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