@aparte/core 0.2.0-alpha.0 → 0.4.0-alpha.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 (42) hide show
  1. package/README.md +21 -0
  2. package/dist/client/aparte-client.d.ts +21 -0
  3. package/dist/client/aparte-client.d.ts.map +1 -1
  4. package/dist/components/bubble/aparte-chat-bubble.d.ts +11 -0
  5. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
  6. package/dist/components/chat/aparte-chat.d.ts +13 -0
  7. package/dist/components/chat/aparte-chat.d.ts.map +1 -1
  8. package/dist/components/viewport/aparte-chat-viewport.d.ts +13 -2
  9. package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
  10. package/dist/config/aparte-config.d.ts +16 -2
  11. package/dist/config/aparte-config.d.ts.map +1 -1
  12. package/dist/config/icon-provider.d.ts +21 -21
  13. package/dist/config/icon-provider.d.ts.map +1 -1
  14. package/dist/conversations/conversation-controller.d.ts.map +1 -1
  15. package/dist/custom-elements.json +3658 -3385
  16. package/dist/host/aparte-chat-host.d.ts +47 -1
  17. package/dist/host/aparte-chat-host.d.ts.map +1 -1
  18. package/dist/{index-D89k-n2Q.js → index-BBg6dsYx.js} +193 -43
  19. package/dist/index-BBg6dsYx.js.map +1 -0
  20. package/dist/index.css +60 -6
  21. package/dist/index.d.ts +10 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +123 -26
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.node.d.ts +2 -0
  26. package/dist/index.node.d.ts.map +1 -1
  27. package/dist/index.node.js +16 -14
  28. package/dist/index.node.js.map +1 -1
  29. package/dist/primitives/select/aparte-optgroup.d.ts +2 -0
  30. package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
  31. package/dist/primitives/select/aparte-select.d.ts +2 -0
  32. package/dist/primitives/select/aparte-select.d.ts.map +1 -1
  33. package/dist/types/imperative-api.d.ts +27 -0
  34. package/dist/types/imperative-api.d.ts.map +1 -1
  35. package/dist/types/model-provider.d.ts +9 -3
  36. package/dist/types/model-provider.d.ts.map +1 -1
  37. package/dist/utils/files-to-attachments.d.ts +27 -0
  38. package/dist/utils/files-to-attachments.d.ts.map +1 -0
  39. package/dist/utils/is-awaiting-reply.d.ts +22 -0
  40. package/dist/utils/is-awaiting-reply.d.ts.map +1 -0
  41. package/package.json +8 -1
  42. package/dist/index-D89k-n2Q.js.map +0 -1
@@ -42,6 +42,8 @@ export type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget,
42
42
  export { MessageRepository } from './runtime/message-repository.js';
43
43
  export type { ExportedMessageRepository } from './runtime/message-repository.js';
44
44
  export { applyElementProps, DEFAULT_UI_EVENTS } from './interop/element-props.js';
45
+ export { filesToAttachments } from './utils/files-to-attachments.js';
46
+ export { isAwaitingReply } from './utils/is-awaiting-reply.js';
45
47
  export { requestUserInput, buildElicitationPanel } from './elicitation/index.js';
46
48
  export type { AparteElicitationSchema, AparteElicitationField, AparteElicitationEnumField, AparteElicitationBooleanField, AparteElicitationStringField, AparteElicitationObjectSchema, AparteElicitationRequest, AparteElicitationResult, AparteElicitationPresenter, BuiltElicitationPanel, } from './elicitation/index.js';
47
49
  /**
@@ -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,sBAAsB,EACtB,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,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,E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, o, p, q, r, s, t, u, v, w, x, y, z, E, F, G, H, I, J, K, L, N, O, P } from "./index-D89k-n2Q.js";
1
+ import { A, a, b, c, d, e, f, g, h, i, B, C, D, j, k, l, m, M, n, o, p, q, r, s, t, u, v, w, x, y, z, E, F, G, H, I, J, K, L, N, O, P, Q, R } from "./index-BBg6dsYx.js";
2
2
  function registerAllComponents() {
3
3
  }
4
4
  export {
@@ -31,19 +31,21 @@ export {
31
31
  v as defaultSanitizer,
32
32
  w as deriveArtifactKind,
33
33
  x as detachConfig,
34
- y as getSegmentRenderer,
35
- z as isFormatAdapter,
36
- E as isSafeUrl,
37
- F as parseAparteEventStream,
38
- G as parseMarkdownToSegments,
39
- H as populateBubbleFromMessage,
40
- I as readableToAsyncIterable,
34
+ y as filesToAttachments,
35
+ z as getSegmentRenderer,
36
+ E as isAwaitingReply,
37
+ F as isFormatAdapter,
38
+ G as isSafeUrl,
39
+ H as parseAparteEventStream,
40
+ I as parseMarkdownToSegments,
41
+ J as populateBubbleFromMessage,
42
+ K as readableToAsyncIterable,
41
43
  registerAllComponents,
42
- J as registerDefaultRenderers,
43
- K as registerSegmentRenderer,
44
- L as requestUserInput,
45
- N as resolveConfig,
46
- O as runWithConfig,
47
- P as unregisterSegmentRenderer
44
+ L as registerDefaultRenderers,
45
+ N as registerSegmentRenderer,
46
+ O as requestUserInput,
47
+ P as resolveConfig,
48
+ Q as runWithConfig,
49
+ R as unregisterSegmentRenderer
48
50
  };
49
51
  //# 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. 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 AparteTokenEventDetail,\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 AparteTerminalSegment,\n AparteSegmentRenderer,\n AparteCustomSegment,\n AparteToolCallSegment,\n AparteArtifactSegment,\n AparteAIProvider,\n AparteAIModel,\n AparteAIProviderConfigField,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteArtifactStartEventDetail,\n AparteArtifactDeltaEventDetail,\n AparteArtifactReadyEventDetail,\n AparteArtifactOpenEventDetail,\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 AparteToolRenderer,\n AparteToolDecisionDetail,\n AparteToolApprovalRequestDetail,\n AparteToolActionDetail,\n AparteChatImperativeApi,\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 } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail } 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} 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 { ConversationManager, 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 { DirectTransport, BackendTransport, 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 { AparteConfig, AparteConfigClass } from './config/index.js';\nexport { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } 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 AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteArtifactPreviewBuilder,\n AparteSanitizer,\n} from './config/index.js';\nexport { DEFAULT_ICON_FALLBACKS, DEFAULT_SKELETON_FALLBACKS, 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 { MessageRepository } 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`/`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, DEFAULT_UI_EVENTS } from './interop/element-props.js';\n\n// Elicitation (human-in-the-loop typed input) — DOM-free at import.\nexport { requestUserInput, buildElicitationPanel } 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 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":";AAoNO,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 AparteTokenEventDetail,\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 AparteTerminalSegment,\n AparteSegmentRenderer,\n AparteCustomSegment,\n AparteToolCallSegment,\n AparteArtifactSegment,\n AparteAIProvider,\n AparteAIModel,\n AparteAIProviderConfigField,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteArtifactStartEventDetail,\n AparteArtifactDeltaEventDetail,\n AparteArtifactReadyEventDetail,\n AparteArtifactOpenEventDetail,\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 AparteToolRenderer,\n AparteToolDecisionDetail,\n AparteToolApprovalRequestDetail,\n AparteToolActionDetail,\n AparteChatImperativeApi,\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 } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail } 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} 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 { ConversationManager, 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 { DirectTransport, BackendTransport, 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 { AparteConfig, AparteConfigClass } from './config/index.js';\nexport { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } 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 AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteArtifactPreviewBuilder,\n AparteSanitizer,\n} from './config/index.js';\nexport { DEFAULT_ICON_FALLBACKS, DEFAULT_SKELETON_FALLBACKS, 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 { MessageRepository } 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`/`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, 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 } from './utils/files-to-attachments.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';\n\n// Elicitation (human-in-the-loop typed input) — DOM-free at import.\nexport { requestUserInput, buildElicitationPanel } 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 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":";AA0NO,SAAS,wBAA8B;AAE9C;"}
@@ -9,6 +9,8 @@
9
9
  * @attr {boolean} collapsed - Collapsed state
10
10
  */
11
11
  export declare class AparteOptgroup extends HTMLElement {
12
+ /** Ids for the label span the group points `aria-labelledby` at. */
13
+ private static _labelIdSeq;
12
14
  static get observedAttributes(): string[];
13
15
  connectedCallback(): void;
14
16
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
@@ -1 +1 @@
1
- {"version":3,"file":"aparte-optgroup.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/aparte-optgroup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,qBAAa,cAAe,SAAQ,WAAW;IAC3C,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAKzB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM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C,OAAO;IA4Cf,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,qBAAqB;CAMhC;AAOD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,cAAc,CAAC;KACrC;CACJ"}
@@ -25,6 +25,8 @@ export interface AparteSelectChangeDetail {
25
25
  }
26
26
  export declare class AparteSelect extends HTMLElement {
27
27
  private static _optIdSeq;
28
+ /** Fallback ids for the listbox `aria-controls` target when the host has no id. */
29
+ private static _listboxSeq;
28
30
  private _value;
29
31
  private _isOpen;
30
32
  private _activeIndex;
@@ -1 +1 @@
1
- {"version":3,"file":"aparte-select.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/aparte-select.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,CAAC;AAE9B,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,YAAa,SAAQ,WAAW;IACzC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAK;IAE7B,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,YAAY,CAAiC;IACrD,OAAO,CAAC,SAAS,CAAiC;IAGlD,OAAO,CAAC,yBAAyB,CAAwC;IACzE,OAAO,CAAC,mBAAmB,CAAkC;IAE7D,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAQzB,oBAAoB,IAAI,IAAI;IAM5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MA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C,iBAAiB;IASzB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,WAAW;CAatB;AAOD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACJ"}
@@ -19,6 +19,19 @@ export interface AparteChatImperativeApi {
19
19
  addSegment: (segment: AparteSegment) => void;
20
20
  updateSegment: (segmentId: string, updates: Partial<AparteSegment>) => void;
21
21
  removeSegment: (segmentId: string) => void;
22
+ /**
23
+ * Append text to a segment of the last message — the streaming path for a
24
+ * thinking block, a tool pill, or any segment that grows token by token.
25
+ *
26
+ * Each chunk is written straight into the bubble, and the framework's message
27
+ * list is synced **once per frame** rather than per chunk, so streaming a
28
+ * segment costs about one render per frame instead of one per token.
29
+ *
30
+ * Note that segments and `content` are mutually exclusive at render time: as
31
+ * soon as a message has segments the bubble hides its plain `content`, so a
32
+ * message driven by `injectTokenStream` (which writes `content`) can't also show
33
+ * a `thinking` segment — put the text in a segment of its own instead.
34
+ */
22
35
  appendToSegment: (segmentId: string, content: string) => void;
23
36
  getMessages: () => AparteMessage[];
24
37
  clearMessages: () => void;
@@ -26,7 +39,21 @@ export interface AparteChatImperativeApi {
26
39
  addSiblingOf: (existingId: string, message: AparteMessage) => string | null;
27
40
  truncateFrom: (messageId: string) => void;
28
41
  truncateResponsesAfter: (userMessageId: string) => void;
42
+ /**
43
+ * Stream tokens into a message from your own loop (no `AparteClient`
44
+ * involved) — the display-only / bring-your-own-loop mode. Resolves when
45
+ * the iterable completes; the message is then marked complete.
46
+ *
47
+ * If `messageId` doesn't exist the viewport auto-creates an empty
48
+ * assistant message — but only in its internal repo, NOT in the
49
+ * framework's message state. In a wrapper, call
50
+ * `appendMessage({ id, role: 'assistant', content: '' , timestamp: Date.now() })`
51
+ * first so both stay in sync. Starting a new stream cancels the previous
52
+ * one; {@link stopTokenStream} cancels explicitly. See the
53
+ * "Bring your own loop" guide.
54
+ */
29
55
  injectTokenStream: (messageId: string, tokens: AsyncIterable<string>) => Promise<void>;
56
+ /** Abort an in-flight {@link injectTokenStream} loop (the source iterable is `return()`ed). */
30
57
  stopTokenStream: () => void;
31
58
  setConversationId: (id: string | null) => Promise<void>;
32
59
  scrollToBottom: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"imperative-api.d.ts","sourceRoot":"","sources":["../../src/types/imperative-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,WAAW,uBAAuB;IAEpC,aAAa,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC5E,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7E,UAAU,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC5E,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,WAAW,EAAE,MAAM,aAAa,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,KAAK,MAAM,GAAG,I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aAAa,CAAC,KAAK,IAAI,CAAC;IAC5E,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;;;;;;;;;OAYG;IACH,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,WAAW,EAAE,MAAM,aAAa,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,KAAK,MAAM,GAAG,IAAI,CAAC;IAC5E,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,sBAAsB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAExD;;;;;;;;;;;;OAYG;IACH,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvF,+FAA+F;IAC/F,eAAe,EAAE,MAAM,IAAI,CAAC;IAE5B,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,wFAAwF;IACxF,WAAW,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CACzC"}
@@ -140,10 +140,16 @@ export interface AparteAIProvider {
140
140
  */
141
141
  getMetadata(): AparteAIProviderMetadata;
142
142
  /**
143
- * Returns the list of available models.
144
- * Can be synchronous (static list) or async (API fetch).
143
+ * Returns the list of available models **synchronously** (static or cached
144
+ * list). Never return a Promise here it would be ignored by
145
+ * `getCurrentModel()`, silently disabling capability gates such as
146
+ * `function_calling` (tools). For async fetching implement
147
+ * {@link fetchModels} instead, which `AparteConfig.refreshProviderModels()`
148
+ * and the model-selector consume. Note: a provider without `fetchModels`
149
+ * shows no models in the model-selector — `getModels()` is only read for
150
+ * the current-model lookup.
145
151
  */
146
- getModels(): AparteAIModel[] | Promise<AparteAIModel[]>;
152
+ getModels(): AparteAIModel[];
147
153
  /**
148
154
  * Optional: Fetch models dynamically from an API.
149
155
  * Useful for providers like OpenRouter that have evolving model lists.
@@ -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;AAMrF;;;;;;;;;;;;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,WAAW,GAAG,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC;IAEtF,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAMD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACjB,OAAO,GACP,QAAQ,GACR,gBAAgB,CAAC;AAEvB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,uCAAuC;IACvC,MAAM,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,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,gFAAgF;IAChF,SAAS,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,WAAW,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAClF,8DAA8D;IAC9D,SAAS,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IAElC;;;;;;;;;OASG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvD;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1F;;;;OAIG;IACH,WAAW,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAMD;;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"}
@@ -0,0 +1,27 @@
1
+ import type { AparteAttachment } from '../types/models.js';
2
+ /**
3
+ * Turn the `File[]` an `aparte-send` event carries into the
4
+ * {@link AparteAttachment}[] a message renders.
5
+ *
6
+ * The composer hands you raw `File`s; a bubble needs an id, a MIME type and a
7
+ * `url` to show a chip or a thumbnail. The `ConversationController` (used by the
8
+ * framework wrappers) does this internally — this is the same conversion,
9
+ * exported so a raw-core consumer driving `appendMessage()` itself doesn't have
10
+ * to hand-roll object URLs:
11
+ *
12
+ * ```ts
13
+ * chat.addEventListener('aparte-send', (e) => {
14
+ * const { content, files } = e.detail;
15
+ * chat.viewport?.appendMessage({
16
+ * id: crypto.randomUUID(), role: 'user', content, timestamp: Date.now(),
17
+ * ...(files?.length ? { attachments: filesToAttachments(files) } : {}),
18
+ * });
19
+ * });
20
+ * ```
21
+ *
22
+ * The `url` comes from `URL.createObjectURL`, so it lives as long as the
23
+ * document; the raw `File` rides along on `blob` for storage adapters that
24
+ * persist attachments and rebuild the url on reload.
25
+ */
26
+ export declare function filesToAttachments(files: readonly File[]): AparteAttachment[];
27
+ //# sourceMappingURL=files-to-attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files-to-attachments.d.ts","sourceRoot":"","sources":["../../src/utils/files-to-attachments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,gBAAgB,EAAE,CAS7E"}
@@ -0,0 +1,22 @@
1
+ import type { AparteMessage } from '../types/index.js';
2
+ /**
3
+ * Is this message waiting for a reply — i.e. should the bubble render as
4
+ * in-progress (waiting indicator, `aria-busy`, no action bar) rather than as a
5
+ * finished answer?
6
+ *
7
+ * Two clauses:
8
+ *
9
+ * 1. **Stated**: `status` is `'streaming'` or `'pending'`. This is exactly the
10
+ * condition every call site used before this helper existed, role included, so
11
+ * no existing behaviour shifts.
12
+ * 2. **Inferred**: an **assistant** message with **no `status` at all** and nothing
13
+ * in it — no `content`, no `segments`. That is the empty shell a token stream is
14
+ * about to fill (`appendMessage({ role: 'assistant', content: '' })` from a
15
+ * hand-rolled loop). It used to render as a completed reply, action bar and all,
16
+ * on a message that had never said anything.
17
+ *
18
+ * Only silence is interpreted. An explicit `status` — including `'completed'` on an
19
+ * empty message — is the application talking, and is believed.
20
+ */
21
+ export declare function isAwaitingReply(message: Pick<AparteMessage, 'role' | 'status' | 'content' | 'segments'>): boolean;
22
+ //# sourceMappingURL=is-awaiting-reply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-awaiting-reply.d.ts","sourceRoot":"","sources":["../../src/utils/is-awaiting-reply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC,GAAG,OAAO,CAMjH"}
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "@aparte/core",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.4.0-alpha.0",
4
4
  "description": "High-performance AI conversation engine - Zero-dependency Web Components",
5
5
  "type": "module",
6
+ "//sideEffects": "The BROWSER entry defines the custom elements and imports CSS at module scope, so it must never be tree-shaken; the Node entry (`index.node`) and every other module are pure. Listing them explicitly is what lets a bundler drop the rest — the whole package was implicitly side-effectful before, the only one of the 14 without this field.",
7
+ "sideEffects": [
8
+ "./dist/index.js",
9
+ "./src/index.ts",
10
+ "**/*.css"
11
+ ],
6
12
  "main": "./dist/index.js",
7
13
  "module": "./dist/index.js",
8
14
  "types": "./dist/index.d.ts",
9
15
  "customElements": "dist/custom-elements.json",
16
+ "//exports": "READ THE ORDER: `@aparte-workspace/source` comes FIRST, but it only resolves for tooling configured with that custom condition (this repo's docs dev server + tsconfig.base). It is NOT what a consumer gets. Node resolves the `node` condition -> `dist/index.node.js`, the DOM-free entry; a bundler/browser gets `dist/index.js`. Reading `src/index.ts` because it sits at the top of this map means reading the BROWSER entry and concluding, wrongly, that the package needs a DOM in Node.",
10
17
  "exports": {
11
18
  ".": {
12
19
  "@aparte-workspace/source": "./src/index.ts",