@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,194 +1,206 @@
1
1
  /**
2
2
  * Skill System Types
3
3
  *
4
- * 定义 Function、FunctionGroup、VisualHooks 等核心类型
4
+ * Defines core types for Function, FunctionGroup, VisualHooks, etc.
5
5
  */
6
6
  import type { ZodType } from 'zod';
7
7
  /**
8
- * CancelledError - 用户取消操作
8
+ * CancelledError - User cancelled operation
9
9
  *
10
- * 用于区分"用户取消"和"真正的错误"
10
+ * Used to distinguish "user cancellation" from "real errors"
11
11
  *
12
- * M13: 添加 isCancelled brand 属性,解决跨 realm 时 instanceof 不可靠的问题。
13
- * 使用 `CancelledError.isCancelledError(err)` 进行类型守卫判断。
12
+ * M13: Added isCancelled brand property to solve the unreliability of instanceof across realms.
13
+ * Use `CancelledError.isCancelledError(err)` for type guard checks.
14
14
  */
15
15
  export declare class CancelledError extends Error {
16
- /** M13: brand 属性,用于跨 realm 可靠判断 */
16
+ /** M13: brand property for reliable cross-realm type checking */
17
17
  readonly isCancelled = true;
18
18
  constructor(message?: string);
19
19
  /**
20
- * M13: 跨 realm 安全的类型守卫
21
- * 比 instanceof 更可靠(iframe、Worker、不同 bundle 等场景)
20
+ * M13: Cross-realm safe type guard
21
+ * More reliable than instanceof (for iframe, Worker, different bundle scenarios, etc.)
22
22
  */
23
23
  static isCancelledError(error: unknown): error is CancelledError;
24
24
  }
25
25
  /**
26
- * OpenAPI Schema 格式的参数定义
26
+ * Parameter definition in OpenAPI Schema format
27
27
  *
28
- * 使用标准 OpenAPI 3.0 Schema 格式,支持:
29
- * - 基础类型:string, number, integer, boolean
30
- * - 复杂类型:object, array
31
- * - 格式:date, date-time, email, uri, uuid 等
32
- * - 嵌套对象和数组
33
- * - 枚举值
34
- * - 示例值(example)
28
+ * Uses standard OpenAPI 3.0 Schema format, supporting:
29
+ * - Basic types: string, number, integer, boolean
30
+ * - Complex types: object, array
31
+ * - Formats: date, date-time, email, uri, uuid, etc.
32
+ * - Nested objects and arrays
33
+ * - Enum values
34
+ * - Example values (example)
35
35
  */
36
36
  export interface OpenAPISchema {
37
- /** 数据类型 */
38
- type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
39
- /** 数据格式(如 date, date-time, email, uri, uuid, int32, int64, float, double 等) */
37
+ /** Data type */
38
+ type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
39
+ /** Data format (e.g. date, date-time, email, uri, uuid, int32, int64, float, double, etc.) */
40
40
  format?: string;
41
- /** 描述 */
41
+ /** Description */
42
42
  description?: string;
43
- /** 是否必需(在 object 的 properties 中使用) */
44
- required?: boolean;
45
- /** 默认值 */
43
+ /** Whether required (used within object properties) */
44
+ required?: boolean | string[];
45
+ /** Default value */
46
46
  default?: unknown;
47
- /** 示例值 */
47
+ /** Example value */
48
48
  example?: unknown;
49
- /** 枚举值 */
49
+ /** Enum values */
50
50
  enum?: unknown[];
51
- /** 对象属性定义 */
51
+ /** Object property definitions */
52
52
  properties?: Record<string, OpenAPISchema>;
53
- /** 数组项定义 */
53
+ /** Array item definition */
54
54
  items?: OpenAPISchema;
55
- /** 引用其他 schema(如 '#/components/schemas/User') */
55
+ /** Additional properties for record/map types */
56
+ additionalProperties?: OpenAPISchema | boolean;
57
+ /** Reference to another schema (e.g. '#/components/schemas/User') */
56
58
  $ref?: string;
57
- /** 最小值(number/integer) */
59
+ /** Minimum value (number/integer) */
58
60
  minimum?: number;
59
- /** 最大值(number/integer) */
61
+ /** Maximum value (number/integer) */
60
62
  maximum?: number;
61
- /** 最小长度(string) */
63
+ /** Minimum length (string) */
62
64
  minLength?: number;
63
- /** 最大长度(string) */
65
+ /** Maximum length (string) */
64
66
  maxLength?: number;
65
- /** 正则模式(string) */
67
+ /** Regex pattern (string) */
66
68
  pattern?: string;
67
- /** 最小项数(array) */
69
+ /** Minimum item count (array) */
68
70
  minItems?: number;
69
- /** 最大项数(array) */
71
+ /** Maximum item count (array) */
70
72
  maxItems?: number;
71
- /** 是否允许重复项(array) */
73
+ /** Whether duplicate items are allowed (array) */
72
74
  uniqueItems?: boolean;
75
+ /** Whether value can be null (OpenAPI 3.0) */
76
+ nullable?: boolean;
77
+ /** One of these schemas (for unions) */
78
+ oneOf?: OpenAPISchema[];
79
+ /** All of these schemas (for intersections) */
80
+ allOf?: OpenAPISchema[];
81
+ /** Any of these schemas */
82
+ anyOf?: OpenAPISchema[];
73
83
  }
74
84
  /**
75
- * 参数定义(OpenAPI 格式)
85
+ * Parameter definition (OpenAPI format)
76
86
  *
77
- * 使用 OpenAPI Schema 定义参数类型,支持复杂的嵌套结构
87
+ * Uses OpenAPI Schema to define parameter types, supporting complex nested structures.
78
88
  */
79
89
  export interface ParameterDef {
80
- /** 参数名称 */
90
+ /** Parameter name */
81
91
  name: string;
82
- /** OpenAPI Schema 定义 */
92
+ /** OpenAPI Schema definition */
83
93
  schema: OpenAPISchema;
84
- /** 是否必需 */
94
+ /** Whether required */
85
95
  required?: boolean;
86
- /** 参数描述(可选,如果 schema 中没有 description) */
96
+ /** Parameter description (optional, fallback if schema has no description) */
87
97
  description?: string;
88
98
  }
89
99
  /**
90
- * 返回值定义(OpenAPI 格式)
100
+ * Return value definition (OpenAPI format)
91
101
  */
92
102
  export interface ReturnDef {
93
- /** OpenAPI Schema 定义 */
94
- schema: OpenAPISchema;
95
- /** 返回值描述(可选,如果 schema 中没有 description) */
103
+ /** OpenAPI Schema definition */
104
+ schema?: OpenAPISchema;
105
+ /** Zod schema (for runtime validation, takes precedence over schema) */
106
+ zodSchema?: ZodType;
107
+ /** Return value description (optional, fallback if schema has no description) */
96
108
  description?: string;
97
109
  }
98
110
  /**
99
- * Visual Hooks - UI 钩子函数
111
+ * Visual Hooks - UI hook functions
100
112
  */
101
113
  export interface VisualHooks {
102
- /** 执行开始 */
114
+ /** Execution started */
103
115
  onStart?: (params: Record<string, unknown>) => void | Promise<void>;
104
- /** 执行成功 */
116
+ /** Execution succeeded */
105
117
  onSuccess?: (result: unknown) => void | Promise<void>;
106
- /** 执行失败 */
118
+ /** Execution failed */
107
119
  onError?: (error: Error) => void | Promise<void>;
108
- /** 执行进度 */
120
+ /** Execution progress */
109
121
  onProgress?: (progress: number) => void | Promise<void>;
110
122
  }
111
123
  /**
112
- * Function 定义
124
+ * Function definition
113
125
  */
114
126
  export interface FunctionDef {
115
- /** Function 名称(如 'user.register') */
127
+ /** Function name (e.g. 'user.register') */
116
128
  name: string;
117
- /** Function 描述 */
129
+ /** Function description */
118
130
  description: string;
119
- /** 参数列表(OpenAPI 格式,向后兼容) */
131
+ /** Parameter list (OpenAPI format, backward compatible) */
120
132
  parameters?: ParameterDef[];
121
- /** Zod schema(用于运行时校验,优先于 parameters) */
133
+ /** Zod schema (for runtime validation, takes precedence over parameters) */
122
134
  zodSchema?: ZodType;
123
- /** 返回值定义 */
135
+ /** Return value definition */
124
136
  returns?: ReturnDef;
125
137
  /** Visual Hooks */
126
138
  hooks?: VisualHooks;
127
139
  /**
128
- * 执行函数(第二个参数是进度回调,可选)
140
+ * Execution function (second parameter is a progress callback, optional)
129
141
  *
130
- * MD13: 返回值类型为 unknown(不再使用 unknown | Promise<unknown>)。
131
- * 注释说明:handler 可以是同步或异步函数。FunctionRegistry.execute 内部会 await 返回值,
132
- * 因此异步函数返回的 Promise 会被自动解析。同步函数的返回值会被包装为 resolved Promise。
142
+ * MD13: Return type is unknown (no longer uses unknown | Promise<unknown>).
143
+ * Note: handler can be a sync or async function. FunctionRegistry.execute internally awaits the return value,
144
+ * so Promises returned by async functions are automatically resolved. Sync function returns are wrapped in a resolved Promise.
133
145
  */
134
146
  handler: (params: Record<string, unknown>, onProgress?: (progress: number) => void | Promise<void>) => unknown;
135
147
  }
136
148
  /**
137
- * FunctionGroup 定义
149
+ * FunctionGroup definition
138
150
  */
139
151
  export interface FunctionGroupDef {
140
- /** Group 名称(如 'user') */
152
+ /** Group name (e.g. 'user') */
141
153
  name: string;
142
- /** Group 描述 */
154
+ /** Group description */
143
155
  description: string;
144
156
  }
145
157
  /**
146
- * Registry 配置
158
+ * Registry configuration
147
159
  */
148
160
  export interface RegistryConfig {
149
- /** 应用名称 */
161
+ /** Application name */
150
162
  name: string;
151
- /** 应用描述 */
163
+ /** Application description */
152
164
  description: string;
153
- /** AI 人设 */
165
+ /** AI persona */
154
166
  persona?: string;
155
- /** 异步操作错误回调(如文档生成失败) */
167
+ /** Async operation error callback (e.g. document generation failure) */
156
168
  onError?: (error: Error, context: string) => void;
157
169
  }
158
170
  /**
159
- * Scenario 定义
171
+ * Scenario definition
160
172
  */
161
173
  export interface ScenarioDef {
162
- /** Scenario 唯一标识(可选,默认从 title 生成) */
174
+ /** Scenario unique identifier (optional, auto-generated from title by default) */
163
175
  id?: string;
164
- /** Scenario 标题 */
176
+ /** Scenario title */
165
177
  title: string;
166
- /** Scenario 简短描述(用于 INDEX.md) */
178
+ /** Scenario short description (used for INDEX.md) */
167
179
  description?: string;
168
- /** Scenario 内容(Markdown) */
180
+ /** Scenario content (Markdown) */
169
181
  content: string;
170
- /** 标签 */
182
+ /** Tags */
171
183
  tags?: string[];
172
- /** 作者 */
184
+ /** Author */
173
185
  author?: string;
174
- /** 创建时间(ISO 8601) */
186
+ /** Creation time (ISO 8601) */
175
187
  createdAt?: string;
176
188
  }
177
189
  /**
178
190
  * Scenario Manifest
179
191
  *
180
- * m10: 此类型在 scenario-loader.ts 中使用(解析 manifest.json),
181
- * 并通过 types/index.ts 和 package index.ts 导出。
192
+ * m10: This type is used in scenario-loader.ts (for parsing manifest.json),
193
+ * and exported via types/index.ts and the package index.ts.
182
194
  */
183
195
  export interface ScenarioManifest {
184
196
  scenarios: Array<{
185
- /** 文件名 */
197
+ /** Filename */
186
198
  file: string;
187
- /** 唯一标识(可选) */
199
+ /** Unique identifier (optional) */
188
200
  id?: string;
189
- /** 名称(可选) */
201
+ /** Name (optional) */
190
202
  name?: string;
191
- /** 描述(可选) */
203
+ /** Description (optional) */
192
204
  description?: string;
193
205
  }>;
194
206
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/types/skill.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEnC;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,mCAAmC;IACnC,QAAQ,CAAC,WAAW,QAAQ;gBAEhB,OAAO,SAAgC;IAKnD;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc;CAMjE;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxE,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS;IACT,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU;IACV,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU;IACV,OAAO,CAAC,EAAE,OAAO,CAA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AAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ"}
@@ -1,73 +1,73 @@
1
1
  /**
2
2
  * Window Configuration Types
3
3
  *
4
- * 用于 <rtc-agent> 组件的窗口配置 API。
5
- * 控制窗口的默认状态、尺寸、位置、交互限制等。
4
+ * Window configuration API for the <rtc-agent> component.
5
+ * Controls the window's default state, size, position, interaction constraints, etc.
6
6
  */
7
7
  /**
8
- * Bubble 位置配置
8
+ * Bubble position configuration
9
9
  *
10
- * 使用数学笛卡尔坐标系:
11
- * - 原点在宿主应用的某个角(由 corner 决定)
12
- * - x 轴:右正左负
13
- * - y 轴:上正下负(数学坐标系,非屏幕坐标系)
10
+ * Uses a mathematical Cartesian coordinate system:
11
+ * - Origin is at one corner of the host application (determined by `corner`)
12
+ * - x-axis: positive to the right, negative to the left
13
+ * - y-axis: positive upward, negative downward (mathematical, not screen coordinates)
14
14
  *
15
- * 象限分布:
16
- * - top-left: 第四象限 (x>0, y<0)
17
- * - top-right: 第三象限 (x<0, y<0)
18
- * - bottom-left: 第一象限 (x>0, y>0)
19
- * - bottom-right: 第二象限 (x<0, y>0)
15
+ * Quadrant distribution:
16
+ * - top-left: Quadrant IV (x>0, y<0)
17
+ * - top-right: Quadrant III (x<0, y<0)
18
+ * - bottom-left: Quadrant I (x>0, y>0)
19
+ * - bottom-right: Quadrant II (x<0, y>0)
20
20
  */
21
21
  export type BubbleCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
22
22
  export interface BubblePosition {
23
- /** 坐标系原点在宿主应用的哪个角 */
23
+ /** Which corner of the host application is the coordinate origin */
24
24
  corner: BubbleCorner;
25
- /** 相对于原点的偏移(数学笛卡尔坐标) */
25
+ /** Offset relative to the origin (mathematical Cartesian coordinates) */
26
26
  offset: {
27
27
  x: number;
28
28
  y: number;
29
29
  };
30
30
  }
31
31
  /**
32
- * 窗口配置
32
+ * Window configuration
33
33
  *
34
- * 通过 <rtc-agent>.windowConfig 属性设置。
34
+ * Set via the <rtc-agent>.windowConfig property.
35
35
  */
36
36
  export interface WindowConfig {
37
- /** 默认窗口模式 */
37
+ /** Default window mode */
38
38
  defaultMode?: 'normal' | 'maximized' | 'minimized';
39
- /** 初始位置(仅 normal 模式生效) */
39
+ /** Initial position (only effective in normal mode) */
40
40
  initialPosition?: {
41
41
  x: number;
42
42
  y: number;
43
43
  };
44
- /** 初始尺寸(仅 normal 模式生效) */
44
+ /** Initial size (only effective in normal mode) */
45
45
  initialSize?: {
46
46
  width: number;
47
47
  height: number;
48
48
  };
49
- /** 最小宽度 */
49
+ /** Minimum width */
50
50
  minWidth?: number;
51
- /** 最小高度 */
51
+ /** Minimum height */
52
52
  minHeight?: number;
53
- /** 最大宽度(默认视口宽度) */
53
+ /** Maximum width (defaults to viewport width) */
54
54
  maxWidth?: number;
55
- /** 最大高度(默认视口高度) */
55
+ /** Maximum height (defaults to viewport height) */
56
56
  maxHeight?: number;
57
- /** 是否允许拖拽(默认 true) */
57
+ /** Whether dragging is allowed (default: true) */
58
58
  draggable?: boolean;
59
- /** 是否允许调整大小(默认 true) */
59
+ /** Whether resizing is allowed (default: true) */
60
60
  resizable?: boolean;
61
- /** 是否显示最小化按钮(默认 true) */
61
+ /** Whether to show the minimize button (default: true) */
62
62
  showMinimize?: boolean;
63
- /** 是否显示最大化按钮(默认 true) */
63
+ /** Whether to show the maximize button (default: true) */
64
64
  showMaximize?: boolean;
65
- /** 是否显示关闭按钮(默认 false,关闭=最小化) */
65
+ /** Whether to show the close button (default: false; close = minimize) */
66
66
  showClose?: boolean;
67
67
  /**
68
- * 嵌入模式(禁用所有窗口交互)
68
+ * Embedded mode (disables all window interaction)
69
69
  *
70
- * 等同于:
70
+ * Equivalent to:
71
71
  * - draggable: false
72
72
  * - resizable: false
73
73
  * - showMinimize: false
@@ -77,15 +77,15 @@ export interface WindowConfig {
77
77
  */
78
78
  embedded?: boolean;
79
79
  /**
80
- * 最小化 bubble 的位置配置
80
+ * Minimized bubble position configuration
81
81
  *
82
- * 使用数学笛卡尔坐标系,原点在宿主应用的某个角。
83
- * 默认值:{ corner: 'bottom-right', offset: { x: -20, y: 20 } }
82
+ * Uses a mathematical Cartesian coordinate system with the origin at one corner of the host application.
83
+ * Default: { corner: 'bottom-right', offset: { x: -20, y: 20 } }
84
84
  */
85
85
  bubblePosition?: BubblePosition;
86
86
  }
87
87
  /**
88
- * 解析后的窗口配置(所有字段都有默认值)
88
+ * Resolved window configuration (all fields have defaults)
89
89
  */
90
90
  export interface ResolvedWindowConfig {
91
91
  defaultMode: 'normal' | 'maximized' | 'minimized';
@@ -110,13 +110,13 @@ export interface ResolvedWindowConfig {
110
110
  bubblePosition: BubblePosition;
111
111
  }
112
112
  /**
113
- * 默认窗口配置
113
+ * Default window configuration
114
114
  */
115
115
  export declare const DEFAULT_WINDOW_CONFIG: ResolvedWindowConfig;
116
116
  /**
117
- * 解析窗口配置(合并默认值)
117
+ * Resolve window configuration (merge with defaults)
118
118
  *
119
- * embedded: true 会覆盖交互相关配置
119
+ * embedded: true overrides interaction-related settings.
120
120
  */
121
121
  export declare function resolveWindowConfig(config?: WindowConfig): ResolvedWindowConfig;
122
122
  //# sourceMappingURL=window-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"window-config.d.ts","sourceRoot":"","sources":["../../src/types/window-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAErF,MAAM,WAAW,cAAc;IAC3B,qBAAqB;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,wBAAwB;IACxB,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAGzB,aAAa;IACb,WAAW,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;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
3
  *
4
- * 提供跨浏览器兼容的剪贴板复制功能。
5
- * 优先使用 navigator.clipboard API,降级到 execCommand。
4
+ * Provides cross-browser compatible clipboard copy functionality.
5
+ * Prefers navigator.clipboard API, falls back to execCommand.
6
6
  */
7
7
  /**
8
- * 复制文本到剪贴板
8
+ * Copy text to clipboard
9
9
  *
10
- * @param text 要复制的文本
11
- * @returns 是否成功
10
+ * @param text Text to copy
11
+ * @returns Whether the copy was successful
12
12
  */
13
13
  export declare function copyToClipboard(text: string): Promise<boolean>;
14
14
  //# sourceMappingURL=clipboard.d.ts.map
@@ -13,21 +13,21 @@
13
13
  * "/ " → { isCommand: false }
14
14
  */
15
15
  export interface ParsedCommand {
16
- /** 是否为命令输入 */
16
+ /** Whether the input is a command */
17
17
  isCommand: boolean;
18
- /** 命令名称(不含 '/' 前缀) */
18
+ /** Command name (without the '/' prefix) */
19
19
  name?: string;
20
- /** 命令参数(命令名后的剩余内容,已 trim) */
20
+ /** Command arguments (remaining content after command name, trimmed) */
21
21
  args?: string;
22
22
  }
23
23
  /**
24
- * 解析用户输入,判断是否为 slash 命令
24
+ * Parse user input to determine if it's a slash command
25
25
  *
26
- * 解析规则:
27
- * 1. 输入必须以 '/' 开头
28
- * 2. '/' 后必须有至少一个非空白字符作为命令名
29
- * 3. 命令名由连续的非空白字符组成(到第一个空格为止)
30
- * 4. 命令名后的内容作为参数(trim 后传入)
26
+ * Parsing rules:
27
+ * 1. Input must start with '/'
28
+ * 2. There must be at least one non-whitespace character after '/' as the command name
29
+ * 3. The command name consists of consecutive non-whitespace characters (up to the first space)
30
+ * 4. Content after the command name is treated as arguments (passed after trimming)
31
31
  */
32
32
  export declare function parseCommand(input: string): ParsedCommand;
33
33
  //# sourceMappingURL=command-parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-parser.d.ts","sourceRoot":"","sources":["../../src/utils/command-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,aAAa;IAC1B,cAAc;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAwCzD"}
1
+ {"version":3,"file":"command-parser.d.ts","sourceRoot":"","sources":["../../src/utils/command-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,aAAa;IAC1B,qCAAqC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAwCzD"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Highlight.js 按需加载配置
2
+ * Highlight.js on-demand loading configuration
3
3
  *
4
- * 只注册常用语言,大幅减小包体积(从 9.2MB 降至 ~1MB)。
5
- * 覆盖 RTC Agent 常见的代码场景:TypeScript/JavaScript/Python/Go/JSON/YAML/Bash 等。
4
+ * Only registers commonly used languages, significantly reducing bundle size (from 9.2MB to ~1MB).
5
+ * Covers common RTC Agent code scenarios: TypeScript/JavaScript/Python/Go/JSON/YAML/Bash, etc.
6
6
  */
7
7
  import hljs from 'highlight.js/lib/core';
8
8
  export default hljs;
@@ -1,14 +1,14 @@
1
1
  /**
2
- * 相对时间格式化工具
2
+ * Relative time formatting utilities
3
3
  *
4
- * 使用原生 Intl.RelativeTimeFormat,无需第三方库。
5
- * 支持中英文,自动选择最佳单位(秒/分钟/小时/天/周/月/年)。
4
+ * Uses native Intl.RelativeTimeFormat, no third-party library needed.
5
+ * Supports Chinese and English, automatically selects the best unit (seconds/minutes/hours/days/weeks/months/years).
6
6
  */
7
7
  /**
8
- * 格式化时间戳为相对时间
9
- * @param timestamp 毫秒时间戳
10
- * @param locale 语言环境,默认中文
11
- * @returns 相对时间字符串,如 "3分钟前"、"2小时前"、"5天前"
8
+ * Format a timestamp as relative time
9
+ * @param timestamp Millisecond timestamp
10
+ * @param locale Locale, defaults to Chinese
11
+ * @returns Relative time string, e.g. "3 minutes ago", "2 hours ago", "5 days ago"
12
12
  */
13
13
  export declare function formatRelativeTime(timestamp: number, locale?: 'zh-CN' | 'en-US'): string;
14
14
  //# sourceMappingURL=relative-time.d.ts.map
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Session Export to HTML
3
+ *
4
+ * Exports current session conversation to a static HTML file for offline
5
+ * reading, archiving, and sharing. Pure frontend implementation.
6
+ */
7
+ import type { Session, Message } from '../types/index.js';
8
+ /**
9
+ * Generate a safe filename from session title and creation date.
10
+ *
11
+ * Format: `rtc-{sanitized-title}-{YYYY-MM-DD}.html`
12
+ * - Replaces illegal filename characters with hyphens
13
+ * - Replaces spaces with hyphens
14
+ * - Truncates title to 50 characters
15
+ */
16
+ export declare function generateFilename(session: Session): string;
17
+ /**
18
+ * Determine if a message should be expanded (shown inline) or collapsed.
19
+ *
20
+ * Expanded: user messages, assistant markdown messages
21
+ * Collapsed: tool calls, thinking, errors, prompts, summaries
22
+ */
23
+ export declare function shouldExpand(message: Message): boolean;
24
+ /**
25
+ * Render message content to sanitized HTML.
26
+ *
27
+ * - user_message: extract text, render as Markdown → sanitize
28
+ * - markdown: render as Markdown → sanitize
29
+ * - text: escape HTML, render as plain text
30
+ * - toolcall_input/toolcall_output: parse tool data, render as formatted JSON
31
+ * - other types: render as JSON or escaped text in <pre><code>
32
+ *
33
+ * Markdown rendering uses the same pipeline as rtc-message.ts:
34
+ * marked.parse() → highlight.js → DOMPurify.sanitize()
35
+ *
36
+ * Tool call data may be an object or a JSON string (double-serialized).
37
+ * Field name is `tool_name` (not `name`). See rtc-toolcall-card.ts:53-91.
38
+ */
39
+ export declare function renderMessageContent(message: Message): Promise<string>;
40
+ /**
41
+ * Generate preview text for collapsed messages.
42
+ *
43
+ * Provides a short, meaningful label for each content type.
44
+ * Tool call field name is `tool_name` (see rtc-toolcall-card.ts:53-91).
45
+ * Uses shared parseContentData() for uniform JSON string/object handling.
46
+ */
47
+ export declare function getPreviewText(message: Message): string;
48
+ /**
49
+ * Generate complete HTML document for session export.
50
+ *
51
+ * Async because renderMessageContent requires lazy-loaded marked/DOMPurify.
52
+ */
53
+ export declare function generateSessionHTML(session: Session, messages: Message[]): Promise<string>;
54
+ /**
55
+ * Trigger browser download of HTML content.
56
+ */
57
+ export declare function triggerDownload(html: string, filename: string): void;
58
+ /**
59
+ * Export session to HTML file.
60
+ *
61
+ * Main entry point: generates HTML and triggers download.
62
+ * Async because generateSessionHTML requires lazy-loaded marked/DOMPurify.
63
+ */
64
+ export declare function exportSession(session: Session, messages: Message[]): Promise<void>;
65
+ //# sourceMappingURL=session-exporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-exporter.d.ts","sourceRoot":"","sources":["../../src/utils/session-exporter.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CASzD;AA6ED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAKtD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA0D5E;AAsCD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CA4BvD;AAkCD;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAoXhG;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAQpE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxF"}