@mastra/agentcore 0.3.0 → 0.3.1-alpha.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.
package/dist/index.cjs CHANGED
@@ -1,331 +1,321 @@
1
- 'use strict';
2
-
3
- var crypto = require('crypto');
4
- var clientBedrockAgentcore = require('@aws-sdk/client-bedrock-agentcore');
5
- var workspace = require('@mastra/core/workspace');
6
-
7
- // src/sandbox/index.ts
8
- var LOG_PREFIX = "[AgentCoreRuntimeSandbox]";
9
- var DEFAULT_COMMAND_TIMEOUT_MS = 3e5;
10
- var MAX_AGENTCORE_TIMEOUT_SECONDS = 3600;
11
- var DEFAULT_ACCEPT = "application/vnd.amazon.eventstream";
12
- var DEFAULT_CONTENT_TYPE = "application/json";
13
- var CommandOutputAccumulator = class extends workspace.ProcessHandle {
14
- pid = "agentcore-command";
15
- exitCode;
16
- async kill() {
17
- return false;
18
- }
19
- async sendStdin() {
20
- throw new Error("AgentCore Runtime command execution does not support stdin");
21
- }
22
- async wait() {
23
- return {
24
- success: this.exitCode === 0,
25
- exitCode: this.exitCode ?? 1,
26
- stdout: this.stdout,
27
- stderr: this.stderr,
28
- executionTimeMs: 0
29
- };
30
- }
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let crypto = require("crypto");
3
+ let _aws_sdk_client_bedrock_agentcore = require("@aws-sdk/client-bedrock-agentcore");
4
+ let _mastra_core_workspace = require("@mastra/core/workspace");
5
+ //#region src/sandbox/index.ts
6
+ /**
7
+ * AWS Bedrock AgentCore Runtime sandbox provider.
8
+ *
9
+ * This provider maps Mastra's one-shot command execution contract to
10
+ * InvokeAgentRuntimeCommand. It intentionally does not expose process
11
+ * management or filesystem mounts because AgentCore Runtime command execution
12
+ * does not provide those WorkspaceSandbox semantics.
13
+ *
14
+ * @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-execute-command.html
15
+ */
16
+ const LOG_PREFIX = "[AgentCoreRuntimeSandbox]";
17
+ const DEFAULT_COMMAND_TIMEOUT_MS = 3e5;
18
+ const MAX_AGENTCORE_TIMEOUT_SECONDS = 3600;
19
+ const DEFAULT_ACCEPT = "application/vnd.amazon.eventstream";
20
+ const DEFAULT_CONTENT_TYPE = "application/json";
21
+ var CommandOutputAccumulator = class extends _mastra_core_workspace.ProcessHandle {
22
+ pid = "agentcore-command";
23
+ exitCode;
24
+ async kill() {
25
+ return false;
26
+ }
27
+ async sendStdin() {
28
+ throw new Error("AgentCore Runtime command execution does not support stdin");
29
+ }
30
+ async wait() {
31
+ return {
32
+ success: this.exitCode === 0,
33
+ exitCode: this.exitCode ?? 1,
34
+ stdout: this.stdout,
35
+ stderr: this.stderr,
36
+ executionTimeMs: 0
37
+ };
38
+ }
31
39
  };
32
40
  function shellQuote(arg) {
33
- if (/^[a-zA-Z0-9._\-\/=:@]+$/.test(arg)) return arg;
34
- return `'${arg.replace(/'/g, "'\\''")}'`;
41
+ if (/^[a-zA-Z0-9._\-\/=:@]+$/.test(arg)) return arg;
42
+ return `'${arg.replace(/'/g, "'\\''")}'`;
35
43
  }
36
44
  function safeEnvName(name) {
37
- return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);
45
+ return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);
38
46
  }
39
47
  function buildCommand(command, args, options) {
40
- const baseCommand = args?.length ? `${command} ${args.map((arg) => shellQuote(arg)).join(" ")}` : command;
41
- const parts = [];
42
- if (options?.cwd) {
43
- parts.push(`cd ${shellQuote(options.cwd)}`);
44
- }
45
- const env = options?.env ?? {};
46
- const envAssignments = Object.entries(env).filter((entry) => entry[1] !== void 0).map(([key, value]) => {
47
- if (!safeEnvName(key)) {
48
- throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);
49
- }
50
- return `${key}=${shellQuote(value)}`;
51
- });
52
- parts.push(`${envAssignments.length ? `${envAssignments.join(" ")} ` : ""}${baseCommand}`);
53
- return parts.join(" && ");
48
+ const baseCommand = args?.length ? `${command} ${args.map((arg) => shellQuote(arg)).join(" ")}` : command;
49
+ const parts = [];
50
+ if (options?.cwd) parts.push(`cd ${shellQuote(options.cwd)}`);
51
+ const env = options?.env ?? {};
52
+ const envAssignments = Object.entries(env).filter((entry) => entry[1] !== void 0).map(([key, value]) => {
53
+ if (!safeEnvName(key)) throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);
54
+ return `${key}=${shellQuote(value)}`;
55
+ });
56
+ parts.push(`${envAssignments.length ? `${envAssignments.join(" ")} ` : ""}${baseCommand}`);
57
+ return parts.join(" && ");
54
58
  }
55
59
  function toAgentCoreTimeoutSeconds(timeoutMs) {
56
- if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
57
- throw new RangeError("AgentCore Runtime command timeout must be a positive number of milliseconds");
58
- }
59
- const timeoutSeconds = Math.ceil(timeoutMs / 1e3);
60
- if (timeoutSeconds > MAX_AGENTCORE_TIMEOUT_SECONDS) {
61
- throw new RangeError(`AgentCore Runtime command timeout must be at most ${MAX_AGENTCORE_TIMEOUT_SECONDS} seconds`);
62
- }
63
- return timeoutSeconds;
60
+ if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) throw new RangeError("AgentCore Runtime command timeout must be a positive number of milliseconds");
61
+ const timeoutSeconds = Math.ceil(timeoutMs / 1e3);
62
+ if (timeoutSeconds > MAX_AGENTCORE_TIMEOUT_SECONDS) throw new RangeError(`AgentCore Runtime command timeout must be at most ${MAX_AGENTCORE_TIMEOUT_SECONDS} seconds`);
63
+ return timeoutSeconds;
64
64
  }
65
65
  function generateSessionId() {
66
- return crypto.randomUUID();
66
+ return (0, crypto.randomUUID)();
67
67
  }
68
68
  function getStreamException(event) {
69
- const exceptionKeys = [
70
- "accessDeniedException",
71
- "internalServerException",
72
- "resourceNotFoundException",
73
- "serviceQuotaExceededException",
74
- "throttlingException",
75
- "validationException",
76
- "runtimeClientError"
77
- ];
78
- for (const key of exceptionKeys) {
79
- const value = event[key];
80
- if (value) return { key, value };
81
- }
82
- if (event.$unknown) {
83
- return { key: event.$unknown[0], value: event.$unknown[1] };
84
- }
85
- return void 0;
69
+ for (const key of [
70
+ "accessDeniedException",
71
+ "internalServerException",
72
+ "resourceNotFoundException",
73
+ "serviceQuotaExceededException",
74
+ "throttlingException",
75
+ "validationException",
76
+ "runtimeClientError"
77
+ ]) {
78
+ const value = event[key];
79
+ if (value) return {
80
+ key,
81
+ value
82
+ };
83
+ }
84
+ if (event.$unknown) return {
85
+ key: event.$unknown[0],
86
+ value: event.$unknown[1]
87
+ };
86
88
  }
87
89
  function formatStreamException(key, value) {
88
- if (value && typeof value === "object") {
89
- const exception = value;
90
- const name = exception.name ?? key;
91
- return exception.message ? `${name}: ${exception.message}` : name;
92
- }
93
- return `${key}: ${String(value)}`;
90
+ if (value && typeof value === "object") {
91
+ const exception = value;
92
+ const name = exception.name ?? key;
93
+ return exception.message ? `${name}: ${exception.message}` : name;
94
+ }
95
+ return `${key}: ${String(value)}`;
94
96
  }
95
- var AgentCoreRuntimeSandbox = class extends workspace.MastraSandbox {
96
- id;
97
- name = "AgentCoreRuntimeSandbox";
98
- provider = "agentcore";
99
- status = "pending";
100
- _client;
101
- _ownsClient;
102
- _region;
103
- _agentRuntimeArn;
104
- _runtimeSessionId;
105
- _qualifier;
106
- _contentType;
107
- _accept;
108
- _commandTimeout;
109
- _stopSessionOnLifecycle;
110
- _stopClientToken;
111
- _instructionsOverride;
112
- _createdAt = /* @__PURE__ */ new Date();
113
- _lastUsedAt;
114
- constructor(options) {
115
- super({ ...options, name: "AgentCoreRuntimeSandbox" });
116
- if (!options.agentRuntimeArn) {
117
- throw new Error(`${LOG_PREFIX} agentRuntimeArn is required`);
118
- }
119
- this.id = options.runtimeSessionId ?? generateSessionId();
120
- this._agentRuntimeArn = options.agentRuntimeArn;
121
- this._runtimeSessionId = this.id;
122
- this._qualifier = options.qualifier;
123
- this._contentType = options.contentType ?? DEFAULT_CONTENT_TYPE;
124
- this._accept = options.accept ?? DEFAULT_ACCEPT;
125
- this._commandTimeout = options.commandTimeout ?? DEFAULT_COMMAND_TIMEOUT_MS;
126
- this._stopSessionOnLifecycle = options.stopSessionOnLifecycle ?? false;
127
- this._stopClientToken = options.stopClientToken;
128
- this._instructionsOverride = options.instructions;
129
- this._client = options.client;
130
- this._ownsClient = !options.client;
131
- this._region = options.region;
132
- }
133
- get runtimeSessionId() {
134
- return this._runtimeSessionId;
135
- }
136
- get agentRuntimeArn() {
137
- return this._agentRuntimeArn;
138
- }
139
- async start() {
140
- this.logger.debug(`${LOG_PREFIX} Using AgentCore Runtime session ${this._runtimeSessionId}`);
141
- }
142
- async stop() {
143
- if (!this._stopSessionOnLifecycle) return;
144
- await this.stopRuntimeSession();
145
- }
146
- async destroy() {
147
- if (this._stopSessionOnLifecycle) {
148
- await this.stopRuntimeSession();
149
- }
150
- if (this._ownsClient && this._client) {
151
- this._client.destroy();
152
- this._client = void 0;
153
- }
154
- }
155
- /**
156
- * Explicitly stops the AgentCore Runtime session used by this sandbox.
157
- *
158
- * This is separate from destroy() because AgentCore Runtime sessions can be
159
- * shared with agent invocations outside the WorkspaceSandbox lifecycle.
160
- */
161
- async stopRuntimeSession() {
162
- await this._getClient().send(
163
- new clientBedrockAgentcore.StopRuntimeSessionCommand({
164
- agentRuntimeArn: this._agentRuntimeArn,
165
- runtimeSessionId: this._runtimeSessionId,
166
- qualifier: this._qualifier,
167
- clientToken: this._stopClientToken ?? generateSessionId()
168
- })
169
- );
170
- }
171
- async executeCommand(command, args, options) {
172
- await this.ensureRunning();
173
- const fullCommand = buildCommand(command, args, options);
174
- const timeoutMs = options?.timeout ?? this._commandTimeout;
175
- const timeoutSeconds = toAgentCoreTimeoutSeconds(timeoutMs);
176
- const startTime = Date.now();
177
- const output = new CommandOutputAccumulator({
178
- maxRetainedBytes: options?.maxRetainedBytes ?? Infinity,
179
- onStdout: options?.onStdout,
180
- onStderr: options?.onStderr
181
- });
182
- let stopStatus;
183
- this.logger.debug(`${LOG_PREFIX} Executing command`, {
184
- runtimeSessionId: this._runtimeSessionId,
185
- command: fullCommand,
186
- timeoutSeconds
187
- });
188
- const response = await this._getClient().send(
189
- new clientBedrockAgentcore.InvokeAgentRuntimeCommandCommand({
190
- agentRuntimeArn: this._agentRuntimeArn,
191
- runtimeSessionId: this._runtimeSessionId,
192
- qualifier: this._qualifier,
193
- contentType: this._contentType,
194
- accept: this._accept,
195
- body: {
196
- command: fullCommand,
197
- timeout: timeoutSeconds
198
- }
199
- }),
200
- { abortSignal: options?.abortSignal }
201
- );
202
- for await (const event of response.stream ?? []) {
203
- const streamEvent = event;
204
- const streamException = getStreamException(streamEvent);
205
- if (streamException) {
206
- throw new Error(`${LOG_PREFIX} ${formatStreamException(streamException.key, streamException.value)}`);
207
- }
208
- const chunk = streamEvent.chunk;
209
- if (!chunk) continue;
210
- if (chunk.contentDelta?.stdout) {
211
- output.emitStdout(chunk.contentDelta.stdout);
212
- }
213
- if (chunk.contentDelta?.stderr) {
214
- output.emitStderr(chunk.contentDelta.stderr);
215
- }
216
- if (chunk.contentStop) {
217
- output.exitCode = chunk.contentStop.exitCode ?? 1;
218
- stopStatus = chunk.contentStop.status;
219
- }
220
- }
221
- const executionTimeMs = Date.now() - startTime;
222
- const exitCode = output.exitCode ?? 1;
223
- const timedOut = stopStatus === "TIMED_OUT";
224
- const finalExitCode = timedOut ? 124 : exitCode;
225
- this._lastUsedAt = /* @__PURE__ */ new Date();
226
- return {
227
- command: fullCommand,
228
- args,
229
- success: finalExitCode === 0 && !timedOut,
230
- exitCode: finalExitCode,
231
- stdout: output.stdout,
232
- stderr: output.stderr,
233
- executionTimeMs,
234
- timedOut,
235
- stdoutTruncated: output.stdoutTruncated,
236
- stderrTruncated: output.stderrTruncated,
237
- stdoutDroppedBytes: output.stdoutDroppedBytes,
238
- stderrDroppedBytes: output.stderrDroppedBytes
239
- };
240
- }
241
- getInstructions(opts) {
242
- const defaultInstructions = this._getDefaultInstructions();
243
- if (this._instructionsOverride === void 0) return defaultInstructions;
244
- if (typeof this._instructionsOverride === "string") return this._instructionsOverride;
245
- return this._instructionsOverride({ defaultInstructions, requestContext: opts?.requestContext });
246
- }
247
- async getInfo() {
248
- return {
249
- id: this.id,
250
- name: this.name,
251
- provider: this.provider,
252
- status: this.status,
253
- createdAt: this._createdAt,
254
- lastUsedAt: this._lastUsedAt,
255
- metadata: {
256
- agentRuntimeArn: this._agentRuntimeArn,
257
- runtimeSessionId: this._runtimeSessionId,
258
- qualifier: this._qualifier ?? "DEFAULT",
259
- stopSessionOnLifecycle: this._stopSessionOnLifecycle
260
- }
261
- };
262
- }
263
- _getDefaultInstructions() {
264
- return [
265
- "AWS Bedrock AgentCore Runtime sandbox.",
266
- "Commands run inside the configured AgentCore Runtime session container.",
267
- "Command output streams from AgentCore Runtime as stdout and stderr.",
268
- "Limitations:",
269
- "- Commands are one-shot and non-interactive.",
270
- "- There is no persistent shell session between commands.",
271
- "- Background process management is not exposed by this provider.",
272
- "- Filesystem mounts are not exposed by this provider.",
273
- "- Developer tools such as git, npm, Python, or Node must exist in the AgentCore container image.",
274
- "- AgentCore Code Interpreter is a separate service and is not part of this runtime sandbox."
275
- ].join("\n");
276
- }
277
- _getClient() {
278
- if (!this._client) {
279
- this._client = new clientBedrockAgentcore.BedrockAgentCoreClient({ region: this._region });
280
- }
281
- return this._client;
282
- }
97
+ var AgentCoreRuntimeSandbox = class extends _mastra_core_workspace.MastraSandbox {
98
+ id;
99
+ name = "AgentCoreRuntimeSandbox";
100
+ provider = "agentcore";
101
+ status = "pending";
102
+ _client;
103
+ _ownsClient;
104
+ _region;
105
+ _agentRuntimeArn;
106
+ _runtimeSessionId;
107
+ _qualifier;
108
+ _contentType;
109
+ _accept;
110
+ _commandTimeout;
111
+ _stopSessionOnLifecycle;
112
+ _stopClientToken;
113
+ _instructionsOverride;
114
+ _createdAt = /* @__PURE__ */ new Date();
115
+ _lastUsedAt;
116
+ constructor(options) {
117
+ super({
118
+ ...options,
119
+ name: "AgentCoreRuntimeSandbox"
120
+ });
121
+ if (!options.agentRuntimeArn) throw new Error(`${LOG_PREFIX} agentRuntimeArn is required`);
122
+ this.id = options.runtimeSessionId ?? generateSessionId();
123
+ this._agentRuntimeArn = options.agentRuntimeArn;
124
+ this._runtimeSessionId = this.id;
125
+ this._qualifier = options.qualifier;
126
+ this._contentType = options.contentType ?? DEFAULT_CONTENT_TYPE;
127
+ this._accept = options.accept ?? DEFAULT_ACCEPT;
128
+ this._commandTimeout = options.commandTimeout ?? DEFAULT_COMMAND_TIMEOUT_MS;
129
+ this._stopSessionOnLifecycle = options.stopSessionOnLifecycle ?? false;
130
+ this._stopClientToken = options.stopClientToken;
131
+ this._instructionsOverride = options.instructions;
132
+ this._client = options.client;
133
+ this._ownsClient = !options.client;
134
+ this._region = options.region;
135
+ }
136
+ get runtimeSessionId() {
137
+ return this._runtimeSessionId;
138
+ }
139
+ get agentRuntimeArn() {
140
+ return this._agentRuntimeArn;
141
+ }
142
+ async start() {
143
+ this.logger.debug(`${LOG_PREFIX} Using AgentCore Runtime session ${this._runtimeSessionId}`);
144
+ }
145
+ async stop() {
146
+ if (!this._stopSessionOnLifecycle) return;
147
+ await this.stopRuntimeSession();
148
+ }
149
+ async destroy() {
150
+ if (this._stopSessionOnLifecycle) await this.stopRuntimeSession();
151
+ if (this._ownsClient && this._client) {
152
+ this._client.destroy();
153
+ this._client = void 0;
154
+ }
155
+ }
156
+ /**
157
+ * Explicitly stops the AgentCore Runtime session used by this sandbox.
158
+ *
159
+ * This is separate from destroy() because AgentCore Runtime sessions can be
160
+ * shared with agent invocations outside the WorkspaceSandbox lifecycle.
161
+ */
162
+ async stopRuntimeSession() {
163
+ await this._getClient().send(new _aws_sdk_client_bedrock_agentcore.StopRuntimeSessionCommand({
164
+ agentRuntimeArn: this._agentRuntimeArn,
165
+ runtimeSessionId: this._runtimeSessionId,
166
+ qualifier: this._qualifier,
167
+ clientToken: this._stopClientToken ?? generateSessionId()
168
+ }));
169
+ }
170
+ async executeCommand(command, args, options) {
171
+ await this.ensureRunning();
172
+ const fullCommand = buildCommand(command, args, options);
173
+ const timeoutSeconds = toAgentCoreTimeoutSeconds(options?.timeout ?? this._commandTimeout);
174
+ const startTime = Date.now();
175
+ const output = new CommandOutputAccumulator({
176
+ maxRetainedBytes: options?.maxRetainedBytes ?? Infinity,
177
+ onStdout: options?.onStdout,
178
+ onStderr: options?.onStderr
179
+ });
180
+ let stopStatus;
181
+ this.logger.debug(`${LOG_PREFIX} Executing command`, {
182
+ runtimeSessionId: this._runtimeSessionId,
183
+ command: fullCommand,
184
+ timeoutSeconds
185
+ });
186
+ const response = await this._getClient().send(new _aws_sdk_client_bedrock_agentcore.InvokeAgentRuntimeCommandCommand({
187
+ agentRuntimeArn: this._agentRuntimeArn,
188
+ runtimeSessionId: this._runtimeSessionId,
189
+ qualifier: this._qualifier,
190
+ contentType: this._contentType,
191
+ accept: this._accept,
192
+ body: {
193
+ command: fullCommand,
194
+ timeout: timeoutSeconds
195
+ }
196
+ }), { abortSignal: options?.abortSignal });
197
+ for await (const event of response.stream ?? []) {
198
+ const streamEvent = event;
199
+ const streamException = getStreamException(streamEvent);
200
+ if (streamException) throw new Error(`${LOG_PREFIX} ${formatStreamException(streamException.key, streamException.value)}`);
201
+ const chunk = streamEvent.chunk;
202
+ if (!chunk) continue;
203
+ if (chunk.contentDelta?.stdout) output.emitStdout(chunk.contentDelta.stdout);
204
+ if (chunk.contentDelta?.stderr) output.emitStderr(chunk.contentDelta.stderr);
205
+ if (chunk.contentStop) {
206
+ output.exitCode = chunk.contentStop.exitCode ?? 1;
207
+ stopStatus = chunk.contentStop.status;
208
+ }
209
+ }
210
+ const executionTimeMs = Date.now() - startTime;
211
+ const exitCode = output.exitCode ?? 1;
212
+ const timedOut = stopStatus === "TIMED_OUT";
213
+ const finalExitCode = timedOut ? 124 : exitCode;
214
+ this._lastUsedAt = /* @__PURE__ */ new Date();
215
+ return {
216
+ command: fullCommand,
217
+ args,
218
+ success: finalExitCode === 0 && !timedOut,
219
+ exitCode: finalExitCode,
220
+ stdout: output.stdout,
221
+ stderr: output.stderr,
222
+ executionTimeMs,
223
+ timedOut,
224
+ stdoutTruncated: output.stdoutTruncated,
225
+ stderrTruncated: output.stderrTruncated,
226
+ stdoutDroppedBytes: output.stdoutDroppedBytes,
227
+ stderrDroppedBytes: output.stderrDroppedBytes
228
+ };
229
+ }
230
+ getInstructions(opts) {
231
+ const defaultInstructions = this._getDefaultInstructions();
232
+ if (this._instructionsOverride === void 0) return defaultInstructions;
233
+ if (typeof this._instructionsOverride === "string") return this._instructionsOverride;
234
+ return this._instructionsOverride({
235
+ defaultInstructions,
236
+ requestContext: opts?.requestContext
237
+ });
238
+ }
239
+ async getInfo() {
240
+ return {
241
+ id: this.id,
242
+ name: this.name,
243
+ provider: this.provider,
244
+ status: this.status,
245
+ createdAt: this._createdAt,
246
+ lastUsedAt: this._lastUsedAt,
247
+ metadata: {
248
+ agentRuntimeArn: this._agentRuntimeArn,
249
+ runtimeSessionId: this._runtimeSessionId,
250
+ qualifier: this._qualifier ?? "DEFAULT",
251
+ stopSessionOnLifecycle: this._stopSessionOnLifecycle
252
+ }
253
+ };
254
+ }
255
+ _getDefaultInstructions() {
256
+ return [
257
+ "AWS Bedrock AgentCore Runtime sandbox.",
258
+ "Commands run inside the configured AgentCore Runtime session container.",
259
+ "Command output streams from AgentCore Runtime as stdout and stderr.",
260
+ "Limitations:",
261
+ "- Commands are one-shot and non-interactive.",
262
+ "- There is no persistent shell session between commands.",
263
+ "- Background process management is not exposed by this provider.",
264
+ "- Filesystem mounts are not exposed by this provider.",
265
+ "- Developer tools such as git, npm, Python, or Node must exist in the AgentCore container image.",
266
+ "- AgentCore Code Interpreter is a separate service and is not part of this runtime sandbox."
267
+ ].join("\n");
268
+ }
269
+ _getClient() {
270
+ if (!this._client) this._client = new _aws_sdk_client_bedrock_agentcore.BedrockAgentCoreClient({ region: this._region });
271
+ return this._client;
272
+ }
283
273
  };
284
-
285
- // src/provider.ts
286
- var agentCoreRuntimeSandboxProvider = {
287
- id: "agentcore",
288
- name: "AgentCore Runtime Sandbox",
289
- description: "AWS Bedrock AgentCore Runtime command execution sandbox",
290
- configSchema: {
291
- type: "object",
292
- required: ["agentRuntimeArn"],
293
- properties: {
294
- region: {
295
- type: "string",
296
- description: "AWS region for Bedrock AgentCore"
297
- },
298
- agentRuntimeArn: {
299
- type: "string",
300
- description: "AgentCore Runtime ARN"
301
- },
302
- runtimeSessionId: {
303
- type: "string",
304
- description: "Runtime session ID. Defaults to a generated UUID."
305
- },
306
- qualifier: {
307
- type: "string",
308
- description: "Agent runtime qualifier/endpoint",
309
- default: "DEFAULT"
310
- },
311
- commandTimeout: {
312
- type: "number",
313
- description: "Default command timeout in milliseconds. Must be between 1 and 3,600,000.",
314
- default: 3e5,
315
- minimum: 1,
316
- maximum: 36e5
317
- },
318
- stopSessionOnLifecycle: {
319
- type: "boolean",
320
- description: "Stop the AgentCore Runtime session during stop()/destroy()",
321
- default: false
322
- }
323
- }
324
- },
325
- createSandbox: (config) => new AgentCoreRuntimeSandbox(config)
274
+ //#endregion
275
+ //#region src/provider.ts
276
+ const agentCoreRuntimeSandboxProvider = {
277
+ id: "agentcore",
278
+ name: "AgentCore Runtime Sandbox",
279
+ description: "AWS Bedrock AgentCore Runtime command execution sandbox",
280
+ configSchema: {
281
+ type: "object",
282
+ required: ["agentRuntimeArn"],
283
+ properties: {
284
+ region: {
285
+ type: "string",
286
+ description: "AWS region for Bedrock AgentCore"
287
+ },
288
+ agentRuntimeArn: {
289
+ type: "string",
290
+ description: "AgentCore Runtime ARN"
291
+ },
292
+ runtimeSessionId: {
293
+ type: "string",
294
+ description: "Runtime session ID. Defaults to a generated UUID."
295
+ },
296
+ qualifier: {
297
+ type: "string",
298
+ description: "Agent runtime qualifier/endpoint",
299
+ default: "DEFAULT"
300
+ },
301
+ commandTimeout: {
302
+ type: "number",
303
+ description: "Default command timeout in milliseconds. Must be between 1 and 3,600,000.",
304
+ default: 3e5,
305
+ minimum: 1,
306
+ maximum: 36e5
307
+ },
308
+ stopSessionOnLifecycle: {
309
+ type: "boolean",
310
+ description: "Stop the AgentCore Runtime session during stop()/destroy()",
311
+ default: false
312
+ }
313
+ }
314
+ },
315
+ createSandbox: (config) => new AgentCoreRuntimeSandbox(config)
326
316
  };
327
-
317
+ //#endregion
328
318
  exports.AgentCoreRuntimeSandbox = AgentCoreRuntimeSandbox;
329
319
  exports.agentCoreRuntimeSandboxProvider = agentCoreRuntimeSandboxProvider;
330
- //# sourceMappingURL=index.cjs.map
320
+
331
321
  //# sourceMappingURL=index.cjs.map