4runr-os 2.0.34 → 2.0.36
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/collectors/collector_feed.d.ts.map +1 -1
- package/dist/collectors/collector_feed.js +6 -1
- package/dist/collectors/collector_feed.js.map +1 -1
- package/dist/core/commandExecutor.d.ts +56 -0
- package/dist/core/commandExecutor.d.ts.map +1 -0
- package/dist/core/commandExecutor.js +161 -0
- package/dist/core/commandExecutor.js.map +1 -0
- package/dist/core/commandRegistry.d.ts +72 -0
- package/dist/core/commandRegistry.d.ts.map +1 -0
- package/dist/core/commandRegistry.js +53 -0
- package/dist/core/commandRegistry.js.map +1 -0
- package/dist/core/commands/size.d.ts +23 -0
- package/dist/core/commands/size.d.ts.map +1 -0
- package/dist/core/commands/size.js +211 -0
- package/dist/core/commands/size.js.map +1 -0
- package/dist/core/eventBus.d.ts +29 -14
- package/dist/core/eventBus.d.ts.map +1 -1
- package/dist/core/eventBus.js +56 -23
- package/dist/core/eventBus.js.map +1 -1
- package/dist/core/opEvent.d.ts +16 -0
- package/dist/core/opEvent.d.ts.map +1 -0
- package/dist/core/opEvent.js +8 -0
- package/dist/core/opEvent.js.map +1 -0
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/ui/v3/commands/commandEngine.js +73 -2
- package/dist/ui/v3/commands/commandEngine.js.map +1 -1
- package/dist/ui/v3/index.js +32 -11
- package/dist/ui/v3/index.js.map +1 -1
- package/dist/ui/v3/tui/geometry.d.ts.map +1 -1
- package/dist/ui/v3/tui/geometry.js +2 -7
- package/dist/ui/v3/tui/geometry.js.map +1 -1
- package/dist/ui/v3/ui/layout/phase1Layout.d.ts.map +1 -1
- package/dist/ui/v3/ui/layout/phase1Layout.js +15 -22
- package/dist/ui/v3/ui/layout/phase1Layout.js.map +1 -1
- package/dist/ui/v3/ui/phase1RuntimeClean.d.ts +8 -0
- package/dist/ui/v3/ui/phase1RuntimeClean.d.ts.map +1 -1
- package/dist/ui/v3/ui/phase1RuntimeClean.js +42 -6
- package/dist/ui/v3/ui/phase1RuntimeClean.js.map +1 -1
- package/dist/ui/v4/engine/renderFrame.d.ts +47 -0
- package/dist/ui/v4/engine/renderFrame.d.ts.map +1 -0
- package/dist/ui/v4/engine/renderFrame.js +653 -0
- package/dist/ui/v4/engine/renderFrame.js.map +1 -0
- package/dist/ui/v4/engine/resizeController.d.ts +48 -0
- package/dist/ui/v4/engine/resizeController.d.ts.map +1 -0
- package/dist/ui/v4/engine/resizeController.js +285 -0
- package/dist/ui/v4/engine/resizeController.js.map +1 -0
- package/dist/ui/v4/engine/safeViewport.d.ts +47 -0
- package/dist/ui/v4/engine/safeViewport.d.ts.map +1 -0
- package/dist/ui/v4/engine/safeViewport.js +123 -0
- package/dist/ui/v4/engine/safeViewport.js.map +1 -0
- package/dist/ui/v4/engine/terminalProfile.d.ts +56 -0
- package/dist/ui/v4/engine/terminalProfile.d.ts.map +1 -0
- package/dist/ui/v4/engine/terminalProfile.js +115 -0
- package/dist/ui/v4/engine/terminalProfile.js.map +1 -0
- package/dist/ui/v4/index.d.ts +28 -0
- package/dist/ui/v4/index.d.ts.map +1 -0
- package/dist/ui/v4/index.js +993 -0
- package/dist/ui/v4/index.js.map +1 -0
- package/dist/ui/v4/layout/layoutEngine.d.ts +62 -0
- package/dist/ui/v4/layout/layoutEngine.d.ts.map +1 -0
- package/dist/ui/v4/layout/layoutEngine.js +294 -0
- package/dist/ui/v4/layout/layoutEngine.js.map +1 -0
- package/dist/ui/v4/runtime/keepAlive.d.ts +21 -0
- package/dist/ui/v4/runtime/keepAlive.d.ts.map +1 -0
- package/dist/ui/v4/runtime/keepAlive.js +149 -0
- package/dist/ui/v4/runtime/keepAlive.js.map +1 -0
- package/dist/ui/v4/runtime/logger.d.ts +35 -0
- package/dist/ui/v4/runtime/logger.d.ts.map +1 -0
- package/dist/ui/v4/runtime/logger.js +109 -0
- package/dist/ui/v4/runtime/logger.js.map +1 -0
- package/dist/ui/v5/index.d.ts +24 -0
- package/dist/ui/v5/index.d.ts.map +1 -0
- package/dist/ui/v5/index.js +123 -0
- package/dist/ui/v5/index.js.map +1 -0
- package/dist/ui/v5/runtime/keepAlive.d.ts +37 -0
- package/dist/ui/v5/runtime/keepAlive.d.ts.map +1 -0
- package/dist/ui/v5/runtime/keepAlive.js +122 -0
- package/dist/ui/v5/runtime/keepAlive.js.map +1 -0
- package/dist/ui/v5/runtime/restoreTerminal.d.ts +34 -0
- package/dist/ui/v5/runtime/restoreTerminal.d.ts.map +1 -0
- package/dist/ui/v5/runtime/restoreTerminal.js +100 -0
- package/dist/ui/v5/runtime/restoreTerminal.js.map +1 -0
- package/dist/ui/v5/runtime/stdoutGuard.d.ts +42 -0
- package/dist/ui/v5/runtime/stdoutGuard.d.ts.map +1 -0
- package/dist/ui/v5/runtime/stdoutGuard.js +154 -0
- package/dist/ui/v5/runtime/stdoutGuard.js.map +1 -0
- package/package.json +1 -1
package/dist/core/eventBus.d.ts
CHANGED
|
@@ -1,24 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Event Bus
|
|
3
|
-
*
|
|
2
|
+
* Core Event Bus
|
|
3
|
+
*
|
|
4
|
+
* UI-agnostic pub/sub system for operations feed.
|
|
5
|
+
* All visible output goes through the EventBus.
|
|
6
|
+
*
|
|
7
|
+
* Rules:
|
|
8
|
+
* - In-memory only (no persistence)
|
|
9
|
+
* - No UI imports inside bus. Bus is pure logic.
|
|
10
|
+
* - Must support multiple subscribers.
|
|
11
|
+
* - Must return an unsubscribe() function.
|
|
4
12
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
msg: string;
|
|
8
|
-
ts: number;
|
|
9
|
-
};
|
|
10
|
-
type EventHandler = (event: FeedEvent) => void;
|
|
13
|
+
import type { OpEvent } from './opEvent.js';
|
|
14
|
+
export type EventListener = (e: OpEvent) => void;
|
|
11
15
|
declare class EventBus {
|
|
12
|
-
private
|
|
16
|
+
private subscribers;
|
|
17
|
+
private eventCounter;
|
|
13
18
|
/**
|
|
14
|
-
* Emit event
|
|
19
|
+
* Emit an event
|
|
20
|
+
* Generates id and ts if missing, then calls all subscribers synchronously
|
|
15
21
|
*/
|
|
16
|
-
emit(
|
|
22
|
+
emit(e: Omit<OpEvent, "id" | "ts"> & Partial<Pick<OpEvent, "id" | "ts">>): void;
|
|
17
23
|
/**
|
|
18
24
|
* Subscribe to events
|
|
19
25
|
* Returns unsubscribe function
|
|
20
26
|
*/
|
|
21
|
-
subscribe(
|
|
27
|
+
subscribe(fn: EventListener): () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Helper: emit with tag and message (for compatibility)
|
|
30
|
+
*/
|
|
31
|
+
emitTag(tag: OpEvent['tag'], msg: string, level?: OpEvent['level']): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get subscriber count (for debugging)
|
|
34
|
+
*/
|
|
35
|
+
getSubscriberCount(): number;
|
|
22
36
|
/**
|
|
23
37
|
* Clear all handlers (for testing)
|
|
24
38
|
*/
|
|
@@ -29,8 +43,9 @@ declare class EventBus {
|
|
|
29
43
|
*/
|
|
30
44
|
export declare const eventBus: EventBus;
|
|
31
45
|
/**
|
|
32
|
-
*
|
|
46
|
+
* Backward compatibility: FeedEvent type alias
|
|
47
|
+
* @deprecated Use OpEvent instead
|
|
33
48
|
*/
|
|
34
|
-
export
|
|
49
|
+
export type FeedEvent = OpEvent;
|
|
35
50
|
export {};
|
|
36
51
|
//# sourceMappingURL=eventBus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../../src/core/eventBus.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../../src/core/eventBus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAEjD,cAAM,QAAQ;IACZ,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,YAAY,CAAK;IAEzB;;;OAGG;IACH,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI;IAmC/E;;;OAGG;IACH,SAAS,CAAC,EAAE,EAAE,aAAa,GAAG,MAAM,IAAI;IASxC;;OAEG;IACH,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,OAAO,CAAC,OAAO,CAAU,GAAG,IAAI;IAIjF;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAI5B;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAiB,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC"}
|
package/dist/core/eventBus.js
CHANGED
|
@@ -1,20 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Event Bus
|
|
3
|
-
*
|
|
2
|
+
* Core Event Bus
|
|
3
|
+
*
|
|
4
|
+
* UI-agnostic pub/sub system for operations feed.
|
|
5
|
+
* All visible output goes through the EventBus.
|
|
6
|
+
*
|
|
7
|
+
* Rules:
|
|
8
|
+
* - In-memory only (no persistence)
|
|
9
|
+
* - No UI imports inside bus. Bus is pure logic.
|
|
10
|
+
* - Must support multiple subscribers.
|
|
11
|
+
* - Must return an unsubscribe() function.
|
|
4
12
|
*/
|
|
5
13
|
class EventBus {
|
|
6
|
-
|
|
14
|
+
subscribers = new Set();
|
|
15
|
+
eventCounter = 0; // Monotonic counter for IDs
|
|
7
16
|
/**
|
|
8
|
-
* Emit event
|
|
17
|
+
* Emit an event
|
|
18
|
+
* Generates id and ts if missing, then calls all subscribers synchronously
|
|
9
19
|
*/
|
|
10
|
-
emit(
|
|
11
|
-
|
|
20
|
+
emit(e) {
|
|
21
|
+
// Generate id if missing
|
|
22
|
+
const id = e.id || `evt-${++this.eventCounter}`;
|
|
23
|
+
// Set ts = Date.now() if missing
|
|
24
|
+
const ts = e.ts ?? Date.now();
|
|
25
|
+
// Default level to INFO if not provided
|
|
26
|
+
const level = e.level || 'INFO';
|
|
27
|
+
const event = {
|
|
28
|
+
id,
|
|
29
|
+
ts,
|
|
30
|
+
tag: e.tag,
|
|
31
|
+
level,
|
|
32
|
+
msg: e.msg,
|
|
33
|
+
};
|
|
34
|
+
// Call all subscribers synchronously
|
|
35
|
+
// Wrap in try/catch so one bad subscriber doesn't kill updates
|
|
36
|
+
this.subscribers.forEach(subscriber => {
|
|
12
37
|
try {
|
|
13
|
-
|
|
38
|
+
subscriber(event);
|
|
14
39
|
}
|
|
15
40
|
catch (error) {
|
|
16
|
-
//
|
|
17
|
-
|
|
41
|
+
// Don't let subscriber errors break the bus
|
|
42
|
+
// In TUI mode, we can't log, so we silently continue
|
|
43
|
+
// In debug mode, we could log to stderr
|
|
44
|
+
if (process.env.DEBUG_NO_TUI === '1') {
|
|
45
|
+
// In non-TUI mode, it's safe to use console.error (goes to stderr, not stdout)
|
|
46
|
+
console.error('[EventBus] Handler error:', error);
|
|
47
|
+
}
|
|
18
48
|
}
|
|
19
49
|
});
|
|
20
50
|
}
|
|
@@ -22,31 +52,34 @@ class EventBus {
|
|
|
22
52
|
* Subscribe to events
|
|
23
53
|
* Returns unsubscribe function
|
|
24
54
|
*/
|
|
25
|
-
subscribe(
|
|
26
|
-
this.
|
|
55
|
+
subscribe(fn) {
|
|
56
|
+
this.subscribers.add(fn);
|
|
57
|
+
// Return unsubscribe function
|
|
27
58
|
return () => {
|
|
28
|
-
this.
|
|
59
|
+
this.subscribers.delete(fn);
|
|
29
60
|
};
|
|
30
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Helper: emit with tag and message (for compatibility)
|
|
64
|
+
*/
|
|
65
|
+
emitTag(tag, msg, level = 'INFO') {
|
|
66
|
+
this.emit({ tag, msg, level });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get subscriber count (for debugging)
|
|
70
|
+
*/
|
|
71
|
+
getSubscriberCount() {
|
|
72
|
+
return this.subscribers.size;
|
|
73
|
+
}
|
|
31
74
|
/**
|
|
32
75
|
* Clear all handlers (for testing)
|
|
33
76
|
*/
|
|
34
77
|
clear() {
|
|
35
|
-
this.
|
|
78
|
+
this.subscribers.clear();
|
|
36
79
|
}
|
|
37
80
|
}
|
|
38
81
|
/**
|
|
39
82
|
* Global event bus instance
|
|
40
83
|
*/
|
|
41
84
|
export const eventBus = new EventBus();
|
|
42
|
-
/**
|
|
43
|
-
* Helper: Emit feed event
|
|
44
|
-
*/
|
|
45
|
-
export function emitFeedEvent(tag, msg) {
|
|
46
|
-
eventBus.emit({
|
|
47
|
-
tag,
|
|
48
|
-
msg,
|
|
49
|
-
ts: Date.now(),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
85
|
//# sourceMappingURL=eventBus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventBus.js","sourceRoot":"","sources":["../../src/core/eventBus.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"eventBus.js","sourceRoot":"","sources":["../../src/core/eventBus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,MAAM,QAAQ;IACJ,WAAW,GAAuB,IAAI,GAAG,EAAE,CAAC;IAC5C,YAAY,GAAG,CAAC,CAAC,CAAC,4BAA4B;IAEtD;;;OAGG;IACH,IAAI,CAAC,CAAmE;QACtE,yBAAyB;QACzB,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;QAEhD,iCAAiC;QACjC,MAAM,EAAE,GAA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AW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Operations Event Types
|
|
3
|
+
*
|
|
4
|
+
* UI-agnostic event interface for operations feed.
|
|
5
|
+
* Used by both V3 and V4.
|
|
6
|
+
*/
|
|
7
|
+
export type OpTag = "SYS" | "CMD" | "RUN" | "NET" | "SEC" | "DB" | "GW" | "ERR" | "OK" | "WARN" | "DBG" | "INFO";
|
|
8
|
+
export type OpLevel = 'INFO' | 'WARN' | 'ERROR';
|
|
9
|
+
export interface OpEvent {
|
|
10
|
+
id: string;
|
|
11
|
+
ts: number;
|
|
12
|
+
tag: OpTag;
|
|
13
|
+
level: OpLevel;
|
|
14
|
+
msg: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=opEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opEvent.d.ts","sourceRoot":"","sources":["../../src/core/opEvent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AACjH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEhD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,KAAK,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opEvent.js","sourceRoot":"","sources":["../../src/core/opEvent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/index.js
CHANGED
|
@@ -2408,10 +2408,26 @@ async function main() {
|
|
|
2408
2408
|
customAgents: customAgents,
|
|
2409
2409
|
runHistory: runHistory,
|
|
2410
2410
|
});
|
|
2411
|
-
// Start
|
|
2411
|
+
// Start Terminal UI (integrated into os-cli)
|
|
2412
2412
|
// Structural Fix B: Use centralized TUI start with singleton guard
|
|
2413
|
-
|
|
2414
|
-
|
|
2413
|
+
// Check for V5 flag first (new development)
|
|
2414
|
+
if (process.env.TUI_V5 === '1') {
|
|
2415
|
+
// V5 mode - Display Kernel (Phase 1)
|
|
2416
|
+
const { startV5Shell } = await import('./ui/v5/index.js');
|
|
2417
|
+
await startV5Shell();
|
|
2418
|
+
}
|
|
2419
|
+
else if (process.env.TUI_V4 === '1') {
|
|
2420
|
+
// ⚠️ V4 FROZEN: Display issues - development moved to V5
|
|
2421
|
+
// V4 is preserved for reference only. Use at your own risk.
|
|
2422
|
+
// See packages/os-cli/src/ui/v4/FROZEN.md
|
|
2423
|
+
const { startV4Shell } = await import('./ui/v4/index.js');
|
|
2424
|
+
await startV4Shell();
|
|
2425
|
+
}
|
|
2426
|
+
else {
|
|
2427
|
+
// V3 mode (default)
|
|
2428
|
+
const { startTui } = await import('./ui/v3/tui/startTui.js');
|
|
2429
|
+
await startTui();
|
|
2430
|
+
}
|
|
2415
2431
|
}
|
|
2416
2432
|
catch (error) {
|
|
2417
2433
|
// Only show errors if TUI failed to initialize
|