MCPcopy Create free account
hub / github.com/JordanCoin/codemap / RunHook

Function RunHook

cmd/hooks.go:229–246  ·  view source on GitHub ↗

RunHook executes the named hook with the given project root

(hookName, root string)

Source from the content-addressed store, hash-verified

227
228// RunHook executes the named hook with the given project root
229func RunHook(hookName, root string) error {
230 switch hookName {
231 case "session-start":
232 return hookSessionStart(root)
233 case "pre-edit":
234 return hookPreEdit(root)
235 case "post-edit":
236 return hookPostEdit(root)
237 case "prompt-submit":
238 return hookPromptSubmit(root)
239 case "pre-compact":
240 return hookPreCompact(root)
241 case "session-stop":
242 return hookSessionStop(root)
243 default:
244 return fmt.Errorf("unknown hook: %s\nAvailable: session-start, pre-edit, post-edit, prompt-submit, pre-compact, session-stop", hookName)
245 }
246}
247
248// hookSessionStart shows project structure, starts daemon, and shows hub warnings
249func hookSessionStart(root string) error {

Callers 2

TestRunHookRoutingFunction · 0.85
RunHookWithTimeoutFunction · 0.85

Calls 6

hookSessionStartFunction · 0.85
hookPreEditFunction · 0.85
hookPostEditFunction · 0.85
hookPromptSubmitFunction · 0.85
hookPreCompactFunction · 0.85
hookSessionStopFunction · 0.85

Tested by 1

TestRunHookRoutingFunction · 0.68