4runr-os 1.0.46 → 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/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,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel Primitive
|
|
3
|
+
*
|
|
4
|
+
* THE ONLY WAY TO DRAW PANELS
|
|
5
|
+
*
|
|
6
|
+
* Responsibilities:
|
|
7
|
+
* - Draw a bordered box at given position
|
|
8
|
+
* - Render title in top border
|
|
9
|
+
* - Render content with padding
|
|
10
|
+
* - Enforce line budget (truncate safely)
|
|
11
|
+
* - Enforce line width budget (clamp to innerWidth)
|
|
12
|
+
*/
|
|
13
|
+
import blessed from 'neo-blessed';
|
|
14
|
+
// Type assertion for blessed
|
|
15
|
+
const blessedLib = blessed;
|
|
16
|
+
import { theme } from '../theme.js';
|
|
17
|
+
import { getBlessedColor } from '../theme.js';
|
|
18
|
+
/**
|
|
19
|
+
* Create and render a panel
|
|
20
|
+
*
|
|
21
|
+
* Rules:
|
|
22
|
+
* - Never crashes if content is too long (truncates)
|
|
23
|
+
* - Enforces line budget
|
|
24
|
+
* - Enforces line width budget
|
|
25
|
+
* - No wrapping (truncation only)
|
|
26
|
+
*/
|
|
27
|
+
export function createPanel(options) {
|
|
28
|
+
const { screen, boxRect, title, lines, borderColor = 'cyan', severity } = options;
|
|
29
|
+
// Calculate inner dimensions (accounting for borders and padding)
|
|
30
|
+
// Blessed borders take 2 chars (1 left + 1 right) and 2 lines (1 top + 1 bottom)
|
|
31
|
+
const innerWidth = boxRect.width - 2 - (theme.padding.panel * 2); // -2 for borders, -padding both sides
|
|
32
|
+
const innerHeight = boxRect.height - 2 - (theme.padding.panel * 2); // -2 for borders, -padding top/bottom
|
|
33
|
+
// Enforce line budget
|
|
34
|
+
const maxLines = Math.max(0, innerHeight);
|
|
35
|
+
const displayLines = lines.slice(0, maxLines);
|
|
36
|
+
// Truncate if we had more lines
|
|
37
|
+
if (lines.length > maxLines) {
|
|
38
|
+
// Replace last line with truncation indicator
|
|
39
|
+
if (displayLines.length > 0) {
|
|
40
|
+
displayLines[displayLines.length - 1] = truncateLine(displayLines[displayLines.length - 1] || '', innerWidth - 3) + '…';
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
displayLines.push('…');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Enforce line width budget (clamp each line to innerWidth)
|
|
47
|
+
const clampedLines = displayLines.map(line => truncateLine(line, innerWidth));
|
|
48
|
+
// Build content with padding
|
|
49
|
+
const paddingTop = '\n'.repeat(theme.padding.panel);
|
|
50
|
+
const paddingLeft = ' '.repeat(theme.padding.panel);
|
|
51
|
+
const content = clampedLines
|
|
52
|
+
.map(line => paddingLeft + line)
|
|
53
|
+
.join('\n');
|
|
54
|
+
// Determine border color based on severity or default
|
|
55
|
+
let finalBorderColor = getBlessedColor(borderColor);
|
|
56
|
+
if (severity === 'error') {
|
|
57
|
+
finalBorderColor = getBlessedColor('red');
|
|
58
|
+
}
|
|
59
|
+
else if (severity === 'warn') {
|
|
60
|
+
finalBorderColor = getBlessedColor('amber');
|
|
61
|
+
}
|
|
62
|
+
// Create blessed box - read-only, no focus (Phase A, Phase B)
|
|
63
|
+
const panel = blessedLib.box({
|
|
64
|
+
top: boxRect.top,
|
|
65
|
+
left: boxRect.left,
|
|
66
|
+
width: boxRect.width,
|
|
67
|
+
height: boxRect.height,
|
|
68
|
+
border: {
|
|
69
|
+
type: theme.border.single,
|
|
70
|
+
},
|
|
71
|
+
tags: true,
|
|
72
|
+
content: paddingTop + content,
|
|
73
|
+
style: {
|
|
74
|
+
border: {
|
|
75
|
+
fg: finalBorderColor,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
// Prevent panel from receiving input (Phase B)
|
|
79
|
+
clickable: false,
|
|
80
|
+
keys: false,
|
|
81
|
+
mouse: false,
|
|
82
|
+
input: false,
|
|
83
|
+
// Make scrollable for feed panel (Phase D)
|
|
84
|
+
scrollable: false, // Individual panels can override this
|
|
85
|
+
alwaysScroll: false,
|
|
86
|
+
});
|
|
87
|
+
// Set title in top border (blessed handles this automatically if we set label)
|
|
88
|
+
// But we need to manually format it
|
|
89
|
+
const titleText = title.toUpperCase() + ' '.repeat(theme.title.spacing);
|
|
90
|
+
panel.setLabel(` {${finalBorderColor}-fg}${titleText}{/}`);
|
|
91
|
+
return panel;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Truncate a line to maxWidth
|
|
95
|
+
* Handles multi-byte characters safely
|
|
96
|
+
*/
|
|
97
|
+
function truncateLine(line, maxWidth) {
|
|
98
|
+
if (line.length <= maxWidth) {
|
|
99
|
+
return line;
|
|
100
|
+
}
|
|
101
|
+
// Simple truncation (for Phase 1)
|
|
102
|
+
// In future phases, we might need to handle multi-byte Unicode properly
|
|
103
|
+
return line.substring(0, Math.max(0, maxWidth));
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=Panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.js","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/primitives/Panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,6BAA6B;AAC7B,MAAM,UAAU,GAAG,OAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAkB9C;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,OAAqB;IAC/C,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAElF,kEAAkE;IAClE,iFAAiF;IACjF,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,sCAAsC;IACxG,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,sCAAsC;IAE1G,sBAAsB;IACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAE9C,gCAAgC;IAChC,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;QAC5B,8CAA8C;QAC9C,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,YA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,MAAM,EAAE;YACN,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;SAC1B;QACD,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,UAAU,GAAG,OAAO;QAC7B,KAAK,EAAE;YACL,MAAM,EAAE;gBACN,EAAE,EAAE,gBAAgB;aACrB;SACF;QACD,+CAA+C;QAC/C,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,2CAA2C;QAC3C,UAAU,EAAE,KAAK,EAAE,sCAAsC;QACzD,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IAEH,+EAA+E;IAC/E,oCAAoC;IACpC,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxE,KAAK,CAAC,QAAQ,CAAC,KAAK,gBAAgB,OAAO,SAAS,KAAK,CAAC,CAAC;IAE3D,OAAO,KAAoB,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAY,EAAE,QAAgB;IAClD,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,kCAAkC;IAClC,wEAAwE;IACxE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Tokens
|
|
3
|
+
*
|
|
4
|
+
* NO styling logic elsewhere. All colors and styles must come from here.
|
|
5
|
+
*/
|
|
6
|
+
export interface Theme {
|
|
7
|
+
colors: {
|
|
8
|
+
purple: string;
|
|
9
|
+
cyan: string;
|
|
10
|
+
green: string;
|
|
11
|
+
amber: string;
|
|
12
|
+
red: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
white: string;
|
|
15
|
+
};
|
|
16
|
+
border: {
|
|
17
|
+
single: string;
|
|
18
|
+
double: string;
|
|
19
|
+
};
|
|
20
|
+
padding: {
|
|
21
|
+
panel: number;
|
|
22
|
+
};
|
|
23
|
+
title: {
|
|
24
|
+
transform: 'uppercase';
|
|
25
|
+
spacing: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare const theme: Theme;
|
|
29
|
+
/**
|
|
30
|
+
* Get blessed color name from theme color
|
|
31
|
+
*/
|
|
32
|
+
export declare function getBlessedColor(colorName: keyof Theme['colors']): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get border style
|
|
35
|
+
*/
|
|
36
|
+
export declare function getBorderStyle(style?: 'single' | 'double'): string;
|
|
37
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/ui/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE;QACL,SAAS,EAAE,WAAW,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,eAAO,MAAM,KAAK,EAAE,KAqBnB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,CAExE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,GAAE,QAAQ,GAAG,QAAmB,GAAG,MAAM,CAE5E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Tokens
|
|
3
|
+
*
|
|
4
|
+
* NO styling logic elsewhere. All colors and styles must come from here.
|
|
5
|
+
*/
|
|
6
|
+
export const theme = {
|
|
7
|
+
colors: {
|
|
8
|
+
purple: 'magenta',
|
|
9
|
+
cyan: 'cyan',
|
|
10
|
+
green: 'green',
|
|
11
|
+
amber: 'yellow',
|
|
12
|
+
red: 'red',
|
|
13
|
+
grey: 'grey',
|
|
14
|
+
white: 'white',
|
|
15
|
+
},
|
|
16
|
+
border: {
|
|
17
|
+
single: 'line',
|
|
18
|
+
double: 'double',
|
|
19
|
+
},
|
|
20
|
+
padding: {
|
|
21
|
+
panel: 1, // 1 char padding inside panels
|
|
22
|
+
},
|
|
23
|
+
title: {
|
|
24
|
+
transform: 'uppercase',
|
|
25
|
+
spacing: 1, // 1 space after title
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Get blessed color name from theme color
|
|
30
|
+
*/
|
|
31
|
+
export function getBlessedColor(colorName) {
|
|
32
|
+
return theme.colors[colorName];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get border style
|
|
36
|
+
*/
|
|
37
|
+
export function getBorderStyle(style = 'single') {
|
|
38
|
+
return style === 'double' ? theme.border.double : theme.border.single;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/ui/v3/ui/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,MAAM,EAAE;QACN,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,QAAQ;QACf,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;KACf;IACD,MAAM,EAAE;QACN,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,QAAQ;KACjB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,+BAA+B;KAC1C;IACD,KAAK,EAAE;QACL,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,CAAC,EAAE,sBAAsB;KACnC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,SAAgC;IAC9D,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAA6B,QAAQ;IAClE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Line Widget
|
|
3
|
+
*
|
|
4
|
+
* Dedicated input widget for commands.
|
|
5
|
+
* Only this widget accepts keyboard input.
|
|
6
|
+
*/
|
|
7
|
+
import type { Widgets } from 'neo-blessed';
|
|
8
|
+
export interface CommandLineOptions {
|
|
9
|
+
screen: Widgets.Screen;
|
|
10
|
+
top: number;
|
|
11
|
+
left: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
onCommand?: (command: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create command line input widget
|
|
18
|
+
*
|
|
19
|
+
* Rules:
|
|
20
|
+
* - Single line input
|
|
21
|
+
* - Cyan cursor
|
|
22
|
+
* - Purple border (optional)
|
|
23
|
+
* - Only accepts input when focused
|
|
24
|
+
*/
|
|
25
|
+
export declare function createCommandLine(options: CommandLineOptions): Widgets.Textbox;
|
|
26
|
+
//# sourceMappingURL=CommandLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandLine.d.ts","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/widgets/CommandLine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAM3C,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAmD9E"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Line Widget
|
|
3
|
+
*
|
|
4
|
+
* Dedicated input widget for commands.
|
|
5
|
+
* Only this widget accepts keyboard input.
|
|
6
|
+
*/
|
|
7
|
+
import blessed from 'neo-blessed';
|
|
8
|
+
// Type assertion for blessed
|
|
9
|
+
const blessedLib = blessed;
|
|
10
|
+
/**
|
|
11
|
+
* Create command line input widget
|
|
12
|
+
*
|
|
13
|
+
* Rules:
|
|
14
|
+
* - Single line input
|
|
15
|
+
* - Cyan cursor
|
|
16
|
+
* - Purple border (optional)
|
|
17
|
+
* - Only accepts input when focused
|
|
18
|
+
*/
|
|
19
|
+
export function createCommandLine(options) {
|
|
20
|
+
const { screen, top, left, width, height, onCommand } = options;
|
|
21
|
+
// Create textbox (blessed textbox is a box with input capability)
|
|
22
|
+
const commandLine = blessedLib.textbox({
|
|
23
|
+
top,
|
|
24
|
+
left,
|
|
25
|
+
width,
|
|
26
|
+
height,
|
|
27
|
+
border: {
|
|
28
|
+
type: 'line',
|
|
29
|
+
},
|
|
30
|
+
style: {
|
|
31
|
+
border: {
|
|
32
|
+
fg: 'magenta', // Purple border
|
|
33
|
+
},
|
|
34
|
+
fg: 'white',
|
|
35
|
+
focus: {
|
|
36
|
+
border: {
|
|
37
|
+
fg: 'cyan', // Cyan when focused
|
|
38
|
+
},
|
|
39
|
+
fg: 'white',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
input: true, // Enable input
|
|
43
|
+
keys: true, // Enable keyboard
|
|
44
|
+
mouse: true, // Enable mouse
|
|
45
|
+
tags: true,
|
|
46
|
+
content: '',
|
|
47
|
+
// Single line mode
|
|
48
|
+
inputOnFocus: true,
|
|
49
|
+
});
|
|
50
|
+
// Handle command submission
|
|
51
|
+
commandLine.on('submit', (value) => {
|
|
52
|
+
const command = value.trim();
|
|
53
|
+
if (command && onCommand) {
|
|
54
|
+
onCommand(command);
|
|
55
|
+
}
|
|
56
|
+
// Clear input after submission
|
|
57
|
+
commandLine.setValue('');
|
|
58
|
+
commandLine.clearValue();
|
|
59
|
+
});
|
|
60
|
+
// Handle escape to blur
|
|
61
|
+
commandLine.key('escape', () => {
|
|
62
|
+
commandLine.blur();
|
|
63
|
+
screen.render();
|
|
64
|
+
});
|
|
65
|
+
return commandLine;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=CommandLine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandLine.js","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/widgets/CommandLine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,6BAA6B;AAC7B,MAAM,UAAU,GAAG,OAAc,CAAC;AAYlC;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA2B;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W,CAAC;AACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "4runr-os",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "4Runr AI Agent OS - Interactive terminal for managing AI agents",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"axios": "^1.6.0",
|
|
29
|
-
"neo-blessed": "^0.2.0"
|
|
29
|
+
"neo-blessed": "^0.2.0",
|
|
30
|
+
"systeminformation": "^5.21.0"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/node": "^20.8.0",
|