@aparte/core 0.3.0-alpha.0 → 0.5.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.
- package/README.md +26 -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 +26 -2
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/chat/aparte-chat.d.ts +13 -0
- package/dist/components/chat/aparte-chat.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 +17 -4
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +64 -7
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/icon-provider.d.ts +21 -21
- package/dist/config/icon-provider.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/conversations/conversation-controller.d.ts.map +1 -1
- package/dist/custom-elements.json +3435 -3000
- package/dist/host/aparte-chat-host.d.ts +58 -1
- package/dist/host/aparte-chat-host.d.ts.map +1 -1
- package/dist/{index-CW2BCAqn.js → index-Dn7TH14G.js} +282 -81
- package/dist/index-Dn7TH14G.js.map +1 -0
- package/dist/index.css +75 -8
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +216 -62
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +3 -1
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +34 -30
- package/dist/index.node.js.map +1 -1
- package/dist/primitives/select/aparte-optgroup.d.ts +2 -0
- package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -1
- package/dist/primitives/select/aparte-select.d.ts +2 -0
- package/dist/primitives/select/aparte-select.d.ts.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/imperative-api.d.ts +13 -0
- package/dist/types/imperative-api.d.ts.map +1 -1
- package/dist/types/models.d.ts +56 -9
- package/dist/types/models.d.ts.map +1 -1
- package/dist/utils/files-to-attachments.d.ts +27 -0
- package/dist/utils/files-to-attachments.d.ts.map +1 -0
- package/dist/utils/is-awaiting-reply.d.ts +22 -0
- package/dist/utils/is-awaiting-reply.d.ts.map +1 -0
- package/package.json +8 -1
- package/dist/index-CW2BCAqn.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';
|
|
@@ -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
|
/**
|
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,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,g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, 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,36 +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
|
-
|
|
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,
|
|
41
45
|
registerAllComponents,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
O as registerDefaultRenderers,
|
|
47
|
+
P as registerSegmentRenderer,
|
|
48
|
+
Q as requestUserInput,
|
|
49
|
+
R as resolveConfig,
|
|
50
|
+
S as runWithConfig,
|
|
51
|
+
T as unregisterSegmentRenderer
|
|
48
52
|
};
|
|
49
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\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":";
|
|
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;"}
|
|
@@ -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,GAAG,IAAI,GAAG,IAAI;IAY9F,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAEpB;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,CAAC,GAAG,EAAE,OAAO,EAMzB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,GAAG,EAAE,OAAO,EAGvB;IAED,OAAO,CAAC,OAAO;
|
|
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,oEAAoE;IACpE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAK;IAE/B,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,GAAG,IAAI,GAAG,IAAI;IAY9F,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAEpB;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,CAAC,GAAG,EAAE,OAAO,EAMzB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,GAAG,EAAE,OAAO,EAGvB;IAED,OAAO,CAAC,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;;;;;;;;;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;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAOpB;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,IAAI,CAAC,GAAG,EAAE,OAAO,EAMpB;IAMD,OAAO,CAAC,OAAO;IAwFf,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,sBAAsB;IA0C9B,OAAO,CAAC,oBAAoB;IAyC5B,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,cAAc;IA0CtB,uDAAuD;IACvD,OAAO,CAAC,eAAe;IAMvB,yEAAyE;IACzE,OAAO,CAAC,WAAW;IAOnB,uFAAuF;IACvF,OAAO,CAAC,UAAU;IAoBlB,+CAA+C;IAC/C,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,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"}
|
|
@@ -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"}
|
|
@@ -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;
|
|
@@ -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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C,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"}
|
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,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AAe,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"}
|
|
@@ -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.
|
|
3
|
+
"version": "0.5.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",
|