@langchain/anthropic 1.3.17 → 1.3.18

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 (126) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +11 -7
  3. package/dist/chat_models.cjs +56 -70
  4. package/dist/chat_models.cjs.map +1 -1
  5. package/dist/chat_models.d.cts +0 -1
  6. package/dist/chat_models.d.cts.map +1 -1
  7. package/dist/chat_models.d.ts +0 -1
  8. package/dist/chat_models.d.ts.map +1 -1
  9. package/dist/chat_models.js +28 -42
  10. package/dist/chat_models.js.map +1 -1
  11. package/dist/index.cjs +1 -0
  12. package/dist/output_parsers.cjs +9 -11
  13. package/dist/output_parsers.cjs.map +1 -1
  14. package/dist/output_parsers.js +2 -4
  15. package/dist/output_parsers.js.map +1 -1
  16. package/dist/profiles.cjs +96 -29
  17. package/dist/profiles.cjs.map +1 -1
  18. package/dist/profiles.js +96 -29
  19. package/dist/profiles.js.map +1 -1
  20. package/dist/tools/bash.cjs +3 -3
  21. package/dist/tools/bash.cjs.map +1 -1
  22. package/dist/tools/bash.d.cts +7 -7
  23. package/dist/tools/bash.d.cts.map +1 -1
  24. package/dist/tools/bash.d.ts +7 -7
  25. package/dist/tools/bash.d.ts.map +1 -1
  26. package/dist/tools/bash.js.map +1 -1
  27. package/dist/tools/codeExecution.cjs.map +1 -1
  28. package/dist/tools/codeExecution.d.cts +0 -1
  29. package/dist/tools/codeExecution.d.cts.map +1 -1
  30. package/dist/tools/codeExecution.d.ts +0 -1
  31. package/dist/tools/codeExecution.d.ts.map +1 -1
  32. package/dist/tools/codeExecution.js.map +1 -1
  33. package/dist/tools/computer.cjs +4 -4
  34. package/dist/tools/computer.cjs.map +1 -1
  35. package/dist/tools/computer.d.cts +101 -101
  36. package/dist/tools/computer.d.cts.map +1 -1
  37. package/dist/tools/computer.d.ts +101 -101
  38. package/dist/tools/computer.d.ts.map +1 -1
  39. package/dist/tools/computer.js.map +1 -1
  40. package/dist/tools/index.cjs.map +1 -1
  41. package/dist/tools/index.d.cts.map +1 -1
  42. package/dist/tools/index.d.ts.map +1 -1
  43. package/dist/tools/index.js.map +1 -1
  44. package/dist/tools/mcpToolset.cjs.map +1 -1
  45. package/dist/tools/mcpToolset.d.cts +0 -1
  46. package/dist/tools/mcpToolset.d.cts.map +1 -1
  47. package/dist/tools/mcpToolset.d.ts +0 -1
  48. package/dist/tools/mcpToolset.d.ts.map +1 -1
  49. package/dist/tools/mcpToolset.js.map +1 -1
  50. package/dist/tools/memory.cjs +3 -3
  51. package/dist/tools/memory.cjs.map +1 -1
  52. package/dist/tools/memory.d.cts +27 -28
  53. package/dist/tools/memory.d.cts.map +1 -1
  54. package/dist/tools/memory.d.ts +25 -26
  55. package/dist/tools/memory.d.ts.map +1 -1
  56. package/dist/tools/memory.js.map +1 -1
  57. package/dist/tools/textEditor.cjs +3 -3
  58. package/dist/tools/textEditor.cjs.map +1 -1
  59. package/dist/tools/textEditor.d.cts +19 -19
  60. package/dist/tools/textEditor.d.cts.map +1 -1
  61. package/dist/tools/textEditor.d.ts +21 -21
  62. package/dist/tools/textEditor.d.ts.map +1 -1
  63. package/dist/tools/textEditor.js.map +1 -1
  64. package/dist/tools/toolSearch.cjs.map +1 -1
  65. package/dist/tools/toolSearch.d.cts +0 -1
  66. package/dist/tools/toolSearch.d.cts.map +1 -1
  67. package/dist/tools/toolSearch.d.ts +0 -1
  68. package/dist/tools/toolSearch.d.ts.map +1 -1
  69. package/dist/tools/toolSearch.js.map +1 -1
  70. package/dist/tools/types.cjs +2 -2
  71. package/dist/tools/types.cjs.map +1 -1
  72. package/dist/tools/types.d.cts +0 -1
  73. package/dist/tools/types.d.cts.map +1 -1
  74. package/dist/tools/types.d.ts +0 -1
  75. package/dist/tools/types.d.ts.map +1 -1
  76. package/dist/tools/types.js.map +1 -1
  77. package/dist/tools/webFetch.cjs.map +1 -1
  78. package/dist/tools/webFetch.d.cts +0 -1
  79. package/dist/tools/webFetch.d.cts.map +1 -1
  80. package/dist/tools/webFetch.d.ts +0 -1
  81. package/dist/tools/webFetch.d.ts.map +1 -1
  82. package/dist/tools/webFetch.js.map +1 -1
  83. package/dist/tools/webSearch.cjs.map +1 -1
  84. package/dist/tools/webSearch.d.cts +0 -1
  85. package/dist/tools/webSearch.d.cts.map +1 -1
  86. package/dist/tools/webSearch.d.ts +0 -1
  87. package/dist/tools/webSearch.d.ts.map +1 -1
  88. package/dist/tools/webSearch.js.map +1 -1
  89. package/dist/types.d.cts +0 -1
  90. package/dist/types.d.cts.map +1 -1
  91. package/dist/types.d.ts +0 -1
  92. package/dist/types.d.ts.map +1 -1
  93. package/dist/utils/content.cjs +3 -3
  94. package/dist/utils/content.cjs.map +1 -1
  95. package/dist/utils/content.js.map +1 -1
  96. package/dist/utils/errors.cjs +4 -1
  97. package/dist/utils/errors.cjs.map +1 -1
  98. package/dist/utils/errors.js +4 -1
  99. package/dist/utils/errors.js.map +1 -1
  100. package/dist/utils/index.cjs.map +1 -1
  101. package/dist/utils/index.js.map +1 -1
  102. package/dist/utils/message_inputs.cjs +79 -100
  103. package/dist/utils/message_inputs.cjs.map +1 -1
  104. package/dist/utils/message_inputs.js +73 -94
  105. package/dist/utils/message_inputs.js.map +1 -1
  106. package/dist/utils/message_outputs.cjs +28 -32
  107. package/dist/utils/message_outputs.cjs.map +1 -1
  108. package/dist/utils/message_outputs.js +13 -17
  109. package/dist/utils/message_outputs.js.map +1 -1
  110. package/dist/utils/prompts.cjs +1 -2
  111. package/dist/utils/prompts.cjs.map +1 -1
  112. package/dist/utils/prompts.d.cts +0 -1
  113. package/dist/utils/prompts.d.cts.map +1 -1
  114. package/dist/utils/prompts.d.ts +0 -1
  115. package/dist/utils/prompts.d.ts.map +1 -1
  116. package/dist/utils/prompts.js +1 -2
  117. package/dist/utils/prompts.js.map +1 -1
  118. package/dist/utils/standard.cjs +2 -4
  119. package/dist/utils/standard.cjs.map +1 -1
  120. package/dist/utils/standard.js +2 -4
  121. package/dist/utils/standard.js.map +1 -1
  122. package/dist/utils/tools.cjs +4 -3
  123. package/dist/utils/tools.cjs.map +1 -1
  124. package/dist/utils/tools.js +1 -1
  125. package/dist/utils/tools.js.map +1 -1
  126. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.js","names":["PROFILES: Record<string, ModelProfile>"],"sources":["../src/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"claude-opus-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20240620\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-opus-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5-20250929\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-haiku-20240307\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-20250219\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1-20250805\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-sonnet-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5-20251001\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAMA,WAAyC;C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AAgB;EAChB,gBAAgB;EAChB,kBAAkB;CACnB;CACD,6BAA6B;EAC3B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;CACnB;AACF;AACD,uBAAe"}
1
+ {"version":3,"file":"profiles.js","names":[],"sources":["../src/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"claude-opus-4-5-20251101\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-sonnet-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-6\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 128000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-6\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5-20250929\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20240620\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-20250219\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-haiku-20240307\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5-20251001\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-opus-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1-20250805\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAM,WAAyC;CAC7C,4BAA4B;EAC1B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;EACnB;CACD,2BAA2B;EACzB,gBAAgB;EAChB,aAAa;EACb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0BAA0B;EACxB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;EACnB;CACD,qBAAqB;EACnB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;EACnB;CACD,4BAA4B;EAC1B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;EACnB;CACD,4BAA4B;EAC1B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;EACnB;CACF"}
@@ -1,6 +1,6 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
2
  const require_types = require('./types.cjs');
3
- const __langchain_core_tools = require_rolldown_runtime.__toESM(require("@langchain/core/tools"));
3
+ let _langchain_core_tools = require("@langchain/core/tools");
4
4
 
5
5
  //#region src/tools/bash.ts
6
6
  /**
@@ -75,7 +75,7 @@ const __langchain_core_tools = require_rolldown_runtime.__toESM(require("@langch
75
75
  */
76
76
  function bash_20250124(options) {
77
77
  const name = "bash";
78
- const bashTool = (0, __langchain_core_tools.tool)(options?.execute, {
78
+ const bashTool = (0, _langchain_core_tools.tool)(options?.execute, {
79
79
  name,
80
80
  description: "A tool for executing bash commands",
81
81
  schema: require_types.Bash20250124CommandSchema
@@ -1 +1 @@
1
- {"version":3,"file":"bash.cjs","names":["options?: Bash20250124Options","Bash20250124CommandSchema"],"sources":["../../src/tools/bash.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n Bash20250124CommandSchema,\n type Bash20250124Command,\n} from \"./types.js\";\n\n/**\n * Options for the bash tool.\n */\nexport interface Bash20250124Options {\n /**\n * Optional execute function that handles bash command execution.\n * This function receives the command input and should return the result\n * (stdout and stderr combined, or an error message).\n */\n execute?: (args: Bash20250124Command) => string | Promise<string>;\n}\n\n/**\n * Creates an Anthropic bash tool for Claude 4 models and Claude 3.7 that enables\n * shell command execution in a persistent bash session.\n *\n * The bash tool provides Claude with:\n * - **Persistent bash session**: Maintains state between commands\n * - **Shell command execution**: Run any shell command\n * - **Environment access**: Access to environment variables and working directory\n * - **Command chaining**: Support for pipes, redirects, and scripting\n *\n * Available commands:\n * - Execute a command: `{ command: \"ls -la\" }`\n * - Restart the session: `{ restart: true }`\n *\n * @warning The bash tool provides direct system access. Implement safety measures\n * such as running in isolated environments (Docker/VM), command filtering,\n * and resource limits.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import { execSync } from \"child_process\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const bash = tools.bash_20250124({\n * execute: async (args) => {\n * if (args.restart) {\n * // Reset session state\n * return \"Bash session restarted\";\n * }\n * try {\n * const output = execSync(args.command!, {\n * encoding: \"utf-8\",\n * timeout: 30000,\n * });\n * return output;\n * } catch (error) {\n * return `Error: ${error.message}`;\n * }\n * },\n * });\n *\n * const llmWithBash = llm.bindTools([bash]);\n * const response = await llmWithBash.invoke(\n * \"List all Python files in the current directory\"\n * );\n *\n * // Outputs: \"bash\"\n * console.log(response.tool_calls[0].name);\n * // Outputs: \"ls -la *.py 2>/dev/null || echo \\\"No Python files found in the current directory\\\"\n * console.log(response.tool_calls[0].args.command);\n * ```\n *\n * @example Multi-step automation\n * ```typescript\n * // Claude can chain commands in a persistent session:\n * // 1. cd /tmp\n * // 2. echo \"Hello\" > test.txt\n * // 3. cat test.txt // Works because we're still in /tmp\n * ```\n *\n * @param options - Configuration options for the bash tool\n * @param options.execute - Function that handles bash command execution\n * @returns The bash tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\nexport function bash_20250124(options?: Bash20250124Options) {\n const name = \"bash\";\n const bashTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for executing bash commands\",\n schema: Bash20250124CommandSchema,\n }\n );\n\n bashTool.extras = {\n ...(bashTool.extras ?? {}),\n providerToolDefinition: {\n type: \"bash_20250124\",\n name,\n } satisfies Anthropic.Beta.BetaToolBash20250124,\n };\n\n return bashTool as DynamicStructuredTool<\n typeof Bash20250124CommandSchema,\n Bash20250124Command,\n unknown,\n string\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,cAAcA,SAA+B;CAC3D,MAAM,OAAO;CACb,MAAM,4CACJ,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQC;CACT,EACF;CAED,SAAS,SAAS;EAChB,GAAI,SAAS,UAAU,CAAE;EACzB,wBAAwB;GACtB,MAAM;GACN;EACD;CACF;AAED,QAAO;AAMR"}
1
+ {"version":3,"file":"bash.cjs","names":["Bash20250124CommandSchema"],"sources":["../../src/tools/bash.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n Bash20250124CommandSchema,\n type Bash20250124Command,\n} from \"./types.js\";\n\n/**\n * Options for the bash tool.\n */\nexport interface Bash20250124Options {\n /**\n * Optional execute function that handles bash command execution.\n * This function receives the command input and should return the result\n * (stdout and stderr combined, or an error message).\n */\n execute?: (args: Bash20250124Command) => string | Promise<string>;\n}\n\n/**\n * Creates an Anthropic bash tool for Claude 4 models and Claude 3.7 that enables\n * shell command execution in a persistent bash session.\n *\n * The bash tool provides Claude with:\n * - **Persistent bash session**: Maintains state between commands\n * - **Shell command execution**: Run any shell command\n * - **Environment access**: Access to environment variables and working directory\n * - **Command chaining**: Support for pipes, redirects, and scripting\n *\n * Available commands:\n * - Execute a command: `{ command: \"ls -la\" }`\n * - Restart the session: `{ restart: true }`\n *\n * @warning The bash tool provides direct system access. Implement safety measures\n * such as running in isolated environments (Docker/VM), command filtering,\n * and resource limits.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import { execSync } from \"child_process\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const bash = tools.bash_20250124({\n * execute: async (args) => {\n * if (args.restart) {\n * // Reset session state\n * return \"Bash session restarted\";\n * }\n * try {\n * const output = execSync(args.command!, {\n * encoding: \"utf-8\",\n * timeout: 30000,\n * });\n * return output;\n * } catch (error) {\n * return `Error: ${error.message}`;\n * }\n * },\n * });\n *\n * const llmWithBash = llm.bindTools([bash]);\n * const response = await llmWithBash.invoke(\n * \"List all Python files in the current directory\"\n * );\n *\n * // Outputs: \"bash\"\n * console.log(response.tool_calls[0].name);\n * // Outputs: \"ls -la *.py 2>/dev/null || echo \\\"No Python files found in the current directory\\\"\n * console.log(response.tool_calls[0].args.command);\n * ```\n *\n * @example Multi-step automation\n * ```typescript\n * // Claude can chain commands in a persistent session:\n * // 1. cd /tmp\n * // 2. echo \"Hello\" > test.txt\n * // 3. cat test.txt // Works because we're still in /tmp\n * ```\n *\n * @param options - Configuration options for the bash tool\n * @param options.execute - Function that handles bash command execution\n * @returns The bash tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\nexport function bash_20250124(options?: Bash20250124Options) {\n const name = \"bash\";\n const bashTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for executing bash commands\",\n schema: Bash20250124CommandSchema,\n }\n );\n\n bashTool.extras = {\n ...(bashTool.extras ?? {}),\n providerToolDefinition: {\n type: \"bash_20250124\",\n name,\n } satisfies Anthropic.Beta.BetaToolBash20250124,\n };\n\n return bashTool as DynamicStructuredTool<\n typeof Bash20250124CommandSchema,\n Bash20250124Command,\n unknown,\n string\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,cAAc,SAA+B;CAC3D,MAAM,OAAO;CACb,MAAM,2CACJ,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQA;EACT,CACF;AAED,UAAS,SAAS;EAChB,GAAI,SAAS,UAAU,EAAE;EACzB,wBAAwB;GACtB,MAAM;GACN;GACD;EACF;AAED,QAAO"}
@@ -1,6 +1,6 @@
1
1
  import { Bash20250124Command } from "./types.cjs";
2
- import * as zod46 from "zod";
3
- import * as zod_v4_core9 from "zod/v4/core";
2
+ import * as zod from "zod";
3
+ import * as zod_v4_core0 from "zod/v4/core";
4
4
  import { DynamicStructuredTool } from "@langchain/core/tools";
5
5
 
6
6
  //#region src/tools/bash.d.ts
@@ -85,11 +85,11 @@ interface Bash20250124Options {
85
85
  *
86
86
  * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool
87
87
  */
88
- declare function bash_20250124(options?: Bash20250124Options): DynamicStructuredTool<zod46.ZodUnion<readonly [zod46.ZodObject<{
89
- command: zod46.ZodString;
90
- }, zod_v4_core9.$strip>, zod46.ZodObject<{
91
- restart: zod46.ZodLiteral<true>;
92
- }, zod_v4_core9.$strip>]>, {
88
+ declare function bash_20250124(options?: Bash20250124Options): DynamicStructuredTool<zod.ZodUnion<readonly [zod.ZodObject<{
89
+ command: zod.ZodString;
90
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
91
+ restart: zod.ZodLiteral<true>;
92
+ }, zod_v4_core0.$strip>]>, {
93
93
  command: string;
94
94
  } | {
95
95
  restart: true;
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.cts","names":["zod_v4_core9","DynamicStructuredTool","Bash20250124Command","Bash20250124Options","Promise","bash_20250124","zod46","ZodString","$strip","ZodObject","ZodLiteral","ZodUnion"],"sources":["../../src/tools/bash.d.ts"],"sourcesContent":["import type { DynamicStructuredTool } from \"@langchain/core/tools\";\nimport { type Bash20250124Command } from \"./types.js\";\n/**\n * Options for the bash tool.\n */\nexport interface Bash20250124Options {\n /**\n * Optional execute function that handles bash command execution.\n * This function receives the command input and should return the result\n * (stdout and stderr combined, or an error message).\n */\n execute?: (args: Bash20250124Command) => string | Promise<string>;\n}\n/**\n * Creates an Anthropic bash tool for Claude 4 models and Claude 3.7 that enables\n * shell command execution in a persistent bash session.\n *\n * The bash tool provides Claude with:\n * - **Persistent bash session**: Maintains state between commands\n * - **Shell command execution**: Run any shell command\n * - **Environment access**: Access to environment variables and working directory\n * - **Command chaining**: Support for pipes, redirects, and scripting\n *\n * Available commands:\n * - Execute a command: `{ command: \"ls -la\" }`\n * - Restart the session: `{ restart: true }`\n *\n * @warning The bash tool provides direct system access. Implement safety measures\n * such as running in isolated environments (Docker/VM), command filtering,\n * and resource limits.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import { execSync } from \"child_process\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const bash = tools.bash_20250124({\n * execute: async (args) => {\n * if (args.restart) {\n * // Reset session state\n * return \"Bash session restarted\";\n * }\n * try {\n * const output = execSync(args.command!, {\n * encoding: \"utf-8\",\n * timeout: 30000,\n * });\n * return output;\n * } catch (error) {\n * return `Error: ${error.message}`;\n * }\n * },\n * });\n *\n * const llmWithBash = llm.bindTools([bash]);\n * const response = await llmWithBash.invoke(\n * \"List all Python files in the current directory\"\n * );\n *\n * // Outputs: \"bash\"\n * console.log(response.tool_calls[0].name);\n * // Outputs: \"ls -la *.py 2>/dev/null || echo \\\"No Python files found in the current directory\\\"\n * console.log(response.tool_calls[0].args.command);\n * ```\n *\n * @example Multi-step automation\n * ```typescript\n * // Claude can chain commands in a persistent session:\n * // 1. cd /tmp\n * // 2. echo \"Hello\" > test.txt\n * // 3. cat test.txt // Works because we're still in /tmp\n * ```\n *\n * @param options - Configuration options for the bash tool\n * @param options.execute - Function that handles bash command execution\n * @returns The bash tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\nexport declare function bash_20250124(options?: Bash20250124Options): DynamicStructuredTool<import(\"zod\").ZodUnion<readonly [import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n restart: import(\"zod\").ZodLiteral<true>;\n}, import(\"zod/v4/core\").$strip>]>, {\n command: string;\n} | {\n restart: true;\n}, unknown, string, string>;\n//# sourceMappingURL=bash.d.ts.map"],"mappings":";;;;;;;;;UAKiBG,mBAAAA;EAAAA;AA8EjB;;;;EAE+BG,OAF4GG,CAAAA,EAAAA,CAAAA,IAAAA,EAxEtHP,mBAwEsHO,EAAAA,GAAAA,MAAAA,GAxErFL,OAwEqFK,CAAAA,MAAAA,CAAAA;;;;;;AAAhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnEJ,aAAAA,WAAwBF,sBAAsBF,sBAEbK,KAAAA,CAFiDK,mBAE3EL,KAAAA,CAF4GG;WAAxEH,KAAAA,CACxCC;GAASP,YAAAA,CACXQ,MAAAA,GAEMF,KAAAA,CAFiBG;WAFoGH,KAAAA,CAGzHI;GAAUV,YAAAA,CACZQ,MAAAA"}
1
+ {"version":3,"file":"bash.d.cts","names":[],"sources":["../../src/tools/bash.ts"],"mappings":";;;;;;;;;UAYiB,mBAAA;EAAA;;;;;EAMf,OAAA,IAAW,IAAA,EAAM,mBAAA,cAAiC,OAAA;AAAA;;;;AAyEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,aAAA,CAAc,OAAA,GAAU,mBAAA,GAAmB,qBAAA,KAAA,QAAA,eAAA,SAAA;WAAA,GAAA,CAAA,SAAA;AAAA;WAAA,GAAA,CAAA,UAAA;AAAA"}
@@ -1,7 +1,7 @@
1
1
  import { Bash20250124Command } from "./types.js";
2
2
  import { DynamicStructuredTool } from "@langchain/core/tools";
3
- import * as zod195 from "zod";
4
- import * as zod_v4_core40 from "zod/v4/core";
3
+ import * as zod from "zod";
4
+ import * as zod_v4_core0 from "zod/v4/core";
5
5
 
6
6
  //#region src/tools/bash.d.ts
7
7
  /**
@@ -85,11 +85,11 @@ interface Bash20250124Options {
85
85
  *
86
86
  * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool
87
87
  */
88
- declare function bash_20250124(options?: Bash20250124Options): DynamicStructuredTool<zod195.ZodUnion<readonly [zod195.ZodObject<{
89
- command: zod195.ZodString;
90
- }, zod_v4_core40.$strip>, zod195.ZodObject<{
91
- restart: zod195.ZodLiteral<true>;
92
- }, zod_v4_core40.$strip>]>, {
88
+ declare function bash_20250124(options?: Bash20250124Options): DynamicStructuredTool<zod.ZodUnion<readonly [zod.ZodObject<{
89
+ command: zod.ZodString;
90
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
91
+ restart: zod.ZodLiteral<true>;
92
+ }, zod_v4_core0.$strip>]>, {
93
93
  command: string;
94
94
  } | {
95
95
  restart: true;
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.ts","names":["zod_v4_core40","DynamicStructuredTool","Bash20250124Command","Bash20250124Options","Promise","bash_20250124","zod195","ZodString","$strip","ZodObject","ZodLiteral","ZodUnion"],"sources":["../../src/tools/bash.d.ts"],"sourcesContent":["import type { DynamicStructuredTool } from \"@langchain/core/tools\";\nimport { type Bash20250124Command } from \"./types.js\";\n/**\n * Options for the bash tool.\n */\nexport interface Bash20250124Options {\n /**\n * Optional execute function that handles bash command execution.\n * This function receives the command input and should return the result\n * (stdout and stderr combined, or an error message).\n */\n execute?: (args: Bash20250124Command) => string | Promise<string>;\n}\n/**\n * Creates an Anthropic bash tool for Claude 4 models and Claude 3.7 that enables\n * shell command execution in a persistent bash session.\n *\n * The bash tool provides Claude with:\n * - **Persistent bash session**: Maintains state between commands\n * - **Shell command execution**: Run any shell command\n * - **Environment access**: Access to environment variables and working directory\n * - **Command chaining**: Support for pipes, redirects, and scripting\n *\n * Available commands:\n * - Execute a command: `{ command: \"ls -la\" }`\n * - Restart the session: `{ restart: true }`\n *\n * @warning The bash tool provides direct system access. Implement safety measures\n * such as running in isolated environments (Docker/VM), command filtering,\n * and resource limits.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import { execSync } from \"child_process\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const bash = tools.bash_20250124({\n * execute: async (args) => {\n * if (args.restart) {\n * // Reset session state\n * return \"Bash session restarted\";\n * }\n * try {\n * const output = execSync(args.command!, {\n * encoding: \"utf-8\",\n * timeout: 30000,\n * });\n * return output;\n * } catch (error) {\n * return `Error: ${error.message}`;\n * }\n * },\n * });\n *\n * const llmWithBash = llm.bindTools([bash]);\n * const response = await llmWithBash.invoke(\n * \"List all Python files in the current directory\"\n * );\n *\n * // Outputs: \"bash\"\n * console.log(response.tool_calls[0].name);\n * // Outputs: \"ls -la *.py 2>/dev/null || echo \\\"No Python files found in the current directory\\\"\n * console.log(response.tool_calls[0].args.command);\n * ```\n *\n * @example Multi-step automation\n * ```typescript\n * // Claude can chain commands in a persistent session:\n * // 1. cd /tmp\n * // 2. echo \"Hello\" > test.txt\n * // 3. cat test.txt // Works because we're still in /tmp\n * ```\n *\n * @param options - Configuration options for the bash tool\n * @param options.execute - Function that handles bash command execution\n * @returns The bash tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\nexport declare function bash_20250124(options?: Bash20250124Options): DynamicStructuredTool<import(\"zod\").ZodUnion<readonly [import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n restart: import(\"zod\").ZodLiteral<true>;\n}, import(\"zod/v4/core\").$strip>]>, {\n command: string;\n} | {\n restart: true;\n}, unknown, string, string>;\n//# sourceMappingURL=bash.d.ts.map"],"mappings":";;;;;;;;;UAKiBG,mBAAAA;EAAAA;AA8EjB;;;;EAE+BG,OAF4GG,CAAAA,EAAAA,CAAAA,IAAAA,EAxEtHP,mBAwEsHO,EAAAA,GAAAA,MAAAA,GAxErFL,OAwEqFK,CAAAA,MAAAA,CAAAA;;;;;;AAAhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnEJ,aAAAA,WAAwBF,sBAAsBF,sBAEbK,MAAAA,CAFiDK,mBAE3EL,MAAAA,CAF4GG;WAAxEH,MAAAA,CACxCC;GAASP,aAAAA,CACXQ,MAAAA,GAEMF,MAAAA,CAFiBG;WAFoGH,MAAAA,CAGzHI;GAAUV,aAAAA,CACZQ,MAAAA"}
1
+ {"version":3,"file":"bash.d.ts","names":[],"sources":["../../src/tools/bash.ts"],"mappings":";;;;;;;;;UAYiB,mBAAA;EAAA;;;;;EAMf,OAAA,IAAW,IAAA,EAAM,mBAAA,cAAiC,OAAA;AAAA;;;;AAyEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,aAAA,CAAc,OAAA,GAAU,mBAAA,GAAmB,qBAAA,KAAA,QAAA,eAAA,SAAA;WAAA,GAAA,CAAA,SAAA;AAAA;WAAA,GAAA,CAAA,UAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"bash.js","names":["options?: Bash20250124Options"],"sources":["../../src/tools/bash.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n Bash20250124CommandSchema,\n type Bash20250124Command,\n} from \"./types.js\";\n\n/**\n * Options for the bash tool.\n */\nexport interface Bash20250124Options {\n /**\n * Optional execute function that handles bash command execution.\n * This function receives the command input and should return the result\n * (stdout and stderr combined, or an error message).\n */\n execute?: (args: Bash20250124Command) => string | Promise<string>;\n}\n\n/**\n * Creates an Anthropic bash tool for Claude 4 models and Claude 3.7 that enables\n * shell command execution in a persistent bash session.\n *\n * The bash tool provides Claude with:\n * - **Persistent bash session**: Maintains state between commands\n * - **Shell command execution**: Run any shell command\n * - **Environment access**: Access to environment variables and working directory\n * - **Command chaining**: Support for pipes, redirects, and scripting\n *\n * Available commands:\n * - Execute a command: `{ command: \"ls -la\" }`\n * - Restart the session: `{ restart: true }`\n *\n * @warning The bash tool provides direct system access. Implement safety measures\n * such as running in isolated environments (Docker/VM), command filtering,\n * and resource limits.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import { execSync } from \"child_process\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const bash = tools.bash_20250124({\n * execute: async (args) => {\n * if (args.restart) {\n * // Reset session state\n * return \"Bash session restarted\";\n * }\n * try {\n * const output = execSync(args.command!, {\n * encoding: \"utf-8\",\n * timeout: 30000,\n * });\n * return output;\n * } catch (error) {\n * return `Error: ${error.message}`;\n * }\n * },\n * });\n *\n * const llmWithBash = llm.bindTools([bash]);\n * const response = await llmWithBash.invoke(\n * \"List all Python files in the current directory\"\n * );\n *\n * // Outputs: \"bash\"\n * console.log(response.tool_calls[0].name);\n * // Outputs: \"ls -la *.py 2>/dev/null || echo \\\"No Python files found in the current directory\\\"\n * console.log(response.tool_calls[0].args.command);\n * ```\n *\n * @example Multi-step automation\n * ```typescript\n * // Claude can chain commands in a persistent session:\n * // 1. cd /tmp\n * // 2. echo \"Hello\" > test.txt\n * // 3. cat test.txt // Works because we're still in /tmp\n * ```\n *\n * @param options - Configuration options for the bash tool\n * @param options.execute - Function that handles bash command execution\n * @returns The bash tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\nexport function bash_20250124(options?: Bash20250124Options) {\n const name = \"bash\";\n const bashTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for executing bash commands\",\n schema: Bash20250124CommandSchema,\n }\n );\n\n bashTool.extras = {\n ...(bashTool.extras ?? {}),\n providerToolDefinition: {\n type: \"bash_20250124\",\n name,\n } satisfies Anthropic.Beta.BetaToolBash20250124,\n };\n\n return bashTool as DynamicStructuredTool<\n typeof Bash20250124CommandSchema,\n Bash20250124Command,\n unknown,\n string\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,cAAcA,SAA+B;CAC3D,MAAM,OAAO;CACb,MAAM,WAAW,KACf,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQ;CACT,EACF;CAED,SAAS,SAAS;EAChB,GAAI,SAAS,UAAU,CAAE;EACzB,wBAAwB;GACtB,MAAM;GACN;EACD;CACF;AAED,QAAO;AAMR"}
1
+ {"version":3,"file":"bash.js","names":[],"sources":["../../src/tools/bash.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n Bash20250124CommandSchema,\n type Bash20250124Command,\n} from \"./types.js\";\n\n/**\n * Options for the bash tool.\n */\nexport interface Bash20250124Options {\n /**\n * Optional execute function that handles bash command execution.\n * This function receives the command input and should return the result\n * (stdout and stderr combined, or an error message).\n */\n execute?: (args: Bash20250124Command) => string | Promise<string>;\n}\n\n/**\n * Creates an Anthropic bash tool for Claude 4 models and Claude 3.7 that enables\n * shell command execution in a persistent bash session.\n *\n * The bash tool provides Claude with:\n * - **Persistent bash session**: Maintains state between commands\n * - **Shell command execution**: Run any shell command\n * - **Environment access**: Access to environment variables and working directory\n * - **Command chaining**: Support for pipes, redirects, and scripting\n *\n * Available commands:\n * - Execute a command: `{ command: \"ls -la\" }`\n * - Restart the session: `{ restart: true }`\n *\n * @warning The bash tool provides direct system access. Implement safety measures\n * such as running in isolated environments (Docker/VM), command filtering,\n * and resource limits.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import { execSync } from \"child_process\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const bash = tools.bash_20250124({\n * execute: async (args) => {\n * if (args.restart) {\n * // Reset session state\n * return \"Bash session restarted\";\n * }\n * try {\n * const output = execSync(args.command!, {\n * encoding: \"utf-8\",\n * timeout: 30000,\n * });\n * return output;\n * } catch (error) {\n * return `Error: ${error.message}`;\n * }\n * },\n * });\n *\n * const llmWithBash = llm.bindTools([bash]);\n * const response = await llmWithBash.invoke(\n * \"List all Python files in the current directory\"\n * );\n *\n * // Outputs: \"bash\"\n * console.log(response.tool_calls[0].name);\n * // Outputs: \"ls -la *.py 2>/dev/null || echo \\\"No Python files found in the current directory\\\"\n * console.log(response.tool_calls[0].args.command);\n * ```\n *\n * @example Multi-step automation\n * ```typescript\n * // Claude can chain commands in a persistent session:\n * // 1. cd /tmp\n * // 2. echo \"Hello\" > test.txt\n * // 3. cat test.txt // Works because we're still in /tmp\n * ```\n *\n * @param options - Configuration options for the bash tool\n * @param options.execute - Function that handles bash command execution\n * @returns The bash tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\nexport function bash_20250124(options?: Bash20250124Options) {\n const name = \"bash\";\n const bashTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for executing bash commands\",\n schema: Bash20250124CommandSchema,\n }\n );\n\n bashTool.extras = {\n ...(bashTool.extras ?? {}),\n providerToolDefinition: {\n type: \"bash_20250124\",\n name,\n } satisfies Anthropic.Beta.BetaToolBash20250124,\n };\n\n return bashTool as DynamicStructuredTool<\n typeof Bash20250124CommandSchema,\n Bash20250124Command,\n unknown,\n string\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,cAAc,SAA+B;CAC3D,MAAM,OAAO;CACb,MAAM,WAAW,KACf,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQ;EACT,CACF;AAED,UAAS,SAAS;EAChB,GAAI,SAAS,UAAU,EAAE;EACzB,wBAAwB;GACtB,MAAM;GACN;GACD;EACF;AAED,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"codeExecution.cjs","names":["options?: CodeExecution20250825Options"],"sources":["../../src/tools/codeExecution.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the code execution tool.\n */\nexport interface CodeExecution20250825Options {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a code execution tool that allows Claude to run Bash commands and manipulate files\n * in a secure, sandboxed environment. Claude can analyze data, create visualizations,\n * perform calculations, and process files.\n *\n * When this tool is provided, Claude automatically gains access to:\n * - **Bash commands**: Execute shell commands for system operations\n * - **File operations**: Create, view, and edit files directly\n *\n * @note This tool requires the beta header `code-execution-2025-08-25` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool | Anthropic Code Execution Documentation}\n * @param options - Configuration options for the code execution tool\n * @returns A code execution tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - calculations and data analysis\n * const response = await model.invoke(\n * \"Calculate the mean and standard deviation of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // File operations and visualization\n * const response2 = await model.invoke(\n * \"Create a matplotlib visualization of sales data and save it as chart.png\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n * ```\n *\n * @example Container reuse\n * ```typescript\n * // First request - creates a container\n * const response1 = await model.invoke(\n * \"Write a random number to /tmp/number.txt\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // Extract container ID from response for reuse\n * const containerId = response1.response_metadata?.container?.id;\n *\n * // Second request - reuse container to access the file\n * const response2 = await model.invoke(\n * \"Read /tmp/number.txt and calculate its square\",\n * {\n * tools: [tools.codeExecution_20250825()],\n * // Pass container ID to reuse the same environment\n * }\n * );\n * ```\n */\nexport function codeExecution_20250825(\n options?: CodeExecution20250825Options\n): ServerTool {\n return {\n type: \"code_execution_20250825\",\n name: \"code_execution\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.BetaCodeExecutionTool20250825;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,uBACdA,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;CACzB;AACF"}
1
+ {"version":3,"file":"codeExecution.cjs","names":[],"sources":["../../src/tools/codeExecution.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the code execution tool.\n */\nexport interface CodeExecution20250825Options {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a code execution tool that allows Claude to run Bash commands and manipulate files\n * in a secure, sandboxed environment. Claude can analyze data, create visualizations,\n * perform calculations, and process files.\n *\n * When this tool is provided, Claude automatically gains access to:\n * - **Bash commands**: Execute shell commands for system operations\n * - **File operations**: Create, view, and edit files directly\n *\n * @note This tool requires the beta header `code-execution-2025-08-25` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool | Anthropic Code Execution Documentation}\n * @param options - Configuration options for the code execution tool\n * @returns A code execution tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - calculations and data analysis\n * const response = await model.invoke(\n * \"Calculate the mean and standard deviation of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // File operations and visualization\n * const response2 = await model.invoke(\n * \"Create a matplotlib visualization of sales data and save it as chart.png\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n * ```\n *\n * @example Container reuse\n * ```typescript\n * // First request - creates a container\n * const response1 = await model.invoke(\n * \"Write a random number to /tmp/number.txt\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // Extract container ID from response for reuse\n * const containerId = response1.response_metadata?.container?.id;\n *\n * // Second request - reuse container to access the file\n * const response2 = await model.invoke(\n * \"Read /tmp/number.txt and calculate its square\",\n * {\n * tools: [tools.codeExecution_20250825()],\n * // Pass container ID to reuse the same environment\n * }\n * );\n * ```\n */\nexport function codeExecution_20250825(\n options?: CodeExecution20250825Options\n): ServerTool {\n return {\n type: \"code_execution_20250825\",\n name: \"code_execution\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.BetaCodeExecutionTool20250825;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,uBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;EACzB"}
@@ -2,7 +2,6 @@ import Anthropic from "@anthropic-ai/sdk";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
3
 
4
4
  //#region src/tools/codeExecution.d.ts
5
-
6
5
  /**
7
6
  * Options for the code execution tool.
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"codeExecution.d.cts","names":["Anthropic","ServerTool","CodeExecution20250825Options","Beta","BetaCacheControlEphemeral","codeExecution_20250825"],"sources":["../../src/tools/codeExecution.d.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n/**\n * Options for the code execution tool.\n */\nexport interface CodeExecution20250825Options {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n/**\n * Creates a code execution tool that allows Claude to run Bash commands and manipulate files\n * in a secure, sandboxed environment. Claude can analyze data, create visualizations,\n * perform calculations, and process files.\n *\n * When this tool is provided, Claude automatically gains access to:\n * - **Bash commands**: Execute shell commands for system operations\n * - **File operations**: Create, view, and edit files directly\n *\n * @note This tool requires the beta header `code-execution-2025-08-25` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool | Anthropic Code Execution Documentation}\n * @param options - Configuration options for the code execution tool\n * @returns A code execution tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - calculations and data analysis\n * const response = await model.invoke(\n * \"Calculate the mean and standard deviation of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // File operations and visualization\n * const response2 = await model.invoke(\n * \"Create a matplotlib visualization of sales data and save it as chart.png\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n * ```\n *\n * @example Container reuse\n * ```typescript\n * // First request - creates a container\n * const response1 = await model.invoke(\n * \"Write a random number to /tmp/number.txt\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // Extract container ID from response for reuse\n * const containerId = response1.response_metadata?.container?.id;\n *\n * // Second request - reuse container to access the file\n * const response2 = await model.invoke(\n * \"Read /tmp/number.txt and calculate its square\",\n * {\n * tools: [tools.codeExecution_20250825()],\n * // Pass container ID to reuse the same environment\n * }\n * );\n * ```\n */\nexport declare function codeExecution_20250825(options?: CodeExecution20250825Options): ServerTool;\n//# sourceMappingURL=codeExecution.d.ts.map"],"mappings":";;;;;;;AAKA;AA+DwBK,UA/DPH,4BAAAA,CA+DwCA;;;;iBA3DtCF,SAAAA,CAAUG,IAAAA,CAAKC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2DVC,sBAAAA,WAAiCH,+BAA+BD"}
1
+ {"version":3,"file":"codeExecution.d.cts","names":[],"sources":["../../src/tools/codeExecution.ts"],"mappings":";;;;;;AAMA;UAAiB,4BAAA;;;;EAIf,YAAA,GAAe,SAAA,CAAU,IAAA,CAAK,yBAAA;AAAA;;;;AA4DhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,sBAAA,CACd,OAAA,GAAU,4BAAA,GACT,UAAA"}
@@ -2,7 +2,6 @@ import Anthropic from "@anthropic-ai/sdk";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
3
 
4
4
  //#region src/tools/codeExecution.d.ts
5
-
6
5
  /**
7
6
  * Options for the code execution tool.
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"codeExecution.d.ts","names":["Anthropic","ServerTool","CodeExecution20250825Options","Beta","BetaCacheControlEphemeral","codeExecution_20250825"],"sources":["../../src/tools/codeExecution.d.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n/**\n * Options for the code execution tool.\n */\nexport interface CodeExecution20250825Options {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n/**\n * Creates a code execution tool that allows Claude to run Bash commands and manipulate files\n * in a secure, sandboxed environment. Claude can analyze data, create visualizations,\n * perform calculations, and process files.\n *\n * When this tool is provided, Claude automatically gains access to:\n * - **Bash commands**: Execute shell commands for system operations\n * - **File operations**: Create, view, and edit files directly\n *\n * @note This tool requires the beta header `code-execution-2025-08-25` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool | Anthropic Code Execution Documentation}\n * @param options - Configuration options for the code execution tool\n * @returns A code execution tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - calculations and data analysis\n * const response = await model.invoke(\n * \"Calculate the mean and standard deviation of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // File operations and visualization\n * const response2 = await model.invoke(\n * \"Create a matplotlib visualization of sales data and save it as chart.png\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n * ```\n *\n * @example Container reuse\n * ```typescript\n * // First request - creates a container\n * const response1 = await model.invoke(\n * \"Write a random number to /tmp/number.txt\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // Extract container ID from response for reuse\n * const containerId = response1.response_metadata?.container?.id;\n *\n * // Second request - reuse container to access the file\n * const response2 = await model.invoke(\n * \"Read /tmp/number.txt and calculate its square\",\n * {\n * tools: [tools.codeExecution_20250825()],\n * // Pass container ID to reuse the same environment\n * }\n * );\n * ```\n */\nexport declare function codeExecution_20250825(options?: CodeExecution20250825Options): ServerTool;\n//# sourceMappingURL=codeExecution.d.ts.map"],"mappings":";;;;;;;AAKA;AA+DwBK,UA/DPH,4BAAAA,CA+DwCA;;;;iBA3DtCF,SAAAA,CAAUG,IAAAA,CAAKC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2DVC,sBAAAA,WAAiCH,+BAA+BD"}
1
+ {"version":3,"file":"codeExecution.d.ts","names":[],"sources":["../../src/tools/codeExecution.ts"],"mappings":";;;;;;AAMA;UAAiB,4BAAA;;;;EAIf,YAAA,GAAe,SAAA,CAAU,IAAA,CAAK,yBAAA;AAAA;;;;AA4DhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,sBAAA,CACd,OAAA,GAAU,4BAAA,GACT,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"codeExecution.js","names":["options?: CodeExecution20250825Options"],"sources":["../../src/tools/codeExecution.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the code execution tool.\n */\nexport interface CodeExecution20250825Options {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a code execution tool that allows Claude to run Bash commands and manipulate files\n * in a secure, sandboxed environment. Claude can analyze data, create visualizations,\n * perform calculations, and process files.\n *\n * When this tool is provided, Claude automatically gains access to:\n * - **Bash commands**: Execute shell commands for system operations\n * - **File operations**: Create, view, and edit files directly\n *\n * @note This tool requires the beta header `code-execution-2025-08-25` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool | Anthropic Code Execution Documentation}\n * @param options - Configuration options for the code execution tool\n * @returns A code execution tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - calculations and data analysis\n * const response = await model.invoke(\n * \"Calculate the mean and standard deviation of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // File operations and visualization\n * const response2 = await model.invoke(\n * \"Create a matplotlib visualization of sales data and save it as chart.png\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n * ```\n *\n * @example Container reuse\n * ```typescript\n * // First request - creates a container\n * const response1 = await model.invoke(\n * \"Write a random number to /tmp/number.txt\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // Extract container ID from response for reuse\n * const containerId = response1.response_metadata?.container?.id;\n *\n * // Second request - reuse container to access the file\n * const response2 = await model.invoke(\n * \"Read /tmp/number.txt and calculate its square\",\n * {\n * tools: [tools.codeExecution_20250825()],\n * // Pass container ID to reuse the same environment\n * }\n * );\n * ```\n */\nexport function codeExecution_20250825(\n options?: CodeExecution20250825Options\n): ServerTool {\n return {\n type: \"code_execution_20250825\",\n name: \"code_execution\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.BetaCodeExecutionTool20250825;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,uBACdA,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;CACzB;AACF"}
1
+ {"version":3,"file":"codeExecution.js","names":[],"sources":["../../src/tools/codeExecution.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the code execution tool.\n */\nexport interface CodeExecution20250825Options {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a code execution tool that allows Claude to run Bash commands and manipulate files\n * in a secure, sandboxed environment. Claude can analyze data, create visualizations,\n * perform calculations, and process files.\n *\n * When this tool is provided, Claude automatically gains access to:\n * - **Bash commands**: Execute shell commands for system operations\n * - **File operations**: Create, view, and edit files directly\n *\n * @note This tool requires the beta header `code-execution-2025-08-25` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool | Anthropic Code Execution Documentation}\n * @param options - Configuration options for the code execution tool\n * @returns A code execution tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - calculations and data analysis\n * const response = await model.invoke(\n * \"Calculate the mean and standard deviation of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // File operations and visualization\n * const response2 = await model.invoke(\n * \"Create a matplotlib visualization of sales data and save it as chart.png\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n * ```\n *\n * @example Container reuse\n * ```typescript\n * // First request - creates a container\n * const response1 = await model.invoke(\n * \"Write a random number to /tmp/number.txt\",\n * { tools: [tools.codeExecution_20250825()] }\n * );\n *\n * // Extract container ID from response for reuse\n * const containerId = response1.response_metadata?.container?.id;\n *\n * // Second request - reuse container to access the file\n * const response2 = await model.invoke(\n * \"Read /tmp/number.txt and calculate its square\",\n * {\n * tools: [tools.codeExecution_20250825()],\n * // Pass container ID to reuse the same environment\n * }\n * );\n * ```\n */\nexport function codeExecution_20250825(\n options?: CodeExecution20250825Options\n): ServerTool {\n return {\n type: \"code_execution_20250825\",\n name: \"code_execution\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.BetaCodeExecutionTool20250825;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,uBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;EACzB"}
@@ -1,6 +1,6 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
2
  const require_types = require('./types.cjs');
3
- const __langchain_core_tools = require_rolldown_runtime.__toESM(require("@langchain/core/tools"));
3
+ let _langchain_core_tools = require("@langchain/core/tools");
4
4
 
5
5
  //#region src/tools/computer.ts
6
6
  const TOOL_NAME = "computer";
@@ -62,7 +62,7 @@ const TOOL_NAME = "computer";
62
62
  */
63
63
  function computer_20251124(options) {
64
64
  const name = TOOL_NAME;
65
- const computerTool = (0, __langchain_core_tools.tool)(options.execute, {
65
+ const computerTool = (0, _langchain_core_tools.tool)(options.execute, {
66
66
  name,
67
67
  schema: require_types.Computer20251124ActionSchema
68
68
  });
@@ -137,7 +137,7 @@ function computer_20251124(options) {
137
137
  */
138
138
  function computer_20250124(options) {
139
139
  const name = TOOL_NAME;
140
- const computerTool = (0, __langchain_core_tools.tool)(options.execute, {
140
+ const computerTool = (0, _langchain_core_tools.tool)(options.execute, {
141
141
  name,
142
142
  description: "A tool for interacting with the computer",
143
143
  schema: require_types.Computer20250124ActionSchema
@@ -1 +1 @@
1
- {"version":3,"file":"computer.cjs","names":["options: Computer20251124Options","Computer20251124ActionSchema","options: Computer20250124Options","Computer20250124ActionSchema"],"sources":["../../src/tools/computer.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport { ToolMessage } from \"@langchain/core/messages\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport type {\n Computer20251124Action,\n Computer20250124Action,\n} from \"./types.js\";\nimport {\n Computer20251124ActionSchema,\n Computer20250124ActionSchema,\n} from \"./types.js\";\n\nconst TOOL_NAME = \"computer\";\n\nexport type ComputerUseReturnType =\n | string\n | Promise<string>\n | ToolMessage<any>\n | Promise<ToolMessage<any>>;\n\n/**\n * Options for the computer use tool (Claude Opus 4.5 only version).\n *\n * @template TState - The type of the state schema (when used with `ReactAgent`)\n * @template TContext - The type of the context schema (when used with `ReactAgent`)\n */\nexport interface Computer20251124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Enable zoom action for detailed screen region inspection.\n * When enabled, Claude can zoom into specific screen regions.\n * @default false\n */\n enableZoom?: boolean;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (\n args: Computer20251124Action,\n runtime: ToolRuntime<TState, TContext>\n ) => ComputerUseReturnType;\n}\n\n/**\n * Creates an Anthropic computer use tool for Claude Opus 4.5 that provides\n * screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n * - **Zoom**: View specific screen regions at full resolution (when enabled)\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-opus-4-5-20251101\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-11-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20251124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * enableZoom: true,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport function computer_20251124(options: Computer20251124Options) {\n const name = TOOL_NAME;\n const computerTool = tool(\n options.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => ComputerUseReturnType,\n {\n name,\n schema: Computer20251124ActionSchema,\n }\n );\n\n computerTool.extras = {\n ...(computerTool.extras ?? {}),\n providerToolDefinition: {\n type: \"computer_20251124\",\n name,\n display_width_px: options.displayWidthPx,\n display_height_px: options.displayHeightPx,\n ...(options.displayNumber !== undefined && {\n display_number: options.displayNumber,\n }),\n ...(options.enableZoom !== undefined && {\n enable_zoom: options.enableZoom,\n }),\n } satisfies Anthropic.Beta.BetaToolComputerUse20251124,\n };\n\n return computerTool as DynamicStructuredTool<\n typeof Computer20251124ActionSchema,\n Computer20251124Action,\n any,\n ToolMessage<any>\n >;\n}\n\n/**\n * Options for the computer use tool.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n */\nexport interface Computer20250124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (\n args: Computer20250124Action,\n runtime: ToolRuntime<TState, TContext>\n ) => ComputerUseReturnType;\n}\n\n/**\n * Creates an Anthropic computer use tool that provides screenshot capabilities and mouse/keyboard control\n * for autonomous desktop interaction.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-01-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20250124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport function computer_20250124(options: Computer20250124Options) {\n const name = TOOL_NAME;\n const computerTool = tool(\n options.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => ComputerUseReturnType,\n {\n name,\n description: \"A tool for interacting with the computer\",\n schema: Computer20250124ActionSchema,\n }\n );\n\n computerTool.extras = {\n ...(computerTool.extras ?? {}),\n providerToolDefinition: {\n type: \"computer_20250124\",\n name,\n display_width_px: options.displayWidthPx,\n display_height_px: options.displayHeightPx,\n ...(options.displayNumber !== undefined && {\n display_number: options.displayNumber,\n }),\n } satisfies Anthropic.Beta.BetaToolComputerUse20250124,\n };\n\n return computerTool as DynamicStructuredTool<\n typeof Computer20250124ActionSchema,\n Computer20250124Action,\n any,\n ComputerUseReturnType\n >;\n}\n"],"mappings":";;;;;AAeA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGlB,SAAgB,kBAAkBA,SAAkC;CAClE,MAAM,OAAO;CACb,MAAM,gDACJ,QAAQ,SAIR;EACE;EACA,QAAQC;CACT,EACF;CAED,aAAa,SAAS;EACpB,GAAI,aAAa,UAAU,CAAE;EAC7B,wBAAwB;GACtB,MAAM;GACN;GACA,kBAAkB,QAAQ;GAC1B,mBAAmB,QAAQ;GAC3B,GAAI,QAAQ,kBAAkB,UAAa,EACzC,gBAAgB,QAAQ,cACzB;GACD,GAAI,QAAQ,eAAe,UAAa,EACtC,aAAa,QAAQ,WACtB;EACF;CACF;AAED,QAAO;AAMR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFD,SAAgB,kBAAkBC,SAAkC;CAClE,MAAM,OAAO;CACb,MAAM,gDACJ,QAAQ,SAIR;EACE;EACA,aAAa;EACb,QAAQC;CACT,EACF;CAED,aAAa,SAAS;EACpB,GAAI,aAAa,UAAU,CAAE;EAC7B,wBAAwB;GACtB,MAAM;GACN;GACA,kBAAkB,QAAQ;GAC1B,mBAAmB,QAAQ;GAC3B,GAAI,QAAQ,kBAAkB,UAAa,EACzC,gBAAgB,QAAQ,cACzB;EACF;CACF;AAED,QAAO;AAMR"}
1
+ {"version":3,"file":"computer.cjs","names":["Computer20251124ActionSchema","Computer20250124ActionSchema"],"sources":["../../src/tools/computer.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport { ToolMessage } from \"@langchain/core/messages\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport type {\n Computer20251124Action,\n Computer20250124Action,\n} from \"./types.js\";\nimport {\n Computer20251124ActionSchema,\n Computer20250124ActionSchema,\n} from \"./types.js\";\n\nconst TOOL_NAME = \"computer\";\n\nexport type ComputerUseReturnType =\n | string\n | Promise<string>\n | ToolMessage<any>\n | Promise<ToolMessage<any>>;\n\n/**\n * Options for the computer use tool (Claude Opus 4.5 only version).\n *\n * @template TState - The type of the state schema (when used with `ReactAgent`)\n * @template TContext - The type of the context schema (when used with `ReactAgent`)\n */\nexport interface Computer20251124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Enable zoom action for detailed screen region inspection.\n * When enabled, Claude can zoom into specific screen regions.\n * @default false\n */\n enableZoom?: boolean;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (\n args: Computer20251124Action,\n runtime: ToolRuntime<TState, TContext>\n ) => ComputerUseReturnType;\n}\n\n/**\n * Creates an Anthropic computer use tool for Claude Opus 4.5 that provides\n * screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n * - **Zoom**: View specific screen regions at full resolution (when enabled)\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-opus-4-5-20251101\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-11-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20251124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * enableZoom: true,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport function computer_20251124(options: Computer20251124Options) {\n const name = TOOL_NAME;\n const computerTool = tool(\n options.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => ComputerUseReturnType,\n {\n name,\n schema: Computer20251124ActionSchema,\n }\n );\n\n computerTool.extras = {\n ...(computerTool.extras ?? {}),\n providerToolDefinition: {\n type: \"computer_20251124\",\n name,\n display_width_px: options.displayWidthPx,\n display_height_px: options.displayHeightPx,\n ...(options.displayNumber !== undefined && {\n display_number: options.displayNumber,\n }),\n ...(options.enableZoom !== undefined && {\n enable_zoom: options.enableZoom,\n }),\n } satisfies Anthropic.Beta.BetaToolComputerUse20251124,\n };\n\n return computerTool as DynamicStructuredTool<\n typeof Computer20251124ActionSchema,\n Computer20251124Action,\n any,\n ToolMessage<any>\n >;\n}\n\n/**\n * Options for the computer use tool.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n */\nexport interface Computer20250124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (\n args: Computer20250124Action,\n runtime: ToolRuntime<TState, TContext>\n ) => ComputerUseReturnType;\n}\n\n/**\n * Creates an Anthropic computer use tool that provides screenshot capabilities and mouse/keyboard control\n * for autonomous desktop interaction.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-01-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20250124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport function computer_20250124(options: Computer20250124Options) {\n const name = TOOL_NAME;\n const computerTool = tool(\n options.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => ComputerUseReturnType,\n {\n name,\n description: \"A tool for interacting with the computer\",\n schema: Computer20250124ActionSchema,\n }\n );\n\n computerTool.extras = {\n ...(computerTool.extras ?? {}),\n providerToolDefinition: {\n type: \"computer_20250124\",\n name,\n display_width_px: options.displayWidthPx,\n display_height_px: options.displayHeightPx,\n ...(options.displayNumber !== undefined && {\n display_number: options.displayNumber,\n }),\n } satisfies Anthropic.Beta.BetaToolComputerUse20250124,\n };\n\n return computerTool as DynamicStructuredTool<\n typeof Computer20250124ActionSchema,\n Computer20250124Action,\n any,\n ComputerUseReturnType\n >;\n}\n"],"mappings":";;;;;AAeA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGlB,SAAgB,kBAAkB,SAAkC;CAClE,MAAM,OAAO;CACb,MAAM,+CACJ,QAAQ,SAIR;EACE;EACA,QAAQA;EACT,CACF;AAED,cAAa,SAAS;EACpB,GAAI,aAAa,UAAU,EAAE;EAC7B,wBAAwB;GACtB,MAAM;GACN;GACA,kBAAkB,QAAQ;GAC1B,mBAAmB,QAAQ;GAC3B,GAAI,QAAQ,kBAAkB,UAAa,EACzC,gBAAgB,QAAQ,eACzB;GACD,GAAI,QAAQ,eAAe,UAAa,EACtC,aAAa,QAAQ,YACtB;GACF;EACF;AAED,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FT,SAAgB,kBAAkB,SAAkC;CAClE,MAAM,OAAO;CACb,MAAM,+CACJ,QAAQ,SAIR;EACE;EACA,aAAa;EACb,QAAQC;EACT,CACF;AAED,cAAa,SAAS;EACpB,GAAI,aAAa,UAAU,EAAE;EAC7B,wBAAwB;GACtB,MAAM;GACN;GACA,kBAAkB,QAAQ;GAC1B,mBAAmB,QAAQ;GAC3B,GAAI,QAAQ,kBAAkB,UAAa,EACzC,gBAAgB,QAAQ,eACzB;GACF;EACF;AAED,QAAO"}