dsh-mcviseron-plugin 0.6.1 → 0.6.2
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 +10 -0
- package/README.en.md +1 -1
- package/README.md +7 -6
- package/docs/automation-task.md +1 -1
- package/docs/release.md +8 -6
- package/lib/auto-review-fix.js +124 -7
- package/lib/client.js +4 -4
- package/lib/index.js +257 -25
- package/lib/task-guard.js +122 -7
- package/package.json +1 -1
- package/src/client/locales.ts +4 -4
- package/src/components/auto-review-fix/index.ts +150 -6
- package/src/components/auto-review-fix/translate.ts +15 -2
- package/src/components/task-guard/index.ts +184 -9
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
- Restart 组件支持 macOS/Linux(当前仅 Windows 桌面版)。
|
|
12
12
|
- 把定时巡检任务 prompt 更新为当前单条目架构。
|
|
13
13
|
|
|
14
|
+
## [0.6.2] - 2026-10-21
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **Todo 守卫更新不顺畅**:新增**阶段完成检测**,从 agent/assistant-stream 的正文/思考中识别「All 46 nets routed」「DRC passes clean」「原理图完成」等完成语句,并用中英文阶段关键词(schematic/原理图、routing/布线、DRC/校验 等)匹配当前 in_progress todo;命中时附一条带可直接发送 todo_write JSON 的定向 notice(每步最多一次)。
|
|
19
|
+
- **停滞提醒更可执行**:不再写「请忽略本提醒」;只有一个进行中任务时,notice 直接给出「当前阶段 completed、下一阶段 in_progress」的 payload,模型只需原样发送。
|
|
20
|
+
- **含中文引用的英文审查理由漏翻**:旧逻辑只要审查正文里出现**任意** CJK 字符就判定“已经是中文”并跳过翻译,导致夹带用户原话(「这个提示框似乎卡住了?」)或中文路径(`D:\文档\...`)的英文理由整段保持英文。改为**以中文为主**判断(中文字符数 vs 英文词数),这类英文理由会正常追加 `【审查理由 · 中文翻译】`。
|
|
21
|
+
- **转手动审批被拒理由回传**:auto-review-fix 在 `approval.request` 返回 `rejected` 且属于 Auto review 时,把自动审查理由(含译文)作为 `plugin:auto-review-fix` notice 附到该工具结果的 `additionalContexts`;AI 下一次能看到被拒理由。DSH 审批面板没有人类理由输入,因此回传的是自动审查理由。
|
|
22
|
+
- 合计 **83 项测试**。
|
|
23
|
+
|
|
14
24
|
## [0.6.1] - 2026-10-19
|
|
15
25
|
|
|
16
26
|
### Added
|
package/README.en.md
CHANGED
|
@@ -109,7 +109,7 @@ Defaults: appearance off / `08:00–23:00`; auto-review both guards on, 6 s, 400
|
|
|
109
109
|
|
|
110
110
|
| DSH version | Status |
|
|
111
111
|
| --- | --- |
|
|
112
|
-
| `0.2.1-rc.2` | ✅ verified (desktop profile;
|
|
112
|
+
| `0.2.1-rc.2` | ✅ verified (desktop profile; 83 tests + real Cordis contexts) |
|
|
113
113
|
| `0.2.0-rc.x` | ✅ covered by the peer range |
|
|
114
114
|
| `0.1.x` | ❌ unsupported (different settings-namespace model) |
|
|
115
115
|
|
package/README.md
CHANGED
|
@@ -26,19 +26,20 @@ MCviseron 的 **DeepSeek Harness(DSH)总插件**:一个 npm 包、一个 `
|
|
|
26
26
|
### 2. Auto review 修复
|
|
27
27
|
|
|
28
28
|
1. **关机预设守卫**:Auto review 在卸载时会调用 `permissionPresets.set` 把仍处于 Auto 的会话改成 `danger-full-access`。整套宿主退出时这是错误落盘;组件在根 Cordis fiber 不是 `ACTIVE` 时丢弃该写入(运行中移除插件仍然照常迁移)。
|
|
29
|
-
2. **审批理由中文译文**:自动审查拒绝并转人工审批时,`displayReason` 里的英文审查理由原样保留,只在本地化文本末尾追加 `【审查理由 · 中文翻译】`
|
|
29
|
+
2. **审批理由中文译文**:自动审查拒绝并转人工审批时,`displayReason` 里的英文审查理由原样保留,只在本地化文本末尾追加 `【审查理由 · 中文翻译】` 段落;同时把同一段译文追加到 `reason` 末尾(审计原文保持开头不变),让只读取 `approval/asked` 的邮箱兜底也能收到译文。
|
|
30
|
+
3. **转手动被拒理由回传**:当 `approval.request` 返回 `rejected` 且该审批来自 Auto review 时,组件把自动审查理由(含译文)作为 `plugin:auto-review-fix` notice 附到该工具结果的 `additionalContexts`;AI 下一次就能看到「为什么被拒」,而不是只看到 `the user rejected tool ...`。注意:DSH 审批面板目前没有人类理由输入框,回传的是自动审查理由。
|
|
30
31
|
|
|
31
32
|
翻译使用当前会话的 provider/model 再发一次短请求(可选固定 provider/model),按原文缓存(进程内,上限 256),超时 6 秒可配。**任何失败都原样放行审批**:没有 `llm`、没有会话路由、宿主没有 `displayReason`、超时、模型报错——都不会阻塞审批,也不会改写审查文本。
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
只有审查理由**本身以中文为主**时才跳过翻译;英文理由里夹带的中文引用(例如用户原话「这个提示框似乎卡住了?」)或 Windows 中文路径(`D:\文档\...`)不会再被误判成中文而漏翻。
|
|
34
35
|
|
|
35
36
|
### 3. Todo 计划守卫
|
|
36
37
|
|
|
37
38
|
- `todo_write` 后如果还有 `pending`、却没有 `in_progress`:附一条**建议性 notice**(默认不把写入变成错误)。
|
|
38
|
-
- 连续 N 次成功工具调用没更新 todo:再附一条停滞 notice(默认 5 次后首发,之后每 4
|
|
39
|
+
- 连续 N 次成功工具调用没更新 todo:再附一条停滞 notice(默认 5 次后首发,之后每 4 次重复);如果只有一个进行中任务,notice 里直接给出「当前完成、下一阶段 in_progress」的 `todo_write` payload,不再写「请忽略本提醒」。
|
|
39
40
|
- 都通过官方 `tools/post-execute` 的 `additionalContexts` 送达,不注册 system prompt 段落,不注入用户提示词。
|
|
40
41
|
- 可选严格模式:`rejectMissingActive: true` 拒绝缺少 active 的写入;`blockAfterCalls: N` 在停滞过久时硬拦截下一次工具调用。
|
|
41
|
-
-
|
|
42
|
+
- **步骤意图 + 阶段完成检测**(`detectStepIntent`):监听官方 `agent/assistant-stream`,识别「Now I will …」「接下来…」「Now building the PCB」等步骤意图,以及「All 46 nets routed」「DRC passes clean」「原理图完成」等阶段完成语句。意图按中英文阶段关键词(schematic/原理图、routing/布线、DRC/校验 等)匹配 `pending` todo;完成语句匹配当前 `in_progress` todo。命中时附一条**定向 notice**(每条消息最多一次),带可直接发送的 `todo_write` JSON;不匹配、没有流、解析失败都静默跳过,**绝不阻塞任务**。
|
|
42
43
|
- **中文 todo 展示**(`translateTodoContent`):notice 里的英文 todo 标题会经 `llm` 批量翻译成「中文(English)」显示,按标题缓存、超时 3 秒可配;翻译失败就显示原文。notice 里还会提示「todo 内容可以直接用中文书写」。**只影响 notice 展示,不改写模型写入的 todo 列表**。
|
|
43
44
|
- notice 的 source kind 按会话格式自动选择:v4 用 `plugin:task-guard`,v3 用 `plugin` + `plugin: 'task-guard'`。
|
|
44
45
|
|
|
@@ -194,7 +195,7 @@ DSH 0.2 的官方设置 apiproxy 不向浏览器暴露第三方命名空间,
|
|
|
194
195
|
|
|
195
196
|
| DSH 版本 | 状态 |
|
|
196
197
|
| --- | --- |
|
|
197
|
-
| `0.2.1-rc.2` | ✅ 本版本验证(desktop profile;
|
|
198
|
+
| `0.2.1-rc.2` | ✅ 本版本验证(desktop profile;83 项测试 + 真实 Cordis 上下文) |
|
|
198
199
|
| `0.2.0-rc.x` | ✅ peer 范围覆盖(同一套设置、审批与 hook 接缝) |
|
|
199
200
|
| `0.1.x` | ❌ 不支持:0.1 的插件自行注册设置命名空间,与本插件的条目 id 命名空间模型不同 |
|
|
200
201
|
|
|
@@ -260,7 +261,7 @@ test/
|
|
|
260
261
|
|
|
261
262
|
```bash
|
|
262
263
|
pnpm install
|
|
263
|
-
pnpm check # typecheck +
|
|
264
|
+
pnpm check # typecheck + 83 项测试 + 构建
|
|
264
265
|
```
|
|
265
266
|
|
|
266
267
|
构建产物:`lib/index.js`(master ESM)、`lib/appearance.js`、`lib/auto-review-fix.js`、`lib/task-guard.js`、`lib/restart.js` 与 `lib/client.js`(浏览器模块)。`lib/` 不入库。
|
package/docs/automation-task.md
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
3. 若发布了新版本:
|
|
39
39
|
a. 执行 pnpm install,把 @deepseek-ai/dsh-client-connection、dsh-client-locale、dsh-client-ui-settings、dsh-client-ui-slots、dsh-client-ui-renderer、dsh-host-webserver、dsh-settings、@deepseek-ai/cordis 的开发依赖升级到与最新 DSH 相同版本,并更新 peerDependencies 范围。
|
|
40
40
|
b. 对照最新包的类型声明与 lib 实现,按组件逐层修复不兼容处(先 Host 设置桥,再 autoReview、taskGuard,最后浏览器外观行)。
|
|
41
|
-
c. 执行 pnpm check(tsc --noEmit +
|
|
41
|
+
c. 执行 pnpm check(tsc --noEmit + 83 项 node 测试 + esbuild 构建),补齐或修正测试;必要时更新 test/plugin.test.ts 的装配断言。
|
|
42
42
|
d. 更新 CHANGELOG.md(新版本段落记录兼容版本与修复)、README.md / README.en.md 的兼容性表;提交并推送到 main。
|
|
43
43
|
4. 不要执行 npm publish;不要重启或关闭正在运行的 DSH;不要修改 D:\Program\DSH-Plugin-Class 下的其他插件仓库。
|
|
44
44
|
|
package/docs/release.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# 发布 dsh-mcviseron-plugin 到 npm
|
|
2
2
|
|
|
3
|
-
## 当前状态(2026-10-
|
|
3
|
+
## 当前状态(2026-10-21)
|
|
4
4
|
|
|
5
|
-
- 包名 **`dsh-mcviseron-plugin`
|
|
5
|
+
- 包名 **`dsh-mcviseron-plugin` 已发布 0.6.1**,npm 上 `latest` 为 0.6.1;**v0.6.2 由 Trusted Publishing 自动发布**。
|
|
6
6
|
- npm 账号 `mcviseron` 已恢复正常,可执行首次手动发布。
|
|
7
7
|
- 本机全局 registry 指向 npmmirror,发布时必须显式指定 `--registry=https://registry.npmjs.org/`。
|
|
8
|
-
- 首次发布 **v0.6.1
|
|
8
|
+
- 首次发布 **v0.6.1 已手动完成**;从 **v0.6.2** 起由 `.github/workflows/publish.yml` 通过 OIDC Trusted Publishing 发布。
|
|
9
9
|
|
|
10
10
|
## 首次发布(账号解冻后)
|
|
11
11
|
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
```powershell
|
|
50
50
|
npm view dsh-mcviseron-plugin version dist-tags.latest --registry=https://registry.npmjs.org/
|
|
51
|
-
curl.exe -sI https://registry.npmjs.org/dsh-mcviseron-plugin/-/dsh-mcviseron-plugin-0.6.
|
|
51
|
+
curl.exe -sI https://registry.npmjs.org/dsh-mcviseron-plugin/-/dsh-mcviseron-plugin-0.6.2.tgz | Select-Object -First 1
|
|
52
52
|
curl.exe -X PUT "https://registry.npmmirror.com/-/package/dsh-mcviseron-plugin/syncs"
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -65,7 +65,7 @@ npmjs.com → `dsh-mcviseron-plugin` → **Settings → Trusted Publisher → Gi
|
|
|
65
65
|
| Allow npm publish | 勾选 |
|
|
66
66
|
| Allow npm dist-tag | 勾选 |
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Trusted Publisher 绑定后,**推送 `v*` tag 即直接发布**,不再需要 repository variable。
|
|
69
69
|
|
|
70
70
|
## 后续发版
|
|
71
71
|
|
|
@@ -74,7 +74,9 @@ npmjs.com → `dsh-mcviseron-plugin` → **Settings → Trusted Publisher → Gi
|
|
|
74
74
|
3. `git tag vX.Y.Z && git push origin main --tags`。
|
|
75
75
|
4. `publish.yml` 会校验 tag 与版本一致、跑测试与构建、检查 tarball 内容,然后通过 OIDC 发布并附带 provenance。
|
|
76
76
|
|
|
77
|
-
>
|
|
77
|
+
> `workflow_dispatch` 默认只做 `npm pack --dry-run`;要发布当前 `main` 的版本,取消勾选 `dry-run` 再运行。
|
|
78
|
+
>
|
|
79
|
+
> v0.6.2 的 tag 运行发生在门禁移除之前,重跑仍会使用旧 workflow;发布 0.6.2 请从 `main` 手动运行一次 `publish` 并取消 `dry-run`。之后的新 tag 会自动发布。
|
|
78
80
|
|
|
79
81
|
## 回滚与故障
|
|
80
82
|
|
package/lib/auto-review-fix.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// src/auto-review-fix/index.ts
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
|
|
4
|
+
// src/components/auto-review-fix/index.ts
|
|
5
|
+
import { randomUUID } from "node:crypto";
|
|
6
|
+
|
|
4
7
|
// src/components/auto-review-fix/translate.ts
|
|
5
8
|
var TRANSLATION_LABEL = "\u3010\u5BA1\u67E5\u7406\u7531 \xB7 \u4E2D\u6587\u7FFB\u8BD1\u3011";
|
|
6
9
|
var SYSTEM_PROMPT = [
|
|
@@ -31,7 +34,7 @@ function isAutoReviewText(text) {
|
|
|
31
34
|
return /auto[\s\-_]*review/i.test(text);
|
|
32
35
|
}
|
|
33
36
|
function reviewerExcerpt(text) {
|
|
34
|
-
const match = /^\s*auto[\s\-_]*review\s+denied\s+this\s+call\s*[::.]?\s*/i.exec(text);
|
|
37
|
+
const match = /^\s*auto[\s\-_]*review\s+(?:denied\s+this\s+call|拒绝了此调用)\s*[::.]?\s*/i.exec(text);
|
|
35
38
|
if (match === null) return text.trim();
|
|
36
39
|
const rest = text.slice(match[0].length).trim();
|
|
37
40
|
return rest.length === 0 ? text.trim() : rest;
|
|
@@ -46,8 +49,11 @@ ${translation}`;
|
|
|
46
49
|
function hasTranslation(value) {
|
|
47
50
|
return value.includes(TRANSLATION_LABEL);
|
|
48
51
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
52
|
+
function isPredominantlyChinese(text) {
|
|
53
|
+
const han = (text.match(/[\u3400-\u9fff\uf900-\ufaff]/g) ?? []).length;
|
|
54
|
+
if (han === 0) return false;
|
|
55
|
+
const englishWords = (text.match(/[A-Za-z][A-Za-z0-9_.-]*/g) ?? []).length;
|
|
56
|
+
return englishWords <= Math.max(2, Math.ceil(han / 2));
|
|
51
57
|
}
|
|
52
58
|
function cleanTranslation(raw) {
|
|
53
59
|
let text = raw.trim();
|
|
@@ -242,7 +248,7 @@ async function decorateApprovalRequest(scope, settings, request, translate = tra
|
|
|
242
248
|
if (typeof localized !== "string" || hasTranslation(localized)) return request;
|
|
243
249
|
const excerpt = reviewerExcerpt(english);
|
|
244
250
|
if (excerpt.length === 0 || excerpt.length > settings.maxChars) return request;
|
|
245
|
-
if (
|
|
251
|
+
if (isPredominantlyChinese(excerpt)) return request;
|
|
246
252
|
if (translationRoute(settings, request) === void 0) return request;
|
|
247
253
|
const llm = serviceOf(scope, "llm");
|
|
248
254
|
const translated = await translate(llm, settings, request, excerpt);
|
|
@@ -258,7 +264,107 @@ async function decorateApprovalRequest(scope, settings, request, translate = tra
|
|
|
258
264
|
displayReason: { ...record, [key]: withTranslation(localized, cleaned) }
|
|
259
265
|
};
|
|
260
266
|
}
|
|
261
|
-
function
|
|
267
|
+
function sessionIdOf(agent) {
|
|
268
|
+
const session = agent?.session;
|
|
269
|
+
return typeof session?.id === "string" ? session.id : "";
|
|
270
|
+
}
|
|
271
|
+
function sessionVersion(agent) {
|
|
272
|
+
const version = agent?.session?.header?.version;
|
|
273
|
+
return typeof version === "number" ? version : void 0;
|
|
274
|
+
}
|
|
275
|
+
function rejectionKey(agent, callId) {
|
|
276
|
+
if (typeof callId !== "string" || callId === "") return "";
|
|
277
|
+
const sessionId = sessionIdOf(agent);
|
|
278
|
+
return sessionId === "" ? "" : sessionId + ":" + callId;
|
|
279
|
+
}
|
|
280
|
+
function approvalReasonText(request) {
|
|
281
|
+
const record = request;
|
|
282
|
+
const display = record.displayReason;
|
|
283
|
+
if (display !== null && typeof display === "object" && !Array.isArray(display)) {
|
|
284
|
+
const key = chineseKey(display);
|
|
285
|
+
if (key !== void 0) {
|
|
286
|
+
const value = display[key];
|
|
287
|
+
if (typeof value === "string" && value !== "") return value;
|
|
288
|
+
}
|
|
289
|
+
const english = englishText(display);
|
|
290
|
+
if (english !== void 0 && english !== "") return english;
|
|
291
|
+
}
|
|
292
|
+
return typeof record.reason === "string" ? record.reason : "";
|
|
293
|
+
}
|
|
294
|
+
function isAutoReviewApproval(request) {
|
|
295
|
+
const record = request;
|
|
296
|
+
if (typeof record.reason === "string" && isAutoReviewText(record.reason)) return true;
|
|
297
|
+
const display = record.displayReason;
|
|
298
|
+
if (display !== null && typeof display === "object" && !Array.isArray(display)) {
|
|
299
|
+
const english = englishText(display);
|
|
300
|
+
if (english !== void 0 && isAutoReviewText(english)) return true;
|
|
301
|
+
}
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
function rejectionSource(agent, summary) {
|
|
305
|
+
return sessionVersion(agent) === 3 ? { kind: "plugin", plugin: "auto-review-fix", form: "notice", summary } : { kind: "plugin:auto-review-fix", form: "notice", summary };
|
|
306
|
+
}
|
|
307
|
+
function buildRejectionNotice(agent, request) {
|
|
308
|
+
const reason = approvalReasonText(request);
|
|
309
|
+
if (reason === "") return void 0;
|
|
310
|
+
const toolName = typeof request.toolName === "string" && request.toolName !== "" ? request.toolName : "\u672A\u77E5\u5DE5\u5177";
|
|
311
|
+
const text = [
|
|
312
|
+
'\u3010\u5BA1\u6279\u88AB\u62D2\u3011\u5DE5\u5177 "' + toolName + '" \u7684\u4EBA\u5DE5\u5BA1\u6279\u88AB\u62D2\u7EDD\u3002',
|
|
313
|
+
"\u81EA\u52A8\u5BA1\u67E5\u7406\u7531\uFF1A",
|
|
314
|
+
reason,
|
|
315
|
+
"",
|
|
316
|
+
"\u8BF7\u6839\u636E\u8BE5\u7406\u7531\u8C03\u6574\u65B9\u6848\uFF0C\u4E0D\u8981\u91CD\u590D\u540C\u4E00\u64CD\u4F5C\u3002"
|
|
317
|
+
].join("\n");
|
|
318
|
+
return {
|
|
319
|
+
id: randomUUID(),
|
|
320
|
+
role: "user",
|
|
321
|
+
content: [{ type: "text", text }],
|
|
322
|
+
source: rejectionSource(agent, "\u5BA1\u6279\u88AB\u62D2 \xB7 " + toolName)
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
function createRejectionRelay() {
|
|
326
|
+
const notes = /* @__PURE__ */ new Map();
|
|
327
|
+
const ttl = 12e4;
|
|
328
|
+
return {
|
|
329
|
+
remember(key, notice) {
|
|
330
|
+
const now = Date.now();
|
|
331
|
+
for (const [oldKey, entry] of notes) if (now - entry.at > ttl) notes.delete(oldKey);
|
|
332
|
+
if (notes.size >= 50) {
|
|
333
|
+
const oldest = notes.keys().next().value;
|
|
334
|
+
if (oldest !== void 0) notes.delete(oldest);
|
|
335
|
+
}
|
|
336
|
+
notes.set(key, { notice, at: now });
|
|
337
|
+
},
|
|
338
|
+
take(key) {
|
|
339
|
+
const entry = notes.get(key);
|
|
340
|
+
if (entry === void 0) return void 0;
|
|
341
|
+
notes.delete(key);
|
|
342
|
+
return entry.notice;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
var relayedContexts = /* @__PURE__ */ new WeakSet();
|
|
347
|
+
function installRejectionRelay(ctx, relay) {
|
|
348
|
+
const target = ctx;
|
|
349
|
+
if (typeof target.on !== "function" || relayedContexts.has(ctx)) return;
|
|
350
|
+
relayedContexts.add(ctx);
|
|
351
|
+
target.on.call(ctx, "tools/post-execute", async (exec, result, next) => {
|
|
352
|
+
const downstream = await next() ?? { kind: "accept" };
|
|
353
|
+
if (result?.isError !== true) return downstream;
|
|
354
|
+
const key = rejectionKey(exec?.agent, exec?.callId);
|
|
355
|
+
if (key === "") return downstream;
|
|
356
|
+
const notice = relay.take(key);
|
|
357
|
+
if (notice === void 0) return downstream;
|
|
358
|
+
return {
|
|
359
|
+
...downstream,
|
|
360
|
+
additionalContexts: [
|
|
361
|
+
...Array.isArray(downstream.additionalContexts) ? downstream.additionalContexts : [],
|
|
362
|
+
notice
|
|
363
|
+
]
|
|
364
|
+
};
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
function installApprovalTranslation(ctx, settings, relay) {
|
|
262
368
|
whenService(ctx, "approval", (scope) => {
|
|
263
369
|
const approval = serviceOf(scope, "approval");
|
|
264
370
|
if (approval === null || typeof approval !== "object") return;
|
|
@@ -273,7 +379,14 @@ function installApprovalTranslation(ctx, settings) {
|
|
|
273
379
|
} catch {
|
|
274
380
|
decorated = request;
|
|
275
381
|
}
|
|
276
|
-
|
|
382
|
+
const outcome = await call.call(this, decorated);
|
|
383
|
+
if (outcome === "rejected" && isAutoReviewApproval(decorated)) {
|
|
384
|
+
const request2 = decorated;
|
|
385
|
+
const key = rejectionKey(request2.agent, request2.callId);
|
|
386
|
+
const notice = buildRejectionNotice(request2.agent, decorated);
|
|
387
|
+
if (key !== "" && notice !== void 0) relay.remember(key, notice);
|
|
388
|
+
}
|
|
389
|
+
return outcome;
|
|
277
390
|
};
|
|
278
391
|
try {
|
|
279
392
|
approval.request = wrapper;
|
|
@@ -289,7 +402,11 @@ function installApprovalTranslation(ctx, settings) {
|
|
|
289
402
|
function installAutoReview(ctx, config) {
|
|
290
403
|
const settings = normalizeConfig(config);
|
|
291
404
|
if (settings.keepPresetGuard) installPresetGuard(ctx);
|
|
292
|
-
if (settings.enabled)
|
|
405
|
+
if (settings.enabled) {
|
|
406
|
+
const relay = createRejectionRelay();
|
|
407
|
+
installRejectionRelay(ctx, relay);
|
|
408
|
+
installApprovalTranslation(ctx, settings, relay);
|
|
409
|
+
}
|
|
293
410
|
}
|
|
294
411
|
|
|
295
412
|
// src/volatile.ts
|
package/lib/client.js
CHANGED
|
@@ -1067,7 +1067,7 @@ var zh = {
|
|
|
1067
1067
|
"form.unavailable": "\u65E0\u6CD5\u8BFB\u53D6\u63D2\u4EF6\u8BBE\u7F6E\uFF1A\u8BF7\u786E\u8BA4 profile \u4E2D\u7684\u63D2\u4EF6\u6761\u76EE id \u4E3A mcviseron",
|
|
1068
1068
|
"form.autoSave": "\u4FEE\u6539\u540E\u81EA\u52A8\u4FDD\u5B58",
|
|
1069
1069
|
"form.autoReview.translate": "\u7FFB\u8BD1\u5BA1\u6279\u7406\u7531",
|
|
1070
|
-
"form.autoReview.translateHint": "\u82F1\u6587\u5BA1\u67E5\u7406\u7531\u4F1A\u9644\u4E0A\u4E2D\u6587\u7FFB\u8BD1\uFF0C\u5E76\u5199\u5165\u5BA1\u6279\u4E8B\u4EF6\uFF0C\
|
|
1070
|
+
"form.autoReview.translateHint": "\u82F1\u6587\u5BA1\u67E5\u7406\u7531\u4F1A\u9644\u4E0A\u4E2D\u6587\u7FFB\u8BD1\uFF0C\u5E76\u5199\u5165\u5BA1\u6279\u4E8B\u4EF6\uFF1B\u8F6C\u624B\u52A8\u540E\u88AB\u62D2\u65F6\uFF0C\u81EA\u52A8\u5BA1\u67E5\u7406\u7531\u4F1A\u4F5C\u4E3A notice \u4EA4\u56DE AI",
|
|
1071
1071
|
"form.autoReview.keepPreset": "\u9000\u51FA\u65F6\u4FDD\u6301\u6743\u9650\u9884\u8BBE",
|
|
1072
1072
|
"form.autoReview.keepPresetHint": "\u5173\u95ED DSH \u65F6\u4E0D\u518D\u628A Auto \u4F1A\u8BDD\u6539\u6210\u5B8C\u5168\u8BBF\u95EE",
|
|
1073
1073
|
"form.autoReview.timeout": "\u7FFB\u8BD1\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",
|
|
@@ -1091,7 +1091,7 @@ var zh = {
|
|
|
1091
1091
|
"form.taskGuard.sourceV4": "v4",
|
|
1092
1092
|
"form.taskGuard.maxListItems": "notice \u6700\u591A\u5217\u51FA\u4EFB\u52A1\u6570",
|
|
1093
1093
|
"form.taskGuard.detectStepIntent": "\u8BC6\u522B\u6B65\u9AA4\u610F\u56FE",
|
|
1094
|
-
"form.taskGuard.detectStepIntentHint": "\
|
|
1094
|
+
"form.taskGuard.detectStepIntentHint": "\u8BC6\u522B\u300CNow I will \u2026\u300D\u7B49\u6B65\u9AA4\u610F\u56FE\uFF0C\u4EE5\u53CA\u300CAll nets routed\u300D\u300CDRC passes\u300D\u300C\u539F\u7406\u56FE\u5B8C\u6210\u300D\u7B49\u9636\u6BB5\u5B8C\u6210\u8BED\u53E5\uFF1B\u547D\u4E2D\u65F6\u63D0\u4F9B\u53EF\u76F4\u63A5\u53D1\u9001\u7684 todo_write",
|
|
1095
1095
|
"form.taskGuard.translateTodo": "\u4E2D\u6587\u5C55\u793A todo \u6807\u9898",
|
|
1096
1096
|
"form.taskGuard.translateTodoHint": "\u53EA\u5F71\u54CD notice \u5C55\u793A\uFF0C\u4E0D\u6539\u5199\u6A21\u578B\u5199\u5165\u7684 todo",
|
|
1097
1097
|
"form.taskGuard.todoTimeout": "todo \u7FFB\u8BD1\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",
|
|
@@ -1162,7 +1162,7 @@ var en = {
|
|
|
1162
1162
|
"form.unavailable": "Cannot read the plugin settings: check that the profile entry id is mcviseron",
|
|
1163
1163
|
"form.autoSave": "Changes save automatically",
|
|
1164
1164
|
"form.autoReview.translate": "Translate the approval reason",
|
|
1165
|
-
"form.autoReview.translateHint": "Appends a Chinese translation to the reviewer note and writes it into the approval event
|
|
1165
|
+
"form.autoReview.translateHint": "Appends a Chinese translation to the reviewer note and writes it into the approval event; a manual rejection returns the auto-review reason to the AI",
|
|
1166
1166
|
"form.autoReview.keepPreset": "Keep the permission preset on shutdown",
|
|
1167
1167
|
"form.autoReview.keepPresetHint": "Stops DSH from rewriting Auto sessions to Full access while exiting",
|
|
1168
1168
|
"form.autoReview.timeout": "Translation timeout (ms)",
|
|
@@ -1186,7 +1186,7 @@ var en = {
|
|
|
1186
1186
|
"form.taskGuard.sourceV4": "v4",
|
|
1187
1187
|
"form.taskGuard.maxListItems": "Maximum tasks listed in a notice",
|
|
1188
1188
|
"form.taskGuard.detectStepIntent": "Detect step intent",
|
|
1189
|
-
"form.taskGuard.detectStepIntentHint": "Recognizes \u201CNow I will \u2026\u201D
|
|
1189
|
+
"form.taskGuard.detectStepIntentHint": "Recognizes step intent (\u201CNow I will \u2026\u201D) and completion statements (\u201CAll nets routed\u201D, \u201CDRC passes\u201D); the notice carries a ready todo_write",
|
|
1190
1190
|
"form.taskGuard.translateTodo": "Show todo titles in Chinese",
|
|
1191
1191
|
"form.taskGuard.translateTodoHint": "Display-only; stored todos are never rewritten",
|
|
1192
1192
|
"form.taskGuard.todoTimeout": "Todo translation timeout (ms)",
|