@altimateai/altimate-code 0.6.1 → 0.7.1

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
@@ -7,24 +7,20 @@
7
7
  "scripts": {
8
8
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
9
9
  },
10
- "version": "0.6.1",
10
+ "version": "0.7.1",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
13
  "@altimateai/altimate-core": "0.3.1"
14
14
  },
15
15
  "optionalDependencies": {
16
- "@altimateai/altimate-code-linux-x64-musl": "0.6.1",
17
- "@altimateai/altimate-code-linux-x64-baseline": "0.6.1",
18
- "@altimateai/altimate-code-windows-arm64": "0.6.1",
19
- "@altimateai/altimate-code-darwin-arm64": "0.6.1",
20
- "@altimateai/altimate-code-windows-x64-baseline": "0.6.1",
21
- "@altimateai/altimate-code-linux-arm64": "0.6.1",
22
- "@altimateai/altimate-code-linux-x64-baseline-musl": "0.6.1",
23
- "@altimateai/altimate-code-darwin-x64-baseline": "0.6.1",
24
- "@altimateai/altimate-code-windows-x64": "0.6.1",
25
- "@altimateai/altimate-code-darwin-x64": "0.6.1",
26
- "@altimateai/altimate-code-linux-x64": "0.6.1",
27
- "@altimateai/altimate-code-linux-arm64-musl": "0.6.1"
16
+ "@altimateai/altimate-code-windows-x64": "0.7.1",
17
+ "@altimateai/altimate-code-linux-x64": "0.7.1",
18
+ "@altimateai/altimate-code-linux-arm64": "0.7.1",
19
+ "@altimateai/altimate-code-windows-x64-baseline": "0.7.1",
20
+ "@altimateai/altimate-code-darwin-arm64": "0.7.1",
21
+ "@altimateai/altimate-code-linux-x64-baseline": "0.7.1",
22
+ "@altimateai/altimate-code-darwin-x64": "0.7.1",
23
+ "@altimateai/altimate-code-darwin-x64-baseline": "0.7.1"
28
24
  },
29
25
  "peerDependencies": {
30
26
  "pg": ">=8",
package/postinstall.mjs CHANGED
@@ -47,8 +47,49 @@ function detectPlatformAndArch() {
47
47
  return { platform, arch }
48
48
  }
49
49
 
50
+ function isMuslPlatform() {
51
+ if (os.platform() !== "linux") return false
52
+ try {
53
+ if (fs.existsSync("/etc/alpine-release")) return true
54
+ } catch {
55
+ // ignore
56
+ }
57
+ try {
58
+ // Mirror the detection in packages/opencode/bin/altimate: on musl
59
+ // systems `ldd --version` exits non-zero and prints to stderr.
60
+ // execSync would throw AND only return stdout — silently missing every
61
+ // non-Alpine musl distro. spawnSync gives both streams regardless of
62
+ // exit code.
63
+ const { spawnSync } = require("child_process")
64
+ const result = spawnSync("ldd", ["--version"], { encoding: "utf8" })
65
+ const text = ((result.stdout || "") + (result.stderr || "")).toLowerCase()
66
+ if (text.includes("musl")) return true
67
+ } catch {
68
+ // ignore — ldd may not exist at all
69
+ }
70
+ return false
71
+ }
72
+
50
73
  function findBinary() {
51
74
  const { platform, arch } = detectPlatformAndArch()
75
+
76
+ // @altimateai/altimate-core has no NAPI prebuild for musl or win32-arm64,
77
+ // and the altimate binary embeds altimate-core's .node at build time. Emit
78
+ // a clear, actionable error here rather than the generic
79
+ // "Could not find package" message that would otherwise fall out below.
80
+ if (isMuslPlatform()) {
81
+ throw new Error(
82
+ "altimate-code is not currently supported on Alpine Linux (musl). " +
83
+ "Run 'apk add gcompat' to execute glibc binaries on Alpine, or use a glibc-based base image.",
84
+ )
85
+ }
86
+ if (platform === "windows" && arch === "arm64") {
87
+ throw new Error(
88
+ "altimate-code is not currently built for Windows on ARM64. " +
89
+ "Run the x64 build under Windows ARM's x64 emulation, or use WSL.",
90
+ )
91
+ }
92
+
52
93
  const packageName = `@altimateai/altimate-code-${platform}-${arch}`
53
94
  const binaryName = platform === "windows" ? "altimate-code.exe" : "altimate-code"
54
95