clawmem 0.2.6 → 0.2.7
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/package.json +1 -1
- package/src/mcp.ts +6 -5
package/package.json
CHANGED
package/src/mcp.ts
CHANGED
|
@@ -878,11 +878,12 @@ This is the recommended entry point for ALL memory queries.`,
|
|
|
878
878
|
if (tokens.length > 0) {
|
|
879
879
|
const minMatch = Math.max(2, Math.ceil(tokens.length / 2));
|
|
880
880
|
const titleHits = store.db.prepare(`
|
|
881
|
-
SELECT
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
881
|
+
SELECT displayPath, title, match_count FROM (
|
|
882
|
+
SELECT collection || '/' || path as displayPath, title, modified_at,
|
|
883
|
+
${tokens.map(() => `(CASE WHEN LOWER(title) LIKE ? THEN 1 ELSE 0 END)`).join(" + ")} as match_count
|
|
884
|
+
FROM documents
|
|
885
|
+
WHERE active = 1 AND invalidated_at IS NULL
|
|
886
|
+
) WHERE match_count >= ?
|
|
886
887
|
ORDER BY match_count DESC, modified_at DESC
|
|
887
888
|
LIMIT ?
|
|
888
889
|
`).all(...tokens.map(t => `%${t}%`), minMatch, limit) as { displayPath: string; title: string; match_count: number }[];
|