Windows:新增内置任务完成提示弹窗,并支持点击聚焦终端#165
Open
sixsixla wants to merge 12 commits into
Open
Conversation
Add a bundled PowerShell script (templates/tools/deepcode-notify.ps1) that: - Captures the console window HWND via GetConsoleWindow - Shows a BalloonTip notification when a task completes/fails - On click, activates the originating terminal via SetForegroundWindow Extend notify.ts with launchBuiltinNotify() and resolveBuiltinNotifyPath() so the CLI can resolve and invoke the bundled script without user configuration. Update SessionManager.maybeNotifyTaskCompletion() to fall back to the built-in notification on Windows when no external notify script is configured.
…ToThisWindow) for Win11
… restore with IsIconic check
…imized window restore
…r to grant foreground permission
…n for foreground permission
…n11 blocks programmatic foreground steal)
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.
Windows:新增内置任务完成提示,并支持点击聚焦终端
概述
这个 PR 改进了 Deep Code CLI 在 Windows 上的默认任务完成通知体验。
Deep Code CLI 是一个很有价值的终端 AI 工具,把 DeepSeek v4 这类模型能力很好地融入到了日常工程工作流中。感谢作者持续开发和维护这个项目。
项目已经提供了灵活的
notify机制,方便用户接入自己的通知脚本。这个 PR 希望在不影响现有自定义能力的前提下,为 Windows 用户补上一个开箱即用的内置桌面提示。当 AI 完成一轮回复后,Deep Code 会显示一个紧凑的桌面提示,内容包含最近一次用户问题和 AI 回复开头。用户点击提示后,会尝试恢复并聚焦启动 CLI 的终端窗口。
效果截图
动机
Deep Code CLI 常用于需要等待一段时间的工程任务,也可能同时开启多个 CLI 终端并行使用。用户经常会在 AI 执行期间切到其它窗口工作,因此任务完成后的反馈很重要。
这个 PR 希望让 Windows 默认体验更完整:
notify脚本仍然优先。实现方式
QUESTION环境变量传给通知脚本。notify时启用。行为边界
现有自定义通知行为保持不变:
notify时,继续执行用户自定义脚本。notify且运行在 Windows 时,才使用内置桌面提示。测试
已通过:
git diff --check构建后手动运行新产物:
手动验收:
已验证场景:
说明
本地 Windows 环境也尝试运行了:
通知相关测试通过;完整测试套件在本地 Windows 上有若干失败,集中在临时目录清理阶段,错误为
fs.rmSync抛出EPERM。这些失败看起来与本 PR 的通知改动无关,因此没有把 Windows 临时目录清理问题纳入这个 PR 的范围。总结
感谢作者把 Deep Code CLI 做成了一个很轻、很直接的终端 AI 工具。这个 PR 主要是在现有
notify设计之上补齐 Windows 的默认体验,让用户在不配置额外脚本的情况下,也能及时知道任务完成,并一键回到正确的终端窗口。