langchain_agentx_stream_ui 0.6.8 → 0.7.1
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/{AskUserQuestionToolBody-CutLY-dS.d.ts → AskUserQuestionToolBody-C6J742a2.d.ts} +2 -2
- package/dist/{MarkdownBlock-Hf-kcLh6.d.ts → MarkdownBlock-B_wNhCB4.d.ts} +1 -1
- package/dist/{chunk-GBY5DJ7L.js → chunk-4RIOBLGB.js} +1 -1
- package/dist/chunk-4RIOBLGB.js.map +1 -0
- package/dist/{chunk-6Z4ZF36Z.js → chunk-DP7V33X7.js} +1 -1
- package/dist/chunk-DP7V33X7.js.map +1 -0
- package/dist/{chunk-VBUKRPEO.js → chunk-GGYJQYVR.js} +66 -35
- package/dist/chunk-GGYJQYVR.js.map +1 -0
- package/dist/{chunk-7XSQYG3X.js → chunk-GLUQUP3A.js} +215 -3
- package/dist/chunk-GLUQUP3A.js.map +1 -0
- package/dist/{chunk-B2NG5KGH.js → chunk-OV6UUIA3.js} +4 -4
- package/dist/chunk-OV6UUIA3.js.map +1 -0
- package/dist/{chunk-UBYOUDQE.js → chunk-RNBYZF6S.js} +81 -66
- package/dist/chunk-RNBYZF6S.js.map +1 -0
- package/dist/default.css +4 -0
- package/dist/index.d.ts +18 -14
- package/dist/index.js +83 -9
- package/dist/index.js.map +1 -1
- package/dist/{multi-session-t7dWsecW.d.ts → multi-session-Dzkwt9KF.d.ts} +8 -9
- package/dist/multi-session.d.ts +4 -4
- package/dist/multi-session.js +6 -6
- package/dist/{nodes-C2rGC3J7.d.ts → nodes-MpVB9C5d.d.ts} +2 -1
- package/dist/{sessionViewOptions-2Hv9BGeg.d.ts → sessionViewOptions-DeTrGjRM.d.ts} +1 -1
- package/dist/tools-presentation.d.ts +3 -3
- package/dist/tools-presentation.js +2 -2
- package/dist/tools.d.ts +5 -5
- package/dist/tools.js +4 -4
- package/dist/{types-kH4WQSM2.d.ts → types-SVtInovH.d.ts} +1 -1
- package/dist/virtual.d.ts +1 -1
- package/dist/virtual.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-6Z4ZF36Z.js.map +0 -1
- package/dist/chunk-7XSQYG3X.js.map +0 -1
- package/dist/chunk-B2NG5KGH.js.map +0 -1
- package/dist/chunk-GBY5DJ7L.js.map +0 -1
- package/dist/chunk-UBYOUDQE.js.map +0 -1
- package/dist/chunk-VBUKRPEO.js.map +0 -1
package/dist/default.css
CHANGED
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
3
|
import { ReactNode, PointerEventHandler } from 'react';
|
|
4
|
-
import { W as WorkflowAuthoritySnapshot, u as Source, L as LangchainAgentEvent, N as NodeRegistry, z as TierOverrides, I as InteractionBus, M as MarkdownRenderer, a as AskDisplaySnapshot, s as SessionTree, H as WorkflowDisplayProjection, G as WorkflowContainerTreeState, Q as WorkflowSessionState, F as WorkflowContainerRuntimeNode, v as SourceEventContext, J as WorkflowDisplayProjectionStatus, T as Task, x as TaskPhase, o as SessionStatus, R as ReducerError, B as WorkflowAuthorityStatus, r as SessionStoreState, t as SessionTreeSnapshot, E as EventTier } from './multi-session-
|
|
5
|
-
export { A as AskCoalescedBlock, b as AskDisplaySnapshotMetadata, c as AskSnapshotProjectionStatus, C as CommonFields, D as DEFAULT_EVENT_TIERS, d as EventType, e as InteractionBusHandlers, f as MarkdownRendererProps, g as MultiAgentSession, h as MultiAgentSessionProps, i as MultiSessionSourceConfig, j as MultiSessionStore, k as MultiSessionStoreOptions, l as MultiSessionStoreState, m as NodeWidget, n as NodeWidgetProps, P as PermissionResolvePayload, S as SessionSlice, p as SessionStore, q as SessionStoreOptions, w as SourceHandler, y as TaskStatus, K as WorkflowProgressState, O as WorkflowScopeFrame, U as WorkflowStageProgress, V as WorkflowTerminalKind, X as createActiveSessionBridge, Y as createEmptyTree, Z as createEmptyWorkflowSessionState, _ as createInteractionBus, $ as createMultiSessionStore, a0 as createSessionStore, a1 as getNoopInteractionBus, a2 as useActiveSession, a3 as useSessionIds } from './multi-session-
|
|
6
|
-
import { T as ToolDisplayRegistry, P as PermissionUiMode, b as DisplayMode, c as ProjectionContext, R as RenderableEntry, C as CanonicalNodeRef } from './sessionViewOptions-
|
|
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-
|
|
8
|
-
import { a as ToolBodyMode } from './types-
|
|
9
|
-
export { T as ToolBodyComponent, b as ToolDisplayProps } from './types-
|
|
4
|
+
import { W as WorkflowAuthoritySnapshot, u as Source, L as LangchainAgentEvent, N as NodeRegistry, z as TierOverrides, I as InteractionBus, M as MarkdownRenderer, a as AskDisplaySnapshot, s as SessionTree, H as WorkflowDisplayProjection, G as WorkflowContainerTreeState, Q as WorkflowSessionState, F as WorkflowContainerRuntimeNode, v as SourceEventContext, J as WorkflowDisplayProjectionStatus, T as Task, x as TaskPhase, o as SessionStatus, R as ReducerError, B as WorkflowAuthorityStatus, r as SessionStoreState, t as SessionTreeSnapshot, E as EventTier } from './multi-session-Dzkwt9KF.js';
|
|
5
|
+
export { A as AskCoalescedBlock, b as AskDisplaySnapshotMetadata, c as AskSnapshotProjectionStatus, C as CommonFields, D as DEFAULT_EVENT_TIERS, d as EventType, e as InteractionBusHandlers, f as MarkdownRendererProps, g as MultiAgentSession, h as MultiAgentSessionProps, i as MultiSessionSourceConfig, j as MultiSessionStore, k as MultiSessionStoreOptions, l as MultiSessionStoreState, m as NodeWidget, n as NodeWidgetProps, P as PermissionResolvePayload, S as SessionSlice, p as SessionStore, q as SessionStoreOptions, w as SourceHandler, y as TaskStatus, K as WorkflowProgressState, O as WorkflowScopeFrame, U as WorkflowStageProgress, V as WorkflowTerminalKind, X as createActiveSessionBridge, Y as createEmptyTree, Z as createEmptyWorkflowSessionState, _ as createInteractionBus, $ as createMultiSessionStore, a0 as createSessionStore, a1 as getNoopInteractionBus, a2 as useActiveSession, a3 as useSessionIds } from './multi-session-Dzkwt9KF.js';
|
|
6
|
+
import { T as ToolDisplayRegistry, P as PermissionUiMode, b as DisplayMode, c as ProjectionContext, R as RenderableEntry, C as CanonicalNodeRef } from './sessionViewOptions-DeTrGjRM.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-DeTrGjRM.js';
|
|
8
|
+
import { a as ToolBodyMode } from './types-SVtInovH.js';
|
|
9
|
+
export { T as ToolBodyComponent, b as ToolDisplayProps } from './types-SVtInovH.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-
|
|
13
|
-
import { S as SessionNode, a as SessionNodeKind } from './nodes-
|
|
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-
|
|
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-
|
|
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-C6J742a2.js';
|
|
13
|
+
import { S as SessionNode, a as SessionNodeKind } from './nodes-MpVB9C5d.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-MpVB9C5d.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-B_wNhCB4.js';
|
|
16
16
|
|
|
17
17
|
/** Workflow 大规模编排 UI 缩放选项(P1–P4 · D40 O1–O4 · D41 P-UX) */
|
|
18
18
|
type DeferEvictionUntil = 'immediate' | 'run-idle' | 'host-reset';
|
|
@@ -1272,14 +1272,18 @@ type AgentAuthorityMetadata = WorkflowAuthoritySnapshot['metadata'] & {
|
|
|
1272
1272
|
};
|
|
1273
1273
|
|
|
1274
1274
|
/**
|
|
1275
|
-
* 职责:authority=canceled 时兜底收口 SessionTree 僵尸 running 点(D43 P-UI-4
|
|
1275
|
+
* 职责:authority=canceled 时兜底收口 SessionTree 僵尸 running 点(D43 P-UI-4),
|
|
1276
|
+
* 并 remap 已写入的取消哨兵 tool-error 为 soft(层 C · D-HOST · CC 双轨)。
|
|
1276
1277
|
* 链路位置:SessionStore / WorkflowSessionStore.applyAuthoritySnapshot。
|
|
1277
|
-
* 当前裁剪范围:仅 canceled;不写 authority
|
|
1278
|
+
* 当前裁剪范围:仅 canceled;不写 authority;不吞真 boom。
|
|
1278
1279
|
*/
|
|
1279
1280
|
|
|
1280
1281
|
/**
|
|
1281
|
-
* authority → canceled 时:running tool
|
|
1282
|
-
*
|
|
1282
|
+
* authority → canceled 时:running tool 收口为 cancelled(soft),
|
|
1283
|
+
* 并对已 failed 且为取消哨兵的节点改写 soft;真 boom 保持 failed。
|
|
1284
|
+
*
|
|
1285
|
+
* running 收口对齐 CC createToolResultStopMessage → canceled 轨;
|
|
1286
|
+
* 已有 Abort 哨兵保持 rejected 轨。
|
|
1283
1287
|
*/
|
|
1284
1288
|
declare function finalizeSessionTreeOnAuthorityCanceled(tree: SessionTree, endedAtMs?: number): SessionTree;
|
|
1285
1289
|
|
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-GGYJQYVR.js";
|
|
27
27
|
import {
|
|
28
28
|
DefaultToolBody,
|
|
29
29
|
InteractionBusContext,
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
getNoopInteractionBus,
|
|
33
33
|
resolveToolBody,
|
|
34
34
|
useInteractionBus
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-OV6UUIA3.js";
|
|
36
|
+
import "./chunk-DP7V33X7.js";
|
|
37
37
|
import {
|
|
38
38
|
CollapseKind,
|
|
39
39
|
CollapsedExploreNode,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
useSessionStatus,
|
|
121
121
|
useSessionViewOptions,
|
|
122
122
|
useTimeline
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-RNBYZF6S.js";
|
|
124
124
|
import {
|
|
125
125
|
AGENT_PROGRESS_GUTTER,
|
|
126
126
|
AGENT_PROGRESS_INDENT,
|
|
@@ -147,10 +147,14 @@ import {
|
|
|
147
147
|
WebSearchToolBody,
|
|
148
148
|
Write,
|
|
149
149
|
WriteToolBody,
|
|
150
|
+
classifyToolResultSoftKind,
|
|
150
151
|
createDefaultToolRegistry,
|
|
151
152
|
formatAgentTitle,
|
|
152
|
-
formatExploreSummaryText
|
|
153
|
-
|
|
153
|
+
formatExploreSummaryText,
|
|
154
|
+
isCancelToolResultError,
|
|
155
|
+
isToolResultCancelled,
|
|
156
|
+
resolveToolCancelDisplayText
|
|
157
|
+
} from "./chunk-GLUQUP3A.js";
|
|
154
158
|
import {
|
|
155
159
|
BodyBlockList,
|
|
156
160
|
DiffView,
|
|
@@ -166,7 +170,7 @@ import {
|
|
|
166
170
|
formatTimeoutFooter,
|
|
167
171
|
parseDiffText,
|
|
168
172
|
truncateCommand
|
|
169
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-4RIOBLGB.js";
|
|
170
174
|
|
|
171
175
|
// src/view/AgentSession.tsx
|
|
172
176
|
import { useEffect as useEffect3, useMemo, useRef as useRef3 } from "react";
|
|
@@ -992,6 +996,18 @@ function trimWorkflowLoopTreesSoft(state, options) {
|
|
|
992
996
|
}
|
|
993
997
|
|
|
994
998
|
// src/core/sessionTreeAuthorityFinalize.ts
|
|
999
|
+
function resolvePreservedErrorKind(meta) {
|
|
1000
|
+
if (meta != null && typeof meta === "object" && !Array.isArray(meta)) {
|
|
1001
|
+
const kind = meta.error_kind;
|
|
1002
|
+
if (kind === "aborted" || kind === "user_cancelled" || kind === "cancelled") {
|
|
1003
|
+
return kind;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
return "aborted";
|
|
1007
|
+
}
|
|
1008
|
+
function resolveSoftKindForRemap(result, fallback) {
|
|
1009
|
+
return classifyToolResultSoftKind(result) ?? fallback;
|
|
1010
|
+
}
|
|
995
1011
|
function finalizeSessionTreeOnAuthorityCanceled(tree, endedAtMs = Date.now()) {
|
|
996
1012
|
const byId = { ...tree.byId };
|
|
997
1013
|
let changed = false;
|
|
@@ -1002,13 +1018,71 @@ function finalizeSessionTreeOnAuthorityCanceled(tree, endedAtMs = Date.now()) {
|
|
|
1002
1018
|
changed = true;
|
|
1003
1019
|
continue;
|
|
1004
1020
|
}
|
|
1021
|
+
if (node.kind === "error") {
|
|
1022
|
+
if (isCancelToolResultError(
|
|
1023
|
+
{ message: node.message, type: node.errorType ?? void 0 },
|
|
1024
|
+
{ error_type: node.errorType }
|
|
1025
|
+
) && node.variant !== "interrupt") {
|
|
1026
|
+
byId[id] = {
|
|
1027
|
+
...node,
|
|
1028
|
+
message: resolveToolCancelDisplayText("rejected"),
|
|
1029
|
+
errorType: "cancelled",
|
|
1030
|
+
variant: "interrupt"
|
|
1031
|
+
};
|
|
1032
|
+
changed = true;
|
|
1033
|
+
}
|
|
1034
|
+
continue;
|
|
1035
|
+
}
|
|
1005
1036
|
if (node.kind !== "tool_call") continue;
|
|
1006
1037
|
let next = node;
|
|
1038
|
+
const wasCancelResult = isToolResultCancelled(next.result);
|
|
1007
1039
|
if (node.status === "running") {
|
|
1040
|
+
const softKind = "canceled";
|
|
1041
|
+
const soft = resolveToolCancelDisplayText(softKind);
|
|
1042
|
+
const prevMeta = typeof next.result?.meta === "object" && next.result.meta != null && !Array.isArray(next.result.meta) ? next.result.meta : {};
|
|
1008
1043
|
next = {
|
|
1009
1044
|
...next,
|
|
1010
|
-
status: "
|
|
1011
|
-
endedAt: node.endedAt ?? endedAtMs
|
|
1045
|
+
status: "cancelled",
|
|
1046
|
+
endedAt: node.endedAt ?? endedAtMs,
|
|
1047
|
+
result: {
|
|
1048
|
+
schema_version: next.result?.schema_version ?? "2",
|
|
1049
|
+
status: "error",
|
|
1050
|
+
summary: soft,
|
|
1051
|
+
payload: next.result?.payload ?? soft,
|
|
1052
|
+
blocks: next.result?.blocks ?? [],
|
|
1053
|
+
artifacts: next.result?.artifacts ?? [],
|
|
1054
|
+
hints: next.result?.hints ?? null,
|
|
1055
|
+
meta: {
|
|
1056
|
+
...prevMeta,
|
|
1057
|
+
terminal_state: "cancelled",
|
|
1058
|
+
error_kind: "user_cancelled",
|
|
1059
|
+
cancel_ui_kind: softKind
|
|
1060
|
+
},
|
|
1061
|
+
error: { message: soft, type: "cancelled" },
|
|
1062
|
+
truncated: next.result?.truncated ?? false,
|
|
1063
|
+
overflow_file: next.result?.overflow_file ?? null
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
changed = true;
|
|
1067
|
+
} else if (wasCancelResult && next.status !== "cancelled") {
|
|
1068
|
+
const softKind = resolveSoftKindForRemap(next.result, "rejected");
|
|
1069
|
+
const soft = resolveToolCancelDisplayText(softKind);
|
|
1070
|
+
const prevMeta = typeof next.result?.meta === "object" && next.result.meta != null && !Array.isArray(next.result.meta) ? next.result.meta : {};
|
|
1071
|
+
const errorKind = resolvePreservedErrorKind(prevMeta);
|
|
1072
|
+
next = {
|
|
1073
|
+
...next,
|
|
1074
|
+
status: "cancelled",
|
|
1075
|
+
result: {
|
|
1076
|
+
...next.result,
|
|
1077
|
+
summary: soft,
|
|
1078
|
+
error: { message: soft, type: "cancelled" },
|
|
1079
|
+
meta: {
|
|
1080
|
+
...prevMeta,
|
|
1081
|
+
terminal_state: "cancelled",
|
|
1082
|
+
error_kind: errorKind,
|
|
1083
|
+
cancel_ui_kind: softKind ?? (errorKind === "user_cancelled" ? "canceled" : "rejected")
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1012
1086
|
};
|
|
1013
1087
|
changed = true;
|
|
1014
1088
|
}
|