@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
@@ -8,10 +8,12 @@ function createMsg({
8
8
  role,
9
9
  metadata = {},
10
10
  id = crypto.randomUUID(),
11
- timestamp = (/* @__PURE__ */ new Date()).toISOString(),
11
+ created_at = (/* @__PURE__ */ new Date()).toISOString(),
12
+ finished_at,
12
13
  usage
13
14
  }) {
14
- return { id, name, role, content, metadata, timestamp, usage };
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.awaitUserConfirmation = true;
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.awaitUserConfirmation = true;
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.executionResults);
831
+ this._saveToContext(event.execution_results);
830
832
  } else if (event.type === "USER_CONFIRM_RESULT" /* USER_CONFIRM_RESULT */) {
831
- for (const result of event.confirmResults) {
833
+ for (const result of event.confirm_results) {
832
834
  if (result.confirmed) {
833
- this.confirmedToolCallIds.push(result.toolCall.id);
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.toolCall.name}"!</system-info>`;
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
840
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
839
841
  type: "TOOL_RESULT_START" /* TOOL_RESULT_START */,
840
- replyId: this.replyId,
841
- toolCallId: result.toolCall.id
842
+ reply_id: this.replyId,
843
+ tool_call_id: result.tool_call.id
842
844
  };
843
845
  yield {
844
846
  id: crypto.randomUUID(),
845
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
847
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
846
848
  type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
847
- replyId: this.replyId,
848
- toolCallId: result.toolCall.id,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
855
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
854
856
  type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
855
- replyId: this.replyId,
856
- toolCallId: result.toolCall.id,
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.toolCall.id,
863
- name: result.toolCall.name,
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.toolCall.name}"!</system-info>`
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 processedToolCallIds = event.confirmResults.map((result) => result.toolCall.id);
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" && processedToolCallIds.includes(content.id)) {
879
- delete content.awaitUserConfirmation;
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: "RUN_STARTED" /* RUN_STARTED */,
890
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
891
- sessionId: "",
892
- replyId: this.replyId,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
931
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
921
932
  type: awaitingType,
922
- replyId: this.replyId,
923
- toolCalls: awaitingToolCalls
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: "RUN_FINISHED" /* RUN_FINISHED */,
947
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
948
- sessionId: "",
949
- replyId: this.replyId
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
972
- type: "MODEL_CALL_STARTED" /* MODEL_CALL_STARTED */,
973
- replyId: this.replyId,
974
- modelName: this.model.modelName
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1031
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1021
1032
  type: "TEXT_BLOCK_END" /* TEXT_BLOCK_END */,
1022
- replyId: this.replyId,
1023
- blockId: blockIds.textBlockId
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1040
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1030
1041
  type: "THINKING_BLOCK_END" /* THINKING_BLOCK_END */,
1031
- replyId: this.replyId,
1032
- blockId: blockIds.thinkingBlockId
1042
+ reply_id: this.replyId,
1043
+ block_id: blockIds.thinkingBlockId
1033
1044
  };
1034
1045
  }
1035
1046
  if (blockIds.toolCallIds.length > 0) {
1036
- for (const toolCallId of blockIds.toolCallIds) {
1047
+ for (const tool_call_id of blockIds.toolCallIds) {
1037
1048
  yield {
1038
1049
  id: crypto.randomUUID(),
1039
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1050
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1040
1051
  type: "TOOL_CALL_END" /* TOOL_CALL_END */,
1041
- replyId: this.replyId,
1042
- toolCallId
1052
+ reply_id: this.replyId,
1053
+ tool_call_id
1043
1054
  };
1044
1055
  }
1045
1056
  }
1046
1057
  yield {
1047
1058
  id: crypto.randomUUID(),
1048
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1049
- type: "MODEL_CALL_ENDED" /* MODEL_CALL_ENDED */,
1050
- replyId: this.replyId,
1051
- inputTokens: completedResponse.usage?.inputTokens || 0,
1052
- outputTokens: completedResponse.usage?.outputTokens || 0
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1069
- replyId: this.replyId,
1070
- toolCallId: options.toolCall.id,
1071
- toolCallName: options.toolCall.name
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1134
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1124
1135
  type: "TEXT_BLOCK_START" /* TEXT_BLOCK_START */,
1125
- replyId: this.replyId,
1126
- blockId: responseId.textBlockId
1136
+ reply_id: this.replyId,
1137
+ block_id: responseId.textBlockId
1127
1138
  };
1128
1139
  }
1129
1140
  yield {
1130
1141
  id: crypto.randomUUID(),
1131
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1142
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1132
1143
  type: "TEXT_BLOCK_DELTA" /* TEXT_BLOCK_DELTA */,
1133
- replyId: this.replyId,
1134
- blockId: responseId.textBlockId,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1154
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1144
1155
  type: "THINKING_BLOCK_START" /* THINKING_BLOCK_START */,
1145
- replyId: this.replyId,
1146
- blockId: responseId.thinkingBlockId
1156
+ reply_id: this.replyId,
1157
+ block_id: responseId.thinkingBlockId
1147
1158
  };
1148
1159
  }
1149
1160
  yield {
1150
1161
  id: crypto.randomUUID(),
1151
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1162
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1152
1163
  type: "THINKING_BLOCK_DELTA" /* THINKING_BLOCK_DELTA */,
1153
- replyId: this.replyId,
1154
- blockId: responseId.thinkingBlockId,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1165
- replyId: this.replyId,
1166
- toolCallId: block.id,
1167
- toolCallName: block.name
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1183
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1173
1184
  type: "TOOL_CALL_DELTA" /* TOOL_CALL_DELTA */,
1174
1185
  delta: block.input,
1175
- replyId: this.replyId,
1176
- toolCallId: block.id
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1206
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1196
1207
  type: "TOOL_RESULT_TEXT_DELTA" /* TOOL_RESULT_TEXT_DELTA */,
1197
- replyId: this.replyId,
1198
- toolCallId: toolCall.id,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1207
- type: "TOOL_RESULT_BINARY_DELTA" /* TOOL_RESULT_BINARY_DELTA */,
1208
- replyId: this.replyId,
1209
- toolCallId: toolCall.id,
1210
- mediaType: block.source.mediaType,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1217
- type: "TOOL_RESULT_BINARY_DELTA" /* TOOL_RESULT_BINARY_DELTA */,
1218
- replyId: this.replyId,
1219
- toolCallId: toolCall.id,
1220
- mediaType: block.source.mediaType,
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
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1240
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1230
1241
  type: "TOOL_RESULT_END" /* TOOL_RESULT_END */,
1231
- replyId: this.replyId,
1232
- toolCallId: toolCall.id,
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
- replyId: this.replyId,
1253
+ reply_id: this.replyId,
1243
1254
  confirmedToolCallIds: this.confirmedToolCallIds,
1244
1255
  curIter: this.curIter
1245
1256
  };