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