@rtc-agent/component 0.2.7-rc.4 → 0.2.8-rc.1

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.
Files changed (235) hide show
  1. package/README.md +109 -13
  2. package/dist/.generated/locales/en-US.d.ts +55 -7
  3. package/dist/.generated/locales/en-US.d.ts.map +1 -1
  4. package/dist/assets/{shared-worker-BQv441O7.js → shared-worker-CXyjL7E6.js} +210 -210
  5. package/dist/components/activity-bar/rtc-activity-bar.d.ts +23 -21
  6. package/dist/components/activity-bar/rtc-activity-bar.d.ts.map +1 -1
  7. package/dist/components/activity-bar/rtc-activity-bar.styles.d.ts +2 -2
  8. package/dist/components/chat-layout/rtc-chat-layout.d.ts +87 -80
  9. package/dist/components/chat-layout/rtc-chat-layout.d.ts.map +1 -1
  10. package/dist/components/chat-layout/rtc-chat-layout.styles.d.ts +5 -5
  11. package/dist/components/content-area/rtc-error-message.d.ts +1 -1
  12. package/dist/components/content-area/rtc-message-more-menu.d.ts +4 -4
  13. package/dist/components/content-area/rtc-message-more-menu.d.ts.map +1 -1
  14. package/dist/components/content-area/rtc-message.d.ts +82 -76
  15. package/dist/components/content-area/rtc-message.d.ts.map +1 -1
  16. package/dist/components/content-area/rtc-message.styles.d.ts.map +1 -1
  17. package/dist/components/content-area/rtc-toolcall-card.d.ts +10 -5
  18. package/dist/components/content-area/rtc-toolcall-card.d.ts.map +1 -1
  19. package/dist/components/content-area/rtc-toolcall-card.styles.d.ts.map +1 -1
  20. package/dist/components/content-area/rtc-toolcall-reply.d.ts +12 -0
  21. package/dist/components/content-area/rtc-toolcall-reply.d.ts.map +1 -1
  22. package/dist/components/content-area/rtc-toolcall-reply.styles.d.ts.map +1 -1
  23. package/dist/components/content-area/rtc-user-message.d.ts +10 -10
  24. package/dist/components/drawer/rtc-drawer.d.ts +29 -27
  25. package/dist/components/drawer/rtc-drawer.d.ts.map +1 -1
  26. package/dist/components/drawer/rtc-drawer.styles.d.ts +9 -9
  27. package/dist/components/editor-area/rtc-editor-area.d.ts +29 -29
  28. package/dist/components/editor-area/rtc-editor-area.d.ts.map +1 -1
  29. package/dist/components/editor-area/rtc-editor-area.styles.d.ts +3 -3
  30. package/dist/components/editor-area/rtc-editor-tab.d.ts +27 -27
  31. package/dist/components/editor-area/rtc-editor-tab.d.ts.map +1 -1
  32. package/dist/components/editor-area/rtc-editor-tab.styles.d.ts +3 -3
  33. package/dist/components/editor-area/rtc-editor-toolbar.d.ts +19 -19
  34. package/dist/components/editor-area/rtc-editor-toolbar.d.ts.map +1 -1
  35. package/dist/components/editor-area/rtc-editor-toolbar.styles.d.ts +3 -3
  36. package/dist/components/file-explorer/rtc-file-explorer.d.ts +28 -28
  37. package/dist/components/file-explorer/rtc-file-explorer.d.ts.map +1 -1
  38. package/dist/components/file-explorer/rtc-file-explorer.styles.d.ts +3 -3
  39. package/dist/components/file-explorer/rtc-file-tree-item.d.ts +19 -19
  40. package/dist/components/file-explorer/rtc-file-tree-item.d.ts.map +1 -1
  41. package/dist/components/file-explorer/rtc-file-tree-item.styles.d.ts +3 -3
  42. package/dist/components/function-console/rtc-function-console.d.ts +32 -0
  43. package/dist/components/function-console/rtc-function-console.d.ts.map +1 -0
  44. package/dist/components/function-console/rtc-function-console.styles.d.ts +8 -0
  45. package/dist/components/function-console/rtc-function-console.styles.d.ts.map +1 -0
  46. package/dist/components/function-debugger/rtc-function-debugger.d.ts +39 -0
  47. package/dist/components/function-debugger/rtc-function-debugger.d.ts.map +1 -0
  48. package/dist/components/function-debugger/rtc-function-debugger.styles.d.ts +8 -0
  49. package/dist/components/function-debugger/rtc-function-debugger.styles.d.ts.map +1 -0
  50. package/dist/components/function-history/rtc-function-history.d.ts +49 -0
  51. package/dist/components/function-history/rtc-function-history.d.ts.map +1 -0
  52. package/dist/components/function-history/rtc-function-history.styles.d.ts +8 -0
  53. package/dist/components/function-history/rtc-function-history.styles.d.ts.map +1 -0
  54. package/dist/components/function-params/rtc-function-params.d.ts +29 -0
  55. package/dist/components/function-params/rtc-function-params.d.ts.map +1 -0
  56. package/dist/components/function-params/rtc-function-params.styles.d.ts +8 -0
  57. package/dist/components/function-params/rtc-function-params.styles.d.ts.map +1 -0
  58. package/dist/components/function-tree/rtc-function-tree.d.ts +59 -0
  59. package/dist/components/function-tree/rtc-function-tree.d.ts.map +1 -0
  60. package/dist/components/function-tree/rtc-function-tree.styles.d.ts +2 -0
  61. package/dist/components/function-tree/rtc-function-tree.styles.d.ts.map +1 -0
  62. package/dist/components/functions-layout/rtc-functions-layout.d.ts +45 -0
  63. package/dist/components/functions-layout/rtc-functions-layout.d.ts.map +1 -0
  64. package/dist/components/functions-layout/rtc-functions-layout.styles.d.ts +8 -0
  65. package/dist/components/functions-layout/rtc-functions-layout.styles.d.ts.map +1 -0
  66. package/dist/components/input-area/rtc-input-area.d.ts +15 -15
  67. package/dist/components/input-area/rtc-input-area.d.ts.map +1 -1
  68. package/dist/components/login/rtc-login-page.d.ts +8 -8
  69. package/dist/components/markdown-editor/rtc-markdown-editor.d.ts +23 -19
  70. package/dist/components/markdown-editor/rtc-markdown-editor.d.ts.map +1 -1
  71. package/dist/components/overlay/rtc-command-panel.d.ts.map +1 -1
  72. package/dist/components/overlay/rtc-export-dialog.d.ts +59 -0
  73. package/dist/components/overlay/rtc-export-dialog.d.ts.map +1 -0
  74. package/dist/components/overlay/rtc-export-dialog.styles.d.ts +11 -0
  75. package/dist/components/overlay/rtc-export-dialog.styles.d.ts.map +1 -0
  76. package/dist/components/overlay/rtc-scenario-panel.d.ts +1 -1
  77. package/dist/components/overlay/rtc-scenario-panel.d.ts.map +1 -1
  78. package/dist/components/overlay/rtc-session-panel.d.ts +1 -1
  79. package/dist/components/overlay/rtc-session-panel.d.ts.map +1 -1
  80. package/dist/components/overlay/rtc-toast.d.ts +8 -8
  81. package/dist/components/rtc-agent/helpers/bus-handler.d.ts +32 -1
  82. package/dist/components/rtc-agent/helpers/bus-handler.d.ts.map +1 -1
  83. package/dist/components/rtc-agent/helpers/command-handler.d.ts +8 -0
  84. package/dist/components/rtc-agent/helpers/command-handler.d.ts.map +1 -1
  85. package/dist/components/rtc-agent/helpers/connection-setup.d.ts +5 -8
  86. package/dist/components/rtc-agent/helpers/connection-setup.d.ts.map +1 -1
  87. package/dist/components/rtc-agent/helpers/dialog-helpers.d.ts +12 -0
  88. package/dist/components/rtc-agent/helpers/dialog-helpers.d.ts.map +1 -1
  89. package/dist/components/rtc-agent/helpers/session-loader.d.ts +2 -0
  90. package/dist/components/rtc-agent/helpers/session-loader.d.ts.map +1 -1
  91. package/dist/components/rtc-agent/helpers/vfs-operations.d.ts +22 -3
  92. package/dist/components/rtc-agent/helpers/vfs-operations.d.ts.map +1 -1
  93. package/dist/components/rtc-agent/rtc-agent.d.ts +22 -47
  94. package/dist/components/rtc-agent/rtc-agent.d.ts.map +1 -1
  95. package/dist/components/session-tree/rtc-session-tab-bar.d.ts +8 -8
  96. package/dist/components/session-tree/rtc-session-tab-bar.d.ts.map +1 -1
  97. package/dist/components/session-tree/rtc-session-tab-bar.styles.d.ts +5 -5
  98. package/dist/components/session-tree/rtc-session-tab.d.ts +6 -6
  99. package/dist/components/session-tree/rtc-session-tab.d.ts.map +1 -1
  100. package/dist/components/session-tree/rtc-session-tab.styles.d.ts +6 -6
  101. package/dist/components/session-tree/rtc-session-tree-item.d.ts +10 -10
  102. package/dist/components/session-tree/rtc-session-tree-item.d.ts.map +1 -1
  103. package/dist/components/session-tree/rtc-session-tree-item.styles.d.ts +6 -6
  104. package/dist/components/session-tree/rtc-session-tree.d.ts +15 -15
  105. package/dist/components/session-tree/rtc-session-tree.d.ts.map +1 -1
  106. package/dist/components/session-tree/rtc-session-tree.styles.d.ts +5 -5
  107. package/dist/components/settings-layout/rtc-settings-layout.d.ts +23 -23
  108. package/dist/components/settings-layout/rtc-settings-layout.d.ts.map +1 -1
  109. package/dist/components/settings-layout/rtc-settings-layout.styles.d.ts +3 -3
  110. package/dist/components/settings-layout/rtc-settings-nav.d.ts +17 -17
  111. package/dist/components/settings-layout/rtc-settings-nav.d.ts.map +1 -1
  112. package/dist/components/settings-layout/rtc-settings-nav.styles.d.ts +2 -2
  113. package/dist/components/status-bar/rtc-status-bar.d.ts +10 -10
  114. package/dist/components/status-bar/rtc-status-bar.d.ts.map +1 -1
  115. package/dist/components/status-bar/rtc-status-bar.styles.d.ts +5 -5
  116. package/dist/components/title-bar/rtc-title-bar.d.ts +4 -4
  117. package/dist/components/title-bar/rtc-title-bar.d.ts.map +1 -1
  118. package/dist/components/token-usage/rtc-token-usage.d.ts +21 -21
  119. package/dist/components/token-usage/rtc-token-usage.d.ts.map +1 -1
  120. package/dist/config/auth.d.ts +12 -6
  121. package/dist/config/auth.d.ts.map +1 -1
  122. package/dist/contexts/activity.d.ts +13 -13
  123. package/dist/contexts/activity.d.ts.map +1 -1
  124. package/dist/contexts/auth.d.ts +5 -4
  125. package/dist/contexts/auth.d.ts.map +1 -1
  126. package/dist/contexts/editor.d.ts +13 -13
  127. package/dist/contexts/editor.d.ts.map +1 -1
  128. package/dist/contexts/file-explorer.d.ts +15 -15
  129. package/dist/contexts/file-explorer.d.ts.map +1 -1
  130. package/dist/contexts/function-debug.d.ts +52 -0
  131. package/dist/contexts/function-debug.d.ts.map +1 -0
  132. package/dist/contexts/functions.d.ts +43 -0
  133. package/dist/contexts/functions.d.ts.map +1 -0
  134. package/dist/contexts/message.d.ts +3 -3
  135. package/dist/contexts/notification.d.ts +4 -4
  136. package/dist/contexts/notification.d.ts.map +1 -1
  137. package/dist/contexts/settings.d.ts +2 -2
  138. package/dist/contexts/skill.d.ts +5 -5
  139. package/dist/contexts/skill.d.ts.map +1 -1
  140. package/dist/contexts/turn-count.d.ts +7 -7
  141. package/dist/controllers/activity.controller.d.ts +11 -11
  142. package/dist/controllers/activity.controller.d.ts.map +1 -1
  143. package/dist/controllers/auth.controller.d.ts +5 -0
  144. package/dist/controllers/auth.controller.d.ts.map +1 -1
  145. package/dist/controllers/editor-area.controller.d.ts +42 -41
  146. package/dist/controllers/editor-area.controller.d.ts.map +1 -1
  147. package/dist/controllers/editor.controller.d.ts +3 -3
  148. package/dist/controllers/event-binding.controller.d.ts +204 -0
  149. package/dist/controllers/event-binding.controller.d.ts.map +1 -0
  150. package/dist/controllers/file-explorer.controller.d.ts +6 -6
  151. package/dist/controllers/function-debug.controller.d.ts +67 -0
  152. package/dist/controllers/function-debug.controller.d.ts.map +1 -0
  153. package/dist/controllers/functions.controller.d.ts +31 -0
  154. package/dist/controllers/functions.controller.d.ts.map +1 -0
  155. package/dist/controllers/message.controller.d.ts +11 -1
  156. package/dist/controllers/message.controller.d.ts.map +1 -1
  157. package/dist/controllers/notification.controller.d.ts +34 -30
  158. package/dist/controllers/notification.controller.d.ts.map +1 -1
  159. package/dist/controllers/persistence.controller.d.ts +31 -14
  160. package/dist/controllers/persistence.controller.d.ts.map +1 -1
  161. package/dist/controllers/session-tab.controller.d.ts +32 -29
  162. package/dist/controllers/session-tab.controller.d.ts.map +1 -1
  163. package/dist/controllers/session-tree.controller.d.ts +10 -10
  164. package/dist/controllers/session-tree.controller.d.ts.map +1 -1
  165. package/dist/controllers/session.controller.d.ts +6 -6
  166. package/dist/controllers/settings.controller.d.ts +1 -1
  167. package/dist/controllers/skill.controller.d.ts +21 -21
  168. package/dist/controllers/skill.controller.d.ts.map +1 -1
  169. package/dist/controllers/status-bar.controller.d.ts +11 -11
  170. package/dist/controllers/toast.controller.d.ts.map +1 -1
  171. package/dist/controllers/tool-call.controller.d.ts +4 -4
  172. package/dist/controllers/window-interaction.controller.d.ts +14 -12
  173. package/dist/controllers/window-interaction.controller.d.ts.map +1 -1
  174. package/dist/controllers/window-state.controller.d.ts +5 -5
  175. package/dist/controllers/window-state.controller.d.ts.map +1 -1
  176. package/dist/core/builtin-system-group.d.ts +26 -19
  177. package/dist/core/builtin-system-group.d.ts.map +1 -1
  178. package/dist/core/event-bus.d.ts +31 -31
  179. package/dist/core/function-registry.d.ts +82 -71
  180. package/dist/core/function-registry.d.ts.map +1 -1
  181. package/dist/core/i18n.d.ts +2 -2
  182. package/dist/core/locale-controller.d.ts +2 -2
  183. package/dist/core/markdown-generator.d.ts +20 -10
  184. package/dist/core/markdown-generator.d.ts.map +1 -1
  185. package/dist/core/ready.d.ts +9 -9
  186. package/dist/core/scenario-loader.d.ts +29 -25
  187. package/dist/core/scenario-loader.d.ts.map +1 -1
  188. package/dist/elements.d.ts +6 -6
  189. package/dist/{en-US-BK61Z8gy.js → en-US-9e1nrE9Q.js} +56 -8
  190. package/dist/factory.d.ts.map +1 -1
  191. package/dist/{highlight-languages-8EK0uwTA.js → highlight-languages-BcRFTMSx.js} +1 -1
  192. package/dist/icons/logo.d.ts +5 -5
  193. package/dist/{index-Bd4j91y1.js → index-CEn11pPK.js} +26829 -22588
  194. package/dist/index.d.ts +17 -15
  195. package/dist/index.d.ts.map +1 -1
  196. package/dist/index.js +39 -36
  197. package/dist/index.umd.js +3303 -1120
  198. package/dist/master-lock.d.ts +27 -27
  199. package/dist/master-lock.d.ts.map +1 -1
  200. package/dist/stats.html +1 -1
  201. package/dist/types/activity-bar-config.d.ts +14 -14
  202. package/dist/types/activity-bar-config.d.ts.map +1 -1
  203. package/dist/types/agent-config.d.ts +18 -18
  204. package/dist/types/agent-config.d.ts.map +1 -1
  205. package/dist/types/events.d.ts +75 -19
  206. package/dist/types/events.d.ts.map +1 -1
  207. package/dist/types/factory.d.ts +13 -5
  208. package/dist/types/factory.d.ts.map +1 -1
  209. package/dist/types/functions-debug.d.ts +48 -0
  210. package/dist/types/functions-debug.d.ts.map +1 -0
  211. package/dist/types/index.d.ts +97 -102
  212. package/dist/types/index.d.ts.map +1 -1
  213. package/dist/types/skill.d.ts +95 -83
  214. package/dist/types/skill.d.ts.map +1 -1
  215. package/dist/types/window-config.d.ts +37 -37
  216. package/dist/types/window-config.d.ts.map +1 -1
  217. package/dist/utils/clipboard.d.ts +6 -6
  218. package/dist/utils/command-parser.d.ts +9 -9
  219. package/dist/utils/command-parser.d.ts.map +1 -1
  220. package/dist/utils/highlight-languages.d.ts +3 -3
  221. package/dist/utils/relative-time.d.ts +7 -7
  222. package/dist/utils/session-exporter.d.ts +65 -0
  223. package/dist/utils/session-exporter.d.ts.map +1 -0
  224. package/dist/utils/skeleton-tracker.d.ts +56 -56
  225. package/dist/utils/skeleton-tracker.d.ts.map +1 -1
  226. package/dist/utils/visibility-manager.d.ts +42 -42
  227. package/dist/utils/visibility-manager.d.ts.map +1 -1
  228. package/dist/validation/index.d.ts +16 -16
  229. package/dist/validation/index.d.ts.map +1 -1
  230. package/dist/validation/openapi-to-zod.d.ts +5 -5
  231. package/dist/validation/zod-to-openapi.d.ts +24 -14
  232. package/dist/validation/zod-to-openapi.d.ts.map +1 -1
  233. package/dist/worker-bridge.d.ts +11 -0
  234. package/dist/worker-bridge.d.ts.map +1 -1
  235. package/package.json +5 -5
@@ -1,85 +1,85 @@
1
1
  /**
2
2
  * Event Bus
3
3
  *
4
- * 简单的事件总线,用于解耦 FunctionRegistry 和 UI
4
+ * Simple event bus for decoupling FunctionRegistry and UI.
5
5
  *
6
- * 使用场景:
7
- * - FunctionRegistry 发出 function:start/success/error/progress 事件
8
- * - UI 层监听事件并显示 toast/confirm/progress
9
- * - 宿主应用(Flutter)监听事件并通过 postMessage 转发
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 类型为 { userId: string }
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 - 事件名到数据类型的映射(MD8)
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: 迭代前对 handlers 做快照(Array.from),避免 handler 内调用 off 导致并发修改
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
- * 发出事件(异步,等待所有 handler 完成)
59
+ * Emit event (async, wait for all handlers to complete)
60
60
  *
61
- * M9: 注意:此方法永远 resolve,handler 中的错误会被 catch 并通过 log.error 输出。
62
- * 如果需要错误传播(handler 错误导致 emitAsync reject),请使用 emitAsyncStrict。
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: 严格版异步事件发出 - handler 错误会导致 Promise reject
66
+ * M9: Strict async event emit - handler errors cause Promise rejection
67
67
  *
68
- * 与 emitAsync 不同,此方法不会吞掉 handler 中的错误。
69
- * 任一 handler 抛出错误,返回的 Promise 将 reject。
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: 清除所有事件的所有处理器(改名为 clearAll 与 clearEvent 对称)
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
- * 全局实例 `defaultEventBus` 只是默认导出,应用可以创建自己的实例。
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
- * 全局默认事件总线实例(MD7:仅作为默认导出,推荐使用 createEventBus() 创建独立实例)
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
- * 管理 Function 注册、解析、链式调用
5
- * 使用 Proxy 实现 rtcAgent.user.register() 语法
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
- * 注册 Function 到当前 Group
18
+ * Register a function to the current group
19
19
  *
20
- * @param funcDef Function 定义,name 为必填(Group 内的函数名称,不含 Group 前缀)
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
- * 获取 Group 内的所有 Function
26
+ * Get all functions within the group
27
27
  */
28
28
  listFunctions(): FunctionDef[];
29
29
  /**
30
- * 通过 Proxy 支持链式调用:rtcAgent.task.list(params)
30
+ * Support chain calls via Proxy: rtcAgent.task.list(params)
31
31
  *
32
- * 白名单方法直接返回,其他属性名视为 Group 内的函数名,
33
- * 返回一个调用 registry.execute('group.funcName', params) 的函数。
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
- * 注册单个 Function
48
+ * Register a single function
49
49
  *
50
- * M10: 注意,文档生成(_updateFunctionDoc)是异步的 fire-and-forget 操作。
51
- * register() 返回后,文档可能尚未写入虚拟文件系统。
52
- * 文档通常会在几百毫秒内就绪,但不保证在 register() 返回时已完成。
53
- * 如果需要确保文档就绪,请手动调用虚拟文件系统的 read 并等待。
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
- * 内部方法:注册 Function(由 FunctionGroup 调用)
57
+ * Internal method: Register a function (called by FunctionGroup)
58
58
  *
59
- * @internal 仅供内部使用,外部应使用 register() 方法
59
+ * @internal For internal use only; external callers should use the register() method
60
60
  *
61
- * M10: 同 register(),文档生成是异步 fire-and-forget,可能延迟就绪。
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
- * 创建 FunctionGroup
65
+ * Normalize a FunctionDef by deriving parameters from zodSchema when parameters is not set.
66
66
  *
67
- * 返回 Proxy 包装的 FunctionGroup,支持链式调用:
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
- * 注销 Function
79
+ * Unregister a function
73
80
  *
74
- * 删除内存中的 Function 定义,同时删除虚拟文件系统中的文档,并更新索引
81
+ * Removes the function definition from memory, deletes the document in the virtual file system, and updates the index.
75
82
  *
76
- * MD9: unregister 是 async 而 register 是 sync 的设计原因:
77
- * - register 只需更新内存 Map(同步操作),文档生成是后台 fire-and-forget
78
- * - unregister 需要删除虚拟文件系统中的文档文件并更新索引,这些是 I/O 操作
79
- * - 调用方通常需要在注销完成后确认文件系统已清理,因此 unregister 返回 Promise
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
- * 解析 Function 路径
90
+ * Resolve a function path
84
91
  */
85
92
  resolve(path: string): FunctionDef | undefined;
86
93
  /**
87
- * 列出所有 Function
94
+ * List all functions
88
95
  */
89
96
  listFunctions(): FunctionDef[];
90
97
  /**
91
- * 列出所有 Group
98
+ * List all groups
92
99
  */
93
100
  listGroups(): FunctionGroupDef[];
94
101
  /**
95
- * 重新生成所有文档(用于数据库初始化后)
102
+ * Regenerate all documents (used after database initialization)
96
103
  *
97
- * 解决时序问题:register() 在数据库初始化前调用时,文档写入会失败。
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
- * 应使用 generateAllDocsContent() + WorkerBridge.batchWriteFiles()
107
+ * Should use generateAllDocsContent() + WorkerBridge.batchWriteFiles()
101
108
  */
102
109
  regenerateAllDocs(): Promise<void>;
103
110
  /**
104
- * 生成所有文档内容(不写入 VirtualFS)
111
+ * Generate all document content (without writing to VirtualFS), and calculate orphan paths to delete
105
112
  *
106
- * 使用方式:主线程生成内容,通过 WorkerBridge.batchWriteFiles() 发送到 Worker 写入。
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 scenario 数量(用于生成 AGENT.md)
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): Array<{
112
- path: string;
113
- content: string;
119
+ generateAllDocsContent(scenarioCount?: number): Promise<{
120
+ files: Array<{
121
+ path: string;
122
+ content: string;
123
+ }>;
124
+ deletePaths: string[];
114
125
  }>;
115
126
  /**
116
- * 执行 Function
127
+ * Execute a function
117
128
  *
118
- * 使用事件驱动架构,不直接调用 UI:
119
- * - 发出 function:start/success/error/progress 事件
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 抛出的 CancelledError 不触发 onError
133
+ * CancelledError handling:
134
+ * - CancelledError thrown by onStart does not trigger onError
124
135
  *
125
- * M11: onSuccess 使用 fire-and-forget,与 eventBus.emit('function:success') 无顺序保证。
126
- * onSuccess 可能在 function:success 事件之前或之后完成。
127
- * 如需严格顺序,请使用事件监听替代 hook。
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
- * 写入 Scenario
142
+ * Write a scenario
132
143
  *
133
- * m8: scenario.id 字段被忽略,文件名始终从 title 生成 slug。
134
- * 原因:虚拟文件系统的文件路径基于 title slug,id 仅用于数据库索引。
135
- * scenario.id 在 scenario-loader 的 manifest 中用于唯一标识,但不影响文件存储路径。
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
- * 写入策略:使用 'create-new' 模式,文件已存在时不覆盖(保护用户编辑的内容)
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
- * 更新 Function 文档
152
+ * Update function documentation
142
153
  */
143
154
  private _updateFunctionDoc;
144
155
  /**
145
- * 更新 Functions 索引
156
+ * Update Functions index
146
157
  *
147
- * 写入策略:使用 'overwrite' 模式(索引文件总是最新状态)
158
+ * Write strategy: uses 'overwrite' mode (index file is always up to date)
148
159
  */
149
160
  private _updateFunctionsIndex;
150
161
  /**
151
- * 更新 Scenarios 索引
162
+ * Update Scenarios index
152
163
  *
153
- * 写入策略:使用 'overwrite' 模式(索引文件总是最新状态)
164
+ * Write strategy: uses 'overwrite' mode (index file is always up to date)
154
165
  */
155
166
  private _updateScenariosIndex;
156
167
  /**
157
- * 更新 AGENT.md
168
+ * Update AGENT.md
158
169
  *
159
- * 写入策略:使用 'create-new' 模式,文件已存在时不覆盖(保护用户编辑的内容)
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
- * 字符串转 slug
174
+ * Convert string to slug
164
175
  *
165
- * 支持 CJK 字符(中文、日文、韩文)
166
- * 如果结果为空,则使用时间戳 + 随机数
176
+ * Supports CJK characters (Chinese, Japanese, Korean)
177
+ * If the result is empty, uses timestamp + random number
167
178
  *
168
- * MD10: slug 截断到 100 字符,避免文件名过长
179
+ * MD10: slug is truncated to 100 characters to avoid overly long filenames
169
180
  */
170
181
  private _slugify;
171
182
  /**
172
- * M12: 通过 Proxy 支持链式调用:rtcAgent.user.register(params)
183
+ * M12: Support chain calls via Proxy: rtcAgent.user.register(params)
173
184
  *
174
- * 使用白名单方式暴露方法,不暴露 functions/groups 等私有属性
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
- * 创建全局 Registry
190
+ * Create global Registry
180
191
  *
181
- * 自动注册内置 system 工具组(delay/uuid/now/random/time),
182
- * 使脚本可以通过 rtcAgent.system.* 访问被沙箱阻断的常用平台 API。
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;AAO3B;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAkC;gBAEvC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB;IAKlE;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,W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SAAC,CAAC,CAAC;QAC9C,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;IAiDF;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAoF9E;;;;;;;;OAQG;IACG,aAAa,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBzD;;OAEG;YACW,kBAAkB;IA8BhC;;;;OAIG;YACW,qBAAqB;IAQnC;;;;OAIG;YACW,qBAAqB;IAcnC;;;;OAIG;YACW,cAAc;IAU5B;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ;IAuBhB;;;;OAIG;IACH,WAAW,IAAI,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;CA6ChE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAIvG"}
@@ -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
- * 组件中应调用此函数而非直接调用 _setLocale
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
- * 封装 locale context 消费逻辑,减少组件样板代码
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>当前: ${this._locale.locale}</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
- * 从 FunctionDef 生成 markdown 文档
5
- * 使用 OpenAPI Schema 格式描述参数和返回值
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
- * 生成单个 Function 的 markdown 文档
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
- * 生成 Functions 索引(按分组组织)
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
- * 生成 Scenarios 索引
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
- * 生成 AGENT.md
40
+ * Generate AGENT.md
31
41
  *
32
- * Agent Prompt 定义 Agent 的身份、工作流和能力。
33
- * 前端生成此内容,Server 端有默认降级实现。
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,EAA+B,MAAM,mBAAmB,CAAC;AAuHpH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAwFnF;AAgDD;;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"}
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"}
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Module Ready Signal
3
3
  *
4
- * 提供两种机制让宿主应用等待 <rtc-agent> 组件初始化完成:
5
- * 1. `whenReady()` Promise — ES module 风格
6
- * 2. `rtc-agent-ready` 自定义事件 — Web Component 风格(由 RtcAgent 组件派发)
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
- * 内部使用:组件在 firstUpdated 时调用 _markReady()。
8
+ * Internal use: component calls _markReady() on firstUpdated.
9
9
  */
10
10
  /**
11
- * 等待 <rtc-agent> 组件模块加载并初始化完成
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
- * 由 RtcAgent 组件在 firstUpdated 时调用。
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
- * 从 URL 加载 Scenario markdown 文件
4
+ * Loads Scenario markdown files from a URL
5
5
  */
6
6
  /**
7
- * 解析 YAML frontmatter
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
- * 支持的字段:title, id, name, description, tags, author, createdAt
18
- * 限制:不支持多行值、复杂 YAML 结构
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
- * 从 URL 加载 Scenarios
31
+ * Load Scenarios from URL
32
32
  *
33
- * @param baseURL Scenario 文件的基础 URL(如 '/scenarios/')
34
- * @param timeoutMs 每个请求的超时时间(毫秒,默认 10000)
35
- * @returns 加载的 Scenario 数量
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
- * 从 URL 加载 Scenarios 内容(不写入 VirtualFS)
39
+ * Load Scenarios content from URL (without writing to VirtualFS), and compute orphan paths to delete
40
40
  *
41
- * 使用方式:主线程获取内容,通过 WorkerBridge.batchWriteFiles() 发送到 Worker 写入。
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 文件的基础 URL
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<Array<{
48
- path: string;
49
- content: string;
50
- metadata: {
51
- name?: string;
52
- description?: string;
53
- tags?: string[];
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,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