@signetai/connector-forge 0.197.7 → 0.197.9

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.
Files changed (2) hide show
  1. package/dist/index.js +121 -7
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -11193,6 +11193,58 @@ function up128(db) {
11193
11193
  AND error IS NOT NULL;
11194
11194
  `);
11195
11195
  }
11196
+ function tableExists3(db, table) {
11197
+ return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
11198
+ }
11199
+ function up129(db) {
11200
+ if (!tableExists3(db, "memory_jobs"))
11201
+ return;
11202
+ if (!tableExists3(db, "job_cancellations")) {
11203
+ throw new Error("job_cancellations table missing; cannot retire structural jobs without an audit trail");
11204
+ }
11205
+ db.prepare(`
11206
+ INSERT INTO job_cancellations (
11207
+ id, source_table, source_id, status_before, payload_json,
11208
+ reason, actor, actor_type, request_id, created_at
11209
+ )
11210
+ SELECT
11211
+ 'retire-structural-jobs-129:' || id,
11212
+ 'memory_jobs',
11213
+ id,
11214
+ status,
11215
+ json_object(
11216
+ 'id', id,
11217
+ 'memory_id', memory_id,
11218
+ 'document_id', document_id,
11219
+ 'job_type', job_type,
11220
+ 'status', status,
11221
+ 'payload', payload,
11222
+ 'result', result,
11223
+ 'attempts', attempts,
11224
+ 'max_attempts', max_attempts,
11225
+ 'leased_at', leased_at,
11226
+ 'completed_at', completed_at,
11227
+ 'failed_at', failed_at,
11228
+ 'error', error,
11229
+ 'created_at', created_at,
11230
+ 'updated_at', updated_at
11231
+ ),
11232
+ 'retired structural queue after Dreaming cutover',
11233
+ 'migration:129',
11234
+ 'system',
11235
+ NULL,
11236
+ strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
11237
+ FROM memory_jobs
11238
+ WHERE job_type IN ('structural_classify', 'structural_dependency')
11239
+ AND status IN ('pending', 'leased');
11240
+ `).run();
11241
+ db.exec(`
11242
+ UPDATE memory_jobs
11243
+ SET status = 'cancelled', updated_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
11244
+ WHERE job_type IN ('structural_classify', 'structural_dependency')
11245
+ AND status IN ('pending', 'leased');
11246
+ `);
11247
+ }
11196
11248
  var MIGRATIONS = [
11197
11249
  {
11198
11250
  version: 1,
@@ -12224,6 +12276,11 @@ var MIGRATIONS = [
12224
12276
  version: 128,
12225
12277
  name: "bounded-queue-diagnostics",
12226
12278
  up: up128
12279
+ },
12280
+ {
12281
+ version: 129,
12282
+ name: "retire-structural-jobs",
12283
+ up: up129
12227
12284
  }
12228
12285
  ];
12229
12286
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -19839,7 +19896,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
19839
19896
  return true;
19840
19897
  return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
19841
19898
  }
19842
- function up129(db) {
19899
+ function up130(db) {
19843
19900
  db.exec(`
19844
19901
  CREATE TABLE IF NOT EXISTS schema_migrations (
19845
19902
  version INTEGER PRIMARY KEY,
@@ -23074,7 +23131,7 @@ function up1032(db) {
23074
23131
  )
23075
23132
  `);
23076
23133
  }
23077
- function tableExists3(db, table) {
23134
+ function tableExists4(db, table) {
23078
23135
  return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) !== undefined;
23079
23136
  }
23080
23137
  function hasColumn162(db, table, column) {
@@ -23096,7 +23153,7 @@ function up1042(db) {
23096
23153
  CREATE INDEX IF NOT EXISTS idx_derived_memory_sources_source
23097
23154
  ON derived_memory_sources(agent_id, source_kind, source_id);
23098
23155
  `);
23099
- if (tableExists3(db, "aggregate_evidence_sources")) {
23156
+ if (tableExists4(db, "aggregate_evidence_sources")) {
23100
23157
  db.exec(`
23101
23158
  INSERT OR IGNORE INTO derived_memory_sources
23102
23159
  (derived_memory_id, source_kind, source_id, source_path, agent_id, created_at)
@@ -23104,7 +23161,7 @@ function up1042(db) {
23104
23161
  FROM aggregate_evidence_sources
23105
23162
  `);
23106
23163
  }
23107
- if (tableExists3(db, "aggregate_memory_sources")) {
23164
+ if (tableExists4(db, "aggregate_memory_sources")) {
23108
23165
  db.exec(`
23109
23166
  INSERT OR IGNORE INTO derived_memory_sources
23110
23167
  (derived_memory_id, source_kind, source_id, source_path, agent_id, created_at)
@@ -23112,10 +23169,10 @@ function up1042(db) {
23112
23169
  FROM aggregate_memory_sources
23113
23170
  `);
23114
23171
  }
23115
- if (tableExists3(db, "memories") && !hasColumn162(db, "memories", "stale_at")) {
23172
+ if (tableExists4(db, "memories") && !hasColumn162(db, "memories", "stale_at")) {
23116
23173
  db.exec("ALTER TABLE memories ADD COLUMN stale_at TEXT");
23117
23174
  }
23118
- if (tableExists3(db, "memories")) {
23175
+ if (tableExists4(db, "memories")) {
23119
23176
  db.exec(`
23120
23177
  CREATE INDEX IF NOT EXISTS idx_memories_stale_derived
23121
23178
  ON memories(agent_id, stale_at)
@@ -23957,11 +24014,63 @@ function up1282(db) {
23957
24014
  AND error IS NOT NULL;
23958
24015
  `);
23959
24016
  }
24017
+ function tableExists32(db, table) {
24018
+ return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
24019
+ }
24020
+ function up1292(db) {
24021
+ if (!tableExists32(db, "memory_jobs"))
24022
+ return;
24023
+ if (!tableExists32(db, "job_cancellations")) {
24024
+ throw new Error("job_cancellations table missing; cannot retire structural jobs without an audit trail");
24025
+ }
24026
+ db.prepare(`
24027
+ INSERT INTO job_cancellations (
24028
+ id, source_table, source_id, status_before, payload_json,
24029
+ reason, actor, actor_type, request_id, created_at
24030
+ )
24031
+ SELECT
24032
+ 'retire-structural-jobs-129:' || id,
24033
+ 'memory_jobs',
24034
+ id,
24035
+ status,
24036
+ json_object(
24037
+ 'id', id,
24038
+ 'memory_id', memory_id,
24039
+ 'document_id', document_id,
24040
+ 'job_type', job_type,
24041
+ 'status', status,
24042
+ 'payload', payload,
24043
+ 'result', result,
24044
+ 'attempts', attempts,
24045
+ 'max_attempts', max_attempts,
24046
+ 'leased_at', leased_at,
24047
+ 'completed_at', completed_at,
24048
+ 'failed_at', failed_at,
24049
+ 'error', error,
24050
+ 'created_at', created_at,
24051
+ 'updated_at', updated_at
24052
+ ),
24053
+ 'retired structural queue after Dreaming cutover',
24054
+ 'migration:129',
24055
+ 'system',
24056
+ NULL,
24057
+ strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
24058
+ FROM memory_jobs
24059
+ WHERE job_type IN ('structural_classify', 'structural_dependency')
24060
+ AND status IN ('pending', 'leased');
24061
+ `).run();
24062
+ db.exec(`
24063
+ UPDATE memory_jobs
24064
+ SET status = 'cancelled', updated_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
24065
+ WHERE job_type IN ('structural_classify', 'structural_dependency')
24066
+ AND status IN ('pending', 'leased');
24067
+ `);
24068
+ }
23960
24069
  var MIGRATIONS2 = [
23961
24070
  {
23962
24071
  version: 1,
23963
24072
  name: "baseline",
23964
- up: up129,
24073
+ up: up130,
23965
24074
  artifacts: { tables: ["memories", "conversations", "embeddings"] }
23966
24075
  },
23967
24076
  {
@@ -24988,6 +25097,11 @@ var MIGRATIONS2 = [
24988
25097
  version: 128,
24989
25098
  name: "bounded-queue-diagnostics",
24990
25099
  up: up1282
25100
+ },
25101
+ {
25102
+ version: 129,
25103
+ name: "retire-structural-jobs",
25104
+ up: up1292
24991
25105
  }
24992
25106
  ];
24993
25107
  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.197.7",
3
+ "version": "0.197.9",
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.197.7",
28
- "@signetai/core": "0.197.7"
27
+ "@signetai/connector-base": "0.197.9",
28
+ "@signetai/core": "0.197.9"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",