dsh-thinking-levels 4.4.12 → 4.4.14

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/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
1
  # Changelog
2
+ 4.4.14: auto 档简单工具判定修复(issue #8)+ 可配置追加名单 `Config.simpleTools`。
3
+
4
+ ## [4.4.14] — 2026-11-10 (auto 降档:命名空间剥离 + shell/pwsh 内置 + 可配置追加名单)
5
+
6
+ ### 修复
7
+ - **issue #8:auto 档在带命名空间工具名宿主恒降不到 `low`**。`SIMPLE_TOOL_RE` 词首锚定导致 `ops_bash`/`ops_grep`/`ops_read_files` 一律判非简单 → `simpleRatio()` 恒 0 → 恒 `high`。新增 `TOOL_NAMESPACE_RE` 先剥 `ops_` 前缀再判(`ops_` 系 dsh-ops 插件族的工具前缀,非宿主通用包装)。
8
+ - **命令工具名缺项**:内置简单工具表补 `shell`/`pwsh`/`cmd`/`sh`(此前仅 `bash`/`terminal`),使以 `shell`/`pwsh` 为命令入口的宿主(dsh-bash-terminal-ts、官方 pwsh)短调用也能降 `low`。
9
+
10
+ ### 新增
11
+ - **`Config.simpleTools`(追加名单,volatile 热生效)**:逗号/空格分隔的工具名并入内置匹配,同样先剥 `ops_` 再按词边界判定;设置面在「模型能力」块上方新增文本框;9 语 `card.simpleTools`/`card.simpleToolsHint`。
12
+
13
+ ### 测试
14
+ - 新增 5 条:shell/pwsh→low、ops_shell→low、配置追加名→low、ops_web_fetch 经剥离→low、词边界仍守 codebase_reader 判 high。全量 234/234。
15
+
2
16
  4.4.9: per-model PDF input declaration + host enumeration addendum for DSH 0.2.1-rc.4.
3
17
 
4
18
  ## [4.4.9] — 2026-10-28 (模型级 PDF 输入声明 + rc.4 枚举)
package/dsh.plugin.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-thinking-levels",
3
- "version": "4.4.12",
3
+ "version": "4.4.14",
4
4
  "main": "./lib/index.js",
5
5
  "description": "thinking-level (reasoning_effort) control — auto-adjust per tool round, with optional manual lock and per-tool timing telemetry.",
6
6
  "engines": {
7
- "dsh": "0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5 || 0.2.2-rc.1"
7
+ "dsh": ">=0.1.1-rc.2 <0.3.0"
8
8
  },
9
9
  "contributes": {
10
10
  "tools": [],
package/lib/client.js CHANGED
@@ -29,6 +29,8 @@ window.__ModuleLoader__.load({
29
29
  "card.allowDowngrade": "允许降档(auto 可降至 low)",
30
30
  "card.allowUpgrade": "允许升档(auto 可升至 max)",
31
31
  "card.defaultPricing": "目录外定价",
32
+ "card.simpleTools": "简单工具白名单(auto 降档判定)",
33
+ "card.simpleToolsHint": "逗号或空格分隔的工具名,追加进内置的「廉价确定性工具」判定(如 shell、pwsh、web_fetch)。auto 档据此把仅由这类短小调用构成的步骤降到低档;内置已覆盖 bash/terminal/shell/pwsh 等,此处仅补充宿主专有工具名。",
32
34
  "card.defaultPricingHint": "定价目录未收录的模型(含其他插件接入的网关型号)如何计价;目录内模型始终按自己的目录价。改价只影响后续新账。",
33
35
  "card.defaultPricing.estimate": "estimate — 典型价兜底估算(未校准·仅供参考,默认)",
34
36
  "card.defaultPricing.cn": "cn — 人民币校准档(目录外仍按典型价估算)",
@@ -131,6 +133,8 @@ window.__ModuleLoader__.load({
131
133
  "card.allowDowngrade": "Allow downgrade (auto may drop to low)",
132
134
  "card.allowUpgrade": "Allow upgrade (auto may lift to max)",
133
135
  "card.defaultPricing": "Off-catalog pricing",
136
+ "card.simpleTools": "Simple-tool allowlist (auto downgrade)",
137
+ "card.simpleToolsHint": "Comma- or space-separated tool names added to the built-in \"cheap and deterministic tool\" set (e.g. shell, pwsh, web_fetch). In auto, a step made only of these short calls drops to low. The built-in set already covers bash/terminal/shell/pwsh; use this for host-specific names.",
134
138
  "card.defaultPricingHint": "How to price models the catalog does not list (including gateway models brought in by other plugins); catalogued models always use their own rates. Pricing changes only affect new accounting from now on.",
135
139
  "card.defaultPricing.estimate": "estimate — typical-price fallback (uncalibrated, reference only; default)",
136
140
  "card.defaultPricing.cn": "cn — CNY calibration tier (off-catalog still falls back to the typical price)",
@@ -233,6 +237,8 @@ window.__ModuleLoader__.load({
233
237
  "card.allowDowngrade": "降格を許可(auto は low まで下げられる)",
234
238
  "card.allowUpgrade": "昇格を許可(auto は max まで上げられる)",
235
239
  "card.defaultPricing": "カタログ外モデルの価格",
240
+ "card.simpleTools": "簡易ツール許可リスト(auto ダウングレード)",
241
+ "card.simpleToolsHint": "カンマまたはスペース区切りのツール名を内蔵の「安価・決定論的ツール」判定に追加します(例: shell、pwsh、web_fetch)。auto ではこれらの短い呼び出しのみのステップは low に下がります。内蔵集合は既に bash/terminal/shell/pwsh を含むため、ここではホスト固有の名前を補完してください。",
236
242
  "card.defaultPricingHint": "価格カタログに未登録のモデル(他プラグイン経由のゲートウェイモデル含む)の計算方法。登録済みモデルは常にカタログ価格を使用。価格変更は以降の新規記録のみ影響。",
237
243
  "card.defaultPricing.estimate": "estimate — 典型価格でフォールバック見積り(未校正・参考値、デフォルト)",
238
244
  "card.defaultPricing.cn": "cn — 人民元キャリブレーション(カタログ外は典型価格の見積りのまま)",
@@ -335,6 +341,8 @@ window.__ModuleLoader__.load({
335
341
  "card.allowDowngrade": "다운그레이드 허용(auto가 low까지 내릴 수 있음)",
336
342
  "card.allowUpgrade": "업그레이드 허용(auto가 max까지 올릴 수 있음)",
337
343
  "card.defaultPricing": "카탈로그 외 과금",
344
+ "card.simpleTools": "간단한 도구 허용 목록(auto 강등)",
345
+ "card.simpleToolsHint": "쉼표 또는 공백으로 구분한 도구 이름을 내장 \"저렴하고 결정적인 도구\" 판정에 추가합니다(예: shell, pwsh, web_fetch). auto에서는 이런 짧은 호출만으로 구성된 단계가 low로 내려갑니다. 내장 목록은 이미 bash/terminal/shell/pwsh를 포함하므로 호스트 고유 이름을 보충하세요.",
338
346
  "card.defaultPricingHint": "가격 카탈로그에 없는 모델(다른 플러그인으로 유입된 게이트웨이 모델 포함)의 과금 방식. 카탈로그 등재 모델은 항상 자체 등재가 사용. 가격 변경은 이후 신규 기록에만 반영.",
339
347
  "card.defaultPricing.estimate": "estimate — 전형가 폴백 추정(미교정·참고용, 기본)",
340
348
  "card.defaultPricing.cn": "cn — 위안화 보정 등급(카탈로그 외는 여전히 전형가 추정)",
@@ -437,6 +445,8 @@ window.__ModuleLoader__.load({
437
445
  "card.allowDowngrade": "Autoriser la rétrogradation (auto peut descendre à low)",
438
446
  "card.allowUpgrade": "Autoriser la montée (auto peut monter à max)",
439
447
  "card.defaultPricing": "Tarification hors catalogue",
448
+ "card.simpleTools": "Liste d'outils simples (rétrogradation auto)",
449
+ "card.simpleToolsHint": "Noms d'outils séparés par virgule ou espace, ajoutés à l'ensemble interne des « outils bon marché et déterministes » (ex. shell, pwsh, web_fetch). En mode auto, une étape composée uniquement de ces appels courts passe à low. L'ensemble interne couvre déjà bash/terminal/shell/pwsh ; utilisez ce champ pour les noms propres à l'hôte.",
440
450
  "card.defaultPricingHint": "Comment tarifer les modèles absents du catalogue (y compris les modèles de passerelle apportés par d'autres plugins) ; les modèles catalogués gardent leurs tarifs. Les changements ne touchent que les nouvelles lignes.",
441
451
  "card.defaultPricing.estimate": "estimate — estimation par prix type (non calibrée, à titre indicatif ; par défaut)",
442
452
  "card.defaultPricing.cn": "cn — palier calibré CNY (hors catalogue : estimation au prix type)",
@@ -539,6 +549,8 @@ window.__ModuleLoader__.load({
539
549
  "card.allowDowngrade": "Herabstufung erlauben (auto kann auf low fallen)",
540
550
  "card.allowUpgrade": "Hochstufung erlauben (auto kann auf max steigen)",
541
551
  "card.defaultPricing": "Preis außerhalb des Katalogs",
552
+ "card.simpleTools": "Allowlist einfacher Tools (Auto-Downgrade)",
553
+ "card.simpleToolsHint": "Durch Komma oder Leerzeichen getrennte Tool-Namen, die der internen Menge „billige und deterministische Tools“ hinzugefügt werden (z. B. shell, pwsh, web_fetch). Im Auto-Modus sinkt ein Schritt, der nur aus diesen kurzen Aufrufen besteht, auf low. Die interne Menge enthält bereits bash/terminal/shell/pwsh; nutzen Sie dieses Feld für hostspezifische Namen.",
542
554
  "card.defaultPricingHint": "Bepreisung von Modellen ohne Katalogeintrag (inkl. Gateway-Modelle anderer Plugins); katalogisierte Modelle nutzen immer ihre Katalogpreise. Änderungen wirken nur auf neue Buchungen.",
543
555
  "card.defaultPricing.estimate": "estimate — Schätzung über Typicalpreis (unkalibriert, nur Referenz; Standard)",
544
556
  "card.defaultPricing.cn": "cn — Kalibrierungsstufe CNY (ohne Katalogeintrag weiterhin Typicalpreis-Schätzung)",
@@ -641,6 +653,8 @@ window.__ModuleLoader__.load({
641
653
  "card.allowDowngrade": "Consenti declassamento (auto può scendere a low)",
642
654
  "card.allowUpgrade": "Consenti avanzamento (auto può salire a max)",
643
655
  "card.defaultPricing": "Prezzi fuori catalogo",
656
+ "card.simpleTools": "Elenco strumenti semplici (downgrade automatico)",
657
+ "card.simpleToolsHint": "Nomi di strumenti separati da virgole o spazi, aggiunti all'insieme interno degli \"strumenti economici e deterministici\" (es. shell, pwsh, web_fetch). In modalità auto, un passo composto solo da queste chiamate brevi scende a low. L'insieme interno copre già bash/terminal/shell/pwsh; usa questo campo per nomi specifici dell'host.",
644
658
  "card.defaultPricingHint": "Come fatturare i modelli assenti dal catalogo (inclusi i modelli gateway di altri plugin); i modelli in catalogo usano sempre i propri prezzi. Le modifiche valgono solo per le nuove registrazioni.",
645
659
  "card.defaultPricing.estimate": "estimate — stima a prezzo tipico (non calibrata, solo indicativa; predefinito)",
646
660
  "card.defaultPricing.cn": "cn — livello calibrato CNY (fuori catalogo resta la stima a prezzo tipico)",
@@ -743,6 +757,8 @@ window.__ModuleLoader__.load({
743
757
  "card.allowDowngrade": "Разрешить понижение (auto может снизить до low)",
744
758
  "card.allowUpgrade": "Разрешить повышение (auto может поднять до max)",
745
759
  "card.defaultPricing": "Внекаталожное ценообразование",
760
+ "card.simpleTools": "Список простых инструментов (понижение auto)",
761
+ "card.simpleToolsHint": "Имена инструментов через запятую или пробел, добавляемые во встроенный набор «дешёвых и детерминированных инструментов» (напр. shell, pwsh, web_fetch). В режиме auto шаг из таких коротких вызовов понижается до low. Встроенный набор уже включает bash/terminal/shell/pwsh; используйте это поле для имён, специфичных для хоста.",
746
762
  "card.defaultPricingHint": "Как считать модели, которых нет в каталоге цен (включая шлюзовые модели из других плагинов); каталожные модели всегда считаются по своему прайсу. Изменения влияют только на новые записи.",
747
763
  "card.defaultPricing.estimate": "estimate — оценка по типовой цене (не откалибровано, справочно; по умолчанию)",
748
764
  "card.defaultPricing.cn": "cn — калибровка CNY (вне каталога всё равно оценка по типовой цене)",
@@ -845,6 +861,8 @@ window.__ModuleLoader__.load({
845
861
  "card.allowDowngrade": "Permitir degradación (auto puede bajar a low)",
846
862
  "card.allowUpgrade": "Permitir mejora (auto puede subir a max)",
847
863
  "card.defaultPricing": "Precio fuera del catálogo",
864
+ "card.simpleTools": "Lista de herramientas simples (degradación auto)",
865
+ "card.simpleToolsHint": "Nombres de herramientas separados por comas o espacios, añadidos al conjunto interno de \"herramientas baratas y deterministas\" (p. ej. shell, pwsh, web_fetch). En modo auto, un paso compuesto solo por estas llamadas cortas baja a low. El conjunto interno ya cubre bash/terminal/shell/pwsh; use este campo para nombres propios del host.",
848
866
  "card.defaultPricingHint": "Cómo facturar los modelos sin entrada en el catálogo (incluidos modelos de puerta de enlace de otros plugins); los modelos catalogados usan siempre sus precios. Los cambios solo afectan a registros nuevos.",
849
867
  "card.defaultPricing.estimate": "estimate — estimación a precio típico (sin calibrar, solo referencia; predeterminado)",
850
868
  "card.defaultPricing.cn": "cn — nivel calibrado en CNY (fuera del catálogo sigue siendo estimación a precio típico)",
@@ -4826,6 +4844,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
4826
4844
  const value = snapshot.value ?? {};
4827
4845
  const [pendingTl, setPendingTl] = (0, react.useState)({});
4828
4846
  const [writeErrorTl, setWriteErrorTl] = (0, react.useState)(null);
4847
+ const [simpleToolsText, setSimpleToolsText] = (0, react.useState)((value.simpleTools ?? []).join(", "));
4829
4848
  const viewValue = {
4830
4849
  ...value,
4831
4850
  ...pendingTl
@@ -5053,6 +5072,36 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
5053
5072
  }, option))
5054
5073
  })]
5055
5074
  }),
5075
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5076
+ style: fieldStyle,
5077
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5078
+ style: rowStyle,
5079
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
5080
+ htmlFor: "plugin-config-thinking-levels-simple-tools",
5081
+ style: labelStyle,
5082
+ children: t("card.simpleTools")
5083
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
5084
+ id: "plugin-config-thinking-levels-simple-tools",
5085
+ type: "text",
5086
+ style: controlStyle,
5087
+ disabled: readonly,
5088
+ value: simpleToolsText,
5089
+ placeholder: "shell, pwsh, web_fetch",
5090
+ onChange: (event) => {
5091
+ const raw = event.currentTarget.value;
5092
+ setSimpleToolsText(raw);
5093
+ const parsed = Array.from(new Set(raw.split(/[,\s]+/).map((token) => token.trim()).filter((token) => token !== "")));
5094
+ writeTl("simpleTools", parsed);
5095
+ }
5096
+ })]
5097
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
5098
+ style: {
5099
+ ...hintStyle,
5100
+ margin: "2px 0 10px"
5101
+ },
5102
+ children: t("card.simpleToolsHint")
5103
+ })]
5104
+ }),
5056
5105
  writeErrorTl !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
5057
5106
  style: {
5058
5107
  margin: "8px 0 0",