codev-code 1.18.4-10 → 1.18.4-11

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 +13 -13
  2. package/postinstall.mjs +25 -2
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "scripts": {
8
8
  "postinstall": "node ./postinstall.mjs"
9
9
  },
10
- "version": "1.18.4-10",
10
+ "version": "1.18.4-11",
11
11
  "license": "MIT",
12
12
  "os": [
13
13
  "darwin",
@@ -19,17 +19,17 @@
19
19
  "x64"
20
20
  ],
21
21
  "optionalDependencies": {
22
- "codev-code-darwin-arm64": "1.18.4-10",
23
- "codev-code-darwin-x64-baseline": "1.18.4-10",
24
- "codev-code-windows-x64": "1.18.4-10",
25
- "codev-code-linux-arm64": "1.18.4-10",
26
- "codev-code-windows-x64-baseline": "1.18.4-10",
27
- "codev-code-linux-x64-musl": "1.18.4-10",
28
- "codev-code-linux-x64-baseline": "1.18.4-10",
29
- "codev-code-linux-x64": "1.18.4-10",
30
- "codev-code-darwin-x64": "1.18.4-10",
31
- "codev-code-windows-arm64": "1.18.4-10",
32
- "codev-code-linux-x64-baseline-musl": "1.18.4-10",
33
- "codev-code-linux-arm64-musl": "1.18.4-10"
22
+ "codev-code-darwin-arm64": "1.18.4-11",
23
+ "codev-code-darwin-x64-baseline": "1.18.4-11",
24
+ "codev-code-windows-x64": "1.18.4-11",
25
+ "codev-code-linux-arm64": "1.18.4-11",
26
+ "codev-code-windows-x64-baseline": "1.18.4-11",
27
+ "codev-code-linux-x64-musl": "1.18.4-11",
28
+ "codev-code-linux-x64-baseline": "1.18.4-11",
29
+ "codev-code-linux-x64": "1.18.4-11",
30
+ "codev-code-darwin-x64": "1.18.4-11",
31
+ "codev-code-windows-arm64": "1.18.4-11",
32
+ "codev-code-linux-x64-baseline-musl": "1.18.4-11",
33
+ "codev-code-linux-arm64-musl": "1.18.4-11"
34
34
  }
35
35
  }
package/postinstall.mjs CHANGED
@@ -139,12 +139,31 @@ function installPackage(name) {
139
139
  if (result.status !== 0) return
140
140
  const packageDir = path.join(temp, "node_modules", name)
141
141
  copyBinary(path.join(packageDir, "bin", sourceBinary), targetBinary)
142
+ // Before the finally deletes temp — the bundled rg lives in the same package.
143
+ copyRipgrep(packageDir)
142
144
  return true
143
145
  } finally {
144
146
  fs.rmSync(temp, { recursive: true, force: true })
145
147
  }
146
148
  }
147
149
 
150
+ // Fork: the Windows platform packages bundle ripgrep (staged by
151
+ // script/build.ts) — fff is disabled on win32, so file search and `@`
152
+ // mentions there depend on rg, and the agent's own GitHub download fallback
153
+ // is what corporate networks block. Best-effort: a missing or uncopyable
154
+ // rg.exe must never fail the install — the agent still resolves rg via PATH,
155
+ // its cache, or download at runtime.
156
+ function copyRipgrep(packageDir) {
157
+ if (platform !== "windows") return
158
+ const source = path.join(packageDir, "bin", "rg.exe")
159
+ if (!fs.existsSync(source)) return
160
+ try {
161
+ copyBinary(source, path.join(__dirname, "bin", "rg.exe"))
162
+ } catch {
163
+ // Ignore — best-effort only.
164
+ }
165
+ }
166
+
148
167
  function copyBinary(source, target) {
149
168
  if (!fs.existsSync(source)) throw new Error(`Binary not found at ${source}`)
150
169
  fs.mkdirSync(path.dirname(target), { recursive: true })
@@ -169,8 +188,12 @@ function verifyBinary() {
169
188
  function main() {
170
189
  for (const name of packageNames()) {
171
190
  try {
172
- copyBinary(resolveBinary(name), targetBinary)
173
- if (verifyBinary()) return
191
+ const binary = resolveBinary(name)
192
+ copyBinary(binary, targetBinary)
193
+ if (verifyBinary()) {
194
+ copyRipgrep(path.dirname(path.dirname(binary)))
195
+ return
196
+ }
174
197
  } catch {
175
198
  if (installPackage(name) && verifyBinary()) return
176
199
  }