Files
wehub-resource-sync adc62957a7
CI / Multi-repo Path Gate (AST-grep) (windows-latest) (push) Has been cancelled
CI / Version Consistency Check (push) Has been cancelled
CI / npm pack + install test (push) Has been cancelled
CI / Lint & Type Check (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Test (Windows path suite) (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / No Committed Build Artifacts (push) Has been cancelled
CI / Multi-repo Path Gate (AST-grep) (ubuntu-latest) (push) Has been cancelled
Upgrade Test / omc update + session-start hook (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:36:54 +08:00

30 lines
906 B
JavaScript
Executable File

#!/usr/bin/env node
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
import { readStdin } from './lib/stdin.mjs';
async function main() {
// Read stdin with reduced timeout for SessionEnd — the input payload is small
// and doesn't need the default 5s wait. This saves ~4s toward the hook timeout (#1700).
const input = await readStdin(1000);
const fallback = { continue: true, suppressOutput: true };
if (input.trim().length === 0) {
console.log(JSON.stringify(fallback));
return;
}
try {
const data = JSON.parse(input);
const { processSessionEnd } = await import('../dist/hooks/session-end/index.js');
const result = await processSessionEnd(data);
console.log(JSON.stringify(result));
} catch (error) {
console.error('[session-end] Error:', error.message);
console.log(JSON.stringify(fallback));
}
}
main();