@blade-hq/agent-kit 1.0.21 → 1.0.22
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/{chunk-MPGRAWLS.js → chunk-2QYV43YP.js} +2 -2
- package/dist/{chunk-O4TRZMGD.js → chunk-BQKF6HJH.js} +3 -3
- package/dist/{chunk-XEKYDE2R.js → chunk-ICV7OTGX.js} +126 -25
- package/dist/{chunk-XEKYDE2R.js.map → chunk-ICV7OTGX.js.map} +1 -1
- package/dist/{chunk-YVAP7QQ7.js → chunk-IMMRWXI7.js} +51 -2
- package/dist/chunk-IMMRWXI7.js.map +1 -0
- package/dist/{chunk-3S5Z6J7V.js → chunk-TYM7KL2L.js} +2 -2
- package/dist/react/api/vibe-coding.js +1 -1
- package/dist/react/components/chat/index.js +4 -4
- package/dist/react/components/plan/index.js +3 -3
- package/dist/react/components/session/index.js +2 -2
- package/dist/react/components/workspace/index.js +2 -2
- package/dist/react/index.d.ts +7 -1
- package/dist/react/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-YVAP7QQ7.js.map +0 -1
- /package/dist/{chunk-MPGRAWLS.js.map → chunk-2QYV43YP.js.map} +0 -0
- /package/dist/{chunk-O4TRZMGD.js.map → chunk-BQKF6HJH.js.map} +0 -0
- /package/dist/{chunk-3S5Z6J7V.js.map → chunk-TYM7KL2L.js.map} +0 -0
|
@@ -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
|
|
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-
|
|
4602
|
+
//# sourceMappingURL=chunk-IMMRWXI7.js.map
|