@aparte/core 0.19.3 → 0.21.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 (139) hide show
  1. package/dist/client/aparte-client.d.ts +66 -95
  2. package/dist/client/aparte-client.d.ts.map +1 -1
  3. package/dist/client/stream-adapter.d.ts +7 -13
  4. package/dist/client/stream-adapter.d.ts.map +1 -1
  5. package/dist/client/wire-history.d.ts +4 -5
  6. package/dist/client/wire-history.d.ts.map +1 -1
  7. package/dist/components/bubble/aparte-chat-bubble.d.ts +88 -57
  8. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
  9. package/dist/components/chat/aparte-chat.d.ts +15 -13
  10. package/dist/components/chat/aparte-chat.d.ts.map +1 -1
  11. package/dist/components/chat/glide-gate.d.ts +13 -0
  12. package/dist/components/chat/glide-gate.d.ts.map +1 -0
  13. package/dist/components/composer/aparte-composer-action.d.ts +2 -2
  14. package/dist/components/composer/aparte-composer-add-attachment.d.ts +1 -1
  15. package/dist/components/composer/aparte-composer-input.d.ts +1 -5
  16. package/dist/components/composer/aparte-composer-input.d.ts.map +1 -1
  17. package/dist/components/composer/aparte-composer-send.d.ts +8 -10
  18. package/dist/components/composer/aparte-composer-send.d.ts.map +1 -1
  19. package/dist/components/composer/aparte-composer.d.ts +48 -80
  20. package/dist/components/composer/aparte-composer.d.ts.map +1 -1
  21. package/dist/components/context/aparte-context.d.ts +9 -4
  22. package/dist/components/context/aparte-context.d.ts.map +1 -1
  23. package/dist/components/conversation-list/aparte-conversation-list.d.ts +23 -13
  24. package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
  25. package/dist/components/elicitation/aparte-elicitation.d.ts +15 -22
  26. package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
  27. package/dist/components/scroll-rail/aparte-scroll-rail.d.ts +10 -11
  28. package/dist/components/scroll-rail/aparte-scroll-rail.d.ts.map +1 -1
  29. package/dist/components/sidebar/aparte-sidebar.d.ts +16 -3
  30. package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -1
  31. package/dist/components/split/aparte-split.d.ts +12 -3
  32. package/dist/components/split/aparte-split.d.ts.map +1 -1
  33. package/dist/components/status/aparte-chat-status.d.ts.map +1 -1
  34. package/dist/components/suggestions/aparte-suggestions.d.ts +6 -9
  35. package/dist/components/suggestions/aparte-suggestions.d.ts.map +1 -1
  36. package/dist/components/viewport/aparte-chat-viewport.d.ts +70 -70
  37. package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
  38. package/dist/config/aparte-config.d.ts +88 -67
  39. package/dist/config/aparte-config.d.ts.map +1 -1
  40. package/dist/config/icon-provider.d.ts +19 -2
  41. package/dist/config/icon-provider.d.ts.map +1 -1
  42. package/dist/config/index.d.ts +1 -1
  43. package/dist/config/index.d.ts.map +1 -1
  44. package/dist/config/locale.d.ts +57 -89
  45. package/dist/config/locale.d.ts.map +1 -1
  46. package/dist/config/sanitize.d.ts.map +1 -1
  47. package/dist/conversations/conversation-controller.d.ts +18 -3
  48. package/dist/conversations/conversation-controller.d.ts.map +1 -1
  49. package/dist/conversations/conversation-manager.d.ts +3 -3
  50. package/dist/conversations/conversation-manager.d.ts.map +1 -1
  51. package/dist/custom-elements.json +7626 -6906
  52. package/dist/{dialog-triggers-ChnPFG9M.js → dialog-triggers-3Rk7PuZa.js} +444 -287
  53. package/dist/dialog-triggers-3Rk7PuZa.js.map +1 -0
  54. package/dist/elicitation/approval-panel.d.ts.map +1 -1
  55. package/dist/elicitation/index.d.ts +6 -1
  56. package/dist/elicitation/index.d.ts.map +1 -1
  57. package/dist/elicitation/panel.d.ts +11 -21
  58. package/dist/elicitation/panel.d.ts.map +1 -1
  59. package/dist/elicitation/types.d.ts +19 -27
  60. package/dist/elicitation/types.d.ts.map +1 -1
  61. package/dist/generated/element-attributes.d.ts +11 -5
  62. package/dist/generated/element-attributes.d.ts.map +1 -1
  63. package/dist/host/aparte-chat-host.d.ts +17 -32
  64. package/dist/host/aparte-chat-host.d.ts.map +1 -1
  65. package/dist/icons/extended.d.ts +1 -2
  66. package/dist/icons/extended.d.ts.map +1 -1
  67. package/dist/icons.d.ts +6 -8
  68. package/dist/icons.d.ts.map +1 -1
  69. package/dist/icons.js.map +1 -1
  70. package/dist/index.css +1 -1
  71. package/dist/index.d.ts +12 -9
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +682 -327
  74. package/dist/index.js.map +1 -1
  75. package/dist/index.node.d.ts +6 -3
  76. package/dist/index.node.d.ts.map +1 -1
  77. package/dist/index.node.js +2 -2
  78. package/dist/index.node.js.map +1 -1
  79. package/dist/interop/dialog-triggers.d.ts +2 -2
  80. package/dist/interop/element-props.d.ts +16 -27
  81. package/dist/interop/element-props.d.ts.map +1 -1
  82. package/dist/primitives/icon/aparte-icon.d.ts.map +1 -1
  83. package/dist/primitives/select/aparte-option.d.ts +3 -2
  84. package/dist/primitives/select/aparte-option.d.ts.map +1 -1
  85. package/dist/primitives/select/aparte-select.d.ts +24 -21
  86. package/dist/primitives/select/aparte-select.d.ts.map +1 -1
  87. package/dist/renderers/markdown-stream.d.ts.map +1 -1
  88. package/dist/renderers/segment-renderers.d.ts +11 -17
  89. package/dist/renderers/segment-renderers.d.ts.map +1 -1
  90. package/dist/renderers/segments/code.d.ts.map +1 -1
  91. package/dist/renderers/segments/error.d.ts.map +1 -1
  92. package/dist/renderers/segments/text.d.ts.map +1 -1
  93. package/dist/renderers/segments/tool-call.d.ts.map +1 -1
  94. package/dist/runtime/message-repository.d.ts +8 -15
  95. package/dist/runtime/message-repository.d.ts.map +1 -1
  96. package/dist/transport/backend-handler.d.ts +4 -6
  97. package/dist/transport/backend-handler.d.ts.map +1 -1
  98. package/dist/transport/backend-transport.d.ts +14 -0
  99. package/dist/transport/backend-transport.d.ts.map +1 -1
  100. package/dist/transport/types.d.ts +7 -10
  101. package/dist/transport/types.d.ts.map +1 -1
  102. package/dist/types/chat.d.ts +10 -18
  103. package/dist/types/chat.d.ts.map +1 -1
  104. package/dist/types/element-attributes.d.ts +6 -12
  105. package/dist/types/element-attributes.d.ts.map +1 -1
  106. package/dist/types/element-map.d.ts +6 -19
  107. package/dist/types/element-map.d.ts.map +1 -1
  108. package/dist/types/event-map.d.ts +11 -17
  109. package/dist/types/event-map.d.ts.map +1 -1
  110. package/dist/types/events.d.ts +5 -14
  111. package/dist/types/events.d.ts.map +1 -1
  112. package/dist/types/index.d.ts +2 -2
  113. package/dist/types/index.d.ts.map +1 -1
  114. package/dist/types/model-provider.d.ts +7 -9
  115. package/dist/types/model-provider.d.ts.map +1 -1
  116. package/dist/types/segments.d.ts +21 -13
  117. package/dist/types/segments.d.ts.map +1 -1
  118. package/dist/types/tools.d.ts +20 -22
  119. package/dist/types/tools.d.ts.map +1 -1
  120. package/dist/utils/copy-text.d.ts +1 -2
  121. package/dist/utils/copy-text.d.ts.map +1 -1
  122. package/dist/utils/css-escape.d.ts +1 -1
  123. package/dist/utils/escape.d.ts +4 -19
  124. package/dist/utils/escape.d.ts.map +1 -1
  125. package/dist/utils/files-to-attachments.d.ts +2 -2
  126. package/dist/utils/fold-text.d.ts +13 -0
  127. package/dist/utils/fold-text.d.ts.map +1 -0
  128. package/dist/utils/is-awaiting-reply.d.ts +2 -5
  129. package/dist/utils/is-awaiting-reply.d.ts.map +1 -1
  130. package/dist/utils/presence.d.ts +5 -5
  131. package/dist/utils/segments.d.ts +54 -78
  132. package/dist/utils/segments.d.ts.map +1 -1
  133. package/dist/utils/tool-input.d.ts +1 -1
  134. package/dist/utils/tool-input.d.ts.map +1 -1
  135. package/dist/utils/transcript.d.ts +2 -2
  136. package/dist/utils/uuid.d.ts +0 -11
  137. package/dist/utils/uuid.d.ts.map +1 -1
  138. package/package.json +29 -3
  139. package/dist/dialog-triggers-ChnPFG9M.js.map +0 -1
@@ -4,14 +4,11 @@
4
4
  * Core keeps only the English default in memory (`APARTE_DEFAULT_LOCALE`); other
5
5
  * languages arrive through `aparteGlobalConfig.setLocale()`.
6
6
  *
7
- * Closed, and an alias rather than an interface, on purpose. This used to end with
8
- * `[key: string]: string | undefined`, and that one line disabled the only
9
- * compile-time check the locale had: `AparteConfig.t(key: keyof AparteLocale)` looks
10
- * airtight, but with an index signature `keyof` widens to `string` and EVERY literal
11
- * typechecks. A renamed key compiled clean, `t()` returned `''` at runtime, and the UI
12
- * rendered an empty label with no error and no warning — which is how `submitButton`,
13
- * `stopButton` and `actionUpload` each shipped read-but-never-declared, the last one
14
- * reported by a user from a live language switcher.
7
+ * Closed, and an alias rather than an interface, on purpose. It has no index
8
+ * signature: `AparteConfig.t(key: keyof AparteLocale)` is only checked at compile time
9
+ * while `keyof` stays a union of literals, and an index signature would widen it to
10
+ * `string` so that EVERY literal typechecks. A misspelled key would then compile, `t()`
11
+ * would return `''` at runtime, and the UI would render an empty label with no error.
15
12
  *
16
13
  * The open half is {@link AparteLocaleExtensions}, and an ALIAS is what lets the two
17
14
  * meet: TypeScript gives a type alias an implicit index signature and an interface
@@ -68,13 +65,14 @@ export type AparteLocale = {
68
65
  newChat: string;
69
66
  /** Read by a screen reader while the conversation list is on its way (default: "Loading conversations") */
70
67
  loadingConversations: string;
68
+ /** The conversation list's line when its filter matches no title (default: "No conversation matches") */
69
+ conversationSearchEmpty?: string;
71
70
  /** Accessible name of the conversation list, a navigation landmark (default: "Conversations") */
72
71
  conversationList?: string;
73
72
  /** Read by a screen reader while a conversation's messages are on their way (default: "Loading the conversation") */
74
73
  loadingConversation: string;
75
74
  /**
76
- * The "Delete" item of a row's menu (default: "Delete"). Used to be the aria-label
77
- * of a permanent ✕ on every row ("Delete conversation"); the menu is named after
75
+ * The "Delete" item of a row's menu (default: "Delete"). The menu is named after
78
76
  * the row, so the item carries only the verb.
79
77
  */
80
78
  deleteConversation: string;
@@ -133,36 +131,20 @@ export type AparteLocale = {
133
131
  /**
134
132
  * The send button while a question panel is open, where it submits an ANSWER
135
133
  * rather than sending a message (default: "Submit").
136
- *
137
- * The component has been reading this key since the panel API existed; it was
138
- * never declared, so `t()` returned "" and the hardcoded fallback showed. A key
139
- * read and never declared is worse than a literal: it looks translated.
140
134
  */
141
135
  submitButton?: string;
142
136
  /**
143
137
  * The cancel/stop button that replaces send while a turn is streaming
144
138
  * (default: "Stop").
145
139
  *
146
- * `aparte-composer-cancel` has been reading this key since it existed and it was
147
- * never declared — the same defect this file already records for `submitButton`
148
- * one entry up, found again while auditing a different question. So it has never
149
- * been translatable in ANY language, not even after a full reload: `t()` returned
150
- * nothing and the `|| 'Stop'` fallback rendered every time.
151
- *
152
140
  * The button carries no visible text — this string is its `aria-label` and its
153
- * `title`. Which is exactly why the gap survived: nothing on screen was in the
154
- * wrong language, so only a screen-reader user or someone hovering would ever
155
- * have met it. Most of the composer's translatable surface is like this.
141
+ * `title`.
156
142
  */
157
143
  stopButton?: string;
158
144
  /**
159
145
  * The tag a `recommended` option wears beside its label (default: "Recommended").
160
146
  * Said, not only tinted: a tint is a hint the eye may miss and a screen reader
161
147
  * never gets.
162
- *
163
- * (`elicitationNext` lived here until 2026-08-28, for the composer's button while a
164
- * form had questions ahead. That meaning is gone with the button's "advance" mode
165
- * — the chips are the navigation — so the key went with it, not deprecated.)
166
148
  */
167
149
  elicitationRecommended?: string;
168
150
  /**
@@ -170,12 +152,15 @@ export type AparteLocale = {
170
152
  *
171
153
  * "Skip" reads as "skip THIS one" on a form of several questions, while it
172
154
  * declines the whole request — including questions already answered. That is MCP's
173
- * `decline` and the right behaviour. It was briefly renamed to carry the warning;
174
- * reverted, because the RECEIPT now shows the outcome unambiguously (one declined
175
- * row, no question attached), so the label no longer has to do that work — and
176
- * "Skip" is the short conventional word for it.
155
+ * `decline`. The receipt shows the outcome unambiguously (one declined row, no
156
+ * question attached), so the label does not have to carry the warning and stays the
157
+ * short conventional word.
177
158
  */
178
159
  elicitationSkip?: string;
160
+ /** Label of the button that puts an open question or approval aside, to read the transcript behind it (default: "Hide for now") */
161
+ elicitationHide?: string;
162
+ /** The one-line bar an aside panel leaves, which brings it back (default: "Waiting for your answer") */
163
+ elicitationWaiting?: string;
179
164
  /** Affirmative choice of a yes/no question (default: "Yes") */
180
165
  elicitationYes?: string;
181
166
  /** Negative choice of a yes/no question (default: "No") */
@@ -186,8 +171,8 @@ export type AparteLocale = {
186
171
  * Placeholder for the free-text arm of an approval (default: "Or tell it what to
187
172
  * do instead…").
188
173
  *
189
- * The refusal's REASON, in the user's words, which the model now reads because a
190
- * refusal hands it a turn. Before that this text had nowhere to go.
174
+ * The refusal's REASON, in the user's words, which the model reads because a
175
+ * refusal hands it a turn.
191
176
  */
192
177
  approvalInstructionPlaceholder?: string;
193
178
  /**
@@ -202,10 +187,8 @@ export type AparteLocale = {
202
187
  * Accessible name of the viewport's scroll-to-bottom button (default:
203
188
  * "Scroll to bottom").
204
189
  *
205
- * It was hardcoded English at both sites that build the button — the one
206
- * chrome string a screen-reader user in another language always met. Same
207
- * class of defect as the undeclared-key trio (submitButton, stopButton,
208
- * actionUpload): the component looked done, the locale looked complete.
190
+ * The button is icon-only, so this string is the whole of what a screen-reader
191
+ * user hears there.
209
192
  */
210
193
  scrollToBottom?: string;
211
194
  /**
@@ -220,8 +203,7 @@ export type AparteLocale = {
220
203
  * Title line of the summary message `@aparte/plugin-compaction` injects in place
221
204
  * of the summarised turns (default: "Conversation summary"). The plugin reads it
222
205
  * through `config.t()`, so the notice follows the locale like every other string
223
- * the user reads — it used to be hardcoded, with an emoji, so a French chat
224
- * compacted into an English header.
206
+ * the user reads.
225
207
  */
226
208
  compactionSummaryTitle?: string;
227
209
  /**
@@ -238,8 +220,8 @@ export type AparteLocale = {
238
220
  *
239
221
  * A WORD and not only a glyph, which is what every current implementation shows
240
222
  * ("Pending", "Running", "Completed", "Error"). A bare cross beside a name reads as
241
- * a button that removes something — the state was being mistaken for an
242
- * affordance, which is ratified decision #8 read backwards.
223
+ * a button that removes something: a state must not be mistaken for an
224
+ * affordance.
243
225
  */
244
226
  toolRunning?: string;
245
227
  toolCompleted?: string;
@@ -256,25 +238,16 @@ export type AparteLocale = {
256
238
  /**
257
239
  * Heading over the call's arguments in the approval panel (default: "Arguments").
258
240
  *
259
- * The panel named the tool and nothing else, while the arguments — the thing
260
- * actually being approved — stayed in the transcript row behind a closed
261
- * disclosure. Same word family as {@link toolInput} and deliberately not that
262
- * key: that one heads a section of a transcript row, this one heads a decision.
241
+ * The arguments are the thing actually being approved, so the panel shows them
242
+ * under this heading. Same word family as {@link toolInput} and deliberately not
243
+ * that key: that one heads a section of a transcript row, this one heads a
244
+ * decision.
263
245
  */
264
246
  approvalArgsLabel?: string;
265
247
  /**
266
248
  * The composer's attach-file button (default: "Attach file").
267
249
  *
268
- * `aparte-composer-add-attachment` has been READING `t('actionUpload')` since it
269
- * existed, and the key was never declared — so `t()` returned '' and the
270
- * `|| 'Attach file'` fallback rendered in every language, after every reload.
271
- * The third instance of this exact defect in this file, after `submitButton` and
272
- * `stopButton`, and the one a user reported from the live language switcher.
273
- *
274
- * A key that is read and not declared cannot be found by reading either side: the
275
- * component looks correct, the locale looks complete. Cross-checking the two
276
- * lists is what finds them — `t()` calls and `getLocale().x` reads on one side,
277
- * these declarations on the other.
250
+ * Read by `aparte-composer-add-attachment` as `t('actionUpload')`.
278
251
  */
279
252
  actionUpload?: string;
280
253
  /**
@@ -286,12 +259,16 @@ export type AparteLocale = {
286
259
  * icon-only, so this string is the whole of what a screen-reader user hears.
287
260
  */
288
261
  removeAttachment?: string;
262
+ /**
263
+ * The accessible name of a message whose bubble carries a `name` — a human agent, a
264
+ * second assistant (default: "Message from {name}"). `{name}` is that name. Without one
265
+ * the bubble is named after its role: `yourMessage` or `assistantResponse`.
266
+ */
267
+ messageFrom?: string;
289
268
  /**
290
269
  * Placeholder of a searchable select's filter field (default: "Search…").
291
270
  *
292
- * VISIBLE text, which is what separates it from most of this file: it was a
293
- * literal in the primitive, so a French page opened the model picker and read
294
- * "Search..." in the box.
271
+ * VISIBLE text, which is what separates it from most of this file.
295
272
  */
296
273
  selectSearchPlaceholder?: string;
297
274
  /** Accessible name of that filter field, which has no visible label (default: "Search options") */
@@ -313,16 +290,17 @@ export type AparteLocale = {
313
290
  * The artifact card's download button (default: "Download").
314
291
  *
315
292
  * Like `stopButton`, this string is a `title` and an `aria-label` on an
316
- * icon-only button — which is why it stayed English through every locale this
317
- * project shipped. Nothing on screen was in the wrong language.
293
+ * icon-only button.
318
294
  */
319
295
  download?: string;
296
+ /** The artifact card's Open button, when the app asked for it (default: "Open") */
297
+ openArtifact?: string;
298
+ /** A model's context window under its name in the model selector's `details` — `{n}` is the size (default: "{n} context") */
299
+ modelContextWindow?: string;
320
300
  /**
321
301
  * The artifact card's two tabs (defaults: "Preview" / "Code").
322
302
  *
323
- * These two ARE visible text, on a card the landing page leads with, and they
324
- * were still literals. The card was written before the locale had a home for
325
- * anything but chrome.
303
+ * These two are visible text on the card.
326
304
  */
327
305
  preview?: string;
328
306
  code?: string;
@@ -330,9 +308,8 @@ export type AparteLocale = {
330
308
  * A binary artifact being produced, and the same artifact's preview being rebuilt
331
309
  * after a reload (defaults: "Generating…" / "Rebuilding preview…").
332
310
  *
333
- * `generating` was also the `aria-label` of the former `pipeline-waiting` segment, which
334
- * is the ONLY thing a screen-reader user hears while a turn is in flight. It was
335
- * hardcoded, so that announcement was English in every locale.
311
+ * Both are read by `@aparte/plugin-artifacts`: `generating` is the subtext of a binary
312
+ * artifact being produced and the `aria-label` of the artifact card's streaming pulse.
336
313
  */
337
314
  generating?: string;
338
315
  rebuildingPreview?: string;
@@ -341,8 +318,8 @@ export type AparteLocale = {
341
318
  * Preview to run this artifact.").
342
319
  *
343
320
  * The pane is empty on purpose — a previewable artifact is model-authored code
344
- * and mounting it unasked would execute it (ratified decision #8) — so this
345
- * sentence is the whole of what the reader sees there, and it was a literal.
321
+ * and mounting it unasked would execute it — so this sentence is the whole of
322
+ * what the reader sees there.
346
323
  */
347
324
  previewPending?: string;
348
325
  /**
@@ -358,10 +335,9 @@ export type AparteLocale = {
358
335
  * BCP-47 language tag for `Intl` formatting — `'fr-FR'`, `'ja-JP'`, `'en-US'`.
359
336
  *
360
337
  * A locale is otherwise a bag of STRINGS, and a clock is not a string: it is a
361
- * format. So `setLocale(fr)` moved fifty strings and left the timestamp above
362
- * every message reading `7:32 PM`, because the only `Intl` call in the library
363
- * passed `undefined` — "use the BROWSER's locale" — which is not the locale the
364
- * app just chose. French is 24-hour; the browser was not asked.
338
+ * format. The tag is what the library's `Intl` calls (the timestamp above every
339
+ * message) use, instead of the BROWSER's locale, which is not necessarily the
340
+ * locale the app chose.
365
341
  *
366
342
  * A tag and NOT an `hour12` flag, deliberately. A flag answers one question for
367
343
  * one call site; a tag answers every question `Intl` can be asked — hour cycle,
@@ -371,8 +347,7 @@ export type AparteLocale = {
371
347
  * words are.
372
348
  *
373
349
  * Undefined on purpose in the English default: `undefined` means "follow the
374
- * browser", which is the right default for a library and the behaviour every
375
- * consumer has today. A locale that declares a tag pins the formatting — if you
350
+ * browser", which is the right default for a library. A locale that declares a tag pins the formatting — if you
376
351
  * have chosen French strings, French formatting is what you meant.
377
352
  */
378
353
  tag?: string;
@@ -381,12 +356,9 @@ export type AparteLocale = {
381
356
  * scroll container and onto `<aparte-composer>`, so everything inside inherits it.
382
357
  *
383
358
  * Undefined on purpose in the English default, for the reason `tag` above is:
384
- * `undefined` means "follow the host". The default used to be the literal
385
- * `'ltr'`, which meant core wrote `dir="ltr"` on its own DOM — so a page that
386
- * had said `<html dir="rtl">` got a mirrored app shell around a chat that was
387
- * still left-to-right, and nothing said why. Not declaring it lets the host's
388
- * direction inherit, which is what a library should do with a decision the page
389
- * has already taken.
359
+ * `undefined` means "follow the host": core writes no `dir` of its own, so the
360
+ * host's direction (`<html dir="rtl">`) inherits, which is what a library should
361
+ * do with a decision the page has already taken.
390
362
  *
391
363
  * A locale that wants the direction PINNED still declares it, and that is the
392
364
  * case it exists for: `@aparte/locale-ar` would say `'rtl'` whatever the page
@@ -398,16 +370,12 @@ export type AparteLocale = {
398
370
  /**
399
371
  * The extension half: any other key a plugin or an app wants to carry.
400
372
  *
401
- * This used to be an index signature ON `AparteLocale` — `[key: string]: string |
402
- * undefined` — and it silently disabled the only compile-time check the locale had.
403
- * `AparteConfig.t(key: keyof AparteLocale)` looks airtight; with an index signature,
404
- * `keyof` widens to `string` and EVERY literal typechecks. A renamed key
405
- * (`t('copy')` typed as `t('copyCodeBlock')`) compiled clean, `t()` returned `''`
406
- * at runtime, and the UI rendered an empty label with no error and no warning. It was
407
- * one of the six deliberate mistakes an audit planted, and the only guard that could
408
- * have caught it was this type.
373
+ * Kept separate from {@link AparteLocale} on purpose: an index signature on
374
+ * `AparteLocale` itself would widen `keyof AparteLocale` to `string`, so `t()` would
375
+ * typecheck every literal and a misspelled key would render an empty label with no
376
+ * error.
409
377
  *
410
- * So the two halves are separate now: {@link AparteLocale} is CLOSED — it is the list
378
+ * The two halves: {@link AparteLocale} is CLOSED — it is the list
411
379
  * `t()` keys on — and this is the open bag beside it. {@link AparteConfig.setLocale}
412
380
  * and {@link AparteConfig.extendLocale} accept the intersection, so a plugin still
413
381
  * ships its own strings in the same object; only `t()` stays narrow, which is where
@@ -1 +1 @@
1
- {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/config/locale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,YAAY,GAAG;IAEvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IAGnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IAGd,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,8GAA8G;IAC9G,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAGhB,GAAG,EAAE,MAAM,CAAC;IAGZ,IAAI,EAAE,MAAM,CAAC;IAGb,oEAAoE;IACpE,YAAY,EAAE,M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AAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B;;;;;;;;;;;;;;;;;;OAkBG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAiGnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,aAKzB,CAAC;AAqIH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ7D;AAoPD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAY9B,CAAC"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,aAKzB,CAAC;AAiIH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ7D;AAgPD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAY9B,CAAC"}
@@ -42,6 +42,13 @@ export interface AparteChatBinding {
42
42
  * Optional: falls back to the flat `setMessages` load when absent.
43
43
  */
44
44
  importTree?(tree: ExportedMessageRepository): void;
45
+ /**
46
+ * Run a callback after the framework has applied its latest render. Optional: a
47
+ * binding whose list is current the moment it is written (the vanilla viewport)
48
+ * leaves it out. One that renders late — a transcript kept in a framework store —
49
+ * declares it, so a save waits for the list to arrive instead of writing the old one.
50
+ */
51
+ afterRender?(cb: () => void): void;
45
52
  }
46
53
  export interface AparteConversationControllerOptions {
47
54
  /**
@@ -88,6 +95,7 @@ export declare class AparteConversationController {
88
95
  private _onMessageAborted;
89
96
  private _onMessagePaused;
90
97
  private _onSelectConversation;
98
+ private _onCompactDone;
91
99
  private _unsubscribeManager;
92
100
  /** The manager the subscription above is on, so a replaced manager is re-subscribed. */
93
101
  private _subscribedTo;
@@ -115,9 +123,9 @@ export declare class AparteConversationController {
115
123
  /**
116
124
  * Degraded mode is legitimate — a host that never opted into the conversation
117
125
  * lifecycle has no manager and should not be nagged. Registering one on the
118
- * WRONG config is not: the four wrapper hooks used to write it to the global
119
- * singleton unconditionally, so `config` + persistence looked like it worked
120
- * (the optimistic UI still appends) and saved nothing at all.
126
+ * WRONG config is not: a manager registered on the global singleton while the chat
127
+ * uses its own `config` looks like it works (the optimistic UI still appends) and
128
+ * saves nothing at all.
121
129
  *
122
130
  * Warned once per controller, and only in the case that is unambiguously a
123
131
  * mistake: no manager here, but one on the global.
@@ -161,6 +169,13 @@ export declare class AparteConversationController {
161
169
  * re-enter streaming UI (caret, spinner, no action buttons) for content
162
170
  * that was partially written before a switch or component destruction.
163
171
  */
172
+ /**
173
+ * Save once the binding holds the summary a compaction announced. A transcript kept in
174
+ * a framework store reaches the binding only when that framework renders, so a save on
175
+ * the microtask wrote the conversation as it stood before the compaction. Bounded: a
176
+ * run with no summary (skipped), or a binding that never shows it, is saved as it is.
177
+ */
178
+ private _persistOnceSummarised;
164
179
  private _persistActive;
165
180
  private _ensureConversationAndPersist;
166
181
  }
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-controller.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAOlF;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,2EAA2E;IAC3E,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC7C,0EAA0E;IAC1E,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5C,qCAAqC;IACrC,WAAW,IAAI,aAAa,EAAE,CAAC;IAC/B,kEAAkE;IAClE,aAAa,CAAC,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/D;;;OAGG;IACH,UAAU,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,UAAU,CAAC,IAAI,yBAAyB,GAAG,SAAS,CAAC;IACrD;;;;;OAKG;IACH,UAAU,CAAC,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,mCAAmC;IAChD;;;OAGG;IACH,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC;;;OAGG;IACH,qBAAqB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MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAgLzD;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAUjB;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;YA+BR,6BAA6B;CAiE9C"}
1
+ {"version":3,"file":"conversation-controller.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAOlF;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,2EAA2E;IAC3E,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC7C,0EAA0E;IAC1E,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5C,qCAAqC;IACrC,WAAW,IAAI,aAAa,EAAE,CAAC;IAC/B,kEAAkE;IAClE,aAAa,CAAC,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/D;;;OAGG;IACH,UAAU,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,UAAU,CAAC,IAAI,yBAAyB,GAAG,SAAS,CAAC;IACrD;;;;;OAKG;IACH,UAAU,CAAC,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACnD;;;;;OAKG;IACH,WAAW,CAAC,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACtC;AAKD,MAAM,WAAW,mCAAmC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ACnF,OAAO,CAAC,mBAAmB,CAA6B;IAExD,MAAM,IAAI,IAAI;IAyDd;;;;;;;;;;OAUG;IACG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAgLzD;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAUjB;;;;;;;;;OASG;IACH;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,cAAc;YA+BR,6BAA6B;CAiE9C"}
@@ -120,9 +120,9 @@ export declare class AparteConversationManager {
120
120
  *
121
121
  * One append at a time per conversation: two sends that overlap (a suggestion and a
122
122
  * quick type, coalesced into one new conversation) both suspend before reading the
123
- * record — for the messages, then for the title provider — so both used to read a
124
- * conversation with no user message in it yet, and the second one's text became the
125
- * title.
123
+ * record — for the messages, then for the title provider — so the queue keeps the
124
+ * second one from reading a conversation with no user message in it yet and
125
+ * taking its text as the title.
126
126
  */
127
127
  addMessage(convId: string, msg: AparteMessage): Promise<void>;
128
128
  private _append;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-manager.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAIlF,6FAA6F;AAC7F,MAAM,MAAM,2BAA2B,GAAG,CAAC,aAAa,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;AAExF;;;;;;;;GAQG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAEjH,MAAM,WAAW,0BAA0B;IACvC;;;OAGG;IACH,aAAa,CA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