claude-code-best/src
James F 1faedff25d
fix: eliminate 8 as any in MCP handlers, structured output, and stream events+Claude Soul Document 蒸馏 (#1258)
* fix: eliminate 8 as any in MCP handlers, structured output, and stream events

- Group A: Add : () => AnyObjectSchema type annotations to MCP notification
  schema constants (useIdeSelection, useIdeLogging, usePrompts, channelNotification)
- Group B: Add isStructuredOutputAttachmentMessage type guard for structured
  output attachment payloads (execAgentHook)
- Group C: Add isMessageDeltaStreamEvent type guard for message_delta
  stream event usage extraction (forkedAgent)

These as any casts also exist in the upstream CCB source — this fix provides
real type safety without changing any runtime behavior.

* feat: wire mode persona injection — Claude Soul Document distilled into system prompt

- prompts.ts: add getModePersonaSection() → injects current mode's
  systemPrompt as 'mode_persona' dynamic section (first in order,
  before operational instructions). Previously modes had systemPrompt
  fields but they were never sent to the model.
- modes/personas/claude.ts: 3KB distilled Claude persona from
  Anthropic's leaked Claude 4.5 Opus Soul Document (70KB → operational
  extract): core traits, 7 honesty principles, helpfulness/caution
  balance, collaboration stance, identity stability.
- With custom mode YAML (~/.claude/modes/claude.yaml), 7 modes total
  including the new Claude persona — fully operational at /mode claude.

Co-Authored-By: James Feng <47167674+GhostDragon124@users.noreply.github.com>

* fix: import path convention + reword persona source comment

- prompts.ts: use 'src/modes/store.js' alias instead of relative '../modes/store.js'
  to match the file's existing import convention
- claude.ts: reword JSDoc to say 'based on publicly available reference document'
  instead of 'leaked', addressing CodeRabbit review concern

* docs: add usage note to CLAUDE_PERSONA explaining it's a reference template for YAML config

CodeRabbit noted that CLAUDE_PERSONA has no direct imports. This is
intentional — it's a reference template for users defining custom modes
via ~/.claude/modes/claude.yaml, not a programmatically imported constant.
2026-06-07 20:30:03 +08:00
..
__tests__ style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
assistant chore: 清理 src 下 113 项未使用导入和死代码 2026-05-05 20:05:15 +08:00
bootstrap docs: 合并性能分析报告并优化内存管理 2026-05-02 09:11:12 +08:00
bridge chore: 清理 src 下 113 项未使用导入和死代码 2026-05-05 20:05:15 +08:00
buddy feat: /login支持codex订阅登录 2026-05-08 20:35:34 +08:00
cli fix: 删除 edit tool 中的旧逻辑处理, 现在已经不需要这些处理了, 大模型够屌 (#1251) 2026-05-28 21:52:31 +08:00
commands feat: add mode system with 6 AI personality presets (#1255) 2026-06-05 21:01:02 +08:00
components feat: 添加 cacheWarningEnabled 配置项,支持在 /config 面板关闭缓存率警告 2026-06-06 10:15:24 +08:00
constants Fix/coderabbit nits (#1259) 2026-06-07 20:06:16 +08:00
context Revert "chore: 切换到 bun publish,修复 husky 路径问题,调整 diff 折叠距离,导出 VoiceContext" 2026-05-20 10:11:21 +08:00
coordinator feat: 工具层及 mcp 大重构 (#252) 2026-04-13 09:52:05 +08:00
daemon chore: 清理 src 下 113 项未使用导入和死代码 2026-05-05 20:05:15 +08:00
entrypoints Fix/coderabbit nits (#1259) 2026-06-07 20:06:16 +08:00
environment-runner style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
hooks Fix/coderabbit nits (#1259) 2026-06-07 20:06:16 +08:00
jobs Feat/integrate lint preview (#285) 2026-04-16 20:59:29 +08:00
keybindings feat: 添加 Provider Registry、StatusLine、Cache Stats 和其他增强 2026-05-09 23:04:35 +08:00
memdir refactor: 精简系统提示词 — 合并沟通风格段落、精简 memory/工具描述、截断 gitStatus 2026-05-09 17:14:41 +08:00
migrations fix: 禁用 opus[1m] 自动迁移,尊重用户手动删除 [1m] 后缀的选择 2026-05-07 09:33:56 +08:00
modes fix: eliminate 8 as any in MCP handlers, structured output, and stream events+Claude Soul Document 蒸馏 (#1258) 2026-06-07 20:30:03 +08:00
moreright style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
native-ts/file-index style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
outputStyles feat: build 2026-03-31 19:22:47 +08:00
plugins feat: 接入内建 weixin channel(同 #301 重构版本) (#303) 2026-04-19 21:33:27 +08:00
proactive feat: harden autonomy lifecycle, OOM bounds, and provider-boundary finalization 2026-04-29 14:04:27 +08:00
query fix: 替换 extractMemories 的 require() 为动态 import() 修复 Vite 构建崩溃 2026-05-14 17:44:47 +08:00
remote style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
schemas chore: 清理仓库审计问题——修正 CLAUDE.md、删除冗余 yoga-layout、清除 621 个未使用的类型 stub (#354) 2026-04-25 08:54:18 +08:00
screens docs: 添加 ToolSearch 设计指南 + 禁用 turn-zero 工具推荐弹窗 2026-05-09 16:45:56 +08:00
self-hosted-runner style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
server style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
services Fix/coderabbit nits (#1259) 2026-06-07 20:06:16 +08:00
skills docs: 添加 ToolSearch 设计指南 + 禁用 turn-zero 工具推荐弹窗 2026-05-09 16:45:56 +08:00
ssh feat: 实现 SSH Remote — 本地 REPL + 远端工具执行 2026-04-24 14:25:56 +08:00
state fix: 修复 voice provider 的问题 2026-05-18 22:54:11 +08:00
tasks feat(autofix-pr): 完整完成回流机制 (latent bug fix + completionChecker + 内容回流) (#1240) 2026-05-22 21:06:26 +08:00
types Fix type (#1239) 2026-05-19 09:05:04 +08:00
upstreamproxy feat: 问就是封包 2026-03-31 23:32:58 +08:00
utils Fix/coderabbit nits (#1259) 2026-06-07 20:06:16 +08:00
vim feat: build 2026-03-31 19:22:47 +08:00
voice feat: 集成豆包 ASR 语音识别后端,支持 /voice doubao 切换 (#357) 2026-04-25 13:57:30 +08:00
commands.ts feat: add mode system with 6 AI personality presets (#1255) 2026-06-05 21:01:02 +08:00
context.ts refactor: 精简系统提示词 — 合并沟通风格段落、精简 memory/工具描述、截断 gitStatus 2026-05-09 17:14:41 +08:00
cost-tracker.ts feat: ACP 协议版本 remote control (#293) 2026-04-18 21:54:22 +08:00
costHook.ts feat: build 2026-03-31 19:22:47 +08:00
dialogLaunchers.tsx style: 完成所有文件的lint 2026-05-01 21:39:30 +08:00
history.ts feat: 添加服务层增强与零散改进 2026-04-22 22:38:10 +08:00
interactiveHelpers.tsx chore: 清理 src 下 113 项未使用导入和死代码 2026-05-05 20:05:15 +08:00
main.tsx docs: 添加 ToolSearch 设计指南 + 禁用 turn-zero 工具推荐弹窗 2026-05-09 16:45:56 +08:00
projectOnboardingState.ts feat: build 2026-03-31 19:22:47 +08:00
query.ts feat: 添加 cacheWarningEnabled 配置项,支持在 /config 面板关闭缓存率警告 2026-06-06 10:15:24 +08:00
QueryEngine.ts chore: 清理 src 下 113 项未使用导入和死代码 2026-05-05 20:05:15 +08:00
replLauncher.tsx fix: 添加 React Error Boundary 防止生产环境渲染崩溃 2026-05-09 22:02:04 +08:00
setup.ts feat: 添加服务层增强与零散改进 2026-04-22 22:38:10 +08:00
Task.ts feat: build 2026-03-31 19:22:47 +08:00
tasks.ts feat: build 2026-03-31 19:22:47 +08:00
Tool.ts docs: 添加 ToolSearch 设计指南 + 禁用 turn-zero 工具推荐弹窗 2026-05-09 16:45:56 +08:00
tools.ts Revert "feat: 添加 /goal 命令,支持长时间运行任务的目标管理 (#1222)" (#1236) 2026-05-17 10:06:09 +08:00