Repository navigation
chore(agents): install shelltime hooks for agy and cursor #361
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 '{}'", | ||
| "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 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "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": [ | ||
| { | ||
|
Contributor
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 file is committed to a repository other people clone, so it registers ShellTime hooks for every contributor who opens the repo in Cursor and has |
||
| "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.
Nit (optional): The hook entries carry
"timeout": 15here, while the Cursor entries in.cursor/hooks.jsonhave none. The generator (projectHookCommandinmodel/agent_hooks_common.goand the Cursor installer) makes this difference, so it is not a bug in this PR. A Cursor hook that hangs, for example on a blocked daemon socket, then has no explicit bound, whereashook-ingestonly promises to answer the daemon within 50 ms. Fix: none needed in this PR. If you want a bound, add atimeoutto the Cursor hook generator and regenerate the file.