@signetai/signet-memory-openclaw 0.85.4 → 0.86.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 +113 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8737,6 +8737,104 @@ function up50(db) {
|
|
|
8737
8737
|
AND (reason IS NULL OR length(trim(reason)) = 0)
|
|
8738
8738
|
`);
|
|
8739
8739
|
}
|
|
8740
|
+
function addColumnIfMissing17(db, table, column, definition) {
|
|
8741
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
8742
|
+
if (cols.some((col) => col.name === column))
|
|
8743
|
+
return;
|
|
8744
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
8745
|
+
}
|
|
8746
|
+
function up51(db) {
|
|
8747
|
+
addColumnIfMissing17(db, "summary_jobs", "session_id", "TEXT");
|
|
8748
|
+
addColumnIfMissing17(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
8749
|
+
addColumnIfMissing17(db, "summary_jobs", "captured_at", "TEXT");
|
|
8750
|
+
addColumnIfMissing17(db, "summary_jobs", "started_at", "TEXT");
|
|
8751
|
+
addColumnIfMissing17(db, "summary_jobs", "ended_at", "TEXT");
|
|
8752
|
+
db.exec(`
|
|
8753
|
+
UPDATE summary_jobs
|
|
8754
|
+
SET
|
|
8755
|
+
session_id = COALESCE(session_id, session_key, id),
|
|
8756
|
+
trigger = COALESCE(NULLIF(trigger, ''), 'session_end'),
|
|
8757
|
+
captured_at = COALESCE(captured_at, completed_at, created_at),
|
|
8758
|
+
ended_at = COALESCE(ended_at, completed_at)
|
|
8759
|
+
WHERE 1 = 1;
|
|
8760
|
+
|
|
8761
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_trigger
|
|
8762
|
+
ON summary_jobs(agent_id, trigger, created_at);
|
|
8763
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session
|
|
8764
|
+
ON summary_jobs(agent_id, session_key, created_at);
|
|
8765
|
+
`);
|
|
8766
|
+
db.exec(`
|
|
8767
|
+
CREATE TABLE IF NOT EXISTS memory_artifacts (
|
|
8768
|
+
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
8769
|
+
source_path TEXT NOT NULL,
|
|
8770
|
+
source_sha256 TEXT NOT NULL,
|
|
8771
|
+
source_kind TEXT NOT NULL,
|
|
8772
|
+
session_id TEXT NOT NULL,
|
|
8773
|
+
session_key TEXT,
|
|
8774
|
+
session_token TEXT NOT NULL,
|
|
8775
|
+
project TEXT,
|
|
8776
|
+
harness TEXT,
|
|
8777
|
+
captured_at TEXT NOT NULL,
|
|
8778
|
+
started_at TEXT,
|
|
8779
|
+
ended_at TEXT,
|
|
8780
|
+
manifest_path TEXT,
|
|
8781
|
+
source_node_id TEXT,
|
|
8782
|
+
memory_sentence TEXT,
|
|
8783
|
+
memory_sentence_quality TEXT,
|
|
8784
|
+
content TEXT NOT NULL DEFAULT '',
|
|
8785
|
+
updated_at TEXT NOT NULL,
|
|
8786
|
+
PRIMARY KEY (agent_id, source_path)
|
|
8787
|
+
);
|
|
8788
|
+
|
|
8789
|
+
CREATE INDEX IF NOT EXISTS idx_memory_artifacts_agent_kind
|
|
8790
|
+
ON memory_artifacts(agent_id, source_kind, captured_at DESC);
|
|
8791
|
+
CREATE INDEX IF NOT EXISTS idx_memory_artifacts_agent_session
|
|
8792
|
+
ON memory_artifacts(agent_id, session_token, captured_at DESC);
|
|
8793
|
+
CREATE INDEX IF NOT EXISTS idx_memory_artifacts_agent_membership
|
|
8794
|
+
ON memory_artifacts(agent_id, COALESCE(ended_at, captured_at) DESC);
|
|
8795
|
+
|
|
8796
|
+
CREATE TABLE IF NOT EXISTS memory_artifact_tombstones (
|
|
8797
|
+
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
8798
|
+
session_token TEXT NOT NULL,
|
|
8799
|
+
removed_at TEXT NOT NULL,
|
|
8800
|
+
reason TEXT NOT NULL,
|
|
8801
|
+
removed_paths TEXT NOT NULL,
|
|
8802
|
+
PRIMARY KEY (agent_id, session_token)
|
|
8803
|
+
);
|
|
8804
|
+
`);
|
|
8805
|
+
db.exec(`
|
|
8806
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS memory_artifacts_fts USING fts5(
|
|
8807
|
+
content,
|
|
8808
|
+
source_path,
|
|
8809
|
+
content='memory_artifacts',
|
|
8810
|
+
content_rowid='rowid'
|
|
8811
|
+
)
|
|
8812
|
+
`);
|
|
8813
|
+
db.exec(`
|
|
8814
|
+
CREATE TRIGGER IF NOT EXISTS memory_artifacts_fts_ai AFTER INSERT ON memory_artifacts BEGIN
|
|
8815
|
+
INSERT INTO memory_artifacts_fts(rowid, content, source_path)
|
|
8816
|
+
VALUES (new.rowid, new.content, new.source_path);
|
|
8817
|
+
END
|
|
8818
|
+
`);
|
|
8819
|
+
db.exec(`
|
|
8820
|
+
CREATE TRIGGER IF NOT EXISTS memory_artifacts_fts_ad AFTER DELETE ON memory_artifacts BEGIN
|
|
8821
|
+
INSERT INTO memory_artifacts_fts(memory_artifacts_fts, rowid, content, source_path)
|
|
8822
|
+
VALUES ('delete', old.rowid, old.content, old.source_path);
|
|
8823
|
+
END
|
|
8824
|
+
`);
|
|
8825
|
+
db.exec(`
|
|
8826
|
+
CREATE TRIGGER IF NOT EXISTS memory_artifacts_fts_au AFTER UPDATE ON memory_artifacts BEGIN
|
|
8827
|
+
INSERT INTO memory_artifacts_fts(memory_artifacts_fts, rowid, content, source_path)
|
|
8828
|
+
VALUES ('delete', old.rowid, old.content, old.source_path);
|
|
8829
|
+
INSERT INTO memory_artifacts_fts(rowid, content, source_path)
|
|
8830
|
+
VALUES (new.rowid, new.content, new.source_path);
|
|
8831
|
+
END
|
|
8832
|
+
`);
|
|
8833
|
+
db.exec(`
|
|
8834
|
+
INSERT INTO memory_artifacts_fts(memory_artifacts_fts)
|
|
8835
|
+
VALUES ('rebuild');
|
|
8836
|
+
`);
|
|
8837
|
+
}
|
|
8740
8838
|
var MIGRATIONS = [
|
|
8741
8839
|
{
|
|
8742
8840
|
version: 1,
|
|
@@ -9129,6 +9227,21 @@ var MIGRATIONS = [
|
|
|
9129
9227
|
artifacts: {
|
|
9130
9228
|
tables: ["entity_dependency_history"]
|
|
9131
9229
|
}
|
|
9230
|
+
},
|
|
9231
|
+
{
|
|
9232
|
+
version: 51,
|
|
9233
|
+
name: "memory-md-rolling-window-lineage",
|
|
9234
|
+
up: up51,
|
|
9235
|
+
artifacts: {
|
|
9236
|
+
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
9237
|
+
columns: [
|
|
9238
|
+
{ table: "summary_jobs", column: "session_id" },
|
|
9239
|
+
{ table: "summary_jobs", column: "trigger" },
|
|
9240
|
+
{ table: "summary_jobs", column: "captured_at" },
|
|
9241
|
+
{ table: "summary_jobs", column: "started_at" },
|
|
9242
|
+
{ table: "summary_jobs", column: "ended_at" }
|
|
9243
|
+
]
|
|
9244
|
+
}
|
|
9132
9245
|
}
|
|
9133
9246
|
];
|
|
9134
9247
|
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.86.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.86.0",
|
|
40
40
|
"@types/node": "^22.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|