@h-rig/cli 0.0.6-alpha.83 → 0.0.6-alpha.85
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 +22060 -14620
- package/dist/src/app/board.js +155 -28
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -2
- package/dist/src/app-opentui/adapters/doctor.js +1 -25
- package/dist/src/app-opentui/adapters/family.d.ts +62 -0
- package/dist/src/app-opentui/adapters/family.js +14305 -0
- package/dist/src/app-opentui/adapters/fleet.d.ts +0 -2
- package/dist/src/app-opentui/adapters/fleet.js +6 -40
- package/dist/src/app-opentui/adapters/inbox.d.ts +12 -2
- package/dist/src/app-opentui/adapters/inbox.js +54 -59
- package/dist/src/app-opentui/adapters/init.d.ts +0 -2
- package/dist/src/app-opentui/adapters/init.js +0 -26
- package/dist/src/app-opentui/adapters/inspect.d.ts +52 -0
- package/dist/src/app-opentui/adapters/inspect.js +1024 -0
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +15 -6
- package/dist/src/app-opentui/adapters/pi-attach.js +348 -93
- package/dist/src/app-opentui/adapters/pi.d.ts +23 -0
- package/dist/src/app-opentui/adapters/pi.js +363 -0
- package/dist/src/app-opentui/adapters/plugin.d.ts +84 -0
- package/dist/src/app-opentui/adapters/plugin.js +544 -0
- package/dist/src/app-opentui/adapters/repo.d.ts +37 -0
- package/dist/src/app-opentui/adapters/repo.js +186 -0
- package/dist/src/app-opentui/adapters/run-detail.d.ts +9 -2
- package/dist/src/app-opentui/adapters/run-detail.js +97 -44
- package/dist/src/app-opentui/adapters/server.d.ts +10 -2
- package/dist/src/app-opentui/adapters/server.js +96 -27
- package/dist/src/app-opentui/adapters/tasks.d.ts +0 -2
- package/dist/src/app-opentui/adapters/tasks.js +437 -105
- package/dist/src/app-opentui/adapters/workspace.d.ts +49 -0
- package/dist/src/app-opentui/adapters/workspace.js +333 -0
- package/dist/src/app-opentui/autocomplete.d.ts +20 -0
- package/dist/src/app-opentui/autocomplete.js +576 -0
- package/dist/src/app-opentui/bootstrap.js +24313 -16963
- package/dist/src/app-opentui/command-palette.d.ts +3 -0
- package/dist/src/app-opentui/command-palette.js +1010 -0
- package/dist/src/app-opentui/drone.js +8 -6
- package/dist/src/app-opentui/fleet-stats.d.ts +32 -0
- package/dist/src/app-opentui/fleet-stats.js +114 -0
- package/dist/src/app-opentui/index.js +3438 -1724
- package/dist/src/app-opentui/intent.js +71 -48
- package/dist/src/app-opentui/keymap.d.ts +6 -5
- package/dist/src/app-opentui/keymap.js +1064 -23
- package/dist/src/app-opentui/layout.d.ts +7 -0
- package/dist/src/app-opentui/layout.js +13 -6
- package/dist/src/app-opentui/list-search.d.ts +24 -0
- package/dist/src/app-opentui/list-search.js +88 -1
- package/dist/src/app-opentui/pi-host-child.js +33 -1
- package/dist/src/app-opentui/pi-pty-host.d.ts +5 -0
- package/dist/src/app-opentui/pi-pty-host.js +21 -3
- package/dist/src/app-opentui/react/App.d.ts +9 -0
- package/dist/src/app-opentui/react/App.js +5099 -0
- package/dist/src/app-opentui/react/Backdrop.d.ts +5 -0
- package/dist/src/app-opentui/react/Backdrop.js +829 -0
- package/dist/src/app-opentui/react/ChromeHost.d.ts +5 -0
- package/dist/src/app-opentui/react/ChromeHost.js +2942 -0
- package/dist/src/app-opentui/react/SceneFrameView.d.ts +7 -0
- package/dist/src/app-opentui/react/SceneFrameView.js +529 -0
- package/dist/src/app-opentui/react/context.d.ts +17 -0
- package/dist/src/app-opentui/react/context.js +37 -0
- package/dist/src/app-opentui/react/launch.d.ts +2 -0
- package/dist/src/app-opentui/react/launch.js +5698 -0
- package/dist/src/app-opentui/react/nav.d.ts +18 -0
- package/dist/src/app-opentui/react/nav.js +54 -0
- package/dist/src/app-opentui/react/scroll.d.ts +12 -0
- package/dist/src/app-opentui/react/scroll.js +21 -0
- package/dist/src/app-opentui/react/syntax.d.ts +2 -0
- package/dist/src/app-opentui/react/syntax.js +64 -0
- package/dist/src/app-opentui/registry.js +19923 -5151
- package/dist/src/app-opentui/render/constants.d.ts +31 -0
- package/dist/src/app-opentui/render/constants.js +66 -0
- package/dist/src/app-opentui/render/graphics.d.ts +2 -1
- package/dist/src/app-opentui/render/graphics.js +106 -39
- package/dist/src/app-opentui/render/image-visual-layer-worker.js +108 -20
- package/dist/src/app-opentui/render/image-visual-layer.d.ts +7 -0
- package/dist/src/app-opentui/render/image-visual-layer.js +109 -20
- package/dist/src/app-opentui/render/native-host.d.ts +37 -0
- package/dist/src/app-opentui/render/native-host.js +179 -0
- package/dist/src/app-opentui/render/panels.js +18 -11
- package/dist/src/app-opentui/render/preloader.js +8 -6
- package/dist/src/app-opentui/render/scene.d.ts +50 -1
- package/dist/src/app-opentui/render/scene.js +183 -6
- package/dist/src/app-opentui/render/text.d.ts +7 -1
- package/dist/src/app-opentui/render/text.js +10 -7
- package/dist/src/app-opentui/render/type-bar.js +69 -30
- package/dist/src/app-opentui/runtime.d.ts +44 -1
- package/dist/src/app-opentui/runtime.js +3231 -1363
- package/dist/src/app-opentui/scenes/command.js +20 -6
- package/dist/src/app-opentui/scenes/doctor.js +176 -11
- package/dist/src/app-opentui/scenes/error.js +20 -10
- package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/agent.js +348 -0
- package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/browser.js +195 -0
- package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/dist.js +243 -0
- package/dist/src/app-opentui/scenes/family-domains/git.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/git.js +195 -0
- package/dist/src/app-opentui/scenes/family-domains/github.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/github.js +274 -0
- package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/harness.js +152 -0
- package/dist/src/app-opentui/scenes/family-domains/index.d.ts +4 -0
- package/dist/src/app-opentui/scenes/family-domains/index.js +1679 -0
- package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +76 -0
- package/dist/src/app-opentui/scenes/family-domains/kit.js +305 -0
- package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/profile.js +212 -0
- package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/queue.js +146 -0
- package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/remote.js +518 -0
- package/dist/src/app-opentui/scenes/family-domains/review.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/review.js +280 -0
- package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/setup.js +267 -0
- package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/stats.js +370 -0
- package/dist/src/app-opentui/scenes/family.d.ts +3 -0
- package/dist/src/app-opentui/scenes/family.js +2144 -0
- package/dist/src/app-opentui/scenes/fleet.js +521 -31
- package/dist/src/app-opentui/scenes/handoff.js +204 -12
- package/dist/src/app-opentui/scenes/help.js +609 -40
- package/dist/src/app-opentui/scenes/inbox.js +278 -17
- package/dist/src/app-opentui/scenes/init.js +84 -39
- package/dist/src/app-opentui/scenes/inspect.d.ts +3 -0
- package/dist/src/app-opentui/scenes/inspect.js +793 -0
- package/dist/src/app-opentui/scenes/main.js +218 -39
- package/dist/src/app-opentui/scenes/pi.d.ts +3 -0
- package/dist/src/app-opentui/scenes/pi.js +508 -0
- package/dist/src/app-opentui/scenes/plugin.d.ts +3 -0
- package/dist/src/app-opentui/scenes/plugin.js +486 -0
- package/dist/src/app-opentui/scenes/repo.d.ts +3 -0
- package/dist/src/app-opentui/scenes/repo.js +424 -0
- package/dist/src/app-opentui/scenes/run-detail.js +333 -20
- package/dist/src/app-opentui/scenes/server.js +181 -15
- package/dist/src/app-opentui/scenes/tasks.js +486 -31
- package/dist/src/app-opentui/scenes/workspace.d.ts +3 -0
- package/dist/src/app-opentui/scenes/workspace.js +426 -0
- package/dist/src/app-opentui/selectable.d.ts +19 -0
- package/dist/src/app-opentui/selectable.js +79 -0
- package/dist/src/app-opentui/state.js +83 -30
- package/dist/src/app-opentui/surface-catalog.d.ts +20 -0
- package/dist/src/app-opentui/surface-catalog.js +540 -0
- package/dist/src/app-opentui/theme.d.ts +28 -6
- package/dist/src/app-opentui/theme.js +61 -8
- package/dist/src/app-opentui/types.d.ts +121 -4
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +2 -12
- package/dist/src/commands/_help-catalog.js +95 -15
- package/dist/src/commands/_operator-view.js +34 -2
- package/dist/src/commands/_pi-frontend.d.ts +2 -0
- package/dist/src/commands/_pi-frontend.js +34 -0
- package/dist/src/commands/_server-events.d.ts +26 -0
- package/dist/src/commands/_server-events.js +310 -0
- package/dist/src/commands/agent.js +2 -12
- package/dist/src/commands/run.js +34 -2
- package/dist/src/commands/server.js +2 -12
- package/dist/src/commands/stats.js +95 -15
- package/dist/src/commands/task-run-driver.js +2 -12
- package/dist/src/commands/task.js +131 -29
- package/dist/src/commands.js +192 -31
- package/dist/src/index.js +192 -31
- package/package.json +11 -9
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const LCG_MULTIPLIER = 1664525;
|
|
2
|
+
export declare const LCG_INCREMENT = 1013904223;
|
|
3
|
+
export declare const LCG_DIVISOR = 4294967295;
|
|
4
|
+
export declare const PACKET_CYAN_PROBABILITY = 0.22;
|
|
5
|
+
export declare const LANE_INTERP_STEPS = 32;
|
|
6
|
+
export declare const LANE_LEN_BASE = 0.32;
|
|
7
|
+
export declare const LANE_LEN_SPREAD = 0.42;
|
|
8
|
+
export declare const LANE_CURVE_RANGE = 0.7;
|
|
9
|
+
export declare const PACKET_SPEED_BASE = 0.003;
|
|
10
|
+
export declare const PACKET_SPEED_SPREAD = 0.009;
|
|
11
|
+
export declare const DISPATCH_LANES_COMPACT = 7;
|
|
12
|
+
export declare const DISPATCH_LANES_WIDE = 12;
|
|
13
|
+
export declare const DISPATCH_PACKETS_COMPACT = 70;
|
|
14
|
+
export declare const DISPATCH_PACKETS_WIDE = 150;
|
|
15
|
+
export declare const CARRIER_NODES_COMPACT = 5;
|
|
16
|
+
export declare const CARRIER_NODES_WIDE = 7;
|
|
17
|
+
export declare const LOOP_GATES_COMPACT = 4;
|
|
18
|
+
export declare const LOOP_GATES_WIDE = 5;
|
|
19
|
+
export declare const DISPATCH_DRONES_COMPACT = 4;
|
|
20
|
+
export declare const DISPATCH_DRONES_WIDE = 8;
|
|
21
|
+
export declare const CORE_DISPATCH_X = 0.3;
|
|
22
|
+
export declare const CORE_DISPATCH_Y = 0.45;
|
|
23
|
+
export declare const CORE_CARRIER_X = 0.5;
|
|
24
|
+
export declare const CORE_CARRIER_Y = 0.54;
|
|
25
|
+
export declare const CORE_LOOP_X = 0.09;
|
|
26
|
+
export declare const CORE_LOOP_Y = 0.56;
|
|
27
|
+
export declare const RAIL_YS_LOOP: readonly [0.18, 0.5, 0.82];
|
|
28
|
+
export declare const RAIL_YS_CARRIER: readonly [0.24, 0.54, 0.82];
|
|
29
|
+
export declare const RAIL_YS_DISPATCH: readonly [0.18, 0.58, 0.82];
|
|
30
|
+
export declare const GLOW_FALLOFF_EXP_ASCII = 2.2;
|
|
31
|
+
export declare const GLOW_FALLOFF_EXP_IMAGE = 2.4;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/cli/src/app-opentui/render/constants.ts
|
|
3
|
+
var LCG_MULTIPLIER = 1664525;
|
|
4
|
+
var LCG_INCREMENT = 1013904223;
|
|
5
|
+
var LCG_DIVISOR = 4294967295;
|
|
6
|
+
var PACKET_CYAN_PROBABILITY = 0.22;
|
|
7
|
+
var LANE_INTERP_STEPS = 32;
|
|
8
|
+
var LANE_LEN_BASE = 0.32;
|
|
9
|
+
var LANE_LEN_SPREAD = 0.42;
|
|
10
|
+
var LANE_CURVE_RANGE = 0.7;
|
|
11
|
+
var PACKET_SPEED_BASE = 0.003;
|
|
12
|
+
var PACKET_SPEED_SPREAD = 0.009;
|
|
13
|
+
var DISPATCH_LANES_COMPACT = 7;
|
|
14
|
+
var DISPATCH_LANES_WIDE = 12;
|
|
15
|
+
var DISPATCH_PACKETS_COMPACT = 70;
|
|
16
|
+
var DISPATCH_PACKETS_WIDE = 150;
|
|
17
|
+
var CARRIER_NODES_COMPACT = 5;
|
|
18
|
+
var CARRIER_NODES_WIDE = 7;
|
|
19
|
+
var LOOP_GATES_COMPACT = 4;
|
|
20
|
+
var LOOP_GATES_WIDE = 5;
|
|
21
|
+
var DISPATCH_DRONES_COMPACT = 4;
|
|
22
|
+
var DISPATCH_DRONES_WIDE = 8;
|
|
23
|
+
var CORE_DISPATCH_X = 0.3;
|
|
24
|
+
var CORE_DISPATCH_Y = 0.45;
|
|
25
|
+
var CORE_CARRIER_X = 0.5;
|
|
26
|
+
var CORE_CARRIER_Y = 0.54;
|
|
27
|
+
var CORE_LOOP_X = 0.09;
|
|
28
|
+
var CORE_LOOP_Y = 0.56;
|
|
29
|
+
var RAIL_YS_LOOP = [0.18, 0.5, 0.82];
|
|
30
|
+
var RAIL_YS_CARRIER = [0.24, 0.54, 0.82];
|
|
31
|
+
var RAIL_YS_DISPATCH = [0.18, 0.58, 0.82];
|
|
32
|
+
var GLOW_FALLOFF_EXP_ASCII = 2.2;
|
|
33
|
+
var GLOW_FALLOFF_EXP_IMAGE = 2.4;
|
|
34
|
+
export {
|
|
35
|
+
RAIL_YS_LOOP,
|
|
36
|
+
RAIL_YS_DISPATCH,
|
|
37
|
+
RAIL_YS_CARRIER,
|
|
38
|
+
PACKET_SPEED_SPREAD,
|
|
39
|
+
PACKET_SPEED_BASE,
|
|
40
|
+
PACKET_CYAN_PROBABILITY,
|
|
41
|
+
LOOP_GATES_WIDE,
|
|
42
|
+
LOOP_GATES_COMPACT,
|
|
43
|
+
LCG_MULTIPLIER,
|
|
44
|
+
LCG_INCREMENT,
|
|
45
|
+
LCG_DIVISOR,
|
|
46
|
+
LANE_LEN_SPREAD,
|
|
47
|
+
LANE_LEN_BASE,
|
|
48
|
+
LANE_INTERP_STEPS,
|
|
49
|
+
LANE_CURVE_RANGE,
|
|
50
|
+
GLOW_FALLOFF_EXP_IMAGE,
|
|
51
|
+
GLOW_FALLOFF_EXP_ASCII,
|
|
52
|
+
DISPATCH_PACKETS_WIDE,
|
|
53
|
+
DISPATCH_PACKETS_COMPACT,
|
|
54
|
+
DISPATCH_LANES_WIDE,
|
|
55
|
+
DISPATCH_LANES_COMPACT,
|
|
56
|
+
DISPATCH_DRONES_WIDE,
|
|
57
|
+
DISPATCH_DRONES_COMPACT,
|
|
58
|
+
CORE_LOOP_Y,
|
|
59
|
+
CORE_LOOP_X,
|
|
60
|
+
CORE_DISPATCH_Y,
|
|
61
|
+
CORE_DISPATCH_X,
|
|
62
|
+
CORE_CARRIER_Y,
|
|
63
|
+
CORE_CARRIER_X,
|
|
64
|
+
CARRIER_NODES_WIDE,
|
|
65
|
+
CARRIER_NODES_COMPACT
|
|
66
|
+
};
|
|
@@ -3,6 +3,7 @@ import type { StageLayout } from "../layout";
|
|
|
3
3
|
import type { AppSceneId, AppScenePanel } from "../types";
|
|
4
4
|
export type RigGraphicsLayer = FrameBufferRenderable & {
|
|
5
5
|
__rigMarketingCanvas?: MarketingGlyphCanvas;
|
|
6
|
+
__rigAmbientKey?: string;
|
|
6
7
|
};
|
|
7
8
|
declare class MarketingGlyphCanvas {
|
|
8
9
|
private rand;
|
|
@@ -34,6 +35,6 @@ export declare function createGraphicsLayer(renderer: CliRenderer, layout: Stage
|
|
|
34
35
|
export declare function resizeGraphicsLayer(layer: RigGraphicsLayer, layout: StageLayout): void;
|
|
35
36
|
export declare function clearGraphicsLayer(layer: RigGraphicsLayer): void;
|
|
36
37
|
export declare function drawPanelChrome(layer: RigGraphicsLayer, layout: StageLayout, panels: readonly AppScenePanel[]): void;
|
|
37
|
-
export declare function drawAmbientField(layer: RigGraphicsLayer, layout: StageLayout, _tick: number, scene?: AppSceneId): void;
|
|
38
|
+
export declare function drawAmbientField(layer: RigGraphicsLayer, layout: StageLayout, _tick: number, scene?: AppSceneId, load?: number, activeRuns?: number): void;
|
|
38
39
|
export declare function drawSparkline(layer: RigGraphicsLayer, x: number, y: number, values: readonly number[], color?: RGBA): void;
|
|
39
40
|
export {};
|
|
@@ -14,15 +14,17 @@ var RIG_UI = {
|
|
|
14
14
|
bg: "#070809",
|
|
15
15
|
bg2: "#0b0c0e",
|
|
16
16
|
panel: "#101115",
|
|
17
|
-
panel2: "#
|
|
18
|
-
glass: "#
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
panel2: "#14161b",
|
|
18
|
+
glass: "#1e2230",
|
|
19
|
+
border: "#2a2e3a",
|
|
20
|
+
ink: "#f4f5f8",
|
|
21
|
+
ink2: "#c7c9d3",
|
|
22
|
+
ink3: "#9aa0ae",
|
|
23
|
+
ink4: "#787b86",
|
|
23
24
|
lime: "#ccff4d",
|
|
24
25
|
limeDim: "#a9d63f",
|
|
25
26
|
cyan: "#56d8ff",
|
|
27
|
+
cyanDim: "#3f9fbd",
|
|
26
28
|
red: "#ff5d5d",
|
|
27
29
|
yellow: "#ffd24d",
|
|
28
30
|
magenta: "#ff79b0"
|
|
@@ -133,7 +135,41 @@ function panelCellRect(layout, panel) {
|
|
|
133
135
|
return { left, top, width, height, right, bottom, headerHeight, dividerY };
|
|
134
136
|
}
|
|
135
137
|
|
|
138
|
+
// packages/cli/src/app-opentui/render/constants.ts
|
|
139
|
+
var LCG_MULTIPLIER = 1664525;
|
|
140
|
+
var LCG_INCREMENT = 1013904223;
|
|
141
|
+
var LCG_DIVISOR = 4294967295;
|
|
142
|
+
var PACKET_CYAN_PROBABILITY = 0.22;
|
|
143
|
+
var LANE_INTERP_STEPS = 32;
|
|
144
|
+
var LANE_LEN_BASE = 0.32;
|
|
145
|
+
var LANE_LEN_SPREAD = 0.42;
|
|
146
|
+
var LANE_CURVE_RANGE = 0.7;
|
|
147
|
+
var PACKET_SPEED_BASE = 0.003;
|
|
148
|
+
var PACKET_SPEED_SPREAD = 0.009;
|
|
149
|
+
var DISPATCH_LANES_COMPACT = 7;
|
|
150
|
+
var DISPATCH_LANES_WIDE = 12;
|
|
151
|
+
var DISPATCH_PACKETS_COMPACT = 70;
|
|
152
|
+
var DISPATCH_PACKETS_WIDE = 150;
|
|
153
|
+
var CARRIER_NODES_COMPACT = 5;
|
|
154
|
+
var CARRIER_NODES_WIDE = 7;
|
|
155
|
+
var LOOP_GATES_COMPACT = 4;
|
|
156
|
+
var LOOP_GATES_WIDE = 5;
|
|
157
|
+
var DISPATCH_DRONES_COMPACT = 4;
|
|
158
|
+
var DISPATCH_DRONES_WIDE = 8;
|
|
159
|
+
var CORE_DISPATCH_X = 0.3;
|
|
160
|
+
var CORE_DISPATCH_Y = 0.45;
|
|
161
|
+
var CORE_CARRIER_X = 0.5;
|
|
162
|
+
var CORE_CARRIER_Y = 0.54;
|
|
163
|
+
var CORE_LOOP_X = 0.09;
|
|
164
|
+
var CORE_LOOP_Y = 0.56;
|
|
165
|
+
var RAIL_YS_LOOP = [0.18, 0.5, 0.82];
|
|
166
|
+
var RAIL_YS_CARRIER = [0.24, 0.54, 0.82];
|
|
167
|
+
var RAIL_YS_DISPATCH = [0.18, 0.58, 0.82];
|
|
168
|
+
var GLOW_FALLOFF_EXP_ASCII = 2.2;
|
|
169
|
+
|
|
136
170
|
// packages/cli/src/app-opentui/render/graphics.ts
|
|
171
|
+
var BRAILLE_SAMPLES_X = 2;
|
|
172
|
+
var BRAILLE_SAMPLES_Y = 4;
|
|
137
173
|
var TRANSPARENT = RGBA.fromValues(0, 0, 0, 0);
|
|
138
174
|
var BACKDROP = RGBA.fromHex(RIG_UI.bg);
|
|
139
175
|
var PANEL_BG = RGBA.fromInts(16, 17, 21, 184);
|
|
@@ -161,8 +197,8 @@ function sceneKind(scene) {
|
|
|
161
197
|
function seeded(seed) {
|
|
162
198
|
let value = seed >>> 0;
|
|
163
199
|
return () => {
|
|
164
|
-
value = value *
|
|
165
|
-
return value /
|
|
200
|
+
value = value * LCG_MULTIPLIER + LCG_INCREMENT >>> 0;
|
|
201
|
+
return value / LCG_DIVISOR;
|
|
166
202
|
};
|
|
167
203
|
}
|
|
168
204
|
function channelBuffer(canvas, channel) {
|
|
@@ -215,7 +251,7 @@ function drawGlow(canvas, channel, cx, cy, radius, value) {
|
|
|
215
251
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
216
252
|
if (distance > radius)
|
|
217
253
|
continue;
|
|
218
|
-
const falloff = Math.pow(1 - distance / Math.max(0.001, radius),
|
|
254
|
+
const falloff = Math.pow(1 - distance / Math.max(0.001, radius), GLOW_FALLOFF_EXP_ASCII);
|
|
219
255
|
addSample(canvas, channel, x, y, value * falloff);
|
|
220
256
|
}
|
|
221
257
|
}
|
|
@@ -254,8 +290,8 @@ function clearCanvas(canvas) {
|
|
|
254
290
|
canvas.ink.fill(0);
|
|
255
291
|
}
|
|
256
292
|
function makeCanvas(layout) {
|
|
257
|
-
const width = Math.max(1, layout.width *
|
|
258
|
-
const height = Math.max(1, layout.height *
|
|
293
|
+
const width = Math.max(1, layout.width * BRAILLE_SAMPLES_X);
|
|
294
|
+
const height = Math.max(1, layout.height * BRAILLE_SAMPLES_Y);
|
|
259
295
|
const size = width * height;
|
|
260
296
|
return {
|
|
261
297
|
width,
|
|
@@ -314,12 +350,12 @@ class MarketingGlyphCanvas {
|
|
|
314
350
|
this.setupCarrier();
|
|
315
351
|
}
|
|
316
352
|
setupDispatch() {
|
|
317
|
-
const count = this.layout.compact ?
|
|
353
|
+
const count = this.layout.compact ? DISPATCH_LANES_COMPACT : DISPATCH_LANES_WIDE;
|
|
318
354
|
for (let i = 0;i < count; i += 1) {
|
|
319
355
|
const ang = (-0.9 + 1.8 * (i / Math.max(1, count - 1))) * (Math.PI * 0.5);
|
|
320
|
-
this.lanes.push({ ang, len: this.canvas.width * (
|
|
356
|
+
this.lanes.push({ ang, len: this.canvas.width * (LANE_LEN_BASE + this.rand() * LANE_LEN_SPREAD), curve: (this.rand() - 0.5) * LANE_CURVE_RANGE, phase: this.rand() * Math.PI * 2 });
|
|
321
357
|
}
|
|
322
|
-
const packets = this.layout.compact ?
|
|
358
|
+
const packets = this.layout.compact ? DISPATCH_PACKETS_COMPACT : DISPATCH_PACKETS_WIDE;
|
|
323
359
|
for (let i = 0;i < packets; i += 1)
|
|
324
360
|
this.packets.push(this.packet(true));
|
|
325
361
|
}
|
|
@@ -329,7 +365,7 @@ class MarketingGlyphCanvas {
|
|
|
329
365
|
this.packets.push(this.packet(true));
|
|
330
366
|
}
|
|
331
367
|
setupCarrier() {
|
|
332
|
-
const nodes = this.layout.compact ?
|
|
368
|
+
const nodes = this.layout.compact ? CARRIER_NODES_COMPACT : CARRIER_NODES_WIDE;
|
|
333
369
|
for (let i = 0;i < nodes * 6; i += 1)
|
|
334
370
|
this.packets.push(this.packet(true));
|
|
335
371
|
}
|
|
@@ -337,18 +373,18 @@ class MarketingGlyphCanvas {
|
|
|
337
373
|
return {
|
|
338
374
|
lane: Math.floor(this.rand() * Math.max(1, this.lanes.length || 7)),
|
|
339
375
|
p: random ? this.rand() : 0,
|
|
340
|
-
spd:
|
|
341
|
-
channel: this.rand() <
|
|
376
|
+
spd: PACKET_SPEED_BASE + this.rand() * PACKET_SPEED_SPREAD,
|
|
377
|
+
channel: this.rand() < PACKET_CYAN_PROBABILITY ? 1 : 0,
|
|
342
378
|
wobble: (this.rand() - 0.5) * 7,
|
|
343
379
|
size: 0.8 + this.rand() * 1.3
|
|
344
380
|
};
|
|
345
381
|
}
|
|
346
382
|
core(kind) {
|
|
347
383
|
if (kind === "dispatch")
|
|
348
|
-
return { x: this.canvas.width *
|
|
384
|
+
return { x: this.canvas.width * CORE_DISPATCH_X, y: this.canvas.height * CORE_DISPATCH_Y };
|
|
349
385
|
if (kind === "carrier")
|
|
350
|
-
return { x: this.canvas.width *
|
|
351
|
-
return { x: this.canvas.width *
|
|
386
|
+
return { x: this.canvas.width * CORE_CARRIER_X, y: this.canvas.height * CORE_CARRIER_Y };
|
|
387
|
+
return { x: this.canvas.width * CORE_LOOP_X, y: this.canvas.height * CORE_LOOP_Y };
|
|
352
388
|
}
|
|
353
389
|
lanePoint(lane, p, kind = "dispatch") {
|
|
354
390
|
const core = this.core(kind);
|
|
@@ -368,7 +404,7 @@ class MarketingGlyphCanvas {
|
|
|
368
404
|
}
|
|
369
405
|
}
|
|
370
406
|
drawMarketingRails(kind, tick) {
|
|
371
|
-
const ys = kind === "loop" ?
|
|
407
|
+
const ys = kind === "loop" ? RAIL_YS_LOOP : kind === "carrier" ? RAIL_YS_CARRIER : RAIL_YS_DISPATCH;
|
|
372
408
|
ys.forEach((ratio, index) => {
|
|
373
409
|
const y = this.canvas.height * ratio + Math.sin(tick * 0.018 + index) * 1.8;
|
|
374
410
|
drawLine(this.canvas, index === 1 ? 0 : 1, this.canvas.width * 0.06, y, this.canvas.width * 0.94, y + Math.sin(index) * 2, index === 1 ? 0.11 : 0.07, 0.55);
|
|
@@ -385,8 +421,8 @@ class MarketingGlyphCanvas {
|
|
|
385
421
|
drawDot(this.canvas, 0, core.x, core.y, 2.2, 0.85);
|
|
386
422
|
for (const lane of this.lanes) {
|
|
387
423
|
let prev = this.lanePoint(lane, 0);
|
|
388
|
-
for (let i = 1;i <=
|
|
389
|
-
const next = this.lanePoint(lane, i /
|
|
424
|
+
for (let i = 1;i <= LANE_INTERP_STEPS; i += 1) {
|
|
425
|
+
const next = this.lanePoint(lane, i / LANE_INTERP_STEPS);
|
|
390
426
|
drawLine(this.canvas, lane.phase > Math.PI ? 1 : 0, prev.x, prev.y, next.x, next.y, 0.045, 0.38);
|
|
391
427
|
prev = next;
|
|
392
428
|
}
|
|
@@ -405,7 +441,7 @@ class MarketingGlyphCanvas {
|
|
|
405
441
|
drawDot(this.canvas, packet.channel, pt.x, y, packet.size, 0.5 * fade);
|
|
406
442
|
drawGlow(this.canvas, packet.channel, pt.x, y, packet.size * 4, 0.045 * fade);
|
|
407
443
|
}
|
|
408
|
-
for (let i = 0;i < (this.layout.compact ?
|
|
444
|
+
for (let i = 0;i < (this.layout.compact ? DISPATCH_DRONES_COMPACT : DISPATCH_DRONES_WIDE); i += 1) {
|
|
409
445
|
const lane = this.lanes[i % Math.max(1, this.lanes.length)];
|
|
410
446
|
if (!lane)
|
|
411
447
|
continue;
|
|
@@ -419,7 +455,7 @@ class MarketingGlyphCanvas {
|
|
|
419
455
|
const x0 = this.canvas.width * 0.09;
|
|
420
456
|
const x1 = this.canvas.width * 0.91;
|
|
421
457
|
drawLine(this.canvas, 0, x0, y, x1, y, 0.12, 0.55);
|
|
422
|
-
const gates = this.layout.compact ?
|
|
458
|
+
const gates = this.layout.compact ? LOOP_GATES_COMPACT : LOOP_GATES_WIDE;
|
|
423
459
|
const active = Math.floor(tick / 16) % gates;
|
|
424
460
|
for (let i = 0;i < gates; i += 1) {
|
|
425
461
|
const x = x0 + (x1 - x0) * (i / Math.max(1, gates - 1));
|
|
@@ -447,7 +483,7 @@ class MarketingGlyphCanvas {
|
|
|
447
483
|
drawGlow(this.canvas, 0, core.x, core.y, 26, 0.12);
|
|
448
484
|
drawDot(this.canvas, 0, core.x, core.y, 2.4, 0.92);
|
|
449
485
|
drawCircleStroke(this.canvas, 0, core.x, core.y, 8 + Math.sin(tick * 0.06) * 2, 0.14);
|
|
450
|
-
const nodes = this.layout.compact ?
|
|
486
|
+
const nodes = this.layout.compact ? CARRIER_NODES_COMPACT : CARRIER_NODES_WIDE;
|
|
451
487
|
const rx = this.canvas.width * 0.36;
|
|
452
488
|
const ry = this.canvas.height * 0.22;
|
|
453
489
|
for (let i = 0;i < nodes; i += 1) {
|
|
@@ -502,10 +538,10 @@ class MarketingGlyphCanvas {
|
|
|
502
538
|
let c2Sum = 0;
|
|
503
539
|
let mgSum = 0;
|
|
504
540
|
let inkSum = 0;
|
|
505
|
-
for (let sy = 0;sy <
|
|
506
|
-
for (let sx = 0;sx <
|
|
507
|
-
const px = cx *
|
|
508
|
-
const py = cy *
|
|
541
|
+
for (let sy = 0;sy < BRAILLE_SAMPLES_Y; sy += 1) {
|
|
542
|
+
for (let sx = 0;sx < BRAILLE_SAMPLES_X; sx += 1) {
|
|
543
|
+
const px = cx * BRAILLE_SAMPLES_X + sx;
|
|
544
|
+
const py = cy * BRAILLE_SAMPLES_Y + sy;
|
|
509
545
|
if (px >= width || py >= height)
|
|
510
546
|
continue;
|
|
511
547
|
const index = py * width + px;
|
|
@@ -553,6 +589,7 @@ function resizeGraphicsLayer(layer, layout) {
|
|
|
553
589
|
}
|
|
554
590
|
function clearGraphicsLayer(layer) {
|
|
555
591
|
layer.frameBuffer.clear(BACKDROP);
|
|
592
|
+
layer.__rigAmbientKey = undefined;
|
|
556
593
|
}
|
|
557
594
|
function writeCell(layer, x, y, char, fg, bg) {
|
|
558
595
|
layer.frameBuffer.setCellWithAlphaBlending(x, y, char, fg, bg);
|
|
@@ -604,21 +641,45 @@ function staticFleetTick(scene) {
|
|
|
604
641
|
hash = hash * 33 + scene.charCodeAt(index) >>> 0;
|
|
605
642
|
return 11 + hash % 97;
|
|
606
643
|
}
|
|
607
|
-
function
|
|
644
|
+
function withAlpha(hex, alpha) {
|
|
645
|
+
const a = Math.max(0, Math.min(255, Math.round(alpha * 255)));
|
|
646
|
+
const [r, g, b] = RGBA.fromHex(hex).toInts();
|
|
647
|
+
return RGBA.fromInts(r, g, b, a);
|
|
648
|
+
}
|
|
649
|
+
function asciiFleetColor(char, row, alpha) {
|
|
608
650
|
if (char === "@" || char === "$" || char === "o")
|
|
609
|
-
return
|
|
651
|
+
return withAlpha(RIG_UI.lime, alpha);
|
|
610
652
|
if (char === "%" || char === "!" || char === "/" || char === "\\" || char === "|")
|
|
611
|
-
return
|
|
612
|
-
if (char === "." || char === "'" || char === "_" || row < 3 || row > FLEET_GRID_HEIGHT - 4)
|
|
613
|
-
return RGBA.fromInts(108, 110, 121, 170);
|
|
614
|
-
|
|
653
|
+
return withAlpha(RIG_UI.cyan, alpha);
|
|
654
|
+
if (char === "." || char === "'" || char === "_" || row < 3 || row > FLEET_GRID_HEIGHT - 4) {
|
|
655
|
+
return RGBA.fromInts(108, 110, 121, Math.min(170, Math.max(0, Math.min(255, Math.round(alpha * 255)))));
|
|
656
|
+
}
|
|
657
|
+
return withAlpha(RIG_UI.limeDim, alpha);
|
|
658
|
+
}
|
|
659
|
+
var AMBIENT_LOAD_BUCKETS = 5;
|
|
660
|
+
function ambientLoadBucket(load) {
|
|
661
|
+
if (!Number.isFinite(load))
|
|
662
|
+
return 0;
|
|
663
|
+
return Math.max(0, Math.min(AMBIENT_LOAD_BUCKETS, Math.round(load * AMBIENT_LOAD_BUCKETS)));
|
|
615
664
|
}
|
|
616
|
-
function drawAmbientField(layer, layout, _tick, scene = "fleet") {
|
|
665
|
+
function drawAmbientField(layer, layout, _tick, scene = "fleet", load = 0, activeRuns = 0) {
|
|
666
|
+
const bucket = ambientLoadBucket(load);
|
|
667
|
+
const rows = fleetRows(staticFleetTick(scene), { animate: true });
|
|
668
|
+
let droneTotal = 0;
|
|
669
|
+
for (const line of rows)
|
|
670
|
+
for (const char of line)
|
|
671
|
+
if (char === "@" || char === "$" || char === "%")
|
|
672
|
+
droneTotal += 1;
|
|
673
|
+
const litTarget = Math.max(0, Math.min(droneTotal, Math.floor(activeRuns)));
|
|
674
|
+
const key = `${layout.width}x${layout.height}|${scene}|l${bucket}|d${litTarget}`;
|
|
675
|
+
if (layer.__rigAmbientKey === key)
|
|
676
|
+
return;
|
|
617
677
|
const fb = layer.frameBuffer;
|
|
618
678
|
fb.clear(BACKDROP);
|
|
619
|
-
const rows = fleetRows(staticFleetTick(scene), { animate: true });
|
|
620
679
|
const left = Math.floor((layout.width - FLEET_GRID_WIDTH) / 2);
|
|
621
680
|
const top = Math.floor((layout.height - FLEET_GRID_HEIGHT) / 2);
|
|
681
|
+
const baseAlpha = 0.62 + bucket / AMBIENT_LOAD_BUCKETS * 0.18;
|
|
682
|
+
let droneIndex = 0;
|
|
622
683
|
for (let row = 0;row < rows.length; row += 1) {
|
|
623
684
|
const y = top + row;
|
|
624
685
|
if (y < 0 || y >= layout.height)
|
|
@@ -631,9 +692,15 @@ function drawAmbientField(layer, layout, _tick, scene = "fleet") {
|
|
|
631
692
|
const char = line[col];
|
|
632
693
|
if (char === " ")
|
|
633
694
|
continue;
|
|
634
|
-
|
|
695
|
+
const isDrone = char === "@" || char === "$" || char === "%";
|
|
696
|
+
const lit = isDrone && droneIndex < litTarget;
|
|
697
|
+
if (isDrone)
|
|
698
|
+
droneIndex += 1;
|
|
699
|
+
const alpha = lit ? 1 : baseAlpha;
|
|
700
|
+
fb.setCellWithAlphaBlending(x, y, char, asciiFleetColor(char, row, alpha), TRANSPARENT);
|
|
635
701
|
}
|
|
636
702
|
}
|
|
703
|
+
layer.__rigAmbientKey = key;
|
|
637
704
|
}
|
|
638
705
|
function drawSparkline(layer, x, y, values, color = RGBA.fromHex(RIG_UI.cyan)) {
|
|
639
706
|
const chars = ["\u2581", "\u2582", "\u2583", "\u2584", "\u2585", "\u2586", "\u2587", "\u2588"];
|
|
@@ -111,7 +111,16 @@ function panelPixelPlacement(layout, panel, size, minPixels = 8) {
|
|
|
111
111
|
return width > minPixels && height > minPixels ? { left, top, width, height, leftCells, topCells, widthCells, heightCells } : null;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
// packages/cli/src/app-opentui/render/constants.ts
|
|
115
|
+
var GLOW_FALLOFF_EXP_IMAGE = 2.4;
|
|
116
|
+
|
|
114
117
|
// packages/cli/src/app-opentui/render/image-visual-layer.ts
|
|
118
|
+
var PANEL_MASK_RADIUS_MIN = 14;
|
|
119
|
+
var PANEL_MASK_RADIUS_MAX = 34;
|
|
120
|
+
var PANEL_MASK_RADIUS_FACTOR = 0.035;
|
|
121
|
+
var PANEL_BLUR_RADIUS_MIN = 8;
|
|
122
|
+
var PANEL_BLUR_RADIUS_MAX = 28;
|
|
123
|
+
var PANEL_BLUR_RADIUS_FACTOR = 0.018;
|
|
115
124
|
var BG = [7, 8, 9, 255];
|
|
116
125
|
var PANEL = [16, 17, 21, 184];
|
|
117
126
|
var PANEL_HEADER = [16, 17, 21, 190];
|
|
@@ -128,6 +137,12 @@ var KITTY_CHUNK_SIZE = 4096;
|
|
|
128
137
|
var PANEL_BLUR_SCALE = 1;
|
|
129
138
|
var PANEL_MASK_CACHE_LIMIT = 16;
|
|
130
139
|
var ZLIB_LEVEL = 1;
|
|
140
|
+
var LOAD_BUCKETS = 5;
|
|
141
|
+
function loadBucket(load) {
|
|
142
|
+
if (!Number.isFinite(load ?? NaN))
|
|
143
|
+
return 0;
|
|
144
|
+
return Math.max(0, Math.min(LOAD_BUCKETS, Math.round((load ?? 0) * LOAD_BUCKETS)));
|
|
145
|
+
}
|
|
131
146
|
var panelMaskCache = new Map;
|
|
132
147
|
var BG_WORD = rgbaWord(BG);
|
|
133
148
|
function imageTransport() {
|
|
@@ -213,17 +228,25 @@ function drawAsciiGlyph(data, width, height, x, y, cellWidth, cellHeight, char,
|
|
|
213
228
|
}
|
|
214
229
|
}
|
|
215
230
|
}
|
|
216
|
-
function drawStaticAsciiFleetBackground(data, width, height, scene, layout) {
|
|
231
|
+
function drawStaticAsciiFleetBackground(data, width, height, scene, layout, load, activeRuns) {
|
|
217
232
|
const rows = fleetRows(sceneStaticTick(scene), { animate: true });
|
|
218
233
|
const cellWidth = width / Math.max(1, layout.width);
|
|
219
234
|
const cellHeight = height / Math.max(1, layout.height);
|
|
220
|
-
const
|
|
235
|
+
const sideBySide = layout.width >= FLEET_GRID_WIDTH * 1.9;
|
|
236
|
+
const leftCells = sideBySide ? Math.max(1, Math.floor(layout.width * 0.3 - FLEET_GRID_WIDTH / 2)) : Math.floor((layout.width - FLEET_GRID_WIDTH) / 2);
|
|
221
237
|
const topCells = Math.floor((layout.height - FLEET_GRID_HEIGHT) / 2);
|
|
222
238
|
const fleetLeft = leftCells * cellWidth;
|
|
223
239
|
const fleetTop = topCells * cellHeight;
|
|
224
|
-
drawGlow(data, width, height, width * 0.5, height * 0.5, Math.min(width, height) * 0.4, LIME, 0.03);
|
|
225
|
-
drawGlow(data, width, height, width * 0.18, height * 0.22, Math.min(width, height) * 0.28, CYAN, 0.
|
|
226
|
-
drawGlow(data, width, height, width * 0.82, height * 0.78, Math.min(width, height) * 0.22, MAGENTA, 0.
|
|
240
|
+
drawGlow(data, width, height, width * 0.5, height * 0.5, Math.min(width, height) * 0.4, LIME, 0.022 + load * 0.03);
|
|
241
|
+
drawGlow(data, width, height, width * 0.18, height * 0.22, Math.min(width, height) * 0.28, CYAN, 0.018 + load * 0.012);
|
|
242
|
+
drawGlow(data, width, height, width * 0.82, height * 0.78, Math.min(width, height) * 0.22, MAGENTA, 0.012 + load * 0.008);
|
|
243
|
+
let droneTotal = 0;
|
|
244
|
+
for (const line of rows)
|
|
245
|
+
for (const char of line)
|
|
246
|
+
if (char === "@" || char === "$" || char === "%")
|
|
247
|
+
droneTotal += 1;
|
|
248
|
+
const litTarget = Math.max(0, Math.min(droneTotal, activeRuns));
|
|
249
|
+
let droneIndex = 0;
|
|
227
250
|
for (let row = 0;row < rows.length; row += 1) {
|
|
228
251
|
const line = rows[row];
|
|
229
252
|
for (let col = 0;col < line.length; col += 1) {
|
|
@@ -233,26 +256,30 @@ function drawStaticAsciiFleetBackground(data, width, height, scene, layout) {
|
|
|
233
256
|
const x = fleetLeft + col * cellWidth;
|
|
234
257
|
const y = fleetTop + row * cellHeight;
|
|
235
258
|
const color = charColor(char, row, rows.length);
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
259
|
+
const isDrone = char === "@" || char === "$" || char === "%";
|
|
260
|
+
const lit = isDrone && droneIndex < litTarget;
|
|
261
|
+
drawAsciiGlyph(data, width, height, x + cellWidth * 0.07, y + cellHeight * 0.05, cellWidth, cellHeight, char, color, lit ? 0.72 : 0.46);
|
|
262
|
+
if (isDrone) {
|
|
263
|
+
droneIndex += 1;
|
|
264
|
+
drawGlow(data, width, height, x + cellWidth * 0.5, y + cellHeight * 0.5, Math.max(cellWidth, cellHeight) * 0.95, color, lit ? 0.044 : 0.014);
|
|
239
265
|
}
|
|
240
266
|
}
|
|
241
267
|
}
|
|
242
268
|
}
|
|
243
|
-
function applyStaticAtmosphere(data, width, height) {
|
|
269
|
+
function applyStaticAtmosphere(data, width, height, load) {
|
|
244
270
|
const cx = width * 0.5;
|
|
245
271
|
const cy = height * 0.42;
|
|
246
272
|
const radius = Math.max(width, height) * 0.78;
|
|
273
|
+
const minVignette = 0.1 - load * 0.02;
|
|
247
274
|
for (let y = 0;y < height; y += 1) {
|
|
248
275
|
for (let x = 0;x < width; x += 1) {
|
|
249
276
|
const distance = Math.hypot(x - cx, y - cy) / radius;
|
|
250
|
-
const alpha = Math.max(
|
|
277
|
+
const alpha = Math.max(minVignette, Math.min(0.82, 0.12 + Math.pow(distance, 1.65) * 0.62));
|
|
251
278
|
blendOver(data, (y * width + x) * 4, BG, alpha);
|
|
252
279
|
}
|
|
253
280
|
}
|
|
254
|
-
drawGlow(data, width, height, width * 0.82, height * 0.04, Math.min(width, height) * 0.2, LIME, 0.
|
|
255
|
-
drawGlow(data, width, height, width * 0.12, height * 0.18, Math.min(width, height) * 0.16, CYAN, 0.
|
|
281
|
+
drawGlow(data, width, height, width * 0.82, height * 0.04, Math.min(width, height) * 0.2, LIME, 0.024 + load * 0.012);
|
|
282
|
+
drawGlow(data, width, height, width * 0.12, height * 0.18, Math.min(width, height) * 0.16, CYAN, 0.018 + load * 0.008);
|
|
256
283
|
}
|
|
257
284
|
function makeCrcTable() {
|
|
258
285
|
const table = new Uint32Array(256);
|
|
@@ -335,6 +362,23 @@ function blendOver(data, index, color, alphaScale = 1) {
|
|
|
335
362
|
data[index + 2] = clampByte(color[2] * alpha + data[index + 2] * inv);
|
|
336
363
|
data[index + 3] = 255;
|
|
337
364
|
}
|
|
365
|
+
function drawDisc(data, width, height, cx, cy, radius, color, alpha = 1) {
|
|
366
|
+
const minX = Math.max(0, Math.floor(cx - radius));
|
|
367
|
+
const maxX = Math.min(width - 1, Math.ceil(cx + radius));
|
|
368
|
+
const minY = Math.max(0, Math.floor(cy - radius));
|
|
369
|
+
const maxY = Math.min(height - 1, Math.ceil(cy + radius));
|
|
370
|
+
for (let y = minY;y <= maxY; y += 1) {
|
|
371
|
+
for (let x = minX;x <= maxX; x += 1) {
|
|
372
|
+
const dx = x + 0.5 - cx;
|
|
373
|
+
const dy = y + 0.5 - cy;
|
|
374
|
+
const d = Math.sqrt(dx * dx + dy * dy);
|
|
375
|
+
if (d > radius)
|
|
376
|
+
continue;
|
|
377
|
+
const edge = Math.max(0, Math.min(1, radius - d));
|
|
378
|
+
blendOver(data, (y * width + x) * 4, color, alpha * Math.min(1, 0.35 + edge));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
338
382
|
function drawGlow(data, width, height, cx, cy, radius, color, alpha = 0.18) {
|
|
339
383
|
const minX = Math.max(0, Math.floor(cx - radius));
|
|
340
384
|
const maxX = Math.min(width - 1, Math.ceil(cx + radius));
|
|
@@ -347,11 +391,20 @@ function drawGlow(data, width, height, cx, cy, radius, color, alpha = 0.18) {
|
|
|
347
391
|
const d = Math.sqrt(dx * dx + dy * dy);
|
|
348
392
|
if (d > radius)
|
|
349
393
|
continue;
|
|
350
|
-
const falloff = Math.pow(1 - d / Math.max(1, radius),
|
|
394
|
+
const falloff = Math.pow(1 - d / Math.max(1, radius), GLOW_FALLOFF_EXP_IMAGE);
|
|
351
395
|
blendOver(data, (y * width + x) * 4, color, alpha * falloff);
|
|
352
396
|
}
|
|
353
397
|
}
|
|
354
398
|
}
|
|
399
|
+
function drawLine(data, width, height, x0, y0, x1, y1, color, alpha = 0.5, thickness = 1.4) {
|
|
400
|
+
const dx = x1 - x0;
|
|
401
|
+
const dy = y1 - y0;
|
|
402
|
+
const steps = Math.max(1, Math.ceil(Math.hypot(dx, dy) * 1.2));
|
|
403
|
+
for (let i = 0;i <= steps; i += 1) {
|
|
404
|
+
const t = i / steps;
|
|
405
|
+
drawDisc(data, width, height, x0 + dx * t, y0 + dy * t, thickness, color, alpha);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
355
408
|
function roundRectAlpha(px, py, x, y, w, h, r) {
|
|
356
409
|
const rx = Math.max(x + r, Math.min(px, x + w - r));
|
|
357
410
|
const ry = Math.max(y + r, Math.min(py, y + h - r));
|
|
@@ -455,7 +508,7 @@ function getPanelMask(width, height, rect, headerPx, blurScale) {
|
|
|
455
508
|
const cached = panelMaskCache.get(key);
|
|
456
509
|
if (cached)
|
|
457
510
|
return cached;
|
|
458
|
-
const radius = Math.max(
|
|
511
|
+
const radius = Math.max(PANEL_MASK_RADIUS_MIN, Math.min(PANEL_MASK_RADIUS_MAX, Math.round(Math.min(rect.width, rect.height) * PANEL_MASK_RADIUS_FACTOR)));
|
|
459
512
|
const sampledWidth = Math.max(1, Math.ceil(rect.width / blurScale));
|
|
460
513
|
const sampledHeight = Math.max(1, Math.ceil(rect.height / blurScale));
|
|
461
514
|
const x0 = Math.max(0, rect.left);
|
|
@@ -510,7 +563,7 @@ function getPanelMask(width, height, rect, headerPx, blurScale) {
|
|
|
510
563
|
function compositePanel(data, width, height, rect, headerPx) {
|
|
511
564
|
const blurScale = PANEL_BLUR_SCALE;
|
|
512
565
|
const sampled = downsampleRegion(data, width, height, rect, blurScale);
|
|
513
|
-
const blurRadius = Math.max(
|
|
566
|
+
const blurRadius = Math.max(PANEL_BLUR_RADIUS_MIN, Math.min(PANEL_BLUR_RADIUS_MAX, Math.round(Math.min(rect.width, rect.height) * PANEL_BLUR_RADIUS_FACTOR)));
|
|
514
567
|
const blurred = blurRgb(sampled.pixels, sampled.width, sampled.height, blurRadius);
|
|
515
568
|
const mask = getPanelMask(width, height, rect, headerPx, blurScale);
|
|
516
569
|
for (let i = 0;i < mask.indices.length; i += 1) {
|
|
@@ -529,16 +582,49 @@ function compositePanel(data, width, height, rect, headerPx) {
|
|
|
529
582
|
blendOver(data, mask.dividerIndices[i], PANEL_LINE, 0.28);
|
|
530
583
|
}
|
|
531
584
|
}
|
|
532
|
-
|
|
585
|
+
var RIG_GLYPH_STROKES = {
|
|
586
|
+
R: [[0, 0, 0, 1], [0, 0, 0.82, 0], [0.82, 0, 0.82, 0.5], [0, 0.5, 0.82, 0.5], [0.36, 0.5, 0.92, 1]],
|
|
587
|
+
I: [[0.5, 0, 0.5, 1], [0.18, 0, 0.82, 0], [0.18, 1, 0.82, 1]],
|
|
588
|
+
G: [[0.92, 0.08, 0.12, 0], [0.12, 0, 0.12, 1], [0.12, 1, 0.92, 1], [0.92, 0.5, 0.92, 1], [0.5, 0.5, 0.92, 0.5]]
|
|
589
|
+
};
|
|
590
|
+
function drawBigRigWordmark(data, width, height, layout, load) {
|
|
591
|
+
const sideBySide = layout.width >= FLEET_GRID_WIDTH * 1.9;
|
|
592
|
+
if (!sideBySide)
|
|
593
|
+
return;
|
|
594
|
+
const letters = "RIG";
|
|
595
|
+
const min = Math.min(width, height);
|
|
596
|
+
const glyphH = height * 0.42;
|
|
597
|
+
const glyphW = width * 0.13;
|
|
598
|
+
const gap = glyphW * 0.3;
|
|
599
|
+
const totalW = letters.length * glyphW + (letters.length - 1) * gap;
|
|
600
|
+
const centerX = width * 0.71;
|
|
601
|
+
const startX = centerX - totalW / 2;
|
|
602
|
+
const top = (height - glyphH) / 2;
|
|
603
|
+
const stroke = Math.max(2, min * 0.013);
|
|
604
|
+
drawGlow(data, width, height, centerX, top + glyphH / 2, Math.max(glyphW, glyphH) * 0.9, LIME, 0.022 + load * 0.02);
|
|
605
|
+
const strokeAlpha = 0.1 + load * 0.06;
|
|
606
|
+
letters.split("").forEach((letter, index) => {
|
|
607
|
+
const segments = RIG_GLYPH_STROKES[letter];
|
|
608
|
+
if (!segments)
|
|
609
|
+
return;
|
|
610
|
+
const ox = startX + index * (glyphW + gap);
|
|
611
|
+
for (const [x0, y0, x1, y1] of segments) {
|
|
612
|
+
drawLine(data, width, height, ox + x0 * glyphW, top + y0 * glyphH, ox + x1 * glyphW, top + y1 * glyphH, LIME_DIM, strokeAlpha, stroke);
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
function drawBackground(data, width, height, _tick, scene, layout, load, activeRuns) {
|
|
533
617
|
fillRgba(data, BG, BG_WORD);
|
|
534
|
-
drawStaticAsciiFleetBackground(data, width, height, scene, layout);
|
|
535
|
-
|
|
618
|
+
drawStaticAsciiFleetBackground(data, width, height, scene, layout, load, activeRuns);
|
|
619
|
+
drawBigRigWordmark(data, width, height, layout, load);
|
|
620
|
+
applyStaticAtmosphere(data, width, height, load);
|
|
536
621
|
}
|
|
537
622
|
function imageVisualFrameKey(input) {
|
|
538
623
|
const width = Math.max(1, Math.floor(input.pixelSize.width));
|
|
539
624
|
const height = Math.max(1, Math.floor(input.pixelSize.height));
|
|
540
625
|
const layer = "layer" in input ? input.layer ?? "full" : "full";
|
|
541
|
-
|
|
626
|
+
const load = loadBucket(input.load);
|
|
627
|
+
return `${layer}:${width}x${height}:${input.layout.width}x${input.layout.height}:${input.scene}:${input.tick}:l${load}:${input.panels.map((panel) => `${panel.id}:${panel.top}:${panel.height}:${panel.width ?? ""}:${panel.left ?? ""}:${panel.headerHeight ?? ""}`).join("|")}`;
|
|
542
628
|
}
|
|
543
629
|
function encodeKittyFrame(width, height, data, input) {
|
|
544
630
|
if (input.transport === "png") {
|
|
@@ -585,7 +671,9 @@ function renderImageVisualFrame(input) {
|
|
|
585
671
|
return null;
|
|
586
672
|
const layer = input.layer ?? "full";
|
|
587
673
|
const data = new Uint8ClampedArray(byteCount);
|
|
588
|
-
|
|
674
|
+
const load = loadBucket(input.load) / LOAD_BUCKETS;
|
|
675
|
+
const activeRuns = Math.max(0, Math.floor(input.activeRuns ?? 0));
|
|
676
|
+
drawBackground(data, width, height, 0, input.scene, input.layout, load, activeRuns);
|
|
589
677
|
if (layer === "split") {
|
|
590
678
|
const sequences = [encodeKittyFrame(width, height, data, input)];
|
|
591
679
|
let panelIndex = 0;
|
|
@@ -12,12 +12,15 @@ export type ImageVisualRenderRequest = {
|
|
|
12
12
|
readonly panels: readonly AppScenePanel[];
|
|
13
13
|
readonly scene: AppSceneId;
|
|
14
14
|
readonly tick: number;
|
|
15
|
+
readonly load?: number;
|
|
16
|
+
readonly activeRuns?: number;
|
|
15
17
|
readonly imageId: number;
|
|
16
18
|
readonly imageIds?: readonly number[];
|
|
17
19
|
readonly zIndex: number;
|
|
18
20
|
readonly transport: ImageTransport;
|
|
19
21
|
readonly layer?: ImageVisualLayerKind;
|
|
20
22
|
};
|
|
23
|
+
export declare function loadBucket(load: number | undefined): number;
|
|
21
24
|
export type ImageVisualRenderResult = {
|
|
22
25
|
readonly key: string;
|
|
23
26
|
readonly sequence: string;
|
|
@@ -67,6 +70,8 @@ export declare class ImageVisualLayer {
|
|
|
67
70
|
panels: readonly AppScenePanel[];
|
|
68
71
|
scene: AppSceneId;
|
|
69
72
|
tick: number;
|
|
73
|
+
load?: number;
|
|
74
|
+
activeRuns?: number;
|
|
70
75
|
}): boolean;
|
|
71
76
|
render(input: {
|
|
72
77
|
layout: StageLayout;
|
|
@@ -74,6 +79,8 @@ export declare class ImageVisualLayer {
|
|
|
74
79
|
panels: readonly AppScenePanel[];
|
|
75
80
|
scene: AppSceneId;
|
|
76
81
|
tick: number;
|
|
82
|
+
load?: number;
|
|
83
|
+
activeRuns?: number;
|
|
77
84
|
force?: boolean;
|
|
78
85
|
}): void;
|
|
79
86
|
flush(): boolean;
|