{"_id":"@birdman1992/model-autofill","_rev":"2-c75bbbf916dfacd71c62f5d845fabc1b","name":"@birdman1992/model-autofill","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@birdman1992/model-autofill","version":"0.1.0","keywords":["deepseek-harness","dsh","cordis","deepseek","plugin","model"],"license":"MIT","_id":"@birdman1992/model-autofill@0.1.0","maintainers":[{"name":"birdman1992","email":"871727949@qq.com"}],"homepage":"https://github.com/birdman1992/dsh-birdman-plugins#readme","bugs":{"url":"https://github.com/birdman1992/dsh-birdman-plugins/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"dist":{"shasum":"6af03078ea0519828034bee550090cb08d503270","tarball":"https://registry.npmjs.org/@birdman1992/model-autofill/-/model-autofill-0.1.0.tgz","fileCount":5,"integrity":"sha512-GMBJKO1TNpoB7FpayKZVDgcvLSmHsATgH4960b3xPrxbV07MO3cVCRovwH3FM0z5iXzSWvjYzWZ+MuOHBQm0jw==","signatures":[{"sig":"MEQCIFCSPMVdi3xV8jf1jp7LLfUf0bGU1vU5fYlqgCc1lv2WAiB9zS8Je3nanYfKr7sqiCydnReadUzw/U6p9Zsk+iG50Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11901},"main":"lib/index.js","type":"module","exports":{".":"./lib/index.js","./package.json":"./package.json","./cordis.patch.yml":"./cordis.patch.yml"},"gitHead":"4652ce8295df5153fdd2b2296e756daecd435d57","_npmUser":{"name":"birdman1992","email":"871727949@qq.com"},"repository":{"url":"git+https://github.com/birdman1992/dsh-birdman-plugins.git","type":"git","directory":"plugins/model-autofill"},"_npmVersion":"11.6.2","description":"Auto-complete missing model display name, context window, and max output tokens in the llm-pi-ai settings namespace from the pi-ai built-in catalog.","directories":{},"_nodeVersion":"24.13.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/model-autofill_0.1.0_1786727335122_0.19638396920628454","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@birdman1992/model-autofill","version":"0.2.0","description":"Auto-complete missing model display name, context window, max output tokens, and reasoning efforts in the llm-pi-ai settings namespace.","license":"MIT","keywords":["deepseek-harness","dsh","cordis","deepseek","plugin","model"],"homepage":"https://github.com/birdman1992/dsh-birdman-plugins#readme","bugs":{"url":"https://github.com/birdman1992/dsh-birdman-plugins/issues"},"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json","./cordis.patch.yml":"./cordis.patch.yml"},"dependencies":{},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"repository":{"type":"git","url":"git+https://github.com/birdman1992/dsh-birdman-plugins.git","directory":"plugins/model-autofill"},"gitHead":"56d7a26a5b1cbffa5a92cc8eea50ae6ce56e3687","_id":"@birdman1992/model-autofill@0.2.0","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-MeqR4GCj43mDYTMzwtrimtgUc0PqlWBidO63GikCs5oijpBgh0Jrw7jO235vaADhK13zmn4UlXAudT49P0J+WQ==","shasum":"58d178f4ed9eaf745cdfb407e72e1f951fc35981","tarball":"https://registry.npmjs.org/@birdman1992/model-autofill/-/model-autofill-0.2.0.tgz","fileCount":5,"unpackedSize":29380,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCgdEm58ZomAr/oR6QPGIBUW/XfSS/rB966EiDTL+ah5QIgVkhabfEjwoN5GAdAUucWQu1sF0Gv1MCw4K42t2G1Ulw="}]},"_npmUser":{"name":"birdman1992","email":"871727949@qq.com"},"directories":{},"maintainers":[{"name":"birdman1992","email":"871727949@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/model-autofill_0.2.0_1786778719403_0.9048399211808422"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-14T17:08:54.962Z","modified":"2026-08-15T07:25:19.712Z","0.1.0":"2026-08-14T17:08:55.278Z","0.2.0":"2026-08-15T07:25:19.571Z"},"bugs":{"url":"https://github.com/birdman1992/dsh-birdman-plugins/issues"},"license":"MIT","homepage":"https://github.com/birdman1992/dsh-birdman-plugins#readme","keywords":["deepseek-harness","dsh","cordis","deepseek","plugin","model"],"repository":{"type":"git","url":"git+https://github.com/birdman1992/dsh-birdman-plugins.git","directory":"plugins/model-autofill"},"description":"Auto-complete missing model display name, context window, max output tokens, and reasoning efforts in the llm-pi-ai settings namespace.","maintainers":[{"name":"birdman1992","email":"871727949@qq.com"}],"readme":"# model-autofill\n\n[English](README.en.md) | 中文\n\n## 作用\n\n模型信息自动补全。在 `llm-pi-ai` 设置命名空间（`$DSH_HOME/settings.yaml`，\n由 Web 的 Models 页面写入）中，每当模型条目缺少以下字段时自动补全：\n\n- 显示名（`name`）— 来自 pi-ai 内置模型目录\n- 上下文窗口（`contextWindow`）\n- 最大输出 token（`maxTokens`）\n- 推理档位（`reasoningEfforts`）— 来自内置规则表（v0.2 新增）\n\n只补全缺失字段，绝不覆盖用户已填写的值；用户修改模型配置后自动触发，\n启动时也会做一次幂等补全。模型 id 带 `provider/` 前缀或 `:suffix` 后缀\n（如 `openai/gpt-5.6-luna`、`xiaomi/mimo-v2.5-pro:free`）时也能正确匹配。\n\n### reasoningEfforts 规则表\n\n推理能力**不能**像目录字段那样从 `discoverModels` 查出——它只返回\nid/name/contextWindow/maxTokens。因此补全采用**声明式规则策略**：按顺序\n匹配 id 子串，命中即写入对应档位表。档位表以**本机安装的 pi-ai 官方\ncatalog**（`node_modules/@earendil-works/pi-ai/dist/providers/data/*.json`\n中各模型自己的 `thinkingLevelMap`）为准，公开文档交叉验证：\n\n| 匹配 | 档位（键 = pi-ai 档位，值 = 发给网关的 wire 拼写） | 依据 |\n| --- | --- | --- |\n| `claude-` / `claude/` | `off` + `minimal/low/medium/high/xhigh/max`（minimal 的 wire 折叠为 `low`） | pi-ai `anthropic.json`（claude-fable-5 map 为 `{off,xhigh,max}` + 基础档默认支持）；[Anthropic skills](https://github.com/anthropics/skills/blob/da20c925/skills/claude-api/SKILL.md) |\n| `gpt-5` / `gpt/` / `o1`/`o3`/`o4` | `off` + `minimal/low/medium/high/xhigh/max`（minimal→`low`） | pi-ai `openai-codex.json`（gpt-5.6-* map 为 `{xhigh, max, minimal:\"low\"}`）；[OpenAI reasoning](https://developers.openai.com/api/docs/guides/reasoning) |\n| `deepseek-` / `deepseek/` | `off` + `high/max` | pi-ai `deepseek.json`（map 为 `{high:\"high\", max:\"max\"}`，low/medium/minimal 均 null）；[DeepSeek reasoning effort](https://promptgenius.net/prompts/deepseek/thinking-mode/reasoning-effort-control) |\n| `glm-` | `off` + `low/medium/high/max`，wire：low/medium/high 全发 `high` | pi-ai `zai.json`（glm-5.2 map 为 `{low:\"high\", medium:\"high\", high:\"high\", max:\"max\"}`）；[pi#5770 GLM-5.2 High & Max](https://github.com/earendil-works/pi/issues/5770) |\n| `kimi-k3`（**必须先于 kimi- 通用规则**） | `off` + `low/high/max`（无 medium/minimal/xhigh） | pi-ai `moonshotai.json`（kimi-k3 map 为 `{low:\"low\", high:\"high\", max:\"max\"}`，medium/minimal/xhigh null）；[Kimi K3 effort: Max/High/Low](https://kimi-ai.chat/docs/kimi-k3-reasoning-effort/) |\n| `kimi-` / `kimi/` / `moonshot`（K2.x 等） | `off` + `minimal/low/medium/high` | pi-ai `moonshotai.json`（kimi-k2.7-code map 仅 `{off:null}` → 基础档默认支持） |\n| `qwen` | `off` + `minimal/low/medium/high` | pi-ai `opencode-go.json`（qwen3.7-max 无 map → 基础档默认支持） |\n| `mimo-` | `off` + `minimal/low/medium/high` | pi-ai `xiaomi.json`（mimo-v2.5-pro `reasoning:true`、无 map；`:free` 只是免费档，不关闭推理） |\n| 其余未命中 | 不写（保持 pi-ai 的\"无元数据 = 仅提供方默认\"，选择器不显示 Effort 行） | — |\n\n关键语义（来自 pi-ai 实现）：\n\n- **`off:` 留空** = 提供 Off 档，anthropic 方言下发 `thinking: {type: \"disabled\"}`。\n- **minimal 的 wire 折叠为 `low`**：anthropic-messages 的\n  `mapThinkingLevelToEffort` 把 minimal 折叠到 low（见\n  `pi-ai/dist/api/anthropic-messages.js`），所以任何表里 minimal 的值都写\n  `low`，避免发出不存在的 wire 值。\n- **未声明的档位被固定为不支持**：所以每张表就是该模型族对外提供的全部\n  档位；表里多写一个实际不支持的档位（如 kimi-k3 的 medium）会让用户选中\n  后请求失败。\n- **`:free` 不等于不支持推理**：`xiaomi/mimo-v2.5-pro:free` 是同一模型的\n  免费档，推理能力不变，因此不再有 `:free → false` 的规则。\n\n> ⚠️ 你的网关（knnns，`anthropic-messages` 方言）会把 effort 名翻译成底层\n> 模型自己的词汇，**某档位能否被接受取决于网关与该模型**。声明档位等于向\n> 网关声明\"该模型支持思考\"：若某个模型实际不接受 thinking 参数（网关忽略或\n> 报错），把它的规则改为 `efforts: false`，或在 settings.yaml 里删除该条目\n> 的 `reasoningEfforts` 即可。补全写进的是用户 settings 层，随时可编辑/删除，\n> 没有锁定。\n\n规则表可用插件 `config` 整体替换（在 profile 的 `cordis.patch.yml` 或\n`cordis.yml` 的 model-autofill 行上加）：\n\n```yaml\n- id: model-autofill\n  name: \"@birdman1992/model-autofill\"\n  config:\n    reasoning:\n      rules:\n        - match: [\"claude-\", \"claude/\"]\n          efforts: { off: null, minimal: low, low: low, medium: medium, high: high, xhigh: xhigh, max: max }\n        - match: [\"deepseek-\", \"deepseek/\"]\n          efforts: { off: null, high: high, max: max }\n```\n\n> 注意：写档位等于向网关声明\"该模型支持思考\"。如果某个模型实际不接受\n> thinking 参数（网关忽略或报错），把它的规则改为 `efforts: false` 或在\n> settings.yaml 里直接删除该条目的 `reasoningEfforts` 即可。补全写进的是\n> 用户 settings 层，随时可编辑/删除，没有锁定。\n\n## 安装\n\n已发布到 npm，直接安装：\n\n```sh\ndsh plugin --profile web add @birdman1992/model-autofill\n```\n\n也可以从 GitHub 直装：\n\n```sh\ndsh plugin --profile web add github:birdman1992/dsh-birdman-plugins#path:plugins/model-autofill\n```\n\n安装后重启 profile：\n\n```sh\ndsh --profile web\n```\n\n> 如果此前已经用 `link:` 方式安装过该插件，请先执行\n> `dsh plugin --profile web remove @birdman1992/model-autofill` 并删除\n> `cordis.patch.yml` 中手动插入的 model-autofill 行，再执行上面的安装命令，\n> 避免重复插入同一行 id。\n","readmeFilename":"README.md"}