codo-ai 2.23.5 → 2.23.6

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/codo.exe CHANGED
File without changes
Binary file
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
- {
2
- "os": [
3
- "darwin",
4
- "linux",
5
- "win32"
6
- ],
7
- "name": "codo-ai",
8
- "scripts": {
9
- "postinstall": "node ./postinstall.mjs"
10
- },
11
- "cpu": [
12
- "arm64",
13
- "x64"
14
- ],
15
- "bin": {
16
- "codo": "./bin/codo.exe"
17
- },
18
- "license": "MIT",
19
- "version": "2.23.5",
20
- "optionalDependencies": {
21
- "@codo-ai/codo-linux-x64": "2.23.5",
22
- "@codo-ai/codo-darwin-x64-baseline": "2.23.5",
23
- "@codo-ai/codo-darwin-x64": "2.23.5",
24
- "@codo-ai/codo-linux-x64-baseline": "2.23.5",
25
- "@codo-ai/codo-linux-arm64-musl": "2.23.5",
26
- "@codo-ai/codo-linux-x64-baseline-musl": "2.23.5",
27
- "@codo-ai/codo-windows-x64": "2.23.5",
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",
31
- "@codo-ai/codo-darwin-arm64": "2.23.5",
32
- "@codo-ai/codo-linux-arm64": "2.23.5"
33
- }
34
- }
1
+ {
2
+ "os": [
3
+ "darwin",
4
+ "linux",
5
+ "win32"
6
+ ],
7
+ "name": "codo-ai",
8
+ "scripts": {
9
+ "postinstall": "node ./postinstall.mjs"
10
+ },
11
+ "cpu": [
12
+ "arm64",
13
+ "x64"
14
+ ],
15
+ "bin": {
16
+ "codo": "./bin/codo.exe"
17
+ },
18
+ "license": "MIT",
19
+ "version": "2.23.6",
20
+ "optionalDependencies": {
21
+ "@codo-ai/codo-linux-x64": "2.23.5",
22
+ "@codo-ai/codo-darwin-x64-baseline": "2.23.5",
23
+ "@codo-ai/codo-darwin-x64": "2.23.5",
24
+ "@codo-ai/codo-linux-x64-baseline": "2.23.5",
25
+ "@codo-ai/codo-linux-arm64-musl": "2.23.5",
26
+ "@codo-ai/codo-linux-x64-baseline-musl": "2.23.5",
27
+ "@codo-ai/codo-windows-x64": "2.23.5",
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",
31
+ "@codo-ai/codo-darwin-arm64": "2.23.5",
32
+ "@codo-ai/codo-linux-arm64": "2.23.5"
33
+ }
34
+ }
package/postinstall.mjs CHANGED
@@ -116,11 +116,23 @@ function packageNames() {
116
116
  return [base]
117
117
  }
118
118
 
119
+ // Published packages may name the binary exactly ("codo.exe" / "codo") or with
120
+ // a version suffix ("codo-2.23.5.exe"), so resolve by pattern rather than by
121
+ // a single hardcoded filename.
122
+ function findBinary(dir) {
123
+ const entries = fs.readdirSync(path.join(dir, "bin"))
124
+ const match =
125
+ entries.find((entry) => entry === sourceBinary) ??
126
+ (platform === "windows"
127
+ ? entries.find((entry) => entry.startsWith("codo") && entry.endsWith(".exe"))
128
+ : undefined) ??
129
+ entries.find((entry) => entry.startsWith("codo"))
130
+ if (!match) throw new Error(`Binary not found in ${path.join(dir, "bin")}`)
131
+ return path.join(dir, "bin", match)
132
+ }
133
+
119
134
  function resolveBinary(name) {
120
- const packageJsonPath = require.resolve(`${name}/package.json`)
121
- const binaryPath = path.join(path.dirname(packageJsonPath), "bin", sourceBinary)
122
- if (!fs.existsSync(binaryPath)) throw new Error(`Binary not found at ${binaryPath}`)
123
- return binaryPath
135
+ return findBinary(path.dirname(require.resolve(`${name}/package.json`)))
124
136
  }
125
137
 
126
138
  function installPackage(name) {
@@ -136,7 +148,7 @@ function installPackage(name) {
136
148
  )
137
149
  if (result.status !== 0) return
138
150
  const packageDir = path.join(temp, "node_modules", name)
139
- copyBinary(path.join(packageDir, "bin", sourceBinary), targetBinary)
151
+ copyBinary(findBinary(packageDir), targetBinary)
140
152
  return true
141
153
  } finally {
142
154
  fs.rmSync(temp, { recursive: true, force: true })