claude-memory-layer 1.0.33 → 1.0.35
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/dist/cli/index.js +21 -8
- package/dist/cli/index.js.map +2 -2
- package/dist/core/index.js +16 -5
- package/dist/core/index.js.map +2 -2
- package/dist/hooks/post-tool-use.js +16 -5
- package/dist/hooks/post-tool-use.js.map +2 -2
- package/dist/hooks/semantic-daemon.js +16 -5
- package/dist/hooks/semantic-daemon.js.map +2 -2
- package/dist/hooks/session-end.js +16 -5
- package/dist/hooks/session-end.js.map +2 -2
- package/dist/hooks/session-start.js +16 -5
- package/dist/hooks/session-start.js.map +2 -2
- package/dist/hooks/stop.js +16 -5
- package/dist/hooks/stop.js.map +2 -2
- package/dist/hooks/user-prompt-submit.js +16 -5
- package/dist/hooks/user-prompt-submit.js.map +2 -2
- package/dist/index.js +16 -5
- package/dist/index.js.map +2 -2
- package/dist/mcp/index.js +176 -24
- package/dist/mcp/index.js.map +2 -2
- package/dist/server/api/index.js +16 -5
- package/dist/server/api/index.js.map +2 -2
- package/dist/server/index.js +16 -5
- package/dist/server/index.js.map +2 -2
- package/dist/services/memory-service.js +16 -5
- package/dist/services/memory-service.js.map +2 -2
- package/package.json +1 -1
package/dist/server/api/index.js
CHANGED
|
@@ -3578,6 +3578,16 @@ var SQLiteEventStore = class {
|
|
|
3578
3578
|
getDatabase() {
|
|
3579
3579
|
return this.db;
|
|
3580
3580
|
}
|
|
3581
|
+
hasTableColumn(tableName, columnName) {
|
|
3582
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(tableName))
|
|
3583
|
+
return false;
|
|
3584
|
+
try {
|
|
3585
|
+
const rows = sqliteAll(this.db, `PRAGMA table_info("${tableName}")`, []);
|
|
3586
|
+
return rows.some((row) => row.name === columnName);
|
|
3587
|
+
} catch {
|
|
3588
|
+
return false;
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3581
3591
|
async recordRetrievalTrace(input) {
|
|
3582
3592
|
await this.initialize();
|
|
3583
3593
|
const traceId = randomUUID5();
|
|
@@ -3643,17 +3653,18 @@ var SQLiteEventStore = class {
|
|
|
3643
3653
|
async getRetrievalTraceStats() {
|
|
3644
3654
|
await this.initialize();
|
|
3645
3655
|
try {
|
|
3656
|
+
const rewrittenQueryRewriteKindSql = this.hasTableColumn("retrieval_traces", "query_rewrite_kind") ? REWRITTEN_QUERY_REWRITE_KIND_SQL : "0";
|
|
3646
3657
|
const row = sqliteGet(
|
|
3647
3658
|
this.db,
|
|
3648
3659
|
`SELECT
|
|
3649
3660
|
COUNT(*) as total_queries,
|
|
3650
3661
|
AVG(candidate_count) as avg_candidate_count,
|
|
3651
3662
|
AVG(selected_count) as avg_selected_count,
|
|
3652
|
-
SUM(CASE WHEN ${
|
|
3653
|
-
SUM(CASE WHEN ${
|
|
3654
|
-
SUM(CASE WHEN NOT (${
|
|
3655
|
-
AVG(CASE WHEN ${
|
|
3656
|
-
AVG(CASE WHEN NOT (${
|
|
3663
|
+
SUM(CASE WHEN ${rewrittenQueryRewriteKindSql} THEN 1 ELSE 0 END) as rewritten_queries,
|
|
3664
|
+
SUM(CASE WHEN ${rewrittenQueryRewriteKindSql} AND selected_count > 0 THEN 1 ELSE 0 END) as rewritten_queries_with_selection,
|
|
3665
|
+
SUM(CASE WHEN NOT (${rewrittenQueryRewriteKindSql}) AND selected_count > 0 THEN 1 ELSE 0 END) as raw_queries_with_selection,
|
|
3666
|
+
AVG(CASE WHEN ${rewrittenQueryRewriteKindSql} THEN selected_count END) as avg_selected_count_for_rewritten_queries,
|
|
3667
|
+
AVG(CASE WHEN NOT (${rewrittenQueryRewriteKindSql}) THEN selected_count END) as avg_selected_count_for_raw_queries,
|
|
3657
3668
|
CASE
|
|
3658
3669
|
WHEN SUM(candidate_count) > 0 THEN (SUM(selected_count) * 1.0 / SUM(candidate_count))
|
|
3659
3670
|
ELSE 0
|