@dnalec/dsh-auto-approve 0.1.2 → 0.2.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/CHANGELOG.md +21 -0
- package/README.md +34 -91
- package/README.zh.md +23 -83
- package/client.js +108 -219
- package/locales.mjs +164 -128
- package/package.json +5 -9
- package/src/index.mjs +179 -458
- package/src/preset-patch.mjs +3 -3
- package/src/rules.mjs +155 -54
- package/src/util.mjs +6 -70
- package/src/provisioning.mjs +0 -131
- package/src/qqbot.mjs +0 -313
- package/src/tickets.mjs +0 -277
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Breaking
|
|
6
|
+
|
|
7
|
+
- Human review is **Web-only**. QQ / WeChat / Feishu / Telegram channels are removed.
|
|
8
|
+
- Plugin config lives in `~/.dsh/auto-approve/config.json`. A readable 0.1.x `~/.dsh/approval-bridge/config.json` is migrated once (judge / preset / language only). QQ credentials are unused.
|
|
9
|
+
|
|
10
|
+
### Pipeline
|
|
11
|
+
|
|
12
|
+
- Keyword reject/human hay includes `session.header.cwd` (not `session.cwd`) and joins relative `file_path`/`path` onto cwd/workdir. Allow keywords still do not match the tool name or the session directory.
|
|
13
|
+
- Empty write/edit bodies are kept and shown on the judge card as `(empty)` / `(空)`. Missing payload still goes to a human.
|
|
14
|
+
- Connection RPC failures always include `{ code, message, details }` (`rpcFail`), matching the host `ConnectionRpcFailure` contract.
|
|
15
|
+
- Settings criteria label/description remount when the snapshot changes, so restore-defaults is not undone on blur.
|
|
16
|
+
|
|
17
|
+
### 中文
|
|
18
|
+
|
|
19
|
+
- **破坏性**:人工只走网页;去掉 QQ / 微信 / 飞书 / Telegram。插件配置改到 `~/.dsh/auto-approve/config.json`(可读的 0.1.x `approval-bridge/config.json` 会迁一次判定字段)。
|
|
20
|
+
- 关键词拒绝/人工干草含 `session.header.cwd`,相对路径会拼到 cwd/workdir;允许桶不含工具名和会话目录名。
|
|
21
|
+
- 空写入/替换仍进审核卡片(`(空)` / `(empty)`)。RPC 失败带 `message`。审核表恢复默认后输入框会随 snapshot 重挂。
|
package/README.md
CHANGED
|
@@ -2,130 +2,84 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
6
|
-
|
|
7
|
-
What needs approval is decided by the Auto-approve preset sandbox (in-workspace writes skip approval, or they also enter the judge pipeline). Keyword and criteria-table actions are configurable; out-of-workspace `danger-full-access` **does not short-circuit on the mode name**. Requests that need a human appear on both the Web UI and a configured QQ chat; **the first answer wins**.
|
|
8
|
-
|
|
9
|
-
Scope is approval only. The QQ bot is a notify-and-reply channel, not an agent chat.
|
|
5
|
+
A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin that auto-approves or rejects tool calls with **keywords** and a **judge-model criteria table**. Uncertainty goes to the original Web approval dialog.
|
|
10
6
|
|
|
11
7
|
## Install
|
|
12
8
|
|
|
13
|
-
Pin a release tag (recommended). `main` is for published commits; in-progress work lives on other branches.
|
|
14
|
-
|
|
15
9
|
```sh
|
|
16
|
-
dsh plugin --profile web add github:DNAlec/dsh-auto-approve#v0.
|
|
10
|
+
dsh plugin --profile web add github:DNAlec/dsh-auto-approve#v0.2.0
|
|
17
11
|
```
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
Or from npm, after a tagged release:
|
|
20
14
|
|
|
21
15
|
```sh
|
|
22
16
|
dsh plugin --profile web add @dnalec/dsh-auto-approve
|
|
23
17
|
```
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
dsh plugin --profile web add /path/to/this-repo
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Restart `dsh web`. The first start writes the `auto-approve` permission preset into the profile patch (the preset table cannot be extended at runtime).
|
|
19
|
+
Restart `dsh web`. The first start adds the **Auto-approve** permission preset.
|
|
32
20
|
|
|
33
21
|
## Setup
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
1. Click **Scan to create bot**, then scan with mobile QQ (official Open Platform flow). Or paste AppID / AppSecret and save.
|
|
38
|
-
2. Friend the bot and send it any message. Pick the chat under **Recent incoming** (private chat recommended). Group chats must @ the bot and set `userId`. Scanning may prefill the scanner’s openid as `chatId` if none is set. This plugin is for a **private bot**: if no `chatId` is bound yet, any C2C reply of `是` / `确认` / `用作审批` / `yes` / `ok` binds that chat as the approval target. Do not add the bot where strangers can DM it.
|
|
39
|
-
3. Under **Auto-approve mode**, choose in-workspace writes without approval (preset sandbox `workspace-write`, recommended) or send them through the judge (`read-only`). After saving, restart `dsh web` and re-select **Auto-approve** or start a new session.
|
|
40
|
-
4. Set the session permission preset to **Auto-approve**. If it is missing after the first start, restart once more so the live patch reload can pick it up.
|
|
41
|
-
|
|
42
|
-
Credentials are stored only in `~/.dsh/approval-bridge/qqbot.json` (`0600`). Do not commit them.
|
|
23
|
+
Settings → **Auto-approve**:
|
|
43
24
|
|
|
44
|
-
|
|
25
|
+
1. **Mode** — in-workspace writes skip approval (`workspace-write`, recommended), or send them through the judge (`read-only`). Save, restart `dsh web`, then re-select **Auto-approve** or start a new session.
|
|
26
|
+
2. **Keywords** and **criteria table** as needed. Restore default criteria loads the shipped pack for the selected judge-prompt language.
|
|
27
|
+
3. **Judge model** — empty follows the deployment default.
|
|
28
|
+
4. Set the session permission to **Auto-approve**.
|
|
45
29
|
|
|
46
|
-
## Behavior
|
|
47
|
-
|
|
48
|
-
| Situation | Result |
|
|
49
|
-
|---|---|
|
|
50
|
-
| Preset sandbox `workspace-write`, in-workspace write | No approval (sandbox already allows it) |
|
|
51
|
-
| Keyword or criteria action is reject | Immediate `rejected`; no dialog, no QQ |
|
|
52
|
-
| Keyword or criteria action is allow | No dialog, no QQ; green strip + `ALLOW` audit |
|
|
53
|
-
| Keyword/criteria human, or judge failure | QQ gets `#N`; reply `批准 N` to continue |
|
|
54
|
-
| `danger-full-access` (outside workspace) | Same judge pipeline; does not short-circuit on the mode name |
|
|
55
|
-
| Web UI and QQ both prompt | First outcome wins; QQ answering first dismisses the Web dialog (forked signal, not `req.signal`) |
|
|
56
|
-
| QQ wait timeout (default 120s) | Web dialog stays open; QQ says continue in the browser |
|
|
57
|
-
| No credentials / not connected | Auto-approval still runs; humans only on the Web UI (`PUSH_SKIP`) |
|
|
58
|
-
| Judge model misconfigured / judge fails | Escalate to human (`FAILED`); do not fall back to the session model |
|
|
59
|
-
| Tool args missing (no command/path/content/code, …) | Human (`missing-payload`); never auto-allow |
|
|
60
|
-
| Captured field truncated | Keyword reject still applies; never auto-allow (`truncated-payload`) |
|
|
61
|
-
| Preset is not `auto-approve` | Do not answer, do not push (unless `onlyAutoApprovePreset` is off) |
|
|
62
30
|
|
|
63
|
-
|
|
31
|
+
## How it works
|
|
64
32
|
|
|
65
|
-
|
|
33
|
+
Runs only when the session preset is Auto-approve. With `workspace-write`, in-workspace writes never reach approval. `danger-full-access` uses the same pipeline. Missing or truncated tool args go to a human and are never auto-allowed.
|
|
66
34
|
|
|
67
|
-
|
|
35
|
+
1. **Keywords** (reject > human > allow). Match tool name, command, path, and working directory. Allow words do not match the tool name or the session directory. Shipped reject words cover disaster commands (`rm -rf`, `git push -f`, `drop table`, `dd of=`), approval-config paths, and credential paths such as `.env` / `id_rsa`.
|
|
36
|
+
2. **Criteria table**. The judge model sees the same fields as the Web tool card and outputs a category; the plugin runs that row’s action. Parse failure or timeout goes to a human.
|
|
68
37
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
1. Keywords (reject > human > allow). Reject/human match **tool name + command + path + workdir**; allow keywords do not match the tool name. They do not match the model justification, `description`, or file bodies. Shipped phrases default to reject: catastrophic command shapes, auto-approve config paths, and credential paths (`.env`, `id_rsa`, …). Anything missed goes to the next step. If a captured field is truncated, keyword reject still applies; keyword allow and judge-safe do not — that request goes to a human.
|
|
72
|
-
2. Criteria table: the judge model sees the same fields as the Web tool card (command, path, old/new text, write content, code/url/sql, …) and emits only a category id + reason; the program applies allow / reject / human. Parse failure or timeout → human and does **not** run `other.action`. Risk rows default to reject; `safe` defaults to allow; `other` defaults to human.
|
|
73
|
-
|
|
74
|
-
Default criteria (actions are editable; `other` cannot be deleted):
|
|
38
|
+
Default criteria (actions are editable; **Other** cannot be deleted):
|
|
75
39
|
|
|
76
40
|
| id | Label | Default |
|
|
77
41
|
|---|---|---|
|
|
78
|
-
| deletion |
|
|
79
|
-
| credential | Credentials
|
|
80
|
-
| remote | Remote
|
|
81
|
-
| system | System paths
|
|
82
|
-
| bulk | Bulk irreversible
|
|
83
|
-
| approval-config | Auto-approve
|
|
84
|
-
| safe | Safe
|
|
85
|
-
| other |
|
|
86
|
-
|
|
87
|
-
Risk rows default to reject. Auto-allow only when the model can confirm `safe`. Uncertainty goes to `other` (human). Mis-filing a dangerous op as `safe` is still auto-allowed.
|
|
42
|
+
| deletion | Delete/overwrite irreplaceable data | reject |
|
|
43
|
+
| credential | Credentials/keys/auth changes | reject |
|
|
44
|
+
| remote | Remote/production/database | reject |
|
|
45
|
+
| system | System paths/config | reject |
|
|
46
|
+
| bulk | Bulk irreversible operations | reject |
|
|
47
|
+
| approval-config | Auto-approve configuration | reject |
|
|
48
|
+
| safe | Safe/routine reversible | allow |
|
|
49
|
+
| other | Other (unsure) | human |
|
|
88
50
|
|
|
89
|
-
|
|
51
|
+
Judge prompt language (Chinese or English) only changes the framework sent to the model, not the current table.
|
|
90
52
|
|
|
91
|
-
|
|
53
|
+
## Data
|
|
92
54
|
|
|
93
55
|
## Data
|
|
94
56
|
|
|
95
|
-
Under `$DSH_HOME` (default `~/.dsh/`)
|
|
57
|
+
Under `$DSH_HOME` (default `~/.dsh/`), never committed:
|
|
96
58
|
|
|
97
59
|
| Path | Purpose |
|
|
98
60
|
|---|---|
|
|
99
|
-
| `auto-approve/allowlist.json` |
|
|
100
|
-
| `auto-approve/
|
|
101
|
-
| `auto-approve/
|
|
102
|
-
| `
|
|
103
|
-
| `approval-bridge/config.json` | Judge model, notify target, and other plugin config (`0600`) |
|
|
61
|
+
| `auto-approve/allowlist.json` | Keywords, criteria, judge timeout |
|
|
62
|
+
| `auto-approve/config.json` | Judge model and plugin settings |
|
|
63
|
+
| `auto-approve/audit.log` | `ALLOW` / `REJECT` / `HUMAN` / `FAILED` / `OUTCOME` |
|
|
64
|
+
| `auto-approve/events.jsonl` | Approval tab events |
|
|
104
65
|
|
|
105
|
-
|
|
66
|
+
Corrupt files are not overwritten. Uninstalling the plugin does not delete this directory.
|
|
106
67
|
|
|
107
|
-
##
|
|
68
|
+
## Config
|
|
108
69
|
|
|
109
70
|
```yaml
|
|
110
71
|
- id: dsh-auto-approve
|
|
111
72
|
config:
|
|
112
73
|
onlyAutoApprovePreset: true
|
|
113
|
-
presetSandbox: workspace-write # or read-only
|
|
74
|
+
presetSandbox: workspace-write # or read-only
|
|
114
75
|
judge:
|
|
115
76
|
provider: ''
|
|
116
77
|
model: ''
|
|
117
78
|
reasoningEffort: ''
|
|
118
79
|
timeoutMs: 20000
|
|
119
|
-
notify:
|
|
120
|
-
enabled: true
|
|
121
|
-
chatId: ''
|
|
122
|
-
userId: ''
|
|
123
|
-
timeoutSecs: 120
|
|
124
80
|
```
|
|
125
81
|
|
|
126
|
-
Empty judge fields follow the deployment default
|
|
127
|
-
|
|
128
|
-
If a JSON file cannot be parsed, this process uses in-memory defaults and **does not overwrite the file**. Settings will not write a corrupt allowlist except Restore defaults; a corrupt plugin config needs an explicit overwrite; corrupt QQ credentials need a re-save or QR scan.
|
|
82
|
+
Empty judge fields follow the deployment default. With no usable route, that request goes to a human. Settings “judge timeout” writes `allowlist.json` and wins at runtime.
|
|
129
83
|
|
|
130
84
|
## Development
|
|
131
85
|
|
|
@@ -134,19 +88,8 @@ node --test tests/*.test.mjs
|
|
|
134
88
|
npm run check
|
|
135
89
|
```
|
|
136
90
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
For agents working in this repository, follow [AGENTS.md](AGENTS.md).
|
|
140
|
-
|
|
141
|
-
## Releasing
|
|
142
|
-
|
|
143
|
-
1. Set `package.json` `version` (for example `0.1.2`) and merge to `main`.
|
|
144
|
-
2. On npmjs.com, add a Trusted Publisher for this GitHub repo, workflow file `publish.yml` (once).
|
|
145
|
-
3. Tag and push: `git tag v0.1.2 && git push origin v0.1.2`.
|
|
146
|
-
|
|
147
|
-
The tag must match `package.json` version. The workflow runs tests, then `npm publish`. The first publish of the package name may need a local `npm login` and `npm publish --access public` once; later tags are enough.
|
|
91
|
+
See [AGENTS.md](AGENTS.md) and [CHANGELOG.md](CHANGELOG.md).
|
|
148
92
|
|
|
149
93
|
## License
|
|
150
94
|
|
|
151
|
-
|
|
152
95
|
[MIT](LICENSE)
|
package/README.zh.md
CHANGED
|
@@ -2,18 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
6
|
-
|
|
7
|
-
需要审批的行为(由「自动审批」预设沙箱决定:工作区内不审批,或工作区也走判定)进入同一条判定管道。关键词和审核表的动作都可配置;越出工作区的 `danger-full-access` **不因模式名短路**。必须人工的请求同时出现在网页和配置的 QQ 聊天,**谁先答谁赢**。
|
|
8
|
-
|
|
9
|
-
范围仅限审批。QQ 机器人是通知和批复通道,不是 agent 聊天。
|
|
5
|
+
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 插件:用**关键词**和**审核模型审核表**自动允许或拒绝工具调用。拿不准就交给原来的网页审批框。
|
|
10
6
|
|
|
11
7
|
## 安装
|
|
12
8
|
|
|
13
|
-
请钉死发行 tag(推荐)。`main` 只放已发布的提交,开发走其他分支。
|
|
14
|
-
|
|
15
9
|
```sh
|
|
16
|
-
dsh plugin --profile web add github:DNAlec/dsh-auto-approve#v0.
|
|
10
|
+
dsh plugin --profile web add github:DNAlec/dsh-auto-approve#v0.2.0
|
|
17
11
|
```
|
|
18
12
|
|
|
19
13
|
打 tag 发布后也可从 npm 安装:
|
|
@@ -22,58 +16,27 @@ dsh plugin --profile web add github:DNAlec/dsh-auto-approve#v0.1.2
|
|
|
22
16
|
dsh plugin --profile web add @dnalec/dsh-auto-approve
|
|
23
17
|
```
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
dsh plugin --profile web add /path/to/this-repo
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
重启 `dsh web`。首次启动会把 `auto-approve` 权限预设写入 profile patch(预设表冻结,不能运行时扩展)。
|
|
19
|
+
重启 `dsh web`。首次启动会写入「自动审批」权限预设。
|
|
32
20
|
|
|
33
21
|
## 设置
|
|
34
22
|
|
|
35
23
|
设置页 → **自动审批**:
|
|
36
24
|
|
|
37
|
-
1.
|
|
38
|
-
2.
|
|
39
|
-
3.
|
|
40
|
-
4.
|
|
41
|
-
|
|
42
|
-
凭据只存在 `~/.dsh/approval-bridge/qqbot.json`(`0600`),不要提交。
|
|
43
|
-
|
|
44
|
-
卸载(`dsh plugin --profile web remove @dnalec/dsh-auto-approve`)后重启,插件随 bundle 层消失。`auto-approve` 预设可能仍留在 profile patch 里:没有本插件时它只是普通的 `workspace-write` 或 `read-only` + `ask`。`~/.dsh/auto-approve/` 与 `~/.dsh/approval-bridge/` 里的规则、审计和 QQ 凭据不会删除。
|
|
45
|
-
|
|
46
|
-
## 行为
|
|
47
|
-
|
|
48
|
-
| 情况 | 结果 |
|
|
49
|
-
|---|---|
|
|
50
|
-
| 预设沙箱 `workspace-write`,工作区内写入 | 不进审批(沙箱已允许) |
|
|
51
|
-
| 关键词命中拒绝 / 审核表动作为拒绝 | 直接 `rejected`,无框、无 QQ |
|
|
52
|
-
| 关键词命中允许 / 审核表动作为允许 | 无框、无 QQ;绿条 + `ALLOW` 审计 |
|
|
53
|
-
| 关键词命中人工、审核表人工、判定失败 | QQ 收到 `#N`;回复 `批准 N` 后工具继续 |
|
|
54
|
-
| `danger-full-access`(越出工作区) | 进入同一条判定管道,不因模式名短路 |
|
|
55
|
-
| 网页与 QQ 同时亮 | 先到的 outcome 生效;QQ 先答会关掉网页框(只 abort 网页用的 fork signal,不碰 `req.signal`) |
|
|
56
|
-
| QQ 等待超时(默认 120s) | 网页框仍在;QQ 提示到网页继续 |
|
|
57
|
-
| 未配凭据 / 未连接 | 自动审批照常;人工只走网页(`PUSH_SKIP`) |
|
|
58
|
-
| 审核模型配错 / 判定失败 | 当次转人工(`FAILED`);不改用会话模型 |
|
|
59
|
-
| 未捕获工具参数(无命令/路径/内容/code 等) | 转人工(`missing-payload`),禁止自动放行 |
|
|
60
|
-
| 捕获字段被截断 | 仍可关键词拒绝;禁止自动放行(`truncated-payload`) |
|
|
61
|
-
| 预设不是 `auto-approve` | 不抢答、不推送(除非关闭 `onlyAutoApprovePreset`) |
|
|
62
|
-
|
|
63
|
-
QQ 审批推送带「批准 / 拒绝」按钮(单聊、群聊自定义按钮)。也可回复:`批准 17` / `#17 批准` / `yes 17` 放行;`拒绝 17` 只拒这一次。仅 1 条 pending 时允许裸 `批准` / `拒绝`。
|
|
64
|
-
|
|
65
|
-
不要 abort `req.signal` 来关网页框:那会把整单变成 `cancelled`。
|
|
25
|
+
1. **模式** — 工作区内不审批(`workspace-write`,推荐),或工作区也走判定(`read-only`)。保存后重启 `dsh web`,再重新选择「自动审批」或开新会话。
|
|
26
|
+
2. 按需改**关键词**和**审核表**。恢复默认会按所选审核提示词语言加载出厂包。
|
|
27
|
+
3. **审核模型** — 空则跟随部署默认。
|
|
28
|
+
4. 会话权限选 **自动审批**。
|
|
66
29
|
|
|
67
|
-
##
|
|
30
|
+
## 怎么判定
|
|
68
31
|
|
|
69
|
-
|
|
32
|
+
仅当会话预设是「自动审批」时介入。`workspace-write` 下,工作区内写入不会进审批。`danger-full-access` 走同一条管道。缺参或字段被截断会转人工,禁止自动放行。
|
|
70
33
|
|
|
71
|
-
1.
|
|
72
|
-
2.
|
|
34
|
+
1. **关键词**(拒绝 > 人工 > 允许)。匹配工具名、命令、路径和工作目录。允许词不匹配工具名,也不匹配会话目录名。预置拒绝词覆盖灾难命令(`rm -rf`、`git push -f`、`drop table`、`dd of=`)、审批配置路径,以及 `.env` / `id_rsa` 等凭据路径。
|
|
35
|
+
2. **审核表**。审核模型看到与网页工具卡片相同的字段,只输出类别;程序按该行动作执行。解析失败或超时转人工。
|
|
73
36
|
|
|
74
|
-
|
|
37
|
+
默认审核表(动作可改;**其他**不能删除):
|
|
75
38
|
|
|
76
|
-
| id | 标签 |
|
|
39
|
+
| id | 标签 | 默认 |
|
|
77
40
|
|---|---|---|
|
|
78
41
|
| deletion | 删除/覆盖不可再生数据 | 拒绝 |
|
|
79
42
|
| credential | 凭据/密钥/授权修改 | 拒绝 |
|
|
@@ -84,25 +47,20 @@ QQ 审批推送带「批准 / 拒绝」按钮(单聊、群聊自定义按钮
|
|
|
84
47
|
| safe | 安全/常规可回补 | 允许 |
|
|
85
48
|
| other | 其他(拿不准) | 人工 |
|
|
86
49
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
设置里可把**审核提示词语言**设为中文或 English(默认中文)。这只换发给模型的框架和卡片标签,**不会**改当前审核表。点「恢复默认审核表」才按所选语言加载出厂包。理由与框架同语言。
|
|
90
|
-
|
|
91
|
-
Host API 走已鉴权的 `connection.rpc`(`/api/dsh-auto-approve`),不上无鉴权 HTTP。
|
|
50
|
+
审核提示词语言(中文 / English)只换发给模型的框架,不改当前审核表。
|
|
92
51
|
|
|
93
52
|
## 数据
|
|
94
53
|
|
|
95
|
-
位于 `$DSH_HOME`(默认 `~/.dsh
|
|
54
|
+
位于 `$DSH_HOME`(默认 `~/.dsh/`),不进 git:
|
|
96
55
|
|
|
97
56
|
| 路径 | 用途 |
|
|
98
57
|
|---|---|
|
|
99
|
-
| `auto-approve/allowlist.json` |
|
|
100
|
-
| `auto-approve/
|
|
101
|
-
| `auto-approve/
|
|
102
|
-
| `
|
|
103
|
-
| `approval-bridge/config.json` | 审核模型、推送目标等插件配置(`0600`) |
|
|
58
|
+
| `auto-approve/allowlist.json` | 关键词、审核表、审核超时 |
|
|
59
|
+
| `auto-approve/config.json` | 审核模型与插件配置 |
|
|
60
|
+
| `auto-approve/audit.log` | `ALLOW` / `REJECT` / `HUMAN` / `FAILED` / `OUTCOME` |
|
|
61
|
+
| `auto-approve/events.jsonl` | 审批 tab 事件 |
|
|
104
62
|
|
|
105
|
-
|
|
63
|
+
损坏文件不会被覆盖。卸载插件不会删除这个目录。
|
|
106
64
|
|
|
107
65
|
## 配置
|
|
108
66
|
|
|
@@ -110,22 +68,15 @@ Host API 走已鉴权的 `connection.rpc`(`/api/dsh-auto-approve`),不上
|
|
|
110
68
|
- id: dsh-auto-approve
|
|
111
69
|
config:
|
|
112
70
|
onlyAutoApprovePreset: true
|
|
113
|
-
presetSandbox: workspace-write # 或 read-only
|
|
71
|
+
presetSandbox: workspace-write # 或 read-only
|
|
114
72
|
judge:
|
|
115
73
|
provider: ''
|
|
116
74
|
model: ''
|
|
117
75
|
reasoningEffort: ''
|
|
118
76
|
timeoutMs: 20000
|
|
119
|
-
notify:
|
|
120
|
-
enabled: true
|
|
121
|
-
chatId: ''
|
|
122
|
-
userId: ''
|
|
123
|
-
timeoutSecs: 120
|
|
124
77
|
```
|
|
125
78
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
JSON 读失败(损坏)时本进程用内存默认,**不覆盖磁盘**。设置页除「恢复默认 / 覆盖损坏配置」外不会写坏 allowlist;插件配置损坏需明确覆盖;QQ 凭据损坏需重新保存或扫码。
|
|
79
|
+
审核模型字段为空则跟随部署默认。没有可用路由时当次转人工。设置页「审核超时」写入 `allowlist.json`,运行时以此为准。
|
|
129
80
|
|
|
130
81
|
## 开发
|
|
131
82
|
|
|
@@ -134,19 +85,8 @@ node --test tests/*.test.mjs
|
|
|
134
85
|
npm run check
|
|
135
86
|
```
|
|
136
87
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
在本仓库改代码的 agent 请遵循 [AGENTS.md](AGENTS.md)。
|
|
140
|
-
|
|
141
|
-
## 发布
|
|
142
|
-
|
|
143
|
-
1. 把 `package.json` 的 `version` 改成目标版本(例如 `0.1.2`),合进 `main`。
|
|
144
|
-
2. 在 npmjs.com 给本仓库配置 Trusted Publisher,工作流文件填 `publish.yml`(只需一次)。
|
|
145
|
-
3. 打 tag 并推送:`git tag v0.1.2 && git push origin v0.1.2`。
|
|
146
|
-
|
|
147
|
-
tag 必须与 `package.json` 版本一致。工作流会先跑测试再 `npm publish`。这个包名第一次上架可能需要本机 `npm login` 后执行一次 `npm publish --access public`;之后推 tag 即可。
|
|
88
|
+
见 [AGENTS.md](AGENTS.md) 与 [CHANGELOG.md](CHANGELOG.md)。
|
|
148
89
|
|
|
149
90
|
## 许可证
|
|
150
91
|
|
|
151
|
-
|
|
152
92
|
[MIT](LICENSE)
|