Files
maestro/scripts
wangjia 2c4140a1a2 feat(daemon): launchd plist + install/uninstall 脚本(tsk_nqvOyIZkd1Dn)
提供三个文件让 maestrod 作为 macOS User Agent 开机自启、崩溃自拉:

- scripts/com.maestro.maestrod.plist  — launchd plist 模板
    KeepAlive=true(崩溃自拉)、RunAtLoad=true(登录即启)
    stdout+stderr 统一写入 ~/.maestro/maestrod.log
    ThrottleInterval=10s 防崩溃风暴;ProcessType=Background
    占位符:__NODE__ / __PROJ_DIR__ / __HOME__ / __PATH__

- scripts/install-daemon.sh  — 安装脚本
    1. 检测 node(>= 20)
    2. npm run build 构建项目
    3. sed 替换占位符,生成真实 plist 并用 plutil 校验
    4. launchctl bootstrap gui/$UID(回退 load -w)加载服务

- scripts/uninstall-daemon.sh  — 卸载脚本
    launchctl bootout / unload -w 卸载,删除 plist

shellcheck 通过(两个脚本);现有 77 个单元测试全部通过。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 09:24:04 +08:00
..