@aparte/core 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/components/composer/aparte-composer-action.d.ts +10 -1
  2. package/dist/components/composer/aparte-composer-action.d.ts.map +1 -1
  3. package/dist/components/composer/aparte-composer.d.ts +29 -2
  4. package/dist/components/composer/aparte-composer.d.ts.map +1 -1
  5. package/dist/components/elicitation/aparte-elicitation.d.ts +2 -2
  6. package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -1
  7. package/dist/config/aparte-config.d.ts +52 -14
  8. package/dist/config/aparte-config.d.ts.map +1 -1
  9. package/dist/config/sanitize.d.ts.map +1 -1
  10. package/dist/custom-elements.json +7225 -7107
  11. package/dist/generated/element-attributes.d.ts +5 -1
  12. package/dist/generated/element-attributes.d.ts.map +1 -1
  13. package/dist/host/aparte-chat-host.d.ts +22 -21
  14. package/dist/host/aparte-chat-host.d.ts.map +1 -1
  15. package/dist/index.css +9 -3
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +43 -17
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.node.d.ts +1 -0
  21. package/dist/index.node.d.ts.map +1 -1
  22. package/dist/index.node.js +1 -1
  23. package/dist/index.node.js.map +1 -1
  24. package/dist/interop/element-props.d.ts +14 -1
  25. package/dist/interop/element-props.d.ts.map +1 -1
  26. package/dist/{is-awaiting-reply-Cb7H3YfN.js → is-awaiting-reply-BWTDvQ__.js} +154 -31
  27. package/dist/is-awaiting-reply-BWTDvQ__.js.map +1 -0
  28. package/dist/renderers/segments/tool-call.d.ts.map +1 -1
  29. package/dist/types/tools.d.ts +11 -2
  30. package/dist/types/tools.d.ts.map +1 -1
  31. package/dist/utils/chat-boundary.d.ts +22 -0
  32. package/dist/utils/chat-boundary.d.ts.map +1 -0
  33. package/package.json +1 -1
  34. package/dist/is-awaiting-reply-Cb7H3YfN.js.map +0 -1
@@ -45,6 +45,7 @@ export type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget,
45
45
  export { AparteMessageRepository } from './runtime/message-repository.js';
46
46
  export type { ExportedMessageRepository } from './runtime/message-repository.js';
47
47
  export { applyElementProps, APARTE_DEFAULT_UI_EVENTS } from './interop/element-props.js';
48
+ export type { AparteUiEventName } from './interop/element-props.js';
48
49
  export { filesToAttachments, revokeAttachmentUrls } from './utils/files-to-attachments.js';
49
50
  import './types/event-map.js';
50
51
  import './types/element-map.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACR,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EAIrB,8BAA8B,EAC9B,gBAAgB,EAChB,aAAa,EACb,2BAA2B,EAC3B,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,kCAAkC,EAClC,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,iBAAiB,EACjB,+BAA+B,EAC/B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,mCAAm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,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAa3F,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wBAAwB,CAAC;AAGhC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI3D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAIvF,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,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;AAEhC;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
@@ -1,4 +1,4 @@
1
- import { A, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6 } from "./is-awaiting-reply-Cb7H3YfN.js";
1
+ import { A, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6 } from "./is-awaiting-reply-BWTDvQ__.js";
2
2
  function registerAllComponents() {
3
3
  }
4
4
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.js","sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @aparte/core — Node.js / SSR-safe entry point.\n *\n * Resolved via the `node` export condition, so `import '@aparte/core'` in Node\n * (Next.js / Nuxt / Angular Universal / SvelteKit server, tsx, CLI tools) loads\n * THIS module instead of the browser entry. It exposes the same public API\n * surface MINUS the Web Components and CSS side-effects — importing the real\n * `index.ts` in Node throws `HTMLElement is not defined` because the custom\n * elements extend `HTMLElement` at module scope.\n *\n * Everything re-exported here is DOM-free at import time. Custom-element CLASSES\n * (AparteChatBubble, AparteComposer*, AparteSelect, …) are intentionally NOT exported\n * as runtime values — they only exist in the browser build. Their TYPES are\n * re-exported (types are erased, so they never pull DOM at runtime), which keeps\n * TypeScript consumers fully typed on the server; `registerAllComponents()` is a\n * no-op here (there is nothing to register without a DOM).\n */\n\n// ── Types (erased at runtime — always safe, mirror index.ts) ────────────────\nexport type {\n AparteBubbleRole,\n AparteMessage,\n AparteContentParser,\n AparteSendEventDetail,\n AparteViewportConfig,\n AparteInputConfig,\n AparteThemeVariables,\n AparteStatus,\n AparteAttachment,\n AparteMessageBranch,\n AparteBubbleActionsConfig,\n AparteBubbleActionName,\n AparteSegment,\n AparteSegmentType,\n AparteTextSegment,\n AparteThinkingSegment,\n AparteCodeSegment,\n AparteSegmentRenderer,\n AparteCustomSegment,\n AparteToolCallSegment,\n AparteArtifactSegment,\n // The detail of the `aparte-segment-update` event. It reached types/index.ts and\n // stopped there — and types/index.ts is not an entry point, so a consumer could\n // bind the event (it is in the published event table) and never name its detail.\n AparteSegmentUpdateEventDetail,\n AparteAIProvider,\n AparteAIModel,\n AparteAIProviderConfigField,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageStartEventDetail,\n AparteMessageErrorEventDetail,\n AparteMessageAbortedEventDetail,\n AparteAbortEventDetail,\n AparteCompactEventDetail,\n AparteCompactDoneEventDetail,\n AparteCompactErrorEventDetail,\n AparteAttachmentPreviewEventDetail,\n AparteFileGenReadyEventDetail,\n AparteFileGenErrorEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteArtifactStartEventDetail,\n AparteArtifactDeltaEventDetail,\n AparteArtifactReadyEventDetail,\n AparteArtifactRedownloadEventDetail,\n AparteChatRequest,\n AparteChatResponse,\n AparteChatMessage,\n AparteContentPart,\n AparteTextPart,\n AparteImagePart,\n AparteFilePart,\n AparteStreamEvent,\n AparteStreamEventMap,\n AparteUsage,\n AparteTool,\n AparteToolCall,\n AparteToolResult,\n AparteToolHandler,\n AparteToolContext,\n AparteToolRenderer,\n AparteToolApprovalRequestDetail,\n AparteChatImperativeApi,\n AparteElementAttributes,\n AparteElementTagName,\n AparteAttrValue,\n AparteTemplateAttrs,\n AparteNoAttributes,\n AparteChatAttributes,\n AparteChatViewportAttributes,\n AparteChatBubbleAttributes,\n AparteChatStatusAttributes,\n AparteComposerAttributes,\n AparteComposerInputAttributes,\n AparteComposerActionAttributes,\n AparteComposerAddAttachmentAttributes,\n AparteComposerToolbarAttributes,\n AparteConversationListAttributes,\n AparteSelectAttributes,\n AparteOptionAttributes,\n AparteOptgroupAttributes,\n AparteProgressSpinnerAttributes,\n} from './types/index.js';\nexport { AparteErrorCode, AparteError, contentToText } from './types/index.js';\n\n// Custom-element TYPES (erased) — keep server consumers fully typed.\nexport type { AparteSelectChangeDetail, AparteOptgroupToggleEventDetail } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteActionClickEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail } from './components/index.js';\n\n// ── Renderers (produce HTML strings; DOM-free at import) ────────────────────\nexport {\n registerSegmentRenderer,\n unregisterSegmentRenderer,\n getSegmentRenderer,\n collectRendererStyles,\n registerDefaultRenderers,\n installDefaultRenderersOnce,\n declineDefaultRenderers,\n getAllRenderers,\n} from './renderers/index.js';\n\n// `populateBubbleFromMessage` is a plain helper — import it from its own module,\n// NOT the components barrel (which would pull in the HTMLElement classes).\nexport { populateBubbleFromMessage } from './components/bubble/bubble-sync.js';\n\n// ── Conversations (types, adapter contract, manager, controller) ────────────\nexport type {\n AparteConversation,\n AparteConversationMeta,\n AparteStorageAdapter,\n AparteMemoryFact,\n AparteArtifactRow,\n AparteAttachmentRow,\n} from './conversations/index.js';\nexport { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';\nexport { AparteConversationManager, type ConversationManagerOptions } from './conversations/index.js';\nexport {\n AparteConversationController,\n type AparteChatBinding,\n type AparteConversationControllerOptions,\n} from './conversations/index.js';\n\n// ── Framework-agnostic chat-host orchestrator (every wrapper binds to it) ───\nexport {\n AparteChatHost,\n type AparteChatHostBinding,\n type AparteChatHostOptions,\n} from './host/index.js';\n\n// ── Parsers ─────────────────────────────────────────────────────────────────\nexport { AparteStreamParser, parseMarkdownToSegments, deriveArtifactKind, parseAparteEventStream } from './parsers/index.js';\nexport type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './parsers/index.js';\n\n// Transport seam — DOM-free (fetch-based), so the whole seam is SSR-safe. The\n// server-side `/api/chat` handler AND both client transports live here; a browser\n// never runs the handler, and the transports touch no DOM at import. Mirrored in\n// full so a wrapper barrel re-exporting a transport can't crash under SSR.\nexport { AparteDirectTransport, AparteBackendTransport, createAparteChatHandler, isFormatAdapter } from './transport/index.js';\nexport type {\n AparteTransport,\n AparteTransportContext,\n AparteFormatAdapter,\n AparteVendorRequest,\n BackendTransportOptions,\n DirectTransportOptions,\n AparteChatHandlerOptions,\n} from './transport/index.js';\n\n// ── Config ──────────────────────────────────────────────────────────────────\nexport { aparteGlobalConfig, AparteConfig, APARTE_DEFAULT_BUBBLE_ACTIONS, APARTE_DEFAULT_HOST_HANDLERS } from './config/index.js';\nexport type { AparteConfigChangeEventDetail } from './config/index.js';\nexport { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';\nexport { subscribeConfigChange, APARTE_CONFIG_CHANGE } from './config/index.js';\nexport type { AparteConfigAware } from './config/index.js';\nexport type {\n AparteMarkdownProvider,\n AparteStreamingMarkdownProvider,\n AparteStreamingMarkdownRenderer,\n AparteHighlightProvider,\n AparteSystemPromptVarsProvider,\n AparteSkeletonProvider,\n AparteSkeletonType,\n AparteLocale,\n AparteAction,\n AparteActionZone,\n AparteIconProvider,\n AparteIconName,\n AparteAvatarProvider,\n AparteStatusRenderer,\n AparteErrorRenderer,\n AparteAttachmentRenderer,\n AparteElicitationFieldRenderer,\n AparteElicitationFieldContext,\n AparteElicitationFieldControl,\n AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteArtifactPreviewBuilder,\n AparteSanitizer,\n} from './config/index.js';\nexport { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_SKELETON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';\n\n// ── Client + runtime ─────────────────────────────────────────────────────────\nexport { AparteClient } from './client/aparte-client.js';\nexport type { AparteClientOptions, AparteToolApprovalResolver, AparteCompactionSelector } from './client/aparte-client.js';\nexport { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';\nexport type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';\nexport { AparteMessageRepository } from './runtime/message-repository.js';\nexport type { ExportedMessageRepository } from './runtime/message-repository.js';\n\n// ── Wrapper interop (DOM-free helpers the four wrappers' AparteUi value-imports) ─\n// `applyElementProps`/`APARTE_DEFAULT_UI_EVENTS` are pure (a string array + a function that\n// only touches its `HTMLElement` argument when CALLED, never at import). They MUST be\n// on the Node surface: every wrapper barrel re-exports `AparteUi`, which value-imports\n// these two — omit them here and any SSR toolchain resolving the `node` condition\n// crashes the whole barrel with \"does not provide an export named 'applyElementProps'\".\nexport { applyElementProps, APARTE_DEFAULT_UI_EVENTS } from './interop/element-props.js';\n// Same rule: DOM-free at import (it only reaches for `URL.createObjectURL` when\n// CALLED, which is a browser-side concern), so it belongs on the SSR surface too.\nexport { filesToAttachments, revokeAttachmentUrls } from './utils/files-to-attachments.js';\n\n/*\n * The global type augmentations, which only the BROWSER entry pulled in.\n *\n * TypeScript applies the `node` export condition under `moduleResolution: node16`\n * / `nodenext`, so a consumer in that mode resolves `index.node.d.ts` — and\n * silently lost typed `e.detail` on every aparté event and typed\n * `querySelector('aparte-…')`. Not a runtime concern and not an SSR hazard: both\n * modules are `import type` throughout, so nothing is emitted and no DOM global is\n * touched. `check:node-barrel-types` diffed export NAMES, which an augmentation\n * has none of, so it saw nothing.\n */\nimport './types/event-map.js';\nimport './types/element-map.js';\n// Is a message waiting for a reply? Shared by the viewport, the four wrappers and\n// any consumer rendering its own bubble — one rule, so they can't disagree.\nexport { isAwaitingReply } from './utils/is-awaiting-reply.js';\nexport { escapeHtml, escapeAttr } from './utils/escape.js';\n// Same reasoning as the browser barrel: the gate script and the customization\n// guide both tell a renderer author to use `cssEscape` for a selector, so it has to\n// be importable. It touches no DOM, so the SSR barrel carries it too.\nexport { cssEscape } from './utils/css-escape.js';\nexport { uuid } from './utils/uuid.js';\n// Pure and DOM-free, so the SSR barrel carries it too — and that is the point: a\n// consumer can assert their own duration logic in Node, with no browser.\nexport { isSegmentSettled, segmentTiming, segmentDuration } from './utils/segments.js';\n// The PARAMETER types of two documented setters. They existed and were the declared\n// argument types, but were not exported — so anyone typing a settings layer over\n// `setHostHandlers` / `setKeyProvider` had to re-declare the shape by hand.\nexport type { AparteHostHandlersConfig } from './types/models.js';\nexport type { AparteKeyProvider } from './config/aparte-config.js';\n\n// Elicitation (human-in-the-loop typed input) — DOM-free at import.\nexport { requestUserInput, buildElicitationPanel, buildApprovalPanel, AparteElicitationAbortError } from './elicitation/index.js';\nexport type {\n AparteElicitationSchema,\n AparteElicitationField,\n AparteElicitationEnumField,\n AparteElicitationBooleanField,\n AparteElicitationStringField,\n AparteElicitationObjectSchema,\n AparteElicitationRequest,\n AparteElicitationResult,\n AparteElicitationPresenter,\n AparteApprovalOption,\n AparteApprovalAnswer,\n BuiltApprovalPanel,\n BuiltElicitationPanel,\n} from './elicitation/index.js';\n\n/**\n * No-op on the server: custom elements only exist in the browser, where the\n * real `index.ts` registers them at import time. Wrappers can call this\n * unconditionally without a `typeof window` guard.\n */\nexport function registerAllComponents(): void {\n /* browser-only — nothing to register without a DOM */\n}\n"],"names":[],"mappings":";AAgSO,SAAS,wBAA8B;AAE9C;"}
1
+ {"version":3,"file":"index.node.js","sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @aparte/core — Node.js / SSR-safe entry point.\n *\n * Resolved via the `node` export condition, so `import '@aparte/core'` in Node\n * (Next.js / Nuxt / Angular Universal / SvelteKit server, tsx, CLI tools) loads\n * THIS module instead of the browser entry. It exposes the same public API\n * surface MINUS the Web Components and CSS side-effects — importing the real\n * `index.ts` in Node throws `HTMLElement is not defined` because the custom\n * elements extend `HTMLElement` at module scope.\n *\n * Everything re-exported here is DOM-free at import time. Custom-element CLASSES\n * (AparteChatBubble, AparteComposer*, AparteSelect, …) are intentionally NOT exported\n * as runtime values — they only exist in the browser build. Their TYPES are\n * re-exported (types are erased, so they never pull DOM at runtime), which keeps\n * TypeScript consumers fully typed on the server; `registerAllComponents()` is a\n * no-op here (there is nothing to register without a DOM).\n */\n\n// ── Types (erased at runtime — always safe, mirror index.ts) ────────────────\nexport type {\n AparteBubbleRole,\n AparteMessage,\n AparteContentParser,\n AparteSendEventDetail,\n AparteViewportConfig,\n AparteInputConfig,\n AparteThemeVariables,\n AparteStatus,\n AparteAttachment,\n AparteMessageBranch,\n AparteBubbleActionsConfig,\n AparteBubbleActionName,\n AparteSegment,\n AparteSegmentType,\n AparteTextSegment,\n AparteThinkingSegment,\n AparteCodeSegment,\n AparteSegmentRenderer,\n AparteCustomSegment,\n AparteToolCallSegment,\n AparteArtifactSegment,\n // The detail of the `aparte-segment-update` event. It reached types/index.ts and\n // stopped there — and types/index.ts is not an entry point, so a consumer could\n // bind the event (it is in the published event table) and never name its detail.\n AparteSegmentUpdateEventDetail,\n AparteAIProvider,\n AparteAIModel,\n AparteAIProviderConfigField,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageStartEventDetail,\n AparteMessageErrorEventDetail,\n AparteMessageAbortedEventDetail,\n AparteAbortEventDetail,\n AparteCompactEventDetail,\n AparteCompactDoneEventDetail,\n AparteCompactErrorEventDetail,\n AparteAttachmentPreviewEventDetail,\n AparteFileGenReadyEventDetail,\n AparteFileGenErrorEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteArtifactStartEventDetail,\n AparteArtifactDeltaEventDetail,\n AparteArtifactReadyEventDetail,\n AparteArtifactRedownloadEventDetail,\n AparteChatRequest,\n AparteChatResponse,\n AparteChatMessage,\n AparteContentPart,\n AparteTextPart,\n AparteImagePart,\n AparteFilePart,\n AparteStreamEvent,\n AparteStreamEventMap,\n AparteUsage,\n AparteTool,\n AparteToolCall,\n AparteToolResult,\n AparteToolHandler,\n AparteToolContext,\n AparteToolRenderer,\n AparteToolApprovalRequestDetail,\n AparteChatImperativeApi,\n AparteElementAttributes,\n AparteElementTagName,\n AparteAttrValue,\n AparteTemplateAttrs,\n AparteNoAttributes,\n AparteChatAttributes,\n AparteChatViewportAttributes,\n AparteChatBubbleAttributes,\n AparteChatStatusAttributes,\n AparteComposerAttributes,\n AparteComposerInputAttributes,\n AparteComposerActionAttributes,\n AparteComposerAddAttachmentAttributes,\n AparteComposerToolbarAttributes,\n AparteConversationListAttributes,\n AparteSelectAttributes,\n AparteOptionAttributes,\n AparteOptgroupAttributes,\n AparteProgressSpinnerAttributes,\n} from './types/index.js';\nexport { AparteErrorCode, AparteError, contentToText } from './types/index.js';\n\n// Custom-element TYPES (erased) — keep server consumers fully typed.\nexport type { AparteSelectChangeDetail, AparteOptgroupToggleEventDetail } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteActionClickEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail } from './components/index.js';\n\n// ── Renderers (produce HTML strings; DOM-free at import) ────────────────────\nexport {\n registerSegmentRenderer,\n unregisterSegmentRenderer,\n getSegmentRenderer,\n collectRendererStyles,\n registerDefaultRenderers,\n installDefaultRenderersOnce,\n declineDefaultRenderers,\n getAllRenderers,\n} from './renderers/index.js';\n\n// `populateBubbleFromMessage` is a plain helper — import it from its own module,\n// NOT the components barrel (which would pull in the HTMLElement classes).\nexport { populateBubbleFromMessage } from './components/bubble/bubble-sync.js';\n\n// ── Conversations (types, adapter contract, manager, controller) ────────────\nexport type {\n AparteConversation,\n AparteConversationMeta,\n AparteStorageAdapter,\n AparteMemoryFact,\n AparteArtifactRow,\n AparteAttachmentRow,\n} from './conversations/index.js';\nexport { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';\nexport { AparteConversationManager, type ConversationManagerOptions } from './conversations/index.js';\nexport {\n AparteConversationController,\n type AparteChatBinding,\n type AparteConversationControllerOptions,\n} from './conversations/index.js';\n\n// ── Framework-agnostic chat-host orchestrator (every wrapper binds to it) ───\nexport {\n AparteChatHost,\n type AparteChatHostBinding,\n type AparteChatHostOptions,\n} from './host/index.js';\n\n// ── Parsers ─────────────────────────────────────────────────────────────────\nexport { AparteStreamParser, parseMarkdownToSegments, deriveArtifactKind, parseAparteEventStream } from './parsers/index.js';\nexport type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './parsers/index.js';\n\n// Transport seam — DOM-free (fetch-based), so the whole seam is SSR-safe. The\n// server-side `/api/chat` handler AND both client transports live here; a browser\n// never runs the handler, and the transports touch no DOM at import. Mirrored in\n// full so a wrapper barrel re-exporting a transport can't crash under SSR.\nexport { AparteDirectTransport, AparteBackendTransport, createAparteChatHandler, isFormatAdapter } from './transport/index.js';\nexport type {\n AparteTransport,\n AparteTransportContext,\n AparteFormatAdapter,\n AparteVendorRequest,\n BackendTransportOptions,\n DirectTransportOptions,\n AparteChatHandlerOptions,\n} from './transport/index.js';\n\n// ── Config ──────────────────────────────────────────────────────────────────\nexport { aparteGlobalConfig, AparteConfig, APARTE_DEFAULT_BUBBLE_ACTIONS, APARTE_DEFAULT_HOST_HANDLERS } from './config/index.js';\nexport type { AparteConfigChangeEventDetail } from './config/index.js';\nexport { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';\nexport { subscribeConfigChange, APARTE_CONFIG_CHANGE } from './config/index.js';\nexport type { AparteConfigAware } from './config/index.js';\nexport type {\n AparteMarkdownProvider,\n AparteStreamingMarkdownProvider,\n AparteStreamingMarkdownRenderer,\n AparteHighlightProvider,\n AparteSystemPromptVarsProvider,\n AparteSkeletonProvider,\n AparteSkeletonType,\n AparteLocale,\n AparteAction,\n AparteActionZone,\n AparteIconProvider,\n AparteIconName,\n AparteAvatarProvider,\n AparteStatusRenderer,\n AparteErrorRenderer,\n AparteAttachmentRenderer,\n AparteElicitationFieldRenderer,\n AparteElicitationFieldContext,\n AparteElicitationFieldControl,\n AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteArtifactPreviewBuilder,\n AparteSanitizer,\n} from './config/index.js';\nexport { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_SKELETON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';\n\n// ── Client + runtime ─────────────────────────────────────────────────────────\nexport { AparteClient } from './client/aparte-client.js';\nexport type { AparteClientOptions, AparteToolApprovalResolver, AparteCompactionSelector } from './client/aparte-client.js';\nexport { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';\nexport type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';\nexport { AparteMessageRepository } from './runtime/message-repository.js';\nexport type { ExportedMessageRepository } from './runtime/message-repository.js';\n\n// ── Wrapper interop (DOM-free helpers the four wrappers' AparteUi value-imports) ─\n// `applyElementProps`/`APARTE_DEFAULT_UI_EVENTS` are pure (a string array + a function that\n// only touches its `HTMLElement` argument when CALLED, never at import). They MUST be\n// on the Node surface: every wrapper barrel re-exports `AparteUi`, which value-imports\n// these two — omit them here and any SSR toolchain resolving the `node` condition\n// crashes the whole barrel with \"does not provide an export named 'applyElementProps'\".\nexport { applyElementProps, APARTE_DEFAULT_UI_EVENTS } from './interop/element-props.js';\n// A type, so it costs nothing here and its absence WAS a compile error for an SSR\n// consumer — `check:node-barrel-types` caught it the moment the browser barrel gained it.\nexport type { AparteUiEventName } from './interop/element-props.js';\n// Same rule: DOM-free at import (it only reaches for `URL.createObjectURL` when\n// CALLED, which is a browser-side concern), so it belongs on the SSR surface too.\nexport { filesToAttachments, revokeAttachmentUrls } from './utils/files-to-attachments.js';\n\n/*\n * The global type augmentations, which only the BROWSER entry pulled in.\n *\n * TypeScript applies the `node` export condition under `moduleResolution: node16`\n * / `nodenext`, so a consumer in that mode resolves `index.node.d.ts` — and\n * silently lost typed `e.detail` on every aparté event and typed\n * `querySelector('aparte-…')`. Not a runtime concern and not an SSR hazard: both\n * modules are `import type` throughout, so nothing is emitted and no DOM global is\n * touched. `check:node-barrel-types` diffed export NAMES, which an augmentation\n * has none of, so it saw nothing.\n */\nimport './types/event-map.js';\nimport './types/element-map.js';\n// Is a message waiting for a reply? Shared by the viewport, the four wrappers and\n// any consumer rendering its own bubble — one rule, so they can't disagree.\nexport { isAwaitingReply } from './utils/is-awaiting-reply.js';\nexport { escapeHtml, escapeAttr } from './utils/escape.js';\n// Same reasoning as the browser barrel: the gate script and the customization\n// guide both tell a renderer author to use `cssEscape` for a selector, so it has to\n// be importable. It touches no DOM, so the SSR barrel carries it too.\nexport { cssEscape } from './utils/css-escape.js';\nexport { uuid } from './utils/uuid.js';\n// Pure and DOM-free, so the SSR barrel carries it too — and that is the point: a\n// consumer can assert their own duration logic in Node, with no browser.\nexport { isSegmentSettled, segmentTiming, segmentDuration } from './utils/segments.js';\n// The PARAMETER types of two documented setters. They existed and were the declared\n// argument types, but were not exported — so anyone typing a settings layer over\n// `setHostHandlers` / `setKeyProvider` had to re-declare the shape by hand.\nexport type { AparteHostHandlersConfig } from './types/models.js';\nexport type { AparteKeyProvider } from './config/aparte-config.js';\n\n// Elicitation (human-in-the-loop typed input) — DOM-free at import.\nexport { requestUserInput, buildElicitationPanel, buildApprovalPanel, AparteElicitationAbortError } from './elicitation/index.js';\nexport type {\n AparteElicitationSchema,\n AparteElicitationField,\n AparteElicitationEnumField,\n AparteElicitationBooleanField,\n AparteElicitationStringField,\n AparteElicitationObjectSchema,\n AparteElicitationRequest,\n AparteElicitationResult,\n AparteElicitationPresenter,\n AparteApprovalOption,\n AparteApprovalAnswer,\n BuiltApprovalPanel,\n BuiltElicitationPanel,\n} from './elicitation/index.js';\n\n/**\n * No-op on the server: custom elements only exist in the browser, where the\n * real `index.ts` registers them at import time. Wrappers can call this\n * unconditionally without a `typeof window` guard.\n */\nexport function registerAllComponents(): void {\n /* browser-only — nothing to register without a DOM */\n}\n"],"names":[],"mappings":";AAmSO,SAAS,wBAA8B;AAE9C;"}
@@ -29,7 +29,20 @@
29
29
  * consumer gets without passing their own, so an event missing here is an event they
30
30
  * cannot hear through the proxy.
31
31
  */
32
- export declare const APARTE_DEFAULT_UI_EVENTS: readonly string[];
32
+ export declare const APARTE_DEFAULT_UI_EVENTS: readonly ["aparte-send", "aparte-cancel", "aparte-composer-change", "aparte-composer-submit", "aparte-action-click", "aparte-attachment-preview", "aparte-action", "aparte-retry", "aparte-edit", "aparte-feedback", "aparte-message-info", "aparte-branch-navigate", "aparte-segment-update", "aparte-reset-done", "aparte-path-changed", "aparte-select-conversation", "aparte-delete-conversation", "aparte-archive-conversation", "aparte-unarchive-conversation", "aparte-select-change", "aparte-select-open", "aparte-select-close", "aparte-optgroup-toggle"];
33
+ /**
34
+ * Every event name aparté dispatches ON an element, as a type.
35
+ *
36
+ * `as const` rather than `readonly string[]` because a TYPE needs the literals: the
37
+ * Svelte wrapper derives its `on:` surface from `HTMLElementEventMap`, which
38
+ * deliberately omits the five detail-less events (a map entry would type `e.detail` as
39
+ * `null` and gain nothing). That omission was harmless while it only governed
40
+ * `addEventListener`; once the wrapper DECLARED the tags it removed
41
+ * `SvelteHTMLElements`' catch-all index signature, and `on:aparte-cancel` — the stop
42
+ * button — stopped type-checking. This list already knows those five, so it is the
43
+ * honest source for "every event you can listen for".
44
+ */
45
+ export type AparteUiEventName = typeof APARTE_DEFAULT_UI_EVENTS[number];
33
46
  /**
34
47
  * Apply props to an aparté custom element. aparté elements are
35
48
  * **attribute-driven** (`observedAttributes`): assigning a property is either a
@@ -1 +1 @@
1
- {"version":3,"file":"element-props.d.ts","sourceRoot":"","sources":["../../src/interop/element-props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EA6BrD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,cAAc,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAA0B,GAC/D,IAAI,CA6BN"}
1
+ {"version":3,"file":"element-props.d.ts","sourceRoot":"","sources":["../../src/interop/element-props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,wBAAwB,uiBA6BC,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,cAAc,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAA0B,GAC/D,IAAI,CA+DN"}
@@ -959,6 +959,7 @@ const SAFE_STYLE_PROPS = /* @__PURE__ */ new Set([
959
959
  "white-space"
960
960
  ]);
961
961
  function isSafeCustomProperty(prop) {
962
+ if (prop.includes("\\")) return false;
962
963
  return prop.startsWith("--") && !prop.startsWith("--aparte-");
963
964
  }
964
965
  function scrubStyle(value) {
@@ -1065,6 +1066,19 @@ function escapeHtml(value) {
1065
1066
  return out;
1066
1067
  }
1067
1068
  const escapeAttr = escapeHtml;
1069
+ function isChatBoundary(el2) {
1070
+ if (!el2) return false;
1071
+ const tag = el2.tagName?.toLowerCase();
1072
+ return tag === "aparte-chat" || tag === "aparte-chat-component" || el2.hasAttribute?.("data-aparte-chat") === true;
1073
+ }
1074
+ function chatBoundaryOf(el2) {
1075
+ let node = el2 ?? null;
1076
+ while (node) {
1077
+ if (isChatBoundary(node)) return node;
1078
+ node = node.parentElement;
1079
+ }
1080
+ return null;
1081
+ }
1068
1082
  const APARTE_DEFAULT_BUBBLE_ACTIONS = {
1069
1083
  copy: true,
1070
1084
  retry: false,
@@ -1130,9 +1144,27 @@ class AparteConfig {
1130
1144
  _modelPreferenceProvider;
1131
1145
  // Conversation persistence (optional, agnostic)
1132
1146
  _conversationManager;
1133
- // Human-in-the-loop: presents typed input requests (ask_user,
1134
- // tool approval, forms). Set by the <aparte-elicitation> Web Component.
1135
- _elicitationPresenter;
1147
+ /*
1148
+ * Human-in-the-loop: presents typed input requests (ask_user, tool approval,
1149
+ * forms). Registered by the `<aparte-elicitation>` Web Component.
1150
+ *
1151
+ * A STACK, not one slot, and that is the fix for two real failures. Since
1152
+ * `<aparte-elicitation>` entered `<aparte-chat>`'s default composition, two plain
1153
+ * `<aparte-chat>` elements on a page each register one on the same global config:
1154
+ *
1155
+ * - the second clobbered the first, so chat A's approval opened under chat B, and
1156
+ * answering it under B decided A's tool call;
1157
+ * - and when B unmounted it cleared the slot, leaving chat A mounted with a
1158
+ * perfectly good presenter that never re-registered — every later approval and
1159
+ * every `ask_user` in A rejected `no-presenter` for the life of the page,
1160
+ * silently, because the warning fires at most once per config.
1161
+ *
1162
+ * Each entry carries the element that registered it, so a request naming a `target`
1163
+ * is routed to the presenter in the SAME chat. `AparteElicitationRequest.target` was
1164
+ * already documented as "used to resolve WHICH instance presents"; the single slot
1165
+ * is what made that impossible.
1166
+ */
1167
+ _elicitationPresenters = [];
1136
1168
  /** Warn once per config, not once per request — a tool loop can ask repeatedly. */
1137
1169
  _warnedNoPresenter = false;
1138
1170
  /**
@@ -1221,7 +1253,7 @@ class AparteConfig {
1221
1253
  * trigger only for the ones you claim — see {@link AparteHostHandlersConfig}.
1222
1254
  *
1223
1255
  * @example
1224
- * aparteGlobalConfig.setHostHandlers({ attachmentPreview: true, terminalRun: true });
1256
+ * aparteGlobalConfig.setHostHandlers({ attachmentPreview: true, artifactRedownload: true });
1225
1257
  */
1226
1258
  setHostHandlers(config) {
1227
1259
  this._hostHandlers = { ...this._hostHandlers, ...config };
@@ -1931,27 +1963,85 @@ class AparteConfig {
1931
1963
  * The `<aparte-elicitation>` Web Component registers itself here; an app can
1932
1964
  * override with its own framework-native presenter. Pass `null` to clear.
1933
1965
  */
1934
- setElicitationPresenter(presenter) {
1935
- this._elicitationPresenter = presenter ?? void 0;
1966
+ setElicitationPresenter(presenter, owner) {
1967
+ if (presenter === null) {
1968
+ this._elicitationPresenters = [];
1969
+ return;
1970
+ }
1971
+ this._elicitationPresenters = this._elicitationPresenters.filter((e) => e.fn !== presenter);
1972
+ this._elicitationPresenters.push(owner === void 0 ? { fn: presenter } : { fn: presenter, owner });
1973
+ }
1974
+ /**
1975
+ * Withdraw ONE presenter, named, leaving any others registered.
1976
+ *
1977
+ * This is what an unmounting `<aparte-elicitation>` needs and what
1978
+ * `setElicitationPresenter(null)` could not express: clearing the slot took every
1979
+ * other mounted chat's presenter down with it. Removing a presenter that is not
1980
+ * registered is a no-op.
1981
+ */
1982
+ removeElicitationPresenter(presenter) {
1983
+ this._elicitationPresenters = this._elicitationPresenters.filter((e) => e.fn !== presenter);
1936
1984
  }
1937
- /** The registered elicitation presenter, or undefined if none. */
1985
+ /**
1986
+ * The presenter a request with no `target` would reach — the most recently
1987
+ * registered one. Kept for the callers that ask "is anybody able to present?".
1988
+ */
1938
1989
  getElicitationPresenter() {
1939
- return this._elicitationPresenter;
1990
+ return this._elicitationPresenters[this._elicitationPresenters.length - 1]?.fn;
1991
+ }
1992
+ /**
1993
+ * The presenter that should handle THIS request.
1994
+ *
1995
+ * A `target` is an element inside the asking chat, so the presenter registered from
1996
+ * the same chat is the right one — found by comparing chat boundaries rather than by
1997
+ * `contains`, because the presenter is a sibling of the transcript, not an ancestor
1998
+ * of it. With no target, no match, or no boundary to compare, the top of the stack
1999
+ * is the answer, which is exactly the old single-slot behaviour.
2000
+ */
2001
+ _presenterFor(target) {
2002
+ const stack = this._elicitationPresenters;
2003
+ if (stack.length === 0) return void 0;
2004
+ if (target) {
2005
+ const wanted = chatBoundaryOf(target);
2006
+ if (wanted) {
2007
+ for (let i = stack.length - 1; i >= 0; i -= 1) {
2008
+ const entry = stack[i];
2009
+ if (entry.owner && chatBoundaryOf(entry.owner) === wanted) return entry.fn;
2010
+ }
2011
+ }
2012
+ }
2013
+ return stack[stack.length - 1]?.fn;
1940
2014
  }
1941
2015
  /**
1942
2016
  * Ask the user for typed input mid-run and await their response. This is the
1943
2017
  * generic primitive behind `ask_user` and tool approval — the KIND of
1944
- * question is the schema, not a bespoke tool. Resolves `accept` with the
1945
- * value, `decline` when the user declines, or `cancel` when the turn is
1946
- * cancelled.
2018
+ * question is the schema, not a bespoke tool.
2019
+ *
2020
+ * **Resolves** `accept` with the value, or `decline` when the user declines.
2021
+ *
2022
+ * **Rejects** — it does not resolve — when the request ends without an answer, with
2023
+ * an {@link AparteElicitationAbortError} whose `name` is `'AbortError'` and whose
2024
+ * `reason` is `'aborted'` (the turn was stopped, the signal fired, or another request
2025
+ * took the question away) or `'no-presenter'` (nothing was mounted to ask it). So
2026
+ * `await` it inside a `try`, or attach a `.catch()`.
1947
2027
  *
1948
- * With NO presenter registered it resolves `cancel` rather than hanging and
1949
- * warns, once, because that `cancel` is otherwise a lie told quietly. The
1950
- * model reads it as "the user refused"; the user was never asked, and the
1951
- * developer sees nothing at all. The default presenter is
1952
- * `<aparte-elicitation>`, which registers itself from its `connectedCallback`
1953
- * so it has to be IN THE DOM. A docs page of ours claimed it "installs
1954
- * itself nothing to register", which is how this failure mode was found.
2028
+ * That is a change, and this block described the old behaviour for a whole release:
2029
+ * "resolves `cancel` when the turn is cancelled", and "with NO presenter registered it
2030
+ * resolves `cancel` rather than hanging". Both were false the moment `cancel` was
2031
+ * removed and the second is the one that bites, because a developer who reads
2032
+ * "rather than hanging" writes no `.catch()` and gets an unhandled rejection. It ships
2033
+ * in the `.d.ts` and in the custom-elements manifest, which is the API surface the
2034
+ * docs site renders, so it was the most-read wrong sentence in the library.
2035
+ *
2036
+ * A value was removed rather than renamed on purpose: `cancel` was easy to handle as
2037
+ * though it were an answer, and the approval gate did exactly that — it read a stopped
2038
+ * turn as the user refusing a tool they were never shown.
2039
+ *
2040
+ * With no presenter it rejects `'no-presenter'` and warns once, because a request
2041
+ * nobody could see is a setup mistake only the developer can fix. The default
2042
+ * presenter is `<aparte-elicitation>`, which registers itself from its
2043
+ * `connectedCallback` — so it has to be IN THE DOM. A docs page of ours claimed it
2044
+ * "installs itself — nothing to register", which is how that was found.
1955
2045
  */
1956
2046
  requestUserInput(request) {
1957
2047
  const previous = this._elicitationQueue;
@@ -1967,7 +2057,8 @@ class AparteConfig {
1967
2057
  }
1968
2058
  /** Hand ONE request to the presenter. Called only from the queue. */
1969
2059
  _present(request) {
1970
- if (!this._elicitationPresenter) {
2060
+ const presenter = this._presenterFor(request.target);
2061
+ if (!presenter) {
1971
2062
  if (!this._warnedNoPresenter) {
1972
2063
  this._warnedNoPresenter = true;
1973
2064
  console.warn(
@@ -1977,7 +2068,7 @@ class AparteConfig {
1977
2068
  return Promise.reject(new AparteElicitationAbortError("no-presenter"));
1978
2069
  }
1979
2070
  if (request.signal?.aborted) return Promise.reject(new AparteElicitationAbortError("aborted"));
1980
- return this._elicitationPresenter(request);
2071
+ return presenter(request);
1981
2072
  }
1982
2073
  /**
1983
2074
  * Reset ALL configuration back to defaults — providers, registries, model
@@ -2003,7 +2094,7 @@ class AparteConfig {
2003
2094
  this._artifactPreviewBuilder = void 0;
2004
2095
  this._keyProvider = void 0;
2005
2096
  this._conversationManager = void 0;
2006
- this._elicitationPresenter = void 0;
2097
+ this._elicitationPresenters = [];
2007
2098
  this._elicitationQueue = null;
2008
2099
  this._locale = APARTE_DEFAULT_LOCALE;
2009
2100
  this._actions = [];
@@ -2484,13 +2575,7 @@ const toolCallRenderer = {
2484
2575
  const icon = element.querySelector(".aparte-tool-icon");
2485
2576
  if (icon) icon.innerHTML = cfg.getIcon("tool");
2486
2577
  const statusEl = element.querySelector(".aparte-tool-state");
2487
- if (statusEl) {
2488
- const s = segment.status;
2489
- statusEl.innerHTML = s === "resolved" ? cfg.getIcon("check") : s === "aborted" || s === "rejected" ? cfg.getIcon("close") : "";
2490
- }
2491
- if (statusEl && segment.status === "awaiting-approval") {
2492
- statusEl.textContent = cfg.t("approvalWaiting");
2493
- }
2578
+ if (statusEl) statusEl.innerHTML = stateBadge(segment);
2494
2579
  },
2495
2580
  /**
2496
2581
  * Patch in place. NEVER re-render, and never touch `open`.
@@ -4036,6 +4121,7 @@ class AparteConversationController {
4036
4121
  function cssEscape(value) {
4037
4122
  return value.replace(/["\\]/g, "\\$&");
4038
4123
  }
4124
+ const MAX_SIBLING_RETRIES = 6;
4039
4125
  class AparteChatHost {
4040
4126
  binding;
4041
4127
  options;
@@ -4045,6 +4131,8 @@ class AparteChatHost {
4045
4131
  _renderedIds = /* @__PURE__ */ new Set();
4046
4132
  /** Sibling info from the last path-change, applied after the next render. */
4047
4133
  _pendingSiblings;
4134
+ /** How many render passes the sibling write has waited for — see `_applyPendingSiblings`. */
4135
+ _siblingRetries = 0;
4048
4136
  /** Abort handle for an in-flight {@link streamTokens} loop. */
4049
4137
  _streamAbort;
4050
4138
  /** Segment chunks written to the bubble, awaiting one coalesced state sync. */
@@ -4546,17 +4634,48 @@ class AparteChatHost {
4546
4634
  }
4547
4635
  }
4548
4636
  }
4637
+ /**
4638
+ * Write the branch counts onto their bubbles — and RESCHEDULE for the ones that are
4639
+ * not on the page yet, instead of dropping them.
4640
+ *
4641
+ * This used to `continue` past a missing bubble and then clear `_pendingSiblings`
4642
+ * unconditionally, which lost the fork for good. That is the "1 / 1" defect: the
4643
+ * bubble kept its default of one sibling, the picker hid itself, and the other version
4644
+ * became unreachable for the life of the page.
4645
+ *
4646
+ * It needed a framework that renders LATE, which is every framework here. React's
4647
+ * `afterRender` is `requestAnimationFrame(() => cb())` — a bet that the next paint
4648
+ * lands after React's commit, and it does not always; the repo has lost that same bet
4649
+ * before (`25f356b`, "a bet on rAF phase"). The fix is here rather than in the
4650
+ * wrapper's rAF call, because ANY binding whose `afterRender` can precede its commit
4651
+ * hits this, and one fix at the host covers all four.
4652
+ *
4653
+ * Bounded, because a sibling can legitimately never arrive — a message that left the
4654
+ * path has no bubble and never will, and an unbounded retry would hold a callback for
4655
+ * the page's lifetime. Six passes is far more than the one tick the race needs.
4656
+ */
4549
4657
  _applyPendingSiblings() {
4550
4658
  if (!this._pendingSiblings) return;
4551
4659
  const msgs = this.binding.getMessages();
4660
+ const unresolved = [];
4552
4661
  for (const sib of this._pendingSiblings) {
4553
4662
  if (sib.count <= 1) continue;
4554
4663
  const bubble = this._bubbleById(sib.id);
4555
- if (!bubble) continue;
4664
+ if (!bubble) {
4665
+ unresolved.push(sib);
4666
+ continue;
4667
+ }
4556
4668
  const message = msgs.find((m) => m.id === sib.id);
4557
4669
  if (message) populateBubbleFromMessage(bubble, message, sib);
4558
4670
  }
4559
4671
  this._pendingSiblings = void 0;
4672
+ if (unresolved.length && this._siblingRetries < MAX_SIBLING_RETRIES) {
4673
+ this._siblingRetries += 1;
4674
+ this._pendingSiblings = unresolved;
4675
+ this.binding.afterRender(() => this._applyPendingSiblings());
4676
+ return;
4677
+ }
4678
+ this._siblingRetries = 0;
4560
4679
  }
4561
4680
  // ── internals ──────────────────────────────────────────────────────────
4562
4681
  /** Orphan-stream guard: a stream is in flight but the last msg isn't it. */
@@ -7285,11 +7404,15 @@ const APARTE_DEFAULT_UI_EVENTS = [
7285
7404
  function applyElementProps(el2, props, transformValue = (value) => value) {
7286
7405
  for (const [key, value] of Object.entries(props)) {
7287
7406
  if (key.startsWith("--")) {
7288
- el2.style.setProperty(key, String(value));
7407
+ if (value === null || value === void 0) el2.style.removeProperty(key);
7408
+ else if (typeof value === "object" || typeof value === "function") el2.style.removeProperty(key);
7409
+ else el2.style.setProperty(key, String(value));
7289
7410
  } else if (key.startsWith("on")) {
7290
7411
  el2.removeAttribute(key);
7291
7412
  } else if (value === null || value === void 0 || value === false) {
7292
7413
  el2.removeAttribute(key);
7414
+ } else if (typeof value === "number" && Number.isNaN(value)) {
7415
+ el2.removeAttribute(key);
7293
7416
  } else if (value === true) {
7294
7417
  el2.setAttribute(key, "");
7295
7418
  } else if (typeof value === "object" || typeof value === "function") {
@@ -7374,4 +7497,4 @@ export {
7374
7497
  buildElicitationPanel as y,
7375
7498
  collectRendererStyles as z
7376
7499
  };
7377
- //# sourceMappingURL=is-awaiting-reply-Cb7H3YfN.js.map
7500
+ //# sourceMappingURL=is-awaiting-reply-BWTDvQ__.js.map