@actions-json/bridge 0.1.118 → 0.1.120

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/lib/install.js CHANGED
@@ -5,12 +5,15 @@ const path = require('node:path');
5
5
  const os = require('node:os');
6
6
  const https = require('node:https');
7
7
  const { execFileSync } = require('node:child_process');
8
- const { assetSlug, downloadUrl, BINARY_NAME } = require('./platform');
8
+ const { assetSlug, downloadUrl, binaryName } = require('./platform');
9
9
 
10
- // Resolve the package version (used to pick the matching release).
10
+ // The bridge binary version to download. This is pinned separately from the
11
+ // package version so the wrapper can ship changes (e.g. the bundled dictionary)
12
+ // without rebuilding identical bridge binaries. Falls back to the package
13
+ // version if the pin isn't set.
11
14
  function packageVersion() {
12
15
  const pkg = require('../package.json');
13
- return pkg.version;
16
+ return pkg.bridgeBinaryVersion || pkg.version;
14
17
  }
15
18
 
16
19
  // Where we cache the downloaded binary: alongside the package, keyed by version
@@ -20,7 +23,7 @@ function binaryDir(version, slug) {
20
23
  }
21
24
 
22
25
  function binaryPath(version, slug) {
23
- return path.join(binaryDir(version, slug), BINARY_NAME);
26
+ return path.join(binaryDir(version, slug), binaryName(slug));
24
27
  }
25
28
 
26
29
  function follow(url, redirectsLeft, cb) {
@@ -70,11 +73,13 @@ function download(version, slug) {
70
73
  out.close(() => {
71
74
  try {
72
75
  // Extract just the binary from the tarball into dir.
73
- execFileSync('tar', ['-xzf', tmpTar, '-C', dir, BINARY_NAME], {
76
+ execFileSync('tar', ['-xzf', tmpTar, '-C', dir, binaryName(slug)], {
74
77
  stdio: 'inherit',
75
78
  });
76
79
  const bin = binaryPath(version, slug);
77
- fs.chmodSync(bin, 0o755);
80
+ if (process.platform !== 'win32') {
81
+ fs.chmodSync(bin, 0o755);
82
+ }
78
83
  fs.rmSync(tmpTar, { force: true });
79
84
  resolve(bin);
80
85
  } catch (e) {
package/lib/platform.js CHANGED
@@ -1,35 +1,46 @@
1
1
  'use strict';
2
2
 
3
3
  // Maps the current Node process platform/arch to the release asset slug used by
4
- // scripts/package-mcp-bridge.sh (e.g. "linux-x64"). Returns null for platforms
5
- // that have no prebuilt binary yet, so the CLI can fall back to a clear
4
+ // scripts/package-mcp-bridge.sh (e.g. "macos-arm64"). Returns null for
5
+ // platforms with no prebuilt binary, so the CLI can fall back to a clear
6
6
  // build-from-source message instead of downloading the wrong file.
7
7
 
8
+ // Node `${process.platform}-${process.arch}` -> release slug.
8
9
  const SUPPORTED = {
9
10
  'linux-x64': 'linux-x64',
11
+ 'darwin-x64': 'macos-x64',
12
+ 'darwin-arm64': 'macos-arm64',
13
+ 'win32-x64': 'win-x64',
10
14
  };
11
15
 
12
16
  function assetSlug(platform, arch) {
13
- const key = `${platform}-${arch}`;
14
- // Node arch "x64" matches the release slug; map the few aliases we care about.
15
- const normalized = key
16
- .replace('linux-x64', 'linux-x64')
17
- .replace('linux-amd64', 'linux-x64');
18
- return SUPPORTED[normalized] || null;
17
+ return SUPPORTED[`${platform}-${arch}`] || null;
19
18
  }
20
19
 
21
- // The binary name inside the tarball.
22
- const BINARY_NAME = 'actions-json-mcp';
20
+ // Base binary name; Windows builds carry a .exe suffix inside the tarball.
21
+ const BINARY_BASE = 'actions-json-mcp';
23
22
 
24
- // Build the release asset filename for a version + slug.
23
+ function binaryName(slug) {
24
+ return slug && slug.startsWith('win-') ? `${BINARY_BASE}.exe` : BINARY_BASE;
25
+ }
26
+
27
+ // Release asset filename for a version + slug. Every platform ships a .tar.gz
28
+ // (tar is available on the Windows runner and Node extracts it the same way).
25
29
  function assetFileName(version, slug) {
26
- return `${BINARY_NAME}-${version}-${slug}.tar.gz`;
30
+ return `${BINARY_BASE}-${version}-${slug}.tar.gz`;
27
31
  }
28
32
 
29
- // Build the GitHub release download URL for a given version tag + asset.
33
+ // GitHub release download URL for a version tag + asset.
30
34
  function downloadUrl(version, slug) {
31
35
  const file = assetFileName(version, slug);
32
36
  return `https://github.com/yaniv256/actions.json/releases/download/extension-v${version}/${file}`;
33
37
  }
34
38
 
35
- module.exports = { assetSlug, assetFileName, downloadUrl, BINARY_NAME, SUPPORTED };
39
+ module.exports = {
40
+ assetSlug,
41
+ assetFileName,
42
+ downloadUrl,
43
+ binaryName,
44
+ BINARY_BASE,
45
+ SUPPORTED,
46
+ };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@actions-json/bridge",
3
- "version": "0.1.118",
4
- "description": "Run the actions.json MCP bridge with npx — no Rust toolchain required. Downloads the prebuilt actions-json-mcp binary for your platform and runs it.",
3
+ "version": "0.1.120",
4
+ "bridgeBinaryVersion": "0.1.119",
5
+ "description": "Run the actions.json MCP bridge with npx — no Rust toolchain required. Downloads the prebuilt actions-json-mcp binary for your platform, bundles the primitive dictionary, and runs it.",
5
6
  "license": "MIT",
6
7
  "repository": {
7
8
  "type": "git",
@@ -15,6 +16,7 @@
15
16
  "files": [
16
17
  "bin/",
17
18
  "lib/",
19
+ "dictionary/",
18
20
  "README.md"
19
21
  ],
20
22
  "engines": {