@wrongstack/tui 0.281.0 → 0.281.3

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
@@ -19303,10 +19303,15 @@ Available chords:
19303
19303
  }
19304
19304
  });
19305
19305
  }
19306
+ const assistantEntriesBeforeRun = stateRef.current.entries.filter(
19307
+ (entry) => entry.kind === "assistant"
19308
+ ).length;
19306
19309
  const result = await agent.run(routed.blocks, { signal: ctrl.signal });
19307
19310
  const lingering = streamingTextRef.current;
19308
19311
  if (lingering.trim()) {
19309
19312
  dispatch({ type: "addEntry", entry: { kind: "assistant", text: lingering } });
19313
+ } else if (result.status === "done" && result.finalText?.trim() && stateRef.current.entries.filter((entry) => entry.kind === "assistant").length === assistantEntriesBeforeRun) {
19314
+ dispatch({ type: "addEntry", entry: { kind: "assistant", text: result.finalText } });
19310
19315
  }
19311
19316
  streamingTextRef.current = "";
19312
19317
  pendingDeltaRef.current = "";