@signetai/connector-hermes-agent 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
|
@@ -9623,6 +9623,155 @@ function up82(db) {
|
|
|
9623
9623
|
`);
|
|
9624
9624
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
9625
9625
|
}
|
|
9626
|
+
var DEPENDENCY_TYPES = new Set([
|
|
9627
|
+
"uses",
|
|
9628
|
+
"requires",
|
|
9629
|
+
"owned_by",
|
|
9630
|
+
"owns",
|
|
9631
|
+
"blocks",
|
|
9632
|
+
"informs",
|
|
9633
|
+
"maintains",
|
|
9634
|
+
"implements",
|
|
9635
|
+
"built",
|
|
9636
|
+
"depends_on",
|
|
9637
|
+
"related_to",
|
|
9638
|
+
"learned_from",
|
|
9639
|
+
"teaches",
|
|
9640
|
+
"knows",
|
|
9641
|
+
"assumes",
|
|
9642
|
+
"supports_claim",
|
|
9643
|
+
"authored_by",
|
|
9644
|
+
"links_to",
|
|
9645
|
+
"contains",
|
|
9646
|
+
"contains_note",
|
|
9647
|
+
"contradicts",
|
|
9648
|
+
"supersedes",
|
|
9649
|
+
"part_of",
|
|
9650
|
+
"produced_artifact",
|
|
9651
|
+
"precedes",
|
|
9652
|
+
"follows",
|
|
9653
|
+
"triggers",
|
|
9654
|
+
"may_execute",
|
|
9655
|
+
"requires_approval_from",
|
|
9656
|
+
"impacts",
|
|
9657
|
+
"produces",
|
|
9658
|
+
"consumes"
|
|
9659
|
+
]);
|
|
9660
|
+
function sqlStringList(values) {
|
|
9661
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
9662
|
+
}
|
|
9663
|
+
function hasTable3(db, table) {
|
|
9664
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
9665
|
+
}
|
|
9666
|
+
function hasColumn12(db, table, column) {
|
|
9667
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9668
|
+
return rows.some((row) => row.name === column);
|
|
9669
|
+
}
|
|
9670
|
+
function addColumnIfMissing20(db, table, column, definition) {
|
|
9671
|
+
if (!hasColumn12(db, table, column))
|
|
9672
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9673
|
+
}
|
|
9674
|
+
function documentScopeColumnsPreservingExisting(db) {
|
|
9675
|
+
const preserveAgentId = hasColumn12(db, "documents", "agent_id");
|
|
9676
|
+
const preserveProject = hasColumn12(db, "documents", "project");
|
|
9677
|
+
if (preserveAgentId) {
|
|
9678
|
+
db.exec(`
|
|
9679
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
9680
|
+
SELECT id, agent_id FROM documents
|
|
9681
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
9682
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
9683
|
+
`);
|
|
9684
|
+
}
|
|
9685
|
+
if (preserveProject) {
|
|
9686
|
+
db.exec(`
|
|
9687
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
9688
|
+
SELECT id, project FROM documents
|
|
9689
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
9690
|
+
`);
|
|
9691
|
+
}
|
|
9692
|
+
try {
|
|
9693
|
+
up80(db);
|
|
9694
|
+
if (preserveAgentId) {
|
|
9695
|
+
db.exec(`
|
|
9696
|
+
UPDATE documents
|
|
9697
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
9698
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
9699
|
+
`);
|
|
9700
|
+
}
|
|
9701
|
+
if (preserveProject) {
|
|
9702
|
+
db.exec(`
|
|
9703
|
+
UPDATE documents
|
|
9704
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
9705
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
9706
|
+
`);
|
|
9707
|
+
}
|
|
9708
|
+
} finally {
|
|
9709
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
9710
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
9711
|
+
}
|
|
9712
|
+
}
|
|
9713
|
+
function up83(db) {
|
|
9714
|
+
up79(db);
|
|
9715
|
+
if (hasTable3(db, "documents")) {
|
|
9716
|
+
documentScopeColumnsPreservingExisting(db);
|
|
9717
|
+
}
|
|
9718
|
+
up81(db);
|
|
9719
|
+
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
9720
|
+
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
9721
|
+
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
9722
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
9723
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
9724
|
+
if (!hasTable3(db, "relations") || !hasTable3(db, "entity_dependencies"))
|
|
9725
|
+
return;
|
|
9726
|
+
addColumnIfMissing20(db, "entity_dependencies", "confidence", "REAL");
|
|
9727
|
+
addColumnIfMissing20(db, "entity_dependencies", "reason", "TEXT");
|
|
9728
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_id", "TEXT");
|
|
9729
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_kind", "TEXT");
|
|
9730
|
+
addColumnIfMissing20(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
9731
|
+
addColumnIfMissing20(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
9732
|
+
const relationConfidence = hasColumn12(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
9733
|
+
const relationUpdatedAt = hasColumn12(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
9734
|
+
const sourceAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
9735
|
+
const targetAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
9736
|
+
db.exec(`
|
|
9737
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
9738
|
+
id,
|
|
9739
|
+
source_entity_id,
|
|
9740
|
+
target_entity_id,
|
|
9741
|
+
agent_id,
|
|
9742
|
+
dependency_type,
|
|
9743
|
+
strength,
|
|
9744
|
+
confidence,
|
|
9745
|
+
reason,
|
|
9746
|
+
created_at,
|
|
9747
|
+
updated_at,
|
|
9748
|
+
source_id,
|
|
9749
|
+
source_kind,
|
|
9750
|
+
proposal_evidence,
|
|
9751
|
+
status
|
|
9752
|
+
)
|
|
9753
|
+
SELECT
|
|
9754
|
+
'relation:' || r.id,
|
|
9755
|
+
r.source_entity_id,
|
|
9756
|
+
r.target_entity_id,
|
|
9757
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
9758
|
+
CASE WHEN r.relation_type IN (${sqlStringList(DEPENDENCY_TYPES)}) THEN r.relation_type ELSE 'related_to' END,
|
|
9759
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
9760
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
9761
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
9762
|
+
COALESCE(r.created_at, datetime('now')),
|
|
9763
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
9764
|
+
r.id,
|
|
9765
|
+
'relation',
|
|
9766
|
+
'[]',
|
|
9767
|
+
'active'
|
|
9768
|
+
FROM relations r
|
|
9769
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
9770
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
9771
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
9772
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
9773
|
+
`);
|
|
9774
|
+
}
|
|
9626
9775
|
var MIGRATIONS = [
|
|
9627
9776
|
{
|
|
9628
9777
|
version: 1,
|
|
@@ -10287,6 +10436,21 @@ var MIGRATIONS = [
|
|
|
10287
10436
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
10288
10437
|
]
|
|
10289
10438
|
}
|
|
10439
|
+
},
|
|
10440
|
+
{
|
|
10441
|
+
version: 83,
|
|
10442
|
+
name: "memory-lifecycle-repair",
|
|
10443
|
+
up: up83,
|
|
10444
|
+
artifacts: {
|
|
10445
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
10446
|
+
columns: [
|
|
10447
|
+
{ table: "documents", column: "agent_id" },
|
|
10448
|
+
{ table: "documents", column: "project" },
|
|
10449
|
+
{ table: "memories", column: "superseded_by" },
|
|
10450
|
+
{ table: "memories", column: "superseded_at" },
|
|
10451
|
+
{ table: "memories", column: "superseded_reason" }
|
|
10452
|
+
]
|
|
10453
|
+
}
|
|
10290
10454
|
}
|
|
10291
10455
|
];
|
|
10292
10456
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -17627,7 +17791,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17627
17791
|
return true;
|
|
17628
17792
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17629
17793
|
}
|
|
17630
|
-
function
|
|
17794
|
+
function up84(db) {
|
|
17631
17795
|
db.exec(`
|
|
17632
17796
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17633
17797
|
version INTEGER PRIMARY KEY,
|
|
@@ -17716,31 +17880,31 @@ function up83(db) {
|
|
|
17716
17880
|
} catch {}
|
|
17717
17881
|
createMemoriesFts2(db);
|
|
17718
17882
|
}
|
|
17719
|
-
function
|
|
17883
|
+
function hasColumn13(db, table, column) {
|
|
17720
17884
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17721
17885
|
return rows.some((r) => r.name === column);
|
|
17722
17886
|
}
|
|
17723
|
-
function
|
|
17724
|
-
if (!
|
|
17887
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
17888
|
+
if (!hasColumn13(db, table, column)) {
|
|
17725
17889
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17726
17890
|
}
|
|
17727
17891
|
}
|
|
17728
17892
|
function up210(db) {
|
|
17729
|
-
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17893
|
+
addColumnIfMissing21(db, "memories", "content_hash", "TEXT");
|
|
17894
|
+
addColumnIfMissing21(db, "memories", "normalized_content", "TEXT");
|
|
17895
|
+
addColumnIfMissing21(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
17896
|
+
addColumnIfMissing21(db, "memories", "deleted_at", "TEXT");
|
|
17897
|
+
addColumnIfMissing21(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
17898
|
+
addColumnIfMissing21(db, "memories", "embedding_model", "TEXT");
|
|
17899
|
+
addColumnIfMissing21(db, "memories", "extraction_model", "TEXT");
|
|
17900
|
+
addColumnIfMissing21(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
17901
|
+
addColumnIfMissing21(db, "memories", "who", "TEXT");
|
|
17902
|
+
addColumnIfMissing21(db, "memories", "why", "TEXT");
|
|
17903
|
+
addColumnIfMissing21(db, "memories", "project", "TEXT");
|
|
17904
|
+
addColumnIfMissing21(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
17905
|
+
addColumnIfMissing21(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
17906
|
+
addColumnIfMissing21(db, "memories", "last_accessed", "TEXT");
|
|
17907
|
+
addColumnIfMissing21(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17744
17908
|
db.exec(`
|
|
17745
17909
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17746
17910
|
id TEXT PRIMARY KEY,
|
|
@@ -18002,7 +18166,7 @@ function up710(db) {
|
|
|
18002
18166
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18003
18167
|
}
|
|
18004
18168
|
}
|
|
18005
|
-
function
|
|
18169
|
+
function up85(db) {
|
|
18006
18170
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18007
18171
|
if (tables.length === 0)
|
|
18008
18172
|
return;
|
|
@@ -19271,7 +19435,7 @@ function up492(db) {
|
|
|
19271
19435
|
);
|
|
19272
19436
|
`);
|
|
19273
19437
|
}
|
|
19274
|
-
function
|
|
19438
|
+
function hasTable4(db, name) {
|
|
19275
19439
|
return db.prepare(`SELECT name
|
|
19276
19440
|
FROM sqlite_master
|
|
19277
19441
|
WHERE type = 'table' AND name = ?
|
|
@@ -19301,7 +19465,7 @@ function up502(db) {
|
|
|
19301
19465
|
CREATE INDEX IF NOT EXISTS idx_entity_dependency_history_created
|
|
19302
19466
|
ON entity_dependency_history(created_at DESC);
|
|
19303
19467
|
`);
|
|
19304
|
-
if (!
|
|
19468
|
+
if (!hasTable4(db, "entity_dependencies"))
|
|
19305
19469
|
return;
|
|
19306
19470
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_insert");
|
|
19307
19471
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_update");
|
|
@@ -20311,11 +20475,160 @@ function up822(db) {
|
|
|
20311
20475
|
`);
|
|
20312
20476
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
20313
20477
|
}
|
|
20478
|
+
var DEPENDENCY_TYPES2 = new Set([
|
|
20479
|
+
"uses",
|
|
20480
|
+
"requires",
|
|
20481
|
+
"owned_by",
|
|
20482
|
+
"owns",
|
|
20483
|
+
"blocks",
|
|
20484
|
+
"informs",
|
|
20485
|
+
"maintains",
|
|
20486
|
+
"implements",
|
|
20487
|
+
"built",
|
|
20488
|
+
"depends_on",
|
|
20489
|
+
"related_to",
|
|
20490
|
+
"learned_from",
|
|
20491
|
+
"teaches",
|
|
20492
|
+
"knows",
|
|
20493
|
+
"assumes",
|
|
20494
|
+
"supports_claim",
|
|
20495
|
+
"authored_by",
|
|
20496
|
+
"links_to",
|
|
20497
|
+
"contains",
|
|
20498
|
+
"contains_note",
|
|
20499
|
+
"contradicts",
|
|
20500
|
+
"supersedes",
|
|
20501
|
+
"part_of",
|
|
20502
|
+
"produced_artifact",
|
|
20503
|
+
"precedes",
|
|
20504
|
+
"follows",
|
|
20505
|
+
"triggers",
|
|
20506
|
+
"may_execute",
|
|
20507
|
+
"requires_approval_from",
|
|
20508
|
+
"impacts",
|
|
20509
|
+
"produces",
|
|
20510
|
+
"consumes"
|
|
20511
|
+
]);
|
|
20512
|
+
function sqlStringList2(values) {
|
|
20513
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
20514
|
+
}
|
|
20515
|
+
function hasTable32(db, table) {
|
|
20516
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
20517
|
+
}
|
|
20518
|
+
function hasColumn122(db, table, column) {
|
|
20519
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20520
|
+
return rows.some((row) => row.name === column);
|
|
20521
|
+
}
|
|
20522
|
+
function addColumnIfMissing202(db, table, column, definition) {
|
|
20523
|
+
if (!hasColumn122(db, table, column))
|
|
20524
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20525
|
+
}
|
|
20526
|
+
function documentScopeColumnsPreservingExisting2(db) {
|
|
20527
|
+
const preserveAgentId = hasColumn122(db, "documents", "agent_id");
|
|
20528
|
+
const preserveProject = hasColumn122(db, "documents", "project");
|
|
20529
|
+
if (preserveAgentId) {
|
|
20530
|
+
db.exec(`
|
|
20531
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
20532
|
+
SELECT id, agent_id FROM documents
|
|
20533
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
20534
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
20535
|
+
`);
|
|
20536
|
+
}
|
|
20537
|
+
if (preserveProject) {
|
|
20538
|
+
db.exec(`
|
|
20539
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
20540
|
+
SELECT id, project FROM documents
|
|
20541
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
20542
|
+
`);
|
|
20543
|
+
}
|
|
20544
|
+
try {
|
|
20545
|
+
up802(db);
|
|
20546
|
+
if (preserveAgentId) {
|
|
20547
|
+
db.exec(`
|
|
20548
|
+
UPDATE documents
|
|
20549
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20550
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20551
|
+
`);
|
|
20552
|
+
}
|
|
20553
|
+
if (preserveProject) {
|
|
20554
|
+
db.exec(`
|
|
20555
|
+
UPDATE documents
|
|
20556
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20557
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20558
|
+
`);
|
|
20559
|
+
}
|
|
20560
|
+
} finally {
|
|
20561
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
20562
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
20563
|
+
}
|
|
20564
|
+
}
|
|
20565
|
+
function up832(db) {
|
|
20566
|
+
up792(db);
|
|
20567
|
+
if (hasTable32(db, "documents")) {
|
|
20568
|
+
documentScopeColumnsPreservingExisting2(db);
|
|
20569
|
+
}
|
|
20570
|
+
up812(db);
|
|
20571
|
+
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
20572
|
+
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
20573
|
+
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
20574
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
20575
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
20576
|
+
if (!hasTable32(db, "relations") || !hasTable32(db, "entity_dependencies"))
|
|
20577
|
+
return;
|
|
20578
|
+
addColumnIfMissing202(db, "entity_dependencies", "confidence", "REAL");
|
|
20579
|
+
addColumnIfMissing202(db, "entity_dependencies", "reason", "TEXT");
|
|
20580
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_id", "TEXT");
|
|
20581
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_kind", "TEXT");
|
|
20582
|
+
addColumnIfMissing202(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
20583
|
+
addColumnIfMissing202(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
20584
|
+
const relationConfidence = hasColumn122(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
20585
|
+
const relationUpdatedAt = hasColumn122(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
20586
|
+
const sourceAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
20587
|
+
const targetAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
20588
|
+
db.exec(`
|
|
20589
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
20590
|
+
id,
|
|
20591
|
+
source_entity_id,
|
|
20592
|
+
target_entity_id,
|
|
20593
|
+
agent_id,
|
|
20594
|
+
dependency_type,
|
|
20595
|
+
strength,
|
|
20596
|
+
confidence,
|
|
20597
|
+
reason,
|
|
20598
|
+
created_at,
|
|
20599
|
+
updated_at,
|
|
20600
|
+
source_id,
|
|
20601
|
+
source_kind,
|
|
20602
|
+
proposal_evidence,
|
|
20603
|
+
status
|
|
20604
|
+
)
|
|
20605
|
+
SELECT
|
|
20606
|
+
'relation:' || r.id,
|
|
20607
|
+
r.source_entity_id,
|
|
20608
|
+
r.target_entity_id,
|
|
20609
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
20610
|
+
CASE WHEN r.relation_type IN (${sqlStringList2(DEPENDENCY_TYPES2)}) THEN r.relation_type ELSE 'related_to' END,
|
|
20611
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
20612
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
20613
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
20614
|
+
COALESCE(r.created_at, datetime('now')),
|
|
20615
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
20616
|
+
r.id,
|
|
20617
|
+
'relation',
|
|
20618
|
+
'[]',
|
|
20619
|
+
'active'
|
|
20620
|
+
FROM relations r
|
|
20621
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
20622
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
20623
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
20624
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
20625
|
+
`);
|
|
20626
|
+
}
|
|
20314
20627
|
var MIGRATIONS2 = [
|
|
20315
20628
|
{
|
|
20316
20629
|
version: 1,
|
|
20317
20630
|
name: "baseline",
|
|
20318
|
-
up:
|
|
20631
|
+
up: up84,
|
|
20319
20632
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20320
20633
|
},
|
|
20321
20634
|
{
|
|
@@ -20364,7 +20677,7 @@ var MIGRATIONS2 = [
|
|
|
20364
20677
|
{
|
|
20365
20678
|
version: 8,
|
|
20366
20679
|
name: "embeddings-unique-hash",
|
|
20367
|
-
up:
|
|
20680
|
+
up: up85
|
|
20368
20681
|
},
|
|
20369
20682
|
{
|
|
20370
20683
|
version: 9,
|
|
@@ -20975,6 +21288,21 @@ var MIGRATIONS2 = [
|
|
|
20975
21288
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
20976
21289
|
]
|
|
20977
21290
|
}
|
|
21291
|
+
},
|
|
21292
|
+
{
|
|
21293
|
+
version: 83,
|
|
21294
|
+
name: "memory-lifecycle-repair",
|
|
21295
|
+
up: up832,
|
|
21296
|
+
artifacts: {
|
|
21297
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
21298
|
+
columns: [
|
|
21299
|
+
{ table: "documents", column: "agent_id" },
|
|
21300
|
+
{ table: "documents", column: "project" },
|
|
21301
|
+
{ table: "memories", column: "superseded_by" },
|
|
21302
|
+
{ table: "memories", column: "superseded_at" },
|
|
21303
|
+
{ table: "memories", column: "superseded_reason" }
|
|
21304
|
+
]
|
|
21305
|
+
}
|
|
20978
21306
|
}
|
|
20979
21307
|
];
|
|
20980
21308
|
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-hermes-agent",
|
|
3
|
-
"version": "0.146.
|
|
3
|
+
"version": "0.146.5",
|
|
4
4
|
"description": "Signet connector for Hermes Agent — installs Signet as a pluggable memory provider",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
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
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.0.0",
|