@signetai/connector-gemini 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;
|
|
@@ -17693,7 +17857,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17693
17857
|
return true;
|
|
17694
17858
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17695
17859
|
}
|
|
17696
|
-
function
|
|
17860
|
+
function up84(db) {
|
|
17697
17861
|
db.exec(`
|
|
17698
17862
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17699
17863
|
version INTEGER PRIMARY KEY,
|
|
@@ -17782,31 +17946,31 @@ function up83(db) {
|
|
|
17782
17946
|
} catch {}
|
|
17783
17947
|
createMemoriesFts2(db);
|
|
17784
17948
|
}
|
|
17785
|
-
function
|
|
17949
|
+
function hasColumn13(db, table, column) {
|
|
17786
17950
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17787
17951
|
return rows.some((r) => r.name === column);
|
|
17788
17952
|
}
|
|
17789
|
-
function
|
|
17790
|
-
if (!
|
|
17953
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
17954
|
+
if (!hasColumn13(db, table, column)) {
|
|
17791
17955
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17792
17956
|
}
|
|
17793
17957
|
}
|
|
17794
17958
|
function up210(db) {
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17959
|
+
addColumnIfMissing21(db, "memories", "content_hash", "TEXT");
|
|
17960
|
+
addColumnIfMissing21(db, "memories", "normalized_content", "TEXT");
|
|
17961
|
+
addColumnIfMissing21(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
17962
|
+
addColumnIfMissing21(db, "memories", "deleted_at", "TEXT");
|
|
17963
|
+
addColumnIfMissing21(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
17964
|
+
addColumnIfMissing21(db, "memories", "embedding_model", "TEXT");
|
|
17965
|
+
addColumnIfMissing21(db, "memories", "extraction_model", "TEXT");
|
|
17966
|
+
addColumnIfMissing21(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
17967
|
+
addColumnIfMissing21(db, "memories", "who", "TEXT");
|
|
17968
|
+
addColumnIfMissing21(db, "memories", "why", "TEXT");
|
|
17969
|
+
addColumnIfMissing21(db, "memories", "project", "TEXT");
|
|
17970
|
+
addColumnIfMissing21(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
17971
|
+
addColumnIfMissing21(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
17972
|
+
addColumnIfMissing21(db, "memories", "last_accessed", "TEXT");
|
|
17973
|
+
addColumnIfMissing21(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17810
17974
|
db.exec(`
|
|
17811
17975
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17812
17976
|
id TEXT PRIMARY KEY,
|
|
@@ -18068,7 +18232,7 @@ function up710(db) {
|
|
|
18068
18232
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18069
18233
|
}
|
|
18070
18234
|
}
|
|
18071
|
-
function
|
|
18235
|
+
function up85(db) {
|
|
18072
18236
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18073
18237
|
if (tables.length === 0)
|
|
18074
18238
|
return;
|
|
@@ -19337,7 +19501,7 @@ function up492(db) {
|
|
|
19337
19501
|
);
|
|
19338
19502
|
`);
|
|
19339
19503
|
}
|
|
19340
|
-
function
|
|
19504
|
+
function hasTable4(db, name) {
|
|
19341
19505
|
return db.prepare(`SELECT name
|
|
19342
19506
|
FROM sqlite_master
|
|
19343
19507
|
WHERE type = 'table' AND name = ?
|
|
@@ -19367,7 +19531,7 @@ function up502(db) {
|
|
|
19367
19531
|
CREATE INDEX IF NOT EXISTS idx_entity_dependency_history_created
|
|
19368
19532
|
ON entity_dependency_history(created_at DESC);
|
|
19369
19533
|
`);
|
|
19370
|
-
if (!
|
|
19534
|
+
if (!hasTable4(db, "entity_dependencies"))
|
|
19371
19535
|
return;
|
|
19372
19536
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_insert");
|
|
19373
19537
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_update");
|
|
@@ -20377,11 +20541,160 @@ function up822(db) {
|
|
|
20377
20541
|
`);
|
|
20378
20542
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
20379
20543
|
}
|
|
20544
|
+
var DEPENDENCY_TYPES2 = new Set([
|
|
20545
|
+
"uses",
|
|
20546
|
+
"requires",
|
|
20547
|
+
"owned_by",
|
|
20548
|
+
"owns",
|
|
20549
|
+
"blocks",
|
|
20550
|
+
"informs",
|
|
20551
|
+
"maintains",
|
|
20552
|
+
"implements",
|
|
20553
|
+
"built",
|
|
20554
|
+
"depends_on",
|
|
20555
|
+
"related_to",
|
|
20556
|
+
"learned_from",
|
|
20557
|
+
"teaches",
|
|
20558
|
+
"knows",
|
|
20559
|
+
"assumes",
|
|
20560
|
+
"supports_claim",
|
|
20561
|
+
"authored_by",
|
|
20562
|
+
"links_to",
|
|
20563
|
+
"contains",
|
|
20564
|
+
"contains_note",
|
|
20565
|
+
"contradicts",
|
|
20566
|
+
"supersedes",
|
|
20567
|
+
"part_of",
|
|
20568
|
+
"produced_artifact",
|
|
20569
|
+
"precedes",
|
|
20570
|
+
"follows",
|
|
20571
|
+
"triggers",
|
|
20572
|
+
"may_execute",
|
|
20573
|
+
"requires_approval_from",
|
|
20574
|
+
"impacts",
|
|
20575
|
+
"produces",
|
|
20576
|
+
"consumes"
|
|
20577
|
+
]);
|
|
20578
|
+
function sqlStringList2(values) {
|
|
20579
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
20580
|
+
}
|
|
20581
|
+
function hasTable32(db, table) {
|
|
20582
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
20583
|
+
}
|
|
20584
|
+
function hasColumn122(db, table, column) {
|
|
20585
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20586
|
+
return rows.some((row) => row.name === column);
|
|
20587
|
+
}
|
|
20588
|
+
function addColumnIfMissing202(db, table, column, definition) {
|
|
20589
|
+
if (!hasColumn122(db, table, column))
|
|
20590
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20591
|
+
}
|
|
20592
|
+
function documentScopeColumnsPreservingExisting2(db) {
|
|
20593
|
+
const preserveAgentId = hasColumn122(db, "documents", "agent_id");
|
|
20594
|
+
const preserveProject = hasColumn122(db, "documents", "project");
|
|
20595
|
+
if (preserveAgentId) {
|
|
20596
|
+
db.exec(`
|
|
20597
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
20598
|
+
SELECT id, agent_id FROM documents
|
|
20599
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
20600
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
20601
|
+
`);
|
|
20602
|
+
}
|
|
20603
|
+
if (preserveProject) {
|
|
20604
|
+
db.exec(`
|
|
20605
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
20606
|
+
SELECT id, project FROM documents
|
|
20607
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
20608
|
+
`);
|
|
20609
|
+
}
|
|
20610
|
+
try {
|
|
20611
|
+
up802(db);
|
|
20612
|
+
if (preserveAgentId) {
|
|
20613
|
+
db.exec(`
|
|
20614
|
+
UPDATE documents
|
|
20615
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20616
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20617
|
+
`);
|
|
20618
|
+
}
|
|
20619
|
+
if (preserveProject) {
|
|
20620
|
+
db.exec(`
|
|
20621
|
+
UPDATE documents
|
|
20622
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20623
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20624
|
+
`);
|
|
20625
|
+
}
|
|
20626
|
+
} finally {
|
|
20627
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
20628
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
20629
|
+
}
|
|
20630
|
+
}
|
|
20631
|
+
function up832(db) {
|
|
20632
|
+
up792(db);
|
|
20633
|
+
if (hasTable32(db, "documents")) {
|
|
20634
|
+
documentScopeColumnsPreservingExisting2(db);
|
|
20635
|
+
}
|
|
20636
|
+
up812(db);
|
|
20637
|
+
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
20638
|
+
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
20639
|
+
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
20640
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
20641
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
20642
|
+
if (!hasTable32(db, "relations") || !hasTable32(db, "entity_dependencies"))
|
|
20643
|
+
return;
|
|
20644
|
+
addColumnIfMissing202(db, "entity_dependencies", "confidence", "REAL");
|
|
20645
|
+
addColumnIfMissing202(db, "entity_dependencies", "reason", "TEXT");
|
|
20646
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_id", "TEXT");
|
|
20647
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_kind", "TEXT");
|
|
20648
|
+
addColumnIfMissing202(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
20649
|
+
addColumnIfMissing202(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
20650
|
+
const relationConfidence = hasColumn122(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
20651
|
+
const relationUpdatedAt = hasColumn122(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
20652
|
+
const sourceAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
20653
|
+
const targetAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
20654
|
+
db.exec(`
|
|
20655
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
20656
|
+
id,
|
|
20657
|
+
source_entity_id,
|
|
20658
|
+
target_entity_id,
|
|
20659
|
+
agent_id,
|
|
20660
|
+
dependency_type,
|
|
20661
|
+
strength,
|
|
20662
|
+
confidence,
|
|
20663
|
+
reason,
|
|
20664
|
+
created_at,
|
|
20665
|
+
updated_at,
|
|
20666
|
+
source_id,
|
|
20667
|
+
source_kind,
|
|
20668
|
+
proposal_evidence,
|
|
20669
|
+
status
|
|
20670
|
+
)
|
|
20671
|
+
SELECT
|
|
20672
|
+
'relation:' || r.id,
|
|
20673
|
+
r.source_entity_id,
|
|
20674
|
+
r.target_entity_id,
|
|
20675
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
20676
|
+
CASE WHEN r.relation_type IN (${sqlStringList2(DEPENDENCY_TYPES2)}) THEN r.relation_type ELSE 'related_to' END,
|
|
20677
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
20678
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
20679
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
20680
|
+
COALESCE(r.created_at, datetime('now')),
|
|
20681
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
20682
|
+
r.id,
|
|
20683
|
+
'relation',
|
|
20684
|
+
'[]',
|
|
20685
|
+
'active'
|
|
20686
|
+
FROM relations r
|
|
20687
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
20688
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
20689
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
20690
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
20691
|
+
`);
|
|
20692
|
+
}
|
|
20380
20693
|
var MIGRATIONS2 = [
|
|
20381
20694
|
{
|
|
20382
20695
|
version: 1,
|
|
20383
20696
|
name: "baseline",
|
|
20384
|
-
up:
|
|
20697
|
+
up: up84,
|
|
20385
20698
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20386
20699
|
},
|
|
20387
20700
|
{
|
|
@@ -20430,7 +20743,7 @@ var MIGRATIONS2 = [
|
|
|
20430
20743
|
{
|
|
20431
20744
|
version: 8,
|
|
20432
20745
|
name: "embeddings-unique-hash",
|
|
20433
|
-
up:
|
|
20746
|
+
up: up85
|
|
20434
20747
|
},
|
|
20435
20748
|
{
|
|
20436
20749
|
version: 9,
|
|
@@ -21041,6 +21354,21 @@ var MIGRATIONS2 = [
|
|
|
21041
21354
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
21042
21355
|
]
|
|
21043
21356
|
}
|
|
21357
|
+
},
|
|
21358
|
+
{
|
|
21359
|
+
version: 83,
|
|
21360
|
+
name: "memory-lifecycle-repair",
|
|
21361
|
+
up: up832,
|
|
21362
|
+
artifacts: {
|
|
21363
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
21364
|
+
columns: [
|
|
21365
|
+
{ table: "documents", column: "agent_id" },
|
|
21366
|
+
{ table: "documents", column: "project" },
|
|
21367
|
+
{ table: "memories", column: "superseded_by" },
|
|
21368
|
+
{ table: "memories", column: "superseded_at" },
|
|
21369
|
+
{ table: "memories", column: "superseded_reason" }
|
|
21370
|
+
]
|
|
21371
|
+
}
|
|
21044
21372
|
}
|
|
21045
21373
|
];
|
|
21046
21374
|
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-gemini",
|
|
3
|
-
"version": "0.146.
|
|
3
|
+
"version": "0.146.5",
|
|
4
4
|
"description": "Signet connector for Gemini CLI",
|
|
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",
|