langchain_agentx_stream_ui 0.1.3 → 0.1.8

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/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ReactNode } from 'react';
4
- import { q as Source, L as LangchainAgentEvent, N as NodeRegistry, v as TierOverrides, I as InteractionBus, M as MarkdownRenderer, p as SessionTree, l as SessionStatus, R as ReducerError, r as SourceEventContext, T as Task, t as TaskPhase, E as EventTier } from './multi-session-DAHwfTNb.js';
5
- export { C as CommonFields, D as DEFAULT_EVENT_TIERS, a as EventType, b as InteractionBusHandlers, c as MarkdownRendererProps, d as MultiAgentSession, e as MultiAgentSessionProps, f as MultiSessionSourceConfig, g as MultiSessionStore, h as MultiSessionStoreOptions, i as MultiSessionStoreState, j as NodeWidget, k as NodeWidgetProps, P as PermissionResolvePayload, S as SessionSlice, m as SessionStore, n as SessionStoreOptions, o as SessionStoreState, s as SourceHandler, u as TaskStatus, w as createActiveSessionBridge, x as createEmptyTree, y as createInteractionBus, z as createMultiSessionStore, A as createSessionStore, B as getNoopInteractionBus, F as useActiveSession, G as useSessionIds } from './multi-session-DAHwfTNb.js';
6
- import { T as ToolDisplayRegistry, P as PermissionUiMode, b as DisplayMode, c as ProjectionContext, R as RenderableEntry, C as CanonicalNodeRef } from './sessionViewOptions-DLSFRQwZ.js';
7
- export { a as CollapsedExplorePayload, D as DEFAULT_SESSION_VIEW_OPTIONS, S as SessionViewOptions, d as ToolUseSnapshot, e as buildProjectionContext, f as buildProjectionViewContext, g as createDefaultToolRegistry, h as createProjectionContext, r as resolveEffectiveToolBodyMode, s as shouldApplyGrouping, i as shouldShowExploreDetail } from './sessionViewOptions-DLSFRQwZ.js';
8
- import { a as ToolBodyMode } from './types-aXj5TYSP.js';
9
- export { T as ToolBodyComponent, b as ToolDisplayProps } from './types-aXj5TYSP.js';
3
+ import { ReactNode, PointerEventHandler } from 'react';
4
+ import { q as Source, L as LangchainAgentEvent, N as NodeRegistry, v as TierOverrides, I as InteractionBus, M as MarkdownRenderer, p as SessionTree, l as SessionStatus, R as ReducerError, r as SourceEventContext, T as Task, t as TaskPhase, E as EventTier } from './multi-session-Dxyo3y7w.js';
5
+ export { C as CommonFields, D as DEFAULT_EVENT_TIERS, a as EventType, b as InteractionBusHandlers, c as MarkdownRendererProps, d as MultiAgentSession, e as MultiAgentSessionProps, f as MultiSessionSourceConfig, g as MultiSessionStore, h as MultiSessionStoreOptions, i as MultiSessionStoreState, j as NodeWidget, k as NodeWidgetProps, P as PermissionResolvePayload, S as SessionSlice, m as SessionStore, n as SessionStoreOptions, o as SessionStoreState, s as SourceHandler, u as TaskStatus, w as createActiveSessionBridge, x as createEmptyTree, y as createInteractionBus, z as createMultiSessionStore, A as createSessionStore, B as getNoopInteractionBus, F as useActiveSession, G as useSessionIds } from './multi-session-Dxyo3y7w.js';
6
+ import { T as ToolDisplayRegistry, P as PermissionUiMode, b as DisplayMode, c as ProjectionContext, R as RenderableEntry, C as CanonicalNodeRef } from './sessionViewOptions-WM00Fpcn.js';
7
+ export { a as CollapsedExplorePayload, D as DEFAULT_SESSION_VIEW_OPTIONS, S as SessionViewOptions, d as ToolUseSnapshot, e as buildProjectionContext, f as buildProjectionViewContext, g as createDefaultToolRegistry, h as createProjectionContext, r as resolveEffectiveToolBodyMode, s as shouldApplyGrouping, i as shouldShowExploreDetail } from './sessionViewOptions-WM00Fpcn.js';
8
+ import { a as ToolBodyMode } from './types-BEXSHQG7.js';
9
+ export { T as ToolBodyComponent, b as ToolDisplayProps } from './types-BEXSHQG7.js';
10
10
  import { StoreApi } from 'zustand/vanilla';
11
11
  export { DEFAULT_ESTIMATE_SIZE, DEFAULT_VIRTUALIZE_THRESHOLD, SessionTimeline, SessionTimelineProps, VirtualTimeline, VirtualTimelineProps } from './virtual.js';
12
- 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';
13
- import { S as SessionNode, a as SessionNodeKind } from './nodes-DqhaBW7M.js';
14
- export { E as ErrorNode, N as NodeDetail, P as PermissionNode, R as ReasoningNode, b as StepDetail, c as StepNode, d as SubAgentNode, T as TextNode, g as ToolCallNode, U as UnknownNode } from './nodes-DqhaBW7M.js';
15
- 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 } from './MarkdownBlock-3iEW0Ubm.js';
12
+ 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-BG1StdvE.js';
13
+ import { S as SessionNode, a as SessionNodeKind } from './nodes-BcyPw6Fr.js';
14
+ export { E as ErrorNode, N as NodeDetail, P as PermissionNode, R as ReasoningNode, b as StepDetail, c as StepNode, d as SubAgentNode, T as TextNode, h as ToolCallNode, U as UnknownNode } from './nodes-BcyPw6Fr.js';
15
+ 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 } from './MarkdownBlock-CcXZ5nTm.js';
16
16
 
17
17
  interface AgentSessionProps {
18
18
  source: Source;
@@ -775,24 +775,25 @@ declare function formatAgentTitle(input: unknown, display: unknown): string;
775
775
  interface RichMarkdownProps {
776
776
  content: string;
777
777
  className?: string;
778
+ /** 流式未稳定后缀:diagram fence 暂以源码展示 */
779
+ deferDiagrams?: boolean;
778
780
  }
779
781
  /** Web 向富 Markdown(TextNode S1);含 Mermaid、GFM、代码高亮。 */
780
- declare function RichMarkdown({ content, className }: RichMarkdownProps): react_jsx_runtime.JSX.Element | null;
782
+ declare function RichMarkdown({ content, className, deferDiagrams, }: RichMarkdownProps): react_jsx_runtime.JSX.Element | null;
781
783
 
782
784
  interface MermaidDiagramProps {
783
785
  chart: string;
784
786
  className?: string;
785
- /** 画布内 svg-pan-zoom */
786
- zoomingEnabled?: boolean;
787
- /** 工具栏全屏与点击放大 */
788
787
  fullscreenEnabled?: boolean;
789
788
  }
790
- declare function MermaidDiagram({ chart, className, zoomingEnabled, fullscreenEnabled, }: MermaidDiagramProps): react_jsx_runtime.JSX.Element;
789
+ declare function MermaidDiagram({ chart, className, fullscreenEnabled, }: MermaidDiagramProps): react_jsx_runtime.JSX.Element;
791
790
 
792
791
  type MermaidThemeName = 'neutral' | 'default' | 'dark' | 'forest' | 'base';
793
792
  interface MermaidInitOptions {
794
793
  theme?: MermaidThemeName;
795
794
  maxTextSize?: number;
795
+ /** 仅 `theme: 'base'` 时生效;默认使用 MERMAID_LIGHT_THEME_VARIABLES */
796
+ themeVariables?: Record<string, string | number | boolean>;
796
797
  }
797
798
 
798
799
  /** 覆盖默认 mermaid 初始化(需在首次 render 前调用) */
@@ -808,10 +809,8 @@ declare function PlantUMLBlock({ content, className }: PlantUMLBlockProps): reac
808
809
  interface PlantUMLDiagramProps {
809
810
  content: string;
810
811
  className?: string;
811
- /** Kroki 或兼容渲染服务根 URL */
812
812
  serverUrl?: string;
813
813
  fullscreenEnabled?: boolean;
814
- /** 仅源码高亮,不请求渲染 */
815
814
  sourceOnly?: boolean;
816
815
  }
817
816
  declare function PlantUMLDiagram({ content, className, serverUrl, fullscreenEnabled, sourceOnly, }: PlantUMLDiagramProps): react_jsx_runtime.JSX.Element;
@@ -819,6 +818,53 @@ declare function PlantUMLDiagram({ content, className, serverUrl, fullscreenEnab
819
818
  /** 配置 PlantUML 渲染服务(默认 Kroki:https://kroki.io) */
820
819
  declare function configurePlantumlServer(url: string): void;
821
820
 
821
+ interface DiagramZoomViewProps {
822
+ fixedSvg: string;
823
+ contentHash: string;
824
+ title: string;
825
+ fullscreenEnabled?: boolean;
826
+ className?: string;
827
+ }
828
+ declare function DiagramZoomView({ fixedSvg, contentHash, title, fullscreenEnabled, className, }: DiagramZoomViewProps): react_jsx_runtime.JSX.Element;
829
+
830
+ /** natural:内嵌自然高度;fill:全屏/固定视口 fit */
831
+ type DiagramFitLayout = 'natural' | 'fill';
832
+ interface ViewportFitTransform {
833
+ x: number;
834
+ y: number;
835
+ scale: number;
836
+ }
837
+ interface ViewportFitOptions {
838
+ layout?: DiagramFitLayout;
839
+ padding?: number;
840
+ /** fill 模式:小图放大上限;natural 固定为 1 */
841
+ maxScale?: number;
842
+ }
843
+ /**
844
+ * natural:CSS max-width:100% 适配框宽,rzpp 恒等变换
845
+ * fill:等比缩放进容器并居中
846
+ */
847
+ declare function computeViewportFitTransform(container: HTMLElement, svg: SVGSVGElement, options?: ViewportFitOptions): ViewportFitTransform;
848
+
849
+ interface DiagramZoomShellProps {
850
+ fixedSvg: string;
851
+ contentHash: string;
852
+ className?: string;
853
+ layout?: DiagramFitLayout;
854
+ viewportPointerHandlers?: {
855
+ onPointerDown?: PointerEventHandler<HTMLDivElement>;
856
+ onPointerMove?: PointerEventHandler<HTMLDivElement>;
857
+ onPointerUp?: PointerEventHandler<HTMLDivElement>;
858
+ onPointerCancel?: PointerEventHandler<HTMLDivElement>;
859
+ };
860
+ toolbarExtra?: ReactNode;
861
+ }
862
+ /** react-zoom-pan-pinch@3.6.1 — 内嵌 natural / 全屏 fill */
863
+ declare function DiagramZoomShell({ fixedSvg, contentHash, className, layout, viewportPointerHandlers, toolbarExtra, }: DiagramZoomShellProps): react_jsx_runtime.JSX.Element;
864
+
865
+ /** Mermaid / PlantUML:禁用 SVG 命中,并规范化百分比宽高(避免 fit 把 100% 当成 100px) */
866
+ declare function fixDiagramSvg(svg: string): string;
867
+
822
868
  /**
823
869
  * toolNames.ts — CC PascalCase 工具名 SSOT(对齐 SDK registry_names.py)
824
870
  *
@@ -1068,4 +1114,4 @@ interface ClassifyContext {
1068
1114
  declare function resolveEventTier(eventType: string, overrides?: TierOverrides): EventTier;
1069
1115
  declare function classifyEvent(event: LangchainAgentEvent, ctx: ClassifyContext, overrides?: TierOverrides, eventIndex?: number): ClassifiedEvent;
1070
1116
 
1071
- export { Agent, AgentLoopView, type AgentLoopViewProps, AgentSession, type AgentSessionProps, type AgentxMetaFrame, type AgentxSseSourceOptions, type ApplicationKind, ApplicationKindMismatchError, AskUserQuestion, Bash, CanonicalNodeRef, type ClassifiedEvent, type ClassifyContext, CollapseKind, CollapsedExploreNode, type CollapsedExploreNodeProps, DEFAULT_WORKFLOW_SCALE_OPTIONS, DisplayMode, EXPECTED_PROTOCOL_VERSION, Edit, ErrorCard, EventTier, ExploreCollapseAccumulator, GROUPABLE_TOOL_NAMES, Glob, Grep, GroupedToolUseAccumulator, InteractionBus, LangchainAgentEvent, MIN_HINT_DISPLAY_MS, MarkdownRenderer, MermaidDiagram, type MermaidDiagramProps, type MermaidInitOptions, type MermaidThemeName, MissingApplicationKindError, NodeRegistry, PermissionCard, PermissionUiMode, PlantUMLBlock, type PlantUMLBlockProps, PlantUMLDiagram, type PlantUMLDiagramProps, type ProjectedTimelineItem, ProjectionContext, DisplayMode as ProjectionDisplayMode, Read, ReasoningBubble, type ReduceOptions, ReducerError, RenderableEntry, RenderableTimelineProjector, type ReplayOptions, type ReplaySourceOptions, RichMarkdown, type RichMarkdownProps, SHELL_PROGRESS_MIN_ELAPSED_SECONDS, SessionNode, SessionNodeKind, SessionStatus, SessionTree, Skill, Source, SourceEventContext, Spinner, type SpinnerProps, type SseTransportFailureKind, SseTransportTerminalError, StepCard, SubAgentBlock, SystemSummaryAccumulator, SystemSummaryNode, Task, TaskList, TaskListFooter, TextBubble, TierOverrides, Timeline, TimelineItem, ToolBodyMode, ToolCallCard, ToolDisplayRegistry, ToolProjectionClassifier, UnknownCard, WORKFLOW_STRUCTURE_EVENT_PREFIXES, WORKFLOW_STRUCTURE_EVENT_TYPES, WebFetch, WebSearch, WorkflowChrome, type WorkflowChromeProps, type WorkflowLoopReplayHandler, WorkflowLoopReplayProvider, type WorkflowProgressState, WorkflowScaleContext, type WorkflowScaleOptions, type WorkflowScopeFrame, WorkflowSession, type WorkflowSessionProps, type WorkflowSessionState, type WorkflowSessionStore, type WorkflowSessionStoreOptions, type WorkflowSessionStoreState, type WorkflowStageProgress, WorkflowTaskListFooter, Write, buildCanonicalFromTree, buildRelevantMemoriesCanonical, buildResumeStreamUrl, buildSystemEventCanonical, buildTimelineEntries, classifyEvent, commandAsHint, configureMermaid, configurePlantumlServer, createAgentxSseSource, createDefaultRegistry, createEmptyWorkflowSessionState, createMockSource, createReplaySource, createWorkflowSessionStore, entryKey, filterAgentLoopReplayEvents, formatAgentTitle, formatExploreSummaryText, formatHookFinishedSummary, formatShellProgressSuffix, formatTaskFooterLabel, getChildIds, getMainStageIds, isAgentLoopReplayEventType, isGitOperationCommand, isGroupableToolName, isMcpToolName, isWorkflowStructureEventType, iterMountCandidates, partitionWorkflowStages, projectCanonical, projectTimeline, reduceAgentLoopEvent, reduceEvents, reduceTree, reduceWorkflowEvents, reduceWorkflowSession, replayEvents, replayTree, resolveEventTier, resolveResponseId, resolveShellProgressFromPayload, shouldShowTaskListFooter, streamChunk, useChildren, useInteractionBus, useInternalErrors, useMinDisplayTime, useNode, useNodeTyped, useProjectedTimeline, useReplayTree, useSessionMeta, useSessionStatus, useTimeline, useWorkflowSessionStatus, useWorkflowSessionStoreApi };
1117
+ export { Agent, AgentLoopView, type AgentLoopViewProps, AgentSession, type AgentSessionProps, type AgentxMetaFrame, type AgentxSseSourceOptions, type ApplicationKind, ApplicationKindMismatchError, AskUserQuestion, Bash, CanonicalNodeRef, type ClassifiedEvent, type ClassifyContext, CollapseKind, CollapsedExploreNode, type CollapsedExploreNodeProps, DEFAULT_WORKFLOW_SCALE_OPTIONS, type DiagramFitLayout, DiagramZoomShell, type DiagramZoomShellProps, DiagramZoomView, type DiagramZoomViewProps, DisplayMode, EXPECTED_PROTOCOL_VERSION, Edit, ErrorCard, EventTier, ExploreCollapseAccumulator, GROUPABLE_TOOL_NAMES, Glob, Grep, GroupedToolUseAccumulator, InteractionBus, LangchainAgentEvent, MIN_HINT_DISPLAY_MS, MarkdownRenderer, MermaidDiagram, type MermaidDiagramProps, type MermaidInitOptions, type MermaidThemeName, MissingApplicationKindError, NodeRegistry, PermissionCard, PermissionUiMode, PlantUMLBlock, type PlantUMLBlockProps, PlantUMLDiagram, type PlantUMLDiagramProps, type ProjectedTimelineItem, ProjectionContext, DisplayMode as ProjectionDisplayMode, Read, ReasoningBubble, type ReduceOptions, ReducerError, RenderableEntry, RenderableTimelineProjector, type ReplayOptions, type ReplaySourceOptions, RichMarkdown, type RichMarkdownProps, SHELL_PROGRESS_MIN_ELAPSED_SECONDS, SessionNode, SessionNodeKind, SessionStatus, SessionTree, Skill, Source, SourceEventContext, Spinner, type SpinnerProps, type SseTransportFailureKind, SseTransportTerminalError, StepCard, SubAgentBlock, SystemSummaryAccumulator, SystemSummaryNode, Task, TaskList, TaskListFooter, TextBubble, TierOverrides, Timeline, TimelineItem, ToolBodyMode, ToolCallCard, ToolDisplayRegistry, ToolProjectionClassifier, UnknownCard, WORKFLOW_STRUCTURE_EVENT_PREFIXES, WORKFLOW_STRUCTURE_EVENT_TYPES, WebFetch, WebSearch, WorkflowChrome, type WorkflowChromeProps, type WorkflowLoopReplayHandler, WorkflowLoopReplayProvider, type WorkflowProgressState, WorkflowScaleContext, type WorkflowScaleOptions, type WorkflowScopeFrame, WorkflowSession, type WorkflowSessionProps, type WorkflowSessionState, type WorkflowSessionStore, type WorkflowSessionStoreOptions, type WorkflowSessionStoreState, type WorkflowStageProgress, WorkflowTaskListFooter, Write, buildCanonicalFromTree, buildRelevantMemoriesCanonical, buildResumeStreamUrl, buildSystemEventCanonical, buildTimelineEntries, classifyEvent, commandAsHint, computeViewportFitTransform, configureMermaid, configurePlantumlServer, createAgentxSseSource, createDefaultRegistry, createEmptyWorkflowSessionState, createMockSource, createReplaySource, createWorkflowSessionStore, entryKey, filterAgentLoopReplayEvents, fixDiagramSvg, formatAgentTitle, formatExploreSummaryText, formatHookFinishedSummary, formatShellProgressSuffix, formatTaskFooterLabel, getChildIds, getMainStageIds, isAgentLoopReplayEventType, isGitOperationCommand, isGroupableToolName, isMcpToolName, isWorkflowStructureEventType, iterMountCandidates, partitionWorkflowStages, projectCanonical, projectTimeline, reduceAgentLoopEvent, reduceEvents, reduceTree, reduceWorkflowEvents, reduceWorkflowSession, replayEvents, replayTree, resolveEventTier, resolveResponseId, resolveShellProgressFromPayload, shouldShowTaskListFooter, streamChunk, useChildren, useInteractionBus, useInternalErrors, useMinDisplayTime, useNode, useNodeTyped, useProjectedTimeline, useReplayTree, useSessionMeta, useSessionStatus, useTimeline, useWorkflowSessionStatus, useWorkflowSessionStoreApi };
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import {
2
+ DiagramZoomShell,
3
+ DiagramZoomView,
2
4
  ErrorCard,
3
5
  MermaidDiagram,
4
6
  MultiAgentSession,
@@ -12,14 +14,16 @@ import {
12
14
  TextBubble,
13
15
  ToolCallCard,
14
16
  UnknownCard,
17
+ computeViewportFitTransform,
15
18
  configureMermaid,
16
19
  configurePlantumlServer,
17
20
  createActiveSessionBridge,
18
21
  createDefaultRegistry,
19
22
  createMultiSessionStore,
23
+ fixDiagramSvg,
20
24
  markEventIdSeen,
21
25
  shouldSkipDuplicateEvent
22
- } from "./chunk-A4W6B7C3.js";
26
+ } from "./chunk-WPW3TQQF.js";
23
27
  import {
24
28
  DefaultToolBody,
25
29
  InteractionBusContext,
@@ -28,7 +32,7 @@ import {
28
32
  getNoopInteractionBus,
29
33
  resolveToolBody,
30
34
  useInteractionBus
31
- } from "./chunk-WM6Y6APP.js";
35
+ } from "./chunk-6DYISADG.js";
32
36
  import "./chunk-DP7V33X7.js";
33
37
  import {
34
38
  CollapseKind,
@@ -107,7 +111,7 @@ import {
107
111
  useSessionStatus,
108
112
  useSessionViewOptions,
109
113
  useTimeline
110
- } from "./chunk-3B4WC67E.js";
114
+ } from "./chunk-LBJFJF22.js";
111
115
  import {
112
116
  Agent,
113
117
  AgentToolBody,
@@ -134,7 +138,7 @@ import {
134
138
  WriteToolBody,
135
139
  createDefaultToolRegistry,
136
140
  formatAgentTitle
137
- } from "./chunk-MHK53ZHC.js";
141
+ } from "./chunk-7CLAU74Y.js";
138
142
  import {
139
143
  BodyBlockList,
140
144
  DiffView,
@@ -3464,6 +3468,8 @@ export {
3464
3468
  DEFAULT_VIRTUALIZE_THRESHOLD,
3465
3469
  DEFAULT_WORKFLOW_SCALE_OPTIONS,
3466
3470
  DefaultToolBody,
3471
+ DiagramZoomShell,
3472
+ DiagramZoomView,
3467
3473
  DiffView,
3468
3474
  EXPECTED_PROTOCOL_VERSION,
3469
3475
  Edit,
@@ -3536,6 +3542,7 @@ export {
3536
3542
  buildTimelineEntries,
3537
3543
  classifyEvent,
3538
3544
  commandAsHint,
3545
+ computeViewportFitTransform,
3539
3546
  configureMermaid,
3540
3547
  configurePlantumlServer,
3541
3548
  createActiveSessionBridge,
@@ -3554,6 +3561,7 @@ export {
3554
3561
  displayPath,
3555
3562
  entryKey,
3556
3563
  filterAgentLoopReplayEvents,
3564
+ fixDiagramSvg,
3557
3565
  formatAgentTitle,
3558
3566
  formatDiffFromStrings,
3559
3567
  formatExploreSummaryText,