langchain_agentx_stream_ui 0.1.0 → 0.1.2

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.
@@ -307,36 +307,6 @@ interface MarkdownRendererProps {
307
307
  }
308
308
  type MarkdownRenderer = (props: MarkdownRendererProps) => ReactNode;
309
309
 
310
- interface MultiSessionSourceConfig {
311
- sessionId: string;
312
- source: Source;
313
- /** EventBuffer ingest 快照或历史事件;挂载时 replay 后再接 source 续流(M3) */
314
- initialEvents?: LangchainAgentEvent[];
315
- }
316
- interface MultiAgentSessionProps {
317
- sessions: MultiSessionSourceConfig[];
318
- /** 受控活跃 session */
319
- activeSessionId?: string | null;
320
- /** 非受控默认活跃 session */
321
- defaultActiveSessionId?: string | null;
322
- onActiveSessionChange?: (sessionId: string | null) => void;
323
- maxSessions?: number;
324
- tierOverrides?: TierOverrides;
325
- debug?: boolean;
326
- registry?: NodeRegistry;
327
- onError?: (error: Error, sessionId: string) => void;
328
- virtualized?: boolean;
329
- virtualizeThreshold?: number;
330
- interactionBus?: InteractionBus;
331
- toolDisplayRegistry?: ToolDisplayRegistry;
332
- defaultBodyMode?: ToolBodyMode;
333
- groupParallelTools?: boolean;
334
- permissionUiMode?: PermissionUiMode;
335
- markdownRenderer?: MarkdownRenderer;
336
- children?: ReactNode;
337
- }
338
- declare function MultiAgentSession({ sessions, activeSessionId: controlledActiveId, defaultActiveSessionId, onActiveSessionChange, maxSessions, tierOverrides, debug, registry, onError, virtualized, virtualizeThreshold, interactionBus, toolDisplayRegistry, defaultBodyMode, groupParallelTools, permissionUiMode, markdownRenderer, children, }: MultiAgentSessionProps): react_jsx_runtime.JSX.Element;
339
-
340
310
  /**
341
311
  * 任务类型定义(对齐 CC tasks.ts)
342
312
  */
@@ -355,6 +325,26 @@ interface Task {
355
325
  completedAt?: number;
356
326
  }
357
327
 
328
+ /**
329
+ * modelRetry.ts — Model API 重试进度(对齐 CC api_retry / SDK model_retry)
330
+ *
331
+ * 职责:SessionTree 上暂存 hook-progress(name=model_retry) 的 UI 状态。
332
+ *
333
+ * 链路位置:reducer.handleHookProgress → Spinner / ModelRetryBlock。
334
+ */
335
+ type ModelRetryPhase = 'scheduled' | 'heartbeat' | string;
336
+ interface ModelRetryState {
337
+ attempt: number;
338
+ maxRetries: number;
339
+ retryDelayMs: number;
340
+ errorCategory: string;
341
+ errorMessage: string;
342
+ errorStatus: number | null;
343
+ phase: ModelRetryPhase;
344
+ /** 最近一次 progress 事件时间(用于倒计时) */
345
+ updatedAt: number;
346
+ }
347
+
358
348
  type SessionStatus = 'connecting' | 'running' | 'done' | 'error';
359
349
  /** 任务列表可见性阶段(对齐 CC / 设计文档 §3.2.3) */
360
350
  type TaskPhase = 'hidden' | 'visible' | 'hidden-after-completion';
@@ -416,6 +406,8 @@ interface SessionTree {
416
406
  /** 自定义状态消息 */
417
407
  customMessage: string | null;
418
408
  };
409
+ /** Model API 重试进度(hook-progress name=model_retry);对齐 CC api_retry */
410
+ modelRetry: ModelRetryState | null;
419
411
  }
420
412
  /** 轮次摘要记录 */
421
413
  interface RoundSummary {
@@ -429,6 +421,36 @@ interface RoundSummary {
429
421
  }
430
422
  declare function createEmptyTree(): SessionTree;
431
423
 
424
+ interface MultiSessionSourceConfig {
425
+ sessionId: string;
426
+ source: Source;
427
+ /** EventBuffer ingest 快照或历史事件;挂载时 replay 后再接 source 续流(M3) */
428
+ initialEvents?: LangchainAgentEvent[];
429
+ }
430
+ interface MultiAgentSessionProps {
431
+ sessions: MultiSessionSourceConfig[];
432
+ /** 受控活跃 session */
433
+ activeSessionId?: string | null;
434
+ /** 非受控默认活跃 session */
435
+ defaultActiveSessionId?: string | null;
436
+ onActiveSessionChange?: (sessionId: string | null) => void;
437
+ maxSessions?: number;
438
+ tierOverrides?: TierOverrides;
439
+ debug?: boolean;
440
+ registry?: NodeRegistry;
441
+ onError?: (error: Error, sessionId: string) => void;
442
+ virtualized?: boolean;
443
+ virtualizeThreshold?: number;
444
+ interactionBus?: InteractionBus;
445
+ toolDisplayRegistry?: ToolDisplayRegistry;
446
+ defaultBodyMode?: ToolBodyMode;
447
+ groupParallelTools?: boolean;
448
+ permissionUiMode?: PermissionUiMode;
449
+ markdownRenderer?: MarkdownRenderer;
450
+ children?: ReactNode;
451
+ }
452
+ declare function MultiAgentSession({ sessions, activeSessionId: controlledActiveId, defaultActiveSessionId, onActiveSessionChange, maxSessions, tierOverrides, debug, registry, onError, virtualized, virtualizeThreshold, interactionBus, toolDisplayRegistry, defaultBodyMode, groupParallelTools, permissionUiMode, markdownRenderer, children, }: MultiAgentSessionProps): react_jsx_runtime.JSX.Element;
453
+
432
454
  interface SessionStoreOptions {
433
455
  tierOverrides?: TierOverrides;
434
456
  debug?: boolean;
@@ -1,4 +1,4 @@
1
- export { d as MultiAgentSession, e as MultiAgentSessionProps, f as MultiSessionSourceConfig, g as MultiSessionStore, h as MultiSessionStoreOptions, i as MultiSessionStoreState, S as SessionSlice, w as createActiveSessionBridge, z as createMultiSessionStore, F as useActiveSession, G as useSessionIds } from './multi-session-CviqerRl.js';
1
+ export { d as MultiAgentSession, e as MultiAgentSessionProps, f as MultiSessionSourceConfig, g as MultiSessionStore, h as MultiSessionStoreOptions, i as MultiSessionStoreState, S as SessionSlice, w as createActiveSessionBridge, z as createMultiSessionStore, F as useActiveSession, G as useSessionIds } from './multi-session-DAHwfTNb.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import './nodes-DqhaBW7M.js';
@@ -2,13 +2,13 @@ import {
2
2
  MultiAgentSession,
3
3
  createActiveSessionBridge,
4
4
  createMultiSessionStore
5
- } from "./chunk-W6QQHTJ4.js";
5
+ } from "./chunk-A4W6B7C3.js";
6
6
  import "./chunk-WM6Y6APP.js";
7
7
  import "./chunk-DP7V33X7.js";
8
8
  import {
9
9
  useActiveSession,
10
10
  useSessionIds
11
- } from "./chunk-G2KYJCMM.js";
11
+ } from "./chunk-3B4WC67E.js";
12
12
  import "./chunk-MHK53ZHC.js";
13
13
  import "./chunk-4RIOBLGB.js";
14
14
  export {
package/dist/virtual.d.ts CHANGED
@@ -14,23 +14,16 @@ declare function estimateNodeSize(node: SessionNode | undefined, fallback?: numb
14
14
  declare const DEFAULT_VIRTUALIZE_THRESHOLD = 500;
15
15
  interface VirtualTimelineProps {
16
16
  estimateSize?: number;
17
+ showTaskListFooter?: boolean;
17
18
  }
18
- declare function VirtualTimeline({ estimateSize, }: VirtualTimelineProps): react_jsx_runtime.JSX.Element;
19
+ declare function VirtualTimeline({ estimateSize, showTaskListFooter, }: VirtualTimelineProps): react_jsx_runtime.JSX.Element;
19
20
 
20
- /**
21
-
22
- * 职责:按 virtualized 阈值选择 Timeline 或 VirtualTimeline。
23
-
24
- * 链路位置:AgentSession / MultiAgentSession 默认 children。
25
-
26
- * 当前裁剪范围:Grouped 布局与 virtual 互斥(groupParallelTools 时强制 Timeline)。
27
-
28
- */
29
21
  interface SessionTimelineProps {
30
22
  virtualized?: boolean;
31
23
  virtualizeThreshold?: number;
32
24
  groupParallelTools?: boolean;
25
+ showTaskListFooter?: boolean;
33
26
  }
34
- declare function SessionTimeline({ virtualized, virtualizeThreshold, groupParallelTools, }: SessionTimelineProps): react_jsx_runtime.JSX.Element;
27
+ declare function SessionTimeline({ virtualized, virtualizeThreshold, groupParallelTools, showTaskListFooter, }: SessionTimelineProps): react_jsx_runtime.JSX.Element;
35
28
 
36
29
  export { DEFAULT_ESTIMATE_SIZE, DEFAULT_VIRTUALIZE_THRESHOLD, ESTIMATE_SIZE_BY_KIND, SessionTimeline, type SessionTimelineProps, VirtualTimeline, type VirtualTimelineProps, estimateNodeSize };
package/dist/virtual.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  SessionTimeline,
6
6
  VirtualTimeline,
7
7
  estimateNodeSize
8
- } from "./chunk-G2KYJCMM.js";
8
+ } from "./chunk-3B4WC67E.js";
9
9
  import "./chunk-MHK53ZHC.js";
10
10
  import "./chunk-4RIOBLGB.js";
11
11
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain_agentx_stream_ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "React session timeline component library for LangchainAgentEvent SSE streams",
5
5
  "license": "MIT",
6
6
  "author": "wugk",
@@ -62,7 +62,17 @@
62
62
  },
63
63
  "peerDependencies": {
64
64
  "react": ">=18",
65
- "react-dom": ">=18"
65
+ "react-dom": ">=18",
66
+ "mermaid": ">=10",
67
+ "svg-pan-zoom": ">=3"
68
+ },
69
+ "peerDependenciesMeta": {
70
+ "mermaid": {
71
+ "optional": true
72
+ },
73
+ "svg-pan-zoom": {
74
+ "optional": true
75
+ }
66
76
  },
67
77
  "dependencies": {
68
78
  "@tanstack/react-virtual": "^3.14.2",
@@ -81,6 +91,8 @@
81
91
  "jsdom": "^25.0.0",
82
92
  "react": "^18.3.0",
83
93
  "react-dom": "^18.3.0",
94
+ "mermaid": "^11.4.0",
95
+ "svg-pan-zoom": "^3.6.1",
84
96
  "tsup": "^8.0.0",
85
97
  "typescript": "^5.8.3",
86
98
  "vitest": "^2.0.0"