@signetai/connector-openclaw 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
|
@@ -10915,6 +10915,102 @@ function up83(db) {
|
|
|
10915
10915
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
10916
10916
|
`);
|
|
10917
10917
|
}
|
|
10918
|
+
function up84(db) {
|
|
10919
|
+
db.exec(`
|
|
10920
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
10921
|
+
path TEXT PRIMARY KEY,
|
|
10922
|
+
mtime_ms INTEGER NOT NULL,
|
|
10923
|
+
ctime_ms INTEGER NOT NULL,
|
|
10924
|
+
size INTEGER NOT NULL,
|
|
10925
|
+
content_hash TEXT NOT NULL,
|
|
10926
|
+
importer_version INTEGER NOT NULL,
|
|
10927
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
10928
|
+
last_imported_at TEXT NOT NULL,
|
|
10929
|
+
last_seen_at TEXT NOT NULL,
|
|
10930
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
10931
|
+
error TEXT
|
|
10932
|
+
);
|
|
10933
|
+
|
|
10934
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
10935
|
+
file_path TEXT NOT NULL,
|
|
10936
|
+
chunk_hash TEXT NOT NULL,
|
|
10937
|
+
chunk_index INTEGER NOT NULL,
|
|
10938
|
+
memory_id TEXT,
|
|
10939
|
+
source_id TEXT,
|
|
10940
|
+
created_at TEXT NOT NULL,
|
|
10941
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
10942
|
+
);
|
|
10943
|
+
|
|
10944
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
10945
|
+
ON legacy_markdown_chunks(memory_id);
|
|
10946
|
+
`);
|
|
10947
|
+
}
|
|
10948
|
+
function up85(db) {
|
|
10949
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
10950
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
10951
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
10952
|
+
return;
|
|
10953
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
10954
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
10955
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
10956
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
10957
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
10958
|
+
return;
|
|
10959
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
10960
|
+
return;
|
|
10961
|
+
const hasRelConfidence = rel.has("confidence");
|
|
10962
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
10963
|
+
const hasDepConfidence = dep.has("confidence");
|
|
10964
|
+
const hasDepReason = dep.has("reason");
|
|
10965
|
+
const hasDepStatus = dep.has("status");
|
|
10966
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
10967
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
10968
|
+
selectParts.push("relation_type");
|
|
10969
|
+
colParts.push("dependency_type");
|
|
10970
|
+
selectParts.push("strength", "created_at");
|
|
10971
|
+
colParts.push("strength", "created_at");
|
|
10972
|
+
selectParts.push("'default'");
|
|
10973
|
+
colParts.push("agent_id");
|
|
10974
|
+
selectParts.push("NULL");
|
|
10975
|
+
colParts.push("aspect_id");
|
|
10976
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
10977
|
+
selectParts.push("confidence");
|
|
10978
|
+
colParts.push("confidence");
|
|
10979
|
+
}
|
|
10980
|
+
if (hasDepReason) {
|
|
10981
|
+
selectParts.push("'extracted'");
|
|
10982
|
+
colParts.push("reason");
|
|
10983
|
+
}
|
|
10984
|
+
if (hasDepStatus) {
|
|
10985
|
+
selectParts.push("'active'");
|
|
10986
|
+
colParts.push("status");
|
|
10987
|
+
}
|
|
10988
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
10989
|
+
selectParts.push("updated_at");
|
|
10990
|
+
colParts.push("updated_at");
|
|
10991
|
+
}
|
|
10992
|
+
const selectClause = selectParts.join(", ");
|
|
10993
|
+
const colsClause = colParts.join(", ");
|
|
10994
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
10995
|
+
SELECT ${selectClause}
|
|
10996
|
+
FROM relations
|
|
10997
|
+
WHERE source_entity_id IS NOT NULL
|
|
10998
|
+
AND target_entity_id IS NOT NULL
|
|
10999
|
+
AND relation_type IS NOT NULL`);
|
|
11000
|
+
}
|
|
11001
|
+
function addColumnIfMissing21(db, table, column, definition) {
|
|
11002
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
11003
|
+
if (cols.some((col) => col.name === column))
|
|
11004
|
+
return;
|
|
11005
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11006
|
+
}
|
|
11007
|
+
function up86(db) {
|
|
11008
|
+
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
11009
|
+
db.exec(`
|
|
11010
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
11011
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
11012
|
+
`);
|
|
11013
|
+
}
|
|
10918
11014
|
var MIGRATIONS = [
|
|
10919
11015
|
{
|
|
10920
11016
|
version: 1,
|
|
@@ -11594,6 +11690,30 @@ var MIGRATIONS = [
|
|
|
11594
11690
|
{ table: "memories", column: "superseded_reason" }
|
|
11595
11691
|
]
|
|
11596
11692
|
}
|
|
11693
|
+
},
|
|
11694
|
+
{
|
|
11695
|
+
version: 84,
|
|
11696
|
+
name: "legacy-markdown-import-state",
|
|
11697
|
+
up: up84,
|
|
11698
|
+
artifacts: {
|
|
11699
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
11700
|
+
}
|
|
11701
|
+
},
|
|
11702
|
+
{
|
|
11703
|
+
version: 85,
|
|
11704
|
+
name: "backfill-relations-to-dependencies",
|
|
11705
|
+
up: up85,
|
|
11706
|
+
artifacts: {
|
|
11707
|
+
tables: ["entity_dependencies"]
|
|
11708
|
+
}
|
|
11709
|
+
},
|
|
11710
|
+
{
|
|
11711
|
+
version: 86,
|
|
11712
|
+
name: "summary-jobs-content-hash",
|
|
11713
|
+
up: up86,
|
|
11714
|
+
artifacts: {
|
|
11715
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
11716
|
+
}
|
|
11597
11717
|
}
|
|
11598
11718
|
];
|
|
11599
11719
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -18944,7 +19064,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
18944
19064
|
return true;
|
|
18945
19065
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
18946
19066
|
}
|
|
18947
|
-
function
|
|
19067
|
+
function up87(db) {
|
|
18948
19068
|
db.exec(`
|
|
18949
19069
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
18950
19070
|
version INTEGER PRIMARY KEY,
|
|
@@ -19037,27 +19157,27 @@ function hasColumn13(db, table, column) {
|
|
|
19037
19157
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
19038
19158
|
return rows.some((r) => r.name === column);
|
|
19039
19159
|
}
|
|
19040
|
-
function
|
|
19160
|
+
function addColumnIfMissing22(db, table, column, definition) {
|
|
19041
19161
|
if (!hasColumn13(db, table, column)) {
|
|
19042
19162
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
19043
19163
|
}
|
|
19044
19164
|
}
|
|
19045
19165
|
function up210(db) {
|
|
19046
|
-
|
|
19047
|
-
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
|
|
19057
|
-
|
|
19058
|
-
|
|
19059
|
-
|
|
19060
|
-
|
|
19166
|
+
addColumnIfMissing22(db, "memories", "content_hash", "TEXT");
|
|
19167
|
+
addColumnIfMissing22(db, "memories", "normalized_content", "TEXT");
|
|
19168
|
+
addColumnIfMissing22(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
19169
|
+
addColumnIfMissing22(db, "memories", "deleted_at", "TEXT");
|
|
19170
|
+
addColumnIfMissing22(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
|
|
19171
|
+
addColumnIfMissing22(db, "memories", "embedding_model", "TEXT");
|
|
19172
|
+
addColumnIfMissing22(db, "memories", "extraction_model", "TEXT");
|
|
19173
|
+
addColumnIfMissing22(db, "memories", "update_count", "INTEGER DEFAULT 0");
|
|
19174
|
+
addColumnIfMissing22(db, "memories", "who", "TEXT");
|
|
19175
|
+
addColumnIfMissing22(db, "memories", "why", "TEXT");
|
|
19176
|
+
addColumnIfMissing22(db, "memories", "project", "TEXT");
|
|
19177
|
+
addColumnIfMissing22(db, "memories", "pinned", "INTEGER DEFAULT 0");
|
|
19178
|
+
addColumnIfMissing22(db, "memories", "importance", "REAL DEFAULT 0.5");
|
|
19179
|
+
addColumnIfMissing22(db, "memories", "last_accessed", "TEXT");
|
|
19180
|
+
addColumnIfMissing22(db, "memories", "access_count", "INTEGER DEFAULT 0");
|
|
19061
19181
|
db.exec(`
|
|
19062
19182
|
CREATE TABLE IF NOT EXISTS memory_history (
|
|
19063
19183
|
id TEXT PRIMARY KEY,
|
|
@@ -19153,7 +19273,7 @@ function up210(db) {
|
|
|
19153
19273
|
ON memory_entity_mentions(entity_id);
|
|
19154
19274
|
`);
|
|
19155
19275
|
}
|
|
19156
|
-
function
|
|
19276
|
+
function addColumnIfMissing23(db, table, column, definition) {
|
|
19157
19277
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
19158
19278
|
if (rows.some((r) => r.name === column))
|
|
19159
19279
|
return false;
|
|
@@ -19161,8 +19281,8 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
19161
19281
|
return true;
|
|
19162
19282
|
}
|
|
19163
19283
|
function up310(db) {
|
|
19164
|
-
|
|
19165
|
-
|
|
19284
|
+
addColumnIfMissing23(db, "memories", "why", "TEXT");
|
|
19285
|
+
addColumnIfMissing23(db, "memories", "project", "TEXT");
|
|
19166
19286
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
19167
19287
|
db.exec(`
|
|
19168
19288
|
UPDATE memories
|
|
@@ -19319,7 +19439,7 @@ function up710(db) {
|
|
|
19319
19439
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
19320
19440
|
}
|
|
19321
19441
|
}
|
|
19322
|
-
function
|
|
19442
|
+
function up88(db) {
|
|
19323
19443
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
19324
19444
|
if (tables.length === 0)
|
|
19325
19445
|
return;
|
|
@@ -21777,11 +21897,107 @@ function up832(db) {
|
|
|
21777
21897
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
21778
21898
|
`);
|
|
21779
21899
|
}
|
|
21900
|
+
function up842(db) {
|
|
21901
|
+
db.exec(`
|
|
21902
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
21903
|
+
path TEXT PRIMARY KEY,
|
|
21904
|
+
mtime_ms INTEGER NOT NULL,
|
|
21905
|
+
ctime_ms INTEGER NOT NULL,
|
|
21906
|
+
size INTEGER NOT NULL,
|
|
21907
|
+
content_hash TEXT NOT NULL,
|
|
21908
|
+
importer_version INTEGER NOT NULL,
|
|
21909
|
+
chunk_count INTEGER NOT NULL DEFAULT 0,
|
|
21910
|
+
last_imported_at TEXT NOT NULL,
|
|
21911
|
+
last_seen_at TEXT NOT NULL,
|
|
21912
|
+
status TEXT NOT NULL DEFAULT 'imported',
|
|
21913
|
+
error TEXT
|
|
21914
|
+
);
|
|
21915
|
+
|
|
21916
|
+
CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
|
|
21917
|
+
file_path TEXT NOT NULL,
|
|
21918
|
+
chunk_hash TEXT NOT NULL,
|
|
21919
|
+
chunk_index INTEGER NOT NULL,
|
|
21920
|
+
memory_id TEXT,
|
|
21921
|
+
source_id TEXT,
|
|
21922
|
+
created_at TEXT NOT NULL,
|
|
21923
|
+
PRIMARY KEY (file_path, chunk_hash)
|
|
21924
|
+
);
|
|
21925
|
+
|
|
21926
|
+
CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
|
|
21927
|
+
ON legacy_markdown_chunks(memory_id);
|
|
21928
|
+
`);
|
|
21929
|
+
}
|
|
21930
|
+
function up852(db) {
|
|
21931
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
21932
|
+
const tableNames = new Set(tables.map((r) => String(r.name)));
|
|
21933
|
+
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
21934
|
+
return;
|
|
21935
|
+
const relCols = db.prepare("PRAGMA table_info(relations)").all();
|
|
21936
|
+
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
21937
|
+
const rel = new Set(relCols.map((c) => String(c.name)));
|
|
21938
|
+
const dep = new Set(depCols.map((c) => String(c.name)));
|
|
21939
|
+
if (!rel.has("source_entity_id") || !rel.has("relation_type"))
|
|
21940
|
+
return;
|
|
21941
|
+
if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
|
|
21942
|
+
return;
|
|
21943
|
+
const hasRelConfidence = rel.has("confidence");
|
|
21944
|
+
const hasRelUpdated = rel.has("updated_at");
|
|
21945
|
+
const hasDepConfidence = dep.has("confidence");
|
|
21946
|
+
const hasDepReason = dep.has("reason");
|
|
21947
|
+
const hasDepStatus = dep.has("status");
|
|
21948
|
+
const selectParts = ["id", "source_entity_id", "target_entity_id"];
|
|
21949
|
+
const colParts = ["id", "source_entity_id", "target_entity_id"];
|
|
21950
|
+
selectParts.push("relation_type");
|
|
21951
|
+
colParts.push("dependency_type");
|
|
21952
|
+
selectParts.push("strength", "created_at");
|
|
21953
|
+
colParts.push("strength", "created_at");
|
|
21954
|
+
selectParts.push("'default'");
|
|
21955
|
+
colParts.push("agent_id");
|
|
21956
|
+
selectParts.push("NULL");
|
|
21957
|
+
colParts.push("aspect_id");
|
|
21958
|
+
if (hasRelConfidence && hasDepConfidence) {
|
|
21959
|
+
selectParts.push("confidence");
|
|
21960
|
+
colParts.push("confidence");
|
|
21961
|
+
}
|
|
21962
|
+
if (hasDepReason) {
|
|
21963
|
+
selectParts.push("'extracted'");
|
|
21964
|
+
colParts.push("reason");
|
|
21965
|
+
}
|
|
21966
|
+
if (hasDepStatus) {
|
|
21967
|
+
selectParts.push("'active'");
|
|
21968
|
+
colParts.push("status");
|
|
21969
|
+
}
|
|
21970
|
+
if (hasRelUpdated && dep.has("updated_at")) {
|
|
21971
|
+
selectParts.push("updated_at");
|
|
21972
|
+
colParts.push("updated_at");
|
|
21973
|
+
}
|
|
21974
|
+
const selectClause = selectParts.join(", ");
|
|
21975
|
+
const colsClause = colParts.join(", ");
|
|
21976
|
+
db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
|
|
21977
|
+
SELECT ${selectClause}
|
|
21978
|
+
FROM relations
|
|
21979
|
+
WHERE source_entity_id IS NOT NULL
|
|
21980
|
+
AND target_entity_id IS NOT NULL
|
|
21981
|
+
AND relation_type IS NOT NULL`);
|
|
21982
|
+
}
|
|
21983
|
+
function addColumnIfMissing212(db, table, column, definition) {
|
|
21984
|
+
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
21985
|
+
if (cols.some((col) => col.name === column))
|
|
21986
|
+
return;
|
|
21987
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
21988
|
+
}
|
|
21989
|
+
function up862(db) {
|
|
21990
|
+
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
21991
|
+
db.exec(`
|
|
21992
|
+
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
21993
|
+
ON summary_jobs(agent_id, session_key, content_hash)
|
|
21994
|
+
`);
|
|
21995
|
+
}
|
|
21780
21996
|
var MIGRATIONS2 = [
|
|
21781
21997
|
{
|
|
21782
21998
|
version: 1,
|
|
21783
21999
|
name: "baseline",
|
|
21784
|
-
up:
|
|
22000
|
+
up: up87,
|
|
21785
22001
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
21786
22002
|
},
|
|
21787
22003
|
{
|
|
@@ -21830,7 +22046,7 @@ var MIGRATIONS2 = [
|
|
|
21830
22046
|
{
|
|
21831
22047
|
version: 8,
|
|
21832
22048
|
name: "embeddings-unique-hash",
|
|
21833
|
-
up:
|
|
22049
|
+
up: up88
|
|
21834
22050
|
},
|
|
21835
22051
|
{
|
|
21836
22052
|
version: 9,
|
|
@@ -22456,6 +22672,30 @@ var MIGRATIONS2 = [
|
|
|
22456
22672
|
{ table: "memories", column: "superseded_reason" }
|
|
22457
22673
|
]
|
|
22458
22674
|
}
|
|
22675
|
+
},
|
|
22676
|
+
{
|
|
22677
|
+
version: 84,
|
|
22678
|
+
name: "legacy-markdown-import-state",
|
|
22679
|
+
up: up842,
|
|
22680
|
+
artifacts: {
|
|
22681
|
+
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
22682
|
+
}
|
|
22683
|
+
},
|
|
22684
|
+
{
|
|
22685
|
+
version: 85,
|
|
22686
|
+
name: "backfill-relations-to-dependencies",
|
|
22687
|
+
up: up852,
|
|
22688
|
+
artifacts: {
|
|
22689
|
+
tables: ["entity_dependencies"]
|
|
22690
|
+
}
|
|
22691
|
+
},
|
|
22692
|
+
{
|
|
22693
|
+
version: 86,
|
|
22694
|
+
name: "summary-jobs-content-hash",
|
|
22695
|
+
up: up862,
|
|
22696
|
+
artifacts: {
|
|
22697
|
+
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
22698
|
+
}
|
|
22459
22699
|
}
|
|
22460
22700
|
];
|
|
22461
22701
|
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-openclaw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.1",
|
|
4
4
|
"description": "Signet connector for OpenClaw - configures workspace and memory hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"test": "bun test"
|
|
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
|
"json5": "^2.2.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|