Repository navigation
chore(agents): install shelltime hooks for agy and cursor #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "shelltime": { | ||
| "SessionStart": [ | ||
| { | ||
| "type": "command", | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent agy --event SessionStart --project) && printf '%s\\n' \"$out\" || echo '{}'", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit (optional): this change adds personal tooling hooks to a Neovim plugin repo. They run |
||
| "timeout": 15 | ||
| } | ||
| ], | ||
| "PreInvocation": [ | ||
| { | ||
| "type": "command", | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent agy --event PreInvocation --project) && printf '%s\\n' \"$out\" || echo '{}'", | ||
| "timeout": 15 | ||
| } | ||
| ], | ||
| "PostToolUse": [ | ||
| { | ||
| "matcher": "*", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent agy --event PostToolUse --project) && printf '%s\\n' \"$out\" || echo '{}'", | ||
| "timeout": 15 | ||
| } | ||
| ] | ||
| } | ||
|
Comment on lines
+17
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Important: the hook schema is inconsistent within this file. Fix: check the agy hooks schema and use one shape consistently. If matchers are needed for tool events, use the nested form where the schema requires it. Otherwise flatten this entry. |
||
| ], | ||
| "PostInvocation": [ | ||
| { | ||
| "type": "command", | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent agy --event PostInvocation --project) && printf '%s\\n' \"$out\" || echo '{}'", | ||
| "timeout": 15 | ||
| } | ||
| ], | ||
| "Stop": [ | ||
| { | ||
| "type": "command", | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent agy --event Stop --project) && printf '%s\\n' \"$out\" || echo '{\"decision\":\"allow\"}'", | ||
| "timeout": 15 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "version": 1, | ||
| "hooks": { | ||
| "beforeSubmitPrompt": [ | ||
| { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Important: in the success path the command can print a bare newline instead of JSON. The shape is Fix: fall back when the output is empty, for example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit (optional): none of the Cursor hook entries sets a |
||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event beforeSubmitPrompt --project) && printf '%s\\n' \"$out\" || echo '{\"continue\":true}'" | ||
| } | ||
| ], | ||
| "postToolUse": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event postToolUse --project) && printf '%s\\n' \"$out\" || echo '{}'" | ||
| } | ||
| ], | ||
| "postToolUseFailure": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event postToolUseFailure --project) && printf '%s\\n' \"$out\" || echo '{}'" | ||
| } | ||
| ], | ||
| "afterAgentResponse": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event afterAgentResponse --project) && printf '%s\\n' \"$out\" || echo '{}'" | ||
| } | ||
| ], | ||
| "stop": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event stop --project) && printf '%s\\n' \"$out\" || echo '{}'" | ||
| } | ||
| ], | ||
| "sessionStart": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event sessionStart --project) && printf '%s\\n' \"$out\" || echo '{}'" | ||
| } | ||
| ], | ||
| "sessionEnd": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event sessionEnd --project) && printf '%s\\n' \"$out\" || echo '{}'" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important (needs checking): every event is nested under a top-level
"shelltime"key. The.cursor/hooks.jsonfile in this PR puts event names under"hooks"with"version": 1. If agy expects event names (SessionStart, ...) at the top level, or underhooks, no hook will ever fire. The failure would be silent.Fix: confirm against the agy hooks file format that a named group such as
shelltimeis a valid wrapper. If it isn't, move the events to where the loader expects them.