@aparte/core 0.11.0 → 0.12.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 (31) 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/custom-elements.json +6914 -6807
  10. package/dist/generated/element-attributes.d.ts +5 -1
  11. package/dist/generated/element-attributes.d.ts.map +1 -1
  12. package/dist/index.css +9 -3
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +43 -17
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.node.d.ts +1 -0
  18. package/dist/index.node.d.ts.map +1 -1
  19. package/dist/index.node.js +1 -1
  20. package/dist/index.node.js.map +1 -1
  21. package/dist/interop/element-props.d.ts +14 -1
  22. package/dist/interop/element-props.d.ts.map +1 -1
  23. package/dist/{is-awaiting-reply-Cb7H3YfN.js → is-awaiting-reply-CxWRISBC.js} +118 -30
  24. package/dist/is-awaiting-reply-CxWRISBC.js.map +1 -0
  25. package/dist/renderers/segments/tool-call.d.ts.map +1 -1
  26. package/dist/types/tools.d.ts +11 -2
  27. package/dist/types/tools.d.ts.map +1 -1
  28. package/dist/utils/chat-boundary.d.ts +22 -0
  29. package/dist/utils/chat-boundary.d.ts.map +1 -0
  30. package/package.json +1 -1
  31. 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,mCAAmC,EACnC,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,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AAC;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-CxWRISBC.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"}
@@ -1065,6 +1065,19 @@ function escapeHtml(value) {
1065
1065
  return out;
1066
1066
  }
1067
1067
  const escapeAttr = escapeHtml;
1068
+ function isChatBoundary(el2) {
1069
+ if (!el2) return false;
1070
+ const tag = el2.tagName?.toLowerCase();
1071
+ return tag === "aparte-chat" || tag === "aparte-chat-component" || el2.hasAttribute?.("data-aparte-chat") === true;
1072
+ }
1073
+ function chatBoundaryOf(el2) {
1074
+ let node = el2 ?? null;
1075
+ while (node) {
1076
+ if (isChatBoundary(node)) return node;
1077
+ node = node.parentElement;
1078
+ }
1079
+ return null;
1080
+ }
1068
1081
  const APARTE_DEFAULT_BUBBLE_ACTIONS = {
1069
1082
  copy: true,
1070
1083
  retry: false,
@@ -1130,9 +1143,27 @@ class AparteConfig {
1130
1143
  _modelPreferenceProvider;
1131
1144
  // Conversation persistence (optional, agnostic)
1132
1145
  _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;
1146
+ /*
1147
+ * Human-in-the-loop: presents typed input requests (ask_user, tool approval,
1148
+ * forms). Registered by the `<aparte-elicitation>` Web Component.
1149
+ *
1150
+ * A STACK, not one slot, and that is the fix for two real failures. Since
1151
+ * `<aparte-elicitation>` entered `<aparte-chat>`'s default composition, two plain
1152
+ * `<aparte-chat>` elements on a page each register one on the same global config:
1153
+ *
1154
+ * - the second clobbered the first, so chat A's approval opened under chat B, and
1155
+ * answering it under B decided A's tool call;
1156
+ * - and when B unmounted it cleared the slot, leaving chat A mounted with a
1157
+ * perfectly good presenter that never re-registered — every later approval and
1158
+ * every `ask_user` in A rejected `no-presenter` for the life of the page,
1159
+ * silently, because the warning fires at most once per config.
1160
+ *
1161
+ * Each entry carries the element that registered it, so a request naming a `target`
1162
+ * is routed to the presenter in the SAME chat. `AparteElicitationRequest.target` was
1163
+ * already documented as "used to resolve WHICH instance presents"; the single slot
1164
+ * is what made that impossible.
1165
+ */
1166
+ _elicitationPresenters = [];
1136
1167
  /** Warn once per config, not once per request — a tool loop can ask repeatedly. */
1137
1168
  _warnedNoPresenter = false;
1138
1169
  /**
@@ -1221,7 +1252,7 @@ class AparteConfig {
1221
1252
  * trigger only for the ones you claim — see {@link AparteHostHandlersConfig}.
1222
1253
  *
1223
1254
  * @example
1224
- * aparteGlobalConfig.setHostHandlers({ attachmentPreview: true, terminalRun: true });
1255
+ * aparteGlobalConfig.setHostHandlers({ attachmentPreview: true, artifactRedownload: true });
1225
1256
  */
1226
1257
  setHostHandlers(config) {
1227
1258
  this._hostHandlers = { ...this._hostHandlers, ...config };
@@ -1931,27 +1962,85 @@ class AparteConfig {
1931
1962
  * The `<aparte-elicitation>` Web Component registers itself here; an app can
1932
1963
  * override with its own framework-native presenter. Pass `null` to clear.
1933
1964
  */
1934
- setElicitationPresenter(presenter) {
1935
- this._elicitationPresenter = presenter ?? void 0;
1965
+ setElicitationPresenter(presenter, owner) {
1966
+ if (presenter === null) {
1967
+ this._elicitationPresenters = [];
1968
+ return;
1969
+ }
1970
+ this._elicitationPresenters = this._elicitationPresenters.filter((e) => e.fn !== presenter);
1971
+ this._elicitationPresenters.push(owner === void 0 ? { fn: presenter } : { fn: presenter, owner });
1972
+ }
1973
+ /**
1974
+ * Withdraw ONE presenter, named, leaving any others registered.
1975
+ *
1976
+ * This is what an unmounting `<aparte-elicitation>` needs and what
1977
+ * `setElicitationPresenter(null)` could not express: clearing the slot took every
1978
+ * other mounted chat's presenter down with it. Removing a presenter that is not
1979
+ * registered is a no-op.
1980
+ */
1981
+ removeElicitationPresenter(presenter) {
1982
+ this._elicitationPresenters = this._elicitationPresenters.filter((e) => e.fn !== presenter);
1936
1983
  }
1937
- /** The registered elicitation presenter, or undefined if none. */
1984
+ /**
1985
+ * The presenter a request with no `target` would reach — the most recently
1986
+ * registered one. Kept for the callers that ask "is anybody able to present?".
1987
+ */
1938
1988
  getElicitationPresenter() {
1939
- return this._elicitationPresenter;
1989
+ return this._elicitationPresenters[this._elicitationPresenters.length - 1]?.fn;
1990
+ }
1991
+ /**
1992
+ * The presenter that should handle THIS request.
1993
+ *
1994
+ * A `target` is an element inside the asking chat, so the presenter registered from
1995
+ * the same chat is the right one — found by comparing chat boundaries rather than by
1996
+ * `contains`, because the presenter is a sibling of the transcript, not an ancestor
1997
+ * of it. With no target, no match, or no boundary to compare, the top of the stack
1998
+ * is the answer, which is exactly the old single-slot behaviour.
1999
+ */
2000
+ _presenterFor(target) {
2001
+ const stack = this._elicitationPresenters;
2002
+ if (stack.length === 0) return void 0;
2003
+ if (target) {
2004
+ const wanted = chatBoundaryOf(target);
2005
+ if (wanted) {
2006
+ for (let i = stack.length - 1; i >= 0; i -= 1) {
2007
+ const entry = stack[i];
2008
+ if (entry.owner && chatBoundaryOf(entry.owner) === wanted) return entry.fn;
2009
+ }
2010
+ }
2011
+ }
2012
+ return stack[stack.length - 1]?.fn;
1940
2013
  }
1941
2014
  /**
1942
2015
  * Ask the user for typed input mid-run and await their response. This is the
1943
2016
  * 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.
2017
+ * question is the schema, not a bespoke tool.
1947
2018
  *
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.
2019
+ * **Resolves** `accept` with the value, or `decline` when the user declines.
2020
+ *
2021
+ * **Rejects** it does not resolve when the request ends without an answer, with
2022
+ * an {@link AparteElicitationAbortError} whose `name` is `'AbortError'` and whose
2023
+ * `reason` is `'aborted'` (the turn was stopped, the signal fired, or another request
2024
+ * took the question away) or `'no-presenter'` (nothing was mounted to ask it). So
2025
+ * `await` it inside a `try`, or attach a `.catch()`.
2026
+ *
2027
+ * That is a change, and this block described the old behaviour for a whole release:
2028
+ * "resolves `cancel` when the turn is cancelled", and "with NO presenter registered it
2029
+ * resolves `cancel` rather than hanging". Both were false the moment `cancel` was
2030
+ * removed — and the second is the one that bites, because a developer who reads
2031
+ * "rather than hanging" writes no `.catch()` and gets an unhandled rejection. It ships
2032
+ * in the `.d.ts` and in the custom-elements manifest, which is the API surface the
2033
+ * docs site renders, so it was the most-read wrong sentence in the library.
2034
+ *
2035
+ * A value was removed rather than renamed on purpose: `cancel` was easy to handle as
2036
+ * though it were an answer, and the approval gate did exactly that — it read a stopped
2037
+ * turn as the user refusing a tool they were never shown.
2038
+ *
2039
+ * With no presenter it rejects `'no-presenter'` and warns once, because a request
2040
+ * nobody could see is a setup mistake only the developer can fix. The default
2041
+ * presenter is `<aparte-elicitation>`, which registers itself from its
2042
+ * `connectedCallback` — so it has to be IN THE DOM. A docs page of ours claimed it
2043
+ * "installs itself — nothing to register", which is how that was found.
1955
2044
  */
1956
2045
  requestUserInput(request) {
1957
2046
  const previous = this._elicitationQueue;
@@ -1967,7 +2056,8 @@ class AparteConfig {
1967
2056
  }
1968
2057
  /** Hand ONE request to the presenter. Called only from the queue. */
1969
2058
  _present(request) {
1970
- if (!this._elicitationPresenter) {
2059
+ const presenter = this._presenterFor(request.target);
2060
+ if (!presenter) {
1971
2061
  if (!this._warnedNoPresenter) {
1972
2062
  this._warnedNoPresenter = true;
1973
2063
  console.warn(
@@ -1977,7 +2067,7 @@ class AparteConfig {
1977
2067
  return Promise.reject(new AparteElicitationAbortError("no-presenter"));
1978
2068
  }
1979
2069
  if (request.signal?.aborted) return Promise.reject(new AparteElicitationAbortError("aborted"));
1980
- return this._elicitationPresenter(request);
2070
+ return presenter(request);
1981
2071
  }
1982
2072
  /**
1983
2073
  * Reset ALL configuration back to defaults — providers, registries, model
@@ -2003,7 +2093,7 @@ class AparteConfig {
2003
2093
  this._artifactPreviewBuilder = void 0;
2004
2094
  this._keyProvider = void 0;
2005
2095
  this._conversationManager = void 0;
2006
- this._elicitationPresenter = void 0;
2096
+ this._elicitationPresenters = [];
2007
2097
  this._elicitationQueue = null;
2008
2098
  this._locale = APARTE_DEFAULT_LOCALE;
2009
2099
  this._actions = [];
@@ -2484,13 +2574,7 @@ const toolCallRenderer = {
2484
2574
  const icon = element.querySelector(".aparte-tool-icon");
2485
2575
  if (icon) icon.innerHTML = cfg.getIcon("tool");
2486
2576
  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
- }
2577
+ if (statusEl) statusEl.innerHTML = stateBadge(segment);
2494
2578
  },
2495
2579
  /**
2496
2580
  * Patch in place. NEVER re-render, and never touch `open`.
@@ -7285,11 +7369,15 @@ const APARTE_DEFAULT_UI_EVENTS = [
7285
7369
  function applyElementProps(el2, props, transformValue = (value) => value) {
7286
7370
  for (const [key, value] of Object.entries(props)) {
7287
7371
  if (key.startsWith("--")) {
7288
- el2.style.setProperty(key, String(value));
7372
+ if (value === null || value === void 0) el2.style.removeProperty(key);
7373
+ else if (typeof value === "object" || typeof value === "function") el2.style.removeProperty(key);
7374
+ else el2.style.setProperty(key, String(value));
7289
7375
  } else if (key.startsWith("on")) {
7290
7376
  el2.removeAttribute(key);
7291
7377
  } else if (value === null || value === void 0 || value === false) {
7292
7378
  el2.removeAttribute(key);
7379
+ } else if (typeof value === "number" && Number.isNaN(value)) {
7380
+ el2.removeAttribute(key);
7293
7381
  } else if (value === true) {
7294
7382
  el2.setAttribute(key, "");
7295
7383
  } else if (typeof value === "object" || typeof value === "function") {
@@ -7374,4 +7462,4 @@ export {
7374
7462
  buildElicitationPanel as y,
7375
7463
  collectRendererStyles as z
7376
7464
  };
7377
- //# sourceMappingURL=is-awaiting-reply-Cb7H3YfN.js.map
7465
+ //# sourceMappingURL=is-awaiting-reply-CxWRISBC.js.map