@goodandready/dsh-model-sync 0.4.6 → 0.4.8
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 +2 -0
- package/README.ru.md +2 -0
- package/README.zh.md +2 -0
- package/lib/client.js +2 -7
- package/lib/policy.js +3 -1
- package/lib/updater.js +7 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -78,6 +78,8 @@ graph LR
|
|
|
78
78
|
|
|
79
79
|
## ✨ Key Features
|
|
80
80
|
|
|
81
|
+
* ⚡ **High-Performance Policy Filtering**: Fast-path evaluation in `filterModels` bypasses regular expressions and array filtering when no filtering policy is configured, guaranteeing zero-overhead discovery runs.
|
|
82
|
+
* 🔄 **One-Click In-App Updates**: Built-in update checker in Settings with automatic npm cache bypass on demand (`?fresh=1` / `Cache-Control: no-cache`), ensuring instantaneous discovery of new package releases.
|
|
81
83
|
* 🔄 **Automated Catalog Discovery**: Syncs model lists, aliases, context windows, and capability flags (`vision`, `tools`, `reasoning`, `embeddings`) across 25+ providers.
|
|
82
84
|
* 🛡️ **Minijinja Chat Template & Role Compatibility**: Automatically sets `compat.supportsDeveloperRole: false` for Groq open-source models (Qwen, Llama, Mistral, Gemma, DeepSeek) and DeepSeek API, preventing 400 `Unexpected message role` errors with reasoning models while preserving user overrides.
|
|
83
85
|
* 🌐 **25+ Built-in Provider Adapters**: Pre-configured discovery for OpenAI, Anthropic, Google, DeepSeek, xAI, OpenRouter, Groq, Mistral, Cerebras, Fireworks, HuggingFace, Moonshot, NVIDIA, Qwen, Together, Xiaomi MiMo, SiliconFlow, Command Code, ClineBot, and local Ollama.
|
package/README.ru.md
CHANGED
|
@@ -78,6 +78,8 @@ graph LR
|
|
|
78
78
|
|
|
79
79
|
## ✨ Ключевые возможности
|
|
80
80
|
|
|
81
|
+
* ⚡ **Высокопроизводительная фильтрация моделей**: Быстрый путь (`fast-path`) в `filterModels` мгновенно возвращает каталог при отсутствии активных правил политики, исключая лишнюю компиляцию regex и прогоны массивов.
|
|
82
|
+
* 🔄 **Обновление плагина в один клик**: Встроенный механизм проверки обновлений в Настройках со сбросом кэша npm при ручном запросе (`?fresh=1` / `Cache-Control: no-cache`), гарантирующий получение актуальной версии.
|
|
81
83
|
* 🔄 **Автоматическое обнаружение каталога**: синхронизация списков моделей, алиасов, контекстных окон и флагов возможностей (`vision`, `tools`, `reasoning`, `embeddings`) для 25+ провайдеров.
|
|
82
84
|
* 🛡️ **Совместимость шаблонов чата и ролей Minijinja**: автоматическая установка `compat.supportsDeveloperRole: false` для открытых моделей Groq (Qwen, Llama, Mistral, Gemma, DeepSeek) и DeepSeek API, предотвращая ошибки 400 `Unexpected message role` для reasoning-моделей с сохранением пользовательских настроек.
|
|
83
85
|
* 🌐 **25+ встроенных адаптеров провайдеров**: готовая поддержка OpenAI, Anthropic, Google, DeepSeek, xAI, OpenRouter, Groq, Mistral, Cerebras, Fireworks, HuggingFace, Moonshot, NVIDIA, Qwen, Together, Xiaomi MiMo, SiliconFlow, Command Code, ClineBot и локальной Ollama.
|
package/README.zh.md
CHANGED
|
@@ -78,6 +78,8 @@ graph LR
|
|
|
78
78
|
|
|
79
79
|
## ✨ 核心特性
|
|
80
80
|
|
|
81
|
+
* ⚡ **高性能模型策略过滤**:在未配置过滤策略时,`filterModels` 采用快速路径直接返回模型目录,避免不必要的正则表达式编译和数组遍历。
|
|
82
|
+
* 🔄 **一键检查与更新**:内置设置面板更新检查,在手动刷新时通过 `?fresh=1` 或 `Cache-Control: no-cache` 绕过 npm 缓存,即时获取最新版本。
|
|
81
83
|
* 🔄 **自动化目录同步**:自动对齐 25+ 服务商的模型清单、别名、上下文窗口及能力标签(`vision`、`tools`、`reasoning`、`embeddings`)。
|
|
82
84
|
* 🛡️ **Minijinja 聊天模板与角色兼容性保障**:自动为 Groq 开源模型(Qwen、Llama、Mistral、Gemma、DeepSeek)及 DeepSeek API 注入 `compat.supportsDeveloperRole: false`,避免推理模型报 400 `Unexpected message role` 错误,同时保留用户自定义配置。
|
|
83
85
|
* 🌐 **内置 25+ 服务商适配器**:预置支持 OpenAI、Anthropic、Google、DeepSeek、xAI、OpenRouter、Groq、Mistral、Cerebras、Fireworks、HuggingFace、Moonshot、NVIDIA、Qwen、Together、Xiaomi MiMo、SiliconFlow、Command Code、ClineBot 以及本地 Ollama。
|
package/lib/client.js
CHANGED
|
@@ -410,7 +410,7 @@ window.__ModuleLoader__.load({
|
|
|
410
410
|
setUpdaterChecking(true)
|
|
411
411
|
setUpdaterError('')
|
|
412
412
|
setUpdaterNotice('')
|
|
413
|
-
fetch(`${api}/update`)
|
|
413
|
+
fetch(`${api}/update?fresh=1`)
|
|
414
414
|
.then((res) => {
|
|
415
415
|
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
416
416
|
return res.json()
|
|
@@ -1270,12 +1270,7 @@ window.__ModuleLoader__.load({
|
|
|
1270
1270
|
}
|
|
1271
1271
|
|
|
1272
1272
|
function apply(ctx) {
|
|
1273
|
-
ctx.effect(() => {
|
|
1274
|
-
try { ctx.locale?.register?.(NS, { en, zh }) } catch (err) {
|
|
1275
|
-
try { console.debug('[dsh-model-sync] locale register best-effort:', err) } catch { /* console unavailable */ }
|
|
1276
|
-
}
|
|
1277
|
-
return () => {}
|
|
1278
|
-
}, 'dsh-model-sync: dictionaries')
|
|
1273
|
+
ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'dsh-model-sync: dictionaries')
|
|
1279
1274
|
try {
|
|
1280
1275
|
// Plugin-list seat (plugins.item) first: it is the seat the current core
|
|
1281
1276
|
// (0.1.6-alpha.2) renders as the plugin's own page with its configuration. The
|
package/lib/policy.js
CHANGED
|
@@ -62,10 +62,12 @@ export function hasPolicy(policy) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export function filterModels(models, policy) {
|
|
65
|
+
if (!models || !models.length) return []
|
|
66
|
+
if (!hasPolicy(policy)) return models
|
|
65
67
|
const normalized = validatePolicy(policy)
|
|
66
68
|
const include = compilePatterns(normalized.include, 'include')
|
|
67
69
|
const exclude = compilePatterns(normalized.exclude, 'exclude')
|
|
68
|
-
return
|
|
70
|
+
return models.filter((model) => {
|
|
69
71
|
const haystack = [model?.id, model?.name, ...(Array.isArray(model?.tags) ? model.tags : [])]
|
|
70
72
|
.filter((value) => typeof value === 'string').join('\n')
|
|
71
73
|
if (include.length > 0 && !include.some((pattern) => pattern.test(haystack))) return false
|
package/lib/updater.js
CHANGED
|
@@ -298,6 +298,13 @@ export function registerPluginUpdater(ctx, options = {}) {
|
|
|
298
298
|
try {
|
|
299
299
|
const target = runtime()
|
|
300
300
|
if (request.method === 'GET' || request.method === 'HEAD') {
|
|
301
|
+
const isFresh = Boolean(
|
|
302
|
+
request.url?.includes('fresh=1') ||
|
|
303
|
+
request.headers?.['cache-control'] === 'no-cache'
|
|
304
|
+
)
|
|
305
|
+
if (isFresh) {
|
|
306
|
+
resetLatestCache()
|
|
307
|
+
}
|
|
301
308
|
const payload = await status({ ...options, packageName }, target)
|
|
302
309
|
response.writeHead(200, {
|
|
303
310
|
'content-type': 'application/json; charset=utf-8',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-model-sync",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Automatic model catalog synchronization for API-key DeepSeek Harness providers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
"lib",
|
|
31
31
|
"cordis.patch.yml",
|
|
32
32
|
"README.md",
|
|
33
|
-
"LICENSE"
|
|
33
|
+
"LICENSE",
|
|
34
|
+
"README.zh.md",
|
|
35
|
+
"README.ru.md"
|
|
34
36
|
],
|
|
35
37
|
"dsh": {
|
|
36
38
|
"bundle": {
|