@trops/dash-core 0.1.388 → 0.1.389

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.
@@ -51566,24 +51566,38 @@ const cliController$2 = {
51566
51566
  activeToolCalls.set(parsed.index, {
51567
51567
  toolUseId: toolBlock.id,
51568
51568
  toolName: toolBlock.name,
51569
+ // Seed with any input already present on the start event.
51570
+ seedInput: toolBlock.input || {},
51569
51571
  partialInput: "",
51570
51572
  });
51571
- safeSend(win, LLM_STREAM_TOOL_CALL$2, {
51572
- requestId,
51573
- toolUseId: toolBlock.id,
51574
- toolName: toolBlock.name,
51575
- serverName: "Claude Code",
51576
- input: toolBlock.input || {},
51577
- });
51573
+ // Emission deferred to content_block_stop so the renderer
51574
+ // receives the fully-parsed input (the Anthropic streaming
51575
+ // format delivers input as incremental JSON deltas).
51578
51576
  }
51579
51577
  } else if (parsed.type === "content_block_stop") {
51580
- // Tool call completed — try to parse the accumulated input
51578
+ // Tool call completed — parse accumulated input and emit the
51579
+ // single LLM_STREAM_TOOL_CALL for this tool with the real input.
51581
51580
  const tc = activeToolCalls.get(parsed.index);
51582
- if (tc && tc.partialInput) {
51583
- try {
51584
- tc.finalInput = JSON.parse(tc.partialInput);
51585
- } catch {
51586
- tc.finalInput = tc.partialInput;
51581
+ if (tc) {
51582
+ if (tc.partialInput) {
51583
+ try {
51584
+ tc.finalInput = JSON.parse(tc.partialInput);
51585
+ } catch {
51586
+ tc.finalInput = tc.partialInput;
51587
+ }
51588
+ }
51589
+ const resolvedInput =
51590
+ tc.finalInput !== undefined
51591
+ ? tc.finalInput
51592
+ : tc.seedInput || {};
51593
+ if (tc.toolUseId && tc.toolName) {
51594
+ safeSend(win, LLM_STREAM_TOOL_CALL$2, {
51595
+ requestId,
51596
+ toolUseId: tc.toolUseId,
51597
+ toolName: tc.toolName,
51598
+ serverName: "Claude Code",
51599
+ input: resolvedInput,
51600
+ });
51587
51601
  }
51588
51602
  }
51589
51603
  } else if (parsed.type === "message_stop") {