@fungi.computer/spore 0.8.2 → 0.9.0

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/fungi.cjs CHANGED
@@ -5,6 +5,15 @@ const { createHash } = require("node:crypto");
5
5
  const { readFileSync } = require("node:fs");
6
6
  const { release, cpus } = require("node:os");
7
7
 
8
+ // Match the published package's Node engine before loading platform dependencies.
9
+ const [nodeMajor, nodeMinor] = process.versions.node.split(".").map(Number);
10
+ if (nodeMajor < 22 || (nodeMajor === 22 && nodeMinor < 13)) {
11
+ console.error(
12
+ `Fungi CLI needs Node 22.13 or newer; found ${process.versions.node}. Install Node 22.13 or newer, reinstall with npm i -g @fungi.computer/spore, then run fungi.`,
13
+ );
14
+ process.exit(1);
15
+ }
16
+
8
17
  const runtimes = {
9
18
  "linux-x64": "@oven/bun-linux-x64/bin/bun",
10
19
  "linux-arm64": "@oven/bun-linux-aarch64/bin/bun",
@@ -60,7 +69,7 @@ function nativeResolution() {
60
69
  }
61
70
  if (nativeResolution().kind === "missing") {
62
71
  console.error(
63
- `Fungi's native package for ${platform} is missing or doesn't match this version. Reinstall: npm i -g @fungi.computer/spore@${sporeVersion}`,
72
+ `Fungi's native package for ${platform} is missing or doesn't match this version. Reinstall: npm i -g @fungi.computer/spore@${sporeVersion} --include=optional`,
64
73
  );
65
74
  process.exit(1);
66
75
  }
@@ -11207,7 +11207,7 @@ var WebSocketTransport = class {
11207
11207
  let reasonBytes = new TextEncoder().encode(message);
11208
11208
  if (reasonBytes.length > 123) message = new TextDecoder().decode(reasonBytes.subarray(0, 123), { stream: true });
11209
11209
  this.#webSocket.close(3e3, message);
11210
- if (!this.#error) this.#error = reason;
11210
+ this.#receivedError(reason);
11211
11211
  }
11212
11212
  #receivedError(reason) {
11213
11213
  if (!this.#error) {