machine-bridge-mcp 0.18.0 → 0.18.1

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
+ ## 0.18.1 - 2026-07-14
4
+
5
+ ### Fixed
6
+
7
+ - Wait for launchd service state to converge after a successful `bootout` before deciding that stop or restart failed. The bounded poll handles macOS's asynchronous unload window while still failing closed when the service remains active.
8
+ - Add deterministic coverage for delayed launchd inactivity and for the bounded failure path.
9
+
3
10
  ## 0.18.0 - 2026-07-14
4
11
 
5
12
  ### Isolated multi-account authorization
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Machine Bridge Browser",
4
- "version": "0.18.0",
4
+ "version": "0.18.1",
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": "0.18.0"
33
+ "version_name": "0.18.1"
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "machine-bridge-mcp",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
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",
@@ -0,0 +1,20 @@
1
+ const DEFAULT_ATTEMPTS = 20;
2
+ const DEFAULT_DELAY_MS = 100;
3
+
4
+ export async function waitForInactiveStatus(
5
+ readStatus,
6
+ { attempts = DEFAULT_ATTEMPTS, delayMs = DEFAULT_DELAY_MS, sleep = delay } = {},
7
+ ) {
8
+ if (typeof readStatus !== "function") throw new TypeError("readStatus must be a function");
9
+ const maximum = Number.isInteger(attempts) && attempts > 0 ? attempts : DEFAULT_ATTEMPTS;
10
+ let status = await readStatus();
11
+ for (let attempt = 1; status?.active === true && attempt < maximum; attempt += 1) {
12
+ await sleep(delayMs);
13
+ status = await readStatus();
14
+ }
15
+ return status;
16
+ }
17
+
18
+ function delay(milliseconds) {
19
+ return new Promise(resolve => setTimeout(resolve, milliseconds));
20
+ }
@@ -5,6 +5,7 @@ import { run } from "./shell.mjs";
5
5
  import { ensureOwnerOnlyDir, expandHome, ownerOnlyFile } from "./state.mjs";
6
6
  import { replaceFileAtomicallySync } from "./exclusive-file.mjs";
7
7
  import { readBoundedRegularFileSync } from "./secure-file.mjs";
8
+ import { waitForInactiveStatus } from "./service-convergence.mjs";
8
9
 
9
10
  const LABEL = "dev.machine-bridge-mcp.daemon";
10
11
  const WINDOWS_TASK = "MachineBridgeMCP";
@@ -299,9 +300,10 @@ async function stopLaunchd(logger) {
299
300
  const byPlist = byServiceTarget.code === 0
300
301
  ? null
301
302
  : await serviceRun("launchctl", ["bootout", domainTarget, plistPath]);
302
- const after = await statusLaunchd();
303
+ const after = await waitForInactiveStatus(statusLaunchd);
303
304
  const rawResult = byPlist || byServiceTarget;
304
- const ok = !after.active;
305
+ const active = after?.active !== false;
306
+ const ok = !active;
305
307
  if (ok) logger.info?.("launchd service stopped");
306
308
  else logger.warn?.("launchd service is still active after the stop request");
307
309
  return {
@@ -310,7 +312,7 @@ async function stopLaunchd(logger) {
310
312
  provider: "launchd",
311
313
  installed: existsSync(plistPath),
312
314
  active_before: true,
313
- active: after.active,
315
+ active,
314
316
  already_stopped: false,
315
317
  code: ok ? 0 : rawResult.code,
316
318
  bootout_service_target: byServiceTarget,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./http";
21
21
 
22
22
  const SERVER_NAME = String(serverMetadata.name);
23
- const SERVER_VERSION = "0.18.0";
23
+ const SERVER_VERSION = "0.18.1";
24
24
  const MCP_PROTOCOL_VERSION = String(serverMetadata.protocolVersion);
25
25
  const MCP_SUPPORTED_PROTOCOL_VERSIONS = serverMetadata.supportedProtocolVersions.map((value) => String(value));
26
26
  const JSONRPC_VERSION = "2.0";