Files
agent/local/start.command
T
kicer 8a5c8b1547 新增本地端(local 模式):同一份代码直接跑在本机,不起 Docker / executor
后端只改两处,都靠 env 开关,不设置时服务器行为与 v2.5.0 完全一致:
- server.js:支持 HOST,本地注入 127.0.0.1(不设仍是 0.0.0.0)
- tools/executor.js:AGENT_FILE_SCOPE=workspace 把文件工具的根从会话目录放宽到
  workspace_root,并关掉 /tmp 重定向(本地 terminal 写的是真 /tmp,重定向会造成
  AI 自己写的东西自己读不到);recordFile 跳过会话外文件,避免附件表存 ../ 路径。
  路由层、@历史会话、mint_public_link 仍按会话目录校验,不变。

新增 local/:start.sh(探测 → 首次生成配置 → 装依赖 → 起 core +4 个 MCP → 守护重启)、
start.command(mac 双击)、config.example.yml(参考)、README.md。
能力按需:node 必需,ffmpeg 决定语音(靠 ASR_URL 注入)、python3 决定技能(靠
.runtime/skills 软链切换),两者都不写进配置——配置首次生成后永不覆盖,避免冲掉
用户在网页里配的模型与密钥。

另加 docs/local-mode.md:设计决定、验证状态与 mac 上的逐项验证清单(含重启按钮
守护、/tmp 一致性两个关键项)。
2026-11-11 10:25:33 +08:00

18 lines
668 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# macOS 双击入口:在 Finder 里双击本文件,会用「终端」打开并执行 ../local/start.sh。
#
# 为什么不直接 exec:脚本失败时要留窗口给人看错误(双击启动的窗口默认一退出就关)。
# 为什么要补 PATH:双击启动的进程不继承登录 shell 的环境,Homebrew 装的 node/ffmpeg
# 常常不在默认 PATH 里(Apple Silicon 是 /opt/homebrew,Intel 是 /usr/local)。
cd "$(dirname "$0")/.." || exit 1
PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
export PATH
./local/start.sh
code=$?
if [ "$code" -ne 0 ] && [ -t 0 ]; then
printf '\n按回车关闭窗口…'
read -r _
fi
exit "$code"