@signetai/connector-gemini 0.146.5 → 0.147.1
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
|
@@ -9782,6 +9782,102 @@ function up83(db) {
|
|
|
9782
9782
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
9783
9783
|
`);
|
|
9784
9784
|
}
|
|
9785
|
+
function up84(db) {
|
|
9786
|
+
db.exec(`
|
|
9787
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
9788
|
+
path TEXT PRIMARY KEY,
|
|
9789
|
+
mtime_ms INTEGER NOT NULL,
|
|
9790
|
+
ctime_ms INTEGER NOT NULL,
|
|
9791
|
+
size INTEGER NOT NULL,
|
|
9792
|
+
content_hash TEXT NOT NULL,
|
|
9793
|
+
importer_version INTEGER NOT NULL,
|
|
9794
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
9795
|
+
last_imported_at TEXT NOT NULL,
|
|
9796
|
+
last_seen_at TEXT NOT NULL,
|
|
9797
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
9798
|
+
error TEXT
|
|
9799
|
+
);
|
|
9800
|
+
|
|
9801
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
9802
|
+
file_path TEXT NOT NULL,
|
|
9803
|
+
chunk_hash TEXT NOT NULL,
|
|
9804
|
+
chunk_index INTEGER NOT NULL,
|
|
9805
|
+
memory_id TEXT,
|
|
9806
|
+
source_id TEXT,
|
|
9807
|
+
created_at TEXT NOT NULL,
|
|
9808
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
9809
|
+
);
|
|
9810
|
+
|
|
9811
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
9812
|
+
ON legacy_markdown_chunks(memory_id);
|
|
9813
|
+
`);
|
|
9814
|
+
}
|
|
9815
|
+
function up85(db) {
|
|
9816
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
9817
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
9818
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
9819
|
+
return;
|
|
9820
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
9821
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
9822
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
9823
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
9824
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
9825
|
+
return;
|
|
9826
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
9827
|
+
return;
|
|
9828
|
+
const hasRelConfidence = rel.has("confidence");
|
|
9829
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
9830
|
+
const hasDepConfidence = dep.has("confidence");
|
|
9831
|
+
const hasDepReason = dep.has("reason");
|
|
9832
|
+
const hasDepStatus = dep.has("status");
|
|
9833
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
9834
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
9835
|
+
selectParts.push("relation_type");
|
|
9836
|
+
colParts.push("dependency_type");
|
|
9837
|
+
selectParts.push("strength", "created_at");
|
|
9838
|
+
colParts.push("strength", "created_at");
|
|
9839
|
+
selectParts.push("'default'");
|
|
9840
|
+
colParts.push("agent_id");
|
|
9841
|
+
selectParts.push("NULL");
|
|
9842
|
+
colParts.push("aspect_id");
|
|
9843
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
9844
|
+
selectParts.push("confidence");
|
|
9845
|
+
colParts.push("confidence");
|
|
9846
|
+
}
|
|
9847
|
+
if (hasDepReason) {
|
|
9848
|
+
selectParts.push("'extracted'");
|
|
9849
|
+
colParts.push("reason");
|
|
9850
|
+
}
|
|
9851
|
+
if (hasDepStatus) {
|
|
9852
|
+
selectParts.push("'active'");
|
|
9853
|
+
colParts.push("status");
|
|
9854
|
+
}
|
|
9855
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
9856
|
+
selectParts.push("updated_at");
|
|
9857
|
+
colParts.push("updated_at");
|
|
9858
|
+
}
|
|
9859
|
+
const selectClause = selectParts.join(", ");
|
|
9860
|
+
const colsClause = colParts.join(", ");
|
|
9861
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
9862
|
+
SELECT ${selectClause}
|
|
9863
|
+
FROM relations
|
|
9864
|
+
WHERE source_entity_id IS NOT NULL
|
|
9865
|
+
AND target_entity_id IS NOT NULL
|
|
9866
|
+
AND relation_type IS NOT NULL`);
|
|
9867
|
+
}
|
|
9868
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
9869
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9870
|
+
if (cols.some((col) => col.name === column))
|
|
9871
|
+
return;
|
|
9872
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9873
|
+
}
|
|
9874
|
+
function up86(db) {
|
|
9875
|
+
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
9876
|
+
db.exec(`
|
|
9877
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
9878
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
9879
|
+
`);
|
|
9880
|
+
}
|
|
9785
9881
|
var MIGRATIONS = [
|
|
9786
9882
|
{
|
|
9787
9883
|
version: 1,
|
|
@@ -10461,6 +10557,30 @@ var MIGRATIONS = [
|
|
|
10461
10557
|
{ table: "memories", column: "superseded_reason" }
|
|
10462
10558
|
]
|
|
10463
10559
|
}
|
|
10560
|
+
},
|
|
10561
|
+
{
|
|
10562
|
+
version: 84,
|
|
10563
|
+
name: "legacy-markdown-import-state",
|
|
10564
|
+
up: up84,
|
|
10565
|
+
artifacts: {
|
|
10566
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
10567
|
+
}
|
|
10568
|
+
},
|
|
10569
|
+
{
|
|
10570
|
+
version: 85,
|
|
10571
|
+
name: "backfill-relations-to-dependencies",
|
|
10572
|
+
up: up85,
|
|
10573
|
+
artifacts: {
|
|
10574
|
+
tables: ["entity_dependencies"]
|
|
10575
|
+
}
|
|
10576
|
+
},
|
|
10577
|
+
{
|
|
10578
|
+
version: 86,
|
|
10579
|
+
name: "summary-jobs-content-hash",
|
|
10580
|
+
up: up86,
|
|
10581
|
+
artifacts: {
|
|
10582
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
10583
|
+
}
|
|
10464
10584
|
}
|
|
10465
10585
|
];
|
|
10466
10586
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -17857,7 +17977,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17857
17977
|
return true;
|
|
17858
17978
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17859
17979
|
}
|
|
17860
|
-
function
|
|
17980
|
+
function up87(db) {
|
|
17861
17981
|
db.exec(`
|
|
17862
17982
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17863
17983
|
version INTEGER PRIMARY KEY,
|
|
@@ -17950,27 +18070,27 @@ function hasColumn13(db, table, column) {
|
|
|
17950
18070
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17951
18071
|
return rows.some((r) => r.name === column);
|
|
17952
18072
|
}
|
|
17953
|
-
function
|
|
18073
|
+
function addColumnIfMissing22(db, table, column, definition) {
|
|
17954
18074
|
if (!hasColumn13(db, table, column)) {
|
|
17955
18075
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17956
18076
|
}
|
|
17957
18077
|
}
|
|
17958
18078
|
function up210(db) {
|
|
17959
|
-
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
|
|
17965
|
-
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
18079
|
+
addColumnIfMissing22(db, "memories", "content_hash", "TEXT");
|
|
18080
|
+
addColumnIfMissing22(db, "memories", "normalized_content", "TEXT");
|
|
18081
|
+
addColumnIfMissing22(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
18082
|
+
addColumnIfMissing22(db, "memories", "deleted_at", "TEXT");
|
|
18083
|
+
addColumnIfMissing22(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
18084
|
+
addColumnIfMissing22(db, "memories", "embedding_model", "TEXT");
|
|
18085
|
+
addColumnIfMissing22(db, "memories", "extraction_model", "TEXT");
|
|
18086
|
+
addColumnIfMissing22(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
18087
|
+
addColumnIfMissing22(db, "memories", "who", "TEXT");
|
|
18088
|
+
addColumnIfMissing22(db, "memories", "why", "TEXT");
|
|
18089
|
+
addColumnIfMissing22(db, "memories", "project", "TEXT");
|
|
18090
|
+
addColumnIfMissing22(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
18091
|
+
addColumnIfMissing22(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
18092
|
+
addColumnIfMissing22(db, "memories", "last_accessed", "TEXT");
|
|
18093
|
+
addColumnIfMissing22(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17974
18094
|
db.exec(`
|
|
17975
18095
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17976
18096
|
id TEXT PRIMARY KEY,
|
|
@@ -18066,7 +18186,7 @@ function up210(db) {
|
|
|
18066
18186
|
ON memory_entity_mentions(entity_id);
|
|
18067
18187
|
`);
|
|
18068
18188
|
}
|
|
18069
|
-
function
|
|
18189
|
+
function addColumnIfMissing23(db, table, column, definition) {
|
|
18070
18190
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
18071
18191
|
if (rows.some((r) => r.name === column))
|
|
18072
18192
|
return false;
|
|
@@ -18074,8 +18194,8 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
18074
18194
|
return true;
|
|
18075
18195
|
}
|
|
18076
18196
|
function up310(db) {
|
|
18077
|
-
|
|
18078
|
-
|
|
18197
|
+
addColumnIfMissing23(db, "memories", "why", "TEXT");
|
|
18198
|
+
addColumnIfMissing23(db, "memories", "project", "TEXT");
|
|
18079
18199
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
18080
18200
|
db.exec(`
|
|
18081
18201
|
UPDATE memories
|
|
@@ -18232,7 +18352,7 @@ function up710(db) {
|
|
|
18232
18352
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18233
18353
|
}
|
|
18234
18354
|
}
|
|
18235
|
-
function
|
|
18355
|
+
function up88(db) {
|
|
18236
18356
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18237
18357
|
if (tables.length === 0)
|
|
18238
18358
|
return;
|
|
@@ -20690,11 +20810,107 @@ function up832(db) {
|
|
|
20690
20810
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
20691
20811
|
`);
|
|
20692
20812
|
}
|
|
20813
|
+
function up842(db) {
|
|
20814
|
+
db.exec(`
|
|
20815
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
20816
|
+
path TEXT PRIMARY KEY,
|
|
20817
|
+
mtime_ms INTEGER NOT NULL,
|
|
20818
|
+
ctime_ms INTEGER NOT NULL,
|
|
20819
|
+
size INTEGER NOT NULL,
|
|
20820
|
+
content_hash TEXT NOT NULL,
|
|
20821
|
+
importer_version INTEGER NOT NULL,
|
|
20822
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
20823
|
+
last_imported_at TEXT NOT NULL,
|
|
20824
|
+
last_seen_at TEXT NOT NULL,
|
|
20825
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
20826
|
+
error TEXT
|
|
20827
|
+
);
|
|
20828
|
+
|
|
20829
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
20830
|
+
file_path TEXT NOT NULL,
|
|
20831
|
+
chunk_hash TEXT NOT NULL,
|
|
20832
|
+
chunk_index INTEGER NOT NULL,
|
|
20833
|
+
memory_id TEXT,
|
|
20834
|
+
source_id TEXT,
|
|
20835
|
+
created_at TEXT NOT NULL,
|
|
20836
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
20837
|
+
);
|
|
20838
|
+
|
|
20839
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
20840
|
+
ON legacy_markdown_chunks(memory_id);
|
|
20841
|
+
`);
|
|
20842
|
+
}
|
|
20843
|
+
function up852(db) {
|
|
20844
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
20845
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
20846
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
20847
|
+
return;
|
|
20848
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
20849
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
20850
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
20851
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
20852
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
20853
|
+
return;
|
|
20854
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
20855
|
+
return;
|
|
20856
|
+
const hasRelConfidence = rel.has("confidence");
|
|
20857
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
20858
|
+
const hasDepConfidence = dep.has("confidence");
|
|
20859
|
+
const hasDepReason = dep.has("reason");
|
|
20860
|
+
const hasDepStatus = dep.has("status");
|
|
20861
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20862
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20863
|
+
selectParts.push("relation_type");
|
|
20864
|
+
colParts.push("dependency_type");
|
|
20865
|
+
selectParts.push("strength", "created_at");
|
|
20866
|
+
colParts.push("strength", "created_at");
|
|
20867
|
+
selectParts.push("'default'");
|
|
20868
|
+
colParts.push("agent_id");
|
|
20869
|
+
selectParts.push("NULL");
|
|
20870
|
+
colParts.push("aspect_id");
|
|
20871
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
20872
|
+
selectParts.push("confidence");
|
|
20873
|
+
colParts.push("confidence");
|
|
20874
|
+
}
|
|
20875
|
+
if (hasDepReason) {
|
|
20876
|
+
selectParts.push("'extracted'");
|
|
20877
|
+
colParts.push("reason");
|
|
20878
|
+
}
|
|
20879
|
+
if (hasDepStatus) {
|
|
20880
|
+
selectParts.push("'active'");
|
|
20881
|
+
colParts.push("status");
|
|
20882
|
+
}
|
|
20883
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
20884
|
+
selectParts.push("updated_at");
|
|
20885
|
+
colParts.push("updated_at");
|
|
20886
|
+
}
|
|
20887
|
+
const selectClause = selectParts.join(", ");
|
|
20888
|
+
const colsClause = colParts.join(", ");
|
|
20889
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
20890
|
+
SELECT ${selectClause}
|
|
20891
|
+
FROM relations
|
|
20892
|
+
WHERE source_entity_id IS NOT NULL
|
|
20893
|
+
AND target_entity_id IS NOT NULL
|
|
20894
|
+
AND relation_type IS NOT NULL`);
|
|
20895
|
+
}
|
|
20896
|
+
function addColumnIfMissing212(db, table, column, definition) {
|
|
20897
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20898
|
+
if (cols.some((col) => col.name === column))
|
|
20899
|
+
return;
|
|
20900
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20901
|
+
}
|
|
20902
|
+
function up862(db) {
|
|
20903
|
+
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
20904
|
+
db.exec(`
|
|
20905
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
20906
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
20907
|
+
`);
|
|
20908
|
+
}
|
|
20693
20909
|
var MIGRATIONS2 = [
|
|
20694
20910
|
{
|
|
20695
20911
|
version: 1,
|
|
20696
20912
|
name: "baseline",
|
|
20697
|
-
up:
|
|
20913
|
+
up: up87,
|
|
20698
20914
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20699
20915
|
},
|
|
20700
20916
|
{
|
|
@@ -20743,7 +20959,7 @@ var MIGRATIONS2 = [
|
|
|
20743
20959
|
{
|
|
20744
20960
|
version: 8,
|
|
20745
20961
|
name: "embeddings-unique-hash",
|
|
20746
|
-
up:
|
|
20962
|
+
up: up88
|
|
20747
20963
|
},
|
|
20748
20964
|
{
|
|
20749
20965
|
version: 9,
|
|
@@ -21369,6 +21585,30 @@ var MIGRATIONS2 = [
|
|
|
21369
21585
|
{ table: "memories", column: "superseded_reason" }
|
|
21370
21586
|
]
|
|
21371
21587
|
}
|
|
21588
|
+
},
|
|
21589
|
+
{
|
|
21590
|
+
version: 84,
|
|
21591
|
+
name: "legacy-markdown-import-state",
|
|
21592
|
+
up: up842,
|
|
21593
|
+
artifacts: {
|
|
21594
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
21595
|
+
}
|
|
21596
|
+
},
|
|
21597
|
+
{
|
|
21598
|
+
version: 85,
|
|
21599
|
+
name: "backfill-relations-to-dependencies",
|
|
21600
|
+
up: up852,
|
|
21601
|
+
artifacts: {
|
|
21602
|
+
tables: ["entity_dependencies"]
|
|
21603
|
+
}
|
|
21604
|
+
},
|
|
21605
|
+
{
|
|
21606
|
+
version: 86,
|
|
21607
|
+
name: "summary-jobs-content-hash",
|
|
21608
|
+
up: up862,
|
|
21609
|
+
artifacts: {
|
|
21610
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
21611
|
+
}
|
|
21372
21612
|
}
|
|
21373
21613
|
];
|
|
21374
21614
|
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.
|
|
3
|
+
"version": "0.147.1",
|
|
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.
|
|
28
|
-
"@signetai/core": "0.
|
|
27
|
+
"@signetai/connector-base": "0.147.1",
|
|
28
|
+
"@signetai/core": "0.147.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.0.0",
|