Conversation
- Updated @ai-sdk/google-vertex from ^4.0.2 to ^4.0.3 - Updated @ai-sdk/react from ^3.0.6 to ^3.0.7 - Updated ai-sdk-provider-claude-code from ^3.0.1 to ^3.1.0 - Updated framer-motion from ^12.23.26 to ^12.24.0 - Updated motion from ^12.23.26 to ^12.24.0 - Updated react-resizable-panels from ^4.2.0 to ^4.2.1 - Updated @ai-sdk/anthropic from 3.0.2 to 3.0.3 - Added marketingCampaignWorkflow to mastra workflows - Removed memory-agent and memory-bank instruction files
- Introduced new tools for e2b sandbox functionality: - createSandbox: Create a new e2b sandbox with custom metadata and environment variables. - runCode: Execute code within an e2b sandbox, supporting multiple languages. - readFile: Read a file from the e2b sandbox. - writeFile: Write a single file to the e2b sandbox. - writeFiles: Write multiple files to the e2b sandbox. - listFiles: List files and directories in a specified path within the e2b sandbox. - deleteFile: Delete a file or directory from the e2b sandbox. - createDirectory: Create a directory in the e2b sandbox. - getFileInfo: Retrieve detailed information about a file or directory in the e2b sandbox. - checkFileExists: Check if a file or directory exists in the e2b sandbox. - getFileSize: Get the size of a file or directory in the e2b sandbox. - watchDirectory: Monitor a directory for file system changes in the e2b sandbox. - runCommand: Execute a shell command in the e2b sandbox. - Updated package.json and package-lock.json to include new dependencies: - Added "@e2b/code-interpreter": "^2.3.3".
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Reviewer's GuideAdds a new set of e2b code-interpreter-backed Mastra tools for sandboxed code execution and filesystem operations, wires a new marketing workflow into the Mastra entrypoint, updates several AI/animation/react-related dependencies, and removes obsolete GitHub memory instruction files. Sequence diagram for watchDirectory e2b sandbox tool executionsequenceDiagram
actor Caller
participant watchDirectoryTool
participant Sandbox
participant FilesAPI as FilesAPI
participant WatchHandle
Caller->>watchDirectoryTool: execute(inputData)
activate watchDirectoryTool
watchDirectoryTool->>Sandbox: connect(inputData.sandboxId)
activate Sandbox
Sandbox-->>watchDirectoryTool: sandbox
deactivate Sandbox
watchDirectoryTool->>FilesAPI: watchDir(inputData.path, onEvent, {recursive})
activate FilesAPI
FilesAPI-->>watchDirectoryTool: WatchHandle
deactivate FilesAPI
loop watchDuration
FilesAPI-->>watchDirectoryTool: onEvent(event)
watchDirectoryTool->>watchDirectoryTool: push event to events array
end
watchDirectoryTool->>WatchHandle: stop()
activate WatchHandle
WatchHandle-->>watchDirectoryTool: stopped
deactivate WatchHandle
watchDirectoryTool-->>Caller: {watchStarted, path, events}
deactivate watchDirectoryTool
Class diagram for new e2b sandbox tools integrationclassDiagram
class MastraTool {
+id string
+description string
+inputSchema ZodSchema
+outputSchema ZodSchema
+execute(input any) Promise~any~
}
class Sandbox {
+string sandboxId
+static create(options any) Promise~Sandbox~
+static connect(sandboxId string) Promise~Sandbox~
+runCode(code string, runCodeOpts any) Promise~Execution~
+files FilesAPI
+commands CommandsAPI
}
class FilesAPI {
+read(path string) Promise~string~
+write(path string, content any) Promise~void~
+list(path string) Promise~FileInfo[]~
+remove(path string) Promise~void~
+makeDir(path string) Promise~void~
+getInfo(path string) Promise~FileInfo~
+watchDir(path string, onEvent FilesystemCallback, options any) Promise~WatchHandle~
}
class CommandsAPI {
+run(command string, options any) Promise~CommandResult~
}
class FileInfo {
+string name
+FileType type
+string path
+number size
+number mode
+string permissions
+string owner
+string group
+Date modifiedTime
+string symlinkTarget
}
class WatchHandle {
+stop() Promise~void~
}
class Execution {
+toJSON() any
}
class CommandResult {
+number exitCode
+string stdout
+string stderr
}
class createSandboxTool {
+execute(sandboxOptions any) Promise~CreateSandboxOutput~
}
class runCodeTool {
+execute(inputData any) Promise~RunCodeOutput~
}
class readFileTool {
+execute(inputData any) Promise~ReadFileOutput~
}
class writeFileTool {
+execute(inputData any) Promise~WriteFileOutput~
}
class writeFilesTool {
+execute(inputData any) Promise~WriteFilesOutput~
}
class listFilesTool {
+execute(inputData any) Promise~ListFilesOutput~
}
class deleteFileTool {
+execute(inputData any) Promise~DeleteFileOutput~
}
class createDirectoryTool {
+execute(inputData any) Promise~CreateDirectoryOutput~
}
class getFileInfoTool {
+execute(inputData any) Promise~GetFileInfoOutput~
}
class checkFileExistsTool {
+execute(inputData any) Promise~CheckFileExistsOutput~
}
class getFileSizeTool {
+execute(inputData any) Promise~GetFileSizeOutput~
}
class watchDirectoryTool {
+execute(inputData any) Promise~WatchDirectoryOutput~
}
class runCommandTool {
+execute(inputData any) Promise~RunCommandOutput~
}
MastraTool <|-- createSandboxTool
MastraTool <|-- runCodeTool
MastraTool <|-- readFileTool
MastraTool <|-- writeFileTool
MastraTool <|-- writeFilesTool
MastraTool <|-- listFilesTool
MastraTool <|-- deleteFileTool
MastraTool <|-- createDirectoryTool
MastraTool <|-- getFileInfoTool
MastraTool <|-- checkFileExistsTool
MastraTool <|-- getFileSizeTool
MastraTool <|-- watchDirectoryTool
MastraTool <|-- runCommandTool
createSandboxTool --> Sandbox : create()
runCodeTool --> Sandbox : connect()
readFileTool --> Sandbox : connect()
writeFileTool --> Sandbox : connect()
writeFilesTool --> Sandbox : connect()
listFilesTool --> Sandbox : connect()
deleteFileTool --> Sandbox : connect()
createDirectoryTool --> Sandbox : connect()
getFileInfoTool --> Sandbox : connect()
checkFileExistsTool --> Sandbox : connect()
getFileSizeTool --> Sandbox : connect()
watchDirectoryTool --> Sandbox : connect()
runCommandTool --> Sandbox : connect()
Sandbox --> FilesAPI : files
Sandbox --> CommandsAPI : commands
FilesAPI --> FileInfo
FilesAPI --> WatchHandle
Sandbox --> Execution
CommandsAPI --> CommandResult
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
🤖 Hi @ssdeanx, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
Caution Review failedThe pull request is closed. Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThis PR removes two documentation files related to memory management infrastructure, updates package dependencies including a new E2B code interpreter integration, registers a marketing campaign workflow in the Mastra instance, and introduces a comprehensive E2B sandbox toolset with 13 operations for sandbox lifecycle and filesystem management. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @ssdeanx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant enhancements to the AI agent system by integrating the E2B Code Interpreter, allowing agents to dynamically execute code and shell commands within isolated sandboxes. This change is accompanied by the removal of a static, documentation-based memory system, signaling a strategic pivot towards a more interactive and code-driven approach for agent intelligence and task management. Additionally, a new workflow has been added, and various project dependencies have been updated to ensure the system remains current. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Hey - I've found 4 issues, and left some high level feedback:
- The import
import { marketingCampaignWorkflow } from './workflows'insrc/mastra/index.tslooks incorrect and likely needs a more specific path (e.g. the actual workflow file) to avoid runtime import failures. - In
src/mastra/tools/e2b.ts, schemas likez.enum(FileType)andz.enum(FilesystemEventType)are probably invalid becausez.enumexpects string literals; consider usingz.nativeEnum(...)or explicit string unions that match the enum values. - The repeated error-wrapping (
const errObj = ...; throw new Error(JSON.stringify(errObj));) across all tools ine2b.tscould be refactored into a small helper to reduce duplication and keep the tools’ execute functions more focused.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The import `import { marketingCampaignWorkflow } from './workflows'` in `src/mastra/index.ts` looks incorrect and likely needs a more specific path (e.g. the actual workflow file) to avoid runtime import failures.
- In `src/mastra/tools/e2b.ts`, schemas like `z.enum(FileType)` and `z.enum(FilesystemEventType)` are probably invalid because `z.enum` expects string literals; consider using `z.nativeEnum(...)` or explicit string unions that match the enum values.
- The repeated error-wrapping (`const errObj = ...; throw new Error(JSON.stringify(errObj));`) across all tools in `e2b.ts` could be refactored into a small helper to reduce duplication and keep the tools’ execute functions more focused.
## Individual Comments
### Comment 1
<location> `src/mastra/tools/e2b.ts:273` </location>
<code_context>
+ }),
+ outputSchema: z.object({
+ name: z.string().describe('The name of the file or directory'),
+ type: z.enum(FileType).optional().describe('Whether this is a file or directory'),
+ path: z.string().describe('The full path of the file or directory'),
+ size: z.number().describe('The size of the file or directory in bytes'),
</code_context>
<issue_to_address>
**issue (bug_risk):** Use `z.nativeEnum` (or string literals) instead of passing the enum type directly to `z.enum`.
`z.enum` requires an array of string literals, not the enum object. Here this should be `z.nativeEnum(FileType)` or `z.enum(['FILE', 'DIR', ...] as const)`, and the same adjustment is needed in `checkFileExists` and `getFileSize` where `z.enum(FileType)` is currently used.
</issue_to_address>
### Comment 2
<location> `src/mastra/tools/e2b.ts:280` </location>
<code_context>
+ permissions: z.string().describe('Human-readable permissions string'),
+ owner: z.string().describe('The owner of the file or directory'),
+ group: z.string().describe('The group of the file or directory'),
+ modifiedTime: z.date().optional().describe('The last modified time in ISO string format'),
+ symlinkTarget: z.string().optional().describe('The target path if this is a symlink, null otherwise'),
+ }),
</code_context>
<issue_to_address>
**issue (bug_risk):** `modifiedTime` is typed as `Date` but described as an ISO string, which is inconsistent with the likely runtime value.
The schema currently uses `z.date()` while the description implies an ISO string, and many APIs return timestamps as strings. If `info.modifiedTime` is a string, validation will fail; if it’s a `Date`, the description is inaccurate. Please either switch to `z.string()` for ISO timestamps or ensure the value is converted with `new Date(...)` before validation/return.
</issue_to_address>
### Comment 3
<location> `src/mastra/tools/e2b.ts:314-20` </location>
<code_context>
+ sandboxId: z.string().describe('The sandboxId for the sandbox to check file existence in'),
+ path: z.string().describe('The path to check for existence'),
+ }),
+ outputSchema: z
+ .object({
+ exists: z.boolean().describe('Whether the file or directory exists'),
+ path: z.string().describe('The path that was checked'),
+ type: z.enum(FileType).optional().describe('The type if the path exists'),
+ })
+ .or(
+ z.object({
+ error: z.string().describe('The error from a failed existence check'),
+ }),
+ ),
+ execute: async (inputData) => {
</code_context>
<issue_to_address>
**suggestion:** The union branch with `{ error: string }` is never returned because errors are rethrown, making the schema misleading.
In `getFileSize`, `checkFileExists`, and `watchDirectory`, the `outputSchema` is a union of a success object and `{ error: string }`, but the outer `try` block wraps failures into thrown exceptions instead. Since `{ error: string }` is never actually returned, please either return that shape on failure instead of throwing, or remove the error branch from the schema so it reflects the real behavior.
</issue_to_address>
### Comment 4
<location> `src/mastra/tools/e2b.ts:484` </location>
<code_context>
+ command: z.string().describe('The shell command to execute'),
+ workingDirectory: z.string().optional().describe('The working directory to run the command in'),
+ timeoutMs: z.number().default(30000).describe('Timeout for the command execution in milliseconds'),
+ captureOutput: z.boolean().default(true).describe('Whether to capture stdout and stderr output'),
+ }),
+ outputSchema: z.object({
</code_context>
<issue_to_address>
**suggestion:** `captureOutput` option is defined but never used in `runCommand` execution logic.
In `runCommand.execute`, `stdout` and `stderr` are always captured and returned, so `captureOutput` currently has no effect. Please either connect this flag to the underlying `sandbox.commands.run` behavior (if available) or remove it from the schema to avoid a misleading, no-op option.
Suggested implementation:
```typescript
inputSchema: z.object({
sandboxId: z.string().describe('The sandboxId for the sandbox to run the command in'),
command: z.string().describe('The shell command to execute'),
workingDirectory: z.string().optional().describe('The working directory to run the command in'),
timeoutMs: z.number().default(30000).describe('Timeout for the command execution in milliseconds'),
```
1. Remove any `captureOutput` property from the `runCommand` `inputSchema` object if it appears elsewhere in this file (e.g., if the snippet you shared was truncated before the `captureOutput` line).
2. If `captureOutput` is currently destructured or referenced in `runCommand.execute` or in any type definitions derived from `inputSchema`, remove those references as well.
3. If there is public documentation or type exports describing `captureOutput` for `runCommand`, update them to reflect that this option is no longer available.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| }), | ||
| outputSchema: z.object({ | ||
| name: z.string().describe('The name of the file or directory'), | ||
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), |
There was a problem hiding this comment.
issue (bug_risk): Use z.nativeEnum (or string literals) instead of passing the enum type directly to z.enum.
z.enum requires an array of string literals, not the enum object. Here this should be z.nativeEnum(FileType) or z.enum(['FILE', 'DIR', ...] as const), and the same adjustment is needed in checkFileExists and getFileSize where z.enum(FileType) is currently used.
| permissions: z.string().describe('Human-readable permissions string'), | ||
| owner: z.string().describe('The owner of the file or directory'), | ||
| group: z.string().describe('The group of the file or directory'), | ||
| modifiedTime: z.date().optional().describe('The last modified time in ISO string format'), |
There was a problem hiding this comment.
issue (bug_risk): modifiedTime is typed as Date but described as an ISO string, which is inconsistent with the likely runtime value.
The schema currently uses z.date() while the description implies an ISO string, and many APIs return timestamps as strings. If info.modifiedTime is a string, validation will fail; if it’s a Date, the description is inaccurate. Please either switch to z.string() for ISO timestamps or ensure the value is converted with new Date(...) before validation/return.
| command: z.string().describe('The shell command to execute'), | ||
| workingDirectory: z.string().optional().describe('The working directory to run the command in'), | ||
| timeoutMs: z.number().default(30000).describe('Timeout for the command execution in milliseconds'), | ||
| captureOutput: z.boolean().default(true).describe('Whether to capture stdout and stderr output'), |
There was a problem hiding this comment.
suggestion: captureOutput option is defined but never used in runCommand execution logic.
In runCommand.execute, stdout and stderr are always captured and returned, so captureOutput currently has no effect. Please either connect this flag to the underlying sandbox.commands.run behavior (if available) or remove it from the schema to avoid a misleading, no-op option.
Suggested implementation:
inputSchema: z.object({
sandboxId: z.string().describe('The sandboxId for the sandbox to run the command in'),
command: z.string().describe('The shell command to execute'),
workingDirectory: z.string().optional().describe('The working directory to run the command in'),
timeoutMs: z.number().default(30000).describe('Timeout for the command execution in milliseconds'),- Remove any
captureOutputproperty from therunCommandinputSchemaobject if it appears elsewhere in this file (e.g., if the snippet you shared was truncated before thecaptureOutputline). - If
captureOutputis currently destructured or referenced inrunCommand.executeor in any type definitions derived frominputSchema, remove those references as well. - If there is public documentation or type exports describing
captureOutputforrunCommand, update them to reflect that this option is no longer available.
|
🤖 I'm sorry @ssdeanx, but I was unable to process your request. Please see the logs for more details. |
There was a problem hiding this comment.
Code Review
This pull request successfully integrates a comprehensive suite of e2b-powered sandbox tools, updates several dependencies to their latest patch or minor versions, and registers a new marketing campaign workflow. The new e2b tools are well-structured with clear input and output schemas, and consistent error handling. The dependency updates are routine and contribute to improved compatibility and maintenance. The removal of obsolete GitHub instruction files is a good cleanup step.
| command: z.string().describe('The shell command to execute'), | ||
| workingDirectory: z.string().optional().describe('The working directory to run the command in'), | ||
| timeoutMs: z.number().default(30000).describe('Timeout for the command execution in milliseconds'), | ||
| captureOutput: z.boolean().default(true).describe('Whether to capture stdout and stderr output'), |
There was a problem hiding this comment.
The captureOutput parameter is defined in the runCommand tool's input schema but is not used within the execute function. The e2b SDK's commands.run method captures stdout and stderr by default, making this parameter redundant and potentially misleading for users who might expect to control this behavior. Consider removing it if it doesn't offer additional functionality or implementing its control if the SDK supports it.
There was a problem hiding this comment.
Pull request overview
This pull request adds E2B sandbox integration tools to the Mastra framework. The PR introduces a comprehensive set of tools for managing and interacting with E2B sandboxes, including code execution, file system operations, and command execution capabilities.
Key Changes
- Added new E2B integration tools with 13 distinct tool functions covering sandbox creation, code execution, file operations, and directory monitoring
- Updated package dependencies to include @e2b/code-interpreter and several minor version bumps
- Removed internal GitHub instruction documentation files for memory bank and memory agent
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 21 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mastra/tools/e2b.ts | New file implementing 13 E2B sandbox tools including createSandbox, runCode, file operations (read/write/delete/list), directory operations, and command execution with comprehensive Zod schemas |
| src/mastra/index.ts | Added import for marketingCampaignWorkflow from workflows module |
| package.json | Updated dependencies: @ai-sdk/google-vertex (4.0.3), @ai-sdk/react (3.0.7), added @e2b/code-interpreter (2.3.3), and minor version bumps for ai-sdk-provider-claude-code, framer-motion, motion, and react-resizable-panels |
| package-lock.json | Lockfile updates reflecting the dependency changes in package.json, including new transitive dependencies for @e2b/code-interpreter |
| .github/-/memory-bank.instructions.md | Removed internal memory bank instruction documentation |
| .github/-/memory-agent.instruction.md | Removed internal memory agent instruction documentation |
| outputSchema: z.object({ | ||
| content: z.string().describe('The content of the file'), | ||
| path: z.string().describe('The path of the file that was read'), | ||
| }), |
There was a problem hiding this comment.
Inconsistent indentation detected in the outputSchema object. The object properties should align with the opening brace, similar to how inputSchema is formatted.
| outputSchema: z.object({ | ||
| success: z.boolean().describe('Whether the file was written successfully'), | ||
| path: z.string().describe('The path where the file was written'), | ||
| }), |
There was a problem hiding this comment.
Inconsistent indentation detected in the outputSchema object. The object properties should align with the opening brace, similar to how inputSchema is formatted.
| const errObj = e instanceof Error ? { message: e.message, stack: e.stack } : { message: String(e) }; | ||
| throw new Error(JSON.stringify(errObj)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Missing trailing comma after the closing brace of the execute function. This is inconsistent with the pattern used in other tool exports in this file.
| } | |
| }, |
| .object({ | ||
| exists: z.boolean().describe('Whether the file or directory exists'), | ||
| path: z.string().describe('The path that was checked'), | ||
| type: z.enum(FileType).optional().describe('The type if the path exists'), |
There was a problem hiding this comment.
Using z.enum with an object instead of an array of string literals. The z.enum() function expects an array of strings like z.enum(['FILE', 'DIR']), not an object type. This will cause a runtime error. Consider using z.nativeEnum() instead if FileType is a TypeScript enum, or define the allowed values as a string array.
| type: z.enum(FileType).optional().describe('The type if the path exists'), | |
| type: z.nativeEnum(FileType).optional().describe('The type if the path exists'), |
| size: z.number().describe('The size in bytes'), | ||
| humanReadableSize: z.string().optional().describe('Human-readable size string if requested'), | ||
| path: z.string().describe('The path that was checked'), | ||
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), |
There was a problem hiding this comment.
Using z.enum with an object instead of an array of string literals. The z.enum() function expects an array of strings like z.enum(['FILE', 'DIR']), not an object type. This will cause a runtime error. Consider using z.nativeEnum() instead if FileType is a TypeScript enum, or define the allowed values as a string array.
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), | |
| type: z.nativeEnum(FileType).optional().describe('Whether this is a file or directory'), |
| .array( | ||
| z.object({ | ||
| type: z | ||
| .enum(FilesystemEventType) |
There was a problem hiding this comment.
Using z.enum with an object instead of an array of string literals. The z.enum() function expects an array of strings like z.enum(['WRITE', 'CREATE', 'DELETE']), not an object type. This will cause a runtime error. Consider using z.nativeEnum() instead if FilesystemEventType is a TypeScript enum, or define the allowed values as a string array.
| .enum(FilesystemEventType) | |
| .nativeEnum(FilesystemEventType) |
| outputSchema: z | ||
| .object({ | ||
| watchStarted: z.boolean().describe('Whether the watch was started successfully'), | ||
| path: z.string().describe('The path that was watched'), | ||
| events: z | ||
| .array( | ||
| z.object({ | ||
| type: z | ||
| .enum(FilesystemEventType) | ||
| .describe('The type of filesystem event (WRITE, CREATE, DELETE, etc.)'), | ||
| name: z.string().describe('The name of the file that changed'), | ||
| timestamp: z.string().describe('When the event occurred'), | ||
| }), | ||
| ) | ||
| .describe('Array of filesystem events that occurred during the watch period'), | ||
| }) | ||
| .or( | ||
| z.object({ | ||
| error: z.string().describe('The error from a failed directory watch'), | ||
| }), | ||
| ), |
There was a problem hiding this comment.
The outputSchema uses .or() to define an error alternative, but the error field is never returned in the execute function. The outer catch block throws an error rather than returning an object with an error field, making this error schema unreachable. Either remove the error alternative from the schema or modify the error handling to return this format instead of throwing.
| outputSchema: z | |
| .object({ | |
| watchStarted: z.boolean().describe('Whether the watch was started successfully'), | |
| path: z.string().describe('The path that was watched'), | |
| events: z | |
| .array( | |
| z.object({ | |
| type: z | |
| .enum(FilesystemEventType) | |
| .describe('The type of filesystem event (WRITE, CREATE, DELETE, etc.)'), | |
| name: z.string().describe('The name of the file that changed'), | |
| timestamp: z.string().describe('When the event occurred'), | |
| }), | |
| ) | |
| .describe('Array of filesystem events that occurred during the watch period'), | |
| }) | |
| .or( | |
| z.object({ | |
| error: z.string().describe('The error from a failed directory watch'), | |
| }), | |
| ), | |
| outputSchema: z.object({ | |
| watchStarted: z.boolean().describe('Whether the watch was started successfully'), | |
| path: z.string().describe('The path that was watched'), | |
| events: z | |
| .array( | |
| z.object({ | |
| type: z | |
| .enum(FilesystemEventType) | |
| .describe('The type of filesystem event (WRITE, CREATE, DELETE, etc.)'), | |
| name: z.string().describe('The name of the file that changed'), | |
| timestamp: z.string().describe('When the event occurred'), | |
| }), | |
| ) | |
| .describe('Array of filesystem events that occurred during the watch period'), | |
| }), |
| outputSchema: z.object({ | ||
| success: z.boolean().describe('Whether the file was deleted successfully'), | ||
| path: z.string().describe('The path that was deleted'), | ||
| }), |
There was a problem hiding this comment.
Inconsistent indentation detected in the outputSchema object. The object properties should align with the opening brace, similar to how inputSchema is formatted.
| }), | ||
| outputSchema: z.object({ | ||
| name: z.string().describe('The name of the file or directory'), | ||
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), |
There was a problem hiding this comment.
Using z.enum with an object instead of an array of string literals. The z.enum() function expects an array of strings like z.enum(['FILE', 'DIR']), not an object type. This will cause a runtime error. Consider using z.nativeEnum() instead if FileType is a TypeScript enum, or define the allowed values as a string array.
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), | |
| type: z.nativeEnum(FileType).optional().describe('Whether this is a file or directory'), |
| outputSchema: z | ||
| .object({ | ||
| size: z.number().describe('The size in bytes'), | ||
| humanReadableSize: z.string().optional().describe('Human-readable size string if requested'), | ||
| path: z.string().describe('The path that was checked'), | ||
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), | ||
| }) | ||
| .or( | ||
| z.object({ | ||
| error: z.string().describe('The error from a failed size check'), | ||
| }), | ||
| ), |
There was a problem hiding this comment.
The outputSchema uses .or() to define an error alternative, but the error field is never returned in the execute function. The outer catch block throws an error rather than returning an object with an error field, making this error schema unreachable. Either remove the error alternative from the schema or modify the error handling to return this format instead of throwing.
| outputSchema: z | |
| .object({ | |
| size: z.number().describe('The size in bytes'), | |
| humanReadableSize: z.string().optional().describe('Human-readable size string if requested'), | |
| path: z.string().describe('The path that was checked'), | |
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), | |
| }) | |
| .or( | |
| z.object({ | |
| error: z.string().describe('The error from a failed size check'), | |
| }), | |
| ), | |
| outputSchema: z.object({ | |
| size: z.number().describe('The size in bytes'), | |
| humanReadableSize: z.string().optional().describe('Human-readable size string if requested'), | |
| path: z.string().describe('The path that was checked'), | |
| type: z.enum(FileType).optional().describe('Whether this is a file or directory'), | |
| }), |

Summary by Sourcery
Integrate an e2b-powered sandbox tool suite into the Mastra workflows and register a new marketing campaign workflow while updating related dependencies and cleaning up unused GitHub instruction files.
New Features:
Enhancements:
Chores: