freebuff 0.0.62 → 0.0.74

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/index.js +21 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -373,6 +373,27 @@ async function downloadBinary(version) {
373
373
  }
374
374
  fs.renameSync(tempBinaryPath, CONFIG.binaryPath)
375
375
 
376
+ // Move tree-sitter.wasm next to the binary if the tarball included
377
+ // it. The CLI binary loads this at startup; embedding it inside the
378
+ // binary itself was unreliable on Windows (bun --compile asset
379
+ // bundling silently dropped or unbound it across several attempts),
380
+ // so we ship it as a sibling file instead. Older artifacts that
381
+ // pre-date this change won't have the wasm and will still install —
382
+ // they'll just hit the same crash they had before, which is fine.
383
+ const tempWasmPath = path.join(CONFIG.tempDownloadDir, 'tree-sitter.wasm')
384
+ if (fs.existsSync(tempWasmPath)) {
385
+ const targetWasmPath = path.join(
386
+ path.dirname(CONFIG.binaryPath),
387
+ 'tree-sitter.wasm',
388
+ )
389
+ try {
390
+ if (fs.existsSync(targetWasmPath)) fs.unlinkSync(targetWasmPath)
391
+ } catch {
392
+ // best effort; rename below will surface the real error if it matters
393
+ }
394
+ fs.renameSync(tempWasmPath, targetWasmPath)
395
+ }
396
+
376
397
  fs.writeFileSync(
377
398
  CONFIG.metadataPath,
378
399
  JSON.stringify({ version }, null, 2),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freebuff",
3
- "version": "0.0.62",
3
+ "version": "0.0.74",
4
4
  "description": "The world's strongest free coding agent",
5
5
  "license": "MIT",
6
6
  "bin": {