fix(hooks): keep silent hook paths silent (#2987)

* fix(hooks): keep silent hook paths silent

* fix(hooks): harden stream failure handling

* fix(hooks): settle interrupted input streams

* test(hooks): name stream input limits

* test(hooks): isolate PostToolUse dispatcher fixtures
This commit is contained in:
He Dong
2026-09-18 18:42:20 -04:00
committed by GitHub
parent 34de45f210
commit 8bf16ccfec
25 changed files with 1489 additions and 289 deletions
+16 -1
View File
@@ -17,7 +17,11 @@ const CURRENT_PACKAGE_VERSION = JSON.parse(
fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf8')
).version;
const { resolveEccRoot, INLINE_RESOLVE } = require('../../scripts/lib/resolve-ecc-root');
const {
resolveEccRoot,
normalizePluginRootForPlatform,
INLINE_RESOLVE
} = require('../../scripts/lib/resolve-ecc-root');
// Sentinel ECC skill that resolveEccRoot() requires (alongside the script tree)
// before accepting a root for skill consumers. Kept in sync with the module's
@@ -401,6 +405,17 @@ function runTests() {
assert.ok(INLINE_RESOLVE.length > 50, 'Should be a substantial inline expression');
})) passed++; else failed++;
if (test('normalizes Git Bash drive roots for Windows lifecycle loaders', () => {
assert.strictEqual(
normalizePluginRootForPlatform('/c/Users/x/.claude/plugins/ecc', 'win32'),
'C:/Users/x/.claude/plugins/ecc'
);
assert.strictEqual(
normalizePluginRootForPlatform('/workspace/ecc', 'win32'),
'/workspace/ecc'
);
})) passed++; else failed++;
if (test('INLINE_RESOLVE does not contain spread, nested arrays, or escaped quotes', () => {
assert.ok(!INLINE_RESOLVE.includes('...'));
assert.ok(!INLINE_RESOLVE.includes('[['));