@altimateai/altimate-code 0.1.4 → 0.1.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.
- package/bin/altimate-code +5 -5
- package/package.json +12 -12
- package/postinstall.mjs +5 -5
package/bin/altimate-code
CHANGED
|
@@ -17,7 +17,7 @@ function run(target) {
|
|
|
17
17
|
process.exit(code)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const envPath = process.env.
|
|
20
|
+
const envPath = process.env.OPENCODE_BIN_PATH
|
|
21
21
|
if (envPath) {
|
|
22
22
|
run(envPath)
|
|
23
23
|
}
|
|
@@ -26,7 +26,7 @@ const scriptPath = fs.realpathSync(__filename)
|
|
|
26
26
|
const scriptDir = path.dirname(scriptPath)
|
|
27
27
|
|
|
28
28
|
//
|
|
29
|
-
const cached = path.join(scriptDir, ".
|
|
29
|
+
const cached = path.join(scriptDir, ".opencode")
|
|
30
30
|
if (fs.existsSync(cached)) {
|
|
31
31
|
run(cached)
|
|
32
32
|
}
|
|
@@ -50,8 +50,8 @@ let arch = archMap[os.arch()]
|
|
|
50
50
|
if (!arch) {
|
|
51
51
|
arch = os.arch()
|
|
52
52
|
}
|
|
53
|
-
const base = "
|
|
54
|
-
const binary = platform === "windows" ? "
|
|
53
|
+
const base = "opencode-" + platform + "-" + arch
|
|
54
|
+
const binary = platform === "windows" ? "opencode.exe" : "opencode"
|
|
55
55
|
|
|
56
56
|
function supportsAvx2() {
|
|
57
57
|
if (arch !== "x64") return false
|
|
@@ -169,7 +169,7 @@ function findBinary(startDir) {
|
|
|
169
169
|
const resolved = findBinary(scriptDir)
|
|
170
170
|
if (!resolved) {
|
|
171
171
|
console.error(
|
|
172
|
-
"It seems that your package manager failed to install the right version of the
|
|
172
|
+
"It seems that your package manager failed to install the right version of the opencode CLI for your platform. You can try manually installing " +
|
|
173
173
|
names.map((n) => `\"${n}\"`).join(" or ") +
|
|
174
174
|
" package",
|
|
175
175
|
)
|
package/package.json
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
8
8
|
},
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "v0.1.9",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"@altimateai/altimate-code-linux-x64": "
|
|
13
|
-
"@altimateai/altimate-code-linux-arm64-musl": "
|
|
14
|
-
"@altimateai/altimate-code-darwin-x64": "
|
|
15
|
-
"@altimateai/altimate-code-windows-x64": "
|
|
16
|
-
"@altimateai/altimate-code-linux-x64-musl": "
|
|
17
|
-
"@altimateai/altimate-code-darwin-x64-baseline": "
|
|
18
|
-
"@altimateai/altimate-code-linux-x64-baseline-musl": "
|
|
19
|
-
"@altimateai/altimate-code-linux-x64-baseline": "
|
|
20
|
-
"@altimateai/altimate-code-linux-arm64": "
|
|
21
|
-
"@altimateai/altimate-code-darwin-arm64": "
|
|
22
|
-
"@altimateai/altimate-code-windows-x64-baseline": "
|
|
12
|
+
"@altimateai/altimate-code-linux-x64": "v0.1.9",
|
|
13
|
+
"@altimateai/altimate-code-linux-arm64-musl": "v0.1.9",
|
|
14
|
+
"@altimateai/altimate-code-darwin-x64": "v0.1.9",
|
|
15
|
+
"@altimateai/altimate-code-windows-x64": "v0.1.9",
|
|
16
|
+
"@altimateai/altimate-code-linux-x64-musl": "v0.1.9",
|
|
17
|
+
"@altimateai/altimate-code-darwin-x64-baseline": "v0.1.9",
|
|
18
|
+
"@altimateai/altimate-code-linux-x64-baseline-musl": "v0.1.9",
|
|
19
|
+
"@altimateai/altimate-code-linux-x64-baseline": "v0.1.9",
|
|
20
|
+
"@altimateai/altimate-code-linux-arm64": "v0.1.9",
|
|
21
|
+
"@altimateai/altimate-code-darwin-arm64": "v0.1.9",
|
|
22
|
+
"@altimateai/altimate-code-windows-x64-baseline": "v0.1.9"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -49,8 +49,8 @@ function detectPlatformAndArch() {
|
|
|
49
49
|
|
|
50
50
|
function findBinary() {
|
|
51
51
|
const { platform, arch } = detectPlatformAndArch()
|
|
52
|
-
const packageName =
|
|
53
|
-
const binaryName = platform === "windows" ? "
|
|
52
|
+
const packageName = `opencode-${platform}-${arch}`
|
|
53
|
+
const binaryName = platform === "windows" ? "opencode.exe" : "opencode"
|
|
54
54
|
|
|
55
55
|
try {
|
|
56
56
|
// Use require.resolve to find the package
|
|
@@ -89,7 +89,7 @@ function symlinkBinary(sourcePath, binaryName) {
|
|
|
89
89
|
const { targetPath } = prepareBinDirectory(binaryName)
|
|
90
90
|
|
|
91
91
|
fs.symlinkSync(sourcePath, targetPath)
|
|
92
|
-
console.log(`
|
|
92
|
+
console.log(`opencode binary symlinked: ${targetPath} -> ${sourcePath}`)
|
|
93
93
|
|
|
94
94
|
// Verify the file exists after operation
|
|
95
95
|
if (!fs.existsSync(targetPath)) {
|
|
@@ -109,7 +109,7 @@ async function main() {
|
|
|
109
109
|
// On non-Windows platforms, just verify the binary package exists
|
|
110
110
|
// Don't replace the wrapper script - it handles binary execution
|
|
111
111
|
const { binaryPath } = findBinary()
|
|
112
|
-
const target = path.join(__dirname, "bin", ".
|
|
112
|
+
const target = path.join(__dirname, "bin", ".opencode")
|
|
113
113
|
if (fs.existsSync(target)) fs.unlinkSync(target)
|
|
114
114
|
try {
|
|
115
115
|
fs.linkSync(binaryPath, target)
|
|
@@ -118,7 +118,7 @@ async function main() {
|
|
|
118
118
|
}
|
|
119
119
|
fs.chmodSync(target, 0o755)
|
|
120
120
|
} catch (error) {
|
|
121
|
-
console.error("Failed to setup
|
|
121
|
+
console.error("Failed to setup opencode binary:", error.message)
|
|
122
122
|
process.exit(1)
|
|
123
123
|
}
|
|
124
124
|
}
|