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
25 lines
718 B
JavaScript
25 lines
718 B
JavaScript
#!/usr/bin/env node
|
|
import { readStdin } from './lib/stdin.mjs';
|
|
|
|
async function main() {
|
|
const input = await readStdin(1000);
|
|
try {
|
|
const data = JSON.parse(input);
|
|
const { onPreCompact } = await import('../dist/hooks/wiki/session-hooks.js');
|
|
const result = onPreCompact(data);
|
|
if (result.additionalContext) {
|
|
console.log(JSON.stringify({
|
|
continue: true,
|
|
systemMessage: result.additionalContext,
|
|
}));
|
|
} else {
|
|
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
}
|
|
} catch (error) {
|
|
console.error('[wiki-pre-compact] Error:', error.message);
|
|
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
}
|
|
}
|
|
|
|
main();
|