@aparte/core 1.4.0 → 1.6.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 (47) hide show
  1. package/dist/client/agent-runner.d.ts.map +1 -1
  2. package/dist/client/aparte-client.d.ts +6 -0
  3. package/dist/client/aparte-client.d.ts.map +1 -1
  4. package/dist/client/stream-adapter.d.ts +52 -2
  5. package/dist/client/stream-adapter.d.ts.map +1 -1
  6. package/dist/client/wire-history.d.ts +3 -2
  7. package/dist/client/wire-history.d.ts.map +1 -1
  8. package/dist/components/bubble/aparte-chat-bubble.d.ts +1 -1
  9. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
  10. package/dist/components/conversation-list/aparte-conversation-list.d.ts +11 -0
  11. package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -1
  12. package/dist/components/launcher/aparte-launcher.d.ts +2 -0
  13. package/dist/components/launcher/aparte-launcher.d.ts.map +1 -1
  14. package/dist/components/sidebar/aparte-sidebar.d.ts +42 -5
  15. package/dist/components/sidebar/aparte-sidebar.d.ts.map +1 -1
  16. package/dist/components/viewport/aparte-chat-viewport.d.ts +5 -0
  17. package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
  18. package/dist/config/aparte-config.d.ts +69 -4
  19. package/dist/config/aparte-config.d.ts.map +1 -1
  20. package/dist/config/locale.d.ts +9 -0
  21. package/dist/config/locale.d.ts.map +1 -1
  22. package/dist/custom-elements.json +2244 -1659
  23. package/dist/{defer-hydration-lK-7XQXf.js → defer-hydration-W4yhnyfc.js} +406 -143
  24. package/dist/defer-hydration-W4yhnyfc.js.map +1 -0
  25. package/dist/generated/element-attributes.d.ts +4 -2
  26. package/dist/generated/element-attributes.d.ts.map +1 -1
  27. package/dist/index.css +1 -1
  28. package/dist/index.d.ts +6 -2
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +167 -90
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.node.d.ts +6 -2
  33. package/dist/index.node.d.ts.map +1 -1
  34. package/dist/index.node.js +52 -47
  35. package/dist/index.node.js.map +1 -1
  36. package/dist/renderers/segments/tool-call.d.ts.map +1 -1
  37. package/dist/transport/agent-handler.d.ts.map +1 -1
  38. package/dist/types/index.d.ts +1 -1
  39. package/dist/types/index.d.ts.map +1 -1
  40. package/dist/types/tools.d.ts +40 -0
  41. package/dist/types/tools.d.ts.map +1 -1
  42. package/dist/utils/segment-list.d.ts +49 -0
  43. package/dist/utils/segment-list.d.ts.map +1 -0
  44. package/dist/utils/tool-line.d.ts +36 -9
  45. package/dist/utils/tool-line.d.ts.map +1 -1
  46. package/package.json +2 -2
  47. package/dist/defer-hydration-lK-7XQXf.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -67,7 +67,7 @@
67
67
  import './types/event-map.js';
68
68
  import './types/element-map.js';
69
69
  export { AparteSelect, AparteOption, AparteOptgroup, type AparteSelectChangeDetail, type AparteOptgroupToggleEventDetail, AparteProgressSpinner, AparteIcon } from './primitives/index.js';
70
- export type { AparteBubbleRole, AparteMessage, AparteContextSummary, AparteCompactor, AparteCompactorRequest, AparteCompactorOutcome, AparteCompactorReason, AparteContentParser, AparteStreamBlock, AparteStreamBlockMatch, AparteSendEventDetail, AparteViewportConfig, AparteInputConfig, AparteThemeVariables, AparteStatus, AparteAttachment, AparteBubbleActionsConfig, AparteTurnSummaryOptions, AparteComposerToken, AparteAttachmentState, AparteMessageToken, AparteComposerCaret, AparteBubbleActionName, AparteSegment, AparteSegmentTypes, AparteSegmentType, AparteTextSegment, AparteSource, AparteCitation, AparteThinkingSegment, AparteCodeSegment, AparteSegmentRenderer, AparteSegmentMount, AparteCustomSegment, AparteToolCallSegment, AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteErrorSegment, AparteSegmentUpdateEventDetail, AparteAIProvider, AparteAIModel, AparteAIProviderConfigField, AparteAIProviderMetadata, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress, AparteModelChangeEventDetail, AparteApprovalModeChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteMessagePausedEventDetail, AparteMessageResumedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactStartEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteLinkClickEventDetail, AparteMessageInfoEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteFeedbackReasonEventDetail, AparteCollectCommandsEventDetail, AparteTriggerSelectEventDetail, AparteCommand, AparteCommandScope, AparteCommandContext, AparteActionEventDetail, AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteFinishReason, AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolMatcher, AparteToolDisplay, AparteToolDetails, AparteToolCallView, AparteMountedView, AparteToolMount, AparteToolApprovalRequestDetail, AparteChatImperativeApi, AparteUiHandle, AparteElementAttributes, AparteElementTagName, AparteAttrValue, AparteTemplateAttrs, AparteNoAttributes, AparteChatAttributes, AparteChatViewportAttributes, AparteChatBubbleAttributes, AparteChatStatusAttributes, AparteComposerAttributes, AparteComposerInputAttributes, AparteComposerActionAttributes, AparteComposerAddAttachmentAttributes, AparteComposerToolbarAttributes, AparteConversationListAttributes, AparteSelectAttributes, AparteOptionAttributes, AparteOptgroupAttributes, AparteProgressSpinnerAttributes, AparteContextAttributes, AparteIconAttributes, AparteScrollRailAttributes, AparteSidebarAttributes, AparteSplitAttributes, AparteLauncherAttributes, AparteSuggestionsAttributes, } from './types/index.js';
70
+ export type { AparteBubbleRole, AparteMessage, AparteContextSummary, AparteCompactor, AparteCompactorRequest, AparteCompactorOutcome, AparteCompactorReason, AparteContentParser, AparteStreamBlock, AparteStreamBlockMatch, AparteSendEventDetail, AparteViewportConfig, AparteInputConfig, AparteThemeVariables, AparteStatus, AparteAttachment, AparteBubbleActionsConfig, AparteTurnSummaryOptions, AparteComposerToken, AparteAttachmentState, AparteMessageToken, AparteComposerCaret, AparteBubbleActionName, AparteSegment, AparteSegmentTypes, AparteSegmentType, AparteTextSegment, AparteSource, AparteCitation, AparteThinkingSegment, AparteCodeSegment, AparteSegmentRenderer, AparteSegmentMount, AparteCustomSegment, AparteToolCallSegment, AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteErrorSegment, AparteSegmentUpdateEventDetail, AparteAIProvider, AparteAIModel, AparteAIProviderConfigField, AparteAIProviderMetadata, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress, AparteModelChangeEventDetail, AparteApprovalModeChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteMessagePausedEventDetail, AparteMessageResumedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactStartEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteLinkClickEventDetail, AparteMessageInfoEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteFeedbackReasonEventDetail, AparteCollectCommandsEventDetail, AparteTriggerSelectEventDetail, AparteCommand, AparteCommandScope, AparteCommandContext, AparteActionEventDetail, AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteFinishReason, AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRun, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolMatcher, AparteToolDisplay, AparteToolDetails, AparteToolLine, AparteToolCallView, AparteMountedView, AparteToolMount, AparteToolApprovalRequestDetail, AparteChatImperativeApi, AparteUiHandle, AparteElementAttributes, AparteElementTagName, AparteAttrValue, AparteTemplateAttrs, AparteNoAttributes, AparteChatAttributes, AparteChatViewportAttributes, AparteChatBubbleAttributes, AparteChatStatusAttributes, AparteComposerAttributes, AparteComposerInputAttributes, AparteComposerActionAttributes, AparteComposerAddAttachmentAttributes, AparteComposerToolbarAttributes, AparteConversationListAttributes, AparteSelectAttributes, AparteOptionAttributes, AparteOptgroupAttributes, AparteProgressSpinnerAttributes, AparteContextAttributes, AparteIconAttributes, AparteScrollRailAttributes, AparteSidebarAttributes, AparteSplitAttributes, AparteLauncherAttributes, AparteSuggestionsAttributes, } from './types/index.js';
71
71
  export { AparteErrorCode, AparteError, contentToText } from './types/index.js';
72
72
  export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, collectRendererStyles, registerDefaultRenderers, installDefaultRenderersOnce, declineDefaultRenderers, getAllRenderers, overrideSegmentRenderer, defineMountedToolRenderer, defineMountedSegmentRenderer, toToolCallView, renderCodeLanguages, renderCitations } from './renderers/index.js';
73
73
  export type { AparteRenderCodeLanguagesOptions } from './renderers/index.js';
@@ -122,11 +122,15 @@ export type { AparteFloatingOptions } from './utils/place-floating.js';
122
122
  export { uuid } from './utils/uuid.js';
123
123
  export { copyText } from './utils/copy-text.js';
124
124
  export { isSegmentSettled, segmentDuration, segmentTiming } from './utils/segments.js';
125
+ export { createSegmentList, type AparteSegmentList } from './utils/segment-list.js';
126
+ export { pluralize } from './utils/plural.js';
127
+ export { formatDuration } from './utils/format-duration.js';
125
128
  export type { AparteHostHandlersConfig } from './types/models.js';
126
129
  export type { AparteKeyProvider } from './config/aparte-config.js';
127
130
  export type { AparteClientOptions, AparteToolApprovalResolver } from './client/aparte-client.js';
128
131
  export { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';
129
- export { toolRefusal } from './client/stream-adapter.js';
132
+ export { toolRefusal, runSubAgent, startSubAgent } from './client/stream-adapter.js';
133
+ export type { AparteRunEventContext, AparteRunEventObserver } from './config/aparte-config.js';
130
134
  export { createAgentStreamRunner, type AgentStreamRunnerOptions } from './client/agent-runner.js';
131
135
  export type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';
132
136
  export { AparteDirectTransport, AparteBackendTransport, createAparteChatHandler, createAparteAgentHandler, isFormatAdapter } from './transport/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,6BAA6B,CAAC;AACrC,OAAO,2BAA2B,CAAC;AACnC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,CAAC;AACpC,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,gCAAgC,CAAC;AACxC,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AACtC,OAAO,6BAA6B,CAAC;AACrC,OAAO,8BAA8B,CAAC;AACtC,OAAO,gCAAgC,CAAC;AACxC,OAAO,0CAA0C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,MAAM,4BAA4B,CAAC;AAG5L,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACzJ,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG7Q,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,YAAY,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAGjF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAClI,YAAY,EACR,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC7B,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AA8FnF;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAKD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { K as deferHydrationOf, ae as resolveConfig, ap as eventOrigin, aq as activeElementIn, ak as subscribeConfigChange, ag as runWithConfig, o as AparteElicitationAbortError, w as buildApprovalPanel, x as buildElicitationPanel, ar as gateGlide, O as escapeAttr, H as cssEscape, ai as segmentTiming, as as chatBoundaryOf, at as relabelCodeLanguages, au as relabelCitations, av as toolCallRenderer, aw as toolRendererThatDrew, t as aparteGlobalConfig, ax as isMountedRenderer, ay as renderingVersionOf, az as onRenderersChange, aA as renderSourceList, aB as mergeSegmentUpdate, a0 as isSegmentSettled, aC as formatDuration, P as escapeHtml, aD as writeStreamedMarkdown, aE as replaceHighlighted, $ as isSafeUrl, C as copyText, V as getSegmentRenderer, X as installDefaultRenderersOnce, r as AparteMessageRepository, aF as CheckpointStateWatcher, aG as chatIdOf, aH as stampSegmentActivity, aI as stampSegmentOnInsert, aJ as stampSegmentOnUpdate, aK as renumberSegments, aL as openSegmentIds, aM as isTerminalStatus, aN as adoptMessageSegments, Z as isAwaitingReply, a6 as populateBubbleFromMessage, ao as uuid, af as revokeAttachmentUrls, a4 as parseMarkdownToSegments, aO as APARTE_DERIVED_SEGMENTS, aP as rememberConversationStatus, aQ as tellConversationStatus, aR as conversationStatusOf, e as APARTE_DEFAULT_LOCALE, a5 as placeFloating, aS as visibleReply, aT as usageTokens, q as AparteErrorCode, a1 as measureContext, aU as rootOf, aV as inRenderedContent, g as APARTE_HOST_ATTR, Y as installDialogTriggersOnce } from "./defer-hydration-lK-7XQXf.js";
2
- import { A, a, b, c, d, f, h, i, j, k, l, m, n, p, s, S, u, v, y, z, B, D, E, F, G, I, J, L, M, N, Q, R, T, U, W, _, a2, a3, a7, a8, a9, aa, ab, ac, ad, ah, aj, al, am, an } from "./defer-hydration-lK-7XQXf.js";
1
+ import { L as deferHydrationOf, ah as resolveConfig, au as eventOrigin, av as activeElementIn, ap as subscribeConfigChange, ak as runWithConfig, o as AparteElicitationAbortError, w as buildApprovalPanel, x as buildElicitationPanel, aw as gateGlide, P as escapeAttr, I as cssEscape, am as segmentTiming, ax as chatBoundaryOf, ay as relabelCodeLanguages, az as relabelCitations, aA as toolCallRenderer, aB as toolRendererThatDrew, t as aparteGlobalConfig, aC as isMountedRenderer, aD as renderingVersionOf, aE as onRenderersChange, aF as renderSourceList, aG as mergeSegmentUpdate, a2 as isSegmentSettled, a8 as pluralize, V as formatDuration, aH as toolNameOf, Q as escapeHtml, aI as writeStreamedMarkdown, aJ as replaceHighlighted, a1 as isSafeUrl, C as copyText, X as getSegmentRenderer, Z as installDefaultRenderersOnce, r as AparteMessageRepository, aK as CheckpointStateWatcher, aL as chatIdOf, aM as stampSegmentActivity, aN as stampSegmentOnInsert, aO as stampSegmentOnUpdate, aP as renumberSegments, aQ as openSegmentIds, aR as isTerminalStatus, aS as adoptMessageSegments, $ as isAwaitingReply, a9 as populateBubbleFromMessage, at as uuid, ai as revokeAttachmentUrls, a6 as parseMarkdownToSegments, aT as APARTE_DERIVED_SEGMENTS, aU as rememberConversationStatus, aV as tellConversationStatus, aW as conversationStatusOf, e as APARTE_DEFAULT_LOCALE, a7 as placeFloating, aX as visibleReply, aY as usageTokens, q as AparteErrorCode, a3 as measureContext, aZ as rootOf, a_ as inRenderedContent, g as APARTE_HOST_ATTR, _ as installDialogTriggersOnce } from "./defer-hydration-W4yhnyfc.js";
2
+ import { A, a, b, c, d, f, h, i, j, k, l, m, n, p, s, S, u, v, y, z, B, D, E, F, G, H, J, K, M, N, O, R, T, U, W, Y, a0, a4, a5, aa, ab, ac, ad, ae, af, ag, aj, al, an, ao, aq, ar, as } from "./defer-hydration-W4yhnyfc.js";
3
3
  function presenceOn(value) {
4
4
  return value === "" ? true : Boolean(value);
5
5
  }
@@ -1314,17 +1314,6 @@ deferHydrationOf(AparteChat);
1314
1314
  if (!customElements.get("aparte-chat")) {
1315
1315
  customElements.define("aparte-chat", AparteChat);
1316
1316
  }
1317
- function pluralize(forms, n2, tag) {
1318
- let category = "other";
1319
- try {
1320
- category = new Intl.PluralRules(tag).select(n2);
1321
- } catch {
1322
- }
1323
- const options = forms.split("|");
1324
- const named = (name) => options.find((form2) => form2.startsWith(`${name}:`));
1325
- const form = named(category) ?? named("other") ?? forms;
1326
- return form.slice(form.indexOf(":") + 1).replace("{n}", String(n2));
1327
- }
1328
1317
  function planTurns(items, roleOf) {
1329
1318
  const runs = [];
1330
1319
  let from = -1;
@@ -1394,7 +1383,7 @@ function draw(root, content, token) {
1394
1383
  }
1395
1384
  function drawMessageTokens(root, content, tokens) {
1396
1385
  if (root.querySelector(".aparte-inline-token")) return;
1397
- for (const token of [...tokens].sort((a4, b2) => b2.start - a4.start)) {
1386
+ for (const token of [...tokens].sort((a2, b2) => b2.start - a2.start)) {
1398
1387
  if (token.text) draw(root, content, token);
1399
1388
  }
1400
1389
  }
@@ -2566,16 +2555,9 @@ class AparteChatBubble extends HTMLElement {
2566
2555
  }
2567
2556
  return tools ? cfg.t("turnUsed").replace("{tools}", () => tools) : cfg.t("thought");
2568
2557
  }
2569
- /** What a call goes by on screen: the label the app gave it, else its identifier. */
2558
+ /** What a call goes by on screen — the name its row shows, through the same function. */
2570
2559
  _stepName(call) {
2571
- const name = call.toolCall?.name ?? "";
2572
- const label = this._cfg.getToolDisplay(name)?.label;
2573
- if (typeof label !== "function") return label ?? name;
2574
- try {
2575
- return label(call);
2576
- } catch {
2577
- return name;
2578
- }
2560
+ return toolNameOf(call, this._cfg).text;
2579
2561
  }
2580
2562
  _applySegmentUpdate(segmentId, segment, updates) {
2581
2563
  const el2 = this._segmentsEl ? rowOf(this._segmentsEl, segmentId) : null;
@@ -2972,19 +2954,19 @@ class AparteChatBubble extends HTMLElement {
2972
2954
  const customAttachment = this._cfg.getAttachmentRenderer?.();
2973
2955
  if (customAttachment) {
2974
2956
  this._attachmentsEl.replaceChildren();
2975
- for (const a4 of this._attachments) {
2976
- const el2 = segmentRenderResultToElement(runWithConfig(this._cfg, () => customAttachment(a4)));
2957
+ for (const a2 of this._attachments) {
2958
+ const el2 = segmentRenderResultToElement(runWithConfig(this._cfg, () => customAttachment(a2)));
2977
2959
  if (el2) this._attachmentsEl.appendChild(el2);
2978
2960
  }
2979
2961
  return;
2980
2962
  }
2981
- this._attachmentsEl.innerHTML = this._attachments.map((a4) => {
2982
- const name = escapeHtml(a4.name);
2983
- if (a4.type.startsWith("image/") && this._isShowableUrl(a4.url)) {
2984
- return `<div class="aparte-thumbnail aparte-thumb aparte-thumb--image" title="${name}" data-type="${escapeHtml(a4.type)}"><img class="aparte-thumbnail__image" src="${escapeHtml(a4.url)}" alt="${name}" loading="lazy" /><span class="aparte-thumb__name">${name}</span></div>`;
2963
+ this._attachmentsEl.innerHTML = this._attachments.map((a2) => {
2964
+ const name = escapeHtml(a2.name);
2965
+ if (a2.type.startsWith("image/") && this._isShowableUrl(a2.url)) {
2966
+ return `<div class="aparte-thumbnail aparte-thumb aparte-thumb--image" title="${name}" data-type="${escapeHtml(a2.type)}"><img class="aparte-thumbnail__image" src="${escapeHtml(a2.url)}" alt="${name}" loading="lazy" /><span class="aparte-thumb__name">${name}</span></div>`;
2985
2967
  }
2986
- const openable = this._isOpenableUrl(a4.url) ? ` data-url="${escapeHtml(a4.url)}"` : "";
2987
- return `<div class="aparte-thumbnail aparte-thumb aparte-thumb--file" title="${name}" data-type="${escapeHtml(a4.type)}"${openable}><span class="aparte-thumbnail__label">${escapeHtml(this._fileExt(a4.name))}</span><span class="aparte-thumb__name">${name}</span></div>`;
2968
+ const openable = this._isOpenableUrl(a2.url) ? ` data-url="${escapeHtml(a2.url)}"` : "";
2969
+ return `<div class="aparte-thumbnail aparte-thumb aparte-thumb--file" title="${name}" data-type="${escapeHtml(a2.type)}"${openable}><span class="aparte-thumbnail__label">${escapeHtml(this._fileExt(a2.name))}</span><span class="aparte-thumb__name">${name}</span></div>`;
2988
2970
  }).join("");
2989
2971
  const { attachmentPreview, filePreview } = this._cfg.getHostHandlers();
2990
2972
  const kinds = [attachmentPreview ? ".aparte-thumb--image" : "", filePreview ? ".aparte-thumb--file[data-url]" : ""].filter(Boolean);
@@ -3176,14 +3158,14 @@ class AparteChatBubble extends HTMLElement {
3176
3158
  const buttons = [];
3177
3159
  if (this._role === "user") {
3178
3160
  if (config.user) {
3179
- for (const a4 of config.user) buttons.push(this._actionButtonHtml(a4, icons, locale));
3161
+ for (const a2 of config.user) buttons.push(this._actionButtonHtml(a2, icons, locale));
3180
3162
  } else {
3181
3163
  if (config.copy) buttons.push(this._actionButtonHtml("copy", icons, locale));
3182
3164
  if (config.edit) buttons.push(this._actionButtonHtml("edit", icons, locale));
3183
3165
  }
3184
3166
  } else if (this._role === "assistant") {
3185
3167
  if (config.assistant) {
3186
- for (const a4 of config.assistant) buttons.push(this._actionButtonHtml(a4, icons, locale));
3168
+ for (const a2 of config.assistant) buttons.push(this._actionButtonHtml(a2, icons, locale));
3187
3169
  } else {
3188
3170
  if (config.copy) buttons.push(this._actionButtonHtml("copy", icons, locale));
3189
3171
  if (config.retry) buttons.push(this._actionButtonHtml("retry", icons, locale));
@@ -3279,16 +3261,16 @@ class AparteChatBubble extends HTMLElement {
3279
3261
  /** Append the registered custom action buttons for this bubble's role. */
3280
3262
  _appendCustomActions() {
3281
3263
  if (!this._actionBarEl) return;
3282
- for (const a4 of this._cfg.getActions("bubble")) {
3283
- const roles = a4.bubble?.roles ?? ["user", "assistant"];
3264
+ for (const a2 of this._cfg.getActions("bubble")) {
3265
+ const roles = a2.bubble?.roles ?? ["user", "assistant"];
3284
3266
  if (!roles.includes(this._role)) continue;
3285
3267
  const btn = document.createElement("button");
3286
3268
  btn.type = "button";
3287
3269
  btn.className = "aparte-btn aparte-btn--icon aparte-btn--sm aparte-action-btn aparte-action-custom";
3288
- btn.dataset["action"] = `custom:${a4.id}`;
3289
- btn.setAttribute("aria-label", a4.label);
3290
- btn.setAttribute("title", a4.label);
3291
- btn.innerHTML = a4.icon.startsWith("<") ? a4.icon : this._cfg.getIcon(a4.icon) ?? a4.iconFallback ?? "";
3270
+ btn.dataset["action"] = `custom:${a2.id}`;
3271
+ btn.setAttribute("aria-label", a2.label);
3272
+ btn.setAttribute("title", a2.label);
3273
+ btn.innerHTML = a2.icon.startsWith("<") ? a2.icon : this._cfg.getIcon(a2.icon) ?? a2.iconFallback ?? "";
3292
3274
  this._actionBarEl.appendChild(btn);
3293
3275
  }
3294
3276
  }
@@ -4166,10 +4148,10 @@ class AparteChatViewport extends HTMLElement {
4166
4148
  this._notifyBubble(messageId, "addSegment", stamped);
4167
4149
  this._autoScroll();
4168
4150
  }
4169
- updateSegment(a4, b2, c2) {
4151
+ updateSegment(a2, b2, c2) {
4170
4152
  const clientForm = c2 === void 0 && typeof b2 === "object";
4171
- const messageId = clientForm ? this._activeMessageId() : a4;
4172
- const segmentId = clientForm ? a4 : b2;
4153
+ const messageId = clientForm ? this._activeMessageId() : a2;
4154
+ const segmentId = clientForm ? a2 : b2;
4173
4155
  const updates = clientForm ? b2 : c2;
4174
4156
  if (!messageId) return;
4175
4157
  const message = this._repo.getMessageById(messageId);
@@ -4182,10 +4164,10 @@ class AparteChatViewport extends HTMLElement {
4182
4164
  this._notifyBubble(messageId, "updateSegment", { segmentId, updates: stamped });
4183
4165
  }
4184
4166
  }
4185
- removeSegment(a4, b2) {
4167
+ removeSegment(a2, b2) {
4186
4168
  const clientForm = b2 === void 0;
4187
- const messageId = clientForm ? this._activeMessageId() : a4;
4188
- const segmentId = clientForm ? a4 : b2;
4169
+ const messageId = clientForm ? this._activeMessageId() : a2;
4170
+ const segmentId = clientForm ? a2 : b2;
4189
4171
  if (!messageId || !segmentId) return;
4190
4172
  const message = this._repo.getMessageById(messageId);
4191
4173
  if (message?.segments) {
@@ -5102,6 +5084,15 @@ class AparteChatViewport extends HTMLElement {
5102
5084
  }
5103
5085
  _scrollToBottom() {
5104
5086
  if (!this._container) return;
5087
+ if (this._fitsOnceCentred()) {
5088
+ this._smoothScrollOnce = false;
5089
+ if (this._gliding()) {
5090
+ this._glideUntil = 0;
5091
+ this._ownScrollAt = performance.now();
5092
+ this._container.scrollTop = 0;
5093
+ }
5094
+ return;
5095
+ }
5105
5096
  if (this._smoothScrollOnce) {
5106
5097
  this._smoothScrollOnce = false;
5107
5098
  this._smoothScrollToBottom();
@@ -5115,6 +5106,18 @@ class AparteChatViewport extends HTMLElement {
5115
5106
  this._container.scrollTop = this._container.scrollHeight;
5116
5107
  this._settleAtBottom();
5117
5108
  }
5109
+ /** The transcript will fit once the room the centring spacer under the composer still
5110
+ * holds (`center-empty`, or a wrapper's auto-centre) is back. That room is 0 once the
5111
+ * slide is over, and outside those layouts. */
5112
+ _fitsOnceCentred() {
5113
+ if (!this._container) return false;
5114
+ const room = this._centringRoom();
5115
+ return room > 0 && this._container.scrollHeight - this._getSpacerHeight() <= this._container.clientHeight + room;
5116
+ }
5117
+ _centringRoom() {
5118
+ const host = this.closest("aparte-chat[center-empty], .aparte-chat-container--auto-center");
5119
+ return host ? parseFloat(getComputedStyle(host, "::after").height) || 0 : 0;
5120
+ }
5118
5121
  _gliding() {
5119
5122
  return performance.now() < this._glideUntil;
5120
5123
  }
@@ -5270,7 +5273,7 @@ class AparteChatViewport extends HTMLElement {
5270
5273
  const userRect = lastUserBubble.getBoundingClientRect();
5271
5274
  const userTopInContent = userRect.top - containerRect.top + this._container.scrollTop;
5272
5275
  const scrollHeightWithoutSpacer = this._container.scrollHeight - currentSpacerH;
5273
- if (scrollHeightWithoutSpacer <= this._container.clientHeight) {
5276
+ if (scrollHeightWithoutSpacer <= this._container.clientHeight + this._centringRoom()) {
5274
5277
  this._setSpacerHeight(0);
5275
5278
  return;
5276
5279
  }
@@ -7368,7 +7371,7 @@ class AparteConversationList extends HTMLElement {
7368
7371
  }
7369
7372
  }
7370
7373
  const fixed = ["pinned", "today", "yesterday", "week", "month"].map((k2) => buckets.get(k2)).filter((g) => !!g);
7371
- const months = [...buckets.keys()].filter((k2) => k2.startsWith("m-")).sort((a4, b2) => b2.localeCompare(a4)).map((k2) => buckets.get(k2));
7374
+ const months = [...buckets.keys()].filter((k2) => k2.startsWith("m-")).sort((a2, b2) => b2.localeCompare(a2)).map((k2) => buckets.get(k2));
7372
7375
  const undated = buckets.get("undated");
7373
7376
  return [...fixed, ...months, ...undated ? [undated] : []];
7374
7377
  }
@@ -7548,7 +7551,10 @@ class AparteConversationList extends HTMLElement {
7548
7551
  */
7549
7552
  _manage(event, run) {
7550
7553
  if (!this.hasAttribute("manage") || event.defaultPrevented) return;
7551
- const manager = resolveConfig(this).getConversationManager();
7554
+ const target = this.getAttribute("target");
7555
+ const root = this.getRootNode();
7556
+ const chat = target ? root.getElementById?.(target) ?? this.ownerDocument.getElementById(target) : null;
7557
+ const manager = resolveConfig(chat ?? this).getConversationManager();
7552
7558
  if (!manager) {
7553
7559
  if (this._warnedNoManager) return;
7554
7560
  this._warnedNoManager = true;
@@ -7749,9 +7755,10 @@ class AparteConversationList extends HTMLElement {
7749
7755
  const select = target.closest("[data-select-id]");
7750
7756
  if (select) {
7751
7757
  this._closeMenu();
7758
+ const targetId = this.getAttribute("target");
7752
7759
  this.dispatchEvent(new CustomEvent(
7753
7760
  "aparte-conversation-select",
7754
- { detail: { id: select.dataset["selectId"] }, bubbles: true, composed: true }
7761
+ { detail: { id: select.dataset["selectId"], ...targetId ? { targetId } : {} }, bubbles: true, composed: true }
7755
7762
  ));
7756
7763
  }
7757
7764
  };
@@ -9381,9 +9388,9 @@ function isBubble(node) {
9381
9388
  function holdsBubbles(nodes) {
9382
9389
  return Array.from(nodes).some((n2) => n2 instanceof Element && (isBubble(n2) || n2.localName === "aparte-chat-viewport" || n2.querySelector("aparte-chat-bubble") !== null));
9383
9390
  }
9384
- function sameElements(a4, b2) {
9385
- if (a4.length !== b2.length) return false;
9386
- for (let i2 = 0; i2 < a4.length; i2++) if (a4[i2] !== b2[i2]) return false;
9391
+ function sameElements(a2, b2) {
9392
+ if (a2.length !== b2.length) return false;
9393
+ for (let i2 = 0; i2 < a2.length; i2++) if (a2[i2] !== b2[i2]) return false;
9387
9394
  return true;
9388
9395
  }
9389
9396
  deferHydrationOf(AparteScrollRail);
@@ -9427,6 +9434,9 @@ class AparteSidebar extends HTMLElement {
9427
9434
  _hostIntentSeeded = false;
9428
9435
  /** Raised around `_applyDrawer`'s own writes, so the breakpoint is never read as a host's intent. */
9429
9436
  _auto = false;
9437
+ /** The floating chat this sidebar is in, if any: its size decides the drawer, not the window's. */
9438
+ _launcher = null;
9439
+ _launcherWatch = null;
9430
9440
  /**
9431
9441
  * The element wrote `inert`/`aria-hidden` and may take them back. A host that inerts
9432
9442
  * the sidebar behind its own modal wrote them itself, and `_syncHidden` runs on every
@@ -9445,7 +9455,7 @@ class AparteSidebar extends HTMLElement {
9445
9455
  set collapsed(value) {
9446
9456
  this.toggleAttribute("collapsed", presenceOn(value));
9447
9457
  }
9448
- /** True while the window is under the breakpoint and the sidebar is a drawer. */
9458
+ /** True while the sidebar is a drawer: the window is under the breakpoint, or it is in a floating chat's card. */
9449
9459
  get drawer() {
9450
9460
  return this.hasAttribute("data-drawer");
9451
9461
  }
@@ -9467,6 +9477,11 @@ class AparteSidebar extends HTMLElement {
9467
9477
  document.addEventListener("keydown", this._onKeydown);
9468
9478
  document.addEventListener("click", this._onDocumentClick);
9469
9479
  window.addEventListener("aparte-config-change", this._onConfigChange);
9480
+ this._launcher = this.closest("aparte-launcher");
9481
+ if (this._launcher && typeof MutationObserver === "function") {
9482
+ this._launcherWatch = new MutationObserver(() => this._followLauncher());
9483
+ this._launcherWatch.observe(this._launcher, { attributes: true, attributeFilter: ["open", "maximized", "maximizable"] });
9484
+ }
9470
9485
  this._watchBreakpoint();
9471
9486
  this._syncHidden();
9472
9487
  this._lastCollapsed = this.collapsed;
@@ -9483,15 +9498,55 @@ class AparteSidebar extends HTMLElement {
9483
9498
  this._media?.removeEventListener("change", this._onMediaChange);
9484
9499
  this._media = null;
9485
9500
  const attr = (this.getAttribute("breakpoint") ?? "").trim();
9486
- if (attr === "none") {
9487
- this._applyDrawer(false);
9501
+ if (attr !== "none" && typeof matchMedia === "function") {
9502
+ const query = attr ? `(max-width: ${attr})` : DRAWER_QUERY;
9503
+ this._media = matchMedia(query);
9504
+ this._media.addEventListener("change", this._onMediaChange);
9505
+ } else if (attr !== "none" && !this._launcher) {
9488
9506
  return;
9489
9507
  }
9490
- if (typeof matchMedia !== "function") return;
9491
- const query = attr ? `(max-width: ${attr})` : DRAWER_QUERY;
9492
- this._media = matchMedia(query);
9493
- this._media.addEventListener("change", this._onMediaChange);
9494
- this._applyDrawer(this._media.matches);
9508
+ this._applyDrawer(this._wantsDrawer());
9509
+ }
9510
+ /**
9511
+ * A drawer under the window's breakpoint, and in the card of a floating chat whatever
9512
+ * the window: the card is narrow in the widest one. `breakpoint="none"` is the host's
9513
+ * word for a column at any width, and it holds in a card too.
9514
+ */
9515
+ _wantsDrawer() {
9516
+ if ((this.getAttribute("breakpoint") ?? "").trim() === "none") return false;
9517
+ return (this._media?.matches ?? false) || this._inCard();
9518
+ }
9519
+ /**
9520
+ * In a floating chat that does not fill the window: its card, or the panel
9521
+ * `maximizable="panel"` runs along the window's edge, which is as narrow. Only as the
9522
+ * child of the card's shell, which is what holds the drawer there: anywhere else in a
9523
+ * card a drawer is fixed to the window, and one forced on a wide window would open over
9524
+ * the page the chat floats on.
9525
+ */
9526
+ _inCard() {
9527
+ const launcher = this._launcher;
9528
+ if (!launcher || !this._cardShell()) return false;
9529
+ return !(launcher.hasAttribute("maximized") && launcher.getAttribute("maximizable") !== "panel");
9530
+ }
9531
+ /**
9532
+ * The floating chat opened, closed or changed size. Its size decides the drawer, and a
9533
+ * drawer does not outlive the chat it is in: left open under a closed chat it would still
9534
+ * answer Escape for the whole page, and stand over the chat when it opens again.
9535
+ */
9536
+ _followLauncher() {
9537
+ this._applyDrawer(this._wantsDrawer());
9538
+ if (this.drawer && !this.collapsed && !this._launcher?.hasAttribute("open")) {
9539
+ this._opener = null;
9540
+ this.close();
9541
+ }
9542
+ }
9543
+ /**
9544
+ * The shell the scrim covers in a floating chat, when the sidebar is that shell's own
9545
+ * child: the stylesheet positions the drawer against it there (`sidebar.css`).
9546
+ */
9547
+ _cardShell() {
9548
+ const shell = this._launcher ? this.parentElement : null;
9549
+ return shell?.classList.contains("aparte-app-shell") ? shell : null;
9495
9550
  }
9496
9551
  disconnectedCallback() {
9497
9552
  this.removeEventListener("input", this._onInput);
@@ -9502,6 +9557,11 @@ class AparteSidebar extends HTMLElement {
9502
9557
  window.removeEventListener("aparte-config-change", this._onConfigChange);
9503
9558
  this._media?.removeEventListener("change", this._onMediaChange);
9504
9559
  this._media = null;
9560
+ this._launcherWatch?.disconnect();
9561
+ this._launcherWatch = null;
9562
+ this._launcher = null;
9563
+ this._scrim?.remove();
9564
+ this._scrim = null;
9505
9565
  this._ready = false;
9506
9566
  }
9507
9567
  attributeChangedCallback(name) {
@@ -9544,7 +9604,7 @@ class AparteSidebar extends HTMLElement {
9544
9604
  else this.close();
9545
9605
  }
9546
9606
  // ─── Drawer ───────────────────────────────────────────────────────────
9547
- _onMediaChange = (e) => this._applyDrawer(e.matches);
9607
+ _onMediaChange = () => this._applyDrawer(this._wantsDrawer());
9548
9608
  /**
9549
9609
  * Entering the drawer state closes the sidebar: a narrow window that opens on an
9550
9610
  * overlay covering the chat is the wrong first screen. Leaving it reopens, since
@@ -9552,6 +9612,7 @@ class AparteSidebar extends HTMLElement {
9552
9612
  */
9553
9613
  _applyDrawer(drawer) {
9554
9614
  const was = this.drawer;
9615
+ if (drawer !== was) this._opener = null;
9555
9616
  this.toggleAttribute("data-drawer", drawer);
9556
9617
  this._auto = true;
9557
9618
  try {
@@ -9630,7 +9691,13 @@ class AparteSidebar extends HTMLElement {
9630
9691
  this._scrim.className = "aparte-sidebar__scrim";
9631
9692
  this._scrim.setAttribute("aria-hidden", "true");
9632
9693
  this._scrim.addEventListener("click", () => this.close());
9633
- this.appendChild(this._scrim);
9694
+ const shell = this._cardShell();
9695
+ if (shell) {
9696
+ this._scrim.classList.add("aparte-sidebar__scrim--contained");
9697
+ shell.appendChild(this._scrim);
9698
+ } else {
9699
+ this.appendChild(this._scrim);
9700
+ }
9634
9701
  } else if (!wanted && this._scrim) {
9635
9702
  this._scrim.remove();
9636
9703
  this._scrim = null;
@@ -9639,6 +9706,7 @@ class AparteSidebar extends HTMLElement {
9639
9706
  _onKeydown = (e) => {
9640
9707
  if (!this.drawer || this.collapsed) return;
9641
9708
  if (e.key === "Escape") {
9709
+ if (e.defaultPrevented) return;
9642
9710
  e.preventDefault();
9643
9711
  this.close();
9644
9712
  return;
@@ -9735,7 +9803,7 @@ function visibleFocusable(root) {
9735
9803
  return Array.from(root.querySelectorAll(FOCUSABLE$1)).filter((el2) => !el2.closest("[hidden]") && el2.checkVisibility?.() !== false);
9736
9804
  }
9737
9805
  function nearestSidebar(control) {
9738
- return control.closest("aparte-sidebar") ?? rootOf(control).querySelector("aparte-sidebar") ?? document.querySelector("aparte-sidebar");
9806
+ return control.closest("aparte-sidebar") ?? control.closest(".aparte-app-shell")?.querySelector("aparte-sidebar") ?? rootOf(control).querySelector("aparte-sidebar") ?? document.querySelector("aparte-sidebar");
9739
9807
  }
9740
9808
  deferHydrationOf(AparteSidebar);
9741
9809
  if (!customElements.get("aparte-sidebar")) {
@@ -11109,10 +11177,14 @@ class AparteLauncher extends HTMLElement {
11109
11177
  return true;
11110
11178
  }
11111
11179
  }
11180
+ /** A sidebar open as a drawer inside the card: Escape closes it before it closes the chat. */
11181
+ _drawerOpen() {
11182
+ return this.querySelector("aparte-sidebar[data-drawer]:not([collapsed])") !== null;
11183
+ }
11112
11184
  _onKeydown = (e) => {
11113
11185
  if (!this.open) return;
11114
11186
  if (e.key === "Escape") {
11115
- if (e.defaultPrevented || e.isComposing || e.keyCode === 229 || this._inModalDialog(e)) return;
11187
+ if (e.defaultPrevented || e.isComposing || e.keyCode === 229 || this._inModalDialog(e) || this._drawerOpen()) return;
11116
11188
  e.preventDefault();
11117
11189
  if (this.maximized && !this.sheet) this.maximized = false;
11118
11190
  else this.close();
@@ -11278,52 +11350,57 @@ export {
11278
11350
  D as createAgentStreamRunner,
11279
11351
  E as createAparteAgentHandler,
11280
11352
  F as createAparteChatHandler,
11281
- G as createStreamAdapter,
11353
+ G as createSegmentList,
11354
+ H as createStreamAdapter,
11282
11355
  cssEscape,
11283
- I as declineDefaultRenderers,
11284
- J as defaultSanitizer,
11356
+ J as declineDefaultRenderers,
11357
+ K as defaultSanitizer,
11285
11358
  deferHydrationOf,
11286
- L as defineMountedSegmentRenderer,
11287
- M as defineMountedToolRenderer,
11288
- N as detachConfig,
11359
+ M as defineMountedSegmentRenderer,
11360
+ N as defineMountedToolRenderer,
11361
+ O as detachConfig,
11289
11362
  escapeAttr,
11290
11363
  escapeHtml,
11291
- Q as estimateTokens,
11292
- R as estimateWireTokens,
11293
- T as filesToAttachments,
11294
- U as getAllRenderers,
11364
+ R as estimateTokens,
11365
+ T as estimateWireTokens,
11366
+ U as filesToAttachments,
11367
+ formatDuration,
11368
+ W as getAllRenderers,
11295
11369
  getSegmentRenderer,
11296
- W as historyFromCheckpoint,
11370
+ Y as historyFromCheckpoint,
11297
11371
  installDefaultRenderersOnce,
11298
11372
  installDialogTriggersOnce,
11299
11373
  isAwaitingReply,
11300
- _ as isFormatAdapter,
11374
+ a0 as isFormatAdapter,
11301
11375
  isSafeUrl,
11302
11376
  isSegmentSettled,
11303
11377
  measureContext,
11304
- a2 as overrideSegmentRenderer,
11305
- a3 as parseAparteEventStream,
11378
+ a4 as overrideSegmentRenderer,
11379
+ a5 as parseAparteEventStream,
11306
11380
  parseMarkdownToSegments,
11307
11381
  placeFloating,
11382
+ pluralize,
11308
11383
  populateBubbleFromMessage,
11309
- a7 as readableToAsyncIterable,
11384
+ aa as readableToAsyncIterable,
11310
11385
  registerAllComponents,
11311
- a8 as registerDefaultRenderers,
11312
- a9 as registerSegmentRenderer,
11313
- aa as releaseDeferredHydration,
11314
- ab as renderCitations,
11315
- ac as renderCodeLanguages,
11316
- ad as requestUserInput,
11386
+ ab as registerDefaultRenderers,
11387
+ ac as registerSegmentRenderer,
11388
+ ad as releaseDeferredHydration,
11389
+ ae as renderCitations,
11390
+ af as renderCodeLanguages,
11391
+ ag as requestUserInput,
11317
11392
  resolveConfig,
11318
11393
  revokeAttachmentUrls,
11394
+ aj as runSubAgent,
11319
11395
  runWithConfig,
11320
- ah as segmentDuration,
11396
+ al as segmentDuration,
11321
11397
  segmentTiming,
11322
- aj as setupSuggestionBlocks,
11398
+ an as setupSuggestionBlocks,
11399
+ ao as startSubAgent,
11323
11400
  subscribeConfigChange,
11324
- al as toToolCallView,
11325
- am as toolRefusal,
11326
- an as unregisterSegmentRenderer,
11401
+ aq as toToolCallView,
11402
+ ar as toolRefusal,
11403
+ as as unregisterSegmentRenderer,
11327
11404
  uuid
11328
11405
  };
11329
11406
  //# sourceMappingURL=index.js.map