skeleton-crew-runtime 0.1.3 → 0.1.5
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/.tsbuildinfo +1 -0
- package/dist/action-engine.d.ts +0 -75
- package/dist/action-engine.d.ts.map +1 -1
- package/dist/action-engine.js +13 -96
- package/dist/action-engine.js.map +1 -1
- package/dist/event-bus.d.ts +0 -44
- package/dist/event-bus.d.ts.map +1 -1
- package/dist/event-bus.js +13 -59
- package/dist/event-bus.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/performance.d.ts +18 -0
- package/dist/performance.d.ts.map +1 -0
- package/dist/performance.js +31 -0
- package/dist/performance.js.map +1 -0
- package/dist/plugin-registry.d.ts +0 -8
- package/dist/plugin-registry.d.ts.map +1 -1
- package/dist/plugin-registry.js +2 -23
- package/dist/plugin-registry.js.map +1 -1
- package/dist/runtime-context.d.ts +17 -68
- package/dist/runtime-context.d.ts.map +1 -1
- package/dist/runtime-context.js +26 -99
- package/dist/runtime-context.js.map +1 -1
- package/dist/runtime.d.ts +3 -100
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +7 -136
- package/dist/runtime.js.map +1 -1
- package/dist/screen-registry.d.ts +0 -40
- package/dist/screen-registry.d.ts.map +1 -1
- package/dist/screen-registry.js +0 -44
- package/dist/screen-registry.js.map +1 -1
- package/dist/types.d.ts +2 -70
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -27
- package/dist/types.js.map +1 -1
- package/dist/ui-bridge.d.ts +0 -27
- package/dist/ui-bridge.d.ts.map +1 -1
- package/dist/ui-bridge.js +0 -29
- package/dist/ui-bridge.js.map +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,64 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when validation fails for a resource
|
|
3
|
-
* @see Requirements 14.1, 14.2, 14.3, 14.4, 14.5, 14.6
|
|
4
|
-
*/
|
|
5
1
|
export declare class ValidationError extends Error {
|
|
6
2
|
resourceType: string;
|
|
7
3
|
field: string;
|
|
8
4
|
resourceId?: string | undefined;
|
|
9
5
|
constructor(resourceType: string, field: string, resourceId?: string | undefined);
|
|
10
6
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Error thrown when attempting to register a duplicate resource
|
|
13
|
-
* @see Requirements 15.1, 15.2, 15.3, 15.4, 15.5
|
|
14
|
-
*/
|
|
15
7
|
export declare class DuplicateRegistrationError extends Error {
|
|
16
8
|
resourceType: string;
|
|
17
9
|
identifier: string;
|
|
18
10
|
constructor(resourceType: string, identifier: string);
|
|
19
11
|
}
|
|
20
|
-
/**
|
|
21
|
-
* Error thrown when an action execution exceeds its timeout
|
|
22
|
-
* @see Requirements 11.1, 11.2, 11.3, 11.4, 11.5
|
|
23
|
-
*/
|
|
24
12
|
export declare class ActionTimeoutError extends Error {
|
|
25
13
|
actionId: string;
|
|
26
14
|
timeoutMs: number;
|
|
27
15
|
constructor(actionId: string, timeoutMs: number);
|
|
28
16
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Error thrown when an action handler throws an error
|
|
31
|
-
* @see Requirements 3.1, 3.2, 3.3, 3.4, 3.5
|
|
32
|
-
*/
|
|
33
17
|
export declare class ActionExecutionError extends Error {
|
|
34
18
|
actionId: string;
|
|
35
19
|
cause: Error;
|
|
36
20
|
constructor(actionId: string, cause: Error);
|
|
37
21
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Logger interface for pluggable logging implementations
|
|
40
|
-
* @see Requirements 7.1, 7.2, 7.3, 7.4, 7.5, 7.6
|
|
41
|
-
*/
|
|
42
22
|
export interface Logger {
|
|
43
23
|
debug(message: string, ...args: unknown[]): void;
|
|
44
24
|
info(message: string, ...args: unknown[]): void;
|
|
45
25
|
warn(message: string, ...args: unknown[]): void;
|
|
46
26
|
error(message: string, ...args: unknown[]): void;
|
|
47
27
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Default console-based logger implementation
|
|
50
|
-
* @see Requirements 7.1, 7.2, 7.3, 7.4, 7.5, 7.6
|
|
51
|
-
*/
|
|
52
28
|
export declare class ConsoleLogger implements Logger {
|
|
53
29
|
debug(message: string, ...args: unknown[]): void;
|
|
54
30
|
info(message: string, ...args: unknown[]): void;
|
|
55
31
|
warn(message: string, ...args: unknown[]): void;
|
|
56
32
|
error(message: string, ...args: unknown[]): void;
|
|
57
33
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Runtime lifecycle states
|
|
60
|
-
* @see Requirements 16.1, 16.2, 16.3, 16.4, 16.5
|
|
61
|
-
*/
|
|
62
34
|
export declare enum RuntimeState {
|
|
63
35
|
Uninitialized = "uninitialized",
|
|
64
36
|
Initializing = "initializing",
|
|
@@ -77,30 +49,16 @@ export interface ScreenDefinition {
|
|
|
77
49
|
title: string;
|
|
78
50
|
component: string;
|
|
79
51
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Action definition with generic type parameters for type-safe action handling
|
|
82
|
-
* @template P - Payload type (defaults to unknown for backward compatibility)
|
|
83
|
-
* @template R - Return type (defaults to unknown for backward compatibility)
|
|
84
|
-
* @see Requirements 6.1, 6.2, 6.3, 6.4, 6.5, 11.1, 11.2, 11.3, 11.4, 11.5
|
|
85
|
-
*/
|
|
86
52
|
export interface ActionDefinition<P = unknown, R = unknown> {
|
|
87
53
|
id: string;
|
|
88
54
|
handler: (params: P, context: RuntimeContext) => Promise<R> | R;
|
|
89
55
|
timeout?: number;
|
|
90
56
|
}
|
|
91
|
-
/**
|
|
92
|
-
* UIProvider interface with enhanced lifecycle methods
|
|
93
|
-
* @see Requirements 9.1, 9.2, 9.3, 9.4, 9.5
|
|
94
|
-
*/
|
|
95
57
|
export interface UIProvider {
|
|
96
58
|
mount(target: unknown, context: RuntimeContext): void | Promise<void>;
|
|
97
59
|
renderScreen(screen: ScreenDefinition): unknown | Promise<unknown>;
|
|
98
60
|
unmount?(): void | Promise<void>;
|
|
99
61
|
}
|
|
100
|
-
/**
|
|
101
|
-
* RuntimeContext provides a safe API facade for subsystems.
|
|
102
|
-
* @see Requirements 4.1, 4.2, 4.3, 4.4, 4.5, 10.1, 10.2, 10.3, 10.4, 10.5, 12.1, 12.2, 12.3, 12.4, 12.5, 13.1, 13.2, 13.3, 13.4, 13.5
|
|
103
|
-
*/
|
|
104
62
|
export interface RuntimeContext {
|
|
105
63
|
screens: {
|
|
106
64
|
registerScreen(screen: ScreenDefinition): () => void;
|
|
@@ -123,15 +81,8 @@ export interface RuntimeContext {
|
|
|
123
81
|
on(event: string, handler: (data: unknown) => void): () => void;
|
|
124
82
|
};
|
|
125
83
|
getRuntime(): Runtime;
|
|
126
|
-
|
|
127
|
-
* Readonly access to host context injected at runtime initialization
|
|
128
|
-
* @see Requirements 1.3, 1.4, 9.2
|
|
129
|
-
*/
|
|
84
|
+
readonly logger: Logger;
|
|
130
85
|
readonly host: Readonly<Record<string, unknown>>;
|
|
131
|
-
/**
|
|
132
|
-
* Introspection API for querying runtime metadata
|
|
133
|
-
* @see Requirements 3.1, 4.1, 5.1, 6.1, 9.2
|
|
134
|
-
*/
|
|
135
86
|
readonly introspect: IntrospectionAPI;
|
|
136
87
|
}
|
|
137
88
|
export interface Runtime {
|
|
@@ -139,44 +90,25 @@ export interface Runtime {
|
|
|
139
90
|
shutdown(): Promise<void>;
|
|
140
91
|
getContext(): RuntimeContext;
|
|
141
92
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Runtime initialization options
|
|
144
|
-
* @see Requirements 1.1, 9.1
|
|
145
|
-
*/
|
|
146
93
|
export interface RuntimeOptions {
|
|
147
94
|
logger?: Logger;
|
|
148
95
|
hostContext?: Record<string, unknown>;
|
|
96
|
+
enablePerformanceMonitoring?: boolean;
|
|
149
97
|
}
|
|
150
|
-
/**
|
|
151
|
-
* Action metadata returned by introspection (excludes handler function)
|
|
152
|
-
* @see Requirements 3.2, 3.4, 3.5, 9.3
|
|
153
|
-
*/
|
|
154
98
|
export interface ActionMetadata {
|
|
155
99
|
id: string;
|
|
156
100
|
timeout?: number;
|
|
157
101
|
}
|
|
158
|
-
/**
|
|
159
|
-
* Plugin metadata returned by introspection (excludes setup/dispose functions)
|
|
160
|
-
* @see Requirements 4.2, 4.4, 4.5, 9.4
|
|
161
|
-
*/
|
|
162
102
|
export interface PluginMetadata {
|
|
163
103
|
name: string;
|
|
164
104
|
version: string;
|
|
165
105
|
}
|
|
166
|
-
/**
|
|
167
|
-
* Runtime metadata with overall statistics
|
|
168
|
-
* @see Requirements 6.1, 6.2, 6.3, 6.4, 6.5, 9.5
|
|
169
|
-
*/
|
|
170
106
|
export interface IntrospectionMetadata {
|
|
171
107
|
runtimeVersion: string;
|
|
172
108
|
totalActions: number;
|
|
173
109
|
totalPlugins: number;
|
|
174
110
|
totalScreens: number;
|
|
175
111
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Introspection API for querying runtime metadata
|
|
178
|
-
* @see Requirements 3.1, 4.1, 5.1, 6.1, 9.2
|
|
179
|
-
*/
|
|
180
112
|
export interface IntrospectionAPI {
|
|
181
113
|
listActions(): string[];
|
|
182
114
|
getActionDefinition(id: string): ActionMetadata | null;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA,qBAAa,eAAgB,SAAQ,KAAK;IAE/B,YAAY,EAAE,MAAM;IACpB,KAAK,EAAE,MAAM;IACb,UAAU,CAAC,EAAE,MAAM;gBAFnB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,YAAA;CAO7B;AAMD,qBAAa,0BAA2B,SAAQ,KAAK;IAE1C,YAAY,EAAE,MAAM;IACpB,UAAU,EAAE,MAAM;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,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAMD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,IAAI,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IACvD,WAAW,IAAI,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IACzD,WAAW,IAAI,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACzD,WAAW,IAAI,qBAAqB,CAAC;CACtC"}
|
package/dist/types.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// Core type definitions will be implemented in task 2
|
|
2
|
-
// Error Classes
|
|
3
|
-
/**
|
|
4
|
-
* Error thrown when validation fails for a resource
|
|
5
|
-
* @see Requirements 14.1, 14.2, 14.3, 14.4, 14.5, 14.6
|
|
6
|
-
*/
|
|
7
1
|
export class ValidationError extends Error {
|
|
8
2
|
resourceType;
|
|
9
3
|
field;
|
|
@@ -16,10 +10,6 @@ export class ValidationError extends Error {
|
|
|
16
10
|
this.name = 'ValidationError';
|
|
17
11
|
}
|
|
18
12
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Error thrown when attempting to register a duplicate resource
|
|
21
|
-
* @see Requirements 15.1, 15.2, 15.3, 15.4, 15.5
|
|
22
|
-
*/
|
|
23
13
|
export class DuplicateRegistrationError extends Error {
|
|
24
14
|
resourceType;
|
|
25
15
|
identifier;
|
|
@@ -30,10 +20,6 @@ export class DuplicateRegistrationError extends Error {
|
|
|
30
20
|
this.name = 'DuplicateRegistrationError';
|
|
31
21
|
}
|
|
32
22
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Error thrown when an action execution exceeds its timeout
|
|
35
|
-
* @see Requirements 11.1, 11.2, 11.3, 11.4, 11.5
|
|
36
|
-
*/
|
|
37
23
|
export class ActionTimeoutError extends Error {
|
|
38
24
|
actionId;
|
|
39
25
|
timeoutMs;
|
|
@@ -44,10 +30,6 @@ export class ActionTimeoutError extends Error {
|
|
|
44
30
|
this.name = 'ActionTimeoutError';
|
|
45
31
|
}
|
|
46
32
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Error thrown when an action handler throws an error
|
|
49
|
-
* @see Requirements 3.1, 3.2, 3.3, 3.4, 3.5
|
|
50
|
-
*/
|
|
51
33
|
export class ActionExecutionError extends Error {
|
|
52
34
|
actionId;
|
|
53
35
|
cause;
|
|
@@ -59,10 +41,6 @@ export class ActionExecutionError extends Error {
|
|
|
59
41
|
this.cause = cause;
|
|
60
42
|
}
|
|
61
43
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Default console-based logger implementation
|
|
64
|
-
* @see Requirements 7.1, 7.2, 7.3, 7.4, 7.5, 7.6
|
|
65
|
-
*/
|
|
66
44
|
export class ConsoleLogger {
|
|
67
45
|
debug(message, ...args) {
|
|
68
46
|
console.debug(message, ...args);
|
|
@@ -77,11 +55,6 @@ export class ConsoleLogger {
|
|
|
77
55
|
console.error(message, ...args);
|
|
78
56
|
}
|
|
79
57
|
}
|
|
80
|
-
// Runtime State Enum
|
|
81
|
-
/**
|
|
82
|
-
* Runtime lifecycle states
|
|
83
|
-
* @see Requirements 16.1, 16.2, 16.3, 16.4, 16.5
|
|
84
|
-
*/
|
|
85
58
|
export var RuntimeState;
|
|
86
59
|
(function (RuntimeState) {
|
|
87
60
|
RuntimeState["Uninitialized"] = "uninitialized";
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAE/B;IACA;IACA;IAHT,YACS,YAAoB,EACpB,KAAa,EACb,UAAmB;QAE1B,KAAK,CACH,yBAAyB,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,+BAA+B,KAAK,GAAG,CACpH,CAAC;QANK,iBAAY,GAAZ,YAAY,CAAQ;QACpB,UAAK,GAAL,KAAK,CAAQ;QACb,eAAU,GAAV,UAAU,CAAS;QAK1B,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAMD,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAE1C;IACA;IAFT,YACS,YAAoB,EACpB,UAAkB;QAEzB,KAAK,CAAC,GAAG,YAAY,qBAAqB,UAAU,yBAAyB,CAAC,CAAC;QAHxE,iBAAY,GAAZ,YAAY,CAAQ;QACpB,eAAU,GAAV,UAAU,CAAQ;QAGzB,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AAMD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAElC;IACA;IAFT,YACS,QAAgB,EAChB,SAAiB;QAExB,KAAK,CAAC,WAAW,QAAQ,qBAAqB,SAAS,IAAI,CAAC,CAAC;QAHtD,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,S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
|
-
* UIBridge manages optional UI provider registration and screen rendering.
|
|
4
|
-
* Validates provider implements required methods and rejects duplicate registration.
|
|
5
|
-
* @see Requirements 9.1, 9.2, 9.3, 9.4, 9.5, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 15.1, 15.2, 15.3, 15.4, 15.5
|
|
6
|
-
*/
|
|
7
2
|
export declare class UIBridge {
|
|
8
3
|
private provider;
|
|
9
4
|
private logger;
|
|
10
5
|
constructor(logger: Logger);
|
|
11
|
-
/**
|
|
12
|
-
* Register a UI provider with the runtime.
|
|
13
|
-
* @throws ValidationError if provider is missing required methods
|
|
14
|
-
* @throws DuplicateRegistrationError if provider is already registered
|
|
15
|
-
* @see Requirements 9.1, 9.2, 9.4, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 15.1, 15.2, 15.3, 15.4, 15.5
|
|
16
|
-
*/
|
|
17
6
|
setProvider(provider: UIProvider): void;
|
|
18
|
-
/**
|
|
19
|
-
* Get the registered UI provider.
|
|
20
|
-
* @returns The registered UIProvider or null if none registered
|
|
21
|
-
*/
|
|
22
7
|
getProvider(): UIProvider | null;
|
|
23
|
-
/**
|
|
24
|
-
* Render a screen using the registered UI provider.
|
|
25
|
-
* @throws Error if no UI provider is registered
|
|
26
|
-
* @see Requirements 9.2
|
|
27
|
-
*/
|
|
28
8
|
renderScreen(screen: ScreenDefinition): unknown;
|
|
29
|
-
/**
|
|
30
|
-
* Shutdown the UI provider by calling unmount if it exists.
|
|
31
|
-
* @see Requirements 9.5
|
|
32
|
-
*/
|
|
33
9
|
shutdown(): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Clear the UI provider during shutdown.
|
|
36
|
-
*/
|
|
37
10
|
clear(): void;
|
|
38
11
|
}
|
|
39
12
|
//# sourceMappingURL=ui-bridge.d.ts.map
|
package/dist/ui-bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-bridge.d.ts","sourceRoot":"","sources":["../src/ui-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAA+C,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-bridge.d.ts","sourceRoot":"","sources":["../src/ui-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAA+C,MAAM,YAAY,CAAC;AAO/G,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;IAU1B,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI;IAsBvC,WAAW,IAAI,UAAU,GAAG,IAAI;IAShC,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO;IAYzC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAe/B,KAAK,IAAI,IAAI;CAGd"}
|
package/dist/ui-bridge.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
import { ValidationError, DuplicateRegistrationError } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* UIBridge manages optional UI provider registration and screen rendering.
|
|
4
|
-
* Validates provider implements required methods and rejects duplicate registration.
|
|
5
|
-
* @see Requirements 9.1, 9.2, 9.3, 9.4, 9.5, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 15.1, 15.2, 15.3, 15.4, 15.5
|
|
6
|
-
*/
|
|
7
2
|
export class UIBridge {
|
|
8
3
|
provider = null;
|
|
9
4
|
logger;
|
|
10
5
|
constructor(logger) {
|
|
11
6
|
this.logger = logger;
|
|
12
7
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Register a UI provider with the runtime.
|
|
15
|
-
* @throws ValidationError if provider is missing required methods
|
|
16
|
-
* @throws DuplicateRegistrationError if provider is already registered
|
|
17
|
-
* @see Requirements 9.1, 9.2, 9.4, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 15.1, 15.2, 15.3, 15.4, 15.5
|
|
18
|
-
*/
|
|
19
8
|
setProvider(provider) {
|
|
20
|
-
// Reject duplicate provider registration
|
|
21
9
|
if (this.provider !== null) {
|
|
22
10
|
throw new DuplicateRegistrationError('UIProvider', 'default');
|
|
23
11
|
}
|
|
24
|
-
// Validate provider has required methods
|
|
25
12
|
if (typeof provider.mount !== 'function') {
|
|
26
13
|
throw new ValidationError('UIProvider', 'mount');
|
|
27
14
|
}
|
|
@@ -30,28 +17,15 @@ export class UIBridge {
|
|
|
30
17
|
}
|
|
31
18
|
this.provider = provider;
|
|
32
19
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Get the registered UI provider.
|
|
35
|
-
* @returns The registered UIProvider or null if none registered
|
|
36
|
-
*/
|
|
37
20
|
getProvider() {
|
|
38
21
|
return this.provider;
|
|
39
22
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Render a screen using the registered UI provider.
|
|
42
|
-
* @throws Error if no UI provider is registered
|
|
43
|
-
* @see Requirements 9.2
|
|
44
|
-
*/
|
|
45
23
|
renderScreen(screen) {
|
|
46
24
|
if (this.provider === null) {
|
|
47
25
|
throw new Error('No UI provider registered');
|
|
48
26
|
}
|
|
49
27
|
return this.provider.renderScreen(screen);
|
|
50
28
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Shutdown the UI provider by calling unmount if it exists.
|
|
53
|
-
* @see Requirements 9.5
|
|
54
|
-
*/
|
|
55
29
|
async shutdown() {
|
|
56
30
|
if (this.provider?.unmount) {
|
|
57
31
|
try {
|
|
@@ -64,9 +38,6 @@ export class UIBridge {
|
|
|
64
38
|
}
|
|
65
39
|
this.provider = null;
|
|
66
40
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Clear the UI provider during shutdown.
|
|
69
|
-
*/
|
|
70
41
|
clear() {
|
|
71
42
|
this.provider = null;
|
|
72
43
|
}
|
package/dist/ui-bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-bridge.js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