claude-code/DEV-LOG.md

34 lines
1.5 KiB
Markdown
Raw Normal View History

# DEV-LOG
## Auto Mode 补全 (2026-04-02)
反编译丢失了 auto mode 分类器的三个 prompt 模板文件,代码逻辑完整但无法运行。
**新增:**
- `yolo-classifier-prompts/auto_mode_system_prompt.txt` — 主系统提示词
- `yolo-classifier-prompts/permissions_external.txt` — 外部权限模板(用户规则替换默认值)
- `yolo-classifier-prompts/permissions_anthropic.txt` — 内部权限模板(用户规则追加)
**改动:**
- `scripts/dev.ts` + `build.ts` — 扫描 `FEATURE_*` 环境变量注入 Bun `--feature`
- `cli.tsx` — 启动时打印已启用的 feature
- `permissionSetup.ts``AUTO_MODE_ENABLED_DEFAULT``feature('TRANSCRIPT_CLASSIFIER')` 决定,开 feature 即开 auto mode
- `docs/safety/auto-mode.mdx` — 补充 prompt 模板章节
**用法:** `FEATURE_TRANSCRIPT_CLASSIFIER=1 bun run dev`
**注意:** prompt 模板为重建产物。
---
## USER_TYPE=ant TUI 修复 (2026-04-02)
`global.d.ts` 声明的全局函数在反编译版本运行时未定义,导致 `USER_TYPE=ant` 时 TUI 崩溃。
修复方式:显式 import / 本地 stub / 全局 stub / 新建 stub 文件。涉及文件:
`cli.tsx`, `model.ts`, `context.ts`, `effort.ts`, `thinking.ts`, `undercover.ts`, `Spinner.tsx`, `AntModelSwitchCallout.tsx`(新建), `UndercoverAutoCallout.tsx`(新建)
注意:
- `USER_TYPE=ant` 启用 alt-screen 全屏模式,中心区域满屏是预期行为
- `global.d.ts` 中剩余未 stub 的全局函数(`getAntModels` 等)遇到 `X is not defined` 时按同样模式处理