@goodandready/dsh-clinebot 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,13 +13,13 @@
13
13
 
14
14
  <!-- Author Showcase Link -->
15
15
  <p align="center">
16
- <a href="https://goodandready.app/"><img src="https://img.shields.io/badge/All_Author_Projects-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="All Projects"></a>
16
+ <a href="https://goodandready.app/"><img src="https://img.shields.io/badge/All_Author_Projects-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="GoodAndReady Showcase"></a>
17
17
  </p>
18
18
 
19
19
  <p align="center">
20
20
  <a href="README.md"><b>🇬🇧 English</b></a> •
21
- <a href="README.ru.md"><b>🇷🇺 Русский</b></a> •
22
- <a href="README.zh.md"><b>🇨🇳 中文说明</b></a>
21
+ <a href="docs/README.ru.md"><b>🇷🇺 Русский</b></a> •
22
+ <a href="docs/README.zh.md"><b>🇨🇳 中文说明</b></a>
23
23
  </p>
24
24
 
25
25
  </div>
@@ -109,27 +109,31 @@ graph LR
109
109
  dsh plugin --profile web add @goodandready/dsh-clinebot
110
110
  ```
111
111
 
112
+ Restart your DeepSeek Harness instance and refresh the browser.
113
+
112
114
  ---
113
115
 
114
116
  ## 💬 Slash-Command `/cline`
115
117
 
116
- From any DSH chat session, type `/cline` to inspect quota:
118
+ From any DSH chat session, type `/cline` to inspect quota and status:
117
119
 
118
120
  ```text
119
121
  ### 🤖 ClinePass Status (ClinePass ($9.99/mo))
120
- * Пинг хоста: ✅ 210 мс
121
- * Активный ключ: CLINEBOT_API_KEY (credentials)
122
- * Модель по умолчанию: `cline-pass/deepseek-v4-flash`
122
+ * Latency: ✅ 210 ms
123
+ * Active Key: CLINEBOT_API_KEY (credentials)
124
+ * Default Model: `cline-pass/deepseek-v4-flash`
123
125
 
124
- ⏱ 5-часовое окно: [████░░░░░░] 42% (сброс: 18:00)
125
- 📅 Недельное окно: [██████░░░░] 60% (сброс: 08.09)
126
- * Аккаунт: `developer@example.com`
126
+ ⏱ 5-Hour Window: [████░░░░░░] 42% (resets: 18:00)
127
+ 📅 Weekly Window: [██████░░░░] 60% (resets: Sep 8)
128
+ * Account: `developer@example.com`
127
129
  ```
128
130
 
129
131
  ---
130
132
 
131
133
  ## ⚙️ Configuration Reference (`settings.yaml`)
132
134
 
135
+ Configure options in `settings.yaml` or directly inside the Web UI:
136
+
133
137
  ```yaml
134
138
  dsh-clinebot:
135
139
  enabled: true
@@ -146,6 +150,29 @@ dsh-clinebot:
146
150
  customModels: []
147
151
  ```
148
152
 
153
+ ### Configuration Parameters
154
+
155
+ | Parameter | Type | Default | Description |
156
+ |:---|:---|:---|:---|
157
+ | `enabled` | `boolean` | `true` | Enable or disable the ClineBot provider bridge |
158
+ | `baseUrl` | `string` | `"https://api.cline.bot/api/v1"` | ClinePass OpenAI-compatible base URL |
159
+ | `apiKeyEnv` | `string` | `"CLINEBOT_API_KEY"` | Environment variable / credentials key name |
160
+ | `defaultModel` | `string` | `"cline-pass/deepseek-v4-flash"` | Default selected model ID |
161
+ | `timeoutMs` | `number` | `15000` | HTTP request timeout in milliseconds |
162
+ | `smokeTimeoutMs` | `number` | `25000` | Smoke test latency ping timeout |
163
+ | `enabledModels` | `array` | `[...]` | List of models exposed in the DSH chat picker |
164
+ | `customModels` | `array` | `[]` | User-defined custom model entries |
165
+
166
+ ---
167
+
168
+ ## 🧪 Testing
169
+
170
+ Run the automated test suite:
171
+
172
+ ```bash
173
+ npm test
174
+ ```
175
+
149
176
  ---
150
177
 
151
178
  ## 📄 License
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/@goodandready/dsh-clinebot"><img src="https://img.shields.io/npm/v/@goodandready/dsh-clinebot.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
9
- <a href="LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-clinebot.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
9
+ <a href="../LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-clinebot.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
10
10
  <a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>
11
11
  <a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>
12
12
  </p>
@@ -17,7 +17,7 @@
17
17
  </p>
18
18
 
19
19
  <p align="center">
20
- <a href="README.md"><b>🇬🇧 English</b></a> •
20
+ <a href="../README.md"><b>🇬🇧 English</b></a> •
21
21
  <a href="README.ru.md"><b>🇷🇺 Русский</b></a> •
22
22
  <a href="README.zh.md"><b>🇨🇳 中文说明</b></a>
23
23
  </p>
@@ -30,7 +30,13 @@
30
30
 
31
31
  **ClinePass** (`https://cline.bot`) — сервис единой фиксированной подписки (\$9.99/мес), предоставляющий разработчикам повышенные лимиты (в 2–5 раз выше стандартных) на передовые open-weights модели программирования и рассуждений через единый OpenAI-совместимый интерфейс (`https://api.cline.bot/api/v1`).
32
32
 
33
- Плагин **`@goodandready/dsh-clinebot`** обеспечивает полноценную интеграцию подписки в DeepSeek Harness:
33
+ Интеграция ClinePass в DeepSeek Harness (DSH) напрямую сопряжена со следующими сложностями:
34
+ 1. **Отсутствие эндпоинта `/v1/models`**: запрос `GET /v1/models` к `api.cline.bot` возвращает `404 Not Found`, из-за чего динамический поиск моделей в DSH падает или оставляет список пустым.
35
+ 2. **Специфический формат идентификаторов**: моделям требуется обязательный префикс `cline-pass/` (например, `cline-pass/deepseek-v4-flash`, `cline-pass/kimi-k3`).
36
+ 3. **Отслеживание лимитов**: 5-часовые и недельные скользящие окна расхода токенов требуют прозрачной визуализации в интерфейсе.
37
+ 4. **Безопасность ключей**: хранение API-токенов в открытых конфигурациях небезопасно.
38
+
39
+ Плагин **`@goodandready/dsh-clinebot`** решает эти задачи «из коробки»:
34
40
  * 🖥️ **Отдельная страница в Настройках**: собственная полноэкранная страница в меню Настроек DSH (`Настройки → ClineBot`).
35
41
  * 📊 **Дашборд лимитов подписки (Usage)**: наглядные прогресс-бары расхода 5-часового и недельного скользящего окна из официального API `GET /users/me/plan/usage-limits` с таймером сброса.
36
42
  * 🔑 **Сохранение ключа прямо из UI**: поле ввода ключа с маскировкой; сохранение напрямую в системный сервис `credentials` (`~/.dsh/.credentials.yaml`) без ручной правки файлов на сервере.
@@ -81,12 +87,27 @@ graph LR
81
87
 
82
88
  ---
83
89
 
84
- ## 📦 Быстрая установка
90
+ ## ✨ Структура модулей и возможности
91
+
92
+ * **`lib/models.js`**: каталог встроенных моделей ClinePass (11 моделей) и управление пользовательскими моделями (`getAllModels`, `validateCustomModel`).
93
+ * **`lib/cline-client.js`**:
94
+ * `fetchUsageLimits`: опрос `GET /users/me/plan/usage-limits` и `GET /users/me` с кэшированием в памяти.
95
+ * `saveCredentialKey`: атомарная запись ключей в `~/.dsh/.credentials.yaml`.
96
+ * `smokeChat`: замер задержки и тестовый пинг.
97
+ * `buildPiAiProvider`: генерация конфигурации провайдера для `llm-pi-ai` (`api: 'openai-completions'`).
98
+ * **`lib/index.js`**: сервис Cordis, регистрация системных маршрутов и слэш-команды `/cline`.
99
+ * **`lib/client.js`**: полнофункциональный раздел настроек (`settings.section`, order 28) и аккордеон плагина (`settings.plugin.item`).
100
+
101
+ ---
102
+
103
+ ## 📦 Установка
85
104
 
86
105
  ```bash
87
106
  dsh plugin --profile web add @goodandready/dsh-clinebot
88
107
  ```
89
108
 
109
+ Перезапустите экземпляр DeepSeek Harness и обновите вкладку в браузере.
110
+
90
111
  ---
91
112
 
92
113
  ## 💬 Слэш-команда `/cline` в чате
@@ -124,6 +145,29 @@ dsh-clinebot:
124
145
  customModels: []
125
146
  ```
126
147
 
148
+ ### Параметры конфигурации
149
+
150
+ | Параметр | Тип | По умолчанию | Описание |
151
+ |:---|:---|:---|:---|
152
+ | `enabled` | `boolean` | `true` | Включение моста провайдера ClineBot |
153
+ | `baseUrl` | `string` | `"https://api.cline.bot/api/v1"` | Базовый URL OpenAI-совместимого API ClinePass |
154
+ | `apiKeyEnv` | `string` | `"CLINEBOT_API_KEY"` | Имя переменной / ключа в хранилище credentials |
155
+ | `defaultModel` | `string` | `"cline-pass/deepseek-v4-flash"` | Модель, выбираемая по умолчанию |
156
+ | `timeoutMs` | `number` | `15000` | Таймаут HTTP-запросов (мс) |
157
+ | `smokeTimeoutMs` | `number` | `25000` | Таймаут тестового пинга (мс) |
158
+ | `enabledModels` | `array` | `[...]` | Список моделей, активных в селекторе чата |
159
+ | `customModels` | `array` | `[]` | Пользовательские модели, добавленные через интерфейс |
160
+
161
+ ---
162
+
163
+ ## 🧪 Тестирование
164
+
165
+ Запуск автоматического набора тестов:
166
+
167
+ ```bash
168
+ npm test
169
+ ```
170
+
127
171
  ---
128
172
 
129
173
  ## 📄 Лицензия
@@ -0,0 +1,177 @@
1
+ # 📦 @goodandready/dsh-clinebot
2
+
3
+ <div align="center">
4
+
5
+ <h3>适用于 DeepSeek Harness 的 ClineBot / ClinePass 原生模型提供商伴侣插件</h3>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@goodandready/dsh-clinebot"><img src="https://img.shields.io/npm/v/@goodandready/dsh-clinebot.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
9
+ <a href="../LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-clinebot.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
10
+ <a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>
11
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>
12
+ </p>
13
+
14
+ <!-- 作者所有项目展示页面链接 -->
15
+ <p align="center">
16
+ <a href="https://goodandready.app/"><img src="https://img.shields.io/badge/作者所有开源项目-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="所有项目"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="../README.md"><b>🇬🇧 English</b></a> •
21
+ <a href="README.ru.md"><b>🇷🇺 Русский</b></a> •
22
+ <a href="README.zh.md"><b>🇨🇳 中文说明</b></a>
23
+ </p>
24
+
25
+ </div>
26
+
27
+ ---
28
+
29
+ ## ⚡ 概述与解决的核心痛点
30
+
31
+ **ClinePass** (`https://cline.bot`) 是一项固定月费(\$9.99/月)的高性价比订阅服务,为开发者提供主流开源代码模型与推理模型 2–5 倍的高并发调用限额,统一通过 OpenAI 兼容接口 (`https://api.cline.bot/api/v1`) 提供服务。
32
+
33
+ 在将 ClinePass 接入 DeepSeek Harness (DSH) 时存在以下挑战:
34
+ 1. **缺失 `/v1/models` 接口**:`api.cline.bot` 的 `GET /v1/models` 会直接返回 `404 Not Found`,导致动态模型同步失败或模型列表为空。
35
+ 2. **专属模型前缀**:所有模型 ID 均需前缀 `cline-pass/`(如 `cline-pass/deepseek-v4-flash`, `cline-pass/kimi-k3`)。
36
+ 3. **用量额度监控**:5 小时滑动窗口与每周限额需要清晰直观的可视化进度监控。
37
+ 4. **安全凭据隔离**:禁止在明文配置中直接填写密钥。
38
+
39
+ **`@goodandready/dsh-clinebot`** 完美解决以上痛点:
40
+ * 🖥️ **专属设置大页**:在 DSH 设置中提供全宽独立页面(`设置 → ClineBot`)。
41
+ * 📊 **实时用量仪表盘**:调用官方 `GET /users/me/plan/usage-limits` API,实时渲染 5 小时与每周额度进度条及重置倒计时。
42
+ * 🔑 **界面直存密钥**:在 UI 中直接粘贴 API 密钥,通过 `ctx.credentials.set()` 自动安全保存至 `~/.dsh/.credentials.yaml`。
43
+ * 🎯 **模型选择器管理**:支持勾选开启/关闭特定模型在聊天选择器中的显示。
44
+ * ➕ **自定义新模型**:支持直接在界面新增官方新推出的模型(ID、名称、上下文、Vision),无需等待插件发版。
45
+ * 💬 **聊天斜杠指令 `/cline`**:在任意聊天框快速查询当前配额、网络延迟与活跃模型。
46
+
47
+ ---
48
+
49
+ ## 🏛️ 架构设计
50
+
51
+ ```mermaid
52
+ graph LR
53
+ subgraph UI [DSH Web 前端界面]
54
+ Page["独立配置页 (设置 -> ClineBot)"]
55
+ QuotaBar["5小时与每周额度进度条"]
56
+ KeyInput["API 密钥直填与安全保存"]
57
+ ModelPick["模型选择器管控与自定义模型"]
58
+ end
59
+
60
+ subgraph PluginHost [dsh-clinebot 宿主运行环境]
61
+ HttpEndpoints["API 路由: /api/plugins/dsh-clinebot/*"]
62
+ ClientCore["lib/cline-client.js"]
63
+ ModelCatalog["lib/models.js (内置精选 + 用户自定义)"]
64
+ SlashCmd["斜杠指令: /cline"]
65
+ end
66
+
67
+ subgraph DSHCore [DSH 核心系统服务]
68
+ Credentials["凭据存储服务 (~/.dsh/.credentials.yaml)"]
69
+ PiAi["模型注册: llm-pi-ai.providers.clinebot"]
70
+ end
71
+
72
+ subgraph Upstream [Cline 官方云端]
73
+ ClinePass["api.cline.bot/api/v1/chat/completions"]
74
+ ClineQuota["api.cline.bot/api/v1/users/me/plan/usage-limits"]
75
+ end
76
+
77
+ Page -->|GET /status & /usage| HttpEndpoints
78
+ KeyInput -->|POST /save-key| HttpEndpoints
79
+ ModelPick -->|POST /register & /models| HttpEndpoints
80
+ HttpEndpoints --> Credentials
81
+ HttpEndpoints --> ClientCore
82
+ ClientCore --> ModelCatalog
83
+ HttpEndpoints -->|原子级写入| PiAi
84
+ ClientCore -->|模型对话| ClinePass
85
+ ClientCore -->|额度查询| ClineQuota
86
+ ```
87
+
88
+ ---
89
+
90
+ ## ✨ 核心模块与功能
91
+
92
+ * **`lib/models.js`**:管理 11 款官方精选内置模型以及用户自定义模型(`getAllModels`, `validateCustomModel`)。
93
+ * **`lib/cline-client.js`**:
94
+ * `fetchUsageLimits`:高效轮询 `GET /users/me/plan/usage-limits` 与 `GET /users/me` 并进行内存缓存。
95
+ * `saveCredentialKey`:将密钥安全写入 `~/.dsh/.credentials.yaml`。
96
+ * `smokeChat`:毫秒级网络探活与非流式延迟测试。
97
+ * `buildPiAiProvider`:构建 DSH `llm-pi-ai` 兼容的服务商定义 (`api: 'openai-completions'`)。
98
+ * **`lib/index.js`**:Cordis 插件主生命周期服务,注册后端 REST API 路由与 `/cline` 聊天斜杠指令。
99
+ * **`lib/client.js`**:前端设置面板(`settings.section` 序号 28)与插件折叠卡片。
100
+
101
+ ---
102
+
103
+ ## 📦 快速安装
104
+
105
+ 在 DeepSeek Harness Web 配置中安装:
106
+
107
+ ```bash
108
+ dsh plugin --profile web add @goodandready/dsh-clinebot
109
+ ```
110
+
111
+ 重启 DeepSeek Harness 实例并刷新浏览器页面。
112
+
113
+ ---
114
+
115
+ ## 💬 聊天斜杠指令 `/cline`
116
+
117
+ 在任何聊天会话中输入 `/cline` 即可即时检查配额:
118
+
119
+ ```text
120
+ ### 🤖 ClinePass Status (ClinePass ($9.99/mo))
121
+ * 响应延迟: ✅ 210 ms
122
+ * 活跃密钥: CLINEBOT_API_KEY (credentials)
123
+ * 默认模型: `cline-pass/deepseek-v4-flash`
124
+
125
+ ⏱ 5 小时窗口: [████░░░░░░] 42% (重置时间: 18:00)
126
+ 📅 每周窗口: [██████░░░░] 60% (重置时间: 09月08日)
127
+ * 绑定账号: `developer@example.com`
128
+ ```
129
+
130
+ ---
131
+
132
+ ## ⚙️ 配置项参考 (`settings.yaml`)
133
+
134
+ ```yaml
135
+ dsh-clinebot:
136
+ enabled: true
137
+ baseUrl: https://api.cline.bot/api/v1
138
+ apiKeyEnv: CLINEBOT_API_KEY
139
+ defaultModel: cline-pass/deepseek-v4-flash
140
+ timeoutMs: 15000
141
+ smokeTimeoutMs: 25000
142
+ enabledModels:
143
+ - cline-pass/deepseek-v4-flash
144
+ - cline-pass/deepseek-v4-pro
145
+ - cline-pass/kimi-k3
146
+ - cline-pass/qwen3.7-max
147
+ customModels: []
148
+ ```
149
+
150
+ ### 配置参数说明
151
+
152
+ | 参数项 | 类型 | 默认值 | 说明 |
153
+ |:---|:---|:---|:---|
154
+ | `enabled` | `boolean` | `true` | 是否启用 ClineBot 桥接插件 |
155
+ | `baseUrl` | `string` | `"https://api.cline.bot/api/v1"` | ClinePass OpenAI 兼容接口地址 |
156
+ | `apiKeyEnv` | `string` | `"CLINEBOT_API_KEY"` | 凭据管理系统中的密钥名称 |
157
+ | `defaultModel` | `string` | `"cline-pass/deepseek-v4-flash"` | 默认选中的模型 ID |
158
+ | `timeoutMs` | `number` | `15000` | HTTP 请求超时时间(毫秒) |
159
+ | `smokeTimeoutMs` | `number` | `25000` | 探活测试超时时间(毫秒) |
160
+ | `enabledModels` | `array` | `[...]` | 允许在聊天下拉框中显示的可用模型列表 |
161
+ | `customModels` | `array` | `[]` | 用户在界面中自定义新增的模型定义列表 |
162
+
163
+ ---
164
+
165
+ ## 🧪 测试
166
+
167
+ 运行自动化测试套件:
168
+
169
+ ```bash
170
+ npm test
171
+ ```
172
+
173
+ ---
174
+
175
+ ## 📄 许可证
176
+
177
+ MIT © [GooDAnDReaDY](https://github.com/GooDAnDReaDY)
@@ -0,0 +1,60 @@
1
+ # Design Contract: `@goodandready/dsh-clinebot`
2
+
3
+ ## 1. Executive Summary
4
+ `@goodandready/dsh-clinebot` is a companion plugin for DeepSeek Harness (DSH) enabling native integration of the **ClineBot / ClinePass** subscription provider. Because ClinePass is an OpenAI-compatible endpoint whose `GET /v1/models` returns `404 Not Found`, dynamic discovery is impossible. This plugin acts as the bridge: delivering a curated catalog of open-weights models, securely resolving credentials, exposing health and smoke tests, and mutating the DSH `llm-pi-ai` provider registry.
5
+
6
+ ## 2. Architecture & Cordis Lifecycles
7
+ The plugin consists of two runtime boundaries conforming to DSH authoring standards:
8
+
9
+ ### 2.1 Host Runtime (`lib/index.js`, `lib/cline-client.js`, `lib/models.js`, `lib/http.js`)
10
+ * **Cordis Service Registration**: Injects `['settings', 'webServer', 'credentials']`.
11
+ * **Credential Isolation**: The plugin NEVER stores plain API keys in its configuration. The setting `apiKeyEnv` holds the credential identifier (default: `CLINEBOT_API_KEY`), resolved via `ctx.credentials.resolve()` or `process.env`.
12
+ * **State Synchronization**: Mutates the core `llm-pi-ai` settings space (`op: 'set', path: ['providers', 'clinebot']`) when enabled or registered.
13
+
14
+ ### 2.2 Client Runtime (`lib/client.js`)
15
+ * Self-registering module via `window.__ModuleLoader__.load({ id: '@goodandready/dsh-clinebot', factory })`.
16
+ * Slots into `settings.plugin.item` (primary) and `settings.section` (fallback).
17
+ * Uses native design tokens (`--dsw-alias-...`) with full dark/light theme support.
18
+
19
+ ```mermaid
20
+ graph LR
21
+ subgraph Client [DSH Web Interface]
22
+ UI[Settings Card: ClineBot]
23
+ SmokeBtn[Smoke Test Button]
24
+ RegBtn[Register in DSH Models]
25
+ end
26
+
27
+ subgraph Host [DSH Node.js Runtime]
28
+ API["HTTP API: /api/plugins/dsh-clinebot/*"]
29
+ ClientHelper["lib/cline-client.js"]
30
+ Catalog["lib/models.js (Static 11 Models)"]
31
+ CredService[DSH Credentials Service]
32
+ PiAiSettings["DSH Settings: llm-pi-ai"]
33
+ end
34
+
35
+ subgraph Remote [Cline Service]
36
+ ClineAPI["api.cline.bot/api/v1"]
37
+ end
38
+
39
+ UI -->|GET /status| API
40
+ SmokeBtn -->|POST /smoke| API
41
+ RegBtn -->|POST /register| API
42
+ API --> CredService
43
+ API --> ClientHelper
44
+ ClientHelper --> Catalog
45
+ API -->|Mutate| PiAiSettings
46
+ ClientHelper -->|POST /chat/completions| ClineAPI
47
+ ```
48
+
49
+ ## 3. UI/UX Contract
50
+ * **Badges**:
51
+ * Host connectivity: `Host online (<ms>)` (green) / `Host unreachable` (red).
52
+ * Credential presence: `Key ✓ (credentials|env)` (green) / `Key missing` (amber).
53
+ * Registration status: `DSH Registered` (green) / `Not Registered` (amber).
54
+ * **Model Picker**: Interactive checklist of all 11 official models with multi-select and vision capability indicators.
55
+ * **Non-destructive actions**: Unregister cleanly removes the provider entry from DSH without touching other providers or configurations.
56
+
57
+ ## 4. Security & Isolation
58
+ * CSRF / Cross-site protection: All mutating routes (`/register`, `/unregister`, `/smoke`, `/models`) validate `isTrustedSettingsRequest(req)` (`Sec-Fetch-Site !== 'cross-site'`).
59
+ * Body size limits: Request payloads are strictly capped at 256 KB.
60
+ * Sensitive credential data is never returned across the HTTP API (only `{ present: boolean, source: string, envName: string }`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-clinebot",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "DeepSeek Harness companion for ClineBot / ClinePass: dedicated settings page, live quota usage limits dashboard, in-UI credentials saving, static & custom models catalog, model picker control, and /cline slash-command.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,8 +15,7 @@
15
15
  "lib/",
16
16
  "cordis.patch.yml",
17
17
  "README.md",
18
- "README.ru.md",
19
- "README.zh.md",
18
+ "docs/",
20
19
  "CHANGELOG.md",
21
20
  "LICENSE"
22
21
  ],
package/README.zh.md DELETED
@@ -1,68 +0,0 @@
1
- # 📦 @goodandready/dsh-clinebot
2
-
3
- <div align="center">
4
-
5
- <h3>适用于 DeepSeek Harness 的 ClineBot / ClinePass 原生模型提供商伴侣插件</h3>
6
-
7
- <p align="center">
8
- <a href="https://www.npmjs.com/package/@goodandready/dsh-clinebot"><img src="https://img.shields.io/npm/v/@goodandready/dsh-clinebot.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>
9
- <a href="LICENSE"><img src="https://img.shields.io/github/license/GooDAnDReaDY/dsh-clinebot.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>
10
- <a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>
11
- <a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>
12
- </p>
13
-
14
- <!-- 作者所有项目展示页面链接 -->
15
- <p align="center">
16
- <a href="https://goodandready.app/"><img src="https://img.shields.io/badge/作者所有开源项目-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="所有项目"></a>
17
- </p>
18
-
19
- <p align="center">
20
- <a href="README.md"><b>🇬🇧 English</b></a> •
21
- <a href="README.ru.md"><b>🇷🇺 Русский</b></a> •
22
- <a href="README.zh.md"><b>🇨🇳 中文说明</b></a>
23
- </p>
24
-
25
- </div>
26
-
27
- ---
28
-
29
- ## ⚡ 概述与解决的问题
30
-
31
- **ClinePass** (`https://cline.bot`) 是一项固定月费(\$9.99/月)的高性价比订阅服务,为开发者提供主流开源代码模型与推理模型 2–5 倍的高并发调用限额,统一通过 OpenAI 兼容接口 (`https://api.cline.bot/api/v1`) 提供服务。
32
-
33
- 在将 ClinePass 接入 DeepSeek Harness (DSH) 时存在以下挑战:
34
- 1. **缺失 `/v1/models` 接口**:`api.cline.bot` 的 `GET /v1/models` 会直接返回 `404 Not Found`,导致动态模型同步失败。
35
- 2. **专属模型前缀**:所有模型 ID 均需前缀 `cline-pass/`(如 `cline-pass/deepseek-v4-flash`, `cline-pass/kimi-k3`)。
36
- 3. **安全凭据隔离**:禁止在明文配置中直接填写密钥。
37
-
38
- **`@goodandready/dsh-clinebot`** 完美解决以上痛点:
39
- * 🎯 内置包含全部 11 款官方 ClinePass 模型的静态精选目录。
40
- * 🔐 深度集成 DSH `credentials` 服务 (`~/.dsh/.credentials.yaml`),凭据隔离无泄漏。
41
- * 🔄 一键写入 DSH `llm-pi-ai` 模型注册表。
42
- * 🩺 设置面板内置毫秒级延迟探测与 Smoke Test 测试生成。
43
-
44
- ---
45
-
46
- ## 📦 快速安装
47
-
48
- 在活动的 DeepSeek Harness 配置中安装:
49
-
50
- ```bash
51
- dsh plugin --profile web add @goodandready/dsh-clinebot
52
- ```
53
-
54
- ---
55
-
56
- ## 🔑 凭据配置
57
-
58
- 在 DSH 凭据文件 (`~/.dsh/.credentials.yaml`) 中添加 ClinePass 密钥:
59
-
60
- ```yaml
61
- CLINEBOT_API_KEY: "your-clinepass-api-key"
62
- ```
63
-
64
- ---
65
-
66
- ## 📄 许可证
67
-
68
- MIT © [GooDAnDReaDY](https://github.com/GooDAnDReaDY)