MCPcopy Create free account
hub / github.com/Louisym/MiniCC / WorkspaceOnly

Class WorkspaceOnly

tutorials/18_design_patterns_for_agents.py:814–820  ·  view source on GitHub ↗

WorkspaceOnly 模式: 只允许访问工作区

Source from the content-addressed store, hash-verified

812 def name(self): return "Off"
813
814 class WorkspaceOnly(IsolationStrategy):
815 """WorkspaceOnly 模式: 只允许访问工作区"""
816 def __init__(self, workspace: str):
817 self.workspace = workspace
818 def check_path(self, path):
819 return path.startswith(self.workspace)
820 def name(self): return "WorkspaceOnly"
821
822 class AllowList(IsolationStrategy):
823 """AllowList 模式: 只允许白名单路径"""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected