834cf4095e
- Implemented context-hook.ts for handling session start events. - Created new-hook.ts for user prompt submission events. - Developed save-hook.ts for post tool use events. - Added summary-hook.ts for handling stop events. - Introduced worker.ts as a standalone background process for the SDK agent. - Each hook reads input from stdin, processes it, and handles errors gracefully.
21 lines
484 B
TypeScript
21 lines
484 B
TypeScript
#!/usr/bin/env bun
|
|
|
|
/**
|
|
* Save Hook Entry Point - PostToolUse
|
|
* Standalone executable for plugin hooks
|
|
*/
|
|
|
|
import { saveHook } from '../../hooks/save.js';
|
|
|
|
// Read input from stdin
|
|
const input = await Bun.stdin.text();
|
|
|
|
try {
|
|
const parsed = input.trim() ? JSON.parse(input) : undefined;
|
|
saveHook(parsed);
|
|
} catch (error: any) {
|
|
console.error(`[claude-mem save-hook error: ${error.message}]`);
|
|
console.log('{"continue": true, "suppressOutput": true}');
|
|
process.exit(0);
|
|
}
|