dsh-model-rotator 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.
Files changed (2) hide show
  1. package/client.js +12 -5
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -74,7 +74,7 @@ window.__ModuleLoader__.load({
74
74
  "models.channelOff": "全部关闭",
75
75
  "models.expandAll": "全部展开",
76
76
  "models.collapseAll": "全部收起",
77
- "models.search": "搜索模型…",
77
+ "models.search": "搜索模型…(空格分隔多个关键词,需全部命中)",
78
78
  "models.searchClear": "清除",
79
79
  "models.searchHits": "命中 {n} / {total} 个模型",
80
80
  "models.searchNone": "没有匹配的模型",
@@ -166,7 +166,7 @@ window.__ModuleLoader__.load({
166
166
  "models.channelOff": "all off",
167
167
  "models.expandAll": "Expand all",
168
168
  "models.collapseAll": "Collapse all",
169
- "models.search": "Search models…",
169
+ "models.search": "Search models… (space-separated terms must all match)",
170
170
  "models.searchClear": "Clear",
171
171
  "models.searchHits": "{n} of {total} models match",
172
172
  "models.searchNone": "No model matches",
@@ -383,9 +383,16 @@ window.__ModuleLoader__.load({
383
383
  * the rows all call it during the same render pass.
384
384
  */
385
385
  const matches = (row) => {
386
- const needle = query.trim().toLowerCase();
387
- if (needle === "") return true;
388
- return (String(row.provider) + "/" + String(row.model)).toLowerCase().includes(needle);
386
+ // Split on whitespace and require EVERY token, rather than matching the whole
387
+ // box as one substring. A reader types "deepseek flash", not
388
+ // "deepseek-v4-flash": as a single substring the first form matches nothing
389
+ // while the second matches only the rows that happen to be hyphenated that
390
+ // way. Per-token AND is what the half-remembered name actually needs.
391
+ const tokens = query.trim().toLowerCase().split(/\s+/).filter(Boolean);
392
+ if (tokens.length === 0) return true;
393
+ const hay = (String(row.provider) + "/" + String(row.model)).toLowerCase();
394
+ for (const token of tokens) if (!hay.includes(token)) return false;
395
+ return true;
389
396
  };
390
397
  // True whenever the box holds something. Declared with the state, before
391
398
  // anything that reads it: the box renders before the payload is inspected,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-model-rotator",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Model auto-ranking and transparent failover for DeepSeek Harness: ranks discovered models by measured connectivity and speed, switches to the next candidate inside the same turn when the current one is unusable, and ships a grouped model list with per-channel switches. Never modifies model or provider configuration.",
5
5
  "type": "module",
6
6
  "main": "index.js",