@aparte/core 0.27.4 → 0.28.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 (51) hide show
  1. package/dist/client/stream-adapter.d.ts.map +1 -1
  2. package/dist/components/bubble/aparte-chat-bubble.d.ts +2 -0
  3. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
  4. package/dist/components/bubble/bubble-sync.d.ts.map +1 -1
  5. package/dist/config/aparte-config.d.ts +86 -7
  6. package/dist/config/aparte-config.d.ts.map +1 -1
  7. package/dist/config/index.d.ts +1 -1
  8. package/dist/config/index.d.ts.map +1 -1
  9. package/dist/config/locale.d.ts +14 -0
  10. package/dist/config/locale.d.ts.map +1 -1
  11. package/dist/config/sanitize.d.ts +7 -2
  12. package/dist/config/sanitize.d.ts.map +1 -1
  13. package/dist/custom-elements.json +12801 -12151
  14. package/dist/{defer-hydration-BlmPqEgs.js → defer-hydration-BMip3DKA.js} +1251 -101
  15. package/dist/defer-hydration-BMip3DKA.js.map +1 -0
  16. package/dist/index.css +1 -1
  17. package/dist/index.d.ts +5 -3
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +37 -13
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.node.d.ts +4 -3
  22. package/dist/index.node.d.ts.map +1 -1
  23. package/dist/index.node.js +14 -12
  24. package/dist/index.node.js.map +1 -1
  25. package/dist/parsers/aparte-stream-parser.d.ts.map +1 -1
  26. package/dist/renderers/citations.d.ts +23 -0
  27. package/dist/renderers/citations.d.ts.map +1 -0
  28. package/dist/renderers/code-languages.d.ts +30 -0
  29. package/dist/renderers/code-languages.d.ts.map +1 -0
  30. package/dist/renderers/highlight-stream.d.ts.map +1 -1
  31. package/dist/renderers/index.d.ts +3 -0
  32. package/dist/renderers/index.d.ts.map +1 -1
  33. package/dist/renderers/markdown-stream.d.ts +12 -1
  34. package/dist/renderers/markdown-stream.d.ts.map +1 -1
  35. package/dist/renderers/segments/code.d.ts.map +1 -1
  36. package/dist/renderers/segments/text.d.ts.map +1 -1
  37. package/dist/renderers/segments/thinking.d.ts.map +1 -1
  38. package/dist/transport/backend-handler.d.ts.map +1 -1
  39. package/dist/transport/backend-transport.d.ts.map +1 -1
  40. package/dist/transport/types.d.ts +15 -2
  41. package/dist/transport/types.d.ts.map +1 -1
  42. package/dist/types/chat.d.ts +10 -1
  43. package/dist/types/chat.d.ts.map +1 -1
  44. package/dist/types/index.d.ts +1 -1
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/types/model-provider.d.ts +3 -1
  47. package/dist/types/model-provider.d.ts.map +1 -1
  48. package/dist/types/segments.d.ts +36 -0
  49. package/dist/types/segments.d.ts.map +1 -1
  50. package/package.json +2 -2
  51. package/dist/defer-hydration-BlmPqEgs.js.map +0 -1
@@ -18,7 +18,7 @@
18
18
  * TypeScript consumers fully typed on the server; `registerAllComponents()` is a
19
19
  * no-op here (there is nothing to register without a DOM).
20
20
  */
21
- export type { AparteBubbleRole, AparteMessage, AparteContextSummary, AparteCompactor, AparteCompactorRequest, AparteCompactorOutcome, AparteCompactorReason, AparteContentParser, AparteStreamBlock, AparteStreamBlockMatch, AparteSendEventDetail, AparteViewportConfig, AparteInputConfig, AparteThemeVariables, AparteStatus, AparteAttachment, AparteMessageBranch, AparteBubbleActionsConfig, AparteBubbleActionName, AparteSegment, AparteSegmentTypes, AparteSegmentType, AparteTextSegment, AparteThinkingSegment, AparteCodeSegment, AparteSegmentRenderer, AparteSegmentMount, AparteCustomSegment, AparteToolCallSegment, AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteErrorSegment, AparteSegmentUpdateEventDetail, AparteAIProvider, AparteAIModel, AparteAIProviderConfigField, AparteAIProviderMetadata, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress, AparteModelChangeEventDetail, AparteApprovalModeChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteMessagePausedEventDetail, AparteMessageResumedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactStartEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteLinkClickEventDetail, AparteMessageInfoEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail, AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteFinishReason, AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolMatcher, AparteToolDisplay, AparteToolDetails, AparteToolCallView, AparteMountedView, AparteToolMount, AparteToolApprovalRequestDetail, AparteChatImperativeApi, AparteUiHandle, AparteElementAttributes, AparteElementTagName, AparteAttrValue, AparteTemplateAttrs, AparteNoAttributes, AparteChatAttributes, AparteChatViewportAttributes, AparteChatBubbleAttributes, AparteChatStatusAttributes, AparteComposerAttributes, AparteComposerInputAttributes, AparteComposerActionAttributes, AparteComposerAddAttachmentAttributes, AparteComposerToolbarAttributes, AparteConversationListAttributes, AparteSelectAttributes, AparteOptionAttributes, AparteOptgroupAttributes, AparteProgressSpinnerAttributes, AparteContextAttributes, AparteIconAttributes, AparteScrollRailAttributes, AparteSidebarAttributes, AparteSplitAttributes, AparteLauncherAttributes, AparteSuggestionsAttributes, } from './types/index.js';
21
+ export type { AparteBubbleRole, AparteMessage, AparteContextSummary, AparteCompactor, AparteCompactorRequest, AparteCompactorOutcome, AparteCompactorReason, AparteContentParser, AparteStreamBlock, AparteStreamBlockMatch, AparteSendEventDetail, AparteViewportConfig, AparteInputConfig, AparteThemeVariables, AparteStatus, AparteAttachment, AparteMessageBranch, AparteBubbleActionsConfig, AparteBubbleActionName, AparteSegment, AparteSegmentTypes, AparteSegmentType, AparteTextSegment, AparteSource, AparteCitation, AparteThinkingSegment, AparteCodeSegment, AparteSegmentRenderer, AparteSegmentMount, AparteCustomSegment, AparteToolCallSegment, AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteErrorSegment, AparteSegmentUpdateEventDetail, AparteAIProvider, AparteAIModel, AparteAIProviderConfigField, AparteAIProviderMetadata, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress, AparteModelChangeEventDetail, AparteApprovalModeChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteMessagePausedEventDetail, AparteMessageResumedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactStartEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteLinkClickEventDetail, AparteMessageInfoEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail, AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteFinishReason, AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolMatcher, AparteToolDisplay, AparteToolDetails, AparteToolCallView, AparteMountedView, AparteToolMount, AparteToolApprovalRequestDetail, AparteChatImperativeApi, AparteUiHandle, AparteElementAttributes, AparteElementTagName, AparteAttrValue, AparteTemplateAttrs, AparteNoAttributes, AparteChatAttributes, AparteChatViewportAttributes, AparteChatBubbleAttributes, AparteChatStatusAttributes, AparteComposerAttributes, AparteComposerInputAttributes, AparteComposerActionAttributes, AparteComposerAddAttachmentAttributes, AparteComposerToolbarAttributes, AparteConversationListAttributes, AparteSelectAttributes, AparteOptionAttributes, AparteOptgroupAttributes, AparteProgressSpinnerAttributes, AparteContextAttributes, AparteIconAttributes, AparteScrollRailAttributes, AparteSidebarAttributes, AparteSplitAttributes, AparteLauncherAttributes, AparteSuggestionsAttributes, } from './types/index.js';
22
22
  export { AparteErrorCode, AparteError, contentToText } from './types/index.js';
23
23
  export type { AparteChat, AparteChatBubble, AparteChatViewport, AparteChatStatus, AparteComposer, AparteComposerInput, AparteComposerSend, AparteComposerCancel, AparteComposerAttachments, AparteComposerAddAttachment, AparteComposerAction, AparteComposerToolbar, AparteSuggestions, AparteContext, AparteConversationList, AparteScrollRail, AparteSidebar, AparteSplit, AparteLauncher, } from './components/index.js';
24
24
  export type { AparteScrollRailJumpDetail, AparteScrollRailEvery, AparteSidebarToggleDetail } from './components/index.js';
@@ -31,7 +31,8 @@ export type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, A
31
31
  export type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail, AparteConversationPinDetail, AparteConversationRenameDetail, AparteConversationStatus, AparteConversationStatusDetail } from './components/index.js';
32
32
  export type { AparteSuggestion, AparteSuggestionEventDetail } from './components/index.js';
33
33
  export type { AparteContextLevel, AparteContextThresholdEventDetail } from './components/index.js';
34
- export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, collectRendererStyles, registerDefaultRenderers, installDefaultRenderersOnce, declineDefaultRenderers, getAllRenderers, overrideSegmentRenderer, defineMountedToolRenderer, defineMountedSegmentRenderer, toToolCallView, } from './renderers/index.js';
34
+ export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, collectRendererStyles, registerDefaultRenderers, installDefaultRenderersOnce, declineDefaultRenderers, getAllRenderers, overrideSegmentRenderer, defineMountedToolRenderer, defineMountedSegmentRenderer, toToolCallView, renderCodeLanguages, renderCitations, } from './renderers/index.js';
35
+ export type { AparteRenderCodeLanguagesOptions } from './renderers/index.js';
35
36
  export { populateBubbleFromMessage } from './components/bubble/bubble-sync.js';
36
37
  export type { AparteConversation, AparteConversationMeta, AparteStorageAdapter, AparteAttachmentRow, AparteConversationLoadedDetail, } from './conversations/index.js';
37
38
  export { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';
@@ -47,7 +48,7 @@ export type { AparteConfigChangeEventDetail } from './config/index.js';
47
48
  export { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';
48
49
  export { subscribeConfigChange, APARTE_CONFIG_CHANGE } from './config/index.js';
49
50
  export type { AparteConfigAware } from './config/index.js';
50
- export type { AparteMarkdownProvider, AparteStreamingMarkdownProvider, AparteStreamingMarkdownRenderer, AparteHighlightProvider, AparteSystemPromptVarsProvider, AparteLocale, AparteLocaleExtensions, AparteAction, AparteActionZone, AparteIconProvider, AparteIconName, AparteCoreIconName, AparteAvatarProvider, AparteStatusRenderer, AparteErrorRenderer, AparteAttachmentRenderer, AparteElicitationFieldRenderer, AparteElicitationFieldContext, AparteElicitationFieldControl, AparteSiblingNavRenderer, AparteBubbleShellRenderer, AparteModelPreference, AparteModelPreferenceProvider, AparteSanitizer, } from './config/index.js';
51
+ export type { AparteMarkdownProvider, AparteStreamingMarkdownProvider, AparteStreamingMarkdownRenderer, AparteCodeLanguageRenderer, AparteCodeLanguageContext, AparteHighlightProvider, AparteSystemPromptVarsProvider, AparteLocale, AparteLocaleExtensions, AparteAction, AparteActionZone, AparteIconProvider, AparteIconName, AparteCoreIconName, AparteAvatarProvider, AparteStatusRenderer, AparteErrorRenderer, AparteAttachmentRenderer, AparteElicitationFieldRenderer, AparteElicitationFieldContext, AparteElicitationFieldControl, AparteSiblingNavRenderer, AparteBubbleShellRenderer, AparteModelPreference, AparteModelPreferenceProvider, AparteSanitizer, } from './config/index.js';
51
52
  export { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';
52
53
  export { AparteClient } from './client/aparte-client.js';
53
54
  export { historyFromCheckpoint } from './context/checkpoint.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,YAAY,EACR,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EAOrB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAIlB,8BAA8B,EAC9B,gBAAgB,EAChB,aAAa,EACb,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,4BAA4B,EAC5B,mCAAmC,EACnC,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,kCAAkC,EAClC,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,+BAA+B,EAC/B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,E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C/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;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,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;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAY5C;AAED,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -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, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj } from "./defer-hydration-BlmPqEgs.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, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al } from "./defer-hydration-BMip3DKA.js";
2
2
  function registerAllComponents() {
3
3
  if (typeof customElements !== "undefined") {
4
4
  console.warn(
@@ -71,16 +71,18 @@ export {
71
71
  a6 as registerDefaultRenderers,
72
72
  a7 as registerSegmentRenderer,
73
73
  a8 as releaseDeferredHydration,
74
- a9 as requestUserInput,
75
- aa as resolveConfig,
76
- ab as revokeAttachmentUrls,
77
- ac as runWithConfig,
78
- ad as segmentDuration,
79
- ae as segmentTiming,
80
- af as subscribeConfigChange,
81
- ag as toToolCallView,
82
- ah as toolRefusal,
83
- ai as unregisterSegmentRenderer,
84
- aj as uuid
74
+ a9 as renderCitations,
75
+ aa as renderCodeLanguages,
76
+ ab as requestUserInput,
77
+ ac as resolveConfig,
78
+ ad as revokeAttachmentUrls,
79
+ ae as runWithConfig,
80
+ af as segmentDuration,
81
+ ag as segmentTiming,
82
+ ah as subscribeConfigChange,
83
+ ai as toToolCallView,
84
+ aj as toolRefusal,
85
+ ak as unregisterSegmentRenderer,
86
+ al as uuid
85
87
  };
86
88
  //# sourceMappingURL=index.node.js.map
@@ -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 — and via `worker`, `workerd`,\n * `edge-light`, `deno` and `bun` for a Cloudflare Worker, an edge route or a\n * `target: 'webworker'` build. A worker built with the page's conditions imports it\n * by name, as `@aparte/core/headless`. 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 AparteContextSummary,\n AparteCompactor,\n AparteCompactorRequest,\n AparteCompactorOutcome,\n AparteCompactorReason,\n AparteContentParser,\n AparteStreamBlock,\n AparteStreamBlockMatch,\n AparteSendEventDetail,\n AparteViewportConfig,\n AparteInputConfig,\n AparteThemeVariables,\n AparteStatus,\n AparteAttachment,\n AparteMessageBranch,\n AparteBubbleActionsConfig,\n AparteBubbleActionName,\n AparteSegment,\n AparteSegmentTypes,\n AparteSegmentType,\n AparteTextSegment,\n AparteThinkingSegment,\n AparteCodeSegment,\n AparteSegmentRenderer,\n AparteSegmentMount,\n AparteCustomSegment,\n AparteToolCallSegment,\n // The same five the browser barrel gained, and they belong here for the same reason:\n // a type has no DOM. `AparteSegmentBase` is the constraint on the exported\n // `AparteSegmentRenderer<T>`, so an SSR consumer writing a renderer for a segment type\n // of its own could not name what it extends. `check:node-barrel-types` is what caught\n // the omission — the browser barrel alone would have compiled fine and failed on the\n // `node` condition only.\n AparteSegmentBase,\n AparteSegmentDefaults,\n AparteSegmentTiming,\n AparteErrorSegment,\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 AparteAIProviderMetadata,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteApprovalModeChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageStartEventDetail,\n AparteMessageErrorEventDetail,\n AparteMessageAbortedEventDetail,\n AparteMessagePausedEventDetail,\n AparteMessageResumedEventDetail,\n AparteAbortEventDetail,\n AparteCompactEventDetail,\n AparteCompactDoneEventDetail,\n AparteCompactStartEventDetail,\n AparteCompactErrorEventDetail,\n AparteAttachmentPreviewEventDetail,\n AparteLinkClickEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteChatRequest,\n AparteRequestMeta,\n AparteChatResponse,\n AparteChatMessage,\n AparteContentPart,\n AparteTextPart,\n AparteImagePart,\n AparteStreamEvent,\n AparteStreamEventMap,\n AparteUsage,\n AparteFinishReason,\n AparteTool,\n AparteToolCall,\n AparteApprovalPolicy,\n AparteApprovalRuling,\n AparteToolResult,\n AparteToolHandler,\n AparteToolContext,\n AparteToolRenderer,\n AparteToolSummary,\n AparteToolInputFormatter,\n AparteToolMatcher,\n AparteToolDisplay,\n AparteToolDetails,\n AparteToolCallView,\n AparteMountedView,\n AparteToolMount,\n AparteToolApprovalRequestDetail,\n AparteChatImperativeApi,\n AparteUiHandle,\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 AparteContextAttributes,\n AparteIconAttributes,\n AparteScrollRailAttributes,\n AparteSidebarAttributes,\n AparteSplitAttributes,\n AparteLauncherAttributes,\n AparteSuggestionsAttributes,\n} from './types/index.js';\nexport { AparteErrorCode, AparteError, contentToText } from './types/index.js';\n\n// Custom-element TYPES (erased) — keep server consumers fully typed.\n//\n// The element CLASSES too, as types: `frameworks/elements.md` promises the `node`\n// condition keeps \"every type\", and a server-side consumer typing a ref\n// (`ref: AparteChat`) or a wrapper's imperative surface needs the class's instance\n// type without its `HTMLElement` runtime. `export type` erases the value, so nothing\n// here touches the DOM at import.\nexport type {\n AparteChat, AparteChatBubble, AparteChatViewport, AparteChatStatus,\n AparteComposer, AparteComposerInput, AparteComposerSend, AparteComposerCancel,\n AparteComposerAttachments, AparteComposerAddAttachment, AparteComposerAction, AparteComposerToolbar,\n AparteSuggestions, AparteContext, AparteConversationList, AparteScrollRail, AparteSidebar,\n AparteSplit, AparteLauncher,\n} from './components/index.js';\nexport type { AparteScrollRailJumpDetail, AparteScrollRailEvery, AparteSidebarToggleDetail } from './components/index.js';\nexport type { AparteSplitResizeDetail } from './components/index.js';\nexport type { AparteLauncherToggleDetail } from './components/index.js';\nexport type { AparteElicitation } from './components/elicitation/aparte-elicitation.js';\nexport type { AparteSelect, AparteOption, AparteOptgroup, AparteIcon, AparteProgressSpinner } from './primitives/index.js';\nexport type { AparteSelectChangeDetail, AparteOptgroupToggleEventDetail } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteComposerPanelMode, AparteActionClickEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail, AparteConversationPinDetail, AparteConversationRenameDetail, AparteConversationStatus, AparteConversationStatusDetail } from './components/index.js';\nexport type { AparteSuggestion, AparteSuggestionEventDetail } from './components/index.js';\nexport type { AparteContextLevel, AparteContextThresholdEventDetail } 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 overrideSegmentRenderer,\n defineMountedToolRenderer,\n defineMountedSegmentRenderer,\n toToolCallView,\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 AparteAttachmentRow,\n AparteConversationLoadedDetail,\n} from './conversations/index.js';\nexport { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';\nexport {\n AparteConversationManager,\n type ConversationManagerOptions,\n type AparteConversationsListener,\n type AparteConversationTitleProvider,\n} 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, 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, createAparteAgentHandler, isFormatAdapter } from './transport/index.js';\nexport type {\n AparteTransport,\n AparteTransportContext,\n AparteFormatAdapter,\n AparteVendorRequest,\n BackendTransportOptions,\n DirectTransportOptions,\n AparteChatHandlerOptions,\n AparteAgentHandlerOptions,\n AparteAgentTool,\n AparteAgentRequestBody,\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 AparteLocale,\n AparteLocaleExtensions,\n AparteAction,\n AparteActionZone,\n AparteIconProvider,\n AparteIconName,\n AparteCoreIconName,\n AparteAvatarProvider,\n AparteStatusRenderer,\n AparteErrorRenderer,\n AparteAttachmentRenderer,\n AparteElicitationFieldRenderer,\n AparteElicitationFieldContext,\n AparteElicitationFieldControl,\n AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteSanitizer,\n} from './config/index.js';\nexport { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';\n\n// ── Client + runtime ─────────────────────────────────────────────────────────\nexport { AparteClient } from './client/aparte-client.js';\nexport { historyFromCheckpoint } from './context/checkpoint.js';\nexport { estimateTokens, estimateWireTokens, measureContext } from './context/measure.js';\nexport type { AparteContextMeasure, AparteContextMeasureInput } from './context/measure.js';\nexport type { AparteClientOptions, AparteToolApprovalResolver } from './client/aparte-client.js';\nexport { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';\nexport { toolRefusal } from './client/stream-adapter.js';\nexport { createAgentStreamRunner, type AgentStreamRunnerOptions } from './client/agent-runner.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';\nexport { copyText } from './utils/copy-text.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 *\n * With ONE thing to say. A `customElements` here means a DOM is present and this\n * DOM-free entry was still the one that resolved — which is a test runner: vitest,\n * jest and friends run on Node, so they take the `node` export condition, and jsdom\n * then supplies the registry. Nothing upgrades, `<aparte-chat>` stays an\n * `HTMLElement`, and every assertion about an element's own properties fails for a\n * reason nothing on the page explains. The escape is `@aparte/core/browser`, which is\n * why that entry exists; before it, the only way out was to reach into this package's\n * `src/`. One warning, not a throw: the environment is legal, only surprising.\n */\nexport function registerAllComponents(): void {\n if (typeof customElements !== 'undefined') {\n console.warn(\n \"[aparte] A DOM is present but '@aparte/core' resolved to its DOM-free Node entry, \"\n + 'so no <aparte-*> element will upgrade. Test runners hit this: they run on Node, '\n + \"so they take the 'node' export condition. Point your runner at '@aparte/core/browser', \"\n // The bare specifier only: a string alias is a PREFIX, and would send\n // '@aparte/core/icons' to '@aparte/core/browser/icons', which does not exist.\n + \"matching the bare specifier only (vitest: test.alias \"\n + \"[{ find: /^@aparte\\\\/core$/, replacement: '@aparte/core/browser' }]).\",\n );\n }\n}\n// Pure until called; the browser entry calls it at import.\nexport { installDialogTriggersOnce } from './interop/dialog-triggers.js';\n// A wrapper imports the release on the server too, and calls it only once mounted in a browser.\nexport { deferHydrationOf, releaseDeferredHydration } from './interop/defer-hydration.js';\n"],"names":[],"mappings":";AAwXO,SAAS,wBAA8B;AAC1C,MAAI,OAAO,mBAAmB,aAAa;AACvC,YAAQ;AAAA,MACJ;AAAA,IAAA;AAAA,EAQR;AACJ;"}
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 — and via `worker`, `workerd`,\n * `edge-light`, `deno` and `bun` for a Cloudflare Worker, an edge route or a\n * `target: 'webworker'` build. A worker built with the page's conditions imports it\n * by name, as `@aparte/core/headless`. 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 AparteContextSummary,\n AparteCompactor,\n AparteCompactorRequest,\n AparteCompactorOutcome,\n AparteCompactorReason,\n AparteContentParser,\n AparteStreamBlock,\n AparteStreamBlockMatch,\n AparteSendEventDetail,\n AparteViewportConfig,\n AparteInputConfig,\n AparteThemeVariables,\n AparteStatus,\n AparteAttachment,\n AparteMessageBranch,\n AparteBubbleActionsConfig,\n AparteBubbleActionName,\n AparteSegment,\n AparteSegmentTypes,\n AparteSegmentType,\n AparteTextSegment,\n AparteSource,\n AparteCitation,\n AparteThinkingSegment,\n AparteCodeSegment,\n AparteSegmentRenderer,\n AparteSegmentMount,\n AparteCustomSegment,\n AparteToolCallSegment,\n // The same five the browser barrel gained, and they belong here for the same reason:\n // a type has no DOM. `AparteSegmentBase` is the constraint on the exported\n // `AparteSegmentRenderer<T>`, so an SSR consumer writing a renderer for a segment type\n // of its own could not name what it extends. `check:node-barrel-types` is what caught\n // the omission — the browser barrel alone would have compiled fine and failed on the\n // `node` condition only.\n AparteSegmentBase,\n AparteSegmentDefaults,\n AparteSegmentTiming,\n AparteErrorSegment,\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 AparteAIProviderMetadata,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteApprovalModeChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageStartEventDetail,\n AparteMessageErrorEventDetail,\n AparteMessageAbortedEventDetail,\n AparteMessagePausedEventDetail,\n AparteMessageResumedEventDetail,\n AparteAbortEventDetail,\n AparteCompactEventDetail,\n AparteCompactDoneEventDetail,\n AparteCompactStartEventDetail,\n AparteCompactErrorEventDetail,\n AparteAttachmentPreviewEventDetail,\n AparteLinkClickEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteChatRequest,\n AparteRequestMeta,\n AparteChatResponse,\n AparteChatMessage,\n AparteContentPart,\n AparteTextPart,\n AparteImagePart,\n AparteStreamEvent,\n AparteStreamEventMap,\n AparteUsage,\n AparteFinishReason,\n AparteTool,\n AparteToolCall,\n AparteApprovalPolicy,\n AparteApprovalRuling,\n AparteToolResult,\n AparteToolHandler,\n AparteToolContext,\n AparteToolRenderer,\n AparteToolSummary,\n AparteToolInputFormatter,\n AparteToolMatcher,\n AparteToolDisplay,\n AparteToolDetails,\n AparteToolCallView,\n AparteMountedView,\n AparteToolMount,\n AparteToolApprovalRequestDetail,\n AparteChatImperativeApi,\n AparteUiHandle,\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 AparteContextAttributes,\n AparteIconAttributes,\n AparteScrollRailAttributes,\n AparteSidebarAttributes,\n AparteSplitAttributes,\n AparteLauncherAttributes,\n AparteSuggestionsAttributes,\n} from './types/index.js';\nexport { AparteErrorCode, AparteError, contentToText } from './types/index.js';\n\n// Custom-element TYPES (erased) — keep server consumers fully typed.\n//\n// The element CLASSES too, as types: `frameworks/elements.md` promises the `node`\n// condition keeps \"every type\", and a server-side consumer typing a ref\n// (`ref: AparteChat`) or a wrapper's imperative surface needs the class's instance\n// type without its `HTMLElement` runtime. `export type` erases the value, so nothing\n// here touches the DOM at import.\nexport type {\n AparteChat, AparteChatBubble, AparteChatViewport, AparteChatStatus,\n AparteComposer, AparteComposerInput, AparteComposerSend, AparteComposerCancel,\n AparteComposerAttachments, AparteComposerAddAttachment, AparteComposerAction, AparteComposerToolbar,\n AparteSuggestions, AparteContext, AparteConversationList, AparteScrollRail, AparteSidebar,\n AparteSplit, AparteLauncher,\n} from './components/index.js';\nexport type { AparteScrollRailJumpDetail, AparteScrollRailEvery, AparteSidebarToggleDetail } from './components/index.js';\nexport type { AparteSplitResizeDetail } from './components/index.js';\nexport type { AparteLauncherToggleDetail } from './components/index.js';\nexport type { AparteElicitation } from './components/elicitation/aparte-elicitation.js';\nexport type { AparteSelect, AparteOption, AparteOptgroup, AparteIcon, AparteProgressSpinner } from './primitives/index.js';\nexport type { AparteSelectChangeDetail, AparteOptgroupToggleEventDetail } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteComposerPanelMode, AparteActionClickEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail, AparteConversationPinDetail, AparteConversationRenameDetail, AparteConversationStatus, AparteConversationStatusDetail } from './components/index.js';\nexport type { AparteSuggestion, AparteSuggestionEventDetail } from './components/index.js';\nexport type { AparteContextLevel, AparteContextThresholdEventDetail } 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 overrideSegmentRenderer,\n defineMountedToolRenderer,\n defineMountedSegmentRenderer,\n toToolCallView,\n renderCodeLanguages,\n renderCitations,\n} from './renderers/index.js';\nexport type { AparteRenderCodeLanguagesOptions } 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 AparteAttachmentRow,\n AparteConversationLoadedDetail,\n} from './conversations/index.js';\nexport { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';\nexport {\n AparteConversationManager,\n type ConversationManagerOptions,\n type AparteConversationsListener,\n type AparteConversationTitleProvider,\n} 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, 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, createAparteAgentHandler, isFormatAdapter } from './transport/index.js';\nexport type {\n AparteTransport,\n AparteTransportContext,\n AparteFormatAdapter,\n AparteVendorRequest,\n BackendTransportOptions,\n DirectTransportOptions,\n AparteChatHandlerOptions,\n AparteAgentHandlerOptions,\n AparteAgentTool,\n AparteAgentRequestBody,\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 AparteCodeLanguageRenderer,\n AparteCodeLanguageContext,\n AparteHighlightProvider,\n AparteSystemPromptVarsProvider,\n AparteLocale,\n AparteLocaleExtensions,\n AparteAction,\n AparteActionZone,\n AparteIconProvider,\n AparteIconName,\n AparteCoreIconName,\n AparteAvatarProvider,\n AparteStatusRenderer,\n AparteErrorRenderer,\n AparteAttachmentRenderer,\n AparteElicitationFieldRenderer,\n AparteElicitationFieldContext,\n AparteElicitationFieldControl,\n AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteSanitizer,\n} from './config/index.js';\nexport { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';\n\n// ── Client + runtime ─────────────────────────────────────────────────────────\nexport { AparteClient } from './client/aparte-client.js';\nexport { historyFromCheckpoint } from './context/checkpoint.js';\nexport { estimateTokens, estimateWireTokens, measureContext } from './context/measure.js';\nexport type { AparteContextMeasure, AparteContextMeasureInput } from './context/measure.js';\nexport type { AparteClientOptions, AparteToolApprovalResolver } from './client/aparte-client.js';\nexport { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';\nexport { toolRefusal } from './client/stream-adapter.js';\nexport { createAgentStreamRunner, type AgentStreamRunnerOptions } from './client/agent-runner.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';\nexport { copyText } from './utils/copy-text.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 *\n * With ONE thing to say. A `customElements` here means a DOM is present and this\n * DOM-free entry was still the one that resolved — which is a test runner: vitest,\n * jest and friends run on Node, so they take the `node` export condition, and jsdom\n * then supplies the registry. Nothing upgrades, `<aparte-chat>` stays an\n * `HTMLElement`, and every assertion about an element's own properties fails for a\n * reason nothing on the page explains. The escape is `@aparte/core/browser`, which is\n * why that entry exists; before it, the only way out was to reach into this package's\n * `src/`. One warning, not a throw: the environment is legal, only surprising.\n */\nexport function registerAllComponents(): void {\n if (typeof customElements !== 'undefined') {\n console.warn(\n \"[aparte] A DOM is present but '@aparte/core' resolved to its DOM-free Node entry, \"\n + 'so no <aparte-*> element will upgrade. Test runners hit this: they run on Node, '\n + \"so they take the 'node' export condition. Point your runner at '@aparte/core/browser', \"\n // The bare specifier only: a string alias is a PREFIX, and would send\n // '@aparte/core/icons' to '@aparte/core/browser/icons', which does not exist.\n + \"matching the bare specifier only (vitest: test.alias \"\n + \"[{ find: /^@aparte\\\\/core$/, replacement: '@aparte/core/browser' }]).\",\n );\n }\n}\n// Pure until called; the browser entry calls it at import.\nexport { installDialogTriggersOnce } from './interop/dialog-triggers.js';\n// A wrapper imports the release on the server too, and calls it only once mounted in a browser.\nexport { deferHydrationOf, releaseDeferredHydration } from './interop/defer-hydration.js';\n"],"names":[],"mappings":";AA+XO,SAAS,wBAA8B;AAC1C,MAAI,OAAO,mBAAmB,aAAa;AACvC,YAAQ;AAAA,MACJ;AAAA,IAAA;AAAA,EAQR;AACJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"aparte-stream-parser.d.ts","sourceRoot":"","sources":["../../src/parsers/aparte-stream-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EACR,aAAa,EAIhB,MAAM,mBAAmB,CAAC;AAO3B,iEAAiE;AACjE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACtC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,2BAA2B,GAAG,2BAA2B,EAAE,CAAC;IACjF;;;;;OAKG;IACH,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,gDAAgD;IAChD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAQD,MAAM,WAAW,iBAAiB;IAC9B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IAC7C,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,WAAW,CAAC,EAAE,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3B,OAAO,CAAC,WAAW;IAKnB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,sBAAsB;CAQjC;AAMD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,yBAAyB,GACpC,aAAa,EAAE,CAKjB"}
@@ -0,0 +1,23 @@
1
+ import type { AparteConfig } from '../config/aparte-config.js';
2
+ import type { AparteSource, AparteTextSegment } from '../types/index.js';
3
+ /** The domain a source is shown by — `www.` dropped — or its title when it has no web address. */
4
+ export declare function sourceDomain(source: AparteSource): string;
5
+ /** "3 sources", "1 source", in the chat's language. */
6
+ export declare function sourcesCount(config: AparteConfig, n: number): string;
7
+ /** Take the chips away and show the markers again, before the text is drawn or read anew. */
8
+ export declare function unrenderCitations(root: Element): void;
9
+ /**
10
+ * Draw the chips of a text segment's citations in its rendered Markdown. Idempotent: the
11
+ * same segment drawn again changes nothing; text written anew (a reply streaming) gets its
12
+ * chips again, keeping the focus and an open card on the chip that replaces theirs. Call it
13
+ * after writing a segment's Markdown into an element of your own.
14
+ */
15
+ export declare function renderCitations(root: Element, segment: AparteTextSegment): void;
16
+ /** Relabel the chips under `root` in the chat's current language. */
17
+ export declare function relabelCitations(root: Element): void;
18
+ /**
19
+ * The sources of a reply, listed after its segments in `container`: a closed `<details>`,
20
+ * "3 sources", each a link. Removed when the reply has none; rebuilt only when they change.
21
+ */
22
+ export declare function renderSourceList(container: HTMLElement, after: Element, sources: readonly AparteSource[], config: AparteConfig): void;
23
+ //# sourceMappingURL=citations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"citations.d.ts","sourceRoot":"","sources":["../../src/renderers/citations.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAkB,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA+BzF,kGAAkG;AAClG,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAMzD;AAQD,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpE;AAwKD,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAYrD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAkF/E;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAGpD;AA6PD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,YAAY,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAyDrI"}
@@ -0,0 +1,30 @@
1
+ export interface AparteRenderCodeLanguagesOptions {
2
+ /** The content is still streaming: its last source, and any marked open, are still arriving. */
3
+ streaming?: boolean;
4
+ /**
5
+ * Only redraw what is drawn already, where what it depends on moved (a renderer's
6
+ * `cacheKey`, a theme). For a renderer reacting to its own change, over a whole page.
7
+ */
8
+ refresh?: boolean;
9
+ /** Only this language. */
10
+ language?: string;
11
+ }
12
+ /**
13
+ * Draw every placeholder under `root` whose language has a renderer.
14
+ *
15
+ * Core calls it wherever it writes Markdown or a code block; call it yourself after
16
+ * writing a provider's HTML into an element of your own (a custom segment renderer).
17
+ * Idempotent and cheap when nothing changed, and a no-op where no renderer is registered.
18
+ */
19
+ export declare function renderCodeLanguages(root: Element, options?: AparteRenderCodeLanguagesOptions): void;
20
+ /**
21
+ * Take every drawing under `root` away and show the sources again — before something
22
+ * re-serialises `root` through the sanitizer, which would strip what a drawing is made
23
+ * of. Drawing again afterwards costs nothing: the drawings are cached.
24
+ */
25
+ export declare function unrenderCodeLanguages(root: Element): void;
26
+ /** Let each drawing under `root` re-read what it takes from the config: the locale changed. */
27
+ export declare function relabelCodeLanguages(root: Element): void;
28
+ /** Whether a code block in `language` is drawn by a registered renderer, so a highlighter should leave it. */
29
+ export declare function isDrawnLanguage(language: string, element?: Element | null): boolean;
30
+ //# sourceMappingURL=code-languages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-languages.d.ts","sourceRoot":"","sources":["../../src/renderers/code-languages.ts"],"names":[],"mappings":"AAqDA,MAAM,WAAW,gCAAgC;IAC7C,gGAAgG;IAChG,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AA8ZD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,GAAE,gCAAqC,GAAG,IAAI,CAqCvG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAMzD;AAED,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAOxD;AAED,8GAA8G;AAC9G,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAEnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"highlight-stream.d.ts","sourceRoot":"","sources":["../../src/renderers/highlight-stream.ts"],"names":[],"mappings":"AAoCA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAOnF;AAQD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC3B,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACd,IAAI,CA6CN"}
1
+ {"version":3,"file":"highlight-stream.d.ts","sourceRoot":"","sources":["../../src/renderers/highlight-stream.ts"],"names":[],"mappings":"AAoCA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAOnF;AAQD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC3B,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACd,IAAI,CAkDN"}
@@ -3,4 +3,7 @@
3
3
  */
4
4
  export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, getAllRenderers, collectRendererStyles, registerDefaultRenderers, installDefaultRenderersOnce, declineDefaultRenderers, overrideSegmentRenderer } from './segment-renderers.js';
5
5
  export { defineMountedToolRenderer, defineMountedSegmentRenderer, toToolCallView } from './mounted-renderer.js';
6
+ export { renderCodeLanguages } from './code-languages.js';
7
+ export { renderCitations } from './citations.js';
8
+ export type { AparteRenderCodeLanguagesOptions } from './code-languages.js';
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC"}
@@ -16,7 +16,9 @@ export type AparteMarkdownStreamHost = HTMLElement & {
16
16
  } | null;
17
17
  };
18
18
  /**
19
- * Render `content` into `contentEl`, incrementally while streaming.
19
+ * Render `content` into `contentEl`, incrementally while streaming, then draw the code
20
+ * languages a renderer is registered for — maths, a diagram — on every path out, so a
21
+ * formula is drawn as soon as its provider has written it.
20
22
  *
21
23
  * @param host the segment's root element, which holds the parser state
22
24
  * @param contentEl the element whose children are the rendered Markdown
@@ -39,4 +41,13 @@ export declare function writeStreamedMarkdown(host: AparteMarkdownStreamHost, co
39
41
  * — exactly like the code renderer's own call.
40
42
  */
41
43
  export declare function highlightMarkdownFences(contentEl: Element): void;
44
+ /**
45
+ * Put a highlighter's whole-block answer in place of `pre`, marked as highlighted.
46
+ *
47
+ * The mark is what tells the next pass to leave it: a highlighter's `<pre>` usually drops
48
+ * the `language-*` class, so a block highlighted once and passed over again — a settled
49
+ * reply a framework re-syncs, which keeps its DOM now — was highlighted a second time as
50
+ * a language-less block, and lost its colours.
51
+ */
52
+ export declare function replaceHighlighted(pre: Element, html: string): void;
42
53
  //# sourceMappingURL=markdown-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-stream.d.ts","sourceRoot":"","sources":["../../src/renderers/markdown-stream.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAG1E;;;;;;;;;GASG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG;IACjD,UAAU,CAAC,EAAE;QAAE,QAAQ,EAAE,+BAA+B,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACtF,CAAC;AAqCF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,wBAAwB,EAC9B,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,OAAO,GACnB,IAAI,CAsDN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAsBhE"}
1
+ {"version":3,"file":"markdown-stream.d.ts","sourceRoot":"","sources":["../../src/renderers/markdown-stream.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAK1E;;;;;;;;;GASG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG;IACjD,UAAU,CAAC,EAAE;QAAE,QAAQ,EAAE,+BAA+B,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACtF,CAAC;AA4CF;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,wBAAwB,EAC9B,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,OAAO,GACnB,IAAI,CAGN;AA2ED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CA0BhE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAKnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/code.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACR,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,YAAY,EAAE,qBAAqB,CAAC,iBAAiB,CAsDjE,CAAC"}
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/code.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACR,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;AAsE9B,eAAO,MAAM,YAAY,EAAE,qBAAqB,CAAC,iBAAiB,CAgDjE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/text.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACR,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,qBAAqB,CAAC,iBAAiB,CA2BjE,CAAC"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/text.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACR,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,qBAAqB,CAAC,iBAAiB,CAgCjE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/thinking.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACR,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAoD9B,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,CAAC,qBAAqB,CA+EzE,CAAC"}
1
+ {"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/thinking.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACR,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAoD9B,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,CAAC,qBAAqB,CAoFzE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"backend-handler.d.ts","sourceRoot":"","sources":["../../src/transport/backend-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAInE,MAAM,WAAW,wBAAwB;IACrC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5C;;;;;;;;;;;;;OAaG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC9E;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACtF;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,wBAAwB,GAClC,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAwJrC"}
1
+ {"version":3,"file":"backend-handler.d.ts","sourceRoot":"","sources":["../../src/transport/backend-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAInE,MAAM,WAAW,wBA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,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,uBAAuB;IAEvD,IAAI,CACN,SAAS,EAAE,gBAAgB,EAC3B,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAClD,GAAG,EAAE,sBAAsB,GAC5B,OAAO,CAAC,kBAAkB,CAAC;CA4BjC"}
1
+ {"version":3,"file":"backend-transport.d.ts","sourceRoot":"","sources":["../../src/transport/backend-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAwB,MAAM,kBAAkB,CAAC;AACpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAI1E,MAAM,WAAW,uBAAuB;IACpC,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CAC3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,uBAAuB;IAEvD,IAAI,CACN,SAAS,EAAE,gBAAgB,EAC3B,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAClD,GAAG,EAAE,sBAAsB,GAC5B,OAAO,CAAC,kBAAkB,CAAC;CA8BjC"}
@@ -12,7 +12,7 @@
12
12
  * A provider exposes EITHER the format-adapter surface OR a legacy monolithic
13
13
  * `chat()` (fetch + key + parse); the transports handle both.
14
14
  */
15
- import type { AparteChatRequest, AparteChatResponse, AparteStreamEvent } from '../types/chat.js';
15
+ import type { AparteChatRequest, AparteChatResponse, AparteStreamEvent, AparteStreamEventMap } from '../types/chat.js';
16
16
  import type { AparteAIProvider } from '../types/model-provider.js';
17
17
  import { AparteError, AparteErrorCode } from '../types/errors.js';
18
18
  /** A vendor HTTP request built from an Aparte request — auth is injected separately. */
@@ -39,6 +39,13 @@ export interface AparteFormatAdapter {
39
39
  parseStream(body: ReadableStream<Uint8Array>): ReadableStream<AparteStreamEvent>;
40
40
  /** Extract text from a non-streaming vendor JSON response. */
41
41
  parseText?(json: unknown): string;
42
+ /**
43
+ * The sources a non-streaming vendor JSON response cites, and where (offsets into the
44
+ * text `parseText` returns) — the `sources` event a stream would carry. With it, a
45
+ * non-streaming answer that cites anything resolves to a stream of its text, its
46
+ * sources and its end, instead of a bare string.
47
+ */
48
+ parseSources?(json: unknown): AparteStreamEventMap['sources'] | undefined;
42
49
  /**
43
50
  * Name the failure of a non-ok vendor response, for the ones a status cannot: a 400
44
51
  * whose body says the prompt overflowed the model's window is `USAGE_CONTEXT_EXCEEDED`,
@@ -94,5 +101,11 @@ export declare function vendorError(response: Response, label?: string, adapter?
94
101
  */
95
102
  export declare function parseNonStreamText(provider: {
96
103
  parseText?: (json: unknown) => string;
97
- }, response: Response, providerId: string): Promise<string>;
104
+ parseSources?: AparteFormatAdapter['parseSources'];
105
+ }, response: Response, providerId: string): Promise<AparteChatResponse>;
106
+ /**
107
+ * A whole answer: the bare text, or — when it cites sources — the stream a streaming answer
108
+ * would have been, so its sources reach the reply the same way.
109
+ */
110
+ export declare function withSources(text: string, sources: AparteStreamEventMap['sources'] | undefined): AparteChatResponse;
98
111
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/transport/types.ts"],"names":[],"mappings":"AAA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AAK,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAA;CAAE,EACvG,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,CAU7B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,kBAAkB,CAUlH"}
@@ -2,7 +2,7 @@
2
2
  * Aparte Chat Request & Stream Types
3
3
  */
4
4
  import type { AparteTool, AparteToolCall } from './tools.js';
5
- import type { AparteSegment } from './segments.js';
5
+ import type { AparteSegment, AparteSource, AparteCitation } from './segments.js';
6
6
  import type { AparteErrorCode } from './errors.js';
7
7
  /** Plain text content part */
8
8
  export interface AparteTextPart {
@@ -202,6 +202,15 @@ export interface AparteStreamEventMap {
202
202
  code?: AparteErrorCode;
203
203
  };
204
204
  tool_use: AparteToolCall;
205
+ /**
206
+ * The sources the reply draws on, and where it cites them: offsets into the text this
207
+ * model call has streamed so far (every `text` delta, joined). Sent once, or as they
208
+ * arrive; a later event adds to the earlier ones.
209
+ */
210
+ sources: {
211
+ sources: AparteSource[];
212
+ citations?: AparteCitation[];
213
+ };
205
214
  }
206
215
  /** Discriminated union derived from AparteStreamEventMap — stays in sync automatically. */
207
216
  export type AparteStreamEvent = {
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAMnD,8BAA8B;AAC9B,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,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B,CAAC,IAAI,MAAM,oBAAoB,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC;CAC3E,CAAC,MAAM,oBAAoB,CAAC,CAAA;AAE7B,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"}
@@ -11,7 +11,7 @@ export type { AparteStreamBlock, AparteStreamBlockMatch } from './stream-blocks.
11
11
  export type { AparteCompactor, AparteCompactorRequest, AparteCompactorOutcome, AparteCompactorReason } from './compactor.js';
12
12
  export type { AparteSendEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, AparteLinkClickEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail } from './events.js';
13
13
  export type { AparteContentParser, AparteParserRegistry } from './parsers.js';
14
- export type { AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteTextSegment, AparteThinkingSegment, AparteCodeSegment, AparteErrorSegment, AparteSegment, AparteSegmentTypes, AparteCustomSegment, AparteToolCallSegment, AparteSegmentType, AparteSegmentRenderer, AparteSegmentMount, AparteSegmentUpdateEventDetail } from './segments.js';
14
+ export type { AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteTextSegment, AparteSource, AparteCitation, AparteThinkingSegment, AparteCodeSegment, AparteErrorSegment, AparteSegment, AparteSegmentTypes, AparteCustomSegment, AparteToolCallSegment, AparteSegmentType, AparteSegmentRenderer, AparteSegmentMount, AparteSegmentUpdateEventDetail } from './segments.js';
15
15
  export type { AparteThemeVariables } from './theming.js';
16
16
  export type { AparteAIModel, AparteAIProvider, AparteAIProviderMetadata, AparteAIProviderConfigField, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress } from './model-provider.js';
17
17
  export type { AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteFinishReason } from './chat.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACpB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAM7H,YAAY,EACR,qBAAqB,EACrB,iBAAiB,EACjB,+BAA+B,EAC/B,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EAC1B,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,8BAA8B,EACjC,MAAM,eAAe,CAAC;AAgBvB,YAAY,EACR,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACR,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,i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E,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACpB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAM7H,YAAY,EACR,qBAAqB,EACrB,iBAAiB,EACjB,+BAA+B,EAC/B,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EAC1B,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,8BAA8B,EACjC,MAAM,eAAe,CAAC;AAgBvB,YAAY,EACR,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACR,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,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qB,CAAC"}
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @packageDocumentation
9
9
  */
10
- import { AparteChatRequest, AparteChatResponse, AparteStreamEvent } from './chat.js';
10
+ import { AparteChatRequest, AparteChatResponse, AparteStreamEvent, AparteStreamEventMap } from './chat.js';
11
11
  import type { AparteErrorCode } from './errors.js';
12
12
  /**
13
13
  * Represents an AI model that can be selected by the user.
@@ -209,6 +209,8 @@ export interface AparteAIProviderFormat {
209
209
  parseStream(body: ReadableStream<Uint8Array>): ReadableStream<AparteStreamEvent>;
210
210
  /** Extract text from a non-streaming vendor JSON response. */
211
211
  parseText?(json: unknown): string;
212
+ /** The sources a non-streaming vendor JSON response cites — see `AparteFormatAdapter.parseSources`. */
213
+ parseSources?(json: unknown): AparteStreamEventMap['sources'] | undefined;
212
214
  /** Name a non-ok vendor response a status cannot (an overflowing prompt) — see `AparteFormatAdapter.classifyError`. */
213
215
  classifyError?(status: number, body: unknown): AparteErrorCode | undefined;
214
216
  }
@@ -1 +1 @@
1
- {"version":3,"file":"model-provider.d.ts","sourceRoot":"","sources":["../../src/types/model-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAMnD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC1B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IAEX,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IAEb,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mDAAmD;IACnD,OAAO,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF,gCAAgC;IAChC,YAAY,CAAC,EAAE,CAAC,QAAQ,GAAG,kBAAkB,GAAG,W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E,CAAC,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,MAAM,gBAAgB,GACtB,CAAC,oBAAoB,GAAG,sBAAsB,GAAG,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,GACtG,CAAC,oBAAoB,GAAG,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG,2BAA2B,CAAC,CAAC;AAMpH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAExC,0BAA0B;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -93,6 +93,42 @@ export interface AparteSegmentTiming {
93
93
  export interface AparteTextSegment extends AparteSegmentBase {
94
94
  type: 'text';
95
95
  content: string;
96
+ /**
97
+ * The sources this text draws on — a web search's results, the documents it quotes.
98
+ * The bubble lists them under the reply; a {@link AparteCitation} places a chip in the text.
99
+ */
100
+ sources?: AparteSource[];
101
+ /** Where in `content` each source is cited: a chip at the end of the passage. */
102
+ citations?: AparteCitation[];
103
+ }
104
+ /** One source a reply draws on. Shown by its domain, its title in the card and the list. */
105
+ export interface AparteSource {
106
+ /** Unique within the message; what a {@link AparteCitation} names. */
107
+ id: string;
108
+ /** Only `https:`, `http:` and the like are linked (the sanitizer's URL policy). */
109
+ url?: string;
110
+ title?: string;
111
+ /** A short excerpt, shown in the card. */
112
+ snippet?: string;
113
+ }
114
+ /**
115
+ * A passage of a text segment that cites sources: offsets into the segment's `content`,
116
+ * in UTF-16 code units (JavaScript string indices), `end` exclusive. The chip goes at the
117
+ * end of the passage — after its punctuation, never inside code, emphasis or a link.
118
+ *
119
+ * @example
120
+ * { end: 42, sources: ['s1', 's3'] }
121
+ */
122
+ export interface AparteCitation {
123
+ start?: number;
124
+ end: number;
125
+ /** Ids of the {@link AparteSource}s, in the order the card pages through them. */
126
+ sources: string[];
127
+ /**
128
+ * `[start, end)` is a marker the model wrote for the citation (Perplexity's `[1]`): the
129
+ * chip takes its place on screen. The text itself is left as it was written.
130
+ */
131
+ marker?: boolean;
96
132
  }
97
133
  /**
98
134
  * Field defaults for one segment TYPE, merged when a segment enters a message.