@fish-under-sea/dsh-approval-guide 0.2.1 → 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fish-under-sea
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.en.md ADDED
@@ -0,0 +1,29 @@
1
+ # @fish-under-sea/dsh-approval-guide
2
+
3
+ **1.0.0 · Approval Guide**
4
+
5
+ [简体中文](README.md)
6
+
7
+ ## Features
8
+
9
+ Adds Chinese action, risk and rationale explanations to approval prompts for files, commands, network access and privilege changes.
10
+
11
+ ## Installation
12
+
13
+ ```sh
14
+ dsh plugin --profile <profile> add @fish-under-sea/dsh-approval-guide@1.0.0
15
+ ```
16
+
17
+ Also included in `@fish-under-sea/dsh-fish@1.0.0`. Do not expand duplicate rows through both aggregate and standalone bundles. Restart DSH after installation; use the desktop plugin manager when no CLI is available.
18
+
19
+ ## Configuration and Safety
20
+
21
+ Explanatory only: never grants approval or changes sandbox policy.
22
+
23
+ Node requirement: `^22.19.0 || >=24.0.0`. Host compatibility follows this package manifest; the aggregate does not override Host checks.
24
+
25
+ ## Maintenance and Attribution
26
+
27
+ 1.0.0 is a coordinated release number, not a claim that all latest upstream commits are merged. Historical documentation remains in Git; see [aggregate changelog](https://github.com/Fish-under-sea/dsh-fish/blob/main/CHANGELOG.en.md).
28
+
29
+ Fish-native plugin. License: MIT.
package/README.md CHANGED
@@ -1,151 +1,29 @@
1
- <div align="center">
2
-
3
1
  # @fish-under-sea/dsh-approval-guide
4
2
 
5
- **给 DSH 审批弹窗补一段中文说明:这次审批会做什么、有什么风险、依据是什么。**
6
-
7
- [![npm](https://img.shields.io/npm/v/@fish-under-sea/dsh-approval-guide?style=flat-square&label=npm&color=cb3837)](https://www.npmjs.com/package/@fish-under-sea/dsh-approval-guide)
8
- ![license](https://img.shields.io/badge/license-MIT-green?style=flat-square)
9
- ![node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933?style=flat-square)
10
- ![DSH](https://img.shields.io/badge/DSH-%3E%3D0.2.0--rc.2-4b6ef6?style=flat-square)
11
- ![client+host](https://img.shields.io/badge/plugin-client%20%2B%20host-6b7280?style=flat-square)
12
-
13
- </div>
14
-
15
- ## 解决什么问题
16
-
17
- 审批弹窗的框架文案本来就有中文(「等待审批」「拒绝」「允许一次」),但**审批理由由宿主生成,只有英文**。最常见的一条长这样:
18
-
19
- ```text
20
- escalate sandbox to danger-full-access: <模型填写的一句英文理由>
21
- ```
22
-
23
- 读者要自己判断「这条命令到底会做什么、放开到什么程度、有什么后果」,而英文句式把这个判断成本抬高了。本插件在审批理由与命令下方插入中文分级说明,把「会做什么 / 风险 / 依据」三件事讲清楚。
24
-
25
- ## 效果
26
-
27
- 审批卡片内的详情区会变成:
28
-
29
- ```text
30
- <原命令>
31
-
32
- 这次审批会做什么
33
- 把这一次 pwsh 调用的文件沙箱范围提升到「完全放开」(danger-full-access)。
34
- 只对本次调用生效:不产生长期授权,也不影响之后的命令。
35
- 风险
36
- 放开后这条命令不再受工作区边界约束:它可以读写本机任意文件,
37
- 包括系统目录、其它项目、SSH 密钥与凭据文件,
38
- 本次执行也不再逐条征求你的同意。只有在你完全信任这条命令时才应允许。
39
- · 工具:pwsh
40
- · 目标权限:完全放开(danger-full-access)
41
- · 模型给的理由:<原文>
42
- 拿不准就先点「拒绝」:拒绝不会中断对话,之后我可以换成只读、
43
- 或只写工作区内的方式重试。
44
- ```
45
-
46
- 说明一律中文显示,不跟随界面语言——界面切到英文时,中文提示仍然在。
3
+ **1.0.0 · 审批说明**
47
4
 
48
- ### 文案分级
5
+ [English](README.en.md)
49
6
 
50
- 中文说明由**静态规则**生成,不额外调用模型、不消耗 API 额度,也不会被请求方自己的说辞带偏。
7
+ ## 功能
51
8
 
52
- | 目标权限 | 级别 | 风险文案要点 |
53
- | --- | --- | --- |
54
- | `danger-full-access` | 高危(红色标题) | 不再受工作区边界约束,可读写本机任意文件(含系统目录、其它项目、SSH 密钥与凭据文件),本次执行不再逐条审批。 |
55
- | `workspace-write` | 注意 | 可写当前工作区目录及其子目录、系统临时目录;工作区之外仍不能写入。 |
56
- | 其它模式 | 注意 | 不是 DSH 内置模式,无法给出确切范围,提示按请求权限运行。 |
57
- | 无沙箱参数 | 注意 | 通用兜底:工具请求以更高权限执行本次操作,仅本次有效。 |
9
+ 为审批弹窗补充中文动作、风险与依据说明;覆盖文件、命令、网络及权限升级等常见请求。
58
10
 
59
11
  ## 安装
60
12
 
61
13
  ```sh
62
- # 从 npm 安装(推荐)
63
- dsh plugin --profile <profile> add @fish-under-sea/dsh-approval-guide
64
- ```
65
-
66
- `--profile` 后跟本机实际的 profile 名:桌面版 `desktop`,Web 版 `web`。
67
-
68
- 要改源码时才用 `link:` 指向本目录(仓库源码即安装源,改完重启 DSH 即生效):
69
-
70
- ```sh
71
- dsh plugin --profile <profile> add "link:<本目录的绝对路径>"
72
- ```
73
-
74
- 安装后需要**重启 DSH 应用并刷新页面**才会生效(Web 端没有原地重启)。
75
-
76
- ### 卸载
77
-
78
- ```sh
79
- dsh plugin --profile <profile> remove @fish-under-sea/dsh-approval-guide
14
+ dsh plugin --profile <profile> add @fish-under-sea/dsh-approval-guide@1.0.0
80
15
  ```
81
16
 
82
- ### 安装后自检
83
-
84
- ```sh
85
- dsh --profile <profile> --dump-config
86
- ```
87
-
88
- 输出末尾应恰好出现一行 `- id: approval-guide` / `name: @fish-under-sea/dsh-approval-guide`。多行即重复挂载,应用会启动失败。
89
-
90
- ## 使用
91
-
92
- 安装后无需任何操作——插件自动占用审批详情的 `conversation.approval.detail` 插槽,在每次审批弹窗里追加中文说明。
93
-
94
- 说明的取值按「纵深防御」分层:先看工具调用参数 `sandbox_permissions` / `justification`,取不到再解析宿主理由句式(`escalate sandbox to <mode>: <理由>`),再取不到走通用兜底。层层都拿不到时仍然显示通用中文说明。
95
-
96
- 覆盖范围:
97
-
98
- - 所有**带关联工具调用**的交互式审批:沙箱权限升级、hook 触发的 ask、其它插件通过审批通道发起的 ask。
99
-
100
- ## 配置
101
-
102
- **无配置文件。** 本包没有任何配置项,也不读写设置文件——所有规则硬编码在 `lib/client.js` 里。
103
-
104
- ## 兼容与边界
105
-
106
- - 平台:纯浏览器插件(`dsh.client.platform: web`),宿主半区是空实现。
107
- - 占用核心包 `@deepseek-ai/dsh-client-ui-approval` 的 `conversation.approval.detail` 子插槽。该插槽为 `single` 类型,按优先级**升序**排列、**数字最小者渲染**;官方占用者 `ApprovalCommand` 用默认优先级 0,本插件注册 `priority: -1` 覆盖它,并在组件里用同一套逻辑(`useChat` 取关联工具调用、解析 `argsRaw.command`)把命令原文重新渲染回来,不丢信息。
108
- - 组件抛错时,插槽渲染器会回收该条目(abdicate),官方 `ApprovalCommand` 自动恢复渲染——审批卡不会留白,也不会卡住审批流程。
109
- - 兼容 DSH 0.2.0(`useSessionStatus`)与 0.1.x(`useSessionPendingInteraction`)两代选择器。
110
-
111
- 数据源:
112
-
113
- | 数据 | 来源 |
114
- | --- | --- |
115
- | 关联工具调用的命令与参数 | `useChat` 选择器(与官方 `ApprovalCommand` 同款) |
116
- | 工具名与审批理由 | `useSessionPendingInteraction` / `useSessionStatus` 选择器(`kind === 'approval'` 的待办交互) |
117
-
118
- ### 已知限制
119
-
120
- - 审批请求若**不带关联工具调用**(`callId` 缺失),核心不会渲染详情区,本插件也就没有插入位置。这是核心插槽契约决定的,不是本插件可以绕过的。
121
- - 中文说明解释的是「权限范围」这一层风险,不判断命令本身是否安全。命令原文要自己看。
122
- - 宿主若调整理由句式(`escalate sandbox to <mode>: <理由>`),第一层参数取值仍然有效,只有第二层兜底会失效。
123
-
124
- ## 开发与测试
125
-
126
- ```sh
127
- node packages/dsh-approval-guide/test/guide.test.mjs
128
- ```
129
-
130
- 当前 12 个用例全部通过。测试装载的是真正会进浏览器的 `lib/client.js`:用 `node:vm` 提供 `window.__ModuleLoader__`,抓住 bundle 注册的 factory,再用假模块表实例化,直接断言纯函数与组件产出的元素树。**零依赖**,不需要安装 React 或 vitest。
131
-
132
- > 不要用 `node --test test/`:测试运行器会派生子进程并捕获管道输出,在受限沙箱里会以 `EPERM` 失败。直接运行测试文件即可。
133
-
134
- 覆盖的用例:两种沙箱模式的分级文案、理由兜底解析、未知模式、通用审批兜底、参数 JSON 损坏、空输入不抛异常、组件保留命令原文、取不到 pending 时降级、插槽注册优先级。
17
+ 也可安装聚合包 `@fish-under-sea/dsh-fish@1.0.0`。聚合与独立安装不要重复展开相同插件行;安装完成后重启 DSH。桌面环境无 CLI 时使用插件管理器。
135
18
 
136
- 目录结构:
19
+ ## 配置与边界
137
20
 
138
- | 路径 | 作用 |
139
- | --- | --- |
140
- | `lib/index.js` | 宿主半区,空实现(纯浏览器插件) |
141
- | `lib/client.js` | 浏览器半区:中文文案、分级逻辑、审批详情组件、插槽注册 |
142
- | `cordis.patch.yml` | bundle 补丁层,把插件行插入 profile 名册 |
143
- | `test/guide.test.mjs` | 零依赖测试 |
21
+ 仅补充说明,不代替人工审批,不改变沙箱或自动放行。
144
22
 
145
- ## 与聚合包的关系
23
+ Node 要求: `^22.19.0 || >=24.0.0`. DSH 支持范围以本包声明为准;聚合包不覆盖宿主兼容性检查。
146
24
 
147
- > 本包是 [`@fish-under-sea/dsh-fish`](https://github.com/Fish-under-sea/dsh-fish) 聚合包的成员之一;单独安装只影响这一项。
25
+ ## 维护与来源
148
26
 
149
- ## 许可
27
+ 1.0.0 统一发布版本,不表示已合并上游所有最新提交。历史说明保留在 Git 历史中;聚合变更见 [聚合变更记录](https://github.com/Fish-under-sea/dsh-fish/blob/main/CHANGELOG.md).
150
28
 
151
- MIT © Fish-under-sea
29
+ Fish 原生插件。 许可证: MIT.
package/cordis.patch.yml CHANGED
@@ -1,12 +1,12 @@
1
- # dsh-approval-guide bundle layer —— 把插件行插入 web profile 的 roster。
2
- #
3
- # 唯一的一行:宿主半区是空实现(纯浏览器插件),浏览器半区占用
4
- # conversation.approval.detail 插槽渲染中文说明。
5
- #
6
- # 安装(在任意目录执行,profile 名按需替换):
7
- # dsh plugin --profile web add link:<本目录>
8
- #
9
- # 本插件没有任何配置项,也不读写设置文件。
10
- - insert:
11
- - id: approval-guide
1
+ # dsh-approval-guide bundle layer —— 把插件行插入 web profile 的 roster。
2
+ #
3
+ # 唯一的一行:宿主半区是空实现(纯浏览器插件),浏览器半区占用
4
+ # conversation.approval.detail 插槽渲染中文说明。
5
+ #
6
+ # 安装(在任意目录执行,profile 名按需替换):
7
+ # dsh plugin --profile web add link:<本目录>
8
+ #
9
+ # 本插件没有任何配置项,也不读写设置文件。
10
+ - insert:
11
+ - id: approval-guide
12
12
  name: '@fish-under-sea/dsh-approval-guide'
package/lib/client.js CHANGED
@@ -1,273 +1,273 @@
1
- // 注册名必须严格等于 package.json 的 name:loader 按行里解析出的包名去
2
- // factories 里认领 factory(@deepseek-ai/dsh-client-modules 的
3
- // "loaded without registering" 校验),对不上就在浏览器侧加载失败。
4
- window.__ModuleLoader__.load({
5
- id: "@fish-under-sea/dsh-approval-guide",
6
- factory: (require) => {
7
- var module = { exports: {} };
8
- var exports = module.exports;
9
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
10
- const react_jsx_runtime = require("react/jsx-runtime");
11
- //#region 样式:复用外壳的设计令牌,跟随明暗主题
12
- const css = ".dag_root{display:flex;flex-direction:column;gap:8px}.dag_command{color:var(--dsw-alias-label-tertiary);font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Menlo,monospace);word-break:break-all;font-size:13px;line-height:20px}.dag_card{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border-radius:12px;background:var(--dsw-alias-state-warn-tertiary);font-family:var(--dsw-font-family,inherit);word-break:normal}.dag_title{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}.dag_what{color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px}.dag_riskTitle{color:var(--dsw-alias-state-warn-primary);font-size:12px;font-weight:600;line-height:18px;margin-top:2px}.dag_cardDanger .dag_riskTitle{color:var(--dsw-alias-state-error-primary)}.dag_risk{color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px}.dag_check{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;margin-top:2px}.dag_facts{margin:2px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:2px}.dag_fact{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.dag_factLabel{color:var(--dsw-alias-label-secondary)}.dag_factValue{word-break:break-word}";
13
- const tagId = "dsh-approval-guide/ApprovalGuide.module.css";
14
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
15
- const tag = document.createElement("style");
16
- tag.dataset.plugin = "dsh-approval-guide";
17
- tag.dataset.pluginCss = tagId;
18
- tag.textContent = css;
19
- document.head.appendChild(tag);
20
- }
21
- const styles = {
22
- root: "dag_root",
23
- command: "dag_command",
24
- card: "dag_card",
25
- cardDanger: "dag_cardDanger",
26
- title: "dag_title",
27
- what: "dag_what",
28
- riskTitle: "dag_riskTitle",
29
- risk: "dag_risk",
30
- check: "dag_check",
31
- facts: "dag_facts",
32
- fact: "dag_fact",
33
- factLabel: "dag_factLabel",
34
- factValue: "dag_factValue"
35
- };
36
- //#endregion
37
- //#region 中文文案:按沙箱目标模式分级,一律中文显示
38
- /** DSH 内置沙箱模式的中文名。 */
39
- const MODE_LABELS = {
40
- "read-only": "只读(read-only)",
41
- "workspace-write": "工作区可写(workspace-write)",
42
- "danger-full-access": "完全放开(danger-full-access)"
43
- };
44
- /** 危险级别:只有完全放开才标红。 */
45
- const DANGER_MODE = "danger-full-access";
46
- /** 固定的行动建议。 */
47
- const CHECK = "拿不准就先点「拒绝」:拒绝不会中断对话,之后我可以换成只读、或只写工作区内的方式重试。";
48
- /** 找不到工具名时的占位。 */
49
- const UNKNOWN_TOOL = "(未知工具)";
50
- /** 宿主沙箱升级请求的理由句式:`escalate sandbox to <mode>: <理由>`。 */
51
- const SANDBOX_REASON = /^escalate sandbox to\s+([A-Za-z0-9._-]+)\s*:\s*([\s\S]*)$/;
52
- /**
53
- * 解析工具调用的原始参数。
54
- * @param argsRaw - 工具调用参数 JSON 文本。
55
- * @returns 参数对象;缺失或非对象时返回 undefined(绝不抛异常)。
56
- */
57
- function parseCallArgs(argsRaw) {
58
- if (typeof argsRaw !== "string" || argsRaw === "") return void 0;
59
- try {
60
- const parsed = JSON.parse(argsRaw);
61
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return void 0;
62
- return parsed;
63
- } catch {
64
- return void 0;
65
- }
66
- }
67
- /**
68
- * 从宿主给的英文理由句子里解析沙箱升级信息。
69
- * @param reason - 审批理由原文。
70
- * @returns 目标模式与理由;不匹配时返回 undefined。
71
- */
72
- function parseSandboxReason(reason) {
73
- if (typeof reason !== "string") return void 0;
74
- const matched = SANDBOX_REASON.exec(reason);
75
- if (matched === null) return void 0;
76
- const justification = matched[2].trim();
77
- return {
78
- mode: matched[1],
79
- ...justification === "" ? {} : { justification }
80
- };
81
- }
82
- /** 规整工具名。 */
83
- function toolLabelOf(toolName) {
84
- return typeof toolName === "string" && toolName.trim() !== "" ? toolName.trim() : UNKNOWN_TOOL;
85
- }
86
- /** 沙箱升级的中文说明。 */
87
- function sandboxGuide(toolLabel, mode, justification, known) {
88
- const danger = mode === DANGER_MODE;
89
- const shared = `只对本次调用生效:不产生长期授权,也不影响之后的命令。`;
90
- let what;
91
- let risk;
92
- if (danger) {
93
- what = `把这一次 ${toolLabel} 调用的文件沙箱范围提升到「完全放开」(${mode})。${shared}`;
94
- risk = "放开后这条命令不再受工作区边界约束:它可以读写本机任意文件,包括系统目录、其它项目、SSH 密钥与凭据文件,本次执行也不再逐条征求你的同意。只有在你完全信任这条命令时才应允许。";
95
- } else if (mode === "workspace-write") {
96
- what = `把这一次 ${toolLabel} 调用的文件沙箱范围提升到「工作区可写」(${mode})。${shared}`;
97
- risk = "这条命令可以写入当前工作区目录及其子目录,以及系统临时目录;工作区之外的位置仍然不能写入。请留意命令里是否出现工作区以外的写入路径。";
98
- } else if (known) {
99
- what = `把这一次 ${toolLabel} 调用的权限提升到 ${mode}。${shared}`;
100
- risk = "这条命令会按它请求的权限运行,范围不由工作区边界限定。请先确认命令内容确实是你想执行的操作。";
101
- } else {
102
- what = `把这一次 ${toolLabel} 调用的权限提升到 ${mode}。${shared}`;
103
- risk = "这不是 DSH 内置的沙箱模式,无法给出确切范围。批准后该命令会按它请求的权限运行,可能影响工作区之外的内容。请先确认命令内容可信。";
104
- }
105
- return {
106
- level: danger ? "danger" : "caution",
107
- scope: "sandbox-escalation",
108
- what,
109
- risk
110
- };
111
- }
112
- /** 非沙箱升级的通用中文说明。 */
113
- function genericGuide(toolLabel) {
114
- return {
115
- level: "caution",
116
- scope: "generic",
117
- what: `工具 ${toolLabel} 请求以更高权限执行这一次操作。批准只对本次调用生效,不会形成长期授权。`,
118
- risk: "批准后该工具会按它请求的更高权限运行:可能修改工作区之外的文件、执行系统级命令,或访问本机资源。请先核对上方的理由和下面的命令,确认它确实是你想执行的内容。"
119
- };
120
- }
121
- /**
122
- * 为一次审批生成中文说明(纯函数,不读全局状态,不抛异常)。
123
- * @param input - 工具名、审批理由、关联的工具调用参数。
124
- * @returns 会做什么 / 有什么风险 / 判断依据与建议。
125
- */
126
- function explainApproval(input) {
127
- const source = input === undefined || input === null ? {} : input;
128
- const args = source.args;
129
- const toolLabel = toolLabelOf(source.toolName);
130
- const parsed = parseSandboxReason(source.reason);
131
- const argsMode = typeof args?.sandbox_permissions === "string" && args.sandbox_permissions !== "" ? args.sandbox_permissions : void 0;
132
- const mode = argsMode ?? parsed?.mode;
133
- const argsJustification = typeof args?.justification === "string" && args.justification.trim() !== "" ? args.justification.trim() : void 0;
134
- const justification = argsJustification ?? parsed?.justification;
135
- const command = typeof args?.command === "string" && args.command !== "" ? args.command : void 0;
136
- const body = mode === void 0 ? genericGuide(toolLabel) : sandboxGuide(toolLabel, mode, justification, Object.hasOwn(MODE_LABELS, mode));
137
- const facts = [{ label: "工具", value: toolLabel }];
138
- if (mode !== void 0) facts.push({ label: "目标权限", value: MODE_LABELS[mode] ?? mode });
139
- if (justification !== void 0) facts.push({ label: "模型给的理由", value: justification });
140
- return {
141
- ...body,
142
- check: CHECK,
143
- facts,
144
- ...command === void 0 ? {} : { command },
145
- toolName: source.toolName
146
- };
147
- }
148
- //#endregion
149
- //#region 组件:占用「审批详情」插槽,渲染原命令 + 中文说明
150
- /**
151
- * 在 Chat store 里找与审批关联的工具调用根节点。
152
- * @param snapshot - Chat store 快照。
153
- * @param callId - 审批关联的工具调用 id。
154
- * @returns 工具调用根节点;找不到时返回 undefined。
155
- */
156
- function findCorrelatedCall(snapshot, callId) {
157
- if (snapshot === void 0 || snapshot === null || callId === void 0) return void 0;
158
- const nodes = snapshot.nodes;
159
- if (nodes === void 0 || nodes === null || typeof nodes.values !== "function") return void 0;
160
- for (const node of nodes.values()) {
161
- const root = node?.kind === "tool-call" ? node.data?.root : void 0;
162
- if (root !== void 0 && root !== null && root.callId === callId && !("kind" in root)) return root;
163
- }
164
- return void 0;
165
- }
166
- /**
167
- * 审批卡片内的详情区:原文命令 + 中文风险说明。
168
- * @param props - 插槽标准属性(callId、会话、chat 与待办交互选择器)。
169
- * @returns 详情区元素。
170
- */
171
- function ApprovalGuide(props) {
172
- // 插槽标准属性在 DSH 0.2.0 改名:useSessionPendingInteraction → useSessionStatus,
173
- // 且选择器形状由「会话 Map」变为「会话状态快照」。这里同时兼容两代宿主:
174
- // 0.2.0 走 useSessionStatus(snapshot => snapshot.get(id)?.pendingInteraction),
175
- // 0.1.x 回退 useSessionPendingInteraction(bySession => bySession.get(id))。
176
- const readStatus = props.useSessionStatus;
177
- const readPendingLegacy = props.useSessionPendingInteraction;
178
- const pending = typeof readStatus === "function" ? readStatus((snapshot) => snapshot === void 0 || snapshot === null ? void 0 : snapshot.get(props.sessionId)?.pendingInteraction) : typeof readPendingLegacy === "function" ? readPendingLegacy((bySession) => bySession === void 0 || bySession === null ? void 0 : bySession.get(props.sessionId)) : void 0;
179
- const approval = pending !== void 0 && pending !== null && pending.kind === "approval" ? pending : void 0;
180
- const readChat = props.useChat;
181
- const argsRaw = typeof readChat === "function" ? readChat((snapshot) => {
182
- const call = findCorrelatedCall(snapshot, props.callId);
183
- return call === void 0 || call === null ? void 0 : call.argsRaw;
184
- }) : void 0;
185
- const guide = explainApproval({
186
- toolName: approval === void 0 ? void 0 : approval.toolName,
187
- reason: approval === void 0 ? void 0 : approval.reason,
188
- args: parseCallArgs(argsRaw)
189
- });
190
- const children = [];
191
- if (guide.command !== void 0) children.push((0, react_jsx_runtime.jsx)("div", {
192
- className: styles.command,
193
- children: guide.command
194
- }, "command"));
195
- const card = [
196
- (0, react_jsx_runtime.jsx)("div", {
197
- className: styles.title,
198
- children: "这次审批会做什么"
199
- }, "whatTitle"),
200
- (0, react_jsx_runtime.jsx)("div", {
201
- className: styles.what,
202
- children: guide.what
203
- }, "what"),
204
- (0, react_jsx_runtime.jsx)("div", {
205
- className: styles.riskTitle,
206
- children: "风险"
207
- }, "riskTitle"),
208
- (0, react_jsx_runtime.jsx)("div", {
209
- className: styles.risk,
210
- children: guide.risk
211
- }, "risk")
212
- ];
213
- if (guide.facts.length > 0) card.push((0, react_jsx_runtime.jsx)("ul", {
214
- className: styles.facts,
215
- children: guide.facts.map((fact, index) => (0, react_jsx_runtime.jsx)("li", {
216
- className: styles.fact,
217
- children: [(0, react_jsx_runtime.jsx)("span", {
218
- className: styles.factLabel,
219
- children: `${fact.label}:`
220
- }, "label"), (0, react_jsx_runtime.jsx)("span", {
221
- className: styles.factValue,
222
- children: fact.value
223
- }, "value")]
224
- }, `fact-${String(index)}`))
225
- }, "facts"));
226
- card.push((0, react_jsx_runtime.jsx)("div", {
227
- className: styles.check,
228
- children: guide.check
229
- }, "check"));
230
- children.push((0, react_jsx_runtime.jsx)("div", {
231
- className: guide.level === "danger" ? `${styles.card} ${styles.cardDanger}` : styles.card,
232
- children: card
233
- }, "guide"));
234
- return (0, react_jsx_runtime.jsx)("div", {
235
- className: styles.root,
236
- "data-approval-guide": guide.scope,
237
- children
238
- });
239
- }
240
- //#endregion
241
- //#region 插件挂载
242
- /** 必需服务:插槽注册表。 */
243
- const inject = ["slots"];
244
- /**
245
- * 把中文说明挂到审批详情插槽。
246
- *
247
- * `conversation.approval.detail` 是 single 插槽,官方占用者是
248
- * `@deepseek-ai/dsh-client-ui-chat` 的 ApprovalCommand(默认优先级 0);
249
- * single 插槽同级注册会直接报错,且优先级数字最小者渲染,因此这里用 -1
250
- * 覆盖它,并在组件里自己把原始命令重新渲染回来。组件崩溃时条目会被
251
- * 回收(abdicate),自动退回官方实现,不会留下空白审批卡。
252
- *
253
- * @param ctx - 客户端根上下文。
254
- */
255
- function apply(ctx) {
256
- ctx.slots.inject("conversation.approval.detail", () => ctx.slots.register({
257
- name: "conversation.approval.detail",
258
- priority: -1
259
- }, ApprovalGuide));
260
- }
261
- //#endregion
262
- exports.apply = apply;
263
- exports.inject = inject;
264
- exports.__internals = {
265
- ApprovalGuide,
266
- explainApproval,
267
- parseCallArgs,
268
- parseSandboxReason,
269
- findCorrelatedCall
270
- };
271
- return module.exports;
272
- }
1
+ // 注册名必须严格等于 package.json 的 name:loader 按行里解析出的包名去
2
+ // factories 里认领 factory(@deepseek-ai/dsh-client-modules 的
3
+ // "loaded without registering" 校验),对不上就在浏览器侧加载失败。
4
+ window.__ModuleLoader__.load({
5
+ id: "@fish-under-sea/dsh-approval-guide",
6
+ factory: (require) => {
7
+ var module = { exports: {} };
8
+ var exports = module.exports;
9
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
10
+ const react_jsx_runtime = require("react/jsx-runtime");
11
+ //#region 样式:复用外壳的设计令牌,跟随明暗主题
12
+ const css = ".dag_root{display:flex;flex-direction:column;gap:8px}.dag_command{color:var(--dsw-alias-label-tertiary);font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Menlo,monospace);word-break:break-all;font-size:13px;line-height:20px}.dag_card{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border-radius:12px;background:var(--dsw-alias-state-warn-tertiary);font-family:var(--dsw-font-family,inherit);word-break:normal}.dag_title{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}.dag_what{color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px}.dag_riskTitle{color:var(--dsw-alias-state-warn-primary);font-size:12px;font-weight:600;line-height:18px;margin-top:2px}.dag_cardDanger .dag_riskTitle{color:var(--dsw-alias-state-error-primary)}.dag_risk{color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px}.dag_check{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;margin-top:2px}.dag_facts{margin:2px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:2px}.dag_fact{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.dag_factLabel{color:var(--dsw-alias-label-secondary)}.dag_factValue{word-break:break-word}";
13
+ const tagId = "dsh-approval-guide/ApprovalGuide.module.css";
14
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
15
+ const tag = document.createElement("style");
16
+ tag.dataset.plugin = "dsh-approval-guide";
17
+ tag.dataset.pluginCss = tagId;
18
+ tag.textContent = css;
19
+ document.head.appendChild(tag);
20
+ }
21
+ const styles = {
22
+ root: "dag_root",
23
+ command: "dag_command",
24
+ card: "dag_card",
25
+ cardDanger: "dag_cardDanger",
26
+ title: "dag_title",
27
+ what: "dag_what",
28
+ riskTitle: "dag_riskTitle",
29
+ risk: "dag_risk",
30
+ check: "dag_check",
31
+ facts: "dag_facts",
32
+ fact: "dag_fact",
33
+ factLabel: "dag_factLabel",
34
+ factValue: "dag_factValue"
35
+ };
36
+ //#endregion
37
+ //#region 中文文案:按沙箱目标模式分级,一律中文显示
38
+ /** DSH 内置沙箱模式的中文名。 */
39
+ const MODE_LABELS = {
40
+ "read-only": "只读(read-only)",
41
+ "workspace-write": "工作区可写(workspace-write)",
42
+ "danger-full-access": "完全放开(danger-full-access)"
43
+ };
44
+ /** 危险级别:只有完全放开才标红。 */
45
+ const DANGER_MODE = "danger-full-access";
46
+ /** 固定的行动建议。 */
47
+ const CHECK = "拿不准就先点「拒绝」:拒绝不会中断对话,之后我可以换成只读、或只写工作区内的方式重试。";
48
+ /** 找不到工具名时的占位。 */
49
+ const UNKNOWN_TOOL = "(未知工具)";
50
+ /** 宿主沙箱升级请求的理由句式:`escalate sandbox to <mode>: <理由>`。 */
51
+ const SANDBOX_REASON = /^escalate sandbox to\s+([A-Za-z0-9._-]+)\s*:\s*([\s\S]*)$/;
52
+ /**
53
+ * 解析工具调用的原始参数。
54
+ * @param argsRaw - 工具调用参数 JSON 文本。
55
+ * @returns 参数对象;缺失或非对象时返回 undefined(绝不抛异常)。
56
+ */
57
+ function parseCallArgs(argsRaw) {
58
+ if (typeof argsRaw !== "string" || argsRaw === "") return void 0;
59
+ try {
60
+ const parsed = JSON.parse(argsRaw);
61
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return void 0;
62
+ return parsed;
63
+ } catch {
64
+ return void 0;
65
+ }
66
+ }
67
+ /**
68
+ * 从宿主给的英文理由句子里解析沙箱升级信息。
69
+ * @param reason - 审批理由原文。
70
+ * @returns 目标模式与理由;不匹配时返回 undefined。
71
+ */
72
+ function parseSandboxReason(reason) {
73
+ if (typeof reason !== "string") return void 0;
74
+ const matched = SANDBOX_REASON.exec(reason);
75
+ if (matched === null) return void 0;
76
+ const justification = matched[2].trim();
77
+ return {
78
+ mode: matched[1],
79
+ ...justification === "" ? {} : { justification }
80
+ };
81
+ }
82
+ /** 规整工具名。 */
83
+ function toolLabelOf(toolName) {
84
+ return typeof toolName === "string" && toolName.trim() !== "" ? toolName.trim() : UNKNOWN_TOOL;
85
+ }
86
+ /** 沙箱升级的中文说明。 */
87
+ function sandboxGuide(toolLabel, mode, justification, known) {
88
+ const danger = mode === DANGER_MODE;
89
+ const shared = `只对本次调用生效:不产生长期授权,也不影响之后的命令。`;
90
+ let what;
91
+ let risk;
92
+ if (danger) {
93
+ what = `把这一次 ${toolLabel} 调用的文件沙箱范围提升到「完全放开」(${mode})。${shared}`;
94
+ risk = "放开后这条命令不再受工作区边界约束:它可以读写本机任意文件,包括系统目录、其它项目、SSH 密钥与凭据文件,本次执行也不再逐条征求你的同意。只有在你完全信任这条命令时才应允许。";
95
+ } else if (mode === "workspace-write") {
96
+ what = `把这一次 ${toolLabel} 调用的文件沙箱范围提升到「工作区可写」(${mode})。${shared}`;
97
+ risk = "这条命令可以写入当前工作区目录及其子目录,以及系统临时目录;工作区之外的位置仍然不能写入。请留意命令里是否出现工作区以外的写入路径。";
98
+ } else if (known) {
99
+ what = `把这一次 ${toolLabel} 调用的权限提升到 ${mode}。${shared}`;
100
+ risk = "这条命令会按它请求的权限运行,范围不由工作区边界限定。请先确认命令内容确实是你想执行的操作。";
101
+ } else {
102
+ what = `把这一次 ${toolLabel} 调用的权限提升到 ${mode}。${shared}`;
103
+ risk = "这不是 DSH 内置的沙箱模式,无法给出确切范围。批准后该命令会按它请求的权限运行,可能影响工作区之外的内容。请先确认命令内容可信。";
104
+ }
105
+ return {
106
+ level: danger ? "danger" : "caution",
107
+ scope: "sandbox-escalation",
108
+ what,
109
+ risk
110
+ };
111
+ }
112
+ /** 非沙箱升级的通用中文说明。 */
113
+ function genericGuide(toolLabel) {
114
+ return {
115
+ level: "caution",
116
+ scope: "generic",
117
+ what: `工具 ${toolLabel} 请求以更高权限执行这一次操作。批准只对本次调用生效,不会形成长期授权。`,
118
+ risk: "批准后该工具会按它请求的更高权限运行:可能修改工作区之外的文件、执行系统级命令,或访问本机资源。请先核对上方的理由和下面的命令,确认它确实是你想执行的内容。"
119
+ };
120
+ }
121
+ /**
122
+ * 为一次审批生成中文说明(纯函数,不读全局状态,不抛异常)。
123
+ * @param input - 工具名、审批理由、关联的工具调用参数。
124
+ * @returns 会做什么 / 有什么风险 / 判断依据与建议。
125
+ */
126
+ function explainApproval(input) {
127
+ const source = input === undefined || input === null ? {} : input;
128
+ const args = source.args;
129
+ const toolLabel = toolLabelOf(source.toolName);
130
+ const parsed = parseSandboxReason(source.reason);
131
+ const argsMode = typeof args?.sandbox_permissions === "string" && args.sandbox_permissions !== "" ? args.sandbox_permissions : void 0;
132
+ const mode = argsMode ?? parsed?.mode;
133
+ const argsJustification = typeof args?.justification === "string" && args.justification.trim() !== "" ? args.justification.trim() : void 0;
134
+ const justification = argsJustification ?? parsed?.justification;
135
+ const command = typeof args?.command === "string" && args.command !== "" ? args.command : void 0;
136
+ const body = mode === void 0 ? genericGuide(toolLabel) : sandboxGuide(toolLabel, mode, justification, Object.hasOwn(MODE_LABELS, mode));
137
+ const facts = [{ label: "工具", value: toolLabel }];
138
+ if (mode !== void 0) facts.push({ label: "目标权限", value: MODE_LABELS[mode] ?? mode });
139
+ if (justification !== void 0) facts.push({ label: "模型给的理由", value: justification });
140
+ return {
141
+ ...body,
142
+ check: CHECK,
143
+ facts,
144
+ ...command === void 0 ? {} : { command },
145
+ toolName: source.toolName
146
+ };
147
+ }
148
+ //#endregion
149
+ //#region 组件:占用「审批详情」插槽,渲染原命令 + 中文说明
150
+ /**
151
+ * 在 Chat store 里找与审批关联的工具调用根节点。
152
+ * @param snapshot - Chat store 快照。
153
+ * @param callId - 审批关联的工具调用 id。
154
+ * @returns 工具调用根节点;找不到时返回 undefined。
155
+ */
156
+ function findCorrelatedCall(snapshot, callId) {
157
+ if (snapshot === void 0 || snapshot === null || callId === void 0) return void 0;
158
+ const nodes = snapshot.nodes;
159
+ if (nodes === void 0 || nodes === null || typeof nodes.values !== "function") return void 0;
160
+ for (const node of nodes.values()) {
161
+ const root = node?.kind === "tool-call" ? node.data?.root : void 0;
162
+ if (root !== void 0 && root !== null && root.callId === callId && !("kind" in root)) return root;
163
+ }
164
+ return void 0;
165
+ }
166
+ /**
167
+ * 审批卡片内的详情区:原文命令 + 中文风险说明。
168
+ * @param props - 插槽标准属性(callId、会话、chat 与待办交互选择器)。
169
+ * @returns 详情区元素。
170
+ */
171
+ function ApprovalGuide(props) {
172
+ // 插槽标准属性在 DSH 0.2.0 改名:useSessionPendingInteraction → useSessionStatus,
173
+ // 且选择器形状由「会话 Map」变为「会话状态快照」。这里同时兼容两代宿主:
174
+ // 0.2.0 走 useSessionStatus(snapshot => snapshot.get(id)?.pendingInteraction),
175
+ // 0.1.x 回退 useSessionPendingInteraction(bySession => bySession.get(id))。
176
+ const readStatus = props.useSessionStatus;
177
+ const readPendingLegacy = props.useSessionPendingInteraction;
178
+ const pending = typeof readStatus === "function" ? readStatus((snapshot) => snapshot === void 0 || snapshot === null ? void 0 : snapshot.get(props.sessionId)?.pendingInteraction) : typeof readPendingLegacy === "function" ? readPendingLegacy((bySession) => bySession === void 0 || bySession === null ? void 0 : bySession.get(props.sessionId)) : void 0;
179
+ const approval = pending !== void 0 && pending !== null && pending.kind === "approval" ? pending : void 0;
180
+ const readChat = props.useChat;
181
+ const argsRaw = typeof readChat === "function" ? readChat((snapshot) => {
182
+ const call = findCorrelatedCall(snapshot, props.callId);
183
+ return call === void 0 || call === null ? void 0 : call.argsRaw;
184
+ }) : void 0;
185
+ const guide = explainApproval({
186
+ toolName: approval === void 0 ? void 0 : approval.toolName,
187
+ reason: approval === void 0 ? void 0 : approval.reason,
188
+ args: parseCallArgs(argsRaw)
189
+ });
190
+ const children = [];
191
+ if (guide.command !== void 0) children.push((0, react_jsx_runtime.jsx)("div", {
192
+ className: styles.command,
193
+ children: guide.command
194
+ }, "command"));
195
+ const card = [
196
+ (0, react_jsx_runtime.jsx)("div", {
197
+ className: styles.title,
198
+ children: "这次审批会做什么"
199
+ }, "whatTitle"),
200
+ (0, react_jsx_runtime.jsx)("div", {
201
+ className: styles.what,
202
+ children: guide.what
203
+ }, "what"),
204
+ (0, react_jsx_runtime.jsx)("div", {
205
+ className: styles.riskTitle,
206
+ children: "风险"
207
+ }, "riskTitle"),
208
+ (0, react_jsx_runtime.jsx)("div", {
209
+ className: styles.risk,
210
+ children: guide.risk
211
+ }, "risk")
212
+ ];
213
+ if (guide.facts.length > 0) card.push((0, react_jsx_runtime.jsx)("ul", {
214
+ className: styles.facts,
215
+ children: guide.facts.map((fact, index) => (0, react_jsx_runtime.jsx)("li", {
216
+ className: styles.fact,
217
+ children: [(0, react_jsx_runtime.jsx)("span", {
218
+ className: styles.factLabel,
219
+ children: `${fact.label}:`
220
+ }, "label"), (0, react_jsx_runtime.jsx)("span", {
221
+ className: styles.factValue,
222
+ children: fact.value
223
+ }, "value")]
224
+ }, `fact-${String(index)}`))
225
+ }, "facts"));
226
+ card.push((0, react_jsx_runtime.jsx)("div", {
227
+ className: styles.check,
228
+ children: guide.check
229
+ }, "check"));
230
+ children.push((0, react_jsx_runtime.jsx)("div", {
231
+ className: guide.level === "danger" ? `${styles.card} ${styles.cardDanger}` : styles.card,
232
+ children: card
233
+ }, "guide"));
234
+ return (0, react_jsx_runtime.jsx)("div", {
235
+ className: styles.root,
236
+ "data-approval-guide": guide.scope,
237
+ children
238
+ });
239
+ }
240
+ //#endregion
241
+ //#region 插件挂载
242
+ /** 必需服务:插槽注册表。 */
243
+ const inject = ["slots"];
244
+ /**
245
+ * 把中文说明挂到审批详情插槽。
246
+ *
247
+ * `conversation.approval.detail` 是 single 插槽,官方占用者是
248
+ * `@deepseek-ai/dsh-client-ui-chat` 的 ApprovalCommand(默认优先级 0);
249
+ * single 插槽同级注册会直接报错,且优先级数字最小者渲染,因此这里用 -1
250
+ * 覆盖它,并在组件里自己把原始命令重新渲染回来。组件崩溃时条目会被
251
+ * 回收(abdicate),自动退回官方实现,不会留下空白审批卡。
252
+ *
253
+ * @param ctx - 客户端根上下文。
254
+ */
255
+ function apply(ctx) {
256
+ ctx.slots.inject("conversation.approval.detail", () => ctx.slots.register({
257
+ name: "conversation.approval.detail",
258
+ priority: -1
259
+ }, ApprovalGuide));
260
+ }
261
+ //#endregion
262
+ exports.apply = apply;
263
+ exports.inject = inject;
264
+ exports.__internals = {
265
+ ApprovalGuide,
266
+ explainApproval,
267
+ parseCallArgs,
268
+ parseSandboxReason,
269
+ findCorrelatedCall
270
+ };
271
+ return module.exports;
272
+ }
273
273
  });
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- //#region src/index.ts
2
- /** 宿主半区:本插件是纯浏览器插件,宿主侧没有任何行为。 */
3
- function apply(_ctx) {}
4
- //#endregion
1
+ //#region src/index.ts
2
+ /** 宿主半区:本插件是纯浏览器插件,宿主侧没有任何行为。 */
3
+ function apply(_ctx) {}
4
+ //#endregion
5
5
  export { apply };
package/package.json CHANGED
@@ -1,55 +1,57 @@
1
- {
2
- "name": "@fish-under-sea/dsh-approval-guide",
3
- "version": "0.2.1",
4
- "description": "在 DSH Web GUI 的审批弹窗里追加中文说明:这次审批会做什么、有什么风险、依据是什么。原英文理由与命令原文保留显示。",
5
- "type": "module",
6
- "main": "./lib/index.js",
7
- "exports": {
8
- ".": {
9
- "default": "./lib/index.js"
10
- },
11
- "./client": {
12
- "default": "./lib/client.js"
13
- },
14
- "./package.json": "./package.json"
15
- },
16
- "files": [
17
- "lib",
18
- "cordis.patch.yml",
19
- "README.md"
20
- ],
21
- "license": "MIT",
22
- "publishConfig": {
23
- "access": "public"
24
- },
25
- "engines": {
26
- "node": "^22.19.0 || >=24.0.0"
27
- },
28
- "keywords": [
29
- "dsh",
30
- "dsh-plugin",
31
- "approval",
32
- "sandbox",
33
- "chinese"
34
- ],
35
- "scripts": {
36
- "test": "node test/guide.test.mjs"
37
- },
38
- "repository": {
39
- "type": "git",
40
- "url": "https://github.com/Fish-under-sea/dsh-fish.git",
41
- "directory": "packages/dsh-approval-guide"
42
- },
43
- "dsh": {
44
- "engines": {
45
- "dsh": ">=0.2.0-rc.2"
46
- },
47
- "bundle": {
48
- "patch": "./cordis.patch.yml"
49
- },
50
- "client": {
51
- "inject": [],
52
- "platform": "web"
53
- }
54
- }
55
- }
1
+ {
2
+ "name": "@fish-under-sea/dsh-approval-guide",
3
+ "version": "1.0.0",
4
+ "description": "在 DSH Web GUI 的审批弹窗里追加中文说明:这次审批会做什么、有什么风险、依据是什么。原英文理由与命令原文保留显示。",
5
+ "type": "module",
6
+ "main": "./lib/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "default": "./lib/index.js"
10
+ },
11
+ "./client": {
12
+ "default": "./lib/client.js"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "lib",
18
+ "cordis.patch.yml",
19
+ "README.md",
20
+ "README.en.md",
21
+ "LICENSE"
22
+ ],
23
+ "license": "MIT",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "engines": {
28
+ "node": "^22.19.0 || >=24.0.0"
29
+ },
30
+ "keywords": [
31
+ "dsh",
32
+ "dsh-plugin",
33
+ "approval",
34
+ "sandbox",
35
+ "chinese"
36
+ ],
37
+ "scripts": {
38
+ "test": "node test/guide.test.mjs"
39
+ },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/Fish-under-sea/dsh-fish.git",
43
+ "directory": "packages/dsh-approval-guide"
44
+ },
45
+ "dsh": {
46
+ "engines": {
47
+ "dsh": ">=0.2.0-rc.2"
48
+ },
49
+ "bundle": {
50
+ "patch": "./cordis.patch.yml"
51
+ },
52
+ "client": {
53
+ "inject": [],
54
+ "platform": "web"
55
+ }
56
+ }
57
+ }