@magpie-community/opencode-workbuddy-auth 0.1.25 → 0.1.26

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/index.mjs +16 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1461,6 +1461,21 @@ function priceOf(d, promotions, now = Date.now()) {
1461
1461
  return { free: base === 0, rate: base }
1462
1462
  }
1463
1463
 
1464
+ // effortsOf are the levels a config model takes. Most list them in
1465
+ // reasoning.supportedEfforts; some (fast-model, deepseek-v4.1-flash, kimi-k3,
1466
+ // gemini-3.5-flash … on both sites, plugins#255) say only supportsReasoning
1467
+ // and a default reasoning.effort. Those take low, high and max (each
1468
+ // reasoned under a real account, on four of them) and their own default.
1469
+ const EFFORT_ORDER = ["low", "medium", "high", "xhigh", "max"]
1470
+ function effortsOf(d) {
1471
+ const said = d.reasoning?.supportedEfforts
1472
+ if (Array.isArray(said) && said.length) return said
1473
+ if (d.supportsReasoning !== true) return []
1474
+ const own = d.reasoning?.effort
1475
+ const set = new Set(["low", "high", "max", ...(typeof own === "string" && EFFORT_ORDER.includes(own) ? [own] : [])])
1476
+ return EFFORT_ORDER.filter((e) => set.has(e))
1477
+ }
1478
+
1464
1479
  async function liveModels(site, a) {
1465
1480
  const headers = new Headers()
1466
1481
  sign(site, a, headers)
@@ -1483,7 +1498,7 @@ async function liveModels(site, a) {
1483
1498
  m.output = d.maxOutputTokens
1484
1499
  m.images = d.supportsImages === true && !textOnly(site, id)
1485
1500
  Object.assign(m, priceOf(d, cfg.modelPromotions))
1486
- const es = d.reasoning?.supportedEfforts ?? []
1501
+ const es = effortsOf(d)
1487
1502
  if (es.length) {
1488
1503
  const canOff = d.reasoning?.canDisableThinking
1489
1504
  m.efforts = [...(!d.onlyReasoning && (canOff == null || canOff) ? ["none"] : []), ...es]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-workbuddy-auth",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",