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