ayder-cli 0.99.90__tar.gz → 1.0__tar.gz
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.
- {ayder_cli-0.99.90 → ayder_cli-1.0}/AGENTS.md +112 -329
- ayder_cli-1.0/PKG-INFO +494 -0
- ayder_cli-1.0/README.md +463 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/pyproject.toml +1 -1
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/runtime_factory.py +3 -2
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/prompts.py +0 -4
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/impl/ollama.py +34 -3
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/impl/openai.py +28 -14
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/themes/claude.py +17 -14
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/dbs_tool_definitions.py +2 -1
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/definition.py +3 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/registry.py +5 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/__init__.py +1 -1
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/app.py +30 -5
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/chat_loop.py +6 -2
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/commands.py +9 -7
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/widgets.py +40 -3
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/application/test_runtime_factory.py +2 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_cli.py +2 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_runtime_factory.py +2 -0
- ayder_cli-0.99.90/PKG-INFO +0 -565
- ayder_cli-0.99.90/README.md +0 -534
- ayder_cli-0.99.90/README_API.md +0 -141
- {ayder_cli-0.99.90 → ayder_cli-1.0}/.github/workflows/ci.yml +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/.github/workflows/python-package.yml +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/.gitignore +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/.python-version +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/LICENSE +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/docs/PROJECT_STRUCTURE.md +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/docs/cc.png +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/docs/temporal/CONTRACT_TEMPLATE.md +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/docs/temporal/PRD.md +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/docs/temporal/prompts.md +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/__main__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/README.md +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/execution_policy.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/message_contract.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/temporal_contract.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/temporal_metadata.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/application/validation.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/cli.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/cli_callbacks.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/cli_runner.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/client.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/console.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/core/config.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/core/config_migration.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/core/context.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/core/context_manager.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/core/result.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/logging_config.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/loops/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/loops/base.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/loops/config.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/memory.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/notes.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/parser.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/process_manager.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/base.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/impl/claude.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/impl/deepseek.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/impl/gemini.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/impl/glm.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/impl/qwen.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/providers/orchestrator.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/services/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/services/interactions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/services/temporal_client.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/services/temporal_worker.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/services/temporal_workflow_service.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/services/tools/executor.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tasks.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/themes/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/themes/original.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/dbs_tool.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/filesystem.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/filesystem_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/memory_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/notes_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/process_manager_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/python_editor.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/python_editor_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/search.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/search_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/shell.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/shell_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/tasks_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/temporal.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/temporal_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/utils_tools.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/utils_tools_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/venv.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/venv_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/web.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/builtins/web_definitions.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/execution.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/hooks.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/normalization.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/schemas.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tools/utils.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/adapter.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/helpers.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/parser.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/screens.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/theme_manager.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/tui/types.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/ui/cli_adapter.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/ui.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/src/ayder_cli/version.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/COVERAGE.md +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/application/test_message_contract.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/application/test_service_ui_decoupling.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/application/test_temporal_contract.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/client/test_main.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/convergence/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/convergence/test_execution_policy_parity.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/convergence/test_runtime_wiring.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/convergence/test_temporal_runtime_wiring.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/convergence/test_validation_path.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/core/test_config.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/core/test_config_coverage.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/core/test_config_migration.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/core/test_config_v2.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/core/test_context_manager.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/core/test_parameter_aliasing.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/core/test_parser.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/loops/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/loops/test_base.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/manual_test_verbose.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/test_boundary.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/test_confirmation_policy.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/test_executor_integration.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/test_interaction_sink.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/test_temporal_client.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/test_temporal_worker.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/test_temporal_workflow_service.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/services/tools/test_executor.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_cli_callbacks.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_env_manager.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_logging_config.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_memory.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_message_contract.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_notes.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_process_manager.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/test_tasks.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/__init__.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_dbs_tool.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_definition_discovery.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_impl.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_impl_coverage.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_path_security.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_python_editor.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_registry.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_registry_coverage.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_result.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_schemas.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_search_codebase.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_temporal_tool.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_utils.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_virtualenv.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/tools/test_web.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_confirm_screen.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_diff_preview.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_tui_chat_loop.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_tui_commands_logging.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_tui_commands_provider.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_tui_helpers.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_tui_temporal_command.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_tui_widgets.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_ui.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_ui_coverage.py +0 -0
- {ayder_cli-0.99.90 → ayder_cli-1.0}/tests/ui/test_ui_verbose.py +0 -0
|
@@ -10,8 +10,6 @@ This document provides coding standards, tool configurations, and workflows for
|
|
|
10
10
|
- **Virtual Environment**: `.venv` (already configured)
|
|
11
11
|
- **Project Structure**: Standard Python package in `src/ayder_cli/`
|
|
12
12
|
|
|
13
|
-
> **📖 For detailed architecture notes, module relationships, and TUI structure, see [docs/PROJECT_STRUCTURE.md](docs/PROJECT_STRUCTURE.md)**
|
|
14
|
-
|
|
15
13
|
## Tech Stack
|
|
16
14
|
|
|
17
15
|
### Core Dependencies
|
|
@@ -23,6 +21,7 @@ This document provides coding standards, tool configurations, and workflows for
|
|
|
23
21
|
| **rich** | Rich text and beautiful formatting | >=13.0.0 |
|
|
24
22
|
| **prompt-toolkit** | Interactive CLI prompts and auto-completion | latest |
|
|
25
23
|
| **python-dotenv** | Environment variable management | >=1.0.0 |
|
|
24
|
+
| **httpx** | Async HTTP client (Ollama API, fetch_web) | latest |
|
|
26
25
|
|
|
27
26
|
### Development Dependencies
|
|
28
27
|
|
|
@@ -50,10 +49,12 @@ This document provides coding standards, tool configurations, and workflows for
|
|
|
50
49
|
ayder-cli/
|
|
51
50
|
├── src/ayder_cli/ # Main source code
|
|
52
51
|
│ ├── cli.py # Entry point (argparse)
|
|
53
|
-
│ ├── cli_runner.py #
|
|
54
|
-
│ ├──
|
|
52
|
+
│ ├── cli_runner.py # CLI command execution logic
|
|
53
|
+
│ ├── cli_callbacks.py # CLI callback implementations
|
|
54
|
+
│ ├── client.py # ChatSession helpers
|
|
55
55
|
│ ├── console.py # Rich console instance
|
|
56
56
|
│ ├── version.py # Version info
|
|
57
|
+
│ ├── logging_config.py # Loguru setup
|
|
57
58
|
│ │
|
|
58
59
|
│ ├── core/ # Core infrastructure
|
|
59
60
|
│ │ ├── config.py # Pydantic config with validation
|
|
@@ -61,84 +62,93 @@ ayder-cli/
|
|
|
61
62
|
│ │ └── result.py # ToolSuccess/ToolError types
|
|
62
63
|
│ │
|
|
63
64
|
│ ├── application/ # Shared application layer (CLI + TUI)
|
|
64
|
-
│ │ ├── checkpoint_orchestrator.py # CheckpointOrchestrator, RuntimeContext
|
|
65
65
|
│ │ ├── execution_policy.py # ExecutionPolicy, PermissionDeniedError
|
|
66
66
|
│ │ ├── message_contract.py # LLM message format contracts
|
|
67
67
|
│ │ ├── runtime_factory.py # create_runtime() composition root
|
|
68
68
|
│ │ ├── temporal_contract.py # Temporal workflow contracts
|
|
69
69
|
│ │ ├── temporal_metadata.py # Temporal metadata types
|
|
70
|
-
│ │ └── validation.py
|
|
70
|
+
│ │ └── validation.py # ValidationAuthority, SchemaValidator
|
|
71
71
|
│ │
|
|
72
72
|
│ ├── loops/ # Shared agent loop base
|
|
73
73
|
│ │ ├── base.py # AgentLoopBase (iteration, checkpoint, routing)
|
|
74
74
|
│ │ └── config.py # Shared LoopConfig dataclass
|
|
75
75
|
│ │
|
|
76
|
+
│ ├── providers/ # LLM provider implementations
|
|
77
|
+
│ │ ├── base.py # AIProvider protocol, NormalizedStreamChunk
|
|
78
|
+
│ │ ├── provider_orchestrator.py # Factory: create(config) → provider
|
|
79
|
+
│ │ └── impl/ # Individual provider drivers
|
|
80
|
+
│ │ ├── openai.py # OpenAIProvider (base for most drivers)
|
|
81
|
+
│ │ ├── ollama.py # OllamaProvider (native + XML fallback)
|
|
82
|
+
│ │ ├── claude.py # ClaudeProvider (Anthropic SDK)
|
|
83
|
+
│ │ ├── gemini.py # GeminiProvider (Google GenAI SDK)
|
|
84
|
+
│ │ ├── deepseek.py # DeepSeekProvider (OpenAI-compatible)
|
|
85
|
+
│ │ ├── qwen.py # QwenNativeProvider (DashScope SDK)
|
|
86
|
+
│ │ └── glm.py # GLMNativeProvider (ZhipuAI SDK)
|
|
87
|
+
│ │
|
|
76
88
|
│ ├── services/ # Service layer
|
|
77
|
-
│ │ ├── llm.py # OpenAI/Ollama LLM provider
|
|
78
89
|
│ │ ├── interactions.py # InteractionSink, ConfirmationPolicy protocols
|
|
79
90
|
│ │ └── tools/
|
|
80
91
|
│ │ └── executor.py # ToolExecutor (CLI confirmation + diff preview)
|
|
81
92
|
│ │
|
|
82
|
-
│ ├── tools/ # Tool framework + implementations (
|
|
83
|
-
│ │ ├── definition.py # ToolDefinition
|
|
84
|
-
│ │ ├── registry.py #
|
|
93
|
+
│ ├── tools/ # Tool framework + implementations (25 tools)
|
|
94
|
+
│ │ ├── definition.py # ToolDefinition dataclass + auto-discovery
|
|
95
|
+
│ │ ├── registry.py # ToolRegistry (schema, execution, system prompts)
|
|
85
96
|
│ │ ├── schemas.py # OpenAI-format JSON schemas
|
|
86
97
|
│ │ ├── execution.py # Tool execution engine
|
|
87
98
|
│ │ ├── hooks.py # Hook/middleware system
|
|
88
|
-
│ │ ├── normalization.py # Argument normalization
|
|
99
|
+
│ │ ├── normalization.py # Argument normalization + path resolution
|
|
89
100
|
│ │ ├── utils.py # Tool utilities
|
|
90
101
|
│ │ └── builtins/ # Built-in tool implementations
|
|
91
|
-
│ │ ├── *_definitions.py # Distributed tool definitions (
|
|
92
|
-
│ │ ├── filesystem.py #
|
|
93
|
-
│ │ ├── python_editor.py # CST-based Python editor
|
|
94
|
-
│ │ ├── search.py #
|
|
95
|
-
│ │ ├── shell.py #
|
|
96
|
-
│ │ ├── venv.py # Virtualenv tools
|
|
97
|
-
│ │ ├── utils_tools.py #
|
|
98
|
-
│ │ ├── web.py #
|
|
102
|
+
│ │ ├── *_definitions.py # Distributed tool definitions (13 files)
|
|
103
|
+
│ │ ├── filesystem.py # file_explorer, read_file, file_editor
|
|
104
|
+
│ │ ├── python_editor.py # CST-based Python structural editor
|
|
105
|
+
│ │ ├── search.py # search_codebase, get_project_structure
|
|
106
|
+
│ │ ├── shell.py # run_shell_command
|
|
107
|
+
│ │ ├── venv.py # Virtualenv management tools
|
|
108
|
+
│ │ ├── utils_tools.py # manage_environment_vars
|
|
109
|
+
│ │ ├── web.py # fetch_web
|
|
110
|
+
│ │ ├── dbs_tool.py # DBS RAG API tool
|
|
99
111
|
│ │ └── temporal.py # Temporal workflow tool
|
|
100
112
|
│ │
|
|
101
113
|
│ ├── tui/ # Textual TUI (main interface)
|
|
114
|
+
│ │ ├── __init__.py # run_tui() entry point
|
|
102
115
|
│ │ ├── app.py # AyderApp main application
|
|
103
116
|
│ │ ├── chat_loop.py # TUI async chat loop (TuiChatLoop)
|
|
104
|
-
│ │ ├── commands.py # Slash command handlers
|
|
117
|
+
│ │ ├── commands.py # Slash command handlers (19 commands)
|
|
105
118
|
│ │ ├── helpers.py # TUI helper functions
|
|
106
|
-
│ │ ├──
|
|
107
|
-
│ │ ├──
|
|
119
|
+
│ │ ├── adapter.py # TUIInteractionSink (verbose debug)
|
|
120
|
+
│ │ ├── parser.py # Message parsing
|
|
121
|
+
│ │ ├── screens.py # Modal screens (confirm, select, permission, task edit)
|
|
108
122
|
│ │ ├── theme_manager.py # Theme loading and CSS
|
|
109
|
-
│ │ ├── types.py #
|
|
110
|
-
│ │ └── widgets.py # ChatView, ToolPanel,
|
|
123
|
+
│ │ ├── types.py # MessageType, ConfirmResult
|
|
124
|
+
│ │ └── widgets.py # ChatView, ToolPanel, CLIInputBar, StatusBar
|
|
111
125
|
│ │
|
|
112
126
|
│ ├── themes/ # TUI themes
|
|
113
127
|
│ │ ├── __init__.py # Theme registry
|
|
114
128
|
│ │ ├── claude.py # Claude theme CSS
|
|
115
129
|
│ │ └── original.py # Original theme CSS
|
|
116
130
|
│ │
|
|
117
|
-
│ ├── chat_loop.py # Sync CLI agent loop (ChatLoop)
|
|
118
|
-
│ ├── checkpoint_manager.py # Memory checkpoint/restore
|
|
119
131
|
│ ├── memory.py # Cross-session memory storage
|
|
120
132
|
│ ├── notes.py # Note management (.ayder/notes/)
|
|
121
|
-
│ ├── parser.py # XML tool call parser
|
|
133
|
+
│ ├── parser.py # XML/JSON tool call parser
|
|
122
134
|
│ ├── process_manager.py # Background process management
|
|
123
|
-
│ ├── prompts.py # System
|
|
135
|
+
│ ├── prompts.py # System prompt templates
|
|
124
136
|
│ ├── tasks.py # Task management (.ayder/tasks/)
|
|
125
|
-
│ └── ui.py # Rich terminal UI
|
|
137
|
+
│ └── ui.py # Rich terminal UI helpers
|
|
126
138
|
│
|
|
127
|
-
├── tests/ # Test suite
|
|
128
|
-
│ ├──
|
|
139
|
+
├── tests/ # Test suite (998+ tests)
|
|
140
|
+
│ ├── application/ # Application layer tests
|
|
129
141
|
│ ├── core/ # Core tests
|
|
130
142
|
│ ├── services/ # Services tests
|
|
131
143
|
│ ├── tools/ # Tool tests
|
|
132
144
|
│ ├── ui/ # TUI tests
|
|
133
145
|
│ └── *.py # Top-level tests
|
|
134
146
|
│
|
|
135
|
-
├──
|
|
136
|
-
├── .ayder/ # Project-specific data (tasks, notes, memory)
|
|
147
|
+
├── .ayder/ # Project-specific data (tasks, notes, memory, skills)
|
|
137
148
|
├── pyproject.toml # Project configuration
|
|
138
149
|
├── AGENTS.md # This file
|
|
139
|
-
├──
|
|
140
|
-
|
|
141
|
-
└── README.md # Project overview
|
|
150
|
+
├── README.md # Project overview
|
|
151
|
+
└── .claude/ # Claude Code configuration + skills
|
|
142
152
|
```
|
|
143
153
|
|
|
144
154
|
### Key Files Reference
|
|
@@ -147,20 +157,18 @@ ayder-cli/
|
|
|
147
157
|
|------|---------|
|
|
148
158
|
| `cli.py` | Entry point, argument parsing |
|
|
149
159
|
| `tui/app.py` | Main TUI application (AyderApp) |
|
|
150
|
-
| `tui/commands.py` | Slash command handlers (
|
|
160
|
+
| `tui/commands.py` | Slash command handlers (19 commands) |
|
|
151
161
|
| `tui/chat_loop.py` | Async LLM loop for TUI (TuiChatLoop + TuiCallbacks protocol) |
|
|
152
|
-
| `
|
|
153
|
-
| `
|
|
162
|
+
| `cli_runner.py` | CLI command execution + sync agent loop |
|
|
163
|
+
| `application/runtime_factory.py` | `create_runtime()` — single composition root for CLI + TUI |
|
|
154
164
|
| `application/execution_policy.py` | Shared permission + tool execution policy |
|
|
155
165
|
| `application/validation.py` | ValidationAuthority + SchemaValidator (single validation path) |
|
|
156
|
-
| `
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
159
|
-
| `tools/builtins/filesystem.py` | File system tool implementations |
|
|
160
|
-
| `tools/builtins/python_editor.py` | CST-based Python structural editor |
|
|
161
|
-
| `tools/builtins/search.py` | Search tool implementations |
|
|
166
|
+
| `loops/base.py` | AgentLoopBase shared by CLI and TUI loops |
|
|
167
|
+
| `tools/definition.py` | ToolDefinition dataclass + auto-discovery from `*_definitions.py` |
|
|
168
|
+
| `tools/registry.py` | ToolRegistry: schemas, execution, system prompts, tag filtering |
|
|
162
169
|
| `core/config.py` | Configuration with Pydantic validation |
|
|
163
170
|
| `core/context.py` | ProjectContext for path sandboxing |
|
|
171
|
+
| `providers/provider_orchestrator.py` | Factory dispatching to correct driver |
|
|
164
172
|
|
|
165
173
|
## Environment Setup
|
|
166
174
|
|
|
@@ -252,19 +260,10 @@ uv run mypy src/
|
|
|
252
260
|
If neither poe nor uv run work, activate the venv manually:
|
|
253
261
|
|
|
254
262
|
```bash
|
|
255
|
-
# Activate virtual environment
|
|
256
263
|
source .venv/bin/activate
|
|
257
|
-
|
|
258
|
-
# Run tests using python3 (not python)
|
|
259
264
|
python3 -m pytest tests/ -x --timeout=30 --ignore=tests/ui/test_tui_chat_loop.py
|
|
260
|
-
|
|
261
|
-
# Lint
|
|
262
265
|
python3 -m ruff check src/
|
|
263
|
-
|
|
264
|
-
# Type check
|
|
265
266
|
python3 -m mypy src/
|
|
266
|
-
|
|
267
|
-
# Deactivate when done
|
|
268
267
|
deactivate
|
|
269
268
|
```
|
|
270
269
|
|
|
@@ -274,7 +273,7 @@ deactivate
|
|
|
274
273
|
|
|
275
274
|
- **Line Length**: 88 characters (Black-compatible)
|
|
276
275
|
- **Quotes**: Use double quotes for strings
|
|
277
|
-
- **Imports**: Sort with `isort` style (standard lib
|
|
276
|
+
- **Imports**: Sort with `isort` style (standard lib > third-party > local)
|
|
278
277
|
- **Type Hints**: Use Python 3.12+ syntax (`str | None` instead of `Optional[str]`)
|
|
279
278
|
- **Docstrings**: Use Google-style docstrings
|
|
280
279
|
|
|
@@ -307,39 +306,14 @@ from ayder_cli.ui import console
|
|
|
307
306
|
|
|
308
307
|
## Linting with Ruff
|
|
309
308
|
|
|
310
|
-
### Using poe (Recommended)
|
|
311
|
-
|
|
312
309
|
```bash
|
|
313
|
-
#
|
|
310
|
+
# Using poe (Recommended)
|
|
314
311
|
uv run poe lint
|
|
315
|
-
|
|
316
|
-
# Check with auto-fix
|
|
317
312
|
uv run poe lint-fix
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
### Using uv run (Fallback)
|
|
321
313
|
|
|
322
|
-
|
|
323
|
-
# Check all source files
|
|
314
|
+
# Using uv run (Fallback)
|
|
324
315
|
uv run ruff check src/
|
|
325
|
-
|
|
326
|
-
# Check with auto-fix (safe fixes only)
|
|
327
316
|
uv run ruff check src/ --fix
|
|
328
|
-
|
|
329
|
-
# Check specific file
|
|
330
|
-
uv run ruff check src/ayder_cli/cli_runner.py
|
|
331
|
-
|
|
332
|
-
# Show all enabled rules
|
|
333
|
-
uv run ruff linter
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
### Using manual venv (Last Resort)
|
|
337
|
-
|
|
338
|
-
```bash
|
|
339
|
-
source .venv/bin/activate
|
|
340
|
-
python3 -m ruff check src/
|
|
341
|
-
python3 -m ruff check src/ --fix
|
|
342
|
-
deactivate
|
|
343
317
|
```
|
|
344
318
|
|
|
345
319
|
### Ruff Standards
|
|
@@ -356,31 +330,12 @@ uv run poe lint # Must pass with no errors
|
|
|
356
330
|
|
|
357
331
|
## Type Checking with Mypy
|
|
358
332
|
|
|
359
|
-
### Using poe (Recommended)
|
|
360
|
-
|
|
361
333
|
```bash
|
|
334
|
+
# Using poe (Recommended)
|
|
362
335
|
uv run poe typecheck
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
### Using uv run (Fallback)
|
|
366
336
|
|
|
367
|
-
|
|
368
|
-
# Check all source files
|
|
337
|
+
# Using uv run (Fallback)
|
|
369
338
|
uv run mypy src/
|
|
370
|
-
|
|
371
|
-
# Check specific file
|
|
372
|
-
uv run mypy src/ayder_cli/cli_runner.py
|
|
373
|
-
|
|
374
|
-
# Check with detailed output
|
|
375
|
-
uv run mypy src/ --show-error-codes
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
### Using manual venv (Last Resort)
|
|
379
|
-
|
|
380
|
-
```bash
|
|
381
|
-
source .venv/bin/activate
|
|
382
|
-
python3 -m mypy src/
|
|
383
|
-
deactivate
|
|
384
339
|
```
|
|
385
340
|
|
|
386
341
|
### Type Annotation Standards
|
|
@@ -389,70 +344,19 @@ deactivate
|
|
|
389
344
|
# Use modern Union syntax
|
|
390
345
|
def func(x: str | None) -> int: ...
|
|
391
346
|
|
|
392
|
-
# Instead of old Optional syntax
|
|
393
|
-
def func(x: Optional[str]) -> int: ... # Don't use
|
|
394
|
-
|
|
395
347
|
# Use built-in generics
|
|
396
348
|
def process(items: list[str]) -> dict[str, int]: ...
|
|
397
|
-
|
|
398
|
-
# Explicit None defaults require Optional
|
|
399
|
-
def greet(name: str | None = None) -> str: ...
|
|
400
349
|
```
|
|
401
350
|
|
|
402
|
-
**Note**: Mypy errors about `Optional` defaults are expected in some places due to historical code. New code should use proper `| None` annotations.
|
|
403
|
-
|
|
404
351
|
## Testing with pytest
|
|
405
352
|
|
|
406
|
-
### Using poe (Recommended)
|
|
407
|
-
|
|
408
|
-
```bash
|
|
409
|
-
# Run tests (excludes slow TUI tests)
|
|
410
|
-
uv run poe test
|
|
411
|
-
|
|
412
|
-
# Run all tests including TUI
|
|
413
|
-
uv run poe test-all
|
|
414
|
-
|
|
415
|
-
# Run tests with verbose output
|
|
416
|
-
uv run poe test-verbose
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
### Using uv run (Fallback)
|
|
420
|
-
|
|
421
|
-
```bash
|
|
422
|
-
# Run all tests
|
|
423
|
-
uv run pytest tests/ -v
|
|
424
|
-
|
|
425
|
-
# Run with coverage
|
|
426
|
-
uv run pytest tests/ --cov=src/ayder_cli --cov-report=term-missing
|
|
427
|
-
|
|
428
|
-
# Run specific test file
|
|
429
|
-
uv run pytest tests/test_cli.py -v
|
|
430
|
-
|
|
431
|
-
# Run specific test
|
|
432
|
-
uv run pytest tests/test_cli.py::TestMainFunction -v
|
|
433
|
-
|
|
434
|
-
# Run with timeout (recommended)
|
|
435
|
-
uv run pytest tests/ -x --timeout=30
|
|
436
|
-
|
|
437
|
-
# Run parallel (fastest)
|
|
438
|
-
uv run pytest tests/ -n auto --timeout=30
|
|
439
|
-
|
|
440
|
-
# Run excluding slow TUI tests
|
|
441
|
-
uv run pytest tests/ --ignore=tests/ui/test_tui_chat_loop.py
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
### Using manual venv (Last Resort)
|
|
445
|
-
|
|
446
353
|
```bash
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
#
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
#
|
|
453
|
-
python3 -m pytest tests/ -v
|
|
454
|
-
|
|
455
|
-
deactivate
|
|
354
|
+
# Using poe (Recommended)
|
|
355
|
+
uv run poe test # Excludes slow TUI tests
|
|
356
|
+
uv run poe test-all # All tests including TUI
|
|
357
|
+
uv run poe test-fast # Parallel execution
|
|
358
|
+
uv run poe test-verbose # Verbose output
|
|
359
|
+
uv run poe test-cov # With coverage report
|
|
456
360
|
```
|
|
457
361
|
|
|
458
362
|
### Test Standards
|
|
@@ -474,12 +378,12 @@ from ayder_cli import some_module
|
|
|
474
378
|
|
|
475
379
|
class TestFeature:
|
|
476
380
|
"""Test suite for feature."""
|
|
477
|
-
|
|
381
|
+
|
|
478
382
|
def test_basic_functionality(self):
|
|
479
383
|
"""Test normal operation."""
|
|
480
384
|
result = some_module.function()
|
|
481
385
|
assert result == expected
|
|
482
|
-
|
|
386
|
+
|
|
483
387
|
@patch("ayder_cli.module.subprocess.run")
|
|
484
388
|
def test_with_mocking(self, mock_run):
|
|
485
389
|
"""Test with external dependencies mocked."""
|
|
@@ -488,106 +392,11 @@ class TestFeature:
|
|
|
488
392
|
assert mock_run.called
|
|
489
393
|
```
|
|
490
394
|
|
|
491
|
-
##
|
|
492
|
-
|
|
493
|
-
Before submitting changes, run:
|
|
494
|
-
|
|
495
|
-
### Option 1: Using poe (RECOMMENDED)
|
|
496
|
-
|
|
497
|
-
```bash
|
|
498
|
-
cd /Users/sinanalyuruk/Vscode/ayder-cli
|
|
395
|
+
## Architecture
|
|
499
396
|
|
|
500
|
-
|
|
501
|
-
# Note: typecheck may show pre-existing errors, but lint and test must pass
|
|
502
|
-
uv run poe check-all
|
|
397
|
+
### Runtime Factory
|
|
503
398
|
|
|
504
|
-
|
|
505
|
-
uv run poe lint # Must pass
|
|
506
|
-
uv run poe test # Must pass
|
|
507
|
-
uv run poe typecheck # Review errors (pre-existing issues exist)
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
### Option 2: Using uv run (Fallback)
|
|
511
|
-
|
|
512
|
-
```bash
|
|
513
|
-
cd /Users/sinanalyuruk/Vscode/ayder-cli
|
|
514
|
-
|
|
515
|
-
# 1. Linting (must pass)
|
|
516
|
-
uv run ruff check src/ tests/
|
|
517
|
-
|
|
518
|
-
# 2. Type checking (review errors)
|
|
519
|
-
uv run mypy src/
|
|
520
|
-
|
|
521
|
-
# 3. Tests (must pass)
|
|
522
|
-
uv run pytest tests/ -x --timeout=30 --ignore=tests/ui/test_tui_chat_loop.py
|
|
523
|
-
|
|
524
|
-
# 4. All checks in one go
|
|
525
|
-
uv run ruff check src/ tests/ && echo "✅ Ruff passed" || echo "❌ Ruff failed"
|
|
526
|
-
uv run pytest tests/ -x --timeout=30 --ignore=tests/ui/test_tui_chat_loop.py -q && echo "✅ Tests passed" || echo "❌ Tests failed"
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
### Option 3: Manual venv (Last Resort)
|
|
530
|
-
|
|
531
|
-
```bash
|
|
532
|
-
cd /Users/sinanalyuruk/Vscode/ayder-cli
|
|
533
|
-
source .venv/bin/activate
|
|
534
|
-
|
|
535
|
-
# 1. Linting (must pass)
|
|
536
|
-
python3 -m ruff check src/ tests/
|
|
537
|
-
|
|
538
|
-
# 2. Type checking (review errors)
|
|
539
|
-
python3 -m mypy src/
|
|
540
|
-
|
|
541
|
-
# 3. Tests (must pass)
|
|
542
|
-
python3 -m pytest tests/ -x --timeout=30 --ignore=tests/ui/test_tui_chat_loop.py
|
|
543
|
-
|
|
544
|
-
deactivate
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
## Common Issues & Fixes
|
|
548
|
-
|
|
549
|
-
### Unused Imports
|
|
550
|
-
|
|
551
|
-
```bash
|
|
552
|
-
# Using poe
|
|
553
|
-
uv run poe lint-fix
|
|
554
|
-
|
|
555
|
-
# Using uv run
|
|
556
|
-
uv run ruff check src/ --fix
|
|
557
|
-
|
|
558
|
-
# Using manual venv
|
|
559
|
-
source .venv/bin/activate && python3 -m ruff check src/ --fix && deactivate
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
### Type Errors
|
|
563
|
-
|
|
564
|
-
```python
|
|
565
|
-
# Error: Incompatible default for argument "x" (default has type "None")
|
|
566
|
-
# Fix: Add | None annotation
|
|
567
|
-
def func(x: str | None = None) -> None: ...
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
### Test Failures
|
|
571
|
-
|
|
572
|
-
```bash
|
|
573
|
-
# Using poe
|
|
574
|
-
uv run poe test-verbose
|
|
575
|
-
|
|
576
|
-
# Using uv run
|
|
577
|
-
uv run pytest tests/test_failing.py -vvs
|
|
578
|
-
|
|
579
|
-
# Using manual venv
|
|
580
|
-
source .venv/bin/activate && python3 -m pytest tests/test_failing.py -vvs && deactivate
|
|
581
|
-
```
|
|
582
|
-
|
|
583
|
-
## Project-Specific Guidelines
|
|
584
|
-
|
|
585
|
-
### Architecture
|
|
586
|
-
|
|
587
|
-
- **Core**: `src/ayder_cli/core/` - Configuration, context, result types
|
|
588
|
-
- **Tools**: `src/ayder_cli/tools/` - Tool implementations and registry
|
|
589
|
-
- **TUI**: `src/ayder_cli/tui/` - Textual-based terminal UI
|
|
590
|
-
- **Services**: `src/ayder_cli/services/` - LLM providers, tool executor
|
|
399
|
+
`application/runtime_factory.py` provides `create_runtime()` — the single composition root used by both CLI and TUI. It assembles a `RuntimeComponents` dataclass containing: `config`, `llm_provider`, `process_manager`, `project_ctx`, `tool_registry`, `memory_manager`, `system_prompt`.
|
|
591
400
|
|
|
592
401
|
### Pluggable Tool System
|
|
593
402
|
|
|
@@ -596,7 +405,7 @@ ayder-cli features a **pluggable tool architecture** with dynamic auto-discovery
|
|
|
596
405
|
**Adding a New Tool:**
|
|
597
406
|
1. Create `src/ayder_cli/tools/builtins/mytool_definitions.py` with `TOOL_DEFINITIONS` tuple
|
|
598
407
|
2. Implement the tool function in `src/ayder_cli/tools/builtins/mytool.py`
|
|
599
|
-
3. **Auto-discovery and validation handle the rest** — no manual registration
|
|
408
|
+
3. **Auto-discovery and validation handle the rest** — no manual registration needed
|
|
600
409
|
|
|
601
410
|
**Tool Definition Pattern:**
|
|
602
411
|
```python
|
|
@@ -610,42 +419,42 @@ TOOL_DEFINITIONS: tuple[ToolDefinition, ...] = (
|
|
|
610
419
|
func_ref="ayder_cli.tools.builtins.mytool:my_function",
|
|
611
420
|
parameters={...},
|
|
612
421
|
permission="r",
|
|
422
|
+
tags=("core",), # Tag for plugin filtering
|
|
423
|
+
system_prompt="", # Optional prompt injected when tool is enabled
|
|
613
424
|
),
|
|
614
425
|
)
|
|
615
426
|
```
|
|
616
427
|
|
|
617
|
-
**Current Tools (
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
428
|
+
**Current Tools (25 total):**
|
|
429
|
+
|
|
430
|
+
| Category | Tag | Tools |
|
|
431
|
+
|----------|-----|-------|
|
|
432
|
+
| **Filesystem** | `core` | `file_explorer`, `read_file`, `file_editor` |
|
|
433
|
+
| **Search** | `core` | `search_codebase`, `get_project_structure` |
|
|
434
|
+
| **Shell** | `core` | `run_shell_command` |
|
|
435
|
+
| **Memory** | `metadata` | `save_memory`, `load_memory` |
|
|
436
|
+
| **Notes** | `metadata` | `create_note` |
|
|
437
|
+
| **Tasks** | `metadata` | `list_tasks`, `show_task` |
|
|
438
|
+
| **Python Editor** | `python` | `python_editor` (CST-based structural editing) |
|
|
439
|
+
| **Background Processes** | `background` | `run_background_process`, `get_background_output`, `kill_background_process`, `list_background_processes` |
|
|
440
|
+
| **Virtual Environments** | `venv` | `create_virtualenv`, `install_requirements`, `list_virtualenvs`, `activate_virtualenv`, `remove_virtualenv` |
|
|
441
|
+
| **Web** | `http` | `fetch_web` |
|
|
442
|
+
| **DBS** | `dbs` | `dbs_tool` (RAG API for DBS issues) |
|
|
443
|
+
| **Environment** | `env` | `manage_environment_vars` |
|
|
444
|
+
| **Temporal** | `temporal` | `temporal_workflow` |
|
|
445
|
+
|
|
446
|
+
**Tag System:** Tools are filtered by tags. Default enabled tags: `["core", "metadata"]`. Use `/plugin` in TUI to toggle additional tags at runtime.
|
|
630
447
|
|
|
631
448
|
**Discovery Features:**
|
|
632
449
|
- Automatic detection of `*_definitions.py` files at import time
|
|
633
450
|
- Duplicate tool name validation
|
|
634
|
-
- Registry-backed input validation
|
|
635
|
-
-
|
|
636
|
-
- Zero maintenance overhead
|
|
451
|
+
- Registry-backed input validation via `SchemaValidator`
|
|
452
|
+
- Tool-specific system prompts injected dynamically via `registry.get_system_prompts(tags)`
|
|
637
453
|
|
|
638
454
|
### Registry-Backed Validation
|
|
639
455
|
|
|
640
456
|
`SchemaValidator` (in `application/validation.py`) derives required-argument lists directly from `TOOL_DEFINITIONS_BY_NAME` — the same live registry the executor uses. There is **no hardcoded tool list** to keep in sync.
|
|
641
457
|
|
|
642
|
-
**Source of truth**: `ToolDefinition.parameters["required"]` in each `*_definitions.py` file.
|
|
643
|
-
|
|
644
|
-
Consequences:
|
|
645
|
-
- Adding a tool: create the `*_definitions.py` file — validation recognises it automatically.
|
|
646
|
-
- Changing required params: update `ToolDefinition.parameters["required"]` — validation is immediately correct.
|
|
647
|
-
- `SchemaValidator` uses a lazy import (`from ayder_cli.tools.definition import TOOL_DEFINITIONS_BY_NAME` inside the method body) to avoid circular imports at module load time.
|
|
648
|
-
|
|
649
458
|
### Key Patterns
|
|
650
459
|
|
|
651
460
|
1. **Tool Results**: Use `ToolSuccess` and `ToolError` from `core.result`
|
|
@@ -653,58 +462,32 @@ Consequences:
|
|
|
653
462
|
3. **Config**: Use `load_config()` for configuration access
|
|
654
463
|
4. **Console Output**: Use `console` from `ayder_cli.console` for Rich output
|
|
655
464
|
|
|
465
|
+
## Pre-Commit Checklist
|
|
656
466
|
|
|
467
|
+
```bash
|
|
468
|
+
# Run all checks (lint + typecheck + test)
|
|
469
|
+
uv run poe check-all
|
|
657
470
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
- **docs/**: Additional documentation
|
|
664
|
-
- **tests/**: Test suites mirror source structure
|
|
471
|
+
# Or individually:
|
|
472
|
+
uv run poe lint # Must pass
|
|
473
|
+
uv run poe test # Must pass
|
|
474
|
+
uv run poe typecheck # Review errors (pre-existing issues may exist)
|
|
475
|
+
```
|
|
665
476
|
|
|
666
477
|
## Quick Reference
|
|
667
478
|
|
|
668
|
-
### Priority 1: Using `poe` (Recommended)
|
|
669
|
-
|
|
670
|
-
| Task | Command | Plugins Used |
|
|
671
|
-
|------|---------|--------------|
|
|
672
|
-
| Install dev deps | `/opt/homebrew/bin/uv pip install -e ".[dev]"` | - |
|
|
673
|
-
| Run tests | `uv run poe test` | timeout, instafail, sugar |
|
|
674
|
-
| Run tests (fast) | `uv run poe test-fast` | + xdist (parallel) |
|
|
675
|
-
| Run tests (coverage) | `uv run poe test-cov` | + cov |
|
|
676
|
-
| Run all tests | `uv run poe test-all` | timeout, instafail, sugar |
|
|
677
|
-
| Run tests (verbose) | `uv run poe test-verbose` | timeout, instafail, sugar |
|
|
678
|
-
| Lint | `uv run poe lint` | - |
|
|
679
|
-
| Lint & fix | `uv run poe lint-fix` | - |
|
|
680
|
-
| Type check | `uv run poe typecheck` | - |
|
|
681
|
-
| Clean caches | `uv run poe clean` | - |
|
|
682
|
-
| All checks | `uv run poe check-all` | lint + typecheck + test |
|
|
683
|
-
|
|
684
|
-
### Priority 2: Using `uv run` (Fallback)
|
|
685
|
-
|
|
686
|
-
| Task | Command |
|
|
687
|
-
|------|---------|
|
|
688
|
-
| Run tests | `uv run pytest tests/ -x --timeout=30` |
|
|
689
|
-
| Run tests (fast) | `uv run pytest tests/ -n auto --timeout=30` |
|
|
690
|
-
| Lint | `uv run ruff check src/` |
|
|
691
|
-
| Lint & fix | `uv run ruff check src/ --fix` |
|
|
692
|
-
| Type check | `uv run mypy src/` |
|
|
693
|
-
| Coverage | `uv run pytest tests/ --cov=src/ayder_cli` |
|
|
694
|
-
|
|
695
|
-
### Priority 3: Manual venv (Last Resort)
|
|
696
|
-
|
|
697
479
|
| Task | Command |
|
|
698
480
|
|------|---------|
|
|
699
|
-
|
|
|
700
|
-
| Run tests | `
|
|
701
|
-
|
|
|
702
|
-
|
|
|
703
|
-
|
|
|
481
|
+
| Install dev deps | `/opt/homebrew/bin/uv pip install -e ".[dev]"` |
|
|
482
|
+
| Run tests | `uv run poe test` |
|
|
483
|
+
| Run tests (fast) | `uv run poe test-fast` |
|
|
484
|
+
| Run tests (coverage) | `uv run poe test-cov` |
|
|
485
|
+
| Lint | `uv run poe lint` |
|
|
486
|
+
| Lint & fix | `uv run poe lint-fix` |
|
|
487
|
+
| Type check | `uv run poe typecheck` |
|
|
488
|
+
| All checks | `uv run poe check-all` |
|
|
489
|
+
| Clean caches | `uv run poe clean` |
|
|
704
490
|
|
|
705
491
|
---
|
|
706
492
|
|
|
707
|
-
**Remember**:
|
|
708
|
-
- When in doubt, run `uv run poe check-all`
|
|
709
|
-
- For architecture questions, module relationships, or TUI structure, see [docs/PROJECT_STRUCTURE.md](docs/PROJECT_STRUCTURE.md)
|
|
710
|
-
- All changes should maintain or improve test coverage
|
|
493
|
+
**Remember**: When in doubt, run `uv run poe check-all`.
|