feat: zcode thinking-mode 0.3.0(state历史+rollback+分写+校验收紧+34用例全绿+文档)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
---
|
||||
description: 自检:安装是否完整、两个写入目标是否可写、node:sqlite 是否可用(只读)
|
||||
---
|
||||
|
||||
用 Bash(Windows 用 git-bash)运行(**只读,不改任何东西,不写档位**):
|
||||
|
||||
```bash
|
||||
THINK_SCRIPT="${ZCODE_THINKING_SCRIPT:-$(find ~/.zcode/plugins -maxdepth 4 -name thinking.mjs -path '*thinking-mode*' 2>/dev/null | head -1)}"
|
||||
[ -n "$THINK_SCRIPT" ] || THINK_SCRIPT="$(find ~/.zcode -maxdepth 8 -type f -path '*thinking-mode/scripts/thinking.mjs' 2>/dev/null | head -1)"
|
||||
[ -n "$THINK_SCRIPT" ] || { echo "找不到 thinking.mjs:插件未安装或不在默认位置,可用 ZCODE_THINKING_SCRIPT 指定路径"; exit 1; }
|
||||
node "$THINK_SCRIPT" doctor $ARGUMENTS
|
||||
```
|
||||
|
||||
检查项(每项 `✓ ok` / `⚠ warn` / `✗ fail`,失败项附可执行的修复建议):
|
||||
|
||||
- **Node 版本 / node:sqlite** — 热档位那一半依赖 `node:sqlite`(需 Node ≥22.5);
|
||||
导入失败时热档位写不了,只能改模型配置
|
||||
- **模型配置** — 能否读到、JSON 是否合法、有几个模型声明了 `reasoning`
|
||||
- **热档位库** — 文件在不在、能否打开、有没有 `local_setting` 表(缺表说明不是有效的 session 库)
|
||||
- **当前热档位** — 库里现在的值;没有这行也会如实说明,不假装读到
|
||||
- **默认值** — 默认档位/默认模型及其来源(环境变量/文件/未设)
|
||||
- **写入能力** — 模型配置是否可写、能否在配置目录写备份、默认值目录是否存在
|
||||
|
||||
退出码:有 `fail` 时为 1。
|
||||
|
||||
用法场景:**用户说"切不了/切了没效果/报错"时先跑这个**,再把 `fail` 项与修复建议照实告诉他,
|
||||
不要自己猜。想知道"怎么回滚"也可以先跑它,备份可写性就在检查项里。
|
||||
|
||||
**把脚本输出原样展示给用户**。
|
||||
|
||||
用户附加要求:$ARGUMENTS
|
||||
Reference in New Issue
Block a user