signetai 0.146.4 → 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/mcp-stdio.js CHANGED
@@ -38118,6 +38118,251 @@ function up82(db) {
38118
38118
  `);
38119
38119
  db.exec("CREATE INDEX IF NOT EXISTS idx_skill_inv_harness ON skill_invocations(harness, created_at)");
38120
38120
  }
38121
+ var DEPENDENCY_TYPES = new Set([
38122
+ "uses",
38123
+ "requires",
38124
+ "owned_by",
38125
+ "owns",
38126
+ "blocks",
38127
+ "informs",
38128
+ "maintains",
38129
+ "implements",
38130
+ "built",
38131
+ "depends_on",
38132
+ "related_to",
38133
+ "learned_from",
38134
+ "teaches",
38135
+ "knows",
38136
+ "assumes",
38137
+ "supports_claim",
38138
+ "authored_by",
38139
+ "links_to",
38140
+ "contains",
38141
+ "contains_note",
38142
+ "contradicts",
38143
+ "supersedes",
38144
+ "part_of",
38145
+ "produced_artifact",
38146
+ "precedes",
38147
+ "follows",
38148
+ "triggers",
38149
+ "may_execute",
38150
+ "requires_approval_from",
38151
+ "impacts",
38152
+ "produces",
38153
+ "consumes"
38154
+ ]);
38155
+ function sqlStringList(values) {
38156
+ return [...values].map((value) => `'${value}'`).join(", ");
38157
+ }
38158
+ function hasTable3(db, table) {
38159
+ return Boolean(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(table));
38160
+ }
38161
+ function hasColumn12(db, table, column) {
38162
+ const rows = db.prepare(`PRAGMA table_info(${table})`).all();
38163
+ return rows.some((row) => row.name === column);
38164
+ }
38165
+ function addColumnIfMissing20(db, table, column, definition) {
38166
+ if (!hasColumn12(db, table, column))
38167
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
38168
+ }
38169
+ function documentScopeColumnsPreservingExisting(db) {
38170
+ const preserveAgentId = hasColumn12(db, "documents", "agent_id");
38171
+ const preserveProject = hasColumn12(db, "documents", "project");
38172
+ if (preserveAgentId) {
38173
+ db.exec(`
38174
+ CREATE TEMP TABLE __signet_doc_agent_guard AS
38175
+ SELECT id, agent_id FROM documents
38176
+ WHERE NULLIF(TRIM(agent_id), '') IS NOT NULL
38177
+ AND NULLIF(TRIM(agent_id), '') <> 'default'
38178
+ `);
38179
+ }
38180
+ if (preserveProject) {
38181
+ db.exec(`
38182
+ CREATE TEMP TABLE __signet_doc_project_guard AS
38183
+ SELECT id, project FROM documents
38184
+ WHERE NULLIF(TRIM(project), '') IS NOT NULL
38185
+ `);
38186
+ }
38187
+ try {
38188
+ up80(db);
38189
+ if (preserveAgentId) {
38190
+ db.exec(`
38191
+ UPDATE documents
38192
+ SET agent_id = (SELECT agent_id FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
38193
+ WHERE EXISTS (SELECT 1 FROM __signet_doc_agent_guard WHERE __signet_doc_agent_guard.id = documents.id)
38194
+ `);
38195
+ }
38196
+ if (preserveProject) {
38197
+ db.exec(`
38198
+ UPDATE documents
38199
+ SET project = (SELECT project FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
38200
+ WHERE EXISTS (SELECT 1 FROM __signet_doc_project_guard WHERE __signet_doc_project_guard.id = documents.id)
38201
+ `);
38202
+ }
38203
+ } finally {
38204
+ db.exec("DROP TABLE IF EXISTS temp.__signet_doc_agent_guard");
38205
+ db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
38206
+ }
38207
+ }
38208
+ function up83(db) {
38209
+ up79(db);
38210
+ if (hasTable3(db, "documents")) {
38211
+ documentScopeColumnsPreservingExisting(db);
38212
+ }
38213
+ up81(db);
38214
+ addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
38215
+ addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
38216
+ addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
38217
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
38218
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
38219
+ if (!hasTable3(db, "relations") || !hasTable3(db, "entity_dependencies"))
38220
+ return;
38221
+ addColumnIfMissing20(db, "entity_dependencies", "confidence", "REAL");
38222
+ addColumnIfMissing20(db, "entity_dependencies", "reason", "TEXT");
38223
+ addColumnIfMissing20(db, "entity_dependencies", "source_id", "TEXT");
38224
+ addColumnIfMissing20(db, "entity_dependencies", "source_kind", "TEXT");
38225
+ addColumnIfMissing20(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
38226
+ addColumnIfMissing20(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
38227
+ const relationConfidence = hasColumn12(db, "relations", "confidence") ? "r.confidence" : "NULL";
38228
+ const relationUpdatedAt = hasColumn12(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
38229
+ const sourceAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
38230
+ const targetAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(dst.agent_id), ''), 'default')" : "'default'";
38231
+ db.exec(`
38232
+ INSERT OR IGNORE INTO entity_dependencies (
38233
+ id,
38234
+ source_entity_id,
38235
+ target_entity_id,
38236
+ agent_id,
38237
+ dependency_type,
38238
+ strength,
38239
+ confidence,
38240
+ reason,
38241
+ created_at,
38242
+ updated_at,
38243
+ source_id,
38244
+ source_kind,
38245
+ proposal_evidence,
38246
+ status
38247
+ )
38248
+ SELECT
38249
+ 'relation:' || r.id,
38250
+ r.source_entity_id,
38251
+ r.target_entity_id,
38252
+ COALESCE(${sourceAgentId}, ${targetAgentId}, 'default'),
38253
+ CASE WHEN r.relation_type IN (${sqlStringList(DEPENDENCY_TYPES)}) THEN r.relation_type ELSE 'related_to' END,
38254
+ MAX(0.1, MIN(1.0, COALESCE(r.strength, 0.5))),
38255
+ MAX(0.1, MIN(1.0, COALESCE(${relationConfidence}, 0.7))),
38256
+ 'legacy relation backfill: ' || r.relation_type,
38257
+ COALESCE(r.created_at, datetime('now')),
38258
+ COALESCE(${relationUpdatedAt}, r.created_at, datetime('now')),
38259
+ r.id,
38260
+ 'relation',
38261
+ '[]',
38262
+ 'active'
38263
+ FROM relations r
38264
+ JOIN entities src ON src.id = r.source_entity_id
38265
+ JOIN entities dst ON dst.id = r.target_entity_id
38266
+ WHERE r.source_entity_id <> r.target_entity_id
38267
+ AND ${sourceAgentId} = ${targetAgentId}
38268
+ `);
38269
+ }
38270
+ function up84(db) {
38271
+ db.exec(`
38272
+ CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
38273
+ path TEXT PRIMARY KEY,
38274
+ mtime_ms INTEGER NOT NULL,
38275
+ ctime_ms INTEGER NOT NULL,
38276
+ size INTEGER NOT NULL,
38277
+ content_hash TEXT NOT NULL,
38278
+ importer_version INTEGER NOT NULL,
38279
+ chunk_count INTEGER NOT NULL DEFAULT 0,
38280
+ last_imported_at TEXT NOT NULL,
38281
+ last_seen_at TEXT NOT NULL,
38282
+ status TEXT NOT NULL DEFAULT 'imported',
38283
+ error TEXT
38284
+ );
38285
+
38286
+ CREATE TABLE IF NOT EXISTS legacy_markdown_chunks (
38287
+ file_path TEXT NOT NULL,
38288
+ chunk_hash TEXT NOT NULL,
38289
+ chunk_index INTEGER NOT NULL,
38290
+ memory_id TEXT,
38291
+ source_id TEXT,
38292
+ created_at TEXT NOT NULL,
38293
+ PRIMARY KEY (file_path, chunk_hash)
38294
+ );
38295
+
38296
+ CREATE INDEX IF NOT EXISTS idx_legacy_markdown_chunks_memory_id
38297
+ ON legacy_markdown_chunks(memory_id);
38298
+ `);
38299
+ }
38300
+ function up85(db) {
38301
+ const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
38302
+ const tableNames = new Set(tables.map((r) => String(r.name)));
38303
+ if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
38304
+ return;
38305
+ const relCols = db.prepare("PRAGMA table_info(relations)").all();
38306
+ const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
38307
+ const rel = new Set(relCols.map((c) => String(c.name)));
38308
+ const dep = new Set(depCols.map((c) => String(c.name)));
38309
+ if (!rel.has("source_entity_id") || !rel.has("relation_type"))
38310
+ return;
38311
+ if (!dep.has("source_entity_id") || !dep.has("dependency_type") || !dep.has("agent_id"))
38312
+ return;
38313
+ const hasRelConfidence = rel.has("confidence");
38314
+ const hasRelUpdated = rel.has("updated_at");
38315
+ const hasDepConfidence = dep.has("confidence");
38316
+ const hasDepReason = dep.has("reason");
38317
+ const hasDepStatus = dep.has("status");
38318
+ const selectParts = ["id", "source_entity_id", "target_entity_id"];
38319
+ const colParts = ["id", "source_entity_id", "target_entity_id"];
38320
+ selectParts.push("relation_type");
38321
+ colParts.push("dependency_type");
38322
+ selectParts.push("strength", "created_at");
38323
+ colParts.push("strength", "created_at");
38324
+ selectParts.push("'default'");
38325
+ colParts.push("agent_id");
38326
+ selectParts.push("NULL");
38327
+ colParts.push("aspect_id");
38328
+ if (hasRelConfidence && hasDepConfidence) {
38329
+ selectParts.push("confidence");
38330
+ colParts.push("confidence");
38331
+ }
38332
+ if (hasDepReason) {
38333
+ selectParts.push("'extracted'");
38334
+ colParts.push("reason");
38335
+ }
38336
+ if (hasDepStatus) {
38337
+ selectParts.push("'active'");
38338
+ colParts.push("status");
38339
+ }
38340
+ if (hasRelUpdated && dep.has("updated_at")) {
38341
+ selectParts.push("updated_at");
38342
+ colParts.push("updated_at");
38343
+ }
38344
+ const selectClause = selectParts.join(", ");
38345
+ const colsClause = colParts.join(", ");
38346
+ db.exec(`INSERT OR IGNORE INTO entity_dependencies (${colsClause})
38347
+ SELECT ${selectClause}
38348
+ FROM relations
38349
+ WHERE source_entity_id IS NOT NULL
38350
+ AND target_entity_id IS NOT NULL
38351
+ AND relation_type IS NOT NULL`);
38352
+ }
38353
+ function addColumnIfMissing21(db, table, column, definition) {
38354
+ const cols = db.prepare(`PRAGMA table_info(${table})`).all();
38355
+ if (cols.some((col) => col.name === column))
38356
+ return;
38357
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
38358
+ }
38359
+ function up86(db) {
38360
+ addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
38361
+ db.exec(`
38362
+ CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
38363
+ ON summary_jobs(agent_id, session_key, content_hash)
38364
+ `);
38365
+ }
38121
38366
  var MIGRATIONS = [
38122
38367
  {
38123
38368
  version: 1,
@@ -38782,6 +39027,45 @@ var MIGRATIONS = [
38782
39027
  { table: "skill_invocations", column: "tool_use_id" }
38783
39028
  ]
38784
39029
  }
39030
+ },
39031
+ {
39032
+ version: 83,
39033
+ name: "memory-lifecycle-repair",
39034
+ up: up83,
39035
+ artifacts: {
39036
+ tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
39037
+ columns: [
39038
+ { table: "documents", column: "agent_id" },
39039
+ { table: "documents", column: "project" },
39040
+ { table: "memories", column: "superseded_by" },
39041
+ { table: "memories", column: "superseded_at" },
39042
+ { table: "memories", column: "superseded_reason" }
39043
+ ]
39044
+ }
39045
+ },
39046
+ {
39047
+ version: 84,
39048
+ name: "legacy-markdown-import-state",
39049
+ up: up84,
39050
+ artifacts: {
39051
+ tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
39052
+ }
39053
+ },
39054
+ {
39055
+ version: 85,
39056
+ name: "backfill-relations-to-dependencies",
39057
+ up: up85,
39058
+ artifacts: {
39059
+ tables: ["entity_dependencies"]
39060
+ }
39061
+ },
39062
+ {
39063
+ version: 86,
39064
+ name: "summary-jobs-content-hash",
39065
+ up: up86,
39066
+ artifacts: {
39067
+ columns: [{ table: "summary_jobs", column: "content_hash" }]
39068
+ }
38785
39069
  }
38786
39070
  ];
38787
39071
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -1,42 +1,42 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.146.4",
3
+ "version": "0.147.0",
4
4
  "assets": [
5
5
  {
6
6
  "name": "signet-darwin-arm64",
7
7
  "platform": "darwin-arm64",
8
- "sha256": "6642211291b22bbdc6e4fd8a593ddb81d57bbd1ef7402226be22e0d90a0159f1",
9
- "size": 126720928
8
+ "sha256": "74bfcb4440042e03c8edad70dd08fa7c29bb26ac4bca266ba47a231e7e03abc9",
9
+ "size": 126985120
10
10
  },
11
11
  {
12
12
  "name": "signet-darwin-x64",
13
13
  "platform": "darwin-x64",
14
- "sha256": "d2d15a6d15f9014389c674eb5c8da66af4c7ef7316f659b59ed1865b9a147dae",
15
- "size": 131271232
14
+ "sha256": "79570dddf14eb288ed1e5280f2d193e4ad8f8b837aa96eee14fd2ffbfcc8e617",
15
+ "size": 131533376
16
16
  },
17
17
  {
18
18
  "name": "signet-linux-arm64",
19
19
  "platform": "linux-arm64",
20
- "sha256": "8beaa3989231aa5664d5bc28e4d1a707dd8bc593148285b59ad51025ae870149",
21
- "size": 164039158
20
+ "sha256": "fd5b630977cc63fe305f1daf9b9c654a8be4f653b5ade0d3525d002daeabb6dc",
21
+ "size": 164303849
22
22
  },
23
23
  {
24
24
  "name": "signet-linux-x64",
25
25
  "platform": "linux-x64",
26
- "sha256": "10f2d70ea8c36554b00437e4edbb21b335fe3483b5226602bdaed4ff8c46720f",
27
- "size": 164552816
26
+ "sha256": "101b5aae80b408c72688a256e1718430703e8b2a9e91027aefcacda2ae795002",
27
+ "size": 164817503
28
28
  },
29
29
  {
30
30
  "name": "signet-win32-x64.exe",
31
31
  "platform": "win32-x64",
32
- "sha256": "e16c68741d16f767f5a3406f2d4f3ef1a9f3de5c67c50208b7d9a6b4c9523f80",
33
- "size": 180617728
32
+ "sha256": "b511c7de24b094de51117ac838d066bbfaa433ee774f1e952907c21f6b75e1c9",
33
+ "size": 180882432
34
34
  }
35
35
  ],
36
36
  "components": {
37
37
  "connectors": {
38
- "url": "signet-connectors-0.146.4.tar.gz",
39
- "sha256": "645c87a699142def9b26fcb41951cf686b32d0897d6668b420b9d01674edc75d",
38
+ "url": "signet-connectors-0.147.0.tar.gz",
39
+ "sha256": "0dce0c56cb892eb1385987c03eb1a4fcf0aff69e0cdc0849d364fb2df5a675a0",
40
40
  "size": 15378
41
41
  }
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signetai",
3
- "version": "0.146.4",
3
+ "version": "0.147.0",
4
4
  "description": "Signet native CLI installer wrapper",
5
5
  "type": "module",
6
6
  "bin": {
@@ -65,10 +65,10 @@
65
65
  "access": "public"
66
66
  },
67
67
  "optionalDependencies": {
68
- "signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.146.4/signetai-darwin-arm64-0.146.4.tgz",
69
- "signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.146.4/signetai-darwin-x64-0.146.4.tgz",
70
- "signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.146.4/signetai-linux-arm64-0.146.4.tgz",
71
- "signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.146.4/signetai-linux-x64-0.146.4.tgz",
72
- "signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.146.4/signetai-win32-x64-0.146.4.tgz"
68
+ "signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.147.0/signetai-darwin-arm64-0.147.0.tgz",
69
+ "signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.147.0/signetai-darwin-x64-0.147.0.tgz",
70
+ "signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.147.0/signetai-linux-arm64-0.147.0.tgz",
71
+ "signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.147.0/signetai-linux-x64-0.147.0.tgz",
72
+ "signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.147.0/signetai-win32-x64-0.147.0.tgz"
73
73
  }
74
74
  }