@threadplane/chat 0.0.52 → 0.0.53
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 +22 -0
- package/fesm2022/threadplane-chat.mjs +316 -40
- package/fesm2022/threadplane-chat.mjs.map +1 -1
- package/package.json +9 -3
- package/types/threadplane-chat.d.ts +68 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threadplane/chat",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./chat.css": "./chat.css",
|
|
6
6
|
"./themes/default-dark.css": "./themes/default-dark.css",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@cacheplane/partial-json": ">=0.1.1 <0.3.0",
|
|
28
|
-
"@cacheplane/partial-markdown": "^0.
|
|
28
|
+
"@cacheplane/partial-markdown": "^0.4.1",
|
|
29
29
|
"tslib": "^2.3.0",
|
|
30
30
|
"@threadplane/telemetry": "*"
|
|
31
31
|
},
|
|
@@ -41,7 +41,13 @@
|
|
|
41
41
|
"@json-render/core": "^0.16.0",
|
|
42
42
|
"@langchain/core": "^1.1.33",
|
|
43
43
|
"rxjs": "~7.8.0",
|
|
44
|
-
"marked": "^15.0.0 || ^16.0.0"
|
|
44
|
+
"marked": "^15.0.0 || ^16.0.0",
|
|
45
|
+
"katex": "^0.16.0 || ^0.17.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"katex": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
45
51
|
},
|
|
46
52
|
"license": "PolyForm-Noncommercial-1.0.0 OR LicenseRef-Threadplane-Commercial",
|
|
47
53
|
"repository": {
|
|
@@ -12,9 +12,9 @@ import * as _threadplane_chat from '@threadplane/chat';
|
|
|
12
12
|
import { PartialJsonParser } from '@cacheplane/partial-json';
|
|
13
13
|
import { BaseMessage } from '@langchain/core/messages';
|
|
14
14
|
import * as _cacheplane_partial_markdown from '@cacheplane/partial-markdown';
|
|
15
|
-
import { CitationDefinition, MarkdownDocumentNode, MarkdownNode, MarkdownParagraphNode, MarkdownHeadingNode, MarkdownBlockquoteNode, MarkdownListNode, MarkdownListItemNode, MarkdownCodeBlockNode, MarkdownThematicBreakNode, MarkdownTextNode, MarkdownEmphasisNode, MarkdownStrongNode, MarkdownStrikethroughNode, MarkdownInlineCodeNode, MarkdownLinkNode, MarkdownAutolinkNode, MarkdownImageNode, MarkdownSoftBreakNode, MarkdownHardBreakNode, MarkdownCitationReferenceNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTableCellNode } from '@cacheplane/partial-markdown';
|
|
15
|
+
import { CitationDefinition, MarkdownDocumentNode, MarkdownNode, MarkdownParagraphNode, MarkdownHeadingNode, MarkdownBlockquoteNode, MarkdownListNode, MarkdownListItemNode, MarkdownCodeBlockNode, MarkdownThematicBreakNode, MarkdownTextNode, MarkdownEmphasisNode, MarkdownStrongNode, MarkdownStrikethroughNode, MarkdownInlineCodeNode, MarkdownMathInlineNode, MarkdownMathDisplayNode, MarkdownHtmlInlineNode, MarkdownHtmlBlockNode, MarkdownLinkNode, MarkdownAutolinkNode, MarkdownImageNode, MarkdownSoftBreakNode, MarkdownHardBreakNode, MarkdownCitationReferenceNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTableCellNode } from '@cacheplane/partial-markdown';
|
|
16
|
+
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
|
|
16
17
|
import { NavigationExtras } from '@angular/router';
|
|
17
|
-
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
18
18
|
|
|
19
19
|
/** Precise authored function tool — what `action()` returns. Carries the schema
|
|
20
20
|
* `S` and the handler's resolved return type `R`. */
|
|
@@ -868,6 +868,19 @@ declare class ChatScrollBubbleComponent {
|
|
|
868
868
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatScrollBubbleComponent, "chat-scroll-bubble", never, { "mode": { "alias": "mode"; "required": true; "isSignal": true; }; }, { "clicked": "clicked"; }, never, never, true, never>;
|
|
869
869
|
}
|
|
870
870
|
|
|
871
|
+
/**
|
|
872
|
+
* Coerce an unknown error value into a human-readable message string — reads
|
|
873
|
+
* `.message` from `Error`s, returns strings as-is, and `String()`-casts the
|
|
874
|
+
* rest. Useful when rendering an agent's `error` outside the built-in
|
|
875
|
+
* `chat-error` component.
|
|
876
|
+
*
|
|
877
|
+
* @param error Any caught/agent error value.
|
|
878
|
+
* @returns The message text, or `null` when `error` is nullish.
|
|
879
|
+
* @example
|
|
880
|
+
* ```ts
|
|
881
|
+
* const msg = extractErrorMessage(agent.error());
|
|
882
|
+
* ```
|
|
883
|
+
*/
|
|
871
884
|
declare function extractErrorMessage(error: unknown): string | null;
|
|
872
885
|
declare class ChatErrorComponent {
|
|
873
886
|
readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
|
|
@@ -1655,6 +1668,26 @@ declare class ChatComponent {
|
|
|
1655
1668
|
* reasoning pill collapses (per its internal logic).
|
|
1656
1669
|
*/
|
|
1657
1670
|
protected isReasoningStreaming(message: Message, index: number): boolean;
|
|
1671
|
+
/** The nearest preceding assistant message (skipping hidden tool messages), or undefined. */
|
|
1672
|
+
private prevAssistant;
|
|
1673
|
+
/**
|
|
1674
|
+
* True when message[index] starts a reasoning RUN — a maximal sequence of
|
|
1675
|
+
* consecutive assistant reasoning steps separated only by (hidden) tool
|
|
1676
|
+
* messages. The merged reasoning pill renders once, here.
|
|
1677
|
+
*/
|
|
1678
|
+
protected reasoningRunStart(index: number): boolean;
|
|
1679
|
+
/**
|
|
1680
|
+
* Aggregate the reasoning RUN starting at `index`: joins each step's
|
|
1681
|
+
* reasoning, sums durations, counts steps, and computes the streaming flag
|
|
1682
|
+
* and the merged label when N > 1 ("Thought for {total} · {N} steps", or
|
|
1683
|
+
* just "{N} steps" when no step reported timing).
|
|
1684
|
+
*/
|
|
1685
|
+
protected reasoningRun(index: number): {
|
|
1686
|
+
content: string;
|
|
1687
|
+
durationMs: number | undefined;
|
|
1688
|
+
streaming: boolean;
|
|
1689
|
+
label: string | undefined;
|
|
1690
|
+
};
|
|
1658
1691
|
private readonly classifiers;
|
|
1659
1692
|
private readonly destroyRef;
|
|
1660
1693
|
private readonly injector;
|
|
@@ -2113,6 +2146,36 @@ declare class MarkdownInlineCodeComponent {
|
|
|
2113
2146
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MarkdownInlineCodeComponent, "chat-md-inline-code", never, { "node": { "alias": "node"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2114
2147
|
}
|
|
2115
2148
|
|
|
2149
|
+
type MathNode = MarkdownMathInlineNode | MarkdownMathDisplayNode;
|
|
2150
|
+
/**
|
|
2151
|
+
* Renders a `math-inline` / `math-display` markdown node as KaTeX. KaTeX is
|
|
2152
|
+
* lazy-loaded (see katex-loader); until it resolves, or if the LaTeX is
|
|
2153
|
+
* invalid, the raw `$…$` source is shown — never blank, never a crash.
|
|
2154
|
+
*/
|
|
2155
|
+
declare class MarkdownMathComponent {
|
|
2156
|
+
readonly node: _angular_core.InputSignal<MathNode>;
|
|
2157
|
+
private readonly sanitizer;
|
|
2158
|
+
protected readonly display: _angular_core.Signal<boolean>;
|
|
2159
|
+
protected readonly raw: _angular_core.Signal<string>;
|
|
2160
|
+
protected readonly html: _angular_core.Signal<SafeHtml | null>;
|
|
2161
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MarkdownMathComponent, never>;
|
|
2162
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MarkdownMathComponent, "chat-md-math", never, { "node": { "alias": "node"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* Renders a `html-block` / `html-inline` markdown node as **escaped text** —
|
|
2167
|
+
* the raw HTML is shown literally (Angular interpolation auto-escapes it),
|
|
2168
|
+
* never injected as live markup. This preserves the pre-0.4 behavior where
|
|
2169
|
+
* raw HTML was plain text, and keeps the chat XSS-safe: model-emitted
|
|
2170
|
+
* `<script>`, `<iframe>`, etc. are displayed as text and never executed.
|
|
2171
|
+
*/
|
|
2172
|
+
declare class MarkdownHtmlComponent {
|
|
2173
|
+
readonly node: _angular_core.InputSignal<MarkdownHtmlInlineNode | MarkdownHtmlBlockNode>;
|
|
2174
|
+
protected readonly raw: _angular_core.Signal<string>;
|
|
2175
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MarkdownHtmlComponent, never>;
|
|
2176
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MarkdownHtmlComponent, "chat-md-html", never, { "node": { "alias": "node"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2116
2179
|
declare class MarkdownLinkComponent {
|
|
2117
2180
|
readonly node: _angular_core.InputSignal<MarkdownLinkNode>;
|
|
2118
2181
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MarkdownLinkComponent, never>;
|
|
@@ -2500,6 +2563,8 @@ declare class A2uiIconComponent {
|
|
|
2500
2563
|
readonly childKeys: _angular_core.InputSignal<string[]>;
|
|
2501
2564
|
readonly spec: _angular_core.InputSignal<Spec | undefined>;
|
|
2502
2565
|
protected readonly effectiveName: _angular_core.Signal<string>;
|
|
2566
|
+
/** The effective name as a Material Symbols ligature (camelCase → snake_case). */
|
|
2567
|
+
protected readonly glyphName: _angular_core.Signal<string>;
|
|
2503
2568
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<A2uiIconComponent, never>;
|
|
2504
2569
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<A2uiIconComponent, "a2ui-icon", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "bindings": { "alias": "bindings"; "required": false; "isSignal": true; }; "emit": { "alias": "emit"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "childKeys": { "alias": "childKeys"; "required": false; "isSignal": true; }; "spec": { "alias": "spec"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2505
2570
|
}
|
|
@@ -2939,5 +3004,5 @@ declare function mockAgent(opts?: MockAgentOptions): MockAgent;
|
|
|
2939
3004
|
/** Inferred argument type for a schema (alias of StandardSchemaInferOutput). */
|
|
2940
3005
|
type ToolArgs<S extends StandardSchemaV1> = StandardSchemaInferOutput<S>;
|
|
2941
3006
|
|
|
2942
|
-
export { A2uiAudioPlayerComponent, A2uiButtonComponent, A2uiCardComponent, A2uiCheckBoxComponent, A2uiColumnComponent, A2uiDateTimeInputComponent, A2uiDividerComponent, A2uiIconComponent, A2uiImageComponent, A2uiListComponent, A2uiModalComponent, A2uiMultipleChoiceComponent, A2uiRowComponent, A2uiSliderComponent, A2uiSurfaceComponent, A2uiTabsComponent, A2uiTextComponent, A2uiTextFieldComponent, A2uiVideoComponent, AGENT_ERROR_MESSAGES, AgentError, CHAT_CONFIG, CHAT_LIFECYCLE, ChatApprovalCardComponent, ChatCitationCardTemplateDirective, ChatCitationsCardComponent, ChatCitationsComponent, ChatComponent, ChatConfirmDialogComponent, ChatErrorComponent, ChatGenerativeUiComponent, ChatGenuiSkeletonComponent, ChatHistorySearchPaletteComponent, ChatInputComponent, ChatInterruptComponent, ChatInterruptPanelComponent, ChatLauncherButtonComponent, ChatMessageActionsComponent, ChatMessageComponent, ChatMessageListComponent, ChatOverflowMenuComponent, ChatPopupComponent, ChatProjectListComponent, ChatReasoningComponent, ChatScrollBubbleComponent, ChatSelectComponent, ChatSidebarComponent, ChatSidenavComponent, ChatSidenavScrimComponent, ChatStreamingMdComponent, ChatSubagentCardComponent, ChatSubagentsComponent, ChatSuggestionsComponent, ChatThreadListComponent, ChatTimelineComponent, ChatTimelineSliderComponent, ChatToolCallCardComponent, ChatToolCallTemplateDirective, ChatToolCallsComponent, ChatToolViewsComponent, ChatTraceComponent, ChatTypingIndicatorComponent, ChatWelcomeComponent, ChatWelcomeSuggestionComponent, ChatWindowComponent, CitationsResolverService, IS_HEADER_ROW, MARKDOWN_VIEW_REGISTRY, MarkdownAutolinkComponent, MarkdownBlockquoteComponent, MarkdownChildrenComponent, MarkdownCitationReferenceComponent, MarkdownCodeBlockComponent, MarkdownDocumentComponent, MarkdownEmphasisComponent, MarkdownHardBreakComponent, MarkdownHeadingComponent, MarkdownImageComponent, MarkdownInlineCodeComponent, MarkdownLinkComponent, MarkdownListComponent, MarkdownListItemComponent, MarkdownParagraphComponent, MarkdownSoftBreakComponent, MarkdownStrikethroughComponent, MarkdownStrongComponent, MarkdownTableCellComponent, MarkdownTableComponent, MarkdownTableRowComponent, MarkdownTextComponent, MarkdownThematicBreakComponent, MessageTemplateDirective, a2uiBasicCatalog, action, ask, buildA2uiActionMessage, cacheplaneMarkdownViews, createA2uiSurfaceStore, createAgentRef, createContentClassifier, createParseTreeStore, createPartialArgsBridge, deriveJsonSchema, emitBinding, executeFunctionTool, extractErrorMessage, formatDuration, getInterrupt, getMessageType, injectThreadRouting, isAbortError, isAssistantMessage, isSystemMessage, isToolMessage, isTyping, isUserMessage, messageContent, mockAgent, normalizeEnvelopeArgs, normalizeViewEntry, provideChat, renderMarkdown, startClientToolExecutor, statusColor, submitMessage, toAgentError, toClientToolSpecs, tools, validateArgs, view };
|
|
3007
|
+
export { A2uiAudioPlayerComponent, A2uiButtonComponent, A2uiCardComponent, A2uiCheckBoxComponent, A2uiColumnComponent, A2uiDateTimeInputComponent, A2uiDividerComponent, A2uiIconComponent, A2uiImageComponent, A2uiListComponent, A2uiModalComponent, A2uiMultipleChoiceComponent, A2uiRowComponent, A2uiSliderComponent, A2uiSurfaceComponent, A2uiTabsComponent, A2uiTextComponent, A2uiTextFieldComponent, A2uiVideoComponent, AGENT_ERROR_MESSAGES, AgentError, CHAT_CONFIG, CHAT_LIFECYCLE, ChatApprovalCardComponent, ChatCitationCardTemplateDirective, ChatCitationsCardComponent, ChatCitationsComponent, ChatComponent, ChatConfirmDialogComponent, ChatErrorComponent, ChatGenerativeUiComponent, ChatGenuiSkeletonComponent, ChatHistorySearchPaletteComponent, ChatInputComponent, ChatInterruptComponent, ChatInterruptPanelComponent, ChatLauncherButtonComponent, ChatMessageActionsComponent, ChatMessageComponent, ChatMessageListComponent, ChatOverflowMenuComponent, ChatPopupComponent, ChatProjectListComponent, ChatReasoningComponent, ChatScrollBubbleComponent, ChatSelectComponent, ChatSidebarComponent, ChatSidenavComponent, ChatSidenavScrimComponent, ChatStreamingMdComponent, ChatSubagentCardComponent, ChatSubagentsComponent, ChatSuggestionsComponent, ChatThreadListComponent, ChatTimelineComponent, ChatTimelineSliderComponent, ChatToolCallCardComponent, ChatToolCallTemplateDirective, ChatToolCallsComponent, ChatToolViewsComponent, ChatTraceComponent, ChatTypingIndicatorComponent, ChatWelcomeComponent, ChatWelcomeSuggestionComponent, ChatWindowComponent, CitationsResolverService, IS_HEADER_ROW, MARKDOWN_VIEW_REGISTRY, MarkdownAutolinkComponent, MarkdownBlockquoteComponent, MarkdownChildrenComponent, MarkdownCitationReferenceComponent, MarkdownCodeBlockComponent, MarkdownDocumentComponent, MarkdownEmphasisComponent, MarkdownHardBreakComponent, MarkdownHeadingComponent, MarkdownHtmlComponent, MarkdownImageComponent, MarkdownInlineCodeComponent, MarkdownLinkComponent, MarkdownListComponent, MarkdownListItemComponent, MarkdownMathComponent, MarkdownParagraphComponent, MarkdownSoftBreakComponent, MarkdownStrikethroughComponent, MarkdownStrongComponent, MarkdownTableCellComponent, MarkdownTableComponent, MarkdownTableRowComponent, MarkdownTextComponent, MarkdownThematicBreakComponent, MessageTemplateDirective, a2uiBasicCatalog, action, ask, buildA2uiActionMessage, cacheplaneMarkdownViews, createA2uiSurfaceStore, createAgentRef, createContentClassifier, createParseTreeStore, createPartialArgsBridge, deriveJsonSchema, emitBinding, executeFunctionTool, extractErrorMessage, formatDuration, getInterrupt, getMessageType, injectThreadRouting, isAbortError, isAssistantMessage, isSystemMessage, isToolMessage, isTyping, isUserMessage, messageContent, mockAgent, normalizeEnvelopeArgs, normalizeViewEntry, provideChat, renderMarkdown, startClientToolExecutor, statusColor, submitMessage, toAgentError, toClientToolSpecs, tools, validateArgs, view };
|
|
2943
3008
|
export type { A2uiComponentView, A2uiSurfaceState, A2uiSurfaceStore, A2uiViewEntry, A2uiViews, Agent, AgentCheckpoint, AgentCustomEvent, AgentErrorKind, AgentEvent, AgentInterrupt, AgentRef, AgentRuntimeTelemetryEvent, AgentRuntimeTelemetryPayload, AgentRuntimeTelemetryProperties, AgentRuntimeTelemetrySink, AgentStateUpdateEvent, AgentStatus, AgentSubmitInput, AgentSubmitOptions, AgentWithHistory, AnyFunctionToolDef, AskToolDef, ChatApprovalAction, ChatConfig, ChatLifecycle, ChatMessageRole, ChatRenderEvent, ChatScrollBubbleMode, ChatSelectOption, ChatSidenavMode, ChatToolCallTemplateContext, Citation, ClientToolDef, ClientToolRegistry, ClientToolResult, ClientToolSpec, ClientToolsCapability, ClientToolsCoordinator, ContentBlock, ContentClassifier, ContentType, ElementAccumulationState, FunctionToolDef, InterruptAction, Message, MessageTemplateType, MockAgent, MockAgentOptions, OverflowMenuItem, ParseTreeStore, PartialArgsBridge, Project, ProjectActionAdapter, ResolvedCitation, Role, Subagent, SubagentStatus, Thread, ThreadActionAdapter, ThreadMatch, ThreadRoutingConfig, ToolArgs, ToolCall, ToolCallInfo, ToolCallStatus, TraceState, ViewProps, ViewToolDef };
|