@h-rig/cli 0.0.6-alpha.76 → 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.
@@ -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 pc2.green;
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 pc2.red;
1402
- if (["running", "reviewing", "validating", "in_progress", "in-progress", "remote"].includes(normalized))
1403
- return pc2.cyan;
1404
- if (["ready", "open", "queued", "created", "preparing", "local", "pending"].includes(normalized))
1405
- return pc2.yellow;
1406
- return pc2.dim;
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(pc2.cyan("\u25C6"))} ${pc2.bold(title)}${subtitle ? pc2.dim(` \u2014 ${subtitle}`) : ""}`;
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]) => `${pc2.dim("\u2502")} ${pc2.dim(key.padEnd(12))} ${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) => `${pc2.dim("\u203A")} ${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 ? pc2.dim(` ${row.labels.slice(0, 4).map((label) => `#${label}`).join(" ")}`) : "";
1470
- const source = row.source ? pc2.dim(` ${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)),
@@ -929,6 +929,125 @@ var init__server_client = __esm(() => {
929
929
  ]);
930
930
  });
931
931
 
932
+ // packages/cli/src/commands/_tui-theme.ts
933
+ function hexToRgb(hex) {
934
+ const value = hex.replace("#", "");
935
+ return [
936
+ Number.parseInt(value.slice(0, 2), 16),
937
+ Number.parseInt(value.slice(2, 4), 16),
938
+ Number.parseInt(value.slice(4, 6), 16)
939
+ ];
940
+ }
941
+ function fg(hex) {
942
+ const [r, g, b] = hexToRgb(hex);
943
+ return (text2) => `\x1B[38;2;${r};${g};${b}m${text2}\x1B[39m`;
944
+ }
945
+ function bold(text2) {
946
+ return `\x1B[1m${text2}\x1B[22m`;
947
+ }
948
+ function statusColor(status) {
949
+ switch (status) {
950
+ case "running":
951
+ return accent;
952
+ case "preparing":
953
+ case "created":
954
+ case "validating":
955
+ case "reviewing":
956
+ case "closing-out":
957
+ return cyan;
958
+ case "needs-attention":
959
+ case "needs_attention":
960
+ return yellow;
961
+ case "failed":
962
+ return red;
963
+ default:
964
+ return ink3;
965
+ }
966
+ }
967
+ function droneCharColor(char) {
968
+ if (char === "$" || char === "@")
969
+ return accent;
970
+ if (char === "=" || char === "%")
971
+ return accentDim;
972
+ if (char === "\\" || char === "/")
973
+ return ink3;
974
+ return ink4;
975
+ }
976
+ function renderDroneFrame(tick) {
977
+ const blade = BLADE_FRAMES[Math.floor(tick / 4) % BLADE_FRAMES.length];
978
+ const pulse = Math.sin(tick * 0.07);
979
+ const eye = pulse > 0.45 ? EYE_FRAMES[0] : pulse > -0.1 ? EYE_FRAMES[1] : EYE_FRAMES[2];
980
+ return DRONE_ART.map((line) => {
981
+ let out = "";
982
+ let index = 0;
983
+ while (index < line.length) {
984
+ if (line.startsWith("!!!", index)) {
985
+ out += cyan(blade);
986
+ index += 3;
987
+ continue;
988
+ }
989
+ const char = line[index];
990
+ if (char === "?") {
991
+ out += bold(cyan(eye));
992
+ } else if (char !== " ") {
993
+ out += droneCharColor(char)(char);
994
+ } else {
995
+ out += " ";
996
+ }
997
+ index += 1;
998
+ }
999
+ return out;
1000
+ });
1001
+ }
1002
+ var RIG_PALETTE, ink, ink2, ink3, ink4, accent, accentDim, cyan, red, yellow, RIG_SPINNER_FRAMES, DRONE_ART, BLADE_FRAMES, EYE_FRAMES, DRONE_WIDTH, DRONE_HEIGHT;
1003
+ var init__tui_theme = __esm(() => {
1004
+ RIG_PALETTE = {
1005
+ ink: "#f2f3f6",
1006
+ ink2: "#aeb0ba",
1007
+ ink3: "#6c6e79",
1008
+ ink4: "#44464f",
1009
+ accent: "#ccff4d",
1010
+ accentDim: "#a9d63f",
1011
+ cyan: "#56d8ff",
1012
+ red: "#ff5d5d",
1013
+ yellow: "#ffd24d"
1014
+ };
1015
+ ink = fg(RIG_PALETTE.ink);
1016
+ ink2 = fg(RIG_PALETTE.ink2);
1017
+ ink3 = fg(RIG_PALETTE.ink3);
1018
+ ink4 = fg(RIG_PALETTE.ink4);
1019
+ accent = fg(RIG_PALETTE.accent);
1020
+ accentDim = fg(RIG_PALETTE.accentDim);
1021
+ cyan = fg(RIG_PALETTE.cyan);
1022
+ red = fg(RIG_PALETTE.red);
1023
+ yellow = fg(RIG_PALETTE.yellow);
1024
+ RIG_SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
1025
+ DRONE_ART = [
1026
+ " .-=-. .-=-. ",
1027
+ " ( !!! ) ( !!! ) ",
1028
+ " '-=-'._ _.'-=-' ",
1029
+ " '._ _.' ",
1030
+ " '=$$$$$$$=.' ",
1031
+ " =$$$$$$$$$$$= ",
1032
+ " $$$@@@@@@@@@@$$$ ",
1033
+ " $$$@@ @@$$$ ",
1034
+ " $$@ ? @$$$ ",
1035
+ " $$$@ '-' @$$$ ",
1036
+ " $$$@@ @@$$$ ",
1037
+ " $$$@@@@@@@@@@$$$ ",
1038
+ " =$$$$$$$$$$$= ",
1039
+ " '=$$$$$$$=.' ",
1040
+ " _.' '._ ",
1041
+ " .-=-.' '.-=-. ",
1042
+ " ( !!! ) ( !!! ) ",
1043
+ " '-=-' '-=-' "
1044
+ ];
1045
+ BLADE_FRAMES = ["---", "\\\\\\", "|||", "///"];
1046
+ EYE_FRAMES = ["@", "o", "."];
1047
+ DRONE_WIDTH = DRONE_ART[0].length;
1048
+ DRONE_HEIGHT = DRONE_ART.length;
1049
+ });
1050
+
932
1051
  // packages/cli/src/commands/_cli-format.ts
933
1052
  import { log as log3, note as note3 } from "@clack/prompts";
934
1053
  import pc3 from "picocolors";
@@ -958,17 +1077,17 @@ function truncate(value, width) {
958
1077
  function pad(value, width) {
959
1078
  return value.length >= width ? value : `${value}${" ".repeat(width - value.length)}`;
960
1079
  }
961
- function statusColor(status) {
1080
+ function statusColor2(status) {
962
1081
  const normalized = status.toLowerCase();
963
- if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved"].includes(normalized))
964
- return pc3.green;
1082
+ if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved", "running"].includes(normalized))
1083
+ return accent;
965
1084
  if (["failed", "needs_attention", "needs-attention", "blocked", "error", "rejected"].includes(normalized))
966
- return pc3.red;
967
- if (["running", "reviewing", "validating", "in_progress", "in-progress", "remote"].includes(normalized))
968
- return pc3.cyan;
969
- if (["ready", "open", "queued", "created", "preparing", "local", "pending"].includes(normalized))
970
- return pc3.yellow;
971
- return pc3.dim;
1085
+ return red;
1086
+ if (["reviewing", "validating", "in_progress", "in-progress", "remote", "preparing", "closing-out"].includes(normalized))
1087
+ return cyan;
1088
+ if (["ready", "open", "queued", "created", "local", "pending"].includes(normalized))
1089
+ return yellow;
1090
+ return themeDim;
972
1091
  }
973
1092
  function compactDate(value) {
974
1093
  if (!value.trim())
@@ -1024,20 +1143,20 @@ function printFormattedOutput(message2, options = {}) {
1024
1143
  }
1025
1144
  function formatStatusPill(status) {
1026
1145
  const label = status || "unknown";
1027
- return statusColor(label)(`\u25CF ${label}`);
1146
+ return statusColor2(label)(`\u25CF ${label}`);
1028
1147
  }
1029
1148
  function formatSection(title, subtitle) {
1030
- return `${pc3.bold(pc3.cyan("\u25C6"))} ${pc3.bold(title)}${subtitle ? pc3.dim(` \u2014 ${subtitle}`) : ""}`;
1149
+ return `${pc3.bold(accent("\u25C6"))} ${pc3.bold(title)}${subtitle ? themeDim(` \u2014 ${subtitle}`) : ""}`;
1031
1150
  }
1032
1151
  function formatSuccessCard(title, rows = []) {
1033
- const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${pc3.dim("\u2502")} ${pc3.dim(key.padEnd(12))} ${value}`);
1152
+ const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${themeFaint("\u2502")} ${themeDim(key.padEnd(12))} ${value}`);
1034
1153
  return [formatSection(title), ...body].join(`
1035
1154
  `);
1036
1155
  }
1037
1156
  function formatNextSteps(steps) {
1038
1157
  if (steps.length === 0)
1039
1158
  return [];
1040
- return [pc3.bold("Next"), ...steps.map((step) => `${pc3.dim("\u203A")} ${step}`)];
1159
+ return [pc3.bold("Next"), ...steps.map((step) => `${accent("\u203A")} ${step}`)];
1041
1160
  }
1042
1161
  function formatTaskList(tasks, options = {}) {
1043
1162
  if (options.raw)
@@ -1059,11 +1178,11 @@ function formatTaskList(tasks, options = {}) {
1059
1178
  const statusWidth = Math.min(16, Math.max(6, ...rows.map((row) => row.status.length)));
1060
1179
  const header = `${pc3.bold(pad("TASK", idWidth))} ${pc3.bold(pad("STATUS", statusWidth))} ${pc3.bold("TITLE")}`;
1061
1180
  const body = rows.map((row) => {
1062
- const labels = row.labels.length > 0 ? pc3.dim(` ${row.labels.slice(0, 4).map((label) => `#${label}`).join(" ")}`) : "";
1063
- const source = row.source ? pc3.dim(` ${row.source}`) : "";
1181
+ const labels = row.labels.length > 0 ? themeDim(` ${row.labels.slice(0, 4).map((label) => `#${label}`).join(" ")}`) : "";
1182
+ const source = row.source ? themeDim(` ${row.source}`) : "";
1064
1183
  return [
1065
1184
  pc3.bold(pad(truncate(row.id, idWidth), idWidth)),
1066
- statusColor(row.status)(pad(truncate(row.status, statusWidth), statusWidth)),
1185
+ statusColor2(row.status)(pad(truncate(row.status, statusWidth), statusWidth)),
1067
1186
  `${row.title}${labels}${source}`
1068
1187
  ].join(" ");
1069
1188
  });
@@ -1108,7 +1227,7 @@ function formatRunList(runs, options = {}) {
1108
1227
  if (runs.length === 0) {
1109
1228
  return [
1110
1229
  formatSection("Runs", "none recorded"),
1111
- options.source === "server" ? pc3.dim("No runs recorded on the selected Rig server.") : pc3.dim("No runs recorded in .rig/runs."),
1230
+ options.source === "server" ? themeDim("No runs recorded on the selected Rig server.") : themeDim("No runs recorded in .rig/runs."),
1112
1231
  "",
1113
1232
  ...formatNextSteps(["Start one: `rig task run --next`", "Check server: `rig server status`"])
1114
1233
  ].join(`
@@ -1127,8 +1246,8 @@ function formatRunList(runs, options = {}) {
1127
1246
  const header = `${pc3.bold(pad("RUN", idWidth))} ${pc3.bold(pad("STATUS", statusWidth))} ${pc3.bold("TITLE")}`;
1128
1247
  const body = rows.map((row) => [
1129
1248
  pc3.bold(pad(truncate(row.runId, idWidth), idWidth)),
1130
- statusColor(row.status)(pad(truncate(row.status, statusWidth), statusWidth)),
1131
- `${row.title}${row.runtime ? pc3.dim(` ${row.runtime}`) : ""}`
1249
+ statusColor2(row.status)(pad(truncate(row.status, statusWidth), statusWidth)),
1250
+ `${row.title}${row.runtime ? themeDim(` ${row.runtime}`) : ""}`
1132
1251
  ].join(" "));
1133
1252
  return [formatSection("Runs", options.source === "server" ? "selected server" : "local state"), header, ...body, "", ...formatNextSteps(["Follow live: `rig run attach <run-id> --follow`", "Details: `rig run show <run-id>`"])].join(`
1134
1253
  `);
@@ -1202,7 +1321,7 @@ function formatRunStatus(summary, options = {}) {
1202
1321
  const lines = [formatSection("Run status", options.source === "server" ? "selected server" : "local state")];
1203
1322
  lines.push("", pc3.bold(`Active runs (${activeRuns.length})`));
1204
1323
  if (activeRuns.length === 0) {
1205
- lines.push(pc3.dim("No active runs."));
1324
+ lines.push(themeDim("No active runs."));
1206
1325
  } else {
1207
1326
  for (const run of activeRuns) {
1208
1327
  lines.push(formatRunSummaryLine(run));
@@ -1210,7 +1329,7 @@ function formatRunStatus(summary, options = {}) {
1210
1329
  }
1211
1330
  lines.push("", pc3.bold(`Recent runs (${recentRuns.length})`));
1212
1331
  if (recentRuns.length === 0) {
1213
- lines.push(pc3.dim("No recent terminal runs."));
1332
+ lines.push(themeDim("No recent terminal runs."));
1214
1333
  } else {
1215
1334
  for (const run of recentRuns.slice(0, 10)) {
1216
1335
  lines.push(formatRunSummaryLine(run));
@@ -1228,14 +1347,14 @@ function formatRunSummaryLine(run) {
1228
1347
  const title = runTitleOf(record);
1229
1348
  const runtime = firstString(record, ["runtimeAdapter", "runtime", "adapter"]);
1230
1349
  const descriptor = [taskId, title].filter(Boolean).join(" \xB7 ");
1231
- return `${pc3.dim("\u2502")} ${pc3.bold(runId)} ${formatStatusPill(status)} ${descriptor}${runtime ? pc3.dim(` ${runtime}`) : ""}`;
1350
+ return `${themeFaint("\u2502")} ${pc3.bold(runId)} ${formatStatusPill(status)} ${descriptor}${runtime ? themeDim(` ${runtime}`) : ""}`;
1232
1351
  }
1233
1352
  function formatInboxList(kind, entries) {
1234
1353
  const title = kind === "approvals" ? "Approval inbox" : "Input inbox";
1235
1354
  if (entries.length === 0) {
1236
1355
  return [
1237
1356
  formatSection(title, "empty"),
1238
- pc3.dim(kind === "approvals" ? "No pending approvals." : "No pending user-input requests."),
1357
+ themeDim(kind === "approvals" ? "No pending approvals." : "No pending user-input requests."),
1239
1358
  "",
1240
1359
  ...formatNextSteps(["Check runs: `rig run status`", "Start work: `rig task run --next`"])
1241
1360
  ].join(`
@@ -1249,8 +1368,8 @@ function formatInboxList(kind, entries) {
1249
1368
  const requestId = requestIdOf(record);
1250
1369
  const status = firstString(record, ["status", "state"], "pending");
1251
1370
  const prompt = firstString(record, ["prompt", "message", "reason", "title", "summary"], kind === "approvals" ? "Approval requested" : "Input requested");
1252
- lines.push(`${pc3.dim("\u2502")} ${pc3.bold(requestId)} ${formatStatusPill(status)} ${prompt}`);
1253
- lines.push(`${pc3.dim("\u2502")} ${pc3.dim("run ")} ${runId || "(unknown-run)"}${taskId ? pc3.dim(` task ${taskId}`) : ""}`);
1371
+ lines.push(`${themeFaint("\u2502")} ${pc3.bold(requestId)} ${formatStatusPill(status)} ${prompt}`);
1372
+ lines.push(`${themeFaint("\u2502")} ${themeDim("run ")} ${runId || "(unknown-run)"}${taskId ? themeDim(` task ${taskId}`) : ""}`);
1254
1373
  }
1255
1374
  lines.push("", ...formatNextSteps(kind === "approvals" ? ["Resolve: `rig inbox approve --run <run-id> --request <request-id> --decision approve|reject`", "Rejoin: `rig run attach <run-id> --follow`"] : ["Respond: `rig inbox respond --run <run-id> --request <request-id> --answer key=value`", "Rejoin: `rig run attach <run-id> --follow`"]));
1256
1375
  return lines.join(`
@@ -1272,15 +1391,18 @@ function formatConnectionStatus(selected, connections) {
1272
1391
  const target = !connection ? "not configured" : connection.kind === "remote" ? connection.baseUrl : "local";
1273
1392
  return [
1274
1393
  formatSection("Rig server", "selected for this repo"),
1275
- `${pc3.dim("\u2502")} ${pc3.dim("selected ")} ${pc3.bold(selected)}`,
1276
- `${pc3.dim("\u2502")} ${pc3.dim("kind ")} ${formatStatusPill(connection?.kind ?? "unknown")}`,
1277
- `${pc3.dim("\u2502")} ${pc3.dim("target ")} ${target ?? "not configured"}`,
1394
+ `${themeFaint("\u2502")} ${themeDim("selected ")} ${pc3.bold(selected)}`,
1395
+ `${themeFaint("\u2502")} ${themeDim("kind ")} ${formatStatusPill(connection?.kind ?? "unknown")}`,
1396
+ `${themeFaint("\u2502")} ${themeDim("target ")} ${target ?? "not configured"}`,
1278
1397
  "",
1279
1398
  ...formatNextSteps(["Change: `rig server use <alias|local>`", "List saved servers: `rig server list`"])
1280
1399
  ].join(`
1281
1400
  `);
1282
1401
  }
1283
- var init__cli_format = () => {};
1402
+ var themeDim = (value) => ink3(value), themeFaint = (value) => ink4(value);
1403
+ var init__cli_format = __esm(() => {
1404
+ init__tui_theme();
1405
+ });
1284
1406
 
1285
1407
  // packages/cli/src/commands/_spinner.ts
1286
1408
  function createTtySpinner(input) {
@@ -1730,125 +1852,6 @@ var init__pi_frontend = __esm(() => {
1730
1852
  init__async_ui();
1731
1853
  });
1732
1854
 
1733
- // packages/cli/src/commands/_tui-theme.ts
1734
- function hexToRgb(hex) {
1735
- const value = hex.replace("#", "");
1736
- return [
1737
- Number.parseInt(value.slice(0, 2), 16),
1738
- Number.parseInt(value.slice(2, 4), 16),
1739
- Number.parseInt(value.slice(4, 6), 16)
1740
- ];
1741
- }
1742
- function fg(hex) {
1743
- const [r, g, b] = hexToRgb(hex);
1744
- return (text3) => `\x1B[38;2;${r};${g};${b}m${text3}\x1B[39m`;
1745
- }
1746
- function bold(text3) {
1747
- return `\x1B[1m${text3}\x1B[22m`;
1748
- }
1749
- function statusColor2(status) {
1750
- switch (status) {
1751
- case "running":
1752
- return accent;
1753
- case "preparing":
1754
- case "created":
1755
- case "validating":
1756
- case "reviewing":
1757
- case "closing-out":
1758
- return cyan;
1759
- case "needs-attention":
1760
- case "needs_attention":
1761
- return yellow;
1762
- case "failed":
1763
- return red;
1764
- default:
1765
- return ink3;
1766
- }
1767
- }
1768
- function droneCharColor(char) {
1769
- if (char === "$" || char === "@")
1770
- return accent;
1771
- if (char === "=" || char === "%")
1772
- return accentDim;
1773
- if (char === "\\" || char === "/")
1774
- return ink3;
1775
- return ink4;
1776
- }
1777
- function renderDroneFrame(tick) {
1778
- const blade = BLADE_FRAMES[Math.floor(tick / 4) % BLADE_FRAMES.length];
1779
- const pulse = Math.sin(tick * 0.07);
1780
- const eye = pulse > 0.45 ? EYE_FRAMES[0] : pulse > -0.1 ? EYE_FRAMES[1] : EYE_FRAMES[2];
1781
- return DRONE_ART.map((line) => {
1782
- let out = "";
1783
- let index = 0;
1784
- while (index < line.length) {
1785
- if (line.startsWith("!!!", index)) {
1786
- out += cyan(blade);
1787
- index += 3;
1788
- continue;
1789
- }
1790
- const char = line[index];
1791
- if (char === "?") {
1792
- out += bold(cyan(eye));
1793
- } else if (char !== " ") {
1794
- out += droneCharColor(char)(char);
1795
- } else {
1796
- out += " ";
1797
- }
1798
- index += 1;
1799
- }
1800
- return out;
1801
- });
1802
- }
1803
- var RIG_PALETTE, ink, ink2, ink3, ink4, accent, accentDim, cyan, red, yellow, RIG_SPINNER_FRAMES, DRONE_ART, BLADE_FRAMES, EYE_FRAMES, DRONE_WIDTH, DRONE_HEIGHT;
1804
- var init__tui_theme = __esm(() => {
1805
- RIG_PALETTE = {
1806
- ink: "#f2f3f6",
1807
- ink2: "#aeb0ba",
1808
- ink3: "#6c6e79",
1809
- ink4: "#44464f",
1810
- accent: "#ccff4d",
1811
- accentDim: "#a9d63f",
1812
- cyan: "#56d8ff",
1813
- red: "#ff5d5d",
1814
- yellow: "#ffd24d"
1815
- };
1816
- ink = fg(RIG_PALETTE.ink);
1817
- ink2 = fg(RIG_PALETTE.ink2);
1818
- ink3 = fg(RIG_PALETTE.ink3);
1819
- ink4 = fg(RIG_PALETTE.ink4);
1820
- accent = fg(RIG_PALETTE.accent);
1821
- accentDim = fg(RIG_PALETTE.accentDim);
1822
- cyan = fg(RIG_PALETTE.cyan);
1823
- red = fg(RIG_PALETTE.red);
1824
- yellow = fg(RIG_PALETTE.yellow);
1825
- RIG_SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
1826
- DRONE_ART = [
1827
- " .-=-. .-=-. ",
1828
- " ( !!! ) ( !!! ) ",
1829
- " '-=-'._ _.'-=-' ",
1830
- " '._ _.' ",
1831
- " '=$$$$$$$=.' ",
1832
- " =$$$$$$$$$$$= ",
1833
- " $$$@@@@@@@@@@$$$ ",
1834
- " $$$@@ @@$$$ ",
1835
- " $$@ ? @$$$ ",
1836
- " $$$@ '-' @$$$ ",
1837
- " $$$@@ @@$$$ ",
1838
- " $$$@@@@@@@@@@$$$ ",
1839
- " =$$$$$$$$$$$= ",
1840
- " '=$$$$$$$=.' ",
1841
- " _.' '._ ",
1842
- " .-=-.' '.-=-. ",
1843
- " ( !!! ) ( !!! ) ",
1844
- " '-=-' '-=-' "
1845
- ];
1846
- BLADE_FRAMES = ["---", "\\\\\\", "|||", "///"];
1847
- EYE_FRAMES = ["@", "o", "."];
1848
- DRONE_WIDTH = DRONE_ART[0].length;
1849
- DRONE_HEIGHT = DRONE_ART.length;
1850
- });
1851
-
1852
1855
  // packages/cli/src/commands/_operator-board.ts
1853
1856
  var exports__operator_board = {};
1854
1857
  __export(exports__operator_board, {
@@ -1919,9 +1922,9 @@ class RunsList {
1919
1922
  const lines = visible.map((run, index) => {
1920
1923
  const absolute = start + index;
1921
1924
  const isSelected = absolute === this.selected;
1922
- const dot = statusColor2(run.status)(isSelected ? "\u25CF" : "\xB7");
1925
+ const dot = statusColor(run.status)(isSelected ? "\u25CF" : "\xB7");
1923
1926
  const id = run.runId.slice(0, 8);
1924
- const status = statusColor2(run.status)(run.status.padEnd(16));
1927
+ const status = statusColor(run.status)(run.status.padEnd(16));
1925
1928
  const title = truncateToWidth(run.title, Math.max(8, width - 36));
1926
1929
  const row = ` ${dot} ${isSelected ? bold(ink(id)) : ink3(id)} ${status} ${isSelected ? ink(title) : ink2(title)}`;
1927
1930
  return isSelected ? accent("\u258C") + row : " " + row;