dsh-team-bots 0.2.289 → 0.2.347

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 (119) hide show
  1. package/README.md +60 -122
  2. package/docs/README.zh.md +61 -123
  3. package/docs/assets/channel-redesign.png +0 -0
  4. package/docs/assets/global-config-dark.png +0 -0
  5. package/docs/assets/global-config-light.png +0 -0
  6. package/docs/assets/global-config-light.zh.png +0 -0
  7. package/docs/assets/global-config-redesign.png +0 -0
  8. package/docs/assets/secrets-redesign.png +0 -0
  9. package/docs/assets/tasks.png +0 -0
  10. package/docs/assets/tasks.zh.png +0 -0
  11. package/docs/assets/usage-redesign-global.png +0 -0
  12. package/docs/assets/usage.png +0 -0
  13. package/docs/assets/usage.zh.png +0 -0
  14. package/package.json +17 -5
  15. package/scripts/doctor.mjs +4 -4
  16. package/src/api.js +6 -3
  17. package/src/botmsg.js +1 -1
  18. package/src/config.js +18 -8
  19. package/src/db-migrations.js +76 -9
  20. package/src/db.js +28 -2
  21. package/src/http.js +22 -3
  22. package/src/paths.js +32 -1
  23. package/src/pricing.js +2 -2
  24. package/src/runtime.js +1 -1
  25. package/src/secrets.js +4 -4
  26. package/src/service.js +14 -5
  27. package/src/services/approvals.js +109 -24
  28. package/src/services/backoff.js +34 -0
  29. package/src/services/bot-quota.js +242 -0
  30. package/src/services/bots.js +35 -6
  31. package/src/services/chat.js +15 -9
  32. package/src/services/core.js +33 -5
  33. package/src/services/hygiene.js +8 -4
  34. package/src/services/locale.js +17 -0
  35. package/src/services/memory.js +112 -1
  36. package/src/services/message-images.js +3 -3
  37. package/src/services/notify.js +169 -0
  38. package/src/services/projects.js +119 -10
  39. package/src/services/proposals.js +2 -3
  40. package/src/services/questions.js +75 -32
  41. package/src/services/review-watchdog.js +261 -30
  42. package/src/services/run-finish.js +186 -17
  43. package/src/services/runs.js +42 -13
  44. package/src/services/runtime/lifecycle.js +3 -1
  45. package/src/services/runtime/model-restore.js +5 -5
  46. package/src/services/runtime/prompt.js +106 -45
  47. package/src/services/runtime/session.js +38 -14
  48. package/src/services/runtime/trajectory.js +1 -1
  49. package/src/services/scheduler.js +146 -19
  50. package/src/services/secrets.js +1 -1
  51. package/src/services/system.js +23 -6
  52. package/src/services/task-dispatch.js +315 -0
  53. package/src/services/task-notify.js +55 -11
  54. package/src/services/task-runs.js +179 -0
  55. package/src/services/task-stage.js +4 -0
  56. package/src/services/tasks.js +51 -399
  57. package/src/services/terminal.js +2 -2
  58. package/src/services/vision-proxy.js +3 -3
  59. package/src/services/wechat.js +228 -7
  60. package/src/services/workspace-groups.js +4 -3
  61. package/src/skill-parse.js +1 -1
  62. package/src/skills.js +1 -1
  63. package/src/tools.js +275 -6
  64. package/src/updater.js +52 -0
  65. package/src/usage-reconcile.js +1 -1
  66. package/src/usage.js +52 -11
  67. package/src/wechat/channel.js +14 -20
  68. package/src/wechat/commands.js +129 -81
  69. package/src/wechat/format.js +247 -0
  70. package/src/wechat/store.js +30 -2
  71. package/ui/app.js +57 -53
  72. package/ui/i18n/en/chat.js +140 -0
  73. package/ui/i18n/en/common.js +187 -0
  74. package/ui/i18n/en/nav.js +89 -0
  75. package/ui/i18n/en/settings.js +352 -0
  76. package/ui/i18n/en/tasks.js +229 -0
  77. package/ui/i18n/en/usage.js +141 -0
  78. package/ui/i18n/en/wechat.js +23 -0
  79. package/ui/i18n/en.js +17 -237
  80. package/ui/i18n/zh/chat.js +140 -0
  81. package/ui/i18n/zh/common.js +187 -0
  82. package/ui/i18n/zh/nav.js +89 -0
  83. package/ui/i18n/zh/settings.js +352 -0
  84. package/ui/i18n/zh/tasks.js +229 -0
  85. package/ui/i18n/zh/usage.js +141 -0
  86. package/ui/i18n/zh/wechat.js +23 -0
  87. package/ui/i18n/zh.js +17 -236
  88. package/ui/modules/api.js +4 -3
  89. package/ui/modules/bot-quota.js +27 -0
  90. package/ui/modules/cards.js +96 -58
  91. package/ui/modules/chat.js +28 -30
  92. package/ui/modules/composer.js +41 -37
  93. package/ui/modules/dom-morph.js +292 -0
  94. package/ui/modules/events-board.js +22 -22
  95. package/ui/modules/events-click.js +100 -68
  96. package/ui/modules/events-misc.js +34 -34
  97. package/ui/modules/events-submit.js +28 -28
  98. package/ui/modules/global-pages.js +125 -116
  99. package/ui/modules/i18n.js +0 -5
  100. package/ui/modules/icons.js +0 -1
  101. package/ui/modules/markdown.js +1 -1
  102. package/ui/modules/modal-forms.js +196 -203
  103. package/ui/modules/modal-layer.js +6 -9
  104. package/ui/modules/page-shell.js +62 -0
  105. package/ui/modules/settings.js +211 -198
  106. package/ui/modules/solo-archive.js +0 -4
  107. package/ui/modules/state.js +57 -50
  108. package/ui/modules/tasks.js +167 -171
  109. package/ui/modules/typing-linger.js +1 -4
  110. package/ui/modules/usage.js +65 -78
  111. package/ui/modules/util.js +92 -25
  112. package/ui/styles/avatars.css +14 -0
  113. package/ui/styles/cards.css +49 -0
  114. package/ui/styles/chat-cards.css +17 -21
  115. package/ui/styles/global-config.css +56 -2
  116. package/ui/styles/modal.css +13 -0
  117. package/ui/styles/usage.css +3 -61
  118. package/CONTRIBUTING.md +0 -20
  119. package/docs/assets/usage-dark.png +0 -0
@@ -180,32 +180,28 @@
180
180
  box-shadow: var(--shadow-3);
181
181
  display: flex;
182
182
  flex-direction: column;
183
- gap: 2px;
183
+ gap: 8px;
184
184
  }
185
185
  .approval-menu-empty { padding: 8px 10px; color: var(--ink-3); font-size: var(--fs-small); }
186
- .approval-menu-item {
187
- display: grid;
188
- grid-template-columns: auto 1fr auto;
189
- grid-template-areas:
190
- "project project time"
191
- "line line line"
192
- "summary summary summary";
186
+ /* 来源定位行(DSHBOTS-240):顶部跨会话审批通知的卡片多一行「来源群聊(项目名/KEY)+ 任务 ID/任务名」,
187
+ 让 owner 不跳转即可判断该批谁。群聊卡片不带这些字段,不渲染该行。 */
188
+ .approval-source {
189
+ display: flex;
190
+ flex-wrap: wrap;
193
191
  gap: 2px 8px;
194
- padding: 8px 10px;
195
- border: 0;
196
- border-radius: 8px;
197
- background: transparent;
198
- color: var(--ink);
199
- text-align: left;
192
+ font-size: var(--fs-caption);
193
+ color: var(--ink-3);
194
+ }
195
+ .approval-source-scope { font-weight: 600; color: var(--ink-2); }
196
+ /* 顶部通知展开态的审批卡(DSHBOTS-240):与群内审批卡同组件,卡片整体可点跳转到对应会话,
197
+ 与卡内「允许一次/拒绝」按钮并存(按钮点击经 data-action 内层命中,不触发跳转)。 */
198
+ .approval-menu-card {
200
199
  cursor: pointer;
200
+ border-radius: 12px;
201
+ transition: background .12s ease;
201
202
  }
202
- .approval-menu-item:hover,
203
- .approval-menu-item:focus-visible { background: var(--surface-2); }
204
- .approval-menu-project { grid-area: project; font-weight: 600; font-size: var(--fs-small); }
205
- .approval-menu-line { grid-area: line; color: var(--ink-2); font-size: var(--fs-small); }
206
- .approval-menu-summary { grid-area: summary; color: var(--ink-3); font-size: var(--fs-caption); white-space: pre-wrap; word-break: break-word; }
207
- .approval-menu-time { grid-area: time; color: var(--star); font: 600 var(--fs-caption) var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
208
- .approval-menu-time.urgent { color: var(--star); }
203
+ .approval-menu-card:hover { background: var(--surface-2); }
204
+ .approval-menu-card .message-row { gap: 0; }
209
205
  /* 提问卡片(DSHBOTS-116):与审批卡片同骨架,四态中只有 pending 是强调态;已答两态回中性底。
210
206
  圆角 12(卡)/ 8(问题块、选项)/ 6(图标徽章)/ 7(pill、进度条),间距 4-6-8-10。
211
207
  整行化与右对齐(DSHBOTS-190):对齐审批卡 D-173/D-180 口径——占满消息行、按钮与 pill 贴右缘。 */
@@ -7,11 +7,15 @@
7
7
  .global-page {
8
8
  display: flex;
9
9
  flex-direction: column;
10
- gap: 26px;
10
+ gap: 24px;
11
11
  }
12
12
 
13
- /* ---------- 页头:标题 ---------- */
13
+ /* ---------- 页头:标题 + 操作区 ---------- */
14
14
  .global-head {
15
+ display: flex;
16
+ align-items: flex-start;
17
+ justify-content: space-between;
18
+ gap: 24px;
15
19
  padding: 22px 24px 20px;
16
20
  border: 1px solid var(--line);
17
21
  border-radius: 14px;
@@ -19,8 +23,16 @@
19
23
  box-shadow: var(--shadow-card);
20
24
  }
21
25
  .global-head-copy {
26
+ flex: 1 1 auto;
22
27
  min-width: 0;
23
28
  }
29
+ .global-head-actions {
30
+ display: flex;
31
+ flex-direction: column;
32
+ align-items: flex-end;
33
+ gap: 10px;
34
+ flex: 0 0 auto;
35
+ }
24
36
  .global-eyebrow {
25
37
  margin: 0 0 8px;
26
38
  color: var(--ink-3);
@@ -158,6 +170,36 @@
158
170
  margin-bottom: 14px;
159
171
  }
160
172
 
173
+ /* ---------- 通道卡:状态行 + 扫码区并排 ---------- */
174
+ .wechat-card {
175
+ display: flex;
176
+ align-items: flex-start;
177
+ gap: 24px;
178
+ }
179
+ .wechat-card-main {
180
+ flex: 1 1 auto;
181
+ min-width: 0;
182
+ }
183
+ .wechat-status {
184
+ display: flex;
185
+ align-items: center;
186
+ gap: 12px;
187
+ flex-wrap: wrap;
188
+ margin-bottom: 12px;
189
+ }
190
+ .wechat-admin {
191
+ color: var(--ink-3);
192
+ font-size: var(--fs-small);
193
+ }
194
+ .wechat-admin strong {
195
+ color: var(--ink);
196
+ font-family: var(--mono);
197
+ font-weight: 500;
198
+ }
199
+ .wechat-card .wechat-qr {
200
+ flex: 0 0 auto;
201
+ }
202
+
161
203
  /* ---------- 界面卡内部:字段两列 + 底部条 ---------- */
162
204
  .g-fields {
163
205
  display: grid;
@@ -199,4 +241,16 @@
199
241
  .g-fields {
200
242
  grid-template-columns: minmax(0, 1fr);
201
243
  }
244
+ .global-head {
245
+ flex-direction: column;
246
+ }
247
+ .global-head-actions {
248
+ align-items: flex-start;
249
+ }
250
+ .wechat-card {
251
+ flex-direction: column;
252
+ }
253
+ .wechat-card .wechat-qr {
254
+ align-self: center;
255
+ }
202
256
  }
@@ -74,6 +74,19 @@
74
74
  可见。提升为合成层后滚动内容在自己的层里位移,遮罩不再参与滚动期的重录。 */
75
75
  will-change: transform;
76
76
  }
77
+ /* 遮罩期间冻结底页动画时间基(DSHBOTS-255):D-210 已把遮罩打开时对 #app 的 JS 写入全部早退,
78
+ 但 #app 里的 CSS 无穷动画(看板进行中卡片的 swim/sheen、typing 圆点)不归 JS 管——它们在
79
+ 全页 backdrop-filter 的输入侧每帧改变模糊输入,活体取证(CDP Tracing,真 GPU)显示任务弹窗
80
+ 滚动 6 个滚轮 tick 产生 33 次 UpdateLayoutTree,把底页动画全部关掉后塌缩到 2 次:滚动期的
81
+ 主线程样式/布局churn 全部来自这些动画在模糊输入侧的每帧翻动。遮罩下的底页本就模糊且
82
+ D-210 冻结后无数据更新,动画继续走只剩代价没有信息——用 :has 直接以「遮罩在档」为条件
83
+ 暂停 #app 动画:状态由样式系统随 .modal-backdrop 的挂载/卸载原子推导,无定时器、无时间窗、
84
+ 不引入 JS 状态。#modal-root 自身在 #app 之外,弹窗内动画不受影响。 */
85
+ body:has(#modal-root .modal-backdrop) #app *,
86
+ body:has(#modal-root .modal-backdrop) #app *::before,
87
+ body:has(#modal-root .modal-backdrop) #app *::after {
88
+ animation-play-state: paused;
89
+ }
77
90
  .modal-foot {
78
91
  display: flex;
79
92
  align-items: center;
@@ -34,17 +34,6 @@
34
34
  color: var(--ink-3);
35
35
  font-size: var(--fs-caption);
36
36
  }
37
- .usage-grid {
38
- display: grid;
39
- grid-template-columns: 1.1fr 0.9fr;
40
- gap: 12px;
41
- /* 同一行的两张卡等高:矮的那张不再在卡片下方留一块空白。 */
42
- align-items: stretch;
43
- }
44
- /* 面板数为奇数时(3 张)最后一张横跨整行,不留空网格单元——这是「分布明细漏空」的根因。 */
45
- .usage-grid > .usage-panel:last-child:nth-child(odd) {
46
- grid-column: 1 / -1;
47
- }
48
37
  .usage-panel {
49
38
  padding: 16px;
50
39
  /* 卡内纵向 flex:图例与说明贴到卡片底部,等高时不再悬空。 */
@@ -61,20 +50,9 @@
61
50
  .usage-panel > .usage-note {
62
51
  padding-top: 10px;
63
52
  }
64
- /* 用量页骨架(DSHBOTS-81):页面头单一声明窗口与口径,区块给真实标题 + 说明副行,
65
- 顶栏 H1 不再被一个灰字 caption 复述。所有颜色只用既有 token。 */
66
- .usage-page-head {
67
- align-items: flex-end;
68
- margin-bottom: 6px;
69
- padding-bottom: 14px;
70
- border-bottom: 1px solid var(--line);
71
- }
72
- .usage-head-meta {
73
- display: flex;
74
- flex-direction: column;
75
- gap: 7px;
76
- min-width: 0;
77
- }
53
+ /* 用量页骨架(DSHBOTS-81,DSHBOTS-214 起与其余三个一级页共用 page-shell 页壳):
54
+ 页面头/分组/槽位样式在 global-config.css,这里只保留窗口切换与面板内部样式。
55
+ 所有颜色只用既有 token。 */
78
56
  .usage-window-row {
79
57
  display: flex;
80
58
  align-items: center;
@@ -92,42 +70,6 @@
92
70
  letter-spacing: 0.02em;
93
71
  white-space: nowrap;
94
72
  }
95
- .usage-head-desc {
96
- color: var(--ink-3);
97
- font-size: var(--fs-small);
98
- line-height: 1.6;
99
- max-width: 72ch;
100
- }
101
- .usage-section {
102
- margin-top: 26px;
103
- }
104
- .usage-section:first-of-type {
105
- margin-top: 18px;
106
- }
107
- .usage-section-head {
108
- display: flex;
109
- align-items: flex-end;
110
- justify-content: space-between;
111
- gap: 16px;
112
- flex-wrap: wrap;
113
- margin-bottom: 12px;
114
- padding-bottom: 9px;
115
- border-bottom: 1px solid var(--line);
116
- }
117
- .usage-h2 {
118
- margin: 0;
119
- color: var(--ink);
120
- font-size: var(--fs-title);
121
- font-weight: 600;
122
- letter-spacing: -0.01em;
123
- }
124
- .usage-desc {
125
- margin: 4px 0 0;
126
- color: var(--ink-3);
127
- font-size: var(--fs-caption);
128
- line-height: 1.7;
129
- max-width: 80ch;
130
- }
131
73
  .usage-seg {
132
74
  display: flex;
133
75
  align-items: center;
package/CONTRIBUTING.md DELETED
@@ -1,20 +0,0 @@
1
- # Contributing
2
-
3
- ## Commit conventions
4
-
5
- - Every commit has the pre-commit hook bump the patch digit of `package.json` by one (`DSH_SKIP_VERSION_BUMP=1` skips it). **Take the committed version from `git show HEAD -- package.json`**, not from the file in the working tree.
6
- - Commit messages use Conventional Commits style and carry the card number, e.g. `feat(ui): 全局配置页美术重设计(DSHBOTS-184)`.
7
- - Commit with an exact pathspec (`git commit -- <pathspec>`), and check `git status --short` before and after, so in-flight work from other sessions never gets swept in.
8
-
9
- ## Guard tests
10
-
11
- `tests/` holds one `*.test.js` per feature domain, plus the pins for several architectural conventions:
12
-
13
- - `tests/styles-split.test.js`: `UI_STYLE_PARTS` corresponds one-to-one with the `ui/styles/` directory (no orphans, no missing entries, no duplicates), each file stays under 800 lines, and the concatenation has zero drift.
14
- - `tests/code-hygiene.test.js`: the line-limit semantics (800 by default, judgement line at limit × 110 %, 0 disables it, one alert per violation, a fresh alert after the file falls back under the limit).
15
- - Cross-slice `import` guards and token-format guards cover the whole `ui/` source tree: a missing import after a slice split leaves the page on the boot screen, so this class of failure is caught in advance.
16
-
17
- ## `ui/` contribution rules
18
-
19
- 1. **Style slices must be registered.** The concatenation order is decided by `UI_STYLE_PARTS` in `src/http.js`, so a new style file must be registered there too; `tests/styles-split.test.js` guards the table's completeness.
20
- 2. **The 800-line rule.** Both `ui/styles/*.css` and `ui/app.js` stay under 800 lines per file; beyond that, split by responsibility into new domain files.
Binary file