langchain_agentx_stream_ui 0.3.7 → 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/{AskUserQuestionToolBody-CUXqUkar.d.ts → AskUserQuestionToolBody-J8MqSUEs.d.ts} +2 -2
- package/dist/{MarkdownBlock-CcXZ5nTm.d.ts → MarkdownBlock-DeICJUtu.d.ts} +1 -1
- package/dist/{chunk-7QYE5PN5.js → chunk-7X7IF2A4.js} +2 -2
- package/dist/{chunk-24FLS4TF.js → chunk-AY7QLXFB.js} +165 -10
- package/dist/chunk-AY7QLXFB.js.map +1 -0
- package/dist/index.d.ts +98 -239
- package/dist/index.js +1852 -1705
- package/dist/index.js.map +1 -1
- package/dist/{multi-session-CsPvSE9d.d.ts → multi-session--0z_-ut1.d.ts} +267 -4
- package/dist/multi-session.d.ts +4 -4
- package/dist/multi-session.js +2 -2
- package/dist/{nodes-BcyPw6Fr.d.ts → nodes-7_0rCAc4.d.ts} +2 -0
- package/dist/{sessionViewOptions-DQRzPuN_.d.ts → sessionViewOptions-EIBugOkf.d.ts} +1 -1
- package/dist/tools-presentation.d.ts +3 -3
- package/dist/tools.d.ts +5 -5
- package/dist/{types-BEXSHQG7.d.ts → types-DAkw2VOv.d.ts} +1 -1
- package/dist/virtual.d.ts +1 -1
- package/dist/virtual.js +1 -1
- package/package.json +4 -2
- package/dist/chunk-24FLS4TF.js.map +0 -1
- /package/dist/{chunk-7QYE5PN5.js.map → chunk-7X7IF2A4.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
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 {
|
|
5
|
-
export { C as CommonFields, D as DEFAULT_EVENT_TIERS,
|
|
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, F as WorkflowContainerRuntimeNode, Q as WorkflowSessionState, 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--0z_-ut1.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--0z_-ut1.js';
|
|
6
|
+
import { T as ToolDisplayRegistry, P as PermissionUiMode, b as DisplayMode, c as ProjectionContext, R as RenderableEntry, C as CanonicalNodeRef } from './sessionViewOptions-EIBugOkf.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-EIBugOkf.js';
|
|
8
|
+
import { a as ToolBodyMode } from './types-DAkw2VOv.js';
|
|
9
|
+
export { T as ToolBodyComponent, b as ToolDisplayProps } from './types-DAkw2VOv.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-J8MqSUEs.js';
|
|
13
|
+
import { S as SessionNode, a as SessionNodeKind } from './nodes-7_0rCAc4.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-7_0rCAc4.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-DeICJUtu.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* workflowAuthoritySource.ts — 宿主 workflow 业务权威输入契约(D33 §6.1)
|
|
19
|
+
*
|
|
20
|
+
* 职责:
|
|
21
|
+
* 定义 WorkflowSession 必填的 authority 订阅接口。
|
|
22
|
+
*
|
|
23
|
+
* 链路位置:
|
|
24
|
+
* WorkflowSession → workflowSessionStore.applyAuthoritySnapshot。
|
|
25
|
+
*
|
|
26
|
+
* 当前裁剪范围:
|
|
27
|
+
* createPollingAuthoritySource 于 Phase 3;此处仅基线接口。
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** 基线契约:hydrate + 推送订阅 */
|
|
31
|
+
interface WorkflowAuthoritySource {
|
|
32
|
+
getSnapshot(): WorkflowAuthoritySnapshot | null;
|
|
33
|
+
subscribe(cb: (snap: WorkflowAuthoritySnapshot) => void): () => void;
|
|
34
|
+
}
|
|
16
35
|
|
|
17
36
|
interface AgentSessionProps {
|
|
18
37
|
source: Source;
|
|
38
|
+
/** D38 P4:REST 执行权威;绑定时 Spinner phase 读 authority 而非 SSE status */
|
|
39
|
+
authoritySource?: WorkflowAuthoritySource;
|
|
40
|
+
/** authority 首次进入 terminal 时触发(phase SSOT) */
|
|
41
|
+
onAuthorityTerminal?: (snapshot: WorkflowAuthoritySnapshot) => void;
|
|
19
42
|
/** 挂载时先 replay 预灌树(含 EventBuffer ingest 快照),再接 source 续流 */
|
|
20
43
|
initialEvents?: LangchainAgentEvent[];
|
|
21
44
|
registry?: NodeRegistry;
|
|
@@ -50,9 +73,13 @@ interface AgentSessionProps {
|
|
|
50
73
|
workspaceRoot?: string | null;
|
|
51
74
|
/** D34 P2 LeakGate synthesize;默认 false */
|
|
52
75
|
subagentLeakGate?: boolean;
|
|
76
|
+
/** D39 P2:remount hydrate SSOT;挂载时写入 store */
|
|
77
|
+
snapshotBootstrap?: AskDisplaySnapshot | null;
|
|
78
|
+
/** GET snapshot 404 / 重试耗尽 */
|
|
79
|
+
snapshotHydrateFailed?: boolean;
|
|
53
80
|
children?: ReactNode;
|
|
54
81
|
}
|
|
55
|
-
declare function AgentSession({ source, initialEvents, registry, tierOverrides: _tierOverrides, onError, autoReconnect: _autoReconnect, debug, virtualized, virtualizeThreshold, interactionBus, toolDisplayRegistry, defaultBodyMode, groupParallelTools, permissionUiMode, markdownRenderer, displayMode, verbose, exploreFullscreenBash, memoryDir, workspaceRoot, subagentLeakGate, children, }: AgentSessionProps): react_jsx_runtime.JSX.Element;
|
|
82
|
+
declare function AgentSession({ source, authoritySource, onAuthorityTerminal, initialEvents, registry, tierOverrides: _tierOverrides, onError, autoReconnect: _autoReconnect, debug, virtualized, virtualizeThreshold, interactionBus, toolDisplayRegistry, defaultBodyMode, groupParallelTools, permissionUiMode, markdownRenderer, displayMode, verbose, exploreFullscreenBash, memoryDir, workspaceRoot, subagentLeakGate, snapshotBootstrap, snapshotHydrateFailed, children, }: AgentSessionProps): react_jsx_runtime.JSX.Element;
|
|
56
83
|
|
|
57
84
|
interface AgentLoopViewProps {
|
|
58
85
|
/** 传入时使用隔离 store(workflow scoped);省略则使用上层 SessionStoreContext */
|
|
@@ -96,213 +123,6 @@ interface WorkflowScaleOptions {
|
|
|
96
123
|
}
|
|
97
124
|
declare const DEFAULT_WORKFLOW_SCALE_OPTIONS: WorkflowScaleOptions;
|
|
98
125
|
|
|
99
|
-
/**
|
|
100
|
-
* workflowDisplay.ts — SDK WorkflowDisplayPayload 契约(TS)
|
|
101
|
-
*
|
|
102
|
-
* 职责:
|
|
103
|
-
* 对齐 langchain_agentx WorkflowDisplayPayload;结构事件 data.display 类型。
|
|
104
|
-
*
|
|
105
|
-
* 链路位置:
|
|
106
|
-
* workflowContainerProjector → WorkflowChrome(P2+)。
|
|
107
|
-
*
|
|
108
|
-
* 当前裁剪范围:
|
|
109
|
-
* 只读消费;不计算 display(由 SDK enricher 注入)。
|
|
110
|
-
*/
|
|
111
|
-
type WorkflowDisplayScope = 'workflow' | 'stage' | 'item' | 'branch' | 'aggregate' | 'subworkflow';
|
|
112
|
-
type WorkflowDisplayStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'cancelled' | 'blocked' | 'retrying';
|
|
113
|
-
/** 对齐 SDK display_resolver.WorkflowDisplayPayload */
|
|
114
|
-
interface WorkflowDisplayPayload {
|
|
115
|
-
version?: number;
|
|
116
|
-
scope?: WorkflowDisplayScope;
|
|
117
|
-
title?: string;
|
|
118
|
-
description?: string;
|
|
119
|
-
workflow_title?: string;
|
|
120
|
-
workflow_description?: string;
|
|
121
|
-
parent_title?: string;
|
|
122
|
-
breadcrumb?: string[];
|
|
123
|
-
progress_current?: number;
|
|
124
|
-
progress_total?: number;
|
|
125
|
-
progress_label?: string;
|
|
126
|
-
progress_indeterminate?: boolean;
|
|
127
|
-
status?: WorkflowDisplayStatus;
|
|
128
|
-
status_reason?: string;
|
|
129
|
-
icon?: string;
|
|
130
|
-
item_index?: number;
|
|
131
|
-
item_total?: number;
|
|
132
|
-
metrics_completed?: number;
|
|
133
|
-
metrics_running?: number;
|
|
134
|
-
metrics_failed?: number;
|
|
135
|
-
metrics_total?: number;
|
|
136
|
-
decision_label?: string;
|
|
137
|
-
pattern?: string;
|
|
138
|
-
debug_key?: string;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* workflowContainer.ts — Workflow 容器树投影类型
|
|
143
|
-
*
|
|
144
|
-
* 职责:
|
|
145
|
-
* 容器节点、正文块、快照;对齐 SDK workflow_container_projector。
|
|
146
|
-
*
|
|
147
|
-
* 链路位置:
|
|
148
|
-
* workflowContainerProjector → workflowReducer(P1+)→ WorkflowChrome(P2+)。
|
|
149
|
-
*
|
|
150
|
-
* 当前裁剪范围:
|
|
151
|
-
* 不含 React 视图 props;仅投影层 state。
|
|
152
|
-
*/
|
|
153
|
-
|
|
154
|
-
type WorkflowContainerScope = 'workflow' | 'stage' | 'item' | 'branch' | 'aggregate' | 'subworkflow';
|
|
155
|
-
type WorkflowContainerStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'cancelled' | 'blocked' | 'retrying';
|
|
156
|
-
type ContentBlockKind = 'reasoning' | 'text' | 'tool';
|
|
157
|
-
interface WorkflowContentBlock {
|
|
158
|
-
kind: ContentBlockKind;
|
|
159
|
-
preview: string;
|
|
160
|
-
tool_name: string | null;
|
|
161
|
-
}
|
|
162
|
-
interface WorkflowContainerNode {
|
|
163
|
-
container_id: string;
|
|
164
|
-
scope: WorkflowContainerScope;
|
|
165
|
-
workflow_path: string;
|
|
166
|
-
workflow_depth: number;
|
|
167
|
-
scope_key: string;
|
|
168
|
-
title: string;
|
|
169
|
-
subtitle: string;
|
|
170
|
-
status: WorkflowContainerStatus;
|
|
171
|
-
pattern: string;
|
|
172
|
-
parent_container_id: string | null;
|
|
173
|
-
display: WorkflowDisplayPayload | null;
|
|
174
|
-
content_blocks: WorkflowContentBlock[];
|
|
175
|
-
is_open: boolean;
|
|
176
|
-
}
|
|
177
|
-
/** reducer 运行时节点:投影字段 + loop 绑定(P1) */
|
|
178
|
-
interface WorkflowContainerRuntimeNode extends WorkflowContainerNode {
|
|
179
|
-
loopSessionId: string | null;
|
|
180
|
-
}
|
|
181
|
-
/** WorkflowSession 容器树 state(P1+) */
|
|
182
|
-
interface WorkflowContainerTreeState {
|
|
183
|
-
rootContainerIds: string[];
|
|
184
|
-
activeContainerIds: string[];
|
|
185
|
-
containersById: Record<string, WorkflowContainerRuntimeNode>;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* workflowSession.ts — Workflow 会话顶层状态
|
|
190
|
-
*
|
|
191
|
-
* 职责:
|
|
192
|
-
* 定义 /workflow 页专用 WorkflowSessionState(与 /chat SessionTree 隔离)。
|
|
193
|
-
*
|
|
194
|
-
* 链路位置:
|
|
195
|
-
* workflowReducer → workflowSessionStore → WorkflowSession / WorkflowChrome。
|
|
196
|
-
*
|
|
197
|
-
* 当前裁剪范围:
|
|
198
|
-
* 不含合并 TaskListFooter(P3);parallel 结构仅基础字段。
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
/** SDK v1.9.0 根 workflow 终态语义 SSOT */
|
|
202
|
-
type WorkflowTerminalKind = 'healthy' | 'forced_closeout' | 'failed';
|
|
203
|
-
/** 宿主业务权威快照 — 唯一控制面输入(D33) */
|
|
204
|
-
type WorkflowAuthorityStatus = 'pending' | 'running' | 'done' | 'error' | 'canceled' | 'partial_success';
|
|
205
|
-
interface WorkflowAuthoritySnapshot {
|
|
206
|
-
taskId: string;
|
|
207
|
-
status: WorkflowAuthorityStatus;
|
|
208
|
-
updatedAt: number;
|
|
209
|
-
metadata?: {
|
|
210
|
-
failed_items?: string[];
|
|
211
|
-
cleanup_failures?: Array<{
|
|
212
|
-
action: string;
|
|
213
|
-
error: string;
|
|
214
|
-
}>;
|
|
215
|
-
execution_authority?: true;
|
|
216
|
-
orphan_items_reaped?: number;
|
|
217
|
-
partial_success_kind?: string;
|
|
218
|
-
projection_status?: 'complete' | 'degraded' | 'running';
|
|
219
|
-
projection_dropped_count?: number;
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
/** 纯投影 / 传输展示态 — 不可驱动宿主 phase(D33) */
|
|
223
|
-
type WorkflowDisplayProjectionStatus = 'connecting' | 'running' | 'done' | 'error' | 'done_with_warning';
|
|
224
|
-
interface WorkflowDisplayProjection {
|
|
225
|
-
/** SSE 字节流是否已结束(transport) */
|
|
226
|
-
streamEnded: boolean;
|
|
227
|
-
/** 投影推断的编排展示态(workflow-end / 容器树;缺帧时不 infer done) */
|
|
228
|
-
projectionStatus: WorkflowDisplayProjectionStatus;
|
|
229
|
-
terminalKind: WorkflowTerminalKind | null;
|
|
230
|
-
openChildIdentities: string[];
|
|
231
|
-
/** streamEnded 且 authority 仍 running 超过阈值时的展示降级 */
|
|
232
|
-
awaitingAuthority?: boolean;
|
|
233
|
-
/** streamEnded + running 超过 120s 仍无 authority terminal */
|
|
234
|
-
authoritySyncFailed?: boolean;
|
|
235
|
-
/** authoritySource.subscribe 抛错时的展示降级 */
|
|
236
|
-
authoritySubscribeFailed?: boolean;
|
|
237
|
-
}
|
|
238
|
-
/** P2:stage 完成摘要缓存(loop 树淘汰后仍显示 teaser) */
|
|
239
|
-
interface CachedStageDoneSummary {
|
|
240
|
-
label: string;
|
|
241
|
-
teaser: string;
|
|
242
|
-
extraLines: number;
|
|
243
|
-
fullMarkdown?: string;
|
|
244
|
-
}
|
|
245
|
-
type WorkflowRunStatus = 'running' | 'done' | 'error';
|
|
246
|
-
interface WorkflowStageProgress {
|
|
247
|
-
stageKey: string;
|
|
248
|
-
stageIndex: number;
|
|
249
|
-
stageTotal?: number;
|
|
250
|
-
status: 'pending' | 'running' | 'done' | 'failed';
|
|
251
|
-
error?: string;
|
|
252
|
-
}
|
|
253
|
-
interface ParallelItemProgress {
|
|
254
|
-
itemKey: string;
|
|
255
|
-
itemIndex: number;
|
|
256
|
-
itemTotal?: number;
|
|
257
|
-
status: 'pending' | 'running' | 'done' | 'failed';
|
|
258
|
-
loopSessionId: string | null;
|
|
259
|
-
error?: string;
|
|
260
|
-
}
|
|
261
|
-
interface WorkflowProgressState {
|
|
262
|
-
workflowId: string | null;
|
|
263
|
-
workflowPath: string | null;
|
|
264
|
-
status: WorkflowRunStatus;
|
|
265
|
-
stages: WorkflowStageProgress[];
|
|
266
|
-
parallelItems: Record<string, ParallelItemProgress>;
|
|
267
|
-
}
|
|
268
|
-
type WorkflowScopeKind = 'stage' | 'parallel-item' | 'subworkflow';
|
|
269
|
-
interface WorkflowScopeFrame {
|
|
270
|
-
kind: WorkflowScopeKind;
|
|
271
|
-
key: string;
|
|
272
|
-
loopSessionId: string | null;
|
|
273
|
-
}
|
|
274
|
-
interface WorkflowSessionState {
|
|
275
|
-
/** 宿主注入;Reducer 禁止写入 */
|
|
276
|
-
authority: WorkflowAuthoritySnapshot | null;
|
|
277
|
-
/** 事件投影 + 传输展示;不可驱动 phase */
|
|
278
|
-
display: WorkflowDisplayProjection;
|
|
279
|
-
meta: {
|
|
280
|
-
workflowRunId: string | null;
|
|
281
|
-
startedAt: number | null;
|
|
282
|
-
lastEventId: string | null;
|
|
283
|
-
};
|
|
284
|
-
/** SDK 容器树投影 + loopSessionId 绑定(P1 主模型) */
|
|
285
|
-
containerTree: WorkflowContainerTreeState;
|
|
286
|
-
/** 过渡期 dual-write;P2+ UI 逐步改读 containerTree */
|
|
287
|
-
workflowProgress: WorkflowProgressState;
|
|
288
|
-
loopTreesBySessionId: Record<string, SessionTree>;
|
|
289
|
-
/** P2:container_id → done 摘要(loop 淘汰后) */
|
|
290
|
-
stageDoneSummariesByContainerId: Record<string, CachedStageDoneSummary>;
|
|
291
|
-
/** P2:completed hydrated loop LRU 热缓存(最近使用在数组尾部) */
|
|
292
|
-
hotCompletedLoopSessionIds: string[];
|
|
293
|
-
activeLoopSessionId: string | null;
|
|
294
|
-
/** D36 P4:snapshot hydrate 后的 tail 游标 */
|
|
295
|
-
projectionCursor: string | null;
|
|
296
|
-
snapshotVersion: number | null;
|
|
297
|
-
reconnectSuppressedReason: string | null;
|
|
298
|
-
/** D36 T6:snapshot 404/409 时展示降级,禁止 history fallback */
|
|
299
|
-
snapshotHydrateFailed: boolean;
|
|
300
|
-
/** @deprecated P1 起由 containerTree.activeContainerIds 替代 */
|
|
301
|
-
openScopeStack: WorkflowScopeFrame[];
|
|
302
|
-
internalErrors: ReducerError[];
|
|
303
|
-
}
|
|
304
|
-
declare function createEmptyWorkflowSessionState(): WorkflowSessionState;
|
|
305
|
-
|
|
306
126
|
/**
|
|
307
127
|
* workflowSnapshot.ts — WorkflowDisplaySnapshot DTO(D36 P3)
|
|
308
128
|
*
|
|
@@ -344,25 +164,6 @@ interface WorkflowDisplaySnapshot {
|
|
|
344
164
|
metadata?: WorkflowDisplaySnapshotMetadata;
|
|
345
165
|
}
|
|
346
166
|
|
|
347
|
-
/**
|
|
348
|
-
* workflowAuthoritySource.ts — 宿主 workflow 业务权威输入契约(D33 §6.1)
|
|
349
|
-
*
|
|
350
|
-
* 职责:
|
|
351
|
-
* 定义 WorkflowSession 必填的 authority 订阅接口。
|
|
352
|
-
*
|
|
353
|
-
* 链路位置:
|
|
354
|
-
* WorkflowSession → workflowSessionStore.applyAuthoritySnapshot。
|
|
355
|
-
*
|
|
356
|
-
* 当前裁剪范围:
|
|
357
|
-
* createPollingAuthoritySource 于 Phase 3;此处仅基线接口。
|
|
358
|
-
*/
|
|
359
|
-
|
|
360
|
-
/** 基线契约:hydrate + 推送订阅 */
|
|
361
|
-
interface WorkflowAuthoritySource {
|
|
362
|
-
getSnapshot(): WorkflowAuthoritySnapshot | null;
|
|
363
|
-
subscribe(cb: (snap: WorkflowAuthoritySnapshot) => void): () => void;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
167
|
interface WorkflowSessionProps {
|
|
367
168
|
source: Source | null;
|
|
368
169
|
/** 宿主业务权威(必填);测试可用 createMockAuthoritySource */
|
|
@@ -441,6 +242,12 @@ interface PollingAuthoritySourceOptions {
|
|
|
441
242
|
/** hydrate 已 terminal 时注入,subscribe 不启动 poll */
|
|
442
243
|
initialSnapshot?: WorkflowAuthoritySnapshot | null;
|
|
443
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
|
+
}
|
|
444
251
|
declare function createPollingAuthoritySource(taskId: string, fetchFn: (id: string) => Promise<WorkflowAuthoritySnapshot>, options?: PollingAuthoritySourceOptions): WorkflowAuthoritySource;
|
|
445
252
|
|
|
446
253
|
declare const WorkflowScaleContext: react.Context<WorkflowScaleOptions>;
|
|
@@ -646,6 +453,8 @@ interface ReduceOptions {
|
|
|
646
453
|
collectDebug?: boolean;
|
|
647
454
|
/** D19 §5.3 / D34 P2:leak main-tier tool-call 合成父 Agent progress;默认 off */
|
|
648
455
|
subagentLeakGate?: boolean;
|
|
456
|
+
/** P2:缺父 Agent tool-call 时在 subagent-start 合成骨架;默认 off */
|
|
457
|
+
syntheticAgentToolOnSubagentStart?: boolean;
|
|
649
458
|
}
|
|
650
459
|
declare function streamChunk(data: {
|
|
651
460
|
delta?: string;
|
|
@@ -1141,7 +950,7 @@ declare class MissingApplicationKindError extends Error {
|
|
|
1141
950
|
* 不等于 workflow 业务终态(authority);phase / spinner 读 WorkflowAuthoritySnapshot(见 D33)。
|
|
1142
951
|
*/
|
|
1143
952
|
|
|
1144
|
-
type SseTransportProfile = 'oneshot' | 'oneshot-workflow' | 'replayable-workflow' | 'workflow-tail';
|
|
953
|
+
type SseTransportProfile = 'oneshot' | 'oneshot-workflow' | 'replayable-workflow' | 'workflow-tail' | 'replayable-ask' | 'ask-tail';
|
|
1145
954
|
type SseReplayMode = 'none' | 'resume' | 'history';
|
|
1146
955
|
type SseReconnectMode = 'off' | 'bounded' | 'unbounded';
|
|
1147
956
|
interface SseReconnectPolicy {
|
|
@@ -1298,6 +1107,9 @@ declare function useSessionMeta(): {
|
|
|
1298
1107
|
startedAt: number | null;
|
|
1299
1108
|
lastEventId: string | null;
|
|
1300
1109
|
};
|
|
1110
|
+
/** D38 P4:AgentSession authority 快照(无绑定时为 null) */
|
|
1111
|
+
declare function useAgentAuthority(): WorkflowAuthoritySnapshot | null;
|
|
1112
|
+
declare function useAgentAuthoritySubscribeFailed(): boolean;
|
|
1301
1113
|
|
|
1302
1114
|
/**
|
|
1303
1115
|
* 职责:内存事件源,按序投递 events 实现 Source 接口。
|
|
@@ -1362,6 +1174,18 @@ declare function resolveWorkflowBanner(state: WorkflowSessionState): WorkflowBan
|
|
|
1362
1174
|
declare function getDisplayProjectionStatus(state: WorkflowSessionState): WorkflowSessionState['display']['projectionStatus'];
|
|
1363
1175
|
declare function applyAuthoritySnapshotToState(state: WorkflowSessionState, snapshot: WorkflowAuthoritySnapshot): WorkflowSessionState;
|
|
1364
1176
|
|
|
1177
|
+
/**
|
|
1178
|
+
* agentAuthoritySelectors.ts — AgentSession authority / spinner 读法(D38 P4)
|
|
1179
|
+
*
|
|
1180
|
+
* 职责:authority 绑定时 Spinner phase 读 REST 快照,非 SSE reducer status。
|
|
1181
|
+
*/
|
|
1182
|
+
|
|
1183
|
+
declare function shouldShowAgentSpinner(state: SessionStoreState): boolean;
|
|
1184
|
+
type AgentAuthorityMetadata = WorkflowAuthoritySnapshot['metadata'] & {
|
|
1185
|
+
projection_status?: 'complete' | 'degraded' | 'running';
|
|
1186
|
+
projection_dropped_count?: number;
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1365
1189
|
/** 与 backend/langchain_agentx_stream_ui_backend/task_sync/multi_sse_bridge.py 对齐 */
|
|
1366
1190
|
declare const WORKFLOW_STRUCTURE_EVENT_PREFIXES: readonly string[];
|
|
1367
1191
|
/** 显式 SSOT(文档/契约测试);新增结构类型应同时满足前缀规则或补入此集合 */
|
|
@@ -1405,6 +1229,41 @@ declare function isAtOrBeforeProjectionCursor(projectionCursor: string | null |
|
|
|
1405
1229
|
/** 冻结算法:替换投影子集,禁止写 authority(除非 preserveAuthority)。 */
|
|
1406
1230
|
declare function hydrateWorkflowFromSnapshot(state: WorkflowSessionState, snapshot: WorkflowDisplaySnapshot, options?: HydrateWorkflowSnapshotOptions): WorkflowSessionState;
|
|
1407
1231
|
|
|
1232
|
+
/**
|
|
1233
|
+
* hydrateAskSnapshot.ts — remount SSOT(D39 P2 · A04 §08 P-ASK-CLIENT-REDUCER)
|
|
1234
|
+
* Live 展示由 SessionStore.applyEvent → reducer;本模块仅服务 snapshot hydrate。
|
|
1235
|
+
*
|
|
1236
|
+
* 职责:AskDisplaySnapshot → SessionStoreState 投影子集替换。
|
|
1237
|
+
* 链路:GET /projection/snapshot → SessionStore.hydrateFromSnapshot。
|
|
1238
|
+
*/
|
|
1239
|
+
|
|
1240
|
+
interface HydrateAskSnapshotState {
|
|
1241
|
+
authority: WorkflowAuthoritySnapshot | null;
|
|
1242
|
+
authoritySubscribeFailed: boolean;
|
|
1243
|
+
authorityBindingActive: boolean;
|
|
1244
|
+
}
|
|
1245
|
+
declare function sessionTreeSnapshotToTree(snapshot: SessionTreeSnapshot): SessionTree;
|
|
1246
|
+
/** 冻结算法:替换投影子集;保留 authority 绑定字段。 */
|
|
1247
|
+
declare function hydrateAskFromSnapshot(state: HydrateAskSnapshotState, snapshot: AskDisplaySnapshot): {
|
|
1248
|
+
tree: SessionTree;
|
|
1249
|
+
eventCount: number;
|
|
1250
|
+
projectionCursor: string;
|
|
1251
|
+
snapshotVersion: number;
|
|
1252
|
+
snapshotHydrateFailed: false;
|
|
1253
|
+
reconnectSuppressedReason: null;
|
|
1254
|
+
authority: WorkflowAuthoritySnapshot | null;
|
|
1255
|
+
authoritySubscribeFailed: boolean;
|
|
1256
|
+
authorityBindingActive: boolean;
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* AgentSessionBanners.tsx — snapshot hydrate 失败黄条(D39 P2)
|
|
1261
|
+
*/
|
|
1262
|
+
interface AgentSessionBannersProps {
|
|
1263
|
+
snapshotHydrateFailed: boolean;
|
|
1264
|
+
}
|
|
1265
|
+
declare function AgentSessionBanners({ snapshotHydrateFailed }: AgentSessionBannersProps): react_jsx_runtime.JSX.Element | null;
|
|
1266
|
+
|
|
1408
1267
|
/**
|
|
1409
1268
|
* 职责:事件分级类型(V2-A classify 层公共契约)。
|
|
1410
1269
|
* 链路位置:classify.ts → reducer;AgentSession tierOverrides 传入。
|
|
@@ -1433,4 +1292,4 @@ interface ClassifyContext {
|
|
|
1433
1292
|
declare function resolveEventTier(eventType: string, overrides?: TierOverrides): EventTier;
|
|
1434
1293
|
declare function classifyEvent(event: LangchainAgentEvent, ctx: ClassifyContext, overrides?: TierOverrides, eventIndex?: number): ClassifiedEvent;
|
|
1435
1294
|
|
|
1436
|
-
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, 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, 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,
|
|
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 };
|