@blade-hq/agent-kit 0.5.24 → 0.5.26

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.
Files changed (38) hide show
  1. package/dist/{SkillStatusBar-DO-ltefK.d.ts → SkillStatusBar-qjGb3eKD.d.ts} +7 -4
  2. package/dist/{blade-client-Bhp0hHiZ.d.ts → blade-client-DA2h2P5I.d.ts} +48 -3
  3. package/dist/{chunk-QKSZPJQX.js → chunk-4FCXKLXT.js} +11 -5
  4. package/dist/chunk-4FCXKLXT.js.map +1 -0
  5. package/dist/{chunk-63IWZ3AO.js → chunk-6L6JFSR5.js} +2 -2
  6. package/dist/{chunk-7FGJNW56.js → chunk-QCDNRR74.js} +403 -326
  7. package/dist/chunk-QCDNRR74.js.map +1 -0
  8. package/dist/{chunk-DTDZFQRY.js → chunk-UNO53NPU.js} +27 -2
  9. package/dist/chunk-UNO53NPU.js.map +1 -0
  10. package/dist/{chunk-KW66QITV.js → chunk-Y7FRTBUT.js} +20 -4
  11. package/dist/chunk-Y7FRTBUT.js.map +1 -0
  12. package/dist/{chunk-7EVVRQ7G.js → chunk-ZWO6YBLA.js} +4 -3
  13. package/dist/chunk-ZWO6YBLA.js.map +1 -0
  14. package/dist/client/index.d.ts +4615 -2834
  15. package/dist/client/index.js +1 -1
  16. package/dist/react/api/vibe-coding.d.ts +3 -3
  17. package/dist/react/api/vibe-coding.js +2 -2
  18. package/dist/react/components/chat/index.d.ts +4 -4
  19. package/dist/react/components/chat/index.js +5 -5
  20. package/dist/react/components/plan/index.js +4 -4
  21. package/dist/react/components/session/index.d.ts +1 -1
  22. package/dist/react/components/session/index.js +3 -3
  23. package/dist/react/components/workspace/index.d.ts +22 -2
  24. package/dist/react/components/workspace/index.js +31 -15
  25. package/dist/react/components/workspace/index.js.map +1 -1
  26. package/dist/react/index.d.ts +24 -179
  27. package/dist/react/index.js +10 -7
  28. package/dist/react/index.js.map +1 -1
  29. package/dist/{session-BuaeCsMC.d.ts → session-B5v5KkVd.d.ts} +5 -3
  30. package/dist/sessions-BZ3y17sP.d.ts +174 -0
  31. package/dist/style.css +1 -1
  32. package/package.json +1 -1
  33. package/dist/chunk-7EVVRQ7G.js.map +0 -1
  34. package/dist/chunk-7FGJNW56.js.map +0 -1
  35. package/dist/chunk-DTDZFQRY.js.map +0 -1
  36. package/dist/chunk-KW66QITV.js.map +0 -1
  37. package/dist/chunk-QKSZPJQX.js.map +0 -1
  38. /package/dist/{chunk-63IWZ3AO.js.map → chunk-6L6JFSR5.js.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  getCodeLanguageFromFilename,
9
9
  parseAskUserQuestion,
10
10
  useHighlightedCodeHtml
11
- } from "./chunk-KW66QITV.js";
11
+ } from "./chunk-Y7FRTBUT.js";
12
12
  import {
13
13
  Collapsible,
14
14
  CollapsibleContent,
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-H62LH2AG.js";
17
17
  import {
18
18
  resolveSessionFilePreviewTarget
19
- } from "./chunk-QKSZPJQX.js";
19
+ } from "./chunk-4FCXKLXT.js";
20
20
  import {
21
21
  apiFetchResponse,
22
22
  buildMessageContent,
@@ -60,7 +60,7 @@ import {
60
60
  useUiBridgeStore,
61
61
  useUiStore,
62
62
  writeFile
63
- } from "./chunk-DTDZFQRY.js";
63
+ } from "./chunk-UNO53NPU.js";
64
64
  import {
65
65
  registerBridgeIframe,
66
66
  tapBridgeEvent
@@ -69,7 +69,7 @@ import {
69
69
  ModelOption,
70
70
  ModelsConfig,
71
71
  ModelsResource
72
- } from "./chunk-7EVVRQ7G.js";
72
+ } from "./chunk-ZWO6YBLA.js";
73
73
  import {
74
74
  cn,
75
75
  copyToClipboard
@@ -79,7 +79,7 @@ import {
79
79
  } from "./chunk-PZ5AY32C.js";
80
80
 
81
81
  // src/react/components/chat/ChatView.tsx
82
- import { CircleAlert } from "lucide-react";
82
+ import { CircleAlert as CircleAlert2 } from "lucide-react";
83
83
  import { Eye } from "lucide-react";
84
84
  import { useCallback as useCallback13, useMemo as useMemo18 } from "react";
85
85
 
@@ -100,6 +100,12 @@ function useChat(sessionId) {
100
100
  },
101
101
  [sessionId]
102
102
  );
103
+ const append = useCallback(
104
+ (msg) => {
105
+ getSocket().append(sessionId, msg);
106
+ },
107
+ [sessionId]
108
+ );
103
109
  const stop = useCallback(async () => {
104
110
  if (isStopping) return;
105
111
  setIsStopping(true);
@@ -131,7 +137,7 @@ function useChat(sessionId) {
131
137
  setAnswerCallback(sessionId, answer);
132
138
  return () => setAnswerCallback(sessionId, void 0);
133
139
  }, [answer, sessionId, setAnswerCallback]);
134
- return { messages, isStreaming, isStopping, send, stop };
140
+ return { messages, isStreaming, isStopping, send, append, stop };
135
141
  }
136
142
  function buildPendingAskUserAnswer(sessionId, message) {
137
143
  const session = useSessionStore.getState().sessions.find((item) => item.id === sessionId);
@@ -2657,6 +2663,7 @@ function showVoiceInputErrorToast(error) {
2657
2663
  }
2658
2664
  function ChatInput({
2659
2665
  onSend,
2666
+ onAppend,
2660
2667
  onStop,
2661
2668
  isStreaming,
2662
2669
  isStopping = false,
@@ -2677,8 +2684,10 @@ function ChatInput({
2677
2684
  skillStatusBarClassName,
2678
2685
  skillStatusBarInnerClassName,
2679
2686
  onResyncSkills,
2680
- isResyncingSkills = false
2687
+ isResyncingSkills = false,
2688
+ inputLabel = "\u8F93\u5165\u6D88\u606F"
2681
2689
  }) {
2690
+ const resolvedInputLabel = inputLabel?.trim() || "\u8F93\u5165\u6D88\u606F";
2682
2691
  const [input, setInputInternal] = useState8(externalDraft?.value ?? "");
2683
2692
  const setInput = useEffectEvent2((value) => {
2684
2693
  setInputInternal(value);
@@ -3015,7 +3024,9 @@ function ChatInput({
3015
3024
  },
3016
3025
  editorProps: {
3017
3026
  attributes: {
3018
- "aria-label": "\u8F93\u5165\u6D88\u606F",
3027
+ "aria-label": resolvedInputLabel,
3028
+ "data-testid": "chat-message-input",
3029
+ "data-blade-input-label": resolvedInputLabel,
3019
3030
  class: "min-h-[40px] max-h-[240px] overflow-y-auto px-4 py-3 text-sm leading-relaxed text-[hsl(var(--foreground))] focus:outline-none [&_.file-mention-pill]:inline-flex [&_.file-mention-pill]:items-center [&_.file-mention-pill]:rounded-full [&_.file-mention-pill]:bg-[hsl(var(--accent))] [&_.file-mention-pill]:px-2 [&_.file-mention-pill]:py-0.5 [&_.file-mention-pill]:font-medium [&_.file-mention-pill]:text-[hsl(var(--primary))] [&_.file-mention-pill]:select-none [&_.file-mention-pill]:whitespace-nowrap [&_.skill-mention-pill]:inline-flex [&_.skill-mention-pill]:items-center [&_.skill-mention-pill]:rounded-full [&_.skill-mention-pill]:bg-[hsl(var(--primary)/0.15)] [&_.skill-mention-pill]:px-2 [&_.skill-mention-pill]:py-0.5 [&_.skill-mention-pill]:font-medium [&_.skill-mention-pill]:text-[hsl(var(--primary))] [&_.skill-mention-pill]:select-none [&_.skill-mention-pill]:whitespace-nowrap [&_p:first-child]:mt-0 [&_p:last-child]:mb-0"
3020
3031
  },
3021
3032
  handleDOMEvents: {
@@ -3076,6 +3087,12 @@ function ChatInput({
3076
3087
  }
3077
3088
  }
3078
3089
  });
3090
+ useEffect7(() => {
3091
+ const dom = editor?.view.dom;
3092
+ if (!dom) return;
3093
+ dom.setAttribute("aria-label", resolvedInputLabel);
3094
+ dom.setAttribute("data-blade-input-label", resolvedInputLabel);
3095
+ }, [editor, resolvedInputLabel]);
3079
3096
  useEffect7(() => {
3080
3097
  if (!editor || !activeSessionId || rewindDraft == null) {
3081
3098
  return;
@@ -3140,7 +3157,7 @@ function ChatInput({
3140
3157
  return;
3141
3158
  }
3142
3159
  applyDraftAppends();
3143
- }, [applyDraftAppends, draftAppends]);
3160
+ }, [applyDraftAppends, draftAppends, editor]);
3144
3161
  const applySendRequests = useEffectEvent2(() => {
3145
3162
  if (!activeSessionId) {
3146
3163
  return;
@@ -3183,7 +3200,16 @@ function ChatInput({
3183
3200
  }
3184
3201
  }, [activeSessionId, isRecording]);
3185
3202
  const handleSubmit = async () => {
3186
- if (isStreaming || connectionStatus !== "connected") {
3203
+ if (connectionStatus !== "connected") {
3204
+ return;
3205
+ }
3206
+ if (isStreaming) {
3207
+ if (!onAppend) return;
3208
+ const json = editor?.getJSON();
3209
+ const text = serializeEditorContent(json);
3210
+ if (!text.trim()) return;
3211
+ onAppend(text);
3212
+ editor?.commands.clearContent();
3187
3213
  return;
3188
3214
  }
3189
3215
  if (isModelLoading) {
@@ -5520,6 +5546,52 @@ function SearchRenderer({ toolCall }) {
5520
5546
  ] });
5521
5547
  }
5522
5548
 
5549
+ // src/react/components/chat/tool-renderers/SubmitResultRenderer.tsx
5550
+ import { CheckCircle2, CircleAlert } from "lucide-react";
5551
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
5552
+ function extractText(value, key) {
5553
+ if (!isPlainObject(value)) return null;
5554
+ const field = value[key];
5555
+ return typeof field === "string" && field.trim() ? field.trim() : null;
5556
+ }
5557
+ function parsePayload(toolCall) {
5558
+ const resultText = getResultText(toolCall.result);
5559
+ const parsedResult = parseJsonValue(resultText);
5560
+ const parsedArgs = parseJsonValue(toolCall.arguments);
5561
+ const source = isPlainObject(parsedResult) ? parsedResult : parsedArgs;
5562
+ const description = extractText(source, "description");
5563
+ const result = extractText(source, "result") ?? (typeof resultText === "string" ? resultText.trim() : null);
5564
+ const error = extractText(source, "err_msg") ?? extractText(source, "error");
5565
+ const status = extractText(source, "status");
5566
+ return { description, result, error, status };
5567
+ }
5568
+ function SubmitResultRenderer({ toolCall }) {
5569
+ const { description, result, error, status } = parsePayload(toolCall);
5570
+ const isError = toolCall.status === "error" || Boolean(error);
5571
+ const Icon = isError ? CircleAlert : CheckCircle2;
5572
+ return /* @__PURE__ */ jsxs16("div", { className: "overflow-hidden rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] shadow-sm", children: [
5573
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]/25 px-4 py-3", children: [
5574
+ /* @__PURE__ */ jsx20("div", { className: isError ? "text-red-500" : "text-emerald-500", children: /* @__PURE__ */ jsx20(Icon, { size: 18 }) }),
5575
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
5576
+ /* @__PURE__ */ jsx20("div", { className: "font-medium text-[hsl(var(--foreground))]", children: description || (isError ? "\u4EFB\u52A1\u6267\u884C\u5931\u8D25" : "\u4EFB\u52A1\u7ED3\u679C\u5DF2\u63D0\u4EA4") }),
5577
+ description ? /* @__PURE__ */ jsx20("div", { className: "mt-0.5 text-xs text-[hsl(var(--muted-foreground))]", children: isError ? "\u4EFB\u52A1\u6267\u884C\u5931\u8D25" : "\u4EFB\u52A1\u7ED3\u679C\u5DF2\u63D0\u4EA4" }) : null,
5578
+ status ? /* @__PURE__ */ jsxs16("div", { className: "mt-0.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
5579
+ "\u72B6\u6001\uFF1A",
5580
+ status
5581
+ ] }) : null
5582
+ ] })
5583
+ ] }),
5584
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-3 px-4 py-4 text-sm leading-6 text-[hsl(var(--foreground))]", children: [
5585
+ result ? /* @__PURE__ */ jsx20("p", { className: "whitespace-pre-wrap", children: result }) : null,
5586
+ error ? /* @__PURE__ */ jsxs16("div", { className: "rounded-xl border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-200", children: [
5587
+ /* @__PURE__ */ jsx20("div", { className: "mb-1 font-medium", children: "\u9519\u8BEF\u4FE1\u606F" }),
5588
+ /* @__PURE__ */ jsx20("div", { className: "whitespace-pre-wrap", children: error })
5589
+ ] }) : null,
5590
+ !result && !error ? /* @__PURE__ */ jsx20("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u667A\u80FD\u4F53\u5DF2\u7ED3\u675F\u672C\u8F6E\u4EFB\u52A1\u3002" }) : null
5591
+ ] })
5592
+ ] });
5593
+ }
5594
+
5523
5595
  // src/react/components/chat/tool-renderers/registry.ts
5524
5596
  var RENDERERS = /* @__PURE__ */ new Map([
5525
5597
  ["Bash", BashRenderer],
@@ -5531,14 +5603,15 @@ var RENDERERS = /* @__PURE__ */ new Map([
5531
5603
  ["Read", FileReadRenderer],
5532
5604
  ["WebFetch", SearchRenderer],
5533
5605
  ["WebSearch", SearchRenderer],
5534
- ["Write", FileEditRenderer]
5606
+ ["Write", FileEditRenderer],
5607
+ ["submit_result", SubmitResultRenderer]
5535
5608
  ]);
5536
5609
  function getRenderer(toolName) {
5537
5610
  return RENDERERS.get(formatToolName(toolName)) ?? null;
5538
5611
  }
5539
5612
 
5540
5613
  // src/react/components/chat/ToolCallBlock.tsx
5541
- import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
5614
+ import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
5542
5615
  function FilePathLink({ filePath, sessionId }) {
5543
5616
  const activeSessionId = useSessionStore((s) => s.activeSessionId);
5544
5617
  const pushArtifact = useUiStore((s) => s.pushArtifact);
@@ -5556,14 +5629,14 @@ function FilePathLink({ filePath, sessionId }) {
5556
5629
  } catch {
5557
5630
  }
5558
5631
  };
5559
- return /* @__PURE__ */ jsx20(
5632
+ return /* @__PURE__ */ jsx21(
5560
5633
  "button",
5561
5634
  {
5562
5635
  type: "button",
5563
5636
  onClick: handleClick,
5564
5637
  className: "flex min-w-0 items-center gap-1 text-blue-400 hover:text-blue-300 hover:underline cursor-pointer font-mono",
5565
5638
  title: `\u9884\u89C8 ${filePath}`,
5566
- children: /* @__PURE__ */ jsx20("span", { className: "truncate", children: fileName })
5639
+ children: /* @__PURE__ */ jsx21("span", { className: "truncate", children: fileName })
5567
5640
  }
5568
5641
  );
5569
5642
  }
@@ -5606,7 +5679,7 @@ function ToolCallBlock({
5606
5679
  const canAnswer = toolCall.status === "awaiting_answer" && Boolean(resolvedOnAnswer) && Boolean(resolvedSessionStatus);
5607
5680
  const shouldRenderQuestion = Boolean(askData) && (canAnswer || resolvedAnswered || toolCall.status === "done");
5608
5681
  if (askData && shouldRenderQuestion) {
5609
- const questionBlock = /* @__PURE__ */ jsx20(
5682
+ const questionBlock = /* @__PURE__ */ jsx21(
5610
5683
  AskUserQuestionBlock,
5611
5684
  {
5612
5685
  data: askData,
@@ -5620,9 +5693,9 @@ function ToolCallBlock({
5620
5693
  if (!reasoning) {
5621
5694
  return questionBlock;
5622
5695
  }
5623
- return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1", children: [
5696
+ return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-1", children: [
5624
5697
  questionBlock,
5625
- /* @__PURE__ */ jsx20("div", { className: "ml-4", children: /* @__PURE__ */ jsx20(ThinkingBadge, { reasoning, variant: "block" }) })
5698
+ /* @__PURE__ */ jsx21("div", { className: "ml-4", children: /* @__PURE__ */ jsx21(ThinkingBadge, { reasoning, variant: "block" }) })
5626
5699
  ] });
5627
5700
  }
5628
5701
  }
@@ -5633,11 +5706,11 @@ function ToolCallBlock({
5633
5706
  const borderWidthClass = level === 2 ? "border-l-[2px]" : "border-l-[3px]";
5634
5707
  const indentClass = level === 2 ? "ml-3" : "ml-4";
5635
5708
  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))]";
5636
- const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */ jsx20(Loader23, { size: 11, className: "animate-spin" }) : toolCall.status === "awaiting_answer" ? /* @__PURE__ */ jsx20(MessageSquareMore, { size: 11 }) : toolCall.status === "cancelled" || toolCall.status === "error" ? /* @__PURE__ */ jsx20(X4, { size: 11 }) : /* @__PURE__ */ jsx20(Check, { size: 11 });
5709
+ const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */ jsx21(Loader23, { size: 11, className: "animate-spin" }) : toolCall.status === "awaiting_answer" ? /* @__PURE__ */ jsx21(MessageSquareMore, { size: 11 }) : toolCall.status === "cancelled" || toolCall.status === "error" ? /* @__PURE__ */ jsx21(X4, { size: 11 }) : /* @__PURE__ */ jsx21(Check, { size: 11 });
5637
5710
  const statusTextClass = tone === "red" ? "text-[hsl(var(--muted-foreground))]" : tone === "amber" ? "text-amber-300" : tone === "blue" ? "text-blue-300" : "text-[hsl(var(--primary))]";
5638
- return /* @__PURE__ */ jsxs16("div", { className: cn(indentClass, "text-xs", customization?.classNames?.toolCall), children: [
5639
- /* @__PURE__ */ jsxs16("div", { className: cn(borderWidthClass, toneClass, "flex items-center gap-2 px-3 py-2"), children: [
5640
- /* @__PURE__ */ jsxs16(
5711
+ return /* @__PURE__ */ jsxs17("div", { className: cn(indentClass, "text-xs", customization?.classNames?.toolCall), children: [
5712
+ /* @__PURE__ */ jsxs17("div", { className: cn(borderWidthClass, toneClass, "flex items-center gap-2 px-3 py-2"), children: [
5713
+ /* @__PURE__ */ jsxs17(
5641
5714
  "button",
5642
5715
  {
5643
5716
  type: "button",
@@ -5645,7 +5718,7 @@ function ToolCallBlock({
5645
5718
  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",
5646
5719
  "aria-expanded": expanded,
5647
5720
  children: [
5648
- /* @__PURE__ */ jsx20(
5721
+ /* @__PURE__ */ jsx21(
5649
5722
  ChevronRight3,
5650
5723
  {
5651
5724
  size: 11,
@@ -5655,21 +5728,21 @@ function ToolCallBlock({
5655
5728
  )
5656
5729
  }
5657
5730
  ),
5658
- /* @__PURE__ */ jsxs16("span", { className: cn("flex shrink-0 items-center gap-1 text-[10px]", statusTextClass), children: [
5731
+ /* @__PURE__ */ jsxs17("span", { className: cn("flex shrink-0 items-center gap-1 text-[10px]", statusTextClass), children: [
5659
5732
  statusIcon,
5660
- /* @__PURE__ */ jsx20("span", { children: getToolStatusLabel(toolCall.status) })
5733
+ /* @__PURE__ */ jsx21("span", { children: getToolStatusLabel(toolCall.status) })
5661
5734
  ] }),
5662
- /* @__PURE__ */ jsxs16("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: [
5735
+ /* @__PURE__ */ jsxs17("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: [
5663
5736
  displayName,
5664
5737
  toolCall.status === "error" ? "\uFF08\u5F85\u91CD\u8BD5\uFF09" : ""
5665
5738
  ] })
5666
5739
  ]
5667
5740
  }
5668
5741
  ),
5669
- filePath && /* @__PURE__ */ jsx20("span", { className: "flex min-w-0 max-w-[50%] text-[hsl(var(--muted-foreground))]", children: /* @__PURE__ */ jsx20(FilePathLink, { filePath, sessionId: resolvedSessionId }) }),
5670
- reasoning ? /* @__PURE__ */ jsx20(ThinkingBadge, { reasoning, variant: "block" }) : null,
5671
- 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) }),
5672
- uiMeta?.target === "preview" && resolvedSessionId && !isInternalStatusPreview(uiMeta) ? /* @__PURE__ */ jsxs16(
5742
+ filePath && /* @__PURE__ */ jsx21("span", { className: "flex min-w-0 max-w-[50%] text-[hsl(var(--muted-foreground))]", children: /* @__PURE__ */ jsx21(FilePathLink, { filePath, sessionId: resolvedSessionId }) }),
5743
+ reasoning ? /* @__PURE__ */ jsx21(ThinkingBadge, { reasoning, variant: "block" }) : null,
5744
+ typeof toolCall.duration_ms === "number" && toolCall.duration_ms > 0 && /* @__PURE__ */ jsx21("span", { className: "shrink-0 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: formatToolDuration(toolCall.duration_ms) }),
5745
+ uiMeta?.target === "preview" && resolvedSessionId && !isInternalStatusPreview(uiMeta) ? /* @__PURE__ */ jsxs17(
5673
5746
  "button",
5674
5747
  {
5675
5748
  type: "button",
@@ -5687,20 +5760,20 @@ function ToolCallBlock({
5687
5760
  className: "inline-flex shrink-0 items-center gap-1 text-blue-400 hover:text-blue-300 hover:underline cursor-pointer",
5688
5761
  title: `\u6253\u5F00 ${uiMeta.title ?? displayName}`,
5689
5762
  children: [
5690
- /* @__PURE__ */ jsx20(PanelRightOpen, { size: 11 }),
5691
- /* @__PURE__ */ jsx20("span", { children: uiMeta.title ?? displayName })
5763
+ /* @__PURE__ */ jsx21(PanelRightOpen, { size: 11 }),
5764
+ /* @__PURE__ */ jsx21("span", { children: uiMeta.title ?? displayName })
5692
5765
  ]
5693
5766
  }
5694
5767
  ) : null
5695
5768
  ] }),
5696
- expanded && /* @__PURE__ */ jsx20("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: Renderer ? /* @__PURE__ */ jsx20(Renderer, { toolCall, sessionId: resolvedSessionId }) : /* @__PURE__ */ jsxs16(Fragment5, { children: [
5697
- /* @__PURE__ */ jsx20("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u5DE5\u5177" }),
5698
- /* @__PURE__ */ jsx20("div", { className: "mb-3 font-mono text-[11px] text-[hsl(var(--foreground))]", children: normalizedName }),
5699
- /* @__PURE__ */ jsx20("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u53C2\u6570" }),
5700
- /* @__PURE__ */ jsx20("pre", { className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[11px] text-[hsl(var(--foreground))]", children: formatArgs(toolCall.arguments) }),
5701
- toolCall.result != null && /* @__PURE__ */ jsxs16(Fragment5, { children: [
5702
- /* @__PURE__ */ jsx20("div", { className: "mb-1 mt-3 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u7ED3\u679C" }),
5703
- /* @__PURE__ */ jsx20(
5769
+ expanded && /* @__PURE__ */ jsx21("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: Renderer ? /* @__PURE__ */ jsx21(Renderer, { toolCall, sessionId: resolvedSessionId }) : /* @__PURE__ */ jsxs17(Fragment5, { children: [
5770
+ /* @__PURE__ */ jsx21("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u5DE5\u5177" }),
5771
+ /* @__PURE__ */ jsx21("div", { className: "mb-3 font-mono text-[11px] text-[hsl(var(--foreground))]", children: normalizedName }),
5772
+ /* @__PURE__ */ jsx21("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u53C2\u6570" }),
5773
+ /* @__PURE__ */ jsx21("pre", { className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[11px] text-[hsl(var(--foreground))]", children: formatArgs(toolCall.arguments) }),
5774
+ toolCall.result != null && /* @__PURE__ */ jsxs17(Fragment5, { children: [
5775
+ /* @__PURE__ */ jsx21("div", { className: "mb-1 mt-3 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u7ED3\u679C" }),
5776
+ /* @__PURE__ */ jsx21(
5704
5777
  "pre",
5705
5778
  {
5706
5779
  className: cn(
@@ -5891,7 +5964,7 @@ import { Download as Download3, X as X5 } from "lucide-react";
5891
5964
  import { useEffect as useEffect12 } from "react";
5892
5965
  import { createPortal as createPortal4 } from "react-dom";
5893
5966
  import { useQuery as useQuery6 } from "@tanstack/react-query";
5894
- import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
5967
+ import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
5895
5968
  function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }) {
5896
5969
  useEffect12(() => {
5897
5970
  if (!open) return;
@@ -5919,7 +5992,7 @@ function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }) {
5919
5992
  staleTime: 6e4
5920
5993
  });
5921
5994
  if (!open) return null;
5922
- const body = /* @__PURE__ */ jsx21(
5995
+ const body = /* @__PURE__ */ jsx22(
5923
5996
  "div",
5924
5997
  {
5925
5998
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",
@@ -5930,17 +6003,17 @@ function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }) {
5930
6003
  role: "dialog",
5931
6004
  "aria-modal": "true",
5932
6005
  "aria-labelledby": "attachment-preview-title",
5933
- children: /* @__PURE__ */ jsxs17(
6006
+ children: /* @__PURE__ */ jsxs18(
5934
6007
  "div",
5935
6008
  {
5936
6009
  className: "max-h-[90vh] w-full max-w-3xl overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--background))] shadow-2xl",
5937
6010
  onClick: (e) => e.stopPropagation(),
5938
6011
  onKeyDown: (e) => e.stopPropagation(),
5939
6012
  children: [
5940
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
5941
- /* @__PURE__ */ jsx21("h3", { id: "attachment-preview-title", className: "truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: filename }),
5942
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1", children: [
5943
- url && /* @__PURE__ */ jsx21(
6013
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
6014
+ /* @__PURE__ */ jsx22("h3", { id: "attachment-preview-title", className: "truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: filename }),
6015
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1", children: [
6016
+ url && /* @__PURE__ */ jsx22(
5944
6017
  "a",
5945
6018
  {
5946
6019
  href: url,
@@ -5949,22 +6022,22 @@ function AttachmentPreviewDialog({ open, onOpenChange, filename, url, mode }) {
5949
6022
  rel: "noopener noreferrer",
5950
6023
  title: "\u4E0B\u8F7D",
5951
6024
  className: "flex h-7 w-7 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
5952
- children: /* @__PURE__ */ jsx21(Download3, { size: 14 })
6025
+ children: /* @__PURE__ */ jsx22(Download3, { size: 14 })
5953
6026
  }
5954
6027
  ),
5955
- /* @__PURE__ */ jsx21(
6028
+ /* @__PURE__ */ jsx22(
5956
6029
  "button",
5957
6030
  {
5958
6031
  type: "button",
5959
6032
  onClick: () => onOpenChange(false),
5960
6033
  title: "\u5173\u95ED",
5961
6034
  className: "flex h-7 w-7 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
5962
- children: /* @__PURE__ */ jsx21(X5, { size: 14 })
6035
+ children: /* @__PURE__ */ jsx22(X5, { size: 14 })
5963
6036
  }
5964
6037
  )
5965
6038
  ] })
5966
6039
  ] }),
5967
- /* @__PURE__ */ jsx21("div", { className: "max-h-[calc(90vh-56px)] overflow-auto px-4 py-3 text-sm text-[hsl(var(--foreground))]", children: renderContent({ mode, url, content, error }) })
6040
+ /* @__PURE__ */ jsx22("div", { className: "max-h-[calc(90vh-56px)] overflow-auto px-4 py-3 text-sm text-[hsl(var(--foreground))]", children: renderContent({ mode, url, content, error }) })
5968
6041
  ]
5969
6042
  }
5970
6043
  )
@@ -5979,43 +6052,43 @@ function renderContent({
5979
6052
  error
5980
6053
  }) {
5981
6054
  if (!url) {
5982
- return /* @__PURE__ */ jsx21("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u6B64\u9644\u4EF6\u6682\u65E0\u53EF\u7528\u9884\u89C8\u5730\u5740\u3002" });
6055
+ return /* @__PURE__ */ jsx22("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u6B64\u9644\u4EF6\u6682\u65E0\u53EF\u7528\u9884\u89C8\u5730\u5740\u3002" });
5983
6056
  }
5984
6057
  if (mode === "default") {
5985
- return /* @__PURE__ */ jsxs17("p", { className: "text-[hsl(var(--muted-foreground))]", children: [
6058
+ return /* @__PURE__ */ jsxs18("p", { className: "text-[hsl(var(--muted-foreground))]", children: [
5986
6059
  "\u6B64\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u5185\u5D4C\u9884\u89C8\u3002\u8BF7\u70B9\u51FB\u53F3\u4E0A\u89D2",
5987
- /* @__PURE__ */ jsx21("span", { className: "mx-1 font-medium text-[hsl(var(--foreground))]", children: "\u4E0B\u8F7D" }),
6060
+ /* @__PURE__ */ jsx22("span", { className: "mx-1 font-medium text-[hsl(var(--foreground))]", children: "\u4E0B\u8F7D" }),
5988
6061
  "\u6309\u94AE\u67E5\u770B\u3002"
5989
6062
  ] });
5990
6063
  }
5991
6064
  if (error) {
5992
- return /* @__PURE__ */ jsxs17("p", { className: "text-[hsl(var(--destructive))]", children: [
6065
+ return /* @__PURE__ */ jsxs18("p", { className: "text-[hsl(var(--destructive))]", children: [
5993
6066
  "\u52A0\u8F7D\u5931\u8D25\uFF1A",
5994
6067
  String(error?.message ?? error)
5995
6068
  ] });
5996
6069
  }
5997
6070
  if (content == null) {
5998
- return /* @__PURE__ */ jsx21("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u52A0\u8F7D\u4E2D\u2026" });
6071
+ return /* @__PURE__ */ jsx22("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u52A0\u8F7D\u4E2D\u2026" });
5999
6072
  }
6000
6073
  if (mode === "markdown") {
6001
- return /* @__PURE__ */ jsx21(MarkdownContent, { className: "prose prose-sm prose-invert max-w-none", children: content });
6074
+ return /* @__PURE__ */ jsx22(MarkdownContent, { className: "prose prose-sm prose-invert max-w-none", children: content });
6002
6075
  }
6003
- return /* @__PURE__ */ jsx21("pre", { className: "whitespace-pre-wrap font-mono text-xs leading-relaxed", children: content });
6076
+ return /* @__PURE__ */ jsx22("pre", { className: "whitespace-pre-wrap font-mono text-xs leading-relaxed", children: content });
6004
6077
  }
6005
6078
 
6006
6079
  // src/react/components/chat/MessageContextPills.tsx
6007
6080
  import { Bookmark } from "lucide-react";
6008
- import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
6081
+ import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
6009
6082
  function MessageContextPills({ contexts }) {
6010
6083
  if (contexts.length === 0) return null;
6011
- return /* @__PURE__ */ jsx22("div", { className: "flex flex-wrap gap-1.5", children: contexts.map((ctx, index) => /* @__PURE__ */ jsxs18(
6084
+ return /* @__PURE__ */ jsx23("div", { className: "flex flex-wrap gap-1.5", children: contexts.map((ctx, index) => /* @__PURE__ */ jsxs19(
6012
6085
  "div",
6013
6086
  {
6014
6087
  className: "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--primary)/0.25)] bg-[hsl(var(--primary)/0.1)] px-2.5 py-1 text-[11px] text-[hsl(var(--primary)/0.85)]",
6015
6088
  title: ctx.content,
6016
6089
  children: [
6017
- /* @__PURE__ */ jsx22(Bookmark, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.65)]" }),
6018
- /* @__PURE__ */ jsx22("span", { className: "max-w-56 truncate", children: ctx.label })
6090
+ /* @__PURE__ */ jsx23(Bookmark, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.65)]" }),
6091
+ /* @__PURE__ */ jsx23("span", { className: "max-w-56 truncate", children: ctx.label })
6019
6092
  ]
6020
6093
  },
6021
6094
  `${ctx.label}:${index}`
@@ -6024,7 +6097,7 @@ function MessageContextPills({ contexts }) {
6024
6097
 
6025
6098
  // src/react/components/chat/MessageFileAttachmentList.tsx
6026
6099
  import { Archive as Archive2, File as File3, FileCode2 as FileCode22, FileText as FileText4, Film as Film2, Music as Music2 } from "lucide-react";
6027
- import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
6100
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
6028
6101
  function getFileIcon(fileName) {
6029
6102
  const lowerName = fileName.toLowerCase();
6030
6103
  if (/\.(zip|rar|7z|tar|gz|bz2|xz)$/.test(lowerName)) {
@@ -6053,15 +6126,15 @@ function MessageFileAttachmentList({
6053
6126
  return null;
6054
6127
  }
6055
6128
  const pillClass = "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2.5 py-1 text-[11px] text-[hsl(var(--foreground))]";
6056
- return /* @__PURE__ */ jsx23("div", { className: cn("flex flex-wrap gap-1.5", className), children: files.map((file) => {
6129
+ return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-wrap gap-1.5", className), children: files.map((file) => {
6057
6130
  const Icon = getFileIcon(file.name);
6058
6131
  const key = `${file.name}-${file.data.slice(0, 32)}`;
6059
- const content = /* @__PURE__ */ jsxs19(Fragment6, { children: [
6060
- /* @__PURE__ */ jsx23(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
6061
- /* @__PURE__ */ jsx23("span", { className: "max-w-32 truncate", children: file.name })
6132
+ const content = /* @__PURE__ */ jsxs20(Fragment6, { children: [
6133
+ /* @__PURE__ */ jsx24(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
6134
+ /* @__PURE__ */ jsx24("span", { className: "max-w-32 truncate", children: file.name })
6062
6135
  ] });
6063
6136
  if (onPreview) {
6064
- return /* @__PURE__ */ jsx23(
6137
+ return /* @__PURE__ */ jsx24(
6065
6138
  "button",
6066
6139
  {
6067
6140
  type: "button",
@@ -6073,14 +6146,14 @@ function MessageFileAttachmentList({
6073
6146
  key
6074
6147
  );
6075
6148
  }
6076
- return /* @__PURE__ */ jsx23("div", { className: pillClass, title: file.name, children: content }, key);
6149
+ return /* @__PURE__ */ jsx24("div", { className: pillClass, title: file.name, children: content }, key);
6077
6150
  }) });
6078
6151
  }
6079
6152
 
6080
6153
  // src/react/components/chat/MessageActions.tsx
6081
6154
  import { Check as Check2, Copy } from "lucide-react";
6082
6155
  import { useState as useState15 } from "react";
6083
- import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
6156
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
6084
6157
  function MessageActions({ content, className }) {
6085
6158
  const [copied, setCopied] = useState15(false);
6086
6159
  const handleCopy = async () => {
@@ -6090,7 +6163,7 @@ function MessageActions({ content, className }) {
6090
6163
  setTimeout(() => setCopied(false), 2e3);
6091
6164
  }
6092
6165
  };
6093
- return /* @__PURE__ */ jsx24("div", { className: cn("flex items-center gap-1 mt-1.5", className), children: /* @__PURE__ */ jsxs20(
6166
+ return /* @__PURE__ */ jsx25("div", { className: cn("flex items-center gap-1 mt-1.5", className), children: /* @__PURE__ */ jsxs21(
6094
6167
  "button",
6095
6168
  {
6096
6169
  type: "button",
@@ -6100,8 +6173,8 @@ function MessageActions({ content, className }) {
6100
6173
  copied ? "text-[hsl(var(--primary))]" : "text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))]"
6101
6174
  ),
6102
6175
  children: [
6103
- copied ? /* @__PURE__ */ jsx24(Check2, { size: 12 }) : /* @__PURE__ */ jsx24(Copy, { size: 12 }),
6104
- /* @__PURE__ */ jsx24("span", { children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236" })
6176
+ copied ? /* @__PURE__ */ jsx25(Check2, { size: 12 }) : /* @__PURE__ */ jsx25(Copy, { size: 12 }),
6177
+ /* @__PURE__ */ jsx25("span", { children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236" })
6105
6178
  ]
6106
6179
  }
6107
6180
  ) });
@@ -6109,7 +6182,7 @@ function MessageActions({ content, className }) {
6109
6182
 
6110
6183
  // src/react/components/chat/TextAttachmentPills.tsx
6111
6184
  import { Archive as Archive3, File as File4, FileCode2 as FileCode23, FileText as FileText5, Film as Film3, Music as Music3, FileSpreadsheet, Image } from "lucide-react";
6112
- import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
6185
+ import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
6113
6186
  function getFileIcon2(fileName) {
6114
6187
  const lower2 = fileName.toLowerCase();
6115
6188
  if (/\.(zip|rar|7z|tar|gz)$/.test(lower2)) return Archive3;
@@ -6124,15 +6197,15 @@ function getFileIcon2(fileName) {
6124
6197
  function TextAttachmentPills({ attachments, onPreview }) {
6125
6198
  if (attachments.length === 0) return null;
6126
6199
  const pillClass = "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--primary)/0.2)] bg-[hsl(var(--primary)/0.08)] px-2.5 py-1 text-[11px] text-[hsl(var(--primary)/0.8)]";
6127
- return /* @__PURE__ */ jsx25("div", { className: "flex flex-wrap gap-1.5", children: attachments.map((att, index) => {
6200
+ return /* @__PURE__ */ jsx26("div", { className: "flex flex-wrap gap-1.5", children: attachments.map((att, index) => {
6128
6201
  const Icon = getFileIcon2(att.name);
6129
6202
  const key = `${att.uploadedPath ?? att.name}:${att.name}:${index}`;
6130
- const content = /* @__PURE__ */ jsxs21(Fragment7, { children: [
6131
- /* @__PURE__ */ jsx25(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.6)]" }),
6132
- /* @__PURE__ */ jsx25("span", { className: "max-w-40 truncate", children: att.name })
6203
+ const content = /* @__PURE__ */ jsxs22(Fragment7, { children: [
6204
+ /* @__PURE__ */ jsx26(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.6)]" }),
6205
+ /* @__PURE__ */ jsx26("span", { className: "max-w-40 truncate", children: att.name })
6133
6206
  ] });
6134
6207
  if (onPreview) {
6135
- return /* @__PURE__ */ jsx25(
6208
+ return /* @__PURE__ */ jsx26(
6136
6209
  "button",
6137
6210
  {
6138
6211
  type: "button",
@@ -6144,7 +6217,7 @@ function TextAttachmentPills({ attachments, onPreview }) {
6144
6217
  key
6145
6218
  );
6146
6219
  }
6147
- return /* @__PURE__ */ jsx25("div", { className: pillClass, title: att.name, children: content }, key);
6220
+ return /* @__PURE__ */ jsx26("div", { className: pillClass, title: att.name, children: content }, key);
6148
6221
  }) });
6149
6222
  }
6150
6223
 
@@ -6153,34 +6226,34 @@ import { RefreshCcw } from "lucide-react";
6153
6226
 
6154
6227
  // src/react/components/chat/whatif-quote-context.tsx
6155
6228
  import { createContext as createContext3, useContext as useContext3, useMemo as useMemo13 } from "react";
6156
- import { jsx as jsx26 } from "react/jsx-runtime";
6229
+ import { jsx as jsx27 } from "react/jsx-runtime";
6157
6230
  var WhatIfQuoteContext = createContext3({});
6158
6231
  function WhatIfQuoteProvider({
6159
6232
  onJumpToStep,
6160
6233
  children
6161
6234
  }) {
6162
6235
  const value = useMemo13(() => ({ onJumpToStep }), [onJumpToStep]);
6163
- return /* @__PURE__ */ jsx26(WhatIfQuoteContext.Provider, { value, children });
6236
+ return /* @__PURE__ */ jsx27(WhatIfQuoteContext.Provider, { value, children });
6164
6237
  }
6165
6238
  function useWhatIfQuoteContext() {
6166
6239
  return useContext3(WhatIfQuoteContext);
6167
6240
  }
6168
6241
 
6169
6242
  // src/react/components/chat/WhatIfUserBubble.tsx
6170
- import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
6243
+ import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
6171
6244
  function WhatIfUserBubble({ parsed, onQuoteClick }) {
6172
6245
  const { onJumpToStep } = useWhatIfQuoteContext();
6173
6246
  const handleQuoteClick = onQuoteClick ?? onJumpToStep;
6174
6247
  const { fromStep, quotes, userText } = parsed;
6175
- return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-end gap-2", children: [
6176
- /* @__PURE__ */ jsxs22("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: [
6177
- /* @__PURE__ */ jsx27(RefreshCcw, { size: 10 }),
6178
- /* @__PURE__ */ jsx27("span", { children: fromStep != null ? `\u91CD\u8DD1\u81EA step ${fromStep}` : "\u91CD\u8DD1" })
6248
+ return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col items-end gap-2", children: [
6249
+ /* @__PURE__ */ jsxs23("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: [
6250
+ /* @__PURE__ */ jsx28(RefreshCcw, { size: 10 }),
6251
+ /* @__PURE__ */ jsx28("span", { children: fromStep != null ? `\u91CD\u8DD1\u81EA step ${fromStep}` : "\u91CD\u8DD1" })
6179
6252
  ] }),
6180
- quotes.length > 0 && /* @__PURE__ */ jsx27("div", { className: "flex flex-wrap justify-end gap-1.5", children: quotes.map((q, i) => {
6253
+ quotes.length > 0 && /* @__PURE__ */ jsx28("div", { className: "flex flex-wrap justify-end gap-1.5", children: quotes.map((q, i) => {
6181
6254
  const clickable = q.stepNumber != null && !!handleQuoteClick;
6182
6255
  const label = q.stepNumber != null ? `\u6B65\u9AA4${q.stepNumber} \xB7 ${q.label}` : q.label;
6183
- return /* @__PURE__ */ jsxs22(
6256
+ return /* @__PURE__ */ jsxs23(
6184
6257
  "button",
6185
6258
  {
6186
6259
  type: "button",
@@ -6189,14 +6262,14 @@ function WhatIfUserBubble({ parsed, onQuoteClick }) {
6189
6262
  className: "inline-flex items-center gap-1 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2.5 py-0.5 text-[11px] text-[hsl(var(--muted-foreground))] transition-colors hover:border-[hsl(var(--ring)/0.5)] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))] disabled:cursor-default disabled:hover:border-[hsl(var(--border))] disabled:hover:bg-[hsl(var(--card))]",
6190
6263
  title: clickable ? "\u8DF3\u8F6C\u5230\u5BF9\u5E94\u6B65\u9AA4\u5361\u7247" : void 0,
6191
6264
  children: [
6192
- /* @__PURE__ */ jsx27("span", { children: "\u21B3" }),
6193
- /* @__PURE__ */ jsx27("span", { className: "max-w-[14rem] truncate", children: label })
6265
+ /* @__PURE__ */ jsx28("span", { children: "\u21B3" }),
6266
+ /* @__PURE__ */ jsx28("span", { className: "max-w-[14rem] truncate", children: label })
6194
6267
  ]
6195
6268
  },
6196
6269
  `${q.stepNumber ?? "x"}-${i}`
6197
6270
  );
6198
6271
  }) }),
6199
- userText && /* @__PURE__ */ jsx27("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))] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]", children: /* @__PURE__ */ jsx27(
6272
+ userText && /* @__PURE__ */ jsx28("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))] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]", children: /* @__PURE__ */ jsx28(
6200
6273
  MarkdownContent,
6201
6274
  {
6202
6275
  className: "prose prose-sm prose-invert max-w-none [&_li>p]:inline [&_p]:mb-3 [&_p:last-child]:mb-0",
@@ -6208,7 +6281,7 @@ function WhatIfUserBubble({ parsed, onQuoteClick }) {
6208
6281
  }
6209
6282
 
6210
6283
  // src/react/components/chat/UserMessageBubble.tsx
6211
- import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
6284
+ import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
6212
6285
  function isUserMessage(message) {
6213
6286
  return message.role === "user";
6214
6287
  }
@@ -6237,9 +6310,9 @@ function UserMessageBubble({ message, className }) {
6237
6310
  const trimmedClean = cleanText.trim();
6238
6311
  const whatifParsed = trimmedClean && imageParts.length === 0 && fileParts.length === 0 && textAttachments.length === 0 ? parseWhatIfPrompt(cleanText) : null;
6239
6312
  if (whatifParsed) {
6240
- return /* @__PURE__ */ jsx28("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs23("div", { className: "group flex max-w-[72%] flex-col items-end gap-2", children: [
6241
- /* @__PURE__ */ jsx28(WhatIfUserBubble, { parsed: whatifParsed }),
6242
- whatifParsed.userText && /* @__PURE__ */ jsx28(
6313
+ return /* @__PURE__ */ jsx29("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs24("div", { className: "group flex max-w-[72%] flex-col items-end gap-2", children: [
6314
+ /* @__PURE__ */ jsx29(WhatIfUserBubble, { parsed: whatifParsed }),
6315
+ whatifParsed.userText && /* @__PURE__ */ jsx29(
6243
6316
  MessageActions,
6244
6317
  {
6245
6318
  content: whatifParsed.userText,
@@ -6311,16 +6384,16 @@ function UserMessageBubble({ message, className }) {
6311
6384
  const mode = kind === "text" ? lower2.endsWith(".md") ? "markdown" : "text" : "default";
6312
6385
  setPreview({ filename: attachment.name, url, mode });
6313
6386
  };
6314
- return /* @__PURE__ */ jsx28("div", { className: cn("flex justify-end", className), children: /* @__PURE__ */ jsxs23("div", { className: "group flex max-w-[72%] flex-col items-end gap-3", children: [
6315
- (imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */ jsxs23("div", { className: "grid gap-2", children: [
6316
- imageParts.map((part, idx) => /* @__PURE__ */ jsx28(
6387
+ return /* @__PURE__ */ jsx29("div", { className: cn("flex justify-end", className), children: /* @__PURE__ */ jsxs24("div", { className: "group flex max-w-[72%] flex-col items-end gap-3", children: [
6388
+ (imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */ jsxs24("div", { className: "grid gap-2", children: [
6389
+ imageParts.map((part, idx) => /* @__PURE__ */ jsx29(
6317
6390
  "button",
6318
6391
  {
6319
6392
  type: "button",
6320
6393
  onClick: () => setLightboxIndex(idx),
6321
6394
  className: "cursor-zoom-in",
6322
6395
  title: "\u67E5\u770B\u5927\u56FE",
6323
- children: /* @__PURE__ */ jsx28(
6396
+ children: /* @__PURE__ */ jsx29(
6324
6397
  "img",
6325
6398
  {
6326
6399
  src: part.image_url.url,
@@ -6333,14 +6406,14 @@ function UserMessageBubble({ message, className }) {
6333
6406
  )),
6334
6407
  imageTextAttachmentMeta.map((att, idx) => {
6335
6408
  const blobUrl = imageAttachmentQueries[idx]?.data;
6336
- return blobUrl ? /* @__PURE__ */ jsx28(
6409
+ return blobUrl ? /* @__PURE__ */ jsx29(
6337
6410
  "button",
6338
6411
  {
6339
6412
  type: "button",
6340
6413
  onClick: () => setLightboxIndex(imageParts.length + idx),
6341
6414
  className: "cursor-zoom-in",
6342
6415
  title: "\u67E5\u770B\u5927\u56FE",
6343
- children: /* @__PURE__ */ jsx28(
6416
+ children: /* @__PURE__ */ jsx29(
6344
6417
  "img",
6345
6418
  {
6346
6419
  src: blobUrl,
@@ -6350,7 +6423,7 @@ function UserMessageBubble({ message, className }) {
6350
6423
  )
6351
6424
  },
6352
6425
  `${att.uploadedPath}:${att.name}`
6353
- ) : imageAttachmentQueries[idx]?.isError ? null : /* @__PURE__ */ jsx28(
6426
+ ) : imageAttachmentQueries[idx]?.isError ? null : /* @__PURE__ */ jsx29(
6354
6427
  "div",
6355
6428
  {
6356
6429
  className: "flex h-20 items-center justify-center rounded-xl border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--muted)/0.3)] text-xs text-[hsl(var(--muted-foreground))]",
@@ -6360,7 +6433,7 @@ function UserMessageBubble({ message, className }) {
6360
6433
  );
6361
6434
  })
6362
6435
  ] }),
6363
- lightboxImages.length > 0 && /* @__PURE__ */ jsx28(
6436
+ lightboxImages.length > 0 && /* @__PURE__ */ jsx29(
6364
6437
  ImageLightbox,
6365
6438
  {
6366
6439
  open: lightboxIndex != null,
@@ -6371,15 +6444,15 @@ function UserMessageBubble({ message, className }) {
6371
6444
  initialIndex: lightboxIndex ?? 0
6372
6445
  }
6373
6446
  ),
6374
- /* @__PURE__ */ jsx28(MessageFileAttachmentList, { files: fileParts }),
6375
- /* @__PURE__ */ jsx28(
6447
+ /* @__PURE__ */ jsx29(MessageFileAttachmentList, { files: fileParts }),
6448
+ /* @__PURE__ */ jsx29(
6376
6449
  TextAttachmentPills,
6377
6450
  {
6378
6451
  attachments: nonImageTextAttachments,
6379
6452
  onPreview: handleTextAttachmentPreview
6380
6453
  }
6381
6454
  ),
6382
- preview && /* @__PURE__ */ jsx28(
6455
+ preview && /* @__PURE__ */ jsx29(
6383
6456
  AttachmentPreviewDialog,
6384
6457
  {
6385
6458
  open: preview != null,
@@ -6391,8 +6464,8 @@ function UserMessageBubble({ message, className }) {
6391
6464
  mode: preview.mode
6392
6465
  }
6393
6466
  ),
6394
- /* @__PURE__ */ jsx28(MessageContextPills, { contexts: textContexts }),
6395
- trimmedClean && /* @__PURE__ */ jsx28("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))] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]", children: /* @__PURE__ */ jsx28(
6467
+ /* @__PURE__ */ jsx29(MessageContextPills, { contexts: textContexts }),
6468
+ trimmedClean && /* @__PURE__ */ jsx29("div", { className: "max-w-full 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))] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]", children: /* @__PURE__ */ jsx29(
6396
6469
  MarkdownContent,
6397
6470
  {
6398
6471
  className: USER_MESSAGE_MARKDOWN_CLASS,
@@ -6400,7 +6473,7 @@ function UserMessageBubble({ message, className }) {
6400
6473
  children: cleanText
6401
6474
  }
6402
6475
  ) }),
6403
- trimmedClean && /* @__PURE__ */ jsx28(
6476
+ trimmedClean && /* @__PURE__ */ jsx29(
6404
6477
  MessageActions,
6405
6478
  {
6406
6479
  content: cleanText,
@@ -6415,14 +6488,14 @@ function ErrorMessageBlock({
6415
6488
  }) {
6416
6489
  const text = getTextContent(message.content);
6417
6490
  const looksLikeModelUnavailable = /no source matches this model|404/i.test(text);
6418
- return /* @__PURE__ */ jsx28("div", { className: cn("flex justify-center", className), children: /* @__PURE__ */ jsxs23("div", { className: "max-w-[85%] border-l-[3px] border-[hsl(var(--destructive))] px-4 py-1 text-sm leading-7 text-[hsl(var(--destructive))]", children: [
6491
+ return /* @__PURE__ */ jsx29("div", { className: cn("flex justify-center", className), children: /* @__PURE__ */ jsxs24("div", { className: "max-w-[85%] border-l-[3px] border-[hsl(var(--destructive))] px-4 py-1 text-sm leading-7 text-[hsl(var(--destructive))]", children: [
6419
6492
  text,
6420
- looksLikeModelUnavailable ? /* @__PURE__ */ jsx28("div", { className: "mt-1 opacity-80", children: "\u6A21\u578B\u53EF\u80FD\u672A\u542F\u52A8\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" }) : null
6493
+ looksLikeModelUnavailable ? /* @__PURE__ */ jsx29("div", { className: "mt-1 opacity-80", children: "\u6A21\u578B\u53EF\u80FD\u672A\u542F\u52A8\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" }) : null
6421
6494
  ] }) });
6422
6495
  }
6423
6496
 
6424
6497
  // src/react/components/chat/AgentLoopBlock.tsx
6425
- import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
6498
+ import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
6426
6499
  var EMPTY_MESSAGES2 = [];
6427
6500
  var EMPTY_AGENT_LOOPS = {};
6428
6501
  var COLLAPSED_SUMMARY_HIDDEN_TOOLS = /* @__PURE__ */ new Set(["ReadSkill", "Read"]);
@@ -6522,7 +6595,7 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6522
6595
  const description = safeParseDescription(toolCall.arguments);
6523
6596
  const status = hasAwaitingAnswer || toolCall.status === "awaiting_answer" ? "awaiting_answer" : toolCall.status === "pending" || loopEntry?.info.status === "running" ? "running" : "done";
6524
6597
  const cardStyles = getLoopCardStyles(status);
6525
- return /* @__PURE__ */ jsxs24(
6598
+ return /* @__PURE__ */ jsxs25(
6526
6599
  "div",
6527
6600
  {
6528
6601
  className: cn(
@@ -6530,8 +6603,8 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6530
6603
  cardStyles.borderClass
6531
6604
  ),
6532
6605
  children: [
6533
- status === "running" || status === "awaiting_answer" ? /* @__PURE__ */ jsxs24(Fragment8, { children: [
6534
- /* @__PURE__ */ jsxs24(
6606
+ status === "running" || status === "awaiting_answer" ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
6607
+ /* @__PURE__ */ jsxs25(
6535
6608
  "div",
6536
6609
  {
6537
6610
  className: cn(
@@ -6539,24 +6612,24 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6539
6612
  cardStyles.headerClass
6540
6613
  ),
6541
6614
  children: [
6542
- /* @__PURE__ */ jsx29(
6615
+ /* @__PURE__ */ jsx30(
6543
6616
  "button",
6544
6617
  {
6545
6618
  type: "button",
6546
6619
  onClick: toggleExpanded,
6547
6620
  "aria-expanded": expanded,
6548
6621
  className: "flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
6549
- children: /* @__PURE__ */ jsxs24("span", { className: "min-w-0 flex items-center gap-2", children: [
6550
- status === "awaiting_answer" ? /* @__PURE__ */ jsx29(MessageSquareMore2, { size: 14, className: "shrink-0 text-amber-500" }) : /* @__PURE__ */ jsx29(Bot, { size: 14, className: "shrink-0 text-blue-500" }),
6551
- /* @__PURE__ */ jsxs24("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: [
6622
+ children: /* @__PURE__ */ jsxs25("span", { className: "min-w-0 flex items-center gap-2", children: [
6623
+ status === "awaiting_answer" ? /* @__PURE__ */ jsx30(MessageSquareMore2, { size: 14, className: "shrink-0 text-amber-500" }) : /* @__PURE__ */ jsx30(Bot, { size: 14, className: "shrink-0 text-blue-500" }),
6624
+ /* @__PURE__ */ jsxs25("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: [
6552
6625
  description,
6553
6626
  status === "awaiting_answer" ? " \u2014 \u7B49\u5F85\u56DE\u7B54" : ""
6554
6627
  ] })
6555
6628
  ] })
6556
6629
  }
6557
6630
  ),
6558
- reasoning ? /* @__PURE__ */ jsx29(ThinkingBadge, { reasoning, variant: "block" }) : null,
6559
- /* @__PURE__ */ jsx29(
6631
+ reasoning ? /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning, variant: "block" }) : null,
6632
+ /* @__PURE__ */ jsx30(
6560
6633
  Bot,
6561
6634
  {
6562
6635
  size: 13,
@@ -6564,14 +6637,14 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6564
6637
  "aria-label": "\u5B50\u667A\u80FD\u4F53"
6565
6638
  }
6566
6639
  ),
6567
- /* @__PURE__ */ jsx29(
6640
+ /* @__PURE__ */ jsx30(
6568
6641
  "button",
6569
6642
  {
6570
6643
  type: "button",
6571
6644
  onClick: toggleExpanded,
6572
6645
  "aria-expanded": expanded,
6573
6646
  className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--muted))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
6574
- children: /* @__PURE__ */ jsx29(
6647
+ children: /* @__PURE__ */ jsx30(
6575
6648
  ChevronRight4,
6576
6649
  {
6577
6650
  size: 14,
@@ -6586,7 +6659,7 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6586
6659
  ]
6587
6660
  }
6588
6661
  ),
6589
- !expanded ? /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-1 py-2", children: visibleLoopToolCalls.length > 0 ? visibleLoopToolCalls.map((childToolCall) => /* @__PURE__ */ jsx29(
6662
+ !expanded ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-1 py-2", children: visibleLoopToolCalls.length > 0 ? visibleLoopToolCalls.map((childToolCall) => /* @__PURE__ */ jsx30(
6590
6663
  ToolCallBlock,
6591
6664
  {
6592
6665
  toolCall: childToolCall,
@@ -6594,12 +6667,12 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6594
6667
  level: 2
6595
6668
  },
6596
6669
  childToolCall.id
6597
- )) : /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
6598
- /* @__PURE__ */ jsx29(Loader24, { size: 12, className: "shrink-0 animate-spin text-blue-500" }),
6599
- /* @__PURE__ */ jsx29("span", { children: "\u6B63\u5728\u542F\u52A8..." })
6600
- ] }) }) : status === "awaiting_answer" ? /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-1 py-2", children: /* @__PURE__ */ jsx29("div", { className: "px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: "\u8BF7\u5728\u4E0B\u65B9\u5B50\u667A\u80FD\u4F53\u5BF9\u8BDD\u4E2D\u5B8C\u6210\u786E\u8BA4" }) }) : null
6601
- ] }) : /* @__PURE__ */ jsxs24(Fragment8, { children: [
6602
- /* @__PURE__ */ jsxs24(
6670
+ )) : /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2 px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
6671
+ /* @__PURE__ */ jsx30(Loader24, { size: 12, className: "shrink-0 animate-spin text-blue-500" }),
6672
+ /* @__PURE__ */ jsx30("span", { children: "\u6B63\u5728\u542F\u52A8..." })
6673
+ ] }) }) : status === "awaiting_answer" ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-1 py-2", children: /* @__PURE__ */ jsx30("div", { className: "px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: "\u8BF7\u5728\u4E0B\u65B9\u5B50\u667A\u80FD\u4F53\u5BF9\u8BDD\u4E2D\u5B8C\u6210\u786E\u8BA4" }) }) : null
6674
+ ] }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
6675
+ /* @__PURE__ */ jsxs25(
6603
6676
  "div",
6604
6677
  {
6605
6678
  className: cn(
@@ -6607,21 +6680,21 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6607
6680
  cardStyles.headerClass
6608
6681
  ),
6609
6682
  children: [
6610
- /* @__PURE__ */ jsx29(
6683
+ /* @__PURE__ */ jsx30(
6611
6684
  "button",
6612
6685
  {
6613
6686
  type: "button",
6614
6687
  onClick: toggleExpanded,
6615
6688
  "aria-expanded": expanded,
6616
6689
  className: "flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
6617
- children: /* @__PURE__ */ jsxs24("span", { className: "min-w-0 flex items-center gap-2", children: [
6618
- /* @__PURE__ */ jsx29(Check3, { size: 14, className: "shrink-0 text-emerald-500" }),
6619
- /* @__PURE__ */ jsx29("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: description })
6690
+ children: /* @__PURE__ */ jsxs25("span", { className: "min-w-0 flex items-center gap-2", children: [
6691
+ /* @__PURE__ */ jsx30(Check3, { size: 14, className: "shrink-0 text-emerald-500" }),
6692
+ /* @__PURE__ */ jsx30("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: description })
6620
6693
  ] })
6621
6694
  }
6622
6695
  ),
6623
- reasoning ? /* @__PURE__ */ jsx29(ThinkingBadge, { reasoning, variant: "block" }) : null,
6624
- /* @__PURE__ */ jsx29(
6696
+ reasoning ? /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning, variant: "block" }) : null,
6697
+ /* @__PURE__ */ jsx30(
6625
6698
  Bot,
6626
6699
  {
6627
6700
  size: 13,
@@ -6629,14 +6702,14 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6629
6702
  "aria-label": "\u5B50\u667A\u80FD\u4F53"
6630
6703
  }
6631
6704
  ),
6632
- /* @__PURE__ */ jsx29(
6705
+ /* @__PURE__ */ jsx30(
6633
6706
  "button",
6634
6707
  {
6635
6708
  type: "button",
6636
6709
  onClick: toggleExpanded,
6637
6710
  "aria-expanded": expanded,
6638
6711
  className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--muted))] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
6639
- children: /* @__PURE__ */ jsx29(
6712
+ children: /* @__PURE__ */ jsx30(
6640
6713
  ChevronRight4,
6641
6714
  {
6642
6715
  size: 14,
@@ -6651,9 +6724,9 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6651
6724
  ]
6652
6725
  }
6653
6726
  ),
6654
- !expanded ? /* @__PURE__ */ jsxs24(Fragment8, { children: [
6655
- /* @__PURE__ */ jsx29("div", { className: "flex flex-wrap gap-1.5 px-4 py-2", children: completedToolLabels.length > 0 ? completedToolLabels.map(
6656
- (item) => item.kind === "file" ? /* @__PURE__ */ jsxs24(
6727
+ !expanded ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
6728
+ /* @__PURE__ */ jsx30("div", { className: "flex flex-wrap gap-1.5 px-4 py-2", children: completedToolLabels.length > 0 ? completedToolLabels.map(
6729
+ (item) => item.kind === "file" ? /* @__PURE__ */ jsxs25(
6657
6730
  "span",
6658
6731
  {
6659
6732
  className: "inline-flex min-w-0 items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-semibold dark:border-emerald-500/25 dark:bg-emerald-500/10 dark:text-emerald-300",
@@ -6664,12 +6737,12 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6664
6737
  },
6665
6738
  title: item.label,
6666
6739
  children: [
6667
- /* @__PURE__ */ jsx29(FileText6, { size: 12, className: "shrink-0", "aria-hidden": "true" }),
6668
- /* @__PURE__ */ jsx29("span", { className: "truncate", children: item.label })
6740
+ /* @__PURE__ */ jsx30(FileText6, { size: 12, className: "shrink-0", "aria-hidden": "true" }),
6741
+ /* @__PURE__ */ jsx30("span", { className: "truncate", children: item.label })
6669
6742
  ]
6670
6743
  },
6671
6744
  item.key
6672
- ) : /* @__PURE__ */ jsx29(
6745
+ ) : /* @__PURE__ */ jsx30(
6673
6746
  "span",
6674
6747
  {
6675
6748
  className: "inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold dark:border-blue-300 dark:bg-blue-400/10 dark:text-blue-300",
@@ -6682,20 +6755,20 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6682
6755
  },
6683
6756
  item.key
6684
6757
  )
6685
- ) : /* @__PURE__ */ jsx29("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u5DE5\u5177\u8C03\u7528" }) }),
6686
- inlineToolUiBlocks.length > 0 ? /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-2 px-4 pb-3", children: inlineToolUiBlocks.map((block) => /* @__PURE__ */ jsx29(ResourceIframe, { ui: block.ui, sessionId }, block.key)) }) : null
6758
+ ) : /* @__PURE__ */ jsx30("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u5DE5\u5177\u8C03\u7528" }) }),
6759
+ inlineToolUiBlocks.length > 0 ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-2 px-4 pb-3", children: inlineToolUiBlocks.map((block) => /* @__PURE__ */ jsx30(ResourceIframe, { ui: block.ui, sessionId }, block.key)) }) : null
6687
6760
  ] }) : null
6688
6761
  ] }),
6689
- expanded && /* @__PURE__ */ jsxs24("div", { className: "border-t border-[hsl(var(--border))] py-2", children: [
6762
+ expanded && /* @__PURE__ */ jsxs25("div", { className: "border-t border-[hsl(var(--border))] py-2", children: [
6690
6763
  (() => {
6691
6764
  const taskPrompt = safeParsePrompt(toolCall.arguments);
6692
- return taskPrompt ? /* @__PURE__ */ jsxs24("details", { className: "mx-3 mb-2 rounded-md bg-[hsl(var(--muted))]/40", children: [
6693
- /* @__PURE__ */ jsx29("summary", { className: "cursor-pointer px-3 py-1.5 text-[11px] font-medium text-[hsl(var(--muted-foreground))]", children: "\u4EFB\u52A1" }),
6694
- /* @__PURE__ */ jsx29("div", { className: "px-3 pb-2", children: /* @__PURE__ */ jsx29("pre", { className: "whitespace-pre-wrap text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: taskPrompt }) })
6765
+ return taskPrompt ? /* @__PURE__ */ jsxs25("details", { className: "mx-3 mb-2 rounded-md bg-[hsl(var(--muted))]/40", children: [
6766
+ /* @__PURE__ */ jsx30("summary", { className: "cursor-pointer px-3 py-1.5 text-[11px] font-medium text-[hsl(var(--muted-foreground))]", children: "\u4EFB\u52A1" }),
6767
+ /* @__PURE__ */ jsx30("div", { className: "px-3 pb-2", children: /* @__PURE__ */ jsx30("pre", { className: "whitespace-pre-wrap text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: taskPrompt }) })
6695
6768
  ] }) : null;
6696
6769
  })(),
6697
- childMessages.length > 0 ? /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-3 px-3", children: childMessages.map(
6698
- (message, index) => message.role === "assistant" ? /* @__PURE__ */ jsx29(
6770
+ childMessages.length > 0 ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-3 px-3", children: childMessages.map(
6771
+ (message, index) => message.role === "assistant" ? /* @__PURE__ */ jsx30(
6699
6772
  ExpandedChildAssistantMessage,
6700
6773
  {
6701
6774
  message,
@@ -6703,13 +6776,13 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6703
6776
  isStreaming: message.status === "streaming"
6704
6777
  },
6705
6778
  message.entry_id ?? `${message.timestamp ?? "child"}-${index}`
6706
- ) : message.role === "user" ? /* @__PURE__ */ jsx29(
6779
+ ) : message.role === "user" ? /* @__PURE__ */ jsx30(
6707
6780
  ExpandedChildUserMessage,
6708
6781
  {
6709
6782
  message
6710
6783
  },
6711
6784
  message.entry_id ?? `${message.timestamp ?? "user"}-${index}`
6712
- ) : message.role === "error" ? /* @__PURE__ */ jsx29(
6785
+ ) : message.role === "error" ? /* @__PURE__ */ jsx30(
6713
6786
  "div",
6714
6787
  {
6715
6788
  className: "border-l-[2px] border-l-red-500 px-3 py-2 text-[11px] text-red-200",
@@ -6717,17 +6790,17 @@ function AgentLoopBlock({ toolCall, sessionId, reasoning }) {
6717
6790
  },
6718
6791
  message.entry_id ?? `${message.timestamp ?? "error"}-${index}`
6719
6792
  ) : null
6720
- ) }) : status === "running" ? /* @__PURE__ */ jsxs24("div", { className: "px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
6721
- /* @__PURE__ */ jsx29(Loader24, { size: 12, className: "mr-1.5 inline animate-spin" }),
6793
+ ) }) : status === "running" ? /* @__PURE__ */ jsxs25("div", { className: "px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
6794
+ /* @__PURE__ */ jsx30(Loader24, { size: 12, className: "mr-1.5 inline animate-spin" }),
6722
6795
  "\u6B63\u5728\u542F\u52A8..."
6723
- ] }) : toolCall.result ? /* @__PURE__ */ jsx29("pre", { className: "max-h-[400px] overflow-auto px-3 py-2 whitespace-pre-wrap text-[11px] text-[hsl(var(--muted-foreground))]", children: typeof toolCall.result === "string" ? toolCall.result : JSON.stringify(toolCall.result, null, 2) }) : null
6796
+ ] }) : toolCall.result ? /* @__PURE__ */ jsx30("pre", { className: "max-h-[400px] overflow-auto px-3 py-2 whitespace-pre-wrap text-[11px] text-[hsl(var(--muted-foreground))]", children: typeof toolCall.result === "string" ? toolCall.result : JSON.stringify(toolCall.result, null, 2) }) : null
6724
6797
  ] })
6725
6798
  ]
6726
6799
  }
6727
6800
  );
6728
6801
  }
6729
6802
  function ExpandedChildUserMessage({ message }) {
6730
- return /* @__PURE__ */ jsx29("div", { className: "pl-8", children: /* @__PURE__ */ jsx29(UserMessageBubble, { message }) });
6803
+ return /* @__PURE__ */ jsx30("div", { className: "pl-8", children: /* @__PURE__ */ jsx30(UserMessageBubble, { message }) });
6731
6804
  }
6732
6805
  function ExpandedChildAssistantMessage({
6733
6806
  message,
@@ -6737,12 +6810,12 @@ function ExpandedChildAssistantMessage({
6737
6810
  const text = typeof message.content === "string" ? message.content.trim() : message.content.filter((part) => part.type === "text").map((part) => part.text).join("").trim();
6738
6811
  const toolCalls = message.tool_calls ?? [];
6739
6812
  const hasToolCalls = toolCalls.length > 0;
6740
- return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-2", children: [
6741
- message.reasoning && /* @__PURE__ */ jsxs24(Reasoning, { isStreaming, children: [
6742
- /* @__PURE__ */ jsx29(ReasoningTrigger, { wordCount: message.reasoning.length }),
6743
- /* @__PURE__ */ jsx29(ReasoningContent, { children: message.reasoning })
6813
+ return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-2", children: [
6814
+ message.reasoning && /* @__PURE__ */ jsxs25(Reasoning, { isStreaming, children: [
6815
+ /* @__PURE__ */ jsx30(ReasoningTrigger, { wordCount: message.reasoning.length }),
6816
+ /* @__PURE__ */ jsx30(ReasoningContent, { children: message.reasoning })
6744
6817
  ] }),
6745
- text ? /* @__PURE__ */ jsx29(
6818
+ text ? /* @__PURE__ */ jsx30(
6746
6819
  ChildText,
6747
6820
  {
6748
6821
  text,
@@ -6751,9 +6824,9 @@ function ExpandedChildAssistantMessage({
6751
6824
  reasoning: void 0
6752
6825
  }
6753
6826
  ) : null,
6754
- !text && isStreaming && /* @__PURE__ */ jsx29("span", { className: "pl-8 text-[12px] text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u751F\u6210..." }),
6755
- hasToolCalls && /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-2", children: toolCalls.map(
6756
- (toolCall) => formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx29(
6827
+ !text && isStreaming && /* @__PURE__ */ jsx30("span", { className: "pl-8 text-[12px] text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u751F\u6210..." }),
6828
+ hasToolCalls && /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-2", children: toolCalls.map(
6829
+ (toolCall) => formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx30(
6757
6830
  AgentLoopBlock,
6758
6831
  {
6759
6832
  toolCall,
@@ -6761,7 +6834,7 @@ function ExpandedChildAssistantMessage({
6761
6834
  reasoning: void 0
6762
6835
  },
6763
6836
  toolCall.id
6764
- ) : /* @__PURE__ */ jsx29(
6837
+ ) : /* @__PURE__ */ jsx30(
6765
6838
  ToolCallBlock,
6766
6839
  {
6767
6840
  toolCall,
@@ -6773,8 +6846,8 @@ function ExpandedChildAssistantMessage({
6773
6846
  toolCall.id
6774
6847
  )
6775
6848
  ) }),
6776
- message.blocks?.some((block) => block.type === "tool_ui") ? /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-2", children: message.blocks.map(
6777
- (block, index) => block.type === "tool_ui" && block.tool_call_id && isUiMeta(block.content) && block.content.target === "inline" ? /* @__PURE__ */ jsx29("div", { className: "ml-4", children: /* @__PURE__ */ jsx29(ResourceIframe, { ui: block.content, sessionId }) }, `${block.tool_call_id}-${index}`) : null
6849
+ message.blocks?.some((block) => block.type === "tool_ui") ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-2", children: message.blocks.map(
6850
+ (block, index) => block.type === "tool_ui" && block.tool_call_id && isUiMeta(block.content) && block.content.target === "inline" ? /* @__PURE__ */ jsx30("div", { className: "ml-4", children: /* @__PURE__ */ jsx30(ResourceIframe, { ui: block.content, sessionId }) }, `${block.tool_call_id}-${index}`) : null
6778
6851
  ) }) : null
6779
6852
  ] });
6780
6853
  }
@@ -6784,8 +6857,8 @@ function ChildText({
6784
6857
  sessionId,
6785
6858
  reasoning
6786
6859
  }) {
6787
- return /* @__PURE__ */ jsxs24("div", { className: "pl-8 text-[12px] leading-6 text-[hsl(var(--foreground))]", children: [
6788
- /* @__PURE__ */ jsx29(
6860
+ return /* @__PURE__ */ jsxs25("div", { className: "pl-8 text-[12px] leading-6 text-[hsl(var(--foreground))]", children: [
6861
+ /* @__PURE__ */ jsx30(
6789
6862
  MarkdownContent,
6790
6863
  {
6791
6864
  mode: "streaming",
@@ -6795,8 +6868,8 @@ function ChildText({
6795
6868
  children: text
6796
6869
  }
6797
6870
  ),
6798
- isStreaming && /* @__PURE__ */ jsx29("span", { className: "ml-0.5 inline-block h-[1em] w-[3px] animate-pulse rounded-sm bg-current opacity-60" }),
6799
- reasoning ? /* @__PURE__ */ jsx29(ThinkingBadge, { reasoning }) : null
6871
+ isStreaming && /* @__PURE__ */ jsx30("span", { className: "ml-0.5 inline-block h-[1em] w-[3px] animate-pulse rounded-sm bg-current opacity-60" }),
6872
+ reasoning ? /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning }) : null
6800
6873
  ] });
6801
6874
  }
6802
6875
  function getLoopCardStyles(status) {
@@ -6836,7 +6909,7 @@ function getLoopCardStyles(status) {
6836
6909
  }
6837
6910
 
6838
6911
  // src/react/components/chat/AssistantTurnBlock.tsx
6839
- import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
6912
+ import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
6840
6913
  var EMPTY_MESSAGES3 = [];
6841
6914
  var EMPTY_AGENT_LOOPS2 = {};
6842
6915
  function defaultTurnDisplayMode({
@@ -7004,7 +7077,7 @@ function AssistantTurnBlockBase({
7004
7077
  const hasInterruptedState = messages.some((message) => message.status === "interrupted");
7005
7078
  const effectiveMode = resolveTurnDisplayMode({ isStreaming, displayMode });
7006
7079
  const memoryRefs = Array.isArray(messages[0]?.memory_refs) ? messages[0].memory_refs : [];
7007
- return /* @__PURE__ */ jsxs25(
7080
+ return /* @__PURE__ */ jsxs26(
7008
7081
  "div",
7009
7082
  {
7010
7083
  className: cn(
@@ -7013,17 +7086,17 @@ function AssistantTurnBlockBase({
7013
7086
  customization?.classNames?.assistantTurn
7014
7087
  ),
7015
7088
  children: [
7016
- memoryRefs.length > 0 && /* @__PURE__ */ jsx30(MemoryRefsHint, { refs: memoryRefs }),
7017
- hasInterruptedState && /* @__PURE__ */ jsx30("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" }),
7018
- !isStreaming && /* @__PURE__ */ jsx30("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs25(
7089
+ memoryRefs.length > 0 && /* @__PURE__ */ jsx31(MemoryRefsHint, { refs: memoryRefs }),
7090
+ hasInterruptedState && /* @__PURE__ */ jsx31("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" }),
7091
+ !isStreaming && /* @__PURE__ */ jsx31("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs26(
7019
7092
  "button",
7020
7093
  {
7021
7094
  type: "button",
7022
7095
  onClick: () => setDisplayMode(displayMode === "detail" ? "compact" : "detail"),
7023
7096
  className: "inline-flex shrink-0 items-center gap-1 text-xs text-[hsl(var(--muted-foreground))] transition-colors hover:text-[hsl(var(--foreground))]",
7024
7097
  children: [
7025
- /* @__PURE__ */ jsx30("span", { children: effectiveMode === "detail" ? "\u7CBE\u7B80" : "\u8BE6\u7EC6" }),
7026
- /* @__PURE__ */ jsx30(
7098
+ /* @__PURE__ */ jsx31("span", { children: effectiveMode === "detail" ? "\u7CBE\u7B80" : "\u8BE6\u7EC6" }),
7099
+ /* @__PURE__ */ jsx31(
7027
7100
  ChevronRight5,
7028
7101
  {
7029
7102
  size: 18,
@@ -7033,7 +7106,7 @@ function AssistantTurnBlockBase({
7033
7106
  ]
7034
7107
  }
7035
7108
  ) }),
7036
- effectiveMode === "detail" ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ jsx30(
7109
+ effectiveMode === "detail" ? /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ jsx31(
7037
7110
  AssistantMessages,
7038
7111
  {
7039
7112
  messages,
@@ -7046,15 +7119,15 @@ function AssistantTurnBlockBase({
7046
7119
  showToolDetails: true,
7047
7120
  customization
7048
7121
  }
7049
- ) }) : /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-4", children: [
7050
- resourceBlocks.length > 0 ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-3", children: resourceBlocks.map((block) => /* @__PURE__ */ jsx30(ResourceIframe, { ui: block.ui, sessionId }, block.key)) }) : null,
7051
- finalMessage ? /* @__PURE__ */ jsx30(
7122
+ ) }) : /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-4", children: [
7123
+ resourceBlocks.length > 0 ? /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-3", children: resourceBlocks.map((block) => /* @__PURE__ */ jsx31(ResourceIframe, { ui: block.ui, sessionId }, block.key)) }) : null,
7124
+ finalMessage ? /* @__PURE__ */ jsx31(
7052
7125
  "div",
7053
7126
  {
7054
7127
  className: cn(
7055
7128
  resourceBlocks.length > 0 && "border-t border-[hsl(var(--border))] pt-4"
7056
7129
  ),
7057
- children: /* @__PURE__ */ jsx30(
7130
+ children: /* @__PURE__ */ jsx31(
7058
7131
  AssistantMessageContent,
7059
7132
  {
7060
7133
  message: finalMessage,
@@ -7065,7 +7138,7 @@ function AssistantTurnBlockBase({
7065
7138
  }
7066
7139
  )
7067
7140
  }
7068
- ) : isStreaming ? /* @__PURE__ */ jsx30("span", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u751F\u6210..." }) : null
7141
+ ) : isStreaming ? /* @__PURE__ */ jsx31("span", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u751F\u6210..." }) : null
7069
7142
  ] }) })
7070
7143
  ]
7071
7144
  }
@@ -7094,16 +7167,16 @@ function AssistantMessages({
7094
7167
  const toolCalls = message.tool_calls ?? [];
7095
7168
  const hasToolCalls = toolCalls.length > 0;
7096
7169
  const toolRenderItems = groupDetailedToolCalls(toolCalls);
7097
- return /* @__PURE__ */ jsxs25(
7170
+ return /* @__PURE__ */ jsxs26(
7098
7171
  "div",
7099
7172
  {
7100
7173
  className: "flex flex-col gap-3",
7101
7174
  children: [
7102
- hasReasoning && /* @__PURE__ */ jsxs25(Reasoning, { isStreaming: isStreamingLastMessage, children: [
7103
- /* @__PURE__ */ jsx30(ReasoningTrigger, { wordCount: reasoning.length }),
7104
- /* @__PURE__ */ jsx30(ReasoningContent, { children: reasoning })
7175
+ hasReasoning && /* @__PURE__ */ jsxs26(Reasoning, { isStreaming: isStreamingLastMessage, children: [
7176
+ /* @__PURE__ */ jsx31(ReasoningTrigger, { wordCount: reasoning.length }),
7177
+ /* @__PURE__ */ jsx31(ReasoningContent, { children: reasoning })
7105
7178
  ] }),
7106
- /* @__PURE__ */ jsx30(
7179
+ /* @__PURE__ */ jsx31(
7107
7180
  AssistantMessageContent,
7108
7181
  {
7109
7182
  message,
@@ -7113,9 +7186,9 @@ function AssistantMessages({
7113
7186
  className: customization?.classNames?.assistantText
7114
7187
  }
7115
7188
  ),
7116
- hasToolCalls && showToolDetails && /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-2", children: toolRenderItems.map((item) => {
7189
+ hasToolCalls && showToolDetails && /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-2", children: toolRenderItems.map((item) => {
7117
7190
  if (item.kind === "read_group") {
7118
- return /* @__PURE__ */ jsx30(
7191
+ return /* @__PURE__ */ jsx31(
7119
7192
  CompactToolGroupBlock,
7120
7193
  {
7121
7194
  toolCalls: item.toolCalls,
@@ -7132,7 +7205,7 @@ function AssistantMessages({
7132
7205
  );
7133
7206
  }
7134
7207
  const { toolCall } = item;
7135
- return formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx30(
7208
+ return formatToolName(toolCall.name) === "Agent" ? /* @__PURE__ */ jsx31(
7136
7209
  AgentLoopBlock,
7137
7210
  {
7138
7211
  toolCall,
@@ -7140,7 +7213,7 @@ function AssistantMessages({
7140
7213
  reasoning: void 0
7141
7214
  },
7142
7215
  toolCall.id
7143
- ) : customization?.components?.ToolCall ? /* @__PURE__ */ jsx30(
7216
+ ) : customization?.components?.ToolCall ? /* @__PURE__ */ jsx31(
7144
7217
  customization.components.ToolCall,
7145
7218
  {
7146
7219
  toolCall,
@@ -7155,7 +7228,7 @@ function AssistantMessages({
7155
7228
  customization
7156
7229
  },
7157
7230
  toolCall.id
7158
- ) : /* @__PURE__ */ jsx30(
7231
+ ) : /* @__PURE__ */ jsx31(
7159
7232
  ToolCallBlock,
7160
7233
  {
7161
7234
  toolCall,
@@ -7172,8 +7245,8 @@ function AssistantMessages({
7172
7245
  toolCall.id
7173
7246
  );
7174
7247
  }) }),
7175
- showToolDetails && message.blocks?.some((block) => block.type === "tool_ui") ? /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-2", children: message.blocks.map(
7176
- (block, blockIndex) => block.type === "tool_ui" && block.tool_call_id && isUiMeta(block.content) && block.content.target === "inline" ? /* @__PURE__ */ jsx30("div", { className: "ml-4", children: /* @__PURE__ */ jsx30(ResourceIframe, { ui: block.content, sessionId }) }, `${block.tool_call_id}-${blockIndex}`) : null
7248
+ showToolDetails && message.blocks?.some((block) => block.type === "tool_ui") ? /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-2", children: message.blocks.map(
7249
+ (block, blockIndex) => block.type === "tool_ui" && block.tool_call_id && isUiMeta(block.content) && block.content.target === "inline" ? /* @__PURE__ */ jsx31("div", { className: "ml-4", children: /* @__PURE__ */ jsx31(ResourceIframe, { ui: block.content, sessionId }) }, `${block.tool_call_id}-${blockIndex}`) : null
7177
7250
  ) }) : null
7178
7251
  ]
7179
7252
  },
@@ -7221,12 +7294,12 @@ function CompactToolGroupBlock({
7221
7294
  return filePath ? formatFileName(filePath) : "\u672A\u77E5\u6587\u4EF6";
7222
7295
  });
7223
7296
  const title = `\u8BFB\u53D6 ${toolCalls.length} \u4E2A\u6587\u4EF6`;
7224
- return /* @__PURE__ */ jsxs25("div", { className: cn(indentClass, "text-xs"), children: [
7225
- /* @__PURE__ */ jsxs25("div", { className: cn(
7297
+ return /* @__PURE__ */ jsxs26("div", { className: cn(indentClass, "text-xs"), children: [
7298
+ /* @__PURE__ */ jsxs26("div", { className: cn(
7226
7299
  "flex items-center gap-2 border-l-[3px] px-3 py-2",
7227
7300
  hasError ? "border-l-[hsl(var(--destructive))]" : "border-l-[hsl(var(--primary))]"
7228
7301
  ), children: [
7229
- /* @__PURE__ */ jsxs25(
7302
+ /* @__PURE__ */ jsxs26(
7230
7303
  "button",
7231
7304
  {
7232
7305
  type: "button",
@@ -7234,7 +7307,7 @@ function CompactToolGroupBlock({
7234
7307
  className: "flex min-w-0 shrink-0 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",
7235
7308
  "aria-expanded": expanded,
7236
7309
  children: [
7237
- /* @__PURE__ */ jsx30(
7310
+ /* @__PURE__ */ jsx31(
7238
7311
  ChevronRight5,
7239
7312
  {
7240
7313
  size: 11,
@@ -7244,18 +7317,18 @@ function CompactToolGroupBlock({
7244
7317
  )
7245
7318
  }
7246
7319
  ),
7247
- hasError ? /* @__PURE__ */ jsxs25("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-[hsl(var(--destructive))]", children: [
7248
- /* @__PURE__ */ jsx30(AlertCircle, { size: 11 }),
7249
- /* @__PURE__ */ jsx30("span", { children: "\u5931\u8D25" })
7250
- ] }) : /* @__PURE__ */ jsxs25("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-[hsl(var(--primary))]", children: [
7251
- /* @__PURE__ */ jsx30(Check4, { size: 11 }),
7252
- /* @__PURE__ */ jsx30("span", { children: "\u5B8C\u6210" })
7320
+ hasError ? /* @__PURE__ */ jsxs26("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-[hsl(var(--destructive))]", children: [
7321
+ /* @__PURE__ */ jsx31(AlertCircle, { size: 11 }),
7322
+ /* @__PURE__ */ jsx31("span", { children: "\u5931\u8D25" })
7323
+ ] }) : /* @__PURE__ */ jsxs26("span", { className: "flex shrink-0 items-center gap-1 text-[10px] text-[hsl(var(--primary))]", children: [
7324
+ /* @__PURE__ */ jsx31(Check4, { size: 11 }),
7325
+ /* @__PURE__ */ jsx31("span", { children: "\u5B8C\u6210" })
7253
7326
  ] }),
7254
- /* @__PURE__ */ jsx30("span", { className: "min-w-0 shrink-0 font-medium text-[hsl(var(--foreground))]", children: title })
7327
+ /* @__PURE__ */ jsx31("span", { className: "min-w-0 shrink-0 font-medium text-[hsl(var(--foreground))]", children: title })
7255
7328
  ]
7256
7329
  }
7257
7330
  ),
7258
- /* @__PURE__ */ jsx30("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1.5", children: tags.map((tag, index) => /* @__PURE__ */ jsx30(
7331
+ /* @__PURE__ */ jsx31("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1.5", children: tags.map((tag, index) => /* @__PURE__ */ jsx31(
7259
7332
  "span",
7260
7333
  {
7261
7334
  className: "max-w-40 truncate rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.35)] px-1.5 py-0.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]",
@@ -7264,12 +7337,12 @@ function CompactToolGroupBlock({
7264
7337
  },
7265
7338
  `${tag}-${index}`
7266
7339
  )) }),
7267
- reasoning ? /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning, variant: "block" }) : null,
7268
- totalDurationMs > 0 ? /* @__PURE__ */ jsx30("span", { className: "shrink-0 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: formatToolDuration2(totalDurationMs) }) : null
7340
+ reasoning ? /* @__PURE__ */ jsx31(ThinkingBadge, { reasoning, variant: "block" }) : null,
7341
+ totalDurationMs > 0 ? /* @__PURE__ */ jsx31("span", { className: "shrink-0 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: formatToolDuration2(totalDurationMs) }) : null
7269
7342
  ] }),
7270
- expanded ? /* @__PURE__ */ jsx30("div", { className: "mt-1 flex flex-col gap-1", children: toolCalls.map((toolCall) => {
7343
+ expanded ? /* @__PURE__ */ jsx31("div", { className: "mt-1 flex flex-col gap-1", children: toolCalls.map((toolCall) => {
7271
7344
  const CustomToolCall = customization?.components?.ToolCall;
7272
- return CustomToolCall ? /* @__PURE__ */ jsx30(
7345
+ return CustomToolCall ? /* @__PURE__ */ jsx31(
7273
7346
  CustomToolCall,
7274
7347
  {
7275
7348
  toolCall,
@@ -7283,7 +7356,7 @@ function CompactToolGroupBlock({
7283
7356
  customization
7284
7357
  },
7285
7358
  toolCall.id
7286
- ) : /* @__PURE__ */ jsx30(
7359
+ ) : /* @__PURE__ */ jsx31(
7287
7360
  ToolCallBlock,
7288
7361
  {
7289
7362
  toolCall,
@@ -7314,8 +7387,8 @@ function AssistantMessageContent({
7314
7387
  if (!text && imageParts.length === 0 && fileParts.length === 0 && !isStreaming && !reasoning) {
7315
7388
  return null;
7316
7389
  }
7317
- return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-3", children: [
7318
- imageParts.length > 0 && /* @__PURE__ */ jsx30("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx30(
7390
+ return /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-3", children: [
7391
+ imageParts.length > 0 && /* @__PURE__ */ jsx31("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx31(
7319
7392
  "img",
7320
7393
  {
7321
7394
  src: part.image_url.url,
@@ -7324,8 +7397,8 @@ function AssistantMessageContent({
7324
7397
  },
7325
7398
  part.image_url.url
7326
7399
  )) }),
7327
- /* @__PURE__ */ jsx30(MessageFileAttachmentList, { files: fileParts }),
7328
- text ? /* @__PURE__ */ jsx30(
7400
+ /* @__PURE__ */ jsx31(MessageFileAttachmentList, { files: fileParts }),
7401
+ text ? /* @__PURE__ */ jsx31(
7329
7402
  AssistantText,
7330
7403
  {
7331
7404
  text,
@@ -7335,8 +7408,8 @@ function AssistantMessageContent({
7335
7408
  className
7336
7409
  }
7337
7410
  ) : null,
7338
- !text && isStreaming && /* @__PURE__ */ jsx30("span", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u751F\u6210..." }),
7339
- !text && reasoning ? /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning, variant: "block" }) : null
7411
+ !text && isStreaming && /* @__PURE__ */ jsx31("span", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u751F\u6210..." }),
7412
+ !text && reasoning ? /* @__PURE__ */ jsx31(ThinkingBadge, { reasoning, variant: "block" }) : null
7340
7413
  ] });
7341
7414
  }
7342
7415
  function AssistantText({
@@ -7356,8 +7429,8 @@ function AssistantText({
7356
7429
  () => ({ sessionId, messageId, sendMessage }),
7357
7430
  [sessionId, messageId, sendMessage]
7358
7431
  );
7359
- return /* @__PURE__ */ jsxs25("div", { className: cn("text-[15px] leading-8 text-[hsl(var(--foreground))]", className), children: [
7360
- /* @__PURE__ */ jsx30(CardContext.Provider, { value: cardCtx, children: /* @__PURE__ */ jsx30(
7432
+ return /* @__PURE__ */ jsxs26("div", { className: cn("text-[15px] leading-8 text-[hsl(var(--foreground))]", className), children: [
7433
+ /* @__PURE__ */ jsx31(CardContext.Provider, { value: cardCtx, children: /* @__PURE__ */ jsx31(
7361
7434
  MarkdownContent,
7362
7435
  {
7363
7436
  mode: "streaming",
@@ -7367,7 +7440,7 @@ function AssistantText({
7367
7440
  children: text
7368
7441
  }
7369
7442
  ) }),
7370
- reasoning ? /* @__PURE__ */ jsx30(ThinkingBadge, { reasoning }) : null
7443
+ reasoning ? /* @__PURE__ */ jsx31(ThinkingBadge, { reasoning }) : null
7371
7444
  ] });
7372
7445
  }
7373
7446
  function MemoryRefsHint({ refs: rawRefs }) {
@@ -7375,22 +7448,22 @@ function MemoryRefsHint({ refs: rawRefs }) {
7375
7448
  const [expanded, setExpanded] = useState18(false);
7376
7449
  const hasSkill = refs.some((r3) => r3.skill_name);
7377
7450
  const label = hasSkill ? "\u53C2\u8003\u4E86\u8BE5\u6280\u80FD\u7684\u5386\u53F2\u7ECF\u9A8C" : "\u53C2\u8003\u4E86\u5386\u53F2\u7ECF\u9A8C";
7378
- return /* @__PURE__ */ jsxs25("div", { className: "ml-4", children: [
7379
- /* @__PURE__ */ jsxs25(
7451
+ return /* @__PURE__ */ jsxs26("div", { className: "ml-4", children: [
7452
+ /* @__PURE__ */ jsxs26(
7380
7453
  "button",
7381
7454
  {
7382
7455
  type: "button",
7383
7456
  onClick: () => setExpanded(!expanded),
7384
7457
  className: "inline-flex items-center gap-1.5 rounded-md border border-[hsl(var(--primary)/0.25)] bg-[hsl(var(--primary)/0.08)] px-2.5 py-1 text-[11px] text-[hsl(var(--primary))] transition-colors hover:bg-[hsl(var(--primary)/0.12)]",
7385
7458
  children: [
7386
- /* @__PURE__ */ jsx30(BookOpen, { size: 12 }),
7387
- /* @__PURE__ */ jsxs25("span", { children: [
7459
+ /* @__PURE__ */ jsx31(BookOpen, { size: 12 }),
7460
+ /* @__PURE__ */ jsxs26("span", { children: [
7388
7461
  label,
7389
7462
  "\uFF08",
7390
7463
  refs.length,
7391
7464
  "\uFF09"
7392
7465
  ] }),
7393
- /* @__PURE__ */ jsx30(
7466
+ /* @__PURE__ */ jsx31(
7394
7467
  ChevronRight5,
7395
7468
  {
7396
7469
  size: 10,
@@ -7400,13 +7473,13 @@ function MemoryRefsHint({ refs: rawRefs }) {
7400
7473
  ]
7401
7474
  }
7402
7475
  ),
7403
- expanded && /* @__PURE__ */ jsxs25("div", { className: "mt-1.5 flex flex-col gap-1 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.45)] px-3 py-2", children: [
7404
- refs.map((ref) => /* @__PURE__ */ jsxs25("div", { className: "flex items-start gap-2 text-[11px] text-[hsl(var(--foreground)/0.82)]", children: [
7405
- /* @__PURE__ */ jsx30("span", { className: "mt-0.5 shrink-0 text-[hsl(var(--primary)/0.75)]", children: "\u2022" }),
7406
- /* @__PURE__ */ jsx30("span", { className: "line-clamp-1", children: ref.content_preview }),
7407
- ref.skill_name && /* @__PURE__ */ jsx30("span", { className: "ml-auto shrink-0 rounded bg-[hsl(var(--primary)/0.12)] px-1.5 py-0.5 text-[10px] text-[hsl(var(--primary))]", children: ref.skill_name })
7476
+ expanded && /* @__PURE__ */ jsxs26("div", { className: "mt-1.5 flex flex-col gap-1 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.45)] px-3 py-2", children: [
7477
+ refs.map((ref) => /* @__PURE__ */ jsxs26("div", { className: "flex items-start gap-2 text-[11px] text-[hsl(var(--foreground)/0.82)]", children: [
7478
+ /* @__PURE__ */ jsx31("span", { className: "mt-0.5 shrink-0 text-[hsl(var(--primary)/0.75)]", children: "\u2022" }),
7479
+ /* @__PURE__ */ jsx31("span", { className: "line-clamp-1", children: ref.content_preview }),
7480
+ ref.skill_name && /* @__PURE__ */ jsx31("span", { className: "ml-auto shrink-0 rounded bg-[hsl(var(--primary)/0.12)] px-1.5 py-0.5 text-[10px] text-[hsl(var(--primary))]", children: ref.skill_name })
7408
7481
  ] }, ref.id)),
7409
- /* @__PURE__ */ jsx30(
7482
+ /* @__PURE__ */ jsx31(
7410
7483
  "a",
7411
7484
  {
7412
7485
  href: MEMORIES_ROUTE,
@@ -7421,7 +7494,7 @@ function MemoryRefsHint({ refs: rawRefs }) {
7421
7494
  // src/react/components/chat/CompactionCard.tsx
7422
7495
  import { ChevronDown as ChevronDown2, ChevronRight as ChevronRight6, Loader2 as Loader25, Square as Square3, XCircle } from "lucide-react";
7423
7496
  import { useState as useState19 } from "react";
7424
- import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
7497
+ import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
7425
7498
  var PERCENT_FORMATTER = new Intl.NumberFormat("zh-CN", {
7426
7499
  style: "percent",
7427
7500
  maximumFractionDigits: 0
@@ -7481,9 +7554,9 @@ function CompactionCard({
7481
7554
  const hasSummary = typeof source.summary_full === "string" && source.summary_full.trim().length > 0 && !isGenericArchiveSummary(source.summary_full);
7482
7555
  const hasFailureReason = source.status === "failed" && Boolean(source.failure_reason);
7483
7556
  const canExpand = source.status === "completed" && (hasSummary || archivedToolCalls.length > 0) || hasFailureReason;
7484
- return /* @__PURE__ */ jsxs26("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
7485
- /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between gap-2", children: [
7486
- /* @__PURE__ */ jsxs26(
7557
+ return /* @__PURE__ */ jsxs27("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
7558
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between gap-2", children: [
7559
+ /* @__PURE__ */ jsxs27(
7487
7560
  "button",
7488
7561
  {
7489
7562
  type: "button",
@@ -7494,21 +7567,21 @@ function CompactionCard({
7494
7567
  ),
7495
7568
  "aria-expanded": expanded,
7496
7569
  children: [
7497
- canExpand ? expanded ? /* @__PURE__ */ jsx31(ChevronDown2, { size: 12, className: "shrink-0" }) : /* @__PURE__ */ jsx31(ChevronRight6, { size: 12, className: "shrink-0" }) : null,
7498
- /* @__PURE__ */ jsx31("span", { children: source.status === "streaming" ? /* @__PURE__ */ jsxs26("span", { className: "inline-flex items-center gap-1", children: [
7499
- /* @__PURE__ */ jsx31(Loader25, { size: 12, className: "animate-spin" }),
7570
+ canExpand ? expanded ? /* @__PURE__ */ jsx32(ChevronDown2, { size: 12, className: "shrink-0" }) : /* @__PURE__ */ jsx32(ChevronRight6, { size: 12, className: "shrink-0" }) : null,
7571
+ /* @__PURE__ */ jsx32("span", { children: source.status === "streaming" ? /* @__PURE__ */ jsxs27("span", { className: "inline-flex items-center gap-1", children: [
7572
+ /* @__PURE__ */ jsx32(Loader25, { size: 12, className: "animate-spin" }),
7500
7573
  "\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587"
7501
- ] }) : source.status === "failed" ? /* @__PURE__ */ jsxs26("span", { className: "inline-flex items-center gap-1 text-rose-500/80", children: [
7502
- /* @__PURE__ */ jsx31(XCircle, { size: 12 }),
7574
+ ] }) : source.status === "failed" ? /* @__PURE__ */ jsxs27("span", { className: "inline-flex items-center gap-1 text-rose-500/80", children: [
7575
+ /* @__PURE__ */ jsx32(XCircle, { size: 12 }),
7503
7576
  "\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
7504
- ] }) : source.status === "interrupted" ? /* @__PURE__ */ jsxs26("span", { className: "inline-flex items-center gap-1 text-amber-500/80", children: [
7505
- /* @__PURE__ */ jsx31(Square3, { size: 11 }),
7577
+ ] }) : source.status === "interrupted" ? /* @__PURE__ */ jsxs27("span", { className: "inline-flex items-center gap-1 text-amber-500/80", children: [
7578
+ /* @__PURE__ */ jsx32(Square3, { size: 11 }),
7506
7579
  "\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88"
7507
7580
  ] }) : "\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29" })
7508
7581
  ]
7509
7582
  }
7510
7583
  ),
7511
- canCancel ? /* @__PURE__ */ jsx31(
7584
+ canCancel ? /* @__PURE__ */ jsx32(
7512
7585
  "button",
7513
7586
  {
7514
7587
  type: "button",
@@ -7518,13 +7591,13 @@ function CompactionCard({
7518
7591
  }
7519
7592
  ) : null
7520
7593
  ] }),
7521
- expanded ? /* @__PURE__ */ jsxs26("div", { className: "mt-1 max-w-3xl rounded-lg border border-[hsl(var(--border))]/70 bg-[hsl(var(--card))]/80 px-3 py-2 text-[11px] leading-relaxed shadow-sm", children: [
7522
- /* @__PURE__ */ jsxs26("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[hsl(var(--muted-foreground))]", children: [
7523
- /* @__PURE__ */ jsxs26("span", { children: [
7594
+ expanded ? /* @__PURE__ */ jsxs27("div", { className: "mt-1 max-w-3xl rounded-lg border border-[hsl(var(--border))]/70 bg-[hsl(var(--card))]/80 px-3 py-2 text-[11px] leading-relaxed shadow-sm", children: [
7595
+ /* @__PURE__ */ jsxs27("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[hsl(var(--muted-foreground))]", children: [
7596
+ /* @__PURE__ */ jsxs27("span", { children: [
7524
7597
  "#",
7525
7598
  shortId(source.compaction_id)
7526
7599
  ] }),
7527
- /* @__PURE__ */ jsxs26("span", { children: [
7600
+ /* @__PURE__ */ jsxs27("span", { children: [
7528
7601
  "\u8282\u7701 ",
7529
7602
  formatSavedRatio(source.saved_ratio),
7530
7603
  "\uFF08",
@@ -7534,31 +7607,31 @@ function CompactionCard({
7534
7607
  formatTokens(source.tokens_after),
7535
7608
  " token\uFF09"
7536
7609
  ] }),
7537
- /* @__PURE__ */ jsxs26("span", { children: [
7610
+ /* @__PURE__ */ jsxs27("span", { children: [
7538
7611
  "\u5F52\u6863 ",
7539
7612
  archivedCount,
7540
7613
  " \u4E2A\u5DE5\u5177\u7ED3\u679C"
7541
7614
  ] })
7542
7615
  ] }),
7543
- archivedToolCalls.length > 0 ? /* @__PURE__ */ jsx31("div", { className: "mt-2 space-y-1.5", children: archivedToolCalls.map((item, index) => {
7616
+ archivedToolCalls.length > 0 ? /* @__PURE__ */ jsx32("div", { className: "mt-2 space-y-1.5", children: archivedToolCalls.map((item, index) => {
7544
7617
  const archivePath = getArchivePath(item, archivedFiles);
7545
- return /* @__PURE__ */ jsxs26(
7618
+ return /* @__PURE__ */ jsxs27(
7546
7619
  "div",
7547
7620
  {
7548
7621
  className: "rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/35 px-2 py-1.5",
7549
7622
  children: [
7550
- /* @__PURE__ */ jsxs26("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-[hsl(var(--foreground))]", children: [
7551
- /* @__PURE__ */ jsx31("span", { className: "font-medium", children: getArchivedToolLabel(item) }),
7552
- item.tool_call_id ? /* @__PURE__ */ jsx31("span", { className: "font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: item.tool_call_id }) : null
7623
+ /* @__PURE__ */ jsxs27("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-[hsl(var(--foreground))]", children: [
7624
+ /* @__PURE__ */ jsx32("span", { className: "font-medium", children: getArchivedToolLabel(item) }),
7625
+ item.tool_call_id ? /* @__PURE__ */ jsx32("span", { className: "font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: item.tool_call_id }) : null
7553
7626
  ] }),
7554
- archivePath ? /* @__PURE__ */ jsx31("div", { className: "mt-0.5 break-all font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: archivePath }) : null
7627
+ archivePath ? /* @__PURE__ */ jsx32("div", { className: "mt-0.5 break-all font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: archivePath }) : null
7555
7628
  ]
7556
7629
  },
7557
7630
  item.tool_call_id || item.entry_id || `${item.tool_name}-${index}`
7558
7631
  );
7559
7632
  }) }) : null,
7560
- hasSummary ? /* @__PURE__ */ jsx31("pre", { className: "mt-2 max-h-[360px] overflow-auto whitespace-pre-wrap rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/25 px-2 py-1.5 font-mono text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: source.summary_full }) : null,
7561
- source.status === "failed" && source.failure_reason ? /* @__PURE__ */ jsxs26("div", { className: "mt-2 text-rose-500/90", children: [
7633
+ hasSummary ? /* @__PURE__ */ jsx32("pre", { className: "mt-2 max-h-[360px] overflow-auto whitespace-pre-wrap rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/25 px-2 py-1.5 font-mono text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: source.summary_full }) : null,
7634
+ source.status === "failed" && source.failure_reason ? /* @__PURE__ */ jsxs27("div", { className: "mt-2 text-rose-500/90", children: [
7562
7635
  "\u5931\u8D25\u539F\u56E0\uFF1A",
7563
7636
  source.failure_reason
7564
7637
  ] }) : null
@@ -7569,7 +7642,7 @@ function CompactionCard({
7569
7642
  // src/react/components/chat/RenderErrorBoundary.tsx
7570
7643
  import { AlertTriangle as AlertTriangle2 } from "lucide-react";
7571
7644
  import { Component } from "react";
7572
- import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
7645
+ import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
7573
7646
  function getFirstComponentName(componentStack) {
7574
7647
  const match = componentStack.match(/\n\s+at\s+([^\s(]+)/);
7575
7648
  return match?.[1] ?? null;
@@ -7602,18 +7675,18 @@ var RenderErrorBoundary = class extends Component {
7602
7675
  return children;
7603
7676
  }
7604
7677
  const componentName = getFirstComponentName(componentStack);
7605
- return /* @__PURE__ */ jsx32("div", { className: "rounded-xl border border-amber-500/30 bg-amber-500/8 px-4 py-3 text-sm text-amber-100", children: /* @__PURE__ */ jsxs27("div", { className: "flex items-start gap-2", children: [
7606
- /* @__PURE__ */ jsx32(AlertTriangle2, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-300" }),
7607
- /* @__PURE__ */ jsxs27("div", { className: "min-w-0 flex-1", children: [
7608
- /* @__PURE__ */ jsxs27("div", { className: "font-medium", children: [
7678
+ return /* @__PURE__ */ jsx33("div", { className: "rounded-xl border border-amber-500/30 bg-amber-500/8 px-4 py-3 text-sm text-amber-100", children: /* @__PURE__ */ jsxs28("div", { className: "flex items-start gap-2", children: [
7679
+ /* @__PURE__ */ jsx33(AlertTriangle2, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-300" }),
7680
+ /* @__PURE__ */ jsxs28("div", { className: "min-w-0 flex-1", children: [
7681
+ /* @__PURE__ */ jsxs28("div", { className: "font-medium", children: [
7609
7682
  label,
7610
7683
  "\u6E32\u67D3\u5931\u8D25"
7611
7684
  ] }),
7612
- /* @__PURE__ */ jsxs27("div", { className: "mt-1 break-words text-xs leading-5 text-amber-100/75", children: [
7685
+ /* @__PURE__ */ jsxs28("div", { className: "mt-1 break-words text-xs leading-5 text-amber-100/75", children: [
7613
7686
  componentName ? `\u7EC4\u4EF6\uFF1A${componentName}\u3002` : null,
7614
7687
  error.message || "\u53D1\u751F\u4E86\u672A\u9884\u671F\u7684\u6E32\u67D3\u9519\u8BEF\u3002"
7615
7688
  ] }),
7616
- details ? /* @__PURE__ */ jsx32("div", { className: "mt-1 truncate text-xs text-amber-100/55", children: details }) : null
7689
+ details ? /* @__PURE__ */ jsx33("div", { className: "mt-1 truncate text-xs text-amber-100/55", children: details }) : null
7617
7690
  ] })
7618
7691
  ] }) });
7619
7692
  }
@@ -7632,7 +7705,7 @@ import {
7632
7705
  WandSparkles
7633
7706
  } from "lucide-react";
7634
7707
  import { useEffect as useEffect16, useMemo as useMemo16, useState as useState20 } from "react";
7635
- import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
7708
+ import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
7636
7709
  var EMPTY_EVENTS = [];
7637
7710
  function formatElapsedDuration(durationMs) {
7638
7711
  if (durationMs == null) return null;
@@ -7742,22 +7815,22 @@ function StickyStatusBar({
7742
7815
  }
7743
7816
  const elapsedLabel = formatElapsedDuration(elapsedDuration);
7744
7817
  const Icon = action.Icon;
7745
- return /* @__PURE__ */ jsxs28(
7818
+ return /* @__PURE__ */ jsxs29(
7746
7819
  "button",
7747
7820
  {
7748
7821
  type: "button",
7749
7822
  onClick: onJumpToLatest,
7750
7823
  className: "sticky top-0 z-20 mb-4 flex w-full items-center gap-3 rounded-2xl border border-[hsl(var(--primary)/0.2)] bg-[hsl(var(--background)/0.92)] px-4 py-3 text-left shadow-[0_12px_32px_-24px_hsl(var(--foreground)/0.6)] backdrop-blur",
7751
7824
  children: [
7752
- /* @__PURE__ */ jsx33("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-[hsl(var(--primary)/0.12)] text-[hsl(var(--primary))]", children: /* @__PURE__ */ jsx33(Icon, { size: 18, className: Icon === LoaderCircle2 ? "animate-spin" : void 0 }) }),
7753
- /* @__PURE__ */ jsxs28("div", { className: "min-w-0 flex-1", children: [
7754
- /* @__PURE__ */ jsx33("div", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: action.label }),
7755
- /* @__PURE__ */ jsxs28("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
7756
- elapsedLabel ? /* @__PURE__ */ jsxs28("span", { className: "font-mono", children: [
7825
+ /* @__PURE__ */ jsx34("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-[hsl(var(--primary)/0.12)] text-[hsl(var(--primary))]", children: /* @__PURE__ */ jsx34(Icon, { size: 18, className: Icon === LoaderCircle2 ? "animate-spin" : void 0 }) }),
7826
+ /* @__PURE__ */ jsxs29("div", { className: "min-w-0 flex-1", children: [
7827
+ /* @__PURE__ */ jsx34("div", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: action.label }),
7828
+ /* @__PURE__ */ jsxs29("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
7829
+ elapsedLabel ? /* @__PURE__ */ jsxs29("span", { className: "font-mono", children: [
7757
7830
  "\u5DF2\u6301\u7EED ",
7758
7831
  elapsedLabel
7759
7832
  ] }) : null,
7760
- /* @__PURE__ */ jsx33("span", { children: "\u70B9\u51FB\u8DF3\u5230\u6700\u65B0\u4F4D\u7F6E" })
7833
+ /* @__PURE__ */ jsx34("span", { children: "\u70B9\u51FB\u8DF3\u5230\u6700\u65B0\u4F4D\u7F6E" })
7761
7834
  ] })
7762
7835
  ] })
7763
7836
  ]
@@ -7766,7 +7839,7 @@ function StickyStatusBar({
7766
7839
  }
7767
7840
 
7768
7841
  // src/react/components/chat/TurnNavRail.tsx
7769
- import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
7842
+ import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
7770
7843
  function TurnNavRail({
7771
7844
  items,
7772
7845
  activeTurnId,
@@ -7775,14 +7848,14 @@ function TurnNavRail({
7775
7848
  if (items.length < 2) {
7776
7849
  return null;
7777
7850
  }
7778
- return /* @__PURE__ */ jsx34(
7851
+ return /* @__PURE__ */ jsx35(
7779
7852
  "nav",
7780
7853
  {
7781
7854
  "aria-label": "\u56DE\u5408\u5BFC\u822A",
7782
7855
  className: "absolute right-2 top-4 z-10 hidden flex-col items-end gap-0.5 md:flex",
7783
7856
  children: items.map((item, index) => {
7784
7857
  const isActive = item.id === activeTurnId;
7785
- return /* @__PURE__ */ jsxs29(
7858
+ return /* @__PURE__ */ jsxs30(
7786
7859
  "button",
7787
7860
  {
7788
7861
  type: "button",
@@ -7790,8 +7863,8 @@ function TurnNavRail({
7790
7863
  "aria-current": isActive ? "true" : void 0,
7791
7864
  className: "group relative flex h-3.5 items-center",
7792
7865
  children: [
7793
- /* @__PURE__ */ jsx34("span", { className: "pointer-events-none absolute right-full mr-2 hidden max-w-48 truncate whitespace-nowrap rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-2.5 py-1.5 text-xs text-[hsl(var(--popover-foreground))] shadow-lg group-hover:block", children: item.title || `\u7B2C ${index + 1} \u8F6E` }),
7794
- /* @__PURE__ */ jsx34(
7866
+ /* @__PURE__ */ jsx35("span", { className: "pointer-events-none absolute right-full mr-2 hidden max-w-48 truncate whitespace-nowrap rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-2.5 py-1.5 text-xs text-[hsl(var(--popover-foreground))] shadow-lg group-hover:block", children: item.title || `\u7B2C ${index + 1} \u8F6E` }),
7867
+ /* @__PURE__ */ jsx35(
7795
7868
  "span",
7796
7869
  {
7797
7870
  className: cn(
@@ -7810,7 +7883,7 @@ function TurnNavRail({
7810
7883
  }
7811
7884
 
7812
7885
  // src/react/components/chat/MessageList.tsx
7813
- import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
7886
+ import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
7814
7887
  function parseModeChange(message) {
7815
7888
  if (message.kind !== "mode_change" || typeof message.content !== "string") {
7816
7889
  return null;
@@ -8086,13 +8159,13 @@ function MessageList({
8086
8159
  const handleSelectTurn = useCallback12((turnId) => {
8087
8160
  document.getElementById(turnId)?.scrollIntoView({ behavior: "smooth", block: "start" });
8088
8161
  }, []);
8089
- return /* @__PURE__ */ jsxs30(
8162
+ return /* @__PURE__ */ jsxs31(
8090
8163
  "div",
8091
8164
  {
8092
8165
  ref: containerRef,
8093
8166
  className: `relative min-h-0 flex-1 ${customization?.classNames?.messageListRoot ?? ""}`,
8094
8167
  children: [
8095
- turnNavItems.length > 1 ? /* @__PURE__ */ jsx35(
8168
+ turnNavItems.length > 1 ? /* @__PURE__ */ jsx36(
8096
8169
  TurnNavRail,
8097
8170
  {
8098
8171
  items: turnNavItems,
@@ -8100,7 +8173,7 @@ function MessageList({
8100
8173
  onSelectTurn: handleSelectTurn
8101
8174
  }
8102
8175
  ) : null,
8103
- /* @__PURE__ */ jsxs30(
8176
+ /* @__PURE__ */ jsxs31(
8104
8177
  StickToBottom,
8105
8178
  {
8106
8179
  contextRef: stickContextRef,
@@ -8108,7 +8181,7 @@ function MessageList({
8108
8181
  initial: "instant",
8109
8182
  resize: stickyTurn ? { damping: 0.8, stiffness: 0.08, mass: 1 } : "instant",
8110
8183
  children: [
8111
- /* @__PURE__ */ jsx35(StickToBottom.Content, { className: "px-5 py-6", children: /* @__PURE__ */ jsx35(
8184
+ /* @__PURE__ */ jsx36(StickToBottom.Content, { className: "px-5 py-6", children: /* @__PURE__ */ jsx36(
8112
8185
  MessageListContent,
8113
8186
  {
8114
8187
  askAnswers,
@@ -8125,7 +8198,7 @@ function MessageList({
8125
8198
  customization
8126
8199
  }
8127
8200
  ) }),
8128
- /* @__PURE__ */ jsx35(ScrollToBottomButton, {})
8201
+ /* @__PURE__ */ jsx36(ScrollToBottomButton, {})
8129
8202
  ]
8130
8203
  }
8131
8204
  )
@@ -8155,8 +8228,8 @@ function MessageListContent({
8155
8228
  }
8156
8229
  scrollToBottom();
8157
8230
  }, [lastTurnId, scrollToBottom]);
8158
- return /* @__PURE__ */ jsx35("div", { className: `mx-auto max-w-3xl ${customization?.classNames?.messageListContent ?? ""}`, children: /* @__PURE__ */ jsxs30("div", { className: `min-w-0 flex flex-col gap-8 ${customization?.classNames?.messageListInner ?? ""}`, children: [
8159
- stickyTurn ? /* @__PURE__ */ jsx35(
8231
+ return /* @__PURE__ */ jsx36("div", { className: `mx-auto max-w-3xl ${customization?.classNames?.messageListContent ?? ""}`, children: /* @__PURE__ */ jsxs31("div", { className: `min-w-0 flex flex-col gap-8 ${customization?.classNames?.messageListInner ?? ""}`, children: [
8232
+ stickyTurn ? /* @__PURE__ */ jsx36(
8160
8233
  StickyStatusBar,
8161
8234
  {
8162
8235
  sessionId,
@@ -8166,31 +8239,31 @@ function MessageListContent({
8166
8239
  onJumpToLatest: handleJumpToLatest
8167
8240
  }
8168
8241
  ) : null,
8169
- renderBlocks.length === 0 ? customization?.components?.EmptyState ? /* @__PURE__ */ jsx35(customization.components.EmptyState, {}) : /* @__PURE__ */ jsxs30("div", { className: `flex flex-col items-center justify-center gap-3 py-24 text-[hsl(var(--muted-foreground))] ${customization?.classNames?.emptyState ?? ""}`, children: [
8170
- /* @__PURE__ */ jsx35(MessageSquare, { size: 40, strokeWidth: 1.5 }),
8171
- /* @__PURE__ */ jsx35("span", { className: "text-base font-medium", children: "\u5F00\u59CB\u5BF9\u8BDD" }),
8172
- /* @__PURE__ */ jsx35("span", { className: "text-sm opacity-60", children: "\u5728\u4E0B\u65B9\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u804A\u5929" })
8242
+ renderBlocks.length === 0 ? customization?.components?.EmptyState ? /* @__PURE__ */ jsx36(customization.components.EmptyState, {}) : /* @__PURE__ */ jsxs31("div", { className: `flex flex-col items-center justify-center gap-3 py-24 text-[hsl(var(--muted-foreground))] ${customization?.classNames?.emptyState ?? ""}`, children: [
8243
+ /* @__PURE__ */ jsx36(MessageSquare, { size: 40, strokeWidth: 1.5 }),
8244
+ /* @__PURE__ */ jsx36("span", { className: "text-base font-medium", children: "\u5F00\u59CB\u5BF9\u8BDD" }),
8245
+ /* @__PURE__ */ jsx36("span", { className: "text-sm opacity-60", children: "\u5728\u4E0B\u65B9\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u804A\u5929" })
8173
8246
  ] }) : renderBlocks.map((block, blockIndex) => {
8174
8247
  if (block.type === "message") {
8175
- return /* @__PURE__ */ jsx35("div", { className: "msg-animate", children: isUserMessage(block.message) ? customization?.components?.UserMessage ? /* @__PURE__ */ jsx35(
8248
+ return /* @__PURE__ */ jsx36("div", { className: "msg-animate", children: isUserMessage(block.message) ? customization?.components?.UserMessage ? /* @__PURE__ */ jsx36(
8176
8249
  customization.components.UserMessage,
8177
8250
  {
8178
8251
  message: block.message,
8179
8252
  className: customization.classNames?.userMessage
8180
8253
  }
8181
- ) : /* @__PURE__ */ jsx35(
8254
+ ) : /* @__PURE__ */ jsx36(
8182
8255
  UserMessageBubble,
8183
8256
  {
8184
8257
  message: block.message,
8185
8258
  className: customization?.classNames?.userMessage
8186
8259
  }
8187
- ) : isErrorMessage(block.message) ? customization?.components?.ErrorMessage ? /* @__PURE__ */ jsx35(
8260
+ ) : isErrorMessage(block.message) ? customization?.components?.ErrorMessage ? /* @__PURE__ */ jsx36(
8188
8261
  customization.components.ErrorMessage,
8189
8262
  {
8190
8263
  message: block.message,
8191
8264
  className: customization.classNames?.errorMessage
8192
8265
  }
8193
- ) : /* @__PURE__ */ jsx35(
8266
+ ) : /* @__PURE__ */ jsx36(
8194
8267
  ErrorMessageBlock,
8195
8268
  {
8196
8269
  message: block.message,
@@ -8207,20 +8280,20 @@ function MessageListContent({
8207
8280
  );
8208
8281
  const isFollowedByPlanningExit = nextBlock?.type === "planning_divider" && nextBlock.kind === "exit";
8209
8282
  const showPlanCard = (hasExitPlan || isFollowedByPlanningExit) && onConfirmPlan && sessionStatus === "waiting_for_input";
8210
- return /* @__PURE__ */ jsxs30(
8283
+ return /* @__PURE__ */ jsxs31(
8211
8284
  "div",
8212
8285
  {
8213
8286
  id: block.anchorId,
8214
8287
  "data-turn-id": block.anchorId,
8215
8288
  className: "msg-animate flex scroll-mt-6 flex-col gap-4",
8216
8289
  children: [
8217
- /* @__PURE__ */ jsx35(
8290
+ /* @__PURE__ */ jsx36(
8218
8291
  RenderErrorBoundary,
8219
8292
  {
8220
8293
  label: "\u52A9\u624B\u6D88\u606F",
8221
8294
  details: block.key,
8222
8295
  resetKey: getMessagesResetSignature(block.messages),
8223
- children: customization?.components?.AssistantTurn ? /* @__PURE__ */ jsx35(
8296
+ children: customization?.components?.AssistantTurn ? /* @__PURE__ */ jsx36(
8224
8297
  customization.components.AssistantTurn,
8225
8298
  {
8226
8299
  turnKey: block.key,
@@ -8233,7 +8306,7 @@ function MessageListContent({
8233
8306
  sessionStatus,
8234
8307
  customization
8235
8308
  }
8236
- ) : /* @__PURE__ */ jsx35(
8309
+ ) : /* @__PURE__ */ jsx36(
8237
8310
  AssistantTurnBlock,
8238
8311
  {
8239
8312
  turnKey: block.key,
@@ -8249,13 +8322,13 @@ function MessageListContent({
8249
8322
  )
8250
8323
  }
8251
8324
  ),
8252
- showPlanCard ? /* @__PURE__ */ jsx35(
8325
+ showPlanCard ? /* @__PURE__ */ jsx36(
8253
8326
  RenderErrorBoundary,
8254
8327
  {
8255
8328
  label: "\u89C4\u5212\u6458\u8981",
8256
8329
  details: block.key,
8257
8330
  resetKey: `${sessionStatus ?? ""}:${layoutSignature}`,
8258
- children: /* @__PURE__ */ jsx35(
8331
+ children: /* @__PURE__ */ jsx36(
8259
8332
  PlanSummaryCard,
8260
8333
  {
8261
8334
  messages: extractLatestPlanMessages(messages),
@@ -8271,7 +8344,7 @@ function MessageListContent({
8271
8344
  );
8272
8345
  }
8273
8346
  if (block.type === "compaction") {
8274
- return /* @__PURE__ */ jsx35("div", { className: "msg-animate", children: /* @__PURE__ */ jsx35(
8347
+ return /* @__PURE__ */ jsx36("div", { className: "msg-animate", children: /* @__PURE__ */ jsx36(
8275
8348
  CompactionCard,
8276
8349
  {
8277
8350
  sessionId,
@@ -8280,41 +8353,41 @@ function MessageListContent({
8280
8353
  }
8281
8354
  ) }, block.key);
8282
8355
  }
8283
- return /* @__PURE__ */ jsx35(PlanningDivider, { kind: block.kind }, block.key);
8356
+ return /* @__PURE__ */ jsx36(PlanningDivider, { kind: block.kind }, block.key);
8284
8357
  }),
8285
- sessionStatus === "interrupted" && !hasInterruptedTurn ? /* @__PURE__ */ jsx35("div", { className: "flex", children: /* @__PURE__ */ jsx35("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
8358
+ sessionStatus === "interrupted" && !hasInterruptedTurn ? /* @__PURE__ */ jsx36("div", { className: "flex", children: /* @__PURE__ */ jsx36("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
8286
8359
  ] }) });
8287
8360
  }
8288
8361
  function ScrollToBottomButton() {
8289
8362
  const { isAtBottom, scrollToBottom } = useStickToBottomContext();
8290
8363
  if (isAtBottom) return null;
8291
- return /* @__PURE__ */ jsxs30(
8364
+ return /* @__PURE__ */ jsxs31(
8292
8365
  "button",
8293
8366
  {
8294
8367
  type: "button",
8295
8368
  onClick: () => scrollToBottom(),
8296
8369
  className: "absolute bottom-4 right-4 flex items-center gap-1 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-3 py-1.5 text-xs text-[hsl(var(--muted-foreground))] shadow-lg transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
8297
8370
  children: [
8298
- /* @__PURE__ */ jsx35(ChevronDown3, { size: 14 }),
8299
- /* @__PURE__ */ jsx35("span", { children: "\u6EDA\u52A8\u5230\u5E95\u90E8" })
8371
+ /* @__PURE__ */ jsx36(ChevronDown3, { size: 14 }),
8372
+ /* @__PURE__ */ jsx36("span", { children: "\u6EDA\u52A8\u5230\u5E95\u90E8" })
8300
8373
  ]
8301
8374
  }
8302
8375
  );
8303
8376
  }
8304
8377
  function PlanningDivider({ kind }) {
8305
8378
  const isEnter = kind === "enter";
8306
- return /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-3 py-1", children: [
8307
- /* @__PURE__ */ jsx35("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" }),
8308
- /* @__PURE__ */ jsxs30("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: [
8309
- /* @__PURE__ */ jsx35(Lightbulb2, { size: 12 }),
8310
- /* @__PURE__ */ jsx35("span", { children: isEnter ? "\u8FDB\u5165\u89C4\u5212\u6A21\u5F0F" : "\u89C4\u5212\u5B8C\u6210" })
8379
+ return /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-3 py-1", children: [
8380
+ /* @__PURE__ */ jsx36("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" }),
8381
+ /* @__PURE__ */ jsxs31("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: [
8382
+ /* @__PURE__ */ jsx36(Lightbulb2, { size: 12 }),
8383
+ /* @__PURE__ */ jsx36("span", { children: isEnter ? "\u8FDB\u5165\u89C4\u5212\u6A21\u5F0F" : "\u89C4\u5212\u5B8C\u6210" })
8311
8384
  ] }),
8312
- /* @__PURE__ */ jsx35("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" })
8385
+ /* @__PURE__ */ jsx36("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" })
8313
8386
  ] });
8314
8387
  }
8315
8388
 
8316
8389
  // src/react/components/chat/ChatView.tsx
8317
- import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
8390
+ import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
8318
8391
  function ChatView({
8319
8392
  sessionId,
8320
8393
  renderAttachments,
@@ -8323,6 +8396,7 @@ function ChatView({
8323
8396
  canShareSession = false,
8324
8397
  onResyncSkills,
8325
8398
  isResyncingSkills = false,
8399
+ inputLabel,
8326
8400
  classNames,
8327
8401
  components,
8328
8402
  renderers
@@ -8332,6 +8406,7 @@ function ChatView({
8332
8406
  isStreaming,
8333
8407
  isStopping,
8334
8408
  send,
8409
+ append,
8335
8410
  stop
8336
8411
  } = useChat(sessionId);
8337
8412
  const session = useSessionStore((s) => s.sessions.find((ss) => ss.id === sessionId));
@@ -8358,17 +8433,17 @@ function ChatView({
8358
8433
  [classNames, components, renderers]
8359
8434
  );
8360
8435
  const SkillStatus = components?.SkillStatusBar;
8361
- return /* @__PURE__ */ jsxs31("div", { className: `flex min-h-0 flex-1 flex-col overflow-hidden ${classNames?.root ?? ""}`, children: [
8362
- isViewer && /* @__PURE__ */ jsxs31("div", { className: `flex items-center justify-center gap-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))] py-2 text-xs text-[hsl(var(--muted-foreground))] ${classNames?.viewerBanner ?? ""}`, children: [
8363
- /* @__PURE__ */ jsx36(Eye, { size: 14 }),
8436
+ return /* @__PURE__ */ jsxs32("div", { className: `flex min-h-0 flex-1 flex-col overflow-hidden ${classNames?.root ?? ""}`, children: [
8437
+ isViewer && /* @__PURE__ */ jsxs32("div", { className: `flex items-center justify-center gap-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))] py-2 text-xs text-[hsl(var(--muted-foreground))] ${classNames?.viewerBanner ?? ""}`, children: [
8438
+ /* @__PURE__ */ jsx37(Eye, { size: 14 }),
8364
8439
  "\u4F60\u6B63\u5728\u67E5\u770B\u5206\u4EAB\u7684\u4F1A\u8BDD\uFF08\u53EA\u8BFB\uFF09"
8365
8440
  ] }),
8366
- !isViewer && /* @__PURE__ */ jsx36(ConnectionBanner, {}),
8367
- errorMessage && /* @__PURE__ */ jsxs31("div", { className: "flex items-start gap-2 border-b border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800 dark:border-red-800/30 dark:bg-red-950/30 dark:text-red-300", children: [
8368
- /* @__PURE__ */ jsx36(CircleAlert, { size: 16, className: "mt-0.5 shrink-0" }),
8369
- /* @__PURE__ */ jsx36("span", { children: errorMessage })
8441
+ !isViewer && /* @__PURE__ */ jsx37(ConnectionBanner, {}),
8442
+ errorMessage && /* @__PURE__ */ jsxs32("div", { className: "flex items-start gap-2 border-b border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800 dark:border-red-800/30 dark:bg-red-950/30 dark:text-red-300", children: [
8443
+ /* @__PURE__ */ jsx37(CircleAlert2, { size: 16, className: "mt-0.5 shrink-0" }),
8444
+ /* @__PURE__ */ jsx37("span", { children: errorMessage })
8370
8445
  ] }),
8371
- /* @__PURE__ */ jsx36(
8446
+ /* @__PURE__ */ jsx37(
8372
8447
  MessageList,
8373
8448
  {
8374
8449
  sessionId,
@@ -8380,10 +8455,11 @@ function ChatView({
8380
8455
  },
8381
8456
  sessionId
8382
8457
  ),
8383
- !isViewer && /* @__PURE__ */ jsx36(
8458
+ !isViewer && /* @__PURE__ */ jsx37(
8384
8459
  ChatInput,
8385
8460
  {
8386
8461
  onSend: (msg, _targetSessionId, model) => send(msg, mode, void 0, { model: model || void 0 }),
8462
+ onAppend: append,
8387
8463
  onStop: stop,
8388
8464
  isStreaming,
8389
8465
  isStopping,
@@ -8399,7 +8475,8 @@ function ChatView({
8399
8475
  skillStatusBarClassName: classNames?.skillStatusBarRoot,
8400
8476
  skillStatusBarInnerClassName: classNames?.skillStatusBarInner,
8401
8477
  onResyncSkills,
8402
- isResyncingSkills
8478
+ isResyncingSkills,
8479
+ inputLabel
8403
8480
  }
8404
8481
  )
8405
8482
  ] });
@@ -8456,4 +8533,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
8456
8533
  * Licensed under the MIT License. See License.txt in the project root for license information.
8457
8534
  *--------------------------------------------------------------------------------------------*)
8458
8535
  */
8459
- //# sourceMappingURL=chunk-7FGJNW56.js.map
8536
+ //# sourceMappingURL=chunk-QCDNRR74.js.map