@fairyhunter13/ai-anthropic 3.0.58-fork.13 → 3.0.58-fork.14

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/index.js CHANGED
@@ -3722,6 +3722,16 @@ var AnthropicMessagesLanguageModel = class {
3722
3722
  }
3723
3723
  // code execution 20250522:
3724
3724
  case "code_execution_tool_result": {
3725
+ if (markCodeExecutionDynamic) {
3726
+ content.push({
3727
+ type: "tool-result",
3728
+ toolCallId: part.tool_use_id,
3729
+ toolName: toolNameMapping.toCustomToolName("code_execution"),
3730
+ isError: true,
3731
+ result: "STOP: code_execution is disabled. Do NOT wrap web_search or web_fetch in Python code. Call web_search and web_fetch as DIRECT tool calls \u2014 they are standalone tools, not Python functions."
3732
+ });
3733
+ break;
3734
+ }
3725
3735
  if (part.content.type === "code_execution_result") {
3726
3736
  content.push({
3727
3737
  type: "tool-result",
@@ -3765,6 +3775,16 @@ var AnthropicMessagesLanguageModel = class {
3765
3775
  // code execution 20250825:
3766
3776
  case "bash_code_execution_tool_result":
3767
3777
  case "text_editor_code_execution_tool_result": {
3778
+ if (markCodeExecutionDynamic) {
3779
+ content.push({
3780
+ type: "tool-result",
3781
+ toolCallId: part.tool_use_id,
3782
+ toolName: toolNameMapping.toCustomToolName("code_execution"),
3783
+ isError: true,
3784
+ result: "STOP: code_execution is disabled. Do NOT wrap web_search or web_fetch in Python code. Call web_search and web_fetch as DIRECT tool calls \u2014 they are standalone tools, not Python functions."
3785
+ });
3786
+ break;
3787
+ }
3768
3788
  content.push({
3769
3789
  type: "tool-result",
3770
3790
  toolCallId: part.tool_use_id,
@@ -4167,6 +4187,16 @@ var AnthropicMessagesLanguageModel = class {
4167
4187
  }
4168
4188
  // code execution 20250522:
4169
4189
  case "code_execution_tool_result": {
4190
+ if (markCodeExecutionDynamic) {
4191
+ controller.enqueue({
4192
+ type: "tool-result",
4193
+ toolCallId: part.tool_use_id,
4194
+ toolName: toolNameMapping.toCustomToolName("code_execution"),
4195
+ isError: true,
4196
+ result: "STOP: code_execution is disabled. Do NOT wrap web_search or web_fetch in Python code. Call web_search and web_fetch as DIRECT tool calls \u2014 they are standalone tools, not Python functions."
4197
+ });
4198
+ return;
4199
+ }
4170
4200
  if (part.content.type === "code_execution_result") {
4171
4201
  controller.enqueue({
4172
4202
  type: "tool-result",
@@ -4210,6 +4240,16 @@ var AnthropicMessagesLanguageModel = class {
4210
4240
  // code execution 20250825:
4211
4241
  case "bash_code_execution_tool_result":
4212
4242
  case "text_editor_code_execution_tool_result": {
4243
+ if (markCodeExecutionDynamic) {
4244
+ controller.enqueue({
4245
+ type: "tool-result",
4246
+ toolCallId: part.tool_use_id,
4247
+ toolName: toolNameMapping.toCustomToolName("code_execution"),
4248
+ isError: true,
4249
+ result: "STOP: code_execution is disabled. Do NOT wrap web_search or web_fetch in Python code. Call web_search and web_fetch as DIRECT tool calls \u2014 they are standalone tools, not Python functions."
4250
+ });
4251
+ return;
4252
+ }
4213
4253
  controller.enqueue({
4214
4254
  type: "tool-result",
4215
4255
  toolCallId: part.tool_use_id,