feat: meetings — system audio recording (macOS 15+) + one-click Scripto install#45
Merged
Conversation
…tap (macOS 15+) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
两个会议相关改动:
改动
系统声音录制(commit 53a998c)
SystemAudioRecorder(macOS 15+,@available门控,部署目标仍为 macOS 13):用 Core Audio process tap(CATapDescription全局混音、排除 Shiftly 自身)+ 私有聚合设备 + IOProc,把系统声音输出写入隐藏边轨.dd-mm-yy.system.m4a。tap 在系统混音层截取,与输出走扬声器还是耳机无关。AppModel:开始录音时同时启动系统声音边轨,任何失败(权限被拒、tap 报错)自动降级为仅麦克风并在状态栏提示;停止录音后用AVMutableComposition+AVAssetExportSession把两轨混成一个文件,仍落在dd-mm-yy.mp4(m4a 容器,Scripto / 播放器均兼容)。混音完成前会议不出现在列表里,避免转录与文件替换竞态;混音失败时保留麦克风原始录音。MeetingStore.meetings()过滤点号开头的文件,录音中/崩溃残留的边轨不会被当成会议音频或字幕。NSAudioCaptureUsageDescription;首次录音会触发独立于麦克风的「系统音频录制」隐私弹窗。一键安装 Scripto(commit 120f37c)
ShiftlyKit.ScriptoInstall:纯逻辑的目标目录解析——app 位于 Shiftly git 检出内(如从 dist/ 运行)时克隆到检出的同级目录(../scripto,即开发机常规布局);否则克隆到~/Library/Application Support/Shiftly/scripto(不受 app 搬家影响,也避免把 Python venv 放进可能被 iCloud 同步的存储根)。AppModel.installScripto():目标处已有 checkout(含pyproject.toml)则直接采用不重复克隆;否则git clone→uv sync预热环境(首次转录不再静默等依赖下载)→ 自动写入scripto_dir。缺 uv / sync 失败时保留 checkout 并给出对应提示;克隆失败时清理本次创建的目录。AppModel.runShell(登录 zsh,先排空 stderr 再等退出,stdout 丢弃,避免管道写满死锁),转录调用同步改用它。验证
scripts/test.sh全部通过(114 用例;新增隐藏文件过滤 3 项 + ScriptoInstall 目录解析/checkout 检测 3 项)。scripts/build_app.sh打包成功,plutil -lint校验 Info.plist 通过。git clone https://github.com/TN019/scripto.git到临时目录实测成功,pyproject.toml存在;登录 shell 可找到 uv。未自动化验证项
Core Audio tap、TCC 弹窗与 GUI 按钮无法在 CI 中自动化,需在打包后的 app 中人工验证:
scripts/build_app.sh,打开dist/Shiftly.app,在会议页点击录音;预期首次出现「系统音频录制」授权弹窗(与麦克风弹窗分开)。~/dev/local/scripto的环境)点击「一键安装」;预期本机(从检出运行)直接采用~/dev/local/scripto并提示已保存;全新环境则克隆到对应位置、跑完 uv sync 后提示「Scripto 已就绪。」且目录自动填入。🤖 Generated with Claude Code