@blade-hq/agent-react 2612.0.0-beta.17 → 2612.0.0-beta.19
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/dist/chat/ChatLoadingIndicator.d.ts +7 -0
- package/dist/{chunk-7TQVTNPL.js → chunk-GXJCVUXP.js} +1 -1
- package/dist/chunk-GXJCVUXP.js.map +1 -0
- package/dist/{chunk-EYRP6PV3.js → chunk-LC7Q64YI.js} +2 -2
- package/dist/{chunk-6YMUPKGL.js → chunk-ZAEHTW2O.js} +885 -869
- package/dist/chunk-ZAEHTW2O.js.map +1 -0
- package/dist/embed/entry.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +7 -3
- package/dist/internal.js.map +1 -1
- package/dist/rich-input/index.d.ts +1 -1
- package/dist/rich-input/lib/composer-content.d.ts +5 -1
- package/dist/rich-input/lib/plugin-suggestions.d.ts +4 -4
- package/dist/rich-input.js +34 -16
- package/dist/rich-input.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-6YMUPKGL.js.map +0 -1
- package/dist/chunk-7TQVTNPL.js.map +0 -1
- /package/dist/{chunk-EYRP6PV3.js.map → chunk-LC7Q64YI.js.map} +0 -0
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
useSessionSource,
|
|
114
114
|
useSessionState,
|
|
115
115
|
useSingleSessionSource
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-GXJCVUXP.js";
|
|
117
117
|
import {
|
|
118
118
|
__export
|
|
119
119
|
} from "./chunk-PR4QN5HX.js";
|
|
@@ -26441,6 +26441,24 @@ ${content3}`);
|
|
|
26441
26441
|
] });
|
|
26442
26442
|
}
|
|
26443
26443
|
|
|
26444
|
+
// src/chat/ChatLoadingIndicator.tsx
|
|
26445
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
26446
|
+
function isPreparingReply(messages) {
|
|
26447
|
+
for (let index2 = messages.length - 1; index2 >= 0; index2 -= 1) {
|
|
26448
|
+
const message = messages[index2];
|
|
26449
|
+
if (message.kind === "context") continue;
|
|
26450
|
+
if (message.role === "assistant") return false;
|
|
26451
|
+
if (message.role === "user") return true;
|
|
26452
|
+
}
|
|
26453
|
+
return true;
|
|
26454
|
+
}
|
|
26455
|
+
function ChatLoadingIndicator({ preparing = false }) {
|
|
26456
|
+
return /* @__PURE__ */ jsxs9("output", { className: "flex h-[38px] items-center gap-2 px-1 text-xs text-[hsl(var(--muted-foreground))]", "aria-live": "polite", children: [
|
|
26457
|
+
/* @__PURE__ */ jsx9(LoaderCircle, { size: 14, className: "animate-spin", "aria-hidden": "true" }),
|
|
26458
|
+
/* @__PURE__ */ jsx9("span", { children: preparing ? "\u6B63\u5728\u51C6\u5907\u53EF\u7528\u5DE5\u5177\u2026" : "\u6B63\u5728\u751F\u6210\u4E2D\u2026" })
|
|
26459
|
+
] });
|
|
26460
|
+
}
|
|
26461
|
+
|
|
26444
26462
|
// src/chat/LiteMessageList.tsx
|
|
26445
26463
|
import { useCallback as useCallback8, useEffect as useEffect19, useMemo as useMemo12, useRef as useRef18, useState as useState24 } from "react";
|
|
26446
26464
|
import {
|
|
@@ -26507,18 +26525,18 @@ function parsePluginEvidence(call) {
|
|
|
26507
26525
|
import { chatErrorForDisplay as chatErrorForDisplay2, isBackgroundWakeMessage as isBackgroundWakeMessage2 } from "@blade-hq/agent-client/internal";
|
|
26508
26526
|
|
|
26509
26527
|
// src/components/BackgroundWakeNotice.tsx
|
|
26510
|
-
import { jsx as
|
|
26528
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
26511
26529
|
function BackgroundWakeNotice() {
|
|
26512
|
-
return /* @__PURE__ */
|
|
26530
|
+
return /* @__PURE__ */ jsxs10(
|
|
26513
26531
|
"div",
|
|
26514
26532
|
{
|
|
26515
26533
|
"data-background-wakeup": true,
|
|
26516
26534
|
className: "my-3 flex items-start gap-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.35)] px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]",
|
|
26517
26535
|
children: [
|
|
26518
|
-
/* @__PURE__ */
|
|
26519
|
-
/* @__PURE__ */
|
|
26520
|
-
/* @__PURE__ */
|
|
26521
|
-
/* @__PURE__ */
|
|
26536
|
+
/* @__PURE__ */ jsx10(BellRing, { size: 14, className: "mt-0.5 shrink-0", "aria-hidden": "true" }),
|
|
26537
|
+
/* @__PURE__ */ jsxs10("div", { children: [
|
|
26538
|
+
/* @__PURE__ */ jsx10("p", { className: "font-medium", children: "\u540E\u53F0\u4EFB\u52A1\u5DF2\u7ED3\u675F" }),
|
|
26539
|
+
/* @__PURE__ */ jsx10("p", { className: "mt-0.5", children: "\u52A9\u624B\u5DF2\u81EA\u52A8\u7EE7\u7EED\u5904\u7406\u7ED3\u679C" })
|
|
26522
26540
|
] })
|
|
26523
26541
|
]
|
|
26524
26542
|
}
|
|
@@ -26527,7 +26545,7 @@ function BackgroundWakeNotice() {
|
|
|
26527
26545
|
|
|
26528
26546
|
// src/components/MessageImage.tsx
|
|
26529
26547
|
import { forwardRef, useEffect as useEffect7, useImperativeHandle, useRef as useRef8, useState as useState8 } from "react";
|
|
26530
|
-
import { jsx as
|
|
26548
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
26531
26549
|
var assetPattern = /^\/api\/(sessions|share)\/([^/]+)\/media\/([a-f0-9]{64})$/;
|
|
26532
26550
|
var MessageImage = forwardRef(function MessageImage2({ client: suppliedClient, src, original = false, alt, style, ...props }, ref) {
|
|
26533
26551
|
const contextClient = useOptionalBladeClient();
|
|
@@ -26577,7 +26595,7 @@ var MessageImage = forwardRef(function MessageImage2({ client: suppliedClient, s
|
|
|
26577
26595
|
}, [visible, client, scope, sessionId, assetId, original, source]);
|
|
26578
26596
|
const current = result?.source === source && result.client === client ? result : null;
|
|
26579
26597
|
const imageStyle = { aspectRatio: props.width && props.height ? `${props.width}/${props.height}` : void 0, ...style };
|
|
26580
|
-
return /* @__PURE__ */
|
|
26598
|
+
return /* @__PURE__ */ jsx11(
|
|
26581
26599
|
"img",
|
|
26582
26600
|
{
|
|
26583
26601
|
...props,
|
|
@@ -26618,16 +26636,16 @@ import {
|
|
|
26618
26636
|
} from "@blade-hq/agent-client/internal";
|
|
26619
26637
|
|
|
26620
26638
|
// ../ui/src/components/collapsible.tsx
|
|
26621
|
-
import { jsx as
|
|
26639
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
26622
26640
|
function Collapsible({
|
|
26623
26641
|
...props
|
|
26624
26642
|
}) {
|
|
26625
|
-
return /* @__PURE__ */
|
|
26643
|
+
return /* @__PURE__ */ jsx12(dist_exports.Root, { "data-slot": "collapsible", ...props });
|
|
26626
26644
|
}
|
|
26627
26645
|
function CollapsibleTrigger({
|
|
26628
26646
|
...props
|
|
26629
26647
|
}) {
|
|
26630
|
-
return /* @__PURE__ */
|
|
26648
|
+
return /* @__PURE__ */ jsx12(
|
|
26631
26649
|
dist_exports.CollapsibleTrigger,
|
|
26632
26650
|
{
|
|
26633
26651
|
"data-slot": "collapsible-trigger",
|
|
@@ -26638,7 +26656,7 @@ function CollapsibleTrigger({
|
|
|
26638
26656
|
function CollapsibleContent({
|
|
26639
26657
|
...props
|
|
26640
26658
|
}) {
|
|
26641
|
-
return /* @__PURE__ */
|
|
26659
|
+
return /* @__PURE__ */ jsx12(
|
|
26642
26660
|
dist_exports.CollapsibleContent,
|
|
26643
26661
|
{
|
|
26644
26662
|
"data-slot": "collapsible-content",
|
|
@@ -26661,7 +26679,7 @@ import {
|
|
|
26661
26679
|
|
|
26662
26680
|
// src/chat/ai-elements/shimmer.tsx
|
|
26663
26681
|
import { memo as memo3, useMemo as useMemo3 } from "react";
|
|
26664
|
-
import { jsx as
|
|
26682
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
26665
26683
|
var ShimmerComponent = ({
|
|
26666
26684
|
children,
|
|
26667
26685
|
as: Component2 = "p",
|
|
@@ -26670,7 +26688,7 @@ var ShimmerComponent = ({
|
|
|
26670
26688
|
spread = 2
|
|
26671
26689
|
}) => {
|
|
26672
26690
|
const dynamicSpread = useMemo3(() => (children?.length ?? 0) * spread, [children, spread]);
|
|
26673
|
-
return /* @__PURE__ */
|
|
26691
|
+
return /* @__PURE__ */ jsx13(
|
|
26674
26692
|
Component2,
|
|
26675
26693
|
{
|
|
26676
26694
|
className: cn(
|
|
@@ -35613,12 +35631,12 @@ function MarkdownRenderer({
|
|
|
35613
35631
|
}
|
|
35614
35632
|
|
|
35615
35633
|
// src/chat/markdown/ExternalAnchor.tsx
|
|
35616
|
-
import { jsx as
|
|
35634
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
35617
35635
|
function ExternalAnchor({ children, href, ...props }) {
|
|
35618
35636
|
if (typeof href === "string" && href.startsWith("#")) {
|
|
35619
|
-
return /* @__PURE__ */
|
|
35637
|
+
return /* @__PURE__ */ jsx14("a", { ...props, href, children });
|
|
35620
35638
|
}
|
|
35621
|
-
return /* @__PURE__ */
|
|
35639
|
+
return /* @__PURE__ */ jsx14("a", { ...props, href, target: "_blank", rel: "noopener noreferrer", children });
|
|
35622
35640
|
}
|
|
35623
35641
|
|
|
35624
35642
|
// src/chat/markdown/text.ts
|
|
@@ -35741,7 +35759,7 @@ function resolveSessionMarkdownAssetUrl(rawSrc, sessionId, baseFilePath, buildAu
|
|
|
35741
35759
|
}
|
|
35742
35760
|
|
|
35743
35761
|
// src/chat/markdown/MarkdownContent.tsx
|
|
35744
|
-
import { Fragment as Fragment6, jsx as
|
|
35762
|
+
import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
35745
35763
|
var SYSTEM_REMINDER_TAG = "system-reminder";
|
|
35746
35764
|
var TOOL_CALL_TAG = "blade-malformed-tool-call";
|
|
35747
35765
|
var CITATION_TAG = "blade-citation-ref";
|
|
@@ -35759,7 +35777,7 @@ function HighlightedCode({ className, children, "data-block-offset": _blockOffse
|
|
|
35759
35777
|
const raw = String(children ?? "");
|
|
35760
35778
|
const { highlightedHtml } = useHighlightedCode(isInline ? "" : raw, isInline ? null : match?.[1] ?? null);
|
|
35761
35779
|
if (!isInline && highlightedHtml) {
|
|
35762
|
-
return /* @__PURE__ */
|
|
35780
|
+
return /* @__PURE__ */ jsx15(
|
|
35763
35781
|
"code",
|
|
35764
35782
|
{
|
|
35765
35783
|
className,
|
|
@@ -35768,7 +35786,7 @@ function HighlightedCode({ className, children, "data-block-offset": _blockOffse
|
|
|
35768
35786
|
}
|
|
35769
35787
|
);
|
|
35770
35788
|
}
|
|
35771
|
-
return /* @__PURE__ */
|
|
35789
|
+
return /* @__PURE__ */ jsx15("code", { className, ...props, children });
|
|
35772
35790
|
}
|
|
35773
35791
|
var malformedToolCallContent = /* @__PURE__ */ new Map();
|
|
35774
35792
|
function InlineToolCallBlock({
|
|
@@ -35779,8 +35797,8 @@ function InlineToolCallBlock({
|
|
|
35779
35797
|
}) {
|
|
35780
35798
|
const rawText = resolveCollapsedContent({ dataKeyAttribute, dataRawAttribute, children }) || extractText(children).trim();
|
|
35781
35799
|
const [open2, setOpen] = useState9(false);
|
|
35782
|
-
return /* @__PURE__ */
|
|
35783
|
-
/* @__PURE__ */
|
|
35800
|
+
return /* @__PURE__ */ jsxs11("span", { ...props, className: "not-prose relative inline-flex align-baseline", children: [
|
|
35801
|
+
/* @__PURE__ */ jsx15(
|
|
35784
35802
|
"button",
|
|
35785
35803
|
{
|
|
35786
35804
|
type: "button",
|
|
@@ -35791,24 +35809,24 @@ function InlineToolCallBlock({
|
|
|
35791
35809
|
children: "\u6298\u53E0\u7684\u5185\u5BB9"
|
|
35792
35810
|
}
|
|
35793
35811
|
),
|
|
35794
|
-
/* @__PURE__ */
|
|
35812
|
+
/* @__PURE__ */ jsx15(Dialog, { open: open2, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs11(
|
|
35795
35813
|
DialogContent,
|
|
35796
35814
|
{
|
|
35797
35815
|
showCloseButton: false,
|
|
35798
35816
|
className: "m-0 flex max-h-[min(520px,calc(100vh-48px))] w-[min(760px,calc(100vw-48px))] flex-col gap-0 overflow-hidden p-0 text-left text-[13px] leading-6",
|
|
35799
35817
|
children: [
|
|
35800
|
-
/* @__PURE__ */
|
|
35801
|
-
/* @__PURE__ */
|
|
35802
|
-
/* @__PURE__ */
|
|
35818
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between gap-3 border-b border-[hsl(var(--border))] px-4 py-2", children: [
|
|
35819
|
+
/* @__PURE__ */ jsx15(DialogTitle, { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u6298\u53E0\u7684\u5185\u5BB9" }),
|
|
35820
|
+
/* @__PURE__ */ jsx15(
|
|
35803
35821
|
DialogClose,
|
|
35804
35822
|
{
|
|
35805
35823
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
35806
35824
|
"aria-label": "\u5173\u95ED\u6298\u53E0\u7684\u5185\u5BB9",
|
|
35807
|
-
children: /* @__PURE__ */
|
|
35825
|
+
children: /* @__PURE__ */ jsx15(X, { size: 14, "aria-hidden": "true" })
|
|
35808
35826
|
}
|
|
35809
35827
|
)
|
|
35810
35828
|
] }),
|
|
35811
|
-
/* @__PURE__ */
|
|
35829
|
+
/* @__PURE__ */ jsx15("pre", { className: "m-0 overflow-auto px-4 py-3 font-mono text-[12px] leading-5 whitespace-pre-wrap text-[hsl(var(--popover-foreground))]", children: rawText || children })
|
|
35812
35830
|
]
|
|
35813
35831
|
}
|
|
35814
35832
|
) })
|
|
@@ -35819,7 +35837,7 @@ function CitationRefBlock({ "data-n": dataN, citations }) {
|
|
|
35819
35837
|
const [snapshotOpen, setSnapshotOpen] = useState9(false);
|
|
35820
35838
|
const n2 = Number(dataN);
|
|
35821
35839
|
const entry = Number.isFinite(n2) ? citations?.[n2] : void 0;
|
|
35822
|
-
if (!entry) return /* @__PURE__ */
|
|
35840
|
+
if (!entry) return /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
35823
35841
|
"[",
|
|
35824
35842
|
dataN,
|
|
35825
35843
|
"]"
|
|
@@ -35831,9 +35849,9 @@ function CitationRefBlock({ "data-n": dataN, citations }) {
|
|
|
35831
35849
|
window.open(entry.previewUrl, "_blank", "noopener,noreferrer");
|
|
35832
35850
|
}
|
|
35833
35851
|
};
|
|
35834
|
-
return /* @__PURE__ */
|
|
35835
|
-
/* @__PURE__ */
|
|
35836
|
-
/* @__PURE__ */
|
|
35852
|
+
return /* @__PURE__ */ jsxs11(dist_exports2.Provider, { delayDuration: 150, children: [
|
|
35853
|
+
/* @__PURE__ */ jsxs11(dist_exports2.Root, { children: [
|
|
35854
|
+
/* @__PURE__ */ jsx15(dist_exports2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx15(
|
|
35837
35855
|
"button",
|
|
35838
35856
|
{
|
|
35839
35857
|
type: "button",
|
|
@@ -35847,27 +35865,27 @@ function CitationRefBlock({ "data-n": dataN, citations }) {
|
|
|
35847
35865
|
children: entry.n
|
|
35848
35866
|
}
|
|
35849
35867
|
) }),
|
|
35850
|
-
/* @__PURE__ */
|
|
35868
|
+
/* @__PURE__ */ jsx15(dist_exports2.Portal, { container: overlayRoot, children: /* @__PURE__ */ jsxs11(
|
|
35851
35869
|
dist_exports2.Content,
|
|
35852
35870
|
{
|
|
35853
35871
|
side: "top",
|
|
35854
35872
|
sideOffset: 6,
|
|
35855
35873
|
className: "z-[70] flex max-w-sm origin-(--radix-tooltip-content-transform-origin) flex-col gap-1 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-3 py-2 text-left text-[12px] leading-5 whitespace-normal text-[hsl(var(--popover-foreground))] shadow-lg 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=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0 data-[state=instant-open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
35856
35874
|
children: [
|
|
35857
|
-
/* @__PURE__ */
|
|
35858
|
-
entry.text ? /* @__PURE__ */
|
|
35859
|
-
entry.snapshot || entry.previewUrl ? /* @__PURE__ */
|
|
35860
|
-
/* @__PURE__ */
|
|
35875
|
+
/* @__PURE__ */ jsx15("div", { className: "font-medium", children: entry.title }),
|
|
35876
|
+
entry.text ? /* @__PURE__ */ jsx15("div", { className: "line-clamp-4 text-[hsl(var(--muted-foreground))]", children: entry.text }) : null,
|
|
35877
|
+
entry.snapshot || entry.previewUrl ? /* @__PURE__ */ jsx15("div", { className: "text-[10px] text-[hsl(var(--muted-foreground))]/70", children: "\u70B9\u51FB\u67E5\u770B\u539F\u6587" }) : null,
|
|
35878
|
+
/* @__PURE__ */ jsx15(dist_exports2.Arrow, { className: "fill-[hsl(var(--popover))]" })
|
|
35861
35879
|
]
|
|
35862
35880
|
}
|
|
35863
35881
|
) })
|
|
35864
35882
|
] }),
|
|
35865
|
-
entry.snapshot ? /* @__PURE__ */
|
|
35866
|
-
/* @__PURE__ */
|
|
35867
|
-
/* @__PURE__ */
|
|
35868
|
-
/* @__PURE__ */
|
|
35869
|
-
entry.text.length > 2e4 ? /* @__PURE__ */
|
|
35870
|
-
entry.previewUrl ? /* @__PURE__ */
|
|
35883
|
+
entry.snapshot ? /* @__PURE__ */ jsx15(Dialog, { open: snapshotOpen, onOpenChange: setSnapshotOpen, children: /* @__PURE__ */ jsxs11(DialogContent, { "aria-describedby": void 0, className: "max-h-[80vh] overflow-y-auto", children: [
|
|
35884
|
+
/* @__PURE__ */ jsx15(DialogTitle, { children: entry.title }),
|
|
35885
|
+
/* @__PURE__ */ jsx15("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u56DE\u7B54\u65F6\u4FDD\u5B58\u7684\u539F\u6587" }),
|
|
35886
|
+
/* @__PURE__ */ jsx15("div", { className: "whitespace-pre-wrap break-words text-sm", children: entry.text.slice(0, 2e4) }),
|
|
35887
|
+
entry.text.length > 2e4 ? /* @__PURE__ */ jsx15("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u539F\u6587\u8F83\u957F\uFF0C\u6B64\u5904\u663E\u793A\u524D 20000 \u5B57\u7B26\uFF1B\u5B8C\u6574\u5185\u5BB9\u5DF2\u4FDD\u5B58\u5728\u5BF9\u8BDD\u4E2D\u3002" }) : null,
|
|
35888
|
+
entry.previewUrl ? /* @__PURE__ */ jsx15(ExternalAnchor, { href: entry.previewUrl, children: "\u6253\u5F00\u6765\u6E90\u9875\u9762" }) : null
|
|
35871
35889
|
] }) }) : null
|
|
35872
35890
|
] });
|
|
35873
35891
|
}
|
|
@@ -35918,13 +35936,13 @@ function CodeBlockPre({ children, ...props }) {
|
|
|
35918
35936
|
URL.revokeObjectURL(url2);
|
|
35919
35937
|
};
|
|
35920
35938
|
if (!hasCodeNode) {
|
|
35921
|
-
return /* @__PURE__ */
|
|
35939
|
+
return /* @__PURE__ */ jsx15("div", { className: "relative", children: /* @__PURE__ */ jsx15("pre", { ref: preRef, ...props, children }) });
|
|
35922
35940
|
}
|
|
35923
|
-
return /* @__PURE__ */
|
|
35924
|
-
/* @__PURE__ */
|
|
35925
|
-
/* @__PURE__ */
|
|
35926
|
-
/* @__PURE__ */
|
|
35927
|
-
/* @__PURE__ */
|
|
35941
|
+
return /* @__PURE__ */ jsxs11("div", { className: "blade-chat-codeblock not-prose my-3 overflow-hidden rounded-xl border border-[hsl(var(--border))]", children: [
|
|
35942
|
+
/* @__PURE__ */ jsxs11("div", { className: "blade-chat-codeblock-header flex h-[34px] items-center justify-between border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))/0.5] pl-3.5 pr-1.5", children: [
|
|
35943
|
+
/* @__PURE__ */ jsx15("span", { className: "font-mono text-[12px] text-[hsl(var(--muted-foreground))]", children: language || "code" }),
|
|
35944
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-0.5", children: [
|
|
35945
|
+
/* @__PURE__ */ jsxs11(
|
|
35928
35946
|
"button",
|
|
35929
35947
|
{
|
|
35930
35948
|
type: "button",
|
|
@@ -35934,26 +35952,26 @@ function CodeBlockPre({ children, ...props }) {
|
|
|
35934
35952
|
copied ? "text-[hsl(var(--primary))]" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]"
|
|
35935
35953
|
),
|
|
35936
35954
|
children: [
|
|
35937
|
-
copied ? /* @__PURE__ */
|
|
35938
|
-
/* @__PURE__ */
|
|
35955
|
+
copied ? /* @__PURE__ */ jsx15(Check, { size: 12 }) : /* @__PURE__ */ jsx15(Copy, { size: 12 }),
|
|
35956
|
+
/* @__PURE__ */ jsx15("span", { children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236" })
|
|
35939
35957
|
]
|
|
35940
35958
|
}
|
|
35941
35959
|
),
|
|
35942
|
-
/* @__PURE__ */
|
|
35960
|
+
/* @__PURE__ */ jsxs11(
|
|
35943
35961
|
"button",
|
|
35944
35962
|
{
|
|
35945
35963
|
type: "button",
|
|
35946
35964
|
onClick: handleDownload,
|
|
35947
35965
|
className: "flex h-6 items-center gap-1 rounded-md px-1.5 text-[11px] text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
|
|
35948
35966
|
children: [
|
|
35949
|
-
/* @__PURE__ */
|
|
35950
|
-
/* @__PURE__ */
|
|
35967
|
+
/* @__PURE__ */ jsx15(Download, { size: 12 }),
|
|
35968
|
+
/* @__PURE__ */ jsx15("span", { children: "\u4E0B\u8F7D" })
|
|
35951
35969
|
]
|
|
35952
35970
|
}
|
|
35953
35971
|
)
|
|
35954
35972
|
] })
|
|
35955
35973
|
] }),
|
|
35956
|
-
/* @__PURE__ */
|
|
35974
|
+
/* @__PURE__ */ jsx15(
|
|
35957
35975
|
"pre",
|
|
35958
35976
|
{
|
|
35959
35977
|
ref: preRef,
|
|
@@ -36096,7 +36114,7 @@ function MarkdownContent({
|
|
|
36096
36114
|
pre: CodeBlockPre,
|
|
36097
36115
|
a: ExternalAnchor,
|
|
36098
36116
|
...components ?? {},
|
|
36099
|
-
img: (imageProps) => /* @__PURE__ */
|
|
36117
|
+
img: (imageProps) => /* @__PURE__ */ jsx15(
|
|
36100
36118
|
"img",
|
|
36101
36119
|
{
|
|
36102
36120
|
...imageProps,
|
|
@@ -36106,11 +36124,11 @@ function MarkdownContent({
|
|
|
36106
36124
|
),
|
|
36107
36125
|
...HIDDEN_SYSTEM_REMINDER_COMPONENTS,
|
|
36108
36126
|
[TOOL_CALL_TAG]: InlineToolCallBlock,
|
|
36109
|
-
[CITATION_TAG]: (props2) => /* @__PURE__ */
|
|
36127
|
+
[CITATION_TAG]: (props2) => /* @__PURE__ */ jsx15(CitationRefBlock, { ...props2, citations })
|
|
36110
36128
|
}),
|
|
36111
36129
|
[baseFilePath, buildAuthedUrl, citations, components, environment.MarkdownCode, sessionId]
|
|
36112
36130
|
);
|
|
36113
|
-
return /* @__PURE__ */
|
|
36131
|
+
return /* @__PURE__ */ jsx15(
|
|
36114
36132
|
MarkdownRenderer,
|
|
36115
36133
|
{
|
|
36116
36134
|
...props,
|
|
@@ -36126,7 +36144,7 @@ function MarkdownContent({
|
|
|
36126
36144
|
}
|
|
36127
36145
|
|
|
36128
36146
|
// src/chat/ai-elements/reasoning.tsx
|
|
36129
|
-
import { Fragment as Fragment7, jsx as
|
|
36147
|
+
import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
36130
36148
|
var ReasoningContext = createContext5(null);
|
|
36131
36149
|
var useReasoning = () => {
|
|
36132
36150
|
const context = useContext5(ReasoningContext);
|
|
@@ -36177,7 +36195,7 @@ var Reasoning = memo4(
|
|
|
36177
36195
|
() => ({ duration: duration3, isOpen, isStreaming, setIsOpen }),
|
|
36178
36196
|
[duration3, isOpen, isStreaming, setIsOpen]
|
|
36179
36197
|
);
|
|
36180
|
-
return /* @__PURE__ */
|
|
36198
|
+
return /* @__PURE__ */ jsx16(ReasoningContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx16(
|
|
36181
36199
|
Collapsible,
|
|
36182
36200
|
{
|
|
36183
36201
|
className: cn("not-prose", className),
|
|
@@ -36203,7 +36221,7 @@ var ReasoningTrigger = memo4(
|
|
|
36203
36221
|
const { isStreaming, isOpen, duration: duration3 } = useReasoning();
|
|
36204
36222
|
const status = isStreaming || duration3 === 0 ? "\u6B63\u5728\u601D\u8003" : "\u5DF2\u601D\u8003";
|
|
36205
36223
|
const detail = `${formatWordCount(wordCount)} \u5B57`;
|
|
36206
|
-
return /* @__PURE__ */
|
|
36224
|
+
return /* @__PURE__ */ jsx16(
|
|
36207
36225
|
CollapsibleTrigger,
|
|
36208
36226
|
{
|
|
36209
36227
|
className: cn(
|
|
@@ -36211,16 +36229,16 @@ var ReasoningTrigger = memo4(
|
|
|
36211
36229
|
className
|
|
36212
36230
|
),
|
|
36213
36231
|
...props,
|
|
36214
|
-
children: children ?? /* @__PURE__ */
|
|
36215
|
-
/* @__PURE__ */
|
|
36216
|
-
/* @__PURE__ */
|
|
36217
|
-
isStreaming || duration3 === 0 ? /* @__PURE__ */
|
|
36218
|
-
/* @__PURE__ */
|
|
36232
|
+
children: children ?? /* @__PURE__ */ jsxs12(Fragment7, { children: [
|
|
36233
|
+
/* @__PURE__ */ jsx16(Brain, { className: "size-4" }),
|
|
36234
|
+
/* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
36235
|
+
isStreaming || duration3 === 0 ? /* @__PURE__ */ jsx16(Shimmer, { duration: 1, children: status }) : /* @__PURE__ */ jsx16("span", { children: status }),
|
|
36236
|
+
/* @__PURE__ */ jsxs12("span", { className: "whitespace-nowrap tabular-nums text-[hsl(var(--muted-foreground))]/70", children: [
|
|
36219
36237
|
"\xB7 ",
|
|
36220
36238
|
detail
|
|
36221
36239
|
] })
|
|
36222
36240
|
] }),
|
|
36223
|
-
/* @__PURE__ */
|
|
36241
|
+
/* @__PURE__ */ jsx16(
|
|
36224
36242
|
ChevronDown,
|
|
36225
36243
|
{
|
|
36226
36244
|
className: cn(
|
|
@@ -36236,11 +36254,11 @@ var ReasoningTrigger = memo4(
|
|
|
36236
36254
|
);
|
|
36237
36255
|
function ReasoningMarkdown({ children }) {
|
|
36238
36256
|
const Injected = useChatEnvironment().ReasoningMarkdown;
|
|
36239
|
-
if (Injected) return /* @__PURE__ */
|
|
36240
|
-
return /* @__PURE__ */
|
|
36257
|
+
if (Injected) return /* @__PURE__ */ jsx16(Injected, { children });
|
|
36258
|
+
return /* @__PURE__ */ jsx16(MarkdownContent, { children });
|
|
36241
36259
|
}
|
|
36242
36260
|
var ReasoningContent = memo4(
|
|
36243
|
-
({ className, children, ...props }) => /* @__PURE__ */
|
|
36261
|
+
({ className, children, ...props }) => /* @__PURE__ */ jsx16(
|
|
36244
36262
|
CollapsibleContent,
|
|
36245
36263
|
{
|
|
36246
36264
|
className: cn(
|
|
@@ -36249,7 +36267,7 @@ var ReasoningContent = memo4(
|
|
|
36249
36267
|
className
|
|
36250
36268
|
),
|
|
36251
36269
|
...props,
|
|
36252
|
-
children: /* @__PURE__ */
|
|
36270
|
+
children: /* @__PURE__ */ jsx16(ReasoningMarkdown, { children })
|
|
36253
36271
|
}
|
|
36254
36272
|
)
|
|
36255
36273
|
);
|
|
@@ -36259,7 +36277,7 @@ function compactReasoningText(text4) {
|
|
|
36259
36277
|
function ThinkingBadge({ reasoning, variant = "inline", onClick }) {
|
|
36260
36278
|
const compactReasoning = compactReasoningText(reasoning);
|
|
36261
36279
|
const [open2, setOpen] = useState10(false);
|
|
36262
|
-
return /* @__PURE__ */
|
|
36280
|
+
return /* @__PURE__ */ jsxs12(
|
|
36263
36281
|
"span",
|
|
36264
36282
|
{
|
|
36265
36283
|
className: cn(
|
|
@@ -36267,7 +36285,7 @@ function ThinkingBadge({ reasoning, variant = "inline", onClick }) {
|
|
|
36267
36285
|
variant === "inline" ? "ml-1" : "ml-1 shrink-0"
|
|
36268
36286
|
),
|
|
36269
36287
|
children: [
|
|
36270
|
-
/* @__PURE__ */
|
|
36288
|
+
/* @__PURE__ */ jsx16(
|
|
36271
36289
|
"button",
|
|
36272
36290
|
{
|
|
36273
36291
|
type: "button",
|
|
@@ -36281,24 +36299,24 @@ function ThinkingBadge({ reasoning, variant = "inline", onClick }) {
|
|
|
36281
36299
|
children: "\u601D\u8003\u8BE6\u60C5"
|
|
36282
36300
|
}
|
|
36283
36301
|
),
|
|
36284
|
-
/* @__PURE__ */
|
|
36302
|
+
/* @__PURE__ */ jsx16(Dialog, { open: open2, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs12(
|
|
36285
36303
|
DialogContent,
|
|
36286
36304
|
{
|
|
36287
36305
|
showCloseButton: false,
|
|
36288
36306
|
className: "m-0 flex max-h-[min(520px,calc(100vh-48px))] w-[min(760px,calc(100vw-48px))] flex-col gap-0 overflow-hidden p-0 text-left text-[13px] leading-6",
|
|
36289
36307
|
children: [
|
|
36290
|
-
/* @__PURE__ */
|
|
36291
|
-
/* @__PURE__ */
|
|
36292
|
-
/* @__PURE__ */
|
|
36308
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-3 border-b border-[hsl(var(--border))] px-4 py-2", children: [
|
|
36309
|
+
/* @__PURE__ */ jsx16(DialogTitle, { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u601D\u8003\u8BE6\u60C5" }),
|
|
36310
|
+
/* @__PURE__ */ jsx16(
|
|
36293
36311
|
DialogClose,
|
|
36294
36312
|
{
|
|
36295
36313
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
36296
36314
|
"aria-label": "\u5173\u95ED\u601D\u8003\u8BE6\u60C5",
|
|
36297
|
-
children: /* @__PURE__ */
|
|
36315
|
+
children: /* @__PURE__ */ jsx16(X, { size: 14, "aria-hidden": "true" })
|
|
36298
36316
|
}
|
|
36299
36317
|
)
|
|
36300
36318
|
] }),
|
|
36301
|
-
/* @__PURE__ */
|
|
36319
|
+
/* @__PURE__ */ jsx16("div", { className: "overflow-auto px-4 py-3 whitespace-normal [&_*]:whitespace-normal [&_p]:my-1.5 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_ul]:my-1.5 [&_ol]:my-1.5", children: /* @__PURE__ */ jsx16(ReasoningMarkdown, { children: compactReasoning }) })
|
|
36302
36320
|
]
|
|
36303
36321
|
}
|
|
36304
36322
|
) })
|
|
@@ -36316,7 +36334,7 @@ var CardContext = createContext6({});
|
|
|
36316
36334
|
|
|
36317
36335
|
// src/chat/FileDeliveryCards.tsx
|
|
36318
36336
|
import { useMemo as useMemo6, useState as useState11 } from "react";
|
|
36319
|
-
import { Fragment as Fragment8, jsx as
|
|
36337
|
+
import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
36320
36338
|
var AGENT_WORKSPACE_DIR_NAME = "\u667A\u80FD\u52A9\u624B\u5DE5\u4F5C\u7A7A\u95F4";
|
|
36321
36339
|
var EXT_LABELS = {
|
|
36322
36340
|
py: "Python",
|
|
@@ -36420,13 +36438,13 @@ function DeliveryCard({
|
|
|
36420
36438
|
setDownloading(false);
|
|
36421
36439
|
}
|
|
36422
36440
|
};
|
|
36423
|
-
return /* @__PURE__ */
|
|
36441
|
+
return /* @__PURE__ */ jsxs13(
|
|
36424
36442
|
"div",
|
|
36425
36443
|
{
|
|
36426
36444
|
"data-artifact-kind": isVideoFile(name) ? "video" : "file",
|
|
36427
36445
|
className: compact ? "file-delivery-card group/delivery relative flex w-full max-w-full items-stretch self-start overflow-hidden rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--card))] shadow-sm transition-colors hover:bg-[hsl(var(--accent)/0.45)] focus-within:ring-1 focus-within:ring-[hsl(var(--ring))]" : "file-delivery-card group/delivery relative flex w-[320px] max-w-full items-center self-start rounded-[14px] border border-[hsl(var(--border))] bg-[hsl(var(--card))] transition-colors duration-150 hover:border-[hsl(var(--primary)/0.3)] hover:bg-[hsl(var(--muted)/0.6)] focus-within:ring-1 focus-within:ring-[hsl(var(--ring))]",
|
|
36428
36446
|
children: [
|
|
36429
|
-
/* @__PURE__ */
|
|
36447
|
+
/* @__PURE__ */ jsxs13(
|
|
36430
36448
|
"button",
|
|
36431
36449
|
{
|
|
36432
36450
|
type: "button",
|
|
@@ -36437,19 +36455,19 @@ function DeliveryCard({
|
|
|
36437
36455
|
title: displayName ? `${displayName}
|
|
36438
36456
|
${name}` : name,
|
|
36439
36457
|
children: [
|
|
36440
|
-
/* @__PURE__ */
|
|
36441
|
-
/* @__PURE__ */
|
|
36442
|
-
/* @__PURE__ */
|
|
36443
|
-
!compact ? /* @__PURE__ */
|
|
36444
|
-
/* @__PURE__ */
|
|
36445
|
-
/* @__PURE__ */
|
|
36446
|
-
/* @__PURE__ */
|
|
36458
|
+
/* @__PURE__ */ jsx17("span", { className: compact ? "flex h-5 w-5 shrink-0 items-center justify-center text-[hsl(var(--primary))]" : "flex h-[42px] w-[42px] shrink-0 items-center justify-center rounded-[11px] bg-gradient-to-br from-[hsl(var(--primary))/0.1] to-[hsl(var(--primary))/0.2] text-[hsl(var(--primary))]", children: opening ? /* @__PURE__ */ jsx17(LoaderCircle, { size: compact ? 15 : 22, className: "animate-spin", "aria-hidden": "true" }) : isVideoFile(name) ? /* @__PURE__ */ jsx17(Film, { size: compact ? 15 : 22, "aria-hidden": "true" }) : /* @__PURE__ */ jsx17(FileGlyph, {}) }),
|
|
36459
|
+
/* @__PURE__ */ jsxs13("span", { className: compact ? "min-w-0" : "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
36460
|
+
/* @__PURE__ */ jsx17("span", { className: compact ? "block truncate text-xs font-medium leading-5" : "truncate text-[15px] font-semibold text-[hsl(var(--foreground))]", children: displayName || name }),
|
|
36461
|
+
!compact ? /* @__PURE__ */ jsx17("span", { className: "flex items-center gap-1.5 truncate text-[12.5px] text-[hsl(var(--muted-foreground))]", children: description ? /* @__PURE__ */ jsx17("span", { className: "truncate", children: description }) : /* @__PURE__ */ jsxs13(Fragment8, { children: [
|
|
36462
|
+
/* @__PURE__ */ jsx17("span", { className: "font-mono", children: getExtLabel(name) }),
|
|
36463
|
+
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: "\xB7" }),
|
|
36464
|
+
/* @__PURE__ */ jsx17("span", { className: "text-[hsl(var(--primary))]", children: "AI \u751F\u6210" })
|
|
36447
36465
|
] }) }) : null
|
|
36448
36466
|
] })
|
|
36449
36467
|
]
|
|
36450
36468
|
}
|
|
36451
36469
|
),
|
|
36452
|
-
/* @__PURE__ */
|
|
36470
|
+
/* @__PURE__ */ jsx17(
|
|
36453
36471
|
"button",
|
|
36454
36472
|
{
|
|
36455
36473
|
type: "button",
|
|
@@ -36461,7 +36479,7 @@ ${name}` : name,
|
|
|
36461
36479
|
className: compact ? "absolute inset-y-0 right-0 flex w-7 items-center justify-center bg-transparent text-[hsl(var(--muted-foreground))] opacity-0 [@media(hover:none)]:opacity-100 transition-[opacity,color] hover:text-[hsl(var(--foreground))] focus:opacity-100 focus:outline-none group-hover/delivery:opacity-100 group-focus-within/delivery:opacity-100" : "absolute right-3 top-1/2 grid h-8 w-8 -translate-y-1/2 place-items-center rounded-lg text-[hsl(var(--muted-foreground))] opacity-0 [@media(hover:none)]:opacity-100 transition-opacity hover:bg-[hsl(var(--background))] hover:text-[hsl(var(--foreground))] focus:opacity-100 focus:outline-none group-hover/delivery:opacity-100",
|
|
36462
36480
|
title: "\u4E0B\u8F7D\u6587\u4EF6",
|
|
36463
36481
|
"aria-label": `\u4E0B\u8F7D\u6587\u4EF6\uFF1A${displayName || name}`,
|
|
36464
|
-
children: downloading ? /* @__PURE__ */
|
|
36482
|
+
children: downloading ? /* @__PURE__ */ jsx17(LoaderCircle, { size: compact ? 13 : 16, className: "animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx17(Download, { size: compact ? 13 : 16, "aria-hidden": "true" })
|
|
36465
36483
|
}
|
|
36466
36484
|
)
|
|
36467
36485
|
]
|
|
@@ -36469,7 +36487,7 @@ ${name}` : name,
|
|
|
36469
36487
|
);
|
|
36470
36488
|
}
|
|
36471
36489
|
function FileGlyph() {
|
|
36472
|
-
return /* @__PURE__ */
|
|
36490
|
+
return /* @__PURE__ */ jsxs13(
|
|
36473
36491
|
"svg",
|
|
36474
36492
|
{
|
|
36475
36493
|
width: "21",
|
|
@@ -36482,10 +36500,10 @@ function FileGlyph() {
|
|
|
36482
36500
|
strokeLinejoin: "round",
|
|
36483
36501
|
"aria-hidden": "true",
|
|
36484
36502
|
children: [
|
|
36485
|
-
/* @__PURE__ */
|
|
36486
|
-
/* @__PURE__ */
|
|
36487
|
-
/* @__PURE__ */
|
|
36488
|
-
/* @__PURE__ */
|
|
36503
|
+
/* @__PURE__ */ jsx17("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z" }),
|
|
36504
|
+
/* @__PURE__ */ jsx17("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
36505
|
+
/* @__PURE__ */ jsx17("path", { d: "m10 13-2 2 2 2" }),
|
|
36506
|
+
/* @__PURE__ */ jsx17("path", { d: "m14 17 2-2-2-2" })
|
|
36489
36507
|
]
|
|
36490
36508
|
}
|
|
36491
36509
|
);
|
|
@@ -36496,12 +36514,12 @@ function FileDeliveryCards({
|
|
|
36496
36514
|
}) {
|
|
36497
36515
|
const files = useMemo6(() => collectDeliveredFiles(toolCalls, sessionId), [toolCalls, sessionId]);
|
|
36498
36516
|
if (files.length === 0) return null;
|
|
36499
|
-
return /* @__PURE__ */
|
|
36517
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-2", children: files.map((file2) => /* @__PURE__ */ jsx17(DeliveryCard, { path: file2.relPath, name: file2.name, sessionId }, file2.relPath)) });
|
|
36500
36518
|
}
|
|
36501
36519
|
|
|
36502
36520
|
// src/chat/MessageActions.tsx
|
|
36503
36521
|
import { useState as useState12 } from "react";
|
|
36504
|
-
import { jsx as
|
|
36522
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
36505
36523
|
function MessageActions({ content: content3, className }) {
|
|
36506
36524
|
const [copied, setCopied] = useState12(false);
|
|
36507
36525
|
const handleCopy = async () => {
|
|
@@ -36511,7 +36529,7 @@ function MessageActions({ content: content3, className }) {
|
|
|
36511
36529
|
setTimeout(() => setCopied(false), 2e3);
|
|
36512
36530
|
}
|
|
36513
36531
|
};
|
|
36514
|
-
return /* @__PURE__ */
|
|
36532
|
+
return /* @__PURE__ */ jsx18("div", { className: cn("flex items-center gap-1 mt-1.5", className), children: /* @__PURE__ */ jsxs14(
|
|
36515
36533
|
"button",
|
|
36516
36534
|
{
|
|
36517
36535
|
type: "button",
|
|
@@ -36521,15 +36539,15 @@ function MessageActions({ content: content3, className }) {
|
|
|
36521
36539
|
copied ? "text-[hsl(var(--primary))]" : "text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))]"
|
|
36522
36540
|
),
|
|
36523
36541
|
children: [
|
|
36524
|
-
copied ? /* @__PURE__ */
|
|
36525
|
-
/* @__PURE__ */
|
|
36542
|
+
copied ? /* @__PURE__ */ jsx18(Check, { size: 12 }) : /* @__PURE__ */ jsx18(Copy, { size: 12 }),
|
|
36543
|
+
/* @__PURE__ */ jsx18("span", { children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236" })
|
|
36526
36544
|
]
|
|
36527
36545
|
}
|
|
36528
36546
|
) });
|
|
36529
36547
|
}
|
|
36530
36548
|
|
|
36531
36549
|
// src/chat/MessageFileAttachmentList.tsx
|
|
36532
|
-
import { Fragment as Fragment9, jsx as
|
|
36550
|
+
import { Fragment as Fragment9, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
36533
36551
|
function getFileIcon(fileName) {
|
|
36534
36552
|
const lowerName = fileName.toLowerCase();
|
|
36535
36553
|
if (/\.(zip|rar|7z|tar|gz|bz2|xz)$/.test(lowerName)) {
|
|
@@ -36558,15 +36576,15 @@ function MessageFileAttachmentList({
|
|
|
36558
36576
|
return null;
|
|
36559
36577
|
}
|
|
36560
36578
|
const pillClass = "blade-chat-file-card flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2.5 py-1 text-[11px] text-[hsl(var(--foreground))]";
|
|
36561
|
-
return /* @__PURE__ */
|
|
36579
|
+
return /* @__PURE__ */ jsx19("div", { className: cn("flex flex-wrap gap-1.5", className), children: files.map((file2) => {
|
|
36562
36580
|
const Icon = getFileIcon(file2.name);
|
|
36563
36581
|
const key = `${file2.name}-${file2.data.slice(0, 32)}`;
|
|
36564
|
-
const content3 = /* @__PURE__ */
|
|
36565
|
-
/* @__PURE__ */
|
|
36566
|
-
/* @__PURE__ */
|
|
36582
|
+
const content3 = /* @__PURE__ */ jsxs15(Fragment9, { children: [
|
|
36583
|
+
/* @__PURE__ */ jsx19(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
|
|
36584
|
+
/* @__PURE__ */ jsx19("span", { className: "max-w-32 truncate", children: file2.name })
|
|
36567
36585
|
] });
|
|
36568
36586
|
if (onPreview) {
|
|
36569
|
-
return /* @__PURE__ */
|
|
36587
|
+
return /* @__PURE__ */ jsx19(
|
|
36570
36588
|
"button",
|
|
36571
36589
|
{
|
|
36572
36590
|
type: "button",
|
|
@@ -36579,23 +36597,23 @@ function MessageFileAttachmentList({
|
|
|
36579
36597
|
key
|
|
36580
36598
|
);
|
|
36581
36599
|
}
|
|
36582
|
-
return /* @__PURE__ */
|
|
36600
|
+
return /* @__PURE__ */ jsx19("div", { part: "file-card", className: pillClass, title: file2.name, children: content3 }, key);
|
|
36583
36601
|
}) });
|
|
36584
36602
|
}
|
|
36585
36603
|
|
|
36586
36604
|
// src/components/ToolUiCardView.tsx
|
|
36587
36605
|
import { resolveToolUiCardContent } from "@blade-hq/agent-client/internal";
|
|
36588
36606
|
import { useEffect as useEffect9, useState as useState13 } from "react";
|
|
36589
|
-
import { jsx as
|
|
36607
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
36590
36608
|
function ToolUiCardView({ card, sessionId }) {
|
|
36591
|
-
if (card.mcpApp) return sessionId ? /* @__PURE__ */
|
|
36609
|
+
if (card.mcpApp) return sessionId ? /* @__PURE__ */ jsx20(McpAppCard, { sessionId, sourceId: card.mcpApp.sourceId }) : null;
|
|
36592
36610
|
const resolved = resolveToolUiCardContent(card);
|
|
36593
36611
|
if (!resolved) return null;
|
|
36594
36612
|
if (resolved.type === "resource-file") {
|
|
36595
|
-
return sessionId ? /* @__PURE__ */
|
|
36613
|
+
return sessionId ? /* @__PURE__ */ jsx20(FileCard, { card, sessionId, path: resolved.content }, `${sessionId}:${resolved.content}`) : null;
|
|
36596
36614
|
}
|
|
36597
36615
|
const sandbox = resolved.type === "resource-uri" ? "allow-scripts allow-same-origin" : "allow-scripts";
|
|
36598
|
-
return /* @__PURE__ */
|
|
36616
|
+
return /* @__PURE__ */ jsx20(
|
|
36599
36617
|
"iframe",
|
|
36600
36618
|
{
|
|
36601
36619
|
title: card.title ?? "\u5DE5\u5177\u754C\u9762",
|
|
@@ -36634,8 +36652,8 @@ function FileCard({ card, sessionId, path: path2 }) {
|
|
|
36634
36652
|
`api/sessions/${encodeURIComponent(sessionId)}/serve/${filePath}`,
|
|
36635
36653
|
`${client.options.baseUrl.replace(/\/$/, "")}/`
|
|
36636
36654
|
).href;
|
|
36637
|
-
return /* @__PURE__ */
|
|
36638
|
-
/* @__PURE__ */
|
|
36655
|
+
return /* @__PURE__ */ jsxs16("div", { children: [
|
|
36656
|
+
/* @__PURE__ */ jsx20("div", { className: "flex justify-end py-2", children: /* @__PURE__ */ jsx20(
|
|
36639
36657
|
"button",
|
|
36640
36658
|
{
|
|
36641
36659
|
type: "button",
|
|
@@ -36645,7 +36663,7 @@ function FileCard({ card, sessionId, path: path2 }) {
|
|
|
36645
36663
|
children: "\u5237\u65B0"
|
|
36646
36664
|
}
|
|
36647
36665
|
) }),
|
|
36648
|
-
failed ? /* @__PURE__ */
|
|
36666
|
+
failed ? /* @__PURE__ */ jsx20("p", { role: "alert", children: "\u65E0\u6CD5\u6253\u5F00\u6587\u4EF6\uFF0C\u6587\u4EF6\u53EF\u80FD\u5DF2\u79FB\u52A8\u6216\u5220\u9664\u3002" }) : html === null ? /* @__PURE__ */ jsx20("p", { children: "\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026" }) : /* @__PURE__ */ jsx20(
|
|
36649
36667
|
"iframe",
|
|
36650
36668
|
{
|
|
36651
36669
|
title: card.title ?? "\u6587\u4EF6\u9884\u89C8",
|
|
@@ -36675,11 +36693,11 @@ ${html}`;
|
|
|
36675
36693
|
}
|
|
36676
36694
|
|
|
36677
36695
|
// src/chat/ToolUiCard.tsx
|
|
36678
|
-
import { jsx as
|
|
36696
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
36679
36697
|
function ToolUiCard({ card, sessionId }) {
|
|
36680
36698
|
const Injected = useChatEnvironment().ToolUiCard;
|
|
36681
|
-
if (Injected) return /* @__PURE__ */
|
|
36682
|
-
return /* @__PURE__ */
|
|
36699
|
+
if (Injected) return /* @__PURE__ */ jsx21(Injected, { card, sessionId });
|
|
36700
|
+
return /* @__PURE__ */ jsx21(ToolUiCardView, { card, sessionId });
|
|
36683
36701
|
}
|
|
36684
36702
|
|
|
36685
36703
|
// src/chat/ToolCallBlock.tsx
|
|
@@ -36691,7 +36709,7 @@ import {
|
|
|
36691
36709
|
|
|
36692
36710
|
// src/chat/AskUserQuestionBlock.tsx
|
|
36693
36711
|
import { useEffect as useEffect10, useMemo as useMemo7, useRef as useRef12, useState as useState14 } from "react";
|
|
36694
|
-
import { jsx as
|
|
36712
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
36695
36713
|
var CUSTOM_TEXTAREA_MAX_HEIGHT = 160;
|
|
36696
36714
|
function resizeCustomTextarea(textarea) {
|
|
36697
36715
|
textarea.style.height = "auto";
|
|
@@ -36841,7 +36859,7 @@ ${parts.join("\n")}`,
|
|
|
36841
36859
|
setSubmitted(true);
|
|
36842
36860
|
onAnswer(text4, toolCallId, nextAnswerData);
|
|
36843
36861
|
};
|
|
36844
|
-
return /* @__PURE__ */
|
|
36862
|
+
return /* @__PURE__ */ jsxs17(
|
|
36845
36863
|
"div",
|
|
36846
36864
|
{
|
|
36847
36865
|
part: "ask-card",
|
|
@@ -36850,12 +36868,12 @@ ${parts.join("\n")}`,
|
|
|
36850
36868
|
answered ? "max-w-2xl space-y-3 p-3 text-xs text-[hsl(var(--muted-foreground))] opacity-80" : "max-w-lg space-y-5 p-4 text-sm"
|
|
36851
36869
|
),
|
|
36852
36870
|
children: [
|
|
36853
|
-
data.source_loop?.description && /* @__PURE__ */
|
|
36871
|
+
data.source_loop?.description && /* @__PURE__ */ jsxs17("div", { className: "rounded-lg bg-[hsl(var(--muted)/0.35)] px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
36854
36872
|
"\u5B50\u667A\u80FD\u4F53\u300C",
|
|
36855
36873
|
data.source_loop.description,
|
|
36856
36874
|
"\u300D\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54"
|
|
36857
36875
|
] }),
|
|
36858
|
-
data.questions.map((q2, qIdx) => /* @__PURE__ */
|
|
36876
|
+
data.questions.map((q2, qIdx) => /* @__PURE__ */ jsx22(
|
|
36859
36877
|
QuestionCard,
|
|
36860
36878
|
{
|
|
36861
36879
|
question: q2,
|
|
@@ -36870,7 +36888,7 @@ ${parts.join("\n")}`,
|
|
|
36870
36888
|
},
|
|
36871
36889
|
q2.question
|
|
36872
36890
|
)),
|
|
36873
|
-
/* @__PURE__ */
|
|
36891
|
+
/* @__PURE__ */ jsx22(
|
|
36874
36892
|
NoteField,
|
|
36875
36893
|
{
|
|
36876
36894
|
answered,
|
|
@@ -36879,7 +36897,7 @@ ${parts.join("\n")}`,
|
|
|
36879
36897
|
onChange: setNote
|
|
36880
36898
|
}
|
|
36881
36899
|
),
|
|
36882
|
-
!answered && !submitted && onAnswer && /* @__PURE__ */
|
|
36900
|
+
!answered && !submitted && onAnswer && /* @__PURE__ */ jsx22(
|
|
36883
36901
|
"button",
|
|
36884
36902
|
{
|
|
36885
36903
|
type: "button",
|
|
@@ -36889,14 +36907,14 @@ ${parts.join("\n")}`,
|
|
|
36889
36907
|
children: allAnswered ? "\u786E\u8BA4" : "\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u9009\u9879"
|
|
36890
36908
|
}
|
|
36891
36909
|
),
|
|
36892
|
-
submitted && !answered && /* @__PURE__ */
|
|
36910
|
+
submitted && !answered && /* @__PURE__ */ jsxs17(
|
|
36893
36911
|
"button",
|
|
36894
36912
|
{
|
|
36895
36913
|
type: "button",
|
|
36896
36914
|
disabled: true,
|
|
36897
36915
|
className: "flex w-full items-center justify-center gap-2 rounded-lg bg-[hsl(var(--primary))] px-4 py-2 text-xs font-semibold text-[hsl(var(--primary-foreground))] opacity-80",
|
|
36898
36916
|
children: [
|
|
36899
|
-
/* @__PURE__ */
|
|
36917
|
+
/* @__PURE__ */ jsx22(LoaderCircle, { size: 14, className: "animate-spin" }),
|
|
36900
36918
|
"\u786E\u8BA4\u4E2D"
|
|
36901
36919
|
]
|
|
36902
36920
|
}
|
|
@@ -36918,23 +36936,23 @@ function QuestionCard({
|
|
|
36918
36936
|
}) {
|
|
36919
36937
|
const multi = question.multiSelect ?? false;
|
|
36920
36938
|
const customTextareaRef = useAutoResizeTextarea(customText);
|
|
36921
|
-
return /* @__PURE__ */
|
|
36922
|
-
/* @__PURE__ */
|
|
36923
|
-
/* @__PURE__ */
|
|
36939
|
+
return /* @__PURE__ */ jsxs17("div", { children: [
|
|
36940
|
+
/* @__PURE__ */ jsxs17("div", { className: cn("flex items-start gap-2", answered ? "mb-2" : "mb-3"), children: [
|
|
36941
|
+
/* @__PURE__ */ jsx22(
|
|
36924
36942
|
MessageSquareMore,
|
|
36925
36943
|
{
|
|
36926
36944
|
size: answered ? 12 : 13,
|
|
36927
36945
|
className: "mt-0.5 shrink-0 text-[hsl(var(--primary))]"
|
|
36928
36946
|
}
|
|
36929
36947
|
),
|
|
36930
|
-
/* @__PURE__ */
|
|
36948
|
+
/* @__PURE__ */ jsx22(
|
|
36931
36949
|
"div",
|
|
36932
36950
|
{
|
|
36933
36951
|
className: cn(
|
|
36934
36952
|
"min-w-0 flex-1 font-medium text-[hsl(var(--foreground))]",
|
|
36935
36953
|
answered ? "text-xs" : "text-sm"
|
|
36936
36954
|
),
|
|
36937
|
-
children: /* @__PURE__ */
|
|
36955
|
+
children: /* @__PURE__ */ jsx22(
|
|
36938
36956
|
MarkdownContent,
|
|
36939
36957
|
{
|
|
36940
36958
|
className: cn(
|
|
@@ -36948,10 +36966,10 @@ function QuestionCard({
|
|
|
36948
36966
|
}
|
|
36949
36967
|
)
|
|
36950
36968
|
] }),
|
|
36951
|
-
/* @__PURE__ */
|
|
36969
|
+
/* @__PURE__ */ jsxs17("div", { className: cn("flex flex-col pl-5", answered ? "gap-1" : "gap-1.5"), children: [
|
|
36952
36970
|
question.options.map((opt, optIdx) => {
|
|
36953
36971
|
const isSel = selected.has(optIdx);
|
|
36954
|
-
return /* @__PURE__ */
|
|
36972
|
+
return /* @__PURE__ */ jsxs17(
|
|
36955
36973
|
"button",
|
|
36956
36974
|
{
|
|
36957
36975
|
type: "button",
|
|
@@ -36967,14 +36985,14 @@ function QuestionCard({
|
|
|
36967
36985
|
answered && !isSel && "text-[hsl(var(--muted-foreground))]"
|
|
36968
36986
|
),
|
|
36969
36987
|
children: [
|
|
36970
|
-
multi && /* @__PURE__ */
|
|
36988
|
+
multi && /* @__PURE__ */ jsx22(
|
|
36971
36989
|
"div",
|
|
36972
36990
|
{
|
|
36973
36991
|
className: cn(
|
|
36974
36992
|
"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",
|
|
36975
36993
|
isSel && !answered ? "border-[hsl(var(--primary-foreground)/0.6)] bg-[hsl(var(--primary-foreground)/0.2)]" : isSel ? "border-[hsl(var(--primary)/0.45)] bg-[hsl(var(--primary)/0.12)]" : "border-[hsl(var(--border))]"
|
|
36976
36994
|
),
|
|
36977
|
-
children: isSel && /* @__PURE__ */
|
|
36995
|
+
children: isSel && /* @__PURE__ */ jsx22(
|
|
36978
36996
|
Check,
|
|
36979
36997
|
{
|
|
36980
36998
|
size: 10,
|
|
@@ -36983,9 +37001,9 @@ function QuestionCard({
|
|
|
36983
37001
|
)
|
|
36984
37002
|
}
|
|
36985
37003
|
),
|
|
36986
|
-
/* @__PURE__ */
|
|
36987
|
-
/* @__PURE__ */
|
|
36988
|
-
opt.description && /* @__PURE__ */
|
|
37004
|
+
/* @__PURE__ */ jsxs17("div", { className: "min-w-0", children: [
|
|
37005
|
+
/* @__PURE__ */ jsx22("div", { className: cn("font-medium", answered ? "text-xs" : "text-[13px]"), children: opt.label }),
|
|
37006
|
+
opt.description && /* @__PURE__ */ jsx22(
|
|
36989
37007
|
"div",
|
|
36990
37008
|
{
|
|
36991
37009
|
className: cn(
|
|
@@ -37002,7 +37020,7 @@ function QuestionCard({
|
|
|
37002
37020
|
opt.label
|
|
37003
37021
|
);
|
|
37004
37022
|
}),
|
|
37005
|
-
answered && !isCustom ? null : /* @__PURE__ */
|
|
37023
|
+
answered && !isCustom ? null : /* @__PURE__ */ jsxs17(
|
|
37006
37024
|
"div",
|
|
37007
37025
|
{
|
|
37008
37026
|
className: cn(
|
|
@@ -37012,8 +37030,8 @@ function QuestionCard({
|
|
|
37012
37030
|
answered && "cursor-default"
|
|
37013
37031
|
),
|
|
37014
37032
|
children: [
|
|
37015
|
-
/* @__PURE__ */
|
|
37016
|
-
/* @__PURE__ */
|
|
37033
|
+
/* @__PURE__ */ jsx22("span", { className: "shrink-0 pt-1 text-xs text-[hsl(var(--muted-foreground))]", children: "\u5176\u4ED6\uFF1A" }),
|
|
37034
|
+
/* @__PURE__ */ jsx22(
|
|
37017
37035
|
"textarea",
|
|
37018
37036
|
{
|
|
37019
37037
|
ref: customTextareaRef,
|
|
@@ -37045,7 +37063,7 @@ function NoteField({
|
|
|
37045
37063
|
const textareaRef = useAutoResizeTextarea(note);
|
|
37046
37064
|
const readOnly = answered || submitted;
|
|
37047
37065
|
if (answered && !note.trim()) return null;
|
|
37048
|
-
return /* @__PURE__ */
|
|
37066
|
+
return /* @__PURE__ */ jsxs17(
|
|
37049
37067
|
"label",
|
|
37050
37068
|
{
|
|
37051
37069
|
className: cn(
|
|
@@ -37055,8 +37073,8 @@ function NoteField({
|
|
|
37055
37073
|
readOnly && "cursor-default"
|
|
37056
37074
|
),
|
|
37057
37075
|
children: [
|
|
37058
|
-
/* @__PURE__ */
|
|
37059
|
-
/* @__PURE__ */
|
|
37076
|
+
/* @__PURE__ */ jsx22("span", { className: "mb-1.5 block text-xs text-[hsl(var(--muted-foreground))]", children: "\u8865\u5145\u8BF4\u660E\uFF08\u53EF\u9009\uFF09" }),
|
|
37077
|
+
/* @__PURE__ */ jsx22(
|
|
37060
37078
|
"textarea",
|
|
37061
37079
|
{
|
|
37062
37080
|
ref: textareaRef,
|
|
@@ -37155,7 +37173,7 @@ function getCodeLanguageFromFilename(filePath) {
|
|
|
37155
37173
|
}
|
|
37156
37174
|
|
|
37157
37175
|
// src/chat/tool-renderers/shared.tsx
|
|
37158
|
-
import { jsx as
|
|
37176
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
37159
37177
|
function getResultText(result) {
|
|
37160
37178
|
if (typeof result === "string") return result;
|
|
37161
37179
|
if (Array.isArray(result)) {
|
|
@@ -37222,7 +37240,7 @@ function CodePreview({
|
|
|
37222
37240
|
}) {
|
|
37223
37241
|
const { highlightedHtml } = useHighlightedCode(content3, getCodeLanguage(filePath));
|
|
37224
37242
|
if (!content3.trim()) {
|
|
37225
|
-
return /* @__PURE__ */
|
|
37243
|
+
return /* @__PURE__ */ jsx23(
|
|
37226
37244
|
"pre",
|
|
37227
37245
|
{
|
|
37228
37246
|
className: cn(
|
|
@@ -37230,11 +37248,11 @@ function CodePreview({
|
|
|
37230
37248
|
"bg-[hsl(var(--muted))]/35 p-3 font-mono text-[11px] text-[hsl(var(--muted-foreground))]",
|
|
37231
37249
|
className
|
|
37232
37250
|
),
|
|
37233
|
-
children: /* @__PURE__ */
|
|
37251
|
+
children: /* @__PURE__ */ jsx23("code", { children: emptyLabel })
|
|
37234
37252
|
}
|
|
37235
37253
|
);
|
|
37236
37254
|
}
|
|
37237
|
-
return /* @__PURE__ */
|
|
37255
|
+
return /* @__PURE__ */ jsx23(
|
|
37238
37256
|
"pre",
|
|
37239
37257
|
{
|
|
37240
37258
|
className: cn(
|
|
@@ -37242,19 +37260,19 @@ function CodePreview({
|
|
|
37242
37260
|
"bg-[hsl(var(--muted))]/35 p-3 text-[11px]",
|
|
37243
37261
|
className
|
|
37244
37262
|
),
|
|
37245
|
-
children: highlightedHtml ? /* @__PURE__ */
|
|
37263
|
+
children: highlightedHtml ? /* @__PURE__ */ jsx23(
|
|
37246
37264
|
"code",
|
|
37247
37265
|
{
|
|
37248
37266
|
className: "font-mono",
|
|
37249
37267
|
dangerouslySetInnerHTML: { __html: highlightedHtml }
|
|
37250
37268
|
}
|
|
37251
|
-
) : /* @__PURE__ */
|
|
37269
|
+
) : /* @__PURE__ */ jsx23("code", { className: "whitespace-pre-wrap break-words font-mono text-[hsl(var(--foreground))]", children: content3 })
|
|
37252
37270
|
}
|
|
37253
37271
|
);
|
|
37254
37272
|
}
|
|
37255
37273
|
|
|
37256
37274
|
// src/chat/tool-renderers/BashRenderer.tsx
|
|
37257
|
-
import { jsx as
|
|
37275
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
37258
37276
|
function pickOutputField(data) {
|
|
37259
37277
|
if (!data) return null;
|
|
37260
37278
|
for (const key of ["output", "stdout", "stderr"]) {
|
|
@@ -37264,7 +37282,7 @@ function pickOutputField(data) {
|
|
|
37264
37282
|
return null;
|
|
37265
37283
|
}
|
|
37266
37284
|
function MetaPill({ label }) {
|
|
37267
|
-
return /* @__PURE__ */
|
|
37285
|
+
return /* @__PURE__ */ jsx24("span", { className: "rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-secondary-foreground", children: label });
|
|
37268
37286
|
}
|
|
37269
37287
|
function BashRenderer({ toolCall }) {
|
|
37270
37288
|
const argsValue = parseJsonValue(toolCall.arguments);
|
|
@@ -37287,16 +37305,16 @@ function BashRenderer({ toolCall }) {
|
|
|
37287
37305
|
const rawFallbackOutput = result === null && typeof resultStr === "string" && resultStr.trim().length > 0 ? resultStr : null;
|
|
37288
37306
|
const output2 = structuredOutput !== null ? structuredOutput : errorMessage ?? rawFallbackOutput ?? (normalizedName === "BgBash" ? "" : null);
|
|
37289
37307
|
const hasFailure = toolCall.status === "error" || timedOut || exitCode !== null && exitCode !== 0;
|
|
37290
|
-
return /* @__PURE__ */
|
|
37291
|
-
(description || cwd) && /* @__PURE__ */
|
|
37292
|
-
description ? /* @__PURE__ */
|
|
37293
|
-
cwd ? /* @__PURE__ */
|
|
37308
|
+
return /* @__PURE__ */ jsxs18("div", { className: "space-y-3", children: [
|
|
37309
|
+
(description || cwd) && /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
|
|
37310
|
+
description ? /* @__PURE__ */ jsx24("span", { children: description }) : null,
|
|
37311
|
+
cwd ? /* @__PURE__ */ jsx24("span", { className: "rounded-full bg-[hsl(var(--muted))] px-2 py-0.5 font-mono", children: cwd }) : null
|
|
37294
37312
|
] }),
|
|
37295
|
-
/* @__PURE__ */
|
|
37296
|
-
/* @__PURE__ */
|
|
37297
|
-
/* @__PURE__ */
|
|
37313
|
+
/* @__PURE__ */ jsxs18("div", { className: "overflow-hidden rounded-lg border border-border bg-card", children: [
|
|
37314
|
+
/* @__PURE__ */ jsx24("div", { className: "border-b border-border px-3 py-2 text-[10px] uppercase tracking-[0.16em] text-muted-foreground", children: "\u547D\u4EE4" }),
|
|
37315
|
+
/* @__PURE__ */ jsx24("pre", { className: "overflow-x-auto px-3 py-3 font-mono text-[11px] leading-5 text-foreground", children: /* @__PURE__ */ jsx24("code", { children: `$ ${command || "\uFF08\u672A\u63D0\u4F9B\u547D\u4EE4\uFF09"}` }) })
|
|
37298
37316
|
] }),
|
|
37299
|
-
/* @__PURE__ */
|
|
37317
|
+
/* @__PURE__ */ jsxs18(
|
|
37300
37318
|
"div",
|
|
37301
37319
|
{
|
|
37302
37320
|
className: cn(
|
|
@@ -37304,21 +37322,21 @@ function BashRenderer({ toolCall }) {
|
|
|
37304
37322
|
hasFailure ? "border-[hsl(var(--swf-danger)/0.5)]" : "border-border"
|
|
37305
37323
|
),
|
|
37306
37324
|
children: [
|
|
37307
|
-
/* @__PURE__ */
|
|
37308
|
-
/* @__PURE__ */
|
|
37309
|
-
/* @__PURE__ */
|
|
37310
|
-
taskId ? /* @__PURE__ */
|
|
37311
|
-
exitCode !== null ? /* @__PURE__ */
|
|
37312
|
-
timedOut ? /* @__PURE__ */
|
|
37313
|
-
truncated ? /* @__PURE__ */
|
|
37314
|
-
normalizedName === "BgBash" && !taskId ? /* @__PURE__ */
|
|
37325
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-2", children: [
|
|
37326
|
+
/* @__PURE__ */ jsx24("div", { className: "text-[10px] uppercase tracking-[0.16em] text-muted-foreground", children: "\u8F93\u51FA" }),
|
|
37327
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
37328
|
+
taskId ? /* @__PURE__ */ jsx24(MetaPill, { label: `\u4EFB\u52A1 ${taskId}` }) : null,
|
|
37329
|
+
exitCode !== null ? /* @__PURE__ */ jsx24(MetaPill, { label: `\u9000\u51FA\u7801 ${exitCode}` }) : null,
|
|
37330
|
+
timedOut ? /* @__PURE__ */ jsx24(MetaPill, { label: "\u5DF2\u8D85\u65F6" }) : null,
|
|
37331
|
+
truncated ? /* @__PURE__ */ jsx24(MetaPill, { label: "\u8F93\u51FA\u5DF2\u622A\u65AD" }) : null,
|
|
37332
|
+
normalizedName === "BgBash" && !taskId ? /* @__PURE__ */ jsx24(MetaPill, { label: "\u540E\u53F0\u4EFB\u52A1" }) : null
|
|
37315
37333
|
] })
|
|
37316
37334
|
] }),
|
|
37317
|
-
/* @__PURE__ */
|
|
37335
|
+
/* @__PURE__ */ jsx24("pre", { className: "max-h-[280px] overflow-auto px-3 py-3 font-mono text-[11px] leading-5 text-foreground", children: /* @__PURE__ */ jsx24("code", { className: "whitespace-pre-wrap break-words", children: output2 !== null && output2.trim().length > 0 ? output2 : normalizedName === "BgBash" ? "\u4EFB\u52A1\u5DF2\u8FDB\u5165\u540E\u53F0\u6267\u884C\uFF0C\u8F93\u51FA\u4F1A\u5728\u540E\u53F0\u4EFB\u52A1\u9762\u677F\u4E2D\u7EE7\u7EED\u66F4\u65B0\u3002" : output2 !== null && output2.trim().length === 0 && hasFailure ? "\u547D\u4EE4\u5DF2\u7ED3\u675F\uFF0C\u4F46\u672A\u6355\u83B7\u5230\u7EC8\u7AEF\u8F93\u51FA\uFF08\u8BF7\u67E5\u770B\u9000\u51FA\u7801\uFF09\u3002" : "\u547D\u4EE4\u672A\u8FD4\u56DE\u8F93\u51FA\u3002" }) })
|
|
37318
37336
|
]
|
|
37319
37337
|
}
|
|
37320
37338
|
),
|
|
37321
|
-
cwdResetNote ? /* @__PURE__ */
|
|
37339
|
+
cwdResetNote ? /* @__PURE__ */ jsx24("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: cwdResetNote }) : null
|
|
37322
37340
|
] });
|
|
37323
37341
|
}
|
|
37324
37342
|
|
|
@@ -37334,7 +37352,7 @@ function scrollWritePreviewToLatest(preview) {
|
|
|
37334
37352
|
}
|
|
37335
37353
|
|
|
37336
37354
|
// src/chat/tool-renderers/FileEditRenderer.tsx
|
|
37337
|
-
import { jsx as
|
|
37355
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
37338
37356
|
var MAX_DIFF_LINES = 200;
|
|
37339
37357
|
var FILE_PATH_FIELDS = ["file_path", "path"];
|
|
37340
37358
|
function computeDiff(oldText, newText) {
|
|
@@ -37539,26 +37557,26 @@ function FileEditRenderer({ toolCall }) {
|
|
|
37539
37557
|
if (!preview || !followLatest || writeContent.length === 0) return;
|
|
37540
37558
|
scrollWritePreviewToLatest(preview);
|
|
37541
37559
|
}, [followLatest, writeContent]);
|
|
37542
|
-
return /* @__PURE__ */
|
|
37543
|
-
/* @__PURE__ */
|
|
37544
|
-
/* @__PURE__ */
|
|
37545
|
-
/* @__PURE__ */
|
|
37546
|
-
/* @__PURE__ */
|
|
37560
|
+
return /* @__PURE__ */ jsxs19("div", { className: "space-y-3", children: [
|
|
37561
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-start justify-between gap-3", children: [
|
|
37562
|
+
/* @__PURE__ */ jsxs19("div", { className: "min-w-0", children: [
|
|
37563
|
+
/* @__PURE__ */ jsx25("div", { className: "text-[10px] uppercase tracking-[0.16em] text-[hsl(var(--muted-foreground))]", children: normalizedName === "Write" ? "\u5199\u5165\u6587\u4EF6" : "\u7F16\u8F91\u6587\u4EF6" }),
|
|
37564
|
+
/* @__PURE__ */ jsx25("div", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: fileName })
|
|
37547
37565
|
] }),
|
|
37548
|
-
checksum ? /* @__PURE__ */
|
|
37566
|
+
checksum ? /* @__PURE__ */ jsx25("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: checksum }) : null
|
|
37549
37567
|
] }),
|
|
37550
|
-
description ? /* @__PURE__ */
|
|
37551
|
-
displayErrorMessage ? /* @__PURE__ */
|
|
37552
|
-
/* @__PURE__ */
|
|
37553
|
-
/* @__PURE__ */
|
|
37554
|
-
/* @__PURE__ */
|
|
37568
|
+
description ? /* @__PURE__ */ jsx25("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: description }) : null,
|
|
37569
|
+
displayErrorMessage ? /* @__PURE__ */ jsx25("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: displayErrorMessage }) : null,
|
|
37570
|
+
/* @__PURE__ */ jsxs19("div", { className: "file-edit-preview overflow-hidden rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20", children: [
|
|
37571
|
+
/* @__PURE__ */ jsx25("div", { className: "border-b border-[hsl(var(--border))] px-3 py-2 text-[10px] uppercase tracking-[0.16em] text-[hsl(var(--muted-foreground))]", children: normalizedName === "Write" ? "\u5185\u5BB9\u9884\u89C8" : "\u53D8\u66F4\u9884\u89C8" }),
|
|
37572
|
+
/* @__PURE__ */ jsx25(
|
|
37555
37573
|
"pre",
|
|
37556
37574
|
{
|
|
37557
37575
|
ref: previewRef,
|
|
37558
37576
|
className: "max-h-[320px] overflow-auto p-0 font-mono text-[11px] leading-5",
|
|
37559
37577
|
children: diffLines.length > 0 ? diffLines.map((line, index2) => {
|
|
37560
37578
|
const prefix = line.type === "added" ? "+ " : line.type === "removed" ? "- " : " ";
|
|
37561
|
-
return /* @__PURE__ */
|
|
37579
|
+
return /* @__PURE__ */ jsxs19(
|
|
37562
37580
|
"div",
|
|
37563
37581
|
{
|
|
37564
37582
|
className: cn(
|
|
@@ -37568,8 +37586,8 @@ function FileEditRenderer({ toolCall }) {
|
|
|
37568
37586
|
line.type === "unchanged" && "text-[hsl(var(--foreground))]"
|
|
37569
37587
|
),
|
|
37570
37588
|
children: [
|
|
37571
|
-
/* @__PURE__ */
|
|
37572
|
-
/* @__PURE__ */
|
|
37589
|
+
/* @__PURE__ */ jsx25("span", { className: "select-none py-0.5 text-right text-[10px] text-[hsl(var(--muted-foreground))]", children: line.line ?? "" }),
|
|
37590
|
+
/* @__PURE__ */ jsxs19("span", { className: "min-w-0 whitespace-pre-wrap break-words py-0.5", children: [
|
|
37573
37591
|
prefix,
|
|
37574
37592
|
line.value
|
|
37575
37593
|
] })
|
|
@@ -37577,11 +37595,11 @@ function FileEditRenderer({ toolCall }) {
|
|
|
37577
37595
|
},
|
|
37578
37596
|
`${line.type}-${line.line}-${index2}`
|
|
37579
37597
|
);
|
|
37580
|
-
}) : /* @__PURE__ */
|
|
37598
|
+
}) : /* @__PURE__ */ jsx25("div", { className: "px-3 py-4 text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u672A\u68C0\u6D4B\u5230\u53EF\u9884\u89C8\u7684\u53D8\u66F4\u3002" })
|
|
37581
37599
|
}
|
|
37582
37600
|
)
|
|
37583
37601
|
] }),
|
|
37584
|
-
displaySummaryText ? /* @__PURE__ */
|
|
37602
|
+
displaySummaryText ? /* @__PURE__ */ jsx25("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: displaySummaryText }) : null
|
|
37585
37603
|
] });
|
|
37586
37604
|
}
|
|
37587
37605
|
|
|
@@ -37591,7 +37609,7 @@ import { useState as useState16 } from "react";
|
|
|
37591
37609
|
// src/chat/ImageLightbox.tsx
|
|
37592
37610
|
import { useCallback as useCallback4, useEffect as useEffect11, useRef as useRef14, useState as useState15 } from "react";
|
|
37593
37611
|
import { createPortal } from "react-dom";
|
|
37594
|
-
import { Fragment as Fragment10, jsx as
|
|
37612
|
+
import { Fragment as Fragment10, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
37595
37613
|
function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 }) {
|
|
37596
37614
|
const [currentIndex, setCurrentIndex] = useState15(initialIndex);
|
|
37597
37615
|
const [scale, setScale] = useState15(1);
|
|
@@ -37705,22 +37723,22 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37705
37723
|
if (images.length === 0) {
|
|
37706
37724
|
return createPortal(
|
|
37707
37725
|
// biome-ignore lint/a11y/useKeyWithClickEvents: ESC handler is registered via useEffect
|
|
37708
|
-
/* @__PURE__ */
|
|
37726
|
+
/* @__PURE__ */ jsxs20(
|
|
37709
37727
|
"div",
|
|
37710
37728
|
{
|
|
37711
37729
|
className: "fixed inset-0 z-50 flex animate-in items-center justify-center bg-black/80 fade-in-0 duration-(--motion-duration-fast)",
|
|
37712
37730
|
onClick: close,
|
|
37713
37731
|
children: [
|
|
37714
|
-
/* @__PURE__ */
|
|
37732
|
+
/* @__PURE__ */ jsx26(
|
|
37715
37733
|
"button",
|
|
37716
37734
|
{
|
|
37717
37735
|
type: "button",
|
|
37718
37736
|
onClick: close,
|
|
37719
37737
|
className: "absolute right-4 top-4 z-10 rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
|
|
37720
|
-
children: /* @__PURE__ */
|
|
37738
|
+
children: /* @__PURE__ */ jsx26(X, { size: 20 })
|
|
37721
37739
|
}
|
|
37722
37740
|
),
|
|
37723
|
-
/* @__PURE__ */
|
|
37741
|
+
/* @__PURE__ */ jsx26("span", { className: "text-sm text-white/60", children: "\u52A0\u8F7D\u4E2D..." })
|
|
37724
37742
|
]
|
|
37725
37743
|
}
|
|
37726
37744
|
),
|
|
@@ -37731,19 +37749,19 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37731
37749
|
const showNav = images.length > 1;
|
|
37732
37750
|
return createPortal(
|
|
37733
37751
|
// biome-ignore lint/a11y/useKeyWithClickEvents: ESC handler is registered via useEffect
|
|
37734
|
-
/* @__PURE__ */
|
|
37752
|
+
/* @__PURE__ */ jsxs20(
|
|
37735
37753
|
"div",
|
|
37736
37754
|
{
|
|
37737
37755
|
className: "fixed inset-0 z-50 animate-in bg-black/80 fade-in-0 duration-(--motion-duration-fast)",
|
|
37738
37756
|
onClick: handleAreaClick,
|
|
37739
37757
|
children: [
|
|
37740
|
-
/* @__PURE__ */
|
|
37758
|
+
/* @__PURE__ */ jsxs20(
|
|
37741
37759
|
"div",
|
|
37742
37760
|
{
|
|
37743
37761
|
className: "absolute right-4 top-4 z-10 flex items-center gap-1.5",
|
|
37744
37762
|
onClick: (e) => e.stopPropagation(),
|
|
37745
37763
|
children: [
|
|
37746
|
-
/* @__PURE__ */
|
|
37764
|
+
/* @__PURE__ */ jsx26(
|
|
37747
37765
|
"button",
|
|
37748
37766
|
{
|
|
37749
37767
|
type: "button",
|
|
@@ -37751,10 +37769,10 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37751
37769
|
disabled: loadedSource !== current.src,
|
|
37752
37770
|
title: loadedSource === current.src ? "\u4E0B\u8F7D\u56FE\u7247" : "\u539F\u56FE\u52A0\u8F7D\u4E2D",
|
|
37753
37771
|
className: "rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
|
|
37754
|
-
children: /* @__PURE__ */
|
|
37772
|
+
children: /* @__PURE__ */ jsx26(Download, { size: 18 })
|
|
37755
37773
|
}
|
|
37756
37774
|
),
|
|
37757
|
-
/* @__PURE__ */
|
|
37775
|
+
/* @__PURE__ */ jsx26(
|
|
37758
37776
|
"button",
|
|
37759
37777
|
{
|
|
37760
37778
|
type: "button",
|
|
@@ -37762,22 +37780,22 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37762
37780
|
disabled: loadedSource !== current.src,
|
|
37763
37781
|
title: loadedSource === current.src ? "\u65B0\u6807\u7B7E\u9875\u6253\u5F00" : "\u539F\u56FE\u52A0\u8F7D\u4E2D",
|
|
37764
37782
|
className: "rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
|
|
37765
|
-
children: /* @__PURE__ */
|
|
37783
|
+
children: /* @__PURE__ */ jsx26(ExternalLink, { size: 18 })
|
|
37766
37784
|
}
|
|
37767
37785
|
),
|
|
37768
|
-
/* @__PURE__ */
|
|
37786
|
+
/* @__PURE__ */ jsx26(
|
|
37769
37787
|
"button",
|
|
37770
37788
|
{
|
|
37771
37789
|
type: "button",
|
|
37772
37790
|
onClick: close,
|
|
37773
37791
|
className: "rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
|
|
37774
|
-
children: /* @__PURE__ */
|
|
37792
|
+
children: /* @__PURE__ */ jsx26(X, { size: 20 })
|
|
37775
37793
|
}
|
|
37776
37794
|
)
|
|
37777
37795
|
]
|
|
37778
37796
|
}
|
|
37779
37797
|
),
|
|
37780
|
-
showNav && currentIndex > 0 && /* @__PURE__ */
|
|
37798
|
+
showNav && currentIndex > 0 && /* @__PURE__ */ jsx26(
|
|
37781
37799
|
"button",
|
|
37782
37800
|
{
|
|
37783
37801
|
type: "button",
|
|
@@ -37786,10 +37804,10 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37786
37804
|
goPrev();
|
|
37787
37805
|
},
|
|
37788
37806
|
className: "absolute left-4 top-1/2 z-10 -translate-y-1/2 rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
|
|
37789
|
-
children: /* @__PURE__ */
|
|
37807
|
+
children: /* @__PURE__ */ jsx26(ChevronLeft, { size: 24 })
|
|
37790
37808
|
}
|
|
37791
37809
|
),
|
|
37792
|
-
showNav && currentIndex < images.length - 1 && /* @__PURE__ */
|
|
37810
|
+
showNav && currentIndex < images.length - 1 && /* @__PURE__ */ jsx26(
|
|
37793
37811
|
"button",
|
|
37794
37812
|
{
|
|
37795
37813
|
type: "button",
|
|
@@ -37798,51 +37816,51 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37798
37816
|
goNext();
|
|
37799
37817
|
},
|
|
37800
37818
|
className: "absolute right-4 top-1/2 z-10 -translate-y-1/2 rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
|
|
37801
|
-
children: /* @__PURE__ */
|
|
37819
|
+
children: /* @__PURE__ */ jsx26(ChevronRight, { size: 24 })
|
|
37802
37820
|
}
|
|
37803
37821
|
),
|
|
37804
|
-
/* @__PURE__ */
|
|
37805
|
-
/* @__PURE__ */
|
|
37822
|
+
/* @__PURE__ */ jsxs20("div", { className: "absolute bottom-6 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1 rounded-full bg-black/50 px-2 py-1", children: [
|
|
37823
|
+
/* @__PURE__ */ jsx26(
|
|
37806
37824
|
"button",
|
|
37807
37825
|
{
|
|
37808
37826
|
type: "button",
|
|
37809
37827
|
onClick: zoomOut,
|
|
37810
37828
|
className: "rounded-full p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white",
|
|
37811
|
-
children: /* @__PURE__ */
|
|
37829
|
+
children: /* @__PURE__ */ jsx26(Minus, { size: 16 })
|
|
37812
37830
|
}
|
|
37813
37831
|
),
|
|
37814
|
-
/* @__PURE__ */
|
|
37832
|
+
/* @__PURE__ */ jsxs20("span", { className: "min-w-[3rem] text-center text-xs text-white/80", children: [
|
|
37815
37833
|
Math.round(scale * 100),
|
|
37816
37834
|
"%"
|
|
37817
37835
|
] }),
|
|
37818
|
-
/* @__PURE__ */
|
|
37836
|
+
/* @__PURE__ */ jsx26(
|
|
37819
37837
|
"button",
|
|
37820
37838
|
{
|
|
37821
37839
|
type: "button",
|
|
37822
37840
|
onClick: zoomIn,
|
|
37823
37841
|
className: "rounded-full p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white",
|
|
37824
|
-
children: /* @__PURE__ */
|
|
37842
|
+
children: /* @__PURE__ */ jsx26(Plus, { size: 16 })
|
|
37825
37843
|
}
|
|
37826
37844
|
),
|
|
37827
|
-
/* @__PURE__ */
|
|
37845
|
+
/* @__PURE__ */ jsx26(
|
|
37828
37846
|
"button",
|
|
37829
37847
|
{
|
|
37830
37848
|
type: "button",
|
|
37831
37849
|
onClick: reset,
|
|
37832
37850
|
className: "rounded-full p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white",
|
|
37833
|
-
children: /* @__PURE__ */
|
|
37851
|
+
children: /* @__PURE__ */ jsx26(RotateCcw, { size: 16 })
|
|
37834
37852
|
}
|
|
37835
37853
|
),
|
|
37836
|
-
showNav && /* @__PURE__ */
|
|
37837
|
-
/* @__PURE__ */
|
|
37838
|
-
/* @__PURE__ */
|
|
37854
|
+
showNav && /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
37855
|
+
/* @__PURE__ */ jsx26("div", { className: "mx-1 h-4 w-px bg-white/20" }),
|
|
37856
|
+
/* @__PURE__ */ jsxs20("span", { className: "min-w-[3rem] text-center text-xs text-white/80", children: [
|
|
37839
37857
|
currentIndex + 1,
|
|
37840
37858
|
" / ",
|
|
37841
37859
|
images.length
|
|
37842
37860
|
] })
|
|
37843
37861
|
] })
|
|
37844
37862
|
] }),
|
|
37845
|
-
/* @__PURE__ */
|
|
37863
|
+
/* @__PURE__ */ jsx26(
|
|
37846
37864
|
"div",
|
|
37847
37865
|
{
|
|
37848
37866
|
className: "flex h-full w-full items-center justify-center overflow-hidden p-12",
|
|
@@ -37853,7 +37871,7 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37853
37871
|
onMouseUp: handleMouseUp,
|
|
37854
37872
|
onMouseLeave: handleMouseUp,
|
|
37855
37873
|
onDoubleClick: handleDoubleClick,
|
|
37856
|
-
children: /* @__PURE__ */
|
|
37874
|
+
children: /* @__PURE__ */ jsx26(
|
|
37857
37875
|
MessageImage,
|
|
37858
37876
|
{
|
|
37859
37877
|
original: true,
|
|
@@ -37879,7 +37897,7 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
|
|
|
37879
37897
|
}
|
|
37880
37898
|
|
|
37881
37899
|
// src/chat/tool-renderers/FileReadRenderer.tsx
|
|
37882
|
-
import { jsx as
|
|
37900
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
37883
37901
|
var NUMBERED_LINE_RE = /^(\s*\d+)\t([\s\S]*)$/;
|
|
37884
37902
|
function parseReadResult(result) {
|
|
37885
37903
|
if (!result) {
|
|
@@ -37941,28 +37959,28 @@ function FileReadRenderer({ toolCall }) {
|
|
|
37941
37959
|
const resolvedStartLine = startLine ?? (lineCount > 0 ? fallbackStart : null);
|
|
37942
37960
|
const resolvedEndLine = endLine ?? (resolvedStartLine !== null && lineCount > 0 ? resolvedStartLine + lineCount - 1 : null);
|
|
37943
37961
|
const lineRange = formatLineRange(resolvedStartLine, resolvedEndLine);
|
|
37944
|
-
return /* @__PURE__ */
|
|
37945
|
-
/* @__PURE__ */
|
|
37946
|
-
/* @__PURE__ */
|
|
37947
|
-
/* @__PURE__ */
|
|
37948
|
-
filePath ? /* @__PURE__ */
|
|
37962
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
|
|
37963
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-start justify-between gap-3", children: [
|
|
37964
|
+
/* @__PURE__ */ jsxs21("div", { className: "min-w-0", children: [
|
|
37965
|
+
/* @__PURE__ */ jsx27("div", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: displayName }),
|
|
37966
|
+
filePath ? /* @__PURE__ */ jsx27("div", { className: "truncate text-[10px] text-[hsl(var(--muted-foreground))]", children: filePath }) : null
|
|
37949
37967
|
] }),
|
|
37950
|
-
/* @__PURE__ */
|
|
37951
|
-
lineRange ? /* @__PURE__ */
|
|
37952
|
-
checksum ? /* @__PURE__ */
|
|
37968
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center justify-end gap-1.5", children: [
|
|
37969
|
+
lineRange ? /* @__PURE__ */ jsx27("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: lineRange }) : null,
|
|
37970
|
+
checksum ? /* @__PURE__ */ jsx27("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: checksum }) : null
|
|
37953
37971
|
] })
|
|
37954
37972
|
] }),
|
|
37955
|
-
description ? /* @__PURE__ */
|
|
37956
|
-
errorMessage ? /* @__PURE__ */
|
|
37957
|
-
isImageResult ? /* @__PURE__ */
|
|
37958
|
-
imageUrls.map((url2, idx) => /* @__PURE__ */
|
|
37973
|
+
description ? /* @__PURE__ */ jsx27("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: description }) : null,
|
|
37974
|
+
errorMessage ? /* @__PURE__ */ jsx27("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: errorMessage }) : null,
|
|
37975
|
+
isImageResult ? /* @__PURE__ */ jsxs21("div", { className: "grid gap-2", children: [
|
|
37976
|
+
imageUrls.map((url2, idx) => /* @__PURE__ */ jsx27(
|
|
37959
37977
|
"button",
|
|
37960
37978
|
{
|
|
37961
37979
|
type: "button",
|
|
37962
37980
|
onClick: () => setLightboxIndex(idx),
|
|
37963
37981
|
className: "cursor-zoom-in",
|
|
37964
37982
|
title: "\u67E5\u770B\u5927\u56FE",
|
|
37965
|
-
children: /* @__PURE__ */
|
|
37983
|
+
children: /* @__PURE__ */ jsx27(
|
|
37966
37984
|
MessageImage,
|
|
37967
37985
|
{
|
|
37968
37986
|
src: url2,
|
|
@@ -37975,7 +37993,7 @@ function FileReadRenderer({ toolCall }) {
|
|
|
37975
37993
|
},
|
|
37976
37994
|
url2.slice(0, 64)
|
|
37977
37995
|
)),
|
|
37978
|
-
/* @__PURE__ */
|
|
37996
|
+
/* @__PURE__ */ jsx27(
|
|
37979
37997
|
ImageLightbox,
|
|
37980
37998
|
{
|
|
37981
37999
|
open: lightboxIndex != null,
|
|
@@ -37986,14 +38004,14 @@ function FileReadRenderer({ toolCall }) {
|
|
|
37986
38004
|
initialIndex: lightboxIndex ?? 0
|
|
37987
38005
|
}
|
|
37988
38006
|
),
|
|
37989
|
-
content3 ? /* @__PURE__ */
|
|
37990
|
-
] }) : !errorMessage ? /* @__PURE__ */
|
|
37991
|
-
note ? /* @__PURE__ */
|
|
38007
|
+
content3 ? /* @__PURE__ */ jsx27("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: content3 }) : null
|
|
38008
|
+
] }) : !errorMessage ? /* @__PURE__ */ jsx27(CodePreview, { content: content3, filePath, className: "max-h-[360px]" }) : null,
|
|
38009
|
+
note ? /* @__PURE__ */ jsx27("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: note }) : null
|
|
37992
38010
|
] });
|
|
37993
38011
|
}
|
|
37994
38012
|
|
|
37995
38013
|
// src/chat/tool-renderers/SearchRenderer.tsx
|
|
37996
|
-
import { jsx as
|
|
38014
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
37997
38015
|
function toRecordArray(value) {
|
|
37998
38016
|
return Array.isArray(value) ? value.filter(isPlainObject3) : [];
|
|
37999
38017
|
}
|
|
@@ -38045,7 +38063,7 @@ function parseWebResults(result) {
|
|
|
38045
38063
|
}));
|
|
38046
38064
|
}
|
|
38047
38065
|
function renderEmptyState(label) {
|
|
38048
|
-
return /* @__PURE__ */
|
|
38066
|
+
return /* @__PURE__ */ jsx28("div", { className: "rounded-lg border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-4 text-[11px] text-[hsl(var(--muted-foreground))]", children: label });
|
|
38049
38067
|
}
|
|
38050
38068
|
function SearchRenderer({ toolCall }) {
|
|
38051
38069
|
const normalizedName = formatToolName(toolCall.name);
|
|
@@ -38054,26 +38072,26 @@ function SearchRenderer({ toolCall }) {
|
|
|
38054
38072
|
const resultStr = getResultText(toolCall.result);
|
|
38055
38073
|
const errorMessage = extractErrorMessage(resultStr);
|
|
38056
38074
|
if (errorMessage) {
|
|
38057
|
-
return /* @__PURE__ */
|
|
38075
|
+
return /* @__PURE__ */ jsx28("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: errorMessage });
|
|
38058
38076
|
}
|
|
38059
38077
|
if (normalizedName === "Ls" || normalizedName === "Glob") {
|
|
38060
38078
|
const items = parseDirectoryItems(resultStr);
|
|
38061
38079
|
const path2 = getStringValue(args, "path");
|
|
38062
|
-
return /* @__PURE__ */
|
|
38063
|
-
path2 ? /* @__PURE__ */
|
|
38080
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
|
|
38081
|
+
path2 ? /* @__PURE__ */ jsxs22("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
|
|
38064
38082
|
"\u76EE\u5F55\uFF1A",
|
|
38065
38083
|
path2
|
|
38066
38084
|
] }) : null,
|
|
38067
|
-
items.length > 0 ? /* @__PURE__ */
|
|
38085
|
+
items.length > 0 ? /* @__PURE__ */ jsx28("div", { className: "grid gap-2", children: items.map((item) => /* @__PURE__ */ jsxs22(
|
|
38068
38086
|
"div",
|
|
38069
38087
|
{
|
|
38070
38088
|
className: "flex items-center justify-between gap-3 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-2",
|
|
38071
38089
|
children: [
|
|
38072
|
-
/* @__PURE__ */
|
|
38073
|
-
item.isDir ? /* @__PURE__ */
|
|
38074
|
-
/* @__PURE__ */
|
|
38090
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
38091
|
+
item.isDir ? /* @__PURE__ */ jsx28(Folder, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }) : /* @__PURE__ */ jsx28(FileText, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
|
|
38092
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: item.name })
|
|
38075
38093
|
] }),
|
|
38076
|
-
/* @__PURE__ */
|
|
38094
|
+
/* @__PURE__ */ jsx28("span", { className: "shrink-0 text-[10px] text-[hsl(var(--muted-foreground))]", children: item.isDir ? "\u76EE\u5F55" : formatBytes(item.size) ?? "\u6587\u4EF6" })
|
|
38077
38095
|
]
|
|
38078
38096
|
},
|
|
38079
38097
|
`${item.name}-${item.size}-${item.isDir}`
|
|
@@ -38083,28 +38101,28 @@ function SearchRenderer({ toolCall }) {
|
|
|
38083
38101
|
if (normalizedName === "Grep") {
|
|
38084
38102
|
const { matches, searchPath } = parseGrepResult(resultStr);
|
|
38085
38103
|
const pattern = getStringValue(args, "pattern");
|
|
38086
|
-
return /* @__PURE__ */
|
|
38087
|
-
/* @__PURE__ */
|
|
38088
|
-
pattern ? /* @__PURE__ */
|
|
38089
|
-
searchPath ? /* @__PURE__ */
|
|
38104
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
|
|
38105
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center gap-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
|
|
38106
|
+
pattern ? /* @__PURE__ */ jsx28("span", { className: "rounded-full bg-[hsl(var(--muted))] px-2 py-0.5 font-mono", children: pattern }) : null,
|
|
38107
|
+
searchPath ? /* @__PURE__ */ jsxs22("span", { children: [
|
|
38090
38108
|
"\u8303\u56F4\uFF1A",
|
|
38091
38109
|
searchPath
|
|
38092
38110
|
] }) : null
|
|
38093
38111
|
] }),
|
|
38094
|
-
matches.length > 0 ? /* @__PURE__ */
|
|
38112
|
+
matches.length > 0 ? /* @__PURE__ */ jsx28("div", { className: "grid gap-2", children: matches.map((match) => /* @__PURE__ */ jsxs22(
|
|
38095
38113
|
"div",
|
|
38096
38114
|
{
|
|
38097
38115
|
className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-2",
|
|
38098
38116
|
children: [
|
|
38099
|
-
/* @__PURE__ */
|
|
38100
|
-
/* @__PURE__ */
|
|
38101
|
-
match.lineNumber !== null ? /* @__PURE__ */
|
|
38117
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between gap-3", children: [
|
|
38118
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: match.path }),
|
|
38119
|
+
match.lineNumber !== null ? /* @__PURE__ */ jsxs22("span", { className: "shrink-0 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
|
|
38102
38120
|
"\u7B2C ",
|
|
38103
38121
|
match.lineNumber,
|
|
38104
38122
|
" \u884C"
|
|
38105
38123
|
] }) : null
|
|
38106
38124
|
] }),
|
|
38107
|
-
/* @__PURE__ */
|
|
38125
|
+
/* @__PURE__ */ jsx28("pre", { className: "mt-2 overflow-x-auto whitespace-pre-wrap font-mono text-[11px] text-[hsl(var(--muted-foreground))]", children: /* @__PURE__ */ jsx28("code", { children: match.line }) })
|
|
38108
38126
|
]
|
|
38109
38127
|
},
|
|
38110
38128
|
`${match.path}-${match.lineNumber}-${match.line}`
|
|
@@ -38114,8 +38132,8 @@ function SearchRenderer({ toolCall }) {
|
|
|
38114
38132
|
if (normalizedName === "WebFetch") {
|
|
38115
38133
|
const url2 = getStringValue(args, "url");
|
|
38116
38134
|
const text4 = resultStr?.trim();
|
|
38117
|
-
return /* @__PURE__ */
|
|
38118
|
-
url2 ? /* @__PURE__ */
|
|
38135
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
|
|
38136
|
+
url2 ? /* @__PURE__ */ jsxs22(
|
|
38119
38137
|
"a",
|
|
38120
38138
|
{
|
|
38121
38139
|
href: url2,
|
|
@@ -38123,23 +38141,23 @@ function SearchRenderer({ toolCall }) {
|
|
|
38123
38141
|
rel: "noreferrer",
|
|
38124
38142
|
className: "flex items-center gap-2 truncate font-mono text-[10px] text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]",
|
|
38125
38143
|
children: [
|
|
38126
|
-
/* @__PURE__ */
|
|
38127
|
-
/* @__PURE__ */
|
|
38128
|
-
/* @__PURE__ */
|
|
38144
|
+
/* @__PURE__ */ jsx28(Earth, { size: 12, className: "shrink-0" }),
|
|
38145
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate", children: url2 }),
|
|
38146
|
+
/* @__PURE__ */ jsx28(ExternalLink, { size: 11, className: "shrink-0" })
|
|
38129
38147
|
]
|
|
38130
38148
|
}
|
|
38131
38149
|
) : null,
|
|
38132
|
-
text4 ? /* @__PURE__ */
|
|
38150
|
+
text4 ? /* @__PURE__ */ jsx28("div", { className: "max-h-80 overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-3", children: /* @__PURE__ */ jsx28("p", { className: "whitespace-pre-wrap text-[11px] leading-5 text-[hsl(var(--foreground))]", children: text4 }) }) : renderEmptyState("\u8FD9\u4E2A\u7F51\u9875\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6B63\u6587\u3002")
|
|
38133
38151
|
] });
|
|
38134
38152
|
}
|
|
38135
38153
|
const results = parseWebResults(resultStr);
|
|
38136
38154
|
const query = getStringValue(args, "query");
|
|
38137
|
-
return /* @__PURE__ */
|
|
38138
|
-
query ? /* @__PURE__ */
|
|
38155
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
|
|
38156
|
+
query ? /* @__PURE__ */ jsxs22("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
|
|
38139
38157
|
"\u67E5\u8BE2\uFF1A",
|
|
38140
38158
|
query
|
|
38141
38159
|
] }) : null,
|
|
38142
|
-
results.length > 0 ? /* @__PURE__ */
|
|
38160
|
+
results.length > 0 ? /* @__PURE__ */ jsx28("div", { className: "grid gap-2", children: results.map((item, index2) => /* @__PURE__ */ jsx28(
|
|
38143
38161
|
"a",
|
|
38144
38162
|
{
|
|
38145
38163
|
href: item.url ?? void 0,
|
|
@@ -38149,12 +38167,12 @@ function SearchRenderer({ toolCall }) {
|
|
|
38149
38167
|
"rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-3 transition-colors",
|
|
38150
38168
|
item.url && "hover:border-[hsl(var(--ring))] hover:bg-[hsl(var(--muted))]/35"
|
|
38151
38169
|
),
|
|
38152
|
-
children: /* @__PURE__ */
|
|
38153
|
-
/* @__PURE__ */
|
|
38154
|
-
/* @__PURE__ */
|
|
38155
|
-
/* @__PURE__ */
|
|
38156
|
-
/* @__PURE__ */
|
|
38157
|
-
item.url ? /* @__PURE__ */
|
|
38170
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "flex items-start gap-3", children: [
|
|
38171
|
+
/* @__PURE__ */ jsx28(Earth, { size: 16, className: "mt-0.5 shrink-0 text-[hsl(var(--muted-foreground))]" }),
|
|
38172
|
+
/* @__PURE__ */ jsxs22("div", { className: "min-w-0 flex-1", children: [
|
|
38173
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-start justify-between gap-3", children: [
|
|
38174
|
+
/* @__PURE__ */ jsx28("span", { className: "line-clamp-2 text-[11px] font-medium text-[hsl(var(--foreground))]", children: item.title ?? item.url ?? "\u672A\u547D\u540D\u7ED3\u679C" }),
|
|
38175
|
+
item.url ? /* @__PURE__ */ jsx28(
|
|
38158
38176
|
ExternalLink,
|
|
38159
38177
|
{
|
|
38160
38178
|
size: 12,
|
|
@@ -38162,12 +38180,12 @@ function SearchRenderer({ toolCall }) {
|
|
|
38162
38180
|
}
|
|
38163
38181
|
) : null
|
|
38164
38182
|
] }),
|
|
38165
|
-
item.url ? /* @__PURE__ */
|
|
38166
|
-
item.publishedDate ? /* @__PURE__ */
|
|
38183
|
+
item.url ? /* @__PURE__ */ jsx28("div", { className: "mt-1 truncate font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: item.url }) : null,
|
|
38184
|
+
item.publishedDate ? /* @__PURE__ */ jsxs22("div", { className: "mt-1 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
|
|
38167
38185
|
"\u53D1\u5E03\u4E8E ",
|
|
38168
38186
|
item.publishedDate.slice(0, 10)
|
|
38169
38187
|
] }) : null,
|
|
38170
|
-
item.description ? /* @__PURE__ */
|
|
38188
|
+
item.description ? /* @__PURE__ */ jsx28("p", { className: "mt-2 line-clamp-3 text-[11px] leading-5 text-[hsl(var(--muted-foreground))]", children: item.description }) : null
|
|
38171
38189
|
] })
|
|
38172
38190
|
] })
|
|
38173
38191
|
},
|
|
@@ -38177,7 +38195,7 @@ function SearchRenderer({ toolCall }) {
|
|
|
38177
38195
|
}
|
|
38178
38196
|
|
|
38179
38197
|
// src/chat/tool-renderers/SubmitResultRenderer.tsx
|
|
38180
|
-
import { jsx as
|
|
38198
|
+
import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
38181
38199
|
function extractText2(value, key) {
|
|
38182
38200
|
if (!isPlainObject3(value)) return null;
|
|
38183
38201
|
const field = value[key];
|
|
@@ -38198,25 +38216,25 @@ function SubmitResultRenderer({ toolCall }) {
|
|
|
38198
38216
|
const { description, result, error: error61, status } = parsePayload(toolCall);
|
|
38199
38217
|
const isError = toolCall.status === "error" || Boolean(error61);
|
|
38200
38218
|
const Icon = isError ? CircleAlert : CircleCheck;
|
|
38201
|
-
return /* @__PURE__ */
|
|
38202
|
-
/* @__PURE__ */
|
|
38203
|
-
/* @__PURE__ */
|
|
38204
|
-
/* @__PURE__ */
|
|
38205
|
-
/* @__PURE__ */
|
|
38206
|
-
description ? /* @__PURE__ */
|
|
38207
|
-
status ? /* @__PURE__ */
|
|
38219
|
+
return /* @__PURE__ */ jsxs23("div", { className: "overflow-hidden rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
|
|
38220
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-3 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]/25 px-4 py-3", children: [
|
|
38221
|
+
/* @__PURE__ */ jsx29("div", { className: isError ? "text-[hsl(var(--swf-danger))]" : "text-[hsl(var(--swf-success))]", children: /* @__PURE__ */ jsx29(Icon, { size: 18 }) }),
|
|
38222
|
+
/* @__PURE__ */ jsxs23("div", { className: "min-w-0 flex-1", children: [
|
|
38223
|
+
/* @__PURE__ */ jsx29("div", { className: "font-medium text-[hsl(var(--foreground))]", children: description || (isError ? "\u4EFB\u52A1\u6267\u884C\u5931\u8D25" : "\u4EFB\u52A1\u7ED3\u679C\u5DF2\u63D0\u4EA4") }),
|
|
38224
|
+
description ? /* @__PURE__ */ jsx29("div", { className: "mt-0.5 text-xs text-[hsl(var(--muted-foreground))]", children: isError ? "\u4EFB\u52A1\u6267\u884C\u5931\u8D25" : "\u4EFB\u52A1\u7ED3\u679C\u5DF2\u63D0\u4EA4" }) : null,
|
|
38225
|
+
status ? /* @__PURE__ */ jsxs23("div", { className: "mt-0.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
38208
38226
|
"\u72B6\u6001\uFF1A",
|
|
38209
38227
|
status
|
|
38210
38228
|
] }) : null
|
|
38211
38229
|
] })
|
|
38212
38230
|
] }),
|
|
38213
|
-
/* @__PURE__ */
|
|
38214
|
-
result ? /* @__PURE__ */
|
|
38215
|
-
error61 ? /* @__PURE__ */
|
|
38216
|
-
/* @__PURE__ */
|
|
38217
|
-
/* @__PURE__ */
|
|
38231
|
+
/* @__PURE__ */ jsxs23("div", { className: "space-y-3 px-4 py-4 text-sm leading-6 text-[hsl(var(--foreground))]", children: [
|
|
38232
|
+
result ? /* @__PURE__ */ jsx29("p", { className: "whitespace-pre-wrap", children: result }) : null,
|
|
38233
|
+
error61 ? /* @__PURE__ */ jsxs23("div", { className: "rounded-xl border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-sm text-[hsl(var(--swf-danger))]", children: [
|
|
38234
|
+
/* @__PURE__ */ jsx29("div", { className: "mb-1 font-medium", children: "\u9519\u8BEF\u4FE1\u606F" }),
|
|
38235
|
+
/* @__PURE__ */ jsx29("div", { className: "whitespace-pre-wrap", children: error61 })
|
|
38218
38236
|
] }) : null,
|
|
38219
|
-
!result && !error61 ? /* @__PURE__ */
|
|
38237
|
+
!result && !error61 ? /* @__PURE__ */ jsx29("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u667A\u80FD\u4F53\u5DF2\u7ED3\u675F\u672C\u8F6E\u4EFB\u52A1\u3002" }) : null
|
|
38220
38238
|
] })
|
|
38221
38239
|
] });
|
|
38222
38240
|
}
|
|
@@ -38241,7 +38259,7 @@ function getRenderer(toolName) {
|
|
|
38241
38259
|
}
|
|
38242
38260
|
|
|
38243
38261
|
// src/chat/ToolCallBlock.tsx
|
|
38244
|
-
import { Fragment as Fragment11, jsx as
|
|
38262
|
+
import { Fragment as Fragment11, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
38245
38263
|
function getFilePreviewName(filePath) {
|
|
38246
38264
|
return filePath.split(/[\\/]/).pop() ?? filePath;
|
|
38247
38265
|
}
|
|
@@ -38259,16 +38277,16 @@ function FilePathLink({ filePath, sessionId }) {
|
|
|
38259
38277
|
}
|
|
38260
38278
|
};
|
|
38261
38279
|
if (!openWorkspaceFile) {
|
|
38262
|
-
return /* @__PURE__ */
|
|
38280
|
+
return /* @__PURE__ */ jsx30("span", { className: "min-w-0 truncate font-mono text-[hsl(var(--muted-foreground))]", children: displayLabel });
|
|
38263
38281
|
}
|
|
38264
|
-
return /* @__PURE__ */
|
|
38282
|
+
return /* @__PURE__ */ jsx30(
|
|
38265
38283
|
"button",
|
|
38266
38284
|
{
|
|
38267
38285
|
type: "button",
|
|
38268
38286
|
onClick: handleClick,
|
|
38269
38287
|
className: "flex min-w-0 cursor-pointer items-center gap-1 font-mono text-[hsl(var(--swf-link-text))] hover:underline",
|
|
38270
38288
|
title: `\u9884\u89C8 ${displayLabel}`,
|
|
38271
|
-
children: /* @__PURE__ */
|
|
38289
|
+
children: /* @__PURE__ */ jsx30("span", { className: "truncate", children: displayLabel })
|
|
38272
38290
|
}
|
|
38273
38291
|
);
|
|
38274
38292
|
}
|
|
@@ -38279,7 +38297,7 @@ function ToolFilePreviewAction({
|
|
|
38279
38297
|
}) {
|
|
38280
38298
|
const filePath = extractToolFilePath(toolCall);
|
|
38281
38299
|
if (!filePath) return null;
|
|
38282
|
-
return /* @__PURE__ */
|
|
38300
|
+
return /* @__PURE__ */ jsx30("span", { className: cn("flex min-w-0", className), children: /* @__PURE__ */ jsx30(FilePathLink, { filePath, sessionId }) });
|
|
38283
38301
|
}
|
|
38284
38302
|
function isLivePreviewTool(toolName) {
|
|
38285
38303
|
return toolName === "Write" || toolName === "Edit" || toolName === "MultiEdit";
|
|
@@ -38304,7 +38322,7 @@ function ToolPreviewAction({
|
|
|
38304
38322
|
return null;
|
|
38305
38323
|
}
|
|
38306
38324
|
const label = uiMeta.title ?? displayName;
|
|
38307
|
-
return /* @__PURE__ */
|
|
38325
|
+
return /* @__PURE__ */ jsxs24(
|
|
38308
38326
|
"button",
|
|
38309
38327
|
{
|
|
38310
38328
|
type: "button",
|
|
@@ -38315,8 +38333,8 @@ function ToolPreviewAction({
|
|
|
38315
38333
|
),
|
|
38316
38334
|
title: `\u6253\u5F00 ${label}`,
|
|
38317
38335
|
children: [
|
|
38318
|
-
/* @__PURE__ */
|
|
38319
|
-
/* @__PURE__ */
|
|
38336
|
+
/* @__PURE__ */ jsx30(PanelRightOpen, { size: 12 }),
|
|
38337
|
+
/* @__PURE__ */ jsx30("span", { children: label })
|
|
38320
38338
|
]
|
|
38321
38339
|
}
|
|
38322
38340
|
);
|
|
@@ -38394,11 +38412,11 @@ function ToolCallBlock({
|
|
|
38394
38412
|
onAnswer: canAnswer ? resolvedOnAnswer : void 0
|
|
38395
38413
|
}) : null;
|
|
38396
38414
|
const customToolCall2 = customQuestion == null && !customization?.renderers?.askUserQuestion ? customization?.renderers?.toolCall?.(toolCall) : null;
|
|
38397
|
-
if (customQuestion != null) return /* @__PURE__ */
|
|
38398
|
-
if (customToolCall2 != null) return /* @__PURE__ */
|
|
38415
|
+
if (customQuestion != null) return /* @__PURE__ */ jsx30(Fragment11, { children: customQuestion });
|
|
38416
|
+
if (customToolCall2 != null) return /* @__PURE__ */ jsx30(Fragment11, { children: customToolCall2 });
|
|
38399
38417
|
if (toolCall.status === "error") return null;
|
|
38400
38418
|
if (askData) {
|
|
38401
|
-
const questionBlock = /* @__PURE__ */
|
|
38419
|
+
const questionBlock = /* @__PURE__ */ jsx30(
|
|
38402
38420
|
AskUserQuestionBlock,
|
|
38403
38421
|
{
|
|
38404
38422
|
data: askData,
|
|
@@ -38412,35 +38430,35 @@ function ToolCallBlock({
|
|
|
38412
38430
|
if (!reasoning) {
|
|
38413
38431
|
return questionBlock;
|
|
38414
38432
|
}
|
|
38415
|
-
return /* @__PURE__ */
|
|
38433
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1", children: [
|
|
38416
38434
|
questionBlock,
|
|
38417
|
-
/* @__PURE__ */
|
|
38435
|
+
/* @__PURE__ */ jsx30("div", { className: "ml-4", children: /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning, variant: "block" }) })
|
|
38418
38436
|
] });
|
|
38419
38437
|
}
|
|
38420
38438
|
if (toolCall.status === "pending") {
|
|
38421
|
-
return /* @__PURE__ */
|
|
38422
|
-
/* @__PURE__ */
|
|
38423
|
-
/* @__PURE__ */
|
|
38439
|
+
return /* @__PURE__ */ jsxs24("div", { part: "ask-card", className: "blade-chat-ask-card ml-4 flex max-w-lg items-center gap-2 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-4 text-sm text-[hsl(var(--muted-foreground))]", children: [
|
|
38440
|
+
/* @__PURE__ */ jsx30(LoaderCircle, { size: 14, className: "animate-spin" }),
|
|
38441
|
+
/* @__PURE__ */ jsx30("span", { children: "\u6B63\u5728\u51C6\u5907\u95EE\u9898\u2026" })
|
|
38424
38442
|
] });
|
|
38425
38443
|
}
|
|
38426
|
-
return /* @__PURE__ */
|
|
38427
|
-
/* @__PURE__ */
|
|
38428
|
-
/* @__PURE__ */
|
|
38444
|
+
return /* @__PURE__ */ jsxs24("div", { part: "ask-card", className: "blade-chat-ask-card ml-4 max-w-lg rounded-xl border border-[hsl(var(--swf-warning)/0.35)] bg-[hsl(var(--swf-warning-soft))] p-4 text-sm text-[hsl(var(--foreground))]", children: [
|
|
38445
|
+
/* @__PURE__ */ jsx30("div", { className: "font-semibold", children: "\u9009\u62E9\u9898\u5185\u5BB9\u6682\u65F6\u65E0\u6CD5\u663E\u793A" }),
|
|
38446
|
+
/* @__PURE__ */ jsxs24("div", { className: "mt-1 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: [
|
|
38429
38447
|
"\u6536\u5230\u7684\u4EA4\u4E92\u6570\u636E\u4E0D\u5B8C\u6574\u6216\u7248\u672C\u4E0D\u517C\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u95EE\u9898\u6301\u7EED\uFF0C\u8BF7\u63D0\u4F9B\u4EA4\u4E92\u7F16\u53F7",
|
|
38430
|
-
/* @__PURE__ */
|
|
38448
|
+
/* @__PURE__ */ jsx30("span", { className: "ml-1 font-mono", children: toolCall.id }),
|
|
38431
38449
|
"\u3002"
|
|
38432
38450
|
] })
|
|
38433
38451
|
] });
|
|
38434
38452
|
}
|
|
38435
38453
|
const customToolCall = customization?.renderers?.toolCall?.(toolCall);
|
|
38436
|
-
if (customToolCall != null) return /* @__PURE__ */
|
|
38454
|
+
if (customToolCall != null) return /* @__PURE__ */ jsx30(Fragment11, { children: customToolCall });
|
|
38437
38455
|
const tone = getToolTone(toolCall.status);
|
|
38438
38456
|
const displayName = getToolDisplayLabel(toolCall);
|
|
38439
38457
|
const Renderer = customization?.renderers?.tool?.[normalizedName] ?? getRenderer(normalizedName);
|
|
38440
38458
|
const indentClass = level === 2 ? "ml-3" : "";
|
|
38441
|
-
const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */
|
|
38459
|
+
const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */ jsx30(LoaderCircle, { size: 12, className: "animate-spin" }) : toolCall.status === "awaiting_answer" ? /* @__PURE__ */ jsx30(MessageSquareMore, { size: 12 }) : toolCall.status === "cancelled" || toolCall.status === "error" ? /* @__PURE__ */ jsx30(X, { size: 12 }) : /* @__PURE__ */ jsx30(Check, { size: 12 });
|
|
38442
38460
|
const statusTextClass = tone === "failed" ? "text-[hsl(var(--swf-danger))]" : tone === "awaiting" ? "text-[hsl(var(--swf-warning))]" : tone === "running" ? "text-[hsl(var(--muted-foreground))]" : "text-[hsl(var(--primary))]";
|
|
38443
|
-
return /* @__PURE__ */
|
|
38461
|
+
return /* @__PURE__ */ jsxs24(
|
|
38444
38462
|
"div",
|
|
38445
38463
|
{
|
|
38446
38464
|
part: normalizedName === "Agent" ? "agent-loop" : "tool-row",
|
|
@@ -38451,8 +38469,8 @@ function ToolCallBlock({
|
|
|
38451
38469
|
customization?.classNames?.toolCall
|
|
38452
38470
|
),
|
|
38453
38471
|
children: [
|
|
38454
|
-
/* @__PURE__ */
|
|
38455
|
-
/* @__PURE__ */
|
|
38472
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 min-h-7 pr-3 leading-5", children: [
|
|
38473
|
+
/* @__PURE__ */ jsxs24(
|
|
38456
38474
|
"button",
|
|
38457
38475
|
{
|
|
38458
38476
|
type: "button",
|
|
@@ -38460,7 +38478,7 @@ function ToolCallBlock({
|
|
|
38460
38478
|
className: "flex min-h-7 min-w-0 flex-1 items-center gap-2 text-left transition-colors hover:bg-[hsl(var(--swf-fill-light))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
38461
38479
|
"aria-expanded": expanded,
|
|
38462
38480
|
children: [
|
|
38463
|
-
/* @__PURE__ */
|
|
38481
|
+
/* @__PURE__ */ jsx30(
|
|
38464
38482
|
ChevronRight,
|
|
38465
38483
|
{
|
|
38466
38484
|
size: 12,
|
|
@@ -38470,20 +38488,20 @@ function ToolCallBlock({
|
|
|
38470
38488
|
)
|
|
38471
38489
|
}
|
|
38472
38490
|
),
|
|
38473
|
-
/* @__PURE__ */
|
|
38491
|
+
/* @__PURE__ */ jsxs24("span", { className: cn("flex shrink-0 items-center gap-1 text-[10px]", statusTextClass), children: [
|
|
38474
38492
|
statusIcon,
|
|
38475
|
-
/* @__PURE__ */
|
|
38493
|
+
/* @__PURE__ */ jsx30("span", { children: getToolStatusLabel(toolCall.status) })
|
|
38476
38494
|
] }),
|
|
38477
|
-
/* @__PURE__ */
|
|
38495
|
+
/* @__PURE__ */ jsxs24("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: [
|
|
38478
38496
|
displayName,
|
|
38479
38497
|
toolCall.status === "error" ? "\uFF08\u5F85\u91CD\u8BD5\uFF09" : ""
|
|
38480
38498
|
] })
|
|
38481
38499
|
]
|
|
38482
38500
|
}
|
|
38483
38501
|
),
|
|
38484
|
-
reasoning ? /* @__PURE__ */
|
|
38485
|
-
typeof toolCall.duration_ms === "number" && toolCall.duration_ms > 0 && /* @__PURE__ */
|
|
38486
|
-
/* @__PURE__ */
|
|
38502
|
+
reasoning ? /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning, variant: "block" }) : null,
|
|
38503
|
+
typeof toolCall.duration_ms === "number" && toolCall.duration_ms > 0 && /* @__PURE__ */ jsx30("span", { className: "shrink-0 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: formatToolDuration(toolCall.duration_ms) }),
|
|
38504
|
+
/* @__PURE__ */ jsx30(
|
|
38487
38505
|
ToolPreviewAction,
|
|
38488
38506
|
{
|
|
38489
38507
|
toolCall,
|
|
@@ -38492,14 +38510,14 @@ function ToolCallBlock({
|
|
|
38492
38510
|
}
|
|
38493
38511
|
)
|
|
38494
38512
|
] }),
|
|
38495
|
-
expanded && /* @__PURE__ */
|
|
38496
|
-
/* @__PURE__ */
|
|
38497
|
-
/* @__PURE__ */
|
|
38498
|
-
/* @__PURE__ */
|
|
38499
|
-
/* @__PURE__ */
|
|
38500
|
-
toolCall.result != null && /* @__PURE__ */
|
|
38501
|
-
/* @__PURE__ */
|
|
38502
|
-
/* @__PURE__ */
|
|
38513
|
+
expanded && /* @__PURE__ */ jsx30("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: Renderer ? /* @__PURE__ */ jsx30(Renderer, { toolCall, sessionId: resolvedSessionId }) : /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
38514
|
+
/* @__PURE__ */ jsx30("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u5DE5\u5177" }),
|
|
38515
|
+
/* @__PURE__ */ jsx30("div", { className: "mb-3 font-mono text-[11px] text-[hsl(var(--foreground))]", children: normalizedName }),
|
|
38516
|
+
/* @__PURE__ */ jsx30("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u53C2\u6570" }),
|
|
38517
|
+
/* @__PURE__ */ jsx30("pre", { className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[11px] text-[hsl(var(--foreground))]", children: formatArgs(toolCall.arguments) }),
|
|
38518
|
+
toolCall.result != null && /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
38519
|
+
/* @__PURE__ */ jsx30("div", { className: "mb-1 mt-3 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u7ED3\u679C" }),
|
|
38520
|
+
/* @__PURE__ */ jsx30(
|
|
38503
38521
|
"pre",
|
|
38504
38522
|
{
|
|
38505
38523
|
className: cn(
|
|
@@ -38668,7 +38686,7 @@ function useAsyncValue(key, load2) {
|
|
|
38668
38686
|
}
|
|
38669
38687
|
|
|
38670
38688
|
// src/chat/AttachmentPreviewDialog.tsx
|
|
38671
|
-
import { jsx as
|
|
38689
|
+
import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
38672
38690
|
function AttachmentPreviewDialog({ open: open2, onOpenChange, filename, url: url2, mode }) {
|
|
38673
38691
|
const enabled = open2 && url2 != null && (mode === "markdown" || mode === "text");
|
|
38674
38692
|
const { data: content3, error: error61 } = useAsyncValue(enabled ? `${mode}:${url2}` : null, async (signal) => {
|
|
@@ -38684,16 +38702,16 @@ function AttachmentPreviewDialog({ open: open2, onOpenChange, filename, url: url
|
|
|
38684
38702
|
return res.text();
|
|
38685
38703
|
});
|
|
38686
38704
|
if (!open2) return null;
|
|
38687
|
-
return /* @__PURE__ */
|
|
38705
|
+
return /* @__PURE__ */ jsx31(Dialog, { open: open2, onOpenChange, children: /* @__PURE__ */ jsxs25(
|
|
38688
38706
|
DialogContent,
|
|
38689
38707
|
{
|
|
38690
38708
|
showCloseButton: false,
|
|
38691
38709
|
className: "flex max-h-[90vh] w-full max-w-3xl flex-col gap-0 overflow-hidden p-0",
|
|
38692
38710
|
children: [
|
|
38693
|
-
/* @__PURE__ */
|
|
38694
|
-
/* @__PURE__ */
|
|
38695
|
-
/* @__PURE__ */
|
|
38696
|
-
url2 && /* @__PURE__ */
|
|
38711
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
|
|
38712
|
+
/* @__PURE__ */ jsx31(DialogTitle, { className: "truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: filename }),
|
|
38713
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-1", children: [
|
|
38714
|
+
url2 && /* @__PURE__ */ jsx31(
|
|
38697
38715
|
"a",
|
|
38698
38716
|
{
|
|
38699
38717
|
href: url2,
|
|
@@ -38702,20 +38720,20 @@ function AttachmentPreviewDialog({ open: open2, onOpenChange, filename, url: url
|
|
|
38702
38720
|
rel: "noopener noreferrer",
|
|
38703
38721
|
title: "\u4E0B\u8F7D",
|
|
38704
38722
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
|
|
38705
|
-
children: /* @__PURE__ */
|
|
38723
|
+
children: /* @__PURE__ */ jsx31(Download, { size: 14 })
|
|
38706
38724
|
}
|
|
38707
38725
|
),
|
|
38708
|
-
/* @__PURE__ */
|
|
38726
|
+
/* @__PURE__ */ jsx31(
|
|
38709
38727
|
DialogClose,
|
|
38710
38728
|
{
|
|
38711
38729
|
title: "\u5173\u95ED",
|
|
38712
38730
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
|
|
38713
|
-
children: /* @__PURE__ */
|
|
38731
|
+
children: /* @__PURE__ */ jsx31(X, { size: 14 })
|
|
38714
38732
|
}
|
|
38715
38733
|
)
|
|
38716
38734
|
] })
|
|
38717
38735
|
] }),
|
|
38718
|
-
/* @__PURE__ */
|
|
38736
|
+
/* @__PURE__ */ jsx31("div", { className: "max-h-[calc(90vh-56px)] overflow-auto px-4 py-3 text-sm text-[hsl(var(--foreground))]", children: renderContent({ mode, url: url2, content: content3, error: error61 }) })
|
|
38719
38737
|
]
|
|
38720
38738
|
}
|
|
38721
38739
|
) });
|
|
@@ -38727,42 +38745,42 @@ function renderContent({
|
|
|
38727
38745
|
error: error61
|
|
38728
38746
|
}) {
|
|
38729
38747
|
if (!url2) {
|
|
38730
|
-
return /* @__PURE__ */
|
|
38748
|
+
return /* @__PURE__ */ jsx31("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u6B64\u9644\u4EF6\u6682\u65E0\u53EF\u7528\u9884\u89C8\u5730\u5740\u3002" });
|
|
38731
38749
|
}
|
|
38732
38750
|
if (mode === "default") {
|
|
38733
|
-
return /* @__PURE__ */
|
|
38751
|
+
return /* @__PURE__ */ jsxs25("p", { className: "text-[hsl(var(--muted-foreground))]", children: [
|
|
38734
38752
|
"\u6B64\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u5185\u5D4C\u9884\u89C8\u3002\u8BF7\u70B9\u51FB\u53F3\u4E0A\u89D2",
|
|
38735
|
-
/* @__PURE__ */
|
|
38753
|
+
/* @__PURE__ */ jsx31("span", { className: "mx-1 font-medium text-[hsl(var(--foreground))]", children: "\u4E0B\u8F7D" }),
|
|
38736
38754
|
"\u6309\u94AE\u67E5\u770B\u3002"
|
|
38737
38755
|
] });
|
|
38738
38756
|
}
|
|
38739
38757
|
if (error61) {
|
|
38740
|
-
return /* @__PURE__ */
|
|
38758
|
+
return /* @__PURE__ */ jsxs25("p", { className: "text-[hsl(var(--destructive))]", children: [
|
|
38741
38759
|
"\u52A0\u8F7D\u5931\u8D25\uFF1A",
|
|
38742
38760
|
String(error61?.message ?? error61)
|
|
38743
38761
|
] });
|
|
38744
38762
|
}
|
|
38745
38763
|
if (content3 == null) {
|
|
38746
|
-
return /* @__PURE__ */
|
|
38764
|
+
return /* @__PURE__ */ jsx31("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u52A0\u8F7D\u4E2D\u2026" });
|
|
38747
38765
|
}
|
|
38748
38766
|
if (mode === "markdown") {
|
|
38749
|
-
return /* @__PURE__ */
|
|
38767
|
+
return /* @__PURE__ */ jsx31(MarkdownContent, { className: "prose prose-sm prose-invert max-w-none", children: content3 });
|
|
38750
38768
|
}
|
|
38751
|
-
return /* @__PURE__ */
|
|
38769
|
+
return /* @__PURE__ */ jsx31("pre", { className: "whitespace-pre-wrap font-mono text-xs leading-relaxed", children: content3 });
|
|
38752
38770
|
}
|
|
38753
38771
|
|
|
38754
38772
|
// src/chat/MessageContextPills.tsx
|
|
38755
|
-
import { jsx as
|
|
38773
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
38756
38774
|
function MessageContextPills({ contexts }) {
|
|
38757
38775
|
if (contexts.length === 0) return null;
|
|
38758
|
-
return /* @__PURE__ */
|
|
38776
|
+
return /* @__PURE__ */ jsx32("div", { className: "flex flex-wrap gap-1.5", children: contexts.map((ctx, index2) => /* @__PURE__ */ jsxs26(
|
|
38759
38777
|
"div",
|
|
38760
38778
|
{
|
|
38761
38779
|
className: "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--primary)/0.25)] bg-[hsl(var(--primary)/0.1)] px-2.5 py-1 text-[11px] text-[hsl(var(--primary)/0.85)]",
|
|
38762
38780
|
title: ctx.content,
|
|
38763
38781
|
children: [
|
|
38764
|
-
/* @__PURE__ */
|
|
38765
|
-
/* @__PURE__ */
|
|
38782
|
+
/* @__PURE__ */ jsx32(Bookmark, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.65)]" }),
|
|
38783
|
+
/* @__PURE__ */ jsx32("span", { className: "max-w-56 truncate", children: ctx.label })
|
|
38766
38784
|
]
|
|
38767
38785
|
},
|
|
38768
38786
|
`${ctx.label}:${index2}`
|
|
@@ -38770,7 +38788,7 @@ function MessageContextPills({ contexts }) {
|
|
|
38770
38788
|
}
|
|
38771
38789
|
|
|
38772
38790
|
// src/chat/TextAttachmentPills.tsx
|
|
38773
|
-
import { Fragment as Fragment12, jsx as
|
|
38791
|
+
import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
38774
38792
|
function getFileIcon2(fileName) {
|
|
38775
38793
|
const lower2 = fileName.toLowerCase();
|
|
38776
38794
|
if (/\.(zip|rar|7z|tar|gz)$/.test(lower2)) return Archive;
|
|
@@ -38785,15 +38803,15 @@ function getFileIcon2(fileName) {
|
|
|
38785
38803
|
function TextAttachmentPills({ attachments, onPreview }) {
|
|
38786
38804
|
if (attachments.length === 0) return null;
|
|
38787
38805
|
const pillClass = "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--primary)/0.2)] bg-[hsl(var(--primary)/0.08)] px-2.5 py-1 text-[11px] text-[hsl(var(--primary)/0.8)]";
|
|
38788
|
-
return /* @__PURE__ */
|
|
38806
|
+
return /* @__PURE__ */ jsx33("div", { className: "flex flex-wrap gap-1.5", children: attachments.map((att, index2) => {
|
|
38789
38807
|
const Icon = getFileIcon2(att.name);
|
|
38790
38808
|
const key = `${att.uploadedPath ?? att.name}:${att.name}:${index2}`;
|
|
38791
|
-
const content3 = /* @__PURE__ */
|
|
38792
|
-
/* @__PURE__ */
|
|
38793
|
-
/* @__PURE__ */
|
|
38809
|
+
const content3 = /* @__PURE__ */ jsxs27(Fragment12, { children: [
|
|
38810
|
+
/* @__PURE__ */ jsx33(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.6)]" }),
|
|
38811
|
+
/* @__PURE__ */ jsx33("span", { className: "max-w-40 truncate", children: att.name })
|
|
38794
38812
|
] });
|
|
38795
38813
|
if (onPreview) {
|
|
38796
|
-
return /* @__PURE__ */
|
|
38814
|
+
return /* @__PURE__ */ jsx33(
|
|
38797
38815
|
"button",
|
|
38798
38816
|
{
|
|
38799
38817
|
type: "button",
|
|
@@ -38805,36 +38823,36 @@ function TextAttachmentPills({ attachments, onPreview }) {
|
|
|
38805
38823
|
key
|
|
38806
38824
|
);
|
|
38807
38825
|
}
|
|
38808
|
-
return /* @__PURE__ */
|
|
38826
|
+
return /* @__PURE__ */ jsx33("div", { className: pillClass, title: att.name, children: content3 }, key);
|
|
38809
38827
|
}) });
|
|
38810
38828
|
}
|
|
38811
38829
|
|
|
38812
38830
|
// src/components/WhatIfUserBubble.tsx
|
|
38813
|
-
import { jsx as
|
|
38831
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
38814
38832
|
function WhatIfUserBubble({ parsed, onQuoteClick }) {
|
|
38815
38833
|
const { fromStep, quotes, userText } = parsed;
|
|
38816
|
-
return /* @__PURE__ */
|
|
38817
|
-
/* @__PURE__ */
|
|
38818
|
-
/* @__PURE__ */
|
|
38819
|
-
/* @__PURE__ */
|
|
38834
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-end gap-2", children: [
|
|
38835
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1.5 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.5)] px-2.5 py-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
|
|
38836
|
+
/* @__PURE__ */ jsx34(RefreshCcw, { size: 10 }),
|
|
38837
|
+
/* @__PURE__ */ jsx34("span", { children: fromStep != null ? `\u91CD\u8DD1\u81EA step ${fromStep}` : "\u91CD\u8DD1" })
|
|
38820
38838
|
] }),
|
|
38821
|
-
quotes.length > 0 && /* @__PURE__ */
|
|
38839
|
+
quotes.length > 0 && /* @__PURE__ */ jsx34("div", { className: "flex max-w-[min(72vw,42rem)] flex-col items-stretch gap-2", children: quotes.map((quote, index2) => {
|
|
38822
38840
|
const clickable = quote.stepNumber != null && !!onQuoteClick;
|
|
38823
38841
|
const label = quote.stepNumber != null ? `\u6B65\u9AA4${quote.stepNumber} \xB7 ${quote.label}` : quote.label;
|
|
38824
|
-
return /* @__PURE__ */
|
|
38825
|
-
/* @__PURE__ */
|
|
38826
|
-
/* @__PURE__ */
|
|
38827
|
-
/* @__PURE__ */
|
|
38842
|
+
return /* @__PURE__ */ jsxs28("div", { className: "rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.8)] px-3 py-2 text-left", children: [
|
|
38843
|
+
/* @__PURE__ */ jsxs28("button", { type: "button", disabled: !clickable, onClick: () => clickable && onQuoteClick(quote.stepNumber), className: "inline-flex max-w-full items-center gap-1 text-[11px] font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] disabled:cursor-default", title: clickable ? "\u8DF3\u8F6C\u5230\u5BF9\u5E94\u6B65\u9AA4\u5361\u7247" : void 0, children: [
|
|
38844
|
+
/* @__PURE__ */ jsx34("span", { children: "\u21B3" }),
|
|
38845
|
+
/* @__PURE__ */ jsx34("span", { className: "truncate", children: label })
|
|
38828
38846
|
] }),
|
|
38829
|
-
quote.snapshot ? /* @__PURE__ */
|
|
38847
|
+
quote.snapshot ? /* @__PURE__ */ jsx34("div", { className: "mt-1 border-l-2 border-[hsl(var(--accent-foreground)/0.35)] pl-2 text-xs leading-relaxed text-[hsl(var(--foreground)/0.8)]", children: /* @__PURE__ */ jsx34(MarkdownContent, { className: "blade-chat-prose", children: quote.snapshot }) }) : null
|
|
38830
38848
|
] }, `${quote.stepNumber ?? "x"}-${index2}`);
|
|
38831
38849
|
}) }),
|
|
38832
|
-
userText && /* @__PURE__ */
|
|
38850
|
+
userText && /* @__PURE__ */ jsx34("div", { className: "rounded-2xl border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-4 py-2.5 text-sm leading-relaxed text-[hsl(var(--user-msg-fg))]", children: /* @__PURE__ */ jsx34(MarkdownContent, { className: "blade-chat-prose", children: userText }) })
|
|
38833
38851
|
] });
|
|
38834
38852
|
}
|
|
38835
38853
|
|
|
38836
38854
|
// src/chat/UserMessageBubble.tsx
|
|
38837
|
-
import { jsx as
|
|
38855
|
+
import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
38838
38856
|
function isUserMessage(message) {
|
|
38839
38857
|
return message.role === "user";
|
|
38840
38858
|
}
|
|
@@ -38884,18 +38902,18 @@ function UserMessageBubble({ message, className }) {
|
|
|
38884
38902
|
contexts: textContexts
|
|
38885
38903
|
} = extractTextAttachments(message.content);
|
|
38886
38904
|
const trimmedClean = cleanText.trim();
|
|
38887
|
-
const pluginPills = message.refs?.length ? /* @__PURE__ */
|
|
38888
|
-
const topicAssetPills = message.topic_asset_refs?.length ? /* @__PURE__ */
|
|
38905
|
+
const pluginPills = message.refs?.length ? /* @__PURE__ */ jsx35("div", { className: "flex flex-wrap justify-end gap-1.5", "aria-label": "\u6D88\u606F\u5F15\u7528", children: message.refs.map((ref) => /* @__PURE__ */ jsx35("span", { className: "max-w-full truncate rounded-full border border-border bg-muted px-2.5 py-1 text-xs", children: ref.provider === "skill" ? `\u6280\u80FD \xB7 ${ref.label}` : ref.label }, ref.provider === "skill" ? `skill:${ref.id}` : `${ref.plugin}:${ref.server}:${ref.id}`)) }) : null;
|
|
38906
|
+
const topicAssetPills = message.topic_asset_refs?.length ? /* @__PURE__ */ jsx35("div", { className: "flex max-w-full flex-wrap justify-end gap-1.5", "aria-label": "\u5F15\u7528\u7684\u4E3B\u9898\u8D44\u4EA7", children: message.topic_asset_refs.map((ref) => /* @__PURE__ */ jsxs29("span", { title: ref.path, className: "max-w-full truncate rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground", children: [
|
|
38889
38907
|
"\u4E3B\u9898\u8D44\u4EA7 \xB7 ",
|
|
38890
38908
|
ref.path
|
|
38891
38909
|
] }, `${ref.topic_id}:${ref.path}`)) }) : null;
|
|
38892
38910
|
const whatifParsed = trimmedClean && imageParts.length === 0 && fileParts.length === 0 && textAttachments.length === 0 ? parseWhatIfPrompt(cleanText) : null;
|
|
38893
38911
|
if (whatifParsed && customBubble == null) {
|
|
38894
|
-
return /* @__PURE__ */
|
|
38912
|
+
return /* @__PURE__ */ jsx35("div", { part: "user-row", className: "blade-chat-user-row flex justify-end", children: /* @__PURE__ */ jsxs29("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-2", children: [
|
|
38895
38913
|
pluginPills,
|
|
38896
38914
|
topicAssetPills,
|
|
38897
|
-
/* @__PURE__ */
|
|
38898
|
-
whatifParsed.userText && /* @__PURE__ */
|
|
38915
|
+
/* @__PURE__ */ jsx35(WhatIfUserBubble, { parsed: whatifParsed }),
|
|
38916
|
+
whatifParsed.userText && /* @__PURE__ */ jsx35(
|
|
38899
38917
|
MessageActions,
|
|
38900
38918
|
{
|
|
38901
38919
|
content: whatifParsed.userText,
|
|
@@ -38946,16 +38964,16 @@ function UserMessageBubble({ message, className }) {
|
|
|
38946
38964
|
const mode = kind === "text" ? lower2.endsWith(".md") ? "markdown" : "text" : "default";
|
|
38947
38965
|
setPreview({ filename: attachment.name, url: url2, mode });
|
|
38948
38966
|
};
|
|
38949
|
-
return /* @__PURE__ */
|
|
38950
|
-
(imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */
|
|
38951
|
-
imageParts.map((part, idx) => /* @__PURE__ */
|
|
38967
|
+
return /* @__PURE__ */ jsx35("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", className), children: /* @__PURE__ */ jsxs29("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-3", children: [
|
|
38968
|
+
(imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */ jsxs29("div", { className: "grid gap-2", children: [
|
|
38969
|
+
imageParts.map((part, idx) => /* @__PURE__ */ jsx35(
|
|
38952
38970
|
"button",
|
|
38953
38971
|
{
|
|
38954
38972
|
type: "button",
|
|
38955
38973
|
onClick: () => setLightboxIndex(idx),
|
|
38956
38974
|
className: "cursor-zoom-in",
|
|
38957
38975
|
title: "\u67E5\u770B\u5927\u56FE",
|
|
38958
|
-
children: /* @__PURE__ */
|
|
38976
|
+
children: /* @__PURE__ */ jsx35(
|
|
38959
38977
|
MessageImage,
|
|
38960
38978
|
{
|
|
38961
38979
|
src: part.image_url.url,
|
|
@@ -38970,14 +38988,14 @@ function UserMessageBubble({ message, className }) {
|
|
|
38970
38988
|
)),
|
|
38971
38989
|
imageTextAttachmentMeta.map((att, idx) => {
|
|
38972
38990
|
const blobUrl = imageAttachmentUrls[idx];
|
|
38973
|
-
return blobUrl ? /* @__PURE__ */
|
|
38991
|
+
return blobUrl ? /* @__PURE__ */ jsx35(
|
|
38974
38992
|
"button",
|
|
38975
38993
|
{
|
|
38976
38994
|
type: "button",
|
|
38977
38995
|
onClick: () => setLightboxIndex(imageParts.length + idx),
|
|
38978
38996
|
className: "cursor-zoom-in",
|
|
38979
38997
|
title: "\u67E5\u770B\u5927\u56FE",
|
|
38980
|
-
children: /* @__PURE__ */
|
|
38998
|
+
children: /* @__PURE__ */ jsx35(
|
|
38981
38999
|
"img",
|
|
38982
39000
|
{
|
|
38983
39001
|
src: blobUrl,
|
|
@@ -38987,7 +39005,7 @@ function UserMessageBubble({ message, className }) {
|
|
|
38987
39005
|
)
|
|
38988
39006
|
},
|
|
38989
39007
|
`${att.uploadedPath}:${att.name}`
|
|
38990
|
-
) : blobUrl === null ? null : /* @__PURE__ */
|
|
39008
|
+
) : blobUrl === null ? null : /* @__PURE__ */ jsx35(
|
|
38991
39009
|
"div",
|
|
38992
39010
|
{
|
|
38993
39011
|
className: "flex h-20 items-center justify-center rounded-xl border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--muted)/0.3)] text-xs text-[hsl(var(--muted-foreground))]",
|
|
@@ -38997,7 +39015,7 @@ function UserMessageBubble({ message, className }) {
|
|
|
38997
39015
|
);
|
|
38998
39016
|
})
|
|
38999
39017
|
] }),
|
|
39000
|
-
lightboxImages.length > 0 && /* @__PURE__ */
|
|
39018
|
+
lightboxImages.length > 0 && /* @__PURE__ */ jsx35(
|
|
39001
39019
|
ImageLightbox,
|
|
39002
39020
|
{
|
|
39003
39021
|
open: lightboxIndex != null,
|
|
@@ -39008,15 +39026,15 @@ function UserMessageBubble({ message, className }) {
|
|
|
39008
39026
|
initialIndex: lightboxIndex ?? 0
|
|
39009
39027
|
}
|
|
39010
39028
|
),
|
|
39011
|
-
/* @__PURE__ */
|
|
39012
|
-
/* @__PURE__ */
|
|
39029
|
+
/* @__PURE__ */ jsx35(MessageFileAttachmentList, { files: fileParts }),
|
|
39030
|
+
/* @__PURE__ */ jsx35(
|
|
39013
39031
|
TextAttachmentPills,
|
|
39014
39032
|
{
|
|
39015
39033
|
attachments: nonImageTextAttachments,
|
|
39016
39034
|
onPreview: handleTextAttachmentPreview
|
|
39017
39035
|
}
|
|
39018
39036
|
),
|
|
39019
|
-
preview && /* @__PURE__ */
|
|
39037
|
+
preview && /* @__PURE__ */ jsx35(
|
|
39020
39038
|
AttachmentPreviewDialog,
|
|
39021
39039
|
{
|
|
39022
39040
|
open: preview != null,
|
|
@@ -39028,16 +39046,16 @@ function UserMessageBubble({ message, className }) {
|
|
|
39028
39046
|
mode: preview.mode
|
|
39029
39047
|
}
|
|
39030
39048
|
),
|
|
39031
|
-
/* @__PURE__ */
|
|
39049
|
+
/* @__PURE__ */ jsx35(MessageContextPills, { contexts: textContexts }),
|
|
39032
39050
|
pluginPills,
|
|
39033
39051
|
topicAssetPills,
|
|
39034
39052
|
trimmedClean && // 原型:不对称圆角(指向发送侧的一角收窄),无边框、无内阴影。
|
|
39035
|
-
(customBubble != null ? customBubble : /* @__PURE__ */
|
|
39053
|
+
(customBubble != null ? customBubble : /* @__PURE__ */ jsx35(
|
|
39036
39054
|
"div",
|
|
39037
39055
|
{
|
|
39038
39056
|
part: "user-bubble",
|
|
39039
39057
|
className: "blade-chat-user-bubble max-w-full rounded-[20px] rounded-br-[6px] border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-[18px] py-[13px] text-sm leading-[1.65] text-[hsl(var(--user-msg-fg))]",
|
|
39040
|
-
children: /* @__PURE__ */
|
|
39058
|
+
children: /* @__PURE__ */ jsx35(
|
|
39041
39059
|
MarkdownContent,
|
|
39042
39060
|
{
|
|
39043
39061
|
className: USER_MESSAGE_MARKDOWN_CLASS,
|
|
@@ -39047,10 +39065,10 @@ function UserMessageBubble({ message, className }) {
|
|
|
39047
39065
|
)
|
|
39048
39066
|
}
|
|
39049
39067
|
)),
|
|
39050
|
-
trimmedClean && (isSending(message) ? /* @__PURE__ */
|
|
39051
|
-
/* @__PURE__ */
|
|
39052
|
-
/* @__PURE__ */
|
|
39053
|
-
] }) : /* @__PURE__ */
|
|
39068
|
+
trimmedClean && (isSending(message) ? /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-1 pr-1 text-[11px] font-medium text-[hsl(var(--muted-foreground))/0.85]", children: [
|
|
39069
|
+
/* @__PURE__ */ jsx35(LoaderCircle, { size: 12, className: "animate-spin", "aria-hidden": "true" }),
|
|
39070
|
+
/* @__PURE__ */ jsx35("span", { children: "\u53D1\u9001\u4E2D" })
|
|
39071
|
+
] }) : /* @__PURE__ */ jsx35(
|
|
39054
39072
|
MessageActions,
|
|
39055
39073
|
{
|
|
39056
39074
|
content: cleanText,
|
|
@@ -39065,9 +39083,9 @@ function ErrorMessageBlock({
|
|
|
39065
39083
|
}) {
|
|
39066
39084
|
const text4 = chatErrorForDisplay(getTextContent(message.content));
|
|
39067
39085
|
const looksLikeModelUnavailable = /no source matches this model|404/i.test(text4);
|
|
39068
|
-
return /* @__PURE__ */
|
|
39086
|
+
return /* @__PURE__ */ jsx35("div", { part: "error-row", className: cn("blade-chat-error-row flex min-w-0 justify-start", className), children: /* @__PURE__ */ jsxs29("div", { className: "min-w-0 max-w-full whitespace-pre-wrap break-words border-l-[3px] border-[hsl(var(--border))] px-3 py-1 text-left text-sm leading-7 text-[hsl(var(--muted-foreground))] [overflow-wrap:anywhere]", children: [
|
|
39069
39087
|
text4,
|
|
39070
|
-
looksLikeModelUnavailable ? /* @__PURE__ */
|
|
39088
|
+
looksLikeModelUnavailable ? /* @__PURE__ */ jsx35("div", { className: "mt-1 opacity-80", children: "\u6A21\u578B\u53EF\u80FD\u672A\u542F\u52A8\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" }) : null
|
|
39071
39089
|
] }) });
|
|
39072
39090
|
}
|
|
39073
39091
|
|
|
@@ -39080,7 +39098,7 @@ function findLatestReasoningMessageIndex(messages) {
|
|
|
39080
39098
|
}
|
|
39081
39099
|
|
|
39082
39100
|
// src/chat/AgentLoopBlock.tsx
|
|
39083
|
-
import { Fragment as Fragment13, jsx as
|
|
39101
|
+
import { Fragment as Fragment13, jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
39084
39102
|
var COLLAPSED_SUMMARY_HIDDEN_TOOLS = /* @__PURE__ */ new Set(["ReadSkill", "Read"]);
|
|
39085
39103
|
function safeParseDescription(argsStr) {
|
|
39086
39104
|
try {
|
|
@@ -39183,7 +39201,7 @@ function AgentLoopBlock({
|
|
|
39183
39201
|
const status = hasAwaitingAnswer || toolCall.status === "awaiting_answer" && visibleLoopToolCalls.length === 0 ? "awaiting_answer" : toolCall.status === "pending" || loopEntry?.info.status === "running" ? "running" : toolCall.status === "error" || loopEntry?.info.status === "error" ? "error" : toolCall.status === "cancelled" || loopEntry?.info.status === "cancelled" ? "cancelled" : "done";
|
|
39184
39202
|
const latestReasoningIndex = status === "running" ? findLatestReasoningMessageIndex(childMessages) : -1;
|
|
39185
39203
|
const cardStyles = getLoopCardStyles(status);
|
|
39186
|
-
return /* @__PURE__ */
|
|
39204
|
+
return /* @__PURE__ */ jsxs30(
|
|
39187
39205
|
"div",
|
|
39188
39206
|
{
|
|
39189
39207
|
part: "agent-loop",
|
|
@@ -39192,8 +39210,8 @@ function AgentLoopBlock({
|
|
|
39192
39210
|
cardStyles.borderClass
|
|
39193
39211
|
),
|
|
39194
39212
|
children: [
|
|
39195
|
-
status === "running" || status === "awaiting_answer" ? /* @__PURE__ */
|
|
39196
|
-
/* @__PURE__ */
|
|
39213
|
+
status === "running" || status === "awaiting_answer" ? /* @__PURE__ */ jsxs30(Fragment13, { children: [
|
|
39214
|
+
/* @__PURE__ */ jsxs30(
|
|
39197
39215
|
"div",
|
|
39198
39216
|
{
|
|
39199
39217
|
className: cn(
|
|
@@ -39201,24 +39219,24 @@ function AgentLoopBlock({
|
|
|
39201
39219
|
cardStyles.headerClass
|
|
39202
39220
|
),
|
|
39203
39221
|
children: [
|
|
39204
|
-
/* @__PURE__ */
|
|
39222
|
+
/* @__PURE__ */ jsx36(
|
|
39205
39223
|
"button",
|
|
39206
39224
|
{
|
|
39207
39225
|
type: "button",
|
|
39208
39226
|
onClick: toggleExpanded,
|
|
39209
39227
|
"aria-expanded": expanded,
|
|
39210
39228
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
39211
|
-
children: /* @__PURE__ */
|
|
39212
|
-
status === "awaiting_answer" ? /* @__PURE__ */
|
|
39213
|
-
/* @__PURE__ */
|
|
39229
|
+
children: /* @__PURE__ */ jsxs30("span", { className: "min-w-0 flex items-center gap-2", children: [
|
|
39230
|
+
status === "awaiting_answer" ? /* @__PURE__ */ jsx36(MessageSquareMore, { size: 14, className: "shrink-0 text-[hsl(var(--swf-warning))] motion-safe:animate-pulse" }) : /* @__PURE__ */ jsx36(Bot, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
|
|
39231
|
+
/* @__PURE__ */ jsxs30("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: [
|
|
39214
39232
|
renderDescription ? renderDescription(description) : description,
|
|
39215
39233
|
status === "awaiting_answer" ? " \u2014 \u7B49\u5F85\u56DE\u7B54" : ""
|
|
39216
39234
|
] })
|
|
39217
39235
|
] })
|
|
39218
39236
|
}
|
|
39219
39237
|
),
|
|
39220
|
-
reasoning ? /* @__PURE__ */
|
|
39221
|
-
/* @__PURE__ */
|
|
39238
|
+
reasoning ? /* @__PURE__ */ jsx36(ThinkingBadge, { reasoning, variant: "block" }) : null,
|
|
39239
|
+
/* @__PURE__ */ jsx36(
|
|
39222
39240
|
Bot,
|
|
39223
39241
|
{
|
|
39224
39242
|
size: 14,
|
|
@@ -39226,14 +39244,14 @@ function AgentLoopBlock({
|
|
|
39226
39244
|
"aria-label": "\u5B50\u667A\u80FD\u4F53"
|
|
39227
39245
|
}
|
|
39228
39246
|
),
|
|
39229
|
-
/* @__PURE__ */
|
|
39247
|
+
/* @__PURE__ */ jsx36(
|
|
39230
39248
|
"button",
|
|
39231
39249
|
{
|
|
39232
39250
|
type: "button",
|
|
39233
39251
|
onClick: toggleExpanded,
|
|
39234
39252
|
"aria-expanded": expanded,
|
|
39235
39253
|
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--muted))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
39236
|
-
children: /* @__PURE__ */
|
|
39254
|
+
children: /* @__PURE__ */ jsx36(
|
|
39237
39255
|
ChevronRight,
|
|
39238
39256
|
{
|
|
39239
39257
|
size: 14,
|
|
@@ -39248,7 +39266,7 @@ function AgentLoopBlock({
|
|
|
39248
39266
|
]
|
|
39249
39267
|
}
|
|
39250
39268
|
),
|
|
39251
|
-
!expanded ? /* @__PURE__ */
|
|
39269
|
+
!expanded ? /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-1 py-2", children: visibleLoopToolCalls.length > 0 ? visibleLoopToolCalls.slice(-1).map((childToolCall) => /* @__PURE__ */ jsx36(
|
|
39252
39270
|
ToolCallBlock,
|
|
39253
39271
|
{
|
|
39254
39272
|
toolCall: childToolCall,
|
|
@@ -39256,12 +39274,12 @@ function AgentLoopBlock({
|
|
|
39256
39274
|
level: 2
|
|
39257
39275
|
},
|
|
39258
39276
|
childToolCall.id
|
|
39259
|
-
)) : /* @__PURE__ */
|
|
39260
|
-
/* @__PURE__ */
|
|
39261
|
-
/* @__PURE__ */
|
|
39262
|
-
] }) }) : status === "awaiting_answer" ? /* @__PURE__ */
|
|
39263
|
-
] }) : /* @__PURE__ */
|
|
39264
|
-
/* @__PURE__ */
|
|
39277
|
+
)) : /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
39278
|
+
/* @__PURE__ */ jsx36(LoaderCircle, { size: 12, className: "shrink-0 animate-spin text-[hsl(var(--muted-foreground))]" }),
|
|
39279
|
+
/* @__PURE__ */ jsx36("span", { children: "\u6B63\u5728\u542F\u52A8..." })
|
|
39280
|
+
] }) }) : status === "awaiting_answer" ? /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-1 py-2", children: /* @__PURE__ */ jsx36("div", { className: "px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: "\u8BF7\u5728\u4E0B\u65B9\u5B50\u667A\u80FD\u4F53\u5BF9\u8BDD\u4E2D\u5B8C\u6210\u786E\u8BA4" }) }) : null
|
|
39281
|
+
] }) : /* @__PURE__ */ jsxs30(Fragment13, { children: [
|
|
39282
|
+
/* @__PURE__ */ jsxs30(
|
|
39265
39283
|
"div",
|
|
39266
39284
|
{
|
|
39267
39285
|
className: cn(
|
|
@@ -39269,21 +39287,21 @@ function AgentLoopBlock({
|
|
|
39269
39287
|
cardStyles.headerClass
|
|
39270
39288
|
),
|
|
39271
39289
|
children: [
|
|
39272
|
-
/* @__PURE__ */
|
|
39290
|
+
/* @__PURE__ */ jsx36(
|
|
39273
39291
|
"button",
|
|
39274
39292
|
{
|
|
39275
39293
|
type: "button",
|
|
39276
39294
|
onClick: toggleExpanded,
|
|
39277
39295
|
"aria-expanded": expanded,
|
|
39278
39296
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
39279
|
-
children: /* @__PURE__ */
|
|
39280
|
-
status === "error" ? /* @__PURE__ */
|
|
39281
|
-
/* @__PURE__ */
|
|
39297
|
+
children: /* @__PURE__ */ jsxs30("span", { className: "min-w-0 flex items-center gap-2", children: [
|
|
39298
|
+
status === "error" ? /* @__PURE__ */ jsx36(X, { size: 14, className: cn("shrink-0", cardStyles.iconClass) }) : status === "cancelled" ? /* @__PURE__ */ jsx36(Ban, { size: 14, className: cn("shrink-0", cardStyles.iconClass) }) : /* @__PURE__ */ jsx36(Check, { size: 14, className: "shrink-0 text-[hsl(var(--swf-success))]" }),
|
|
39299
|
+
/* @__PURE__ */ jsx36("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: renderDescription ? renderDescription(description) : description })
|
|
39282
39300
|
] })
|
|
39283
39301
|
}
|
|
39284
39302
|
),
|
|
39285
|
-
reasoning ? /* @__PURE__ */
|
|
39286
|
-
/* @__PURE__ */
|
|
39303
|
+
reasoning ? /* @__PURE__ */ jsx36(ThinkingBadge, { reasoning, variant: "block" }) : null,
|
|
39304
|
+
/* @__PURE__ */ jsx36(
|
|
39287
39305
|
Bot,
|
|
39288
39306
|
{
|
|
39289
39307
|
size: 14,
|
|
@@ -39291,14 +39309,14 @@ function AgentLoopBlock({
|
|
|
39291
39309
|
"aria-label": "\u5B50\u667A\u80FD\u4F53"
|
|
39292
39310
|
}
|
|
39293
39311
|
),
|
|
39294
|
-
/* @__PURE__ */
|
|
39312
|
+
/* @__PURE__ */ jsx36(
|
|
39295
39313
|
"button",
|
|
39296
39314
|
{
|
|
39297
39315
|
type: "button",
|
|
39298
39316
|
onClick: toggleExpanded,
|
|
39299
39317
|
"aria-expanded": expanded,
|
|
39300
39318
|
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--muted))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
39301
|
-
children: /* @__PURE__ */
|
|
39319
|
+
children: /* @__PURE__ */ jsx36(
|
|
39302
39320
|
ChevronRight,
|
|
39303
39321
|
{
|
|
39304
39322
|
size: 14,
|
|
@@ -39313,20 +39331,20 @@ function AgentLoopBlock({
|
|
|
39313
39331
|
]
|
|
39314
39332
|
}
|
|
39315
39333
|
),
|
|
39316
|
-
!expanded ? /* @__PURE__ */
|
|
39317
|
-
/* @__PURE__ */
|
|
39318
|
-
(item) => item.kind === "file" ? /* @__PURE__ */
|
|
39334
|
+
!expanded ? /* @__PURE__ */ jsxs30(Fragment13, { children: [
|
|
39335
|
+
/* @__PURE__ */ jsx36("div", { className: "flex flex-wrap gap-1.5 px-4 py-2", children: completedToolLabels.length > 0 ? completedToolLabels.map(
|
|
39336
|
+
(item) => item.kind === "file" ? /* @__PURE__ */ jsxs30(
|
|
39319
39337
|
"span",
|
|
39320
39338
|
{
|
|
39321
39339
|
className: "inline-flex min-w-0 items-center gap-1 rounded-[6px] bg-[hsl(var(--muted))] px-2 py-0.5 text-xs font-medium text-[hsl(var(--secondary-foreground))]",
|
|
39322
39340
|
title: item.label,
|
|
39323
39341
|
children: [
|
|
39324
|
-
/* @__PURE__ */
|
|
39325
|
-
/* @__PURE__ */
|
|
39342
|
+
/* @__PURE__ */ jsx36(FileText, { size: 12, className: "shrink-0", "aria-hidden": "true" }),
|
|
39343
|
+
/* @__PURE__ */ jsx36("span", { className: "truncate", children: item.label })
|
|
39326
39344
|
]
|
|
39327
39345
|
},
|
|
39328
39346
|
item.key
|
|
39329
|
-
) : /* @__PURE__ */
|
|
39347
|
+
) : /* @__PURE__ */ jsx36(
|
|
39330
39348
|
"span",
|
|
39331
39349
|
{
|
|
39332
39350
|
className: "inline-flex items-center rounded-[6px] bg-[hsl(var(--muted))] px-2 py-0.5 text-xs font-medium text-[hsl(var(--secondary-foreground))]",
|
|
@@ -39334,20 +39352,20 @@ function AgentLoopBlock({
|
|
|
39334
39352
|
},
|
|
39335
39353
|
item.key
|
|
39336
39354
|
)
|
|
39337
|
-
) : /* @__PURE__ */
|
|
39338
|
-
inlineToolUiBlocks.length > 0 ? /* @__PURE__ */
|
|
39355
|
+
) : /* @__PURE__ */ jsx36("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u5DE5\u5177\u8C03\u7528" }) }),
|
|
39356
|
+
inlineToolUiBlocks.length > 0 ? /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-2 px-4 pb-3", children: inlineToolUiBlocks.map((block) => /* @__PURE__ */ jsx36(ToolUiCard, { card: block.card, sessionId }, block.key)) }) : null
|
|
39339
39357
|
] }) : null
|
|
39340
39358
|
] }),
|
|
39341
|
-
expanded && /* @__PURE__ */
|
|
39359
|
+
expanded && /* @__PURE__ */ jsxs30("div", { className: "border-t border-[hsl(var(--border))] py-2", children: [
|
|
39342
39360
|
(() => {
|
|
39343
39361
|
const taskPrompt = safeParsePrompt(toolCall.arguments);
|
|
39344
|
-
return taskPrompt ? /* @__PURE__ */
|
|
39345
|
-
/* @__PURE__ */
|
|
39346
|
-
/* @__PURE__ */
|
|
39362
|
+
return taskPrompt ? /* @__PURE__ */ jsxs30("details", { className: "mx-3 mb-2 rounded-md bg-[hsl(var(--muted))]/40", children: [
|
|
39363
|
+
/* @__PURE__ */ jsx36("summary", { className: "cursor-pointer px-3 py-1.5 text-[11px] font-medium text-[hsl(var(--muted-foreground))]", children: "\u4EFB\u52A1" }),
|
|
39364
|
+
/* @__PURE__ */ jsx36("div", { className: "px-3 pb-2", children: /* @__PURE__ */ jsx36("pre", { className: "whitespace-pre-wrap text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: taskPrompt }) })
|
|
39347
39365
|
] }) : null;
|
|
39348
39366
|
})(),
|
|
39349
|
-
childMessages.length > 0 ? /* @__PURE__ */
|
|
39350
|
-
(message, index2) => message.role === "assistant" ? /* @__PURE__ */
|
|
39367
|
+
childMessages.length > 0 ? /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-3 px-3", children: childMessages.map(
|
|
39368
|
+
(message, index2) => message.role === "assistant" ? /* @__PURE__ */ jsx36(
|
|
39351
39369
|
ExpandedChildAssistantMessage,
|
|
39352
39370
|
{
|
|
39353
39371
|
message,
|
|
@@ -39357,13 +39375,13 @@ function AgentLoopBlock({
|
|
|
39357
39375
|
hideAskUserQuestions
|
|
39358
39376
|
},
|
|
39359
39377
|
message.entry_id ?? `${message.timestamp ?? "child"}-${index2}`
|
|
39360
|
-
) : message.role === "user" ? /* @__PURE__ */
|
|
39378
|
+
) : message.role === "user" ? /* @__PURE__ */ jsx36(
|
|
39361
39379
|
ExpandedChildUserMessage,
|
|
39362
39380
|
{
|
|
39363
39381
|
message
|
|
39364
39382
|
},
|
|
39365
39383
|
message.entry_id ?? `${message.timestamp ?? "user"}-${index2}`
|
|
39366
|
-
) : message.role === "error" ? /* @__PURE__ */
|
|
39384
|
+
) : message.role === "error" ? /* @__PURE__ */ jsx36(
|
|
39367
39385
|
"div",
|
|
39368
39386
|
{
|
|
39369
39387
|
className: "border-l-[2px] border-l-[hsl(var(--border))] px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]",
|
|
@@ -39371,17 +39389,17 @@ function AgentLoopBlock({
|
|
|
39371
39389
|
},
|
|
39372
39390
|
message.entry_id ?? `${message.timestamp ?? "error"}-${index2}`
|
|
39373
39391
|
) : null
|
|
39374
|
-
) }) : status === "running" ? /* @__PURE__ */
|
|
39375
|
-
/* @__PURE__ */
|
|
39392
|
+
) }) : status === "running" ? /* @__PURE__ */ jsxs30("div", { className: "px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
|
|
39393
|
+
/* @__PURE__ */ jsx36(LoaderCircle, { size: 12, className: "mr-1.5 inline animate-spin" }),
|
|
39376
39394
|
"\u6B63\u5728\u542F\u52A8..."
|
|
39377
|
-
] }) : toolCall.result ? /* @__PURE__ */
|
|
39395
|
+
] }) : toolCall.result ? /* @__PURE__ */ jsx36("pre", { className: "max-h-[400px] overflow-auto px-3 py-2 whitespace-pre-wrap text-[11px] text-[hsl(var(--muted-foreground))]", children: typeof toolCall.result === "string" ? toolCall.result : JSON.stringify(toolCall.result, null, 2) }) : null
|
|
39378
39396
|
] })
|
|
39379
39397
|
]
|
|
39380
39398
|
}
|
|
39381
39399
|
);
|
|
39382
39400
|
}
|
|
39383
39401
|
function ExpandedChildUserMessage({ message }) {
|
|
39384
|
-
return /* @__PURE__ */
|
|
39402
|
+
return /* @__PURE__ */ jsx36("div", { className: "pl-8", children: /* @__PURE__ */ jsx36(UserMessageBubble, { message }) });
|
|
39385
39403
|
}
|
|
39386
39404
|
function ExpandedChildAssistantMessage({
|
|
39387
39405
|
message,
|
|
@@ -39395,12 +39413,12 @@ function ExpandedChildAssistantMessage({
|
|
|
39395
39413
|
(toolCall) => formatToolName(toolCall.name) !== "AskUserQuestion"
|
|
39396
39414
|
) : message.tool_calls ?? [];
|
|
39397
39415
|
const hasToolCalls = toolCalls.length > 0;
|
|
39398
|
-
return /* @__PURE__ */
|
|
39399
|
-
showReasoning && message.reasoning && /* @__PURE__ */
|
|
39400
|
-
/* @__PURE__ */
|
|
39401
|
-
/* @__PURE__ */
|
|
39416
|
+
return /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-2", children: [
|
|
39417
|
+
showReasoning && message.reasoning && /* @__PURE__ */ jsxs30(Reasoning, { isStreaming, children: [
|
|
39418
|
+
/* @__PURE__ */ jsx36(ReasoningTrigger, { wordCount: message.reasoning.length }),
|
|
39419
|
+
/* @__PURE__ */ jsx36(ReasoningContent, { children: message.reasoning })
|
|
39402
39420
|
] }),
|
|
39403
|
-
text4 ? /* @__PURE__ */
|
|
39421
|
+
text4 ? /* @__PURE__ */ jsx36(
|
|
39404
39422
|
ChildText,
|
|
39405
39423
|
{
|
|
39406
39424
|
text: text4,
|
|
@@ -39409,8 +39427,8 @@ function ExpandedChildAssistantMessage({
|
|
|
39409
39427
|
reasoning: void 0
|
|
39410
39428
|
}
|
|
39411
39429
|
) : null,
|
|
39412
|
-
hasToolCalls && /* @__PURE__ */
|
|
39413
|
-
(toolCall) => formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */
|
|
39430
|
+
hasToolCalls && /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-2", children: toolCalls.map(
|
|
39431
|
+
(toolCall) => formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx36(
|
|
39414
39432
|
AgentLoopBlock,
|
|
39415
39433
|
{
|
|
39416
39434
|
toolCall,
|
|
@@ -39419,7 +39437,7 @@ function ExpandedChildAssistantMessage({
|
|
|
39419
39437
|
hideAskUserQuestions
|
|
39420
39438
|
},
|
|
39421
39439
|
toolCall.id
|
|
39422
|
-
) : /* @__PURE__ */
|
|
39440
|
+
) : /* @__PURE__ */ jsx36(
|
|
39423
39441
|
ToolCallBlock,
|
|
39424
39442
|
{
|
|
39425
39443
|
toolCall,
|
|
@@ -39431,8 +39449,8 @@ function ExpandedChildAssistantMessage({
|
|
|
39431
39449
|
toolCall.id
|
|
39432
39450
|
)
|
|
39433
39451
|
) }),
|
|
39434
|
-
message.blocks?.some((block) => block.type === "tool_ui") ? /* @__PURE__ */
|
|
39435
|
-
(block, index2) => block.type === "tool_ui" && block.tool_call_id && isUiMeta(block.content) && block.content.target === "inline" ? /* @__PURE__ */
|
|
39452
|
+
message.blocks?.some((block) => block.type === "tool_ui") ? /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-2", children: message.blocks.map(
|
|
39453
|
+
(block, index2) => block.type === "tool_ui" && block.tool_call_id && isUiMeta(block.content) && block.content.target === "inline" ? /* @__PURE__ */ jsx36("div", { className: "ml-4", children: /* @__PURE__ */ jsx36(ToolUiCard, { card: block.content, sessionId }) }, `${block.tool_call_id}-${index2}`) : null
|
|
39436
39454
|
) }) : null
|
|
39437
39455
|
] });
|
|
39438
39456
|
}
|
|
@@ -39442,8 +39460,8 @@ function ChildText({
|
|
|
39442
39460
|
sessionId,
|
|
39443
39461
|
reasoning
|
|
39444
39462
|
}) {
|
|
39445
|
-
return /* @__PURE__ */
|
|
39446
|
-
/* @__PURE__ */
|
|
39463
|
+
return /* @__PURE__ */ jsxs30("div", { className: "pl-8 text-[12px] leading-6 text-[hsl(var(--foreground))]", children: [
|
|
39464
|
+
/* @__PURE__ */ jsx36(
|
|
39447
39465
|
MarkdownContent,
|
|
39448
39466
|
{
|
|
39449
39467
|
mode: isStreaming ? "streaming" : "static",
|
|
@@ -39453,8 +39471,8 @@ function ChildText({
|
|
|
39453
39471
|
children: text4
|
|
39454
39472
|
}
|
|
39455
39473
|
),
|
|
39456
|
-
isStreaming && /* @__PURE__ */
|
|
39457
|
-
reasoning ? /* @__PURE__ */
|
|
39474
|
+
isStreaming && /* @__PURE__ */ jsx36("span", { className: "ml-0.5 inline-block h-[1em] w-[3px] animate-pulse rounded-sm bg-current opacity-60" }),
|
|
39475
|
+
reasoning ? /* @__PURE__ */ jsx36(ThinkingBadge, { reasoning }) : null
|
|
39458
39476
|
] });
|
|
39459
39477
|
}
|
|
39460
39478
|
function getLoopCardStyles(status) {
|
|
@@ -39482,7 +39500,7 @@ function getLoopCardStyles(status) {
|
|
|
39482
39500
|
}
|
|
39483
39501
|
|
|
39484
39502
|
// src/chat/WorkflowRunBlock.tsx
|
|
39485
|
-
import { Fragment as Fragment14, jsx as
|
|
39503
|
+
import { Fragment as Fragment14, jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
39486
39504
|
var EMPTY_ENTRIES = [];
|
|
39487
39505
|
function synthToolCall(loopName, info, desc) {
|
|
39488
39506
|
return {
|
|
@@ -39527,10 +39545,10 @@ function stepStatus(group, runStatus) {
|
|
|
39527
39545
|
return runStatus === "done" ? "done" : void 0;
|
|
39528
39546
|
}
|
|
39529
39547
|
function StatusIcon({ status }) {
|
|
39530
|
-
if (status === "done") return /* @__PURE__ */
|
|
39531
|
-
if (status === "running") return /* @__PURE__ */
|
|
39532
|
-
if (status === "error") return /* @__PURE__ */
|
|
39533
|
-
if (status === "cancelled") return /* @__PURE__ */
|
|
39548
|
+
if (status === "done") return /* @__PURE__ */ jsx37(Check, { size: 13, className: "shrink-0 text-emerald-600", "aria-label": "\u5B8C\u6210" });
|
|
39549
|
+
if (status === "running") return /* @__PURE__ */ jsx37(LoaderCircle, { size: 13, className: "shrink-0 animate-spin text-[hsl(var(--muted-foreground))]", "aria-label": "\u8FDB\u884C\u4E2D" });
|
|
39550
|
+
if (status === "error") return /* @__PURE__ */ jsx37(X, { size: 13, className: "shrink-0 text-red-600", "aria-label": "\u5931\u8D25" });
|
|
39551
|
+
if (status === "cancelled") return /* @__PURE__ */ jsx37(CircleSlash, { size: 13, className: "shrink-0 text-[hsl(var(--muted-foreground))]", "aria-label": "\u5DF2\u53D6\u6D88" });
|
|
39534
39552
|
return null;
|
|
39535
39553
|
}
|
|
39536
39554
|
var CONTAINER_LABEL = { parallel: "\u5E76\u884C", choice: "\u6761\u4EF6", end: "\u7ED3\u675F" };
|
|
@@ -39543,7 +39561,7 @@ function meaningfulLogs(logs) {
|
|
|
39543
39561
|
}
|
|
39544
39562
|
function LogLines({ logs }) {
|
|
39545
39563
|
if (logs.length === 0) return null;
|
|
39546
|
-
return /* @__PURE__ */
|
|
39564
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex flex-col gap-0.5", children: logs.map((log, index2) => /* @__PURE__ */ jsx37(
|
|
39547
39565
|
"div",
|
|
39548
39566
|
{
|
|
39549
39567
|
className: "whitespace-pre-wrap break-words font-mono text-[11px] leading-[1.5] text-[hsl(var(--muted-foreground))]",
|
|
@@ -39574,7 +39592,7 @@ function RefTokenText({ text: text4, refs }) {
|
|
|
39574
39592
|
const id = match[1];
|
|
39575
39593
|
const info = refs.get(id);
|
|
39576
39594
|
parts.push(
|
|
39577
|
-
/* @__PURE__ */
|
|
39595
|
+
/* @__PURE__ */ jsxs31(
|
|
39578
39596
|
"span",
|
|
39579
39597
|
{
|
|
39580
39598
|
title: info?.value ? info.value.slice(0, 300) : "\u5C1A\u65E0\u8F93\u51FA",
|
|
@@ -39590,7 +39608,7 @@ function RefTokenText({ text: text4, refs }) {
|
|
|
39590
39608
|
cursor = match.index + match[0].length;
|
|
39591
39609
|
}
|
|
39592
39610
|
if (cursor < text4.length) parts.push(text4.slice(cursor));
|
|
39593
|
-
return /* @__PURE__ */
|
|
39611
|
+
return /* @__PURE__ */ jsx37(Fragment14, { children: parts });
|
|
39594
39612
|
}
|
|
39595
39613
|
function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
39596
39614
|
const run = useSessionState(sessionId, (state) => state.workflowRuns[toolCall.id]);
|
|
@@ -39638,7 +39656,7 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
39638
39656
|
});
|
|
39639
39657
|
return map3;
|
|
39640
39658
|
}, [toolCall.arguments, groups, groupLoops, sessionMessages]);
|
|
39641
|
-
const renderRefText = (text4) => /* @__PURE__ */
|
|
39659
|
+
const renderRefText = (text4) => /* @__PURE__ */ jsx37(RefTokenText, { text: text4, refs: refInfos });
|
|
39642
39660
|
const finalOutput = useMemo10(
|
|
39643
39661
|
() => output2.split("\n").filter((line) => !line.startsWith(LOG_PREFIX)).join("\n").trim(),
|
|
39644
39662
|
[output2]
|
|
@@ -39649,8 +39667,8 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
39649
39667
|
const title = run?.name || "\u6280\u80FD";
|
|
39650
39668
|
const statusSummary = running ? `\u8FDB\u884C\u4E2D \xB7 ${stepCount} \u6B65` : status === "error" ? `\u5931\u8D25 \xB7 ${stepCount} \u6B65` : status === "cancelled" ? `\u5DF2\u53D6\u6D88 \xB7 ${stepCount} \u6B65` : `\u5DF2\u5B8C\u6210 \xB7 ${stepCount} \u6B65`;
|
|
39651
39669
|
const hasStepContent = groups.length > 0 || stepLoops.length > 0;
|
|
39652
|
-
return /* @__PURE__ */
|
|
39653
|
-
/* @__PURE__ */
|
|
39670
|
+
return /* @__PURE__ */ jsxs31("div", { className: "msg-animate overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]/50", children: [
|
|
39671
|
+
/* @__PURE__ */ jsxs31(
|
|
39654
39672
|
"button",
|
|
39655
39673
|
{
|
|
39656
39674
|
type: "button",
|
|
@@ -39658,16 +39676,16 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
39658
39676
|
"aria-expanded": !collapsed,
|
|
39659
39677
|
className: "flex w-full items-center gap-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--primary)/0.06)] px-4 py-2.5 text-left transition-colors hover:bg-[hsl(var(--primary)/0.1)] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
39660
39678
|
children: [
|
|
39661
|
-
/* @__PURE__ */
|
|
39662
|
-
/* @__PURE__ */
|
|
39679
|
+
/* @__PURE__ */ jsx37(Zap, { size: 15, className: "shrink-0 text-violet-600" }),
|
|
39680
|
+
/* @__PURE__ */ jsxs31("span", { className: "min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: [
|
|
39663
39681
|
"\u56FA\u5B9A\u6D41\u7A0B \xB7 ",
|
|
39664
39682
|
title
|
|
39665
39683
|
] }),
|
|
39666
|
-
/* @__PURE__ */
|
|
39667
|
-
running ? /* @__PURE__ */
|
|
39684
|
+
/* @__PURE__ */ jsxs31("span", { className: "ml-auto flex shrink-0 items-center gap-1.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
39685
|
+
running ? /* @__PURE__ */ jsx37(LoaderCircle, { size: 12, className: "animate-spin" }) : null,
|
|
39668
39686
|
statusSummary
|
|
39669
39687
|
] }),
|
|
39670
|
-
/* @__PURE__ */
|
|
39688
|
+
/* @__PURE__ */ jsx37(
|
|
39671
39689
|
ChevronRight,
|
|
39672
39690
|
{
|
|
39673
39691
|
size: 15,
|
|
@@ -39680,14 +39698,14 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
39680
39698
|
]
|
|
39681
39699
|
}
|
|
39682
39700
|
),
|
|
39683
|
-
!collapsed && /* @__PURE__ */
|
|
39684
|
-
/* @__PURE__ */
|
|
39701
|
+
!collapsed && /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-2 p-3", children: [
|
|
39702
|
+
/* @__PURE__ */ jsx37(LogLines, { logs: meaningfulLogs(prelude) }),
|
|
39685
39703
|
groups.map((group, index2) => {
|
|
39686
39704
|
const loop = groupLoops[index2];
|
|
39687
39705
|
const logs = meaningfulLogs(group.logs);
|
|
39688
39706
|
if (loop) {
|
|
39689
|
-
return /* @__PURE__ */
|
|
39690
|
-
/* @__PURE__ */
|
|
39707
|
+
return /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
|
|
39708
|
+
/* @__PURE__ */ jsx37(
|
|
39691
39709
|
AgentLoopBlock,
|
|
39692
39710
|
{
|
|
39693
39711
|
toolCall: synthToolCall(loop.loopName, loop.info, group.desc),
|
|
@@ -39696,11 +39714,11 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
39696
39714
|
renderDescription: renderRefText
|
|
39697
39715
|
}
|
|
39698
39716
|
),
|
|
39699
|
-
/* @__PURE__ */
|
|
39717
|
+
/* @__PURE__ */ jsx37(LogLines, { logs })
|
|
39700
39718
|
] }, group.key);
|
|
39701
39719
|
}
|
|
39702
39720
|
const container = CONTAINER_LABEL[group.stepKind];
|
|
39703
|
-
return /* @__PURE__ */
|
|
39721
|
+
return /* @__PURE__ */ jsxs31(
|
|
39704
39722
|
"div",
|
|
39705
39723
|
{
|
|
39706
39724
|
className: cn(
|
|
@@ -39708,18 +39726,18 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
39708
39726
|
container ? "border border-dashed border-violet-400/50 bg-violet-500/5" : "border border-[hsl(var(--border))] bg-[hsl(var(--card))]"
|
|
39709
39727
|
),
|
|
39710
39728
|
children: [
|
|
39711
|
-
/* @__PURE__ */
|
|
39712
|
-
/* @__PURE__ */
|
|
39713
|
-
container ? /* @__PURE__ */
|
|
39714
|
-
/* @__PURE__ */
|
|
39729
|
+
/* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1.5 text-sm text-[hsl(var(--foreground))]", children: [
|
|
39730
|
+
/* @__PURE__ */ jsx37(StatusIcon, { status: stepStatus(group, status) }),
|
|
39731
|
+
container ? /* @__PURE__ */ jsx37("span", { className: "text-[11px] font-semibold text-violet-600", children: container }) : null,
|
|
39732
|
+
/* @__PURE__ */ jsx37("span", { className: "min-w-0 truncate", children: renderRefText(group.desc || group.stepId) })
|
|
39715
39733
|
] }),
|
|
39716
|
-
/* @__PURE__ */
|
|
39734
|
+
/* @__PURE__ */ jsx37(LogLines, { logs })
|
|
39717
39735
|
]
|
|
39718
39736
|
},
|
|
39719
39737
|
group.key
|
|
39720
39738
|
);
|
|
39721
39739
|
}),
|
|
39722
|
-
leftoverLoops.map((step) => /* @__PURE__ */
|
|
39740
|
+
leftoverLoops.map((step) => /* @__PURE__ */ jsx37(
|
|
39723
39741
|
AgentLoopBlock,
|
|
39724
39742
|
{
|
|
39725
39743
|
toolCall: synthToolCall(step.loopName, step.info),
|
|
@@ -39729,13 +39747,13 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
39729
39747
|
},
|
|
39730
39748
|
step.loopName
|
|
39731
39749
|
)),
|
|
39732
|
-
(!hasStepContent && output2 || status === "error" && output2) && /* @__PURE__ */
|
|
39733
|
-
status === "done" && hasStepContent && finalOutput && /* @__PURE__ */
|
|
39734
|
-
/* @__PURE__ */
|
|
39735
|
-
/* @__PURE__ */
|
|
39750
|
+
(!hasStepContent && output2 || status === "error" && output2) && /* @__PURE__ */ jsx37("pre", { className: "max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-[hsl(var(--border))] px-3 py-2 font-mono text-[11px] leading-[1.5] text-[hsl(var(--muted-foreground))]", children: output2 }),
|
|
39751
|
+
status === "done" && hasStepContent && finalOutput && /* @__PURE__ */ jsxs31("details", { className: "rounded-lg border border-[hsl(var(--border))] px-3 py-2", children: [
|
|
39752
|
+
/* @__PURE__ */ jsx37("summary", { className: "cursor-pointer select-none text-xs text-[hsl(var(--muted-foreground))]", children: "\u6700\u7EC8\u8F93\u51FA" }),
|
|
39753
|
+
/* @__PURE__ */ jsx37("pre", { className: "mt-1.5 max-h-48 overflow-y-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-[1.5] text-[hsl(var(--muted-foreground))]", children: finalOutput })
|
|
39736
39754
|
] }),
|
|
39737
39755
|
status === "done" && hasStepContent && // 统一的终止行:正常跑完(不管是 end 节点还是自然走完)都有,观感一致
|
|
39738
|
-
/* @__PURE__ */
|
|
39756
|
+
/* @__PURE__ */ jsx37("div", { className: "py-0.5 text-center text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u23F9 \u6D41\u7A0B\u5230\u6B64\u7ED3\u675F" })
|
|
39739
39757
|
] })
|
|
39740
39758
|
] });
|
|
39741
39759
|
}
|
|
@@ -39793,7 +39811,7 @@ function toolCallAnswered(toolCall, sessionStatus, answerData) {
|
|
|
39793
39811
|
}
|
|
39794
39812
|
|
|
39795
39813
|
// src/chat/AssistantTurnBlock.tsx
|
|
39796
|
-
import { jsx as
|
|
39814
|
+
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
39797
39815
|
var EMPTY_MESSAGES = [];
|
|
39798
39816
|
var EMPTY_AGENT_LOOPS = {};
|
|
39799
39817
|
var turnDisplayModeMemory = /* @__PURE__ */ new Map();
|
|
@@ -40107,7 +40125,7 @@ function AssistantTurnBlockBase({
|
|
|
40107
40125
|
if (observedMemoryRefs.length > 0) setCachedMemoryRefs(observedMemoryRefs);
|
|
40108
40126
|
}, [observedMemoryRefs]);
|
|
40109
40127
|
const memoryRefs = observedMemoryRefs.length > 0 ? observedMemoryRefs : cachedMemoryRefs;
|
|
40110
|
-
return /* @__PURE__ */
|
|
40128
|
+
return /* @__PURE__ */ jsxs32(
|
|
40111
40129
|
"div",
|
|
40112
40130
|
{
|
|
40113
40131
|
"aria-busy": isStreaming || void 0,
|
|
@@ -40118,20 +40136,20 @@ function AssistantTurnBlockBase({
|
|
|
40118
40136
|
customization?.classNames?.assistantTurn
|
|
40119
40137
|
),
|
|
40120
40138
|
children: [
|
|
40121
|
-
memoryRefs.length > 0 && /* @__PURE__ */
|
|
40122
|
-
hasInterruptedState && /* @__PURE__ */
|
|
40123
|
-
hasFailedWithoutContent && /* @__PURE__ */
|
|
40124
|
-
hasExecutionProcess && /* @__PURE__ */
|
|
40125
|
-
/* @__PURE__ */
|
|
40139
|
+
memoryRefs.length > 0 && /* @__PURE__ */ jsx38(MemoryRefsHint, { refs: memoryRefs }),
|
|
40140
|
+
hasInterruptedState && /* @__PURE__ */ jsx38("div", { className: "ml-4 w-fit rounded-full border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--swf-warning))]", children: "\u5DF2\u4E2D\u65AD" }),
|
|
40141
|
+
hasFailedWithoutContent && /* @__PURE__ */ jsx38("div", { className: "ml-4 w-fit rounded-full border border-[hsl(var(--destructive)/0.3)] bg-[hsl(var(--destructive)/0.1)] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--destructive))]", children: "\u751F\u6210\u5931\u8D25" }),
|
|
40142
|
+
hasExecutionProcess && /* @__PURE__ */ jsxs32("div", { className: "flex w-full items-start gap-2.5", children: [
|
|
40143
|
+
/* @__PURE__ */ jsx38(
|
|
40126
40144
|
"span",
|
|
40127
40145
|
{
|
|
40128
40146
|
className: "grid size-[30px] shrink-0 place-items-center rounded-full bg-[hsl(var(--muted)/0.55)] text-[hsl(var(--foreground))]",
|
|
40129
40147
|
"aria-hidden": "true",
|
|
40130
|
-
children: /* @__PURE__ */
|
|
40148
|
+
children: /* @__PURE__ */ jsx38(Bot, { size: 16 })
|
|
40131
40149
|
}
|
|
40132
40150
|
),
|
|
40133
|
-
/* @__PURE__ */
|
|
40134
|
-
/* @__PURE__ */
|
|
40151
|
+
/* @__PURE__ */ jsxs32("div", { className: "min-w-0 flex-1 pt-0.5", children: [
|
|
40152
|
+
/* @__PURE__ */ jsxs32(
|
|
40135
40153
|
"button",
|
|
40136
40154
|
{
|
|
40137
40155
|
type: "button",
|
|
@@ -40145,14 +40163,14 @@ function AssistantTurnBlockBase({
|
|
|
40145
40163
|
"data-testid": "assistant-execution-summary",
|
|
40146
40164
|
className: "inline-flex min-w-0 max-w-full select-none items-center gap-1 bg-transparent p-0 text-left text-xs leading-[22px] text-[hsl(var(--muted-foreground))] transition-colors hover:text-[hsl(var(--foreground))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
40147
40165
|
children: [
|
|
40148
|
-
/* @__PURE__ */
|
|
40166
|
+
/* @__PURE__ */ jsx38("span", { className: "min-w-0 truncate", children: executionSummaryLabel({
|
|
40149
40167
|
messages: assistantTurnMessages,
|
|
40150
40168
|
isStreaming,
|
|
40151
40169
|
durationMs: liveExecutionDurationMs,
|
|
40152
40170
|
sessionStatus,
|
|
40153
40171
|
askAnswers
|
|
40154
40172
|
}) }),
|
|
40155
|
-
/* @__PURE__ */
|
|
40173
|
+
/* @__PURE__ */ jsx38(
|
|
40156
40174
|
ChevronRight,
|
|
40157
40175
|
{
|
|
40158
40176
|
size: 14,
|
|
@@ -40170,11 +40188,11 @@ function AssistantTurnBlockBase({
|
|
|
40170
40188
|
]
|
|
40171
40189
|
}
|
|
40172
40190
|
),
|
|
40173
|
-
/* @__PURE__ */
|
|
40191
|
+
/* @__PURE__ */ jsx38("div", { className: "mt-3 h-px w-full bg-[hsl(var(--border)/0.75)]" })
|
|
40174
40192
|
] })
|
|
40175
40193
|
] }),
|
|
40176
|
-
hasExecutionProcess && effectiveMode === "detail" ? /* @__PURE__ */
|
|
40177
|
-
/* @__PURE__ */
|
|
40194
|
+
hasExecutionProcess && effectiveMode === "detail" ? /* @__PURE__ */ jsxs32("div", { className: "ml-10 flex flex-col gap-1", children: [
|
|
40195
|
+
/* @__PURE__ */ jsx38(
|
|
40178
40196
|
AssistantMessages,
|
|
40179
40197
|
{
|
|
40180
40198
|
messages: assistantTurnMessages,
|
|
@@ -40192,7 +40210,7 @@ function AssistantTurnBlockBase({
|
|
|
40192
40210
|
customization
|
|
40193
40211
|
}
|
|
40194
40212
|
),
|
|
40195
|
-
workflowRunToolCalls.map((workflowToolCall) => /* @__PURE__ */
|
|
40213
|
+
workflowRunToolCalls.map((workflowToolCall) => /* @__PURE__ */ jsx38(
|
|
40196
40214
|
WorkflowRunBlock,
|
|
40197
40215
|
{
|
|
40198
40216
|
toolCall: workflowToolCall,
|
|
@@ -40201,8 +40219,8 @@ function AssistantTurnBlockBase({
|
|
|
40201
40219
|
workflowToolCall.id
|
|
40202
40220
|
))
|
|
40203
40221
|
] }) : null,
|
|
40204
|
-
resourceBlocks.some((block) => !compactOrderedToolIds.has(block.toolCallId)) ? /* @__PURE__ */
|
|
40205
|
-
previewToolCalls.some(({ toolCall }) => !compactOrderedToolIds.has(toolCall.id)) ? /* @__PURE__ */
|
|
40222
|
+
resourceBlocks.some((block) => !compactOrderedToolIds.has(block.toolCallId)) ? /* @__PURE__ */ jsx38("div", { className: "ml-10 flex flex-col gap-3", children: resourceBlocks.filter((block) => !compactOrderedToolIds.has(block.toolCallId)).map((block) => /* @__PURE__ */ jsx38(ToolUiCard, { card: block.card, sessionId }, block.key)) }) : null,
|
|
40223
|
+
previewToolCalls.some(({ toolCall }) => !compactOrderedToolIds.has(toolCall.id)) ? /* @__PURE__ */ jsx38("div", { className: "ml-10 flex flex-wrap gap-x-3 gap-y-1", children: previewToolCalls.filter(({ toolCall }) => !compactOrderedToolIds.has(toolCall.id)).map(({ key, toolCall, blocks }) => /* @__PURE__ */ jsx38(
|
|
40206
40224
|
ToolPreviewAction,
|
|
40207
40225
|
{
|
|
40208
40226
|
toolCall,
|
|
@@ -40212,7 +40230,7 @@ function AssistantTurnBlockBase({
|
|
|
40212
40230
|
},
|
|
40213
40231
|
key
|
|
40214
40232
|
)) }) : null,
|
|
40215
|
-
isDeveloperMode && fileToolCalls.some((toolCall) => !compactOrderedToolIds.has(toolCall.id)) ? /* @__PURE__ */
|
|
40233
|
+
isDeveloperMode && fileToolCalls.some((toolCall) => !compactOrderedToolIds.has(toolCall.id)) ? /* @__PURE__ */ jsx38("div", { className: "ml-10 flex flex-wrap gap-x-3 gap-y-1", children: fileToolCalls.filter((toolCall) => !compactOrderedToolIds.has(toolCall.id)).map((toolCall) => /* @__PURE__ */ jsx38(
|
|
40216
40234
|
ToolFilePreviewAction,
|
|
40217
40235
|
{
|
|
40218
40236
|
toolCall,
|
|
@@ -40221,7 +40239,7 @@ function AssistantTurnBlockBase({
|
|
|
40221
40239
|
},
|
|
40222
40240
|
toolCall.id
|
|
40223
40241
|
)) }) : null,
|
|
40224
|
-
effectiveMode === "compact" && finalMessage && finalOrderedParts.length > 0 ? /* @__PURE__ */
|
|
40242
|
+
effectiveMode === "compact" && finalMessage && finalOrderedParts.length > 0 ? /* @__PURE__ */ jsx38("div", { className: "ml-10 flex flex-col gap-3", children: finalOrderedParts.map((part) => part.type === "text" ? /* @__PURE__ */ jsx38(
|
|
40225
40243
|
AssistantMessageContent,
|
|
40226
40244
|
{
|
|
40227
40245
|
message: { ...finalMessage, content: part.content },
|
|
@@ -40232,12 +40250,12 @@ function AssistantTurnBlockBase({
|
|
|
40232
40250
|
toolCalls: turnToolCalls
|
|
40233
40251
|
},
|
|
40234
40252
|
part.key
|
|
40235
|
-
) : /* @__PURE__ */
|
|
40236
|
-
...resourceBlocks.filter((block) => block.toolCallId === toolCall.id).map((block) => /* @__PURE__ */
|
|
40237
|
-
...previewToolCalls.filter((item) => item.toolCall.id === toolCall.id).map(({ key, toolCall: previewToolCall, blocks }) => /* @__PURE__ */
|
|
40238
|
-
...fileToolCalls.filter((fileToolCall) => fileToolCall.id === toolCall.id).map((fileToolCall) => /* @__PURE__ */
|
|
40253
|
+
) : /* @__PURE__ */ jsx38("div", { className: "flex flex-col gap-3", children: part.toolCalls.flatMap((toolCall) => [
|
|
40254
|
+
...resourceBlocks.filter((block) => block.toolCallId === toolCall.id).map((block) => /* @__PURE__ */ jsx38(ToolUiCard, { card: block.card, sessionId }, block.key)),
|
|
40255
|
+
...previewToolCalls.filter((item) => item.toolCall.id === toolCall.id).map(({ key, toolCall: previewToolCall, blocks }) => /* @__PURE__ */ jsx38(ToolPreviewAction, { toolCall: previewToolCall, sessionId, turnBlocks: blocks, className: "text-xs leading-[22px]" }, key)),
|
|
40256
|
+
...fileToolCalls.filter((fileToolCall) => fileToolCall.id === toolCall.id).map((fileToolCall) => /* @__PURE__ */ jsx38(ToolFilePreviewAction, { toolCall: fileToolCall, sessionId, className: "max-w-full text-xs leading-[22px] text-[hsl(var(--swf-link-text))]" }, fileToolCall.id))
|
|
40239
40257
|
]) }, part.key)) }) : null,
|
|
40240
|
-
finalMessage && finalOrderedParts.length === 0 ? /* @__PURE__ */
|
|
40258
|
+
finalMessage && finalOrderedParts.length === 0 ? /* @__PURE__ */ jsx38("div", { className: "ml-10", children: /* @__PURE__ */ jsx38(
|
|
40241
40259
|
AssistantMessageContent,
|
|
40242
40260
|
{
|
|
40243
40261
|
message: finalMessage,
|
|
@@ -40248,7 +40266,7 @@ function AssistantTurnBlockBase({
|
|
|
40248
40266
|
toolCalls: turnToolCalls
|
|
40249
40267
|
}
|
|
40250
40268
|
) }) : null,
|
|
40251
|
-
/* @__PURE__ */
|
|
40269
|
+
/* @__PURE__ */ jsx38(
|
|
40252
40270
|
PersistentAskUserQuestions,
|
|
40253
40271
|
{
|
|
40254
40272
|
questions: persistentAskUserQuestions,
|
|
@@ -40261,10 +40279,10 @@ function AssistantTurnBlockBase({
|
|
|
40261
40279
|
}
|
|
40262
40280
|
),
|
|
40263
40281
|
SHOW_FILE_DELIVERY_CARDS && level === 1 && // 用合并后的轮次消息:子智能体(fork Agent)写入的文件也要出交付卡片。
|
|
40264
|
-
/* @__PURE__ */
|
|
40282
|
+
/* @__PURE__ */ jsx38(FileDeliveryCards, { toolCalls: turnToolCalls, sessionId }),
|
|
40265
40283
|
level === 1 && !isStreaming && finalMessageText ? (
|
|
40266
40284
|
// 反馈行(原型):轮次底部的复制入口。
|
|
40267
|
-
/* @__PURE__ */
|
|
40285
|
+
/* @__PURE__ */ jsx38(MessageActions, { content: finalMessageText, className: "-mt-1.5" })
|
|
40268
40286
|
) : null
|
|
40269
40287
|
]
|
|
40270
40288
|
}
|
|
@@ -40285,7 +40303,7 @@ function PersistentAskUserQuestions({
|
|
|
40285
40303
|
}) {
|
|
40286
40304
|
const activeQuestionId = questions.filter(({ toolCall }) => toolCall.status === "pending").at(-1)?.toolCall.id;
|
|
40287
40305
|
return questions.map(
|
|
40288
|
-
({ toolCall, turnBlocks }) => customization?.components?.ToolCall ? /* @__PURE__ */
|
|
40306
|
+
({ toolCall, turnBlocks }) => customization?.components?.ToolCall ? /* @__PURE__ */ jsx38(
|
|
40289
40307
|
customization.components.ToolCall,
|
|
40290
40308
|
{
|
|
40291
40309
|
toolCall,
|
|
@@ -40299,7 +40317,7 @@ function PersistentAskUserQuestions({
|
|
|
40299
40317
|
customization
|
|
40300
40318
|
},
|
|
40301
40319
|
toolCall.id
|
|
40302
|
-
) : /* @__PURE__ */
|
|
40320
|
+
) : /* @__PURE__ */ jsx38(
|
|
40303
40321
|
ToolCallBlock,
|
|
40304
40322
|
{
|
|
40305
40323
|
toolCall,
|
|
@@ -40327,9 +40345,9 @@ function DetailedToolCallList({
|
|
|
40327
40345
|
level,
|
|
40328
40346
|
customization
|
|
40329
40347
|
}) {
|
|
40330
|
-
return /* @__PURE__ */
|
|
40348
|
+
return /* @__PURE__ */ jsx38("div", { className: "flex flex-col gap-1", children: groupDetailedToolCalls(toolCalls).map((item) => {
|
|
40331
40349
|
if (item.kind === "read_group") {
|
|
40332
|
-
return /* @__PURE__ */
|
|
40350
|
+
return /* @__PURE__ */ jsx38(
|
|
40333
40351
|
CompactToolGroupBlock,
|
|
40334
40352
|
{
|
|
40335
40353
|
toolCalls: item.toolCalls,
|
|
@@ -40347,7 +40365,7 @@ function DetailedToolCallList({
|
|
|
40347
40365
|
}
|
|
40348
40366
|
const { toolCall } = item;
|
|
40349
40367
|
if (isWorkflowRunToolName2(toolCall.name)) return null;
|
|
40350
|
-
return customization?.components?.ToolCall ? /* @__PURE__ */
|
|
40368
|
+
return customization?.components?.ToolCall ? /* @__PURE__ */ jsx38(
|
|
40351
40369
|
customization.components.ToolCall,
|
|
40352
40370
|
{
|
|
40353
40371
|
toolCall,
|
|
@@ -40362,7 +40380,7 @@ function DetailedToolCallList({
|
|
|
40362
40380
|
customization
|
|
40363
40381
|
},
|
|
40364
40382
|
toolCall.id
|
|
40365
|
-
) : /* @__PURE__ */
|
|
40383
|
+
) : /* @__PURE__ */ jsx38(
|
|
40366
40384
|
ToolCallBlock,
|
|
40367
40385
|
{
|
|
40368
40386
|
toolCall,
|
|
@@ -40407,32 +40425,32 @@ function AssistantMessages({
|
|
|
40407
40425
|
);
|
|
40408
40426
|
const hasToolCalls = toolCalls.length > 0;
|
|
40409
40427
|
const orderedParts = getOrderedMessageParts(message, toolCalls);
|
|
40410
|
-
return /* @__PURE__ */
|
|
40428
|
+
return /* @__PURE__ */ jsxs32(
|
|
40411
40429
|
"div",
|
|
40412
40430
|
{
|
|
40413
40431
|
className: "flex flex-col gap-1",
|
|
40414
40432
|
children: [
|
|
40415
|
-
showReasoning && /* @__PURE__ */
|
|
40433
|
+
showReasoning && /* @__PURE__ */ jsxs32(
|
|
40416
40434
|
Reasoning,
|
|
40417
40435
|
{
|
|
40418
40436
|
isStreaming: isReasoningStreamingLastMessage,
|
|
40419
40437
|
part: "thinking",
|
|
40420
40438
|
className: "blade-chat-thinking",
|
|
40421
40439
|
children: [
|
|
40422
|
-
/* @__PURE__ */
|
|
40440
|
+
/* @__PURE__ */ jsx38(
|
|
40423
40441
|
ReasoningTrigger,
|
|
40424
40442
|
{
|
|
40425
40443
|
wordCount: reasoning.length,
|
|
40426
40444
|
className: "gap-1 rounded-none p-0 text-xs leading-[22px]",
|
|
40427
|
-
children: /* @__PURE__ */
|
|
40445
|
+
children: /* @__PURE__ */ jsx38("span", { children: isReasoningStreamingLastMessage ? "\u6B63\u5728\u601D\u8003" : "\u5DF2\u601D\u8003" })
|
|
40428
40446
|
}
|
|
40429
40447
|
),
|
|
40430
|
-
/* @__PURE__ */
|
|
40448
|
+
/* @__PURE__ */ jsx38(ReasoningContent, { className: "mt-1.5 rounded-none border-0 bg-transparent px-0 py-0 text-xs leading-[22px]", children: reasoning })
|
|
40431
40449
|
]
|
|
40432
40450
|
}
|
|
40433
40451
|
),
|
|
40434
40452
|
orderedParts.length > 0 ? orderedParts.map(
|
|
40435
|
-
(part) => part.type === "text" ? /* @__PURE__ */
|
|
40453
|
+
(part) => part.type === "text" ? /* @__PURE__ */ jsx38(
|
|
40436
40454
|
AssistantMessageContent,
|
|
40437
40455
|
{
|
|
40438
40456
|
message: { ...message, content: part.content },
|
|
@@ -40447,7 +40465,7 @@ function AssistantMessages({
|
|
|
40447
40465
|
)
|
|
40448
40466
|
},
|
|
40449
40467
|
part.key
|
|
40450
|
-
) : showToolDetails ? /* @__PURE__ */
|
|
40468
|
+
) : showToolDetails ? /* @__PURE__ */ jsx38(
|
|
40451
40469
|
DetailedToolCallList,
|
|
40452
40470
|
{
|
|
40453
40471
|
toolCalls: part.toolCalls,
|
|
@@ -40461,7 +40479,7 @@ function AssistantMessages({
|
|
|
40461
40479
|
},
|
|
40462
40480
|
part.key
|
|
40463
40481
|
) : null
|
|
40464
|
-
) : message !== hideMessageContentFor ? /* @__PURE__ */
|
|
40482
|
+
) : message !== hideMessageContentFor ? /* @__PURE__ */ jsx38(
|
|
40465
40483
|
AssistantMessageContent,
|
|
40466
40484
|
{
|
|
40467
40485
|
message,
|
|
@@ -40476,7 +40494,7 @@ function AssistantMessages({
|
|
|
40476
40494
|
compact: true
|
|
40477
40495
|
}
|
|
40478
40496
|
) : null,
|
|
40479
|
-
orderedParts.length === 0 && hasToolCalls && showToolDetails ? /* @__PURE__ */
|
|
40497
|
+
orderedParts.length === 0 && hasToolCalls && showToolDetails ? /* @__PURE__ */ jsx38(
|
|
40480
40498
|
DetailedToolCallList,
|
|
40481
40499
|
{
|
|
40482
40500
|
toolCalls,
|
|
@@ -40521,11 +40539,11 @@ function CompactToolGroupBlock({
|
|
|
40521
40539
|
level,
|
|
40522
40540
|
customization
|
|
40523
40541
|
}) {
|
|
40524
|
-
return /* @__PURE__ */
|
|
40542
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
40525
40543
|
toolCalls.map((toolCall) => {
|
|
40526
40544
|
if (isWorkflowRunToolName2(toolCall.name)) return null;
|
|
40527
40545
|
const CustomToolCall = customization?.components?.ToolCall;
|
|
40528
|
-
return CustomToolCall ? /* @__PURE__ */
|
|
40546
|
+
return CustomToolCall ? /* @__PURE__ */ jsx38(
|
|
40529
40547
|
CustomToolCall,
|
|
40530
40548
|
{
|
|
40531
40549
|
toolCall,
|
|
@@ -40539,7 +40557,7 @@ function CompactToolGroupBlock({
|
|
|
40539
40557
|
customization
|
|
40540
40558
|
},
|
|
40541
40559
|
toolCall.id
|
|
40542
|
-
) : /* @__PURE__ */
|
|
40560
|
+
) : /* @__PURE__ */ jsx38(
|
|
40543
40561
|
ToolCallBlock,
|
|
40544
40562
|
{
|
|
40545
40563
|
toolCall,
|
|
@@ -40556,7 +40574,7 @@ function CompactToolGroupBlock({
|
|
|
40556
40574
|
toolCall.id
|
|
40557
40575
|
);
|
|
40558
40576
|
}),
|
|
40559
|
-
reasoning ? /* @__PURE__ */
|
|
40577
|
+
reasoning ? /* @__PURE__ */ jsx38(ThinkingBadge, { reasoning, variant: "block" }) : null
|
|
40560
40578
|
] });
|
|
40561
40579
|
}
|
|
40562
40580
|
function AssistantMessageContent({
|
|
@@ -40582,9 +40600,9 @@ function AssistantMessageContent({
|
|
|
40582
40600
|
if (!text4 && imageParts.length === 0 && fileParts.length === 0 && !reasoning && !failed) {
|
|
40583
40601
|
return null;
|
|
40584
40602
|
}
|
|
40585
|
-
return /* @__PURE__ */
|
|
40586
|
-
failed ? /* @__PURE__ */
|
|
40587
|
-
imageParts.length > 0 && /* @__PURE__ */
|
|
40603
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-3", children: [
|
|
40604
|
+
failed ? /* @__PURE__ */ jsx38("div", { className: "w-fit rounded-full border border-[hsl(var(--destructive)/0.3)] bg-[hsl(var(--destructive)/0.1)] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--destructive))]", children: "\u751F\u6210\u5931\u8D25" }) : null,
|
|
40605
|
+
imageParts.length > 0 && /* @__PURE__ */ jsx38("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx38(
|
|
40588
40606
|
MessageImage,
|
|
40589
40607
|
{
|
|
40590
40608
|
src: part.image_url.url,
|
|
@@ -40595,8 +40613,8 @@ function AssistantMessageContent({
|
|
|
40595
40613
|
},
|
|
40596
40614
|
part.image_url.url
|
|
40597
40615
|
)) }),
|
|
40598
|
-
/* @__PURE__ */
|
|
40599
|
-
text4 && customText != null ? customText : text4 ? /* @__PURE__ */
|
|
40616
|
+
/* @__PURE__ */ jsx38(MessageFileAttachmentList, { files: fileParts }),
|
|
40617
|
+
text4 && customText != null ? customText : text4 ? /* @__PURE__ */ jsx38(
|
|
40600
40618
|
AssistantText,
|
|
40601
40619
|
{
|
|
40602
40620
|
text: text4,
|
|
@@ -40608,7 +40626,7 @@ function AssistantMessageContent({
|
|
|
40608
40626
|
citations
|
|
40609
40627
|
}
|
|
40610
40628
|
) : null,
|
|
40611
|
-
!text4 && reasoning ? /* @__PURE__ */
|
|
40629
|
+
!text4 && reasoning ? /* @__PURE__ */ jsx38(ThinkingBadge, { reasoning, variant: "block" }) : null
|
|
40612
40630
|
] });
|
|
40613
40631
|
}
|
|
40614
40632
|
function AssistantText({
|
|
@@ -40631,13 +40649,13 @@ function AssistantText({
|
|
|
40631
40649
|
() => ({ sessionId, messageId, sendMessage }),
|
|
40632
40650
|
[sessionId, messageId, sendMessage]
|
|
40633
40651
|
);
|
|
40634
|
-
return /* @__PURE__ */
|
|
40652
|
+
return /* @__PURE__ */ jsxs32(
|
|
40635
40653
|
"div",
|
|
40636
40654
|
{
|
|
40637
40655
|
part: "assistant-text",
|
|
40638
40656
|
className: cn("blade-chat-assistant-text text-[15px] leading-8 text-[hsl(var(--foreground))]", className),
|
|
40639
40657
|
children: [
|
|
40640
|
-
/* @__PURE__ */
|
|
40658
|
+
/* @__PURE__ */ jsx38(CardContext.Provider, { value: cardCtx, children: /* @__PURE__ */ jsx38(
|
|
40641
40659
|
MarkdownContent,
|
|
40642
40660
|
{
|
|
40643
40661
|
mode: isStreaming ? "streaming" : "static",
|
|
@@ -40648,7 +40666,7 @@ function AssistantText({
|
|
|
40648
40666
|
children: text4
|
|
40649
40667
|
}
|
|
40650
40668
|
) }),
|
|
40651
|
-
reasoning ? /* @__PURE__ */
|
|
40669
|
+
reasoning ? /* @__PURE__ */ jsx38(ThinkingBadge, { reasoning }) : null
|
|
40652
40670
|
]
|
|
40653
40671
|
}
|
|
40654
40672
|
);
|
|
@@ -40666,27 +40684,27 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
|
|
|
40666
40684
|
const memoriesHref = useChatEnvironment().memoriesHref;
|
|
40667
40685
|
const hasSkill = refs.some((r) => r.skill_name);
|
|
40668
40686
|
const label = hasSkill ? "\u53C2\u8003\u4E86\u8BE5\u6280\u80FD\u7684\u5386\u53F2\u7ECF\u9A8C" : "\u53C2\u8003\u4E86\u5386\u53F2\u7ECF\u9A8C";
|
|
40669
|
-
return /* @__PURE__ */
|
|
40687
|
+
return /* @__PURE__ */ jsxs32(
|
|
40670
40688
|
"div",
|
|
40671
40689
|
{
|
|
40672
40690
|
part: "memory-refs",
|
|
40673
40691
|
className: cn("blade-chat-memory-refs relative z-[1] ml-1 w-[calc(100%-0.25rem)] max-w-[680px] self-start", className),
|
|
40674
40692
|
children: [
|
|
40675
|
-
/* @__PURE__ */
|
|
40693
|
+
/* @__PURE__ */ jsxs32(
|
|
40676
40694
|
"button",
|
|
40677
40695
|
{
|
|
40678
40696
|
type: "button",
|
|
40679
40697
|
onClick: () => setExpanded(!expanded),
|
|
40680
40698
|
className: "inline-flex h-8 items-center gap-1.5 rounded-lg border border-[hsl(var(--primary)/0.22)] bg-[hsl(var(--primary)/0.07)] px-3 text-xs font-medium text-[hsl(var(--primary))] transition-colors hover:bg-[hsl(var(--primary)/0.12)]",
|
|
40681
40699
|
children: [
|
|
40682
|
-
/* @__PURE__ */
|
|
40683
|
-
/* @__PURE__ */
|
|
40700
|
+
/* @__PURE__ */ jsx38(BookOpen, { size: 12 }),
|
|
40701
|
+
/* @__PURE__ */ jsxs32("span", { children: [
|
|
40684
40702
|
label,
|
|
40685
40703
|
"\uFF08",
|
|
40686
40704
|
refs.length,
|
|
40687
40705
|
"\uFF09"
|
|
40688
40706
|
] }),
|
|
40689
|
-
/* @__PURE__ */
|
|
40707
|
+
/* @__PURE__ */ jsx38(
|
|
40690
40708
|
ChevronRight,
|
|
40691
40709
|
{
|
|
40692
40710
|
size: 10,
|
|
@@ -40696,19 +40714,19 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
|
|
|
40696
40714
|
]
|
|
40697
40715
|
}
|
|
40698
40716
|
),
|
|
40699
|
-
expanded && /* @__PURE__ */
|
|
40700
|
-
refs.map((ref) => /* @__PURE__ */
|
|
40717
|
+
expanded && /* @__PURE__ */ jsxs32("div", { className: "mt-2 flex flex-col gap-2 rounded-xl border border-[hsl(var(--border)/0.8)] bg-[hsl(var(--muted)/0.28)] p-2.5", children: [
|
|
40718
|
+
refs.map((ref) => /* @__PURE__ */ jsxs32(
|
|
40701
40719
|
"div",
|
|
40702
40720
|
{
|
|
40703
40721
|
className: "rounded-lg border border-[hsl(var(--border)/0.55)] bg-[hsl(var(--background)/0.72)] px-3 py-2.5",
|
|
40704
40722
|
children: [
|
|
40705
|
-
/* @__PURE__ */
|
|
40706
|
-
ref.skill_name && /* @__PURE__ */
|
|
40723
|
+
/* @__PURE__ */ jsx38("p", { className: "line-clamp-2 break-words text-xs leading-5 text-[hsl(var(--foreground)/0.86)]", children: ref.content_preview }),
|
|
40724
|
+
ref.skill_name && /* @__PURE__ */ jsx38("span", { className: "mt-1.5 inline-flex rounded-md bg-[hsl(var(--primary)/0.09)] px-2 py-0.5 text-[10px] font-medium text-[hsl(var(--primary))]", children: ref.skill_name })
|
|
40707
40725
|
]
|
|
40708
40726
|
},
|
|
40709
40727
|
ref.id
|
|
40710
40728
|
)),
|
|
40711
|
-
memoriesHref ? /* @__PURE__ */
|
|
40729
|
+
memoriesHref ? /* @__PURE__ */ jsxs32(
|
|
40712
40730
|
"a",
|
|
40713
40731
|
{
|
|
40714
40732
|
href: memoriesHref,
|
|
@@ -40717,7 +40735,7 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
|
|
|
40717
40735
|
className: "inline-flex h-7 self-start items-center gap-1 rounded-lg px-2 text-[11px] font-medium text-[hsl(var(--primary))] transition-colors hover:bg-[hsl(var(--primary)/0.08)]",
|
|
40718
40736
|
children: [
|
|
40719
40737
|
"\u67E5\u770B\u5168\u90E8\u7ECF\u9A8C",
|
|
40720
|
-
/* @__PURE__ */
|
|
40738
|
+
/* @__PURE__ */ jsx38(ArrowUpRight, { size: 12, "aria-hidden": "true" })
|
|
40721
40739
|
]
|
|
40722
40740
|
}
|
|
40723
40741
|
) : null
|
|
@@ -41192,16 +41210,16 @@ import {
|
|
|
41192
41210
|
getContextDisplayState,
|
|
41193
41211
|
getContextGroupDisplayState
|
|
41194
41212
|
} from "@blade-hq/agent-client/internal";
|
|
41195
|
-
import { jsx as
|
|
41213
|
+
import { jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
41196
41214
|
function ContextCard({ context, className }) {
|
|
41197
41215
|
const display = getContextDisplayState(context);
|
|
41198
|
-
return /* @__PURE__ */
|
|
41216
|
+
return /* @__PURE__ */ jsxs33(
|
|
41199
41217
|
"details",
|
|
41200
41218
|
{
|
|
41201
41219
|
className: `blade-chat-context-card group/context-card overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-sm ${className ?? ""}`,
|
|
41202
41220
|
children: [
|
|
41203
|
-
/* @__PURE__ */
|
|
41204
|
-
/* @__PURE__ */
|
|
41221
|
+
/* @__PURE__ */ jsxs33("summary", { className: "blade-chat-context-summary flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 [&::-webkit-details-marker]:hidden", children: [
|
|
41222
|
+
/* @__PURE__ */ jsx39(
|
|
41205
41223
|
Layers,
|
|
41206
41224
|
{
|
|
41207
41225
|
size: 15,
|
|
@@ -41209,11 +41227,11 @@ function ContextCard({ context, className }) {
|
|
|
41209
41227
|
"aria-hidden": "true"
|
|
41210
41228
|
}
|
|
41211
41229
|
),
|
|
41212
|
-
/* @__PURE__ */
|
|
41213
|
-
/* @__PURE__ */
|
|
41214
|
-
/* @__PURE__ */
|
|
41230
|
+
/* @__PURE__ */ jsxs33("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
|
|
41231
|
+
/* @__PURE__ */ jsx39("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: display.title }),
|
|
41232
|
+
/* @__PURE__ */ jsx39("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: display.summary })
|
|
41215
41233
|
] }),
|
|
41216
|
-
/* @__PURE__ */
|
|
41234
|
+
/* @__PURE__ */ jsx39(
|
|
41217
41235
|
ChevronDown,
|
|
41218
41236
|
{
|
|
41219
41237
|
size: 14,
|
|
@@ -41222,7 +41240,7 @@ function ContextCard({ context, className }) {
|
|
|
41222
41240
|
}
|
|
41223
41241
|
)
|
|
41224
41242
|
] }),
|
|
41225
|
-
/* @__PURE__ */
|
|
41243
|
+
/* @__PURE__ */ jsx39("div", { className: "blade-chat-context-detail border-t border-[hsl(var(--border))] px-3 py-2.5 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: display.detail })
|
|
41226
41244
|
]
|
|
41227
41245
|
}
|
|
41228
41246
|
);
|
|
@@ -41231,9 +41249,9 @@ function ContextGroupCard({ contexts, className }) {
|
|
|
41231
41249
|
if (contexts.length === 0) return null;
|
|
41232
41250
|
const single = contexts.length === 1 ? getContextDisplayState(contexts[0]) : null;
|
|
41233
41251
|
const group = single ? null : getContextGroupDisplayState(contexts);
|
|
41234
|
-
return /* @__PURE__ */
|
|
41235
|
-
/* @__PURE__ */
|
|
41236
|
-
/* @__PURE__ */
|
|
41252
|
+
return /* @__PURE__ */ jsxs33("details", { className: `blade-chat-context-card group/context-group overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-sm ${className ?? ""}`, children: [
|
|
41253
|
+
/* @__PURE__ */ jsxs33("summary", { className: "blade-chat-context-summary flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 [&::-webkit-details-marker]:hidden", children: [
|
|
41254
|
+
/* @__PURE__ */ jsx39(
|
|
41237
41255
|
Layers,
|
|
41238
41256
|
{
|
|
41239
41257
|
size: 15,
|
|
@@ -41241,11 +41259,11 @@ function ContextGroupCard({ contexts, className }) {
|
|
|
41241
41259
|
"aria-hidden": "true"
|
|
41242
41260
|
}
|
|
41243
41261
|
),
|
|
41244
|
-
/* @__PURE__ */
|
|
41245
|
-
/* @__PURE__ */
|
|
41246
|
-
/* @__PURE__ */
|
|
41262
|
+
/* @__PURE__ */ jsxs33("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
|
|
41263
|
+
/* @__PURE__ */ jsx39("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: single ? single.title : `${group?.title} \xB7 ${group?.count} \u9879` }),
|
|
41264
|
+
/* @__PURE__ */ jsx39("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: single ? single.summary : group?.summary })
|
|
41247
41265
|
] }),
|
|
41248
|
-
/* @__PURE__ */
|
|
41266
|
+
/* @__PURE__ */ jsx39(
|
|
41249
41267
|
ChevronDown,
|
|
41250
41268
|
{
|
|
41251
41269
|
size: 14,
|
|
@@ -41254,7 +41272,7 @@ function ContextGroupCard({ contexts, className }) {
|
|
|
41254
41272
|
}
|
|
41255
41273
|
)
|
|
41256
41274
|
] }),
|
|
41257
|
-
single ? /* @__PURE__ */
|
|
41275
|
+
single ? /* @__PURE__ */ jsx39("div", { className: "blade-chat-context-detail border-t border-[hsl(var(--border))] px-3 py-2.5 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: single.detail }) : /* @__PURE__ */ jsx39("div", { className: "blade-chat-context-group-items flex flex-col gap-1.5 border-t border-[hsl(var(--border))] p-2", children: contexts.map((context) => /* @__PURE__ */ jsx39(
|
|
41258
41276
|
ContextCard,
|
|
41259
41277
|
{
|
|
41260
41278
|
context
|
|
@@ -41266,7 +41284,7 @@ function ContextGroupCard({ contexts, className }) {
|
|
|
41266
41284
|
|
|
41267
41285
|
// src/chat/ResultFeedback.tsx
|
|
41268
41286
|
import { useCallback as useCallback7, useEffect as useEffect18, useRef as useRef17, useState as useState23 } from "react";
|
|
41269
|
-
import { jsx as
|
|
41287
|
+
import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
41270
41288
|
var REASONS = [
|
|
41271
41289
|
{ value: "not_solved", label: "\u6CA1\u89E3\u51B3\u95EE\u9898" },
|
|
41272
41290
|
{ value: "inaccurate", label: "\u5185\u5BB9\u4E0D\u51C6\u786E" },
|
|
@@ -41280,17 +41298,17 @@ function reasonLabel(reason) {
|
|
|
41280
41298
|
}
|
|
41281
41299
|
function HistoricalResultFeedback({ feedback }) {
|
|
41282
41300
|
const label = reasonLabel(feedback.reason);
|
|
41283
|
-
return /* @__PURE__ */
|
|
41301
|
+
return /* @__PURE__ */ jsxs34(
|
|
41284
41302
|
"section",
|
|
41285
41303
|
{
|
|
41286
41304
|
"aria-label": "\u5386\u53F2\u7ED3\u679C\u53CD\u9988",
|
|
41287
41305
|
className: "w-fit max-w-full rounded-lg border border-[hsl(var(--border)/0.7)] bg-[hsl(var(--muted)/0.2)] px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]",
|
|
41288
41306
|
children: [
|
|
41289
|
-
/* @__PURE__ */
|
|
41307
|
+
/* @__PURE__ */ jsxs34("span", { children: [
|
|
41290
41308
|
"\u4F60\u5BF9\u6B64\u8F6E\u7ED3\u679C\u7684\u8BC4\u4EF7\uFF1A",
|
|
41291
41309
|
feedback.helpful ? "\u6709\u5E2E\u52A9" : "\u6CA1\u5E2E\u52A9"
|
|
41292
41310
|
] }),
|
|
41293
|
-
label ? /* @__PURE__ */
|
|
41311
|
+
label ? /* @__PURE__ */ jsxs34("span", { children: [
|
|
41294
41312
|
" \xB7 ",
|
|
41295
41313
|
label
|
|
41296
41314
|
] }) : null
|
|
@@ -41365,15 +41383,15 @@ function ResultFeedback({
|
|
|
41365
41383
|
[client, emit, followup.assistant_entry_id, onSaved, sessionId]
|
|
41366
41384
|
);
|
|
41367
41385
|
if (!visible) return null;
|
|
41368
|
-
return /* @__PURE__ */
|
|
41386
|
+
return /* @__PURE__ */ jsxs34(
|
|
41369
41387
|
"section",
|
|
41370
41388
|
{
|
|
41371
41389
|
"aria-label": "\u7ED3\u679C\u53CD\u9988",
|
|
41372
41390
|
className: "flex flex-col gap-2 border-t border-[hsl(var(--border)/0.7)] pt-3",
|
|
41373
41391
|
children: [
|
|
41374
|
-
/* @__PURE__ */
|
|
41375
|
-
/* @__PURE__ */
|
|
41376
|
-
/* @__PURE__ */
|
|
41392
|
+
/* @__PURE__ */ jsx40("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u76EE\u524D\u7684\u6574\u4F53\u7ED3\u679C\u6709\u5E2E\u52A9\u5417\uFF1F" }),
|
|
41393
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
41394
|
+
/* @__PURE__ */ jsx40(
|
|
41377
41395
|
"button",
|
|
41378
41396
|
{
|
|
41379
41397
|
type: "button",
|
|
@@ -41384,7 +41402,7 @@ function ResultFeedback({
|
|
|
41384
41402
|
children: "\u6709\u5E2E\u52A9"
|
|
41385
41403
|
}
|
|
41386
41404
|
),
|
|
41387
|
-
/* @__PURE__ */
|
|
41405
|
+
/* @__PURE__ */ jsx40(
|
|
41388
41406
|
"button",
|
|
41389
41407
|
{
|
|
41390
41408
|
type: "button",
|
|
@@ -41396,7 +41414,7 @@ function ResultFeedback({
|
|
|
41396
41414
|
}
|
|
41397
41415
|
)
|
|
41398
41416
|
] }),
|
|
41399
|
-
selectedHelpful === false ? /* @__PURE__ */
|
|
41417
|
+
selectedHelpful === false ? /* @__PURE__ */ jsx40("div", { className: "flex max-w-[520px] flex-wrap gap-1.5", "aria-label": "\u6CA1\u5E2E\u52A9\u7684\u4E3B\u8981\u539F\u56E0", children: REASONS.map((reason) => /* @__PURE__ */ jsx40(
|
|
41400
41418
|
"button",
|
|
41401
41419
|
{
|
|
41402
41420
|
type: "button",
|
|
@@ -41408,9 +41426,9 @@ function ResultFeedback({
|
|
|
41408
41426
|
},
|
|
41409
41427
|
reason.value
|
|
41410
41428
|
)) }) : null,
|
|
41411
|
-
saveError ? /* @__PURE__ */
|
|
41412
|
-
/* @__PURE__ */
|
|
41413
|
-
/* @__PURE__ */
|
|
41429
|
+
saveError ? /* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--destructive))]", children: [
|
|
41430
|
+
/* @__PURE__ */ jsx40("span", { children: "\u53CD\u9988\u6682\u672A\u4FDD\u5B58\uFF0C\u53EF\u91CD\u8BD5" }),
|
|
41431
|
+
/* @__PURE__ */ jsx40(
|
|
41414
41432
|
"button",
|
|
41415
41433
|
{
|
|
41416
41434
|
type: "button",
|
|
@@ -41422,14 +41440,14 @@ function ResultFeedback({
|
|
|
41422
41440
|
children: "\u91CD\u8BD5"
|
|
41423
41441
|
}
|
|
41424
41442
|
)
|
|
41425
|
-
] }) : saved ? /* @__PURE__ */
|
|
41443
|
+
] }) : saved ? /* @__PURE__ */ jsx40("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u5DF2\u4FDD\u5B58\uFF0C\u53EF\u968F\u65F6\u4FEE\u6539" }) : null
|
|
41426
41444
|
]
|
|
41427
41445
|
}
|
|
41428
41446
|
);
|
|
41429
41447
|
}
|
|
41430
41448
|
|
|
41431
41449
|
// src/chat/LiteMessageList.tsx
|
|
41432
|
-
import { jsx as
|
|
41450
|
+
import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
41433
41451
|
var LITE_LOADING_INDICATOR_HEIGHT = 38;
|
|
41434
41452
|
function messageText(message) {
|
|
41435
41453
|
return getTextContent3(normalizeMessageContent2(message.content)).trim();
|
|
@@ -41716,7 +41734,7 @@ function LiteMessageList({
|
|
|
41716
41734
|
},
|
|
41717
41735
|
[]
|
|
41718
41736
|
);
|
|
41719
|
-
return /* @__PURE__ */
|
|
41737
|
+
return /* @__PURE__ */ jsxs35(
|
|
41720
41738
|
"div",
|
|
41721
41739
|
{
|
|
41722
41740
|
ref: scrollRef,
|
|
@@ -41730,7 +41748,7 @@ function LiteMessageList({
|
|
|
41730
41748
|
},
|
|
41731
41749
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-6 sm:px-8",
|
|
41732
41750
|
children: [
|
|
41733
|
-
rows.length === 0 ? /* @__PURE__ */
|
|
41751
|
+
rows.length === 0 ? /* @__PURE__ */ jsx41("div", { className: "grid min-h-full place-items-center text-sm text-[hsl(var(--muted-foreground))]", children: isLoadingHistory ? "\u6B63\u5728\u52A0\u8F7D\u6D88\u606F\u2026" : "\u5F00\u59CB\u65B0\u7684\u5BF9\u8BDD\u5427" }) : /* @__PURE__ */ jsxs35(
|
|
41734
41752
|
"div",
|
|
41735
41753
|
{
|
|
41736
41754
|
className: "relative mx-auto w-full max-w-3xl",
|
|
@@ -41741,7 +41759,7 @@ function LiteMessageList({
|
|
|
41741
41759
|
virtualizer.getVirtualItems().map((virtualRow) => {
|
|
41742
41760
|
const row = rows[virtualRow.index];
|
|
41743
41761
|
if (!row) return null;
|
|
41744
|
-
return /* @__PURE__ */
|
|
41762
|
+
return /* @__PURE__ */ jsx41(
|
|
41745
41763
|
"div",
|
|
41746
41764
|
{
|
|
41747
41765
|
ref: virtualizer.measureElement,
|
|
@@ -41749,7 +41767,7 @@ function LiteMessageList({
|
|
|
41749
41767
|
"data-lite-row-key": row.key,
|
|
41750
41768
|
className: "absolute left-0 top-0 w-full pb-5",
|
|
41751
41769
|
style: { transform: `translateY(${virtualRow.start}px)` },
|
|
41752
|
-
children: row.type === "text" ? /* @__PURE__ */
|
|
41770
|
+
children: row.type === "text" ? /* @__PURE__ */ jsx41(PlainTextMessage, { row, sessionId }) : row.type === "background-wakeup" ? /* @__PURE__ */ jsx41(BackgroundWakeNotice, {}) : row.type === "memory-refs" ? /* @__PURE__ */ jsx41(MemoryRefsHint, { refs: row.refs }) : row.type === "question" ? /* @__PURE__ */ jsx41(
|
|
41753
41771
|
ToolCallBlock,
|
|
41754
41772
|
{
|
|
41755
41773
|
toolCall: row.toolCall,
|
|
@@ -41765,7 +41783,7 @@ function LiteMessageList({
|
|
|
41765
41783
|
isActiveQuestion: row.toolCall.id === activeQuestionId,
|
|
41766
41784
|
turnBlocks: row.turnBlocks
|
|
41767
41785
|
}
|
|
41768
|
-
) : row.type === "tool-description" ? /* @__PURE__ */
|
|
41786
|
+
) : row.type === "tool-description" ? /* @__PURE__ */ jsx41(ToolDescription, { row }) : row.type === "context-group" ? /* @__PURE__ */ jsx41(ContextGroupCard, { contexts: row.contexts }) : row.type === "context-divider" ? /* @__PURE__ */ jsx41("div", { "aria-hidden": "true", className: "h-px w-full bg-[hsl(var(--border)/0.55)]" }) : row.type === "historical-feedback" ? /* @__PURE__ */ jsx41(HistoricalResultFeedback, { feedback: row.feedback }) : /* @__PURE__ */ jsx41(
|
|
41769
41787
|
LiteFollowup,
|
|
41770
41788
|
{
|
|
41771
41789
|
sessionId,
|
|
@@ -41779,19 +41797,19 @@ function LiteMessageList({
|
|
|
41779
41797
|
row.key
|
|
41780
41798
|
);
|
|
41781
41799
|
}),
|
|
41782
|
-
isStreaming ? /* @__PURE__ */
|
|
41800
|
+
isStreaming ? /* @__PURE__ */ jsx41(
|
|
41783
41801
|
"div",
|
|
41784
41802
|
{
|
|
41785
41803
|
className: "absolute left-0 top-0 w-full",
|
|
41786
41804
|
style: { transform: `translateY(${totalSize}px)` },
|
|
41787
|
-
children: /* @__PURE__ */
|
|
41805
|
+
children: /* @__PURE__ */ jsx41(ChatLoadingIndicator, { preparing: isPreparingReply(messages) })
|
|
41788
41806
|
}
|
|
41789
41807
|
) : null
|
|
41790
41808
|
]
|
|
41791
41809
|
}
|
|
41792
41810
|
),
|
|
41793
|
-
rows.length === 0 && isStreaming ? /* @__PURE__ */
|
|
41794
|
-
/* @__PURE__ */
|
|
41811
|
+
rows.length === 0 && isStreaming ? /* @__PURE__ */ jsx41(ChatLoadingIndicator, { preparing: isPreparingReply(messages) }) : null,
|
|
41812
|
+
/* @__PURE__ */ jsx41("div", { ref: trailingSpacerRef, "aria-hidden": "true", className: "pointer-events-none w-full" })
|
|
41795
41813
|
]
|
|
41796
41814
|
}
|
|
41797
41815
|
);
|
|
@@ -41799,13 +41817,13 @@ function LiteMessageList({
|
|
|
41799
41817
|
function ToolDescription({ row }) {
|
|
41800
41818
|
const description = row.description;
|
|
41801
41819
|
const Icon = description.includes("\u641C\u7D22") ? Search : description.includes("\u6267\u884C") ? Terminal : description.includes("\u8BFB\u53D6") ? BookOpen : description.includes("\u6587\u4EF6") ? FilePenLine : Wrench;
|
|
41802
|
-
return /* @__PURE__ */
|
|
41820
|
+
return /* @__PURE__ */ jsx41("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", title: description, children: /* @__PURE__ */ jsx41(Icon, { size: 14, className: row.running ? "animate-pulse" : "opacity-55", "aria-hidden": "true" }) });
|
|
41803
41821
|
}
|
|
41804
41822
|
function PlainTextMessage({
|
|
41805
41823
|
row,
|
|
41806
41824
|
sessionId
|
|
41807
41825
|
}) {
|
|
41808
|
-
const markdown = /* @__PURE__ */
|
|
41826
|
+
const markdown = /* @__PURE__ */ jsx41(
|
|
41809
41827
|
MarkdownContent,
|
|
41810
41828
|
{
|
|
41811
41829
|
sessionId,
|
|
@@ -41816,25 +41834,19 @@ function PlainTextMessage({
|
|
|
41816
41834
|
}
|
|
41817
41835
|
);
|
|
41818
41836
|
if (row.role === "user") {
|
|
41819
|
-
return /* @__PURE__ */
|
|
41837
|
+
return /* @__PURE__ */ jsx41("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx41("div", { className: "max-w-[82%] rounded-[18px] rounded-br-[6px] border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-4 py-3 text-sm leading-6 text-[hsl(var(--user-msg-fg))]", children: markdown }) });
|
|
41820
41838
|
}
|
|
41821
|
-
return /* @__PURE__ */
|
|
41839
|
+
return /* @__PURE__ */ jsxs35(
|
|
41822
41840
|
"div",
|
|
41823
41841
|
{
|
|
41824
41842
|
className: `break-words text-sm leading-6 ${row.role === "error" ? "text-[hsl(var(--destructive))]" : "text-[hsl(var(--foreground))]"}`,
|
|
41825
41843
|
children: [
|
|
41826
|
-
row.failed ? /* @__PURE__ */
|
|
41844
|
+
row.failed ? /* @__PURE__ */ jsx41("div", { className: "mb-1 w-fit rounded-full border border-[hsl(var(--destructive)/0.3)] bg-[hsl(var(--destructive)/0.1)] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--destructive))]", children: "\u751F\u6210\u5931\u8D25" }) : null,
|
|
41827
41845
|
markdown
|
|
41828
41846
|
]
|
|
41829
41847
|
}
|
|
41830
41848
|
);
|
|
41831
41849
|
}
|
|
41832
|
-
function LiteLoadingIndicator() {
|
|
41833
|
-
return /* @__PURE__ */ jsxs34("output", { className: "flex h-[38px] items-center gap-2 px-1 text-xs text-[hsl(var(--muted-foreground))]", "aria-live": "polite", children: [
|
|
41834
|
-
/* @__PURE__ */ jsx40(LoaderCircle, { size: 14, className: "animate-spin", "aria-hidden": "true" }),
|
|
41835
|
-
/* @__PURE__ */ jsx40("span", { children: "\u6B63\u5728\u751F\u6210\u4E2D\u2026" })
|
|
41836
|
-
] });
|
|
41837
|
-
}
|
|
41838
41850
|
function LiteFollowup({
|
|
41839
41851
|
sessionId,
|
|
41840
41852
|
followup,
|
|
@@ -41856,11 +41868,11 @@ function LiteFollowup({
|
|
|
41856
41868
|
setDownloadingPath(null);
|
|
41857
41869
|
}
|
|
41858
41870
|
};
|
|
41859
|
-
return /* @__PURE__ */
|
|
41860
|
-
artifacts.length > 0 ? /* @__PURE__ */
|
|
41861
|
-
/* @__PURE__ */
|
|
41871
|
+
return /* @__PURE__ */ jsxs35("div", { className: "flex flex-col items-start gap-3", children: [
|
|
41872
|
+
artifacts.length > 0 ? /* @__PURE__ */ jsxs35("div", { className: "flex w-full flex-col items-start gap-1.5", children: [
|
|
41873
|
+
/* @__PURE__ */ jsx41("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u672C\u8F6E\u6210\u679C" }),
|
|
41862
41874
|
artifacts.map(
|
|
41863
|
-
(artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */
|
|
41875
|
+
(artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */ jsxs35(
|
|
41864
41876
|
"a",
|
|
41865
41877
|
{
|
|
41866
41878
|
href: artifact.target,
|
|
@@ -41868,12 +41880,12 @@ function LiteFollowup({
|
|
|
41868
41880
|
rel: "noopener noreferrer",
|
|
41869
41881
|
className: "flex w-[320px] max-w-full items-center gap-2 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-3 py-2.5 text-sm hover:bg-[hsl(var(--muted)/0.5)]",
|
|
41870
41882
|
children: [
|
|
41871
|
-
/* @__PURE__ */
|
|
41872
|
-
/* @__PURE__ */
|
|
41883
|
+
/* @__PURE__ */ jsx41(ExternalLink, { size: 16, className: "shrink-0" }),
|
|
41884
|
+
/* @__PURE__ */ jsx41("span", { className: "min-w-0 flex-1 truncate", children: artifact.label || artifact.target })
|
|
41873
41885
|
]
|
|
41874
41886
|
},
|
|
41875
41887
|
`${artifact.kind}:${artifactIndex}`
|
|
41876
|
-
) : /* @__PURE__ */
|
|
41888
|
+
) : /* @__PURE__ */ jsxs35(
|
|
41877
41889
|
"button",
|
|
41878
41890
|
{
|
|
41879
41891
|
type: "button",
|
|
@@ -41884,18 +41896,18 @@ function LiteFollowup({
|
|
|
41884
41896
|
),
|
|
41885
41897
|
className: "flex w-[320px] max-w-full items-center gap-2 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-3 py-2.5 text-sm hover:bg-[hsl(var(--muted)/0.5)]",
|
|
41886
41898
|
children: [
|
|
41887
|
-
/* @__PURE__ */
|
|
41888
|
-
/* @__PURE__ */
|
|
41889
|
-
/* @__PURE__ */
|
|
41899
|
+
/* @__PURE__ */ jsx41(FileText, { size: 16, className: "shrink-0" }),
|
|
41900
|
+
/* @__PURE__ */ jsx41("span", { className: "min-w-0 flex-1 truncate", children: artifact.label || artifact.target }),
|
|
41901
|
+
/* @__PURE__ */ jsx41(Download, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" })
|
|
41890
41902
|
]
|
|
41891
41903
|
},
|
|
41892
41904
|
`${artifact.kind}:${artifactIndex}`
|
|
41893
41905
|
)
|
|
41894
41906
|
)
|
|
41895
41907
|
] }) : null,
|
|
41896
|
-
followup.suggestions.length > 0 ? /* @__PURE__ */
|
|
41897
|
-
/* @__PURE__ */
|
|
41898
|
-
followup.suggestions.map((suggestion) => /* @__PURE__ */
|
|
41908
|
+
followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs35("div", { className: "flex max-w-full flex-col items-start gap-1.5", children: [
|
|
41909
|
+
/* @__PURE__ */ jsx41("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
|
|
41910
|
+
followup.suggestions.map((suggestion) => /* @__PURE__ */ jsxs35(
|
|
41899
41911
|
"button",
|
|
41900
41912
|
{
|
|
41901
41913
|
type: "button",
|
|
@@ -41905,14 +41917,14 @@ function LiteFollowup({
|
|
|
41905
41917
|
},
|
|
41906
41918
|
className: "flex max-w-full items-center gap-2 rounded-xl bg-[hsl(var(--muted)/0.62)] px-3 py-2 text-left text-sm disabled:opacity-60",
|
|
41907
41919
|
children: [
|
|
41908
|
-
/* @__PURE__ */
|
|
41909
|
-
/* @__PURE__ */
|
|
41920
|
+
/* @__PURE__ */ jsx41("span", { children: suggestion }),
|
|
41921
|
+
/* @__PURE__ */ jsx41(ArrowRight, { size: 14, className: "shrink-0" })
|
|
41910
41922
|
]
|
|
41911
41923
|
},
|
|
41912
41924
|
suggestion
|
|
41913
41925
|
))
|
|
41914
41926
|
] }) : null,
|
|
41915
|
-
/* @__PURE__ */
|
|
41927
|
+
/* @__PURE__ */ jsx41(
|
|
41916
41928
|
ResultFeedback,
|
|
41917
41929
|
{
|
|
41918
41930
|
sessionId,
|
|
@@ -45701,7 +45713,7 @@ function extractRefs(content3) {
|
|
|
45701
45713
|
}
|
|
45702
45714
|
|
|
45703
45715
|
// src/chat/plan/PlanSummaryCard.tsx
|
|
45704
|
-
import { Fragment as Fragment15, jsx as
|
|
45716
|
+
import { Fragment as Fragment15, jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
45705
45717
|
function PlanSummaryCard({
|
|
45706
45718
|
messages,
|
|
45707
45719
|
sessionStatus,
|
|
@@ -45716,8 +45728,8 @@ function PlanSummaryCard({
|
|
|
45716
45728
|
const isWaitingForInput = sessionStatus === "waiting_for_input";
|
|
45717
45729
|
const canConfirm = Boolean(onConfirmPlan) && isWaitingForInput && data.lastPauseTool === "ExitPlanMode";
|
|
45718
45730
|
const openPlanPanel = openPlanPanelAction && sessionId ? () => openPlanPanelAction(sessionId) : void 0;
|
|
45719
|
-
return /* @__PURE__ */
|
|
45720
|
-
/* @__PURE__ */
|
|
45731
|
+
return /* @__PURE__ */ jsxs36("div", { className: "flex w-full flex-col gap-4 rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.55)] p-4", children: [
|
|
45732
|
+
/* @__PURE__ */ jsxs36(
|
|
45721
45733
|
"button",
|
|
45722
45734
|
{
|
|
45723
45735
|
type: "button",
|
|
@@ -45725,17 +45737,17 @@ function PlanSummaryCard({
|
|
|
45725
45737
|
disabled: isHistorical || !openPlanPanel,
|
|
45726
45738
|
className: "flex w-full flex-col gap-4 text-left transition-colors hover:text-[hsl(var(--foreground))]",
|
|
45727
45739
|
children: [
|
|
45728
|
-
/* @__PURE__ */
|
|
45729
|
-
/* @__PURE__ */
|
|
45730
|
-
/* @__PURE__ */
|
|
45731
|
-
/* @__PURE__ */
|
|
45732
|
-
/* @__PURE__ */
|
|
45740
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-start justify-between gap-3", children: [
|
|
45741
|
+
/* @__PURE__ */ jsxs36("div", { className: "min-w-0 space-y-2", children: [
|
|
45742
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
45743
|
+
/* @__PURE__ */ jsx42(Sparkles, { size: 12 }),
|
|
45744
|
+
/* @__PURE__ */ jsx42("span", { children: "\u89C4\u5212\u6458\u8981" })
|
|
45733
45745
|
] }),
|
|
45734
|
-
/* @__PURE__ */
|
|
45735
|
-
/* @__PURE__ */
|
|
45736
|
-
/* @__PURE__ */
|
|
45737
|
-
/* @__PURE__ */
|
|
45738
|
-
] }) : /* @__PURE__ */
|
|
45746
|
+
/* @__PURE__ */ jsx42("div", { className: "truncate text-base font-medium text-[hsl(var(--foreground))]", children: data.intent || "\u5F53\u524D\u89C4\u5212" }),
|
|
45747
|
+
/* @__PURE__ */ jsx42("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: summaryState.kind === "progress" ? /* @__PURE__ */ jsxs36(Fragment15, { children: [
|
|
45748
|
+
/* @__PURE__ */ jsx42("span", { className: "rounded-full bg-[hsl(var(--accent))] px-2.5 py-1 text-[hsl(var(--foreground))]", children: summaryState.label }),
|
|
45749
|
+
/* @__PURE__ */ jsx42("span", { className: "font-mono tracking-[0.25em] text-[hsl(var(--muted-foreground))]", children: summaryState.dots })
|
|
45750
|
+
] }) : /* @__PURE__ */ jsx42(
|
|
45739
45751
|
"span",
|
|
45740
45752
|
{
|
|
45741
45753
|
className: cn(
|
|
@@ -45748,7 +45760,7 @@ function PlanSummaryCard({
|
|
|
45748
45760
|
}
|
|
45749
45761
|
) })
|
|
45750
45762
|
] }),
|
|
45751
|
-
!isHistorical && /* @__PURE__ */
|
|
45763
|
+
!isHistorical && /* @__PURE__ */ jsx42(
|
|
45752
45764
|
ChevronRight,
|
|
45753
45765
|
{
|
|
45754
45766
|
size: 16,
|
|
@@ -45757,24 +45769,24 @@ function PlanSummaryCard({
|
|
|
45757
45769
|
}
|
|
45758
45770
|
)
|
|
45759
45771
|
] }),
|
|
45760
|
-
summaryState.kind === "complete" && /* @__PURE__ */
|
|
45761
|
-
/* @__PURE__ */
|
|
45772
|
+
summaryState.kind === "complete" && /* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
45773
|
+
/* @__PURE__ */ jsxs36("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
|
|
45762
45774
|
data.selectedSkills.length,
|
|
45763
45775
|
" \u4E2A\u6280\u80FD"
|
|
45764
45776
|
] }),
|
|
45765
|
-
/* @__PURE__ */
|
|
45777
|
+
/* @__PURE__ */ jsxs36("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
|
|
45766
45778
|
stepCount,
|
|
45767
45779
|
" \u4E2A\u6B65\u9AA4"
|
|
45768
45780
|
] }),
|
|
45769
|
-
!isHistorical && /* @__PURE__ */
|
|
45770
|
-
/* @__PURE__ */
|
|
45781
|
+
!isHistorical && /* @__PURE__ */ jsxs36("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--muted-foreground))]", children: [
|
|
45782
|
+
/* @__PURE__ */ jsx42(CircleCheck, { size: 12 }),
|
|
45771
45783
|
"\u53F3\u4FA7\u67E5\u770B\u8BE6\u60C5"
|
|
45772
45784
|
] })
|
|
45773
45785
|
] })
|
|
45774
45786
|
]
|
|
45775
45787
|
}
|
|
45776
45788
|
),
|
|
45777
|
-
canConfirm && /* @__PURE__ */
|
|
45789
|
+
canConfirm && /* @__PURE__ */ jsx42(PlanConfirmationPanel, { onConfirmPlan })
|
|
45778
45790
|
] });
|
|
45779
45791
|
}
|
|
45780
45792
|
function PlanConfirmationPanel({
|
|
@@ -45789,35 +45801,35 @@ function PlanConfirmationPanel({
|
|
|
45789
45801
|
setRevisionText("");
|
|
45790
45802
|
setIsEditing(false);
|
|
45791
45803
|
};
|
|
45792
|
-
return /* @__PURE__ */
|
|
45793
|
-
/* @__PURE__ */
|
|
45794
|
-
/* @__PURE__ */
|
|
45804
|
+
return /* @__PURE__ */ jsxs36("div", { className: "space-y-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--background)/0.45)] p-3", children: [
|
|
45805
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap gap-2", children: [
|
|
45806
|
+
/* @__PURE__ */ jsxs36(
|
|
45795
45807
|
"button",
|
|
45796
45808
|
{
|
|
45797
45809
|
type: "button",
|
|
45798
45810
|
onClick: () => onConfirmPlan?.("execute"),
|
|
45799
45811
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-[hsl(var(--primary))] px-3 py-2 text-sm font-medium text-[hsl(var(--primary-foreground))] transition-opacity hover:opacity-90",
|
|
45800
45812
|
children: [
|
|
45801
|
-
/* @__PURE__ */
|
|
45813
|
+
/* @__PURE__ */ jsx42(Play, { size: 14 }),
|
|
45802
45814
|
"\u5F00\u59CB\u6267\u884C"
|
|
45803
45815
|
]
|
|
45804
45816
|
}
|
|
45805
45817
|
),
|
|
45806
|
-
/* @__PURE__ */
|
|
45818
|
+
/* @__PURE__ */ jsxs36(
|
|
45807
45819
|
"button",
|
|
45808
45820
|
{
|
|
45809
45821
|
type: "button",
|
|
45810
45822
|
onClick: () => setIsEditing((value) => !value),
|
|
45811
45823
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-[hsl(var(--border))] px-3 py-2 text-sm text-[hsl(var(--foreground))] transition-colors hover:bg-[hsl(var(--accent))]",
|
|
45812
45824
|
children: [
|
|
45813
|
-
/* @__PURE__ */
|
|
45825
|
+
/* @__PURE__ */ jsx42(PencilLine, { size: 14 }),
|
|
45814
45826
|
"\u4FEE\u6539"
|
|
45815
45827
|
]
|
|
45816
45828
|
}
|
|
45817
45829
|
)
|
|
45818
45830
|
] }),
|
|
45819
|
-
isEditing && /* @__PURE__ */
|
|
45820
|
-
/* @__PURE__ */
|
|
45831
|
+
isEditing && /* @__PURE__ */ jsxs36("div", { className: "space-y-2", children: [
|
|
45832
|
+
/* @__PURE__ */ jsx42(
|
|
45821
45833
|
"textarea",
|
|
45822
45834
|
{
|
|
45823
45835
|
value: revisionText,
|
|
@@ -45826,7 +45838,7 @@ function PlanConfirmationPanel({
|
|
|
45826
45838
|
className: "min-h-24 w-full resize-y rounded-lg border border-[hsl(var(--border))] bg-transparent px-3 py-2 text-sm text-[hsl(var(--foreground))] outline-none placeholder:text-[hsl(var(--muted-foreground))]"
|
|
45827
45839
|
}
|
|
45828
45840
|
),
|
|
45829
|
-
/* @__PURE__ */
|
|
45841
|
+
/* @__PURE__ */ jsx42("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx42(
|
|
45830
45842
|
"button",
|
|
45831
45843
|
{
|
|
45832
45844
|
type: "button",
|
|
@@ -45944,7 +45956,7 @@ function extractPlanMessagesForTurn(messages, turnLastMessage) {
|
|
|
45944
45956
|
|
|
45945
45957
|
// src/chat/CompactionCard.tsx
|
|
45946
45958
|
import { useState as useState29 } from "react";
|
|
45947
|
-
import { jsx as
|
|
45959
|
+
import { jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
45948
45960
|
var PERCENT_FORMATTER = new Intl.NumberFormat("zh-CN", {
|
|
45949
45961
|
style: "percent",
|
|
45950
45962
|
maximumFractionDigits: 0
|
|
@@ -46005,9 +46017,9 @@ function CompactionCard({
|
|
|
46005
46017
|
const hasSummary = typeof source.summary_full === "string" && source.summary_full.trim().length > 0 && !isGenericArchiveSummary(source.summary_full);
|
|
46006
46018
|
const hasFailureReason = source.status === "failed" && Boolean(source.failure_reason);
|
|
46007
46019
|
const canExpand = source.status === "completed" && (hasSummary || archivedToolCalls.length > 0) || hasFailureReason;
|
|
46008
|
-
return /* @__PURE__ */
|
|
46009
|
-
/* @__PURE__ */
|
|
46010
|
-
/* @__PURE__ */
|
|
46020
|
+
return /* @__PURE__ */ jsxs37("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
46021
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex items-center justify-between gap-2", children: [
|
|
46022
|
+
/* @__PURE__ */ jsxs37(
|
|
46011
46023
|
"button",
|
|
46012
46024
|
{
|
|
46013
46025
|
type: "button",
|
|
@@ -46018,21 +46030,21 @@ function CompactionCard({
|
|
|
46018
46030
|
),
|
|
46019
46031
|
"aria-expanded": expanded,
|
|
46020
46032
|
children: [
|
|
46021
|
-
canExpand ? expanded ? /* @__PURE__ */
|
|
46022
|
-
/* @__PURE__ */
|
|
46023
|
-
/* @__PURE__ */
|
|
46033
|
+
canExpand ? expanded ? /* @__PURE__ */ jsx43(ChevronDown, { size: 12, className: "shrink-0" }) : /* @__PURE__ */ jsx43(ChevronRight, { size: 12, className: "shrink-0" }) : null,
|
|
46034
|
+
/* @__PURE__ */ jsx43("span", { children: source.status === "streaming" ? /* @__PURE__ */ jsxs37("span", { className: "inline-flex items-center gap-1", children: [
|
|
46035
|
+
/* @__PURE__ */ jsx43(LoaderCircle, { size: 12, className: "animate-spin" }),
|
|
46024
46036
|
"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587"
|
|
46025
|
-
] }) : source.status === "failed" ? /* @__PURE__ */
|
|
46026
|
-
/* @__PURE__ */
|
|
46037
|
+
] }) : source.status === "failed" ? /* @__PURE__ */ jsxs37("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-danger))]", children: [
|
|
46038
|
+
/* @__PURE__ */ jsx43(CircleX, { size: 12 }),
|
|
46027
46039
|
"\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
|
|
46028
|
-
] }) : source.status === "interrupted" ? /* @__PURE__ */
|
|
46029
|
-
/* @__PURE__ */
|
|
46040
|
+
] }) : source.status === "interrupted" ? /* @__PURE__ */ jsxs37("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-warning))]", children: [
|
|
46041
|
+
/* @__PURE__ */ jsx43(Square, { size: 12 }),
|
|
46030
46042
|
"\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88"
|
|
46031
46043
|
] }) : "\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29" })
|
|
46032
46044
|
]
|
|
46033
46045
|
}
|
|
46034
46046
|
),
|
|
46035
|
-
canCancel ? /* @__PURE__ */
|
|
46047
|
+
canCancel ? /* @__PURE__ */ jsx43(
|
|
46036
46048
|
"button",
|
|
46037
46049
|
{
|
|
46038
46050
|
type: "button",
|
|
@@ -46042,13 +46054,13 @@ function CompactionCard({
|
|
|
46042
46054
|
}
|
|
46043
46055
|
) : null
|
|
46044
46056
|
] }),
|
|
46045
|
-
expanded ? /* @__PURE__ */
|
|
46046
|
-
/* @__PURE__ */
|
|
46047
|
-
/* @__PURE__ */
|
|
46057
|
+
expanded ? /* @__PURE__ */ jsxs37("div", { className: "mt-1 max-w-3xl rounded-lg border border-[hsl(var(--border))]/70 bg-[hsl(var(--card))]/80 px-3 py-2 text-[11px] leading-relaxed", children: [
|
|
46058
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[hsl(var(--muted-foreground))]", children: [
|
|
46059
|
+
/* @__PURE__ */ jsxs37("span", { children: [
|
|
46048
46060
|
"#",
|
|
46049
46061
|
shortId(source.compaction_id)
|
|
46050
46062
|
] }),
|
|
46051
|
-
/* @__PURE__ */
|
|
46063
|
+
/* @__PURE__ */ jsxs37("span", { children: [
|
|
46052
46064
|
"\u8282\u7701 ",
|
|
46053
46065
|
formatSavedRatio(source.saved_ratio),
|
|
46054
46066
|
"\uFF08",
|
|
@@ -46058,31 +46070,31 @@ function CompactionCard({
|
|
|
46058
46070
|
formatTokens(source.tokens_after),
|
|
46059
46071
|
" token\uFF09"
|
|
46060
46072
|
] }),
|
|
46061
|
-
/* @__PURE__ */
|
|
46073
|
+
/* @__PURE__ */ jsxs37("span", { children: [
|
|
46062
46074
|
"\u5F52\u6863 ",
|
|
46063
46075
|
archivedCount,
|
|
46064
46076
|
" \u4E2A\u5DE5\u5177\u7ED3\u679C"
|
|
46065
46077
|
] })
|
|
46066
46078
|
] }),
|
|
46067
|
-
archivedToolCalls.length > 0 ? /* @__PURE__ */
|
|
46079
|
+
archivedToolCalls.length > 0 ? /* @__PURE__ */ jsx43("div", { className: "mt-2 space-y-1.5", children: archivedToolCalls.map((item, index2) => {
|
|
46068
46080
|
const archivePath = getArchivePath(item, archivedFiles);
|
|
46069
|
-
return /* @__PURE__ */
|
|
46081
|
+
return /* @__PURE__ */ jsxs37(
|
|
46070
46082
|
"div",
|
|
46071
46083
|
{
|
|
46072
46084
|
className: "rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/35 px-2 py-1.5",
|
|
46073
46085
|
children: [
|
|
46074
|
-
/* @__PURE__ */
|
|
46075
|
-
/* @__PURE__ */
|
|
46076
|
-
item.tool_call_id ? /* @__PURE__ */
|
|
46086
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-[hsl(var(--foreground))]", children: [
|
|
46087
|
+
/* @__PURE__ */ jsx43("span", { className: "font-medium", children: getArchivedToolLabel(item) }),
|
|
46088
|
+
item.tool_call_id ? /* @__PURE__ */ jsx43("span", { className: "font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: item.tool_call_id }) : null
|
|
46077
46089
|
] }),
|
|
46078
|
-
archivePath ? /* @__PURE__ */
|
|
46090
|
+
archivePath ? /* @__PURE__ */ jsx43("div", { className: "mt-0.5 break-all font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: archivePath }) : null
|
|
46079
46091
|
]
|
|
46080
46092
|
},
|
|
46081
46093
|
item.tool_call_id || item.entry_id || `${item.tool_name}-${index2}`
|
|
46082
46094
|
);
|
|
46083
46095
|
}) }) : null,
|
|
46084
|
-
hasSummary ? /* @__PURE__ */
|
|
46085
|
-
source.status === "failed" && source.failure_reason ? /* @__PURE__ */
|
|
46096
|
+
hasSummary ? /* @__PURE__ */ jsx43("pre", { className: "mt-2 max-h-[360px] overflow-auto whitespace-pre-wrap rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/25 px-2 py-1.5 font-mono text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: source.summary_full }) : null,
|
|
46097
|
+
source.status === "failed" && source.failure_reason ? /* @__PURE__ */ jsxs37("div", { className: "mt-2 text-[hsl(var(--swf-danger))]", children: [
|
|
46086
46098
|
"\u5931\u8D25\u539F\u56E0\uFF1A",
|
|
46087
46099
|
source.failure_reason
|
|
46088
46100
|
] }) : null
|
|
@@ -46095,7 +46107,7 @@ import { useEffect as useEffect24, useRef as useRef24 } from "react";
|
|
|
46095
46107
|
|
|
46096
46108
|
// src/chat/FinalArtifactCards.tsx
|
|
46097
46109
|
import { useEffect as useEffect23, useRef as useRef23, useState as useState30 } from "react";
|
|
46098
|
-
import { Fragment as Fragment16, jsx as
|
|
46110
|
+
import { Fragment as Fragment16, jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
46099
46111
|
function basename2(path2) {
|
|
46100
46112
|
return path2.split("/").filter(Boolean).pop() || path2;
|
|
46101
46113
|
}
|
|
@@ -46116,10 +46128,10 @@ function LinkCard({
|
|
|
46116
46128
|
const bladeHost = useBladeHost();
|
|
46117
46129
|
const host = hostOf(url2);
|
|
46118
46130
|
const local = isLoopbackUrl(url2) && Boolean(bladeHost.openPreview);
|
|
46119
|
-
const content3 = /* @__PURE__ */
|
|
46120
|
-
/* @__PURE__ */
|
|
46121
|
-
/* @__PURE__ */
|
|
46122
|
-
/* @__PURE__ */
|
|
46131
|
+
const content3 = /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
46132
|
+
/* @__PURE__ */ jsx44("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-[hsl(var(--primary))]", children: /* @__PURE__ */ jsx44(Globe, { size: 15, "aria-hidden": "true" }) }),
|
|
46133
|
+
/* @__PURE__ */ jsx44("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx44("span", { className: "block truncate text-xs font-medium leading-5", children: label || host }) }),
|
|
46134
|
+
/* @__PURE__ */ jsx44(
|
|
46123
46135
|
ArrowUpRight,
|
|
46124
46136
|
{
|
|
46125
46137
|
size: 13,
|
|
@@ -46129,7 +46141,7 @@ function LinkCard({
|
|
|
46129
46141
|
)
|
|
46130
46142
|
] });
|
|
46131
46143
|
if (local) {
|
|
46132
|
-
return /* @__PURE__ */
|
|
46144
|
+
return /* @__PURE__ */ jsx44(
|
|
46133
46145
|
"button",
|
|
46134
46146
|
{
|
|
46135
46147
|
type: "button",
|
|
@@ -46145,7 +46157,7 @@ ${url2}`,
|
|
|
46145
46157
|
}
|
|
46146
46158
|
);
|
|
46147
46159
|
}
|
|
46148
|
-
return /* @__PURE__ */
|
|
46160
|
+
return /* @__PURE__ */ jsx44(
|
|
46149
46161
|
"a",
|
|
46150
46162
|
{
|
|
46151
46163
|
href: url2,
|
|
@@ -46188,8 +46200,8 @@ function FinalArtifactCards({
|
|
|
46188
46200
|
const columnCount = Math.min(artifacts.length, 3);
|
|
46189
46201
|
const gridWidth = columnCount * 180 + Math.max(0, columnCount - 1) * 6;
|
|
46190
46202
|
if (artifacts.length === 0) return null;
|
|
46191
|
-
return /* @__PURE__ */
|
|
46192
|
-
/* @__PURE__ */
|
|
46203
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex max-w-full flex-col gap-1.5", children: [
|
|
46204
|
+
/* @__PURE__ */ jsx44(
|
|
46193
46205
|
"div",
|
|
46194
46206
|
{
|
|
46195
46207
|
style: {
|
|
@@ -46198,7 +46210,7 @@ function FinalArtifactCards({
|
|
|
46198
46210
|
},
|
|
46199
46211
|
className: expanded && hasMore ? "grid max-h-[144px] max-w-full gap-1.5 overflow-y-auto pr-1" : "grid max-w-full gap-1.5",
|
|
46200
46212
|
children: visibleArtifacts.map(
|
|
46201
|
-
(artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */
|
|
46213
|
+
(artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */ jsx44(
|
|
46202
46214
|
LinkCard,
|
|
46203
46215
|
{
|
|
46204
46216
|
url: artifact.target,
|
|
@@ -46207,7 +46219,7 @@ function FinalArtifactCards({
|
|
|
46207
46219
|
onOpen: () => reportOpened(artifactIndex, "link")
|
|
46208
46220
|
},
|
|
46209
46221
|
`${artifact.kind}:${artifactIndex}`
|
|
46210
|
-
) : /* @__PURE__ */
|
|
46222
|
+
) : /* @__PURE__ */ jsx44(
|
|
46211
46223
|
DeliveryCard,
|
|
46212
46224
|
{
|
|
46213
46225
|
path: artifact.target,
|
|
@@ -46224,7 +46236,7 @@ function FinalArtifactCards({
|
|
|
46224
46236
|
)
|
|
46225
46237
|
}
|
|
46226
46238
|
),
|
|
46227
|
-
hasMore ? /* @__PURE__ */
|
|
46239
|
+
hasMore ? /* @__PURE__ */ jsxs38(
|
|
46228
46240
|
"button",
|
|
46229
46241
|
{
|
|
46230
46242
|
type: "button",
|
|
@@ -46232,8 +46244,8 @@ function FinalArtifactCards({
|
|
|
46232
46244
|
className: "flex w-fit items-center gap-0.5 text-[11px] leading-4 text-[hsl(var(--muted-foreground))] transition-colors hover:text-[hsl(var(--foreground))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
|
|
46233
46245
|
"aria-expanded": expanded,
|
|
46234
46246
|
children: [
|
|
46235
|
-
/* @__PURE__ */
|
|
46236
|
-
/* @__PURE__ */
|
|
46247
|
+
/* @__PURE__ */ jsx44("span", { children: expanded ? "\u6536\u8D77" : `\u5C55\u5F00 ${artifacts.length - 3} \u4E2A` }),
|
|
46248
|
+
/* @__PURE__ */ jsx44(
|
|
46237
46249
|
ChevronDown,
|
|
46238
46250
|
{
|
|
46239
46251
|
size: 13,
|
|
@@ -46248,7 +46260,7 @@ function FinalArtifactCards({
|
|
|
46248
46260
|
}
|
|
46249
46261
|
|
|
46250
46262
|
// src/chat/PostChatFollowupBlock.tsx
|
|
46251
|
-
import { jsx as
|
|
46263
|
+
import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
46252
46264
|
function PostChatFollowupBlock({
|
|
46253
46265
|
sessionId,
|
|
46254
46266
|
followup,
|
|
@@ -46270,14 +46282,14 @@ function PostChatFollowupBlock({
|
|
|
46270
46282
|
}, [assistantEntryId, emit, sessionId, suggestionCount]);
|
|
46271
46283
|
if (!followup || !followup.recaption && followup.suggestions.length === 0 && artifacts.length === 0 && !followup.feedback_eligible)
|
|
46272
46284
|
return null;
|
|
46273
|
-
return /* @__PURE__ */
|
|
46274
|
-
followup.recaption ? /* @__PURE__ */
|
|
46275
|
-
/* @__PURE__ */
|
|
46276
|
-
/* @__PURE__ */
|
|
46285
|
+
return /* @__PURE__ */ jsxs39("div", { part: "followup", className: "blade-chat-followup flex w-fit max-w-full flex-col gap-4 rounded-xl border border-[hsl(var(--border)/0.75)] bg-[hsl(var(--muted)/0.28)] px-3 py-3 sm:min-w-[340px] sm:max-w-[680px]", children: [
|
|
46286
|
+
followup.recaption ? /* @__PURE__ */ jsxs39("section", { "aria-label": "\u672C\u8F6E\u5C0F\u7ED3", className: "flex flex-col gap-2", children: [
|
|
46287
|
+
/* @__PURE__ */ jsxs39("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-[hsl(var(--muted-foreground))]", children: [
|
|
46288
|
+
/* @__PURE__ */ jsx45(Sparkles, { size: 14, "aria-hidden": "true" }),
|
|
46277
46289
|
"\u672C\u8F6E\u5C0F\u7ED3"
|
|
46278
46290
|
] }),
|
|
46279
|
-
/* @__PURE__ */
|
|
46280
|
-
artifacts.length > 0 ? /* @__PURE__ */
|
|
46291
|
+
/* @__PURE__ */ jsx45("p", { className: "text-[13px] leading-5 text-[hsl(var(--foreground)/0.9)]", children: followup.recaption }),
|
|
46292
|
+
artifacts.length > 0 ? /* @__PURE__ */ jsx45(
|
|
46281
46293
|
FinalArtifactCards,
|
|
46282
46294
|
{
|
|
46283
46295
|
artifacts,
|
|
@@ -46286,7 +46298,7 @@ function PostChatFollowupBlock({
|
|
|
46286
46298
|
}
|
|
46287
46299
|
) : null
|
|
46288
46300
|
] }) : null,
|
|
46289
|
-
!followup.recaption && artifacts.length > 0 ? /* @__PURE__ */
|
|
46301
|
+
!followup.recaption && artifacts.length > 0 ? /* @__PURE__ */ jsx45("section", { "aria-label": "\u672C\u8F6E\u5C0F\u7ED3", children: /* @__PURE__ */ jsx45(
|
|
46290
46302
|
FinalArtifactCards,
|
|
46291
46303
|
{
|
|
46292
46304
|
artifacts,
|
|
@@ -46294,9 +46306,9 @@ function PostChatFollowupBlock({
|
|
|
46294
46306
|
assistantEntryId
|
|
46295
46307
|
}
|
|
46296
46308
|
) }) : null,
|
|
46297
|
-
followup.suggestions.length > 0 ? /* @__PURE__ */
|
|
46298
|
-
/* @__PURE__ */
|
|
46299
|
-
/* @__PURE__ */
|
|
46309
|
+
followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs39("section", { className: "flex flex-col items-start gap-1.5", "aria-label": "\u4E0B\u4E00\u6B65\u5EFA\u8BAE", children: [
|
|
46310
|
+
/* @__PURE__ */ jsx45("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
|
|
46311
|
+
/* @__PURE__ */ jsx45("div", { className: "grid w-fit max-w-full gap-1.5 sm:max-w-[680px]", children: followup.suggestions.map((suggestion, suggestionIndex) => /* @__PURE__ */ jsxs39(
|
|
46300
46312
|
"button",
|
|
46301
46313
|
{
|
|
46302
46314
|
type: "button",
|
|
@@ -46311,8 +46323,8 @@ function PostChatFollowupBlock({
|
|
|
46311
46323
|
part: "followup-action",
|
|
46312
46324
|
className: "blade-chat-followup-action group flex w-full items-center gap-2.5 rounded-[14px] bg-[hsl(var(--muted)/0.62)] px-3.5 py-2 text-left text-[13px] font-normal leading-5 text-[hsl(var(--foreground)/0.92)] transition-colors hover:bg-[hsl(var(--muted)/0.88)] disabled:cursor-default disabled:opacity-60",
|
|
46313
46325
|
children: [
|
|
46314
|
-
/* @__PURE__ */
|
|
46315
|
-
/* @__PURE__ */
|
|
46326
|
+
/* @__PURE__ */ jsx45("span", { className: "min-w-0", children: suggestion }),
|
|
46327
|
+
/* @__PURE__ */ jsx45(
|
|
46316
46328
|
ArrowRight,
|
|
46317
46329
|
{
|
|
46318
46330
|
size: 14,
|
|
@@ -46326,7 +46338,7 @@ function PostChatFollowupBlock({
|
|
|
46326
46338
|
suggestion
|
|
46327
46339
|
)) })
|
|
46328
46340
|
] }) : null,
|
|
46329
|
-
/* @__PURE__ */
|
|
46341
|
+
/* @__PURE__ */ jsx45(
|
|
46330
46342
|
ResultFeedback,
|
|
46331
46343
|
{
|
|
46332
46344
|
sessionId,
|
|
@@ -46341,7 +46353,7 @@ function PostChatFollowupBlock({
|
|
|
46341
46353
|
|
|
46342
46354
|
// src/chat/RenderErrorBoundary.tsx
|
|
46343
46355
|
import { Component } from "react";
|
|
46344
|
-
import { jsx as
|
|
46356
|
+
import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
46345
46357
|
function getFirstComponentName(componentStack) {
|
|
46346
46358
|
const match = componentStack.match(/\n\s+at\s+([^\s(]+)/);
|
|
46347
46359
|
return match?.[1] ?? null;
|
|
@@ -46374,18 +46386,18 @@ var RenderErrorBoundary = class extends Component {
|
|
|
46374
46386
|
return children;
|
|
46375
46387
|
}
|
|
46376
46388
|
const componentName = getFirstComponentName(componentStack);
|
|
46377
|
-
return /* @__PURE__ */
|
|
46378
|
-
/* @__PURE__ */
|
|
46379
|
-
/* @__PURE__ */
|
|
46380
|
-
/* @__PURE__ */
|
|
46389
|
+
return /* @__PURE__ */ jsx46("div", { className: "blade-chat-render-error rounded-xl border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-4 py-3 text-sm text-[hsl(var(--foreground))]", children: /* @__PURE__ */ jsxs40("div", { className: "flex items-start gap-2", children: [
|
|
46390
|
+
/* @__PURE__ */ jsx46(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-[hsl(var(--swf-warning))]" }),
|
|
46391
|
+
/* @__PURE__ */ jsxs40("div", { className: "min-w-0 flex-1", children: [
|
|
46392
|
+
/* @__PURE__ */ jsxs40("div", { className: "font-medium", children: [
|
|
46381
46393
|
label,
|
|
46382
46394
|
"\u6E32\u67D3\u5931\u8D25"
|
|
46383
46395
|
] }),
|
|
46384
|
-
/* @__PURE__ */
|
|
46396
|
+
/* @__PURE__ */ jsxs40("div", { className: "mt-1 break-words text-xs leading-5 text-[hsl(var(--secondary-foreground))]", children: [
|
|
46385
46397
|
componentName ? `\u7EC4\u4EF6\uFF1A${componentName}\u3002` : null,
|
|
46386
46398
|
error61.message || "\u53D1\u751F\u4E86\u672A\u9884\u671F\u7684\u6E32\u67D3\u9519\u8BEF\u3002"
|
|
46387
46399
|
] }),
|
|
46388
|
-
details ? /* @__PURE__ */
|
|
46400
|
+
details ? /* @__PURE__ */ jsx46("div", { className: "mt-1 truncate text-xs text-[hsl(var(--muted-foreground))]", children: details }) : null
|
|
46389
46401
|
] })
|
|
46390
46402
|
] }) });
|
|
46391
46403
|
}
|
|
@@ -46393,7 +46405,7 @@ var RenderErrorBoundary = class extends Component {
|
|
|
46393
46405
|
|
|
46394
46406
|
// src/chat/TurnNavRail.tsx
|
|
46395
46407
|
import { useCallback as useCallback13, useEffect as useEffect25, useLayoutEffect as useLayoutEffect6, useRef as useRef25, useState as useState31 } from "react";
|
|
46396
|
-
import { jsx as
|
|
46408
|
+
import { jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
46397
46409
|
var PANEL_MAX_HEIGHT = 448;
|
|
46398
46410
|
var PANEL_MARGIN = 16;
|
|
46399
46411
|
function clippingAncestor(element2) {
|
|
@@ -46523,7 +46535,7 @@ function TurnNavRail({
|
|
|
46523
46535
|
if (items.length < 2) {
|
|
46524
46536
|
return null;
|
|
46525
46537
|
}
|
|
46526
|
-
return /* @__PURE__ */
|
|
46538
|
+
return /* @__PURE__ */ jsx47(
|
|
46527
46539
|
"nav",
|
|
46528
46540
|
{
|
|
46529
46541
|
"aria-label": "\u56DE\u5408\u5BFC\u822A",
|
|
@@ -46538,8 +46550,8 @@ function TurnNavRail({
|
|
|
46538
46550
|
setPanelOpen(false);
|
|
46539
46551
|
setHoveredTurnId(null);
|
|
46540
46552
|
},
|
|
46541
|
-
children: /* @__PURE__ */
|
|
46542
|
-
/* @__PURE__ */
|
|
46553
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-end", children: [
|
|
46554
|
+
/* @__PURE__ */ jsxs41(
|
|
46543
46555
|
"div",
|
|
46544
46556
|
{
|
|
46545
46557
|
ref: markerRef,
|
|
@@ -46554,10 +46566,10 @@ function TurnNavRail({
|
|
|
46554
46566
|
maskImage: "linear-gradient(to bottom, transparent, black 10%, black 90%, transparent)"
|
|
46555
46567
|
},
|
|
46556
46568
|
children: [
|
|
46557
|
-
/* @__PURE__ */
|
|
46569
|
+
/* @__PURE__ */ jsx47("span", { "aria-hidden": true, className: "mt-auto shrink-0" }),
|
|
46558
46570
|
items.map((item, index2) => {
|
|
46559
46571
|
const isActive = item.id === activeTurnId;
|
|
46560
|
-
return /* @__PURE__ */
|
|
46572
|
+
return /* @__PURE__ */ jsx47(
|
|
46561
46573
|
"button",
|
|
46562
46574
|
{
|
|
46563
46575
|
type: "button",
|
|
@@ -46567,7 +46579,7 @@ function TurnNavRail({
|
|
|
46567
46579
|
"aria-current": isActive ? "true" : void 0,
|
|
46568
46580
|
"aria-label": item.title || `\u7B2C ${index2 + 1} \u8F6E`,
|
|
46569
46581
|
className: "flex h-3.5 shrink-0 items-center",
|
|
46570
|
-
children: /* @__PURE__ */
|
|
46582
|
+
children: /* @__PURE__ */ jsx47(
|
|
46571
46583
|
"span",
|
|
46572
46584
|
{
|
|
46573
46585
|
className: cn(
|
|
@@ -46583,18 +46595,18 @@ function TurnNavRail({
|
|
|
46583
46595
|
item.id
|
|
46584
46596
|
);
|
|
46585
46597
|
}),
|
|
46586
|
-
/* @__PURE__ */
|
|
46598
|
+
/* @__PURE__ */ jsx47("span", { "aria-hidden": true, className: "mb-auto shrink-0" })
|
|
46587
46599
|
]
|
|
46588
46600
|
}
|
|
46589
46601
|
),
|
|
46590
|
-
error61 ? /* @__PURE__ */
|
|
46602
|
+
error61 ? /* @__PURE__ */ jsxs41(
|
|
46591
46603
|
"div",
|
|
46592
46604
|
{
|
|
46593
46605
|
role: "alert",
|
|
46594
46606
|
className: "absolute right-full top-1/2 mr-2 flex -translate-y-1/2 items-center gap-2 whitespace-nowrap rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-2.5 py-1 text-xs text-[hsl(var(--popover-foreground))] shadow-[var(--swf-shadow-overlay)]",
|
|
46595
46607
|
children: [
|
|
46596
|
-
/* @__PURE__ */
|
|
46597
|
-
failedTurnId ? /* @__PURE__ */
|
|
46608
|
+
/* @__PURE__ */ jsx47("span", { children: error61 }),
|
|
46609
|
+
failedTurnId ? /* @__PURE__ */ jsx47(
|
|
46598
46610
|
"button",
|
|
46599
46611
|
{
|
|
46600
46612
|
type: "button",
|
|
@@ -46605,12 +46617,12 @@ function TurnNavRail({
|
|
|
46605
46617
|
) : null
|
|
46606
46618
|
]
|
|
46607
46619
|
}
|
|
46608
|
-
) : loadingTurnId ? /* @__PURE__ */
|
|
46620
|
+
) : loadingTurnId ? /* @__PURE__ */ jsx47("output", { className: "absolute right-full top-1/2 mr-2 -translate-y-1/2 whitespace-nowrap rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-2.5 py-1 text-xs text-[hsl(var(--popover-foreground))] shadow-[var(--swf-shadow-overlay)]", children: "\u6B63\u5728\u5B9A\u4F4D\u5230\u8FD9\u6761\u53D1\u8A00\u2026" }) : null,
|
|
46609
46621
|
panelOpen ? (
|
|
46610
46622
|
// pr-2 让刻度与列表之间的空隙也算悬停区域,鼠标横穿时面板不会关闭。
|
|
46611
46623
|
// 与刻度轨同心:顶对齐会让接近上限高度的面板整条往下长,聊天区是 overflow: hidden,
|
|
46612
46624
|
// 视口矮一点下面的条目就被裁掉、滚也滚不到。高度同时受视口约束。
|
|
46613
|
-
/* @__PURE__ */
|
|
46625
|
+
/* @__PURE__ */ jsx47("div", { className: "absolute right-full top-1/2 -translate-y-1/2 pr-2", children: /* @__PURE__ */ jsx47(
|
|
46614
46626
|
"div",
|
|
46615
46627
|
{
|
|
46616
46628
|
ref: listRef,
|
|
@@ -46618,7 +46630,7 @@ function TurnNavRail({
|
|
|
46618
46630
|
children: items.map((item, index2) => {
|
|
46619
46631
|
const isActive = item.id === activeTurnId;
|
|
46620
46632
|
const isHovered = item.id === hoveredTurnId;
|
|
46621
|
-
return /* @__PURE__ */
|
|
46633
|
+
return /* @__PURE__ */ jsx47(
|
|
46622
46634
|
"button",
|
|
46623
46635
|
{
|
|
46624
46636
|
type: "button",
|
|
@@ -46697,7 +46709,7 @@ function calculateAnimatedScrollTop({
|
|
|
46697
46709
|
}
|
|
46698
46710
|
|
|
46699
46711
|
// src/chat/MessageList.tsx
|
|
46700
|
-
import { Fragment as Fragment17, jsx as
|
|
46712
|
+
import { Fragment as Fragment17, jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
46701
46713
|
function isReasoningRevealingForMessage(message, isRevealing, isStopping = false) {
|
|
46702
46714
|
if (isStopping) return false;
|
|
46703
46715
|
const hasContent = message?.content != null && message.content.length > 0;
|
|
@@ -46790,6 +46802,7 @@ function MessageListBody({
|
|
|
46790
46802
|
const askAnswers = useSessionState(sessionId, (state) => state.askAnswers);
|
|
46791
46803
|
const stateIsStreaming = useSessionState(sessionId, (state) => state.isStreaming);
|
|
46792
46804
|
const sessionIsStreaming = streamingOverride ?? stateIsStreaming;
|
|
46805
|
+
const isPreparing = sessionIsStreaming && isPreparingReply(messages);
|
|
46793
46806
|
const agentLoopNameSet = useMemo16(() => new Set(Object.keys(agentLoops ?? {})), [agentLoops]);
|
|
46794
46807
|
const assistantMessagesCacheRef = useRef26(/* @__PURE__ */ new Map());
|
|
46795
46808
|
const stickContextRef = useRef26(null);
|
|
@@ -47700,15 +47713,15 @@ function MessageListBody({
|
|
|
47700
47713
|
stablePrefixEnd,
|
|
47701
47714
|
virtualizer
|
|
47702
47715
|
]);
|
|
47703
|
-
return /* @__PURE__ */
|
|
47716
|
+
return /* @__PURE__ */ jsxs42(
|
|
47704
47717
|
"div",
|
|
47705
47718
|
{
|
|
47706
47719
|
ref: containerRef,
|
|
47707
47720
|
part: "messages",
|
|
47708
47721
|
className: `blade-chat-messages relative min-h-0 flex-1 ${customization?.classNames?.messageListRoot ?? ""}`,
|
|
47709
47722
|
children: [
|
|
47710
|
-
sessionIsStreaming || isRevealingAny ? /* @__PURE__ */
|
|
47711
|
-
turnNavItems.length > 1 ? /* @__PURE__ */
|
|
47723
|
+
!isPreparing && (sessionIsStreaming || isRevealingAny) ? /* @__PURE__ */ jsx48("output", { className: "sr-only", children: "\u6B63\u5728\u751F\u6210\u56DE\u590D" }) : null,
|
|
47724
|
+
turnNavItems.length > 1 ? /* @__PURE__ */ jsx48(
|
|
47712
47725
|
TurnNavRail,
|
|
47713
47726
|
{
|
|
47714
47727
|
items: turnNavItems,
|
|
@@ -47719,7 +47732,7 @@ function MessageListBody({
|
|
|
47719
47732
|
failedTurnId: navFailedEntryId
|
|
47720
47733
|
}
|
|
47721
47734
|
) : null,
|
|
47722
|
-
/* @__PURE__ */
|
|
47735
|
+
/* @__PURE__ */ jsxs42(
|
|
47723
47736
|
StickToBottom,
|
|
47724
47737
|
{
|
|
47725
47738
|
contextRef: stickContextRef,
|
|
@@ -47728,7 +47741,7 @@ function MessageListBody({
|
|
|
47728
47741
|
resize: stickyTurn ? { damping: 0.8, stiffness: 0.08, mass: 1 } : "instant",
|
|
47729
47742
|
targetScrollTop: shouldAnchorEntry ? getAnchorTargetScrollTop : void 0,
|
|
47730
47743
|
children: [
|
|
47731
|
-
/* @__PURE__ */
|
|
47744
|
+
/* @__PURE__ */ jsxs42(
|
|
47732
47745
|
StickToBottom.Content,
|
|
47733
47746
|
{
|
|
47734
47747
|
part: "messages-scroll",
|
|
@@ -47737,7 +47750,7 @@ function MessageListBody({
|
|
|
47737
47750
|
customization?.classNames?.messageListViewport
|
|
47738
47751
|
),
|
|
47739
47752
|
children: [
|
|
47740
|
-
/* @__PURE__ */
|
|
47753
|
+
/* @__PURE__ */ jsx48(
|
|
47741
47754
|
MessageListContent,
|
|
47742
47755
|
{
|
|
47743
47756
|
askAnswers,
|
|
@@ -47772,11 +47785,12 @@ function MessageListBody({
|
|
|
47772
47785
|
emptyState
|
|
47773
47786
|
}
|
|
47774
47787
|
),
|
|
47775
|
-
/* @__PURE__ */
|
|
47788
|
+
isPreparing ? /* @__PURE__ */ jsx48("div", { className: "mx-auto mt-3 max-w-[748px] px-4", children: /* @__PURE__ */ jsx48(ChatLoadingIndicator, { preparing: true }) }) : null,
|
|
47789
|
+
/* @__PURE__ */ jsx48("div", { ref: newTurnSpacerRef, "aria-hidden": "true", className: "pointer-events-none w-full" })
|
|
47776
47790
|
]
|
|
47777
47791
|
}
|
|
47778
47792
|
),
|
|
47779
|
-
/* @__PURE__ */
|
|
47793
|
+
/* @__PURE__ */ jsx48(ScrollToBottomButton, { onBeforeScroll: releaseNewTurnPin })
|
|
47780
47794
|
]
|
|
47781
47795
|
},
|
|
47782
47796
|
scrollEntryId ?? "latest"
|
|
@@ -47840,31 +47854,31 @@ function MessageListContent({
|
|
|
47840
47854
|
};
|
|
47841
47855
|
const RenderBlockView = (block, globalBlockIndex) => {
|
|
47842
47856
|
if (block.type === "message") {
|
|
47843
|
-
return /* @__PURE__ */
|
|
47857
|
+
return /* @__PURE__ */ jsx48(
|
|
47844
47858
|
"div",
|
|
47845
47859
|
{
|
|
47846
47860
|
id: block.anchorId ?? void 0,
|
|
47847
47861
|
"data-entry-id": block.message.entry_id,
|
|
47848
47862
|
className: "msg-animate scroll-mt-6",
|
|
47849
|
-
children: isBackgroundWakeMessage3(block.message) ? /* @__PURE__ */
|
|
47863
|
+
children: isBackgroundWakeMessage3(block.message) ? /* @__PURE__ */ jsx48(BackgroundWakeNotice, {}) : isUserMessage(block.message) ? customization?.components?.UserMessage ? /* @__PURE__ */ jsx48(
|
|
47850
47864
|
customization.components.UserMessage,
|
|
47851
47865
|
{
|
|
47852
47866
|
message: block.message,
|
|
47853
47867
|
className: customization.classNames?.userMessage
|
|
47854
47868
|
}
|
|
47855
|
-
) : /* @__PURE__ */
|
|
47869
|
+
) : /* @__PURE__ */ jsx48(
|
|
47856
47870
|
UserMessageBubble,
|
|
47857
47871
|
{
|
|
47858
47872
|
message: block.message,
|
|
47859
47873
|
className: customization?.classNames?.userMessage
|
|
47860
47874
|
}
|
|
47861
|
-
) : isErrorMessage(block.message) ? customization?.components?.ErrorMessage ? /* @__PURE__ */
|
|
47875
|
+
) : isErrorMessage(block.message) ? customization?.components?.ErrorMessage ? /* @__PURE__ */ jsx48(
|
|
47862
47876
|
customization.components.ErrorMessage,
|
|
47863
47877
|
{
|
|
47864
47878
|
message: block.message,
|
|
47865
47879
|
className: customization.classNames?.errorMessage
|
|
47866
47880
|
}
|
|
47867
|
-
) : /* @__PURE__ */
|
|
47881
|
+
) : /* @__PURE__ */ jsx48(
|
|
47868
47882
|
ErrorMessageBlock,
|
|
47869
47883
|
{
|
|
47870
47884
|
message: block.message,
|
|
@@ -47887,7 +47901,7 @@ function MessageListContent({
|
|
|
47887
47901
|
const isHistoricalPlan = globalBlockIndex !== latestPlanCardBlockIndex;
|
|
47888
47902
|
const blockFeedback = displayMessages.map((message) => message.entry_id && resultFeedbackByEntry.get(message.entry_id)).find((feedback) => feedback != null);
|
|
47889
47903
|
const isActiveFollowup = block.anchorId === followupTurnId;
|
|
47890
|
-
return /* @__PURE__ */
|
|
47904
|
+
return /* @__PURE__ */ jsxs42(
|
|
47891
47905
|
"div",
|
|
47892
47906
|
{
|
|
47893
47907
|
ref: getTurnElementRef(block.anchorId),
|
|
@@ -47896,13 +47910,13 @@ function MessageListContent({
|
|
|
47896
47910
|
"data-entry-id": block.messages[0]?.entry_id,
|
|
47897
47911
|
className: "msg-animate flex scroll-mt-6 flex-col gap-4",
|
|
47898
47912
|
children: [
|
|
47899
|
-
/* @__PURE__ */
|
|
47913
|
+
/* @__PURE__ */ jsx48(
|
|
47900
47914
|
RenderErrorBoundary,
|
|
47901
47915
|
{
|
|
47902
47916
|
label: "\u52A9\u624B\u6D88\u606F",
|
|
47903
47917
|
details: block.key,
|
|
47904
47918
|
resetKey: getMessagesResetSignature(displayMessages),
|
|
47905
|
-
children: customization?.components?.AssistantTurn ? /* @__PURE__ */
|
|
47919
|
+
children: customization?.components?.AssistantTurn ? /* @__PURE__ */ jsx48(
|
|
47906
47920
|
customization.components.AssistantTurn,
|
|
47907
47921
|
{
|
|
47908
47922
|
turnKey: block.key,
|
|
@@ -47916,7 +47930,7 @@ function MessageListContent({
|
|
|
47916
47930
|
sessionStatus,
|
|
47917
47931
|
customization
|
|
47918
47932
|
}
|
|
47919
|
-
) : /* @__PURE__ */
|
|
47933
|
+
) : /* @__PURE__ */ jsx48(
|
|
47920
47934
|
AssistantTurnBlock,
|
|
47921
47935
|
{
|
|
47922
47936
|
turnKey: block.key,
|
|
@@ -47933,13 +47947,13 @@ function MessageListContent({
|
|
|
47933
47947
|
)
|
|
47934
47948
|
}
|
|
47935
47949
|
),
|
|
47936
|
-
showPlanCard ? /* @__PURE__ */
|
|
47950
|
+
showPlanCard ? /* @__PURE__ */ jsx48(
|
|
47937
47951
|
RenderErrorBoundary,
|
|
47938
47952
|
{
|
|
47939
47953
|
label: "\u89C4\u5212\u6458\u8981",
|
|
47940
47954
|
details: block.key,
|
|
47941
47955
|
resetKey: `${sessionStatus ?? ""}:${layoutSignature}`,
|
|
47942
|
-
children: /* @__PURE__ */
|
|
47956
|
+
children: /* @__PURE__ */ jsx48(
|
|
47943
47957
|
PlanSummaryCard,
|
|
47944
47958
|
{
|
|
47945
47959
|
messages: extractPlanMessagesForTurn(messages, block.messages.at(-1)),
|
|
@@ -47951,8 +47965,8 @@ function MessageListContent({
|
|
|
47951
47965
|
)
|
|
47952
47966
|
}
|
|
47953
47967
|
) : null,
|
|
47954
|
-
blockFeedback && !isActiveFollowup ? /* @__PURE__ */
|
|
47955
|
-
isActiveFollowup ? /* @__PURE__ */
|
|
47968
|
+
blockFeedback && !isActiveFollowup ? /* @__PURE__ */ jsx48(HistoricalResultFeedback, { feedback: blockFeedback }) : null,
|
|
47969
|
+
isActiveFollowup ? /* @__PURE__ */ jsx48(
|
|
47956
47970
|
PostChatFollowupBlock,
|
|
47957
47971
|
{
|
|
47958
47972
|
sessionId,
|
|
@@ -47967,7 +47981,7 @@ function MessageListContent({
|
|
|
47967
47981
|
);
|
|
47968
47982
|
}
|
|
47969
47983
|
if (block.type === "compaction") {
|
|
47970
|
-
return /* @__PURE__ */
|
|
47984
|
+
return /* @__PURE__ */ jsx48("div", { className: "msg-animate", children: /* @__PURE__ */ jsx48(
|
|
47971
47985
|
CompactionCard,
|
|
47972
47986
|
{
|
|
47973
47987
|
sessionId,
|
|
@@ -47978,17 +47992,17 @@ function MessageListContent({
|
|
|
47978
47992
|
}
|
|
47979
47993
|
if (block.type === "context_group") {
|
|
47980
47994
|
const contexts = block.messages.map((message) => message.context).filter((context) => Boolean(context));
|
|
47981
|
-
return contexts.length > 0 ? /* @__PURE__ */
|
|
47995
|
+
return contexts.length > 0 ? /* @__PURE__ */ jsx48("div", { className: "msg-animate", "data-entry-id": block.messages[0].entry_id, children: /* @__PURE__ */ jsx48(ContextGroupCard, { contexts }) }) : null;
|
|
47982
47996
|
}
|
|
47983
47997
|
if (block.type === "context_divider") {
|
|
47984
|
-
return /* @__PURE__ */
|
|
47998
|
+
return /* @__PURE__ */ jsx48(ContextDivider, {});
|
|
47985
47999
|
}
|
|
47986
|
-
return /* @__PURE__ */
|
|
48000
|
+
return /* @__PURE__ */ jsx48(PlanningDivider, { kind: block.kind });
|
|
47987
48001
|
};
|
|
47988
48002
|
const renderMeasuredRow = (block, globalBlockIndex, virtualItem) => {
|
|
47989
48003
|
const persistentId = getRenderBlockPersistentId(block);
|
|
47990
48004
|
const isVirtual = virtualItem !== void 0;
|
|
47991
|
-
return /* @__PURE__ */
|
|
48005
|
+
return /* @__PURE__ */ jsxs42(
|
|
47992
48006
|
"div",
|
|
47993
48007
|
{
|
|
47994
48008
|
ref: getMeasuredRowRef(block, globalBlockIndex, isVirtual),
|
|
@@ -48008,31 +48022,31 @@ function MessageListContent({
|
|
|
48008
48022
|
},
|
|
48009
48023
|
children: [
|
|
48010
48024
|
RenderBlockView(block, globalBlockIndex),
|
|
48011
|
-
isVirtual && globalBlockIndex < stablePrefixEnd - 1 ? /* @__PURE__ */
|
|
48025
|
+
isVirtual && globalBlockIndex < stablePrefixEnd - 1 ? /* @__PURE__ */ jsx48("div", { "aria-hidden": "true", className: "h-0 shrink-0" }) : null
|
|
48012
48026
|
]
|
|
48013
48027
|
},
|
|
48014
48028
|
block.key
|
|
48015
48029
|
);
|
|
48016
48030
|
};
|
|
48017
|
-
return /* @__PURE__ */
|
|
48031
|
+
return /* @__PURE__ */ jsx48(
|
|
48018
48032
|
"div",
|
|
48019
48033
|
{
|
|
48020
48034
|
part: "messages-content",
|
|
48021
48035
|
className: `blade-chat-messages-content mx-auto max-w-[748px] ${customization?.classNames?.messageListContent ?? ""}`,
|
|
48022
|
-
children: /* @__PURE__ */
|
|
48023
|
-
renderBlocks.length === 0 && isLoadingHistory ? /* @__PURE__ */
|
|
48036
|
+
children: /* @__PURE__ */ jsxs42("div", { className: `min-w-0 flex flex-col gap-9 ${customization?.classNames?.messageListInner ?? ""}`, children: [
|
|
48037
|
+
renderBlocks.length === 0 && isLoadingHistory ? /* @__PURE__ */ jsx48(HistoryLoadingPlaceholder, {}) : renderBlocks.length === 0 ? emptyState ? emptyState : customization?.components?.EmptyState ? /* @__PURE__ */ jsx48(customization.components.EmptyState, {}) : /* @__PURE__ */ jsxs42(
|
|
48024
48038
|
"div",
|
|
48025
48039
|
{
|
|
48026
48040
|
part: "empty",
|
|
48027
48041
|
className: `blade-chat-empty flex flex-col items-center justify-center gap-3 py-24 text-[hsl(var(--muted-foreground))] ${customization?.classNames?.emptyState ?? ""}`,
|
|
48028
48042
|
children: [
|
|
48029
|
-
/* @__PURE__ */
|
|
48030
|
-
/* @__PURE__ */
|
|
48031
|
-
/* @__PURE__ */
|
|
48043
|
+
/* @__PURE__ */ jsx48(MessageSquare, { size: 40, strokeWidth: 1.5 }),
|
|
48044
|
+
/* @__PURE__ */ jsx48("span", { className: "text-base font-medium", children: "\u5F00\u59CB\u5BF9\u8BDD" }),
|
|
48045
|
+
/* @__PURE__ */ jsx48("span", { className: "text-sm opacity-60", children: "\u5728\u4E0B\u65B9\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u804A\u5929" })
|
|
48032
48046
|
]
|
|
48033
48047
|
}
|
|
48034
|
-
) : /* @__PURE__ */
|
|
48035
|
-
stablePrefixEnd > 0 ? /* @__PURE__ */
|
|
48048
|
+
) : /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
48049
|
+
stablePrefixEnd > 0 ? /* @__PURE__ */ jsx48(
|
|
48036
48050
|
"div",
|
|
48037
48051
|
{
|
|
48038
48052
|
ref: virtualPrefixRef,
|
|
@@ -48049,23 +48063,23 @@ function MessageListContent({
|
|
|
48049
48063
|
(block, residentIndex) => renderMeasuredRow(block, stablePrefixEnd + residentIndex)
|
|
48050
48064
|
)
|
|
48051
48065
|
] }),
|
|
48052
|
-
sessionStatus === "interrupted" && !hasInterruptedTurn ? /* @__PURE__ */
|
|
48066
|
+
sessionStatus === "interrupted" && !hasInterruptedTurn ? /* @__PURE__ */ jsx48("div", { className: "flex", children: /* @__PURE__ */ jsx48("div", { className: "rounded-full border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--swf-warning))]", children: "\u5DF2\u4E2D\u65AD" }) }) : null
|
|
48053
48067
|
] })
|
|
48054
48068
|
}
|
|
48055
48069
|
);
|
|
48056
48070
|
}
|
|
48057
48071
|
function HistoryLoadingPlaceholder() {
|
|
48058
|
-
return /* @__PURE__ */
|
|
48059
|
-
/* @__PURE__ */
|
|
48060
|
-
/* @__PURE__ */
|
|
48061
|
-
/* @__PURE__ */
|
|
48072
|
+
return /* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-9", "aria-busy": "true", "aria-live": "polite", children: [
|
|
48073
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-center justify-center gap-2 text-sm text-[hsl(var(--muted-foreground))]", children: [
|
|
48074
|
+
/* @__PURE__ */ jsx48("span", { className: "size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
48075
|
+
/* @__PURE__ */ jsx48("span", { children: "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD\u8BB0\u5F55\u2026" })
|
|
48062
48076
|
] }),
|
|
48063
|
-
[0, 1].map((index2) => /* @__PURE__ */
|
|
48064
|
-
/* @__PURE__ */
|
|
48065
|
-
/* @__PURE__ */
|
|
48066
|
-
/* @__PURE__ */
|
|
48067
|
-
/* @__PURE__ */
|
|
48068
|
-
/* @__PURE__ */
|
|
48077
|
+
[0, 1].map((index2) => /* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-4", children: [
|
|
48078
|
+
/* @__PURE__ */ jsx48("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx48("div", { className: "h-10 w-2/5 animate-pulse rounded-2xl bg-[hsl(var(--muted))]" }) }),
|
|
48079
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-2.5", children: [
|
|
48080
|
+
/* @__PURE__ */ jsx48("div", { className: "h-4 w-1/3 animate-pulse rounded bg-[hsl(var(--muted))]" }),
|
|
48081
|
+
/* @__PURE__ */ jsx48("div", { className: "h-4 w-4/5 animate-pulse rounded bg-[hsl(var(--muted))]" }),
|
|
48082
|
+
/* @__PURE__ */ jsx48("div", { className: "h-4 w-3/5 animate-pulse rounded bg-[hsl(var(--muted))]" })
|
|
48069
48083
|
] })
|
|
48070
48084
|
] }, index2))
|
|
48071
48085
|
] });
|
|
@@ -48073,7 +48087,7 @@ function HistoryLoadingPlaceholder() {
|
|
|
48073
48087
|
function ScrollToBottomButton({ onBeforeScroll }) {
|
|
48074
48088
|
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
48075
48089
|
if (isAtBottom) return null;
|
|
48076
|
-
return /* @__PURE__ */
|
|
48090
|
+
return /* @__PURE__ */ jsxs42(
|
|
48077
48091
|
"button",
|
|
48078
48092
|
{
|
|
48079
48093
|
type: "button",
|
|
@@ -48085,28 +48099,28 @@ function ScrollToBottomButton({ onBeforeScroll }) {
|
|
|
48085
48099
|
part: "scroll-bottom",
|
|
48086
48100
|
className: "blade-chat-scroll-bottom absolute bottom-4 right-4 flex items-center gap-1 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-3 py-1.5 text-xs text-[hsl(var(--muted-foreground))] shadow-[var(--swf-shadow-overlay)] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
|
|
48087
48101
|
children: [
|
|
48088
|
-
/* @__PURE__ */
|
|
48089
|
-
/* @__PURE__ */
|
|
48102
|
+
/* @__PURE__ */ jsx48(ChevronDown, { size: 14 }),
|
|
48103
|
+
/* @__PURE__ */ jsx48("span", { className: "blade-chat-scroll-bottom-label", children: "\u6EDA\u52A8\u5230\u5E95\u90E8" })
|
|
48090
48104
|
]
|
|
48091
48105
|
}
|
|
48092
48106
|
);
|
|
48093
48107
|
}
|
|
48094
48108
|
function PlanningDivider({ kind }) {
|
|
48095
48109
|
const isEnter = kind === "enter";
|
|
48096
|
-
return /* @__PURE__ */
|
|
48097
|
-
/* @__PURE__ */
|
|
48098
|
-
/* @__PURE__ */
|
|
48099
|
-
/* @__PURE__ */
|
|
48100
|
-
/* @__PURE__ */
|
|
48110
|
+
return /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-3 py-1", children: [
|
|
48111
|
+
/* @__PURE__ */ jsx48("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" }),
|
|
48112
|
+
/* @__PURE__ */ jsxs42("div", { className: "inline-flex items-center gap-1.5 rounded-full border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-3 py-1 text-[11px] text-[hsl(var(--swf-warning))]", children: [
|
|
48113
|
+
/* @__PURE__ */ jsx48(Lightbulb, { size: 12 }),
|
|
48114
|
+
/* @__PURE__ */ jsx48("span", { children: isEnter ? "\u8FDB\u5165\u89C4\u5212\u6A21\u5F0F" : "\u89C4\u5212\u5B8C\u6210" })
|
|
48101
48115
|
] }),
|
|
48102
|
-
/* @__PURE__ */
|
|
48116
|
+
/* @__PURE__ */ jsx48("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" })
|
|
48103
48117
|
] });
|
|
48104
48118
|
}
|
|
48105
48119
|
function ContextDivider() {
|
|
48106
|
-
return /* @__PURE__ */
|
|
48120
|
+
return /* @__PURE__ */ jsx48("div", { "aria-hidden": "true", className: "h-px w-full bg-[hsl(var(--border)/0.55)]" });
|
|
48107
48121
|
}
|
|
48108
48122
|
function MessageList(props) {
|
|
48109
|
-
return /* @__PURE__ */
|
|
48123
|
+
return /* @__PURE__ */ jsx48(CurrentChatSessionProvider, { sessionId: props.sessionId || null, children: /* @__PURE__ */ jsx48(MessageListBody, { ...props }) });
|
|
48110
48124
|
}
|
|
48111
48125
|
|
|
48112
48126
|
// src/chat/runtime/use-chat-actions.ts
|
|
@@ -48250,14 +48264,14 @@ function useSessionReplay(sessionId) {
|
|
|
48250
48264
|
}
|
|
48251
48265
|
|
|
48252
48266
|
// src/chat/SessionReplayBar.tsx
|
|
48253
|
-
import { jsx as
|
|
48267
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
48254
48268
|
function SessionReplayBar({
|
|
48255
48269
|
sessionId,
|
|
48256
48270
|
className,
|
|
48257
48271
|
onExit
|
|
48258
48272
|
}) {
|
|
48259
48273
|
const { isReplay, canControl, speed, setSpeed, exitToAutonomous } = useSessionReplay(sessionId);
|
|
48260
|
-
return /* @__PURE__ */
|
|
48274
|
+
return /* @__PURE__ */ jsx49(
|
|
48261
48275
|
ReplayBar,
|
|
48262
48276
|
{
|
|
48263
48277
|
isReplay,
|
|
@@ -48271,7 +48285,7 @@ function SessionReplayBar({
|
|
|
48271
48285
|
}
|
|
48272
48286
|
|
|
48273
48287
|
// src/chat/ChatPanel.tsx
|
|
48274
|
-
import { Fragment as Fragment18, jsx as
|
|
48288
|
+
import { Fragment as Fragment18, jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
48275
48289
|
function nextQueuedOrder(items, itemId, delta) {
|
|
48276
48290
|
const pending = items.filter((item) => item.status === "pending");
|
|
48277
48291
|
const index2 = pending.findIndex((item) => item.id === itemId);
|
|
@@ -48499,7 +48513,7 @@ function ChatPanel({
|
|
|
48499
48513
|
onCommand,
|
|
48500
48514
|
canCreateBoardTask,
|
|
48501
48515
|
canShareSession,
|
|
48502
|
-
planPanel: !lite ? /* @__PURE__ */
|
|
48516
|
+
planPanel: !lite ? /* @__PURE__ */ jsx50(CurrentPlanPanel, { sessionId, className: "border-b border-[hsl(var(--border))] px-4" }) : null,
|
|
48503
48517
|
maxWidthClassName: cn("max-w-3xl", classNames?.chatInputInner),
|
|
48504
48518
|
// 队列面板此刻占位时,输入框上两角改直角,跟它拼成一条完整轮廓。
|
|
48505
48519
|
// 用面板自己上报的状态,不在宿主侧复算。
|
|
@@ -48524,14 +48538,14 @@ function ChatPanel({
|
|
|
48524
48538
|
initialDraftKey,
|
|
48525
48539
|
lite
|
|
48526
48540
|
};
|
|
48527
|
-
return /* @__PURE__ */
|
|
48541
|
+
return /* @__PURE__ */ jsx50(CurrentChatSessionProvider, { sessionId: sessionId || null, children: /* @__PURE__ */ jsx50(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsx50(FollowupInteractionProvider, { value: onFollowupInteraction, children: /* @__PURE__ */ jsx50(McpAppMessageContext.Provider, { value: handleMcpAppMessage, children: /* @__PURE__ */ jsxs43(
|
|
48528
48542
|
"div",
|
|
48529
48543
|
{
|
|
48530
48544
|
"data-theme": theme,
|
|
48531
48545
|
part: "root",
|
|
48532
48546
|
className: cn("blade-chat flex min-h-0 flex-1 flex-col overflow-hidden", classNames?.root),
|
|
48533
48547
|
children: [
|
|
48534
|
-
isViewer && /* @__PURE__ */
|
|
48548
|
+
isViewer && /* @__PURE__ */ jsxs43(
|
|
48535
48549
|
"div",
|
|
48536
48550
|
{
|
|
48537
48551
|
className: cn(
|
|
@@ -48539,27 +48553,27 @@ function ChatPanel({
|
|
|
48539
48553
|
classNames?.viewerBanner
|
|
48540
48554
|
),
|
|
48541
48555
|
children: [
|
|
48542
|
-
/* @__PURE__ */
|
|
48556
|
+
/* @__PURE__ */ jsx50(Eye, { size: 14 }),
|
|
48543
48557
|
"\u4F60\u6B63\u5728\u67E5\u770B\u5206\u4EAB\u7684\u4F1A\u8BDD\uFF08\u53EA\u8BFB\uFF09"
|
|
48544
48558
|
]
|
|
48545
48559
|
}
|
|
48546
48560
|
),
|
|
48547
|
-
!isViewer && /* @__PURE__ */
|
|
48561
|
+
!isViewer && /* @__PURE__ */ jsx50(ConnectionBanner, { connection }),
|
|
48548
48562
|
banner,
|
|
48549
|
-
/* @__PURE__ */
|
|
48550
|
-
errorMessage && /* @__PURE__ */
|
|
48563
|
+
/* @__PURE__ */ jsx50(SessionReplayBar, { sessionId, onExit: onExitReplay }),
|
|
48564
|
+
errorMessage && /* @__PURE__ */ jsxs43(
|
|
48551
48565
|
"div",
|
|
48552
48566
|
{
|
|
48553
48567
|
part: "error-bar",
|
|
48554
48568
|
className: "blade-chat-error-bar flex items-start gap-2 border-b border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-4 py-3 text-sm text-[hsl(var(--swf-danger))]",
|
|
48555
48569
|
children: [
|
|
48556
|
-
/* @__PURE__ */
|
|
48557
|
-
/* @__PURE__ */
|
|
48570
|
+
/* @__PURE__ */ jsx50(CircleAlert, { size: 16, className: "mt-0.5 shrink-0" }),
|
|
48571
|
+
/* @__PURE__ */ jsx50("span", { className: "min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]", children: chatErrorForDisplay3(errorMessage, developer) })
|
|
48558
48572
|
]
|
|
48559
48573
|
}
|
|
48560
48574
|
),
|
|
48561
48575
|
header,
|
|
48562
|
-
developer && DeveloperMessageList ? /* @__PURE__ */
|
|
48576
|
+
developer && DeveloperMessageList ? /* @__PURE__ */ jsx50(
|
|
48563
48577
|
DeveloperMessageList,
|
|
48564
48578
|
{
|
|
48565
48579
|
sessionId,
|
|
@@ -48580,7 +48594,7 @@ function ChatPanel({
|
|
|
48580
48594
|
isReplay
|
|
48581
48595
|
},
|
|
48582
48596
|
sessionId
|
|
48583
|
-
) : lite ? /* @__PURE__ */
|
|
48597
|
+
) : lite ? /* @__PURE__ */ jsx50(
|
|
48584
48598
|
LiteMessageList,
|
|
48585
48599
|
{
|
|
48586
48600
|
sessionId,
|
|
@@ -48597,7 +48611,7 @@ function ChatPanel({
|
|
|
48597
48611
|
onAnswer: isViewer ? void 0 : answerQuestion
|
|
48598
48612
|
},
|
|
48599
48613
|
sessionId
|
|
48600
|
-
) : /* @__PURE__ */
|
|
48614
|
+
) : /* @__PURE__ */ jsx50(
|
|
48601
48615
|
MessageList,
|
|
48602
48616
|
{
|
|
48603
48617
|
sessionId,
|
|
@@ -48623,15 +48637,15 @@ function ChatPanel({
|
|
|
48623
48637
|
},
|
|
48624
48638
|
sessionId
|
|
48625
48639
|
),
|
|
48626
|
-
isViewer && !lite ? /* @__PURE__ */
|
|
48640
|
+
isViewer && !lite ? /* @__PURE__ */ jsx50(
|
|
48627
48641
|
CurrentPlanPanel,
|
|
48628
48642
|
{
|
|
48629
48643
|
sessionId,
|
|
48630
48644
|
className: cn("mx-auto w-full max-w-3xl px-5 pb-3", classNames?.chatInputInner)
|
|
48631
48645
|
}
|
|
48632
48646
|
) : null,
|
|
48633
|
-
!isViewer && /* @__PURE__ */
|
|
48634
|
-
/* @__PURE__ */
|
|
48647
|
+
!isViewer && /* @__PURE__ */ jsxs43(Fragment18, { children: [
|
|
48648
|
+
/* @__PURE__ */ jsx50(
|
|
48635
48649
|
SessionQueuePanel,
|
|
48636
48650
|
{
|
|
48637
48651
|
snapshot: queue,
|
|
@@ -48652,7 +48666,7 @@ function ChatPanel({
|
|
|
48652
48666
|
},
|
|
48653
48667
|
sessionId
|
|
48654
48668
|
),
|
|
48655
|
-
/* @__PURE__ */
|
|
48669
|
+
/* @__PURE__ */ jsx50(Composer, { ...composerProps })
|
|
48656
48670
|
] }),
|
|
48657
48671
|
footer
|
|
48658
48672
|
]
|
|
@@ -48662,14 +48676,14 @@ function ChatPanel({
|
|
|
48662
48676
|
|
|
48663
48677
|
// src/components/SessionPluginSelector.tsx
|
|
48664
48678
|
import { useEffect as useEffect29, useState as useState35 } from "react";
|
|
48665
|
-
import { jsx as
|
|
48679
|
+
import { jsx as jsx51, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
48666
48680
|
function SessionPluginSelector(props) {
|
|
48667
|
-
return /* @__PURE__ */
|
|
48681
|
+
return /* @__PURE__ */ jsx51(PluginSelectorState, { ...props }, props.sessionId);
|
|
48668
48682
|
}
|
|
48669
48683
|
function PluginSelectorState({ client, sessionId, className, side = "bottom", onChange }) {
|
|
48670
48684
|
const [open2, setOpen] = useState35(false);
|
|
48671
|
-
return /* @__PURE__ */
|
|
48672
|
-
/* @__PURE__ */
|
|
48685
|
+
return /* @__PURE__ */ jsxs44("div", { className: `relative text-xs ${className ?? ""}`, children: [
|
|
48686
|
+
/* @__PURE__ */ jsx51(
|
|
48673
48687
|
"button",
|
|
48674
48688
|
{
|
|
48675
48689
|
type: "button",
|
|
@@ -48680,7 +48694,7 @@ function PluginSelectorState({ client, sessionId, className, side = "bottom", on
|
|
|
48680
48694
|
children: "\u4F1A\u8BDD\u63D2\u4EF6"
|
|
48681
48695
|
}
|
|
48682
48696
|
),
|
|
48683
|
-
open2 ? /* @__PURE__ */
|
|
48697
|
+
open2 ? /* @__PURE__ */ jsx51(PluginSelectorList, { client, sessionId, side, onChange }) : null
|
|
48684
48698
|
] });
|
|
48685
48699
|
}
|
|
48686
48700
|
function PluginSelectorList({
|
|
@@ -48694,13 +48708,13 @@ function PluginSelectorList({
|
|
|
48694
48708
|
useEffect29(() => {
|
|
48695
48709
|
reload();
|
|
48696
48710
|
}, [reload]);
|
|
48697
|
-
return /* @__PURE__ */
|
|
48711
|
+
return /* @__PURE__ */ jsxs44(
|
|
48698
48712
|
"div",
|
|
48699
48713
|
{
|
|
48700
48714
|
className: `absolute left-0 z-40 my-2 max-h-72 w-72 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-3 text-[hsl(var(--popover-foreground))] shadow-lg ${side === "top" ? "bottom-full" : "top-full"}`,
|
|
48701
48715
|
children: [
|
|
48702
|
-
controller.listError ? /* @__PURE__ */
|
|
48703
|
-
/* @__PURE__ */
|
|
48716
|
+
controller.listError ? /* @__PURE__ */ jsx51("button", { type: "button", onClick: reload, children: "\u63D2\u4EF6\u5217\u8868\u6682\u4E0D\u53EF\u7528\uFF0C\u70B9\u51FB\u91CD\u8BD5" }) : null,
|
|
48717
|
+
/* @__PURE__ */ jsx51(
|
|
48704
48718
|
PluginConnectorList,
|
|
48705
48719
|
{
|
|
48706
48720
|
client,
|
|
@@ -48724,7 +48738,7 @@ function PluginSelectorList({
|
|
|
48724
48738
|
}
|
|
48725
48739
|
|
|
48726
48740
|
// src/components/AgentChat.tsx
|
|
48727
|
-
import { Fragment as Fragment19, jsx as
|
|
48741
|
+
import { Fragment as Fragment19, jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
48728
48742
|
function isUnauthorizedError(error61) {
|
|
48729
48743
|
return error61 instanceof BladeApiError2 && error61.status === 401;
|
|
48730
48744
|
}
|
|
@@ -48743,11 +48757,11 @@ function LoginCard({ client, onLoggedIn }) {
|
|
|
48743
48757
|
setLoggingIn(false);
|
|
48744
48758
|
}
|
|
48745
48759
|
};
|
|
48746
|
-
return /* @__PURE__ */
|
|
48747
|
-
/* @__PURE__ */
|
|
48748
|
-
/* @__PURE__ */
|
|
48749
|
-
/* @__PURE__ */
|
|
48750
|
-
/* @__PURE__ */
|
|
48760
|
+
return /* @__PURE__ */ jsx52("div", { className: "blade-chat-login flex flex-1 items-center justify-center p-6", children: /* @__PURE__ */ jsxs45("div", { className: "flex w-full max-w-sm flex-col items-center gap-4 rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-6 py-8 text-center", children: [
|
|
48761
|
+
/* @__PURE__ */ jsx52(LockKeyhole, { size: 28, className: "text-[hsl(var(--muted-foreground))]" }),
|
|
48762
|
+
/* @__PURE__ */ jsx52("div", { className: "text-base font-medium text-[hsl(var(--foreground))]", children: "\u9700\u8981\u767B\u5F55\u540E\u4F7F\u7528" }),
|
|
48763
|
+
/* @__PURE__ */ jsx52("div", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: "\u767B\u5F55\u540E\u5373\u53EF\u4E0E\u667A\u80FD\u4F53\u5BF9\u8BDD\uFF0C\u4F60\u7684\u4F1A\u8BDD\u5185\u5BB9\u4EC5\u81EA\u5DF1\u53EF\u89C1\u3002" }),
|
|
48764
|
+
/* @__PURE__ */ jsx52(
|
|
48751
48765
|
"button",
|
|
48752
48766
|
{
|
|
48753
48767
|
type: "button",
|
|
@@ -48757,7 +48771,7 @@ function LoginCard({ client, onLoggedIn }) {
|
|
|
48757
48771
|
children: loggingIn ? "\u767B\u5F55\u4E2D\u2026" : "\u767B\u5F55"
|
|
48758
48772
|
}
|
|
48759
48773
|
),
|
|
48760
|
-
loginError && /* @__PURE__ */
|
|
48774
|
+
loginError && /* @__PURE__ */ jsx52("div", { className: "text-xs text-[hsl(var(--destructive))]", children: loginError })
|
|
48761
48775
|
] }) });
|
|
48762
48776
|
}
|
|
48763
48777
|
function AgentChat(props) {
|
|
@@ -48765,13 +48779,13 @@ function AgentChat(props) {
|
|
|
48765
48779
|
const [attempt, setAttempt] = useState36(0);
|
|
48766
48780
|
const [needLogin, setNeedLogin] = useState36(() => !client.hasToken());
|
|
48767
48781
|
if (needLogin) {
|
|
48768
|
-
return /* @__PURE__ */
|
|
48782
|
+
return /* @__PURE__ */ jsx52(
|
|
48769
48783
|
"div",
|
|
48770
48784
|
{
|
|
48771
48785
|
"data-theme": props.theme,
|
|
48772
48786
|
part: "root",
|
|
48773
48787
|
className: cn("blade-chat flex min-h-0 flex-1 flex-col", props.classNames?.root),
|
|
48774
|
-
children: /* @__PURE__ */
|
|
48788
|
+
children: /* @__PURE__ */ jsx52(
|
|
48775
48789
|
LoginCard,
|
|
48776
48790
|
{
|
|
48777
48791
|
client,
|
|
@@ -48784,7 +48798,7 @@ function AgentChat(props) {
|
|
|
48784
48798
|
}
|
|
48785
48799
|
);
|
|
48786
48800
|
}
|
|
48787
|
-
return /* @__PURE__ */
|
|
48801
|
+
return /* @__PURE__ */ jsx52(ChatSessionView, { ...props, onUnauthorized: () => setNeedLogin(true) }, attempt);
|
|
48788
48802
|
}
|
|
48789
48803
|
function ChatSessionView({
|
|
48790
48804
|
sessionId,
|
|
@@ -48853,7 +48867,7 @@ function ChatSessionView({
|
|
|
48853
48867
|
);
|
|
48854
48868
|
const connectError = error61 && !isUnauthorizedError(error61) ? error61.message || "\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" : null;
|
|
48855
48869
|
const sessionClient = resolvedSessionId && createOptions?.anonymous && !client.options.anonymousSessionId ? client.forAnonymousSession(resolvedSessionId) : client;
|
|
48856
|
-
return /* @__PURE__ */
|
|
48870
|
+
return /* @__PURE__ */ jsx52(BladeProvider, { client: sessionClient, host, children: /* @__PURE__ */ jsx52(SessionSourceProvider, { source, children: /* @__PURE__ */ jsx52(ChatEnvironmentProvider, { value: environment, children: /* @__PURE__ */ jsx52(
|
|
48857
48871
|
ChatPanel,
|
|
48858
48872
|
{
|
|
48859
48873
|
sessionId: resolvedSessionId ?? "",
|
|
@@ -48867,9 +48881,9 @@ function ChatSessionView({
|
|
|
48867
48881
|
onFollowupInteraction,
|
|
48868
48882
|
errorMessage: connectError ?? replay.error?.message ?? notice,
|
|
48869
48883
|
onExitReplay: () => void replay.exitToAutonomous(),
|
|
48870
|
-
banner: /* @__PURE__ */
|
|
48871
|
-
resolvedSessionId && !isViewer && (sessionPluginControls ? sessionPluginControls(resolvedSessionId) : client.options.anonymousSessionId || createOptions?.anonymous ? null : /* @__PURE__ */
|
|
48872
|
-
/* @__PURE__ */
|
|
48884
|
+
banner: /* @__PURE__ */ jsxs45(Fragment19, { children: [
|
|
48885
|
+
resolvedSessionId && !isViewer && (sessionPluginControls ? sessionPluginControls(resolvedSessionId) : client.options.anonymousSessionId || createOptions?.anonymous ? null : /* @__PURE__ */ jsx52(SessionPluginSelector, { client, sessionId: resolvedSessionId })),
|
|
48886
|
+
/* @__PURE__ */ jsx52(ReplayMismatchPrompt, { mismatch: replay.mismatch })
|
|
48873
48887
|
] })
|
|
48874
48888
|
}
|
|
48875
48889
|
) }) }) });
|
|
@@ -49237,7 +49251,7 @@ function toToolCallInfo(call, results, failedToolIds) {
|
|
|
49237
49251
|
|
|
49238
49252
|
// src/components/LlmAdvancedSettings.tsx
|
|
49239
49253
|
import { useState as useState38 } from "react";
|
|
49240
|
-
import { jsx as
|
|
49254
|
+
import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
49241
49255
|
var FIELDS = [
|
|
49242
49256
|
{ id: "baseURL", label: "\u6A21\u578B\u670D\u52A1\u5730\u5740", placeholder: "http://\u5185\u7F51\u5730\u5740/v1" },
|
|
49243
49257
|
{ id: "model", label: "\u6A21\u578B", placeholder: "\u6A21\u578B\u540D\u79F0" },
|
|
@@ -49288,8 +49302,8 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
49288
49302
|
if (!normalized) return null;
|
|
49289
49303
|
const fields = FIELDS.filter((field) => normalized[field.id]);
|
|
49290
49304
|
const dirty = Object.keys(override).length > 0;
|
|
49291
|
-
return /* @__PURE__ */
|
|
49292
|
-
/* @__PURE__ */
|
|
49305
|
+
return /* @__PURE__ */ jsxs46("div", { className: "blade-chat-advanced border-t border-[hsl(var(--border))] px-4 py-2 text-xs", children: [
|
|
49306
|
+
/* @__PURE__ */ jsxs46(
|
|
49293
49307
|
"button",
|
|
49294
49308
|
{
|
|
49295
49309
|
type: "button",
|
|
@@ -49299,16 +49313,16 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
49299
49313
|
},
|
|
49300
49314
|
className: "flex items-center gap-1.5 text-[hsl(var(--muted-foreground))] transition-colors hover:text-[hsl(var(--foreground))]",
|
|
49301
49315
|
children: [
|
|
49302
|
-
/* @__PURE__ */
|
|
49316
|
+
/* @__PURE__ */ jsx53(Settings2, { size: 13 }),
|
|
49303
49317
|
"\u9AD8\u7EA7\u8BBE\u7F6E",
|
|
49304
|
-
dirty && /* @__PURE__ */
|
|
49318
|
+
dirty && /* @__PURE__ */ jsx53("span", { className: "text-[hsl(var(--primary))]", children: "\uFF08\u5DF2\u81EA\u5B9A\u4E49\uFF09" })
|
|
49305
49319
|
]
|
|
49306
49320
|
}
|
|
49307
49321
|
),
|
|
49308
|
-
open2 && /* @__PURE__ */
|
|
49309
|
-
fields.map((field) => /* @__PURE__ */
|
|
49310
|
-
/* @__PURE__ */
|
|
49311
|
-
/* @__PURE__ */
|
|
49322
|
+
open2 && /* @__PURE__ */ jsxs46("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
49323
|
+
fields.map((field) => /* @__PURE__ */ jsxs46("label", { className: "flex flex-col gap-1", children: [
|
|
49324
|
+
/* @__PURE__ */ jsx53("span", { className: "text-[hsl(var(--muted-foreground))]", children: field.label }),
|
|
49325
|
+
/* @__PURE__ */ jsx53(
|
|
49312
49326
|
"input",
|
|
49313
49327
|
{
|
|
49314
49328
|
type: field.secret ? "password" : "text",
|
|
@@ -49319,9 +49333,9 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
49319
49333
|
}
|
|
49320
49334
|
)
|
|
49321
49335
|
] }, field.id)),
|
|
49322
|
-
normalized.apiKey && /* @__PURE__ */
|
|
49323
|
-
/* @__PURE__ */
|
|
49324
|
-
/* @__PURE__ */
|
|
49336
|
+
normalized.apiKey && /* @__PURE__ */ jsx53("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u5BC6\u94A5\u4F1A\u5B58\u5728\u8FD9\u53F0\u6D4F\u89C8\u5668\u91CC\u3002\u53EA\u5728\u4F60\u4FE1\u5F97\u8FC7\u8FD9\u53F0\u673A\u5668\u65F6\u586B\u3002" }),
|
|
49337
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex gap-2", children: [
|
|
49338
|
+
/* @__PURE__ */ jsx53(
|
|
49325
49339
|
"button",
|
|
49326
49340
|
{
|
|
49327
49341
|
type: "button",
|
|
@@ -49336,7 +49350,7 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
49336
49350
|
children: "\u4FDD\u5B58"
|
|
49337
49351
|
}
|
|
49338
49352
|
),
|
|
49339
|
-
/* @__PURE__ */
|
|
49353
|
+
/* @__PURE__ */ jsx53(
|
|
49340
49354
|
"button",
|
|
49341
49355
|
{
|
|
49342
49356
|
type: "button",
|
|
@@ -49355,7 +49369,7 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
49355
49369
|
}
|
|
49356
49370
|
|
|
49357
49371
|
// src/components/LlmChat.tsx
|
|
49358
|
-
import { jsx as
|
|
49372
|
+
import { jsx as jsx54, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
49359
49373
|
function LlmChat({
|
|
49360
49374
|
classNames,
|
|
49361
49375
|
renderers,
|
|
@@ -49387,26 +49401,26 @@ ${text4}` : text4),
|
|
|
49387
49401
|
onReady?.(handle);
|
|
49388
49402
|
}, [handle, onReady]);
|
|
49389
49403
|
const customization = useMemo20(() => ({ classNames, renderers }), [classNames, renderers]);
|
|
49390
|
-
return /* @__PURE__ */
|
|
49404
|
+
return /* @__PURE__ */ jsx54(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsxs47(
|
|
49391
49405
|
"div",
|
|
49392
49406
|
{
|
|
49393
49407
|
"data-theme": theme,
|
|
49394
49408
|
part: "root",
|
|
49395
49409
|
className: cn("blade-chat flex min-h-0 flex-1 flex-col overflow-hidden", classNames?.root),
|
|
49396
49410
|
children: [
|
|
49397
|
-
error61 ? /* @__PURE__ */
|
|
49411
|
+
error61 ? /* @__PURE__ */ jsxs47(
|
|
49398
49412
|
"div",
|
|
49399
49413
|
{
|
|
49400
49414
|
part: "error-bar",
|
|
49401
49415
|
className: "blade-chat-error-bar flex items-start gap-2 border-b border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-4 py-3 text-sm text-[hsl(var(--swf-danger))]",
|
|
49402
49416
|
children: [
|
|
49403
|
-
/* @__PURE__ */
|
|
49404
|
-
/* @__PURE__ */
|
|
49417
|
+
/* @__PURE__ */ jsx54(CircleAlert, { size: 16, className: "mt-0.5 shrink-0" }),
|
|
49418
|
+
/* @__PURE__ */ jsx54("span", { className: "min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]", children: chatErrorForDisplay4(error61) })
|
|
49405
49419
|
]
|
|
49406
49420
|
}
|
|
49407
49421
|
) : null,
|
|
49408
49422
|
slots?.header,
|
|
49409
|
-
/* @__PURE__ */
|
|
49423
|
+
/* @__PURE__ */ jsx54(
|
|
49410
49424
|
MessageList,
|
|
49411
49425
|
{
|
|
49412
49426
|
sessionId: "",
|
|
@@ -49418,7 +49432,7 @@ ${text4}` : text4),
|
|
|
49418
49432
|
onRevealingChange: setIsRevealing
|
|
49419
49433
|
}
|
|
49420
49434
|
),
|
|
49421
|
-
advanced ? /* @__PURE__ */
|
|
49435
|
+
advanced ? /* @__PURE__ */ jsx54(
|
|
49422
49436
|
LlmAdvancedSettingsBar,
|
|
49423
49437
|
{
|
|
49424
49438
|
settings: advanced,
|
|
@@ -49431,7 +49445,7 @@ ${text4}` : text4),
|
|
|
49431
49445
|
}
|
|
49432
49446
|
}
|
|
49433
49447
|
) : null,
|
|
49434
|
-
/* @__PURE__ */
|
|
49448
|
+
/* @__PURE__ */ jsx54(
|
|
49435
49449
|
ChatInput,
|
|
49436
49450
|
{
|
|
49437
49451
|
value: inputText,
|
|
@@ -49460,14 +49474,14 @@ ${text4}` : text4),
|
|
|
49460
49474
|
}
|
|
49461
49475
|
|
|
49462
49476
|
// src/components/ChatView.tsx
|
|
49463
|
-
import { jsx as
|
|
49477
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
49464
49478
|
function ChatView(props) {
|
|
49465
49479
|
const { mode, llm, onLlmReady, ...rest } = props;
|
|
49466
49480
|
if (mode === "llm") {
|
|
49467
49481
|
if (!llm) {
|
|
49468
49482
|
throw new Error('ChatView: mode="llm" \u9700\u8981\u540C\u65F6\u4F20 llm={{ baseURL, model }}');
|
|
49469
49483
|
}
|
|
49470
|
-
return /* @__PURE__ */
|
|
49484
|
+
return /* @__PURE__ */ jsx55(
|
|
49471
49485
|
LlmChat,
|
|
49472
49486
|
{
|
|
49473
49487
|
...llm,
|
|
@@ -49480,12 +49494,12 @@ function ChatView(props) {
|
|
|
49480
49494
|
}
|
|
49481
49495
|
);
|
|
49482
49496
|
}
|
|
49483
|
-
return /* @__PURE__ */
|
|
49497
|
+
return /* @__PURE__ */ jsx55(AgentChat, { ...rest });
|
|
49484
49498
|
}
|
|
49485
49499
|
|
|
49486
49500
|
// src/components/TopicAssetSubmitDialog.tsx
|
|
49487
49501
|
import { useRef as useRef30, useState as useState40 } from "react";
|
|
49488
|
-
import { jsx as
|
|
49502
|
+
import { jsx as jsx56, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
49489
49503
|
function useTopicAssetSubmissionAccess(sessionId) {
|
|
49490
49504
|
const client = useBladeClient();
|
|
49491
49505
|
return useAsyncValue(sessionId, async (signal) => {
|
|
@@ -49541,36 +49555,36 @@ function TopicAssetSubmitDialog({ sessionId, topicId, path: path2, onClose, onSu
|
|
|
49541
49555
|
setBusy(false);
|
|
49542
49556
|
}
|
|
49543
49557
|
};
|
|
49544
|
-
return /* @__PURE__ */
|
|
49558
|
+
return /* @__PURE__ */ jsx56(Dialog, { open: true, onOpenChange: (open2) => {
|
|
49545
49559
|
if (!open2 && !busy) onClose();
|
|
49546
|
-
}, children: /* @__PURE__ */
|
|
49547
|
-
/* @__PURE__ */
|
|
49548
|
-
/* @__PURE__ */
|
|
49549
|
-
/* @__PURE__ */
|
|
49560
|
+
}, children: /* @__PURE__ */ jsxs48(DialogContent, { className: "max-w-md", children: [
|
|
49561
|
+
/* @__PURE__ */ jsx56(DialogTitle, { children: "\u63D0\u4EA4\u5230\u8D44\u4EA7" }),
|
|
49562
|
+
/* @__PURE__ */ jsx56(DialogDescription, { children: "\u5C06\u6587\u4EF6\u590D\u5236\u5230\u4E3B\u9898\u4F9B\u6210\u5458\u4F7F\u7528\uFF0C\u5DE5\u4F5C\u533A\u539F\u6587\u4EF6\u4F1A\u4FDD\u7559\u3002\u540C\u540D\u8D44\u4EA7\u4F1A\u88AB\u66FF\u6362\u3002" }),
|
|
49563
|
+
/* @__PURE__ */ jsxs48("form", { onSubmit: (event) => {
|
|
49550
49564
|
event.preventDefault();
|
|
49551
49565
|
void submit();
|
|
49552
49566
|
}, className: "flex flex-col gap-4", children: [
|
|
49553
|
-
/* @__PURE__ */
|
|
49554
|
-
/* @__PURE__ */
|
|
49567
|
+
/* @__PURE__ */ jsx56("p", { className: "break-all text-sm text-secondary-foreground", children: path2 }),
|
|
49568
|
+
/* @__PURE__ */ jsxs48("label", { className: "flex flex-col gap-1 text-sm", children: [
|
|
49555
49569
|
"\u76EE\u6807\u6587\u4EF6\u5939",
|
|
49556
|
-
/* @__PURE__ */
|
|
49557
|
-
/* @__PURE__ */
|
|
49558
|
-
assets.data?.map((item) => /* @__PURE__ */
|
|
49570
|
+
/* @__PURE__ */ jsxs48("select", { "aria-label": "\u76EE\u6807\u6587\u4EF6\u5939", value: folder, onChange: (event) => setFolder(event.target.value), disabled: busy || !assets.data, className: "rounded-md border border-border bg-background p-2", children: [
|
|
49571
|
+
/* @__PURE__ */ jsx56("option", { value: "", children: "\u8D44\u4EA7\u6839\u76EE\u5F55" }),
|
|
49572
|
+
assets.data?.map((item) => /* @__PURE__ */ jsx56("option", { value: item, children: item }, item))
|
|
49559
49573
|
] })
|
|
49560
49574
|
] }),
|
|
49561
|
-
/* @__PURE__ */
|
|
49575
|
+
/* @__PURE__ */ jsxs48("label", { className: "flex flex-col gap-1 text-sm", children: [
|
|
49562
49576
|
"\u8BF4\u660E\uFF08\u53EF\u9009\uFF09",
|
|
49563
|
-
/* @__PURE__ */
|
|
49577
|
+
/* @__PURE__ */ jsx56("textarea", { "aria-label": "\u63D0\u4EA4\u8BF4\u660E", value: message, onChange: (event) => setMessage(event.target.value), maxLength: 1e3, disabled: busy, className: "min-h-20 rounded-md border border-border bg-background p-2" })
|
|
49564
49578
|
] }),
|
|
49565
|
-
assets.error ? /* @__PURE__ */
|
|
49579
|
+
assets.error ? /* @__PURE__ */ jsxs48("div", { role: "alert", className: "text-sm text-muted-foreground", children: [
|
|
49566
49580
|
assets.error instanceof Error ? assets.error.message : "\u8D44\u4EA7\u52A0\u8F7D\u5931\u8D25",
|
|
49567
49581
|
" ",
|
|
49568
|
-
/* @__PURE__ */
|
|
49569
|
-
] }) : !assets.data ? /* @__PURE__ */
|
|
49570
|
-
error61 ? /* @__PURE__ */
|
|
49571
|
-
/* @__PURE__ */
|
|
49572
|
-
/* @__PURE__ */
|
|
49573
|
-
/* @__PURE__ */
|
|
49582
|
+
/* @__PURE__ */ jsx56("button", { type: "button", onClick: () => setRevision((n2) => n2 + 1), className: "underline", children: "\u91CD\u8BD5" })
|
|
49583
|
+
] }) : !assets.data ? /* @__PURE__ */ jsx56("output", { className: "text-sm text-muted-foreground", children: "\u6B63\u5728\u52A0\u8F7D\u8D44\u4EA7\u2026" }) : null,
|
|
49584
|
+
error61 ? /* @__PURE__ */ jsx56("p", { role: "alert", className: "text-sm text-muted-foreground", children: error61 }) : null,
|
|
49585
|
+
/* @__PURE__ */ jsxs48("div", { className: "flex justify-end gap-2", children: [
|
|
49586
|
+
/* @__PURE__ */ jsx56("button", { type: "button", disabled: busy, onClick: onClose, className: "rounded-md border border-border px-3 py-2 text-sm", children: "\u53D6\u6D88" }),
|
|
49587
|
+
/* @__PURE__ */ jsx56("button", { type: "submit", disabled: busy || !assets.data, className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground disabled:opacity-50", children: busy ? "\u63D0\u4EA4\u4E2D\u2026" : "\u63D0\u4EA4" })
|
|
49574
49588
|
] })
|
|
49575
49589
|
] })
|
|
49576
49590
|
] }) });
|
|
@@ -49584,6 +49598,8 @@ export {
|
|
|
49584
49598
|
isQueuePanelVisible,
|
|
49585
49599
|
SessionQueuePanel,
|
|
49586
49600
|
McpAppCard,
|
|
49601
|
+
isPreparingReply,
|
|
49602
|
+
ChatLoadingIndicator,
|
|
49587
49603
|
BackgroundWakeNotice,
|
|
49588
49604
|
MessageImage,
|
|
49589
49605
|
DEFAULT_ALLOWED_TAGS,
|
|
@@ -49628,4 +49644,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
|
|
|
49628
49644
|
js-yaml/dist/js-yaml.mjs:
|
|
49629
49645
|
(*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
|
|
49630
49646
|
*/
|
|
49631
|
-
//# sourceMappingURL=chunk-
|
|
49647
|
+
//# sourceMappingURL=chunk-ZAEHTW2O.js.map
|