codo-ai 2.23.6 → 2.23.8

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/package.json +4 -4
  2. package/postinstall.mjs +9 -5
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "codo": "./bin/codo.exe"
17
17
  },
18
18
  "license": "MIT",
19
- "version": "2.23.6",
19
+ "version": "2.23.8",
20
20
  "optionalDependencies": {
21
21
  "@codo-ai/codo-linux-x64": "2.23.5",
22
22
  "@codo-ai/codo-darwin-x64-baseline": "2.23.5",
@@ -24,10 +24,10 @@
24
24
  "@codo-ai/codo-linux-x64-baseline": "2.23.5",
25
25
  "@codo-ai/codo-linux-arm64-musl": "2.23.5",
26
26
  "@codo-ai/codo-linux-x64-baseline-musl": "2.23.5",
27
- "@codo-ai/codo-windows-x64": "2.23.5",
27
+ "@codo-ai/codo-windows-x64": "2.23.6",
28
28
  "@codo-ai/codo-linux-x64-musl": "2.23.5",
29
- "@codo-ai/codo-windows-x64-baseline": "2.23.5",
30
- "@codo-ai/codo-windows-arm64": "2.23.5",
29
+ "@codo-ai/codo-windows-x64-baseline": "2.23.6",
30
+ "@codo-ai/codo-windows-arm64": "2.23.6",
31
31
  "@codo-ai/codo-darwin-arm64": "2.23.5",
32
32
  "@codo-ai/codo-linux-arm64": "2.23.5"
33
33
  }
package/postinstall.mjs CHANGED
@@ -131,23 +131,27 @@ function findBinary(dir) {
131
131
  return path.join(dir, "bin", match)
132
132
  }
133
133
 
134
+ // Platform binaries live in scoped packages (@codo-ai/codo-<platform>-<arch>),
135
+ // while packageNames() works with the unscoped suffix.
136
+ const scope = "@codo-ai/"
137
+
134
138
  function resolveBinary(name) {
135
- return findBinary(path.dirname(require.resolve(`${name}/package.json`)))
139
+ return findBinary(path.dirname(require.resolve(`${scope}${name}/package.json`)))
136
140
  }
137
141
 
138
142
  function installPackage(name) {
139
- const version = packageJson.optionalDependencies?.[name]
143
+ const version = packageJson.optionalDependencies?.[`${scope}${name}`]
140
144
  if (!version) return
141
145
 
142
146
  const temp = fs.mkdtempSync(path.join(os.tmpdir(), "codo-install-"))
143
147
  try {
144
148
  const result = childProcess.spawnSync(
145
149
  "npm",
146
- ["install", "--ignore-scripts", "--no-save", "--loglevel=error", "--prefix", temp, `${name}@${version}`],
150
+ ["install", "--ignore-scripts", "--no-save", "--loglevel=error", "--prefix", temp, `${scope}${name}@${version}`],
147
151
  { stdio: "inherit", windowsHide: true },
148
152
  )
149
153
  if (result.status !== 0) return
150
- const packageDir = path.join(temp, "node_modules", name)
154
+ const packageDir = path.join(temp, "node_modules", scope, name)
151
155
  copyBinary(findBinary(packageDir), targetBinary)
152
156
  return true
153
157
  } finally {
@@ -188,7 +192,7 @@ function main() {
188
192
 
189
193
  throw new Error(
190
194
  `It seems your package manager failed to install the right codo CLI package. Try manually installing ${packageNames()
191
- .map((name) => JSON.stringify(name))
195
+ .map((name) => JSON.stringify(`@codo-ai/${name}`))
192
196
  .join(" or ")}.`,
193
197
  )
194
198
  }