@auersperg/flare 0.3.8 → 0.3.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.
@@ -594,6 +594,17 @@ function settingsDigest(settings) {
594
594
  }
595
595
 
596
596
  // packages/flare/src/cli/platform-health.mjs
597
+ function runtimeReadinessFailures(data, state, release = state.installed) {
598
+ const expected = {
599
+ readiness: "control-plane-ready",
600
+ installationId: state.id,
601
+ platformPayload: release?.digest,
602
+ version: release?.version,
603
+ runtimeAbi: release?.runtimeAbi ?? 4,
604
+ protocol: release?.protocol ?? 1
605
+ };
606
+ return Object.keys(expected).filter((key) => expected[key] === undefined || data?.[key] !== expected[key]);
607
+ }
597
608
  async function platformHealth(cf, state, fetcher) {
598
609
  const checkedAt = Date.now();
599
610
  const probe = async (fn) => {
@@ -611,9 +622,10 @@ async function platformHealth(cf, state, fetcher) {
611
622
  return { status: "unhealthy", httpStatus: r.status };
612
623
  }
613
624
  const d = await r.json();
614
- const matches = d.readiness === "control-plane-ready" && d.installationId === state.id && d.platformPayload === state.installed?.digest && d.version === state.installed?.version;
625
+ const mismatches = runtimeReadinessFailures(d, state);
615
626
  return {
616
- status: matches ? "healthy" : "mismatch",
627
+ status: mismatches.length ? "mismatch" : "healthy",
628
+ ...mismatches.length ? { mismatches } : {},
617
629
  version: d.version,
618
630
  installationId: d.installationId
619
631
  };
@@ -1024,19 +1036,29 @@ async function verify(cf, state, release, fetcher, wait) {
1024
1036
  await assertAccess(cf, state);
1025
1037
  await supervisorNamespace(cf, state);
1026
1038
  let healthy = false;
1039
+ let lastProbe = "unavailable";
1027
1040
  for (let attempt = 0;attempt < 5; attempt++) {
1028
1041
  try {
1029
1042
  const response = await fetcher(`https://${state.addresses.runtimeHost}/health?ready=1`, { redirect: "error", signal: AbortSignal.timeout(15000) });
1030
- const data = await response.json();
1031
- healthy = response.ok && data.readiness === "control-plane-ready" && data.version === release.manifest.version && data.installationId === state.id && data.platformPayload === release.manifest.digest && data.runtimeAbi === 4 && data.protocol === 1;
1032
- } catch {}
1043
+ lastProbe = `HTTP ${response.status}`;
1044
+ if (!response.ok)
1045
+ await response.body?.cancel();
1046
+ else {
1047
+ const failures = runtimeReadinessFailures(await response.json(), state, release.manifest);
1048
+ healthy = failures.length === 0;
1049
+ if (failures.length)
1050
+ lastProbe += "; mismatches: " + failures.join(",");
1051
+ }
1052
+ } catch {
1053
+ lastProbe = "network/timeout or invalid health response";
1054
+ }
1033
1055
  if (healthy)
1034
1056
  break;
1035
1057
  if (attempt < 4)
1036
1058
  await wait(2000);
1037
1059
  }
1038
1060
  if (!healthy)
1039
- throw Error("Runtime health does not match the installed platform payload; operation remains resumable");
1061
+ throw Error("Runtime health does not match the installed platform payload; operation remains resumable. Last probe: " + lastProbe);
1040
1062
  for (const path of ["/", "/api/session"]) {
1041
1063
  const response = await fetcher(`https://${state.addresses.adminHost}${path}`, { redirect: "manual", signal: AbortSignal.timeout(15000) });
1042
1064
  if ([301, 302, 303, 307, 308].includes(response.status)) {
package/dist/cli/flare.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // packages/flare/package.json
4
4
  var package_default = {
5
5
  name: "@auersperg/flare",
6
- version: "0.3.8",
6
+ version: "0.3.9",
7
7
  license: "MIT",
8
8
  type: "module",
9
9
  description: "Flare client, server declarations and development CLI",
@@ -147,7 +147,7 @@ Uses the platform payload bundled with this CLI release. Never updates applicati
147
147
  options[key] = args[++i];
148
148
  }
149
149
  }
150
- const { platform } = await import("./chunk-y6e2h40n.js");
150
+ const { platform } = await import("./chunk-0s0vrjtw.js");
151
151
  console.log(JSON.stringify(await platform(options), null, 2));
152
152
  }
153
153
  } catch (error) {
@@ -301,7 +301,7 @@ async function collectCatalog(database, now = Date.now()) {
301
301
  // packages/core/package.json
302
302
  var package_default = {
303
303
  name: "@flare/platform",
304
- version: "0.3.8",
304
+ version: "0.3.9",
305
305
  type: "module",
306
306
  license: "MIT",
307
307
  private: true,
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "format": 1,
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "stateFormat": 1,
5
5
  "protocol": 1,
6
6
  "runtimeAbi": 4,
7
7
  "compatibilityDate": "2026-10-10",
8
8
  "wranglerVersion": "4.150.0",
9
9
  "upgradeFrom": [
10
- "0.3.7"
10
+ "0.3.8"
11
11
  ],
12
12
  "files": [
13
13
  {
14
14
  "path": "admin.js",
15
15
  "bytes": 37187,
16
- "sha256": "818f2b570aed00d675582b9cef0419d765f0a40e0190748c1bc565f3d42d55e8"
16
+ "sha256": "49f0ae5f7f00dec3ee19882ec2cef180e40bb12e0a3a0a687702a5147d3f6154"
17
17
  },
18
18
  {
19
19
  "path": "dashboard/_astro/auth-view.EASEF9BN.js",
@@ -188,8 +188,8 @@
188
188
  {
189
189
  "path": "runtime.js",
190
190
  "bytes": 355598,
191
- "sha256": "e76574a99a64e47da14ab86a0331b924cf4d369acd32cae7f50207eeba303101"
191
+ "sha256": "f51eb0521194d3eb83e949b5f92c9f5327096fcb5306fe10425038576618af5a"
192
192
  }
193
193
  ],
194
- "digest": "306a5a5e07866fc7c21c88f96c96fa91dcd0ed13ec48599560429f8d1b8c47c3"
194
+ "digest": "a0d7181857f7b4ec5be28c139389cadac59b5d21a88a812f22ce424cdb605965"
195
195
  }
@@ -560,7 +560,7 @@ function dashboardIdentity(value) {
560
560
  // packages/core/package.json
561
561
  var package_default = {
562
562
  name: "@flare/platform",
563
- version: "0.3.8",
563
+ version: "0.3.9",
564
564
  type: "module",
565
565
  license: "MIT",
566
566
  private: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auersperg/flare",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Flare client, server declarations and development CLI",