Skip to content

dsh-rtk v1.4.0 — 会话内自检 /rtk

Choose a tag to compare

@robbin810130 robbin810130 released this 04 Oct 15:45
· 1 commit to main since this release

dsh-rtk v1.4.0 — 会话内自检 /rtk

问题:此前想知道"到底生效没有",要么翻启动日志(桌面版看不到宿主 stdout)、要么跑 npm run doctor(只知道静态环境)。人在会话里,却拿不到当前这一进程的实时状态。

  • 新增人类命令 /rtk(ctx.commands.register(),不产生模型消息):
    • /rtk、/rtk status:版本、平台、挂载的 shell 工具与引用方言、RTK 路径与来源、改写/无等价/未改写计数、生效配置、状态文件路径、最近错误;未生效时附带原因与修复步骤。
    • /rtk recheck:丢弃解析缓存重新探测 RTK —— 刚装好 rtk、又不想重启 DSH 时即刻生效。
    • 其他输入返回用法;命令结果分为 success/error。
  • commands 服务按可选依赖注入(ctx.inject(['commands'], …)):未组合该服务的 profile 里插件行为不变,不会因缺服务而报错。
  • 运行时新增 recheck();snapshot() 增补 pluginVersion、timeoutMs、hint、platform,供命令与测试复用。
  • 测试:test/resolve.mjs 覆盖命令定义与三种输入;test/runtime.mjs 组合真实的 @deepseek-ai/dsh-commands(新增 devDependency),验证定义能通过真实注册表校验、出现在 commands.list() 中,并随插件卸载而消失。
  • 文档:README 重排(平台矩阵 → 本版功能 → 更新记录表 → 安装 → 配置 → 自检与排障),新增「三层自检」对照表;Windows 说明补充 /rtk 与 /rtk recheck。