mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-26 18:35:05 +00:00
26 lines
1.1 KiB
JavaScript
26 lines
1.1 KiB
JavaScript
#!/usr/bin/env node
|
|
const { hookEnabled, readStdin, runExistingHook, transformToClaude } = require('./adapter');
|
|
readStdin().then(raw => {
|
|
try {
|
|
const input = JSON.parse(raw);
|
|
const claudeInput = transformToClaude(input, {
|
|
tool_input: { file_path: input.file_path || input.path || input.file || '' }
|
|
});
|
|
const claudeStr = JSON.stringify(claudeInput);
|
|
|
|
// Accumulate edited paths for batch format+typecheck at stop time.
|
|
if (hookEnabled('post:edit:accumulator', ['standard', 'strict'])) {
|
|
runExistingHook('post-edit-accumulator.js', claudeStr);
|
|
}
|
|
if (hookEnabled('post:edit:console-warn', ['standard', 'strict'])) {
|
|
runExistingHook('post-edit-console-warn.js', claudeStr, { forwardStderr: true });
|
|
}
|
|
if (hookEnabled('post:edit:design-quality-check', ['standard', 'strict'])) {
|
|
runExistingHook('design-quality-check.js', claudeStr, { forwardStderr: true });
|
|
}
|
|
} catch {
|
|
// Cursor post-event hooks fail open on malformed or partial payloads.
|
|
}
|
|
process.stdout.write(raw);
|
|
}).catch(() => process.exit(0));
|