统一公共工具并移除 workspace 专家链路。

将文件/命令/Git/检索能力统一迁入 public,去除重复工具与 local_ 命名前缀,并重命名底层路径守卫模块为 path_guard 以提升语义清晰度。

Made-with: Cursor
This commit is contained in:
oliver 2026-05-01 00:38:31 +08:00
parent 75aec2abe4
commit d0a66d190d
21 changed files with 326 additions and 1012 deletions

View file

@ -9,7 +9,7 @@ from datetime import datetime, timezone
from pathlib import Path
from typing import Any
from oclaw.runtime.tools.experts.workspace.workspace_base import resolve_workspace_path, truncate_text
from oclaw.runtime.tools.path_guard import resolve_workspace_path, truncate_text
@dataclass(frozen=True)
@ -72,7 +72,9 @@ class LocalAdapter:
return {"ok": False, "error_code": "command_required", "error": "command_required"}
try:
timeout_s = max(1, min(int(timeout or 30), 600))
workdir = str(resolve_workspace_path(cwd or (self._cwd or ".")))
# run_command never follows adapter cd state.
# It only uses explicit cwd; otherwise defaults to workspace root (".").
workdir = str(resolve_workspace_path(cwd or "."))
run_kwargs: dict[str, Any] = {
"cwd": workdir,
"shell": True,