@signetai/connector-forge 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
|
@@ -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;
|
|
@@ -17860,7 +17980,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17860
17980
|
return true;
|
|
17861
17981
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17862
17982
|
}
|
|
17863
|
-
function
|
|
17983
|
+
function up87(db) {
|
|
17864
17984
|
db.exec(`
|
|
17865
17985
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17866
17986
|
version INTEGER PRIMARY KEY,
|
|
@@ -17953,27 +18073,27 @@ function hasColumn13(db, table, column) {
|
|
|
17953
18073
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17954
18074
|
return rows.some((r) => r.name === column);
|
|
17955
18075
|
}
|
|
17956
|
-
function
|
|
18076
|
+
function addColumnIfMissing22(db, table, column, definition) {
|
|
17957
18077
|
if (!hasColumn13(db, table, column)) {
|
|
17958
18078
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17959
18079
|
}
|
|
17960
18080
|
}
|
|
17961
18081
|
function up210(db) {
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
|
|
17965
|
-
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
17974
|
-
|
|
17975
|
-
|
|
17976
|
-
|
|
18082
|
+
addColumnIfMissing22(db, "memories", "content_hash", "TEXT");
|
|
18083
|
+
addColumnIfMissing22(db, "memories", "normalized_content", "TEXT");
|
|
18084
|
+
addColumnIfMissing22(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
18085
|
+
addColumnIfMissing22(db, "memories", "deleted_at", "TEXT");
|
|
18086
|
+
addColumnIfMissing22(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
18087
|
+
addColumnIfMissing22(db, "memories", "embedding_model", "TEXT");
|
|
18088
|
+
addColumnIfMissing22(db, "memories", "extraction_model", "TEXT");
|
|
18089
|
+
addColumnIfMissing22(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
18090
|
+
addColumnIfMissing22(db, "memories", "who", "TEXT");
|
|
18091
|
+
addColumnIfMissing22(db, "memories", "why", "TEXT");
|
|
18092
|
+
addColumnIfMissing22(db, "memories", "project", "TEXT");
|
|
18093
|
+
addColumnIfMissing22(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
18094
|
+
addColumnIfMissing22(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
18095
|
+
addColumnIfMissing22(db, "memories", "last_accessed", "TEXT");
|
|
18096
|
+
addColumnIfMissing22(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17977
18097
|
db.exec(`
|
|
17978
18098
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17979
18099
|
id TEXT PRIMARY KEY,
|
|
@@ -18069,7 +18189,7 @@ function up210(db) {
|
|
|
18069
18189
|
ON memory_entity_mentions(entity_id);
|
|
18070
18190
|
`);
|
|
18071
18191
|
}
|
|
18072
|
-
function
|
|
18192
|
+
function addColumnIfMissing23(db, table, column, definition) {
|
|
18073
18193
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
18074
18194
|
if (rows.some((r) => r.name === column))
|
|
18075
18195
|
return false;
|
|
@@ -18077,8 +18197,8 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
18077
18197
|
return true;
|
|
18078
18198
|
}
|
|
18079
18199
|
function up310(db) {
|
|
18080
|
-
|
|
18081
|
-
|
|
18200
|
+
addColumnIfMissing23(db, "memories", "why", "TEXT");
|
|
18201
|
+
addColumnIfMissing23(db, "memories", "project", "TEXT");
|
|
18082
18202
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
18083
18203
|
db.exec(`
|
|
18084
18204
|
UPDATE memories
|
|
@@ -18235,7 +18355,7 @@ function up710(db) {
|
|
|
18235
18355
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18236
18356
|
}
|
|
18237
18357
|
}
|
|
18238
|
-
function
|
|
18358
|
+
function up88(db) {
|
|
18239
18359
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18240
18360
|
if (tables.length === 0)
|
|
18241
18361
|
return;
|
|
@@ -20693,11 +20813,107 @@ function up832(db) {
|
|
|
20693
20813
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
20694
20814
|
`);
|
|
20695
20815
|
}
|
|
20816
|
+
function up842(db) {
|
|
20817
|
+
db.exec(`
|
|
20818
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
20819
|
+
path TEXT PRIMARY KEY,
|
|
20820
|
+
mtime_ms INTEGER NOT NULL,
|
|
20821
|
+
ctime_ms INTEGER NOT NULL,
|
|
20822
|
+
size INTEGER NOT NULL,
|
|
20823
|
+
content_hash TEXT NOT NULL,
|
|
20824
|
+
importer_version INTEGER NOT NULL,
|
|
20825
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
20826
|
+
last_imported_at TEXT NOT NULL,
|
|
20827
|
+
last_seen_at TEXT NOT NULL,
|
|
20828
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
20829
|
+
error TEXT
|
|
20830
|
+
);
|
|
20831
|
+
|
|
20832
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
20833
|
+
file_path TEXT NOT NULL,
|
|
20834
|
+
chunk_hash TEXT NOT NULL,
|
|
20835
|
+
chunk_index INTEGER NOT NULL,
|
|
20836
|
+
memory_id TEXT,
|
|
20837
|
+
source_id TEXT,
|
|
20838
|
+
created_at TEXT NOT NULL,
|
|
20839
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
20840
|
+
);
|
|
20841
|
+
|
|
20842
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
20843
|
+
ON legacy_markdown_chunks(memory_id);
|
|
20844
|
+
`);
|
|
20845
|
+
}
|
|
20846
|
+
function up852(db) {
|
|
20847
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
20848
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
20849
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
20850
|
+
return;
|
|
20851
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
20852
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
20853
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
20854
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
20855
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
20856
|
+
return;
|
|
20857
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
20858
|
+
return;
|
|
20859
|
+
const hasRelConfidence = rel.has("confidence");
|
|
20860
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
20861
|
+
const hasDepConfidence = dep.has("confidence");
|
|
20862
|
+
const hasDepReason = dep.has("reason");
|
|
20863
|
+
const hasDepStatus = dep.has("status");
|
|
20864
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20865
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20866
|
+
selectParts.push("relation_type");
|
|
20867
|
+
colParts.push("dependency_type");
|
|
20868
|
+
selectParts.push("strength", "created_at");
|
|
20869
|
+
colParts.push("strength", "created_at");
|
|
20870
|
+
selectParts.push("'default'");
|
|
20871
|
+
colParts.push("agent_id");
|
|
20872
|
+
selectParts.push("NULL");
|
|
20873
|
+
colParts.push("aspect_id");
|
|
20874
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
20875
|
+
selectParts.push("confidence");
|
|
20876
|
+
colParts.push("confidence");
|
|
20877
|
+
}
|
|
20878
|
+
if (hasDepReason) {
|
|
20879
|
+
selectParts.push("'extracted'");
|
|
20880
|
+
colParts.push("reason");
|
|
20881
|
+
}
|
|
20882
|
+
if (hasDepStatus) {
|
|
20883
|
+
selectParts.push("'active'");
|
|
20884
|
+
colParts.push("status");
|
|
20885
|
+
}
|
|
20886
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
20887
|
+
selectParts.push("updated_at");
|
|
20888
|
+
colParts.push("updated_at");
|
|
20889
|
+
}
|
|
20890
|
+
const selectClause = selectParts.join(", ");
|
|
20891
|
+
const colsClause = colParts.join(", ");
|
|
20892
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
20893
|
+
SELECT ${selectClause}
|
|
20894
|
+
FROM relations
|
|
20895
|
+
WHERE source_entity_id IS NOT NULL
|
|
20896
|
+
AND target_entity_id IS NOT NULL
|
|
20897
|
+
AND relation_type IS NOT NULL`);
|
|
20898
|
+
}
|
|
20899
|
+
function addColumnIfMissing212(db, table, column, definition) {
|
|
20900
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20901
|
+
if (cols.some((col) => col.name === column))
|
|
20902
|
+
return;
|
|
20903
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20904
|
+
}
|
|
20905
|
+
function up862(db) {
|
|
20906
|
+
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
20907
|
+
db.exec(`
|
|
20908
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
20909
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
20910
|
+
`);
|
|
20911
|
+
}
|
|
20696
20912
|
var MIGRATIONS2 = [
|
|
20697
20913
|
{
|
|
20698
20914
|
version: 1,
|
|
20699
20915
|
name: "baseline",
|
|
20700
|
-
up:
|
|
20916
|
+
up: up87,
|
|
20701
20917
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20702
20918
|
},
|
|
20703
20919
|
{
|
|
@@ -20746,7 +20962,7 @@ var MIGRATIONS2 = [
|
|
|
20746
20962
|
{
|
|
20747
20963
|
version: 8,
|
|
20748
20964
|
name: "embeddings-unique-hash",
|
|
20749
|
-
up:
|
|
20965
|
+
up: up88
|
|
20750
20966
|
},
|
|
20751
20967
|
{
|
|
20752
20968
|
version: 9,
|
|
@@ -21372,6 +21588,30 @@ var MIGRATIONS2 = [
|
|
|
21372
21588
|
{ table: "memories", column: "superseded_reason" }
|
|
21373
21589
|
]
|
|
21374
21590
|
}
|
|
21591
|
+
},
|
|
21592
|
+
{
|
|
21593
|
+
version: 84,
|
|
21594
|
+
name: "legacy-markdown-import-state",
|
|
21595
|
+
up: up842,
|
|
21596
|
+
artifacts: {
|
|
21597
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
21598
|
+
}
|
|
21599
|
+
},
|
|
21600
|
+
{
|
|
21601
|
+
version: 85,
|
|
21602
|
+
name: "backfill-relations-to-dependencies",
|
|
21603
|
+
up: up852,
|
|
21604
|
+
artifacts: {
|
|
21605
|
+
tables: ["entity_dependencies"]
|
|
21606
|
+
}
|
|
21607
|
+
},
|
|
21608
|
+
{
|
|
21609
|
+
version: 86,
|
|
21610
|
+
name: "summary-jobs-content-hash",
|
|
21611
|
+
up: up862,
|
|
21612
|
+
artifacts: {
|
|
21613
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
21614
|
+
}
|
|
21375
21615
|
}
|
|
21376
21616
|
];
|
|
21377
21617
|
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-forge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.0",
|
|
4
4
|
"description": "Signet connector for ForgeCode - installs MCP, identity, and skills integration",
|
|
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",
|