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

Method __init__

tutorials/04_permission_system.py:147–157  ·  view source on GitHub ↗

参数: active_mode: 当前的权限模式 可以是 PermissionMode 枚举值 或 "prompt"(每次询问) / "allow"(全部允许)

(self, active_mode: PermissionMode | str)

Source from the content-addressed store, hash-verified

145 """
146
147 def __init__(self, active_mode: PermissionMode | str):
148 """
149 参数:
150 active_mode: 当前的权限模式
151 可以是 PermissionMode 枚举值
152 或 "prompt"(每次询问) / "allow"(全部允许)
153 """
154 self.active_mode = active_mode
155 # 每个工具需要的权限等级
156 # 默认所有工具都需要最高权限,然后逐个设置
157 self._tool_requirements: dict[str, PermissionMode] = {}
158
159 def with_tool_requirement(self, tool_name: str, required_mode: PermissionMode) -> "PermissionPolicy":
160 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected