@hot-updater/cloudflare 1.0.0-rc.45 → 1.0.0-rc.47

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/cloudflare",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.45",
4
+ "version": "1.0.0-rc.47",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -21,8 +21,6 @@
21
21
  "require": "./dist/worker/index.cjs",
22
22
  "default": "./dist/worker/index.mjs"
23
23
  },
24
- "./worker/config": "./worker/wrangler.json",
25
- "./worker/wrangler.json": "./worker/wrangler.json",
26
24
  "./package.json": "./package.json"
27
25
  },
28
26
  "license": "MIT",
@@ -57,10 +55,10 @@
57
55
  "cloudflare": "4.2.0",
58
56
  "hono": "4.12.34",
59
57
  "uuidv7": "^1.0.2",
60
- "@hot-updater/cli-tools": "1.0.0-rc.45",
61
- "@hot-updater/plugin-core": "1.0.0-rc.45",
62
- "@hot-updater/protocol": "1.0.0-rc.45",
63
- "@hot-updater/server": "1.0.0-rc.45"
58
+ "@hot-updater/protocol": "1.0.0-rc.47",
59
+ "@hot-updater/cli-tools": "1.0.0-rc.47",
60
+ "@hot-updater/plugin-core": "1.0.0-rc.47",
61
+ "@hot-updater/server": "1.0.0-rc.47"
64
62
  },
65
63
  "devDependencies": {
66
64
  "@cloudflare/vitest-pool-workers": "0.13.0",
@@ -76,7 +74,7 @@
76
74
  "vitest": "4.1.4",
77
75
  "wrangler": "^4.69.0",
78
76
  "xdg-app-paths": "^8.3.0",
79
- "@hot-updater/test-utils": "1.0.0-rc.45"
77
+ "@hot-updater/test-utils": "1.0.0-rc.47"
80
78
  },
81
79
  "scripts": {
82
80
  "build": "tsdown && pnpm build:worker",
@@ -20,10 +20,6 @@ export type D1Like = {
20
20
  batch(statements: D1BoundStatement[]): Promise<readonly D1ResultLike[]>;
21
21
  };
22
22
 
23
- export interface CloudflareWorkerDatabaseEnv {
24
- readonly DB: D1Like;
25
- }
26
-
27
23
  /** Hot Updater's database on a D1 binding, inside a Worker. */
28
24
  export const d1Database = (database: D1Like): EngineDatabase =>
29
25
  createD1Database({
@@ -1 +1 @@
1
- This folder contains the built output assets for the worker "hot-updater" generated at 2026-10-10T04:34:58.260Z.
1
+ This folder contains the built output assets for the worker "hot-updater" generated at 2026-10-10T23:06:42.511Z.
@@ -207,6 +207,13 @@ var isDatabaseJsonValue = /* @__PURE__ */ __name((value) => {
207
207
  var isDatabaseJsonObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value) && isDatabaseJsonValue(value), "isDatabaseJsonObject");
208
208
  var isDatabaseMetadataObject = /* @__PURE__ */ __name((value) => isDatabaseJsonObject(value) && (!Object.hasOwn(value, "app_version") || typeof value["app_version"] === "string"), "isDatabaseMetadataObject");
209
209
 
210
+ // ../plugin-core/dist/databaseMetadata.mjs
211
+ var bundleMetadataToRow = /* @__PURE__ */ __name((metadata) => {
212
+ if (metadata === void 0) return {};
213
+ if (!isDatabaseMetadataObject(metadata)) throw new DatabaseAdapterInputError("invalid-data");
214
+ return metadata;
215
+ }, "bundleMetadataToRow");
216
+
210
217
  // ../../packages/protocol/dist/index.mjs
211
218
  var LETTER_DASH_NUMBER = "[a-zA-Z0-9-]";
212
219
  var NUMERIC_IDENTIFIER = String.raw`0|[1-9]\d*`;
@@ -323,7 +330,6 @@ function canonicalizeAppVersion(appVersion) {
323
330
  return version2 ? normalizeFull(version2) : null;
324
331
  }
325
332
  __name(canonicalizeAppVersion, "canonicalizeAppVersion");
326
- var stripBundleArtifactMetadata = /* @__PURE__ */ __name((metadata) => metadata, "stripBundleArtifactMetadata");
327
333
  var getManifestStorageUri = /* @__PURE__ */ __name((bundle) => bundle.manifestStorageUri, "getManifestStorageUri");
328
334
  var getManifestFileHash = /* @__PURE__ */ __name((bundle) => bundle.manifestFileHash, "getManifestFileHash");
329
335
  var getAssetBaseStorageUri = /* @__PURE__ */ __name((bundle) => bundle.assetBaseStorageUri, "getAssetBaseStorageUri");
@@ -599,14 +605,6 @@ var UUID_V7_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[
599
605
  var isUUIDv7 = /* @__PURE__ */ __name((value) => typeof value === "string" && UUID_V7_PATTERN.test(value), "isUUIDv7");
600
606
  var ARTIFACT_PROTOCOL_VERSION = 1;
601
607
 
602
- // ../plugin-core/dist/databaseMetadata.mjs
603
- var bundleMetadataToRow = /* @__PURE__ */ __name((metadata) => {
604
- const value = stripBundleArtifactMetadata(metadata);
605
- if (value === void 0) return {};
606
- if (!isDatabaseMetadataObject(value)) throw new DatabaseAdapterInputError("invalid-data");
607
- return value;
608
- }, "bundleMetadataToRow");
609
-
610
608
  // ../plugin-core/dist/databaseRows.mjs
611
609
  var releaseRowToRelease = /* @__PURE__ */ __name((row) => ({
612
610
  id: row.id,
@@ -664,7 +662,7 @@ var rowToBundle = /* @__PURE__ */ __name((row, patchRows = []) => {
664
662
  id: row.id,
665
663
  platform: row.platform,
666
664
  gitCommitHash: row.git_commit_hash,
667
- metadata: stripBundleArtifactMetadata(row.metadata),
665
+ metadata: row.metadata,
668
666
  manifestStorageUri: row.manifest_storage_uri,
669
667
  manifestFileHash: row.manifest_file_hash,
670
668
  assetBaseStorageUri: row.asset_base_storage_uri,
@@ -672,6 +670,36 @@ var rowToBundle = /* @__PURE__ */ __name((row, patchRows = []) => {
672
670
  };
673
671
  }, "rowToBundle");
674
672
 
673
+ // ../plugin-core/dist/uuidv7.mjs
674
+ var extractTimestampFromUUIDv7 = /* @__PURE__ */ __name((uuid) => {
675
+ if (!isUUIDv7(uuid)) throw new TypeError("Expected a canonical lowercase UUIDv7");
676
+ const timestampHex = uuid.split("-").join("").slice(0, 12);
677
+ return Number.parseInt(timestampHex, 16);
678
+ }, "extractTimestampFromUUIDv7");
679
+ function createUUIDv7FromTimestampHex(timestampHex) {
680
+ const randomBytes = /* @__PURE__ */ new Uint8Array(10);
681
+ crypto.getRandomValues(randomBytes);
682
+ const randomHex = Array.from(randomBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
683
+ const randA = randomHex.slice(0, 3);
684
+ const randBHex = randomHex.slice(3, 19);
685
+ const versionAndRandA = `7${randA}`;
686
+ const variantAndFirstRandB = (128 | parseInt(randBHex.slice(0, 2), 16) & 63).toString(16).padStart(2, "0");
687
+ return [
688
+ timestampHex.slice(0, 8),
689
+ timestampHex.slice(8, 12),
690
+ versionAndRandA,
691
+ variantAndFirstRandB + randBHex.slice(2, 4),
692
+ randBHex.slice(4, 16)
693
+ ].join("-");
694
+ }
695
+ __name(createUUIDv7FromTimestampHex, "createUUIDv7FromTimestampHex");
696
+ var createUUIDv7 = /* @__PURE__ */ __name(() => createUUIDv7FromTimestampHex(Date.now().toString(16).padStart(12, "0")), "createUUIDv7");
697
+ var createUUIDv7After = /* @__PURE__ */ __name((floor, nowMs = Date.now()) => {
698
+ const timestamp = Math.max(nowMs, floor === null ? 0 : extractTimestampFromUUIDv7(floor) + 1);
699
+ if (!Number.isSafeInteger(timestamp) || timestamp < 0 || timestamp >= 2 ** 48) throw new RangeError("UUIDv7 timestamp is out of range");
700
+ return createUUIDv7FromTimestampHex(timestamp.toString(16).padStart(12, "0"));
701
+ }, "createUUIDv7After");
702
+
675
703
  // ../plugin-core/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.mjs
676
704
  var LETTER_DASH_NUMBER2 = "[a-zA-Z0-9-]";
677
705
  var NUMERIC_IDENTIFIER2 = String.raw`0|[1-9]\d*`;
@@ -1063,43 +1091,6 @@ function coerce2(value, options = {}) {
1063
1091
  }
1064
1092
  __name(coerce2, "coerce");
1065
1093
 
1066
- // ../plugin-core/dist/semverSatisfies.mjs
1067
- var semverSatisfies = /* @__PURE__ */ __name((targetAppVersion, currentVersion) => {
1068
- const currentCoerce = coerce2(currentVersion);
1069
- if (!currentCoerce) return false;
1070
- return satisfies(currentCoerce, targetAppVersion);
1071
- }, "semverSatisfies");
1072
-
1073
- // ../plugin-core/dist/uuidv7.mjs
1074
- var extractTimestampFromUUIDv7 = /* @__PURE__ */ __name((uuid) => {
1075
- if (!isUUIDv7(uuid)) throw new TypeError("Expected a canonical lowercase UUIDv7");
1076
- const timestampHex = uuid.split("-").join("").slice(0, 12);
1077
- return Number.parseInt(timestampHex, 16);
1078
- }, "extractTimestampFromUUIDv7");
1079
- function createUUIDv7FromTimestampHex(timestampHex) {
1080
- const randomBytes = /* @__PURE__ */ new Uint8Array(10);
1081
- crypto.getRandomValues(randomBytes);
1082
- const randomHex = Array.from(randomBytes).map((b) => b.toString(16).padStart(2, "0")).join("");
1083
- const randA = randomHex.slice(0, 3);
1084
- const randBHex = randomHex.slice(3, 19);
1085
- const versionAndRandA = `7${randA}`;
1086
- const variantAndFirstRandB = (128 | parseInt(randBHex.slice(0, 2), 16) & 63).toString(16).padStart(2, "0");
1087
- return [
1088
- timestampHex.slice(0, 8),
1089
- timestampHex.slice(8, 12),
1090
- versionAndRandA,
1091
- variantAndFirstRandB + randBHex.slice(2, 4),
1092
- randBHex.slice(4, 16)
1093
- ].join("-");
1094
- }
1095
- __name(createUUIDv7FromTimestampHex, "createUUIDv7FromTimestampHex");
1096
- var createUUIDv7 = /* @__PURE__ */ __name(() => createUUIDv7FromTimestampHex(Date.now().toString(16).padStart(12, "0")), "createUUIDv7");
1097
- var createUUIDv7After = /* @__PURE__ */ __name((floor, nowMs = Date.now()) => {
1098
- const timestamp = Math.max(nowMs, floor === null ? 0 : extractTimestampFromUUIDv7(floor) + 1);
1099
- if (!Number.isSafeInteger(timestamp) || timestamp < 0 || timestamp >= 2 ** 48) throw new RangeError("UUIDv7 timestamp is out of range");
1100
- return createUUIDv7FromTimestampHex(timestamp.toString(16).padStart(12, "0"));
1101
- }, "createUUIDv7After");
1102
-
1103
1094
  // ../plugin-core/dist/releaseCatalogCompiler.mjs
1104
1095
  var ReleaseCatalogCompilationError = class extends Error {
1105
1096
  static {
@@ -1217,30 +1208,24 @@ function validateReleases(releases, strategy) {
1217
1208
  if (seenIds.has(release.id)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Duplicate Release ID: ${release.id}`);
1218
1209
  seenIds.add(release.id);
1219
1210
  if (release.strategy !== strategy) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has the wrong strategy`);
1220
- if (release.kind === "BUNDLE" && release.bundleId === null || release.kind === "EMBEDDED" && release.bundleId !== null) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid kind/Bundle combination`);
1211
+ if (release.bundleId === null) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has no Bundle`);
1221
1212
  if (release.targetCohorts.length > MAX_TARGET_COHORTS_PER_RELEASE) throw new ReleaseCatalogCompilationError("TARGET_COHORT_LIMIT", `Release ${release.id} exceeds ${MAX_TARGET_COHORTS_PER_RELEASE} target cohorts`);
1222
1213
  if (strategy === "APP_VERSION" && (release.targetAppVersion === null || release.fingerprintHash !== null)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid app-version target`);
1223
1214
  if (strategy === "FINGERPRINT" && (release.fingerprintHash === null || release.targetAppVersion !== null)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid fingerprint target`);
1224
1215
  }
1225
- return enabled.filter((release) => release.kind === "BUNDLE");
1216
+ return enabled;
1226
1217
  }
1227
1218
  __name(validateReleases, "validateReleases");
1228
1219
  function collectFrontierReleaseIds(releases) {
1229
1220
  if (releases.every((release) => normalizeRolloutCohortCount(release.rolloutCohortCount) >= NUMERIC_COHORT_SIZE)) {
1230
1221
  const retained3 = /* @__PURE__ */ new Set();
1231
1222
  const bundleIds = /* @__PURE__ */ new Set();
1232
- let embedded = false;
1233
1223
  for (const release of releases) {
1234
- if (release.kind === "EMBEDDED") {
1235
- if (!embedded) {
1236
- embedded = true;
1237
- retained3.add(release.id);
1238
- }
1239
- } else if (release.bundleId !== null && bundleIds.size < 11 && !bundleIds.has(release.bundleId)) {
1224
+ if (release.bundleId !== null && !bundleIds.has(release.bundleId)) {
1240
1225
  bundleIds.add(release.bundleId);
1241
1226
  retained3.add(release.id);
1242
1227
  }
1243
- if (embedded && bundleIds.size >= 11) break;
1228
+ if (bundleIds.size >= 11) break;
1244
1229
  }
1245
1230
  return retained3;
1246
1231
  }
@@ -1257,7 +1242,6 @@ function collectFrontierReleaseIds(releases) {
1257
1242
  normalized,
1258
1243
  numeric: normalized === void 0 ? null : getNumericCohortValue(normalized),
1259
1244
  bundleIds: /* @__PURE__ */ new Set(),
1260
- embedded: false,
1261
1245
  complete: false
1262
1246
  };
1263
1247
  });
@@ -1282,16 +1266,11 @@ function collectFrontierReleaseIds(releases) {
1282
1266
  for (const index of eligibleStateIndexes) {
1283
1267
  const state = cohortStates[index];
1284
1268
  if (state.complete) continue;
1285
- if (release.kind === "EMBEDDED") {
1286
- if (!state.embedded) {
1287
- state.embedded = true;
1288
- retained2.add(release.id);
1289
- }
1290
- } else if (release.bundleId !== null && state.bundleIds.size < 11 && !state.bundleIds.has(release.bundleId)) {
1269
+ if (release.bundleId !== null && !state.bundleIds.has(release.bundleId)) {
1291
1270
  state.bundleIds.add(release.bundleId);
1292
1271
  retained2.add(release.id);
1293
1272
  }
1294
- if (state.embedded && state.bundleIds.size >= 11) {
1273
+ if (state.bundleIds.size >= 11) {
1295
1274
  state.complete = true;
1296
1275
  incompleteStateCount -= 1;
1297
1276
  }
@@ -1488,12 +1467,11 @@ function projectCompiledCatalog(catalog, appVersion) {
1488
1467
  __name(projectCompiledCatalog, "projectCompiledCatalog");
1489
1468
  function projectCompiledRollbackCatalog(catalog, appVersion) {
1490
1469
  let indexes;
1491
- if (catalog.strategy === "FINGERPRINT") indexes = catalog.rollbackReleaseIndexes ?? catalog.releaseIndexes;
1470
+ if (catalog.strategy === "FINGERPRINT") indexes = catalog.rollbackReleaseIndexes;
1492
1471
  else {
1493
1472
  const canonicalVersion = appVersion && canonicalizeAppVersion(appVersion);
1494
1473
  if (!canonicalVersion) return [];
1495
- const segment = catalog.segments.find((candidate) => versionInSegment(canonicalVersion, candidate));
1496
- indexes = segment?.rollbackReleaseIndexes ?? segment?.releaseIndexes ?? [];
1474
+ indexes = catalog.segments.find((segment) => versionInSegment(canonicalVersion, segment))?.rollbackReleaseIndexes ?? [];
1497
1475
  }
1498
1476
  return indexes.map((index) => catalog.releaseDescriptors[index]);
1499
1477
  }
@@ -1525,6 +1503,13 @@ var ReleaseCatalogMutationError = class extends Error {
1525
1503
  }
1526
1504
  };
1527
1505
 
1506
+ // ../plugin-core/dist/semverSatisfies.mjs
1507
+ var semverSatisfies = /* @__PURE__ */ __name((targetAppVersion, currentVersion) => {
1508
+ const currentCoerce = coerce2(currentVersion);
1509
+ if (!currentCoerce) return false;
1510
+ return satisfies(currentCoerce, targetAppVersion);
1511
+ }, "semverSatisfies");
1512
+
1528
1513
  // ../plugin-core/dist/serverPlugin/definePlugin.mjs
1529
1514
  var definePlugin = /* @__PURE__ */ __name((plugin) => plugin, "definePlugin");
1530
1515
 
@@ -1997,7 +1982,7 @@ var SETTINGS_TABLE = {
1997
1982
  var ENGINE_SCHEMA_KEY = "schema.engine";
1998
1983
  var CORE_SCHEMA_KEY = "schema.core";
1999
1984
  var stored = /* @__PURE__ */ __name(({ key, expected, found }) => `"${key}" is ${found === null ? "missing" : `"${found}"`}; expected "${expected}"`, "stored");
2000
- var settingMessage = /* @__PURE__ */ __name((adapterName, { key, expected, found }) => `Hot Updater schema setting "${key}" for ${adapterName} is ${found === null ? "missing" : `"${found}"`}; expected "${expected}". ${key === "schema.engine" ? "Create a new empty database and run `hot-updater db migrate`; databases from before the storage engine are not converted." : "Run `hot-updater db migrate`."}`, "settingMessage");
1985
+ var settingMessage = /* @__PURE__ */ __name((adapterName, { key, expected, found }) => `Hot Updater schema setting "${key}" for ${adapterName} is ${found === null ? "missing" : `"${found}"`}; expected "${expected}". Run \`hot-updater db migrate\`.`, "settingMessage");
2001
1986
  var pluginOf = /* @__PURE__ */ __name(({ key }) => key.startsWith("schema.") && key !== "schema.engine" && key !== CORE_SCHEMA_KEY ? key.slice(7) : void 0, "pluginOf");
2002
1987
  var listed = /* @__PURE__ */ __name((items) => items.length < 2 ? items.join("") : `${items.slice(0, -1).join(", ")} and ${items.at(-1)}`, "listed");
2003
1988
  var PLUGIN_TABLES_FIX = "Run `hot-updater db migrate`. A managed server runs only its provider's plugins, and rerunning `hot-updater init --provider <provider>` applies the provider's migrations. Run `hot-updater db` commands in the server's project: they load the server file named on the command line, or src/hotUpdater.* or src/db.*, and don't read hot-updater.config.ts.";
@@ -2097,24 +2082,12 @@ var METER = /* @__PURE__ */ Symbol.for("@hot-updater/plugin-core/read-meter");
2097
2082
  var readMeterOf = /* @__PURE__ */ __name((database) => typeof database === "object" && database !== null ? database[METER] : void 0, "readMeterOf");
2098
2083
 
2099
2084
  // ../plugin-core/dist/engine/db/schemaSettings.mjs
2100
- var assertEngineDatabase = /* @__PURE__ */ __name((adapterName, stored2) => {
2101
- if (stored2.get("schema.core") && !stored2.get("schema.engine")) throw new HotUpdaterSchemaMigrationRequiredError(adapterName, String(stored2.get("schema.core").value), {
2102
- key: ENGINE_SCHEMA_KEY,
2103
- expected: "1",
2104
- found: null
2105
- });
2106
- }, "assertEngineDatabase");
2107
2085
  var storedSettings = /* @__PURE__ */ __name(async (adapter, keys) => {
2108
2086
  const rows = await readSettings(adapter, keys);
2109
2087
  return new Map(keys.map((key, position) => [key, rows[position] ?? null]));
2110
2088
  }, "storedSettings");
2111
2089
  var writeSchemaSettings = /* @__PURE__ */ __name(async (adapter, adapterName, settings) => {
2112
- const stored2 = await storedSettings(adapter, [.../* @__PURE__ */ new Set([
2113
- "schema.core",
2114
- ENGINE_SCHEMA_KEY,
2115
- ...Object.keys(settings)
2116
- ])]);
2117
- assertEngineDatabase(adapterName, stored2);
2090
+ const stored2 = await storedSettings(adapter, Object.keys(settings));
2118
2091
  const ops = Object.entries(settings).flatMap(([key, value]) => {
2119
2092
  const row = stored2.get(key);
2120
2093
  if (row === null || row === void 0) return [{
@@ -2137,15 +2110,10 @@ var writeSchemaSettings = /* @__PURE__ */ __name(async (adapter, adapterName, se
2137
2110
  }];
2138
2111
  });
2139
2112
  if (ops.length === 0) return;
2140
- if (!(await adapter.write(ops)).ok) throw new Error("The schema settings changed during the migration; run it again.");
2113
+ if (!(await adapter.write(ops)).ok) throw new Error(`${adapterName}: the schema settings changed during the migration; run it again.`);
2141
2114
  }, "writeSchemaSettings");
2142
2115
  var migrateSchema = /* @__PURE__ */ __name(async (adapter, adapterName, tables, settings) => {
2143
2116
  if (adapter.migrations === void 0) throw new Error(`${adapterName} creates its tables with its own tooling; write only the settings rows.`);
2144
- const stored2 = await storedSettings(adapter, ["schema.core", ENGINE_SCHEMA_KEY]).catch((error) => {
2145
- if (!isMissingSchemaError(error)) throw error;
2146
- return /* @__PURE__ */ new Map();
2147
- });
2148
- assertEngineDatabase(adapterName, stored2);
2149
2117
  await adapter.migrations.apply([...tables, SETTINGS_TABLE]);
2150
2118
  await writeSchemaSettings(adapter, adapterName, settings);
2151
2119
  }, "migrateSchema");
@@ -2564,24 +2532,17 @@ var getEmptyMigrationResult = /* @__PURE__ */ __name(() => ({
2564
2532
  }, "execute"),
2565
2533
  getSQL: /* @__PURE__ */ __name(() => "", "getSQL")
2566
2534
  }), "getEmptyMigrationResult");
2567
- var assertSupportedMigrationMode = /* @__PURE__ */ __name((options) => {
2568
- if (options.mode === "from-database") throw new Error("Hot Updater migrations support only mode: 'from-schema'.");
2569
- }, "assertSupportedMigrationMode");
2570
2535
 
2571
2536
  // ../plugin-core/dist/engine/db/settingsMigrator.mjs
2572
2537
  var storedSchemaVersion = /* @__PURE__ */ __name((stored2) => {
2573
2538
  const version2 = stored2?.get("schema.core") ?? stored2?.get("version");
2574
2539
  return typeof version2 === "string" ? version2 : void 0;
2575
2540
  }, "storedSchemaVersion");
2576
- var refusePreEngineDatabase = /* @__PURE__ */ __name((adapterName, stored2) => {
2577
- const version2 = storedSchemaVersion(stored2);
2578
- if (version2 === void 0 || stored2.has("schema.engine")) return;
2579
- throw new HotUpdaterSchemaMigrationRequiredError(adapterName, version2, stored2.has("schema.core") ? {
2580
- key: ENGINE_SCHEMA_KEY,
2581
- expected: "1",
2582
- found: null
2583
- } : void 0);
2584
- }, "refusePreEngineDatabase");
2541
+ var refuseV0Database = /* @__PURE__ */ __name((adapterName, stored2) => {
2542
+ const version2 = stored2.get("version");
2543
+ if (typeof version2 !== "string" || stored2.has("schema.engine")) return;
2544
+ throw new HotUpdaterSchemaMigrationRequiredError(adapterName, version2);
2545
+ }, "refuseV0Database");
2585
2546
 
2586
2547
  // ../plugin-core/dist/engine/database/cursor.mjs
2587
2548
  var encoder = new TextEncoder();
@@ -3513,9 +3474,8 @@ var resolveSchema = /* @__PURE__ */ __name((modules) => {
3513
3474
  var createEngineMigrator = /* @__PURE__ */ __name((options) => {
3514
3475
  const getVersion = /* @__PURE__ */ __name(async () => storedSchemaVersion(await options.readSettings()), "getVersion");
3515
3476
  const makeResult = /* @__PURE__ */ __name(async (migrate = {}) => {
3516
- assertSupportedMigrationMode(migrate);
3517
3477
  const stored2 = await options.readSettings();
3518
- refusePreEngineDatabase(options.adapterName, stored2);
3478
+ refuseV0Database(options.adapterName, stored2);
3519
3479
  if (Object.entries(options.settings).every(([key, value]) => stored2.get(key) === value)) return getEmptyMigrationResult();
3520
3480
  return {
3521
3481
  operations: [...options.schema.tables.map((table) => ({
@@ -4550,7 +4510,7 @@ var createSqlAdapter = /* @__PURE__ */ __name(({ executor, tablePrefix = "", max
4550
4510
  }, "createSqlAdapter");
4551
4511
 
4552
4512
  // ../../packages/server/dist/package.mjs
4553
- var version = "1.0.0-rc.45";
4513
+ var version = "1.0.0-rc.47";
4554
4514
 
4555
4515
  // ../../packages/server/dist/version.mjs
4556
4516
  var HOT_UPDATER_SERVER_VERSION = version;
@@ -5244,7 +5204,7 @@ var baseBundleIdsOf = /* @__PURE__ */ __name((row, range, bundleId, limit) => {
5244
5204
  for (const { descriptor, index } of newestFirst) {
5245
5205
  if (ids.length >= limit) break;
5246
5206
  const id = descriptor.bundleId;
5247
- if (serving.has(index) && descriptor.kind === "BUNDLE" && id !== null && id < bundleId && !ids.includes(id)) ids.push(id);
5207
+ if (serving.has(index) && id !== null && id < bundleId && !ids.includes(id)) ids.push(id);
5248
5208
  }
5249
5209
  return ids;
5250
5210
  }, "baseBundleIdsOf");
@@ -5975,7 +5935,7 @@ var createCoreOperations = /* @__PURE__ */ __name((db, { now = Date.now } = {})
5975
5935
  }), "deleteRelease"),
5976
5936
  promoteRelease: /* @__PURE__ */ __name((input) => withChannels(async () => {
5977
5937
  const checkSource = /* @__PURE__ */ __name((source) => {
5978
- if (source.kind !== "BUNDLE" || source.bundle_id === null) throw new ReleaseManagementError("TARGET_RELEASE_INVALID", "Only a Bundle Release can be promoted.");
5938
+ if (source.bundle_id === null) throw new ReleaseManagementError("TARGET_RELEASE_INVALID", "Only a Bundle Release can be promoted.");
5979
5939
  }, "checkSource");
5980
5940
  checkSource((await db.transaction((tx) => loadTarget(tx, input))).release);
5981
5941
  const targetChannel = input.targetChannel.trim();
@@ -6167,7 +6127,6 @@ var fail3 = /* @__PURE__ */ __name((message) => {
6167
6127
  var isRecord2 = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isRecord");
6168
6128
  var checkPlugin = /* @__PURE__ */ __name((value, at) => {
6169
6129
  if (!isRecord2(value)) return fail3(`${at} is not a plugin.`);
6170
- if ("kind" in value) fail3(`${at} has a kind; core is built in and is never passed as a plugin.`);
6171
6130
  const unknown = Object.keys(value).find((key) => !PLUGIN_KEYS.has(key));
6172
6131
  if (unknown !== void 0) fail3(`${at} has an unknown key "${unknown}".`);
6173
6132
  const plugin = value;
@@ -7016,7 +6975,7 @@ var databaseOf = /* @__PURE__ */ __name((value) => {
7016
6975
  if (isAdapter(value.adapter)) return value;
7017
6976
  if ("core" in value && "fetchAdmin" in value) throw new HotUpdaterConfigError("standaloneRepository reaches a server's admin API from the CLI and console. createHotUpdater needs the server's own database, such as kyselyAdapter(...).");
7018
6977
  }
7019
- throw new HotUpdaterConfigError("database must be a Hot Updater 1.0 database, such as kyselyAdapter(...) or postgres(...). Upgrade the provider package that created it.");
6978
+ throw new HotUpdaterConfigError("database must be a Hot Updater database adapter, such as kyselyAdapter(...) or postgres(...).");
7020
6979
  }, "databaseOf");
7021
6980
  var storageOf = /* @__PURE__ */ __name((value) => {
7022
6981
  if (isRecord4(value) && typeof value.name === "string" && typeof value.protocol === "string") return value;