@signetai/core 0.214.5 → 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.
package/dist/index.js
CHANGED
|
@@ -16803,6 +16803,43 @@ function up142(db) {
|
|
|
16803
16803
|
}
|
|
16804
16804
|
}
|
|
16805
16805
|
|
|
16806
|
+
// src/migrations/143-embedding-index-progress.ts
|
|
16807
|
+
function up143(db) {
|
|
16808
|
+
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16809
|
+
const additions = [
|
|
16810
|
+
["migration_phase", "TEXT"],
|
|
16811
|
+
["progress_staged", "INTEGER NOT NULL DEFAULT 0"],
|
|
16812
|
+
["progress_total", "INTEGER NOT NULL DEFAULT 0"],
|
|
16813
|
+
["projection_cursor_last_id", "TEXT"],
|
|
16814
|
+
["projection_cursor_slot", "TEXT"],
|
|
16815
|
+
["no_progress_ticks", "INTEGER NOT NULL DEFAULT 0"],
|
|
16816
|
+
["provider_endpoint", "TEXT"]
|
|
16817
|
+
];
|
|
16818
|
+
for (const [name, definition] of additions) {
|
|
16819
|
+
if (!columns.has(name))
|
|
16820
|
+
db.exec(`ALTER TABLE embedding_index_state ADD COLUMN ${name} ${definition}`);
|
|
16821
|
+
}
|
|
16822
|
+
db.exec(`
|
|
16823
|
+
UPDATE embedding_index_state
|
|
16824
|
+
SET provider_endpoint = COALESCE(
|
|
16825
|
+
provider_endpoint,
|
|
16826
|
+
json_extract(active_profile_json, '$.baseUrl')
|
|
16827
|
+
)
|
|
16828
|
+
WHERE id = 1
|
|
16829
|
+
`);
|
|
16830
|
+
const hasEmbeddings = db.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'embeddings'").get() != null;
|
|
16831
|
+
const hasStaging = db.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'embeddings_staging'").get() != null;
|
|
16832
|
+
if (hasEmbeddings && hasStaging) {
|
|
16833
|
+
db.exec(`
|
|
16834
|
+
UPDATE embedding_index_state
|
|
16835
|
+
SET migration_phase = COALESCE(migration_phase, CASE WHEN state = 'building' THEN 'staging' END),
|
|
16836
|
+
progress_staged = CASE WHEN state = 'building' THEN (SELECT COUNT(*) FROM embeddings_staging) ELSE progress_staged END,
|
|
16837
|
+
progress_total = CASE WHEN state = 'building' THEN (SELECT COUNT(*) FROM embeddings) ELSE progress_total END
|
|
16838
|
+
WHERE state = 'building'
|
|
16839
|
+
`);
|
|
16840
|
+
}
|
|
16841
|
+
}
|
|
16842
|
+
|
|
16806
16843
|
// src/migrations/index.ts
|
|
16807
16844
|
var MIGRATIONS = [
|
|
16808
16845
|
{
|
|
@@ -17925,6 +17962,22 @@ var MIGRATIONS = [
|
|
|
17925
17962
|
name: "source-sync-frontier",
|
|
17926
17963
|
up: up142,
|
|
17927
17964
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
17965
|
+
},
|
|
17966
|
+
{
|
|
17967
|
+
version: 143,
|
|
17968
|
+
name: "embedding-index-progress",
|
|
17969
|
+
up: up143,
|
|
17970
|
+
artifacts: {
|
|
17971
|
+
columns: [
|
|
17972
|
+
{ table: "embedding_index_state", column: "migration_phase" },
|
|
17973
|
+
{ table: "embedding_index_state", column: "progress_staged" },
|
|
17974
|
+
{ table: "embedding_index_state", column: "progress_total" },
|
|
17975
|
+
{ table: "embedding_index_state", column: "projection_cursor_last_id" },
|
|
17976
|
+
{ table: "embedding_index_state", column: "projection_cursor_slot" },
|
|
17977
|
+
{ table: "embedding_index_state", column: "no_progress_ticks" },
|
|
17978
|
+
{ table: "embedding_index_state", column: "provider_endpoint" }
|
|
17979
|
+
]
|
|
17980
|
+
}
|
|
17928
17981
|
}
|
|
17929
17982
|
];
|
|
17930
17983
|
function checksum(m) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MigrationDb } from "./index";
|
|
2
|
+
/**
|
|
3
|
+
* Durable visibility and projection cursor for the killable embedding owner.
|
|
4
|
+
* The column checks keep this safe for partially repaired v91 databases.
|
|
5
|
+
*/
|
|
6
|
+
export declare function up(db: MigrationDb): void;
|
|
7
|
+
//# sourceMappingURL=143-embedding-index-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"143-embedding-index-progress.d.ts","sourceRoot":"","sources":["../../src/migrations/143-embedding-index-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAiDxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoJH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QACrB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC9B,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;QAC7D,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;KACnD,CAAC;CACF;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS;QAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QA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