feat(knowledge): add cli and update docs

This commit is contained in:
zhayujie
2026-04-12 16:39:06 +08:00
parent ea78e3d0c6
commit a1d82f6193
34 changed files with 956 additions and 208 deletions

View File

@@ -85,7 +85,11 @@ class MemoryGetTool(BaseTool):
if not path.startswith('memory/') and not path.startswith('knowledge/') and not path.startswith('/') and path != 'MEMORY.md':
path = f'memory/{path}'
file_path = workspace_dir / path
file_path = (workspace_dir / path).resolve()
workspace_resolved = workspace_dir.resolve()
if not str(file_path).startswith(str(workspace_resolved) + '/') and file_path != workspace_resolved:
return ToolResult.fail(f"Error: Access denied: path outside workspace")
if not file_path.exists():
return ToolResult.fail(f"Error: File not found: {path}")