@blade-hq/agent-kit 1.0.21 → 1.0.23

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.
@@ -636,9 +636,44 @@ function applyToolResult(state, toolCallId, result, status, durationMs, sourceLo
636
636
  displayName = tc.display_name;
637
637
  break;
638
638
  }
639
+ upsertToolResultBlock(state, toolCallId, finalResult, toolName, displayName);
640
+ }
641
+ function appendToolResultDelta(state, toolCallId, delta) {
642
+ if (!toolCallId || !delta) return;
643
+ let toolName = "";
644
+ let displayName = "";
645
+ let currentResult = "";
646
+ for (let i = 0; i < state.toolCalls.length; i++) {
647
+ const tc = state.toolCalls[i];
648
+ if (tc.id !== toolCallId) continue;
649
+ toolName = tc.tool_name;
650
+ displayName = tc.display_name;
651
+ if (typeof tc.result === "string") currentResult = tc.result;
652
+ state.toolCalls[i] = { ...tc, result: currentResult + delta };
653
+ break;
654
+ }
655
+ for (const block of state.blocks) {
656
+ if (block.type !== "tool_result" || block.tool_call_id !== toolCallId) continue;
657
+ if (typeof block.content === "string") currentResult = block.content;
658
+ break;
659
+ }
660
+ upsertToolResultBlock(state, toolCallId, currentResult + delta, toolName, displayName);
661
+ }
662
+ function upsertToolResultBlock(state, toolCallId, content, toolName, displayName) {
663
+ for (let i = 0; i < state.blocks.length; i++) {
664
+ const block = state.blocks[i];
665
+ if (block.type !== "tool_result" || block.tool_call_id !== toolCallId) continue;
666
+ state.blocks[i] = {
667
+ ...block,
668
+ content,
669
+ tool_name: toolName || block.tool_name,
670
+ display_name: displayName || block.display_name
671
+ };
672
+ return;
673
+ }
639
674
  state.blocks.push({
640
675
  type: "tool_result",
641
- content: finalResult,
676
+ content,
642
677
  tool_call_id: toolCallId,
643
678
  tool_name: toolName || null,
644
679
  display_name: displayName || null
@@ -1099,6 +1134,8 @@ var ClientProjectionBuilder = class {
1099
1134
  return this.onToolCallCreated(state, payload);
1100
1135
  case "llm:response:done":
1101
1136
  return this.onResponseDone(state, loopId, payload);
1137
+ case "tool:result:delta":
1138
+ return this.onToolResultDelta(state, payload);
1102
1139
  case "tool:result:done":
1103
1140
  return this.onToolResultDone(state, loopId, payload);
1104
1141
  case "loop:tool_ui":
@@ -1365,6 +1402,14 @@ var ClientProjectionBuilder = class {
1365
1402
  }
1366
1403
  return this.syncPatch(state);
1367
1404
  }
1405
+ onToolResultDelta(state, payload) {
1406
+ appendToolResultDelta(
1407
+ state,
1408
+ String(payload.tool_call_id ?? ""),
1409
+ String(payload.content ?? "")
1410
+ );
1411
+ return this.syncPatch(state);
1412
+ }
1368
1413
  onToolUi(state, payload) {
1369
1414
  const toolCallId = String(payload.tool_call_id ?? "");
1370
1415
  const ui = payload.ui;
@@ -1878,6 +1923,10 @@ function getToolDisplayLabel(toolCall) {
1878
1923
  if (normalized === "BgBash") {
1879
1924
  return description ? `\u540E\u53F0\u6267\u884C\uFF1A${description}` : "\u540E\u53F0\u6267\u884C\u547D\u4EE4";
1880
1925
  }
1926
+ if (normalized === "ReadSkill") {
1927
+ const skillName = getStringArgValue(args, "skill") || getStringArgValue(args, "skill_name");
1928
+ return skillName ? `${baseLabel}\u300C${skillName}\u300D` : baseLabel;
1929
+ }
1881
1930
  if (normalized === "FinishTask") {
1882
1931
  const title = args && typeof args.title === "string" ? args.title : "";
1883
1932
  return title ? `${baseLabel}\uFF1A${title}` : baseLabel;
@@ -4550,4 +4599,4 @@ export {
4550
4599
  bootstrapBladeClient,
4551
4600
  getBootstrappedClient
4552
4601
  };
4553
- //# sourceMappingURL=chunk-YVAP7QQ7.js.map
4602
+ //# sourceMappingURL=chunk-IMMRWXI7.js.map