langchain_agentx_stream_ui 0.8.3 → 0.8.5

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.
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { b as ToolDisplayProps, T as ToolBodyComponent } from './types-CZahMfoe.js';
3
- import { T as ToolDisplayRegistry } from './sessionViewOptions-Il6SnYYB.js';
2
+ import { b as ToolDisplayProps, T as ToolBodyComponent } from './types-Db-2uTSL.js';
3
+ import { T as ToolDisplayRegistry } from './sessionViewOptions-DboYs118.js';
4
4
 
5
5
  declare function DefaultToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
6
6
 
@@ -26,7 +26,7 @@ declare function WebSearchToolBody({ result, bodyMode, onBodyModeChange, }: Tool
26
26
 
27
27
  declare function WebFetchToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
28
28
 
29
- declare function SkillToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
29
+ declare function SkillToolBody({ input, result, bodyMode, onBodyModeChange, status, skillProgressMessages, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
30
30
 
31
31
  declare function AskUserQuestionToolBody({ input, result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
32
32
 
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as ToolBodyMode } from './types-CZahMfoe.js';
2
+ import { a as ToolBodyMode } from './types-Db-2uTSL.js';
3
3
 
4
4
  declare const MAX_PREVIEW_LINES = 3;
5
5
  interface TruncatedContentProps {
@@ -24,7 +24,7 @@ import {
24
24
  resolveHookStoppedMessage,
25
25
  resolveInterruptDisplayText,
26
26
  resolveToolCancelDisplayText
27
- } from "./chunk-Z5EWWIP3.js";
27
+ } from "./chunk-DQVSFHKW.js";
28
28
 
29
29
  // src/types/tree.ts
30
30
  function createEmptyTree() {
@@ -85,6 +85,7 @@ var DEFAULT_EVENT_TIERS = {
85
85
  "subagent-tool-result": "collapsed",
86
86
  "subagent-transcript-message": "collapsed",
87
87
  "subagent-model-step": "collapsed",
88
+ "skill-progress": "collapsed",
88
89
  "hook-progress": "debug",
89
90
  "hook-finished": "debug",
90
91
  "api-retry": "debug",
@@ -152,6 +153,8 @@ function classifyEvent(event, ctx, overrides, eventIndex = 0) {
152
153
  if (tier === "collapsed") {
153
154
  if (isSubagentFoldEvent(event)) {
154
155
  parentNodeId = resolveAgentToolParentId(event);
156
+ } else if (event.event_type === "skill-progress") {
157
+ parentNodeId = resolveAgentToolParentId(event);
155
158
  } else if (event.event_type.startsWith("tool-") || event.event_type === "start-step" || event.event_type === "finish-step") {
156
159
  parentNodeId = resolveToolParentId(event, ctx, eventIndex);
157
160
  }
@@ -766,6 +769,22 @@ function applyTaskNotification(tree, data, endedAt) {
766
769
  return true;
767
770
  }
768
771
 
772
+ // src/core/skillProgress.ts
773
+ function appendSkillProgressMessage(existing, data, seq) {
774
+ return [
775
+ ...existing,
776
+ {
777
+ id: `skill-progress:${seq}`,
778
+ agentId: data.agent_id,
779
+ messageKind: data.message_kind,
780
+ message: data.message,
781
+ step: data.step,
782
+ toolName: data.tool_name,
783
+ prompt: data.prompt
784
+ }
785
+ ];
786
+ }
787
+
769
788
  // src/core/reducer.ts
770
789
  function isInternalTool(toolName) {
771
790
  return INTERNAL_TOOL_NAMES.has(toolName);
@@ -844,6 +863,15 @@ function warnSubagentOrphanParent(eventType, data) {
844
863
  });
845
864
  }
846
865
  }
866
+ function warnSkillProgressOrphan(data, reason) {
867
+ if (import.meta.env?.DEV) {
868
+ console.warn("[langchain_agentx_stream_ui] skill-progress orphan", {
869
+ reason,
870
+ tool_call_id: data.tool_call_id,
871
+ agent_id: data.agent_id
872
+ });
873
+ }
874
+ }
847
875
  function ensureSyntheticAgentToolParent(tree, parentNodeId, event, data) {
848
876
  const existing = tree.byId[parentNodeId];
849
877
  if (existing?.kind === "tool_call") return;
@@ -1680,6 +1708,26 @@ function handleSubagentToolResult(tree, _event, parentNodeId, data) {
1680
1708
  })
1681
1709
  });
1682
1710
  }
1711
+ function handleSkillProgress(tree, event, parentNodeId, seq) {
1712
+ const data = event.data;
1713
+ const parentId = parentNodeId ?? (typeof data.tool_call_id === "string" && data.tool_call_id ? `tool:${data.tool_call_id}` : void 0);
1714
+ if (!parentId) {
1715
+ warnSkillProgressOrphan(data, "missing_parent_id");
1716
+ return;
1717
+ }
1718
+ const tool = tree.byId[parentId];
1719
+ if (tool?.kind !== "tool_call") {
1720
+ warnSkillProgressOrphan(data, "parent_not_tool_call");
1721
+ return;
1722
+ }
1723
+ patchToolNode(tree, parentId, {
1724
+ skillProgressMessages: appendSkillProgressMessage(
1725
+ tool.skillProgressMessages ?? [],
1726
+ data,
1727
+ seq
1728
+ )
1729
+ });
1730
+ }
1683
1731
  function handleSubagentTranscriptMessage(tree, parentNodeId, data) {
1684
1732
  const tool = agentToolNode(tree, parentNodeId);
1685
1733
  if (!tool || !parentNodeId) return;
@@ -1984,6 +2032,9 @@ function applyClassified(tree, classified, eventIndex, options) {
1984
2032
  event.data
1985
2033
  );
1986
2034
  break;
2035
+ case "skill-progress":
2036
+ handleSkillProgress(tree, event, parentNodeId, seq);
2037
+ break;
1987
2038
  case "subagent-model-step":
1988
2039
  break;
1989
2040
  case "task-notification":
@@ -6109,4 +6160,4 @@ export {
6109
6160
  VirtualTimeline,
6110
6161
  SessionTimeline
6111
6162
  };
6112
- //# sourceMappingURL=chunk-I62OIBGA.js.map
6163
+ //# sourceMappingURL=chunk-B4PTD7WI.js.map