4runr-os 1.0.45 → 1.0.48
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/index.js +6 -34
- package/dist/index.js.map +1 -1
- package/dist/ui/runtime/hub.d.ts.map +1 -1
- package/dist/ui/runtime/hub.js +56 -20
- package/dist/ui/runtime/hub.js.map +1 -1
- package/dist/ui/v3/collectors/resources.d.ts +23 -0
- package/dist/ui/v3/collectors/resources.d.ts.map +1 -0
- package/dist/ui/v3/collectors/resources.js +117 -0
- package/dist/ui/v3/collectors/resources.js.map +1 -0
- package/dist/ui/v3/commands/commandResult.d.ts +25 -0
- package/dist/ui/v3/commands/commandResult.d.ts.map +1 -0
- package/dist/ui/v3/commands/commandResult.js +19 -0
- package/dist/ui/v3/commands/commandResult.js.map +1 -0
- package/dist/ui/v3/commands/parser.d.ts +14 -0
- package/dist/ui/v3/commands/parser.d.ts.map +1 -0
- package/dist/ui/v3/commands/parser.js +29 -0
- package/dist/ui/v3/commands/parser.js.map +1 -0
- package/dist/ui/v3/commands/router.d.ts +13 -0
- package/dist/ui/v3/commands/router.d.ts.map +1 -0
- package/dist/ui/v3/commands/router.js +69 -0
- package/dist/ui/v3/commands/router.js.map +1 -0
- package/dist/ui/v3/core/event.d.ts +19 -0
- package/dist/ui/v3/core/event.d.ts.map +1 -0
- package/dist/ui/v3/core/event.js +7 -0
- package/dist/ui/v3/core/event.js.map +1 -0
- package/dist/ui/v3/core/eventBus.d.ts +33 -0
- package/dist/ui/v3/core/eventBus.d.ts.map +1 -0
- package/dist/ui/v3/core/eventBus.js +78 -0
- package/dist/ui/v3/core/eventBus.js.map +1 -0
- package/dist/ui/v3/index.d.ts +8 -0
- package/dist/ui/v3/index.d.ts.map +1 -0
- package/dist/ui/v3/index.js +30 -0
- package/dist/ui/v3/index.js.map +1 -0
- package/dist/ui/v3/state/defaultState.d.ts +9 -0
- package/dist/ui/v3/state/defaultState.d.ts.map +1 -0
- package/dist/ui/v3/state/defaultState.js +11 -0
- package/dist/ui/v3/state/defaultState.js.map +1 -0
- package/dist/ui/v3/state/feedModel.d.ts +49 -0
- package/dist/ui/v3/state/feedModel.d.ts.map +1 -0
- package/dist/ui/v3/state/feedModel.js +84 -0
- package/dist/ui/v3/state/feedModel.js.map +1 -0
- package/dist/ui/v3/state/resourcesData.d.ts +15 -0
- package/dist/ui/v3/state/resourcesData.d.ts.map +1 -0
- package/dist/ui/v3/state/resourcesData.js +7 -0
- package/dist/ui/v3/state/resourcesData.js.map +1 -0
- package/dist/ui/v3/state/uiState.d.ts +12 -0
- package/dist/ui/v3/state/uiState.d.ts.map +1 -0
- package/dist/ui/v3/state/uiState.js +8 -0
- package/dist/ui/v3/state/uiState.js.map +1 -0
- package/dist/ui/v3/state/uiStateBuilder.d.ts +16 -0
- package/dist/ui/v3/state/uiStateBuilder.d.ts.map +1 -0
- package/dist/ui/v3/state/uiStateBuilder.js +35 -0
- package/dist/ui/v3/state/uiStateBuilder.js.map +1 -0
- package/dist/ui/v3/state/value.d.ts +39 -0
- package/dist/ui/v3/state/value.d.ts.map +1 -0
- package/dist/ui/v3/state/value.js +31 -0
- package/dist/ui/v3/state/value.js.map +1 -0
- package/dist/ui/v3/ui/focus.d.ts +28 -0
- package/dist/ui/v3/ui/focus.d.ts.map +1 -0
- package/dist/ui/v3/ui/focus.js +38 -0
- package/dist/ui/v3/ui/focus.js.map +1 -0
- package/dist/ui/v3/ui/layout/hubLayout.d.ts +43 -0
- package/dist/ui/v3/ui/layout/hubLayout.d.ts.map +1 -0
- package/dist/ui/v3/ui/layout/hubLayout.js +170 -0
- package/dist/ui/v3/ui/layout/hubLayout.js.map +1 -0
- package/dist/ui/v3/ui/layout/phase1Layout.d.ts +34 -0
- package/dist/ui/v3/ui/layout/phase1Layout.d.ts.map +1 -0
- package/dist/ui/v3/ui/layout/phase1Layout.js +107 -0
- package/dist/ui/v3/ui/layout/phase1Layout.js.map +1 -0
- package/dist/ui/v3/ui/minimalRuntime.d.ts +14 -0
- package/dist/ui/v3/ui/minimalRuntime.d.ts.map +1 -0
- package/dist/ui/v3/ui/minimalRuntime.js +111 -0
- package/dist/ui/v3/ui/minimalRuntime.js.map +1 -0
- package/dist/ui/v3/ui/panels/ResourcesPanel.d.ts +16 -0
- package/dist/ui/v3/ui/panels/ResourcesPanel.d.ts.map +1 -0
- package/dist/ui/v3/ui/panels/ResourcesPanel.js +46 -0
- package/dist/ui/v3/ui/panels/ResourcesPanel.js.map +1 -0
- package/dist/ui/v3/ui/phase1Runtime.d.ts +22 -0
- package/dist/ui/v3/ui/phase1Runtime.d.ts.map +1 -0
- package/dist/ui/v3/ui/phase1Runtime.js +574 -0
- package/dist/ui/v3/ui/phase1Runtime.js.map +1 -0
- package/dist/ui/v3/ui/primitives/Panel.d.ts +39 -0
- package/dist/ui/v3/ui/primitives/Panel.d.ts.map +1 -0
- package/dist/ui/v3/ui/primitives/Panel.js +105 -0
- package/dist/ui/v3/ui/primitives/Panel.js.map +1 -0
- package/dist/ui/v3/ui/theme.d.ts +37 -0
- package/dist/ui/v3/ui/theme.d.ts.map +1 -0
- package/dist/ui/v3/ui/theme.js +40 -0
- package/dist/ui/v3/ui/theme.js.map +1 -0
- package/dist/ui/v3/ui/widgets/CommandLine.d.ts +26 -0
- package/dist/ui/v3/ui/widgets/CommandLine.d.ts.map +1 -0
- package/dist/ui/v3/ui/widgets/CommandLine.js +67 -0
- package/dist/ui/v3/ui/widgets/CommandLine.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hub Layout Calculator
|
|
3
|
+
*
|
|
4
|
+
* Pure function to compute panel positions and sizes.
|
|
5
|
+
* NO blessed logic here - just math.
|
|
6
|
+
*/
|
|
7
|
+
const MIN_WIDTH = 120;
|
|
8
|
+
const MIN_HEIGHT = 35;
|
|
9
|
+
const BOTTOM_BAR_HEIGHT = 3;
|
|
10
|
+
/**
|
|
11
|
+
* Compute hub layout for given terminal dimensions
|
|
12
|
+
*
|
|
13
|
+
* Layout structure:
|
|
14
|
+
* - Left column (3 panels): POSTURE, RESOURCES, ACTIVE ASSETS (~30% width)
|
|
15
|
+
* - Center main (1 panel): OPERATIONS FEED (remaining width)
|
|
16
|
+
* - Right column (2 panels): NETWORK/ORIGIN, CAPABILITY FLAGS (~25% width)
|
|
17
|
+
* - Bottom bar (1 panel): COMMAND SURFACE + STATUS STRIP (fixed 3 lines)
|
|
18
|
+
*
|
|
19
|
+
* Rules:
|
|
20
|
+
* - Minimum size: 120x35
|
|
21
|
+
* - No overlaps
|
|
22
|
+
* - No negative dimensions
|
|
23
|
+
* - No zero-height panels
|
|
24
|
+
*/
|
|
25
|
+
export function computeHubLayout(width, height) {
|
|
26
|
+
// Check minimum size
|
|
27
|
+
if (width < MIN_WIDTH || height < MIN_HEIGHT) {
|
|
28
|
+
return {
|
|
29
|
+
ok: false,
|
|
30
|
+
errorMessage: `Terminal too small (need ${MIN_WIDTH}x${MIN_HEIGHT})`,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Allocate bottom bar (fixed height)
|
|
34
|
+
const bottomBarHeight = BOTTOM_BAR_HEIGHT;
|
|
35
|
+
const availableHeight = height - bottomBarHeight - 1; // -1 for divider
|
|
36
|
+
// Allocate column widths
|
|
37
|
+
// Account for dividers: 1 between left-center, 1 between center-right
|
|
38
|
+
const leftColWidth = Math.floor(width * 0.30); // 30%
|
|
39
|
+
const rightColWidth = Math.floor(width * 0.25); // 25%
|
|
40
|
+
const centerWidth = width - leftColWidth - rightColWidth - 2; // -2 for dividers between columns
|
|
41
|
+
// Validate no negative dimensions
|
|
42
|
+
if (leftColWidth <= 0 || rightColWidth <= 0 || centerWidth <= 0 || availableHeight <= 0) {
|
|
43
|
+
return {
|
|
44
|
+
ok: false,
|
|
45
|
+
errorMessage: `Terminal too small (need ${MIN_WIDTH}x${MIN_HEIGHT})`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// Left column: 3 panels stacked evenly with spacing
|
|
49
|
+
const leftPanelSpacing = 1; // 1 line spacing between panels
|
|
50
|
+
// Total: 3 panels + 2 spacers = availableHeight
|
|
51
|
+
// So: leftPanelHeight = (availableHeight - 2 * spacing) / 3
|
|
52
|
+
const leftPanelHeight = Math.floor((availableHeight - 2 * leftPanelSpacing) / 3);
|
|
53
|
+
// Right column: 2 panels (top larger, bottom smaller)
|
|
54
|
+
const rightTopHeight = Math.floor(availableHeight * 0.6); // 60% for top
|
|
55
|
+
const rightBottomHeight = availableHeight - rightTopHeight - leftPanelSpacing; // remaining for bottom
|
|
56
|
+
// Calculate positions
|
|
57
|
+
let currentTop = 0;
|
|
58
|
+
// Left column panels
|
|
59
|
+
const posture = {
|
|
60
|
+
top: currentTop,
|
|
61
|
+
left: 0,
|
|
62
|
+
width: leftColWidth,
|
|
63
|
+
height: leftPanelHeight,
|
|
64
|
+
};
|
|
65
|
+
currentTop += leftPanelHeight + leftPanelSpacing;
|
|
66
|
+
const resources = {
|
|
67
|
+
top: currentTop,
|
|
68
|
+
left: 0,
|
|
69
|
+
width: leftColWidth,
|
|
70
|
+
height: leftPanelHeight,
|
|
71
|
+
};
|
|
72
|
+
currentTop += leftPanelHeight + leftPanelSpacing;
|
|
73
|
+
const assets = {
|
|
74
|
+
top: currentTop,
|
|
75
|
+
left: 0,
|
|
76
|
+
width: leftColWidth,
|
|
77
|
+
height: leftPanelHeight,
|
|
78
|
+
};
|
|
79
|
+
// Center panel (full available height)
|
|
80
|
+
const feed = {
|
|
81
|
+
top: 0,
|
|
82
|
+
left: leftColWidth + 1, // +1 for divider
|
|
83
|
+
width: centerWidth,
|
|
84
|
+
height: availableHeight,
|
|
85
|
+
};
|
|
86
|
+
// Right column panels
|
|
87
|
+
const network = {
|
|
88
|
+
top: 0,
|
|
89
|
+
left: leftColWidth + centerWidth + 2, // +1 for left divider, +1 for center divider
|
|
90
|
+
width: rightColWidth,
|
|
91
|
+
height: rightTopHeight,
|
|
92
|
+
};
|
|
93
|
+
const capabilities = {
|
|
94
|
+
top: rightTopHeight + leftPanelSpacing,
|
|
95
|
+
left: leftColWidth + centerWidth + 2,
|
|
96
|
+
width: rightColWidth,
|
|
97
|
+
height: rightBottomHeight,
|
|
98
|
+
};
|
|
99
|
+
// Bottom bar (full width)
|
|
100
|
+
const bottom = {
|
|
101
|
+
top: availableHeight + 1, // +1 for divider
|
|
102
|
+
left: 0,
|
|
103
|
+
width: width,
|
|
104
|
+
height: bottomBarHeight,
|
|
105
|
+
};
|
|
106
|
+
// Validate no overlaps or negative dimensions
|
|
107
|
+
const layout = {
|
|
108
|
+
posture,
|
|
109
|
+
resources,
|
|
110
|
+
assets,
|
|
111
|
+
feed,
|
|
112
|
+
network,
|
|
113
|
+
capabilities,
|
|
114
|
+
bottom,
|
|
115
|
+
};
|
|
116
|
+
// Final validation
|
|
117
|
+
if (!validateLayout(layout, width, height)) {
|
|
118
|
+
return {
|
|
119
|
+
ok: false,
|
|
120
|
+
errorMessage: `Terminal too small (need ${MIN_WIDTH}x${MIN_HEIGHT})`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
ok: true,
|
|
125
|
+
layout,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Validate layout has no overlaps or invalid dimensions
|
|
130
|
+
*/
|
|
131
|
+
function validateLayout(layout, terminalWidth, terminalHeight) {
|
|
132
|
+
const panels = [
|
|
133
|
+
layout.posture,
|
|
134
|
+
layout.resources,
|
|
135
|
+
layout.assets,
|
|
136
|
+
layout.feed,
|
|
137
|
+
layout.network,
|
|
138
|
+
layout.capabilities,
|
|
139
|
+
layout.bottom,
|
|
140
|
+
];
|
|
141
|
+
// Check for negative or zero dimensions
|
|
142
|
+
for (const panel of panels) {
|
|
143
|
+
if (panel.width <= 0 || panel.height <= 0 || panel.top < 0 || panel.left < 0) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
// Check bounds
|
|
147
|
+
if (panel.left + panel.width > terminalWidth || panel.top + panel.height > terminalHeight) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Check for overlaps (simple check - panels should not intersect)
|
|
152
|
+
for (let i = 0; i < panels.length; i++) {
|
|
153
|
+
for (let j = i + 1; j < panels.length; j++) {
|
|
154
|
+
if (panelsIntersect(panels[i], panels[j])) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Check if two rectangles intersect
|
|
163
|
+
*/
|
|
164
|
+
function panelsIntersect(a, b) {
|
|
165
|
+
return !(a.left + a.width <= b.left ||
|
|
166
|
+
b.left + b.width <= a.left ||
|
|
167
|
+
a.top + a.height <= b.top ||
|
|
168
|
+
b.top + b.height <= a.top);
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=hubLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hubLayout.js","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/layout/hubLayout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,MAAc;IAC5D,qBAAqB;IACrB,IAAI,KAAK,GAAG,SAAS,IAAI,MAAM,GAAG,UAAU,EAAE,CAAC;QAC7C,OAAO;YACL,EAAE,EAAE,KAAK;YACT,YAAY,EAAE,4BAA4B,SAAS,IAAI,UAAU,GAAG;SACrE,CAAC;IACJ,CAAC;IAED,qCAAqC;IACrC,MAAM,eAAe,GAAG,iBAAiB,CAAC;IAC1C,MAAM,eAAe,GAAG,MAAM,GAAG,eAAe,GAAG,CAAC,CA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,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,CAAU,EAAE,CAAU;IAC7C,OAAO,CAAC,CACN,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI;QAC1B,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI;QAC1B,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG;QACzB,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 1 Layout Calculator
|
|
3
|
+
*
|
|
4
|
+
* Fixed hub layout with 7 boxes:
|
|
5
|
+
* - Left column (3 stacked): POSTURE, RESOURCES, ASSETS
|
|
6
|
+
* - Center (1): OPERATIONS
|
|
7
|
+
* - Right column (2 stacked): NETWORK, CAPABILITIES
|
|
8
|
+
* - Bottom bar (1): COMMAND LINE
|
|
9
|
+
*/
|
|
10
|
+
export interface BoxRect {
|
|
11
|
+
top: number;
|
|
12
|
+
left: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
export interface Phase1Layout {
|
|
17
|
+
posture: BoxRect;
|
|
18
|
+
resources: BoxRect;
|
|
19
|
+
assets: BoxRect;
|
|
20
|
+
operations: BoxRect;
|
|
21
|
+
network: BoxRect;
|
|
22
|
+
capabilities: BoxRect;
|
|
23
|
+
commandLine: BoxRect;
|
|
24
|
+
}
|
|
25
|
+
export interface LayoutResult {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
errorMessage?: string;
|
|
28
|
+
layout?: Phase1Layout;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Compute Phase 1 layout
|
|
32
|
+
*/
|
|
33
|
+
export declare function computePhase1Layout(width: number, height: number): LayoutResult;
|
|
34
|
+
//# sourceMappingURL=phase1Layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase1Layout.d.ts","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/layout/phase1Layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAOD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAiG/E"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 1 Layout Calculator
|
|
3
|
+
*
|
|
4
|
+
* Fixed hub layout with 7 boxes:
|
|
5
|
+
* - Left column (3 stacked): POSTURE, RESOURCES, ASSETS
|
|
6
|
+
* - Center (1): OPERATIONS
|
|
7
|
+
* - Right column (2 stacked): NETWORK, CAPABILITIES
|
|
8
|
+
* - Bottom bar (1): COMMAND LINE
|
|
9
|
+
*/
|
|
10
|
+
const MIN_WIDTH = 120;
|
|
11
|
+
const MIN_HEIGHT = 35;
|
|
12
|
+
const BOTTOM_BAR_HEIGHT = 3; // Fixed height for command line
|
|
13
|
+
const PANEL_SPACING = 1; // 1 character spacing between panels
|
|
14
|
+
/**
|
|
15
|
+
* Compute Phase 1 layout
|
|
16
|
+
*/
|
|
17
|
+
export function computePhase1Layout(width, height) {
|
|
18
|
+
// Check minimum size
|
|
19
|
+
if (width < MIN_WIDTH || height < MIN_HEIGHT) {
|
|
20
|
+
return {
|
|
21
|
+
ok: false,
|
|
22
|
+
errorMessage: `Terminal too small (need ${MIN_WIDTH}x${MIN_HEIGHT})`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// Allocate bottom bar (fixed height)
|
|
26
|
+
const availableHeight = height - BOTTOM_BAR_HEIGHT - PANEL_SPACING;
|
|
27
|
+
// Allocate column widths
|
|
28
|
+
// Left column: ~30%
|
|
29
|
+
// Right column: ~25%
|
|
30
|
+
// Center: remaining
|
|
31
|
+
// Account for 2 vertical dividers between columns
|
|
32
|
+
const leftColWidth = Math.floor((width - (PANEL_SPACING * 2)) * 0.30);
|
|
33
|
+
const rightColWidth = Math.floor((width - (PANEL_SPACING * 2)) * 0.25);
|
|
34
|
+
const centerWidth = width - leftColWidth - rightColWidth - (PANEL_SPACING * 2);
|
|
35
|
+
// Validate no negative or zero dimensions
|
|
36
|
+
if (leftColWidth <= 0 || rightColWidth <= 0 || centerWidth <= 0 || availableHeight <= 0) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
errorMessage: `Terminal too small (need ${MIN_WIDTH}x${MIN_HEIGHT})`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Left column: 3 panels stacked evenly
|
|
43
|
+
// Account for 2 horizontal dividers between 3 panels
|
|
44
|
+
const leftPanelHeight = Math.floor((availableHeight - (PANEL_SPACING * 2)) / 3);
|
|
45
|
+
// Right column: 2 panels stacked
|
|
46
|
+
// Account for 1 horizontal divider between 2 panels
|
|
47
|
+
const rightTopHeight = Math.floor((availableHeight - PANEL_SPACING) * 0.6); // 60% for top
|
|
48
|
+
const rightBottomHeight = availableHeight - rightTopHeight - PANEL_SPACING; // remaining for bottom
|
|
49
|
+
// Validate panel heights
|
|
50
|
+
if (leftPanelHeight <= 0 || rightTopHeight <= 0 || rightBottomHeight <= 0) {
|
|
51
|
+
return {
|
|
52
|
+
ok: false,
|
|
53
|
+
errorMessage: `Terminal too small (need ${MIN_WIDTH}x${MIN_HEIGHT})`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// Calculate positions
|
|
57
|
+
const layout = {
|
|
58
|
+
// Left column panels
|
|
59
|
+
posture: {
|
|
60
|
+
top: 0,
|
|
61
|
+
left: 0,
|
|
62
|
+
width: leftColWidth,
|
|
63
|
+
height: leftPanelHeight,
|
|
64
|
+
},
|
|
65
|
+
resources: {
|
|
66
|
+
top: leftPanelHeight + PANEL_SPACING,
|
|
67
|
+
left: 0,
|
|
68
|
+
width: leftColWidth,
|
|
69
|
+
height: leftPanelHeight,
|
|
70
|
+
},
|
|
71
|
+
assets: {
|
|
72
|
+
top: (leftPanelHeight + PANEL_SPACING) * 2,
|
|
73
|
+
left: 0,
|
|
74
|
+
width: leftColWidth,
|
|
75
|
+
height: leftPanelHeight,
|
|
76
|
+
},
|
|
77
|
+
// Center panel (full available height)
|
|
78
|
+
operations: {
|
|
79
|
+
top: 0,
|
|
80
|
+
left: leftColWidth + PANEL_SPACING,
|
|
81
|
+
width: centerWidth,
|
|
82
|
+
height: availableHeight,
|
|
83
|
+
},
|
|
84
|
+
// Right column panels
|
|
85
|
+
network: {
|
|
86
|
+
top: 0,
|
|
87
|
+
left: leftColWidth + PANEL_SPACING + centerWidth + PANEL_SPACING,
|
|
88
|
+
width: rightColWidth,
|
|
89
|
+
height: rightTopHeight,
|
|
90
|
+
},
|
|
91
|
+
capabilities: {
|
|
92
|
+
top: rightTopHeight + PANEL_SPACING,
|
|
93
|
+
left: leftColWidth + PANEL_SPACING + centerWidth + PANEL_SPACING,
|
|
94
|
+
width: rightColWidth,
|
|
95
|
+
height: rightBottomHeight,
|
|
96
|
+
},
|
|
97
|
+
// Bottom bar (command line)
|
|
98
|
+
commandLine: {
|
|
99
|
+
top: availableHeight + PANEL_SPACING,
|
|
100
|
+
left: 0,
|
|
101
|
+
width: width,
|
|
102
|
+
height: BOTTOM_BAR_HEIGHT,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
return { ok: true, layout };
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=phase1Layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase1Layout.js","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/layout/phase1Layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyBH,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,iBAAiB,GAAG,CAAC,CAAC,CAAC,gCAAgC;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC,qCAAqC;AAE9D;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa,EAAE,MAAc;IAC/D,qBAAqB;IACrB,IAAI,KAAK,GAAG,SAAS,IAAI,MAAM,GAAG,UAAU,EAAE,CAAC;QAC7C,OAAO;YACL,EAAE,EAAE,KAAK;YACT,YAAY,EAAE,4BAA4B,SAAS,IAAI,UAAU,GAAG;SACrE,CAAC;IACJ,CAAC;IAED,qCAAqC;IACrC,MAAM,eAAe,GAAG,MAAM,GAAG,iBAAiB,GAAG,aAAa,CAAC;IAEnE,yBAAyB;IACzB,oBAAoB;IACpB,qBAAqB;IACrB,oBAAoB;IACpB,kDAAkD;IAClD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACtE,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,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AAC;YACP,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,eAAe;SACxB;QACD,MAAM,EAAE;YACN,GAAG,EAAE,CAAC,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC;YAC1C,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,eAAe;SACxB;QACD,uCAAuC;QACvC,UAAU,EAAE;YACV,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,YAAY,GAAG,aAAa;YAClC,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,eAAe;SACxB;QACD,sBAAsB;QACtB,OAAO,EAAE;YACP,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa;YAChE,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,cAAc;SACvB;QACD,YAAY,EAAE;YACZ,GAAG,EAAE,cAAc,GAAG,aAAa;YACnC,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa;YAChE,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,iBAAiB;SAC1B;QACD,4BAA4B;QAC5B,WAAW,EAAE;YACX,GAAG,EAAE,eAAe,GAAG,aAAa;YACpC,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,iBAAiB;SAC1B;KACF,CAAC;IAEF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal TUI Runtime (Phase 0)
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* - Initialize neo-blessed screen
|
|
6
|
+
* - Render a simple label
|
|
7
|
+
* - Handle clean exit (q, Ctrl+C)
|
|
8
|
+
* - Restore terminal state on exit
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Start minimal TUI runtime
|
|
12
|
+
*/
|
|
13
|
+
export declare function startMinimalTUI(): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=minimalRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimalRuntime.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/ui/minimalRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+CH;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAsErD"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal TUI Runtime (Phase 0)
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* - Initialize neo-blessed screen
|
|
6
|
+
* - Render a simple label
|
|
7
|
+
* - Handle clean exit (q, Ctrl+C)
|
|
8
|
+
* - Restore terminal state on exit
|
|
9
|
+
*/
|
|
10
|
+
import blessed from 'neo-blessed';
|
|
11
|
+
// Type assertion for blessed
|
|
12
|
+
const blessedLib = blessed;
|
|
13
|
+
let screen = null;
|
|
14
|
+
let isCleaningUp = false; // Guard to ensure cleanup runs exactly once
|
|
15
|
+
/**
|
|
16
|
+
* Cleanup and exit
|
|
17
|
+
*
|
|
18
|
+
* Rules:
|
|
19
|
+
* - Must restore terminal state
|
|
20
|
+
* - Must run exactly once (protected by isCleaningUp guard)
|
|
21
|
+
* - Must call screen.destroy() if screen exists
|
|
22
|
+
*/
|
|
23
|
+
function cleanupAndExit(code = 0) {
|
|
24
|
+
// Guard: ensure cleanup runs exactly once
|
|
25
|
+
if (isCleaningUp) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
isCleaningUp = true;
|
|
29
|
+
// Restore terminal state
|
|
30
|
+
if (screen) {
|
|
31
|
+
try {
|
|
32
|
+
screen.destroy();
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
// Ignore destroy errors
|
|
36
|
+
}
|
|
37
|
+
screen = null;
|
|
38
|
+
}
|
|
39
|
+
// Restore cursor and input echo
|
|
40
|
+
// blessed should handle this, but we ensure it
|
|
41
|
+
if (process.stdout.isTTY) {
|
|
42
|
+
process.stdout.write('\x1b[?25h'); // Show cursor
|
|
43
|
+
process.stdout.write('\x1b[?1049l'); // Exit alternate screen
|
|
44
|
+
}
|
|
45
|
+
// Exit
|
|
46
|
+
process.exit(code);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Start minimal TUI runtime
|
|
50
|
+
*/
|
|
51
|
+
export async function startMinimalTUI() {
|
|
52
|
+
// Suppress console.log during TUI
|
|
53
|
+
const originalLog = console.log;
|
|
54
|
+
console.log = () => { }; // Suppress stdout
|
|
55
|
+
try {
|
|
56
|
+
// Create screen
|
|
57
|
+
screen = blessedLib.screen({
|
|
58
|
+
smartCSR: true,
|
|
59
|
+
title: '4Runr Terminal UI V3',
|
|
60
|
+
fullUnicode: true,
|
|
61
|
+
});
|
|
62
|
+
if (!screen) {
|
|
63
|
+
throw new Error('Failed to create screen');
|
|
64
|
+
}
|
|
65
|
+
// Render simple label (centered)
|
|
66
|
+
const labelText = '4Runr OS Terminal UI v3';
|
|
67
|
+
const label = blessedLib.box({
|
|
68
|
+
top: Math.floor((screen.height - 1) / 2),
|
|
69
|
+
left: Math.floor((screen.width - labelText.length) / 2),
|
|
70
|
+
width: labelText.length,
|
|
71
|
+
height: 1,
|
|
72
|
+
content: labelText,
|
|
73
|
+
tags: true,
|
|
74
|
+
style: {
|
|
75
|
+
fg: 'cyan',
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
screen.append(label);
|
|
79
|
+
// Handle exit keys
|
|
80
|
+
screen.key(['q', 'Q'], () => {
|
|
81
|
+
cleanupAndExit(0);
|
|
82
|
+
});
|
|
83
|
+
screen.key(['C-c'], () => {
|
|
84
|
+
cleanupAndExit(0);
|
|
85
|
+
});
|
|
86
|
+
// Handle process termination signals
|
|
87
|
+
process.on('SIGINT', () => {
|
|
88
|
+
cleanupAndExit(0);
|
|
89
|
+
});
|
|
90
|
+
process.on('SIGTERM', () => {
|
|
91
|
+
cleanupAndExit(0);
|
|
92
|
+
});
|
|
93
|
+
// Handle uncaught exceptions
|
|
94
|
+
process.on('uncaughtException', (error) => {
|
|
95
|
+
// Restore console.log for error output
|
|
96
|
+
console.log = originalLog;
|
|
97
|
+
console.error('Uncaught exception:', error);
|
|
98
|
+
cleanupAndExit(1);
|
|
99
|
+
});
|
|
100
|
+
// Initial render
|
|
101
|
+
screen.render();
|
|
102
|
+
// Restore console.log on successful start
|
|
103
|
+
console.log = originalLog;
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
// Restore console.log on error
|
|
107
|
+
console.log = originalLog;
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=minimalRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimalRuntime.js","sourceRoot":"","sources":["../../../../src/ui/v3/ui/minimalRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,6BAA6B;AAC7B,MAAM,UAAU,GAAG,OAAc,CAAC;AAElC,IAAI,MAAM,GAA0B,IAAI,CAAC;AACzC,IAAI,YAAY,GAAG,KAAK,CAAC,CAAC,4CAA4C;AAEtE;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,OAAe,CAAC;IACtC,0CAA0C;IAC1C,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IACD,YAAY,GAAG,IAAI,CAAC;IAEpB,yBAAyB;IACzB,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,CAAC;YACH,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,wBAAwB;QAC1B,CAAC;QACD,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IAED,gCAAgC;IAChC,+CAA+C;I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geted, truncation-safe.
|
|
6
|
+
*/
|
|
7
|
+
import type { Value } from '../../state/value.js';
|
|
8
|
+
import type { ResourcesData } from '../../state/resourcesData.js';
|
|
9
|
+
/**
|
|
10
|
+
* Render Resources panel content
|
|
11
|
+
*
|
|
12
|
+
* Returns array of lines (max ~6 lines)
|
|
13
|
+
* Lines will be truncated to panel width in updateResourcesPanel()
|
|
14
|
+
*/
|
|
15
|
+
export declare function renderResourcesPanel(value: Value<ResourcesData>): string[];
|
|
16
|
+
//# sourceMappingURL=ResourcesPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourcesPanel.d.ts","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/panels/ResourcesPanel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAclE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,MAAM,EAAE,CA4B1E"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resources Panel Renderer (Phase 4)
|
|
3
|
+
*
|
|
4
|
+
* Renders the RESOURCES panel content.
|
|
5
|
+
* Line-budgeted, truncation-safe.
|
|
6
|
+
*/
|
|
7
|
+
import { isAvailable } from '../../state/value.js';
|
|
8
|
+
/**
|
|
9
|
+
* Format uptime seconds to HH:MM:SS
|
|
10
|
+
*/
|
|
11
|
+
function formatUptime(seconds) {
|
|
12
|
+
const hours = Math.floor(seconds / 3600);
|
|
13
|
+
const minutes = Math.floor((seconds % 3600) / 60);
|
|
14
|
+
const secs = Math.floor(seconds % 60);
|
|
15
|
+
return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Render Resources panel content
|
|
19
|
+
*
|
|
20
|
+
* Returns array of lines (max ~6 lines)
|
|
21
|
+
* Lines will be truncated to panel width in updateResourcesPanel()
|
|
22
|
+
*/
|
|
23
|
+
export function renderResourcesPanel(value) {
|
|
24
|
+
const lines = [];
|
|
25
|
+
if (isAvailable(value)) {
|
|
26
|
+
const data = value.data;
|
|
27
|
+
// Line 1: CPU and Load
|
|
28
|
+
lines.push(`CPU: ${data.cpuPercent.toFixed(1)}% | Load1: ${data.load1.toFixed(2)}`);
|
|
29
|
+
// Line 2: RAM
|
|
30
|
+
lines.push(`RAM: ${data.ramUsedMB} / ${data.ramTotalMB} MB`);
|
|
31
|
+
// Line 3: Disk
|
|
32
|
+
lines.push(`DISK: ${data.diskUsedGB} / ${data.diskTotalGB} GB`);
|
|
33
|
+
// Line 4: Uptime
|
|
34
|
+
lines.push(`UP: ${formatUptime(data.uptimeSeconds)}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// UNAVAILABLE state
|
|
38
|
+
lines.push('STATUS: UNAVAILABLE');
|
|
39
|
+
lines.push(`REASON: ${value.reason}`);
|
|
40
|
+
if (value.nextAction) {
|
|
41
|
+
lines.push(`NEXT: ${value.nextAction}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return lines;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=ResourcesPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourcesPanel.js","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/panels/ResourcesPanel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;GAEG;AACH,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,CA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AAM,EAAE,CAAC,CAAC;QACtC,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 1 Runtime
|
|
3
|
+
*
|
|
4
|
+
* Layout skeleton + dedicated command line
|
|
5
|
+
* - 6 read-only panels
|
|
6
|
+
* - 1 command line (only writable area)
|
|
7
|
+
* - Focus locked to command line
|
|
8
|
+
*
|
|
9
|
+
* Phase 2: Command Router
|
|
10
|
+
* - Command parsing and routing
|
|
11
|
+
* - Output to OPERATIONS FEED panel
|
|
12
|
+
*
|
|
13
|
+
* Phase 3: Operations Feed as Only Output Channel
|
|
14
|
+
* - EventBus system
|
|
15
|
+
* - All output goes through EventBus → feedStore
|
|
16
|
+
* - Long line truncation
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Start Phase 1 runtime
|
|
20
|
+
*/
|
|
21
|
+
export declare function startPhase1Runtime(): Promise<void>;
|
|
22
|
+
//# sourceMappingURL=phase1Runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase1Runtime.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/ui/phase1Runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAqNH;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAibxD"}
|