@magpie-community/opencode-cursor-auth 0.2.8 → 0.2.9

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 +7 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -723,17 +723,20 @@ function pick(entry, effort, fast, seed) {
723
723
  // without thinking stops at high), the variant with those parameters at the
724
724
  // nearest effort it has, not the default's id with parameters that
725
725
  // contradict it (claude-opus-5-thinking-high with thinking=false). Where
726
- // the default differs from what is asked in the effort alone, the effort
727
- // goes as asked, as for a listed model.
726
+ // the default differs from what is asked in the effort alone, and no
727
+ // variant at all is named for that effort, the effort goes as asked, as for
728
+ // a listed model (claude-opus-5-5-xhigh). When another branch has it, the
729
+ // default's own branch stops short there, and its nearest goes (#55).
728
730
  function branch(entry, want) {
729
731
  if (!entry.pid || entry.pid === "thinking") return undefined
732
+ const level = (x) => (x === "extra-high" ? "xhigh" : x)
730
733
  const def = valuesOf(entry.def)
731
- if (Object.keys(want).every((k) => k === entry.pid || k === "context" || def[k] === undefined || def[k] === want[k])) return undefined
734
+ const named = entry.variants.some((v) => level(valuesOf(v)[entry.pid]) === level(want[entry.pid]))
735
+ if (!named && Object.keys(want).every((k) => k === entry.pid || k === "context" || def[k] === undefined || def[k] === want[k])) return undefined
732
736
  const vs = entry.variants.filter((v) => {
733
737
  const have = valuesOf(v)
734
738
  return entry.pid in have && Object.keys(want).every((k) => k === entry.pid || have[k] === undefined || have[k] === want[k])
735
739
  })
736
- const level = (x) => (x === "extra-high" ? "xhigh" : x)
737
740
  const at = fitEffort(level(want[entry.pid]), vs.map((v) => level(valuesOf(v)[entry.pid])))
738
741
  return at ? vs.find((v) => level(valuesOf(v)[entry.pid]) === at) : undefined
739
742
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-cursor-auth",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Cursor subscriptions (Pro, Pro+, Ultra, Teams) in OpenCode and magpie, through the API cursor-agent talks to",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",