@h-rig/cli 0.0.6-alpha.76 → 0.0.6-alpha.78
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/dist/bin/rig.js +10130 -9246
- package/dist/src/app/board.js +1783 -0
- package/dist/src/app/drone-ui.js +294 -0
- package/dist/src/{commands/_tui-theme.js → app/theme.js} +16 -1
- package/dist/src/commands/_async-ui.js +74 -3
- package/dist/src/commands/_cli-format.js +107 -29
- package/dist/src/commands/_doctor-checks.js +3 -1
- package/dist/src/commands/_help-catalog.js +8 -70
- package/dist/src/commands/_operator-view.js +184 -7
- package/dist/src/commands/_pi-frontend.js +184 -7
- package/dist/src/commands/_preflight.js +3 -1
- package/dist/src/commands/_server-client.js +3 -1
- package/dist/src/commands/_snapshot-upload.js +3 -1
- package/dist/src/commands/_task-picker.js +132 -7
- package/dist/src/commands/browser.js +306 -30
- package/dist/src/commands/connect.js +146 -20
- package/dist/src/commands/doctor.js +77 -4
- package/dist/src/commands/github.js +77 -4
- package/dist/src/commands/inbox.js +171 -88
- package/dist/src/commands/init.js +349 -9
- package/dist/src/commands/inspect.js +77 -4
- package/dist/src/commands/run.js +214 -28
- package/dist/src/commands/server.js +149 -21
- package/dist/src/commands/setup.js +77 -4
- package/dist/src/commands/stats.js +109 -107
- package/dist/src/commands/task-report-bug.js +231 -40
- package/dist/src/commands/task-run-driver.js +3 -1
- package/dist/src/commands/task.js +355 -184
- package/dist/src/commands.js +10126 -9242
- package/dist/src/index.js +10131 -9247
- package/package.json +8 -9
- package/dist/src/commands/_operator-board.js +0 -730
|
@@ -1,6 +1,131 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// packages/cli/src/
|
|
3
|
-
import {
|
|
2
|
+
// packages/cli/src/app/drone-ui.ts
|
|
3
|
+
import { ProcessTerminal, TUI, Text, Input, SelectList, matchesKey } from "@earendil-works/pi-tui";
|
|
4
|
+
|
|
5
|
+
// packages/cli/src/app/theme.ts
|
|
6
|
+
var RIG_PALETTE = {
|
|
7
|
+
ink: "#f2f3f6",
|
|
8
|
+
ink2: "#aeb0ba",
|
|
9
|
+
ink3: "#6c6e79",
|
|
10
|
+
ink4: "#44464f",
|
|
11
|
+
accent: "#ccff4d",
|
|
12
|
+
accentDim: "#a9d63f",
|
|
13
|
+
cyan: "#56d8ff",
|
|
14
|
+
red: "#ff5d5d",
|
|
15
|
+
yellow: "#ffd24d"
|
|
16
|
+
};
|
|
17
|
+
function hexToRgb(hex) {
|
|
18
|
+
const value = hex.replace("#", "");
|
|
19
|
+
return [
|
|
20
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
21
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
22
|
+
Number.parseInt(value.slice(4, 6), 16)
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
function fg(hex) {
|
|
26
|
+
const [r, g, b] = hexToRgb(hex);
|
|
27
|
+
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
|
|
28
|
+
}
|
|
29
|
+
var ink = fg(RIG_PALETTE.ink);
|
|
30
|
+
var ink2 = fg(RIG_PALETTE.ink2);
|
|
31
|
+
var ink3 = fg(RIG_PALETTE.ink3);
|
|
32
|
+
var ink4 = fg(RIG_PALETTE.ink4);
|
|
33
|
+
var accent = fg(RIG_PALETTE.accent);
|
|
34
|
+
var accentDim = fg(RIG_PALETTE.accentDim);
|
|
35
|
+
var cyan = fg(RIG_PALETTE.cyan);
|
|
36
|
+
var red = fg(RIG_PALETTE.red);
|
|
37
|
+
var yellow = fg(RIG_PALETTE.yellow);
|
|
38
|
+
function bold(text) {
|
|
39
|
+
return `\x1B[1m${text}\x1B[22m`;
|
|
40
|
+
}
|
|
41
|
+
var DRONE_ART = [
|
|
42
|
+
" .-=-. .-=-. ",
|
|
43
|
+
" ( !!! ) ( !!! ) ",
|
|
44
|
+
" '-=-'._ _.'-=-' ",
|
|
45
|
+
" '._ _.' ",
|
|
46
|
+
" '=$$$$$$$=.' ",
|
|
47
|
+
" =$$$$$$$$$$$= ",
|
|
48
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
49
|
+
" $$$@@ @@$$$ ",
|
|
50
|
+
" $$@ ? @$$$ ",
|
|
51
|
+
" $$$@ '-' @$$$ ",
|
|
52
|
+
" $$$@@ @@$$$ ",
|
|
53
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
54
|
+
" =$$$$$$$$$$$= ",
|
|
55
|
+
" '=$$$$$$$=.' ",
|
|
56
|
+
" _.' '._ ",
|
|
57
|
+
" .-=-.' '.-=-. ",
|
|
58
|
+
" ( !!! ) ( !!! ) ",
|
|
59
|
+
" '-=-' '-=-' "
|
|
60
|
+
];
|
|
61
|
+
var EYE_FRAMES = ["@", "o", "."];
|
|
62
|
+
var DRONE_WIDTH = DRONE_ART[0].length;
|
|
63
|
+
var DRONE_HEIGHT = DRONE_ART.length;
|
|
64
|
+
var MICRO_BLADES = ["---", "\\\\\\", "|||", "///"];
|
|
65
|
+
function microDroneFrame(tick) {
|
|
66
|
+
const blade = MICRO_BLADES[tick % MICRO_BLADES.length];
|
|
67
|
+
const eye = EYE_FRAMES[Math.floor(tick / 2) % EYE_FRAMES.length];
|
|
68
|
+
return `(${blade})${eye}(${blade})`;
|
|
69
|
+
}
|
|
70
|
+
var MICRO_DRONE_FRAMES = Array.from({ length: 12 }, (_, index) => microDroneFrame(index));
|
|
71
|
+
|
|
72
|
+
// packages/cli/src/app/drone-ui.ts
|
|
73
|
+
var isTty = () => Boolean(process.stdout.isTTY);
|
|
74
|
+
function droneCancel(text) {
|
|
75
|
+
console.log(` ${red("\u2716")} ${ink3(text)}`);
|
|
76
|
+
}
|
|
77
|
+
var SELECT_THEME = {
|
|
78
|
+
selectedPrefix: (text) => accent(text),
|
|
79
|
+
selectedText: (text) => bold(ink(text)),
|
|
80
|
+
description: (text) => ink3(text),
|
|
81
|
+
scrollInfo: (text) => ink4(text),
|
|
82
|
+
noMatch: (text) => ink3(text)
|
|
83
|
+
};
|
|
84
|
+
async function runMiniTui(build) {
|
|
85
|
+
const terminal = new ProcessTerminal;
|
|
86
|
+
const tui = new TUI(terminal);
|
|
87
|
+
let settled = false;
|
|
88
|
+
return await new Promise((resolve) => {
|
|
89
|
+
const finish = (result) => {
|
|
90
|
+
if (settled)
|
|
91
|
+
return;
|
|
92
|
+
settled = true;
|
|
93
|
+
tui.stop();
|
|
94
|
+
resolve(result);
|
|
95
|
+
};
|
|
96
|
+
build(tui, finish);
|
|
97
|
+
tui.start();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async function droneSelect(input) {
|
|
101
|
+
if (!isTty() || input.options.length === 0) {
|
|
102
|
+
return input.initialValue ?? input.options[0]?.value ?? null;
|
|
103
|
+
}
|
|
104
|
+
return runMiniTui((tui, finish) => {
|
|
105
|
+
tui.addChild(new Text(` ${accent("\u258D")}${bold(ink(input.message))}`));
|
|
106
|
+
const items = input.options.map((option) => ({
|
|
107
|
+
value: option.value,
|
|
108
|
+
label: option.label,
|
|
109
|
+
...option.hint ? { description: option.hint } : {}
|
|
110
|
+
}));
|
|
111
|
+
const list = new SelectList(items, Math.min(items.length, 12), SELECT_THEME);
|
|
112
|
+
const initialIndex = input.initialValue ? items.findIndex((item) => item.value === input.initialValue) : -1;
|
|
113
|
+
if (initialIndex > 0)
|
|
114
|
+
list.setSelectedIndex(initialIndex);
|
|
115
|
+
list.onSelect = (item) => finish(item.value);
|
|
116
|
+
list.onCancel = () => finish(null);
|
|
117
|
+
tui.addChild(list);
|
|
118
|
+
tui.addChild(new Text(ink4(" \u2191\u2193 navigate \xB7 enter select \xB7 esc cancel")));
|
|
119
|
+
tui.setFocus(list);
|
|
120
|
+
tui.addInputListener((data) => {
|
|
121
|
+
if (matchesKey(data, "ctrl+c") || matchesKey(data, "escape")) {
|
|
122
|
+
finish(null);
|
|
123
|
+
return { consume: true };
|
|
124
|
+
}
|
|
125
|
+
return;
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
4
129
|
|
|
5
130
|
// packages/cli/src/runner.ts
|
|
6
131
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
@@ -115,8 +240,9 @@ function writeRepoConnection(projectRoot, state) {
|
|
|
115
240
|
}
|
|
116
241
|
|
|
117
242
|
// packages/cli/src/commands/_cli-format.ts
|
|
118
|
-
import { log, note } from "@clack/prompts";
|
|
119
243
|
import pc from "picocolors";
|
|
244
|
+
var themeDim = (value) => ink3(value);
|
|
245
|
+
var themeFaint = (value) => ink4(value);
|
|
120
246
|
function truncate(value, width) {
|
|
121
247
|
if (value.length <= width)
|
|
122
248
|
return value;
|
|
@@ -129,32 +255,32 @@ function pad(value, width) {
|
|
|
129
255
|
}
|
|
130
256
|
function statusColor(status) {
|
|
131
257
|
const normalized = status.toLowerCase();
|
|
132
|
-
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved"].includes(normalized))
|
|
133
|
-
return
|
|
258
|
+
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved", "running"].includes(normalized))
|
|
259
|
+
return accent;
|
|
134
260
|
if (["failed", "needs_attention", "needs-attention", "blocked", "error", "rejected"].includes(normalized))
|
|
135
|
-
return
|
|
136
|
-
if (["
|
|
137
|
-
return
|
|
138
|
-
if (["ready", "open", "queued", "created", "
|
|
139
|
-
return
|
|
140
|
-
return
|
|
261
|
+
return red;
|
|
262
|
+
if (["reviewing", "validating", "in_progress", "in-progress", "remote", "preparing", "closing-out"].includes(normalized))
|
|
263
|
+
return cyan;
|
|
264
|
+
if (["ready", "open", "queued", "created", "local", "pending"].includes(normalized))
|
|
265
|
+
return yellow;
|
|
266
|
+
return themeDim;
|
|
141
267
|
}
|
|
142
268
|
function formatStatusPill(status) {
|
|
143
269
|
const label = status || "unknown";
|
|
144
270
|
return statusColor(label)(`\u25CF ${label}`);
|
|
145
271
|
}
|
|
146
272
|
function formatSection(title, subtitle) {
|
|
147
|
-
return `${pc.bold(
|
|
273
|
+
return `${pc.bold(accent("\u25C6"))} ${pc.bold(title)}${subtitle ? themeDim(` \u2014 ${subtitle}`) : ""}`;
|
|
148
274
|
}
|
|
149
275
|
function formatSuccessCard(title, rows = []) {
|
|
150
|
-
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${
|
|
276
|
+
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${themeFaint("\u2502")} ${themeDim(key.padEnd(12))} ${value}`);
|
|
151
277
|
return [formatSection(title), ...body].join(`
|
|
152
278
|
`);
|
|
153
279
|
}
|
|
154
280
|
function formatNextSteps(steps) {
|
|
155
281
|
if (steps.length === 0)
|
|
156
282
|
return [];
|
|
157
|
-
return [pc.bold("Next"), ...steps.map((step) => `${
|
|
283
|
+
return [pc.bold("Next"), ...steps.map((step) => `${accent("\u203A")} ${step}`)];
|
|
158
284
|
}
|
|
159
285
|
function formatConnectionList(connections) {
|
|
160
286
|
const rows = [["local", { kind: "local", mode: "auto" }], ...Object.entries(connections)];
|
|
@@ -172,9 +298,9 @@ function formatConnectionStatus(selected, connections) {
|
|
|
172
298
|
const target = !connection ? "not configured" : connection.kind === "remote" ? connection.baseUrl : "local";
|
|
173
299
|
return [
|
|
174
300
|
formatSection("Rig server", "selected for this repo"),
|
|
175
|
-
`${
|
|
176
|
-
`${
|
|
177
|
-
`${
|
|
301
|
+
`${themeFaint("\u2502")} ${themeDim("selected ")} ${pc.bold(selected)}`,
|
|
302
|
+
`${themeFaint("\u2502")} ${themeDim("kind ")} ${formatStatusPill(connection?.kind ?? "unknown")}`,
|
|
303
|
+
`${themeFaint("\u2502")} ${themeDim("target ")} ${target ?? "not configured"}`,
|
|
178
304
|
"",
|
|
179
305
|
...formatNextSteps(["Change: `rig server use <alias|local>`", "List saved servers: `rig server list`"])
|
|
180
306
|
].join(`
|
|
@@ -219,13 +345,13 @@ async function promptForConnectionAlias(context) {
|
|
|
219
345
|
hint: connection.kind === "remote" ? connection.baseUrl : "local"
|
|
220
346
|
}))
|
|
221
347
|
].filter((option, index, all) => all.findIndex((candidate) => candidate.value === option.value) === index);
|
|
222
|
-
const answer = await
|
|
348
|
+
const answer = await droneSelect({
|
|
223
349
|
message: "Select Rig server for this repo",
|
|
224
350
|
initialValue: repo?.selected ?? "local",
|
|
225
351
|
options
|
|
226
352
|
});
|
|
227
|
-
if (
|
|
228
|
-
|
|
353
|
+
if (answer === null) {
|
|
354
|
+
droneCancel("No server selected.");
|
|
229
355
|
throw new CliError("No server selected.", 3);
|
|
230
356
|
}
|
|
231
357
|
return String(answer);
|
|
@@ -320,7 +320,9 @@ ${failure.contextLine}`, 1, { hint: failure.hint });
|
|
|
320
320
|
})() : null;
|
|
321
321
|
if (!response.ok) {
|
|
322
322
|
const diagnostics = diagnosticMessage(payload);
|
|
323
|
-
const
|
|
323
|
+
const rawDetail = diagnostics ?? (text || response.statusText);
|
|
324
|
+
const detail = diagnostics ? rawDetail : rawDetail.split(`
|
|
325
|
+
`).map((line) => line.trim()).find((line) => line.length > 0)?.slice(0, 200) ?? response.statusText;
|
|
324
326
|
const failure = await buildServerFailureContext(context.projectRoot, server);
|
|
325
327
|
throw new CliError(`Rig server request failed (${response.status}): ${detail}
|
|
326
328
|
${failure.contextLine}`, 1, { hint: failure.hint });
|
|
@@ -713,8 +715,79 @@ function createTtySpinner(input) {
|
|
|
713
715
|
};
|
|
714
716
|
}
|
|
715
717
|
|
|
718
|
+
// packages/cli/src/app/theme.ts
|
|
719
|
+
var RIG_PALETTE = {
|
|
720
|
+
ink: "#f2f3f6",
|
|
721
|
+
ink2: "#aeb0ba",
|
|
722
|
+
ink3: "#6c6e79",
|
|
723
|
+
ink4: "#44464f",
|
|
724
|
+
accent: "#ccff4d",
|
|
725
|
+
accentDim: "#a9d63f",
|
|
726
|
+
cyan: "#56d8ff",
|
|
727
|
+
red: "#ff5d5d",
|
|
728
|
+
yellow: "#ffd24d"
|
|
729
|
+
};
|
|
730
|
+
function hexToRgb(hex) {
|
|
731
|
+
const value = hex.replace("#", "");
|
|
732
|
+
return [
|
|
733
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
734
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
735
|
+
Number.parseInt(value.slice(4, 6), 16)
|
|
736
|
+
];
|
|
737
|
+
}
|
|
738
|
+
function fg(hex) {
|
|
739
|
+
const [r, g, b] = hexToRgb(hex);
|
|
740
|
+
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
|
|
741
|
+
}
|
|
742
|
+
var ink = fg(RIG_PALETTE.ink);
|
|
743
|
+
var ink2 = fg(RIG_PALETTE.ink2);
|
|
744
|
+
var ink3 = fg(RIG_PALETTE.ink3);
|
|
745
|
+
var ink4 = fg(RIG_PALETTE.ink4);
|
|
746
|
+
var accent = fg(RIG_PALETTE.accent);
|
|
747
|
+
var accentDim = fg(RIG_PALETTE.accentDim);
|
|
748
|
+
var cyan = fg(RIG_PALETTE.cyan);
|
|
749
|
+
var red = fg(RIG_PALETTE.red);
|
|
750
|
+
var yellow = fg(RIG_PALETTE.yellow);
|
|
751
|
+
function bold(text) {
|
|
752
|
+
return `\x1B[1m${text}\x1B[22m`;
|
|
753
|
+
}
|
|
754
|
+
var DRONE_ART = [
|
|
755
|
+
" .-=-. .-=-. ",
|
|
756
|
+
" ( !!! ) ( !!! ) ",
|
|
757
|
+
" '-=-'._ _.'-=-' ",
|
|
758
|
+
" '._ _.' ",
|
|
759
|
+
" '=$$$$$$$=.' ",
|
|
760
|
+
" =$$$$$$$$$$$= ",
|
|
761
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
762
|
+
" $$$@@ @@$$$ ",
|
|
763
|
+
" $$@ ? @$$$ ",
|
|
764
|
+
" $$$@ '-' @$$$ ",
|
|
765
|
+
" $$$@@ @@$$$ ",
|
|
766
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
767
|
+
" =$$$$$$$$$$$= ",
|
|
768
|
+
" '=$$$$$$$=.' ",
|
|
769
|
+
" _.' '._ ",
|
|
770
|
+
" .-=-.' '.-=-. ",
|
|
771
|
+
" ( !!! ) ( !!! ) ",
|
|
772
|
+
" '-=-' '-=-' "
|
|
773
|
+
];
|
|
774
|
+
var EYE_FRAMES = ["@", "o", "."];
|
|
775
|
+
var DRONE_WIDTH = DRONE_ART[0].length;
|
|
776
|
+
var DRONE_HEIGHT = DRONE_ART.length;
|
|
777
|
+
var MICRO_BLADES = ["---", "\\\\\\", "|||", "///"];
|
|
778
|
+
function microDroneFrame(tick) {
|
|
779
|
+
const blade = MICRO_BLADES[tick % MICRO_BLADES.length];
|
|
780
|
+
const eye = EYE_FRAMES[Math.floor(tick / 2) % EYE_FRAMES.length];
|
|
781
|
+
return `(${blade})${eye}(${blade})`;
|
|
782
|
+
}
|
|
783
|
+
var MICRO_DRONE_FRAMES = Array.from({ length: 12 }, (_, index) => microDroneFrame(index));
|
|
784
|
+
function renderMicroDroneFrame(tick) {
|
|
785
|
+
const blade = MICRO_BLADES[tick % MICRO_BLADES.length];
|
|
786
|
+
const eye = EYE_FRAMES[Math.floor(tick / 2) % EYE_FRAMES.length];
|
|
787
|
+
return `${ink4("(")}${cyan(blade)}${ink4(")")}${bold(accent(eye))}${ink4("(")}${cyan(blade)}${ink4(")")}`;
|
|
788
|
+
}
|
|
789
|
+
|
|
716
790
|
// packages/cli/src/commands/_async-ui.ts
|
|
717
|
-
var CLACK_SPINNER_FRAMES = ["\u25D2", "\u25D0", "\u25D3", "\u25D1"];
|
|
718
791
|
var DONE_SYMBOL = pc.green("\u25C7");
|
|
719
792
|
var FAIL_SYMBOL = pc.red("\u25A0");
|
|
720
793
|
var activeUpdate = null;
|
|
@@ -748,8 +821,8 @@ async function withSpinner(label, work, options = {}) {
|
|
|
748
821
|
const spinner = createTtySpinner({
|
|
749
822
|
label,
|
|
750
823
|
output,
|
|
751
|
-
frames:
|
|
752
|
-
styleFrame: (frame) =>
|
|
824
|
+
frames: MICRO_DRONE_FRAMES,
|
|
825
|
+
styleFrame: (frame) => renderMicroDroneFrame(Math.max(0, MICRO_DRONE_FRAMES.indexOf(frame)))
|
|
753
826
|
});
|
|
754
827
|
const update = (next) => {
|
|
755
828
|
lastLabel = next;
|
|
@@ -332,7 +332,9 @@ ${failure.contextLine}`, 1, { hint: failure.hint });
|
|
|
332
332
|
})() : null;
|
|
333
333
|
if (!response.ok) {
|
|
334
334
|
const diagnostics = diagnosticMessage(payload);
|
|
335
|
-
const
|
|
335
|
+
const rawDetail = diagnostics ?? (text || response.statusText);
|
|
336
|
+
const detail = diagnostics ? rawDetail : rawDetail.split(`
|
|
337
|
+
`).map((line) => line.trim()).find((line) => line.length > 0)?.slice(0, 200) ?? response.statusText;
|
|
336
338
|
const failure = await buildServerFailureContext(context.projectRoot, server);
|
|
337
339
|
throw new CliError(`Rig server request failed (${response.status}): ${detail}
|
|
338
340
|
${failure.contextLine}`, 1, { hint: failure.hint });
|
|
@@ -427,8 +429,79 @@ function createTtySpinner(input) {
|
|
|
427
429
|
};
|
|
428
430
|
}
|
|
429
431
|
|
|
432
|
+
// packages/cli/src/app/theme.ts
|
|
433
|
+
var RIG_PALETTE = {
|
|
434
|
+
ink: "#f2f3f6",
|
|
435
|
+
ink2: "#aeb0ba",
|
|
436
|
+
ink3: "#6c6e79",
|
|
437
|
+
ink4: "#44464f",
|
|
438
|
+
accent: "#ccff4d",
|
|
439
|
+
accentDim: "#a9d63f",
|
|
440
|
+
cyan: "#56d8ff",
|
|
441
|
+
red: "#ff5d5d",
|
|
442
|
+
yellow: "#ffd24d"
|
|
443
|
+
};
|
|
444
|
+
function hexToRgb(hex) {
|
|
445
|
+
const value = hex.replace("#", "");
|
|
446
|
+
return [
|
|
447
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
448
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
449
|
+
Number.parseInt(value.slice(4, 6), 16)
|
|
450
|
+
];
|
|
451
|
+
}
|
|
452
|
+
function fg(hex) {
|
|
453
|
+
const [r, g, b] = hexToRgb(hex);
|
|
454
|
+
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
|
|
455
|
+
}
|
|
456
|
+
var ink = fg(RIG_PALETTE.ink);
|
|
457
|
+
var ink2 = fg(RIG_PALETTE.ink2);
|
|
458
|
+
var ink3 = fg(RIG_PALETTE.ink3);
|
|
459
|
+
var ink4 = fg(RIG_PALETTE.ink4);
|
|
460
|
+
var accent = fg(RIG_PALETTE.accent);
|
|
461
|
+
var accentDim = fg(RIG_PALETTE.accentDim);
|
|
462
|
+
var cyan = fg(RIG_PALETTE.cyan);
|
|
463
|
+
var red = fg(RIG_PALETTE.red);
|
|
464
|
+
var yellow = fg(RIG_PALETTE.yellow);
|
|
465
|
+
function bold(text) {
|
|
466
|
+
return `\x1B[1m${text}\x1B[22m`;
|
|
467
|
+
}
|
|
468
|
+
var DRONE_ART = [
|
|
469
|
+
" .-=-. .-=-. ",
|
|
470
|
+
" ( !!! ) ( !!! ) ",
|
|
471
|
+
" '-=-'._ _.'-=-' ",
|
|
472
|
+
" '._ _.' ",
|
|
473
|
+
" '=$$$$$$$=.' ",
|
|
474
|
+
" =$$$$$$$$$$$= ",
|
|
475
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
476
|
+
" $$$@@ @@$$$ ",
|
|
477
|
+
" $$@ ? @$$$ ",
|
|
478
|
+
" $$$@ '-' @$$$ ",
|
|
479
|
+
" $$$@@ @@$$$ ",
|
|
480
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
481
|
+
" =$$$$$$$$$$$= ",
|
|
482
|
+
" '=$$$$$$$=.' ",
|
|
483
|
+
" _.' '._ ",
|
|
484
|
+
" .-=-.' '.-=-. ",
|
|
485
|
+
" ( !!! ) ( !!! ) ",
|
|
486
|
+
" '-=-' '-=-' "
|
|
487
|
+
];
|
|
488
|
+
var EYE_FRAMES = ["@", "o", "."];
|
|
489
|
+
var DRONE_WIDTH = DRONE_ART[0].length;
|
|
490
|
+
var DRONE_HEIGHT = DRONE_ART.length;
|
|
491
|
+
var MICRO_BLADES = ["---", "\\\\\\", "|||", "///"];
|
|
492
|
+
function microDroneFrame(tick) {
|
|
493
|
+
const blade = MICRO_BLADES[tick % MICRO_BLADES.length];
|
|
494
|
+
const eye = EYE_FRAMES[Math.floor(tick / 2) % EYE_FRAMES.length];
|
|
495
|
+
return `(${blade})${eye}(${blade})`;
|
|
496
|
+
}
|
|
497
|
+
var MICRO_DRONE_FRAMES = Array.from({ length: 12 }, (_, index) => microDroneFrame(index));
|
|
498
|
+
function renderMicroDroneFrame(tick) {
|
|
499
|
+
const blade = MICRO_BLADES[tick % MICRO_BLADES.length];
|
|
500
|
+
const eye = EYE_FRAMES[Math.floor(tick / 2) % EYE_FRAMES.length];
|
|
501
|
+
return `${ink4("(")}${cyan(blade)}${ink4(")")}${bold(accent(eye))}${ink4("(")}${cyan(blade)}${ink4(")")}`;
|
|
502
|
+
}
|
|
503
|
+
|
|
430
504
|
// packages/cli/src/commands/_async-ui.ts
|
|
431
|
-
var CLACK_SPINNER_FRAMES = ["\u25D2", "\u25D0", "\u25D3", "\u25D1"];
|
|
432
505
|
var DONE_SYMBOL = pc.green("\u25C7");
|
|
433
506
|
var FAIL_SYMBOL = pc.red("\u25A0");
|
|
434
507
|
var activeUpdate = null;
|
|
@@ -462,8 +535,8 @@ async function withSpinner(label, work, options = {}) {
|
|
|
462
535
|
const spinner = createTtySpinner({
|
|
463
536
|
label,
|
|
464
537
|
output,
|
|
465
|
-
frames:
|
|
466
|
-
styleFrame: (frame) =>
|
|
538
|
+
frames: MICRO_DRONE_FRAMES,
|
|
539
|
+
styleFrame: (frame) => renderMicroDroneFrame(Math.max(0, MICRO_DRONE_FRAMES.indexOf(frame)))
|
|
467
540
|
});
|
|
468
541
|
const update = (next) => {
|
|
469
542
|
lastLabel = next;
|