@signetai/signet-memory-openclaw 0.119.0 → 0.120.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 +66 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9211,6 +9211,57 @@ function up69(db) {
|
|
|
9211
9211
|
WHERE content_key IS NOT NULL;
|
|
9212
9212
|
`);
|
|
9213
9213
|
}
|
|
9214
|
+
function hasColumn9(db, table, column) {
|
|
9215
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9216
|
+
return rows.some((row) => row.name === column);
|
|
9217
|
+
}
|
|
9218
|
+
function addColumnIfMissing18(db, table, column, definition) {
|
|
9219
|
+
if (!hasColumn9(db, table, column)) {
|
|
9220
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9221
|
+
}
|
|
9222
|
+
}
|
|
9223
|
+
function backfillVersionRoots(db) {
|
|
9224
|
+
db.exec(`
|
|
9225
|
+
UPDATE entity_attributes
|
|
9226
|
+
SET version_root_id = id
|
|
9227
|
+
WHERE version_root_id IS NULL
|
|
9228
|
+
`);
|
|
9229
|
+
}
|
|
9230
|
+
function up70(db) {
|
|
9231
|
+
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
9232
|
+
addColumnIfMissing18(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
9233
|
+
addColumnIfMissing18(db, table, "archived_at", "TEXT");
|
|
9234
|
+
addColumnIfMissing18(db, table, "archived_by", "TEXT");
|
|
9235
|
+
addColumnIfMissing18(db, table, "archive_reason", "TEXT");
|
|
9236
|
+
}
|
|
9237
|
+
for (const table of ["entities", "entity_aspects"]) {
|
|
9238
|
+
addColumnIfMissing18(db, table, "proposal_id", "TEXT");
|
|
9239
|
+
addColumnIfMissing18(db, table, "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
9240
|
+
}
|
|
9241
|
+
addColumnIfMissing18(db, "entity_attributes", "version", "INTEGER NOT NULL DEFAULT 1");
|
|
9242
|
+
addColumnIfMissing18(db, "entity_attributes", "version_root_id", "TEXT");
|
|
9243
|
+
addColumnIfMissing18(db, "entity_attributes", "previous_attribute_id", "TEXT");
|
|
9244
|
+
addColumnIfMissing18(db, "entity_attributes", "archived_at", "TEXT");
|
|
9245
|
+
addColumnIfMissing18(db, "entity_attributes", "archived_by", "TEXT");
|
|
9246
|
+
addColumnIfMissing18(db, "entity_attributes", "archive_reason", "TEXT");
|
|
9247
|
+
backfillVersionRoots(db);
|
|
9248
|
+
db.exec(`
|
|
9249
|
+
CREATE INDEX IF NOT EXISTS idx_entities_status
|
|
9250
|
+
ON entities(agent_id, status, updated_at DESC);
|
|
9251
|
+
CREATE INDEX IF NOT EXISTS idx_entity_aspects_status
|
|
9252
|
+
ON entity_aspects(agent_id, entity_id, status);
|
|
9253
|
+
CREATE INDEX IF NOT EXISTS idx_entity_attributes_version_root
|
|
9254
|
+
ON entity_attributes(agent_id, version_root_id, version DESC);
|
|
9255
|
+
CREATE INDEX IF NOT EXISTS idx_entity_attributes_claim_version
|
|
9256
|
+
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, version DESC);
|
|
9257
|
+
CREATE INDEX IF NOT EXISTS idx_entity_dependencies_status
|
|
9258
|
+
ON entity_dependencies(agent_id, status, updated_at DESC);
|
|
9259
|
+
CREATE INDEX IF NOT EXISTS idx_entities_proposal
|
|
9260
|
+
ON entities(agent_id, proposal_id);
|
|
9261
|
+
CREATE INDEX IF NOT EXISTS idx_entity_aspects_proposal
|
|
9262
|
+
ON entity_aspects(agent_id, proposal_id);
|
|
9263
|
+
`);
|
|
9264
|
+
}
|
|
9214
9265
|
var MIGRATIONS = [
|
|
9215
9266
|
{
|
|
9216
9267
|
version: 1,
|
|
@@ -9749,6 +9800,21 @@ var MIGRATIONS = [
|
|
|
9749
9800
|
artifacts: {
|
|
9750
9801
|
tables: ["daily_reflections"]
|
|
9751
9802
|
}
|
|
9803
|
+
},
|
|
9804
|
+
{
|
|
9805
|
+
version: 70,
|
|
9806
|
+
name: "ontology-control-plane-state",
|
|
9807
|
+
up: up70,
|
|
9808
|
+
artifacts: {
|
|
9809
|
+
columns: [
|
|
9810
|
+
{ table: "entities", column: "status" },
|
|
9811
|
+
{ table: "entity_aspects", column: "status" },
|
|
9812
|
+
{ table: "entity_attributes", column: "version" },
|
|
9813
|
+
{ table: "entity_attributes", column: "version_root_id" },
|
|
9814
|
+
{ table: "entity_attributes", column: "previous_attribute_id" },
|
|
9815
|
+
{ table: "entity_dependencies", column: "status" }
|
|
9816
|
+
]
|
|
9817
|
+
}
|
|
9752
9818
|
}
|
|
9753
9819
|
];
|
|
9754
9820
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|