@blade-hq/agent-react 2612.0.0-beta.86 → 2612.0.0-beta.87
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 +1 -1
- package/dist/SessionPluginConfigForm-2KG4TG4W.js +9 -0
- package/dist/chat/AssistantTurnBlock.d.ts +2 -1
- package/dist/chat/ChatLoadingIndicator.d.ts +9 -1
- package/dist/chat/FileDeliveryCards.d.ts +12 -6
- package/dist/chat/ai-elements/shimmer.d.ts +4 -0
- package/dist/chat/chat-column-width.d.ts +21 -0
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/runtime/actions.d.ts +5 -1
- package/dist/chat/runtime/environment.d.ts +2 -0
- package/dist/chat/runtime/use-chat-actions.d.ts +1 -1
- package/dist/{chat-IHPRU35X.css → chat-WA7YIAHD.css} +18 -0
- package/dist/chat.css +18 -0
- package/dist/{chunk-LYDXKR3Q.js → chunk-34MHG656.js} +15 -8
- package/dist/{chunk-LYDXKR3Q.js.map → chunk-34MHG656.js.map} +1 -1
- package/dist/{chunk-KHJEIHMJ.js → chunk-5ZV73E5D.js} +28 -60
- package/dist/chunk-5ZV73E5D.js.map +1 -0
- package/dist/{chunk-NRYLAO3X.js → chunk-BZHMZBYT.js} +3 -3
- package/dist/{chunk-NRYLAO3X.js.map → chunk-BZHMZBYT.js.map} +1 -1
- package/dist/{chunk-C3LBNHVM.js → chunk-G6OC5I4W.js} +4 -4
- package/dist/{chunk-SK43YNRX.js → chunk-GBZEFIGW.js} +2 -2
- package/dist/{chunk-RGL2XUQR.js → chunk-GJZGRIDJ.js} +1577 -1183
- package/dist/chunk-GJZGRIDJ.js.map +1 -0
- package/dist/{chunk-MWILWSPG.js → chunk-J6YPRDQH.js} +2 -2
- package/dist/{chunk-FH5HA3GW.js → chunk-JFGBDNDD.js} +6 -6
- package/dist/chunk-JFGBDNDD.js.map +1 -0
- package/dist/{chunk-6RQGCCG7.js → chunk-K6N5CQDP.js} +7 -7
- package/dist/{chunk-FDB3J5QF.js → chunk-WG2HHYGK.js} +5 -5
- package/dist/connectors.js +3 -3
- package/dist/index.js +9 -9
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +15 -11
- package/dist/internal.js.map +1 -1
- package/dist/questions.js +4 -4
- package/dist/rich-input/ChatInput.d.ts +1 -1
- package/dist/rich-input/ModelSelector.d.ts +3 -1
- package/dist/rich-input/model/resolve-model.d.ts +1 -1
- package/dist/rich-input.js +414 -369
- package/dist/rich-input.js.map +1 -1
- package/dist/style.full.css +19 -1
- package/dist/tool-details.js +5 -5
- package/package.json +2 -2
- package/dist/SessionPluginConfigForm-7LJ5SUNY.js +0 -9
- package/dist/chunk-FH5HA3GW.js.map +0 -1
- package/dist/chunk-KHJEIHMJ.js.map +0 -1
- package/dist/chunk-RGL2XUQR.js.map +0 -1
- /package/dist/{SessionPluginConfigForm-7LJ5SUNY.js.map → SessionPluginConfigForm-2KG4TG4W.js.map} +0 -0
- /package/dist/{chunk-C3LBNHVM.js.map → chunk-G6OC5I4W.js.map} +0 -0
- /package/dist/{chunk-SK43YNRX.js.map → chunk-GBZEFIGW.js.map} +0 -0
- /package/dist/{chunk-MWILWSPG.js.map → chunk-J6YPRDQH.js.map} +0 -0
- /package/dist/{chunk-6RQGCCG7.js.map → chunk-K6N5CQDP.js.map} +0 -0
- /package/dist/{chunk-FDB3J5QF.js.map → chunk-WG2HHYGK.js.map} +0 -0
package/dist/rich-input.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
PluginTriggerStack,
|
|
4
4
|
selectionFromItem,
|
|
5
5
|
triggerSummary
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K6N5CQDP.js";
|
|
7
7
|
import {
|
|
8
8
|
MODEL_REASONING_LEVELS_KEY,
|
|
9
9
|
PREFERRED_MODEL_KEY,
|
|
@@ -40,8 +40,8 @@ import {
|
|
|
40
40
|
useSessionDataInvalidation,
|
|
41
41
|
useSessionSkills,
|
|
42
42
|
useSkillStats
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-
|
|
43
|
+
} from "./chunk-34MHG656.js";
|
|
44
|
+
import "./chunk-JFGBDNDD.js";
|
|
45
45
|
import {
|
|
46
46
|
cn,
|
|
47
47
|
notifyChat,
|
|
@@ -51,8 +51,9 @@ import {
|
|
|
51
51
|
useChatSessionDetail,
|
|
52
52
|
useCurrentChatSessionId,
|
|
53
53
|
useSessionHandle,
|
|
54
|
-
useSessionSource
|
|
55
|
-
|
|
54
|
+
useSessionSource,
|
|
55
|
+
useSessionState
|
|
56
|
+
} from "./chunk-BZHMZBYT.js";
|
|
56
57
|
import {
|
|
57
58
|
Dialog,
|
|
58
59
|
DialogClose,
|
|
@@ -61,28 +62,26 @@ import {
|
|
|
61
62
|
cn as cn2,
|
|
62
63
|
dist_exports4 as dist_exports,
|
|
63
64
|
usePortalContainer
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import "./chunk-
|
|
65
|
+
} from "./chunk-J6YPRDQH.js";
|
|
66
|
+
import "./chunk-GBZEFIGW.js";
|
|
66
67
|
import {
|
|
67
68
|
Archive,
|
|
69
|
+
ArrowUp,
|
|
68
70
|
BookOpen,
|
|
69
71
|
Brain,
|
|
70
72
|
Check,
|
|
71
73
|
ChevronDown,
|
|
72
74
|
ChevronRight,
|
|
73
|
-
Download,
|
|
74
75
|
EyeOff,
|
|
75
76
|
File,
|
|
76
77
|
FileCode2,
|
|
77
78
|
FileText,
|
|
78
79
|
Film,
|
|
79
|
-
FlaskConical,
|
|
80
80
|
Folder,
|
|
81
81
|
FolderUp,
|
|
82
82
|
Import,
|
|
83
83
|
Lightbulb,
|
|
84
84
|
ListPlus,
|
|
85
|
-
ListTree,
|
|
86
85
|
LoaderCircle,
|
|
87
86
|
Mic,
|
|
88
87
|
Music,
|
|
@@ -90,17 +89,14 @@ import {
|
|
|
90
89
|
Play,
|
|
91
90
|
Plug,
|
|
92
91
|
Plus,
|
|
93
|
-
|
|
94
|
-
RotateCcw,
|
|
95
|
-
Scissors,
|
|
92
|
+
RotateCw,
|
|
96
93
|
Search,
|
|
97
|
-
|
|
98
|
-
Share2,
|
|
94
|
+
SlidersHorizontal,
|
|
99
95
|
Sparkles,
|
|
100
96
|
Square,
|
|
101
97
|
Terminal,
|
|
102
98
|
X
|
|
103
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-5ZV73E5D.js";
|
|
104
100
|
import {
|
|
105
101
|
__commonJS,
|
|
106
102
|
__require,
|
|
@@ -138,7 +134,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
138
134
|
},
|
|
139
135
|
[subscribe, value, getSnapshot]
|
|
140
136
|
);
|
|
141
|
-
|
|
137
|
+
useEffect11(
|
|
142
138
|
function() {
|
|
143
139
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
144
140
|
return subscribe(function() {
|
|
@@ -164,7 +160,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
164
160
|
return getSnapshot();
|
|
165
161
|
}
|
|
166
162
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
167
|
-
var React2 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState13 = React2.useState,
|
|
163
|
+
var React2 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState13 = React2.useState, useEffect11 = React2.useEffect, useLayoutEffect3 = React2.useLayoutEffect, useDebugValue3 = React2.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
168
164
|
exports.useSyncExternalStore = void 0 !== React2.useSyncExternalStore ? React2.useSyncExternalStore : shim;
|
|
169
165
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
170
166
|
})();
|
|
@@ -192,7 +188,7 @@ var require_with_selector_development = __commonJS({
|
|
|
192
188
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
193
189
|
}
|
|
194
190
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
195
|
-
var React2 = __require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore5 = shim.useSyncExternalStore, useRef8 = React2.useRef,
|
|
191
|
+
var React2 = __require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore5 = shim.useSyncExternalStore, useRef8 = React2.useRef, useEffect11 = React2.useEffect, useMemo8 = React2.useMemo, useDebugValue3 = React2.useDebugValue;
|
|
196
192
|
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
197
193
|
var instRef = useRef8(null);
|
|
198
194
|
if (null === instRef.current) {
|
|
@@ -235,7 +231,7 @@ var require_with_selector_development = __commonJS({
|
|
|
235
231
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
236
232
|
);
|
|
237
233
|
var value = useSyncExternalStore5(subscribe, instRef[0], instRef[1]);
|
|
238
|
-
|
|
234
|
+
useEffect11(
|
|
239
235
|
function() {
|
|
240
236
|
inst.hasValue = true;
|
|
241
237
|
inst.value = value;
|
|
@@ -25101,7 +25097,7 @@ var index_default2 = StarterKit;
|
|
|
25101
25097
|
|
|
25102
25098
|
// src/rich-input/ChatInput.tsx
|
|
25103
25099
|
import {
|
|
25104
|
-
useEffect as
|
|
25100
|
+
useEffect as useEffect9,
|
|
25105
25101
|
useRef as useRef7,
|
|
25106
25102
|
useState as useState11
|
|
25107
25103
|
} from "react";
|
|
@@ -25470,8 +25466,8 @@ function PopoverContent({
|
|
|
25470
25466
|
}
|
|
25471
25467
|
|
|
25472
25468
|
// src/rich-input/ModelSelector.tsx
|
|
25473
|
-
import { useMemo as useMemo4, useState as useState5 } from "react";
|
|
25474
|
-
import { jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
25469
|
+
import { useEffect as useEffect6, useMemo as useMemo4, useState as useState5 } from "react";
|
|
25470
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
25475
25471
|
var inputModalityLabels = {
|
|
25476
25472
|
text: "\u6587\u672C",
|
|
25477
25473
|
image: "\u56FE\u7247",
|
|
@@ -25489,19 +25485,100 @@ function formatInputModalities(model) {
|
|
|
25489
25485
|
if (modalities.length === 0) return "\u65E0\u8F93\u5165\u80FD\u529B";
|
|
25490
25486
|
return modalities.map((value) => inputModalityLabels[value] ?? value).join("\u3001");
|
|
25491
25487
|
}
|
|
25492
|
-
function
|
|
25488
|
+
function ModelCatalogPopoverBody({
|
|
25489
|
+
value,
|
|
25490
|
+
onSelectModel,
|
|
25491
|
+
refreshOnMount = false
|
|
25492
|
+
}) {
|
|
25493
|
+
const { models, isFetching, refresh } = useModelCatalog();
|
|
25494
|
+
const [query, setQuery] = useState5("");
|
|
25495
|
+
const selectedModel = models.find((model) => model.id === value);
|
|
25496
|
+
const selectedUnavailable = !!value.trim() && !selectedModel;
|
|
25497
|
+
useEffect6(() => {
|
|
25498
|
+
if (refreshOnMount) {
|
|
25499
|
+
void refresh();
|
|
25500
|
+
}
|
|
25501
|
+
}, []);
|
|
25502
|
+
const filteredModels = useMemo4(() => {
|
|
25503
|
+
const normalized = query.trim().toLowerCase();
|
|
25504
|
+
if (!normalized) return models;
|
|
25505
|
+
return models.filter((model) => {
|
|
25506
|
+
const inputLabel = formatInputModalities(model).toLowerCase();
|
|
25507
|
+
return model.id.toLowerCase().includes(normalized) || model.label.toLowerCase().includes(normalized) || inputLabel.includes(normalized);
|
|
25508
|
+
});
|
|
25509
|
+
}, [models, query]);
|
|
25510
|
+
return /* @__PURE__ */ jsxs3(Fragment4, { children: [
|
|
25511
|
+
/* @__PURE__ */ jsxs3("div", { className: "border-b border-border p-2", children: [
|
|
25512
|
+
/* @__PURE__ */ jsx12(
|
|
25513
|
+
"input",
|
|
25514
|
+
{
|
|
25515
|
+
value: query,
|
|
25516
|
+
onChange: (event) => setQuery(event.target.value),
|
|
25517
|
+
placeholder: "\u7B5B\u9009\u6A21\u578B...",
|
|
25518
|
+
className: "h-8 w-full rounded-lg border border-border bg-background px-2.5 text-xs text-foreground outline-none placeholder:text-muted-foreground focus:border-ring"
|
|
25519
|
+
}
|
|
25520
|
+
),
|
|
25521
|
+
selectedUnavailable ? /* @__PURE__ */ jsx12("p", { className: "px-1 pt-2 text-[11px] leading-4 text-destructive", children: "\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B\u4E0D\u53EF\u7528\u3002\u8BF7\u5728\u4E0B\u65B9\u9009\u62E9\u4E00\u4E2A\u6A21\u578B\uFF0C\u9009\u4E2D\u540E\u4F1A\u5728\u4E0B\u6B21\u53D1\u9001\u65F6\u5207\u6362\u3002" }) : null
|
|
25522
|
+
] }),
|
|
25523
|
+
/* @__PURE__ */ jsx12(
|
|
25524
|
+
"div",
|
|
25525
|
+
{
|
|
25526
|
+
className: "overflow-y-auto p-1",
|
|
25527
|
+
style: { maxHeight: "min(220px, max(0px, calc(var(--radix-popover-content-available-height) - 49px)))" },
|
|
25528
|
+
children: isFetching ? /* @__PURE__ */ jsxs3("output", { className: "flex items-center justify-center gap-2 px-3 py-6 text-xs text-muted-foreground", children: [
|
|
25529
|
+
/* @__PURE__ */ jsx12(LoaderCircle, { size: 14, className: "animate-spin", "aria-hidden": "true" }),
|
|
25530
|
+
"\u6B63\u5728\u52A0\u8F7D\u5019\u9009\u6A21\u578B..."
|
|
25531
|
+
] }) : models.length === 0 ? /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between gap-2 px-3 py-3 text-xs text-muted-foreground", children: [
|
|
25532
|
+
/* @__PURE__ */ jsx12("span", { children: "\u5F53\u524D\u6682\u65E0\u53EF\u7528\u6A21\u578B" }),
|
|
25533
|
+
/* @__PURE__ */ jsxs3(
|
|
25534
|
+
"button",
|
|
25535
|
+
{
|
|
25536
|
+
type: "button",
|
|
25537
|
+
onClick: () => void refresh(),
|
|
25538
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-xs text-foreground transition-colors hover:bg-accent",
|
|
25539
|
+
children: [
|
|
25540
|
+
/* @__PURE__ */ jsx12(RotateCw, { size: 12, "aria-hidden": "true" }),
|
|
25541
|
+
"\u91CD\u65B0\u52A0\u8F7D"
|
|
25542
|
+
]
|
|
25543
|
+
}
|
|
25544
|
+
)
|
|
25545
|
+
] }) : filteredModels.length === 0 ? /* @__PURE__ */ jsx12("div", { className: "px-3 py-2 text-xs text-muted-foreground", children: "\u6CA1\u6709\u5339\u914D\u7684\u6A21\u578B" }) : filteredModels.map((model) => {
|
|
25546
|
+
const inputLabel = formatInputModalities(model);
|
|
25547
|
+
const title = model.id === model.label ? `${model.id}\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${inputLabel}` : `${model.label} (${model.id})\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${inputLabel}`;
|
|
25548
|
+
return /* @__PURE__ */ jsxs3(
|
|
25549
|
+
"button",
|
|
25550
|
+
{
|
|
25551
|
+
type: "button",
|
|
25552
|
+
onClick: () => onSelectModel(model.id),
|
|
25553
|
+
className: `flex w-full items-center justify-between gap-3 rounded-lg px-3 py-2 text-left text-xs transition-colors ${model.id === value ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground"}`,
|
|
25554
|
+
title,
|
|
25555
|
+
children: [
|
|
25556
|
+
/* @__PURE__ */ jsx12("span", { className: "min-w-0 truncate", children: model.label }),
|
|
25557
|
+
/* @__PURE__ */ jsxs3("span", { className: "flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: [
|
|
25558
|
+
inputLabel,
|
|
25559
|
+
model.id === value ? /* @__PURE__ */ jsx12(Check, { size: 13, "aria-label": "\u5DF2\u9009\u62E9" }) : null
|
|
25560
|
+
] })
|
|
25561
|
+
]
|
|
25562
|
+
},
|
|
25563
|
+
model.id
|
|
25564
|
+
);
|
|
25565
|
+
})
|
|
25566
|
+
}
|
|
25567
|
+
)
|
|
25568
|
+
] });
|
|
25569
|
+
}
|
|
25570
|
+
function BannerModelSelector({
|
|
25493
25571
|
value,
|
|
25494
25572
|
onValueChange,
|
|
25495
25573
|
disabled = false,
|
|
25496
|
-
|
|
25497
|
-
|
|
25574
|
+
placement = "top",
|
|
25575
|
+
onOpenChange
|
|
25498
25576
|
}) {
|
|
25499
|
-
const { models, defaultModel, isLoading, isFetching, refresh } = useModelCatalog();
|
|
25500
25577
|
const [isOpen, setIsOpen] = useState5(false);
|
|
25501
|
-
const [query, setQuery] = useState5("");
|
|
25502
25578
|
const [mobileAnchor, setMobileAnchor] = useState5(null);
|
|
25503
25579
|
function handleOpenChange(open) {
|
|
25504
25580
|
setIsOpen(open);
|
|
25581
|
+
onOpenChange?.(open);
|
|
25505
25582
|
if (!open) return;
|
|
25506
25583
|
const isNarrow = window.matchMedia?.("(max-width: 767px)").matches ?? false;
|
|
25507
25584
|
if (isNarrow) {
|
|
@@ -25510,18 +25587,87 @@ function ModelSelector({
|
|
|
25510
25587
|
} else {
|
|
25511
25588
|
setMobileAnchor(null);
|
|
25512
25589
|
}
|
|
25513
|
-
void refresh();
|
|
25514
25590
|
}
|
|
25515
|
-
|
|
25516
|
-
|
|
25517
|
-
|
|
25518
|
-
|
|
25519
|
-
|
|
25520
|
-
|
|
25521
|
-
|
|
25591
|
+
return /* @__PURE__ */ jsx12("div", { className: "relative shrink-0", children: /* @__PURE__ */ jsxs3(Popover, { open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
25592
|
+
mobileAnchor ? /* @__PURE__ */ jsx12(PopoverAnchor, { virtualRef: mobileAnchor }) : null,
|
|
25593
|
+
/* @__PURE__ */ jsx12(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(
|
|
25594
|
+
"button",
|
|
25595
|
+
{
|
|
25596
|
+
type: "button",
|
|
25597
|
+
disabled,
|
|
25598
|
+
"aria-label": "\u9009\u62E9\u6A21\u578B",
|
|
25599
|
+
title: "\u9009\u62E9\u6216\u5207\u6362\u53EF\u7528\u6A21\u578B",
|
|
25600
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded-lg border border-[hsl(var(--destructive))]/25 bg-[hsl(var(--background))] px-2.5 py-1 text-xs font-medium text-[hsl(var(--foreground))] shadow-2xs transition-colors hover:border-[hsl(var(--destructive))]/45 hover:bg-[hsl(var(--accent))] disabled:cursor-not-allowed disabled:opacity-50",
|
|
25601
|
+
children: [
|
|
25602
|
+
/* @__PURE__ */ jsx12(Sparkles, { size: 13, className: "shrink-0 text-[hsl(var(--destructive))]", "aria-hidden": "true" }),
|
|
25603
|
+
/* @__PURE__ */ jsx12("span", { className: "whitespace-nowrap", children: "\u9009\u62E9\u6A21\u578B" }),
|
|
25604
|
+
/* @__PURE__ */ jsx12(ChevronDown, { size: 13, className: "shrink-0 text-[hsl(var(--muted-foreground))]", "aria-hidden": "true" })
|
|
25605
|
+
]
|
|
25606
|
+
}
|
|
25607
|
+
) }),
|
|
25608
|
+
isOpen ? /* @__PURE__ */ jsx12(
|
|
25609
|
+
PopoverContent,
|
|
25610
|
+
{
|
|
25611
|
+
side: mobileAnchor ? "top" : placement,
|
|
25612
|
+
align: mobileAnchor ? "start" : "end",
|
|
25613
|
+
sideOffset: mobileAnchor ? 0 : 8,
|
|
25614
|
+
collisionPadding: 8,
|
|
25615
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
25616
|
+
className: `block gap-0 overflow-hidden rounded-xl border border-border bg-popover p-0 text-base text-foreground shadow-[var(--swf-shadow-overlay)] ring-0 ${mobileAnchor ? "w-(--radix-popover-trigger-width)" : "w-[380px]"}`,
|
|
25617
|
+
children: /* @__PURE__ */ jsx12(
|
|
25618
|
+
ModelCatalogPopoverBody,
|
|
25619
|
+
{
|
|
25620
|
+
value,
|
|
25621
|
+
refreshOnMount: true,
|
|
25622
|
+
onSelectModel: (modelId) => {
|
|
25623
|
+
onValueChange(modelId);
|
|
25624
|
+
handleOpenChange(false);
|
|
25625
|
+
}
|
|
25626
|
+
}
|
|
25627
|
+
)
|
|
25628
|
+
}
|
|
25629
|
+
) : null
|
|
25630
|
+
] }) });
|
|
25631
|
+
}
|
|
25632
|
+
function ModelSelector(props) {
|
|
25633
|
+
if (props.variant === "banner") {
|
|
25634
|
+
return /* @__PURE__ */ jsx12(
|
|
25635
|
+
BannerModelSelector,
|
|
25636
|
+
{
|
|
25637
|
+
value: props.value,
|
|
25638
|
+
onValueChange: props.onValueChange,
|
|
25639
|
+
disabled: props.disabled,
|
|
25640
|
+
placement: props.placement,
|
|
25641
|
+
onOpenChange: props.onOpenChange
|
|
25522
25642
|
}
|
|
25523
25643
|
);
|
|
25524
|
-
}
|
|
25644
|
+
}
|
|
25645
|
+
return /* @__PURE__ */ jsx12(StandardModelSelector, { ...props });
|
|
25646
|
+
}
|
|
25647
|
+
function StandardModelSelector({
|
|
25648
|
+
value,
|
|
25649
|
+
onValueChange,
|
|
25650
|
+
disabled = false,
|
|
25651
|
+
compact = false,
|
|
25652
|
+
placement = "bottom",
|
|
25653
|
+
onOpenChange
|
|
25654
|
+
}) {
|
|
25655
|
+
const { models, defaultModel, isLoading, refresh } = useModelCatalog();
|
|
25656
|
+
const [isOpen, setIsOpen] = useState5(false);
|
|
25657
|
+
const [mobileAnchor, setMobileAnchor] = useState5(null);
|
|
25658
|
+
function handleOpenChange(open) {
|
|
25659
|
+
setIsOpen(open);
|
|
25660
|
+
onOpenChange?.(open);
|
|
25661
|
+
if (!open) return;
|
|
25662
|
+
const isNarrow = window.matchMedia?.("(max-width: 767px)").matches ?? false;
|
|
25663
|
+
if (isNarrow) {
|
|
25664
|
+
const rect = new DOMRect(8, window.innerHeight - 8, window.innerWidth - 16, 0);
|
|
25665
|
+
setMobileAnchor({ current: { getBoundingClientRect: () => rect } });
|
|
25666
|
+
} else {
|
|
25667
|
+
setMobileAnchor(null);
|
|
25668
|
+
}
|
|
25669
|
+
void refresh();
|
|
25670
|
+
}
|
|
25525
25671
|
const canSelect = models.length > 0;
|
|
25526
25672
|
const selectedModel = models.find((model) => model.id === value);
|
|
25527
25673
|
const defaultModelOption = models.find((model) => model.id === defaultModel);
|
|
@@ -25575,7 +25721,7 @@ function ModelSelector({
|
|
|
25575
25721
|
]
|
|
25576
25722
|
}
|
|
25577
25723
|
) }),
|
|
25578
|
-
/* @__PURE__ */
|
|
25724
|
+
/* @__PURE__ */ jsx12(
|
|
25579
25725
|
PopoverContent,
|
|
25580
25726
|
{
|
|
25581
25727
|
side: mobileAnchor ? "top" : placement,
|
|
@@ -25584,61 +25730,16 @@ function ModelSelector({
|
|
|
25584
25730
|
collisionPadding: 8,
|
|
25585
25731
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
25586
25732
|
className: `block gap-0 overflow-hidden rounded-xl border border-border bg-popover p-0 text-base text-foreground shadow-[var(--swf-shadow-overlay)] ring-0 ${mobileAnchor ? "w-(--radix-popover-trigger-width)" : "w-[380px]"}`,
|
|
25587
|
-
children:
|
|
25588
|
-
|
|
25589
|
-
|
|
25590
|
-
|
|
25591
|
-
|
|
25592
|
-
|
|
25593
|
-
|
|
25594
|
-
placeholder: "\u7B5B\u9009\u6A21\u578B...",
|
|
25595
|
-
className: "h-8 w-full rounded-lg border border-border bg-background px-2.5 text-xs text-foreground outline-none placeholder:text-muted-foreground focus:border-ring"
|
|
25596
|
-
}
|
|
25597
|
-
),
|
|
25598
|
-
selectedUnavailable ? /* @__PURE__ */ jsx12("p", { className: "px-1 pt-2 text-[11px] leading-4 text-destructive", children: "\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B\u4E0D\u53EF\u7528\u3002\u8BF7\u5728\u4E0B\u65B9\u9009\u62E9\u4E00\u4E2A\u6A21\u578B\uFF0C\u9009\u4E2D\u540E\u4F1A\u5728\u4E0B\u6B21\u53D1\u9001\u65F6\u5207\u6362\u3002" }) : null
|
|
25599
|
-
] }),
|
|
25600
|
-
/* @__PURE__ */ jsx12(
|
|
25601
|
-
"div",
|
|
25602
|
-
{
|
|
25603
|
-
className: "overflow-y-auto p-1",
|
|
25604
|
-
style: { maxHeight: "min(220px, max(0px, calc(var(--radix-popover-content-available-height) - 49px)))" },
|
|
25605
|
-
children: isFetching ? /* @__PURE__ */ jsxs3(
|
|
25606
|
-
"output",
|
|
25607
|
-
{
|
|
25608
|
-
className: "flex items-center justify-center gap-2 px-3 py-6 text-xs text-muted-foreground",
|
|
25609
|
-
children: [
|
|
25610
|
-
/* @__PURE__ */ jsx12(LoaderCircle, { size: 14, className: "animate-spin", "aria-hidden": "true" }),
|
|
25611
|
-
"\u6B63\u5728\u52A0\u8F7D\u5019\u9009\u6A21\u578B..."
|
|
25612
|
-
]
|
|
25613
|
-
}
|
|
25614
|
-
) : filteredModels.length === 0 ? /* @__PURE__ */ jsx12("div", { className: "px-3 py-2 text-xs text-muted-foreground", children: "\u6CA1\u6709\u5339\u914D\u7684\u6A21\u578B" }) : filteredModels.map((model) => {
|
|
25615
|
-
const inputLabel = formatInputModalities(model);
|
|
25616
|
-
const title = model.id === model.label ? `${model.id}\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${inputLabel}` : `${model.label} (${model.id})\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${inputLabel}`;
|
|
25617
|
-
return /* @__PURE__ */ jsxs3(
|
|
25618
|
-
"button",
|
|
25619
|
-
{
|
|
25620
|
-
type: "button",
|
|
25621
|
-
onClick: () => {
|
|
25622
|
-
onValueChange(model.id);
|
|
25623
|
-
setIsOpen(false);
|
|
25624
|
-
setQuery("");
|
|
25625
|
-
},
|
|
25626
|
-
className: `flex w-full items-center justify-between gap-3 rounded-lg px-3 py-2 text-left text-xs transition-colors ${model.id === value ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground"}`,
|
|
25627
|
-
title,
|
|
25628
|
-
children: [
|
|
25629
|
-
/* @__PURE__ */ jsx12("span", { className: "min-w-0 truncate", children: model.label }),
|
|
25630
|
-
/* @__PURE__ */ jsxs3("span", { className: "flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: [
|
|
25631
|
-
inputLabel,
|
|
25632
|
-
model.id === value ? /* @__PURE__ */ jsx12(Check, { size: 13, "aria-label": "\u5DF2\u9009\u62E9" }) : null
|
|
25633
|
-
] })
|
|
25634
|
-
]
|
|
25635
|
-
},
|
|
25636
|
-
model.id
|
|
25637
|
-
);
|
|
25638
|
-
})
|
|
25733
|
+
children: /* @__PURE__ */ jsx12(
|
|
25734
|
+
ModelCatalogPopoverBody,
|
|
25735
|
+
{
|
|
25736
|
+
value,
|
|
25737
|
+
onSelectModel: (modelId) => {
|
|
25738
|
+
onValueChange(modelId);
|
|
25739
|
+
handleOpenChange(false);
|
|
25639
25740
|
}
|
|
25640
|
-
|
|
25641
|
-
|
|
25741
|
+
}
|
|
25742
|
+
)
|
|
25642
25743
|
}
|
|
25643
25744
|
)
|
|
25644
25745
|
] }) });
|
|
@@ -25809,7 +25910,9 @@ function SkillStatusBar({
|
|
|
25809
25910
|
}) {
|
|
25810
25911
|
const { data: skillStatsData, error, loading } = useSkillStats(sessionId);
|
|
25811
25912
|
const skillStats = skillStatsData ?? EMPTY_SKILL_STATS;
|
|
25812
|
-
const
|
|
25913
|
+
const chatEnvironment = useChatEnvironment();
|
|
25914
|
+
const renderMode = useChatRenderMode();
|
|
25915
|
+
const mode = chatEnvironment.includeBuiltinSkills ? "developer" : renderMode;
|
|
25813
25916
|
const { data: allSessionSkills = NO_SKILLS, loading: skillsLoading, error: skillsFailure } = useSessionSkills(sessionId);
|
|
25814
25917
|
const skillsError = Boolean(skillsFailure);
|
|
25815
25918
|
const sessionSkills = visibleSkills(allSessionSkills, mode);
|
|
@@ -26219,7 +26322,7 @@ function ConnectButton({
|
|
|
26219
26322
|
}
|
|
26220
26323
|
|
|
26221
26324
|
// src/rich-input/voice/use-voice-input.ts
|
|
26222
|
-
import { useCallback as useCallback2, useEffect as
|
|
26325
|
+
import { useCallback as useCallback2, useEffect as useEffect7, useRef as useRef5, useState as useState7 } from "react";
|
|
26223
26326
|
|
|
26224
26327
|
// src/rich-input/voice/voice-input-support.ts
|
|
26225
26328
|
function isIpHost(hostname) {
|
|
@@ -26531,7 +26634,7 @@ function useVoiceInput(options) {
|
|
|
26531
26634
|
if (startAbortRef.current === abort) startAbortRef.current = null;
|
|
26532
26635
|
}
|
|
26533
26636
|
}, [reportError, disposeSession, getSocket]);
|
|
26534
|
-
|
|
26637
|
+
useEffect7(() => {
|
|
26535
26638
|
return () => {
|
|
26536
26639
|
startAbortRef.current?.abort();
|
|
26537
26640
|
const s = sessionRef.current;
|
|
@@ -26657,7 +26760,7 @@ function useReferenceCandidates(getScope, sources) {
|
|
|
26657
26760
|
}
|
|
26658
26761
|
|
|
26659
26762
|
// src/rich-input/use-input-history.ts
|
|
26660
|
-
import { useCallback as useCallback3, useEffect as
|
|
26763
|
+
import { useCallback as useCallback3, useEffect as useEffect8, useMemo as useMemo6, useState as useState8 } from "react";
|
|
26661
26764
|
|
|
26662
26765
|
// src/rich-input/lib/input-history-document.ts
|
|
26663
26766
|
import { normalizeTopicAssetRefs as normalizeTopicAssetRefs3 } from "@blade-hq/agent-client";
|
|
@@ -26751,13 +26854,13 @@ function useInputHistory(sessionId, client) {
|
|
|
26751
26854
|
const [entries, setEntries] = useState8([]);
|
|
26752
26855
|
const [cursor, setCursor] = useState8(null);
|
|
26753
26856
|
const [draft, setDraft] = useState8(emptyEntry);
|
|
26754
|
-
|
|
26857
|
+
useEffect8(() => {
|
|
26755
26858
|
setGeneration(getInputHistoryGeneration());
|
|
26756
26859
|
setEntries(readEntries(storageKey));
|
|
26757
26860
|
setCursor(null);
|
|
26758
26861
|
setDraft(emptyEntry());
|
|
26759
26862
|
}, [storageKey, client]);
|
|
26760
|
-
|
|
26863
|
+
useEffect8(() => {
|
|
26761
26864
|
if (!client) return;
|
|
26762
26865
|
return onInputCachesReset(client, () => {
|
|
26763
26866
|
setGeneration(getInputHistoryGeneration());
|
|
@@ -26921,7 +27024,7 @@ function listUserHomeDir(client, dirPath) {
|
|
|
26921
27024
|
}
|
|
26922
27025
|
|
|
26923
27026
|
// src/rich-input/FileCompletionMenu.tsx
|
|
26924
|
-
import { Fragment as
|
|
27027
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
26925
27028
|
var ROOT_DIR = ".";
|
|
26926
27029
|
function installSuggestionOutsideDismiss(container, onDismiss) {
|
|
26927
27030
|
const onPointerDown = (event) => {
|
|
@@ -27182,7 +27285,7 @@ var FileCompletionMenuContent = forwardRef2(function FileCompletionMenuContent2(
|
|
|
27182
27285
|
},
|
|
27183
27286
|
`${item.plugin}:${item.server}:${item.id}`
|
|
27184
27287
|
)),
|
|
27185
|
-
topicItems.length > 0 || topicError ? /* @__PURE__ */ jsxs8(
|
|
27288
|
+
topicItems.length > 0 || topicError ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
27186
27289
|
/* @__PURE__ */ jsx17("div", { className: "px-3 pt-1 pb-0.5 text-xs font-medium text-muted-foreground", children: "\u5DE5\u4F5C\u7A7A\u95F4\u8D44\u4EA7" }),
|
|
27187
27290
|
topicError ? /* @__PURE__ */ jsx17("output", { className: "block px-3 py-2 text-xs text-muted-foreground", children: topicError }) : null,
|
|
27188
27291
|
topicItems.map((item, topicIndex) => {
|
|
@@ -27551,7 +27654,7 @@ function ComposerAttachmentViewport({
|
|
|
27551
27654
|
}
|
|
27552
27655
|
|
|
27553
27656
|
// src/rich-input/ChatInput.tsx
|
|
27554
|
-
import { Fragment as
|
|
27657
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
27555
27658
|
var RECENT_SESSION_LIMIT = 50;
|
|
27556
27659
|
var DOUBLE_ESCAPE_MS = 450;
|
|
27557
27660
|
function getEditorText(editor) {
|
|
@@ -28010,7 +28113,7 @@ function ComposerContextPill({
|
|
|
28010
28113
|
}) {
|
|
28011
28114
|
const [showDetail, setShowDetail] = useState11(false);
|
|
28012
28115
|
const tokenK = formatTokenK(content);
|
|
28013
|
-
return /* @__PURE__ */ jsxs13(
|
|
28116
|
+
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
28014
28117
|
/* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--accent))] px-2.5 py-1 text-[11px] text-[hsl(var(--foreground))]", children: [
|
|
28015
28118
|
imageUrl ? /* @__PURE__ */ jsx24(
|
|
28016
28119
|
"button",
|
|
@@ -28131,13 +28234,13 @@ function ChatInput({
|
|
|
28131
28234
|
onBeforeSend,
|
|
28132
28235
|
ensureSession,
|
|
28133
28236
|
onCommand,
|
|
28134
|
-
canShareSession = false,
|
|
28237
|
+
canShareSession: _canShareSession = false,
|
|
28135
28238
|
slotAboveTextarea,
|
|
28136
28239
|
slotBeforeSend,
|
|
28137
28240
|
planPanel,
|
|
28138
28241
|
externalDraft,
|
|
28139
28242
|
externalAttachments,
|
|
28140
|
-
maxWidthClassName = "max-w-
|
|
28243
|
+
maxWidthClassName = "max-w-[var(--blade-chat-width,780px)]",
|
|
28141
28244
|
mergesWithPanelAbove = false,
|
|
28142
28245
|
className,
|
|
28143
28246
|
innerClassName,
|
|
@@ -28171,7 +28274,7 @@ function ChatInput({
|
|
|
28171
28274
|
inputRef.current = input;
|
|
28172
28275
|
const appliedInitialDraftKeyRef = useRef7(null);
|
|
28173
28276
|
const appliedInitialDraftRef = useRef7(null);
|
|
28174
|
-
|
|
28277
|
+
useEffect9(() => {
|
|
28175
28278
|
if (externalDraftValue == null) return;
|
|
28176
28279
|
if (inputRef.current === externalDraftValue) return;
|
|
28177
28280
|
if (editorRef.current) {
|
|
@@ -28179,7 +28282,7 @@ function ChatInput({
|
|
|
28179
28282
|
}
|
|
28180
28283
|
setInputInternal(externalDraftValue);
|
|
28181
28284
|
}, [externalDraftValue]);
|
|
28182
|
-
|
|
28285
|
+
useEffect9(() => {
|
|
28183
28286
|
const key = initialDraftKey ?? initialDraft ?? "";
|
|
28184
28287
|
if (!initialDraft || !key || appliedInitialDraftKeyRef.current === key) return;
|
|
28185
28288
|
if (inputRef.current === initialDraft) appliedInitialDraftRef.current = initialDraft;
|
|
@@ -28207,7 +28310,7 @@ function ChatInput({
|
|
|
28207
28310
|
const externalAttachmentsValue = externalAttachments?.value;
|
|
28208
28311
|
const composerAttachmentsRef = useRef7(composerAttachments);
|
|
28209
28312
|
composerAttachmentsRef.current = composerAttachments;
|
|
28210
|
-
|
|
28313
|
+
useEffect9(() => {
|
|
28211
28314
|
if (externalAttachmentsValue == null) return;
|
|
28212
28315
|
if (composerAttachmentsRef.current === externalAttachmentsValue) return;
|
|
28213
28316
|
setComposerAttachmentsInternal(externalAttachmentsValue);
|
|
@@ -28221,11 +28324,13 @@ function ChatInput({
|
|
|
28221
28324
|
const invalidation = useSessionDataInvalidation();
|
|
28222
28325
|
const SkillStatusBarComponent = SkillStatusBarOverride ?? SkillStatusBar;
|
|
28223
28326
|
const [actionMenuOpen, setActionMenuOpen] = useState11(false);
|
|
28327
|
+
const [bannerModelPickerOpen, setBannerModelPickerOpen] = useState11(false);
|
|
28224
28328
|
const actionMenuOpenRef = useRef7(false);
|
|
28225
|
-
|
|
28329
|
+
useEffect9(() => {
|
|
28226
28330
|
actionMenuOpenRef.current = actionMenuOpen;
|
|
28227
28331
|
}, [actionMenuOpen]);
|
|
28228
28332
|
const [connectMenuOpen, setConnectMenuOpen] = useState11(false);
|
|
28333
|
+
const [moreOptionsOpen, setMoreOptionsOpen] = useState11(false);
|
|
28229
28334
|
const fileInputRef = useRef7(null);
|
|
28230
28335
|
const folderInputRef = useRef7(null);
|
|
28231
28336
|
const editorRef = useRef7(null);
|
|
@@ -28284,7 +28389,7 @@ function ChatInput({
|
|
|
28284
28389
|
const skillItems = await getSlashSuggestions(query, {
|
|
28285
28390
|
client,
|
|
28286
28391
|
sessionId: getSessionId(),
|
|
28287
|
-
renderMode: environment.renderMode ?? "normal"
|
|
28392
|
+
renderMode: environment.includeBuiltinSkills ? "developer" : environment.renderMode ?? "normal"
|
|
28288
28393
|
}).catch(() => []);
|
|
28289
28394
|
return skillItems;
|
|
28290
28395
|
}
|
|
@@ -28534,7 +28639,7 @@ function ChatInput({
|
|
|
28534
28639
|
"aria-label": resolvedInputLabel,
|
|
28535
28640
|
"data-testid": "chat-message-input",
|
|
28536
28641
|
"data-blade-input-label": resolvedInputLabel,
|
|
28537
|
-
class: "min-h-[
|
|
28642
|
+
class: "min-h-[36px] max-h-[220px] overflow-y-auto px-2 py-1.5 text-[15px] leading-6 text-[hsl(var(--foreground))] focus:outline-none [&_.file-mention-pill]:inline-flex [&_.file-mention-pill]:items-center [&_.file-mention-pill]:rounded-full [&_.file-mention-pill]:bg-[hsl(var(--accent))] [&_.file-mention-pill]:px-2 [&_.file-mention-pill]:py-0.5 [&_.file-mention-pill]:font-medium [&_.file-mention-pill]:text-[hsl(var(--primary))] [&_.file-mention-pill]:select-none [&_.file-mention-pill]:whitespace-nowrap [&_.skill-mention-pill]:inline-flex [&_.skill-mention-pill]:items-center [&_.skill-mention-pill]:rounded-full [&_.skill-mention-pill]:bg-[hsl(var(--primary)/0.15)] [&_.skill-mention-pill]:px-2 [&_.skill-mention-pill]:py-0.5 [&_.skill-mention-pill]:font-medium [&_.skill-mention-pill]:text-[hsl(var(--primary))] [&_.skill-mention-pill]:select-none [&_.skill-mention-pill]:whitespace-nowrap [&_p:first-child]:mt-0 [&_p:last-child]:mb-0"
|
|
28538
28643
|
},
|
|
28539
28644
|
handleDOMEvents: {
|
|
28540
28645
|
focus: () => {
|
|
@@ -28610,13 +28715,13 @@ function ChatInput({
|
|
|
28610
28715
|
}
|
|
28611
28716
|
});
|
|
28612
28717
|
useDismissSkillSuggestionsOnModeChange(editor);
|
|
28613
|
-
|
|
28718
|
+
useEffect9(() => {
|
|
28614
28719
|
const dom = editor?.view.dom;
|
|
28615
28720
|
if (!dom) return;
|
|
28616
28721
|
dom.setAttribute("aria-label", resolvedInputLabel);
|
|
28617
28722
|
dom.setAttribute("data-blade-input-label", resolvedInputLabel);
|
|
28618
28723
|
}, [editor, resolvedInputLabel]);
|
|
28619
|
-
|
|
28724
|
+
useEffect9(() => {
|
|
28620
28725
|
if (!editor || !activeSessionId || rewindDraft == null) {
|
|
28621
28726
|
return;
|
|
28622
28727
|
}
|
|
@@ -28629,7 +28734,7 @@ function ChatInput({
|
|
|
28629
28734
|
}, [activeSessionId, editor, rewindDraft]);
|
|
28630
28735
|
const submittingRef = useRef7(false);
|
|
28631
28736
|
const [isSubmitting, setIsSubmitting] = useState11(false);
|
|
28632
|
-
|
|
28737
|
+
useEffect9(() => {
|
|
28633
28738
|
let changed = false;
|
|
28634
28739
|
const nextLocalIds = /* @__PURE__ */ new Set();
|
|
28635
28740
|
for (const attachment of composerAttachments) {
|
|
@@ -28654,7 +28759,7 @@ function ChatInput({
|
|
|
28654
28759
|
setLocalImageUrls(Object.fromEntries(localImageUrlsRef.current));
|
|
28655
28760
|
}
|
|
28656
28761
|
}, [composerAttachments]);
|
|
28657
|
-
|
|
28762
|
+
useEffect9(() => {
|
|
28658
28763
|
return () => {
|
|
28659
28764
|
for (const url of localImageUrlsRef.current.values()) {
|
|
28660
28765
|
URL.revokeObjectURL(url);
|
|
@@ -28664,7 +28769,7 @@ function ChatInput({
|
|
|
28664
28769
|
}, []);
|
|
28665
28770
|
const sessionHandle = useSessionHandle(activeSessionId);
|
|
28666
28771
|
const restoredPluginSelection = useRef7(null);
|
|
28667
|
-
|
|
28772
|
+
useEffect9(() => {
|
|
28668
28773
|
if (!sessionHandle || !activeSessionId || !editor) return;
|
|
28669
28774
|
const restore = () => {
|
|
28670
28775
|
if (restoredPluginSelection.current === activeSessionId) return;
|
|
@@ -28679,7 +28784,7 @@ function ChatInput({
|
|
|
28679
28784
|
restore();
|
|
28680
28785
|
return sessionHandle.subscribe(restore);
|
|
28681
28786
|
}, [sessionHandle, activeSessionId, editor]);
|
|
28682
|
-
|
|
28787
|
+
useEffect9(() => {
|
|
28683
28788
|
if (!sessionHandle || !activeSessionId) return;
|
|
28684
28789
|
const offInsert = sessionHandle.on("insertTextRequested", ({ text }) => {
|
|
28685
28790
|
const separate = /^\n/.test(text);
|
|
@@ -28714,7 +28819,7 @@ ${append2.text}` : append2.text;
|
|
|
28714
28819
|
editor.chain().focus("end").insertContent(text).run();
|
|
28715
28820
|
});
|
|
28716
28821
|
const editorReady = editor != null;
|
|
28717
|
-
|
|
28822
|
+
useEffect9(() => {
|
|
28718
28823
|
if (!editorReady || !draftAppends?.length) {
|
|
28719
28824
|
return;
|
|
28720
28825
|
}
|
|
@@ -28730,7 +28835,7 @@ ${append2.text}` : append2.text;
|
|
|
28730
28835
|
}
|
|
28731
28836
|
void stableHandleSubmit();
|
|
28732
28837
|
});
|
|
28733
|
-
|
|
28838
|
+
useEffect9(() => {
|
|
28734
28839
|
if (!sendRequests?.length) {
|
|
28735
28840
|
return;
|
|
28736
28841
|
}
|
|
@@ -28748,7 +28853,7 @@ ${append2.text}` : append2.text;
|
|
|
28748
28853
|
const voiceStopRef = useRef7(voice.stop);
|
|
28749
28854
|
voiceStopRef.current = voice.stop;
|
|
28750
28855
|
const prevSessionIdRef = useRef7(activeSessionId);
|
|
28751
|
-
|
|
28856
|
+
useEffect9(() => {
|
|
28752
28857
|
if (prevSessionIdRef.current !== activeSessionId) {
|
|
28753
28858
|
prevSessionIdRef.current = activeSessionId;
|
|
28754
28859
|
if (isRecording) {
|
|
@@ -28760,7 +28865,7 @@ ${append2.text}` : append2.text;
|
|
|
28760
28865
|
const json = editor?.getJSON();
|
|
28761
28866
|
return composerAttachments.length > 0 || collectMessageMentions(json).length > 0 || collectTopicAssetMentions(json).length > 0;
|
|
28762
28867
|
};
|
|
28763
|
-
const handleSubmit = async (queueWhenRunning = false) => {
|
|
28868
|
+
const handleSubmit = async (queueWhenRunning = false, overrideText) => {
|
|
28764
28869
|
if (connectionStatus !== "connected") {
|
|
28765
28870
|
return;
|
|
28766
28871
|
}
|
|
@@ -28780,7 +28885,8 @@ ${append2.text}` : append2.text;
|
|
|
28780
28885
|
return;
|
|
28781
28886
|
}
|
|
28782
28887
|
if (!isStreaming) {
|
|
28783
|
-
const
|
|
28888
|
+
const hasEffectiveContent = hasComposerContent || Boolean(overrideText?.trim());
|
|
28889
|
+
const modelGate = gateSendWhileModelLoading(isModelLoading, hasEffectiveContent);
|
|
28784
28890
|
if (modelGate.blocked) {
|
|
28785
28891
|
if (modelGate.hint) notifyChat(environment, "info", modelGate.hint);
|
|
28786
28892
|
return;
|
|
@@ -28816,7 +28922,7 @@ ${append2.text}` : append2.text;
|
|
|
28816
28922
|
notifyChat(environment, "error", "\u6BCF\u6761\u6D88\u606F\u6700\u591A\u5F15\u7528 20 \u4E2A\u5DE5\u4F5C\u7A7A\u95F4\u8D44\u4EA7");
|
|
28817
28923
|
return;
|
|
28818
28924
|
}
|
|
28819
|
-
const text = rawText;
|
|
28925
|
+
const text = overrideText ?? rawText;
|
|
28820
28926
|
const pendingFiles = composerAttachments.filter(
|
|
28821
28927
|
(a) => a.kind === "file" && a.status === "pending" && !!a.file
|
|
28822
28928
|
);
|
|
@@ -28915,12 +29021,18 @@ ${append2.text}` : append2.text;
|
|
|
28915
29021
|
}
|
|
28916
29022
|
}
|
|
28917
29023
|
const activePendingContexts = pendingContexts ?? [];
|
|
28918
|
-
|
|
28919
|
-
|
|
28920
|
-
|
|
28921
|
-
|
|
28922
|
-
|
|
28923
|
-
|
|
29024
|
+
let nextPayload;
|
|
29025
|
+
try {
|
|
29026
|
+
nextPayload = await buildSubmitPayload(
|
|
29027
|
+
text,
|
|
29028
|
+
updatedAttachments,
|
|
29029
|
+
activePendingContexts,
|
|
29030
|
+
onBeforeSend
|
|
29031
|
+
);
|
|
29032
|
+
} catch (error) {
|
|
29033
|
+
notifyChat(environment, "error", error instanceof Error ? error.message : "\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
|
|
29034
|
+
return;
|
|
29035
|
+
}
|
|
28924
29036
|
if (isMessageContentEmpty(nextPayload)) {
|
|
28925
29037
|
return;
|
|
28926
29038
|
}
|
|
@@ -28943,7 +29055,7 @@ ${append2.text}` : append2.text;
|
|
|
28943
29055
|
resetComposer();
|
|
28944
29056
|
return true;
|
|
28945
29057
|
};
|
|
28946
|
-
const composerWasReset = resetSubmittedComposer();
|
|
29058
|
+
const composerWasReset = overrideText ? false : resetSubmittedComposer();
|
|
28947
29059
|
let accepted;
|
|
28948
29060
|
try {
|
|
28949
29061
|
accepted = await onSend(nextPayload, {
|
|
@@ -28974,7 +29086,7 @@ ${append2.text}` : append2.text;
|
|
|
28974
29086
|
if (activeSessionId && activePendingContexts.length > 0) {
|
|
28975
29087
|
composerChannels.consumePendingContexts(activeSessionId);
|
|
28976
29088
|
}
|
|
28977
|
-
if (text.trim()) {
|
|
29089
|
+
if (!overrideText && text.trim()) {
|
|
28978
29090
|
inputHistory.addEntry(json);
|
|
28979
29091
|
}
|
|
28980
29092
|
} finally {
|
|
@@ -28982,7 +29094,7 @@ ${append2.text}` : append2.text;
|
|
|
28982
29094
|
setIsSubmitting(false);
|
|
28983
29095
|
}
|
|
28984
29096
|
};
|
|
28985
|
-
|
|
29097
|
+
useEffect9(() => {
|
|
28986
29098
|
if (!editor || !activeSessionId || !queuedTopicRefs?.length) return;
|
|
28987
29099
|
const existing = collectTopicAssetMentions(editor.getJSON());
|
|
28988
29100
|
const refs = composerChannels.consumeTopicAssetReferences(activeSessionId).filter((ref) => !existing.some((item) => item.topic_id === ref.topic_id && item.path === ref.path));
|
|
@@ -28996,7 +29108,7 @@ ${append2.text}` : append2.text;
|
|
|
28996
29108
|
};
|
|
28997
29109
|
const [showAddContext, setShowAddContext] = useState11(false);
|
|
28998
29110
|
const isPlanning = mode === "planning";
|
|
28999
|
-
const fullPlaceholder = isPlanning ? "\u89C4\u5212\u8FDB\u884C\u4E2D\u2026 \u53EF\u8F93\u5165\u8865\u5145\u9700\u6C42\u6216\u7B49\u5F85\u5B8C\u6210" : placeholderText ?? "\
|
|
29111
|
+
const fullPlaceholder = isPlanning ? "\u89C4\u5212\u8FDB\u884C\u4E2D\u2026 \u53EF\u8F93\u5165\u8865\u5145\u9700\u6C42\u6216\u7B49\u5F85\u5B8C\u6210" : placeholderText ?? "\u6D88\u606F";
|
|
29000
29112
|
const [typedPlaceholder, setTypedPlaceholder] = useState11(() => {
|
|
29001
29113
|
if (!typewriterPlaceholder) return fullPlaceholder;
|
|
29002
29114
|
const reduceMotion = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -29004,7 +29116,7 @@ ${append2.text}` : append2.text;
|
|
|
29004
29116
|
});
|
|
29005
29117
|
const typewriterPlayedRef = useRef7(false);
|
|
29006
29118
|
const isTypingRef = useRef7(false);
|
|
29007
|
-
|
|
29119
|
+
useEffect9(() => {
|
|
29008
29120
|
if (!typewriterPlaceholder || typewriterPlayedRef.current) return;
|
|
29009
29121
|
typewriterPlayedRef.current = true;
|
|
29010
29122
|
const reduceMotion = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -29025,7 +29137,7 @@ ${append2.text}` : append2.text;
|
|
|
29025
29137
|
isTypingRef.current = false;
|
|
29026
29138
|
};
|
|
29027
29139
|
}, [typewriterPlaceholder]);
|
|
29028
|
-
|
|
29140
|
+
useEffect9(() => {
|
|
29029
29141
|
if (isTypingRef.current) return;
|
|
29030
29142
|
setTypedPlaceholder(fullPlaceholder);
|
|
29031
29143
|
}, [fullPlaceholder]);
|
|
@@ -29045,11 +29157,35 @@ ${append2.text}` : append2.text;
|
|
|
29045
29157
|
const submitWhileRunning = isStreaming && !isStopping && queueWhileRunning;
|
|
29046
29158
|
const hasComposerContent = Boolean(input.trim()) || hasValidAttachments || hasRenderedAttachments || hasPendingContexts;
|
|
29047
29159
|
const isSendDisabled = connectionStatus !== "connected" || isCompacting || !submitWhileRunning && isModelLoading || !submitWhileRunning && !hasAvailableModel || isSubmitting || hasUploadingFiles || !input.trim() && !hasValidAttachments && !hasRenderedAttachments && !hasPendingContexts;
|
|
29160
|
+
const hasRecoverableLastTurn = useSessionState(activeSessionId ?? "", (state3) => {
|
|
29161
|
+
const last = state3.messages.at(-1);
|
|
29162
|
+
return Boolean(
|
|
29163
|
+
last && last.role === "assistant" && (last.status === "interrupted" || last.status === "failed")
|
|
29164
|
+
);
|
|
29165
|
+
});
|
|
29166
|
+
const canContinueGeneration = Boolean(activeSessionId) && hasRecoverableLastTurn && !isStreaming && !isCompacting && !hasComposerContent && !isRecording && !isSubmitting && connectionStatus === "connected" && !isModelLoading && hasAvailableModel;
|
|
29167
|
+
const hasMoreOptions = !lite;
|
|
29048
29168
|
const showQueueShortcut = Boolean(input.trim()) && !isSendDisabled && !isStopping && !isRecording && (!isStreaming || queueWhileRunning && !hasRunningSendBlockers());
|
|
29049
|
-
return /* @__PURE__ */ jsxs13(
|
|
29169
|
+
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
29050
29170
|
/* @__PURE__ */ jsx24("div", { className: `px-5 pb-3 pt-0 ${className ?? ""}`, children: /* @__PURE__ */ jsxs13("div", { className: `mx-auto ${maxWidthClassName} ${innerClassName ?? ""}`, children: [
|
|
29051
|
-
statusBarAddon ? /* @__PURE__ */
|
|
29052
|
-
|
|
29171
|
+
statusBarAddon || !lite && activeSessionId ? /* @__PURE__ */ jsxs13("div", { className: "mb-2 flex flex-wrap items-center gap-2 empty:mb-0", children: [
|
|
29172
|
+
statusBarAddon,
|
|
29173
|
+
!lite && activeSessionId ? /* @__PURE__ */ jsx24(BackgroundTasksPill, { sessionId: activeSessionId }) : null
|
|
29174
|
+
] }) : null,
|
|
29175
|
+
(!isModelLoading || bannerModelPickerOpen) && !hasAvailableModel ? /* @__PURE__ */ jsxs13("div", { className: "mb-2 flex items-center justify-between gap-3 rounded-xl border border-[hsl(var(--destructive))]/30 bg-[hsl(var(--destructive))]/8 px-3 py-1.5 text-xs text-[hsl(var(--destructive))]", children: [
|
|
29176
|
+
/* @__PURE__ */ jsx24("span", { className: "min-w-0 flex-1 leading-5", children: modelAvailabilityMessage || "\u6A21\u578B\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u6216\u91CD\u65B0\u9009\u62E9\u6A21\u578B" }),
|
|
29177
|
+
/* @__PURE__ */ jsx24(
|
|
29178
|
+
ModelSelector,
|
|
29179
|
+
{
|
|
29180
|
+
variant: "banner",
|
|
29181
|
+
disabled: isModelLoading && !bannerModelPickerOpen,
|
|
29182
|
+
value: selectedModel,
|
|
29183
|
+
onValueChange: model.selectModel,
|
|
29184
|
+
onOpenChange: setBannerModelPickerOpen,
|
|
29185
|
+
placement: "top"
|
|
29186
|
+
}
|
|
29187
|
+
)
|
|
29188
|
+
] }) : null,
|
|
29053
29189
|
/* @__PURE__ */ jsx24(
|
|
29054
29190
|
"div",
|
|
29055
29191
|
{
|
|
@@ -29087,9 +29223,9 @@ ${append2.text}` : append2.text;
|
|
|
29087
29223
|
children: /* @__PURE__ */ jsxs13(
|
|
29088
29224
|
"div",
|
|
29089
29225
|
{
|
|
29090
|
-
className: `overflow-visible border bg-[hsl(var(--card))] transition-[box-shadow,border-color] duration-
|
|
29226
|
+
className: `overflow-visible border bg-[hsl(var(--card))] transition-[box-shadow,border-color] duration-200 ${mergesWithPanelAbove ? "rounded-b-[28px]" : "rounded-[28px]"} ${isRecording ? "border-[hsl(var(--swf-success))]!" : isPlanning ? dragging || isEditorFocused ? "border-[hsl(var(--swf-warning)/0.6)]" : "border-[hsl(var(--swf-warning)/0.3)]" : dragging || isEditorFocused ? "border-[hsl(var(--primary)/0.45)] shadow-[0_2px_16px_-4px_hsl(var(--foreground)/0.1)]" : "border-[hsl(var(--border)/0.85)] shadow-xs"}`,
|
|
29091
29227
|
children: [
|
|
29092
|
-
dragging && /* @__PURE__ */ jsx24("div", { className: `pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-[hsl(var(--primary)/0.06)] ${mergesWithPanelAbove ? "rounded-b-[
|
|
29228
|
+
dragging && /* @__PURE__ */ jsx24("div", { className: `pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-[hsl(var(--primary)/0.06)] ${mergesWithPanelAbove ? "rounded-b-[28px]" : "rounded-[28px]"}`, children: /* @__PURE__ */ jsx24("span", { className: "rounded-full bg-[hsl(var(--primary)/0.12)] px-4 py-2 text-sm font-medium text-[hsl(var(--primary))]", children: "\u677E\u624B\u5F15\u7528\u6587\u4EF6" }) }),
|
|
29093
29229
|
planPanel,
|
|
29094
29230
|
composerAttachments.length > 0 && /* @__PURE__ */ jsxs13(ComposerAttachmentViewport, { className: "flex flex-col gap-2 border-b border-[hsl(var(--border))] px-4 py-2", children: [
|
|
29095
29231
|
imageAttachments.length > 0 && /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-3 gap-2", children: imageAttachments.map((attachment) => /* @__PURE__ */ jsxs13(
|
|
@@ -29171,12 +29307,8 @@ ${append2.text}` : append2.text;
|
|
|
29171
29307
|
),
|
|
29172
29308
|
attachments ? /* @__PURE__ */ jsx24("div", { className: "border-b border-[hsl(var(--border))] px-4 py-3", children: attachments }) : null,
|
|
29173
29309
|
slotAboveTextarea ? /* @__PURE__ */ jsx24("div", { className: "border-b border-[hsl(var(--border))] px-4 py-2", children: slotAboveTextarea }) : null,
|
|
29174
|
-
/* @__PURE__ */ jsxs13("div", { className: "
|
|
29175
|
-
|
|
29176
|
-
/* @__PURE__ */ jsx24(EditorContent, { editor })
|
|
29177
|
-
] }),
|
|
29178
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between px-4 pb-3 pt-1", children: [
|
|
29179
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
|
|
29310
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-end gap-1.5 px-2.5 py-2", children: [
|
|
29311
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center self-end", children: [
|
|
29180
29312
|
/* @__PURE__ */ jsx24(
|
|
29181
29313
|
"input",
|
|
29182
29314
|
{
|
|
@@ -29215,7 +29347,10 @@ ${append2.text}` : append2.text;
|
|
|
29215
29347
|
open: actionMenuOpen,
|
|
29216
29348
|
onOpenChange: (open) => {
|
|
29217
29349
|
setActionMenuOpen(open);
|
|
29218
|
-
if (open)
|
|
29350
|
+
if (!open) {
|
|
29351
|
+
setConnectMenuOpen(false);
|
|
29352
|
+
setMoreOptionsOpen(false);
|
|
29353
|
+
}
|
|
29219
29354
|
},
|
|
29220
29355
|
children: [
|
|
29221
29356
|
/* @__PURE__ */ jsx24(dist_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
@@ -29224,8 +29359,8 @@ ${append2.text}` : append2.text;
|
|
|
29224
29359
|
type: "button",
|
|
29225
29360
|
"aria-label": "\u6DFB\u52A0\u5185\u5BB9",
|
|
29226
29361
|
title: "\u6DFB\u52A0\u5185\u5BB9",
|
|
29227
|
-
className: "flex h-9 w-9 shrink-0 cursor-pointer items-center justify-center rounded-full
|
|
29228
|
-
children: /* @__PURE__ */ jsx24(Plus, { size:
|
|
29362
|
+
className: "flex h-9 w-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))] data-[state=open]:bg-[hsl(var(--accent))] data-[state=open]:text-[hsl(var(--foreground))]",
|
|
29363
|
+
children: /* @__PURE__ */ jsx24(Plus, { size: 20, strokeWidth: 1.85 })
|
|
29229
29364
|
}
|
|
29230
29365
|
) }),
|
|
29231
29366
|
/* @__PURE__ */ jsx24(dist_exports.Portal, { children: /* @__PURE__ */ jsxs13(
|
|
@@ -29234,7 +29369,7 @@ ${append2.text}` : append2.text;
|
|
|
29234
29369
|
side: "top",
|
|
29235
29370
|
align: "start",
|
|
29236
29371
|
sideOffset: 8,
|
|
29237
|
-
className: "z-30 w-[min(
|
|
29372
|
+
className: "z-30 w-[min(240px,calc(100vw-2rem))] origin-(--radix-popover-content-transform-origin) overflow-visible rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-sm text-[hsl(var(--popover-foreground))] shadow-[var(--swf-shadow-overlay)] outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
29238
29373
|
children: [
|
|
29239
29374
|
/* @__PURE__ */ jsxs13(
|
|
29240
29375
|
"button",
|
|
@@ -29244,9 +29379,9 @@ ${append2.text}` : append2.text;
|
|
|
29244
29379
|
setActionMenuOpen(false);
|
|
29245
29380
|
fileInputRef.current?.click();
|
|
29246
29381
|
},
|
|
29247
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29382
|
+
className: "flex w-full items-center gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29248
29383
|
children: [
|
|
29249
|
-
/* @__PURE__ */ jsx24(Paperclip, { size:
|
|
29384
|
+
/* @__PURE__ */ jsx24(Paperclip, { size: 16 }),
|
|
29250
29385
|
"\u4E0A\u4F20\u6587\u4EF6"
|
|
29251
29386
|
]
|
|
29252
29387
|
}
|
|
@@ -29259,224 +29394,120 @@ ${append2.text}` : append2.text;
|
|
|
29259
29394
|
setActionMenuOpen(false);
|
|
29260
29395
|
folderInputRef.current?.click();
|
|
29261
29396
|
},
|
|
29262
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29397
|
+
className: "flex w-full items-center gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29263
29398
|
children: [
|
|
29264
|
-
/* @__PURE__ */ jsx24(FolderUp, { size:
|
|
29399
|
+
/* @__PURE__ */ jsx24(FolderUp, { size: 16 }),
|
|
29265
29400
|
"\u4E0A\u4F20\u6587\u4EF6\u5939"
|
|
29266
29401
|
]
|
|
29267
29402
|
}
|
|
29268
29403
|
),
|
|
29269
|
-
|
|
29270
|
-
|
|
29271
|
-
{
|
|
29272
|
-
type: "button",
|
|
29273
|
-
onClick: () => {
|
|
29274
|
-
setActionMenuOpen(false);
|
|
29275
|
-
void onCommand("create_board_task");
|
|
29276
|
-
},
|
|
29277
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29278
|
-
children: [
|
|
29279
|
-
/* @__PURE__ */ jsx24(ListPlus, { size: 14 }),
|
|
29280
|
-
"\u521B\u5EFA\u540E\u53F0\u4EFB\u52A1"
|
|
29281
|
-
]
|
|
29282
|
-
}
|
|
29283
|
-
) : null,
|
|
29284
|
-
onCommand && !lite ? /* @__PURE__ */ jsxs13(
|
|
29285
|
-
"button",
|
|
29404
|
+
/* @__PURE__ */ jsx24(
|
|
29405
|
+
ConnectButton,
|
|
29286
29406
|
{
|
|
29287
|
-
|
|
29288
|
-
|
|
29289
|
-
|
|
29290
|
-
|
|
29291
|
-
|
|
29292
|
-
|
|
29293
|
-
children: [
|
|
29294
|
-
/* @__PURE__ */ jsx24(ListTree, { size: 14 }),
|
|
29295
|
-
"\u6D88\u606F\u8109\u7EDC"
|
|
29296
|
-
]
|
|
29297
|
-
}
|
|
29298
|
-
) : null,
|
|
29299
|
-
onDoubleEscape ? /* @__PURE__ */ jsxs13(
|
|
29300
|
-
"button",
|
|
29301
|
-
{
|
|
29302
|
-
type: "button",
|
|
29303
|
-
onClick: () => {
|
|
29304
|
-
setActionMenuOpen(false);
|
|
29305
|
-
onDoubleEscape(
|
|
29306
|
-
editorRef.current?.view.dom.getBoundingClientRect() ?? null
|
|
29307
|
-
);
|
|
29308
|
-
},
|
|
29309
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29310
|
-
children: [
|
|
29311
|
-
/* @__PURE__ */ jsx24(RotateCcw, { size: 14 }),
|
|
29312
|
-
"\u56DE\u5230\u4E4B\u524D\u7684\u67D0\u4E00\u6B65"
|
|
29313
|
-
]
|
|
29314
|
-
}
|
|
29315
|
-
) : null,
|
|
29316
|
-
onCommand && !lite ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
29317
|
-
developer ? /* @__PURE__ */ jsxs13(
|
|
29318
|
-
"button",
|
|
29319
|
-
{
|
|
29320
|
-
type: "button",
|
|
29321
|
-
onClick: () => {
|
|
29322
|
-
setActionMenuOpen(false);
|
|
29323
|
-
void onCommand("compact");
|
|
29324
|
-
},
|
|
29325
|
-
disabled: isBusy,
|
|
29326
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))] disabled:cursor-not-allowed disabled:opacity-50",
|
|
29327
|
-
children: [
|
|
29328
|
-
isCompacting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ jsx24(Scissors, { size: 14 }),
|
|
29329
|
-
"\u6574\u7406\u5BF9\u8BDD"
|
|
29330
|
-
]
|
|
29331
|
-
}
|
|
29332
|
-
) : null,
|
|
29333
|
-
/* @__PURE__ */ jsxs13(
|
|
29334
|
-
"button",
|
|
29335
|
-
{
|
|
29336
|
-
type: "button",
|
|
29337
|
-
onClick: () => {
|
|
29338
|
-
setActionMenuOpen(false);
|
|
29339
|
-
void onCommand("download_session");
|
|
29340
|
-
},
|
|
29341
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29342
|
-
children: [
|
|
29343
|
-
/* @__PURE__ */ jsx24(Download, { size: 14 }),
|
|
29344
|
-
"\u5BFC\u51FA\u4F1A\u8BDD"
|
|
29345
|
-
]
|
|
29346
|
-
}
|
|
29347
|
-
),
|
|
29348
|
-
/* @__PURE__ */ jsxs13(
|
|
29349
|
-
"button",
|
|
29350
|
-
{
|
|
29351
|
-
type: "button",
|
|
29352
|
-
onClick: () => {
|
|
29353
|
-
setActionMenuOpen(false);
|
|
29354
|
-
void onCommand("replay_session");
|
|
29355
|
-
},
|
|
29356
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29357
|
-
children: [
|
|
29358
|
-
/* @__PURE__ */ jsx24(Play, { size: 14 }),
|
|
29359
|
-
"\u56DE\u653E\u8FD9\u4E2A\u5BF9\u8BDD"
|
|
29360
|
-
]
|
|
29361
|
-
}
|
|
29362
|
-
),
|
|
29363
|
-
canShareSession ? /* @__PURE__ */ jsxs13(
|
|
29364
|
-
"button",
|
|
29365
|
-
{
|
|
29366
|
-
type: "button",
|
|
29367
|
-
onClick: () => {
|
|
29368
|
-
setActionMenuOpen(false);
|
|
29369
|
-
void onCommand("share_session");
|
|
29370
|
-
},
|
|
29371
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29372
|
-
children: [
|
|
29373
|
-
/* @__PURE__ */ jsx24(Share2, { size: 14 }),
|
|
29374
|
-
"\u5206\u4EAB\u4F1A\u8BDD"
|
|
29375
|
-
]
|
|
29376
|
-
}
|
|
29377
|
-
) : null,
|
|
29378
|
-
/* @__PURE__ */ jsxs13(
|
|
29379
|
-
"button",
|
|
29380
|
-
{
|
|
29381
|
-
type: "button",
|
|
29382
|
-
onClick: () => {
|
|
29383
|
-
setActionMenuOpen(false);
|
|
29384
|
-
void onCommand("extract_skill");
|
|
29385
|
-
},
|
|
29386
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29387
|
-
children: [
|
|
29388
|
-
/* @__PURE__ */ jsx24(FlaskConical, { size: 14 }),
|
|
29389
|
-
"\u63D0\u53D6\u6280\u80FD"
|
|
29390
|
-
]
|
|
29407
|
+
variant: "submenu",
|
|
29408
|
+
sessionId: activeSessionId,
|
|
29409
|
+
open: connectMenuOpen,
|
|
29410
|
+
onOpenChange: (open) => {
|
|
29411
|
+
setConnectMenuOpen(open);
|
|
29412
|
+
if (open) setMoreOptionsOpen(false);
|
|
29391
29413
|
}
|
|
29392
|
-
),
|
|
29393
|
-
/* @__PURE__ */ jsxs13(
|
|
29394
|
-
"button",
|
|
29395
|
-
{
|
|
29396
|
-
type: "button",
|
|
29397
|
-
onClick: () => {
|
|
29398
|
-
setActionMenuOpen(false);
|
|
29399
|
-
void onCommand("generate_app");
|
|
29400
|
-
},
|
|
29401
|
-
className: "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29402
|
-
children: [
|
|
29403
|
-
/* @__PURE__ */ jsx24(Rocket, { size: 14 }),
|
|
29404
|
-
"\u751F\u6210\u5E94\u7528"
|
|
29405
|
-
]
|
|
29406
|
-
}
|
|
29407
|
-
)
|
|
29408
|
-
] }) : null,
|
|
29409
|
-
onToggleMode && !lite ? /* @__PURE__ */ jsx24(
|
|
29410
|
-
PlanningToggle,
|
|
29411
|
-
{
|
|
29412
|
-
enabled: isPlanning,
|
|
29413
|
-
onChange: () => {
|
|
29414
|
-
setActionMenuOpen(false);
|
|
29415
|
-
onToggleMode();
|
|
29416
|
-
},
|
|
29417
|
-
disabled: isBusy
|
|
29418
29414
|
}
|
|
29419
|
-
)
|
|
29420
|
-
|
|
29421
|
-
|
|
29422
|
-
{
|
|
29423
|
-
level: selectedReasoningLevel,
|
|
29424
|
-
levels: reasoningLevels,
|
|
29425
|
-
disabled: isCompacting,
|
|
29426
|
-
disabledReason: developer ? "\u5BF9\u8BDD\u6574\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574" : "\u5904\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574",
|
|
29427
|
-
onChange: model.setReasoningLevel
|
|
29428
|
-
}
|
|
29429
|
-
) : null,
|
|
29430
|
-
!lite ? /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 px-3 py-2", children: [
|
|
29431
|
-
/* @__PURE__ */ jsx24(Sparkles, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
|
|
29432
|
-
/* @__PURE__ */ jsx24("span", { className: "shrink-0", children: "\u6A21\u578B" }),
|
|
29415
|
+
),
|
|
29416
|
+
hasMoreOptions ? /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
29417
|
+
/* @__PURE__ */ jsx24("div", { className: "my-1 h-px bg-[hsl(var(--border)/0.75)]" }),
|
|
29433
29418
|
/* @__PURE__ */ jsx24(
|
|
29434
|
-
|
|
29419
|
+
InputActionSubmenu,
|
|
29435
29420
|
{
|
|
29436
|
-
|
|
29437
|
-
|
|
29438
|
-
|
|
29439
|
-
|
|
29440
|
-
|
|
29421
|
+
label: "\u66F4\u591A\u9009\u9879",
|
|
29422
|
+
icon: /* @__PURE__ */ jsx24(SlidersHorizontal, { size: 16, "aria-hidden": "true" }),
|
|
29423
|
+
open: moreOptionsOpen,
|
|
29424
|
+
onOpenChange: (open) => {
|
|
29425
|
+
setMoreOptionsOpen(open);
|
|
29426
|
+
if (open) setConnectMenuOpen(false);
|
|
29427
|
+
},
|
|
29428
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-0.5 py-0.5 text-xs", children: [
|
|
29429
|
+
onCommand && canCreateBoardTask && !lite ? /* @__PURE__ */ jsxs13(
|
|
29430
|
+
"button",
|
|
29431
|
+
{
|
|
29432
|
+
type: "button",
|
|
29433
|
+
onClick: () => {
|
|
29434
|
+
setMoreOptionsOpen(false);
|
|
29435
|
+
setActionMenuOpen(false);
|
|
29436
|
+
void onCommand("create_board_task");
|
|
29437
|
+
},
|
|
29438
|
+
className: "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-xs transition-colors hover:bg-[hsl(var(--accent))]",
|
|
29439
|
+
children: [
|
|
29440
|
+
/* @__PURE__ */ jsx24(ListPlus, { size: 14, className: "shrink-0" }),
|
|
29441
|
+
/* @__PURE__ */ jsx24("span", { children: "\u521B\u5EFA\u540E\u53F0\u4EFB\u52A1" })
|
|
29442
|
+
]
|
|
29443
|
+
}
|
|
29444
|
+
) : null,
|
|
29445
|
+
onToggleMode ? /* @__PURE__ */ jsx24(
|
|
29446
|
+
PlanningToggle,
|
|
29447
|
+
{
|
|
29448
|
+
enabled: isPlanning,
|
|
29449
|
+
onChange: () => {
|
|
29450
|
+
setMoreOptionsOpen(false);
|
|
29451
|
+
setActionMenuOpen(false);
|
|
29452
|
+
onToggleMode();
|
|
29453
|
+
},
|
|
29454
|
+
disabled: isBusy
|
|
29455
|
+
}
|
|
29456
|
+
) : null,
|
|
29457
|
+
thinkingAvailable && reasoningLevels.length > 0 ? /* @__PURE__ */ jsx24(
|
|
29458
|
+
ReasoningModeSelect,
|
|
29459
|
+
{
|
|
29460
|
+
level: selectedReasoningLevel,
|
|
29461
|
+
levels: reasoningLevels,
|
|
29462
|
+
disabled: isCompacting,
|
|
29463
|
+
disabledReason: developer ? "\u5BF9\u8BDD\u6574\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574" : "\u5904\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574",
|
|
29464
|
+
onChange: model.setReasoningLevel
|
|
29465
|
+
}
|
|
29466
|
+
) : null,
|
|
29467
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2", children: [
|
|
29468
|
+
/* @__PURE__ */ jsx24(Sparkles, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
|
|
29469
|
+
/* @__PURE__ */ jsx24("span", { className: "shrink-0", children: "\u6A21\u578B" }),
|
|
29470
|
+
/* @__PURE__ */ jsx24(
|
|
29471
|
+
ModelSelector,
|
|
29472
|
+
{
|
|
29473
|
+
disabled: isModelLoading,
|
|
29474
|
+
value: selectedModel,
|
|
29475
|
+
onValueChange: model.selectModel,
|
|
29476
|
+
compact: true,
|
|
29477
|
+
placement: "top"
|
|
29478
|
+
}
|
|
29479
|
+
)
|
|
29480
|
+
] }),
|
|
29481
|
+
activeSessionId && moreOptionsOpen ? /* @__PURE__ */ jsxs13("div", { className: "border-t border-[hsl(var(--border))] px-3 py-2.5", children: [
|
|
29482
|
+
/* @__PURE__ */ jsx24(
|
|
29483
|
+
SkillStatusBarComponent,
|
|
29484
|
+
{
|
|
29485
|
+
sessionId: activeSessionId,
|
|
29486
|
+
onOpenSkills,
|
|
29487
|
+
vertical: true,
|
|
29488
|
+
className: skillStatusBarClassName,
|
|
29489
|
+
innerClassName: skillStatusBarInnerClassName
|
|
29490
|
+
}
|
|
29491
|
+
),
|
|
29492
|
+
composerHint ? /* @__PURE__ */ jsx24("div", { className: "mt-2 border-t border-[hsl(var(--border))] pt-2 text-[hsl(var(--muted-foreground))]", children: composerHint }) : null
|
|
29493
|
+
] }) : null
|
|
29494
|
+
] })
|
|
29441
29495
|
}
|
|
29442
29496
|
)
|
|
29443
|
-
] }) : null,
|
|
29444
|
-
!lite && activeSessionId && actionMenuOpen ? /* @__PURE__ */ jsxs13("div", { className: "border-t border-[hsl(var(--border))] px-3 py-2.5", children: [
|
|
29445
|
-
/* @__PURE__ */ jsx24(
|
|
29446
|
-
SkillStatusBarComponent,
|
|
29447
|
-
{
|
|
29448
|
-
sessionId: activeSessionId,
|
|
29449
|
-
onOpenSkills,
|
|
29450
|
-
vertical: true,
|
|
29451
|
-
className: skillStatusBarClassName,
|
|
29452
|
-
innerClassName: skillStatusBarInnerClassName
|
|
29453
|
-
}
|
|
29454
|
-
),
|
|
29455
|
-
composerHint ? /* @__PURE__ */ jsx24("div", { className: "mt-2 border-t border-[hsl(var(--border))] pt-2 text-[hsl(var(--muted-foreground))]", children: composerHint }) : null
|
|
29456
29497
|
] }) : null
|
|
29457
29498
|
]
|
|
29458
29499
|
}
|
|
29459
29500
|
) })
|
|
29460
29501
|
]
|
|
29461
29502
|
}
|
|
29462
|
-
)
|
|
29463
|
-
|
|
29464
|
-
|
|
29465
|
-
|
|
29466
|
-
|
|
29467
|
-
open: connectMenuOpen,
|
|
29468
|
-
onOpenChange: (open) => {
|
|
29469
|
-
setConnectMenuOpen(open);
|
|
29470
|
-
if (open) {
|
|
29471
|
-
setActionMenuOpen(false);
|
|
29472
|
-
}
|
|
29473
|
-
}
|
|
29474
|
-
}
|
|
29475
|
-
),
|
|
29476
|
-
!lite && activeSessionId ? /* @__PURE__ */ jsx24(BackgroundTasksPill, { sessionId: activeSessionId }) : null
|
|
29503
|
+
)
|
|
29504
|
+
] }),
|
|
29505
|
+
/* @__PURE__ */ jsxs13("div", { className: "relative min-w-0 flex-1 self-center", children: [
|
|
29506
|
+
input.length === 0 && /* @__PURE__ */ jsx24("div", { className: "pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 select-none truncate text-[15px] leading-6 text-[hsl(var(--muted-foreground)/0.65)]", children: placeholder }),
|
|
29507
|
+
/* @__PURE__ */ jsx24(EditorContent, { editor })
|
|
29477
29508
|
] }),
|
|
29478
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex
|
|
29479
|
-
showQueueShortcut && /* @__PURE__ */ jsxs13("span", { className: "mr-1 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
|
|
29509
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center gap-1.5 self-end", children: [
|
|
29510
|
+
showQueueShortcut && /* @__PURE__ */ jsxs13("span", { className: "mr-1 hidden text-[11px] text-[hsl(var(--muted-foreground))] sm:inline", children: [
|
|
29480
29511
|
queueShortcutLabel(),
|
|
29481
29512
|
" \xB7 \u6392\u961F\u6D88\u606F"
|
|
29482
29513
|
] }),
|
|
@@ -29488,12 +29519,12 @@ ${append2.text}` : append2.text;
|
|
|
29488
29519
|
onClick: voice.toggle,
|
|
29489
29520
|
"aria-label": isRecording || isVoiceStarting ? "\u505C\u6B62\u8BED\u97F3\u8F93\u5165" : "\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",
|
|
29490
29521
|
title: isVoiceStarting ? "\u6B63\u5728\u8FDE\u63A5\u8BED\u97F3\u8F93\u5165\uFF0C\u70B9\u51FB\u53D6\u6D88" : isRecording ? "\u505C\u6B62\u8BED\u97F3\u8F93\u5165" : "\u8BED\u97F3\u8F93\u5165",
|
|
29491
|
-
className: `flex items-center justify-center rounded-full transition-
|
|
29492
|
-
children: isVoiceStarting ? /* @__PURE__ */ jsx24(LoaderCircle, { size:
|
|
29522
|
+
className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full transition-colors duration-150 disabled:opacity-40 ${isRecording ? "bg-[hsl(var(--swf-success-soft))] text-[hsl(var(--swf-success))]" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]"}`,
|
|
29523
|
+
children: isVoiceStarting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 18, className: "animate-spin" }) : isRecording ? /* @__PURE__ */ jsx24(VoiceWaveform, { level: voiceLevel, size: 18 }) : /* @__PURE__ */ jsx24(Mic, { size: 19, strokeWidth: 1.85 })
|
|
29493
29524
|
}
|
|
29494
29525
|
) : null,
|
|
29495
|
-
isStreaming ? /* @__PURE__ */ jsxs13(
|
|
29496
|
-
submitWhileRunning ? /* @__PURE__ */ jsx24(
|
|
29526
|
+
isStreaming ? /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
29527
|
+
submitWhileRunning && hasComposerContent && !isSendDisabled && !isRecording ? /* @__PURE__ */ jsx24(
|
|
29497
29528
|
"button",
|
|
29498
29529
|
{
|
|
29499
29530
|
type: "button",
|
|
@@ -29501,8 +29532,8 @@ ${append2.text}` : append2.text;
|
|
|
29501
29532
|
disabled: isSendDisabled || isRecording,
|
|
29502
29533
|
"aria-label": "\u53D1\u9001\u5F15\u5BFC\u6D88\u606F",
|
|
29503
29534
|
title: "\u53D1\u9001\u5F15\u5BFC\u6D88\u606F",
|
|
29504
|
-
className: "flex h-
|
|
29505
|
-
children: isSubmitting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ jsx24(
|
|
29535
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] transition-opacity hover:opacity-90 disabled:opacity-30",
|
|
29536
|
+
children: isSubmitting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ jsx24(ArrowUp, { size: 18, strokeWidth: 2.25 })
|
|
29506
29537
|
}
|
|
29507
29538
|
) : null,
|
|
29508
29539
|
/* @__PURE__ */ jsx24(
|
|
@@ -29512,9 +29543,9 @@ ${append2.text}` : append2.text;
|
|
|
29512
29543
|
onClick: () => void onStop(),
|
|
29513
29544
|
disabled: isStopping,
|
|
29514
29545
|
"aria-label": isStopping ? "\u6B63\u5728\u505C\u6B62" : "\u505C\u6B62\u751F\u6210",
|
|
29515
|
-
title: isStopping ? "\u6B63\u5728\u505C\u6B62" : "\u505C\u6B62\u751F\u6210",
|
|
29516
|
-
className: "flex h-
|
|
29517
|
-
children: isStopping ? /* @__PURE__ */ jsx24(LoaderCircle, { size:
|
|
29546
|
+
title: isStopping ? "\u6B63\u5728\u505C\u6B62" : "\u505C\u6B62\u751F\u6210\uFF08\u6216\u53CC\u51FB Esc\uFF09",
|
|
29547
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--destructive)/0.14)] text-[hsl(var(--destructive))] transition-colors hover:bg-[hsl(var(--destructive))] hover:text-[hsl(var(--destructive-foreground))] disabled:cursor-wait disabled:opacity-70",
|
|
29548
|
+
children: isStopping ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 15, className: "animate-spin" }) : /* @__PURE__ */ jsx24(Square, { size: 13, fill: "currentColor" })
|
|
29518
29549
|
}
|
|
29519
29550
|
)
|
|
29520
29551
|
] }) : isCompacting ? /* @__PURE__ */ jsx24(
|
|
@@ -29524,21 +29555,35 @@ ${append2.text}` : append2.text;
|
|
|
29524
29555
|
disabled: true,
|
|
29525
29556
|
"aria-label": developer ? "\u6B63\u5728\u6574\u7406\u5BF9\u8BDD" : "\u6B63\u5728\u5904\u7406",
|
|
29526
29557
|
title: developer ? "\u6B63\u5728\u6574\u7406\u5BF9\u8BDD" : "\u6B63\u5728\u5904\u7406",
|
|
29527
|
-
className: "flex h-
|
|
29558
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--primary)/0.22)] text-[hsl(var(--primary))] opacity-70",
|
|
29528
29559
|
children: /* @__PURE__ */ jsx24(LoaderCircle, { size: 16, className: "animate-spin" })
|
|
29529
29560
|
}
|
|
29530
|
-
) :
|
|
29561
|
+
) : canContinueGeneration ? /* @__PURE__ */ jsxs13(
|
|
29562
|
+
"button",
|
|
29563
|
+
{
|
|
29564
|
+
type: "button",
|
|
29565
|
+
"data-testid": "composer-continue-button",
|
|
29566
|
+
onClick: () => void handleSubmit(false, "\u8BF7\u7EE7\u7EED\u5B8C\u6210\u521A\u624D\u672A\u5B8C\u6210\u7684\u56DE\u590D"),
|
|
29567
|
+
"aria-label": "\u7EE7\u7EED\u751F\u6210",
|
|
29568
|
+
title: "\u7EE7\u7EED\u5B8C\u6210\u4E0A\u4E00\u8F6E\u4E2D\u65AD\u6216\u5931\u8D25\u7684\u56DE\u590D",
|
|
29569
|
+
className: "inline-flex h-9 shrink-0 items-center gap-1 rounded-full bg-[hsl(var(--primary)/0.14)] px-3 text-xs font-medium text-[hsl(var(--primary))] transition-colors hover:bg-[hsl(var(--primary))] hover:text-[hsl(var(--primary-foreground))]",
|
|
29570
|
+
children: [
|
|
29571
|
+
/* @__PURE__ */ jsx24(Play, { size: 12, fill: "currentColor", "aria-hidden": "true" }),
|
|
29572
|
+
/* @__PURE__ */ jsx24("span", { children: "\u7EE7\u7EED" })
|
|
29573
|
+
]
|
|
29574
|
+
}
|
|
29575
|
+
) : /* @__PURE__ */ jsx24(
|
|
29531
29576
|
"button",
|
|
29532
29577
|
{
|
|
29533
29578
|
type: "button",
|
|
29534
29579
|
onClick: () => void handleSubmit(),
|
|
29535
|
-
disabled: isSendDisabled,
|
|
29580
|
+
disabled: isSendDisabled || isRecording,
|
|
29536
29581
|
"aria-label": "\u53D1\u9001\u5F15\u5BFC\u6D88\u606F",
|
|
29537
29582
|
title: isModelLoading ? "\u6B63\u5728\u52A0\u8F7D\u6A21\u578B\u914D\u7F6E" : !hasAvailableModel ? modelAvailabilityMessage : "\u53D1\u9001\u5F15\u5BFC\u6D88\u606F",
|
|
29538
|
-
className:
|
|
29539
|
-
children: isSubmitting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ jsx24(
|
|
29583
|
+
className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full transition-colors duration-150 ${isSendDisabled || isRecording ? "cursor-not-allowed bg-[hsl(var(--primary)/0.2)] text-[hsl(var(--primary)/0.65)]" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90"}`,
|
|
29584
|
+
children: isSubmitting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ jsx24(ArrowUp, { size: 18, strokeWidth: 2.25 })
|
|
29540
29585
|
}
|
|
29541
|
-
)
|
|
29586
|
+
)
|
|
29542
29587
|
] })
|
|
29543
29588
|
] }),
|
|
29544
29589
|
slotBelowActions ? /* @__PURE__ */ jsx24("div", { className: "border-t border-[hsl(var(--border))] px-4 py-1.5", children: slotBelowActions }) : null
|
|
@@ -29565,8 +29610,8 @@ ${append2.text}` : append2.text;
|
|
|
29565
29610
|
}
|
|
29566
29611
|
|
|
29567
29612
|
// src/rich-input/SkillActionMenu.tsx
|
|
29568
|
-
import { useEffect as
|
|
29569
|
-
import { Fragment as
|
|
29613
|
+
import { useEffect as useEffect10, useState as useState12 } from "react";
|
|
29614
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
29570
29615
|
function SkillActionMenu({ open, onOpenChange, renderMode, onSelect, onManage, disabled }) {
|
|
29571
29616
|
return /* @__PURE__ */ jsx25(InputActionSubmenu, { label: "\u6280\u80FD", icon: /* @__PURE__ */ jsx25(Sparkles, { size: 16, "aria-hidden": "true" }), open, onOpenChange, disabled, children: /* @__PURE__ */ jsx25(SkillPicker, { renderMode, onSelect, onManage }) });
|
|
29572
29617
|
}
|
|
@@ -29574,7 +29619,7 @@ function SkillPicker({ renderMode, onSelect, onManage }) {
|
|
|
29574
29619
|
const client = useBladeClient();
|
|
29575
29620
|
const [query, setQuery] = useState12("");
|
|
29576
29621
|
const [skills, setSkills] = useState12(null);
|
|
29577
|
-
|
|
29622
|
+
useEffect10(() => {
|
|
29578
29623
|
let active = true;
|
|
29579
29624
|
setSkills(null);
|
|
29580
29625
|
getSlashSuggestions(query, { client, sessionId: null, renderMode }).then((items) => {
|
|
@@ -29586,7 +29631,7 @@ function SkillPicker({ renderMode, onSelect, onManage }) {
|
|
|
29586
29631
|
active = false;
|
|
29587
29632
|
};
|
|
29588
29633
|
}, [client, renderMode, query]);
|
|
29589
|
-
return /* @__PURE__ */ jsxs14(
|
|
29634
|
+
return /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
29590
29635
|
/* @__PURE__ */ jsxs14("label", { className: "m-1 flex items-center gap-2 rounded-lg bg-[hsl(var(--muted))] px-3 py-2", children: [
|
|
29591
29636
|
/* @__PURE__ */ jsx25(Search, { size: 14, "aria-hidden": "true" }),
|
|
29592
29637
|
/* @__PURE__ */ jsx25("input", { "aria-label": "\u641C\u7D22\u6280\u80FD", placeholder: "\u641C\u7D22\u6280\u80FD", value: query, onChange: (event) => setQuery(event.target.value), className: "min-w-0 flex-1 bg-transparent outline-none" })
|