38 Commits
Author SHA1 Message Date
zeekay 58f1fd2929 Dev version 2025-03-28 02:05:55 -05:00
zeekay 306255de43 Add vector store support 2025-03-27 23:10:50 -05:00
zeekay 6c95a3a9a6 Add external MCP server support with iTerm2 integration 2025-03-25 23:55:25 -05:00
zeekay 7198d2fdf7 Add LLM-agnostic thinking mode with multiple provider support 2025-03-25 23:21:04 -05:00
zeekay 3c2e946a09 Expanded mission 2025-03-24 01:55:02 -05:00
zeekay f9805e63ff Update a few more references 2025-03-24 00:22:19 -05:00
zeekay b841b4727b Rename package from hanzo-dev-mcp to hanzo-mcp
This commit renames the package from hanzo-dev-mcp to hanzo-mcp and refactors the codebase to reflect the expanded purpose of the MCP server. Key changes include:

- Renamed package and module (dev_mcp → hanzo_mcp)
- Updated server description to emphasize Platform API access
- Changed default server name (hanzo-dev → hanzo)
- Updated entry point and CLI commands
- Updated README with new configuration examples
- Fixed all imports and references in tests

This aligns with the shift from a development-only tool to a more general-purpose MCP server that can access Hanzo APIs and Cloud Platform services.
2025-03-24 00:21:33 -05:00
zeekay 106395b8ef Update cli 2025-03-23 22:57:01 -05:00
zeekay 35a1e8c36f Reformat 2025-03-23 22:22:56 -05:00
zeekay 7dcdc533e7 Rebrand 2025-03-23 22:18:10 -05:00
SDGLBL 7652939809 feat: Add Jupyter notebook tools support 2025-03-23 20:53:53 +08:00
SDGLBL f59a07eae7 feat(file_operations): support file paths in search and replace operations
Extended the search_content and content_replace methods in FileOperations to handle both directory and file paths. Previously, these methods only worked with directories. Now, when a file path is provided, the operation is performed directly on that file. Added validation to check if the path is a file or directory and handle each case appropriately. Also updated the docstrings to reflect this change.

Added extensive test coverage for the new functionality in test_file_operations.py, including:
- Searching content in a single file
- Handling file pattern mismatches
- Replacing content in a single file
- Dry run functionality for file paths
- Directory-based operations with multiple files and subdirectories
- File pattern filtering in both search and replace operations

The changes maintain backward compatibility while adding more flexibility to the file operations API.
2025-03-23 19:08:40 +08:00
SDGLBL 38370ad67d feat: enhance directory_tree tool with depth limits and filtering 2025-03-23 18:36:13 +08:00
SDGLBL a177e76211 test: remove test_executors.py following removal of executors.py 2025-03-23 10:49:25 +08:00
SDGLBL 3d74540fdd Allow access to .git folders by default
- Modified permissions system to allow access to .git folders by default
- Updated tests to reflect the new permission behavior
- Updated version to 0.1.12
- Updated CHANGELOG.md
2025-03-22 21:21:31 +08:00
SDGLBL 6c303babc7 refactor: improve code formatting and consistency across multiple files
- Standardize import statements by removing unnecessary parentheses and line breaks
- Adjust function signatures and docstrings for better readability
- Fix indentation and spacing in test files to follow consistent patterns
- Reformat multi-line statements and expressions for clarity
- Remove trailing whitespace and ensure consistent line endings
2025-03-22 15:52:02 +08:00
SDGLBL 24402be291 refactor: remove unused imports and clean up code
Removed unused imports across multiple files including `os`, `json`, `time`, `pathlib.Path`, `pytest`, and `unittest.mock.patch`.
Cleaned up redundant variable assignments in `CommandExecutor` and removed unnecessary f-strings in log messages.
This improves code readability and reduces unnecessary dependencies.
2025-03-22 15:50:35 +08:00
SDGLBL 07fdd7089a Add think tool based on Anthropic research to enhance complex reasoning 2025-03-22 11:32:44 +08:00
SDGLBL ffe9dfe79c fix: Add validation for empty oldText parameter in edit_file 2025-03-22 09:51:34 +08:00
SDGLBL 050e5545f3 Update test to use required cwd parameter in run_command 2025-03-21 16:44:20 +08:00
SDGLBL 135f2a1bf5 test: update test to use create_subprocess_shell instead of create_subprocess_exec
The test in `test_command_executor.py` was updated to use `asyncio.create_subprocess_shell` instead of `asyncio.create_subprocess_exec` to better reflect the intended behavior. Additionally, the assertion to verify the subprocess call was modified to check if "python" is included in the call arguments rather than being the first argument, ensuring the test remains accurate with the updated method.
2025-03-21 16:17:37 +08:00
SDGLBL 33d0c19386 feat(command-executor): add support for environment variable expansion in shell commands
Added the "$" operator to the list of shell operators in the CommandExecutor class to ensure commands containing environment variables are executed in a shell context. This allows for proper expansion of environment variables like $PATH.

test(command-executor): add test case for environment variable expansion

Added a new test case `test_execute_command_with_env_vars` to verify that environment variables are correctly expanded when executing shell commands. The test checks that the $PATH variable is expanded and contains colon-separated directories in the output.
2025-03-21 15:56:30 +08:00
SDGLBL 21211389b3 Remove unnecessary file operations tools and update documentation
- Remove create_directory, move_file, and list_directory tools
- Update system prompt to show how to use run_command instead
- Update documentation in README.md and ClaudeCode.md
- Remove related tests
2025-03-20 10:43:37 +08:00
SDGLBL da9edcfea7 feat: add parameter validation utilities and integrate into existing tools
This commit introduces a new validation module with utilities for validating parameters in tool functions. The module includes functions `validate_parameter`, `validate_path_parameter`, and `validate_parameters` that return structured validation results. These utilities have been integrated into various tool functions across the codebase to ensure proper parameter validation before execution. Additionally, tests have been added to verify the validation behavior across different scenarios. This enhancement improves the robustness of the tools by preventing invalid parameter usage and providing clear error messages.
2025-03-19 19:38:43 +08:00
SDGLBL 2f4d3b1ea6 Refactor: Consolidate read_file and read_multiple_files into a single read_files function 2025-03-19 16:47:04 +08:00
SDGLBL 72a7532505 feat: Add support for combined shell commands with shell operators in execute_command
- Added detection for shell operators (&&, ||, |, ;, >, <, etc.)
- Use create_subprocess_shell for commands with shell operators
- Added test for combined commands using cd with another command
- This enables scenarios like 'cd /path && cat file.txt'
2025-03-19 14:33:16 +08:00
SDGLBL bf8b622e65 refactor: add type hints to test methods for improved code clarity and maintainability
This commit introduces type hints to all test methods across multiple test files. The type hints provide explicit information about the expected types of function parameters and return values, enhancing code readability and enabling better static analysis. This change aligns with Python's gradual typing approach and helps catch potential type-related issues early in the development process. The affected test files include:
- tests/test_cli.py
- tests/test_common/test_context.py
- tests/test_common/test_hidden_files.py
- tests/test_common/test_permissions.py
- tests/test_executors.py
- tests/test_filesystem/test_file_operations.py
- tests/test_project/test_analysis.py
- tests/test_server.py
- tests/test_shell/test_command_executor.py

The type hints have been added to test methods, fixtures, and helper functions, ensuring consistent typing throughout the test suite. This change does not modify the actual test logic but improves the overall code quality and maintainability.
2025-03-19 00:48:26 +08:00
SDGLBL e24e959b0c test: update test assertions and remove redundant test cases 2025-03-19 00:06:22 +08:00
SDGLBL 1f3191803f fix: update test assertions and exclusions for hidden files
The commit modifies the test assertions and exclusions in `test_hidden_files.py` to reflect changes in the handling of hidden files. Specifically, the test now correctly asserts that the actual `.github` directory should be allowed instead of excluded. Additionally, redundant exclusions for `.github/workflows/test.yml` and `.github/workflows/ci.yml` have been removed to align with the updated logic. These changes ensure the tests accurately validate the intended behavior for hidden file permissions.
2025-03-18 23:45:33 +08:00
SDGLBL 6755c8c5d8 refactor: simplify command executor by removing default exclusions and patterns
Removed the `.github` directory from the sensitive directories list in the `PermissionManager` class. Simplified the `CommandExecutor` class by removing the `_add_default_exclusions` method and the `excluded_patterns` list, retaining only the `rm` command in the `excluded_commands` list. Updated the corresponding tests to reflect these changes.
2025-03-18 23:25:30 +08:00
SDGLBL abc4a23225 refactor: remove operation approval system from PermissionManager
The operation approval system, including `approved_operations` and `operation_timeout`, has been removed from the `PermissionManager` class. This simplifies the permission management by relying solely on path-based permissions (`is_path_allowed`) instead of requiring explicit operation approvals. The changes include:

- Removed `approved_operations` and `operation_timeout` fields from `PermissionManager`
- Removed `approve_operation`, `is_operation_approved`, `clear_approvals`, and `clear_expired_approvals` methods
- Updated `to_json` and `from_json` methods to exclude operation approval data
- Modified `PermissibleOperation` to use `is_path_allowed` instead of operation approvals
- Updated `FileOperations` and `CommandExecutor` to remove operation approval checks
- Removed related tests from `test_permissions.py` and updated remaining tests
- Simplified file operation methods in `FileOperations` to rely on path permissions

These changes streamline the permission system by focusing on path-level access control rather than granular operation approvals.
2025-03-18 22:12:22 +08:00
SDGLBL f573dc6cf4 feat(permissions): enhance path exclusion logic in PermissionManager 2025-03-18 21:56:27 +08:00
SDGLBL add2fcdc1c test: update test fixtures and improve test coverage
- Add new `project_manager` fixture to `tests/conftest.py` for testing
- Update test assertions in `tests/test_cli.py` to clarify mode parameter behavior
- Refactor imports and improve code formatting in `tests/test_common/test_context.py`
- Refactor imports and improve code formatting in `tests/test_common/test_permissions.py`
- Enhance test coverage for `ScriptExecutor` in `tests/test_executors.py` with additional edge cases and improved mocking
- Update test setup in `tests/test_filesystem/test_file_operations.py` to handle tool registration more robustly
- Update test setup in `tests/test_project/test_analysis.py` to handle tool registration more robustly
- Improve server initialization tests in `tests/test_server.py` with better mocking and path handling
- Update command executor tests in `tests/test_shell/test_command_executor.py` with more precise assertions
2025-03-18 18:45:20 +08:00
SDGLBL 8de1082379 feat(tests): add comprehensive test suite for project components
Added a full suite of test files to cover the functionality of various project components including:
- CLI module tests
- Common context and permissions tests
- Command executor tests
- File operations tests
- Project analysis tests
- Server tests
- Shell command tests

Each test file includes unit tests for the corresponding module, covering core functionality, error handling, and edge cases. The tests utilize pytest fixtures and mocks to simulate different scenarios and ensure proper behavior of the code.

This extensive test suite will help maintain code quality, catch regressions, and ensure the reliability of the project as it evolves.
2025-03-17 00:16:14 +08:00
SDGLBL ee6431f6fc refactor: remove deprecated test files for server, basic functionality, and enhanced commands
The test files `test_basic.py`, `test_enhanced_commands.py`, and `test_server.py` have been deleted as they are no longer relevant or maintained. These tests were associated with older versions of the MCP agent server and its components, which have since been refactored or replaced. The removal of these files helps to clean up the codebase and reduce maintenance overhead.
2025-03-16 21:47:45 +08:00
SDGLBL 97e672136d refactor: move permissions to tools/common directory 2025-03-15 23:50:41 +08:00
SDGLBL 98e80683d4 refactor: update CLI and server code for improved type safety and consistency
- Rename `BashTool` to `bash_tool` in README.md for consistency with naming conventions
- Add `json` import and type casting to CLI arguments in `cli.py` for improved type safety
- Remove `commands.py` and consolidate command execution logic in `EnhancedCommandExecutor`
- Update `DocumentContext` to ignore unused path resolution result
- Refactor `EnhancedCommandExecutor` to use modern type annotations and improve logging
- Update `executors.py` to ignore unused process communication result
- Refactor `PermissionManager` to use type variables for better type annotations
- Remove `CommandExecutor` import and use `EnhancedCommandExecutor` exclusively in `server.py`
- Update `tool_integration.py` imports for better organization
- Add `basedpyright` configuration to `pyproject.toml` for static type checking
- Update test imports to use `EnhancedCommandExecutor` instead of `CommandExecutor` in `test_basic.py`
2025-03-15 23:26:00 +08:00
SDGLBL 217733fc68 feat: add initial project structure with core functionality
This commit introduces the initial project structure for the MCP agent implementation. Key additions include:

- Added .gitignore for Python projects
- Defined Python version as 3.13 in .python-version
- Created KODING.md with development guidelines and project structure
- Added comprehensive README.md with project overview, features, and usage instructions
- Implemented installation scripts (install.bat and install.sh)
- Added core Python package structure with modules for:
  - Command execution (commands.py, enhanced_commands.py)
  - Document context management (context.py)
  - Script execution (executors.py)
  - Permission management (permissions.py)
  - Project management (project.py)
  - Server implementation (server.py)
  - Tool integration (tool_integration.py)
- Added pyproject.toml for project configuration and dependencies
- Created test suite with basic functionality tests and enhanced command tests

The implementation provides a foundation for the MCP server with capabilities for code understanding, modification, command execution, and project analysis. Security features include permission management and input validation.
2025-03-15 09:26:16 +08:00