@signetai/connector-claude-code 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
|
@@ -9621,6 +9621,155 @@ function up82(db) {
|
|
|
9621
9621
|
`);
|
|
9622
9622
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
9623
9623
|
}
|
|
9624
|
+
var DEPENDENCY_TYPES = new Set([
|
|
9625
|
+
"uses",
|
|
9626
|
+
"requires",
|
|
9627
|
+
"owned_by",
|
|
9628
|
+
"owns",
|
|
9629
|
+
"blocks",
|
|
9630
|
+
"informs",
|
|
9631
|
+
"maintains",
|
|
9632
|
+
"implements",
|
|
9633
|
+
"built",
|
|
9634
|
+
"depends_on",
|
|
9635
|
+
"related_to",
|
|
9636
|
+
"learned_from",
|
|
9637
|
+
"teaches",
|
|
9638
|
+
"knows",
|
|
9639
|
+
"assumes",
|
|
9640
|
+
"supports_claim",
|
|
9641
|
+
"authored_by",
|
|
9642
|
+
"links_to",
|
|
9643
|
+
"contains",
|
|
9644
|
+
"contains_note",
|
|
9645
|
+
"contradicts",
|
|
9646
|
+
"supersedes",
|
|
9647
|
+
"part_of",
|
|
9648
|
+
"produced_artifact",
|
|
9649
|
+
"precedes",
|
|
9650
|
+
"follows",
|
|
9651
|
+
"triggers",
|
|
9652
|
+
"may_execute",
|
|
9653
|
+
"requires_approval_from",
|
|
9654
|
+
"impacts",
|
|
9655
|
+
"produces",
|
|
9656
|
+
"consumes"
|
|
9657
|
+
]);
|
|
9658
|
+
function sqlStringList(values) {
|
|
9659
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
9660
|
+
}
|
|
9661
|
+
function hasTable3(db, table) {
|
|
9662
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
9663
|
+
}
|
|
9664
|
+
function hasColumn12(db, table, column) {
|
|
9665
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9666
|
+
return rows.some((row) => row.name === column);
|
|
9667
|
+
}
|
|
9668
|
+
function addColumnIfMissing20(db, table, column, definition) {
|
|
9669
|
+
if (!hasColumn12(db, table, column))
|
|
9670
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9671
|
+
}
|
|
9672
|
+
function documentScopeColumnsPreservingExisting(db) {
|
|
9673
|
+
const preserveAgentId = hasColumn12(db, "documents", "agent_id");
|
|
9674
|
+
const preserveProject = hasColumn12(db, "documents", "project");
|
|
9675
|
+
if (preserveAgentId) {
|
|
9676
|
+
db.exec(`
|
|
9677
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
9678
|
+
SELECT id, agent_id FROM documents
|
|
9679
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
9680
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
9681
|
+
`);
|
|
9682
|
+
}
|
|
9683
|
+
if (preserveProject) {
|
|
9684
|
+
db.exec(`
|
|
9685
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
9686
|
+
SELECT id, project FROM documents
|
|
9687
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
9688
|
+
`);
|
|
9689
|
+
}
|
|
9690
|
+
try {
|
|
9691
|
+
up80(db);
|
|
9692
|
+
if (preserveAgentId) {
|
|
9693
|
+
db.exec(`
|
|
9694
|
+
UPDATE documents
|
|
9695
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
9696
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
9697
|
+
`);
|
|
9698
|
+
}
|
|
9699
|
+
if (preserveProject) {
|
|
9700
|
+
db.exec(`
|
|
9701
|
+
UPDATE documents
|
|
9702
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
9703
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
9704
|
+
`);
|
|
9705
|
+
}
|
|
9706
|
+
} finally {
|
|
9707
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
9708
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
9709
|
+
}
|
|
9710
|
+
}
|
|
9711
|
+
function up83(db) {
|
|
9712
|
+
up79(db);
|
|
9713
|
+
if (hasTable3(db, "documents")) {
|
|
9714
|
+
documentScopeColumnsPreservingExisting(db);
|
|
9715
|
+
}
|
|
9716
|
+
up81(db);
|
|
9717
|
+
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
9718
|
+
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
9719
|
+
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
9720
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
9721
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
9722
|
+
if (!hasTable3(db, "relations") || !hasTable3(db, "entity_dependencies"))
|
|
9723
|
+
return;
|
|
9724
|
+
addColumnIfMissing20(db, "entity_dependencies", "confidence", "REAL");
|
|
9725
|
+
addColumnIfMissing20(db, "entity_dependencies", "reason", "TEXT");
|
|
9726
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_id", "TEXT");
|
|
9727
|
+
addColumnIfMissing20(db, "entity_dependencies", "source_kind", "TEXT");
|
|
9728
|
+
addColumnIfMissing20(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
9729
|
+
addColumnIfMissing20(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
9730
|
+
const relationConfidence = hasColumn12(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
9731
|
+
const relationUpdatedAt = hasColumn12(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
9732
|
+
const sourceAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
9733
|
+
const targetAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
9734
|
+
db.exec(`
|
|
9735
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
9736
|
+
id,
|
|
9737
|
+
source_entity_id,
|
|
9738
|
+
target_entity_id,
|
|
9739
|
+
agent_id,
|
|
9740
|
+
dependency_type,
|
|
9741
|
+
strength,
|
|
9742
|
+
confidence,
|
|
9743
|
+
reason,
|
|
9744
|
+
created_at,
|
|
9745
|
+
updated_at,
|
|
9746
|
+
source_id,
|
|
9747
|
+
source_kind,
|
|
9748
|
+
proposal_evidence,
|
|
9749
|
+
status
|
|
9750
|
+
)
|
|
9751
|
+
SELECT
|
|
9752
|
+
'relation:' || r.id,
|
|
9753
|
+
r.source_entity_id,
|
|
9754
|
+
r.target_entity_id,
|
|
9755
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
9756
|
+
CASE WHEN r.relation_type IN (${sqlStringList(DEPENDENCY_TYPES)}) THEN r.relation_type ELSE 'related_to' END,
|
|
9757
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
9758
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
9759
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
9760
|
+
COALESCE(r.created_at, datetime('now')),
|
|
9761
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
9762
|
+
r.id,
|
|
9763
|
+
'relation',
|
|
9764
|
+
'[]',
|
|
9765
|
+
'active'
|
|
9766
|
+
FROM relations r
|
|
9767
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
9768
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
9769
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
9770
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
9771
|
+
`);
|
|
9772
|
+
}
|
|
9624
9773
|
var MIGRATIONS = [
|
|
9625
9774
|
{
|
|
9626
9775
|
version: 1,
|
|
@@ -10285,6 +10434,21 @@ var MIGRATIONS = [
|
|
|
10285
10434
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
10286
10435
|
]
|
|
10287
10436
|
}
|
|
10437
|
+
},
|
|
10438
|
+
{
|
|
10439
|
+
version: 83,
|
|
10440
|
+
name: "memory-lifecycle-repair",
|
|
10441
|
+
up: up83,
|
|
10442
|
+
artifacts: {
|
|
10443
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
10444
|
+
columns: [
|
|
10445
|
+
{ table: "documents", column: "agent_id" },
|
|
10446
|
+
{ table: "documents", column: "project" },
|
|
10447
|
+
{ table: "memories", column: "superseded_by" },
|
|
10448
|
+
{ table: "memories", column: "superseded_at" },
|
|
10449
|
+
{ table: "memories", column: "superseded_reason" }
|
|
10450
|
+
]
|
|
10451
|
+
}
|
|
10288
10452
|
}
|
|
10289
10453
|
];
|
|
10290
10454
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -17640,7 +17804,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17640
17804
|
return true;
|
|
17641
17805
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17642
17806
|
}
|
|
17643
|
-
function
|
|
17807
|
+
function up84(db) {
|
|
17644
17808
|
db.exec(`
|
|
17645
17809
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17646
17810
|
version INTEGER PRIMARY KEY,
|
|
@@ -17729,31 +17893,31 @@ function up83(db) {
|
|
|
17729
17893
|
} catch {}
|
|
17730
17894
|
createMemoriesFts2(db);
|
|
17731
17895
|
}
|
|
17732
|
-
function
|
|
17896
|
+
function hasColumn13(db, table, column) {
|
|
17733
17897
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17734
17898
|
return rows.some((r) => r.name === column);
|
|
17735
17899
|
}
|
|
17736
|
-
function
|
|
17737
|
-
if (!
|
|
17900
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
17901
|
+
if (!hasColumn13(db, table, column)) {
|
|
17738
17902
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17739
17903
|
}
|
|
17740
17904
|
}
|
|
17741
17905
|
function up210(db) {
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
|
|
17753
|
-
|
|
17754
|
-
|
|
17755
|
-
|
|
17756
|
-
|
|
17906
|
+
addColumnIfMissing21(db, "memories", "content_hash", "TEXT");
|
|
17907
|
+
addColumnIfMissing21(db, "memories", "normalized_content", "TEXT");
|
|
17908
|
+
addColumnIfMissing21(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
17909
|
+
addColumnIfMissing21(db, "memories", "deleted_at", "TEXT");
|
|
17910
|
+
addColumnIfMissing21(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
17911
|
+
addColumnIfMissing21(db, "memories", "embedding_model", "TEXT");
|
|
17912
|
+
addColumnIfMissing21(db, "memories", "extraction_model", "TEXT");
|
|
17913
|
+
addColumnIfMissing21(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
17914
|
+
addColumnIfMissing21(db, "memories", "who", "TEXT");
|
|
17915
|
+
addColumnIfMissing21(db, "memories", "why", "TEXT");
|
|
17916
|
+
addColumnIfMissing21(db, "memories", "project", "TEXT");
|
|
17917
|
+
addColumnIfMissing21(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
17918
|
+
addColumnIfMissing21(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
17919
|
+
addColumnIfMissing21(db, "memories", "last_accessed", "TEXT");
|
|
17920
|
+
addColumnIfMissing21(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17757
17921
|
db.exec(`
|
|
17758
17922
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17759
17923
|
id TEXT PRIMARY KEY,
|
|
@@ -18015,7 +18179,7 @@ function up710(db) {
|
|
|
18015
18179
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18016
18180
|
}
|
|
18017
18181
|
}
|
|
18018
|
-
function
|
|
18182
|
+
function up85(db) {
|
|
18019
18183
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18020
18184
|
if (tables.length === 0)
|
|
18021
18185
|
return;
|
|
@@ -19284,7 +19448,7 @@ function up492(db) {
|
|
|
19284
19448
|
);
|
|
19285
19449
|
`);
|
|
19286
19450
|
}
|
|
19287
|
-
function
|
|
19451
|
+
function hasTable4(db, name) {
|
|
19288
19452
|
return db.prepare(`SELECT name
|
|
19289
19453
|
FROM sqlite_master
|
|
19290
19454
|
WHERE type = 'table' AND name = ?
|
|
@@ -19314,7 +19478,7 @@ function up502(db) {
|
|
|
19314
19478
|
CREATE INDEX IF NOT EXISTS idx_entity_dependency_history_created
|
|
19315
19479
|
ON entity_dependency_history(created_at DESC);
|
|
19316
19480
|
`);
|
|
19317
|
-
if (!
|
|
19481
|
+
if (!hasTable4(db, "entity_dependencies"))
|
|
19318
19482
|
return;
|
|
19319
19483
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_insert");
|
|
19320
19484
|
db.exec("DROP TRIGGER IF EXISTS trg_entity_dependencies_related_to_reason_update");
|
|
@@ -20324,11 +20488,160 @@ function up822(db) {
|
|
|
20324
20488
|
`);
|
|
20325
20489
|
db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
|
|
20326
20490
|
}
|
|
20491
|
+
var DEPENDENCY_TYPES2 = new Set([
|
|
20492
|
+
"uses",
|
|
20493
|
+
"requires",
|
|
20494
|
+
"owned_by",
|
|
20495
|
+
"owns",
|
|
20496
|
+
"blocks",
|
|
20497
|
+
"informs",
|
|
20498
|
+
"maintains",
|
|
20499
|
+
"implements",
|
|
20500
|
+
"built",
|
|
20501
|
+
"depends_on",
|
|
20502
|
+
"related_to",
|
|
20503
|
+
"learned_from",
|
|
20504
|
+
"teaches",
|
|
20505
|
+
"knows",
|
|
20506
|
+
"assumes",
|
|
20507
|
+
"supports_claim",
|
|
20508
|
+
"authored_by",
|
|
20509
|
+
"links_to",
|
|
20510
|
+
"contains",
|
|
20511
|
+
"contains_note",
|
|
20512
|
+
"contradicts",
|
|
20513
|
+
"supersedes",
|
|
20514
|
+
"part_of",
|
|
20515
|
+
"produced_artifact",
|
|
20516
|
+
"precedes",
|
|
20517
|
+
"follows",
|
|
20518
|
+
"triggers",
|
|
20519
|
+
"may_execute",
|
|
20520
|
+
"requires_approval_from",
|
|
20521
|
+
"impacts",
|
|
20522
|
+
"produces",
|
|
20523
|
+
"consumes"
|
|
20524
|
+
]);
|
|
20525
|
+
function sqlStringList2(values) {
|
|
20526
|
+
return [...values].map((value) => `'${value}'`).join(", ");
|
|
20527
|
+
}
|
|
20528
|
+
function hasTable32(db, table) {
|
|
20529
|
+
return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
|
|
20530
|
+
}
|
|
20531
|
+
function hasColumn122(db, table, column) {
|
|
20532
|
+
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20533
|
+
return rows.some((row) => row.name === column);
|
|
20534
|
+
}
|
|
20535
|
+
function addColumnIfMissing202(db, table, column, definition) {
|
|
20536
|
+
if (!hasColumn122(db, table, column))
|
|
20537
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20538
|
+
}
|
|
20539
|
+
function documentScopeColumnsPreservingExisting2(db) {
|
|
20540
|
+
const preserveAgentId = hasColumn122(db, "documents", "agent_id");
|
|
20541
|
+
const preserveProject = hasColumn122(db, "documents", "project");
|
|
20542
|
+
if (preserveAgentId) {
|
|
20543
|
+
db.exec(`
|
|
20544
|
+
CREATE TEMP TABLE __signet_doc_agent_guard AS
|
|
20545
|
+
SELECT id, agent_id FROM documents
|
|
20546
|
+
WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
|
|
20547
|
+
AND NULLIF(TRIM(agent_id), '') <> 'default'
|
|
20548
|
+
`);
|
|
20549
|
+
}
|
|
20550
|
+
if (preserveProject) {
|
|
20551
|
+
db.exec(`
|
|
20552
|
+
CREATE TEMP TABLE __signet_doc_project_guard AS
|
|
20553
|
+
SELECT id, project FROM documents
|
|
20554
|
+
WHERE NULLIF(TRIM(project), '') IS NOT NULL
|
|
20555
|
+
`);
|
|
20556
|
+
}
|
|
20557
|
+
try {
|
|
20558
|
+
up802(db);
|
|
20559
|
+
if (preserveAgentId) {
|
|
20560
|
+
db.exec(`
|
|
20561
|
+
UPDATE documents
|
|
20562
|
+
SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20563
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
|
|
20564
|
+
`);
|
|
20565
|
+
}
|
|
20566
|
+
if (preserveProject) {
|
|
20567
|
+
db.exec(`
|
|
20568
|
+
UPDATE documents
|
|
20569
|
+
SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20570
|
+
WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
|
|
20571
|
+
`);
|
|
20572
|
+
}
|
|
20573
|
+
} finally {
|
|
20574
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
|
|
20575
|
+
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
20576
|
+
}
|
|
20577
|
+
}
|
|
20578
|
+
function up832(db) {
|
|
20579
|
+
up792(db);
|
|
20580
|
+
if (hasTable32(db, "documents")) {
|
|
20581
|
+
documentScopeColumnsPreservingExisting2(db);
|
|
20582
|
+
}
|
|
20583
|
+
up812(db);
|
|
20584
|
+
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
20585
|
+
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
20586
|
+
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
20587
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
|
|
20588
|
+
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
|
|
20589
|
+
if (!hasTable32(db, "relations") || !hasTable32(db, "entity_dependencies"))
|
|
20590
|
+
return;
|
|
20591
|
+
addColumnIfMissing202(db, "entity_dependencies", "confidence", "REAL");
|
|
20592
|
+
addColumnIfMissing202(db, "entity_dependencies", "reason", "TEXT");
|
|
20593
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_id", "TEXT");
|
|
20594
|
+
addColumnIfMissing202(db, "entity_dependencies", "source_kind", "TEXT");
|
|
20595
|
+
addColumnIfMissing202(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
|
|
20596
|
+
addColumnIfMissing202(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
20597
|
+
const relationConfidence = hasColumn122(db, "relations", "confidence") ? "r.confidence" : "NULL";
|
|
20598
|
+
const relationUpdatedAt = hasColumn122(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
|
|
20599
|
+
const sourceAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
|
|
20600
|
+
const targetAgentId = hasColumn122(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
|
|
20601
|
+
db.exec(`
|
|
20602
|
+
INSERT OR IGNORE INTO entity_dependencies (
|
|
20603
|
+
id,
|
|
20604
|
+
source_entity_id,
|
|
20605
|
+
target_entity_id,
|
|
20606
|
+
agent_id,
|
|
20607
|
+
dependency_type,
|
|
20608
|
+
strength,
|
|
20609
|
+
confidence,
|
|
20610
|
+
reason,
|
|
20611
|
+
created_at,
|
|
20612
|
+
updated_at,
|
|
20613
|
+
source_id,
|
|
20614
|
+
source_kind,
|
|
20615
|
+
proposal_evidence,
|
|
20616
|
+
status
|
|
20617
|
+
)
|
|
20618
|
+
SELECT
|
|
20619
|
+
'relation:' || r.id,
|
|
20620
|
+
r.source_entity_id,
|
|
20621
|
+
r.target_entity_id,
|
|
20622
|
+
COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
|
|
20623
|
+
CASE WHEN r.relation_type IN (${sqlStringList2(DEPENDENCY_TYPES2)}) THEN r.relation_type ELSE 'related_to' END,
|
|
20624
|
+
MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
|
|
20625
|
+
MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
|
|
20626
|
+
'legacy relation backfill: ' || r.relation_type,
|
|
20627
|
+
COALESCE(r.created_at, datetime('now')),
|
|
20628
|
+
COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
|
|
20629
|
+
r.id,
|
|
20630
|
+
'relation',
|
|
20631
|
+
'[]',
|
|
20632
|
+
'active'
|
|
20633
|
+
FROM relations r
|
|
20634
|
+
JOIN entities src ON src.id = r.source_entity_id
|
|
20635
|
+
JOIN entities dst ON dst.id = r.target_entity_id
|
|
20636
|
+
WHERE r.source_entity_id <> r.target_entity_id
|
|
20637
|
+
AND ${sourceAgentId} = ${targetAgentId}
|
|
20638
|
+
`);
|
|
20639
|
+
}
|
|
20327
20640
|
var MIGRATIONS2 = [
|
|
20328
20641
|
{
|
|
20329
20642
|
version: 1,
|
|
20330
20643
|
name: "baseline",
|
|
20331
|
-
up:
|
|
20644
|
+
up: up84,
|
|
20332
20645
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20333
20646
|
},
|
|
20334
20647
|
{
|
|
@@ -20377,7 +20690,7 @@ var MIGRATIONS2 = [
|
|
|
20377
20690
|
{
|
|
20378
20691
|
version: 8,
|
|
20379
20692
|
name: "embeddings-unique-hash",
|
|
20380
|
-
up:
|
|
20693
|
+
up: up85
|
|
20381
20694
|
},
|
|
20382
20695
|
{
|
|
20383
20696
|
version: 9,
|
|
@@ -20988,6 +21301,21 @@ var MIGRATIONS2 = [
|
|
|
20988
21301
|
{ table: "skill_invocations", column: "tool_use_id" }
|
|
20989
21302
|
]
|
|
20990
21303
|
}
|
|
21304
|
+
},
|
|
21305
|
+
{
|
|
21306
|
+
version: 83,
|
|
21307
|
+
name: "memory-lifecycle-repair",
|
|
21308
|
+
up: up832,
|
|
21309
|
+
artifacts: {
|
|
21310
|
+
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
21311
|
+
columns: [
|
|
21312
|
+
{ table: "documents", column: "agent_id" },
|
|
21313
|
+
{ table: "documents", column: "project" },
|
|
21314
|
+
{ table: "memories", column: "superseded_by" },
|
|
21315
|
+
{ table: "memories", column: "superseded_at" },
|
|
21316
|
+
{ table: "memories", column: "superseded_reason" }
|
|
21317
|
+
]
|
|
21318
|
+
}
|
|
20991
21319
|
}
|
|
20992
21320
|
];
|
|
20993
21321
|
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-claude-code",
|
|
3
|
-
"version": "0.146.
|
|
3
|
+
"version": "0.146.5",
|
|
4
4
|
"description": "Signet connector for Claude Code (Anthropic 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",
|