bedrock-agentcore 0.1.1 → 0.2.0

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 (114) hide show
  1. package/README.md +94 -114
  2. package/dist/src/_utils/endpoints.d.ts +28 -0
  3. package/dist/src/_utils/endpoints.d.ts.map +1 -0
  4. package/dist/src/_utils/endpoints.js +44 -0
  5. package/dist/src/_utils/endpoints.js.map +1 -0
  6. package/dist/src/identity/client.d.ts +40 -0
  7. package/dist/src/identity/client.d.ts.map +1 -0
  8. package/dist/src/identity/client.js +109 -0
  9. package/dist/src/identity/client.js.map +1 -0
  10. package/dist/src/identity/index.d.ts +22 -0
  11. package/dist/src/identity/index.d.ts.map +1 -0
  12. package/dist/src/identity/index.js +24 -0
  13. package/dist/src/identity/index.js.map +1 -0
  14. package/dist/src/identity/types.d.ts +82 -0
  15. package/dist/src/identity/types.d.ts.map +1 -0
  16. package/dist/src/identity/types.js +5 -0
  17. package/dist/src/identity/types.js.map +1 -0
  18. package/dist/src/identity/wrappers.d.ts +54 -0
  19. package/dist/src/identity/wrappers.d.ts.map +1 -0
  20. package/dist/src/identity/wrappers.js +95 -0
  21. package/dist/src/identity/wrappers.js.map +1 -0
  22. package/dist/src/runtime/app.d.ts +144 -0
  23. package/dist/src/runtime/app.d.ts.map +1 -0
  24. package/dist/src/runtime/app.js +485 -0
  25. package/dist/src/runtime/app.js.map +1 -0
  26. package/dist/src/runtime/client.d.ts +154 -0
  27. package/dist/src/runtime/client.d.ts.map +1 -0
  28. package/dist/src/runtime/client.js +319 -0
  29. package/dist/src/runtime/client.js.map +1 -0
  30. package/dist/src/runtime/context.d.ts +33 -0
  31. package/dist/src/runtime/context.d.ts.map +1 -0
  32. package/dist/src/runtime/context.js +49 -0
  33. package/dist/src/runtime/context.js.map +1 -0
  34. package/dist/src/runtime/index.d.ts +8 -0
  35. package/dist/src/runtime/index.d.ts.map +1 -0
  36. package/dist/src/runtime/index.js +7 -0
  37. package/dist/src/runtime/index.js.map +1 -0
  38. package/dist/src/runtime/types.d.ts +429 -0
  39. package/dist/src/runtime/types.d.ts.map +1 -0
  40. package/dist/src/runtime/types.js +26 -0
  41. package/dist/src/runtime/types.js.map +1 -0
  42. package/dist/src/tools/browser/integrations/strands/click-tool.d.ts +20 -0
  43. package/dist/src/tools/browser/integrations/strands/click-tool.d.ts.map +1 -0
  44. package/dist/src/tools/browser/integrations/strands/click-tool.js +33 -0
  45. package/dist/src/tools/browser/integrations/strands/click-tool.js.map +1 -0
  46. package/dist/src/tools/browser/integrations/strands/evaluate-tool.d.ts +20 -0
  47. package/dist/src/tools/browser/integrations/strands/evaluate-tool.d.ts.map +1 -0
  48. package/dist/src/tools/browser/integrations/strands/evaluate-tool.js +34 -0
  49. package/dist/src/tools/browser/integrations/strands/evaluate-tool.js.map +1 -0
  50. package/dist/src/tools/browser/integrations/strands/get-html-tool.d.ts +19 -0
  51. package/dist/src/tools/browser/integrations/strands/get-html-tool.d.ts.map +1 -0
  52. package/dist/src/tools/browser/integrations/strands/get-html-tool.js +32 -0
  53. package/dist/src/tools/browser/integrations/strands/get-html-tool.js.map +1 -0
  54. package/dist/src/tools/browser/integrations/strands/get-text-tool.d.ts +19 -0
  55. package/dist/src/tools/browser/integrations/strands/get-text-tool.d.ts.map +1 -0
  56. package/dist/src/tools/browser/integrations/strands/get-text-tool.js +32 -0
  57. package/dist/src/tools/browser/integrations/strands/get-text-tool.js.map +1 -0
  58. package/dist/src/tools/browser/integrations/strands/index.d.ts +25 -0
  59. package/dist/src/tools/browser/integrations/strands/index.d.ts.map +1 -0
  60. package/dist/src/tools/browser/integrations/strands/index.js +25 -0
  61. package/dist/src/tools/browser/integrations/strands/index.js.map +1 -0
  62. package/dist/src/tools/browser/integrations/strands/navigate-tool.d.ts +21 -0
  63. package/dist/src/tools/browser/integrations/strands/navigate-tool.d.ts.map +1 -0
  64. package/dist/src/tools/browser/integrations/strands/navigate-tool.js +41 -0
  65. package/dist/src/tools/browser/integrations/strands/navigate-tool.js.map +1 -0
  66. package/dist/src/tools/browser/integrations/strands/screenshot-tool.d.ts +29 -0
  67. package/dist/src/tools/browser/integrations/strands/screenshot-tool.d.ts.map +1 -0
  68. package/dist/src/tools/browser/integrations/strands/screenshot-tool.js +52 -0
  69. package/dist/src/tools/browser/integrations/strands/screenshot-tool.js.map +1 -0
  70. package/dist/src/tools/browser/integrations/strands/tools.d.ts +119 -0
  71. package/dist/src/tools/browser/integrations/strands/tools.d.ts.map +1 -0
  72. package/dist/src/tools/browser/integrations/strands/tools.js +141 -0
  73. package/dist/src/tools/browser/integrations/strands/tools.js.map +1 -0
  74. package/dist/src/tools/browser/integrations/strands/type-tool.d.ts +22 -0
  75. package/dist/src/tools/browser/integrations/strands/type-tool.d.ts.map +1 -0
  76. package/dist/src/tools/browser/integrations/strands/type-tool.js +37 -0
  77. package/dist/src/tools/browser/integrations/strands/type-tool.js.map +1 -0
  78. package/dist/src/tools/browser/integrations/vercel-ai/tools.d.ts +1 -1
  79. package/dist/src/tools/browser/integrations/vercel-ai/tools.js +1 -1
  80. package/dist/src/tools/code-interpreter/client.d.ts +2 -0
  81. package/dist/src/tools/code-interpreter/client.d.ts.map +1 -1
  82. package/dist/src/tools/code-interpreter/client.js +31 -25
  83. package/dist/src/tools/code-interpreter/client.js.map +1 -1
  84. package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.d.ts +28 -0
  85. package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.d.ts.map +1 -0
  86. package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.js +47 -0
  87. package/dist/src/tools/code-interpreter/integrations/strands/execute-code-tool.js.map +1 -0
  88. package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.d.ts +27 -0
  89. package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.d.ts.map +1 -0
  90. package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.js +42 -0
  91. package/dist/src/tools/code-interpreter/integrations/strands/execute-command-tool.js.map +1 -0
  92. package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.d.ts +33 -0
  93. package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.d.ts.map +1 -0
  94. package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.js +78 -0
  95. package/dist/src/tools/code-interpreter/integrations/strands/file-operations-tool.js.map +1 -0
  96. package/dist/src/tools/code-interpreter/integrations/strands/index.d.ts +32 -0
  97. package/dist/src/tools/code-interpreter/integrations/strands/index.d.ts.map +1 -0
  98. package/dist/src/tools/code-interpreter/integrations/strands/index.js +32 -0
  99. package/dist/src/tools/code-interpreter/integrations/strands/index.js.map +1 -0
  100. package/dist/src/tools/code-interpreter/integrations/strands/tools.d.ts +94 -0
  101. package/dist/src/tools/code-interpreter/integrations/strands/tools.d.ts.map +1 -0
  102. package/dist/src/tools/code-interpreter/integrations/strands/tools.js +112 -0
  103. package/dist/src/tools/code-interpreter/integrations/strands/tools.js.map +1 -0
  104. package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-code-tool.d.ts +2 -2
  105. package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-code-tool.js +2 -2
  106. package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.d.ts +2 -2
  107. package/dist/src/tools/code-interpreter/integrations/vercel-ai/execute-command-tool.js +2 -2
  108. package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.d.ts +3 -3
  109. package/dist/src/tools/code-interpreter/integrations/vercel-ai/file-operations-tool.js +2 -2
  110. package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.d.ts +1 -1
  111. package/dist/src/tools/code-interpreter/integrations/vercel-ai/index.js +1 -1
  112. package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.d.ts +1 -1
  113. package/dist/src/tools/code-interpreter/integrations/vercel-ai/tools.js +1 -1
  114. package/package.json +46 -11
@@ -1,3 +1,4 @@
1
+ import { Buffer } from 'node:buffer';
1
2
  import { BedrockAgentCoreClient, StartCodeInterpreterSessionCommand, StopCodeInterpreterSessionCommand, InvokeCodeInterpreterCommand, GetCodeInterpreterSessionCommand, ListCodeInterpreterSessionsCommand, } from '@aws-sdk/client-bedrock-agentcore';
2
3
  import { DEFAULT_IDENTIFIER, DEFAULT_SESSION_NAME, DEFAULT_TIMEOUT, DEFAULT_REGION } from './types.js';
3
4
  /**
@@ -377,7 +378,7 @@ export class CodeInterpreter {
377
378
  sessionId: this._session.sessionId,
378
379
  name: 'listFiles',
379
380
  arguments: {
380
- path: params?.path ?? '.',
381
+ directoryPath: params?.path ?? '.',
381
382
  },
382
383
  });
383
384
  const response = await this._client.send(command);
@@ -479,34 +480,39 @@ export class CodeInterpreter {
479
480
  */
480
481
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
481
482
  _extractFromContentArray(content) {
482
- const parts = [];
483
- for (const item of content) {
484
- if (item.type === 'text') {
485
- // Direct text output
486
- parts.push(item.text);
487
- }
488
- else if (item.type === 'resource' && item.resource) {
489
- // File content - extract text from nested resource object
490
- if (item.resource.text) {
491
- parts.push(item.resource.text);
492
- }
493
- else {
494
- // Resource without text - show metadata
495
- parts.push(JSON.stringify(item.resource));
496
- }
497
- }
498
- else if (item.type === 'resource_link') {
499
- // File metadata - format as human-readable string
483
+ return content.map((item) => this._extractContentItem(item)).join('\n');
484
+ }
485
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
486
+ _extractContentItem(item) {
487
+ switch (item.type) {
488
+ case 'text':
489
+ return item.text;
490
+ case 'resource':
491
+ return item.resource ? this._extractResourceContent(item.resource) : JSON.stringify(item);
492
+ case 'resource_link': {
500
493
  const { name, description, mimeType, uri } = item;
501
494
  const meta = [name, description, mimeType].filter(Boolean).join(' - ');
502
- parts.push(`${meta} (${uri})`);
503
- }
504
- else {
505
- // Unknown type - fallback to JSON
506
- parts.push(JSON.stringify(item));
495
+ return `${meta} (${uri})`;
507
496
  }
497
+ default:
498
+ return JSON.stringify(item);
499
+ }
500
+ }
501
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
502
+ _extractResourceContent(resource) {
503
+ if (resource.text) {
504
+ return resource.text;
505
+ }
506
+ if (resource.blob) {
507
+ const blob = resource.blob;
508
+ const base64 = blob instanceof Uint8Array || Buffer.isBuffer(blob) ? Buffer.from(blob).toString('base64') : String(blob);
509
+ return JSON.stringify({
510
+ uri: resource.uri,
511
+ mimeType: resource.mimeType,
512
+ blob: base64,
513
+ });
508
514
  }
509
- return parts.join('\n');
515
+ return JSON.stringify(resource);
510
516
  }
511
517
  }
512
518
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/tools/code-interpreter/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,kCAAkC,EAClC,iCAAiC,EACjC,4BAA4B,EAC5B,gCAAgC,EAChC,kCAAkC,GACnC,MAAM,mCAAmC,CAAA;AAkB1C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEtG;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,eAAe;IACjB,MAAM,CAAQ;IACd,UAAU,CAAQ;IAEnB,OAAO,CAAwB;IAC/B,QAAQ,GAAuB,IAAI,CAAA;IACnC,oBAAoB,GAA8C,SAAS,CAAA;IAEnF;;;;OAIG;IACH,YAAY,MAA6B;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,cAAc,CAAA;QACvE,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,kBAAkB,CAAA;QACzD,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,mBAAmB,CAAA;QAEtD,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAsB,CAAC;YACxC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,CAAC,IAAI,CAAC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Q,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAC3G,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,GAAG,EAAE,QAAQ,CAAC,GAAG;gBACjB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,IAAI,EAAE,MAAM;aACb,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import type { CodeInterpreter } from '../../client.js';
2
+ /**
3
+ * Creates a Strands SDK tool for executing code in CodeInterpreter.
4
+ *
5
+ * @param interpreter - CodeInterpreter instance
6
+ * @returns Strands SDK tool for code execution
7
+ *
8
+ * @experimental
9
+ * @example
10
+ * ```typescript
11
+ * import { createExecuteCodeTool } from 'bedrock-agentcore/experimental/code-interpreter/strands'
12
+ * import { CodeInterpreter } from 'bedrock-agentcore/code-interpreter'
13
+ *
14
+ * const interpreter = new CodeInterpreter({ region: 'us-west-2' })
15
+ * const executeCodeTool = createExecuteCodeTool(interpreter)
16
+ *
17
+ * // Use with Strands SDK Agent
18
+ * const agent = new Agent({
19
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
20
+ * tools: [executeCodeTool]
21
+ * })
22
+ * ```
23
+ */
24
+ export declare function createExecuteCodeTool(interpreter: CodeInterpreter): import("@strands-agents/sdk").InvokableTool<{
25
+ code: string;
26
+ language: "python" | "javascript" | "typescript";
27
+ }, string>;
28
+ //# sourceMappingURL=execute-code-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-code-tool.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/execute-code-tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,eAAe;;;WAoBjE"}
@@ -0,0 +1,47 @@
1
+ /// <reference types="node" />
2
+ import { tool } from '@strands-agents/sdk';
3
+ import { z } from 'zod';
4
+ /**
5
+ * Creates a Strands SDK tool for executing code in CodeInterpreter.
6
+ *
7
+ * @param interpreter - CodeInterpreter instance
8
+ * @returns Strands SDK tool for code execution
9
+ *
10
+ * @experimental
11
+ * @example
12
+ * ```typescript
13
+ * import { createExecuteCodeTool } from 'bedrock-agentcore/experimental/code-interpreter/strands'
14
+ * import { CodeInterpreter } from 'bedrock-agentcore/code-interpreter'
15
+ *
16
+ * const interpreter = new CodeInterpreter({ region: 'us-west-2' })
17
+ * const executeCodeTool = createExecuteCodeTool(interpreter)
18
+ *
19
+ * // Use with Strands SDK Agent
20
+ * const agent = new Agent({
21
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
22
+ * tools: [executeCodeTool]
23
+ * })
24
+ * ```
25
+ */
26
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/explicit-module-boundary-types
27
+ export function createExecuteCodeTool(interpreter) {
28
+ return tool({
29
+ name: 'executeCode',
30
+ description: `Execute code in a secure sandbox environment.
31
+ Use this to perform calculations, data analysis, create visualizations, or run any code.
32
+ The environment persists across executions within the same session.
33
+ Supports Python, JavaScript, and TypeScript.`,
34
+ inputSchema: z.object({
35
+ code: z.string().describe('The code to execute. Can use imports and access files.'),
36
+ language: z
37
+ .enum(['python', 'javascript', 'typescript'])
38
+ .default('python')
39
+ .describe('Programming language to use (default: python)'),
40
+ }),
41
+ callback: async ({ code, language }) => {
42
+ const result = await interpreter.executeCode({ code, language });
43
+ return result;
44
+ },
45
+ });
46
+ }
47
+ //# sourceMappingURL=execute-code-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-code-tool.js","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/execute-code-tool.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,+HAA+H;AAC/H,MAAM,UAAU,qBAAqB,CAAC,WAA4B;IAChE,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE;;;6CAG4B;QACzC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;YACnF,QAAQ,EAAE,CAAC;iBACR,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;iBAC5C,OAAO,CAAC,QAAQ,CAAC;iBACjB,QAAQ,CAAC,+CAA+C,CAAC;SAC7D,CAAC;QACF,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;YACrC,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;YAEhE,OAAO,MAAM,CAAA;QACf,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { CodeInterpreter } from '../../client.js';
2
+ /**
3
+ * Creates a Strands SDK tool for executing shell commands in CodeInterpreter.
4
+ *
5
+ * @param interpreter - CodeInterpreter instance
6
+ * @returns Strands SDK tool for command execution
7
+ *
8
+ * @experimental
9
+ * @example
10
+ * ```typescript
11
+ * import { createExecuteCommandTool } from 'bedrock-agentcore/experimental/code-interpreter/strands'
12
+ * import { CodeInterpreter } from 'bedrock-agentcore/code-interpreter'
13
+ *
14
+ * const interpreter = new CodeInterpreter({ region: 'us-west-2' })
15
+ * const executeCommandTool = createExecuteCommandTool(interpreter)
16
+ *
17
+ * // Use with Strands SDK Agent
18
+ * const agent = new Agent({
19
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
20
+ * tools: [executeCommandTool]
21
+ * })
22
+ * ```
23
+ */
24
+ export declare function createExecuteCommandTool(interpreter: CodeInterpreter): import("@strands-agents/sdk").InvokableTool<{
25
+ command: string;
26
+ }, string>;
27
+ //# sourceMappingURL=execute-command-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-command-tool.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/execute-command-tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,eAAe;;WAepE"}
@@ -0,0 +1,42 @@
1
+ /// <reference types="node" />
2
+ import { tool } from '@strands-agents/sdk';
3
+ import { z } from 'zod';
4
+ /**
5
+ * Creates a Strands SDK tool for executing shell commands in CodeInterpreter.
6
+ *
7
+ * @param interpreter - CodeInterpreter instance
8
+ * @returns Strands SDK tool for command execution
9
+ *
10
+ * @experimental
11
+ * @example
12
+ * ```typescript
13
+ * import { createExecuteCommandTool } from 'bedrock-agentcore/experimental/code-interpreter/strands'
14
+ * import { CodeInterpreter } from 'bedrock-agentcore/code-interpreter'
15
+ *
16
+ * const interpreter = new CodeInterpreter({ region: 'us-west-2' })
17
+ * const executeCommandTool = createExecuteCommandTool(interpreter)
18
+ *
19
+ * // Use with Strands SDK Agent
20
+ * const agent = new Agent({
21
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
22
+ * tools: [executeCommandTool]
23
+ * })
24
+ * ```
25
+ */
26
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/explicit-module-boundary-types
27
+ export function createExecuteCommandTool(interpreter) {
28
+ return tool({
29
+ name: 'executeCommand',
30
+ description: `Execute shell commands in the sandbox environment.
31
+ Use this to run system commands, install packages, manipulate files with Unix tools, etc.
32
+ The environment persists across executions within the same session.`,
33
+ inputSchema: z.object({
34
+ command: z.string().describe('The shell command to execute'),
35
+ }),
36
+ callback: async ({ command }) => {
37
+ const result = await interpreter.executeCommand({ command });
38
+ return result;
39
+ },
40
+ });
41
+ }
42
+ //# sourceMappingURL=execute-command-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-command-tool.js","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/execute-command-tool.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,+HAA+H;AAC/H,MAAM,UAAU,wBAAwB,CAAC,WAA4B;IACnE,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE;;oEAEmD;QAChE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;SAC7D,CAAC;QACF,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YAC9B,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;YAE5D,OAAO,MAAM,CAAA;QACf,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { CodeInterpreter } from '../../client.js';
2
+ /**
3
+ * Creates a Strands SDK tool for file operations in CodeInterpreter.
4
+ *
5
+ * @param interpreter - CodeInterpreter instance
6
+ * @returns Strands SDK tool for file operations
7
+ *
8
+ * @experimental
9
+ * @example
10
+ * ```typescript
11
+ * import { createFileOperationsTool } from 'bedrock-agentcore/experimental/code-interpreter/strands'
12
+ * import { CodeInterpreter } from 'bedrock-agentcore/code-interpreter'
13
+ *
14
+ * const interpreter = new CodeInterpreter({ region: 'us-west-2' })
15
+ * const fileOpsTool = createFileOperationsTool(interpreter)
16
+ *
17
+ * // Use with Strands SDK Agent
18
+ * const agent = new Agent({
19
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
20
+ * tools: [fileOpsTool]
21
+ * })
22
+ * ```
23
+ */
24
+ export declare function createFileOperationsTool(interpreter: CodeInterpreter): import("@strands-agents/sdk").InvokableTool<{
25
+ operation: "remove" | "write" | "read" | "list";
26
+ path: string;
27
+ files?: {
28
+ path: string;
29
+ content: string;
30
+ }[] | undefined;
31
+ paths?: string[] | undefined;
32
+ }, string>;
33
+ //# sourceMappingURL=file-operations-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-operations-tool.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/file-operations-tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,eAAe;;;;;;;;WAwDpE"}
@@ -0,0 +1,78 @@
1
+ /// <reference types="node" />
2
+ import { tool } from '@strands-agents/sdk';
3
+ import { z } from 'zod';
4
+ /**
5
+ * Creates a Strands SDK tool for file operations in CodeInterpreter.
6
+ *
7
+ * @param interpreter - CodeInterpreter instance
8
+ * @returns Strands SDK tool for file operations
9
+ *
10
+ * @experimental
11
+ * @example
12
+ * ```typescript
13
+ * import { createFileOperationsTool } from 'bedrock-agentcore/experimental/code-interpreter/strands'
14
+ * import { CodeInterpreter } from 'bedrock-agentcore/code-interpreter'
15
+ *
16
+ * const interpreter = new CodeInterpreter({ region: 'us-west-2' })
17
+ * const fileOpsTool = createFileOperationsTool(interpreter)
18
+ *
19
+ * // Use with Strands SDK Agent
20
+ * const agent = new Agent({
21
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
22
+ * tools: [fileOpsTool]
23
+ * })
24
+ * ```
25
+ */
26
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/explicit-module-boundary-types
27
+ export function createFileOperationsTool(interpreter) {
28
+ return tool({
29
+ name: 'fileOperations',
30
+ description: `Manage files in the code execution sandbox.
31
+ Use this to create notebooks/scripts, store intermediate results, and inspect outputs.
32
+ Operations: write (create/update files), read (get file contents), list (show directory contents), remove (delete files).`,
33
+ inputSchema: z.object({
34
+ operation: z.enum(['write', 'read', 'list', 'remove']).describe('File operation to perform'),
35
+ files: z
36
+ .array(z.object({
37
+ path: z.string().describe('File path'),
38
+ content: z.string().describe('File content (for write operation)'),
39
+ }))
40
+ .optional()
41
+ .describe('Files to write (for write operation)'),
42
+ paths: z.array(z.string()).optional().describe('File paths to read or remove (for read/remove operations)'),
43
+ path: z.string().optional().default('.').describe('Directory path to list (for list operation)'),
44
+ }),
45
+ callback: async ({ operation, files, paths, path }) => {
46
+ switch (operation) {
47
+ case 'write': {
48
+ if (!files || files.length === 0) {
49
+ return 'status: error\nerror: No files specified for write operation';
50
+ }
51
+ const result = await interpreter.writeFiles({ files });
52
+ return result;
53
+ }
54
+ case 'read': {
55
+ if (!paths || paths.length === 0) {
56
+ return 'status: error\nerror: No paths specified for read operation';
57
+ }
58
+ const result = await interpreter.readFiles({ paths });
59
+ return result;
60
+ }
61
+ case 'list': {
62
+ const result = await interpreter.listFiles({ path });
63
+ return result;
64
+ }
65
+ case 'remove': {
66
+ if (!paths || paths.length === 0) {
67
+ return 'status: error\nerror: No paths specified for remove operation';
68
+ }
69
+ const result = await interpreter.removeFiles({ paths });
70
+ return result;
71
+ }
72
+ default:
73
+ return 'status: error\nerror: Invalid operation';
74
+ }
75
+ },
76
+ });
77
+ }
78
+ //# sourceMappingURL=file-operations-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-operations-tool.js","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/file-operations-tool.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,+HAA+H;AAC/H,MAAM,UAAU,wBAAwB,CAAC,WAA4B;IACnE,OAAO,IAAI,CAAC;QACV,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE;;0HAEyG;QACtH,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YAC5F,KAAK,EAAE,CAAC;iBACL,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;gBACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;gBACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;aACnE,CAAC,CACH;iBACA,QAAQ,EAAE;iBACV,QAAQ,CAAC,sCAAsC,CAAC;YACnD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;YAC3G,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,6CAA6C,CAAC;SACjG,CAAC;QACF,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;YACpD,QAAQ,SAAS,EAAE,CAAC;gBAClB,KAAK,OAAO,CAAC,CAAC,CAAC;oBACb,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACjC,OAAO,8DAA8D,CAAA;oBACvE,CAAC;oBACD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;oBACtD,OAAO,MAAM,CAAA;gBACf,CAAC;gBAED,KAAK,MAAM,CAAC,CAAC,CAAC;oBACZ,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACjC,OAAO,6DAA6D,CAAA;oBACtE,CAAC;oBACD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;oBACrD,OAAO,MAAM,CAAA;gBACf,CAAC;gBAED,KAAK,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;oBACpD,OAAO,MAAM,CAAA;gBACf,CAAC;gBAED,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACd,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACjC,OAAO,+DAA+D,CAAA;oBACxE,CAAC;oBACD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;oBACvD,OAAO,MAAM,CAAA;gBACf,CAAC;gBAED;oBACE,OAAO,yCAAyC,CAAA;YACpD,CAAC;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Strands SDK integrations for AWS Bedrock AgentCore CodeInterpreter.
3
+ *
4
+ * **⚠️ EXPERIMENTAL:** This integration uses the Strands TypeScript SDK, which is
5
+ * currently experimental and subject to breaking changes.
6
+ *
7
+ * This module provides a unified CodeInterpreterTools class that simplifies
8
+ * integration with Strands SDK Agent.
9
+ *
10
+ * @experimental
11
+ * @example
12
+ * ```typescript
13
+ * import { Agent, BedrockModel } from '@strands-agents/sdk'
14
+ * import { CodeInterpreterTools } from 'bedrock-agentcore/experimental/code-interpreter/strands'
15
+ *
16
+ * const codeInterpreter = new CodeInterpreterTools({ region: 'us-west-2' })
17
+ *
18
+ * const agent = new Agent({
19
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
20
+ * instructions: 'You are a helpful coding assistant...',
21
+ * tools: codeInterpreter.tools,
22
+ * })
23
+ *
24
+ * // Clean up when done
25
+ * await codeInterpreter.stopSession()
26
+ * ```
27
+ */
28
+ export { CodeInterpreterTools } from './tools.js';
29
+ export { createExecuteCodeTool } from './execute-code-tool.js';
30
+ export { createExecuteCommandTool } from './execute-command-tool.js';
31
+ export { createFileOperationsTool } from './file-operations-tool.js';
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Strands SDK integrations for AWS Bedrock AgentCore CodeInterpreter.
3
+ *
4
+ * **⚠️ EXPERIMENTAL:** This integration uses the Strands TypeScript SDK, which is
5
+ * currently experimental and subject to breaking changes.
6
+ *
7
+ * This module provides a unified CodeInterpreterTools class that simplifies
8
+ * integration with Strands SDK Agent.
9
+ *
10
+ * @experimental
11
+ * @example
12
+ * ```typescript
13
+ * import { Agent, BedrockModel } from '@strands-agents/sdk'
14
+ * import { CodeInterpreterTools } from 'bedrock-agentcore/experimental/code-interpreter/strands'
15
+ *
16
+ * const codeInterpreter = new CodeInterpreterTools({ region: 'us-west-2' })
17
+ *
18
+ * const agent = new Agent({
19
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
20
+ * instructions: 'You are a helpful coding assistant...',
21
+ * tools: codeInterpreter.tools,
22
+ * })
23
+ *
24
+ * // Clean up when done
25
+ * await codeInterpreter.stopSession()
26
+ * ```
27
+ */
28
+ export { CodeInterpreterTools } from './tools.js';
29
+ export { createExecuteCodeTool } from './execute-code-tool.js';
30
+ export { createExecuteCommandTool } from './execute-command-tool.js';
31
+ export { createFileOperationsTool } from './file-operations-tool.js';
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Unified CodeInterpreter Tools for Strands SDK
3
+ *
4
+ * Provides all three CodeInterpreter tools and session management in one class.
5
+ */
6
+ import { CodeInterpreter } from '../../client.js';
7
+ import type { CodeInterpreterConfig, SessionInfo } from '../../types.js';
8
+ import { createExecuteCodeTool } from './execute-code-tool.js';
9
+ import { createFileOperationsTool } from './file-operations-tool.js';
10
+ import { createExecuteCommandTool } from './execute-command-tool.js';
11
+ /**
12
+ * CodeInterpreterTools - All-in-one CodeInterpreter integration for Strands SDK
13
+ *
14
+ * Provides three ready-to-use tools and session management in a single class.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import { CodeInterpreterTools } from 'bedrock-agentcore/experimental/code-interpreter/strands'
19
+ * import { Agent, BedrockModel } from '@strands-agents/sdk'
20
+ *
21
+ * // Create tools instance
22
+ * const codeInterpreter = new CodeInterpreterTools({ region: 'us-west-2' })
23
+ *
24
+ * // Start session (optional - automatically started on first use)
25
+ * await codeInterpreter.startSession()
26
+ *
27
+ * // Create agent with all three tools
28
+ * const agent = new Agent({
29
+ * model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
30
+ * tools: codeInterpreter.tools,
31
+ * })
32
+ *
33
+ * // Clean up when done
34
+ * await codeInterpreter.stopSession()
35
+ * ```
36
+ */
37
+ export declare class CodeInterpreterTools {
38
+ private interpreter;
39
+ /**
40
+ * Tool for executing Python, JavaScript, or TypeScript code
41
+ */
42
+ readonly executeCode: ReturnType<typeof createExecuteCodeTool>;
43
+ /**
44
+ * Tool for file operations (read, write, list, remove)
45
+ */
46
+ readonly fileOperations: ReturnType<typeof createFileOperationsTool>;
47
+ /**
48
+ * Tool for executing shell commands
49
+ */
50
+ readonly executeCommand: ReturnType<typeof createExecuteCommandTool>;
51
+ /**
52
+ * All three tools in an array for easy spreading into agent config
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * const agent = new Agent({
57
+ * tools: codeInterpreter.tools, // spreads all three tools
58
+ * })
59
+ *
60
+ * // Or combine with other tools
61
+ * const agent = new Agent({
62
+ * tools: [...codeInterpreter.tools, ...browserTools.tools],
63
+ * })
64
+ * ```
65
+ */
66
+ readonly tools: Array<ReturnType<typeof createExecuteCodeTool> | ReturnType<typeof createFileOperationsTool> | ReturnType<typeof createExecuteCommandTool>>;
67
+ constructor(config?: CodeInterpreterConfig);
68
+ /**
69
+ * Start a CodeInterpreter session
70
+ *
71
+ * Sessions are automatically started on first tool use, but you can
72
+ * call this explicitly to start the session upfront.
73
+ *
74
+ * @param sessionName - Optional session name for AWS
75
+ * @param timeout - Optional session timeout in seconds (default: 900, max: 28800)
76
+ * @returns Session information
77
+ */
78
+ startSession(sessionName?: string, timeout?: number): Promise<SessionInfo>;
79
+ /**
80
+ * Stop the current CodeInterpreter session
81
+ *
82
+ * Call this when you're done using the tools to clean up resources.
83
+ */
84
+ stopSession(): Promise<void>;
85
+ /**
86
+ * Get the underlying CodeInterpreter client
87
+ *
88
+ * Provides direct access to the client for advanced use cases.
89
+ *
90
+ * @returns The CodeInterpreter client instance
91
+ */
92
+ getClient(): CodeInterpreter;
93
+ }
94
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-interpreter/integrations/strands/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAsB,MAAM,gBAAgB,CAAA;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,WAAW,CAAiB;IAEpC;;OAEG;IACH,SAAgB,WAAW,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;IAErE;;OAEG;IACH,SAAgB,cAAc,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;IAE3E;;OAEG;IACH,SAAgB,cAAc,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;IAE3E;;;;;;;;;;;;;;OAcG;IACH,SAAgB,KAAK,EAAE,KAAK,CACxB,UAAU,CAAC,OAAO,qBAAqB,CAAC,GACxC,UAAU,CAAC,OAAO,wBAAwB,CAAC,GAC3C,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAC9C,CAAA;gBAEW,MAAM,GAAE,qBAA0B;IAY9C;;;;;;;;;OASG;IACG,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOhF;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC;;;;;;OAMG;IACH,SAAS,IAAI,eAAe;CAG7B"}