@blade-hq/agent-react 2612.0.0-beta.77 → 2612.0.0-beta.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/SessionPluginConfigForm-7LJ5SUNY.js +9 -0
- package/dist/SessionPluginConfigForm-7LJ5SUNY.js.map +1 -0
- package/dist/chat/LiteMessageList.d.ts +4 -0
- package/dist/{chunk-IVGTMWRV.js → chunk-66JXSDLB.js} +284 -289
- package/dist/chunk-66JXSDLB.js.map +1 -0
- package/dist/{chunk-VBHHFIII.js → chunk-C3LBNHVM.js} +12 -10
- package/dist/{chunk-VBHHFIII.js.map → chunk-C3LBNHVM.js.map} +1 -1
- package/dist/chunk-F4MWGSKX.js +1308 -0
- package/dist/chunk-F4MWGSKX.js.map +1 -0
- package/dist/{chunk-ZIECHNZA.js → chunk-FBGCDXRK.js} +110 -115
- package/dist/chunk-FBGCDXRK.js.map +1 -0
- package/dist/{chunk-26NE55SJ.js → chunk-FDB3J5QF.js} +8 -6
- package/dist/{chunk-26NE55SJ.js.map → chunk-FDB3J5QF.js.map} +1 -1
- package/dist/{chunk-WO2VCQ5N.js → chunk-FH5HA3GW.js} +551 -455
- package/dist/chunk-FH5HA3GW.js.map +1 -0
- package/dist/chunk-KHJEIHMJ.js +973 -0
- package/dist/chunk-KHJEIHMJ.js.map +1 -0
- package/dist/{chunk-XBEN2ASY.js → chunk-MWILWSPG.js} +4262 -3186
- package/dist/chunk-MWILWSPG.js.map +1 -0
- package/dist/{chunk-EQOKPZI2.js → chunk-NRYLAO3X.js} +87 -154
- package/dist/chunk-NRYLAO3X.js.map +1 -0
- package/dist/{chunk-F2IJZX2Z.js → chunk-SK43YNRX.js} +151 -1442
- package/dist/chunk-SK43YNRX.js.map +1 -0
- package/dist/components/BrowserConnectionDialog.d.ts +3 -2
- package/dist/components/ConfigConnection.d.ts +16 -0
- package/dist/components/ConnectorDetail.d.ts +46 -0
- package/dist/components/ConnectorRulesPanel.d.ts +2 -1
- package/dist/components/ConnectorRuntimeDiagnostics.d.ts +2 -2
- package/dist/components/DeviceConnection.d.ts +3 -1
- package/dist/components/FeishuPermissionStatus.d.ts +3 -1
- package/dist/components/ManagedConnection.d.ts +5 -2
- package/dist/components/PackEventNotice.d.ts +3 -0
- package/dist/components/SessionPluginConfigForm.d.ts +2 -1
- package/dist/connectors.d.ts +3 -0
- package/dist/connectors.js +7 -2
- package/dist/embed/entry.d.ts +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -7
- package/dist/internal.js +16 -9
- package/dist/internal.js.map +1 -1
- package/dist/questions.js +8 -6
- package/dist/questions.js.map +1 -1
- package/dist/rich-input.js +16 -13
- package/dist/rich-input.js.map +1 -1
- package/dist/style.full.css +1 -1
- package/dist/tool-details.js +5 -4
- package/dist/tool-details.js.map +1 -1
- package/package.json +2 -2
- package/public-api.md +41 -3
- package/dist/chunk-EQOKPZI2.js.map +0 -1
- package/dist/chunk-F2IJZX2Z.js.map +0 -1
- package/dist/chunk-IVGTMWRV.js.map +0 -1
- package/dist/chunk-WO2VCQ5N.js.map +0 -1
- package/dist/chunk-XBEN2ASY.js.map +0 -1
- package/dist/chunk-ZIECHNZA.js.map +0 -1
|
@@ -9,26 +9,21 @@ import {
|
|
|
9
9
|
useEffectEvent,
|
|
10
10
|
useSessionPluginActivation,
|
|
11
11
|
useSessionSkills
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-F4MWGSKX.js";
|
|
13
13
|
import {
|
|
14
14
|
ImageLightbox,
|
|
15
15
|
McpAppMessageContext,
|
|
16
16
|
MessageImage,
|
|
17
17
|
ToolUiCardView,
|
|
18
18
|
getRenderer
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FDB3J5QF.js";
|
|
20
20
|
import {
|
|
21
21
|
MarkdownContent
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-C3LBNHVM.js";
|
|
23
23
|
import {
|
|
24
24
|
BladeProvider,
|
|
25
25
|
ChatEnvironmentProvider,
|
|
26
26
|
CurrentChatSessionProvider,
|
|
27
|
-
Dialog,
|
|
28
|
-
DialogClose,
|
|
29
|
-
DialogContent,
|
|
30
|
-
DialogDescription,
|
|
31
|
-
DialogTitle,
|
|
32
27
|
PlanUpdateBlock,
|
|
33
28
|
SessionSourceProvider,
|
|
34
29
|
cn,
|
|
@@ -61,7 +56,18 @@ import {
|
|
|
61
56
|
useSessionSource,
|
|
62
57
|
useSessionState,
|
|
63
58
|
useSingleSessionSource
|
|
64
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-NRYLAO3X.js";
|
|
60
|
+
import {
|
|
61
|
+
Collapsible,
|
|
62
|
+
CollapsibleContent,
|
|
63
|
+
CollapsibleTrigger,
|
|
64
|
+
Dialog,
|
|
65
|
+
DialogClose,
|
|
66
|
+
DialogContent,
|
|
67
|
+
DialogDescription,
|
|
68
|
+
DialogTitle,
|
|
69
|
+
useControllableState
|
|
70
|
+
} from "./chunk-MWILWSPG.js";
|
|
65
71
|
import {
|
|
66
72
|
Archive,
|
|
67
73
|
ArrowRight,
|
|
@@ -115,10 +121,8 @@ import {
|
|
|
115
121
|
TriangleAlert,
|
|
116
122
|
Wrench,
|
|
117
123
|
X,
|
|
118
|
-
Zap
|
|
119
|
-
|
|
120
|
-
useControllableState
|
|
121
|
-
} from "./chunk-XBEN2ASY.js";
|
|
124
|
+
Zap
|
|
125
|
+
} from "./chunk-KHJEIHMJ.js";
|
|
122
126
|
|
|
123
127
|
// src/hooks/use-agent-session.ts
|
|
124
128
|
import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
@@ -798,7 +802,7 @@ function SessionQueuePanel({
|
|
|
798
802
|
{
|
|
799
803
|
type: "button",
|
|
800
804
|
"aria-label": `\u7ACB\u523B\u53D1\u9001\u7B2C ${position} \u6761`,
|
|
801
|
-
title: deliverable ? "\u53D1\u9001\u5F15\u5BFC\u6D88\u606F" : "\u5F53\u524D\u6CA1\u6709\u53EF\u63A5\u6536\u8865\u5145\u7684\u4EFB\u52A1",
|
|
805
|
+
title: item.next_turn_only ? "\u8FD9\u6761\u6D88\u606F\u4F1A\u5728\u4E0B\u4E00\u8F6E\u5355\u72EC\u5904\u7406" : deliverable ? "\u53D1\u9001\u5F15\u5BFC\u6D88\u606F" : "\u5F53\u524D\u6CA1\u6709\u53EF\u63A5\u6536\u8865\u5145\u7684\u4EFB\u52A1",
|
|
802
806
|
disabled: busy || !deliverable,
|
|
803
807
|
onClick: () => onDeliver(item),
|
|
804
808
|
className: LABEL_BUTTON,
|
|
@@ -1408,6 +1412,18 @@ function BackgroundWakeNotice() {
|
|
|
1408
1412
|
);
|
|
1409
1413
|
}
|
|
1410
1414
|
|
|
1415
|
+
// src/components/PackEventNotice.tsx
|
|
1416
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1417
|
+
function PackEventNotice({ title }) {
|
|
1418
|
+
return /* @__PURE__ */ jsxs10("div", { "data-pack-event": true, className: "my-3 flex items-center 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))]", children: [
|
|
1419
|
+
/* @__PURE__ */ jsx10(BellRing, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
|
|
1420
|
+
/* @__PURE__ */ jsx10("span", { children: title })
|
|
1421
|
+
] });
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
// src/chat/LiteMessageList.tsx
|
|
1425
|
+
import { packEventTitle } from "@blade-hq/agent-client/internal";
|
|
1426
|
+
|
|
1411
1427
|
// src/chat/AssistantTurnBlock.tsx
|
|
1412
1428
|
import { getServerTime } from "@blade-hq/agent-client/internal";
|
|
1413
1429
|
import { memo as memo3, useCallback as useCallback4, useEffect as useEffect13, useMemo as useMemo10, useRef as useRef10, useState as useState17 } from "react";
|
|
@@ -1436,36 +1452,6 @@ import {
|
|
|
1436
1452
|
isWorkflowRunToolName as isWorkflowRunToolName2
|
|
1437
1453
|
} from "@blade-hq/agent-client/internal";
|
|
1438
1454
|
|
|
1439
|
-
// ../ui/src/components/collapsible.tsx
|
|
1440
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1441
|
-
function Collapsible({
|
|
1442
|
-
...props
|
|
1443
|
-
}) {
|
|
1444
|
-
return /* @__PURE__ */ jsx10(dist_exports.Root, { "data-slot": "collapsible", ...props });
|
|
1445
|
-
}
|
|
1446
|
-
function CollapsibleTrigger({
|
|
1447
|
-
...props
|
|
1448
|
-
}) {
|
|
1449
|
-
return /* @__PURE__ */ jsx10(
|
|
1450
|
-
dist_exports.CollapsibleTrigger,
|
|
1451
|
-
{
|
|
1452
|
-
"data-slot": "collapsible-trigger",
|
|
1453
|
-
...props
|
|
1454
|
-
}
|
|
1455
|
-
);
|
|
1456
|
-
}
|
|
1457
|
-
function CollapsibleContent({
|
|
1458
|
-
...props
|
|
1459
|
-
}) {
|
|
1460
|
-
return /* @__PURE__ */ jsx10(
|
|
1461
|
-
dist_exports.CollapsibleContent,
|
|
1462
|
-
{
|
|
1463
|
-
"data-slot": "collapsible-content",
|
|
1464
|
-
...props
|
|
1465
|
-
}
|
|
1466
|
-
);
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
1455
|
// src/chat/ai-elements/reasoning.tsx
|
|
1470
1456
|
import {
|
|
1471
1457
|
createContext as createContext4,
|
|
@@ -1510,7 +1496,7 @@ var ShimmerComponent = ({
|
|
|
1510
1496
|
var Shimmer = memo(ShimmerComponent);
|
|
1511
1497
|
|
|
1512
1498
|
// src/chat/ai-elements/reasoning.tsx
|
|
1513
|
-
import { Fragment as Fragment5, jsx as jsx12, jsxs as
|
|
1499
|
+
import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1514
1500
|
var ReasoningContext = createContext4(null);
|
|
1515
1501
|
var useReasoning = () => {
|
|
1516
1502
|
const context = useContext4(ReasoningContext);
|
|
@@ -1595,11 +1581,11 @@ var ReasoningTrigger = memo2(
|
|
|
1595
1581
|
className
|
|
1596
1582
|
),
|
|
1597
1583
|
...props,
|
|
1598
|
-
children: children ?? /* @__PURE__ */
|
|
1584
|
+
children: children ?? /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1599
1585
|
/* @__PURE__ */ jsx12(Brain, { className: "size-4" }),
|
|
1600
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsxs11("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1601
1587
|
isStreaming || duration === 0 ? /* @__PURE__ */ jsx12(Shimmer, { duration: 1, children: status }) : /* @__PURE__ */ jsx12("span", { children: status }),
|
|
1602
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ jsxs11("span", { className: "whitespace-nowrap tabular-nums text-[hsl(var(--muted-foreground))]/70", children: [
|
|
1603
1589
|
"\xB7 ",
|
|
1604
1590
|
detail
|
|
1605
1591
|
] })
|
|
@@ -1643,7 +1629,7 @@ function compactReasoningText(text) {
|
|
|
1643
1629
|
function ThinkingBadge({ reasoning, variant = "inline", onClick }) {
|
|
1644
1630
|
const compactReasoning = compactReasoningText(reasoning);
|
|
1645
1631
|
const [open, setOpen] = useState7(false);
|
|
1646
|
-
return /* @__PURE__ */
|
|
1632
|
+
return /* @__PURE__ */ jsxs11(
|
|
1647
1633
|
"span",
|
|
1648
1634
|
{
|
|
1649
1635
|
className: cn(
|
|
@@ -1665,13 +1651,13 @@ function ThinkingBadge({ reasoning, variant = "inline", onClick }) {
|
|
|
1665
1651
|
children: "\u601D\u8003\u8BE6\u60C5"
|
|
1666
1652
|
}
|
|
1667
1653
|
),
|
|
1668
|
-
/* @__PURE__ */ jsx12(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ jsx12(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs11(
|
|
1669
1655
|
DialogContent,
|
|
1670
1656
|
{
|
|
1671
1657
|
showCloseButton: false,
|
|
1672
1658
|
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",
|
|
1673
1659
|
children: [
|
|
1674
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between gap-3 border-b border-[hsl(var(--border))] px-4 py-2", children: [
|
|
1675
1661
|
/* @__PURE__ */ jsx12(DialogTitle, { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u601D\u8003\u8BE6\u60C5" }),
|
|
1676
1662
|
/* @__PURE__ */ jsx12(
|
|
1677
1663
|
DialogClose,
|
|
@@ -1700,7 +1686,7 @@ var CardContext = createContext5({});
|
|
|
1700
1686
|
|
|
1701
1687
|
// src/chat/FileDeliveryCards.tsx
|
|
1702
1688
|
import { useMemo as useMemo5, useState as useState8 } from "react";
|
|
1703
|
-
import { Fragment as Fragment6, jsx as jsx13, jsxs as
|
|
1689
|
+
import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1704
1690
|
var AGENT_WORKSPACE_DIR_NAME = "\u667A\u80FD\u52A9\u624B\u5DE5\u4F5C\u7A7A\u95F4";
|
|
1705
1691
|
var EXT_LABELS = {
|
|
1706
1692
|
py: "Python",
|
|
@@ -1804,13 +1790,13 @@ function DeliveryCard({
|
|
|
1804
1790
|
setDownloading(false);
|
|
1805
1791
|
}
|
|
1806
1792
|
};
|
|
1807
|
-
return /* @__PURE__ */
|
|
1793
|
+
return /* @__PURE__ */ jsxs12(
|
|
1808
1794
|
"div",
|
|
1809
1795
|
{
|
|
1810
1796
|
"data-artifact-kind": isVideoFile(name) ? "video" : "file",
|
|
1811
1797
|
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))]",
|
|
1812
1798
|
children: [
|
|
1813
|
-
/* @__PURE__ */
|
|
1799
|
+
/* @__PURE__ */ jsxs12(
|
|
1814
1800
|
"button",
|
|
1815
1801
|
{
|
|
1816
1802
|
type: "button",
|
|
@@ -1822,9 +1808,9 @@ function DeliveryCard({
|
|
|
1822
1808
|
${name}` : name,
|
|
1823
1809
|
children: [
|
|
1824
1810
|
/* @__PURE__ */ jsx13("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__ */ jsx13(LoaderCircle, { size: compact ? 15 : 22, className: "animate-spin", "aria-hidden": "true" }) : isVideoFile(name) ? /* @__PURE__ */ jsx13(Film, { size: compact ? 15 : 22, "aria-hidden": "true" }) : /* @__PURE__ */ jsx13(FileGlyph, {}) }),
|
|
1825
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ jsxs12("span", { className: compact ? "min-w-0" : "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
1826
1812
|
/* @__PURE__ */ jsx13("span", { className: compact ? "block truncate text-xs font-medium leading-5" : "truncate text-[15px] font-semibold text-[hsl(var(--foreground))]", children: displayName || name }),
|
|
1827
|
-
!compact ? /* @__PURE__ */ jsx13("span", { className: "flex items-center gap-1.5 truncate text-[12.5px] text-[hsl(var(--muted-foreground))]", children: description ? /* @__PURE__ */ jsx13("span", { className: "truncate", children: description }) : /* @__PURE__ */
|
|
1813
|
+
!compact ? /* @__PURE__ */ jsx13("span", { className: "flex items-center gap-1.5 truncate text-[12.5px] text-[hsl(var(--muted-foreground))]", children: description ? /* @__PURE__ */ jsx13("span", { className: "truncate", children: description }) : /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
1828
1814
|
/* @__PURE__ */ jsx13("span", { className: "font-mono", children: getExtLabel(name) }),
|
|
1829
1815
|
/* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: "\xB7" }),
|
|
1830
1816
|
/* @__PURE__ */ jsx13("span", { className: "text-[hsl(var(--primary))]", children: "AI \u751F\u6210" })
|
|
@@ -1853,7 +1839,7 @@ ${name}` : name,
|
|
|
1853
1839
|
);
|
|
1854
1840
|
}
|
|
1855
1841
|
function FileGlyph() {
|
|
1856
|
-
return /* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ jsxs12(
|
|
1857
1843
|
"svg",
|
|
1858
1844
|
{
|
|
1859
1845
|
width: "21",
|
|
@@ -1885,7 +1871,7 @@ function FileDeliveryCards({
|
|
|
1885
1871
|
|
|
1886
1872
|
// src/chat/MessageActions.tsx
|
|
1887
1873
|
import { useState as useState9 } from "react";
|
|
1888
|
-
import { jsx as jsx14, jsxs as
|
|
1874
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1889
1875
|
function MessageActions({ content, className }) {
|
|
1890
1876
|
const [copied, setCopied] = useState9(false);
|
|
1891
1877
|
const handleCopy = async () => {
|
|
@@ -1895,7 +1881,7 @@ function MessageActions({ content, className }) {
|
|
|
1895
1881
|
setTimeout(() => setCopied(false), 2e3);
|
|
1896
1882
|
}
|
|
1897
1883
|
};
|
|
1898
|
-
return /* @__PURE__ */ jsx14("div", { className: cn("flex items-center gap-1 mt-1.5", className), children: /* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("flex items-center gap-1 mt-1.5", className), children: /* @__PURE__ */ jsxs13(
|
|
1899
1885
|
"button",
|
|
1900
1886
|
{
|
|
1901
1887
|
type: "button",
|
|
@@ -1913,7 +1899,7 @@ function MessageActions({ content, className }) {
|
|
|
1913
1899
|
}
|
|
1914
1900
|
|
|
1915
1901
|
// src/chat/MessageFileAttachmentList.tsx
|
|
1916
|
-
import { Fragment as Fragment7, jsx as jsx15, jsxs as
|
|
1902
|
+
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1917
1903
|
function getFileIcon(fileName) {
|
|
1918
1904
|
const lowerName = fileName.toLowerCase();
|
|
1919
1905
|
if (/\.(zip|rar|7z|tar|gz|bz2|xz)$/.test(lowerName)) {
|
|
@@ -1945,7 +1931,7 @@ function MessageFileAttachmentList({
|
|
|
1945
1931
|
return /* @__PURE__ */ jsx15("div", { className: cn("flex flex-wrap gap-1.5", className), children: files.map((file) => {
|
|
1946
1932
|
const Icon = getFileIcon(file.name);
|
|
1947
1933
|
const key = `${file.name}-${file.data.slice(0, 32)}`;
|
|
1948
|
-
const content = /* @__PURE__ */
|
|
1934
|
+
const content = /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
1949
1935
|
/* @__PURE__ */ jsx15(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
|
|
1950
1936
|
/* @__PURE__ */ jsx15("span", { className: "max-w-32 truncate", children: file.name })
|
|
1951
1937
|
] });
|
|
@@ -1986,7 +1972,7 @@ import {
|
|
|
1986
1972
|
import { formatAskUserAnswer } from "@blade-hq/agent-client";
|
|
1987
1973
|
import { useEffect as useEffect7, useMemo as useMemo6, useRef as useRef8, useState as useState10 } from "react";
|
|
1988
1974
|
import { parseAskUserQuestion } from "@blade-hq/agent-client";
|
|
1989
|
-
import { jsx as jsx17, jsxs as
|
|
1975
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1990
1976
|
var CUSTOM_TEXTAREA_MAX_HEIGHT = 160;
|
|
1991
1977
|
function resizeCustomTextarea(textarea) {
|
|
1992
1978
|
textarea.style.height = "auto";
|
|
@@ -2126,7 +2112,7 @@ function AskUserQuestionBlock({
|
|
|
2126
2112
|
setSubmitted(true);
|
|
2127
2113
|
onAnswer(text, toolCallId, nextAnswerData);
|
|
2128
2114
|
};
|
|
2129
|
-
return /* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ jsxs15(
|
|
2130
2116
|
"div",
|
|
2131
2117
|
{
|
|
2132
2118
|
part: "ask-card",
|
|
@@ -2135,7 +2121,7 @@ function AskUserQuestionBlock({
|
|
|
2135
2121
|
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"
|
|
2136
2122
|
),
|
|
2137
2123
|
children: [
|
|
2138
|
-
data.source_loop?.description && /* @__PURE__ */
|
|
2124
|
+
data.source_loop?.description && /* @__PURE__ */ jsxs15("div", { className: "rounded-lg bg-[hsl(var(--muted)/0.35)] px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
2139
2125
|
"\u5B50\u667A\u80FD\u4F53\u300C",
|
|
2140
2126
|
data.source_loop.description,
|
|
2141
2127
|
"\u300D\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54"
|
|
@@ -2174,7 +2160,7 @@ function AskUserQuestionBlock({
|
|
|
2174
2160
|
children: allAnswered ? "\u786E\u8BA4" : "\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u9009\u9879"
|
|
2175
2161
|
}
|
|
2176
2162
|
),
|
|
2177
|
-
submitted && !answered && /* @__PURE__ */
|
|
2163
|
+
submitted && !answered && /* @__PURE__ */ jsxs15(
|
|
2178
2164
|
"button",
|
|
2179
2165
|
{
|
|
2180
2166
|
type: "button",
|
|
@@ -2203,8 +2189,8 @@ function QuestionCard({
|
|
|
2203
2189
|
}) {
|
|
2204
2190
|
const multi = question.multiSelect ?? false;
|
|
2205
2191
|
const customTextareaRef = useAutoResizeTextarea(customText);
|
|
2206
|
-
return /* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsxs15("div", { children: [
|
|
2193
|
+
/* @__PURE__ */ jsxs15("div", { className: cn("flex items-start gap-2", answered ? "mb-2" : "mb-3"), children: [
|
|
2208
2194
|
/* @__PURE__ */ jsx17(
|
|
2209
2195
|
MessageSquareMore,
|
|
2210
2196
|
{
|
|
@@ -2233,10 +2219,10 @@ function QuestionCard({
|
|
|
2233
2219
|
}
|
|
2234
2220
|
)
|
|
2235
2221
|
] }),
|
|
2236
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ jsxs15("div", { className: cn("flex flex-col pl-5", answered ? "gap-1" : "gap-1.5"), children: [
|
|
2237
2223
|
question.options.map((opt, optIdx) => {
|
|
2238
2224
|
const isSel = selected.has(optIdx);
|
|
2239
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ jsxs15(
|
|
2240
2226
|
"button",
|
|
2241
2227
|
{
|
|
2242
2228
|
type: "button",
|
|
@@ -2268,7 +2254,7 @@ function QuestionCard({
|
|
|
2268
2254
|
)
|
|
2269
2255
|
}
|
|
2270
2256
|
),
|
|
2271
|
-
/* @__PURE__ */
|
|
2257
|
+
/* @__PURE__ */ jsxs15("div", { className: "min-w-0", children: [
|
|
2272
2258
|
/* @__PURE__ */ jsx17("div", { className: cn("font-medium", answered ? "text-xs" : "text-[13px]"), children: opt.label }),
|
|
2273
2259
|
opt.description && /* @__PURE__ */ jsx17(
|
|
2274
2260
|
"div",
|
|
@@ -2287,7 +2273,7 @@ function QuestionCard({
|
|
|
2287
2273
|
opt.label
|
|
2288
2274
|
);
|
|
2289
2275
|
}),
|
|
2290
|
-
answered && !isCustom ? null : /* @__PURE__ */
|
|
2276
|
+
answered && !isCustom ? null : /* @__PURE__ */ jsxs15(
|
|
2291
2277
|
"div",
|
|
2292
2278
|
{
|
|
2293
2279
|
className: cn(
|
|
@@ -2330,7 +2316,7 @@ function NoteField({
|
|
|
2330
2316
|
const textareaRef = useAutoResizeTextarea(note);
|
|
2331
2317
|
const readOnly = answered || submitted;
|
|
2332
2318
|
if (answered && !note.trim()) return null;
|
|
2333
|
-
return /* @__PURE__ */
|
|
2319
|
+
return /* @__PURE__ */ jsxs15(
|
|
2334
2320
|
"label",
|
|
2335
2321
|
{
|
|
2336
2322
|
className: cn(
|
|
@@ -2366,7 +2352,7 @@ function NoteField({
|
|
|
2366
2352
|
}
|
|
2367
2353
|
|
|
2368
2354
|
// src/chat/ToolCallBlock.tsx
|
|
2369
|
-
import { Fragment as Fragment8, jsx as jsx18, jsxs as
|
|
2355
|
+
import { Fragment as Fragment8, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2370
2356
|
function getFilePreviewName(filePath) {
|
|
2371
2357
|
return filePath.split(/[\\/]/).pop() ?? filePath;
|
|
2372
2358
|
}
|
|
@@ -2429,7 +2415,7 @@ function ToolPreviewAction({
|
|
|
2429
2415
|
return null;
|
|
2430
2416
|
}
|
|
2431
2417
|
const label = uiMeta.title ?? displayName;
|
|
2432
|
-
return /* @__PURE__ */
|
|
2418
|
+
return /* @__PURE__ */ jsxs16(
|
|
2433
2419
|
"button",
|
|
2434
2420
|
{
|
|
2435
2421
|
type: "button",
|
|
@@ -2537,20 +2523,20 @@ function ToolCallBlock({
|
|
|
2537
2523
|
if (!reasoning) {
|
|
2538
2524
|
return questionBlock;
|
|
2539
2525
|
}
|
|
2540
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1", children: [
|
|
2541
2527
|
questionBlock,
|
|
2542
2528
|
/* @__PURE__ */ jsx18("div", { className: "ml-4", children: /* @__PURE__ */ jsx18(ThinkingBadge, { reasoning, variant: "block" }) })
|
|
2543
2529
|
] });
|
|
2544
2530
|
}
|
|
2545
2531
|
if (toolCall.status === "pending") {
|
|
2546
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ jsxs16("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: [
|
|
2547
2533
|
/* @__PURE__ */ jsx18(LoaderCircle, { size: 14, className: "animate-spin" }),
|
|
2548
2534
|
/* @__PURE__ */ jsx18("span", { children: "\u6B63\u5728\u51C6\u5907\u95EE\u9898\u2026" })
|
|
2549
2535
|
] });
|
|
2550
2536
|
}
|
|
2551
|
-
return /* @__PURE__ */
|
|
2537
|
+
return /* @__PURE__ */ jsxs16("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: [
|
|
2552
2538
|
/* @__PURE__ */ jsx18("div", { className: "font-semibold", children: "\u9009\u62E9\u9898\u5185\u5BB9\u6682\u65F6\u65E0\u6CD5\u663E\u793A" }),
|
|
2553
|
-
/* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ jsxs16("div", { className: "mt-1 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: [
|
|
2554
2540
|
"\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",
|
|
2555
2541
|
/* @__PURE__ */ jsx18("span", { className: "ml-1 font-mono", children: toolCall.id }),
|
|
2556
2542
|
"\u3002"
|
|
@@ -2565,7 +2551,7 @@ function ToolCallBlock({
|
|
|
2565
2551
|
const indentClass = level === 2 ? "ml-3" : "";
|
|
2566
2552
|
const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */ jsx18(LoaderCircle, { size: 12, className: "animate-spin" }) : toolCall.status === "awaiting_answer" ? /* @__PURE__ */ jsx18(MessageSquareMore, { size: 12 }) : toolCall.status === "cancelled" || toolCall.status === "error" ? /* @__PURE__ */ jsx18(X, { size: 12 }) : /* @__PURE__ */ jsx18(Check, { size: 12 });
|
|
2567
2553
|
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))]";
|
|
2568
|
-
return /* @__PURE__ */
|
|
2554
|
+
return /* @__PURE__ */ jsxs16(
|
|
2569
2555
|
"div",
|
|
2570
2556
|
{
|
|
2571
2557
|
part: normalizedName === "Agent" ? "agent-loop" : "tool-row",
|
|
@@ -2576,8 +2562,8 @@ function ToolCallBlock({
|
|
|
2576
2562
|
customization?.classNames?.toolCall
|
|
2577
2563
|
),
|
|
2578
2564
|
children: [
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 min-h-7 pr-3 leading-5", children: [
|
|
2566
|
+
/* @__PURE__ */ jsxs16(
|
|
2581
2567
|
"button",
|
|
2582
2568
|
{
|
|
2583
2569
|
type: "button",
|
|
@@ -2595,11 +2581,11 @@ function ToolCallBlock({
|
|
|
2595
2581
|
)
|
|
2596
2582
|
}
|
|
2597
2583
|
),
|
|
2598
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ jsxs16("span", { className: cn("flex shrink-0 items-center gap-1 text-[10px]", statusTextClass), children: [
|
|
2599
2585
|
statusIcon,
|
|
2600
2586
|
/* @__PURE__ */ jsx18("span", { children: getToolStatusLabel(toolCall.status) })
|
|
2601
2587
|
] }),
|
|
2602
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ jsxs16("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: [
|
|
2603
2589
|
displayName,
|
|
2604
2590
|
toolCall.status === "error" ? "\uFF08\u5F85\u91CD\u8BD5\uFF09" : ""
|
|
2605
2591
|
] })
|
|
@@ -2617,12 +2603,12 @@ function ToolCallBlock({
|
|
|
2617
2603
|
}
|
|
2618
2604
|
)
|
|
2619
2605
|
] }),
|
|
2620
|
-
expanded && /* @__PURE__ */ jsx18("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: Renderer ? /* @__PURE__ */ jsx18(Renderer, { toolCall, sessionId: resolvedSessionId }) : /* @__PURE__ */
|
|
2606
|
+
expanded && /* @__PURE__ */ jsx18("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: Renderer ? /* @__PURE__ */ jsx18(Renderer, { toolCall, sessionId: resolvedSessionId }) : /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
2621
2607
|
/* @__PURE__ */ jsx18("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u5DE5\u5177" }),
|
|
2622
2608
|
/* @__PURE__ */ jsx18("div", { className: "mb-3 font-mono text-[11px] text-[hsl(var(--foreground))]", children: normalizedName }),
|
|
2623
2609
|
/* @__PURE__ */ jsx18("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u53C2\u6570" }),
|
|
2624
2610
|
/* @__PURE__ */ jsx18("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) }),
|
|
2625
|
-
toolCall.result != null && /* @__PURE__ */
|
|
2611
|
+
toolCall.result != null && /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
2626
2612
|
/* @__PURE__ */ jsx18("div", { className: "mb-1 mt-3 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u7ED3\u679C" }),
|
|
2627
2613
|
/* @__PURE__ */ jsx18(
|
|
2628
2614
|
"pre",
|
|
@@ -2701,7 +2687,7 @@ function useAsyncValue(key, load2) {
|
|
|
2701
2687
|
}
|
|
2702
2688
|
|
|
2703
2689
|
// src/chat/AttachmentPreviewDialog.tsx
|
|
2704
|
-
import { jsx as jsx19, jsxs as
|
|
2690
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2705
2691
|
function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }) {
|
|
2706
2692
|
const enabled = open && url != null && (mode === "markdown" || mode === "text");
|
|
2707
2693
|
const { data: content, error } = useAsyncValue(enabled ? `${mode}:${url}` : null, async (signal) => {
|
|
@@ -2717,15 +2703,15 @@ function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }) {
|
|
|
2717
2703
|
return res.text();
|
|
2718
2704
|
});
|
|
2719
2705
|
if (!open) return null;
|
|
2720
|
-
return /* @__PURE__ */ jsx19(Dialog, { open, onOpenChange, children: /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ jsx19(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs17(
|
|
2721
2707
|
DialogContent,
|
|
2722
2708
|
{
|
|
2723
2709
|
showCloseButton: false,
|
|
2724
2710
|
className: "flex max-h-[90vh] w-full max-w-3xl flex-col gap-0 overflow-hidden p-0",
|
|
2725
2711
|
children: [
|
|
2726
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
|
|
2727
2713
|
/* @__PURE__ */ jsx19(DialogTitle, { className: "truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: filename }),
|
|
2728
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1", children: [
|
|
2729
2715
|
url && /* @__PURE__ */ jsx19(
|
|
2730
2716
|
"a",
|
|
2731
2717
|
{
|
|
@@ -2763,14 +2749,14 @@ function renderContent({
|
|
|
2763
2749
|
return /* @__PURE__ */ jsx19("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u6B64\u9644\u4EF6\u6682\u65E0\u53EF\u7528\u9884\u89C8\u5730\u5740\u3002" });
|
|
2764
2750
|
}
|
|
2765
2751
|
if (mode === "default") {
|
|
2766
|
-
return /* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ jsxs17("p", { className: "text-[hsl(var(--muted-foreground))]", children: [
|
|
2767
2753
|
"\u6B64\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u5185\u5D4C\u9884\u89C8\u3002\u8BF7\u70B9\u51FB\u53F3\u4E0A\u89D2",
|
|
2768
2754
|
/* @__PURE__ */ jsx19("span", { className: "mx-1 font-medium text-[hsl(var(--foreground))]", children: "\u4E0B\u8F7D" }),
|
|
2769
2755
|
"\u6309\u94AE\u67E5\u770B\u3002"
|
|
2770
2756
|
] });
|
|
2771
2757
|
}
|
|
2772
2758
|
if (error) {
|
|
2773
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ jsxs17("p", { className: "text-[hsl(var(--destructive))]", children: [
|
|
2774
2760
|
"\u52A0\u8F7D\u5931\u8D25\uFF1A",
|
|
2775
2761
|
String(error?.message ?? error)
|
|
2776
2762
|
] });
|
|
@@ -2821,7 +2807,7 @@ function dispatchPreview(filename, url) {
|
|
|
2821
2807
|
}
|
|
2822
2808
|
|
|
2823
2809
|
// src/chat/ContextAttachmentPills.tsx
|
|
2824
|
-
import { Fragment as Fragment9, jsx as jsx20, jsxs as
|
|
2810
|
+
import { Fragment as Fragment9, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2825
2811
|
function ContextAttachmentPills({ attachments }) {
|
|
2826
2812
|
const client = useOptionalBladeClient();
|
|
2827
2813
|
const download = useRef9(null);
|
|
@@ -2857,19 +2843,19 @@ function ContextAttachmentPills({ attachments }) {
|
|
|
2857
2843
|
if (!controller.signal.aborted) setLoading(null);
|
|
2858
2844
|
}
|
|
2859
2845
|
};
|
|
2860
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
2861
2847
|
/* @__PURE__ */ jsx20("div", { className: "flex max-w-full flex-wrap justify-end gap-1.5", "aria-label": "\u9644\u52A0\u8D44\u6599", children: attachments.map((item) => /* @__PURE__ */ jsx20("button", { type: "button", onClick: () => {
|
|
2862
2848
|
setSelected(selected?.id === item.id ? null : item);
|
|
2863
2849
|
setUnavailable(null);
|
|
2864
2850
|
}, "aria-expanded": selected?.id === item.id, className: "max-w-full truncate rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground", children: item.label }, item.id)) }),
|
|
2865
|
-
selected && /* @__PURE__ */
|
|
2851
|
+
selected && /* @__PURE__ */ jsxs18("div", { className: "max-w-full rounded-xl border border-border bg-muted p-3 text-sm text-foreground", children: [
|
|
2866
2852
|
/* @__PURE__ */ jsx20("div", { className: "mb-2 font-medium", children: selected.label }),
|
|
2867
2853
|
/* @__PURE__ */ jsx20("div", { className: "whitespace-pre-wrap break-words", children: selected.content }),
|
|
2868
|
-
selected.files?.map((file, index) => /* @__PURE__ */
|
|
2854
|
+
selected.files?.map((file, index) => /* @__PURE__ */ jsxs18("button", { type: "button", disabled: loading != null || !file.path || !file.session_id, onClick: () => void openFile(file), className: "mt-2 block max-w-full truncate text-left underline", children: [
|
|
2869
2855
|
file.name,
|
|
2870
2856
|
!file.path || !file.session_id ? " \xB7 \u6587\u4EF6\u4E0D\u53EF\u7528" : loading === file.name ? " \xB7 \u8BFB\u53D6\u4E2D" : ""
|
|
2871
2857
|
] }, index)),
|
|
2872
|
-
unavailable && /* @__PURE__ */
|
|
2858
|
+
unavailable && /* @__PURE__ */ jsxs18("output", { className: "mt-2 block text-xs text-muted-foreground", children: [
|
|
2873
2859
|
unavailable,
|
|
2874
2860
|
" \xB7 \u6587\u4EF6\u4E0D\u53EF\u7528"
|
|
2875
2861
|
] })
|
|
@@ -2938,10 +2924,10 @@ function parseWhatIfPrompt(text) {
|
|
|
2938
2924
|
}
|
|
2939
2925
|
|
|
2940
2926
|
// src/chat/MessageContextPills.tsx
|
|
2941
|
-
import { jsx as jsx21, jsxs as
|
|
2927
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2942
2928
|
function MessageContextPills({ contexts }) {
|
|
2943
2929
|
if (contexts.length === 0) return null;
|
|
2944
|
-
return /* @__PURE__ */ jsx21("div", { className: "flex flex-wrap gap-1.5", children: contexts.map((ctx, index) => /* @__PURE__ */
|
|
2930
|
+
return /* @__PURE__ */ jsx21("div", { className: "flex flex-wrap gap-1.5", children: contexts.map((ctx, index) => /* @__PURE__ */ jsxs19(
|
|
2945
2931
|
"div",
|
|
2946
2932
|
{
|
|
2947
2933
|
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)]",
|
|
@@ -2956,7 +2942,7 @@ function MessageContextPills({ contexts }) {
|
|
|
2956
2942
|
}
|
|
2957
2943
|
|
|
2958
2944
|
// src/chat/TextAttachmentPills.tsx
|
|
2959
|
-
import { Fragment as Fragment10, jsx as jsx22, jsxs as
|
|
2945
|
+
import { Fragment as Fragment10, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2960
2946
|
function getFileIcon2(fileName) {
|
|
2961
2947
|
const lower2 = fileName.toLowerCase();
|
|
2962
2948
|
if (/\.(zip|rar|7z|tar|gz)$/.test(lower2)) return Archive;
|
|
@@ -2974,7 +2960,7 @@ function TextAttachmentPills({ attachments, onPreview }) {
|
|
|
2974
2960
|
return /* @__PURE__ */ jsx22("div", { className: "flex flex-wrap gap-1.5", children: attachments.map((att, index) => {
|
|
2975
2961
|
const Icon = getFileIcon2(att.name);
|
|
2976
2962
|
const key = `${att.uploadedPath ?? att.name}:${att.name}:${index}`;
|
|
2977
|
-
const content = /* @__PURE__ */
|
|
2963
|
+
const content = /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
2978
2964
|
/* @__PURE__ */ jsx22(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.6)]" }),
|
|
2979
2965
|
/* @__PURE__ */ jsx22("span", { className: "max-w-40 truncate", children: att.name })
|
|
2980
2966
|
] });
|
|
@@ -2996,19 +2982,19 @@ function TextAttachmentPills({ attachments, onPreview }) {
|
|
|
2996
2982
|
}
|
|
2997
2983
|
|
|
2998
2984
|
// src/components/WhatIfUserBubble.tsx
|
|
2999
|
-
import { jsx as jsx23, jsxs as
|
|
2985
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3000
2986
|
function WhatIfUserBubble({ parsed, onQuoteClick }) {
|
|
3001
2987
|
const { fromStep, quotes, userText } = parsed;
|
|
3002
|
-
return /* @__PURE__ */
|
|
3003
|
-
/* @__PURE__ */
|
|
2988
|
+
return /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-end gap-2", children: [
|
|
2989
|
+
/* @__PURE__ */ jsxs21("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: [
|
|
3004
2990
|
/* @__PURE__ */ jsx23(RefreshCcw, { size: 10 }),
|
|
3005
2991
|
/* @__PURE__ */ jsx23("span", { children: fromStep != null ? `\u91CD\u8DD1\u81EA step ${fromStep}` : "\u91CD\u8DD1" })
|
|
3006
2992
|
] }),
|
|
3007
2993
|
quotes.length > 0 && /* @__PURE__ */ jsx23("div", { className: "flex max-w-[min(72vw,42rem)] flex-col items-stretch gap-2", children: quotes.map((quote, index) => {
|
|
3008
2994
|
const clickable = quote.stepNumber != null && !!onQuoteClick;
|
|
3009
2995
|
const label = quote.stepNumber != null ? `\u6B65\u9AA4${quote.stepNumber} \xB7 ${quote.label}` : quote.label;
|
|
3010
|
-
return /* @__PURE__ */
|
|
3011
|
-
/* @__PURE__ */
|
|
2996
|
+
return /* @__PURE__ */ jsxs21("div", { className: "rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.8)] px-3 py-2 text-left", children: [
|
|
2997
|
+
/* @__PURE__ */ jsxs21("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: [
|
|
3012
2998
|
/* @__PURE__ */ jsx23("span", { children: "\u21B3" }),
|
|
3013
2999
|
/* @__PURE__ */ jsx23("span", { className: "truncate", children: label })
|
|
3014
3000
|
] }),
|
|
@@ -3020,7 +3006,7 @@ function WhatIfUserBubble({ parsed, onQuoteClick }) {
|
|
|
3020
3006
|
}
|
|
3021
3007
|
|
|
3022
3008
|
// src/chat/UserMessageBubble.tsx
|
|
3023
|
-
import { jsx as jsx24, jsxs as
|
|
3009
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3024
3010
|
function isUserMessage(message) {
|
|
3025
3011
|
return message.role === "user";
|
|
3026
3012
|
}
|
|
@@ -3071,13 +3057,13 @@ function UserMessageBubble({ message, className }) {
|
|
|
3071
3057
|
} = extractTextAttachments(message.content);
|
|
3072
3058
|
const trimmedClean = cleanText.trim();
|
|
3073
3059
|
const pluginPills = message.refs?.length ? /* @__PURE__ */ jsx24("div", { className: "flex flex-wrap justify-end gap-1.5", "aria-label": "\u6D88\u606F\u5F15\u7528", children: message.refs.map((ref) => /* @__PURE__ */ jsx24("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;
|
|
3074
|
-
const topicAssetPills = message.topic_asset_refs?.length ? /* @__PURE__ */ jsx24("div", { className: "flex max-w-full flex-wrap justify-end gap-1.5", "aria-label": "\u5F15\u7528\u7684\u5DE5\u4F5C\u7A7A\u95F4\u8D44\u4EA7", children: message.topic_asset_refs.map((ref) => /* @__PURE__ */
|
|
3060
|
+
const topicAssetPills = message.topic_asset_refs?.length ? /* @__PURE__ */ jsx24("div", { className: "flex max-w-full flex-wrap justify-end gap-1.5", "aria-label": "\u5F15\u7528\u7684\u5DE5\u4F5C\u7A7A\u95F4\u8D44\u4EA7", children: message.topic_asset_refs.map((ref) => /* @__PURE__ */ jsxs22("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: [
|
|
3075
3061
|
"\u5DE5\u4F5C\u7A7A\u95F4\u8D44\u4EA7 \xB7 ",
|
|
3076
3062
|
ref.path
|
|
3077
3063
|
] }, `${ref.topic_id}:${ref.path}`)) }) : null;
|
|
3078
3064
|
const whatifParsed = trimmedClean && imageParts.length === 0 && fileParts.length === 0 && textAttachments.length === 0 ? parseWhatIfPrompt(cleanText) : null;
|
|
3079
3065
|
if (whatifParsed && customBubble == null) {
|
|
3080
|
-
return /* @__PURE__ */ jsx24("div", { part: "user-row", className: "blade-chat-user-row flex justify-end", children: /* @__PURE__ */
|
|
3066
|
+
return /* @__PURE__ */ jsx24("div", { part: "user-row", className: "blade-chat-user-row flex justify-end", children: /* @__PURE__ */ jsxs22("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-2", children: [
|
|
3081
3067
|
pluginPills,
|
|
3082
3068
|
topicAssetPills,
|
|
3083
3069
|
/* @__PURE__ */ jsx24(ContextAttachmentPills, { attachments: message.context_attachments }),
|
|
@@ -3133,8 +3119,8 @@ function UserMessageBubble({ message, className }) {
|
|
|
3133
3119
|
const mode = kind === "text" ? lower2.endsWith(".md") ? "markdown" : "text" : "default";
|
|
3134
3120
|
setPreview({ filename: attachment.name, url, mode });
|
|
3135
3121
|
};
|
|
3136
|
-
return /* @__PURE__ */ jsx24("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", className), children: /* @__PURE__ */
|
|
3137
|
-
(imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */
|
|
3122
|
+
return /* @__PURE__ */ jsx24("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", className), children: /* @__PURE__ */ jsxs22("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-3", children: [
|
|
3123
|
+
(imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */ jsxs22("div", { className: "grid gap-2", children: [
|
|
3138
3124
|
imageParts.map((part, idx) => /* @__PURE__ */ jsx24(
|
|
3139
3125
|
"button",
|
|
3140
3126
|
{
|
|
@@ -3246,7 +3232,7 @@ function ErrorMessageBlock({
|
|
|
3246
3232
|
}) {
|
|
3247
3233
|
const text = chatErrorForDisplay(getTextContent(message.content));
|
|
3248
3234
|
const looksLikeModelUnavailable = /no source matches this model|404/i.test(text);
|
|
3249
|
-
return /* @__PURE__ */ jsx24("div", { part: "error-row", className: cn("blade-chat-error-row flex min-w-0 justify-start", className), children: /* @__PURE__ */
|
|
3235
|
+
return /* @__PURE__ */ jsx24("div", { part: "error-row", className: cn("blade-chat-error-row flex min-w-0 justify-start", className), children: /* @__PURE__ */ jsxs22("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: [
|
|
3250
3236
|
text,
|
|
3251
3237
|
looksLikeModelUnavailable ? /* @__PURE__ */ jsx24("div", { className: "mt-1 opacity-80", children: "\u6A21\u578B\u53EF\u80FD\u672A\u542F\u52A8\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" }) : null
|
|
3252
3238
|
] }) });
|
|
@@ -3261,7 +3247,7 @@ function findLatestReasoningMessageIndex(messages) {
|
|
|
3261
3247
|
}
|
|
3262
3248
|
|
|
3263
3249
|
// src/chat/AgentLoopBlock.tsx
|
|
3264
|
-
import { Fragment as Fragment11, jsx as jsx25, jsxs as
|
|
3250
|
+
import { Fragment as Fragment11, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3265
3251
|
var COLLAPSED_SUMMARY_HIDDEN_TOOLS = /* @__PURE__ */ new Set(["ReadSkill", "Read"]);
|
|
3266
3252
|
function safeParseDescription(argsStr) {
|
|
3267
3253
|
try {
|
|
@@ -3364,7 +3350,7 @@ function AgentLoopBlock({
|
|
|
3364
3350
|
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";
|
|
3365
3351
|
const latestReasoningIndex = status === "running" ? findLatestReasoningMessageIndex(childMessages) : -1;
|
|
3366
3352
|
const cardStyles = getLoopCardStyles(status);
|
|
3367
|
-
return /* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ jsxs23(
|
|
3368
3354
|
"div",
|
|
3369
3355
|
{
|
|
3370
3356
|
part: "agent-loop",
|
|
@@ -3373,8 +3359,8 @@ function AgentLoopBlock({
|
|
|
3373
3359
|
cardStyles.borderClass
|
|
3374
3360
|
),
|
|
3375
3361
|
children: [
|
|
3376
|
-
status === "running" || status === "awaiting_answer" ? /* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
3362
|
+
status === "running" || status === "awaiting_answer" ? /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
3363
|
+
/* @__PURE__ */ jsxs23(
|
|
3378
3364
|
"div",
|
|
3379
3365
|
{
|
|
3380
3366
|
className: cn(
|
|
@@ -3389,9 +3375,9 @@ function AgentLoopBlock({
|
|
|
3389
3375
|
onClick: toggleExpanded,
|
|
3390
3376
|
"aria-expanded": expanded,
|
|
3391
3377
|
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",
|
|
3392
|
-
children: /* @__PURE__ */
|
|
3378
|
+
children: /* @__PURE__ */ jsxs23("span", { className: "min-w-0 flex items-center gap-2", children: [
|
|
3393
3379
|
status === "awaiting_answer" ? /* @__PURE__ */ jsx25(MessageSquareMore, { size: 14, className: "shrink-0 text-[hsl(var(--swf-warning))] motion-safe:animate-pulse" }) : /* @__PURE__ */ jsx25(Bot, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
|
|
3394
|
-
/* @__PURE__ */
|
|
3380
|
+
/* @__PURE__ */ jsxs23("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: [
|
|
3395
3381
|
renderDescription ? renderDescription(description) : description,
|
|
3396
3382
|
status === "awaiting_answer" ? " \u2014 \u7B49\u5F85\u56DE\u7B54" : ""
|
|
3397
3383
|
] })
|
|
@@ -3437,12 +3423,12 @@ function AgentLoopBlock({
|
|
|
3437
3423
|
level: 2
|
|
3438
3424
|
},
|
|
3439
3425
|
childToolCall.id
|
|
3440
|
-
)) : /* @__PURE__ */
|
|
3426
|
+
)) : /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2 px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
3441
3427
|
/* @__PURE__ */ jsx25(LoaderCircle, { size: 12, className: "shrink-0 animate-spin text-[hsl(var(--muted-foreground))]" }),
|
|
3442
3428
|
/* @__PURE__ */ jsx25("span", { children: "\u6B63\u5728\u542F\u52A8..." })
|
|
3443
3429
|
] }) }) : status === "awaiting_answer" ? /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-1 py-2", children: /* @__PURE__ */ jsx25("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
|
|
3444
|
-
] }) : /* @__PURE__ */
|
|
3445
|
-
/* @__PURE__ */
|
|
3430
|
+
] }) : /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
3431
|
+
/* @__PURE__ */ jsxs23(
|
|
3446
3432
|
"div",
|
|
3447
3433
|
{
|
|
3448
3434
|
className: cn(
|
|
@@ -3457,7 +3443,7 @@ function AgentLoopBlock({
|
|
|
3457
3443
|
onClick: toggleExpanded,
|
|
3458
3444
|
"aria-expanded": expanded,
|
|
3459
3445
|
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",
|
|
3460
|
-
children: /* @__PURE__ */
|
|
3446
|
+
children: /* @__PURE__ */ jsxs23("span", { className: "min-w-0 flex items-center gap-2", children: [
|
|
3461
3447
|
status === "error" ? /* @__PURE__ */ jsx25(X, { size: 14, className: cn("shrink-0", cardStyles.iconClass) }) : status === "cancelled" ? /* @__PURE__ */ jsx25(Ban, { size: 14, className: cn("shrink-0", cardStyles.iconClass) }) : /* @__PURE__ */ jsx25(Check, { size: 14, className: "shrink-0 text-[hsl(var(--swf-success))]" }),
|
|
3462
3448
|
/* @__PURE__ */ jsx25("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: renderDescription ? renderDescription(description) : description })
|
|
3463
3449
|
] })
|
|
@@ -3494,9 +3480,9 @@ function AgentLoopBlock({
|
|
|
3494
3480
|
]
|
|
3495
3481
|
}
|
|
3496
3482
|
),
|
|
3497
|
-
!expanded ? /* @__PURE__ */
|
|
3483
|
+
!expanded ? /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
3498
3484
|
/* @__PURE__ */ jsx25("div", { className: "flex flex-wrap gap-1.5 px-4 py-2", children: completedToolLabels.length > 0 ? completedToolLabels.map(
|
|
3499
|
-
(item) => item.kind === "file" ? /* @__PURE__ */
|
|
3485
|
+
(item) => item.kind === "file" ? /* @__PURE__ */ jsxs23(
|
|
3500
3486
|
"span",
|
|
3501
3487
|
{
|
|
3502
3488
|
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))]",
|
|
@@ -3519,10 +3505,10 @@ function AgentLoopBlock({
|
|
|
3519
3505
|
inlineToolUiBlocks.length > 0 ? /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-2 px-4 pb-3", children: inlineToolUiBlocks.map((block) => /* @__PURE__ */ jsx25(ToolUiCard, { card: block.card, sessionId }, block.key)) }) : null
|
|
3520
3506
|
] }) : null
|
|
3521
3507
|
] }),
|
|
3522
|
-
expanded && /* @__PURE__ */
|
|
3508
|
+
expanded && /* @__PURE__ */ jsxs23("div", { className: "border-t border-[hsl(var(--border))] py-2", children: [
|
|
3523
3509
|
(() => {
|
|
3524
3510
|
const taskPrompt = safeParsePrompt(toolCall.arguments);
|
|
3525
|
-
return taskPrompt ? /* @__PURE__ */
|
|
3511
|
+
return taskPrompt ? /* @__PURE__ */ jsxs23("details", { className: "mx-3 mb-2 rounded-md bg-[hsl(var(--muted))]/40", children: [
|
|
3526
3512
|
/* @__PURE__ */ jsx25("summary", { className: "cursor-pointer px-3 py-1.5 text-[11px] font-medium text-[hsl(var(--muted-foreground))]", children: "\u4EFB\u52A1" }),
|
|
3527
3513
|
/* @__PURE__ */ jsx25("div", { className: "px-3 pb-2", children: /* @__PURE__ */ jsx25("pre", { className: "whitespace-pre-wrap text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: taskPrompt }) })
|
|
3528
3514
|
] }) : null;
|
|
@@ -3552,7 +3538,7 @@ function AgentLoopBlock({
|
|
|
3552
3538
|
},
|
|
3553
3539
|
message.entry_id ?? `${message.timestamp ?? "error"}-${index}`
|
|
3554
3540
|
) : null
|
|
3555
|
-
) }) : status === "running" ? /* @__PURE__ */
|
|
3541
|
+
) }) : status === "running" ? /* @__PURE__ */ jsxs23("div", { className: "px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
|
|
3556
3542
|
/* @__PURE__ */ jsx25(LoaderCircle, { size: 12, className: "mr-1.5 inline animate-spin" }),
|
|
3557
3543
|
"\u6B63\u5728\u542F\u52A8..."
|
|
3558
3544
|
] }) : toolCall.result ? /* @__PURE__ */ jsx25("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
|
|
@@ -3579,8 +3565,8 @@ function ExpandedChildAssistantMessage({
|
|
|
3579
3565
|
if (!text && !hasToolCalls && !(showReasoning && message.reasoning) && !message.blocks?.some((block) => block.type === "tool_ui")) {
|
|
3580
3566
|
return null;
|
|
3581
3567
|
}
|
|
3582
|
-
return /* @__PURE__ */
|
|
3583
|
-
showReasoning && message.reasoning && /* @__PURE__ */
|
|
3568
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-2", children: [
|
|
3569
|
+
showReasoning && message.reasoning && /* @__PURE__ */ jsxs23(Reasoning, { isStreaming, children: [
|
|
3584
3570
|
/* @__PURE__ */ jsx25(ReasoningTrigger, { wordCount: message.reasoning.length }),
|
|
3585
3571
|
/* @__PURE__ */ jsx25(ReasoningContent, { children: message.reasoning })
|
|
3586
3572
|
] }),
|
|
@@ -3626,7 +3612,7 @@ function ChildText({
|
|
|
3626
3612
|
sessionId,
|
|
3627
3613
|
reasoning
|
|
3628
3614
|
}) {
|
|
3629
|
-
return /* @__PURE__ */
|
|
3615
|
+
return /* @__PURE__ */ jsxs23("div", { className: "pl-8 text-[12px] leading-6 text-[hsl(var(--foreground))]", children: [
|
|
3630
3616
|
/* @__PURE__ */ jsx25(
|
|
3631
3617
|
MarkdownContent,
|
|
3632
3618
|
{
|
|
@@ -3666,7 +3652,7 @@ function getLoopCardStyles(status) {
|
|
|
3666
3652
|
}
|
|
3667
3653
|
|
|
3668
3654
|
// src/chat/WorkflowRunBlock.tsx
|
|
3669
|
-
import { Fragment as Fragment12, jsx as jsx26, jsxs as
|
|
3655
|
+
import { Fragment as Fragment12, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3670
3656
|
var EMPTY_ENTRIES = [];
|
|
3671
3657
|
var NO_SKILLS = [];
|
|
3672
3658
|
function workflowTitle(name, argumentsJson, skills) {
|
|
@@ -3768,7 +3754,7 @@ function RefTokenText({ text, refs }) {
|
|
|
3768
3754
|
const id = match[1];
|
|
3769
3755
|
const info = refs.get(id);
|
|
3770
3756
|
parts.push(
|
|
3771
|
-
/* @__PURE__ */
|
|
3757
|
+
/* @__PURE__ */ jsxs24(
|
|
3772
3758
|
"span",
|
|
3773
3759
|
{
|
|
3774
3760
|
title: info?.value ? info.value.slice(0, 300) : "\u5C1A\u65E0\u8F93\u51FA",
|
|
@@ -3846,8 +3832,8 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
3846
3832
|
const title = workflowTitle(run?.name || "\u6280\u80FD", toolCall.arguments, sessionSkills);
|
|
3847
3833
|
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`;
|
|
3848
3834
|
const hasStepContent = groups.length > 0 || stepLoops.length > 0;
|
|
3849
|
-
return /* @__PURE__ */
|
|
3850
|
-
/* @__PURE__ */
|
|
3835
|
+
return /* @__PURE__ */ jsxs24("div", { className: "msg-animate overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]/50", children: [
|
|
3836
|
+
/* @__PURE__ */ jsxs24(
|
|
3851
3837
|
"button",
|
|
3852
3838
|
{
|
|
3853
3839
|
type: "button",
|
|
@@ -3856,11 +3842,11 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
3856
3842
|
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",
|
|
3857
3843
|
children: [
|
|
3858
3844
|
/* @__PURE__ */ jsx26(Zap, { size: 15, className: "shrink-0 text-violet-600" }),
|
|
3859
|
-
/* @__PURE__ */
|
|
3845
|
+
/* @__PURE__ */ jsxs24("span", { className: "min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: [
|
|
3860
3846
|
"\u56FA\u5B9A\u6D41\u7A0B \xB7 ",
|
|
3861
3847
|
title
|
|
3862
3848
|
] }),
|
|
3863
|
-
/* @__PURE__ */
|
|
3849
|
+
/* @__PURE__ */ jsxs24("span", { className: "ml-auto flex shrink-0 items-center gap-1.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
3864
3850
|
running ? /* @__PURE__ */ jsx26(LoaderCircle, { size: 12, className: "animate-spin" }) : null,
|
|
3865
3851
|
statusSummary
|
|
3866
3852
|
] }),
|
|
@@ -3877,13 +3863,13 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
3877
3863
|
]
|
|
3878
3864
|
}
|
|
3879
3865
|
),
|
|
3880
|
-
!collapsed && /* @__PURE__ */
|
|
3866
|
+
!collapsed && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-2 p-3", children: [
|
|
3881
3867
|
/* @__PURE__ */ jsx26(LogLines, { logs: meaningfulLogs(prelude) }),
|
|
3882
3868
|
groups.map((group, index) => {
|
|
3883
3869
|
const loop = groupLoops[index];
|
|
3884
3870
|
const logs = meaningfulLogs(group.logs);
|
|
3885
3871
|
if (loop) {
|
|
3886
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1", children: [
|
|
3887
3873
|
/* @__PURE__ */ jsx26(
|
|
3888
3874
|
AgentLoopBlock,
|
|
3889
3875
|
{
|
|
@@ -3897,7 +3883,7 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
3897
3883
|
] }, group.key);
|
|
3898
3884
|
}
|
|
3899
3885
|
const container = CONTAINER_LABEL[group.stepKind];
|
|
3900
|
-
return /* @__PURE__ */
|
|
3886
|
+
return /* @__PURE__ */ jsxs24(
|
|
3901
3887
|
"div",
|
|
3902
3888
|
{
|
|
3903
3889
|
className: cn(
|
|
@@ -3905,7 +3891,7 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
3905
3891
|
container ? "border border-dashed border-violet-400/50 bg-violet-500/5" : "border border-[hsl(var(--border))] bg-[hsl(var(--card))]"
|
|
3906
3892
|
),
|
|
3907
3893
|
children: [
|
|
3908
|
-
/* @__PURE__ */
|
|
3894
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1.5 text-sm text-[hsl(var(--foreground))]", children: [
|
|
3909
3895
|
/* @__PURE__ */ jsx26(StatusIcon, { status: stepStatus(group, status) }),
|
|
3910
3896
|
container ? /* @__PURE__ */ jsx26("span", { className: "text-[11px] font-semibold text-violet-600", children: container }) : null,
|
|
3911
3897
|
/* @__PURE__ */ jsx26("span", { className: "min-w-0 truncate", children: renderRefText(group.desc || group.stepId) })
|
|
@@ -3927,7 +3913,7 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
|
|
|
3927
3913
|
step.loopName
|
|
3928
3914
|
)),
|
|
3929
3915
|
(!hasStepContent && output || status === "error" && output) && /* @__PURE__ */ jsx26("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: output }),
|
|
3930
|
-
status === "done" && hasStepContent && finalOutput && /* @__PURE__ */
|
|
3916
|
+
status === "done" && hasStepContent && finalOutput && /* @__PURE__ */ jsxs24("details", { className: "rounded-lg border border-[hsl(var(--border))] px-3 py-2", children: [
|
|
3931
3917
|
/* @__PURE__ */ jsx26("summary", { className: "cursor-pointer select-none text-xs text-[hsl(var(--muted-foreground))]", children: "\u6700\u7EC8\u8F93\u51FA" }),
|
|
3932
3918
|
/* @__PURE__ */ jsx26("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 })
|
|
3933
3919
|
] }),
|
|
@@ -3989,7 +3975,7 @@ function toolCallAnswered(toolCall, sessionStatus, answerData) {
|
|
|
3989
3975
|
}
|
|
3990
3976
|
|
|
3991
3977
|
// src/chat/AssistantTurnBlock.tsx
|
|
3992
|
-
import { jsx as jsx27, jsxs as
|
|
3978
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3993
3979
|
var EMPTY_MESSAGES = [];
|
|
3994
3980
|
var EMPTY_AGENT_LOOPS = {};
|
|
3995
3981
|
var turnDisplayModeMemory = /* @__PURE__ */ new Map();
|
|
@@ -4304,7 +4290,7 @@ function AssistantTurnBlockBase({
|
|
|
4304
4290
|
if (observedMemoryRefs.length > 0) setCachedMemoryRefs(observedMemoryRefs);
|
|
4305
4291
|
}, [observedMemoryRefs]);
|
|
4306
4292
|
const memoryRefs = observedMemoryRefs.length > 0 ? observedMemoryRefs : cachedMemoryRefs;
|
|
4307
|
-
return /* @__PURE__ */
|
|
4293
|
+
return /* @__PURE__ */ jsxs25(
|
|
4308
4294
|
"div",
|
|
4309
4295
|
{
|
|
4310
4296
|
"aria-busy": isStreaming || void 0,
|
|
@@ -4318,7 +4304,7 @@ function AssistantTurnBlockBase({
|
|
|
4318
4304
|
memoryRefs.length > 0 && /* @__PURE__ */ jsx27(MemoryRefsHint, { refs: memoryRefs }),
|
|
4319
4305
|
hasInterruptedState && /* @__PURE__ */ jsx27("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" }),
|
|
4320
4306
|
hasFailedWithoutContent && /* @__PURE__ */ jsx27("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" }),
|
|
4321
|
-
hasExecutionProcess && /* @__PURE__ */
|
|
4307
|
+
hasExecutionProcess && /* @__PURE__ */ jsxs25("div", { className: "flex w-full items-start gap-2.5", children: [
|
|
4322
4308
|
/* @__PURE__ */ jsx27(
|
|
4323
4309
|
"span",
|
|
4324
4310
|
{
|
|
@@ -4327,8 +4313,8 @@ function AssistantTurnBlockBase({
|
|
|
4327
4313
|
children: /* @__PURE__ */ jsx27(Bot, { size: 16 })
|
|
4328
4314
|
}
|
|
4329
4315
|
),
|
|
4330
|
-
/* @__PURE__ */
|
|
4331
|
-
/* @__PURE__ */
|
|
4316
|
+
/* @__PURE__ */ jsxs25("div", { className: "min-w-0 flex-1 pt-0.5", children: [
|
|
4317
|
+
/* @__PURE__ */ jsxs25(
|
|
4332
4318
|
"button",
|
|
4333
4319
|
{
|
|
4334
4320
|
type: "button",
|
|
@@ -4370,7 +4356,7 @@ function AssistantTurnBlockBase({
|
|
|
4370
4356
|
/* @__PURE__ */ jsx27("div", { className: "mt-3 h-px w-full bg-[hsl(var(--border)/0.75)]" })
|
|
4371
4357
|
] })
|
|
4372
4358
|
] }),
|
|
4373
|
-
hasExecutionProcess && effectiveMode === "detail" ? /* @__PURE__ */
|
|
4359
|
+
hasExecutionProcess && effectiveMode === "detail" ? /* @__PURE__ */ jsxs25("div", { className: "ml-10 flex flex-col gap-1", children: [
|
|
4374
4360
|
/* @__PURE__ */ jsx27(
|
|
4375
4361
|
AssistantMessages,
|
|
4376
4362
|
{
|
|
@@ -4600,12 +4586,12 @@ function AssistantMessages({
|
|
|
4600
4586
|
);
|
|
4601
4587
|
const hasToolCalls = toolCalls.length > 0;
|
|
4602
4588
|
const orderedParts = getOrderedMessageParts(message, toolCalls);
|
|
4603
|
-
return /* @__PURE__ */
|
|
4589
|
+
return /* @__PURE__ */ jsxs25(
|
|
4604
4590
|
"div",
|
|
4605
4591
|
{
|
|
4606
4592
|
className: "flex flex-col gap-1",
|
|
4607
4593
|
children: [
|
|
4608
|
-
showReasoning && /* @__PURE__ */
|
|
4594
|
+
showReasoning && /* @__PURE__ */ jsxs25(
|
|
4609
4595
|
Reasoning,
|
|
4610
4596
|
{
|
|
4611
4597
|
isStreaming: isReasoningStreamingLastMessage,
|
|
@@ -4714,7 +4700,7 @@ function CompactToolGroupBlock({
|
|
|
4714
4700
|
level,
|
|
4715
4701
|
customization
|
|
4716
4702
|
}) {
|
|
4717
|
-
return /* @__PURE__ */
|
|
4703
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-1", children: [
|
|
4718
4704
|
toolCalls.map((toolCall) => {
|
|
4719
4705
|
if (isWorkflowRunToolName2(toolCall.name)) return null;
|
|
4720
4706
|
const CustomToolCall = customization?.components?.ToolCall;
|
|
@@ -4775,7 +4761,7 @@ function AssistantMessageContent({
|
|
|
4775
4761
|
if (!text && imageParts.length === 0 && fileParts.length === 0 && !reasoning && !failed) {
|
|
4776
4762
|
return null;
|
|
4777
4763
|
}
|
|
4778
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-3", children: [
|
|
4779
4765
|
failed ? /* @__PURE__ */ jsx27("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,
|
|
4780
4766
|
imageParts.length > 0 && /* @__PURE__ */ jsx27("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx27(
|
|
4781
4767
|
MessageImage,
|
|
@@ -4824,7 +4810,7 @@ function AssistantText({
|
|
|
4824
4810
|
() => ({ sessionId, messageId, sendMessage }),
|
|
4825
4811
|
[sessionId, messageId, sendMessage]
|
|
4826
4812
|
);
|
|
4827
|
-
return /* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ jsxs25(
|
|
4828
4814
|
"div",
|
|
4829
4815
|
{
|
|
4830
4816
|
part: "assistant-text",
|
|
@@ -4859,13 +4845,13 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
|
|
|
4859
4845
|
const memoriesHref = useChatEnvironment().memoriesHref;
|
|
4860
4846
|
const hasSkill = refs.some((r) => r.skill_name);
|
|
4861
4847
|
const label = hasSkill ? "\u53C2\u8003\u4E86\u8BE5\u6280\u80FD\u7684\u5386\u53F2\u7ECF\u9A8C" : "\u53C2\u8003\u4E86\u5386\u53F2\u7ECF\u9A8C";
|
|
4862
|
-
return /* @__PURE__ */
|
|
4848
|
+
return /* @__PURE__ */ jsxs25(
|
|
4863
4849
|
"div",
|
|
4864
4850
|
{
|
|
4865
4851
|
part: "memory-refs",
|
|
4866
4852
|
className: cn("blade-chat-memory-refs relative z-[1] ml-1 w-[calc(100%-0.25rem)] max-w-[680px] self-start", className),
|
|
4867
4853
|
children: [
|
|
4868
|
-
/* @__PURE__ */
|
|
4854
|
+
/* @__PURE__ */ jsxs25(
|
|
4869
4855
|
"button",
|
|
4870
4856
|
{
|
|
4871
4857
|
type: "button",
|
|
@@ -4873,7 +4859,7 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
|
|
|
4873
4859
|
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)]",
|
|
4874
4860
|
children: [
|
|
4875
4861
|
/* @__PURE__ */ jsx27(BookOpen, { size: 12 }),
|
|
4876
|
-
/* @__PURE__ */
|
|
4862
|
+
/* @__PURE__ */ jsxs25("span", { children: [
|
|
4877
4863
|
label,
|
|
4878
4864
|
"\uFF08",
|
|
4879
4865
|
refs.length,
|
|
@@ -4889,8 +4875,8 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
|
|
|
4889
4875
|
]
|
|
4890
4876
|
}
|
|
4891
4877
|
),
|
|
4892
|
-
expanded && /* @__PURE__ */
|
|
4893
|
-
refs.map((ref) => /* @__PURE__ */
|
|
4878
|
+
expanded && /* @__PURE__ */ jsxs25("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: [
|
|
4879
|
+
refs.map((ref) => /* @__PURE__ */ jsxs25(
|
|
4894
4880
|
"div",
|
|
4895
4881
|
{
|
|
4896
4882
|
className: "rounded-lg border border-[hsl(var(--border)/0.55)] bg-[hsl(var(--background)/0.72)] px-3 py-2.5",
|
|
@@ -4901,7 +4887,7 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
|
|
|
4901
4887
|
},
|
|
4902
4888
|
ref.id
|
|
4903
4889
|
)),
|
|
4904
|
-
memoriesHref ? /* @__PURE__ */
|
|
4890
|
+
memoriesHref ? /* @__PURE__ */ jsxs25(
|
|
4905
4891
|
"a",
|
|
4906
4892
|
{
|
|
4907
4893
|
href: memoriesHref,
|
|
@@ -5379,15 +5365,15 @@ import {
|
|
|
5379
5365
|
getContextDisplayState,
|
|
5380
5366
|
getContextGroupDisplayState
|
|
5381
5367
|
} from "@blade-hq/agent-client/internal";
|
|
5382
|
-
import { jsx as jsx28, jsxs as
|
|
5368
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5383
5369
|
function ContextCard({ context, className }) {
|
|
5384
5370
|
const display = getContextDisplayState(context);
|
|
5385
|
-
return /* @__PURE__ */
|
|
5371
|
+
return /* @__PURE__ */ jsxs26(
|
|
5386
5372
|
"details",
|
|
5387
5373
|
{
|
|
5388
5374
|
className: `blade-chat-context-card group/context-card overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-sm ${className ?? ""}`,
|
|
5389
5375
|
children: [
|
|
5390
|
-
/* @__PURE__ */
|
|
5376
|
+
/* @__PURE__ */ jsxs26("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: [
|
|
5391
5377
|
/* @__PURE__ */ jsx28(
|
|
5392
5378
|
Layers,
|
|
5393
5379
|
{
|
|
@@ -5396,7 +5382,7 @@ function ContextCard({ context, className }) {
|
|
|
5396
5382
|
"aria-hidden": "true"
|
|
5397
5383
|
}
|
|
5398
5384
|
),
|
|
5399
|
-
/* @__PURE__ */
|
|
5385
|
+
/* @__PURE__ */ jsxs26("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
|
|
5400
5386
|
/* @__PURE__ */ jsx28("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: display.title }),
|
|
5401
5387
|
/* @__PURE__ */ jsx28("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: display.summary })
|
|
5402
5388
|
] }),
|
|
@@ -5418,8 +5404,8 @@ function ContextGroupCard({ contexts, className }) {
|
|
|
5418
5404
|
if (contexts.length === 0) return null;
|
|
5419
5405
|
const single = contexts.length === 1 ? getContextDisplayState(contexts[0]) : null;
|
|
5420
5406
|
const group = single ? null : getContextGroupDisplayState(contexts);
|
|
5421
|
-
return /* @__PURE__ */
|
|
5422
|
-
/* @__PURE__ */
|
|
5407
|
+
return /* @__PURE__ */ jsxs26("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: [
|
|
5408
|
+
/* @__PURE__ */ jsxs26("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: [
|
|
5423
5409
|
/* @__PURE__ */ jsx28(
|
|
5424
5410
|
Layers,
|
|
5425
5411
|
{
|
|
@@ -5428,7 +5414,7 @@ function ContextGroupCard({ contexts, className }) {
|
|
|
5428
5414
|
"aria-hidden": "true"
|
|
5429
5415
|
}
|
|
5430
5416
|
),
|
|
5431
|
-
/* @__PURE__ */
|
|
5417
|
+
/* @__PURE__ */ jsxs26("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
|
|
5432
5418
|
/* @__PURE__ */ jsx28("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: single ? single.title : `${group?.title} \xB7 ${group?.count} \u9879` }),
|
|
5433
5419
|
/* @__PURE__ */ jsx28("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: single ? single.summary : group?.summary })
|
|
5434
5420
|
] }),
|
|
@@ -5453,7 +5439,7 @@ function ContextGroupCard({ contexts, className }) {
|
|
|
5453
5439
|
|
|
5454
5440
|
// src/chat/ResultFeedback.tsx
|
|
5455
5441
|
import { useCallback as useCallback6, useEffect as useEffect15, useRef as useRef12, useState as useState18 } from "react";
|
|
5456
|
-
import { jsx as jsx29, jsxs as
|
|
5442
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5457
5443
|
var REASONS = [
|
|
5458
5444
|
{ value: "not_solved", label: "\u6CA1\u89E3\u51B3\u95EE\u9898" },
|
|
5459
5445
|
{ value: "inaccurate", label: "\u5185\u5BB9\u4E0D\u51C6\u786E" },
|
|
@@ -5467,17 +5453,17 @@ function reasonLabel(reason) {
|
|
|
5467
5453
|
}
|
|
5468
5454
|
function HistoricalResultFeedback({ feedback }) {
|
|
5469
5455
|
const label = reasonLabel(feedback.reason);
|
|
5470
|
-
return /* @__PURE__ */
|
|
5456
|
+
return /* @__PURE__ */ jsxs27(
|
|
5471
5457
|
"section",
|
|
5472
5458
|
{
|
|
5473
5459
|
"aria-label": "\u5386\u53F2\u7ED3\u679C\u53CD\u9988",
|
|
5474
5460
|
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))]",
|
|
5475
5461
|
children: [
|
|
5476
|
-
/* @__PURE__ */
|
|
5462
|
+
/* @__PURE__ */ jsxs27("span", { children: [
|
|
5477
5463
|
"\u4F60\u5BF9\u6B64\u8F6E\u7ED3\u679C\u7684\u8BC4\u4EF7\uFF1A",
|
|
5478
5464
|
feedback.helpful ? "\u6709\u5E2E\u52A9" : "\u6CA1\u5E2E\u52A9"
|
|
5479
5465
|
] }),
|
|
5480
|
-
label ? /* @__PURE__ */
|
|
5466
|
+
label ? /* @__PURE__ */ jsxs27("span", { children: [
|
|
5481
5467
|
" \xB7 ",
|
|
5482
5468
|
label
|
|
5483
5469
|
] }) : null
|
|
@@ -5552,14 +5538,14 @@ function ResultFeedback({
|
|
|
5552
5538
|
[client, emit, followup.assistant_entry_id, onSaved, sessionId]
|
|
5553
5539
|
);
|
|
5554
5540
|
if (!visible) return null;
|
|
5555
|
-
return /* @__PURE__ */
|
|
5541
|
+
return /* @__PURE__ */ jsxs27(
|
|
5556
5542
|
"section",
|
|
5557
5543
|
{
|
|
5558
5544
|
"aria-label": "\u7ED3\u679C\u53CD\u9988",
|
|
5559
5545
|
className: "flex flex-col gap-2 border-t border-[hsl(var(--border)/0.7)] pt-3",
|
|
5560
5546
|
children: [
|
|
5561
5547
|
/* @__PURE__ */ jsx29("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u76EE\u524D\u7684\u6574\u4F53\u7ED3\u679C\u6709\u5E2E\u52A9\u5417\uFF1F" }),
|
|
5562
|
-
/* @__PURE__ */
|
|
5548
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex flex-wrap gap-1.5", children: [
|
|
5563
5549
|
/* @__PURE__ */ jsx29(
|
|
5564
5550
|
"button",
|
|
5565
5551
|
{
|
|
@@ -5595,7 +5581,7 @@ function ResultFeedback({
|
|
|
5595
5581
|
},
|
|
5596
5582
|
reason.value
|
|
5597
5583
|
)) }) : null,
|
|
5598
|
-
saveError ? /* @__PURE__ */
|
|
5584
|
+
saveError ? /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--destructive))]", children: [
|
|
5599
5585
|
/* @__PURE__ */ jsx29("span", { children: "\u53CD\u9988\u6682\u672A\u4FDD\u5B58\uFF0C\u53EF\u91CD\u8BD5" }),
|
|
5600
5586
|
/* @__PURE__ */ jsx29(
|
|
5601
5587
|
"button",
|
|
@@ -5616,7 +5602,7 @@ function ResultFeedback({
|
|
|
5616
5602
|
}
|
|
5617
5603
|
|
|
5618
5604
|
// src/chat/LiteMessageList.tsx
|
|
5619
|
-
import { jsx as jsx30, jsxs as
|
|
5605
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5620
5606
|
var LITE_LOADING_INDICATOR_HEIGHT = 38;
|
|
5621
5607
|
function messageText(message) {
|
|
5622
5608
|
return getTextContent3(normalizeMessageContent2(message.content)).trim();
|
|
@@ -5649,6 +5635,8 @@ function buildLiteRows({
|
|
|
5649
5635
|
let turnMessages = [];
|
|
5650
5636
|
const followupMatchesBlock = block.type === "assistant_turn" && followup != null && block.messages.some((message) => message.entry_id === followup.assistant_entry_id);
|
|
5651
5637
|
if (block.type === "message") {
|
|
5638
|
+
const sourceTitle = packEventTitle(block.message);
|
|
5639
|
+
if (sourceTitle) rows.push({ type: "pack-event", key: `${block.key}:pack-event`, title: sourceTitle });
|
|
5652
5640
|
if (isBackgroundWakeMessage2(block.message)) {
|
|
5653
5641
|
rows.push({ type: "background-wakeup", key: block.message.render_id ?? block.key });
|
|
5654
5642
|
continue;
|
|
@@ -5850,7 +5838,7 @@ function LiteMessageList({
|
|
|
5850
5838
|
});
|
|
5851
5839
|
const totalSize = virtualizer.getTotalSize();
|
|
5852
5840
|
const latestSignature = rows.map(
|
|
5853
|
-
(row) => row.type === "text" ? `${row.key}:${row.text.length}` : row.type === "question" ? `${row.key}:${row.toolCall.status ?? ""}` : row.type === "tool-description" ? `${row.key}:${row.running ? 1 : 0}` : row.type === "context-group" ? `${row.key}:${row.contexts.length}:${row.contexts.at(-1)?.context_revision ?? ""}` : row.type === "context-divider" || row.type === "background-wakeup" ? row.key : row.type === "historical-feedback" ? `${row.key}:${row.feedback.updated_at}` : row.type === "memory-refs" ? `${row.key}:${row.refs.length}` : `${row.key}:${row.followup.suggestions.length}:${row.followup.final_artifacts?.length ?? 0}`
|
|
5841
|
+
(row) => row.type === "text" ? `${row.key}:${row.text.length}` : row.type === "question" ? `${row.key}:${row.toolCall.status ?? ""}` : row.type === "tool-description" ? `${row.key}:${row.running ? 1 : 0}` : row.type === "context-group" ? `${row.key}:${row.contexts.length}:${row.contexts.at(-1)?.context_revision ?? ""}` : row.type === "context-divider" || row.type === "background-wakeup" || row.type === "pack-event" ? row.key : row.type === "historical-feedback" ? `${row.key}:${row.feedback.updated_at}` : row.type === "memory-refs" ? `${row.key}:${row.refs.length}` : `${row.key}:${row.followup.suggestions.length}:${row.followup.final_artifacts?.length ?? 0}`
|
|
5854
5842
|
).join("|");
|
|
5855
5843
|
const getScrollElement = useCallback7(() => scrollRef.current, []);
|
|
5856
5844
|
const getTargetElement = useCallback7(() => {
|
|
@@ -5904,7 +5892,7 @@ function LiteMessageList({
|
|
|
5904
5892
|
},
|
|
5905
5893
|
[]
|
|
5906
5894
|
);
|
|
5907
|
-
return /* @__PURE__ */
|
|
5895
|
+
return /* @__PURE__ */ jsxs28(
|
|
5908
5896
|
"div",
|
|
5909
5897
|
{
|
|
5910
5898
|
ref: scrollRef,
|
|
@@ -5918,7 +5906,7 @@ function LiteMessageList({
|
|
|
5918
5906
|
},
|
|
5919
5907
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-6 sm:px-8",
|
|
5920
5908
|
children: [
|
|
5921
|
-
rows.length === 0 ? /* @__PURE__ */ jsx30("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__ */
|
|
5909
|
+
rows.length === 0 ? /* @__PURE__ */ jsx30("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__ */ jsxs28(
|
|
5922
5910
|
"div",
|
|
5923
5911
|
{
|
|
5924
5912
|
className: "relative mx-auto w-full max-w-3xl",
|
|
@@ -5937,7 +5925,7 @@ function LiteMessageList({
|
|
|
5937
5925
|
"data-lite-row-key": row.key,
|
|
5938
5926
|
className: "absolute left-0 top-0 w-full pb-5",
|
|
5939
5927
|
style: { transform: `translateY(${virtualRow.start}px)` },
|
|
5940
|
-
children: row.type === "text" ? /* @__PURE__ */ jsx30(PlainTextMessage, { row, sessionId }) : row.type === "background-wakeup" ? /* @__PURE__ */ jsx30(BackgroundWakeNotice, {}) : row.type === "memory-refs" ? /* @__PURE__ */ jsx30(MemoryRefsHint, { refs: row.refs }) : row.type === "question" ? /* @__PURE__ */ jsx30(
|
|
5928
|
+
children: row.type === "text" ? /* @__PURE__ */ jsx30(PlainTextMessage, { row, sessionId }) : row.type === "background-wakeup" ? /* @__PURE__ */ jsx30(BackgroundWakeNotice, {}) : row.type === "pack-event" ? /* @__PURE__ */ jsx30(PackEventNotice, { title: row.title }) : row.type === "memory-refs" ? /* @__PURE__ */ jsx30(MemoryRefsHint, { refs: row.refs }) : row.type === "question" ? /* @__PURE__ */ jsx30(
|
|
5941
5929
|
ToolCallBlock,
|
|
5942
5930
|
{
|
|
5943
5931
|
toolCall: row.toolCall,
|
|
@@ -6006,7 +5994,7 @@ function PlainTextMessage({
|
|
|
6006
5994
|
if (row.role === "user") {
|
|
6007
5995
|
return /* @__PURE__ */ jsx30("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx30("div", { className: `max-w-[82%] rounded-[24px] bg-[hsl(var(--user-msg-bg))] px-4 py-2.5 text-base leading-[1.7] transition-colors duration-200 ${row.sending ? "text-[hsl(var(--muted-foreground))]" : "text-[hsl(var(--user-msg-fg))]"}`, children: markdown }) });
|
|
6008
5996
|
}
|
|
6009
|
-
return /* @__PURE__ */
|
|
5997
|
+
return /* @__PURE__ */ jsxs28(
|
|
6010
5998
|
"div",
|
|
6011
5999
|
{
|
|
6012
6000
|
className: `break-words text-sm leading-6 ${row.role === "error" ? "text-[hsl(var(--destructive))]" : "text-[hsl(var(--foreground))]"}`,
|
|
@@ -6038,11 +6026,11 @@ function LiteFollowup({
|
|
|
6038
6026
|
setDownloadingPath(null);
|
|
6039
6027
|
}
|
|
6040
6028
|
};
|
|
6041
|
-
return /* @__PURE__ */
|
|
6042
|
-
artifacts.length > 0 ? /* @__PURE__ */
|
|
6029
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-start gap-3", children: [
|
|
6030
|
+
artifacts.length > 0 ? /* @__PURE__ */ jsxs28("div", { className: "flex w-full flex-col items-start gap-1.5", children: [
|
|
6043
6031
|
/* @__PURE__ */ jsx30("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u672C\u8F6E\u6210\u679C" }),
|
|
6044
6032
|
artifacts.map(
|
|
6045
|
-
(artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */
|
|
6033
|
+
(artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */ jsxs28(
|
|
6046
6034
|
"a",
|
|
6047
6035
|
{
|
|
6048
6036
|
href: artifact.target,
|
|
@@ -6055,7 +6043,7 @@ function LiteFollowup({
|
|
|
6055
6043
|
]
|
|
6056
6044
|
},
|
|
6057
6045
|
`${artifact.kind}:${artifactIndex}`
|
|
6058
|
-
) : /* @__PURE__ */
|
|
6046
|
+
) : /* @__PURE__ */ jsxs28(
|
|
6059
6047
|
"button",
|
|
6060
6048
|
{
|
|
6061
6049
|
type: "button",
|
|
@@ -6075,9 +6063,9 @@ function LiteFollowup({
|
|
|
6075
6063
|
)
|
|
6076
6064
|
)
|
|
6077
6065
|
] }) : null,
|
|
6078
|
-
followup.suggestions.length > 0 ? /* @__PURE__ */
|
|
6066
|
+
followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs28("div", { className: "flex max-w-full flex-col items-start gap-1.5", children: [
|
|
6079
6067
|
/* @__PURE__ */ jsx30("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
|
|
6080
|
-
followup.suggestions.map((suggestion) => /* @__PURE__ */
|
|
6068
|
+
followup.suggestions.map((suggestion) => /* @__PURE__ */ jsxs28(
|
|
6081
6069
|
"button",
|
|
6082
6070
|
{
|
|
6083
6071
|
type: "button",
|
|
@@ -6542,6 +6530,9 @@ function useStickToBottomContext() {
|
|
|
6542
6530
|
return context;
|
|
6543
6531
|
}
|
|
6544
6532
|
|
|
6533
|
+
// src/chat/MessageList.tsx
|
|
6534
|
+
import { packEventTitle as packEventTitle2 } from "@blade-hq/agent-client/internal";
|
|
6535
|
+
|
|
6545
6536
|
// src/hooks/use-turn-navigation.ts
|
|
6546
6537
|
import {
|
|
6547
6538
|
getTextContent as getTextContent4,
|
|
@@ -9893,7 +9884,7 @@ function extractRefs(content) {
|
|
|
9893
9884
|
}
|
|
9894
9885
|
|
|
9895
9886
|
// src/chat/plan/PlanSummaryCard.tsx
|
|
9896
|
-
import { Fragment as Fragment13, jsx as jsx31, jsxs as
|
|
9887
|
+
import { Fragment as Fragment13, jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9897
9888
|
function PlanSummaryCard({
|
|
9898
9889
|
messages,
|
|
9899
9890
|
sessionStatus,
|
|
@@ -9908,8 +9899,8 @@ function PlanSummaryCard({
|
|
|
9908
9899
|
const isWaitingForInput = sessionStatus === "waiting_for_input";
|
|
9909
9900
|
const canConfirm = Boolean(onConfirmPlan) && isWaitingForInput && data.lastPauseTool === "ExitPlanMode";
|
|
9910
9901
|
const openPlanPanel = openPlanPanelAction && sessionId ? () => openPlanPanelAction(sessionId) : void 0;
|
|
9911
|
-
return /* @__PURE__ */
|
|
9912
|
-
/* @__PURE__ */
|
|
9902
|
+
return /* @__PURE__ */ jsxs29("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: [
|
|
9903
|
+
/* @__PURE__ */ jsxs29(
|
|
9913
9904
|
"button",
|
|
9914
9905
|
{
|
|
9915
9906
|
type: "button",
|
|
@@ -9917,14 +9908,14 @@ function PlanSummaryCard({
|
|
|
9917
9908
|
disabled: isHistorical || !openPlanPanel,
|
|
9918
9909
|
className: "flex w-full flex-col gap-4 text-left transition-colors hover:text-[hsl(var(--foreground))]",
|
|
9919
9910
|
children: [
|
|
9920
|
-
/* @__PURE__ */
|
|
9921
|
-
/* @__PURE__ */
|
|
9922
|
-
/* @__PURE__ */
|
|
9911
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-start justify-between gap-3", children: [
|
|
9912
|
+
/* @__PURE__ */ jsxs29("div", { className: "min-w-0 space-y-2", children: [
|
|
9913
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
9923
9914
|
/* @__PURE__ */ jsx31(Sparkles, { size: 12 }),
|
|
9924
9915
|
/* @__PURE__ */ jsx31("span", { children: "\u89C4\u5212\u6458\u8981" })
|
|
9925
9916
|
] }),
|
|
9926
9917
|
/* @__PURE__ */ jsx31("div", { className: "truncate text-base font-medium text-[hsl(var(--foreground))]", children: data.intent || "\u5F53\u524D\u89C4\u5212" }),
|
|
9927
|
-
/* @__PURE__ */ jsx31("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: summaryState.kind === "progress" ? /* @__PURE__ */
|
|
9918
|
+
/* @__PURE__ */ jsx31("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: summaryState.kind === "progress" ? /* @__PURE__ */ jsxs29(Fragment13, { children: [
|
|
9928
9919
|
/* @__PURE__ */ jsx31("span", { className: "rounded-full bg-[hsl(var(--accent))] px-2.5 py-1 text-[hsl(var(--foreground))]", children: summaryState.label }),
|
|
9929
9920
|
/* @__PURE__ */ jsx31("span", { className: "font-mono tracking-[0.25em] text-[hsl(var(--muted-foreground))]", children: summaryState.dots })
|
|
9930
9921
|
] }) : /* @__PURE__ */ jsx31(
|
|
@@ -9949,16 +9940,16 @@ function PlanSummaryCard({
|
|
|
9949
9940
|
}
|
|
9950
9941
|
)
|
|
9951
9942
|
] }),
|
|
9952
|
-
summaryState.kind === "complete" && /* @__PURE__ */
|
|
9953
|
-
/* @__PURE__ */
|
|
9943
|
+
summaryState.kind === "complete" && /* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
9944
|
+
/* @__PURE__ */ jsxs29("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
|
|
9954
9945
|
data.selectedSkills.length,
|
|
9955
9946
|
" \u4E2A\u6280\u80FD"
|
|
9956
9947
|
] }),
|
|
9957
|
-
/* @__PURE__ */
|
|
9948
|
+
/* @__PURE__ */ jsxs29("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
|
|
9958
9949
|
stepCount,
|
|
9959
9950
|
" \u4E2A\u6B65\u9AA4"
|
|
9960
9951
|
] }),
|
|
9961
|
-
!isHistorical && /* @__PURE__ */
|
|
9952
|
+
!isHistorical && /* @__PURE__ */ jsxs29("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--muted-foreground))]", children: [
|
|
9962
9953
|
/* @__PURE__ */ jsx31(CircleCheck, { size: 12 }),
|
|
9963
9954
|
"\u53F3\u4FA7\u67E5\u770B\u8BE6\u60C5"
|
|
9964
9955
|
] })
|
|
@@ -9981,9 +9972,9 @@ function PlanConfirmationPanel({
|
|
|
9981
9972
|
setRevisionText("");
|
|
9982
9973
|
setIsEditing(false);
|
|
9983
9974
|
};
|
|
9984
|
-
return /* @__PURE__ */
|
|
9985
|
-
/* @__PURE__ */
|
|
9986
|
-
/* @__PURE__ */
|
|
9975
|
+
return /* @__PURE__ */ jsxs29("div", { className: "space-y-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--background)/0.45)] p-3", children: [
|
|
9976
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap gap-2", children: [
|
|
9977
|
+
/* @__PURE__ */ jsxs29(
|
|
9987
9978
|
"button",
|
|
9988
9979
|
{
|
|
9989
9980
|
type: "button",
|
|
@@ -9995,7 +9986,7 @@ function PlanConfirmationPanel({
|
|
|
9995
9986
|
]
|
|
9996
9987
|
}
|
|
9997
9988
|
),
|
|
9998
|
-
/* @__PURE__ */
|
|
9989
|
+
/* @__PURE__ */ jsxs29(
|
|
9999
9990
|
"button",
|
|
10000
9991
|
{
|
|
10001
9992
|
type: "button",
|
|
@@ -10008,7 +9999,7 @@ function PlanConfirmationPanel({
|
|
|
10008
9999
|
}
|
|
10009
10000
|
)
|
|
10010
10001
|
] }),
|
|
10011
|
-
isEditing && /* @__PURE__ */
|
|
10002
|
+
isEditing && /* @__PURE__ */ jsxs29("div", { className: "space-y-2", children: [
|
|
10012
10003
|
/* @__PURE__ */ jsx31(
|
|
10013
10004
|
"textarea",
|
|
10014
10005
|
{
|
|
@@ -10139,7 +10130,7 @@ import { useEffect as useEffect21, useRef as useRef19 } from "react";
|
|
|
10139
10130
|
|
|
10140
10131
|
// src/chat/FinalArtifactCards.tsx
|
|
10141
10132
|
import { useEffect as useEffect20, useRef as useRef18, useState as useState24 } from "react";
|
|
10142
|
-
import { Fragment as Fragment14, jsx as jsx32, jsxs as
|
|
10133
|
+
import { Fragment as Fragment14, jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
10143
10134
|
function basename2(path) {
|
|
10144
10135
|
return path.split("/").filter(Boolean).pop() || path;
|
|
10145
10136
|
}
|
|
@@ -10160,7 +10151,7 @@ function LinkCard({
|
|
|
10160
10151
|
const bladeHost = useBladeHost();
|
|
10161
10152
|
const host = hostOf(url);
|
|
10162
10153
|
const local = isLoopbackUrl(url) && Boolean(bladeHost.openPreview);
|
|
10163
|
-
const content = /* @__PURE__ */
|
|
10154
|
+
const content = /* @__PURE__ */ jsxs30(Fragment14, { children: [
|
|
10164
10155
|
/* @__PURE__ */ jsx32("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-[hsl(var(--primary))]", children: /* @__PURE__ */ jsx32(Globe, { size: 15, "aria-hidden": "true" }) }),
|
|
10165
10156
|
/* @__PURE__ */ jsx32("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx32("span", { className: "block truncate text-xs font-medium leading-5", children: label || host }) }),
|
|
10166
10157
|
/* @__PURE__ */ jsx32(
|
|
@@ -10232,7 +10223,7 @@ function FinalArtifactCards({
|
|
|
10232
10223
|
const columnCount = Math.min(artifacts.length, 3);
|
|
10233
10224
|
const gridWidth = columnCount * 180 + Math.max(0, columnCount - 1) * 6;
|
|
10234
10225
|
if (artifacts.length === 0) return null;
|
|
10235
|
-
return /* @__PURE__ */
|
|
10226
|
+
return /* @__PURE__ */ jsxs30("div", { className: "flex max-w-full flex-col gap-1.5", children: [
|
|
10236
10227
|
/* @__PURE__ */ jsx32(
|
|
10237
10228
|
"div",
|
|
10238
10229
|
{
|
|
@@ -10268,7 +10259,7 @@ function FinalArtifactCards({
|
|
|
10268
10259
|
)
|
|
10269
10260
|
}
|
|
10270
10261
|
),
|
|
10271
|
-
hasMore ? /* @__PURE__ */
|
|
10262
|
+
hasMore ? /* @__PURE__ */ jsxs30(
|
|
10272
10263
|
"button",
|
|
10273
10264
|
{
|
|
10274
10265
|
type: "button",
|
|
@@ -10292,7 +10283,7 @@ function FinalArtifactCards({
|
|
|
10292
10283
|
}
|
|
10293
10284
|
|
|
10294
10285
|
// src/chat/PostChatFollowupBlock.tsx
|
|
10295
|
-
import { jsx as jsx33, jsxs as
|
|
10286
|
+
import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
10296
10287
|
function PostChatFollowupBlock({
|
|
10297
10288
|
sessionId,
|
|
10298
10289
|
followup,
|
|
@@ -10314,9 +10305,9 @@ function PostChatFollowupBlock({
|
|
|
10314
10305
|
}, [assistantEntryId, emit, sessionId, suggestionCount]);
|
|
10315
10306
|
if (!followup || !followup.recaption && followup.suggestions.length === 0 && artifacts.length === 0 && !followup.feedback_eligible)
|
|
10316
10307
|
return null;
|
|
10317
|
-
return /* @__PURE__ */
|
|
10318
|
-
followup.recaption ? /* @__PURE__ */
|
|
10319
|
-
/* @__PURE__ */
|
|
10308
|
+
return /* @__PURE__ */ jsxs31("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: [
|
|
10309
|
+
followup.recaption ? /* @__PURE__ */ jsxs31("section", { "aria-label": "\u672C\u8F6E\u5C0F\u7ED3", className: "flex flex-col gap-2", children: [
|
|
10310
|
+
/* @__PURE__ */ jsxs31("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-[hsl(var(--muted-foreground))]", children: [
|
|
10320
10311
|
/* @__PURE__ */ jsx33(Sparkles, { size: 14, "aria-hidden": "true" }),
|
|
10321
10312
|
"\u672C\u8F6E\u5C0F\u7ED3"
|
|
10322
10313
|
] }),
|
|
@@ -10338,9 +10329,9 @@ function PostChatFollowupBlock({
|
|
|
10338
10329
|
assistantEntryId
|
|
10339
10330
|
}
|
|
10340
10331
|
) }) : null,
|
|
10341
|
-
followup.suggestions.length > 0 ? /* @__PURE__ */
|
|
10332
|
+
followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs31("section", { className: "flex flex-col items-start gap-1.5", "aria-label": "\u4E0B\u4E00\u6B65\u5EFA\u8BAE", children: [
|
|
10342
10333
|
/* @__PURE__ */ jsx33("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
|
|
10343
|
-
/* @__PURE__ */ jsx33("div", { className: "grid w-fit max-w-full gap-1.5 sm:max-w-[680px]", children: followup.suggestions.map((suggestion, suggestionIndex) => /* @__PURE__ */
|
|
10334
|
+
/* @__PURE__ */ jsx33("div", { className: "grid w-fit max-w-full gap-1.5 sm:max-w-[680px]", children: followup.suggestions.map((suggestion, suggestionIndex) => /* @__PURE__ */ jsxs31(
|
|
10344
10335
|
"button",
|
|
10345
10336
|
{
|
|
10346
10337
|
type: "button",
|
|
@@ -10385,7 +10376,7 @@ function PostChatFollowupBlock({
|
|
|
10385
10376
|
|
|
10386
10377
|
// src/chat/RenderErrorBoundary.tsx
|
|
10387
10378
|
import { Component } from "react";
|
|
10388
|
-
import { jsx as jsx34, jsxs as
|
|
10379
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10389
10380
|
function getFirstComponentName(componentStack) {
|
|
10390
10381
|
const match = componentStack.match(/\n\s+at\s+([^\s(]+)/);
|
|
10391
10382
|
return match?.[1] ?? null;
|
|
@@ -10418,14 +10409,14 @@ var RenderErrorBoundary = class extends Component {
|
|
|
10418
10409
|
return children;
|
|
10419
10410
|
}
|
|
10420
10411
|
const componentName = getFirstComponentName(componentStack);
|
|
10421
|
-
return /* @__PURE__ */ jsx34("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__ */
|
|
10412
|
+
return /* @__PURE__ */ jsx34("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__ */ jsxs32("div", { className: "flex items-start gap-2", children: [
|
|
10422
10413
|
/* @__PURE__ */ jsx34(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-[hsl(var(--swf-warning))]" }),
|
|
10423
|
-
/* @__PURE__ */
|
|
10424
|
-
/* @__PURE__ */
|
|
10414
|
+
/* @__PURE__ */ jsxs32("div", { className: "min-w-0 flex-1", children: [
|
|
10415
|
+
/* @__PURE__ */ jsxs32("div", { className: "font-medium", children: [
|
|
10425
10416
|
label,
|
|
10426
10417
|
"\u6E32\u67D3\u5931\u8D25"
|
|
10427
10418
|
] }),
|
|
10428
|
-
/* @__PURE__ */
|
|
10419
|
+
/* @__PURE__ */ jsxs32("div", { className: "mt-1 break-words text-xs leading-5 text-[hsl(var(--secondary-foreground))]", children: [
|
|
10429
10420
|
componentName ? `\u7EC4\u4EF6\uFF1A${componentName}\u3002` : null,
|
|
10430
10421
|
error.message || "\u53D1\u751F\u4E86\u672A\u9884\u671F\u7684\u6E32\u67D3\u9519\u8BEF\u3002"
|
|
10431
10422
|
] }),
|
|
@@ -10437,7 +10428,7 @@ var RenderErrorBoundary = class extends Component {
|
|
|
10437
10428
|
|
|
10438
10429
|
// src/chat/TurnNavRail.tsx
|
|
10439
10430
|
import { useCallback as useCallback12, useEffect as useEffect22, useLayoutEffect as useLayoutEffect4, useRef as useRef20, useState as useState25 } from "react";
|
|
10440
|
-
import { jsx as jsx35, jsxs as
|
|
10431
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
10441
10432
|
var PANEL_MAX_HEIGHT = 448;
|
|
10442
10433
|
var PANEL_MARGIN = 16;
|
|
10443
10434
|
function clippingAncestor(element) {
|
|
@@ -10582,8 +10573,8 @@ function TurnNavRail({
|
|
|
10582
10573
|
setPanelOpen(false);
|
|
10583
10574
|
setHoveredTurnId(null);
|
|
10584
10575
|
},
|
|
10585
|
-
children: /* @__PURE__ */
|
|
10586
|
-
/* @__PURE__ */
|
|
10576
|
+
children: /* @__PURE__ */ jsxs33("div", { className: "flex flex-col items-end", children: [
|
|
10577
|
+
/* @__PURE__ */ jsxs33(
|
|
10587
10578
|
"div",
|
|
10588
10579
|
{
|
|
10589
10580
|
ref: markerRef,
|
|
@@ -10631,7 +10622,7 @@ function TurnNavRail({
|
|
|
10631
10622
|
]
|
|
10632
10623
|
}
|
|
10633
10624
|
),
|
|
10634
|
-
error ? /* @__PURE__ */
|
|
10625
|
+
error ? /* @__PURE__ */ jsxs33(
|
|
10635
10626
|
"div",
|
|
10636
10627
|
{
|
|
10637
10628
|
role: "alert",
|
|
@@ -10834,7 +10825,7 @@ function calculateAnimatedScrollTop({
|
|
|
10834
10825
|
}
|
|
10835
10826
|
|
|
10836
10827
|
// src/chat/MessageList.tsx
|
|
10837
|
-
import { Fragment as Fragment15, jsx as jsx36, jsxs as
|
|
10828
|
+
import { Fragment as Fragment15, jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10838
10829
|
function isReasoningRevealingForMessage(message, isRevealing, isStopping = false) {
|
|
10839
10830
|
if (isStopping) return false;
|
|
10840
10831
|
const hasContent = message?.content != null && message.content.length > 0;
|
|
@@ -11872,7 +11863,7 @@ function MessageListBody({
|
|
|
11872
11863
|
stablePrefixEnd,
|
|
11873
11864
|
virtualizer
|
|
11874
11865
|
]);
|
|
11875
|
-
return /* @__PURE__ */
|
|
11866
|
+
return /* @__PURE__ */ jsxs34(
|
|
11876
11867
|
"div",
|
|
11877
11868
|
{
|
|
11878
11869
|
ref: containerRef,
|
|
@@ -11891,7 +11882,7 @@ function MessageListBody({
|
|
|
11891
11882
|
failedTurnId: navFailedEntryId
|
|
11892
11883
|
}
|
|
11893
11884
|
) : null,
|
|
11894
|
-
/* @__PURE__ */
|
|
11885
|
+
/* @__PURE__ */ jsxs34(
|
|
11895
11886
|
StickToBottom,
|
|
11896
11887
|
{
|
|
11897
11888
|
contextRef: stickContextRef,
|
|
@@ -11900,7 +11891,7 @@ function MessageListBody({
|
|
|
11900
11891
|
resize: stickyTurn ? { damping: 0.8, stiffness: 0.08, mass: 1 } : "instant",
|
|
11901
11892
|
targetScrollTop: shouldAnchorEntry ? getAnchorTargetScrollTop : void 0,
|
|
11902
11893
|
children: [
|
|
11903
|
-
/* @__PURE__ */
|
|
11894
|
+
/* @__PURE__ */ jsxs34(
|
|
11904
11895
|
StickToBottom.Content,
|
|
11905
11896
|
{
|
|
11906
11897
|
part: "messages-scroll",
|
|
@@ -12013,37 +12004,41 @@ function MessageListContent({
|
|
|
12013
12004
|
};
|
|
12014
12005
|
const RenderBlockView = (block, globalBlockIndex) => {
|
|
12015
12006
|
if (block.type === "message") {
|
|
12016
|
-
|
|
12007
|
+
const sourceTitle = packEventTitle2(block.message);
|
|
12008
|
+
return /* @__PURE__ */ jsxs34(
|
|
12017
12009
|
"div",
|
|
12018
12010
|
{
|
|
12019
12011
|
id: block.anchorId ?? void 0,
|
|
12020
12012
|
"data-entry-id": block.message.entry_id,
|
|
12021
12013
|
className: "msg-animate scroll-mt-6",
|
|
12022
|
-
children:
|
|
12023
|
-
|
|
12024
|
-
{
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12014
|
+
children: [
|
|
12015
|
+
sourceTitle && /* @__PURE__ */ jsx36(PackEventNotice, { title: sourceTitle }),
|
|
12016
|
+
isBackgroundWakeMessage3(block.message) ? /* @__PURE__ */ jsx36(BackgroundWakeNotice, {}) : isUserMessage(block.message) ? customization?.components?.UserMessage ? /* @__PURE__ */ jsx36(
|
|
12017
|
+
customization.components.UserMessage,
|
|
12018
|
+
{
|
|
12019
|
+
message: block.message,
|
|
12020
|
+
className: customization.classNames?.userMessage
|
|
12021
|
+
}
|
|
12022
|
+
) : /* @__PURE__ */ jsx36(
|
|
12023
|
+
UserMessageBubble,
|
|
12024
|
+
{
|
|
12025
|
+
message: block.message,
|
|
12026
|
+
className: customization?.classNames?.userMessage
|
|
12027
|
+
}
|
|
12028
|
+
) : isErrorMessage(block.message) ? customization?.components?.ErrorMessage ? /* @__PURE__ */ jsx36(
|
|
12029
|
+
customization.components.ErrorMessage,
|
|
12030
|
+
{
|
|
12031
|
+
message: block.message,
|
|
12032
|
+
className: customization.classNames?.errorMessage
|
|
12033
|
+
}
|
|
12034
|
+
) : /* @__PURE__ */ jsx36(
|
|
12035
|
+
ErrorMessageBlock,
|
|
12036
|
+
{
|
|
12037
|
+
message: block.message,
|
|
12038
|
+
className: customization?.classNames?.errorMessage
|
|
12039
|
+
}
|
|
12040
|
+
) : null
|
|
12041
|
+
]
|
|
12047
12042
|
}
|
|
12048
12043
|
);
|
|
12049
12044
|
}
|
|
@@ -12060,7 +12055,7 @@ function MessageListContent({
|
|
|
12060
12055
|
const isHistoricalPlan = globalBlockIndex !== latestPlanCardBlockIndex;
|
|
12061
12056
|
const blockFeedback = displayMessages.map((message) => message.entry_id && resultFeedbackByEntry.get(message.entry_id)).find((feedback) => feedback != null);
|
|
12062
12057
|
const isActiveFollowup = block.anchorId === followupTurnId;
|
|
12063
|
-
return /* @__PURE__ */
|
|
12058
|
+
return /* @__PURE__ */ jsxs34(
|
|
12064
12059
|
"div",
|
|
12065
12060
|
{
|
|
12066
12061
|
ref: getTurnElementRef(block.anchorId),
|
|
@@ -12152,7 +12147,7 @@ function MessageListContent({
|
|
|
12152
12147
|
const renderMeasuredRow = (block, globalBlockIndex, virtualItem) => {
|
|
12153
12148
|
const persistentId = getRenderBlockPersistentId(block);
|
|
12154
12149
|
const isVirtual = virtualItem !== void 0;
|
|
12155
|
-
return /* @__PURE__ */
|
|
12150
|
+
return /* @__PURE__ */ jsxs34(
|
|
12156
12151
|
"div",
|
|
12157
12152
|
{
|
|
12158
12153
|
ref: getMeasuredRowRef(block, globalBlockIndex, isVirtual),
|
|
@@ -12183,8 +12178,8 @@ function MessageListContent({
|
|
|
12183
12178
|
{
|
|
12184
12179
|
part: "messages-content",
|
|
12185
12180
|
className: `blade-chat-messages-content mx-auto max-w-[748px] ${customization?.classNames?.messageListContent ?? ""}`,
|
|
12186
|
-
children: /* @__PURE__ */
|
|
12187
|
-
renderBlocks.length === 0 && isLoadingHistory ? /* @__PURE__ */ jsx36(HistoryLoadingPlaceholder, {}) : renderBlocks.length === 0 ? emptyState ? emptyState : customization?.components?.EmptyState ? /* @__PURE__ */ jsx36(customization.components.EmptyState, {}) : /* @__PURE__ */
|
|
12181
|
+
children: /* @__PURE__ */ jsxs34("div", { className: `min-w-0 flex flex-col gap-9 ${customization?.classNames?.messageListInner ?? ""}`, children: [
|
|
12182
|
+
renderBlocks.length === 0 && isLoadingHistory ? /* @__PURE__ */ jsx36(HistoryLoadingPlaceholder, {}) : renderBlocks.length === 0 ? emptyState ? emptyState : customization?.components?.EmptyState ? /* @__PURE__ */ jsx36(customization.components.EmptyState, {}) : /* @__PURE__ */ jsxs34(
|
|
12188
12183
|
"div",
|
|
12189
12184
|
{
|
|
12190
12185
|
part: "empty",
|
|
@@ -12195,7 +12190,7 @@ function MessageListContent({
|
|
|
12195
12190
|
/* @__PURE__ */ jsx36("span", { className: "text-sm opacity-60", children: "\u5728\u4E0B\u65B9\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u804A\u5929" })
|
|
12196
12191
|
]
|
|
12197
12192
|
}
|
|
12198
|
-
) : /* @__PURE__ */
|
|
12193
|
+
) : /* @__PURE__ */ jsxs34(Fragment15, { children: [
|
|
12199
12194
|
stablePrefixEnd > 0 ? /* @__PURE__ */ jsx36(
|
|
12200
12195
|
"div",
|
|
12201
12196
|
{
|
|
@@ -12219,14 +12214,14 @@ function MessageListContent({
|
|
|
12219
12214
|
);
|
|
12220
12215
|
}
|
|
12221
12216
|
function HistoryLoadingPlaceholder() {
|
|
12222
|
-
return /* @__PURE__ */
|
|
12223
|
-
/* @__PURE__ */
|
|
12217
|
+
return /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-9", "aria-busy": "true", "aria-live": "polite", children: [
|
|
12218
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-center gap-2 text-sm text-[hsl(var(--muted-foreground))]", children: [
|
|
12224
12219
|
/* @__PURE__ */ jsx36("span", { className: "size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
12225
12220
|
/* @__PURE__ */ jsx36("span", { children: "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD\u8BB0\u5F55\u2026" })
|
|
12226
12221
|
] }),
|
|
12227
|
-
[0, 1].map((index) => /* @__PURE__ */
|
|
12222
|
+
[0, 1].map((index) => /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-4", children: [
|
|
12228
12223
|
/* @__PURE__ */ jsx36("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx36("div", { className: "h-10 w-2/5 animate-pulse rounded-2xl bg-[hsl(var(--muted))]" }) }),
|
|
12229
|
-
/* @__PURE__ */
|
|
12224
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-2.5", children: [
|
|
12230
12225
|
/* @__PURE__ */ jsx36("div", { className: "h-4 w-1/3 animate-pulse rounded bg-[hsl(var(--muted))]" }),
|
|
12231
12226
|
/* @__PURE__ */ jsx36("div", { className: "h-4 w-4/5 animate-pulse rounded bg-[hsl(var(--muted))]" }),
|
|
12232
12227
|
/* @__PURE__ */ jsx36("div", { className: "h-4 w-3/5 animate-pulse rounded bg-[hsl(var(--muted))]" })
|
|
@@ -12237,7 +12232,7 @@ function HistoryLoadingPlaceholder() {
|
|
|
12237
12232
|
function ScrollToBottomButton({ onBeforeScroll }) {
|
|
12238
12233
|
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
12239
12234
|
if (isAtBottom) return null;
|
|
12240
|
-
return /* @__PURE__ */
|
|
12235
|
+
return /* @__PURE__ */ jsxs34(
|
|
12241
12236
|
"button",
|
|
12242
12237
|
{
|
|
12243
12238
|
type: "button",
|
|
@@ -12257,9 +12252,9 @@ function ScrollToBottomButton({ onBeforeScroll }) {
|
|
|
12257
12252
|
}
|
|
12258
12253
|
function PlanningDivider({ kind }) {
|
|
12259
12254
|
const isEnter = kind === "enter";
|
|
12260
|
-
return /* @__PURE__ */
|
|
12255
|
+
return /* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-3 py-1", children: [
|
|
12261
12256
|
/* @__PURE__ */ jsx36("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" }),
|
|
12262
|
-
/* @__PURE__ */
|
|
12257
|
+
/* @__PURE__ */ jsxs34("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: [
|
|
12263
12258
|
/* @__PURE__ */ jsx36(Lightbulb, { size: 12 }),
|
|
12264
12259
|
/* @__PURE__ */ jsx36("span", { children: isEnter ? "\u8FDB\u5165\u89C4\u5212\u6A21\u5F0F" : "\u89C4\u5212\u5B8C\u6210" })
|
|
12265
12260
|
] }),
|
|
@@ -12432,7 +12427,7 @@ function SessionReplayBar({
|
|
|
12432
12427
|
}
|
|
12433
12428
|
|
|
12434
12429
|
// src/chat/ChatPanel.tsx
|
|
12435
|
-
import { Fragment as Fragment16, jsx as jsx38, jsxs as
|
|
12430
|
+
import { Fragment as Fragment16, jsx as jsx38, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
12436
12431
|
function nextQueuedOrder(items, itemId, delta) {
|
|
12437
12432
|
const pending = items.filter((item) => item.status === "pending");
|
|
12438
12433
|
const index = pending.findIndex((item) => item.id === itemId);
|
|
@@ -12680,14 +12675,14 @@ function ChatPanel({
|
|
|
12680
12675
|
initialDraftKey,
|
|
12681
12676
|
lite
|
|
12682
12677
|
};
|
|
12683
|
-
return /* @__PURE__ */ jsx38(ChatEnvironmentProvider, { value: scopedEnvironment, children: /* @__PURE__ */ jsx38(CurrentChatSessionProvider, { sessionId: sessionId || null, children: /* @__PURE__ */ jsx38(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsx38(FollowupInteractionProvider, { value: onFollowupInteraction, children: /* @__PURE__ */ jsx38(McpAppMessageContext.Provider, { value: handleMcpAppMessage, children: /* @__PURE__ */
|
|
12678
|
+
return /* @__PURE__ */ jsx38(ChatEnvironmentProvider, { value: scopedEnvironment, children: /* @__PURE__ */ jsx38(CurrentChatSessionProvider, { sessionId: sessionId || null, children: /* @__PURE__ */ jsx38(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsx38(FollowupInteractionProvider, { value: onFollowupInteraction, children: /* @__PURE__ */ jsx38(McpAppMessageContext.Provider, { value: handleMcpAppMessage, children: /* @__PURE__ */ jsxs35(
|
|
12684
12679
|
"div",
|
|
12685
12680
|
{
|
|
12686
12681
|
"data-theme": theme,
|
|
12687
12682
|
part: "root",
|
|
12688
12683
|
className: cn("blade-chat flex min-h-0 flex-1 flex-col overflow-hidden", classNames?.root),
|
|
12689
12684
|
children: [
|
|
12690
|
-
isViewer && /* @__PURE__ */
|
|
12685
|
+
isViewer && /* @__PURE__ */ jsxs35(
|
|
12691
12686
|
"div",
|
|
12692
12687
|
{
|
|
12693
12688
|
className: cn(
|
|
@@ -12703,7 +12698,7 @@ function ChatPanel({
|
|
|
12703
12698
|
!isViewer && /* @__PURE__ */ jsx38(ConnectionBanner, { connection }),
|
|
12704
12699
|
banner,
|
|
12705
12700
|
/* @__PURE__ */ jsx38(SessionReplayBar, { sessionId, onExit: onExitReplay }),
|
|
12706
|
-
errorMessage && /* @__PURE__ */
|
|
12701
|
+
errorMessage && /* @__PURE__ */ jsxs35(
|
|
12707
12702
|
"div",
|
|
12708
12703
|
{
|
|
12709
12704
|
part: "error-bar",
|
|
@@ -12786,7 +12781,7 @@ function ChatPanel({
|
|
|
12786
12781
|
className: cn("mx-auto w-full max-w-3xl px-5 pb-3", classNames?.chatInputInner)
|
|
12787
12782
|
}
|
|
12788
12783
|
) : null,
|
|
12789
|
-
!isViewer && /* @__PURE__ */
|
|
12784
|
+
!isViewer && /* @__PURE__ */ jsxs35(Fragment16, { children: [
|
|
12790
12785
|
/* @__PURE__ */ jsx38(
|
|
12791
12786
|
SessionQueuePanel,
|
|
12792
12787
|
{
|
|
@@ -12818,13 +12813,13 @@ function ChatPanel({
|
|
|
12818
12813
|
|
|
12819
12814
|
// src/components/SessionPluginSelector.tsx
|
|
12820
12815
|
import { useEffect as useEffect27, useState as useState30 } from "react";
|
|
12821
|
-
import { jsx as jsx39, jsxs as
|
|
12816
|
+
import { jsx as jsx39, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
12822
12817
|
function SessionPluginSelector(props) {
|
|
12823
12818
|
return /* @__PURE__ */ jsx39(PluginSelectorState, { ...props }, props.sessionId);
|
|
12824
12819
|
}
|
|
12825
12820
|
function PluginSelectorState({ client, sessionId, className, side = "bottom", onChange }) {
|
|
12826
12821
|
const [open, setOpen] = useState30(false);
|
|
12827
|
-
return /* @__PURE__ */
|
|
12822
|
+
return /* @__PURE__ */ jsxs36("div", { className: `relative text-xs ${className ?? ""}`, children: [
|
|
12828
12823
|
/* @__PURE__ */ jsx39(
|
|
12829
12824
|
"button",
|
|
12830
12825
|
{
|
|
@@ -12850,7 +12845,7 @@ function PluginSelectorList({
|
|
|
12850
12845
|
useEffect27(() => {
|
|
12851
12846
|
reload();
|
|
12852
12847
|
}, [reload]);
|
|
12853
|
-
return /* @__PURE__ */
|
|
12848
|
+
return /* @__PURE__ */ jsxs36(
|
|
12854
12849
|
"div",
|
|
12855
12850
|
{
|
|
12856
12851
|
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"}`,
|
|
@@ -12880,7 +12875,7 @@ function PluginSelectorList({
|
|
|
12880
12875
|
}
|
|
12881
12876
|
|
|
12882
12877
|
// src/components/AgentChat.tsx
|
|
12883
|
-
import { Fragment as Fragment17, jsx as jsx40, jsxs as
|
|
12878
|
+
import { Fragment as Fragment17, jsx as jsx40, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12884
12879
|
function isUnauthorizedError(error) {
|
|
12885
12880
|
return error instanceof BladeApiError && error.status === 401;
|
|
12886
12881
|
}
|
|
@@ -12899,7 +12894,7 @@ function LoginCard({ client, onLoggedIn }) {
|
|
|
12899
12894
|
setLoggingIn(false);
|
|
12900
12895
|
}
|
|
12901
12896
|
};
|
|
12902
|
-
return /* @__PURE__ */ jsx40("div", { className: "blade-chat-login flex flex-1 items-center justify-center p-6", children: /* @__PURE__ */
|
|
12897
|
+
return /* @__PURE__ */ jsx40("div", { className: "blade-chat-login flex flex-1 items-center justify-center p-6", children: /* @__PURE__ */ jsxs37("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: [
|
|
12903
12898
|
/* @__PURE__ */ jsx40(LockKeyhole, { size: 28, className: "text-[hsl(var(--muted-foreground))]" }),
|
|
12904
12899
|
/* @__PURE__ */ jsx40("div", { className: "text-base font-medium text-[hsl(var(--foreground))]", children: "\u9700\u8981\u767B\u5F55\u540E\u4F7F\u7528" }),
|
|
12905
12900
|
/* @__PURE__ */ jsx40("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" }),
|
|
@@ -13023,7 +13018,7 @@ function ChatSessionView({
|
|
|
13023
13018
|
onFollowupInteraction,
|
|
13024
13019
|
errorMessage: connectError ?? replay.error?.message ?? notice,
|
|
13025
13020
|
onExitReplay: () => void replay.exitToAutonomous(),
|
|
13026
|
-
banner: /* @__PURE__ */
|
|
13021
|
+
banner: /* @__PURE__ */ jsxs37(Fragment17, { children: [
|
|
13027
13022
|
resolvedSessionId && !isViewer && (sessionPluginControls ? sessionPluginControls(resolvedSessionId) : client.options.anonymousSessionId || createOptions?.anonymous ? null : /* @__PURE__ */ jsx40(SessionPluginSelector, { client, sessionId: resolvedSessionId })),
|
|
13028
13023
|
/* @__PURE__ */ jsx40(ReplayMismatchPrompt, { mismatch: replay.mismatch })
|
|
13029
13024
|
] })
|
|
@@ -13393,7 +13388,7 @@ function toToolCallInfo(call, results, failedToolIds) {
|
|
|
13393
13388
|
|
|
13394
13389
|
// src/components/LlmAdvancedSettings.tsx
|
|
13395
13390
|
import { useState as useState33 } from "react";
|
|
13396
|
-
import { jsx as jsx41, jsxs as
|
|
13391
|
+
import { jsx as jsx41, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
13397
13392
|
var FIELDS = [
|
|
13398
13393
|
{ id: "baseURL", label: "\u6A21\u578B\u670D\u52A1\u5730\u5740", placeholder: "http://\u5185\u7F51\u5730\u5740/v1" },
|
|
13399
13394
|
{ id: "model", label: "\u6A21\u578B", placeholder: "\u6A21\u578B\u540D\u79F0" },
|
|
@@ -13444,8 +13439,8 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
13444
13439
|
if (!normalized) return null;
|
|
13445
13440
|
const fields = FIELDS.filter((field) => normalized[field.id]);
|
|
13446
13441
|
const dirty = Object.keys(override).length > 0;
|
|
13447
|
-
return /* @__PURE__ */
|
|
13448
|
-
/* @__PURE__ */
|
|
13442
|
+
return /* @__PURE__ */ jsxs38("div", { className: "blade-chat-advanced border-t border-[hsl(var(--border))] px-4 py-2 text-xs", children: [
|
|
13443
|
+
/* @__PURE__ */ jsxs38(
|
|
13449
13444
|
"button",
|
|
13450
13445
|
{
|
|
13451
13446
|
type: "button",
|
|
@@ -13461,8 +13456,8 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
13461
13456
|
]
|
|
13462
13457
|
}
|
|
13463
13458
|
),
|
|
13464
|
-
open && /* @__PURE__ */
|
|
13465
|
-
fields.map((field) => /* @__PURE__ */
|
|
13459
|
+
open && /* @__PURE__ */ jsxs38("div", { className: "mt-2 flex flex-col gap-2", children: [
|
|
13460
|
+
fields.map((field) => /* @__PURE__ */ jsxs38("label", { className: "flex flex-col gap-1", children: [
|
|
13466
13461
|
/* @__PURE__ */ jsx41("span", { className: "text-[hsl(var(--muted-foreground))]", children: field.label }),
|
|
13467
13462
|
/* @__PURE__ */ jsx41(
|
|
13468
13463
|
"input",
|
|
@@ -13476,7 +13471,7 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
13476
13471
|
)
|
|
13477
13472
|
] }, field.id)),
|
|
13478
13473
|
normalized.apiKey && /* @__PURE__ */ jsx41("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" }),
|
|
13479
|
-
/* @__PURE__ */
|
|
13474
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex gap-2", children: [
|
|
13480
13475
|
/* @__PURE__ */ jsx41(
|
|
13481
13476
|
"button",
|
|
13482
13477
|
{
|
|
@@ -13511,7 +13506,7 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
|
|
|
13511
13506
|
}
|
|
13512
13507
|
|
|
13513
13508
|
// src/components/LlmChat.tsx
|
|
13514
|
-
import { jsx as jsx42, jsxs as
|
|
13509
|
+
import { jsx as jsx42, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
13515
13510
|
function LlmChat({
|
|
13516
13511
|
classNames,
|
|
13517
13512
|
renderers,
|
|
@@ -13543,14 +13538,14 @@ ${text}` : text),
|
|
|
13543
13538
|
onReady?.(handle);
|
|
13544
13539
|
}, [handle, onReady]);
|
|
13545
13540
|
const customization = useMemo19(() => ({ classNames, renderers }), [classNames, renderers]);
|
|
13546
|
-
return /* @__PURE__ */ jsx42(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */
|
|
13541
|
+
return /* @__PURE__ */ jsx42(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsxs39(
|
|
13547
13542
|
"div",
|
|
13548
13543
|
{
|
|
13549
13544
|
"data-theme": theme,
|
|
13550
13545
|
part: "root",
|
|
13551
13546
|
className: cn("blade-chat flex min-h-0 flex-1 flex-col overflow-hidden", classNames?.root),
|
|
13552
13547
|
children: [
|
|
13553
|
-
error ? /* @__PURE__ */
|
|
13548
|
+
error ? /* @__PURE__ */ jsxs39(
|
|
13554
13549
|
"div",
|
|
13555
13550
|
{
|
|
13556
13551
|
part: "error-bar",
|
|
@@ -13641,7 +13636,7 @@ function ChatView(props) {
|
|
|
13641
13636
|
|
|
13642
13637
|
// src/components/TopicAssetSubmitDialog.tsx
|
|
13643
13638
|
import { useRef as useRef25, useState as useState35 } from "react";
|
|
13644
|
-
import { jsx as jsx44, jsxs as
|
|
13639
|
+
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13645
13640
|
function useTopicAssetSubmissionAccess(sessionId) {
|
|
13646
13641
|
const client = useBladeClient();
|
|
13647
13642
|
return useAsyncValue(sessionId, async (signal) => {
|
|
@@ -13699,32 +13694,32 @@ function TopicAssetSubmitDialog({ sessionId, topicId, path, onClose, onSubmitted
|
|
|
13699
13694
|
};
|
|
13700
13695
|
return /* @__PURE__ */ jsx44(Dialog, { open: true, onOpenChange: (open) => {
|
|
13701
13696
|
if (!open && !busy) onClose();
|
|
13702
|
-
}, children: /* @__PURE__ */
|
|
13697
|
+
}, children: /* @__PURE__ */ jsxs40(DialogContent, { className: "max-w-md", children: [
|
|
13703
13698
|
/* @__PURE__ */ jsx44(DialogTitle, { children: "\u63D0\u4EA4\u5230\u8D44\u4EA7" }),
|
|
13704
13699
|
/* @__PURE__ */ jsx44(DialogDescription, { children: "\u5C06\u6587\u4EF6\u590D\u5236\u5230\u5DE5\u4F5C\u7A7A\u95F4\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" }),
|
|
13705
|
-
/* @__PURE__ */
|
|
13700
|
+
/* @__PURE__ */ jsxs40("form", { onSubmit: (event) => {
|
|
13706
13701
|
event.preventDefault();
|
|
13707
13702
|
void submit();
|
|
13708
13703
|
}, className: "flex flex-col gap-4", children: [
|
|
13709
13704
|
/* @__PURE__ */ jsx44("p", { className: "break-all text-sm text-secondary-foreground", children: path }),
|
|
13710
|
-
/* @__PURE__ */
|
|
13705
|
+
/* @__PURE__ */ jsxs40("label", { className: "flex flex-col gap-1 text-sm", children: [
|
|
13711
13706
|
"\u76EE\u6807\u6587\u4EF6\u5939",
|
|
13712
|
-
/* @__PURE__ */
|
|
13707
|
+
/* @__PURE__ */ jsxs40("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: [
|
|
13713
13708
|
/* @__PURE__ */ jsx44("option", { value: "", children: "\u8D44\u4EA7\u6839\u76EE\u5F55" }),
|
|
13714
13709
|
assets.data?.map((item) => /* @__PURE__ */ jsx44("option", { value: item, children: item }, item))
|
|
13715
13710
|
] })
|
|
13716
13711
|
] }),
|
|
13717
|
-
/* @__PURE__ */
|
|
13712
|
+
/* @__PURE__ */ jsxs40("label", { className: "flex flex-col gap-1 text-sm", children: [
|
|
13718
13713
|
"\u8BF4\u660E\uFF08\u53EF\u9009\uFF09",
|
|
13719
13714
|
/* @__PURE__ */ jsx44("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" })
|
|
13720
13715
|
] }),
|
|
13721
|
-
assets.error ? /* @__PURE__ */
|
|
13716
|
+
assets.error ? /* @__PURE__ */ jsxs40("div", { role: "alert", className: "text-sm text-muted-foreground", children: [
|
|
13722
13717
|
assets.error instanceof Error ? assets.error.message : "\u8D44\u4EA7\u52A0\u8F7D\u5931\u8D25",
|
|
13723
13718
|
" ",
|
|
13724
13719
|
/* @__PURE__ */ jsx44("button", { type: "button", onClick: () => setRevision((n) => n + 1), className: "underline", children: "\u91CD\u8BD5" })
|
|
13725
13720
|
] }) : !assets.data ? /* @__PURE__ */ jsx44("output", { className: "text-sm text-muted-foreground", children: "\u6B63\u5728\u52A0\u8F7D\u8D44\u4EA7\u2026" }) : null,
|
|
13726
13721
|
error ? /* @__PURE__ */ jsx44("p", { role: "alert", className: "text-sm text-muted-foreground", children: error }) : null,
|
|
13727
|
-
/* @__PURE__ */
|
|
13722
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex justify-end gap-2", children: [
|
|
13728
13723
|
/* @__PURE__ */ jsx44("button", { type: "button", disabled: busy, onClick: onClose, className: "rounded-md border border-border px-3 py-2 text-sm", children: "\u53D6\u6D88" }),
|
|
13729
13724
|
/* @__PURE__ */ jsx44("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" })
|
|
13730
13725
|
] })
|
|
@@ -13772,4 +13767,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
|
|
|
13772
13767
|
js-yaml/dist/js-yaml.mjs:
|
|
13773
13768
|
(*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
|
|
13774
13769
|
*/
|
|
13775
|
-
//# sourceMappingURL=chunk-
|
|
13770
|
+
//# sourceMappingURL=chunk-66JXSDLB.js.map
|