reasonix 0.4.12 → 0.4.13

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.d.ts CHANGED
@@ -489,6 +489,13 @@ declare class ToolRegistry {
489
489
  }
490
490
 
491
491
  type EventRole = "assistant_delta" | "assistant_final"
492
+ /**
493
+ * Emitted as `tool_calls[].function.arguments` streams in. A tool
494
+ * call with a large arguments payload produces no `content` or
495
+ * `reasoning_content` bytes — this is the only signal the UI has
496
+ * that the stream is alive during that window.
497
+ */
498
+ | "tool_call_delta"
492
499
  /**
493
500
  * Yielded immediately before a tool is dispatched. Lets the TUI put
494
501
  * up a "▸ tool<X> running…" spinner while the tool's Promise is
@@ -531,6 +538,8 @@ interface LoopEvent {
531
538
  * what it returned. Needed by `reasonix diff` to explain divergences.
532
539
  */
533
540
  toolArgs?: string;
541
+ /** Cumulative arguments-string length for `role === "tool_call_delta"`. */
542
+ toolCallArgsChars?: number;
534
543
  stats?: TurnStats;
535
544
  planState?: TypedPlanState;
536
545
  repair?: RepairReport;
package/dist/index.js CHANGED
@@ -1561,6 +1561,15 @@ var CacheFirstLoop = class {
1561
1561
  if (d.argumentsDelta)
1562
1562
  cur.function.arguments = (cur.function.arguments ?? "") + d.argumentsDelta;
1563
1563
  callBuf.set(d.index, cur);
1564
+ if (cur.function.name) {
1565
+ yield {
1566
+ turn: this._turn,
1567
+ role: "tool_call_delta",
1568
+ content: "",
1569
+ toolName: cur.function.name,
1570
+ toolCallArgsChars: (cur.function.arguments ?? "").length
1571
+ };
1572
+ }
1564
1573
  }
1565
1574
  if (chunk.usage) usage = chunk.usage;
1566
1575
  }