minecodex 1.0.6 → 1.0.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecodex",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Lightweight, local-first plugins for the Codex desktop app.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1805,8 +1805,8 @@ export function createInjectionSource(features, {
1805
1805
  const placeholder = document.querySelector(
1806
1806
  '[data-codex-intelligence-trigger] [class*="_ModelPickerTriggerPlaceholder_"]',
1807
1807
  );
1808
- if (placeholder && record.placeholderText != null) {
1809
- placeholder.textContent = record.placeholderText;
1808
+ if (placeholder?.firstChild && record.placeholderText != null) {
1809
+ placeholder.firstChild.nodeValue = record.placeholderText;
1810
1810
  }
1811
1811
  record.button.setAttribute("aria-expanded", "false");
1812
1812
  record.parentMenu.style.position = record.position;
@@ -1892,8 +1892,13 @@ export function createInjectionSource(features, {
1892
1892
  const placeholder = document.querySelector(
1893
1893
  '[data-codex-intelligence-trigger] [class*="_ModelPickerTriggerPlaceholder_"]',
1894
1894
  );
1895
- const placeholderText = placeholder?.textContent ?? null;
1896
- if (placeholder) placeholder.textContent = locale === "zh-CN" ? "选择模型" : "Select model";
1895
+ const placeholderText = placeholder?.firstChild?.nodeValue ?? null;
1896
+ // 保留产品行为:模型列表打开时 chip 显示 Select model。只能原地更新
1897
+ // 同一个文本节点(nodeValue),不能 textContent 替换整个节点,否则
1898
+ // React 卸载菜单时 removeChild 找不到旧文本节点会触发错误边界。
1899
+ if (placeholder?.firstChild) {
1900
+ placeholder.firstChild.nodeValue = locale === "zh-CN" ? "选择模型" : "Select model";
1901
+ }
1897
1902
 
1898
1903
  modelSelectorControllerMenu = {
1899
1904
  menu,
@@ -2408,10 +2413,20 @@ export function createInjectionSource(features, {
2408
2413
  const identity = modelIdentity(nativeModelValue(parentMenu));
2409
2414
  const model = modelDefinitionFor(identity, selector);
2410
2415
  const catalogModel = catalogModelFor(identity, selector);
2416
+ const catalogedLevels = model?.supportedReasoningLevels ?? catalogModel?.supportedReasoningLevels ?? [];
2417
+ // 外部模型在菜单中的 identity 常是 displayName(如 commandcode-auth/xai-grok-4.6),
2418
+ // 而 reasoningEffortOverrides 按 catalog slug(command-code/xai-grok-4.6)声明;
2419
+ // 先按 catalog slug 匹配,再退回菜单原始值,确保档位兜底能命中。
2420
+ const overrideLevels = selector?.reasoningEffortOverrides?.[catalogModel?.slug.toLowerCase()]
2421
+ ?? selector?.reasoningEffortOverrides?.[identity.raw.toLowerCase()];
2411
2422
  const modelWithCapability = model?.modelSelectorCapability ? model : {
2412
2423
  ...(model ?? {}),
2413
2424
  ...(catalogModel ?? {}),
2414
- supportedReasoningLevels: model?.supportedReasoningLevels ?? catalogModel?.supportedReasoningLevels ?? [],
2425
+ // 外部模型 catalog supported_reasoning_levels 可能为空;此时用
2426
+ // modelSelector.reasoningEffortOverrides 补齐档位,否则滑条没有刻度。
2427
+ supportedReasoningLevels: catalogedLevels.length
2428
+ ? catalogedLevels
2429
+ : (overrideLevels?.map((effort) => ({ effort })) ?? []),
2415
2430
  };
2416
2431
  const efforts = visibleReasoningLevelsFor(modelWithCapability);
2417
2432
  if (!model) return false;
@@ -2462,7 +2477,15 @@ export function createInjectionSource(features, {
2462
2477
  existing?.remove();
2463
2478
  const nativeContainer = parentMenu.firstElementChild;
2464
2479
  if (!nativeContainer) return false;
2465
- const shell = createGenericModelSlider(parentMenu, selector, identity, model, selectedEffortValue);
2480
+ // 使用聚合了 override 兜底档位的 modelWithCapability,空目录档位的外部
2481
+ // 模型才能渲染滑条刻度;原始 model 只负责身份/默认值。
2482
+ const shell = createGenericModelSlider(
2483
+ parentMenu,
2484
+ selector,
2485
+ identity,
2486
+ modelWithCapability,
2487
+ selectedEffortValue,
2488
+ );
2466
2489
  if (!shell) return false;
2467
2490
  if (!modelSelectorGenericContainers.has(nativeContainer)) {
2468
2491
  modelSelectorGenericContainers.set(nativeContainer, nativeContainer.style.display);
@@ -4020,7 +4043,7 @@ export function createInjectionSource(features, {
4020
4043
  "data-[state=open]:bg-token-list-hover-background",
4021
4044
  );
4022
4045
  const originalIcon = button.querySelector("svg");
4023
- const featureIcon = createFeatureIcon(feature, originalIcon?.getAttribute("class"), 20);
4046
+ const featureIcon = createFeatureIcon(feature, originalIcon?.getAttribute("class"), 16);
4024
4047
  if (originalIcon && featureIcon) originalIcon.replaceWith(featureIcon);
4025
4048
  button.addEventListener("click", (event) => {
4026
4049
  event.preventDefault();