@signetai/connector-hermes-agent 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
|
@@ -9772,6 +9772,102 @@ function up83(db) {
|
|
|
9772
9772
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
9773
9773
|
`);
|
|
9774
9774
|
}
|
|
9775
|
+
function up84(db) {
|
|
9776
|
+
db.exec(`
|
|
9777
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
9778
|
+
path TEXT PRIMARY KEY,
|
|
9779
|
+
mtime_ms INTEGER NOT NULL,
|
|
9780
|
+
ctime_ms INTEGER NOT NULL,
|
|
9781
|
+
size INTEGER NOT NULL,
|
|
9782
|
+
content_hash TEXT NOT NULL,
|
|
9783
|
+
importer_version INTEGER NOT NULL,
|
|
9784
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
9785
|
+
last_imported_at TEXT NOT NULL,
|
|
9786
|
+
last_seen_at TEXT NOT NULL,
|
|
9787
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
9788
|
+
error TEXT
|
|
9789
|
+
);
|
|
9790
|
+
|
|
9791
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
9792
|
+
file_path TEXT NOT NULL,
|
|
9793
|
+
chunk_hash TEXT NOT NULL,
|
|
9794
|
+
chunk_index INTEGER NOT NULL,
|
|
9795
|
+
memory_id TEXT,
|
|
9796
|
+
source_id TEXT,
|
|
9797
|
+
created_at TEXT NOT NULL,
|
|
9798
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
9799
|
+
);
|
|
9800
|
+
|
|
9801
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
9802
|
+
ON legacy_markdown_chunks(memory_id);
|
|
9803
|
+
`);
|
|
9804
|
+
}
|
|
9805
|
+
function up85(db) {
|
|
9806
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
9807
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
9808
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
9809
|
+
return;
|
|
9810
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
9811
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
9812
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
9813
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
9814
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
9815
|
+
return;
|
|
9816
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
9817
|
+
return;
|
|
9818
|
+
const hasRelConfidence = rel.has("confidence");
|
|
9819
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
9820
|
+
const hasDepConfidence = dep.has("confidence");
|
|
9821
|
+
const hasDepReason = dep.has("reason");
|
|
9822
|
+
const hasDepStatus = dep.has("status");
|
|
9823
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
9824
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
9825
|
+
selectParts.push("relation_type");
|
|
9826
|
+
colParts.push("dependency_type");
|
|
9827
|
+
selectParts.push("strength", "created_at");
|
|
9828
|
+
colParts.push("strength", "created_at");
|
|
9829
|
+
selectParts.push("'default'");
|
|
9830
|
+
colParts.push("agent_id");
|
|
9831
|
+
selectParts.push("NULL");
|
|
9832
|
+
colParts.push("aspect_id");
|
|
9833
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
9834
|
+
selectParts.push("confidence");
|
|
9835
|
+
colParts.push("confidence");
|
|
9836
|
+
}
|
|
9837
|
+
if (hasDepReason) {
|
|
9838
|
+
selectParts.push("'extracted'");
|
|
9839
|
+
colParts.push("reason");
|
|
9840
|
+
}
|
|
9841
|
+
if (hasDepStatus) {
|
|
9842
|
+
selectParts.push("'active'");
|
|
9843
|
+
colParts.push("status");
|
|
9844
|
+
}
|
|
9845
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
9846
|
+
selectParts.push("updated_at");
|
|
9847
|
+
colParts.push("updated_at");
|
|
9848
|
+
}
|
|
9849
|
+
const selectClause = selectParts.join(", ");
|
|
9850
|
+
const colsClause = colParts.join(", ");
|
|
9851
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
9852
|
+
SELECT ${selectClause}
|
|
9853
|
+
FROM relations
|
|
9854
|
+
WHERE source_entity_id IS NOT NULL
|
|
9855
|
+
AND target_entity_id IS NOT NULL
|
|
9856
|
+
AND relation_type IS NOT NULL`);
|
|
9857
|
+
}
|
|
9858
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
9859
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
9860
|
+
if (cols.some((col) => col.name === column))
|
|
9861
|
+
return;
|
|
9862
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
9863
|
+
}
|
|
9864
|
+
function up86(db) {
|
|
9865
|
+
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
9866
|
+
db.exec(`
|
|
9867
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
9868
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
9869
|
+
`);
|
|
9870
|
+
}
|
|
9775
9871
|
var MIGRATIONS = [
|
|
9776
9872
|
{
|
|
9777
9873
|
version: 1,
|
|
@@ -10451,6 +10547,30 @@ var MIGRATIONS = [
|
|
|
10451
10547
|
{ table: "memories", column: "superseded_reason" }
|
|
10452
10548
|
]
|
|
10453
10549
|
}
|
|
10550
|
+
},
|
|
10551
|
+
{
|
|
10552
|
+
version: 84,
|
|
10553
|
+
name: "legacy-markdown-import-state",
|
|
10554
|
+
up: up84,
|
|
10555
|
+
artifacts: {
|
|
10556
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
10557
|
+
}
|
|
10558
|
+
},
|
|
10559
|
+
{
|
|
10560
|
+
version: 85,
|
|
10561
|
+
name: "backfill-relations-to-dependencies",
|
|
10562
|
+
up: up85,
|
|
10563
|
+
artifacts: {
|
|
10564
|
+
tables: ["entity_dependencies"]
|
|
10565
|
+
}
|
|
10566
|
+
},
|
|
10567
|
+
{
|
|
10568
|
+
version: 86,
|
|
10569
|
+
name: "summary-jobs-content-hash",
|
|
10570
|
+
up: up86,
|
|
10571
|
+
artifacts: {
|
|
10572
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
10573
|
+
}
|
|
10454
10574
|
}
|
|
10455
10575
|
];
|
|
10456
10576
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -17791,7 +17911,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
17791
17911
|
return true;
|
|
17792
17912
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
17793
17913
|
}
|
|
17794
|
-
function
|
|
17914
|
+
function up87(db) {
|
|
17795
17915
|
db.exec(`
|
|
17796
17916
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
17797
17917
|
version INTEGER PRIMARY KEY,
|
|
@@ -17884,27 +18004,27 @@ function hasColumn13(db, table, column) {
|
|
|
17884
18004
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
17885
18005
|
return rows.some((r) => r.name === column);
|
|
17886
18006
|
}
|
|
17887
|
-
function
|
|
18007
|
+
function addColumnIfMissing22(db, table, column, definition) {
|
|
17888
18008
|
if (!hasColumn13(db, table, column)) {
|
|
17889
18009
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
17890
18010
|
}
|
|
17891
18011
|
}
|
|
17892
18012
|
function up210(db) {
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
|
|
17898
|
-
|
|
17899
|
-
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
|
|
17903
|
-
|
|
17904
|
-
|
|
17905
|
-
|
|
17906
|
-
|
|
17907
|
-
|
|
18013
|
+
addColumnIfMissing22(db, "memories", "content_hash", "TEXT");
|
|
18014
|
+
addColumnIfMissing22(db, "memories", "normalized_content", "TEXT");
|
|
18015
|
+
addColumnIfMissing22(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
18016
|
+
addColumnIfMissing22(db, "memories", "deleted_at", "TEXT");
|
|
18017
|
+
addColumnIfMissing22(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
18018
|
+
addColumnIfMissing22(db, "memories", "embedding_model", "TEXT");
|
|
18019
|
+
addColumnIfMissing22(db, "memories", "extraction_model", "TEXT");
|
|
18020
|
+
addColumnIfMissing22(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
18021
|
+
addColumnIfMissing22(db, "memories", "who", "TEXT");
|
|
18022
|
+
addColumnIfMissing22(db, "memories", "why", "TEXT");
|
|
18023
|
+
addColumnIfMissing22(db, "memories", "project", "TEXT");
|
|
18024
|
+
addColumnIfMissing22(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
18025
|
+
addColumnIfMissing22(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
18026
|
+
addColumnIfMissing22(db, "memories", "last_accessed", "TEXT");
|
|
18027
|
+
addColumnIfMissing22(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
17908
18028
|
db.exec(`
|
|
17909
18029
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
17910
18030
|
id TEXT PRIMARY KEY,
|
|
@@ -18000,7 +18120,7 @@ function up210(db) {
|
|
|
18000
18120
|
ON memory_entity_mentions(entity_id);
|
|
18001
18121
|
`);
|
|
18002
18122
|
}
|
|
18003
|
-
function
|
|
18123
|
+
function addColumnIfMissing23(db, table, column, definition) {
|
|
18004
18124
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
18005
18125
|
if (rows.some((r) => r.name === column))
|
|
18006
18126
|
return false;
|
|
@@ -18008,8 +18128,8 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
18008
18128
|
return true;
|
|
18009
18129
|
}
|
|
18010
18130
|
function up310(db) {
|
|
18011
|
-
|
|
18012
|
-
|
|
18131
|
+
addColumnIfMissing23(db, "memories", "why", "TEXT");
|
|
18132
|
+
addColumnIfMissing23(db, "memories", "project", "TEXT");
|
|
18013
18133
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
18014
18134
|
db.exec(`
|
|
18015
18135
|
UPDATE memories
|
|
@@ -18166,7 +18286,7 @@ function up710(db) {
|
|
|
18166
18286
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
18167
18287
|
}
|
|
18168
18288
|
}
|
|
18169
|
-
function
|
|
18289
|
+
function up88(db) {
|
|
18170
18290
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
18171
18291
|
if (tables.length === 0)
|
|
18172
18292
|
return;
|
|
@@ -20624,11 +20744,107 @@ function up832(db) {
|
|
|
20624
20744
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
20625
20745
|
`);
|
|
20626
20746
|
}
|
|
20747
|
+
function up842(db) {
|
|
20748
|
+
db.exec(`
|
|
20749
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
20750
|
+
path TEXT PRIMARY KEY,
|
|
20751
|
+
mtime_ms INTEGER NOT NULL,
|
|
20752
|
+
ctime_ms INTEGER NOT NULL,
|
|
20753
|
+
size INTEGER NOT NULL,
|
|
20754
|
+
content_hash TEXT NOT NULL,
|
|
20755
|
+
importer_version INTEGER NOT NULL,
|
|
20756
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
20757
|
+
last_imported_at TEXT NOT NULL,
|
|
20758
|
+
last_seen_at TEXT NOT NULL,
|
|
20759
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
20760
|
+
error TEXT
|
|
20761
|
+
);
|
|
20762
|
+
|
|
20763
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
20764
|
+
file_path TEXT NOT NULL,
|
|
20765
|
+
chunk_hash TEXT NOT NULL,
|
|
20766
|
+
chunk_index INTEGER NOT NULL,
|
|
20767
|
+
memory_id TEXT,
|
|
20768
|
+
source_id TEXT,
|
|
20769
|
+
created_at TEXT NOT NULL,
|
|
20770
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
20771
|
+
);
|
|
20772
|
+
|
|
20773
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
20774
|
+
ON legacy_markdown_chunks(memory_id);
|
|
20775
|
+
`);
|
|
20776
|
+
}
|
|
20777
|
+
function up852(db) {
|
|
20778
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
20779
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
20780
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
20781
|
+
return;
|
|
20782
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
20783
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
20784
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
20785
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
20786
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
20787
|
+
return;
|
|
20788
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
20789
|
+
return;
|
|
20790
|
+
const hasRelConfidence = rel.has("confidence");
|
|
20791
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
20792
|
+
const hasDepConfidence = dep.has("confidence");
|
|
20793
|
+
const hasDepReason = dep.has("reason");
|
|
20794
|
+
const hasDepStatus = dep.has("status");
|
|
20795
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20796
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
20797
|
+
selectParts.push("relation_type");
|
|
20798
|
+
colParts.push("dependency_type");
|
|
20799
|
+
selectParts.push("strength", "created_at");
|
|
20800
|
+
colParts.push("strength", "created_at");
|
|
20801
|
+
selectParts.push("'default'");
|
|
20802
|
+
colParts.push("agent_id");
|
|
20803
|
+
selectParts.push("NULL");
|
|
20804
|
+
colParts.push("aspect_id");
|
|
20805
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
20806
|
+
selectParts.push("confidence");
|
|
20807
|
+
colParts.push("confidence");
|
|
20808
|
+
}
|
|
20809
|
+
if (hasDepReason) {
|
|
20810
|
+
selectParts.push("'extracted'");
|
|
20811
|
+
colParts.push("reason");
|
|
20812
|
+
}
|
|
20813
|
+
if (hasDepStatus) {
|
|
20814
|
+
selectParts.push("'active'");
|
|
20815
|
+
colParts.push("status");
|
|
20816
|
+
}
|
|
20817
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
20818
|
+
selectParts.push("updated_at");
|
|
20819
|
+
colParts.push("updated_at");
|
|
20820
|
+
}
|
|
20821
|
+
const selectClause = selectParts.join(", ");
|
|
20822
|
+
const colsClause = colParts.join(", ");
|
|
20823
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
20824
|
+
SELECT ${selectClause}
|
|
20825
|
+
FROM relations
|
|
20826
|
+
WHERE source_entity_id IS NOT NULL
|
|
20827
|
+
AND target_entity_id IS NOT NULL
|
|
20828
|
+
AND relation_type IS NOT NULL`);
|
|
20829
|
+
}
|
|
20830
|
+
function addColumnIfMissing212(db, table, column, definition) {
|
|
20831
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
20832
|
+
if (cols.some((col) => col.name === column))
|
|
20833
|
+
return;
|
|
20834
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
20835
|
+
}
|
|
20836
|
+
function up862(db) {
|
|
20837
|
+
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
20838
|
+
db.exec(`
|
|
20839
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
20840
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
20841
|
+
`);
|
|
20842
|
+
}
|
|
20627
20843
|
var MIGRATIONS2 = [
|
|
20628
20844
|
{
|
|
20629
20845
|
version: 1,
|
|
20630
20846
|
name: "baseline",
|
|
20631
|
-
up:
|
|
20847
|
+
up: up87,
|
|
20632
20848
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
20633
20849
|
},
|
|
20634
20850
|
{
|
|
@@ -20677,7 +20893,7 @@ var MIGRATIONS2 = [
|
|
|
20677
20893
|
{
|
|
20678
20894
|
version: 8,
|
|
20679
20895
|
name: "embeddings-unique-hash",
|
|
20680
|
-
up:
|
|
20896
|
+
up: up88
|
|
20681
20897
|
},
|
|
20682
20898
|
{
|
|
20683
20899
|
version: 9,
|
|
@@ -21303,6 +21519,30 @@ var MIGRATIONS2 = [
|
|
|
21303
21519
|
{ table: "memories", column: "superseded_reason" }
|
|
21304
21520
|
]
|
|
21305
21521
|
}
|
|
21522
|
+
},
|
|
21523
|
+
{
|
|
21524
|
+
version: 84,
|
|
21525
|
+
name: "legacy-markdown-import-state",
|
|
21526
|
+
up: up842,
|
|
21527
|
+
artifacts: {
|
|
21528
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
21529
|
+
}
|
|
21530
|
+
},
|
|
21531
|
+
{
|
|
21532
|
+
version: 85,
|
|
21533
|
+
name: "backfill-relations-to-dependencies",
|
|
21534
|
+
up: up852,
|
|
21535
|
+
artifacts: {
|
|
21536
|
+
tables: ["entity_dependencies"]
|
|
21537
|
+
}
|
|
21538
|
+
},
|
|
21539
|
+
{
|
|
21540
|
+
version: 86,
|
|
21541
|
+
name: "summary-jobs-content-hash",
|
|
21542
|
+
up: up862,
|
|
21543
|
+
artifacts: {
|
|
21544
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
21545
|
+
}
|
|
21306
21546
|
}
|
|
21307
21547
|
];
|
|
21308
21548
|
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-hermes-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.1",
|
|
4
4
|
"description": "Signet connector for Hermes Agent — installs Signet as a pluggable memory provider",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@signetai/connector-base": "0.
|
|
29
|
-
"@signetai/core": "0.
|
|
28
|
+
"@signetai/connector-base": "0.147.1",
|
|
29
|
+
"@signetai/core": "0.147.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.0.0",
|