4runr-os 1.0.46 → 1.0.49
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/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,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 = 80;
|
|
11
|
+
const MIN_HEIGHT = 25;
|
|
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,EAAE,CAAC;AACrB,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,CAAC,aAAa,GAAG,CAAC,CAAC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ACnB,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;IAC/C,IAAI,OAAO,CAAC,MAAM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
|
|
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,CAAC,KAAK,CAAC,CAAC,OAAO,G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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"}
|