langchain_agentx_stream_ui 0.5.0 → 0.6.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/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  fixDiagramSvg,
24
24
  markEventIdSeen,
25
25
  shouldSkipDuplicateEvent
26
- } from "./chunk-ME5T6YSV.js";
26
+ } from "./chunk-4OISGUFR.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-TCKOXX7O.js";
36
- import "./chunk-6Z4ZF36Z.js";
35
+ } from "./chunk-4TG4TGIL.js";
36
+ import "./chunk-DP7V33X7.js";
37
37
  import {
38
38
  CollapseKind,
39
39
  CollapsedExploreNode,
@@ -119,8 +119,10 @@ import {
119
119
  useSessionStatus,
120
120
  useSessionViewOptions,
121
121
  useTimeline
122
- } from "./chunk-JAOJAGMM.js";
122
+ } from "./chunk-RYUOZTUI.js";
123
123
  import {
124
+ AGENT_PROGRESS_GUTTER,
125
+ AGENT_PROGRESS_INDENT,
124
126
  Agent,
125
127
  AgentToolBody,
126
128
  AskUserQuestion,
@@ -147,7 +149,7 @@ import {
147
149
  createDefaultToolRegistry,
148
150
  formatAgentTitle,
149
151
  formatExploreSummaryText
150
- } from "./chunk-FL2G7SV3.js";
152
+ } from "./chunk-ZR37OKV6.js";
151
153
  import {
152
154
  BodyBlockList,
153
155
  DiffView,
@@ -163,7 +165,7 @@ import {
163
165
  formatTimeoutFooter,
164
166
  parseDiffText,
165
167
  truncateCommand
166
- } from "./chunk-GBY5DJ7L.js";
168
+ } from "./chunk-4RIOBLGB.js";
167
169
 
168
170
  // src/view/AgentSession.tsx
169
171
  import { useEffect as useEffect3, useMemo, useRef as useRef3 } from "react";
@@ -3660,55 +3662,15 @@ function WorkflowContainerLine({
3660
3662
  return /* @__PURE__ */ jsx5("div", { className: lineClass, style, children: content });
3661
3663
  }
3662
3664
 
3663
- // src/view/workflow/WorkflowExpandTrigger.tsx
3664
- import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
3665
- function WorkflowExpandTrigger({
3666
- summary,
3667
- summaryTestId,
3668
- teaser,
3669
- expandHint,
3670
- onToggle,
3671
- expanded = false,
3672
- testId,
3673
- teaserTestId,
3674
- className = ""
3675
- }) {
3676
- return /* @__PURE__ */ jsxs3(
3677
- "button",
3678
- {
3679
- type: "button",
3680
- className: `lax-workflow-expand-trigger${className ? ` ${className}` : ""}`,
3681
- onClick: onToggle,
3682
- "aria-expanded": expanded,
3683
- "data-testid": testId,
3684
- children: [
3685
- /* @__PURE__ */ jsxs3("span", { className: "lax-workflow-expand-trigger__summary", "data-testid": summaryTestId, children: [
3686
- "\u23BF ",
3687
- summary
3688
- ] }),
3689
- teaser ? /* @__PURE__ */ jsx6(
3690
- "span",
3691
- {
3692
- className: "lax-workflow-expand-trigger__teaser",
3693
- "data-testid": teaserTestId,
3694
- children: teaser
3695
- }
3696
- ) : null,
3697
- expandHint ? /* @__PURE__ */ jsx6("span", { className: "lax-workflow-expand-trigger__hint", children: expandHint }) : null
3698
- ]
3699
- }
3700
- );
3701
- }
3702
-
3703
3665
  // src/view/workflow/WorkflowMarkdownPreview.tsx
3704
- import { jsx as jsx7 } from "react/jsx-runtime";
3666
+ import { jsx as jsx6 } from "react/jsx-runtime";
3705
3667
  function WorkflowMarkdownPreview({
3706
3668
  content,
3707
3669
  testId,
3708
3670
  className = "lax-workflow-markdown-preview"
3709
3671
  }) {
3710
3672
  if (!content.trim()) return null;
3711
- return /* @__PURE__ */ jsx7("div", { className, "data-testid": testId, children: /* @__PURE__ */ jsx7(RichMarkdown, { content, deferDiagrams: true }) });
3673
+ return /* @__PURE__ */ jsx6("div", { className, "data-testid": testId, children: /* @__PURE__ */ jsx6(RichMarkdown, { content, deferDiagrams: true }) });
3712
3674
  }
3713
3675
 
3714
3676
  // src/core/workflow/loopTreeUtils.ts
@@ -3718,7 +3680,7 @@ function hasTimelineNodes(tree) {
3718
3680
  }
3719
3681
 
3720
3682
  // src/view/workflow/workflowStageDoneBody.tsx
3721
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
3683
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
3722
3684
  function WorkflowStageDoneBody({
3723
3685
  loopTree,
3724
3686
  testId,
@@ -3728,7 +3690,7 @@ function WorkflowStageDoneBody({
3728
3690
  bodyClassName = "lax-workflow-stage-container__body"
3729
3691
  }) {
3730
3692
  if (loopTree && hasTimelineNodes(loopTree)) {
3731
- return /* @__PURE__ */ jsx8("div", { className: bodyClassName, "data-testid": testId, "data-loop-display": "full", children: /* @__PURE__ */ jsx8(
3693
+ return /* @__PURE__ */ jsx7("div", { className: bodyClassName, "data-testid": testId, "data-loop-display": "full", children: /* @__PURE__ */ jsx7(
3732
3694
  AgentLoopView,
3733
3695
  {
3734
3696
  tree: loopTree,
@@ -3739,12 +3701,12 @@ function WorkflowStageDoneBody({
3739
3701
  }
3740
3702
  ) });
3741
3703
  }
3742
- return /* @__PURE__ */ jsx8(
3704
+ return /* @__PURE__ */ jsx7(
3743
3705
  "div",
3744
3706
  {
3745
3707
  className: `${bodyClassName} lax-workflow-stage-container__empty-hint`,
3746
3708
  "data-testid": testId,
3747
- children: /* @__PURE__ */ jsx8("span", { className: "lax-workflow-stage-container__empty-hint-text", children: "\uFF08\u6B64\u9636\u6BB5\u6682\u65E0 Agent \u65F6\u95F4\u7EBF\u5185\u5BB9\uFF09" })
3709
+ children: /* @__PURE__ */ jsx7("span", { className: "lax-workflow-stage-container__empty-hint-text", children: "\uFF08\u6B64\u9636\u6BB5\u6682\u65E0 Agent \u65F6\u95F4\u7EBF\u5185\u5BB9\uFF09" })
3748
3710
  }
3749
3711
  );
3750
3712
  }
@@ -3755,22 +3717,22 @@ function WorkflowStageSummaryOnlyBody({
3755
3717
  bodyClassName = "lax-workflow-stage-container__body lax-workflow-stage-container__body--summary-only"
3756
3718
  }) {
3757
3719
  const expandHint = formatTeaserExpandHint(summary.extraLines, verbose);
3758
- return /* @__PURE__ */ jsxs4(
3720
+ return /* @__PURE__ */ jsxs3(
3759
3721
  "div",
3760
3722
  {
3761
3723
  className: bodyClassName,
3762
3724
  "data-testid": testId,
3763
3725
  "data-loop-display": "summary",
3764
3726
  children: [
3765
- summary.teaser ? /* @__PURE__ */ jsx8(
3727
+ summary.teaser ? /* @__PURE__ */ jsx7(
3766
3728
  WorkflowMarkdownPreview,
3767
3729
  {
3768
3730
  content: summary.teaser,
3769
3731
  className: "lax-workflow-stage-container__teaser",
3770
3732
  testId: `${testId}-summary-teaser`
3771
3733
  }
3772
- ) : /* @__PURE__ */ jsx8("span", { className: "lax-workflow-stage-container__empty-hint-text", children: WORKFLOW_STAGE_EMPTY_SUMMARY_HINT }),
3773
- expandHint ? /* @__PURE__ */ jsx8("span", { className: "lax-workflow-expand-trigger__hint", children: expandHint }) : null
3734
+ ) : /* @__PURE__ */ jsx7("span", { className: "lax-workflow-stage-container__empty-hint-text", children: WORKFLOW_STAGE_EMPTY_SUMMARY_HINT }),
3735
+ expandHint ? /* @__PURE__ */ jsx7("span", { className: "lax-workflow-stage-container__done-teaser-hint", children: expandHint }) : null
3774
3736
  ]
3775
3737
  }
3776
3738
  );
@@ -4018,7 +3980,7 @@ function workflowContainerViewPropsEqual(prev, next) {
4018
3980
  }
4019
3981
 
4020
3982
  // src/view/workflow/WorkflowAggregateContainer.tsx
4021
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
3983
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
4022
3984
  function mergeContentPreview(node) {
4023
3985
  const blocks = node.content_blocks;
4024
3986
  if (blocks.length === 0) return "";
@@ -4082,7 +4044,7 @@ function WorkflowAggregateContainerInner({
4082
4044
  setExpanded((prev) => !prev);
4083
4045
  }, []);
4084
4046
  const shellToggle = isRunning ? toggleExpanded : isDone ? toggleExpanded : void 0;
4085
- const markdownPreview = bodyMarkdown ? /* @__PURE__ */ jsx9(
4047
+ const markdownPreview = bodyMarkdown ? /* @__PURE__ */ jsx8(
4086
4048
  WorkflowMarkdownPreview,
4087
4049
  {
4088
4050
  content: bodyMarkdown,
@@ -4091,7 +4053,8 @@ function WorkflowAggregateContainerInner({
4091
4053
  }
4092
4054
  ) : null;
4093
4055
  const canExpandDone = isDone && (Boolean(loopTree) || Boolean(bodyMarkdown) || Boolean(node.loopSessionId));
4094
- return /* @__PURE__ */ jsxs5(
4056
+ const doneExpandHint = expandHint ?? (canExpandDone ? "(click to expand)" : null);
4057
+ return /* @__PURE__ */ jsxs4(
4095
4058
  "div",
4096
4059
  {
4097
4060
  className: `lax-workflow-aggregate lax-workflow-stage-container lax-workflow-stage-container--${isWaiting ? "pending" : isDone ? "done" : "running"}`,
@@ -4099,7 +4062,7 @@ function WorkflowAggregateContainerInner({
4099
4062
  "data-container-scope": "aggregate",
4100
4063
  style: { "--lax-workflow-depth": depth },
4101
4064
  children: [
4102
- /* @__PURE__ */ jsx9(
4065
+ /* @__PURE__ */ jsx8(
4103
4066
  WorkflowContainerLine,
4104
4067
  {
4105
4068
  title: node.title,
@@ -4114,17 +4077,31 @@ function WorkflowAggregateContainerInner({
4114
4077
  descriptionTestId: `${testId}-desc`
4115
4078
  }
4116
4079
  ),
4117
- isWaiting && waitingTeaser ? /* @__PURE__ */ jsxs5("div", { className: "lax-workflow-aggregate__waiting-teaser", "data-testid": `${testId}-waiting`, children: [
4118
- /* @__PURE__ */ jsx9("span", { className: "lax-workflow-aggregate__waiting-prefix", children: "\u23BF " }),
4119
- /* @__PURE__ */ jsx9(
4120
- WorkflowMarkdownPreview,
4121
- {
4122
- content: waitingTeaser,
4123
- className: "lax-workflow-aggregate__markdown lax-workflow-markdown-preview"
4124
- }
4125
- )
4126
- ] }) : null,
4127
- expanded && isRunning && loopTree ? /* @__PURE__ */ jsx9("div", { className: "lax-workflow-stage-container__body", "data-testid": `${testId}-body`, children: /* @__PURE__ */ jsx9(
4080
+ isWaiting && waitingTeaser ? /* @__PURE__ */ jsxs4(
4081
+ "div",
4082
+ {
4083
+ className: "lax-workflow-stage-container__done-teaser",
4084
+ "data-testid": `${testId}-waiting`,
4085
+ children: [
4086
+ /* @__PURE__ */ jsx8(
4087
+ "span",
4088
+ {
4089
+ className: "lax-workflow-stage-container__done-teaser-prefix",
4090
+ "aria-hidden": true,
4091
+ children: AGENT_PROGRESS_GUTTER
4092
+ }
4093
+ ),
4094
+ /* @__PURE__ */ jsx8("div", { className: "lax-workflow-stage-container__done-teaser-body", children: /* @__PURE__ */ jsx8(
4095
+ WorkflowMarkdownPreview,
4096
+ {
4097
+ content: waitingTeaser,
4098
+ className: "lax-workflow-stage-container__done-teaser-markdown"
4099
+ }
4100
+ ) })
4101
+ ]
4102
+ }
4103
+ ) : null,
4104
+ expanded && isRunning && loopTree ? /* @__PURE__ */ jsx8("div", { className: "lax-workflow-stage-container__body", "data-testid": `${testId}-body`, children: /* @__PURE__ */ jsx8(
4128
4105
  AgentLoopView,
4129
4106
  {
4130
4107
  tree: loopTree,
@@ -4134,7 +4111,7 @@ function WorkflowAggregateContainerInner({
4134
4111
  groupParallelTools
4135
4112
  }
4136
4113
  ) }) : null,
4137
- expanded && isRunning && !loopTree && bodyMarkdown ? /* @__PURE__ */ jsx9(
4114
+ expanded && isRunning && !loopTree && bodyMarkdown ? /* @__PURE__ */ jsx8(
4138
4115
  "div",
4139
4116
  {
4140
4117
  className: "lax-workflow-stage-container__body lax-workflow-stage-container__content-preview",
@@ -4142,21 +4119,35 @@ function WorkflowAggregateContainerInner({
4142
4119
  children: markdownPreview
4143
4120
  }
4144
4121
  ) : null,
4145
- isDone && !expanded ? /* @__PURE__ */ jsxs5("div", { className: "lax-workflow-aggregate__done", "data-testid": `${testId}-done`, children: [
4146
- canExpandDone ? /* @__PURE__ */ jsx9(
4147
- WorkflowExpandTrigger,
4148
- {
4149
- summary: `${node.title} \xB7 done`,
4150
- onToggle: toggleExpanded,
4151
- expanded: false,
4152
- expandHint: bodyMarkdown || expandHint ? "(click to expand)" : void 0,
4153
- testId: `${testId}-done-trigger`
4154
- }
4155
- ) : null,
4156
- markdownPreview ? /* @__PURE__ */ jsx9("div", { className: "lax-workflow-aggregate__done-preview", "data-testid": `${testId}-teaser`, children: markdownPreview }) : null,
4157
- !bodyMarkdown && expandHint ? /* @__PURE__ */ jsx9("span", { className: "lax-workflow-expand-trigger__hint", children: expandHint }) : null
4158
- ] }) : null,
4159
- isDone && expanded ? loopTree ? /* @__PURE__ */ jsx9(
4122
+ isDone && !expanded && (bodyMarkdown || doneExpandHint) ? /* @__PURE__ */ jsx8("div", { "data-testid": `${testId}-done`, children: /* @__PURE__ */ jsxs4(
4123
+ "div",
4124
+ {
4125
+ className: "lax-workflow-stage-container__done-teaser",
4126
+ "data-testid": bodyMarkdown ? `${testId}-teaser` : void 0,
4127
+ children: [
4128
+ /* @__PURE__ */ jsx8(
4129
+ "span",
4130
+ {
4131
+ className: "lax-workflow-stage-container__done-teaser-prefix",
4132
+ "aria-hidden": true,
4133
+ children: bodyMarkdown ? AGENT_PROGRESS_GUTTER : AGENT_PROGRESS_INDENT
4134
+ }
4135
+ ),
4136
+ /* @__PURE__ */ jsxs4("div", { className: "lax-workflow-stage-container__done-teaser-body", children: [
4137
+ bodyMarkdown ? /* @__PURE__ */ jsx8(
4138
+ WorkflowMarkdownPreview,
4139
+ {
4140
+ content: bodyMarkdown,
4141
+ testId: `${testId}-markdown`,
4142
+ className: "lax-workflow-stage-container__done-teaser-markdown"
4143
+ }
4144
+ ) : null,
4145
+ doneExpandHint ? /* @__PURE__ */ jsx8("span", { className: "lax-workflow-stage-container__done-teaser-hint", children: doneExpandHint }) : null
4146
+ ] })
4147
+ ]
4148
+ }
4149
+ ) }) : null,
4150
+ isDone && expanded ? loopTree ? /* @__PURE__ */ jsx8(
4160
4151
  WorkflowStageDoneBody,
4161
4152
  {
4162
4153
  node,
@@ -4166,19 +4157,19 @@ function WorkflowAggregateContainerInner({
4166
4157
  virtualizeThreshold,
4167
4158
  groupParallelTools
4168
4159
  }
4169
- ) : bodyMarkdown ? /* @__PURE__ */ jsx9(
4160
+ ) : bodyMarkdown ? /* @__PURE__ */ jsx8(
4170
4161
  "div",
4171
4162
  {
4172
4163
  className: "lax-workflow-stage-container__body lax-workflow-stage-container__content-preview",
4173
4164
  "data-testid": `${testId}-body`,
4174
4165
  children: markdownPreview
4175
4166
  }
4176
- ) : usesScopedLoop ? /* @__PURE__ */ jsx9(
4167
+ ) : usesScopedLoop ? /* @__PURE__ */ jsx8(
4177
4168
  "div",
4178
4169
  {
4179
4170
  className: "lax-workflow-stage-container__body lax-workflow-loop-replay-pending",
4180
4171
  "data-testid": `${testId}-body`,
4181
- children: /* @__PURE__ */ jsx9("p", { className: "lax-workflow-loop-replay-pending__hint", children: "Loop details evicted from memory." })
4172
+ children: /* @__PURE__ */ jsx8("p", { className: "lax-workflow-loop-replay-pending__hint", children: "Loop details evicted from memory." })
4182
4173
  }
4183
4174
  ) : null : null
4184
4175
  ]
@@ -4295,6 +4286,53 @@ function formatParallelGroupSummary(metrics) {
4295
4286
  return `Done (${n} agent${n === 1 ? "" : "s"})`;
4296
4287
  }
4297
4288
 
4289
+ // src/view/workflow/WorkflowExpandTrigger.tsx
4290
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
4291
+ function WorkflowExpandTrigger({
4292
+ summary,
4293
+ summaryTestId,
4294
+ teaser,
4295
+ expandHint,
4296
+ onToggle,
4297
+ expanded = false,
4298
+ testId,
4299
+ teaserTestId,
4300
+ className = ""
4301
+ }) {
4302
+ return /* @__PURE__ */ jsx9(
4303
+ "button",
4304
+ {
4305
+ type: "button",
4306
+ className: `lax-workflow-expand-trigger${className ? ` ${className}` : ""}`,
4307
+ onClick: onToggle,
4308
+ "aria-expanded": expanded,
4309
+ "data-testid": testId,
4310
+ children: /* @__PURE__ */ jsxs5("span", { className: "lax-workflow-expand-trigger__hang", children: [
4311
+ /* @__PURE__ */ jsx9("span", { className: "lax-workflow-expand-trigger__prefix", "aria-hidden": true, children: AGENT_PROGRESS_GUTTER }),
4312
+ /* @__PURE__ */ jsxs5("span", { className: "lax-workflow-expand-trigger__body", children: [
4313
+ /* @__PURE__ */ jsx9(
4314
+ "span",
4315
+ {
4316
+ className: "lax-workflow-expand-trigger__summary",
4317
+ "data-testid": summaryTestId,
4318
+ children: summary
4319
+ }
4320
+ ),
4321
+ teaser ? /* @__PURE__ */ jsx9(
4322
+ "span",
4323
+ {
4324
+ className: "lax-workflow-expand-trigger__teaser",
4325
+ "data-testid": teaserTestId,
4326
+ children: teaser
4327
+ }
4328
+ ) : null,
4329
+ expandHint ? /* @__PURE__ */ jsx9("span", { className: "lax-workflow-expand-trigger__hint", children: expandHint }) : null
4330
+ ] })
4331
+ ] })
4332
+ }
4333
+ );
4334
+ }
4335
+
4298
4336
  // src/view/workflow/WorkflowStageContainer.tsx
4299
4337
  import { useCallback as useCallback2, useEffect as useEffect7, useMemo as useMemo3, useState as useState2, memo as memo2 } from "react";
4300
4338
  import { useStore as useStore4 } from "zustand";
@@ -4410,26 +4448,33 @@ function WorkflowStageContainerInner({
4410
4448
  className: isItem ? "lax-workflow-parallel-item__header" : void 0
4411
4449
  }
4412
4450
  ),
4413
- effectivelyDone && !expanded && (teaserText || expandHint) ? /* @__PURE__ */ jsxs6("div", { className: "lax-workflow-stage-container__done-teaser", children: [
4414
- teaserText ? /* @__PURE__ */ jsxs6(
4415
- "div",
4416
- {
4417
- className: "lax-workflow-stage-container__done-teaser-line",
4418
- "data-testid": `${testId}-teaser`,
4419
- children: [
4420
- /* @__PURE__ */ jsx10("span", { className: "lax-workflow-stage-container__done-teaser-prefix", children: "\u23BF" }),
4421
- /* @__PURE__ */ jsx10(
4451
+ effectivelyDone && !expanded && (teaserText || expandHint) ? /* @__PURE__ */ jsxs6(
4452
+ "div",
4453
+ {
4454
+ className: "lax-workflow-stage-container__done-teaser",
4455
+ "data-testid": teaserText ? `${testId}-teaser` : void 0,
4456
+ children: [
4457
+ /* @__PURE__ */ jsx10(
4458
+ "span",
4459
+ {
4460
+ className: "lax-workflow-stage-container__done-teaser-prefix",
4461
+ "aria-hidden": true,
4462
+ children: teaserText ? AGENT_PROGRESS_GUTTER : AGENT_PROGRESS_INDENT
4463
+ }
4464
+ ),
4465
+ /* @__PURE__ */ jsxs6("div", { className: "lax-workflow-stage-container__done-teaser-body", children: [
4466
+ teaserText ? /* @__PURE__ */ jsx10(
4422
4467
  WorkflowMarkdownPreview,
4423
4468
  {
4424
4469
  content: teaserText,
4425
4470
  className: "lax-workflow-stage-container__done-teaser-markdown"
4426
4471
  }
4427
- )
4428
- ]
4429
- }
4430
- ) : null,
4431
- expandHint ? /* @__PURE__ */ jsx10("span", { className: "lax-workflow-expand-trigger__hint", children: expandHint }) : null
4432
- ] }) : null,
4472
+ ) : null,
4473
+ expandHint ? /* @__PURE__ */ jsx10("span", { className: "lax-workflow-stage-container__done-teaser-hint", children: expandHint }) : null
4474
+ ] })
4475
+ ]
4476
+ }
4477
+ ) : null,
4433
4478
  expanded && isRunning && !usesScopedLoop && node.content_blocks.length > 0 ? /* @__PURE__ */ jsx10(
4434
4479
  "div",
4435
4480
  {