@apteva/apteva-kit 0.1.83 → 0.1.86

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
@@ -1542,10 +1542,8 @@ function ToolCall({ name, status, isReceiving = false, inputLength = 0, streamOu
1542
1542
  ] }),
1543
1543
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "apteva-tool-label", children: [
1544
1544
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: name }),
1545
- streamOutput ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "apteva-tool-stream-output", children: [
1546
- " ",
1547
- streamOutput
1548
- ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1545
+ streamOutput ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "apteva-tool-stream-separator", children: " \xB7 " }) : null,
1546
+ streamOutput ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "apteva-tool-stream-output", children: streamOutput }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1549
1547
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "apteva-tool-status-text", children: " running" }),
1550
1548
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "apteva-tool-dots", children: [
1551
1549
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "." }),
@@ -2993,11 +2991,19 @@ ${widgetContext}` : widgetContext;
2993
2991
  }
2994
2992
  break;
2995
2993
  case "tool_stream":
2996
- if (chunk.tool_id && chunk.event === "chunk" && chunk.content) {
2994
+ if (chunk.tool_id) {
2997
2995
  const toolSegment = contentSegments.find((s) => s.type === "tool" && s.id === chunk.tool_id);
2998
2996
  if (toolSegment) {
2999
- toolSegment.streamOutput = (toolSegment.streamOutput || "") + chunk.content;
3000
- updateMessage();
2997
+ if (chunk.event === "chunk" && chunk.content) {
2998
+ if (toolSegment.pendingReset) {
2999
+ toolSegment.streamOutput = "";
3000
+ toolSegment.pendingReset = false;
3001
+ }
3002
+ toolSegment.streamOutput = (toolSegment.streamOutput || "") + chunk.content;
3003
+ updateMessage();
3004
+ } else if (chunk.event === "log" || chunk.event === "progress") {
3005
+ toolSegment.pendingReset = true;
3006
+ }
3001
3007
  }
3002
3008
  }
3003
3009
  break;