mercury-agent 0.4.17 → 0.4.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mercury-agent",
3
- "version": "0.4.17",
3
+ "version": "0.4.19",
4
4
  "description": "Personal AI assistant for chat platforms (WhatsApp, Slack, Discord, Telegram)",
5
5
  "license": "MIT",
6
6
  "author": "Avishai Tsabari",
@@ -1,4 +1,4 @@
1
- import { execFileSync, execSync, spawn } from "node:child_process";
1
+ import { execFileSync, execSync, spawn, spawnSync } from "node:child_process";
2
2
  import { randomBytes } from "node:crypto";
3
3
  import fs from "node:fs";
4
4
  import path, { dirname } from "node:path";
@@ -389,12 +389,13 @@ let _isDockerDesktop: boolean | undefined;
389
389
  function isDockerDesktop(): boolean {
390
390
  if (_isDockerDesktop !== undefined) return _isDockerDesktop;
391
391
  try {
392
- const info = execFileSync("docker", ["info", "--format", "{{.Name}}"], {
392
+ const result = spawnSync("docker", ["info", "--format", "{{.Name}}"], {
393
393
  encoding: "utf8",
394
394
  timeout: 10_000,
395
395
  stdio: ["pipe", "pipe", "pipe"],
396
- }).trim();
397
- _isDockerDesktop = info === "docker-desktop";
396
+ });
397
+ const info = (result.stdout ?? "").trim();
398
+ _isDockerDesktop = result.status === 0 && info === "docker-desktop";
398
399
  } catch {
399
400
  _isDockerDesktop = false;
400
401
  }
@@ -951,10 +952,10 @@ export class AgentContainerRunner {
951
952
  "CONTAINER_RUNTIME=runsc",
952
953
  );
953
954
  } else if (this.config.containerBwrapDockerCompat || isDockerDesktop()) {
954
- // runc + bwrap: bubblewrap needs extra namespace syscalls that Docker's default
955
- // seccomp/caps/AppArmor block. seccomp=unconfined allows unshare; apparmor=unconfined
956
- // allows mount(MS_SLAVE); SYS_ADMIN grants the mount capability. Bwrap remains active
957
- // inside the container; only the outer Docker layer is relaxed.
955
+ logger.info("Enabling bwrap Docker compat (seccomp/apparmor/SYS_ADMIN)", {
956
+ configFlag: this.config.containerBwrapDockerCompat,
957
+ dockerDesktop: isDockerDesktop(),
958
+ });
958
959
  args.push(
959
960
  "--security-opt",
960
961
  "seccomp=unconfined",