Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/plugins/antigravity/content/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,27 @@
"hooks": [
{
"type": "command",
"command": "sh \"./bin/antigravity-hook.sh\" PostToolUse",
"timeout": 30
"command": "sh \"./bin/antigravity-hook.sh\" PostToolUse"
}
]
}
],
"PreInvocation": [
{
"type": "command",
"command": "sh \"./bin/antigravity-hook.sh\" PreInvocation",
"timeout": 30
"command": "sh \"./bin/antigravity-hook.sh\" PreInvocation"
}
],
"PostInvocation": [
{
"type": "command",
"command": "sh \"./bin/antigravity-hook.sh\" PostInvocation",
"timeout": 30
"command": "sh \"./bin/antigravity-hook.sh\" PostInvocation"
}
],
"Stop": [
{
"type": "command",
"command": "sh \"./bin/antigravity-hook.sh\" Stop",
"timeout": 30
"command": "sh \"./bin/antigravity-hook.sh\" Stop"
}
]
}
Expand Down
30 changes: 15 additions & 15 deletions src/plugins/grok/content/hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
{
"hooks": {
"SessionStart": [
{ "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"UserPromptSubmit": [
{ "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"PreToolUse": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"PostToolUse": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"PostToolUseFailure": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"PermissionDenied": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"Stop": [
{ "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"StopFailure": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"StopCancelled": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"Notification": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"SubagentStart": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"SubagentStop": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"PreCompact": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"PostCompact": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 5 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
],
"SessionEnd": [
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"", "timeout": 15 }] }
{ "matcher": ".*", "hooks": [{ "type": "command", "command": "bash \"${GROK_PLUGIN_ROOT}/hooks/forward.sh\"" }] }
]
}
}
12 changes: 3 additions & 9 deletions src/plugins/grok/test/test_hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,9 @@ with open(sys.argv[1], encoding="utf-8") as handle:
assert "SessionEnd" in hooks, "terminal hook must use exact SessionEnd spelling"
assert "SessionStop" not in hooks, "non-native terminal spelling must not be registered"
for event, groups in hooks.items():
expected_timeout = 15 if event == "SessionEnd" else 5
timeouts = {
hook["timeout"]
for group in groups
for hook in group["hooks"]
}
assert timeouts == {expected_timeout}, (
f"{event} timeout {sorted(timeouts)} != {expected_timeout}"
)
for group in groups:
for hook in group["hooks"]:
assert "timeout" not in hook, f"{event} must use Grok's default timeout"
PY

echo "test: grok hook adapter OK"
2 changes: 0 additions & 2 deletions src/plugins/grok/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ expected = {
}
assert set(hooks) == expected
for event, groups in hooks.items():
expected_timeout = 15 if event == "SessionEnd" else 5
for group in groups:
for hook in group["hooks"]:
assert hook == {
"type": "command",
"command": 'bash "${GROK_PLUGIN_ROOT}/hooks/forward.sh"',
"timeout": expected_timeout,
}
PY

Expand Down
Loading