minecodex 1.1.0 → 1.1.1
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/package.json
CHANGED
|
@@ -1740,6 +1740,24 @@ export function createInjectionSource(features, {
|
|
|
1740
1740
|
: String(model?.defaultReasoningEffort ?? supported[0] ?? "none").toLowerCase();
|
|
1741
1741
|
}
|
|
1742
1742
|
|
|
1743
|
+
function visibleControllerModels(controller) {
|
|
1744
|
+
const models = controller.models.filter((model) => !model.hidden && String(model.model ?? "").trim());
|
|
1745
|
+
const nativeGptIds = new Set(models
|
|
1746
|
+
.filter((model) => !String(model.model).includes("/") && /^gpt-/i.test(model.model))
|
|
1747
|
+
.map((model) => String(model.model).toLowerCase()));
|
|
1748
|
+
// OCX 自动发现的同名路由若没有独立档位,会与原生 GPT 显示成两项。
|
|
1749
|
+
return models.filter((model) => {
|
|
1750
|
+
const slug = String(model.model);
|
|
1751
|
+
const backend = modelIdentity(slug).backend.toLowerCase();
|
|
1752
|
+
return slug === controller.model
|
|
1753
|
+
|| !(
|
|
1754
|
+
slug.includes("/")
|
|
1755
|
+
&& nativeGptIds.has(backend)
|
|
1756
|
+
&& !(model.supportedReasoningEfforts ?? []).length
|
|
1757
|
+
);
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1743
1761
|
function openControllerModelMenu(parentMenu, modelButton, selector) {
|
|
1744
1762
|
if (modelSelectorControllerMenu) {
|
|
1745
1763
|
closeControllerModelMenu();
|
|
@@ -1747,7 +1765,7 @@ export function createInjectionSource(features, {
|
|
|
1747
1765
|
}
|
|
1748
1766
|
const controller = nativeComposerModelController();
|
|
1749
1767
|
if (!Array.isArray(controller?.models) || typeof controller.onSelectModel !== "function") return;
|
|
1750
|
-
const models = controller
|
|
1768
|
+
const models = visibleControllerModels(controller);
|
|
1751
1769
|
if (!models.length) return;
|
|
1752
1770
|
|
|
1753
1771
|
const menu = document.createElement("div");
|
|
@@ -2203,7 +2221,8 @@ export function createInjectionSource(features, {
|
|
|
2203
2221
|
fastButton.append(fastContent);
|
|
2204
2222
|
fastButton.addEventListener("click", () => {
|
|
2205
2223
|
const nextEnabled = fastButton.getAttribute("aria-pressed") !== "true";
|
|
2206
|
-
|
|
2224
|
+
const currentIndex = Number(shell.querySelector("[data-codex-model-slider-rail]")?.getAttribute("aria-valuenow"));
|
|
2225
|
+
syncGenericFastVisual(shell, nextEnabled, efforts[currentIndex] === "ultra", true);
|
|
2207
2226
|
controller.onSelectServiceTier?.(nextEnabled ? fastOption.value : null);
|
|
2208
2227
|
queueEnsure();
|
|
2209
2228
|
});
|
|
@@ -2299,6 +2318,8 @@ export function createInjectionSource(features, {
|
|
|
2299
2318
|
effortText.textContent = effortLabel(effort);
|
|
2300
2319
|
effortText.setAttribute("data-maximum", String(effort === "ultra"));
|
|
2301
2320
|
}
|
|
2321
|
+
const fastButton = shell.querySelector("[data-codex-model-slider-fast]");
|
|
2322
|
+
fastButton?.setAttribute("data-max-power-selection", String(effort === "ultra"));
|
|
2302
2323
|
};
|
|
2303
2324
|
const preview = (clientX) => previewIndex(indexAt(clientX));
|
|
2304
2325
|
rail.addEventListener("pointerdown", (event) => {
|