@spenceriam/impulse 0.35.0 → 0.36.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/bin/impulse +29 -19
- package/package.json +7 -6
- package/postinstall.mjs +2 -2
package/bin/impulse
CHANGED
|
@@ -47,30 +47,40 @@ function findBinary() {
|
|
|
47
47
|
const { platform, arch } = detectPlatformAndArch();
|
|
48
48
|
const packageName = `@spenceriam/impulse-${platform}-${arch}`;
|
|
49
49
|
const binaryName = platform === "windows" ? "impulse.exe" : "impulse";
|
|
50
|
+
const packageCandidates = [packageName];
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// On Windows ARM64, allow fallback to the x64 package for Prism emulation.
|
|
53
|
+
if (platform === "windows" && arch === "arm64") {
|
|
54
|
+
packageCandidates.push("@spenceriam/impulse-windows-x64");
|
|
55
|
+
}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
for (const candidate of packageCandidates) {
|
|
58
|
+
try {
|
|
59
|
+
const packageJsonPath = require.resolve(`${candidate}/package.json`);
|
|
60
|
+
const packageDir = dirname(packageJsonPath);
|
|
61
|
+
const binaryPath = join(packageDir, "bin", binaryName);
|
|
62
|
+
|
|
63
|
+
if (!existsSync(binaryPath)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const localBinary = join(__dirname, binaryName);
|
|
64
|
-
if (existsSync(localBinary)) {
|
|
65
|
-
return localBinary;
|
|
67
|
+
return binaryPath;
|
|
68
|
+
} catch (_error) {
|
|
69
|
+
// Try next candidate package.
|
|
66
70
|
}
|
|
67
|
-
|
|
68
|
-
throw new Error(
|
|
69
|
-
`Could not find IMPULSE binary for ${platform}-${arch}.\n` +
|
|
70
|
-
`Package ${packageName} may not be installed.\n` +
|
|
71
|
-
`Try reinstalling: npm install -g @spenceriam/impulse`
|
|
72
|
-
);
|
|
73
71
|
}
|
|
72
|
+
|
|
73
|
+
// Check if symlinked binary exists in same directory
|
|
74
|
+
const localBinary = join(__dirname, binaryName);
|
|
75
|
+
if (existsSync(localBinary)) {
|
|
76
|
+
return localBinary;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
throw new Error(
|
|
80
|
+
`Could not find IMPULSE binary for ${platform}-${arch}.\n` +
|
|
81
|
+
`Checked packages: ${packageCandidates.join(", ")}.\n` +
|
|
82
|
+
`Try reinstalling: npm install -g @spenceriam/impulse`
|
|
83
|
+
);
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spenceriam/impulse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Terminal-based AI coding agent powered by Z.ai's Coding Plan",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@spenceriam/impulse-linux-x64": "0.
|
|
25
|
-
"@spenceriam/impulse-linux-arm64": "0.
|
|
26
|
-
"@spenceriam/impulse-darwin-x64": "0.
|
|
27
|
-
"@spenceriam/impulse-darwin-arm64": "0.
|
|
28
|
-
"@spenceriam/impulse-windows-x64": "0.
|
|
24
|
+
"@spenceriam/impulse-linux-x64": "0.36.0",
|
|
25
|
+
"@spenceriam/impulse-linux-arm64": "0.36.0",
|
|
26
|
+
"@spenceriam/impulse-darwin-x64": "0.36.0",
|
|
27
|
+
"@spenceriam/impulse-darwin-arm64": "0.36.0",
|
|
28
|
+
"@spenceriam/impulse-windows-x64": "0.36.0",
|
|
29
|
+
"@spenceriam/impulse-windows-arm64": "0.36.0"
|
|
29
30
|
}
|
|
30
31
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -54,14 +54,14 @@ function findBinary() {
|
|
|
54
54
|
"darwin-x64",
|
|
55
55
|
"darwin-arm64",
|
|
56
56
|
"windows-x64",
|
|
57
|
+
"windows-arm64",
|
|
57
58
|
];
|
|
58
59
|
|
|
59
60
|
const combo = `${platform}-${arch}`;
|
|
60
61
|
if (!supportedCombos.includes(combo)) {
|
|
61
62
|
throw new Error(
|
|
62
63
|
`Unsupported platform: ${platform}-${arch}\n` +
|
|
63
|
-
`IMPULSE currently supports: ${supportedCombos.join(", ")}
|
|
64
|
-
`Windows ARM64 support is pending Bun's cross-compile target.`
|
|
64
|
+
`IMPULSE currently supports: ${supportedCombos.join(", ")}`
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
|