@h-rig/cli 0.0.6-alpha.89 → 0.0.6-alpha.90
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/build-rig-binaries.js +8 -40
- package/dist/bin/rig.js +12519 -26675
- package/dist/src/app/board.js +74 -693
- package/dist/src/app/drone-ui.js +1 -1
- package/dist/src/app/theme.js +0 -1
- package/dist/src/commands/_async-ui.js +1 -1
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +12 -2
- package/dist/src/commands/_cli-format.d.ts +1 -10
- package/dist/src/commands/_cli-format.js +2 -5
- package/dist/src/commands/_connection-state.d.ts +1 -11
- package/dist/src/commands/_connection-state.js +5 -50
- package/dist/src/commands/_doctor-checks.js +40 -501
- package/dist/src/commands/_help-catalog.js +17 -99
- package/dist/src/commands/_json-output.js +0 -4
- package/dist/src/commands/_operator-view.js +54 -575
- package/dist/src/commands/_pi-frontend.d.ts +0 -27
- package/dist/src/commands/_pi-frontend.js +52 -576
- package/dist/src/commands/_preflight.js +66 -553
- package/dist/src/commands/_server-client.d.ts +0 -33
- package/dist/src/commands/_server-client.js +46 -541
- package/dist/src/commands/_snapshot-upload.js +42 -503
- package/dist/src/commands/_spinner.js +1 -1
- package/dist/src/commands/agent.js +12 -2
- package/dist/src/commands/browser.js +1 -1
- package/dist/src/commands/connect.js +15 -626
- package/dist/src/commands/doctor.js +41 -502
- package/dist/src/commands/github.js +51 -584
- package/dist/src/commands/inbox.js +41 -502
- package/dist/src/commands/init.js +74 -561
- package/dist/src/commands/inspect.js +41 -502
- package/dist/src/commands/run.js +54 -578
- package/dist/src/commands/server.js +163 -692
- package/dist/src/commands/setup.js +46 -507
- package/dist/src/commands/stats.js +58 -601
- package/dist/src/commands/task-run-driver.js +58 -509
- package/dist/src/commands/task.js +110 -729
- package/dist/src/commands.js +237 -1112
- package/dist/src/index.js +244 -1123
- package/dist/src/launcher.js +0 -4
- package/package.json +9 -13
- package/dist/src/app-opentui/adapters/command.d.ts +0 -2
- package/dist/src/app-opentui/adapters/command.js +0 -329
- package/dist/src/app-opentui/adapters/common.d.ts +0 -56
- package/dist/src/app-opentui/adapters/common.js +0 -153
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -9
- package/dist/src/app-opentui/adapters/doctor.js +0 -1217
- package/dist/src/app-opentui/adapters/family.d.ts +0 -62
- package/dist/src/app-opentui/adapters/family.js +0 -14855
- package/dist/src/app-opentui/adapters/fleet.d.ts +0 -14
- package/dist/src/app-opentui/adapters/fleet.js +0 -1335
- package/dist/src/app-opentui/adapters/inbox.d.ts +0 -43
- package/dist/src/app-opentui/adapters/inbox.js +0 -1944
- package/dist/src/app-opentui/adapters/init.d.ts +0 -11
- package/dist/src/app-opentui/adapters/init.js +0 -2818
- package/dist/src/app-opentui/adapters/inspect.d.ts +0 -52
- package/dist/src/app-opentui/adapters/inspect.js +0 -1455
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +0 -32
- package/dist/src/app-opentui/adapters/pi-attach.js +0 -2101
- package/dist/src/app-opentui/adapters/pi.d.ts +0 -23
- package/dist/src/app-opentui/adapters/pi.js +0 -363
- package/dist/src/app-opentui/adapters/plugin.d.ts +0 -84
- package/dist/src/app-opentui/adapters/plugin.js +0 -544
- package/dist/src/app-opentui/adapters/repo.d.ts +0 -37
- package/dist/src/app-opentui/adapters/repo.js +0 -186
- package/dist/src/app-opentui/adapters/run-detail.d.ts +0 -27
- package/dist/src/app-opentui/adapters/run-detail.js +0 -1441
- package/dist/src/app-opentui/adapters/server.d.ts +0 -48
- package/dist/src/app-opentui/adapters/server.js +0 -1561
- package/dist/src/app-opentui/adapters/tasks.d.ts +0 -64
- package/dist/src/app-opentui/adapters/tasks.js +0 -4524
- package/dist/src/app-opentui/adapters/workspace.d.ts +0 -49
- package/dist/src/app-opentui/adapters/workspace.js +0 -333
- package/dist/src/app-opentui/autocomplete.d.ts +0 -20
- package/dist/src/app-opentui/autocomplete.js +0 -578
- package/dist/src/app-opentui/bootstrap.d.ts +0 -11
- package/dist/src/app-opentui/bootstrap.js +0 -27833
- package/dist/src/app-opentui/command-palette.d.ts +0 -3
- package/dist/src/app-opentui/command-palette.js +0 -1038
- package/dist/src/app-opentui/command-pty-host.d.ts +0 -62
- package/dist/src/app-opentui/command-pty-host.js +0 -248
- package/dist/src/app-opentui/drone.d.ts +0 -12
- package/dist/src/app-opentui/drone.js +0 -230
- package/dist/src/app-opentui/events.d.ts +0 -7
- package/dist/src/app-opentui/events.js +0 -28
- package/dist/src/app-opentui/fleet-stats.d.ts +0 -32
- package/dist/src/app-opentui/fleet-stats.js +0 -114
- package/dist/src/app-opentui/focus-manager.d.ts +0 -14
- package/dist/src/app-opentui/focus-manager.js +0 -24
- package/dist/src/app-opentui/index.d.ts +0 -8
- package/dist/src/app-opentui/index.js +0 -5260
- package/dist/src/app-opentui/intent.d.ts +0 -3
- package/dist/src/app-opentui/intent.js +0 -365
- package/dist/src/app-opentui/keymap.d.ts +0 -21
- package/dist/src/app-opentui/keymap.js +0 -1377
- package/dist/src/app-opentui/launch-routing.d.ts +0 -16
- package/dist/src/app-opentui/launch-routing.js +0 -55
- package/dist/src/app-opentui/layout.d.ts +0 -22
- package/dist/src/app-opentui/layout.js +0 -51
- package/dist/src/app-opentui/list-search.d.ts +0 -36
- package/dist/src/app-opentui/list-search.js +0 -130
- package/dist/src/app-opentui/pi-host-child.d.ts +0 -2
- package/dist/src/app-opentui/pi-host-child.js +0 -1299
- package/dist/src/app-opentui/pi-pty-host.d.ts +0 -28
- package/dist/src/app-opentui/pi-pty-host.js +0 -10
- package/dist/src/app-opentui/react/App.d.ts +0 -9
- package/dist/src/app-opentui/react/App.js +0 -3866
- package/dist/src/app-opentui/react/Backdrop.d.ts +0 -5
- package/dist/src/app-opentui/react/Backdrop.js +0 -823
- package/dist/src/app-opentui/react/ChromeHost.d.ts +0 -5
- package/dist/src/app-opentui/react/ChromeHost.js +0 -1539
- package/dist/src/app-opentui/react/SceneFrameView.d.ts +0 -7
- package/dist/src/app-opentui/react/SceneFrameView.js +0 -579
- package/dist/src/app-opentui/react/context.d.ts +0 -17
- package/dist/src/app-opentui/react/context.js +0 -37
- package/dist/src/app-opentui/react/launch.d.ts +0 -2
- package/dist/src/app-opentui/react/launch.js +0 -4897
- package/dist/src/app-opentui/react/nav.d.ts +0 -18
- package/dist/src/app-opentui/react/nav.js +0 -54
- package/dist/src/app-opentui/react/scroll.d.ts +0 -12
- package/dist/src/app-opentui/react/scroll.js +0 -21
- package/dist/src/app-opentui/react/syntax.d.ts +0 -2
- package/dist/src/app-opentui/react/syntax.js +0 -65
- package/dist/src/app-opentui/registry.d.ts +0 -4
- package/dist/src/app-opentui/registry.js +0 -22876
- package/dist/src/app-opentui/remote-link.d.ts +0 -10
- package/dist/src/app-opentui/remote-link.js +0 -47
- package/dist/src/app-opentui/render/ascii-fleet.d.ts +0 -15
- package/dist/src/app-opentui/render/ascii-fleet.js +0 -82
- package/dist/src/app-opentui/render/constants.d.ts +0 -30
- package/dist/src/app-opentui/render/constants.js +0 -64
- package/dist/src/app-opentui/render/graphics.d.ts +0 -40
- package/dist/src/app-opentui/render/graphics.js +0 -713
- package/dist/src/app-opentui/render/hover.d.ts +0 -11
- package/dist/src/app-opentui/render/hover.js +0 -34
- package/dist/src/app-opentui/render/native-host.d.ts +0 -37
- package/dist/src/app-opentui/render/native-host.js +0 -180
- package/dist/src/app-opentui/render/panel-layout.d.ts +0 -38
- package/dist/src/app-opentui/render/panel-layout.js +0 -48
- package/dist/src/app-opentui/render/panels.d.ts +0 -12
- package/dist/src/app-opentui/render/panels.js +0 -288
- package/dist/src/app-opentui/render/preloader.d.ts +0 -10
- package/dist/src/app-opentui/render/preloader.js +0 -166
- package/dist/src/app-opentui/render/scene.d.ts +0 -68
- package/dist/src/app-opentui/render/scene.js +0 -300
- package/dist/src/app-opentui/render/terminal-handoff.d.ts +0 -16
- package/dist/src/app-opentui/render/terminal-handoff.js +0 -14
- package/dist/src/app-opentui/render/text.d.ts +0 -29
- package/dist/src/app-opentui/render/text.js +0 -177
- package/dist/src/app-opentui/render/type-bar.d.ts +0 -15
- package/dist/src/app-opentui/render/type-bar.js +0 -212
- package/dist/src/app-opentui/runtime-resources.d.ts +0 -16
- package/dist/src/app-opentui/runtime-resources.js +0 -62
- package/dist/src/app-opentui/runtime.d.ts +0 -45
- package/dist/src/app-opentui/runtime.js +0 -5232
- package/dist/src/app-opentui/scenes/command.d.ts +0 -3
- package/dist/src/app-opentui/scenes/command.js +0 -118
- package/dist/src/app-opentui/scenes/doctor.d.ts +0 -3
- package/dist/src/app-opentui/scenes/doctor.js +0 -296
- package/dist/src/app-opentui/scenes/error.d.ts +0 -2
- package/dist/src/app-opentui/scenes/error.js +0 -277
- package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/agent.js +0 -349
- package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/browser.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/dist.js +0 -244
- package/dist/src/app-opentui/scenes/family-domains/git.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/git.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/github.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/github.js +0 -275
- package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/harness.js +0 -153
- package/dist/src/app-opentui/scenes/family-domains/index.d.ts +0 -4
- package/dist/src/app-opentui/scenes/family-domains/index.js +0 -1680
- package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +0 -76
- package/dist/src/app-opentui/scenes/family-domains/kit.js +0 -306
- package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/profile.js +0 -213
- package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/queue.js +0 -147
- package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/remote.js +0 -519
- package/dist/src/app-opentui/scenes/family-domains/review.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/review.js +0 -281
- package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/setup.js +0 -268
- package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/stats.js +0 -371
- package/dist/src/app-opentui/scenes/family.d.ts +0 -3
- package/dist/src/app-opentui/scenes/family.js +0 -2199
- package/dist/src/app-opentui/scenes/fleet.d.ts +0 -3
- package/dist/src/app-opentui/scenes/fleet.js +0 -766
- package/dist/src/app-opentui/scenes/handoff.d.ts +0 -2
- package/dist/src/app-opentui/scenes/handoff.js +0 -455
- package/dist/src/app-opentui/scenes/help.d.ts +0 -3
- package/dist/src/app-opentui/scenes/help.js +0 -725
- package/dist/src/app-opentui/scenes/inbox.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inbox.js +0 -427
- package/dist/src/app-opentui/scenes/init.d.ts +0 -3
- package/dist/src/app-opentui/scenes/init.js +0 -181
- package/dist/src/app-opentui/scenes/inspect.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inspect.js +0 -794
- package/dist/src/app-opentui/scenes/main.d.ts +0 -3
- package/dist/src/app-opentui/scenes/main.js +0 -332
- package/dist/src/app-opentui/scenes/pi.d.ts +0 -3
- package/dist/src/app-opentui/scenes/pi.js +0 -509
- package/dist/src/app-opentui/scenes/plugin.d.ts +0 -3
- package/dist/src/app-opentui/scenes/plugin.js +0 -487
- package/dist/src/app-opentui/scenes/repo.d.ts +0 -3
- package/dist/src/app-opentui/scenes/repo.js +0 -425
- package/dist/src/app-opentui/scenes/run-detail.d.ts +0 -3
- package/dist/src/app-opentui/scenes/run-detail.js +0 -467
- package/dist/src/app-opentui/scenes/server.d.ts +0 -3
- package/dist/src/app-opentui/scenes/server.js +0 -378
- package/dist/src/app-opentui/scenes/tasks.d.ts +0 -3
- package/dist/src/app-opentui/scenes/tasks.js +0 -768
- package/dist/src/app-opentui/scenes/workspace.d.ts +0 -3
- package/dist/src/app-opentui/scenes/workspace.js +0 -427
- package/dist/src/app-opentui/selectable.d.ts +0 -19
- package/dist/src/app-opentui/selectable.js +0 -80
- package/dist/src/app-opentui/state.d.ts +0 -4
- package/dist/src/app-opentui/state.js +0 -399
- package/dist/src/app-opentui/surface-catalog.d.ts +0 -20
- package/dist/src/app-opentui/surface-catalog.js +0 -542
- package/dist/src/app-opentui/theme.d.ts +0 -59
- package/dist/src/app-opentui/theme.js +0 -142
- package/dist/src/app-opentui/types.d.ts +0 -313
- package/dist/src/app-opentui/types.js +0 -1
- package/dist/src/commands/_server-events.d.ts +0 -26
- package/dist/src/commands/_server-events.js +0 -715
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/theme.ts
|
|
3
|
-
import {
|
|
4
|
-
bold as otuiBold,
|
|
5
|
-
dim as otuiDim,
|
|
6
|
-
fg as otuiFg,
|
|
7
|
-
t,
|
|
8
|
-
TextAttributes
|
|
9
|
-
} from "@opentui/core";
|
|
10
|
-
var RIG_UI = {
|
|
11
|
-
bg: "#070809",
|
|
12
|
-
bg2: "#0b0c0e",
|
|
13
|
-
panel: "#101115",
|
|
14
|
-
panel2: "#14161b",
|
|
15
|
-
hover: "#181b24",
|
|
16
|
-
glass: "#1e2230",
|
|
17
|
-
border: "#2a2e3a",
|
|
18
|
-
ink: "#f4f5f8",
|
|
19
|
-
ink2: "#c7c9d3",
|
|
20
|
-
ink3: "#9aa0ae",
|
|
21
|
-
ink4: "#787b86",
|
|
22
|
-
lime: "#ccff4d",
|
|
23
|
-
limeDim: "#a9d63f",
|
|
24
|
-
cyan: "#56d8ff",
|
|
25
|
-
cyanDim: "#3f9fbd",
|
|
26
|
-
red: "#ff5d5d",
|
|
27
|
-
yellow: "#ffd24d",
|
|
28
|
-
magenta: "#ff79b0"
|
|
29
|
-
};
|
|
30
|
-
var styles = {
|
|
31
|
-
ink: otuiFg(RIG_UI.ink),
|
|
32
|
-
ink2: otuiFg(RIG_UI.ink2),
|
|
33
|
-
ink3: otuiFg(RIG_UI.ink3),
|
|
34
|
-
ink4: otuiFg(RIG_UI.ink4),
|
|
35
|
-
lime: otuiFg(RIG_UI.lime),
|
|
36
|
-
limeDim: otuiFg(RIG_UI.limeDim),
|
|
37
|
-
cyan: otuiFg(RIG_UI.cyan),
|
|
38
|
-
red: otuiFg(RIG_UI.red),
|
|
39
|
-
yellow: otuiFg(RIG_UI.yellow),
|
|
40
|
-
magenta: otuiFg(RIG_UI.magenta)
|
|
41
|
-
};
|
|
42
|
-
function statusColor(status) {
|
|
43
|
-
switch (status) {
|
|
44
|
-
case "success":
|
|
45
|
-
case "completed":
|
|
46
|
-
case "merged":
|
|
47
|
-
return RIG_UI.lime;
|
|
48
|
-
case "running":
|
|
49
|
-
case "preparing":
|
|
50
|
-
case "created":
|
|
51
|
-
case "validating":
|
|
52
|
-
case "reviewing":
|
|
53
|
-
case "closing-out":
|
|
54
|
-
case "stopping":
|
|
55
|
-
case "loading":
|
|
56
|
-
case "action":
|
|
57
|
-
return RIG_UI.cyan;
|
|
58
|
-
case "needs-attention":
|
|
59
|
-
case "needs_attention":
|
|
60
|
-
return RIG_UI.yellow;
|
|
61
|
-
case "failed":
|
|
62
|
-
case "error":
|
|
63
|
-
return RIG_UI.red;
|
|
64
|
-
default:
|
|
65
|
-
return RIG_UI.ink3;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function statusGlyph(status) {
|
|
69
|
-
switch (status) {
|
|
70
|
-
case "success":
|
|
71
|
-
case "completed":
|
|
72
|
-
case "merged":
|
|
73
|
-
return "\u2713";
|
|
74
|
-
case "running":
|
|
75
|
-
return "\u25CF";
|
|
76
|
-
case "preparing":
|
|
77
|
-
case "created":
|
|
78
|
-
case "validating":
|
|
79
|
-
case "reviewing":
|
|
80
|
-
case "closing-out":
|
|
81
|
-
case "stopping":
|
|
82
|
-
case "loading":
|
|
83
|
-
case "action":
|
|
84
|
-
return "\u25D0";
|
|
85
|
-
case "needs-attention":
|
|
86
|
-
case "needs_attention":
|
|
87
|
-
return "\u26A0";
|
|
88
|
-
case "failed":
|
|
89
|
-
case "error":
|
|
90
|
-
return "\u2717";
|
|
91
|
-
default:
|
|
92
|
-
return "\xB7";
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function noColorActive() {
|
|
96
|
-
const noColor = process.env.NO_COLOR;
|
|
97
|
-
if (noColor !== undefined && noColor !== "") {
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
return process.env.RIG_NO_COLOR !== undefined;
|
|
101
|
-
}
|
|
102
|
-
function statusLabel(status) {
|
|
103
|
-
return {
|
|
104
|
-
glyph: statusGlyph(status),
|
|
105
|
-
color: noColorActive() ? RIG_UI.ink : statusColor(status)
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// packages/cli/src/app-opentui/drone.ts
|
|
110
|
-
import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
111
|
-
var MINI_DRONE = [
|
|
112
|
-
"(!!!) (!!!)",
|
|
113
|
-
" \\%==%/ ",
|
|
114
|
-
" %%?%% ",
|
|
115
|
-
" /%==%\\ ",
|
|
116
|
-
"(!!!) (!!!)"
|
|
117
|
-
];
|
|
118
|
-
var LEAD_MARK = [
|
|
119
|
-
" .-=-. ",
|
|
120
|
-
"=%%?%%=",
|
|
121
|
-
" '-=-' "
|
|
122
|
-
];
|
|
123
|
-
var BLADE_FRAMES = ["---", "\\\\\\", "|||", "///"];
|
|
124
|
-
var EYE_FRAMES = ["o", "@", "\u2022", "."];
|
|
125
|
-
var COLOR = {
|
|
126
|
-
body: RGBA.fromHex(RIG_UI.lime),
|
|
127
|
-
mini: RGBA.fromHex(RIG_UI.limeDim),
|
|
128
|
-
rotor: RGBA.fromHex(RIG_UI.cyan),
|
|
129
|
-
path: RGBA.fromHex(RIG_UI.cyan),
|
|
130
|
-
eye: RGBA.fromHex(RIG_UI.ink),
|
|
131
|
-
dim: RGBA.fromHex(RIG_UI.ink4),
|
|
132
|
-
ink: RGBA.fromHex(RIG_UI.ink2)
|
|
133
|
-
};
|
|
134
|
-
function bladeForTick(tick, phase = 0) {
|
|
135
|
-
return BLADE_FRAMES[(Math.floor(tick / 3) + phase) % BLADE_FRAMES.length];
|
|
136
|
-
}
|
|
137
|
-
function eyeForTick(tick, phase = 0) {
|
|
138
|
-
const pulse = Math.sin(tick * 0.09 + phase);
|
|
139
|
-
return pulse > 0.55 ? EYE_FRAMES[1] : pulse > 0.1 ? EYE_FRAMES[0] : pulse > -0.45 ? EYE_FRAMES[2] : EYE_FRAMES[3];
|
|
140
|
-
}
|
|
141
|
-
function chunk(text, fg, bold = false, dim = false) {
|
|
142
|
-
let attributes = TextAttributes2.NONE;
|
|
143
|
-
if (bold)
|
|
144
|
-
attributes |= TextAttributes2.BOLD;
|
|
145
|
-
if (dim)
|
|
146
|
-
attributes |= TextAttributes2.DIM;
|
|
147
|
-
return { __isChunk: true, text, fg, ...attributes !== TextAttributes2.NONE ? { attributes } : {} };
|
|
148
|
-
}
|
|
149
|
-
function styledLine(text, colorFor) {
|
|
150
|
-
const chunks = [];
|
|
151
|
-
let run = "";
|
|
152
|
-
let runColor = null;
|
|
153
|
-
const flush = () => {
|
|
154
|
-
if (!run || !runColor)
|
|
155
|
-
return;
|
|
156
|
-
chunks.push(chunk(run, COLOR[runColor], runColor === "body" || runColor === "eye", runColor === "dim"));
|
|
157
|
-
run = "";
|
|
158
|
-
};
|
|
159
|
-
for (const char of text) {
|
|
160
|
-
const next = colorFor(char);
|
|
161
|
-
if (next !== runColor) {
|
|
162
|
-
flush();
|
|
163
|
-
runColor = next;
|
|
164
|
-
}
|
|
165
|
-
run += char;
|
|
166
|
-
}
|
|
167
|
-
flush();
|
|
168
|
-
return new StyledText(chunks.length > 0 ? chunks : [chunk("", COLOR.ink)]);
|
|
169
|
-
}
|
|
170
|
-
function droneColor(char) {
|
|
171
|
-
if (char === "?" || char === "o" || char === "@" || char === "\u2022")
|
|
172
|
-
return "eye";
|
|
173
|
-
if (char === "%" || char === "=")
|
|
174
|
-
return "mini";
|
|
175
|
-
if (char === "$")
|
|
176
|
-
return "body";
|
|
177
|
-
if (char === "(" || char === ")" || char === "/" || char === "\\" || char === "|" || char === "-")
|
|
178
|
-
return "rotor";
|
|
179
|
-
if (char === "\xB7" || char === "\u2022" || char === "'" || char === ".")
|
|
180
|
-
return "path";
|
|
181
|
-
if (char.trim() === "")
|
|
182
|
-
return "dim";
|
|
183
|
-
return "ink";
|
|
184
|
-
}
|
|
185
|
-
function motionColor(char) {
|
|
186
|
-
if (char === "\u25CF" || char === "\u25C6" || char === "\u25C9")
|
|
187
|
-
return "body";
|
|
188
|
-
if (char === "\u2022" || char === "\xB7" || char === "\u2500" || char === "\u2502" || char === "\u2571" || char === "\u2572" || char === "\u256D" || char === "\u256E" || char === "\u2570" || char === "\u256F")
|
|
189
|
-
return "path";
|
|
190
|
-
if (char === "\u258C" || char === "\u2590" || char === "\u2581" || char === "\u2594")
|
|
191
|
-
return "mini";
|
|
192
|
-
return droneColor(char);
|
|
193
|
-
}
|
|
194
|
-
function materializeDrone(lines, tick, phase = 0) {
|
|
195
|
-
const blade = bladeForTick(tick, phase);
|
|
196
|
-
const eye = eyeForTick(tick, phase);
|
|
197
|
-
return lines.map((line) => line.replaceAll("!!!", blade).replaceAll("?", eye));
|
|
198
|
-
}
|
|
199
|
-
function miniDroneLines(tick, align = "left", phase = 0) {
|
|
200
|
-
return materializeDrone(MINI_DRONE, tick, phase).map((text) => ({
|
|
201
|
-
text,
|
|
202
|
-
styledText: styledLine(text, droneColor),
|
|
203
|
-
fg: RIG_UI.limeDim,
|
|
204
|
-
align
|
|
205
|
-
}));
|
|
206
|
-
}
|
|
207
|
-
function brandFleetLines(tick, align = "center") {
|
|
208
|
-
const left = materializeDrone(MINI_DRONE, tick, 0);
|
|
209
|
-
const right = materializeDrone(MINI_DRONE, tick, 2);
|
|
210
|
-
const lead = materializeDrone(LEAD_MARK, tick, 1);
|
|
211
|
-
const packet = ["\xB7", "\u2022", "\u25CF", "\u2022"][Math.floor(tick / 2) % 4];
|
|
212
|
-
const bridge = [
|
|
213
|
-
` ${left[0]} ${lead[0]} ${right[0]}`,
|
|
214
|
-
` ${left[1]} \xB7\u2500\u2500${packet}\u2500\u2500\xB7 ${lead[1]} \xB7\u2500\u2500${packet}\u2500\u2500\xB7 ${right[1]}`,
|
|
215
|
-
` ${left[2]} \xB7' '${lead[2]}' '\xB7 ${right[2]}`,
|
|
216
|
-
` ${left[3]} \u2572 signal bus \u2571 ${right[3]}`,
|
|
217
|
-
` ${left[4]} \xB7\u2500\u2500\u2500${packet}\u2500\u2500\u2500\u2500\u2500\u2500${packet}\u2500\u2500\u2500\xB7 ${right[4]}`
|
|
218
|
-
];
|
|
219
|
-
return bridge.map((text) => ({
|
|
220
|
-
text,
|
|
221
|
-
styledText: styledLine(text, motionColor),
|
|
222
|
-
fg: RIG_UI.limeDim,
|
|
223
|
-
align
|
|
224
|
-
}));
|
|
225
|
-
}
|
|
226
|
-
function actionDrone(tick, phase = 0) {
|
|
227
|
-
const blade = bladeForTick(tick, phase);
|
|
228
|
-
const eye = eyeForTick(tick, phase);
|
|
229
|
-
return `(${blade})\u2572${eye}\u2571(${blade})`;
|
|
230
|
-
}
|
|
231
|
-
function actionDroneLine(tick, text, fg = RIG_UI.ink2) {
|
|
232
|
-
const prefix = actionDrone(tick);
|
|
233
|
-
const content = `${prefix} ${text}`;
|
|
234
|
-
return { text: content, styledText: styledLine(content, motionColor), fg, align: "center" };
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// packages/cli/src/app-opentui/render/scene.ts
|
|
238
|
-
function line(text, options = {}) {
|
|
239
|
-
return { text, ...options };
|
|
240
|
-
}
|
|
241
|
-
function blank() {
|
|
242
|
-
return { text: "" };
|
|
243
|
-
}
|
|
244
|
-
function deckRow(input) {
|
|
245
|
-
const prefix = input.active ? "\u25B8" : " ";
|
|
246
|
-
const label = input.label.toUpperCase().padEnd(10);
|
|
247
|
-
return line(`${prefix} ${label} ${input.detail}`, {
|
|
248
|
-
fg: input.active ? RIG_UI.lime : RIG_UI.ink2,
|
|
249
|
-
bold: input.active,
|
|
250
|
-
selectableIndex: input.index,
|
|
251
|
-
activateOnClick: input.activateOnClick
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
function loadingRows(label, tick = 0, compact = false) {
|
|
255
|
-
const mascot = compact ? miniDroneLines(tick, "center") : brandFleetLines(tick, "center");
|
|
256
|
-
return [
|
|
257
|
-
blank(),
|
|
258
|
-
...mascot,
|
|
259
|
-
blank(),
|
|
260
|
-
{ ...actionDroneLine(tick, `loading ${label}\u2026`, RIG_UI.cyan), align: "center" }
|
|
261
|
-
];
|
|
262
|
-
}
|
|
263
|
-
function errorBanner(message, hint) {
|
|
264
|
-
return [
|
|
265
|
-
line(`\u2717 failed to load \u2014 ${message}`, { fg: RIG_UI.red, bold: true }),
|
|
266
|
-
...hint ? [line(` ${hint}`, { fg: RIG_UI.ink3 })] : [],
|
|
267
|
-
line(" select refresh/retry below", { fg: RIG_UI.ink4 }),
|
|
268
|
-
line("", { fg: RIG_UI.ink3 })
|
|
269
|
-
];
|
|
270
|
-
}
|
|
271
|
-
function lastRefreshError(state) {
|
|
272
|
-
const value = state.data.lastRefreshError;
|
|
273
|
-
return typeof value === "string" && value.trim() ? value : undefined;
|
|
274
|
-
}
|
|
275
|
-
function makeSceneFrame(input) {
|
|
276
|
-
return input;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// packages/cli/src/app-opentui/selectable.ts
|
|
280
|
-
function selectableDeckRow(deck, item) {
|
|
281
|
-
return { ...deckRow({ ...deck, activateOnClick: true }), selectable: item };
|
|
282
|
-
}
|
|
283
|
-
function withSelectable(line2, item) {
|
|
284
|
-
return { ...line2, selectable: item, activateOnClick: true };
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// packages/cli/src/app-opentui/scenes/workspace.ts
|
|
288
|
-
function selectedService(state) {
|
|
289
|
-
const value = state.data.selectedWorkspaceService;
|
|
290
|
-
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
291
|
-
}
|
|
292
|
-
var WORKSPACE_BACK_ITEM = {
|
|
293
|
-
id: "workspace-back",
|
|
294
|
-
label: "back",
|
|
295
|
-
data: { selectedWorkspaceService: undefined },
|
|
296
|
-
message: "back to workspace console"
|
|
297
|
-
};
|
|
298
|
-
var WORKSPACE_ACTIONS = [
|
|
299
|
-
{ detail: "re-read topology, remotes, and service fabric", item: { id: "workspace-refresh", label: "refresh", intent: { scene: "workspace", argv: ["workspace", "summary"], action: { kind: "refresh", label: "Refresh workspace" } }, message: "reload workspace console" } },
|
|
300
|
-
{ detail: "verify the whole workspace service fabric", item: { id: "workspace-fabric", label: "verify fabric", intent: { scene: "command", argv: ["workspace", "service-fabric", "verify"], action: { kind: "command-run", label: "Verify service fabric" } }, message: "verify service fabric" } },
|
|
301
|
-
{ detail: "list microservice topology (full output)", item: { id: "workspace-topology", label: "topology", intent: { scene: "command", argv: ["workspace", "topology"], action: { kind: "command-run", label: "Show workspace topology" } }, message: "show topology" } },
|
|
302
|
-
{ detail: "list remote hosts (full output)", item: { id: "workspace-remotes", label: "remotes", intent: { scene: "command", argv: ["workspace", "remote-hosts"], action: { kind: "command-run", label: "Show remote hosts" } }, message: "show remote hosts" } }
|
|
303
|
-
];
|
|
304
|
-
function snapshot(state) {
|
|
305
|
-
const value = state.data.workspace;
|
|
306
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
307
|
-
}
|
|
308
|
-
function panelWidth(layout) {
|
|
309
|
-
return layout?.centerWidth ?? 118;
|
|
310
|
-
}
|
|
311
|
-
function panelHeight(layout) {
|
|
312
|
-
return Math.max(18, layout?.centerHeight ?? 34);
|
|
313
|
-
}
|
|
314
|
-
function cell(value, width) {
|
|
315
|
-
if (value.length <= width)
|
|
316
|
-
return value.padEnd(width);
|
|
317
|
-
return width <= 1 ? value.slice(0, width) : `${value.slice(0, width - 1)}\u2026`;
|
|
318
|
-
}
|
|
319
|
-
function serviceTable(services) {
|
|
320
|
-
if (services.length === 0) {
|
|
321
|
-
return [line(" no services \u2014 add manifests under microservices/, then refresh", { fg: RIG_UI.ink4 })];
|
|
322
|
-
}
|
|
323
|
-
const header = line(` ${cell("SERVICE", 18)} ${cell("RUNTIME", 12)} ${cell("PORT", 6)} ${cell("HEALTHCHECK", 16)} ROOT`, { fg: RIG_UI.ink3, bold: true });
|
|
324
|
-
const rows = services.map((service) => withSelectable(line(` ${cell(service.name, 18)} ${cell(service.runtime, 12)} ${cell(service.port, 6)} ${cell(service.healthcheck, 16)} ${cell(service.rootPath, 28)} \u203A`, { fg: RIG_UI.ink2 }), { id: `workspace-service:${service.name}`, label: service.name, data: { selectedWorkspaceService: service.name }, message: `open ${service.name} detail` }));
|
|
325
|
-
return [header, ...rows];
|
|
326
|
-
}
|
|
327
|
-
function hostTable(hosts) {
|
|
328
|
-
if (hosts.length === 0) {
|
|
329
|
-
return [line(" no remote hosts \u2014 declare them in rig.remote-hosts.yaml, then refresh", { fg: RIG_UI.ink4 })];
|
|
330
|
-
}
|
|
331
|
-
const header = line(` ${cell("HOST", 18)} ${cell("STATUS", 12)} ${cell("BASE URL", 30)} WORKSPACE`, { fg: RIG_UI.ink3, bold: true });
|
|
332
|
-
const rows = hosts.map((host) => {
|
|
333
|
-
const { glyph, color } = statusLabel(host.online ? "success" : "failed");
|
|
334
|
-
return line(` ${glyph} ${cell(host.name, 18)} ${cell(host.status, 12)} ${cell(host.baseUrl, 30)} ${cell(host.workspacePath, 28)}`, { fg: color });
|
|
335
|
-
});
|
|
336
|
-
return [header, ...rows];
|
|
337
|
-
}
|
|
338
|
-
function serviceDetail(service) {
|
|
339
|
-
const { glyph, color } = statusLabel("success");
|
|
340
|
-
return [
|
|
341
|
-
line(`${glyph} ${service.name}`, { fg: color, bold: true }),
|
|
342
|
-
blank(),
|
|
343
|
-
line(` runtime ${service.runtime}`, { fg: RIG_UI.ink2 }),
|
|
344
|
-
line(` port ${service.port}`, { fg: RIG_UI.ink3 }),
|
|
345
|
-
line(` healthcheck ${service.healthcheck}`, { fg: RIG_UI.ink3 }),
|
|
346
|
-
line(` root ${service.rootPath}`, { fg: RIG_UI.ink3 }),
|
|
347
|
-
blank(),
|
|
348
|
-
line("ACTIONS", { fg: RIG_UI.ink3, bold: true }),
|
|
349
|
-
selectableDeckRow({ label: "up", detail: `rig workspace service-fabric up --service ${service.name}`, index: 0, active: false }, { id: `workspace-up:${service.name}`, label: `up ${service.name}`, intent: { scene: "command", argv: ["workspace", "service-fabric", "up", "--service", service.name], action: { kind: "command-run", label: `Start ${service.name}` } }, message: `start ${service.name}` }),
|
|
350
|
-
selectableDeckRow({ label: "verify", detail: `rig workspace service-fabric verify --service ${service.name}`, index: 1, active: false }, { id: `workspace-verify:${service.name}`, label: `verify ${service.name}`, intent: { scene: "command", argv: ["workspace", "service-fabric", "verify", "--service", service.name], action: { kind: "command-run", label: `Verify ${service.name}` } }, message: `verify ${service.name}` }),
|
|
351
|
-
selectableDeckRow({ label: "down", detail: `stop ${service.name} (asks to confirm)`, index: 2, active: false }, { id: `workspace-down:${service.name}`, label: `down ${service.name}`, intent: { scene: "command", argv: ["workspace", "service-fabric", "down", "--service", service.name], action: { kind: "command-run", label: `Stop ${service.name}`, payload: { confirm: true } } }, message: `stop ${service.name}` }),
|
|
352
|
-
blank(),
|
|
353
|
-
selectableDeckRow({ label: "back", detail: "return to the workspace console", index: 3, active: false }, WORKSPACE_BACK_ITEM)
|
|
354
|
-
];
|
|
355
|
-
}
|
|
356
|
-
function statusRows(workspace) {
|
|
357
|
-
const counts = workspace.taskCounts;
|
|
358
|
-
const fabric = workspace.serviceFabric;
|
|
359
|
-
return [
|
|
360
|
-
line(`root ${workspace.rootPath}`, { fg: RIG_UI.ink3 }),
|
|
361
|
-
line(`tasks ${counts.total} total \xB7 ${counts.ready} ready \xB7 ${counts.running} running \xB7 ${counts.blocked} blocked \xB7 ${counts.completed} done \xB7 ${counts.unknown} unknown`, { fg: RIG_UI.ink2 }),
|
|
362
|
-
line(`runtimes ${workspace.runtimeCount} \xB7 artifact tasks ${workspace.artifactTaskCount}`, { fg: RIG_UI.ink3 }),
|
|
363
|
-
line(`fabric ${fabric ? `${fabric.status} \xB7 ${fabric.detail}` : "not configured"}`, { fg: fabric ? RIG_UI.ink3 : RIG_UI.ink4 }),
|
|
364
|
-
line(`failures log ${workspace.failedApproachesPresent ? "present" : "missing"}`, { fg: workspace.failedApproachesPresent ? RIG_UI.yellow : RIG_UI.ink4 }),
|
|
365
|
-
blank(),
|
|
366
|
-
line(`SERVICES \xB7 ${workspace.services.length} \xB7 ${workspace.topology.status}`, { fg: RIG_UI.ink3, bold: true }),
|
|
367
|
-
...serviceTable(workspace.services),
|
|
368
|
-
blank(),
|
|
369
|
-
line(`REMOTE HOSTS \xB7 ${workspace.hosts.length} \xB7 ${workspace.remoteFleet.status}`, { fg: RIG_UI.ink3, bold: true }),
|
|
370
|
-
...hostTable(workspace.hosts)
|
|
371
|
-
];
|
|
372
|
-
}
|
|
373
|
-
function renderWorkspaceScene(state, layout) {
|
|
374
|
-
const workspace = snapshot(state);
|
|
375
|
-
const selected = Math.max(0, Math.min(WORKSPACE_ACTIONS.length - 1, state.selection.index));
|
|
376
|
-
const loading = state.status === "loading" && !workspace;
|
|
377
|
-
const refreshError = lastRefreshError(state);
|
|
378
|
-
const warnings = workspace?.warnings ?? [];
|
|
379
|
-
const drilled = selectedService(state);
|
|
380
|
-
const detailEntry = workspace && drilled ? workspace.services.find((entry) => entry.name === drilled) : undefined;
|
|
381
|
-
const panelLines = detailEntry && workspace ? [
|
|
382
|
-
...refreshError && !state.error ? errorBanner(refreshError) : [],
|
|
383
|
-
line(`SERVICE \xB7 ${detailEntry.name}`, { fg: RIG_UI.ink3, bold: true }),
|
|
384
|
-
blank(),
|
|
385
|
-
...serviceDetail(detailEntry)
|
|
386
|
-
] : [
|
|
387
|
-
...refreshError && !state.error ? errorBanner(refreshError) : [],
|
|
388
|
-
line("workspace operations console", { fg: RIG_UI.ink3 }),
|
|
389
|
-
blank(),
|
|
390
|
-
line("ACTIONS", { fg: RIG_UI.ink3, bold: true }),
|
|
391
|
-
...WORKSPACE_ACTIONS.map(({ detail, item }, index) => selectableDeckRow({ label: item.label, detail, index, active: selected === index }, item)),
|
|
392
|
-
blank(),
|
|
393
|
-
line("STATUS", { fg: RIG_UI.ink3, bold: true }),
|
|
394
|
-
...loading ? loadingRows("workspace console", state.tick) : workspace ? statusRows(workspace) : [line("workspace console pending", { fg: RIG_UI.ink3 })],
|
|
395
|
-
...warnings.length > 0 ? [blank(), line(`WARNINGS \xB7 ${warnings.length}`, { fg: RIG_UI.yellow, bold: true }), ...warnings.map((warning) => line(` - ${warning}`, { fg: RIG_UI.yellow }))] : [],
|
|
396
|
-
blank(),
|
|
397
|
-
line("enter/click a service to drill in + verify it \xB7 refresh reloads in-app", { fg: RIG_UI.ink4 })
|
|
398
|
-
];
|
|
399
|
-
return makeSceneFrame({
|
|
400
|
-
scene: "workspace",
|
|
401
|
-
title: "Workspace",
|
|
402
|
-
lines: [],
|
|
403
|
-
panels: [{
|
|
404
|
-
id: "workspace-console",
|
|
405
|
-
top: 0,
|
|
406
|
-
width: panelWidth(layout),
|
|
407
|
-
height: panelHeight(layout),
|
|
408
|
-
lines: panelLines,
|
|
409
|
-
backgroundColor: RIG_UI.panel,
|
|
410
|
-
backgroundAlpha: 184,
|
|
411
|
-
opacity: 0.98,
|
|
412
|
-
border: false,
|
|
413
|
-
stickyScroll: true,
|
|
414
|
-
stickyStart: "top",
|
|
415
|
-
chrome: "ad-terminal",
|
|
416
|
-
headerText: detailEntry ? `rig workspace \xB7 ${detailEntry.name}` : workspace ? `rig workspace \xB7 ${workspace.services.length} services \xB7 ${workspace.hosts.length} hosts` : "rig workspace",
|
|
417
|
-
headerHeight: 3,
|
|
418
|
-
paddingX: layout?.compact ? 3 : 5,
|
|
419
|
-
paddingY: 2
|
|
420
|
-
}],
|
|
421
|
-
footer: { message: detailEntry ? `${detailEntry.name} \u2014 back returns to the console` : workspace ? `${workspace.services.length} services \xB7 ${workspace.hosts.length} hosts` : "loading workspace" },
|
|
422
|
-
live: state.status === "action" || !workspace
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
export {
|
|
426
|
-
renderWorkspaceScene
|
|
427
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AppSceneLine, AppSelectableItem } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Build a deck row that carries its own selectable item (#6/#12). The runtime
|
|
4
|
-
* derives every scene's selectable list from the rendered lines' `selectable`
|
|
5
|
-
* field, so the row and the action it activates live in one place — no parallel
|
|
6
|
-
* index-synced builder to drift out of sync.
|
|
7
|
-
*
|
|
8
|
-
* `index`/`active` still drive the positional highlight the way the scene
|
|
9
|
-
* computed it; `selectable` drives click/keyboard activation by stable id.
|
|
10
|
-
*/
|
|
11
|
-
export declare function selectableDeckRow(deck: {
|
|
12
|
-
readonly label: string;
|
|
13
|
-
readonly detail: string;
|
|
14
|
-
readonly index?: number;
|
|
15
|
-
readonly active?: boolean;
|
|
16
|
-
}, item: AppSelectableItem): AppSceneLine;
|
|
17
|
-
/** Attach a selectable item to an already-built scene line (for non-deckRow rows
|
|
18
|
-
* such as the data-list rows in fleet/tasks). */
|
|
19
|
-
export declare function withSelectable(line: AppSceneLine, item: AppSelectableItem): AppSceneLine;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/theme.ts
|
|
3
|
-
import {
|
|
4
|
-
bold as otuiBold,
|
|
5
|
-
dim as otuiDim,
|
|
6
|
-
fg as otuiFg,
|
|
7
|
-
t,
|
|
8
|
-
TextAttributes
|
|
9
|
-
} from "@opentui/core";
|
|
10
|
-
var RIG_UI = {
|
|
11
|
-
bg: "#070809",
|
|
12
|
-
bg2: "#0b0c0e",
|
|
13
|
-
panel: "#101115",
|
|
14
|
-
panel2: "#14161b",
|
|
15
|
-
hover: "#181b24",
|
|
16
|
-
glass: "#1e2230",
|
|
17
|
-
border: "#2a2e3a",
|
|
18
|
-
ink: "#f4f5f8",
|
|
19
|
-
ink2: "#c7c9d3",
|
|
20
|
-
ink3: "#9aa0ae",
|
|
21
|
-
ink4: "#787b86",
|
|
22
|
-
lime: "#ccff4d",
|
|
23
|
-
limeDim: "#a9d63f",
|
|
24
|
-
cyan: "#56d8ff",
|
|
25
|
-
cyanDim: "#3f9fbd",
|
|
26
|
-
red: "#ff5d5d",
|
|
27
|
-
yellow: "#ffd24d",
|
|
28
|
-
magenta: "#ff79b0"
|
|
29
|
-
};
|
|
30
|
-
var styles = {
|
|
31
|
-
ink: otuiFg(RIG_UI.ink),
|
|
32
|
-
ink2: otuiFg(RIG_UI.ink2),
|
|
33
|
-
ink3: otuiFg(RIG_UI.ink3),
|
|
34
|
-
ink4: otuiFg(RIG_UI.ink4),
|
|
35
|
-
lime: otuiFg(RIG_UI.lime),
|
|
36
|
-
limeDim: otuiFg(RIG_UI.limeDim),
|
|
37
|
-
cyan: otuiFg(RIG_UI.cyan),
|
|
38
|
-
red: otuiFg(RIG_UI.red),
|
|
39
|
-
yellow: otuiFg(RIG_UI.yellow),
|
|
40
|
-
magenta: otuiFg(RIG_UI.magenta)
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// packages/cli/src/app-opentui/drone.ts
|
|
44
|
-
import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
45
|
-
var COLOR = {
|
|
46
|
-
body: RGBA.fromHex(RIG_UI.lime),
|
|
47
|
-
mini: RGBA.fromHex(RIG_UI.limeDim),
|
|
48
|
-
rotor: RGBA.fromHex(RIG_UI.cyan),
|
|
49
|
-
path: RGBA.fromHex(RIG_UI.cyan),
|
|
50
|
-
eye: RGBA.fromHex(RIG_UI.ink),
|
|
51
|
-
dim: RGBA.fromHex(RIG_UI.ink4),
|
|
52
|
-
ink: RGBA.fromHex(RIG_UI.ink2)
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// packages/cli/src/app-opentui/render/scene.ts
|
|
56
|
-
function line(text, options = {}) {
|
|
57
|
-
return { text, ...options };
|
|
58
|
-
}
|
|
59
|
-
function deckRow(input) {
|
|
60
|
-
const prefix = input.active ? "\u25B8" : " ";
|
|
61
|
-
const label = input.label.toUpperCase().padEnd(10);
|
|
62
|
-
return line(`${prefix} ${label} ${input.detail}`, {
|
|
63
|
-
fg: input.active ? RIG_UI.lime : RIG_UI.ink2,
|
|
64
|
-
bold: input.active,
|
|
65
|
-
selectableIndex: input.index,
|
|
66
|
-
activateOnClick: input.activateOnClick
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// packages/cli/src/app-opentui/selectable.ts
|
|
71
|
-
function selectableDeckRow(deck, item) {
|
|
72
|
-
return { ...deckRow({ ...deck, activateOnClick: true }), selectable: item };
|
|
73
|
-
}
|
|
74
|
-
function withSelectable(line2, item) {
|
|
75
|
-
return { ...line2, selectable: item, activateOnClick: true };
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
withSelectable,
|
|
79
|
-
selectableDeckRow
|
|
80
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AppEvent, AppLaunchOptions, AppState, AppStatePatch, AppStore } from "./types";
|
|
2
|
-
export declare function createInitialAppState(options: AppLaunchOptions): AppState;
|
|
3
|
-
export declare function createAppStore(initialState: AppState): AppStore;
|
|
4
|
-
export declare function reduceAppEvent(state: AppState, event: AppEvent): AppStatePatch;
|