langchain_agentx_stream_ui 0.4.0 → 0.4.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.
- package/dist/index.d.ts +7 -1
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -242,6 +242,12 @@ interface PollingAuthoritySourceOptions {
|
|
|
242
242
|
/** hydrate 已 terminal 时注入,subscribe 不启动 poll */
|
|
243
243
|
initialSnapshot?: WorkflowAuthoritySnapshot | null;
|
|
244
244
|
}
|
|
245
|
+
/** 404/410:run 已从 registry 消失,继续轮询无意义。 */
|
|
246
|
+
declare function isFatalAuthorityPollStatus(status: number): boolean;
|
|
247
|
+
declare class AuthorityPollFatalError extends Error {
|
|
248
|
+
readonly status: number;
|
|
249
|
+
constructor(status: number, message?: string);
|
|
250
|
+
}
|
|
245
251
|
declare function createPollingAuthoritySource(taskId: string, fetchFn: (id: string) => Promise<WorkflowAuthoritySnapshot>, options?: PollingAuthoritySourceOptions): WorkflowAuthoritySource;
|
|
246
252
|
|
|
247
253
|
declare const WorkflowScaleContext: react.Context<WorkflowScaleOptions>;
|
|
@@ -1286,4 +1292,4 @@ interface ClassifyContext {
|
|
|
1286
1292
|
declare function resolveEventTier(eventType: string, overrides?: TierOverrides): EventTier;
|
|
1287
1293
|
declare function classifyEvent(event: LangchainAgentEvent, ctx: ClassifyContext, overrides?: TierOverrides, eventIndex?: number): ClassifiedEvent;
|
|
1288
1294
|
|
|
1289
|
-
export { Agent, type AgentAuthorityMetadata, type WorkflowAuthoritySource as AgentAuthoritySource, AgentLoopView, type AgentLoopViewProps, AgentSession, AgentSessionBanners, type AgentSessionBannersProps, type AgentSessionProps, type AgentxMetaFrame, type AgentxSseSourceOptions, type ApplicationKind, ApplicationKindMismatchError, AskDisplaySnapshot, AskUserQuestion, BOUNDED_DEFAULTS, 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, type HydrateAskSnapshotState, type HydrateLoopSessionAsyncOptions, type HydrateWorkflowSnapshotOptions, InteractionBus, LangchainAgentEvent, MIN_HINT_DISPLAY_MS, MarkdownRenderer, MermaidDiagram, type MermaidDiagramProps, type MermaidInitOptions, type MermaidThemeName, MissingApplicationKindError, type MockAuthoritySourceOptions, NodeRegistry, PROFILE_PRESETS, PermissionCard, PermissionUiMode, PlantUMLBlock, type PlantUMLBlockProps, PlantUMLDiagram, type PlantUMLDiagramProps, type PollingAuthoritySourceOptions, type ProjectedTimelineItem, ProjectionContext, DisplayMode as ProjectionDisplayMode, Read, ReasoningBubble, ReconnectBudget, type ReduceOptions, ReducerError, RenderableEntry, RenderableTimelineProjector, type ReplayOptions, type ReplaySourceOptions, RichMarkdown, type RichMarkdownProps, SHELL_PROGRESS_MIN_ELAPSED_SECONDS, SessionNode, SessionNodeKind, SessionStatus, SessionStoreState, SessionTree, SessionTreeSnapshot, Skill, Source, SourceEventContext, Spinner, type SpinnerProps, type SseReconnectMode, type SseReconnectPolicy, type SseReplayMode, type SseTerminalPolicy, type SseTransportFailureKind, type SseTransportPolicy, type SseTransportPolicyOverride, type SseTransportProfile, 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, WorkflowAuthoritySnapshot, type WorkflowAuthoritySource, WorkflowAuthorityStatus, type WorkflowBannerDescriptor, WorkflowChrome, type WorkflowChromeProps, type WorkflowCoalescedBlock, WorkflowDisplayProjection, WorkflowDisplayProjectionStatus, type WorkflowDisplaySnapshot, type WorkflowDisplaySnapshotMetadata, type WorkflowLoopReplayHandler, WorkflowLoopReplayProvider, WorkflowScaleContext, type WorkflowScaleOptions, WorkflowSession, type WorkflowSessionProps, WorkflowSessionState, type WorkflowSessionStore, type WorkflowSessionStoreOptions, type WorkflowSessionStoreState, type WorkflowSnapshotProjectionStatus, WorkflowTaskListFooter, Write, applyAuthoritySnapshotToState, buildCanonicalFromTree, buildRelevantMemoriesCanonical, buildResumeStreamUrl, buildSystemEventCanonical, buildTimelineEntries, classifyEvent, commandAsHint, computeViewportFitTransform, configureMermaid, configurePlantumlServer, createAgentxSseSource, createControllableAuthoritySource, createDefaultRegistry, createDoneAuthoritySource, createMockAuthoritySource, createMockSource, createPollingAuthoritySource, createReplaySource, createRunningAuthoritySource, createWorkflowSessionStore, deriveLoopSessionIdFromAgentEvent, entryKey, filterAgentLoopReplayEvents, finalizeWorkflowDisplayOnStreamEnded, fixDiagramSvg, formatAgentTitle, formatExploreSummaryText, formatHookFinishedSummary, formatShellProgressSuffix, formatTaskFooterLabel, getChildIds, getDisplayProjectionStatus, getMainStageIds, hydrateAskFromSnapshot, hydrateWorkflowFromSnapshot, isAgentLoopReplayEventType, isAtOrBeforeProjectionCursor, isAuthorityTerminal, isAuthorityTerminalStatus, isGitOperationCommand, isGroupableToolName, isMcpToolName, isSseStreamTerminalEvent, isWorkflowStructureEventType, iterMountCandidates, partitionWorkflowStages, projectCanonical, projectTimeline, reduceAgentLoopEvent, reduceEvents, reduceTree, reduceWorkflowEvents, reduceWorkflowSession, replayEvents, replayTree, resolveEventTier, resolveResponseId, resolveShellProgressFromPayload, resolveSseTransportPolicy, resolveWorkflowBanner, sessionTreeSnapshotToTree, shouldShowAgentSpinner, shouldShowGlobalSpinner, shouldShowTaskListFooter, streamChunk, useAgentAuthority, useAgentAuthoritySubscribeFailed, useChildren, useInteractionBus, useInternalErrors, useMinDisplayTime, useNode, useNodeTyped, useProjectedTimeline, useReplayTree, useSessionMeta, useSessionStatus, useTimeline, useWorkflowSessionStatus, useWorkflowSessionStoreApi };
|
|
1295
|
+
export { Agent, type AgentAuthorityMetadata, type WorkflowAuthoritySource as AgentAuthoritySource, AgentLoopView, type AgentLoopViewProps, AgentSession, AgentSessionBanners, type AgentSessionBannersProps, type AgentSessionProps, type AgentxMetaFrame, type AgentxSseSourceOptions, type ApplicationKind, ApplicationKindMismatchError, AskDisplaySnapshot, AskUserQuestion, AuthorityPollFatalError, BOUNDED_DEFAULTS, 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, type HydrateAskSnapshotState, type HydrateLoopSessionAsyncOptions, type HydrateWorkflowSnapshotOptions, InteractionBus, LangchainAgentEvent, MIN_HINT_DISPLAY_MS, MarkdownRenderer, MermaidDiagram, type MermaidDiagramProps, type MermaidInitOptions, type MermaidThemeName, MissingApplicationKindError, type MockAuthoritySourceOptions, NodeRegistry, PROFILE_PRESETS, PermissionCard, PermissionUiMode, PlantUMLBlock, type PlantUMLBlockProps, PlantUMLDiagram, type PlantUMLDiagramProps, type PollingAuthoritySourceOptions, type ProjectedTimelineItem, ProjectionContext, DisplayMode as ProjectionDisplayMode, Read, ReasoningBubble, ReconnectBudget, type ReduceOptions, ReducerError, RenderableEntry, RenderableTimelineProjector, type ReplayOptions, type ReplaySourceOptions, RichMarkdown, type RichMarkdownProps, SHELL_PROGRESS_MIN_ELAPSED_SECONDS, SessionNode, SessionNodeKind, SessionStatus, SessionStoreState, SessionTree, SessionTreeSnapshot, Skill, Source, SourceEventContext, Spinner, type SpinnerProps, type SseReconnectMode, type SseReconnectPolicy, type SseReplayMode, type SseTerminalPolicy, type SseTransportFailureKind, type SseTransportPolicy, type SseTransportPolicyOverride, type SseTransportProfile, 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, WorkflowAuthoritySnapshot, type WorkflowAuthoritySource, WorkflowAuthorityStatus, type WorkflowBannerDescriptor, WorkflowChrome, type WorkflowChromeProps, type WorkflowCoalescedBlock, WorkflowDisplayProjection, WorkflowDisplayProjectionStatus, type WorkflowDisplaySnapshot, type WorkflowDisplaySnapshotMetadata, type WorkflowLoopReplayHandler, WorkflowLoopReplayProvider, WorkflowScaleContext, type WorkflowScaleOptions, WorkflowSession, type WorkflowSessionProps, WorkflowSessionState, type WorkflowSessionStore, type WorkflowSessionStoreOptions, type WorkflowSessionStoreState, type WorkflowSnapshotProjectionStatus, WorkflowTaskListFooter, Write, applyAuthoritySnapshotToState, buildCanonicalFromTree, buildRelevantMemoriesCanonical, buildResumeStreamUrl, buildSystemEventCanonical, buildTimelineEntries, classifyEvent, commandAsHint, computeViewportFitTransform, configureMermaid, configurePlantumlServer, createAgentxSseSource, createControllableAuthoritySource, createDefaultRegistry, createDoneAuthoritySource, createMockAuthoritySource, createMockSource, createPollingAuthoritySource, createReplaySource, createRunningAuthoritySource, createWorkflowSessionStore, deriveLoopSessionIdFromAgentEvent, entryKey, filterAgentLoopReplayEvents, finalizeWorkflowDisplayOnStreamEnded, fixDiagramSvg, formatAgentTitle, formatExploreSummaryText, formatHookFinishedSummary, formatShellProgressSuffix, formatTaskFooterLabel, getChildIds, getDisplayProjectionStatus, getMainStageIds, hydrateAskFromSnapshot, hydrateWorkflowFromSnapshot, isAgentLoopReplayEventType, isAtOrBeforeProjectionCursor, isAuthorityTerminal, isAuthorityTerminalStatus, isFatalAuthorityPollStatus, isGitOperationCommand, isGroupableToolName, isMcpToolName, isSseStreamTerminalEvent, isWorkflowStructureEventType, iterMountCandidates, partitionWorkflowStages, projectCanonical, projectTimeline, reduceAgentLoopEvent, reduceEvents, reduceTree, reduceWorkflowEvents, reduceWorkflowSession, replayEvents, replayTree, resolveEventTier, resolveResponseId, resolveShellProgressFromPayload, resolveSseTransportPolicy, resolveWorkflowBanner, sessionTreeSnapshotToTree, shouldShowAgentSpinner, shouldShowGlobalSpinner, shouldShowTaskListFooter, streamChunk, useAgentAuthority, useAgentAuthoritySubscribeFailed, useChildren, useInteractionBus, useInternalErrors, useMinDisplayTime, useNode, useNodeTyped, useProjectedTimeline, useReplayTree, useSessionMeta, useSessionStatus, useTimeline, useWorkflowSessionStatus, useWorkflowSessionStoreApi };
|
package/dist/index.js
CHANGED
|
@@ -5444,6 +5444,17 @@ function createControllableAuthoritySource(initial) {
|
|
|
5444
5444
|
}
|
|
5445
5445
|
|
|
5446
5446
|
// src/core/workflow/createPollingAuthoritySource.ts
|
|
5447
|
+
function isFatalAuthorityPollStatus(status) {
|
|
5448
|
+
return status === 404 || status === 410;
|
|
5449
|
+
}
|
|
5450
|
+
var AuthorityPollFatalError = class extends Error {
|
|
5451
|
+
status;
|
|
5452
|
+
constructor(status, message) {
|
|
5453
|
+
super(message ?? `authority poll fatal: ${status}`);
|
|
5454
|
+
this.name = "AuthorityPollFatalError";
|
|
5455
|
+
this.status = status;
|
|
5456
|
+
}
|
|
5457
|
+
};
|
|
5447
5458
|
var DEFAULT_INTERVAL_MS = 2e3;
|
|
5448
5459
|
function createPollingAuthoritySource(taskId, fetchFn, options) {
|
|
5449
5460
|
let cached = options?.initialSnapshot ?? null;
|
|
@@ -5474,6 +5485,10 @@ function createPollingAuthoritySource(taskId, fetchFn, options) {
|
|
|
5474
5485
|
if (isAuthorityTerminalStatus(snap.status)) {
|
|
5475
5486
|
stopPoll();
|
|
5476
5487
|
}
|
|
5488
|
+
} catch (err) {
|
|
5489
|
+
if (err instanceof AuthorityPollFatalError) {
|
|
5490
|
+
stopPoll();
|
|
5491
|
+
}
|
|
5477
5492
|
} finally {
|
|
5478
5493
|
pollInFlight = false;
|
|
5479
5494
|
}
|
|
@@ -5599,6 +5614,7 @@ export {
|
|
|
5599
5614
|
ApplicationKindMismatchError,
|
|
5600
5615
|
AskUserQuestion,
|
|
5601
5616
|
AskUserQuestionToolBody,
|
|
5617
|
+
AuthorityPollFatalError,
|
|
5602
5618
|
BOUNDED_DEFAULTS,
|
|
5603
5619
|
Bash,
|
|
5604
5620
|
BashToolBody,
|
|
@@ -5735,6 +5751,7 @@ export {
|
|
|
5735
5751
|
isAtOrBeforeProjectionCursor,
|
|
5736
5752
|
isAuthorityTerminal,
|
|
5737
5753
|
isAuthorityTerminalStatus,
|
|
5754
|
+
isFatalAuthorityPollStatus,
|
|
5738
5755
|
isGitOperationCommand,
|
|
5739
5756
|
isGroupableToolName,
|
|
5740
5757
|
isMcpToolName,
|