@signetai/connector-forge 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
|
@@ -9633,6 +9633,155 @@ function up82(db) {
|
|
|
9633
9633
|
`);
|
|
9634
9634
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
9635
9635
|
}
|
|
9636
|
+
var DEPENDENCY_TYPES = new Set([
|
|
9637
|
+
"uses",
|
|
9638
|
+
"requires",
|
|
9639
|
+
"owned_by",
|
|
9640
|
+
"owns",
|
|
9641
|
+
"blocks",
|
|
9642
|
+
"informs",
|
|
9643
|
+
"maintains",
|
|
9644
|
+
"implements",
|
|
9645
|
+
"built",
|
|
9646
|
+
"depends_on",
|
|
9647
|
+
"related_to",
|
|
9648
|
+
"learned_from",
|
|
9649
|
+
"teaches",
|
|
9650
|
+
"knows",
|
|
9651
|
+
"assumes",
|
|
9652
|
+
"supports_claim",
|
|
9653
|
+
"authored_by",
|
|
9654
|
+
"links_to",
|
|
9655
|
+
"contains",
|
|
9656
|
+
"contains_note",
|
|
9657
|
+
"contradicts",
|
|
9658
|
+
"supersedes",
|
|
9659
|
+
"part_of",
|
|
9660
|
+
"produced_artifact",
|
|
9661
|
+
"precedes",
|
|
9662
|
+
"follows",
|
|
9663
|
+
"triggers",
|
|
9664
|
+
"may_execute",
|
|
9665
|
+
"requires_approval_from",
|
|
9666
|
+
"impacts",
|
|
9667
|
+
"produces",
|
|
9668
|
+
"consumes"
|
|
9669
|
+
]);
|
|
9670
|
+
function sqlStringList(values) {
|
|
9671
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
9672
|
+
}
|
|
9673
|
+
function hasTable3(db, table) {
|
|
9674
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
9675
|
+
}
|
|
9676
|
+
function hasColumn12(db, table, column) {
|
|
9677
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9678
|
+
return rows.some((row) => row.name === column);
|
|
9679
|
+
}
|
|
9680
|
+
function addColumnIfMissing20(db, table, column, definition) {
|
|
9681
|
+
if (!hasColumn12(db, table, column))
|
|
9682
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9683
|
+
}
|
|
9684
|
+
function documentScopeColumnsPreservingExisting(db) {
|
|
9685
|
+
const preserveAgentId = hasColumn12(db, "documents", "agent_id");
|
|
9686
|
+
const preserveProject = hasColumn12(db, "documents", "project");
|
|
9687
|
+
if (preserveAgentId) {
|
|
9688
|
+
db.exec(`
|
|
9689
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
9690
|
+
SELECT id, agent_id FROM documents
|
|
9691
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
9692
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
9693
|
+
`);
|
|
9694
|
+
}
|
|
9695
|
+
if (preserveProject) {
|
|
9696
|
+
db.exec(`
|
|
9697
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
9698
|
+
SELECT id, project FROM documents
|
|
9699
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
9700
|
+
`);
|
|
9701
|
+
}
|
|
9702
|
+
try {
|
|
9703
|
+
up80(db);
|
|
9704
|
+
if (preserveAgentId) {
|
|
9705
|
+
db.exec(`
|
|
9706
|
+
UPDATE documents
|
|
9707
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
9708
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
9709
|
+
`);
|
|
9710
|
+
}
|
|
9711
|
+
if (preserveProject) {
|
|
9712
|
+
db.exec(`
|
|
9713
|
+
UPDATE documents
|
|
9714
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
9715
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
9716
|
+
`);
|
|
9717
|
+
}
|
|
9718
|
+
} finally {
|
|
9719
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
9720
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
9721
|
+
}
|
|
9722
|
+
}
|
|
9723
|
+
function up83(db) {
|
|
9724
|
+
up79(db);
|
|
9725
|
+
if (hasTable3(db, "documents")) {
|
|
9726
|
+
documentScopeColumnsPreservingExisting(db);
|
|
9727
|
+
}
|
|
9728
|
+
up81(db);
|
|
9729
|
+
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
9730
|
+
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
9731
|
+
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
9732
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
9733
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
9734
|
+
if (!hasTable3(db, "relations") || !hasTable3(db, "entity_dependencies"))
|
|
9735
|
+
return;
|
|
9736
|
+
addColumnIfMissing20(db, "entity_dependencies", "confidence", "REAL");
|
|
9737
|
+
addColumnIfMissing20(db, "entity_dependencies", "reason", "TEXT");
|
|
9738
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_id", "TEXT");
|
|
9739
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_kind", "TEXT");
|
|
9740
|
+
addColumnIfMissing20(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
9741
|
+
addColumnIfMissing20(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
9742
|
+
const relationConfidence = hasColumn12(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
9743
|
+
const relationUpdatedAt = hasColumn12(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
9744
|
+
const sourceAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
9745
|
+
const targetAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
9746
|
+
db.exec(`
|
|
9747
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
9748
|
+
id,
|
|
9749
|
+
source_entity_id,
|
|
9750
|
+
target_entity_id,
|
|
9751
|
+
agent_id,
|
|
9752
|
+
dependency_type,
|
|
9753
|
+
strength,
|
|
9754
|
+
confidence,
|
|
9755
|
+
reason,
|
|
9756
|
+
created_at,
|
|
9757
|
+
updated_at,
|
|
9758
|
+
source_id,
|
|
9759
|
+
source_kind,
|
|
9760
|
+
proposal_evidence,
|
|
9761
|
+
status
|
|
9762
|
+
)
|
|
9763
|
+
SELECT
|
|
9764
|
+
'relation:' || r.id,
|
|
9765
|
+
r.source_entity_id,
|
|
9766
|
+
r.target_entity_id,
|
|
9767
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
9768
|
+
CASE WHEN r.relation_type IN (${sqlStringList(DEPENDENCY_TYPES)}) THEN r.relation_type ELSE 'related_to' END,
|
|
9769
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
9770
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
9771
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
9772
|
+
COALESCE(r.created_at, datetime('now')),
|
|
9773
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
9774
|
+
r.id,
|
|
9775
|
+
'relation',
|
|
9776
|
+
'[]',
|
|
9777
|
+
'active'
|
|
9778
|
+
FROM relations r
|
|
9779
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
9780
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
9781
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
9782
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
9783
|
+
`);
|
|
9784
|
+
}
|
|
9636
9785
|
var MIGRATIONS = [
|
|
9637
9786
|
{
|
|
9638
9787
|
version: 1,
|
|
@@ -10297,6 +10446,21 @@ var MIGRATIONS = [
|
|
|
10297
10446
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
10298
10447
|
]
|
|
10299
10448
|
}
|
|
10449
|
+
},
|
|
10450
|
+
{
|
|
10451
|
+
version: 83,
|
|
10452
|
+
name: "memory-lifecycle-repair",
|
|
10453
|
+
up: up83,
|
|
10454
|
+
artifacts: {
|
|
10455
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
10456
|
+
columns: [
|
|
10457
|
+
{ table: "documents", column: "agent_id" },
|
|
10458
|
+
{ table: "documents", column: "project" },
|
|
10459
|
+
{ table: "memories", column: "superseded_by" },
|
|
10460
|
+
{ table: "memories", column: "superseded_at" },
|
|
10461
|
+
{ table: "memories", column: "superseded_reason" }
|
|
10462
|
+
]
|
|
10463
|
+
}
|
|
10300
10464
|
}
|
|
10301
10465
|
];
|
|
10302
10466
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -17696,7 +17860,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17696
17860
|
return true;
|
|
17697
17861
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17698
17862
|
}
|
|
17699
|
-
function
|
|
17863
|
+
function up84(db) {
|
|
17700
17864
|
db.exec(`
|
|
17701
17865
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17702
17866
|
version INTEGER PRIMARY KEY,
|
|
@@ -17785,31 +17949,31 @@ function up83(db) {
|
|
|
17785
17949
|
} catch {}
|
|
17786
17950
|
createMemoriesFts2(db);
|
|
17787
17951
|
}
|
|
17788
|
-
function
|
|
17952
|
+
function hasColumn13(db, table, column) {
|
|
17789
17953
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17790
17954
|
return rows.some((r) => r.name === column);
|
|
17791
17955
|
}
|
|
17792
|
-
function
|
|
17793
|
-
if (!
|
|
17956
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
17957
|
+
if (!hasColumn13(db, table, column)) {
|
|
17794
17958
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17795
17959
|
}
|
|
17796
17960
|
}
|
|
17797
17961
|
function up210(db) {
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
|
|
17962
|
+
addColumnIfMissing21(db, "memories", "content_hash", "TEXT");
|
|
17963
|
+
addColumnIfMissing21(db, "memories", "normalized_content", "TEXT");
|
|
17964
|
+
addColumnIfMissing21(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
17965
|
+
addColumnIfMissing21(db, "memories", "deleted_at", "TEXT");
|
|
17966
|
+
addColumnIfMissing21(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
17967
|
+
addColumnIfMissing21(db, "memories", "embedding_model", "TEXT");
|
|
17968
|
+
addColumnIfMissing21(db, "memories", "extraction_model", "TEXT");
|
|
17969
|
+
addColumnIfMissing21(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
17970
|
+
addColumnIfMissing21(db, "memories", "who", "TEXT");
|
|
17971
|
+
addColumnIfMissing21(db, "memories", "why", "TEXT");
|
|
17972
|
+
addColumnIfMissing21(db, "memories", "project", "TEXT");
|
|
17973
|
+
addColumnIfMissing21(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
17974
|
+
addColumnIfMissing21(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
17975
|
+
addColumnIfMissing21(db, "memories", "last_accessed", "TEXT");
|
|
17976
|
+
addColumnIfMissing21(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17813
17977
|
db.exec(`
|
|
17814
17978
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17815
17979
|
id TEXT PRIMARY KEY,
|
|
@@ -18071,7 +18235,7 @@ function up710(db) {
|
|
|
18071
18235
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18072
18236
|
}
|
|
18073
18237
|
}
|
|
18074
|
-
function
|
|
18238
|
+
function up85(db) {
|
|
18075
18239
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18076
18240
|
if (tables.length === 0)
|
|
18077
18241
|
return;
|
|
@@ -19340,7 +19504,7 @@ function up492(db) {
|
|
|
19340
19504
|
);
|
|
19341
19505
|
`);
|
|
19342
19506
|
}
|
|
19343
|
-
function
|
|
19507
|
+
function hasTable4(db, name) {
|
|
19344
19508
|
return db.prepare(`SELECT name
|
|
19345
19509
|
FROM sqlite_master
|
|
19346
19510
|
WHERE type = 'table' AND name = ?
|
|
@@ -19370,7 +19534,7 @@ function up502(db) {
|
|
|
19370
19534
|
CREATE INDEX IF NOT EXISTS idx_entity_dependency_history_created
|
|
19371
19535
|
ON entity_dependency_history(created_at DESC);
|
|
19372
19536
|
`);
|
|
19373
|
-
if (!
|
|
19537
|
+
if (!hasTable4(db, "entity_dependencies"))
|
|
19374
19538
|
return;
|
|
19375
19539
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_insert");
|
|
19376
19540
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_update");
|
|
@@ -20380,11 +20544,160 @@ function up822(db) {
|
|
|
20380
20544
|
`);
|
|
20381
20545
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
20382
20546
|
}
|
|
20547
|
+
var DEPENDENCY_TYPES2 = new Set([
|
|
20548
|
+
"uses",
|
|
20549
|
+
"requires",
|
|
20550
|
+
"owned_by",
|
|
20551
|
+
"owns",
|
|
20552
|
+
"blocks",
|
|
20553
|
+
"informs",
|
|
20554
|
+
"maintains",
|
|
20555
|
+
"implements",
|
|
20556
|
+
"built",
|
|
20557
|
+
"depends_on",
|
|
20558
|
+
"related_to",
|
|
20559
|
+
"learned_from",
|
|
20560
|
+
"teaches",
|
|
20561
|
+
"knows",
|
|
20562
|
+
"assumes",
|
|
20563
|
+
"supports_claim",
|
|
20564
|
+
"authored_by",
|
|
20565
|
+
"links_to",
|
|
20566
|
+
"contains",
|
|
20567
|
+
"contains_note",
|
|
20568
|
+
"contradicts",
|
|
20569
|
+
"supersedes",
|
|
20570
|
+
"part_of",
|
|
20571
|
+
"produced_artifact",
|
|
20572
|
+
"precedes",
|
|
20573
|
+
"follows",
|
|
20574
|
+
"triggers",
|
|
20575
|
+
"may_execute",
|
|
20576
|
+
"requires_approval_from",
|
|
20577
|
+
"impacts",
|
|
20578
|
+
"produces",
|
|
20579
|
+
"consumes"
|
|
20580
|
+
]);
|
|
20581
|
+
function sqlStringList2(values) {
|
|
20582
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
20583
|
+
}
|
|
20584
|
+
function hasTable32(db, table) {
|
|
20585
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
20586
|
+
}
|
|
20587
|
+
function hasColumn122(db, table, column) {
|
|
20588
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20589
|
+
return rows.some((row) => row.name === column);
|
|
20590
|
+
}
|
|
20591
|
+
function addColumnIfMissing202(db, table, column, definition) {
|
|
20592
|
+
if (!hasColumn122(db, table, column))
|
|
20593
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20594
|
+
}
|
|
20595
|
+
function documentScopeColumnsPreservingExisting2(db) {
|
|
20596
|
+
const preserveAgentId = hasColumn122(db, "documents", "agent_id");
|
|
20597
|
+
const preserveProject = hasColumn122(db, "documents", "project");
|
|
20598
|
+
if (preserveAgentId) {
|
|
20599
|
+
db.exec(`
|
|
20600
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
20601
|
+
SELECT id, agent_id FROM documents
|
|
20602
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
20603
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
20604
|
+
`);
|
|
20605
|
+
}
|
|
20606
|
+
if (preserveProject) {
|
|
20607
|
+
db.exec(`
|
|
20608
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
20609
|
+
SELECT id, project FROM documents
|
|
20610
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
20611
|
+
`);
|
|
20612
|
+
}
|
|
20613
|
+
try {
|
|
20614
|
+
up802(db);
|
|
20615
|
+
if (preserveAgentId) {
|
|
20616
|
+
db.exec(`
|
|
20617
|
+
UPDATE documents
|
|
20618
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20619
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20620
|
+
`);
|
|
20621
|
+
}
|
|
20622
|
+
if (preserveProject) {
|
|
20623
|
+
db.exec(`
|
|
20624
|
+
UPDATE documents
|
|
20625
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20626
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20627
|
+
`);
|
|
20628
|
+
}
|
|
20629
|
+
} finally {
|
|
20630
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
20631
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
20632
|
+
}
|
|
20633
|
+
}
|
|
20634
|
+
function up832(db) {
|
|
20635
|
+
up792(db);
|
|
20636
|
+
if (hasTable32(db, "documents")) {
|
|
20637
|
+
documentScopeColumnsPreservingExisting2(db);
|
|
20638
|
+
}
|
|
20639
|
+
up812(db);
|
|
20640
|
+
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
20641
|
+
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
20642
|
+
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
20643
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
20644
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
20645
|
+
if (!hasTable32(db, "relations") || !hasTable32(db, "entity_dependencies"))
|
|
20646
|
+
return;
|
|
20647
|
+
addColumnIfMissing202(db, "entity_dependencies", "confidence", "REAL");
|
|
20648
|
+
addColumnIfMissing202(db, "entity_dependencies", "reason", "TEXT");
|
|
20649
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_id", "TEXT");
|
|
20650
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_kind", "TEXT");
|
|
20651
|
+
addColumnIfMissing202(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
20652
|
+
addColumnIfMissing202(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
20653
|
+
const relationConfidence = hasColumn122(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
20654
|
+
const relationUpdatedAt = hasColumn122(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
20655
|
+
const sourceAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
20656
|
+
const targetAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
20657
|
+
db.exec(`
|
|
20658
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
20659
|
+
id,
|
|
20660
|
+
source_entity_id,
|
|
20661
|
+
target_entity_id,
|
|
20662
|
+
agent_id,
|
|
20663
|
+
dependency_type,
|
|
20664
|
+
strength,
|
|
20665
|
+
confidence,
|
|
20666
|
+
reason,
|
|
20667
|
+
created_at,
|
|
20668
|
+
updated_at,
|
|
20669
|
+
source_id,
|
|
20670
|
+
source_kind,
|
|
20671
|
+
proposal_evidence,
|
|
20672
|
+
status
|
|
20673
|
+
)
|
|
20674
|
+
SELECT
|
|
20675
|
+
'relation:' || r.id,
|
|
20676
|
+
r.source_entity_id,
|
|
20677
|
+
r.target_entity_id,
|
|
20678
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
20679
|
+
CASE WHEN r.relation_type IN (${sqlStringList2(DEPENDENCY_TYPES2)}) THEN r.relation_type ELSE 'related_to' END,
|
|
20680
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
20681
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
20682
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
20683
|
+
COALESCE(r.created_at, datetime('now')),
|
|
20684
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
20685
|
+
r.id,
|
|
20686
|
+
'relation',
|
|
20687
|
+
'[]',
|
|
20688
|
+
'active'
|
|
20689
|
+
FROM relations r
|
|
20690
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
20691
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
20692
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
20693
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
20694
|
+
`);
|
|
20695
|
+
}
|
|
20383
20696
|
var MIGRATIONS2 = [
|
|
20384
20697
|
{
|
|
20385
20698
|
version: 1,
|
|
20386
20699
|
name: "baseline",
|
|
20387
|
-
up:
|
|
20700
|
+
up: up84,
|
|
20388
20701
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20389
20702
|
},
|
|
20390
20703
|
{
|
|
@@ -20433,7 +20746,7 @@ var MIGRATIONS2 = [
|
|
|
20433
20746
|
{
|
|
20434
20747
|
version: 8,
|
|
20435
20748
|
name: "embeddings-unique-hash",
|
|
20436
|
-
up:
|
|
20749
|
+
up: up85
|
|
20437
20750
|
},
|
|
20438
20751
|
{
|
|
20439
20752
|
version: 9,
|
|
@@ -21044,6 +21357,21 @@ var MIGRATIONS2 = [
|
|
|
21044
21357
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
21045
21358
|
]
|
|
21046
21359
|
}
|
|
21360
|
+
},
|
|
21361
|
+
{
|
|
21362
|
+
version: 83,
|
|
21363
|
+
name: "memory-lifecycle-repair",
|
|
21364
|
+
up: up832,
|
|
21365
|
+
artifacts: {
|
|
21366
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
21367
|
+
columns: [
|
|
21368
|
+
{ table: "documents", column: "agent_id" },
|
|
21369
|
+
{ table: "documents", column: "project" },
|
|
21370
|
+
{ table: "memories", column: "superseded_by" },
|
|
21371
|
+
{ table: "memories", column: "superseded_at" },
|
|
21372
|
+
{ table: "memories", column: "superseded_reason" }
|
|
21373
|
+
]
|
|
21374
|
+
}
|
|
21047
21375
|
}
|
|
21048
21376
|
];
|
|
21049
21377
|
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-forge",
|
|
3
|
-
"version": "0.146.
|
|
3
|
+
"version": "0.146.5",
|
|
4
4
|
"description": "Signet connector for ForgeCode - installs MCP, identity, and skills integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"typecheck": "tsc --noEmit"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@signetai/connector-base": "0.146.
|
|
28
|
-
"@signetai/core": "0.146.
|
|
27
|
+
"@signetai/connector-base": "0.146.5",
|
|
28
|
+
"@signetai/core": "0.146.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.0.0",
|