@aparte/core 0.22.0 → 0.23.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/dist/client/aparte-client.d.ts +5 -22
- package/dist/client/aparte-client.d.ts.map +1 -1
- package/dist/client/stream-adapter.d.ts +16 -0
- package/dist/client/stream-adapter.d.ts.map +1 -1
- package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts +10 -1
- package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -1
- package/dist/config/aparte-config.d.ts +66 -19
- package/dist/config/aparte-config.d.ts.map +1 -1
- package/dist/config/error-renderer.d.ts +3 -1
- package/dist/config/error-renderer.d.ts.map +1 -1
- package/dist/config/locale.d.ts +45 -4
- package/dist/config/locale.d.ts.map +1 -1
- package/dist/config/tool-table.d.ts +28 -0
- package/dist/config/tool-table.d.ts.map +1 -0
- package/dist/custom-elements.json +12019 -11500
- package/dist/{dialog-triggers-3Rk7PuZa.js → dialog-triggers-3G9TqG9g.js} +473 -165
- package/dist/dialog-triggers-3G9TqG9g.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -16
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +2 -1
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +4 -3
- package/dist/index.node.js.map +1 -1
- package/dist/renderers/copy-button.d.ts +12 -0
- package/dist/renderers/copy-button.d.ts.map +1 -0
- package/dist/renderers/segment-renderers.d.ts +6 -3
- package/dist/renderers/segment-renderers.d.ts.map +1 -1
- package/dist/renderers/segments/code.d.ts.map +1 -1
- package/dist/renderers/segments/error.d.ts.map +1 -1
- package/dist/renderers/segments/thinking.d.ts.map +1 -1
- package/dist/renderers/segments/tool-call.d.ts.map +1 -1
- package/dist/transport/agent-handler.d.ts.map +1 -1
- package/dist/types/errors.d.ts +2 -0
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/segments.d.ts +42 -2
- package/dist/types/segments.d.ts.map +1 -1
- package/dist/types/tools.d.ts +38 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/format-duration.d.ts +9 -0
- package/dist/utils/format-duration.d.ts.map +1 -0
- package/dist/utils/tool-line.d.ts +23 -0
- package/dist/utils/tool-line.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/dialog-triggers-3Rk7PuZa.js.map +0 -1
package/dist/index.node.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* TypeScript consumers fully typed on the server; `registerAllComponents()` is a
|
|
19
19
|
* no-op here (there is nothing to register without a DOM).
|
|
20
20
|
*/
|
|
21
|
-
export type { AparteBubbleRole, AparteMessage, AparteContentParser, AparteStreamBlock, AparteStreamBlockMatch, AparteSendEventDetail, AparteViewportConfig, AparteInputConfig, AparteThemeVariables, AparteStatus, AparteAttachment, AparteMessageBranch, AparteBubbleActionsConfig, AparteBubbleActionName, AparteSegment, AparteSegmentTypes, AparteSegmentType, AparteTextSegment, AparteThinkingSegment, AparteCodeSegment, AparteSegmentRenderer, AparteCustomSegment, AparteToolCallSegment, AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteErrorSegment, AparteSegmentUpdateEventDetail, AparteAIProvider, AparteAIModel, AparteAIProviderConfigField, AparteAIProviderMetadata, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress, AparteModelChangeEventDetail, AparteApprovalModeChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteMessagePausedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactStartEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteLinkClickEventDetail, AparteMessageInfoEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail, AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolApprovalRequestDetail, AparteChatImperativeApi, AparteUiHandle, AparteElementAttributes, AparteElementTagName, AparteAttrValue, AparteTemplateAttrs, AparteNoAttributes, AparteChatAttributes, AparteChatViewportAttributes, AparteChatBubbleAttributes, AparteChatStatusAttributes, AparteComposerAttributes, AparteComposerInputAttributes, AparteComposerActionAttributes, AparteComposerAddAttachmentAttributes, AparteComposerToolbarAttributes, AparteConversationListAttributes, AparteSelectAttributes, AparteOptionAttributes, AparteOptgroupAttributes, AparteProgressSpinnerAttributes, AparteContextAttributes, AparteIconAttributes, AparteScrollRailAttributes, AparteSidebarAttributes, AparteSplitAttributes, AparteSuggestionsAttributes, } from './types/index.js';
|
|
21
|
+
export type { AparteBubbleRole, AparteMessage, AparteContentParser, AparteStreamBlock, AparteStreamBlockMatch, AparteSendEventDetail, AparteViewportConfig, AparteInputConfig, AparteThemeVariables, AparteStatus, AparteAttachment, AparteMessageBranch, AparteBubbleActionsConfig, AparteBubbleActionName, AparteSegment, AparteSegmentTypes, AparteSegmentType, AparteTextSegment, AparteThinkingSegment, AparteCodeSegment, AparteSegmentRenderer, AparteCustomSegment, AparteToolCallSegment, AparteSegmentBase, AparteSegmentDefaults, AparteSegmentTiming, AparteErrorSegment, AparteSegmentUpdateEventDetail, AparteAIProvider, AparteAIModel, AparteAIProviderConfigField, AparteAIProviderMetadata, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress, AparteModelChangeEventDetail, AparteApprovalModeChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteMessagePausedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactStartEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteLinkClickEventDetail, AparteMessageInfoEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail, AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolMatcher, AparteToolDisplay, AparteToolApprovalRequestDetail, AparteChatImperativeApi, AparteUiHandle, AparteElementAttributes, AparteElementTagName, AparteAttrValue, AparteTemplateAttrs, AparteNoAttributes, AparteChatAttributes, AparteChatViewportAttributes, AparteChatBubbleAttributes, AparteChatStatusAttributes, AparteComposerAttributes, AparteComposerInputAttributes, AparteComposerActionAttributes, AparteComposerAddAttachmentAttributes, AparteComposerToolbarAttributes, AparteConversationListAttributes, AparteSelectAttributes, AparteOptionAttributes, AparteOptgroupAttributes, AparteProgressSpinnerAttributes, AparteContextAttributes, AparteIconAttributes, AparteScrollRailAttributes, AparteSidebarAttributes, AparteSplitAttributes, AparteSuggestionsAttributes, } from './types/index.js';
|
|
22
22
|
export { AparteErrorCode, AparteError, contentToText } from './types/index.js';
|
|
23
23
|
export type { AparteChat, AparteChatBubble, AparteChatViewport, AparteChatStatus, AparteComposer, AparteComposerInput, AparteComposerSend, AparteComposerCancel, AparteComposerAttachments, AparteComposerAddAttachment, AparteComposerAction, AparteComposerToolbar, AparteSuggestions, AparteContext, AparteConversationList, AparteScrollRail, AparteSidebar, AparteSplit, } from './components/index.js';
|
|
24
24
|
export type { AparteScrollRailJumpDetail, AparteScrollRailEvery, AparteSidebarToggleDetail } from './components/index.js';
|
|
@@ -51,6 +51,7 @@ export { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer,
|
|
|
51
51
|
export { AparteClient } from './client/aparte-client.js';
|
|
52
52
|
export type { AparteClientOptions, AparteToolApprovalResolver } from './client/aparte-client.js';
|
|
53
53
|
export { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';
|
|
54
|
+
export { toolRefusal } from './client/stream-adapter.js';
|
|
54
55
|
export { createAgentStreamRunner, type AgentStreamRunnerOptions } from './client/agent-runner.js';
|
|
55
56
|
export type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';
|
|
56
57
|
export { AparteMessageRepository } from './runtime/message-repository.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;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,YAAY,EACR,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EAOrB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAIlB,8BAA8B,EAC9B,gBAAgB,EAChB,aAAa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BAAgB,qBAAqB,IAAI,IAAI,CAY5C;AAED,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/index.node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8 } from "./dialog-triggers-
|
|
1
|
+
import { A, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 } from "./dialog-triggers-3G9TqG9g.js";
|
|
2
2
|
function registerAllComponents() {
|
|
3
3
|
if (typeof customElements !== "undefined") {
|
|
4
4
|
console.warn(
|
|
@@ -69,7 +69,8 @@ export {
|
|
|
69
69
|
a4 as segmentDuration,
|
|
70
70
|
a5 as segmentTiming,
|
|
71
71
|
a6 as subscribeConfigChange,
|
|
72
|
-
a7 as
|
|
73
|
-
a8 as
|
|
72
|
+
a7 as toolRefusal,
|
|
73
|
+
a8 as unregisterSegmentRenderer,
|
|
74
|
+
a9 as uuid
|
|
74
75
|
};
|
|
75
76
|
//# 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 — and via `worker`, `workerd`,\n * `edge-light`, `deno` and `bun` for a Cloudflare Worker, an edge route or a\n * `target: 'webworker'` build. A worker built with the page's conditions imports it\n * by name, as `@aparte/core/headless`. It exposes the same public API\n * surface MINUS the Web Components and CSS side-effects — importing the real\n * `index.ts` in Node throws `HTMLElement is not defined` because the custom\n * elements extend `HTMLElement` at module scope.\n *\n * Everything re-exported here is DOM-free at import time. Custom-element CLASSES\n * (AparteChatBubble, AparteComposer*, AparteSelect, …) are intentionally NOT exported\n * as runtime values — they only exist in the browser build. Their TYPES are\n * re-exported (types are erased, so they never pull DOM at runtime), which keeps\n * TypeScript consumers fully typed on the server; `registerAllComponents()` is a\n * no-op here (there is nothing to register without a DOM).\n */\n\n// ── Types (erased at runtime — always safe, mirror index.ts) ────────────────\nexport type {\n AparteBubbleRole,\n AparteMessage,\n AparteContentParser,\n AparteStreamBlock,\n AparteStreamBlockMatch,\n AparteSendEventDetail,\n AparteViewportConfig,\n AparteInputConfig,\n AparteThemeVariables,\n AparteStatus,\n AparteAttachment,\n AparteMessageBranch,\n AparteBubbleActionsConfig,\n AparteBubbleActionName,\n AparteSegment,\n AparteSegmentTypes,\n AparteSegmentType,\n AparteTextSegment,\n AparteThinkingSegment,\n AparteCodeSegment,\n AparteSegmentRenderer,\n AparteCustomSegment,\n AparteToolCallSegment,\n // The same five the browser barrel gained, and they belong here for the same reason:\n // a type has no DOM. `AparteSegmentBase` is the constraint on the exported\n // `AparteSegmentRenderer<T>`, so an SSR consumer writing a renderer for a segment type\n // of its own could not name what it extends. `check:node-barrel-types` is what caught\n // the omission — the browser barrel alone would have compiled fine and failed on the\n // `node` condition only.\n AparteSegmentBase,\n AparteSegmentDefaults,\n AparteSegmentTiming,\n AparteErrorSegment,\n // The detail of the `aparte-segment-update` event. It reached types/index.ts and\n // stopped there — and types/index.ts is not an entry point, so a consumer could\n // bind the event (it is in the published event table) and never name its detail.\n AparteSegmentUpdateEventDetail,\n AparteAIProvider,\n AparteAIModel,\n AparteAIProviderConfigField,\n AparteAIProviderMetadata,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteApprovalModeChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageStartEventDetail,\n AparteMessageErrorEventDetail,\n AparteMessageAbortedEventDetail,\n AparteMessagePausedEventDetail,\n AparteAbortEventDetail,\n AparteCompactEventDetail,\n AparteCompactDoneEventDetail,\n AparteCompactStartEventDetail,\n AparteCompactErrorEventDetail,\n AparteAttachmentPreviewEventDetail,\n AparteLinkClickEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteChatRequest,\n AparteRequestMeta,\n AparteChatResponse,\n AparteChatMessage,\n AparteContentPart,\n AparteTextPart,\n AparteImagePart,\n AparteStreamEvent,\n AparteStreamEventMap,\n AparteUsage,\n AparteTool,\n AparteToolCall,\n AparteApprovalPolicy,\n AparteApprovalRuling,\n AparteToolResult,\n AparteToolHandler,\n AparteToolContext,\n AparteToolRenderer,\n AparteToolSummary,\n AparteToolInputFormatter,\n AparteToolApprovalRequestDetail,\n AparteChatImperativeApi,\n AparteUiHandle,\n AparteElementAttributes,\n AparteElementTagName,\n AparteAttrValue,\n AparteTemplateAttrs,\n AparteNoAttributes,\n AparteChatAttributes,\n AparteChatViewportAttributes,\n AparteChatBubbleAttributes,\n AparteChatStatusAttributes,\n AparteComposerAttributes,\n AparteComposerInputAttributes,\n AparteComposerActionAttributes,\n AparteComposerAddAttachmentAttributes,\n AparteComposerToolbarAttributes,\n AparteConversationListAttributes,\n AparteSelectAttributes,\n AparteOptionAttributes,\n AparteOptgroupAttributes,\n AparteProgressSpinnerAttributes,\n AparteContextAttributes,\n AparteIconAttributes,\n AparteScrollRailAttributes,\n AparteSidebarAttributes,\n AparteSplitAttributes,\n AparteSuggestionsAttributes,\n} from './types/index.js';\nexport { AparteErrorCode, AparteError, contentToText } from './types/index.js';\n\n// Custom-element TYPES (erased) — keep server consumers fully typed.\n//\n// The element CLASSES too, as types: `frameworks/elements.md` promises the `node`\n// condition keeps \"every type\", and a server-side consumer typing a ref\n// (`ref: AparteChat`) or a wrapper's imperative surface needs the class's instance\n// type without its `HTMLElement` runtime. `export type` erases the value, so nothing\n// here touches the DOM at import.\nexport type {\n AparteChat, AparteChatBubble, AparteChatViewport, AparteChatStatus,\n AparteComposer, AparteComposerInput, AparteComposerSend, AparteComposerCancel,\n AparteComposerAttachments, AparteComposerAddAttachment, AparteComposerAction, AparteComposerToolbar,\n AparteSuggestions, AparteContext, AparteConversationList, AparteScrollRail, AparteSidebar,\n AparteSplit,\n} from './components/index.js';\nexport type { AparteScrollRailJumpDetail, AparteScrollRailEvery, AparteSidebarToggleDetail } from './components/index.js';\nexport type { AparteSplitResizeDetail } from './components/index.js';\nexport type { AparteElicitation } from './components/elicitation/aparte-elicitation.js';\nexport type { AparteSelect, AparteOption, AparteOptgroup, AparteIcon, AparteProgressSpinner } from './primitives/index.js';\nexport type { AparteSelectChangeDetail, AparteOptgroupToggleEventDetail } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteComposerPanelMode, AparteActionClickEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail, AparteConversationPinDetail, AparteConversationRenameDetail } from './components/index.js';\nexport type { AparteSuggestion, AparteSuggestionEventDetail } from './components/index.js';\nexport type { AparteContextLevel, AparteContextThresholdEventDetail } from './components/index.js';\n\n// ── Renderers (produce HTML strings; DOM-free at import) ────────────────────\nexport {\n registerSegmentRenderer,\n unregisterSegmentRenderer,\n getSegmentRenderer,\n collectRendererStyles,\n registerDefaultRenderers,\n installDefaultRenderersOnce,\n declineDefaultRenderers,\n getAllRenderers,\n} from './renderers/index.js';\n\n// `populateBubbleFromMessage` is a plain helper — import it from its own module,\n// NOT the components barrel (which would pull in the HTMLElement classes).\nexport { populateBubbleFromMessage } from './components/bubble/bubble-sync.js';\n\n// ── Conversations (types, adapter contract, manager, controller) ────────────\nexport type {\n AparteConversation,\n AparteConversationMeta,\n AparteStorageAdapter,\n AparteAttachmentRow,\n AparteConversationLoadedDetail,\n} from './conversations/index.js';\nexport { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';\nexport {\n AparteConversationManager,\n type ConversationManagerOptions,\n type AparteConversationsListener,\n type AparteConversationTitleProvider,\n} from './conversations/index.js';\nexport {\n AparteConversationController,\n type AparteChatBinding,\n type AparteConversationControllerOptions,\n} from './conversations/index.js';\n\n// ── Framework-agnostic chat-host orchestrator (every wrapper binds to it) ───\nexport {\n AparteChatHost,\n type AparteChatHostBinding,\n type AparteChatHostOptions,\n} from './host/index.js';\n\n// ── Parsers ─────────────────────────────────────────────────────────────────\nexport { AparteStreamParser, parseMarkdownToSegments, parseAparteEventStream } from './parsers/index.js';\nexport type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './parsers/index.js';\n\n// Transport seam — DOM-free (fetch-based), so the whole seam is SSR-safe. The\n// server-side `/api/chat` handler AND both client transports live here; a browser\n// never runs the handler, and the transports touch no DOM at import. Mirrored in\n// full so a wrapper barrel re-exporting a transport can't crash under SSR.\nexport { AparteDirectTransport, AparteBackendTransport, createAparteChatHandler, createAparteAgentHandler, isFormatAdapter } from './transport/index.js';\nexport type {\n AparteTransport,\n AparteTransportContext,\n AparteFormatAdapter,\n AparteVendorRequest,\n BackendTransportOptions,\n DirectTransportOptions,\n AparteChatHandlerOptions,\n AparteAgentHandlerOptions,\n AparteAgentTool,\n AparteAgentRequestBody,\n} from './transport/index.js';\n\n// ── Config ──────────────────────────────────────────────────────────────────\nexport { aparteGlobalConfig, AparteConfig, APARTE_DEFAULT_BUBBLE_ACTIONS, APARTE_DEFAULT_HOST_HANDLERS } from './config/index.js';\nexport type { AparteConfigChangeEventDetail } from './config/index.js';\nexport { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';\nexport { subscribeConfigChange, APARTE_CONFIG_CHANGE } from './config/index.js';\nexport type { AparteConfigAware } from './config/index.js';\nexport type {\n AparteMarkdownProvider,\n AparteStreamingMarkdownProvider,\n AparteStreamingMarkdownRenderer,\n AparteHighlightProvider,\n AparteSystemPromptVarsProvider,\n AparteLocale,\n AparteLocaleExtensions,\n AparteAction,\n AparteActionZone,\n AparteIconProvider,\n AparteIconName,\n AparteCoreIconName,\n AparteAvatarProvider,\n AparteStatusRenderer,\n AparteErrorRenderer,\n AparteAttachmentRenderer,\n AparteElicitationFieldRenderer,\n AparteElicitationFieldContext,\n AparteElicitationFieldControl,\n AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteSanitizer,\n} from './config/index.js';\nexport { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';\n\n// ── Client + runtime ─────────────────────────────────────────────────────────\nexport { AparteClient } from './client/aparte-client.js';\nexport type { AparteClientOptions, AparteToolApprovalResolver } from './client/aparte-client.js';\nexport { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';\nexport { createAgentStreamRunner, type AgentStreamRunnerOptions } from './client/agent-runner.js';\nexport type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';\nexport { AparteMessageRepository } from './runtime/message-repository.js';\nexport type { ExportedMessageRepository } from './runtime/message-repository.js';\n\n// ── Wrapper interop (DOM-free helpers the four wrappers' AparteUi value-imports) ─\n// `applyElementProps`/`APARTE_DEFAULT_UI_EVENTS` are pure (a string array + a function that\n// only touches its `HTMLElement` argument when CALLED, never at import). They MUST be\n// on the Node surface: every wrapper barrel re-exports `AparteUi`, which value-imports\n// these two — omit them here and any SSR toolchain resolving the `node` condition\n// crashes the whole barrel with \"does not provide an export named 'applyElementProps'\".\nexport { applyElementProps, APARTE_DEFAULT_UI_EVENTS } from './interop/element-props.js';\n// A type, so it costs nothing here and its absence WAS a compile error for an SSR\n// consumer — `check:node-barrel-types` caught it the moment the browser barrel gained it.\nexport type { AparteUiEventName } from './interop/element-props.js';\n// Same rule: DOM-free at import (it only reaches for `URL.createObjectURL` when\n// CALLED, which is a browser-side concern), so it belongs on the SSR surface too.\nexport { filesToAttachments, revokeAttachmentUrls } from './utils/files-to-attachments.js';\n\n/*\n * The global type augmentations, which only the BROWSER entry pulled in.\n *\n * TypeScript applies the `node` export condition under `moduleResolution: node16`\n * / `nodenext`, so a consumer in that mode resolves `index.node.d.ts` — and\n * silently lost typed `e.detail` on every aparté event and typed\n * `querySelector('aparte-…')`. Not a runtime concern and not an SSR hazard: both\n * modules are `import type` throughout, so nothing is emitted and no DOM global is\n * touched. `check:node-barrel-types` diffed export NAMES, which an augmentation\n * has none of, so it saw nothing.\n */\nimport './types/event-map.js';\nimport './types/element-map.js';\n// Is a message waiting for a reply? Shared by the viewport, the four wrappers and\n// any consumer rendering its own bubble — one rule, so they can't disagree.\nexport { isAwaitingReply } from './utils/is-awaiting-reply.js';\nexport { escapeHtml, escapeAttr } from './utils/escape.js';\n// Same reasoning as the browser barrel: the gate script and the customization\n// guide both tell a renderer author to use `cssEscape` for a selector, so it has to\n// be importable. It touches no DOM, so the SSR barrel carries it too.\nexport { cssEscape } from './utils/css-escape.js';\nexport { uuid } from './utils/uuid.js';\nexport { copyText } from './utils/copy-text.js';\n// Pure and DOM-free, so the SSR barrel carries it too — and that is the point: a\n// consumer can assert their own duration logic in Node, with no browser.\nexport { isSegmentSettled, segmentTiming, segmentDuration } from './utils/segments.js';\n// The PARAMETER types of two documented setters. They existed and were the declared\n// argument types, but were not exported — so anyone typing a settings layer over\n// `setHostHandlers` / `setKeyProvider` had to re-declare the shape by hand.\nexport type { AparteHostHandlersConfig } from './types/models.js';\nexport type { AparteKeyProvider } from './config/aparte-config.js';\n\n// Elicitation (human-in-the-loop typed input) — DOM-free at import.\nexport { requestUserInput, buildElicitationPanel, buildApprovalPanel, AparteElicitationAbortError } from './elicitation/index.js';\nexport type {\n AparteElicitationSchema,\n AparteElicitationField,\n AparteElicitationEnumField,\n AparteElicitationBooleanField,\n AparteElicitationStringField,\n AparteElicitationObjectSchema,\n AparteElicitationRequest,\n AparteElicitationResult,\n AparteElicitationPresenter,\n AparteApprovalOption,\n AparteApprovalAnswer,\n BuiltApprovalPanel,\n BuiltElicitationPanel,\n} from './elicitation/index.js';\n\n/**\n * No-op on the server: custom elements only exist in the browser, where the\n * real `index.ts` registers them at import time. Wrappers can call this\n * unconditionally without a `typeof window` guard.\n *\n * With ONE thing to say. A `customElements` here means a DOM is present and this\n * DOM-free entry was still the one that resolved — which is a test runner: vitest,\n * jest and friends run on Node, so they take the `node` export condition, and jsdom\n * then supplies the registry. Nothing upgrades, `<aparte-chat>` stays an\n * `HTMLElement`, and every assertion about an element's own properties fails for a\n * reason nothing on the page explains. The escape is `@aparte/core/browser`, which is\n * why that entry exists; before it, the only way out was to reach into this package's\n * `src/`. One warning, not a throw: the environment is legal, only surprising.\n */\nexport function registerAllComponents(): void {\n if (typeof customElements !== 'undefined') {\n console.warn(\n \"[aparte] A DOM is present but '@aparte/core' resolved to its DOM-free Node entry, \"\n + 'so no <aparte-*> element will upgrade. Test runners hit this: they run on Node, '\n + \"so they take the 'node' export condition. Point your runner at '@aparte/core/browser', \"\n // The bare specifier only: a string alias is a PREFIX, and would send\n // '@aparte/core/icons' to '@aparte/core/browser/icons', which does not exist.\n + \"matching the bare specifier only (vitest: test.alias \"\n + \"[{ find: /^@aparte\\\\/core$/, replacement: '@aparte/core/browser' }]).\",\n );\n }\n}\n// Pure until called; the browser entry calls it at import.\nexport { installDialogTriggersOnce } from './interop/dialog-triggers.js';\n"],"names":[],"mappings":";AAgWO,SAAS,wBAA8B;AAC1C,MAAI,OAAO,mBAAmB,aAAa;AACvC,YAAQ;AAAA,MACJ;AAAA,IAAA;AAAA,EAQR;AACJ;"}
|
|
1
|
+
{"version":3,"file":"index.node.js","sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @aparte/core — Node.js / SSR-safe entry point.\n *\n * Resolved via the `node` export condition, so `import '@aparte/core'` in Node\n * (Next.js / Nuxt / Angular Universal / SvelteKit server, tsx, CLI tools) loads\n * THIS module instead of the browser entry — and via `worker`, `workerd`,\n * `edge-light`, `deno` and `bun` for a Cloudflare Worker, an edge route or a\n * `target: 'webworker'` build. A worker built with the page's conditions imports it\n * by name, as `@aparte/core/headless`. It exposes the same public API\n * surface MINUS the Web Components and CSS side-effects — importing the real\n * `index.ts` in Node throws `HTMLElement is not defined` because the custom\n * elements extend `HTMLElement` at module scope.\n *\n * Everything re-exported here is DOM-free at import time. Custom-element CLASSES\n * (AparteChatBubble, AparteComposer*, AparteSelect, …) are intentionally NOT exported\n * as runtime values — they only exist in the browser build. Their TYPES are\n * re-exported (types are erased, so they never pull DOM at runtime), which keeps\n * TypeScript consumers fully typed on the server; `registerAllComponents()` is a\n * no-op here (there is nothing to register without a DOM).\n */\n\n// ── Types (erased at runtime — always safe, mirror index.ts) ────────────────\nexport type {\n AparteBubbleRole,\n AparteMessage,\n AparteContentParser,\n AparteStreamBlock,\n AparteStreamBlockMatch,\n AparteSendEventDetail,\n AparteViewportConfig,\n AparteInputConfig,\n AparteThemeVariables,\n AparteStatus,\n AparteAttachment,\n AparteMessageBranch,\n AparteBubbleActionsConfig,\n AparteBubbleActionName,\n AparteSegment,\n AparteSegmentTypes,\n AparteSegmentType,\n AparteTextSegment,\n AparteThinkingSegment,\n AparteCodeSegment,\n AparteSegmentRenderer,\n AparteCustomSegment,\n AparteToolCallSegment,\n // The same five the browser barrel gained, and they belong here for the same reason:\n // a type has no DOM. `AparteSegmentBase` is the constraint on the exported\n // `AparteSegmentRenderer<T>`, so an SSR consumer writing a renderer for a segment type\n // of its own could not name what it extends. `check:node-barrel-types` is what caught\n // the omission — the browser barrel alone would have compiled fine and failed on the\n // `node` condition only.\n AparteSegmentBase,\n AparteSegmentDefaults,\n AparteSegmentTiming,\n AparteErrorSegment,\n // The detail of the `aparte-segment-update` event. It reached types/index.ts and\n // stopped there — and types/index.ts is not an entry point, so a consumer could\n // bind the event (it is in the published event table) and never name its detail.\n AparteSegmentUpdateEventDetail,\n AparteAIProvider,\n AparteAIModel,\n AparteAIProviderConfigField,\n AparteAIProviderMetadata,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteApprovalModeChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageStartEventDetail,\n AparteMessageErrorEventDetail,\n AparteMessageAbortedEventDetail,\n AparteMessagePausedEventDetail,\n AparteAbortEventDetail,\n AparteCompactEventDetail,\n AparteCompactDoneEventDetail,\n AparteCompactStartEventDetail,\n AparteCompactErrorEventDetail,\n AparteAttachmentPreviewEventDetail,\n AparteLinkClickEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteChatRequest,\n AparteRequestMeta,\n AparteChatResponse,\n AparteChatMessage,\n AparteContentPart,\n AparteTextPart,\n AparteImagePart,\n AparteStreamEvent,\n AparteStreamEventMap,\n AparteUsage,\n AparteTool,\n AparteToolCall,\n AparteApprovalPolicy,\n AparteApprovalRuling,\n AparteToolResult,\n AparteToolHandler,\n AparteToolContext,\n AparteToolRenderer,\n AparteToolSummary,\n AparteToolInputFormatter,\n AparteToolMatcher,\n AparteToolDisplay,\n AparteToolApprovalRequestDetail,\n AparteChatImperativeApi,\n AparteUiHandle,\n AparteElementAttributes,\n AparteElementTagName,\n AparteAttrValue,\n AparteTemplateAttrs,\n AparteNoAttributes,\n AparteChatAttributes,\n AparteChatViewportAttributes,\n AparteChatBubbleAttributes,\n AparteChatStatusAttributes,\n AparteComposerAttributes,\n AparteComposerInputAttributes,\n AparteComposerActionAttributes,\n AparteComposerAddAttachmentAttributes,\n AparteComposerToolbarAttributes,\n AparteConversationListAttributes,\n AparteSelectAttributes,\n AparteOptionAttributes,\n AparteOptgroupAttributes,\n AparteProgressSpinnerAttributes,\n AparteContextAttributes,\n AparteIconAttributes,\n AparteScrollRailAttributes,\n AparteSidebarAttributes,\n AparteSplitAttributes,\n AparteSuggestionsAttributes,\n} from './types/index.js';\nexport { AparteErrorCode, AparteError, contentToText } from './types/index.js';\n\n// Custom-element TYPES (erased) — keep server consumers fully typed.\n//\n// The element CLASSES too, as types: `frameworks/elements.md` promises the `node`\n// condition keeps \"every type\", and a server-side consumer typing a ref\n// (`ref: AparteChat`) or a wrapper's imperative surface needs the class's instance\n// type without its `HTMLElement` runtime. `export type` erases the value, so nothing\n// here touches the DOM at import.\nexport type {\n AparteChat, AparteChatBubble, AparteChatViewport, AparteChatStatus,\n AparteComposer, AparteComposerInput, AparteComposerSend, AparteComposerCancel,\n AparteComposerAttachments, AparteComposerAddAttachment, AparteComposerAction, AparteComposerToolbar,\n AparteSuggestions, AparteContext, AparteConversationList, AparteScrollRail, AparteSidebar,\n AparteSplit,\n} from './components/index.js';\nexport type { AparteScrollRailJumpDetail, AparteScrollRailEvery, AparteSidebarToggleDetail } from './components/index.js';\nexport type { AparteSplitResizeDetail } from './components/index.js';\nexport type { AparteElicitation } from './components/elicitation/aparte-elicitation.js';\nexport type { AparteSelect, AparteOption, AparteOptgroup, AparteIcon, AparteProgressSpinner } from './primitives/index.js';\nexport type { AparteSelectChangeDetail, AparteOptgroupToggleEventDetail } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail, AparteComposerPanelMode, AparteActionClickEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail, AparteConversationArchiveDetail, AparteConversationPinDetail, AparteConversationRenameDetail } from './components/index.js';\nexport type { AparteSuggestion, AparteSuggestionEventDetail } from './components/index.js';\nexport type { AparteContextLevel, AparteContextThresholdEventDetail } from './components/index.js';\n\n// ── Renderers (produce HTML strings; DOM-free at import) ────────────────────\nexport {\n registerSegmentRenderer,\n unregisterSegmentRenderer,\n getSegmentRenderer,\n collectRendererStyles,\n registerDefaultRenderers,\n installDefaultRenderersOnce,\n declineDefaultRenderers,\n getAllRenderers,\n} from './renderers/index.js';\n\n// `populateBubbleFromMessage` is a plain helper — import it from its own module,\n// NOT the components barrel (which would pull in the HTMLElement classes).\nexport { populateBubbleFromMessage } from './components/bubble/bubble-sync.js';\n\n// ── Conversations (types, adapter contract, manager, controller) ────────────\nexport type {\n AparteConversation,\n AparteConversationMeta,\n AparteStorageAdapter,\n AparteAttachmentRow,\n AparteConversationLoadedDetail,\n} from './conversations/index.js';\nexport { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';\nexport {\n AparteConversationManager,\n type ConversationManagerOptions,\n type AparteConversationsListener,\n type AparteConversationTitleProvider,\n} from './conversations/index.js';\nexport {\n AparteConversationController,\n type AparteChatBinding,\n type AparteConversationControllerOptions,\n} from './conversations/index.js';\n\n// ── Framework-agnostic chat-host orchestrator (every wrapper binds to it) ───\nexport {\n AparteChatHost,\n type AparteChatHostBinding,\n type AparteChatHostOptions,\n} from './host/index.js';\n\n// ── Parsers ─────────────────────────────────────────────────────────────────\nexport { AparteStreamParser, parseMarkdownToSegments, parseAparteEventStream } from './parsers/index.js';\nexport type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './parsers/index.js';\n\n// Transport seam — DOM-free (fetch-based), so the whole seam is SSR-safe. The\n// server-side `/api/chat` handler AND both client transports live here; a browser\n// never runs the handler, and the transports touch no DOM at import. Mirrored in\n// full so a wrapper barrel re-exporting a transport can't crash under SSR.\nexport { AparteDirectTransport, AparteBackendTransport, createAparteChatHandler, createAparteAgentHandler, isFormatAdapter } from './transport/index.js';\nexport type {\n AparteTransport,\n AparteTransportContext,\n AparteFormatAdapter,\n AparteVendorRequest,\n BackendTransportOptions,\n DirectTransportOptions,\n AparteChatHandlerOptions,\n AparteAgentHandlerOptions,\n AparteAgentTool,\n AparteAgentRequestBody,\n} from './transport/index.js';\n\n// ── Config ──────────────────────────────────────────────────────────────────\nexport { aparteGlobalConfig, AparteConfig, APARTE_DEFAULT_BUBBLE_ACTIONS, APARTE_DEFAULT_HOST_HANDLERS } from './config/index.js';\nexport type { AparteConfigChangeEventDetail } from './config/index.js';\nexport { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';\nexport { subscribeConfigChange, APARTE_CONFIG_CHANGE } from './config/index.js';\nexport type { AparteConfigAware } from './config/index.js';\nexport type {\n AparteMarkdownProvider,\n AparteStreamingMarkdownProvider,\n AparteStreamingMarkdownRenderer,\n AparteHighlightProvider,\n AparteSystemPromptVarsProvider,\n AparteLocale,\n AparteLocaleExtensions,\n AparteAction,\n AparteActionZone,\n AparteIconProvider,\n AparteIconName,\n AparteCoreIconName,\n AparteAvatarProvider,\n AparteStatusRenderer,\n AparteErrorRenderer,\n AparteAttachmentRenderer,\n AparteElicitationFieldRenderer,\n AparteElicitationFieldContext,\n AparteElicitationFieldControl,\n AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteSanitizer,\n} from './config/index.js';\nexport { APARTE_DEFAULT_ICON_FALLBACKS, APARTE_DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';\n\n// ── Client + runtime ─────────────────────────────────────────────────────────\nexport { AparteClient } from './client/aparte-client.js';\nexport type { AparteClientOptions, AparteToolApprovalResolver } from './client/aparte-client.js';\nexport { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';\nexport { toolRefusal } from './client/stream-adapter.js';\nexport { createAgentStreamRunner, type AgentStreamRunnerOptions } from './client/agent-runner.js';\nexport type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';\nexport { AparteMessageRepository } from './runtime/message-repository.js';\nexport type { ExportedMessageRepository } from './runtime/message-repository.js';\n\n// ── Wrapper interop (DOM-free helpers the four wrappers' AparteUi value-imports) ─\n// `applyElementProps`/`APARTE_DEFAULT_UI_EVENTS` are pure (a string array + a function that\n// only touches its `HTMLElement` argument when CALLED, never at import). They MUST be\n// on the Node surface: every wrapper barrel re-exports `AparteUi`, which value-imports\n// these two — omit them here and any SSR toolchain resolving the `node` condition\n// crashes the whole barrel with \"does not provide an export named 'applyElementProps'\".\nexport { applyElementProps, APARTE_DEFAULT_UI_EVENTS } from './interop/element-props.js';\n// A type, so it costs nothing here and its absence WAS a compile error for an SSR\n// consumer — `check:node-barrel-types` caught it the moment the browser barrel gained it.\nexport type { AparteUiEventName } from './interop/element-props.js';\n// Same rule: DOM-free at import (it only reaches for `URL.createObjectURL` when\n// CALLED, which is a browser-side concern), so it belongs on the SSR surface too.\nexport { filesToAttachments, revokeAttachmentUrls } from './utils/files-to-attachments.js';\n\n/*\n * The global type augmentations, which only the BROWSER entry pulled in.\n *\n * TypeScript applies the `node` export condition under `moduleResolution: node16`\n * / `nodenext`, so a consumer in that mode resolves `index.node.d.ts` — and\n * silently lost typed `e.detail` on every aparté event and typed\n * `querySelector('aparte-…')`. Not a runtime concern and not an SSR hazard: both\n * modules are `import type` throughout, so nothing is emitted and no DOM global is\n * touched. `check:node-barrel-types` diffed export NAMES, which an augmentation\n * has none of, so it saw nothing.\n */\nimport './types/event-map.js';\nimport './types/element-map.js';\n// Is a message waiting for a reply? Shared by the viewport, the four wrappers and\n// any consumer rendering its own bubble — one rule, so they can't disagree.\nexport { isAwaitingReply } from './utils/is-awaiting-reply.js';\nexport { escapeHtml, escapeAttr } from './utils/escape.js';\n// Same reasoning as the browser barrel: the gate script and the customization\n// guide both tell a renderer author to use `cssEscape` for a selector, so it has to\n// be importable. It touches no DOM, so the SSR barrel carries it too.\nexport { cssEscape } from './utils/css-escape.js';\nexport { uuid } from './utils/uuid.js';\nexport { copyText } from './utils/copy-text.js';\n// Pure and DOM-free, so the SSR barrel carries it too — and that is the point: a\n// consumer can assert their own duration logic in Node, with no browser.\nexport { isSegmentSettled, segmentTiming, segmentDuration } from './utils/segments.js';\n// The PARAMETER types of two documented setters. They existed and were the declared\n// argument types, but were not exported — so anyone typing a settings layer over\n// `setHostHandlers` / `setKeyProvider` had to re-declare the shape by hand.\nexport type { AparteHostHandlersConfig } from './types/models.js';\nexport type { AparteKeyProvider } from './config/aparte-config.js';\n\n// Elicitation (human-in-the-loop typed input) — DOM-free at import.\nexport { requestUserInput, buildElicitationPanel, buildApprovalPanel, AparteElicitationAbortError } from './elicitation/index.js';\nexport type {\n AparteElicitationSchema,\n AparteElicitationField,\n AparteElicitationEnumField,\n AparteElicitationBooleanField,\n AparteElicitationStringField,\n AparteElicitationObjectSchema,\n AparteElicitationRequest,\n AparteElicitationResult,\n AparteElicitationPresenter,\n AparteApprovalOption,\n AparteApprovalAnswer,\n BuiltApprovalPanel,\n BuiltElicitationPanel,\n} from './elicitation/index.js';\n\n/**\n * No-op on the server: custom elements only exist in the browser, where the\n * real `index.ts` registers them at import time. Wrappers can call this\n * unconditionally without a `typeof window` guard.\n *\n * With ONE thing to say. A `customElements` here means a DOM is present and this\n * DOM-free entry was still the one that resolved — which is a test runner: vitest,\n * jest and friends run on Node, so they take the `node` export condition, and jsdom\n * then supplies the registry. Nothing upgrades, `<aparte-chat>` stays an\n * `HTMLElement`, and every assertion about an element's own properties fails for a\n * reason nothing on the page explains. The escape is `@aparte/core/browser`, which is\n * why that entry exists; before it, the only way out was to reach into this package's\n * `src/`. One warning, not a throw: the environment is legal, only surprising.\n */\nexport function registerAllComponents(): void {\n if (typeof customElements !== 'undefined') {\n console.warn(\n \"[aparte] A DOM is present but '@aparte/core' resolved to its DOM-free Node entry, \"\n + 'so no <aparte-*> element will upgrade. Test runners hit this: they run on Node, '\n + \"so they take the 'node' export condition. Point your runner at '@aparte/core/browser', \"\n // The bare specifier only: a string alias is a PREFIX, and would send\n // '@aparte/core/icons' to '@aparte/core/browser/icons', which does not exist.\n + \"matching the bare specifier only (vitest: test.alias \"\n + \"[{ find: /^@aparte\\\\/core$/, replacement: '@aparte/core/browser' }]).\",\n );\n }\n}\n// Pure until called; the browser entry calls it at import.\nexport { installDialogTriggersOnce } from './interop/dialog-triggers.js';\n"],"names":[],"mappings":";AAmWO,SAAS,wBAA8B;AAC1C,MAAI,OAAO,mBAAmB,aAAa;AACvC,YAAQ;AAAA,MACJ;AAAA,IAAA;AAAA,EAQR;AACJ;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The button, at rest. `className` is the component's own hook beside the recipe's. */
|
|
2
|
+
export declare function copyButtonMarkup(className: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Copy what `read()` returns on click, then confirm with a check mark for a moment.
|
|
5
|
+
*
|
|
6
|
+
* `read` is called at click time — the DOM, not a segment a closure captured at setup,
|
|
7
|
+
* which for a streamed block was still empty.
|
|
8
|
+
*/
|
|
9
|
+
export declare function wireCopyButton(button: HTMLElement, read: () => string): void;
|
|
10
|
+
/** The button's icon and name from the current config — skipped while it confirms a copy. */
|
|
11
|
+
export declare function relabelCopyButton(button: HTMLElement): void;
|
|
12
|
+
//# sourceMappingURL=copy-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../src/renderers/copy-button.ts"],"names":[],"mappings":"AAuBA,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,MAAM,GAAG,IAAI,CAkB5E;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAK3D"}
|
|
@@ -57,13 +57,16 @@ export declare function getAllRenderers(config?: AparteConfig): readonly AparteS
|
|
|
57
57
|
export declare function collectRendererStyles(config?: AparteConfig): string;
|
|
58
58
|
export declare function injectRendererStyles(config?: AparteConfig): void;
|
|
59
59
|
/**
|
|
60
|
-
* Put a tool renderer's stylesheet on the page, once per
|
|
60
|
+
* Put a tool renderer's stylesheet on the page, once per RENDERER.
|
|
61
61
|
*
|
|
62
62
|
* Called from the stream adapter's `tool-start` handler and from `toolCallRenderer` on
|
|
63
63
|
* every render, a stored conversation's included (it looks the renderer up and delegates
|
|
64
64
|
* to it; nothing replays `tool-start` for history), so "the renderer drew"
|
|
65
|
-
* and "its rules are on the page" cannot come apart.
|
|
66
|
-
*
|
|
65
|
+
* and "its rules are on the page" cannot come apart.
|
|
66
|
+
*
|
|
67
|
+
* Keyed by the renderer, named after the first tool it drew: the name was the renderer's
|
|
68
|
+
* identity while one renderer drew one tool, and a renderer registered for a pattern or
|
|
69
|
+
* `'*'` draws many, which put a copy of the same rules on the page per tool.
|
|
67
70
|
*/
|
|
68
71
|
export declare function injectToolRendererStyles(toolName: string, renderer: {
|
|
69
72
|
getStyles?: () => string;
|
|
@@ -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,EACxB,MAAM,mBAAmB,CAAC;AAO3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAqFvD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAClC,MAAM,GAAE,YAA8B,GACvC,IAAI,CAGN;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BAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,YAA8B,GAAG,IAAI,CAEpG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,YAA8B,GACvC,qBAAqB,GAAG,SAAS,CAEnC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,GAAE,YAA8B,GAAG,SAAS,qBAAqB,EAAE,CAExG;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,YAA8B,GAAG,MAAM,CAKpF;AAmBD,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,YAA8B,GAAG,IAAI,CAuBjF;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE,GAAG,IAAI,CAcvG;AAED,wBAAgB,wBAAwB,CAAC,MAAM,GAAE,YAA8B,GAAG,IAAI,CAiBrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/code.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACR,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/code.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACR,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,YAAY,EAAE,qBAAqB,CAAC,iBAAiB,CAsDjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/error.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,qBAAqB,EACrB,kBAAkB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,aAAa,EAAE,qBAAqB,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/error.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,qBAAqB,EACrB,kBAAkB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,aAAa,EAAE,qBAAqB,CAAC,kBAAkB,CA4CnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/thinking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/thinking.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACR,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AA2C9B,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,CAAC,qBAAqB,CA+EzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/tool-call.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-call.d.ts","sourceRoot":"","sources":["../../../src/renderers/segments/tool-call.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAkT9B,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,CAAC,qBAAqB,CAqPzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-handler.d.ts","sourceRoot":"","sources":["../../src/transport/agent-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,qBAAqB,EAAkB,MAAM,gBAAgB,CAAC;AA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AAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,2GAA2G;IAC3G,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,0HAA0H;IAC1H,MAAM,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,4CAA4C;AAC5C,MAAM,WAAW,sBAAsB;IACnC,CAAC,EAAE,CAAC,CAAC;IACL,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,iFAAiF;IACjF,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;KAAE,CAAC;CAChF;AAID;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA0MhH"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare enum AparteErrorCode {
|
|
|
12
12
|
PROVIDER_ERROR = "PROVIDER_ERROR",// HTTP 5xx
|
|
13
13
|
PROVIDER_UNAVAILABLE = "PROVIDER_UNAVAILABLE",// HTTP 503
|
|
14
14
|
PROVIDER_POLICY = "PROVIDER_POLICY",// Moderation / Policy
|
|
15
|
+
/** The turn reached `maxTurns`: the loop stopped asking the model, to avoid an endless loop. */
|
|
16
|
+
MAX_TURNS_EXCEEDED = "MAX_TURNS_EXCEEDED",
|
|
15
17
|
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
16
18
|
}
|
|
17
19
|
export declare class AparteError extends Error {
|
|
@@ -1 +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15,7 @@ export type { AparteThemeVariables } from './theming.js';
|
|
|
15
15
|
export type { AparteAIModel, AparteAIProvider, AparteAIProviderMetadata, AparteAIProviderConfigField, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress } from './model-provider.js';
|
|
16
16
|
export type { AparteChatRequest, AparteRequestMeta, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage } from './chat.js';
|
|
17
17
|
export { contentToText } from './chat.js';
|
|
18
|
-
export type { AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolApprovalRequestDetail, } from './tools.js';
|
|
18
|
+
export type { AparteTool, AparteToolCall, AparteApprovalPolicy, AparteApprovalRuling, AparteToolResult, AparteToolHandler, AparteToolContext, AparteToolRenderer, AparteToolSummary, AparteToolInputFormatter, AparteToolMatcher, AparteToolDisplay, AparteToolApprovalRequestDetail, } from './tools.js';
|
|
19
19
|
export { AparteErrorCode, AparteError } from './errors.js';
|
|
20
20
|
export type { AparteModelChangeEventDetail, AparteApprovalModeChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageStartEventDetail, AparteMessageErrorEventDetail, AparteMessageAbortedEventDetail, AparteMessagePausedEventDetail, AparteAbortEventDetail, AparteCompactEventDetail, AparteCompactDoneEventDetail, AparteCompactStartEventDetail, AparteCompactErrorEventDetail, AparteAttachmentPreviewEventDetail, AparteMessageInfoEventDetail, } from './events.js';
|
|
21
21
|
export type { AparteElementAttributes, AparteElementTagName, AparteAttrValue, AparteTemplateAttrs, AparteNoAttributes, AparteChatAttributes, AparteChatViewportAttributes, AparteChatBubbleAttributes, AparteChatStatusAttributes, AparteComposerAttributes, AparteComposerInputAttributes, AparteComposerActionAttributes, AparteComposerAddAttachmentAttributes, AparteComposerToolbarAttributes, AparteConversationListAttributes, AparteSelectAttributes, AparteOptionAttributes, AparteOptgroupAttributes, AparteProgressSpinnerAttributes, AparteContextAttributes, AparteIconAttributes, AparteScrollRailAttributes, AparteSidebarAttributes, AparteSplitAttributes, AparteSuggestionsAttributes } from './element-attributes.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACpB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAMpF,YAAY,EACR,qBAAqB,EACrB,iBAAiB,EACjB,+BAA+B,EAC/B,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EAC1B,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,mBAAmB,EACnB,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,8BAA8B,EACjC,MAAM,eAAe,CAAC;AAgBvB,YAAY,EACR,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAMtB,YAAY,EACR,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACR,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACj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EACjB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,+BAA+B,GAClC,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,YAAY,EACR,4BAA4B,EAC5B,mCAAmC,EACnC,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,GAC/B,MAAM,aAAa,CAAC;AAKrB,YAAY,EACR,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC7B,8BAA8B,EAC9B,qCAAqC,EACrC,+BAA+B,EAC/B,gCAAgC,EAChC,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC9B,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/types/segments.d.ts
CHANGED
|
@@ -60,8 +60,9 @@ export interface AparteSegmentBase {
|
|
|
60
60
|
* `aparte` because `meta` is the consumer's: a flat `startedAt` there would collide
|
|
61
61
|
* with a key of their own.
|
|
62
62
|
*
|
|
63
|
-
* Core reads it through {@link segmentDuration} and {@link isSegmentSettled}
|
|
64
|
-
*
|
|
63
|
+
* Core reads it through {@link segmentDuration} and {@link isSegmentSettled}. It draws
|
|
64
|
+
* one number, and only when asked: a reasoning block with `showDuration` reads its
|
|
65
|
+
* duration once settled. Every other display of it is the app's.
|
|
65
66
|
*/
|
|
66
67
|
export interface AparteSegmentTiming {
|
|
67
68
|
/** Epoch ms when the segment entered a LIVE transcript. Absent for history. */
|
|
@@ -133,6 +134,17 @@ export interface AparteThinkingSegment extends AparteSegmentBase {
|
|
|
133
134
|
*/
|
|
134
135
|
collapsed?: boolean;
|
|
135
136
|
label?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Once settled, read "Thought for 8s" rather than "Thought". Off by default: the
|
|
139
|
+
* duration is measured in the browser, from the first reasoning delta to the last,
|
|
140
|
+
* which is the model's thinking time only when the provider streams its reasoning — a
|
|
141
|
+
* provider that sends it in one piece would read "1s", and a reload shows it only if
|
|
142
|
+
* the stored segment kept its `meta`. Usually turned on for every block with
|
|
143
|
+
* `setSegmentDefaults('thinking', { showDuration: true })`, which a block restored
|
|
144
|
+
* from storage follows too (it is read when the block is drawn); the block's own
|
|
145
|
+
* field wins.
|
|
146
|
+
*/
|
|
147
|
+
showDuration?: boolean;
|
|
136
148
|
}
|
|
137
149
|
/**
|
|
138
150
|
* Code segment - syntax highlighted code block
|
|
@@ -177,7 +189,14 @@ export interface AparteCodeSegment extends AparteSegmentBase {
|
|
|
177
189
|
export interface AparteErrorSegment extends AparteSegmentBase {
|
|
178
190
|
type: 'error';
|
|
179
191
|
content: string;
|
|
192
|
+
/** Text the alert shows under the message, in a block — a stack, a status line an app chooses to show. */
|
|
180
193
|
details?: string;
|
|
194
|
+
/**
|
|
195
|
+
* A machine-readable code for the app to branch on — an `AparteErrorCode` value when
|
|
196
|
+
* core made the error (`AparteErrorCode.MAX_TURNS_EXCEEDED`, `PROVIDER_ERROR`…). Never drawn: the
|
|
197
|
+
* alert carries it as `data-error-code`, and a custom error renderer receives it.
|
|
198
|
+
*/
|
|
199
|
+
code?: string;
|
|
181
200
|
/**
|
|
182
201
|
* @deprecated Set by nothing and read by nothing: the error renderer draws `content` and
|
|
183
202
|
* `details` only. Put a stack in `details` to show it. It will be removed in a later minor.
|
|
@@ -219,6 +238,27 @@ export interface AparteToolCallSegment extends AparteSegmentBase {
|
|
|
219
238
|
reason: 'approval' | 'external' | 'queued';
|
|
220
239
|
ticket?: string;
|
|
221
240
|
};
|
|
241
|
+
/**
|
|
242
|
+
* On a `rejected` call, who refused it — a person, a policy, or the loop because an
|
|
243
|
+
* earlier call of the same step was refused — and what the person typed instead.
|
|
244
|
+
* `result` is the sentence the MODEL read; this is what a row tells a person, in their
|
|
245
|
+
* language. Absent on a call refused by a runner that does not say.
|
|
246
|
+
*/
|
|
247
|
+
refusal?: {
|
|
248
|
+
by: import('@aparte/engine').StreamRefusalOrigin;
|
|
249
|
+
instruction?: string;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* On an `aborted` call, why: a Stop, its handler's timeout, no handler here, a gate
|
|
253
|
+
* with nobody to ask, or its own turn limit. Absent when the run ended before it.
|
|
254
|
+
*/
|
|
255
|
+
abortCause?: import('@aparte/engine').StreamAbortCause | 'turn-limit';
|
|
256
|
+
/**
|
|
257
|
+
* Whether the row's disclosure starts closed. Absent: closed, unless the tool's display
|
|
258
|
+
* says `open`. `setSegmentDefaults('tool_call', { collapsed: false })` opens every row;
|
|
259
|
+
* like reasoning's, it is read when the row is drawn and never forced on an update.
|
|
260
|
+
*/
|
|
261
|
+
collapsed?: boolean;
|
|
222
262
|
}
|
|
223
263
|
/**
|
|
224
264
|
* Custom segment - one escape hatch for the views an app draws itself.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../src/types/segments.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAC9B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IAEX,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IAEb,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAkBlB,u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AAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAE/C;;;;;OAKG;IACH,MAAM,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAEhD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAEjD;;;OAGG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CACxC;AAMD,6DAA6D;AAC7D,MAAM,WAAW,8BAA8B;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/dist/types/tools.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Provider-agnostic tool calling interface
|
|
4
4
|
*/
|
|
5
5
|
import type { AparteToolCallSegment } from './segments.js';
|
|
6
|
+
import type { AparteIconName } from '../config/icon-provider.js';
|
|
6
7
|
/** Definition of a tool the AI can call */
|
|
7
8
|
export interface AparteTool {
|
|
8
9
|
name: string;
|
|
@@ -160,6 +161,43 @@ export type AparteToolSummary = (segment: AparteToolCallSegment) => string;
|
|
|
160
161
|
* falls back to the JSON.
|
|
161
162
|
*/
|
|
162
163
|
export type AparteToolInputFormatter = (input: Record<string, unknown>) => string;
|
|
164
|
+
/**
|
|
165
|
+
* Which tools a registration names: one exact name, a RegExp tested against the name
|
|
166
|
+
* (`name.search(re) !== -1`, so a `g` flag is harmless), or `'*'` for every tool nothing
|
|
167
|
+
* more specific describes.
|
|
168
|
+
*/
|
|
169
|
+
export type AparteToolMatcher = string | RegExp;
|
|
170
|
+
/**
|
|
171
|
+
* How a tool's calls are shown — registered with `registerToolDisplay(matcher, display)`.
|
|
172
|
+
*
|
|
173
|
+
* Every field is optional; what is left out keeps core's default row. The tool's NAME is
|
|
174
|
+
* the app's wire format and core never turns it into words on its own: `label` is how an
|
|
175
|
+
* app gives a person something better to read than `web_search`.
|
|
176
|
+
*/
|
|
177
|
+
export interface AparteToolDisplay {
|
|
178
|
+
/**
|
|
179
|
+
* What the row and the approval question call the tool, in place of its identifier.
|
|
180
|
+
* Plain text, never HTML. A function reads the call (its status, its input); one that
|
|
181
|
+
* throws falls back to the identifier.
|
|
182
|
+
*/
|
|
183
|
+
label?: string | ((segment: AparteToolCallSegment) => string);
|
|
184
|
+
/**
|
|
185
|
+
* The row's glyph: an icon-provider key (`file`, `edit`, `terminal`… — or `search`,
|
|
186
|
+
* `globe` from `@aparte/core/icons` once registered). Unknown keys fall back to `tool`.
|
|
187
|
+
*/
|
|
188
|
+
icon?: AparteIconName | (string & {});
|
|
189
|
+
/** What the call targets, after the label — see {@link AparteToolSummary}. */
|
|
190
|
+
summary?: AparteToolSummary;
|
|
191
|
+
/** The arguments as a person reads them — see {@link AparteToolInputFormatter}. */
|
|
192
|
+
formatInput?: AparteToolInputFormatter;
|
|
193
|
+
/**
|
|
194
|
+
* Draw nothing for these calls. The call stays in the message, in storage and in the
|
|
195
|
+
* model's history; an approval it needs is still asked.
|
|
196
|
+
*/
|
|
197
|
+
hidden?: boolean;
|
|
198
|
+
/** Open the row's disclosure by default (a segment's own `collapsed` wins). */
|
|
199
|
+
open?: boolean;
|
|
200
|
+
}
|
|
163
201
|
/**
|
|
164
202
|
* Per-tool segment renderer.
|
|
165
203
|
* Registered via aparteGlobalConfig.registerToolRenderer(toolName, renderer).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":"AAAA;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;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,MAAM,GAAG,WAAW,CAAC;IACjE,8EAA8E;IAC9E,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvE;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxE;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzE,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A duration as a person reads it, in the locale's own units: "8s", "1m 12s", "1 min 12 s".
|
|
3
|
+
*
|
|
4
|
+
* `Intl`'s narrow unit style rather than a sentence of our own: the units, their order and
|
|
5
|
+
* their spacing are the locale's, and a translation never has to spell "seconds". A floor
|
|
6
|
+
* of one second — a block that took 300ms still took time, and "0s" reads as nothing.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatDuration(ms: number, tag?: string): string;
|
|
9
|
+
//# sourceMappingURL=format-duration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-duration.d.ts","sourceRoot":"","sources":["../../src/utils/format-duration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAc/D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a tool call is called, and what it targets — read by the transcript row AND by the
|
|
3
|
+
* approval question, so a person cannot read the two differently (the same reason
|
|
4
|
+
* `tool-input.ts` exists for the arguments).
|
|
5
|
+
*/
|
|
6
|
+
import type { AparteConfig } from '../config/aparte-config.js';
|
|
7
|
+
import type { AparteToolCallSegment } from '../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* The name a call goes by: the label its display declares (`registerToolDisplay`), else
|
|
10
|
+
* the identifier — the app's wire format, which core never turns into words on its own.
|
|
11
|
+
* A label that throws or says nothing costs the call its label, not its render.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toolNameOf(segment: AparteToolCallSegment, config: AparteConfig): {
|
|
14
|
+
text: string;
|
|
15
|
+
isLabel: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* What a call targets, from the summary its display declares — `''` when there is none,
|
|
19
|
+
* or when it throws: a summary reads model-chosen input, and a bad one must cost the call
|
|
20
|
+
* its one line, not the bubble its render.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toolTargetOf(segment: AparteToolCallSegment, config: AparteConfig): string;
|
|
23
|
+
//# sourceMappingURL=tool-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-line.d.ts","sourceRoot":"","sources":["../../src/utils/tool-line.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAUnH;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CASzF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aparte/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"homepage": "https://apartejs.dev/",
|
|
5
5
|
"description": "AI chat and agent UI components as Web Components, with the agent loop inside — zero third-party dependencies",
|
|
6
6
|
"type": "module",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"node": ">=18"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@aparte/engine": "0.
|
|
82
|
+
"@aparte/engine": "0.23.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|