Consolidate hooks: merge bin/hooks and hooks into single hooks/ directory

- Removed bin/hooks/ wrapper layer
- Moved all hook logic into consolidated hooks/*-hook.ts files
- Each hook now handles its own stdin/stdout/JSON wrapping
- Removed ALL try-catch blocks from context-hook (let errors surface)
- Updated build script to reference new src/hooks/ paths
- Reduced from 12+ files to 6 hook files

This simplifies the architecture and makes debugging actually possible.
This commit is contained in:
Alex Newman
2025-10-25 23:59:43 -04:00
parent d363dfd668
commit e9c0ec45db
20 changed files with 718 additions and 825 deletions
+5 -5
View File
@@ -13,11 +13,11 @@ import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const HOOKS = [
{ name: 'context-hook', source: 'src/bin/hooks/context-hook.ts' },
{ name: 'new-hook', source: 'src/bin/hooks/new-hook.ts' },
{ name: 'save-hook', source: 'src/bin/hooks/save-hook.ts' },
{ name: 'summary-hook', source: 'src/bin/hooks/summary-hook.ts' },
{ name: 'cleanup-hook', source: 'src/bin/hooks/cleanup-hook.ts' }
{ name: 'context-hook', source: 'src/hooks/context-hook.ts' },
{ name: 'new-hook', source: 'src/hooks/new-hook.ts' },
{ name: 'save-hook', source: 'src/hooks/save-hook.ts' },
{ name: 'summary-hook', source: 'src/hooks/summary-hook.ts' },
{ name: 'cleanup-hook', source: 'src/hooks/cleanup-hook.ts' }
];
const WORKER_SERVICE = {