@h-rig/cli 0.0.6-alpha.75 → 0.0.6-alpha.77
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 +4632 -4200
- package/dist/src/commands/_cli-format.js +84 -24
- package/dist/src/commands/_operator-board.js +730 -0
- package/dist/src/commands/_server-client.js +14 -0
- package/dist/src/commands/_tui-theme.js +135 -0
- package/dist/src/commands/connect.js +74 -14
- package/dist/src/commands/inbox.js +73 -13
- package/dist/src/commands/run.js +76 -16
- package/dist/src/commands/server.js +74 -14
- package/dist/src/commands/stats.js +61 -2
- package/dist/src/commands/task.js +73 -13
- package/dist/src/commands.js +4639 -4207
- package/dist/src/index.js +4639 -4207
- package/package.json +8 -8
|
@@ -184,6 +184,66 @@ function writeRepoServerProjectRoot(projectRoot, serverProjectRoot) {
|
|
|
184
184
|
// packages/cli/src/commands/_cli-format.ts
|
|
185
185
|
import { log, note } from "@clack/prompts";
|
|
186
186
|
import pc from "picocolors";
|
|
187
|
+
|
|
188
|
+
// packages/cli/src/commands/_tui-theme.ts
|
|
189
|
+
var RIG_PALETTE = {
|
|
190
|
+
ink: "#f2f3f6",
|
|
191
|
+
ink2: "#aeb0ba",
|
|
192
|
+
ink3: "#6c6e79",
|
|
193
|
+
ink4: "#44464f",
|
|
194
|
+
accent: "#ccff4d",
|
|
195
|
+
accentDim: "#a9d63f",
|
|
196
|
+
cyan: "#56d8ff",
|
|
197
|
+
red: "#ff5d5d",
|
|
198
|
+
yellow: "#ffd24d"
|
|
199
|
+
};
|
|
200
|
+
function hexToRgb(hex) {
|
|
201
|
+
const value = hex.replace("#", "");
|
|
202
|
+
return [
|
|
203
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
204
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
205
|
+
Number.parseInt(value.slice(4, 6), 16)
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
function fg(hex) {
|
|
209
|
+
const [r, g, b] = hexToRgb(hex);
|
|
210
|
+
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
|
|
211
|
+
}
|
|
212
|
+
var ink = fg(RIG_PALETTE.ink);
|
|
213
|
+
var ink2 = fg(RIG_PALETTE.ink2);
|
|
214
|
+
var ink3 = fg(RIG_PALETTE.ink3);
|
|
215
|
+
var ink4 = fg(RIG_PALETTE.ink4);
|
|
216
|
+
var accent = fg(RIG_PALETTE.accent);
|
|
217
|
+
var accentDim = fg(RIG_PALETTE.accentDim);
|
|
218
|
+
var cyan = fg(RIG_PALETTE.cyan);
|
|
219
|
+
var red = fg(RIG_PALETTE.red);
|
|
220
|
+
var yellow = fg(RIG_PALETTE.yellow);
|
|
221
|
+
var DRONE_ART = [
|
|
222
|
+
" .-=-. .-=-. ",
|
|
223
|
+
" ( !!! ) ( !!! ) ",
|
|
224
|
+
" '-=-'._ _.'-=-' ",
|
|
225
|
+
" '._ _.' ",
|
|
226
|
+
" '=$$$$$$$=.' ",
|
|
227
|
+
" =$$$$$$$$$$$= ",
|
|
228
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
229
|
+
" $$$@@ @@$$$ ",
|
|
230
|
+
" $$@ ? @$$$ ",
|
|
231
|
+
" $$$@ '-' @$$$ ",
|
|
232
|
+
" $$$@@ @@$$$ ",
|
|
233
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
234
|
+
" =$$$$$$$$$$$= ",
|
|
235
|
+
" '=$$$$$$$=.' ",
|
|
236
|
+
" _.' '._ ",
|
|
237
|
+
" .-=-.' '.-=-. ",
|
|
238
|
+
" ( !!! ) ( !!! ) ",
|
|
239
|
+
" '-=-' '-=-' "
|
|
240
|
+
];
|
|
241
|
+
var DRONE_WIDTH = DRONE_ART[0].length;
|
|
242
|
+
var DRONE_HEIGHT = DRONE_ART.length;
|
|
243
|
+
|
|
244
|
+
// packages/cli/src/commands/_cli-format.ts
|
|
245
|
+
var themeDim = (value) => ink3(value);
|
|
246
|
+
var themeFaint = (value) => ink4(value);
|
|
187
247
|
function truncate(value, width) {
|
|
188
248
|
if (value.length <= width)
|
|
189
249
|
return value;
|
|
@@ -196,32 +256,32 @@ function pad(value, width) {
|
|
|
196
256
|
}
|
|
197
257
|
function statusColor(status) {
|
|
198
258
|
const normalized = status.toLowerCase();
|
|
199
|
-
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved"].includes(normalized))
|
|
200
|
-
return
|
|
259
|
+
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved", "running"].includes(normalized))
|
|
260
|
+
return accent;
|
|
201
261
|
if (["failed", "needs_attention", "needs-attention", "blocked", "error", "rejected"].includes(normalized))
|
|
202
|
-
return
|
|
203
|
-
if (["
|
|
204
|
-
return
|
|
205
|
-
if (["ready", "open", "queued", "created", "
|
|
206
|
-
return
|
|
207
|
-
return
|
|
262
|
+
return red;
|
|
263
|
+
if (["reviewing", "validating", "in_progress", "in-progress", "remote", "preparing", "closing-out"].includes(normalized))
|
|
264
|
+
return cyan;
|
|
265
|
+
if (["ready", "open", "queued", "created", "local", "pending"].includes(normalized))
|
|
266
|
+
return yellow;
|
|
267
|
+
return themeDim;
|
|
208
268
|
}
|
|
209
269
|
function formatStatusPill(status) {
|
|
210
270
|
const label = status || "unknown";
|
|
211
271
|
return statusColor(label)(`\u25CF ${label}`);
|
|
212
272
|
}
|
|
213
273
|
function formatSection(title, subtitle) {
|
|
214
|
-
return `${pc.bold(
|
|
274
|
+
return `${pc.bold(accent("\u25C6"))} ${pc.bold(title)}${subtitle ? themeDim(` \u2014 ${subtitle}`) : ""}`;
|
|
215
275
|
}
|
|
216
276
|
function formatSuccessCard(title, rows = []) {
|
|
217
|
-
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${
|
|
277
|
+
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${themeFaint("\u2502")} ${themeDim(key.padEnd(12))} ${value}`);
|
|
218
278
|
return [formatSection(title), ...body].join(`
|
|
219
279
|
`);
|
|
220
280
|
}
|
|
221
281
|
function formatNextSteps(steps) {
|
|
222
282
|
if (steps.length === 0)
|
|
223
283
|
return [];
|
|
224
|
-
return [pc.bold("Next"), ...steps.map((step) => `${
|
|
284
|
+
return [pc.bold("Next"), ...steps.map((step) => `${accent("\u203A")} ${step}`)];
|
|
225
285
|
}
|
|
226
286
|
function formatConnectionList(connections) {
|
|
227
287
|
const rows = [["local", { kind: "local", mode: "auto" }], ...Object.entries(connections)];
|
|
@@ -239,9 +299,9 @@ function formatConnectionStatus(selected, connections) {
|
|
|
239
299
|
const target = !connection ? "not configured" : connection.kind === "remote" ? connection.baseUrl : "local";
|
|
240
300
|
return [
|
|
241
301
|
formatSection("Rig server", "selected for this repo"),
|
|
242
|
-
`${
|
|
243
|
-
`${
|
|
244
|
-
`${
|
|
302
|
+
`${themeFaint("\u2502")} ${themeDim("selected ")} ${pc.bold(selected)}`,
|
|
303
|
+
`${themeFaint("\u2502")} ${themeDim("kind ")} ${formatStatusPill(connection?.kind ?? "unknown")}`,
|
|
304
|
+
`${themeFaint("\u2502")} ${themeDim("target ")} ${target ?? "not configured"}`,
|
|
245
305
|
"",
|
|
246
306
|
...formatNextSteps(["Change: `rig server use <alias|local>`", "List saved servers: `rig server list`"])
|
|
247
307
|
].join(`
|
|
@@ -364,6 +364,65 @@ var RESUMABLE_RUN_STATUSES = new Set([
|
|
|
364
364
|
// packages/cli/src/commands/_cli-format.ts
|
|
365
365
|
import { log, note } from "@clack/prompts";
|
|
366
366
|
import pc from "picocolors";
|
|
367
|
+
|
|
368
|
+
// packages/cli/src/commands/_tui-theme.ts
|
|
369
|
+
var RIG_PALETTE = {
|
|
370
|
+
ink: "#f2f3f6",
|
|
371
|
+
ink2: "#aeb0ba",
|
|
372
|
+
ink3: "#6c6e79",
|
|
373
|
+
ink4: "#44464f",
|
|
374
|
+
accent: "#ccff4d",
|
|
375
|
+
accentDim: "#a9d63f",
|
|
376
|
+
cyan: "#56d8ff",
|
|
377
|
+
red: "#ff5d5d",
|
|
378
|
+
yellow: "#ffd24d"
|
|
379
|
+
};
|
|
380
|
+
function hexToRgb(hex) {
|
|
381
|
+
const value = hex.replace("#", "");
|
|
382
|
+
return [
|
|
383
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
384
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
385
|
+
Number.parseInt(value.slice(4, 6), 16)
|
|
386
|
+
];
|
|
387
|
+
}
|
|
388
|
+
function fg(hex) {
|
|
389
|
+
const [r, g, b] = hexToRgb(hex);
|
|
390
|
+
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
|
|
391
|
+
}
|
|
392
|
+
var ink = fg(RIG_PALETTE.ink);
|
|
393
|
+
var ink2 = fg(RIG_PALETTE.ink2);
|
|
394
|
+
var ink3 = fg(RIG_PALETTE.ink3);
|
|
395
|
+
var ink4 = fg(RIG_PALETTE.ink4);
|
|
396
|
+
var accent = fg(RIG_PALETTE.accent);
|
|
397
|
+
var accentDim = fg(RIG_PALETTE.accentDim);
|
|
398
|
+
var cyan = fg(RIG_PALETTE.cyan);
|
|
399
|
+
var red = fg(RIG_PALETTE.red);
|
|
400
|
+
var yellow = fg(RIG_PALETTE.yellow);
|
|
401
|
+
var DRONE_ART = [
|
|
402
|
+
" .-=-. .-=-. ",
|
|
403
|
+
" ( !!! ) ( !!! ) ",
|
|
404
|
+
" '-=-'._ _.'-=-' ",
|
|
405
|
+
" '._ _.' ",
|
|
406
|
+
" '=$$$$$$$=.' ",
|
|
407
|
+
" =$$$$$$$$$$$= ",
|
|
408
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
409
|
+
" $$$@@ @@$$$ ",
|
|
410
|
+
" $$@ ? @$$$ ",
|
|
411
|
+
" $$$@ '-' @$$$ ",
|
|
412
|
+
" $$$@@ @@$$$ ",
|
|
413
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
414
|
+
" =$$$$$$$$$$$= ",
|
|
415
|
+
" '=$$$$$$$=.' ",
|
|
416
|
+
" _.' '._ ",
|
|
417
|
+
" .-=-.' '.-=-. ",
|
|
418
|
+
" ( !!! ) ( !!! ) ",
|
|
419
|
+
" '-=-' '-=-' "
|
|
420
|
+
];
|
|
421
|
+
var DRONE_WIDTH = DRONE_ART[0].length;
|
|
422
|
+
var DRONE_HEIGHT = DRONE_ART.length;
|
|
423
|
+
|
|
424
|
+
// packages/cli/src/commands/_cli-format.ts
|
|
425
|
+
var themeDim = (value) => ink3(value);
|
|
367
426
|
function shouldUseClackOutput() {
|
|
368
427
|
return Boolean(process.stdout.isTTY) && process.env.RIG_CLI_PLAIN_HELP !== "1";
|
|
369
428
|
}
|
|
@@ -378,12 +437,12 @@ function printFormattedOutput(message, options = {}) {
|
|
|
378
437
|
log.message(message);
|
|
379
438
|
}
|
|
380
439
|
function formatSection(title, subtitle) {
|
|
381
|
-
return `${pc.bold(
|
|
440
|
+
return `${pc.bold(accent("\u25C6"))} ${pc.bold(title)}${subtitle ? themeDim(` \u2014 ${subtitle}`) : ""}`;
|
|
382
441
|
}
|
|
383
442
|
function formatNextSteps(steps) {
|
|
384
443
|
if (steps.length === 0)
|
|
385
444
|
return [];
|
|
386
|
-
return [pc.bold("Next"), ...steps.map((step) => `${
|
|
445
|
+
return [pc.bold("Next"), ...steps.map((step) => `${accent("\u203A")} ${step}`)];
|
|
387
446
|
}
|
|
388
447
|
|
|
389
448
|
// packages/cli/src/commands/_async-ui.ts
|
|
@@ -1367,6 +1367,66 @@ async function attachRunOperatorView(context, input) {
|
|
|
1367
1367
|
// packages/cli/src/commands/_cli-format.ts
|
|
1368
1368
|
import { log, note } from "@clack/prompts";
|
|
1369
1369
|
import pc2 from "picocolors";
|
|
1370
|
+
|
|
1371
|
+
// packages/cli/src/commands/_tui-theme.ts
|
|
1372
|
+
var RIG_PALETTE = {
|
|
1373
|
+
ink: "#f2f3f6",
|
|
1374
|
+
ink2: "#aeb0ba",
|
|
1375
|
+
ink3: "#6c6e79",
|
|
1376
|
+
ink4: "#44464f",
|
|
1377
|
+
accent: "#ccff4d",
|
|
1378
|
+
accentDim: "#a9d63f",
|
|
1379
|
+
cyan: "#56d8ff",
|
|
1380
|
+
red: "#ff5d5d",
|
|
1381
|
+
yellow: "#ffd24d"
|
|
1382
|
+
};
|
|
1383
|
+
function hexToRgb(hex) {
|
|
1384
|
+
const value = hex.replace("#", "");
|
|
1385
|
+
return [
|
|
1386
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
1387
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
1388
|
+
Number.parseInt(value.slice(4, 6), 16)
|
|
1389
|
+
];
|
|
1390
|
+
}
|
|
1391
|
+
function fg(hex) {
|
|
1392
|
+
const [r, g, b] = hexToRgb(hex);
|
|
1393
|
+
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
|
|
1394
|
+
}
|
|
1395
|
+
var ink = fg(RIG_PALETTE.ink);
|
|
1396
|
+
var ink2 = fg(RIG_PALETTE.ink2);
|
|
1397
|
+
var ink3 = fg(RIG_PALETTE.ink3);
|
|
1398
|
+
var ink4 = fg(RIG_PALETTE.ink4);
|
|
1399
|
+
var accent = fg(RIG_PALETTE.accent);
|
|
1400
|
+
var accentDim = fg(RIG_PALETTE.accentDim);
|
|
1401
|
+
var cyan = fg(RIG_PALETTE.cyan);
|
|
1402
|
+
var red = fg(RIG_PALETTE.red);
|
|
1403
|
+
var yellow = fg(RIG_PALETTE.yellow);
|
|
1404
|
+
var DRONE_ART = [
|
|
1405
|
+
" .-=-. .-=-. ",
|
|
1406
|
+
" ( !!! ) ( !!! ) ",
|
|
1407
|
+
" '-=-'._ _.'-=-' ",
|
|
1408
|
+
" '._ _.' ",
|
|
1409
|
+
" '=$$$$$$$=.' ",
|
|
1410
|
+
" =$$$$$$$$$$$= ",
|
|
1411
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
1412
|
+
" $$$@@ @@$$$ ",
|
|
1413
|
+
" $$@ ? @$$$ ",
|
|
1414
|
+
" $$$@ '-' @$$$ ",
|
|
1415
|
+
" $$$@@ @@$$$ ",
|
|
1416
|
+
" $$$@@@@@@@@@@$$$ ",
|
|
1417
|
+
" =$$$$$$$$$$$= ",
|
|
1418
|
+
" '=$$$$$$$=.' ",
|
|
1419
|
+
" _.' '._ ",
|
|
1420
|
+
" .-=-.' '.-=-. ",
|
|
1421
|
+
" ( !!! ) ( !!! ) ",
|
|
1422
|
+
" '-=-' '-=-' "
|
|
1423
|
+
];
|
|
1424
|
+
var DRONE_WIDTH = DRONE_ART[0].length;
|
|
1425
|
+
var DRONE_HEIGHT = DRONE_ART.length;
|
|
1426
|
+
|
|
1427
|
+
// packages/cli/src/commands/_cli-format.ts
|
|
1428
|
+
var themeDim = (value) => ink3(value);
|
|
1429
|
+
var themeFaint = (value) => ink4(value);
|
|
1370
1430
|
function stringField(record, key, fallback = "") {
|
|
1371
1431
|
const value = record[key];
|
|
1372
1432
|
return typeof value === "string" && value.trim() ? value.trim() : fallback;
|
|
@@ -1395,15 +1455,15 @@ function pad(value, width) {
|
|
|
1395
1455
|
}
|
|
1396
1456
|
function statusColor(status) {
|
|
1397
1457
|
const normalized = status.toLowerCase();
|
|
1398
|
-
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved"].includes(normalized))
|
|
1399
|
-
return
|
|
1458
|
+
if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved", "running"].includes(normalized))
|
|
1459
|
+
return accent;
|
|
1400
1460
|
if (["failed", "needs_attention", "needs-attention", "blocked", "error", "rejected"].includes(normalized))
|
|
1401
|
-
return
|
|
1402
|
-
if (["
|
|
1403
|
-
return
|
|
1404
|
-
if (["ready", "open", "queued", "created", "
|
|
1405
|
-
return
|
|
1406
|
-
return
|
|
1461
|
+
return red;
|
|
1462
|
+
if (["reviewing", "validating", "in_progress", "in-progress", "remote", "preparing", "closing-out"].includes(normalized))
|
|
1463
|
+
return cyan;
|
|
1464
|
+
if (["ready", "open", "queued", "created", "local", "pending"].includes(normalized))
|
|
1465
|
+
return yellow;
|
|
1466
|
+
return themeDim;
|
|
1407
1467
|
}
|
|
1408
1468
|
function compactValue(value) {
|
|
1409
1469
|
if (value === null || value === undefined)
|
|
@@ -1434,17 +1494,17 @@ function formatStatusPill(status) {
|
|
|
1434
1494
|
return statusColor(label)(`\u25CF ${label}`);
|
|
1435
1495
|
}
|
|
1436
1496
|
function formatSection(title, subtitle) {
|
|
1437
|
-
return `${pc2.bold(
|
|
1497
|
+
return `${pc2.bold(accent("\u25C6"))} ${pc2.bold(title)}${subtitle ? themeDim(` \u2014 ${subtitle}`) : ""}`;
|
|
1438
1498
|
}
|
|
1439
1499
|
function formatSuccessCard(title, rows = []) {
|
|
1440
|
-
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${
|
|
1500
|
+
const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${themeFaint("\u2502")} ${themeDim(key.padEnd(12))} ${value}`);
|
|
1441
1501
|
return [formatSection(title), ...body].join(`
|
|
1442
1502
|
`);
|
|
1443
1503
|
}
|
|
1444
1504
|
function formatNextSteps(steps) {
|
|
1445
1505
|
if (steps.length === 0)
|
|
1446
1506
|
return [];
|
|
1447
|
-
return [pc2.bold("Next"), ...steps.map((step) => `${
|
|
1507
|
+
return [pc2.bold("Next"), ...steps.map((step) => `${accent("\u203A")} ${step}`)];
|
|
1448
1508
|
}
|
|
1449
1509
|
function formatTaskList(tasks, options = {}) {
|
|
1450
1510
|
if (options.raw)
|
|
@@ -1466,8 +1526,8 @@ function formatTaskList(tasks, options = {}) {
|
|
|
1466
1526
|
const statusWidth = Math.min(16, Math.max(6, ...rows.map((row) => row.status.length)));
|
|
1467
1527
|
const header = `${pc2.bold(pad("TASK", idWidth))} ${pc2.bold(pad("STATUS", statusWidth))} ${pc2.bold("TITLE")}`;
|
|
1468
1528
|
const body = rows.map((row) => {
|
|
1469
|
-
const labels = row.labels.length > 0 ?
|
|
1470
|
-
const source = row.source ?
|
|
1529
|
+
const labels = row.labels.length > 0 ? themeDim(` ${row.labels.slice(0, 4).map((label) => `#${label}`).join(" ")}`) : "";
|
|
1530
|
+
const source = row.source ? themeDim(` ${row.source}`) : "";
|
|
1471
1531
|
return [
|
|
1472
1532
|
pc2.bold(pad(truncate(row.id, idWidth), idWidth)),
|
|
1473
1533
|
statusColor(row.status)(pad(truncate(row.status, statusWidth), statusWidth)),
|