@altimateai/altimate-code 0.1.9 → 0.2.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/altimate-code CHANGED
@@ -17,7 +17,7 @@ function run(target) {
17
17
  process.exit(code)
18
18
  }
19
19
 
20
- const envPath = process.env.OPENCODE_BIN_PATH
20
+ const envPath = process.env.ALTIMATE_CODE_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, ".opencode")
29
+ const cached = path.join(scriptDir, ".altimate-code")
30
30
  if (fs.existsSync(cached)) {
31
31
  run(cached)
32
32
  }
@@ -50,8 +50,9 @@ let arch = archMap[os.arch()]
50
50
  if (!arch) {
51
51
  arch = os.arch()
52
52
  }
53
- const base = "opencode-" + platform + "-" + arch
54
- const binary = platform === "windows" ? "opencode.exe" : "opencode"
53
+ const scope = "@altimateai"
54
+ const base = "altimate-code-" + platform + "-" + arch
55
+ const binary = platform === "windows" ? "altimate-code.exe" : "altimate-code"
55
56
 
56
57
  function supportsAvx2() {
57
58
  if (arch !== "x64") return false
@@ -154,7 +155,7 @@ function findBinary(startDir) {
154
155
  const modules = path.join(current, "node_modules")
155
156
  if (fs.existsSync(modules)) {
156
157
  for (const name of names) {
157
- const candidate = path.join(modules, name, "bin", binary)
158
+ const candidate = path.join(modules, scope, name, "bin", binary)
158
159
  if (fs.existsSync(candidate)) return candidate
159
160
  }
160
161
  }
@@ -169,8 +170,8 @@ function findBinary(startDir) {
169
170
  const resolved = findBinary(scriptDir)
170
171
  if (!resolved) {
171
172
  console.error(
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
- names.map((n) => `\"${n}\"`).join(" or ") +
173
+ "It seems that your package manager failed to install the right version of the altimate-code CLI for your platform. You can try manually installing " +
174
+ names.map((n) => `\"${scope}/${n}\"`).join(" or ") +
174
175
  " package",
175
176
  )
176
177
  process.exit(1)
package/package.json CHANGED
@@ -6,19 +6,19 @@
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "v0.1.9",
9
+ "version": "v0.2.0",
10
10
  "license": "MIT",
11
11
  "optionalDependencies": {
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"
12
+ "@altimateai/altimate-code-linux-x64": "v0.2.0",
13
+ "@altimateai/altimate-code-linux-arm64-musl": "v0.2.0",
14
+ "@altimateai/altimate-code-darwin-x64": "v0.2.0",
15
+ "@altimateai/altimate-code-windows-x64": "v0.2.0",
16
+ "@altimateai/altimate-code-linux-x64-musl": "v0.2.0",
17
+ "@altimateai/altimate-code-darwin-x64-baseline": "v0.2.0",
18
+ "@altimateai/altimate-code-linux-x64-baseline-musl": "v0.2.0",
19
+ "@altimateai/altimate-code-linux-x64-baseline": "v0.2.0",
20
+ "@altimateai/altimate-code-linux-arm64": "v0.2.0",
21
+ "@altimateai/altimate-code-darwin-arm64": "v0.2.0",
22
+ "@altimateai/altimate-code-windows-x64-baseline": "v0.2.0"
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 = `opencode-${platform}-${arch}`
53
- const binaryName = platform === "windows" ? "opencode.exe" : "opencode"
52
+ const packageName = `@altimateai/altimate-code-${platform}-${arch}`
53
+ const binaryName = platform === "windows" ? "altimate-code.exe" : "altimate-code"
54
54
 
55
55
  try {
56
56
  // Use require.resolve to find the package
@@ -85,18 +85,6 @@ function prepareBinDirectory(binaryName) {
85
85
  return { binDir, targetPath }
86
86
  }
87
87
 
88
- function symlinkBinary(sourcePath, binaryName) {
89
- const { targetPath } = prepareBinDirectory(binaryName)
90
-
91
- fs.symlinkSync(sourcePath, targetPath)
92
- console.log(`opencode binary symlinked: ${targetPath} -> ${sourcePath}`)
93
-
94
- // Verify the file exists after operation
95
- if (!fs.existsSync(targetPath)) {
96
- throw new Error(`Failed to symlink binary to ${targetPath}`)
97
- }
98
- }
99
-
100
88
  async function main() {
101
89
  try {
102
90
  if (os.platform() === "win32") {
@@ -109,7 +97,7 @@ async function main() {
109
97
  // On non-Windows platforms, just verify the binary package exists
110
98
  // Don't replace the wrapper script - it handles binary execution
111
99
  const { binaryPath } = findBinary()
112
- const target = path.join(__dirname, "bin", ".opencode")
100
+ const target = path.join(__dirname, "bin", ".altimate-code")
113
101
  if (fs.existsSync(target)) fs.unlinkSync(target)
114
102
  try {
115
103
  fs.linkSync(binaryPath, target)
@@ -118,7 +106,7 @@ async function main() {
118
106
  }
119
107
  fs.chmodSync(target, 0o755)
120
108
  } catch (error) {
121
- console.error("Failed to setup opencode binary:", error.message)
109
+ console.error("Failed to setup altimate-code binary:", error.message)
122
110
  process.exit(1)
123
111
  }
124
112
  }