@agentscope-ai/agentscope 0.0.2 → 0.0.4
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/LICENSE +202 -0
- package/dist/agent/index.d.mts +10 -10
- package/dist/agent/index.d.ts +10 -10
- package/dist/agent/index.js +104 -93
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +104 -93
- package/dist/agent/index.mjs.map +1 -1
- package/dist/{base-BOx3UzOl.d.mts → base-1YVBgB4n.d.mts} +2 -2
- package/dist/{base-DYlBMCy_.d.mts → base-B_MQMHWr.d.mts} +3 -3
- package/dist/{base-Cwi4bjze.d.ts → base-BherSLRs.d.ts} +3 -3
- package/dist/{base-NX-knWOv.d.ts → base-CY4DMBH1.d.ts} +1 -1
- package/dist/{base-BoIps2RL.d.ts → base-ChWjyzPL.d.ts} +2 -2
- package/dist/{base-C7jwyH4Z.d.mts → base-ClilytRZ.d.mts} +1 -1
- package/dist/{block-VsnHrllL.d.mts → block-B72uPF1H.d.mts} +7 -5
- package/dist/{block-VsnHrllL.d.ts → block-B72uPF1H.d.ts} +7 -5
- package/dist/event/index.d.mts +105 -89
- package/dist/event/index.d.ts +105 -89
- package/dist/event/index.js +8 -8
- package/dist/event/index.js.map +1 -1
- package/dist/event/index.mjs +8 -8
- package/dist/event/index.mjs.map +1 -1
- package/dist/formatter/index.d.mts +4 -3
- package/dist/formatter/index.d.ts +4 -3
- package/dist/formatter/index.js +17 -17
- package/dist/formatter/index.js.map +1 -1
- package/dist/formatter/index.mjs +17 -17
- package/dist/formatter/index.mjs.map +1 -1
- package/dist/{index-BcatlwXQ.d.ts → index-BNfyKbQN.d.ts} +1 -1
- package/dist/{index-BTJDlKvQ.d.mts → index-UQCwdfet.d.mts} +1 -1
- package/dist/mcp/index.d.mts +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/index.mjs +1 -1
- package/dist/mcp/index.mjs.map +1 -1
- package/dist/message/index.d.mts +3 -2
- package/dist/message/index.d.ts +3 -2
- package/dist/message/index.js +204 -5
- package/dist/message/index.js.map +1 -1
- package/dist/message/index.mjs +200 -5
- package/dist/message/index.mjs.map +1 -1
- package/dist/message-CPZd0NIc.d.ts +133 -0
- package/dist/message-DgpfAaHK.d.mts +133 -0
- package/dist/model/index.d.mts +6 -5
- package/dist/model/index.d.ts +6 -5
- package/dist/model/index.js +39 -28
- package/dist/model/index.js.map +1 -1
- package/dist/model/index.mjs +39 -28
- package/dist/model/index.mjs.map +1 -1
- package/dist/storage/index.d.mts +4 -3
- package/dist/storage/index.d.ts +4 -3
- package/dist/storage/index.js +4 -4
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/index.mjs +4 -4
- package/dist/storage/index.mjs.map +1 -1
- package/dist/tool/index.d.mts +4 -4
- package/dist/tool/index.d.ts +4 -4
- package/dist/{toolkit-CEpulFi0.d.ts → toolkit-DeOlul5Y.d.ts} +2 -2
- package/dist/{toolkit-CGEZSZPa.d.mts → toolkit-jwe7NmVJ.d.mts} +2 -2
- package/package.json +87 -87
- package/src/agent/agent.test.ts +104 -71
- package/src/agent/agent.ts +112 -104
- package/src/agent/test-compression.ts +1 -1
- package/src/event/index.ts +96 -98
- package/src/formatter/base.ts +3 -3
- package/src/formatter/dashscope-chat-formatter.test.ts +11 -8
- package/src/formatter/dashscope-chat-formatter.ts +3 -3
- package/src/formatter/openai-chat-formatter.test.ts +13 -5
- package/src/formatter/openai-chat-formatter.ts +6 -6
- package/src/mcp/base.ts +1 -1
- package/src/mcp/http.test.ts +2 -0
- package/src/mcp/stdio.test.ts +1 -0
- package/src/message/append-event.test.ts +783 -0
- package/src/message/block.ts +8 -4
- package/src/message/index.ts +12 -1
- package/src/message/message.test.ts +3 -1
- package/src/message/message.ts +310 -47
- package/src/model/dashscope-model.test.ts +4 -0
- package/src/model/dashscope-model.ts +3 -0
- package/src/model/deepseek-model.test.ts +2 -0
- package/src/model/deepseek-model.ts +3 -0
- package/src/model/ollama-model.test.ts +1 -0
- package/src/model/ollama-model.ts +2 -0
- package/src/model/openai-model.ts +3 -0
- package/src/permission/index.ts +13 -0
- package/src/storage/file-system.test.ts +4 -3
- package/src/storage/file-system.ts +4 -4
- package/src/tool/toolkit.test.ts +12 -0
- package/dist/message-CkN21KaY.d.mts +0 -99
- package/dist/message-CzLeTlua.d.ts +0 -99
package/dist/agent/index.js
CHANGED
|
@@ -44,10 +44,12 @@ function createMsg({
|
|
|
44
44
|
role,
|
|
45
45
|
metadata = {},
|
|
46
46
|
id = crypto.randomUUID(),
|
|
47
|
-
|
|
47
|
+
created_at = (/* @__PURE__ */ new Date()).toISOString(),
|
|
48
|
+
finished_at,
|
|
48
49
|
usage
|
|
49
50
|
}) {
|
|
50
|
-
|
|
51
|
+
const contentBlocks = typeof content === "string" ? [{ id: crypto.randomUUID(), type: "text", text: content }] : content;
|
|
52
|
+
return { id, name, role, content: contentBlocks, metadata, created_at, finished_at, usage };
|
|
51
53
|
}
|
|
52
54
|
function getContentBlocks(msg, blockType) {
|
|
53
55
|
if (!blockType) return msg.content;
|
|
@@ -813,13 +815,13 @@ var Agent = class {
|
|
|
813
815
|
const preToolCalls = [];
|
|
814
816
|
for (const [index, toolCall] of pendingToolCalls.entries()) {
|
|
815
817
|
if (this.toolkit.requireUserConfirm(toolCall.name) && !this.confirmedToolCallIds.includes(toolCall.id)) {
|
|
816
|
-
toolCall.
|
|
818
|
+
toolCall.state = "asking";
|
|
817
819
|
let i = index + 1;
|
|
818
820
|
for (; i < pendingToolCalls.length; i++) {
|
|
819
821
|
const nextToolCall = pendingToolCalls[i];
|
|
820
822
|
if (!this.toolkit.requireUserConfirm(nextToolCall.name) || this.confirmedToolCallIds.includes(nextToolCall.id))
|
|
821
823
|
break;
|
|
822
|
-
nextToolCall.
|
|
824
|
+
nextToolCall.state = "asking";
|
|
823
825
|
}
|
|
824
826
|
return {
|
|
825
827
|
awaitingType: "REQUIRE_USER_CONFIRM" /* REQUIRE_USER_CONFIRM */,
|
|
@@ -862,46 +864,46 @@ var Agent = class {
|
|
|
862
864
|
}
|
|
863
865
|
const event = options.event;
|
|
864
866
|
if (event.type === "EXTERNAL_EXECUTION_RESULT" /* EXTERNAL_EXECUTION_RESULT */) {
|
|
865
|
-
this._saveToContext(event.
|
|
867
|
+
this._saveToContext(event.execution_results);
|
|
866
868
|
} else if (event.type === "USER_CONFIRM_RESULT" /* USER_CONFIRM_RESULT */) {
|
|
867
|
-
for (const result of event.
|
|
869
|
+
for (const result of event.confirm_results) {
|
|
868
870
|
if (result.confirmed) {
|
|
869
|
-
this.confirmedToolCallIds.push(result.
|
|
871
|
+
this.confirmedToolCallIds.push(result.tool_call.id);
|
|
870
872
|
} else {
|
|
871
|
-
const rejectionRes = `<system-info>**Note** the user rejected the execution of tool "${result.
|
|
873
|
+
const rejectionRes = `<system-info>**Note** the user rejected the execution of tool "${result.tool_call.name}"!</system-info>`;
|
|
872
874
|
yield {
|
|
873
875
|
id: crypto.randomUUID(),
|
|
874
|
-
|
|
876
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
875
877
|
type: "TOOL_RESULT_START" /* TOOL_RESULT_START */,
|
|
876
|
-
|
|
877
|
-
|
|
878
|
+
reply_id: this.replyId,
|
|
879
|
+
tool_call_id: result.tool_call.id
|
|
878
880
|
};
|
|
879
881
|
yield {
|
|
880
882
|
id: crypto.randomUUID(),
|
|
881
|
-
|
|
883
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
882
884
|
type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
|
|
883
|
-
|
|
884
|
-
|
|
885
|
+
reply_id: this.replyId,
|
|
886
|
+
tool_call_id: result.tool_call.id,
|
|
885
887
|
delta: rejectionRes
|
|
886
888
|
};
|
|
887
889
|
yield {
|
|
888
890
|
id: crypto.randomUUID(),
|
|
889
|
-
|
|
891
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
890
892
|
type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
|
|
891
|
-
|
|
892
|
-
|
|
893
|
+
reply_id: this.replyId,
|
|
894
|
+
tool_call_id: result.tool_call.id,
|
|
893
895
|
state: "interrupted"
|
|
894
896
|
};
|
|
895
897
|
this._saveToContext([
|
|
896
898
|
{
|
|
897
899
|
type: "tool_result",
|
|
898
|
-
id: result.
|
|
899
|
-
name: result.
|
|
900
|
+
id: result.tool_call.id,
|
|
901
|
+
name: result.tool_call.name,
|
|
900
902
|
output: [
|
|
901
903
|
{
|
|
902
904
|
id: crypto.randomUUID(),
|
|
903
905
|
type: "text",
|
|
904
|
-
text: `<system-info>**Note** the user rejected the execution of tool "${result.
|
|
906
|
+
text: `<system-info>**Note** the user rejected the execution of tool "${result.tool_call.name}"!</system-info>`
|
|
905
907
|
}
|
|
906
908
|
],
|
|
907
909
|
state: "interrupted"
|
|
@@ -909,10 +911,19 @@ var Agent = class {
|
|
|
909
911
|
]);
|
|
910
912
|
}
|
|
911
913
|
}
|
|
912
|
-
const
|
|
914
|
+
const confirmedIds = new Set(
|
|
915
|
+
event.confirm_results.filter((r) => r.confirmed).map((r) => r.tool_call.id)
|
|
916
|
+
);
|
|
917
|
+
const deniedIds = new Set(
|
|
918
|
+
event.confirm_results.filter((r) => !r.confirmed).map((r) => r.tool_call.id)
|
|
919
|
+
);
|
|
913
920
|
this.context.at(-1)?.content.forEach((content) => {
|
|
914
|
-
if (content.type === "tool_call"
|
|
915
|
-
|
|
921
|
+
if (content.type === "tool_call") {
|
|
922
|
+
if (confirmedIds.has(content.id)) {
|
|
923
|
+
content.state = "allowed";
|
|
924
|
+
} else if (deniedIds.has(content.id)) {
|
|
925
|
+
content.state = "finished";
|
|
926
|
+
}
|
|
916
927
|
}
|
|
917
928
|
});
|
|
918
929
|
}
|
|
@@ -922,10 +933,10 @@ var Agent = class {
|
|
|
922
933
|
this.confirmedToolCallIds = [];
|
|
923
934
|
yield {
|
|
924
935
|
id: crypto.randomUUID(),
|
|
925
|
-
type: "
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
936
|
+
type: "REPLY_START" /* REPLY_START */,
|
|
937
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
938
|
+
session_id: "",
|
|
939
|
+
reply_id: this.replyId,
|
|
929
940
|
name: this.name,
|
|
930
941
|
role: "assistant"
|
|
931
942
|
};
|
|
@@ -953,10 +964,10 @@ var Agent = class {
|
|
|
953
964
|
if (awaitingType) {
|
|
954
965
|
yield {
|
|
955
966
|
id: crypto.randomUUID(),
|
|
956
|
-
|
|
967
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
957
968
|
type: awaitingType,
|
|
958
|
-
|
|
959
|
-
|
|
969
|
+
reply_id: this.replyId,
|
|
970
|
+
tool_calls: awaitingToolCalls
|
|
960
971
|
};
|
|
961
972
|
return createMsg({
|
|
962
973
|
name: this.name,
|
|
@@ -979,10 +990,10 @@ var Agent = class {
|
|
|
979
990
|
}
|
|
980
991
|
yield {
|
|
981
992
|
id: crypto.randomUUID(),
|
|
982
|
-
type: "
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
993
|
+
type: "REPLY_END" /* REPLY_END */,
|
|
994
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
995
|
+
session_id: "",
|
|
996
|
+
reply_id: this.replyId
|
|
986
997
|
};
|
|
987
998
|
return createMsg({
|
|
988
999
|
id: this.replyId,
|
|
@@ -1004,10 +1015,10 @@ var Agent = class {
|
|
|
1004
1015
|
const tools = this.toolkit.getJSONSchemas();
|
|
1005
1016
|
yield {
|
|
1006
1017
|
id: crypto.randomUUID(),
|
|
1007
|
-
|
|
1008
|
-
type: "
|
|
1009
|
-
|
|
1010
|
-
|
|
1018
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1019
|
+
type: "MODEL_CALL_START" /* MODEL_CALL_START */,
|
|
1020
|
+
reply_id: this.replyId,
|
|
1021
|
+
model_name: this.model.modelName
|
|
1011
1022
|
};
|
|
1012
1023
|
const res = await this.model.call({
|
|
1013
1024
|
messages: [
|
|
@@ -1053,39 +1064,39 @@ var Agent = class {
|
|
|
1053
1064
|
if (blockIds.textBlockId) {
|
|
1054
1065
|
yield {
|
|
1055
1066
|
id: crypto.randomUUID(),
|
|
1056
|
-
|
|
1067
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1057
1068
|
type: "TEXT_BLOCK_END" /* TEXT_BLOCK_END */,
|
|
1058
|
-
|
|
1059
|
-
|
|
1069
|
+
reply_id: this.replyId,
|
|
1070
|
+
block_id: blockIds.textBlockId
|
|
1060
1071
|
};
|
|
1061
1072
|
}
|
|
1062
1073
|
if (blockIds.thinkingBlockId) {
|
|
1063
1074
|
yield {
|
|
1064
1075
|
id: crypto.randomUUID(),
|
|
1065
|
-
|
|
1076
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1066
1077
|
type: "THINKING_BLOCK_END" /* THINKING_BLOCK_END */,
|
|
1067
|
-
|
|
1068
|
-
|
|
1078
|
+
reply_id: this.replyId,
|
|
1079
|
+
block_id: blockIds.thinkingBlockId
|
|
1069
1080
|
};
|
|
1070
1081
|
}
|
|
1071
1082
|
if (blockIds.toolCallIds.length > 0) {
|
|
1072
|
-
for (const
|
|
1083
|
+
for (const tool_call_id of blockIds.toolCallIds) {
|
|
1073
1084
|
yield {
|
|
1074
1085
|
id: crypto.randomUUID(),
|
|
1075
|
-
|
|
1086
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1076
1087
|
type: "TOOL_CALL_END" /* TOOL_CALL_END */,
|
|
1077
|
-
|
|
1078
|
-
|
|
1088
|
+
reply_id: this.replyId,
|
|
1089
|
+
tool_call_id
|
|
1079
1090
|
};
|
|
1080
1091
|
}
|
|
1081
1092
|
}
|
|
1082
1093
|
yield {
|
|
1083
1094
|
id: crypto.randomUUID(),
|
|
1084
|
-
|
|
1085
|
-
type: "
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1095
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1096
|
+
type: "MODEL_CALL_END" /* MODEL_CALL_END */,
|
|
1097
|
+
reply_id: this.replyId,
|
|
1098
|
+
input_tokens: completedResponse.usage?.inputTokens || 0,
|
|
1099
|
+
output_tokens: completedResponse.usage?.outputTokens || 0
|
|
1089
1100
|
};
|
|
1090
1101
|
return completedResponse;
|
|
1091
1102
|
}
|
|
@@ -1101,10 +1112,10 @@ var Agent = class {
|
|
|
1101
1112
|
yield {
|
|
1102
1113
|
type: "TOOL_RESULT_START" /* TOOL_RESULT_START */,
|
|
1103
1114
|
id: crypto.randomUUID(),
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1115
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1116
|
+
reply_id: this.replyId,
|
|
1117
|
+
tool_call_id: options.toolCall.id,
|
|
1118
|
+
tool_call_name: options.toolCall.name
|
|
1108
1119
|
};
|
|
1109
1120
|
while (true) {
|
|
1110
1121
|
const { value, done } = await res.next();
|
|
@@ -1156,18 +1167,18 @@ var Agent = class {
|
|
|
1156
1167
|
responseId.textBlockId = crypto.randomUUID();
|
|
1157
1168
|
yield {
|
|
1158
1169
|
id: crypto.randomUUID(),
|
|
1159
|
-
|
|
1170
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1160
1171
|
type: "TEXT_BLOCK_START" /* TEXT_BLOCK_START */,
|
|
1161
|
-
|
|
1162
|
-
|
|
1172
|
+
reply_id: this.replyId,
|
|
1173
|
+
block_id: responseId.textBlockId
|
|
1163
1174
|
};
|
|
1164
1175
|
}
|
|
1165
1176
|
yield {
|
|
1166
1177
|
id: crypto.randomUUID(),
|
|
1167
|
-
|
|
1178
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1168
1179
|
type: "TEXT_BLOCK_DELTA" /* TEXT_BLOCK_DELTA */,
|
|
1169
|
-
|
|
1170
|
-
|
|
1180
|
+
reply_id: this.replyId,
|
|
1181
|
+
block_id: responseId.textBlockId,
|
|
1171
1182
|
delta: block.text
|
|
1172
1183
|
};
|
|
1173
1184
|
break;
|
|
@@ -1176,18 +1187,18 @@ var Agent = class {
|
|
|
1176
1187
|
responseId.thinkingBlockId = crypto.randomUUID();
|
|
1177
1188
|
yield {
|
|
1178
1189
|
id: crypto.randomUUID(),
|
|
1179
|
-
|
|
1190
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1180
1191
|
type: "THINKING_BLOCK_START" /* THINKING_BLOCK_START */,
|
|
1181
|
-
|
|
1182
|
-
|
|
1192
|
+
reply_id: this.replyId,
|
|
1193
|
+
block_id: responseId.thinkingBlockId
|
|
1183
1194
|
};
|
|
1184
1195
|
}
|
|
1185
1196
|
yield {
|
|
1186
1197
|
id: crypto.randomUUID(),
|
|
1187
|
-
|
|
1198
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1188
1199
|
type: "THINKING_BLOCK_DELTA" /* THINKING_BLOCK_DELTA */,
|
|
1189
|
-
|
|
1190
|
-
|
|
1200
|
+
reply_id: this.replyId,
|
|
1201
|
+
block_id: responseId.thinkingBlockId,
|
|
1191
1202
|
delta: block.thinking
|
|
1192
1203
|
};
|
|
1193
1204
|
break;
|
|
@@ -1197,19 +1208,19 @@ var Agent = class {
|
|
|
1197
1208
|
yield {
|
|
1198
1209
|
id: crypto.randomUUID(),
|
|
1199
1210
|
type: "TOOL_CALL_START" /* TOOL_CALL_START */,
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1211
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1212
|
+
reply_id: this.replyId,
|
|
1213
|
+
tool_call_id: block.id,
|
|
1214
|
+
tool_call_name: block.name
|
|
1204
1215
|
};
|
|
1205
1216
|
}
|
|
1206
1217
|
yield {
|
|
1207
1218
|
id: crypto.randomUUID(),
|
|
1208
|
-
|
|
1219
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1209
1220
|
type: "TOOL_CALL_DELTA" /* TOOL_CALL_DELTA */,
|
|
1210
1221
|
delta: block.input,
|
|
1211
|
-
|
|
1212
|
-
|
|
1222
|
+
reply_id: this.replyId,
|
|
1223
|
+
tool_call_id: block.id
|
|
1213
1224
|
};
|
|
1214
1225
|
}
|
|
1215
1226
|
}
|
|
@@ -1228,10 +1239,10 @@ var Agent = class {
|
|
|
1228
1239
|
case "text":
|
|
1229
1240
|
yield {
|
|
1230
1241
|
id: crypto.randomUUID(),
|
|
1231
|
-
|
|
1242
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1232
1243
|
type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
|
|
1233
|
-
|
|
1234
|
-
|
|
1244
|
+
reply_id: this.replyId,
|
|
1245
|
+
tool_call_id: toolCall.id,
|
|
1235
1246
|
delta: block.text
|
|
1236
1247
|
};
|
|
1237
1248
|
break;
|
|
@@ -1239,21 +1250,21 @@ var Agent = class {
|
|
|
1239
1250
|
if (block.source.type === "base64") {
|
|
1240
1251
|
yield {
|
|
1241
1252
|
id: crypto.randomUUID(),
|
|
1242
|
-
|
|
1243
|
-
type: "
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1253
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1254
|
+
type: "TOOL_RESULT_DATA_DELTA" /* TOOL_RESULT_DATA_DELTA */,
|
|
1255
|
+
reply_id: this.replyId,
|
|
1256
|
+
tool_call_id: toolCall.id,
|
|
1257
|
+
media_type: block.source.media_type,
|
|
1247
1258
|
data: block.source.data
|
|
1248
1259
|
};
|
|
1249
1260
|
} else if (block.source.type === "url") {
|
|
1250
1261
|
yield {
|
|
1251
1262
|
id: crypto.randomUUID(),
|
|
1252
|
-
|
|
1253
|
-
type: "
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1263
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1264
|
+
type: "TOOL_RESULT_DATA_DELTA" /* TOOL_RESULT_DATA_DELTA */,
|
|
1265
|
+
reply_id: this.replyId,
|
|
1266
|
+
tool_call_id: toolCall.id,
|
|
1267
|
+
media_type: block.source.media_type,
|
|
1257
1268
|
url: block.source.url
|
|
1258
1269
|
};
|
|
1259
1270
|
}
|
|
@@ -1262,10 +1273,10 @@ var Agent = class {
|
|
|
1262
1273
|
}
|
|
1263
1274
|
yield {
|
|
1264
1275
|
id: crypto.randomUUID(),
|
|
1265
|
-
|
|
1276
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1266
1277
|
type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
|
|
1267
|
-
|
|
1268
|
-
|
|
1278
|
+
reply_id: this.replyId,
|
|
1279
|
+
tool_call_id: toolCall.id,
|
|
1269
1280
|
state: toolRes.state
|
|
1270
1281
|
};
|
|
1271
1282
|
}
|
|
@@ -1275,7 +1286,7 @@ var Agent = class {
|
|
|
1275
1286
|
*/
|
|
1276
1287
|
async toJSON() {
|
|
1277
1288
|
return {
|
|
1278
|
-
|
|
1289
|
+
reply_id: this.replyId,
|
|
1279
1290
|
confirmedToolCallIds: this.confirmedToolCallIds,
|
|
1280
1291
|
curIter: this.curIter
|
|
1281
1292
|
};
|