@blade-hq/agent-kit 1.0.33 → 1.0.35
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.md +95 -2
- package/dist/chunk-6KO3AOJ7.js +251 -0
- package/dist/chunk-6KO3AOJ7.js.map +1 -0
- package/dist/{chunk-FK4CV6R2.js → chunk-C63X3RCM.js} +629 -32
- package/dist/chunk-C63X3RCM.js.map +1 -0
- package/dist/{chunk-IGMLETZX.js → chunk-DOBX7XP3.js} +15 -12
- package/dist/chunk-DOBX7XP3.js.map +1 -0
- package/dist/{chunk-EGGBOVVF.js → chunk-IP7EZVT5.js} +2 -2
- package/dist/{chunk-OICNN4K4.js → chunk-J6H4TMTH.js} +2 -2
- package/dist/{chunk-F4Y7SUBC.js → chunk-SEHOWQVO.js} +2 -2
- package/dist/{chunk-IDVNG3YJ.js → chunk-YJSN44Q4.js} +16 -3
- package/dist/{chunk-IDVNG3YJ.js.map → chunk-YJSN44Q4.js.map} +1 -1
- package/dist/{chunk-E7FQV4IX.js → chunk-ZPPYDQPU.js} +3 -3
- package/dist/client/auth.d.ts +55 -0
- package/dist/client/blade-client.d.ts +19 -3
- package/dist/client/connection.d.ts +41 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.js +11 -3
- package/dist/client/resources/auth.d.ts +1 -26
- package/dist/client/socket.d.ts +1 -0
- package/dist/client/types/rest.d.ts +246 -17
- package/dist/client/types/socket-events.d.ts +4 -0
- package/dist/react/api/model-config.d.ts +14 -2
- package/dist/react/api/published-apps.js +3 -3
- package/dist/react/api/sessions.js +2 -2
- package/dist/react/bootstrap.d.ts +1 -1
- package/dist/react/components/chat/index.js +5 -5
- package/dist/react/components/connection/BladeConnectionButton.d.ts +7 -0
- package/dist/react/components/connection/BladeConnectionPanel.d.ts +7 -0
- package/dist/react/components/connection/index.d.ts +2 -0
- package/dist/react/components/connection/index.js +15 -0
- package/dist/react/components/connection/index.js.map +1 -0
- package/dist/react/components/plan/index.js +4 -4
- package/dist/react/components/session/index.js +3 -3
- package/dist/react/components/workspace/index.js +3 -3
- package/dist/react/hooks/use-blade-connection.d.ts +14 -0
- package/dist/react/index.d.ts +6 -2
- package/dist/react/index.js +33 -28
- package/dist/react/index.js.map +1 -1
- package/dist/react/sockets/event-bridge.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +5 -1
- package/dist/chunk-FK4CV6R2.js.map +0 -1
- package/dist/chunk-IGMLETZX.js.map +0 -1
- /package/dist/{chunk-EGGBOVVF.js.map → chunk-IP7EZVT5.js.map} +0 -0
- /package/dist/{chunk-OICNN4K4.js.map → chunk-J6H4TMTH.js.map} +0 -0
- /package/dist/{chunk-F4Y7SUBC.js.map → chunk-SEHOWQVO.js.map} +0 -0
- /package/dist/{chunk-E7FQV4IX.js.map → chunk-ZPPYDQPU.js.map} +0 -0
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
getCodeLanguageFromFilename,
|
|
14
14
|
parseAskUserQuestion,
|
|
15
15
|
useHighlightedCodeHtml
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZPPYDQPU.js";
|
|
17
17
|
import {
|
|
18
18
|
getSessionFilePath,
|
|
19
19
|
resolveSessionFilePreviewTarget
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-J6H4TMTH.js";
|
|
21
21
|
import {
|
|
22
22
|
apiFetchResponse,
|
|
23
23
|
buildMessageContent,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
useUiBridgeStore,
|
|
64
64
|
useUiStore,
|
|
65
65
|
writeFile
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-YJSN44Q4.js";
|
|
67
67
|
import {
|
|
68
68
|
registerBridgeIframe,
|
|
69
69
|
tapBridgeEvent
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
ModelOption,
|
|
73
73
|
ModelsConfig,
|
|
74
74
|
ModelsResource
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-C63X3RCM.js";
|
|
76
76
|
import {
|
|
77
77
|
cn,
|
|
78
78
|
copyToClipboard
|
|
@@ -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" :
|
|
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:
|
|
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 (
|
|
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-
|
|
9373
|
+
//# sourceMappingURL=chunk-DOBX7XP3.js.map
|