Avoid Gemini loading Claude hook events (#139)
This commit is contained in:
@@ -11,7 +11,11 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
const HOOKS_JSON = 'hooks/hooks.json';
|
||||
const HOOKS_JSON = 'hooks/claude-codex-hooks.json';
|
||||
const HOST_PLUGIN_MANIFESTS = [
|
||||
'.claude-plugin/plugin.json',
|
||||
'.codex-plugin/plugin.json',
|
||||
];
|
||||
// cmd.exe variable syntax (%FOO%); PowerShell leaves it literal, breaking the path.
|
||||
const CMD_VAR_SYNTAX = /%[A-Za-z_][A-Za-z0-9_]*%/;
|
||||
// Pull the hooks/<script> a command launches, so we can check it exists.
|
||||
@@ -46,3 +50,10 @@ test('every hook command points at a script that ships in hooks/', () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('Claude and Codex manifests point at the shared host-specific hook config', () => {
|
||||
for (const rel of HOST_PLUGIN_MANIFESTS) {
|
||||
const manifest = JSON.parse(fs.readFileSync(path.join(root, rel), 'utf8'));
|
||||
assert.equal(manifest.hooks, `./${HOOKS_JSON}`, `${rel} must not rely on root hooks auto-discovery`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user