@signetai/signet-memory-openclaw 0.111.10 → 0.111.12
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/index.js +45 -162
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -7645,52 +7645,6 @@ function addColumnIfMissing7(db, table, column, definition) {
|
|
|
7645
7645
|
}
|
|
7646
7646
|
}
|
|
7647
7647
|
function up20(db) {
|
|
7648
|
-
db.exec(`
|
|
7649
|
-
CREATE TABLE IF NOT EXISTS predictor_comparisons (
|
|
7650
|
-
id TEXT PRIMARY KEY,
|
|
7651
|
-
session_key TEXT NOT NULL,
|
|
7652
|
-
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
7653
|
-
predictor_ndcg REAL NOT NULL,
|
|
7654
|
-
baseline_ndcg REAL NOT NULL,
|
|
7655
|
-
predictor_won INTEGER NOT NULL,
|
|
7656
|
-
margin REAL NOT NULL,
|
|
7657
|
-
alpha REAL NOT NULL,
|
|
7658
|
-
ema_updated INTEGER NOT NULL DEFAULT 0,
|
|
7659
|
-
focal_entity_id TEXT,
|
|
7660
|
-
focal_entity_name TEXT,
|
|
7661
|
-
project TEXT,
|
|
7662
|
-
candidate_count INTEGER NOT NULL,
|
|
7663
|
-
traversal_count INTEGER NOT NULL DEFAULT 0,
|
|
7664
|
-
constraint_count INTEGER NOT NULL DEFAULT 0,
|
|
7665
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
7666
|
-
);
|
|
7667
|
-
|
|
7668
|
-
CREATE INDEX IF NOT EXISTS idx_predictor_comparisons_session
|
|
7669
|
-
ON predictor_comparisons(session_key);
|
|
7670
|
-
CREATE INDEX IF NOT EXISTS idx_predictor_comparisons_agent
|
|
7671
|
-
ON predictor_comparisons(agent_id);
|
|
7672
|
-
CREATE INDEX IF NOT EXISTS idx_predictor_comparisons_project
|
|
7673
|
-
ON predictor_comparisons(project);
|
|
7674
|
-
CREATE INDEX IF NOT EXISTS idx_predictor_comparisons_entity
|
|
7675
|
-
ON predictor_comparisons(focal_entity_id);
|
|
7676
|
-
|
|
7677
|
-
CREATE TABLE IF NOT EXISTS predictor_training_log (
|
|
7678
|
-
id TEXT PRIMARY KEY,
|
|
7679
|
-
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
7680
|
-
model_version INTEGER NOT NULL,
|
|
7681
|
-
loss REAL NOT NULL,
|
|
7682
|
-
sample_count INTEGER NOT NULL,
|
|
7683
|
-
duration_ms INTEGER NOT NULL,
|
|
7684
|
-
canary_ndcg REAL,
|
|
7685
|
-
canary_ndcg_delta REAL,
|
|
7686
|
-
canary_score_variance REAL,
|
|
7687
|
-
canary_topk_churn REAL,
|
|
7688
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
7689
|
-
);
|
|
7690
|
-
|
|
7691
|
-
CREATE INDEX IF NOT EXISTS idx_predictor_training_agent
|
|
7692
|
-
ON predictor_training_log(agent_id);
|
|
7693
|
-
`);
|
|
7694
7648
|
addColumnIfMissing7(db, "session_memories", "entity_slot", "INTEGER");
|
|
7695
7649
|
addColumnIfMissing7(db, "session_memories", "aspect_slot", "INTEGER");
|
|
7696
7650
|
addColumnIfMissing7(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -7726,75 +7680,19 @@ function up22(db) {
|
|
|
7726
7680
|
addColumnIfMissing8(db, "entities", "pinned_at", "TEXT");
|
|
7727
7681
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
7728
7682
|
}
|
|
7683
|
+
function up23(_db) {}
|
|
7684
|
+
function up24(_db) {}
|
|
7729
7685
|
function addColumnIfMissing9(db, table, column, definition) {
|
|
7730
7686
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
7731
7687
|
if (!cols.some((c) => c.name === column)) {
|
|
7732
7688
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
7733
7689
|
}
|
|
7734
7690
|
}
|
|
7735
|
-
function up23(db) {
|
|
7736
|
-
addColumnIfMissing9(db, "session_memories", "predictor_rank", "INTEGER");
|
|
7737
|
-
}
|
|
7738
|
-
function addColumnIfMissing10(db, table, column, definition) {
|
|
7739
|
-
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
7740
|
-
if (!cols.some((c) => c.name === column)) {
|
|
7741
|
-
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
7742
|
-
}
|
|
7743
|
-
}
|
|
7744
|
-
function up24(db) {
|
|
7745
|
-
addColumnIfMissing10(db, "predictor_comparisons", "scorer_confidence", "REAL NOT NULL DEFAULT 0");
|
|
7746
|
-
addColumnIfMissing10(db, "predictor_comparisons", "success_rate", "REAL NOT NULL DEFAULT 0.5");
|
|
7747
|
-
addColumnIfMissing10(db, "predictor_comparisons", "predictor_top_ids", "TEXT NOT NULL DEFAULT '[]'");
|
|
7748
|
-
addColumnIfMissing10(db, "predictor_comparisons", "baseline_top_ids", "TEXT NOT NULL DEFAULT '[]'");
|
|
7749
|
-
addColumnIfMissing10(db, "predictor_comparisons", "relevance_scores", "TEXT NOT NULL DEFAULT '{}'");
|
|
7750
|
-
addColumnIfMissing10(db, "predictor_comparisons", "fts_overlap_score", "REAL");
|
|
7751
|
-
}
|
|
7752
|
-
function addColumnIfMissing11(db, table, column, definition) {
|
|
7753
|
-
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
7754
|
-
if (!cols.some((c) => c.name === column)) {
|
|
7755
|
-
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
7756
|
-
}
|
|
7757
|
-
}
|
|
7758
7691
|
function up25(db) {
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
}
|
|
7762
|
-
function up26(db) {
|
|
7763
|
-
db.exec(`
|
|
7764
|
-
CREATE TABLE IF NOT EXISTS predictor_training_pairs (
|
|
7765
|
-
id TEXT PRIMARY KEY,
|
|
7766
|
-
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
7767
|
-
session_key TEXT NOT NULL,
|
|
7768
|
-
memory_id TEXT NOT NULL,
|
|
7769
|
-
-- Feature vector (anonymized -- no content, just structural features)
|
|
7770
|
-
recency_days REAL NOT NULL,
|
|
7771
|
-
access_count INTEGER NOT NULL,
|
|
7772
|
-
importance REAL NOT NULL,
|
|
7773
|
-
decay_factor REAL NOT NULL,
|
|
7774
|
-
embedding_similarity REAL,
|
|
7775
|
-
entity_slot INTEGER,
|
|
7776
|
-
aspect_slot INTEGER,
|
|
7777
|
-
is_constraint INTEGER NOT NULL DEFAULT 0,
|
|
7778
|
-
structural_density INTEGER,
|
|
7779
|
-
fts_hit_count INTEGER NOT NULL DEFAULT 0,
|
|
7780
|
-
-- Label (ground truth)
|
|
7781
|
-
agent_relevance_score REAL,
|
|
7782
|
-
continuity_score REAL,
|
|
7783
|
-
fts_overlap_score REAL,
|
|
7784
|
-
combined_label REAL NOT NULL,
|
|
7785
|
-
-- Metadata
|
|
7786
|
-
was_injected INTEGER NOT NULL,
|
|
7787
|
-
predictor_rank INTEGER,
|
|
7788
|
-
baseline_rank INTEGER,
|
|
7789
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
7790
|
-
);
|
|
7791
|
-
|
|
7792
|
-
CREATE INDEX IF NOT EXISTS idx_training_pairs_agent
|
|
7793
|
-
ON predictor_training_pairs(agent_id);
|
|
7794
|
-
CREATE INDEX IF NOT EXISTS idx_training_pairs_session
|
|
7795
|
-
ON predictor_training_pairs(session_key);
|
|
7796
|
-
`);
|
|
7692
|
+
addColumnIfMissing9(db, "session_memories", "agent_relevance_score", "REAL");
|
|
7693
|
+
addColumnIfMissing9(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
7797
7694
|
}
|
|
7695
|
+
function up26(_db) {}
|
|
7798
7696
|
function up27(db) {
|
|
7799
7697
|
db.exec(`
|
|
7800
7698
|
UPDATE entities
|
|
@@ -8095,14 +7993,14 @@ function up40(db) {
|
|
|
8095
7993
|
ON session_transcripts(created_at);
|
|
8096
7994
|
`);
|
|
8097
7995
|
}
|
|
8098
|
-
function
|
|
7996
|
+
function addColumnIfMissing10(db, table, column, definition) {
|
|
8099
7997
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
8100
7998
|
if (!cols.some((c) => c.name === column)) {
|
|
8101
7999
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
8102
8000
|
}
|
|
8103
8001
|
}
|
|
8104
8002
|
function up41(db) {
|
|
8105
|
-
|
|
8003
|
+
addColumnIfMissing10(db, "session_memories", "path_json", "TEXT");
|
|
8106
8004
|
db.exec(`
|
|
8107
8005
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
8108
8006
|
id TEXT PRIMARY KEY,
|
|
@@ -8170,21 +8068,21 @@ function up41(db) {
|
|
|
8170
8068
|
);
|
|
8171
8069
|
`);
|
|
8172
8070
|
}
|
|
8173
|
-
function
|
|
8071
|
+
function addColumnIfMissing11(db, table, column, definition) {
|
|
8174
8072
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
8175
8073
|
if (cols.some((col) => col.name === column))
|
|
8176
8074
|
return;
|
|
8177
8075
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
8178
8076
|
}
|
|
8179
8077
|
function up42(db) {
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8078
|
+
addColumnIfMissing11(db, "session_memories", "entity_slot", "INTEGER");
|
|
8079
|
+
addColumnIfMissing11(db, "session_memories", "aspect_slot", "INTEGER");
|
|
8080
|
+
addColumnIfMissing11(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
8081
|
+
addColumnIfMissing11(db, "session_memories", "structural_density", "INTEGER");
|
|
8082
|
+
addColumnIfMissing11(db, "session_memories", "predictor_rank", "INTEGER");
|
|
8083
|
+
addColumnIfMissing11(db, "session_memories", "agent_relevance_score", "REAL");
|
|
8084
|
+
addColumnIfMissing11(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
8085
|
+
addColumnIfMissing11(db, "session_memories", "path_json", "TEXT");
|
|
8188
8086
|
const cols = db.prepare("PRAGMA table_info(session_memories)").all();
|
|
8189
8087
|
const hasAgent = cols.some((col) => col.name === "agent_id");
|
|
8190
8088
|
const agentExpr = hasAgent ? "COALESCE(NULLIF(agent_id, ''), 'default')" : "'default'";
|
|
@@ -8258,7 +8156,7 @@ function up42(db) {
|
|
|
8258
8156
|
ON session_memories(agent_id, session_key);
|
|
8259
8157
|
`);
|
|
8260
8158
|
}
|
|
8261
|
-
function
|
|
8159
|
+
function addColumnIfMissing12(db, table, column, definition) {
|
|
8262
8160
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
8263
8161
|
if (cols.some((c) => c.name === column))
|
|
8264
8162
|
return;
|
|
@@ -8278,8 +8176,8 @@ function up43(db) {
|
|
|
8278
8176
|
const now = new Date().toISOString();
|
|
8279
8177
|
db.prepare(`INSERT OR IGNORE INTO agents (id, name, read_policy, created_at, updated_at)
|
|
8280
8178
|
VALUES ('default', 'default', 'shared', ?, ?)`).run(now, now);
|
|
8281
|
-
|
|
8282
|
-
|
|
8179
|
+
addColumnIfMissing12(db, "memories", "agent_id", "TEXT DEFAULT 'default'");
|
|
8180
|
+
addColumnIfMissing12(db, "memories", "visibility", "TEXT DEFAULT 'global'");
|
|
8283
8181
|
db.exec(`
|
|
8284
8182
|
CREATE INDEX IF NOT EXISTS idx_memories_agent_id
|
|
8285
8183
|
ON memories(agent_id);
|
|
@@ -8287,16 +8185,16 @@ function up43(db) {
|
|
|
8287
8185
|
ON memories(agent_id, visibility);
|
|
8288
8186
|
`);
|
|
8289
8187
|
}
|
|
8290
|
-
function
|
|
8188
|
+
function addColumnIfMissing13(db, table, column, definition) {
|
|
8291
8189
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
8292
8190
|
if (cols.some((c) => c.name === column))
|
|
8293
8191
|
return;
|
|
8294
8192
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
8295
8193
|
}
|
|
8296
8194
|
function up44(db) {
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8195
|
+
addColumnIfMissing13(db, "session_summaries", "source_type", "TEXT");
|
|
8196
|
+
addColumnIfMissing13(db, "session_summaries", "source_ref", "TEXT");
|
|
8197
|
+
addColumnIfMissing13(db, "session_summaries", "meta_json", "TEXT");
|
|
8300
8198
|
db.exec(`
|
|
8301
8199
|
UPDATE session_summaries
|
|
8302
8200
|
SET source_type = CASE
|
|
@@ -8313,16 +8211,16 @@ function up44(db) {
|
|
|
8313
8211
|
ON session_summaries(source_ref);
|
|
8314
8212
|
`);
|
|
8315
8213
|
}
|
|
8316
|
-
function
|
|
8214
|
+
function addColumnIfMissing14(db, table, column, definition) {
|
|
8317
8215
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
8318
8216
|
if (cols.some((col) => col.name === column))
|
|
8319
8217
|
return;
|
|
8320
8218
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
8321
8219
|
}
|
|
8322
8220
|
function up45(db) {
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8221
|
+
addColumnIfMissing14(db, "session_transcripts", "updated_at", "TEXT");
|
|
8222
|
+
addColumnIfMissing14(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
8223
|
+
addColumnIfMissing14(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
8326
8224
|
db.exec(`
|
|
8327
8225
|
UPDATE session_transcripts
|
|
8328
8226
|
SET updated_at = COALESCE(updated_at, created_at)
|
|
@@ -8848,18 +8746,18 @@ function up50(db) {
|
|
|
8848
8746
|
AND (reason IS NULL OR length(trim(reason)) = 0)
|
|
8849
8747
|
`);
|
|
8850
8748
|
}
|
|
8851
|
-
function
|
|
8749
|
+
function addColumnIfMissing15(db, table, column, definition) {
|
|
8852
8750
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
8853
8751
|
if (cols.some((col) => col.name === column))
|
|
8854
8752
|
return;
|
|
8855
8753
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
8856
8754
|
}
|
|
8857
8755
|
function up51(db) {
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8756
|
+
addColumnIfMissing15(db, "summary_jobs", "session_id", "TEXT");
|
|
8757
|
+
addColumnIfMissing15(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
8758
|
+
addColumnIfMissing15(db, "summary_jobs", "captured_at", "TEXT");
|
|
8759
|
+
addColumnIfMissing15(db, "summary_jobs", "started_at", "TEXT");
|
|
8760
|
+
addColumnIfMissing15(db, "summary_jobs", "ended_at", "TEXT");
|
|
8863
8761
|
db.exec(`
|
|
8864
8762
|
UPDATE summary_jobs
|
|
8865
8763
|
SET
|
|
@@ -9133,17 +9031,17 @@ function hasColumn6(db, table, column) {
|
|
|
9133
9031
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9134
9032
|
return rows.some((row) => row.name === column);
|
|
9135
9033
|
}
|
|
9136
|
-
function
|
|
9034
|
+
function addColumnIfMissing16(db, table, column, definition) {
|
|
9137
9035
|
if (!hasColumn6(db, table, column)) {
|
|
9138
9036
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9139
9037
|
}
|
|
9140
9038
|
}
|
|
9141
9039
|
function up64(db) {
|
|
9142
9040
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9041
|
+
addColumnIfMissing16(db, table, "source_id", "TEXT");
|
|
9042
|
+
addColumnIfMissing16(db, table, "source_kind", "TEXT");
|
|
9043
|
+
addColumnIfMissing16(db, table, "source_path", "TEXT");
|
|
9044
|
+
addColumnIfMissing16(db, table, "source_root", "TEXT");
|
|
9147
9045
|
}
|
|
9148
9046
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_source ON entities(agent_id, source_id, source_path)");
|
|
9149
9047
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entity_communities_source ON entity_communities(agent_id, source_id, source_path)");
|
|
@@ -9306,10 +9204,9 @@ var MIGRATIONS = [
|
|
|
9306
9204
|
},
|
|
9307
9205
|
{
|
|
9308
9206
|
version: 20,
|
|
9309
|
-
name: "
|
|
9207
|
+
name: "session-structural-columns",
|
|
9310
9208
|
up: up20,
|
|
9311
9209
|
artifacts: {
|
|
9312
|
-
tables: ["predictor_comparisons", "predictor_training_log"],
|
|
9313
9210
|
columns: [
|
|
9314
9211
|
{ table: "session_memories", column: "entity_slot" },
|
|
9315
9212
|
{ table: "session_memories", column: "aspect_slot" },
|
|
@@ -9339,26 +9236,13 @@ var MIGRATIONS = [
|
|
|
9339
9236
|
},
|
|
9340
9237
|
{
|
|
9341
9238
|
version: 23,
|
|
9342
|
-
name: "
|
|
9343
|
-
up: up23
|
|
9344
|
-
artifacts: {
|
|
9345
|
-
columns: [{ table: "session_memories", column: "predictor_rank" }]
|
|
9346
|
-
}
|
|
9239
|
+
name: "retired-scorer-gap",
|
|
9240
|
+
up: up23
|
|
9347
9241
|
},
|
|
9348
9242
|
{
|
|
9349
9243
|
version: 24,
|
|
9350
|
-
name: "
|
|
9351
|
-
up: up24
|
|
9352
|
-
artifacts: {
|
|
9353
|
-
columns: [
|
|
9354
|
-
{ table: "predictor_comparisons", column: "scorer_confidence" },
|
|
9355
|
-
{ table: "predictor_comparisons", column: "success_rate" },
|
|
9356
|
-
{ table: "predictor_comparisons", column: "predictor_top_ids" },
|
|
9357
|
-
{ table: "predictor_comparisons", column: "baseline_top_ids" },
|
|
9358
|
-
{ table: "predictor_comparisons", column: "relevance_scores" },
|
|
9359
|
-
{ table: "predictor_comparisons", column: "fts_overlap_score" }
|
|
9360
|
-
]
|
|
9361
|
-
}
|
|
9244
|
+
name: "retired-scorer-gap",
|
|
9245
|
+
up: up24
|
|
9362
9246
|
},
|
|
9363
9247
|
{
|
|
9364
9248
|
version: 25,
|
|
@@ -9370,9 +9254,8 @@ var MIGRATIONS = [
|
|
|
9370
9254
|
},
|
|
9371
9255
|
{
|
|
9372
9256
|
version: 26,
|
|
9373
|
-
name: "
|
|
9374
|
-
up: up26
|
|
9375
|
-
artifacts: { tables: ["predictor_training_pairs"] }
|
|
9257
|
+
name: "retired-scorer-gap",
|
|
9258
|
+
up: up26
|
|
9376
9259
|
},
|
|
9377
9260
|
{
|
|
9378
9261
|
version: 27,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/signet-memory-openclaw",
|
|
3
|
-
"version": "0.111.
|
|
3
|
+
"version": "0.111.12",
|
|
4
4
|
"description": "Signet adapter for OpenClaw — runtime plugin for AI agent memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@sinclair/typebox": "0.34.47"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@signet/core": "0.111.
|
|
40
|
-
"@signet/sdk": "0.111.
|
|
39
|
+
"@signet/core": "0.111.12",
|
|
40
|
+
"@signet/sdk": "0.111.12",
|
|
41
41
|
"@types/node": "^22.0.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|