@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.mjs
CHANGED
|
@@ -8,10 +8,12 @@ function createMsg({
|
|
|
8
8
|
role,
|
|
9
9
|
metadata = {},
|
|
10
10
|
id = crypto.randomUUID(),
|
|
11
|
-
|
|
11
|
+
created_at = (/* @__PURE__ */ new Date()).toISOString(),
|
|
12
|
+
finished_at,
|
|
12
13
|
usage
|
|
13
14
|
}) {
|
|
14
|
-
|
|
15
|
+
const contentBlocks = typeof content === "string" ? [{ id: crypto.randomUUID(), type: "text", text: content }] : content;
|
|
16
|
+
return { id, name, role, content: contentBlocks, metadata, created_at, finished_at, usage };
|
|
15
17
|
}
|
|
16
18
|
function getContentBlocks(msg, blockType) {
|
|
17
19
|
if (!blockType) return msg.content;
|
|
@@ -777,13 +779,13 @@ var Agent = class {
|
|
|
777
779
|
const preToolCalls = [];
|
|
778
780
|
for (const [index, toolCall] of pendingToolCalls.entries()) {
|
|
779
781
|
if (this.toolkit.requireUserConfirm(toolCall.name) && !this.confirmedToolCallIds.includes(toolCall.id)) {
|
|
780
|
-
toolCall.
|
|
782
|
+
toolCall.state = "asking";
|
|
781
783
|
let i = index + 1;
|
|
782
784
|
for (; i < pendingToolCalls.length; i++) {
|
|
783
785
|
const nextToolCall = pendingToolCalls[i];
|
|
784
786
|
if (!this.toolkit.requireUserConfirm(nextToolCall.name) || this.confirmedToolCallIds.includes(nextToolCall.id))
|
|
785
787
|
break;
|
|
786
|
-
nextToolCall.
|
|
788
|
+
nextToolCall.state = "asking";
|
|
787
789
|
}
|
|
788
790
|
return {
|
|
789
791
|
awaitingType: "REQUIRE_USER_CONFIRM" /* REQUIRE_USER_CONFIRM */,
|
|
@@ -826,46 +828,46 @@ var Agent = class {
|
|
|
826
828
|
}
|
|
827
829
|
const event = options.event;
|
|
828
830
|
if (event.type === "EXTERNAL_EXECUTION_RESULT" /* EXTERNAL_EXECUTION_RESULT */) {
|
|
829
|
-
this._saveToContext(event.
|
|
831
|
+
this._saveToContext(event.execution_results);
|
|
830
832
|
} else if (event.type === "USER_CONFIRM_RESULT" /* USER_CONFIRM_RESULT */) {
|
|
831
|
-
for (const result of event.
|
|
833
|
+
for (const result of event.confirm_results) {
|
|
832
834
|
if (result.confirmed) {
|
|
833
|
-
this.confirmedToolCallIds.push(result.
|
|
835
|
+
this.confirmedToolCallIds.push(result.tool_call.id);
|
|
834
836
|
} else {
|
|
835
|
-
const rejectionRes = `<system-info>**Note** the user rejected the execution of tool "${result.
|
|
837
|
+
const rejectionRes = `<system-info>**Note** the user rejected the execution of tool "${result.tool_call.name}"!</system-info>`;
|
|
836
838
|
yield {
|
|
837
839
|
id: crypto.randomUUID(),
|
|
838
|
-
|
|
840
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
839
841
|
type: "TOOL_RESULT_START" /* TOOL_RESULT_START */,
|
|
840
|
-
|
|
841
|
-
|
|
842
|
+
reply_id: this.replyId,
|
|
843
|
+
tool_call_id: result.tool_call.id
|
|
842
844
|
};
|
|
843
845
|
yield {
|
|
844
846
|
id: crypto.randomUUID(),
|
|
845
|
-
|
|
847
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
846
848
|
type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
+
reply_id: this.replyId,
|
|
850
|
+
tool_call_id: result.tool_call.id,
|
|
849
851
|
delta: rejectionRes
|
|
850
852
|
};
|
|
851
853
|
yield {
|
|
852
854
|
id: crypto.randomUUID(),
|
|
853
|
-
|
|
855
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
854
856
|
type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
|
|
855
|
-
|
|
856
|
-
|
|
857
|
+
reply_id: this.replyId,
|
|
858
|
+
tool_call_id: result.tool_call.id,
|
|
857
859
|
state: "interrupted"
|
|
858
860
|
};
|
|
859
861
|
this._saveToContext([
|
|
860
862
|
{
|
|
861
863
|
type: "tool_result",
|
|
862
|
-
id: result.
|
|
863
|
-
name: result.
|
|
864
|
+
id: result.tool_call.id,
|
|
865
|
+
name: result.tool_call.name,
|
|
864
866
|
output: [
|
|
865
867
|
{
|
|
866
868
|
id: crypto.randomUUID(),
|
|
867
869
|
type: "text",
|
|
868
|
-
text: `<system-info>**Note** the user rejected the execution of tool "${result.
|
|
870
|
+
text: `<system-info>**Note** the user rejected the execution of tool "${result.tool_call.name}"!</system-info>`
|
|
869
871
|
}
|
|
870
872
|
],
|
|
871
873
|
state: "interrupted"
|
|
@@ -873,10 +875,19 @@ var Agent = class {
|
|
|
873
875
|
]);
|
|
874
876
|
}
|
|
875
877
|
}
|
|
876
|
-
const
|
|
878
|
+
const confirmedIds = new Set(
|
|
879
|
+
event.confirm_results.filter((r) => r.confirmed).map((r) => r.tool_call.id)
|
|
880
|
+
);
|
|
881
|
+
const deniedIds = new Set(
|
|
882
|
+
event.confirm_results.filter((r) => !r.confirmed).map((r) => r.tool_call.id)
|
|
883
|
+
);
|
|
877
884
|
this.context.at(-1)?.content.forEach((content) => {
|
|
878
|
-
if (content.type === "tool_call"
|
|
879
|
-
|
|
885
|
+
if (content.type === "tool_call") {
|
|
886
|
+
if (confirmedIds.has(content.id)) {
|
|
887
|
+
content.state = "allowed";
|
|
888
|
+
} else if (deniedIds.has(content.id)) {
|
|
889
|
+
content.state = "finished";
|
|
890
|
+
}
|
|
880
891
|
}
|
|
881
892
|
});
|
|
882
893
|
}
|
|
@@ -886,10 +897,10 @@ var Agent = class {
|
|
|
886
897
|
this.confirmedToolCallIds = [];
|
|
887
898
|
yield {
|
|
888
899
|
id: crypto.randomUUID(),
|
|
889
|
-
type: "
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
900
|
+
type: "REPLY_START" /* REPLY_START */,
|
|
901
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
902
|
+
session_id: "",
|
|
903
|
+
reply_id: this.replyId,
|
|
893
904
|
name: this.name,
|
|
894
905
|
role: "assistant"
|
|
895
906
|
};
|
|
@@ -917,10 +928,10 @@ var Agent = class {
|
|
|
917
928
|
if (awaitingType) {
|
|
918
929
|
yield {
|
|
919
930
|
id: crypto.randomUUID(),
|
|
920
|
-
|
|
931
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
921
932
|
type: awaitingType,
|
|
922
|
-
|
|
923
|
-
|
|
933
|
+
reply_id: this.replyId,
|
|
934
|
+
tool_calls: awaitingToolCalls
|
|
924
935
|
};
|
|
925
936
|
return createMsg({
|
|
926
937
|
name: this.name,
|
|
@@ -943,10 +954,10 @@ var Agent = class {
|
|
|
943
954
|
}
|
|
944
955
|
yield {
|
|
945
956
|
id: crypto.randomUUID(),
|
|
946
|
-
type: "
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
957
|
+
type: "REPLY_END" /* REPLY_END */,
|
|
958
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
959
|
+
session_id: "",
|
|
960
|
+
reply_id: this.replyId
|
|
950
961
|
};
|
|
951
962
|
return createMsg({
|
|
952
963
|
id: this.replyId,
|
|
@@ -968,10 +979,10 @@ var Agent = class {
|
|
|
968
979
|
const tools = this.toolkit.getJSONSchemas();
|
|
969
980
|
yield {
|
|
970
981
|
id: crypto.randomUUID(),
|
|
971
|
-
|
|
972
|
-
type: "
|
|
973
|
-
|
|
974
|
-
|
|
982
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
983
|
+
type: "MODEL_CALL_START" /* MODEL_CALL_START */,
|
|
984
|
+
reply_id: this.replyId,
|
|
985
|
+
model_name: this.model.modelName
|
|
975
986
|
};
|
|
976
987
|
const res = await this.model.call({
|
|
977
988
|
messages: [
|
|
@@ -1017,39 +1028,39 @@ var Agent = class {
|
|
|
1017
1028
|
if (blockIds.textBlockId) {
|
|
1018
1029
|
yield {
|
|
1019
1030
|
id: crypto.randomUUID(),
|
|
1020
|
-
|
|
1031
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1021
1032
|
type: "TEXT_BLOCK_END" /* TEXT_BLOCK_END */,
|
|
1022
|
-
|
|
1023
|
-
|
|
1033
|
+
reply_id: this.replyId,
|
|
1034
|
+
block_id: blockIds.textBlockId
|
|
1024
1035
|
};
|
|
1025
1036
|
}
|
|
1026
1037
|
if (blockIds.thinkingBlockId) {
|
|
1027
1038
|
yield {
|
|
1028
1039
|
id: crypto.randomUUID(),
|
|
1029
|
-
|
|
1040
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1030
1041
|
type: "THINKING_BLOCK_END" /* THINKING_BLOCK_END */,
|
|
1031
|
-
|
|
1032
|
-
|
|
1042
|
+
reply_id: this.replyId,
|
|
1043
|
+
block_id: blockIds.thinkingBlockId
|
|
1033
1044
|
};
|
|
1034
1045
|
}
|
|
1035
1046
|
if (blockIds.toolCallIds.length > 0) {
|
|
1036
|
-
for (const
|
|
1047
|
+
for (const tool_call_id of blockIds.toolCallIds) {
|
|
1037
1048
|
yield {
|
|
1038
1049
|
id: crypto.randomUUID(),
|
|
1039
|
-
|
|
1050
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1040
1051
|
type: "TOOL_CALL_END" /* TOOL_CALL_END */,
|
|
1041
|
-
|
|
1042
|
-
|
|
1052
|
+
reply_id: this.replyId,
|
|
1053
|
+
tool_call_id
|
|
1043
1054
|
};
|
|
1044
1055
|
}
|
|
1045
1056
|
}
|
|
1046
1057
|
yield {
|
|
1047
1058
|
id: crypto.randomUUID(),
|
|
1048
|
-
|
|
1049
|
-
type: "
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1059
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1060
|
+
type: "MODEL_CALL_END" /* MODEL_CALL_END */,
|
|
1061
|
+
reply_id: this.replyId,
|
|
1062
|
+
input_tokens: completedResponse.usage?.inputTokens || 0,
|
|
1063
|
+
output_tokens: completedResponse.usage?.outputTokens || 0
|
|
1053
1064
|
};
|
|
1054
1065
|
return completedResponse;
|
|
1055
1066
|
}
|
|
@@ -1065,10 +1076,10 @@ var Agent = class {
|
|
|
1065
1076
|
yield {
|
|
1066
1077
|
type: "TOOL_RESULT_START" /* TOOL_RESULT_START */,
|
|
1067
1078
|
id: crypto.randomUUID(),
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1079
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1080
|
+
reply_id: this.replyId,
|
|
1081
|
+
tool_call_id: options.toolCall.id,
|
|
1082
|
+
tool_call_name: options.toolCall.name
|
|
1072
1083
|
};
|
|
1073
1084
|
while (true) {
|
|
1074
1085
|
const { value, done } = await res.next();
|
|
@@ -1120,18 +1131,18 @@ var Agent = class {
|
|
|
1120
1131
|
responseId.textBlockId = crypto.randomUUID();
|
|
1121
1132
|
yield {
|
|
1122
1133
|
id: crypto.randomUUID(),
|
|
1123
|
-
|
|
1134
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1124
1135
|
type: "TEXT_BLOCK_START" /* TEXT_BLOCK_START */,
|
|
1125
|
-
|
|
1126
|
-
|
|
1136
|
+
reply_id: this.replyId,
|
|
1137
|
+
block_id: responseId.textBlockId
|
|
1127
1138
|
};
|
|
1128
1139
|
}
|
|
1129
1140
|
yield {
|
|
1130
1141
|
id: crypto.randomUUID(),
|
|
1131
|
-
|
|
1142
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1132
1143
|
type: "TEXT_BLOCK_DELTA" /* TEXT_BLOCK_DELTA */,
|
|
1133
|
-
|
|
1134
|
-
|
|
1144
|
+
reply_id: this.replyId,
|
|
1145
|
+
block_id: responseId.textBlockId,
|
|
1135
1146
|
delta: block.text
|
|
1136
1147
|
};
|
|
1137
1148
|
break;
|
|
@@ -1140,18 +1151,18 @@ var Agent = class {
|
|
|
1140
1151
|
responseId.thinkingBlockId = crypto.randomUUID();
|
|
1141
1152
|
yield {
|
|
1142
1153
|
id: crypto.randomUUID(),
|
|
1143
|
-
|
|
1154
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1144
1155
|
type: "THINKING_BLOCK_START" /* THINKING_BLOCK_START */,
|
|
1145
|
-
|
|
1146
|
-
|
|
1156
|
+
reply_id: this.replyId,
|
|
1157
|
+
block_id: responseId.thinkingBlockId
|
|
1147
1158
|
};
|
|
1148
1159
|
}
|
|
1149
1160
|
yield {
|
|
1150
1161
|
id: crypto.randomUUID(),
|
|
1151
|
-
|
|
1162
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1152
1163
|
type: "THINKING_BLOCK_DELTA" /* THINKING_BLOCK_DELTA */,
|
|
1153
|
-
|
|
1154
|
-
|
|
1164
|
+
reply_id: this.replyId,
|
|
1165
|
+
block_id: responseId.thinkingBlockId,
|
|
1155
1166
|
delta: block.thinking
|
|
1156
1167
|
};
|
|
1157
1168
|
break;
|
|
@@ -1161,19 +1172,19 @@ var Agent = class {
|
|
|
1161
1172
|
yield {
|
|
1162
1173
|
id: crypto.randomUUID(),
|
|
1163
1174
|
type: "TOOL_CALL_START" /* TOOL_CALL_START */,
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1175
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1176
|
+
reply_id: this.replyId,
|
|
1177
|
+
tool_call_id: block.id,
|
|
1178
|
+
tool_call_name: block.name
|
|
1168
1179
|
};
|
|
1169
1180
|
}
|
|
1170
1181
|
yield {
|
|
1171
1182
|
id: crypto.randomUUID(),
|
|
1172
|
-
|
|
1183
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1173
1184
|
type: "TOOL_CALL_DELTA" /* TOOL_CALL_DELTA */,
|
|
1174
1185
|
delta: block.input,
|
|
1175
|
-
|
|
1176
|
-
|
|
1186
|
+
reply_id: this.replyId,
|
|
1187
|
+
tool_call_id: block.id
|
|
1177
1188
|
};
|
|
1178
1189
|
}
|
|
1179
1190
|
}
|
|
@@ -1192,10 +1203,10 @@ var Agent = class {
|
|
|
1192
1203
|
case "text":
|
|
1193
1204
|
yield {
|
|
1194
1205
|
id: crypto.randomUUID(),
|
|
1195
|
-
|
|
1206
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1196
1207
|
type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
|
|
1197
|
-
|
|
1198
|
-
|
|
1208
|
+
reply_id: this.replyId,
|
|
1209
|
+
tool_call_id: toolCall.id,
|
|
1199
1210
|
delta: block.text
|
|
1200
1211
|
};
|
|
1201
1212
|
break;
|
|
@@ -1203,21 +1214,21 @@ var Agent = class {
|
|
|
1203
1214
|
if (block.source.type === "base64") {
|
|
1204
1215
|
yield {
|
|
1205
1216
|
id: crypto.randomUUID(),
|
|
1206
|
-
|
|
1207
|
-
type: "
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1217
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1218
|
+
type: "TOOL_RESULT_DATA_DELTA" /* TOOL_RESULT_DATA_DELTA */,
|
|
1219
|
+
reply_id: this.replyId,
|
|
1220
|
+
tool_call_id: toolCall.id,
|
|
1221
|
+
media_type: block.source.media_type,
|
|
1211
1222
|
data: block.source.data
|
|
1212
1223
|
};
|
|
1213
1224
|
} else if (block.source.type === "url") {
|
|
1214
1225
|
yield {
|
|
1215
1226
|
id: crypto.randomUUID(),
|
|
1216
|
-
|
|
1217
|
-
type: "
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1227
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1228
|
+
type: "TOOL_RESULT_DATA_DELTA" /* TOOL_RESULT_DATA_DELTA */,
|
|
1229
|
+
reply_id: this.replyId,
|
|
1230
|
+
tool_call_id: toolCall.id,
|
|
1231
|
+
media_type: block.source.media_type,
|
|
1221
1232
|
url: block.source.url
|
|
1222
1233
|
};
|
|
1223
1234
|
}
|
|
@@ -1226,10 +1237,10 @@ var Agent = class {
|
|
|
1226
1237
|
}
|
|
1227
1238
|
yield {
|
|
1228
1239
|
id: crypto.randomUUID(),
|
|
1229
|
-
|
|
1240
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1230
1241
|
type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
|
|
1231
|
-
|
|
1232
|
-
|
|
1242
|
+
reply_id: this.replyId,
|
|
1243
|
+
tool_call_id: toolCall.id,
|
|
1233
1244
|
state: toolRes.state
|
|
1234
1245
|
};
|
|
1235
1246
|
}
|
|
@@ -1239,7 +1250,7 @@ var Agent = class {
|
|
|
1239
1250
|
*/
|
|
1240
1251
|
async toJSON() {
|
|
1241
1252
|
return {
|
|
1242
|
-
|
|
1253
|
+
reply_id: this.replyId,
|
|
1243
1254
|
confirmedToolCallIds: this.confirmedToolCallIds,
|
|
1244
1255
|
curIter: this.curIter
|
|
1245
1256
|
};
|