@actions-json/bridge 0.1.119 → 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/README.md CHANGED
@@ -3,42 +3,33 @@
3
3
  Run the [actions.json](https://yaniv256.github.io/actions.json/) MCP bridge with
4
4
  `npx` — no Rust toolchain required. On first run this downloads the prebuilt
5
5
  `actions-json-mcp` binary for your platform from the GitHub release, caches it,
6
- and runs it with the arguments you pass.
6
+ and runs it. The primitive dictionary (browser-control tool catalog) is bundled,
7
+ so you don't pass `--actions`.
7
8
 
8
9
  ## Usage
9
10
 
10
11
  ```bash
11
- npx @actions-json/bridge mcp \
12
- --bind 0.0.0.0:17345 \
13
- --actions /abs/path/to/overlay.actions.json \
14
- --storage-root /abs/path/to/actions.json.storage
12
+ npx @actions-json/bridge mcp --storage-root /path/to/.storage
15
13
  ```
16
14
 
17
- Register it with a coding agent the same way — for Claude Code:
15
+ Register it with a coding agent — for Claude Code:
18
16
 
19
17
  ```bash
20
18
  claude mcp add actions-json -- \
21
- npx -y @actions-json/bridge mcp \
22
- --bind 0.0.0.0:17345 \
23
- --actions /abs/path/to/overlay.actions.json \
24
- --storage-root /abs/path/to/actions.json.storage
19
+ npx -y @actions-json/bridge mcp --storage-root /path/to/.storage
25
20
  ```
26
21
 
27
- For Codex (`~/.codex/config.toml`):
28
-
29
- ```toml
30
- [mcp_servers.actions-json]
31
- command = "npx"
32
- args = [
33
- "-y", "@actions-json/bridge", "mcp",
34
- "--bind", "0.0.0.0:17345",
35
- "--actions", "/abs/path/to/overlay.actions.json",
36
- "--storage-root", "/abs/path/to/actions.json.storage",
37
- ]
22
+ For Codex:
23
+
24
+ ```bash
25
+ codex mcp add actions-json -- \
26
+ npx -y @actions-json/bridge mcp --storage-root /path/to/.storage
38
27
  ```
39
28
 
40
- All arguments after the binary are passed straight through to `actions-json-mcp`.
41
- See [Getting Started](https://yaniv256.github.io/actions.json/getting-started.html).
29
+ All arguments after the binary pass straight through to `actions-json-mcp`. To
30
+ use a custom primitive dictionary, pass your own `--actions <file>` and the
31
+ bundled default is skipped. See
32
+ [Getting Started](https://yaniv256.github.io/actions.json/getting-started.html).
42
33
 
43
34
  ## Platforms
44
35
 
package/bin/cli.js CHANGED
@@ -4,11 +4,28 @@
4
4
  // Thin launcher: ensure the prebuilt actions-json-mcp binary is present
5
5
  // (downloading it on first run), then exec it with whatever args were passed.
6
6
  // Example:
7
- // npx @actions-json/bridge mcp --bind 0.0.0.0:17345 --actions ... --storage-root ...
7
+ // npx @actions-json/bridge mcp --storage-root .storage
8
8
 
9
+ const path = require('node:path');
9
10
  const { spawn } = require('node:child_process');
10
11
  const { ensureBinary } = require('../lib/install');
11
12
 
13
+ // The primitive dictionary (browser-control tool catalog) ships with this
14
+ // package — it's a fixed runtime file, not user config. When the caller runs a
15
+ // subcommand that needs it and didn't pass --actions, default to the bundled
16
+ // copy so users don't have to know its path.
17
+ const BUNDLED_ACTIONS = path.join(__dirname, '..', 'dictionary', 'overlay.actions.json');
18
+ const SUBCOMMANDS_NEEDING_ACTIONS = new Set(['mcp', 'serve']);
19
+
20
+ function withDefaultActions(args) {
21
+ const sub = args[0];
22
+ if (!SUBCOMMANDS_NEEDING_ACTIONS.has(sub)) return args;
23
+ if (args.includes('--actions')) return args;
24
+ if (args.includes('--help') || args.includes('-h')) return args;
25
+ // Insert right after the subcommand.
26
+ return [args[0], '--actions', BUNDLED_ACTIONS, ...args.slice(1)];
27
+ }
28
+
12
29
  async function main() {
13
30
  let bin;
14
31
  try {
@@ -19,7 +36,7 @@ async function main() {
19
36
  return;
20
37
  }
21
38
 
22
- const args = process.argv.slice(2);
39
+ const args = withDefaultActions(process.argv.slice(2));
23
40
  const child = spawn(bin, args, { stdio: 'inherit' });
24
41
 
25
42
  // Forward termination signals so the bridge shuts down cleanly.