- Add create-file-tool.ts with Zod schema and bulk file creation support
- Add create-file-functions.ts with sandbox execution and local fallback
- Support both absolute and relative file paths
- Create directories if they don't exist, overwrite existing files
- Handle errors gracefully, continue processing other files on individual failures
- Return detailed success/error results for each file operation
- Include comprehensive unit tests (18 tests, all passing)
- Export tool in index.ts following established patterns
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Move to new subdirectory structure: packages/ai/src/tools/file-tools/edit-files-tool/
- Follow exact same architectural pattern as read_files tool
- Use discriminated union output schema for results
- Implement sandbox execution with fallback to local execution
- Fix regex escaping issues in generated sandbox code
- Maintain all existing find-and-replace validation logic
- Support bulk operations with individual success/failure tracking
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Added support for reading files in a sandbox environment using @buster/sandbox.
- Introduced new file reading tool with async operations and error handling.
- Implemented integration tests for sandbox and local execution scenarios.
- Updated package.json and pnpm-lock.yaml to include new dependencies.
Co-Authored-By: [Your Name] <your.email@example.com>
- Make installationId and githubOrgId NOT NULL (required GitHub API fields)
- Change user foreign key to ON DELETE SET NULL to prevent blocking user deletion
- Add index on github_org_id for better query performance
- Maintain unique constraint on organization_id + installation_id pair
Addresses greptile-apps review comments on PR #574
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Convert file operations from sequential to parallel using Promise.all()
- Use async/await with fs.promises for better performance
- Maintain error handling and 1000-line truncation functionality
- All unit tests continue to pass (10/10)
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Updated `createChatHandler` to include a `concurrencyKey` when triggering the `analyst-agent-task`, ensuring tasks are processed sequentially per chat.
- Adjusted related test cases to verify the inclusion of the `concurrencyKey`.
- Integrated the `concurrencyKey` in the `slackAgentTask` to manage task queuing and notify users when tasks are queued.
- Introduced a new function `checkForDuplicateMessages` in the database queries to verify if a message already exists in the same chat.
- Integrated the duplicate check in the `slackAgentTask` to prevent processing of duplicate messages, enhancing task efficiency and logging warnings for duplicates detected.
- Update Rust handlers to use user_email instead of 'Unknown' fallback
- Add user_email field to MessageWithUser and ChatWithUser structs
- Update database queries to select user email field
- Update TypeScript chat-helpers to use email fallback
- Maintain final fallback to 'Unknown'/'Unknown User' if email is null
Fixes BUS-1457
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Use consistent regex for both validation and replacement
- Add reasonable upper limit (100) for bulk operations to prevent memory issues
Addresses greptile-apps bot feedback on PR #561
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Add edit_files tool in packages/ai/src/tools/file-tools/
- Implement find-and-replace with exact single occurrence validation
- Support bulk operations with individual success/failure tracking
- Handle both relative and absolute file paths
- Return detailed error messages for various failure scenarios
- Follow established patterns using createTool and wrapTraced
- Add comprehensive unit tests with 11 test cases
- Export tool in packages/ai/src/tools/index.ts
Addresses BUS-1449
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Add read_files tool in packages/ai/src/tools/file-tools
- Support both absolute and relative file paths
- Implement 1000-line truncation with indication
- Handle errors gracefully with discriminated union results
- Include comprehensive unit tests with 10/10 passing
- Export tool from main index
- Update sandbox index to export runTypescript and createSandbox
- Follow established patterns from execute-sql.ts
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>