@aparte/core 0.7.0 → 0.8.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.
Files changed (171) hide show
  1. package/README.md +20 -6
  2. package/dist/client/aparte-client.d.ts +113 -47
  3. package/dist/client/aparte-client.d.ts.map +1 -1
  4. package/dist/client/lifecycle-events.d.ts +55 -0
  5. package/dist/client/lifecycle-events.d.ts.map +1 -0
  6. package/dist/client/stream-adapter.d.ts +11 -5
  7. package/dist/client/stream-adapter.d.ts.map +1 -1
  8. package/dist/client/xml-artifact-feed.d.ts +76 -0
  9. package/dist/client/xml-artifact-feed.d.ts.map +1 -0
  10. package/dist/components/bubble/aparte-chat-bubble.d.ts +35 -8
  11. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
  12. package/dist/components/chat/aparte-chat.d.ts +0 -6
  13. package/dist/components/chat/aparte-chat.d.ts.map +1 -1
  14. package/dist/components/composer/aparte-composer-action.d.ts +18 -3
  15. package/dist/components/composer/aparte-composer-action.d.ts.map +1 -1
  16. package/dist/components/composer/aparte-composer-add-attachment.d.ts.map +1 -1
  17. package/dist/components/composer/aparte-composer-attachments.d.ts +1 -1
  18. package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -1
  19. package/dist/components/composer/aparte-composer-cancel.d.ts.map +1 -1
  20. package/dist/components/composer/aparte-composer-input.d.ts +0 -2
  21. package/dist/components/composer/aparte-composer-input.d.ts.map +1 -1
  22. package/dist/components/composer/aparte-composer-send.d.ts +5 -0
  23. package/dist/components/composer/aparte-composer-send.d.ts.map +1 -1
  24. package/dist/components/composer/aparte-composer-toolbar.d.ts +4 -0
  25. package/dist/components/composer/aparte-composer-toolbar.d.ts.map +1 -1
  26. package/dist/components/composer/aparte-composer.d.ts +64 -6
  27. package/dist/components/composer/aparte-composer.d.ts.map +1 -1
  28. package/dist/components/composer/index.d.ts +1 -1
  29. package/dist/components/composer/index.d.ts.map +1 -1
  30. package/dist/components/conversation-list/aparte-conversation-list.d.ts +2 -5
  31. package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
  32. package/dist/components/conversation-list/index.d.ts +1 -1
  33. package/dist/components/conversation-list/index.d.ts.map +1 -1
  34. package/dist/components/elicitation/aparte-elicitation.d.ts +63 -3
  35. package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
  36. package/dist/components/index.d.ts +2 -2
  37. package/dist/components/index.d.ts.map +1 -1
  38. package/dist/components/status/aparte-chat-status.d.ts +8 -6
  39. package/dist/components/status/aparte-chat-status.d.ts.map +1 -1
  40. package/dist/components/viewport/aparte-chat-viewport.d.ts +35 -9
  41. package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
  42. package/dist/config/action-provider.d.ts +4 -4
  43. package/dist/config/aparte-config.d.ts +124 -41
  44. package/dist/config/aparte-config.d.ts.map +1 -1
  45. package/dist/config/attachment-renderer.d.ts +1 -1
  46. package/dist/config/avatar-provider.d.ts +1 -1
  47. package/dist/config/config-context.d.ts +66 -11
  48. package/dist/config/config-context.d.ts.map +1 -1
  49. package/dist/config/elicitation-field-renderer.d.ts +73 -0
  50. package/dist/config/elicitation-field-renderer.d.ts.map +1 -0
  51. package/dist/config/error-renderer.d.ts +1 -1
  52. package/dist/config/icon-provider.d.ts +2 -2
  53. package/dist/config/icon-provider.d.ts.map +1 -1
  54. package/dist/config/index.d.ts +7 -5
  55. package/dist/config/index.d.ts.map +1 -1
  56. package/dist/config/locale.d.ts +43 -2
  57. package/dist/config/locale.d.ts.map +1 -1
  58. package/dist/config/sanitize.d.ts +1 -7
  59. package/dist/config/sanitize.d.ts.map +1 -1
  60. package/dist/config/sibling-nav-renderer.d.ts +1 -1
  61. package/dist/config/skeleton-provider.d.ts +2 -2
  62. package/dist/config/skeleton-provider.d.ts.map +1 -1
  63. package/dist/config/status-renderer.d.ts +1 -1
  64. package/dist/conversations/conversation-controller.d.ts +19 -5
  65. package/dist/conversations/conversation-controller.d.ts.map +1 -1
  66. package/dist/conversations/conversation-manager.d.ts +2 -2
  67. package/dist/conversations/conversation-manager.d.ts.map +1 -1
  68. package/dist/conversations/index.d.ts +1 -1
  69. package/dist/conversations/index.d.ts.map +1 -1
  70. package/dist/conversations/types.d.ts +1 -1
  71. package/dist/custom-elements.json +7962 -6175
  72. package/dist/elicitation/index.d.ts +1 -1
  73. package/dist/elicitation/panel.d.ts +32 -0
  74. package/dist/elicitation/panel.d.ts.map +1 -1
  75. package/dist/elicitation/types.d.ts +29 -2
  76. package/dist/elicitation/types.d.ts.map +1 -1
  77. package/dist/host/aparte-chat-host.d.ts +3 -3
  78. package/dist/host/aparte-chat-host.d.ts.map +1 -1
  79. package/dist/{index-Dn7TH14G.js → index-BieFbKeW.js} +1795 -1238
  80. package/dist/index-BieFbKeW.js.map +1 -0
  81. package/dist/index.css +311 -21
  82. package/dist/index.d.ts +21 -13
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +447 -200
  85. package/dist/index.js.map +1 -1
  86. package/dist/index.node.d.ts +22 -13
  87. package/dist/index.node.d.ts.map +1 -1
  88. package/dist/index.node.js +54 -46
  89. package/dist/index.node.js.map +1 -1
  90. package/dist/interop/element-props.d.ts +1 -1
  91. package/dist/interop/element-props.d.ts.map +1 -1
  92. package/dist/parsers/aparte-stream-parser.d.ts.map +1 -1
  93. package/dist/primitives/index.d.ts +1 -1
  94. package/dist/primitives/index.d.ts.map +1 -1
  95. package/dist/primitives/select/aparte-optgroup.d.ts +15 -4
  96. package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
  97. package/dist/primitives/select/aparte-option.d.ts +0 -5
  98. package/dist/primitives/select/aparte-option.d.ts.map +1 -1
  99. package/dist/primitives/select/aparte-select.d.ts +17 -5
  100. package/dist/primitives/select/aparte-select.d.ts.map +1 -1
  101. package/dist/primitives/select/index.d.ts +1 -1
  102. package/dist/primitives/select/index.d.ts.map +1 -1
  103. package/dist/renderers/markdown-stream.d.ts +42 -0
  104. package/dist/renderers/markdown-stream.d.ts.map +1 -0
  105. package/dist/renderers/segment-renderers.d.ts +20 -14
  106. package/dist/renderers/segment-renderers.d.ts.map +1 -1
  107. package/dist/renderers/segments/artifact/binary-file.d.ts +45 -0
  108. package/dist/renderers/segments/artifact/binary-file.d.ts.map +1 -0
  109. package/dist/renderers/segments/artifact/card.d.ts +3 -0
  110. package/dist/renderers/segments/artifact/card.d.ts.map +1 -0
  111. package/dist/renderers/segments/artifact/preview-document.d.ts +27 -0
  112. package/dist/renderers/segments/artifact/preview-document.d.ts.map +1 -0
  113. package/dist/renderers/segments/artifact/shared.d.ts +12 -0
  114. package/dist/renderers/segments/artifact/shared.d.ts.map +1 -0
  115. package/dist/renderers/segments/code.d.ts +3 -0
  116. package/dist/renderers/segments/code.d.ts.map +1 -0
  117. package/dist/renderers/segments/error.d.ts +3 -0
  118. package/dist/renderers/segments/error.d.ts.map +1 -0
  119. package/dist/renderers/segments/file-tree.d.ts +3 -0
  120. package/dist/renderers/segments/file-tree.d.ts.map +1 -0
  121. package/dist/renderers/segments/pipeline-waiting.d.ts +3 -0
  122. package/dist/renderers/segments/pipeline-waiting.d.ts.map +1 -0
  123. package/dist/renderers/segments/progress.d.ts +3 -0
  124. package/dist/renderers/segments/progress.d.ts.map +1 -0
  125. package/dist/renderers/segments/terminal.d.ts +3 -0
  126. package/dist/renderers/segments/terminal.d.ts.map +1 -0
  127. package/dist/renderers/segments/text.d.ts +10 -0
  128. package/dist/renderers/segments/text.d.ts.map +1 -0
  129. package/dist/renderers/segments/thinking.d.ts +3 -0
  130. package/dist/renderers/segments/thinking.d.ts.map +1 -0
  131. package/dist/renderers/segments/tool-call.d.ts +3 -0
  132. package/dist/renderers/segments/tool-call.d.ts.map +1 -0
  133. package/dist/runtime/message-repository.d.ts +3 -3
  134. package/dist/runtime/message-repository.d.ts.map +1 -1
  135. package/dist/transport/backend-handler.d.ts +19 -7
  136. package/dist/transport/backend-handler.d.ts.map +1 -1
  137. package/dist/transport/backend-transport.d.ts +1 -1
  138. package/dist/transport/backend-transport.d.ts.map +1 -1
  139. package/dist/transport/direct-transport.d.ts +4 -4
  140. package/dist/transport/direct-transport.d.ts.map +1 -1
  141. package/dist/transport/index.d.ts +2 -2
  142. package/dist/transport/index.d.ts.map +1 -1
  143. package/dist/transport/types.d.ts +3 -3
  144. package/dist/types/element-map.d.ts +69 -0
  145. package/dist/types/element-map.d.ts.map +1 -0
  146. package/dist/types/event-map.d.ts +84 -23
  147. package/dist/types/event-map.d.ts.map +1 -1
  148. package/dist/types/events.d.ts +206 -64
  149. package/dist/types/events.d.ts.map +1 -1
  150. package/dist/types/index.d.ts +4 -5
  151. package/dist/types/index.d.ts.map +1 -1
  152. package/dist/types/model-provider.d.ts +100 -54
  153. package/dist/types/model-provider.d.ts.map +1 -1
  154. package/dist/types/models.d.ts +29 -7
  155. package/dist/types/models.d.ts.map +1 -1
  156. package/dist/types/segments.d.ts +1 -8
  157. package/dist/types/segments.d.ts.map +1 -1
  158. package/dist/types/theming.d.ts +25 -37
  159. package/dist/types/theming.d.ts.map +1 -1
  160. package/dist/types/tools.d.ts +60 -15
  161. package/dist/types/tools.d.ts.map +1 -1
  162. package/dist/utils/escape.d.ts +46 -0
  163. package/dist/utils/escape.d.ts.map +1 -0
  164. package/dist/utils/files-to-attachments.d.ts +18 -1
  165. package/dist/utils/files-to-attachments.d.ts.map +1 -1
  166. package/dist/utils/uuid.d.ts +26 -0
  167. package/dist/utils/uuid.d.ts.map +1 -0
  168. package/package.json +3 -5
  169. package/dist/index-Dn7TH14G.js.map +0 -1
  170. package/dist/types/providers.d.ts +0 -93
  171. package/dist/types/providers.d.ts.map +0 -1
@@ -2,8 +2,9 @@
2
2
  * Aparte Events
3
3
  * Event interfaces for component communication and control
4
4
  */
5
- import type { AparteStatus, AparteMessage } from './models.js';
5
+ import type { AparteMessage } from './models.js';
6
6
  import type { AparteUsage } from './chat.js';
7
+ import type { AparteError } from './errors.js';
7
8
  /**
8
9
  * Detail payload for aparte-send custom event
9
10
  * Emitted when user sends a message via the input component
@@ -23,71 +24,38 @@ export interface AparteSendEventDetail {
23
24
  files?: File[];
24
25
  }
25
26
  /**
26
- * Detail payload for aparte-token custom event
27
- * Emitted during streaming when a new token is appended
28
- */
29
- export interface AparteTokenEventDetail {
30
- /** Message ID receiving the token */
31
- messageId: string;
32
- /** Token chunk content */
33
- chunk: string;
34
- }
35
- /**
36
- * Control event for external packages to pilot the Core
37
- * Allows packages like API adapters or plugins to update message states
38
- * without direct coupling to the core implementation
27
+ * Detail payload for `aparte-message-done`.
28
+ * Dispatched when a turn finishes normally. Carries token usage when the provider
29
+ * reports it.
30
+ *
31
+ * @event aparte-message-done
39
32
  */
40
- export interface AparteControlEvent {
41
- /** Target message ID for the control action */
42
- messageId: string;
43
- /** New status to apply to the message */
44
- status: AparteStatus;
33
+ export interface AparteMessageDoneEventDetail {
45
34
  /**
46
- * Optional metadata for arbitrary context
47
- * Examples: response time, tokens/sec, error details
35
+ * Id of the `<aparte-chat>` host that produced this turn, when it has one.
36
+ *
37
+ * Stamped by the client's lifecycle dispatcher on EVERY lifecycle event so
38
+ * several chats on one page stay isolated — a composer reacts only to its own
39
+ * host's turn. It was undeclared here while being sent at runtime, and the
40
+ * dispatcher takes `Record<string, unknown>`, so the compiler could not notice.
48
41
  */
49
- metadata?: Record<string, unknown>;
50
- }
51
- /**
52
- * Event detail for message lifecycle changes
53
- * Emitted when a message is added, updated, or removed
54
- */
55
- export interface AparteMessageEventDetail {
56
- /** The message that changed */
42
+ targetId?: string;
57
43
  messageId: string;
58
- /** Type of lifecycle event */
59
- type: 'added' | 'updated' | 'removed' | 'completed';
60
- /** Optional additional context */
61
- metadata?: Record<string, unknown>;
62
- }
63
- /**
64
- * Event detail for status changes
65
- * Emitted when the global or message status changes
66
- */
67
- export interface AparteStatusEventDetail {
68
- /** Previous status */
69
- previousStatus: AparteStatus;
70
- /** New status */
71
- currentStatus: AparteStatus;
72
- /** Optional message ID if status is message-specific */
73
- messageId?: string;
44
+ role: string;
45
+ /** Token usage for the completed response, if reported by the provider. */
46
+ usage?: AparteUsage;
74
47
  }
75
48
  /**
76
- * Event detail for model selection changes
77
- * Emitted when user selects a different provider or model
49
+ * Detail payload for `aparte-model-change`.
50
+ * Dispatched by `@aparte/plugin-model-selector` when the user picks a different
51
+ * provider or model — the clearest cross-package contract in the set.
52
+ *
53
+ * Its `@event` tag used to sit above `AparteMessageDoneEventDetail`'s doc block
54
+ * instead, so this interface had no documentation of its own and the other one
55
+ * claimed to describe a different event.
78
56
  *
79
57
  * @event aparte-model-change
80
58
  */
81
- /**
82
- * Emitted when a message response completes (aparte-message-done).
83
- * Carries token usage when the provider reports it.
84
- */
85
- export interface AparteMessageDoneEventDetail {
86
- messageId: string;
87
- role: string;
88
- /** Token usage for the completed response, if reported by the provider. */
89
- usage?: AparteUsage;
90
- }
91
59
  export interface AparteModelChangeEventDetail {
92
60
  /** Selected provider ID (e.g., 'openrouter', 'gemini') */
93
61
  providerId?: string;
@@ -206,14 +174,19 @@ export interface AparteArtifactReadyEventDetail {
206
174
  content: string;
207
175
  }
208
176
  /**
209
- * Detail payload for `aparte-artifact-open`.
210
- * Dispatched by the artifact pill when a user clicks it (e.g. on a persisted
211
- * conversation reload). Apps use this to re-open the preview panel for an
212
- * already-completed artifact.
177
+ * Detail payload for `aparte-artifact-redownload`.
178
+ * Dispatched by an artifact card's Download button when the artifact is a BINARY
179
+ * kind: core cannot produce the bytes itself, so it asks the host to re-run the
180
+ * generation and save the file. Enable it with
181
+ * `setHostHandlers({ artifactRedownload: true })` — ratified decision #8, tier (b).
182
+ *
183
+ * It was declared for `aparte-artifact-open` and said so, an event that exists
184
+ * nowhere in the repo. The shape is field-for-field what the Download button really
185
+ * dispatches, so the type moved rather than being deleted.
213
186
  *
214
- * @event aparte-artifact-open
187
+ * @event aparte-artifact-redownload
215
188
  */
216
- export interface AparteArtifactOpenEventDetail {
189
+ export interface AparteArtifactRedownloadEventDetail {
217
190
  /** Owning segment id */
218
191
  segmentId: string;
219
192
  /** MIME type */
@@ -255,7 +228,7 @@ export interface AparteFeedbackEventDetail {
255
228
  }
256
229
  /**
257
230
  * Detail payload for `aparte-action`.
258
- * Dispatched by a custom action button (registered via `AparteConfig.registerAction`)
231
+ * Dispatched by a custom action button (registered via `aparteGlobalConfig.registerAction`)
259
232
  * in either the composer or a message-bubble toolbar. Apps listen (bubbling) and
260
233
  * dispatch on `actionId`. Mirrors the built-in bubble events (retry/feedback) so
261
234
  * custom actions are wired the same way in every framework and in vanilla.
@@ -287,4 +260,173 @@ export interface AparteMessageInfoEventDetail {
287
260
  /** Token usage + timing for the message, when available. */
288
261
  usage?: AparteUsage;
289
262
  }
263
+ /**
264
+ * Detail payload for `aparte-message-start`.
265
+ * Dispatched when a turn begins, before the first token. The composer and the
266
+ * conversation controller both use it to enter their streaming state.
267
+ *
268
+ * @event aparte-message-start
269
+ */
270
+ export interface AparteMessageStartEventDetail {
271
+ /** Host element id, when the `<aparte-chat>` has one. */
272
+ targetId?: string;
273
+ /** Id of the assistant message about to stream. */
274
+ messageId: string;
275
+ /** Role of the message being created — `'assistant'` in every current path. */
276
+ role: string;
277
+ }
278
+ /**
279
+ * Detail payload for `aparte-message-error`.
280
+ * Dispatched when a turn fails. Four core components listen for it, and it is the
281
+ * event `guides/troubleshooting.md` tells you to bind to surface a failure.
282
+ *
283
+ * @event aparte-message-error
284
+ */
285
+ export interface AparteMessageErrorEventDetail {
286
+ /** Host element id, when the `<aparte-chat>` has one. */
287
+ targetId?: string;
288
+ /** Id of the message that failed. */
289
+ messageId: string;
290
+ /** The failure, with its `code` — not a string, unlike `aparte-compact-error`. */
291
+ error: AparteError;
292
+ }
293
+ /**
294
+ * Detail payload for `aparte-message-aborted`.
295
+ * Dispatched when the user stops a turn.
296
+ *
297
+ * @event aparte-message-aborted
298
+ */
299
+ export interface AparteMessageAbortedEventDetail {
300
+ /** Host element id, when the `<aparte-chat>` has one. */
301
+ targetId?: string;
302
+ /**
303
+ * Id of the aborted message — OPTIONAL, and that is not laziness: the composer
304
+ * dispatches this event on its own with only a `targetId`, because a user can
305
+ * press Stop during the pre-flight window before any message id exists.
306
+ */
307
+ messageId?: string;
308
+ }
309
+ /**
310
+ * Detail payload for `aparte-abort` — a COMMAND, not a notification.
311
+ *
312
+ * `AparteClient` listens for it on `window`; a bring-your-own-composer consumer
313
+ * dispatches it to stop a stream. Nothing in core dispatches it on the consumer's
314
+ * behalf, which is exactly why its shape had to be documented somewhere.
315
+ *
316
+ * @event aparte-abort
317
+ */
318
+ export interface AparteAbortEventDetail {
319
+ /** Which chat to stop. Omit on a single-chat page. */
320
+ targetId?: string;
321
+ }
322
+ /**
323
+ * Detail payload for `aparte-compact` — a COMMAND the consumer dispatches on
324
+ * `window` to ask the client to summarise the conversation so far.
325
+ *
326
+ * Core listens and never dispatches it, so this type describes what YOU produce.
327
+ *
328
+ * @event aparte-compact
329
+ */
330
+ export interface AparteCompactEventDetail {
331
+ /** Which chat to compact. Omit on a single-chat page. */
332
+ targetId?: string;
333
+ }
334
+ /**
335
+ * Detail payload for `aparte-compact-done`.
336
+ *
337
+ * A union flattened to optional fields, because the two outcomes carry different
338
+ * payloads and a consumer cannot guess which: nothing to compact sends
339
+ * `{ skipped: true }`, a real compaction sends `{ summary, kept }`.
340
+ *
341
+ * @event aparte-compact-done
342
+ */
343
+ export interface AparteCompactDoneEventDetail {
344
+ /** `true` when there was nothing worth summarising; the other two are absent. */
345
+ skipped?: boolean;
346
+ /** The summary that replaced the compacted turns. */
347
+ summary?: string;
348
+ /** How many messages were kept verbatim after the summary. */
349
+ kept?: number;
350
+ }
351
+ /**
352
+ * Detail payload for `aparte-compact-error`.
353
+ *
354
+ * Note the asymmetry with `aparte-message-error`, which is deliberate rather than
355
+ * hidden: `error` here is a plain string, not an `AparteError`.
356
+ *
357
+ * @event aparte-compact-error
358
+ */
359
+ export interface AparteCompactErrorEventDetail {
360
+ /** Human-readable failure reason. */
361
+ error: string;
362
+ }
363
+ /**
364
+ * Detail payload for `aparte-attachment-preview`.
365
+ * Dispatched when a user clicks an image tile, once
366
+ * `setHostHandlers({ attachmentPreview: true })` has declared that you will open
367
+ * a lightbox. Without the handler the tile is not interactive at all.
368
+ *
369
+ * @event aparte-attachment-preview
370
+ */
371
+ export interface AparteAttachmentPreviewEventDetail {
372
+ /** Object URL or remote URL of the image. */
373
+ url: string;
374
+ /** File name, or `''` when the attachment carries none. */
375
+ name: string;
376
+ }
377
+ /**
378
+ * Detail payload for `aparte-terminal-run`.
379
+ * Dispatched by a terminal segment's Run button, once
380
+ * `setHostHandlers({ terminalRun: true })` has declared that you will execute it.
381
+ *
382
+ * @event aparte-terminal-run
383
+ */
384
+ export interface AparteTerminalRunEventDetail {
385
+ /**
386
+ * Owning segment id — nullable because it is read from a DOM attribute that a
387
+ * custom renderer may not have set.
388
+ */
389
+ segmentId: string | null;
390
+ /** The command text the user asked to run. */
391
+ command: string;
392
+ }
393
+ /**
394
+ * Detail payload for `aparte-file-gen-ready` — dispatched by YOU, not by core.
395
+ *
396
+ * A binary artifact (pdf, xlsx, docx…) is generated by running the model's code in
397
+ * a sandbox, which core deliberately does not do. Core renders a "Running sandbox…"
398
+ * card, listens on `window`, and swaps in the preview when this arrives. Nothing in
399
+ * the repo dispatches it: the contract is entirely yours to fulfil, which is why
400
+ * this type is the one most worth having.
401
+ *
402
+ * @event aparte-file-gen-ready
403
+ */
404
+ export interface AparteFileGenReadyEventDetail {
405
+ /** Must match the artifact segment's id, or the event is ignored. */
406
+ segmentId: string;
407
+ /** File name to show and to download as. */
408
+ filename: string;
409
+ /** Size in bytes, for the card's label. */
410
+ bytes: number;
411
+ /** MIME type of the produced file. */
412
+ mime: string;
413
+ /** The file itself. */
414
+ buffer: Uint8Array | ArrayBuffer;
415
+ /** Optional HTML preview to show inside the card; `null` for none. */
416
+ previewHtml: string | null;
417
+ }
418
+ /**
419
+ * Detail payload for `aparte-file-gen-error` — dispatched by YOU.
420
+ * Its twin: without it a failed sandbox run leaves the card spinning forever.
421
+ *
422
+ * @event aparte-file-gen-error
423
+ */
424
+ export interface AparteFileGenErrorEventDetail {
425
+ /** Must match the artifact segment's id. */
426
+ segmentId: string;
427
+ /** Which stage failed, shown in the inline error. Defaults to `'exec'`. */
428
+ phase?: string;
429
+ /** The message shown to the user. Defaults to `'Unknown error'`. */
430
+ error?: string;
431
+ }
290
432
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAM7C;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAEhB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yEAAyE;IACzE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAElB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;CACjB;AAMD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAElB,yCAAyC;IACzC,MAAM,EAAE,YAAY,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAMD;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACrC,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAElB,8BAA8B;IAC9B,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAEpD,kCAAkC;IAClC,QA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OAAO,CAAC;IAClB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,6BAA6B;IAC1C,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,kCAAkC;IAC/C,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IACzC;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,6BAA6B;IAC1C,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,MAAM,EAAE,UAAU,GAAG,WAAW,CAAC;IACjC,sEAAsE;IACtE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC1C,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -7,16 +7,15 @@
7
7
  * @packageDocumentation
8
8
  */
9
9
  export type { AparteStatus, AparteBubbleRole, AparteAttachment, AparteMessage, AparteMessageBranch, AparteBubbleActionsConfig, AparteBubbleActionName, AparteViewportConfig, AparteInputConfig } from './models.js';
10
- export type { AparteSendEventDetail, AparteTokenEventDetail, AparteControlEvent, AparteMessageEventDetail, AparteStatusEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail } from './events.js';
10
+ export type { AparteSendEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail } from './events.js';
11
11
  export type { AparteContentParser, AparteParserRegistry } from './parsers.js';
12
- export type { AparteSegmentBase, AparteTextSegment, AparteThinkingSegment, AparteCodeSegment, AparteDiffSegment, AparteDiffHunk, AparteDiffLine, AparteTerminalSegment, AparteFileTreeSegment, AparteFileNode, AparteImageSegment, ApartePreviewSegment, AparteErrorSegment, AparteProgressSegment, AparteSegment, AparteCustomSegment, AparteToolCallSegment, AparteArtifactSegment, AparteSegmentType, AparteSegmentRenderer, AparteSegmentActionEvent, AparteSegmentUpdateEvent } from './segments.js';
13
- export type { AparteDataProvider, AparteStreamProvider, AparteMessageStore, AparteControlHandler } from './providers.js';
12
+ export type { AparteSegmentBase, AparteTextSegment, AparteThinkingSegment, AparteCodeSegment, AparteDiffSegment, AparteDiffHunk, AparteDiffLine, AparteTerminalSegment, AparteFileTreeSegment, AparteFileNode, AparteImageSegment, ApartePreviewSegment, AparteErrorSegment, AparteProgressSegment, AparteSegment, AparteCustomSegment, AparteToolCallSegment, AparteArtifactSegment, AparteSegmentType, AparteSegmentRenderer, AparteSegmentUpdateEventDetail } from './segments.js';
14
13
  export type { AparteThemeVariables } from './theming.js';
15
14
  export type { AparteAIModel, AparteAIProvider, AparteAIProviderConfigField, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress } from './model-provider.js';
16
15
  export type { AparteChatRequest, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteFilePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage } from './chat.js';
17
16
  export { contentToText } from './chat.js';
18
- export type { AparteTool, AparteToolCall, AparteToolResult, AparteToolHandler, AparteToolRenderer, AparteToolDecisionDetail, AparteToolApprovalRequestDetail, AparteToolActionDetail } from './tools.js';
17
+ export type { AparteTool, AparteToolCall, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolDecisionDetail, AparteToolApprovalRequestDetail, } from './tools.js';
19
18
  export { AparteErrorCode, AparteError } from './errors.js';
20
- export type { AparteModelChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageInfoEventDetail, AparteArtifactStartEventDetail, AparteArtifactDeltaEventDetail, AparteArtifactReadyEventDetail, AparteArtifactOpenEventDetail } from './events.js';
19
+ export type { AparteModelChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteTerminalRunEventDetail, AparteFileGenReadyEventDetail, AparteFileGenErrorEventDetail, AparteMessageInfoEventDetail, AparteArtifactStartEventDetail, AparteArtifactDeltaEventDetail, AparteArtifactReadyEventDetail, AparteArtifactRedownloadEventDetail } from './events.js';
21
20
  export type { AparteChatImperativeApi } from './imperative-api.js';
22
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACpB,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,+B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4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAChC,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACpB,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,qBAAqB,EACrB,iBAAiB,EACjB,+BAA+B,EAC/B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EAC1B,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,8BAA8B,EACjC,MAAM,eAAe,CAAC;AAgBvB,YAAY,EACR,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACR,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,YAAY,EACR,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,+BAA+B,GAClC,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,YAAY,EACR,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,mCAAmC,EACtC,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -113,26 +113,13 @@ export interface AparteAIProviderConfigSchema {
113
113
  fields: AparteAIProviderConfigField[];
114
114
  }
115
115
  /**
116
- * Represents an AI provider (e.g., OpenRouter, OpenAI, Anthropic).
116
+ * What every provider carries, whichever half of the contract it implements:
117
+ * an identity, brand metadata, and a synchronous model list.
117
118
  *
118
- * Providers can return a static list of models or fetch them dynamically.
119
- *
120
- * @example
121
- * ```typescript
122
- * const provider: AparteAIProvider = {
123
- * id: 'openrouter',
124
- * getMetadata: () => ({
125
- * name: 'OpenRouter',
126
- * id: 'openrouter',
127
- * icon: '<svg>...</svg>',
128
- * color: '#000000',
129
- * helpUrl: 'https://openrouter.ai/keys'
130
- * }),
131
- * getModels: () => [...]
132
- * };
133
- * ```
119
+ * On its own this is **not** a usable provider see {@link AparteAIProvider},
120
+ * which requires one of the two execution surfaces as well.
134
121
  */
135
- export interface AparteAIProvider {
122
+ export interface AparteAIProviderCore {
136
123
  /** Unique identifier for the provider */
137
124
  id: string;
138
125
  /**
@@ -144,7 +131,7 @@ export interface AparteAIProvider {
144
131
  * list). Never return a Promise here — it would be ignored by
145
132
  * `getCurrentModel()`, silently disabling capability gates such as
146
133
  * `function_calling` (tools). For async fetching implement
147
- * {@link fetchModels} instead, which `AparteConfig.refreshProviderModels()`
134
+ * {@link fetchModels} instead, which `aparteGlobalConfig.refreshProviderModels()`
148
135
  * and the model-selector consume. Note: a provider without `fetchModels`
149
136
  * shows no models in the model-selector — `getModels()` is only read for
150
137
  * the current-model lookup.
@@ -157,41 +144,6 @@ export interface AparteAIProvider {
157
144
  * @param config - Optional API key or full configuration object for authenticated requests
158
145
  */
159
146
  fetchModels?(config?: string | Record<string, string>): Promise<AparteAIModel[]>;
160
- /**
161
- * Execute a chat request directly. **Optional** — HTTP providers expose the
162
- * format-adapter surface below and are driven by an `AparteTransport` instead;
163
- * providers that own their own I/O (Transformers.js locally, or a bridge
164
- * wrapping an external SDK) implement `chat`, to which `DirectTransport`
165
- * delegates.
166
- *
167
- * @param request - The chat request options (messages, model, etc.)
168
- * @param config - Optional API key or full configuration object
169
- * @param ctx - Transport context (structurally mirrors `AparteTransportContext`;
170
- * inline to avoid a type cycle with `transport/types`). `signal` aborts the
171
- * in-flight call — bridges MUST honor it so a user "stop" cancels the
172
- * underlying request, not just the local read.
173
- * @returns ReadableStream for streaming or string for full response
174
- */
175
- chat?(request: AparteChatRequest, config?: string | Record<string, string>, ctx?: {
176
- providerId: string;
177
- signal?: AbortSignal;
178
- }): Promise<AparteChatResponse>;
179
- /** Build the vendor HTTP request from an Aparte request (auth injected by the transport). */
180
- buildRequest?(request: AparteChatRequest): {
181
- path: string;
182
- body: unknown;
183
- headers?: Record<string, string>;
184
- };
185
- /** Vendor auth headers for a resolved key (browser-direct only). */
186
- authHeaders?(key: string): Record<string, string>;
187
- /** Vendor auth as URL query params for a resolved key (e.g. Gemini `?key=`). */
188
- authQuery?(key: string): Record<string, string>;
189
- /** Base URL for browser-direct calls (overridable per request via config). */
190
- defaultEndpoint?: string;
191
- /** Parse a streaming vendor response body into unified events. */
192
- parseStream?(body: ReadableStream<Uint8Array>): ReadableStream<AparteStreamEvent>;
193
- /** Extract text from a non-streaming vendor JSON response. */
194
- parseText?(json: unknown): string;
195
147
  /**
196
148
  * Optional. Returns the availability status of a model.
197
149
  *
@@ -219,6 +171,100 @@ export interface AparteAIProvider {
219
171
  */
220
172
  deleteModel?(modelId: string): Promise<void>;
221
173
  }
174
+ /**
175
+ * Execution surface for a provider that **owns its own I/O** — Transformers.js
176
+ * running locally, or a bridge wrapping an external SDK. `AparteDirectTransport`
177
+ * delegates to `chat()` and stays out of the way.
178
+ */
179
+ export interface AparteAIProviderChat {
180
+ /**
181
+ * @param request - The chat request options (messages, model, etc.)
182
+ * @param config - Optional API key or full configuration object
183
+ * @param ctx - Transport context (structurally mirrors `AparteTransportContext`;
184
+ * inline to avoid a type cycle with `transport/types`). `signal` aborts the
185
+ * in-flight call — bridges MUST honor it so a user "stop" cancels the
186
+ * underlying request, not just the local read.
187
+ * @returns ReadableStream for streaming or string for full response
188
+ */
189
+ chat(request: AparteChatRequest, config?: string | Record<string, string>, ctx?: {
190
+ providerId: string;
191
+ signal?: AbortSignal;
192
+ }): Promise<AparteChatResponse>;
193
+ }
194
+ /**
195
+ * Execution surface for a provider that only **shapes payloads** (transport ⊥
196
+ * format): an `AparteTransport` performs the call and handles auth, and the
197
+ * provider builds the request and parses the stream. See `src/transport/`.
198
+ */
199
+ export interface AparteAIProviderFormat {
200
+ /** Base URL for browser-direct calls (overridable per request via config). */
201
+ defaultEndpoint: string;
202
+ /** Build the vendor HTTP request from an Aparte request (auth injected by the transport). */
203
+ buildRequest(request: AparteChatRequest): {
204
+ path: string;
205
+ body: unknown;
206
+ headers?: Record<string, string>;
207
+ };
208
+ /** Parse a streaming vendor response body into unified events. */
209
+ parseStream(body: ReadableStream<Uint8Array>): ReadableStream<AparteStreamEvent>;
210
+ /** Extract text from a non-streaming vendor JSON response. */
211
+ parseText?(json: unknown): string;
212
+ }
213
+ /** Both ways a format adapter can present a resolved key. At least one is required. */
214
+ export interface AparteAIProviderAuthMembers {
215
+ /** Vendor auth headers for a resolved key (browser-direct only). */
216
+ authHeaders?(key: string): Record<string, string>;
217
+ /** Vendor auth as URL query params for a resolved key (e.g. Gemini `?key=`). */
218
+ authQuery?(key: string): Record<string, string>;
219
+ }
220
+ /**
221
+ * A format adapter with no way to present a key cannot be called, so the union
222
+ * demands one of the two — mirroring `isFormatAdapter`, which accepts either.
223
+ */
224
+ export type AparteAIProviderAuth = (AparteAIProviderAuthMembers & {
225
+ authHeaders(key: string): Record<string, string>;
226
+ }) | (AparteAIProviderAuthMembers & {
227
+ authQuery(key: string): Record<string, string>;
228
+ });
229
+ /**
230
+ * An AI provider (e.g. OpenRouter, OpenAI, Transformers.js).
231
+ *
232
+ * A **union, not one interface**, because there are two mutually sufficient ways
233
+ * to be a provider and the compiler should say which one you implemented. It used
234
+ * to be a single interface with three required members and fifteen optional ones,
235
+ * discriminated at RUNTIME by `isFormatAdapter()` — so `{ id, getMetadata,
236
+ * getModels }` typechecked, registered, and then failed on the first message with
237
+ * nothing at build time to warn you.
238
+ *
239
+ * Every member of both surfaces stays reachable on the union (optional on the arm
240
+ * that does not require it), so runtime probes like `typeof p.buildRequest ===
241
+ * 'function'` and `isFormatAdapter()` narrowing keep working unchanged. A provider
242
+ * implementing both surfaces is valid and satisfies the format arm.
243
+ *
244
+ * @example A format adapter — a transport does the call
245
+ * ```typescript
246
+ * const provider: AparteAIProvider = {
247
+ * id: 'openrouter',
248
+ * getMetadata: () => ({ name: 'OpenRouter', id: 'openrouter', icon: '<svg/>', color: '#000' }),
249
+ * getModels: () => [],
250
+ * defaultEndpoint: 'https://openrouter.ai/api/v1',
251
+ * buildRequest: (req) => ({ path: '/chat/completions', body: req }),
252
+ * authHeaders: (key) => ({ Authorization: `Bearer ${key}` }),
253
+ * parseStream: (body) => body as unknown as ReadableStream<AparteStreamEvent>,
254
+ * };
255
+ * ```
256
+ *
257
+ * @example A provider owning its own I/O
258
+ * ```typescript
259
+ * const local: AparteAIProvider = {
260
+ * id: 'transformers',
261
+ * getMetadata: () => ({ name: 'Transformers.js', id: 'transformers', icon: '<svg/>', color: '#000' }),
262
+ * getModels: () => [],
263
+ * chat: async (request) => runLocally(request),
264
+ * };
265
+ * ```
266
+ */
267
+ export type AparteAIProvider = (AparteAIProviderCore & AparteAIProviderFormat & AparteAIProviderAuth & Partial<AparteAIProviderChat>) | (AparteAIProviderCore & AparteAIProviderChat & Partial<AparteAIProviderFormat> & AparteAIProviderAuthMembers);
222
268
  /**
223
269
  * Configuration options for model selection behavior.
224
270
  */
@@ -1 +1 @@
1
- {"version":3,"file":"model-provider.d.ts","sourceRoot":"","sources":["../../src/types/model-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAMrF;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC1B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IAEX,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IAEb,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mDAAmD;IACnD,OAAO,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF,gCAAgC;IAChC,YAAY,CAAC,EAAE,CAAC,QAAQ,GAAG,kBAAkB,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC;IAEtF,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,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