mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
- session-end-marker.js now exports run() function - Enables in-process execution via run-with-flags.js - Avoids spawnSync cross-platform issues on Windows - Maintains backward compatibility with direct CLI execution Fixes #429 Co-authored-by: 阳虎 <yanghu@yanghudeMacBook-Pro.local>
30 lines
678 B
JavaScript
Executable File
30 lines
678 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
/**
|
|
* Session end marker hook - outputs stdin to stdout unchanged.
|
|
* Exports run() for in-process execution (avoids spawnSync issues on Windows).
|
|
*/
|
|
|
|
function run(rawInput) {
|
|
return rawInput || '';
|
|
}
|
|
|
|
// Legacy CLI execution (when run directly)
|
|
if (require.main === module) {
|
|
const MAX_STDIN = 1024 * 1024;
|
|
let raw = '';
|
|
process.stdin.setEncoding('utf8');
|
|
process.stdin.on('data', chunk => {
|
|
if (raw.length < MAX_STDIN) {
|
|
const remaining = MAX_STDIN - raw.length;
|
|
raw += chunk.substring(0, remaining);
|
|
}
|
|
});
|
|
process.stdin.on('end', () => {
|
|
process.stdout.write(raw);
|
|
});
|
|
}
|
|
|
|
module.exports = { run };
|