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
+11
View File
@@ -126,6 +126,16 @@ function resolveEccRoot(options = {}) {
return claudeDir;
}
function normalizePluginRootForPlatform(rootDir, platform = process.platform) {
if (platform !== 'win32' || typeof rootDir !== 'string') return rootDir;
const match = rootDir.match(/^\/([a-zA-Z])(?:\/(.*))?$/);
if (!match) return rootDir;
const [, driveLetter, rest = ''] = match;
return `${driveLetter.toUpperCase()}:/${rest}`;
}
/**
* Compact inline locator for embedding in hooks.json and command .md code blocks.
*
@@ -151,5 +161,6 @@ const INLINE_RESOLVE = `(function(){var p=require('path'),f=require('fs'),o=requ
module.exports = {
resolveEccRoot,
normalizePluginRootForPlatform,
INLINE_RESOLVE,
};