@mastra/agentcore 0.4.1 → 0.5.0-alpha.1

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/LICENSE.md CHANGED
@@ -1,10 +1,12 @@
1
1
  Portions of this software are licensed as follows:
2
2
 
3
- - All content that resides under any directory named "ee/" within this
3
+ - All content that resides under any directory named `ee/` within this
4
4
  repository, including but not limited to:
5
- - `packages/core/src/auth/ee/`
6
- - `packages/server/src/server/auth/ee/`
7
- is licensed under the license defined in `ee/LICENSE`.
5
+ - `@mastra/core/auth/ee`
6
+ - `@mastra/core/agent-builder/ee`
7
+ - `@mastra/editor/ee`
8
+
9
+ is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
8
10
 
9
11
  - All third-party components incorporated into the Mastra Software are
10
12
  licensed under the original license provided by the owner of the
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mastra/agentcore
2
2
 
3
- AWS Bedrock AgentCore Runtime sandbox provider for Mastra workspaces.
3
+ Execute commands in AWS Bedrock AgentCore Runtime sessions from Mastra workspaces, with session management, environment variables, and file operations.
4
4
 
5
5
  ## Installation
6
6
 
@@ -28,8 +28,14 @@ const result = await workspace.sandbox?.executeCommand?.('npm', ['test'], {
28
28
  });
29
29
  ```
30
30
 
31
- `AgentCoreRuntimeSandbox` uses `InvokeAgentRuntimeCommand` to run one-shot shell commands inside an existing AgentCore Runtime session. It does not provide background process management or filesystem mounts.
31
+ ## Documentation
32
32
 
33
- By default, `destroy()` does not stop the AgentCore Runtime session because sessions can be shared with other AgentCore invocations. Call `stopRuntimeSession()` explicitly, or set `stopSessionOnLifecycle: true`, when the sandbox owns the session and should clean it up.
33
+ - [AgentCore](https://mastra.ai/integrations/sandboxes/agentcore)
34
34
 
35
- AgentCore Code Interpreter is a separate AgentCore service and is not part of this runtime sandbox provider.
35
+ ## Changelog
36
+
37
+ See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/workspaces/agentcore/CHANGELOG.md) for version history and release notes.
38
+
39
+ ## Support
40
+
41
+ We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
package/dist/index.cjs CHANGED
@@ -47,10 +47,11 @@ function shellQuote(arg) {
47
47
  function safeEnvName(name) {
48
48
  return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);
49
49
  }
50
- function buildCommand(command, args, options) {
50
+ function buildCommand(command, args, options, workingDirectory) {
51
51
  const baseCommand = args?.length ? `${command} ${args.map((arg) => shellQuote(arg)).join(" ")}` : command;
52
52
  const parts = [];
53
- if (options?.cwd) parts.push(`cd ${shellQuote(options.cwd)}`);
53
+ const cwd = options?.cwd ?? workingDirectory;
54
+ if (cwd) parts.push(`cd ${shellQuote(cwd)}`);
54
55
  const env = options?.env ?? {};
55
56
  const envAssignments = Object.entries(env).filter((entry) => entry[1] !== void 0).map(([key, value]) => {
56
57
  if (!safeEnvName(key)) throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);
@@ -178,7 +179,7 @@ var AgentCoreRuntimeSandbox = class extends _mastra_core_workspace.MastraSandbox
178
179
  ...this.getEnv(),
179
180
  ...options?.env
180
181
  }
181
- });
182
+ }, this.workingDirectory);
182
183
  const timeoutSeconds = toAgentCoreTimeoutSeconds(options?.timeout ?? this._commandTimeout);
183
184
  const startTime = Date.now();
184
185
  const output = new CommandOutputAccumulator({
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["ProcessHandle","UnsupportedStdinCloseError","MastraSandbox","StopRuntimeSessionCommand","InvokeAgentRuntimeCommandCommand","BedrockAgentCoreClient"],"sources":["../src/sandbox/index.ts","../src/provider.ts"],"sourcesContent":["/**\n * AWS Bedrock AgentCore Runtime sandbox provider.\n *\n * This provider maps Mastra's one-shot command execution contract to\n * InvokeAgentRuntimeCommand. It intentionally does not expose process\n * management or filesystem mounts because AgentCore Runtime command execution\n * does not provide those WorkspaceSandbox semantics.\n *\n * @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-execute-command.html\n */\n\nimport { randomUUID } from 'node:crypto';\nimport {\n BedrockAgentCoreClient,\n InvokeAgentRuntimeCommandCommand,\n StopRuntimeSessionCommand,\n} from '@aws-sdk/client-bedrock-agentcore';\nimport type { RequestContext } from '@mastra/core/di';\nimport type {\n CommandResult,\n ExecuteCommandOptions,\n MastraSandboxOptions,\n ProviderStatus,\n SandboxInfo,\n} from '@mastra/core/workspace';\nimport { MastraSandbox, ProcessHandle, UnsupportedStdinCloseError } from '@mastra/core/workspace';\n\nconst LOG_PREFIX = '[AgentCoreRuntimeSandbox]';\nconst DEFAULT_COMMAND_TIMEOUT_MS = 300_000;\nconst MAX_AGENTCORE_TIMEOUT_SECONDS = 3600;\nconst DEFAULT_ACCEPT = 'application/vnd.amazon.eventstream';\nconst DEFAULT_CONTENT_TYPE = 'application/json';\n\ntype AgentCoreRuntimeClient = Pick<BedrockAgentCoreClient, 'send' | 'destroy'>;\ntype InstructionsOption = string | ((opts: { defaultInstructions: string; requestContext?: RequestContext }) => string);\ntype AgentCoreStreamException = {\n name?: string;\n message?: string;\n};\n\ntype AgentCoreStreamEvent = {\n chunk?: {\n contentStart?: unknown;\n contentDelta?: {\n stdout?: string;\n stderr?: string;\n };\n contentStop?: {\n exitCode?: number;\n status?: string;\n };\n };\n accessDeniedException?: AgentCoreStreamException;\n internalServerException?: AgentCoreStreamException;\n resourceNotFoundException?: AgentCoreStreamException;\n serviceQuotaExceededException?: AgentCoreStreamException;\n throttlingException?: AgentCoreStreamException;\n validationException?: AgentCoreStreamException;\n runtimeClientError?: AgentCoreStreamException;\n $unknown?: [string, unknown];\n};\n\nclass CommandOutputAccumulator extends ProcessHandle {\n readonly pid = 'agentcore-command';\n exitCode: number | undefined;\n\n async kill(): Promise<boolean> {\n return false;\n }\n\n async sendStdin(): Promise<void> {\n throw new Error('AgentCore Runtime command execution does not support stdin');\n }\n\n async closeStdin(): Promise<void> {\n throw new UnsupportedStdinCloseError('AgentCore Runtime command execution does not support closing stdin');\n }\n\n async wait(): Promise<CommandResult> {\n return {\n success: this.exitCode === 0,\n exitCode: this.exitCode ?? 1,\n stdout: this.stdout,\n stderr: this.stderr,\n executionTimeMs: 0,\n };\n }\n}\n\nfunction shellQuote(arg: string): string {\n if (/^[a-zA-Z0-9._\\-\\/=:@]+$/.test(arg)) return arg;\n return `'${arg.replace(/'/g, \"'\\\\''\")}'`;\n}\n\nfunction safeEnvName(name: string): boolean {\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);\n}\n\nfunction buildCommand(command: string, args: string[] | undefined, options: ExecuteCommandOptions | undefined): string {\n const baseCommand = args?.length ? `${command} ${args.map(arg => shellQuote(arg)).join(' ')}` : command;\n const parts: string[] = [];\n\n if (options?.cwd) {\n parts.push(`cd ${shellQuote(options.cwd)}`);\n }\n\n const env = options?.env ?? {};\n const envAssignments = Object.entries(env)\n .filter((entry): entry is [string, string] => entry[1] !== undefined)\n .map(([key, value]) => {\n if (!safeEnvName(key)) {\n throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);\n }\n return `${key}=${shellQuote(value)}`;\n });\n\n parts.push(`${envAssignments.length ? `${envAssignments.join(' ')} ` : ''}${baseCommand}`);\n return parts.join(' && ');\n}\n\nfunction toAgentCoreTimeoutSeconds(timeoutMs: number): number {\n if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {\n throw new RangeError('AgentCore Runtime command timeout must be a positive number of milliseconds');\n }\n\n const timeoutSeconds = Math.ceil(timeoutMs / 1000);\n if (timeoutSeconds > MAX_AGENTCORE_TIMEOUT_SECONDS) {\n throw new RangeError(`AgentCore Runtime command timeout must be at most ${MAX_AGENTCORE_TIMEOUT_SECONDS} seconds`);\n }\n\n return timeoutSeconds;\n}\n\nfunction generateSessionId(): string {\n return randomUUID();\n}\n\nfunction getStreamException(event: AgentCoreStreamEvent): { key: string; value: unknown } | undefined {\n const exceptionKeys = [\n 'accessDeniedException',\n 'internalServerException',\n 'resourceNotFoundException',\n 'serviceQuotaExceededException',\n 'throttlingException',\n 'validationException',\n 'runtimeClientError',\n ] as const;\n\n for (const key of exceptionKeys) {\n const value = event[key];\n if (value) return { key, value };\n }\n\n if (event.$unknown) {\n return { key: event.$unknown[0], value: event.$unknown[1] };\n }\n\n return undefined;\n}\n\nfunction formatStreamException(key: string, value: unknown): string {\n if (value && typeof value === 'object') {\n const exception = value as AgentCoreStreamException;\n const name = exception.name ?? key;\n return exception.message ? `${name}: ${exception.message}` : name;\n }\n\n return `${key}: ${String(value)}`;\n}\n\n// =============================================================================\n// Options\n// =============================================================================\n\nexport interface AgentCoreRuntimeSandboxOptions extends Omit<MastraSandboxOptions, 'processes'> {\n /** AWS region for the Bedrock AgentCore client. Falls back to the AWS SDK default region chain. */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute. */\n agentRuntimeArn: string;\n /** Runtime session ID. Defaults to a generated UUID, which satisfies AgentCore's 33 character minimum. */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint. Defaults to AWS AgentCore's DEFAULT qualifier. */\n qualifier?: string;\n /** MIME type sent for command requests. */\n contentType?: string;\n /** Accept header for command event streams. */\n accept?: string;\n /** Default command timeout in milliseconds. */\n commandTimeout?: number;\n /**\n * Stop the AgentCore Runtime session during stop()/destroy().\n *\n * Defaults to false because sessions are often shared with agent invocations\n * outside the WorkspaceSandbox instance.\n */\n stopSessionOnLifecycle?: boolean;\n /** Client token used for StopRuntimeSession. Defaults to a generated UUID when needed. */\n stopClientToken?: string;\n /** Optional preconfigured AWS SDK client, primarily for advanced credential setup and tests. */\n client?: AgentCoreRuntimeClient;\n /** Custom instructions for getInstructions(). String replaces the default; function receives it. */\n instructions?: InstructionsOption;\n}\n\n// =============================================================================\n// Implementation\n// =============================================================================\n\nexport class AgentCoreRuntimeSandbox extends MastraSandbox {\n readonly id: string;\n readonly name = 'AgentCoreRuntimeSandbox';\n readonly provider = 'agentcore';\n status: ProviderStatus = 'pending';\n\n private _client?: AgentCoreRuntimeClient;\n private readonly _ownsClient: boolean;\n private readonly _region?: string;\n private readonly _agentRuntimeArn: string;\n private readonly _runtimeSessionId: string;\n private readonly _qualifier?: string;\n private readonly _contentType: string;\n private readonly _accept: string;\n private readonly _commandTimeout: number;\n private readonly _stopSessionOnLifecycle: boolean;\n private readonly _stopClientToken?: string;\n private readonly _instructionsOverride?: InstructionsOption;\n private readonly _createdAt = new Date();\n private _lastUsedAt?: Date;\n\n constructor(options: AgentCoreRuntimeSandboxOptions) {\n super({ ...options, name: 'AgentCoreRuntimeSandbox' });\n\n if (!options.agentRuntimeArn) {\n throw new Error(`${LOG_PREFIX} agentRuntimeArn is required`);\n }\n\n this.id = options.runtimeSessionId ?? generateSessionId();\n this._agentRuntimeArn = options.agentRuntimeArn;\n this._runtimeSessionId = this.id;\n this._qualifier = options.qualifier;\n this._contentType = options.contentType ?? DEFAULT_CONTENT_TYPE;\n this._accept = options.accept ?? DEFAULT_ACCEPT;\n this._commandTimeout = options.commandTimeout ?? DEFAULT_COMMAND_TIMEOUT_MS;\n this._stopSessionOnLifecycle = options.stopSessionOnLifecycle ?? false;\n this._stopClientToken = options.stopClientToken;\n this._instructionsOverride = options.instructions;\n this._client = options.client;\n this._ownsClient = !options.client;\n this._region = options.region;\n }\n\n get runtimeSessionId(): string {\n return this._runtimeSessionId;\n }\n\n get agentRuntimeArn(): string {\n return this._agentRuntimeArn;\n }\n\n async start(): Promise<void> {\n this.logger.debug(`${LOG_PREFIX} Using AgentCore Runtime session ${this._runtimeSessionId}`);\n }\n\n async stop(): Promise<void> {\n if (!this._stopSessionOnLifecycle) return;\n await this.stopRuntimeSession();\n }\n\n async destroy(): Promise<void> {\n if (this._stopSessionOnLifecycle) {\n await this.stopRuntimeSession();\n }\n\n if (this._ownsClient && this._client) {\n this._client.destroy();\n this._client = undefined;\n }\n }\n\n /**\n * Explicitly stops the AgentCore Runtime session used by this sandbox.\n *\n * This is separate from destroy() because AgentCore Runtime sessions can be\n * shared with agent invocations outside the WorkspaceSandbox lifecycle.\n */\n async stopRuntimeSession(): Promise<void> {\n await this._getClient().send(\n new StopRuntimeSessionCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n clientToken: this._stopClientToken ?? generateSessionId(),\n }),\n );\n }\n\n async executeCommand(command: string, args?: string[], options?: ExecuteCommandOptions): Promise<CommandResult> {\n await this.ensureRunning();\n\n // Merge the sandbox env under per-call env — this exec path bypasses the process manager\n const fullCommand = buildCommand(command, args, { ...options, env: { ...this.getEnv(), ...options?.env } });\n const timeoutMs = options?.timeout ?? this._commandTimeout;\n const timeoutSeconds = toAgentCoreTimeoutSeconds(timeoutMs);\n const startTime = Date.now();\n const output = new CommandOutputAccumulator({\n maxRetainedBytes: options?.maxRetainedBytes ?? Infinity,\n onStdout: options?.onStdout,\n onStderr: options?.onStderr,\n });\n let stopStatus: string | undefined;\n\n this.logger.debug(`${LOG_PREFIX} Executing command`, {\n runtimeSessionId: this._runtimeSessionId,\n command: fullCommand,\n timeoutSeconds,\n });\n\n const response = await this._getClient().send(\n new InvokeAgentRuntimeCommandCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n contentType: this._contentType,\n accept: this._accept,\n body: {\n command: fullCommand,\n timeout: timeoutSeconds,\n },\n }),\n { abortSignal: options?.abortSignal },\n );\n\n for await (const event of response.stream ?? []) {\n const streamEvent = event as AgentCoreStreamEvent;\n const streamException = getStreamException(streamEvent);\n if (streamException) {\n throw new Error(`${LOG_PREFIX} ${formatStreamException(streamException.key, streamException.value)}`);\n }\n\n const chunk = streamEvent.chunk;\n if (!chunk) continue;\n\n if (chunk.contentDelta?.stdout) {\n output.emitStdout(chunk.contentDelta.stdout);\n }\n\n if (chunk.contentDelta?.stderr) {\n output.emitStderr(chunk.contentDelta.stderr);\n }\n\n if (chunk.contentStop) {\n output.exitCode = chunk.contentStop.exitCode ?? 1;\n stopStatus = chunk.contentStop.status;\n }\n }\n\n const executionTimeMs = Date.now() - startTime;\n const exitCode = output.exitCode ?? 1;\n const timedOut = stopStatus === 'TIMED_OUT';\n const finalExitCode = timedOut ? 124 : exitCode;\n this._lastUsedAt = new Date();\n\n return {\n command: fullCommand,\n args,\n success: finalExitCode === 0 && !timedOut,\n exitCode: finalExitCode,\n stdout: output.stdout,\n stderr: output.stderr,\n executionTimeMs,\n timedOut,\n stdoutTruncated: output.stdoutTruncated,\n stderrTruncated: output.stderrTruncated,\n stdoutDroppedBytes: output.stdoutDroppedBytes,\n stderrDroppedBytes: output.stderrDroppedBytes,\n };\n }\n\n getInstructions(opts?: { requestContext?: RequestContext }): string {\n const defaultInstructions = this._getDefaultInstructions();\n if (this._instructionsOverride === undefined) return defaultInstructions;\n if (typeof this._instructionsOverride === 'string') return this._instructionsOverride;\n return this._instructionsOverride({ defaultInstructions, requestContext: opts?.requestContext });\n }\n\n async getInfo(): Promise<SandboxInfo> {\n return {\n id: this.id,\n name: this.name,\n provider: this.provider,\n status: this.status,\n createdAt: this._createdAt,\n lastUsedAt: this._lastUsedAt,\n metadata: {\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier ?? 'DEFAULT',\n stopSessionOnLifecycle: this._stopSessionOnLifecycle,\n },\n };\n }\n\n private _getDefaultInstructions(): string {\n return [\n 'AWS Bedrock AgentCore Runtime sandbox.',\n 'Commands run inside the configured AgentCore Runtime session container.',\n 'Command output streams from AgentCore Runtime as stdout and stderr.',\n 'Limitations:',\n '- Commands are one-shot and non-interactive.',\n '- There is no persistent shell session between commands.',\n '- Background process management is not exposed by this provider.',\n '- Filesystem mounts are not exposed by this provider.',\n '- Developer tools such as git, npm, Python, or Node must exist in the AgentCore container image.',\n '- AgentCore Code Interpreter is a separate service and is not part of this runtime sandbox.',\n ].join('\\n');\n }\n\n private _getClient(): AgentCoreRuntimeClient {\n if (!this._client) {\n this._client = new BedrockAgentCoreClient({ region: this._region });\n }\n return this._client;\n }\n}\n","/**\n * AWS Bedrock AgentCore Runtime sandbox provider descriptor.\n *\n * Enables registration with MastraEditor for UI-driven sandbox configuration.\n */\n\nimport type { SandboxProvider } from '@mastra/core/editor';\nimport { AgentCoreRuntimeSandbox } from './sandbox';\n\nexport interface AgentCoreRuntimeProviderConfig {\n /** AWS region for the Bedrock AgentCore client */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute */\n agentRuntimeArn: string;\n /** Runtime session ID */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint */\n qualifier?: string;\n /** Default command timeout in milliseconds */\n commandTimeout?: number;\n /** Stop the runtime session during stop()/destroy() */\n stopSessionOnLifecycle?: boolean;\n}\n\nexport const agentCoreRuntimeSandboxProvider: SandboxProvider<AgentCoreRuntimeProviderConfig> = {\n id: 'agentcore',\n name: 'AgentCore Runtime Sandbox',\n description: 'AWS Bedrock AgentCore Runtime command execution sandbox',\n configSchema: {\n type: 'object',\n required: ['agentRuntimeArn'],\n properties: {\n region: {\n type: 'string',\n description: 'AWS region for Bedrock AgentCore',\n },\n agentRuntimeArn: {\n type: 'string',\n description: 'AgentCore Runtime ARN',\n },\n runtimeSessionId: {\n type: 'string',\n description: 'Runtime session ID. Defaults to a generated UUID.',\n },\n qualifier: {\n type: 'string',\n description: 'Agent runtime qualifier/endpoint',\n default: 'DEFAULT',\n },\n commandTimeout: {\n type: 'number',\n description: 'Default command timeout in milliseconds. Must be between 1 and 3,600,000.',\n default: 300_000,\n minimum: 1,\n maximum: 3_600_000,\n },\n stopSessionOnLifecycle: {\n type: 'boolean',\n description: 'Stop the AgentCore Runtime session during stop()/destroy()',\n default: false,\n },\n },\n },\n createSandbox: config => new AgentCoreRuntimeSandbox(config),\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,MAAM,aAAa;AACnB,MAAM,6BAA6B;AACnC,MAAM,gCAAgC;AACtC,MAAM,iBAAiB;AACvB,MAAM,uBAAuB;AA+B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+ {"version":3,"file":"index.cjs","names":["ProcessHandle","UnsupportedStdinCloseError","MastraSandbox","StopRuntimeSessionCommand","InvokeAgentRuntimeCommandCommand","BedrockAgentCoreClient"],"sources":["../src/sandbox/index.ts","../src/provider.ts"],"sourcesContent":["/**\n * AWS Bedrock AgentCore Runtime sandbox provider.\n *\n * This provider maps Mastra's one-shot command execution contract to\n * InvokeAgentRuntimeCommand. It intentionally does not expose process\n * management or filesystem mounts because AgentCore Runtime command execution\n * does not provide those WorkspaceSandbox semantics.\n *\n * @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-execute-command.html\n */\n\nimport { randomUUID } from 'node:crypto';\nimport {\n BedrockAgentCoreClient,\n InvokeAgentRuntimeCommandCommand,\n StopRuntimeSessionCommand,\n} from '@aws-sdk/client-bedrock-agentcore';\nimport type { RequestContext } from '@mastra/core/di';\nimport type {\n CommandResult,\n ExecuteCommandOptions,\n MastraSandboxOptions,\n ProviderStatus,\n SandboxInfo,\n} from '@mastra/core/workspace';\nimport { MastraSandbox, ProcessHandle, UnsupportedStdinCloseError } from '@mastra/core/workspace';\n\nconst LOG_PREFIX = '[AgentCoreRuntimeSandbox]';\nconst DEFAULT_COMMAND_TIMEOUT_MS = 300_000;\nconst MAX_AGENTCORE_TIMEOUT_SECONDS = 3600;\nconst DEFAULT_ACCEPT = 'application/vnd.amazon.eventstream';\nconst DEFAULT_CONTENT_TYPE = 'application/json';\n\ntype AgentCoreRuntimeClient = Pick<BedrockAgentCoreClient, 'send' | 'destroy'>;\ntype InstructionsOption = string | ((opts: { defaultInstructions: string; requestContext?: RequestContext }) => string);\ntype AgentCoreStreamException = {\n name?: string;\n message?: string;\n};\n\ntype AgentCoreStreamEvent = {\n chunk?: {\n contentStart?: unknown;\n contentDelta?: {\n stdout?: string;\n stderr?: string;\n };\n contentStop?: {\n exitCode?: number;\n status?: string;\n };\n };\n accessDeniedException?: AgentCoreStreamException;\n internalServerException?: AgentCoreStreamException;\n resourceNotFoundException?: AgentCoreStreamException;\n serviceQuotaExceededException?: AgentCoreStreamException;\n throttlingException?: AgentCoreStreamException;\n validationException?: AgentCoreStreamException;\n runtimeClientError?: AgentCoreStreamException;\n $unknown?: [string, unknown];\n};\n\nclass CommandOutputAccumulator extends ProcessHandle {\n readonly pid = 'agentcore-command';\n exitCode: number | undefined;\n\n async kill(): Promise<boolean> {\n return false;\n }\n\n async sendStdin(): Promise<void> {\n throw new Error('AgentCore Runtime command execution does not support stdin');\n }\n\n async closeStdin(): Promise<void> {\n throw new UnsupportedStdinCloseError('AgentCore Runtime command execution does not support closing stdin');\n }\n\n async wait(): Promise<CommandResult> {\n return {\n success: this.exitCode === 0,\n exitCode: this.exitCode ?? 1,\n stdout: this.stdout,\n stderr: this.stderr,\n executionTimeMs: 0,\n };\n }\n}\n\nfunction shellQuote(arg: string): string {\n if (/^[a-zA-Z0-9._\\-\\/=:@]+$/.test(arg)) return arg;\n return `'${arg.replace(/'/g, \"'\\\\''\")}'`;\n}\n\nfunction safeEnvName(name: string): boolean {\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);\n}\n\nfunction buildCommand(\n command: string,\n args: string[] | undefined,\n options: ExecuteCommandOptions | undefined,\n workingDirectory?: string,\n): string {\n const baseCommand = args?.length ? `${command} ${args.map(arg => shellQuote(arg)).join(' ')}` : command;\n const parts: string[] = [];\n\n // The cd target is shell-quoted, which defeats `~` expansion — the sandbox's\n // workingDirectory option must be an absolute path on this provider.\n const cwd = options?.cwd ?? workingDirectory;\n if (cwd) {\n parts.push(`cd ${shellQuote(cwd)}`);\n }\n\n const env = options?.env ?? {};\n const envAssignments = Object.entries(env)\n .filter((entry): entry is [string, string] => entry[1] !== undefined)\n .map(([key, value]) => {\n if (!safeEnvName(key)) {\n throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);\n }\n return `${key}=${shellQuote(value)}`;\n });\n\n parts.push(`${envAssignments.length ? `${envAssignments.join(' ')} ` : ''}${baseCommand}`);\n return parts.join(' && ');\n}\n\nfunction toAgentCoreTimeoutSeconds(timeoutMs: number): number {\n if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {\n throw new RangeError('AgentCore Runtime command timeout must be a positive number of milliseconds');\n }\n\n const timeoutSeconds = Math.ceil(timeoutMs / 1000);\n if (timeoutSeconds > MAX_AGENTCORE_TIMEOUT_SECONDS) {\n throw new RangeError(`AgentCore Runtime command timeout must be at most ${MAX_AGENTCORE_TIMEOUT_SECONDS} seconds`);\n }\n\n return timeoutSeconds;\n}\n\nfunction generateSessionId(): string {\n return randomUUID();\n}\n\nfunction getStreamException(event: AgentCoreStreamEvent): { key: string; value: unknown } | undefined {\n const exceptionKeys = [\n 'accessDeniedException',\n 'internalServerException',\n 'resourceNotFoundException',\n 'serviceQuotaExceededException',\n 'throttlingException',\n 'validationException',\n 'runtimeClientError',\n ] as const;\n\n for (const key of exceptionKeys) {\n const value = event[key];\n if (value) return { key, value };\n }\n\n if (event.$unknown) {\n return { key: event.$unknown[0], value: event.$unknown[1] };\n }\n\n return undefined;\n}\n\nfunction formatStreamException(key: string, value: unknown): string {\n if (value && typeof value === 'object') {\n const exception = value as AgentCoreStreamException;\n const name = exception.name ?? key;\n return exception.message ? `${name}: ${exception.message}` : name;\n }\n\n return `${key}: ${String(value)}`;\n}\n\n// =============================================================================\n// Options\n// =============================================================================\n\nexport interface AgentCoreRuntimeSandboxOptions extends Omit<MastraSandboxOptions, 'processes'> {\n /** AWS region for the Bedrock AgentCore client. Falls back to the AWS SDK default region chain. */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute. */\n agentRuntimeArn: string;\n /** Runtime session ID. Defaults to a generated UUID, which satisfies AgentCore's 33 character minimum. */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint. Defaults to AWS AgentCore's DEFAULT qualifier. */\n qualifier?: string;\n /** MIME type sent for command requests. */\n contentType?: string;\n /** Accept header for command event streams. */\n accept?: string;\n /** Default command timeout in milliseconds. */\n commandTimeout?: number;\n /**\n * Stop the AgentCore Runtime session during stop()/destroy().\n *\n * Defaults to false because sessions are often shared with agent invocations\n * outside the WorkspaceSandbox instance.\n */\n stopSessionOnLifecycle?: boolean;\n /** Client token used for StopRuntimeSession. Defaults to a generated UUID when needed. */\n stopClientToken?: string;\n /** Optional preconfigured AWS SDK client, primarily for advanced credential setup and tests. */\n client?: AgentCoreRuntimeClient;\n /** Custom instructions for getInstructions(). String replaces the default; function receives it. */\n instructions?: InstructionsOption;\n}\n\n// =============================================================================\n// Implementation\n// =============================================================================\n\nexport class AgentCoreRuntimeSandbox extends MastraSandbox {\n readonly id: string;\n readonly name = 'AgentCoreRuntimeSandbox';\n readonly provider = 'agentcore';\n status: ProviderStatus = 'pending';\n\n private _client?: AgentCoreRuntimeClient;\n private readonly _ownsClient: boolean;\n private readonly _region?: string;\n private readonly _agentRuntimeArn: string;\n private readonly _runtimeSessionId: string;\n private readonly _qualifier?: string;\n private readonly _contentType: string;\n private readonly _accept: string;\n private readonly _commandTimeout: number;\n private readonly _stopSessionOnLifecycle: boolean;\n private readonly _stopClientToken?: string;\n private readonly _instructionsOverride?: InstructionsOption;\n private readonly _createdAt = new Date();\n private _lastUsedAt?: Date;\n\n constructor(options: AgentCoreRuntimeSandboxOptions) {\n super({ ...options, name: 'AgentCoreRuntimeSandbox' });\n\n if (!options.agentRuntimeArn) {\n throw new Error(`${LOG_PREFIX} agentRuntimeArn is required`);\n }\n\n this.id = options.runtimeSessionId ?? generateSessionId();\n this._agentRuntimeArn = options.agentRuntimeArn;\n this._runtimeSessionId = this.id;\n this._qualifier = options.qualifier;\n this._contentType = options.contentType ?? DEFAULT_CONTENT_TYPE;\n this._accept = options.accept ?? DEFAULT_ACCEPT;\n this._commandTimeout = options.commandTimeout ?? DEFAULT_COMMAND_TIMEOUT_MS;\n this._stopSessionOnLifecycle = options.stopSessionOnLifecycle ?? false;\n this._stopClientToken = options.stopClientToken;\n this._instructionsOverride = options.instructions;\n this._client = options.client;\n this._ownsClient = !options.client;\n this._region = options.region;\n }\n\n get runtimeSessionId(): string {\n return this._runtimeSessionId;\n }\n\n get agentRuntimeArn(): string {\n return this._agentRuntimeArn;\n }\n\n async start(): Promise<void> {\n this.logger.debug(`${LOG_PREFIX} Using AgentCore Runtime session ${this._runtimeSessionId}`);\n }\n\n async stop(): Promise<void> {\n if (!this._stopSessionOnLifecycle) return;\n await this.stopRuntimeSession();\n }\n\n async destroy(): Promise<void> {\n if (this._stopSessionOnLifecycle) {\n await this.stopRuntimeSession();\n }\n\n if (this._ownsClient && this._client) {\n this._client.destroy();\n this._client = undefined;\n }\n }\n\n /**\n * Explicitly stops the AgentCore Runtime session used by this sandbox.\n *\n * This is separate from destroy() because AgentCore Runtime sessions can be\n * shared with agent invocations outside the WorkspaceSandbox lifecycle.\n */\n async stopRuntimeSession(): Promise<void> {\n await this._getClient().send(\n new StopRuntimeSessionCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n clientToken: this._stopClientToken ?? generateSessionId(),\n }),\n );\n }\n\n async executeCommand(command: string, args?: string[], options?: ExecuteCommandOptions): Promise<CommandResult> {\n await this.ensureRunning();\n\n // Merge the sandbox env under per-call env — this exec path bypasses the process manager\n const fullCommand = buildCommand(\n command,\n args,\n { ...options, env: { ...this.getEnv(), ...options?.env } },\n this.workingDirectory,\n );\n const timeoutMs = options?.timeout ?? this._commandTimeout;\n const timeoutSeconds = toAgentCoreTimeoutSeconds(timeoutMs);\n const startTime = Date.now();\n const output = new CommandOutputAccumulator({\n maxRetainedBytes: options?.maxRetainedBytes ?? Infinity,\n onStdout: options?.onStdout,\n onStderr: options?.onStderr,\n });\n let stopStatus: string | undefined;\n\n this.logger.debug(`${LOG_PREFIX} Executing command`, {\n runtimeSessionId: this._runtimeSessionId,\n command: fullCommand,\n timeoutSeconds,\n });\n\n const response = await this._getClient().send(\n new InvokeAgentRuntimeCommandCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n contentType: this._contentType,\n accept: this._accept,\n body: {\n command: fullCommand,\n timeout: timeoutSeconds,\n },\n }),\n { abortSignal: options?.abortSignal },\n );\n\n for await (const event of response.stream ?? []) {\n const streamEvent = event as AgentCoreStreamEvent;\n const streamException = getStreamException(streamEvent);\n if (streamException) {\n throw new Error(`${LOG_PREFIX} ${formatStreamException(streamException.key, streamException.value)}`);\n }\n\n const chunk = streamEvent.chunk;\n if (!chunk) continue;\n\n if (chunk.contentDelta?.stdout) {\n output.emitStdout(chunk.contentDelta.stdout);\n }\n\n if (chunk.contentDelta?.stderr) {\n output.emitStderr(chunk.contentDelta.stderr);\n }\n\n if (chunk.contentStop) {\n output.exitCode = chunk.contentStop.exitCode ?? 1;\n stopStatus = chunk.contentStop.status;\n }\n }\n\n const executionTimeMs = Date.now() - startTime;\n const exitCode = output.exitCode ?? 1;\n const timedOut = stopStatus === 'TIMED_OUT';\n const finalExitCode = timedOut ? 124 : exitCode;\n this._lastUsedAt = new Date();\n\n return {\n command: fullCommand,\n args,\n success: finalExitCode === 0 && !timedOut,\n exitCode: finalExitCode,\n stdout: output.stdout,\n stderr: output.stderr,\n executionTimeMs,\n timedOut,\n stdoutTruncated: output.stdoutTruncated,\n stderrTruncated: output.stderrTruncated,\n stdoutDroppedBytes: output.stdoutDroppedBytes,\n stderrDroppedBytes: output.stderrDroppedBytes,\n };\n }\n\n getInstructions(opts?: { requestContext?: RequestContext }): string {\n const defaultInstructions = this._getDefaultInstructions();\n if (this._instructionsOverride === undefined) return defaultInstructions;\n if (typeof this._instructionsOverride === 'string') return this._instructionsOverride;\n return this._instructionsOverride({ defaultInstructions, requestContext: opts?.requestContext });\n }\n\n async getInfo(): Promise<SandboxInfo> {\n return {\n id: this.id,\n name: this.name,\n provider: this.provider,\n status: this.status,\n createdAt: this._createdAt,\n lastUsedAt: this._lastUsedAt,\n metadata: {\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier ?? 'DEFAULT',\n stopSessionOnLifecycle: this._stopSessionOnLifecycle,\n },\n };\n }\n\n private _getDefaultInstructions(): string {\n return [\n 'AWS Bedrock AgentCore Runtime sandbox.',\n 'Commands run inside the configured AgentCore Runtime session container.',\n 'Command output streams from AgentCore Runtime as stdout and stderr.',\n 'Limitations:',\n '- Commands are one-shot and non-interactive.',\n '- There is no persistent shell session between commands.',\n '- Background process management is not exposed by this provider.',\n '- Filesystem mounts are not exposed by this provider.',\n '- Developer tools such as git, npm, Python, or Node must exist in the AgentCore container image.',\n '- AgentCore Code Interpreter is a separate service and is not part of this runtime sandbox.',\n ].join('\\n');\n }\n\n private _getClient(): AgentCoreRuntimeClient {\n if (!this._client) {\n this._client = new BedrockAgentCoreClient({ region: this._region });\n }\n return this._client;\n }\n}\n","/**\n * AWS Bedrock AgentCore Runtime sandbox provider descriptor.\n *\n * Enables registration with MastraEditor for UI-driven sandbox configuration.\n */\n\nimport type { SandboxProvider } from '@mastra/core/editor';\nimport { AgentCoreRuntimeSandbox } from './sandbox';\n\nexport interface AgentCoreRuntimeProviderConfig {\n /** AWS region for the Bedrock AgentCore client */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute */\n agentRuntimeArn: string;\n /** Runtime session ID */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint */\n qualifier?: string;\n /** Default command timeout in milliseconds */\n commandTimeout?: number;\n /** Stop the runtime session during stop()/destroy() */\n stopSessionOnLifecycle?: boolean;\n}\n\nexport const agentCoreRuntimeSandboxProvider: SandboxProvider<AgentCoreRuntimeProviderConfig> = {\n id: 'agentcore',\n name: 'AgentCore Runtime Sandbox',\n description: 'AWS Bedrock AgentCore Runtime command execution sandbox',\n configSchema: {\n type: 'object',\n required: ['agentRuntimeArn'],\n properties: {\n region: {\n type: 'string',\n description: 'AWS region for Bedrock AgentCore',\n },\n agentRuntimeArn: {\n type: 'string',\n description: 'AgentCore Runtime ARN',\n },\n runtimeSessionId: {\n type: 'string',\n description: 'Runtime session ID. Defaults to a generated UUID.',\n },\n qualifier: {\n type: 'string',\n description: 'Agent runtime qualifier/endpoint',\n default: 'DEFAULT',\n },\n commandTimeout: {\n type: 'number',\n description: 'Default command timeout in milliseconds. Must be between 1 and 3,600,000.',\n default: 300_000,\n minimum: 1,\n maximum: 3_600_000,\n },\n stopSessionOnLifecycle: {\n type: 'boolean',\n description: 'Stop the AgentCore Runtime session during stop()/destroy()',\n default: false,\n },\n },\n },\n createSandbox: config => new AgentCoreRuntimeSandbox(config),\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,MAAM,aAAa;AACnB,MAAM,6BAA6B;AACnC,MAAM,gCAAgC;AACtC,MAAM,iBAAiB;AACvB,MAAM,uBAAuB;AA+B7B,IAAM,2BAAN,cAAuCA,uBAAAA,cAAc;CACnD,MAAe;CACf;CAEA,MAAM,OAAyB;EAC7B,OAAO;CACT;CAEA,MAAM,YAA2B;EAC/B,MAAM,IAAI,MAAM,4DAA4D;CAC9E;CAEA,MAAM,aAA4B;EAChC,MAAM,IAAIC,uBAAAA,2BAA2B,oEAAoE;CAC3G;CAEA,MAAM,OAA+B;EACnC,OAAO;GACL,SAAS,KAAK,aAAa;GAC3B,UAAU,KAAK,YAAY;GAC3B,QAAQ,KAAK;GACb,QAAQ,KAAK;GACb,iBAAiB;EACnB;CACF;AACF;AAEA,SAAS,WAAW,KAAqB;CACvC,IAAI,0BAA0B,KAAK,GAAG,GAAG,OAAO;CAChD,OAAO,IAAI,IAAI,QAAQ,MAAM,OAAO,EAAE;AACxC;AAEA,SAAS,YAAY,MAAuB;CAC1C,OAAO,2BAA2B,KAAK,IAAI;AAC7C;AAEA,SAAS,aACP,SACA,MACA,SACA,kBACQ;CACR,MAAM,cAAc,MAAM,SAAS,GAAG,QAAQ,GAAG,KAAK,KAAI,QAAO,WAAW,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM;CAChG,MAAM,QAAkB,CAAC;CAIzB,MAAM,MAAM,SAAS,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,KAAK;CACd;AACF;;;AC5ZA,MAAa,kCAAmF;CAC9F,IAAI;CACJ,MAAM;CACN,aAAa;CACb,cAAc;EACZ,MAAM;EACN,UAAU,CAAC,iBAAiB;EAC5B,YAAY;GACV,QAAQ;IACN,MAAM;IACN,aAAa;GACf;GACA,iBAAiB;IACf,MAAM;IACN,aAAa;GACf;GACA,kBAAkB;IAChB,MAAM;IACN,aAAa;GACf;GACA,WAAW;IACT,MAAM;IACN,aAAa;IACb,SAAS;GACX;GACA,gBAAgB;IACd,MAAM;IACN,aAAa;IACb,SAAS;IACT,SAAS;IACT,SAAS;GACX;GACA,wBAAwB;IACtB,MAAM;IACN,aAAa;IACb,SAAS;GACX;EACF;CACF;CACA,gBAAe,WAAU,IAAI,wBAAwB,MAAM;AAC7D"}
package/dist/index.js CHANGED
@@ -46,10 +46,11 @@ function shellQuote(arg) {
46
46
  function safeEnvName(name) {
47
47
  return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);
48
48
  }
49
- function buildCommand(command, args, options) {
49
+ function buildCommand(command, args, options, workingDirectory) {
50
50
  const baseCommand = args?.length ? `${command} ${args.map((arg) => shellQuote(arg)).join(" ")}` : command;
51
51
  const parts = [];
52
- if (options?.cwd) parts.push(`cd ${shellQuote(options.cwd)}`);
52
+ const cwd = options?.cwd ?? workingDirectory;
53
+ if (cwd) parts.push(`cd ${shellQuote(cwd)}`);
53
54
  const env = options?.env ?? {};
54
55
  const envAssignments = Object.entries(env).filter((entry) => entry[1] !== void 0).map(([key, value]) => {
55
56
  if (!safeEnvName(key)) throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);
@@ -177,7 +178,7 @@ var AgentCoreRuntimeSandbox = class extends MastraSandbox {
177
178
  ...this.getEnv(),
178
179
  ...options?.env
179
180
  }
180
- });
181
+ }, this.workingDirectory);
181
182
  const timeoutSeconds = toAgentCoreTimeoutSeconds(options?.timeout ?? this._commandTimeout);
182
183
  const startTime = Date.now();
183
184
  const output = new CommandOutputAccumulator({
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/sandbox/index.ts","../src/provider.ts"],"sourcesContent":["/**\n * AWS Bedrock AgentCore Runtime sandbox provider.\n *\n * This provider maps Mastra's one-shot command execution contract to\n * InvokeAgentRuntimeCommand. It intentionally does not expose process\n * management or filesystem mounts because AgentCore Runtime command execution\n * does not provide those WorkspaceSandbox semantics.\n *\n * @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-execute-command.html\n */\n\nimport { randomUUID } from 'node:crypto';\nimport {\n BedrockAgentCoreClient,\n InvokeAgentRuntimeCommandCommand,\n StopRuntimeSessionCommand,\n} from '@aws-sdk/client-bedrock-agentcore';\nimport type { RequestContext } from '@mastra/core/di';\nimport type {\n CommandResult,\n ExecuteCommandOptions,\n MastraSandboxOptions,\n ProviderStatus,\n SandboxInfo,\n} from '@mastra/core/workspace';\nimport { MastraSandbox, ProcessHandle, UnsupportedStdinCloseError } from '@mastra/core/workspace';\n\nconst LOG_PREFIX = '[AgentCoreRuntimeSandbox]';\nconst DEFAULT_COMMAND_TIMEOUT_MS = 300_000;\nconst MAX_AGENTCORE_TIMEOUT_SECONDS = 3600;\nconst DEFAULT_ACCEPT = 'application/vnd.amazon.eventstream';\nconst DEFAULT_CONTENT_TYPE = 'application/json';\n\ntype AgentCoreRuntimeClient = Pick<BedrockAgentCoreClient, 'send' | 'destroy'>;\ntype InstructionsOption = string | ((opts: { defaultInstructions: string; requestContext?: RequestContext }) => string);\ntype AgentCoreStreamException = {\n name?: string;\n message?: string;\n};\n\ntype AgentCoreStreamEvent = {\n chunk?: {\n contentStart?: unknown;\n contentDelta?: {\n stdout?: string;\n stderr?: string;\n };\n contentStop?: {\n exitCode?: number;\n status?: string;\n };\n };\n accessDeniedException?: AgentCoreStreamException;\n internalServerException?: AgentCoreStreamException;\n resourceNotFoundException?: AgentCoreStreamException;\n serviceQuotaExceededException?: AgentCoreStreamException;\n throttlingException?: AgentCoreStreamException;\n validationException?: AgentCoreStreamException;\n runtimeClientError?: AgentCoreStreamException;\n $unknown?: [string, unknown];\n};\n\nclass CommandOutputAccumulator extends ProcessHandle {\n readonly pid = 'agentcore-command';\n exitCode: number | undefined;\n\n async kill(): Promise<boolean> {\n return false;\n }\n\n async sendStdin(): Promise<void> {\n throw new Error('AgentCore Runtime command execution does not support stdin');\n }\n\n async closeStdin(): Promise<void> {\n throw new UnsupportedStdinCloseError('AgentCore Runtime command execution does not support closing stdin');\n }\n\n async wait(): Promise<CommandResult> {\n return {\n success: this.exitCode === 0,\n exitCode: this.exitCode ?? 1,\n stdout: this.stdout,\n stderr: this.stderr,\n executionTimeMs: 0,\n };\n }\n}\n\nfunction shellQuote(arg: string): string {\n if (/^[a-zA-Z0-9._\\-\\/=:@]+$/.test(arg)) return arg;\n return `'${arg.replace(/'/g, \"'\\\\''\")}'`;\n}\n\nfunction safeEnvName(name: string): boolean {\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);\n}\n\nfunction buildCommand(command: string, args: string[] | undefined, options: ExecuteCommandOptions | undefined): string {\n const baseCommand = args?.length ? `${command} ${args.map(arg => shellQuote(arg)).join(' ')}` : command;\n const parts: string[] = [];\n\n if (options?.cwd) {\n parts.push(`cd ${shellQuote(options.cwd)}`);\n }\n\n const env = options?.env ?? {};\n const envAssignments = Object.entries(env)\n .filter((entry): entry is [string, string] => entry[1] !== undefined)\n .map(([key, value]) => {\n if (!safeEnvName(key)) {\n throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);\n }\n return `${key}=${shellQuote(value)}`;\n });\n\n parts.push(`${envAssignments.length ? `${envAssignments.join(' ')} ` : ''}${baseCommand}`);\n return parts.join(' && ');\n}\n\nfunction toAgentCoreTimeoutSeconds(timeoutMs: number): number {\n if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {\n throw new RangeError('AgentCore Runtime command timeout must be a positive number of milliseconds');\n }\n\n const timeoutSeconds = Math.ceil(timeoutMs / 1000);\n if (timeoutSeconds > MAX_AGENTCORE_TIMEOUT_SECONDS) {\n throw new RangeError(`AgentCore Runtime command timeout must be at most ${MAX_AGENTCORE_TIMEOUT_SECONDS} seconds`);\n }\n\n return timeoutSeconds;\n}\n\nfunction generateSessionId(): string {\n return randomUUID();\n}\n\nfunction getStreamException(event: AgentCoreStreamEvent): { key: string; value: unknown } | undefined {\n const exceptionKeys = [\n 'accessDeniedException',\n 'internalServerException',\n 'resourceNotFoundException',\n 'serviceQuotaExceededException',\n 'throttlingException',\n 'validationException',\n 'runtimeClientError',\n ] as const;\n\n for (const key of exceptionKeys) {\n const value = event[key];\n if (value) return { key, value };\n }\n\n if (event.$unknown) {\n return { key: event.$unknown[0], value: event.$unknown[1] };\n }\n\n return undefined;\n}\n\nfunction formatStreamException(key: string, value: unknown): string {\n if (value && typeof value === 'object') {\n const exception = value as AgentCoreStreamException;\n const name = exception.name ?? key;\n return exception.message ? `${name}: ${exception.message}` : name;\n }\n\n return `${key}: ${String(value)}`;\n}\n\n// =============================================================================\n// Options\n// =============================================================================\n\nexport interface AgentCoreRuntimeSandboxOptions extends Omit<MastraSandboxOptions, 'processes'> {\n /** AWS region for the Bedrock AgentCore client. Falls back to the AWS SDK default region chain. */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute. */\n agentRuntimeArn: string;\n /** Runtime session ID. Defaults to a generated UUID, which satisfies AgentCore's 33 character minimum. */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint. Defaults to AWS AgentCore's DEFAULT qualifier. */\n qualifier?: string;\n /** MIME type sent for command requests. */\n contentType?: string;\n /** Accept header for command event streams. */\n accept?: string;\n /** Default command timeout in milliseconds. */\n commandTimeout?: number;\n /**\n * Stop the AgentCore Runtime session during stop()/destroy().\n *\n * Defaults to false because sessions are often shared with agent invocations\n * outside the WorkspaceSandbox instance.\n */\n stopSessionOnLifecycle?: boolean;\n /** Client token used for StopRuntimeSession. Defaults to a generated UUID when needed. */\n stopClientToken?: string;\n /** Optional preconfigured AWS SDK client, primarily for advanced credential setup and tests. */\n client?: AgentCoreRuntimeClient;\n /** Custom instructions for getInstructions(). String replaces the default; function receives it. */\n instructions?: InstructionsOption;\n}\n\n// =============================================================================\n// Implementation\n// =============================================================================\n\nexport class AgentCoreRuntimeSandbox extends MastraSandbox {\n readonly id: string;\n readonly name = 'AgentCoreRuntimeSandbox';\n readonly provider = 'agentcore';\n status: ProviderStatus = 'pending';\n\n private _client?: AgentCoreRuntimeClient;\n private readonly _ownsClient: boolean;\n private readonly _region?: string;\n private readonly _agentRuntimeArn: string;\n private readonly _runtimeSessionId: string;\n private readonly _qualifier?: string;\n private readonly _contentType: string;\n private readonly _accept: string;\n private readonly _commandTimeout: number;\n private readonly _stopSessionOnLifecycle: boolean;\n private readonly _stopClientToken?: string;\n private readonly _instructionsOverride?: InstructionsOption;\n private readonly _createdAt = new Date();\n private _lastUsedAt?: Date;\n\n constructor(options: AgentCoreRuntimeSandboxOptions) {\n super({ ...options, name: 'AgentCoreRuntimeSandbox' });\n\n if (!options.agentRuntimeArn) {\n throw new Error(`${LOG_PREFIX} agentRuntimeArn is required`);\n }\n\n this.id = options.runtimeSessionId ?? generateSessionId();\n this._agentRuntimeArn = options.agentRuntimeArn;\n this._runtimeSessionId = this.id;\n this._qualifier = options.qualifier;\n this._contentType = options.contentType ?? DEFAULT_CONTENT_TYPE;\n this._accept = options.accept ?? DEFAULT_ACCEPT;\n this._commandTimeout = options.commandTimeout ?? DEFAULT_COMMAND_TIMEOUT_MS;\n this._stopSessionOnLifecycle = options.stopSessionOnLifecycle ?? false;\n this._stopClientToken = options.stopClientToken;\n this._instructionsOverride = options.instructions;\n this._client = options.client;\n this._ownsClient = !options.client;\n this._region = options.region;\n }\n\n get runtimeSessionId(): string {\n return this._runtimeSessionId;\n }\n\n get agentRuntimeArn(): string {\n return this._agentRuntimeArn;\n }\n\n async start(): Promise<void> {\n this.logger.debug(`${LOG_PREFIX} Using AgentCore Runtime session ${this._runtimeSessionId}`);\n }\n\n async stop(): Promise<void> {\n if (!this._stopSessionOnLifecycle) return;\n await this.stopRuntimeSession();\n }\n\n async destroy(): Promise<void> {\n if (this._stopSessionOnLifecycle) {\n await this.stopRuntimeSession();\n }\n\n if (this._ownsClient && this._client) {\n this._client.destroy();\n this._client = undefined;\n }\n }\n\n /**\n * Explicitly stops the AgentCore Runtime session used by this sandbox.\n *\n * This is separate from destroy() because AgentCore Runtime sessions can be\n * shared with agent invocations outside the WorkspaceSandbox lifecycle.\n */\n async stopRuntimeSession(): Promise<void> {\n await this._getClient().send(\n new StopRuntimeSessionCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n clientToken: this._stopClientToken ?? generateSessionId(),\n }),\n );\n }\n\n async executeCommand(command: string, args?: string[], options?: ExecuteCommandOptions): Promise<CommandResult> {\n await this.ensureRunning();\n\n // Merge the sandbox env under per-call env — this exec path bypasses the process manager\n const fullCommand = buildCommand(command, args, { ...options, env: { ...this.getEnv(), ...options?.env } });\n const timeoutMs = options?.timeout ?? this._commandTimeout;\n const timeoutSeconds = toAgentCoreTimeoutSeconds(timeoutMs);\n const startTime = Date.now();\n const output = new CommandOutputAccumulator({\n maxRetainedBytes: options?.maxRetainedBytes ?? Infinity,\n onStdout: options?.onStdout,\n onStderr: options?.onStderr,\n });\n let stopStatus: string | undefined;\n\n this.logger.debug(`${LOG_PREFIX} Executing command`, {\n runtimeSessionId: this._runtimeSessionId,\n command: fullCommand,\n timeoutSeconds,\n });\n\n const response = await this._getClient().send(\n new InvokeAgentRuntimeCommandCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n contentType: this._contentType,\n accept: this._accept,\n body: {\n command: fullCommand,\n timeout: timeoutSeconds,\n },\n }),\n { abortSignal: options?.abortSignal },\n );\n\n for await (const event of response.stream ?? []) {\n const streamEvent = event as AgentCoreStreamEvent;\n const streamException = getStreamException(streamEvent);\n if (streamException) {\n throw new Error(`${LOG_PREFIX} ${formatStreamException(streamException.key, streamException.value)}`);\n }\n\n const chunk = streamEvent.chunk;\n if (!chunk) continue;\n\n if (chunk.contentDelta?.stdout) {\n output.emitStdout(chunk.contentDelta.stdout);\n }\n\n if (chunk.contentDelta?.stderr) {\n output.emitStderr(chunk.contentDelta.stderr);\n }\n\n if (chunk.contentStop) {\n output.exitCode = chunk.contentStop.exitCode ?? 1;\n stopStatus = chunk.contentStop.status;\n }\n }\n\n const executionTimeMs = Date.now() - startTime;\n const exitCode = output.exitCode ?? 1;\n const timedOut = stopStatus === 'TIMED_OUT';\n const finalExitCode = timedOut ? 124 : exitCode;\n this._lastUsedAt = new Date();\n\n return {\n command: fullCommand,\n args,\n success: finalExitCode === 0 && !timedOut,\n exitCode: finalExitCode,\n stdout: output.stdout,\n stderr: output.stderr,\n executionTimeMs,\n timedOut,\n stdoutTruncated: output.stdoutTruncated,\n stderrTruncated: output.stderrTruncated,\n stdoutDroppedBytes: output.stdoutDroppedBytes,\n stderrDroppedBytes: output.stderrDroppedBytes,\n };\n }\n\n getInstructions(opts?: { requestContext?: RequestContext }): string {\n const defaultInstructions = this._getDefaultInstructions();\n if (this._instructionsOverride === undefined) return defaultInstructions;\n if (typeof this._instructionsOverride === 'string') return this._instructionsOverride;\n return this._instructionsOverride({ defaultInstructions, requestContext: opts?.requestContext });\n }\n\n async getInfo(): Promise<SandboxInfo> {\n return {\n id: this.id,\n name: this.name,\n provider: this.provider,\n status: this.status,\n createdAt: this._createdAt,\n lastUsedAt: this._lastUsedAt,\n metadata: {\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier ?? 'DEFAULT',\n stopSessionOnLifecycle: this._stopSessionOnLifecycle,\n },\n };\n }\n\n private _getDefaultInstructions(): string {\n return [\n 'AWS Bedrock AgentCore Runtime sandbox.',\n 'Commands run inside the configured AgentCore Runtime session container.',\n 'Command output streams from AgentCore Runtime as stdout and stderr.',\n 'Limitations:',\n '- Commands are one-shot and non-interactive.',\n '- There is no persistent shell session between commands.',\n '- Background process management is not exposed by this provider.',\n '- Filesystem mounts are not exposed by this provider.',\n '- Developer tools such as git, npm, Python, or Node must exist in the AgentCore container image.',\n '- AgentCore Code Interpreter is a separate service and is not part of this runtime sandbox.',\n ].join('\\n');\n }\n\n private _getClient(): AgentCoreRuntimeClient {\n if (!this._client) {\n this._client = new BedrockAgentCoreClient({ region: this._region });\n }\n return this._client;\n }\n}\n","/**\n * AWS Bedrock AgentCore Runtime sandbox provider descriptor.\n *\n * Enables registration with MastraEditor for UI-driven sandbox configuration.\n */\n\nimport type { SandboxProvider } from '@mastra/core/editor';\nimport { AgentCoreRuntimeSandbox } from './sandbox';\n\nexport interface AgentCoreRuntimeProviderConfig {\n /** AWS region for the Bedrock AgentCore client */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute */\n agentRuntimeArn: string;\n /** Runtime session ID */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint */\n qualifier?: string;\n /** Default command timeout in milliseconds */\n commandTimeout?: number;\n /** Stop the runtime session during stop()/destroy() */\n stopSessionOnLifecycle?: boolean;\n}\n\nexport const agentCoreRuntimeSandboxProvider: SandboxProvider<AgentCoreRuntimeProviderConfig> = {\n id: 'agentcore',\n name: 'AgentCore Runtime Sandbox',\n description: 'AWS Bedrock AgentCore Runtime command execution sandbox',\n configSchema: {\n type: 'object',\n required: ['agentRuntimeArn'],\n properties: {\n region: {\n type: 'string',\n description: 'AWS region for Bedrock AgentCore',\n },\n agentRuntimeArn: {\n type: 'string',\n description: 'AgentCore Runtime ARN',\n },\n runtimeSessionId: {\n type: 'string',\n description: 'Runtime session ID. Defaults to a generated UUID.',\n },\n qualifier: {\n type: 'string',\n description: 'Agent runtime qualifier/endpoint',\n default: 'DEFAULT',\n },\n commandTimeout: {\n type: 'number',\n description: 'Default command timeout in milliseconds. Must be between 1 and 3,600,000.',\n default: 300_000,\n minimum: 1,\n maximum: 3_600_000,\n },\n stopSessionOnLifecycle: {\n type: 'boolean',\n description: 'Stop the AgentCore Runtime session during stop()/destroy()',\n default: false,\n },\n },\n },\n createSandbox: config => new AgentCoreRuntimeSandbox(config),\n};\n"],"mappings":";;;;;;;;;;;;;;AA2BA,MAAM,aAAa;AACnB,MAAM,6BAA6B;AACnC,MAAM,gCAAgC;AACtC,MAAM,iBAAiB;AACvB,MAAM,uBAAuB;AA+B7B,IAAM,2BAAN,cAAuC,cAAc;CACnD,MAAe;CACf;CAEA,MAAM,OAAyB;EAC7B,OAAO;CACT;CAEA,MAAM,YAA2B;EAC/B,MAAM,IAAI,MAAM,4DAA4D;CAC9E;CAEA,MAAM,aAA4B;EAChC,MAAM,IAAI,2BAA2B,oEAAoE;CAC3G;CAEA,MAAM,OAA+B;EACnC,OAAO;GACL,SAAS,KAAK,aAAa;GAC3B,UAAU,KAAK,YAAY;GAC3B,QAAQ,KAAK;GACb,QAAQ,KAAK;GACb,iBAAiB;EACnB;CACF;AACF;AAEA,SAAS,WAAW,KAAqB;CACvC,IAAI,0BAA0B,KAAK,GAAG,GAAG,OAAO;CAChD,OAAO,IAAI,IAAI,QAAQ,MAAM,OAAO,EAAE;AACxC;AAEA,SAAS,YAAY,MAAuB;CAC1C,OAAO,2BAA2B,KAAK,IAAI;AAC7C;AAEA,SAAS,aAAa,SAAiB,MAA4B,SAAoD;CACrH,MAAM,cAAc,MAAM,SAAS,GAAG,QAAQ,GAAG,KAAK,KAAI,QAAO,WAAW,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM;CAChG,MAAM,QAAkB,CAAC;CAEzB,IAAI,SAAS,KACX,MAAM,KAAK,MAAM,WAAW,QAAQ,GAAG,GAAG;CAG5C,MAAM,MAAM,SAAS,OAAO,CAAC;CAC7B,MAAM,iBAAiB,OAAO,QAAQ,GAAG,CAAC,CACvC,QAAQ,UAAqC,MAAM,OAAO,KAAA,CAAS,CAAC,CACpE,KAAK,CAAC,KAAK,WAAW;EACr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SAAS;GACX;GACA,gBAAgB;IACd,MAAM;IACN,aAAa;IACb,SAAS;IACT,SAAS;IACT,SAAS;GACX;GACA,wBAAwB;IACtB,MAAM;IACN,aAAa;IACb,SAAS;GACX;EACF;CACF;CACA,gBAAe,WAAU,IAAI,wBAAwB,MAAM;AAC7D"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/sandbox/index.ts","../src/provider.ts"],"sourcesContent":["/**\n * AWS Bedrock AgentCore Runtime sandbox provider.\n *\n * This provider maps Mastra's one-shot command execution contract to\n * InvokeAgentRuntimeCommand. It intentionally does not expose process\n * management or filesystem mounts because AgentCore Runtime command execution\n * does not provide those WorkspaceSandbox semantics.\n *\n * @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-execute-command.html\n */\n\nimport { randomUUID } from 'node:crypto';\nimport {\n BedrockAgentCoreClient,\n InvokeAgentRuntimeCommandCommand,\n StopRuntimeSessionCommand,\n} from '@aws-sdk/client-bedrock-agentcore';\nimport type { RequestContext } from '@mastra/core/di';\nimport type {\n CommandResult,\n ExecuteCommandOptions,\n MastraSandboxOptions,\n ProviderStatus,\n SandboxInfo,\n} from '@mastra/core/workspace';\nimport { MastraSandbox, ProcessHandle, UnsupportedStdinCloseError } from '@mastra/core/workspace';\n\nconst LOG_PREFIX = '[AgentCoreRuntimeSandbox]';\nconst DEFAULT_COMMAND_TIMEOUT_MS = 300_000;\nconst MAX_AGENTCORE_TIMEOUT_SECONDS = 3600;\nconst DEFAULT_ACCEPT = 'application/vnd.amazon.eventstream';\nconst DEFAULT_CONTENT_TYPE = 'application/json';\n\ntype AgentCoreRuntimeClient = Pick<BedrockAgentCoreClient, 'send' | 'destroy'>;\ntype InstructionsOption = string | ((opts: { defaultInstructions: string; requestContext?: RequestContext }) => string);\ntype AgentCoreStreamException = {\n name?: string;\n message?: string;\n};\n\ntype AgentCoreStreamEvent = {\n chunk?: {\n contentStart?: unknown;\n contentDelta?: {\n stdout?: string;\n stderr?: string;\n };\n contentStop?: {\n exitCode?: number;\n status?: string;\n };\n };\n accessDeniedException?: AgentCoreStreamException;\n internalServerException?: AgentCoreStreamException;\n resourceNotFoundException?: AgentCoreStreamException;\n serviceQuotaExceededException?: AgentCoreStreamException;\n throttlingException?: AgentCoreStreamException;\n validationException?: AgentCoreStreamException;\n runtimeClientError?: AgentCoreStreamException;\n $unknown?: [string, unknown];\n};\n\nclass CommandOutputAccumulator extends ProcessHandle {\n readonly pid = 'agentcore-command';\n exitCode: number | undefined;\n\n async kill(): Promise<boolean> {\n return false;\n }\n\n async sendStdin(): Promise<void> {\n throw new Error('AgentCore Runtime command execution does not support stdin');\n }\n\n async closeStdin(): Promise<void> {\n throw new UnsupportedStdinCloseError('AgentCore Runtime command execution does not support closing stdin');\n }\n\n async wait(): Promise<CommandResult> {\n return {\n success: this.exitCode === 0,\n exitCode: this.exitCode ?? 1,\n stdout: this.stdout,\n stderr: this.stderr,\n executionTimeMs: 0,\n };\n }\n}\n\nfunction shellQuote(arg: string): string {\n if (/^[a-zA-Z0-9._\\-\\/=:@]+$/.test(arg)) return arg;\n return `'${arg.replace(/'/g, \"'\\\\''\")}'`;\n}\n\nfunction safeEnvName(name: string): boolean {\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name);\n}\n\nfunction buildCommand(\n command: string,\n args: string[] | undefined,\n options: ExecuteCommandOptions | undefined,\n workingDirectory?: string,\n): string {\n const baseCommand = args?.length ? `${command} ${args.map(arg => shellQuote(arg)).join(' ')}` : command;\n const parts: string[] = [];\n\n // The cd target is shell-quoted, which defeats `~` expansion — the sandbox's\n // workingDirectory option must be an absolute path on this provider.\n const cwd = options?.cwd ?? workingDirectory;\n if (cwd) {\n parts.push(`cd ${shellQuote(cwd)}`);\n }\n\n const env = options?.env ?? {};\n const envAssignments = Object.entries(env)\n .filter((entry): entry is [string, string] => entry[1] !== undefined)\n .map(([key, value]) => {\n if (!safeEnvName(key)) {\n throw new Error(`Invalid environment variable name for AgentCore Runtime command: ${key}`);\n }\n return `${key}=${shellQuote(value)}`;\n });\n\n parts.push(`${envAssignments.length ? `${envAssignments.join(' ')} ` : ''}${baseCommand}`);\n return parts.join(' && ');\n}\n\nfunction toAgentCoreTimeoutSeconds(timeoutMs: number): number {\n if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {\n throw new RangeError('AgentCore Runtime command timeout must be a positive number of milliseconds');\n }\n\n const timeoutSeconds = Math.ceil(timeoutMs / 1000);\n if (timeoutSeconds > MAX_AGENTCORE_TIMEOUT_SECONDS) {\n throw new RangeError(`AgentCore Runtime command timeout must be at most ${MAX_AGENTCORE_TIMEOUT_SECONDS} seconds`);\n }\n\n return timeoutSeconds;\n}\n\nfunction generateSessionId(): string {\n return randomUUID();\n}\n\nfunction getStreamException(event: AgentCoreStreamEvent): { key: string; value: unknown } | undefined {\n const exceptionKeys = [\n 'accessDeniedException',\n 'internalServerException',\n 'resourceNotFoundException',\n 'serviceQuotaExceededException',\n 'throttlingException',\n 'validationException',\n 'runtimeClientError',\n ] as const;\n\n for (const key of exceptionKeys) {\n const value = event[key];\n if (value) return { key, value };\n }\n\n if (event.$unknown) {\n return { key: event.$unknown[0], value: event.$unknown[1] };\n }\n\n return undefined;\n}\n\nfunction formatStreamException(key: string, value: unknown): string {\n if (value && typeof value === 'object') {\n const exception = value as AgentCoreStreamException;\n const name = exception.name ?? key;\n return exception.message ? `${name}: ${exception.message}` : name;\n }\n\n return `${key}: ${String(value)}`;\n}\n\n// =============================================================================\n// Options\n// =============================================================================\n\nexport interface AgentCoreRuntimeSandboxOptions extends Omit<MastraSandboxOptions, 'processes'> {\n /** AWS region for the Bedrock AgentCore client. Falls back to the AWS SDK default region chain. */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute. */\n agentRuntimeArn: string;\n /** Runtime session ID. Defaults to a generated UUID, which satisfies AgentCore's 33 character minimum. */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint. Defaults to AWS AgentCore's DEFAULT qualifier. */\n qualifier?: string;\n /** MIME type sent for command requests. */\n contentType?: string;\n /** Accept header for command event streams. */\n accept?: string;\n /** Default command timeout in milliseconds. */\n commandTimeout?: number;\n /**\n * Stop the AgentCore Runtime session during stop()/destroy().\n *\n * Defaults to false because sessions are often shared with agent invocations\n * outside the WorkspaceSandbox instance.\n */\n stopSessionOnLifecycle?: boolean;\n /** Client token used for StopRuntimeSession. Defaults to a generated UUID when needed. */\n stopClientToken?: string;\n /** Optional preconfigured AWS SDK client, primarily for advanced credential setup and tests. */\n client?: AgentCoreRuntimeClient;\n /** Custom instructions for getInstructions(). String replaces the default; function receives it. */\n instructions?: InstructionsOption;\n}\n\n// =============================================================================\n// Implementation\n// =============================================================================\n\nexport class AgentCoreRuntimeSandbox extends MastraSandbox {\n readonly id: string;\n readonly name = 'AgentCoreRuntimeSandbox';\n readonly provider = 'agentcore';\n status: ProviderStatus = 'pending';\n\n private _client?: AgentCoreRuntimeClient;\n private readonly _ownsClient: boolean;\n private readonly _region?: string;\n private readonly _agentRuntimeArn: string;\n private readonly _runtimeSessionId: string;\n private readonly _qualifier?: string;\n private readonly _contentType: string;\n private readonly _accept: string;\n private readonly _commandTimeout: number;\n private readonly _stopSessionOnLifecycle: boolean;\n private readonly _stopClientToken?: string;\n private readonly _instructionsOverride?: InstructionsOption;\n private readonly _createdAt = new Date();\n private _lastUsedAt?: Date;\n\n constructor(options: AgentCoreRuntimeSandboxOptions) {\n super({ ...options, name: 'AgentCoreRuntimeSandbox' });\n\n if (!options.agentRuntimeArn) {\n throw new Error(`${LOG_PREFIX} agentRuntimeArn is required`);\n }\n\n this.id = options.runtimeSessionId ?? generateSessionId();\n this._agentRuntimeArn = options.agentRuntimeArn;\n this._runtimeSessionId = this.id;\n this._qualifier = options.qualifier;\n this._contentType = options.contentType ?? DEFAULT_CONTENT_TYPE;\n this._accept = options.accept ?? DEFAULT_ACCEPT;\n this._commandTimeout = options.commandTimeout ?? DEFAULT_COMMAND_TIMEOUT_MS;\n this._stopSessionOnLifecycle = options.stopSessionOnLifecycle ?? false;\n this._stopClientToken = options.stopClientToken;\n this._instructionsOverride = options.instructions;\n this._client = options.client;\n this._ownsClient = !options.client;\n this._region = options.region;\n }\n\n get runtimeSessionId(): string {\n return this._runtimeSessionId;\n }\n\n get agentRuntimeArn(): string {\n return this._agentRuntimeArn;\n }\n\n async start(): Promise<void> {\n this.logger.debug(`${LOG_PREFIX} Using AgentCore Runtime session ${this._runtimeSessionId}`);\n }\n\n async stop(): Promise<void> {\n if (!this._stopSessionOnLifecycle) return;\n await this.stopRuntimeSession();\n }\n\n async destroy(): Promise<void> {\n if (this._stopSessionOnLifecycle) {\n await this.stopRuntimeSession();\n }\n\n if (this._ownsClient && this._client) {\n this._client.destroy();\n this._client = undefined;\n }\n }\n\n /**\n * Explicitly stops the AgentCore Runtime session used by this sandbox.\n *\n * This is separate from destroy() because AgentCore Runtime sessions can be\n * shared with agent invocations outside the WorkspaceSandbox lifecycle.\n */\n async stopRuntimeSession(): Promise<void> {\n await this._getClient().send(\n new StopRuntimeSessionCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n clientToken: this._stopClientToken ?? generateSessionId(),\n }),\n );\n }\n\n async executeCommand(command: string, args?: string[], options?: ExecuteCommandOptions): Promise<CommandResult> {\n await this.ensureRunning();\n\n // Merge the sandbox env under per-call env — this exec path bypasses the process manager\n const fullCommand = buildCommand(\n command,\n args,\n { ...options, env: { ...this.getEnv(), ...options?.env } },\n this.workingDirectory,\n );\n const timeoutMs = options?.timeout ?? this._commandTimeout;\n const timeoutSeconds = toAgentCoreTimeoutSeconds(timeoutMs);\n const startTime = Date.now();\n const output = new CommandOutputAccumulator({\n maxRetainedBytes: options?.maxRetainedBytes ?? Infinity,\n onStdout: options?.onStdout,\n onStderr: options?.onStderr,\n });\n let stopStatus: string | undefined;\n\n this.logger.debug(`${LOG_PREFIX} Executing command`, {\n runtimeSessionId: this._runtimeSessionId,\n command: fullCommand,\n timeoutSeconds,\n });\n\n const response = await this._getClient().send(\n new InvokeAgentRuntimeCommandCommand({\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier,\n contentType: this._contentType,\n accept: this._accept,\n body: {\n command: fullCommand,\n timeout: timeoutSeconds,\n },\n }),\n { abortSignal: options?.abortSignal },\n );\n\n for await (const event of response.stream ?? []) {\n const streamEvent = event as AgentCoreStreamEvent;\n const streamException = getStreamException(streamEvent);\n if (streamException) {\n throw new Error(`${LOG_PREFIX} ${formatStreamException(streamException.key, streamException.value)}`);\n }\n\n const chunk = streamEvent.chunk;\n if (!chunk) continue;\n\n if (chunk.contentDelta?.stdout) {\n output.emitStdout(chunk.contentDelta.stdout);\n }\n\n if (chunk.contentDelta?.stderr) {\n output.emitStderr(chunk.contentDelta.stderr);\n }\n\n if (chunk.contentStop) {\n output.exitCode = chunk.contentStop.exitCode ?? 1;\n stopStatus = chunk.contentStop.status;\n }\n }\n\n const executionTimeMs = Date.now() - startTime;\n const exitCode = output.exitCode ?? 1;\n const timedOut = stopStatus === 'TIMED_OUT';\n const finalExitCode = timedOut ? 124 : exitCode;\n this._lastUsedAt = new Date();\n\n return {\n command: fullCommand,\n args,\n success: finalExitCode === 0 && !timedOut,\n exitCode: finalExitCode,\n stdout: output.stdout,\n stderr: output.stderr,\n executionTimeMs,\n timedOut,\n stdoutTruncated: output.stdoutTruncated,\n stderrTruncated: output.stderrTruncated,\n stdoutDroppedBytes: output.stdoutDroppedBytes,\n stderrDroppedBytes: output.stderrDroppedBytes,\n };\n }\n\n getInstructions(opts?: { requestContext?: RequestContext }): string {\n const defaultInstructions = this._getDefaultInstructions();\n if (this._instructionsOverride === undefined) return defaultInstructions;\n if (typeof this._instructionsOverride === 'string') return this._instructionsOverride;\n return this._instructionsOverride({ defaultInstructions, requestContext: opts?.requestContext });\n }\n\n async getInfo(): Promise<SandboxInfo> {\n return {\n id: this.id,\n name: this.name,\n provider: this.provider,\n status: this.status,\n createdAt: this._createdAt,\n lastUsedAt: this._lastUsedAt,\n metadata: {\n agentRuntimeArn: this._agentRuntimeArn,\n runtimeSessionId: this._runtimeSessionId,\n qualifier: this._qualifier ?? 'DEFAULT',\n stopSessionOnLifecycle: this._stopSessionOnLifecycle,\n },\n };\n }\n\n private _getDefaultInstructions(): string {\n return [\n 'AWS Bedrock AgentCore Runtime sandbox.',\n 'Commands run inside the configured AgentCore Runtime session container.',\n 'Command output streams from AgentCore Runtime as stdout and stderr.',\n 'Limitations:',\n '- Commands are one-shot and non-interactive.',\n '- There is no persistent shell session between commands.',\n '- Background process management is not exposed by this provider.',\n '- Filesystem mounts are not exposed by this provider.',\n '- Developer tools such as git, npm, Python, or Node must exist in the AgentCore container image.',\n '- AgentCore Code Interpreter is a separate service and is not part of this runtime sandbox.',\n ].join('\\n');\n }\n\n private _getClient(): AgentCoreRuntimeClient {\n if (!this._client) {\n this._client = new BedrockAgentCoreClient({ region: this._region });\n }\n return this._client;\n }\n}\n","/**\n * AWS Bedrock AgentCore Runtime sandbox provider descriptor.\n *\n * Enables registration with MastraEditor for UI-driven sandbox configuration.\n */\n\nimport type { SandboxProvider } from '@mastra/core/editor';\nimport { AgentCoreRuntimeSandbox } from './sandbox';\n\nexport interface AgentCoreRuntimeProviderConfig {\n /** AWS region for the Bedrock AgentCore client */\n region?: string;\n /** AgentCore Runtime ARN where commands should execute */\n agentRuntimeArn: string;\n /** Runtime session ID */\n runtimeSessionId?: string;\n /** Agent runtime qualifier/endpoint */\n qualifier?: string;\n /** Default command timeout in milliseconds */\n commandTimeout?: number;\n /** Stop the runtime session during stop()/destroy() */\n stopSessionOnLifecycle?: boolean;\n}\n\nexport const agentCoreRuntimeSandboxProvider: SandboxProvider<AgentCoreRuntimeProviderConfig> = {\n id: 'agentcore',\n name: 'AgentCore Runtime Sandbox',\n description: 'AWS Bedrock AgentCore Runtime command execution sandbox',\n configSchema: {\n type: 'object',\n required: ['agentRuntimeArn'],\n properties: {\n region: {\n type: 'string',\n description: 'AWS region for Bedrock AgentCore',\n },\n agentRuntimeArn: {\n type: 'string',\n description: 'AgentCore Runtime ARN',\n },\n runtimeSessionId: {\n type: 'string',\n description: 'Runtime session ID. Defaults to a generated UUID.',\n },\n qualifier: {\n type: 'string',\n description: 'Agent runtime qualifier/endpoint',\n default: 'DEFAULT',\n },\n commandTimeout: {\n type: 'number',\n description: 'Default command timeout in milliseconds. Must be between 1 and 3,600,000.',\n default: 300_000,\n minimum: 1,\n maximum: 3_600_000,\n },\n stopSessionOnLifecycle: {\n type: 'boolean',\n description: 'Stop the AgentCore Runtime session during stop()/destroy()',\n default: false,\n },\n },\n },\n createSandbox: config => new AgentCoreRuntimeSandbox(config),\n};\n"],"mappings":";;;;;;;;;;;;;;AA2BA,MAAM,aAAa;AACnB,MAAM,6BAA6B;AACnC,MAAM,gCAAgC;AACtC,MAAM,iBAAiB;AACvB,MAAM,uBAAuB;AA+B7B,IAAM,2BAAN,cAAuC,cAAc;CACnD,MAAe;CACf;CAEA,MAAM,OAAyB;EAC7B,OAAO;CACT;CAEA,MAAM,YAA2B;EAC/B,MAAM,IAAI,MAAM,4DAA4D;CAC9E;CAEA,MAAM,aAA4B;EAChC,MAAM,IAAI,2BAA2B,oEAAoE;CAC3G;CAEA,MAAM,OAA+B;EACnC,OAAO;GACL,SAAS,KAAK,aAAa;GAC3B,UAAU,KAAK,YAAY;GAC3B,QAAQ,KAAK;GACb,QAAQ,KAAK;GACb,iBAAiB;EACnB;CACF;AACF;AAEA,SAAS,WAAW,KAAqB;CACvC,IAAI,0BAA0B,KAAK,GAAG,GAAG,OAAO;CAChD,OAAO,IAAI,IAAI,QAAQ,MAAM,OAAO,EAAE;AACxC;AAEA,SAAS,YAAY,MAAuB;CAC1C,OAAO,2BAA2B,KAAK,IAAI;AAC7C;AAEA,SAAS,aACP,SACA,MACA,SACA,kBACQ;CACR,MAAM,cAAc,MAAM,SAAS,GAAG,QAAQ,GAAG,KAAK,KAAI,QAAO,WAAW,GAAG,CAAC,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CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAU;IAClD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAqB;IAC5D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,OAAO,CAAC,WAAW,CAAC,CAAO;IAE3B,YAAY,OAAO,EAAE,8BAA8B,EAoBlD;IAED,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1B;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAS7B;IAED;;;;;OAKG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CASxC;IAEK,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC,CAqF9G;IAED,eAAe,CAAC,IAAI,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,cAAc,CAAA;KAAE,GAAG,MAAM,CAKlE;IAEK,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAepC;IAED,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,UAAU;CAMnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/agentcore",
3
- "version": "0.4.1",
3
+ "version": "0.5.0-alpha.1",
4
4
  "description": "AWS Bedrock AgentCore Runtime sandbox provider for Mastra workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,18 +29,17 @@
29
29
  "dotenv": "^17.4.2",
30
30
  "eslint": "^10.7.0",
31
31
  "tsdown": "0.22.9",
32
- "typescript": "^6.0.3",
32
+ "typescript": "^7.0.2",
33
33
  "vitest": "4.1.10",
34
- "@internal/lint": "0.0.126",
35
- "@internal/types-builder": "0.0.101",
36
- "@mastra/core": "1.62.0"
34
+ "@internal/lint": "0.0.129",
35
+ "@internal/types-builder": "0.0.104",
36
+ "@mastra/core": "1.64.0-alpha.7"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@mastra/core": ">=1.12.0-0 <2.0.0-0"
40
40
  },
41
41
  "files": [
42
- "dist",
43
- "CHANGELOG.md"
42
+ "dist"
44
43
  ],
45
44
  "homepage": "https://mastra.ai",
46
45
  "repository": {
package/CHANGELOG.md DELETED
@@ -1,185 +0,0 @@
1
- # @mastra/agentcore
2
-
3
- ## 0.4.1
4
-
5
- ### Patch Changes
6
-
7
- - Honor the sandbox runtime environment (`setEnv()`/`getEnv()` from `@mastra/core`) in every workspace sandbox provider. Environment variables set after construction now reach subsequent commands on all providers: ([#22250](https://github.com/mastra-ai/mastra/pull/22250))
8
-
9
- - Process-manager-routed providers (E2B, Blaxel, Cloudflare, Daytona, Docker, Modal, Vercel microVM spawns) inherit the merge from the core spawn wrapper; their duplicated per-manager env plumbing is removed.
10
- - Providers with their own exec transports (AgentCore, Apple Container, Railway, Vercel microVM and serverless `executeCommand`, Platform's private-network, WebSocket lease, and E2B lease paths) now merge `getEnv()` under per-call env.
11
-
12
- Constructor `env` continues to behave as before: it seeds the sandbox runtime environment, and providers that bake env into the VM or container at creation time (Docker, Modal, Railway, Apple Container, Vercel, Platform) still do so. Per-call `env` on `executeCommand` still takes precedence for that command only.
13
-
14
- Removed exported types (minor bump for these two packages): `BlaxelProcessManagerOptions` from `@mastra/blaxel` and `RailwayProcessManagerOptions` from `@mastra/railway`. Both existed only to pass `env` into a process manager constructed by hand; the core spawn wrapper now owns that merge, so the option and its type are gone.
15
-
16
- - Updated dependencies [[`79f04a7`](https://github.com/mastra-ai/mastra/commit/79f04a7f6c6829da541139f638f2f1d267916e08), [`65edab1`](https://github.com/mastra-ai/mastra/commit/65edab1c233d17b8f163bad12fca410d0e6f16b1), [`1e47b75`](https://github.com/mastra-ai/mastra/commit/1e47b7520cab4cfaa8daed52f17e2e6d14ff7539), [`ab20a38`](https://github.com/mastra-ai/mastra/commit/ab20a38d0275f8d85e0f3833bd87ef487bcc609f), [`fd4d5fe`](https://github.com/mastra-ai/mastra/commit/fd4d5fe4f943699b85db5e74404f190d5a6b8c2a), [`ae8790c`](https://github.com/mastra-ai/mastra/commit/ae8790c4bfaa088d2ab279d1dcc06f326b9fd109), [`2c85f42`](https://github.com/mastra-ai/mastra/commit/2c85f428e04ccd63ea31a7ec80b5b327afdad555), [`11bbeb9`](https://github.com/mastra-ai/mastra/commit/11bbeb9b108ef2264e05acefc6dafb9cbb342921), [`48ef1f1`](https://github.com/mastra-ai/mastra/commit/48ef1f1d24eedafbb07f64e659a81b52b67b8bf6), [`aa3a85d`](https://github.com/mastra-ai/mastra/commit/aa3a85daf094c683bb97efdf4b6a696d2e474af5), [`d29d06f`](https://github.com/mastra-ai/mastra/commit/d29d06fe00bbd35b4571150ea04c59d2ed783c71), [`e6516df`](https://github.com/mastra-ai/mastra/commit/e6516dfcdae4f4ac0e7971d84359a81385ee602f), [`1a485f3`](https://github.com/mastra-ai/mastra/commit/1a485f3538f5ec64d58bd8b5e1e99de0c695c87b), [`0d37487`](https://github.com/mastra-ai/mastra/commit/0d37487d9f349388a3f1cef6a536cf9dcc4b6273), [`8661d7d`](https://github.com/mastra-ai/mastra/commit/8661d7d7179f0a024456aabdd8679bcecd09ac28), [`dbbfeb8`](https://github.com/mastra-ai/mastra/commit/dbbfeb85ec949dc9ebc0755e1ad262e4f5eba8db), [`575e343`](https://github.com/mastra-ai/mastra/commit/575e343900451021d96110916497d334af7bc252), [`0b2a3d1`](https://github.com/mastra-ai/mastra/commit/0b2a3d1783875c5b97b7b36ab3d03d7360e0dde7), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`3cc9d00`](https://github.com/mastra-ai/mastra/commit/3cc9d00b2b4333e0377a5e9df5eff92c17ce7630), [`cacb839`](https://github.com/mastra-ai/mastra/commit/cacb8392d9e74189b56d857290b0615f98a2683d), [`57de7d6`](https://github.com/mastra-ai/mastra/commit/57de7d644ba7146edb4e9e6111ec4fa98c3a59e9), [`c8e4cea`](https://github.com/mastra-ai/mastra/commit/c8e4ceac9a390d78c8327dff3cdb2861dd71957f), [`ed01e9a`](https://github.com/mastra-ai/mastra/commit/ed01e9a807514a904374bf687a7b8f18750f6f78), [`b47b26e`](https://github.com/mastra-ai/mastra/commit/b47b26e6fe95cb8a3482be2c5e52de157fe59d0b), [`0d37487`](https://github.com/mastra-ai/mastra/commit/0d37487d9f349388a3f1cef6a536cf9dcc4b6273), [`733a537`](https://github.com/mastra-ai/mastra/commit/733a537489a858b5880b2e98809334fba895a221), [`e8e299c`](https://github.com/mastra-ai/mastra/commit/e8e299cc6abdfc39947e2fec25803493015d3882), [`edfc548`](https://github.com/mastra-ai/mastra/commit/edfc548886bc7bae17b681f8b6b41a47eb32bcd2), [`b05f486`](https://github.com/mastra-ai/mastra/commit/b05f48612984d5fe2447ea2d6cdd5c604d285b97), [`a8a4871`](https://github.com/mastra-ai/mastra/commit/a8a4871215f51da95c47129602157ce5372f634a), [`eb9ecaa`](https://github.com/mastra-ai/mastra/commit/eb9ecaa89c36e889749e3b825cfc507ce7f7980b), [`4ff3ee2`](https://github.com/mastra-ai/mastra/commit/4ff3ee2bff7ed07528b4817f8f49639031c72a4d), [`9207dfa`](https://github.com/mastra-ai/mastra/commit/9207dfab8062e5fc68b751684797ff86fe0b4e70), [`5165cdc`](https://github.com/mastra-ai/mastra/commit/5165cdcdcf50e144bb8113278535196cc9b07065), [`e737014`](https://github.com/mastra-ai/mastra/commit/e737014e0fc7035759762bb5b48baef1d6c0f6a7), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`f591643`](https://github.com/mastra-ai/mastra/commit/f591643becdf0be9bddce6ba1748e64bc30d77f1), [`63796ba`](https://github.com/mastra-ai/mastra/commit/63796ba0fda60253be17535e68f6bbbf1e6ffa09), [`b1ad324`](https://github.com/mastra-ai/mastra/commit/b1ad324d657f3544b0701332aef7eb10e9a36258), [`61c566d`](https://github.com/mastra-ai/mastra/commit/61c566dd2f2cde2b23ed8f139924e530d4202214), [`c24754c`](https://github.com/mastra-ai/mastra/commit/c24754c1fb6fe144e5051e536e98c8a18b0214ac), [`12c61d2`](https://github.com/mastra-ai/mastra/commit/12c61d280c8cb208bc3c8dbcbe5dcc60cf9d1cd0), [`c46eb09`](https://github.com/mastra-ai/mastra/commit/c46eb09ce4987509af57a0ac582c61241a6dd2f1), [`9ee8120`](https://github.com/mastra-ai/mastra/commit/9ee8120ce17f76b9f617489e05a283353742690a), [`d975e92`](https://github.com/mastra-ai/mastra/commit/d975e924d4936f46c386bd3dee39c671720289f6), [`45dd6ee`](https://github.com/mastra-ai/mastra/commit/45dd6ee089bd7df0d0c98a10098e483fd388e04a), [`4e9a228`](https://github.com/mastra-ai/mastra/commit/4e9a2283d5fd6ed1b70a2751eb3dc2cbf82ada20), [`d6ce34a`](https://github.com/mastra-ai/mastra/commit/d6ce34aeceb06ddf3d595a1eed5cc74f481a46a1), [`f95f468`](https://github.com/mastra-ai/mastra/commit/f95f468cf1e7c2b924a13826494f98b8f2ccd581), [`30ed33e`](https://github.com/mastra-ai/mastra/commit/30ed33ee14084a26019aba15fceadda6d6ddefaf), [`04a815f`](https://github.com/mastra-ai/mastra/commit/04a815fc8971d29e97fcdcc5008a1eb472fc00ff), [`1cfa878`](https://github.com/mastra-ai/mastra/commit/1cfa8784d8da0dfaa0317e5048bc48b6084a5ea5), [`9a12ef3`](https://github.com/mastra-ai/mastra/commit/9a12ef3fccf3f4186db0f294f4ee1f02cf4d8db2), [`32d3583`](https://github.com/mastra-ai/mastra/commit/32d358332cb8ac2306b83b73cf3536e74dbd435e), [`7960688`](https://github.com/mastra-ai/mastra/commit/7960688828e04eaf3106e34f7758fa580257eef6), [`91ad69d`](https://github.com/mastra-ai/mastra/commit/91ad69d64994c89199b0c55399e64ed91c61df2f), [`8dc408d`](https://github.com/mastra-ai/mastra/commit/8dc408d34438f9e13297f792c11a5cfd6cf952e1), [`c92def1`](https://github.com/mastra-ai/mastra/commit/c92def10a13c822972c96f0a4ca6ffc1f4258aed), [`63041eb`](https://github.com/mastra-ai/mastra/commit/63041eb4c50b520a0a80e03d4cd6ea99f67715a0), [`c118318`](https://github.com/mastra-ai/mastra/commit/c1183181c9804303db4b511c2e2648f8b714712b), [`c5eaec5`](https://github.com/mastra-ai/mastra/commit/c5eaec5a860d80d0e3805e67db0414b87ac8cbed), [`fc07c64`](https://github.com/mastra-ai/mastra/commit/fc07c6465043e08e99193a6751a01c56ffc2e7a1), [`cced745`](https://github.com/mastra-ai/mastra/commit/cced745a056ec2225c5bc702e32d848847aa8b65), [`542dee2`](https://github.com/mastra-ai/mastra/commit/542dee254167f974ff8cbbbfc0ce10f9a2616a7b), [`3c19dce`](https://github.com/mastra-ai/mastra/commit/3c19dcef8e73062a80627a4927eae3ec11145afd), [`aca2869`](https://github.com/mastra-ai/mastra/commit/aca2869b2031982f3c4a2f52525c9be7cf123ef8), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`e6f8450`](https://github.com/mastra-ai/mastra/commit/e6f845074d478527026b18d85031b23353e1d0a4), [`895e9df`](https://github.com/mastra-ai/mastra/commit/895e9dfc17d6f34299eca64e317ded9e5f5e5ef8), [`e66b2ba`](https://github.com/mastra-ai/mastra/commit/e66b2ba100db63eaeab6e21e1ea34b113f2ec781), [`3e8727e`](https://github.com/mastra-ai/mastra/commit/3e8727e11ec1a5d733acedb5c872896394be18c1)]:
17
- - @mastra/core@1.62.0
18
-
19
- ## 0.4.1-alpha.0
20
-
21
- ### Patch Changes
22
-
23
- - Honor the sandbox runtime environment (`setEnv()`/`getEnv()` from `@mastra/core`) in every workspace sandbox provider. Environment variables set after construction now reach subsequent commands on all providers: ([#22250](https://github.com/mastra-ai/mastra/pull/22250))
24
-
25
- - Process-manager-routed providers (E2B, Blaxel, Cloudflare, Daytona, Docker, Modal, Vercel microVM spawns) inherit the merge from the core spawn wrapper; their duplicated per-manager env plumbing is removed.
26
- - Providers with their own exec transports (AgentCore, Apple Container, Railway, Vercel microVM and serverless `executeCommand`, Platform's private-network, WebSocket lease, and E2B lease paths) now merge `getEnv()` under per-call env.
27
-
28
- Constructor `env` continues to behave as before: it seeds the sandbox runtime environment, and providers that bake env into the VM or container at creation time (Docker, Modal, Railway, Apple Container, Vercel, Platform) still do so. Per-call `env` on `executeCommand` still takes precedence for that command only.
29
-
30
- Removed exported types (minor bump for these two packages): `BlaxelProcessManagerOptions` from `@mastra/blaxel` and `RailwayProcessManagerOptions` from `@mastra/railway`. Both existed only to pass `env` into a process manager constructed by hand; the core spawn wrapper now owns that merge, so the option and its type are gone.
31
-
32
- - Updated dependencies [[`aa3a85d`](https://github.com/mastra-ai/mastra/commit/aa3a85daf094c683bb97efdf4b6a696d2e474af5), [`d29d06f`](https://github.com/mastra-ai/mastra/commit/d29d06fe00bbd35b4571150ea04c59d2ed783c71), [`e6516df`](https://github.com/mastra-ai/mastra/commit/e6516dfcdae4f4ac0e7971d84359a81385ee602f), [`0b2a3d1`](https://github.com/mastra-ai/mastra/commit/0b2a3d1783875c5b97b7b36ab3d03d7360e0dde7), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`57de7d6`](https://github.com/mastra-ai/mastra/commit/57de7d644ba7146edb4e9e6111ec4fa98c3a59e9), [`e8e299c`](https://github.com/mastra-ai/mastra/commit/e8e299cc6abdfc39947e2fec25803493015d3882), [`edfc548`](https://github.com/mastra-ai/mastra/commit/edfc548886bc7bae17b681f8b6b41a47eb32bcd2), [`a8a4871`](https://github.com/mastra-ai/mastra/commit/a8a4871215f51da95c47129602157ce5372f634a), [`5165cdc`](https://github.com/mastra-ai/mastra/commit/5165cdcdcf50e144bb8113278535196cc9b07065), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`9ee8120`](https://github.com/mastra-ai/mastra/commit/9ee8120ce17f76b9f617489e05a283353742690a), [`d975e92`](https://github.com/mastra-ai/mastra/commit/d975e924d4936f46c386bd3dee39c671720289f6), [`1cfa878`](https://github.com/mastra-ai/mastra/commit/1cfa8784d8da0dfaa0317e5048bc48b6084a5ea5), [`c118318`](https://github.com/mastra-ai/mastra/commit/c1183181c9804303db4b511c2e2648f8b714712b), [`fc07c64`](https://github.com/mastra-ai/mastra/commit/fc07c6465043e08e99193a6751a01c56ffc2e7a1), [`542dee2`](https://github.com/mastra-ai/mastra/commit/542dee254167f974ff8cbbbfc0ce10f9a2616a7b), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`895e9df`](https://github.com/mastra-ai/mastra/commit/895e9dfc17d6f34299eca64e317ded9e5f5e5ef8)]:
33
- - @mastra/core@1.62.0-alpha.8
34
-
35
- ## 0.4.0
36
-
37
- ### Minor Changes
38
-
39
- - Added `ProcessHandle.closeStdin()` to signal end-of-file to background processes. Local and Docker sandboxes support closing stdin, while providers without an available stdin-close API return a provider-specific unsupported-operation error. Providers signal the unsupported case with the new `UnsupportedStdinCloseError`, and the base class supplies that behavior by default so existing `ProcessHandle` subclasses keep compiling. Calling `handle.writer.end()` also closes stdin, and finishes without an error when the provider cannot close stdin. ([#21606](https://github.com/mastra-ai/mastra/pull/21606))
40
-
41
- ### Patch Changes
42
-
43
- - Updated dependencies [[`587f6ef`](https://github.com/mastra-ai/mastra/commit/587f6efcfc25880b93760a8607d1cd381ec612fe), [`7e096f0`](https://github.com/mastra-ai/mastra/commit/7e096f02f0dddbf09b85d306458351245ed2f886), [`d7e6745`](https://github.com/mastra-ai/mastra/commit/d7e67456954863c55440ea9c49bc6ceb9949972d), [`6223446`](https://github.com/mastra-ai/mastra/commit/6223446ddce6166e96e0ba5e00d628b615dee8ca), [`15101bb`](https://github.com/mastra-ai/mastra/commit/15101bb53c0d934f31af6b8813b88191e382a5e5), [`4e7a421`](https://github.com/mastra-ai/mastra/commit/4e7a421dce8a48742f785d1e93ad2f43a572b282), [`c2c3deb`](https://github.com/mastra-ai/mastra/commit/c2c3debcf670c7082d0a5e553aa99818a864698c), [`d8308a2`](https://github.com/mastra-ai/mastra/commit/d8308a2be3c07e777393d1017a381dcae3890d30), [`b0a2a07`](https://github.com/mastra-ai/mastra/commit/b0a2a07800d42bd9823292e7db832374ed084c9c), [`74e5bd3`](https://github.com/mastra-ai/mastra/commit/74e5bd315b8b3a1e04cb6cf480bb0f5fc4951dc8), [`242e324`](https://github.com/mastra-ai/mastra/commit/242e3241e73cbd5c9bb86a31ebb49ca0256488d4), [`217e967`](https://github.com/mastra-ai/mastra/commit/217e9672d8b3160eb729d8e9f0044949e88da239), [`d774e89`](https://github.com/mastra-ai/mastra/commit/d774e8930c781df8c9effe3763e6b501c099b6cc), [`9c27a53`](https://github.com/mastra-ai/mastra/commit/9c27a53cd9d3de4f3f025bc387d94ce371c33f95), [`8f0a332`](https://github.com/mastra-ai/mastra/commit/8f0a3321bf180368d76fe7b36aa1a8f60f00b6de), [`0b4f108`](https://github.com/mastra-ai/mastra/commit/0b4f1089aa8d92e67c2a8e99726822c5ee410784), [`9acb50f`](https://github.com/mastra-ai/mastra/commit/9acb50f71cec9c362f06820033f90ae6b1f8282f), [`46e9e3f`](https://github.com/mastra-ai/mastra/commit/46e9e3f73babe1bc70080a596cf2ac0b9da48519), [`3f9a190`](https://github.com/mastra-ai/mastra/commit/3f9a19057c027155867b9317294ee4ca7bd0581a), [`dff25a1`](https://github.com/mastra-ai/mastra/commit/dff25a1103fa72ee082a9b6f805ebeb5ce400753), [`6db7a5d`](https://github.com/mastra-ai/mastra/commit/6db7a5dd3dd2b6f7ef75dcd804fcffef5fa83963), [`217e967`](https://github.com/mastra-ai/mastra/commit/217e9672d8b3160eb729d8e9f0044949e88da239), [`583e235`](https://github.com/mastra-ai/mastra/commit/583e23519c13af16c1746f9c49722d011216611b), [`b098de9`](https://github.com/mastra-ai/mastra/commit/b098de9d7cb9f672e0883a5c716465a3a689693d), [`e8808e3`](https://github.com/mastra-ai/mastra/commit/e8808e3d8eb585a2565be53e56a7e0e1477352a4), [`a77f8d4`](https://github.com/mastra-ai/mastra/commit/a77f8d4740d2178a74c41e4bf678b4fcd8fa0bb2), [`7f78585`](https://github.com/mastra-ai/mastra/commit/7f785857e401570e2ffb316911f126ed363aa537), [`33374ba`](https://github.com/mastra-ai/mastra/commit/33374ba359e4fb13eaa918ae925fe167a3c55414), [`940bf5c`](https://github.com/mastra-ai/mastra/commit/940bf5ccf04f2c9ebd8a1390431733222a03b1cd), [`c549e2f`](https://github.com/mastra-ai/mastra/commit/c549e2f40edc1cac5d9e74e82f90da22b48df084), [`58c43d3`](https://github.com/mastra-ai/mastra/commit/58c43d3f7cb2eeaeb8ac733ae71dde822348e588), [`ef6e295`](https://github.com/mastra-ai/mastra/commit/ef6e295b59bc25a5b61b633a89c97bcfce9fb465), [`208e1b3`](https://github.com/mastra-ai/mastra/commit/208e1b39f30f4b386e494394e9d71d96f0f90241), [`c938d34`](https://github.com/mastra-ai/mastra/commit/c938d34739936c8ecbabd67ad6a4a4396f41c4c6), [`88ddc7c`](https://github.com/mastra-ai/mastra/commit/88ddc7ce01d40175f13a3228b789a906779680bd), [`f2a4afd`](https://github.com/mastra-ai/mastra/commit/f2a4afd7e37e809669001ed17724b341a5c1f45e), [`d438148`](https://github.com/mastra-ai/mastra/commit/d438148e222c1e2fb3c652725ce75680962ebec4), [`ba05fe0`](https://github.com/mastra-ai/mastra/commit/ba05fe0738f70cb686777546e968237d09269142), [`40d358e`](https://github.com/mastra-ai/mastra/commit/40d358e29d55543803e64b49241122f598ffabc7), [`d26a8d4`](https://github.com/mastra-ai/mastra/commit/d26a8d4281f28414715b333c85bedaf70d0b2890), [`e80cd7e`](https://github.com/mastra-ai/mastra/commit/e80cd7e7683e7d732e1cc6784bcac1d2640d2ce3), [`ccbbcd9`](https://github.com/mastra-ai/mastra/commit/ccbbcd974eedff4367a54ed0e24c9ee742ab2f61), [`1d9a0ea`](https://github.com/mastra-ai/mastra/commit/1d9a0ea4a9901baee6cd56737243bd6d1f631ac0), [`677cdc6`](https://github.com/mastra-ai/mastra/commit/677cdc6af564dec29a13464d12b7ab2a4efc22e9), [`c549e2f`](https://github.com/mastra-ai/mastra/commit/c549e2f40edc1cac5d9e74e82f90da22b48df084), [`a7dd322`](https://github.com/mastra-ai/mastra/commit/a7dd32247d95afc539f483ca37f4594af0387f59), [`3f5c6f7`](https://github.com/mastra-ai/mastra/commit/3f5c6f728ea35da344248de9aa070f12849f3aa0), [`a318490`](https://github.com/mastra-ai/mastra/commit/a318490e17da32f338d50929c770d901a9b3dd72), [`b860493`](https://github.com/mastra-ai/mastra/commit/b86049391100e665d579f700c8a2034c036defc3), [`d4be8c1`](https://github.com/mastra-ai/mastra/commit/d4be8c1739d22d621e3f78790e1dd5eb5ecc3589), [`a5d2eb1`](https://github.com/mastra-ai/mastra/commit/a5d2eb10347eade1ae2816d88f466c25186c54a5), [`3667679`](https://github.com/mastra-ai/mastra/commit/3667679db057edfb086846d13369fdda4902ad65), [`49696e8`](https://github.com/mastra-ai/mastra/commit/49696e8e42f870674a0a58f5abcd22cc54dd2864), [`2ef2f23`](https://github.com/mastra-ai/mastra/commit/2ef2f230a7aed342e7dc3b2000cd42e4c43e08a7), [`763e0c6`](https://github.com/mastra-ai/mastra/commit/763e0c61e04d76ad9a9efd301aa57525ca0cbea9), [`20504b2`](https://github.com/mastra-ai/mastra/commit/20504b2ecebd0e077acda3d457ab57480a98ed3e), [`77e6b1b`](https://github.com/mastra-ai/mastra/commit/77e6b1bc4c46ce94fe501023fb4393c812ec6be3), [`c5f964d`](https://github.com/mastra-ai/mastra/commit/c5f964d3f77064e978f8066ec506eed77ba5c63c), [`23e0be2`](https://github.com/mastra-ai/mastra/commit/23e0be261381e49534b4ff3101c60ee64a946cbf), [`7fc8806`](https://github.com/mastra-ai/mastra/commit/7fc880627d3cbf995d31ea0e8b807bf15417e651), [`0e02eac`](https://github.com/mastra-ai/mastra/commit/0e02eacdb2e30e1697a41910b41163742a181dc1), [`4df174c`](https://github.com/mastra-ai/mastra/commit/4df174c32bddf093a82f273070b8380aef7c9e90), [`f7c25b5`](https://github.com/mastra-ai/mastra/commit/f7c25b5106ddfb48e591f98df7a51e0f2dd01dba), [`7aad631`](https://github.com/mastra-ai/mastra/commit/7aad631b43bc10db77d5b8c66b200d7a49d18bf2), [`512100a`](https://github.com/mastra-ai/mastra/commit/512100a7d8b7e9c920f2590c6b3612f5de0d3cff), [`e81744c`](https://github.com/mastra-ai/mastra/commit/e81744cd13c46619c142dc521dc0baac47607a84), [`f8f653f`](https://github.com/mastra-ai/mastra/commit/f8f653f10980d01a73706cc3c8689ca5e40ce808), [`dc09cc1`](https://github.com/mastra-ai/mastra/commit/dc09cc1083d861cde192c1cd235324dc75b8c731), [`9ef432b`](https://github.com/mastra-ai/mastra/commit/9ef432b6faa534b57b0d182a610e13dd9a7123ff), [`36b4649`](https://github.com/mastra-ai/mastra/commit/36b4649045a3a380cbab8ceca866db4086223aff), [`b9cf308`](https://github.com/mastra-ai/mastra/commit/b9cf30846f97f99ac1906ee8a68f4f2d117b0378), [`2e1d098`](https://github.com/mastra-ai/mastra/commit/2e1d0984e325fd319d32ea182f596b3170be3847), [`377eb81`](https://github.com/mastra-ai/mastra/commit/377eb81ce43b964e3a6b541df172da74a8ff3716), [`1794a79`](https://github.com/mastra-ai/mastra/commit/1794a79178c418004a7261b1ad9114066f7ef01d), [`0cdc5dc`](https://github.com/mastra-ai/mastra/commit/0cdc5dc69024957815da4f51acc4119eb4f447d7), [`5740ec6`](https://github.com/mastra-ai/mastra/commit/5740ec60c760ffdfbfaa59d603d03b847c864e05)]:
44
- - @mastra/core@1.60.0
45
-
46
- ## 0.4.0-alpha.0
47
-
48
- ### Minor Changes
49
-
50
- - Added `ProcessHandle.closeStdin()` to signal end-of-file to background processes. Local and Docker sandboxes support closing stdin, while providers without an available stdin-close API return a provider-specific unsupported-operation error. Providers signal the unsupported case with the new `UnsupportedStdinCloseError`, and the base class supplies that behavior by default so existing `ProcessHandle` subclasses keep compiling. Calling `handle.writer.end()` also closes stdin, and finishes without an error when the provider cannot close stdin. ([#21606](https://github.com/mastra-ai/mastra/pull/21606))
51
-
52
- ### Patch Changes
53
-
54
- - Updated dependencies [[`4e7a421`](https://github.com/mastra-ai/mastra/commit/4e7a421dce8a48742f785d1e93ad2f43a572b282), [`242e324`](https://github.com/mastra-ai/mastra/commit/242e3241e73cbd5c9bb86a31ebb49ca0256488d4), [`217e967`](https://github.com/mastra-ai/mastra/commit/217e9672d8b3160eb729d8e9f0044949e88da239), [`d774e89`](https://github.com/mastra-ai/mastra/commit/d774e8930c781df8c9effe3763e6b501c099b6cc), [`9c27a53`](https://github.com/mastra-ai/mastra/commit/9c27a53cd9d3de4f3f025bc387d94ce371c33f95), [`dff25a1`](https://github.com/mastra-ai/mastra/commit/dff25a1103fa72ee082a9b6f805ebeb5ce400753), [`217e967`](https://github.com/mastra-ai/mastra/commit/217e9672d8b3160eb729d8e9f0044949e88da239), [`7f78585`](https://github.com/mastra-ai/mastra/commit/7f785857e401570e2ffb316911f126ed363aa537), [`f2a4afd`](https://github.com/mastra-ai/mastra/commit/f2a4afd7e37e809669001ed17724b341a5c1f45e), [`d438148`](https://github.com/mastra-ai/mastra/commit/d438148e222c1e2fb3c652725ce75680962ebec4), [`ba05fe0`](https://github.com/mastra-ai/mastra/commit/ba05fe0738f70cb686777546e968237d09269142), [`d26a8d4`](https://github.com/mastra-ai/mastra/commit/d26a8d4281f28414715b333c85bedaf70d0b2890), [`677cdc6`](https://github.com/mastra-ai/mastra/commit/677cdc6af564dec29a13464d12b7ab2a4efc22e9), [`a318490`](https://github.com/mastra-ai/mastra/commit/a318490e17da32f338d50929c770d901a9b3dd72), [`763e0c6`](https://github.com/mastra-ai/mastra/commit/763e0c61e04d76ad9a9efd301aa57525ca0cbea9), [`23e0be2`](https://github.com/mastra-ai/mastra/commit/23e0be261381e49534b4ff3101c60ee64a946cbf), [`7fc8806`](https://github.com/mastra-ai/mastra/commit/7fc880627d3cbf995d31ea0e8b807bf15417e651), [`0e02eac`](https://github.com/mastra-ai/mastra/commit/0e02eacdb2e30e1697a41910b41163742a181dc1), [`4df174c`](https://github.com/mastra-ai/mastra/commit/4df174c32bddf093a82f273070b8380aef7c9e90), [`f7c25b5`](https://github.com/mastra-ai/mastra/commit/f7c25b5106ddfb48e591f98df7a51e0f2dd01dba), [`dc09cc1`](https://github.com/mastra-ai/mastra/commit/dc09cc1083d861cde192c1cd235324dc75b8c731), [`36b4649`](https://github.com/mastra-ai/mastra/commit/36b4649045a3a380cbab8ceca866db4086223aff), [`377eb81`](https://github.com/mastra-ai/mastra/commit/377eb81ce43b964e3a6b541df172da74a8ff3716)]:
55
- - @mastra/core@1.60.0-alpha.8
56
-
57
- ## 0.3.1
58
-
59
- ### Patch Changes
60
-
61
- - dependencies updates: ([#20406](https://github.com/mastra-ai/mastra/pull/20406))
62
- - Updated dependency [`@aws-sdk/client-bedrock-agentcore@^3.1095.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/client-bedrock-agentcore/v/3.1095.0) (from `^3.1058.0`, in `dependencies`)
63
- - Updated dependencies [[`e7109ee`](https://github.com/mastra-ai/mastra/commit/e7109ee6f731bacc79c885906f3c7dca8d8f013a), [`b8ce7ec`](https://github.com/mastra-ai/mastra/commit/b8ce7ec96e39343c6c2f36d12d68a9ad816c09f7), [`2e4624e`](https://github.com/mastra-ai/mastra/commit/2e4624edb6917e61249cb60ee377735e7af7e4a9), [`45a9147`](https://github.com/mastra-ai/mastra/commit/45a914741f578754d79d8b7de7b4e4f304d8e14a), [`a3a3624`](https://github.com/mastra-ai/mastra/commit/a3a3624f646b98e409424d8defccbd334da9e8b8), [`6246914`](https://github.com/mastra-ai/mastra/commit/62469146636911f3cbbe0880bd011c6a897a59a7), [`6445eba`](https://github.com/mastra-ai/mastra/commit/6445eba6020abac681aba1cc9289f446cb400cbe), [`86b7b77`](https://github.com/mastra-ai/mastra/commit/86b7b777980d30f66e1fd134a37d2af4c22e54cc), [`1c75e32`](https://github.com/mastra-ai/mastra/commit/1c75e32f7fc0b9fb6f548b4407feaec8a1440212), [`296dc9a`](https://github.com/mastra-ai/mastra/commit/296dc9af29f3616e786c7825ec32e0df92d754c5), [`f59032a`](https://github.com/mastra-ai/mastra/commit/f59032a73699443555a08a479e7ac578975784f2), [`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`3f73c07`](https://github.com/mastra-ai/mastra/commit/3f73c076727e8c36b4fff7a1b40290fb68957fa8), [`772c0c8`](https://github.com/mastra-ai/mastra/commit/772c0c897cec383258de2e6178147f8014767c7b), [`d7cf7fa`](https://github.com/mastra-ai/mastra/commit/d7cf7fafc1ae1b50bd8462dd0e6c671a8606db93), [`7c1ebb1`](https://github.com/mastra-ai/mastra/commit/7c1ebb15690c4b3f0eabb19077cf8af573311e57), [`0f9a448`](https://github.com/mastra-ai/mastra/commit/0f9a448502157e59f7b76f24360ad497168f5ef8), [`578bf2e`](https://github.com/mastra-ai/mastra/commit/578bf2e6a88e9d5b8bf502204e15a95dfbb679ae), [`c47165c`](https://github.com/mastra-ai/mastra/commit/c47165c983c87594c6952f1fd2fa51a90205034c), [`289f4ce`](https://github.com/mastra-ai/mastra/commit/289f4ce16e3293370440172132c52ee787cbc09f), [`df31eb0`](https://github.com/mastra-ai/mastra/commit/df31eb0c7087d782a0d9346e467f9a4af4b0eef6), [`9571e3a`](https://github.com/mastra-ai/mastra/commit/9571e3a06ed2c5220196460bf82a2129255c3a8b), [`4f16ff8`](https://github.com/mastra-ai/mastra/commit/4f16ff824bf2f9b0ddc93f210477c10c8a4fb1ab), [`b4c89b4`](https://github.com/mastra-ai/mastra/commit/b4c89b4371b0c86da57403ad1a3b3ef0681f3128), [`e6534fa`](https://github.com/mastra-ai/mastra/commit/e6534fab031216f6cb48c4c9907cbfdce9d60bc6), [`210cb7a`](https://github.com/mastra-ai/mastra/commit/210cb7a167998c7bbf72cb3b93e6eb0563330239), [`06b2d87`](https://github.com/mastra-ai/mastra/commit/06b2d87e63bcdd0ed59215c6789692b9b12de376), [`1c67d85`](https://github.com/mastra-ai/mastra/commit/1c67d85e9da8285662f4dbbf47e0378c3fee0747), [`ac01d63`](https://github.com/mastra-ai/mastra/commit/ac01d6355974aec73fdb8781449ed12bac582094), [`80a3324`](https://github.com/mastra-ai/mastra/commit/80a33245d3110204de6f56d61211523ffe338692), [`e44e8f3`](https://github.com/mastra-ai/mastra/commit/e44e8f370b66c339ddcaba946d33da6d3c3f06cd), [`d9d2881`](https://github.com/mastra-ai/mastra/commit/d9d2881ede6dd6c023d144215fc812062aed0890), [`a810a05`](https://github.com/mastra-ai/mastra/commit/a810a058f62ad407cfc1701e0be36ae91145d7cf), [`ba24be6`](https://github.com/mastra-ai/mastra/commit/ba24be662439c331ab23a600041f93803c89eca8), [`842b5fe`](https://github.com/mastra-ai/mastra/commit/842b5fe22b6a7fa811bd14e48eb9af523ac989f2), [`990611b`](https://github.com/mastra-ai/mastra/commit/990611ba76eb876d86c9c594371ae5f02f94b432), [`80bdf3a`](https://github.com/mastra-ai/mastra/commit/80bdf3ae16ade6ff63bde0cb16fa2df8ab7dd4dd), [`c967a5e`](https://github.com/mastra-ai/mastra/commit/c967a5eec150c5dc5418c4a4388982d1fb7ad27c), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`9ba1247`](https://github.com/mastra-ai/mastra/commit/9ba12470c77f1c03642d720ce67e517e878f666e), [`fd96298`](https://github.com/mastra-ai/mastra/commit/fd96298a8367622f4ebfcaa97b5b6c1fbbd14564), [`66bbfb5`](https://github.com/mastra-ai/mastra/commit/66bbfb5f05b473d39f88c0e4a481ccac41634f3a), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`f8da216`](https://github.com/mastra-ai/mastra/commit/f8da21633e7eb0e31c9ce0fc30567870d19416d3), [`4a09a9c`](https://github.com/mastra-ai/mastra/commit/4a09a9c0474ef643558fcb5f0edc542b82f1cab0), [`5f798b3`](https://github.com/mastra-ai/mastra/commit/5f798b3362e9bdf4d690f85245606e146eef60b9), [`6a84954`](https://github.com/mastra-ai/mastra/commit/6a84954a2667f85b6d59da652dab1bbff007ccb0), [`1e83a47`](https://github.com/mastra-ai/mastra/commit/1e83a4734ab61ba5926af6793e3569a78b72ed37), [`52d8ef0`](https://github.com/mastra-ai/mastra/commit/52d8ef03801f1deb7ee48532fc4190dd4a33916c), [`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`7fdcaa6`](https://github.com/mastra-ai/mastra/commit/7fdcaa66105d64290f9b14432a12ec99f39c4d3a), [`d6c56f9`](https://github.com/mastra-ai/mastra/commit/d6c56f951db3213330b98b0abafa9778c8770e58), [`e08e789`](https://github.com/mastra-ai/mastra/commit/e08e789c1bf4cd2fe46363f7a4728536ceccc9bd), [`bf936e2`](https://github.com/mastra-ai/mastra/commit/bf936e2c89b2ff0dad5695b873ddc009ba96d41e), [`7fb580a`](https://github.com/mastra-ai/mastra/commit/7fb580ac73fbcacf2ff00872a3395f73ae1b9fa5), [`ed5d606`](https://github.com/mastra-ai/mastra/commit/ed5d606739c5e3fbdfa9f272df7809aa5ab43b1d), [`f53d5bd`](https://github.com/mastra-ai/mastra/commit/f53d5bd4885b29e4ac29a428a6044088ea8d6aa3), [`32980a3`](https://github.com/mastra-ai/mastra/commit/32980a3e2413d0274ac244d32c37d910edc13f00), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`82e3365`](https://github.com/mastra-ai/mastra/commit/82e3365ef7c9bf7bee2e7a7029035ea262d68895), [`6104347`](https://github.com/mastra-ai/mastra/commit/61043473ba6bfd0a25156824e853e13165562e6c), [`35cc901`](https://github.com/mastra-ai/mastra/commit/35cc90102cf834a84827acaf9eee0b6d6d1e2a3b), [`a8b4cf0`](https://github.com/mastra-ai/mastra/commit/a8b4cf02823cffebc4751a53337dfacf097c1ae1), [`9571e3a`](https://github.com/mastra-ai/mastra/commit/9571e3a06ed2c5220196460bf82a2129255c3a8b), [`333785c`](https://github.com/mastra-ai/mastra/commit/333785c93cbb01e42c60167e995457c28897ddbf), [`bda2235`](https://github.com/mastra-ai/mastra/commit/bda22353ee28f2df0eaea555f7cae1549f979c0b), [`efd5c81`](https://github.com/mastra-ai/mastra/commit/efd5c81cc25fde3c2ddd86fc1178deb4ec176e19), [`1b482c2`](https://github.com/mastra-ai/mastra/commit/1b482c2d89244dd758c41e5f927a2b44041388d2), [`45bfb88`](https://github.com/mastra-ai/mastra/commit/45bfb88fd52f1dd3be20e2a38905777c96499c90), [`ff28284`](https://github.com/mastra-ai/mastra/commit/ff2828416f14daff9d956e6a352fdaa23c950979), [`4bcdfaf`](https://github.com/mastra-ai/mastra/commit/4bcdfaf0eac3199d7cb171b0a19a92c9c341eea4), [`e3b9307`](https://github.com/mastra-ai/mastra/commit/e3b9307098daefbfae2a52ae2ef51bc9fc701190), [`d6834c5`](https://github.com/mastra-ai/mastra/commit/d6834c5a7866b16734d23900163c2414ed70d791), [`f33264f`](https://github.com/mastra-ai/mastra/commit/f33264f517ae603279afd5c4251e2b40f6dd3618), [`689f2c4`](https://github.com/mastra-ai/mastra/commit/689f2c4b6c0835fe455702b01d21daa8abcd9331), [`fcd0667`](https://github.com/mastra-ai/mastra/commit/fcd0667a4e378be35c9a1b1eb19cce78fbfd7282), [`cfd0d9e`](https://github.com/mastra-ai/mastra/commit/cfd0d9ec77ec3c69dd96f79cdb579e03d79f22ce), [`acc3513`](https://github.com/mastra-ai/mastra/commit/acc3513b19f79bf0a7ec2998694580edca54086c), [`1670533`](https://github.com/mastra-ai/mastra/commit/1670533986f6bacf567746245348125e3a106448), [`a7eb4a1`](https://github.com/mastra-ai/mastra/commit/a7eb4a11450f6170274ed5141bffe821d4fdd5a6), [`0976933`](https://github.com/mastra-ai/mastra/commit/0976933142333ec78451feef265b68bcb45aa5e7), [`242b945`](https://github.com/mastra-ai/mastra/commit/242b94558777bfbdeb42cbfea84afff0b6ad0633), [`c52d346`](https://github.com/mastra-ai/mastra/commit/c52d3462ec831a5d95926ecd3d3373f5928ad2e5), [`af4636a`](https://github.com/mastra-ai/mastra/commit/af4636a74463275d71c1d13a38f7d2b738f128bf), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`2eabc09`](https://github.com/mastra-ai/mastra/commit/2eabc097d86d52fbd0123da36a7c874154cc384f), [`0023e79`](https://github.com/mastra-ai/mastra/commit/0023e7919431078280abd11c89d1edeae35fcc69), [`c2ad51e`](https://github.com/mastra-ai/mastra/commit/c2ad51e2467f901eecba8c9f4a45e22a50bd7c18), [`25ca73d`](https://github.com/mastra-ai/mastra/commit/25ca73d25dee7ce9f0ca72939e3a505c4db7257e), [`2f9ef3f`](https://github.com/mastra-ai/mastra/commit/2f9ef3f4ca06fc2dcdd5088c26b7f4da6a016791), [`e7eefcb`](https://github.com/mastra-ai/mastra/commit/e7eefcb162cda7c493e8c3bf43050ead0efbcb2c), [`fea5cae`](https://github.com/mastra-ai/mastra/commit/fea5caedc7e2cfea51784a15e015952692027abf), [`4d7aca2`](https://github.com/mastra-ai/mastra/commit/4d7aca2fe75f225c83d1502d63079568e6ec163f), [`e1cead1`](https://github.com/mastra-ai/mastra/commit/e1cead17b5f3653cf00d2f90cc19b113119c02ba), [`01a2943`](https://github.com/mastra-ai/mastra/commit/01a2943a7d886edefdff072bfa51f055bab54437), [`d9d93b2`](https://github.com/mastra-ai/mastra/commit/d9d93b25e4a65ad5fa153fa35be7ed149c8d587f), [`c4ec889`](https://github.com/mastra-ai/mastra/commit/c4ec889561c0264c43f66d04d587bee4ce35e792), [`4b59f78`](https://github.com/mastra-ai/mastra/commit/4b59f786cbc9a7d1ef07a07517dbd4b96865e99d), [`eeae63e`](https://github.com/mastra-ai/mastra/commit/eeae63e7fbe8e1f237adc69bca6e2ac13c5ca907), [`3dc97ea`](https://github.com/mastra-ai/mastra/commit/3dc97ea415fad353b48a13095fad1835933cc12a), [`94e7ae9`](https://github.com/mastra-ai/mastra/commit/94e7ae970b37c888cd1244ef013292639a2fe6d1), [`e6a2860`](https://github.com/mastra-ai/mastra/commit/e6a2860649cc51f87d32d78b766ae2126446ba07), [`7010c5d`](https://github.com/mastra-ai/mastra/commit/7010c5d15728bf9c5dfe4fb6b1bf80ce23bf143a), [`bab06b1`](https://github.com/mastra-ai/mastra/commit/bab06b18923873a584bdfc71a6b4ec7fb4727fb7), [`3d01cd3`](https://github.com/mastra-ai/mastra/commit/3d01cd387321b6f9c5cac31d487c84bf51b19c78), [`7bf3086`](https://github.com/mastra-ai/mastra/commit/7bf308663f0115ca74ad20554ade740f06640859), [`4c186a0`](https://github.com/mastra-ai/mastra/commit/4c186a017275f45e6ed4c09de0f89550e2d09e8c), [`b0fa077`](https://github.com/mastra-ai/mastra/commit/b0fa077bcbc9b08551846fe372a0d3d15b71ed72), [`0282e16`](https://github.com/mastra-ai/mastra/commit/0282e16115538c8e9b248b90f0748eb01cb5dc98), [`a8dd139`](https://github.com/mastra-ai/mastra/commit/a8dd1391a9fe9a6632c25809ef236980afa9a020), [`6a667b4`](https://github.com/mastra-ai/mastra/commit/6a667b4b7cd6a93fe41fcdd357b08c5a8c09b9ab), [`9be8878`](https://github.com/mastra-ai/mastra/commit/9be8878dcf0388e84fc4873e0eec27bd49b881a4), [`e5786be`](https://github.com/mastra-ai/mastra/commit/e5786be02bb903073082bd9d6da880ebaacc343f), [`2440e09`](https://github.com/mastra-ai/mastra/commit/2440e096ea6c2def1ccc1eb2d0f3f5b88c4af940), [`2093fbd`](https://github.com/mastra-ai/mastra/commit/2093fbd53bb744bae19ec89f6d73db9a66fbe8a7), [`a59049b`](https://github.com/mastra-ai/mastra/commit/a59049b1652a13efff66ac826326b5ed9a550342), [`7bd85ea`](https://github.com/mastra-ai/mastra/commit/7bd85ea7588b71c25ce9f4019c88f8539be5dcbc), [`83fa004`](https://github.com/mastra-ai/mastra/commit/83fa0044bfda8b703a83883dbd8bef204844d13f), [`a463cdf`](https://github.com/mastra-ai/mastra/commit/a463cdf1c95c3059e70f0bff27959e8558bb899d), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`7b4393d`](https://github.com/mastra-ai/mastra/commit/7b4393d557411fdcf07b0e30e5acaf7cc85154ae), [`0ea6b80`](https://github.com/mastra-ai/mastra/commit/0ea6b8001408ce02b56e8be0536b0fd8cbaf8ad2)]:
64
- - @mastra/core@1.58.0
65
-
66
- ## 0.3.1-alpha.0
67
-
68
- ### Patch Changes
69
-
70
- - dependencies updates: ([#20406](https://github.com/mastra-ai/mastra/pull/20406))
71
- - Updated dependency [`@aws-sdk/client-bedrock-agentcore@^3.1095.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/client-bedrock-agentcore/v/3.1095.0) (from `^3.1058.0`, in `dependencies`)
72
- - Updated dependencies [[`e7109ee`](https://github.com/mastra-ai/mastra/commit/e7109ee6f731bacc79c885906f3c7dca8d8f013a), [`772c0c8`](https://github.com/mastra-ai/mastra/commit/772c0c897cec383258de2e6178147f8014767c7b), [`578bf2e`](https://github.com/mastra-ai/mastra/commit/578bf2e6a88e9d5b8bf502204e15a95dfbb679ae), [`06b2d87`](https://github.com/mastra-ai/mastra/commit/06b2d87e63bcdd0ed59215c6789692b9b12de376), [`ac01d63`](https://github.com/mastra-ai/mastra/commit/ac01d6355974aec73fdb8781449ed12bac582094), [`a810a05`](https://github.com/mastra-ai/mastra/commit/a810a058f62ad407cfc1701e0be36ae91145d7cf), [`f8da216`](https://github.com/mastra-ai/mastra/commit/f8da21633e7eb0e31c9ce0fc30567870d19416d3), [`6104347`](https://github.com/mastra-ai/mastra/commit/61043473ba6bfd0a25156824e853e13165562e6c), [`45bfb88`](https://github.com/mastra-ai/mastra/commit/45bfb88fd52f1dd3be20e2a38905777c96499c90), [`e3b9307`](https://github.com/mastra-ai/mastra/commit/e3b9307098daefbfae2a52ae2ef51bc9fc701190), [`d6834c5`](https://github.com/mastra-ai/mastra/commit/d6834c5a7866b16734d23900163c2414ed70d791), [`c52d346`](https://github.com/mastra-ai/mastra/commit/c52d3462ec831a5d95926ecd3d3373f5928ad2e5), [`0023e79`](https://github.com/mastra-ai/mastra/commit/0023e7919431078280abd11c89d1edeae35fcc69), [`c2ad51e`](https://github.com/mastra-ai/mastra/commit/c2ad51e2467f901eecba8c9f4a45e22a50bd7c18), [`3dc97ea`](https://github.com/mastra-ai/mastra/commit/3dc97ea415fad353b48a13095fad1835933cc12a), [`3d01cd3`](https://github.com/mastra-ai/mastra/commit/3d01cd387321b6f9c5cac31d487c84bf51b19c78), [`7bf3086`](https://github.com/mastra-ai/mastra/commit/7bf308663f0115ca74ad20554ade740f06640859), [`a8dd139`](https://github.com/mastra-ai/mastra/commit/a8dd1391a9fe9a6632c25809ef236980afa9a020), [`e5786be`](https://github.com/mastra-ai/mastra/commit/e5786be02bb903073082bd9d6da880ebaacc343f), [`2093fbd`](https://github.com/mastra-ai/mastra/commit/2093fbd53bb744bae19ec89f6d73db9a66fbe8a7), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`7b4393d`](https://github.com/mastra-ai/mastra/commit/7b4393d557411fdcf07b0e30e5acaf7cc85154ae)]:
73
- - @mastra/core@1.58.0-alpha.1
74
-
75
- ## 0.3.0
76
-
77
- ### Minor Changes
78
-
79
- - Random bump ([#18178](https://github.com/mastra-ai/mastra/pull/18178))
80
-
81
- ### Patch Changes
82
-
83
- - Updated dependencies [[`7c0d868`](https://github.com/mastra-ai/mastra/commit/7c0d868d97d0fdbc04c14d0166dbf44d4c5a4a62), [`d9d2273`](https://github.com/mastra-ai/mastra/commit/d9d2273c702690c9a26eab2aebea879701d4355a), [`b04369d`](https://github.com/mastra-ai/mastra/commit/b04369d6b167c698ef103981171a8bf92808e756), [`8f3c262`](https://github.com/mastra-ai/mastra/commit/8f3c262587b335588a02d96b17fd6aca34c885b3)]:
84
- - @mastra/core@1.45.0
85
-
86
- ## 0.3.0-alpha.0
87
-
88
- ### Minor Changes
89
-
90
- - Random bump ([#18178](https://github.com/mastra-ai/mastra/pull/18178))
91
-
92
- ### Patch Changes
93
-
94
- - Updated dependencies [[`7c0d868`](https://github.com/mastra-ai/mastra/commit/7c0d868d97d0fdbc04c14d0166dbf44d4c5a4a62), [`d9d2273`](https://github.com/mastra-ai/mastra/commit/d9d2273c702690c9a26eab2aebea879701d4355a), [`b04369d`](https://github.com/mastra-ai/mastra/commit/b04369d6b167c698ef103981171a8bf92808e756), [`8f3c262`](https://github.com/mastra-ai/mastra/commit/8f3c262587b335588a02d96b17fd6aca34c885b3)]:
95
- - @mastra/core@1.45.0-alpha.0
96
-
97
- ## 0.2.4
98
-
99
- ### Patch Changes
100
-
101
- - Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
102
-
103
- - Updated dependencies [[`339c57c`](https://github.com/mastra-ai/mastra/commit/339c57c5b2c6dbe75a125e138228e0556528976f), [`1dd4117`](https://github.com/mastra-ai/mastra/commit/1dd4117dcbd8e031ede9f0489436bfbc6f0315b8), [`2b11d1f`](https://github.com/mastra-ai/mastra/commit/2b11d1f6ac7024c5dd2b2dd12a48a956ac9d63bd), [`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d), [`b7dff0a`](https://github.com/mastra-ai/mastra/commit/b7dff0a3d1022eb6868f48dc40a2b1febd5c277f), [`02087e1`](https://github.com/mastra-ai/mastra/commit/02087e1fbc54aa07f3071f7a200df1bf5be601a8), [`49af8df`](https://github.com/mastra-ai/mastra/commit/49af8df589c4ff71a5015a4553b377b32704b691), [`30ce559`](https://github.com/mastra-ai/mastra/commit/30ce55902ecf819b8ab8697398dd68b108228063), [`c241b92`](https://github.com/mastra-ai/mastra/commit/c241b929dc8c8d6a7b7219c99ed13ac1f3124a77), [`7d6ff70`](https://github.com/mastra-ai/mastra/commit/7d6ff708727297a0526ca0e26e93eeb5bbaaa187), [`ab975d4`](https://github.com/mastra-ai/mastra/commit/ab975d4dd9488752f05bda7afa03166d207e3e2a), [`9d6aa1b`](https://github.com/mastra-ai/mastra/commit/9d6aa1bae407e2afa6a089abc2a6accbbcb287b8)]:
104
- - @mastra/core@1.44.0
105
-
106
- ## 0.2.4-alpha.0
107
-
108
- ### Patch Changes
109
-
110
- - Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
111
-
112
- - Updated dependencies [[`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d)]:
113
- - @mastra/core@1.43.1-alpha.0
114
-
115
- ## 0.2.1
116
-
117
- ### Patch Changes
118
-
119
- - dependencies updates: ([#17521](https://github.com/mastra-ai/mastra/pull/17521))
120
- - Updated dependency [`@aws-sdk/client-bedrock-agentcore@^3.1057.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/client-bedrock-agentcore/v/3.1057.0) (from `^3.1045.0`, in `dependencies`)
121
-
122
- - dependencies updates: ([#17600](https://github.com/mastra-ai/mastra/pull/17600))
123
- - Updated dependency [`@aws-sdk/client-bedrock-agentcore@^3.1058.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/client-bedrock-agentcore/v/3.1058.0) (from `^3.1057.0`, in `dependencies`)
124
- - Updated dependencies [[`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`575f815`](https://github.com/mastra-ai/mastra/commit/575f815c5c3567b71c0b83cbb7fa98c8253a9d9c), [`34839c1`](https://github.com/mastra-ai/mastra/commit/34839c1910b6964bf59ed0cee58844efebbb684e), [`053735a`](https://github.com/mastra-ai/mastra/commit/053735a75c2c18e23ce34d9468007efa4a45f4c4), [`306909a`](https://github.com/mastra-ai/mastra/commit/306909a693de77d709b38706e2673c9547d24a28), [`5191af8`](https://github.com/mastra-ai/mastra/commit/5191af80c799eea25357c545fc05d91b3883531d), [`43bd3d4`](https://github.com/mastra-ai/mastra/commit/43bd3d421987463fdf35386a45199c49499ed069), [`e6fa79e`](https://github.com/mastra-ai/mastra/commit/e6fa79ec72a2ddffdd25e85270398951e9d552a4), [`904bcdf`](https://github.com/mastra-ai/mastra/commit/904bcdf7b8004aa7be823f9f70ca63580e47e470), [`7f5ee1d`](https://github.com/mastra-ai/mastra/commit/7f5ee1dca46daee8d2817f2ebe49e6335da81956), [`1e9aab5`](https://github.com/mastra-ai/mastra/commit/1e9aab50ff11e6e88fde4d7cbf512c44a9fe8d61), [`2bccba4`](https://github.com/mastra-ai/mastra/commit/2bccba4c03cadc815c2d54cbf4dd43a922140a8d), [`bf8eb6d`](https://github.com/mastra-ai/mastra/commit/bf8eb6d0ec213a403eb9265a594ad283c44ab3dc), [`e9be4e7`](https://github.com/mastra-ai/mastra/commit/e9be4e747ec3d8b65548bff92f9377db06105376), [`493a328`](https://github.com/mastra-ai/mastra/commit/493a328f4346a1deeb9f1e2e44c8f2a3a4d7591b), [`d53cfc2`](https://github.com/mastra-ai/mastra/commit/d53cfc2c7f8d78343a4aa84ec4e129ba25f3325e), [`65799d4`](https://github.com/mastra-ai/mastra/commit/65799d4d549e5ebb9c848fbe3f51ac090f64becf), [`c268c89`](https://github.com/mastra-ai/mastra/commit/c268c89f4c63a93ee474d3cffdf3ea60bf00d4f2), [`34839c1`](https://github.com/mastra-ai/mastra/commit/34839c1910b6964bf59ed0cee58844efebbb684e), [`014e00f`](https://github.com/mastra-ai/mastra/commit/014e00f2b3a597a016b72f9901c6ab27d491f822), [`029a414`](https://github.com/mastra-ai/mastra/commit/029a4141719793bd3e898a39eb5a0466a55f5f3a), [`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`b147b29`](https://github.com/mastra-ai/mastra/commit/b147b2907f0cd1aa812efe6d6e3f58d22e66fc88), [`d371ac1`](https://github.com/mastra-ai/mastra/commit/d371ac1d9820afaaf7cfdbc380a475946a994d8f), [`2bccba4`](https://github.com/mastra-ai/mastra/commit/2bccba4c03cadc815c2d54cbf4dd43a922140a8d), [`0c72f03`](https://github.com/mastra-ai/mastra/commit/0c72f032abb13254df5a7856d64be2f207b8006d), [`cf182b7`](https://github.com/mastra-ai/mastra/commit/cf182b7fb495767946d9840ef29f19cfa906f31f), [`3b45ea9`](https://github.com/mastra-ai/mastra/commit/3b45ea95015557a6cb9d70dc5252af54ab1b78ac), [`a049c2a`](https://github.com/mastra-ai/mastra/commit/a049c2a9dfb41d0ee2e7a28874a88cd64fd5669f), [`f084be1`](https://github.com/mastra-ai/mastra/commit/f084be1fcbe33ad7480913e44d6130c421c0976f), [`b147b29`](https://github.com/mastra-ai/mastra/commit/b147b2907f0cd1aa812efe6d6e3f58d22e66fc88), [`2a96528`](https://github.com/mastra-ai/mastra/commit/2a9652848dfa3c5a2426f952e9d93554c26fd90f), [`f2ab060`](https://github.com/mastra-ai/mastra/commit/f2ab060162bea81505fda553e2cee29c1979fd04), [`5d302c8`](https://github.com/mastra-ai/mastra/commit/5d302c8eda1a6ac74eab5e442c4f64db6cc97a06), [`34839c1`](https://github.com/mastra-ai/mastra/commit/34839c1910b6964bf59ed0cee58844efebbb684e), [`a952852`](https://github.com/mastra-ai/mastra/commit/a952852c971a21fb646cd907c75fcf4443cdc963), [`2656d9c`](https://github.com/mastra-ai/mastra/commit/2656d9c2976d4f3354253bfbbbf9b88a1b2bbf34), [`63e3fe1`](https://github.com/mastra-ai/mastra/commit/63e3fe13cc1ea96f91d7c68aea92f400faf9e4da), [`1d4ce8d`](https://github.com/mastra-ai/mastra/commit/1d4ce8daaa54511f325c1b609d31b8e54009d677), [`8c68372`](https://github.com/mastra-ai/mastra/commit/8c68372e85fe0b066ec12c58bd29ffb93e54c552)]:
125
- - @mastra/core@1.42.0
126
-
127
- ## 0.2.1-alpha.0
128
-
129
- ### Patch Changes
130
-
131
- - dependencies updates: ([#17521](https://github.com/mastra-ai/mastra/pull/17521))
132
- - Updated dependency [`@aws-sdk/client-bedrock-agentcore@^3.1057.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/client-bedrock-agentcore/v/3.1057.0) (from `^3.1045.0`, in `dependencies`)
133
-
134
- - dependencies updates: ([#17600](https://github.com/mastra-ai/mastra/pull/17600))
135
- - Updated dependency [`@aws-sdk/client-bedrock-agentcore@^3.1058.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/client-bedrock-agentcore/v/3.1058.0) (from `^3.1057.0`, in `dependencies`)
136
- - Updated dependencies [[`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`e9be4e7`](https://github.com/mastra-ai/mastra/commit/e9be4e747ec3d8b65548bff92f9377db06105376), [`d53cfc2`](https://github.com/mastra-ai/mastra/commit/d53cfc2c7f8d78343a4aa84ec4e129ba25f3325e), [`65799d4`](https://github.com/mastra-ai/mastra/commit/65799d4d549e5ebb9c848fbe3f51ac090f64becf), [`c268c89`](https://github.com/mastra-ai/mastra/commit/c268c89f4c63a93ee474d3cffdf3ea60bf00d4f2), [`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`0c72f03`](https://github.com/mastra-ai/mastra/commit/0c72f032abb13254df5a7856d64be2f207b8006d), [`3b45ea9`](https://github.com/mastra-ai/mastra/commit/3b45ea95015557a6cb9d70dc5252af54ab1b78ac), [`f084be1`](https://github.com/mastra-ai/mastra/commit/f084be1fcbe33ad7480913e44d6130c421c0976f)]:
137
- - @mastra/core@1.42.0-alpha.0
138
-
139
- ## 0.2.0
140
-
141
- ### Minor Changes
142
-
143
- - Added AWS Bedrock AgentCore Runtime sandbox support. ([#16642](https://github.com/mastra-ai/mastra/pull/16642))
144
-
145
- You can now run Workspace commands in AWS Bedrock AgentCore Runtime through a sandbox provider.
146
-
147
- ```ts
148
- import { AgentCoreRuntimeSandbox } from '@mastra/agentcore';
149
-
150
- const sandbox = new AgentCoreRuntimeSandbox({
151
- region: 'us-west-2',
152
- agentRuntimeArn: process.env.AGENTCORE_RUNTIME_ARN!,
153
- });
154
-
155
- const result = await sandbox.executeCommand('node', ['--version']);
156
- ```
157
-
158
- ### Patch Changes
159
-
160
- - Updated dependencies [[`fa63872`](https://github.com/mastra-ai/mastra/commit/fa6387280954e6b667bec5714b55ba082bc627ff), [`d779de3`](https://github.com/mastra-ai/mastra/commit/d779de3cd9d2e7ed8110547190e2f15e786a0e41), [`1750c97`](https://github.com/mastra-ai/mastra/commit/1750c975d6179fbf6db2813b15229d4f8f23fc55), [`9283971`](https://github.com/mastra-ai/mastra/commit/928397157009b4aef4d5fdf3a0a273cb371beb55), [`f07b646`](https://github.com/mastra-ai/mastra/commit/f07b64604ab7d25391179790b7fd4823df9e2dff), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`40f9297`](https://github.com/mastra-ai/mastra/commit/40f9297003b921c62373d3e8d3a4bda76c9f6de3), [`19a8658`](https://github.com/mastra-ai/mastra/commit/19a86589c788ef48bb6c1b0612cc82a201857379), [`850af77`](https://github.com/mastra-ai/mastra/commit/850af7779cb87c350804488734544a5b1843de25), [`0f0d1ba`](https://github.com/mastra-ai/mastra/commit/0f0d1ba67bfcb2204e571401662f1eceefc03357), [`a18775a`](https://github.com/mastra-ai/mastra/commit/a18775a693172546ee2378d39b67d4e32895b251), [`1baf2d1`](https://github.com/mastra-ai/mastra/commit/1baf2d152c6881338ff8f114633d5316fe13dd15), [`8c31bcd`](https://github.com/mastra-ai/mastra/commit/8c31bcdb00e597880d5939b1b7d7566fbe5dacae), [`0e32507`](https://github.com/mastra-ai/mastra/commit/0e32507962cdfa5569b7bda5bc6fb3dd34e40b03), [`95b14cd`](https://github.com/mastra-ai/mastra/commit/95b14cdd820e86d97ac05fe568424c513a252e31), [`07c3de7`](https://github.com/mastra-ai/mastra/commit/07c3de7f7bc418beccaea3b5e6b7f7cdda79d492), [`0bf2d93`](https://github.com/mastra-ai/mastra/commit/0bf2d932d20e2936f2d9abb8c0a86e24fbc97ec6), [`7b0d34c`](https://github.com/mastra-ai/mastra/commit/7b0d34cfe4a2fce22ac86ae17404685ff67a2ddb), [`a659a77`](https://github.com/mastra-ai/mastra/commit/a659a779bdebe3a52a518c56d2260592d0240fe0), [`aa36be2`](https://github.com/mastra-ai/mastra/commit/aa36be23aa513b7dc53cb8ca16b7fab8f20e43ad), [`3332be9`](https://github.com/mastra-ai/mastra/commit/3332be9701ecd77aba840959d9a1d1ce7aef02d3), [`212c635`](https://github.com/mastra-ai/mastra/commit/212c635203e61d036ab41db8ff86c3893dc795b3), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`9aa5a73`](https://github.com/mastra-ai/mastra/commit/9aa5a73e7e110f6e9365eec69364a33d5f03bb56), [`f73c789`](https://github.com/mastra-ai/mastra/commit/f73c789e8ef21561580395d2c410119cab5848c8), [`8bd16da`](https://github.com/mastra-ai/mastra/commit/8bd16da73a4cb874d739373643dbd6a6e7f88684), [`c8630f8`](https://github.com/mastra-ai/mastra/commit/c8630f80d4f40cb5d22e60ab162b618b1907167a), [`94dfef6`](https://github.com/mastra-ai/mastra/commit/94dfef6e2bf19a88467ea3940afcbce88a433f0f), [`47f71dc`](https://github.com/mastra-ai/mastra/commit/47f71dc6fbcbd12d71e21a979e676e20a02bd77d), [`50ceae2`](https://github.com/mastra-ai/mastra/commit/50ceae270878e2f8fb2b2c6c2faab09df0007c8a), [`a122f79`](https://github.com/mastra-ai/mastra/commit/a122f79427ae225ec79c7b2ed46278da48d04b17), [`8cdde58`](https://github.com/mastra-ai/mastra/commit/8cdde5875bbba6702d9df226f2b20232b8d75d6c), [`3a081c1`](https://github.com/mastra-ai/mastra/commit/3a081c1255c5ae8c99f6dad91cc612934ef6f2bd), [`49f8abc`](https://github.com/mastra-ai/mastra/commit/49f8abce8258e4f2f87bd326acfbdb641264a47c), [`847ff1e`](https://github.com/mastra-ai/mastra/commit/847ff1e0d94368d94b2e173e4e0908e115568ef3), [`0c1ed1d`](https://github.com/mastra-ai/mastra/commit/0c1ed1d00c7d87b5ac99ca95896211a2fa9189fa), [`259d409`](https://github.com/mastra-ai/mastra/commit/259d409a514174299dbde1ff5e1121209b3ba850), [`9e16c68`](https://github.com/mastra-ai/mastra/commit/9e16c6818b6485ccb43df28aba6f3a2219d28662), [`cefca33`](https://github.com/mastra-ai/mastra/commit/cefca33ae666e69810c935fedf95a929c173d1d7), [`d00e8c5`](https://github.com/mastra-ai/mastra/commit/d00e8c50daebe5bce5bf2f48bde39c86fc3d2fe4), [`36fa7e2`](https://github.com/mastra-ai/mastra/commit/36fa7e24d14e58a1eb46147097b32f583e5b8775), [`87e9774`](https://github.com/mastra-ai/mastra/commit/87e97741c1e493cd6d62f478eb810b49bda4d57c), [`65a72e7`](https://github.com/mastra-ai/mastra/commit/65a72e70c25eedea8ff985a6624b96be2850236b), [`fe9eacd`](https://github.com/mastra-ai/mastra/commit/fe9eacd9545a0a9d64aad31c9fa90294a425289e), [`4c02027`](https://github.com/mastra-ai/mastra/commit/4c020277235eaa6b1dc957c90ad0639eef213992), [`0f77241`](https://github.com/mastra-ai/mastra/commit/0f7724108806703799a8ba80ad0f09414afd5066), [`849efb9`](https://github.com/mastra-ai/mastra/commit/849efb9fca6dc976589c1f90a303fea618769109), [`92ff509`](https://github.com/mastra-ai/mastra/commit/92ff5098ef8a990438ca038077021a5f7541ec1d), [`3fce5e7`](https://github.com/mastra-ai/mastra/commit/3fce5e70d011d289043e75003ef3336ed4aa43c3), [`a763592`](https://github.com/mastra-ai/mastra/commit/a763592c3db46963ef1011cfe16fe372816e775e), [`db79c86`](https://github.com/mastra-ai/mastra/commit/db79c86c60723d57e02f9636ca2611bd4515f194), [`6855012`](https://github.com/mastra-ai/mastra/commit/685501247cc4717506f3e89beed03509d63a5370), [`80c7737`](https://github.com/mastra-ai/mastra/commit/80c7737e32d7917b5f356957d67c169d01744fd3), [`7fef31c`](https://github.com/mastra-ai/mastra/commit/7fef31c0d2a6d362a43a647a8a4f6ab893758a23), [`7fef31c`](https://github.com/mastra-ai/mastra/commit/7fef31c0d2a6d362a43a647a8a4f6ab893758a23), [`3f1cf47`](https://github.com/mastra-ai/mastra/commit/3f1cf476f74c1e4cc2df908837e05853a5347e31)]:
161
- - @mastra/core@1.38.0
162
-
163
- ## 0.2.0-alpha.0
164
-
165
- ### Minor Changes
166
-
167
- - Added AWS Bedrock AgentCore Runtime sandbox support. ([#16642](https://github.com/mastra-ai/mastra/pull/16642))
168
-
169
- You can now run Workspace commands in AWS Bedrock AgentCore Runtime through a sandbox provider.
170
-
171
- ```ts
172
- import { AgentCoreRuntimeSandbox } from '@mastra/agentcore';
173
-
174
- const sandbox = new AgentCoreRuntimeSandbox({
175
- region: 'us-west-2',
176
- agentRuntimeArn: process.env.AGENTCORE_RUNTIME_ARN!,
177
- });
178
-
179
- const result = await sandbox.executeCommand('node', ['--version']);
180
- ```
181
-
182
- ### Patch Changes
183
-
184
- - Updated dependencies [[`8ace89d`](https://github.com/mastra-ai/mastra/commit/8ace89df77f762e622d3b9f7f65ad7524350d050), [`fa63872`](https://github.com/mastra-ai/mastra/commit/fa6387280954e6b667bec5714b55ba082bc627ff), [`f07b646`](https://github.com/mastra-ai/mastra/commit/f07b64604ab7d25391179790b7fd4823df9e2dff), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`40f9297`](https://github.com/mastra-ai/mastra/commit/40f9297003b921c62373d3e8d3a4bda76c9f6de3), [`0f0d1ba`](https://github.com/mastra-ai/mastra/commit/0f0d1ba67bfcb2204e571401662f1eceefc03357), [`8c31bcd`](https://github.com/mastra-ai/mastra/commit/8c31bcdb00e597880d5939b1b7d7566fbe5dacae), [`95b14cd`](https://github.com/mastra-ai/mastra/commit/95b14cdd820e86d97ac05fe568424c513a252e31), [`aa36be2`](https://github.com/mastra-ai/mastra/commit/aa36be23aa513b7dc53cb8ca16b7fab8f20e43ad), [`212c635`](https://github.com/mastra-ai/mastra/commit/212c635203e61d036ab41db8ff86c3893dc795b3), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`9aa5a73`](https://github.com/mastra-ai/mastra/commit/9aa5a73e7e110f6e9365eec69364a33d5f03bb56), [`f73c789`](https://github.com/mastra-ai/mastra/commit/f73c789e8ef21561580395d2c410119cab5848c8), [`8bd16da`](https://github.com/mastra-ai/mastra/commit/8bd16da73a4cb874d739373643dbd6a6e7f88684), [`c8630f8`](https://github.com/mastra-ai/mastra/commit/c8630f80d4f40cb5d22e60ab162b618b1907167a), [`47f71dc`](https://github.com/mastra-ai/mastra/commit/47f71dc6fbcbd12d71e21a979e676e20a02bd77d), [`50ceae2`](https://github.com/mastra-ai/mastra/commit/50ceae270878e2f8fb2b2c6c2faab09df0007c8a), [`8cdde58`](https://github.com/mastra-ai/mastra/commit/8cdde5875bbba6702d9df226f2b20232b8d75d6c), [`847ff1e`](https://github.com/mastra-ai/mastra/commit/847ff1e0d94368d94b2e173e4e0908e115568ef3), [`259d409`](https://github.com/mastra-ai/mastra/commit/259d409a514174299dbde1ff5e1121209b3ba850), [`9e16c68`](https://github.com/mastra-ai/mastra/commit/9e16c6818b6485ccb43df28aba6f3a2219d28662), [`cefca33`](https://github.com/mastra-ai/mastra/commit/cefca33ae666e69810c935fedf95a929c173d1d7), [`d00e8c5`](https://github.com/mastra-ai/mastra/commit/d00e8c50daebe5bce5bf2f48bde39c86fc3d2fe4), [`36fa7e2`](https://github.com/mastra-ai/mastra/commit/36fa7e24d14e58a1eb46147097b32f583e5b8775), [`87e9774`](https://github.com/mastra-ai/mastra/commit/87e97741c1e493cd6d62f478eb810b49bda4d57c), [`65a72e7`](https://github.com/mastra-ai/mastra/commit/65a72e70c25eedea8ff985a6624b96be2850236b), [`0f77241`](https://github.com/mastra-ai/mastra/commit/0f7724108806703799a8ba80ad0f09414afd5066), [`92ff509`](https://github.com/mastra-ai/mastra/commit/92ff5098ef8a990438ca038077021a5f7541ec1d), [`3fce5e7`](https://github.com/mastra-ai/mastra/commit/3fce5e70d011d289043e75003ef3336ed4aa43c3), [`a763592`](https://github.com/mastra-ai/mastra/commit/a763592c3db46963ef1011cfe16fe372816e775e), [`80c7737`](https://github.com/mastra-ai/mastra/commit/80c7737e32d7917b5f356957d67c169d01744fd3), [`3f1cf47`](https://github.com/mastra-ai/mastra/commit/3f1cf476f74c1e4cc2df908837e05853a5347e31)]:
185
- - @mastra/core@1.38.0-alpha.3