langchain_agentx_stream_ui 0.1.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.
@@ -0,0 +1,195 @@
1
+ interface TextNode {
2
+ kind: 'text';
3
+ id: string;
4
+ accumulated: string;
5
+ status: 'streaming' | 'done';
6
+ startedAt: number;
7
+ }
8
+ interface ReasoningNode {
9
+ kind: 'reasoning';
10
+ id: string;
11
+ accumulated: string;
12
+ status: 'streaming' | 'done';
13
+ startedAt: number;
14
+ /** 所属轮次 ID */
15
+ roundId: string;
16
+ /** 是否可折叠(用于完成态) */
17
+ isCollapsible: boolean;
18
+ /** 轮次耗时(秒) */
19
+ elapsedSeconds: number | null;
20
+ /** 结束时间戳 */
21
+ endedAt: number | null;
22
+ }
23
+ interface StepDetail {
24
+ id: string;
25
+ label: string;
26
+ status: 'running' | 'done';
27
+ startedAt: number;
28
+ endedAt: number | null;
29
+ }
30
+ type SubagentProgressStatus = 'running' | 'completed' | 'error';
31
+ /** 子 agent 内部工具 progress 行(挂 Agent ToolCallNode)。 */
32
+ interface SubagentProgressEntry {
33
+ agentId: string;
34
+ subagentType?: string;
35
+ step: number;
36
+ toolName: string;
37
+ summary: string;
38
+ status: SubagentProgressStatus;
39
+ /** SDK subagent-tool-call 携带,用于 Bash(cmd) / Read(path) 折叠行。 */
40
+ toolInput?: unknown;
41
+ childToolCallId?: string;
42
+ }
43
+ /** 子 agent 生命周期标记(按 agent_id 分桶)。 */
44
+ interface SubagentSessionMarker {
45
+ agentId: string;
46
+ subagentType?: string;
47
+ status: 'running' | 'done';
48
+ startedAt: number;
49
+ endedAt: number | null;
50
+ }
51
+ /** 挂在 ToolCall / SubAgent 上的折叠区数据 */
52
+ interface NodeDetail {
53
+ input?: unknown;
54
+ inputStream?: string;
55
+ steps?: StepDetail[];
56
+ debugLines?: {
57
+ eventType: string;
58
+ data: unknown;
59
+ }[];
60
+ }
61
+ interface ToolCallNode {
62
+ kind: 'tool_call';
63
+ id: string;
64
+ toolCallId: string | null;
65
+ toolName: string;
66
+ input: unknown;
67
+ status: 'running' | 'done' | 'failed';
68
+ startedAt: number;
69
+ endedAt: number | null;
70
+ result: {
71
+ schema_version: string;
72
+ status: string;
73
+ summary: string | null;
74
+ payload: unknown;
75
+ display?: unknown;
76
+ blocks: unknown[];
77
+ artifacts: unknown[];
78
+ hints: unknown;
79
+ meta: unknown;
80
+ error: {
81
+ message: string;
82
+ type?: string;
83
+ } | null;
84
+ truncated: boolean;
85
+ overflow_file: string | null;
86
+ } | null;
87
+ progress: {
88
+ current: number;
89
+ total: number;
90
+ message?: string;
91
+ elapsedTimeSeconds?: number;
92
+ totalLines?: number;
93
+ } | null;
94
+ /** @deprecated 使用 details.inputStream */
95
+ inputDelta: string;
96
+ details?: NodeDetail;
97
+ /** 主舞台挂载后出现在 Timeline;仅 byId 存在时为 false */
98
+ onMainStage?: boolean;
99
+ /** 内部工具(Task* 等),不在 Timeline 显示 */
100
+ hidden?: boolean;
101
+ /** SDK 1.2.0 方案 A:子 agent 工具 progress(折叠在 Agent 行下) */
102
+ subagentProgress?: SubagentProgressEntry[];
103
+ /** 子 agent 实例生命周期(agent_id → marker) */
104
+ subagentSessions?: Record<string, SubagentSessionMarker>;
105
+ }
106
+ interface SubAgentNode {
107
+ kind: 'subagent';
108
+ id: string;
109
+ subagentId: string;
110
+ childIds: string[];
111
+ status: 'running' | 'done' | 'failed';
112
+ startedAt: number;
113
+ endedAt: number | null;
114
+ details?: NodeDetail;
115
+ }
116
+ interface StepNode {
117
+ kind: 'step';
118
+ id: string;
119
+ label: string;
120
+ status: 'running' | 'done';
121
+ startedAt: number;
122
+ endedAt: number | null;
123
+ }
124
+ interface ErrorNode {
125
+ kind: 'error';
126
+ id: string;
127
+ message: string;
128
+ errorType: string | null;
129
+ startedAt: number;
130
+ }
131
+ interface UnknownNode {
132
+ kind: 'unknown';
133
+ id: string;
134
+ eventType: string;
135
+ rawData: unknown;
136
+ startedAt: number;
137
+ }
138
+ interface PermissionNode {
139
+ kind: 'permission';
140
+ id: string;
141
+ requestId: string;
142
+ toolName: string;
143
+ message: string;
144
+ askPrompt: string | null;
145
+ status: 'pending' | 'resolved';
146
+ startedAt: number;
147
+ }
148
+ /** 工具统计(用于轮次摘要) */
149
+ interface ToolCounts {
150
+ searchCount: number;
151
+ readCount: number;
152
+ listCount: number;
153
+ bashCount: number;
154
+ memorySearchCount: number;
155
+ memoryReadCount: number;
156
+ memoryWriteCount: number;
157
+ relevantRecallCount: number;
158
+ gitOpBashCount: number;
159
+ mcpCallCount: number;
160
+ }
161
+ /** Thinking 轮次摘要节点 */
162
+ interface ThinkingSummaryNode {
163
+ kind: 'thinking_summary';
164
+ id: string;
165
+ /** 所属轮次 ID */
166
+ roundId: string;
167
+ /** 关联的 reasoning 节点 ID */
168
+ reasoningNodeId: string;
169
+ /** 关联的 collapsed_explore 节点 ID(如果有工具活动) */
170
+ exploreNodeId: string | null;
171
+ /** 耗时(秒) */
172
+ elapsedSeconds: number;
173
+ /** 工具统计 */
174
+ toolCounts: ToolCounts;
175
+ /** 是否可展开 */
176
+ isExpanded: boolean;
177
+ /** 创建时间 */
178
+ startedAt: number;
179
+ }
180
+ /** 记忆保存摘要节点(SDK MEMORY_SAVED → "Saved N memories")。 */
181
+ interface MemorySavedNode {
182
+ kind: 'memory_saved';
183
+ id: string;
184
+ /** 实际保存的记忆条数(与 writtenPaths.length 一致或更大)。 */
185
+ count: number;
186
+ /** 写入的文件绝对路径列表(可为空,例如仅更新索引)。 */
187
+ writtenPaths: string[];
188
+ /** UI 一行摘要文本,对齐 CLI memory_saved_handler.display_hint。 */
189
+ displayHint: string;
190
+ startedAt: number;
191
+ }
192
+ type SessionNode = TextNode | ReasoningNode | ThinkingSummaryNode | ToolCallNode | SubAgentNode | StepNode | ErrorNode | UnknownNode | PermissionNode | MemorySavedNode;
193
+ type SessionNodeKind = SessionNode['kind'];
194
+
195
+ export type { ErrorNode as E, NodeDetail as N, PermissionNode as P, ReasoningNode as R, SessionNode as S, TextNode as T, UnknownNode as U, SessionNodeKind as a, StepDetail as b, StepNode as c, SubAgentNode as d, SubagentProgressEntry as e, SubagentSessionMarker as f, ToolCallNode as g, ToolCounts as h };
@@ -0,0 +1,158 @@
1
+ import { T as ToolBodyComponent, a as ToolBodyMode } from './types-aXj5TYSP.js';
2
+
3
+ declare class ToolDisplayRegistry {
4
+ private readonly map;
5
+ register(toolName: string, body: ToolBodyComponent): this;
6
+ resolve(toolName: string): ToolBodyComponent | undefined;
7
+ static default(): ToolDisplayRegistry;
8
+ }
9
+ /** 默认 registry:CC TOOL_NAME 单键,与 SDK registry_names.py 对齐。 */
10
+ declare function createDefaultToolRegistry(): ToolDisplayRegistry;
11
+
12
+ /**
13
+ * renderModel.ts — Canonical / Renderable 投影契约
14
+ *
15
+ * 职责:
16
+ * 定义 CanonicalNodeRef、RenderableEntry、ProjectionContext(Phase 1 SSOT)。
17
+ *
18
+ * 链路位置:
19
+ * treeAdapter → RenderableTimelineProjector.project() → RenderableEntry[]。
20
+ *
21
+ * 当前裁剪范围:
22
+ * 折叠 / 分组 payload 由 Phase 2+ accumulator 填充;本文件仅 contract。
23
+ */
24
+ type DisplayMode = 'normal' | 'brief_only' | 'transcript';
25
+ type CanonicalNodeType = 'text' | 'reasoning' | 'tool_use' | 'permission' | 'error' | 'unknown'
26
+ /** @deprecated 方案 A 不再从 treeAdapter 产出;保留类型供历史 canonical 兼容。 */
27
+ | 'subagent' | 'hook' | 'compact' | 'relevant_memories' | 'thinking_round' | 'thinking_summary' | 'memory_saved';
28
+ interface CanonicalNodeRef {
29
+ nodeId: string;
30
+ type: CanonicalNodeType;
31
+ payload: Record<string, unknown>;
32
+ responseId?: string | null;
33
+ }
34
+ type RenderableEntryKind = 'node' | 'collapsed_explore' | 'grouped_tool_use' | 'thinking_summary' | 'system_summary';
35
+ interface RenderableEntry {
36
+ kind: RenderableEntryKind;
37
+ sourceNodeIds: string[];
38
+ payload: Record<string, unknown>;
39
+ }
40
+ interface ToolUseSnapshot {
41
+ tool_call_id: string;
42
+ tool_name: unknown;
43
+ tool_input: Record<string, unknown>;
44
+ progress_text?: string;
45
+ output?: string;
46
+ is_error?: boolean;
47
+ display?: Record<string, unknown>;
48
+ meta?: Record<string, unknown>;
49
+ }
50
+ interface CollapsedExplorePayload {
51
+ summaryText: string | null;
52
+ active: boolean;
53
+ searchCount: number;
54
+ readCount: number;
55
+ listCount: number;
56
+ bashCount: number;
57
+ memoryReadCount: number;
58
+ memoryWriteCount: number;
59
+ memorySearchCount: number;
60
+ relevantRecallCount: number;
61
+ gitOpBashCount: number;
62
+ mcpCallCount: number;
63
+ readPaths: string[];
64
+ searchArgs: string[];
65
+ latestDisplayHint: string | null;
66
+ shellProgressSuffix: string | null;
67
+ toolUses: ToolUseSnapshot[];
68
+ /** 所属轮次 ID */
69
+ roundId: string | null;
70
+ /** 关联的 reasoning 节点 ID */
71
+ reasoningNodeId: string | null;
72
+ }
73
+ interface ProjectionContextOptions {
74
+ displayMode: DisplayMode;
75
+ verbose?: boolean;
76
+ /** CC/CLI normal:false → 不 emit thinking_summary;时间线不 mount reasoning */
77
+ showReasoningInTimeline?: boolean;
78
+ /** 方案 A:任务列表已展示时 suppress 纯 thought 的 thinking_summary */
79
+ hasEverShownTaskList?: boolean;
80
+ memoryDir?: string | null;
81
+ workspaceRoot?: string | null;
82
+ silentTools?: ReadonlySet<string>;
83
+ exploreFullscreenBash?: boolean;
84
+ }
85
+ declare class ProjectionContext {
86
+ readonly displayMode: DisplayMode;
87
+ readonly verbose: boolean;
88
+ readonly showReasoningInTimeline: boolean;
89
+ readonly hasEverShownTaskList: boolean;
90
+ readonly memoryDir: string | null;
91
+ readonly workspaceRoot: string | null;
92
+ readonly silentTools: ReadonlySet<string>;
93
+ readonly exploreFullscreenBash: boolean;
94
+ constructor(options: ProjectionContextOptions);
95
+ withHasEverShownTaskList(hasEverShownTaskList: boolean): ProjectionContext;
96
+ get transcript(): boolean;
97
+ get briefOnly(): boolean;
98
+ get normal(): boolean;
99
+ /** 对齐 CLI ProjectionContext.should_apply_grouping */
100
+ shouldApplyGrouping(): boolean;
101
+ /** 对齐 CLI ProjectionContext.should_show_explore_detail */
102
+ shouldShowExploreDetail(): boolean;
103
+ /** CC normal:emit thinking_summary(Thought for Ns);reasoning 全文仍由 showReasoningInTimeline 控制 */
104
+ shouldEmitThinkingSummary(): boolean;
105
+ /** compact normal / 任务模式:不 emit 无 explore 的 thought-only thinking_summary */
106
+ shouldSuppressThoughtOnlySummary(): boolean;
107
+ }
108
+ declare function createProjectionContext(options: ProjectionContextOptions): ProjectionContext;
109
+
110
+ /**
111
+ * sessionViewOptions.ts — Timeline 布局、权限 UI 与 Projection 视图上下文
112
+ *
113
+ * 对齐参考:详设 07 · CLI ProjectionContext · CC display mode / verbose
114
+ */
115
+
116
+ /** standalone:V2-D 独立 PermissionCard;inline:挂到 ToolCallShell;both:双轨 */
117
+ type PermissionUiMode = 'standalone' | 'inline' | 'both';
118
+
119
+ interface SessionViewOptions {
120
+ /**
121
+ * @deprecated Phase 4 起由 core/projection GroupedToolUseAccumulator 替代。
122
+ * 在 projection 全量接入前,TimelineEntries 仍读取此开关。
123
+ */
124
+ groupParallelTools: boolean;
125
+ /** 权限 UI 策略(T4.6);后台 bypass 时通常无 pending */
126
+ permissionUiMode: PermissionUiMode;
127
+ /** 对齐 CC verbose / transcript:展开 reasoning 全文;默认 false 仅一行 ∴ Thinking */
128
+ verboseReasoning: boolean;
129
+ /** 对齐 CLI Normal;explore 折叠默认开启 */
130
+ displayMode: DisplayMode;
131
+ /** 对齐 CC verbose;为 true 时跳过分组(shouldApplyGrouping) */
132
+ verbose: boolean;
133
+ /** 对齐 CLI_EXPLORE_FULLSCREEN_BASH;控制 bash 桶计数 */
134
+ exploreFullscreenBash: boolean;
135
+ /** memory 工具路径分类;宿主注入 workspace memory 目录 */
136
+ memoryDir?: string | null;
137
+ workspaceRoot?: string | null;
138
+ }
139
+ declare const DEFAULT_SESSION_VIEW_OPTIONS: SessionViewOptions;
140
+ /** Phase 1+ ProjectionContext 语义预览(仍由 SessionViewOptions 驱动) */
141
+ interface ProjectionViewContext {
142
+ displayMode: DisplayMode;
143
+ verbose: boolean;
144
+ exploreFullscreenBash: boolean;
145
+ memoryDir: string | null;
146
+ workspaceRoot: string | null;
147
+ }
148
+ declare function buildProjectionViewContext(options?: SessionViewOptions): ProjectionViewContext;
149
+ /** SessionViewOptions → ProjectionContext(Phase 1+ projector 入口) */
150
+ declare function buildProjectionContext(options?: SessionViewOptions): ProjectionContext;
151
+ /** 对齐 CLI ProjectionContext.shouldApplyGrouping() */
152
+ declare function shouldApplyGrouping(options: SessionViewOptions): boolean;
153
+ /** 对齐 CLI ProjectionContext.shouldShowExploreDetail() */
154
+ declare function shouldShowExploreDetail(options: Pick<SessionViewOptions, 'verbose' | 'displayMode'>): boolean;
155
+ /** transcript / verbose 时 V3 ToolBody 默认 FULL(详设 I07) */
156
+ declare function resolveEffectiveToolBodyMode(options: SessionViewOptions, defaultMode: ToolBodyMode): ToolBodyMode;
157
+
158
+ export { type CanonicalNodeRef as C, DEFAULT_SESSION_VIEW_OPTIONS as D, type PermissionUiMode as P, type RenderableEntry as R, type SessionViewOptions as S, ToolDisplayRegistry as T, type CollapsedExplorePayload as a, type DisplayMode as b, ProjectionContext as c, type ToolUseSnapshot as d, buildProjectionContext as e, buildProjectionViewContext as f, createDefaultToolRegistry as g, createProjectionContext as h, shouldShowExploreDetail as i, resolveEffectiveToolBodyMode as r, shouldApplyGrouping as s };
@@ -0,0 +1,14 @@
1
+ export { B as BodyBlock, a as BodyBlockList, D as DiffView, M as MAX_PREVIEW_LINES, b as MarkdownBlock, T as TruncatedContent, c as buildBashBodyBlocks, d as displayPath, f as formatDiffFromStrings, e as formatPatternTitle, g as formatSearchResultBody, h as formatTimeoutFooter, p as parseDiffText, t as truncateCommand, i as truncateLines } from './MarkdownBlock-3iEW0Ubm.js';
2
+ export { a as ToolBodyMode } from './types-aXj5TYSP.js';
3
+ import 'react/jsx-runtime';
4
+ import 'react';
5
+ import './nodes-DqhaBW7M.js';
6
+
7
+ /**
8
+ * textHelpers.ts — 标题预览截断
9
+ *
10
+ * 对齐参考:CLI widgets/tools/helpers.py truncate_preview
11
+ */
12
+ declare function truncatePreview(text: string, maxChars?: number): string;
13
+
14
+ export { truncatePreview };
@@ -0,0 +1,37 @@
1
+ import {
2
+ truncatePreview
3
+ } from "./chunk-DP7V33X7.js";
4
+ import {
5
+ BodyBlockList,
6
+ DiffView,
7
+ MAX_PREVIEW_LINES,
8
+ MarkdownBlock,
9
+ TruncatedContent,
10
+ buildBashBodyBlocks,
11
+ displayPath,
12
+ formatDiffFromStrings,
13
+ formatPatternTitle,
14
+ formatSearchResultBody,
15
+ formatTimeoutFooter,
16
+ parseDiffText,
17
+ truncateCommand,
18
+ truncateLines
19
+ } from "./chunk-4RIOBLGB.js";
20
+ export {
21
+ BodyBlockList,
22
+ DiffView,
23
+ MAX_PREVIEW_LINES,
24
+ MarkdownBlock,
25
+ TruncatedContent,
26
+ buildBashBodyBlocks,
27
+ displayPath,
28
+ formatDiffFromStrings,
29
+ formatPatternTitle,
30
+ formatSearchResultBody,
31
+ formatTimeoutFooter,
32
+ parseDiffText,
33
+ truncateCommand,
34
+ truncateLines,
35
+ truncatePreview
36
+ };
37
+ //# sourceMappingURL=tools-presentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,21 @@
1
+ import { P as PermissionUiMode } from './sessionViewOptions-DLSFRQwZ.js';
2
+ export { T as ToolDisplayRegistry, g as createDefaultToolRegistry } from './sessionViewOptions-DLSFRQwZ.js';
3
+ export { A as AgentToolBody, a as AskUserQuestionToolBody, B as BashToolBody, D as DefaultToolBody, E as EditToolBody, G as GlobToolBody, b as GrepToolBody, R as ReadToolBody, S as SkillToolBody, W as WebFetchToolBody, c as WebSearchToolBody, d as WriteToolBody, f as formatToolTitle, r as resolveToolBody } from './AskUserQuestionToolBody-CyuNy_k5.js';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import { ReactNode } from 'react';
6
+ import { g as ToolCallNode, P as PermissionNode } from './nodes-DqhaBW7M.js';
7
+ export { T as ToolBodyComponent, a as ToolBodyMode, b as ToolDisplayProps } from './types-aXj5TYSP.js';
8
+
9
+ interface ToolCallShellProps {
10
+ status: ToolCallNode['status'];
11
+ title: string;
12
+ progress?: ToolCallNode['progress'];
13
+ errorMessage?: string | null;
14
+ layout?: 'default' | 'grouped';
15
+ permissionWait?: PermissionNode;
16
+ permissionUiMode?: PermissionUiMode;
17
+ children?: ReactNode;
18
+ }
19
+ declare function ToolCallShell({ status, title, progress, errorMessage, layout, permissionWait, permissionUiMode, children, }: ToolCallShellProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { ToolCallShell };
package/dist/tools.js ADDED
@@ -0,0 +1,43 @@
1
+ import {
2
+ DefaultToolBody,
3
+ ToolCallShell,
4
+ formatToolTitle,
5
+ resolveToolBody
6
+ } from "./chunk-WM6Y6APP.js";
7
+ import "./chunk-DP7V33X7.js";
8
+ import {
9
+ AgentToolBody,
10
+ AskUserQuestionToolBody,
11
+ BashToolBody,
12
+ EditToolBody,
13
+ GlobToolBody,
14
+ GrepToolBody,
15
+ ReadToolBody,
16
+ SkillToolBody,
17
+ ToolDisplayRegistry,
18
+ WebFetchToolBody,
19
+ WebSearchToolBody,
20
+ WriteToolBody,
21
+ createDefaultToolRegistry
22
+ } from "./chunk-MHK53ZHC.js";
23
+ import "./chunk-4RIOBLGB.js";
24
+ export {
25
+ AgentToolBody,
26
+ AskUserQuestionToolBody,
27
+ BashToolBody,
28
+ DefaultToolBody,
29
+ EditToolBody,
30
+ GlobToolBody,
31
+ GrepToolBody,
32
+ ReadToolBody,
33
+ SkillToolBody,
34
+ ToolCallShell,
35
+ ToolDisplayRegistry,
36
+ WebFetchToolBody,
37
+ WebSearchToolBody,
38
+ WriteToolBody,
39
+ createDefaultToolRegistry,
40
+ formatToolTitle,
41
+ resolveToolBody
42
+ };
43
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,33 @@
1
+ import { ComponentType } from 'react';
2
+ import { g as ToolCallNode, e as SubagentProgressEntry, f as SubagentSessionMarker } from './nodes-DqhaBW7M.js';
3
+
4
+ /**
5
+ * types.ts — Tool Display 公共类型
6
+ *
7
+ * 职责:
8
+ * ToolBodyMode、ToolDisplayProps、ToolBodyComponent 定义。
9
+ *
10
+ * 链路位置:
11
+ * ToolDisplayRegistry → resolveToolBody → *ToolBody / DefaultToolBody。
12
+ *
13
+ * 当前裁剪范围:
14
+ * 不含 per-tool 专用 props;T1+ Widget 共用此接口。
15
+ */
16
+
17
+ type ToolBodyMode = 'preview' | 'full';
18
+ interface ToolDisplayProps {
19
+ nodeId: string;
20
+ toolName: string;
21
+ status: ToolCallNode['status'];
22
+ input: unknown;
23
+ inputStream?: string;
24
+ result: ToolCallNode['result'];
25
+ progress?: ToolCallNode['progress'];
26
+ subagentProgress?: SubagentProgressEntry[];
27
+ subagentSessions?: Record<string, SubagentSessionMarker>;
28
+ bodyMode: ToolBodyMode;
29
+ onBodyModeChange?: (mode: ToolBodyMode) => void;
30
+ }
31
+ type ToolBodyComponent = ComponentType<ToolDisplayProps>;
32
+
33
+ export type { ToolBodyComponent as T, ToolBodyMode as a, ToolDisplayProps as b };
@@ -0,0 +1,36 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { a as SessionNodeKind, S as SessionNode } from './nodes-DqhaBW7M.js';
3
+
4
+ /**
5
+ * 职责:VirtualTimeline 按 SessionNode kind 或 RenderableEntry kind 估算行高。
6
+ * 链路位置:VirtualTimeline useVirtualizer estimateSize。
7
+ * 当前裁剪范围:静态表;subagent 估算保留供自定义 registry 兼容。
8
+ */
9
+
10
+ declare const DEFAULT_ESTIMATE_SIZE = 96;
11
+ declare const ESTIMATE_SIZE_BY_KIND: Record<SessionNodeKind, number>;
12
+ declare function estimateNodeSize(node: SessionNode | undefined, fallback?: number): number;
13
+
14
+ declare const DEFAULT_VIRTUALIZE_THRESHOLD = 500;
15
+ interface VirtualTimelineProps {
16
+ estimateSize?: number;
17
+ }
18
+ declare function VirtualTimeline({ estimateSize, }: VirtualTimelineProps): react_jsx_runtime.JSX.Element;
19
+
20
+ /**
21
+
22
+ * 职责:按 virtualized 阈值选择 Timeline 或 VirtualTimeline。
23
+
24
+ * 链路位置:AgentSession / MultiAgentSession 默认 children。
25
+
26
+ * 当前裁剪范围:Grouped 布局与 virtual 互斥(groupParallelTools 时强制 Timeline)。
27
+
28
+ */
29
+ interface SessionTimelineProps {
30
+ virtualized?: boolean;
31
+ virtualizeThreshold?: number;
32
+ groupParallelTools?: boolean;
33
+ }
34
+ declare function SessionTimeline({ virtualized, virtualizeThreshold, groupParallelTools, }: SessionTimelineProps): react_jsx_runtime.JSX.Element;
35
+
36
+ export { DEFAULT_ESTIMATE_SIZE, DEFAULT_VIRTUALIZE_THRESHOLD, ESTIMATE_SIZE_BY_KIND, SessionTimeline, type SessionTimelineProps, VirtualTimeline, type VirtualTimelineProps, estimateNodeSize };
@@ -0,0 +1,19 @@
1
+ import {
2
+ DEFAULT_ESTIMATE_SIZE,
3
+ DEFAULT_VIRTUALIZE_THRESHOLD,
4
+ ESTIMATE_SIZE_BY_KIND,
5
+ SessionTimeline,
6
+ VirtualTimeline,
7
+ estimateNodeSize
8
+ } from "./chunk-G2KYJCMM.js";
9
+ import "./chunk-MHK53ZHC.js";
10
+ import "./chunk-4RIOBLGB.js";
11
+ export {
12
+ DEFAULT_ESTIMATE_SIZE,
13
+ DEFAULT_VIRTUALIZE_THRESHOLD,
14
+ ESTIMATE_SIZE_BY_KIND,
15
+ SessionTimeline,
16
+ VirtualTimeline,
17
+ estimateNodeSize
18
+ };
19
+ //# sourceMappingURL=virtual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "langchain_agentx_stream_ui",
3
+ "version": "0.1.0",
4
+ "description": "React session timeline component library for LangchainAgentEvent SSE streams",
5
+ "license": "MIT",
6
+ "author": "wugk",
7
+ "keywords": [
8
+ "react",
9
+ "agent",
10
+ "stream",
11
+ "sse",
12
+ "langchain",
13
+ "visualization",
14
+ "session-timeline"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/GoodMood2008/langchain_agentx_stream_ui.git"
19
+ },
20
+ "homepage": "https://github.com/GoodMood2008/langchain_agentx_stream_ui#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/GoodMood2008/langchain_agentx_stream_ui/issues"
23
+ },
24
+ "type": "module",
25
+ "main": "./dist/index.js",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ },
33
+ "./virtual": {
34
+ "types": "./dist/virtual.d.ts",
35
+ "import": "./dist/virtual.js"
36
+ },
37
+ "./multi-session": {
38
+ "types": "./dist/multi-session.d.ts",
39
+ "import": "./dist/multi-session.js"
40
+ },
41
+ "./tools": {
42
+ "types": "./dist/tools.d.ts",
43
+ "import": "./dist/tools.js"
44
+ },
45
+ "./tools/presentation": {
46
+ "types": "./dist/tools-presentation.d.ts",
47
+ "import": "./dist/tools-presentation.js"
48
+ },
49
+ "./styles/default.css": "./dist/default.css"
50
+ },
51
+ "files": [
52
+ "dist"
53
+ ],
54
+ "sideEffects": [
55
+ "*.css"
56
+ ],
57
+ "scripts": {
58
+ "build": "tsup",
59
+ "test": "vitest run",
60
+ "test:watch": "vitest",
61
+ "typecheck": "tsc --noEmit"
62
+ },
63
+ "peerDependencies": {
64
+ "react": ">=18",
65
+ "react-dom": ">=18"
66
+ },
67
+ "dependencies": {
68
+ "@tanstack/react-virtual": "^3.14.2",
69
+ "zustand": "^5.0.0",
70
+ "react-markdown": "^10.1.0",
71
+ "remark-gfm": "^4.0.1",
72
+ "react-syntax-highlighter": "^15.6.6",
73
+ "marked": "^15.0.0"
74
+ },
75
+ "devDependencies": {
76
+ "@testing-library/react": "^16.0.0",
77
+ "@types/node": "^22.0.0",
78
+ "@types/react": "^18.3.0",
79
+ "@types/react-dom": "^18.3.0",
80
+ "@types/react-syntax-highlighter": "^15.5.13",
81
+ "jsdom": "^25.0.0",
82
+ "react": "^18.3.0",
83
+ "react-dom": "^18.3.0",
84
+ "tsup": "^8.0.0",
85
+ "typescript": "^5.8.3",
86
+ "vitest": "^2.0.0"
87
+ }
88
+ }