@ethlete/agent-rules 0.1.0-next.6 → 0.1.0-next.61
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/AGENTS.md +28 -0
- package/CHANGELOG.md +847 -0
- package/CLAUDE.md +1 -0
- package/README.md +244 -36
- package/THIRD-PARTY-LICENSES.md +35 -0
- package/content/defaults.json +1 -1
- package/content/hooks/away-mode.py +413 -0
- package/content/hooks/background-commands.py +177 -0
- package/content/hooks/builder-idle-check.py +562 -0
- package/content/hooks/context-warning.py +666 -134
- package/content/hooks/git-safety.py +213 -0
- package/content/hooks/human-wait-check.py +167 -0
- package/content/hooks/subagent-model-policy.py +261 -0
- package/content/mods/.claude-plugin/marketplace.json +26 -0
- package/content/mods/plugins/codex-runs/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/codex-runs/hooks/agent-runs.ts +310 -0
- package/content/mods/plugins/codex-runs/hooks/hooks.json +1 -0
- package/content/mods/plugins/codex-runs/hooks/progress.ts +130 -0
- package/content/mods/plugins/codex-runs/hooks/register.tsx +283 -0
- package/content/mods/plugins/codex-runs/tests/pane.test.ts +21 -0
- package/content/mods/plugins/codex-runs/tsconfig.json +4 -0
- package/content/mods/plugins/codex-runs/types/index.d.ts +37 -0
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
- package/content/mods/plugins/e2e-progress/hooks/progress.ts +205 -0
- package/content/mods/plugins/e2e-progress/hooks/register.tsx +498 -0
- package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
- package/content/mods/plugins/e2e-progress/types/index.d.ts +27 -0
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/status-line/hooks/line.ts +74 -0
- package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
- package/content/mods/plugins/status-line/types/index.d.ts +5 -0
- package/content/mods/plugins/usage-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/usage-line/hooks/codex.ts +52 -0
- package/content/mods/plugins/usage-line/hooks/format.ts +24 -0
- package/content/mods/plugins/usage-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/usage-line/hooks/rate-limits.ts +23 -0
- package/content/mods/plugins/usage-line/hooks/register.tsx +83 -0
- package/content/mods/plugins/usage-line/tsconfig.json +4 -0
- package/content/mods/plugins/usage-line/types/index.d.ts +5 -0
- package/content/output-styles/ste-clarity.md +131 -0
- package/content/rules/agent-sessions-wake-up.md +11 -0
- package/content/rules/app-styling.md +66 -0
- package/content/rules/comments.md +4 -1
- package/content/rules/lint-and-format.md +7 -5
- package/content/rules/nx-layout.md +53 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +19 -10
- package/content/rules/subagent-models.md +42 -0
- package/content/rules/waiting-on-the-human.md +17 -0
- package/content/skills/agent-sessions/SKILL.md +101 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +1462 -0
- package/content/skills/angular-patterns/SKILL.md +31 -7
- package/content/skills/api-source/SKILL.md +156 -0
- package/content/skills/app-testing/SKILL.md +141 -0
- package/content/skills/codex-subagent/SKILL.md +102 -0
- package/content/skills/codex-subagent/codex-agent.mjs +260 -0
- package/content/skills/codex-subagent/codex-limit.mjs +106 -0
- package/content/skills/design-exploration/SKILL.md +121 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/reference-shots.md +15 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +71 -0
- package/content/skills/e2e-triage/SKILL.md +80 -0
- package/content/skills/figma-export/SKILL.md +16 -18
- package/content/skills/git-commit/SKILL.md +21 -7
- package/content/skills/git-flow/SKILL.md +9 -5
- package/content/skills/grill-with-docs/SKILL.md +13 -0
- package/content/skills/grilling/SKILL.md +52 -0
- package/content/skills/handoff/SKILL.md +30 -72
- package/content/skills/handoff/save.md +189 -0
- package/content/skills/query/SKILL.md +165 -74
- package/content/skills/report/SKILL.md +26 -0
- package/content/skills/rxjs-signals/SKILL.md +33 -4
- package/content/skills/sdk-docs/SKILL.md +50 -14
- package/content/skills/sdk-local-build/SKILL.md +26 -8
- package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
- package/content/skills/sdk-source/SKILL.md +37 -34
- package/content/skills/sdk-update/SKILL.md +103 -0
- package/content/skills/story-styling/SKILL.md +12 -10
- package/content/skills/styleguide/SKILL.md +13 -8
- package/content/skills/styleguide/assets.md +54 -0
- package/content/skills/styleguide/changesets.md +17 -0
- package/content/skills/styleguide/file-structure.md +73 -0
- package/content/skills/styleguide/lint-rule-lookup.md +52 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +76 -49
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/content/skills/verify-in-storybook/SKILL.md +1 -1
- package/content/skills/verify-on-apple-devices/SKILL.md +100 -0
- package/content/skills/verify-on-apple-devices/apple-remote.sh +421 -0
- package/content/skills/verify-on-apple-devices/sim-edge-back.m +159 -0
- package/migrations/list-state-query-form.md +20 -0
- package/migrations/nx-layout.md +29 -0
- package/migrations/sdk-components-over-hand-built-ui.md +27 -0
- package/migrations/search-query-field.md +52 -0
- package/migrations/studio-claude-plugin.md +27 -0
- package/migrations.json +47 -0
- package/package.json +8 -3
- package/src/index.js +84 -28
- package/src/index.js.map +1 -1
- package/src/lib/cli-args.d.ts +9 -0
- package/src/lib/cli-args.js +48 -0
- package/src/lib/cli-args.js.map +1 -0
- package/src/lib/commitlint.d.ts +10 -0
- package/src/lib/commitlint.js +51 -0
- package/src/lib/commitlint.js.map +1 -0
- package/src/lib/config.d.ts +53 -22
- package/src/lib/config.js +128 -12
- package/src/lib/config.js.map +1 -1
- package/src/lib/filter.d.ts +3 -0
- package/src/lib/filter.js +7 -5
- package/src/lib/filter.js.map +1 -1
- package/src/lib/frontmatter.d.ts +2 -0
- package/src/lib/frontmatter.js +33 -5
- package/src/lib/frontmatter.js.map +1 -1
- package/src/lib/git-flow/config.js +1 -1
- package/src/lib/git-flow/config.js.map +1 -1
- package/src/lib/git-flow/index.d.ts +1 -0
- package/src/lib/git-flow/index.js +20 -6
- package/src/lib/git-flow/index.js.map +1 -1
- package/src/lib/git-flow/parse.js +38 -12
- package/src/lib/git-flow/parse.js.map +1 -1
- package/src/lib/git-flow/rename.d.ts +24 -0
- package/src/lib/git-flow/rename.js +70 -0
- package/src/lib/git-flow/rename.js.map +1 -0
- package/src/lib/git-flow/start.d.ts +27 -0
- package/src/lib/git-flow/start.js +34 -1
- package/src/lib/git-flow/start.js.map +1 -1
- package/src/lib/git-flow-command.js +10 -2
- package/src/lib/git-flow-command.js.map +1 -1
- package/src/lib/git-flow-repair.d.ts +1 -1
- package/src/lib/git-flow-repair.js +30 -15
- package/src/lib/git-flow-repair.js.map +1 -1
- package/src/lib/git-flow-start.d.ts +1 -1
- package/src/lib/git-flow-start.js +25 -32
- package/src/lib/git-flow-start.js.map +1 -1
- package/src/lib/git.d.ts +37 -0
- package/src/lib/git.js +85 -3
- package/src/lib/git.js.map +1 -1
- package/src/lib/gitlab.js +24 -6
- package/src/lib/gitlab.js.map +1 -1
- package/src/lib/index.d.ts +2 -0
- package/src/lib/index.js +26 -11
- package/src/lib/index.js.map +1 -1
- package/src/lib/migrate.js +8 -2
- package/src/lib/migrate.js.map +1 -1
- package/src/lib/output-style-command.d.ts +3 -0
- package/src/lib/output-style-command.js +69 -0
- package/src/lib/output-style-command.js.map +1 -0
- package/src/lib/output-style.d.ts +38 -0
- package/src/lib/output-style.js +134 -0
- package/src/lib/output-style.js.map +1 -0
- package/src/lib/owned-paths.js +8 -2
- package/src/lib/owned-paths.js.map +1 -1
- package/src/lib/package-runner.d.ts +4 -0
- package/src/lib/package-runner.js +86 -0
- package/src/lib/package-runner.js.map +1 -0
- package/src/lib/plain-text.d.ts +9 -0
- package/src/lib/plain-text.js +22 -0
- package/src/lib/plain-text.js.map +1 -0
- package/src/lib/plan.d.ts +6 -6
- package/src/lib/plan.js +153 -40
- package/src/lib/plan.js.map +1 -1
- package/src/lib/prettier.d.ts +21 -0
- package/src/lib/prettier.js +51 -0
- package/src/lib/prettier.js.map +1 -0
- package/src/lib/prompt.js +10 -2
- package/src/lib/prompt.js.map +1 -1
- package/src/lib/render.d.ts +14 -1
- package/src/lib/render.js +23 -5
- package/src/lib/render.js.map +1 -1
- package/src/lib/report-command.d.ts +34 -0
- package/src/lib/report-command.js +322 -0
- package/src/lib/report-command.js.map +1 -0
- package/src/lib/sessions-command.d.ts +4 -0
- package/src/lib/sessions-command.js +16 -0
- package/src/lib/sessions-command.js.map +1 -0
- package/src/lib/sync.d.ts +1 -2
- package/src/lib/sync.js +37 -17
- package/src/lib/sync.js.map +1 -1
- package/src/lib/targets/agents-skills.js +1 -1
- package/src/lib/targets/agents-skills.js.map +1 -1
- package/src/lib/targets/claude-hooks.d.ts +5 -0
- package/src/lib/targets/claude-hooks.js +27 -4
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/claude-mods.d.ts +20 -0
- package/src/lib/targets/claude-mods.js +47 -0
- package/src/lib/targets/claude-mods.js.map +1 -0
- package/src/lib/targets/claude.js +2 -3
- package/src/lib/targets/claude.js.map +1 -1
- package/src/lib/targets/codex-hooks.js +4 -2
- package/src/lib/targets/codex-hooks.js.map +1 -1
- package/src/lib/targets/codex.js +4 -4
- package/src/lib/targets/codex.js.map +1 -1
- package/src/lib/targets/copilot.js +4 -4
- package/src/lib/targets/copilot.js.map +1 -1
- package/src/lib/targets/cursor.js +3 -3
- package/src/lib/targets/cursor.js.map +1 -1
- package/src/lib/targets/git-hooks.d.ts +1 -1
- package/src/lib/targets/git-hooks.js +6 -5
- package/src/lib/targets/git-hooks.js.map +1 -1
- package/src/lib/targets/hooks-shared.d.ts +34 -5
- package/src/lib/targets/hooks-shared.js +132 -36
- package/src/lib/targets/hooks-shared.js.map +1 -1
- package/src/lib/targets/mcp.d.ts +25 -0
- package/src/lib/targets/mcp.js +114 -0
- package/src/lib/targets/mcp.js.map +1 -0
- package/src/lib/targets/shared.d.ts +1 -9
- package/src/lib/targets/shared.js +4 -8
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/timetrack.d.ts +16 -0
- package/src/lib/timetrack.js +149 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
- package/src/lib/jira.d.ts +0 -28
- package/src/lib/jira.js +0 -83
- package/src/lib/jira.js.map +0 -1
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { atom, read, update } from 'claude-code';
|
|
2
|
+
import type { EngineInterface, Register, Timer } from 'claude-code';
|
|
3
|
+
|
|
4
|
+
import type { Progress } from '../types';
|
|
5
|
+
import {
|
|
6
|
+
FAIL_LINE,
|
|
7
|
+
HIDE_AFTER_MS,
|
|
8
|
+
REGISTRY,
|
|
9
|
+
doneOf,
|
|
10
|
+
parse,
|
|
11
|
+
parseUnit,
|
|
12
|
+
SETUP_MAX_MS,
|
|
13
|
+
registryRuns,
|
|
14
|
+
setupRuns,
|
|
15
|
+
summary,
|
|
16
|
+
worktreeRoots,
|
|
17
|
+
} from './progress';
|
|
18
|
+
import type { RegistryRun } from './progress';
|
|
19
|
+
|
|
20
|
+
const PANE = 'e2e-progress';
|
|
21
|
+
const HANDOFFS = ['.claude/handoffs', '.agents/handoffs'];
|
|
22
|
+
const WORKTREES = '.claude/worktrees';
|
|
23
|
+
const TICK_MS = 5000;
|
|
24
|
+
const STALE_MS = 15_000;
|
|
25
|
+
const MIN_ETA_TESTS = 5;
|
|
26
|
+
const MIN_ETA_MS = 30_000;
|
|
27
|
+
const MAX_CANDIDATES = 12;
|
|
28
|
+
const STALLED_MS = 15 * 60_000;
|
|
29
|
+
const runs = atom({ plugin: 'e2e-progress', key: 'runs' } as const, []);
|
|
30
|
+
const pinnedPath = atom({ plugin: 'e2e-progress', key: 'path' } as const, null);
|
|
31
|
+
|
|
32
|
+
const TEST_DECLARATION = /\btest(\.\w+)?\(/;
|
|
33
|
+
const indentOf = (line: string) => line.length - line.trimStart().length;
|
|
34
|
+
|
|
35
|
+
const titleOf = (rest: string) =>
|
|
36
|
+
(
|
|
37
|
+
rest
|
|
38
|
+
.replace(/\s+@\S+.*$/, '')
|
|
39
|
+
.replace(/\s+\([\d.]+m?s\)$/, '')
|
|
40
|
+
.split(' › ')
|
|
41
|
+
.pop() ?? ''
|
|
42
|
+
).trim();
|
|
43
|
+
|
|
44
|
+
const declaresAt = (source: string[], index: number, title: string) => {
|
|
45
|
+
if (!TEST_DECLARATION.test(source[index] ?? '')) return false;
|
|
46
|
+
const head = source.slice(index, index + 3).join('\n');
|
|
47
|
+
return head.includes(title.slice(0, 25)) || head.includes('`');
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const callsTestFail = (source: string[], index: number) => {
|
|
51
|
+
const declaration = source[index] ?? '';
|
|
52
|
+
if (/\btest\.fail\(/.test(declaration)) return true;
|
|
53
|
+
const indent = indentOf(declaration);
|
|
54
|
+
for (const line of source.slice(index + 1)) {
|
|
55
|
+
if (line.trim() !== '' && indentOf(line) <= indent && !/=>\s*\{\s*$/.test(line)) return false;
|
|
56
|
+
if (/\btest\.fail\(/.test(line)) return true;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const sourceCache = new Map<string, string[] | null>();
|
|
62
|
+
|
|
63
|
+
async function sourceOf($: EngineInterface, path: string) {
|
|
64
|
+
if (!sourceCache.has(path))
|
|
65
|
+
sourceCache.set(
|
|
66
|
+
path,
|
|
67
|
+
await $.fs.read(path).then(
|
|
68
|
+
(t) => t.split('\n'),
|
|
69
|
+
() => null,
|
|
70
|
+
),
|
|
71
|
+
);
|
|
72
|
+
return sourceCache.get(path) ?? null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function rootsFor($: EngineInterface, logPath: string) {
|
|
76
|
+
const at = Math.max(...HANDOFFS.map((dir) => logPath.indexOf(dir)));
|
|
77
|
+
const own = at > 0 ? logPath.slice(0, at) : '';
|
|
78
|
+
const worktrees = await $.fs.list(WORKTREES).catch(() => []);
|
|
79
|
+
const all = [own, '', ...worktrees.filter((d) => d.kind === 'dir').map((d) => `${WORKTREES}/${d.name}/`)];
|
|
80
|
+
return [...new Set(all)];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function expectedFailures($: EngineInterface, logPath: string, text: string) {
|
|
84
|
+
const expected = new Set<string>();
|
|
85
|
+
const failLines = text.split('\n').filter((line) => FAIL_LINE.test(line));
|
|
86
|
+
if (failLines.length === 0) return expected;
|
|
87
|
+
const roots = await rootsFor($, logPath);
|
|
88
|
+
for (const line of failLines) {
|
|
89
|
+
const [, file = '', lineNo = '0', rest = ''] = line.match(FAIL_LINE) ?? [];
|
|
90
|
+
const index = Number(lineNo) - 1;
|
|
91
|
+
const title = titleOf(rest);
|
|
92
|
+
for (const root of roots) {
|
|
93
|
+
const source = await sourceOf($, `${root}${file}`);
|
|
94
|
+
if (source === null || !declaresAt(source, index, title)) continue;
|
|
95
|
+
if (callsTestFail(source, index)) expected.add(line);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return expected;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const FAILURES_FILE_LINE = /^\[failure-reporter\] Writing failures to (.+)$/m;
|
|
103
|
+
|
|
104
|
+
type FailureRecord = { test: string; location: string; error?: string; detail?: string | null };
|
|
105
|
+
|
|
106
|
+
const recordsOf = (text: string): FailureRecord[] =>
|
|
107
|
+
text.split('\n').flatMap((line) => {
|
|
108
|
+
if (line.trim() === '') return [];
|
|
109
|
+
try {
|
|
110
|
+
const record = JSON.parse(line);
|
|
111
|
+
return typeof record?.test === 'string' && typeof record?.location === 'string' ? [record] : [];
|
|
112
|
+
} catch {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const firstErrorLine = (error: string | undefined) =>
|
|
118
|
+
(error ?? '')
|
|
119
|
+
.split('\n')
|
|
120
|
+
.find((line) => line.trim() !== '')
|
|
121
|
+
?.replace(/^Error:\s*/, '')
|
|
122
|
+
.trim() ?? '';
|
|
123
|
+
|
|
124
|
+
const failuresOf = (records: FailureRecord[]) => {
|
|
125
|
+
const latest = new Map<string, FailureRecord>();
|
|
126
|
+
for (const record of records) latest.set(`${record.location} › ${record.test}`, record);
|
|
127
|
+
return [...latest].map(([key, record]) => {
|
|
128
|
+
const error = firstErrorLine(record.error);
|
|
129
|
+
const line = error ? `${key} — ${error}` : key;
|
|
130
|
+
return record.detail ? `${line} (${record.detail})` : line;
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
async function withRecords($: EngineInterface, p: Progress, text: string): Promise<Progress> {
|
|
135
|
+
const file = text.match(FAILURES_FILE_LINE)?.[1]?.trim();
|
|
136
|
+
if (!file) return p;
|
|
137
|
+
const records = await $.fs.read(file).then(recordsOf, () => undefined);
|
|
138
|
+
if (records === undefined) return p;
|
|
139
|
+
const failures = failuresOf(records);
|
|
140
|
+
return { ...p, failures, failed: summary(text, 'failed') ?? failures.length };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const remainingMs = (p: Progress, nowMs: number) => {
|
|
144
|
+
const doneSince = doneOf(p) - p.firstDone;
|
|
145
|
+
const elapsed = nowMs - p.firstSeenMs;
|
|
146
|
+
if (p.isDone || p.total <= 0 || doneSince < MIN_ETA_TESTS || elapsed < MIN_ETA_MS) return undefined;
|
|
147
|
+
return ((p.total - doneOf(p)) / doneSince) * elapsed;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const formatEta = (ms: number | undefined) => {
|
|
151
|
+
if (ms === undefined) return '';
|
|
152
|
+
const minutes = Math.round(ms / 60_000);
|
|
153
|
+
return minutes < 1 ? ' ~<1m left' : ` ~${minutes}m left`;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
type LogFile = { path: string; mtimeMs: number };
|
|
157
|
+
|
|
158
|
+
async function logsUnder($: EngineInterface, dir: string, depth: number): Promise<LogFile[]> {
|
|
159
|
+
const entries = await $.fs.list(dir).catch(() => []);
|
|
160
|
+
const files = entries
|
|
161
|
+
.filter((f) => f.kind === 'file' && f.name.endsWith('.log'))
|
|
162
|
+
.map((f) => ({ path: `${dir}/${f.name}`, mtimeMs: f.mtimeMs }));
|
|
163
|
+
if (depth === 0) return files;
|
|
164
|
+
const nested = await Promise.all(
|
|
165
|
+
entries.filter((d) => d.kind === 'dir').map((d) => logsUnder($, `${dir}/${d.name}`, depth - 1)),
|
|
166
|
+
);
|
|
167
|
+
return [...files, ...nested.flat()];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async function baseDirs($: EngineInterface) {
|
|
171
|
+
const bases = new Set([await $.session.root()]);
|
|
172
|
+
let dir = await $.session.cwd();
|
|
173
|
+
for (let up = 0; up <= 3 && dir !== ''; up++) {
|
|
174
|
+
bases.add(dir);
|
|
175
|
+
dir = dir.slice(0, dir.lastIndexOf('/'));
|
|
176
|
+
}
|
|
177
|
+
return [...bases];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let cachedRoots: { at: number; roots: string[] } | undefined;
|
|
181
|
+
const ROOTS_TTL_MS = 30_000;
|
|
182
|
+
|
|
183
|
+
async function gitWorktrees($: EngineInterface, nowMs: number) {
|
|
184
|
+
if (cachedRoots && nowMs - cachedRoots.at < ROOTS_TTL_MS) return cachedRoots.roots;
|
|
185
|
+
const result = await $.process
|
|
186
|
+
.run(['git', 'worktree', 'list', '--porcelain'], { cwd: await $.session.root() })
|
|
187
|
+
.catch(() => undefined);
|
|
188
|
+
const roots = result?.exitCode === 0 ? worktreeRoots(result.stdout) : [];
|
|
189
|
+
cachedRoots = { at: nowMs, roots };
|
|
190
|
+
return roots;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async function handoffDirs($: EngineInterface) {
|
|
194
|
+
const gitRoots = await gitWorktrees($, await $.clock.now());
|
|
195
|
+
const perBase = await Promise.all(
|
|
196
|
+
(await baseDirs($)).map(async (base) => {
|
|
197
|
+
const worktrees = await $.fs.list(`${base}/${WORKTREES}`).catch(() => []);
|
|
198
|
+
return [base, ...worktrees.filter((d) => d.kind === 'dir').map((d) => `${base}/${WORKTREES}/${d.name}`)];
|
|
199
|
+
}),
|
|
200
|
+
);
|
|
201
|
+
const roots = new Set([...perBase.flat(), ...gitRoots]);
|
|
202
|
+
return [...roots].flatMap((root) => HANDOFFS.map((dir) => `${root}/${dir}`));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
async function playwrightCwds($: EngineInterface) {
|
|
206
|
+
const result = await $.process.run(['ps', '-eo', 'pid=,args=']).catch(() => undefined);
|
|
207
|
+
if (result?.exitCode !== 0) return [];
|
|
208
|
+
const pids = result.stdout
|
|
209
|
+
.split('\n')
|
|
210
|
+
.map((line) => line.trim().match(/^(\d+)\s+(.*)$/))
|
|
211
|
+
.filter((m) => m !== null && /\bplaywright\b.*\btest\b/.test(m[2] ?? ''))
|
|
212
|
+
.map((m) => m?.[1]);
|
|
213
|
+
const cwds = await Promise.all(
|
|
214
|
+
pids.map((pid) =>
|
|
215
|
+
$.fs.stat(`/proc/${pid}/cwd`, { resolve: true }).then(
|
|
216
|
+
(s) => s.realPath,
|
|
217
|
+
() => undefined,
|
|
218
|
+
),
|
|
219
|
+
),
|
|
220
|
+
);
|
|
221
|
+
return cwds.filter((cwd) => cwd !== undefined);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const nameOf = (path: string) => (path.split('/').pop() ?? path).replace(/\.log$/, '');
|
|
225
|
+
|
|
226
|
+
const MAX_LABEL = 40;
|
|
227
|
+
const shortLabel = (label: string) => {
|
|
228
|
+
const words = label
|
|
229
|
+
.split(/\s+/)
|
|
230
|
+
.filter((w) => !/^(npx|yarn|node|sh|-c|--)$/.test(w) && !w.includes('='))
|
|
231
|
+
.map((w) => (w.includes('/') ? (w.split('/').pop() ?? w) : w))
|
|
232
|
+
.join(' ');
|
|
233
|
+
return words.length > MAX_LABEL ? `${words.slice(0, MAX_LABEL - 1)}…` : words;
|
|
234
|
+
};
|
|
235
|
+
const titleOfRun = (p: Progress) =>
|
|
236
|
+
`${p.machine ? `${p.machine} ` : ''}${p.label ? shortLabel(p.label) : nameOf(p.path)}`;
|
|
237
|
+
|
|
238
|
+
async function progressOfRegistryRun(
|
|
239
|
+
$: EngineInterface,
|
|
240
|
+
{ entry, mtimeMs }: RegistryRun,
|
|
241
|
+
previous: Progress | undefined,
|
|
242
|
+
nowMs: number,
|
|
243
|
+
): Promise<Progress> {
|
|
244
|
+
const isEnded = entry.endedAt !== undefined;
|
|
245
|
+
const tag = { machine: entry.machine, label: entry.label };
|
|
246
|
+
if (previous?.mtimeMs === mtimeMs && previous.isDone === isEnded) return { ...previous, ...tag };
|
|
247
|
+
const text = mtimeMs === 0 ? '' : await $.fs.read(entry.log).catch(() => '');
|
|
248
|
+
if (isRunLog(text)) {
|
|
249
|
+
sourceCache.clear();
|
|
250
|
+
const parsed = parse(entry.log, text, await expectedFailures($, entry.log, text), mtimeMs, nowMs, previous ?? null);
|
|
251
|
+
return { ...(await withRecords($, parsed, text)), isDone: parsed.isDone || isEnded, ...tag };
|
|
252
|
+
}
|
|
253
|
+
const unit = parseUnit(entry.log, text, mtimeMs, nowMs, isEnded);
|
|
254
|
+
return {
|
|
255
|
+
...unit,
|
|
256
|
+
firstSeenMs: previous?.firstSeenMs ?? nowMs,
|
|
257
|
+
mtimeMs: isEnded ? (entry.endedAt ?? mtimeMs) : mtimeMs,
|
|
258
|
+
...tag,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const isRunLog = (text: string) => /^Running \d+ tests?/m.test(text);
|
|
263
|
+
|
|
264
|
+
const notRunLogs = new Map<string, number>();
|
|
265
|
+
|
|
266
|
+
async function candidateLogs($: EngineInterface) {
|
|
267
|
+
const perDir = await Promise.all((await handoffDirs($)).map((dir) => logsUnder($, dir, 2)));
|
|
268
|
+
const unique = new Map(perDir.flat().map((log) => [log.path, log]));
|
|
269
|
+
return [...unique.values()].sort((a, b) => b.mtimeMs - a.mtimeMs).slice(0, MAX_CANDIDATES);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
async function newestLog($: EngineInterface) {
|
|
273
|
+
for (const log of await candidateLogs($)) {
|
|
274
|
+
if (isRunLog(await $.fs.read(log.path).catch(() => ''))) return log;
|
|
275
|
+
}
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async function pinnedLog($: EngineInterface): Promise<LogFile | undefined> {
|
|
280
|
+
const pinned = await read($, pinnedPath);
|
|
281
|
+
if (pinned === null) return undefined;
|
|
282
|
+
const stat = await $.fs.stat(pinned).catch(() => undefined);
|
|
283
|
+
const newest = await newestLog($);
|
|
284
|
+
if (newest !== undefined && newest.path !== pinned && (stat === undefined || newest.mtimeMs > stat.mtimeMs)) {
|
|
285
|
+
await update($, pinnedPath, () => null);
|
|
286
|
+
return undefined;
|
|
287
|
+
}
|
|
288
|
+
return stat === undefined ? undefined : { path: pinned, mtimeMs: stat.mtimeMs };
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const isVisible = (p: Progress, nowMs: number) =>
|
|
292
|
+
p.isDone ? nowMs - p.mtimeMs <= HIDE_AFTER_MS : nowMs - p.mtimeMs <= STALLED_MS;
|
|
293
|
+
|
|
294
|
+
let isHidden = false;
|
|
295
|
+
let timer: Timer | undefined;
|
|
296
|
+
let lastTickMs = 0;
|
|
297
|
+
let shownStatus: string | undefined | null = null;
|
|
298
|
+
|
|
299
|
+
function setStatus($: EngineInterface, text: string | undefined) {
|
|
300
|
+
if (text === shownStatus) return;
|
|
301
|
+
shownStatus = text;
|
|
302
|
+
$.ui.status(text);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const unitStatusOf = (p: Progress) =>
|
|
306
|
+
`${titleOfRun(p)} ${p.isDone ? 'done' : p.passed + p.failed === 0 ? 'running' : `${p.passed + p.failed}${p.total ? `/${p.total}` : ''}`} ✓${p.passed} ✘${p.failed}`;
|
|
307
|
+
|
|
308
|
+
const statusOf = (p: Progress, nowMs: number) =>
|
|
309
|
+
p.kind === 'unit'
|
|
310
|
+
? unitStatusOf(p)
|
|
311
|
+
: p.isSetup
|
|
312
|
+
? `${titleOfRun(p)} setup`
|
|
313
|
+
: `${titleOfRun(p)} w${p.workers} ${p.isDone ? `done ${p.duration ?? ''}`.trim() : `${doneOf(p)}/${p.total}`} ✓${p.passed} ✘${p.failed}` +
|
|
314
|
+
`${p.flaky ? ` ~${p.flaky}` : ''}${p.skipped ? ` -${p.skipped}` : ''}${p.didNotRun ? ` ⊘${p.didNotRun}` : ''}${formatEta(remainingMs(p, nowMs))}`;
|
|
315
|
+
|
|
316
|
+
async function tick($: EngineInterface) {
|
|
317
|
+
const nowMs = await $.clock.now();
|
|
318
|
+
const pinned = await pinnedLog($);
|
|
319
|
+
const logs = pinned ? [pinned] : await candidateLogs($);
|
|
320
|
+
const last = new Map((await read($, runs)).map((p) => [p.path, p]));
|
|
321
|
+
const next: Progress[] = [];
|
|
322
|
+
const setupCandidates: LogFile[] = [];
|
|
323
|
+
for (const log of logs) {
|
|
324
|
+
const previous = last.get(log.path);
|
|
325
|
+
if (previous?.mtimeMs === log.mtimeMs && !previous.isSetup) {
|
|
326
|
+
next.push(previous);
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
if (nowMs - log.mtimeMs <= SETUP_MAX_MS) setupCandidates.push(log);
|
|
330
|
+
if (notRunLogs.get(log.path) === log.mtimeMs) continue;
|
|
331
|
+
const text = await $.fs.read(log.path).catch(() => '');
|
|
332
|
+
if (!isRunLog(text)) {
|
|
333
|
+
notRunLogs.set(log.path, log.mtimeMs);
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
setupCandidates.pop();
|
|
337
|
+
sourceCache.clear();
|
|
338
|
+
const parsed = parse(
|
|
339
|
+
log.path,
|
|
340
|
+
text,
|
|
341
|
+
await expectedFailures($, log.path, text),
|
|
342
|
+
log.mtimeMs,
|
|
343
|
+
nowMs,
|
|
344
|
+
previous ?? null,
|
|
345
|
+
);
|
|
346
|
+
next.push(await withRecords($, parsed, text));
|
|
347
|
+
}
|
|
348
|
+
if (setupCandidates.length > 0) {
|
|
349
|
+
const known = new Set(next.map((p) => p.path));
|
|
350
|
+
const roots = await gitWorktrees($, nowMs);
|
|
351
|
+
const shown = setupRuns(setupCandidates, roots, await playwrightCwds($), nowMs);
|
|
352
|
+
next.push(...shown.filter((p) => !known.has(p.path)));
|
|
353
|
+
}
|
|
354
|
+
if (!pinned) {
|
|
355
|
+
const [root, sessionId] = await Promise.all([$.session.root(), $.session.id()]);
|
|
356
|
+
const stat = await $.fs.stat(root, { resolve: true }).catch(() => undefined);
|
|
357
|
+
const projectRoot = stat?.realPath ?? root;
|
|
358
|
+
const known = new Set(next.map((p) => p.path));
|
|
359
|
+
for (const run of await registryRuns(
|
|
360
|
+
{
|
|
361
|
+
list: (path) => $.fs.list(path),
|
|
362
|
+
read: (path) => $.fs.read(path),
|
|
363
|
+
stat: (path) => $.fs.stat(path),
|
|
364
|
+
},
|
|
365
|
+
{ nowMs, projectRoot, sessionId },
|
|
366
|
+
)) {
|
|
367
|
+
if (known.has(run.entry.log)) continue;
|
|
368
|
+
next.push(await progressOfRegistryRun($, run, last.get(run.entry.log), nowMs));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
const visible = next.filter((p) => isVisible(p, nowMs)).sort((a, b) => a.path.localeCompare(b.path));
|
|
372
|
+
await update($, runs, () => visible);
|
|
373
|
+
|
|
374
|
+
if (visible.length === 0) {
|
|
375
|
+
setStatus($, undefined);
|
|
376
|
+
if (!isHidden) {
|
|
377
|
+
isHidden = true;
|
|
378
|
+
await $.ui.close({ id: PANE }).catch(() => undefined);
|
|
379
|
+
}
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
isHidden = false;
|
|
384
|
+
setStatus($, `runs ${visible.map((p) => statusOf(p, nowMs)).join(' │ ')}`);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
async function run($: EngineInterface) {
|
|
388
|
+
lastTickMs = await $.clock.now();
|
|
389
|
+
try {
|
|
390
|
+
await tick($);
|
|
391
|
+
} catch (error) {
|
|
392
|
+
setStatus($, `e2e-progress failed: ${String(error)}`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function start($: EngineInterface) {
|
|
397
|
+
timer?.cancel();
|
|
398
|
+
timer = $.clock.every(TICK_MS, () => run($));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
async function revive($: EngineInterface) {
|
|
402
|
+
if ((await $.clock.now()) - lastTickMs < STALE_MS) return;
|
|
403
|
+
start($);
|
|
404
|
+
await run($);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export const register: Register = (on) => {
|
|
408
|
+
on('session.start', async ($, e, next) => {
|
|
409
|
+
await $.command.register({
|
|
410
|
+
name: 'e2e',
|
|
411
|
+
description:
|
|
412
|
+
'Show e2e run progress. Optional arg: a log path to pin; "auto" removes the pin; "off" clears the status',
|
|
413
|
+
});
|
|
414
|
+
start($);
|
|
415
|
+
return next(e);
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
on('prompt.submit', async ($, e, next) => {
|
|
419
|
+
await revive($);
|
|
420
|
+
return next(e);
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
on('tool.call', async ($, e, next) => {
|
|
424
|
+
await revive($);
|
|
425
|
+
return next(e);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
on('turn.complete', async ($, e, next) => {
|
|
429
|
+
await revive($);
|
|
430
|
+
return next(e);
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
on('command.run', { command: 'e2e' }, async ($, e) => {
|
|
434
|
+
const arg = e.args.trim();
|
|
435
|
+
if (arg === 'off') {
|
|
436
|
+
setStatus($, undefined);
|
|
437
|
+
return { text: 'e2e status cleared until the log changes.' };
|
|
438
|
+
}
|
|
439
|
+
if (arg === 'auto') {
|
|
440
|
+
await update($, pinnedPath, () => null);
|
|
441
|
+
start($);
|
|
442
|
+
await run($);
|
|
443
|
+
return { text: `Pin removed. Watching the newest logs under ${HANDOFFS.join(' and ')}.` };
|
|
444
|
+
}
|
|
445
|
+
if (arg !== '') await update($, pinnedPath, () => arg);
|
|
446
|
+
start($);
|
|
447
|
+
await $.ui.open({ id: PANE, title: 'E2E progress' });
|
|
448
|
+
return { text: arg ? `Watching ${arg}.` : 'E2E progress pane opened.' };
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
|
|
452
|
+
const { Box, Text } = $.ui.resolve(e);
|
|
453
|
+
const shown = await read($, runs);
|
|
454
|
+
if (shown.length === 0)
|
|
455
|
+
return (
|
|
456
|
+
<Text dimColor>
|
|
457
|
+
No active run in {REGISTRY} and no run log under {HANDOFFS.join(' or ')}, also in {WORKTREES}/*.
|
|
458
|
+
</Text>
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
const nowMs = await $.clock.now();
|
|
462
|
+
const room = Math.max(1, Math.floor(((e.viewport?.rows ?? 24) - 6 * shown.length) / shown.length));
|
|
463
|
+
return (
|
|
464
|
+
<Box flexDirection="column">
|
|
465
|
+
{shown.map((p) => {
|
|
466
|
+
const done = doneOf(p);
|
|
467
|
+
return (
|
|
468
|
+
<Box flexDirection="column" marginBottom={1}>
|
|
469
|
+
<Text bold>
|
|
470
|
+
{titleOfRun(p)} <Text dimColor>· {p.kind === 'unit' ? 'unit' : `${p.workers} workers`}</Text>
|
|
471
|
+
</Text>
|
|
472
|
+
<Text dimColor wrap="truncate-start">
|
|
473
|
+
{p.path}
|
|
474
|
+
</Text>
|
|
475
|
+
<Text>
|
|
476
|
+
{p.isDone ? `finished in ${p.duration ?? '?'}` : p.total > 0 ? `${done} / ${p.total}` : `${done} done`}
|
|
477
|
+
{p.total > 0 && !p.isDone ? ` (${Math.round((done / p.total) * 100)}%)` : ''}
|
|
478
|
+
{formatEta(remainingMs(p, nowMs))}
|
|
479
|
+
</Text>
|
|
480
|
+
<Text>
|
|
481
|
+
<Text color="green">✓ {p.passed}</Text> <Text color="red">✘ {p.failed}</Text>{' '}
|
|
482
|
+
<Text dimColor>- {p.skipped} skipped</Text>
|
|
483
|
+
{p.didNotRun > 0 ? <Text color="yellow"> ⊘ {p.didNotRun} did not run</Text> : ''}
|
|
484
|
+
{p.flaky > 0 ? <Text color="yellow"> ~ {p.flaky} flaky</Text> : ''}
|
|
485
|
+
</Text>
|
|
486
|
+
{p.expected > 0 && <Text dimColor>{p.expected} expected failures (test.fail) counted as passed</Text>}
|
|
487
|
+
{p.failures.slice(-room).map((f) => (
|
|
488
|
+
<Text color="red" wrap="truncate-end">
|
|
489
|
+
✘ {f}
|
|
490
|
+
</Text>
|
|
491
|
+
))}
|
|
492
|
+
</Box>
|
|
493
|
+
);
|
|
494
|
+
})}
|
|
495
|
+
</Box>
|
|
496
|
+
);
|
|
497
|
+
});
|
|
498
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type Progress = {
|
|
2
|
+
path: string;
|
|
3
|
+
kind: 'e2e' | 'unit';
|
|
4
|
+
machine?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
total: number;
|
|
7
|
+
passed: number;
|
|
8
|
+
failed: number;
|
|
9
|
+
skipped: number;
|
|
10
|
+
flaky: number;
|
|
11
|
+
didNotRun: number;
|
|
12
|
+
workers: number;
|
|
13
|
+
duration: string | undefined;
|
|
14
|
+
expected: number;
|
|
15
|
+
isDone: boolean;
|
|
16
|
+
isSetup?: boolean;
|
|
17
|
+
failures: string[];
|
|
18
|
+
mtimeMs: number;
|
|
19
|
+
firstSeenMs: number;
|
|
20
|
+
firstDone: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare module 'claude-code' {
|
|
24
|
+
interface PluginState {
|
|
25
|
+
'e2e-progress': { runs: Progress[]; path: string | null };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "modules": ["./register.tsx"] }
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const STALE_MS = 2 * 60 * 60 * 1000;
|
|
2
|
+
const QUEUE_HEADING = /^#{1,6} Warteschlange(, Rest)?\s*$/;
|
|
3
|
+
const HEADING = /^#{1,6} /;
|
|
4
|
+
const QUEUE_ITEM = /^\d+\. \*\*(?:.+ \()?[A-Z]\d+b?\)?\*\*/;
|
|
5
|
+
const QUEUE_ROW = /^\| [A-Z]\d+b? \|/;
|
|
6
|
+
|
|
7
|
+
export type StatusFields = {
|
|
8
|
+
task?: string;
|
|
9
|
+
minutes?: number;
|
|
10
|
+
queue?: number;
|
|
11
|
+
questions?: number;
|
|
12
|
+
isCiRot?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const lastSlice = (content: string, mtimeMs: number) => {
|
|
16
|
+
const blocks = content.split(/^(?=#\s*slice:)/m).filter((text) => /^#\s*slice:/m.test(text));
|
|
17
|
+
const block = blocks[blocks.length - 1];
|
|
18
|
+
if (block === undefined) return undefined;
|
|
19
|
+
const name = /^#\s*slice:\s*(.+)$/m.exec(block)?.[1]?.trim();
|
|
20
|
+
const written = /^#\s*written:\s*(\S+)/m.exec(block)?.[1];
|
|
21
|
+
const writtenAt = written && !Number.isNaN(Date.parse(written)) ? Date.parse(written) : mtimeMs;
|
|
22
|
+
return name ? { name, writtenAt } : undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const taskFields = (content: string, mtimeMs: number, nowMs: number): Pick<StatusFields, 'task' | 'minutes'> => {
|
|
26
|
+
const slice = lastSlice(content, mtimeMs);
|
|
27
|
+
if (slice === undefined) return {};
|
|
28
|
+
if (nowMs - slice.writtenAt > STALE_MS) return { task: 'kein Slice' };
|
|
29
|
+
return { task: slice.name, minutes: Math.max(0, Math.floor((nowMs - slice.writtenAt) / 60_000)) };
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const queueCount = (text: string) => {
|
|
33
|
+
let count = 0;
|
|
34
|
+
let isInQueue = false;
|
|
35
|
+
for (const line of text.split('\n')) {
|
|
36
|
+
if (HEADING.test(line)) isInQueue = QUEUE_HEADING.test(line);
|
|
37
|
+
else if (isInQueue && (QUEUE_ITEM.test(line) || QUEUE_ROW.test(line))) count++;
|
|
38
|
+
}
|
|
39
|
+
return count;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const questionCount = (text: string) => text.split('\n').filter((line) => line.startsWith('- ')).length;
|
|
43
|
+
|
|
44
|
+
export const planFilesOf = (configText: string) => {
|
|
45
|
+
try {
|
|
46
|
+
const files = (JSON.parse(configText) as { report?: { planFiles?: unknown } }).report?.planFiles;
|
|
47
|
+
return Array.isArray(files) && files.every((f) => typeof f === 'string') ? (files as string[]) : undefined;
|
|
48
|
+
} catch {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const isCiRotOf = (runJson: string) => {
|
|
54
|
+
try {
|
|
55
|
+
const [run] = JSON.parse(runJson) as { conclusion?: string; status?: string }[];
|
|
56
|
+
return run?.status === 'completed' && run.conclusion === 'failure';
|
|
57
|
+
} catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const durationOf = (minutes: number) =>
|
|
63
|
+
minutes < 60 ? `${minutes} min` : `${Math.floor(minutes / 60)} h ${minutes % 60} min`;
|
|
64
|
+
|
|
65
|
+
export const formatLine = (fields: StatusFields) => {
|
|
66
|
+
const parts = [
|
|
67
|
+
fields.task === undefined ? undefined : `▶ ${fields.task}`,
|
|
68
|
+
fields.minutes === undefined ? undefined : durationOf(fields.minutes),
|
|
69
|
+
fields.queue === undefined ? undefined : `${fields.queue} offen`,
|
|
70
|
+
fields.questions ? `❓${fields.questions}` : undefined,
|
|
71
|
+
fields.isCiRot ? '⛔ CI rot' : undefined,
|
|
72
|
+
].filter((part): part is string => part !== undefined);
|
|
73
|
+
return parts.length === 0 ? null : parts.join(' · ');
|
|
74
|
+
};
|