dsh-team-bots 0.3.12 → 0.3.70

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.
Files changed (76) hide show
  1. package/NOTICE +3 -4
  2. package/README.md +2 -2
  3. package/docs/README.zh.md +2 -2
  4. package/docs/assets/global-config.png +0 -0
  5. package/docs/assets/global-config.zh.png +0 -0
  6. package/docs/assets/tasks.png +0 -0
  7. package/docs/assets/tasks.zh.png +0 -0
  8. package/docs/assets/usage.png +0 -0
  9. package/docs/assets/usage.zh.png +0 -0
  10. package/package.json +8 -2
  11. package/src/api.js +10 -1
  12. package/src/config.js +180 -2
  13. package/src/db-migrations.js +55 -4
  14. package/src/db.js +30 -3
  15. package/src/http.js +21 -1
  16. package/src/runtime.js +16 -1
  17. package/src/seed-bots.js +4 -0
  18. package/src/service.js +21 -2
  19. package/src/services/approvals.js +303 -10
  20. package/src/services/bots.js +12 -3
  21. package/src/services/core.js +31 -2
  22. package/src/services/memory.js +24 -8
  23. package/src/services/projects.js +12 -1
  24. package/src/services/run-finish.js +11 -0
  25. package/src/services/runtime/session.js +116 -32
  26. package/src/services/scheduler.js +20 -0
  27. package/src/services/system.js +164 -10
  28. package/src/services/task-review.js +90 -55
  29. package/src/services/tasks.js +5 -2
  30. package/ui/app.js +7 -10
  31. package/ui/i18n/en/chat.js +2 -0
  32. package/ui/i18n/en/common.js +14 -0
  33. package/ui/i18n/en/settings.js +81 -1
  34. package/ui/i18n/en/tasks.js +3 -0
  35. package/ui/i18n/zh/chat.js +2 -0
  36. package/ui/i18n/zh/common.js +14 -0
  37. package/ui/i18n/zh/settings.js +81 -1
  38. package/ui/i18n/zh/tasks.js +3 -0
  39. package/ui/modules/api.js +9 -1
  40. package/ui/modules/approval-rule-modal.js +31 -0
  41. package/ui/modules/cards.js +6 -3
  42. package/ui/modules/chat.js +3 -2
  43. package/ui/modules/composer.js +6 -1
  44. package/ui/modules/events-board.js +46 -0
  45. package/ui/modules/events-misc.js +43 -0
  46. package/ui/modules/events-submit.js +45 -0
  47. package/ui/modules/form-validation.js +204 -0
  48. package/ui/modules/global-pages.js +8 -5
  49. package/ui/modules/modal-forms.js +3 -2
  50. package/ui/modules/modal-layer.js +6 -1
  51. package/ui/modules/page-shell.js +10 -7
  52. package/ui/modules/permissions.js +56 -0
  53. package/ui/modules/settings.js +103 -21
  54. package/ui/modules/state.js +10 -0
  55. package/ui/modules/task-menu.js +147 -0
  56. package/ui/modules/tasks.js +9 -8
  57. package/ui/modules/util.js +58 -6
  58. package/ui/styles/a11y.css +13 -0
  59. package/ui/styles/base.css +57 -11
  60. package/ui/styles/buttons.css +46 -6
  61. package/ui/styles/cards.css +54 -0
  62. package/ui/styles/chat.css +23 -2
  63. package/ui/styles/global-config.css +7 -4
  64. package/ui/styles/modal.css +28 -0
  65. package/ui/styles/settings.css +23 -1
  66. package/ui/styles/tasks.css +51 -1
  67. package/ui/styles/toast.css +18 -11
  68. package/ui/styles/usage.css +2 -0
  69. package/ui/styles/wide.css +4 -0
  70. package/docs/assets/channel-redesign.png +0 -0
  71. package/docs/assets/global-config-dark.png +0 -0
  72. package/docs/assets/global-config-light.png +0 -0
  73. package/docs/assets/global-config-light.zh.png +0 -0
  74. package/docs/assets/global-config-redesign.png +0 -0
  75. package/docs/assets/secrets-redesign.png +0 -0
  76. package/docs/assets/usage-redesign-global.png +0 -0
@@ -7,8 +7,10 @@
7
7
 
8
8
  import { badRequest, conflict, forbidden } from '../errors.js'
9
9
  import { bool } from '../config.js'
10
+ import { REVIEWER_BOT_NAME } from '../seed-bots.js'
10
11
  import { id, nowIso, text } from '../util.js'
11
12
  import { parseWriteScopes, readWriteScopes } from './write-scopes.js'
13
+ import { effectiveSandbox } from './runtime/sandbox-policy.js'
12
14
 
13
15
  export const taskReviewMethods = {
14
16
  async reviewFromBot(sessionId, input) {
@@ -21,14 +23,34 @@ export const taskReviewMethods = {
21
23
  return this.applyReview(task, project, input.decision, input.comment, actor)
22
24
  },
23
25
 
26
+ // 验收核验分档开关:默认开,DSH_TEAM_REVIEW_READ_ONLY_SKIP=0 关闭回到全量强制核验。
27
+ reviewReadOnlySkipEnabled() {
28
+ return bool(this.config.reviewReadOnlySkip, true)
29
+ },
30
+
31
+ // 只读档交付判定(核验分档的单一口径):交付运行的生效沙箱为 read-only(非写运行被
32
+ // run_type 收紧,或任务覆盖/负责人配置档为只读)即视为只读交付——物理上写不了工作区,
33
+ // 核验子代理重读一遍的边际价值最低。queueAutoReviewDelegate 跳过、验收闸门放宽、
34
+ // taskReviewStatus 标记 skipped 三处共用本判定。
35
+ readOnlyDelivery(run, taskRow) {
36
+ if (!run || !this.reviewReadOnlySkipEnabled()) return false
37
+ // 保守卫:mode 缺失的坏数据不豁免(DB 列 NOT NULL DEFAULT 'write',正常不会缺),
38
+ // 只有显式 read 运行或写运行被覆盖/配置收紧到只读才豁免。
39
+ if (run.mode !== 'write' && run.mode !== 'read') return false
40
+ const bot = this.store.get('SELECT id, file_policy FROM bots WHERE id = ?', run.bot_id)
41
+ const task = taskRow ?? (run.task_id ? this.store.get('SELECT id, sandbox_override FROM tasks WHERE id = ?', run.task_id) : null)
42
+ return effectiveSandbox(run, bot, task).mode === 'read-only'
43
+ },
44
+
24
45
  // 验收机械闸(DSHBOTS-318/353):把「验收必须经由子代理」从提示约束升级为机械约束——
25
46
  // owner bot 的 team_review_task 前置校验本评审周期内的子代理账目(run_events 的
26
47
  // subagent_spawned)。周期起点 T=最近一次交付(run_succeeded)或看板流转
27
- // (status→in_review)事件的 created_at 取 MAX;账目归属两条认领线:
28
- // 本任务的 owner 运行(task_id+bot_id)或调用方会话的任意运行——两跳正规流程
29
- // (review_delegate 派子代理 → 新运行只裁决)的账目挂在上一跳已结束运行上,
30
- // 按「当运行有账」查必漏,故按周期查。comment 显式注明「兜底验收」放行
31
- // (对应 router 硬流程第 4 条:子代理失败重试一次仍失败时 director 兜底)。
48
+ // (status→in_review)事件的 created_at 取 MAX;账目归属三条认领线:
49
+ // 本任务的 owner 运行(task_id+bot_id)、调用方会话的任意运行、或本任务上的委派核验
50
+ // 运行(task_id+trigger_type,DSHBOTS-365:核验承接人可能是成员 reviewer 而非总监,
51
+ // 其子代理账目挂在自己名下)。两跳正规流程(review_delegate 派子代理 → 新运行只裁决)
52
+ // 的账目挂在上一跳已结束运行上,按当运行有账查必漏,故按周期查。comment 显式注明
53
+ // 「兜底验收」放行(对应 router 硬流程第 4 条:子代理失败重试一次仍失败时 director 兜底)。
32
54
  // 仅机器人路径:微信管理员/看板 owner 走 applyReview,不经过本闸。
33
55
  assertReviewSubagentVerified(sessionId, project, task, comment) {
34
56
  if (comment?.includes('兜底验收')) return
@@ -38,13 +60,23 @@ export const taskReviewMethods = {
38
60
  AND (type = 'run_succeeded' OR (type = 'status' AND json_extract(data_json, '$.to') = 'in_review'))`,
39
61
  task.id,
40
62
  )?.t ?? ''
63
+ // 核验分档:本评审周期的交付运行为只读档(事件载荷 runId 指回交付运行)时免子代理
64
+ // 账目——与自动委派豁免同口径;无交付运行锚(如纯看板流转)时保持强制,不放宽。
65
+ const delivered = this.store.get(
66
+ `SELECT r.* FROM task_events e JOIN runs r ON r.id = json_extract(e.data_json, '$.runId')
67
+ WHERE e.task_id = ? AND e.type = 'run_succeeded' AND e.created_at >= ?
68
+ ORDER BY e.created_at DESC LIMIT 1`,
69
+ task.id, windowStart,
70
+ )
71
+ if (delivered && this.readOnlyDelivery(delivered, task)) return
41
72
  const ledger = this.store.get(
42
73
  `SELECT 1 AS hit FROM runs r
43
- WHERE ((r.task_id = ? AND r.bot_id = ?) OR r.session_id = ?)
74
+ WHERE ((r.task_id = ? AND r.bot_id = ?) OR r.session_id = ?
75
+ OR (r.task_id = ? AND r.trigger_type = 'review_delegate'))
44
76
  AND EXISTS (SELECT 1 FROM run_events e
45
77
  WHERE e.run_id = r.id AND e.type = 'subagent_spawned' AND e.created_at >= ?)
46
78
  LIMIT 1`,
47
- task.id, project.owner_bot_id, sessionId, windowStart,
79
+ task.id, project.owner_bot_id, sessionId, task.id, windowStart,
48
80
  )
49
81
  if (ledger) return
50
82
  // DSHBOTS-269 失败语义引导:拒绝文案 = 原因 + 正确下一步。
@@ -55,28 +87,6 @@ export const taskReviewMethods = {
55
87
  )
56
88
  },
57
89
 
58
- // 执行者不得验收(builder≠verifier,吸收自 dsh-agent-team 的协作理念):
59
- // bot 验收时校验该 bot 从未担任过本卡负责人——含当前 assignee 与历史派单
60
- // (task_events 的 created/assigned 事件)。工作台 owner(人)与看板/看门狗
61
- // (system)不受此闸:信任边界归人,机械闸只拦 bot 自审自发。
62
- assertAcceptorNotExecutor(task, project, actorBotId) {
63
- const identifier = `${project.key}-${task.number}`
64
- const executed = task.assignee_bot_id === actorBotId || !!this.store.get(
65
- `SELECT 1 FROM task_events WHERE task_id = ?
66
- AND ((type = 'assigned' AND json_extract(data_json, '$.botId') = ?)
67
- OR (type = 'created' AND json_extract(data_json, '$.assigneeBotId') = ?))
68
- LIMIT 1`,
69
- task.id, actorBotId, actorBotId,
70
- )
71
- if (executed) {
72
- throw conflict(
73
- `任务 ${identifier} 的验收者就是它的执行者,执行者不得验收:`
74
- + '把该卡验收交给未执行过本卡的 bot(team_assign_task 重派验收方),'
75
- + '或由工作台 owner 在看板/管理通道直接验收。',
76
- )
77
- }
78
- },
79
-
80
90
  /** 验收/退回的共用流程:owner Bot 会话与微信管理员共用。 */
81
91
  async applyReview(task, project, decision, comment, actor) {
82
92
  const identifier = `${project.key}-${task.number}`
@@ -89,9 +99,6 @@ export const taskReviewMethods = {
89
99
  + '若卡面或目标有误,用 team_assign_task 重派原任务(task=原任务号,附 title/description 即改卡)修正。',
90
100
  )
91
101
  }
92
- if (decision === 'accept' && actor?.type === 'bot') {
93
- this.assertAcceptorNotExecutor(task, project, actor.id)
94
- }
95
102
  if (decision === 'accept') {
96
103
  await this.updateTask(task.id, { status: 'done' }, actor)
97
104
  if (comment) await this.addComment(task.id, comment, actor)
@@ -125,10 +132,12 @@ export const taskReviewMethods = {
125
132
  return this.taskView(this.taskRow(task.id))
126
133
  },
127
134
 
128
- // 验收核验委派(DSHBOTS-107):待验收任务上,owner 一键把核验工作派给总监 Bot,
129
- // 由其会话内的 subagent/subagent_fork 并行完成(提示词见 runtime/prompt.js 的
130
- // review-verification 模板)。核验结论以任务评论写回(finishRun 复用 addComment 通道),
131
- // 裁决权不变:accept/return 仍由 owner 经 team_review_task 或看板执行,本方法不碰任务状态。
135
+ // 验收核验委派(DSHBOTS-107;DSHBOTS-365 承接人默认 reviewer):待验收任务上,owner
136
+ // 一键委派子代理核验——承接人优先项目内种子 reviewer(reviewDelegateBotFor),无则
137
+ // 总监 Bot 兜底,由其会话内的 subagent/subagent_fork 并行完成(提示词见
138
+ // runtime/prompt.js 的 review-verification 模板)。核验结论以任务评论写回(finishRun
139
+ // 复用 addComment 通道),不改任务状态、不代负责人裁决:accept/return 仍由 owner 经
140
+ // team_review_task 或看板执行,本方法不碰任务状态。
132
141
  async taskReviewDelegate(taskId, actor = this.actor()) {
133
142
  if (actor.type !== 'user') throw forbidden('只有工作台 owner 可以委派子代理核验')
134
143
  const task = this.taskRow(taskId)
@@ -174,6 +183,19 @@ export const taskReviewMethods = {
174
183
  return this.taskView(this.taskRow(taskId))
175
184
  },
176
185
 
186
+ // 核验承接人(DSHBOTS-365 产品默认):项目成员里的种子 reviewer 优先(固定名识别,
187
+ // 改名/移除/不可用即失效),回落总监自行核验(兜底)。裁决权不变:仍归 owner。
188
+ reviewDelegateBotFor(project) {
189
+ if (!project.owner_bot_id) return null
190
+ return this.store.get(
191
+ `SELECT b.* FROM bots b
192
+ JOIN project_members m ON m.member_type = 'bot' AND m.member_id = b.id
193
+ WHERE m.project_id = ? AND b.name = ? AND b.status = 'active' AND b.id <> ?
194
+ LIMIT 1`,
195
+ project.id, REVIEWER_BOT_NAME, project.owner_bot_id,
196
+ )
197
+ },
198
+
177
199
  // 核验委派共享入口(DSHBOTS-113):手动按钮(taskReviewDelegate)与交付后自动委派
178
200
  // (review_delegate_auto outbox)走同一实现,守卫(待验收状态 / 可用总监 / one_active
179
201
  // 幂等复看)与运行形态(kind='review', mode='read', trigger='review_delegate')完全一致。
@@ -186,6 +208,8 @@ export const taskReviewMethods = {
186
208
  ? this.store.get("SELECT * FROM bots WHERE id = ? AND status = 'active'", project.owner_bot_id)
187
209
  : null
188
210
  if (!owner) throw conflict(`项目 ${project.name} 没有可用的总监 Bot,无法委派核验`)
211
+ // 核验承接人:优先成员 reviewer(DSHBOTS-365),无则总监兜底。
212
+ const verifier = this.reviewDelegateBotFor(project) ?? owner
189
213
  const active = this.store.get(
190
214
  "SELECT id, trigger_type FROM runs WHERE task_id = ? AND status IN ('queued', 'running')",
191
215
  task.id,
@@ -198,34 +222,45 @@ export const taskReviewMethods = {
198
222
  }
199
223
  // DSHBOTS-358:额度路由(与任务运行同口径)——主 provider 耗尽时走备用模型,
200
224
  // 无可用备用则留 queued 等恢复;路由快照写进运行行的 model_* 三列。
201
- const routing = this.quotaRoutingForBot(owner)
225
+ const routing = this.quotaRoutingForBot(verifier)
202
226
  const routeProvider = routing.mode === 'fallback' ? routing.provider : null
203
227
  const routeModel = routing.mode === 'fallback' ? routing.model : null
204
228
  const routeEffort = routing.mode === 'fallback' ? routing.effort : null
205
- // busy 闸(DSHBOTS-290):总监忙时不落 runs 行(撞 one_active_run_per_bot),挂待
229
+ // busy 闸(DSHBOTS-290):承接人忙时不落 runs 行(撞 one_active_run_per_bot),挂待
206
230
  // 处理队列空闲建回(insertHeldMessageRun 的 owner_task 分支);返回 deferred 让
207
231
  // 手动入口与 outbox 自动入口都能感知「已挂起」而非失败。
208
- if (this.botBusy(owner.id, project.id)) {
209
- this.holdPendingMessage(owner.id, project.id, {
210
- kind: 'owner_task', messageId: `owner_task:${task.id}:review_delegate`, taskId: task.id,
211
- projectId: project.id, runKind: 'review', triggerType: 'review_delegate', queuedAt: nowIso(),
212
- routing: routing.mode === 'fallback'
213
- ? { mode: 'fallback', provider: routing.provider, model: routing.model, effort: routing.effort, ref: routing.ref }
214
- : routing.mode === 'wait'
215
- ? { mode: 'wait', resetAt: routing.resetAt }
216
- : { mode: 'primary' },
217
- })
232
+ const hold = () => this.holdPendingMessage(verifier.id, project.id, {
233
+ kind: 'owner_task', messageId: `owner_task:${task.id}:review_delegate`, taskId: task.id,
234
+ projectId: project.id, runKind: 'review', triggerType: 'review_delegate', queuedAt: nowIso(),
235
+ routing: routing.mode === 'fallback'
236
+ ? { mode: 'fallback', provider: routing.provider, model: routing.model, effort: routing.effort, ref: routing.ref }
237
+ : routing.mode === 'wait'
238
+ ? { mode: 'wait', resetAt: routing.resetAt }
239
+ : { mode: 'primary' },
240
+ })
241
+ if (this.botBusy(verifier.id, project.id)) {
242
+ hold()
218
243
  return { runId: null, deferred: true }
219
244
  }
220
245
  const runId = id('run')
221
246
  const createdAt = nowIso()
222
- this.store.run(
223
- `INSERT INTO runs(id, project_id, bot_id, task_id, kind, mode, trigger_type, trigger_ref, status,
224
- attempt, idempotency_key, model_provider, model_model, model_effort, queued_at)
225
- VALUES (?, ?, ?, ?, 'review', 'read', 'review_delegate', ?, 'queued', 1, ?, ?, ?, ?, ?)`,
226
- runId, project.id, owner.id, task.id, task.id, `review_delegate:${task.id}:${Date.now()}:${runId}`,
227
- routeProvider, routeModel, routeEffort, createdAt,
228
- )
247
+ try {
248
+ this.store.run(
249
+ `INSERT INTO runs(id, project_id, bot_id, task_id, kind, mode, trigger_type, trigger_ref, status,
250
+ attempt, idempotency_key, model_provider, model_model, model_effort, queued_at)
251
+ VALUES (?, ?, ?, ?, 'review', 'read', 'review_delegate', ?, 'queued', 1, ?, ?, ?, ?, ?)`,
252
+ runId, project.id, verifier.id, task.id, task.id, `review_delegate:${task.id}:${Date.now()}:${runId}`,
253
+ routeProvider, routeModel, routeEffort, createdAt,
254
+ )
255
+ } catch (error) {
256
+ // 查后插竞态(DSHBOTS-300 同款):busy 检查与 INSERT 之间承接人被占用,撞
257
+ // one_active_run_per_bot——挂待处理队列空闲建回,同 busy 闸返回 deferred,不向上抛。
258
+ if (this.isRunBotUniqueViolation(error)) {
259
+ hold()
260
+ return { runId: null, deferred: true }
261
+ }
262
+ throw error
263
+ }
229
264
  this.store.run(
230
265
  'INSERT INTO run_events(id, run_id, type, message, created_at) VALUES (?, ?, ?, ?, ?)',
231
266
  id('evt'), runId, 'queued',
@@ -365,15 +365,18 @@ export const tasksMethods = {
365
365
  },
366
366
 
367
367
  // 核验状态(DSHBOTS-113):none=未核验 / pending=核验中(委派运行在跑或自动委派待投递)/
368
- // done=本次交付已有核验结论 / failed=核验失败(运行失败或自动委派重试耗尽)。
368
+ // done=本次交付已有核验结论 / failed=核验失败(运行失败或自动委派重试耗尽)/
369
+ // skipped=只读档交付按策略跳过核验(readOnlyDelivery 豁免)。
369
370
  // 以「最近一次成功的执行运行」(本次交付)为基准,只认其后发起的核验,避免上一轮
370
371
  // 交付的旧结论被误读为本轮已核验。自动流程失败必须在 UI 可见(防静默漏审)。
371
372
  taskReviewStatus(task) {
372
373
  const delivery = this.store.get(
373
- "SELECT queued_at FROM runs WHERE task_id = ? AND kind = 'task' AND status = 'succeeded' AND COALESCE(error_code, '') <> 'SUPERSEDED' ORDER BY ended_at DESC LIMIT 1",
374
+ "SELECT queued_at, bot_id, task_id, mode FROM runs WHERE task_id = ? AND kind = 'task' AND status = 'succeeded' AND COALESCE(error_code, '') <> 'SUPERSEDED' ORDER BY ended_at DESC LIMIT 1",
374
375
  task.id,
375
376
  )
376
377
  if (!delivery) return 'none'
378
+ // 核验分档:只读档交付按策略跳过核验,标 skipped(UI 呈现「只读免核验」而非误报未核验)。
379
+ if (this.readOnlyDelivery(delivery, task)) return 'skipped'
377
380
  const activeRun = this.store.get(
378
381
  "SELECT id FROM runs WHERE task_id = ? AND trigger_type = 'review_delegate' AND status IN ('queued', 'running') AND queued_at >= ?",
379
382
  task.id, delivery.queued_at,
package/ui/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { state, STATUS, STATUS_ORDER, PRIORITY, PROPOSAL_STATUS, COLORS, COLOR_NAMES, BOT_STATUS, RUN_STATUS, RUN_KIND, CHAT_PAGE_SIZE, CHAT_ACTIVE_TASK_LIMIT, SKILL_STATUS, MEMORY_STATUS, PROPOSAL_KIND, TERMINAL_STATUS, CREATOR_TYPE, EFFORT, FILE_POLICY, DEFAULT_FILE_POLICY, VIEW_ACTION, NAV, SOLO_NAV } from './modules/state.js'
1
+ import { state, STATUS, STATUS_ORDER, PRIORITY, PROPOSAL_STATUS, COLORS, COLOR_NAMES, BOT_STATUS, RUN_STATUS, RUN_KIND, CHAT_PAGE_SIZE, CHAT_ACTIVE_TASK_LIMIT, SKILL_STATUS, MEMORY_STATUS, PROPOSAL_KIND, TERMINAL_STATUS, CREATOR_TYPE, EFFORT, FILE_POLICY, DEFAULT_FILE_POLICY, VIEW_ACTION, NAV, SOLO_NAV, runStatusLabel, runKindLabel } from './modules/state.js'
2
2
  import { icon } from './modules/icons.js'
3
3
  import { applyUiScale, applyUiTheme, initColorScheme, esc, attr, pathCode, costValue, clamp, botById, shortRefId, actorLabel, taskById, activeProject, inSoloContext, pageProject, activeBots, formatNumber, CURRENCY_SYMBOL, formatCost, timeAgo, formatTime, duration, avatar, statusPill, runDot, memberRunDot, runDotHtml, memorySource, toast, filePolicyOptions } from './modules/util.js'
4
4
  import { richText, mdPlainSummary, mdChatScope, mdImageChipTitle } from './modules/markdown.js'
@@ -199,7 +199,8 @@ function tabDot(view) {
199
199
  return false
200
200
  }
201
201
 
202
- // STATUS/RUN_STATUS/RUN_KIND 的渲染标签:表内有键走 t(),表外原样回落(保持旧 ?? 兜底语义)。
202
+ // STATUS 的渲染标签:表内有键走 t(),表外原样回落(保持旧 ?? 兜底语义;
203
+ // runStatus/runKind 同口径的 runStatusLabel/runKindLabel 已下沉 modules/state.js)。
203
204
  function statusLabel(status) {
204
205
  return STATUS[status] ? t('status.' + status) : status
205
206
  }
@@ -213,14 +214,6 @@ function sideRowStatusHtml(status) {
213
214
  return `<span class="side-row-status${live}">${esc(statusLabel(status))}</span>`
214
215
  }
215
216
 
216
- function runStatusLabel(status) {
217
- return RUN_STATUS[status] ? t('runStatus.' + status) : status
218
- }
219
-
220
- function runKindLabel(kind) {
221
- return RUN_KIND[kind] ? t('runKind.' + kind) : kind
222
- }
223
-
224
217
  function renderShell() {
225
218
  const data = state.data
226
219
  const inSolo = inSoloContext()
@@ -642,7 +635,11 @@ async function poll() {
642
635
  notifyNewApprovals(data?.approvals ?? [])
643
636
  return
644
637
  }
638
+ // 版本短路:loadState 在服务端版本未变时原引用返回,数据零变化——跳过整页重渲染
639
+ // 与通知重算(2.8s 空闲轮询从「全量取数+渲染」降为一次版本比对)。
640
+ const previousData = state.data
645
641
  await loadState(state.projectId, { quiet: true })
642
+ if (state.data === previousData) return
646
643
  // 渲染闸门(DSHBOTS-123):composer 静默窗内有输入或 IME 组词中才挡整页重建,
647
644
  // 其余输入控件维持原「焦点即挡」;被挡周期的取数已生效,下一周期自动补渲染。
648
645
  if (!pollRenderBlockedByFocus(document.activeElement, { composing: state.composerComposing, composerInputAt: state.composerInputAt })) render()
@@ -77,6 +77,8 @@ export default {
77
77
  // DSHBOTS-220: ui/modules copy
78
78
  "等待审批": "Waiting for approval",
79
79
  "已允许一次": "Allowed once",
80
+ // DSHBOTS-365: distinct pill text for rule-based auto-allow (decided_by=auto:rule:*)
81
+ "规则自动放行": "Auto-allowed by rule",
80
82
  "已拒绝": "Rejected",
81
83
  "已超时": "Timed out",
82
84
  "已取消": "Canceled",
@@ -172,4 +172,18 @@ export default {
172
172
  "主模型": "Primary model",
173
173
  ":": ": ",
174
174
  ")": ")",
175
+ // Form inline validation (DSHBOTS-367)
176
+ "form.thisField": "This field",
177
+ "form.errorRequired": "${label} is required",
178
+ "form.errorTypeMismatch": "${label} has an invalid format",
179
+ "form.errorPatternMismatch": "${label} does not match the expected format",
180
+ "form.errorTooShort": "${label} must be at least ${min} characters",
181
+ "form.errorTooLong": "${label} must be at most ${max} characters",
182
+ "form.errorRangeUnderflow": "${label} must be at least ${min}",
183
+ "form.errorRangeOverflow": "${label} must be at most ${max}",
184
+ "form.errorStepMismatch": "${label} must be a multiple of ${step}",
185
+ "bots.agentPreset": "Agent preset",
186
+ "bots.presetFollow": "Follow global",
187
+ "bots.agentPresetTitle": "Agent preset for this bot's sessions; empty = follow global (effective DSH_TEAM_WORKER_PRESET chain), applies to newly created sessions",
188
+ "bots.agentPresetHint": "Empty follows the global value; selecting one applies to this bot's new sessions only.",
175
189
  }
@@ -36,6 +36,40 @@ export default {
36
36
  "global.promptSegSelfcheckHint": "Delivery reports must carry reproducible verification evidence",
37
37
  "global.promptSegmentsHint": "Instruction text ships with releases: when an upgrade changes a default, customized segments get a \"Default updated\" badge — keep your text or switch to the new default.",
38
38
  "global.save": "Save",
39
+ // Approval auto-allow rules (DSHBOTS-365)
40
+ "global.approvalPermissionsTitle": "Auto-allow permissions",
41
+ "global.approvalRulesMeta": "${count} rule(s) · auto-allowed with audit trail on match",
42
+ "global.approvalRulesEmpty": "No rules yet: matching escalations still land in the approval card.",
43
+ "global.approvalRulePath": "Path glob",
44
+ "global.approvalRuleCommand": "Command glob",
45
+ "global.approvalRulePathExample": "e.g. **/tmp/**",
46
+ "global.approvalRuleCommandExample": "e.g. git push*",
47
+ "global.approvalRulePathHint": "Matches the operation target path: * stays in one segment, ** crosses directories; a leading ~ expands to the home directory.",
48
+ "global.approvalRuleCommandHint": "Matches the first line of the command: * stays in one segment, ** crosses directories.",
49
+ "global.approvalRuleBot": "Bot filter",
50
+ "global.approvalRuleTool": "Tool filter",
51
+ "global.approvalRuleToolPlaceholder": "e.g. bash",
52
+ "global.approvalRuleToolHint": "Empty = any tool; a value must exactly match the escalating tool name (e.g. bash, edit).",
53
+ "global.approvalRuleSandbox": "Sandbox tier",
54
+ "global.approvalRuleNote": "Note",
55
+ "global.approvalRuleAny": "Any",
56
+ "global.approvalRuleDelete": "Delete",
57
+ "global.approvalRuleEdit": "Edit",
58
+ "global.approvalRuleAdd": "Add rule",
59
+ "global.approvalRuleMore": "More conditions (bot / tool / sandbox / note)",
60
+ "global.approvalRuleChipPath": "Path",
61
+ "global.approvalRuleChipCommand": "Cmd",
62
+ "global.approvalRuleChipBot": "Bot",
63
+ "global.approvalRuleChipTool": "Tool",
64
+ "global.approvalRuleChipSandbox": "Sandbox",
65
+ "global.approvalRuleChipNote": "Note",
66
+ "global.saveApprovalRules": "Save auto-allow rules",
67
+ "global.approvalRulesHint": "Matching escalation requests skip the approval card: the plugin answers allowed-once immediately and leaves an audit trail (decided_by=auto:rule:*). Path and command rules match the target as globs (* stays in one segment, ** crosses directories); legacy rules without wildcards keep prefix matching, so existing entries stay effective. The system temp directory ($TMPDIR) is allowed out of the box. Each call is allowed once per match; rule changes take effect immediately. Only the workbench owner can edit rules.",
68
+ "审批免审规则已保存": "Approval auto-allow rules saved",
69
+ "新增免审规则": "Add auto-allow rule",
70
+ "编辑免审规则": "Edit auto-allow rule",
71
+ "保存规则": "Save rule",
72
+ "规则已删除": "Rule deleted",
39
73
  "团队指令已保存,新会话生效": "Team instructions saved; applies to new sessions",
40
74
  "已恢复默认指令": "Restored to default",
41
75
  "global.groupPrefDesc": "Affects only how things are displayed on this machine and takes effect immediately after saving.",
@@ -65,10 +99,56 @@ export default {
65
99
  "global.stallWatchdogLabel": "No-progress watchdog (minutes)",
66
100
  "global.runLimitsHint1": "Timeout abort = the maximum duration of a single run (1–360 minutes); no-progress watchdog = how long a run may produce no output before it is considered stuck (0–360 minutes, 0 disables it).",
67
101
  "global.reviewIdleLabel": "Review idle threshold (minutes)",
102
+ "global.reviewTimeoutLabel": "Review run timeout (minutes)",
103
+ "global.reviewTimeoutHint": "Per-tier timeout for review/blocker-handling runs (the director chain); 0 = tier disabled, follow the global run timeout (default). Slow but healthy reviews are no longer cut short; genuinely stuck runs are still reaped by the stall watchdog.",
68
104
  "global.reviewAutoCloseLabel": "Auto close reviews",
69
105
  "global.reviewIdleHint": "Review idle threshold = how long an in_review card may sit with no comments and no run activity before it counts as stalled (0–1440 minutes, 0 disables the watchdog); with auto close on, the three-tier rule engine closes cards programmatically: A verifiable delivery auto-accepts, B unresponsive deliverer auto-returns, C undecidable only reminds. Observe mode evaluates by the same rules and records on the task timeline without actually closing.",
70
106
  "global.runLimitsEnv": "Environment variable(s) ${names} are set explicitly; those items follow the environment and values saved on this page are ignored.",
71
107
  "global.saveRunLimits": "Save run limits",
108
+ "global.rsCardTitle": "Runtime parameters (env vars)",
109
+ "global.rsCardMeta": "All runtime DSH_TEAM_* variables",
110
+ "global.rsHint": "Configure every runtime environment variable here. Priority: explicit env var > saved page value > startup default; empty clears the saved value back to default. Takes effect immediately after saving (in-flight runs and existing sessions are not retroactive). Bootstrap variables (workspace/data dir/first seed) and channel credentials (WeChat/Feishu) are configured on their own pages.",
111
+ "global.rsGroupSched": "Scheduling & parallelism",
112
+ "global.rsGroupLimits": "Run limits",
113
+ "global.rsGroupSession": "Sessions & presets",
114
+ "global.rsGroupChat": "Message sizes",
115
+ "global.rsGroupOps": "Operations",
116
+ "global.rsGroupReview": "Review",
117
+ "global.rsGroupModels": "Derived model proxies",
118
+ "global.rsFollowDefault": "Follow default",
119
+ "global.rsEffective": "Effective ${value} (default ${def})",
120
+ "global.rsSave": "Save runtime parameters",
121
+ "运行参数已保存,即时生效(env 显式设置仍优先)": "Runtime parameters saved, effective immediately (explicit env vars still take priority)",
122
+ "global.rs.max_concurrent_runs": "Max concurrent runs",
123
+ "global.rs.max_write_scopes": "Write scopes per task",
124
+ "global.rs.max_teammates": "Max teammates",
125
+ "global.rs.agent_team": "Parallel split guidance (Agent Teams)",
126
+ "global.rs.max_run_tokens": "Max tokens per run (0 off)",
127
+ "global.rs.task_time_budget_minutes": "Default task budget (minutes)",
128
+ "global.rs.session_rollover_turns": "Session rollover turns (0 off)",
129
+ "global.rs.session_compact_turns": "Idle compact window (0 off)",
130
+ "global.rs.session_compact_ctx_tokens": "Compact ctx floor (tokens, 0 off)",
131
+ "global.rs.session_rollover_ctx_tokens": "Rollover ctx ceiling (tokens, 0 off)",
132
+ "global.rs.session_rollover_subagents": "Rollover subagent cap (0 off)",
133
+ "global.rs.router_preset": "Router session agent preset",
134
+ "global.rs.worker_preset": "Worker session agent preset",
135
+ "global.rs.chat_max_chars": "Group reply cap (chars)",
136
+ "global.rs.delivery_report_max_chars": "Delivery report cap (chars)",
137
+ "global.rs.dm_archive_days": "DM archive days (0 off)",
138
+ "global.rs.dm_keep_recent": "DM keep per bot (0 off)",
139
+ "global.rs.secrets_ttl_ms": "Ephemeral secret TTL (ms)",
140
+ "global.rs.image_png_jpeg_threshold_bytes": "PNG→JPEG threshold (bytes, 0 off)",
141
+ "global.rs.usage_snapshot_cache_ms": "Usage snapshot cache (ms, 0 off)",
142
+ "global.rs.catalog_stale_ms": "Model catalog SWR (ms, 0 off)",
143
+ "global.rs.code_hygiene_exts": "Code hygiene extensions (comma list, empty = default)",
144
+ "global.rs.github_watch": "GitHub watch sources (JSON array)",
145
+ "global.rs.github_poll_minutes": "GitHub poll interval (minutes, 0 off)",
146
+ "global.rs.auto_review_delegate": "Auto review delegation",
147
+ "global.rs.review_read_only_skip": "Skip auto review for read-only deliveries",
148
+ "global.rs.vision_proxy_provider": "Vision proxy provider",
149
+ "global.rs.vision_proxy_model": "Vision proxy model",
150
+ "global.rs.memory_review_provider": "Memory review provider",
151
+ "global.rs.memory_review_model": "Memory review model",
72
152
  "global.cardOps": "System & operations",
73
153
  "global.budgetCurrency": "Budget currency",
74
154
  "global.memoryReview": "Automatic memory review",
@@ -217,7 +297,7 @@ export default {
217
297
  "复制路径": "Copy path",
218
298
  "外观颜色": "Color",
219
299
  "如": "e.g.",
220
- "委派总监 Bot 的子代理并行核验交付,结论写回任务评论,裁决仍由您执行": "Delegate a subagent of the director Bot to verify deliverables in parallel and write the conclusion back to the task comments; the final call remains yours",
300
+ "委派子代理并行核验交付(优先 reviewer,无则总监兜底),结论写回任务评论,裁决仍由您执行": "Delegate subagents to verify deliverables in parallel (reviewer first, director as fallback) and write the conclusion back to the task comments; the final call remains yours",
221
301
  "子代理核验": "Subagent verification",
222
302
  "完成于": "Completed at",
223
303
  "完整替换现有指令,而不是追加": "Completely replace the existing instructions instead of appending",
@@ -67,6 +67,7 @@ export default {
67
67
  "task.reviewOwner": "Director reviewing",
68
68
  "task.reviewYou": "Waiting for your review",
69
69
  "task.reviewPending": "Verifying",
70
+ "task.reviewSkipped": "Read-only skip",
70
71
  "task.reviewUnverified": "Unverified",
71
72
  "task.childrenSuffix": "subtasks",
72
73
  "task.unassigned": "Unassigned",
@@ -237,4 +238,6 @@ export default {
237
238
  "文件较大,已截断,仅显示开头部分。": "Large file; showing a truncated head only.",
238
239
  "新窗口打开": "Open in new window",
239
240
  "加载文件失败:": "Failed to load file: ",
241
+ // Task card context menu (DSHBOTS-367): keyboard cross-column move
242
+ "task.moveMenuLabel": "Move to",
240
243
  }
@@ -77,6 +77,8 @@ export default {
77
77
  // DSHBOTS-220: ui/modules 文案(原文即键)
78
78
  "等待审批": "等待审批",
79
79
  "已允许一次": "已允许一次",
80
+ // DSHBOTS-365:免审放行的独立状态文案(decided_by=auto:rule:*)
81
+ "规则自动放行": "规则自动放行",
80
82
  "已拒绝": "已拒绝",
81
83
  "已超时": "已超时",
82
84
  "已取消": "已取消",
@@ -172,4 +172,18 @@ export default {
172
172
  "主模型": "主模型",
173
173
  ":": ":",
174
174
  ")": ")",
175
+ // 表单内联校验(DSHBOTS-367)
176
+ "form.thisField": "该字段",
177
+ "form.errorRequired": "${label}不能为空",
178
+ "form.errorTypeMismatch": "${label}格式不正确",
179
+ "form.errorPatternMismatch": "${label}格式不符合要求",
180
+ "form.errorTooShort": "${label}至少需要 ${min} 个字符",
181
+ "form.errorTooLong": "${label}最多 ${max} 个字符",
182
+ "form.errorRangeUnderflow": "${label}不能小于 ${min}",
183
+ "form.errorRangeOverflow": "${label}不能大于 ${max}",
184
+ "form.errorStepMismatch": "${label}必须是 ${step} 的整数倍",
185
+ "bots.agentPreset": "Agent 预设",
186
+ "bots.presetFollow": "跟随全局",
187
+ "bots.agentPresetTitle": "Bot 会话使用的 agent preset;留空 = 跟随全局(DSH_TEAM_WORKER_PRESET 生效链),下次新建会话生效",
188
+ "bots.agentPresetHint": "留空跟随全局;选择后仅该 Bot 的新建会话使用所选预设。",
175
189
  }
@@ -36,6 +36,40 @@ export default {
36
36
  "global.promptSegSelfcheckHint": "交付报告必须自带可复现验证证据",
37
37
  "global.promptSegmentsHint": "指令正文随发版升级:升级改动默认文本后,自定义段会标「默认内容已更新」,可保留现有文本或恢复新默认。",
38
38
  "global.save": "保存",
39
+ // 审批免审规则(DSHBOTS-365)
40
+ "global.approvalPermissionsTitle": "免审权限",
41
+ "global.approvalRulesMeta": "${count} 条 · 命中即自动放行并留痕",
42
+ "global.approvalRulesEmpty": "还没有免审规则:命中的提权请求仍会落审批卡。",
43
+ "global.approvalRulePath": "路径 glob",
44
+ "global.approvalRuleCommand": "命令 glob",
45
+ "global.approvalRulePathExample": "例:**/tmp/**",
46
+ "global.approvalRuleCommandExample": "例:git push*",
47
+ "global.approvalRulePathHint": "匹配操作目标路径:* 不跨目录,** 跨目录;~ 开头按家目录展开。",
48
+ "global.approvalRuleCommandHint": "匹配命令首行:* 不跨目录,** 跨目录。",
49
+ "global.approvalRuleBot": "限 Bot",
50
+ "global.approvalRuleTool": "限工具",
51
+ "global.approvalRuleToolPlaceholder": "如:bash",
52
+ "global.approvalRuleToolHint": "留空 = 任意工具;填了则须与提权工具名完全一致(如 bash、edit)。",
53
+ "global.approvalRuleSandbox": "限沙箱档",
54
+ "global.approvalRuleNote": "备注",
55
+ "global.approvalRuleAny": "任意",
56
+ "global.approvalRuleDelete": "删除",
57
+ "global.approvalRuleEdit": "编辑",
58
+ "global.approvalRuleAdd": "新增规则",
59
+ "global.approvalRuleMore": "更多条件(Bot / 工具 / 沙箱档 / 备注)",
60
+ "global.approvalRuleChipPath": "路径",
61
+ "global.approvalRuleChipCommand": "命令",
62
+ "global.approvalRuleChipBot": "Bot",
63
+ "global.approvalRuleChipTool": "工具",
64
+ "global.approvalRuleChipSandbox": "沙箱",
65
+ "global.approvalRuleChipNote": "备注",
66
+ "global.saveApprovalRules": "保存免审规则",
67
+ "global.approvalRulesHint": "命中的提权请求不落审批卡:插件即时按 allowed-once 放行,并在审批记录与审计里留痕(decided_by=auto:rule:*)。路径与命令规则都用 glob 匹配目标(* 不跨目录,** 跨目录);不含通配符的旧规则按前缀匹配,存量不失效。系统临时目录($TMPDIR)随预置一并放行。每次调用一放行一结,改规则即时生效;仅工作台 owner 可修改。",
68
+ "审批免审规则已保存": "审批免审规则已保存",
69
+ "新增免审规则": "新增免审规则",
70
+ "编辑免审规则": "编辑免审规则",
71
+ "保存规则": "保存规则",
72
+ "规则已删除": "规则已删除",
39
73
  "团队指令已保存,新会话生效": "团队指令已保存,新会话生效",
40
74
  "已恢复默认指令": "已恢复默认指令",
41
75
  "global.groupPrefDesc": "只影响这台机器上的显示方式,保存后立即生效。",
@@ -65,10 +99,56 @@ export default {
65
99
  "global.stallWatchdogLabel": "无进展看门狗(分钟)",
66
100
  "global.runLimitsHint1": "超时中止 = 单次运行的最长时长(1–360 分钟);无进展看门狗 = 运行多久没有任何输出即判定卡住(0–360 分钟,0 为关闭)。",
67
101
  "global.reviewIdleLabel": "验收滞留阈值(分钟)",
102
+ "global.reviewTimeoutLabel": "验收运行时效(分钟)",
103
+ "global.reviewTimeoutHint": "验收/受阻处理运行(总监链)的单独特效上限;0 = 关闭分档、跟随全局运行超时(默认)。慢而健康的验收不再被提前中止;真挂死的运行由无进展看门狗收割,不会永久卡住。",
68
104
  "global.reviewAutoCloseLabel": "验收自动收口",
69
105
  "global.reviewIdleHint": "验收滞留阈值 = in_review 卡静置多久无评论且无运行活动即判定滞留(0–1440 分钟,0 为关闭);自动收口三档规则:A 交付可验证自动通过、B 交付方无响应自动退回、C 不可判定仅提醒;干跑模式按同一规则只判定并在任务时间线留痕,不实际收口。",
70
106
  "global.runLimitsEnv": "环境变量 ${names} 已显式设置,对应项以环境变量为准,页面保存值不生效。",
71
107
  "global.saveRunLimits": "保存运行时效",
108
+ "global.rsCardTitle": "运行参数(环境变量)",
109
+ "global.rsCardMeta": "所有 DSH_TEAM_* 运行期变量",
110
+ "global.rsHint": "此处可配置本服务支持的全部运行期环境变量。优先级:环境变量显式设置 > 页面保存值 > 启动默认;留空 = 清除保存值回默认。保存后即时生效(进行中的运行/已建会话不追溯)。引导期变量(工作区/数据目录/首次种子)与通道凭据(微信/飞书)在各自专属页面配置。",
111
+ "global.rsGroupSched": "调度与并行",
112
+ "global.rsGroupLimits": "运行限额",
113
+ "global.rsGroupSession": "会话与预设",
114
+ "global.rsGroupChat": "消息体量",
115
+ "global.rsGroupOps": "运维杂项",
116
+ "global.rsGroupReview": "验收",
117
+ "global.rsGroupModels": "派生模型代理",
118
+ "global.rsFollowDefault": "跟随默认",
119
+ "global.rsEffective": "生效 ${value}(默认 ${def})",
120
+ "global.rsSave": "保存运行参数",
121
+ "运行参数已保存,即时生效(env 显式设置仍优先)": "运行参数已保存,即时生效(env 显式设置仍优先)",
122
+ "global.rs.max_concurrent_runs": "最大并发运行",
123
+ "global.rs.max_write_scopes": "单卡写范围上限",
124
+ "global.rs.max_teammates": "团队成员上限",
125
+ "global.rs.agent_team": "并行拆分引导(Agent Teams)",
126
+ "global.rs.max_run_tokens": "单运行 Token 上限(0 关闭)",
127
+ "global.rs.task_time_budget_minutes": "任务卡缺省预算(分钟)",
128
+ "global.rs.session_rollover_turns": "会话结转轮数(0 关闭)",
129
+ "global.rs.session_compact_turns": "闲时压缩窗口(0 关闭)",
130
+ "global.rs.session_compact_ctx_tokens": "压缩上下文下限(token,0 关闭)",
131
+ "global.rs.session_rollover_ctx_tokens": "结转上下文上限(token,0 关闭)",
132
+ "global.rs.session_rollover_subagents": "结转子代理上限(0 关闭)",
133
+ "global.rs.router_preset": "Router 会话 Agent 预设",
134
+ "global.rs.worker_preset": "Worker 会话 Agent 预设",
135
+ "global.rs.chat_max_chars": "群聊回复上限(字符)",
136
+ "global.rs.delivery_report_max_chars": "交付报告上限(字符)",
137
+ "global.rs.dm_archive_days": "私信归档天数(0 关闭)",
138
+ "global.rs.dm_keep_recent": "私信每 bot 保留条数(0 关闭)",
139
+ "global.rs.secrets_ttl_ms": "一次性密钥存活窗口(毫秒)",
140
+ "global.rs.image_png_jpeg_threshold_bytes": "PNG 转 JPEG 阈值(字节,0 关闭)",
141
+ "global.rs.usage_snapshot_cache_ms": "用量快照缓存(毫秒,0 关闭)",
142
+ "global.rs.catalog_stale_ms": "模型目录 SWR 窗口(毫秒,0 关闭)",
143
+ "global.rs.code_hygiene_exts": "代码卫生扩展名白名单(逗号分隔,空 = 默认)",
144
+ "global.rs.github_watch": "GitHub 只读触发源(JSON 数组)",
145
+ "global.rs.github_poll_minutes": "GitHub 轮询间隔(分钟,0 关闭)",
146
+ "global.rs.auto_review_delegate": "交付自动核验委派",
147
+ "global.rs.review_read_only_skip": "只读交付免自动核验",
148
+ "global.rs.vision_proxy_provider": "读图代理 Provider",
149
+ "global.rs.vision_proxy_model": "读图代理模型",
150
+ "global.rs.memory_review_provider": "记忆审查 Provider",
151
+ "global.rs.memory_review_model": "记忆审查模型",
72
152
  "global.cardOps": "系统与运维",
73
153
  "global.budgetCurrency": "预算币种",
74
154
  "global.memoryReview": "记忆自动审查",
@@ -216,7 +296,7 @@ export default {
216
296
  "复制路径": "复制路径",
217
297
  "外观颜色": "外观颜色",
218
298
  "如": "如",
219
- "委派总监 Bot 的子代理并行核验交付,结论写回任务评论,裁决仍由您执行": "委派总监 Bot 的子代理并行核验交付,结论写回任务评论,裁决仍由您执行",
299
+ "委派子代理并行核验交付(优先 reviewer,无则总监兜底),结论写回任务评论,裁决仍由您执行": "委派子代理并行核验交付(优先 reviewer,无则总监兜底),结论写回任务评论,裁决仍由您执行",
220
300
  "子代理核验": "子代理核验",
221
301
  "完成于": "完成于",
222
302
  "完整替换现有指令,而不是追加": "完整替换现有指令,而不是追加",
@@ -67,6 +67,7 @@ export default {
67
67
  "task.reviewOwner": "总监验收中",
68
68
  "task.reviewYou": "待您验收",
69
69
  "task.reviewPending": "核验中",
70
+ "task.reviewSkipped": "只读免核验",
70
71
  "task.reviewUnverified": "未核验",
71
72
  "task.childrenSuffix": "个子任务",
72
73
  "task.unassigned": "未指派",
@@ -237,4 +238,6 @@ export default {
237
238
  "文件较大,已截断,仅显示开头部分。": "文件较大,已截断,仅显示开头部分。",
238
239
  "新窗口打开": "新窗口打开",
239
240
  "加载文件失败:": "加载文件失败:",
241
+ // 任务卡上下文菜单(DSHBOTS-367):键盘跨列移动
242
+ "task.moveMenuLabel": "移动到",
240
243
  }
package/ui/modules/api.js CHANGED
@@ -127,7 +127,15 @@ export function preserveAnsweredQuestions(previous, next) {
127
127
 
128
128
  export async function loadState(projectId = state.projectId, { quiet = false } = {}) {
129
129
  // 仅单聊场景携带 soloBotId,避免把单聊口径的 runs/memories 泄漏进群聊视图。
130
- const data = preserveAnsweredQuestions(state.data, preserveDecidedApprovals(state.data, await api('state', { projectId: projectId || undefined, soloBotId: state.chatMode === 'solo' ? state.soloBotId : undefined }, { quiet })))
130
+ // since 版本短路:带上上次响应的 version,服务端版本未变时只回十几字节的 unchanged,
131
+ // 此处沿用既有 state.data(同引用返回),调用方据此可跳过重渲染。
132
+ const response = await api('state', {
133
+ projectId: projectId || undefined,
134
+ soloBotId: state.chatMode === 'solo' ? state.soloBotId : undefined,
135
+ since: state.data?.version ?? undefined,
136
+ }, { quiet })
137
+ if (response?.unchanged) return state.data
138
+ const data = preserveAnsweredQuestions(state.data, preserveDecidedApprovals(state.data, response))
131
139
  state.data = data
132
140
  // 已读上报不挡渲染(DSHBOTS-167):本地水位与徽标在调用瞬间即生效(函数体首段同步执行),
133
141
  // 服务端上报即发即走;失败由 markVisibleChatRead 内部回退 markedRead,下一轮轮询自动重报。