@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.
Files changed (2) hide show
  1. package/bin/opencode2 +7 -4
  2. 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 cached = path.join(scriptDir, ".opencode2")
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 = "@opencode-ai/cli-" + platform + "-" + arch
38
- const binary = platform === "windows" ? "opencode2.exe" : "opencode2"
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
- "It seems that your package manager failed to install the right opencode2 CLI package. Try manually installing " +
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-15717",
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-15717",
23
- "@opencode-ai/cli-windows-arm64": "0.0.0-next-15717",
24
- "@opencode-ai/cli-windows-x64-baseline": "0.0.0-next-15717",
25
- "@opencode-ai/cli-linux-x64-baseline-musl": "0.0.0-next-15717",
26
- "@opencode-ai/cli-darwin-arm64": "0.0.0-next-15717",
27
- "@opencode-ai/cli-linux-arm64-musl": "0.0.0-next-15717",
28
- "@opencode-ai/cli-linux-x64-musl": "0.0.0-next-15717",
29
- "@opencode-ai/cli-darwin-x64-baseline": "0.0.0-next-15717",
30
- "@opencode-ai/cli-linux-x64-baseline": "0.0.0-next-15717",
31
- "@opencode-ai/cli-linux-arm64": "0.0.0-next-15717",
32
- "@opencode-ai/cli-linux-x64": "0.0.0-next-15717",
33
- "@opencode-ai/cli-darwin-x64": "0.0.0-next-15717"
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
  }