claude-memory-layer 1.0.15 → 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/README.md +3 -0
- package/dist/cli/index.js +54 -41
- 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
|
@@ -2032,49 +2032,62 @@ var SQLiteEventStore = class {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
async getRecentRetrievalTraces(limit = 50) {
|
|
2034
2034
|
await this.initialize();
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2035
|
+
try {
|
|
2036
|
+
const rows = sqliteAll(
|
|
2037
|
+
this.db,
|
|
2038
|
+
`SELECT * FROM retrieval_traces ORDER BY created_at DESC LIMIT ?`,
|
|
2039
|
+
[limit]
|
|
2040
|
+
);
|
|
2041
|
+
return rows.map((row) => ({
|
|
2042
|
+
traceId: row.trace_id,
|
|
2043
|
+
sessionId: row.session_id || void 0,
|
|
2044
|
+
projectHash: row.project_hash || void 0,
|
|
2045
|
+
queryText: row.query_text,
|
|
2046
|
+
strategy: row.strategy || void 0,
|
|
2047
|
+
candidateEventIds: row.candidate_event_ids ? JSON.parse(row.candidate_event_ids) : [],
|
|
2048
|
+
selectedEventIds: row.selected_event_ids ? JSON.parse(row.selected_event_ids) : [],
|
|
2049
|
+
candidateDetails: row.candidate_details_json ? JSON.parse(row.candidate_details_json) : [],
|
|
2050
|
+
selectedDetails: row.selected_details_json ? JSON.parse(row.selected_details_json) : [],
|
|
2051
|
+
candidateCount: Number(row.candidate_count || 0),
|
|
2052
|
+
selectedCount: Number(row.selected_count || 0),
|
|
2053
|
+
confidence: row.confidence || void 0,
|
|
2054
|
+
fallbackTrace: row.fallback_trace ? JSON.parse(row.fallback_trace) : [],
|
|
2055
|
+
createdAt: toDateFromSQLite(row.created_at)
|
|
2056
|
+
}));
|
|
2057
|
+
} catch (err) {
|
|
2058
|
+
if (err?.message?.includes("no such table"))
|
|
2059
|
+
return [];
|
|
2060
|
+
throw err;
|
|
2061
|
+
}
|
|
2056
2062
|
}
|
|
2057
2063
|
async getRetrievalTraceStats() {
|
|
2058
2064
|
await this.initialize();
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2065
|
+
try {
|
|
2066
|
+
const row = sqliteGet(
|
|
2067
|
+
this.db,
|
|
2068
|
+
`SELECT
|
|
2069
|
+
COUNT(*) as total_queries,
|
|
2070
|
+
AVG(candidate_count) as avg_candidate_count,
|
|
2071
|
+
AVG(selected_count) as avg_selected_count,
|
|
2072
|
+
CASE
|
|
2073
|
+
WHEN SUM(candidate_count) > 0 THEN (SUM(selected_count) * 1.0 / SUM(candidate_count))
|
|
2074
|
+
ELSE 0
|
|
2075
|
+
END as selection_rate
|
|
2076
|
+
FROM retrieval_traces`,
|
|
2077
|
+
[]
|
|
2078
|
+
);
|
|
2079
|
+
return {
|
|
2080
|
+
totalQueries: Number(row?.total_queries || 0),
|
|
2081
|
+
avgCandidateCount: Number(row?.avg_candidate_count || 0),
|
|
2082
|
+
avgSelectedCount: Number(row?.avg_selected_count || 0),
|
|
2083
|
+
selectionRate: Number(row?.selection_rate || 0)
|
|
2084
|
+
};
|
|
2085
|
+
} catch (err) {
|
|
2086
|
+
if (err?.message?.includes("no such table")) {
|
|
2087
|
+
return { totalQueries: 0, avgCandidateCount: 0, avgSelectedCount: 0, selectionRate: 0 };
|
|
2088
|
+
}
|
|
2089
|
+
throw err;
|
|
2090
|
+
}
|
|
2078
2091
|
}
|
|
2079
2092
|
/**
|
|
2080
2093
|
* Close database connection
|