singleton-pipeline 0.4.0-beta.1 → 0.4.0-beta.13
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/CHANGELOG.md +49 -0
- package/README.md +170 -129
- package/docs/reference.md +63 -18
- package/package.json +3 -1
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/commands/new.js +455 -109
- package/packages/cli/src/commands/repl.js +86 -89
- package/packages/cli/src/executor/debug-loop.js +587 -0
- package/packages/cli/src/executor/inputs.js +202 -0
- package/packages/cli/src/executor/outputs.js +140 -0
- package/packages/cli/src/executor/preflight.js +459 -0
- package/packages/cli/src/executor/replay-loop.js +172 -0
- package/packages/cli/src/executor/run-report.js +189 -0
- package/packages/cli/src/executor/run-setup.js +93 -0
- package/packages/cli/src/executor/security-review.js +108 -0
- package/packages/cli/src/executor/snapshot-manager.js +335 -0
- package/packages/cli/src/executor/step-runner.js +266 -0
- package/packages/cli/src/executor.js +233 -2228
- package/packages/cli/src/index.js +1 -1
- package/packages/cli/src/runners/claude.js +6 -3
- package/packages/cli/src/runners/codex.js +6 -3
- package/packages/cli/src/runners/copilot.js +25 -9
- package/packages/cli/src/runners/opencode.js +1 -1
- package/packages/cli/src/shell.js +244 -54
- package/packages/cli/src/timeline.js +54 -20
- package/packages/server/package.json +1 -1
- package/packages/web/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import blessed from 'blessed';
|
|
2
|
-
import {
|
|
2
|
+
import { S } from './shell.js';
|
|
3
3
|
|
|
4
4
|
const FRAMES = ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷'];
|
|
5
5
|
|
|
@@ -13,10 +13,10 @@ export function createTimeline(stepNames, widgets = null) {
|
|
|
13
13
|
let spinnerInterval = null;
|
|
14
14
|
let spinnerFrame = 0;
|
|
15
15
|
|
|
16
|
-
let screen, logPanel, statusBox, ownScreen = false;
|
|
16
|
+
let screen, logPanel, statusBox, setLabel = null, mirror = null, ownScreen = false;
|
|
17
17
|
|
|
18
18
|
if (widgets) {
|
|
19
|
-
({ screen, logPanel, statusBox } = widgets);
|
|
19
|
+
({ screen, logPanel, statusBox, setLabel = null, mirror = null } = widgets);
|
|
20
20
|
} else {
|
|
21
21
|
ownScreen = true;
|
|
22
22
|
screen = blessed.screen({ smartCSR: true, title: 'Singleton' });
|
|
@@ -34,7 +34,7 @@ export function createTimeline(stepNames, widgets = null) {
|
|
|
34
34
|
orientation: 'horizontal',
|
|
35
35
|
bottom: 5, left: 0,
|
|
36
36
|
width: '100%',
|
|
37
|
-
style: { fg:
|
|
37
|
+
style: { fg: S.border }
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
statusBox = blessed.box({
|
|
@@ -52,19 +52,19 @@ export function createTimeline(stepNames, widgets = null) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function dot(status, frame = 0) {
|
|
55
|
-
if (status === 'done') return `{${
|
|
56
|
-
if (status === 'running') return `{
|
|
57
|
-
if (status === 'paused') return `{${
|
|
58
|
-
if (status === 'error') return `{${
|
|
59
|
-
return `{${
|
|
55
|
+
if (status === 'done') return `{${S.success}-fg}●{/}`;
|
|
56
|
+
if (status === 'running') return `{${S.text}-fg}${FRAMES[frame % FRAMES.length]}{/}`;
|
|
57
|
+
if (status === 'paused') return `{${S.warning}-fg}●{/}`;
|
|
58
|
+
if (status === 'error') return `{${S.error}-fg}●{/}`;
|
|
59
|
+
return `{${S.subtle}-fg}○{/}`;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function shimmerName(text, frame = 0) {
|
|
63
63
|
const peak = frame % (text.length + 6);
|
|
64
64
|
return text.split('').map((ch, i) => {
|
|
65
65
|
const dist = Math.abs(i - peak);
|
|
66
|
-
let color =
|
|
67
|
-
if (dist === 0) color =
|
|
66
|
+
let color = S.accent;
|
|
67
|
+
if (dist === 0) color = S.text;
|
|
68
68
|
else if (dist === 1) color = '#EDD9FF';
|
|
69
69
|
else if (dist === 2) color = '#D4B0FE';
|
|
70
70
|
return ch === ' ' ? ch : `{${color}-fg}{bold}${ch}{/}`;
|
|
@@ -72,23 +72,23 @@ export function createTimeline(stepNames, widgets = null) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function compactDots(frame = 0) {
|
|
75
|
-
return stepNames.map((_name, i) => dot(statuses[i], frame)).join(` {${
|
|
75
|
+
return stepNames.map((_name, i) => dot(statuses[i], frame)).join(` {${S.subtle}-fg}─{/} `);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function renderTimeline(frame = 0) {
|
|
79
79
|
const currentMeta = runningIdx >= 0 && meta[runningIdx]
|
|
80
|
-
? ` {${
|
|
80
|
+
? ` {${S.muted}-fg}${meta[runningIdx]}{/}`
|
|
81
81
|
: '';
|
|
82
82
|
const isPaused = runningIdx >= 0 && statuses[runningIdx] === 'paused';
|
|
83
83
|
const activityLabel = isPaused
|
|
84
|
-
? `{${
|
|
84
|
+
? `{${S.warning}-fg}{bold}Paused{/}`
|
|
85
85
|
: `{bold}Running{/}`;
|
|
86
86
|
const activityIcon = isPaused
|
|
87
|
-
? `{${
|
|
88
|
-
: `{
|
|
87
|
+
? `{${S.warning}-fg}●{/}`
|
|
88
|
+
: `{${S.text}-fg}${FRAMES[frame % FRAMES.length]}{/}`;
|
|
89
89
|
const runningLabel = runningIdx >= 0
|
|
90
|
-
? `${activityLabel} ${activityIcon} ${shimmerName(stepNames[runningIdx], frame)}
|
|
91
|
-
: `{bold}Running:{/} {${
|
|
90
|
+
? `${activityLabel} ${activityIcon} ${shimmerName(stepNames[runningIdx], frame)}${currentMeta}`
|
|
91
|
+
: `{bold}Running:{/} {${S.muted}-fg}idle{/}`;
|
|
92
92
|
const statusLines = [
|
|
93
93
|
'',
|
|
94
94
|
runningLabel,
|
|
@@ -96,14 +96,48 @@ export function createTimeline(stepNames, widgets = null) {
|
|
|
96
96
|
compactDots(frame)
|
|
97
97
|
];
|
|
98
98
|
statusBox.setContent(statusLines.join('\n'));
|
|
99
|
+
if (setLabel) {
|
|
100
|
+
if (runningIdx < 0) {
|
|
101
|
+
setLabel('');
|
|
102
|
+
} else if (runningIdx === 0) {
|
|
103
|
+
// Index 0 is always the preflight pseudo-step — it's not a "real" pipeline step,
|
|
104
|
+
// so show "preflight" rather than fold it into the X/N count.
|
|
105
|
+
const labelText = isPaused ? 'preflight — paused' : 'preflight';
|
|
106
|
+
setLabel(`{${S.text}-fg}{bold}${labelText}{/}`);
|
|
107
|
+
} else {
|
|
108
|
+
// Real steps: 1..(N-1). Subtract 1 from N to exclude preflight from the total.
|
|
109
|
+
const labelText = isPaused
|
|
110
|
+
? `step ${runningIdx}/${N - 1} — paused`
|
|
111
|
+
: `step ${runningIdx}/${N - 1}`;
|
|
112
|
+
setLabel(`{${S.text}-fg}{bold}${labelText}{/}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
99
115
|
screen.render();
|
|
100
116
|
}
|
|
101
117
|
|
|
102
118
|
renderTimeline();
|
|
103
119
|
|
|
104
120
|
return {
|
|
105
|
-
log(text)
|
|
106
|
-
logMuted(text)
|
|
121
|
+
log(text) { const s = `{${S.keyword}-fg}${text}{/}`; logPanel.log(s); mirror?.(s); screen.render(); },
|
|
122
|
+
logMuted(text) { const s = `{${S.muted}-fg}${text}{/}`; logPanel.log(s); mirror?.(s); screen.render(); },
|
|
123
|
+
logSuccess(text) { const s = `{${S.success}-fg}${text}{/}`; logPanel.log(s); mirror?.(s); screen.render(); },
|
|
124
|
+
logError(text) { const s = `{${S.error}-fg}${text}{/}`; logPanel.log(s); mirror?.(s); screen.render(); },
|
|
125
|
+
logDiffLine(raw) {
|
|
126
|
+
const text = String(raw ?? '');
|
|
127
|
+
const body = text.replace(/^\s+/, '');
|
|
128
|
+
// Default to S.subtle for all non-signal lines (meta git, context, untracked previews) —
|
|
129
|
+
// one consistent gray instead of two slightly different ones. Check git meta starts before
|
|
130
|
+
// +/- because +++ and --- would otherwise match the body coloring.
|
|
131
|
+
let color = S.muted;
|
|
132
|
+
if (/^(diff --git|index |--- |\+\+\+ )/.test(body)) color = S.muted;
|
|
133
|
+
else if (body.startsWith('@@')) color = S.keyword;
|
|
134
|
+
else if (body.startsWith('+')) color = S.success;
|
|
135
|
+
else if (body.startsWith('-')) color = S.error;
|
|
136
|
+
const s = `{${color}-fg}${text}{/}`;
|
|
137
|
+
logPanel.log(s);
|
|
138
|
+
mirror?.(s);
|
|
139
|
+
screen.render();
|
|
140
|
+
},
|
|
107
141
|
|
|
108
142
|
setRunning(i, info = '') {
|
|
109
143
|
if (spinnerInterval) { clearInterval(spinnerInterval); spinnerInterval = null; }
|