feat: Implement Worker Service with session management and SDK integration

- Added WorkerService to handle long-running HTTP service with session management.
- Implemented endpoints for initializing, observing, finalizing, checking status, and deleting sessions.
- Integrated with Claude SDK for processing observations and generating responses.
- Added port allocator utility to dynamically find available ports for the service.
- Configured TypeScript settings for the project.
This commit is contained in:
Alex Newman
2025-10-17 15:59:36 -04:00
parent d6462919cb
commit 372854948c
57 changed files with 7055 additions and 6649 deletions
+8 -5
View File
@@ -1,4 +1,3 @@
#!/usr/bin/env bun
/**
* Context Hook Entry Point - SessionStart
@@ -6,14 +5,18 @@
*/
import { contextHook } from '../../hooks/context.js';
import { stdin } from 'process';
try {
if (process.stdin.isTTY) {
if (stdin.isTTY) {
contextHook();
} else {
const input = await Bun.stdin.text();
const parsed = input.trim() ? JSON.parse(input) : undefined;
contextHook(parsed);
let input = '';
stdin.on('data', (chunk) => input += chunk);
stdin.on('end', () => {
const parsed = input.trim() ? JSON.parse(input) : undefined;
contextHook(parsed);
});
}
} catch (error: any) {
console.error(`[claude-mem context-hook error: ${error.message}]`);