claude-memory-layer 1.0.15 → 1.0.17
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 +105 -74
- 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 +3 -0
- package/memory/agent_response/uncategorized/2026-02-26.md +26 -0
- package/memory/tool_observation/uncategorized/2026-02-26.md +201 -0
- package/memory/user_prompt/uncategorized/2026-02-26.md +16 -0
- package/package.json +1 -1
- package/src/cli/index.ts +55 -33
- package/src/core/sqlite-event-store.ts +52 -40
- package/src/hooks/user-prompt-submit.ts +22 -3
package/dist/server/index.js
CHANGED
|
@@ -2057,49 +2057,62 @@ var SQLiteEventStore = class {
|
|
|
2057
2057
|
}
|
|
2058
2058
|
async getRecentRetrievalTraces(limit = 50) {
|
|
2059
2059
|
await this.initialize();
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2060
|
+
try {
|
|
2061
|
+
const rows = sqliteAll(
|
|
2062
|
+
this.db,
|
|
2063
|
+
`SELECT * FROM retrieval_traces ORDER BY created_at DESC LIMIT ?`,
|
|
2064
|
+
[limit]
|
|
2065
|
+
);
|
|
2066
|
+
return rows.map((row) => ({
|
|
2067
|
+
traceId: row.trace_id,
|
|
2068
|
+
sessionId: row.session_id || void 0,
|
|
2069
|
+
projectHash: row.project_hash || void 0,
|
|
2070
|
+
queryText: row.query_text,
|
|
2071
|
+
strategy: row.strategy || void 0,
|
|
2072
|
+
candidateEventIds: row.candidate_event_ids ? JSON.parse(row.candidate_event_ids) : [],
|
|
2073
|
+
selectedEventIds: row.selected_event_ids ? JSON.parse(row.selected_event_ids) : [],
|
|
2074
|
+
candidateDetails: row.candidate_details_json ? JSON.parse(row.candidate_details_json) : [],
|
|
2075
|
+
selectedDetails: row.selected_details_json ? JSON.parse(row.selected_details_json) : [],
|
|
2076
|
+
candidateCount: Number(row.candidate_count || 0),
|
|
2077
|
+
selectedCount: Number(row.selected_count || 0),
|
|
2078
|
+
confidence: row.confidence || void 0,
|
|
2079
|
+
fallbackTrace: row.fallback_trace ? JSON.parse(row.fallback_trace) : [],
|
|
2080
|
+
createdAt: toDateFromSQLite(row.created_at)
|
|
2081
|
+
}));
|
|
2082
|
+
} catch (err) {
|
|
2083
|
+
if (err?.message?.includes("no such table"))
|
|
2084
|
+
return [];
|
|
2085
|
+
throw err;
|
|
2086
|
+
}
|
|
2081
2087
|
}
|
|
2082
2088
|
async getRetrievalTraceStats() {
|
|
2083
2089
|
await this.initialize();
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2090
|
+
try {
|
|
2091
|
+
const row = sqliteGet(
|
|
2092
|
+
this.db,
|
|
2093
|
+
`SELECT
|
|
2094
|
+
COUNT(*) as total_queries,
|
|
2095
|
+
AVG(candidate_count) as avg_candidate_count,
|
|
2096
|
+
AVG(selected_count) as avg_selected_count,
|
|
2097
|
+
CASE
|
|
2098
|
+
WHEN SUM(candidate_count) > 0 THEN (SUM(selected_count) * 1.0 / SUM(candidate_count))
|
|
2099
|
+
ELSE 0
|
|
2100
|
+
END as selection_rate
|
|
2101
|
+
FROM retrieval_traces`,
|
|
2102
|
+
[]
|
|
2103
|
+
);
|
|
2104
|
+
return {
|
|
2105
|
+
totalQueries: Number(row?.total_queries || 0),
|
|
2106
|
+
avgCandidateCount: Number(row?.avg_candidate_count || 0),
|
|
2107
|
+
avgSelectedCount: Number(row?.avg_selected_count || 0),
|
|
2108
|
+
selectionRate: Number(row?.selection_rate || 0)
|
|
2109
|
+
};
|
|
2110
|
+
} catch (err) {
|
|
2111
|
+
if (err?.message?.includes("no such table")) {
|
|
2112
|
+
return { totalQueries: 0, avgCandidateCount: 0, avgSelectedCount: 0, selectionRate: 0 };
|
|
2113
|
+
}
|
|
2114
|
+
throw err;
|
|
2115
|
+
}
|
|
2103
2116
|
}
|
|
2104
2117
|
/**
|
|
2105
2118
|
* Close database connection
|