@rtc-agent/component 0.2.7-rc.4 → 0.2.8-rc.0
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/README.md +109 -13
- package/dist/.generated/locales/en-US.d.ts +55 -7
- package/dist/.generated/locales/en-US.d.ts.map +1 -1
- package/dist/assets/{shared-worker-BQv441O7.js → shared-worker-CXyjL7E6.js} +210 -210
- package/dist/components/activity-bar/rtc-activity-bar.d.ts +23 -21
- package/dist/components/activity-bar/rtc-activity-bar.d.ts.map +1 -1
- package/dist/components/activity-bar/rtc-activity-bar.styles.d.ts +2 -2
- package/dist/components/chat-layout/rtc-chat-layout.d.ts +87 -80
- package/dist/components/chat-layout/rtc-chat-layout.d.ts.map +1 -1
- package/dist/components/chat-layout/rtc-chat-layout.styles.d.ts +5 -5
- package/dist/components/content-area/rtc-error-message.d.ts +1 -1
- package/dist/components/content-area/rtc-message-more-menu.d.ts +4 -4
- package/dist/components/content-area/rtc-message-more-menu.d.ts.map +1 -1
- package/dist/components/content-area/rtc-message.d.ts +82 -76
- package/dist/components/content-area/rtc-message.d.ts.map +1 -1
- package/dist/components/content-area/rtc-message.styles.d.ts.map +1 -1
- package/dist/components/content-area/rtc-toolcall-card.d.ts +10 -5
- package/dist/components/content-area/rtc-toolcall-card.d.ts.map +1 -1
- package/dist/components/content-area/rtc-toolcall-card.styles.d.ts.map +1 -1
- package/dist/components/content-area/rtc-toolcall-reply.d.ts +12 -0
- package/dist/components/content-area/rtc-toolcall-reply.d.ts.map +1 -1
- package/dist/components/content-area/rtc-toolcall-reply.styles.d.ts.map +1 -1
- package/dist/components/content-area/rtc-user-message.d.ts +10 -10
- package/dist/components/drawer/rtc-drawer.d.ts +29 -27
- package/dist/components/drawer/rtc-drawer.d.ts.map +1 -1
- package/dist/components/drawer/rtc-drawer.styles.d.ts +9 -9
- package/dist/components/editor-area/rtc-editor-area.d.ts +29 -29
- package/dist/components/editor-area/rtc-editor-area.d.ts.map +1 -1
- package/dist/components/editor-area/rtc-editor-area.styles.d.ts +3 -3
- package/dist/components/editor-area/rtc-editor-tab.d.ts +27 -27
- package/dist/components/editor-area/rtc-editor-tab.d.ts.map +1 -1
- package/dist/components/editor-area/rtc-editor-tab.styles.d.ts +3 -3
- package/dist/components/editor-area/rtc-editor-toolbar.d.ts +19 -19
- package/dist/components/editor-area/rtc-editor-toolbar.d.ts.map +1 -1
- package/dist/components/editor-area/rtc-editor-toolbar.styles.d.ts +3 -3
- package/dist/components/file-explorer/rtc-file-explorer.d.ts +28 -28
- package/dist/components/file-explorer/rtc-file-explorer.d.ts.map +1 -1
- package/dist/components/file-explorer/rtc-file-explorer.styles.d.ts +3 -3
- package/dist/components/file-explorer/rtc-file-tree-item.d.ts +19 -19
- package/dist/components/file-explorer/rtc-file-tree-item.d.ts.map +1 -1
- package/dist/components/file-explorer/rtc-file-tree-item.styles.d.ts +3 -3
- package/dist/components/function-console/rtc-function-console.d.ts +32 -0
- package/dist/components/function-console/rtc-function-console.d.ts.map +1 -0
- package/dist/components/function-console/rtc-function-console.styles.d.ts +8 -0
- package/dist/components/function-console/rtc-function-console.styles.d.ts.map +1 -0
- package/dist/components/function-debugger/rtc-function-debugger.d.ts +39 -0
- package/dist/components/function-debugger/rtc-function-debugger.d.ts.map +1 -0
- package/dist/components/function-debugger/rtc-function-debugger.styles.d.ts +8 -0
- package/dist/components/function-debugger/rtc-function-debugger.styles.d.ts.map +1 -0
- package/dist/components/function-history/rtc-function-history.d.ts +49 -0
- package/dist/components/function-history/rtc-function-history.d.ts.map +1 -0
- package/dist/components/function-history/rtc-function-history.styles.d.ts +8 -0
- package/dist/components/function-history/rtc-function-history.styles.d.ts.map +1 -0
- package/dist/components/function-params/rtc-function-params.d.ts +29 -0
- package/dist/components/function-params/rtc-function-params.d.ts.map +1 -0
- package/dist/components/function-params/rtc-function-params.styles.d.ts +8 -0
- package/dist/components/function-params/rtc-function-params.styles.d.ts.map +1 -0
- package/dist/components/function-tree/rtc-function-tree.d.ts +59 -0
- package/dist/components/function-tree/rtc-function-tree.d.ts.map +1 -0
- package/dist/components/function-tree/rtc-function-tree.styles.d.ts +2 -0
- package/dist/components/function-tree/rtc-function-tree.styles.d.ts.map +1 -0
- package/dist/components/functions-layout/rtc-functions-layout.d.ts +45 -0
- package/dist/components/functions-layout/rtc-functions-layout.d.ts.map +1 -0
- package/dist/components/functions-layout/rtc-functions-layout.styles.d.ts +8 -0
- package/dist/components/functions-layout/rtc-functions-layout.styles.d.ts.map +1 -0
- package/dist/components/input-area/rtc-input-area.d.ts +15 -15
- package/dist/components/input-area/rtc-input-area.d.ts.map +1 -1
- package/dist/components/login/rtc-login-page.d.ts +8 -8
- package/dist/components/markdown-editor/rtc-markdown-editor.d.ts +23 -19
- package/dist/components/markdown-editor/rtc-markdown-editor.d.ts.map +1 -1
- package/dist/components/overlay/rtc-command-panel.d.ts.map +1 -1
- package/dist/components/overlay/rtc-export-dialog.d.ts +59 -0
- package/dist/components/overlay/rtc-export-dialog.d.ts.map +1 -0
- package/dist/components/overlay/rtc-export-dialog.styles.d.ts +11 -0
- package/dist/components/overlay/rtc-export-dialog.styles.d.ts.map +1 -0
- package/dist/components/overlay/rtc-scenario-panel.d.ts +1 -1
- package/dist/components/overlay/rtc-scenario-panel.d.ts.map +1 -1
- package/dist/components/overlay/rtc-session-panel.d.ts +1 -1
- package/dist/components/overlay/rtc-session-panel.d.ts.map +1 -1
- package/dist/components/overlay/rtc-toast.d.ts +8 -8
- package/dist/components/rtc-agent/helpers/bus-handler.d.ts +32 -1
- package/dist/components/rtc-agent/helpers/bus-handler.d.ts.map +1 -1
- package/dist/components/rtc-agent/helpers/command-handler.d.ts +8 -0
- package/dist/components/rtc-agent/helpers/command-handler.d.ts.map +1 -1
- package/dist/components/rtc-agent/helpers/connection-setup.d.ts +5 -8
- package/dist/components/rtc-agent/helpers/connection-setup.d.ts.map +1 -1
- package/dist/components/rtc-agent/helpers/dialog-helpers.d.ts +12 -0
- package/dist/components/rtc-agent/helpers/dialog-helpers.d.ts.map +1 -1
- package/dist/components/rtc-agent/helpers/session-loader.d.ts +2 -0
- package/dist/components/rtc-agent/helpers/session-loader.d.ts.map +1 -1
- package/dist/components/rtc-agent/helpers/vfs-operations.d.ts +22 -3
- package/dist/components/rtc-agent/helpers/vfs-operations.d.ts.map +1 -1
- package/dist/components/rtc-agent/rtc-agent.d.ts +22 -47
- package/dist/components/rtc-agent/rtc-agent.d.ts.map +1 -1
- package/dist/components/session-tree/rtc-session-tab-bar.d.ts +8 -8
- package/dist/components/session-tree/rtc-session-tab-bar.d.ts.map +1 -1
- package/dist/components/session-tree/rtc-session-tab-bar.styles.d.ts +5 -5
- package/dist/components/session-tree/rtc-session-tab.d.ts +6 -6
- package/dist/components/session-tree/rtc-session-tab.d.ts.map +1 -1
- package/dist/components/session-tree/rtc-session-tab.styles.d.ts +6 -6
- package/dist/components/session-tree/rtc-session-tree-item.d.ts +10 -10
- package/dist/components/session-tree/rtc-session-tree-item.d.ts.map +1 -1
- package/dist/components/session-tree/rtc-session-tree-item.styles.d.ts +6 -6
- package/dist/components/session-tree/rtc-session-tree.d.ts +15 -15
- package/dist/components/session-tree/rtc-session-tree.d.ts.map +1 -1
- package/dist/components/session-tree/rtc-session-tree.styles.d.ts +5 -5
- package/dist/components/settings-layout/rtc-settings-layout.d.ts +23 -23
- package/dist/components/settings-layout/rtc-settings-layout.d.ts.map +1 -1
- package/dist/components/settings-layout/rtc-settings-layout.styles.d.ts +3 -3
- package/dist/components/settings-layout/rtc-settings-nav.d.ts +17 -17
- package/dist/components/settings-layout/rtc-settings-nav.d.ts.map +1 -1
- package/dist/components/settings-layout/rtc-settings-nav.styles.d.ts +2 -2
- package/dist/components/status-bar/rtc-status-bar.d.ts +10 -10
- package/dist/components/status-bar/rtc-status-bar.d.ts.map +1 -1
- package/dist/components/status-bar/rtc-status-bar.styles.d.ts +5 -5
- package/dist/components/title-bar/rtc-title-bar.d.ts +4 -4
- package/dist/components/title-bar/rtc-title-bar.d.ts.map +1 -1
- package/dist/components/token-usage/rtc-token-usage.d.ts +21 -21
- package/dist/components/token-usage/rtc-token-usage.d.ts.map +1 -1
- package/dist/config/auth.d.ts +12 -6
- package/dist/config/auth.d.ts.map +1 -1
- package/dist/contexts/activity.d.ts +13 -13
- package/dist/contexts/activity.d.ts.map +1 -1
- package/dist/contexts/auth.d.ts +5 -4
- package/dist/contexts/auth.d.ts.map +1 -1
- package/dist/contexts/editor.d.ts +13 -13
- package/dist/contexts/editor.d.ts.map +1 -1
- package/dist/contexts/file-explorer.d.ts +15 -15
- package/dist/contexts/file-explorer.d.ts.map +1 -1
- package/dist/contexts/function-debug.d.ts +52 -0
- package/dist/contexts/function-debug.d.ts.map +1 -0
- package/dist/contexts/functions.d.ts +43 -0
- package/dist/contexts/functions.d.ts.map +1 -0
- package/dist/contexts/message.d.ts +3 -3
- package/dist/contexts/notification.d.ts +4 -4
- package/dist/contexts/notification.d.ts.map +1 -1
- package/dist/contexts/settings.d.ts +2 -2
- package/dist/contexts/skill.d.ts +5 -5
- package/dist/contexts/skill.d.ts.map +1 -1
- package/dist/contexts/turn-count.d.ts +7 -7
- package/dist/controllers/activity.controller.d.ts +11 -11
- package/dist/controllers/activity.controller.d.ts.map +1 -1
- package/dist/controllers/auth.controller.d.ts +5 -0
- package/dist/controllers/auth.controller.d.ts.map +1 -1
- package/dist/controllers/editor-area.controller.d.ts +42 -41
- package/dist/controllers/editor-area.controller.d.ts.map +1 -1
- package/dist/controllers/editor.controller.d.ts +3 -3
- package/dist/controllers/event-binding.controller.d.ts +204 -0
- package/dist/controllers/event-binding.controller.d.ts.map +1 -0
- package/dist/controllers/file-explorer.controller.d.ts +6 -6
- package/dist/controllers/function-debug.controller.d.ts +67 -0
- package/dist/controllers/function-debug.controller.d.ts.map +1 -0
- package/dist/controllers/functions.controller.d.ts +31 -0
- package/dist/controllers/functions.controller.d.ts.map +1 -0
- package/dist/controllers/message.controller.d.ts +11 -1
- package/dist/controllers/message.controller.d.ts.map +1 -1
- package/dist/controllers/notification.controller.d.ts +34 -30
- package/dist/controllers/notification.controller.d.ts.map +1 -1
- package/dist/controllers/persistence.controller.d.ts +31 -14
- package/dist/controllers/persistence.controller.d.ts.map +1 -1
- package/dist/controllers/session-tab.controller.d.ts +32 -29
- package/dist/controllers/session-tab.controller.d.ts.map +1 -1
- package/dist/controllers/session-tree.controller.d.ts +10 -10
- package/dist/controllers/session-tree.controller.d.ts.map +1 -1
- package/dist/controllers/session.controller.d.ts +6 -6
- package/dist/controllers/settings.controller.d.ts +1 -1
- package/dist/controllers/skill.controller.d.ts +21 -21
- package/dist/controllers/skill.controller.d.ts.map +1 -1
- package/dist/controllers/status-bar.controller.d.ts +11 -11
- package/dist/controllers/toast.controller.d.ts.map +1 -1
- package/dist/controllers/tool-call.controller.d.ts +4 -4
- package/dist/controllers/window-interaction.controller.d.ts +14 -12
- package/dist/controllers/window-interaction.controller.d.ts.map +1 -1
- package/dist/controllers/window-state.controller.d.ts +5 -5
- package/dist/controllers/window-state.controller.d.ts.map +1 -1
- package/dist/core/builtin-system-group.d.ts +26 -19
- package/dist/core/builtin-system-group.d.ts.map +1 -1
- package/dist/core/event-bus.d.ts +31 -31
- package/dist/core/function-registry.d.ts +82 -71
- package/dist/core/function-registry.d.ts.map +1 -1
- package/dist/core/i18n.d.ts +2 -2
- package/dist/core/locale-controller.d.ts +2 -2
- package/dist/core/markdown-generator.d.ts +20 -10
- package/dist/core/markdown-generator.d.ts.map +1 -1
- package/dist/core/ready.d.ts +9 -9
- package/dist/core/scenario-loader.d.ts +29 -25
- package/dist/core/scenario-loader.d.ts.map +1 -1
- package/dist/elements.d.ts +6 -6
- package/dist/{en-US-BK61Z8gy.js → en-US-DGPo7Pzk.js} +56 -8
- package/dist/factory.d.ts.map +1 -1
- package/dist/{highlight-languages-8EK0uwTA.js → highlight-languages-BStkA3vP.js} +1 -1
- package/dist/icons/logo.d.ts +5 -5
- package/dist/{index-Bd4j91y1.js → index-c20k11wZ.js} +28078 -23840
- package/dist/index.d.ts +17 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -36
- package/dist/index.umd.js +3277 -1094
- package/dist/master-lock.d.ts +27 -27
- package/dist/master-lock.d.ts.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types/activity-bar-config.d.ts +14 -14
- package/dist/types/activity-bar-config.d.ts.map +1 -1
- package/dist/types/agent-config.d.ts +18 -18
- package/dist/types/agent-config.d.ts.map +1 -1
- package/dist/types/events.d.ts +75 -19
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/factory.d.ts +13 -5
- package/dist/types/factory.d.ts.map +1 -1
- package/dist/types/functions-debug.d.ts +48 -0
- package/dist/types/functions-debug.d.ts.map +1 -0
- package/dist/types/index.d.ts +97 -102
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/skill.d.ts +95 -83
- package/dist/types/skill.d.ts.map +1 -1
- package/dist/types/window-config.d.ts +37 -37
- package/dist/types/window-config.d.ts.map +1 -1
- package/dist/utils/clipboard.d.ts +6 -6
- package/dist/utils/command-parser.d.ts +9 -9
- package/dist/utils/command-parser.d.ts.map +1 -1
- package/dist/utils/highlight-languages.d.ts +3 -3
- package/dist/utils/relative-time.d.ts +7 -7
- package/dist/utils/session-exporter.d.ts +65 -0
- package/dist/utils/session-exporter.d.ts.map +1 -0
- package/dist/utils/skeleton-tracker.d.ts +56 -56
- package/dist/utils/skeleton-tracker.d.ts.map +1 -1
- package/dist/utils/visibility-manager.d.ts +42 -42
- package/dist/utils/visibility-manager.d.ts.map +1 -1
- package/dist/validation/index.d.ts +16 -16
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/openapi-to-zod.d.ts +5 -5
- package/dist/validation/zod-to-openapi.d.ts +24 -14
- package/dist/validation/zod-to-openapi.d.ts.map +1 -1
- package/dist/worker-bridge.d.ts +11 -0
- package/dist/worker-bridge.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/core/event-bus.d.ts
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Event Bus
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Simple event bus for decoupling FunctionRegistry and UI.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* - FunctionRegistry
|
|
8
|
-
* - UI
|
|
9
|
-
* -
|
|
6
|
+
* Usage scenarios:
|
|
7
|
+
* - FunctionRegistry emits function:start/success/error/progress events
|
|
8
|
+
* - UI layer listens to events and displays toast/confirm/progress
|
|
9
|
+
* - Host applications (Flutter) listen to events and forward via postMessage
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Event handler type
|
|
13
13
|
*/
|
|
14
14
|
export type EventHandler<T = unknown> = (event: T) => void | Promise<void>;
|
|
15
15
|
/**
|
|
16
|
-
* MD8:
|
|
16
|
+
* MD8: Event map interface - provides type safety for event names
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Usage:
|
|
19
19
|
* ```ts
|
|
20
20
|
* interface MyEvents {
|
|
21
21
|
* 'user:login': { userId: string };
|
|
22
22
|
* 'user:logout': void;
|
|
23
23
|
* }
|
|
24
24
|
* const bus = createEventBus<MyEvents>();
|
|
25
|
-
* bus.on('user:login', (event) => { ... }); // event
|
|
25
|
+
* bus.on('user:login', (event) => { ... }); // event type is { userId: string }
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
export interface DefaultEventMap {
|
|
29
29
|
[event: string]: unknown;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Event bus
|
|
33
33
|
*
|
|
34
|
-
* @typeParam TEventMap -
|
|
34
|
+
* @typeParam TEventMap - Mapping from event names to data types (MD8)
|
|
35
35
|
*/
|
|
36
36
|
export declare class EventBus<TEventMap extends DefaultEventMap = DefaultEventMap> {
|
|
37
37
|
private handlers;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Subscribe to event
|
|
40
40
|
*
|
|
41
|
-
* @returns
|
|
41
|
+
* @returns Unsubscribe function
|
|
42
42
|
*/
|
|
43
43
|
on<K extends keyof TEventMap & string>(event: K, handler: EventHandler<TEventMap[K]>): () => void;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Subscribe to one-time event
|
|
46
46
|
*/
|
|
47
47
|
once<K extends keyof TEventMap & string>(event: K, handler: EventHandler<TEventMap[K]>): () => void;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Unsubscribe
|
|
50
50
|
*/
|
|
51
51
|
off<K extends keyof TEventMap & string>(event: K, handler: EventHandler<TEventMap[K]>): void;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Emit event (synchronous)
|
|
54
54
|
*
|
|
55
|
-
* M8:
|
|
55
|
+
* M8: Snapshot handlers (Array.from) before iteration to avoid concurrent modification when handler calls off
|
|
56
56
|
*/
|
|
57
57
|
emit<K extends keyof TEventMap & string>(event: K, data: TEventMap[K]): void;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Emit event (async, wait for all handlers to complete)
|
|
60
60
|
*
|
|
61
|
-
* M9:
|
|
62
|
-
*
|
|
61
|
+
* M9: Note: this method always resolves; errors in handlers are caught and output via log.error.
|
|
62
|
+
* If error propagation is needed (handler errors cause emitAsync to reject), use emitAsyncStrict.
|
|
63
63
|
*/
|
|
64
64
|
emitAsync<K extends keyof TEventMap & string>(event: K, data: TEventMap[K]): Promise<void>;
|
|
65
65
|
/**
|
|
66
|
-
* M9:
|
|
66
|
+
* M9: Strict async event emit - handler errors cause Promise rejection
|
|
67
67
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
68
|
+
* Unlike emitAsync, this method does not swallow errors from handlers.
|
|
69
|
+
* If any handler throws, the returned Promise will reject.
|
|
70
70
|
*/
|
|
71
71
|
emitAsyncStrict<K extends keyof TEventMap & string>(event: K, data: TEventMap[K]): Promise<void>;
|
|
72
72
|
/**
|
|
73
|
-
* m6:
|
|
73
|
+
* m6: Clear all handlers for all events (renamed to clearAll for symmetry with clearEvent)
|
|
74
74
|
*/
|
|
75
75
|
clearAll(): void;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Clear all handlers for a specific event
|
|
78
78
|
*/
|
|
79
79
|
clearEvent(event: string): void;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Function
|
|
82
|
+
* Function execution related events
|
|
83
83
|
*/
|
|
84
84
|
export interface FunctionStartEvent {
|
|
85
85
|
path: string;
|
|
@@ -98,7 +98,7 @@ export interface FunctionProgressEvent {
|
|
|
98
98
|
progress: number;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
* MD8: FunctionRegistry
|
|
101
|
+
* MD8: Event map used by FunctionRegistry
|
|
102
102
|
*/
|
|
103
103
|
export interface FunctionRegistryEventMap extends DefaultEventMap {
|
|
104
104
|
'function:start': FunctionStartEvent;
|
|
@@ -120,14 +120,14 @@ export interface FunctionRegistryEventMap extends DefaultEventMap {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
* MD7:
|
|
123
|
+
* MD7: Event bus factory function
|
|
124
124
|
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
125
|
+
* Uses factory function to create new event bus instances, avoiding global singleton issues.
|
|
126
|
+
* The global instance `defaultEventBus` is just the default export; applications can create their own instances.
|
|
127
127
|
*/
|
|
128
128
|
export declare function createEventBus<TEventMap extends DefaultEventMap = DefaultEventMap>(): EventBus<TEventMap>;
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
130
|
+
* Global default event bus instance (MD7: only as default export; recommended to use createEventBus() to create independent instances)
|
|
131
131
|
*/
|
|
132
132
|
export declare const eventBus: EventBus<FunctionRegistryEventMap>;
|
|
133
133
|
//# sourceMappingURL=event-bus.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Function Registry
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Manages function registration, resolution, and chain calls.
|
|
5
|
+
* Uses Proxy to implement rtcAgent.user.register() syntax.
|
|
6
6
|
*/
|
|
7
7
|
import type { FunctionDef, FunctionGroupDef, RegistryConfig, ScenarioDef } from '../types/skill.js';
|
|
8
8
|
/**
|
|
9
|
-
* FunctionGroup
|
|
10
|
-
*
|
|
9
|
+
* FunctionGroup instance
|
|
10
|
+
* Supports chain registration and invocation
|
|
11
11
|
*/
|
|
12
12
|
export declare class FunctionGroup {
|
|
13
13
|
private registry;
|
|
@@ -15,27 +15,27 @@ export declare class FunctionGroup {
|
|
|
15
15
|
private functions;
|
|
16
16
|
constructor(registry: FunctionRegistry, groupDef: FunctionGroupDef);
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Register a function to the current group
|
|
19
19
|
*
|
|
20
|
-
* @param funcDef Function
|
|
20
|
+
* @param funcDef Function definition, name is required (function name within the group, without group prefix)
|
|
21
21
|
*/
|
|
22
22
|
register(funcDef: Omit<FunctionDef, 'name'> & {
|
|
23
23
|
name: string;
|
|
24
24
|
}): FunctionDef;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Get all functions within the group
|
|
27
27
|
*/
|
|
28
28
|
listFunctions(): FunctionDef[];
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Support chain calls via Proxy: rtcAgent.task.list(params)
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* Whitelist methods are returned directly; other property names are treated as function names within the group,
|
|
33
|
+
* returning a function that calls registry.execute('group.funcName', params).
|
|
34
34
|
*/
|
|
35
35
|
createProxy(): FunctionGroup & Record<string, (params?: Record<string, unknown>) => Promise<unknown>>;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
* FunctionRegistry -
|
|
38
|
+
* FunctionRegistry - Global registry
|
|
39
39
|
*/
|
|
40
40
|
export declare class FunctionRegistry {
|
|
41
41
|
private config;
|
|
@@ -45,141 +45,152 @@ export declare class FunctionRegistry {
|
|
|
45
45
|
private groupDefs;
|
|
46
46
|
constructor(config: RegistryConfig);
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Register a single function
|
|
49
49
|
*
|
|
50
|
-
* M10:
|
|
51
|
-
* register()
|
|
52
|
-
*
|
|
53
|
-
*
|
|
50
|
+
* M10: Note that document generation (_updateFunctionDoc) is an async fire-and-forget operation.
|
|
51
|
+
* After register() returns, the document may not yet be written to the virtual file system.
|
|
52
|
+
* Documents will typically be ready within a few hundred milliseconds, but completion at register() return is not guaranteed.
|
|
53
|
+
* If you need to ensure the document is ready, manually call the virtual file system's read and wait.
|
|
54
54
|
*/
|
|
55
55
|
register(funcDef: FunctionDef): FunctionDef;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Internal method: Register a function (called by FunctionGroup)
|
|
58
58
|
*
|
|
59
|
-
* @internal
|
|
59
|
+
* @internal For internal use only; external callers should use the register() method
|
|
60
60
|
*
|
|
61
|
-
* M10:
|
|
61
|
+
* M10: Same as register(), document generation is async fire-and-forget and may be delayed in becoming ready.
|
|
62
62
|
*/
|
|
63
63
|
registerInternal(funcDef: FunctionDef, groupName: string): void;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Normalize a FunctionDef by deriving parameters from zodSchema when parameters is not set.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
67
|
+
* Ensures all downstream consumers (debugger, default params, markdown generator)
|
|
68
|
+
* can rely on `fn.parameters` being populated.
|
|
69
|
+
*/
|
|
70
|
+
private _normalizeFunctionDef;
|
|
71
|
+
/**
|
|
72
|
+
* Create a FunctionGroup
|
|
73
|
+
*
|
|
74
|
+
* Returns a Proxy-wrapped FunctionGroup supporting chain calls:
|
|
68
75
|
* rtcAgent.task.list(params) → rtcAgent.execute('task.list', params)
|
|
69
76
|
*/
|
|
70
77
|
createGroup(groupDef: FunctionGroupDef): FunctionGroup & Record<string, (params?: Record<string, unknown>) => Promise<unknown>>;
|
|
71
78
|
/**
|
|
72
|
-
*
|
|
79
|
+
* Unregister a function
|
|
73
80
|
*
|
|
74
|
-
*
|
|
81
|
+
* Removes the function definition from memory, deletes the document in the virtual file system, and updates the index.
|
|
75
82
|
*
|
|
76
|
-
* MD9: unregister
|
|
77
|
-
* - register
|
|
78
|
-
* - unregister
|
|
79
|
-
* -
|
|
83
|
+
* MD9: Design rationale for unregister being async while register is sync:
|
|
84
|
+
* - register only updates the in-memory Map (synchronous operation); document generation is background fire-and-forget
|
|
85
|
+
* - unregister needs to delete document files in the virtual file system and update the index, which are I/O operations
|
|
86
|
+
* - Callers typically need to confirm file system cleanup after unregister completes, so unregister returns a Promise
|
|
80
87
|
*/
|
|
81
88
|
unregister(name: string): Promise<void>;
|
|
82
89
|
/**
|
|
83
|
-
*
|
|
90
|
+
* Resolve a function path
|
|
84
91
|
*/
|
|
85
92
|
resolve(path: string): FunctionDef | undefined;
|
|
86
93
|
/**
|
|
87
|
-
*
|
|
94
|
+
* List all functions
|
|
88
95
|
*/
|
|
89
96
|
listFunctions(): FunctionDef[];
|
|
90
97
|
/**
|
|
91
|
-
*
|
|
98
|
+
* List all groups
|
|
92
99
|
*/
|
|
93
100
|
listGroups(): FunctionGroupDef[];
|
|
94
101
|
/**
|
|
95
|
-
*
|
|
102
|
+
* Regenerate all documents (used after database initialization)
|
|
96
103
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
104
|
+
* Solves timing issue: when register() is called before database initialization, document writes will fail.
|
|
105
|
+
* After database initialization completes, call this method to regenerate all documents.
|
|
99
106
|
*
|
|
100
|
-
*
|
|
107
|
+
* Should use generateAllDocsContent() + WorkerBridge.batchWriteFiles()
|
|
101
108
|
*/
|
|
102
109
|
regenerateAllDocs(): Promise<void>;
|
|
103
110
|
/**
|
|
104
|
-
*
|
|
111
|
+
* Generate all document content (without writing to VirtualFS), and calculate orphan paths to delete
|
|
105
112
|
*
|
|
106
|
-
*
|
|
113
|
+
* Usage: main thread generates content, sends it to Worker via WorkerBridge.batchWriteFiles() for writing.
|
|
114
|
+
* Also queries existing function documents in VFS to calculate orphan paths that are no longer registered, and passes them to Worker for deletion.
|
|
107
115
|
*
|
|
108
|
-
* @param scenarioCount
|
|
109
|
-
* @returns
|
|
116
|
+
* @param scenarioCount Number of scenarios (used for generating AGENT.md)
|
|
117
|
+
* @returns files: list of files to write, deletePaths: orphan paths to delete
|
|
110
118
|
*/
|
|
111
|
-
generateAllDocsContent(scenarioCount?: number):
|
|
112
|
-
|
|
113
|
-
|
|
119
|
+
generateAllDocsContent(scenarioCount?: number): Promise<{
|
|
120
|
+
files: Array<{
|
|
121
|
+
path: string;
|
|
122
|
+
content: string;
|
|
123
|
+
}>;
|
|
124
|
+
deletePaths: string[];
|
|
114
125
|
}>;
|
|
115
126
|
/**
|
|
116
|
-
*
|
|
127
|
+
* Execute a function
|
|
117
128
|
*
|
|
118
|
-
*
|
|
119
|
-
* -
|
|
120
|
-
* - UI
|
|
129
|
+
* Uses event-driven architecture, does not directly invoke UI:
|
|
130
|
+
* - Emits function:start/success/error/progress events
|
|
131
|
+
* - UI layer listens to events and handles them
|
|
121
132
|
*
|
|
122
|
-
* CancelledError
|
|
123
|
-
* - onStart
|
|
133
|
+
* CancelledError handling:
|
|
134
|
+
* - CancelledError thrown by onStart does not trigger onError
|
|
124
135
|
*
|
|
125
|
-
* M11: onSuccess
|
|
126
|
-
* onSuccess
|
|
127
|
-
*
|
|
136
|
+
* M11: onSuccess uses fire-and-forget, no ordering guarantee with eventBus.emit('function:success').
|
|
137
|
+
* onSuccess may complete before or after the function:success event.
|
|
138
|
+
* For strict ordering, use event listeners instead of hooks.
|
|
128
139
|
*/
|
|
129
140
|
execute(path: string, params: Record<string, unknown>): Promise<unknown>;
|
|
130
141
|
/**
|
|
131
|
-
*
|
|
142
|
+
* Write a scenario
|
|
132
143
|
*
|
|
133
|
-
* m8: scenario.id
|
|
134
|
-
*
|
|
135
|
-
* scenario.id
|
|
144
|
+
* m8: scenario.id field is ignored; filename is always generated from title slug.
|
|
145
|
+
* Reason: virtual file system paths are based on title slug; id is only used for database indexing.
|
|
146
|
+
* scenario.id is used for unique identification in scenario-loader's manifest, but does not affect file storage path.
|
|
136
147
|
*
|
|
137
|
-
*
|
|
148
|
+
* Write strategy: uses 'create-new' mode; does not overwrite if file already exists (protects user-edited content)
|
|
138
149
|
*/
|
|
139
150
|
writeScenario(scenario: ScenarioDef): Promise<void>;
|
|
140
151
|
/**
|
|
141
|
-
*
|
|
152
|
+
* Update function documentation
|
|
142
153
|
*/
|
|
143
154
|
private _updateFunctionDoc;
|
|
144
155
|
/**
|
|
145
|
-
*
|
|
156
|
+
* Update Functions index
|
|
146
157
|
*
|
|
147
|
-
*
|
|
158
|
+
* Write strategy: uses 'overwrite' mode (index file is always up to date)
|
|
148
159
|
*/
|
|
149
160
|
private _updateFunctionsIndex;
|
|
150
161
|
/**
|
|
151
|
-
*
|
|
162
|
+
* Update Scenarios index
|
|
152
163
|
*
|
|
153
|
-
*
|
|
164
|
+
* Write strategy: uses 'overwrite' mode (index file is always up to date)
|
|
154
165
|
*/
|
|
155
166
|
private _updateScenariosIndex;
|
|
156
167
|
/**
|
|
157
|
-
*
|
|
168
|
+
* Update AGENT.md
|
|
158
169
|
*
|
|
159
|
-
*
|
|
170
|
+
* Write strategy: uses 'create-new' mode; does not overwrite if file already exists (protects user-edited content)
|
|
160
171
|
*/
|
|
161
172
|
private _updateAgentMd;
|
|
162
173
|
/**
|
|
163
|
-
*
|
|
174
|
+
* Convert string to slug
|
|
164
175
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
176
|
+
* Supports CJK characters (Chinese, Japanese, Korean)
|
|
177
|
+
* If the result is empty, uses timestamp + random number
|
|
167
178
|
*
|
|
168
|
-
* MD10: slug
|
|
179
|
+
* MD10: slug is truncated to 100 characters to avoid overly long filenames
|
|
169
180
|
*/
|
|
170
181
|
private _slugify;
|
|
171
182
|
/**
|
|
172
|
-
* M12:
|
|
183
|
+
* M12: Support chain calls via Proxy: rtcAgent.user.register(params)
|
|
173
184
|
*
|
|
174
|
-
*
|
|
185
|
+
* Uses whitelist to expose methods, without exposing private properties like functions/groups
|
|
175
186
|
*/
|
|
176
187
|
createProxy(): FunctionRegistry & Record<string, FunctionGroup>;
|
|
177
188
|
}
|
|
178
189
|
/**
|
|
179
|
-
*
|
|
190
|
+
* Create global Registry
|
|
180
191
|
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
192
|
+
* Automatically registers the built-in system tool group (delay/uuid/now/random/time),
|
|
193
|
+
* allowing scripts to access commonly used platform APIs sandboxed via rtcAgent.system.*.
|
|
183
194
|
*/
|
|
184
195
|
export declare function defineRegistry(config: RegistryConfig): FunctionRegistry & Record<string, FunctionGroup>;
|
|
185
196
|
//# sourceMappingURL=function-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-registry.d.ts","sourceRoot":"","sources":["../../src/core/function-registry.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACZ,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"function-registry.d.ts","sourceRoot":"","sources":["../../src/core/function-registry.ts"],"names":[],"mappings":"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"}
|
package/dist/core/i18n.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export declare function isValidLocale(value: string): value is SupportedLocale;
|
|
|
18
18
|
export declare function initLocale(hostLang?: string): Promise<void>;
|
|
19
19
|
export declare function persistLocale(locale: SupportedLocale): void;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Switch language and synchronize all related state
|
|
22
|
+
* Components should call this function instead of calling _setLocale directly
|
|
23
23
|
*/
|
|
24
24
|
export declare function switchLocale(locale: SupportedLocale): Promise<void>;
|
|
25
25
|
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactiveController, type ReactiveControllerHost } from 'lit';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Wraps locale context consumption logic to reduce component boilerplate
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```typescript
|
|
@@ -10,7 +10,7 @@ import { type ReactiveController, type ReactiveControllerHost } from 'lit';
|
|
|
10
10
|
* private _locale = new LocaleController(this);
|
|
11
11
|
*
|
|
12
12
|
* render() {
|
|
13
|
-
* return html`<p
|
|
13
|
+
* return html`<p>Current: ${this._locale.locale}</p>`;
|
|
14
14
|
* }
|
|
15
15
|
* }
|
|
16
16
|
* ```
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Markdown Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Generates markdown documentation from FunctionDef.
|
|
5
|
+
* Uses OpenAPI Schema format to describe parameters and return values.
|
|
6
6
|
*/
|
|
7
|
-
import type { FunctionDef, FunctionGroupDef, RegistryConfig } from '../types/skill.js';
|
|
7
|
+
import type { FunctionDef, FunctionGroupDef, RegistryConfig, OpenAPISchema } from '../types/skill.js';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Convert OpenAPI Schema to a readable type string
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* References openapi-markdown's dataTypes.js logic
|
|
12
|
+
*/
|
|
13
|
+
export declare function schemaToTypeString(schema: OpenAPISchema): string;
|
|
14
|
+
/**
|
|
15
|
+
* Generate markdown documentation for a single Function
|
|
16
|
+
*
|
|
17
|
+
* Adds a generation identifier comment at the file header to mark it as auto-generated
|
|
12
18
|
*/
|
|
13
19
|
export declare function generateFunctionMd(funcDef: FunctionDef, groupName?: string): string;
|
|
14
20
|
/**
|
|
15
|
-
*
|
|
21
|
+
* Generate example value based on OpenAPI Schema
|
|
22
|
+
*/
|
|
23
|
+
export declare function getExampleValue(schema: OpenAPISchema): string;
|
|
24
|
+
/**
|
|
25
|
+
* Generate Functions index (organized by group)
|
|
16
26
|
*/
|
|
17
27
|
export declare function generateFunctionsIndex(functions: FunctionDef[], groups: FunctionGroupDef[]): string;
|
|
18
28
|
/**
|
|
19
|
-
*
|
|
29
|
+
* Generate Scenarios index
|
|
20
30
|
*/
|
|
21
31
|
export declare function generateScenariosIndex(scenarios: Array<{
|
|
22
32
|
path: string;
|
|
@@ -27,10 +37,10 @@ export declare function generateScenariosIndex(scenarios: Array<{
|
|
|
27
37
|
};
|
|
28
38
|
}>): string;
|
|
29
39
|
/**
|
|
30
|
-
*
|
|
40
|
+
* Generate AGENT.md
|
|
31
41
|
*
|
|
32
|
-
* Agent Prompt
|
|
33
|
-
*
|
|
42
|
+
* Agent Prompt defines the Agent's identity, workflow, and capabilities.
|
|
43
|
+
* The frontend generates this content; the server has a default fallback implementation.
|
|
34
44
|
*/
|
|
35
45
|
export declare function generateAgentMd(config: RegistryConfig, functions: FunctionDef[], groups: FunctionGroupDef[], scenarioCount: number): string;
|
|
36
46
|
//# sourceMappingURL=markdown-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-generator.d.ts","sourceRoot":"","sources":["../../src/core/markdown-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"markdown-generator.d.ts","sourceRoot":"","sources":["../../src/core/markdown-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAgB,MAAM,mBAAmB,CAAC;AAMpH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAqChE;AAuED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAgInF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAyC7D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,WAAW,EAAE,EACxB,MAAM,EAAE,gBAAgB,EAAE,GACzB,MAAM,CAsCR;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,KAAK,CAAC;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpE,CAAC,GAAG,MAAM,CAgBV;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,WAAW,EAAE,EACxB,MAAM,EAAE,gBAAgB,EAAE,EAC1B,aAAa,EAAE,MAAM,GACpB,MAAM,CAaR"}
|
package/dist/core/ready.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Module Ready Signal
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1. `whenReady()` Promise — ES module
|
|
6
|
-
* 2. `rtc-agent-ready`
|
|
4
|
+
* Provides two mechanisms for the host application to wait for <rtc-agent> component initialization:
|
|
5
|
+
* 1. `whenReady()` Promise — ES module style
|
|
6
|
+
* 2. `rtc-agent-ready` custom event — Web Component style (dispatched by RtcAgent component)
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Internal use: component calls _markReady() on firstUpdated.
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Wait for the <rtc-agent> component module to load and initialize
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const whenReady: Promise<void>;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Mark the module as ready (internal use)
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* Called by RtcAgent component on firstUpdated.
|
|
26
|
+
* Safe to call multiple times (subsequent calls return immediately).
|
|
27
27
|
*/
|
|
28
28
|
export declare function _markReady(): void;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Check whether the module is ready (internal use, mainly for testing)
|
|
31
31
|
*/
|
|
32
32
|
export declare function _isReady(): boolean;
|
|
33
33
|
//# sourceMappingURL=ready.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Scenario Loader
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Loads Scenario markdown files from a URL
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Parse YAML frontmatter
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Format:
|
|
10
10
|
* ---
|
|
11
|
-
* title: "
|
|
11
|
+
* title: "Title"
|
|
12
12
|
* tags: [tag1, tag2]
|
|
13
13
|
* ---
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* Content...
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Supported fields: title, id, name, description, tags, author, createdAt
|
|
18
|
+
* Limitations: does not support multi-line values or complex YAML structures
|
|
19
19
|
*/
|
|
20
20
|
export declare function parseFrontmatter(content: string): {
|
|
21
21
|
id?: string;
|
|
@@ -28,29 +28,33 @@ export declare function parseFrontmatter(content: string): {
|
|
|
28
28
|
body: string;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Load Scenarios from URL
|
|
32
32
|
*
|
|
33
|
-
* @param baseURL Scenario
|
|
34
|
-
* @param timeoutMs
|
|
35
|
-
* @returns
|
|
33
|
+
* @param baseURL Base URL for Scenario files (e.g. '/scenarios/')
|
|
34
|
+
* @param timeoutMs Timeout per request in milliseconds (default 10000)
|
|
35
|
+
* @returns Number of Scenarios loaded
|
|
36
36
|
*/
|
|
37
37
|
export declare function loadScenariosFromURL(baseURL: string, timeoutMs?: number): Promise<number>;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Load Scenarios content from URL (without writing to VirtualFS), and compute orphan paths to delete
|
|
40
40
|
*
|
|
41
|
-
*
|
|
41
|
+
* Usage: main thread fetches content, then sends it via WorkerBridge.batchWriteFiles() to the Worker for writing.
|
|
42
|
+
* Also queries existing scenario files in VFS to compute orphan paths not in the manifest, passing them to the Worker for deletion.
|
|
42
43
|
*
|
|
43
|
-
* @param baseURL Scenario
|
|
44
|
-
* @param timeoutMs
|
|
45
|
-
* @returns
|
|
44
|
+
* @param baseURL Base URL for Scenario files
|
|
45
|
+
* @param timeoutMs Timeout per request
|
|
46
|
+
* @returns files: files to write, deletePaths: orphan paths to delete
|
|
46
47
|
*/
|
|
47
|
-
export declare function loadScenariosContent(baseURL: string, timeoutMs?: number): Promise<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
48
|
+
export declare function loadScenariosContent(baseURL: string, timeoutMs?: number): Promise<{
|
|
49
|
+
files: Array<{
|
|
50
|
+
path: string;
|
|
51
|
+
content: string;
|
|
52
|
+
metadata: {
|
|
53
|
+
name?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
tags?: string[];
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
deletePaths: string[];
|
|
59
|
+
}>;
|
|
56
60
|
//# sourceMappingURL=scenario-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-loader.d.ts","sourceRoot":"","sources":["../../src/core/scenario-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG;IACjD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAuEA;AAiBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwFtG;AAED
|
|
1
|
+
{"version":3,"file":"scenario-loader.d.ts","sourceRoot":"","sources":["../../src/core/scenario-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG;IACjD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAuEA;AAiBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwFtG;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAc,GACxB,OAAO,CAAC;IACT,KAAK,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;SAAC,CAAA;KAAC,CAAC,CAAA;IAC/G,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC,CA+ED"}
|