@h-rig/cli 0.0.6-alpha.75 → 0.0.6-alpha.76

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.
@@ -513,6 +513,19 @@ async function resumeRunViaServer(context, runId, options) {
513
513
  }
514
514
  return { ok: true, runId: targetRunId, ...record };
515
515
  }
516
+ async function resolveServerConnectionLabel(projectRoot) {
517
+ try {
518
+ const selected = resolveSelectedConnection(projectRoot);
519
+ if (!selected)
520
+ return "no server selected";
521
+ if (selected.connection.kind === "remote") {
522
+ return selected.connection.baseUrl.replace(/^https?:\/\//, "");
523
+ }
524
+ return `local (${selected.alias})`;
525
+ } catch {
526
+ return "no server selected";
527
+ }
528
+ }
516
529
  async function stopRunViaServer(context, runId) {
517
530
  const payload = await requestServerJson(context, "/api/runs/stop", {
518
531
  method: "POST",
@@ -640,6 +653,7 @@ export {
640
653
  runRunPiCommandViaServer,
641
654
  resumeRunViaServer,
642
655
  respondRunPiExtensionUiViaServer,
656
+ resolveServerConnectionLabel,
643
657
  requestServerJson,
644
658
  registerProjectViaServer,
645
659
  prepareRemoteCheckoutViaServer,
@@ -0,0 +1,135 @@
1
+ // @bun
2
+ // packages/cli/src/commands/_tui-theme.ts
3
+ var RIG_PALETTE = {
4
+ ink: "#f2f3f6",
5
+ ink2: "#aeb0ba",
6
+ ink3: "#6c6e79",
7
+ ink4: "#44464f",
8
+ accent: "#ccff4d",
9
+ accentDim: "#a9d63f",
10
+ cyan: "#56d8ff",
11
+ red: "#ff5d5d",
12
+ yellow: "#ffd24d"
13
+ };
14
+ function hexToRgb(hex) {
15
+ const value = hex.replace("#", "");
16
+ return [
17
+ Number.parseInt(value.slice(0, 2), 16),
18
+ Number.parseInt(value.slice(2, 4), 16),
19
+ Number.parseInt(value.slice(4, 6), 16)
20
+ ];
21
+ }
22
+ function fg(hex) {
23
+ const [r, g, b] = hexToRgb(hex);
24
+ return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[39m`;
25
+ }
26
+ var ink = fg(RIG_PALETTE.ink);
27
+ var ink2 = fg(RIG_PALETTE.ink2);
28
+ var ink3 = fg(RIG_PALETTE.ink3);
29
+ var ink4 = fg(RIG_PALETTE.ink4);
30
+ var accent = fg(RIG_PALETTE.accent);
31
+ var accentDim = fg(RIG_PALETTE.accentDim);
32
+ var cyan = fg(RIG_PALETTE.cyan);
33
+ var red = fg(RIG_PALETTE.red);
34
+ var yellow = fg(RIG_PALETTE.yellow);
35
+ function bold(text) {
36
+ return `\x1B[1m${text}\x1B[22m`;
37
+ }
38
+ function statusColor(status) {
39
+ switch (status) {
40
+ case "running":
41
+ return accent;
42
+ case "preparing":
43
+ case "created":
44
+ case "validating":
45
+ case "reviewing":
46
+ case "closing-out":
47
+ return cyan;
48
+ case "needs-attention":
49
+ case "needs_attention":
50
+ return yellow;
51
+ case "failed":
52
+ return red;
53
+ default:
54
+ return ink3;
55
+ }
56
+ }
57
+ var RIG_SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
58
+ var DRONE_ART = [
59
+ " .-=-. .-=-. ",
60
+ " ( !!! ) ( !!! ) ",
61
+ " '-=-'._ _.'-=-' ",
62
+ " '._ _.' ",
63
+ " '=$$$$$$$=.' ",
64
+ " =$$$$$$$$$$$= ",
65
+ " $$$@@@@@@@@@@$$$ ",
66
+ " $$$@@ @@$$$ ",
67
+ " $$@ ? @$$$ ",
68
+ " $$$@ '-' @$$$ ",
69
+ " $$$@@ @@$$$ ",
70
+ " $$$@@@@@@@@@@$$$ ",
71
+ " =$$$$$$$$$$$= ",
72
+ " '=$$$$$$$=.' ",
73
+ " _.' '._ ",
74
+ " .-=-.' '.-=-. ",
75
+ " ( !!! ) ( !!! ) ",
76
+ " '-=-' '-=-' "
77
+ ];
78
+ var BLADE_FRAMES = ["---", "\\\\\\", "|||", "///"];
79
+ var EYE_FRAMES = ["@", "o", "."];
80
+ function droneCharColor(char) {
81
+ if (char === "$" || char === "@")
82
+ return accent;
83
+ if (char === "=" || char === "%")
84
+ return accentDim;
85
+ if (char === "\\" || char === "/")
86
+ return ink3;
87
+ return ink4;
88
+ }
89
+ function renderDroneFrame(tick) {
90
+ const blade = BLADE_FRAMES[Math.floor(tick / 4) % BLADE_FRAMES.length];
91
+ const pulse = Math.sin(tick * 0.07);
92
+ const eye = pulse > 0.45 ? EYE_FRAMES[0] : pulse > -0.1 ? EYE_FRAMES[1] : EYE_FRAMES[2];
93
+ return DRONE_ART.map((line) => {
94
+ let out = "";
95
+ let index = 0;
96
+ while (index < line.length) {
97
+ if (line.startsWith("!!!", index)) {
98
+ out += cyan(blade);
99
+ index += 3;
100
+ continue;
101
+ }
102
+ const char = line[index];
103
+ if (char === "?") {
104
+ out += bold(cyan(eye));
105
+ } else if (char !== " ") {
106
+ out += droneCharColor(char)(char);
107
+ } else {
108
+ out += " ";
109
+ }
110
+ index += 1;
111
+ }
112
+ return out;
113
+ });
114
+ }
115
+ var DRONE_WIDTH = DRONE_ART[0].length;
116
+ var DRONE_HEIGHT = DRONE_ART.length;
117
+ export {
118
+ yellow,
119
+ statusColor,
120
+ renderDroneFrame,
121
+ red,
122
+ ink4,
123
+ ink3,
124
+ ink2,
125
+ ink,
126
+ fg,
127
+ cyan,
128
+ bold,
129
+ accentDim,
130
+ accent,
131
+ RIG_SPINNER_FRAMES,
132
+ RIG_PALETTE,
133
+ DRONE_WIDTH,
134
+ DRONE_HEIGHT
135
+ };