@signetai/connector-base 0.214.4 → 0.214.7

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 +51 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -16139,6 +16139,41 @@ function up142(db) {
16139
16139
  db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
16140
16140
  }
16141
16141
  }
16142
+ function up143(db) {
16143
+ const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
16144
+ const additions = [
16145
+ ["migration_phase", "TEXT"],
16146
+ ["progress_staged", "INTEGER NOT NULL DEFAULT 0"],
16147
+ ["progress_total", "INTEGER NOT NULL DEFAULT 0"],
16148
+ ["projection_cursor_last_id", "TEXT"],
16149
+ ["projection_cursor_slot", "TEXT"],
16150
+ ["no_progress_ticks", "INTEGER NOT NULL DEFAULT 0"],
16151
+ ["provider_endpoint", "TEXT"]
16152
+ ];
16153
+ for (const [name, definition] of additions) {
16154
+ if (!columns.has(name))
16155
+ db.exec(`ALTER TABLE embedding_index_state ADD COLUMN ${name} ${definition}`);
16156
+ }
16157
+ db.exec(`
16158
+ UPDATE embedding_index_state
16159
+ SET provider_endpoint = COALESCE(
16160
+ provider_endpoint,
16161
+ json_extract(active_profile_json, '$.baseUrl')
16162
+ )
16163
+ WHERE id = 1
16164
+ `);
16165
+ const hasEmbeddings = db.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'embeddings'").get() != null;
16166
+ const hasStaging = db.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'embeddings_staging'").get() != null;
16167
+ if (hasEmbeddings && hasStaging) {
16168
+ db.exec(`
16169
+ UPDATE embedding_index_state
16170
+ SET migration_phase = COALESCE(migration_phase, CASE WHEN state = 'building' THEN 'staging' END),
16171
+ progress_staged = CASE WHEN state = 'building' THEN (SELECT COUNT(*) FROM embeddings_staging) ELSE progress_staged END,
16172
+ progress_total = CASE WHEN state = 'building' THEN (SELECT COUNT(*) FROM embeddings) ELSE progress_total END
16173
+ WHERE state = 'building'
16174
+ `);
16175
+ }
16176
+ }
16142
16177
  var MIGRATIONS = [
16143
16178
  {
16144
16179
  version: 1,
@@ -17260,6 +17295,22 @@ var MIGRATIONS = [
17260
17295
  name: "source-sync-frontier",
17261
17296
  up: up142,
17262
17297
  artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
17298
+ },
17299
+ {
17300
+ version: 143,
17301
+ name: "embedding-index-progress",
17302
+ up: up143,
17303
+ artifacts: {
17304
+ columns: [
17305
+ { table: "embedding_index_state", column: "migration_phase" },
17306
+ { table: "embedding_index_state", column: "progress_staged" },
17307
+ { table: "embedding_index_state", column: "progress_total" },
17308
+ { table: "embedding_index_state", column: "projection_cursor_last_id" },
17309
+ { table: "embedding_index_state", column: "projection_cursor_slot" },
17310
+ { table: "embedding_index_state", column: "no_progress_ticks" },
17311
+ { table: "embedding_index_state", column: "provider_endpoint" }
17312
+ ]
17313
+ }
17263
17314
  }
17264
17315
  ];
17265
17316
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-base",
3
- "version": "0.214.4",
3
+ "version": "0.214.7",
4
4
  "description": "Base class for Signet harness connectors",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsc --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@signetai/core": "0.214.4",
29
+ "@signetai/core": "0.214.7",
30
30
  "json5": "^2.2.3",
31
31
  "jsonc-parser": "3.3.1"
32
32
  },