claude-mem-lite 3.30.0 → 3.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/server.mjs +48 -30
- package/tool-schemas.mjs +2 -0
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "claude-mem-lite",
|
|
13
|
-
"version": "3.
|
|
13
|
+
"version": "3.32.0",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Persistent long-term memory for Claude Code via MCP — captures coding decisions, bugfixes, and context across sessions. Hybrid FTS5 + TF-IDF search with episode batching. Single SQLite DB, no external services. A lighter, lower-cost alternative to claude-mem (episode batching + a smaller model; cost savings are an internal estimate, not a measured benchmark)."
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-mem-lite",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.32.0",
|
|
4
4
|
"description": "Persistent long-term memory for Claude Code via MCP — captures coding decisions, bugfixes, and context across sessions. Hybrid FTS5 + TF-IDF search with episode batching. Single SQLite DB, no external services. A lighter, lower-cost alternative to claude-mem (episode batching + a smaller model; cost savings are an internal estimate, not a measured benchmark).",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "sdsrss"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-mem-lite",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.32.0",
|
|
4
4
|
"description": "Persistent long-term memory for Claude Code via MCP — captures coding decisions, bugfixes, and context across sessions. Hybrid FTS5 + TF-IDF search with episode batching. Single SQLite DB, no external services. A lighter, lower-cost alternative to claude-mem (episode batching + a smaller model; cost savings are an internal estimate, not a measured benchmark).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "npm@10.9.2",
|
package/server.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { deepSearch, resolveDeepMode, shouldEscalateToDeep, autoDeepLlmReady } f
|
|
|
14
14
|
import { selectCompressionCandidates, groupByProjectWeek, compressGroup } from './lib/compress-core.mjs';
|
|
15
15
|
import { buildNotLowSignalSql } from './lib/low-signal-patterns.mjs';
|
|
16
16
|
import { resolveAnchorToken, formatAnchorError, resolveQueryAnchor, fetchRecentTimeline, fetchTimelineWindow } from './lib/timeline-core.mjs';
|
|
17
|
-
import { buildSearchFtsQuery, parseDateBounds, coreRunSearchPipeline } from './lib/search-core.mjs';
|
|
17
|
+
import { buildSearchFtsQuery, parseDateBounds, parseDuration, coreRunSearchPipeline } from './lib/search-core.mjs';
|
|
18
18
|
import {
|
|
19
19
|
cleanupBroken, decayAndMarkIdle, boostAccessed, demotePinned, mergeDuplicates,
|
|
20
20
|
recoverOrphanedChildren,
|
|
@@ -346,41 +346,59 @@ server.registerTool(
|
|
|
346
346
|
|
|
347
347
|
// ─── Tool: mem_recent ────────────────────────────────────────────────────────
|
|
348
348
|
|
|
349
|
+
// In-process test seam (mirrors handleSearchForTest, #8743): threads an injected
|
|
350
|
+
// db through the SAME body the registered handler runs. NOTE: a `project` arg is
|
|
351
|
+
// still resolved via resolveProject() against the MODULE db, not the injected one.
|
|
352
|
+
export async function handleRecentForTest(db, args) {
|
|
353
|
+
return runRecent(db, args);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
async function runRecent(db, args) {
|
|
357
|
+
if (args.project) args = { ...args, project: resolveProject(args.project) };
|
|
358
|
+
const limit = args.limit ?? 10;
|
|
359
|
+
const project = args.project || inferProject();
|
|
360
|
+
|
|
361
|
+
const params = [];
|
|
362
|
+
const wheres = ['COALESCE(compressed_into, 0) = 0', 'superseded_at IS NULL'];
|
|
363
|
+
if (project) { wheres.push('project = ?'); params.push(project); }
|
|
364
|
+
// obs_type: observation-type filter (CLI `recent --type` parity). The zod enum
|
|
365
|
+
// already rejected an invalid value before the handler ran.
|
|
366
|
+
if (args.obs_type) { wheres.push('type = ?'); params.push(args.obs_type); }
|
|
367
|
+
// date_since: relative lower bound on created_at (CLI `recent --since` parity).
|
|
368
|
+
if (args.date_since !== undefined) {
|
|
369
|
+
const d = parseDuration(args.date_since);
|
|
370
|
+
if (!d.ok) throw new Error(`Invalid date_since: "${args.date_since}" (use <N><unit>, e.g. 7d, 24h, 90m, 2w)`);
|
|
371
|
+
wheres.push('created_at_epoch >= ?'); params.push(Date.now() - d.ms);
|
|
372
|
+
}
|
|
373
|
+
params.push(limit);
|
|
374
|
+
|
|
375
|
+
const rows = db.prepare(`
|
|
376
|
+
SELECT id, type, title, subtitle, project, created_at, created_at_epoch
|
|
377
|
+
FROM observations
|
|
378
|
+
WHERE ${wheres.join(' AND ')}
|
|
379
|
+
ORDER BY created_at_epoch DESC
|
|
380
|
+
LIMIT ?
|
|
381
|
+
`).all(...params);
|
|
382
|
+
|
|
383
|
+
if (rows.length === 0) {
|
|
384
|
+
return { content: [{ type: 'text', text: `No recent observations${project ? ` (${project})` : ''}.` }] };
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const lines = [`Recent observations (${project || 'all'}):\n`];
|
|
388
|
+
for (const r of rows) {
|
|
389
|
+
lines.push(`#${r.id} ${typeIcon(r.type)} [${r.type}] ${truncate(r.title || r.subtitle || '(untitled)')} | ${r.project} | ${fmtDate(r.created_at)}`);
|
|
390
|
+
}
|
|
391
|
+
lines.push(`\nWorkflow: mem_get(ids=[...]) for full details | mem_timeline(anchor=ID) for context`);
|
|
392
|
+
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
393
|
+
}
|
|
394
|
+
|
|
349
395
|
server.registerTool(
|
|
350
396
|
'mem_recent',
|
|
351
397
|
{
|
|
352
398
|
description: descriptionOf('mem_recent'),
|
|
353
399
|
inputSchema: memRecentSchema,
|
|
354
400
|
},
|
|
355
|
-
safeHandler(async (args) =>
|
|
356
|
-
if (args.project) args = { ...args, project: resolveProject(args.project) };
|
|
357
|
-
const limit = args.limit ?? 10;
|
|
358
|
-
const project = args.project || inferProject();
|
|
359
|
-
|
|
360
|
-
const params = [];
|
|
361
|
-
const wheres = ['COALESCE(compressed_into, 0) = 0', 'superseded_at IS NULL'];
|
|
362
|
-
if (project) { wheres.push('project = ?'); params.push(project); }
|
|
363
|
-
params.push(limit);
|
|
364
|
-
|
|
365
|
-
const rows = db.prepare(`
|
|
366
|
-
SELECT id, type, title, subtitle, project, created_at, created_at_epoch
|
|
367
|
-
FROM observations
|
|
368
|
-
WHERE ${wheres.join(' AND ')}
|
|
369
|
-
ORDER BY created_at_epoch DESC
|
|
370
|
-
LIMIT ?
|
|
371
|
-
`).all(...params);
|
|
372
|
-
|
|
373
|
-
if (rows.length === 0) {
|
|
374
|
-
return { content: [{ type: 'text', text: `No recent observations${project ? ` (${project})` : ''}.` }] };
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
const lines = [`Recent observations (${project || 'all'}):\n`];
|
|
378
|
-
for (const r of rows) {
|
|
379
|
-
lines.push(`#${r.id} ${typeIcon(r.type)} [${r.type}] ${truncate(r.title || r.subtitle || '(untitled)')} | ${r.project} | ${fmtDate(r.created_at)}`);
|
|
380
|
-
}
|
|
381
|
-
lines.push(`\nWorkflow: mem_get(ids=[...]) for full details | mem_timeline(anchor=ID) for context`);
|
|
382
|
-
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
383
|
-
})
|
|
401
|
+
safeHandler(async (args) => runRecent(db, args))
|
|
384
402
|
);
|
|
385
403
|
|
|
386
404
|
// ─── Tool: mem_timeline ─────────────────────────────────────────────────────
|
package/tool-schemas.mjs
CHANGED
|
@@ -101,6 +101,8 @@ export const memSearchSchema = {
|
|
|
101
101
|
export const memRecentSchema = {
|
|
102
102
|
limit: coerceInt.pipe(z.number().int().min(1).max(100)).optional().describe('Max results (default 10)'),
|
|
103
103
|
project: z.string().optional().describe('Filter by project (default: inferred from CWD)'),
|
|
104
|
+
obs_type: OBS_TYPE_ENUM.optional().describe('Filter observation type (e.g. bugfix, decision) — CLI `recent --type` parity'),
|
|
105
|
+
date_since: z.string().optional().describe('Relative lower bound from now: 7d/24h/90m/2w/30s. Only items newer than the window (pair with a high limit for "everything since X")'),
|
|
104
106
|
};
|
|
105
107
|
|
|
106
108
|
// Anchor accepts plain int, "123" string-int, or prefixed token from search output:
|