ralphctl 0.2.4 → 0.3.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 +21 -9
- package/dist/add-GX7P7XTT.mjs +16 -0
- package/dist/add-JGUOR4Z5.mjs +18 -0
- package/dist/bootstrap-FMHG6DRY.mjs +11 -0
- package/dist/chunk-3QBEBKMZ.mjs +103 -0
- package/dist/chunk-4GHVNKLV.mjs +5088 -0
- package/dist/{chunk-EDJX7TT6.mjs → chunk-57UWLHRH.mjs} +22 -2
- package/dist/chunk-747KW2RW.mjs +24 -0
- package/dist/chunk-CDOPLXFK.mjs +5485 -0
- package/dist/{chunk-7TG3EAQ2.mjs → chunk-CFUVE2BP.mjs} +1 -5
- package/dist/{chunk-IB6OCKZW.mjs → chunk-CTP2A436.mjs} +60 -55
- package/dist/{chunk-UBPZHHCD.mjs → chunk-D2YGPLIV.mjs} +84 -41
- package/dist/{chunk-QBXHAXHI.mjs → chunk-FKMKOWLA.mjs} +154 -208
- package/dist/chunk-HL4ZMHCQ.mjs +261 -0
- package/dist/{chunk-OEUJDSHY.mjs → chunk-IWXBJD2D.mjs} +1 -1
- package/dist/chunk-JXMHLW42.mjs +227 -0
- package/dist/{chunk-EUNAUHC3.mjs → chunk-NUYQK5MN.mjs} +80 -29
- package/dist/{chunk-JRFOUFD3.mjs → chunk-YCDUVPRT.mjs} +32 -52
- package/dist/cli.mjs +168 -3978
- package/dist/create-7WFSCMP4.mjs +15 -0
- package/dist/{handle-TA4MYNQJ.mjs → handle-BBAZJ44Y.mjs} +2 -2
- package/dist/mount-XZPBDRPZ.mjs +6751 -0
- package/dist/{project-YONEJICR.mjs → project-2IE7VWDB.mjs} +9 -5
- package/dist/prompts/harness-context.md +5 -0
- package/dist/prompts/ideate-auto.md +34 -19
- package/dist/prompts/ideate.md +21 -4
- package/dist/prompts/plan-auto.md +19 -24
- package/dist/prompts/plan-common.md +42 -17
- package/dist/prompts/plan-interactive.md +16 -21
- package/dist/prompts/signals-evaluation.md +6 -0
- package/dist/prompts/signals-planning.md +5 -0
- package/dist/prompts/signals-task.md +7 -0
- package/dist/prompts/sprint-feedback.md +48 -0
- package/dist/prompts/task-evaluation-resume.md +27 -13
- package/dist/prompts/task-evaluation.md +44 -34
- package/dist/prompts/task-execution.md +46 -46
- package/dist/prompts/ticket-refine.md +6 -5
- package/dist/prompts/validation-checklist.md +14 -0
- package/dist/{resolver-RXEY6EJE.mjs → resolver-EOE5WUMV.mjs} +5 -5
- package/dist/{sprint-FGLWYWKX.mjs → sprint-OGOFEJJH.mjs} +7 -9
- package/dist/start-MMWC7QLI.mjs +17 -0
- package/package.json +15 -13
- package/dist/add-3T225IX5.mjs +0 -16
- package/dist/add-6A5432U2.mjs +0 -16
- package/dist/chunk-742XQ7FL.mjs +0 -551
- package/dist/chunk-7LZ6GOGN.mjs +0 -53
- package/dist/chunk-DUU5346E.mjs +0 -59
- package/dist/chunk-U62BX47C.mjs +0 -4231
- package/dist/create-MYGOWO2F.mjs +0 -12
- package/dist/multiline-OHSNFCRG.mjs +0 -40
- package/dist/wizard-HWOH2HPV.mjs +0 -193
- package/schemas/config.schema.json +0 -30
- package/schemas/ideate-output.schema.json +0 -22
- package/schemas/projects.schema.json +0 -58
- package/schemas/requirements-output.schema.json +0 -24
- package/schemas/sprint.schema.json +0 -109
- package/schemas/task-import.schema.json +0 -56
- package/schemas/tasks.schema.json +0 -98
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// src/theme/
|
|
4
|
-
import { bold, cyan,
|
|
3
|
+
// src/integration/ui/theme/theme.ts
|
|
4
|
+
import { bold, cyan, gray, green, red, yellow } from "colorette";
|
|
5
5
|
import gradient from "gradient-string";
|
|
6
|
-
import {
|
|
6
|
+
import { isColorSupported } from "colorette";
|
|
7
|
+
var emoji = {
|
|
8
|
+
donut: "\u{1F369}"
|
|
9
|
+
};
|
|
7
10
|
var colors = {
|
|
8
11
|
// Semantic colors
|
|
9
12
|
success: green,
|
|
@@ -12,18 +15,11 @@ var colors = {
|
|
|
12
15
|
info: cyan,
|
|
13
16
|
muted: gray,
|
|
14
17
|
highlight: yellow,
|
|
15
|
-
accent: bold
|
|
16
|
-
subtle: dim,
|
|
17
|
-
// Ralph-specific
|
|
18
|
-
primary: yellow,
|
|
19
|
-
secondary: magenta
|
|
18
|
+
accent: bold
|
|
20
19
|
};
|
|
21
20
|
var success = (text) => colors.success(text);
|
|
22
21
|
var error = (text) => colors.error(text);
|
|
23
|
-
var warning = (text) => colors.warning(text);
|
|
24
|
-
var info = (text) => colors.info(text);
|
|
25
22
|
var muted = (text) => colors.muted(text);
|
|
26
|
-
var highlight = (text) => colors.highlight(text);
|
|
27
23
|
var gradients = {
|
|
28
24
|
/** Gold → Orange → Hot Pink → Orchid → Violet (Ralph's signature donut warmth) */
|
|
29
25
|
donut: gradient(["#FFD700", "#FFA500", "#FF69B4", "#DA70D6", "#9400D3"], {
|
|
@@ -137,20 +133,13 @@ function getStatusEmoji(status) {
|
|
|
137
133
|
return status;
|
|
138
134
|
}
|
|
139
135
|
|
|
140
|
-
// src/theme/ui.ts
|
|
141
|
-
import ora from "ora";
|
|
142
|
-
var emoji = {
|
|
143
|
-
donut: "\u{1F369}"
|
|
144
|
-
};
|
|
136
|
+
// src/integration/ui/theme/ui.ts
|
|
145
137
|
var icons = {
|
|
146
|
-
// Entities
|
|
147
138
|
sprint: ">",
|
|
148
139
|
ticket: "#",
|
|
149
140
|
task: "*",
|
|
150
141
|
project: "@",
|
|
151
|
-
// Actions
|
|
152
142
|
edit: ">",
|
|
153
|
-
// Status indicators
|
|
154
143
|
success: "+",
|
|
155
144
|
error: "x",
|
|
156
145
|
warning: "!",
|
|
@@ -162,47 +151,34 @@ var icons = {
|
|
|
162
151
|
};
|
|
163
152
|
var INDENT = " ";
|
|
164
153
|
var log = {
|
|
165
|
-
/** Info message with icon */
|
|
166
154
|
info(message) {
|
|
167
155
|
console.log(`${INDENT}${colors.info(icons.info)} ${message}`);
|
|
168
156
|
},
|
|
169
|
-
/** Success message with icon */
|
|
170
157
|
success(message) {
|
|
171
158
|
console.log(`${INDENT}${colors.success(icons.success)} ${message}`);
|
|
172
159
|
},
|
|
173
|
-
/** Warning message with icon */
|
|
174
160
|
warn(message) {
|
|
175
161
|
console.log(`${INDENT}${colors.warning(icons.warning)} ${message}`);
|
|
176
162
|
},
|
|
177
|
-
/** Error message with icon */
|
|
178
163
|
error(message) {
|
|
179
164
|
console.log(`${INDENT}${colors.error(icons.error)} ${message}`);
|
|
180
165
|
},
|
|
181
|
-
/** Dimmed/muted message */
|
|
182
166
|
dim(message) {
|
|
183
167
|
console.log(`${INDENT}${colors.muted(message)}`);
|
|
184
168
|
},
|
|
185
|
-
/** List item with bullet */
|
|
186
169
|
item(message) {
|
|
187
170
|
console.log(`${INDENT}${INDENT}${colors.muted(icons.bullet)} ${message}`);
|
|
188
171
|
},
|
|
189
|
-
/** Success list item */
|
|
190
172
|
itemSuccess(message) {
|
|
191
173
|
console.log(`${INDENT}${INDENT}${colors.success(icons.success)} ${message}`);
|
|
192
174
|
},
|
|
193
|
-
/** Error list item */
|
|
194
175
|
itemError(message, detail) {
|
|
195
176
|
console.log(`${INDENT}${INDENT}${colors.error(icons.error)} ${message}`);
|
|
196
|
-
if (detail) {
|
|
197
|
-
console.log(`${INDENT}${INDENT} ${colors.muted(detail)}`);
|
|
198
|
-
}
|
|
177
|
+
if (detail) console.log(`${INDENT}${INDENT} ${colors.muted(detail)}`);
|
|
199
178
|
},
|
|
200
|
-
/** Raw text with indent */
|
|
201
179
|
raw(message, indentLevel = 1) {
|
|
202
|
-
|
|
203
|
-
console.log(`${prefix}${message}`);
|
|
180
|
+
console.log(`${INDENT.repeat(indentLevel)}${message}`);
|
|
204
181
|
},
|
|
205
|
-
/** Newline for spacing */
|
|
206
182
|
newline() {
|
|
207
183
|
console.log("");
|
|
208
184
|
}
|
|
@@ -217,8 +193,130 @@ function printHeader(title, icon) {
|
|
|
217
193
|
function printSeparator(width = 40) {
|
|
218
194
|
console.log(`${INDENT}${colors.muted("\u2500".repeat(width))}`);
|
|
219
195
|
}
|
|
196
|
+
function showSuccess(message, details) {
|
|
197
|
+
console.log(`
|
|
198
|
+
${INDENT}${colors.success(icons.success)} ${colors.success(message)}`);
|
|
199
|
+
if (details) {
|
|
200
|
+
console.log(details.map(([label, value]) => field(label, value)).join("\n"));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function showError(message) {
|
|
204
|
+
console.log(`
|
|
205
|
+
${INDENT}${colors.error(icons.error)} ${colors.error(message)}`);
|
|
206
|
+
}
|
|
207
|
+
function showWarning(message) {
|
|
208
|
+
console.log(`${INDENT}${colors.warning(icons.warning)} ${colors.warning(message)}`);
|
|
209
|
+
}
|
|
210
|
+
function showTip(message) {
|
|
211
|
+
console.log(`${INDENT}${colors.muted(icons.tip + " " + message)}`);
|
|
212
|
+
}
|
|
213
|
+
function showEmpty(what, hint) {
|
|
214
|
+
console.log(`
|
|
215
|
+
${INDENT}${colors.muted(icons.inactive)} ${colors.muted(`No ${what} yet.`)}`);
|
|
216
|
+
if (hint) {
|
|
217
|
+
console.log(`${INDENT} ${colors.muted(icons.tip + " " + hint)}
|
|
218
|
+
`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function showNextStep(command, description) {
|
|
222
|
+
const desc = description ? ` ${colors.muted("- " + description)}` : "";
|
|
223
|
+
console.log(`${INDENT}${colors.muted("\u2192")} ${colors.highlight(command)}${desc}`);
|
|
224
|
+
}
|
|
225
|
+
function showNextSteps(steps) {
|
|
226
|
+
for (const [command, description] of steps) showNextStep(command, description);
|
|
227
|
+
}
|
|
228
|
+
function showRandomQuote() {
|
|
229
|
+
console.log(colors.muted(` "${getRandomQuote()}"`));
|
|
230
|
+
}
|
|
231
|
+
function printCountSummary(label, done, total) {
|
|
232
|
+
const percent = total > 0 ? Math.round(done / total * 100) : 0;
|
|
233
|
+
const color = percent === 100 ? colors.success : percent > 50 ? colors.warning : colors.muted;
|
|
234
|
+
printSeparator();
|
|
235
|
+
console.log(`${INDENT}${label} ${color(`${String(done)}/${String(total)} (${String(percent)}%)`)}`);
|
|
236
|
+
}
|
|
237
|
+
function getBannerText() {
|
|
238
|
+
const art = isColorSupported ? gradients.donut.multiline(banner.art) : banner.art;
|
|
239
|
+
const quote = getRandomQuote();
|
|
240
|
+
return `${art}
|
|
241
|
+
${colors.muted(`"${quote}"`)}
|
|
242
|
+
`;
|
|
243
|
+
}
|
|
244
|
+
function printBanner() {
|
|
245
|
+
console.log(getBannerText());
|
|
246
|
+
}
|
|
247
|
+
function isTTY() {
|
|
248
|
+
if (!process.stdout.isTTY || process.env["NO_COLOR"]) return false;
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
function terminalBell() {
|
|
252
|
+
if (isTTY()) process.stdout.write("\x07");
|
|
253
|
+
}
|
|
254
|
+
function createSpinner(text) {
|
|
255
|
+
let started = false;
|
|
256
|
+
const shim = {
|
|
257
|
+
text,
|
|
258
|
+
start() {
|
|
259
|
+
if (!started && isTTY()) {
|
|
260
|
+
console.log(`${INDENT}${colors.muted("\u2022")} ${shim.text}`);
|
|
261
|
+
}
|
|
262
|
+
started = true;
|
|
263
|
+
return shim;
|
|
264
|
+
},
|
|
265
|
+
stop() {
|
|
266
|
+
return shim;
|
|
267
|
+
},
|
|
268
|
+
succeed(msg) {
|
|
269
|
+
console.log(`${INDENT}${colors.success("+")} ${msg ?? shim.text}`);
|
|
270
|
+
return shim;
|
|
271
|
+
},
|
|
272
|
+
fail(msg) {
|
|
273
|
+
console.error(`${INDENT}${colors.error("x")} ${msg ?? shim.text}`);
|
|
274
|
+
return shim;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
return shim;
|
|
278
|
+
}
|
|
279
|
+
function field(label, value, labelWidth = 12) {
|
|
280
|
+
const paddedLabel = (label + ":").padEnd(labelWidth);
|
|
281
|
+
return `${INDENT}${colors.muted(paddedLabel)} ${value}`;
|
|
282
|
+
}
|
|
283
|
+
function fieldMultiline(label, value, labelWidth = 12) {
|
|
284
|
+
const lines = value.split("\n");
|
|
285
|
+
const paddedLabel = (label + ":").padEnd(labelWidth);
|
|
286
|
+
const indent = INDENT + " ".repeat(labelWidth + 1);
|
|
287
|
+
if (lines.length === 1) return `${INDENT}${colors.muted(paddedLabel)} ${value}`;
|
|
288
|
+
const firstLine = lines[0] ?? "";
|
|
289
|
+
const result = [`${INDENT}${colors.muted(paddedLabel)} ${firstLine}`];
|
|
290
|
+
for (let i = 1; i < lines.length; i++) result.push(`${indent}${lines[i] ?? ""}`);
|
|
291
|
+
return result.join("\n");
|
|
292
|
+
}
|
|
293
|
+
function labelValue(label, value, labelWidth = DETAIL_LABEL_WIDTH) {
|
|
294
|
+
return field(label, value, labelWidth).trimStart();
|
|
295
|
+
}
|
|
296
|
+
function formatTaskStatus(status) {
|
|
297
|
+
const e = getStatusEmoji(status);
|
|
298
|
+
const labels = { todo: "To Do", in_progress: "In Progress", done: "Done" };
|
|
299
|
+
const statusColors = {
|
|
300
|
+
todo: colors.muted,
|
|
301
|
+
in_progress: colors.warning,
|
|
302
|
+
done: colors.success
|
|
303
|
+
};
|
|
304
|
+
return (statusColors[status] ?? colors.muted)(`${e} ${labels[status] ?? status}`);
|
|
305
|
+
}
|
|
306
|
+
function formatSprintStatus(status) {
|
|
307
|
+
const e = getStatusEmoji(status);
|
|
308
|
+
const labels = { draft: "Draft", active: "Active", closed: "Closed" };
|
|
309
|
+
const statusColors = {
|
|
310
|
+
draft: colors.warning,
|
|
311
|
+
active: colors.success,
|
|
312
|
+
closed: colors.muted
|
|
313
|
+
};
|
|
314
|
+
return (statusColors[status] ?? colors.muted)(`${e} ${labels[status] ?? status}`);
|
|
315
|
+
}
|
|
316
|
+
function badge(text, type = "muted") {
|
|
317
|
+
return colors[type](`[${text}]`);
|
|
318
|
+
}
|
|
220
319
|
var boxChars = {
|
|
221
|
-
/** Light box-drawing (default) */
|
|
222
320
|
light: {
|
|
223
321
|
topLeft: "\u250C",
|
|
224
322
|
topRight: "\u2510",
|
|
@@ -232,7 +330,6 @@ var boxChars = {
|
|
|
232
330
|
teeUp: "\u2534",
|
|
233
331
|
cross: "\u253C"
|
|
234
332
|
},
|
|
235
|
-
/** Rounded corners */
|
|
236
333
|
rounded: {
|
|
237
334
|
topLeft: "\u256D",
|
|
238
335
|
topRight: "\u256E",
|
|
@@ -246,7 +343,6 @@ var boxChars = {
|
|
|
246
343
|
teeUp: "\u2534",
|
|
247
344
|
cross: "\u253C"
|
|
248
345
|
},
|
|
249
|
-
/** Heavy box-drawing */
|
|
250
346
|
heavy: {
|
|
251
347
|
topLeft: "\u250F",
|
|
252
348
|
topRight: "\u2513",
|
|
@@ -270,6 +366,7 @@ function sanitizeForDisplay(s) {
|
|
|
270
366
|
}
|
|
271
367
|
var MIN_BOX_WIDTH = 20;
|
|
272
368
|
var DEFAULT_TERMINAL_WIDTH = 80;
|
|
369
|
+
var DETAIL_LABEL_WIDTH = 14;
|
|
273
370
|
function getTerminalWidth() {
|
|
274
371
|
return process.stdout.columns || DEFAULT_TERMINAL_WIDTH;
|
|
275
372
|
}
|
|
@@ -288,20 +385,15 @@ function wrapLine(line, maxWidth) {
|
|
|
288
385
|
if (current.length + word.length <= wrapWidth) {
|
|
289
386
|
current += word;
|
|
290
387
|
} else if (current.length === 0) {
|
|
291
|
-
for (let i = 0; i < word.length; i += wrapWidth)
|
|
292
|
-
wrapped.push(indent + word.slice(i, i + wrapWidth));
|
|
293
|
-
}
|
|
388
|
+
for (let i = 0; i < word.length; i += wrapWidth) wrapped.push(indent + word.slice(i, i + wrapWidth));
|
|
294
389
|
} else {
|
|
295
390
|
wrapped.push(indent + current.trimEnd());
|
|
296
391
|
current = word.trimStart();
|
|
297
392
|
}
|
|
298
393
|
}
|
|
299
|
-
if (current.trimEnd().length > 0)
|
|
300
|
-
wrapped.push(indent + current.trimEnd());
|
|
301
|
-
}
|
|
394
|
+
if (current.trimEnd().length > 0) wrapped.push(indent + current.trimEnd());
|
|
302
395
|
return wrapped.length > 0 ? wrapped : [line];
|
|
303
396
|
}
|
|
304
|
-
var DETAIL_LABEL_WIDTH = 14;
|
|
305
397
|
function horizontalLine(width, style = "light") {
|
|
306
398
|
return boxChars[style].horizontal.repeat(width);
|
|
307
399
|
}
|
|
@@ -328,148 +420,6 @@ function renderCard(title, lines, options = {}) {
|
|
|
328
420
|
result.push(colorFn(chars.bottomLeft + chars.horizontal.repeat(innerWidth) + chars.bottomRight));
|
|
329
421
|
return result.join("\n");
|
|
330
422
|
}
|
|
331
|
-
function showBanner() {
|
|
332
|
-
if (isColorSupported) {
|
|
333
|
-
console.log(gradients.donut.multiline(banner.art));
|
|
334
|
-
} else {
|
|
335
|
-
console.log(banner.art);
|
|
336
|
-
}
|
|
337
|
-
const quote = getRandomQuote();
|
|
338
|
-
console.log(colors.muted(` "${quote}"
|
|
339
|
-
`));
|
|
340
|
-
}
|
|
341
|
-
function field(label, value, labelWidth = 12) {
|
|
342
|
-
const paddedLabel = (label + ":").padEnd(labelWidth);
|
|
343
|
-
return `${INDENT}${colors.muted(paddedLabel)} ${value}`;
|
|
344
|
-
}
|
|
345
|
-
function labelValue(label, value, labelWidth = DETAIL_LABEL_WIDTH) {
|
|
346
|
-
return field(label, value, labelWidth).trimStart();
|
|
347
|
-
}
|
|
348
|
-
function fieldMultiline(label, value, labelWidth = 12) {
|
|
349
|
-
const lines = value.split("\n");
|
|
350
|
-
const paddedLabel = (label + ":").padEnd(labelWidth);
|
|
351
|
-
const indent = INDENT + " ".repeat(labelWidth + 1);
|
|
352
|
-
if (lines.length === 1) {
|
|
353
|
-
return `${INDENT}${colors.muted(paddedLabel)} ${value}`;
|
|
354
|
-
}
|
|
355
|
-
const firstLine = lines[0] ?? "";
|
|
356
|
-
const result = [];
|
|
357
|
-
result.push(`${INDENT}${colors.muted(paddedLabel)} ${firstLine}`);
|
|
358
|
-
for (let i = 1; i < lines.length; i++) {
|
|
359
|
-
const line = lines[i] ?? "";
|
|
360
|
-
result.push(`${indent}${line}`);
|
|
361
|
-
}
|
|
362
|
-
return result.join("\n");
|
|
363
|
-
}
|
|
364
|
-
function formatTaskStatus(status) {
|
|
365
|
-
const emoji2 = getStatusEmoji(status);
|
|
366
|
-
const labels = {
|
|
367
|
-
todo: "To Do",
|
|
368
|
-
in_progress: "In Progress",
|
|
369
|
-
done: "Done"
|
|
370
|
-
};
|
|
371
|
-
const statusColors = {
|
|
372
|
-
todo: colors.muted,
|
|
373
|
-
in_progress: colors.warning,
|
|
374
|
-
done: colors.success
|
|
375
|
-
};
|
|
376
|
-
const colorFn = statusColors[status] ?? colors.muted;
|
|
377
|
-
return colorFn(`${emoji2} ${labels[status] ?? status}`);
|
|
378
|
-
}
|
|
379
|
-
function formatSprintStatus(status) {
|
|
380
|
-
const emoji2 = getStatusEmoji(status);
|
|
381
|
-
const labels = {
|
|
382
|
-
draft: "Draft",
|
|
383
|
-
active: "Active",
|
|
384
|
-
closed: "Closed"
|
|
385
|
-
};
|
|
386
|
-
const statusColors = {
|
|
387
|
-
draft: colors.warning,
|
|
388
|
-
active: colors.success,
|
|
389
|
-
closed: colors.muted
|
|
390
|
-
};
|
|
391
|
-
const colorFn = statusColors[status] ?? colors.muted;
|
|
392
|
-
return colorFn(`${emoji2} ${labels[status] ?? status}`);
|
|
393
|
-
}
|
|
394
|
-
function badge(text, type = "muted") {
|
|
395
|
-
const colorFn = colors[type];
|
|
396
|
-
return colorFn(`[${text}]`);
|
|
397
|
-
}
|
|
398
|
-
function printCountSummary(label, done, total) {
|
|
399
|
-
const percent = total > 0 ? Math.round(done / total * 100) : 0;
|
|
400
|
-
const color = percent === 100 ? colors.success : percent > 50 ? colors.warning : colors.muted;
|
|
401
|
-
printSeparator();
|
|
402
|
-
console.log(`${INDENT}${label} ${color(`${String(done)}/${String(total)} (${String(percent)}%)`)}`);
|
|
403
|
-
}
|
|
404
|
-
function showSuccess(message, details) {
|
|
405
|
-
console.log(`
|
|
406
|
-
${INDENT}${colors.success(icons.success)} ${colors.success(message)}`);
|
|
407
|
-
if (details) {
|
|
408
|
-
console.log(details.map(([label, value]) => field(label, value)).join("\n"));
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function showError(message) {
|
|
412
|
-
console.log(`
|
|
413
|
-
${INDENT}${colors.error(icons.error)} ${colors.error(message)}`);
|
|
414
|
-
}
|
|
415
|
-
function showInfo(message) {
|
|
416
|
-
console.log(`${INDENT}${colors.info(icons.info)} ${colors.info(message)}`);
|
|
417
|
-
}
|
|
418
|
-
function showWarning(message) {
|
|
419
|
-
console.log(`${INDENT}${colors.warning(icons.warning)} ${colors.warning(message)}`);
|
|
420
|
-
}
|
|
421
|
-
function showTip(message) {
|
|
422
|
-
console.log(`${INDENT}${colors.muted(icons.tip + " " + message)}`);
|
|
423
|
-
}
|
|
424
|
-
function showEmpty(what, hint) {
|
|
425
|
-
console.log(`
|
|
426
|
-
${INDENT}${colors.muted(icons.inactive)} ${colors.muted(`No ${what} yet.`)}`);
|
|
427
|
-
if (hint) {
|
|
428
|
-
console.log(`${INDENT} ${colors.muted(icons.tip + " " + hint)}
|
|
429
|
-
`);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
function showNextStep(command, description) {
|
|
433
|
-
const desc = description ? ` ${colors.muted("- " + description)}` : "";
|
|
434
|
-
console.log(`${INDENT}${colors.muted("\u2192")} ${colors.highlight(command)}${desc}`);
|
|
435
|
-
}
|
|
436
|
-
function showNextSteps(steps) {
|
|
437
|
-
for (const [command, description] of steps) {
|
|
438
|
-
showNextStep(command, description);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
function showRandomQuote() {
|
|
442
|
-
const quote = getRandomQuote();
|
|
443
|
-
console.log(colors.muted(` "${quote}"`));
|
|
444
|
-
}
|
|
445
|
-
function createSpinner(text) {
|
|
446
|
-
return ora({
|
|
447
|
-
text,
|
|
448
|
-
color: "yellow",
|
|
449
|
-
prefixText: INDENT,
|
|
450
|
-
// Disable stdin-discarder: it puts stdin in raw mode, which swallows
|
|
451
|
-
// Ctrl+C (byte 0x03) instead of letting the OS deliver a real SIGINT.
|
|
452
|
-
discardStdin: false,
|
|
453
|
-
spinner: {
|
|
454
|
-
interval: 80,
|
|
455
|
-
frames: Array(8).fill(emoji.donut).map((d, i) => i % 2 === 0 ? colors.highlight(d) : colors.muted(d))
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
function isTTY() {
|
|
460
|
-
if (!process.stdout.isTTY || process.env["NO_COLOR"]) return false;
|
|
461
|
-
return true;
|
|
462
|
-
}
|
|
463
|
-
function terminalBell() {
|
|
464
|
-
if (isTTY()) {
|
|
465
|
-
process.stdout.write("\x07");
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
function clearScreen() {
|
|
469
|
-
if (isTTY()) {
|
|
470
|
-
process.stdout.write("\x1B[2J\x1B[0f");
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
423
|
function progressBar(done, total, options = {}) {
|
|
474
424
|
const { width = 20, filled = "\u2588", empty = "\u2591", showPercent = true } = options;
|
|
475
425
|
if (total === 0 || width <= 0) return colors.muted("\u2500".repeat(Math.max(0, width)));
|
|
@@ -507,9 +457,7 @@ function renderTable(columns, rows, options = {}) {
|
|
|
507
457
|
const visibleLen = stripAnsi(cell).length;
|
|
508
458
|
const padding = Math.max(0, w - visibleLen);
|
|
509
459
|
const coloredCell = col.color ? col.color(cell) : cell;
|
|
510
|
-
if (col.align === "right")
|
|
511
|
-
return " " + " ".repeat(padding) + coloredCell + " ";
|
|
512
|
-
}
|
|
460
|
+
if (col.align === "right") return " " + " ".repeat(padding) + coloredCell + " ";
|
|
513
461
|
return " " + coloredCell + " ".repeat(padding) + " ";
|
|
514
462
|
});
|
|
515
463
|
result.push(pad + colorFn(chars.vertical) + cells.join(colorFn(chars.vertical)) + colorFn(chars.vertical));
|
|
@@ -520,43 +468,41 @@ function renderTable(columns, rows, options = {}) {
|
|
|
520
468
|
}
|
|
521
469
|
|
|
522
470
|
export {
|
|
471
|
+
emoji,
|
|
523
472
|
colors,
|
|
524
473
|
success,
|
|
525
474
|
error,
|
|
526
|
-
warning,
|
|
527
|
-
info,
|
|
528
475
|
muted,
|
|
529
|
-
|
|
476
|
+
gradients,
|
|
477
|
+
banner,
|
|
478
|
+
getRandomQuote,
|
|
530
479
|
getQuoteForContext,
|
|
531
|
-
emoji,
|
|
532
480
|
icons,
|
|
533
481
|
log,
|
|
534
482
|
printHeader,
|
|
535
483
|
printSeparator,
|
|
536
|
-
boxChars,
|
|
537
|
-
DETAIL_LABEL_WIDTH,
|
|
538
|
-
horizontalLine,
|
|
539
|
-
renderCard,
|
|
540
|
-
showBanner,
|
|
541
|
-
field,
|
|
542
|
-
labelValue,
|
|
543
|
-
fieldMultiline,
|
|
544
|
-
formatTaskStatus,
|
|
545
|
-
formatSprintStatus,
|
|
546
|
-
badge,
|
|
547
|
-
printCountSummary,
|
|
548
484
|
showSuccess,
|
|
549
485
|
showError,
|
|
550
|
-
showInfo,
|
|
551
486
|
showWarning,
|
|
552
487
|
showTip,
|
|
553
488
|
showEmpty,
|
|
554
489
|
showNextStep,
|
|
555
490
|
showNextSteps,
|
|
556
491
|
showRandomQuote,
|
|
557
|
-
|
|
492
|
+
printCountSummary,
|
|
493
|
+
printBanner,
|
|
558
494
|
terminalBell,
|
|
559
|
-
|
|
495
|
+
createSpinner,
|
|
496
|
+
field,
|
|
497
|
+
fieldMultiline,
|
|
498
|
+
labelValue,
|
|
499
|
+
formatTaskStatus,
|
|
500
|
+
formatSprintStatus,
|
|
501
|
+
badge,
|
|
502
|
+
boxChars,
|
|
503
|
+
DETAIL_LABEL_WIDTH,
|
|
504
|
+
horizontalLine,
|
|
505
|
+
renderCard,
|
|
560
506
|
progressBar,
|
|
561
507
|
renderTable
|
|
562
508
|
};
|