@goodandready/dsh-subscriptions 0.6.6 → 0.6.7

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
@@ -243,6 +243,15 @@ dsh-subscriptions:
243
243
 
244
244
  ---
245
245
 
246
+ ## 🧠 Claude Adaptive Thinking & Effort (Added in v0.6.7)
247
+
248
+ Supports Anthropic's adaptive thinking (`thinking: { type: "adaptive" }`) and reasoning effort steering (`output_config: { effort }`):
249
+ - **Model Support**: Automatically gates effort levels for Opus 4.6+, Opus 4.7+, Opus 5 (`low`, `medium`, `high`, `xhigh`, `max`) and Sonnet 4.6+, Sonnet 5 (`low`, `medium`, `high`).
250
+ - **Safe Fallback**: Models that do not support adaptive thinking (Haiku, Fable, 4.5 and earlier) reject the parameter cleanly and leave requests unaugmented to prevent 400 Bad Request API errors.
251
+ - **Dynamic Catalog**: The provider model catalog exports matching `reasoning.efforts` options to the DeepSeek Harness interface.
252
+
253
+ ---
254
+
246
255
  ## 🌐 Localization
247
256
 
248
257
  The plugin source language is English only. Russian and other translations are provided at runtime by separate language plugins (for example the russification plugin), which translate the registered locale keys - the package itself ships no bundled translations (Changed in 0.6.1).
package/README.ru.md CHANGED
@@ -216,6 +216,15 @@ dsh-subscriptions:
216
216
 
217
217
  ---
218
218
 
219
+ ## 🧠 Адаптивное мышление Claude и уровни усилия (Добавлено в v0.6.7)
220
+
221
+ Поддержка адаптивного мышления Anthropic (`thinking: { type: "adaptive" }`) и управления глубиной рассуждений (`output_config: { effort }`):
222
+ - **Поддержка моделей**: Автоматическое определение уровней усилия для Opus 4.6+, Opus 4.7+, Opus 5 (`low`, `medium`, `high`, `xhigh`, `max`) и Sonnet 4.6+, Sonnet 5 (`low`, `medium`, `high`).
223
+ - **Безопасный фоллбэк**: Модели без поддержки адаптивного рассуждения (Haiku, Fable, 4.5 и старше) не перегружаются параметрами во избежание ошибок Anthropic API (400 Bad Request).
224
+ - **Динамический каталог**: В каталоге моделей регистрируется секция `reasoning.efforts`, доступная для выбора в интерфейсе DeepSeek Harness.
225
+
226
+ ---
227
+
219
228
  ## 🌐 Локализация
220
229
 
221
230
  Исходный язык плагина - только английский. Русский и другие переводы во время работы предоставляют отдельные языковые плагины (например, плагин русификации), переводящие зарегистрированные ключи локали, - сам пакет не содержит встроенных переводов (Changed in 0.6.1).
package/README.zh.md CHANGED
@@ -138,6 +138,15 @@ dsh plugin --profile web add @goodandready/dsh-subscriptions
138
138
 
139
139
  ---
140
140
 
141
+ ## 🧠 Claude 自适应思考与推理深度控制 (v0.6.7 新增)
142
+
143
+ 支持 Anthropic 自适应思考 (`thinking: { type: "adaptive" }`) 及推理深度调节 (`output_config: { effort }`):
144
+ - **模型支持**: 针对 Opus 4.6+、Opus 4.7+、Opus 5 (`low`, `medium`, `high`, `xhigh`, `max`) 及 Sonnet 4.6+、Sonnet 5 (`low`, `medium`, `high`) 自动提供对应推理级别。
145
+ - **安全降级**: 不支持自适应思考的模型(如 Haiku、Fable、4.5 及更早版本)保持原始请求,防止出现 400 Bad Request 错误。
146
+ - **动态目录**: 模型列表自动暴露 `reasoning.efforts`,供 DeepSeek Harness 界面选择。
147
+
148
+ ---
149
+
141
150
  ## 🌐 本地化
142
151
 
143
152
  插件源语言仅为英语。俄语及其他翻译由独立的语言插件(如俄化插件)在运行时对注册的本地化键进行翻译,包本身不内置翻译(Changed in 0.6.1)。
@@ -19,6 +19,38 @@ export function providerInfo() {
19
19
  return { id, name: 'Claude' }
20
20
  }
21
21
 
22
+ // Thinking-effort support follows Anthropic's current semantics:
23
+ // - Adaptive thinking (`thinking: { type: 'adaptive' }`) is the recommended /
24
+ // only on-mode for current generations; depth and token spend are steered by
25
+ // `output_config: { effort }`.
26
+ // - Effort is accepted on Opus 4.6+ and Sonnet 4.6+; `xhigh` was added on
27
+ // Opus 4.7; `max` is Opus-tier only.
28
+ // - Sonnet 4.5 / Haiku / Fable families reject effort (400), and models older
29
+ // than the adaptive generation use the legacy budget_tokens knob, so no
30
+ // effort control is advertised there. Model ids with a major version only
31
+ // (e.g. `claude-opus-5`) are treated as the latest of their family.
32
+ const BASE_EFFORT_LEVELS = ['low', 'medium', 'high']
33
+
34
+ export function effortLevelsForModel(modelId) {
35
+ const m = /^claude-(opus|sonnet|haiku|fable)(?:-(\d+))?(?:-(\d+))?/.exec(String(modelId || ''))
36
+ if (!m) return null
37
+ const [, family, majorRaw, minorRaw] = m
38
+ if (family === 'haiku' || family === 'fable') return null
39
+ const major = majorRaw ? Number(majorRaw) : null
40
+ const minor = minorRaw ? Number(minorRaw) : null
41
+ const atLeast = (wantMajor, wantMinor) => (
42
+ major === null || major > wantMajor || (major === wantMajor && (minor === null || minor >= wantMinor))
43
+ )
44
+ // Adaptive thinking / effort exist from Opus 4.6 and Sonnet 4.6 onward.
45
+ if (!atLeast(4, 6)) return null
46
+ const levels = [...BASE_EFFORT_LEVELS]
47
+ if (family === 'opus') {
48
+ if (atLeast(4, 7)) levels.push('xhigh')
49
+ levels.push('max')
50
+ }
51
+ return levels
52
+ }
53
+
22
54
  export function defaults() {
23
55
  return {
24
56
  clientId: '9d1c250a-e61b-44d9-88ed-5944d1962f5e',
@@ -88,7 +120,27 @@ export async function refresh(cfg, blob, fetchImpl) {
88
120
  }
89
121
 
90
122
  export async function listModels(blob, cfg) {
91
- return modelCatalog(id, cfg.models || defaults().models)
123
+ const raw = cfg.models && cfg.models.length ? cfg.models : defaults().models
124
+ const entries = raw.map((entry) => {
125
+ const model = typeof entry === 'string' ? { id: entry, name: entry } : { ...entry }
126
+ const levels = effortLevelsForModel(model.id || model.name)
127
+ if (!levels) return model
128
+ return { ...model, reasoning: { efforts: levels.map((level) => ({ id: level, name: level })) } }
129
+ })
130
+ return modelCatalog(id, entries)
131
+ }
132
+
133
+ // Advertise adaptive thinking + effort only for models whose capability table
134
+ // declares the chosen level; anything else (unsupported family, 'off', no
135
+ // selection) leaves the request untouched so behavior stays opt-in.
136
+ export function applyClaudeThinking(payload, options) {
137
+ const effort = options && String(options.reasoningEffort || '')
138
+ if (!effort || effort === 'off') return payload
139
+ const levels = effortLevelsForModel(payload && payload.model)
140
+ if (!levels || !levels.includes(effort)) return payload
141
+ payload.thinking = { type: 'adaptive' }
142
+ payload.output_config = { effort }
143
+ return payload
92
144
  }
93
145
 
94
146
 
@@ -114,6 +166,7 @@ export async function usage(blob, _cfg, fetchImpl) {
114
166
 
115
167
  export async function* streamOnce({ blob, options, fetchImpl, headers, config, signal }) {
116
168
  const payload = anthropicPayload(options, config.systemPrefix || IDENTITY)
169
+ applyClaudeThinking(payload, options)
117
170
  const res = await fetchImpl(API, {
118
171
  method: 'POST',
119
172
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-subscriptions",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Use ChatGPT Codex, Claude, Grok, Antigravity, Kimi, GLM, Cursor, Kiro, Copilot, Qwen, ERNIE, Spark, JetBrains, Perplexity, Replit, and Cody subscriptions as DeepSeek Harness LLM providers via OAuth.",
5
5
  "license": "MIT",
6
6
  "type": "module",