@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.
Files changed (90) hide show
  1. package/LICENSE +202 -0
  2. package/dist/agent/index.d.mts +10 -10
  3. package/dist/agent/index.d.ts +10 -10
  4. package/dist/agent/index.js +104 -93
  5. package/dist/agent/index.js.map +1 -1
  6. package/dist/agent/index.mjs +104 -93
  7. package/dist/agent/index.mjs.map +1 -1
  8. package/dist/{base-BOx3UzOl.d.mts → base-1YVBgB4n.d.mts} +2 -2
  9. package/dist/{base-DYlBMCy_.d.mts → base-B_MQMHWr.d.mts} +3 -3
  10. package/dist/{base-Cwi4bjze.d.ts → base-BherSLRs.d.ts} +3 -3
  11. package/dist/{base-NX-knWOv.d.ts → base-CY4DMBH1.d.ts} +1 -1
  12. package/dist/{base-BoIps2RL.d.ts → base-ChWjyzPL.d.ts} +2 -2
  13. package/dist/{base-C7jwyH4Z.d.mts → base-ClilytRZ.d.mts} +1 -1
  14. package/dist/{block-VsnHrllL.d.mts → block-B72uPF1H.d.mts} +7 -5
  15. package/dist/{block-VsnHrllL.d.ts → block-B72uPF1H.d.ts} +7 -5
  16. package/dist/event/index.d.mts +105 -89
  17. package/dist/event/index.d.ts +105 -89
  18. package/dist/event/index.js +8 -8
  19. package/dist/event/index.js.map +1 -1
  20. package/dist/event/index.mjs +8 -8
  21. package/dist/event/index.mjs.map +1 -1
  22. package/dist/formatter/index.d.mts +4 -3
  23. package/dist/formatter/index.d.ts +4 -3
  24. package/dist/formatter/index.js +17 -17
  25. package/dist/formatter/index.js.map +1 -1
  26. package/dist/formatter/index.mjs +17 -17
  27. package/dist/formatter/index.mjs.map +1 -1
  28. package/dist/{index-BcatlwXQ.d.ts → index-BNfyKbQN.d.ts} +1 -1
  29. package/dist/{index-BTJDlKvQ.d.mts → index-UQCwdfet.d.mts} +1 -1
  30. package/dist/mcp/index.d.mts +2 -2
  31. package/dist/mcp/index.d.ts +2 -2
  32. package/dist/mcp/index.js +1 -1
  33. package/dist/mcp/index.js.map +1 -1
  34. package/dist/mcp/index.mjs +1 -1
  35. package/dist/mcp/index.mjs.map +1 -1
  36. package/dist/message/index.d.mts +3 -2
  37. package/dist/message/index.d.ts +3 -2
  38. package/dist/message/index.js +204 -5
  39. package/dist/message/index.js.map +1 -1
  40. package/dist/message/index.mjs +200 -5
  41. package/dist/message/index.mjs.map +1 -1
  42. package/dist/message-CPZd0NIc.d.ts +133 -0
  43. package/dist/message-DgpfAaHK.d.mts +133 -0
  44. package/dist/model/index.d.mts +6 -5
  45. package/dist/model/index.d.ts +6 -5
  46. package/dist/model/index.js +39 -28
  47. package/dist/model/index.js.map +1 -1
  48. package/dist/model/index.mjs +39 -28
  49. package/dist/model/index.mjs.map +1 -1
  50. package/dist/storage/index.d.mts +4 -3
  51. package/dist/storage/index.d.ts +4 -3
  52. package/dist/storage/index.js +4 -4
  53. package/dist/storage/index.js.map +1 -1
  54. package/dist/storage/index.mjs +4 -4
  55. package/dist/storage/index.mjs.map +1 -1
  56. package/dist/tool/index.d.mts +4 -4
  57. package/dist/tool/index.d.ts +4 -4
  58. package/dist/{toolkit-CEpulFi0.d.ts → toolkit-DeOlul5Y.d.ts} +2 -2
  59. package/dist/{toolkit-CGEZSZPa.d.mts → toolkit-jwe7NmVJ.d.mts} +2 -2
  60. package/package.json +87 -87
  61. package/src/agent/agent.test.ts +104 -71
  62. package/src/agent/agent.ts +112 -104
  63. package/src/agent/test-compression.ts +1 -1
  64. package/src/event/index.ts +96 -98
  65. package/src/formatter/base.ts +3 -3
  66. package/src/formatter/dashscope-chat-formatter.test.ts +11 -8
  67. package/src/formatter/dashscope-chat-formatter.ts +3 -3
  68. package/src/formatter/openai-chat-formatter.test.ts +13 -5
  69. package/src/formatter/openai-chat-formatter.ts +6 -6
  70. package/src/mcp/base.ts +1 -1
  71. package/src/mcp/http.test.ts +2 -0
  72. package/src/mcp/stdio.test.ts +1 -0
  73. package/src/message/append-event.test.ts +783 -0
  74. package/src/message/block.ts +8 -4
  75. package/src/message/index.ts +12 -1
  76. package/src/message/message.test.ts +3 -1
  77. package/src/message/message.ts +310 -47
  78. package/src/model/dashscope-model.test.ts +4 -0
  79. package/src/model/dashscope-model.ts +3 -0
  80. package/src/model/deepseek-model.test.ts +2 -0
  81. package/src/model/deepseek-model.ts +3 -0
  82. package/src/model/ollama-model.test.ts +1 -0
  83. package/src/model/ollama-model.ts +2 -0
  84. package/src/model/openai-model.ts +3 -0
  85. package/src/permission/index.ts +13 -0
  86. package/src/storage/file-system.test.ts +4 -3
  87. package/src/storage/file-system.ts +4 -4
  88. package/src/tool/toolkit.test.ts +12 -0
  89. package/dist/message-CkN21KaY.d.mts +0 -99
  90. package/dist/message-CzLeTlua.d.ts +0 -99
@@ -44,10 +44,12 @@ function createMsg({
44
44
  role,
45
45
  metadata = {},
46
46
  id = crypto.randomUUID(),
47
- timestamp = (/* @__PURE__ */ new Date()).toISOString(),
47
+ created_at = (/* @__PURE__ */ new Date()).toISOString(),
48
+ finished_at,
48
49
  usage
49
50
  }) {
50
- return { id, name, role, content, metadata, timestamp, usage };
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.awaitUserConfirmation = true;
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.awaitUserConfirmation = true;
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.executionResults);
867
+ this._saveToContext(event.execution_results);
866
868
  } else if (event.type === "USER_CONFIRM_RESULT" /* USER_CONFIRM_RESULT */) {
867
- for (const result of event.confirmResults) {
869
+ for (const result of event.confirm_results) {
868
870
  if (result.confirmed) {
869
- this.confirmedToolCallIds.push(result.toolCall.id);
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.toolCall.name}"!</system-info>`;
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
876
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
875
877
  type: "TOOL_RESULT_START" /* TOOL_RESULT_START */,
876
- replyId: this.replyId,
877
- toolCallId: result.toolCall.id
878
+ reply_id: this.replyId,
879
+ tool_call_id: result.tool_call.id
878
880
  };
879
881
  yield {
880
882
  id: crypto.randomUUID(),
881
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
883
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
882
884
  type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
883
- replyId: this.replyId,
884
- toolCallId: result.toolCall.id,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
891
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
890
892
  type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
891
- replyId: this.replyId,
892
- toolCallId: result.toolCall.id,
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.toolCall.id,
899
- name: result.toolCall.name,
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.toolCall.name}"!</system-info>`
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 processedToolCallIds = event.confirmResults.map((result) => result.toolCall.id);
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" && processedToolCallIds.includes(content.id)) {
915
- delete content.awaitUserConfirmation;
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: "RUN_STARTED" /* RUN_STARTED */,
926
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
927
- sessionId: "",
928
- replyId: this.replyId,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
967
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
957
968
  type: awaitingType,
958
- replyId: this.replyId,
959
- toolCalls: awaitingToolCalls
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: "RUN_FINISHED" /* RUN_FINISHED */,
983
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
984
- sessionId: "",
985
- replyId: this.replyId
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1008
- type: "MODEL_CALL_STARTED" /* MODEL_CALL_STARTED */,
1009
- replyId: this.replyId,
1010
- modelName: this.model.modelName
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1067
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1057
1068
  type: "TEXT_BLOCK_END" /* TEXT_BLOCK_END */,
1058
- replyId: this.replyId,
1059
- blockId: blockIds.textBlockId
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1076
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1066
1077
  type: "THINKING_BLOCK_END" /* THINKING_BLOCK_END */,
1067
- replyId: this.replyId,
1068
- blockId: blockIds.thinkingBlockId
1078
+ reply_id: this.replyId,
1079
+ block_id: blockIds.thinkingBlockId
1069
1080
  };
1070
1081
  }
1071
1082
  if (blockIds.toolCallIds.length > 0) {
1072
- for (const toolCallId of blockIds.toolCallIds) {
1083
+ for (const tool_call_id of blockIds.toolCallIds) {
1073
1084
  yield {
1074
1085
  id: crypto.randomUUID(),
1075
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1086
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1076
1087
  type: "TOOL_CALL_END" /* TOOL_CALL_END */,
1077
- replyId: this.replyId,
1078
- toolCallId
1088
+ reply_id: this.replyId,
1089
+ tool_call_id
1079
1090
  };
1080
1091
  }
1081
1092
  }
1082
1093
  yield {
1083
1094
  id: crypto.randomUUID(),
1084
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1085
- type: "MODEL_CALL_ENDED" /* MODEL_CALL_ENDED */,
1086
- replyId: this.replyId,
1087
- inputTokens: completedResponse.usage?.inputTokens || 0,
1088
- outputTokens: completedResponse.usage?.outputTokens || 0
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1105
- replyId: this.replyId,
1106
- toolCallId: options.toolCall.id,
1107
- toolCallName: options.toolCall.name
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1170
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1160
1171
  type: "TEXT_BLOCK_START" /* TEXT_BLOCK_START */,
1161
- replyId: this.replyId,
1162
- blockId: responseId.textBlockId
1172
+ reply_id: this.replyId,
1173
+ block_id: responseId.textBlockId
1163
1174
  };
1164
1175
  }
1165
1176
  yield {
1166
1177
  id: crypto.randomUUID(),
1167
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1178
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1168
1179
  type: "TEXT_BLOCK_DELTA" /* TEXT_BLOCK_DELTA */,
1169
- replyId: this.replyId,
1170
- blockId: responseId.textBlockId,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1190
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1180
1191
  type: "THINKING_BLOCK_START" /* THINKING_BLOCK_START */,
1181
- replyId: this.replyId,
1182
- blockId: responseId.thinkingBlockId
1192
+ reply_id: this.replyId,
1193
+ block_id: responseId.thinkingBlockId
1183
1194
  };
1184
1195
  }
1185
1196
  yield {
1186
1197
  id: crypto.randomUUID(),
1187
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1198
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1188
1199
  type: "THINKING_BLOCK_DELTA" /* THINKING_BLOCK_DELTA */,
1189
- replyId: this.replyId,
1190
- blockId: responseId.thinkingBlockId,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1201
- replyId: this.replyId,
1202
- toolCallId: block.id,
1203
- toolCallName: block.name
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1219
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1209
1220
  type: "TOOL_CALL_DELTA" /* TOOL_CALL_DELTA */,
1210
1221
  delta: block.input,
1211
- replyId: this.replyId,
1212
- toolCallId: block.id
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1242
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1232
1243
  type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
1233
- replyId: this.replyId,
1234
- toolCallId: toolCall.id,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1243
- type: "TOOL_RESULT_BINARY_DELTA" /* TOOL_RESULT_BINARY_DELTA */,
1244
- replyId: this.replyId,
1245
- toolCallId: toolCall.id,
1246
- mediaType: block.source.mediaType,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1253
- type: "TOOL_RESULT_BINARY_DELTA" /* TOOL_RESULT_BINARY_DELTA */,
1254
- replyId: this.replyId,
1255
- toolCallId: toolCall.id,
1256
- mediaType: block.source.mediaType,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1276
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1266
1277
  type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
1267
- replyId: this.replyId,
1268
- toolCallId: toolCall.id,
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
- replyId: this.replyId,
1289
+ reply_id: this.replyId,
1279
1290
  confirmedToolCallIds: this.confirmedToolCallIds,
1280
1291
  curIter: this.curIter
1281
1292
  };