@aparte/core 0.4.0-alpha.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/client/aparte-client.d.ts +7 -1
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts +15 -2
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/composer/aparte-composer-attachments.d.ts +3 -2
- package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +4 -2
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +54 -5
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/custom-elements.json +4501 -4310
- package/dist/host/aparte-chat-host.d.ts +11 -0
- package/dist/host/aparte-chat-host.d.ts.map +1 -1
- package/dist/{index-BBg6dsYx.js → index-Dn7TH14G.js} +137 -59
- package/dist/index-Dn7TH14G.js.map +1 -0
- package/dist/index.css +15 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +106 -48
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +34 -32
- package/dist/index.node.js.map +1 -1
- package/dist/renderers/index.d.ts +1 -1
- package/dist/renderers/index.d.ts.map +1 -1
- package/dist/renderers/segment-renderers.d.ts +23 -0
- package/dist/renderers/segment-renderers.d.ts.map +1 -1
- package/dist/types/models.d.ts +56 -9
- package/dist/types/models.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-BBg6dsYx.js.map +0 -1
package/dist/index.node.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export { AparteStreamParser, parseMarkdownToSegments, deriveArtifactKind, parseA
|
|
|
31
31
|
export type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './parsers/index.js';
|
|
32
32
|
export { DirectTransport, BackendTransport, createAparteChatHandler, isFormatAdapter } from './transport/index.js';
|
|
33
33
|
export type { AparteTransport, AparteTransportContext, AparteFormatAdapter, AparteVendorRequest, BackendTransportOptions, DirectTransportOptions, AparteChatHandlerOptions, } from './transport/index.js';
|
|
34
|
-
export { AparteConfig, AparteConfigClass } from './config/index.js';
|
|
34
|
+
export { AparteConfig, AparteConfigClass, DEFAULT_BUBBLE_ACTIONS, DEFAULT_HOST_HANDLERS } from './config/index.js';
|
|
35
35
|
export { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';
|
|
36
36
|
export type { AparteMarkdownProvider, AparteStreamingMarkdownProvider, AparteStreamingMarkdownRenderer, AparteHighlightProvider, AparteSystemPromptVarsProvider, AparteSkeletonProvider, AparteSkeletonType, AparteLocale, AparteAction, AparteActionZone, AparteIconProvider, AparteIconName, AparteAvatarProvider, AparteStatusRenderer, AparteErrorRenderer, AparteAttachmentRenderer, AparteSiblingNavRenderer, AparteBubbleShellRenderer, AparteModelPreference, AparteModelPreferenceProvider, AparteArtifactPreviewBuilder, AparteSanitizer, } from './config/index.js';
|
|
37
37
|
export { DEFAULT_ICON_FALLBACKS, DEFAULT_SKELETON_FALLBACKS, DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';
|
package/dist/index.node.d.ts.map
CHANGED
|
@@ -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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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, b, c, d, e, f, g, h, i, B, C, D, j, k, l, m,
|
|
1
|
+
import { A, a, b, c, d, e, f, g, h, i, B, C, D, j, k, l, m, n, o, M, p, q, r, s, t, u, v, w, x, y, z, E, F, G, H, I, J, K, L, N, O, P, Q, R, S, T } from "./index-Dn7TH14G.js";
|
|
2
2
|
function registerAllComponents() {
|
|
3
3
|
}
|
|
4
4
|
export {
|
|
@@ -14,38 +14,40 @@ export {
|
|
|
14
14
|
i as AparteStreamParser,
|
|
15
15
|
B as BackendTransport,
|
|
16
16
|
C as ConversationManager,
|
|
17
|
-
D as
|
|
18
|
-
j as
|
|
19
|
-
k as
|
|
20
|
-
l as
|
|
21
|
-
m as
|
|
17
|
+
D as DEFAULT_BUBBLE_ACTIONS,
|
|
18
|
+
j as DEFAULT_HOST_HANDLERS,
|
|
19
|
+
k as DEFAULT_ICON_FALLBACKS,
|
|
20
|
+
l as DEFAULT_LOCALE,
|
|
21
|
+
m as DEFAULT_SKELETON_FALLBACKS,
|
|
22
|
+
n as DEFAULT_UI_EVENTS,
|
|
23
|
+
o as DirectTransport,
|
|
22
24
|
M as MessageRepository,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
p as applyElementProps,
|
|
26
|
+
q as attachConfig,
|
|
27
|
+
r as buildElicitationPanel,
|
|
28
|
+
s as collectRendererStyles,
|
|
29
|
+
t as contentToText,
|
|
30
|
+
u as contextConfig,
|
|
31
|
+
v as createAparteChatHandler,
|
|
32
|
+
w as createStreamAdapter,
|
|
33
|
+
x as defaultSanitizer,
|
|
34
|
+
y as deriveArtifactKind,
|
|
35
|
+
z as detachConfig,
|
|
36
|
+
E as filesToAttachments,
|
|
37
|
+
F as getSegmentRenderer,
|
|
38
|
+
G as isAwaitingReply,
|
|
39
|
+
H as isFormatAdapter,
|
|
40
|
+
I as isSafeUrl,
|
|
41
|
+
J as parseAparteEventStream,
|
|
42
|
+
K as parseMarkdownToSegments,
|
|
43
|
+
L as populateBubbleFromMessage,
|
|
44
|
+
N as readableToAsyncIterable,
|
|
43
45
|
registerAllComponents,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
O as registerDefaultRenderers,
|
|
47
|
+
P as registerSegmentRenderer,
|
|
48
|
+
Q as requestUserInput,
|
|
49
|
+
R as resolveConfig,
|
|
50
|
+
S as runWithConfig,
|
|
51
|
+
T as unregisterSegmentRenderer
|
|
50
52
|
};
|
|
51
53
|
//# sourceMappingURL=index.node.js.map
|
package/dist/index.node.js.map
CHANGED
|
@@ -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// 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;"}
|
|
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, DEFAULT_BUBBLE_ACTIONS, DEFAULT_HOST_HANDLERS } 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;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Segment Renderers Barrel Export
|
|
3
3
|
*/
|
|
4
|
-
export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, getAllRenderers, collectRendererStyles, registerDefaultRenderers } from './segment-renderers.js';
|
|
4
|
+
export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, getAllRenderers, collectRendererStyles, registerDefaultRenderers, installDefaultRenderersOnce, declineDefaultRenderers } from './segment-renderers.js';
|
|
5
5
|
//# 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,EAC3B,MAAM,wBAAwB,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,EAC1B,MAAM,wBAAwB,CAAC"}
|
|
@@ -7,6 +7,29 @@ import type { AparteSegmentBase, AparteSegmentRenderer } from '../types/index.js
|
|
|
7
7
|
* Register a segment renderer
|
|
8
8
|
*/
|
|
9
9
|
export declare function registerSegmentRenderer<T extends AparteSegmentBase>(renderer: AparteSegmentRenderer<T>): void;
|
|
10
|
+
/**
|
|
11
|
+
* Remember that the app declined the built-in renderers, so
|
|
12
|
+
* {@link installDefaultRenderersOnce} stays out of the way for good.
|
|
13
|
+
*
|
|
14
|
+
* `AparteClient({ autoRegister: false })` is the one caller. Without this latch the
|
|
15
|
+
* lazy install below would quietly turn that option into a no-op.
|
|
16
|
+
*/
|
|
17
|
+
export declare function declineDefaultRenderers(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Fill in the built-in renderers for the types nobody has claimed — called by the
|
|
20
|
+
* bubble the first time a segment has no renderer.
|
|
21
|
+
*
|
|
22
|
+
* Why lazily and not at import time: **`registerDefaultRenderers()` used to have
|
|
23
|
+
* exactly one caller, `new AparteClient()`.** An app on the bring-your-own-loop
|
|
24
|
+
* path — the one the guide tells you not to construct a client on — rendered
|
|
25
|
+
* `[Unknown segment type: text]` for every reply. Bubbles, streaming and scrolling
|
|
26
|
+
* all worked; only the content was missing, which reads as a bug in the consumer's
|
|
27
|
+
* own loop, not as a missing call.
|
|
28
|
+
*
|
|
29
|
+
* Strictly additive: a type someone registered themselves is never replaced, so a
|
|
30
|
+
* custom `text` renderer survives the sweep triggered by a `code` segment.
|
|
31
|
+
*/
|
|
32
|
+
export declare function installDefaultRenderersOnce(): void;
|
|
10
33
|
/**
|
|
11
34
|
* Unregister a segment renderer
|
|
12
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-renderers.d.ts","sourceRoot":"","sources":["../../src/renderers/segment-renderers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,iBAAiB,EACjB,qBAAqB,EAWxB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"segment-renderers.d.ts","sourceRoot":"","sources":["../../src/renderers/segment-renderers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,iBAAiB,EACjB,qBAAqB,EAWxB,MAAM,mBAAmB,CAAC;AAwG3B;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,GACnC,IAAI,CAGN;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAOlD;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAElF;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,SAAS,qBAAqB,EAAE,CAElE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAK9C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAU3C;AA0eD,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C"}
|
package/dist/types/models.d.ts
CHANGED
|
@@ -63,33 +63,80 @@ export interface AparteMessageBranch {
|
|
|
63
63
|
* Names of the individual action-bar buttons, used for explicit per-role
|
|
64
64
|
* ordered configuration (see `AparteBubbleActionsConfig.user` / `.assistant`).
|
|
65
65
|
*/
|
|
66
|
-
export type AparteBubbleActionName = 'copy' | 'edit' | 'retry' | 'thumbUp' | 'thumbDown';
|
|
66
|
+
export type AparteBubbleActionName = 'copy' | 'edit' | 'retry' | 'thumbUp' | 'thumbDown' | 'info';
|
|
67
67
|
/**
|
|
68
68
|
* Controls which action buttons are rendered in message bubbles.
|
|
69
69
|
* Pass to `AparteConfig.setBubbleActions()` to customise or disable actions.
|
|
70
70
|
*
|
|
71
|
+
* **Only `copy` is on by default.** Core can copy text on its own; every other
|
|
72
|
+
* button needs someone outside core to honor it — `AparteClient` (retry, edit) or
|
|
73
|
+
* your own listener (feedback, info). A button nobody answers is a lie told to the
|
|
74
|
+
* user, so aparté ships them off and you turn on what you handle:
|
|
75
|
+
*
|
|
76
|
+
* ```ts
|
|
77
|
+
* AparteConfig.setBubbleActions({ retry: true, edit: true }); // you run AparteClient
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
71
80
|
* Two ways to configure:
|
|
72
|
-
* - Global flags (`copy`/`retry`/`edit`/`feedback`) — role-aware defaults
|
|
73
|
-
* original behaviour.
|
|
81
|
+
* - Global flags (`copy`/`retry`/`edit`/`feedback`/`info`) — role-aware defaults.
|
|
74
82
|
* - Explicit per-role ordered sets (`user`/`assistant`) — when provided for a
|
|
75
83
|
* role, they fully replace the flag-derived set for that role: buttons render
|
|
76
|
-
* in exactly the given order and
|
|
77
|
-
*
|
|
84
|
+
* in exactly the given order, and naming a button there IS the opt-in (the flag
|
|
85
|
+
* is not consulted). Lets a theme match a specific product 1:1.
|
|
78
86
|
*/
|
|
79
87
|
export interface AparteBubbleActionsConfig {
|
|
80
|
-
/** Copy message text to clipboard. Default: true */
|
|
88
|
+
/** Copy message text to clipboard — the one action core honors alone. Default: true */
|
|
81
89
|
copy?: boolean;
|
|
82
|
-
/** Retry / regenerate the response (assistant bubbles). Default:
|
|
90
|
+
/** Retry / regenerate the response (assistant bubbles). Needs a host to re-send. Default: false */
|
|
83
91
|
retry?: boolean;
|
|
84
|
-
/** Edit the sent message inline (user bubbles). Default:
|
|
92
|
+
/** Edit the sent message inline (user bubbles). Needs a host to keep the new text. Default: false */
|
|
85
93
|
edit?: boolean;
|
|
86
|
-
/** Thumbs-up / thumbs-down feedback (assistant bubbles). Default: false */
|
|
94
|
+
/** Thumbs-up / thumbs-down feedback (assistant bubbles). Needs a listener. Default: false */
|
|
87
95
|
feedback?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* The details ("i") button, which opens the **app-owned** stats popover by
|
|
98
|
+
* emitting `aparte-message-info` (assistant bubbles). Rendered only when the
|
|
99
|
+
* message also carries a `usage` — no numbers, nothing to show. Default: false
|
|
100
|
+
*/
|
|
101
|
+
info?: boolean;
|
|
88
102
|
/** Explicit, ordered action set for USER bubbles. Example: `['edit', 'copy']`. */
|
|
89
103
|
user?: AparteBubbleActionName[];
|
|
90
104
|
/** Explicit, ordered action set for ASSISTANT bubbles. Example: `['copy', 'thumbUp', 'thumbDown', 'retry']`. */
|
|
91
105
|
assistant?: AparteBubbleActionName[];
|
|
92
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* The affordances core RENDERS but cannot COMPLETE — each one only asks, through a
|
|
109
|
+
* DOM event, and the app does the work. Declare what your app actually handles
|
|
110
|
+
* with `AparteConfig.setHostHandlers()`; everything else stays out of the UI
|
|
111
|
+
* rather than showing a control that answers to nobody.
|
|
112
|
+
*
|
|
113
|
+
* ```ts
|
|
114
|
+
* AparteConfig.setHostHandlers({ attachmentPreview: true }); // you open a lightbox
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* These are declarations, not callbacks: the events (`aparte-attachment-preview`,
|
|
118
|
+
* `aparte-terminal-run`, `aparte-artifact-redownload`) are unchanged, and you keep
|
|
119
|
+
* listening for them wherever you already do.
|
|
120
|
+
*/
|
|
121
|
+
export interface AparteHostHandlersConfig {
|
|
122
|
+
/**
|
|
123
|
+
* Clicking an image attachment asks for a full-size preview
|
|
124
|
+
* (`aparte-attachment-preview`) — core owns no lightbox. Until declared, the
|
|
125
|
+
* tile is inert and is not signalled as a button. Default: false
|
|
126
|
+
*/
|
|
127
|
+
attachmentPreview?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* The Run button on a `terminal` segment (`aparte-terminal-run`) — core never
|
|
130
|
+
* executes anything. Copy is unaffected. Default: false
|
|
131
|
+
*/
|
|
132
|
+
terminalRun?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* The download button on a **binary** artifact, which asks the app to
|
|
135
|
+
* re-generate the file (`aparte-artifact-redownload`). Text artifacts keep
|
|
136
|
+
* their button: core writes those out itself. Default: false
|
|
137
|
+
*/
|
|
138
|
+
artifactRedownload?: boolean;
|
|
139
|
+
}
|
|
93
140
|
/**
|
|
94
141
|
* Core message structure for the chat
|
|
95
142
|
* Supports both simple content and rich multi-segment content
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/types/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAMnD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;AAMhG,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,CAAC;AAMpD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IAEX,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IAEb,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IAEb,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IAEZ,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAA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AAgB,CAAC;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAE3B,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAElB,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,oCAAoC;IACpC,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,iDAAiD;IACjD,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEjC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,WAAW,EAAE,WAAW,CAAC;IAExC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAMD,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACjC,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAC9B,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aparte/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "High-performance AI conversation engine - Zero-dependency Web Components",
|
|
5
5
|
"type": "module",
|
|
6
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.",
|