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.
- package/README.md +13 -7
- package/package.json +1 -1
- package/skills/teamsmith/CHANGELOG.md +67 -0
- package/skills/teamsmith/SKILL.md +26 -8
- package/skills/teamsmith/extension/team-notify.ts +37 -6
- package/skills/teamsmith/extension/team.ts +438 -0
- package/skills/teamsmith/references/agent-adapters.md +7 -7
- package/skills/teamsmith/references/config.md +65 -18
- package/skills/teamsmith/references/migration.md +220 -34
- package/skills/teamsmith/references/protocol.md +250 -25
- package/skills/teamsmith/references/troubleshooting.md +124 -7
- package/skills/teamsmith/references/workflows.md +66 -20
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +525 -90
- package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +71 -10
- package/skills/teamsmith/scripts/lib/cmd-config.sh +562 -128
- package/skills/teamsmith/scripts/lib/cmd-death.sh +2 -15
- package/skills/teamsmith/scripts/lib/cmd-docs.sh +6 -3
- package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
- package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
- package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
- package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
- package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
- package/skills/teamsmith/scripts/lib/cmd-project.sh +149 -105
- package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
- package/skills/teamsmith/scripts/lib/cmd-reply.sh +96 -0
- package/skills/teamsmith/scripts/lib/cmd-review.sh +188 -40
- package/skills/teamsmith/scripts/lib/cmd-status.sh +268 -30
- package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +634 -54
- package/skills/teamsmith/scripts/lib/common.sh +1560 -109
- package/skills/teamsmith/scripts/lib/gate-lock.sh +544 -0
- package/skills/teamsmith/scripts/monitor.mjs +34 -3
- package/skills/teamsmith/scripts/panel/README.md +22 -11
- package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
- package/skills/teamsmith/scripts/panel/panel.js +226 -224
- package/skills/teamsmith/scripts/panel/src/App.tsx +478 -184
- package/skills/teamsmith/scripts/panel/src/clipboard.ts +11 -5
- package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
- package/skills/teamsmith/scripts/panel/src/data.ts +95 -7
- package/skills/teamsmith/scripts/panel/src/layout.ts +703 -152
- package/skills/teamsmith/scripts/panel/src/main.tsx +129 -19
- package/skills/teamsmith/scripts/panel/src/settings.ts +1 -1
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +76 -31
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +78 -33
- package/skills/teamsmith/scripts/panel/src/types.ts +204 -17
- package/skills/teamsmith/scripts/replies.mjs +896 -0
- package/skills/teamsmith/scripts/shim/tmux +18 -0
- package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
- package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
- package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
- package/skills/teamsmith/scripts/team +20 -6
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +23 -3
- package/skills/teamsmith/templates/BOARD.md.tmpl +2 -2
- package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +7 -3
- package/skills/teamsmith/templates/PROTOCOL.md.tmpl +17 -0
- package/skills/teamsmith/templates/config.sh.tmpl +29 -5
- package/skills/teamsmith/templates/memory-seed.md.tmpl +3 -0
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +41 -1
- package/skills/teamsmith/templates/report.md.tmpl +12 -0
- package/skills/teamsmith/templates/task.md.tmpl +4 -0
- package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
- package/skills/teamsmith/tests/bg-ledger.sh +168 -10
- package/skills/teamsmith/tests/checkout-shape-probe.sh +3 -1
- package/skills/teamsmith/tests/config-cli.sh +320 -300
- package/skills/teamsmith/tests/death-cause.sh +5 -2
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
- package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
- package/skills/teamsmith/tests/flip-m33.sh +5 -3
- package/skills/teamsmith/tests/flip-m37.sh +4 -1
- package/skills/teamsmith/tests/flip-m4.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.5.sh +4 -1
- package/skills/teamsmith/tests/flip-m7.2.sh +4 -1
- package/skills/teamsmith/tests/flip-p158.sh +2 -1
- package/skills/teamsmith/tests/flip-p210.sh +4 -1
- package/skills/teamsmith/tests/flip-p217.sh +4 -1
- package/skills/teamsmith/tests/flip-p287-lock.sh +342 -0
- package/skills/teamsmith/tests/flip-p287-name.sh +279 -0
- package/skills/teamsmith/tests/flip-p304-read-side.sh +98 -0
- package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
- package/skills/teamsmith/tests/flip-p309-p162-deep.sh +122 -0
- package/skills/teamsmith/tests/flip-p310-lock.sh +216 -0
- package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
- package/skills/teamsmith/tests/help-surface.sh +1664 -0
- package/skills/teamsmith/tests/install-shape.sh +283 -22
- package/skills/teamsmith/tests/key-replies-pty.sh +374 -0
- package/skills/teamsmith/tests/key-replies-ui.sh +325 -0
- package/skills/teamsmith/tests/key-replies.sh +1314 -0
- package/skills/teamsmith/tests/ledger-ban.sh +9 -8
- package/skills/teamsmith/tests/ledger-claim.sh +248 -0
- package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
- package/skills/teamsmith/tests/lib/model-policy.sh +30 -0
- package/skills/teamsmith/tests/lib/model-routing-boundary.sh +420 -0
- package/skills/teamsmith/tests/lib/model-routing-expansion.sh +155 -0
- package/skills/teamsmith/tests/lib/model-routing-flips.py +187 -0
- package/skills/teamsmith/tests/lib/model-routing-roles.sh +250 -0
- package/skills/teamsmith/tests/lib/proc-io.sh +103 -0
- package/skills/teamsmith/tests/lib/reply-fixture.sh +367 -0
- package/skills/teamsmith/tests/lib/section-guard.sh +258 -13
- package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
- package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
- package/skills/teamsmith/tests/lib/tmux-iso.sh +39 -13
- package/skills/teamsmith/tests/loop-inventory.tsv +59 -47
- package/skills/teamsmith/tests/panel-b2.sh +107 -4
- package/skills/teamsmith/tests/panel-b3-stub.sh +139 -4
- package/skills/teamsmith/tests/panel-b3.sh +189 -29
- package/skills/teamsmith/tests/panel-choices.sh +81 -63
- package/skills/teamsmith/tests/panel-cpu.sh +3 -2
- package/skills/teamsmith/tests/panel-knobs.sh +7 -1
- package/skills/teamsmith/tests/panel-p21.sh +445 -241
- package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
- package/skills/teamsmith/tests/panel-strings.mjs +33 -18
- package/skills/teamsmith/tests/perf.sh +122 -31
- package/skills/teamsmith/tests/pm-box-real.sh +1 -1
- package/skills/teamsmith/tests/pulse-nudge-key.sh +1 -1
- package/skills/teamsmith/tests/routes.sh +364 -109
- package/skills/teamsmith/tests/seat-interrupt.sh +1002 -0
- package/skills/teamsmith/tests/seat-visibility.sh +675 -0
- package/skills/teamsmith/tests/section-budgets.tsv +26 -12
- package/skills/teamsmith/tests/section-guard.sh +6 -1
- package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
- package/skills/teamsmith/tests/section-paths.tsv +42 -26
- package/skills/teamsmith/tests/section-select.sh +90 -7
- package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
- package/skills/teamsmith/tests/slash-team.sh +617 -0
- package/skills/teamsmith/tests/smoke.sh +3762 -628
- package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-120.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-160.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-light-59.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-99.txt +5 -5
- package/skills/teamsmith/tests/task-header-model.sh +2 -1
- package/skills/teamsmith/tests/task-model-routing.sh +1511 -0
- package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
- package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
- package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
- package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
- package/skills/teamsmith-init/SKILL.md +43 -43
- package/skills/teamsmith-init/references/bootstrap.md +8 -6
- package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +9 -5
|
@@ -33,7 +33,17 @@ import { clockOf } from './format.js'
|
|
|
33
33
|
import { dispWidth } from './width.js'
|
|
34
34
|
import type { Palette } from './theme.js'
|
|
35
35
|
import type { Segment } from './types.js'
|
|
36
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
BLOCK_NAMES,
|
|
38
|
+
MACHINE_BLOCKS,
|
|
39
|
+
cleanIdentityEnv,
|
|
40
|
+
createPanelCache,
|
|
41
|
+
findTeamCli,
|
|
42
|
+
loadPanelData,
|
|
43
|
+
panelDirOf,
|
|
44
|
+
runTick,
|
|
45
|
+
type BlockName,
|
|
46
|
+
} from './data.js'
|
|
37
47
|
import type { DataOptions, DataResult, PanelCache } from './data.js'
|
|
38
48
|
import { normalizeNewlines, parseSendResult, mapReceipt, DRAFT_FILE } from './compose.js'
|
|
39
49
|
import type { Receipt } from './compose.js'
|
|
@@ -44,7 +54,7 @@ import { fill, stringsFor } from './strings/index.js'
|
|
|
44
54
|
import { PANEL_CONF_FILE, PANEL_PAGE_FILE, readPage, readSettings, writePage, writeSettings } from './settings.js'
|
|
45
55
|
import type { Settings } from './settings.js'
|
|
46
56
|
import { contrastPairs, PALETTES, resolveTheme } from './theme.js'
|
|
47
|
-
import type { FrameInput, PageId, ViewState } from './types.js'
|
|
57
|
+
import type { FrameInput, PageId, ViewState, DetailSource } from './types.js'
|
|
48
58
|
|
|
49
59
|
/** The Kitty keyboard protocol's pop/push pair, written around the editor handoff (design §6). */
|
|
50
60
|
const KITTY_POP = '\u001b[<u'
|
|
@@ -99,12 +109,35 @@ function argOf(name: string): string | undefined {
|
|
|
99
109
|
|
|
100
110
|
const has = (name: string): boolean => process.argv.includes(`--${name}`)
|
|
101
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Write every byte to a raw fd. Node puts fd 1 (and 2) in non-blocking mode when it is a pipe, so a
|
|
114
|
+
* single `writeSync` of a whole frame may return a **short count** — the tail is then simply lost.
|
|
115
|
+
* Measured on this pinned stack: a 160-column `--snapshot` piped through `sed` dropped its last 462
|
|
116
|
+
* bytes roughly one run in five (a frame cut mid-character). A full-write loop is the fix; `EAGAIN`
|
|
117
|
+
* means the pipe's buffer is full, so wait a millisecond and continue instead of dropping the tail.
|
|
118
|
+
*/
|
|
119
|
+
function writeAll(fd: number, text: string): void {
|
|
120
|
+
const buf = Buffer.from(text, 'utf8')
|
|
121
|
+
let off = 0
|
|
122
|
+
let spins = 0
|
|
123
|
+
while (off < buf.length) {
|
|
124
|
+
try {
|
|
125
|
+
off += writeSync(fd, buf, off, buf.length - off)
|
|
126
|
+
spins = 0
|
|
127
|
+
} catch (e) {
|
|
128
|
+
if ((e as NodeJS.ErrnoException)?.code !== 'EAGAIN') throw e
|
|
129
|
+
if (++spins > 10000) throw e // ~10s of a full pipe: fail loudly instead of spinning forever
|
|
130
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 1)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
102
135
|
/** Machine-readable output must not be lost to an async pipe write. */
|
|
103
136
|
function out(text: string): void {
|
|
104
|
-
|
|
137
|
+
writeAll(1, text)
|
|
105
138
|
}
|
|
106
139
|
function fail(message: string): never {
|
|
107
|
-
|
|
140
|
+
writeAll(2, `✗ ${message}\n`)
|
|
108
141
|
process.exit(1)
|
|
109
142
|
}
|
|
110
143
|
|
|
@@ -135,6 +168,23 @@ const pageArg = argOf('page')
|
|
|
135
168
|
const langArg = argOf('lang')
|
|
136
169
|
/** `--detail <ID>`: render the read-only detail view in a snapshot (the overlay's sibling exit). */
|
|
137
170
|
const detailArg = argOf('detail') || ''
|
|
171
|
+
/**
|
|
172
|
+
* `--detail-source entry|spec|change|decision`: the source the snapshot's detail view addresses.
|
|
173
|
+
* Read-only and snapshot-only — the live console passes its source through `api.setDetail`. An
|
|
174
|
+
* unrecognised value is ignored (entry), so the argument cannot open a way out of the closed set.
|
|
175
|
+
*/
|
|
176
|
+
const detailSourceRaw = argOf('detail-source') || ''
|
|
177
|
+
const detailSourceArg =
|
|
178
|
+
detailSourceRaw === 'spec' || detailSourceRaw === 'change' || detailSourceRaw === 'decision' ? detailSourceRaw : 'entry'
|
|
179
|
+
/**
|
|
180
|
+
* Page 5's snapshot/demand knobs (pulse-key-replies). `--reply-no N` opens that number's viewer,
|
|
181
|
+
* `--reply-before N` pins the list cursor and `--reply-focus N` pins the focused slot, so the
|
|
182
|
+
* snapshot matrix can render summary/list/empty/corrupt/continuation/long-body deterministically.
|
|
183
|
+
* They are read options only: nothing here writes to the store.
|
|
184
|
+
*/
|
|
185
|
+
const replyNoArg = Number(argOf('reply-no') ?? 0) || 0
|
|
186
|
+
const replyBeforeArg = Number(argOf('reply-before') ?? 0) || 0
|
|
187
|
+
const replyFocusArg = Number(argOf('reply-focus') ?? 0) || 0
|
|
138
188
|
|
|
139
189
|
if (has('version')) {
|
|
140
190
|
out(`teamsmith panel ${PANEL_VERSION} · ink ${PIN_INK} · react ${PIN_REACT}\nbuilt by: ${BUILD_CMD}\n`)
|
|
@@ -144,7 +194,8 @@ if (has('help')) {
|
|
|
144
194
|
out(
|
|
145
195
|
'usage: panel.js [--root DIR] [--state-dir DIR] [--print|--json|--once|--headless|--snapshot|--palette]\n' +
|
|
146
196
|
' [--width N] [--height N] [--activity|--no-activity] [--events N] [--refresh N]\n' +
|
|
147
|
-
' [--no-pulse] [--theme dark|light] [--page 1|2|3|4] [--lang zh|en] [--overlay] [--detail ID] [--
|
|
197
|
+
' [--no-pulse] [--theme dark|light] [--page 1|2|3|4|5] [--lang zh|en] [--overlay] [--detail ID] [--detail-source entry|spec|change|decision]\n' +
|
|
198
|
+
' [--reply-no N] [--reply-before N] [--reply-focus N] [--version]\n',
|
|
148
199
|
)
|
|
149
200
|
process.exit(0)
|
|
150
201
|
}
|
|
@@ -242,6 +293,7 @@ function frameOf(res: DataResult, activity: boolean, scroll?: number): FrameInpu
|
|
|
242
293
|
activityBlocks: activity ? res.activity ?? [] : [],
|
|
243
294
|
blocks: res.blocks ?? {},
|
|
244
295
|
degraded: res.degraded ?? [],
|
|
296
|
+
replyBodyFailed: Boolean(res.errors?.reply_body),
|
|
245
297
|
width: widthArg || stdoutColumns || 100,
|
|
246
298
|
height: heightArg || stdoutRows || 0,
|
|
247
299
|
activity,
|
|
@@ -290,14 +342,31 @@ async function main(): Promise<void> {
|
|
|
290
342
|
const settings = readSettings(confFile)
|
|
291
343
|
const themeName = themeArg === 'dark' || themeArg === 'light' ? themeArg : resolveTheme(settings.theme)
|
|
292
344
|
const lang = langArg === 'en' || langArg === 'zh' ? langArg : settings.lang
|
|
293
|
-
const page =
|
|
294
|
-
|
|
345
|
+
const page =
|
|
346
|
+
pageArg === '1' || pageArg === '2' || pageArg === '3' || pageArg === '4' || pageArg === '5'
|
|
347
|
+
? (Number(pageArg) as PageId)
|
|
348
|
+
: settings.defaultPage
|
|
349
|
+
// Page 5's demand reads are handed to the assembly exactly as the App hands them over: the list
|
|
350
|
+
// only for the cursor in view, the body only while the viewer is open.
|
|
351
|
+
const res = await loadPanelData({
|
|
352
|
+
root,
|
|
353
|
+
teamCli,
|
|
354
|
+
activity: rawActivityOn,
|
|
355
|
+
events,
|
|
356
|
+
detailId: detailArg || null,
|
|
357
|
+
detailSource: detailArg ? detailSourceArg : null,
|
|
358
|
+
replyListOpen: page === 5 && !replyNoArg,
|
|
359
|
+
replyBefore: replyBeforeArg || null,
|
|
360
|
+
replyNo: page === 5 && replyNoArg ? replyNoArg : null,
|
|
361
|
+
})
|
|
295
362
|
const frame = frameOrFail(res, rawActivityOn)
|
|
296
363
|
const view: ViewState = {
|
|
297
364
|
...defaultView(lang, page),
|
|
298
365
|
tui: true,
|
|
299
366
|
mouseOn: settings.mouse,
|
|
300
367
|
density: settings.density,
|
|
368
|
+
replyFocus: replyFocusArg || null,
|
|
369
|
+
replyBody: replyNoArg || null,
|
|
301
370
|
overlay: wantOverlay,
|
|
302
371
|
detail: detailArg || null,
|
|
303
372
|
// P123: the snapshot is the TUI's own render path, so it reads the fold keys (the machine exits
|
|
@@ -335,7 +404,7 @@ async function main(): Promise<void> {
|
|
|
335
404
|
// `--page` is honoured here too (P123's machine-frame identity fixture renders page 4); absent,
|
|
336
405
|
// the machine frame stays the overview it always was.
|
|
337
406
|
const machinePage: PageId =
|
|
338
|
-
pageArg === '1' || pageArg === '2' || pageArg === '3' || pageArg === '4' ? (Number(pageArg) as PageId) : 1
|
|
407
|
+
pageArg === '1' || pageArg === '2' || pageArg === '3' || pageArg === '4' || pageArg === '5' ? (Number(pageArg) as PageId) : 1
|
|
339
408
|
if (once || wantPrint) {
|
|
340
409
|
// One frame; `--once` then keeps today's tick semantics, `--print` (the observer) never ticks.
|
|
341
410
|
const frame = frameOrFail(await loadPanelData({ root, teamCli, activity: rawActivityOn, events, blocks: MACHINE_BLOCKS }), rawActivityOn, MACHINE_BLOCKS)
|
|
@@ -431,12 +500,19 @@ async function main(): Promise<void> {
|
|
|
431
500
|
return ''
|
|
432
501
|
}
|
|
433
502
|
}
|
|
434
|
-
|
|
503
|
+
/**
|
|
504
|
+
* Write `state/draft.md`. Returns whether the write landed: the send settle empties the file first
|
|
505
|
+
* and must know the result before it may drop the in-memory draft (change
|
|
506
|
+
* panel-preview-and-compose — memory and disk never disagree about the draft).
|
|
507
|
+
*/
|
|
508
|
+
function writeDraft(text: string): boolean {
|
|
435
509
|
try {
|
|
436
510
|
mkdirSync(stateDir, { recursive: true })
|
|
437
511
|
writeFileSync(draftFile, String(text ?? ''))
|
|
512
|
+
return true
|
|
438
513
|
} catch {
|
|
439
514
|
/* a state directory the console cannot write must not kill the panel */
|
|
515
|
+
return false
|
|
440
516
|
}
|
|
441
517
|
}
|
|
442
518
|
|
|
@@ -539,14 +615,18 @@ async function main(): Promise<void> {
|
|
|
539
615
|
return { code: res.rc, line }
|
|
540
616
|
}
|
|
541
617
|
|
|
542
|
-
/**
|
|
543
|
-
|
|
544
|
-
|
|
618
|
+
/**
|
|
619
|
+
* One `team config set-task-model <category> <model>` invocation (P232): a category row edits one
|
|
620
|
+
* mapping entry through the owning command — the console never composes or writes the pair list
|
|
621
|
+
* itself. Same dry-run/CAS/actor panel contract as `setSetting`.
|
|
622
|
+
*/
|
|
623
|
+
async function setTaskModel(
|
|
624
|
+
category: string,
|
|
545
625
|
model: string,
|
|
546
626
|
o: { dryRun?: boolean; fingerprint?: string | null },
|
|
547
627
|
): Promise<{ code: number; line: string }> {
|
|
548
628
|
if (!teamCli) return { code: 127, line: s.noTeamCli }
|
|
549
|
-
const args = [teamCli, '--root', root, 'config', 'set-
|
|
629
|
+
const args = [teamCli, '--root', root, 'config', 'set-task-model', category, model, '--actor', 'panel']
|
|
550
630
|
if (o.dryRun) args.push('--dry-run')
|
|
551
631
|
else args.push('--yes')
|
|
552
632
|
if (o.fingerprint) args.push('--fingerprint', o.fingerprint)
|
|
@@ -720,7 +800,7 @@ async function main(): Promise<void> {
|
|
|
720
800
|
const api: PanelApi = {
|
|
721
801
|
readDraft,
|
|
722
802
|
writeDraft,
|
|
723
|
-
clearDraft: () => writeDraft(''),
|
|
803
|
+
clearDraft: (): boolean => writeDraft(''),
|
|
724
804
|
send,
|
|
725
805
|
flushQueue,
|
|
726
806
|
setStandby,
|
|
@@ -733,7 +813,8 @@ async function main(): Promise<void> {
|
|
|
733
813
|
const read = await readClipboard(clipRunner)
|
|
734
814
|
if (!read) return { kind: 'none' as const, value: '' }
|
|
735
815
|
if (read.kind === 'text') return { kind: 'text' as const, value: read.text }
|
|
736
|
-
|
|
816
|
+
// P309: the paste path uses the resolved temp root the data layer reports (no second resolution).
|
|
817
|
+
const file = writePasteFile(read.bytes, read.mime, cache.snapshot().data?.capacity?.temp_root)
|
|
737
818
|
if (!file) return { kind: 'none' as const, value: '' }
|
|
738
819
|
return { kind: 'path' as const, value: file }
|
|
739
820
|
},
|
|
@@ -755,23 +836,52 @@ async function main(): Promise<void> {
|
|
|
755
836
|
opts.activity = on
|
|
756
837
|
refreshNow()
|
|
757
838
|
},
|
|
758
|
-
setDetail: (id: string | null, file?: string | null) => {
|
|
839
|
+
setDetail: (id: string | null, file?: string | null, source?: DetailSource | null) => {
|
|
759
840
|
const nextId = id ?? null
|
|
760
841
|
const nextFile = nextId ? file ?? null : null
|
|
761
|
-
|
|
842
|
+
const nextSource: DetailSource = nextId ? source ?? 'entry' : 'entry'
|
|
843
|
+
if (
|
|
844
|
+
(opts.detailId ?? null) === nextId &&
|
|
845
|
+
(opts.detailFile ?? null) === nextFile &&
|
|
846
|
+
(opts.detailSource ?? 'entry') === nextSource
|
|
847
|
+
)
|
|
848
|
+
return
|
|
762
849
|
opts.detailId = nextId
|
|
763
850
|
opts.detailFile = nextFile
|
|
851
|
+
opts.detailSource = nextSource
|
|
764
852
|
// The detail block is off the tick path: only the view's own open/tab-switch forces a build.
|
|
765
853
|
if (!nextId) return
|
|
766
854
|
// The cached block already serves this file (the open returns the first file without
|
|
767
|
-
// `--file`): record the option and rebuild nothing, so the effect can stay idempotent.
|
|
855
|
+
// `--file`): record the option and rebuild nothing, so the effect can stay idempotent. The
|
|
856
|
+
// source is part of the identity — the same id from two sources is two different reads.
|
|
768
857
|
const cached = cache.snapshot().blocks?.detail
|
|
769
858
|
if (cached?.id === nextId && nextFile && cached.file === nextFile) return
|
|
770
859
|
void cache.refresh({ force: true, only: ['detail'] }).then(adopt)
|
|
771
860
|
},
|
|
861
|
+
/**
|
|
862
|
+
* Page 5's demand reads: record the cursor/number as cache options and force exactly the block
|
|
863
|
+
* that changed. An unchanged pair (a re-render, the same page) rebuilds nothing — the effect in
|
|
864
|
+
* the App may run freely. Clearing both drops the blocks from the wanted set, so a parked page
|
|
865
|
+
* spawns no list/body child at all.
|
|
866
|
+
*/
|
|
867
|
+
setReply: ({ list, before, no }: { list: boolean; before: number | null; no: number | null }) => {
|
|
868
|
+
const nextBefore = before ?? null
|
|
869
|
+
const nextNo = no ?? null
|
|
870
|
+
const listChanged = Boolean(opts.replyListOpen) !== Boolean(list) || (opts.replyBefore ?? null) !== nextBefore
|
|
871
|
+
const noChanged = (opts.replyNo ?? null) !== nextNo
|
|
872
|
+
if (!listChanged && !noChanged) return
|
|
873
|
+
opts.replyListOpen = Boolean(list)
|
|
874
|
+
opts.replyBefore = nextBefore
|
|
875
|
+
opts.replyNo = nextNo
|
|
876
|
+
const only: BlockName[] = []
|
|
877
|
+
if (listChanged && list) only.push('reply_list')
|
|
878
|
+
if (noChanged && nextNo != null) only.push('reply_body')
|
|
879
|
+
if (!only.length) return
|
|
880
|
+
void cache.refresh({ force: true, only }).then(adopt)
|
|
881
|
+
},
|
|
772
882
|
collapse,
|
|
773
883
|
setSetting,
|
|
774
|
-
|
|
884
|
+
setTaskModel,
|
|
775
885
|
/**
|
|
776
886
|
* The path kind's existence mark (M55): resolved against the project root (`~` honoured), the
|
|
777
887
|
* rule from the command's own note. `not-exec` is only reachable for `exec` — a directory is
|
|
@@ -52,7 +52,7 @@ function boolOf(value: string): boolean | null {
|
|
|
52
52
|
|
|
53
53
|
function pageOf(value: string): PageId | null {
|
|
54
54
|
const v = value.trim()
|
|
55
|
-
if (v === '1' || v === '2' || v === '3' || v === '4') return Number(v) as PageId
|
|
55
|
+
if (v === '1' || v === '2' || v === '3' || v === '4' || v === '5') return Number(v) as PageId
|
|
56
56
|
return null
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -76,6 +76,12 @@ export const en = {
|
|
|
76
76
|
pageWork: 'work',
|
|
77
77
|
pageMessages: 'messages & logs',
|
|
78
78
|
pageBoard: 'board',
|
|
79
|
+
pageReplies: 'key replies',
|
|
80
|
+
pageOverviewShort: 'overview',
|
|
81
|
+
pageWorkShort: 'work',
|
|
82
|
+
pageMessagesShort: 'msgs',
|
|
83
|
+
pageBoardShort: 'board',
|
|
84
|
+
pageRepliesShort: 'replies',
|
|
79
85
|
pageTab: ' {name} ',
|
|
80
86
|
pageTabActive: '▸{name}◂',
|
|
81
87
|
|
|
@@ -93,6 +99,7 @@ export const en = {
|
|
|
93
99
|
// Detail view (read-only)
|
|
94
100
|
detailTitle: 'detail {id}',
|
|
95
101
|
detailNoFiles: '(no associated files for this entry)',
|
|
102
|
+
detailUnavailable: '(source unavailable: {reason})',
|
|
96
103
|
detailTruncated: '… truncated (first 128 KiB shown)',
|
|
97
104
|
detailLoading: '… loading',
|
|
98
105
|
|
|
@@ -175,22 +182,22 @@ export const en = {
|
|
|
175
182
|
group_branch: 'Branch & forge',
|
|
176
183
|
group_policy: 'Permissions & dependencies',
|
|
177
184
|
group_roster: 'Roster, models & adapters',
|
|
178
|
-
'
|
|
185
|
+
'group_task-model': 'Task categories & PM model',
|
|
179
186
|
group_workflow: 'Workflow & gates',
|
|
180
187
|
group_delivery: 'Capacity & delivery',
|
|
181
188
|
group_panel: 'Pulse & panel',
|
|
182
|
-
group_patrol: 'Patrol
|
|
189
|
+
group_patrol: 'Patrol',
|
|
183
190
|
'group_pm-lifecycle': 'PM lifecycle',
|
|
184
191
|
group_session: 'Live sessions',
|
|
185
192
|
group_meeting: 'Cross-project meetings',
|
|
186
193
|
settingsGroupUngrouped: 'Ungrouped',
|
|
187
|
-
|
|
194
|
+
settingsGroupCategories: 'The model the next task will use',
|
|
195
|
+
settingsGroupAssignments: 'The model running tasks actually use',
|
|
188
196
|
settingsBadgeApply: 'apply',
|
|
189
197
|
settingsBadgeRestart: 'restart',
|
|
190
|
-
settingsBadgeRefuse: '
|
|
191
|
-
settingsUnknownBadge: '
|
|
198
|
+
settingsBadgeRefuse: 'change in file',
|
|
199
|
+
settingsUnknownBadge: 'not recognized',
|
|
192
200
|
settingsUnset: 'unset · default {value}',
|
|
193
|
-
settingsAuditHeading: 'Audit (newest)',
|
|
194
201
|
settingsKeyHint: '↑/↓ rows · Enter edit · / filter · Esc back',
|
|
195
202
|
keyFilter: '/ filter',
|
|
196
203
|
settingFilterTitle: 'Filter settings',
|
|
@@ -200,44 +207,52 @@ export const en = {
|
|
|
200
207
|
settingDanger: 'Danger: {reason} (press Enter once more to confirm)',
|
|
201
208
|
settingRejected: '✗ refused: {line}',
|
|
202
209
|
settingWritten: '✓ wrote {key} = {value} · {timing}',
|
|
203
|
-
settingRefused: '✗
|
|
210
|
+
settingRefused: '✗ this value is changed in the project config file: {line}',
|
|
204
211
|
settingInvalid: '✗ invalid value: {line}',
|
|
205
212
|
settingConflict: '! the contract changed under the editor (fingerprint mismatch) — nothing written; reloaded',
|
|
206
213
|
settingWriteError: '✗ write failed (file unchanged): {line}',
|
|
207
|
-
settingsRefusedRoute: '
|
|
208
|
-
|
|
209
|
-
|
|
214
|
+
settingsRefusedRoute: 'change this value in the project config file .pi/team/config.sh; the panel cannot change it',
|
|
215
|
+
settingsCategoryHint: 'category {category}: team config set-task-model {category} <model> — new tasks only; a task already dispatched keeps the model it was given (this row never composes the map)',
|
|
216
|
+
settingsCategoryRow: 'category {category}',
|
|
217
|
+
settingsCategoryModel: 'model {model}',
|
|
218
|
+
settingsCategoryBadge: 'new tasks',
|
|
219
|
+
settingsCategoryPickerTitle: 'Pick the model for category {category}',
|
|
220
|
+
settingsCategoryPickerHint: '↑/↓ choose · Enter writes that value now · only free text opens the editor · Esc back (new tasks only; a task already dispatched keeps the model it was given and no process is restarted)',
|
|
221
|
+
settingsCategoryMapHint: 'the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the pair list is never composed in the console',
|
|
222
|
+
settingsCategoryMapEmpty: 'the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the map is empty today; add a category through the CLI first',
|
|
223
|
+
settingsAssignmentHint: 'once a task is dispatched it keeps the model it was given; this setting does not change it',
|
|
224
|
+
settingsAssignmentNote: 'task {task} · category {category} · session {sid} · origin {selected}/{launch}',
|
|
225
|
+
settingsAssignmentNone: 'this seat has not been given a task yet',
|
|
226
|
+
settingsAssignmentUnreadable: 'this seat was given a task, but its record could not be read, so the panel does not show its model',
|
|
227
|
+
settingsReadOnlyBadge: 'change in file',
|
|
228
|
+
settingsPmLaunchLabel: 'last PM start',
|
|
229
|
+
settingsPmLaunchNote: 'window {window} · {mode} · {time}',
|
|
230
|
+
settingsPmLaunchHint: 'the model the PM used the last time it started; it cannot be changed here',
|
|
231
|
+
settingsDiagnosisHeading: 'these settings need an upgrade',
|
|
210
232
|
settingsCliHint: 'CLI: team config set {key} <value>',
|
|
211
|
-
settingsRefusedHint: '
|
|
212
|
-
settingsUnknownHint: '
|
|
233
|
+
settingsRefusedHint: 'change this value in the project config file .pi/team/config.sh; the panel cannot change it',
|
|
234
|
+
settingsUnknownHint: '{key}: the file carries this setting but the tool does not know it; the panel cannot change it',
|
|
213
235
|
settingsChoiceTitle: 'Choose a value for {label} · {key}',
|
|
214
236
|
settingsChoiceHint: '↑/↓ choose · Enter writes that value now (danger needs one more) · only free text opens the editor · Esc back',
|
|
215
237
|
settingsChoiceCurrent: 'current',
|
|
216
238
|
settingsChoiceDefault: 'default',
|
|
217
|
-
settingsChoiceKeepUnset: 'keep unset (cancel
|
|
239
|
+
settingsChoiceKeepUnset: 'keep unset (cancel, nothing written)',
|
|
218
240
|
settingsChoiceClear: 'clear (write the empty value)',
|
|
219
241
|
settingsChoiceFree: '… (free text)',
|
|
220
242
|
settingsChoiceInterval: 'accepted interval {min}–{max} (empty = unbounded)',
|
|
221
243
|
settingsChoiceNoChoice: 'the kind {kind} has no choice set; the command still validates the write (Enter opens free text)',
|
|
222
|
-
|
|
244
|
+
settingCategoryConfirm: 'Confirm category {category}: {old} → {next} · new tasks only; a task already dispatched keeps the model it was given (Enter again to write)',
|
|
245
|
+
settingCategoryWritten: '✓ wrote category {category} = {value} · new tasks only; tasks already dispatched keep the model they were given; no process was restarted',
|
|
246
|
+
settingPmWritten: '✓ wrote the PM model = {value} · changing the model needs team up --fresh-pm, which starts a new conversation; no process was restarted',
|
|
223
247
|
settingsBoolOn: 'on (1)',
|
|
224
248
|
settingsBoolOff: 'off (0)',
|
|
225
249
|
settingsPathExists: 'exists',
|
|
226
250
|
settingsPathMissing: 'missing',
|
|
227
251
|
settingsPathNotExec: 'not executable',
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
settingSeatConfirm: 'Confirm seat {seat}: {old} → {next} · takes effect on the next dispatch/resume (a running window keeps its model) (Enter again to write)',
|
|
233
|
-
settingSeatWritten: '✓ wrote seat {seat} = {value} · effective on the next dispatch/resume',
|
|
234
|
-
settingSeatRemoved: '✓ removed the override of seat {seat} · back to the default {value}',
|
|
235
|
-
keySeatPick: 'Enter select',
|
|
236
|
-
seatSourceConfig: 'config',
|
|
237
|
-
seatSourceExplicit: 'explicit',
|
|
238
|
-
seatSourceRecord: 'stale record',
|
|
239
|
-
seatOverride: 'override',
|
|
240
|
-
seatFallback: 'fallback',
|
|
252
|
+
keyCategoryPick: 'Enter edit',
|
|
253
|
+
seatSourceExplicit: 'chosen at dispatch',
|
|
254
|
+
seatSourcePolicy: 'set by category',
|
|
255
|
+
seatSourceAssignment: 'kept from the record',
|
|
241
256
|
|
|
242
257
|
// The human labels of the contract keys (M49): one per key of `lib/cmd-config.sh`'s schema, and
|
|
243
258
|
// the row's main text — the bare TEAM_* stays where it aligns with the CLI (the editor's title,
|
|
@@ -256,6 +271,7 @@ export const en = {
|
|
|
256
271
|
label_TEAM_SPEC_DIR: 'Spec dir',
|
|
257
272
|
label_TEAM_ROOT: 'Project root',
|
|
258
273
|
label_TEAM_MAIN_ROOT: 'Main checkout root',
|
|
274
|
+
label_TEAM_TMP_ROOT: 'Temp root',
|
|
259
275
|
label_TEAM_CONFIG_FILE: 'Contract file',
|
|
260
276
|
// -- branch and forge (read-only)
|
|
261
277
|
label_TEAM_BRANCH_MODE: 'Branch naming mode',
|
|
@@ -297,11 +313,12 @@ export const en = {
|
|
|
297
313
|
label_TEAM_AGENT_BIN: 'Seat binary',
|
|
298
314
|
label_TEAM_OPENSPEC_BIN: 'openspec binary',
|
|
299
315
|
label_TEAM_JS_BIN: 'JS runtime',
|
|
300
|
-
// --
|
|
301
|
-
|
|
302
|
-
label_TEAM_AGENT_MODELS: 'Per-seat models',
|
|
316
|
+
// -- task categories and the PM model (apply/restart)
|
|
317
|
+
label_TEAM_TASK_MODELS: 'Task category models',
|
|
303
318
|
label_TEAM_PM_MODEL: 'PM model',
|
|
319
|
+
label_TEAM_CONFIG_VERSION: 'Config shape version',
|
|
304
320
|
// -- workflow and gates
|
|
321
|
+
label_TEAM_UPDATE_CHECK: 'Startup version notice',
|
|
305
322
|
label_TEAM_GATES: 'Gate commands',
|
|
306
323
|
label_TEAM_INSTALL_CMD: 'Install command',
|
|
307
324
|
label_TEAM_TASK_BRANCH_RESET: 'Reset task branch',
|
|
@@ -329,9 +346,13 @@ export const en = {
|
|
|
329
346
|
label_TEAM_NOTIFY_DEDUP_SEC: 'Notify dedup window',
|
|
330
347
|
label_TEAM_INBOX_MAX_CHARS: 'Inbox summary chars',
|
|
331
348
|
label_TEAM_NOTIFY_LOG: 'Notify debug log',
|
|
349
|
+
label_TEAM_NOTIFY_DETAIL_MAX: 'Notify detail bound',
|
|
332
350
|
label_TEAM_DEFER_TTL: 'Queued delivery TTL',
|
|
333
351
|
label_TEAM_OUTBOX_MAX: 'Outbox cap',
|
|
334
352
|
label_TEAM_PANEL_DETAIL_CAP: 'Detail read cap',
|
|
353
|
+
label_TEAM_ORPHAN_WARN_MB: 'Orphan memory hint',
|
|
354
|
+
label_TEAM_ORPHAN_SCAN: 'Scan orphan seats',
|
|
355
|
+
label_TEAM_ORPHAN_PROC_ROOT: 'Census proc root',
|
|
335
356
|
// -- pulse and panel (needs a restart)
|
|
336
357
|
label_TEAM_PULSE_INTERVAL: 'Patrol interval',
|
|
337
358
|
label_TEAM_MONITOR_REFRESH: 'Panel refresh period',
|
|
@@ -375,12 +396,35 @@ export const en = {
|
|
|
375
396
|
label_TEAM_MEETING_KNOCK: 'Allow knocking',
|
|
376
397
|
label_TEAM_MEETING_ALLOW_USER_ID: 'Users who may knock',
|
|
377
398
|
|
|
399
|
+
// Key replies (pulse-key-replies)
|
|
400
|
+
replyHeading: 'key replies',
|
|
401
|
+
replyHeadingCount: 'key replies ({n})',
|
|
402
|
+
replyLatest: 'latest key reply',
|
|
403
|
+
replyEmpty: '(no key replies yet)',
|
|
404
|
+
replyUnavailable: '(unavailable)',
|
|
405
|
+
replyLatestUnavailable: 'latest reply unavailable: {reason}',
|
|
406
|
+
replyDeclared: 'from {from} · {at}',
|
|
407
|
+
replyDeclaredShort: 'from {from}',
|
|
408
|
+
replySlotUnavailable: '#{no} unavailable',
|
|
409
|
+
replyLoading: '… loading',
|
|
410
|
+
replyBodyMissing: 'this reply is unavailable',
|
|
411
|
+
replyBodyHint: 'read-only · shown as published',
|
|
412
|
+
replyOlder: 'Older',
|
|
413
|
+
replyNewer: 'Newer',
|
|
414
|
+
replyBack: 'Back',
|
|
415
|
+
replyScrollHint: '↑/↓ PgUp/PgDn Home/End scroll',
|
|
416
|
+
replyTotalSlots: '{n} numbered slots',
|
|
417
|
+
replyTailWarning: 'the index tail is incomplete (the last append did not finish)',
|
|
418
|
+
replyPageNote: '"who is this reply written for?" — replies the PM wrote for the user',
|
|
419
|
+
|
|
378
420
|
// Global keys (footer)
|
|
379
421
|
keyCompose: 'm compose',
|
|
380
422
|
keyFlush: 'f flush',
|
|
381
423
|
keyStandby: 's standby',
|
|
382
424
|
keySettings: ', settings',
|
|
383
|
-
keyPages: 'Tab/1-
|
|
425
|
+
keyPages: 'Tab/1-5 pages',
|
|
426
|
+
keyReplies: '←/→ older/newer',
|
|
427
|
+
keyReplyReset: 'r newest',
|
|
384
428
|
keyScroll: '↑/↓ scroll',
|
|
385
429
|
keyLanes: '←/→ lanes',
|
|
386
430
|
keyCards: '↑/↓ cards',
|
|
@@ -402,6 +446,7 @@ export const en = {
|
|
|
402
446
|
receiptQueued: '… queued (the PM is typing) · queued',
|
|
403
447
|
receiptHeld: '! held (copy under state/outbox/held/) · held',
|
|
404
448
|
receiptError: '✗ delivery unconfirmed · {detail}',
|
|
449
|
+
draftNotCleared: '✗ settled, but the draft file could not be emptied: {file} (the text stays in the input line)',
|
|
405
450
|
flushOk: '✓ flush · {detail}',
|
|
406
451
|
flushFail: '✗ flush failed · {detail}',
|
|
407
452
|
standbyOkOn: '✓ standby on (reason: {reason})',
|