633f89a5fb
- Added `getObservationById` method to retrieve observations by ID in SessionStore. - Introduced `getSessionSummariesByIds` and `getUserPromptsByIds` methods for fetching session summaries and user prompts by IDs. - Developed `getTimelineAroundTimestamp` and `getTimelineAroundObservation` methods to provide a unified timeline of observations, sessions, and prompts around a specified anchor point. - Enhanced ChromaSync to format and sync user prompts, including a new `syncUserPrompt` method. - Updated WorkerService to sync the latest user prompt to Chroma after updating the worker port. - Created tests for timeline querying and MCP handler logic to ensure functionality. - Documented the implementation plan for user prompts and timeline context tool in the Chroma search completion plan.
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
/**
|
|
* PM2 Ecosystem Configuration for claude-mem Worker Service
|
|
*
|
|
* Usage:
|
|
* pm2 start ecosystem.config.cjs
|
|
* pm2 stop claude-mem-worker
|
|
* pm2 restart claude-mem-worker
|
|
* pm2 logs claude-mem-worker
|
|
* pm2 status
|
|
*/
|
|
|
|
const os = require('os');
|
|
const path = require('path');
|
|
|
|
// Determine log directory
|
|
const logDir = path.join(os.homedir(), '.claude-mem', 'logs');
|
|
|
|
module.exports = {
|
|
apps: [{
|
|
name: 'claude-mem-worker',
|
|
script: './plugin/scripts/worker-service.cjs',
|
|
interpreter: 'node',
|
|
instances: 1,
|
|
exec_mode: 'fork',
|
|
autorestart: true,
|
|
watch: false,
|
|
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
CLAUDE_MEM_WORKER_PORT: 37777, // Fixed port for reliability
|
|
FORCE_COLOR: '1'
|
|
},
|
|
|
|
// Logging
|
|
error_file: path.join(logDir, 'worker-error.log'),
|
|
out_file: path.join(logDir, 'worker-out.log'),
|
|
log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS Z',
|
|
merge_logs: true,
|
|
|
|
// Keep logs from last 7 days
|
|
log_type: 'json',
|
|
|
|
// Process management
|
|
kill_timeout: 1000,
|
|
listen_timeout: 3000,
|
|
shutdown_with_message: true,
|
|
|
|
// PM2 Plus (optional monitoring)
|
|
// instance_var: 'INSTANCE_ID',
|
|
// pmx: true
|
|
}]
|
|
};
|