@signetai/signet-memory-openclaw 0.72.8 → 0.73.0
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 +185 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7844,6 +7844,145 @@ function up33(db) {
|
|
|
7844
7844
|
}
|
|
7845
7845
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
7846
7846
|
}
|
|
7847
|
+
function up34(db) {
|
|
7848
|
+
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
7849
|
+
db.exec(`
|
|
7850
|
+
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
7851
|
+
ON memories(content_hash, COALESCE(scope, '__NULL__'))
|
|
7852
|
+
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
7853
|
+
`);
|
|
7854
|
+
}
|
|
7855
|
+
function up35(db) {
|
|
7856
|
+
db.exec(`
|
|
7857
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
7858
|
+
name, canonical_name,
|
|
7859
|
+
content='entities', content_rowid='rowid'
|
|
7860
|
+
)
|
|
7861
|
+
`);
|
|
7862
|
+
db.exec(`
|
|
7863
|
+
INSERT INTO entities_fts(rowid, name, canonical_name)
|
|
7864
|
+
SELECT rowid, name, canonical_name FROM entities
|
|
7865
|
+
`);
|
|
7866
|
+
db.exec(`
|
|
7867
|
+
CREATE TRIGGER IF NOT EXISTS entities_fts_ai AFTER INSERT ON entities BEGIN
|
|
7868
|
+
INSERT INTO entities_fts(rowid, name, canonical_name)
|
|
7869
|
+
VALUES (new.rowid, new.name, new.canonical_name);
|
|
7870
|
+
END
|
|
7871
|
+
`);
|
|
7872
|
+
db.exec(`
|
|
7873
|
+
CREATE TRIGGER IF NOT EXISTS entities_fts_ad AFTER DELETE ON entities BEGIN
|
|
7874
|
+
INSERT INTO entities_fts(entities_fts, rowid, name, canonical_name)
|
|
7875
|
+
VALUES ('delete', old.rowid, old.name, old.canonical_name);
|
|
7876
|
+
END
|
|
7877
|
+
`);
|
|
7878
|
+
db.exec(`
|
|
7879
|
+
CREATE TRIGGER IF NOT EXISTS entities_fts_au AFTER UPDATE ON entities BEGIN
|
|
7880
|
+
INSERT INTO entities_fts(entities_fts, rowid, name, canonical_name)
|
|
7881
|
+
VALUES ('delete', old.rowid, old.name, old.canonical_name);
|
|
7882
|
+
INSERT INTO entities_fts(rowid, name, canonical_name)
|
|
7883
|
+
VALUES (new.rowid, new.name, new.canonical_name);
|
|
7884
|
+
END
|
|
7885
|
+
`);
|
|
7886
|
+
}
|
|
7887
|
+
function up36(db) {
|
|
7888
|
+
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
7889
|
+
if (!cols.some((c) => c.name === "confidence")) {
|
|
7890
|
+
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
7891
|
+
}
|
|
7892
|
+
}
|
|
7893
|
+
function up37(db) {
|
|
7894
|
+
db.exec(`
|
|
7895
|
+
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
7896
|
+
id TEXT PRIMARY KEY,
|
|
7897
|
+
agent_id TEXT NOT NULL,
|
|
7898
|
+
name TEXT,
|
|
7899
|
+
cohesion REAL DEFAULT 0.0,
|
|
7900
|
+
member_count INTEGER DEFAULT 0,
|
|
7901
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
7902
|
+
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
7903
|
+
)
|
|
7904
|
+
`);
|
|
7905
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_entity_communities_agent ON entity_communities(agent_id)");
|
|
7906
|
+
const cols = db.prepare("PRAGMA table_info(entities)").all();
|
|
7907
|
+
if (!cols.some((c) => c.name === "community_id")) {
|
|
7908
|
+
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
7909
|
+
}
|
|
7910
|
+
}
|
|
7911
|
+
function up38(db) {
|
|
7912
|
+
db.exec(`
|
|
7913
|
+
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
7914
|
+
id TEXT PRIMARY KEY,
|
|
7915
|
+
memory_id TEXT NOT NULL REFERENCES memories(id) ON DELETE CASCADE,
|
|
7916
|
+
agent_id TEXT NOT NULL,
|
|
7917
|
+
hint TEXT NOT NULL,
|
|
7918
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
7919
|
+
UNIQUE(memory_id, hint)
|
|
7920
|
+
)
|
|
7921
|
+
`);
|
|
7922
|
+
db.exec(`CREATE INDEX IF NOT EXISTS idx_hints_memory ON memory_hints(memory_id)`);
|
|
7923
|
+
db.exec(`CREATE INDEX IF NOT EXISTS idx_hints_agent ON memory_hints(agent_id)`);
|
|
7924
|
+
db.exec(`
|
|
7925
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS memory_hints_fts USING fts5(
|
|
7926
|
+
hint,
|
|
7927
|
+
content='memory_hints', content_rowid='rowid'
|
|
7928
|
+
)
|
|
7929
|
+
`);
|
|
7930
|
+
db.exec(`
|
|
7931
|
+
CREATE TRIGGER IF NOT EXISTS memory_hints_fts_ai AFTER INSERT ON memory_hints BEGIN
|
|
7932
|
+
INSERT INTO memory_hints_fts(rowid, hint)
|
|
7933
|
+
VALUES (new.rowid, new.hint);
|
|
7934
|
+
END
|
|
7935
|
+
`);
|
|
7936
|
+
db.exec(`
|
|
7937
|
+
CREATE TRIGGER IF NOT EXISTS memory_hints_fts_ad AFTER DELETE ON memory_hints BEGIN
|
|
7938
|
+
INSERT INTO memory_hints_fts(memory_hints_fts, rowid, hint)
|
|
7939
|
+
VALUES ('delete', old.rowid, old.hint);
|
|
7940
|
+
END
|
|
7941
|
+
`);
|
|
7942
|
+
db.exec(`
|
|
7943
|
+
CREATE TRIGGER IF NOT EXISTS memory_hints_fts_au AFTER UPDATE ON memory_hints BEGIN
|
|
7944
|
+
INSERT INTO memory_hints_fts(memory_hints_fts, rowid, hint)
|
|
7945
|
+
VALUES ('delete', old.rowid, old.hint);
|
|
7946
|
+
INSERT INTO memory_hints_fts(rowid, hint)
|
|
7947
|
+
VALUES (new.rowid, new.hint);
|
|
7948
|
+
END
|
|
7949
|
+
`);
|
|
7950
|
+
}
|
|
7951
|
+
function up39(db) {
|
|
7952
|
+
db.exec(`
|
|
7953
|
+
DELETE FROM entity_dependencies
|
|
7954
|
+
WHERE id NOT IN (
|
|
7955
|
+
SELECT MIN(id) FROM entity_dependencies
|
|
7956
|
+
GROUP BY source_entity_id, target_entity_id,
|
|
7957
|
+
dependency_type, agent_id
|
|
7958
|
+
)
|
|
7959
|
+
`);
|
|
7960
|
+
db.exec(`
|
|
7961
|
+
CREATE UNIQUE INDEX IF NOT EXISTS
|
|
7962
|
+
idx_entity_deps_unique
|
|
7963
|
+
ON entity_dependencies(
|
|
7964
|
+
source_entity_id, target_entity_id,
|
|
7965
|
+
dependency_type, agent_id
|
|
7966
|
+
)
|
|
7967
|
+
`);
|
|
7968
|
+
}
|
|
7969
|
+
function up40(db) {
|
|
7970
|
+
db.exec(`
|
|
7971
|
+
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
7972
|
+
session_key TEXT PRIMARY KEY,
|
|
7973
|
+
content TEXT NOT NULL,
|
|
7974
|
+
harness TEXT,
|
|
7975
|
+
project TEXT,
|
|
7976
|
+
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
7977
|
+
created_at TEXT NOT NULL
|
|
7978
|
+
);
|
|
7979
|
+
|
|
7980
|
+
CREATE INDEX IF NOT EXISTS idx_st_project
|
|
7981
|
+
ON session_transcripts(project);
|
|
7982
|
+
CREATE INDEX IF NOT EXISTS idx_st_created
|
|
7983
|
+
ON session_transcripts(created_at);
|
|
7984
|
+
`);
|
|
7985
|
+
}
|
|
7847
7986
|
var MIGRATIONS = [
|
|
7848
7987
|
{
|
|
7849
7988
|
version: 1,
|
|
@@ -8113,6 +8252,52 @@ var MIGRATIONS = [
|
|
|
8113
8252
|
artifacts: {
|
|
8114
8253
|
columns: [{ table: "memories", column: "scope" }]
|
|
8115
8254
|
}
|
|
8255
|
+
},
|
|
8256
|
+
{
|
|
8257
|
+
version: 34,
|
|
8258
|
+
name: "scope-aware-dedup",
|
|
8259
|
+
up: up34
|
|
8260
|
+
},
|
|
8261
|
+
{
|
|
8262
|
+
version: 35,
|
|
8263
|
+
name: "entity-fts",
|
|
8264
|
+
up: up35
|
|
8265
|
+
},
|
|
8266
|
+
{
|
|
8267
|
+
version: 36,
|
|
8268
|
+
name: "dependency-confidence",
|
|
8269
|
+
up: up36,
|
|
8270
|
+
artifacts: {
|
|
8271
|
+
columns: [
|
|
8272
|
+
{ table: "entity_dependencies", column: "confidence" }
|
|
8273
|
+
]
|
|
8274
|
+
}
|
|
8275
|
+
},
|
|
8276
|
+
{
|
|
8277
|
+
version: 37,
|
|
8278
|
+
name: "entity-communities",
|
|
8279
|
+
up: up37,
|
|
8280
|
+
artifacts: {
|
|
8281
|
+
tables: ["entity_communities"],
|
|
8282
|
+
columns: [{ table: "entities", column: "community_id" }]
|
|
8283
|
+
}
|
|
8284
|
+
},
|
|
8285
|
+
{
|
|
8286
|
+
version: 38,
|
|
8287
|
+
name: "memory-hints",
|
|
8288
|
+
up: up38,
|
|
8289
|
+
artifacts: { tables: ["memory_hints"] }
|
|
8290
|
+
},
|
|
8291
|
+
{
|
|
8292
|
+
version: 39,
|
|
8293
|
+
name: "dedup-entity-dependencies",
|
|
8294
|
+
up: up39
|
|
8295
|
+
},
|
|
8296
|
+
{
|
|
8297
|
+
version: 40,
|
|
8298
|
+
name: "session-transcripts",
|
|
8299
|
+
up: up40,
|
|
8300
|
+
artifacts: { tables: ["session_transcripts"] }
|
|
8116
8301
|
}
|
|
8117
8302
|
];
|
|
8118
8303
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/signet-memory-openclaw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "Signet adapter for OpenClaw — runtime plugin for AI agent memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@sinclair/typebox": "0.34.47"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@signet/core": "0.
|
|
39
|
+
"@signet/core": "0.73.0",
|
|
40
40
|
"@types/node": "^22.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|