specsmd 0.0.0-dev.9 → 0.0.0-dev.90
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 +190 -224
- package/bin/cli.js +28 -1
- package/flows/aidlc/commands/construction-agent.md +5 -1
- package/flows/aidlc/commands/inception-agent.md +4 -0
- package/flows/aidlc/commands/master-agent.md +4 -0
- package/flows/aidlc/commands/operations-agent.md +4 -0
- package/flows/aidlc/memory-bank.yaml +2 -1
- package/{scripts/artifact-validator.js → flows/aidlc/scripts/artifact-validator.cjs} +3 -3
- package/{scripts/bolt-complete.js → flows/aidlc/scripts/bolt-complete.cjs} +36 -5
- package/{scripts/status-integrity.js → flows/aidlc/scripts/status-integrity.cjs} +5 -5
- package/flows/aidlc/skills/construction/bolt-list.md +1 -1
- package/flows/aidlc/skills/construction/bolt-start.md +3 -3
- package/flows/aidlc/skills/construction/bolt-status.md +1 -1
- package/flows/aidlc/skills/construction/prototype-apply.md +311 -0
- package/flows/aidlc/skills/inception/vibe-to-spec.md +410 -0
- package/flows/aidlc/skills/master/analyze-context.md +1 -1
- package/flows/aidlc/templates/construction/bolt-template.md +2 -2
- package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +73 -11
- package/flows/aidlc/templates/standards/decision-index-template.md +32 -0
- package/flows/fire/README.md +19 -0
- package/flows/fire/agents/builder/agent.md +260 -0
- package/flows/fire/agents/builder/skills/code-review/SKILL.md +257 -0
- package/flows/fire/agents/builder/skills/code-review/references/auto-fix-rules.md +218 -0
- package/flows/fire/agents/builder/skills/code-review/references/review-categories.md +154 -0
- package/flows/fire/agents/builder/skills/code-review/templates/review-report.md.hbs +120 -0
- package/flows/fire/agents/builder/skills/run-execute/SKILL.md +714 -0
- package/flows/fire/agents/builder/skills/run-execute/scripts/complete-run.cjs +800 -0
- package/flows/fire/agents/builder/skills/run-execute/scripts/init-run.cjs +500 -0
- package/flows/fire/agents/builder/skills/run-execute/scripts/update-checkpoint.cjs +254 -0
- package/flows/fire/agents/builder/skills/run-execute/scripts/update-phase.cjs +250 -0
- package/flows/fire/agents/builder/skills/run-execute/templates/plan.md.hbs +61 -0
- package/flows/fire/agents/builder/skills/run-execute/templates/test-report.md.hbs +81 -0
- package/flows/fire/agents/builder/skills/run-plan/SKILL.md +378 -0
- package/flows/fire/agents/builder/skills/run-status/SKILL.md +96 -0
- package/flows/fire/agents/builder/skills/walkthrough-generate/SKILL.md +267 -0
- package/flows/fire/agents/builder/skills/walkthrough-generate/templates/walkthrough.md.hbs +176 -0
- package/flows/fire/agents/orchestrator/agent.md +144 -0
- package/flows/fire/agents/orchestrator/skills/project-init/SKILL.md +226 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/coding-standards.md.hbs +149 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/constitution.md.hbs +43 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/system-architecture.md.hbs +101 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/tech-stack.md.hbs +136 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/testing-standards.md.hbs +94 -0
- package/flows/fire/agents/orchestrator/skills/route/SKILL.md +146 -0
- package/flows/fire/agents/orchestrator/skills/status/SKILL.md +696 -0
- package/flows/fire/agents/planner/agent.md +143 -0
- package/flows/fire/agents/planner/skills/design-doc-generate/SKILL.md +156 -0
- package/flows/fire/agents/planner/skills/design-doc-generate/templates/design.md.hbs +124 -0
- package/flows/fire/agents/planner/skills/intent-capture/SKILL.md +125 -0
- package/flows/fire/agents/planner/skills/intent-capture/templates/brief.md.hbs +40 -0
- package/flows/fire/agents/planner/skills/work-item-decompose/SKILL.md +166 -0
- package/flows/fire/agents/planner/skills/work-item-decompose/templates/work-item.md.hbs +40 -0
- package/flows/fire/commands/fire-builder.md +56 -0
- package/flows/fire/commands/fire-planner.md +48 -0
- package/flows/fire/commands/fire.md +46 -0
- package/flows/fire/memory-bank.yaml +240 -0
- package/flows/fire/quick-start.md +146 -0
- package/flows/ideation/README.md +35 -0
- package/flows/ideation/agents/orchestrator/agent.md +103 -0
- package/flows/ideation/agents/orchestrator/skills/flame/SKILL.md +132 -0
- package/flows/ideation/agents/orchestrator/skills/flame/references/evaluation-criteria.md +81 -0
- package/flows/ideation/agents/orchestrator/skills/flame/references/six-hats-method.md +87 -0
- package/flows/ideation/agents/orchestrator/skills/flame/templates/flame-report.md.hbs +81 -0
- package/flows/ideation/agents/orchestrator/skills/forge/SKILL.md +153 -0
- package/flows/ideation/agents/orchestrator/skills/forge/references/disney-method.md +94 -0
- package/flows/ideation/agents/orchestrator/skills/forge/references/pitch-framework.md +87 -0
- package/flows/ideation/agents/orchestrator/skills/forge/templates/concept-brief.md.hbs +83 -0
- package/flows/ideation/agents/orchestrator/skills/spark/SKILL.md +152 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/anti-bias.md +43 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/analogy.md +60 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/first-principles.md +56 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/index.yaml +76 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/inversion.md +52 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/questorming.md +57 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/random-word.md +35 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/scamper.md +67 -0
- package/flows/ideation/agents/orchestrator/skills/spark/references/techniques/what-if.md +55 -0
- package/flows/ideation/agents/orchestrator/skills/spark/templates/spark-bank.md.hbs +72 -0
- package/flows/ideation/commands/flame.md +43 -0
- package/flows/ideation/commands/forge.md +43 -0
- package/flows/ideation/commands/ideation.md +51 -0
- package/flows/ideation/commands/spark.md +43 -0
- package/flows/ideation/memory-bank.yaml +177 -0
- package/flows/ideation/quick-start.md +84 -0
- package/flows/ideation/shared/protocols/anti-bias.md +79 -0
- package/flows/ideation/shared/protocols/deep-thinking.md +92 -0
- package/flows/ideation/shared/protocols/diverge-converge.md +72 -0
- package/flows/ideation/shared/protocols/interaction-adaptation.md +88 -0
- package/flows/simple/README.md +190 -0
- package/flows/simple/agents/agent.md +404 -0
- package/flows/simple/commands/agent.md +60 -0
- package/flows/simple/context-config.yaml +34 -0
- package/flows/simple/memory-bank.yaml +66 -0
- package/flows/simple/quick-start.md +231 -0
- package/flows/simple/skills/design.md +96 -0
- package/flows/simple/skills/execute.md +190 -0
- package/flows/simple/skills/requirements.md +94 -0
- package/flows/simple/skills/tasks.md +136 -0
- package/flows/simple/templates/design-template.md +138 -0
- package/flows/simple/templates/requirements-template.md +85 -0
- package/flows/simple/templates/tasks-template.md +104 -0
- package/lib/analytics/tracker.js +6 -2
- package/lib/constants.js +25 -8
- package/lib/dashboard/aidlc/parser.js +581 -0
- package/lib/dashboard/fire/model.js +382 -0
- package/lib/dashboard/fire/parser.js +470 -0
- package/lib/dashboard/flow-detect.js +86 -0
- package/lib/dashboard/git/changes.js +362 -0
- package/lib/dashboard/git/worktrees.js +248 -0
- package/lib/dashboard/index.js +709 -0
- package/lib/dashboard/runtime/watch-runtime.js +122 -0
- package/lib/dashboard/simple/parser.js +293 -0
- package/lib/dashboard/tui/app.js +1675 -0
- package/lib/dashboard/tui/components/error-banner.js +35 -0
- package/lib/dashboard/tui/components/header.js +60 -0
- package/lib/dashboard/tui/components/help-footer.js +15 -0
- package/lib/dashboard/tui/components/stats-strip.js +35 -0
- package/lib/dashboard/tui/file-entries.js +383 -0
- package/lib/dashboard/tui/flow-builders.js +991 -0
- package/lib/dashboard/tui/git-builders.js +218 -0
- package/lib/dashboard/tui/helpers.js +236 -0
- package/lib/dashboard/tui/overlays.js +242 -0
- package/lib/dashboard/tui/preview.js +220 -0
- package/lib/dashboard/tui/renderer.js +76 -0
- package/lib/dashboard/tui/row-builders.js +797 -0
- package/lib/dashboard/tui/sections.js +45 -0
- package/lib/dashboard/tui/store.js +44 -0
- package/lib/dashboard/tui/views/overview-view.js +61 -0
- package/lib/dashboard/tui/views/runs-view.js +93 -0
- package/lib/dashboard/tui/worktree-builders.js +229 -0
- package/lib/dashboard/web/extension-adapter.js +726 -0
- package/lib/dashboard/web/public/app.js +9 -0
- package/lib/dashboard/web/public/index.html +14 -0
- package/lib/dashboard/web/public/styles.css +36 -0
- package/lib/dashboard/web/public/webview-bundle.js +7596 -0
- package/lib/dashboard/web/server.js +376 -0
- package/lib/dashboard/web/snapshot.js +299 -0
- package/lib/installer.js +19 -15
- package/lib/installers/CodexInstaller.js +72 -1
- package/lib/installers/KiroInstaller.js +55 -0
- package/lib/installers/OpenCodeInstaller.js +9 -1
- package/lib/installers/ToolInstaller.js +4 -1
- package/lib/installers/WindsurfInstaller.js +0 -54
- package/package.json +15 -55
- package/scripts/check-webview-bundle-sync.cjs +38 -0
- package/scripts/sync-webview-bundle.cjs +19 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const { truncate, clampIndex } = require('./helpers');
|
|
3
|
+
const { colorizeMarkdownLine, sanitizeRenderLine } = require('./overlays');
|
|
4
|
+
const {
|
|
5
|
+
loadGitDiffPreview,
|
|
6
|
+
loadGitCommitPreview
|
|
7
|
+
} = require('../git/changes');
|
|
8
|
+
|
|
9
|
+
const MAX_PREVIEW_CACHE_ENTRIES = 64;
|
|
10
|
+
const previewContentCache = new Map();
|
|
11
|
+
|
|
12
|
+
function getFilePreviewCacheKey(filePath) {
|
|
13
|
+
if (typeof filePath !== 'string' || filePath.trim() === '') {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const stat = fs.statSync(filePath);
|
|
19
|
+
return `file:${filePath}:${stat.size}:${Math.floor(stat.mtimeMs)}`;
|
|
20
|
+
} catch {
|
|
21
|
+
return `file:${filePath}:missing`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getGitPreviewCacheKey(fileEntry, isGitCommitPreview) {
|
|
26
|
+
if (!fileEntry || typeof fileEntry !== 'object') {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const repoRoot = typeof fileEntry.repoRoot === 'string' ? fileEntry.repoRoot : '';
|
|
31
|
+
if (isGitCommitPreview) {
|
|
32
|
+
const commitHash = typeof fileEntry.commitHash === 'string' ? fileEntry.commitHash : '';
|
|
33
|
+
return `git-commit:${repoRoot}:${commitHash}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const bucket = typeof fileEntry.bucket === 'string' ? fileEntry.bucket : '';
|
|
37
|
+
const relativePath = typeof fileEntry.relativePath === 'string' ? fileEntry.relativePath : '';
|
|
38
|
+
const pathValue = typeof fileEntry.path === 'string' ? fileEntry.path : '';
|
|
39
|
+
return `git-diff:${repoRoot}:${bucket}:${relativePath}:${pathValue}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getCachedPreviewContent(cacheKey) {
|
|
43
|
+
if (!cacheKey || !previewContentCache.has(cacheKey)) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const cached = previewContentCache.get(cacheKey);
|
|
48
|
+
previewContentCache.delete(cacheKey);
|
|
49
|
+
previewContentCache.set(cacheKey, cached);
|
|
50
|
+
return Array.isArray(cached) ? cached : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function setCachedPreviewContent(cacheKey, lines) {
|
|
54
|
+
if (!cacheKey || !Array.isArray(lines)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (previewContentCache.has(cacheKey)) {
|
|
59
|
+
previewContentCache.delete(cacheKey);
|
|
60
|
+
}
|
|
61
|
+
previewContentCache.set(cacheKey, lines);
|
|
62
|
+
|
|
63
|
+
while (previewContentCache.size > MAX_PREVIEW_CACHE_ENTRIES) {
|
|
64
|
+
const oldest = previewContentCache.keys().next().value;
|
|
65
|
+
if (!oldest) {
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
previewContentCache.delete(oldest);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function clearPreviewContentCache() {
|
|
73
|
+
previewContentCache.clear();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function buildPreviewLines(fileEntry, width, scrollOffset, options = {}) {
|
|
77
|
+
const fullDocument = options?.fullDocument === true;
|
|
78
|
+
|
|
79
|
+
if (!fileEntry || typeof fileEntry.path !== 'string') {
|
|
80
|
+
return [{ text: truncate('No file selected', width), color: 'gray', bold: false }];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const isGitFilePreview = fileEntry.previewType === 'git-diff';
|
|
84
|
+
const isGitCommitPreview = fileEntry.previewType === 'git-commit-diff';
|
|
85
|
+
const isGitPreview = isGitFilePreview || isGitCommitPreview;
|
|
86
|
+
const cacheKey = isGitPreview
|
|
87
|
+
? getGitPreviewCacheKey(fileEntry, isGitCommitPreview)
|
|
88
|
+
: getFilePreviewCacheKey(fileEntry.path);
|
|
89
|
+
let rawLines = getCachedPreviewContent(cacheKey);
|
|
90
|
+
if (!rawLines) {
|
|
91
|
+
if (isGitPreview) {
|
|
92
|
+
const diffText = isGitCommitPreview
|
|
93
|
+
? loadGitCommitPreview(fileEntry)
|
|
94
|
+
: loadGitDiffPreview(fileEntry);
|
|
95
|
+
rawLines = String(diffText || '').split(/\r?\n/);
|
|
96
|
+
} else {
|
|
97
|
+
let content;
|
|
98
|
+
try {
|
|
99
|
+
content = fs.readFileSync(fileEntry.path, 'utf8');
|
|
100
|
+
} catch (error) {
|
|
101
|
+
return [{
|
|
102
|
+
text: truncate(`Unable to read ${fileEntry.label || fileEntry.path}: ${error.message}`, width),
|
|
103
|
+
color: 'red',
|
|
104
|
+
bold: false
|
|
105
|
+
}];
|
|
106
|
+
}
|
|
107
|
+
rawLines = String(content).split(/\r?\n/);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
setCachedPreviewContent(cacheKey, rawLines);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const headLine = {
|
|
114
|
+
text: truncate(
|
|
115
|
+
isGitCommitPreview
|
|
116
|
+
? `commit: ${fileEntry.commitHash || fileEntry.path}`
|
|
117
|
+
: `${isGitPreview ? 'diff' : 'file'}: ${fileEntry.path}`,
|
|
118
|
+
width
|
|
119
|
+
),
|
|
120
|
+
color: 'cyan',
|
|
121
|
+
bold: true
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const normalizedLines = rawLines.map((line) => sanitizeRenderLine(line));
|
|
125
|
+
const cappedLines = fullDocument ? normalizedLines : normalizedLines.slice(0, 300);
|
|
126
|
+
const hiddenLineCount = fullDocument ? 0 : Math.max(0, rawLines.length - cappedLines.length);
|
|
127
|
+
let inCodeBlock = false;
|
|
128
|
+
|
|
129
|
+
const highlighted = cappedLines.map((rawLine, index) => {
|
|
130
|
+
const prefixedLine = `${String(index + 1).padStart(4, ' ')} | ${rawLine}`;
|
|
131
|
+
let color;
|
|
132
|
+
let bold;
|
|
133
|
+
let togglesCodeBlock = false;
|
|
134
|
+
|
|
135
|
+
if (isGitPreview) {
|
|
136
|
+
if (rawLine.startsWith('+++ ') || rawLine.startsWith('--- ') || rawLine.startsWith('diff --git')) {
|
|
137
|
+
color = 'cyan';
|
|
138
|
+
bold = true;
|
|
139
|
+
} else if (rawLine.startsWith('@@')) {
|
|
140
|
+
color = 'magenta';
|
|
141
|
+
bold = true;
|
|
142
|
+
} else if (rawLine.startsWith('+')) {
|
|
143
|
+
color = 'green';
|
|
144
|
+
bold = false;
|
|
145
|
+
} else if (rawLine.startsWith('-')) {
|
|
146
|
+
color = 'red';
|
|
147
|
+
bold = false;
|
|
148
|
+
} else {
|
|
149
|
+
color = undefined;
|
|
150
|
+
bold = false;
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
const markdownStyle = colorizeMarkdownLine(rawLine, inCodeBlock);
|
|
154
|
+
color = markdownStyle.color;
|
|
155
|
+
bold = markdownStyle.bold;
|
|
156
|
+
togglesCodeBlock = markdownStyle.togglesCodeBlock;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (togglesCodeBlock) {
|
|
160
|
+
inCodeBlock = !inCodeBlock;
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
text: truncate(prefixedLine, width),
|
|
164
|
+
color,
|
|
165
|
+
bold
|
|
166
|
+
};
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
if (hiddenLineCount > 0) {
|
|
170
|
+
highlighted.push({
|
|
171
|
+
text: truncate(`... ${hiddenLineCount} additional lines hidden`, width),
|
|
172
|
+
color: 'gray',
|
|
173
|
+
bold: false
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const clampedOffset = clampIndex(scrollOffset, highlighted.length);
|
|
178
|
+
const body = highlighted.slice(clampedOffset);
|
|
179
|
+
|
|
180
|
+
return [headLine, { text: '', color: undefined, bold: false }, ...body];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function allocateSingleColumnPanels(candidates, rowsBudget) {
|
|
184
|
+
const filtered = (candidates || []).filter(Boolean);
|
|
185
|
+
if (filtered.length === 0) {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const selected = [];
|
|
190
|
+
let remaining = Math.max(4, rowsBudget);
|
|
191
|
+
|
|
192
|
+
for (const panel of filtered) {
|
|
193
|
+
const margin = selected.length > 0 ? 1 : 0;
|
|
194
|
+
const minimumRows = 4 + margin;
|
|
195
|
+
|
|
196
|
+
if (remaining >= minimumRows || selected.length === 0) {
|
|
197
|
+
selected.push({
|
|
198
|
+
...panel,
|
|
199
|
+
maxLines: 1
|
|
200
|
+
});
|
|
201
|
+
remaining -= minimumRows;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
let index = 0;
|
|
206
|
+
while (remaining > 0 && selected.length > 0) {
|
|
207
|
+
const panelIndex = index % selected.length;
|
|
208
|
+
selected[panelIndex].maxLines += 1;
|
|
209
|
+
remaining -= 1;
|
|
210
|
+
index += 1;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return selected;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
module.exports = {
|
|
217
|
+
buildPreviewLines,
|
|
218
|
+
allocateSingleColumnPanels,
|
|
219
|
+
clearPreviewContentCache
|
|
220
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const { renderHeaderLines, truncate } = require('./components/header');
|
|
2
|
+
const { renderStatsLines } = require('./components/stats-strip');
|
|
3
|
+
const { renderErrorLines } = require('./components/error-banner');
|
|
4
|
+
const { renderHelpLines } = require('./components/help-footer');
|
|
5
|
+
const { renderRunsViewLines } = require('./views/runs-view');
|
|
6
|
+
const { renderOverviewViewLines } = require('./views/overview-view');
|
|
7
|
+
|
|
8
|
+
function normalizeWidth(width) {
|
|
9
|
+
if (!Number.isFinite(width)) {
|
|
10
|
+
return 120;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return Math.max(40, Math.min(Math.floor(width), 180));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function buildDashboardLines(params) {
|
|
17
|
+
const {
|
|
18
|
+
snapshot,
|
|
19
|
+
error,
|
|
20
|
+
flow,
|
|
21
|
+
workspacePath,
|
|
22
|
+
view,
|
|
23
|
+
watchEnabled,
|
|
24
|
+
watchStatus,
|
|
25
|
+
showHelp,
|
|
26
|
+
lastRefreshAt,
|
|
27
|
+
width
|
|
28
|
+
} = params;
|
|
29
|
+
|
|
30
|
+
const safeWidth = normalizeWidth(width);
|
|
31
|
+
const lines = [];
|
|
32
|
+
|
|
33
|
+
lines.push(...renderHeaderLines({
|
|
34
|
+
snapshot,
|
|
35
|
+
flow,
|
|
36
|
+
workspacePath,
|
|
37
|
+
view,
|
|
38
|
+
watchEnabled,
|
|
39
|
+
watchStatus,
|
|
40
|
+
lastRefreshAt,
|
|
41
|
+
width: safeWidth
|
|
42
|
+
}));
|
|
43
|
+
|
|
44
|
+
if (snapshot) {
|
|
45
|
+
lines.push(...renderStatsLines(snapshot, safeWidth));
|
|
46
|
+
lines.push('');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (error) {
|
|
50
|
+
lines.push(...renderErrorLines(error, safeWidth, watchEnabled));
|
|
51
|
+
lines.push('');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!snapshot) {
|
|
55
|
+
lines.push(truncate('No snapshot available yet. Waiting for refresh...', safeWidth));
|
|
56
|
+
} else if (view === 'overview') {
|
|
57
|
+
lines.push(...renderOverviewViewLines(snapshot, safeWidth));
|
|
58
|
+
} else {
|
|
59
|
+
lines.push(...renderRunsViewLines(snapshot, safeWidth));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
lines.push('');
|
|
63
|
+
lines.push(...renderHelpLines(showHelp, safeWidth));
|
|
64
|
+
|
|
65
|
+
return lines;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function formatDashboardText(params) {
|
|
69
|
+
return buildDashboardLines(params).join('\n');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
buildDashboardLines,
|
|
74
|
+
formatDashboardText,
|
|
75
|
+
normalizeWidth
|
|
76
|
+
};
|