-
Notifications
You must be signed in to change notification settings - Fork 88
feat: target-aware hook event diagnostics #541
Copy link
Copy link
Open
Description
Summary
When APM deploys hooks for a package, it should log which hook event names were found and note if they may not be recognized by the target platform. Currently APM silently deploys all events regardless of target.
Background
The hooks specification has no unified standard — three implementations exist with divergent event names and schemas:
| Platform | Event naming | Example events | Spec reference |
|---|---|---|---|
| GitHub Copilot Agent (cloud/CLI) | camelCase | sessionStart, preToolUse, postToolUse, userPromptSubmitted |
docs.github.com |
| VS Code (Copilot Chat extension) | PascalCase | SessionStart, PreToolUse, PostToolUse, UserPromptSubmit |
code.visualstudio.com |
| Claude Code | PascalCase | SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, PermissionRequest, FileChanged |
code.claude.com |
Additionally, each platform supports different events — Claude Code has 25+ events, while GH Agent has 8.
Proposed Behavior
When deploying hooks to a target (e.g., copilot, claude, cursor, codex):
- Log the event names found in the hook JSON (e.g.,
"Deployed 3 hook events: preToolUse, postToolUse, sessionStart") - Optionally note if events use a naming convention that may not match the target (e.g.,
"Note: camelCase events detected — these are GitHub Copilot Agent format; VS Code expects PascalCase")
Scope
- Informational only — do NOT block deployment
- Emit via existing
logger.infoor diagnostics mechanism - Consider a future
--strictmode that warns on unrecognized events per target
Related
- Issue Bug: Hook integrator does not process 'windows' property – scripts not copied and paths not rewritten #520 — original hooks bug (missing
windowskey) - The hook command keys (
command,bash,powershell,windows,linux,osx) are already handled as a superset; this issue addresses the event name dimension
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels