teamsmith 0.1.2 → 0.3.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.
Files changed (158) hide show
  1. package/README.md +13 -7
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +67 -0
  4. package/skills/teamsmith/SKILL.md +26 -8
  5. package/skills/teamsmith/extension/team-notify.ts +37 -6
  6. package/skills/teamsmith/extension/team.ts +438 -0
  7. package/skills/teamsmith/references/agent-adapters.md +7 -7
  8. package/skills/teamsmith/references/config.md +65 -18
  9. package/skills/teamsmith/references/migration.md +220 -34
  10. package/skills/teamsmith/references/protocol.md +250 -25
  11. package/skills/teamsmith/references/troubleshooting.md +124 -7
  12. package/skills/teamsmith/references/workflows.md +66 -20
  13. package/skills/teamsmith/scripts/lib/cmd-agents.sh +525 -90
  14. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +71 -10
  15. package/skills/teamsmith/scripts/lib/cmd-config.sh +562 -128
  16. package/skills/teamsmith/scripts/lib/cmd-death.sh +2 -15
  17. package/skills/teamsmith/scripts/lib/cmd-docs.sh +6 -3
  18. package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
  19. package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
  20. package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
  21. package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
  22. package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
  23. package/skills/teamsmith/scripts/lib/cmd-project.sh +149 -105
  24. package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
  25. package/skills/teamsmith/scripts/lib/cmd-reply.sh +96 -0
  26. package/skills/teamsmith/scripts/lib/cmd-review.sh +188 -40
  27. package/skills/teamsmith/scripts/lib/cmd-status.sh +268 -30
  28. package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
  29. package/skills/teamsmith/scripts/lib/cmd-watch.sh +634 -54
  30. package/skills/teamsmith/scripts/lib/common.sh +1560 -109
  31. package/skills/teamsmith/scripts/lib/gate-lock.sh +544 -0
  32. package/skills/teamsmith/scripts/monitor.mjs +34 -3
  33. package/skills/teamsmith/scripts/panel/README.md +22 -11
  34. package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
  35. package/skills/teamsmith/scripts/panel/panel.js +226 -224
  36. package/skills/teamsmith/scripts/panel/src/App.tsx +478 -184
  37. package/skills/teamsmith/scripts/panel/src/clipboard.ts +11 -5
  38. package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
  39. package/skills/teamsmith/scripts/panel/src/data.ts +95 -7
  40. package/skills/teamsmith/scripts/panel/src/layout.ts +703 -152
  41. package/skills/teamsmith/scripts/panel/src/main.tsx +129 -19
  42. package/skills/teamsmith/scripts/panel/src/settings.ts +1 -1
  43. package/skills/teamsmith/scripts/panel/src/strings/en.ts +76 -31
  44. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +78 -33
  45. package/skills/teamsmith/scripts/panel/src/types.ts +204 -17
  46. package/skills/teamsmith/scripts/replies.mjs +896 -0
  47. package/skills/teamsmith/scripts/shim/tmux +18 -0
  48. package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
  49. package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
  50. package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
  51. package/skills/teamsmith/scripts/team +20 -6
  52. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +23 -3
  53. package/skills/teamsmith/templates/BOARD.md.tmpl +2 -2
  54. package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +7 -3
  55. package/skills/teamsmith/templates/PROTOCOL.md.tmpl +17 -0
  56. package/skills/teamsmith/templates/config.sh.tmpl +29 -5
  57. package/skills/teamsmith/templates/memory-seed.md.tmpl +3 -0
  58. package/skills/teamsmith/templates/pm-prompt.md.tmpl +41 -1
  59. package/skills/teamsmith/templates/report.md.tmpl +12 -0
  60. package/skills/teamsmith/templates/task.md.tmpl +4 -0
  61. package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
  62. package/skills/teamsmith/tests/bg-ledger.sh +168 -10
  63. package/skills/teamsmith/tests/checkout-shape-probe.sh +3 -1
  64. package/skills/teamsmith/tests/config-cli.sh +320 -300
  65. package/skills/teamsmith/tests/death-cause.sh +5 -2
  66. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
  67. package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
  68. package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
  69. package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
  70. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
  71. package/skills/teamsmith/tests/flip-m33.sh +5 -3
  72. package/skills/teamsmith/tests/flip-m37.sh +4 -1
  73. package/skills/teamsmith/tests/flip-m4.3.sh +4 -1
  74. package/skills/teamsmith/tests/flip-m6.3.sh +4 -1
  75. package/skills/teamsmith/tests/flip-m6.5.sh +4 -1
  76. package/skills/teamsmith/tests/flip-m7.2.sh +4 -1
  77. package/skills/teamsmith/tests/flip-p158.sh +2 -1
  78. package/skills/teamsmith/tests/flip-p210.sh +4 -1
  79. package/skills/teamsmith/tests/flip-p217.sh +4 -1
  80. package/skills/teamsmith/tests/flip-p287-lock.sh +342 -0
  81. package/skills/teamsmith/tests/flip-p287-name.sh +279 -0
  82. package/skills/teamsmith/tests/flip-p304-read-side.sh +98 -0
  83. package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
  84. package/skills/teamsmith/tests/flip-p309-p162-deep.sh +122 -0
  85. package/skills/teamsmith/tests/flip-p310-lock.sh +216 -0
  86. package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
  87. package/skills/teamsmith/tests/help-surface.sh +1664 -0
  88. package/skills/teamsmith/tests/install-shape.sh +283 -22
  89. package/skills/teamsmith/tests/key-replies-pty.sh +374 -0
  90. package/skills/teamsmith/tests/key-replies-ui.sh +325 -0
  91. package/skills/teamsmith/tests/key-replies.sh +1314 -0
  92. package/skills/teamsmith/tests/ledger-ban.sh +9 -8
  93. package/skills/teamsmith/tests/ledger-claim.sh +248 -0
  94. package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
  95. package/skills/teamsmith/tests/lib/model-policy.sh +30 -0
  96. package/skills/teamsmith/tests/lib/model-routing-boundary.sh +420 -0
  97. package/skills/teamsmith/tests/lib/model-routing-expansion.sh +155 -0
  98. package/skills/teamsmith/tests/lib/model-routing-flips.py +187 -0
  99. package/skills/teamsmith/tests/lib/model-routing-roles.sh +250 -0
  100. package/skills/teamsmith/tests/lib/proc-io.sh +103 -0
  101. package/skills/teamsmith/tests/lib/reply-fixture.sh +367 -0
  102. package/skills/teamsmith/tests/lib/section-guard.sh +258 -13
  103. package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
  104. package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
  105. package/skills/teamsmith/tests/lib/tmux-iso.sh +39 -13
  106. package/skills/teamsmith/tests/loop-inventory.tsv +59 -47
  107. package/skills/teamsmith/tests/panel-b2.sh +107 -4
  108. package/skills/teamsmith/tests/panel-b3-stub.sh +139 -4
  109. package/skills/teamsmith/tests/panel-b3.sh +189 -29
  110. package/skills/teamsmith/tests/panel-choices.sh +81 -63
  111. package/skills/teamsmith/tests/panel-cpu.sh +3 -2
  112. package/skills/teamsmith/tests/panel-knobs.sh +7 -1
  113. package/skills/teamsmith/tests/panel-p21.sh +445 -241
  114. package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
  115. package/skills/teamsmith/tests/panel-strings.mjs +33 -18
  116. package/skills/teamsmith/tests/perf.sh +122 -31
  117. package/skills/teamsmith/tests/pm-box-real.sh +1 -1
  118. package/skills/teamsmith/tests/pulse-nudge-key.sh +1 -1
  119. package/skills/teamsmith/tests/routes.sh +364 -109
  120. package/skills/teamsmith/tests/seat-interrupt.sh +1002 -0
  121. package/skills/teamsmith/tests/seat-visibility.sh +675 -0
  122. package/skills/teamsmith/tests/section-budgets.tsv +26 -12
  123. package/skills/teamsmith/tests/section-guard.sh +6 -1
  124. package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
  125. package/skills/teamsmith/tests/section-paths.tsv +42 -26
  126. package/skills/teamsmith/tests/section-select.sh +90 -7
  127. package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
  128. package/skills/teamsmith/tests/slash-team.sh +617 -0
  129. package/skills/teamsmith/tests/smoke.sh +3762 -628
  130. package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +2 -2
  131. package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +2 -2
  132. package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +9 -9
  133. package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +2 -2
  134. package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +9 -9
  135. package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +1 -1
  136. package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +1 -1
  137. package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +5 -5
  138. package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +2 -2
  139. package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +5 -5
  140. package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +2 -2
  141. package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +2 -2
  142. package/skills/teamsmith/tests/snapshots/zh-light-120.txt +9 -9
  143. package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +2 -2
  144. package/skills/teamsmith/tests/snapshots/zh-light-160.txt +9 -9
  145. package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +1 -1
  146. package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +1 -1
  147. package/skills/teamsmith/tests/snapshots/zh-light-59.txt +5 -5
  148. package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +2 -2
  149. package/skills/teamsmith/tests/snapshots/zh-light-99.txt +5 -5
  150. package/skills/teamsmith/tests/task-header-model.sh +2 -1
  151. package/skills/teamsmith/tests/task-model-routing.sh +1511 -0
  152. package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
  153. package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
  154. package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
  155. package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
  156. package/skills/teamsmith-init/SKILL.md +43 -43
  157. package/skills/teamsmith-init/references/bootstrap.md +8 -6
  158. package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +9 -5
@@ -76,6 +76,12 @@ export const zh = {
76
76
  pageWork: '工作',
77
77
  pageMessages: '消息与日志',
78
78
  pageBoard: '看板',
79
+ pageReplies: '关键回复',
80
+ pageOverviewShort: '总览',
81
+ pageWorkShort: '工作',
82
+ pageMessagesShort: '消息',
83
+ pageBoardShort: '看板',
84
+ pageRepliesShort: '回复',
79
85
  pageTab: ' {name} ',
80
86
  pageTabActive: '▸{name}◂',
81
87
 
@@ -93,6 +99,7 @@ export const zh = {
93
99
  // 详情视图(只读)
94
100
  detailTitle: '详情 {id}',
95
101
  detailNoFiles: '(这个入口没有关联文件)',
102
+ detailUnavailable: '(来源不可用:{reason})',
96
103
  detailTruncated: '… 已截断(只显示前 128 KiB)',
97
104
  detailLoading: '… 读取中',
98
105
 
@@ -172,24 +179,24 @@ export const zh = {
172
179
  // P30/D2:分组按 schema 行的第 10 列(`group_<token>`),不再是类分组——三个类分组标签已删。
173
180
  group_identity: '身份与账本布局',
174
181
  group_branch: '分支与 forge',
175
- group_policy: '权限与依赖策略',
182
+ group_policy: '权限与依赖',
176
183
  group_roster: '名册、模型解析与适配器',
177
- 'group_seat-model': '按席位模型',
184
+ 'group_task-model': '任务类别与 PM 模型',
178
185
  group_workflow: '工作流与门禁',
179
186
  group_delivery: '容量与投递通知',
180
187
  group_panel: '巡检与面板',
181
- group_patrol: '巡检策略',
188
+ group_patrol: '巡检',
182
189
  'group_pm-lifecycle': 'PM 生命周期',
183
190
  group_session: '活着的会话',
184
191
  group_meeting: '跨项目会议',
185
192
  settingsGroupUngrouped: '未分组',
186
- settingsGroupSeats: '席位',
193
+ settingsGroupCategories: '下一次派任务会用的模型',
194
+ settingsGroupAssignments: '正在运行的任务实际使用的模型',
187
195
  settingsBadgeApply: '立即生效',
188
196
  settingsBadgeRestart: '需重启',
189
- settingsBadgeRefuse: '只读',
190
- settingsUnknownBadge: '未知键',
197
+ settingsBadgeRefuse: '不可改',
198
+ settingsUnknownBadge: '不认识',
191
199
  settingsUnset: '未设 · 默认 {value}',
192
- settingsAuditHeading: '审计(最近)',
193
200
  settingsKeyHint: '↑/↓ 行 · Enter 编辑 · / 筛选 · Esc 返回',
194
201
  keyFilter: '/ 筛选',
195
202
  settingFilterTitle: '筛选设置',
@@ -199,44 +206,52 @@ export const zh = {
199
206
  settingDanger: '危险:{reason}(再按一次 Enter 确认)',
200
207
  settingRejected: '✗ 被拒:{line}',
201
208
  settingWritten: '✓ 已写入 {key} = {value} · {timing}',
202
- settingRefused: '✗ 只读键:{line}',
209
+ settingRefused: '✗ 这个值要在项目配置文件里改:{line}',
203
210
  settingInvalid: '✗ 值不合法:{line}',
204
211
  settingConflict: '! 契约在编辑器打开后变过(指纹不符)—— 什么都没写;已重读',
205
212
  settingWriteError: '✗ 写入失败(原文件未动):{line}',
206
- settingsRefusedRoute: '只读键:手改 .pi/team/config.sh',
207
- settingsSeatHint: '席位模型:team config set-agent-model {seat} <model>',
208
- settingsPairlistHint: '席位模型:team config set-agent-model <seat> <model|-> —— 该行的编辑器是席位块(Enter 跳到那里,不在这里组合)',
213
+ settingsRefusedRoute: '这个值要改项目配置文件 .pi/team/config.sh,界面不能改',
214
+ settingsCategoryHint: '类别 {category}:team config set-task-model {category} <model> —— 只影响以后派的新任务;已经派出去的任务继续用它当时的模型(这一行不组合映射)',
215
+ settingsCategoryRow: '类别 {category}',
216
+ settingsCategoryModel: '模型 {model}',
217
+ settingsCategoryBadge: '新任务',
218
+ settingsCategoryPickerTitle: '选择类别 {category} 的模型',
219
+ settingsCategoryPickerHint: '↑/↓ 选择 · Enter 直接写入该值 ·「自由输入」才进编辑器 · Esc 返回(只影响以后派的新任务;已经派出去的任务继续用它当时的模型,没有进程被重启)',
220
+ settingsCategoryMapHint: '类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 映射在面板里绝不被组合',
221
+ settingsCategoryMapEmpty: '类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 当前映射为空,先用 CLI 添加一个类别',
222
+ settingsAssignmentHint: '任务派出去以后就固定用它当时的模型,不跟着上面的设置变',
223
+ settingsAssignmentNote: '任务 {task} · 类别 {category} · 会话 {sid} · 来源 {selected}/{launch}',
224
+ settingsAssignmentNone: '这个席位还没有派过任务',
225
+ settingsAssignmentUnreadable: '这个席位派过任务,但它的记录读不出来,面板不显示它在用的模型',
226
+ settingsReadOnlyBadge: '不可改',
227
+ settingsPmLaunchLabel: 'PM 上次启动',
228
+ settingsPmLaunchNote: '窗口 {window} · {mode} · {time}',
229
+ settingsPmLaunchHint: 'PM 上一次启动时用的模型,这里不能改',
230
+ settingsDiagnosisHeading: '旧设置需要升级',
209
231
  settingsCliHint: '命令行:team config set {key} <新值>',
210
- settingsRefusedHint: '只读:手改 .pi/team/config.sh 里的 {key}',
211
- settingsUnknownHint: '未知键:{key} 在文件里,命令的 schema 不认识',
232
+ settingsRefusedHint: '这个值要改项目配置文件 .pi/team/config.sh,界面不能改',
233
+ settingsUnknownHint: '{key}:这个设置在文件里,工具不认识它,面板不能改',
212
234
  settingsChoiceTitle: '选择 {label} 的值 · {key}',
213
235
  settingsChoiceHint: '↑/↓ 选择 · Enter 直接写入该值(危险值再按一次确认)· 「自由输入」才进编辑器 · Esc 返回',
214
236
  settingsChoiceCurrent: '当前',
215
237
  settingsChoiceDefault: '默认',
216
- settingsChoiceKeepUnset: '保持未设(取消 = 不写、不留审计)',
238
+ settingsChoiceKeepUnset: '保持未设(取消,什么都不写)',
217
239
  settingsChoiceClear: '清空(写入空值)',
218
240
  settingsChoiceFree: '…(自由输入)',
219
241
  settingsChoiceInterval: '接受区间 {min}–{max}(空 = 无界)',
220
242
  settingsChoiceNoChoice: '{kind} 这种 kind 没有选项集;写入仍由命令校验(Enter 打开自由输入)',
221
- settingsChoicePairlist: '席位块就是这一行的编辑器(命令:team config set-agent-model <seat> <model|->)',
243
+ settingCategoryConfirm: '确认类别 {category}:{old} → {next} · 只影响以后派的新任务;已经派出去的任务继续用它当时的模型(再按 Enter 写入)',
244
+ settingCategoryWritten: '✓ 已写入类别 {category} = {value} · 只影响以后派的新任务;已经派出去的任务继续用它当时的模型;没有重启任何进程',
245
+ settingPmWritten: '✓ 已写入 PM 模型 = {value} · 换模型要用 team up --fresh-pm 重开一场对话;没有重启任何进程',
222
246
  settingsBoolOn: '开(1)',
223
247
  settingsBoolOff: '关(0)',
224
248
  settingsPathExists: '存在',
225
249
  settingsPathMissing: '不存在',
226
250
  settingsPathNotExec: '不是可执行文件',
227
- seatPickerTitle: '选择 {seat} 的模型',
228
- seatPickerHint: '↑/↓ 选择 · Enter 编辑该值 · Esc 返回(运行中的窗口保持旧模型,下次 dispatch/resume 才换)',
229
- seatPickerRemove: '-(移除覆盖,回退默认)',
230
- seatPickerFree: '…(自由输入 provider/model)',
231
- settingSeatConfirm: '确认席位 {seat}:{old} → {next} · 下次 dispatch/resume 生效(运行中的窗口保持旧模型)(再按 Enter 写入)',
232
- settingSeatWritten: '✓ 已写入席位 {seat} = {value} · 下次 dispatch/resume 生效',
233
- settingSeatRemoved: '✓ 已移除席位 {seat} 的覆盖 · 回到默认 {value}',
234
- keySeatPick: 'Enter 选择',
235
- seatSourceConfig: '配置',
236
- seatSourceExplicit: '显式',
237
- seatSourceRecord: '历史记录',
238
- seatOverride: '覆盖',
239
- seatFallback: '回退默认',
251
+ keyCategoryPick: 'Enter 编辑',
252
+ seatSourceExplicit: '派单时指定',
253
+ seatSourcePolicy: '按类别设置',
254
+ seatSourceAssignment: '沿用原记录',
240
255
 
241
256
  // 契约键的人话标签(M49):`lib/cmd-config.sh` 的 schema 每个键一条,行的主文本用它,
242
257
  // 裸 TEAM_* 只留在与 CLI 对齐的地方(编辑器标题、确认行、视图底部的命令行提示)。
@@ -254,6 +269,7 @@ export const zh = {
254
269
  label_TEAM_SPEC_DIR: '规格目录',
255
270
  label_TEAM_ROOT: '项目根',
256
271
  label_TEAM_MAIN_ROOT: '主检出根',
272
+ label_TEAM_TMP_ROOT: '临时根目录',
257
273
  label_TEAM_CONFIG_FILE: '契约文件',
258
274
  // —— 分支与托管平台(只读)
259
275
  label_TEAM_BRANCH_MODE: '分支命名模式',
@@ -267,7 +283,7 @@ export const zh = {
267
283
  label_TEAM_GITLAB_PROJECT: 'GitLab 项目',
268
284
  label_TEAM_GITLAB_TOKEN_FILE: 'GitLab 凭据文件',
269
285
  label_TEAM_MERGE_PREFER_THEIRS: '冲突默认取分支侧',
270
- // —— 权限与依赖策略(只读)
286
+ // —— 权限与依赖(不可改)
271
287
  label_TEAM_CONFIRM_WRITES: '写入前确认',
272
288
  label_TEAM_ALLOW_FOREIGN_IDENTITY: '放行外部身份',
273
289
  label_TEAM_ALLOW_FOREIGN_SESSION: '放行外部会话',
@@ -295,11 +311,12 @@ export const zh = {
295
311
  label_TEAM_AGENT_BIN: '席位可执行文件',
296
312
  label_TEAM_OPENSPEC_BIN: 'openspec 可执行文件',
297
313
  label_TEAM_JS_BIN: 'JS 运行时',
298
- // —— 按席位模型(需重启)
299
- label_TEAM_DEFAULT_MODEL: '默认模型',
300
- label_TEAM_AGENT_MODELS: '按席位模型',
314
+ // —— 任务类别与 PM 模型(apply/restart)
315
+ label_TEAM_TASK_MODELS: '任务类别模型',
301
316
  label_TEAM_PM_MODEL: 'PM 模型',
317
+ label_TEAM_CONFIG_VERSION: '配置形状号',
302
318
  // —— 工作流与门禁
319
+ label_TEAM_UPDATE_CHECK: '启动时提示新版本',
303
320
  label_TEAM_GATES: '门禁命令',
304
321
  label_TEAM_INSTALL_CMD: '安装命令',
305
322
  label_TEAM_TASK_BRANCH_RESET: '派单时重置分支',
@@ -327,9 +344,13 @@ export const zh = {
327
344
  label_TEAM_NOTIFY_DEDUP_SEC: '通知去重窗口',
328
345
  label_TEAM_INBOX_MAX_CHARS: '收件箱摘要字数',
329
346
  label_TEAM_NOTIFY_LOG: '通知调试日志',
347
+ label_TEAM_NOTIFY_DETAIL_MAX: '通知明细条数上限',
330
348
  label_TEAM_DEFER_TTL: '排队过期时间',
331
349
  label_TEAM_OUTBOX_MAX: '发件箱条数上限',
332
350
  label_TEAM_PANEL_DETAIL_CAP: '详情文件读取上限',
351
+ label_TEAM_ORPHAN_WARN_MB: '孤儿内存提示阈值',
352
+ label_TEAM_ORPHAN_SCAN: '扫描孤儿席位进程',
353
+ label_TEAM_ORPHAN_PROC_ROOT: '普查 /proc 接缝',
333
354
  // —— 巡检与面板(需重启)
334
355
  label_TEAM_PULSE_INTERVAL: '巡检周期',
335
356
  label_TEAM_MONITOR_REFRESH: '面板刷新周期',
@@ -373,12 +394,35 @@ export const zh = {
373
394
  label_TEAM_MEETING_KNOCK: '允许敲门',
374
395
  label_TEAM_MEETING_ALLOW_USER_ID: '可敲门用户',
375
396
 
397
+ // 关键回复(pulse-key-replies)
398
+ replyHeading: '关键回复',
399
+ replyHeadingCount: '关键回复({n})',
400
+ replyLatest: '最新关键回复',
401
+ replyEmpty: '(还没有关键回复)',
402
+ replyUnavailable: '(不可用)',
403
+ replyLatestUnavailable: '最新回复不可用:{reason}',
404
+ replyDeclared: '来自 {from} · {at}',
405
+ replyDeclaredShort: '来自 {from}',
406
+ replySlotUnavailable: '#{no} 不可用',
407
+ replyLoading: '… 载入中',
408
+ replyBodyMissing: '这份回复不可用',
409
+ replyBodyHint: '只读 · 按发布的原文显示',
410
+ replyOlder: '更早',
411
+ replyNewer: '更新',
412
+ replyBack: '返回',
413
+ replyScrollHint: '↑/↓ PgUp/PgDn Home/End 滚动',
414
+ replyTotalSlots: '{n} 个编号槽位',
415
+ replyTailWarning: '索引尾部不完整(上一次追加没有写完)',
416
+ replyPageNote: '「这条回复是写给谁的?」——PM 写给用户的回复都在这里',
417
+
376
418
  // 全局键位(页脚)
377
419
  keyCompose: 'm 写信',
378
420
  keyFlush: 'f 冲刷',
379
421
  keyStandby: 's 待命',
380
422
  keySettings: ', 设置',
381
- keyPages: 'Tab/1-4 翻页',
423
+ keyPages: 'Tab/1-5 翻页',
424
+ keyReplies: '←/→ 更早/更新',
425
+ keyReplyReset: 'r 最新',
382
426
  keyScroll: '↑/↓ 滚动',
383
427
  keyLanes: '←/→ 车道',
384
428
  keyCards: '↑/↓ 卡片',
@@ -400,6 +444,7 @@ export const zh = {
400
444
  receiptQueued: '… 已入队(PM 的输入框在忙)· queued',
401
445
  receiptHeld: '! 滞留(副本在 state/outbox/held/)· held',
402
446
  receiptError: '✗ 投递未确认 · {detail}',
447
+ draftNotCleared: '✗ 已结算,但草稿文件清不掉:{file}(文字保留在输入行)',
403
448
  flushOk: '✓ 冲刷 · {detail}',
404
449
  flushFail: '✗ 冲刷失败 · {detail}',
405
450
  standbyOkOn: '✓ 待命 on(原因:{reason})',
@@ -10,8 +10,8 @@
10
10
  export type PmState = 'running' | 'starting' | 'absent' | 'foreign' | 'unknown'
11
11
  export type AgentState = 'running' | 'exited' | 'absent'
12
12
 
13
- /** The four console pages (TUI-only; `--print`/`--json` render the overview). */
14
- export type PageId = 1 | 2 | 3 | 4
13
+ /** The five console pages (TUI-only; `--print`/`--json` render the overview). */
14
+ export type PageId = 1 | 2 | 3 | 4 | 5
15
15
 
16
16
  /**
17
17
  * The board's six lanes in the fixed order BOARD.md's header legend declares (P123). Both the layout
@@ -87,6 +87,9 @@ export interface PanelCapacity {
87
87
  ram_avail_mb: number
88
88
  swap_free_mb: number
89
89
  agents: number
90
+ /** P309: the resolved temp root (`team_tmp_root`) and how it was resolved. */
91
+ temp_root?: string
92
+ temp_root_source?: string
90
93
  /** P144: one entry per judged filesystem (temp root + worktrees root). */
91
94
  disk?: PanelDiskEntry[]
92
95
  spark: number[]
@@ -304,7 +307,10 @@ export interface SettingsKey {
304
307
  comment: string
305
308
  /** A command-side warning (an unknown seat token in TEAM_AGENT_MODELS, …). */
306
309
  warning: string
307
- /** The refusal's route for a read-only key (`team add-agent`, hand-edit the file, …). */
310
+ /**
311
+ * The read's own note for the row (`memory-and-deps` owns its words): a `refuse` key's route, an
312
+ * `apply` key's remark or the declared `fixture-only: ` marker the view refuses to render.
313
+ */
308
314
  route?: string
309
315
  /**
310
316
  * The key's schema-derived choice set (M55), verbatim from `team config list --json`. The
@@ -365,23 +371,73 @@ export interface SettingsChoicePicker {
365
371
  index: number
366
372
  /** The accepted interval the numeric kinds display (null when the kind names none). */
367
373
  interval: { min: string; max: string } | null
374
+ /**
375
+ * True when this picker edits a **task category** rather than a contract key (P232): the row it
376
+ * belongs to is a category row, its entries are the project's known models plus free text, and
377
+ * the accept writes `team config set-task-model <category> <model>` — never a pair list.
378
+ */
379
+ category?: boolean
380
+ }
381
+
382
+ /** One future task-category policy row as `team config list --json` reports it (P232). */
383
+ export interface SettingsCategory {
384
+ category: string
385
+ model: string
368
386
  }
369
387
 
370
- /** One seat's displayed model and its CLI-computed source (P22/B4). */
371
- export interface SettingsSeat {
388
+ /**
389
+ * One seat's **committed** launch assignment (P232): the record a dispatch published, read-only.
390
+ * `assigned=false` means there is no complete record, and no model is invented (the future policy
391
+ * above is never displayed as this seat's actual model). The plain reason the view shows is chosen
392
+ * from `record_present` (P266) — never from the command's `diagnostic`, which is forbidden on screen.
393
+ */
394
+ export interface SettingsAssignment {
372
395
  agent: string
396
+ assigned: boolean
397
+ /**
398
+ * P266 (`memory-and-deps` owns the fact): does a record file exist for this seat at all — true even
399
+ * when the file cannot be read, false when there is none. Absent against an older command.
400
+ */
401
+ record_present?: boolean
402
+ task: string
403
+ category: string
373
404
  model: string
374
- source: 'config' | 'explicit' | 'record'
375
- override: boolean
405
+ selected_via: string
406
+ launch_via: string
407
+ sid: string
408
+ identity_via: string
409
+ diagnostic: string
376
410
  }
377
411
 
378
- /** The `settings` block: exactly `team config list --json` (P22/B2). */
412
+ /** The PM's last launch metadata (`state/pm-launch.env`), read-only (P232). */
413
+ export interface SettingsPmLaunch {
414
+ project?: string
415
+ window?: string
416
+ model?: string
417
+ nonce?: string
418
+ time?: string
419
+ mode?: string
420
+ resume_key?: string
421
+ }
422
+
423
+ /**
424
+ * The `settings` block: exactly `team config list --json` (P22/B2). `models` separates the future
425
+ * policy (`policy.categories`/`policy.pm`) from the committed launch records (`assignments`,
426
+ * `pm_launch`) — the view never presents one as the other — plus the project's known model
427
+ * vocabulary (`known`) and the policy's migration diagnosis (`diagnostic`).
428
+ */
379
429
  export interface SettingsBlock {
380
430
  path: string
381
431
  fingerprint: string
382
432
  mtime: string
383
433
  keys: SettingsKey[]
384
- models: { default: string; known: string[]; seats: SettingsSeat[] }
434
+ models: {
435
+ policy: { categories: SettingsCategory[]; pm: string }
436
+ assignments: SettingsAssignment[]
437
+ pm_launch: SettingsPmLaunch
438
+ known: string[]
439
+ diagnostic: string
440
+ }
385
441
  audit: string[]
386
442
  }
387
443
 
@@ -410,6 +466,101 @@ export interface DetailBlock {
410
466
  /** True when the served file was cut at the cap. */
411
467
  truncated: boolean
412
468
  files: DetailFile[]
469
+ /**
470
+ * The reader's one-line reason when the requested target is unavailable: a missing capability,
471
+ * change or decision, or a discovered symbolic link it refused to read through. Absent on a
472
+ * served read (change: panel-preview-and-compose).
473
+ */
474
+ reason?: string
475
+ }
476
+
477
+ /**
478
+ * The read-only preview source a detail view addresses (change: panel-preview-and-compose).
479
+ * `entry` is the original entry-id discovery (task briefs, reports, reviews); the other three are
480
+ * the closed set the reader's explicit `--source` accepts.
481
+ */
482
+ export type DetailSource = 'entry' | 'spec' | 'change' | 'decision'
483
+
484
+ // ---------------------------------------------------------------- key replies (pulse-key-replies)
485
+
486
+ /** One numbered slot as the readers report it: metadata only, or a numbered unavailable row. */
487
+ export type ReplyEntry =
488
+ | {
489
+ no: number
490
+ available: true
491
+ /** Safe display text (the metadata's own sanitization already ran in the reader). */
492
+ title: string
493
+ /** The declared (self-declared, never verified) publisher label. */
494
+ from: string
495
+ /** UTC ISO publication time. */
496
+ at: string
497
+ bytes: number
498
+ sha256: string
499
+ }
500
+ | { no: number; available: false; reason: string }
501
+
502
+ /** One index-level warning (`partial-tail`): a reader continues and says the tail is incomplete. */
503
+ export interface ReplyWarning {
504
+ kind: string
505
+ bytes?: number
506
+ }
507
+
508
+ /** The latest-reply summary block (`__panel-data --block reply_summary`). Body-free by contract. */
509
+ export interface ReplySummaryBlock {
510
+ available: boolean
511
+ /** ok | empty | unavailable */
512
+ state: string
513
+ total_slots: number
514
+ warnings: ReplyWarning[]
515
+ entry?: ReplyEntry
516
+ reason?: string
517
+ }
518
+
519
+ /** One list page: at most 50 slots, newest first, `next_before` when older slots exist. */
520
+ export interface ReplyListBlock {
521
+ available: boolean
522
+ state: string
523
+ total_slots: number
524
+ entries: ReplyEntry[]
525
+ next_before: number | null
526
+ warnings: ReplyWarning[]
527
+ }
528
+
529
+ /** One committed body as safe display text (`--format json`); `--raw` is the byte-exact exit. */
530
+ export interface ReplyBodyBlock {
531
+ no: number
532
+ available: boolean
533
+ title: string
534
+ from: string
535
+ at: string
536
+ bytes: number
537
+ sha256: string
538
+ text_kind: string
539
+ display_text: string
540
+ }
541
+
542
+ /** The open viewer's document window as the frame rendered it (the App's scroll clamps on it). */
543
+ export interface ReplyDocWindow {
544
+ /** The number the document belongs to. */
545
+ no: number
546
+ /** Document rows at the rendered width. */
547
+ total: number
548
+ /** Rows the window shows. */
549
+ visible: number
550
+ /** The first visible row (clamped by the layout). */
551
+ offset: number
552
+ }
553
+
554
+ /** The key-replies page's list window as the frame rendered it (the App's arrows clamp on it). */
555
+ export interface ReplyWindow {
556
+ /** The focused row's number (0 when the page has no committed row to focus). */
557
+ focus: number
558
+ /** The first visible row's index in the drawn list. */
559
+ offset: number
560
+ /** Rows the window shows. */
561
+ visible: number
562
+ /** Rows the page currently holds. */
563
+ count: number
413
564
  }
414
565
 
415
566
  /** The console-only readers, keyed by their block name; absent = that source failed. */
@@ -426,6 +577,12 @@ export interface PanelBlocks {
426
577
  settings?: SettingsBlock
427
578
  /** Built only while the detail view is open (design §8); never spawned on a parked page. */
428
579
  detail?: DetailBlock
580
+ /** The overview's latest-reply summary (scheduled on every page; body-free). */
581
+ reply_summary?: ReplySummaryBlock
582
+ /** Page 5's current list page: wanted only on page 5 (and only for the cursor in view). */
583
+ reply_list?: ReplyListBlock
584
+ /** The open viewer's one body: wanted only while the reply viewer is open. */
585
+ reply_body?: ReplyBodyBlock
429
586
  }
430
587
 
431
588
  // ------------------------------------------------------------------ layout
@@ -516,10 +673,22 @@ export type Action =
516
673
  | { kind: 'choice-close' }
517
674
  /** The settings overlay's navigation row: open the project-settings view. */
518
675
  | { kind: 'settings-open-view' }
519
- /** The seat picker: choose option `index` (a click on a picker row). */
520
- | { kind: 'seat-pick'; index: number }
521
- /** The seat picker: move the selection (the ↑/↓ chips). */
522
- | { kind: 'seat-move'; delta: number }
676
+ /** Key-replies page: a click on a row (focus when it was not focused, open when it was). */
677
+ | { kind: 'reply-click'; index: number }
678
+ /** Key-replies page: move the row focus (↑/↓ and the wheel rows). */
679
+ | { kind: 'reply-move'; delta: number }
680
+ /** Key-replies page: fetch the adjacent cursor page (←/→ and the Older/Newer chips). */
681
+ | { kind: 'reply-page'; dir: -1 | 1 }
682
+ /** Key-replies page: `r` — drop the cursor chain and fetch the newest page. */
683
+ | { kind: 'reply-reset' }
684
+ /** Key-replies page: open the focused row's body (Enter / the second click). */
685
+ | { kind: 'reply-open'; index?: number }
686
+ /** Key-replies viewer: scroll the document (↑/↓, PgUp/PgDn, Home/End, the wheel). */
687
+ | { kind: 'reply-scroll'; delta: number }
688
+ /** Key-replies viewer: leave it (Esc/q) back to the same list cursor, focus and viewport. */
689
+ | { kind: 'reply-close' }
690
+ /** The overview's latest-reply entry: page 5 plus that entry's viewer. */
691
+ | { kind: 'reply-open-latest'; no?: number }
523
692
 
524
693
  export interface PlacedLine {
525
694
  line: Line
@@ -580,6 +749,10 @@ export interface Frame {
580
749
  detail?: DetailWindow
581
750
  /** The project-settings view's row window (absent while the view is closed). */
582
751
  settings?: SettingsWindow
752
+ /** Page 5's list window (absent off page 5). */
753
+ replyList?: ReplyWindow
754
+ /** The open reply viewer's document window (absent while the viewer is closed). */
755
+ replyDoc?: ReplyDocWindow
583
756
  /** The work page's board rows in the order they were drawn (the App's `↑`/`↓` walk this). */
584
757
  boardOrder?: FocusRef[]
585
758
  }
@@ -595,7 +768,8 @@ export interface FrameInput {
595
768
  width: number
596
769
  height: number
597
770
  /** Whether the activity column is on for this frame. */
598
- activity: boolean
771
+ activity: boolean /** Why the reply-body reader is degraded, when it is a failure and not a pending read. */
772
+ replyBodyFailed?: boolean
599
773
  }
600
774
 
601
775
  /** The console's UI state (TUI-only; the machine exits use the defaults). */
@@ -628,6 +802,21 @@ export interface ViewState {
628
802
  detail?: string | null
629
803
  /** The open detail view's file tab (clamped by the layout; 0 = the first file). */
630
804
  detailIndex?: number
805
+ /** Page 5's focused number (a stable `no`, never an array position); null = the newest row. */
806
+ replyFocus?: number | null
807
+ /** Page 5's fetched cursor: null/absent = the newest page; a number = `--before` that number. */
808
+ replyCursor?: number | null
809
+ /** The cursors already fetched, newest first (the Newer chain walks back through this). */
810
+ replyStack?: number[]
811
+ /** The open viewer's number (null/absent = the list is showing). */
812
+ replyBody?: number | null
813
+ /** The viewer document's first visible row. */
814
+ replyScroll?: number
815
+ /** Page 5's list window offset (`undefined` = follow the focus; a number = the wheel's offset). */
816
+ replyOffset?: number | null
817
+ /** True when the viewer's body read failed (the frame carries the block's error): the viewer then
818
+ * says "unavailable" instead of spinning forever. */
819
+ replyBodyFailed?: boolean
631
820
  /** The detail document's first visible row. */
632
821
  detailScroll?: number
633
822
  /** True while the project-settings view replaces the page's blocks (P22/B2). */
@@ -645,8 +834,6 @@ export interface ViewState {
645
834
  settingsDraft?: { row: number; text: string; cursor: number } | null
646
835
  /** The pending write confirmation (the first Enter of a two-step write). */
647
836
  settingsConfirm?: { row: number; key: string; old: string; next: string; danger: boolean } | null
648
- /** The open seat picker: the seat's agent, its option list and the selection. */
649
- seatPicker?: { agent: string; row: number; models: string[]; index: number } | null
650
- /** The open choice picker (M55): the row, its schema-derived entries and the selection. */
837
+ /** The open choice picker (M55/P232): the row, its schema-derived entries and the selection. */
651
838
  choicePicker?: SettingsChoicePicker | null
652
839
  }