Add comprehensive documentation for claude-mem codebase and create a test worker script

- Introduced CODEMAP.md detailing project overview, architecture, directory structure, core components, commands, hooks system, SDK, services, shared components, utilities, and key workflows.
- Added a test-worker.sh script to automate testing of the SDK worker, including session creation, worker initiation, socket communication, and cleanup after finalization.
This commit is contained in:
Alex Newman
2025-10-16 13:56:18 -04:00
parent 18aa4f2538
commit 6e9be84a01
10 changed files with 2074 additions and 228 deletions
+16
View File
@@ -174,6 +174,22 @@ program
summaryHook(JSON.parse(input));
});
program
.command('worker <sessionId>')
.description('Run SDK worker process (internal use)')
.action(async (sessionId: string) => {
try {
// Import and run the worker main function
const { main } = await import('../sdk/worker.js');
// Set process.argv so worker can parse sessionId
process.argv[2] = sessionId;
await main();
} catch (error: any) {
console.error(`[SDK Worker] Fatal error: ${error.message}`);
process.exit(1);
}
});
// Helper function to read stdin
async function readStdin(): Promise<string> {
return new Promise((resolve) => {