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 +2 -2
- package/README.md +2 -2
- package/package.json +1 -1
- package/scripts/postinstall.mjs +23 -17
package/README.ko.md
CHANGED
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
|
|
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.
|
|
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/",
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -657,12 +657,9 @@ async function buildInteractivePreset(currentModel, allModels, scriptedAnswers,
|
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
if (profile === "glm") {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
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
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
:
|
|
823
|
-
|
|
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
|
|
828
|
-
const
|
|
829
|
-
|
|
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:
|
|
832
|
-
silver:
|
|
833
|
-
gold:
|
|
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
|
|