fix: align Cursor hook contract
This commit is contained in:
1 parent
16e7e7a9a6
commit
4f9108099c
4 files changed
+36
-4
No files matched your search
@@ -8,6 +8,8 @@ Grok Build adapters write native user hook files under `$GROK_HOME/hooks` or `~/
|
||||
|
||||
GitHub Copilot command `preToolUse` hooks deny on crashes and every non-zero exit. Command timeouts continue through the normal permission flow, so `timeout_failure_mode` records that explicit exception when it differs from `failure_mode`.
|
||||
|
||||
Cursor uses the same `preToolUse` and `postToolUse` contract across its CLI and IDE. User, project, and enterprise hook sources merge by documented priority; command exit code `2` denies an action, while per-script `failClosed` controls crash, timeout, and invalid-output behavior.
|
||||
|
||||
`delivery_state` is computed from the `node`, `python`, and `go` adapter flags:
|
||||
|
||||
| State | Meaning |
|
||||
|
||||
@@ -148,20 +148,28 @@
|
||||
"id": "cursor",
|
||||
"name": "Cursor",
|
||||
"vendor": "Anysphere",
|
||||
"surface": "ide",
|
||||
"surface": "cli_and_ide",
|
||||
"integration_mode": "command_hooks",
|
||||
"config_format": "json",
|
||||
"config_paths": [
|
||||
"~/.cursor/hooks.json",
|
||||
".cursor/hooks.json"
|
||||
"/Library/Application Support/Cursor/hooks.json",
|
||||
"/etc/cursor/hooks.json",
|
||||
"C:\\ProgramData\\Cursor\\hooks.json",
|
||||
".cursor/hooks.json",
|
||||
"~/.cursor/hooks.json"
|
||||
],
|
||||
"events": {
|
||||
"before_tool": "preToolUse",
|
||||
"after_tool": "postToolUse"
|
||||
},
|
||||
"event_fields": {
|
||||
"name": "tool_name",
|
||||
"input": "tool_input",
|
||||
"session": "conversation_id"
|
||||
},
|
||||
"blocking": {
|
||||
"mechanism": "exit_code_2",
|
||||
"failure_mode": "fail_open"
|
||||
"failure_mode": "configurable"
|
||||
},
|
||||
"adapters": { "node": true, "python": true, "go": true },
|
||||
"delivery_state": "available",
|
||||
|
||||
Reference in new issue
Block a user