🇨🇳 中文
(本轮新消息)"] --> B{"显式 @模型?"} B -- "@kimi 等" --> H["🎯 显式指令
最高优先"] B -- 否 --> C["📏 预设规则链
带图 / 关键词组
首条命中生效"] C -- 命中 --> D["🌙 规则目标
(未接入则降级跳过)"] C -- 未命中 --> E["💰 预设默认模型
(打底)"] H --> J D --> F{"带图且目标
文本-only?"} E --> F F -- 是 --> G["🖼️ 图像护栏
改道多模态候选"] F -- 否 --> J["📋 dock 面板留痕
选谁 + 为什么"] G --> J ``` --- ## 特性一览 - 🚦 **预设路由**:内置「省钱」「能力」两种预设,也可自建命名预设,设置卡片一键全局切换;按**每个步骤**决策,不是一会话绑定到死。 - 🎯 **规则引擎**(0.5.0):规则 = `带图` / 命名关键词组(内置「代码」「闲聊」两组,词表可改、可自建);首条命中生效,未命中走预设打底,不可用目标自动降级跳过。 - 🖼️ **图像护栏**:带图消息自动改道多模态模型;会话锁存防止历史含图后文本模型崩溃(`UNSUPPORTED_CONTENT`)。 - 👁️ **决策可观测**:dock 面板实时显示「这步选了谁、为什么」,会话日志留痕可复查——不黑箱。 - ⚙️ **官方设置卡片**:路由配置就在 DSH「设置 → 月汐」里编辑,原生分层持久化,重启保持。 - 🔌 **官方接入层**(0.4.x):Kimi 模型经 pi-ai 原生 `kimi-coding` 路由接入,**一把 Console API Key 即可**,不再需要 Kimi CLI 登录与令牌刷新。 - 📊 **官方配额显示**:dock 面板轮询 Kimi Code 用量接口,周配额 / 5h 窗口一目了然。 - ⌨️ **`/kimi-tide` 命令族**:`preset` / `show` / `set` / `export-config` / `import-config` / `refresh`,配置可导出备份、可导入恢复。 --- ## 快速开始 > 旧 OAuth 方案已退役,历史存档见 [`docs/legacy-setup.md`](https://github.com/tafcear/kimi-tide/blob/main/docs/legacy-setup.md)。 ### 1. 前置条件 - Node.js ≥ 22 - DSH `@deepseek-ai/dsh@0.1.0-rc.7` 及以上(设置卡片依赖 rc.7 的 `dsh-settings`) - 一把 **Kimi Code Console API Key**(Kimi 控制台获取) ### 2. 配置 Kimi 路由(官方 Models 页) DSH「设置 → Models」添加 provider **`kimi-coding`**,`apiKeyEnv` 填 `KIMI_API_KEY`(或自建引用名),在凭据区粘贴你的 Key。模型目录(k3 / k3-256k / kimi-for-coding / kimi-for-coding-highspeed)自动就位——密钥由 DSH 托管凭据存储,**不落任何插件配置文件**。 ### 3. 安装插件 ```bash cd packages/dsh-kimi-tide npm install && npm run build && npm pack dsh plugin --profile web add ./dsh-kimi-tide-
🇬🇧 English
(new this turn)"] --> B{"Explicit @model?"} B -- "@kimi etc." --> H["🎯 Explicit directive
highest priority"] B -- no --> C["📏 Preset rule chain
image / keyword groups
first hit wins"] C -- hit --> D["🌙 Rule target
(skipped if unavailable)"] C -- miss --> E["💰 Preset default
(baseline)"] H --> J D --> F{"Image step on a
text-only target?"} E --> F F -- yes --> G["🖼️ Image guard
reroute to multimodal"] F -- no --> J["📋 dock trail
who + why"] G --> J ``` --- ## Features - 🚦 **Preset-based routing**: built-in "saving" and "capability" presets, plus your own named presets, switched globally from the settings card; decisions are made **per step**, not per session. - 🎯 **Rule-driven routing** (0.5.0): a rule is *image-bearing* or a *named keyword group* (built-in "code" and "chitchat", custom groups allowed); first hit in list order wins; a miss routes to the preset default (baseline), and unavailable rule targets are skipped automatically. - 🖼️ **Image guard**: image-bearing steps reroute to multimodal candidates automatically; session latching prevents text-model crashes (`UNSUPPORTED_CONTENT`) once images enter history. - 👁️ **Observable decisions**: the dock panel shows "who was picked and why" for every step, with session-log traceability — no black box. - ⚙️ **Official settings card**: router config lives in DSH "Settings → 月汐", natively persisted with layered overrides and restart-safe storage. - 🔌 **Official access layer** (0.4.x): Kimi models arrive via the pi-ai native `kimi-coding` route — **one Console API key is all you need**; no Kimi CLI login or token refresh anymore. - 📊 **Official quota display**: the dock polls the Kimi Code usage endpoint — weekly quota and 5h window at a glance. - ⌨️ **`/kimi-tide` command family**: `preset` / `show` / `set` / `export-config` / `import-config` / `refresh` — export, back up, and restore your config. --- ## Quick Start > The old OAuth form is retired; archived in [`docs/legacy-setup.md`](https://github.com/tafcear/kimi-tide/blob/main/docs/legacy-setup.md). ### 1. Prerequisites - Node.js ≥ 22 - DSH `@deepseek-ai/dsh@0.1.0-rc.7` or newer (the settings card needs rc.7's `dsh-settings`) - A **Kimi Code Console API key** (from the Kimi console) ### 2. Configure the Kimi route (official Models page) In DSH "Settings → Models", add provider **`kimi-coding`**, set `apiKeyEnv` to `KIMI_API_KEY` (or your own reference name), and paste your key into the credential area. The model catalog (k3 / k3-256k / kimi-for-coding / kimi-for-coding-highspeed) appears automatically — the secret lives in the DSH managed credential store, **never in any plugin config file**. ### 3. Install the plugin ```bash cd packages/dsh-kimi-tide npm install && npm run build && npm pack dsh plugin --profile web add ./dsh-kimi-tide-