claude-memory-layer 1.0.14 → 1.0.16
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/.npm-cache/_cacache/content-v2/sha512/04/76/c098f88dfe584a2b80870bff7421b05d17d3d9ee1027f77772332a22d3f93a9a57101a2855107f6ad82077a818bba912b2bc317f2361b5ddb09ad284d9ce +0 -0
- package/.npm-cache/_cacache/content-v2/sha512/60/25/d2ecd39cfc7cab58351162814be77f935c6d6491c10c3745d456da7ddb2117ffd90c10e53fe3c0f1ed16b403307841543634504398b16ee4e6b6dd8e0c45 +0 -0
- package/.npm-cache/_cacache/index-v5/2b/9a/7f8f40206ed8a2e0a84efaa953ccaed1f5d001e14b931083f2e7a0738007 +2 -0
- package/.npm-cache/_cacache/index-v5/2e/d9/fcfa5c6a6abdc2a3644ab84a95936047298c465a2f47ee03db8f7fe1e946 +3 -0
- package/.npm-cache/_cacache/index-v5/a9/42/e519633356d12d3d2f19da66a8301016d496c8f5c3e0554124aaa62dc043 +2 -0
- package/.npm-cache/_logs/2026-02-26T12_04_52_729Z-debug-0.log +256 -0
- package/.npm-cache/_logs/2026-02-26T12_05_36_835Z-debug-0.log +18 -0
- package/.npm-cache/_logs/2026-02-26T12_05_45_982Z-debug-0.log +32 -0
- package/.npm-cache/_logs/2026-02-26T12_05_48_515Z-debug-0.log +260 -0
- package/.npm-cache/_logs/2026-02-26T12_05_53_567Z-debug-0.log +69 -0
- package/.npm-cache/_update-notifier-last-checked +0 -0
- package/README.md +3 -0
- package/claude-memory-layer-1.0.14.tgz +0 -0
- package/dist/cli/index.js +63 -48
- package/dist/cli/index.js.map +2 -2
- package/dist/core/index.js +53 -40
- package/dist/core/index.js.map +2 -2
- package/dist/hooks/post-tool-use.js +53 -40
- package/dist/hooks/post-tool-use.js.map +2 -2
- package/dist/hooks/session-end.js +53 -40
- package/dist/hooks/session-end.js.map +2 -2
- package/dist/hooks/session-start.js +53 -40
- package/dist/hooks/session-start.js.map +2 -2
- package/dist/hooks/stop.js +53 -40
- package/dist/hooks/stop.js.map +2 -2
- package/dist/hooks/user-prompt-submit.js +72 -43
- package/dist/hooks/user-prompt-submit.js.map +2 -2
- package/dist/server/api/index.js +53 -40
- package/dist/server/api/index.js.map +2 -2
- package/dist/server/index.js +53 -40
- package/dist/server/index.js.map +2 -2
- package/dist/services/memory-service.js +53 -40
- package/dist/services/memory-service.js.map +2 -2
- package/memory/_index.md +2 -0
- package/memory/tool_observation/uncategorized/2026-02-26.md +201 -0
- package/memory/user_prompt/uncategorized/2026-02-26.md +10 -0
- package/package.json +1 -1
- package/src/core/sqlite-event-store.ts +52 -40
- package/src/hooks/user-prompt-submit.ts +22 -3
- package/src/services/session-history-importer.ts +15 -7
package/dist/hooks/stop.js
CHANGED
|
@@ -2036,49 +2036,62 @@ var SQLiteEventStore = class {
|
|
|
2036
2036
|
}
|
|
2037
2037
|
async getRecentRetrievalTraces(limit = 50) {
|
|
2038
2038
|
await this.initialize();
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2039
|
+
try {
|
|
2040
|
+
const rows = sqliteAll(
|
|
2041
|
+
this.db,
|
|
2042
|
+
`SELECT * FROM retrieval_traces ORDER BY created_at DESC LIMIT ?`,
|
|
2043
|
+
[limit]
|
|
2044
|
+
);
|
|
2045
|
+
return rows.map((row) => ({
|
|
2046
|
+
traceId: row.trace_id,
|
|
2047
|
+
sessionId: row.session_id || void 0,
|
|
2048
|
+
projectHash: row.project_hash || void 0,
|
|
2049
|
+
queryText: row.query_text,
|
|
2050
|
+
strategy: row.strategy || void 0,
|
|
2051
|
+
candidateEventIds: row.candidate_event_ids ? JSON.parse(row.candidate_event_ids) : [],
|
|
2052
|
+
selectedEventIds: row.selected_event_ids ? JSON.parse(row.selected_event_ids) : [],
|
|
2053
|
+
candidateDetails: row.candidate_details_json ? JSON.parse(row.candidate_details_json) : [],
|
|
2054
|
+
selectedDetails: row.selected_details_json ? JSON.parse(row.selected_details_json) : [],
|
|
2055
|
+
candidateCount: Number(row.candidate_count || 0),
|
|
2056
|
+
selectedCount: Number(row.selected_count || 0),
|
|
2057
|
+
confidence: row.confidence || void 0,
|
|
2058
|
+
fallbackTrace: row.fallback_trace ? JSON.parse(row.fallback_trace) : [],
|
|
2059
|
+
createdAt: toDateFromSQLite(row.created_at)
|
|
2060
|
+
}));
|
|
2061
|
+
} catch (err) {
|
|
2062
|
+
if (err?.message?.includes("no such table"))
|
|
2063
|
+
return [];
|
|
2064
|
+
throw err;
|
|
2065
|
+
}
|
|
2060
2066
|
}
|
|
2061
2067
|
async getRetrievalTraceStats() {
|
|
2062
2068
|
await this.initialize();
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2069
|
+
try {
|
|
2070
|
+
const row = sqliteGet(
|
|
2071
|
+
this.db,
|
|
2072
|
+
`SELECT
|
|
2073
|
+
COUNT(*) as total_queries,
|
|
2074
|
+
AVG(candidate_count) as avg_candidate_count,
|
|
2075
|
+
AVG(selected_count) as avg_selected_count,
|
|
2076
|
+
CASE
|
|
2077
|
+
WHEN SUM(candidate_count) > 0 THEN (SUM(selected_count) * 1.0 / SUM(candidate_count))
|
|
2078
|
+
ELSE 0
|
|
2079
|
+
END as selection_rate
|
|
2080
|
+
FROM retrieval_traces`,
|
|
2081
|
+
[]
|
|
2082
|
+
);
|
|
2083
|
+
return {
|
|
2084
|
+
totalQueries: Number(row?.total_queries || 0),
|
|
2085
|
+
avgCandidateCount: Number(row?.avg_candidate_count || 0),
|
|
2086
|
+
avgSelectedCount: Number(row?.avg_selected_count || 0),
|
|
2087
|
+
selectionRate: Number(row?.selection_rate || 0)
|
|
2088
|
+
};
|
|
2089
|
+
} catch (err) {
|
|
2090
|
+
if (err?.message?.includes("no such table")) {
|
|
2091
|
+
return { totalQueries: 0, avgCandidateCount: 0, avgSelectedCount: 0, selectionRate: 0 };
|
|
2092
|
+
}
|
|
2093
|
+
throw err;
|
|
2094
|
+
}
|
|
2082
2095
|
}
|
|
2083
2096
|
/**
|
|
2084
2097
|
* Close database connection
|