@blade-hq/agent-kit 1.0.33 → 1.0.34

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.
@@ -820,25 +820,27 @@ function ModelSelector({
820
820
  const canSelect = models.length > 0;
821
821
  const selectedModel = models.find((model) => model.id === value);
822
822
  const defaultModelOption = models.find((model) => model.id === defaultModel);
823
+ const selectedUnavailable = !!value.trim() && !selectedModel;
823
824
  const selectedLabel = selectedModel?.label;
824
825
  const defaultLabel = defaultModelOption?.label;
825
- const label = isLoading ? "\u6B63\u5728\u52A0\u8F7D\u6A21\u578B..." : models.length === 0 ? "\u65E0\u53EF\u7528\u6A21\u578B" : selectedLabel || defaultLabel || value.trim() || "\u672A\u8FDE\u63A5\u5230\u6A21\u578B";
826
- const activeModel = selectedModel ?? defaultModelOption;
826
+ const label = isLoading ? "\u6B63\u5728\u52A0\u8F7D\u6A21\u578B..." : selectedLabel || value.trim() || defaultLabel || (models.length === 0 ? "\u65E0\u53EF\u7528\u6A21\u578B" : "\u672A\u8FDE\u63A5\u5230\u6A21\u578B");
827
+ const activeModel = selectedModel ?? (value.trim() ? void 0 : defaultModelOption);
827
828
  const activeInputLabel = activeModel ? formatInputModalities(activeModel) : "";
828
- const selectorTitle = activeInputLabel ? `${label}\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${activeInputLabel}` : label;
829
+ const selectorTitle = selectedUnavailable ? `${label}\uFF0C\u5F53\u524D\u6A21\u578B\u76EE\u5F55\u4E2D\u4E0D\u53EF\u7528` : activeInputLabel ? `${label}\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${activeInputLabel}` : label;
829
830
  const dropdownPosition = placement === "top" ? "bottom-[calc(100%+8px)]" : "top-[calc(100%+8px)]";
830
831
  if (!canSelect) {
831
832
  return /* @__PURE__ */ jsxs(
832
833
  "div",
833
834
  {
834
835
  className: "flex min-w-0 items-center gap-1 rounded-lg px-2.5 py-[5px] text-[hsl(var(--muted-foreground))]",
835
- title: label,
836
+ title: selectorTitle,
836
837
  children: [
837
838
  isLoading ? /* @__PURE__ */ jsx2(Loader2, { size: 14, className: "animate-spin", "aria-hidden": "true" }) : compact ? null : (
838
839
  // compact 用于「+」菜单的「模型」行,行首已有图标,触发器内不再重复。
839
840
  /* @__PURE__ */ jsx2(Sparkles, { size: 14, "aria-hidden": "true" })
840
841
  ),
841
- /* @__PURE__ */ jsx2("span", { className: `whitespace-nowrap text-xs ${compact ? "" : "max-w-[180px]"}`, children: label })
842
+ /* @__PURE__ */ jsx2("span", { className: `whitespace-nowrap text-xs ${compact ? "" : "max-w-[180px]"}`, children: label }),
843
+ selectedUnavailable ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 rounded border border-[hsl(var(--destructive)/0.4)] px-1 py-0 text-[10px] leading-4 text-[hsl(var(--destructive))]", children: "\u5F53\u524D\u4E0D\u53EF\u7528" }) : null
842
844
  ]
843
845
  }
844
846
  );
@@ -868,7 +870,8 @@ function ModelSelector({
868
870
  children: label
869
871
  }
870
872
  ),
871
- activeInputLabel ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 rounded border border-[hsl(var(--border))] px-1 py-0 text-[10px] leading-4 text-[hsl(var(--muted-foreground))]", children: activeInputLabel }) : null
873
+ activeInputLabel ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 rounded border border-[hsl(var(--border))] px-1 py-0 text-[10px] leading-4 text-[hsl(var(--muted-foreground))]", children: activeInputLabel }) : null,
874
+ selectedUnavailable ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 rounded border border-[hsl(var(--destructive)/0.4)] px-1 py-0 text-[10px] leading-4 text-[hsl(var(--destructive))]", children: "\u5F53\u524D\u4E0D\u53EF\u7528" }) : null
872
875
  ]
873
876
  }
874
877
  ),
@@ -1036,7 +1039,7 @@ function useResolvedModel(activeSessionModel) {
1036
1039
  }
1037
1040
  const ids = models.map((model) => model.id);
1038
1041
  const inList = (id) => !!id && ids.includes(id);
1039
- if (inList(activeSessionModel)) {
1042
+ if (activeSessionModel) {
1040
1043
  return { resolvedModel: activeSessionModel, hasAvailableModel: true, isLoading };
1041
1044
  }
1042
1045
  if (inList(preferredModel)) {
@@ -9367,4 +9370,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
9367
9370
  * Licensed under the MIT License. See License.txt in the project root for license information.
9368
9371
  *--------------------------------------------------------------------------------------------*)
9369
9372
  */
9370
- //# sourceMappingURL=chunk-IGMLETZX.js.map
9373
+ //# sourceMappingURL=chunk-BDGMBHYV.js.map