claude-memory-layer 1.0.34 → 1.0.36
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 +58 -17
- 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 +16 -5
- package/dist/mcp/index.js.map +2 -2
- package/dist/server/api/index.js +57 -16
- package/dist/server/api/index.js.map +2 -2
- package/dist/server/index.js +57 -16
- 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/index.js
CHANGED
|
@@ -3297,6 +3297,16 @@ var SQLiteEventStore = class {
|
|
|
3297
3297
|
getDatabase() {
|
|
3298
3298
|
return this.db;
|
|
3299
3299
|
}
|
|
3300
|
+
hasTableColumn(tableName, columnName) {
|
|
3301
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(tableName))
|
|
3302
|
+
return false;
|
|
3303
|
+
try {
|
|
3304
|
+
const rows = sqliteAll(this.db, `PRAGMA table_info("${tableName}")`, []);
|
|
3305
|
+
return rows.some((row) => row.name === columnName);
|
|
3306
|
+
} catch {
|
|
3307
|
+
return false;
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3300
3310
|
async recordRetrievalTrace(input) {
|
|
3301
3311
|
await this.initialize();
|
|
3302
3312
|
const traceId = randomUUID();
|
|
@@ -3362,17 +3372,18 @@ var SQLiteEventStore = class {
|
|
|
3362
3372
|
async getRetrievalTraceStats() {
|
|
3363
3373
|
await this.initialize();
|
|
3364
3374
|
try {
|
|
3375
|
+
const rewrittenQueryRewriteKindSql = this.hasTableColumn("retrieval_traces", "query_rewrite_kind") ? REWRITTEN_QUERY_REWRITE_KIND_SQL : "0";
|
|
3365
3376
|
const row = sqliteGet(
|
|
3366
3377
|
this.db,
|
|
3367
3378
|
`SELECT
|
|
3368
3379
|
COUNT(*) as total_queries,
|
|
3369
3380
|
AVG(candidate_count) as avg_candidate_count,
|
|
3370
3381
|
AVG(selected_count) as avg_selected_count,
|
|
3371
|
-
SUM(CASE WHEN ${
|
|
3372
|
-
SUM(CASE WHEN ${
|
|
3373
|
-
SUM(CASE WHEN NOT (${
|
|
3374
|
-
AVG(CASE WHEN ${
|
|
3375
|
-
AVG(CASE WHEN NOT (${
|
|
3382
|
+
SUM(CASE WHEN ${rewrittenQueryRewriteKindSql} THEN 1 ELSE 0 END) as rewritten_queries,
|
|
3383
|
+
SUM(CASE WHEN ${rewrittenQueryRewriteKindSql} AND selected_count > 0 THEN 1 ELSE 0 END) as rewritten_queries_with_selection,
|
|
3384
|
+
SUM(CASE WHEN NOT (${rewrittenQueryRewriteKindSql}) AND selected_count > 0 THEN 1 ELSE 0 END) as raw_queries_with_selection,
|
|
3385
|
+
AVG(CASE WHEN ${rewrittenQueryRewriteKindSql} THEN selected_count END) as avg_selected_count_for_rewritten_queries,
|
|
3386
|
+
AVG(CASE WHEN NOT (${rewrittenQueryRewriteKindSql}) THEN selected_count END) as avg_selected_count_for_raw_queries,
|
|
3376
3387
|
CASE
|
|
3377
3388
|
WHEN SUM(candidate_count) > 0 THEN (SUM(selected_count) * 1.0 / SUM(candidate_count))
|
|
3378
3389
|
ELSE 0
|