teamsmith 0.0.0-stage → 0.1.2

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 (245) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +158 -2
  3. package/bin/team.mjs +59 -0
  4. package/install.sh +94 -0
  5. package/package.json +37 -4
  6. package/skills/teamsmith/CHANGELOG.md +763 -0
  7. package/skills/teamsmith/SKILL.md +312 -0
  8. package/skills/teamsmith/extension/team-bg.ts +435 -0
  9. package/skills/teamsmith/extension/team-inbox-watch.ts +1412 -0
  10. package/skills/teamsmith/extension/team-notify.ts +663 -0
  11. package/skills/teamsmith/references/agent-adapters.md +643 -0
  12. package/skills/teamsmith/references/config.md +477 -0
  13. package/skills/teamsmith/references/meeting.md +124 -0
  14. package/skills/teamsmith/references/memory.md +133 -0
  15. package/skills/teamsmith/references/migration.md +227 -0
  16. package/skills/teamsmith/references/openspec.md +222 -0
  17. package/skills/teamsmith/references/philosophy.md +95 -0
  18. package/skills/teamsmith/references/protocol.md +712 -0
  19. package/skills/teamsmith/references/troubleshooting.md +1384 -0
  20. package/skills/teamsmith/references/workflows.md +448 -0
  21. package/skills/teamsmith/scripts/lib/cmd-agents.sh +1709 -0
  22. package/skills/teamsmith/scripts/lib/cmd-bg.sh +284 -0
  23. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +311 -0
  24. package/skills/teamsmith/scripts/lib/cmd-config.sh +1156 -0
  25. package/skills/teamsmith/scripts/lib/cmd-death.sh +562 -0
  26. package/skills/teamsmith/scripts/lib/cmd-docs.sh +149 -0
  27. package/skills/teamsmith/scripts/lib/cmd-draft.sh +124 -0
  28. package/skills/teamsmith/scripts/lib/cmd-init.sh +212 -0
  29. package/skills/teamsmith/scripts/lib/cmd-meeting.sh +904 -0
  30. package/skills/teamsmith/scripts/lib/cmd-outbox.sh +196 -0
  31. package/skills/teamsmith/scripts/lib/cmd-project.sh +642 -0
  32. package/skills/teamsmith/scripts/lib/cmd-review.sh +1393 -0
  33. package/skills/teamsmith/scripts/lib/cmd-status.sh +1399 -0
  34. package/skills/teamsmith/scripts/lib/cmd-update.sh +191 -0
  35. package/skills/teamsmith/scripts/lib/cmd-watch.sh +1681 -0
  36. package/skills/teamsmith/scripts/lib/common.sh +4964 -0
  37. package/skills/teamsmith/scripts/lib/draft-entry.sh +51 -0
  38. package/skills/teamsmith/scripts/lib/outbox.sh +2042 -0
  39. package/skills/teamsmith/scripts/lib/tmux-argv.sh +165 -0
  40. package/skills/teamsmith/scripts/monitor.mjs +616 -0
  41. package/skills/teamsmith/scripts/panel/README.md +192 -0
  42. package/skills/teamsmith/scripts/panel/build.sh +47 -0
  43. package/skills/teamsmith/scripts/panel/bun.lock +109 -0
  44. package/skills/teamsmith/scripts/panel/draft-send.sh +68 -0
  45. package/skills/teamsmith/scripts/panel/package.json +24 -0
  46. package/skills/teamsmith/scripts/panel/panel.js +388 -0
  47. package/skills/teamsmith/scripts/panel/src/App.tsx +2150 -0
  48. package/skills/teamsmith/scripts/panel/src/clipboard.ts +154 -0
  49. package/skills/teamsmith/scripts/panel/src/compose.ts +691 -0
  50. package/skills/teamsmith/scripts/panel/src/data.ts +555 -0
  51. package/skills/teamsmith/scripts/panel/src/format.ts +50 -0
  52. package/skills/teamsmith/scripts/panel/src/layout.ts +2562 -0
  53. package/skills/teamsmith/scripts/panel/src/main.tsx +894 -0
  54. package/skills/teamsmith/scripts/panel/src/markdown.ts +340 -0
  55. package/skills/teamsmith/scripts/panel/src/sanitize.ts +42 -0
  56. package/skills/teamsmith/scripts/panel/src/settings.ts +154 -0
  57. package/skills/teamsmith/scripts/panel/src/strings/en.ts +416 -0
  58. package/skills/teamsmith/scripts/panel/src/strings/index.ts +65 -0
  59. package/skills/teamsmith/scripts/panel/src/strings/types.ts +9 -0
  60. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +414 -0
  61. package/skills/teamsmith/scripts/panel/src/theme.ts +116 -0
  62. package/skills/teamsmith/scripts/panel/src/types.ts +652 -0
  63. package/skills/teamsmith/scripts/panel/src/width.ts +105 -0
  64. package/skills/teamsmith/scripts/panel/tsconfig.json +16 -0
  65. package/skills/teamsmith/scripts/shim/signal-gate +156 -0
  66. package/skills/teamsmith/scripts/shim/tmux +403 -0
  67. package/skills/teamsmith/scripts/team +143 -0
  68. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +147 -0
  69. package/skills/teamsmith/templates/BOARD.md.tmpl +18 -0
  70. package/skills/teamsmith/templates/DECISIONS.md.tmpl +22 -0
  71. package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +25 -0
  72. package/skills/teamsmith/templates/PROTOCOL.md.tmpl +84 -0
  73. package/skills/teamsmith/templates/ROADMAP.md.tmpl +29 -0
  74. package/skills/teamsmith/templates/config.sh.tmpl +106 -0
  75. package/skills/teamsmith/templates/memory-seed.md.tmpl +46 -0
  76. package/skills/teamsmith/templates/pm-prompt.md.tmpl +110 -0
  77. package/skills/teamsmith/templates/report.md.tmpl +36 -0
  78. package/skills/teamsmith/templates/task.md.tmpl +65 -0
  79. package/skills/teamsmith/templates/threads-README.md +17 -0
  80. package/skills/teamsmith/tests/bg-ledger-harness.mjs +682 -0
  81. package/skills/teamsmith/tests/bg-ledger.sh +307 -0
  82. package/skills/teamsmith/tests/checkout-shape-probe.sh +800 -0
  83. package/skills/teamsmith/tests/config-cli.sh +1562 -0
  84. package/skills/teamsmith/tests/container-tmux.sh +493 -0
  85. package/skills/teamsmith/tests/coverage-inventory.sh +173 -0
  86. package/skills/teamsmith/tests/death-cause.sh +564 -0
  87. package/skills/teamsmith/tests/delivery-truth.sh +1231 -0
  88. package/skills/teamsmith/tests/fake-tui.py +450 -0
  89. package/skills/teamsmith/tests/fixtures/delivery-truth-real/README.md +60 -0
  90. package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-second.py +139 -0
  91. package/skills/teamsmith/tests/fixtures/delivery-truth-real/mock-server.py +29 -0
  92. package/skills/teamsmith/tests/fixtures/delivery-truth-real/observe.ts +20 -0
  93. package/skills/teamsmith/tests/fixtures/delivery-truth-real/run-case.sh +79 -0
  94. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +175 -0
  95. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +229 -0
  96. package/skills/teamsmith/tests/fixtures/p71-incident/README.md +22 -0
  97. package/skills/teamsmith/tests/fixtures/p71-incident/dev2.seen +8 -0
  98. package/skills/teamsmith/tests/fixtures/p71-incident/dev2.wake +9 -0
  99. package/skills/teamsmith/tests/fixtures/p71-incident/pm-nudges.wake +3 -0
  100. package/skills/teamsmith/tests/fixtures/signal-lint-cases.txt +40 -0
  101. package/skills/teamsmith/tests/flip-glue.sh +162 -0
  102. package/skills/teamsmith/tests/flip-m12-26c.sh +129 -0
  103. package/skills/teamsmith/tests/flip-m12.sh +185 -0
  104. package/skills/teamsmith/tests/flip-m16.sh +166 -0
  105. package/skills/teamsmith/tests/flip-m17.sh +204 -0
  106. package/skills/teamsmith/tests/flip-m33.sh +284 -0
  107. package/skills/teamsmith/tests/flip-m34.sh +96 -0
  108. package/skills/teamsmith/tests/flip-m37.sh +185 -0
  109. package/skills/teamsmith/tests/flip-m4.3.sh +375 -0
  110. package/skills/teamsmith/tests/flip-m43.sh +128 -0
  111. package/skills/teamsmith/tests/flip-m44.sh +262 -0
  112. package/skills/teamsmith/tests/flip-m45.sh +244 -0
  113. package/skills/teamsmith/tests/flip-m46.sh +238 -0
  114. package/skills/teamsmith/tests/flip-m48.sh +304 -0
  115. package/skills/teamsmith/tests/flip-m6.2.sh +205 -0
  116. package/skills/teamsmith/tests/flip-m6.3.sh +283 -0
  117. package/skills/teamsmith/tests/flip-m6.4.sh +267 -0
  118. package/skills/teamsmith/tests/flip-m6.5.sh +113 -0
  119. package/skills/teamsmith/tests/flip-m7.1.sh +135 -0
  120. package/skills/teamsmith/tests/flip-m7.2.sh +321 -0
  121. package/skills/teamsmith/tests/flip-p144.sh +112 -0
  122. package/skills/teamsmith/tests/flip-p156.sh +133 -0
  123. package/skills/teamsmith/tests/flip-p158.sh +301 -0
  124. package/skills/teamsmith/tests/flip-p160.sh +182 -0
  125. package/skills/teamsmith/tests/flip-p171.sh +249 -0
  126. package/skills/teamsmith/tests/flip-p18.1.sh +95 -0
  127. package/skills/teamsmith/tests/flip-p20.sh +286 -0
  128. package/skills/teamsmith/tests/flip-p201.sh +249 -0
  129. package/skills/teamsmith/tests/flip-p210.sh +239 -0
  130. package/skills/teamsmith/tests/flip-p211.sh +152 -0
  131. package/skills/teamsmith/tests/flip-p217.sh +288 -0
  132. package/skills/teamsmith/tests/flip-p22.sh +123 -0
  133. package/skills/teamsmith/tests/flip-p23.sh +239 -0
  134. package/skills/teamsmith/tests/flip-p25.sh +165 -0
  135. package/skills/teamsmith/tests/flip-p71.sh +184 -0
  136. package/skills/teamsmith/tests/flip-p72.sh +202 -0
  137. package/skills/teamsmith/tests/frames/README.md +176 -0
  138. package/skills/teamsmith/tests/frames/p78-conversation-rule-below-box.txt +6 -0
  139. package/skills/teamsmith/tests/frames/p78-cursor-mid-draft.txt +6 -0
  140. package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor-line.txt +6 -0
  141. package/skills/teamsmith/tests/frames/p78-draft-rule-below-cursor.txt +6 -0
  142. package/skills/teamsmith/tests/frames/p78-draft-rule-blank-region.txt +6 -0
  143. package/skills/teamsmith/tests/frames/p78-draft-rule-only.txt +5 -0
  144. package/skills/teamsmith/tests/frames/p78-spinner-row-below-cursor.txt +6 -0
  145. package/skills/teamsmith/tests/frames/p78-wider-rule-below-cursor.txt +6 -0
  146. package/skills/teamsmith/tests/frames/p86-f1-mixed-width-disjoint-box.txt +8 -0
  147. package/skills/teamsmith/tests/frames/p86-f1-narrower-width-disjoint-box.txt +8 -0
  148. package/skills/teamsmith/tests/frames/p86-f1-spinner-top-disjoint-box.txt +8 -0
  149. package/skills/teamsmith/tests/frames/pi-0.85.1-update-banner.txt +30 -0
  150. package/skills/teamsmith/tests/frames/pi-0.87.0-draft-half-sentence.txt +30 -0
  151. package/skills/teamsmith/tests/frames/pi-0.87.0-empty-box.txt +30 -0
  152. package/skills/teamsmith/tests/frames/pi-0.87.0-one-line-draft.txt +30 -0
  153. package/skills/teamsmith/tests/frames/pi-0.87.0-project-trust-prompt.txt +30 -0
  154. package/skills/teamsmith/tests/frames/pi-0.99.2-empty-editor.txt +32 -0
  155. package/skills/teamsmith/tests/frames/pi-0.99.2-human-draft.txt +32 -0
  156. package/skills/teamsmith/tests/frames/pi-1.0.0-git-error-in-box.txt +32 -0
  157. package/skills/teamsmith/tests/gate-guard.sh +112 -0
  158. package/skills/teamsmith/tests/guard-matrix.sh +233 -0
  159. package/skills/teamsmith/tests/install-shape.sh +731 -0
  160. package/skills/teamsmith/tests/ledger-ban.sh +612 -0
  161. package/skills/teamsmith/tests/lib/box-judge.sh +68 -0
  162. package/skills/teamsmith/tests/lib/checkout-shape.sh +129 -0
  163. package/skills/teamsmith/tests/lib/loop-scan.awk +114 -0
  164. package/skills/teamsmith/tests/lib/pty-wait.sh +676 -0
  165. package/skills/teamsmith/tests/lib/section-guard.sh +855 -0
  166. package/skills/teamsmith/tests/lib/shell-lex.pl +261 -0
  167. package/skills/teamsmith/tests/lib/tmp-root.sh +528 -0
  168. package/skills/teamsmith/tests/lib/tmux-cap.sh +35 -0
  169. package/skills/teamsmith/tests/lib/tmux-iso-call-probe.sh +81 -0
  170. package/skills/teamsmith/tests/lib/tmux-iso-probe.sh +46 -0
  171. package/skills/teamsmith/tests/lib/tmux-iso.sh +381 -0
  172. package/skills/teamsmith/tests/load-experiment.sh +290 -0
  173. package/skills/teamsmith/tests/loop-inventory.tsv +84 -0
  174. package/skills/teamsmith/tests/panel-b2-slow-stub.sh +19 -0
  175. package/skills/teamsmith/tests/panel-b2.sh +1183 -0
  176. package/skills/teamsmith/tests/panel-b3-pty-mouse.py +240 -0
  177. package/skills/teamsmith/tests/panel-b3-pty-tmux-mouse.py +138 -0
  178. package/skills/teamsmith/tests/panel-b3-stub.sh +279 -0
  179. package/skills/teamsmith/tests/panel-b3.sh +1301 -0
  180. package/skills/teamsmith/tests/panel-choices.sh +572 -0
  181. package/skills/teamsmith/tests/panel-clipboard-model.ts +187 -0
  182. package/skills/teamsmith/tests/panel-compose-model.ts +290 -0
  183. package/skills/teamsmith/tests/panel-contrast.mjs +81 -0
  184. package/skills/teamsmith/tests/panel-cpu-premise.sh +173 -0
  185. package/skills/teamsmith/tests/panel-cpu.sh +391 -0
  186. package/skills/teamsmith/tests/panel-flip-m54.sh +207 -0
  187. package/skills/teamsmith/tests/panel-flip-p123.sh +278 -0
  188. package/skills/teamsmith/tests/panel-flip-p125.sh +318 -0
  189. package/skills/teamsmith/tests/panel-flip-p128.sh +259 -0
  190. package/skills/teamsmith/tests/panel-keyprobe-pty.py +99 -0
  191. package/skills/teamsmith/tests/panel-keyprobe-stub.sh +41 -0
  192. package/skills/teamsmith/tests/panel-keyprobe.sh +82 -0
  193. package/skills/teamsmith/tests/panel-keyprobe.tsx +116 -0
  194. package/skills/teamsmith/tests/panel-knobs.sh +83 -0
  195. package/skills/teamsmith/tests/panel-p21.sh +2181 -0
  196. package/skills/teamsmith/tests/panel-snapshots.sh +802 -0
  197. package/skills/teamsmith/tests/panel-strings.mjs +195 -0
  198. package/skills/teamsmith/tests/perf.sh +740 -0
  199. package/skills/teamsmith/tests/pm-box-real.sh +350 -0
  200. package/skills/teamsmith/tests/pulse-nudge-key.sh +563 -0
  201. package/skills/teamsmith/tests/routes.sh +1652 -0
  202. package/skills/teamsmith/tests/section-budgets.tsv +150 -0
  203. package/skills/teamsmith/tests/section-guard.sh +231 -0
  204. package/skills/teamsmith/tests/section-needs-audit.sh +94 -0
  205. package/skills/teamsmith/tests/section-paths.tsv +142 -0
  206. package/skills/teamsmith/tests/section-select.sh +655 -0
  207. package/skills/teamsmith/tests/signal-gate.sh +366 -0
  208. package/skills/teamsmith/tests/signal-lint-legacy.txt +14 -0
  209. package/skills/teamsmith/tests/signal-lint.pl +416 -0
  210. package/skills/teamsmith/tests/skill-load.mjs +65 -0
  211. package/skills/teamsmith/tests/smoke.sh +19711 -0
  212. package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +32 -0
  213. package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +32 -0
  214. package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +32 -0
  215. package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +32 -0
  216. package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +32 -0
  217. package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +32 -0
  218. package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +32 -0
  219. package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +32 -0
  220. package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +32 -0
  221. package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +32 -0
  222. package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +32 -0
  223. package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +32 -0
  224. package/skills/teamsmith/tests/snapshots/zh-light-120.txt +32 -0
  225. package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +32 -0
  226. package/skills/teamsmith/tests/snapshots/zh-light-160.txt +32 -0
  227. package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +32 -0
  228. package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +32 -0
  229. package/skills/teamsmith/tests/snapshots/zh-light-59.txt +32 -0
  230. package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +32 -0
  231. package/skills/teamsmith/tests/snapshots/zh-light-99.txt +32 -0
  232. package/skills/teamsmith/tests/spec-ledger-refs.tsv +78 -0
  233. package/skills/teamsmith/tests/spec-refs.sh +826 -0
  234. package/skills/teamsmith/tests/task-header-model.sh +267 -0
  235. package/skills/teamsmith/tests/team-bg-flip.sh +239 -0
  236. package/skills/teamsmith/tests/team-bg-harness.mjs +392 -0
  237. package/skills/teamsmith/tests/team-bg-stop.sh +434 -0
  238. package/skills/teamsmith/tests/team-inbox-watch-flip.sh +191 -0
  239. package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +1559 -0
  240. package/skills/teamsmith/tests/tmp-hygiene.sh +1190 -0
  241. package/skills/teamsmith/tests/tmux-lint-legacy.txt +31 -0
  242. package/skills/teamsmith/tests/tmux-lint.pl +604 -0
  243. package/skills/teamsmith-init/SKILL.md +100 -0
  244. package/skills/teamsmith-init/references/bootstrap.md +74 -0
  245. package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +46 -0
@@ -0,0 +1,192 @@
1
+ # teamsmith pulse panel (`team monitor`)
2
+
3
+ The panel is the process that owns the pulse window: an [Ink](https://github.com/vadimdemedes/ink) + React
4
+ front end that draws one frame per data-refresh cadence (3s by default), runs one patrol tick per
5
+ `TEAM_PULSE_INTERVAL`, and consumes the existing data layer unchanged (`scripts/monitor.mjs --json` for the
6
+ activity stream, the bash readers for the team fields). `team monitor` never reads state files itself.
7
+
8
+ The team fields arrive **per block**: `data.ts` spawns one `team __panel-data --block <name>` child per block,
9
+ asynchronously and with its own timeout, and the renderer only ever reads the in-memory cache. A source that is
10
+ missing, unreadable, too slow or failing renders its own block as `—` and never delays the rest of the frame or a
11
+ keystroke (see `openspec/changes/pulse-console`).
12
+
13
+ ```
14
+ team monitor # TUI in a terminal; plain text when stdout is not a TTY
15
+ team monitor --once # one frame through the same renderer selection, plus the due tick
16
+ team monitor --print # exactly one plain-text frame (no escape bytes, no state writes, no tick)
17
+ team monitor --json # {"panel": {...}, "activity": [...]} (same guarantees as --print)
18
+ team monitor --headless # the tick loop with no renderer — the shape `q` collapses the console into
19
+ team monitor --width N --height N
20
+ ```
21
+
22
+ ## The console surface (pulse-console B3; four pages, board page and detail view from `console-board-page`)
23
+
24
+ Four pages, switched by `Tab` or `1`–`4`, remembered in `state/panel-page` and restored on the next start:
25
+
26
+ | Page | Blocks |
27
+ |---|---|
28
+ | 1 overview | banner (PM/pending/queue/standby), capacity, project progress (board counts, changes, spec counts, decisions), recent deliveries, agent table, session activity, recent actions |
29
+ | 2 work | board rows (`done`/`dropped` collapse to the newest five), active changes with their phase, spec counts, recent decisions |
30
+ | 3 messages & logs | the deferred queue (list + read-only full text), inbox/threads, the patrol log, the capacity trend, health (skill version, `doctor`, last gates `—`) |
31
+ | 4 board | the board block as a kanban over the board's states, plus the entry's read-only markdown detail view while one is open |
32
+
33
+ **The board page** renders six lanes in `BOARD.md` legend order — every lane always present. A card's line is
34
+ its state glyph, id and title (the focused card's `agent · phase` pair rides the key band's free width), and an
35
+ empty lane folds by default; `c` or a click on a lane's header toggles any lane. At ≥100 columns the lanes sit
36
+ side by side and the unfolded lanes share the width: a folded lane takes a three-column frame (`╭─╮` over
37
+ `│…│`/`│⋮│` over `╰─╯`) in its fixed lane position, so the columns it does not use go to the unfolded lanes.
38
+ Below 100 columns they stack as one state-grouped column, where a folded lane stays its one labelled line
39
+ (`▸ 完成 8(已折叠)`) because folding there saves rows, and below 60 a card folds to one line (id + title, no
40
+ agent). `←`/`→` moves the focus between lanes and `↑`/`↓` between cards; a lane taller than the pane scrolls (the
41
+ wheel scrolls the lane under the cursor, other lanes keep their position) and its edge shows how many cards are
42
+ hidden above/below, the `done`/`dropped` windows anchored on the newest cards. The focused card carries `›` and
43
+ is tracked by entry **id**, so a reordering board never moves the focus; the entry disappearing lands it on that
44
+ lane's first card. While the focused card lives in a folded lane the frame carries the cursor and the band names
45
+ the lane (its label and card count).
46
+
47
+ **The detail view** is the focused card's read-only markdown: `Enter` (or a click on the already focused card)
48
+ opens the files discovered for that entry id — its task brief, delivery reports and review records — one per tab,
49
+ with `←`/`→` switching tabs and `↑`/`↓`/the wheel scrolling the document. The renderer is a self-contained
50
+ markdown subset (ATX headings, verbatim fences, display-width-aligned pipe tables, lists, blockquotes,
51
+ bold/code/link spans, `---` rules; anything else stays source text), the reader caps every file at 128 KiB and
52
+ marks the cut, and opening it writes nothing. `Esc` or `q` returns to the board page **without collapsing the
53
+ console** — the documented exception to `q` — and the `detail` block is spawned only while the view is open.
54
+
55
+ A block whose source has no data collapses and yields its space. `,` opens the **settings overlay** with exactly
56
+ five preferences — language (`zh`/`en`), default page, activity column, mouse, density — applied immediately and
57
+ persisted to `state/panel.conf`. A sixth key, `theme` (`dark`/`light`/`auto`), pins the palette and is not an
58
+ overlay item; `state/panel.conf` is read **by the TUI only**, so `--print`/`--json` stay byte-stable under any
59
+ preference. A missing, unreadable or corrupt file falls back to the defaults.
60
+
61
+ Every visible string comes from `src/strings/{zh,en}.ts`; the two tables' key sets, placeholders and non-empty
62
+ values are asserted in the gate (`tests/panel-strings.mjs`, wired into `tests/smoke.sh` §28), which also refuses a
63
+ CJK literal outside `src/strings/**`.
64
+
65
+ **Mouse** follows the preference: on enables SGR reporting (`ESC[?1000h` `ESC[?1006h`) for the console's lifetime
66
+ and disables it on exit; off emits no sequence at all. Every documented key — `m`, `f`, `s`, `,`, Tab, `1`–`4`,
67
+ `↑`/`↓`, `q`, and on the board page `←`/`→`, `c` and Enter — is a click target (Ink strips the leading ESC from
68
+ the SGR sequence; the parser tolerates both
69
+ spellings) and the wheel scrolls the page's list. On the board page the wheel scrolls the lane under the cursor
70
+ while the other lanes and the focus stay put, a click focuses a card and a click on the focused card opens its
71
+ detail view, and a click on a lane's header — or on a folded lane's three-column frame — toggles that lane's fold; in the detail view the tabs and both nav chips are targets and the replacement leaves no card target
72
+ behind (a replaced block is dead). The fixtures drive real SGR bytes through a pty (`tests/panel-b3-pty-mouse.py`)
73
+ and through a real terminal→tmux→pane chain (`tests/panel-b3-pty-tmux-mouse.py`), because `tmux send-keys` cannot inject `0x1b`.
74
+
75
+ **Collapse.** `q` rebuilds the patrol window in place as the headless tick loop (`team monitor --headless`): one
76
+ window, one process, the tick keeps logging. `team pulse up` restores the console in the same window and
77
+ `team pulse status` reports which shape the window is in. `Ctrl-C` still exits.
78
+
79
+ ## The project-settings view (P22)
80
+
81
+ The settings overlay (`,`) carries one navigation row — `项目设置` / `Project settings` — which opens the
82
+ project-settings view. It replaces the page's blocks (title band, tabs and key band stay) and lists the project
83
+ contract from `team __panel-data --block settings`, whose payload is exactly `team config list --json`: one row
84
+ per schema key plus one per key the file carries that the schema does not know, grouped by the **effect class the
85
+ command reports** (`apply` / `restart` / `refuse`), with the file's value, the schema's default for an unset key,
86
+ the line's own inline comment and the command's warning/route text. `↑`/`↓` walk the row window (a click focuses a
87
+ row, a second click opens it), `/` opens the compose editor in `filter` mode (matches key or value; `esc` clears),
88
+ and `esc` returns to the overlay row it was opened from (`q` keeps its global collapse meaning). A `refuse` row
89
+ opens no editor — the command's route is shown. An editable row opens the compose line's `setting` mode holding the
90
+ file's value (or the schema default): the first `enter` runs `team config set … --dry-run` and renders the
91
+ confirmation (the class's timing; a danger reply needs one more `enter`), the second `enter` runs
92
+ `team config set … --yes` with the fingerprint pinned when the editor opened; the exit code maps to the receipt
93
+ and every settle re-reads the list and the audit footer. The seats block (one row per roster seat plus `pm`) shows
94
+ the model the CLI displays with its source badge (`配置` / `显式` / `历史记录`) and `enter` opens a picker (the
95
+ command's `known[]`, the removal, a free-text line) writing through `team config set-agent-model …`; the console
96
+ never restarts a seat — a running window keeps its model until its next `dispatch`/`resume`.
97
+
98
+ The view is console-only: `--print`/`--json` never read it, a parked console spawns no `settings` child (the
99
+ `detail` block's on-demand rule), and the reader rides the open view, never the frame cadence.
100
+
101
+ The pty fixtures for it are `tests/panel-p21.sh` (scenarios `settings write conflict seats readonly`, driven
102
+ through the real CLI behind an argv-logging wrapper).
103
+
104
+ ## Compose and the three actions (pulse-console B2)
105
+
106
+ `m` opens a bottom input line **on any page**; the draft is edited at an insertion point (arrow keys, Home/End,
107
+ pi's word/line keys, kill ring and undo) and `C-j` inserts a line break while Enter sends through the guarded
108
+ delivery path. The receipt is one of three honest states — **delivered**, **queued** (the PM's box is busy) or
109
+ **held** (the payload is in `state/outbox/held/`). Esc keeps the draft in `state/draft.md` and the next `m`
110
+ brings it back; `C-o` hands the draft to `$EDITOR` with rendering suspended for the whole handoff (`C-e` is the
111
+ line-end key). `f` runs `team outbox flush` and `s`
112
+ toggles standby (switching it on asks for a one-line reason in the same input line). The console itself never
113
+ types into the PM's pane — every delivery is the owning command's, and the input line keeps refreshing the
114
+ rest of the frame while it is open.
115
+
116
+ The receipt is mapped from the send command's machine tokens, never from its human prose:
117
+ `draft-send.sh` runs the same guarded `team draft send` function in one shell (the CLI's
118
+ `TEAM_SEND_OUTCOME` / `TEAM_OUTBOX_RESULT` cannot cross a process boundary) and prints
119
+ `rc=<n> outcome=<token> result=<token>` for the console to parse. It lives under `scripts/panel/**` and
120
+ changes nothing in the CLI's own files.
121
+
122
+ The console's own files live in the project's state directory (`--state-dir`, passed by `team monitor`):
123
+ `state/draft.md` (the compose draft), `state/panel.conf` (the preferences) and `state/panel-page` (the last
124
+ page). They are registered in `references/config.md` §3.
125
+
126
+ ## Layout
127
+
128
+ `layout.ts` is a pure function of (data, width, height, view state): the same inputs produce the same frame byte
129
+ for byte. Four width tiers — ≥160 columns two columns, 100–159 two compact columns, <100 one column, <60 the
130
+ minimal form (table columns dropped, times to the clock, states abbreviated) — with the documented degradation
131
+ order: side-by-side blocks become one column, a block folds into one summary line as the height runs out, then
132
+ blocks collapse. A terminal resize re-lays out the next frame live. The four tiers × both themes are pinned as
133
+ byte-exact snapshots in `tests/snapshots/` (`tests/panel-snapshots.sh`) — the overview page, plus the board page
134
+ and the detail view (the latter at 120 and 59 columns) — which also checks that a 60×8 pane is never overrun.
135
+
136
+ ## What is committed, and why
137
+
138
+ | Path | What it is |
139
+ |---|---|
140
+ | `panel.js` | **the committed bundle** — the only file the runtime path uses. It runs with no `node_modules` and no network, so installing the skill needs no package manager |
141
+ | `src/*.tsx`, `src/*.ts` | the sources (layout, Ink app, width table, sanitizer, the bash data adapter, the CLI) |
142
+ | `src/strings/{zh,en}.ts` | the language tables (plain ESM + JSDoc, so the gate script can import them with any JS runtime) |
143
+ | `package.json`, `bun.lock` | the pinned build-time dependencies (`bun install --frozen-lockfile` is part of the build) |
144
+ | `build.sh` | the one build command; it writes `panel.js` |
145
+ | `draft-send.sh` | the send bridge: the guarded `team draft send` run in one shell, printing one machine line (rc + outcome tokens) for the receipt |
146
+ | `tsconfig.json` | types only (`bunx tsc --noEmit` is a development check, not a gate) |
147
+
148
+ Four extra machine exits exist for the fixtures (they are not part of the user-facing contract):
149
+ `--snapshot` prints one themed frame with its SGR bytes (the snapshot suite's input) — with `--overlay` it opens
150
+ the settings overlay in that frame, which is how the overlay's column plan is checked at every width — with
151
+ `--targets` it prints **only** the frame's click-target map (the fixtures' input for the "every key affordance is
152
+ also a mouse target" requirement), `--detail <ID>` renders that entry's detail view in the snapshot, and
153
+ `--palette` prints the declared palettes with their contrast pairs (`tests/panel-contrast.mjs` recomputes every
154
+ pair independently and refuses anything below 4.5:1).
155
+
156
+ ## Rebuilding it
157
+
158
+ ```sh
159
+ bun install --frozen-lockfile
160
+ bash skills/teamsmith/scripts/panel/build.sh
161
+ ```
162
+
163
+ The build needs the network (it resolves the pinned dependencies) and Bun ≥ 1.3; it is a maintainer action, not
164
+ something a user of the skill ever runs. The result is deterministic: the same lockfile, sources and Bun version
165
+ produce the same bytes, so `cmp` against the committed `panel.js` is the release-time check (the smoke suite runs
166
+ the same comparison when Bun is available).
167
+
168
+ The committed artifact at the time of writing:
169
+
170
+ ```
171
+ file: skills/teamsmith/scripts/panel/panel.js
172
+ size and sha256: printed by build.sh (the smoke suite compares a fresh rebuild byte for byte)
173
+ pins: ink 7.1.1 · react 19.3.0 · runtime floor: node >= 20 | bun >= 1.3
174
+ ```
175
+
176
+ The bundle's header (first lines of `panel.js`) names the same pins and the build command; `node panel.js
177
+ --version` prints them too, so a stale bundle is visible without a rebuild.
178
+
179
+ ## Notes for maintainers
180
+
181
+ - `package.json` is only read by the build and by a consistency check; nothing installs it at runtime. The
182
+ repository stays free of `node_modules` (it is `.gitignore`d here).
183
+ - Ink imports `react-devtools-core` statically; it is pinned as a dependency so the bundle resolves it offline.
184
+ `--external react-devtools-core` is *not* an option: it moves the failure to the runtime.
185
+ - `TEAM_MONITOR_UI=tui` forces the TUI renderer even when stdout is redirected. Ink writes no control bytes when
186
+ stdout is not a TTY, so a piped sample cannot tell the two renderers apart — the real-pane capture is what
187
+ pins the renderer.
188
+ - The panel's own sanitizer (`src/sanitize.ts`) runs on every string before layout; the bash data command also
189
+ strips control bytes before JSON-encoding, because a raw control byte makes the JSON unparseable.
190
+ - The machine exits assemble the original eight blocks plus the overview's four (`board`, `changes`, `specs`,
191
+ `decisions`); the page-2/3 readers (`outbox_list`, `inbox`, `patrol`, `health`) are console-only, so `--json`
192
+ keeps its cost and its keys and a `doctor` run never sits on a machine exit's path.
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env bash
2
+ # Build the committed single-file panel bundle.
3
+ #
4
+ # bun install --frozen-lockfile && bash skills/teamsmith/scripts/panel/build.sh
5
+ #
6
+ # The build is deterministic: same lockfile + same sources + same Bun version produce the same
7
+ # bytes, which is what makes "rebuild reproduces the committed panel.js" a checkable promise.
8
+ # `panel.js` is committed because an installation of the skill must run with no node_modules and no
9
+ # network; this script is only run by a maintainer (it needs the registry).
10
+ set -euo pipefail
11
+ cd "$(dirname "$0")"
12
+
13
+ BUN="${BUN:-}"
14
+ if [ -z "$BUN" ]; then
15
+ for cand in bun "$HOME/.bun/bin/bun"; do
16
+ if command -v "$cand" >/dev/null 2>&1; then BUN="$cand"; break; fi
17
+ done
18
+ fi
19
+ if [ -z "$BUN" ]; then
20
+ printf 'build.sh: bun is required to rebuild the panel bundle (https://bun.sh)\n' >&2
21
+ exit 1
22
+ fi
23
+
24
+ INK_PIN="$(sed -n 's/.*"ink": *"\([^"]*\)".*/\1/p' package.json)"
25
+ REACT_PIN="$(sed -n 's/.*"react": *"\([^"]*\)".*/\1/p' package.json)"
26
+ [ -n "$INK_PIN" ] && [ -n "$REACT_PIN" ] || { printf 'build.sh: cannot read the pins from package.json\n' >&2; exit 1; }
27
+ BUILD_CMD='bun install --frozen-lockfile && bash skills/teamsmith/scripts/panel/build.sh'
28
+
29
+ TMP="panel.js.tmp"
30
+ "$BUN" build src/main.tsx \
31
+ --target=node --format=esm --minify \
32
+ --define "__PIN_INK__=\"$INK_PIN\"" \
33
+ --define "__PIN_REACT__=\"$REACT_PIN\"" \
34
+ --define "__BUILD_CMD__=\"$BUILD_CMD\"" \
35
+ --outfile "$TMP"
36
+
37
+ # Provenance header (a stale bundle is detectable without a network rebuild). Kept free of
38
+ # timestamps/hosts so the rebuild stays byte-identical.
39
+ {
40
+ printf '// teamsmith pulse panel — generated bundle; do not edit by hand\n'
41
+ printf '// built from src/*.tsx by: %s\n' "$BUILD_CMD"
42
+ printf '// pinned: ink %s · react %s · runtime floor: node >=20 | bun >=1.3\n' "$INK_PIN" "$REACT_PIN"
43
+ printf '// size and sha256: README.md\n'
44
+ cat "$TMP"
45
+ } > panel.js
46
+ rm -f "$TMP"
47
+ printf 'panel.js written (%s bytes, sha256 %s)\n' "$(wc -c < panel.js | tr -d ' ')" "$(sha256sum panel.js | cut -d' ' -f1)"
@@ -0,0 +1,109 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "configVersion": 1,
4
+ "workspaces": {
5
+ "": {
6
+ "name": "teamsmith-panel",
7
+ "dependencies": {
8
+ "ink": "7.1.1",
9
+ "react": "19.3.0",
10
+ "react-devtools-core": "8.0.0",
11
+ },
12
+ "devDependencies": {
13
+ "@types/node": "22.20.3",
14
+ "@types/react": "19.3.0",
15
+ },
16
+ },
17
+ },
18
+ "packages": {
19
+ "@alcalzone/ansi-tokenize": ["@alcalzone/ansi-tokenize@0.3.1", "", { "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" } }, "sha512-cUD0PT0YX+rImRhfn7BfMRduP/tX/Zqt/N0dHlAyn2RlcJssCb5KsCJkhln61eh9vuJDkH8wKn3L8zJzzWXPFg=="],
20
+
21
+ "@types/node": ["@types/node@22.20.3", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-DZmzkmwHzXrLPAXPyKNDzlIwMMUZCVacoD25ywdy5YTKGbOx/2ld+Q38Im2zJ0vBuZP5Prd3VZutKZyXwkOS8A=="],
22
+
23
+ "@types/react": ["@types/react@19.3.0", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg=="],
24
+
25
+ "ansi-escapes": ["ansi-escapes@7.3.0", "", { "dependencies": { "environment": "^1.0.0" } }, "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg=="],
26
+
27
+ "ansi-regex": ["ansi-regex@6.3.0", "", {}, "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ=="],
28
+
29
+ "ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="],
30
+
31
+ "auto-bind": ["auto-bind@5.0.1", "", {}, "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg=="],
32
+
33
+ "chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],
34
+
35
+ "cli-boxes": ["cli-boxes@4.0.1", "", {}, "sha512-5IOn+jcCEHEraYolBPs/sT4BxYCe2nHg374OPiItB1O96KZFseS2gthU4twyYzeDcFew4DaUM/xwc5BQf08JJw=="],
36
+
37
+ "cli-cursor": ["cli-cursor@4.0.0", "", { "dependencies": { "restore-cursor": "^4.0.0" } }, "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg=="],
38
+
39
+ "cli-truncate": ["cli-truncate@6.1.1", "", { "dependencies": { "slice-ansi": "^9.0.0", "string-width": "^8.2.0" } }, "sha512-06p9vyLahLa4zkGcgsGxU6iEkSOiuI4fhCH6Emhe2lPAcoUv73n72DnODsnHA+5wwXGnV0n9M9/qOQJSjYhFhw=="],
40
+
41
+ "code-excerpt": ["code-excerpt@4.0.0", "", { "dependencies": { "convert-to-spaces": "^2.0.1" } }, "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA=="],
42
+
43
+ "convert-to-spaces": ["convert-to-spaces@2.0.1", "", {}, "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ=="],
44
+
45
+ "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
46
+
47
+ "environment": ["environment@1.1.0", "", {}, "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q=="],
48
+
49
+ "es-toolkit": ["es-toolkit@1.52.0", "", {}, "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA=="],
50
+
51
+ "escape-string-regexp": ["escape-string-regexp@2.0.0", "", {}, "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w=="],
52
+
53
+ "get-east-asian-width": ["get-east-asian-width@1.6.0", "", {}, "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA=="],
54
+
55
+ "indent-string": ["indent-string@5.0.0", "", {}, "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg=="],
56
+
57
+ "ink": ["ink@7.1.1", "", { "dependencies": { "@alcalzone/ansi-tokenize": "^0.3.0", "ansi-escapes": "^7.3.0", "ansi-styles": "^6.2.3", "auto-bind": "^5.0.1", "chalk": "^5.6.2", "cli-boxes": "^4.0.1", "cli-cursor": "^4.0.0", "cli-truncate": "^6.0.0", "code-excerpt": "^4.0.0", "es-toolkit": "^1.45.1", "indent-string": "^5.0.0", "is-in-ci": "^2.0.0", "patch-console": "^2.0.0", "react-reconciler": "^0.33.0", "scheduler": "^0.27.0", "signal-exit": "^3.0.7", "slice-ansi": "^9.0.0", "stack-utils": "^2.0.6", "string-width": "^8.2.0", "terminal-size": "^4.0.1", "type-fest": "^5.5.0", "widest-line": "^6.0.0", "wrap-ansi": "^10.0.0", "ws": "^8.20.0", "yoga-layout": "~3.2.1" }, "peerDependencies": { "@types/react": ">=19.2.0", "react": ">=19.2.0", "react-devtools-core": ">=6.1.2" }, "optionalPeers": ["@types/react", "react-devtools-core"] }, "sha512-Y43xxa1ZSPvpmfLHcN5o+OdP8Rf8ykkNJEuKYOUNZKT8wXVNLFTtEm1nSDMQkfBH+YANF4Xuu0hhZ4ejqAtN2w=="],
58
+
59
+ "is-fullwidth-code-point": ["is-fullwidth-code-point@5.1.0", "", { "dependencies": { "get-east-asian-width": "^1.3.1" } }, "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ=="],
60
+
61
+ "is-in-ci": ["is-in-ci@2.0.0", "", { "bin": { "is-in-ci": "cli.js" } }, "sha512-cFeerHriAnhrQSbpAxL37W1wcJKUUX07HyLWZCW1URJT/ra3GyUTzBgUnh24TMVfNTV2Hij2HLxkPHFZfOZy5w=="],
62
+
63
+ "mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="],
64
+
65
+ "onetime": ["onetime@5.1.2", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="],
66
+
67
+ "patch-console": ["patch-console@2.0.0", "", {}, "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA=="],
68
+
69
+ "react": ["react@19.3.0", "", {}, "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog=="],
70
+
71
+ "react-devtools-core": ["react-devtools-core@8.0.0", "", { "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" } }, "sha512-DGXJX+sCn2zC3ZalHoJhmZJsvP4QTpERlmCQAOgExc4Vp74ywB9ZnO8992cKw5ZcOS5u8GtpchTUPbjTiu5zaw=="],
72
+
73
+ "react-reconciler": ["react-reconciler@0.33.0", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.0" } }, "sha512-KetWRytFv1epdpJc3J4G75I4WrplZE5jOL7Yq0p34+OVOKF4Se7WrdIdVC45XsSSmUTlht2FM/fM1FZb1mfQeA=="],
74
+
75
+ "restore-cursor": ["restore-cursor@4.0.0", "", { "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg=="],
76
+
77
+ "scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],
78
+
79
+ "shell-quote": ["shell-quote@1.10.0", "", {}, "sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA=="],
80
+
81
+ "signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
82
+
83
+ "slice-ansi": ["slice-ansi@9.0.0", "", { "dependencies": { "ansi-styles": "^6.2.3", "is-fullwidth-code-point": "^5.1.0" } }, "sha512-SO/3iYL5S3W57LLEniscOGPZgOqZUPCx6d3dB+52B80yJ0XstzsC/eV8gnA4tM3MHDrKz+OCFSLNjswdSC+/bA=="],
84
+
85
+ "stack-utils": ["stack-utils@2.0.6", "", { "dependencies": { "escape-string-regexp": "^2.0.0" } }, "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ=="],
86
+
87
+ "string-width": ["string-width@8.2.2", "", { "dependencies": { "get-east-asian-width": "^1.5.0", "strip-ansi": "^7.1.2" } }, "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg=="],
88
+
89
+ "strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="],
90
+
91
+ "tagged-tag": ["tagged-tag@1.0.0", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="],
92
+
93
+ "terminal-size": ["terminal-size@4.0.1", "", {}, "sha512-avMLDQpUI9I5XFrklECw1ZEUPJhqzcwSWsyyI8blhRLT+8N1jLJWLWWYQpB2q2xthq8xDvjZPISVh53T/+CLYQ=="],
94
+
95
+ "type-fest": ["type-fest@5.9.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-yANm3Jr3GiJ1qgJlxGAVxTOIcEOk1rhQHamlXtnrCK7EHP4HeM9OGxtMg/W7HFdrVzw/ZWJKGVIJusVH85sLtw=="],
96
+
97
+ "undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
98
+
99
+ "widest-line": ["widest-line@6.0.0", "", { "dependencies": { "string-width": "^8.1.0" } }, "sha512-U89AsyEeAsyoF0zVJBkG9zBgekjgjK7yk9sje3F4IQpXBJ10TF6ByLlIfjMhcmHMJgHZI4KHt4rdNfktzxIAMA=="],
100
+
101
+ "wrap-ansi": ["wrap-ansi@10.0.1", "", { "dependencies": { "ansi-styles": "^6.2.3", "string-width": "^8.2.0" } }, "sha512-M0N4xzyzosiIok3svYlEo1sdLZts/8FPgYH/GPC3wvlmPoRvnoManGMrE54waYj3tISA8w6lsdesfVv67qSr8Q=="],
102
+
103
+ "ws": ["ws@8.21.3", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw=="],
104
+
105
+ "yoga-layout": ["yoga-layout@3.2.1", "", {}, "sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ=="],
106
+
107
+ "react-devtools-core/ws": ["ws@7.5.13", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA=="],
108
+ }
109
+ }
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env bash
2
+ # teamsmith · panel send bridge (pulse-console B2)
3
+ #
4
+ # bash scripts/panel/draft-send.sh <draft-file> [extra args to `team draft send`...]
5
+ #
6
+ # Why this exists: `team draft send` reports its machine outcome in the shell variables
7
+ # `TEAM_SEND_OUTCOME` / `TEAM_OUTBOX_RESULT`, which a caller cannot read across a process boundary
8
+ # — and the console's receipt contract forbids parsing the human prose (`✓ draft:已确认送达 …`)
9
+ # that the CLI prints next to them. The bridge therefore runs the **same guarded send function**
10
+ # in its own shell and prints exactly one machine line:
11
+ #
12
+ # rc=<n> outcome=<token> result=<token>
13
+ #
14
+ # `outcome` is `TEAM_SEND_OUTCOME` (delivered|queued|forced|unknown-sent|duplicate|offline|…),
15
+ # `result` is the finer `TEAM_OUTBOX_RESULT` (delivered|held|busy|queued|offline|terminal|skip).
16
+ # The prose goes to stderr unchanged so the console can show it as the receipt's detail.
17
+ #
18
+ # The bridge is panel code on purpose: it lives under `scripts/panel/**` and changes nothing in
19
+ # the CLI's own files. If the CLI ever grows a machine-readable send output (the `[v1.1]`
20
+ # `team draft send --json`), this bridge is the one file that goes away.
21
+ set -uo pipefail
22
+
23
+ self="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
24
+ skill="$(cd -P "$self/../.." && pwd)"
25
+ file="${1:-}"
26
+ if [ -n "$file" ]; then shift || true; fi
27
+
28
+ emit() { printf 'rc=%s outcome=%s result=%s\n' "${1:-1}" "${TEAM_SEND_OUTCOME:-}" "${TEAM_OUTBOX_RESULT:-}"; }
29
+
30
+ if [ -z "$file" ] || [ ! -f "$file" ]; then
31
+ printf 'draft-send: 草稿文件不存在(%s)\n' "${file:--}" >&2
32
+ emit 2
33
+ exit 2
34
+ fi
35
+
36
+ log="$(mktemp "${TMPDIR:-/tmp}/panel-draft-send.XXXXXX")"
37
+ trap 'rm -f "$log"' EXIT
38
+
39
+ TEAM_SKILL_DIR="${TEAM_SKILL_DIR:-$skill}"; export TEAM_SKILL_DIR
40
+ TEAM_CLI="${TEAM_CLI:-team}"; export TEAM_CLI
41
+
42
+ rc=0
43
+ . "$skill/scripts/lib/common.sh" >>"$log" 2>&1 || rc=$?
44
+ if [ "$rc" = "0" ]; then
45
+ for f in "$skill"/scripts/lib/cmd-*.sh; do
46
+ # shellcheck disable=SC1090
47
+ . "$f" >>"$log" 2>&1 || rc=$?
48
+ [ "$rc" = "0" ] || break
49
+ done
50
+ fi
51
+ if [ "$rc" = "0" ]; then
52
+ team_identity_resolve >>"$log" 2>&1 || true
53
+ team_load_config >>"$log" 2>&1 || rc=$?
54
+ fi
55
+ # M40:身份冲突(继承了别的项目的 TEAM_* 身份)→ 拒绝投递 —— 否则草稿会进错项目的队列。
56
+ # 身份本身已经按 cwd(= 面板的 root)解析,告警也写进同一个日志,由调用方原样展示。
57
+ if [ "$rc" = "0" ]; then
58
+ team_identity_gate draft >>"$log" 2>&1 || rc=$?
59
+ fi
60
+ if [ "$rc" = "0" ]; then
61
+ # The CLI's own command handler (`team draft send`), one layer below the `team` wrapper's arg
62
+ # parsing: same dispatch, same guarded path, but the outcome variables stay readable here.
63
+ team_cmd_draft send "$file" "$@" >>"$log" 2>&1 || rc=$?
64
+ fi
65
+
66
+ cat "$log" >&2
67
+ emit "$rc"
68
+ exit "$rc"
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "teamsmith-panel",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "description": "teamsmith pulse panel: the Ink front end over the monitor.mjs data layer. build.sh writes the committed panel.js bundle; nothing installs these packages at runtime.",
7
+ "engines": {
8
+ "node": ">=20",
9
+ "bun": ">=1.3"
10
+ },
11
+ "scripts": {
12
+ "build": "bash build.sh",
13
+ "typecheck": "bunx tsc --noEmit"
14
+ },
15
+ "dependencies": {
16
+ "ink": "7.1.1",
17
+ "react": "19.3.0",
18
+ "react-devtools-core": "8.0.0"
19
+ },
20
+ "devDependencies": {
21
+ "@types/node": "22.20.3",
22
+ "@types/react": "19.3.0"
23
+ }
24
+ }