Commit Graph

356 Commits

Author SHA1 Message Date
dependabot[bot]
d97e92e714 chore(deps-dev): bump eslint-plugin-prettier in /frontend (#2980)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.1.3 to 5.2.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.1.3...v5.2.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-17 23:14:51 +08:00
sp.wack
2c02ab9586 Refactor and extend, and pass tests (#2976) 2024-07-17 17:08:05 +03:00
sp.wack
a2ec1ded26 Remove unused framer motion package (#2973) 2024-07-16 16:33:05 +00:00
dependabot[bot]
dc45b14720 chore(deps-dev): bump @typescript-eslint/eslint-plugin in /frontend (#2970)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.16.0 to 7.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.16.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 16:20:10 +00:00
sp.wack
4b6a2ff3c4 Remove unused react router package (#2972) 2024-07-16 15:55:05 +00:00
dependabot[bot]
f5a4fb80a3 chore(deps-dev): bump tailwindcss from 3.4.4 to 3.4.5 in /frontend (#2971)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.4.4 to 3.4.5.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.5/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.4...v3.4.5)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 15:41:18 +00:00
dependabot[bot]
59d05f3934 chore(deps-dev): bump @typescript-eslint/parser in /frontend (#2969)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.16.0 to 7.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.16.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 15:39:00 +00:00
dependabot[bot]
29483c0620 chore(deps): bump vite from 5.3.3 to 5.3.4 in /frontend (#2967)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.3.3 to 5.3.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.3.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 15:28:56 +00:00
dependabot[bot]
42abc727d7 chore(deps): bump react-i18next from 14.1.2 to 14.1.3 in /frontend (#2965)
Bumps [react-i18next](https://github.com/i18next/react-i18next) from 14.1.2 to 14.1.3.
- [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/react-i18next/compare/v14.1.2...v14.1.3)

---
updated-dependencies:
- dependency-name: react-i18next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 15:27:33 +00:00
sp.wack
1fd2e511f8 refactor: Frontend tests (#2959)
* Refactor and clean

* Refactor, cleanup, and pass skipped test

* Refactor

* Refactor and cleanup

* Cleanup

* Refactor and cleanup

* Remove unused mock

* Refactor and cleanup

* Refactor

* Remove unused hooks

* Refactor
2024-07-16 11:14:00 +03:00
dependabot[bot]
cf531518a5 chore(deps): bump i18next from 23.11.5 to 23.12.1 in /frontend (#2939)
Bumps [i18next](https://github.com/i18next/i18next) from 23.11.5 to 23.12.1.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v23.11.5...v23.12.1)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2024-07-15 18:27:16 +00:00
dependabot[bot]
8ea66a82c8 chore(deps-dev): bump eslint-plugin-react in /frontend (#2940) 2024-07-16 00:51:23 +08:00
dependabot[bot]
653a3c0f11 chore(deps-dev): bump prettier from 3.3.2 to 3.3.3 in /frontend (#2938) 2024-07-16 00:50:02 +08:00
Xingyao Wang
e45ddeb2a2 arch: deprecating recall action and search_memory (#2900)
* deprecating recall action

* fix integration tests

* fix integration tests

* remove search memory
2024-07-12 19:23:21 +00:00
மனோஜ்குமார் பழனிச்சாமி
43c3e904b7 Restore last mute setting (#2895) 2024-07-11 16:48:04 +00:00
dependabot[bot]
e793ca2261 chore(deps): bump framer-motion from 11.3.0 to 11.3.2 in /frontend (#2890) 2024-07-11 23:19:52 +08:00
adragos
5f61885e44 feat: Implement user confirmation mode, request confirmation when running bash/python code in this mode (#2774)
* [feat] confirmation mode for bash actions

* feat: Add modal setting for Confirmation Mode

* fix: frontend tests for confirmation mode switch

* fix: add missing CONFIRMATION_MODE value in SettingsModal.test.tsx

* fix: update test to integrate new setting

* feat: Implement user confirmation for running bash/python code

* fix: don't display rejected actions

* fix: linting, rename/refactor based on feedback

* fix: add property only to commands, pass serialization tests

* fix: package-lock.json, lint test_action_serialization.py

* test: add is_confirmed to integration test outputs

---------

Co-authored-by: Mislav Balunovic <mislav.balunovic@gmail.com>
2024-07-11 14:57:21 +03:00
dependabot[bot]
50f07aea44 chore(deps): bump framer-motion from 11.2.14 to 11.3.0 in /frontend (#2880) 2024-07-11 00:03:22 +08:00
dependabot[bot]
de47d8eecc chore(deps-dev): bump @typescript-eslint/eslint-plugin in /frontend (#2872) 2024-07-09 16:42:22 +00:00
dependabot[bot]
fbced43ff3 chore(deps): bump framer-motion from 11.2.13 to 11.2.14 in /frontend (#2871) 2024-07-10 00:07:12 +08:00
dependabot[bot]
46b853e1b4 chore(deps-dev): bump @typescript-eslint/parser in /frontend (#2873) 2024-07-10 00:06:36 +08:00
dependabot[bot]
648597c4f7 chore(deps-dev): bump @types/node from 20.14.9 to 20.14.10 in /frontend (#2852)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.9 to 20.14.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 14:49:49 +00:00
dependabot[bot]
ff701f99e6 chore(deps): bump tailwind-merge from 2.3.0 to 2.4.0 in /frontend (#2851)
Bumps [tailwind-merge](https://github.com/dcastil/tailwind-merge) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: tailwind-merge
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 14:49:39 +00:00
Leo
9b0ff117ab CI: Support uploading frontend unit test coverage. (#2772)
* CI: Support uploading frontend unit test coverage.

* Add make-i18n before test.

* Update vitest configuration to include only .ts and .tsx files in coverage.

* remove .only in test and fix the failed tests.

* Add text summary.

* Move vite-tsconfig-paths to dev dep. Adjust UTs.

---------

Signed-off-by: ifuryst <ifuryst@gmail.com>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2024-07-06 12:16:30 +08:00
Xingyao Wang
a47713ecb0 [Arch] Remove supports for Background Commands (#2803)
* depracting docker exec box

* remove doc exec from workflow and docs

* remove background commands

* Update tests/unit/test_sandbox.py

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>

* replace for-loop with assignment

* fix integration tests

* fix integration tests for shell script

* fix integration tests

* increase max iter to fix some monologue agent issue

* fix integration test again

* fix integration tests (seems related to run_user issue)

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2024-07-06 03:38:05 +08:00
dependabot[bot]
6853cbb4f6 chore(deps): bump framer-motion from 11.2.12 to 11.2.13 in /frontend (#2793)
Bumps [framer-motion](https://github.com/framer/motion) from 11.2.12 to 11.2.13.
- [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/framer/motion/compare/v11.2.12...v11.2.13)

---
updated-dependencies:
- dependency-name: framer-motion
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 23:41:47 +08:00
dependabot[bot]
82ed0a07cb chore(deps): bump jose from 5.6.2 to 5.6.3 in /frontend (#2766) 2024-07-04 13:28:35 +08:00
dependabot[bot]
81226e63e9 chore(deps): bump vite from 5.3.2 to 5.3.3 in /frontend (#2767) 2024-07-04 13:28:25 +08:00
dependabot[bot]
8b01d16926 chore(deps): bump react-router-dom from 6.24.0 to 6.24.1 in /frontend (#2768) 2024-07-04 13:28:13 +08:00
Leo
b60a696296 Fix the FE failed unit test. (#2773)
Signed-off-by: ifuryst <ifuryst@gmail.com>
2024-07-03 15:52:51 +00:00
dependabot[bot]
f293b33856 chore(deps-dev): bump @typescript-eslint/eslint-plugin in /frontend (#2742)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.14.1 to 7.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.15.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 16:08:09 +00:00
dependabot[bot]
52ab4b4f18 chore(deps-dev): bump @typescript-eslint/parser in /frontend (#2743)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.14.1 to 7.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.15.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 23:35:13 +08:00
dependabot[bot]
4489c40106 chore(deps-dev): bump typescript from 5.5.2 to 5.5.3 in /frontend (#2741)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.5.2 to 5.5.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.2...v5.5.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 23:33:34 +08:00
r.e.e.c.h.e.e
0689eef844 Fix: Add scroll functionality to file explorer sidepane (#2731)
* Fix: Add scroll and resize functionalities to file explorer

* fix: the icon missing from filename and tree scroll
2024-07-02 12:14:12 +00:00
PierrunoYT
bfa1de4a6b Refactor: Enhance file handling and code editing functionality (#2646)
* refactor: Enhance file handling and code editing functionality

# PR Summary
**refactor: Enhance file handling and code editing functionality**

## PR Description

This pull request includes improvements to file handling, error management, and code editing functionality across multiple files. The changes enhance the robustness, security, and user experience of the application.

### Changes in `listen.py`

1. **Imports and Error Handling**:
   - Removed `warnings` import and its usage with `litellm`.
   - More consistent use of `JSONResponse` and `HTTPException` for error handling.

2. **WebSocket Endpoint (`/ws`)**:
   - Simplified logic for handling events using a single `isinstance` check.

3. **New Endpoint**:
   - Added `/api/save-file` POST endpoint for saving file contents.
   - Implemented checks for agent state before allowing file edits.

4. **Code Style and Organization**:
   - Improved code formatting and organization.
   - Refactored some functions for better readability and consistency.

### Changes in `fileService.ts`

1. **Error Handling**:
   - Added try-catch blocks to all functions for better error handling and logging.

2. **Input Sanitization**:
   - Implemented `encodeURIComponent()` for file names and paths in API requests.

3. **Type Checking**:
   - Added type checks for API responses to ensure data format consistency.

4. **File Upload Improvement**:
   - Refactored `uploadFiles()` to use `Array.from(files)` instead of a for loop.

5. **New Functionality**:
   - Added `saveFile()` function to allow saving file content to a specified path.

### Changes in `CodeEditor.tsx`

1. **New Dependencies**:
   - Added imports for state management, UI components, and file operations.

2. **State Management**:
   - Introduced new state variables for tracking save status and last saved time.
   - Implemented Redux state management for code and agent state.

3. **UI Enhancements**:
   - Added a save button with dynamic colors based on save status.
   - Implemented a save notification system.
   - Added a "Last saved" timestamp display.

4. **File Saving Functionality**:
   - Implemented complete file saving feature with error handling and user feedback.

5. **Code Structure**:
   - Improved structure with additional hooks and memoized values for optimization.

### Testing Performed
- Manually tested new file saving functionality.
- Verified error handling and user feedback mechanisms.
- Checked integration between backend (`listen.py`) and frontend (`fileService.ts`, `CodeEditor.tsx`).

### Next Steps
- Conduct thorough testing of the file saving feature across different scenarios.
- Update documentation to reflect new file handling capabilities.
- Consider adding unit tests for new functions and components.

* Added Docstrings back

Added Docstrings back

* Fix

# Allow Code Editing in AWAITING_USER_INPUT State

## Description
This pull request extends the functionality of the code editor to allow editing when the agent is in the AWAITING_USER_INPUT state, in addition to the existing PAUSED and FINISHED states.

## Changes
1. Backend (`listen.py`):
   - Updated the `save_file` function to allow saving when the agent state is AWAITING_USER_INPUT.

2. Frontend (`CodeEditor.tsx`):
   - Modified the `isEditingAllowed` condition to include the AWAITING_USER_INPUT state.

## Files Changed
- `listen.py`
- `CodeEditor.tsx`

## Testing
- Verified that the save button appears when the agent is in the AWAITING_USER_INPUT state.
- Tested saving files in all three allowed states (PAUSED, FINISHED, AWAITING_USER_INPUT).
- Ensured that saving is still prohibited in other agent states.

## Additional Notes
This change improves the user experience by allowing code edits while the agent is waiting for user input, which is a common scenario in interactive coding sessions.

* Add internationalization for 'File saved successfully' message

# Add internationalization for 'File saved successfully' message

## Description
This PR adds internationalization support for the "File saved successfully" message in the CodeEditor component. It updates the translation.json file to include translations for multiple languages and modifies the CodeEditor.tsx file to use the new translation key.

## Changes
1. Updated `translation.json`:
   - Added a new key `CODE_EDITOR$FILE_SAVED_SUCCESSFULLY` with translations for multiple languages.
   - Ensured the file structure supports multiple languages per key.

2. Modified `CodeEditor.tsx`:
   - Updated the success message to use the new translation key.
   - Applied the translation to both the toast notification and the on-screen notification.

## Why
These changes improve the user experience for non-English speakers by providing localized feedback when a file is successfully saved. This aligns with our goal of making the application more accessible to a global audience.

## How to Test
1. Change the application language to different supported languages.
2. Open the CodeEditor, make changes to a file, and save it.
3. Verify that the "File saved successfully" message appears in the correct language for both the toast and on-screen notifications.

## Additional Notes
Please pay special attention to the structure of the translation.json file to ensure it follows our established patterns for internationalization.

* Add toast notifications for error handling in fileService

# Add toast notifications for error handling in fileService

## Description
This PR enhances the error handling in the `fileService.ts` file by adding toast notifications for user feedback. It maintains the existing console error logging for debugging purposes while improving the user experience by providing visible error messages in the UI.

## Changes
- Added import for the toast utility
- Implemented toast.error() calls in catch blocks for all file operations
- Kept console.error() calls for detailed logging
- Updated error messages to be more user-friendly

## Files Changed
- `src/services/fileService.ts`

## Testing
- Tested all file operations (select, upload, list, save) to ensure proper error handling
- Verified that toast notifications appear when errors are simulated
- Confirmed that console errors are still logged for debugging

## Additional Notes
This change improves error visibility for users without altering the underlying error handling logic. It should make troubleshooting easier for both users and developers.

* Add file path safety check and improve error handling in file services

# Add file path safety check and improve error handling in file services

## Description
This PR enhances the `fileService.ts` by adding a safety check for file paths in the `saveFile` function and improves error handling across all file operations. It also includes new translations for various file-related error messages.

## Changes
1. Updated `src/services/fileService.ts`:
   - Added a validation check for file paths in the saveFile function
   - Improved error handling for all file operations (select, upload, list, save)
   - Implemented toast error messages with translation support

2. Updated `src/i18n/translations.json`:
   - Added new translation keys for file service error messages:
     - FILE_SERVICE$SELECT_FILE_ERROR
     - FILE_SERVICE$UPLOAD_FILES_ERROR
     - FILE_SERVICE$LIST_FILES_ERROR
     - FILE_SERVICE$SAVE_FILE_ERROR
     - FILE_SERVICE$INVALID_FILE_PATH

## Files Changed
- `src/services/fileService.ts`
- `src/i18n/translations.json`

## Key Implementation Details
```typescript
export async function saveFile(filePath: string, content: string): Promise<void> {
  const { t } = useTranslation();
  if (!filePath || filePath.includes('..')) {
    toast.error(t(I18nKey.FILE_SERVICE$INVALID_FILE_PATH));
    throw new Error('Invalid file path');
  }
  try {
    // Existing implementation...
  } catch (error) {
    console.error('Error saving file:', error);
    toast.error(t(I18nKey.FILE_SERVICE$SAVE_FILE_ERROR), 'File Save Error');
    throw error;
  }
}
```

## Testing
- Verified that the saveFile function rejects invalid file paths (empty or containing '..')
- Confirmed that appropriate error messages are displayed using toast notifications for all file operations
- Tested with different languages to ensure translated messages appear correctly

## Security Implications
The file path check in saveFile enhances security by preventing potential directory traversal attacks.

## Next Steps
- Consider adding similar safety checks to other file operations if applicable
- Ensure thorough testing of error scenarios across all supported languages

* Add docstrings to listen.py

# Add docstrings to listen.py

## Description
This PR adds comprehensive docstrings to all functions in the `listen.py` file. These additions improve code documentation, making the file more readable and maintainable for current and future developers.

## Changes
- Added docstrings to all functions in `listen.py`
- Docstrings follow the Google Python Style Guide format
- Included descriptions, parameters, return values, and potential exceptions for each function

## Files Changed
- `src/listen.py`

## Docstring Example
Here's an example of one of the added docstrings:

```python
@app.post('/api/save-file')
async def save_file(request: Request):
    """
    Save a file to the agent's runtime file store.

    This endpoint allows saving a file when the agent is in a paused, finished,
    or awaiting user input state. It checks the agent's state before proceeding
    with the file save operation.

    Args:
        request (Request): The incoming FastAPI request object.

    Returns:
        JSONResponse: A JSON response indicating the success of the operation.

    Raises:
        HTTPException:
            - 403 error if the agent is not in an allowed state for editing.
            - 400 error if the file path or content is missing.
            - 500 error if there's an unexpected error during the save operation.
    """
    # Function implementation...
```

## Impact
- Improved code readability and maintainability
- Better understanding of function purposes, inputs, outputs, and potential errors
- Easier onboarding for new developers working on this file
- Enhanced IDE support for function descriptions and parameter information

## Testing
- No functional changes were made, so existing tests should pass without modification
- Manual review of docstrings for accuracy and completeness is recommended

## Next Steps
- Consider adding similar docstrings to other files in the project for consistency
- Review the added docstrings to ensure they accurately describe the current functionality
- Update docstrings as needed when function implementations change in the future

## Additional Notes
The existing code structure and functionality remain unchanged. This PR focuses solely on improving documentation through the addition of docstrings.

* Revert exclude_list formatting and add docstrings in listen.py

# Revert exclude_list formatting and add docstrings in listen.py

## Description
This PR makes two main changes to the `listen.py` file:
1. Reverts the `exclude_list` in the `list_files` function to its original format, with each item on a separate line.
2. Adds comprehensive docstrings to all functions in the file.

These changes improve code readability, maintain consistency with project standards, and enhance documentation for better maintainability.

## Changes
1. Updated `opendevin/server/listen.py`:
   - Reverted `exclude_list` formatting in `list_files` function
   - Added docstrings to all functions

## Detailed Changes

### 1. Reverted exclude_list formatting
```python
exclude_list = (
    '.git',
    '.DS_Store',
    '.svn',
    '.hg',
    '.idea',
    '.vscode',
    '.settings',
    '.pytest_cache',
    '__pycache__',
    'node_modules',
    'vendor',
    'build',
    'dist',
    'bin',
    'logs',
    'log',
    'tmp',
    'temp',
    'coverage',
    'venv',
    'env',
)
```

### 2. Added docstrings (example)
```python
@app.get('/api/list-files')
def list_files(request: Request, path: str = '/'):
    """
    List files in the specified path.

    This function retrieves a list of files from the agent's runtime file store,
    excluding certain system and hidden files/directories.

    Args:
        request (Request): The incoming request object.
        path (str, optional): The path to list files from. Defaults to '/'.

    Returns:
        list: A list of file names in the specified path.

    Raises:
        HTTPException: If there's an error listing the files.
    """
    # Function implementation...
```

## Rationale
- Reverting `exclude_list` formatting maintains consistency with the project's coding style and ensures proper functioning of pre-commit hooks.
- Adding docstrings improves code documentation, making it easier for developers to understand and maintain the codebase.

## Impact
- Improved code readability and consistency
- Enhanced documentation for all functions in `listen.py`
- Easier onboarding for new developers
- Better IDE support for function descriptions and parameter information

## Testing
- No functional changes were made, so existing tests should pass without modification
- Manual review of the reverted `exclude_list` and new docstrings is recommended

## Additional Notes
- The existing code functionality remains unchanged
- All functions in `listen.py` now have detailed docstrings following the Google Python Style Guide format

## Next Steps
- Review the added docstrings to ensure they accurately describe the current functionality
- Consider adding similar docstrings to other files in the project for consistency
- Update docstrings as needed when function implementations change in the future

* made code reviewable

* fixed ruff issues

* Update listen.py docstrings

* final tweaks

* re-added encodedURIComponent in selectFile

---------

Co-authored-by: tobitege <tobitege@gmx.de>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2024-07-02 09:42:43 +02:00
Leo
82ea8b3556 test: fix the failed unit tests. (#2721)
Signed-off-by: ifuryst <ifuryst@gmail.com>
2024-07-01 15:27:27 +00:00
dependabot[bot]
e83d1fe8b8 chore(deps): bump @reduxjs/toolkit from 2.2.5 to 2.2.6 in /frontend (#2717)
Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](https://github.com/reduxjs/redux-toolkit/compare/v2.2.5...v2.2.6)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:21:47 +08:00
dependabot[bot]
1cbbb10c56 chore(deps-dev): bump postcss from 8.4.38 to 8.4.39 in /frontend (#2716)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.38 to 8.4.39.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.38...8.4.39)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:21:24 +08:00
Leo
58191e0af0 style: refine the copy button and add copy feedback for the icon. (#2715)
* Add padding on top for input to overlay the message bubbles.

Signed-off-by: ifuryst <ifuryst@gmail.com>
2024-07-01 14:59:12 +00:00
tobitege
ea3c58dc8c feat: added make run-wsl (#2711)
* feat: added make run-wsl

* moved Windows warning
2024-07-01 09:01:54 +02:00
tobitege
7d31057904 feat: file explorer: better sorting; .gitignore support; file upload config (#2621)
* feat: file explorer: better sorting; .gitignore support; file upload config

* resolved poetry

* move config settings (no extra file); updated uploading of files; fix exception on refresh of removed folder

* removed console cmds; fix in a toast

* attempt fix of upload toasts

* fix new options' assignments in listen.py
2024-06-28 16:36:25 +00:00
dependabot[bot]
a918198f43 chore(deps): bump vite from 5.3.1 to 5.3.2 in /frontend (#2681) 2024-06-28 23:48:02 +08:00
dependabot[bot]
839c51ed3c chore(deps): bump jose from 5.6.1 to 5.6.2 in /frontend (#2682) 2024-06-28 23:47:35 +08:00
dependabot[bot]
fdef348365 chore(deps): bump jose from 5.5.0 to 5.6.1 in /frontend (#2663) 2024-06-27 15:42:38 +00:00
மனோஜ்குமார் பழனிச்சாமி
877d9ae794 Added Sound Notification 🎵 (#2203)
* Added Sound Notification

* prettify

* linted

* disabled by default

* Add dev config for frontend

* add volume icon

* fix typo

* lint

* lint

* Apply suggestions from code review

Co-authored-by: Graham Neubig <neubig@gmail.com>

* Move volume icon to bottom

---------

Co-authored-by: Graham Neubig <neubig@gmail.com>
2024-06-27 01:27:48 +00:00
dependabot[bot]
8fef94cac4 chore(deps): bump jose from 5.4.1 to 5.5.0 in /frontend (#2645)
Bumps [jose](https://github.com/panva/jose) from 5.4.1 to 5.5.0.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/panva/jose/compare/v5.4.1...v5.5.0)

---
updated-dependencies:
- dependency-name: jose
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 23:40:14 +08:00
dependabot[bot]
10b7a1e9c5 chore(deps-dev): bump @types/node from 20.14.8 to 20.14.9 in /frontend (#2644)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.8 to 20.14.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 23:29:55 +08:00
dependabot[bot]
5abe014218 chore(deps): bump react-router-dom from 6.23.1 to 6.24.0 in /frontend (#2628)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.23.1 to 6.24.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.24.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 23:19:52 +08:00
tobitege
163ee3abf6 dev: added make-i18n to "build" (package.json) (#2641)
* added i18n to build-frontend

* revert Makefile; update package.json for make-i18n instead
2024-06-26 11:53:40 +02:00
Boxuan Li
ee86d8d25e Frontend support for delegation and rejection (#2608)
1. Add support for rejection action on frontend
2. Show users the reason for rejection
3. Get rid of weird empty box after delegation
4. On web GUI, show customer when a delegation starts and ends
2024-06-26 00:30:10 -07:00