@jeffreyjyz/opencode-command-code 0.2.2 → 0.2.3
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/dist/index.js +17 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -676,11 +676,15 @@ var commandCodeV2 = Plugin.define({
|
|
|
676
676
|
});
|
|
677
677
|
});
|
|
678
678
|
const controller = new AbortController;
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
if (
|
|
679
|
+
let refreshing = false;
|
|
680
|
+
const refresh = async () => {
|
|
681
|
+
if (refreshing || controller.signal.aborted)
|
|
682
682
|
return;
|
|
683
|
+
refreshing = true;
|
|
683
684
|
try {
|
|
685
|
+
const key = await credentialKey(ctx);
|
|
686
|
+
if (!key)
|
|
687
|
+
return;
|
|
684
688
|
const split = await loadModels(key);
|
|
685
689
|
if (controller.signal.aborted)
|
|
686
690
|
return;
|
|
@@ -689,10 +693,17 @@ var commandCodeV2 = Plugin.define({
|
|
|
689
693
|
editor.models.set("command-code-openai", split.open.map((m) => toV2Model(m, LANES[1])));
|
|
690
694
|
});
|
|
691
695
|
} catch (e) {
|
|
692
|
-
console.warn("[command-code] live model list unavailable, keeping
|
|
696
|
+
console.warn("[command-code] live model list unavailable, keeping previous list:", e);
|
|
697
|
+
} finally {
|
|
698
|
+
refreshing = false;
|
|
693
699
|
}
|
|
694
|
-
}
|
|
695
|
-
|
|
700
|
+
};
|
|
701
|
+
refresh();
|
|
702
|
+
const timer = setInterval(() => void refresh(), 30 * 60 * 1000);
|
|
703
|
+
return () => {
|
|
704
|
+
controller.abort();
|
|
705
|
+
clearInterval(timer);
|
|
706
|
+
};
|
|
696
707
|
}
|
|
697
708
|
});
|
|
698
709
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeffreyjyz/opencode-command-code",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Command Code provider + usage dashboard for opencode: two providers (Anthropic wire for Claude, OpenAI wire for everything else) against api.commandcode.ai, live model list, plan gating, /cmd-usage. Requires the cmduse CLI for usage rendering.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|