langchain_agentx_stream_ui 0.2.5 → 0.2.7
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/{chunk-AVSPJ252.js → chunk-CUKNUCGU.js} +2 -2
- package/dist/{chunk-D4BG3I7P.js → chunk-SUEMZC4U.js} +1 -1
- package/dist/chunk-SUEMZC4U.js.map +1 -0
- package/dist/default.css +23 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +96 -6
- package/dist/index.js.map +1 -1
- package/dist/{multi-session-Dxyo3y7w.d.ts → multi-session-xvSZstSN.d.ts} +1 -1
- package/dist/multi-session.d.ts +1 -1
- package/dist/multi-session.js +2 -2
- package/dist/virtual.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-D4BG3I7P.js.map +0 -1
- /package/dist/{chunk-AVSPJ252.js.map → chunk-CUKNUCGU.js.map} +0 -0
package/dist/default.css
CHANGED
|
@@ -2050,6 +2050,24 @@
|
|
|
2050
2050
|
--lax-workflow-indent: calc(var(--lax-workflow-depth, 0) * var(--lax-workflow-indent-unit, 1rem));
|
|
2051
2051
|
}
|
|
2052
2052
|
|
|
2053
|
+
.lax-workflow-closeout-warning {
|
|
2054
|
+
margin: 0 0 0.75rem;
|
|
2055
|
+
padding: 0.65rem 0.85rem;
|
|
2056
|
+
border-radius: var(--lax-radius, 8px);
|
|
2057
|
+
border: 1px solid color-mix(in srgb, var(--lax-color-warning, #b8860b) 45%, transparent);
|
|
2058
|
+
background: var(--lax-bg-warning, #fdf8ec);
|
|
2059
|
+
color: color-mix(in srgb, var(--lax-color-warning, #b8860b) 85%, #000);
|
|
2060
|
+
font-size: 0.875rem;
|
|
2061
|
+
line-height: 1.45;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
.lax-workflow-closeout-warning__scopes {
|
|
2065
|
+
margin: 0.45rem 0 0 1.1rem;
|
|
2066
|
+
padding: 0;
|
|
2067
|
+
font-family: Consolas, monospace;
|
|
2068
|
+
font-size: 0.8125rem;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2053
2071
|
.lax-workflow-chrome {
|
|
2054
2072
|
display: flex;
|
|
2055
2073
|
flex-direction: column;
|
|
@@ -2267,6 +2285,11 @@
|
|
|
2267
2285
|
color: var(--lax-color-done, var(--lax-accent-primary));
|
|
2268
2286
|
}
|
|
2269
2287
|
|
|
2288
|
+
.lax-workflow-container-line__status-dot[data-status='warning'],
|
|
2289
|
+
.lax-workflow-stage-container__status-dot[data-status='warning'] {
|
|
2290
|
+
color: var(--lax-color-warning, #b8860b);
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2270
2293
|
.lax-workflow-stage-container__status-dot[data-status='pending'] {
|
|
2271
2294
|
color: var(--lax-muted);
|
|
2272
2295
|
opacity: 0.5;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
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-
|
|
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-
|
|
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-xvSZstSN.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-xvSZstSN.js';
|
|
6
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
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
8
|
import { a as ToolBodyMode } from './types-BEXSHQG7.js';
|
|
@@ -21,6 +21,9 @@ interface AgentSessionProps {
|
|
|
21
21
|
registry?: NodeRegistry;
|
|
22
22
|
tierOverrides?: TierOverrides;
|
|
23
23
|
onError?: (error: Error) => void;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated 重连策略由 Source(如 createAgentxSseSource 的 profile)承载;本 prop 未接入 store
|
|
26
|
+
*/
|
|
24
27
|
autoReconnect?: boolean;
|
|
25
28
|
debug?: boolean;
|
|
26
29
|
/** 为 true 且主舞台节点数超过阈值时使用 VirtualTimeline(V2-E) */
|
|
@@ -240,6 +243,8 @@ declare function partitionWorkflowStages(stages: WorkflowContainerRuntimeNode[],
|
|
|
240
243
|
* 不含合并 TaskListFooter(P3);parallel 结构仅基础字段。
|
|
241
244
|
*/
|
|
242
245
|
|
|
246
|
+
/** SDK v1.9.0 根 workflow 终态语义 SSOT */
|
|
247
|
+
type WorkflowTerminalKind = 'healthy' | 'forced_closeout' | 'failed';
|
|
243
248
|
/** P2:stage 完成摘要缓存(loop 树淘汰后仍显示 teaser) */
|
|
244
249
|
interface CachedStageDoneSummary {
|
|
245
250
|
label: string;
|
|
@@ -277,6 +282,10 @@ interface WorkflowScopeFrame {
|
|
|
277
282
|
}
|
|
278
283
|
interface WorkflowSessionState {
|
|
279
284
|
status: SessionStatus;
|
|
285
|
+
/** SDK v1.9.0 根终态语义;stream 推断 done 时为 null */
|
|
286
|
+
terminalKind: WorkflowTerminalKind | null;
|
|
287
|
+
/** forced_closeout 时 SDK 写入的未关闭 child scope */
|
|
288
|
+
openChildIdentities: string[];
|
|
280
289
|
meta: {
|
|
281
290
|
workflowRunId: string | null;
|
|
282
291
|
startedAt: number | null;
|
|
@@ -1202,4 +1211,4 @@ interface ClassifyContext {
|
|
|
1202
1211
|
declare function resolveEventTier(eventType: string, overrides?: TierOverrides): EventTier;
|
|
1203
1212
|
declare function classifyEvent(event: LangchainAgentEvent, ctx: ClassifyContext, overrides?: TierOverrides, eventIndex?: number): ClassifiedEvent;
|
|
1204
1213
|
|
|
1205
|
-
export { Agent, AgentLoopView, type AgentLoopViewProps, AgentSession, type AgentSessionProps, type AgentxMetaFrame, type AgentxSseSourceOptions, type ApplicationKind, ApplicationKindMismatchError, 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 HydrateLoopSessionAsyncOptions, InteractionBus, LangchainAgentEvent, MIN_HINT_DISPLAY_MS, MarkdownRenderer, MermaidDiagram, type MermaidDiagramProps, type MermaidInitOptions, type MermaidThemeName, MissingApplicationKindError, NodeRegistry, PROFILE_PRESETS, PermissionCard, PermissionUiMode, PlantUMLBlock, type PlantUMLBlockProps, PlantUMLDiagram, type PlantUMLDiagramProps, 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, SessionTree, 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, 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, deriveLoopSessionIdFromAgentEvent, entryKey, filterAgentLoopReplayEvents, fixDiagramSvg, formatAgentTitle, formatExploreSummaryText, formatHookFinishedSummary, formatShellProgressSuffix, formatTaskFooterLabel, getChildIds, getMainStageIds, isAgentLoopReplayEventType, isGitOperationCommand, isGroupableToolName, isMcpToolName, isSseStreamTerminalEvent, isWorkflowStructureEventType, iterMountCandidates, partitionWorkflowStages, projectCanonical, projectTimeline, reduceAgentLoopEvent, reduceEvents, reduceTree, reduceWorkflowEvents, reduceWorkflowSession, replayEvents, replayTree, resolveEventTier, resolveResponseId, resolveShellProgressFromPayload, resolveSseTransportPolicy, shouldShowTaskListFooter, streamChunk, useChildren, useInteractionBus, useInternalErrors, useMinDisplayTime, useNode, useNodeTyped, useProjectedTimeline, useReplayTree, useSessionMeta, useSessionStatus, useTimeline, useWorkflowSessionStatus, useWorkflowSessionStoreApi };
|
|
1214
|
+
export { Agent, AgentLoopView, type AgentLoopViewProps, AgentSession, type AgentSessionProps, type AgentxMetaFrame, type AgentxSseSourceOptions, type ApplicationKind, ApplicationKindMismatchError, 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 HydrateLoopSessionAsyncOptions, InteractionBus, LangchainAgentEvent, MIN_HINT_DISPLAY_MS, MarkdownRenderer, MermaidDiagram, type MermaidDiagramProps, type MermaidInitOptions, type MermaidThemeName, MissingApplicationKindError, NodeRegistry, PROFILE_PRESETS, PermissionCard, PermissionUiMode, PlantUMLBlock, type PlantUMLBlockProps, PlantUMLDiagram, type PlantUMLDiagramProps, 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, SessionTree, 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, 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, type WorkflowTerminalKind, Write, buildCanonicalFromTree, buildRelevantMemoriesCanonical, buildResumeStreamUrl, buildSystemEventCanonical, buildTimelineEntries, classifyEvent, commandAsHint, computeViewportFitTransform, configureMermaid, configurePlantumlServer, createAgentxSseSource, createDefaultRegistry, createEmptyWorkflowSessionState, createMockSource, createReplaySource, createWorkflowSessionStore, deriveLoopSessionIdFromAgentEvent, entryKey, filterAgentLoopReplayEvents, fixDiagramSvg, formatAgentTitle, formatExploreSummaryText, formatHookFinishedSummary, formatShellProgressSuffix, formatTaskFooterLabel, getChildIds, getMainStageIds, isAgentLoopReplayEventType, isGitOperationCommand, isGroupableToolName, isMcpToolName, isSseStreamTerminalEvent, isWorkflowStructureEventType, iterMountCandidates, partitionWorkflowStages, projectCanonical, projectTimeline, reduceAgentLoopEvent, reduceEvents, reduceTree, reduceWorkflowEvents, reduceWorkflowSession, replayEvents, replayTree, resolveEventTier, resolveResponseId, resolveShellProgressFromPayload, resolveSseTransportPolicy, shouldShowTaskListFooter, streamChunk, useChildren, useInteractionBus, useInternalErrors, useMinDisplayTime, useNode, useNodeTyped, useProjectedTimeline, useReplayTree, useSessionMeta, useSessionStatus, useTimeline, useWorkflowSessionStatus, useWorkflowSessionStoreApi };
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
fixDiagramSvg,
|
|
24
24
|
markEventIdSeen,
|
|
25
25
|
shouldSkipDuplicateEvent
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CUKNUCGU.js";
|
|
27
27
|
import {
|
|
28
28
|
DefaultToolBody,
|
|
29
29
|
InteractionBusContext,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
useSessionStatus,
|
|
112
112
|
useSessionViewOptions,
|
|
113
113
|
useTimeline
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-SUEMZC4U.js";
|
|
115
115
|
import {
|
|
116
116
|
Agent,
|
|
117
117
|
AgentToolBody,
|
|
@@ -263,6 +263,17 @@ var BOUNDED_DEFAULTS = {
|
|
|
263
263
|
reconnectTimeoutMs: 6e4,
|
|
264
264
|
reconnectDelayMs: 1e3
|
|
265
265
|
};
|
|
266
|
+
var legacyAutoReconnectWarned = false;
|
|
267
|
+
function warnLegacyAutoReconnectOnce() {
|
|
268
|
+
if (legacyAutoReconnectWarned) return;
|
|
269
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV === "production") {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
legacyAutoReconnectWarned = true;
|
|
273
|
+
console.warn(
|
|
274
|
+
"[langchain_agentx_stream_ui] autoReconnect is deprecated; use profile or policy.reconnect instead."
|
|
275
|
+
);
|
|
276
|
+
}
|
|
266
277
|
var AGENT_TERMINAL = {
|
|
267
278
|
primary: ["finish"],
|
|
268
279
|
allowFinishFallback: false
|
|
@@ -353,6 +364,9 @@ function resolveSseTransportPolicy(input) {
|
|
|
353
364
|
reconnectDelayMs,
|
|
354
365
|
expectedApplicationKind
|
|
355
366
|
} = input;
|
|
367
|
+
if (profile === void 0 && policyOverride === void 0 && autoReconnect !== void 0) {
|
|
368
|
+
warnLegacyAutoReconnectOnce();
|
|
369
|
+
}
|
|
356
370
|
let base;
|
|
357
371
|
if (profile) {
|
|
358
372
|
base = { ...PROFILE_PRESETS[profile] };
|
|
@@ -942,6 +956,8 @@ function createEmptyWorkflowProgress() {
|
|
|
942
956
|
function createEmptyWorkflowSessionState() {
|
|
943
957
|
return {
|
|
944
958
|
status: "connecting",
|
|
959
|
+
terminalKind: null,
|
|
960
|
+
openChildIdentities: [],
|
|
945
961
|
meta: { workflowRunId: null, startedAt: null, lastEventId: null },
|
|
946
962
|
containerTree: createEmptyWorkflowContainerTreeState(),
|
|
947
963
|
workflowProgress: createEmptyWorkflowProgress(),
|
|
@@ -2106,6 +2122,38 @@ function readWorkflowId(data) {
|
|
|
2106
2122
|
return readWorkflowIdFromData(data);
|
|
2107
2123
|
}
|
|
2108
2124
|
|
|
2125
|
+
// src/core/workflow/workflowTerminalKind.ts
|
|
2126
|
+
function resolveWorkflowTerminalKind(data, eventType) {
|
|
2127
|
+
const raw = data.terminal_kind;
|
|
2128
|
+
if (raw === "healthy" || raw === "forced_closeout" || raw === "failed") {
|
|
2129
|
+
return raw;
|
|
2130
|
+
}
|
|
2131
|
+
if (data.closeout_forced === true) {
|
|
2132
|
+
return "forced_closeout";
|
|
2133
|
+
}
|
|
2134
|
+
if (eventType === "workflow-failed") {
|
|
2135
|
+
return "failed";
|
|
2136
|
+
}
|
|
2137
|
+
return "healthy";
|
|
2138
|
+
}
|
|
2139
|
+
function sessionStatusFromTerminalKind(kind, isWorkflowFailedEvent) {
|
|
2140
|
+
if (isWorkflowFailedEvent || kind === "failed") {
|
|
2141
|
+
return "error";
|
|
2142
|
+
}
|
|
2143
|
+
if (kind === "forced_closeout") {
|
|
2144
|
+
return "done_with_warning";
|
|
2145
|
+
}
|
|
2146
|
+
return "done";
|
|
2147
|
+
}
|
|
2148
|
+
function readOpenChildIdentities(data) {
|
|
2149
|
+
const raw = data.open_child_identities;
|
|
2150
|
+
if (!Array.isArray(raw)) return [];
|
|
2151
|
+
return raw.filter((item) => typeof item === "string");
|
|
2152
|
+
}
|
|
2153
|
+
function isWorkflowSessionTerminal(status) {
|
|
2154
|
+
return status === "done" || status === "done_with_warning" || status === "error";
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2109
2157
|
// src/core/workflowReducer.ts
|
|
2110
2158
|
function readString5(data, key) {
|
|
2111
2159
|
const value = data[key];
|
|
@@ -2479,9 +2527,25 @@ function applyStructureEvent(state, event) {
|
|
|
2479
2527
|
if (workflowProgress.status === "done") status = "done";
|
|
2480
2528
|
else if (workflowProgress.status === "error") status = "error";
|
|
2481
2529
|
else if (status === "connecting") status = "running";
|
|
2530
|
+
let terminalKind = state.terminalKind;
|
|
2531
|
+
let openChildIdentities = state.openChildIdentities;
|
|
2532
|
+
if (projectedEvent.event_type === "workflow-end" || projectedEvent.event_type === "workflow-failed") {
|
|
2533
|
+
const resolved = resolveWorkflowTerminalKind(
|
|
2534
|
+
structureData,
|
|
2535
|
+
projectedEvent.event_type
|
|
2536
|
+
);
|
|
2537
|
+
status = sessionStatusFromTerminalKind(
|
|
2538
|
+
resolved,
|
|
2539
|
+
projectedEvent.event_type === "workflow-failed"
|
|
2540
|
+
);
|
|
2541
|
+
terminalKind = resolved;
|
|
2542
|
+
openChildIdentities = resolved === "forced_closeout" ? readOpenChildIdentities(structureData) : [];
|
|
2543
|
+
}
|
|
2482
2544
|
const base = {
|
|
2483
2545
|
...nextState,
|
|
2484
2546
|
status,
|
|
2547
|
+
terminalKind,
|
|
2548
|
+
openChildIdentities,
|
|
2485
2549
|
containerTree,
|
|
2486
2550
|
workflowProgress
|
|
2487
2551
|
};
|
|
@@ -2566,7 +2630,7 @@ function reduceWorkflowSession(state, event, eventIndex, options) {
|
|
|
2566
2630
|
};
|
|
2567
2631
|
}
|
|
2568
2632
|
function finalizeWorkflowSessionOnStreamComplete(state) {
|
|
2569
|
-
if (state.status
|
|
2633
|
+
if (isWorkflowSessionTerminal(state.status)) {
|
|
2570
2634
|
return { ...state, activeLoopSessionId: null };
|
|
2571
2635
|
}
|
|
2572
2636
|
const tree = state.containerTree;
|
|
@@ -3148,7 +3212,10 @@ function mapContainerStatusLabel(status) {
|
|
|
3148
3212
|
return "pending";
|
|
3149
3213
|
}
|
|
3150
3214
|
}
|
|
3151
|
-
function mapWorkflowRootStatusLabel(status) {
|
|
3215
|
+
function mapWorkflowRootStatusLabel(status, sessionStatus) {
|
|
3216
|
+
if (sessionStatus === "done_with_warning" && status === "completed") {
|
|
3217
|
+
return "done (warning)";
|
|
3218
|
+
}
|
|
3152
3219
|
switch (status) {
|
|
3153
3220
|
case "completed":
|
|
3154
3221
|
return "done";
|
|
@@ -3861,9 +3928,12 @@ function WorkflowRootContainer({
|
|
|
3861
3928
|
containersById
|
|
3862
3929
|
}) {
|
|
3863
3930
|
const { verbose } = useSessionViewOptions();
|
|
3931
|
+
const sessionStatus = useWorkflowSessionStatus();
|
|
3864
3932
|
const visuallyActive = containersById ? isWorkflowRootVisuallyActive(node, containersById) : node.status === "running" || node.status === "retrying";
|
|
3865
|
-
const
|
|
3866
|
-
const
|
|
3933
|
+
const nodeStatus = visuallyActive ? "running" : node.status;
|
|
3934
|
+
const forcedCloseout = sessionStatus === "done_with_warning" && nodeStatus === "completed";
|
|
3935
|
+
const uiStatus = forcedCloseout ? "warning" : mapContainerUiStatus(nodeStatus);
|
|
3936
|
+
const statusLabel = mapWorkflowRootStatusLabel(nodeStatus, sessionStatus);
|
|
3867
3937
|
const meta = containersById ? buildEffectiveWorkflowRootMeta(node, containersById) : buildWorkflowRootMeta(node);
|
|
3868
3938
|
return /* @__PURE__ */ jsxs7("div", { className: "lax-workflow-root", "data-testid": "lax-workflow-root", children: [
|
|
3869
3939
|
/* @__PURE__ */ jsx12(
|
|
@@ -4573,6 +4643,10 @@ function WorkflowSession({
|
|
|
4573
4643
|
storeRef.current,
|
|
4574
4644
|
(s) => s.state.loopTreesBySessionId
|
|
4575
4645
|
);
|
|
4646
|
+
const openChildIdentities = useStore4(
|
|
4647
|
+
storeRef.current,
|
|
4648
|
+
(s) => s.state.openChildIdentities
|
|
4649
|
+
);
|
|
4576
4650
|
const sessionStatus = useStore4(
|
|
4577
4651
|
storeRef.current,
|
|
4578
4652
|
(s) => s.state.status
|
|
@@ -4611,6 +4685,22 @@ function WorkflowSession({
|
|
|
4611
4685
|
className: "lax-agent-session lax-workflow-session",
|
|
4612
4686
|
"data-testid": "lax-workflow-session",
|
|
4613
4687
|
children: [
|
|
4688
|
+
sessionStatus === "done_with_warning" ? /* @__PURE__ */ jsxs12(
|
|
4689
|
+
"div",
|
|
4690
|
+
{
|
|
4691
|
+
className: "lax-workflow-closeout-warning",
|
|
4692
|
+
"data-testid": "lax-workflow-closeout-warning",
|
|
4693
|
+
role: "status",
|
|
4694
|
+
children: [
|
|
4695
|
+
/* @__PURE__ */ jsx17("strong", { children: "Workflow forced closeout" }),
|
|
4696
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
4697
|
+
" ",
|
|
4698
|
+
"\u2014 stream ended with unresolved child scopes; not a healthy completion."
|
|
4699
|
+
] }),
|
|
4700
|
+
openChildIdentities.length > 0 ? /* @__PURE__ */ jsx17("ul", { className: "lax-workflow-closeout-warning__scopes", children: openChildIdentities.map((identity) => /* @__PURE__ */ jsx17("li", { children: identity }, identity)) }) : null
|
|
4701
|
+
]
|
|
4702
|
+
}
|
|
4703
|
+
) : null,
|
|
4614
4704
|
sessionStatus === "error" || internalErrors.length > 0 ? /* @__PURE__ */ jsx17(
|
|
4615
4705
|
"div",
|
|
4616
4706
|
{
|