@signetai/connector-openclaw 0.146.4 → 0.146.5
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 +352 -24
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -10766,6 +10766,155 @@ function up82(db) {
|
|
|
10766
10766
|
`);
|
|
10767
10767
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
10768
10768
|
}
|
|
10769
|
+
var DEPENDENCY_TYPES = new Set([
|
|
10770
|
+
"uses",
|
|
10771
|
+
"requires",
|
|
10772
|
+
"owned_by",
|
|
10773
|
+
"owns",
|
|
10774
|
+
"blocks",
|
|
10775
|
+
"informs",
|
|
10776
|
+
"maintains",
|
|
10777
|
+
"implements",
|
|
10778
|
+
"built",
|
|
10779
|
+
"depends_on",
|
|
10780
|
+
"related_to",
|
|
10781
|
+
"learned_from",
|
|
10782
|
+
"teaches",
|
|
10783
|
+
"knows",
|
|
10784
|
+
"assumes",
|
|
10785
|
+
"supports_claim",
|
|
10786
|
+
"authored_by",
|
|
10787
|
+
"links_to",
|
|
10788
|
+
"contains",
|
|
10789
|
+
"contains_note",
|
|
10790
|
+
"contradicts",
|
|
10791
|
+
"supersedes",
|
|
10792
|
+
"part_of",
|
|
10793
|
+
"produced_artifact",
|
|
10794
|
+
"precedes",
|
|
10795
|
+
"follows",
|
|
10796
|
+
"triggers",
|
|
10797
|
+
"may_execute",
|
|
10798
|
+
"requires_approval_from",
|
|
10799
|
+
"impacts",
|
|
10800
|
+
"produces",
|
|
10801
|
+
"consumes"
|
|
10802
|
+
]);
|
|
10803
|
+
function sqlStringList(values) {
|
|
10804
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
10805
|
+
}
|
|
10806
|
+
function hasTable3(db, table) {
|
|
10807
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
10808
|
+
}
|
|
10809
|
+
function hasColumn12(db, table, column) {
|
|
10810
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
10811
|
+
return rows.some((row) => row.name === column);
|
|
10812
|
+
}
|
|
10813
|
+
function addColumnIfMissing20(db, table, column, definition) {
|
|
10814
|
+
if (!hasColumn12(db, table, column))
|
|
10815
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
10816
|
+
}
|
|
10817
|
+
function documentScopeColumnsPreservingExisting(db) {
|
|
10818
|
+
const preserveAgentId = hasColumn12(db, "documents", "agent_id");
|
|
10819
|
+
const preserveProject = hasColumn12(db, "documents", "project");
|
|
10820
|
+
if (preserveAgentId) {
|
|
10821
|
+
db.exec(`
|
|
10822
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
10823
|
+
SELECT id, agent_id FROM documents
|
|
10824
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
10825
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
10826
|
+
`);
|
|
10827
|
+
}
|
|
10828
|
+
if (preserveProject) {
|
|
10829
|
+
db.exec(`
|
|
10830
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
10831
|
+
SELECT id, project FROM documents
|
|
10832
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
10833
|
+
`);
|
|
10834
|
+
}
|
|
10835
|
+
try {
|
|
10836
|
+
up80(db);
|
|
10837
|
+
if (preserveAgentId) {
|
|
10838
|
+
db.exec(`
|
|
10839
|
+
UPDATE documents
|
|
10840
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
10841
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
10842
|
+
`);
|
|
10843
|
+
}
|
|
10844
|
+
if (preserveProject) {
|
|
10845
|
+
db.exec(`
|
|
10846
|
+
UPDATE documents
|
|
10847
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
10848
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
10849
|
+
`);
|
|
10850
|
+
}
|
|
10851
|
+
} finally {
|
|
10852
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
10853
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
10854
|
+
}
|
|
10855
|
+
}
|
|
10856
|
+
function up83(db) {
|
|
10857
|
+
up79(db);
|
|
10858
|
+
if (hasTable3(db, "documents")) {
|
|
10859
|
+
documentScopeColumnsPreservingExisting(db);
|
|
10860
|
+
}
|
|
10861
|
+
up81(db);
|
|
10862
|
+
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
10863
|
+
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
10864
|
+
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
10865
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
10866
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
10867
|
+
if (!hasTable3(db, "relations") || !hasTable3(db, "entity_dependencies"))
|
|
10868
|
+
return;
|
|
10869
|
+
addColumnIfMissing20(db, "entity_dependencies", "confidence", "REAL");
|
|
10870
|
+
addColumnIfMissing20(db, "entity_dependencies", "reason", "TEXT");
|
|
10871
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_id", "TEXT");
|
|
10872
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_kind", "TEXT");
|
|
10873
|
+
addColumnIfMissing20(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
10874
|
+
addColumnIfMissing20(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
10875
|
+
const relationConfidence = hasColumn12(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
10876
|
+
const relationUpdatedAt = hasColumn12(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
10877
|
+
const sourceAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
10878
|
+
const targetAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
10879
|
+
db.exec(`
|
|
10880
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
10881
|
+
id,
|
|
10882
|
+
source_entity_id,
|
|
10883
|
+
target_entity_id,
|
|
10884
|
+
agent_id,
|
|
10885
|
+
dependency_type,
|
|
10886
|
+
strength,
|
|
10887
|
+
confidence,
|
|
10888
|
+
reason,
|
|
10889
|
+
created_at,
|
|
10890
|
+
updated_at,
|
|
10891
|
+
source_id,
|
|
10892
|
+
source_kind,
|
|
10893
|
+
proposal_evidence,
|
|
10894
|
+
status
|
|
10895
|
+
)
|
|
10896
|
+
SELECT
|
|
10897
|
+
'relation:' || r.id,
|
|
10898
|
+
r.source_entity_id,
|
|
10899
|
+
r.target_entity_id,
|
|
10900
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
10901
|
+
CASE WHEN r.relation_type IN (${sqlStringList(DEPENDENCY_TYPES)}) THEN r.relation_type ELSE 'related_to' END,
|
|
10902
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
10903
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
10904
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
10905
|
+
COALESCE(r.created_at, datetime('now')),
|
|
10906
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
10907
|
+
r.id,
|
|
10908
|
+
'relation',
|
|
10909
|
+
'[]',
|
|
10910
|
+
'active'
|
|
10911
|
+
FROM relations r
|
|
10912
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
10913
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
10914
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
10915
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
10916
|
+
`);
|
|
10917
|
+
}
|
|
10769
10918
|
var MIGRATIONS = [
|
|
10770
10919
|
{
|
|
10771
10920
|
version: 1,
|
|
@@ -11430,6 +11579,21 @@ var MIGRATIONS = [
|
|
|
11430
11579
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
11431
11580
|
]
|
|
11432
11581
|
}
|
|
11582
|
+
},
|
|
11583
|
+
{
|
|
11584
|
+
version: 83,
|
|
11585
|
+
name: "memory-lifecycle-repair",
|
|
11586
|
+
up: up83,
|
|
11587
|
+
artifacts: {
|
|
11588
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
11589
|
+
columns: [
|
|
11590
|
+
{ table: "documents", column: "agent_id" },
|
|
11591
|
+
{ table: "documents", column: "project" },
|
|
11592
|
+
{ table: "memories", column: "superseded_by" },
|
|
11593
|
+
{ table: "memories", column: "superseded_at" },
|
|
11594
|
+
{ table: "memories", column: "superseded_reason" }
|
|
11595
|
+
]
|
|
11596
|
+
}
|
|
11433
11597
|
}
|
|
11434
11598
|
];
|
|
11435
11599
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -18780,7 +18944,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
18780
18944
|
return true;
|
|
18781
18945
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
18782
18946
|
}
|
|
18783
|
-
function
|
|
18947
|
+
function up84(db) {
|
|
18784
18948
|
db.exec(`
|
|
18785
18949
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
18786
18950
|
version INTEGER PRIMARY KEY,
|
|
@@ -18869,31 +19033,31 @@ function up83(db) {
|
|
|
18869
19033
|
} catch {}
|
|
18870
19034
|
createMemoriesFts2(db);
|
|
18871
19035
|
}
|
|
18872
|
-
function
|
|
19036
|
+
function hasColumn13(db, table, column) {
|
|
18873
19037
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
18874
19038
|
return rows.some((r) => r.name === column);
|
|
18875
19039
|
}
|
|
18876
|
-
function
|
|
18877
|
-
if (!
|
|
19040
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
19041
|
+
if (!hasColumn13(db, table, column)) {
|
|
18878
19042
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
18879
19043
|
}
|
|
18880
19044
|
}
|
|
18881
19045
|
function up210(db) {
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
|
|
18889
|
-
|
|
18890
|
-
|
|
18891
|
-
|
|
18892
|
-
|
|
18893
|
-
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
19046
|
+
addColumnIfMissing21(db, "memories", "content_hash", "TEXT");
|
|
19047
|
+
addColumnIfMissing21(db, "memories", "normalized_content", "TEXT");
|
|
19048
|
+
addColumnIfMissing21(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
19049
|
+
addColumnIfMissing21(db, "memories", "deleted_at", "TEXT");
|
|
19050
|
+
addColumnIfMissing21(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
19051
|
+
addColumnIfMissing21(db, "memories", "embedding_model", "TEXT");
|
|
19052
|
+
addColumnIfMissing21(db, "memories", "extraction_model", "TEXT");
|
|
19053
|
+
addColumnIfMissing21(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
19054
|
+
addColumnIfMissing21(db, "memories", "who", "TEXT");
|
|
19055
|
+
addColumnIfMissing21(db, "memories", "why", "TEXT");
|
|
19056
|
+
addColumnIfMissing21(db, "memories", "project", "TEXT");
|
|
19057
|
+
addColumnIfMissing21(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
19058
|
+
addColumnIfMissing21(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
19059
|
+
addColumnIfMissing21(db, "memories", "last_accessed", "TEXT");
|
|
19060
|
+
addColumnIfMissing21(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
18897
19061
|
db.exec(`
|
|
18898
19062
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
18899
19063
|
id TEXT PRIMARY KEY,
|
|
@@ -19155,7 +19319,7 @@ function up710(db) {
|
|
|
19155
19319
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
19156
19320
|
}
|
|
19157
19321
|
}
|
|
19158
|
-
function
|
|
19322
|
+
function up85(db) {
|
|
19159
19323
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
19160
19324
|
if (tables.length === 0)
|
|
19161
19325
|
return;
|
|
@@ -20424,7 +20588,7 @@ function up492(db) {
|
|
|
20424
20588
|
);
|
|
20425
20589
|
`);
|
|
20426
20590
|
}
|
|
20427
|
-
function
|
|
20591
|
+
function hasTable4(db, name) {
|
|
20428
20592
|
return db.prepare(`SELECT name
|
|
20429
20593
|
FROM sqlite_master
|
|
20430
20594
|
WHERE type = 'table' AND name = ?
|
|
@@ -20454,7 +20618,7 @@ function up502(db) {
|
|
|
20454
20618
|
CREATE INDEX IF NOT EXISTS idx_entity_dependency_history_created
|
|
20455
20619
|
ON entity_dependency_history(created_at DESC);
|
|
20456
20620
|
`);
|
|
20457
|
-
if (!
|
|
20621
|
+
if (!hasTable4(db, "entity_dependencies"))
|
|
20458
20622
|
return;
|
|
20459
20623
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_insert");
|
|
20460
20624
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_update");
|
|
@@ -21464,11 +21628,160 @@ function up822(db) {
|
|
|
21464
21628
|
`);
|
|
21465
21629
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
21466
21630
|
}
|
|
21631
|
+
var DEPENDENCY_TYPES2 = new Set([
|
|
21632
|
+
"uses",
|
|
21633
|
+
"requires",
|
|
21634
|
+
"owned_by",
|
|
21635
|
+
"owns",
|
|
21636
|
+
"blocks",
|
|
21637
|
+
"informs",
|
|
21638
|
+
"maintains",
|
|
21639
|
+
"implements",
|
|
21640
|
+
"built",
|
|
21641
|
+
"depends_on",
|
|
21642
|
+
"related_to",
|
|
21643
|
+
"learned_from",
|
|
21644
|
+
"teaches",
|
|
21645
|
+
"knows",
|
|
21646
|
+
"assumes",
|
|
21647
|
+
"supports_claim",
|
|
21648
|
+
"authored_by",
|
|
21649
|
+
"links_to",
|
|
21650
|
+
"contains",
|
|
21651
|
+
"contains_note",
|
|
21652
|
+
"contradicts",
|
|
21653
|
+
"supersedes",
|
|
21654
|
+
"part_of",
|
|
21655
|
+
"produced_artifact",
|
|
21656
|
+
"precedes",
|
|
21657
|
+
"follows",
|
|
21658
|
+
"triggers",
|
|
21659
|
+
"may_execute",
|
|
21660
|
+
"requires_approval_from",
|
|
21661
|
+
"impacts",
|
|
21662
|
+
"produces",
|
|
21663
|
+
"consumes"
|
|
21664
|
+
]);
|
|
21665
|
+
function sqlStringList2(values) {
|
|
21666
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
21667
|
+
}
|
|
21668
|
+
function hasTable32(db, table) {
|
|
21669
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
21670
|
+
}
|
|
21671
|
+
function hasColumn122(db, table, column) {
|
|
21672
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
21673
|
+
return rows.some((row) => row.name === column);
|
|
21674
|
+
}
|
|
21675
|
+
function addColumnIfMissing202(db, table, column, definition) {
|
|
21676
|
+
if (!hasColumn122(db, table, column))
|
|
21677
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
21678
|
+
}
|
|
21679
|
+
function documentScopeColumnsPreservingExisting2(db) {
|
|
21680
|
+
const preserveAgentId = hasColumn122(db, "documents", "agent_id");
|
|
21681
|
+
const preserveProject = hasColumn122(db, "documents", "project");
|
|
21682
|
+
if (preserveAgentId) {
|
|
21683
|
+
db.exec(`
|
|
21684
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
21685
|
+
SELECT id, agent_id FROM documents
|
|
21686
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
21687
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
21688
|
+
`);
|
|
21689
|
+
}
|
|
21690
|
+
if (preserveProject) {
|
|
21691
|
+
db.exec(`
|
|
21692
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
21693
|
+
SELECT id, project FROM documents
|
|
21694
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
21695
|
+
`);
|
|
21696
|
+
}
|
|
21697
|
+
try {
|
|
21698
|
+
up802(db);
|
|
21699
|
+
if (preserveAgentId) {
|
|
21700
|
+
db.exec(`
|
|
21701
|
+
UPDATE documents
|
|
21702
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
21703
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
21704
|
+
`);
|
|
21705
|
+
}
|
|
21706
|
+
if (preserveProject) {
|
|
21707
|
+
db.exec(`
|
|
21708
|
+
UPDATE documents
|
|
21709
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
21710
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
21711
|
+
`);
|
|
21712
|
+
}
|
|
21713
|
+
} finally {
|
|
21714
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
21715
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
21716
|
+
}
|
|
21717
|
+
}
|
|
21718
|
+
function up832(db) {
|
|
21719
|
+
up792(db);
|
|
21720
|
+
if (hasTable32(db, "documents")) {
|
|
21721
|
+
documentScopeColumnsPreservingExisting2(db);
|
|
21722
|
+
}
|
|
21723
|
+
up812(db);
|
|
21724
|
+
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
21725
|
+
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
21726
|
+
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
21727
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
21728
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
21729
|
+
if (!hasTable32(db, "relations") || !hasTable32(db, "entity_dependencies"))
|
|
21730
|
+
return;
|
|
21731
|
+
addColumnIfMissing202(db, "entity_dependencies", "confidence", "REAL");
|
|
21732
|
+
addColumnIfMissing202(db, "entity_dependencies", "reason", "TEXT");
|
|
21733
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_id", "TEXT");
|
|
21734
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_kind", "TEXT");
|
|
21735
|
+
addColumnIfMissing202(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
21736
|
+
addColumnIfMissing202(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
21737
|
+
const relationConfidence = hasColumn122(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
21738
|
+
const relationUpdatedAt = hasColumn122(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
21739
|
+
const sourceAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
21740
|
+
const targetAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
21741
|
+
db.exec(`
|
|
21742
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
21743
|
+
id,
|
|
21744
|
+
source_entity_id,
|
|
21745
|
+
target_entity_id,
|
|
21746
|
+
agent_id,
|
|
21747
|
+
dependency_type,
|
|
21748
|
+
strength,
|
|
21749
|
+
confidence,
|
|
21750
|
+
reason,
|
|
21751
|
+
created_at,
|
|
21752
|
+
updated_at,
|
|
21753
|
+
source_id,
|
|
21754
|
+
source_kind,
|
|
21755
|
+
proposal_evidence,
|
|
21756
|
+
status
|
|
21757
|
+
)
|
|
21758
|
+
SELECT
|
|
21759
|
+
'relation:' || r.id,
|
|
21760
|
+
r.source_entity_id,
|
|
21761
|
+
r.target_entity_id,
|
|
21762
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
21763
|
+
CASE WHEN r.relation_type IN (${sqlStringList2(DEPENDENCY_TYPES2)}) THEN r.relation_type ELSE 'related_to' END,
|
|
21764
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
21765
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
21766
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
21767
|
+
COALESCE(r.created_at, datetime('now')),
|
|
21768
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
21769
|
+
r.id,
|
|
21770
|
+
'relation',
|
|
21771
|
+
'[]',
|
|
21772
|
+
'active'
|
|
21773
|
+
FROM relations r
|
|
21774
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
21775
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
21776
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
21777
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
21778
|
+
`);
|
|
21779
|
+
}
|
|
21467
21780
|
var MIGRATIONS2 = [
|
|
21468
21781
|
{
|
|
21469
21782
|
version: 1,
|
|
21470
21783
|
name: "baseline",
|
|
21471
|
-
up:
|
|
21784
|
+
up: up84,
|
|
21472
21785
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
21473
21786
|
},
|
|
21474
21787
|
{
|
|
@@ -21517,7 +21830,7 @@ var MIGRATIONS2 = [
|
|
|
21517
21830
|
{
|
|
21518
21831
|
version: 8,
|
|
21519
21832
|
name: "embeddings-unique-hash",
|
|
21520
|
-
up:
|
|
21833
|
+
up: up85
|
|
21521
21834
|
},
|
|
21522
21835
|
{
|
|
21523
21836
|
version: 9,
|
|
@@ -22128,6 +22441,21 @@ var MIGRATIONS2 = [
|
|
|
22128
22441
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
22129
22442
|
]
|
|
22130
22443
|
}
|
|
22444
|
+
},
|
|
22445
|
+
{
|
|
22446
|
+
version: 83,
|
|
22447
|
+
name: "memory-lifecycle-repair",
|
|
22448
|
+
up: up832,
|
|
22449
|
+
artifacts: {
|
|
22450
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
22451
|
+
columns: [
|
|
22452
|
+
{ table: "documents", column: "agent_id" },
|
|
22453
|
+
{ table: "documents", column: "project" },
|
|
22454
|
+
{ table: "memories", column: "superseded_by" },
|
|
22455
|
+
{ table: "memories", column: "superseded_at" },
|
|
22456
|
+
{ table: "memories", column: "superseded_reason" }
|
|
22457
|
+
]
|
|
22458
|
+
}
|
|
22131
22459
|
}
|
|
22132
22460
|
];
|
|
22133
22461
|
var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-openclaw",
|
|
3
|
-
"version": "0.146.
|
|
3
|
+
"version": "0.146.5",
|
|
4
4
|
"description": "Signet connector for OpenClaw - configures workspace and memory hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"test": "bun test"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@signetai/connector-base": "0.146.
|
|
29
|
-
"@signetai/core": "0.146.
|
|
28
|
+
"@signetai/connector-base": "0.146.5",
|
|
29
|
+
"@signetai/core": "0.146.5",
|
|
30
30
|
"json5": "^2.2.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|