@intentic/local-agent 1.331.0 → 1.333.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 +7 -3
- package/dist/autostart.d.ts.map +1 -1
- package/dist/autostart.js +26 -21
- package/dist/autostart.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +55 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +278 -0
- package/dist/layout.js.map +1 -0
- package/dist/ui.d.ts +19 -5
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +210 -115
- package/dist/ui.js.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,OAAO,GAAW,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;AAEnJ,MAAM,CAAC,MAAM,KAAK,GAAW,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC;AAGpH,MAAM,CAAC,MAAM,GAAG,GAAG,WAAW,CAAC;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;AAChC,MAAM,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KAA0B,EAAY,EAAE;IACxE,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE;QAClC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;IACnH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type Footnote, type Item } from "./layout.js";
|
|
2
|
+
export { displayWidth, explain, truncate, wrap, type Footnote, type Item, type Tone } from "./layout.js";
|
|
1
3
|
export type UiMode = "rich" | "plain" | "nested";
|
|
2
4
|
export interface PlanStep {
|
|
3
5
|
readonly phase: string;
|
|
@@ -5,10 +7,9 @@ export interface PlanStep {
|
|
|
5
7
|
readonly weight: number;
|
|
6
8
|
}
|
|
7
9
|
export type RowOutcome = "pass" | "warn" | "fail" | "skip";
|
|
8
|
-
export type Footnote = readonly [what: string, command: string];
|
|
9
10
|
export interface Ui {
|
|
10
11
|
readonly mode: UiMode;
|
|
11
|
-
begin: (title: string, plan?: readonly PlanStep[]) => void;
|
|
12
|
+
begin: (title: string, plan?: readonly PlanStep[], scope?: string) => void;
|
|
12
13
|
step: (phase: string, message: string) => void;
|
|
13
14
|
detail: (text: string) => void;
|
|
14
15
|
progress: (text: string) => void;
|
|
@@ -16,6 +17,16 @@ export interface Ui {
|
|
|
16
17
|
note: (text: string) => void;
|
|
17
18
|
warn: (text: string) => void;
|
|
18
19
|
finished: (verdict: string, address: string | undefined, instruction: string, footnotes?: readonly Footnote[]) => void;
|
|
20
|
+
act: (label: string) => void;
|
|
21
|
+
done: (verdict: string) => void;
|
|
22
|
+
report: (title: string, scope?: string) => void;
|
|
23
|
+
items: (items: readonly Item[]) => void;
|
|
24
|
+
section: (title: string) => void;
|
|
25
|
+
fields: (fields: readonly Footnote[]) => void;
|
|
26
|
+
quiet: (sentence: string) => void;
|
|
27
|
+
cancelled: () => void;
|
|
28
|
+
later: (footnotes: readonly Footnote[]) => void;
|
|
29
|
+
plain: (text: string) => void;
|
|
19
30
|
fail: (message: string) => void;
|
|
20
31
|
suspend: () => void;
|
|
21
32
|
resume: () => void;
|
|
@@ -32,10 +43,13 @@ export interface UiProcess {
|
|
|
32
43
|
};
|
|
33
44
|
readonly env?: Record<string, string | undefined> | undefined;
|
|
34
45
|
}
|
|
35
|
-
export
|
|
36
|
-
|
|
46
|
+
export interface UiOptions {
|
|
47
|
+
readonly stamp?: string | undefined;
|
|
48
|
+
}
|
|
37
49
|
export declare const humanDuration: (milliseconds: number) => string;
|
|
50
|
+
export declare const widthFrom: (reported: number | undefined, columns: string | undefined) => number;
|
|
51
|
+
export declare const unicodeSafe: (env: Record<string, string | undefined>, platform: string) => boolean;
|
|
38
52
|
export declare const estimate: (totalWeight: number, consumed: number, elapsedSeconds: number) => string | undefined;
|
|
39
53
|
export declare const asLabel: (message: string) => string;
|
|
40
|
-
export declare const createUi: (process: UiProcess) => Ui;
|
|
54
|
+
export declare const createUi: (process: UiProcess, options?: UiOptions) => Ui;
|
|
41
55
|
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1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
|
|
2
|
-
|
|
3
|
-
const DIM = "\u001b[2m";
|
|
4
|
-
const BOLD = "\u001b[1m";
|
|
5
|
-
const GREEN = "\u001b[32m";
|
|
6
|
-
const RED = "\u001b[31m";
|
|
7
|
-
const YELLOW = "\u001b[33m";
|
|
8
|
-
const CYAN = "\u001b[36m";
|
|
9
|
-
const RESET = "\u001b[0m";
|
|
1
|
+
import { ASCII, CANCELLED, CYAN, DIM, fieldLines, footnoteLines, GREEN, headingLines, itemLines, liveLine, paint, planSummary, plainFieldLines, plainItemLines, plainRowLine, plainSectionLines, quietLine, RED, rowLines, sectionLines, settledLine, stopLines, UNICODE, verdictLines, wrap, YELLOW, } from "./layout.js";
|
|
2
|
+
export { displayWidth, explain, truncate, wrap } from "./layout.js";
|
|
10
3
|
const TICK_MS = 110;
|
|
11
4
|
const ESTIMATE_FLOOR_SECONDS = 20;
|
|
12
|
-
export const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let current = "";
|
|
18
|
-
for (const word of text.split(/\s+/u).filter((part) => part !== "")) {
|
|
19
|
-
if (current === "") {
|
|
20
|
-
current = word;
|
|
21
|
-
}
|
|
22
|
-
else if ([...current].length + 1 + [...word].length <= width) {
|
|
23
|
-
current = `${current} ${word}`;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
lines.push(current);
|
|
27
|
-
current = word;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (current !== "") {
|
|
31
|
-
lines.push(current);
|
|
5
|
+
export const humanDuration = (milliseconds) => {
|
|
6
|
+
const total = Math.max(0, Math.floor(milliseconds));
|
|
7
|
+
const tenths = Math.floor((total + 50) / 100);
|
|
8
|
+
if (tenths < 100) {
|
|
9
|
+
return `${Math.floor(tenths / 10)}.${tenths % 10}s`;
|
|
32
10
|
}
|
|
33
|
-
|
|
11
|
+
const seconds = Math.max(10, Math.floor(total / 1000));
|
|
12
|
+
return seconds >= 90 ? `${Math.floor((seconds + 30) / 60)}m` : `${seconds}s`;
|
|
34
13
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
return `${characters.slice(0, limit - 1).join("")}…`;
|
|
14
|
+
const MIN_WIDTH = 20;
|
|
15
|
+
const MAX_WIDTH = 120;
|
|
16
|
+
export const widthFrom = (reported, columns) => {
|
|
17
|
+
const named = columns?.trim() ?? "";
|
|
18
|
+
const fallback = /^\d+$/u.test(named) && Number(named) > 0 ? Number(named) : 80;
|
|
19
|
+
const width = reported !== undefined && Number.isFinite(reported) && reported > 0 ? Math.floor(reported) : fallback;
|
|
20
|
+
return Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, width));
|
|
44
21
|
};
|
|
45
|
-
export const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return `${Math.round(seconds / 60)}m`;
|
|
49
|
-
}
|
|
50
|
-
if (seconds >= 10) {
|
|
51
|
-
return `${seconds}s`;
|
|
22
|
+
export const unicodeSafe = (env, platform) => {
|
|
23
|
+
if (platform === "win32") {
|
|
24
|
+
return true;
|
|
52
25
|
}
|
|
53
|
-
|
|
26
|
+
const locale = [env["LC_ALL"], env["LC_CTYPE"], env["LANG"]].find((value) => value !== undefined && value !== "");
|
|
27
|
+
return locale === undefined || /utf-?8/iu.test(locale);
|
|
54
28
|
};
|
|
55
29
|
export const estimate = (totalWeight, consumed, elapsedSeconds) => {
|
|
56
30
|
if (totalWeight <= 0 || consumed < 1) {
|
|
@@ -64,6 +38,13 @@ export const asLabel = (message) => {
|
|
|
64
38
|
const trimmed = message.replace(/[…. ]+$/u, "");
|
|
65
39
|
return trimmed === "" ? "" : trimmed[0].toUpperCase() + trimmed.slice(1);
|
|
66
40
|
};
|
|
41
|
+
const NAMES = new Set(["Docker", "Intentic", "WSL", "Windows"]);
|
|
42
|
+
const asNarration = (label) => {
|
|
43
|
+
const first = label.split(" ")[0] ?? "";
|
|
44
|
+
const isWord = [...first].length > 1 && first.slice(1) === first.slice(1).toLowerCase() && !NAMES.has(first);
|
|
45
|
+
return isWord ? first[0].toLowerCase() + label.slice(1) : label;
|
|
46
|
+
};
|
|
47
|
+
const toneOf = (outcome) => (outcome === "pass" ? "ok" : outcome);
|
|
67
48
|
const detectMode = (process) => {
|
|
68
49
|
const forced = process.env?.["INTENTIC_UI"];
|
|
69
50
|
if (forced === "plain" || forced === "rich" || forced === "nested") {
|
|
@@ -74,17 +55,22 @@ const detectMode = (process) => {
|
|
|
74
55
|
}
|
|
75
56
|
return process.stdout.isTTY === true ? "rich" : "plain";
|
|
76
57
|
};
|
|
77
|
-
export const createUi = (process) => {
|
|
58
|
+
export const createUi = (process, options = {}) => {
|
|
78
59
|
const mode = detectMode(process);
|
|
79
60
|
const env = process.env ?? {};
|
|
80
61
|
const colour = mode !== "plain" && (env["FORCE_COLOR"] !== undefined || env["NO_COLOR"] === undefined);
|
|
81
|
-
const width =
|
|
82
|
-
const
|
|
83
|
-
const paint = (text, code) => (colour ? `${code}${text}${RESET}` : text);
|
|
62
|
+
const width = widthFrom(process.stdout.columns, env["COLUMNS"]);
|
|
63
|
+
const pen = { colour, glyphs: unicodeSafe(env, globalThis.process.platform) ? UNICODE : ASCII, width };
|
|
84
64
|
const out = (text) => void process.stdout.write(text);
|
|
65
|
+
const lines = (all) => {
|
|
66
|
+
for (const line of all) {
|
|
67
|
+
out(`${line}\n`);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
85
70
|
let plan = [];
|
|
86
71
|
let index;
|
|
87
72
|
let ordinal = 0;
|
|
73
|
+
let numbered = true;
|
|
88
74
|
let label = "";
|
|
89
75
|
let detailText = "";
|
|
90
76
|
let started = Date.now();
|
|
@@ -112,26 +98,18 @@ export const createUi = (process) => {
|
|
|
112
98
|
if (!live) {
|
|
113
99
|
return;
|
|
114
100
|
}
|
|
115
|
-
out(`\r${" ".repeat(width)}\r`);
|
|
101
|
+
out(`\r${" ".repeat(width - 1)}\r`);
|
|
116
102
|
live = false;
|
|
117
103
|
};
|
|
118
104
|
const repaint = () => {
|
|
119
105
|
if (mode !== "rich" || suspended || label === "") {
|
|
120
106
|
return;
|
|
121
107
|
}
|
|
122
|
-
const spinner = glyphs.spinner[frame % glyphs.spinner.length] ?? "";
|
|
108
|
+
const spinner = pen.glyphs.spinner[frame % pen.glyphs.spinner.length] ?? "";
|
|
123
109
|
const elapsed = humanDuration(Date.now() - stepStarted);
|
|
124
110
|
const left = remaining();
|
|
125
111
|
const right = left === undefined || Date.now() - stepStarted < 5000 ? elapsed : `${elapsed} · ~${left} left`;
|
|
126
|
-
|
|
127
|
-
const budget = width - 1;
|
|
128
|
-
const fixed = [...head].length + [...right].length + 1;
|
|
129
|
-
const middle = detailText === "" ? "" : truncate(` · ${detailText}`, Math.max(0, budget - fixed));
|
|
130
|
-
const pad = " ".repeat(Math.max(0, budget - fixed - [...middle].length));
|
|
131
|
-
const text = colour
|
|
132
|
-
? ` ${paint(spinner, CYAN)} ${paint(String(ordinal).padStart(2), DIM)} ${label}${middle === "" ? "" : paint(middle, DIM)}${pad} ${paint(right, DIM)}`
|
|
133
|
-
: `${head}${middle}${pad} ${right}`;
|
|
134
|
-
out(`\r${text}`);
|
|
112
|
+
out(`\r${liveLine(pen, spinner, numbered ? ordinal : undefined, label, detailText, right)}`);
|
|
135
113
|
live = true;
|
|
136
114
|
};
|
|
137
115
|
const above = (text) => {
|
|
@@ -149,7 +127,13 @@ export const createUi = (process) => {
|
|
|
149
127
|
}, TICK_MS);
|
|
150
128
|
ticker.unref();
|
|
151
129
|
};
|
|
152
|
-
const
|
|
130
|
+
const stopTicker = () => {
|
|
131
|
+
if (ticker !== undefined) {
|
|
132
|
+
clearInterval(ticker);
|
|
133
|
+
ticker = undefined;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const settle = (tone = "ok", as) => {
|
|
153
137
|
if (label === "") {
|
|
154
138
|
return;
|
|
155
139
|
}
|
|
@@ -157,35 +141,27 @@ export const createUi = (process) => {
|
|
|
157
141
|
if (index !== undefined) {
|
|
158
142
|
behind += plan[index]?.weight ?? 0;
|
|
159
143
|
}
|
|
160
|
-
|
|
161
|
-
const bare = ` x ${String(ordinal).padStart(2)} ${label}`;
|
|
162
|
-
const pad = " ".repeat(Math.max(0, width - 1 - [...bare].length - [...took].length));
|
|
163
|
-
out(` ${paint(glyphs.ok, GREEN)} ${paint(String(ordinal).padStart(2), DIM)} ${label}${pad}${paint(took, DIM)}\n`);
|
|
144
|
+
out(`${settledLine(pen, tone, numbered ? ordinal : undefined, as ?? label, humanDuration(Date.now() - stepStarted))}\n`);
|
|
164
145
|
label = "";
|
|
165
146
|
detailText = "";
|
|
166
147
|
};
|
|
167
148
|
const nestedLine = (text, marker) => {
|
|
168
149
|
for (const [at, part] of wrap(text, width - 10).entries()) {
|
|
169
150
|
const lead = at === 0 && marker !== undefined ? ` ${marker} ` : " ";
|
|
170
|
-
above(`${lead}${paint(part, DIM)}`);
|
|
151
|
+
above(`${lead}${paint(pen, part, DIM)}`);
|
|
171
152
|
}
|
|
172
153
|
};
|
|
154
|
+
const nestedMarker = (tone) => (tone === "ok" ? pen.glyphs.ok : tone === "fail" ? pen.glyphs.fail : tone === "warn" ? pen.glyphs.warn : pen.glyphs.skip);
|
|
173
155
|
return {
|
|
174
156
|
mode,
|
|
175
|
-
begin: (title, steps = []) => {
|
|
157
|
+
begin: (title, steps = [], scope) => {
|
|
176
158
|
plan = steps;
|
|
177
159
|
started = Date.now();
|
|
178
160
|
if (mode !== "rich") {
|
|
179
161
|
return;
|
|
180
162
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (steps.length > 0) {
|
|
184
|
-
const seconds = steps.reduce((sum, step) => sum + step.weight, 0);
|
|
185
|
-
const minutes = Math.max(1, Math.round(seconds / 60));
|
|
186
|
-
out(`${paint(` ${steps.length} steps, roughly ${minutes} minute${minutes === 1 ? "" : "s"}.`, DIM)}\n`);
|
|
187
|
-
}
|
|
188
|
-
out("\n");
|
|
163
|
+
const promise = scope ?? (steps.length > 0 ? planSummary(steps.length, steps.reduce((sum, step) => sum + step.weight, 0)) : undefined);
|
|
164
|
+
lines(headingLines(pen, title, options.stamp, promise));
|
|
189
165
|
startTicker();
|
|
190
166
|
},
|
|
191
167
|
step: (phase, message) => {
|
|
@@ -201,6 +177,7 @@ export const createUi = (process) => {
|
|
|
201
177
|
const found = plan.findIndex((planned) => planned.phase === phase);
|
|
202
178
|
const at = found >= 0 && (index === undefined || found >= index) ? found : undefined;
|
|
203
179
|
index = at;
|
|
180
|
+
numbered = true;
|
|
204
181
|
label = at === undefined ? asLabel(message) : (plan[at]?.label ?? asLabel(message));
|
|
205
182
|
detailText = "";
|
|
206
183
|
ordinal += 1;
|
|
@@ -230,16 +207,11 @@ export const createUi = (process) => {
|
|
|
230
207
|
},
|
|
231
208
|
row: (outcome, name, note = "") => {
|
|
232
209
|
if (mode === "plain") {
|
|
233
|
-
|
|
234
|
-
const word = outcome === "pass" ? "ok " : outcome === "fail" ? "FAIL" : outcome === "warn" ? "warn" : "skip";
|
|
235
|
-
out(` ${word} ${name}${tail}\n`);
|
|
210
|
+
out(`${plainRowLine(toneOf(outcome), name, note)}\n`);
|
|
236
211
|
return;
|
|
237
212
|
}
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
const body = note === "" ? name : `${name}, ${note}`;
|
|
241
|
-
for (const [at, part] of wrap(body, width - 10).entries()) {
|
|
242
|
-
above(at === 0 ? ` ${paint(glyph, code)} ${paint(part, DIM)}` : ` ${paint(part, DIM)}`);
|
|
213
|
+
for (const line of rowLines(pen, toneOf(outcome), name, note)) {
|
|
214
|
+
above(line);
|
|
243
215
|
}
|
|
244
216
|
},
|
|
245
217
|
note: (text) => {
|
|
@@ -248,7 +220,7 @@ export const createUi = (process) => {
|
|
|
248
220
|
return;
|
|
249
221
|
}
|
|
250
222
|
for (const part of wrap(text, width - 8)) {
|
|
251
|
-
above(` ${paint(part, DIM)}`);
|
|
223
|
+
above(` ${paint(pen, part, DIM)}`);
|
|
252
224
|
}
|
|
253
225
|
},
|
|
254
226
|
warn: (text) => {
|
|
@@ -261,7 +233,7 @@ export const createUi = (process) => {
|
|
|
261
233
|
let first = true;
|
|
262
234
|
for (const paragraph of text.split("\n")) {
|
|
263
235
|
for (const part of wrap(paragraph, width - 9)) {
|
|
264
|
-
above(first ? ` ${paint(glyphs.warn, YELLOW)} ${paint(part, DIM)}` : ` ${paint(part, DIM)}`);
|
|
236
|
+
above(first ? ` ${paint(pen, pen.glyphs.warn, YELLOW)} ${paint(pen, part, DIM)}` : ` ${paint(pen, part, DIM)}`);
|
|
265
237
|
first = false;
|
|
266
238
|
}
|
|
267
239
|
}
|
|
@@ -281,55 +253,181 @@ export const createUi = (process) => {
|
|
|
281
253
|
return;
|
|
282
254
|
}
|
|
283
255
|
if (mode === "nested") {
|
|
284
|
-
nestedLine(verdict, paint(glyphs.ok, GREEN));
|
|
256
|
+
nestedLine(verdict, paint(pen, pen.glyphs.ok, GREEN));
|
|
285
257
|
if (address !== undefined) {
|
|
286
258
|
nestedLine(address);
|
|
287
259
|
}
|
|
288
260
|
return;
|
|
289
261
|
}
|
|
290
262
|
settle();
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
out("\n");
|
|
294
|
-
out(` ${paint(glyphs.ok, GREEN)} ${paint(verdict, BOLD)}${pad}${paint(took, DIM)}\n`);
|
|
263
|
+
stopTicker();
|
|
264
|
+
lines(verdictLines(pen, "ok", verdict, `took ${humanDuration(Date.now() - started)}`));
|
|
295
265
|
if (address !== undefined) {
|
|
296
|
-
out(`\n ${paint(address, CYAN)}\n`);
|
|
266
|
+
out(`\n ${paint(pen, address, CYAN)}\n`);
|
|
297
267
|
}
|
|
298
268
|
if (instruction !== "") {
|
|
299
|
-
out(
|
|
269
|
+
out("\n");
|
|
270
|
+
lines(wrap(instruction, width - 6).map((part) => ` ${part}`));
|
|
300
271
|
}
|
|
301
272
|
if (footnotes.length > 0) {
|
|
302
273
|
out("\n");
|
|
303
|
-
|
|
304
|
-
for (const [at, [what, command]] of footnotes.entries()) {
|
|
305
|
-
const heading = (at === 0 ? "later" : "").padEnd(6);
|
|
306
|
-
out(`${paint(truncate(` ${heading} ${what.padEnd(column)} ${command}`, width), DIM)}\n`);
|
|
307
|
-
}
|
|
274
|
+
lines(footnoteLines(pen, footnotes));
|
|
308
275
|
}
|
|
309
276
|
out("\n");
|
|
310
277
|
},
|
|
278
|
+
act: (text) => {
|
|
279
|
+
if (mode === "plain") {
|
|
280
|
+
out(`intentic: ${asNarration(text)}…\n`);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (mode === "nested") {
|
|
284
|
+
nestedLine(text);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
settle();
|
|
288
|
+
index = undefined;
|
|
289
|
+
numbered = false;
|
|
290
|
+
label = text;
|
|
291
|
+
detailText = "";
|
|
292
|
+
stepStarted = Date.now();
|
|
293
|
+
frame = 0;
|
|
294
|
+
startTicker();
|
|
295
|
+
repaint();
|
|
296
|
+
},
|
|
297
|
+
done: (verdict) => {
|
|
298
|
+
if (mode === "plain") {
|
|
299
|
+
out(`intentic: ${verdict}\n`);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
if (mode === "nested") {
|
|
303
|
+
nestedLine(verdict, paint(pen, pen.glyphs.ok, GREEN));
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
if (label === "") {
|
|
307
|
+
out(`${settledLine(pen, "ok", undefined, verdict, "")}\n`);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
settle("ok", verdict);
|
|
311
|
+
},
|
|
312
|
+
report: (title, scope) => {
|
|
313
|
+
if (mode !== "rich") {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
settle();
|
|
317
|
+
lines(headingLines(pen, title, options.stamp, scope));
|
|
318
|
+
},
|
|
319
|
+
items: (items) => {
|
|
320
|
+
if (mode === "plain") {
|
|
321
|
+
lines(plainItemLines(items));
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (mode === "nested") {
|
|
325
|
+
for (const item of items) {
|
|
326
|
+
nestedLine(item.meta === undefined || item.meta === "" ? item.name : `${item.name} — ${item.meta}`, nestedMarker(item.tone));
|
|
327
|
+
}
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
for (const line of itemLines(pen, items)) {
|
|
331
|
+
above(line);
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
section: (title) => {
|
|
335
|
+
if (mode === "plain") {
|
|
336
|
+
lines(plainSectionLines(title));
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
if (mode === "nested") {
|
|
340
|
+
nestedLine(title);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
for (const line of sectionLines(pen, title)) {
|
|
344
|
+
above(line);
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
fields: (fields) => {
|
|
348
|
+
if (mode === "plain") {
|
|
349
|
+
lines(plainFieldLines(fields));
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (mode === "nested") {
|
|
353
|
+
for (const [key, value] of fields) {
|
|
354
|
+
nestedLine(`${key}: ${value}`);
|
|
355
|
+
}
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
for (const line of fieldLines(pen, fields)) {
|
|
359
|
+
above(line);
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
quiet: (sentence) => {
|
|
363
|
+
if (mode === "plain") {
|
|
364
|
+
out(`intentic: ${sentence}\n`);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (mode === "nested") {
|
|
368
|
+
nestedLine(sentence);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
above(quietLine(pen, sentence));
|
|
372
|
+
},
|
|
373
|
+
cancelled: () => {
|
|
374
|
+
if (mode === "plain") {
|
|
375
|
+
out(`intentic: ${CANCELLED}\n`);
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
settle("skip");
|
|
379
|
+
if (mode === "nested") {
|
|
380
|
+
nestedLine(CANCELLED);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
out(`${quietLine(pen, CANCELLED)}\n`);
|
|
384
|
+
},
|
|
385
|
+
later: (footnotes) => {
|
|
386
|
+
if (mode !== "rich" || footnotes.length === 0) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
settle();
|
|
390
|
+
lines(footnoteLines(pen, footnotes));
|
|
391
|
+
},
|
|
392
|
+
plain: (text) => {
|
|
393
|
+
if (mode === "plain") {
|
|
394
|
+
out(`${text}\n`);
|
|
395
|
+
}
|
|
396
|
+
},
|
|
311
397
|
fail: (message) => {
|
|
312
398
|
if (mode === "plain") {
|
|
313
399
|
process.stderr.write(`error: ${message}\n`);
|
|
314
400
|
return;
|
|
315
401
|
}
|
|
316
|
-
erase();
|
|
317
402
|
if (mode === "nested") {
|
|
318
|
-
|
|
319
|
-
|
|
403
|
+
erase();
|
|
404
|
+
const [headline = "", ...rest] = message.split("\n");
|
|
405
|
+
for (const [at, part] of wrap(headline, width - 10).entries()) {
|
|
406
|
+
process.stderr.write(`${at === 0 ? ` ${paint(pen, pen.glyphs.fail, RED)} ` : " "}${paint(pen, part, RED)}\n`);
|
|
407
|
+
}
|
|
408
|
+
for (const raw of rest) {
|
|
409
|
+
const body = raw.trim();
|
|
410
|
+
const split = body.indexOf(": ");
|
|
411
|
+
const label = split > 0 ? body.slice(0, split) : "";
|
|
412
|
+
if (label === "problem" || label === "fix") {
|
|
413
|
+
const padded = `${label}:`.padEnd(9);
|
|
414
|
+
for (const [at, part] of wrap(body.slice(split + 2), width - 9 - padded.length).entries()) {
|
|
415
|
+
process.stderr.write(`${at === 0 ? ` ${paint(pen, padded, DIM)}` : " ".repeat(8 + padded.length)}${part}\n`);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
else if (body !== "") {
|
|
419
|
+
for (const part of wrap(body, width - 9)) {
|
|
420
|
+
process.stderr.write(` ${part}\n`);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
320
423
|
}
|
|
321
424
|
return;
|
|
322
425
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
for (const
|
|
326
|
-
process.stderr.write(`${
|
|
327
|
-
}
|
|
328
|
-
for (const line of rest) {
|
|
329
|
-
const trimmed = line.trimEnd();
|
|
330
|
-
process.stderr.write(trimmed === "" ? "\n" : ` ${trimmed}\n`);
|
|
426
|
+
settle("fail");
|
|
427
|
+
stopTicker();
|
|
428
|
+
for (const line of stopLines(pen, message)) {
|
|
429
|
+
process.stderr.write(`${line}\n`);
|
|
331
430
|
}
|
|
332
|
-
process.stderr.write("\n");
|
|
333
431
|
},
|
|
334
432
|
suspend: () => {
|
|
335
433
|
if (mode !== "rich") {
|
|
@@ -349,10 +447,7 @@ export const createUi = (process) => {
|
|
|
349
447
|
if (mode === "rich") {
|
|
350
448
|
settle();
|
|
351
449
|
}
|
|
352
|
-
|
|
353
|
-
clearInterval(ticker);
|
|
354
|
-
ticker = undefined;
|
|
355
|
-
}
|
|
450
|
+
stopTicker();
|
|
356
451
|
},
|
|
357
452
|
};
|
|
358
453
|
};
|