core/tools: include VCS_TOOLS in DEFAULT_TOOLS

Wire vcs tools into the default agent registry and document the
extensible backend design.
This commit is contained in:
2026-07-15 10:22:07 +08:00
parent 5b4d3985b7
commit 0ab1a7f953
2 changed files with 9 additions and 2 deletions
+2 -1
View File
@@ -70,7 +70,8 @@ Module-level `@tool` handlers. Call `set_workspace_root()` before use.
- PTY: structured status (`alive`/`exit_code`/`data`); `read_pty(..., until=)`; session limit/idle TTL/output budget; close SIGTERM→SIGKILL.
- CLI limit hooks: interactive confirm to raise tool-loop rounds, PTY session cap, or PTY output budget.
- Destructive confirms: `classify_danger` + `ToolRegistry(on_confirm=…)`; CLI default deny; config `confirm_destructive` / `path_denylist`.
- **`DEFAULT_TOOLS`**: file + process tool list for a `ToolRegistry`.
- **`vcs`**: read-only VCS tools (`vcs_kind` / `vcs_status` / `vcs_diff` / `vcs_log` / `vcs_branch`) via `VcsBackend` protocol; **git** implemented; detectors are pluggable for other systems.
- **`DEFAULT_TOOLS`**: file + process + vcs tool list for a `ToolRegistry`.
### CLI (`cli/`)
+7 -1
View File
@@ -17,6 +17,12 @@ from .process import open_pty as open_pty
from .process import read_pty as read_pty
from .process import run_command as run_command
from .process import write_pty as write_pty
from .vcs import VCS_TOOLS as VCS_TOOLS
from .vcs import vcs_branch as vcs_branch
from .vcs import vcs_diff as vcs_diff
from .vcs import vcs_kind as vcs_kind
from .vcs import vcs_log as vcs_log
from .vcs import vcs_status as vcs_status
from .workspace import (
DEFAULT_COMMAND_DENYLIST as DEFAULT_COMMAND_DENYLIST,
)
@@ -31,4 +37,4 @@ from .workspace import set_command_denylist as set_command_denylist
from .workspace import set_path_denylist as set_path_denylist
from .workspace import set_workspace_root as set_workspace_root
DEFAULT_TOOLS = [*FILE_TOOLS, *PROCESS_TOOLS]
DEFAULT_TOOLS = [*FILE_TOOLS, *PROCESS_TOOLS, *VCS_TOOLS]