Merge feature/bun-instead-of-pm2: PM2 to Bun migration v7.1.0

Major architectural migration from PM2 to native Bun process management,
and better-sqlite3 to bun:sqlite database driver.

Key changes:
- Replace PM2 with custom Bun-based ProcessManager
- Migrate from better-sqlite3 npm to bun:sqlite runtime
- Auto-install Bun and uv (Python) on first run
- Automatic legacy PM2 process cleanup on all platforms
- Complete documentation in docs/PM2-TO-BUN-MIGRATION.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2025-12-12 21:12:34 -05:00
79 changed files with 3911 additions and 3363 deletions
+2 -1
View File
@@ -6,9 +6,10 @@
*/
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { sampleObservation, featureObservation } from '../helpers/scenarios.js';
import { getWorkerPort } from '../../src/shared/worker-utils.js';
describe('Context Injection (SessionStart)', () => {
const WORKER_PORT = 37777;
const WORKER_PORT = getWorkerPort();
const PROJECT_NAME = 'claude-mem';
beforeEach(() => {
@@ -14,9 +14,10 @@ import {
grepScenario,
sessionScenario
} from '../helpers/scenarios.js';
import { getWorkerPort } from '../../src/shared/worker-utils.js';
describe('Observation Capture (PostToolUse)', () => {
const WORKER_PORT = 37777;
const WORKER_PORT = getWorkerPort();
beforeEach(() => {
vi.clearAllMocks();
+2 -1
View File
@@ -6,9 +6,10 @@
*/
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { sampleObservation, featureObservation } from '../helpers/scenarios.js';
import { getWorkerPort } from '../../src/shared/worker-utils.js';
describe('Search (MCP Tools)', () => {
const WORKER_PORT = 37777;
const WORKER_PORT = getWorkerPort();
beforeEach(() => {
vi.clearAllMocks();
+2 -1
View File
@@ -6,9 +6,10 @@
*/
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { sessionScenario } from '../helpers/scenarios.js';
import { getWorkerPort } from '../../src/shared/worker-utils.js';
describe('Session Cleanup (SessionEnd)', () => {
const WORKER_PORT = 37777;
const WORKER_PORT = getWorkerPort();
beforeEach(() => {
vi.clearAllMocks();
+2 -1
View File
@@ -6,9 +6,10 @@
*/
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { bashCommandScenario, sessionScenario } from '../helpers/scenarios.js';
import { getWorkerPort } from '../../src/shared/worker-utils.js';
describe('Session Initialization (UserPromptSubmit)', () => {
const WORKER_PORT = 37777;
const WORKER_PORT = getWorkerPort();
beforeEach(() => {
vi.clearAllMocks();
+2 -1
View File
@@ -6,9 +6,10 @@
*/
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { sessionSummaryScenario, sessionScenario } from '../helpers/scenarios.js';
import { getWorkerPort } from '../../src/shared/worker-utils.js';
describe('Session Summary (Stop)', () => {
const WORKER_PORT = 37777;
const WORKER_PORT = getWorkerPort();
beforeEach(() => {
vi.clearAllMocks();
+2 -1
View File
@@ -11,9 +11,10 @@ import {
sessionScenario,
sampleObservation
} from '../helpers/scenarios.js';
import { getWorkerPort } from '../../src/shared/worker-utils.js';
describe('Full Observation Lifecycle', () => {
const WORKER_PORT = 37777;
const WORKER_PORT = getWorkerPort();
let sessionId: string;
beforeEach(() => {