langchain_agentx_stream_ui 0.7.0 → 0.7.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.
@@ -85,8 +85,8 @@ var DEFAULT_EVENT_TIERS = {
85
85
  "hook-finished": "debug",
86
86
  "api-retry": "debug",
87
87
  "assistant-turn-superseded": "main",
88
- "compact-start": "debug",
89
- "compact-end": "debug",
88
+ /** D-CMP-EVT-11:主可见(非仅 debug);淡提示 Conversation compacted */
89
+ "compact-boundary": "collapsed",
90
90
  "task-started": "debug",
91
91
  "task-progress": "debug",
92
92
  "task-notification-enqueued": "debug",
@@ -1062,6 +1062,7 @@ function flushDeferredMainTextToTree(tree, event, seq) {
1062
1062
  const text = flushDeferredMainText(tree.deferredMainText);
1063
1063
  tree.deferredMainText = "";
1064
1064
  if (!text) return;
1065
+ clearModelRetry(tree);
1065
1066
  const id = `text:defer-${seq}`;
1066
1067
  const node = {
1067
1068
  kind: "text",
@@ -1606,12 +1607,20 @@ function attachDebugToParent(tree, parentNodeId, event) {
1606
1607
  }
1607
1608
  var SYSTEM_SUMMARY_SOURCE_EVENTS = /* @__PURE__ */ new Set([
1608
1609
  "hook-finished",
1609
- "compact-start",
1610
- "compact-end"
1610
+ "compact-boundary"
1611
1611
  ]);
1612
1612
  function isSystemSummarySourceEvent(eventType) {
1613
1613
  return SYSTEM_SUMMARY_SOURCE_EVENTS.has(eventType);
1614
1614
  }
1615
+ function pushSystemSummarySource(tree, event, eventIndex) {
1616
+ if (!isSystemSummarySourceEvent(event.event_type)) return;
1617
+ tree.systemEvents.push({
1618
+ eventIndex,
1619
+ eventType: event.event_type,
1620
+ data: event.data,
1621
+ timestamp: eventTimeToMs(event.timestamp)
1622
+ });
1623
+ }
1615
1624
  function handleDebug(tree, event, eventIndex, parentNodeId, collectDebug) {
1616
1625
  if (TASK_DEBUG_EVENT_TYPES.has(event.event_type)) {
1617
1626
  appendTaskDebugEvent(tree, event, eventIndex);
@@ -1627,14 +1636,7 @@ function handleDebug(tree, event, eventIndex, parentNodeId, collectDebug) {
1627
1636
  handleHookFinished(tree, event);
1628
1637
  break;
1629
1638
  }
1630
- if (isSystemSummarySourceEvent(event.event_type)) {
1631
- tree.systemEvents.push({
1632
- eventIndex,
1633
- eventType: event.event_type,
1634
- data: event.data,
1635
- timestamp: eventTimeToMs(event.timestamp)
1636
- });
1637
- }
1639
+ pushSystemSummarySource(tree, event, eventIndex);
1638
1640
  if (collectDebug && !TASK_DEBUG_EVENT_TYPES.has(event.event_type)) {
1639
1641
  tree.debugEvents.push({
1640
1642
  eventIndex,
@@ -1776,6 +1778,17 @@ function applyClassified(tree, classified, eventIndex, options) {
1776
1778
  case "task-notification":
1777
1779
  handleTaskNotification(tree, event);
1778
1780
  break;
1781
+ case "compact-boundary":
1782
+ pushSystemSummarySource(tree, event, eventIndex);
1783
+ if (options?.collectDebug === true) {
1784
+ tree.debugEvents.push({
1785
+ eventIndex,
1786
+ eventType: event.event_type,
1787
+ data: event.data
1788
+ });
1789
+ }
1790
+ attachDebugToParent(tree, parentNodeId, event);
1791
+ break;
1779
1792
  case "start-step":
1780
1793
  handleStepStart(tree, event, parentNodeId, seq);
1781
1794
  break;
@@ -1859,6 +1872,7 @@ function applyClassified(tree, classified, eventIndex, options) {
1859
1872
  const softKind = classifyToolCancelSoftKind(
1860
1873
  extractToolCancelSignals(data)
1861
1874
  );
1875
+ clearModelRetry(tree);
1862
1876
  const id = `error:${seq}`;
1863
1877
  const node = {
1864
1878
  kind: "error",
@@ -2695,6 +2709,8 @@ function formatSystemEventSummary(eventType, data) {
2695
2709
  switch (eventType) {
2696
2710
  case "hook-finished":
2697
2711
  return formatHookFinishedSummary(payload);
2712
+ case "compact-boundary":
2713
+ return "Conversation compacted";
2698
2714
  default:
2699
2715
  return null;
2700
2716
  }
@@ -2709,9 +2725,6 @@ function mergeSystemSummaryLines(lines) {
2709
2725
  function summarizeSystemEvents(events) {
2710
2726
  const lines = [];
2711
2727
  for (const evt of events) {
2712
- if (evt.eventType === "compact-start" || evt.eventType === "compact-end") {
2713
- continue;
2714
- }
2715
2728
  if (evt.eventType === "hook-finished" && isRecord3(evt.data) && !isHookVisibleInTimeline(evt.data)) {
2716
2729
  continue;
2717
2730
  }
@@ -2818,6 +2831,7 @@ var ExploreCollapseAccumulator = class {
2818
2831
  continue;
2819
2832
  }
2820
2833
  if (entry.kind === "node" && entry.payload.canonicalType === "compact") {
2834
+ result.push(entry);
2821
2835
  continue;
2822
2836
  }
2823
2837
  if (entry.kind === "node" && entry.payload.canonicalType === "hook") {
@@ -3260,7 +3274,8 @@ function toolUseEntry(entry) {
3260
3274
  if (!isGroupableToolName(toolName)) return null;
3261
3275
  const toolCallId = readPayloadString2(payload, "tool_call_id") ?? entry.sourceNodeIds[0] ?? "";
3262
3276
  if (!toolCallId) return null;
3263
- const messageId = readPayloadString2(payload, "message_id") ?? readPayloadString2(payload, "response_id") ?? "default";
3277
+ const messageId = readPayloadString2(payload, "message_id") ?? readPayloadString2(payload, "response_id");
3278
+ if (!messageId) return null;
3264
3279
  return {
3265
3280
  entry,
3266
3281
  toolCallId,
@@ -3908,7 +3923,7 @@ function mapNode(node, pendingPermissionTools) {
3908
3923
  }
3909
3924
  function systemEventCanonicalType(eventType) {
3910
3925
  if (eventType === "hook-finished") return "hook";
3911
- if (eventType === "compact-start" || eventType === "compact-end") return "compact";
3926
+ if (eventType === "compact-boundary") return "compact";
3912
3927
  return null;
3913
3928
  }
3914
3929
  function mapSystemEvent(evt) {
@@ -5903,4 +5918,4 @@ export {
5903
5918
  VirtualTimeline,
5904
5919
  SessionTimeline
5905
5920
  };
5906
- //# sourceMappingURL=chunk-EFJMU4WW.js.map
5921
+ //# sourceMappingURL=chunk-N2OSBCFN.js.map