@signetai/connector-codex 0.146.5 → 0.147.0
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 +263 -23
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -9771,6 +9771,102 @@ function up83(db) {
|
|
|
9771
9771
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
9772
9772
|
`);
|
|
9773
9773
|
}
|
|
9774
|
+
function up84(db) {
|
|
9775
|
+
db.exec(`
|
|
9776
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
9777
|
+
path TEXT PRIMARY KEY,
|
|
9778
|
+
mtime_ms INTEGER NOT NULL,
|
|
9779
|
+
ctime_ms INTEGER NOT NULL,
|
|
9780
|
+
size INTEGER NOT NULL,
|
|
9781
|
+
content_hash TEXT NOT NULL,
|
|
9782
|
+
importer_version INTEGER NOT NULL,
|
|
9783
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
9784
|
+
last_imported_at TEXT NOT NULL,
|
|
9785
|
+
last_seen_at TEXT NOT NULL,
|
|
9786
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
9787
|
+
error TEXT
|
|
9788
|
+
);
|
|
9789
|
+
|
|
9790
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
9791
|
+
file_path TEXT NOT NULL,
|
|
9792
|
+
chunk_hash TEXT NOT NULL,
|
|
9793
|
+
chunk_index INTEGER NOT NULL,
|
|
9794
|
+
memory_id TEXT,
|
|
9795
|
+
source_id TEXT,
|
|
9796
|
+
created_at TEXT NOT NULL,
|
|
9797
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
9798
|
+
);
|
|
9799
|
+
|
|
9800
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
9801
|
+
ON legacy_markdown_chunks(memory_id);
|
|
9802
|
+
`);
|
|
9803
|
+
}
|
|
9804
|
+
function up85(db) {
|
|
9805
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
9806
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
9807
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
9808
|
+
return;
|
|
9809
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
9810
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
9811
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
9812
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
9813
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
9814
|
+
return;
|
|
9815
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
9816
|
+
return;
|
|
9817
|
+
const hasRelConfidence = rel.has("confidence");
|
|
9818
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
9819
|
+
const hasDepConfidence = dep.has("confidence");
|
|
9820
|
+
const hasDepReason = dep.has("reason");
|
|
9821
|
+
const hasDepStatus = dep.has("status");
|
|
9822
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
9823
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
9824
|
+
selectParts.push("relation_type");
|
|
9825
|
+
colParts.push("dependency_type");
|
|
9826
|
+
selectParts.push("strength", "created_at");
|
|
9827
|
+
colParts.push("strength", "created_at");
|
|
9828
|
+
selectParts.push("'default'");
|
|
9829
|
+
colParts.push("agent_id");
|
|
9830
|
+
selectParts.push("NULL");
|
|
9831
|
+
colParts.push("aspect_id");
|
|
9832
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
9833
|
+
selectParts.push("confidence");
|
|
9834
|
+
colParts.push("confidence");
|
|
9835
|
+
}
|
|
9836
|
+
if (hasDepReason) {
|
|
9837
|
+
selectParts.push("'extracted'");
|
|
9838
|
+
colParts.push("reason");
|
|
9839
|
+
}
|
|
9840
|
+
if (hasDepStatus) {
|
|
9841
|
+
selectParts.push("'active'");
|
|
9842
|
+
colParts.push("status");
|
|
9843
|
+
}
|
|
9844
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
9845
|
+
selectParts.push("updated_at");
|
|
9846
|
+
colParts.push("updated_at");
|
|
9847
|
+
}
|
|
9848
|
+
const selectClause = selectParts.join(", ");
|
|
9849
|
+
const colsClause = colParts.join(", ");
|
|
9850
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
9851
|
+
SELECT ${selectClause}
|
|
9852
|
+
FROM relations
|
|
9853
|
+
WHERE source_entity_id IS NOT NULL
|
|
9854
|
+
AND target_entity_id IS NOT NULL
|
|
9855
|
+
AND relation_type IS NOT NULL`);
|
|
9856
|
+
}
|
|
9857
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
9858
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9859
|
+
if (cols.some((col) => col.name === column))
|
|
9860
|
+
return;
|
|
9861
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9862
|
+
}
|
|
9863
|
+
function up86(db) {
|
|
9864
|
+
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
9865
|
+
db.exec(`
|
|
9866
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
9867
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
9868
|
+
`);
|
|
9869
|
+
}
|
|
9774
9870
|
var MIGRATIONS = [
|
|
9775
9871
|
{
|
|
9776
9872
|
version: 1,
|
|
@@ -10450,6 +10546,30 @@ var MIGRATIONS = [
|
|
|
10450
10546
|
{ table: "memories", column: "superseded_reason" }
|
|
10451
10547
|
]
|
|
10452
10548
|
}
|
|
10549
|
+
},
|
|
10550
|
+
{
|
|
10551
|
+
version: 84,
|
|
10552
|
+
name: "legacy-markdown-import-state",
|
|
10553
|
+
up: up84,
|
|
10554
|
+
artifacts: {
|
|
10555
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
10556
|
+
}
|
|
10557
|
+
},
|
|
10558
|
+
{
|
|
10559
|
+
version: 85,
|
|
10560
|
+
name: "backfill-relations-to-dependencies",
|
|
10561
|
+
up: up85,
|
|
10562
|
+
artifacts: {
|
|
10563
|
+
tables: ["entity_dependencies"]
|
|
10564
|
+
}
|
|
10565
|
+
},
|
|
10566
|
+
{
|
|
10567
|
+
version: 86,
|
|
10568
|
+
name: "summary-jobs-content-hash",
|
|
10569
|
+
up: up86,
|
|
10570
|
+
artifacts: {
|
|
10571
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
10572
|
+
}
|
|
10453
10573
|
}
|
|
10454
10574
|
];
|
|
10455
10575
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -17800,7 +17920,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17800
17920
|
return true;
|
|
17801
17921
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17802
17922
|
}
|
|
17803
|
-
function
|
|
17923
|
+
function up87(db) {
|
|
17804
17924
|
db.exec(`
|
|
17805
17925
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17806
17926
|
version INTEGER PRIMARY KEY,
|
|
@@ -17893,27 +18013,27 @@ function hasColumn13(db, table, column) {
|
|
|
17893
18013
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17894
18014
|
return rows.some((r) => r.name === column);
|
|
17895
18015
|
}
|
|
17896
|
-
function
|
|
18016
|
+
function addColumnIfMissing22(db, table, column, definition) {
|
|
17897
18017
|
if (!hasColumn13(db, table, column)) {
|
|
17898
18018
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17899
18019
|
}
|
|
17900
18020
|
}
|
|
17901
18021
|
function up210(db) {
|
|
17902
|
-
|
|
17903
|
-
|
|
17904
|
-
|
|
17905
|
-
|
|
17906
|
-
|
|
17907
|
-
|
|
17908
|
-
|
|
17909
|
-
|
|
17910
|
-
|
|
17911
|
-
|
|
17912
|
-
|
|
17913
|
-
|
|
17914
|
-
|
|
17915
|
-
|
|
17916
|
-
|
|
18022
|
+
addColumnIfMissing22(db, "memories", "content_hash", "TEXT");
|
|
18023
|
+
addColumnIfMissing22(db, "memories", "normalized_content", "TEXT");
|
|
18024
|
+
addColumnIfMissing22(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
18025
|
+
addColumnIfMissing22(db, "memories", "deleted_at", "TEXT");
|
|
18026
|
+
addColumnIfMissing22(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
18027
|
+
addColumnIfMissing22(db, "memories", "embedding_model", "TEXT");
|
|
18028
|
+
addColumnIfMissing22(db, "memories", "extraction_model", "TEXT");
|
|
18029
|
+
addColumnIfMissing22(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
18030
|
+
addColumnIfMissing22(db, "memories", "who", "TEXT");
|
|
18031
|
+
addColumnIfMissing22(db, "memories", "why", "TEXT");
|
|
18032
|
+
addColumnIfMissing22(db, "memories", "project", "TEXT");
|
|
18033
|
+
addColumnIfMissing22(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
18034
|
+
addColumnIfMissing22(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
18035
|
+
addColumnIfMissing22(db, "memories", "last_accessed", "TEXT");
|
|
18036
|
+
addColumnIfMissing22(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17917
18037
|
db.exec(`
|
|
17918
18038
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17919
18039
|
id TEXT PRIMARY KEY,
|
|
@@ -18009,7 +18129,7 @@ function up210(db) {
|
|
|
18009
18129
|
ON memory_entity_mentions(entity_id);
|
|
18010
18130
|
`);
|
|
18011
18131
|
}
|
|
18012
|
-
function
|
|
18132
|
+
function addColumnIfMissing23(db, table, column, definition) {
|
|
18013
18133
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
18014
18134
|
if (rows.some((r) => r.name === column))
|
|
18015
18135
|
return false;
|
|
@@ -18017,8 +18137,8 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
18017
18137
|
return true;
|
|
18018
18138
|
}
|
|
18019
18139
|
function up310(db) {
|
|
18020
|
-
|
|
18021
|
-
|
|
18140
|
+
addColumnIfMissing23(db, "memories", "why", "TEXT");
|
|
18141
|
+
addColumnIfMissing23(db, "memories", "project", "TEXT");
|
|
18022
18142
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
18023
18143
|
db.exec(`
|
|
18024
18144
|
UPDATE memories
|
|
@@ -18175,7 +18295,7 @@ function up710(db) {
|
|
|
18175
18295
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18176
18296
|
}
|
|
18177
18297
|
}
|
|
18178
|
-
function
|
|
18298
|
+
function up88(db) {
|
|
18179
18299
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18180
18300
|
if (tables.length === 0)
|
|
18181
18301
|
return;
|
|
@@ -20633,11 +20753,107 @@ function up832(db) {
|
|
|
20633
20753
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
20634
20754
|
`);
|
|
20635
20755
|
}
|
|
20756
|
+
function up842(db) {
|
|
20757
|
+
db.exec(`
|
|
20758
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
20759
|
+
path TEXT PRIMARY KEY,
|
|
20760
|
+
mtime_ms INTEGER NOT NULL,
|
|
20761
|
+
ctime_ms INTEGER NOT NULL,
|
|
20762
|
+
size INTEGER NOT NULL,
|
|
20763
|
+
content_hash TEXT NOT NULL,
|
|
20764
|
+
importer_version INTEGER NOT NULL,
|
|
20765
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
20766
|
+
last_imported_at TEXT NOT NULL,
|
|
20767
|
+
last_seen_at TEXT NOT NULL,
|
|
20768
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
20769
|
+
error TEXT
|
|
20770
|
+
);
|
|
20771
|
+
|
|
20772
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
20773
|
+
file_path TEXT NOT NULL,
|
|
20774
|
+
chunk_hash TEXT NOT NULL,
|
|
20775
|
+
chunk_index INTEGER NOT NULL,
|
|
20776
|
+
memory_id TEXT,
|
|
20777
|
+
source_id TEXT,
|
|
20778
|
+
created_at TEXT NOT NULL,
|
|
20779
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
20780
|
+
);
|
|
20781
|
+
|
|
20782
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
20783
|
+
ON legacy_markdown_chunks(memory_id);
|
|
20784
|
+
`);
|
|
20785
|
+
}
|
|
20786
|
+
function up852(db) {
|
|
20787
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
20788
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
20789
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
20790
|
+
return;
|
|
20791
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
20792
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
20793
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
20794
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
20795
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
20796
|
+
return;
|
|
20797
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
20798
|
+
return;
|
|
20799
|
+
const hasRelConfidence = rel.has("confidence");
|
|
20800
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
20801
|
+
const hasDepConfidence = dep.has("confidence");
|
|
20802
|
+
const hasDepReason = dep.has("reason");
|
|
20803
|
+
const hasDepStatus = dep.has("status");
|
|
20804
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20805
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20806
|
+
selectParts.push("relation_type");
|
|
20807
|
+
colParts.push("dependency_type");
|
|
20808
|
+
selectParts.push("strength", "created_at");
|
|
20809
|
+
colParts.push("strength", "created_at");
|
|
20810
|
+
selectParts.push("'default'");
|
|
20811
|
+
colParts.push("agent_id");
|
|
20812
|
+
selectParts.push("NULL");
|
|
20813
|
+
colParts.push("aspect_id");
|
|
20814
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
20815
|
+
selectParts.push("confidence");
|
|
20816
|
+
colParts.push("confidence");
|
|
20817
|
+
}
|
|
20818
|
+
if (hasDepReason) {
|
|
20819
|
+
selectParts.push("'extracted'");
|
|
20820
|
+
colParts.push("reason");
|
|
20821
|
+
}
|
|
20822
|
+
if (hasDepStatus) {
|
|
20823
|
+
selectParts.push("'active'");
|
|
20824
|
+
colParts.push("status");
|
|
20825
|
+
}
|
|
20826
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
20827
|
+
selectParts.push("updated_at");
|
|
20828
|
+
colParts.push("updated_at");
|
|
20829
|
+
}
|
|
20830
|
+
const selectClause = selectParts.join(", ");
|
|
20831
|
+
const colsClause = colParts.join(", ");
|
|
20832
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
20833
|
+
SELECT ${selectClause}
|
|
20834
|
+
FROM relations
|
|
20835
|
+
WHERE source_entity_id IS NOT NULL
|
|
20836
|
+
AND target_entity_id IS NOT NULL
|
|
20837
|
+
AND relation_type IS NOT NULL`);
|
|
20838
|
+
}
|
|
20839
|
+
function addColumnIfMissing212(db, table, column, definition) {
|
|
20840
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20841
|
+
if (cols.some((col) => col.name === column))
|
|
20842
|
+
return;
|
|
20843
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20844
|
+
}
|
|
20845
|
+
function up862(db) {
|
|
20846
|
+
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
20847
|
+
db.exec(`
|
|
20848
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
20849
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
20850
|
+
`);
|
|
20851
|
+
}
|
|
20636
20852
|
var MIGRATIONS2 = [
|
|
20637
20853
|
{
|
|
20638
20854
|
version: 1,
|
|
20639
20855
|
name: "baseline",
|
|
20640
|
-
up:
|
|
20856
|
+
up: up87,
|
|
20641
20857
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20642
20858
|
},
|
|
20643
20859
|
{
|
|
@@ -20686,7 +20902,7 @@ var MIGRATIONS2 = [
|
|
|
20686
20902
|
{
|
|
20687
20903
|
version: 8,
|
|
20688
20904
|
name: "embeddings-unique-hash",
|
|
20689
|
-
up:
|
|
20905
|
+
up: up88
|
|
20690
20906
|
},
|
|
20691
20907
|
{
|
|
20692
20908
|
version: 9,
|
|
@@ -21312,6 +21528,30 @@ var MIGRATIONS2 = [
|
|
|
21312
21528
|
{ table: "memories", column: "superseded_reason" }
|
|
21313
21529
|
]
|
|
21314
21530
|
}
|
|
21531
|
+
},
|
|
21532
|
+
{
|
|
21533
|
+
version: 84,
|
|
21534
|
+
name: "legacy-markdown-import-state",
|
|
21535
|
+
up: up842,
|
|
21536
|
+
artifacts: {
|
|
21537
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
21538
|
+
}
|
|
21539
|
+
},
|
|
21540
|
+
{
|
|
21541
|
+
version: 85,
|
|
21542
|
+
name: "backfill-relations-to-dependencies",
|
|
21543
|
+
up: up852,
|
|
21544
|
+
artifacts: {
|
|
21545
|
+
tables: ["entity_dependencies"]
|
|
21546
|
+
}
|
|
21547
|
+
},
|
|
21548
|
+
{
|
|
21549
|
+
version: 86,
|
|
21550
|
+
name: "summary-jobs-content-hash",
|
|
21551
|
+
up: up862,
|
|
21552
|
+
artifacts: {
|
|
21553
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
21554
|
+
}
|
|
21315
21555
|
}
|
|
21316
21556
|
];
|
|
21317
21557
|
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.
|
|
3
|
+
"version": "0.147.0",
|
|
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.
|
|
28
|
-
"@signetai/core": "0.
|
|
27
|
+
"@signetai/connector-base": "0.147.0",
|
|
28
|
+
"@signetai/core": "0.147.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.0.0",
|