mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-10 19:33:37 +08:00
fix: align architecture tooling with current hooks docs
This commit is contained in:
committed by
Affaan Mustafa
parent
a50349181a
commit
7705051910
@@ -1927,7 +1927,7 @@ function runTests() {
|
||||
PreToolUse: [{
|
||||
matcher: 'Write',
|
||||
hooks: [{
|
||||
type: 'intercept',
|
||||
type: 'command',
|
||||
command: 'echo test',
|
||||
async: 'yes' // Should be boolean, not string
|
||||
}]
|
||||
@@ -1947,7 +1947,7 @@ function runTests() {
|
||||
PostToolUse: [{
|
||||
matcher: 'Edit',
|
||||
hooks: [{
|
||||
type: 'intercept',
|
||||
type: 'command',
|
||||
command: 'echo test',
|
||||
timeout: -5 // Must be non-negative
|
||||
}]
|
||||
@@ -2105,6 +2105,31 @@ function runTests() {
|
||||
cleanupTestDir(testDir);
|
||||
})) passed++; else failed++;
|
||||
|
||||
console.log('\nRound 82b: validate-hooks (current official events and hook types):');
|
||||
|
||||
if (test('accepts UserPromptSubmit with omitted matcher and prompt/http/agent hooks', () => {
|
||||
const testDir = createTestDir();
|
||||
const hooksJson = JSON.stringify({
|
||||
hooks: {
|
||||
UserPromptSubmit: [
|
||||
{
|
||||
hooks: [
|
||||
{ type: 'prompt', prompt: 'Summarize the request.' },
|
||||
{ type: 'agent', prompt: 'Review for security issues.', model: 'gpt-5.4' },
|
||||
{ type: 'http', url: 'https://example.com/hooks', headers: { Authorization: 'Bearer token' } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
const hooksFile = path.join(testDir, 'hooks.json');
|
||||
fs.writeFileSync(hooksFile, hooksJson);
|
||||
|
||||
const result = runValidatorWithDir('validate-hooks', 'HOOKS_FILE', hooksFile);
|
||||
assert.strictEqual(result.code, 0, 'Should accept current official hook event/type combinations');
|
||||
cleanupTestDir(testDir);
|
||||
})) passed++; else failed++;
|
||||
|
||||
// ── Round 83: validate-agents whitespace-only field, validate-skills empty SKILL.md ──
|
||||
|
||||
console.log('\nRound 83: validate-agents (whitespace-only frontmatter field value):');
|
||||
|
||||
Reference in New Issue
Block a user