@xcanwin/manyoyo 5.10.5 → 5.10.7

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/bin/manyoyo.js CHANGED
@@ -713,6 +713,32 @@ function showImagePullHint(err) {
713
713
  console.log(`${YELLOW} 你可以: (1) 更新 ~/.manyoyo/manyoyo.json 的 imageVersion。 (2) 或先执行 ${MANYOYO_NAME} build --iv <x.y.z-后缀> 构建镜像。${NC}`);
714
714
  }
715
715
 
716
+ function getCommandFailureText(err) {
717
+ const stderr = err && err.stderr ? err.stderr.toString() : '';
718
+ const stdout = err && err.stdout ? err.stdout.toString() : '';
719
+ const message = err && err.message ? err.message : '';
720
+ return `${message}\n${stderr}\n${stdout}`;
721
+ }
722
+
723
+ function getContainerRuntimeUnavailableHint(command, err) {
724
+ const text = getCommandFailureText(err);
725
+ if (/Cannot connect to Podman|unable to connect to Podman socket|podman machine start|podman system connection/i.test(text)) {
726
+ return [
727
+ '',
728
+ `提示: 当前 ${command} 命令正在连接 Podman machine,但连接不可用。`,
729
+ '请先在宿主机执行: podman machine start'
730
+ ].join('\n');
731
+ }
732
+ if (/Cannot connect to the Docker daemon|docker daemon is not running|Is the docker daemon running/i.test(text)) {
733
+ return [
734
+ '',
735
+ `提示: 当前 ${command} 命令无法连接容器运行时。`,
736
+ '请先启动 Docker Desktop / Docker daemon,或确认 Podman machine 已启动。'
737
+ ].join('\n');
738
+ }
739
+ return '';
740
+ }
741
+
716
742
  function runCmd(cmd, args, options = {}) {
717
743
  const result = spawnSync(cmd, args, { encoding: 'utf-8', ...options });
718
744
  if (result.error) {
@@ -732,7 +758,15 @@ function runCmd(cmd, args, options = {}) {
732
758
  }
733
759
 
734
760
  function dockerExecArgs(args, options = {}) {
735
- return runCmd(DOCKER_CMD, args, options);
761
+ try {
762
+ return runCmd(DOCKER_CMD, args, options);
763
+ } catch (e) {
764
+ const hint = getContainerRuntimeUnavailableHint(DOCKER_CMD, e);
765
+ if (hint && e && e.message && !e.message.includes(hint)) {
766
+ e.message = `${e.message}${hint}`;
767
+ }
768
+ throw e;
769
+ }
736
770
  }
737
771
 
738
772
  function containerExists(name) {
@@ -41,5 +41,5 @@ echo "[manyoyo] Agent CLI versions after update:"
41
41
  print_agent_versions
42
42
 
43
43
  npm_config_update_notifier=false npm cache clean --force --loglevel=error
44
- rm -rf /tmp/* /var/tmp/* /var/log/apt /var/log/*.log /var/lib/apt/lists/* ~/.npm ~/.cache/node-gyp ~/.claude/plugins/cache ~/go/pkg/mod/cache
44
+ rm -rf /tmp/* /tmp/.[!.]* /tmp/..?* /var/tmp/* /var/tmp/.[!.]* /var/tmp/..?* /var/log/apt /var/log/*.log /var/lib/apt/lists/* ~/.npm ~/.cache/node-gyp ~/.claude/plugins/cache ~/go/pkg/mod/cache
45
45
  rm -f /var/log/dpkg.log /var/log/bootstrap.log /var/lib/dpkg/status-old /var/cache/debconf/templates.dat-old
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcanwin/manyoyo",
3
- "version": "5.10.5",
3
+ "version": "5.10.7",
4
4
  "imageVersion": "1.9.0-common",
5
5
  "playwrightCliVersion": "0.1.1",
6
6
  "description": "AI Agent CLI Security Sandbox for Docker and Podman",