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

Class HookRunResult

tutorials/08_hook_system.py:58–72  ·  view source on GitHub ↗

Hook 执行后的结果。 denied: 是否阻止了工具执行 messages: Hook 输出的消息列表(会显示给用户看) 对应源码: hooks.rs:24-47

Source from the content-addressed store, hash-verified

56
57@dataclass
58class HookRunResult:
59 """
60 Hook 执行后的结果。
61
62 denied: 是否阻止了工具执行
63 messages: Hook 输出的消息列表(会显示给用户看)
64
65 对应源码: hooks.rs:24-47
66 """
67 denied: bool = False
68 messages: list[str] = field(default_factory=list)
69
70 @staticmethod
71 def allow(messages: list[str] | None = None) -> "HookRunResult":
72 return HookRunResult(denied=False, messages=messages or [])
73
74
75# ============================================================

Callers 2

allowMethod · 0.70
_run_commandsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected