opencode-resolve 0.1.19 → 0.1.20

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.ko.md CHANGED
@@ -16,8 +16,8 @@
16
16
  독립 실행형 앱, 모델 프로바이더, API 키 관리자, `opencode.json` 대체물이 아닙니다.
17
17
 
18
18
  ```sh
19
- npm install -g opencode-resolve
20
- opencode plugin opencode-resolve --global --force
19
+ npm install -g opencode-resolve@latest
20
+ opencode-resolve setup
21
21
  ```
22
22
 
23
23
  ## 목차
package/README.md CHANGED
@@ -16,8 +16,8 @@
16
16
  It is not a standalone app, model provider, API key manager, or replacement for `opencode.json`.
17
17
 
18
18
  ```sh
19
- npm install -g opencode-resolve
20
- opencode plugin opencode-resolve --global --force
19
+ npm install -g opencode-resolve@latest
20
+ opencode-resolve setup
21
21
  ```
22
22
 
23
23
  ## Contents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-resolve",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "OpenCode plugin that adds a lightweight resolver/coder harness for continuous agentic coding.",
5
5
  "type": "module",
6
6
  "homepage": "https://jshsakura.github.io/opencode-resolve/",
@@ -657,12 +657,9 @@ async function buildInteractivePreset(currentModel, allModels, scriptedAnswers,
657
657
  }
658
658
 
659
659
  if (profile === "glm") {
660
- const useCodingPlan = await askYesNo(rl, "Use coding-plan (zai-coding-plan) instead of standard (zai)? [y/N]: ", false)
661
- const glmChoices = useCodingPlan
662
- ? choices.glm.map((m) => m.replace(/^zai\//, "zai-coding-plan/"))
663
- : choices.glm.map((m) => m.replace(/^zai-coding-plan\//, "zai/"))
664
- const deduped = unique([...glmChoices.filter((m) => isGLMModel(m)), ...GLM_MODEL_HINTS])
665
- const tiers = await askThreeTier(rl, "GLM", deduped)
660
+ // zai and zai-coding-plan are distinct providers show whatever the user actually
661
+ // has configured. No rewriting between them.
662
+ const tiers = await askThreeTier(rl, "GLM", choices.glm)
666
663
  return {
667
664
  label: "glm-three-tier",
668
665
  profile: "glm",
@@ -816,21 +813,30 @@ function buildGLMThreeTierModels(tiers) {
816
813
 
817
814
  function collectModelChoices(allModels, predicate, hints, includeFallbackHints = true) {
818
815
  const detected = allModels.filter(predicate)
819
- const providerIds = new Set(detected.map((model) => model.split("/")[0]).filter(Boolean))
820
- const matchingHints = includeFallbackHints
821
- ? hints.filter((model) => providerIds.size === 0 || providerIds.has(model.split("/")[0]) || detected.length < 3)
822
- : []
823
- const choices = unique([...detected, ...matchingHints])
816
+ if (detected.length > 0) {
817
+ // Only show the user's own models when they have any — never pollute the picker
818
+ // with hint IDs they don't actually have configured in opencode.json.
819
+ return predicate === isGLMModel ? sortGLMModelChoices(unique(detected)) : unique(detected)
820
+ }
821
+ // Fallback: user has zero models of this family — show the hint list so the
822
+ // picker still has something to display.
823
+ if (!includeFallbackHints) return []
824
+ const choices = unique(hints)
824
825
  return predicate === isGLMModel ? sortGLMModelChoices(choices) : choices
825
826
  }
826
827
 
827
- function chooseThreeTier(models, family, includeFallbackHints = true) {
828
- const fallback = family === "glm" ? GLM_MODEL_HINTS : OPENAI_MODEL_HINTS
829
- const choices = unique(includeFallbackHints ? [...models, ...fallback] : models)
828
+ function chooseThreeTier(models, family) {
829
+ const choices = unique(models)
830
+ if (choices.length === 0) {
831
+ const fallback = family === "glm" ? GLM_MODEL_HINTS : OPENAI_MODEL_HINTS
832
+ return chooseThreeTier(fallback, family)
833
+ }
834
+ // Sort by inferred strength (weak → strong) and pick bronze/silver/gold by position.
835
+ const sorted = sortModelsByStrength(choices)
830
836
  return {
831
- bronze: preferModel(choices, family === "glm" ? ["5.1", "4.5", "5"] : ["spark", "mini", "4o-mini"], choices[0]),
832
- silver: preferModel(choices, family === "glm" ? ["5.1", "4.5", "5"] : ["codex", "5.3", "5.2"], choices[1] ?? choices[0]),
833
- gold: preferModel(choices, family === "glm" ? ["5.1", "5", "4.5"] : ["5.5", "5.4", "gpt-5.3-codex"], choices[2] ?? choices[1] ?? choices[0]),
837
+ bronze: sorted[0],
838
+ silver: sorted[Math.min(1, sorted.length - 1)] ?? sorted[0],
839
+ gold: sorted[sorted.length - 1],
834
840
  }
835
841
  }
836
842