machine-bridge-mcp 1.0.3 → 1.0.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.4 - 2026-07-14
4
+
5
+ ### Windows first-run workspace
6
+
7
+ - Keep the first interactive workspace question on Windows, but default it to `%USERPROFILE%\MachineBridge` instead of the Command Prompt current directory. Pressing Enter creates, canonicalizes, and remembers that folder, so users do not need `cd` or directory knowledge and an elevated prompt cannot accidentally select `C:\Windows\System32`.
8
+ - Preserve explicit `--workspace` semantics for automation, while allowing an interactively entered Windows workspace folder to be created when it does not yet exist. The installed zero-argument startup test now verifies the remembered platform default.
9
+
3
10
  ## 1.0.3 - 2026-07-14
4
11
 
5
12
  ### Code-scanning and supply-chain integrity
package/README.md CHANGED
@@ -97,7 +97,13 @@ npm install
97
97
 
98
98
  ## Remote MCP for ChatGPT
99
99
 
100
- Start the bridge from the project directory or select a workspace explicitly:
100
+ After a global installation, `machine-mcp` can be launched from any Command Prompt or terminal; the package installation directory is not the workspace. On the first interactive Windows start, the CLI asks:
101
+
102
+ ```text
103
+ Workspace folder [C:\Users\Alice\MachineBridge] (press Enter to use the default):
104
+ ```
105
+
106
+ Press Enter to create and remember `%USERPROFILE%\MachineBridge`. No `cd` command or directory selection is required. Enter another folder when desired; an interactively selected Windows folder is created if it does not yet exist. Later starts reuse the remembered workspace. Advanced users and automation may still select an existing workspace explicitly:
101
107
 
102
108
  ```sh
103
109
  machine-mcp --workspace /path/to/project
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Machine Bridge Browser",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "description": "Connects the current Chromium browser profile to the local Machine Bridge runtime for user-authorized automation.",
6
6
  "permissions": [
7
7
  "tabs",
@@ -30,5 +30,5 @@
30
30
  "action": {
31
31
  "default_title": "Machine Bridge Browser"
32
32
  },
33
- "version_name": "1.0.3"
33
+ "version_name": "1.0.4"
34
34
  }
@@ -19,6 +19,7 @@ No transport is treated as a sandbox. Both transports invoke the same local runt
19
19
  ### CLI and state layer
20
20
 
21
21
  The CLI canonicalizes workspaces, resolves policy profiles, maintains per-workspace state and credentials, serializes startup/deploy/rotation with process-identity locks, deploys the Worker, installs optional platform-native autostart, and starts either remote daemon or stdio mode.
22
+ On a first interactive Windows start, workspace selection remains explicit but offers `%USERPROFILE%\MachineBridge` as a dedicated default; accepting it creates and remembers the folder instead of inheriting the shell current directory. Non-Windows interactive starts retain the current-directory default, and explicit `--workspace` paths remain strict existing-path inputs.
22
23
 
23
24
  A canonical workspace receives an independent profile, Worker name, secret set, resource registry, managed-job directory, daemon/startup locks, and state file. State schema version 6 records named accounts, policy origin/revision, and local resource metadata in addition to the capability fields. `exclusive-file.mjs` owns complete-before-visible exclusive claims and flushed atomic replacement. `process-identity.mjs` owns PID liveness, process start-time comparison, bounded command-line inspection, and PID-reuse classification. `service-lifecycle.mjs` owns the fail-closed stop-daemons-before-remove state machine shared by service removal and full uninstall.
24
25
 
@@ -99,6 +99,8 @@ machine-mcp --verbose
99
99
 
100
100
  `Unknown cli config "--allow-scripts"` proves the package installation ran under npm 11 or older. `Invalid property "node"` or `Invalid property "devEngines.node"` means npm parsed an outdated `devEngines` object; inspect the npm debug log to identify its source rather than assuming it belongs to Machine Bridge. The published package declares both Node.js 26 and npm 12 in `engines`, and `machine-mcp doctor` checks both active versions. Keep `--omit=optional` in the install command. Without it npm may resolve optional `fsevents` and warn that its install script was not included in `allowScripts`; Machine Bridge does not require that development-time watcher at runtime.
101
101
 
102
+ After global installation, Windows users may open any `cmd.exe` window and run `machine-mcp`; they do not need to navigate to a project or package directory. On the first interactive start, the CLI asks for a workspace folder and displays `%USERPROFILE%\MachineBridge` as the default. Pressing Enter creates and remembers that folder. This avoids inheriting an arbitrary Command Prompt current directory such as `C:\Windows\System32`. Typing another folder in the prompt creates that folder when necessary. Explicit `--workspace PATH` remains a strict automation interface and requires an existing path.
103
+
102
104
  ## Version 1 upgrade convergence
103
105
 
104
106
  Version 1 advertises only MCP protocol `2025-11-25`. Upgrade the MCP client/host if it cannot negotiate that version; Machine Bridge does not retain an obsolete protocol dispatcher. The current local state schema is unchanged from the final 0.18.x release, so do not delete the state root merely to upgrade.
package/docs/TESTING.md CHANGED
@@ -89,7 +89,7 @@ npm run version:check
89
89
  npm run release-impact:check
90
90
  ```
91
91
 
92
- GitHub Actions executes the main suite on Linux, macOS, and Windows using the pinned Node 26/npm 12 baseline. Because Node 26 currently bundles npm 11, CI downloads the exact npm 12.0.1 tarball from the canonical registry, rejects redirects, verifies its recorded SHA-512 SRI, and exposes that verified CLI through `GITHUB_PATH` before any project-local npm command can trigger strict `devEngines`. Checkout fetches version tags so the release-impact gate can compare the branch with the latest release. A separate package-audit job scans reachable Git history, audits both the complete dependency graph and the production-only graph, verifies registry signatures and attestations, validates a CycloneDX SBOM written under the runner temporary directory, exercises the documented isolated global installation, then performs a dry-run package build. Separate pinned workflows validate governance titles, review dependency changes, run CodeQL over JavaScript/TypeScript and GitHub Actions, and run OpenSSF Scorecard. The SARIF gate fails closed when rule metadata is absent, CodeQL permits only one exact, expiring non-shell process-boundary result, and Scorecard permits only exact reviewed governance/time-dependent findings; new dependency-pinning, fuzzing, or other supply-chain results fail before upload. Scorecard's signed analysis job contains only pinned `uses` steps, while a dependent gate job downloads the SARIF, enforces the accepted inventory, and uploads it to code scanning. Security property tests use a `.js` `fast-check` suite with deterministic seeds because the pinned Scorecard scanner recognizes JavaScript property testing only in `*.js`/`*.jsx`. The macOS matrix job also runs the installation smoke test because Wrangler's optional `fsevents` resolution is platform-specific. Third-party Actions are pinned to immutable 40-character commit SHAs; architecture tests reject movable tags, and Dependabot monitors both action and dependency updates. Source release creation additionally requires successful push-triggered CI, CodeQL, Governance, and Scorecard runs for the exact `main` commit.
92
+ GitHub Actions executes the main suite on Linux, macOS, and Windows using the pinned Node 26/npm 12 baseline. Because Node 26 currently bundles npm 11, CI downloads the exact npm 12.0.1 tarball from the canonical registry, rejects redirects, verifies its recorded SHA-512 SRI, and exposes that verified CLI through `GITHUB_PATH` before any project-local npm command can trigger strict `devEngines`. Checkout fetches version tags so the release-impact gate can compare the branch with the latest release. A separate package-audit job scans reachable Git history, audits both the complete dependency graph and the production-only graph, verifies registry signatures and attestations, validates a CycloneDX SBOM written under the runner temporary directory, exercises the documented isolated global installation, then performs a dry-run package build. Separate pinned workflows validate governance titles, review dependency changes, run CodeQL over JavaScript/TypeScript and GitHub Actions, and run OpenSSF Scorecard. The SARIF gate fails closed when rule metadata is absent, CodeQL permits only one exact, expiring non-shell process-boundary result, and Scorecard permits only exact reviewed governance/time-dependent findings; new dependency-pinning, fuzzing, or other supply-chain results fail before upload. Scorecard's signed analysis job contains only pinned `uses` steps, while a dependent gate job downloads the SARIF, enforces the accepted inventory, and uploads it to code scanning. Security property tests use a `.js` `fast-check` suite with deterministic seeds because the pinned Scorecard scanner recognizes JavaScript property testing only in `*.js`/`*.jsx`. The installed zero-argument startup smoke test also verifies that Windows creates and remembers `%USERPROFILE%\MachineBridge` while other platforms retain the package-free current directory. The macOS matrix job also runs the installation smoke test because Wrangler's optional `fsevents` resolution is platform-specific. Third-party Actions are pinned to immutable 40-character commit SHAs; architecture tests reject movable tags, and Dependabot monitors both action and dependency updates. Source release creation additionally requires successful push-triggered CI, CodeQL, Governance, and Scorecard runs for the exact `main` commit.
93
93
 
94
94
  ## Test design rules
95
95
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "machine-bridge-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Cross-client MCP bridge for local agent context, structured browser and application automation, files, Git, processes, resources, and durable jobs over stdio or OAuth relay.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/local/cli.mjs CHANGED
@@ -26,8 +26,10 @@ import {
26
26
  acquireStartupLockWithWait,
27
27
  appName,
28
28
  daemonLockPathForState,
29
+ defaultFirstRunWorkspace,
29
30
  defaultStateRoot,
30
31
  ensureWorkerSecrets,
32
+ ensureWorkspaceDirectory,
31
33
  expandHome,
32
34
  loadGlobalConfig,
33
35
  loadState,
@@ -95,15 +97,19 @@ async function chooseWorkspace(args, { promptOnFirstRun, save, allowPositional =
95
97
  const remembered = selectedWorkspace(stateRoot);
96
98
  if (remembered) return resolveWorkspace(remembered);
97
99
 
98
- const fallback = process.cwd();
100
+ const fallback = promptOnFirstRun ? defaultFirstRunWorkspace() : process.cwd();
99
101
  if (!promptOnFirstRun || !process.stdin.isTTY) {
100
- const workspace = resolveWorkspace(fallback);
102
+ const workspace = promptOnFirstRun && process.platform === "win32"
103
+ ? ensureWorkspaceDirectory(fallback)
104
+ : resolveWorkspace(fallback);
101
105
  if (save) setSelectedWorkspace(workspace, stateRoot);
102
106
  return workspace;
103
107
  }
104
108
 
105
- const answer = await ask(`Workspace path [${fallback}]: `);
106
- const workspace = resolveWorkspace(answer.trim() || fallback);
109
+ const answer = await ask(`Workspace folder [${fallback}] (press Enter to use the default): `);
110
+ const workspace = process.platform === "win32"
111
+ ? ensureWorkspaceDirectory(answer.trim() || fallback)
112
+ : resolveWorkspace(answer.trim() || fallback);
107
113
  if (save) setSelectedWorkspace(workspace, stateRoot);
108
114
  return workspace;
109
115
  }
@@ -1,5 +1,5 @@
1
1
  import { createHash, randomBytes } from "node:crypto";
2
- import { existsSync, lstatSync, realpathSync, rmSync, unlinkSync, readdirSync, statSync } from "node:fs";
2
+ import { existsSync, lstatSync, mkdirSync, realpathSync, rmSync, unlinkSync, readdirSync, statSync } from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -35,6 +35,16 @@ export function resolveWorkspace(input = process.cwd()) {
35
35
  return realpathSync.native ? realpathSync.native(resolved) : realpathSync(resolved);
36
36
  }
37
37
 
38
+ export function defaultFirstRunWorkspace({ platform = process.platform, home = os.homedir(), cwd = process.cwd() } = {}) {
39
+ return path.resolve(platform === "win32" ? path.join(home, "MachineBridge") : cwd);
40
+ }
41
+
42
+ export function ensureWorkspaceDirectory(input) {
43
+ const requested = path.resolve(expandHome(input));
44
+ mkdirSync(requested, { recursive: true });
45
+ return resolveWorkspace(requested);
46
+ }
47
+
38
48
  export function defaultStateRoot() {
39
49
  if (process.platform === "win32") {
40
50
  const base = process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
@@ -22,7 +22,7 @@ import {
22
22
  } from "./http";
23
23
 
24
24
  const SERVER_NAME = String(serverMetadata.name);
25
- const SERVER_VERSION = "1.0.3";
25
+ const SERVER_VERSION = "1.0.4";
26
26
  const MCP_PROTOCOL_VERSION = String(serverMetadata.protocolVersion);
27
27
  const MCP_SUPPORTED_PROTOCOL_VERSIONS = serverMetadata.supportedProtocolVersions.map((value) => String(value));
28
28
  const JSONRPC_VERSION = "2.0";