@opencode-ai/cli 0.0.0-next-15717 → 0.0.0-next-15747
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/opencode2 +7 -4
- package/package.json +13 -13
package/bin/opencode2
CHANGED
|
@@ -31,11 +31,13 @@ function run(target) {
|
|
|
31
31
|
|
|
32
32
|
const envPath = process.env.OPENCODE_BIN_PATH
|
|
33
33
|
const scriptDir = path.dirname(fs.realpathSync(__filename))
|
|
34
|
-
const
|
|
34
|
+
const command = path.basename(__filename).replace(/\.cjs$/, "")
|
|
35
|
+
const nodeBuild = command === "opencode2-node"
|
|
36
|
+
const cached = path.join(scriptDir, `.${command}`)
|
|
35
37
|
const platform = { darwin: "darwin", linux: "linux", win32: "windows" }[os.platform()] || os.platform()
|
|
36
38
|
const arch = { x64: "x64", arm64: "arm64", arm: "arm" }[os.arch()] || os.arch()
|
|
37
|
-
const base =
|
|
38
|
-
const binary = platform === "windows" ?
|
|
39
|
+
const base = `@opencode-ai/cli${nodeBuild ? "-node" : ""}-` + platform + "-" + arch
|
|
40
|
+
const binary = platform === "windows" ? `${command}.exe` : command
|
|
39
41
|
|
|
40
42
|
function supportsAvx2() {
|
|
41
43
|
if (arch !== "x64") return false
|
|
@@ -77,6 +79,7 @@ function supportsAvx2() {
|
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
const names = (() => {
|
|
82
|
+
if (nodeBuild) return [base]
|
|
80
83
|
const baseline = arch === "x64" && !supportsAvx2()
|
|
81
84
|
if (platform === "linux") {
|
|
82
85
|
const musl = (() => {
|
|
@@ -121,7 +124,7 @@ function findBinary(startDir) {
|
|
|
121
124
|
const resolved = envPath || (fs.existsSync(cached) ? cached : findBinary(scriptDir))
|
|
122
125
|
if (!resolved) {
|
|
123
126
|
console.error(
|
|
124
|
-
|
|
127
|
+
`It seems that your package manager failed to install the right ${command} CLI package. Try manually installing ` +
|
|
125
128
|
names.map((name) => `"${name}"`).join(" or ") +
|
|
126
129
|
" package",
|
|
127
130
|
)
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"bin": {
|
|
4
4
|
"opencode2": "./bin/opencode2"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.0-next-
|
|
6
|
+
"version": "0.0.0-next-15747",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"x64"
|
|
20
20
|
],
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@opencode-ai/cli-windows-x64": "0.0.0-next-
|
|
23
|
-
"@opencode-ai/cli-
|
|
24
|
-
"@opencode-ai/cli-
|
|
25
|
-
"@opencode-ai/cli-linux-x64
|
|
26
|
-
"@opencode-ai/cli-darwin-
|
|
27
|
-
"@opencode-ai/cli-
|
|
28
|
-
"@opencode-ai/cli-linux-x64-musl": "0.0.0-next-
|
|
29
|
-
"@opencode-ai/cli-
|
|
30
|
-
"@opencode-ai/cli-linux-
|
|
31
|
-
"@opencode-ai/cli-linux-
|
|
32
|
-
"@opencode-ai/cli-
|
|
33
|
-
"@opencode-ai/cli-
|
|
22
|
+
"@opencode-ai/cli-windows-x64": "0.0.0-next-15747",
|
|
23
|
+
"@opencode-ai/cli-linux-x64-baseline": "0.0.0-next-15747",
|
|
24
|
+
"@opencode-ai/cli-linux-arm64-musl": "0.0.0-next-15747",
|
|
25
|
+
"@opencode-ai/cli-linux-x64": "0.0.0-next-15747",
|
|
26
|
+
"@opencode-ai/cli-darwin-x64-baseline": "0.0.0-next-15747",
|
|
27
|
+
"@opencode-ai/cli-darwin-arm64": "0.0.0-next-15747",
|
|
28
|
+
"@opencode-ai/cli-linux-x64-musl": "0.0.0-next-15747",
|
|
29
|
+
"@opencode-ai/cli-windows-arm64": "0.0.0-next-15747",
|
|
30
|
+
"@opencode-ai/cli-linux-arm64": "0.0.0-next-15747",
|
|
31
|
+
"@opencode-ai/cli-linux-x64-baseline-musl": "0.0.0-next-15747",
|
|
32
|
+
"@opencode-ai/cli-darwin-x64": "0.0.0-next-15747",
|
|
33
|
+
"@opencode-ai/cli-windows-x64-baseline": "0.0.0-next-15747"
|
|
34
34
|
}
|
|
35
35
|
}
|