From f1ea392c1c10509aebefbad1d9b5cf38bea972b6 Mon Sep 17 00:00:00 2001 From: worldmozara Date: Wed, 15 Jul 2026 10:15:26 +0800 Subject: [PATCH] core/tools: register glob_paths and grep_files in DEFAULT_TOOLS Wire new search tools into FILE_TOOLS and document them. --- CLAUDE.md | 2 +- src/plyngent/tools/__init__.py | 2 ++ src/plyngent/tools/file/__init__.py | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 215da48..6861b01 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -65,7 +65,7 @@ Async SQLAlchemy + aiosqlite. `MemoryStore`: schema init (+ lightweight SQLite ` Module-level `@tool` handlers. Call `set_workspace_root()` before use. - **`workspace`**: path resolve under root; path substring denylist; command basename denylist; clearer deny messages. -- **`file`**: `read_file`, `write_file`, `listdir`, `tree`, `edit_replace`, `edit_lineno` (1-based range), `copy_path` / `move_path` / `delete_path`. +- **`file`**: `read_file`, `write_file`, `listdir`, `tree`, `glob_paths`, `grep_files` (regex, skip VCS/binary), `edit_replace`, `edit_lineno` (1-based range), `copy_path` / `move_path` / `delete_path`. - **`process`**: `run_command` (argv, no shell, timeout, optional stdin/env); PTY `open_pty` / `read_pty` / `write_pty` / `close_pty` (**Unix only**: `pty`+`fork`). - 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. diff --git a/src/plyngent/tools/__init__.py b/src/plyngent/tools/__init__.py index 91a36d0..e608a53 100644 --- a/src/plyngent/tools/__init__.py +++ b/src/plyngent/tools/__init__.py @@ -4,6 +4,8 @@ from .file import copy_path as copy_path from .file import delete_path as delete_path from .file import edit_lineno as edit_lineno from .file import edit_replace as edit_replace +from .file import glob_paths as glob_paths +from .file import grep_files as grep_files from .file import listdir as listdir from .file import move_path as move_path from .file import read_file as read_file diff --git a/src/plyngent/tools/file/__init__.py b/src/plyngent/tools/file/__init__.py index 784192f..427a5c8 100644 --- a/src/plyngent/tools/file/__init__.py +++ b/src/plyngent/tools/file/__init__.py @@ -3,6 +3,8 @@ from .edit_replace import edit_replace as edit_replace from .fs_ops import copy_path as copy_path from .fs_ops import delete_path as delete_path from .fs_ops import move_path as move_path +from .glob_paths import glob_paths as glob_paths +from .grep_files import grep_files as grep_files from .listdir import listdir as listdir from .read import read_file as read_file from .tree import tree as tree @@ -13,6 +15,8 @@ FILE_TOOLS = [ write_file, listdir, tree, + glob_paths, + grep_files, edit_replace, edit_lineno, copy_path,