@xcanwin/manyoyo 8.1.0 → 8.2.0

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
@@ -71,7 +71,7 @@ manyoyo run -y c # 在沙箱里以 YOLO 模式启动 Claude Code
71
71
 
72
72
  ## 安全须知
73
73
 
74
- MANYOYO 降低风险,但不是“绝对安全”:主要隔离手段是容器而不是虚拟机;`YOLO / SOLO` 仍可能执行危险命令;`sock` 模式会暴露宿主机 Docker socket;对外监听必须设强密码。详见[安全须知](https://xcanwin.github.io/manyoyo/reference/container-modes)。
74
+ MANYOYO 降低风险,但不是“绝对安全”:主要隔离手段是容器而不是虚拟机;`YOLO / SOLO` 仍可能执行危险命令;`sock` 模式会暴露宿主机 Docker socket;对外监听必须设强密码。详见[安全须知](https://xcanwin.github.io/manyoyo/guide/security)。
75
75
 
76
76
  ## 文档
77
77
 
package/bin/manyoyo.js CHANGED
@@ -895,7 +895,7 @@ async function updateOfflineInstall(mode, options, globalConfig) {
895
895
 
896
896
  // Podman / VM 磁盘有变化只提示(需要新的完整包)
897
897
  const runtimeHint = appUpdate.describeRuntimeChange(appUpdate.readInstalledRecord(os.homedir()), result.manifest.runtime);
898
- if (runtimeHint) console.log(`${YELLOW}ℹ️ ${runtimeHint}${NC}`);
898
+ if (runtimeHint && appUpdate.markRuntimeHintShown(os.homedir(), result.manifest.runtime)) console.log(`${YELLOW}ℹ️ ${runtimeHint}${NC}`);
899
899
 
900
900
  // 新版本要求的镜像不存在就拉取;仍用旧镜像的容器只列出来,不动
901
901
  const imageName = String(globalConfig.imageName || 'ghcr.io/xcanwin/manyoyo');
package/lib/app-update.js CHANGED
@@ -275,6 +275,27 @@ function describeRuntimeChange(installed, remoteRuntime) {
275
275
  return `新版本捆绑的运行环境有变化(${parts.join(',')})。本次只升级了 manyoyo 本体;要换 Podman / 虚拟机,请下载新的完整安装包重新安装。`;
276
276
  }
277
277
 
278
+ /**
279
+ * 同一份新运行环境的提示只显示一次(每次 update 都重复提示只是噪音):
280
+ * 记下已提示过的 runtime(~/.manyoyo/.install/runtime-hint.json),返回这次是否应该显示。
281
+ */
282
+ function markRuntimeHintShown(homeDir, runtime) {
283
+ const file = path.join(homeDir, '.manyoyo', '.install', 'runtime-hint.json');
284
+ const key = JSON.stringify({ podmanVersion: runtime && runtime.podmanVersion || '', vmDiskSha256: runtime && runtime.vmDiskSha256 || '' });
285
+ try {
286
+ if (fs.readFileSync(file, 'utf-8').trim() === key) return false;
287
+ } catch (error) {
288
+ // 没有记录或记录损坏:当作没提示过
289
+ }
290
+ try {
291
+ fs.mkdirSync(path.dirname(file), { recursive: true });
292
+ fs.writeFileSync(file, `${key}\n`);
293
+ } catch (error) {
294
+ // 记录写不进去不影响升级,最多下次再提示一次
295
+ }
296
+ return true;
297
+ }
298
+
278
299
  function readInstalledRecord(homeDir) {
279
300
  try {
280
301
  return JSON.parse(fs.readFileSync(path.join(homeDir, '.manyoyo', '.install', 'installed.json'), 'utf-8'));
@@ -316,6 +337,7 @@ module.exports = {
316
337
  rollbackApp,
317
338
  currentVersion,
318
339
  describeRuntimeChange,
340
+ markRuntimeHintShown,
319
341
  readInstalledRecord,
320
342
  findOutdatedContainers,
321
343
  fetchText,