Repository navigation
fix(macos): 同时识别 WorkBuddy 的两个 bundle id (#44) - #67
Merged
Merged
Conversation
WorkBuddy ships as com.tencent.workbuddy.mac (WeChat-distributed build) and com.workbuddy.workbuddy (public download). Only the first was known, so the public build read as 未安装 and forwarding fell back to the clipboard. ShareAction and AgentID now carry a list of bundle ids; the app resolves whichever one is installed for the entry status, icon, activation and collection targets. Fixes #44 Co-Authored-By: Claude Opus 5.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.
问题
WorkBuddy 有两种发行版,bundle id 不同:
com.tencent.workbuddy.mac(原代码只认这个)com.workbuddy.workbuddy装的是公开版的用户,「发给 WorkBuddy」会显示「未安装」,转发时找不到这个 App,最后只能退回到剪贴板。
改动
ShareAction.targetBundleIdentifiers和AgentID.bundleIdentifiers改为 id 列表,WorkBuddy 两个 id 都列进去。targetBundleIdentifier和bundleIdentifier仍然返回主 id,保持兼容。AgentID.matching(bundleIdentifier:)改为在列表里匹配,用任意一个 id 都能找到对应的 Agent,场景的兼容判断也跟着生效。ShareAction.installedTargetBundleIdentifier,取本机实际装了的那个 id。入口状态、图标、激活粘贴、汇总投递的可选目标都改用它。ShareEntryProbe.installationFailure:两个 id 装了任意一个,就允许开启入口。testWorkBuddyIsKnownUnderBothBundleIdentifiers。验证
swift build编译通过,swift test共 187 个测试,0 失败。com.tencent.workbuddy.mac,这个 id 的行为不变。com.workbuddy.workbuddy没有在真机上装来验证,只覆盖了单元测试。Fixes #44
🤖 Generated with Claude Code