fix(mem0-agent): emit the Claude Code manifest at hooks/hooks.json
Claude Code auto-discovers a plugin's hooks at <plugin>/hooks/hooks.json. The generator was writing to hooks/generated/, so the manifest existed but was never loaded and no hook would have fired on install. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
ba1de5f87b
commit
e11d2a4a06
@@ -25,7 +25,7 @@ To wire the hooks into Claude Code, point your plugin/settings config at the gen
|
|||||||
manifest:
|
manifest:
|
||||||
|
|
||||||
```
|
```
|
||||||
hooks/generated/claude-code.hooks.json
|
hooks/hooks.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Non-interactive install (CI, dotfiles, provisioning):
|
Non-interactive install (CI, dotfiles, provisioning):
|
||||||
@@ -100,7 +100,7 @@ matcher, command, timeout, background/blocking flags, local-only contract, and o
|
|||||||
of *why*.
|
of *why*.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 hooks/generate.py # write hooks/generated/claude-code.hooks.json
|
python3 hooks/generate.py # write hooks/hooks.json
|
||||||
python3 hooks/generate.py --check # exit 1 if the committed manifest drifted (run in CI)
|
python3 hooks/generate.py --check # exit 1 if the committed manifest drifted (run in CI)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ defaults:
|
|||||||
editors:
|
editors:
|
||||||
- id: claude-code
|
- id: claude-code
|
||||||
supported: true
|
supported: true
|
||||||
output: "generated/claude-code.hooks.json"
|
output: "hooks.json" # Claude Code auto-discovers <plugin>/hooks/hooks.json
|
||||||
dialect: "claude-code"
|
dialect: "claude-code"
|
||||||
env:
|
env:
|
||||||
MEM0_EDITOR: "claude-code"
|
MEM0_EDITOR: "claude-code"
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ def test_hook_manifest_commands_all_exist():
|
|||||||
"""Guards against the manifest and the CLI drifting apart."""
|
"""Guards against the manifest and the CLI drifting apart."""
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
manifest = pathlib.Path(__file__).resolve().parents[1] / "hooks/generated/claude-code.hooks.json"
|
manifest = pathlib.Path(__file__).resolve().parents[1] / "hooks/hooks.json"
|
||||||
data = json.loads(manifest.read_text())
|
data = json.loads(manifest.read_text())
|
||||||
known = {"setup", "onboard", "context", "observe", "flush", "assist-error",
|
known = {"setup", "onboard", "context", "observe", "flush", "assist-error",
|
||||||
"remember", "forget", "maintain", "health", "stats", "config"}
|
"remember", "forget", "maintain", "health", "stats", "config"}
|
||||||
|
|||||||
Reference in New Issue
Block a user