@blade-hq/agent-react 2610.0.0-beta.79 → 2610.0.0-beta.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3095,6 +3095,13 @@ var CircleDot = createLucideIcon("CircleDot", [
3095
3095
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
3096
3096
  ]);
3097
3097
 
3098
+ // ../../node_modules/.pnpm/lucide-react@0.468.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/circle-help.js
3099
+ var CircleHelp = createLucideIcon("CircleHelp", [
3100
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
3101
+ ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
3102
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
3103
+ ]);
3104
+
3098
3105
  // ../../node_modules/.pnpm/lucide-react@0.468.0_react@19.2.4/node_modules/lucide-react/dist/esm/icons/circle-pause.js
3099
3106
  var CirclePause = createLucideIcon("CirclePause", [
3100
3107
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
@@ -3391,7 +3398,7 @@ var X = createLucideIcon("X", [
3391
3398
  ]);
3392
3399
 
3393
3400
  // src/components/AgentChat.tsx
3394
- import { useCallback as useCallback30, useEffect as useEffect23, useMemo as useMemo18, useRef as useRef27, useState as useState34 } from "react";
3401
+ import { useCallback as useCallback30, useEffect as useEffect24, useMemo as useMemo18, useRef as useRef27, useState as useState34 } from "react";
3395
3402
 
3396
3403
  // src/components/SessionPluginSelector.tsx
3397
3404
  import { useEffect as useEffect14, useState as useState19 } from "react";
@@ -46388,7 +46395,7 @@ function ConnectionBanner({ connection, className }) {
46388
46395
  import { isHiddenInternalMessage as isHiddenInternalMessage2 } from "@blade-hq/agent-client";
46389
46396
  import {
46390
46397
  useCallback as useCallback29,
46391
- useEffect as useEffect22,
46398
+ useEffect as useEffect23,
46392
46399
  useMemo as useMemo16,
46393
46400
  useRef as useRef26,
46394
46401
  useState as useState32
@@ -46826,11 +46833,61 @@ import {
46826
46833
  getTextContent as getTextContent2,
46827
46834
  normalizeMessageContent as normalizeMessageContent2
46828
46835
  } from "@blade-hq/agent-client";
46829
- import { useEffect as useEffect20, useRef as useRef24, useState as useState30 } from "react";
46836
+ import { useEffect as useEffect21, useRef as useRef24, useState as useState30 } from "react";
46830
46837
 
46831
- // src/components/AgentLoopBlock.tsx
46832
- import { useState as useState26 } from "react";
46838
+ // src/components/AgentTaskCard.tsx
46839
+ import { useEffect as useEffect19, useState as useState26 } from "react";
46833
46840
  import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
46841
+ var STATUS_LABELS = {
46842
+ running: "\u8FDB\u884C\u4E2D",
46843
+ waiting_input: "\u7B49\u5F85\u56DE\u7B54",
46844
+ completed: "\u5DF2\u5B8C\u6210",
46845
+ failed: "\u6267\u884C\u5931\u8D25",
46846
+ cancelled: "\u5DF2\u505C\u6B62"
46847
+ };
46848
+ function AgentTaskCard({ title, status, activity, children, className, recordId }) {
46849
+ const waiting = status === "waiting_input";
46850
+ const [open2, setOpen] = useState26(waiting);
46851
+ useEffect19(() => {
46852
+ if (waiting) setOpen(true);
46853
+ }, [waiting]);
46854
+ return /* @__PURE__ */ jsxs13(
46855
+ "details",
46856
+ {
46857
+ part: "agent-loop",
46858
+ "data-agent-card": status,
46859
+ "data-list-record-id": recordId,
46860
+ open: open2,
46861
+ onToggle: (event) => setOpen(event.currentTarget.open),
46862
+ className: cn(
46863
+ "blade-chat-agent-loop my-2 min-w-0 rounded-xl border border-l-[3px] bg-[hsl(var(--card))] scroll-mt-4",
46864
+ waiting ? "border-amber-500/50 bg-amber-500/5" : status === "failed" ? "border-red-500/40" : "border-[hsl(var(--border))] border-l-[hsl(var(--primary))]/50",
46865
+ className
46866
+ ),
46867
+ children: [
46868
+ /* @__PURE__ */ jsxs13("summary", { className: "flex cursor-pointer list-none items-start gap-2.5 rounded-xl px-3 py-3 text-left outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] [&::-webkit-details-marker]:hidden", children: [
46869
+ waiting ? /* @__PURE__ */ jsx15(CircleHelp, { size: 18, "aria-hidden": "true", className: "mt-0.5 shrink-0 text-amber-600 motion-safe:animate-pulse" }) : /* @__PURE__ */ jsx15(Bot, { size: 18, "aria-hidden": "true", className: "mt-0.5 shrink-0 text-[hsl(var(--primary))]" }),
46870
+ /* @__PURE__ */ jsxs13("span", { className: "min-w-0 flex-1", children: [
46871
+ /* @__PURE__ */ jsxs13("span", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
46872
+ /* @__PURE__ */ jsx15("span", { children: "\u5B50\u667A\u80FD\u4F53" }),
46873
+ /* @__PURE__ */ jsxs13("span", { className: cn("inline-flex items-center gap-1", waiting && "font-semibold text-amber-600"), children: [
46874
+ status === "running" ? /* @__PURE__ */ jsx15(LoaderCircle, { size: 12, "aria-hidden": "true", className: "motion-safe:animate-spin" }) : null,
46875
+ STATUS_LABELS[status]
46876
+ ] })
46877
+ ] }),
46878
+ /* @__PURE__ */ jsx15("span", { className: "mt-1 block break-words text-sm font-medium text-[hsl(var(--foreground))]", children: title }),
46879
+ activity ? /* @__PURE__ */ jsx15("span", { className: "mt-1 block truncate text-xs text-[hsl(var(--muted-foreground))]", title: activity, children: activity }) : null
46880
+ ] }),
46881
+ /* @__PURE__ */ jsx15(ChevronRight, { size: 15, "aria-hidden": "true", className: cn("mt-1 shrink-0 text-[hsl(var(--muted-foreground))] transition-transform motion-reduce:transition-none", open2 && "rotate-90") })
46882
+ ] }),
46883
+ /* @__PURE__ */ jsx15("div", { className: "min-w-0 border-t border-[hsl(var(--border))] px-3 py-2", children })
46884
+ ]
46885
+ }
46886
+ );
46887
+ }
46888
+
46889
+ // src/components/AgentLoopBlock.tsx
46890
+ import { jsx as jsx16 } from "react/jsx-runtime";
46834
46891
  function parseAgentDescription(argumentsJson) {
46835
46892
  try {
46836
46893
  const parsed = JSON.parse(argumentsJson);
@@ -46840,53 +46897,8 @@ function parseAgentDescription(argumentsJson) {
46840
46897
  }
46841
46898
  }
46842
46899
  function AgentLoopBlock({ toolCall, className }) {
46843
- const [expanded, setExpanded] = useState26(false);
46844
- const description = parseAgentDescription(toolCall.arguments);
46845
- const running = toolCall.status === "pending" || toolCall.status === "awaiting_answer";
46846
- const failed = toolCall.status === "error" || toolCall.status === "cancelled";
46847
- const hasResult = toolCall.result != null;
46848
- const iconClass = cn(
46849
- "size-3.5 shrink-0",
46850
- failed ? "text-red-500" : "text-[hsl(var(--muted-foreground))]"
46851
- );
46852
- return /* @__PURE__ */ jsxs13("div", { part: "agent-loop", className: cn("blade-chat-agent-loop ml-4 text-xs leading-[22px]", className), children: [
46853
- /* @__PURE__ */ jsxs13(
46854
- "button",
46855
- {
46856
- type: "button",
46857
- onClick: () => hasResult && setExpanded(!expanded),
46858
- disabled: !hasResult,
46859
- "aria-expanded": hasResult ? expanded : void 0,
46860
- "data-testid": "execution-tool-intent",
46861
- className: cn(
46862
- "flex min-w-0 items-center gap-1 py-1.5 text-left",
46863
- hasResult && "cursor-pointer hover:text-[hsl(var(--foreground))]",
46864
- failed ? "text-red-500" : "text-[hsl(var(--muted-foreground))]"
46865
- ),
46866
- title: `\u5B50\u4EFB\u52A1\uFF1A${description}`,
46867
- children: [
46868
- running ? /* @__PURE__ */ jsx15(LoaderCircle, { className: cn(iconClass, "animate-spin"), "aria-hidden": "true" }) : toolCall.status === "error" ? /* @__PURE__ */ jsx15(CircleAlert, { className: iconClass, "aria-hidden": "true" }) : toolCall.status === "cancelled" ? /* @__PURE__ */ jsx15(X, { className: iconClass, "aria-hidden": "true" }) : /* @__PURE__ */ jsx15(Bot, { className: iconClass, "aria-hidden": "true" }),
46869
- /* @__PURE__ */ jsxs13("span", { className: "min-w-0 truncate", children: [
46870
- "\u5B50\u4EFB\u52A1\uFF1A",
46871
- description
46872
- ] }),
46873
- hasResult ? /* @__PURE__ */ jsx15(
46874
- ChevronRight,
46875
- {
46876
- size: 14,
46877
- style: { transitionDuration: "260ms", transitionTimingFunction: "cubic-bezier(0.25, 0.1, 0.25, 1)" },
46878
- className: cn(
46879
- "shrink-0 transition-transform",
46880
- expanded && "rotate-90"
46881
- ),
46882
- "aria-hidden": "true"
46883
- }
46884
- ) : null
46885
- ]
46886
- }
46887
- ),
46888
- expanded && hasResult ? /* @__PURE__ */ jsx15("div", { className: "ml-[18px] mt-1.5 max-h-[400px] overflow-auto whitespace-pre-wrap text-xs leading-[22px] text-[hsl(var(--muted-foreground))]", children: formatToolResult(toolCall.result) }) : null
46889
- ] });
46900
+ const status = toolCall.status === "awaiting_answer" ? "waiting_input" : toolCall.status === "pending" ? "running" : toolCall.status === "error" ? "failed" : toolCall.status === "cancelled" ? "cancelled" : "completed";
46901
+ return /* @__PURE__ */ jsx16(AgentTaskCard, { title: parseAgentDescription(toolCall.arguments), status, className, children: toolCall.result != null ? /* @__PURE__ */ jsx16("div", { className: "max-h-[400px] overflow-auto whitespace-pre-wrap break-words text-xs text-[hsl(var(--muted-foreground))]", children: formatToolResult(toolCall.result) }) : /* @__PURE__ */ jsx16("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: status === "waiting_input" ? "\u8BF7\u56DE\u7B54\u5BF9\u8BDD\u4E2D\u7684\u95EE\u9898\uFF0C\u5B50\u667A\u80FD\u4F53\u4F1A\u7EE7\u7EED\u5904\u7406\u3002" : status === "running" ? "\u5B50\u667A\u80FD\u4F53\u6B63\u5728\u5904\u7406\u4EFB\u52A1\u3002" : "\u6682\u65E0\u6267\u884C\u7ED3\u679C\u3002" }) });
46890
46902
  }
46891
46903
 
46892
46904
  // src/components/MarkdownContent.tsx
@@ -55823,7 +55835,7 @@ function MarkdownRenderer({
55823
55835
  }
55824
55836
 
55825
55837
  // src/components/MarkdownContent.tsx
55826
- import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
55838
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
55827
55839
  var SYSTEM_REMINDER_RE = /<system-reminder>[\s\S]*?<\/system-reminder>/gi;
55828
55840
  var INCOMPLETE_SYSTEM_REMINDER_RE = /<system-reminder>[\s\S]*$/i;
55829
55841
  function findCodeRanges(text4) {
@@ -55881,7 +55893,7 @@ function CodeBlockPre({ children, ...props }) {
55881
55893
  };
55882
55894
  return /* @__PURE__ */ jsxs14("div", { className: "blade-chat-codeblock not-prose my-3 overflow-hidden rounded-xl border border-[hsl(var(--border))]", children: [
55883
55895
  /* @__PURE__ */ jsxs14("div", { className: "blade-chat-codeblock-header flex h-[34px] items-center justify-between border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))/0.5] pl-3.5 pr-1.5", children: [
55884
- /* @__PURE__ */ jsx16("span", { className: "font-mono text-[12px] text-[hsl(var(--muted-foreground))]", children: language || "code" }),
55896
+ /* @__PURE__ */ jsx17("span", { className: "font-mono text-[12px] text-[hsl(var(--muted-foreground))]", children: language || "code" }),
55885
55897
  /* @__PURE__ */ jsxs14(
55886
55898
  "button",
55887
55899
  {
@@ -55892,13 +55904,13 @@ function CodeBlockPre({ children, ...props }) {
55892
55904
  copied ? "text-[hsl(var(--primary))]" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]"
55893
55905
  ),
55894
55906
  children: [
55895
- copied ? /* @__PURE__ */ jsx16(Check, { size: 12 }) : /* @__PURE__ */ jsx16(Copy, { size: 12 }),
55896
- /* @__PURE__ */ jsx16("span", { children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236" })
55907
+ copied ? /* @__PURE__ */ jsx17(Check, { size: 12 }) : /* @__PURE__ */ jsx17(Copy, { size: 12 }),
55908
+ /* @__PURE__ */ jsx17("span", { children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236" })
55897
55909
  ]
55898
55910
  }
55899
55911
  )
55900
55912
  ] }),
55901
- /* @__PURE__ */ jsx16(
55913
+ /* @__PURE__ */ jsx17(
55902
55914
  "pre",
55903
55915
  {
55904
55916
  ref: preRef,
@@ -55911,9 +55923,9 @@ function CodeBlockPre({ children, ...props }) {
55911
55923
  }
55912
55924
  function ExternalAnchor({ children, href, ...props }) {
55913
55925
  if (typeof href === "string" && href.startsWith("#")) {
55914
- return /* @__PURE__ */ jsx16("a", { ...props, href, children });
55926
+ return /* @__PURE__ */ jsx17("a", { ...props, href, children });
55915
55927
  }
55916
- return /* @__PURE__ */ jsx16("a", { ...props, href, target: "_blank", rel: "noopener noreferrer", children });
55928
+ return /* @__PURE__ */ jsx17("a", { ...props, href, target: "_blank", rel: "noopener noreferrer", children });
55917
55929
  }
55918
55930
  var MARKDOWN_COMPONENTS = {
55919
55931
  pre: CodeBlockPre,
@@ -55923,7 +55935,7 @@ function MarkdownContent({ children, className, mode, sessionId }) {
55923
55935
  const resolvedChildren = useMemo14(() => {
55924
55936
  return normalizeAdjacentUrlFormatting(stripSystemReminders(children));
55925
55937
  }, [children]);
55926
- return /* @__PURE__ */ jsx16(
55938
+ return /* @__PURE__ */ jsx17(
55927
55939
  MarkdownRenderer,
55928
55940
  {
55929
55941
  className: cn("blade-chat-markdown break-words", className),
@@ -55937,17 +55949,17 @@ function MarkdownContent({ children, className, mode, sessionId }) {
55937
55949
  }
55938
55950
 
55939
55951
  // src/components/Shimmer.tsx
55940
- import { jsx as jsx17 } from "react/jsx-runtime";
55952
+ import { jsx as jsx18 } from "react/jsx-runtime";
55941
55953
  function Shimmer({ children = "\u6B63\u5728\u601D\u8003...", className }) {
55942
- return /* @__PURE__ */ jsx17("span", { className: cn("blade-shimmer-text text-sm font-medium", className), children });
55954
+ return /* @__PURE__ */ jsx18("span", { className: cn("blade-shimmer-text text-sm font-medium", className), children });
55943
55955
  }
55944
55956
 
55945
55957
  // src/components/ToolCallBlock.tsx
55946
55958
  import { useState as useState29 } from "react";
55947
55959
 
55948
55960
  // src/components/AskUserQuestionBlock.tsx
55949
- import { useEffect as useEffect19, useMemo as useMemo15, useRef as useRef23, useState as useState28 } from "react";
55950
- import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
55961
+ import { useEffect as useEffect20, useMemo as useMemo15, useRef as useRef23, useState as useState28 } from "react";
55962
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
55951
55963
  var CUSTOM_TEXTAREA_MAX_HEIGHT = 160;
55952
55964
  function resizeCustomTextarea(textarea) {
55953
55965
  textarea.style.height = "auto";
@@ -55956,11 +55968,11 @@ function resizeCustomTextarea(textarea) {
55956
55968
  }
55957
55969
  function useAutoResizeTextarea(value) {
55958
55970
  const textareaRef = useRef23(null);
55959
- useEffect19(() => {
55971
+ useEffect20(() => {
55960
55972
  const textarea = textareaRef.current;
55961
55973
  if (textarea?.value === value) resizeCustomTextarea(textarea);
55962
55974
  }, [value]);
55963
- useEffect19(() => {
55975
+ useEffect20(() => {
55964
55976
  const textarea = textareaRef.current;
55965
55977
  if (!textarea || typeof ResizeObserver === "undefined") return;
55966
55978
  let previousWidth = textarea.clientWidth;
@@ -55992,7 +56004,7 @@ function AskUserQuestionBlock({
55992
56004
  const [usingCustom, setUsingCustom] = useState28(/* @__PURE__ */ new Set());
55993
56005
  const [note, setNote] = useState28("");
55994
56006
  const [submitted, setSubmitted] = useState28(false);
55995
- useEffect19(() => {
56007
+ useEffect20(() => {
55996
56008
  if (sessionStatus === "failed" || sessionStatus === "interrupted") {
55997
56009
  setSubmitted(false);
55998
56010
  }
@@ -56105,7 +56117,7 @@ ${parts.join("\n")}`,
56105
56117
  data.source_loop.description,
56106
56118
  "\u300D\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54"
56107
56119
  ] }),
56108
- data.questions.map((q2, qIdx) => /* @__PURE__ */ jsx18(
56120
+ data.questions.map((q2, qIdx) => /* @__PURE__ */ jsx19(
56109
56121
  QuestionCard,
56110
56122
  {
56111
56123
  question: q2,
@@ -56121,7 +56133,7 @@ ${parts.join("\n")}`,
56121
56133
  },
56122
56134
  q2.question
56123
56135
  )),
56124
- /* @__PURE__ */ jsx18(
56136
+ /* @__PURE__ */ jsx19(
56125
56137
  NoteField,
56126
56138
  {
56127
56139
  answered,
@@ -56130,7 +56142,7 @@ ${parts.join("\n")}`,
56130
56142
  onChange: setNote
56131
56143
  }
56132
56144
  ),
56133
- !answered && !submitted && onAnswer && /* @__PURE__ */ jsx18(
56145
+ !answered && !submitted && onAnswer && /* @__PURE__ */ jsx19(
56134
56146
  "button",
56135
56147
  {
56136
56148
  type: "button",
@@ -56147,7 +56159,7 @@ ${parts.join("\n")}`,
56147
56159
  disabled: true,
56148
56160
  className: "flex w-full items-center justify-center gap-2 rounded-lg bg-[hsl(var(--primary))] px-4 py-2 text-xs font-semibold text-[hsl(var(--primary-foreground))] opacity-80",
56149
56161
  children: [
56150
- /* @__PURE__ */ jsx18(LoaderCircle, { size: 14, className: "animate-spin" }),
56162
+ /* @__PURE__ */ jsx19(LoaderCircle, { size: 14, className: "animate-spin" }),
56151
56163
  "\u786E\u8BA4\u4E2D"
56152
56164
  ]
56153
56165
  }
@@ -56172,21 +56184,21 @@ function QuestionCard({
56172
56184
  const customTextareaRef = useAutoResizeTextarea(customText);
56173
56185
  return /* @__PURE__ */ jsxs15("div", { children: [
56174
56186
  /* @__PURE__ */ jsxs15("div", { className: cn("flex items-start gap-2", answered ? "mb-2" : "mb-3"), children: [
56175
- /* @__PURE__ */ jsx18(
56187
+ /* @__PURE__ */ jsx19(
56176
56188
  MessageSquareMore,
56177
56189
  {
56178
56190
  size: answered ? 12 : 13,
56179
56191
  className: "mt-0.5 shrink-0 text-[hsl(var(--primary))]"
56180
56192
  }
56181
56193
  ),
56182
- /* @__PURE__ */ jsx18(
56194
+ /* @__PURE__ */ jsx19(
56183
56195
  "div",
56184
56196
  {
56185
56197
  className: cn(
56186
56198
  "min-w-0 flex-1 font-medium text-[hsl(var(--foreground))]",
56187
56199
  answered ? "text-xs" : "text-sm"
56188
56200
  ),
56189
- children: /* @__PURE__ */ jsx18(MarkdownContent, { className: "blade-chat-prose", children: question.question })
56201
+ children: /* @__PURE__ */ jsx19(MarkdownContent, { className: "blade-chat-prose", children: question.question })
56190
56202
  }
56191
56203
  )
56192
56204
  ] }),
@@ -56209,14 +56221,14 @@ function QuestionCard({
56209
56221
  optionClassName
56210
56222
  ),
56211
56223
  children: [
56212
- multi && /* @__PURE__ */ jsx18(
56224
+ multi && /* @__PURE__ */ jsx19(
56213
56225
  "div",
56214
56226
  {
56215
56227
  className: cn(
56216
56228
  "mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",
56217
56229
  isSel && !answered ? "border-[hsl(var(--primary-foreground)/0.6)] bg-[hsl(var(--primary-foreground)/0.2)]" : isSel ? "border-[hsl(var(--primary)/0.45)] bg-[hsl(var(--primary)/0.12)]" : "border-[hsl(var(--border))]"
56218
56230
  ),
56219
- children: isSel && /* @__PURE__ */ jsx18(
56231
+ children: isSel && /* @__PURE__ */ jsx19(
56220
56232
  Check,
56221
56233
  {
56222
56234
  size: 9,
@@ -56226,8 +56238,8 @@ function QuestionCard({
56226
56238
  }
56227
56239
  ),
56228
56240
  /* @__PURE__ */ jsxs15("div", { className: "min-w-0", children: [
56229
- /* @__PURE__ */ jsx18("div", { className: cn("font-medium", answered ? "text-xs" : "text-[13px]"), children: opt.label }),
56230
- opt.description && /* @__PURE__ */ jsx18(
56241
+ /* @__PURE__ */ jsx19("div", { className: cn("font-medium", answered ? "text-xs" : "text-[13px]"), children: opt.label }),
56242
+ opt.description && /* @__PURE__ */ jsx19(
56231
56243
  "div",
56232
56244
  {
56233
56245
  className: cn(
@@ -56254,8 +56266,8 @@ function QuestionCard({
56254
56266
  answered && "cursor-default opacity-70"
56255
56267
  ),
56256
56268
  children: [
56257
- /* @__PURE__ */ jsx18("span", { className: "shrink-0 pt-1 text-xs text-[hsl(var(--muted-foreground))]", children: "\u5176\u4ED6\uFF1A" }),
56258
- /* @__PURE__ */ jsx18(
56269
+ /* @__PURE__ */ jsx19("span", { className: "shrink-0 pt-1 text-xs text-[hsl(var(--muted-foreground))]", children: "\u5176\u4ED6\uFF1A" }),
56270
+ /* @__PURE__ */ jsx19(
56259
56271
  "textarea",
56260
56272
  {
56261
56273
  ref: customTextareaRef,
@@ -56297,8 +56309,8 @@ function NoteField({
56297
56309
  readOnly && "cursor-default opacity-70"
56298
56310
  ),
56299
56311
  children: [
56300
- /* @__PURE__ */ jsx18("span", { className: "mb-1.5 block text-xs text-[hsl(var(--muted-foreground))]", children: "\u8865\u5145\u8BF4\u660E\uFF08\u53EF\u9009\uFF09" }),
56301
- /* @__PURE__ */ jsx18(
56312
+ /* @__PURE__ */ jsx19("span", { className: "mb-1.5 block text-xs text-[hsl(var(--muted-foreground))]", children: "\u8865\u5145\u8BF4\u660E\uFF08\u53EF\u9009\uFF09" }),
56313
+ /* @__PURE__ */ jsx19(
56302
56314
  "textarea",
56303
56315
  {
56304
56316
  ref: textareaRef,
@@ -56387,7 +56399,7 @@ function normalizeOptionItem(value) {
56387
56399
  }
56388
56400
 
56389
56401
  // src/components/ToolCallBlock.tsx
56390
- import { Fragment as Fragment7, jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
56402
+ import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
56391
56403
  function resolveAskQuestionState({
56392
56404
  toolStatus,
56393
56405
  hasAnswerData,
@@ -56415,7 +56427,7 @@ function ToolCallBlock({
56415
56427
  const customQuestion = normalizedName === "AskUserQuestion" ? renderers?.askUserQuestion : void 0;
56416
56428
  const customToolCall = normalizedName === "AskUserQuestion" && customQuestion ? null : renderers?.toolCall?.(toolCall);
56417
56429
  if (customToolCall !== null && customToolCall !== void 0) {
56418
- return /* @__PURE__ */ jsx19(Fragment7, { children: customToolCall });
56430
+ return /* @__PURE__ */ jsx20(Fragment7, { children: customToolCall });
56419
56431
  }
56420
56432
  if (normalizedName === "AskUserQuestion") {
56421
56433
  const askData = parseAskUserQuestion(typeof toolCall.result === "string" ? toolCall.result : null) ?? parseAskUserQuestion(buildAskUserPayload(toolCall.arguments));
@@ -56437,9 +56449,9 @@ function ToolCallBlock({
56437
56449
  };
56438
56450
  const customAsk = customQuestion?.(answerProps);
56439
56451
  if (customAsk !== null && customAsk !== void 0) {
56440
- return /* @__PURE__ */ jsx19(Fragment7, { children: customAsk });
56452
+ return /* @__PURE__ */ jsx20(Fragment7, { children: customAsk });
56441
56453
  }
56442
- return /* @__PURE__ */ jsx19(
56454
+ return /* @__PURE__ */ jsx20(
56443
56455
  AskUserQuestionBlock,
56444
56456
  {
56445
56457
  ...answerProps,
@@ -56458,8 +56470,8 @@ function ToolCallBlock({
56458
56470
  classNames?.askCard
56459
56471
  ),
56460
56472
  children: [
56461
- /* @__PURE__ */ jsx19(LoaderCircle, { size: 14, className: "animate-spin" }),
56462
- /* @__PURE__ */ jsx19("span", { children: "\u6B63\u5728\u51C6\u5907\u95EE\u9898\u2026" })
56473
+ /* @__PURE__ */ jsx20(LoaderCircle, { size: 14, className: "animate-spin" }),
56474
+ /* @__PURE__ */ jsx20("span", { children: "\u6B63\u5728\u51C6\u5907\u95EE\u9898\u2026" })
56463
56475
  ]
56464
56476
  }
56465
56477
  );
@@ -56476,11 +56488,11 @@ function ToolCallBlock({
56476
56488
  classNames?.askCard
56477
56489
  ),
56478
56490
  children: [
56479
- /* @__PURE__ */ jsx19("div", { className: "font-semibold", children: "\u9009\u62E9\u9898\u5185\u5BB9\u6682\u65F6\u65E0\u6CD5\u663E\u793A" }),
56480
- /* @__PURE__ */ jsx19("div", { className: "mt-1 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: errorDetail?.message ?? "\u6536\u5230\u7684\u4EA4\u4E92\u6570\u636E\u4E0D\u5B8C\u6574\u3002\u8BF7\u8BA9\u667A\u80FD\u4F53\u91CD\u65B0\u63D0\u95EE\u3002" }),
56491
+ /* @__PURE__ */ jsx20("div", { className: "font-semibold", children: "\u9009\u62E9\u9898\u5185\u5BB9\u6682\u65F6\u65E0\u6CD5\u663E\u793A" }),
56492
+ /* @__PURE__ */ jsx20("div", { className: "mt-1 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: errorDetail?.message ?? "\u6536\u5230\u7684\u4EA4\u4E92\u6570\u636E\u4E0D\u5B8C\u6574\u3002\u8BF7\u8BA9\u667A\u80FD\u4F53\u91CD\u65B0\u63D0\u95EE\u3002" }),
56481
56493
  errorDetail?.detail ? /* @__PURE__ */ jsxs16("details", { className: "mt-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
56482
- /* @__PURE__ */ jsx19("summary", { className: "cursor-pointer", children: "\u67E5\u770B\u5177\u4F53\u539F\u56E0" }),
56483
- /* @__PURE__ */ jsx19("div", { className: "mt-1 break-words font-mono", children: errorDetail.detail })
56494
+ /* @__PURE__ */ jsx20("summary", { className: "cursor-pointer", children: "\u67E5\u770B\u5177\u4F53\u539F\u56E0" }),
56495
+ /* @__PURE__ */ jsx20("div", { className: "mt-1 break-words font-mono", children: errorDetail.detail })
56484
56496
  ] }) : null
56485
56497
  ]
56486
56498
  }
@@ -56489,7 +56501,7 @@ function ToolCallBlock({
56489
56501
  const tone = getToolTone(toolCall.status);
56490
56502
  const displayName = getToolDisplayLabel(toolCall);
56491
56503
  const toneClass = tone === "red" ? "border-l-[hsl(var(--muted-foreground)/0.5)]" : tone === "amber" ? "border-l-amber-400" : tone === "blue" ? "border-l-blue-500" : "border-l-[hsl(var(--primary))]";
56492
- const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */ jsx19(LoaderCircle, { size: 11, className: "animate-spin" }) : toolCall.status === "awaiting_answer" ? /* @__PURE__ */ jsx19(MessageSquareMore, { size: 11 }) : toolCall.status === "cancelled" || toolCall.status === "error" ? /* @__PURE__ */ jsx19(X, { size: 11 }) : /* @__PURE__ */ jsx19(Check, { size: 11 });
56504
+ const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */ jsx20(LoaderCircle, { size: 11, className: "animate-spin" }) : toolCall.status === "awaiting_answer" ? /* @__PURE__ */ jsx20(MessageSquareMore, { size: 11 }) : toolCall.status === "cancelled" || toolCall.status === "error" ? /* @__PURE__ */ jsx20(X, { size: 11 }) : /* @__PURE__ */ jsx20(Check, { size: 11 });
56493
56505
  const statusTextClass = tone === "red" ? "text-[hsl(var(--muted-foreground))]" : tone === "amber" ? "text-amber-300" : tone === "blue" ? "text-blue-300" : "text-[hsl(var(--primary))]";
56494
56506
  return /* @__PURE__ */ jsxs16("div", { className: "ml-4 text-xs", children: [
56495
56507
  /* @__PURE__ */ jsxs16("div", { className: cn("border-l-[3px] flex items-center gap-2 px-3 py-2", toneClass), children: [
@@ -56501,7 +56513,7 @@ function ToolCallBlock({
56501
56513
  className: "flex min-w-0 flex-1 items-center gap-2 text-left transition-colors hover:bg-white/3 focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
56502
56514
  "aria-expanded": expanded,
56503
56515
  children: [
56504
- /* @__PURE__ */ jsx19(
56516
+ /* @__PURE__ */ jsx20(
56505
56517
  ChevronRight,
56506
56518
  {
56507
56519
  size: 11,
@@ -56513,22 +56525,22 @@ function ToolCallBlock({
56513
56525
  ),
56514
56526
  /* @__PURE__ */ jsxs16("span", { className: cn("flex shrink-0 items-center gap-1 text-[10px]", statusTextClass), children: [
56515
56527
  statusIcon,
56516
- /* @__PURE__ */ jsx19("span", { children: getToolStatusLabel(toolCall.status) })
56528
+ /* @__PURE__ */ jsx20("span", { children: getToolStatusLabel(toolCall.status) })
56517
56529
  ] }),
56518
- /* @__PURE__ */ jsx19("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: displayName })
56530
+ /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: displayName })
56519
56531
  ]
56520
56532
  }
56521
56533
  ),
56522
- typeof toolCall.duration_ms === "number" && toolCall.duration_ms > 0 && /* @__PURE__ */ jsx19("span", { className: "shrink-0 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: formatToolDuration(toolCall.duration_ms) })
56534
+ typeof toolCall.duration_ms === "number" && toolCall.duration_ms > 0 && /* @__PURE__ */ jsx20("span", { className: "shrink-0 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: formatToolDuration(toolCall.duration_ms) })
56523
56535
  ] }),
56524
56536
  expanded && /* @__PURE__ */ jsxs16("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: [
56525
- /* @__PURE__ */ jsx19("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u5DE5\u5177" }),
56526
- /* @__PURE__ */ jsx19("div", { className: "mb-3 font-mono text-[11px] text-[hsl(var(--foreground))]", children: normalizedName }),
56527
- /* @__PURE__ */ jsx19("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u53C2\u6570" }),
56528
- /* @__PURE__ */ jsx19("pre", { className: "overflow-auto whitespace-pre-wrap rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[11px] text-[hsl(var(--foreground))]", children: formatToolArgs(toolCall.arguments) }),
56537
+ /* @__PURE__ */ jsx20("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u5DE5\u5177" }),
56538
+ /* @__PURE__ */ jsx20("div", { className: "mb-3 font-mono text-[11px] text-[hsl(var(--foreground))]", children: normalizedName }),
56539
+ /* @__PURE__ */ jsx20("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u53C2\u6570" }),
56540
+ /* @__PURE__ */ jsx20("pre", { className: "overflow-auto whitespace-pre-wrap rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[11px] text-[hsl(var(--foreground))]", children: formatToolArgs(toolCall.arguments) }),
56529
56541
  toolCall.result != null && /* @__PURE__ */ jsxs16(Fragment7, { children: [
56530
- /* @__PURE__ */ jsx19("div", { className: "mb-1 mt-3 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u7ED3\u679C" }),
56531
- /* @__PURE__ */ jsx19("pre", { className: "max-h-[400px] overflow-auto whitespace-pre-wrap rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[11px] text-[hsl(var(--foreground))]", children: formatToolResult(toolCall.result) })
56542
+ /* @__PURE__ */ jsx20("div", { className: "mb-1 mt-3 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u7ED3\u679C" }),
56543
+ /* @__PURE__ */ jsx20("pre", { className: "max-h-[400px] overflow-auto whitespace-pre-wrap rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[11px] text-[hsl(var(--foreground))]", children: formatToolResult(toolCall.result) })
56532
56544
  ] })
56533
56545
  ] })
56534
56546
  ] });
@@ -56547,13 +56559,13 @@ function buildAskUserPayload(argumentsJson) {
56547
56559
 
56548
56560
  // src/components/ToolUiCardView.tsx
56549
56561
  import { resolveToolUiCardContent } from "@blade-hq/agent-client";
56550
- import { jsx as jsx20 } from "react/jsx-runtime";
56562
+ import { jsx as jsx21 } from "react/jsx-runtime";
56551
56563
  function ToolUiCardView({ card, sessionId }) {
56552
- if (card.mcpApp) return sessionId ? /* @__PURE__ */ jsx20(McpAppCard, { sessionId, sourceId: card.mcpApp.sourceId }) : null;
56564
+ if (card.mcpApp) return sessionId ? /* @__PURE__ */ jsx21(McpAppCard, { sessionId, sourceId: card.mcpApp.sourceId }) : null;
56553
56565
  const resolved = resolveToolUiCardContent(card);
56554
56566
  if (!resolved) return null;
56555
56567
  const sandbox = resolved.type === "resource-uri" ? "allow-scripts allow-same-origin" : "allow-scripts";
56556
- return /* @__PURE__ */ jsx20(
56568
+ return /* @__PURE__ */ jsx21(
56557
56569
  "iframe",
56558
56570
  {
56559
56571
  title: card.title ?? "\u5DE5\u5177\u754C\u9762",
@@ -56584,7 +56596,7 @@ ${html}`;
56584
56596
  }
56585
56597
 
56586
56598
  // src/components/AssistantTurnBlock.tsx
56587
- import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
56599
+ import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
56588
56600
  function ThinkingBlock({
56589
56601
  reasoning,
56590
56602
  isStreaming,
@@ -56601,8 +56613,8 @@ function ThinkingBlock({
56601
56613
  "aria-expanded": open2,
56602
56614
  className: "group/thinking inline-flex items-center gap-1 text-[hsl(var(--muted-foreground))] transition-colors hover:text-[hsl(var(--foreground))]",
56603
56615
  children: [
56604
- /* @__PURE__ */ jsx21(Shimmer, { className: "text-xs", children: "\u6B63\u5728\u601D\u8003" }),
56605
- /* @__PURE__ */ jsx21(
56616
+ /* @__PURE__ */ jsx22(Shimmer, { className: "text-xs", children: "\u6B63\u5728\u601D\u8003" }),
56617
+ /* @__PURE__ */ jsx22(
56606
56618
  ChevronRight,
56607
56619
  {
56608
56620
  size: 14,
@@ -56615,7 +56627,7 @@ function ThinkingBlock({
56615
56627
  ]
56616
56628
  }
56617
56629
  ),
56618
- open2 ? /* @__PURE__ */ jsx21("div", { className: "mt-1.5 whitespace-pre-wrap text-xs leading-[22px] text-[hsl(var(--muted-foreground))]", children: reasoning }) : null
56630
+ open2 ? /* @__PURE__ */ jsx22("div", { className: "mt-1.5 whitespace-pre-wrap text-xs leading-[22px] text-[hsl(var(--muted-foreground))]", children: reasoning }) : null
56619
56631
  ] });
56620
56632
  }
56621
56633
  function getMessageText(message) {
@@ -56810,7 +56822,7 @@ function ExecutionToolRow({
56810
56822
  "size-3.5 shrink-0",
56811
56823
  failed ? "text-red-500" : "text-[hsl(var(--muted-foreground))]"
56812
56824
  );
56813
- const icon = toolCall.status === "pending" ? /* @__PURE__ */ jsx21(LoaderCircle, { className: cn(iconClass, "animate-spin"), "aria-hidden": "true" }) : toolCall.status === "error" ? /* @__PURE__ */ jsx21(CircleAlert, { className: iconClass, "aria-hidden": "true" }) : toolCall.status === "cancelled" ? /* @__PURE__ */ jsx21(X, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "WebSearch" || normalizedName === "WebFetch" ? /* @__PURE__ */ jsx21(Earth, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Bash" || normalizedName === "BgBash" ? /* @__PURE__ */ jsx21(Terminal, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Write" || normalizedName === "Edit" || normalizedName === "MultiEdit" ? /* @__PURE__ */ jsx21(FilePenLine, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Read" || normalizedName === "ReadSkill" || normalizedName === "get_skill_content" ? /* @__PURE__ */ jsx21(BookOpen, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Grep" || normalizedName === "Glob" || normalizedName === "search_skills" ? /* @__PURE__ */ jsx21(Search, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Agent" ? /* @__PURE__ */ jsx21(Bot, { className: iconClass, "aria-hidden": "true" }) : /* @__PURE__ */ jsx21(Wrench, { className: iconClass, "aria-hidden": "true" });
56825
+ const icon = toolCall.status === "pending" ? /* @__PURE__ */ jsx22(LoaderCircle, { className: cn(iconClass, "animate-spin"), "aria-hidden": "true" }) : toolCall.status === "error" ? /* @__PURE__ */ jsx22(CircleAlert, { className: iconClass, "aria-hidden": "true" }) : toolCall.status === "cancelled" ? /* @__PURE__ */ jsx22(X, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "WebSearch" || normalizedName === "WebFetch" ? /* @__PURE__ */ jsx22(Earth, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Bash" || normalizedName === "BgBash" ? /* @__PURE__ */ jsx22(Terminal, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Write" || normalizedName === "Edit" || normalizedName === "MultiEdit" ? /* @__PURE__ */ jsx22(FilePenLine, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Read" || normalizedName === "ReadSkill" || normalizedName === "get_skill_content" ? /* @__PURE__ */ jsx22(BookOpen, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Grep" || normalizedName === "Glob" || normalizedName === "search_skills" ? /* @__PURE__ */ jsx22(Search, { className: iconClass, "aria-hidden": "true" }) : normalizedName === "Agent" ? /* @__PURE__ */ jsx22(Bot, { className: iconClass, "aria-hidden": "true" }) : /* @__PURE__ */ jsx22(Wrench, { className: iconClass, "aria-hidden": "true" });
56814
56826
  const rowClassName = cn(
56815
56827
  "flex min-w-0 items-center gap-1 py-1.5 text-xs leading-[22px]",
56816
56828
  failed ? "text-red-500" : "text-[hsl(var(--muted-foreground))]"
@@ -56824,7 +56836,7 @@ function ExecutionToolRow({
56824
56836
  title: label,
56825
56837
  children: [
56826
56838
  icon,
56827
- /* @__PURE__ */ jsx21("span", { className: "min-w-0 truncate", children: label })
56839
+ /* @__PURE__ */ jsx22("span", { className: "min-w-0 truncate", children: label })
56828
56840
  ]
56829
56841
  }
56830
56842
  );
@@ -56878,7 +56890,7 @@ function AssistantTurnBlock({
56878
56890
  );
56879
56891
  const userSelectedDisplayModeRef = useRef24(false);
56880
56892
  const wasStreamingRef = useRef24(isStreaming);
56881
- useEffect20(() => {
56893
+ useEffect21(() => {
56882
56894
  if (wasStreamingRef.current && !isStreaming && !userSelectedDisplayModeRef.current) {
56883
56895
  setDisplayMode(hasActionableToolCall ? "detail" : "compact");
56884
56896
  }
@@ -56890,7 +56902,7 @@ function AssistantTurnBlock({
56890
56902
  const hasLiveStartTime = messages.some(
56891
56903
  (message) => message.timestamp != null && Number.isFinite(Date.parse(message.timestamp))
56892
56904
  );
56893
- useEffect20(() => {
56905
+ useEffect21(() => {
56894
56906
  if (!isStreaming || !hasLiveStartTime) return;
56895
56907
  const timer = window.setInterval(() => setClock(Date.now()), 1e3);
56896
56908
  return () => window.clearInterval(timer);
@@ -56906,15 +56918,15 @@ function AssistantTurnBlock({
56906
56918
  part: "assistant-turn",
56907
56919
  className: cn("blade-chat-assistant-turn flex flex-col gap-3", classNames?.assistantTurn),
56908
56920
  children: [
56909
- memoryRefs.length > 0 ? /* @__PURE__ */ jsx21(MemoryRefsHint, { refs: memoryRefs, className: classNames?.memoryRefs }) : null,
56910
- hasInterrupted && /* @__PURE__ */ jsx21("div", { className: "ml-4 w-fit rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.12em] text-amber-300", children: "\u5DF2\u4E2D\u65AD" }),
56911
- hasFailedWithoutContent && /* @__PURE__ */ jsx21("div", { className: "ml-4 w-fit rounded-full border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] font-medium text-red-400", children: "\u751F\u6210\u5931\u8D25" }),
56921
+ memoryRefs.length > 0 ? /* @__PURE__ */ jsx22(MemoryRefsHint, { refs: memoryRefs, className: classNames?.memoryRefs }) : null,
56922
+ hasInterrupted && /* @__PURE__ */ jsx22("div", { className: "ml-4 w-fit rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.12em] text-amber-300", children: "\u5DF2\u4E2D\u65AD" }),
56923
+ hasFailedWithoutContent && /* @__PURE__ */ jsx22("div", { className: "ml-4 w-fit rounded-full border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] font-medium text-red-400", children: "\u751F\u6210\u5931\u8D25" }),
56912
56924
  messages.map((message, index2) => {
56913
- return hasRenderableMessageContent(message) ? /* @__PURE__ */ jsx21(
56925
+ return hasRenderableMessageContent(message) ? /* @__PURE__ */ jsx22(
56914
56926
  "div",
56915
56927
  {
56916
56928
  className: "flex flex-col gap-3",
56917
- children: /* @__PURE__ */ jsx21(
56929
+ children: /* @__PURE__ */ jsx22(
56918
56930
  AssistantMessageContent,
56919
56931
  {
56920
56932
  message,
@@ -56928,7 +56940,7 @@ function AssistantTurnBlock({
56928
56940
  message.entry_id ?? `${message.timestamp ?? "assistant"}-${index2}`
56929
56941
  ) : null;
56930
56942
  }),
56931
- inlineToolUiCards.length > 0 ? /* @__PURE__ */ jsx21("div", { className: "flex flex-col gap-3", children: inlineToolUiCards.map((entry) => /* @__PURE__ */ jsx21(ToolUiCardView, { card: entry.card, sessionId }, entry.key)) }) : null
56943
+ inlineToolUiCards.length > 0 ? /* @__PURE__ */ jsx22("div", { className: "flex flex-col gap-3", children: inlineToolUiCards.map((entry) => /* @__PURE__ */ jsx22(ToolUiCardView, { card: entry.card, sessionId }, entry.key)) }) : null
56932
56944
  ]
56933
56945
  }
56934
56946
  );
@@ -56940,16 +56952,16 @@ function AssistantTurnBlock({
56940
56952
  part: "assistant-turn",
56941
56953
  className: cn("blade-chat-assistant-turn flex flex-col gap-3", classNames?.assistantTurn),
56942
56954
  children: [
56943
- memoryRefs.length > 0 ? /* @__PURE__ */ jsx21(MemoryRefsHint, { refs: memoryRefs, className: classNames?.memoryRefs }) : null,
56944
- hasInterrupted && /* @__PURE__ */ jsx21("div", { className: "ml-4 w-fit rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.12em] text-amber-300", children: "\u5DF2\u4E2D\u65AD" }),
56945
- hasFailedWithoutContent && /* @__PURE__ */ jsx21("div", { className: "ml-4 w-fit rounded-full border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] font-medium text-red-400", children: "\u751F\u6210\u5931\u8D25" }),
56955
+ memoryRefs.length > 0 ? /* @__PURE__ */ jsx22(MemoryRefsHint, { refs: memoryRefs, className: classNames?.memoryRefs }) : null,
56956
+ hasInterrupted && /* @__PURE__ */ jsx22("div", { className: "ml-4 w-fit rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.12em] text-amber-300", children: "\u5DF2\u4E2D\u65AD" }),
56957
+ hasFailedWithoutContent && /* @__PURE__ */ jsx22("div", { className: "ml-4 w-fit rounded-full border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] font-medium text-red-400", children: "\u751F\u6210\u5931\u8D25" }),
56946
56958
  /* @__PURE__ */ jsxs17("div", { className: "flex w-full items-start gap-2.5", children: [
56947
- /* @__PURE__ */ jsx21(
56959
+ /* @__PURE__ */ jsx22(
56948
56960
  "span",
56949
56961
  {
56950
56962
  className: "grid size-[30px] shrink-0 place-items-center rounded-full bg-[hsl(var(--muted)/0.55)] text-[hsl(var(--foreground))]",
56951
56963
  "aria-hidden": "true",
56952
- children: /* @__PURE__ */ jsx21(Bot, { size: 16 })
56964
+ children: /* @__PURE__ */ jsx22(Bot, { size: 16 })
56953
56965
  }
56954
56966
  ),
56955
56967
  /* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1 pt-0.5", children: [
@@ -56966,14 +56978,14 @@ function AssistantTurnBlock({
56966
56978
  "data-testid": "assistant-execution-summary",
56967
56979
  className: "inline-flex min-w-0 max-w-full select-none items-center gap-1 bg-transparent p-0 text-left text-xs leading-[22px] text-[hsl(var(--muted-foreground))] transition-colors hover:text-[hsl(var(--foreground))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
56968
56980
  children: [
56969
- /* @__PURE__ */ jsx21("span", { className: "min-w-0 truncate", children: executionSummaryLabel({
56981
+ /* @__PURE__ */ jsx22("span", { className: "min-w-0 truncate", children: executionSummaryLabel({
56970
56982
  messages,
56971
56983
  isStreaming,
56972
56984
  durationMs: liveExecutionDurationMs,
56973
56985
  sessionStatus,
56974
56986
  askAnswers
56975
56987
  }) }),
56976
- /* @__PURE__ */ jsx21(
56988
+ /* @__PURE__ */ jsx22(
56977
56989
  ChevronRight,
56978
56990
  {
56979
56991
  size: 14,
@@ -56988,10 +57000,10 @@ function AssistantTurnBlock({
56988
57000
  ]
56989
57001
  }
56990
57002
  ),
56991
- /* @__PURE__ */ jsx21("div", { className: "mt-3 h-px w-full bg-[hsl(var(--border)/0.75)]" })
57003
+ /* @__PURE__ */ jsx22("div", { className: "mt-3 h-px w-full bg-[hsl(var(--border)/0.75)]" })
56992
57004
  ] })
56993
57005
  ] }),
56994
- effectiveMode === "detail" ? /* @__PURE__ */ jsx21("div", { className: "ml-10 flex flex-col gap-3 pt-1", children: messages.map((message, index2) => {
57006
+ effectiveMode === "detail" ? /* @__PURE__ */ jsx22("div", { className: "ml-10 flex flex-col gap-3 pt-1", children: messages.map((message, index2) => {
56995
57007
  const isLast = index2 === messages.length - 1;
56996
57008
  const streamingThis = isStreaming && isLast;
56997
57009
  const text4 = getMessageText(message);
@@ -57006,7 +57018,7 @@ function AssistantTurnBlock({
57006
57018
  {
57007
57019
  className: "flex flex-col gap-3",
57008
57020
  children: [
57009
- showReasoning && message.reasoning ? /* @__PURE__ */ jsx21(
57021
+ showReasoning && message.reasoning ? /* @__PURE__ */ jsx22(
57010
57022
  ThinkingBlock,
57011
57023
  {
57012
57024
  reasoning: message.reasoning,
@@ -57015,7 +57027,7 @@ function AssistantTurnBlock({
57015
57027
  }
57016
57028
  ) : null,
57017
57029
  orderedParts.length > 0 ? orderedParts.map(
57018
- (part) => part.type === "text" ? /* @__PURE__ */ jsx21(
57030
+ (part) => part.type === "text" ? /* @__PURE__ */ jsx22(
57019
57031
  AssistantMessageContent,
57020
57032
  {
57021
57033
  message: { ...message, content: part.content, tool_calls: turnToolCalls },
@@ -57026,9 +57038,9 @@ function AssistantTurnBlock({
57026
57038
  renderers
57027
57039
  },
57028
57040
  part.key
57029
- ) : /* @__PURE__ */ jsx21("div", { className: "flex flex-col gap-0.5", children: part.toolCalls.map((toolCall) => {
57041
+ ) : /* @__PURE__ */ jsx22("div", { className: "flex flex-col gap-0.5", children: part.toolCalls.map((toolCall) => {
57030
57042
  const custom2 = renderers?.toolCall?.(toolCall);
57031
- return custom2 !== null && custom2 !== void 0 ? /* @__PURE__ */ jsx21("div", { children: custom2 }, toolCall.id) : formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx21(AgentLoopBlock, { toolCall, className: classNames?.agentLoop }, toolCall.id) : /* @__PURE__ */ jsx21(
57043
+ return custom2 !== null && custom2 !== void 0 ? /* @__PURE__ */ jsx22("div", { children: custom2 }, toolCall.id) : formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx22(AgentLoopBlock, { toolCall, className: classNames?.agentLoop }, toolCall.id) : /* @__PURE__ */ jsx22(
57032
57044
  ExecutionToolRow,
57033
57045
  {
57034
57046
  toolCall,
@@ -57037,7 +57049,7 @@ function AssistantTurnBlock({
57037
57049
  toolCall.id
57038
57050
  );
57039
57051
  }) }, part.key)
57040
- ) : hasRenderableMessageContent(message) && message !== finalMessage ? /* @__PURE__ */ jsx21(
57052
+ ) : hasRenderableMessageContent(message) && message !== finalMessage ? /* @__PURE__ */ jsx22(
57041
57053
  AssistantMessageContent,
57042
57054
  {
57043
57055
  message,
@@ -57048,9 +57060,9 @@ function AssistantTurnBlock({
57048
57060
  renderers
57049
57061
  }
57050
57062
  ) : null,
57051
- orderedParts.length === 0 && toolCalls.length > 0 ? /* @__PURE__ */ jsx21("div", { className: "flex flex-col gap-0.5", children: toolCalls.map((toolCall) => {
57063
+ orderedParts.length === 0 && toolCalls.length > 0 ? /* @__PURE__ */ jsx22("div", { className: "flex flex-col gap-0.5", children: toolCalls.map((toolCall) => {
57052
57064
  const custom2 = renderers?.toolCall?.(toolCall);
57053
- return custom2 !== null && custom2 !== void 0 ? /* @__PURE__ */ jsx21("div", { children: custom2 }, toolCall.id) : formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx21(AgentLoopBlock, { toolCall, className: classNames?.agentLoop }, toolCall.id) : /* @__PURE__ */ jsx21(
57065
+ return custom2 !== null && custom2 !== void 0 ? /* @__PURE__ */ jsx22("div", { children: custom2 }, toolCall.id) : formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx22(AgentLoopBlock, { toolCall, className: classNames?.agentLoop }, toolCall.id) : /* @__PURE__ */ jsx22(
57054
57066
  ExecutionToolRow,
57055
57067
  {
57056
57068
  toolCall,
@@ -57059,14 +57071,14 @@ function AssistantTurnBlock({
57059
57071
  toolCall.id
57060
57072
  );
57061
57073
  }) }) : null,
57062
- messageToolUiCards.map((entry) => /* @__PURE__ */ jsx21(ToolUiCardView, { card: entry.card, sessionId }, entry.key))
57074
+ messageToolUiCards.map((entry) => /* @__PURE__ */ jsx22(ToolUiCardView, { card: entry.card, sessionId }, entry.key))
57063
57075
  ]
57064
57076
  },
57065
57077
  message.entry_id ?? `${message.timestamp ?? "assistant"}-${index2}`
57066
57078
  );
57067
57079
  }) }) : null,
57068
- effectiveMode === "compact" && inlineToolUiCards.length > 0 ? /* @__PURE__ */ jsx21("div", { className: "ml-10 flex flex-col gap-3", children: inlineToolUiCards.map((entry) => /* @__PURE__ */ jsx21(ToolUiCardView, { card: entry.card, sessionId }, entry.key)) }) : null,
57069
- finalMessage && (effectiveMode === "compact" || finalOrderedParts.length === 0) ? /* @__PURE__ */ jsx21("div", { className: "ml-10", children: /* @__PURE__ */ jsx21(
57080
+ effectiveMode === "compact" && inlineToolUiCards.length > 0 ? /* @__PURE__ */ jsx22("div", { className: "ml-10 flex flex-col gap-3", children: inlineToolUiCards.map((entry) => /* @__PURE__ */ jsx22(ToolUiCardView, { card: entry.card, sessionId }, entry.key)) }) : null,
57081
+ finalMessage && (effectiveMode === "compact" || finalOrderedParts.length === 0) ? /* @__PURE__ */ jsx22("div", { className: "ml-10", children: /* @__PURE__ */ jsx22(
57070
57082
  AssistantMessageContent,
57071
57083
  {
57072
57084
  message: finalMessage,
@@ -57076,7 +57088,7 @@ function AssistantTurnBlock({
57076
57088
  renderers
57077
57089
  }
57078
57090
  ) }) : null,
57079
- questionToolCalls.map((toolCall) => /* @__PURE__ */ jsx21(
57091
+ questionToolCalls.map((toolCall) => /* @__PURE__ */ jsx22(
57080
57092
  ToolCallBlock,
57081
57093
  {
57082
57094
  toolCall,
@@ -57106,18 +57118,18 @@ function MemoryRefsHint({ refs, className }) {
57106
57118
  const label = refs.some((ref) => ref.skill_name) ? "\u53C2\u8003\u4E86\u8BE5\u6280\u80FD\u7684\u5386\u53F2\u7ECF\u9A8C" : "\u53C2\u8003\u4E86\u5386\u53F2\u7ECF\u9A8C";
57107
57119
  return /* @__PURE__ */ jsxs17("div", { part: "memory-refs", className: cn("blade-chat-memory-refs ml-1 w-full max-w-[680px]", className), children: [
57108
57120
  /* @__PURE__ */ jsxs17("button", { type: "button", onClick: () => setExpanded((value) => !value), 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))]", children: [
57109
- /* @__PURE__ */ jsx21(BookOpen, { size: 12 }),
57121
+ /* @__PURE__ */ jsx22(BookOpen, { size: 12 }),
57110
57122
  /* @__PURE__ */ jsxs17("span", { children: [
57111
57123
  label,
57112
57124
  "\uFF08",
57113
57125
  refs.length,
57114
57126
  "\uFF09"
57115
57127
  ] }),
57116
- /* @__PURE__ */ jsx21(ChevronRight, { size: 10, className: cn("transition-transform", expanded && "rotate-90") })
57128
+ /* @__PURE__ */ jsx22(ChevronRight, { size: 10, className: cn("transition-transform", expanded && "rotate-90") })
57117
57129
  ] }),
57118
- expanded ? /* @__PURE__ */ jsx21("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: refs.map((ref) => /* @__PURE__ */ jsxs17("div", { className: "rounded-lg border border-[hsl(var(--border)/0.55)] bg-[hsl(var(--background)/0.72)] px-3 py-2.5 text-xs", children: [
57119
- /* @__PURE__ */ jsx21("p", { className: "line-clamp-2 break-words leading-5", children: ref.content_preview }),
57120
- ref.skill_name ? /* @__PURE__ */ jsx21("span", { className: "mt-1 inline-flex text-[10px] text-[hsl(var(--primary))]", children: ref.skill_name }) : null
57130
+ expanded ? /* @__PURE__ */ jsx22("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: refs.map((ref) => /* @__PURE__ */ jsxs17("div", { className: "rounded-lg border border-[hsl(var(--border)/0.55)] bg-[hsl(var(--background)/0.72)] px-3 py-2.5 text-xs", children: [
57131
+ /* @__PURE__ */ jsx22("p", { className: "line-clamp-2 break-words leading-5", children: ref.content_preview }),
57132
+ ref.skill_name ? /* @__PURE__ */ jsx22("span", { className: "mt-1 inline-flex text-[10px] text-[hsl(var(--primary))]", children: ref.skill_name }) : null
57121
57133
  ] }, ref.id)) }) : null
57122
57134
  ] });
57123
57135
  }
@@ -57133,9 +57145,9 @@ function AssistantMessageContent({
57133
57145
  const imageParts = getImageParts(message.content);
57134
57146
  const fileParts = getFileParts(message.content);
57135
57147
  const failed = message.status === "failed";
57136
- const failedBadge = failed ? /* @__PURE__ */ jsx21("div", { className: "w-fit rounded-full border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] font-medium text-red-400", children: "\u751F\u6210\u5931\u8D25" }) : null;
57148
+ const failedBadge = failed ? /* @__PURE__ */ jsx22("div", { className: "w-fit rounded-full border border-red-500/30 bg-red-500/10 px-2.5 py-1 text-[10px] font-medium text-red-400", children: "\u751F\u6210\u5931\u8D25" }) : null;
57137
57149
  const customText = text4 ? renderers?.assistantText?.({ message, streaming, compact, sessionId }) : void 0;
57138
- const textContent = text4 ? customText ?? /* @__PURE__ */ jsx21(
57150
+ const textContent = text4 ? customText ?? /* @__PURE__ */ jsx22(
57139
57151
  "div",
57140
57152
  {
57141
57153
  part: "assistant-text",
@@ -57144,7 +57156,7 @@ function AssistantMessageContent({
57144
57156
  compact ? "text-xs leading-[22px] text-[hsl(var(--foreground))]" : "text-[15px] leading-8 text-[hsl(var(--foreground))]",
57145
57157
  classNames?.assistantText
57146
57158
  ),
57147
- children: /* @__PURE__ */ jsx21(
57159
+ children: /* @__PURE__ */ jsx22(
57148
57160
  MarkdownContent,
57149
57161
  {
57150
57162
  mode: streaming ? "streaming" : "static",
@@ -57164,7 +57176,7 @@ function AssistantMessageContent({
57164
57176
  }
57165
57177
  return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-3", children: [
57166
57178
  failedBadge,
57167
- imageParts.length > 0 ? /* @__PURE__ */ jsx21("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx21(
57179
+ imageParts.length > 0 ? /* @__PURE__ */ jsx22("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx22(
57168
57180
  "img",
57169
57181
  {
57170
57182
  src: part.image_url.url,
@@ -57173,7 +57185,7 @@ function AssistantMessageContent({
57173
57185
  },
57174
57186
  part.image_url.url
57175
57187
  )) }) : null,
57176
- fileParts.length > 0 ? /* @__PURE__ */ jsx21("div", { className: "flex flex-wrap gap-1.5", children: fileParts.map((part) => /* @__PURE__ */ jsxs17(
57188
+ fileParts.length > 0 ? /* @__PURE__ */ jsx22("div", { className: "flex flex-wrap gap-1.5", children: fileParts.map((part) => /* @__PURE__ */ jsxs17(
57177
57189
  "div",
57178
57190
  {
57179
57191
  part: "file-card",
@@ -57183,8 +57195,8 @@ function AssistantMessageContent({
57183
57195
  ),
57184
57196
  title: part.name,
57185
57197
  children: [
57186
- /* @__PURE__ */ jsx21(FileText, { size: 12, className: "blade-chat-file-card-icon shrink-0" }),
57187
- /* @__PURE__ */ jsx21("span", { className: "blade-chat-file-card-name max-w-56 truncate", children: part.name })
57198
+ /* @__PURE__ */ jsx22(FileText, { size: 12, className: "blade-chat-file-card-icon shrink-0" }),
57199
+ /* @__PURE__ */ jsx22("span", { className: "blade-chat-file-card-name max-w-56 truncate", children: part.name })
57188
57200
  ]
57189
57201
  },
57190
57202
  `${part.name}-${part.data.slice(0, 32)}`
@@ -57195,7 +57207,7 @@ function AssistantMessageContent({
57195
57207
 
57196
57208
  // src/components/RenderErrorBoundary.tsx
57197
57209
  import { Component as Component2 } from "react";
57198
- import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
57210
+ import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
57199
57211
  function getFirstComponentName(componentStack) {
57200
57212
  const match = componentStack.match(/\n\s+at\s+([^\s(]+)/);
57201
57213
  return match?.[1] ?? null;
@@ -57228,8 +57240,8 @@ var RenderErrorBoundary = class extends Component2 {
57228
57240
  return children;
57229
57241
  }
57230
57242
  const componentName = getFirstComponentName(componentStack);
57231
- return /* @__PURE__ */ jsx22("div", { className: "blade-chat-render-error rounded-xl border border-amber-500/30 bg-amber-500/8 px-4 py-3 text-sm text-amber-100", children: /* @__PURE__ */ jsxs18("div", { className: "flex items-start gap-2", children: [
57232
- /* @__PURE__ */ jsx22(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-300" }),
57243
+ return /* @__PURE__ */ jsx23("div", { className: "blade-chat-render-error rounded-xl border border-amber-500/30 bg-amber-500/8 px-4 py-3 text-sm text-amber-100", children: /* @__PURE__ */ jsxs18("div", { className: "flex items-start gap-2", children: [
57244
+ /* @__PURE__ */ jsx23(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-300" }),
57233
57245
  /* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1", children: [
57234
57246
  /* @__PURE__ */ jsxs18("div", { className: "font-medium", children: [
57235
57247
  label,
@@ -57239,15 +57251,15 @@ var RenderErrorBoundary = class extends Component2 {
57239
57251
  componentName ? `\u7EC4\u4EF6\uFF1A${componentName}\u3002` : null,
57240
57252
  error61.message || "\u53D1\u751F\u4E86\u672A\u9884\u671F\u7684\u6E32\u67D3\u9519\u8BEF\u3002"
57241
57253
  ] }),
57242
- details ? /* @__PURE__ */ jsx22("div", { className: "mt-1 truncate text-xs text-amber-100/55", children: details }) : null
57254
+ details ? /* @__PURE__ */ jsx23("div", { className: "mt-1 truncate text-xs text-amber-100/55", children: details }) : null
57243
57255
  ] })
57244
57256
  ] }) });
57245
57257
  }
57246
57258
  };
57247
57259
 
57248
57260
  // src/components/PostChatFollowupBlock.tsx
57249
- import { useCallback as useCallback28, useEffect as useEffect21, useRef as useRef25, useState as useState31 } from "react";
57250
- import { Fragment as Fragment8, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
57261
+ import { useCallback as useCallback28, useEffect as useEffect22, useRef as useRef25, useState as useState31 } from "react";
57262
+ import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
57251
57263
  function emitInteraction(callback, event) {
57252
57264
  try {
57253
57265
  callback?.(event);
@@ -57280,9 +57292,9 @@ function ArtifactCard({
57280
57292
  ${artifact.target}`,
57281
57293
  className: "group relative flex min-w-0 items-center gap-1.5 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2 py-1.5 text-xs text-[hsl(var(--card-foreground))] hover:bg-[hsl(var(--accent))]",
57282
57294
  children: [
57283
- /* @__PURE__ */ jsx23(Globe, { size: 15, className: "shrink-0 text-[hsl(var(--primary))]" }),
57284
- /* @__PURE__ */ jsx23("span", { className: "min-w-0 flex-1 truncate font-medium", children: name }),
57285
- /* @__PURE__ */ jsx23(ArrowUpRight, { size: 13, className: "absolute right-2 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100" })
57295
+ /* @__PURE__ */ jsx24(Globe, { size: 15, className: "shrink-0 text-[hsl(var(--primary))]" }),
57296
+ /* @__PURE__ */ jsx24("span", { className: "min-w-0 flex-1 truncate font-medium", children: name }),
57297
+ /* @__PURE__ */ jsx24(ArrowUpRight, { size: 13, className: "absolute right-2 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100" })
57286
57298
  ]
57287
57299
  }
57288
57300
  );
@@ -57317,7 +57329,7 @@ ${artifact.target}`,
57317
57329
  setDownloading(false);
57318
57330
  }
57319
57331
  };
57320
- return /* @__PURE__ */ jsx23(
57332
+ return /* @__PURE__ */ jsx24(
57321
57333
  "a",
57322
57334
  {
57323
57335
  href: downloadUrl,
@@ -57380,7 +57392,7 @@ function ResultFeedback({
57380
57392
  const reportedShown = useRef25(false);
57381
57393
  const latestChoice = useRef25(null);
57382
57394
  const eligible = followup.feedback_eligible === true && Boolean(sessionId) && !isViewer;
57383
- useEffect21(() => {
57395
+ useEffect22(() => {
57384
57396
  if (!eligible || reportedShown.current) return;
57385
57397
  reportedShown.current = true;
57386
57398
  emitInteraction(onInteraction, {
@@ -57389,7 +57401,7 @@ function ResultFeedback({
57389
57401
  assistantEntryId: followup.assistant_entry_id
57390
57402
  });
57391
57403
  }, [eligible, followup.assistant_entry_id, onInteraction, sessionId]);
57392
- useEffect21(() => {
57404
+ useEffect22(() => {
57393
57405
  if (!savedFeedback || latestChoice.current) return;
57394
57406
  setSaved(savedFeedback);
57395
57407
  setHelpful(savedFeedback.helpful);
@@ -57436,9 +57448,9 @@ function ResultFeedback({
57436
57448
  "aria-label": "\u7ED3\u679C\u53CD\u9988",
57437
57449
  className: "flex flex-col gap-2 border-t border-[hsl(var(--border))] pt-3",
57438
57450
  children: [
57439
- /* @__PURE__ */ jsx23("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u76EE\u524D\u7684\u6574\u4F53\u7ED3\u679C\u6709\u5E2E\u52A9\u5417\uFF1F" }),
57451
+ /* @__PURE__ */ jsx24("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u76EE\u524D\u7684\u6574\u4F53\u7ED3\u679C\u6709\u5E2E\u52A9\u5417\uFF1F" }),
57440
57452
  /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap gap-1.5", children: [
57441
- /* @__PURE__ */ jsx23(
57453
+ /* @__PURE__ */ jsx24(
57442
57454
  "button",
57443
57455
  {
57444
57456
  type: "button",
@@ -57449,7 +57461,7 @@ function ResultFeedback({
57449
57461
  children: "\u6709\u5E2E\u52A9"
57450
57462
  }
57451
57463
  ),
57452
- /* @__PURE__ */ jsx23(
57464
+ /* @__PURE__ */ jsx24(
57453
57465
  "button",
57454
57466
  {
57455
57467
  type: "button",
@@ -57461,7 +57473,7 @@ function ResultFeedback({
57461
57473
  }
57462
57474
  )
57463
57475
  ] }),
57464
- helpful === false ? /* @__PURE__ */ jsx23("div", { className: "flex flex-wrap gap-1.5", "aria-label": "\u6CA1\u5E2E\u52A9\u7684\u4E3B\u8981\u539F\u56E0", children: FEEDBACK_REASONS.map((item) => /* @__PURE__ */ jsx23(
57476
+ helpful === false ? /* @__PURE__ */ jsx24("div", { className: "flex flex-wrap gap-1.5", "aria-label": "\u6CA1\u5E2E\u52A9\u7684\u4E3B\u8981\u539F\u56E0", children: FEEDBACK_REASONS.map((item) => /* @__PURE__ */ jsx24(
57465
57477
  "button",
57466
57478
  {
57467
57479
  type: "button",
@@ -57474,8 +57486,8 @@ function ResultFeedback({
57474
57486
  item.value
57475
57487
  )) }) : null,
57476
57488
  saveError ? /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--destructive))]", children: [
57477
- /* @__PURE__ */ jsx23("span", { children: "\u53CD\u9988\u6682\u672A\u4FDD\u5B58\uFF0C\u53EF\u91CD\u8BD5" }),
57478
- /* @__PURE__ */ jsx23(
57489
+ /* @__PURE__ */ jsx24("span", { children: "\u53CD\u9988\u6682\u672A\u4FDD\u5B58\uFF0C\u53EF\u91CD\u8BD5" }),
57490
+ /* @__PURE__ */ jsx24(
57479
57491
  "button",
57480
57492
  {
57481
57493
  type: "button",
@@ -57487,7 +57499,7 @@ function ResultFeedback({
57487
57499
  children: "\u91CD\u8BD5"
57488
57500
  }
57489
57501
  )
57490
- ] }) : saved ? /* @__PURE__ */ jsx23("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u5DF2\u4FDD\u5B58\uFF0C\u53EF\u968F\u65F6\u4FEE\u6539" }) : null
57502
+ ] }) : saved ? /* @__PURE__ */ jsx24("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u5DF2\u4FDD\u5B58\uFF0C\u53EF\u968F\u65F6\u4FEE\u6539" }) : null
57491
57503
  ]
57492
57504
  }
57493
57505
  );
@@ -57510,7 +57522,7 @@ function PostChatFollowupBlock({
57510
57522
  const openedArtifacts = useRef25(/* @__PURE__ */ new Set());
57511
57523
  const artifacts = followup.final_artifacts ?? [];
57512
57524
  const visibleArtifacts = expanded ? artifacts : artifacts.slice(0, 3);
57513
- useEffect21(() => {
57525
+ useEffect22(() => {
57514
57526
  if (!reportedSuggestions.current && followup.suggestions.length > 0) {
57515
57527
  reportedSuggestions.current = true;
57516
57528
  emitInteraction(onInteraction, {
@@ -57567,12 +57579,12 @@ function PostChatFollowupBlock({
57567
57579
  children: [
57568
57580
  followup.recaption || artifacts.length > 0 ? /* @__PURE__ */ jsxs19("section", { "aria-label": "\u672C\u8F6E\u5C0F\u7ED3", className: "flex flex-col gap-2", children: [
57569
57581
  /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1.5 text-xs font-medium text-[hsl(var(--muted-foreground))]", children: [
57570
- /* @__PURE__ */ jsx23(Sparkles, { size: 14 }),
57582
+ /* @__PURE__ */ jsx24(Sparkles, { size: 14 }),
57571
57583
  "\u672C\u8F6E\u5C0F\u7ED3"
57572
57584
  ] }),
57573
- followup.recaption ? /* @__PURE__ */ jsx23("p", { className: "text-[13px] leading-5", children: followup.recaption }) : null,
57585
+ followup.recaption ? /* @__PURE__ */ jsx24("p", { className: "text-[13px] leading-5", children: followup.recaption }) : null,
57574
57586
  artifacts.length > 0 ? /* @__PURE__ */ jsxs19(Fragment8, { children: [
57575
- /* @__PURE__ */ jsx23("div", { className: "grid max-w-full grid-cols-3 gap-1.5", children: visibleArtifacts.map((artifact, artifactIndex) => /* @__PURE__ */ jsx23(
57587
+ /* @__PURE__ */ jsx24("div", { className: "grid max-w-full grid-cols-3 gap-1.5", children: visibleArtifacts.map((artifact, artifactIndex) => /* @__PURE__ */ jsx24(
57576
57588
  ArtifactCard,
57577
57589
  {
57578
57590
  artifact,
@@ -57593,14 +57605,14 @@ function PostChatFollowupBlock({
57593
57605
  className: "flex w-fit items-center gap-0.5 text-[11px] text-[hsl(var(--muted-foreground))]",
57594
57606
  children: [
57595
57607
  expanded ? "\u6536\u8D77" : `\u5C55\u5F00 ${artifacts.length - 3} \u4E2A`,
57596
- /* @__PURE__ */ jsx23(ChevronDown, { size: 13, className: expanded ? "rotate-180" : void 0 })
57608
+ /* @__PURE__ */ jsx24(ChevronDown, { size: 13, className: expanded ? "rotate-180" : void 0 })
57597
57609
  ]
57598
57610
  }
57599
57611
  ) : null
57600
57612
  ] }) : null
57601
57613
  ] }) : null,
57602
57614
  followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs19("section", { "aria-label": "\u4E0B\u4E00\u6B65\u5EFA\u8BAE", className: "flex flex-col gap-1.5", children: [
57603
- /* @__PURE__ */ jsx23("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
57615
+ /* @__PURE__ */ jsx24("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
57604
57616
  followup.suggestions.map((suggestion, suggestionIndex) => /* @__PURE__ */ jsxs19(
57605
57617
  "button",
57606
57618
  {
@@ -57624,14 +57636,14 @@ function PostChatFollowupBlock({
57624
57636
  suggestionClassName
57625
57637
  ),
57626
57638
  children: [
57627
- /* @__PURE__ */ jsx23("span", { children: suggestion }),
57628
- /* @__PURE__ */ jsx23(ArrowRight, { size: 14, className: "ml-auto shrink-0" })
57639
+ /* @__PURE__ */ jsx24("span", { children: suggestion }),
57640
+ /* @__PURE__ */ jsx24(ArrowRight, { size: 14, className: "ml-auto shrink-0" })
57629
57641
  ]
57630
57642
  },
57631
57643
  suggestion
57632
57644
  ))
57633
57645
  ] }) : null,
57634
- /* @__PURE__ */ jsx23(
57646
+ /* @__PURE__ */ jsx24(
57635
57647
  ResultFeedback,
57636
57648
  {
57637
57649
  followup,
@@ -57708,31 +57720,31 @@ function parseWhatIfPrompt(text4) {
57708
57720
  }
57709
57721
 
57710
57722
  // src/components/WhatIfUserBubble.tsx
57711
- import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
57723
+ import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
57712
57724
  function WhatIfUserBubble({ parsed, onQuoteClick }) {
57713
57725
  const { fromStep, quotes, userText } = parsed;
57714
57726
  return /* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-end gap-2", children: [
57715
57727
  /* @__PURE__ */ jsxs20("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: [
57716
- /* @__PURE__ */ jsx24(RefreshCcw, { size: 10 }),
57717
- /* @__PURE__ */ jsx24("span", { children: fromStep != null ? `\u91CD\u8DD1\u81EA step ${fromStep}` : "\u91CD\u8DD1" })
57728
+ /* @__PURE__ */ jsx25(RefreshCcw, { size: 10 }),
57729
+ /* @__PURE__ */ jsx25("span", { children: fromStep != null ? `\u91CD\u8DD1\u81EA step ${fromStep}` : "\u91CD\u8DD1" })
57718
57730
  ] }),
57719
- quotes.length > 0 && /* @__PURE__ */ jsx24("div", { className: "flex max-w-[min(72vw,42rem)] flex-col items-stretch gap-2", children: quotes.map((quote, index2) => {
57731
+ quotes.length > 0 && /* @__PURE__ */ jsx25("div", { className: "flex max-w-[min(72vw,42rem)] flex-col items-stretch gap-2", children: quotes.map((quote, index2) => {
57720
57732
  const clickable = quote.stepNumber != null && !!onQuoteClick;
57721
57733
  const label = quote.stepNumber != null ? `\u6B65\u9AA4${quote.stepNumber} \xB7 ${quote.label}` : quote.label;
57722
57734
  return /* @__PURE__ */ jsxs20("div", { className: "rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.8)] px-3 py-2 text-left", children: [
57723
57735
  /* @__PURE__ */ jsxs20("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: [
57724
- /* @__PURE__ */ jsx24("span", { children: "\u21B3" }),
57725
- /* @__PURE__ */ jsx24("span", { className: "truncate", children: label })
57736
+ /* @__PURE__ */ jsx25("span", { children: "\u21B3" }),
57737
+ /* @__PURE__ */ jsx25("span", { className: "truncate", children: label })
57726
57738
  ] }),
57727
- quote.snapshot ? /* @__PURE__ */ jsx24("div", { className: "mt-1 border-l-2 border-[hsl(var(--accent-foreground)/0.35)] pl-2 text-xs leading-relaxed text-[hsl(var(--foreground)/0.8)]", children: /* @__PURE__ */ jsx24(MarkdownContent, { className: "blade-chat-prose", children: quote.snapshot }) }) : null
57739
+ quote.snapshot ? /* @__PURE__ */ jsx25("div", { className: "mt-1 border-l-2 border-[hsl(var(--accent-foreground)/0.35)] pl-2 text-xs leading-relaxed text-[hsl(var(--foreground)/0.8)]", children: /* @__PURE__ */ jsx25(MarkdownContent, { className: "blade-chat-prose", children: quote.snapshot }) }) : null
57728
57740
  ] }, `${quote.stepNumber ?? "x"}-${index2}`);
57729
57741
  }) }),
57730
- userText && /* @__PURE__ */ jsx24("div", { className: "rounded-2xl border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-4 py-2.5 text-sm leading-relaxed text-[hsl(var(--user-msg-fg))]", children: /* @__PURE__ */ jsx24(MarkdownContent, { className: "blade-chat-prose", children: userText }) })
57742
+ userText && /* @__PURE__ */ jsx25("div", { className: "rounded-2xl border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-4 py-2.5 text-sm leading-relaxed text-[hsl(var(--user-msg-fg))]", children: /* @__PURE__ */ jsx25(MarkdownContent, { className: "blade-chat-prose", children: userText }) })
57731
57743
  ] });
57732
57744
  }
57733
57745
 
57734
57746
  // src/components/UserMessageBubble.tsx
57735
- import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
57747
+ import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
57736
57748
  function isUserMessage(message) {
57737
57749
  return message.role === "user";
57738
57750
  }
@@ -57747,17 +57759,17 @@ function UserMessageBubble({ message, classNames, renderers }) {
57747
57759
  const whatifParsed = text4 && imageParts.length === 0 && fileParts.length === 0 ? parseWhatIfPrompt(text4) : null;
57748
57760
  const customBubble = renderers?.userMessage?.({ message });
57749
57761
  if (whatifParsed) {
57750
- return /* @__PURE__ */ jsx25("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", classNames?.userMessage), children: /* @__PURE__ */ jsx25("div", { className: "blade-chat-user-col flex max-w-[72%] flex-col items-end gap-3", children: customBubble ?? /* @__PURE__ */ jsx25(
57762
+ return /* @__PURE__ */ jsx26("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", classNames?.userMessage), children: /* @__PURE__ */ jsx26("div", { className: "blade-chat-user-col flex max-w-[72%] flex-col items-end gap-3", children: customBubble ?? /* @__PURE__ */ jsx26(
57751
57763
  "div",
57752
57764
  {
57753
57765
  part: "user-bubble",
57754
57766
  className: cn("blade-chat-user-bubble", classNames?.userBubble),
57755
- children: /* @__PURE__ */ jsx25(WhatIfUserBubble, { parsed: whatifParsed })
57767
+ children: /* @__PURE__ */ jsx26(WhatIfUserBubble, { parsed: whatifParsed })
57756
57768
  }
57757
57769
  ) }) });
57758
57770
  }
57759
- return /* @__PURE__ */ jsx25("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", classNames?.userMessage), children: /* @__PURE__ */ jsxs21("div", { className: "blade-chat-user-col flex max-w-[72%] flex-col items-end gap-3", children: [
57760
- imageParts.length > 0 && /* @__PURE__ */ jsx25("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx25(
57771
+ return /* @__PURE__ */ jsx26("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", classNames?.userMessage), children: /* @__PURE__ */ jsxs21("div", { className: "blade-chat-user-col flex max-w-[72%] flex-col items-end gap-3", children: [
57772
+ imageParts.length > 0 && /* @__PURE__ */ jsx26("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx26(
57761
57773
  "img",
57762
57774
  {
57763
57775
  src: part.image_url.url,
@@ -57766,7 +57778,7 @@ function UserMessageBubble({ message, classNames, renderers }) {
57766
57778
  },
57767
57779
  part.image_url.url
57768
57780
  )) }),
57769
- fileParts.length > 0 && /* @__PURE__ */ jsx25("div", { className: "flex flex-col items-end gap-1.5", children: fileParts.map((part) => /* @__PURE__ */ jsxs21(
57781
+ fileParts.length > 0 && /* @__PURE__ */ jsx26("div", { className: "flex flex-col items-end gap-1.5", children: fileParts.map((part) => /* @__PURE__ */ jsxs21(
57770
57782
  "div",
57771
57783
  {
57772
57784
  part: "file-card",
@@ -57775,13 +57787,13 @@ function UserMessageBubble({ message, classNames, renderers }) {
57775
57787
  classNames?.fileCard
57776
57788
  ),
57777
57789
  children: [
57778
- /* @__PURE__ */ jsx25(FileText, { size: 12, className: "blade-chat-file-card-icon shrink-0" }),
57779
- /* @__PURE__ */ jsx25("span", { className: "blade-chat-file-card-name max-w-56 truncate", title: part.name, children: part.name })
57790
+ /* @__PURE__ */ jsx26(FileText, { size: 12, className: "blade-chat-file-card-icon shrink-0" }),
57791
+ /* @__PURE__ */ jsx26("span", { className: "blade-chat-file-card-name max-w-56 truncate", title: part.name, children: part.name })
57780
57792
  ]
57781
57793
  },
57782
57794
  `${part.name}-${part.data.length}`
57783
57795
  )) }),
57784
- text4 && (customBubble ?? /* @__PURE__ */ jsx25(
57796
+ text4 && (customBubble ?? /* @__PURE__ */ jsx26(
57785
57797
  "div",
57786
57798
  {
57787
57799
  part: "user-bubble",
@@ -57789,12 +57801,12 @@ function UserMessageBubble({ message, classNames, renderers }) {
57789
57801
  "blade-chat-user-bubble max-w-full rounded-[20px] rounded-br-[6px] border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-[18px] py-[13px] text-sm leading-[1.65] text-[hsl(var(--user-msg-fg))]",
57790
57802
  classNames?.userBubble
57791
57803
  ),
57792
- children: /* @__PURE__ */ jsx25(MarkdownContent, { className: "blade-chat-prose", children: text4 })
57804
+ children: /* @__PURE__ */ jsx26(MarkdownContent, { className: "blade-chat-prose", children: text4 })
57793
57805
  }
57794
57806
  )),
57795
57807
  text4 && isSending(message) && /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1 pr-1 text-[11px] font-medium text-[hsl(var(--muted-foreground))/0.85]", children: [
57796
- /* @__PURE__ */ jsx25(LoaderCircle, { size: 11, className: "animate-spin", "aria-hidden": "true" }),
57797
- /* @__PURE__ */ jsx25("span", { children: "\u53D1\u9001\u4E2D" })
57808
+ /* @__PURE__ */ jsx26(LoaderCircle, { size: 11, className: "animate-spin", "aria-hidden": "true" }),
57809
+ /* @__PURE__ */ jsx26("span", { children: "\u53D1\u9001\u4E2D" })
57798
57810
  ] })
57799
57811
  ] }) });
57800
57812
  }
@@ -57803,11 +57815,11 @@ function ErrorMessageBlock({
57803
57815
  className
57804
57816
  }) {
57805
57817
  const text4 = chatErrorForDisplay(getTextContent3(message.content));
57806
- return /* @__PURE__ */ jsx25("div", { part: "error-row", className: cn("blade-chat-error-row flex min-w-0 justify-start", className), children: /* @__PURE__ */ jsx25("div", { className: "blade-chat-error-block 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: text4 }) });
57818
+ return /* @__PURE__ */ jsx26("div", { part: "error-row", className: cn("blade-chat-error-row flex min-w-0 justify-start", className), children: /* @__PURE__ */ jsx26("div", { className: "blade-chat-error-block 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: text4 }) });
57807
57819
  }
57808
57820
 
57809
57821
  // src/components/MessageList.tsx
57810
- import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
57822
+ import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
57811
57823
  function parseModeChange(message) {
57812
57824
  if (message.kind !== "mode_change" || typeof message.content !== "string") {
57813
57825
  return null;
@@ -57885,10 +57897,10 @@ function MessageList({
57885
57897
  const contentReveal = useTypewriterReveal(revealContentText, isRevealLive, revealTargetKey);
57886
57898
  const reasoningReveal = useTypewriterReveal(revealReasoningText, isRevealLive, revealTargetKey);
57887
57899
  const isRevealingAny = contentReveal.isRevealing || reasoningReveal.isRevealing;
57888
- useEffect22(() => {
57900
+ useEffect23(() => {
57889
57901
  onRevealingChange?.(isRevealingAny);
57890
57902
  }, [isRevealingAny, onRevealingChange]);
57891
- useEffect22(() => {
57903
+ useEffect23(() => {
57892
57904
  if (isStopping) {
57893
57905
  contentReveal.flushNow();
57894
57906
  reasoningReveal.flushNow();
@@ -58005,8 +58017,8 @@ function MessageList({
58005
58017
  part: "messages",
58006
58018
  className: cn("blade-chat-messages relative min-h-0 flex-1", classNames?.messageList),
58007
58019
  children: [
58008
- isStreaming || isRevealingAny ? /* @__PURE__ */ jsx26("output", { className: "sr-only", children: "\u6B63\u5728\u751F\u6210\u56DE\u590D" }) : null,
58009
- /* @__PURE__ */ jsx26(
58020
+ isStreaming || isRevealingAny ? /* @__PURE__ */ jsx27("output", { className: "sr-only", children: "\u6B63\u5728\u751F\u6210\u56DE\u590D" }) : null,
58021
+ /* @__PURE__ */ jsx27(
58010
58022
  TurnNavRail,
58011
58023
  {
58012
58024
  items: turnNavItems,
@@ -58024,23 +58036,23 @@ function MessageList({
58024
58036
  initial: "instant",
58025
58037
  resize: "instant",
58026
58038
  children: [
58027
- /* @__PURE__ */ jsx26(StickToBottom.Content, { part: "messages-scroll", className: cn("blade-chat-messages-scroll", classNames?.messagesScroll), children: /* @__PURE__ */ jsxs22("div", { part: "messages-content", className: cn("blade-chat-messages-content mx-auto max-w-[748px]", classNames?.messagesContent), children: [
58028
- historyPaging && (historyPaging.hasOlder || historyPaging.loading) ? /* @__PURE__ */ jsx26(LoadOlderSentinel, { ...historyPaging }) : null,
58039
+ /* @__PURE__ */ jsx27(StickToBottom.Content, { part: "messages-scroll", className: cn("blade-chat-messages-scroll", classNames?.messagesScroll), children: /* @__PURE__ */ jsxs22("div", { part: "messages-content", className: cn("blade-chat-messages-content mx-auto max-w-[748px]", classNames?.messagesContent), children: [
58040
+ historyPaging && (historyPaging.hasOlder || historyPaging.loading) ? /* @__PURE__ */ jsx27(LoadOlderSentinel, { ...historyPaging }) : null,
58029
58041
  /* @__PURE__ */ jsxs22("div", { className: "flex min-w-0 flex-col", children: [
58030
58042
  renderBlocks.length === 0 ? emptyState ?? /* @__PURE__ */ jsxs22("div", { part: "empty", className: cn("blade-chat-empty", classNames?.empty), children: [
58031
- /* @__PURE__ */ jsx26(MessageSquare, { size: 40, strokeWidth: 1.5 }),
58032
- /* @__PURE__ */ jsx26("span", { className: "text-base font-medium", children: "\u5F00\u59CB\u5BF9\u8BDD" }),
58033
- /* @__PURE__ */ jsx26("span", { className: "text-sm opacity-60", children: "\u5728\u4E0B\u65B9\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u804A\u5929" })
58043
+ /* @__PURE__ */ jsx27(MessageSquare, { size: 40, strokeWidth: 1.5 }),
58044
+ /* @__PURE__ */ jsx27("span", { className: "text-base font-medium", children: "\u5F00\u59CB\u5BF9\u8BDD" }),
58045
+ /* @__PURE__ */ jsx27("span", { className: "text-sm opacity-60", children: "\u5728\u4E0B\u65B9\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u804A\u5929" })
58034
58046
  ] }) : renderBlocks.map((block) => {
58035
58047
  if (block.type === "message") {
58036
- return /* @__PURE__ */ jsx26("div", { "data-entry-id": block.message.entry_id, children: isUserMessage(block.message) ? /* @__PURE__ */ jsx26(
58048
+ return /* @__PURE__ */ jsx27("div", { "data-entry-id": block.message.entry_id, children: isUserMessage(block.message) ? /* @__PURE__ */ jsx27(
58037
58049
  UserMessageBubble,
58038
58050
  {
58039
58051
  message: block.message,
58040
58052
  classNames,
58041
58053
  renderers
58042
58054
  }
58043
- ) : isErrorMessage(block.message) ? /* @__PURE__ */ jsx26(
58055
+ ) : isErrorMessage(block.message) ? /* @__PURE__ */ jsx27(
58044
58056
  ErrorMessageBlock,
58045
58057
  {
58046
58058
  message: block.message,
@@ -58058,14 +58070,14 @@ function MessageList({
58058
58070
  (message) => message.entry_id === postChatFollowup.assistant_entry_id
58059
58071
  )
58060
58072
  );
58061
- return /* @__PURE__ */ jsx26("div", { "data-entry-id": displayMessages[0]?.entry_id, children: /* @__PURE__ */ jsxs22(
58073
+ return /* @__PURE__ */ jsx27("div", { "data-entry-id": displayMessages[0]?.entry_id, children: /* @__PURE__ */ jsxs22(
58062
58074
  RenderErrorBoundary,
58063
58075
  {
58064
58076
  label: "\u52A9\u624B\u6D88\u606F",
58065
58077
  details: block.key,
58066
58078
  resetKey: getMessageResetSignature(displayMessages),
58067
58079
  children: [
58068
- /* @__PURE__ */ jsx26(
58080
+ /* @__PURE__ */ jsx27(
58069
58081
  AssistantTurnBlock,
58070
58082
  {
58071
58083
  messages: displayMessages,
@@ -58079,8 +58091,8 @@ function MessageList({
58079
58091
  sessionId
58080
58092
  }
58081
58093
  ),
58082
- blockFeedback && !hasActiveFollowup ? /* @__PURE__ */ jsx26(HistoricalResultFeedback, { feedback: blockFeedback }) : null,
58083
- hasActiveFollowup && postChatFollowup ? /* @__PURE__ */ jsx26(
58094
+ blockFeedback && !hasActiveFollowup ? /* @__PURE__ */ jsx27(HistoricalResultFeedback, { feedback: blockFeedback }) : null,
58095
+ hasActiveFollowup && postChatFollowup ? /* @__PURE__ */ jsx27(
58084
58096
  PostChatFollowupBlock,
58085
58097
  {
58086
58098
  followup: postChatFollowup,
@@ -58104,19 +58116,19 @@ function MessageList({
58104
58116
  {
58105
58117
  className: "flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]",
58106
58118
  children: [
58107
- /* @__PURE__ */ jsx26(Layers, { size: 12 }),
58108
- /* @__PURE__ */ jsx26("span", { children: "\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29" })
58119
+ /* @__PURE__ */ jsx27(Layers, { size: 12 }),
58120
+ /* @__PURE__ */ jsx27("span", { children: "\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29" })
58109
58121
  ]
58110
58122
  },
58111
58123
  block.key
58112
58124
  );
58113
58125
  }
58114
- return /* @__PURE__ */ jsx26(PlanningDivider, { kind: block.kind }, block.key);
58126
+ return /* @__PURE__ */ jsx27(PlanningDivider, { kind: block.kind }, block.key);
58115
58127
  }),
58116
- sessionStatus === "interrupted" && !isStreaming ? /* @__PURE__ */ jsx26("div", { className: "flex", children: /* @__PURE__ */ jsx26("div", { className: "rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.12em] text-amber-300", children: "\u5DF2\u4E2D\u65AD" }) }) : null
58128
+ sessionStatus === "interrupted" && !isStreaming ? /* @__PURE__ */ jsx27("div", { className: "flex", children: /* @__PURE__ */ jsx27("div", { className: "rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.12em] text-amber-300", children: "\u5DF2\u4E2D\u65AD" }) }) : null
58117
58129
  ] })
58118
58130
  ] }) }),
58119
- /* @__PURE__ */ jsx26(
58131
+ /* @__PURE__ */ jsx27(
58120
58132
  PinLatestUserMessage,
58121
58133
  {
58122
58134
  userMessageCount: userMessages.length,
@@ -58126,9 +58138,9 @@ function MessageList({
58126
58138
  },
58127
58139
  sessionId ?? "no-session"
58128
58140
  ),
58129
- /* @__PURE__ */ jsx26(ScrollToBottomButton, { className: classNames?.scrollToBottom }),
58130
- /* @__PURE__ */ jsx26(StopAutoScrollBridge, { stopRef: stopAutoScrollRef }),
58131
- /* @__PURE__ */ jsx26(
58141
+ /* @__PURE__ */ jsx27(ScrollToBottomButton, { className: classNames?.scrollToBottom }),
58142
+ /* @__PURE__ */ jsx27(StopAutoScrollBridge, { stopRef: stopAutoScrollRef }),
58143
+ /* @__PURE__ */ jsx27(
58132
58144
  ViewportTurnBridge,
58133
58145
  {
58134
58146
  rootRef,
@@ -58153,7 +58165,7 @@ function LoadOlderSentinel({
58153
58165
  const sentinelRef = useRef26(null);
58154
58166
  const stateRef = useRef26({ hasOlder, loading, loadOlder });
58155
58167
  stateRef.current = { hasOlder, loading, loadOlder };
58156
- useEffect22(() => {
58168
+ useEffect23(() => {
58157
58169
  const sentinel = sentinelRef.current;
58158
58170
  const scroller = scrollRef.current;
58159
58171
  if (!sentinel || !scroller || typeof IntersectionObserver === "undefined") return;
@@ -58212,7 +58224,7 @@ function LoadOlderSentinel({
58212
58224
  observer.disconnect();
58213
58225
  };
58214
58226
  }, [contentRef, scrollRef]);
58215
- return /* @__PURE__ */ jsx26("div", { ref: sentinelRef, "data-history-sentinel": true, className: "flex h-6 items-center justify-center", children: loading ? /* @__PURE__ */ jsx26("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026" }) : null });
58227
+ return /* @__PURE__ */ jsx27("div", { ref: sentinelRef, "data-history-sentinel": true, className: "flex h-6 items-center justify-center", children: loading ? /* @__PURE__ */ jsx27("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026" }) : null });
58216
58228
  }
58217
58229
  function PinLatestUserMessage({
58218
58230
  userMessageCount,
@@ -58264,7 +58276,7 @@ function PinLatestUserMessage({
58264
58276
  stopAutoScroll: stopScroll,
58265
58277
  scrollToBottom
58266
58278
  });
58267
- useEffect22(() => {
58279
+ useEffect23(() => {
58268
58280
  if (userMessageCount > previousCountRef.current && !shouldPinLatestUser) {
58269
58281
  scrollToBottom("instant");
58270
58282
  }
@@ -58276,7 +58288,7 @@ function ScrollToBottomButton({ className }) {
58276
58288
  const { isAtBottom, scrollToBottom } = useStickToBottomContext();
58277
58289
  const [visible, setVisible] = useState32(false);
58278
58290
  const hideTimerRef = useRef26(null);
58279
- useEffect22(() => {
58291
+ useEffect23(() => {
58280
58292
  if (isAtBottom) {
58281
58293
  if (!hideTimerRef.current) {
58282
58294
  hideTimerRef.current = setTimeout(() => {
@@ -58319,20 +58331,20 @@ function ScrollToBottomButton({ className }) {
58319
58331
  className
58320
58332
  ),
58321
58333
  children: [
58322
- /* @__PURE__ */ jsx26(ChevronDown, { size: 14 }),
58323
- /* @__PURE__ */ jsx26("span", { className: "blade-chat-scroll-bottom-label", children: "\u6EDA\u52A8\u5230\u5E95\u90E8" })
58334
+ /* @__PURE__ */ jsx27(ChevronDown, { size: 14 }),
58335
+ /* @__PURE__ */ jsx27("span", { className: "blade-chat-scroll-bottom-label", children: "\u6EDA\u52A8\u5230\u5E95\u90E8" })
58324
58336
  ]
58325
58337
  }
58326
58338
  );
58327
58339
  }
58328
58340
  function PlanningDivider({ kind }) {
58329
58341
  return /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-3 py-1", children: [
58330
- /* @__PURE__ */ jsx26("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" }),
58342
+ /* @__PURE__ */ jsx27("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" }),
58331
58343
  /* @__PURE__ */ jsxs22("div", { className: "inline-flex items-center gap-1.5 rounded-full border border-amber-500/30 bg-amber-500/10 px-3 py-1 text-[11px] text-amber-300", children: [
58332
- /* @__PURE__ */ jsx26(Lightbulb, { size: 12 }),
58333
- /* @__PURE__ */ jsx26("span", { children: kind === "enter" ? "\u8FDB\u5165\u89C4\u5212\u6A21\u5F0F" : "\u89C4\u5212\u5B8C\u6210" })
58344
+ /* @__PURE__ */ jsx27(Lightbulb, { size: 12 }),
58345
+ /* @__PURE__ */ jsx27("span", { children: kind === "enter" ? "\u8FDB\u5165\u89C4\u5212\u6A21\u5F0F" : "\u89C4\u5212\u5B8C\u6210" })
58334
58346
  ] }),
58335
- /* @__PURE__ */ jsx26("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" })
58347
+ /* @__PURE__ */ jsx27("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" })
58336
58348
  ] });
58337
58349
  }
58338
58350
  function findEntryRow(root, entryId) {
@@ -58350,11 +58362,11 @@ function ViewportTurnBridge({
58350
58362
  const { scrollRef } = useStickToBottomContext();
58351
58363
  const itemsRef = useRef26(items);
58352
58364
  const updateRef = useRef26(null);
58353
- useEffect22(() => {
58365
+ useEffect23(() => {
58354
58366
  itemsRef.current = items;
58355
58367
  updateRef.current?.();
58356
58368
  }, [items]);
58357
- useEffect22(() => {
58369
+ useEffect23(() => {
58358
58370
  const scroller = scrollRef.current;
58359
58371
  const root = rootRef.current;
58360
58372
  if (!scroller || !root) return;
@@ -58398,7 +58410,7 @@ function ViewportTurnBridge({
58398
58410
  var VIEWPORT_ACTIVE_OFFSET = 8;
58399
58411
  function StopAutoScrollBridge({ stopRef }) {
58400
58412
  const { stopScroll } = useStickToBottomContext();
58401
- useEffect22(() => {
58413
+ useEffect23(() => {
58402
58414
  stopRef.current = stopScroll;
58403
58415
  return () => {
58404
58416
  stopRef.current = null;
@@ -58408,7 +58420,7 @@ function StopAutoScrollBridge({ stopRef }) {
58408
58420
  }
58409
58421
 
58410
58422
  // src/components/ChatSurface.tsx
58411
- import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
58423
+ import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
58412
58424
  function themeAttr(theme) {
58413
58425
  return theme === "dark" ? "dark" : void 0;
58414
58426
  }
@@ -58466,7 +58478,7 @@ ${item.content}`), text4].filter(Boolean).join("\n\n");
58466
58478
  return current ? parsePlanUpdate(current.arguments) : null;
58467
58479
  }, [messages, renderers?.planUpdate]);
58468
58480
  const customPlan = planForRenderer ? renderers?.planUpdate?.({ plan: planForRenderer, running: isStreaming, sessionId }) : void 0;
58469
- return /* @__PURE__ */ jsx27(McpAppMessageContext.Provider, { value: (message) => {
58481
+ return /* @__PURE__ */ jsx28(McpAppMessageContext.Provider, { value: (message) => {
58470
58482
  if (!sessionId || message.sessionId !== sessionId || isViewer) throw new Error("\u5F53\u524D\u4F1A\u8BDD\u4E0D\u80FD\u63A5\u6536\u5E94\u7528\u6D88\u606F");
58471
58483
  setPending((items) => [...items, { ...message, sessionId, id: randomId() }]);
58472
58484
  }, children: /* @__PURE__ */ jsxs23(
@@ -58479,7 +58491,7 @@ ${item.content}`), text4].filter(Boolean).join("\n\n");
58479
58491
  classNames?.root
58480
58492
  ),
58481
58493
  children: [
58482
- /* @__PURE__ */ jsx27(ConnectionBanner, { connection, className: classNames?.banner }),
58494
+ /* @__PURE__ */ jsx28(ConnectionBanner, { connection, className: classNames?.banner }),
58483
58495
  banner,
58484
58496
  errorMessage && /* @__PURE__ */ jsxs23(
58485
58497
  "div",
@@ -58487,13 +58499,13 @@ ${item.content}`), text4].filter(Boolean).join("\n\n");
58487
58499
  part: "error-bar",
58488
58500
  className: cn("blade-chat-error-bar flex items-start gap-2 border-b px-4 py-3 text-sm", classNames?.errorBar),
58489
58501
  children: [
58490
- /* @__PURE__ */ jsx27(CircleAlert, { size: 16, className: "mt-0.5 shrink-0" }),
58491
- /* @__PURE__ */ jsx27("span", { className: "min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]", children: chatErrorForDisplay2(errorMessage) })
58502
+ /* @__PURE__ */ jsx28(CircleAlert, { size: 16, className: "mt-0.5 shrink-0" }),
58503
+ /* @__PURE__ */ jsx28("span", { className: "min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]", children: chatErrorForDisplay2(errorMessage) })
58492
58504
  ]
58493
58505
  }
58494
58506
  ),
58495
58507
  slots?.header,
58496
- /* @__PURE__ */ jsx27(
58508
+ /* @__PURE__ */ jsx28(
58497
58509
  MessageList,
58498
58510
  {
58499
58511
  messages,
@@ -58519,7 +58531,7 @@ ${item.content}`), text4].filter(Boolean).join("\n\n");
58519
58531
  turnNavigation
58520
58532
  }
58521
58533
  ),
58522
- showPlanUpdates ? customPlan ?? /* @__PURE__ */ jsx27(
58534
+ showPlanUpdates ? customPlan ?? /* @__PURE__ */ jsx28(
58523
58535
  CurrentPlanPanel,
58524
58536
  {
58525
58537
  messages,
@@ -58530,15 +58542,15 @@ ${item.content}`), text4].filter(Boolean).join("\n\n");
58530
58542
  }
58531
58543
  ) : null,
58532
58544
  beforeInput,
58533
- /* @__PURE__ */ jsx27(QueuePanelAdjacencyContext.Provider, { value: currentPending.length === 0, children: queuePanel }),
58545
+ /* @__PURE__ */ jsx28(QueuePanelAdjacencyContext.Provider, { value: currentPending.length === 0, children: queuePanel }),
58534
58546
  currentPending.map((item) => /* @__PURE__ */ jsxs23("div", { style: { display: "flex", gap: 8, padding: "8px 16px" }, children: [
58535
58547
  /* @__PURE__ */ jsxs23("details", { style: { flex: 1, minWidth: 0 }, children: [
58536
- /* @__PURE__ */ jsx27("summary", { children: item.label }),
58537
- /* @__PURE__ */ jsx27("pre", { style: { whiteSpace: "pre-wrap", overflowWrap: "anywhere" }, children: item.content })
58548
+ /* @__PURE__ */ jsx28("summary", { children: item.label }),
58549
+ /* @__PURE__ */ jsx28("pre", { style: { whiteSpace: "pre-wrap", overflowWrap: "anywhere" }, children: item.content })
58538
58550
  ] }),
58539
- /* @__PURE__ */ jsx27("button", { type: "button", "aria-label": "\u79FB\u9664\u5F85\u53D1\u9001\u5185\u5BB9", title: "\u79FB\u9664", onClick: () => setPending((items) => items.filter((other) => other.id !== item.id)), children: /* @__PURE__ */ jsx27(X, { size: 16 }) })
58551
+ /* @__PURE__ */ jsx28("button", { type: "button", "aria-label": "\u79FB\u9664\u5F85\u53D1\u9001\u5185\u5BB9", title: "\u79FB\u9664", onClick: () => setPending((items) => items.filter((other) => other.id !== item.id)), children: /* @__PURE__ */ jsx28(X, { size: 16 }) })
58540
58552
  ] }, item.id)),
58541
- /* @__PURE__ */ jsx27(
58553
+ /* @__PURE__ */ jsx28(
58542
58554
  ChatInput,
58543
58555
  {
58544
58556
  value: inputText,
@@ -58565,7 +58577,7 @@ ${item.content}`), text4].filter(Boolean).join("\n\n");
58565
58577
  }
58566
58578
 
58567
58579
  // src/components/AgentChat.tsx
58568
- import { Fragment as Fragment9, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
58580
+ import { Fragment as Fragment9, jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
58569
58581
  function isUnauthorizedError(error61) {
58570
58582
  return error61 instanceof BladeApiError2 && error61.status === 401;
58571
58583
  }
@@ -58584,11 +58596,11 @@ function LoginCard({ client, onLoggedIn }) {
58584
58596
  setLoggingIn(false);
58585
58597
  }
58586
58598
  };
58587
- return /* @__PURE__ */ jsx28("div", { className: "blade-chat-login flex flex-1 items-center justify-center p-6", children: /* @__PURE__ */ jsxs24("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: [
58588
- /* @__PURE__ */ jsx28(LockKeyhole, { size: 28, className: "text-[hsl(var(--muted-foreground))]" }),
58589
- /* @__PURE__ */ jsx28("div", { className: "text-base font-medium text-[hsl(var(--foreground))]", children: "\u9700\u8981\u767B\u5F55\u540E\u4F7F\u7528" }),
58590
- /* @__PURE__ */ jsx28("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" }),
58591
- /* @__PURE__ */ jsx28(
58599
+ return /* @__PURE__ */ jsx29("div", { className: "blade-chat-login flex flex-1 items-center justify-center p-6", children: /* @__PURE__ */ jsxs24("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: [
58600
+ /* @__PURE__ */ jsx29(LockKeyhole, { size: 28, className: "text-[hsl(var(--muted-foreground))]" }),
58601
+ /* @__PURE__ */ jsx29("div", { className: "text-base font-medium text-[hsl(var(--foreground))]", children: "\u9700\u8981\u767B\u5F55\u540E\u4F7F\u7528" }),
58602
+ /* @__PURE__ */ jsx29("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" }),
58603
+ /* @__PURE__ */ jsx29(
58592
58604
  "button",
58593
58605
  {
58594
58606
  type: "button",
@@ -58598,7 +58610,7 @@ function LoginCard({ client, onLoggedIn }) {
58598
58610
  children: loggingIn ? "\u767B\u5F55\u4E2D\u2026" : "\u767B\u5F55"
58599
58611
  }
58600
58612
  ),
58601
- loginError && /* @__PURE__ */ jsx28("div", { className: "text-xs text-[hsl(var(--destructive))]", children: loginError })
58613
+ loginError && /* @__PURE__ */ jsx29("div", { className: "text-xs text-[hsl(var(--destructive))]", children: loginError })
58602
58614
  ] }) });
58603
58615
  }
58604
58616
  function AgentChat(props) {
@@ -58606,13 +58618,13 @@ function AgentChat(props) {
58606
58618
  const [attempt, setAttempt] = useState34(0);
58607
58619
  const [needLogin, setNeedLogin] = useState34(() => !client.hasToken());
58608
58620
  if (needLogin) {
58609
- return /* @__PURE__ */ jsx28(
58621
+ return /* @__PURE__ */ jsx29(
58610
58622
  "div",
58611
58623
  {
58612
58624
  "data-theme": themeAttr(props.theme),
58613
58625
  part: "root",
58614
58626
  className: cn("blade-chat flex min-h-0 flex-1 flex-col", props.classNames?.root),
58615
- children: /* @__PURE__ */ jsx28(
58627
+ children: /* @__PURE__ */ jsx29(
58616
58628
  LoginCard,
58617
58629
  {
58618
58630
  client,
@@ -58625,7 +58637,7 @@ function AgentChat(props) {
58625
58637
  }
58626
58638
  );
58627
58639
  }
58628
- return /* @__PURE__ */ jsx28(ChatSessionView, { ...props, onUnauthorized: () => setNeedLogin(true) }, attempt);
58640
+ return /* @__PURE__ */ jsx29(ChatSessionView, { ...props, onUnauthorized: () => setNeedLogin(true) }, attempt);
58629
58641
  }
58630
58642
  function ChatSessionView({
58631
58643
  sessionId,
@@ -58678,10 +58690,10 @@ function ChatSessionView({
58678
58690
  const onSessionReadyRef = useRef27(onSessionReady);
58679
58691
  const readySessionRef = useRef27(null);
58680
58692
  const hasOnSessionReady = onSessionReady !== void 0;
58681
- useEffect23(() => {
58693
+ useEffect24(() => {
58682
58694
  onSessionReadyRef.current = onSessionReady;
58683
58695
  }, [onSessionReady]);
58684
- useEffect23(() => {
58696
+ useEffect24(() => {
58685
58697
  setResultFeedback([]);
58686
58698
  if (!resolvedSessionId || isViewer) return;
58687
58699
  let cancelled = false;
@@ -58716,13 +58728,13 @@ function ChatSessionView({
58716
58728
  saved
58717
58729
  ]);
58718
58730
  }, []);
58719
- useEffect23(() => {
58731
+ useEffect24(() => {
58720
58732
  const handler = onSessionReadyRef.current;
58721
58733
  if (!session || !hasOnSessionReady || !handler || readySessionRef.current === session) return;
58722
58734
  readySessionRef.current = session;
58723
58735
  handler(session);
58724
58736
  }, [session, hasOnSessionReady]);
58725
- useEffect23(() => {
58737
+ useEffect24(() => {
58726
58738
  if (!session) return;
58727
58739
  const offAttach = session.on("attachRequested", ({ label, content: content3 }) => {
58728
58740
  setInputText((prev) => `${prev ? `${prev}
@@ -58742,12 +58754,12 @@ ${content3}`);
58742
58754
  offRewind();
58743
58755
  };
58744
58756
  }, [session]);
58745
- useEffect23(() => {
58757
+ useEffect24(() => {
58746
58758
  if (isUnauthorizedError(error61)) {
58747
58759
  onUnauthorized();
58748
58760
  }
58749
58761
  }, [error61, onUnauthorized]);
58750
- useEffect23(() => {
58762
+ useEffect24(() => {
58751
58763
  if (!session || !commands) return;
58752
58764
  const unsubscribes = Object.entries(commands).map(
58753
58765
  ([action, handler]) => session.onCommand(action, (payload) => handler(payload))
@@ -58813,7 +58825,7 @@ ${content3}`);
58813
58825
  next[to] = item.id;
58814
58826
  handleQueueReorder(next);
58815
58827
  };
58816
- return /* @__PURE__ */ jsx28(
58828
+ return /* @__PURE__ */ jsx29(
58817
58829
  ChatSurface,
58818
58830
  {
58819
58831
  theme,
@@ -58824,8 +58836,8 @@ ${content3}`);
58824
58836
  placeholder,
58825
58837
  connection: state?.connection ?? "connecting",
58826
58838
  banner: /* @__PURE__ */ jsxs24(Fragment9, { children: [
58827
- resolvedSessionId && !isViewer && (sessionPluginControls ? sessionPluginControls(resolvedSessionId) : /* @__PURE__ */ jsx28(SessionPluginSelector, { client, sessionId: resolvedSessionId })),
58828
- /* @__PURE__ */ jsx28(
58839
+ resolvedSessionId && !isViewer && (sessionPluginControls ? sessionPluginControls(resolvedSessionId) : /* @__PURE__ */ jsx29(SessionPluginSelector, { client, sessionId: resolvedSessionId })),
58840
+ /* @__PURE__ */ jsx29(
58829
58841
  ReplayBar,
58830
58842
  {
58831
58843
  isReplay: replay.isReplay,
@@ -58835,7 +58847,7 @@ ${content3}`);
58835
58847
  onExit: () => void replay.exitToAutonomous()
58836
58848
  }
58837
58849
  ),
58838
- /* @__PURE__ */ jsx28(ReplayMismatchPrompt, { mismatch: replay.mismatch })
58850
+ /* @__PURE__ */ jsx29(ReplayMismatchPrompt, { mismatch: replay.mismatch })
58839
58851
  ] }),
58840
58852
  errorMessage,
58841
58853
  messages: state?.messages ?? [],
@@ -58847,7 +58859,7 @@ ${content3}`);
58847
58859
  planRevealRevision,
58848
58860
  queuePanel: (
58849
58861
  // 只读身份不能操作队列,藏起来免得每个按钮都弹冲突。
58850
- canUseQueue ? /* @__PURE__ */ jsx28(
58862
+ canUseQueue ? /* @__PURE__ */ jsx29(
58851
58863
  SessionQueuePanel,
58852
58864
  {
58853
58865
  rootClassName: classNames?.queuePanel,
@@ -58919,11 +58931,11 @@ ${content3}`);
58919
58931
  }
58920
58932
 
58921
58933
  // src/components/LlmChat.tsx
58922
- import { useEffect as useEffect24, useMemo as useMemo19, useState as useState36 } from "react";
58934
+ import { useEffect as useEffect25, useMemo as useMemo19, useState as useState36 } from "react";
58923
58935
 
58924
58936
  // src/components/LlmAdvancedSettings.tsx
58925
58937
  import { useState as useState35 } from "react";
58926
- import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
58938
+ import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
58927
58939
  var FIELDS = [
58928
58940
  { id: "baseURL", label: "\u6A21\u578B\u670D\u52A1\u5730\u5740", placeholder: "http://\u5185\u7F51\u5730\u5740/v1" },
58929
58941
  { id: "model", label: "\u6A21\u578B", placeholder: "\u6A21\u578B\u540D\u79F0" },
@@ -58985,16 +58997,16 @@ function LlmAdvancedSettingsBar({ settings, defaults: defaults2, override, onCha
58985
58997
  },
58986
58998
  className: "flex items-center gap-1.5 text-[hsl(var(--muted-foreground))] transition-colors hover:text-[hsl(var(--foreground))]",
58987
58999
  children: [
58988
- /* @__PURE__ */ jsx29(Settings2, { size: 13 }),
59000
+ /* @__PURE__ */ jsx30(Settings2, { size: 13 }),
58989
59001
  "\u9AD8\u7EA7\u8BBE\u7F6E",
58990
- dirty && /* @__PURE__ */ jsx29("span", { className: "text-[hsl(var(--primary))]", children: "\uFF08\u5DF2\u81EA\u5B9A\u4E49\uFF09" })
59002
+ dirty && /* @__PURE__ */ jsx30("span", { className: "text-[hsl(var(--primary))]", children: "\uFF08\u5DF2\u81EA\u5B9A\u4E49\uFF09" })
58991
59003
  ]
58992
59004
  }
58993
59005
  ),
58994
59006
  open2 && /* @__PURE__ */ jsxs25("div", { className: "mt-2 flex flex-col gap-2", children: [
58995
59007
  fields2.map((field) => /* @__PURE__ */ jsxs25("label", { className: "flex flex-col gap-1", children: [
58996
- /* @__PURE__ */ jsx29("span", { className: "text-[hsl(var(--muted-foreground))]", children: field.label }),
58997
- /* @__PURE__ */ jsx29(
59008
+ /* @__PURE__ */ jsx30("span", { className: "text-[hsl(var(--muted-foreground))]", children: field.label }),
59009
+ /* @__PURE__ */ jsx30(
58998
59010
  "input",
58999
59011
  {
59000
59012
  type: field.secret ? "password" : "text",
@@ -59005,9 +59017,9 @@ function LlmAdvancedSettingsBar({ settings, defaults: defaults2, override, onCha
59005
59017
  }
59006
59018
  )
59007
59019
  ] }, field.id)),
59008
- normalized.apiKey && /* @__PURE__ */ jsx29("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" }),
59020
+ normalized.apiKey && /* @__PURE__ */ jsx30("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" }),
59009
59021
  /* @__PURE__ */ jsxs25("div", { className: "flex gap-2", children: [
59010
- /* @__PURE__ */ jsx29(
59022
+ /* @__PURE__ */ jsx30(
59011
59023
  "button",
59012
59024
  {
59013
59025
  type: "button",
@@ -59022,7 +59034,7 @@ function LlmAdvancedSettingsBar({ settings, defaults: defaults2, override, onCha
59022
59034
  children: "\u4FDD\u5B58"
59023
59035
  }
59024
59036
  ),
59025
- /* @__PURE__ */ jsx29(
59037
+ /* @__PURE__ */ jsx30(
59026
59038
  "button",
59027
59039
  {
59028
59040
  type: "button",
@@ -59041,7 +59053,7 @@ function LlmAdvancedSettingsBar({ settings, defaults: defaults2, override, onCha
59041
59053
  }
59042
59054
 
59043
59055
  // src/components/LlmChat.tsx
59044
- import { jsx as jsx30 } from "react/jsx-runtime";
59056
+ import { jsx as jsx31 } from "react/jsx-runtime";
59045
59057
  function LlmChat({
59046
59058
  classNames,
59047
59059
  renderers,
@@ -59069,10 +59081,10 @@ ${text4}` : text4),
59069
59081
  }),
59070
59082
  [send, reset]
59071
59083
  );
59072
- useEffect24(() => {
59084
+ useEffect25(() => {
59073
59085
  onReady?.(handle);
59074
59086
  }, [handle, onReady]);
59075
- return /* @__PURE__ */ jsx30(
59087
+ return /* @__PURE__ */ jsx31(
59076
59088
  ChatSurface,
59077
59089
  {
59078
59090
  theme,
@@ -59098,7 +59110,7 @@ ${text4}` : text4),
59098
59110
  setStopRequested(true);
59099
59111
  stop();
59100
59112
  },
59101
- beforeInput: advanced ? /* @__PURE__ */ jsx30(
59113
+ beforeInput: advanced ? /* @__PURE__ */ jsx31(
59102
59114
  LlmAdvancedSettingsBar,
59103
59115
  {
59104
59116
  settings: advanced,
@@ -59116,14 +59128,14 @@ ${text4}` : text4),
59116
59128
  }
59117
59129
 
59118
59130
  // src/components/ChatView.tsx
59119
- import { jsx as jsx31 } from "react/jsx-runtime";
59131
+ import { jsx as jsx32 } from "react/jsx-runtime";
59120
59132
  function ChatView(props) {
59121
59133
  const { mode, llm, onLlmReady, ...rest } = props;
59122
59134
  if (mode === "llm") {
59123
59135
  if (!llm) {
59124
59136
  throw new Error('ChatView: mode="llm" \u9700\u8981\u540C\u65F6\u4F20 llm={{ baseURL, model }}');
59125
59137
  }
59126
- return /* @__PURE__ */ jsx31(
59138
+ return /* @__PURE__ */ jsx32(
59127
59139
  LlmChat,
59128
59140
  {
59129
59141
  ...llm,
@@ -59136,11 +59148,11 @@ function ChatView(props) {
59136
59148
  }
59137
59149
  );
59138
59150
  }
59139
- return /* @__PURE__ */ jsx31(AgentChat, { ...rest });
59151
+ return /* @__PURE__ */ jsx32(AgentChat, { ...rest });
59140
59152
  }
59141
59153
 
59142
59154
  // src/components/ConnectorPanel.tsx
59143
- import { useCallback as useCallback31, useEffect as useEffect25, useMemo as useMemo20, useRef as useRef28, useState as useState37 } from "react";
59155
+ import { useCallback as useCallback31, useEffect as useEffect26, useMemo as useMemo20, useRef as useRef28, useState as useState37 } from "react";
59144
59156
 
59145
59157
  // src/components/connector-panel-types.ts
59146
59158
  function selectionFromItem(item) {
@@ -59162,12 +59174,12 @@ function triggerSummary(items) {
59162
59174
  }
59163
59175
 
59164
59176
  // src/components/ConnectorPanel.tsx
59165
- import { Fragment as Fragment10, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
59177
+ import { Fragment as Fragment10, jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
59166
59178
  function PanelDivider() {
59167
- return /* @__PURE__ */ jsx32("div", { className: "my-1 border-[hsl(var(--border))] border-t" });
59179
+ return /* @__PURE__ */ jsx33("div", { className: "my-1 border-[hsl(var(--border))] border-t" });
59168
59180
  }
59169
59181
  function PanelTitle({ children }) {
59170
- return /* @__PURE__ */ jsx32("div", { className: "px-3 pt-1 pb-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children });
59182
+ return /* @__PURE__ */ jsx33("div", { className: "px-3 pt-1 pb-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children });
59171
59183
  }
59172
59184
  function ConnectorPanel({
59173
59185
  client,
@@ -59193,7 +59205,7 @@ function ConnectorPanel({
59193
59205
  onChange: onPluginsChanged
59194
59206
  });
59195
59207
  const { reload, items: sessionItems } = activation;
59196
- useEffect25(() => {
59208
+ useEffect26(() => {
59197
59209
  if (sessionId) reload();
59198
59210
  }, [reload, sessionId]);
59199
59211
  const loadPendingCatalog = useCallback31(async () => {
@@ -59208,7 +59220,7 @@ function ConnectorPanel({
59208
59220
  setPendingLoading(false);
59209
59221
  }
59210
59222
  }, [client]);
59211
- useEffect25(() => {
59223
+ useEffect26(() => {
59212
59224
  if (sessionId) return;
59213
59225
  void loadPendingCatalog();
59214
59226
  }, [loadPendingCatalog, sessionId]);
@@ -59247,12 +59259,12 @@ function ConnectorPanel({
59247
59259
  onSelectedChangeRef.current?.(latestSelected.current);
59248
59260
  }, []);
59249
59261
  const selectedNames = selectedItems.map((item) => item.name).join("\0");
59250
- useEffect25(reportSelected, [reportSelected, selectedNames]);
59262
+ useEffect26(reportSelected, [reportSelected, selectedNames]);
59251
59263
  const failed = sessionId ? activation.listError : pendingError;
59252
59264
  return /* @__PURE__ */ jsxs26("div", { className, children: [
59253
59265
  /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2 border-[hsl(var(--border))] border-b px-3 py-2", children: [
59254
- /* @__PURE__ */ jsx32(Search, { size: 12, className: "shrink-0 text-[hsl(var(--muted-foreground))]", "aria-hidden": "true" }),
59255
- /* @__PURE__ */ jsx32(
59266
+ /* @__PURE__ */ jsx33(Search, { size: 12, className: "shrink-0 text-[hsl(var(--muted-foreground))]", "aria-hidden": "true" }),
59267
+ /* @__PURE__ */ jsx33(
59256
59268
  "input",
59257
59269
  {
59258
59270
  value: query,
@@ -59264,21 +59276,21 @@ function ConnectorPanel({
59264
59276
  )
59265
59277
  ] }),
59266
59278
  renderComputerSection ? /* @__PURE__ */ jsxs26(Fragment10, { children: [
59267
- /* @__PURE__ */ jsx32(PanelTitle, { children: "\u7535\u8111" }),
59279
+ /* @__PURE__ */ jsx33(PanelTitle, { children: "\u7535\u8111" }),
59268
59280
  renderComputerSection(query)
59269
59281
  ] }) : null,
59270
- /* @__PURE__ */ jsx32(PanelDivider, {}),
59271
- /* @__PURE__ */ jsx32(PanelTitle, { children: "\u63D2\u4EF6" }),
59282
+ /* @__PURE__ */ jsx33(PanelDivider, {}),
59283
+ /* @__PURE__ */ jsx33(PanelTitle, { children: "\u63D2\u4EF6" }),
59272
59284
  !sessionId ? (
59273
59285
  // 首页没有会话,开关只记下「这条消息要带上谁」:不说清楚,用户会以为已经
59274
59286
  // 生效(issue 明确要求「明确为待选,不宣称已经激活」)。
59275
- /* @__PURE__ */ jsx32("div", { className: "px-3 pb-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: "\u5148\u9009\u4E2D\uFF0C\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u65F6\u4F1A\u4E00\u5E76\u542F\u7528" })
59287
+ /* @__PURE__ */ jsx33("div", { className: "px-3 pb-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: "\u5148\u9009\u4E2D\uFF0C\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u65F6\u4F1A\u4E00\u5E76\u542F\u7528" })
59276
59288
  ) : null,
59277
59289
  (sessionId ? activation.loading : pendingLoading) && visibleItems.length === 0 ? /* @__PURE__ */ jsxs26("div", { className: "px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
59278
- /* @__PURE__ */ jsx32(LoaderCircle, { size: 12, className: "mr-1 inline animate-spin" }),
59290
+ /* @__PURE__ */ jsx33(LoaderCircle, { size: 12, className: "mr-1 inline animate-spin" }),
59279
59291
  "\u6B63\u5728\u83B7\u53D6\u63D2\u4EF6\u2026"
59280
59292
  ] }) : null,
59281
- failed ? /* @__PURE__ */ jsx32(
59293
+ failed ? /* @__PURE__ */ jsx33(
59282
59294
  "button",
59283
59295
  {
59284
59296
  type: "button",
@@ -59287,7 +59299,7 @@ function ConnectorPanel({
59287
59299
  children: "\u63D2\u4EF6\u5217\u8868\u6682\u4E0D\u53EF\u7528\uFF0C\u70B9\u51FB\u91CD\u8BD5"
59288
59300
  }
59289
59301
  ) : null,
59290
- /* @__PURE__ */ jsx32(
59302
+ /* @__PURE__ */ jsx33(
59291
59303
  PluginConnectorList,
59292
59304
  {
59293
59305
  client,
@@ -59309,19 +59321,19 @@ function ConnectorPanel({
59309
59321
  }
59310
59322
  ),
59311
59323
  renderExternalAccounts ? /* @__PURE__ */ jsxs26(Fragment10, { children: [
59312
- /* @__PURE__ */ jsx32(PanelDivider, {}),
59313
- /* @__PURE__ */ jsx32(PanelTitle, { children: "\u5916\u90E8\u8D26\u53F7" }),
59324
+ /* @__PURE__ */ jsx33(PanelDivider, {}),
59325
+ /* @__PURE__ */ jsx33(PanelTitle, { children: "\u5916\u90E8\u8D26\u53F7" }),
59314
59326
  renderExternalAccounts(query)
59315
59327
  ] }) : null,
59316
59328
  renderFooterActions ? /* @__PURE__ */ jsxs26(Fragment10, { children: [
59317
- /* @__PURE__ */ jsx32(PanelDivider, {}),
59329
+ /* @__PURE__ */ jsx33(PanelDivider, {}),
59318
59330
  renderFooterActions()
59319
59331
  ] }) : null
59320
59332
  ] });
59321
59333
  }
59322
59334
 
59323
59335
  // src/components/PluginTriggerStack.tsx
59324
- import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
59336
+ import { jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
59325
59337
  var AVATAR_SIZE = 20;
59326
59338
  function hueOf(name) {
59327
59339
  let hash2 = 0;
@@ -59345,7 +59357,7 @@ function PluginTriggerStack({ client, sessionId, summary, className }) {
59345
59357
  summary.visible.map((item) => {
59346
59358
  const label = item.displayName?.trim() || item.name;
59347
59359
  const tone = AVATAR_PALETTE[hueOf(item.name) % AVATAR_PALETTE.length];
59348
- return item.icon ? /* @__PURE__ */ jsx33(
59360
+ return item.icon ? /* @__PURE__ */ jsx34(
59349
59361
  SessionPluginIcon,
59350
59362
  {
59351
59363
  client,
@@ -59356,7 +59368,7 @@ function PluginTriggerStack({ client, sessionId, summary, className }) {
59356
59368
  className: ring
59357
59369
  },
59358
59370
  item.name
59359
- ) : /* @__PURE__ */ jsx33(
59371
+ ) : /* @__PURE__ */ jsx34(
59360
59372
  "span",
59361
59373
  {
59362
59374
  title: label,
@@ -59386,7 +59398,7 @@ import {
59386
59398
  getContextDisplayState,
59387
59399
  getContextGroupDisplayState
59388
59400
  } from "@blade-hq/agent-client";
59389
- import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
59401
+ import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
59390
59402
  function ContextCard({ context, className }) {
59391
59403
  const display = getContextDisplayState(context);
59392
59404
  return /* @__PURE__ */ jsxs28(
@@ -59395,7 +59407,7 @@ function ContextCard({ context, className }) {
59395
59407
  className: `blade-chat-context-card group/context-card overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-sm ${className ?? ""}`,
59396
59408
  children: [
59397
59409
  /* @__PURE__ */ jsxs28("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: [
59398
- /* @__PURE__ */ jsx34(
59410
+ /* @__PURE__ */ jsx35(
59399
59411
  Layers,
59400
59412
  {
59401
59413
  size: 15,
@@ -59404,10 +59416,10 @@ function ContextCard({ context, className }) {
59404
59416
  }
59405
59417
  ),
59406
59418
  /* @__PURE__ */ jsxs28("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
59407
- /* @__PURE__ */ jsx34("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: display.title }),
59408
- /* @__PURE__ */ jsx34("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: display.summary })
59419
+ /* @__PURE__ */ jsx35("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: display.title }),
59420
+ /* @__PURE__ */ jsx35("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: display.summary })
59409
59421
  ] }),
59410
- /* @__PURE__ */ jsx34(
59422
+ /* @__PURE__ */ jsx35(
59411
59423
  ChevronDown,
59412
59424
  {
59413
59425
  size: 14,
@@ -59416,7 +59428,7 @@ function ContextCard({ context, className }) {
59416
59428
  }
59417
59429
  )
59418
59430
  ] }),
59419
- /* @__PURE__ */ jsx34("div", { className: "blade-chat-context-detail border-t border-[hsl(var(--border))] px-3 py-2.5 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: display.detail })
59431
+ /* @__PURE__ */ jsx35("div", { className: "blade-chat-context-detail border-t border-[hsl(var(--border))] px-3 py-2.5 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: display.detail })
59420
59432
  ]
59421
59433
  }
59422
59434
  );
@@ -59427,7 +59439,7 @@ function ContextGroupCard({ contexts, className }) {
59427
59439
  const group = single ? null : getContextGroupDisplayState(contexts);
59428
59440
  return /* @__PURE__ */ jsxs28("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: [
59429
59441
  /* @__PURE__ */ jsxs28("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: [
59430
- /* @__PURE__ */ jsx34(
59442
+ /* @__PURE__ */ jsx35(
59431
59443
  Layers,
59432
59444
  {
59433
59445
  size: 15,
@@ -59436,10 +59448,10 @@ function ContextGroupCard({ contexts, className }) {
59436
59448
  }
59437
59449
  ),
59438
59450
  /* @__PURE__ */ jsxs28("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
59439
- /* @__PURE__ */ jsx34("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: single ? single.title : `${group?.title} \xB7 ${group?.count} \u9879` }),
59440
- /* @__PURE__ */ jsx34("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: single ? single.summary : group?.summary })
59451
+ /* @__PURE__ */ jsx35("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: single ? single.title : `${group?.title} \xB7 ${group?.count} \u9879` }),
59452
+ /* @__PURE__ */ jsx35("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: single ? single.summary : group?.summary })
59441
59453
  ] }),
59442
- /* @__PURE__ */ jsx34(
59454
+ /* @__PURE__ */ jsx35(
59443
59455
  ChevronDown,
59444
59456
  {
59445
59457
  size: 14,
@@ -59448,7 +59460,7 @@ function ContextGroupCard({ contexts, className }) {
59448
59460
  }
59449
59461
  )
59450
59462
  ] }),
59451
- single ? /* @__PURE__ */ jsx34("div", { className: "blade-chat-context-detail border-t border-[hsl(var(--border))] px-3 py-2.5 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: single.detail }) : /* @__PURE__ */ jsx34("div", { className: "blade-chat-context-group-items flex flex-col gap-1.5 border-t border-[hsl(var(--border))] p-2", children: contexts.map((context) => /* @__PURE__ */ jsx34(
59463
+ single ? /* @__PURE__ */ jsx35("div", { className: "blade-chat-context-detail border-t border-[hsl(var(--border))] px-3 py-2.5 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: single.detail }) : /* @__PURE__ */ jsx35("div", { className: "blade-chat-context-group-items flex flex-col gap-1.5 border-t border-[hsl(var(--border))] p-2", children: contexts.map((context) => /* @__PURE__ */ jsx35(
59452
59464
  ContextCard,
59453
59465
  {
59454
59466
  context
@@ -59459,8 +59471,8 @@ function ContextGroupCard({ contexts, className }) {
59459
59471
  }
59460
59472
 
59461
59473
  // src/components/SessionMemoryToggle.tsx
59462
- import { useCallback as useCallback32, useEffect as useEffect26, useRef as useRef29, useState as useState38, useSyncExternalStore as useSyncExternalStore2 } from "react";
59463
- import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
59474
+ import { useCallback as useCallback32, useEffect as useEffect27, useRef as useRef29, useState as useState38, useSyncExternalStore as useSyncExternalStore2 } from "react";
59475
+ import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
59464
59476
  var saveStates = /* @__PURE__ */ new WeakMap();
59465
59477
  function getSaveState(client, sessionId) {
59466
59478
  let clientStates = saveStates.get(client);
@@ -59520,7 +59532,7 @@ function SessionMemoryToggle({
59520
59532
  const [draftEnabled, setDraftEnabled] = useState38(enabled);
59521
59533
  const activeSessionIdRef = useRef29(sessionId);
59522
59534
  activeSessionIdRef.current = sessionId;
59523
- useEffect26(() => {
59535
+ useEffect27(() => {
59524
59536
  setDraftEnabled(enabled);
59525
59537
  }, [enabled, sessionId]);
59526
59538
  const update = useCallback32(
@@ -59550,8 +59562,8 @@ function SessionMemoryToggle({
59550
59562
  [client, enabled, onError, onSaved, sessionId]
59551
59563
  );
59552
59564
  return /* @__PURE__ */ jsxs29("label", { className: cn("flex items-center justify-between", className), children: [
59553
- /* @__PURE__ */ jsx35("span", { className: labelClassName, children: label }),
59554
- /* @__PURE__ */ jsx35(
59565
+ /* @__PURE__ */ jsx36("span", { className: labelClassName, children: label }),
59566
+ /* @__PURE__ */ jsx36(
59555
59567
  "input",
59556
59568
  {
59557
59569
  type: "checkbox",
@@ -59610,6 +59622,7 @@ function classifyAgentComputerLaunchOutcome(toolCall) {
59610
59622
  export * from "@blade-hq/agent-client";
59611
59623
  export {
59612
59624
  AgentChat,
59625
+ AgentTaskCard,
59613
59626
  BladeProvider,
59614
59627
  ChatView,
59615
59628
  ConnectorPanel,
@@ -59696,6 +59709,7 @@ lucide-react/dist/esm/icons/chevron-down.js:
59696
59709
  lucide-react/dist/esm/icons/chevron-right.js:
59697
59710
  lucide-react/dist/esm/icons/circle-alert.js:
59698
59711
  lucide-react/dist/esm/icons/circle-dot.js:
59712
+ lucide-react/dist/esm/icons/circle-help.js:
59699
59713
  lucide-react/dist/esm/icons/circle-pause.js:
59700
59714
  lucide-react/dist/esm/icons/circle.js:
59701
59715
  lucide-react/dist/esm/icons/copy.js: