@actions-json/bridge 0.1.118 → 0.1.119

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/README.md CHANGED
@@ -42,8 +42,9 @@ See [Getting Started](https://yaniv256.github.io/actions.json/getting-started.ht
42
42
 
43
43
  ## Platforms
44
44
 
45
- Prebuilt binaries are published for **linux-x64**. On other platforms the wrapper
46
- prints build-from-source instructions (clone the repo and
45
+ Prebuilt binaries are published for **linux-x64**, **macos-x64**,
46
+ **macos-arm64**, and **win-x64**. On any other platform/arch the wrapper prints
47
+ build-from-source instructions (clone the repo and
47
48
  `cargo build --release --manifest-path mcp/actions-json-mcp/Cargo.toml`).
48
49
 
49
50
  ## How it works
package/lib/install.js CHANGED
@@ -5,7 +5,7 @@ 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
10
  // Resolve the package version (used to pick the matching release).
11
11
  function packageVersion() {
@@ -20,7 +20,7 @@ function binaryDir(version, slug) {
20
20
  }
21
21
 
22
22
  function binaryPath(version, slug) {
23
- return path.join(binaryDir(version, slug), BINARY_NAME);
23
+ return path.join(binaryDir(version, slug), binaryName(slug));
24
24
  }
25
25
 
26
26
  function follow(url, redirectsLeft, cb) {
@@ -70,11 +70,13 @@ function download(version, slug) {
70
70
  out.close(() => {
71
71
  try {
72
72
  // Extract just the binary from the tarball into dir.
73
- execFileSync('tar', ['-xzf', tmpTar, '-C', dir, BINARY_NAME], {
73
+ execFileSync('tar', ['-xzf', tmpTar, '-C', dir, binaryName(slug)], {
74
74
  stdio: 'inherit',
75
75
  });
76
76
  const bin = binaryPath(version, slug);
77
- fs.chmodSync(bin, 0o755);
77
+ if (process.platform !== 'win32') {
78
+ fs.chmodSync(bin, 0o755);
79
+ }
78
80
  fs.rmSync(tmpTar, { force: true });
79
81
  resolve(bin);
80
82
  } 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@actions-json/bridge",
3
- "version": "0.1.118",
3
+ "version": "0.1.119",
4
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.",
5
5
  "license": "MIT",
6
6
  "repository": {