claude-code-best/src/hooks
claude-code-best 494eab7204
feat: 接入内建 weixin channel(同 #301 重构版本) (#303)
* feat: 接入 weixin 服务层与命令入口

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat: 注册内建 weixin channel 插件

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix: 修正 channel permission relay 路由与能力判定

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix: 修复 builtin channel 的 ChannelsNotice 误报

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* docs: 补充内建 weixin channel 使用说明

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* docs: 更新微信 channel 接入计划状态

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix: 延迟加载 weixin 登录二维码依赖

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix: 改用 qrcode 生成 weixin 登录二维码

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix: 修正 vite 构建的 Windows 路径解析

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* chore: 删除临时规划文档 wx_channel.md 并还原 package.json 排序

wx_channel.md 内容已整合到 docs/features/channels.md,不再需要。
package.json 中 @ant/model-provider 位置从原始位置被无意移动,还原。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: 将 weixin 模块从 src/ 迁移至 packages/weixin 工作区包

将 src/services/weixin/ 中的纯业务逻辑迁入 @claude-code-best/weixin
workspace 包,降低 src/ 耦合度。仅保留 server.ts 作为薄适配层。

- 迁移 7 个无修改的纯模块 (types/api/accounts/login/pairing/media/send)
- monitor.ts 内联 PERMISSION_REPLY_RE 正则,解除对 src/ 的依赖
- permissions.ts 本地定义 ChannelPermissionRequestParams 接口
- cli.ts 拆分:serve 子命令通过回调注入,login/access 保留在包内
- server.ts 重写为从 @claude-code-best/weixin 导入
- 新增 cli-serve.ts 作为 serve 入口薄壳

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: 修正 weixin barrel export 中 interface 的导出方式

ChannelPermissionRequestParams 是纯类型,必须用 export type 导出,
否则 Bun 运行时会报 "export not found" 错误。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: 将 server.ts 迁入 packages/weixin,彻底移除 src/services/weixin/

通过依赖注入(WeixinServerDeps)解耦 src/ 依赖(analytics、config、
MCP channel schema),server.ts 完全移入包内。cli.tsx 入口处一次性
注入所有依赖。

src/services/weixin/ 目录已完全删除。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: 修复 markdownToPlainText 中代码块正则的 ReDoS 风险

用非正则的线性扫描替代 \`\`\`[\s\S]*?\n([\s\S]*?)\`\`\` 匹配,
避免在含有大量重复 \`\`\` 序列的输入上触发多项式回溯。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: 1111 <11111@asd.c>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-19 21:33:27 +08:00
..
__tests__ feat: 远程群控 (#243) 2026-04-11 23:22:55 +08:00
notifs Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
src feat: 全面清理类型错误 — tsc 零错误,any 标注全部消除 2026-04-01 01:00:10 +08:00
toolPermission feat: 接入内建 weixin channel(同 #301 重构版本) (#303) 2026-04-19 21:33:27 +08:00
fileSuggestions.ts fix: 修复 @ typeahead 文件搜索无结果的问题 2026-04-01 17:11:09 +08:00
renderPlaceholder.ts feat: build 2026-03-31 19:22:47 +08:00
unifiedSuggestions.ts feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useAfterFirstRender.ts feat: build 2026-03-31 19:22:47 +08:00
useApiKeyVerification.ts feat: build 2026-03-31 19:22:47 +08:00
useArrowKeyHistory.tsx Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useAssistantHistory.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useAwaySummary.ts Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
useBackgroundTaskNavigation.ts feat: 远程群控 (#243) 2026-04-11 23:22:55 +08:00
useBlink.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useCancelRequest.ts feat: build 2026-03-31 19:22:47 +08:00
useCanUseTool.tsx feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useChromeExtensionNotification.tsx fix(types): clean type fixes across 92 files 2026-04-09 23:45:56 +08:00
useClaudeCodeHintRecommendation.tsx fix(types): clean type fixes across 92 files 2026-04-09 23:45:56 +08:00
useClipboardImageHint.ts feat: build 2026-03-31 19:22:47 +08:00
useCommandKeybindings.tsx 更新大量 tsx 原始文件; 已经迁移 login panel; 部分 (#121) 2026-04-04 23:24:27 +08:00
useCommandQueue.ts feat: build 2026-03-31 19:22:47 +08:00
useCopyOnSelect.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useDeferredHookMessages.ts feat: build 2026-03-31 19:22:47 +08:00
useDiffData.ts feat: build 2026-03-31 19:22:47 +08:00
useDiffInIDE.ts feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useDirectConnect.ts fix(types): clean type fixes across 92 files 2026-04-09 23:45:56 +08:00
useDoublePress.ts refactor: 大规模迁移原有组件到 ink 包内 2026-04-07 22:26:45 +08:00
useDynamicConfig.ts feat: build 2026-03-31 19:22:47 +08:00
useElapsedTime.ts feat: build 2026-03-31 19:22:47 +08:00
useExitOnCtrlCD.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useExitOnCtrlCDWithKeybindings.ts feat: build 2026-03-31 19:22:47 +08:00
useFileHistorySnapshotInit.ts feat: build 2026-03-31 19:22:47 +08:00
useGlobalKeybindings.tsx feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useHistorySearch.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useIdeAtMentioned.ts feat: build 2026-03-31 19:22:47 +08:00
useIdeConnectionStatus.ts feat: build 2026-03-31 19:22:47 +08:00
useIDEIntegration.tsx 更新大量 tsx 原始文件; 已经迁移 login panel; 部分 (#121) 2026-04-04 23:24:27 +08:00
useIdeLogging.ts feat: build 2026-03-31 19:22:47 +08:00
useIdeSelection.ts feat: build 2026-03-31 19:22:47 +08:00
useInboxPoller.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useInputBuffer.ts feat: build 2026-03-31 19:22:47 +08:00
useIssueFlagBanner.ts feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useLogMessages.ts feat: build 2026-03-31 19:22:47 +08:00
useLspPluginRecommendation.tsx 更新大量 tsx 原始文件; 已经迁移 login panel; 部分 (#121) 2026-04-04 23:24:27 +08:00
useMailboxBridge.ts feat: build 2026-03-31 19:22:47 +08:00
useMainLoopModel.ts feat: build 2026-03-31 19:22:47 +08:00
useManagePlugins.ts feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useMasterMonitor.ts Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
useMemoryUsage.ts feat: build 2026-03-31 19:22:47 +08:00
useMergedClients.ts feat: build 2026-03-31 19:22:47 +08:00
useMergedCommands.ts feat: build 2026-03-31 19:22:47 +08:00
useMergedTools.ts feat: build 2026-03-31 19:22:47 +08:00
useMinDisplayTime.ts refactor: 大规模迁移原有组件到 ink 包内 2026-04-07 22:26:45 +08:00
useNotifyAfterTimeout.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useOfficialMarketplaceNotification.tsx Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
usePasteHandler.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
usePipeIpc.ts Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
usePipeMuteSync.ts Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
usePipePermissionForward.ts Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
usePipeRelay.ts Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
usePipeRouter.ts feat: 远程群控 (#243) 2026-04-11 23:22:55 +08:00
usePluginRecommendationBase.tsx Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
usePromptsFromClaudeInChrome.tsx fix(types): clean type fixes across 92 files 2026-04-09 23:45:56 +08:00
usePromptSuggestion.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
usePrStatus.ts feat: build 2026-03-31 19:22:47 +08:00
useQueueProcessor.ts feat: build 2026-03-31 19:22:47 +08:00
useRemoteSession.ts fix(types): clean type fixes across 92 files 2026-04-09 23:45:56 +08:00
useReplBridge.tsx feat(remote-control): 优化 Web 展示、状态同步与桥接控制流程 (#288) 2026-04-17 16:21:27 +08:00
useScheduledTasks.ts Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
useSearchInput.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useSessionBackgrounding.ts feat: build 2026-03-31 19:22:47 +08:00
useSettings.ts feat: build 2026-03-31 19:22:47 +08:00
useSettingsChange.ts feat: build 2026-03-31 19:22:47 +08:00
useSkillImprovementSurvey.ts feat: build 2026-03-31 19:22:47 +08:00
useSkillsChange.ts feat: build 2026-03-31 19:22:47 +08:00
useSlaveNotifications.ts feat: 远程群控 (#243) 2026-04-11 23:22:55 +08:00
useSSHSession.ts fix: 修复类型问题 2026-04-10 17:34:01 +08:00
useSwarmInitialization.ts feat: build 2026-03-31 19:22:47 +08:00
useSwarmPermissionPoller.ts feat: build 2026-03-31 19:22:47 +08:00
useTaskListWatcher.ts feat: build 2026-03-31 19:22:47 +08:00
useTasksV2.ts feat: build 2026-03-31 19:22:47 +08:00
useTeammateViewAutoExit.ts feat: build 2026-03-31 19:22:47 +08:00
useTeleportResume.tsx 更新大量 tsx 原始文件; 已经迁移 login panel; 部分 (#121) 2026-04-04 23:24:27 +08:00
useTerminalSize.ts refactor: 大规模迁移原有组件到 ink 包内 2026-04-07 22:26:45 +08:00
useTextInput.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useTimeout.ts refactor: 大规模迁移原有组件到 ink 包内 2026-04-07 22:26:45 +08:00
useTurnDiffs.ts feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useTypeahead.tsx feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
useUpdateNotification.ts feat: build 2026-03-31 19:22:47 +08:00
useVimInput.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useVirtualScroll.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useVoice.ts Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00
useVoiceEnabled.ts feat: build 2026-03-31 19:22:47 +08:00
useVoiceIntegration.tsx Revert "Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)" 2026-04-07 16:17:48 +08:00