@dnalec/dsh-auto-approve 0.1.3 → 0.2.1

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/locales.mjs CHANGED
@@ -14,8 +14,34 @@ export const zh = {
14
14
  'action.allow': '允许',
15
15
  'action.human': '人工',
16
16
 
17
+ 'criterion.deletion': '删除/覆盖不可再生数据',
18
+ 'criterion.credential': '凭据/密钥/授权修改',
19
+ 'criterion.remote': '远程系统/生产环境/数据库',
20
+ 'criterion.system': '系统级路径/配置',
21
+ 'criterion.bulk': '批量不可回补操作',
22
+ 'criterion.approval-config': '自动审批配置',
23
+ 'criterion.safe': '安全/常规可回补',
24
+ 'criterion.other': '其他(拿不准)',
25
+
26
+ 'sandbox.read-only': '只读',
27
+ 'sandbox.workspace-write': '工作区可写',
28
+ 'sandbox.danger-full-access': '全权限',
29
+
30
+ 'source.web': '网页',
31
+
17
32
  'verdict.keyword-allow': '关键词允许',
18
33
  'verdict.keyword-reject': '关键词拒绝',
34
+ 'verdict.keyword-human': '关键词转人工',
35
+ 'verdict.criteria-reject': '审核表拒绝',
36
+ 'verdict.criteria-allow': '审核表允许',
37
+ 'verdict.criteria-human': '审核表转人工',
38
+ 'verdict.judge-failed': '判定失败转人工',
39
+ 'verdict.missing-payload': '缺少工具参数转人工',
40
+ 'verdict.truncated-payload': '参数过长转人工',
41
+ 'verdict.plugin-error': '插件异常转人工',
42
+ 'verdict.human': '转人工',
43
+ 'verdict.cancelled': '人工取消',
44
+ 'verdict.unavailable': '审批不可用',
19
45
  'path.keyword-reject': '关键词拒绝',
20
46
  'path.keyword-allow': '关键词允许',
21
47
  'path.keyword-human': '关键词转人工',
@@ -29,14 +55,14 @@ export const zh = {
29
55
 
30
56
  'notice.feedError': '审批提示暂时不可用',
31
57
  'notice.feedErrorTag': '连接失败',
32
- 'notice.pendingTitle': '等待人工审批{ticket}:{preview}',
33
- 'notice.pendingTag': '人工审批中{ticket}',
34
- 'notice.qqApproved': '已在 QQ 批准{ticket}:{preview}',
35
- 'notice.webApproved': '人工审批通过{ticket}:{preview}',
36
- 'notice.qqApprovedTag': '已在 QQ 批准{ticket}',
58
+ 'notice.pendingTitle': '等待人工审批:{preview}',
59
+ 'notice.pendingTag': '人工审批中',
60
+ 'notice.webApproved': '人工审批通过:{preview}',
37
61
  'notice.webApprovedTag': '人工审批通过',
38
- 'notice.rejectedTitle': '已拒绝{ticket}:{preview}',
39
- 'notice.rejectedTag': '已拒绝{ticket}',
62
+ 'notice.rejectedTitle': '已拒绝:{preview}',
63
+ 'notice.rejectedTag': '已拒绝',
64
+ 'notice.cancelledTitle': '已取消人工审批:{preview}',
65
+ 'notice.unavailableTitle': '审批不可用:{preview}',
40
66
  'notice.autoTag': '自动放行 · {verdict}',
41
67
  'notice.autoDefault': '自动放行',
42
68
  'notice.rejectedDefault': '已拒绝',
@@ -52,10 +78,12 @@ export const zh = {
52
78
  'history.emptyHint': '自动放行与转人工都会出现在这里',
53
79
  'history.sub': '最新在上 · 点开看命令与详情',
54
80
  'history.tagAuto': '自动放行',
55
- 'history.tagPending': '待处理 {ticket}',
56
- 'history.tagQqAllow': 'QQ 批准 {ticket}',
57
- 'history.tagAllow': '批准 {ticket}',
58
- 'history.tagReject': '拒绝 {ticket}',
81
+ 'history.tagPending': '转人工',
82
+ 'history.tagAllow': '人工批准',
83
+ 'history.tagReject': '人工拒绝',
84
+ 'history.tagCancel': '人工取消',
85
+ 'history.tagUnavailable': '审批不可用',
86
+ 'history.unknownTool': '工具',
59
87
 
60
88
  'detail.request': '请求',
61
89
  'detail.audit': '审核',
@@ -71,7 +99,15 @@ export const zh = {
71
99
  'detail.script': '脚本',
72
100
  'detail.sql': 'SQL',
73
101
  'detail.prompt': '提示词',
102
+ 'detail.input': '输入',
103
+ 'detail.text': '文本',
104
+ 'detail.body': '正文',
105
+ 'detail.message': '消息',
106
+ 'detail.pattern': '模式',
107
+ 'detail.selector': '选择器',
74
108
  'detail.cwd': '工作目录',
109
+ 'detail.workdir': '命令工作目录',
110
+ 'detail.empty': '(空)',
75
111
  'detail.sandbox': '沙箱',
76
112
  'detail.justification': '模型理由',
77
113
  'detail.pipe': '管道',
@@ -82,29 +118,30 @@ export const zh = {
82
118
  'detail.judgeReason': '审核理由',
83
119
  'detail.judgeError': '审核失败',
84
120
  'detail.judgeRaw': '审核结果原文',
85
- 'detail.ticket': '短号',
86
121
  'detail.source': '来源',
87
122
  'detail.judgeFailed': '未完成(解析失败/超时转人工,不执行「其他」的动作)',
88
123
 
89
124
  'set.title': '自动审批',
90
- 'set.intro': '需要审批的行为会自动审批,并可推送到已配置的消息平台。按私人 bot 设计:未绑定聊天时,私聊回「是」会绑成审批目标,不要让陌生人能私聊这个 bot。',
125
+ 'set.intro': '需要审批的行为由审核模型自动判定。允许或拒绝与在网页点按钮相同;拿不准则交给原来的人工审批框。',
91
126
  'set.allowlistCorrupt': '规则文件损坏,当前是内存默认,普通保存不会覆盖磁盘。请修好 allowlist.json,或点「恢复默认」写回出厂规则。',
92
- 'set.pluginCorrupt': '插件配置损坏,拒绝保存以免清空 chatId。请修好 ~/.dsh/approval-bridge/config.json,或',
127
+ 'set.pluginCorrupt': '插件配置损坏,拒绝保存以免清空审核模型。请修好 ~/.dsh/auto-approve/config.json,或',
93
128
  'set.pluginCorruptOverwrite': '覆盖损坏配置',
94
- 'set.qqCorrupt': 'QQ 凭据文件损坏,未覆盖磁盘。请修好 ~/.dsh/approval-bridge/qqbot.json,或重新保存凭据 / 扫码。',
95
129
  'set.loading': '加载中…',
96
130
  'set.loadFailed': '加载失败:{error}',
97
131
  'set.resetConfirm': '再点一次确认恢复',
98
132
  'set.presetMissingTitle': '权限预设',
133
+ 'set.driftTitle': '权限预设表需要更新',
134
+ 'set.driftBody': 'DSH 出厂权限预设表多了 {keys}。本 profile 的 permission 行由本插件写入,patch 会整块替换 config,所以不会自动出现这些预设;请更新插件或手工合并该行。',
99
135
  'set.presetMissingSub': '插件启动时会写入 auto-approve。当前未检测到,可手动补写。',
100
136
  'set.presetWrite': '写入权限预设',
101
137
  'set.presetWriteNote': '写入后需重启 dsh web',
102
138
  'set.presetWrote': '已写入,请重启 dsh web',
103
139
  'set.modeTitle': '自动审批模式',
104
- 'set.modeWs': 'workspace-write(推荐)',
140
+ 'set.modeWs': '工作区可写(推荐)',
105
141
  'set.modeWsHint': '工作区内直接放行,越出工作区需审核。',
106
- 'set.modeRo': 'read-only',
142
+ 'set.modeRo': '只读',
107
143
  'set.modeRoHint': '工作区内写操作也需审核。',
144
+ 'set.modeHint': '点选即写入。改完需重启 dsh web,并重新选择「自动审批」或开新会话。',
108
145
  'set.save': '保存',
109
146
  'set.hotOk': '已生效(热更新,无需重启)',
110
147
  'set.modeSaved': '已写入。请重启 dsh web,并重新选择「自动审批」或开新会话',
@@ -144,59 +181,58 @@ export const zh = {
144
181
  'set.modelDefaultEffort': '模型默认',
145
182
  'set.effortOff': 'off(建议)',
146
183
  'set.judgeTimeoutMs': '审核超时(ms):',
147
- 'set.judgeSaved': '审核模型已保存',
184
+ 'set.judgeSaved': '审核设置已保存',
148
185
  'set.judgeLang': '提示词语言',
149
186
  'set.judgeLangZh': '中文',
150
187
  'set.judgeLangEn': 'English',
151
- 'set.judgeLangHint': '只改发给审核模型的框架语言,不会改当前审核表。恢复默认审核表时使用这里选的语言。',
152
- 'set.qqTitle': 'QQ 审批通道',
153
- 'set.qqSub': '扫码或填凭据。按私人 bot 设计:未绑定 chatId 时,私聊回「是」会绑成审批聊天。不要让陌生人能私聊这个 bot。群必须 @机器人并另配 userId。',
154
- 'set.qqScan': '扫码接入机器人',
155
- 'set.qqRescan': '重新扫码接入',
156
- 'set.qqCancelScan': '取消扫码',
157
- 'set.qqCancelOk': '已取消扫码',
158
- 'set.qqScanStart': '已开始扫码,请用手机 QQ 扫描',
159
- 'set.qqScanOk': '扫码成功,凭据已保存',
160
- 'set.qqScanFail': '扫码失败',
161
- 'set.qqScanStatus': '扫码接入:{status}',
162
- 'set.qqQrAlt': 'QQ 机器人扫码二维码',
163
- 'set.qqQrTip': '请用手机 QQ 扫码并确认创建机器人(约 5 分钟有效)',
164
- 'set.qqAppId': 'AppID',
165
- 'set.qqAppSecret': 'AppSecret',
166
- 'set.qqSecretKeep': 'AppSecret(留空则保留)',
167
- 'set.qqSaveConnect': '保存并连接',
168
- 'set.qqCredsReconnect': '凭据已保存并重连',
169
- 'set.qqReconnect': '重连',
170
- 'set.qqReconnected': '正在重连',
171
- 'set.qqUnknown': '未知',
172
- 'set.qqChatOn': '已选定聊天',
173
- 'set.qqChatOff': '未选定',
174
- 'set.qqPush': '推送:{state}',
175
- 'set.qqPushOn': '开',
176
- 'set.qqPushOff': '关',
177
- 'set.qqPushToggled': '已切换推送',
178
- 'set.qqEnablePush': '启用推送',
179
- 'set.qqPausePush': '暂停推送',
180
- 'set.qqCurrentChat': '当前 chatId:{chatId}',
181
- 'set.qqUnset': '(未选定)',
182
- 'set.qqChatPlaceholder': 'chatId(私聊 openid / 群 g:openid)',
183
- 'set.qqGroupUser': '群 userId',
184
- 'set.qqTimeoutS': '超时s',
185
- 'set.prov.loggingIn': '登录中',
186
- 'set.prov.waitScan': '等待扫码',
187
- 'set.prov.saving': '保存凭据',
188
- 'set.prov.connected': '已连接',
189
- 'set.chatId': 'chatId',
190
- 'set.userId': 'userId(群)',
191
- 'set.notifyTimeout': '提醒间隔(秒)',
192
- 'set.saveTarget': '保存目标/超时',
193
- 'set.targetSaved': '推送目标已保存',
194
- 'set.recent': '最近来信(点选设为审批聊天;群必须 @机器人,还需匹配 userId)',
195
- 'set.noMail': '还没有来信。加好友后给机器人发任意一句。',
196
- 'set.group': '群',
197
- 'set.c2c': '私聊',
198
- 'set.chatPicked': '已选定审批聊天',
188
+ 'set.judgeLangHint': '切换发给审核模型的框架语言与卡片标签,不会改当前审核表。下面的提示词按此语言编辑;恢复默认审核表也用这里选的语言。',
189
+ 'set.judgePrompt': '审核提示词',
190
+ 'set.judgePromptHint': '按所选语言内置默认提示词。用 {{criteria}} 插入当前审核表;删掉占位符时会把审核表附在末尾。与审核模型、超时一起保存。',
191
+ 'set.judgePromptCustom': '已自定义',
192
+ 'set.judgePromptDefault': '默认',
193
+ 'set.resetJudgePrompt': '恢复默认提示词',
194
+ 'set.resetJudgePromptOk': '已恢复默认提示词',
199
195
  'set.overwriteOk': '已覆盖损坏的插件配置',
196
+ 'err.missingPayload': '工具参数不完整,转人工',
197
+ 'err.missingPayloadUncaptured': '未捕获工具参数,转人工',
198
+ 'err.truncatedPayload': '工具参数过长已截断,转人工(禁止按前缀自动放行)',
199
+ 'err.pluginError': '插件判定异常,转人工',
200
+ 'err.allowlistCorrupt': '规则文件损坏,拒绝覆盖。请先「恢复默认」写回出厂规则,或修好磁盘上的 allowlist.json',
201
+ 'err.allowlistWrite': '写入 allowlist 失败',
202
+ 'err.criterionNotFound': '未找到该审核项',
203
+ 'err.criterionNeedId': '需要 id 或 label',
204
+ 'err.criterionIdExists': 'id 已存在',
205
+ 'err.criterionOtherLocked': '「其他」不可删除',
206
+ 'err.criteriaOp': '审核表请用添加 / 修改 / 删除 / 恢复默认',
207
+ 'err.opMustSet': '{kind} 只能用修改操作',
208
+ 'err.invalidNumber': '无效数值',
209
+ 'err.keywordEmpty': '关键词不能为空',
210
+ 'err.keywordNotFound': '未找到该关键词',
211
+ 'err.keywordsOp': '关键词请用添加 / 修改 / 删除 / 恢复默认',
212
+ 'err.valueEmpty': '值不能为空',
213
+ 'err.unknownKind': '未知规则类型:{kind}',
214
+ 'err.unknownOp': '未知操作:{op}',
215
+ 'err.ruleNotFound': '未找到匹配的规则',
216
+ 'err.badBody': '请求体不是 JSON',
217
+ 'err.needSessionId': '需要 sessionId',
218
+ 'err.pluginCorrupt': '插件配置损坏,拒绝覆盖。请修好磁盘文件,或点「覆盖损坏配置」',
219
+ 'err.pluginWrite': '写入配置失败',
220
+ 'err.unknownEndpoint': '未知接口:{endpoint}',
221
+ 'err.internal': '内部错误:{error}',
222
+ 'err.catalog': '无法列出模型:{error}',
223
+ 'err.info': '无法读取模型信息:{error}',
224
+ 'err.judgeUnconfigured': '未配置审核模型',
225
+ 'err.judgeEffort': '思考强度 {effort} 不受支持',
226
+ 'err.judgeTimeout': '审核超时({ms}ms)',
227
+ 'err.judgeRetryTimeout': '审核重试超时({ms}ms)',
228
+ 'err.judgeFailed': '审核失败',
229
+ 'err.judgeCall': '审核模型调用失败:{error}',
230
+ 'err.judgeEmpty': '审核模型输出为空',
231
+ 'err.judgeParse': '审核模型输出无法解析',
232
+ 'err.judgeUpstream': '审核模型路由失败:{error}',
233
+ 'err.noPresetsKey': 'permission 条目缺少 presets 键,请手动添加',
234
+ 'err.preset': '写入预设失败:{error}',
235
+ 'err.presetSandboxMissing': '预设里没有 sandbox 行,无法写入沙箱模式;请检查 profile 的 cordis.patch.yml',
200
236
  'rpc.unavailable': 'connection.rpc 不可用',
201
237
  'rpc.failed': 'RPC 失败',
202
238
  }
@@ -210,8 +246,34 @@ export const en = {
210
246
  'action.allow': 'Allow',
211
247
  'action.human': 'Human',
212
248
 
249
+ 'criterion.deletion': 'Delete/overwrite irreplaceable data',
250
+ 'criterion.credential': 'Credentials/keys/auth changes',
251
+ 'criterion.remote': 'Remote/production/database',
252
+ 'criterion.system': 'System paths/config',
253
+ 'criterion.bulk': 'Bulk irreversible operations',
254
+ 'criterion.approval-config': 'Auto-approve configuration',
255
+ 'criterion.safe': 'Safe/routine reversible',
256
+ 'criterion.other': 'Other (unsure)',
257
+
258
+ 'sandbox.read-only': 'Read-only',
259
+ 'sandbox.workspace-write': 'Workspace write',
260
+ 'sandbox.danger-full-access': 'Full access',
261
+
262
+ 'source.web': 'Web',
263
+
213
264
  'verdict.keyword-allow': 'Keyword allow',
214
265
  'verdict.keyword-reject': 'Keyword reject',
266
+ 'verdict.keyword-human': 'Keyword → human',
267
+ 'verdict.criteria-reject': 'Criteria reject',
268
+ 'verdict.criteria-allow': 'Criteria allow',
269
+ 'verdict.criteria-human': 'Criteria → human',
270
+ 'verdict.judge-failed': 'Judge failed → human',
271
+ 'verdict.missing-payload': 'Missing tool args → human',
272
+ 'verdict.truncated-payload': 'Truncated args → human',
273
+ 'verdict.plugin-error': 'Plugin error → human',
274
+ 'verdict.human': 'To human',
275
+ 'verdict.cancelled': 'Human cancel',
276
+ 'verdict.unavailable': 'Unavailable',
215
277
  'path.keyword-reject': 'Keyword reject',
216
278
  'path.keyword-allow': 'Keyword allow',
217
279
  'path.keyword-human': 'Keyword → human',
@@ -225,14 +287,14 @@ export const en = {
225
287
 
226
288
  'notice.feedError': 'Approval notices unavailable',
227
289
  'notice.feedErrorTag': 'Connection failed',
228
- 'notice.pendingTitle': 'Waiting for human{ticket}: {preview}',
229
- 'notice.pendingTag': 'Human review{ticket}',
230
- 'notice.qqApproved': 'Approved in QQ{ticket}: {preview}',
231
- 'notice.webApproved': 'Approved{ticket}: {preview}',
232
- 'notice.qqApprovedTag': 'Approved in QQ{ticket}',
290
+ 'notice.pendingTitle': 'Waiting for human: {preview}',
291
+ 'notice.pendingTag': 'Human review',
292
+ 'notice.webApproved': 'Approved: {preview}',
233
293
  'notice.webApprovedTag': 'Approved',
234
- 'notice.rejectedTitle': 'Rejected{ticket}: {preview}',
235
- 'notice.rejectedTag': 'Rejected{ticket}',
294
+ 'notice.rejectedTitle': 'Rejected: {preview}',
295
+ 'notice.rejectedTag': 'Rejected',
296
+ 'notice.cancelledTitle': 'Cancelled: {preview}',
297
+ 'notice.unavailableTitle': 'Unavailable: {preview}',
236
298
  'notice.autoTag': 'Auto-allowed · {verdict}',
237
299
  'notice.autoDefault': 'Auto-allowed',
238
300
  'notice.rejectedDefault': 'Rejected',
@@ -248,10 +310,12 @@ export const en = {
248
310
  'history.emptyHint': 'Auto-allows and human escalations appear here',
249
311
  'history.sub': 'Newest first · expand for command and details',
250
312
  'history.tagAuto': 'Auto-allowed',
251
- 'history.tagPending': 'Pending {ticket}',
252
- 'history.tagQqAllow': 'QQ allow {ticket}',
253
- 'history.tagAllow': 'Allow {ticket}',
254
- 'history.tagReject': 'Reject {ticket}',
313
+ 'history.tagPending': 'To human',
314
+ 'history.tagAllow': 'Human allow',
315
+ 'history.tagReject': 'Human reject',
316
+ 'history.tagCancel': 'Human cancel',
317
+ 'history.tagUnavailable': 'Unavailable',
318
+ 'history.unknownTool': 'Tool',
255
319
 
256
320
  'detail.request': 'Request',
257
321
  'detail.audit': 'Review',
@@ -267,7 +331,15 @@ export const en = {
267
331
  'detail.script': 'Script',
268
332
  'detail.sql': 'SQL',
269
333
  'detail.prompt': 'Prompt',
334
+ 'detail.input': 'Input',
335
+ 'detail.text': 'Text',
336
+ 'detail.body': 'Body',
337
+ 'detail.message': 'Message',
338
+ 'detail.pattern': 'Pattern',
339
+ 'detail.selector': 'Selector',
270
340
  'detail.cwd': 'Working directory',
341
+ 'detail.workdir': 'Command working directory',
342
+ 'detail.empty': '(empty)',
271
343
  'detail.sandbox': 'Sandbox',
272
344
  'detail.justification': 'Model justification',
273
345
  'detail.pipe': 'Pipeline',
@@ -278,29 +350,30 @@ export const en = {
278
350
  'detail.judgeReason': 'Judge reason',
279
351
  'detail.judgeError': 'Judge error',
280
352
  'detail.judgeRaw': 'Judge raw output',
281
- 'detail.ticket': 'Ticket',
282
353
  'detail.source': 'Source',
283
354
  'detail.judgeFailed': 'Incomplete (parse failure/timeout → human; does not run Other)',
284
355
 
285
356
  'set.title': 'Auto-approve',
286
- 'set.intro': 'Actions that need approval are auto-approved and can be pushed to a configured chat. Designed for a private bot: if no chat is bound, a C2C reply of “是” binds that chat. Do not let strangers DM this bot.',
357
+ 'set.intro': 'Actions that need approval are judged automatically. Allow and reject match clicking the Web buttons; uncertainty goes to the original human dialog.',
287
358
  'set.allowlistCorrupt': 'The rules file is corrupt. This process is using in-memory defaults and will not overwrite the disk. Repair allowlist.json, or Restore defaults to write shipped rules.',
288
- 'set.pluginCorrupt': 'Plugin config is corrupt; saves are refused so chatId is not wiped. Repair ~/.dsh/approval-bridge/config.json, or ',
359
+ 'set.pluginCorrupt': 'Plugin config is corrupt; saves are refused so the judge model is not wiped. Repair ~/.dsh/auto-approve/config.json, or ',
289
360
  'set.pluginCorruptOverwrite': 'Overwrite corrupt config',
290
- 'set.qqCorrupt': 'QQ credentials file is corrupt and was not overwritten. Repair ~/.dsh/approval-bridge/qqbot.json, or save credentials / scan again.',
291
361
  'set.loading': 'Loading…',
292
362
  'set.loadFailed': 'Failed to load: {error}',
293
363
  'set.resetConfirm': 'Click again to confirm restore',
294
364
  'set.presetMissingTitle': 'Permission preset',
365
+ 'set.driftTitle': 'Permission preset table needs updating',
366
+ 'set.driftBody': 'The shipped permission table has new presets: {keys}. This profile\'s permission row is written by this plugin, and a patch replaces that config wholesale, so they will not appear automatically. Update the plugin or merge that row by hand.',
295
367
  'set.presetMissingSub': 'Startup writes auto-approve. It was not detected; you can write it now.',
296
368
  'set.presetWrite': 'Write permission preset',
297
369
  'set.presetWriteNote': 'Restart dsh web after writing',
298
370
  'set.presetWrote': 'Written. Restart dsh web',
299
371
  'set.modeTitle': 'Auto-approve mode',
300
- 'set.modeWs': 'workspace-write (recommended)',
372
+ 'set.modeWs': 'Workspace write (recommended)',
301
373
  'set.modeWsHint': 'In-workspace writes skip approval; outside the workspace still goes through the judge.',
302
- 'set.modeRo': 'read-only',
374
+ 'set.modeRo': 'Read-only',
303
375
  'set.modeRoHint': 'In-workspace writes also go through the judge.',
376
+ 'set.modeHint': 'Clicking a mode writes it. Then restart dsh web and re-select Auto-approve or start a new session.',
304
377
  'set.save': 'Save',
305
378
  'set.hotOk': 'Applied (live; no restart)',
306
379
  'set.modeSaved': 'Written. Restart dsh web and re-select Auto-approve or start a new session',
@@ -340,59 +413,58 @@ export const en = {
340
413
  'set.modelDefaultEffort': 'Model default',
341
414
  'set.effortOff': 'off (recommended)',
342
415
  'set.judgeTimeoutMs': 'Judge timeout (ms):',
343
- 'set.judgeSaved': 'Judge model saved',
416
+ 'set.judgeSaved': 'Judge settings saved',
344
417
  'set.judgeLang': 'Prompt language',
345
418
  'set.judgeLangZh': 'Chinese',
346
419
  'set.judgeLangEn': 'English',
347
- 'set.judgeLangHint': 'Changes only the judge prompt framework, not the current criteria table. Restore default criteria uses this language.',
348
- 'set.qqTitle': 'QQ approval channel',
349
- 'set.qqSub': 'Scan or paste credentials. Designed for a private bot: if no chatId is bound, a C2C reply of “是” binds that chat. Do not let strangers DM this bot. Groups must @ the bot and set userId.',
350
- 'set.qqScan': 'Scan to create bot',
351
- 'set.qqRescan': 'Scan again',
352
- 'set.qqCancelScan': 'Cancel scan',
353
- 'set.qqCancelOk': 'Scan cancelled',
354
- 'set.qqScanStart': 'Scan started; use mobile QQ',
355
- 'set.qqScanOk': 'Scan succeeded; credentials saved',
356
- 'set.qqScanFail': 'Scan failed',
357
- 'set.qqScanStatus': 'Scan: {status}',
358
- 'set.qqQrAlt': 'QQ bot QR code',
359
- 'set.qqQrTip': 'Scan with mobile QQ and confirm creating the bot (about 5 minutes)',
360
- 'set.qqAppId': 'AppID',
361
- 'set.qqAppSecret': 'AppSecret',
362
- 'set.qqSecretKeep': 'AppSecret (leave blank to keep)',
363
- 'set.qqSaveConnect': 'Save and connect',
364
- 'set.qqCredsReconnect': 'Credentials saved; reconnecting',
365
- 'set.qqReconnect': 'Reconnect',
366
- 'set.qqReconnected': 'Reconnecting',
367
- 'set.qqUnknown': 'Unknown',
368
- 'set.qqChatOn': 'Chat selected',
369
- 'set.qqChatOff': 'No chat selected',
370
- 'set.qqPush': 'Push: {state}',
371
- 'set.qqPushOn': 'on',
372
- 'set.qqPushOff': 'off',
373
- 'set.qqPushToggled': 'Push toggled',
374
- 'set.qqEnablePush': 'Enable push',
375
- 'set.qqPausePush': 'Pause push',
376
- 'set.qqCurrentChat': 'Current chatId: {chatId}',
377
- 'set.qqUnset': '(none)',
378
- 'set.qqChatPlaceholder': 'chatId (C2C openid / group g:openid)',
379
- 'set.qqGroupUser': 'Group userId',
380
- 'set.qqTimeoutS': 'Timeout s',
381
- 'set.prov.loggingIn': 'Signing in',
382
- 'set.prov.waitScan': 'Waiting for scan',
383
- 'set.prov.saving': 'Saving credentials',
384
- 'set.prov.connected': 'Connected',
385
- 'set.chatId': 'chatId',
386
- 'set.userId': 'userId (group)',
387
- 'set.notifyTimeout': 'Reminder interval (seconds)',
388
- 'set.saveTarget': 'Save target / timeout',
389
- 'set.targetSaved': 'Push target saved',
390
- 'set.recent': 'Recent incoming (click to set as the approval chat; groups must @ the bot and match userId)',
391
- 'set.noMail': 'No messages yet. Friend the bot and send it anything.',
392
- 'set.group': 'Group',
393
- 'set.c2c': 'C2C',
394
- 'set.chatPicked': 'Approval chat selected',
420
+ 'set.judgeLangHint': 'Switches the judge prompt framework and card labels, not the current criteria table. The prompt below is edited per language; restore default criteria also uses this language.',
421
+ 'set.judgePrompt': 'Judge prompt',
422
+ 'set.judgePromptHint': 'Built-in default for the selected language. Use {{criteria}} to insert the current criteria table; if the placeholder is removed, the table is appended. Saved with the judge model and timeout.',
423
+ 'set.judgePromptCustom': 'Custom',
424
+ 'set.judgePromptDefault': 'Default',
425
+ 'set.resetJudgePrompt': 'Restore default prompt',
426
+ 'set.resetJudgePromptOk': 'Default prompt restored',
395
427
  'set.overwriteOk': 'Corrupt plugin config overwritten',
428
+ 'err.missingPayload': 'Tool arguments are incomplete; sending to human',
429
+ 'err.missingPayloadUncaptured': 'Tool arguments were not captured; sending to human',
430
+ 'err.truncatedPayload': 'Tool arguments were truncated; sending to human (no prefix auto-allow)',
431
+ 'err.pluginError': 'Plugin error; sending to human',
432
+ 'err.allowlistCorrupt': 'Rules file is corrupt; refusing to overwrite. Restore defaults or fix allowlist.json on disk.',
433
+ 'err.allowlistWrite': 'Failed to write allowlist',
434
+ 'err.criterionNotFound': 'Criterion not found',
435
+ 'err.criterionNeedId': 'id or label is required',
436
+ 'err.criterionIdExists': 'id already exists',
437
+ 'err.criterionOtherLocked': '“Other” cannot be deleted',
438
+ 'err.criteriaOp': 'Criteria accept add / set / remove / reset',
439
+ 'err.opMustSet': '{kind} only accepts set',
440
+ 'err.invalidNumber': 'Invalid number',
441
+ 'err.keywordEmpty': 'Keyword cannot be empty',
442
+ 'err.keywordNotFound': 'Keyword not found',
443
+ 'err.keywordsOp': 'Keywords accept add / set / remove / reset',
444
+ 'err.valueEmpty': 'Value cannot be empty',
445
+ 'err.unknownKind': 'Unknown rule kind: {kind}',
446
+ 'err.unknownOp': 'Unknown operation: {op}',
447
+ 'err.ruleNotFound': 'No matching rule',
448
+ 'err.badBody': 'Request body is not JSON',
449
+ 'err.needSessionId': 'sessionId is required',
450
+ 'err.pluginCorrupt': 'Plugin config is corrupt; refusing to overwrite. Fix the file on disk, or overwrite the corrupt config.',
451
+ 'err.pluginWrite': 'Failed to write plugin config',
452
+ 'err.unknownEndpoint': 'Unknown endpoint: {endpoint}',
453
+ 'err.internal': 'Internal error: {error}',
454
+ 'err.catalog': 'Could not list models: {error}',
455
+ 'err.info': 'Could not load model info: {error}',
456
+ 'err.judgeUnconfigured': 'Judge model is not configured',
457
+ 'err.judgeEffort': 'reasoningEffort {effort} is not supported',
458
+ 'err.judgeTimeout': 'Judge timed out ({ms}ms)',
459
+ 'err.judgeRetryTimeout': 'Judge retry timed out ({ms}ms)',
460
+ 'err.judgeFailed': 'Judge failed',
461
+ 'err.judgeCall': 'Judge call failed: {error}',
462
+ 'err.judgeEmpty': 'Judge output was empty',
463
+ 'err.judgeParse': 'Judge output could not be parsed',
464
+ 'err.judgeUpstream': 'Judge route failed: {error}',
465
+ 'err.noPresetsKey': 'The permission entry has no presets key; add it manually',
466
+ 'err.preset': 'Failed to write preset: {error}',
467
+ 'err.presetSandboxMissing': 'The preset has no sandbox line; cannot set the sandbox mode. Check the profile cordis.patch.yml',
396
468
  'rpc.unavailable': 'connection.rpc is unavailable',
397
469
  'rpc.failed': 'RPC failed',
398
470
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dnalec/dsh-auto-approve",
3
- "version": "0.1.3",
4
- "description": "DeepSeek Harness 自动审批门控 + QQ 官方 Bot 审批推送(支持扫码接入)+ 设置页",
3
+ "version": "0.2.1",
4
+ "description": "DeepSeek Harness 自动审批门控 + 设置页",
5
5
  "type": "module",
6
6
  "main": "./src/index.mjs",
7
7
  "exports": {
@@ -16,11 +16,14 @@
16
16
  "cordis.patch.yml",
17
17
  "README.md",
18
18
  "README.zh.md",
19
+ "CHANGELOG.md",
19
20
  "LICENSE"
20
21
  ],
22
+
21
23
  "scripts": {
22
24
  "test": "node --test tests/*.test.mjs",
23
- "check": "node --check src/index.mjs && node --check src/rules.mjs && node --check src/tickets.mjs && node --check src/qqbot.mjs && node --check src/provisioning.mjs && node --check src/preset-patch.mjs && node --check src/util.mjs && node --check locales.mjs && node --check client.js"
25
+ "check": "node --check src/index.mjs && node --check src/rules.mjs && node --check src/preset-patch.mjs && node --check src/util.mjs && node --check locales.mjs && node --check client.js && node --check scripts/sync-locales.mjs && node scripts/sync-locales.mjs",
26
+ "locales:sync": "node scripts/sync-locales.mjs --write"
24
27
  },
25
28
  "keywords": [
26
29
  "deepseek-harness",
@@ -43,12 +46,6 @@
43
46
  "bugs": {
44
47
  "url": "https://github.com/DNAlec/dsh-auto-approve/issues"
45
48
  },
46
- "dependencies": {
47
- "qrcode": "^1.5.4"
48
- },
49
- "optionalDependencies": {
50
- "@tencent-connect/qqbot-connector": "^1.2.0"
51
- },
52
49
  "dsh": {
53
50
  "bundle": {
54
51
  "patch": "./cordis.patch.yml"