@blade-hq/agent-react 2612.0.0-beta.6 → 2612.0.0-beta.7

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.
@@ -18,7 +18,6 @@ import {
18
18
  CircleCheck,
19
19
  CirclePause,
20
20
  CircleX,
21
- CodePreview,
22
21
  Copy,
23
22
  CurrentChatSessionProvider,
24
23
  Dialog,
@@ -76,29 +75,18 @@ import {
76
75
  copyToClipboard,
77
76
  dist_exports,
78
77
  dist_exports3 as dist_exports2,
79
- extractErrorMessage,
80
78
  extractToolFilePath,
81
- formatBytes,
82
79
  formatToolFileName,
83
80
  formatToolName,
84
- getBooleanValue,
85
- getFileName,
86
- getNumberValue,
87
81
  getPlanUpdateDisplayState,
88
82
  getPluginSuggestionItems,
89
- getResultImages,
90
- getResultText,
91
- getStringValue,
92
83
  getToolDescription,
93
84
  getToolDisplayLabel,
94
85
  getToolOutputTag,
95
86
  getToolStatusLabel,
96
87
  getToolTone,
97
- isPlainObject,
98
88
  isPlanUpdateTool,
99
89
  notifyChat,
100
- parseJsonValue,
101
- parseKbSearchResult,
102
90
  parsePlanUpdate,
103
91
  pluginRefsForSend,
104
92
  sendToSession,
@@ -123,7 +111,7 @@ import {
123
111
  useSessionSource,
124
112
  useSessionState,
125
113
  useSingleSessionSource
126
- } from "./chunk-UKQFSXGC.js";
114
+ } from "./chunk-MERN5XEM.js";
127
115
  import {
128
116
  __export
129
117
  } from "./chunk-PR4QN5HX.js";
@@ -1513,7 +1501,7 @@ __export(util_exports, {
1513
1501
  hide: () => hide,
1514
1502
  installLazyProp: () => installLazyProp,
1515
1503
  isObject: () => isObject,
1516
- isPlainObject: () => isPlainObject2,
1504
+ isPlainObject: () => isPlainObject,
1517
1505
  issue: () => issue,
1518
1506
  joinValues: () => joinValues,
1519
1507
  jsonStringifyReplacer: () => jsonStringifyReplacer,
@@ -1699,7 +1687,7 @@ var allowsEval = /* @__PURE__ */ cached(() => {
1699
1687
  return false;
1700
1688
  }
1701
1689
  });
1702
- function isPlainObject2(o) {
1690
+ function isPlainObject(o) {
1703
1691
  if (isObject(o) === false)
1704
1692
  return false;
1705
1693
  const ctor = o.constructor;
@@ -1716,7 +1704,7 @@ function isPlainObject2(o) {
1716
1704
  return true;
1717
1705
  }
1718
1706
  function shallowClone(o) {
1719
- if (isPlainObject2(o))
1707
+ if (isPlainObject(o))
1720
1708
  return { ...o };
1721
1709
  if (Array.isArray(o))
1722
1710
  return [...o];
@@ -1920,7 +1908,7 @@ function omit(schema2, mask) {
1920
1908
  return clone(schema2, def);
1921
1909
  }
1922
1910
  function extend(schema2, shape) {
1923
- if (!isPlainObject2(shape)) {
1911
+ if (!isPlainObject(shape)) {
1924
1912
  throw new Error("Invalid input to extend: expected a plain object");
1925
1913
  }
1926
1914
  const checks = schema2._zod.def.checks;
@@ -1943,7 +1931,7 @@ function extend(schema2, shape) {
1943
1931
  return clone(schema2, def);
1944
1932
  }
1945
1933
  function safeExtend(schema2, shape) {
1946
- if (!isPlainObject2(shape)) {
1934
+ if (!isPlainObject(shape)) {
1947
1935
  throw new Error("Invalid input to safeExtend: expected a plain object");
1948
1936
  }
1949
1937
  const def = mergeDefs(schema2._zod.def, {
@@ -4786,7 +4774,7 @@ function mergeValues(a, b2) {
4786
4774
  if (a instanceof Date && b2 instanceof Date && +a === +b2) {
4787
4775
  return { valid: true, data: a };
4788
4776
  }
4789
- if (isPlainObject2(a) && isPlainObject2(b2)) {
4777
+ if (isPlainObject(a) && isPlainObject(b2)) {
4790
4778
  const bKeys = Object.keys(b2);
4791
4779
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
4792
4780
  const newObj = { ...a, ...b2 };
@@ -4997,7 +4985,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4997
4985
  memo6?.attach(inst);
4998
4986
  inst._zod.parse = (payload, ctx) => {
4999
4987
  const input2 = payload.value;
5000
- if (!isPlainObject2(input2)) {
4988
+ if (!isPlainObject(input2)) {
5001
4989
  payload.issues.push({
5002
4990
  expected: "record",
5003
4991
  code: "invalid_type",
@@ -14701,7 +14689,7 @@ function generateIntersectionCheck(doc, ctx, schema2, accessor) {
14701
14689
  }
14702
14690
  function generateRecordCheck(doc, ctx, schema2, accessor) {
14703
14691
  const def = schema2._zod.def;
14704
- const isPlainObjectConst = addConstant(ctx, isPlainObject2);
14692
+ const isPlainObjectConst = addConstant(ctx, isPlainObject);
14705
14693
  doc.write(`if (!${isPlainObjectConst}(${accessor})) return INVALID;`);
14706
14694
  const outputVar = newVar(ctx);
14707
14695
  const kVar = newVar(ctx);
@@ -19375,7 +19363,7 @@ function convertBaseSchema(schema2, ctx) {
19375
19363
  const patterns = patternKeys.map((p2) => new RegExp(p2));
19376
19364
  const basePatternSchema = zodSchema;
19377
19365
  zodSchema = zodSchema.check((payload) => {
19378
- if (!isPlainObject2(payload.value))
19366
+ if (!isPlainObject(payload.value))
19379
19367
  return;
19380
19368
  const unrecognized = [];
19381
19369
  for (const key of Object.keys(payload.value)) {
@@ -24877,18 +24865,18 @@ var Protocol = class {
24877
24865
  function isPlainObject$1(value) {
24878
24866
  return value !== null && typeof value === "object" && !Array.isArray(value);
24879
24867
  }
24880
- function isPlainObject3(value) {
24868
+ function isPlainObject2(value) {
24881
24869
  return typeof value === "object" && value !== null && !Array.isArray(value);
24882
24870
  }
24883
24871
  function partitionInputResponses(inputResponses) {
24884
24872
  const accepted = {};
24885
24873
  const droppedKeys = [];
24886
- if (!isPlainObject3(inputResponses)) return {
24874
+ if (!isPlainObject2(inputResponses)) return {
24887
24875
  accepted,
24888
24876
  droppedKeys
24889
24877
  };
24890
24878
  for (const [key, entry] of Object.entries(inputResponses)) {
24891
- if (!isPlainObject3(entry) || "method" in entry || "result" in entry) {
24879
+ if (!isPlainObject2(entry) || "method" in entry || "result" in entry) {
24892
24880
  droppedKeys.push(key);
24893
24881
  continue;
24894
24882
  }
@@ -26458,14 +26446,14 @@ import {
26458
26446
 
26459
26447
  // src/chat/lib/citations.ts
26460
26448
  function sameEvidence(a, b2) {
26461
- return a.kbName === b2.kbName && a.title === b2.title && a.path === b2.path && a.page === b2.page && a.heading === b2.heading && a.text === b2.text && a.toolCallId === b2.toolCallId && a.itemId === b2.itemId;
26449
+ return a.title === b2.title && a.text === b2.text && a.toolCallId === b2.toolCallId && a.itemId === b2.itemId;
26462
26450
  }
26463
26451
  function buildCitationsFromToolCalls(toolCalls) {
26464
26452
  const successfulCalls = (toolCalls ?? []).filter((call) => call.status === "done");
26465
26453
  const merged = /* @__PURE__ */ new Map();
26466
26454
  const ambiguous = /* @__PURE__ */ new Set();
26467
26455
  for (const call of successfulCalls) {
26468
- const hits = parsePluginEvidence(call) ?? (formatToolName(call.name) === "KbSearch" ? parseKbSearchResult(call.result)?.hits : void 0);
26456
+ const hits = parsePluginEvidence(call);
26469
26457
  if (!hits) continue;
26470
26458
  for (const hit of hits) {
26471
26459
  const existing = merged.get(hit.n);
@@ -26505,10 +26493,6 @@ function parsePluginEvidence(call) {
26505
26493
  snapshot: true,
26506
26494
  toolCallId: String(entry.tool_call_id),
26507
26495
  itemId: entry.id,
26508
- kbName: "",
26509
- path: "",
26510
- page: null,
26511
- heading: null,
26512
26496
  previewUrl: url2
26513
26497
  }];
26514
26498
  });
@@ -35854,7 +35838,7 @@ function CitationRefBlock({ "data-n": dataN, citations }) {
35854
35838
  "bg-[hsl(var(--muted))]/60 text-[hsl(var(--muted-foreground))] transition-colors",
35855
35839
  entry.snapshot || entry.previewUrl ? "cursor-pointer hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]" : "cursor-default"
35856
35840
  ),
35857
- "aria-label": `\u5F15\u7528\u6765\u6E90\uFF1A${entry.title}${entry.page ? ` \u7B2C ${entry.page} \u9875` : ""}`,
35841
+ "aria-label": `\u5F15\u7528\u6765\u6E90\uFF1A${entry.title}`,
35858
35842
  children: entry.n
35859
35843
  }
35860
35844
  ) }),
@@ -35865,15 +35849,7 @@ function CitationRefBlock({ "data-n": dataN, citations }) {
35865
35849
  sideOffset: 6,
35866
35850
  className: "z-[70] flex max-w-sm origin-(--radix-tooltip-content-transform-origin) flex-col gap-1 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-3 py-2 text-left text-[12px] leading-5 whitespace-normal text-[hsl(var(--popover-foreground))] shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0 data-[state=instant-open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
35867
35851
  children: [
35868
- /* @__PURE__ */ jsxs10("div", { className: "font-medium", children: [
35869
- entry.title,
35870
- entry.page ? ` \xB7 \u7B2C ${entry.page} \u9875` : ""
35871
- ] }),
35872
- entry.kbName ? /* @__PURE__ */ jsxs10("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
35873
- "\u300A",
35874
- entry.kbName,
35875
- "\u300B"
35876
- ] }) : null,
35852
+ /* @__PURE__ */ jsx14("div", { className: "font-medium", children: entry.title }),
35877
35853
  entry.text ? /* @__PURE__ */ jsx14("div", { className: "line-clamp-4 text-[hsl(var(--muted-foreground))]", children: entry.text }) : null,
35878
35854
  entry.snapshot || entry.previewUrl ? /* @__PURE__ */ jsx14("div", { className: "text-[10px] text-[hsl(var(--muted-foreground))]/70", children: "\u70B9\u51FB\u67E5\u770B\u539F\u6587" }) : null,
35879
35855
  /* @__PURE__ */ jsx14(dist_exports2.Arrow, { className: "fill-[hsl(var(--popover))]" })
@@ -37143,8 +37119,137 @@ function normalizeOptionItem(value) {
37143
37119
  };
37144
37120
  }
37145
37121
 
37122
+ // src/chat/lib/code-language.ts
37123
+ var FILE_EXTENSION_ALIASES = {
37124
+ ".bash": "bash",
37125
+ ".css": "css",
37126
+ ".go": "go",
37127
+ ".htm": "html",
37128
+ ".html": "html",
37129
+ ".js": "javascript",
37130
+ ".json": "json",
37131
+ ".jsonc": "json",
37132
+ ".jsx": "jsx",
37133
+ ".md": "markdown",
37134
+ ".mdx": "markdown",
37135
+ ".py": "python",
37136
+ ".rs": "rust",
37137
+ ".scss": "css",
37138
+ ".sh": "bash",
37139
+ ".ts": "typescript",
37140
+ ".tsx": "tsx",
37141
+ ".yaml": "yaml",
37142
+ ".yml": "yaml",
37143
+ ".zsh": "bash"
37144
+ };
37145
+ function getCodeLanguageFromFilename(filePath) {
37146
+ if (!filePath) return null;
37147
+ const dotIndex = filePath.lastIndexOf(".");
37148
+ if (dotIndex < 0) return null;
37149
+ return FILE_EXTENSION_ALIASES[filePath.slice(dotIndex).toLowerCase()] ?? null;
37150
+ }
37151
+
37152
+ // src/chat/tool-renderers/shared.tsx
37153
+ import { jsx as jsx22 } from "react/jsx-runtime";
37154
+ function getResultText(result) {
37155
+ if (typeof result === "string") return result;
37156
+ if (Array.isArray(result)) {
37157
+ const texts = result.filter(
37158
+ (p2) => typeof p2 === "object" && p2 !== null && p2.type === "text" && typeof p2.text === "string"
37159
+ ).map((p2) => p2.text);
37160
+ return texts.length > 0 ? texts.join("\n") : null;
37161
+ }
37162
+ return result != null ? String(result) : null;
37163
+ }
37164
+ function getResultImages(result) {
37165
+ if (!Array.isArray(result)) return [];
37166
+ return result.filter(
37167
+ (p2) => typeof p2 === "object" && p2 !== null && p2.type === "image_url" && typeof p2.image_url?.url === "string"
37168
+ ).map((p2) => p2.image_url);
37169
+ }
37170
+ function parseJsonValue(value) {
37171
+ if (!value) return null;
37172
+ try {
37173
+ return JSON.parse(value);
37174
+ } catch {
37175
+ return null;
37176
+ }
37177
+ }
37178
+ function isPlainObject3(value) {
37179
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
37180
+ }
37181
+ function getStringValue(data, key) {
37182
+ const value = data?.[key];
37183
+ return typeof value === "string" && value.trim() ? value.trim() : null;
37184
+ }
37185
+ function getNumberValue(data, key) {
37186
+ const value = data?.[key];
37187
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
37188
+ }
37189
+ function getBooleanValue(data, key) {
37190
+ return data?.[key] === true;
37191
+ }
37192
+ function extractErrorMessage(value) {
37193
+ const text4 = typeof value === "string" ? value : getResultText(value);
37194
+ if (!text4?.trim()) return null;
37195
+ const parsed = parseJsonValue(text4);
37196
+ if (!isPlainObject3(parsed)) return null;
37197
+ return typeof parsed.error === "string" && parsed.error.trim() ? parsed.error.trim() : null;
37198
+ }
37199
+ function getFileName(filePath) {
37200
+ if (!filePath) return "\u672A\u547D\u540D\u6587\u4EF6";
37201
+ return filePath.split(/[\\/]/).pop() ?? filePath;
37202
+ }
37203
+ function getCodeLanguage(filePath) {
37204
+ return getCodeLanguageFromFilename(filePath);
37205
+ }
37206
+ function formatBytes(size) {
37207
+ if (typeof size !== "number" || !Number.isFinite(size) || size < 0) return null;
37208
+ if (size < 1024) return `${size} B`;
37209
+ if (size < 1024 * 1024) return `${(size / 1024).toFixed(1)} KB`;
37210
+ return `${(size / (1024 * 1024)).toFixed(1)} MB`;
37211
+ }
37212
+ function CodePreview({
37213
+ content: content3,
37214
+ filePath,
37215
+ emptyLabel = "\uFF08\u6682\u65E0\u5185\u5BB9\uFF09",
37216
+ className
37217
+ }) {
37218
+ const { highlightedHtml } = useHighlightedCode(content3, getCodeLanguage(filePath));
37219
+ if (!content3.trim()) {
37220
+ return /* @__PURE__ */ jsx22(
37221
+ "pre",
37222
+ {
37223
+ className: cn(
37224
+ "overflow-auto rounded-lg border border-[hsl(var(--border))]",
37225
+ "bg-[hsl(var(--muted))]/35 p-3 font-mono text-[11px] text-[hsl(var(--muted-foreground))]",
37226
+ className
37227
+ ),
37228
+ children: /* @__PURE__ */ jsx22("code", { children: emptyLabel })
37229
+ }
37230
+ );
37231
+ }
37232
+ return /* @__PURE__ */ jsx22(
37233
+ "pre",
37234
+ {
37235
+ className: cn(
37236
+ "overflow-auto rounded-lg border border-[hsl(var(--border))]",
37237
+ "bg-[hsl(var(--muted))]/35 p-3 text-[11px]",
37238
+ className
37239
+ ),
37240
+ children: highlightedHtml ? /* @__PURE__ */ jsx22(
37241
+ "code",
37242
+ {
37243
+ className: "font-mono",
37244
+ dangerouslySetInnerHTML: { __html: highlightedHtml }
37245
+ }
37246
+ ) : /* @__PURE__ */ jsx22("code", { className: "whitespace-pre-wrap break-words font-mono text-[hsl(var(--foreground))]", children: content3 })
37247
+ }
37248
+ );
37249
+ }
37250
+
37146
37251
  // src/chat/tool-renderers/BashRenderer.tsx
37147
- import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
37252
+ import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
37148
37253
  function pickOutputField(data) {
37149
37254
  if (!data) return null;
37150
37255
  for (const key of ["output", "stdout", "stderr"]) {
@@ -37154,15 +37259,15 @@ function pickOutputField(data) {
37154
37259
  return null;
37155
37260
  }
37156
37261
  function MetaPill({ label }) {
37157
- return /* @__PURE__ */ jsx22("span", { className: "rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-secondary-foreground", children: label });
37262
+ return /* @__PURE__ */ jsx23("span", { className: "rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-secondary-foreground", children: label });
37158
37263
  }
37159
37264
  function BashRenderer({ toolCall }) {
37160
37265
  const argsValue = parseJsonValue(toolCall.arguments);
37161
37266
  const rawText = getResultText(toolCall.result);
37162
37267
  const resultStr = typeof rawText === "string" && rawText.trim().length > 0 ? rawText : null;
37163
37268
  const resultValue = parseJsonValue(resultStr);
37164
- const args = isPlainObject(argsValue) ? argsValue : null;
37165
- const result = isPlainObject(resultValue) ? resultValue : null;
37269
+ const args = isPlainObject3(argsValue) ? argsValue : null;
37270
+ const result = isPlainObject3(resultValue) ? resultValue : null;
37166
37271
  const normalizedName = formatToolName(toolCall.name);
37167
37272
  const command = getStringValue(result, "command") ?? getStringValue(args, "command") ?? "";
37168
37273
  const description = getStringValue(args, "description") ?? getStringValue(result, "description") ?? "";
@@ -37179,12 +37284,12 @@ function BashRenderer({ toolCall }) {
37179
37284
  const hasFailure = toolCall.status === "error" || timedOut || exitCode !== null && exitCode !== 0;
37180
37285
  return /* @__PURE__ */ jsxs17("div", { className: "space-y-3", children: [
37181
37286
  (description || cwd) && /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
37182
- description ? /* @__PURE__ */ jsx22("span", { children: description }) : null,
37183
- cwd ? /* @__PURE__ */ jsx22("span", { className: "rounded-full bg-[hsl(var(--muted))] px-2 py-0.5 font-mono", children: cwd }) : null
37287
+ description ? /* @__PURE__ */ jsx23("span", { children: description }) : null,
37288
+ cwd ? /* @__PURE__ */ jsx23("span", { className: "rounded-full bg-[hsl(var(--muted))] px-2 py-0.5 font-mono", children: cwd }) : null
37184
37289
  ] }),
37185
37290
  /* @__PURE__ */ jsxs17("div", { className: "overflow-hidden rounded-lg border border-border bg-card", children: [
37186
- /* @__PURE__ */ jsx22("div", { className: "border-b border-border px-3 py-2 text-[10px] uppercase tracking-[0.16em] text-muted-foreground", children: "\u547D\u4EE4" }),
37187
- /* @__PURE__ */ jsx22("pre", { className: "overflow-x-auto px-3 py-3 font-mono text-[11px] leading-5 text-foreground", children: /* @__PURE__ */ jsx22("code", { children: `$ ${command || "\uFF08\u672A\u63D0\u4F9B\u547D\u4EE4\uFF09"}` }) })
37291
+ /* @__PURE__ */ jsx23("div", { className: "border-b border-border px-3 py-2 text-[10px] uppercase tracking-[0.16em] text-muted-foreground", children: "\u547D\u4EE4" }),
37292
+ /* @__PURE__ */ jsx23("pre", { className: "overflow-x-auto px-3 py-3 font-mono text-[11px] leading-5 text-foreground", children: /* @__PURE__ */ jsx23("code", { children: `$ ${command || "\uFF08\u672A\u63D0\u4F9B\u547D\u4EE4\uFF09"}` }) })
37188
37293
  ] }),
37189
37294
  /* @__PURE__ */ jsxs17(
37190
37295
  "div",
@@ -37195,20 +37300,20 @@ function BashRenderer({ toolCall }) {
37195
37300
  ),
37196
37301
  children: [
37197
37302
  /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-2", children: [
37198
- /* @__PURE__ */ jsx22("div", { className: "text-[10px] uppercase tracking-[0.16em] text-muted-foreground", children: "\u8F93\u51FA" }),
37303
+ /* @__PURE__ */ jsx23("div", { className: "text-[10px] uppercase tracking-[0.16em] text-muted-foreground", children: "\u8F93\u51FA" }),
37199
37304
  /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-1.5", children: [
37200
- taskId ? /* @__PURE__ */ jsx22(MetaPill, { label: `\u4EFB\u52A1 ${taskId}` }) : null,
37201
- exitCode !== null ? /* @__PURE__ */ jsx22(MetaPill, { label: `\u9000\u51FA\u7801 ${exitCode}` }) : null,
37202
- timedOut ? /* @__PURE__ */ jsx22(MetaPill, { label: "\u5DF2\u8D85\u65F6" }) : null,
37203
- truncated ? /* @__PURE__ */ jsx22(MetaPill, { label: "\u8F93\u51FA\u5DF2\u622A\u65AD" }) : null,
37204
- normalizedName === "BgBash" && !taskId ? /* @__PURE__ */ jsx22(MetaPill, { label: "\u540E\u53F0\u4EFB\u52A1" }) : null
37305
+ taskId ? /* @__PURE__ */ jsx23(MetaPill, { label: `\u4EFB\u52A1 ${taskId}` }) : null,
37306
+ exitCode !== null ? /* @__PURE__ */ jsx23(MetaPill, { label: `\u9000\u51FA\u7801 ${exitCode}` }) : null,
37307
+ timedOut ? /* @__PURE__ */ jsx23(MetaPill, { label: "\u5DF2\u8D85\u65F6" }) : null,
37308
+ truncated ? /* @__PURE__ */ jsx23(MetaPill, { label: "\u8F93\u51FA\u5DF2\u622A\u65AD" }) : null,
37309
+ normalizedName === "BgBash" && !taskId ? /* @__PURE__ */ jsx23(MetaPill, { label: "\u540E\u53F0\u4EFB\u52A1" }) : null
37205
37310
  ] })
37206
37311
  ] }),
37207
- /* @__PURE__ */ jsx22("pre", { className: "max-h-[280px] overflow-auto px-3 py-3 font-mono text-[11px] leading-5 text-foreground", children: /* @__PURE__ */ jsx22("code", { className: "whitespace-pre-wrap break-words", children: output2 !== null && output2.trim().length > 0 ? output2 : normalizedName === "BgBash" ? "\u4EFB\u52A1\u5DF2\u8FDB\u5165\u540E\u53F0\u6267\u884C\uFF0C\u8F93\u51FA\u4F1A\u5728\u540E\u53F0\u4EFB\u52A1\u9762\u677F\u4E2D\u7EE7\u7EED\u66F4\u65B0\u3002" : output2 !== null && output2.trim().length === 0 && hasFailure ? "\u547D\u4EE4\u5DF2\u7ED3\u675F\uFF0C\u4F46\u672A\u6355\u83B7\u5230\u7EC8\u7AEF\u8F93\u51FA\uFF08\u8BF7\u67E5\u770B\u9000\u51FA\u7801\uFF09\u3002" : "\u547D\u4EE4\u672A\u8FD4\u56DE\u8F93\u51FA\u3002" }) })
37312
+ /* @__PURE__ */ jsx23("pre", { className: "max-h-[280px] overflow-auto px-3 py-3 font-mono text-[11px] leading-5 text-foreground", children: /* @__PURE__ */ jsx23("code", { className: "whitespace-pre-wrap break-words", children: output2 !== null && output2.trim().length > 0 ? output2 : normalizedName === "BgBash" ? "\u4EFB\u52A1\u5DF2\u8FDB\u5165\u540E\u53F0\u6267\u884C\uFF0C\u8F93\u51FA\u4F1A\u5728\u540E\u53F0\u4EFB\u52A1\u9762\u677F\u4E2D\u7EE7\u7EED\u66F4\u65B0\u3002" : output2 !== null && output2.trim().length === 0 && hasFailure ? "\u547D\u4EE4\u5DF2\u7ED3\u675F\uFF0C\u4F46\u672A\u6355\u83B7\u5230\u7EC8\u7AEF\u8F93\u51FA\uFF08\u8BF7\u67E5\u770B\u9000\u51FA\u7801\uFF09\u3002" : "\u547D\u4EE4\u672A\u8FD4\u56DE\u8F93\u51FA\u3002" }) })
37208
37313
  ]
37209
37314
  }
37210
37315
  ),
37211
- cwdResetNote ? /* @__PURE__ */ jsx22("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: cwdResetNote }) : null
37316
+ cwdResetNote ? /* @__PURE__ */ jsx23("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: cwdResetNote }) : null
37212
37317
  ] });
37213
37318
  }
37214
37319
 
@@ -37224,7 +37329,7 @@ function scrollWritePreviewToLatest(preview) {
37224
37329
  }
37225
37330
 
37226
37331
  // src/chat/tool-renderers/FileEditRenderer.tsx
37227
- import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
37332
+ import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
37228
37333
  var MAX_DIFF_LINES = 200;
37229
37334
  var FILE_PATH_FIELDS = ["file_path", "path"];
37230
37335
  function computeDiff(oldText, newText) {
@@ -37295,7 +37400,7 @@ function buildEditPreview(args, rawArguments) {
37295
37400
  const edits = Array.isArray(args?.edits) ? args.edits : null;
37296
37401
  if (edits) {
37297
37402
  return edits.flatMap((rawEdit, index2) => {
37298
- if (!isPlainObject(rawEdit)) {
37403
+ if (!isPlainObject3(rawEdit)) {
37299
37404
  return [];
37300
37405
  }
37301
37406
  const oldText = getStringValue(rawEdit, "old_text") ?? "";
@@ -37409,7 +37514,7 @@ function FileEditRenderer({ toolCall }) {
37409
37514
  const previewRef = useRef13(null);
37410
37515
  const rawArguments = toolCall.arguments ?? "";
37411
37516
  const argsValue = parseJsonValue(toolCall.arguments);
37412
- const args = isPlainObject(argsValue) ? argsValue : null;
37517
+ const args = isPlainObject3(argsValue) ? argsValue : null;
37413
37518
  const normalizedName = formatToolName(toolCall.name);
37414
37519
  const partialFilePath = extractJsonStringFieldPartial(rawArguments, FILE_PATH_FIELDS);
37415
37520
  const filePath = extractToolFilePath(toolCall) ?? partialFilePath;
@@ -37432,16 +37537,16 @@ function FileEditRenderer({ toolCall }) {
37432
37537
  return /* @__PURE__ */ jsxs18("div", { className: "space-y-3", children: [
37433
37538
  /* @__PURE__ */ jsxs18("div", { className: "flex items-start justify-between gap-3", children: [
37434
37539
  /* @__PURE__ */ jsxs18("div", { className: "min-w-0", children: [
37435
- /* @__PURE__ */ jsx23("div", { className: "text-[10px] uppercase tracking-[0.16em] text-[hsl(var(--muted-foreground))]", children: normalizedName === "Write" ? "\u5199\u5165\u6587\u4EF6" : "\u7F16\u8F91\u6587\u4EF6" }),
37436
- /* @__PURE__ */ jsx23("div", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: fileName })
37540
+ /* @__PURE__ */ jsx24("div", { className: "text-[10px] uppercase tracking-[0.16em] text-[hsl(var(--muted-foreground))]", children: normalizedName === "Write" ? "\u5199\u5165\u6587\u4EF6" : "\u7F16\u8F91\u6587\u4EF6" }),
37541
+ /* @__PURE__ */ jsx24("div", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: fileName })
37437
37542
  ] }),
37438
- checksum ? /* @__PURE__ */ jsx23("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: checksum }) : null
37543
+ checksum ? /* @__PURE__ */ jsx24("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: checksum }) : null
37439
37544
  ] }),
37440
- description ? /* @__PURE__ */ jsx23("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: description }) : null,
37441
- displayErrorMessage ? /* @__PURE__ */ jsx23("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: displayErrorMessage }) : null,
37545
+ description ? /* @__PURE__ */ jsx24("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: description }) : null,
37546
+ displayErrorMessage ? /* @__PURE__ */ jsx24("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: displayErrorMessage }) : null,
37442
37547
  /* @__PURE__ */ jsxs18("div", { className: "file-edit-preview overflow-hidden rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20", children: [
37443
- /* @__PURE__ */ jsx23("div", { className: "border-b border-[hsl(var(--border))] px-3 py-2 text-[10px] uppercase tracking-[0.16em] text-[hsl(var(--muted-foreground))]", children: normalizedName === "Write" ? "\u5185\u5BB9\u9884\u89C8" : "\u53D8\u66F4\u9884\u89C8" }),
37444
- /* @__PURE__ */ jsx23(
37548
+ /* @__PURE__ */ jsx24("div", { className: "border-b border-[hsl(var(--border))] px-3 py-2 text-[10px] uppercase tracking-[0.16em] text-[hsl(var(--muted-foreground))]", children: normalizedName === "Write" ? "\u5185\u5BB9\u9884\u89C8" : "\u53D8\u66F4\u9884\u89C8" }),
37549
+ /* @__PURE__ */ jsx24(
37445
37550
  "pre",
37446
37551
  {
37447
37552
  ref: previewRef,
@@ -37458,7 +37563,7 @@ function FileEditRenderer({ toolCall }) {
37458
37563
  line.type === "unchanged" && "text-[hsl(var(--foreground))]"
37459
37564
  ),
37460
37565
  children: [
37461
- /* @__PURE__ */ jsx23("span", { className: "select-none py-0.5 text-right text-[10px] text-[hsl(var(--muted-foreground))]", children: line.line ?? "" }),
37566
+ /* @__PURE__ */ jsx24("span", { className: "select-none py-0.5 text-right text-[10px] text-[hsl(var(--muted-foreground))]", children: line.line ?? "" }),
37462
37567
  /* @__PURE__ */ jsxs18("span", { className: "min-w-0 whitespace-pre-wrap break-words py-0.5", children: [
37463
37568
  prefix,
37464
37569
  line.value
@@ -37467,11 +37572,11 @@ function FileEditRenderer({ toolCall }) {
37467
37572
  },
37468
37573
  `${line.type}-${line.line}-${index2}`
37469
37574
  );
37470
- }) : /* @__PURE__ */ jsx23("div", { className: "px-3 py-4 text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u672A\u68C0\u6D4B\u5230\u53EF\u9884\u89C8\u7684\u53D8\u66F4\u3002" })
37575
+ }) : /* @__PURE__ */ jsx24("div", { className: "px-3 py-4 text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u672A\u68C0\u6D4B\u5230\u53EF\u9884\u89C8\u7684\u53D8\u66F4\u3002" })
37471
37576
  }
37472
37577
  )
37473
37578
  ] }),
37474
- displaySummaryText ? /* @__PURE__ */ jsx23("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: displaySummaryText }) : null
37579
+ displaySummaryText ? /* @__PURE__ */ jsx24("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: displaySummaryText }) : null
37475
37580
  ] });
37476
37581
  }
37477
37582
 
@@ -37481,7 +37586,7 @@ import { useState as useState16 } from "react";
37481
37586
  // src/chat/ImageLightbox.tsx
37482
37587
  import { useCallback as useCallback4, useEffect as useEffect11, useRef as useRef14, useState as useState15 } from "react";
37483
37588
  import { createPortal } from "react-dom";
37484
- import { Fragment as Fragment10, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
37589
+ import { Fragment as Fragment10, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
37485
37590
  function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 }) {
37486
37591
  const [currentIndex, setCurrentIndex] = useState15(initialIndex);
37487
37592
  const [scale, setScale] = useState15(1);
@@ -37601,16 +37706,16 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37601
37706
  className: "fixed inset-0 z-50 flex animate-in items-center justify-center bg-black/80 fade-in-0 duration-(--motion-duration-fast)",
37602
37707
  onClick: close,
37603
37708
  children: [
37604
- /* @__PURE__ */ jsx24(
37709
+ /* @__PURE__ */ jsx25(
37605
37710
  "button",
37606
37711
  {
37607
37712
  type: "button",
37608
37713
  onClick: close,
37609
37714
  className: "absolute right-4 top-4 z-10 rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
37610
- children: /* @__PURE__ */ jsx24(X, { size: 20 })
37715
+ children: /* @__PURE__ */ jsx25(X, { size: 20 })
37611
37716
  }
37612
37717
  ),
37613
- /* @__PURE__ */ jsx24("span", { className: "text-sm text-white/60", children: "\u52A0\u8F7D\u4E2D..." })
37718
+ /* @__PURE__ */ jsx25("span", { className: "text-sm text-white/60", children: "\u52A0\u8F7D\u4E2D..." })
37614
37719
  ]
37615
37720
  }
37616
37721
  ),
@@ -37633,7 +37738,7 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37633
37738
  className: "absolute right-4 top-4 z-10 flex items-center gap-1.5",
37634
37739
  onClick: (e) => e.stopPropagation(),
37635
37740
  children: [
37636
- /* @__PURE__ */ jsx24(
37741
+ /* @__PURE__ */ jsx25(
37637
37742
  "button",
37638
37743
  {
37639
37744
  type: "button",
@@ -37641,10 +37746,10 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37641
37746
  disabled: loadedSource !== current.src,
37642
37747
  title: loadedSource === current.src ? "\u4E0B\u8F7D\u56FE\u7247" : "\u539F\u56FE\u52A0\u8F7D\u4E2D",
37643
37748
  className: "rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
37644
- children: /* @__PURE__ */ jsx24(Download, { size: 18 })
37749
+ children: /* @__PURE__ */ jsx25(Download, { size: 18 })
37645
37750
  }
37646
37751
  ),
37647
- /* @__PURE__ */ jsx24(
37752
+ /* @__PURE__ */ jsx25(
37648
37753
  "button",
37649
37754
  {
37650
37755
  type: "button",
@@ -37652,22 +37757,22 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37652
37757
  disabled: loadedSource !== current.src,
37653
37758
  title: loadedSource === current.src ? "\u65B0\u6807\u7B7E\u9875\u6253\u5F00" : "\u539F\u56FE\u52A0\u8F7D\u4E2D",
37654
37759
  className: "rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
37655
- children: /* @__PURE__ */ jsx24(ExternalLink, { size: 18 })
37760
+ children: /* @__PURE__ */ jsx25(ExternalLink, { size: 18 })
37656
37761
  }
37657
37762
  ),
37658
- /* @__PURE__ */ jsx24(
37763
+ /* @__PURE__ */ jsx25(
37659
37764
  "button",
37660
37765
  {
37661
37766
  type: "button",
37662
37767
  onClick: close,
37663
37768
  className: "rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
37664
- children: /* @__PURE__ */ jsx24(X, { size: 20 })
37769
+ children: /* @__PURE__ */ jsx25(X, { size: 20 })
37665
37770
  }
37666
37771
  )
37667
37772
  ]
37668
37773
  }
37669
37774
  ),
37670
- showNav && currentIndex > 0 && /* @__PURE__ */ jsx24(
37775
+ showNav && currentIndex > 0 && /* @__PURE__ */ jsx25(
37671
37776
  "button",
37672
37777
  {
37673
37778
  type: "button",
@@ -37676,10 +37781,10 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37676
37781
  goPrev();
37677
37782
  },
37678
37783
  className: "absolute left-4 top-1/2 z-10 -translate-y-1/2 rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
37679
- children: /* @__PURE__ */ jsx24(ChevronLeft, { size: 24 })
37784
+ children: /* @__PURE__ */ jsx25(ChevronLeft, { size: 24 })
37680
37785
  }
37681
37786
  ),
37682
- showNav && currentIndex < images.length - 1 && /* @__PURE__ */ jsx24(
37787
+ showNav && currentIndex < images.length - 1 && /* @__PURE__ */ jsx25(
37683
37788
  "button",
37684
37789
  {
37685
37790
  type: "button",
@@ -37688,43 +37793,43 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37688
37793
  goNext();
37689
37794
  },
37690
37795
  className: "absolute right-4 top-1/2 z-10 -translate-y-1/2 rounded-full bg-black/50 p-2 text-white/80 transition-colors hover:bg-black/70 hover:text-white",
37691
- children: /* @__PURE__ */ jsx24(ChevronRight, { size: 24 })
37796
+ children: /* @__PURE__ */ jsx25(ChevronRight, { size: 24 })
37692
37797
  }
37693
37798
  ),
37694
37799
  /* @__PURE__ */ jsxs19("div", { className: "absolute bottom-6 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1 rounded-full bg-black/50 px-2 py-1", children: [
37695
- /* @__PURE__ */ jsx24(
37800
+ /* @__PURE__ */ jsx25(
37696
37801
  "button",
37697
37802
  {
37698
37803
  type: "button",
37699
37804
  onClick: zoomOut,
37700
37805
  className: "rounded-full p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white",
37701
- children: /* @__PURE__ */ jsx24(Minus, { size: 16 })
37806
+ children: /* @__PURE__ */ jsx25(Minus, { size: 16 })
37702
37807
  }
37703
37808
  ),
37704
37809
  /* @__PURE__ */ jsxs19("span", { className: "min-w-[3rem] text-center text-xs text-white/80", children: [
37705
37810
  Math.round(scale * 100),
37706
37811
  "%"
37707
37812
  ] }),
37708
- /* @__PURE__ */ jsx24(
37813
+ /* @__PURE__ */ jsx25(
37709
37814
  "button",
37710
37815
  {
37711
37816
  type: "button",
37712
37817
  onClick: zoomIn,
37713
37818
  className: "rounded-full p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white",
37714
- children: /* @__PURE__ */ jsx24(Plus, { size: 16 })
37819
+ children: /* @__PURE__ */ jsx25(Plus, { size: 16 })
37715
37820
  }
37716
37821
  ),
37717
- /* @__PURE__ */ jsx24(
37822
+ /* @__PURE__ */ jsx25(
37718
37823
  "button",
37719
37824
  {
37720
37825
  type: "button",
37721
37826
  onClick: reset,
37722
37827
  className: "rounded-full p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white",
37723
- children: /* @__PURE__ */ jsx24(RotateCcw, { size: 16 })
37828
+ children: /* @__PURE__ */ jsx25(RotateCcw, { size: 16 })
37724
37829
  }
37725
37830
  ),
37726
37831
  showNav && /* @__PURE__ */ jsxs19(Fragment10, { children: [
37727
- /* @__PURE__ */ jsx24("div", { className: "mx-1 h-4 w-px bg-white/20" }),
37832
+ /* @__PURE__ */ jsx25("div", { className: "mx-1 h-4 w-px bg-white/20" }),
37728
37833
  /* @__PURE__ */ jsxs19("span", { className: "min-w-[3rem] text-center text-xs text-white/80", children: [
37729
37834
  currentIndex + 1,
37730
37835
  " / ",
@@ -37732,7 +37837,7 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37732
37837
  ] })
37733
37838
  ] })
37734
37839
  ] }),
37735
- /* @__PURE__ */ jsx24(
37840
+ /* @__PURE__ */ jsx25(
37736
37841
  "div",
37737
37842
  {
37738
37843
  className: "flex h-full w-full items-center justify-center overflow-hidden p-12",
@@ -37743,7 +37848,7 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37743
37848
  onMouseUp: handleMouseUp,
37744
37849
  onMouseLeave: handleMouseUp,
37745
37850
  onDoubleClick: handleDoubleClick,
37746
- children: /* @__PURE__ */ jsx24(
37851
+ children: /* @__PURE__ */ jsx25(
37747
37852
  MessageImage,
37748
37853
  {
37749
37854
  original: true,
@@ -37769,7 +37874,7 @@ function ImageLightbox({ open: open2, onOpenChange, images, initialIndex = 0 })
37769
37874
  }
37770
37875
 
37771
37876
  // src/chat/tool-renderers/FileReadRenderer.tsx
37772
- import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
37877
+ import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
37773
37878
  var NUMBERED_LINE_RE = /^(\s*\d+)\t([\s\S]*)$/;
37774
37879
  function parseReadResult(result) {
37775
37880
  if (!result) {
@@ -37815,7 +37920,7 @@ function formatLineRange(startLine, endLine) {
37815
37920
  function FileReadRenderer({ toolCall }) {
37816
37921
  const [lightboxIndex, setLightboxIndex] = useState16(null);
37817
37922
  const argsValue = parseJsonValue(toolCall.arguments);
37818
- const args = isPlainObject(argsValue) ? argsValue : null;
37923
+ const args = isPlainObject3(argsValue) ? argsValue : null;
37819
37924
  const filePath = extractToolFilePath(toolCall);
37820
37925
  const fileName = getFileName(filePath);
37821
37926
  const displayName = filePath ? formatToolFileName(filePath) : fileName;
@@ -37834,25 +37939,25 @@ function FileReadRenderer({ toolCall }) {
37834
37939
  return /* @__PURE__ */ jsxs20("div", { className: "space-y-3", children: [
37835
37940
  /* @__PURE__ */ jsxs20("div", { className: "flex items-start justify-between gap-3", children: [
37836
37941
  /* @__PURE__ */ jsxs20("div", { className: "min-w-0", children: [
37837
- /* @__PURE__ */ jsx25("div", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: displayName }),
37838
- filePath ? /* @__PURE__ */ jsx25("div", { className: "truncate text-[10px] text-[hsl(var(--muted-foreground))]", children: filePath }) : null
37942
+ /* @__PURE__ */ jsx26("div", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: displayName }),
37943
+ filePath ? /* @__PURE__ */ jsx26("div", { className: "truncate text-[10px] text-[hsl(var(--muted-foreground))]", children: filePath }) : null
37839
37944
  ] }),
37840
37945
  /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center justify-end gap-1.5", children: [
37841
- lineRange ? /* @__PURE__ */ jsx25("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: lineRange }) : null,
37842
- checksum ? /* @__PURE__ */ jsx25("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: checksum }) : null
37946
+ lineRange ? /* @__PURE__ */ jsx26("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: lineRange }) : null,
37947
+ checksum ? /* @__PURE__ */ jsx26("span", { className: "rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2 py-0.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: checksum }) : null
37843
37948
  ] })
37844
37949
  ] }),
37845
- description ? /* @__PURE__ */ jsx25("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: description }) : null,
37846
- errorMessage ? /* @__PURE__ */ jsx25("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: errorMessage }) : null,
37950
+ description ? /* @__PURE__ */ jsx26("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: description }) : null,
37951
+ errorMessage ? /* @__PURE__ */ jsx26("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: errorMessage }) : null,
37847
37952
  isImageResult ? /* @__PURE__ */ jsxs20("div", { className: "grid gap-2", children: [
37848
- imageUrls.map((url2, idx) => /* @__PURE__ */ jsx25(
37953
+ imageUrls.map((url2, idx) => /* @__PURE__ */ jsx26(
37849
37954
  "button",
37850
37955
  {
37851
37956
  type: "button",
37852
37957
  onClick: () => setLightboxIndex(idx),
37853
37958
  className: "cursor-zoom-in",
37854
37959
  title: "\u67E5\u770B\u5927\u56FE",
37855
- children: /* @__PURE__ */ jsx25(
37960
+ children: /* @__PURE__ */ jsx26(
37856
37961
  MessageImage,
37857
37962
  {
37858
37963
  src: url2,
@@ -37865,7 +37970,7 @@ function FileReadRenderer({ toolCall }) {
37865
37970
  },
37866
37971
  url2.slice(0, 64)
37867
37972
  )),
37868
- /* @__PURE__ */ jsx25(
37973
+ /* @__PURE__ */ jsx26(
37869
37974
  ImageLightbox,
37870
37975
  {
37871
37976
  open: lightboxIndex != null,
@@ -37876,86 +37981,16 @@ function FileReadRenderer({ toolCall }) {
37876
37981
  initialIndex: lightboxIndex ?? 0
37877
37982
  }
37878
37983
  ),
37879
- content3 ? /* @__PURE__ */ jsx25("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: content3 }) : null
37880
- ] }) : !errorMessage ? /* @__PURE__ */ jsx25(CodePreview, { content: content3, filePath, className: "max-h-[360px]" }) : null,
37881
- note ? /* @__PURE__ */ jsx25("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: note }) : null
37882
- ] });
37883
- }
37884
-
37885
- // src/chat/tool-renderers/KbSearchRenderer.tsx
37886
- import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
37887
- function KbSearchRenderer({ toolCall }) {
37888
- const resultStr = getResultText(toolCall.result);
37889
- const errorMessage = extractErrorMessage(resultStr);
37890
- if (errorMessage) {
37891
- return /* @__PURE__ */ jsx26("div", { className: "rounded-lg border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-[11px] text-[hsl(var(--swf-danger))]", children: errorMessage });
37892
- }
37893
- const argsValue = parseJsonValue(toolCall.arguments);
37894
- const args = isPlainObject(argsValue) ? argsValue : null;
37895
- const parsed = parseKbSearchResult(toolCall.result);
37896
- const query = parsed?.query ?? getStringValue(args, "query");
37897
- return /* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
37898
- query ? /* @__PURE__ */ jsxs21("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
37899
- "\u68C0\u7D22\uFF1A",
37900
- query
37901
- ] }) : null,
37902
- parsed && parsed.hits.length > 0 ? /* @__PURE__ */ jsx26("div", { className: "grid gap-2", children: parsed.hits.map((hit) => /* @__PURE__ */ jsx26(
37903
- "div",
37904
- {
37905
- className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-2",
37906
- children: /* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-2", children: [
37907
- /* @__PURE__ */ jsxs21("span", { className: "mt-0.5 shrink-0 rounded bg-[hsl(var(--muted))] px-1.5 font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: [
37908
- "[",
37909
- hit.n,
37910
- "]"
37911
- ] }),
37912
- /* @__PURE__ */ jsxs21("div", { className: "min-w-0 flex-1", children: [
37913
- /* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-2", children: [
37914
- /* @__PURE__ */ jsx26(BookOpen, { size: 13, className: "mt-0.5 shrink-0 text-[hsl(var(--muted-foreground))]" }),
37915
- hit.previewUrl ? /* @__PURE__ */ jsxs21(
37916
- "a",
37917
- {
37918
- href: hit.previewUrl,
37919
- target: "_blank",
37920
- rel: "noreferrer",
37921
- className: cn(
37922
- "inline-flex min-w-0 items-center gap-1 text-[11px] font-medium",
37923
- "text-[hsl(var(--swf-link-text))] hover:underline"
37924
- ),
37925
- title: "\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00\u539F\u6587",
37926
- children: [
37927
- /* @__PURE__ */ jsx26("span", { className: "truncate", children: hit.title }),
37928
- /* @__PURE__ */ jsx26(ExternalLink, { size: 11, className: "shrink-0" })
37929
- ]
37930
- }
37931
- ) : /* @__PURE__ */ jsx26("span", { className: "truncate text-[11px] font-medium text-[hsl(var(--foreground))]", children: hit.title })
37932
- ] }),
37933
- /* @__PURE__ */ jsxs21("div", { className: "mt-0.5 flex flex-wrap gap-x-2 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
37934
- hit.kbName ? /* @__PURE__ */ jsxs21("span", { children: [
37935
- "\u300A",
37936
- hit.kbName,
37937
- "\u300B"
37938
- ] }) : null,
37939
- hit.page !== null ? /* @__PURE__ */ jsxs21("span", { children: [
37940
- "\u7B2C ",
37941
- hit.page,
37942
- " \u9875"
37943
- ] }) : null,
37944
- hit.heading ? /* @__PURE__ */ jsx26("span", { className: "truncate", children: hit.heading }) : null
37945
- ] }),
37946
- hit.text ? /* @__PURE__ */ jsx26("p", { className: "mt-1.5 line-clamp-4 whitespace-pre-wrap text-[11px] leading-5 text-[hsl(var(--muted-foreground))]", children: hit.text }) : null
37947
- ] })
37948
- ] })
37949
- },
37950
- `${hit.n}-${hit.path}-${hit.page ?? ""}`
37951
- )) }) : /* @__PURE__ */ jsx26("div", { className: "rounded-lg border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-4 text-[11px] text-[hsl(var(--muted-foreground))]", children: parsed?.summary ?? "\u77E5\u8BC6\u5E93\u91CC\u6CA1\u6709\u627E\u5230\u76F8\u5173\u5185\u5BB9\u3002" })
37984
+ content3 ? /* @__PURE__ */ jsx26("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: content3 }) : null
37985
+ ] }) : !errorMessage ? /* @__PURE__ */ jsx26(CodePreview, { content: content3, filePath, className: "max-h-[360px]" }) : null,
37986
+ note ? /* @__PURE__ */ jsx26("div", { className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/35 px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: note }) : null
37952
37987
  ] });
37953
37988
  }
37954
37989
 
37955
37990
  // src/chat/tool-renderers/SearchRenderer.tsx
37956
- import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
37991
+ import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
37957
37992
  function toRecordArray(value) {
37958
- return Array.isArray(value) ? value.filter(isPlainObject) : [];
37993
+ return Array.isArray(value) ? value.filter(isPlainObject3) : [];
37959
37994
  }
37960
37995
  function parseDirectoryItems(result) {
37961
37996
  const value = parseJsonValue(result);
@@ -37970,7 +38005,7 @@ function parseDirectoryItems(result) {
37970
38005
  size: null
37971
38006
  };
37972
38007
  }
37973
- if (!isPlainObject(item)) {
38008
+ if (!isPlainObject3(item)) {
37974
38009
  return null;
37975
38010
  }
37976
38011
  return {
@@ -37995,7 +38030,7 @@ function parseGrepResult(result) {
37995
38030
  }
37996
38031
  function parseWebResults(result) {
37997
38032
  const value = parseJsonValue(result);
37998
- const items = isPlainObject(value) ? toRecordArray(value.results) : toRecordArray(value);
38033
+ const items = isPlainObject3(value) ? toRecordArray(value.results) : toRecordArray(value);
37999
38034
  return items.map((item) => ({
38000
38035
  // text 是当前字段;description 只为读旧会话保留,那时的结果没有正文片段。
38001
38036
  description: typeof item.text === "string" ? item.text : typeof item.description === "string" ? item.description : null,
@@ -38010,7 +38045,7 @@ function renderEmptyState(label) {
38010
38045
  function SearchRenderer({ toolCall }) {
38011
38046
  const normalizedName = formatToolName(toolCall.name);
38012
38047
  const argsValue = parseJsonValue(toolCall.arguments);
38013
- const args = isPlainObject(argsValue) ? argsValue : null;
38048
+ const args = isPlainObject3(argsValue) ? argsValue : null;
38014
38049
  const resultStr = getResultText(toolCall.result);
38015
38050
  const errorMessage = extractErrorMessage(resultStr);
38016
38051
  if (errorMessage) {
@@ -38019,17 +38054,17 @@ function SearchRenderer({ toolCall }) {
38019
38054
  if (normalizedName === "Ls" || normalizedName === "Glob") {
38020
38055
  const items = parseDirectoryItems(resultStr);
38021
38056
  const path2 = getStringValue(args, "path");
38022
- return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
38023
- path2 ? /* @__PURE__ */ jsxs22("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
38057
+ return /* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
38058
+ path2 ? /* @__PURE__ */ jsxs21("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
38024
38059
  "\u76EE\u5F55\uFF1A",
38025
38060
  path2
38026
38061
  ] }) : null,
38027
- items.length > 0 ? /* @__PURE__ */ jsx27("div", { className: "grid gap-2", children: items.map((item) => /* @__PURE__ */ jsxs22(
38062
+ items.length > 0 ? /* @__PURE__ */ jsx27("div", { className: "grid gap-2", children: items.map((item) => /* @__PURE__ */ jsxs21(
38028
38063
  "div",
38029
38064
  {
38030
38065
  className: "flex items-center justify-between gap-3 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-2",
38031
38066
  children: [
38032
- /* @__PURE__ */ jsxs22("div", { className: "flex min-w-0 items-center gap-2", children: [
38067
+ /* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 items-center gap-2", children: [
38033
38068
  item.isDir ? /* @__PURE__ */ jsx27(Folder, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }) : /* @__PURE__ */ jsx27(FileText, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
38034
38069
  /* @__PURE__ */ jsx27("span", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: item.name })
38035
38070
  ] }),
@@ -38043,22 +38078,22 @@ function SearchRenderer({ toolCall }) {
38043
38078
  if (normalizedName === "Grep") {
38044
38079
  const { matches, searchPath } = parseGrepResult(resultStr);
38045
38080
  const pattern = getStringValue(args, "pattern");
38046
- return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
38047
- /* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center gap-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
38081
+ return /* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
38082
+ /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
38048
38083
  pattern ? /* @__PURE__ */ jsx27("span", { className: "rounded-full bg-[hsl(var(--muted))] px-2 py-0.5 font-mono", children: pattern }) : null,
38049
- searchPath ? /* @__PURE__ */ jsxs22("span", { children: [
38084
+ searchPath ? /* @__PURE__ */ jsxs21("span", { children: [
38050
38085
  "\u8303\u56F4\uFF1A",
38051
38086
  searchPath
38052
38087
  ] }) : null
38053
38088
  ] }),
38054
- matches.length > 0 ? /* @__PURE__ */ jsx27("div", { className: "grid gap-2", children: matches.map((match) => /* @__PURE__ */ jsxs22(
38089
+ matches.length > 0 ? /* @__PURE__ */ jsx27("div", { className: "grid gap-2", children: matches.map((match) => /* @__PURE__ */ jsxs21(
38055
38090
  "div",
38056
38091
  {
38057
38092
  className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-2",
38058
38093
  children: [
38059
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between gap-3", children: [
38094
+ /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between gap-3", children: [
38060
38095
  /* @__PURE__ */ jsx27("span", { className: "truncate font-mono text-[11px] text-[hsl(var(--foreground))]", children: match.path }),
38061
- match.lineNumber !== null ? /* @__PURE__ */ jsxs22("span", { className: "shrink-0 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
38096
+ match.lineNumber !== null ? /* @__PURE__ */ jsxs21("span", { className: "shrink-0 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
38062
38097
  "\u7B2C ",
38063
38098
  match.lineNumber,
38064
38099
  " \u884C"
@@ -38074,8 +38109,8 @@ function SearchRenderer({ toolCall }) {
38074
38109
  if (normalizedName === "WebFetch") {
38075
38110
  const url2 = getStringValue(args, "url");
38076
38111
  const text4 = resultStr?.trim();
38077
- return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
38078
- url2 ? /* @__PURE__ */ jsxs22(
38112
+ return /* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
38113
+ url2 ? /* @__PURE__ */ jsxs21(
38079
38114
  "a",
38080
38115
  {
38081
38116
  href: url2,
@@ -38094,8 +38129,8 @@ function SearchRenderer({ toolCall }) {
38094
38129
  }
38095
38130
  const results = parseWebResults(resultStr);
38096
38131
  const query = getStringValue(args, "query");
38097
- return /* @__PURE__ */ jsxs22("div", { className: "space-y-3", children: [
38098
- query ? /* @__PURE__ */ jsxs22("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
38132
+ return /* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
38133
+ query ? /* @__PURE__ */ jsxs21("div", { className: "text-[11px] text-[hsl(var(--muted-foreground))]", children: [
38099
38134
  "\u67E5\u8BE2\uFF1A",
38100
38135
  query
38101
38136
  ] }) : null,
@@ -38109,10 +38144,10 @@ function SearchRenderer({ toolCall }) {
38109
38144
  "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted))]/20 px-3 py-3 transition-colors",
38110
38145
  item.url && "hover:border-[hsl(var(--ring))] hover:bg-[hsl(var(--muted))]/35"
38111
38146
  ),
38112
- children: /* @__PURE__ */ jsxs22("div", { className: "flex items-start gap-3", children: [
38147
+ children: /* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-3", children: [
38113
38148
  /* @__PURE__ */ jsx27(Earth, { size: 16, className: "mt-0.5 shrink-0 text-[hsl(var(--muted-foreground))]" }),
38114
- /* @__PURE__ */ jsxs22("div", { className: "min-w-0 flex-1", children: [
38115
- /* @__PURE__ */ jsxs22("div", { className: "flex items-start justify-between gap-3", children: [
38149
+ /* @__PURE__ */ jsxs21("div", { className: "min-w-0 flex-1", children: [
38150
+ /* @__PURE__ */ jsxs21("div", { className: "flex items-start justify-between gap-3", children: [
38116
38151
  /* @__PURE__ */ jsx27("span", { className: "line-clamp-2 text-[11px] font-medium text-[hsl(var(--foreground))]", children: item.title ?? item.url ?? "\u672A\u547D\u540D\u7ED3\u679C" }),
38117
38152
  item.url ? /* @__PURE__ */ jsx27(
38118
38153
  ExternalLink,
@@ -38123,7 +38158,7 @@ function SearchRenderer({ toolCall }) {
38123
38158
  ) : null
38124
38159
  ] }),
38125
38160
  item.url ? /* @__PURE__ */ jsx27("div", { className: "mt-1 truncate font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: item.url }) : null,
38126
- item.publishedDate ? /* @__PURE__ */ jsxs22("div", { className: "mt-1 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
38161
+ item.publishedDate ? /* @__PURE__ */ jsxs21("div", { className: "mt-1 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
38127
38162
  "\u53D1\u5E03\u4E8E ",
38128
38163
  item.publishedDate.slice(0, 10)
38129
38164
  ] }) : null,
@@ -38137,9 +38172,9 @@ function SearchRenderer({ toolCall }) {
38137
38172
  }
38138
38173
 
38139
38174
  // src/chat/tool-renderers/SubmitResultRenderer.tsx
38140
- import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
38175
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
38141
38176
  function extractText2(value, key) {
38142
- if (!isPlainObject(value)) return null;
38177
+ if (!isPlainObject3(value)) return null;
38143
38178
  const field = value[key];
38144
38179
  return typeof field === "string" && field.trim() ? field.trim() : null;
38145
38180
  }
@@ -38147,7 +38182,7 @@ function parsePayload(toolCall) {
38147
38182
  const resultText2 = getResultText(toolCall.result);
38148
38183
  const parsedResult = parseJsonValue(resultText2);
38149
38184
  const parsedArgs = parseJsonValue(toolCall.arguments);
38150
- const source = isPlainObject(parsedResult) ? parsedResult : parsedArgs;
38185
+ const source = isPlainObject3(parsedResult) ? parsedResult : parsedArgs;
38151
38186
  const description = extractText2(source, "description");
38152
38187
  const result = extractText2(source, "result") ?? (typeof resultText2 === "string" ? resultText2.trim() : null);
38153
38188
  const error61 = extractText2(source, "err_msg") ?? extractText2(source, "error");
@@ -38158,21 +38193,21 @@ function SubmitResultRenderer({ toolCall }) {
38158
38193
  const { description, result, error: error61, status } = parsePayload(toolCall);
38159
38194
  const isError = toolCall.status === "error" || Boolean(error61);
38160
38195
  const Icon = isError ? CircleAlert : CircleCheck;
38161
- return /* @__PURE__ */ jsxs23("div", { className: "overflow-hidden rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
38162
- /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-3 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]/25 px-4 py-3", children: [
38196
+ return /* @__PURE__ */ jsxs22("div", { className: "overflow-hidden rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
38197
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-3 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]/25 px-4 py-3", children: [
38163
38198
  /* @__PURE__ */ jsx28("div", { className: isError ? "text-[hsl(var(--swf-danger))]" : "text-[hsl(var(--swf-success))]", children: /* @__PURE__ */ jsx28(Icon, { size: 18 }) }),
38164
- /* @__PURE__ */ jsxs23("div", { className: "min-w-0 flex-1", children: [
38199
+ /* @__PURE__ */ jsxs22("div", { className: "min-w-0 flex-1", children: [
38165
38200
  /* @__PURE__ */ jsx28("div", { className: "font-medium text-[hsl(var(--foreground))]", children: description || (isError ? "\u4EFB\u52A1\u6267\u884C\u5931\u8D25" : "\u4EFB\u52A1\u7ED3\u679C\u5DF2\u63D0\u4EA4") }),
38166
38201
  description ? /* @__PURE__ */ jsx28("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,
38167
- status ? /* @__PURE__ */ jsxs23("div", { className: "mt-0.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
38202
+ status ? /* @__PURE__ */ jsxs22("div", { className: "mt-0.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
38168
38203
  "\u72B6\u6001\uFF1A",
38169
38204
  status
38170
38205
  ] }) : null
38171
38206
  ] })
38172
38207
  ] }),
38173
- /* @__PURE__ */ jsxs23("div", { className: "space-y-3 px-4 py-4 text-sm leading-6 text-[hsl(var(--foreground))]", children: [
38208
+ /* @__PURE__ */ jsxs22("div", { className: "space-y-3 px-4 py-4 text-sm leading-6 text-[hsl(var(--foreground))]", children: [
38174
38209
  result ? /* @__PURE__ */ jsx28("p", { className: "whitespace-pre-wrap", children: result }) : null,
38175
- error61 ? /* @__PURE__ */ jsxs23("div", { className: "rounded-xl border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-sm text-[hsl(var(--swf-danger))]", children: [
38210
+ error61 ? /* @__PURE__ */ jsxs22("div", { className: "rounded-xl border border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] px-3 py-2 text-sm text-[hsl(var(--swf-danger))]", children: [
38176
38211
  /* @__PURE__ */ jsx28("div", { className: "mb-1 font-medium", children: "\u9519\u8BEF\u4FE1\u606F" }),
38177
38212
  /* @__PURE__ */ jsx28("div", { className: "whitespace-pre-wrap", children: error61 })
38178
38213
  ] }) : null,
@@ -38188,7 +38223,6 @@ var RENDERERS = /* @__PURE__ */ new Map([
38188
38223
  ["Edit", FileEditRenderer],
38189
38224
  ["MultiEdit", FileEditRenderer],
38190
38225
  ["Grep", SearchRenderer],
38191
- ["KbSearch", KbSearchRenderer],
38192
38226
  ["Glob", SearchRenderer],
38193
38227
  ["Ls", SearchRenderer],
38194
38228
  ["Read", FileReadRenderer],
@@ -38202,7 +38236,7 @@ function getRenderer(toolName) {
38202
38236
  }
38203
38237
 
38204
38238
  // src/chat/ToolCallBlock.tsx
38205
- import { Fragment as Fragment11, jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
38239
+ import { Fragment as Fragment11, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
38206
38240
  function getFilePreviewName(filePath) {
38207
38241
  return filePath.split(/[\\/]/).pop() ?? filePath;
38208
38242
  }
@@ -38265,7 +38299,7 @@ function ToolPreviewAction({
38265
38299
  return null;
38266
38300
  }
38267
38301
  const label = uiMeta.title ?? displayName;
38268
- return /* @__PURE__ */ jsxs24(
38302
+ return /* @__PURE__ */ jsxs23(
38269
38303
  "button",
38270
38304
  {
38271
38305
  type: "button",
@@ -38373,20 +38407,20 @@ function ToolCallBlock({
38373
38407
  if (!reasoning) {
38374
38408
  return questionBlock;
38375
38409
  }
38376
- return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1", children: [
38410
+ return /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-1", children: [
38377
38411
  questionBlock,
38378
38412
  /* @__PURE__ */ jsx29("div", { className: "ml-4", children: /* @__PURE__ */ jsx29(ThinkingBadge, { reasoning, variant: "block" }) })
38379
38413
  ] });
38380
38414
  }
38381
38415
  if (toolCall.status === "pending") {
38382
- return /* @__PURE__ */ jsxs24("div", { part: "ask-card", className: "blade-chat-ask-card ml-4 flex max-w-lg items-center gap-2 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-4 text-sm text-[hsl(var(--muted-foreground))]", children: [
38416
+ return /* @__PURE__ */ jsxs23("div", { part: "ask-card", className: "blade-chat-ask-card ml-4 flex max-w-lg items-center gap-2 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-4 text-sm text-[hsl(var(--muted-foreground))]", children: [
38383
38417
  /* @__PURE__ */ jsx29(LoaderCircle, { size: 14, className: "animate-spin" }),
38384
38418
  /* @__PURE__ */ jsx29("span", { children: "\u6B63\u5728\u51C6\u5907\u95EE\u9898\u2026" })
38385
38419
  ] });
38386
38420
  }
38387
- return /* @__PURE__ */ jsxs24("div", { part: "ask-card", className: "blade-chat-ask-card ml-4 max-w-lg rounded-xl border border-[hsl(var(--swf-warning)/0.35)] bg-[hsl(var(--swf-warning-soft))] p-4 text-sm text-[hsl(var(--foreground))]", children: [
38421
+ return /* @__PURE__ */ jsxs23("div", { part: "ask-card", className: "blade-chat-ask-card ml-4 max-w-lg rounded-xl border border-[hsl(var(--swf-warning)/0.35)] bg-[hsl(var(--swf-warning-soft))] p-4 text-sm text-[hsl(var(--foreground))]", children: [
38388
38422
  /* @__PURE__ */ jsx29("div", { className: "font-semibold", children: "\u9009\u62E9\u9898\u5185\u5BB9\u6682\u65F6\u65E0\u6CD5\u663E\u793A" }),
38389
- /* @__PURE__ */ jsxs24("div", { className: "mt-1 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: [
38423
+ /* @__PURE__ */ jsxs23("div", { className: "mt-1 text-xs leading-5 text-[hsl(var(--muted-foreground))]", children: [
38390
38424
  "\u6536\u5230\u7684\u4EA4\u4E92\u6570\u636E\u4E0D\u5B8C\u6574\u6216\u7248\u672C\u4E0D\u517C\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u95EE\u9898\u6301\u7EED\uFF0C\u8BF7\u63D0\u4F9B\u4EA4\u4E92\u7F16\u53F7",
38391
38425
  /* @__PURE__ */ jsx29("span", { className: "ml-1 font-mono", children: toolCall.id }),
38392
38426
  "\u3002"
@@ -38401,7 +38435,7 @@ function ToolCallBlock({
38401
38435
  const indentClass = level === 2 ? "ml-3" : "";
38402
38436
  const statusIcon = toolCall.status === "pending" ? /* @__PURE__ */ jsx29(LoaderCircle, { size: 12, className: "animate-spin" }) : toolCall.status === "awaiting_answer" ? /* @__PURE__ */ jsx29(MessageSquareMore, { size: 12 }) : toolCall.status === "cancelled" || toolCall.status === "error" ? /* @__PURE__ */ jsx29(X, { size: 12 }) : /* @__PURE__ */ jsx29(Check, { size: 12 });
38403
38437
  const statusTextClass = tone === "failed" ? "text-[hsl(var(--swf-danger))]" : tone === "awaiting" ? "text-[hsl(var(--swf-warning))]" : tone === "running" ? "text-[hsl(var(--muted-foreground))]" : "text-[hsl(var(--primary))]";
38404
- return /* @__PURE__ */ jsxs24(
38438
+ return /* @__PURE__ */ jsxs23(
38405
38439
  "div",
38406
38440
  {
38407
38441
  part: normalizedName === "Agent" ? "agent-loop" : "tool-row",
@@ -38412,8 +38446,8 @@ function ToolCallBlock({
38412
38446
  customization?.classNames?.toolCall
38413
38447
  ),
38414
38448
  children: [
38415
- /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 min-h-7 pr-3 leading-5", children: [
38416
- /* @__PURE__ */ jsxs24(
38449
+ /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2 min-h-7 pr-3 leading-5", children: [
38450
+ /* @__PURE__ */ jsxs23(
38417
38451
  "button",
38418
38452
  {
38419
38453
  type: "button",
@@ -38431,11 +38465,11 @@ function ToolCallBlock({
38431
38465
  )
38432
38466
  }
38433
38467
  ),
38434
- /* @__PURE__ */ jsxs24("span", { className: cn("flex shrink-0 items-center gap-1 text-[10px]", statusTextClass), children: [
38468
+ /* @__PURE__ */ jsxs23("span", { className: cn("flex shrink-0 items-center gap-1 text-[10px]", statusTextClass), children: [
38435
38469
  statusIcon,
38436
38470
  /* @__PURE__ */ jsx29("span", { children: getToolStatusLabel(toolCall.status) })
38437
38471
  ] }),
38438
- /* @__PURE__ */ jsxs24("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: [
38472
+ /* @__PURE__ */ jsxs23("span", { className: "min-w-0 flex-1 truncate font-medium text-[hsl(var(--foreground))]", children: [
38439
38473
  displayName,
38440
38474
  toolCall.status === "error" ? "\uFF08\u5F85\u91CD\u8BD5\uFF09" : ""
38441
38475
  ] })
@@ -38453,12 +38487,12 @@ function ToolCallBlock({
38453
38487
  }
38454
38488
  )
38455
38489
  ] }),
38456
- expanded && /* @__PURE__ */ jsx29("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: Renderer ? /* @__PURE__ */ jsx29(Renderer, { toolCall, sessionId: resolvedSessionId }) : /* @__PURE__ */ jsxs24(Fragment11, { children: [
38490
+ expanded && /* @__PURE__ */ jsx29("div", { className: "ml-4 mt-1 rounded-xl bg-[hsl(var(--card))] px-3 py-3", children: Renderer ? /* @__PURE__ */ jsx29(Renderer, { toolCall, sessionId: resolvedSessionId }) : /* @__PURE__ */ jsxs23(Fragment11, { children: [
38457
38491
  /* @__PURE__ */ jsx29("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u5DE5\u5177" }),
38458
38492
  /* @__PURE__ */ jsx29("div", { className: "mb-3 font-mono text-[11px] text-[hsl(var(--foreground))]", children: normalizedName }),
38459
38493
  /* @__PURE__ */ jsx29("div", { className: "mb-1 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u53C2\u6570" }),
38460
38494
  /* @__PURE__ */ jsx29("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) }),
38461
- toolCall.result != null && /* @__PURE__ */ jsxs24(Fragment11, { children: [
38495
+ toolCall.result != null && /* @__PURE__ */ jsxs23(Fragment11, { children: [
38462
38496
  /* @__PURE__ */ jsx29("div", { className: "mb-1 mt-3 text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u7ED3\u679C" }),
38463
38497
  /* @__PURE__ */ jsx29(
38464
38498
  "pre",
@@ -38629,7 +38663,7 @@ function useAsyncValue(key, load2) {
38629
38663
  }
38630
38664
 
38631
38665
  // src/chat/AttachmentPreviewDialog.tsx
38632
- import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
38666
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
38633
38667
  function AttachmentPreviewDialog({ open: open2, onOpenChange, filename, url: url2, mode }) {
38634
38668
  const enabled = open2 && url2 != null && (mode === "markdown" || mode === "text");
38635
38669
  const { data: content3, error: error61 } = useAsyncValue(enabled ? `${mode}:${url2}` : null, async (signal) => {
@@ -38645,15 +38679,15 @@ function AttachmentPreviewDialog({ open: open2, onOpenChange, filename, url: url
38645
38679
  return res.text();
38646
38680
  });
38647
38681
  if (!open2) return null;
38648
- return /* @__PURE__ */ jsx30(Dialog, { open: open2, onOpenChange, children: /* @__PURE__ */ jsxs25(
38682
+ return /* @__PURE__ */ jsx30(Dialog, { open: open2, onOpenChange, children: /* @__PURE__ */ jsxs24(
38649
38683
  DialogContent,
38650
38684
  {
38651
38685
  showCloseButton: false,
38652
38686
  className: "flex max-h-[90vh] w-full max-w-3xl flex-col gap-0 overflow-hidden p-0",
38653
38687
  children: [
38654
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
38688
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
38655
38689
  /* @__PURE__ */ jsx30(DialogTitle, { className: "truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: filename }),
38656
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-1", children: [
38690
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1", children: [
38657
38691
  url2 && /* @__PURE__ */ jsx30(
38658
38692
  "a",
38659
38693
  {
@@ -38691,14 +38725,14 @@ function renderContent({
38691
38725
  return /* @__PURE__ */ jsx30("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u6B64\u9644\u4EF6\u6682\u65E0\u53EF\u7528\u9884\u89C8\u5730\u5740\u3002" });
38692
38726
  }
38693
38727
  if (mode === "default") {
38694
- return /* @__PURE__ */ jsxs25("p", { className: "text-[hsl(var(--muted-foreground))]", children: [
38728
+ return /* @__PURE__ */ jsxs24("p", { className: "text-[hsl(var(--muted-foreground))]", children: [
38695
38729
  "\u6B64\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u5185\u5D4C\u9884\u89C8\u3002\u8BF7\u70B9\u51FB\u53F3\u4E0A\u89D2",
38696
38730
  /* @__PURE__ */ jsx30("span", { className: "mx-1 font-medium text-[hsl(var(--foreground))]", children: "\u4E0B\u8F7D" }),
38697
38731
  "\u6309\u94AE\u67E5\u770B\u3002"
38698
38732
  ] });
38699
38733
  }
38700
38734
  if (error61) {
38701
- return /* @__PURE__ */ jsxs25("p", { className: "text-[hsl(var(--destructive))]", children: [
38735
+ return /* @__PURE__ */ jsxs24("p", { className: "text-[hsl(var(--destructive))]", children: [
38702
38736
  "\u52A0\u8F7D\u5931\u8D25\uFF1A",
38703
38737
  String(error61?.message ?? error61)
38704
38738
  ] });
@@ -38713,10 +38747,10 @@ function renderContent({
38713
38747
  }
38714
38748
 
38715
38749
  // src/chat/MessageContextPills.tsx
38716
- import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
38750
+ import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
38717
38751
  function MessageContextPills({ contexts }) {
38718
38752
  if (contexts.length === 0) return null;
38719
- return /* @__PURE__ */ jsx31("div", { className: "flex flex-wrap gap-1.5", children: contexts.map((ctx, index2) => /* @__PURE__ */ jsxs26(
38753
+ return /* @__PURE__ */ jsx31("div", { className: "flex flex-wrap gap-1.5", children: contexts.map((ctx, index2) => /* @__PURE__ */ jsxs25(
38720
38754
  "div",
38721
38755
  {
38722
38756
  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)]",
@@ -38731,7 +38765,7 @@ function MessageContextPills({ contexts }) {
38731
38765
  }
38732
38766
 
38733
38767
  // src/chat/TextAttachmentPills.tsx
38734
- import { Fragment as Fragment12, jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
38768
+ import { Fragment as Fragment12, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
38735
38769
  function getFileIcon2(fileName) {
38736
38770
  const lower2 = fileName.toLowerCase();
38737
38771
  if (/\.(zip|rar|7z|tar|gz)$/.test(lower2)) return Archive;
@@ -38749,7 +38783,7 @@ function TextAttachmentPills({ attachments, onPreview }) {
38749
38783
  return /* @__PURE__ */ jsx32("div", { className: "flex flex-wrap gap-1.5", children: attachments.map((att, index2) => {
38750
38784
  const Icon = getFileIcon2(att.name);
38751
38785
  const key = `${att.uploadedPath ?? att.name}:${att.name}:${index2}`;
38752
- const content3 = /* @__PURE__ */ jsxs27(Fragment12, { children: [
38786
+ const content3 = /* @__PURE__ */ jsxs26(Fragment12, { children: [
38753
38787
  /* @__PURE__ */ jsx32(Icon, { size: 12, className: "shrink-0 text-[hsl(var(--primary)/0.6)]" }),
38754
38788
  /* @__PURE__ */ jsx32("span", { className: "max-w-40 truncate", children: att.name })
38755
38789
  ] });
@@ -38771,19 +38805,19 @@ function TextAttachmentPills({ attachments, onPreview }) {
38771
38805
  }
38772
38806
 
38773
38807
  // src/components/WhatIfUserBubble.tsx
38774
- import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
38808
+ import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
38775
38809
  function WhatIfUserBubble({ parsed, onQuoteClick }) {
38776
38810
  const { fromStep, quotes, userText } = parsed;
38777
- return /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-end gap-2", children: [
38778
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1.5 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.5)] px-2.5 py-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
38811
+ return /* @__PURE__ */ jsxs27("div", { className: "flex flex-col items-end gap-2", children: [
38812
+ /* @__PURE__ */ jsxs27("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: [
38779
38813
  /* @__PURE__ */ jsx33(RefreshCcw, { size: 10 }),
38780
38814
  /* @__PURE__ */ jsx33("span", { children: fromStep != null ? `\u91CD\u8DD1\u81EA step ${fromStep}` : "\u91CD\u8DD1" })
38781
38815
  ] }),
38782
38816
  quotes.length > 0 && /* @__PURE__ */ jsx33("div", { className: "flex max-w-[min(72vw,42rem)] flex-col items-stretch gap-2", children: quotes.map((quote, index2) => {
38783
38817
  const clickable = quote.stepNumber != null && !!onQuoteClick;
38784
38818
  const label = quote.stepNumber != null ? `\u6B65\u9AA4${quote.stepNumber} \xB7 ${quote.label}` : quote.label;
38785
- return /* @__PURE__ */ jsxs28("div", { className: "rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.8)] px-3 py-2 text-left", children: [
38786
- /* @__PURE__ */ jsxs28("button", { type: "button", disabled: !clickable, onClick: () => clickable && onQuoteClick(quote.stepNumber), className: "inline-flex max-w-full items-center gap-1 text-[11px] font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] disabled:cursor-default", title: clickable ? "\u8DF3\u8F6C\u5230\u5BF9\u5E94\u6B65\u9AA4\u5361\u7247" : void 0, children: [
38819
+ return /* @__PURE__ */ jsxs27("div", { className: "rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.8)] px-3 py-2 text-left", children: [
38820
+ /* @__PURE__ */ jsxs27("button", { type: "button", disabled: !clickable, onClick: () => clickable && onQuoteClick(quote.stepNumber), className: "inline-flex max-w-full items-center gap-1 text-[11px] font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] disabled:cursor-default", title: clickable ? "\u8DF3\u8F6C\u5230\u5BF9\u5E94\u6B65\u9AA4\u5361\u7247" : void 0, children: [
38787
38821
  /* @__PURE__ */ jsx33("span", { children: "\u21B3" }),
38788
38822
  /* @__PURE__ */ jsx33("span", { className: "truncate", children: label })
38789
38823
  ] }),
@@ -38795,7 +38829,7 @@ function WhatIfUserBubble({ parsed, onQuoteClick }) {
38795
38829
  }
38796
38830
 
38797
38831
  // src/chat/UserMessageBubble.tsx
38798
- import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
38832
+ import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
38799
38833
  function isUserMessage(message) {
38800
38834
  return message.role === "user";
38801
38835
  }
@@ -38846,13 +38880,13 @@ function UserMessageBubble({ message, className }) {
38846
38880
  } = extractTextAttachments(message.content);
38847
38881
  const trimmedClean = cleanText.trim();
38848
38882
  const pluginPills = message.refs?.length ? /* @__PURE__ */ jsx34("div", { className: "flex flex-wrap justify-end gap-1.5", "aria-label": "\u9009\u62E9\u7684\u63D2\u4EF6\u6761\u76EE", children: message.refs.map((ref) => /* @__PURE__ */ jsx34("span", { className: "max-w-full truncate rounded-full border border-border bg-muted px-2.5 py-1 text-xs", children: ref.label }, `${ref.plugin}:${ref.server}:${ref.id}`)) }) : null;
38849
- const topicAssetPills = message.topic_asset_refs?.length ? /* @__PURE__ */ jsx34("div", { className: "flex max-w-full flex-wrap justify-end gap-1.5", "aria-label": "\u5F15\u7528\u7684\u4E3B\u9898\u8D44\u4EA7", children: message.topic_asset_refs.map((ref) => /* @__PURE__ */ jsxs29("span", { title: ref.path, className: "max-w-full truncate rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground", children: [
38883
+ const topicAssetPills = message.topic_asset_refs?.length ? /* @__PURE__ */ jsx34("div", { className: "flex max-w-full flex-wrap justify-end gap-1.5", "aria-label": "\u5F15\u7528\u7684\u4E3B\u9898\u8D44\u4EA7", children: message.topic_asset_refs.map((ref) => /* @__PURE__ */ jsxs28("span", { title: ref.path, className: "max-w-full truncate rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground", children: [
38850
38884
  "\u4E3B\u9898\u8D44\u4EA7 \xB7 ",
38851
38885
  ref.path
38852
38886
  ] }, `${ref.topic_id}:${ref.path}`)) }) : null;
38853
38887
  const whatifParsed = trimmedClean && imageParts.length === 0 && fileParts.length === 0 && textAttachments.length === 0 ? parseWhatIfPrompt(cleanText) : null;
38854
38888
  if (whatifParsed && customBubble == null) {
38855
- return /* @__PURE__ */ jsx34("div", { part: "user-row", className: "blade-chat-user-row flex justify-end", children: /* @__PURE__ */ jsxs29("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-2", children: [
38889
+ return /* @__PURE__ */ jsx34("div", { part: "user-row", className: "blade-chat-user-row flex justify-end", children: /* @__PURE__ */ jsxs28("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-2", children: [
38856
38890
  pluginPills,
38857
38891
  topicAssetPills,
38858
38892
  /* @__PURE__ */ jsx34(WhatIfUserBubble, { parsed: whatifParsed }),
@@ -38907,8 +38941,8 @@ function UserMessageBubble({ message, className }) {
38907
38941
  const mode = kind === "text" ? lower2.endsWith(".md") ? "markdown" : "text" : "default";
38908
38942
  setPreview({ filename: attachment.name, url: url2, mode });
38909
38943
  };
38910
- return /* @__PURE__ */ jsx34("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", className), children: /* @__PURE__ */ jsxs29("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-3", children: [
38911
- (imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */ jsxs29("div", { className: "grid gap-2", children: [
38944
+ return /* @__PURE__ */ jsx34("div", { part: "user-row", className: cn("blade-chat-user-row flex justify-end", className), children: /* @__PURE__ */ jsxs28("div", { className: "blade-chat-user-col group flex max-w-[72%] flex-col items-end gap-3", children: [
38945
+ (imageParts.length > 0 || imageTextAttachmentMeta.length > 0) && /* @__PURE__ */ jsxs28("div", { className: "grid gap-2", children: [
38912
38946
  imageParts.map((part, idx) => /* @__PURE__ */ jsx34(
38913
38947
  "button",
38914
38948
  {
@@ -39008,7 +39042,7 @@ function UserMessageBubble({ message, className }) {
39008
39042
  )
39009
39043
  }
39010
39044
  )),
39011
- trimmedClean && (isSending(message) ? /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-1 pr-1 text-[11px] font-medium text-[hsl(var(--muted-foreground))/0.85]", children: [
39045
+ trimmedClean && (isSending(message) ? /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1 pr-1 text-[11px] font-medium text-[hsl(var(--muted-foreground))/0.85]", children: [
39012
39046
  /* @__PURE__ */ jsx34(LoaderCircle, { size: 12, className: "animate-spin", "aria-hidden": "true" }),
39013
39047
  /* @__PURE__ */ jsx34("span", { children: "\u53D1\u9001\u4E2D" })
39014
39048
  ] }) : /* @__PURE__ */ jsx34(
@@ -39026,7 +39060,7 @@ function ErrorMessageBlock({
39026
39060
  }) {
39027
39061
  const text4 = chatErrorForDisplay(getTextContent(message.content));
39028
39062
  const looksLikeModelUnavailable = /no source matches this model|404/i.test(text4);
39029
- return /* @__PURE__ */ jsx34("div", { part: "error-row", className: cn("blade-chat-error-row flex min-w-0 justify-start", className), children: /* @__PURE__ */ jsxs29("div", { className: "min-w-0 max-w-full whitespace-pre-wrap break-words border-l-[3px] border-[hsl(var(--border))] px-3 py-1 text-left text-sm leading-7 text-[hsl(var(--muted-foreground))] [overflow-wrap:anywhere]", children: [
39063
+ return /* @__PURE__ */ jsx34("div", { part: "error-row", className: cn("blade-chat-error-row flex min-w-0 justify-start", className), children: /* @__PURE__ */ jsxs28("div", { className: "min-w-0 max-w-full whitespace-pre-wrap break-words border-l-[3px] border-[hsl(var(--border))] px-3 py-1 text-left text-sm leading-7 text-[hsl(var(--muted-foreground))] [overflow-wrap:anywhere]", children: [
39030
39064
  text4,
39031
39065
  looksLikeModelUnavailable ? /* @__PURE__ */ jsx34("div", { className: "mt-1 opacity-80", children: "\u6A21\u578B\u53EF\u80FD\u672A\u542F\u52A8\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" }) : null
39032
39066
  ] }) });
@@ -39041,7 +39075,7 @@ function findLatestReasoningMessageIndex(messages) {
39041
39075
  }
39042
39076
 
39043
39077
  // src/chat/AgentLoopBlock.tsx
39044
- import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
39078
+ import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
39045
39079
  var COLLAPSED_SUMMARY_HIDDEN_TOOLS = /* @__PURE__ */ new Set(["ReadSkill", "Read"]);
39046
39080
  function safeParseDescription(argsStr) {
39047
39081
  try {
@@ -39144,7 +39178,7 @@ function AgentLoopBlock({
39144
39178
  const status = hasAwaitingAnswer || toolCall.status === "awaiting_answer" && visibleLoopToolCalls.length === 0 ? "awaiting_answer" : toolCall.status === "pending" || loopEntry?.info.status === "running" ? "running" : toolCall.status === "error" || loopEntry?.info.status === "error" ? "error" : toolCall.status === "cancelled" || loopEntry?.info.status === "cancelled" ? "cancelled" : "done";
39145
39179
  const latestReasoningIndex = status === "running" ? findLatestReasoningMessageIndex(childMessages) : -1;
39146
39180
  const cardStyles = getLoopCardStyles(status);
39147
- return /* @__PURE__ */ jsxs30(
39181
+ return /* @__PURE__ */ jsxs29(
39148
39182
  "div",
39149
39183
  {
39150
39184
  part: "agent-loop",
@@ -39153,8 +39187,8 @@ function AgentLoopBlock({
39153
39187
  cardStyles.borderClass
39154
39188
  ),
39155
39189
  children: [
39156
- status === "running" || status === "awaiting_answer" ? /* @__PURE__ */ jsxs30(Fragment13, { children: [
39157
- /* @__PURE__ */ jsxs30(
39190
+ status === "running" || status === "awaiting_answer" ? /* @__PURE__ */ jsxs29(Fragment13, { children: [
39191
+ /* @__PURE__ */ jsxs29(
39158
39192
  "div",
39159
39193
  {
39160
39194
  className: cn(
@@ -39169,9 +39203,9 @@ function AgentLoopBlock({
39169
39203
  onClick: toggleExpanded,
39170
39204
  "aria-expanded": expanded,
39171
39205
  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",
39172
- children: /* @__PURE__ */ jsxs30("span", { className: "min-w-0 flex items-center gap-2", children: [
39206
+ children: /* @__PURE__ */ jsxs29("span", { className: "min-w-0 flex items-center gap-2", children: [
39173
39207
  status === "awaiting_answer" ? /* @__PURE__ */ jsx35(MessageSquareMore, { size: 14, className: "shrink-0 text-[hsl(var(--swf-warning))] motion-safe:animate-pulse" }) : /* @__PURE__ */ jsx35(Bot, { size: 14, className: "shrink-0 text-[hsl(var(--muted-foreground))]" }),
39174
- /* @__PURE__ */ jsxs30("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: [
39208
+ /* @__PURE__ */ jsxs29("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: [
39175
39209
  renderDescription ? renderDescription(description) : description,
39176
39210
  status === "awaiting_answer" ? " \u2014 \u7B49\u5F85\u56DE\u7B54" : ""
39177
39211
  ] })
@@ -39217,12 +39251,12 @@ function AgentLoopBlock({
39217
39251
  level: 2
39218
39252
  },
39219
39253
  childToolCall.id
39220
- )) : /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
39254
+ )) : /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 px-4 py-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
39221
39255
  /* @__PURE__ */ jsx35(LoaderCircle, { size: 12, className: "shrink-0 animate-spin text-[hsl(var(--muted-foreground))]" }),
39222
39256
  /* @__PURE__ */ jsx35("span", { children: "\u6B63\u5728\u542F\u52A8..." })
39223
39257
  ] }) }) : status === "awaiting_answer" ? /* @__PURE__ */ jsx35("div", { className: "flex flex-col gap-1 py-2", children: /* @__PURE__ */ jsx35("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
39224
- ] }) : /* @__PURE__ */ jsxs30(Fragment13, { children: [
39225
- /* @__PURE__ */ jsxs30(
39258
+ ] }) : /* @__PURE__ */ jsxs29(Fragment13, { children: [
39259
+ /* @__PURE__ */ jsxs29(
39226
39260
  "div",
39227
39261
  {
39228
39262
  className: cn(
@@ -39237,7 +39271,7 @@ function AgentLoopBlock({
39237
39271
  onClick: toggleExpanded,
39238
39272
  "aria-expanded": expanded,
39239
39273
  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",
39240
- children: /* @__PURE__ */ jsxs30("span", { className: "min-w-0 flex items-center gap-2", children: [
39274
+ children: /* @__PURE__ */ jsxs29("span", { className: "min-w-0 flex items-center gap-2", children: [
39241
39275
  status === "error" ? /* @__PURE__ */ jsx35(X, { size: 14, className: cn("shrink-0", cardStyles.iconClass) }) : status === "cancelled" ? /* @__PURE__ */ jsx35(Ban, { size: 14, className: cn("shrink-0", cardStyles.iconClass) }) : /* @__PURE__ */ jsx35(Check, { size: 14, className: "shrink-0 text-[hsl(var(--swf-success))]" }),
39242
39276
  /* @__PURE__ */ jsx35("span", { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: renderDescription ? renderDescription(description) : description })
39243
39277
  ] })
@@ -39274,9 +39308,9 @@ function AgentLoopBlock({
39274
39308
  ]
39275
39309
  }
39276
39310
  ),
39277
- !expanded ? /* @__PURE__ */ jsxs30(Fragment13, { children: [
39311
+ !expanded ? /* @__PURE__ */ jsxs29(Fragment13, { children: [
39278
39312
  /* @__PURE__ */ jsx35("div", { className: "flex flex-wrap gap-1.5 px-4 py-2", children: completedToolLabels.length > 0 ? completedToolLabels.map(
39279
- (item) => item.kind === "file" ? /* @__PURE__ */ jsxs30(
39313
+ (item) => item.kind === "file" ? /* @__PURE__ */ jsxs29(
39280
39314
  "span",
39281
39315
  {
39282
39316
  className: "inline-flex min-w-0 items-center gap-1 rounded-[6px] bg-[hsl(var(--muted))] px-2 py-0.5 text-xs font-medium text-[hsl(var(--secondary-foreground))]",
@@ -39299,10 +39333,10 @@ function AgentLoopBlock({
39299
39333
  inlineToolUiBlocks.length > 0 ? /* @__PURE__ */ jsx35("div", { className: "flex flex-col gap-2 px-4 pb-3", children: inlineToolUiBlocks.map((block) => /* @__PURE__ */ jsx35(ToolUiCard, { card: block.card, sessionId }, block.key)) }) : null
39300
39334
  ] }) : null
39301
39335
  ] }),
39302
- expanded && /* @__PURE__ */ jsxs30("div", { className: "border-t border-[hsl(var(--border))] py-2", children: [
39336
+ expanded && /* @__PURE__ */ jsxs29("div", { className: "border-t border-[hsl(var(--border))] py-2", children: [
39303
39337
  (() => {
39304
39338
  const taskPrompt = safeParsePrompt(toolCall.arguments);
39305
- return taskPrompt ? /* @__PURE__ */ jsxs30("details", { className: "mx-3 mb-2 rounded-md bg-[hsl(var(--muted))]/40", children: [
39339
+ return taskPrompt ? /* @__PURE__ */ jsxs29("details", { className: "mx-3 mb-2 rounded-md bg-[hsl(var(--muted))]/40", children: [
39306
39340
  /* @__PURE__ */ jsx35("summary", { className: "cursor-pointer px-3 py-1.5 text-[11px] font-medium text-[hsl(var(--muted-foreground))]", children: "\u4EFB\u52A1" }),
39307
39341
  /* @__PURE__ */ jsx35("div", { className: "px-3 pb-2", children: /* @__PURE__ */ jsx35("pre", { className: "whitespace-pre-wrap text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: taskPrompt }) })
39308
39342
  ] }) : null;
@@ -39332,7 +39366,7 @@ function AgentLoopBlock({
39332
39366
  },
39333
39367
  message.entry_id ?? `${message.timestamp ?? "error"}-${index2}`
39334
39368
  ) : null
39335
- ) }) : status === "running" ? /* @__PURE__ */ jsxs30("div", { className: "px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
39369
+ ) }) : status === "running" ? /* @__PURE__ */ jsxs29("div", { className: "px-3 py-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
39336
39370
  /* @__PURE__ */ jsx35(LoaderCircle, { size: 12, className: "mr-1.5 inline animate-spin" }),
39337
39371
  "\u6B63\u5728\u542F\u52A8..."
39338
39372
  ] }) : toolCall.result ? /* @__PURE__ */ jsx35("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
@@ -39356,8 +39390,8 @@ function ExpandedChildAssistantMessage({
39356
39390
  (toolCall) => formatToolName(toolCall.name) !== "AskUserQuestion"
39357
39391
  ) : message.tool_calls ?? [];
39358
39392
  const hasToolCalls = toolCalls.length > 0;
39359
- return /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-2", children: [
39360
- showReasoning && message.reasoning && /* @__PURE__ */ jsxs30(Reasoning, { isStreaming, children: [
39393
+ return /* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-2", children: [
39394
+ showReasoning && message.reasoning && /* @__PURE__ */ jsxs29(Reasoning, { isStreaming, children: [
39361
39395
  /* @__PURE__ */ jsx35(ReasoningTrigger, { wordCount: message.reasoning.length }),
39362
39396
  /* @__PURE__ */ jsx35(ReasoningContent, { children: message.reasoning })
39363
39397
  ] }),
@@ -39403,7 +39437,7 @@ function ChildText({
39403
39437
  sessionId,
39404
39438
  reasoning
39405
39439
  }) {
39406
- return /* @__PURE__ */ jsxs30("div", { className: "pl-8 text-[12px] leading-6 text-[hsl(var(--foreground))]", children: [
39440
+ return /* @__PURE__ */ jsxs29("div", { className: "pl-8 text-[12px] leading-6 text-[hsl(var(--foreground))]", children: [
39407
39441
  /* @__PURE__ */ jsx35(
39408
39442
  MarkdownContent,
39409
39443
  {
@@ -39443,7 +39477,7 @@ function getLoopCardStyles(status) {
39443
39477
  }
39444
39478
 
39445
39479
  // src/chat/WorkflowRunBlock.tsx
39446
- import { Fragment as Fragment14, jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
39480
+ import { Fragment as Fragment14, jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
39447
39481
  var EMPTY_ENTRIES = [];
39448
39482
  function synthToolCall(loopName, info, desc) {
39449
39483
  return {
@@ -39518,7 +39552,7 @@ function RefTokenText({ text: text4, refs }) {
39518
39552
  const id = match[1];
39519
39553
  const info = refs.get(id);
39520
39554
  parts.push(
39521
- /* @__PURE__ */ jsxs31(
39555
+ /* @__PURE__ */ jsxs30(
39522
39556
  "span",
39523
39557
  {
39524
39558
  title: info?.value ? info.value.slice(0, 300) : "\u5C1A\u65E0\u8F93\u51FA",
@@ -39593,8 +39627,8 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
39593
39627
  const title = run?.name || "\u5DE5\u4F5C\u6D41";
39594
39628
  const statusSummary = running ? `\u8FDB\u884C\u4E2D \xB7 ${stepCount} \u6B65` : status === "error" ? `\u5931\u8D25 \xB7 ${stepCount} \u6B65` : status === "cancelled" ? `\u5DF2\u53D6\u6D88 \xB7 ${stepCount} \u6B65` : `\u5DF2\u5B8C\u6210 \xB7 ${stepCount} \u6B65`;
39595
39629
  const hasStepContent = groups.length > 0 || stepLoops.length > 0;
39596
- return /* @__PURE__ */ jsxs31("div", { className: "msg-animate overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]/50", children: [
39597
- /* @__PURE__ */ jsxs31(
39630
+ return /* @__PURE__ */ jsxs30("div", { className: "msg-animate overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]/50", children: [
39631
+ /* @__PURE__ */ jsxs30(
39598
39632
  "button",
39599
39633
  {
39600
39634
  type: "button",
@@ -39603,11 +39637,11 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
39603
39637
  className: "flex w-full items-center gap-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--primary)/0.06)] px-4 py-2.5 text-left transition-colors hover:bg-[hsl(var(--primary)/0.1)] focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))] focus:outline-none",
39604
39638
  children: [
39605
39639
  /* @__PURE__ */ jsx36(Workflow, { size: 15, className: "shrink-0 text-[hsl(var(--primary))]" }),
39606
- /* @__PURE__ */ jsxs31("span", { className: "min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: [
39640
+ /* @__PURE__ */ jsxs30("span", { className: "min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: [
39607
39641
  "\u5DE5\u4F5C\u6D41\u8FD0\u884C \xB7 ",
39608
39642
  title
39609
39643
  ] }),
39610
- /* @__PURE__ */ jsxs31("span", { className: "ml-auto flex shrink-0 items-center gap-1.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
39644
+ /* @__PURE__ */ jsxs30("span", { className: "ml-auto flex shrink-0 items-center gap-1.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
39611
39645
  running ? /* @__PURE__ */ jsx36(LoaderCircle, { size: 12, className: "animate-spin" }) : null,
39612
39646
  statusSummary
39613
39647
  ] }),
@@ -39624,13 +39658,13 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
39624
39658
  ]
39625
39659
  }
39626
39660
  ),
39627
- !collapsed && /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-2 p-3", children: [
39661
+ !collapsed && /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-2 p-3", children: [
39628
39662
  /* @__PURE__ */ jsx36(LogLines, { logs: meaningfulLogs(prelude) }),
39629
39663
  groups.map((group, index2) => {
39630
39664
  const loop = groupLoops[index2];
39631
39665
  const logs = meaningfulLogs(group.logs);
39632
39666
  if (loop) {
39633
- return /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
39667
+ return /* @__PURE__ */ jsxs30("div", { className: "flex flex-col gap-1", children: [
39634
39668
  /* @__PURE__ */ jsx36(
39635
39669
  AgentLoopBlock,
39636
39670
  {
@@ -39644,7 +39678,7 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
39644
39678
  ] }, group.key);
39645
39679
  }
39646
39680
  if (logs.length === 0) return null;
39647
- return /* @__PURE__ */ jsxs31(
39681
+ return /* @__PURE__ */ jsxs30(
39648
39682
  "div",
39649
39683
  {
39650
39684
  className: "rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-3 py-2",
@@ -39667,7 +39701,7 @@ function WorkflowRunBlock({ toolCall, sessionId }) {
39667
39701
  step.loopName
39668
39702
  )),
39669
39703
  (!hasStepContent && output2 || status === "error" && output2) && /* @__PURE__ */ jsx36("pre", { className: "max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-[hsl(var(--border))] px-3 py-2 font-mono text-[11px] leading-[1.5] text-[hsl(var(--muted-foreground))]", children: output2 }),
39670
- status === "done" && hasStepContent && finalOutput && /* @__PURE__ */ jsxs31("details", { className: "rounded-lg border border-[hsl(var(--border))] px-3 py-2", children: [
39704
+ status === "done" && hasStepContent && finalOutput && /* @__PURE__ */ jsxs30("details", { className: "rounded-lg border border-[hsl(var(--border))] px-3 py-2", children: [
39671
39705
  /* @__PURE__ */ jsx36("summary", { className: "cursor-pointer select-none text-xs text-[hsl(var(--muted-foreground))]", children: "\u6700\u7EC8\u8F93\u51FA" }),
39672
39706
  /* @__PURE__ */ jsx36("pre", { className: "mt-1.5 max-h-48 overflow-y-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-[1.5] text-[hsl(var(--muted-foreground))]", children: finalOutput })
39673
39707
  ] }),
@@ -39730,7 +39764,7 @@ function toolCallAnswered(toolCall, sessionStatus, answerData) {
39730
39764
  }
39731
39765
 
39732
39766
  // src/chat/AssistantTurnBlock.tsx
39733
- import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
39767
+ import { jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
39734
39768
  var EMPTY_MESSAGES = [];
39735
39769
  var EMPTY_AGENT_LOOPS = {};
39736
39770
  var turnDisplayModeMemory = /* @__PURE__ */ new Map();
@@ -40044,7 +40078,7 @@ function AssistantTurnBlockBase({
40044
40078
  if (observedMemoryRefs.length > 0) setCachedMemoryRefs(observedMemoryRefs);
40045
40079
  }, [observedMemoryRefs]);
40046
40080
  const memoryRefs = observedMemoryRefs.length > 0 ? observedMemoryRefs : cachedMemoryRefs;
40047
- return /* @__PURE__ */ jsxs32(
40081
+ return /* @__PURE__ */ jsxs31(
40048
40082
  "div",
40049
40083
  {
40050
40084
  "aria-busy": isStreaming || void 0,
@@ -40058,7 +40092,7 @@ function AssistantTurnBlockBase({
40058
40092
  memoryRefs.length > 0 && /* @__PURE__ */ jsx37(MemoryRefsHint, { refs: memoryRefs }),
40059
40093
  hasInterruptedState && /* @__PURE__ */ jsx37("div", { className: "ml-4 w-fit rounded-full border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--swf-warning))]", children: "\u5DF2\u4E2D\u65AD" }),
40060
40094
  hasFailedWithoutContent && /* @__PURE__ */ jsx37("div", { className: "ml-4 w-fit rounded-full border border-[hsl(var(--destructive)/0.3)] bg-[hsl(var(--destructive)/0.1)] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--destructive))]", children: "\u751F\u6210\u5931\u8D25" }),
40061
- hasExecutionProcess && /* @__PURE__ */ jsxs32("div", { className: "flex w-full items-start gap-2.5", children: [
40095
+ hasExecutionProcess && /* @__PURE__ */ jsxs31("div", { className: "flex w-full items-start gap-2.5", children: [
40062
40096
  /* @__PURE__ */ jsx37(
40063
40097
  "span",
40064
40098
  {
@@ -40067,8 +40101,8 @@ function AssistantTurnBlockBase({
40067
40101
  children: /* @__PURE__ */ jsx37(Bot, { size: 16 })
40068
40102
  }
40069
40103
  ),
40070
- /* @__PURE__ */ jsxs32("div", { className: "min-w-0 flex-1 pt-0.5", children: [
40071
- /* @__PURE__ */ jsxs32(
40104
+ /* @__PURE__ */ jsxs31("div", { className: "min-w-0 flex-1 pt-0.5", children: [
40105
+ /* @__PURE__ */ jsxs31(
40072
40106
  "button",
40073
40107
  {
40074
40108
  type: "button",
@@ -40341,12 +40375,12 @@ function AssistantMessages({
40341
40375
  );
40342
40376
  const hasToolCalls = toolCalls.length > 0;
40343
40377
  const orderedParts = getOrderedMessageParts(message, toolCalls);
40344
- return /* @__PURE__ */ jsxs32(
40378
+ return /* @__PURE__ */ jsxs31(
40345
40379
  "div",
40346
40380
  {
40347
40381
  className: "flex flex-col gap-1",
40348
40382
  children: [
40349
- showReasoning && /* @__PURE__ */ jsxs32(
40383
+ showReasoning && /* @__PURE__ */ jsxs31(
40350
40384
  Reasoning,
40351
40385
  {
40352
40386
  isStreaming: isReasoningStreamingLastMessage,
@@ -40455,7 +40489,7 @@ function CompactToolGroupBlock({
40455
40489
  level,
40456
40490
  customization
40457
40491
  }) {
40458
- return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
40492
+ return /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-1", children: [
40459
40493
  toolCalls.map((toolCall) => {
40460
40494
  const CustomToolCall = customization?.components?.ToolCall;
40461
40495
  return CustomToolCall ? /* @__PURE__ */ jsx37(
@@ -40515,7 +40549,7 @@ function AssistantMessageContent({
40515
40549
  if (!text4 && imageParts.length === 0 && fileParts.length === 0 && !reasoning && !failed) {
40516
40550
  return null;
40517
40551
  }
40518
- return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-3", children: [
40552
+ return /* @__PURE__ */ jsxs31("div", { className: "flex flex-col gap-3", children: [
40519
40553
  failed ? /* @__PURE__ */ jsx37("div", { className: "w-fit rounded-full border border-[hsl(var(--destructive)/0.3)] bg-[hsl(var(--destructive)/0.1)] px-2.5 py-1 text-[10px] font-medium text-[hsl(var(--destructive))]", children: "\u751F\u6210\u5931\u8D25" }) : null,
40520
40554
  imageParts.length > 0 && /* @__PURE__ */ jsx37("div", { className: "grid gap-2", children: imageParts.map((part) => /* @__PURE__ */ jsx37(
40521
40555
  MessageImage,
@@ -40564,7 +40598,7 @@ function AssistantText({
40564
40598
  () => ({ sessionId, messageId, sendMessage }),
40565
40599
  [sessionId, messageId, sendMessage]
40566
40600
  );
40567
- return /* @__PURE__ */ jsxs32(
40601
+ return /* @__PURE__ */ jsxs31(
40568
40602
  "div",
40569
40603
  {
40570
40604
  part: "assistant-text",
@@ -40599,13 +40633,13 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
40599
40633
  const memoriesHref = useChatEnvironment().memoriesHref;
40600
40634
  const hasSkill = refs.some((r) => r.skill_name);
40601
40635
  const label = hasSkill ? "\u53C2\u8003\u4E86\u8BE5\u6280\u80FD\u7684\u5386\u53F2\u7ECF\u9A8C" : "\u53C2\u8003\u4E86\u5386\u53F2\u7ECF\u9A8C";
40602
- return /* @__PURE__ */ jsxs32(
40636
+ return /* @__PURE__ */ jsxs31(
40603
40637
  "div",
40604
40638
  {
40605
40639
  part: "memory-refs",
40606
40640
  className: cn("blade-chat-memory-refs relative z-[1] ml-1 w-[calc(100%-0.25rem)] max-w-[680px] self-start", className),
40607
40641
  children: [
40608
- /* @__PURE__ */ jsxs32(
40642
+ /* @__PURE__ */ jsxs31(
40609
40643
  "button",
40610
40644
  {
40611
40645
  type: "button",
@@ -40613,7 +40647,7 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
40613
40647
  className: "inline-flex h-8 items-center gap-1.5 rounded-lg border border-[hsl(var(--primary)/0.22)] bg-[hsl(var(--primary)/0.07)] px-3 text-xs font-medium text-[hsl(var(--primary))] transition-colors hover:bg-[hsl(var(--primary)/0.12)]",
40614
40648
  children: [
40615
40649
  /* @__PURE__ */ jsx37(BookOpen, { size: 12 }),
40616
- /* @__PURE__ */ jsxs32("span", { children: [
40650
+ /* @__PURE__ */ jsxs31("span", { children: [
40617
40651
  label,
40618
40652
  "\uFF08",
40619
40653
  refs.length,
@@ -40629,8 +40663,8 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
40629
40663
  ]
40630
40664
  }
40631
40665
  ),
40632
- expanded && /* @__PURE__ */ jsxs32("div", { className: "mt-2 flex flex-col gap-2 rounded-xl border border-[hsl(var(--border)/0.8)] bg-[hsl(var(--muted)/0.28)] p-2.5", children: [
40633
- refs.map((ref) => /* @__PURE__ */ jsxs32(
40666
+ expanded && /* @__PURE__ */ jsxs31("div", { className: "mt-2 flex flex-col gap-2 rounded-xl border border-[hsl(var(--border)/0.8)] bg-[hsl(var(--muted)/0.28)] p-2.5", children: [
40667
+ refs.map((ref) => /* @__PURE__ */ jsxs31(
40634
40668
  "div",
40635
40669
  {
40636
40670
  className: "rounded-lg border border-[hsl(var(--border)/0.55)] bg-[hsl(var(--background)/0.72)] px-3 py-2.5",
@@ -40641,7 +40675,7 @@ function MemoryRefsHint({ refs: rawRefs, className }) {
40641
40675
  },
40642
40676
  ref.id
40643
40677
  )),
40644
- memoriesHref ? /* @__PURE__ */ jsxs32(
40678
+ memoriesHref ? /* @__PURE__ */ jsxs31(
40645
40679
  "a",
40646
40680
  {
40647
40681
  href: memoriesHref,
@@ -41125,15 +41159,15 @@ import {
41125
41159
  getContextDisplayState,
41126
41160
  getContextGroupDisplayState
41127
41161
  } from "@blade-hq/agent-client/internal";
41128
- import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
41162
+ import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
41129
41163
  function ContextCard({ context, className }) {
41130
41164
  const display = getContextDisplayState(context);
41131
- return /* @__PURE__ */ jsxs33(
41165
+ return /* @__PURE__ */ jsxs32(
41132
41166
  "details",
41133
41167
  {
41134
41168
  className: `blade-chat-context-card group/context-card overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-sm ${className ?? ""}`,
41135
41169
  children: [
41136
- /* @__PURE__ */ jsxs33("summary", { className: "blade-chat-context-summary flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 [&::-webkit-details-marker]:hidden", children: [
41170
+ /* @__PURE__ */ jsxs32("summary", { className: "blade-chat-context-summary flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 [&::-webkit-details-marker]:hidden", children: [
41137
41171
  /* @__PURE__ */ jsx38(
41138
41172
  Layers,
41139
41173
  {
@@ -41142,7 +41176,7 @@ function ContextCard({ context, className }) {
41142
41176
  "aria-hidden": "true"
41143
41177
  }
41144
41178
  ),
41145
- /* @__PURE__ */ jsxs33("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
41179
+ /* @__PURE__ */ jsxs32("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
41146
41180
  /* @__PURE__ */ jsx38("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: display.title }),
41147
41181
  /* @__PURE__ */ jsx38("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: display.summary })
41148
41182
  ] }),
@@ -41164,8 +41198,8 @@ function ContextGroupCard({ contexts, className }) {
41164
41198
  if (contexts.length === 0) return null;
41165
41199
  const single = contexts.length === 1 ? getContextDisplayState(contexts[0]) : null;
41166
41200
  const group = single ? null : getContextGroupDisplayState(contexts);
41167
- return /* @__PURE__ */ jsxs33("details", { className: `blade-chat-context-card group/context-group overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-sm ${className ?? ""}`, children: [
41168
- /* @__PURE__ */ jsxs33("summary", { className: "blade-chat-context-summary flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 [&::-webkit-details-marker]:hidden", children: [
41201
+ return /* @__PURE__ */ jsxs32("details", { className: `blade-chat-context-card group/context-group overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-sm ${className ?? ""}`, children: [
41202
+ /* @__PURE__ */ jsxs32("summary", { className: "blade-chat-context-summary flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 [&::-webkit-details-marker]:hidden", children: [
41169
41203
  /* @__PURE__ */ jsx38(
41170
41204
  Layers,
41171
41205
  {
@@ -41174,7 +41208,7 @@ function ContextGroupCard({ contexts, className }) {
41174
41208
  "aria-hidden": "true"
41175
41209
  }
41176
41210
  ),
41177
- /* @__PURE__ */ jsxs33("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
41211
+ /* @__PURE__ */ jsxs32("span", { className: "blade-chat-context-copy min-w-0 flex-1", children: [
41178
41212
  /* @__PURE__ */ jsx38("span", { className: "blade-chat-context-title block font-medium text-[hsl(var(--foreground))]", children: single ? single.title : `${group?.title} \xB7 ${group?.count} \u9879` }),
41179
41213
  /* @__PURE__ */ jsx38("span", { className: "blade-chat-context-status block truncate text-xs text-[hsl(var(--muted-foreground))]", children: single ? single.summary : group?.summary })
41180
41214
  ] }),
@@ -41199,7 +41233,7 @@ function ContextGroupCard({ contexts, className }) {
41199
41233
 
41200
41234
  // src/chat/ResultFeedback.tsx
41201
41235
  import { useCallback as useCallback7, useEffect as useEffect18, useRef as useRef17, useState as useState23 } from "react";
41202
- import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
41236
+ import { jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
41203
41237
  var REASONS = [
41204
41238
  { value: "not_solved", label: "\u6CA1\u89E3\u51B3\u95EE\u9898" },
41205
41239
  { value: "inaccurate", label: "\u5185\u5BB9\u4E0D\u51C6\u786E" },
@@ -41213,17 +41247,17 @@ function reasonLabel(reason) {
41213
41247
  }
41214
41248
  function HistoricalResultFeedback({ feedback }) {
41215
41249
  const label = reasonLabel(feedback.reason);
41216
- return /* @__PURE__ */ jsxs34(
41250
+ return /* @__PURE__ */ jsxs33(
41217
41251
  "section",
41218
41252
  {
41219
41253
  "aria-label": "\u5386\u53F2\u7ED3\u679C\u53CD\u9988",
41220
41254
  className: "w-fit max-w-full rounded-lg border border-[hsl(var(--border)/0.7)] bg-[hsl(var(--muted)/0.2)] px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]",
41221
41255
  children: [
41222
- /* @__PURE__ */ jsxs34("span", { children: [
41256
+ /* @__PURE__ */ jsxs33("span", { children: [
41223
41257
  "\u4F60\u5BF9\u6B64\u8F6E\u7ED3\u679C\u7684\u8BC4\u4EF7\uFF1A",
41224
41258
  feedback.helpful ? "\u6709\u5E2E\u52A9" : "\u6CA1\u5E2E\u52A9"
41225
41259
  ] }),
41226
- label ? /* @__PURE__ */ jsxs34("span", { children: [
41260
+ label ? /* @__PURE__ */ jsxs33("span", { children: [
41227
41261
  " \xB7 ",
41228
41262
  label
41229
41263
  ] }) : null
@@ -41298,14 +41332,14 @@ function ResultFeedback({
41298
41332
  [client, emit, followup.assistant_entry_id, onSaved, sessionId]
41299
41333
  );
41300
41334
  if (!visible) return null;
41301
- return /* @__PURE__ */ jsxs34(
41335
+ return /* @__PURE__ */ jsxs33(
41302
41336
  "section",
41303
41337
  {
41304
41338
  "aria-label": "\u7ED3\u679C\u53CD\u9988",
41305
41339
  className: "flex flex-col gap-2 border-t border-[hsl(var(--border)/0.7)] pt-3",
41306
41340
  children: [
41307
41341
  /* @__PURE__ */ jsx39("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u76EE\u524D\u7684\u6574\u4F53\u7ED3\u679C\u6709\u5E2E\u52A9\u5417\uFF1F" }),
41308
- /* @__PURE__ */ jsxs34("div", { className: "flex flex-wrap gap-1.5", children: [
41342
+ /* @__PURE__ */ jsxs33("div", { className: "flex flex-wrap gap-1.5", children: [
41309
41343
  /* @__PURE__ */ jsx39(
41310
41344
  "button",
41311
41345
  {
@@ -41341,7 +41375,7 @@ function ResultFeedback({
41341
41375
  },
41342
41376
  reason.value
41343
41377
  )) }) : null,
41344
- saveError ? /* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--destructive))]", children: [
41378
+ saveError ? /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--destructive))]", children: [
41345
41379
  /* @__PURE__ */ jsx39("span", { children: "\u53CD\u9988\u6682\u672A\u4FDD\u5B58\uFF0C\u53EF\u91CD\u8BD5" }),
41346
41380
  /* @__PURE__ */ jsx39(
41347
41381
  "button",
@@ -41362,7 +41396,7 @@ function ResultFeedback({
41362
41396
  }
41363
41397
 
41364
41398
  // src/chat/LiteMessageList.tsx
41365
- import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
41399
+ import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
41366
41400
  var LITE_LOADING_INDICATOR_HEIGHT = 38;
41367
41401
  function messageText(message) {
41368
41402
  return getTextContent3(normalizeMessageContent2(message.content)).trim();
@@ -41649,7 +41683,7 @@ function LiteMessageList({
41649
41683
  },
41650
41684
  []
41651
41685
  );
41652
- return /* @__PURE__ */ jsxs35(
41686
+ return /* @__PURE__ */ jsxs34(
41653
41687
  "div",
41654
41688
  {
41655
41689
  ref: scrollRef,
@@ -41663,7 +41697,7 @@ function LiteMessageList({
41663
41697
  },
41664
41698
  className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-6 sm:px-8",
41665
41699
  children: [
41666
- rows.length === 0 ? /* @__PURE__ */ jsx40("div", { className: "grid min-h-full place-items-center text-sm text-[hsl(var(--muted-foreground))]", children: isLoadingHistory ? "\u6B63\u5728\u52A0\u8F7D\u6D88\u606F\u2026" : "\u5F00\u59CB\u65B0\u7684\u5BF9\u8BDD\u5427" }) : /* @__PURE__ */ jsxs35(
41700
+ rows.length === 0 ? /* @__PURE__ */ jsx40("div", { className: "grid min-h-full place-items-center text-sm text-[hsl(var(--muted-foreground))]", children: isLoadingHistory ? "\u6B63\u5728\u52A0\u8F7D\u6D88\u606F\u2026" : "\u5F00\u59CB\u65B0\u7684\u5BF9\u8BDD\u5427" }) : /* @__PURE__ */ jsxs34(
41667
41701
  "div",
41668
41702
  {
41669
41703
  className: "relative mx-auto w-full max-w-3xl",
@@ -41751,7 +41785,7 @@ function PlainTextMessage({
41751
41785
  if (row.role === "user") {
41752
41786
  return /* @__PURE__ */ jsx40("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx40("div", { className: "max-w-[82%] rounded-[18px] rounded-br-[6px] border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-4 py-3 text-sm leading-6 text-[hsl(var(--user-msg-fg))]", children: markdown }) });
41753
41787
  }
41754
- return /* @__PURE__ */ jsxs35(
41788
+ return /* @__PURE__ */ jsxs34(
41755
41789
  "div",
41756
41790
  {
41757
41791
  className: `break-words text-sm leading-6 ${row.role === "error" ? "text-[hsl(var(--destructive))]" : "text-[hsl(var(--foreground))]"}`,
@@ -41763,7 +41797,7 @@ function PlainTextMessage({
41763
41797
  );
41764
41798
  }
41765
41799
  function LiteLoadingIndicator() {
41766
- return /* @__PURE__ */ jsxs35("output", { className: "flex h-[38px] items-center gap-2 px-1 text-xs text-[hsl(var(--muted-foreground))]", "aria-live": "polite", children: [
41800
+ return /* @__PURE__ */ jsxs34("output", { className: "flex h-[38px] items-center gap-2 px-1 text-xs text-[hsl(var(--muted-foreground))]", "aria-live": "polite", children: [
41767
41801
  /* @__PURE__ */ jsx40(LoaderCircle, { size: 14, className: "animate-spin", "aria-hidden": "true" }),
41768
41802
  /* @__PURE__ */ jsx40("span", { children: "\u6B63\u5728\u751F\u6210\u4E2D\u2026" })
41769
41803
  ] });
@@ -41789,11 +41823,11 @@ function LiteFollowup({
41789
41823
  setDownloadingPath(null);
41790
41824
  }
41791
41825
  };
41792
- return /* @__PURE__ */ jsxs35("div", { className: "flex flex-col items-start gap-3", children: [
41793
- artifacts.length > 0 ? /* @__PURE__ */ jsxs35("div", { className: "flex w-full flex-col items-start gap-1.5", children: [
41826
+ return /* @__PURE__ */ jsxs34("div", { className: "flex flex-col items-start gap-3", children: [
41827
+ artifacts.length > 0 ? /* @__PURE__ */ jsxs34("div", { className: "flex w-full flex-col items-start gap-1.5", children: [
41794
41828
  /* @__PURE__ */ jsx40("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u672C\u8F6E\u6210\u679C" }),
41795
41829
  artifacts.map(
41796
- (artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */ jsxs35(
41830
+ (artifact, artifactIndex) => artifact.kind === "link" ? /* @__PURE__ */ jsxs34(
41797
41831
  "a",
41798
41832
  {
41799
41833
  href: artifact.target,
@@ -41806,7 +41840,7 @@ function LiteFollowup({
41806
41840
  ]
41807
41841
  },
41808
41842
  `${artifact.kind}:${artifactIndex}`
41809
- ) : /* @__PURE__ */ jsxs35(
41843
+ ) : /* @__PURE__ */ jsxs34(
41810
41844
  "button",
41811
41845
  {
41812
41846
  type: "button",
@@ -41826,9 +41860,9 @@ function LiteFollowup({
41826
41860
  )
41827
41861
  )
41828
41862
  ] }) : null,
41829
- followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs35("div", { className: "flex max-w-full flex-col items-start gap-1.5", children: [
41863
+ followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs34("div", { className: "flex max-w-full flex-col items-start gap-1.5", children: [
41830
41864
  /* @__PURE__ */ jsx40("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
41831
- followup.suggestions.map((suggestion) => /* @__PURE__ */ jsxs35(
41865
+ followup.suggestions.map((suggestion) => /* @__PURE__ */ jsxs34(
41832
41866
  "button",
41833
41867
  {
41834
41868
  type: "button",
@@ -45634,7 +45668,7 @@ function extractRefs(content3) {
45634
45668
  }
45635
45669
 
45636
45670
  // src/chat/plan/PlanSummaryCard.tsx
45637
- import { Fragment as Fragment15, jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
45671
+ import { Fragment as Fragment15, jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
45638
45672
  function PlanSummaryCard({
45639
45673
  messages,
45640
45674
  sessionStatus,
@@ -45649,8 +45683,8 @@ function PlanSummaryCard({
45649
45683
  const isWaitingForInput = sessionStatus === "waiting_for_input";
45650
45684
  const canConfirm = Boolean(onConfirmPlan) && isWaitingForInput && data.lastPauseTool === "ExitPlanMode";
45651
45685
  const openPlanPanel = openPlanPanelAction && sessionId ? () => openPlanPanelAction(sessionId) : void 0;
45652
- return /* @__PURE__ */ jsxs36("div", { className: "flex w-full flex-col gap-4 rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.55)] p-4", children: [
45653
- /* @__PURE__ */ jsxs36(
45686
+ return /* @__PURE__ */ jsxs35("div", { className: "flex w-full flex-col gap-4 rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card)/0.55)] p-4", children: [
45687
+ /* @__PURE__ */ jsxs35(
45654
45688
  "button",
45655
45689
  {
45656
45690
  type: "button",
@@ -45658,14 +45692,14 @@ function PlanSummaryCard({
45658
45692
  disabled: isHistorical || !openPlanPanel,
45659
45693
  className: "flex w-full flex-col gap-4 text-left transition-colors hover:text-[hsl(var(--foreground))]",
45660
45694
  children: [
45661
- /* @__PURE__ */ jsxs36("div", { className: "flex items-start justify-between gap-3", children: [
45662
- /* @__PURE__ */ jsxs36("div", { className: "min-w-0 space-y-2", children: [
45663
- /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
45695
+ /* @__PURE__ */ jsxs35("div", { className: "flex items-start justify-between gap-3", children: [
45696
+ /* @__PURE__ */ jsxs35("div", { className: "min-w-0 space-y-2", children: [
45697
+ /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
45664
45698
  /* @__PURE__ */ jsx41(Sparkles, { size: 12 }),
45665
45699
  /* @__PURE__ */ jsx41("span", { children: "\u89C4\u5212\u6458\u8981" })
45666
45700
  ] }),
45667
45701
  /* @__PURE__ */ jsx41("div", { className: "truncate text-base font-medium text-[hsl(var(--foreground))]", children: data.intent || "\u5F53\u524D\u89C4\u5212" }),
45668
- /* @__PURE__ */ jsx41("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: summaryState.kind === "progress" ? /* @__PURE__ */ jsxs36(Fragment15, { children: [
45702
+ /* @__PURE__ */ jsx41("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: summaryState.kind === "progress" ? /* @__PURE__ */ jsxs35(Fragment15, { children: [
45669
45703
  /* @__PURE__ */ jsx41("span", { className: "rounded-full bg-[hsl(var(--accent))] px-2.5 py-1 text-[hsl(var(--foreground))]", children: summaryState.label }),
45670
45704
  /* @__PURE__ */ jsx41("span", { className: "font-mono tracking-[0.25em] text-[hsl(var(--muted-foreground))]", children: summaryState.dots })
45671
45705
  ] }) : /* @__PURE__ */ jsx41(
@@ -45690,16 +45724,16 @@ function PlanSummaryCard({
45690
45724
  }
45691
45725
  )
45692
45726
  ] }),
45693
- summaryState.kind === "complete" && /* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
45694
- /* @__PURE__ */ jsxs36("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
45727
+ summaryState.kind === "complete" && /* @__PURE__ */ jsxs35("div", { className: "flex flex-wrap items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
45728
+ /* @__PURE__ */ jsxs35("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
45695
45729
  data.selectedSkills.length,
45696
45730
  " \u4E2A\u6280\u80FD"
45697
45731
  ] }),
45698
- /* @__PURE__ */ jsxs36("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
45732
+ /* @__PURE__ */ jsxs35("span", { className: "rounded-full border border-[hsl(var(--border))] px-2.5 py-1", children: [
45699
45733
  stepCount,
45700
45734
  " \u4E2A\u6B65\u9AA4"
45701
45735
  ] }),
45702
- !isHistorical && /* @__PURE__ */ jsxs36("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--muted-foreground))]", children: [
45736
+ !isHistorical && /* @__PURE__ */ jsxs35("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--muted-foreground))]", children: [
45703
45737
  /* @__PURE__ */ jsx41(CircleCheck, { size: 12 }),
45704
45738
  "\u53F3\u4FA7\u67E5\u770B\u8BE6\u60C5"
45705
45739
  ] })
@@ -45722,9 +45756,9 @@ function PlanConfirmationPanel({
45722
45756
  setRevisionText("");
45723
45757
  setIsEditing(false);
45724
45758
  };
45725
- return /* @__PURE__ */ jsxs36("div", { className: "space-y-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--background)/0.45)] p-3", children: [
45726
- /* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap gap-2", children: [
45727
- /* @__PURE__ */ jsxs36(
45759
+ return /* @__PURE__ */ jsxs35("div", { className: "space-y-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--background)/0.45)] p-3", children: [
45760
+ /* @__PURE__ */ jsxs35("div", { className: "flex flex-wrap gap-2", children: [
45761
+ /* @__PURE__ */ jsxs35(
45728
45762
  "button",
45729
45763
  {
45730
45764
  type: "button",
@@ -45736,7 +45770,7 @@ function PlanConfirmationPanel({
45736
45770
  ]
45737
45771
  }
45738
45772
  ),
45739
- /* @__PURE__ */ jsxs36(
45773
+ /* @__PURE__ */ jsxs35(
45740
45774
  "button",
45741
45775
  {
45742
45776
  type: "button",
@@ -45749,7 +45783,7 @@ function PlanConfirmationPanel({
45749
45783
  }
45750
45784
  )
45751
45785
  ] }),
45752
- isEditing && /* @__PURE__ */ jsxs36("div", { className: "space-y-2", children: [
45786
+ isEditing && /* @__PURE__ */ jsxs35("div", { className: "space-y-2", children: [
45753
45787
  /* @__PURE__ */ jsx41(
45754
45788
  "textarea",
45755
45789
  {
@@ -45877,7 +45911,7 @@ function extractPlanMessagesForTurn(messages, turnLastMessage) {
45877
45911
 
45878
45912
  // src/chat/CompactionCard.tsx
45879
45913
  import { useState as useState29 } from "react";
45880
- import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
45914
+ import { jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
45881
45915
  var PERCENT_FORMATTER = new Intl.NumberFormat("zh-CN", {
45882
45916
  style: "percent",
45883
45917
  maximumFractionDigits: 0
@@ -45938,9 +45972,9 @@ function CompactionCard({
45938
45972
  const hasSummary = typeof source.summary_full === "string" && source.summary_full.trim().length > 0 && !isGenericArchiveSummary(source.summary_full);
45939
45973
  const hasFailureReason = source.status === "failed" && Boolean(source.failure_reason);
45940
45974
  const canExpand = source.status === "completed" && (hasSummary || archivedToolCalls.length > 0) || hasFailureReason;
45941
- return /* @__PURE__ */ jsxs37("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
45942
- /* @__PURE__ */ jsxs37("div", { className: "flex items-center justify-between gap-2", children: [
45943
- /* @__PURE__ */ jsxs37(
45975
+ return /* @__PURE__ */ jsxs36("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
45976
+ /* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between gap-2", children: [
45977
+ /* @__PURE__ */ jsxs36(
45944
45978
  "button",
45945
45979
  {
45946
45980
  type: "button",
@@ -45952,13 +45986,13 @@ function CompactionCard({
45952
45986
  "aria-expanded": expanded,
45953
45987
  children: [
45954
45988
  canExpand ? expanded ? /* @__PURE__ */ jsx42(ChevronDown, { size: 12, className: "shrink-0" }) : /* @__PURE__ */ jsx42(ChevronRight, { size: 12, className: "shrink-0" }) : null,
45955
- /* @__PURE__ */ jsx42("span", { children: source.status === "streaming" ? /* @__PURE__ */ jsxs37("span", { className: "inline-flex items-center gap-1", children: [
45989
+ /* @__PURE__ */ jsx42("span", { children: source.status === "streaming" ? /* @__PURE__ */ jsxs36("span", { className: "inline-flex items-center gap-1", children: [
45956
45990
  /* @__PURE__ */ jsx42(LoaderCircle, { size: 12, className: "animate-spin" }),
45957
45991
  "\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587"
45958
- ] }) : source.status === "failed" ? /* @__PURE__ */ jsxs37("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-danger))]", children: [
45992
+ ] }) : source.status === "failed" ? /* @__PURE__ */ jsxs36("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-danger))]", children: [
45959
45993
  /* @__PURE__ */ jsx42(CircleX, { size: 12 }),
45960
45994
  "\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
45961
- ] }) : source.status === "interrupted" ? /* @__PURE__ */ jsxs37("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-warning))]", children: [
45995
+ ] }) : source.status === "interrupted" ? /* @__PURE__ */ jsxs36("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-warning))]", children: [
45962
45996
  /* @__PURE__ */ jsx42(Square, { size: 12 }),
45963
45997
  "\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88"
45964
45998
  ] }) : "\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29" })
@@ -45975,13 +46009,13 @@ function CompactionCard({
45975
46009
  }
45976
46010
  ) : null
45977
46011
  ] }),
45978
- expanded ? /* @__PURE__ */ jsxs37("div", { className: "mt-1 max-w-3xl rounded-lg border border-[hsl(var(--border))]/70 bg-[hsl(var(--card))]/80 px-3 py-2 text-[11px] leading-relaxed", children: [
45979
- /* @__PURE__ */ jsxs37("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[hsl(var(--muted-foreground))]", children: [
45980
- /* @__PURE__ */ jsxs37("span", { children: [
46012
+ expanded ? /* @__PURE__ */ jsxs36("div", { className: "mt-1 max-w-3xl rounded-lg border border-[hsl(var(--border))]/70 bg-[hsl(var(--card))]/80 px-3 py-2 text-[11px] leading-relaxed", children: [
46013
+ /* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[hsl(var(--muted-foreground))]", children: [
46014
+ /* @__PURE__ */ jsxs36("span", { children: [
45981
46015
  "#",
45982
46016
  shortId(source.compaction_id)
45983
46017
  ] }),
45984
- /* @__PURE__ */ jsxs37("span", { children: [
46018
+ /* @__PURE__ */ jsxs36("span", { children: [
45985
46019
  "\u8282\u7701 ",
45986
46020
  formatSavedRatio(source.saved_ratio),
45987
46021
  "\uFF08",
@@ -45991,7 +46025,7 @@ function CompactionCard({
45991
46025
  formatTokens(source.tokens_after),
45992
46026
  " token\uFF09"
45993
46027
  ] }),
45994
- /* @__PURE__ */ jsxs37("span", { children: [
46028
+ /* @__PURE__ */ jsxs36("span", { children: [
45995
46029
  "\u5F52\u6863 ",
45996
46030
  archivedCount,
45997
46031
  " \u4E2A\u5DE5\u5177\u7ED3\u679C"
@@ -45999,12 +46033,12 @@ function CompactionCard({
45999
46033
  ] }),
46000
46034
  archivedToolCalls.length > 0 ? /* @__PURE__ */ jsx42("div", { className: "mt-2 space-y-1.5", children: archivedToolCalls.map((item, index2) => {
46001
46035
  const archivePath = getArchivePath(item, archivedFiles);
46002
- return /* @__PURE__ */ jsxs37(
46036
+ return /* @__PURE__ */ jsxs36(
46003
46037
  "div",
46004
46038
  {
46005
46039
  className: "rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/35 px-2 py-1.5",
46006
46040
  children: [
46007
- /* @__PURE__ */ jsxs37("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-[hsl(var(--foreground))]", children: [
46041
+ /* @__PURE__ */ jsxs36("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-[hsl(var(--foreground))]", children: [
46008
46042
  /* @__PURE__ */ jsx42("span", { className: "font-medium", children: getArchivedToolLabel(item) }),
46009
46043
  item.tool_call_id ? /* @__PURE__ */ jsx42("span", { className: "font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: item.tool_call_id }) : null
46010
46044
  ] }),
@@ -46015,7 +46049,7 @@ function CompactionCard({
46015
46049
  );
46016
46050
  }) }) : null,
46017
46051
  hasSummary ? /* @__PURE__ */ jsx42("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,
46018
- source.status === "failed" && source.failure_reason ? /* @__PURE__ */ jsxs37("div", { className: "mt-2 text-[hsl(var(--swf-danger))]", children: [
46052
+ source.status === "failed" && source.failure_reason ? /* @__PURE__ */ jsxs36("div", { className: "mt-2 text-[hsl(var(--swf-danger))]", children: [
46019
46053
  "\u5931\u8D25\u539F\u56E0\uFF1A",
46020
46054
  source.failure_reason
46021
46055
  ] }) : null
@@ -46028,7 +46062,7 @@ import { useEffect as useEffect24, useRef as useRef24 } from "react";
46028
46062
 
46029
46063
  // src/chat/FinalArtifactCards.tsx
46030
46064
  import { useEffect as useEffect23, useRef as useRef23, useState as useState30 } from "react";
46031
- import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
46065
+ import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
46032
46066
  function basename2(path2) {
46033
46067
  return path2.split("/").filter(Boolean).pop() || path2;
46034
46068
  }
@@ -46049,7 +46083,7 @@ function LinkCard({
46049
46083
  const bladeHost = useBladeHost();
46050
46084
  const host = hostOf(url2);
46051
46085
  const local = isLoopbackUrl(url2) && Boolean(bladeHost.openPreview);
46052
- const content3 = /* @__PURE__ */ jsxs38(Fragment16, { children: [
46086
+ const content3 = /* @__PURE__ */ jsxs37(Fragment16, { children: [
46053
46087
  /* @__PURE__ */ jsx43("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-[hsl(var(--primary))]", children: /* @__PURE__ */ jsx43(Globe, { size: 15, "aria-hidden": "true" }) }),
46054
46088
  /* @__PURE__ */ jsx43("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx43("span", { className: "block truncate text-xs font-medium leading-5", children: label || host }) }),
46055
46089
  /* @__PURE__ */ jsx43(
@@ -46121,7 +46155,7 @@ function FinalArtifactCards({
46121
46155
  const columnCount = Math.min(artifacts.length, 3);
46122
46156
  const gridWidth = columnCount * 180 + Math.max(0, columnCount - 1) * 6;
46123
46157
  if (artifacts.length === 0) return null;
46124
- return /* @__PURE__ */ jsxs38("div", { className: "flex max-w-full flex-col gap-1.5", children: [
46158
+ return /* @__PURE__ */ jsxs37("div", { className: "flex max-w-full flex-col gap-1.5", children: [
46125
46159
  /* @__PURE__ */ jsx43(
46126
46160
  "div",
46127
46161
  {
@@ -46157,7 +46191,7 @@ function FinalArtifactCards({
46157
46191
  )
46158
46192
  }
46159
46193
  ),
46160
- hasMore ? /* @__PURE__ */ jsxs38(
46194
+ hasMore ? /* @__PURE__ */ jsxs37(
46161
46195
  "button",
46162
46196
  {
46163
46197
  type: "button",
@@ -46181,7 +46215,7 @@ function FinalArtifactCards({
46181
46215
  }
46182
46216
 
46183
46217
  // src/chat/PostChatFollowupBlock.tsx
46184
- import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
46218
+ import { jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
46185
46219
  function PostChatFollowupBlock({
46186
46220
  sessionId,
46187
46221
  followup,
@@ -46203,9 +46237,9 @@ function PostChatFollowupBlock({
46203
46237
  }, [assistantEntryId, emit, sessionId, suggestionCount]);
46204
46238
  if (!followup || !followup.recaption && followup.suggestions.length === 0 && artifacts.length === 0 && !followup.feedback_eligible)
46205
46239
  return null;
46206
- return /* @__PURE__ */ jsxs39("div", { part: "followup", className: "blade-chat-followup flex w-fit max-w-full flex-col gap-4 rounded-xl border border-[hsl(var(--border)/0.75)] bg-[hsl(var(--muted)/0.28)] px-3 py-3 sm:min-w-[340px] sm:max-w-[680px]", children: [
46207
- followup.recaption ? /* @__PURE__ */ jsxs39("section", { "aria-label": "\u672C\u8F6E\u5C0F\u7ED3", className: "flex flex-col gap-2", children: [
46208
- /* @__PURE__ */ jsxs39("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-[hsl(var(--muted-foreground))]", children: [
46240
+ return /* @__PURE__ */ jsxs38("div", { part: "followup", className: "blade-chat-followup flex w-fit max-w-full flex-col gap-4 rounded-xl border border-[hsl(var(--border)/0.75)] bg-[hsl(var(--muted)/0.28)] px-3 py-3 sm:min-w-[340px] sm:max-w-[680px]", children: [
46241
+ followup.recaption ? /* @__PURE__ */ jsxs38("section", { "aria-label": "\u672C\u8F6E\u5C0F\u7ED3", className: "flex flex-col gap-2", children: [
46242
+ /* @__PURE__ */ jsxs38("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-[hsl(var(--muted-foreground))]", children: [
46209
46243
  /* @__PURE__ */ jsx44(Sparkles, { size: 14, "aria-hidden": "true" }),
46210
46244
  "\u672C\u8F6E\u5C0F\u7ED3"
46211
46245
  ] }),
@@ -46227,9 +46261,9 @@ function PostChatFollowupBlock({
46227
46261
  assistantEntryId
46228
46262
  }
46229
46263
  ) }) : null,
46230
- followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs39("section", { className: "flex flex-col items-start gap-1.5", "aria-label": "\u4E0B\u4E00\u6B65\u5EFA\u8BAE", children: [
46264
+ followup.suggestions.length > 0 ? /* @__PURE__ */ jsxs38("section", { className: "flex flex-col items-start gap-1.5", "aria-label": "\u4E0B\u4E00\u6B65\u5EFA\u8BAE", children: [
46231
46265
  /* @__PURE__ */ jsx44("div", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "\u4E0B\u4E00\u6B65\u53EF\u4EE5" }),
46232
- /* @__PURE__ */ jsx44("div", { className: "grid w-fit max-w-full gap-1.5 sm:max-w-[680px]", children: followup.suggestions.map((suggestion, suggestionIndex) => /* @__PURE__ */ jsxs39(
46266
+ /* @__PURE__ */ jsx44("div", { className: "grid w-fit max-w-full gap-1.5 sm:max-w-[680px]", children: followup.suggestions.map((suggestion, suggestionIndex) => /* @__PURE__ */ jsxs38(
46233
46267
  "button",
46234
46268
  {
46235
46269
  type: "button",
@@ -46274,7 +46308,7 @@ function PostChatFollowupBlock({
46274
46308
 
46275
46309
  // src/chat/RenderErrorBoundary.tsx
46276
46310
  import { Component } from "react";
46277
- import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
46311
+ import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
46278
46312
  function getFirstComponentName(componentStack) {
46279
46313
  const match = componentStack.match(/\n\s+at\s+([^\s(]+)/);
46280
46314
  return match?.[1] ?? null;
@@ -46307,14 +46341,14 @@ var RenderErrorBoundary = class extends Component {
46307
46341
  return children;
46308
46342
  }
46309
46343
  const componentName = getFirstComponentName(componentStack);
46310
- return /* @__PURE__ */ jsx45("div", { className: "blade-chat-render-error rounded-xl border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-4 py-3 text-sm text-[hsl(var(--foreground))]", children: /* @__PURE__ */ jsxs40("div", { className: "flex items-start gap-2", children: [
46344
+ return /* @__PURE__ */ jsx45("div", { className: "blade-chat-render-error rounded-xl border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-4 py-3 text-sm text-[hsl(var(--foreground))]", children: /* @__PURE__ */ jsxs39("div", { className: "flex items-start gap-2", children: [
46311
46345
  /* @__PURE__ */ jsx45(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-[hsl(var(--swf-warning))]" }),
46312
- /* @__PURE__ */ jsxs40("div", { className: "min-w-0 flex-1", children: [
46313
- /* @__PURE__ */ jsxs40("div", { className: "font-medium", children: [
46346
+ /* @__PURE__ */ jsxs39("div", { className: "min-w-0 flex-1", children: [
46347
+ /* @__PURE__ */ jsxs39("div", { className: "font-medium", children: [
46314
46348
  label,
46315
46349
  "\u6E32\u67D3\u5931\u8D25"
46316
46350
  ] }),
46317
- /* @__PURE__ */ jsxs40("div", { className: "mt-1 break-words text-xs leading-5 text-[hsl(var(--secondary-foreground))]", children: [
46351
+ /* @__PURE__ */ jsxs39("div", { className: "mt-1 break-words text-xs leading-5 text-[hsl(var(--secondary-foreground))]", children: [
46318
46352
  componentName ? `\u7EC4\u4EF6\uFF1A${componentName}\u3002` : null,
46319
46353
  error61.message || "\u53D1\u751F\u4E86\u672A\u9884\u671F\u7684\u6E32\u67D3\u9519\u8BEF\u3002"
46320
46354
  ] }),
@@ -46326,7 +46360,7 @@ var RenderErrorBoundary = class extends Component {
46326
46360
 
46327
46361
  // src/chat/TurnNavRail.tsx
46328
46362
  import { useCallback as useCallback13, useEffect as useEffect25, useLayoutEffect as useLayoutEffect6, useRef as useRef25, useState as useState31 } from "react";
46329
- import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
46363
+ import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
46330
46364
  var PANEL_MAX_HEIGHT = 448;
46331
46365
  var PANEL_MARGIN = 16;
46332
46366
  function clippingAncestor(element2) {
@@ -46471,8 +46505,8 @@ function TurnNavRail({
46471
46505
  setPanelOpen(false);
46472
46506
  setHoveredTurnId(null);
46473
46507
  },
46474
- children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-end", children: [
46475
- /* @__PURE__ */ jsxs41(
46508
+ children: /* @__PURE__ */ jsxs40("div", { className: "flex flex-col items-end", children: [
46509
+ /* @__PURE__ */ jsxs40(
46476
46510
  "div",
46477
46511
  {
46478
46512
  ref: markerRef,
@@ -46520,7 +46554,7 @@ function TurnNavRail({
46520
46554
  ]
46521
46555
  }
46522
46556
  ),
46523
- error61 ? /* @__PURE__ */ jsxs41(
46557
+ error61 ? /* @__PURE__ */ jsxs40(
46524
46558
  "div",
46525
46559
  {
46526
46560
  role: "alert",
@@ -46630,7 +46664,7 @@ function calculateAnimatedScrollTop({
46630
46664
  }
46631
46665
 
46632
46666
  // src/chat/MessageList.tsx
46633
- import { Fragment as Fragment17, jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
46667
+ import { Fragment as Fragment17, jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
46634
46668
  function isReasoningRevealingForMessage(message, isRevealing, isStopping = false) {
46635
46669
  if (isStopping) return false;
46636
46670
  const hasContent = message?.content != null && message.content.length > 0;
@@ -47633,7 +47667,7 @@ function MessageListBody({
47633
47667
  stablePrefixEnd,
47634
47668
  virtualizer
47635
47669
  ]);
47636
- return /* @__PURE__ */ jsxs42(
47670
+ return /* @__PURE__ */ jsxs41(
47637
47671
  "div",
47638
47672
  {
47639
47673
  ref: containerRef,
@@ -47652,7 +47686,7 @@ function MessageListBody({
47652
47686
  failedTurnId: navFailedEntryId
47653
47687
  }
47654
47688
  ) : null,
47655
- /* @__PURE__ */ jsxs42(
47689
+ /* @__PURE__ */ jsxs41(
47656
47690
  StickToBottom,
47657
47691
  {
47658
47692
  contextRef: stickContextRef,
@@ -47661,7 +47695,7 @@ function MessageListBody({
47661
47695
  resize: stickyTurn ? { damping: 0.8, stiffness: 0.08, mass: 1 } : "instant",
47662
47696
  targetScrollTop: shouldAnchorEntry ? getAnchorTargetScrollTop : void 0,
47663
47697
  children: [
47664
- /* @__PURE__ */ jsxs42(
47698
+ /* @__PURE__ */ jsxs41(
47665
47699
  StickToBottom.Content,
47666
47700
  {
47667
47701
  part: "messages-scroll",
@@ -47820,7 +47854,7 @@ function MessageListContent({
47820
47854
  const isHistoricalPlan = globalBlockIndex !== latestPlanCardBlockIndex;
47821
47855
  const blockFeedback = displayMessages.map((message) => message.entry_id && resultFeedbackByEntry.get(message.entry_id)).find((feedback) => feedback != null);
47822
47856
  const isActiveFollowup = block.anchorId === followupTurnId;
47823
- return /* @__PURE__ */ jsxs42(
47857
+ return /* @__PURE__ */ jsxs41(
47824
47858
  "div",
47825
47859
  {
47826
47860
  ref: getTurnElementRef(block.anchorId),
@@ -47921,7 +47955,7 @@ function MessageListContent({
47921
47955
  const renderMeasuredRow = (block, globalBlockIndex, virtualItem) => {
47922
47956
  const persistentId = getRenderBlockPersistentId(block);
47923
47957
  const isVirtual = virtualItem !== void 0;
47924
- return /* @__PURE__ */ jsxs42(
47958
+ return /* @__PURE__ */ jsxs41(
47925
47959
  "div",
47926
47960
  {
47927
47961
  ref: getMeasuredRowRef(block, globalBlockIndex, isVirtual),
@@ -47952,8 +47986,8 @@ function MessageListContent({
47952
47986
  {
47953
47987
  part: "messages-content",
47954
47988
  className: `blade-chat-messages-content mx-auto max-w-[748px] ${customization?.classNames?.messageListContent ?? ""}`,
47955
- children: /* @__PURE__ */ jsxs42("div", { className: `min-w-0 flex flex-col gap-9 ${customization?.classNames?.messageListInner ?? ""}`, children: [
47956
- renderBlocks.length === 0 && isLoadingHistory ? /* @__PURE__ */ jsx47(HistoryLoadingPlaceholder, {}) : renderBlocks.length === 0 ? emptyState ? emptyState : customization?.components?.EmptyState ? /* @__PURE__ */ jsx47(customization.components.EmptyState, {}) : /* @__PURE__ */ jsxs42(
47989
+ children: /* @__PURE__ */ jsxs41("div", { className: `min-w-0 flex flex-col gap-9 ${customization?.classNames?.messageListInner ?? ""}`, children: [
47990
+ renderBlocks.length === 0 && isLoadingHistory ? /* @__PURE__ */ jsx47(HistoryLoadingPlaceholder, {}) : renderBlocks.length === 0 ? emptyState ? emptyState : customization?.components?.EmptyState ? /* @__PURE__ */ jsx47(customization.components.EmptyState, {}) : /* @__PURE__ */ jsxs41(
47957
47991
  "div",
47958
47992
  {
47959
47993
  part: "empty",
@@ -47964,7 +47998,7 @@ function MessageListContent({
47964
47998
  /* @__PURE__ */ jsx47("span", { className: "text-sm opacity-60", children: "\u5728\u4E0B\u65B9\u8F93\u5165\u6D88\u606F\u5F00\u59CB\u804A\u5929" })
47965
47999
  ]
47966
48000
  }
47967
- ) : /* @__PURE__ */ jsxs42(Fragment17, { children: [
48001
+ ) : /* @__PURE__ */ jsxs41(Fragment17, { children: [
47968
48002
  stablePrefixEnd > 0 ? /* @__PURE__ */ jsx47(
47969
48003
  "div",
47970
48004
  {
@@ -47988,14 +48022,14 @@ function MessageListContent({
47988
48022
  );
47989
48023
  }
47990
48024
  function HistoryLoadingPlaceholder() {
47991
- return /* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-9", "aria-busy": "true", "aria-live": "polite", children: [
47992
- /* @__PURE__ */ jsxs42("div", { className: "flex items-center justify-center gap-2 text-sm text-[hsl(var(--muted-foreground))]", children: [
48025
+ return /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-9", "aria-busy": "true", "aria-live": "polite", children: [
48026
+ /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-center gap-2 text-sm text-[hsl(var(--muted-foreground))]", children: [
47993
48027
  /* @__PURE__ */ jsx47("span", { className: "size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }),
47994
48028
  /* @__PURE__ */ jsx47("span", { children: "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD\u8BB0\u5F55\u2026" })
47995
48029
  ] }),
47996
- [0, 1].map((index2) => /* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-4", children: [
48030
+ [0, 1].map((index2) => /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-4", children: [
47997
48031
  /* @__PURE__ */ jsx47("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx47("div", { className: "h-10 w-2/5 animate-pulse rounded-2xl bg-[hsl(var(--muted))]" }) }),
47998
- /* @__PURE__ */ jsxs42("div", { className: "flex flex-col gap-2.5", children: [
48032
+ /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-2.5", children: [
47999
48033
  /* @__PURE__ */ jsx47("div", { className: "h-4 w-1/3 animate-pulse rounded bg-[hsl(var(--muted))]" }),
48000
48034
  /* @__PURE__ */ jsx47("div", { className: "h-4 w-4/5 animate-pulse rounded bg-[hsl(var(--muted))]" }),
48001
48035
  /* @__PURE__ */ jsx47("div", { className: "h-4 w-3/5 animate-pulse rounded bg-[hsl(var(--muted))]" })
@@ -48006,7 +48040,7 @@ function HistoryLoadingPlaceholder() {
48006
48040
  function ScrollToBottomButton({ onBeforeScroll }) {
48007
48041
  const { isAtBottom, scrollToBottom } = useStickToBottomContext();
48008
48042
  if (isAtBottom) return null;
48009
- return /* @__PURE__ */ jsxs42(
48043
+ return /* @__PURE__ */ jsxs41(
48010
48044
  "button",
48011
48045
  {
48012
48046
  type: "button",
@@ -48026,9 +48060,9 @@ function ScrollToBottomButton({ onBeforeScroll }) {
48026
48060
  }
48027
48061
  function PlanningDivider({ kind }) {
48028
48062
  const isEnter = kind === "enter";
48029
- return /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-3 py-1", children: [
48063
+ return /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-3 py-1", children: [
48030
48064
  /* @__PURE__ */ jsx47("div", { className: "h-px flex-1 bg-gradient-to-r from-transparent via-amber-400/40 to-transparent" }),
48031
- /* @__PURE__ */ jsxs42("div", { className: "inline-flex items-center gap-1.5 rounded-full border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-3 py-1 text-[11px] text-[hsl(var(--swf-warning))]", children: [
48065
+ /* @__PURE__ */ jsxs41("div", { className: "inline-flex items-center gap-1.5 rounded-full border border-[hsl(var(--swf-warning)/0.3)] bg-[hsl(var(--swf-warning-soft))] px-3 py-1 text-[11px] text-[hsl(var(--swf-warning))]", children: [
48032
48066
  /* @__PURE__ */ jsx47(Lightbulb, { size: 12 }),
48033
48067
  /* @__PURE__ */ jsx47("span", { children: isEnter ? "\u8FDB\u5165\u89C4\u5212\u6A21\u5F0F" : "\u89C4\u5212\u5B8C\u6210" })
48034
48068
  ] }),
@@ -48204,7 +48238,7 @@ function SessionReplayBar({
48204
48238
  }
48205
48239
 
48206
48240
  // src/chat/ChatPanel.tsx
48207
- import { Fragment as Fragment18, jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
48241
+ import { Fragment as Fragment18, jsx as jsx49, jsxs as jsxs42 } from "react/jsx-runtime";
48208
48242
  function nextQueuedOrder(items, itemId, delta) {
48209
48243
  const pending = items.filter((item) => item.status === "pending");
48210
48244
  const index2 = pending.findIndex((item) => item.id === itemId);
@@ -48364,7 +48398,6 @@ function ChatPanel({
48364
48398
  thinkingOverride: options?.thinkingOverride,
48365
48399
  reasoningLevel: options?.reasoningLevel,
48366
48400
  refs: options?.refs,
48367
- kbIds: options?.kbIds,
48368
48401
  topicAssetRefs: options?.topicAssetRefs,
48369
48402
  queueWhenRunning: options?.queueWhenRunning
48370
48403
  });
@@ -48458,14 +48491,14 @@ function ChatPanel({
48458
48491
  initialDraftKey,
48459
48492
  lite
48460
48493
  };
48461
- return /* @__PURE__ */ jsx49(CurrentChatSessionProvider, { sessionId: sessionId || null, children: /* @__PURE__ */ jsx49(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsx49(FollowupInteractionProvider, { value: onFollowupInteraction, children: /* @__PURE__ */ jsx49(McpAppMessageContext.Provider, { value: handleMcpAppMessage, children: /* @__PURE__ */ jsxs43(
48494
+ return /* @__PURE__ */ jsx49(CurrentChatSessionProvider, { sessionId: sessionId || null, children: /* @__PURE__ */ jsx49(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsx49(FollowupInteractionProvider, { value: onFollowupInteraction, children: /* @__PURE__ */ jsx49(McpAppMessageContext.Provider, { value: handleMcpAppMessage, children: /* @__PURE__ */ jsxs42(
48462
48495
  "div",
48463
48496
  {
48464
48497
  "data-theme": theme,
48465
48498
  part: "root",
48466
48499
  className: cn("blade-chat flex min-h-0 flex-1 flex-col overflow-hidden", classNames?.root),
48467
48500
  children: [
48468
- isViewer && /* @__PURE__ */ jsxs43(
48501
+ isViewer && /* @__PURE__ */ jsxs42(
48469
48502
  "div",
48470
48503
  {
48471
48504
  className: cn(
@@ -48481,7 +48514,7 @@ function ChatPanel({
48481
48514
  !isViewer && /* @__PURE__ */ jsx49(ConnectionBanner, { connection }),
48482
48515
  banner,
48483
48516
  /* @__PURE__ */ jsx49(SessionReplayBar, { sessionId, onExit: onExitReplay }),
48484
- errorMessage && /* @__PURE__ */ jsxs43(
48517
+ errorMessage && /* @__PURE__ */ jsxs42(
48485
48518
  "div",
48486
48519
  {
48487
48520
  part: "error-bar",
@@ -48564,7 +48597,7 @@ function ChatPanel({
48564
48597
  className: cn("mx-auto w-full max-w-3xl px-5 pb-3", classNames?.chatInputInner)
48565
48598
  }
48566
48599
  ) : null,
48567
- !isViewer && /* @__PURE__ */ jsxs43(Fragment18, { children: [
48600
+ !isViewer && /* @__PURE__ */ jsxs42(Fragment18, { children: [
48568
48601
  /* @__PURE__ */ jsx49(
48569
48602
  SessionQueuePanel,
48570
48603
  {
@@ -48596,13 +48629,13 @@ function ChatPanel({
48596
48629
 
48597
48630
  // src/components/SessionPluginSelector.tsx
48598
48631
  import { useEffect as useEffect29, useState as useState35 } from "react";
48599
- import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
48632
+ import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
48600
48633
  function SessionPluginSelector(props) {
48601
48634
  return /* @__PURE__ */ jsx50(PluginSelectorState, { ...props }, props.sessionId);
48602
48635
  }
48603
48636
  function PluginSelectorState({ client, sessionId, className, side = "bottom", onChange }) {
48604
48637
  const [open2, setOpen] = useState35(false);
48605
- return /* @__PURE__ */ jsxs44("div", { className: `relative text-xs ${className ?? ""}`, children: [
48638
+ return /* @__PURE__ */ jsxs43("div", { className: `relative text-xs ${className ?? ""}`, children: [
48606
48639
  /* @__PURE__ */ jsx50(
48607
48640
  "button",
48608
48641
  {
@@ -48628,7 +48661,7 @@ function PluginSelectorList({
48628
48661
  useEffect29(() => {
48629
48662
  reload();
48630
48663
  }, [reload]);
48631
- return /* @__PURE__ */ jsxs44(
48664
+ return /* @__PURE__ */ jsxs43(
48632
48665
  "div",
48633
48666
  {
48634
48667
  className: `absolute left-0 z-40 my-2 max-h-72 w-72 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-3 text-[hsl(var(--popover-foreground))] shadow-lg ${side === "top" ? "bottom-full" : "top-full"}`,
@@ -48658,7 +48691,7 @@ function PluginSelectorList({
48658
48691
  }
48659
48692
 
48660
48693
  // src/components/AgentChat.tsx
48661
- import { Fragment as Fragment19, jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
48694
+ import { Fragment as Fragment19, jsx as jsx51, jsxs as jsxs44 } from "react/jsx-runtime";
48662
48695
  function isUnauthorizedError(error61) {
48663
48696
  return error61 instanceof BladeApiError2 && error61.status === 401;
48664
48697
  }
@@ -48677,7 +48710,7 @@ function LoginCard({ client, onLoggedIn }) {
48677
48710
  setLoggingIn(false);
48678
48711
  }
48679
48712
  };
48680
- return /* @__PURE__ */ jsx51("div", { className: "blade-chat-login flex flex-1 items-center justify-center p-6", children: /* @__PURE__ */ jsxs45("div", { className: "flex w-full max-w-sm flex-col items-center gap-4 rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-6 py-8 text-center", children: [
48713
+ return /* @__PURE__ */ jsx51("div", { className: "blade-chat-login flex flex-1 items-center justify-center p-6", children: /* @__PURE__ */ jsxs44("div", { className: "flex w-full max-w-sm flex-col items-center gap-4 rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-6 py-8 text-center", children: [
48681
48714
  /* @__PURE__ */ jsx51(LockKeyhole, { size: 28, className: "text-[hsl(var(--muted-foreground))]" }),
48682
48715
  /* @__PURE__ */ jsx51("div", { className: "text-base font-medium text-[hsl(var(--foreground))]", children: "\u9700\u8981\u767B\u5F55\u540E\u4F7F\u7528" }),
48683
48716
  /* @__PURE__ */ jsx51("div", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: "\u767B\u5F55\u540E\u5373\u53EF\u4E0E\u667A\u80FD\u4F53\u5BF9\u8BDD\uFF0C\u4F60\u7684\u4F1A\u8BDD\u5185\u5BB9\u4EC5\u81EA\u5DF1\u53EF\u89C1\u3002" }),
@@ -48799,7 +48832,7 @@ function ChatSessionView({
48799
48832
  onFollowupInteraction,
48800
48833
  errorMessage: connectError ?? replay.error?.message ?? notice,
48801
48834
  onExitReplay: () => void replay.exitToAutonomous(),
48802
- banner: /* @__PURE__ */ jsxs45(Fragment19, { children: [
48835
+ banner: /* @__PURE__ */ jsxs44(Fragment19, { children: [
48803
48836
  resolvedSessionId && !isViewer && (sessionPluginControls ? sessionPluginControls(resolvedSessionId) : /* @__PURE__ */ jsx51(SessionPluginSelector, { client, sessionId: resolvedSessionId })),
48804
48837
  /* @__PURE__ */ jsx51(ReplayMismatchPrompt, { mismatch: replay.mismatch })
48805
48838
  ] })
@@ -49169,7 +49202,7 @@ function toToolCallInfo(call, results, failedToolIds) {
49169
49202
 
49170
49203
  // src/components/LlmAdvancedSettings.tsx
49171
49204
  import { useState as useState38 } from "react";
49172
- import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
49205
+ import { jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
49173
49206
  var FIELDS = [
49174
49207
  { id: "baseURL", label: "\u6A21\u578B\u670D\u52A1\u5730\u5740", placeholder: "http://\u5185\u7F51\u5730\u5740/v1" },
49175
49208
  { id: "model", label: "\u6A21\u578B", placeholder: "\u6A21\u578B\u540D\u79F0" },
@@ -49220,8 +49253,8 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
49220
49253
  if (!normalized) return null;
49221
49254
  const fields = FIELDS.filter((field) => normalized[field.id]);
49222
49255
  const dirty = Object.keys(override).length > 0;
49223
- return /* @__PURE__ */ jsxs46("div", { className: "blade-chat-advanced border-t border-[hsl(var(--border))] px-4 py-2 text-xs", children: [
49224
- /* @__PURE__ */ jsxs46(
49256
+ return /* @__PURE__ */ jsxs45("div", { className: "blade-chat-advanced border-t border-[hsl(var(--border))] px-4 py-2 text-xs", children: [
49257
+ /* @__PURE__ */ jsxs45(
49225
49258
  "button",
49226
49259
  {
49227
49260
  type: "button",
@@ -49237,8 +49270,8 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
49237
49270
  ]
49238
49271
  }
49239
49272
  ),
49240
- open2 && /* @__PURE__ */ jsxs46("div", { className: "mt-2 flex flex-col gap-2", children: [
49241
- fields.map((field) => /* @__PURE__ */ jsxs46("label", { className: "flex flex-col gap-1", children: [
49273
+ open2 && /* @__PURE__ */ jsxs45("div", { className: "mt-2 flex flex-col gap-2", children: [
49274
+ fields.map((field) => /* @__PURE__ */ jsxs45("label", { className: "flex flex-col gap-1", children: [
49242
49275
  /* @__PURE__ */ jsx52("span", { className: "text-[hsl(var(--muted-foreground))]", children: field.label }),
49243
49276
  /* @__PURE__ */ jsx52(
49244
49277
  "input",
@@ -49252,7 +49285,7 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
49252
49285
  )
49253
49286
  ] }, field.id)),
49254
49287
  normalized.apiKey && /* @__PURE__ */ jsx52("p", { className: "text-[hsl(var(--muted-foreground))]", children: "\u5BC6\u94A5\u4F1A\u5B58\u5728\u8FD9\u53F0\u6D4F\u89C8\u5668\u91CC\u3002\u53EA\u5728\u4F60\u4FE1\u5F97\u8FC7\u8FD9\u53F0\u673A\u5668\u65F6\u586B\u3002" }),
49255
- /* @__PURE__ */ jsxs46("div", { className: "flex gap-2", children: [
49288
+ /* @__PURE__ */ jsxs45("div", { className: "flex gap-2", children: [
49256
49289
  /* @__PURE__ */ jsx52(
49257
49290
  "button",
49258
49291
  {
@@ -49287,7 +49320,7 @@ function LlmAdvancedSettingsBar({ settings, defaults, override, onChange }) {
49287
49320
  }
49288
49321
 
49289
49322
  // src/components/LlmChat.tsx
49290
- import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
49323
+ import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
49291
49324
  function LlmChat({
49292
49325
  classNames,
49293
49326
  renderers,
@@ -49319,14 +49352,14 @@ ${text4}` : text4),
49319
49352
  onReady?.(handle);
49320
49353
  }, [handle, onReady]);
49321
49354
  const customization = useMemo20(() => ({ classNames, renderers }), [classNames, renderers]);
49322
- return /* @__PURE__ */ jsx53(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsxs47(
49355
+ return /* @__PURE__ */ jsx53(ChatCustomizationProvider, { value: customization, children: /* @__PURE__ */ jsxs46(
49323
49356
  "div",
49324
49357
  {
49325
49358
  "data-theme": theme,
49326
49359
  part: "root",
49327
49360
  className: cn("blade-chat flex min-h-0 flex-1 flex-col overflow-hidden", classNames?.root),
49328
49361
  children: [
49329
- error61 ? /* @__PURE__ */ jsxs47(
49362
+ error61 ? /* @__PURE__ */ jsxs46(
49330
49363
  "div",
49331
49364
  {
49332
49365
  part: "error-bar",
@@ -49417,7 +49450,7 @@ function ChatView(props) {
49417
49450
 
49418
49451
  // src/components/TopicAssetSubmitDialog.tsx
49419
49452
  import { useRef as useRef30, useState as useState40 } from "react";
49420
- import { jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
49453
+ import { jsx as jsx55, jsxs as jsxs47 } from "react/jsx-runtime";
49421
49454
  function useTopicAssetSubmissionAccess(sessionId) {
49422
49455
  const client = useBladeClient();
49423
49456
  return useAsyncValue(sessionId, async (signal) => {
@@ -49475,32 +49508,32 @@ function TopicAssetSubmitDialog({ sessionId, topicId, path: path2, onClose, onSu
49475
49508
  };
49476
49509
  return /* @__PURE__ */ jsx55(Dialog, { open: true, onOpenChange: (open2) => {
49477
49510
  if (!open2 && !busy) onClose();
49478
- }, children: /* @__PURE__ */ jsxs48(DialogContent, { className: "max-w-md", children: [
49511
+ }, children: /* @__PURE__ */ jsxs47(DialogContent, { className: "max-w-md", children: [
49479
49512
  /* @__PURE__ */ jsx55(DialogTitle, { children: "\u63D0\u4EA4\u5230\u8D44\u4EA7" }),
49480
49513
  /* @__PURE__ */ jsx55(DialogDescription, { children: "\u5C06\u6587\u4EF6\u590D\u5236\u5230\u4E3B\u9898\u4F9B\u6210\u5458\u4F7F\u7528\uFF0C\u5DE5\u4F5C\u533A\u539F\u6587\u4EF6\u4F1A\u4FDD\u7559\u3002\u540C\u540D\u8D44\u4EA7\u4F1A\u88AB\u66FF\u6362\u3002" }),
49481
- /* @__PURE__ */ jsxs48("form", { onSubmit: (event) => {
49514
+ /* @__PURE__ */ jsxs47("form", { onSubmit: (event) => {
49482
49515
  event.preventDefault();
49483
49516
  void submit();
49484
49517
  }, className: "flex flex-col gap-4", children: [
49485
49518
  /* @__PURE__ */ jsx55("p", { className: "break-all text-sm text-secondary-foreground", children: path2 }),
49486
- /* @__PURE__ */ jsxs48("label", { className: "flex flex-col gap-1 text-sm", children: [
49519
+ /* @__PURE__ */ jsxs47("label", { className: "flex flex-col gap-1 text-sm", children: [
49487
49520
  "\u76EE\u6807\u6587\u4EF6\u5939",
49488
- /* @__PURE__ */ jsxs48("select", { "aria-label": "\u76EE\u6807\u6587\u4EF6\u5939", value: folder, onChange: (event) => setFolder(event.target.value), disabled: busy || !assets.data, className: "rounded-md border border-border bg-background p-2", children: [
49521
+ /* @__PURE__ */ jsxs47("select", { "aria-label": "\u76EE\u6807\u6587\u4EF6\u5939", value: folder, onChange: (event) => setFolder(event.target.value), disabled: busy || !assets.data, className: "rounded-md border border-border bg-background p-2", children: [
49489
49522
  /* @__PURE__ */ jsx55("option", { value: "", children: "\u8D44\u4EA7\u6839\u76EE\u5F55" }),
49490
49523
  assets.data?.map((item) => /* @__PURE__ */ jsx55("option", { value: item, children: item }, item))
49491
49524
  ] })
49492
49525
  ] }),
49493
- /* @__PURE__ */ jsxs48("label", { className: "flex flex-col gap-1 text-sm", children: [
49526
+ /* @__PURE__ */ jsxs47("label", { className: "flex flex-col gap-1 text-sm", children: [
49494
49527
  "\u8BF4\u660E\uFF08\u53EF\u9009\uFF09",
49495
49528
  /* @__PURE__ */ jsx55("textarea", { "aria-label": "\u63D0\u4EA4\u8BF4\u660E", value: message, onChange: (event) => setMessage(event.target.value), maxLength: 1e3, disabled: busy, className: "min-h-20 rounded-md border border-border bg-background p-2" })
49496
49529
  ] }),
49497
- assets.error ? /* @__PURE__ */ jsxs48("div", { role: "alert", className: "text-sm text-muted-foreground", children: [
49530
+ assets.error ? /* @__PURE__ */ jsxs47("div", { role: "alert", className: "text-sm text-muted-foreground", children: [
49498
49531
  assets.error instanceof Error ? assets.error.message : "\u8D44\u4EA7\u52A0\u8F7D\u5931\u8D25",
49499
49532
  " ",
49500
49533
  /* @__PURE__ */ jsx55("button", { type: "button", onClick: () => setRevision((n2) => n2 + 1), className: "underline", children: "\u91CD\u8BD5" })
49501
49534
  ] }) : !assets.data ? /* @__PURE__ */ jsx55("output", { className: "text-sm text-muted-foreground", children: "\u6B63\u5728\u52A0\u8F7D\u8D44\u4EA7\u2026" }) : null,
49502
49535
  error61 ? /* @__PURE__ */ jsx55("p", { role: "alert", className: "text-sm text-muted-foreground", children: error61 }) : null,
49503
- /* @__PURE__ */ jsxs48("div", { className: "flex justify-end gap-2", children: [
49536
+ /* @__PURE__ */ jsxs47("div", { className: "flex justify-end gap-2", children: [
49504
49537
  /* @__PURE__ */ jsx55("button", { type: "button", disabled: busy, onClick: onClose, className: "rounded-md border border-border px-3 py-2 text-sm", children: "\u53D6\u6D88" }),
49505
49538
  /* @__PURE__ */ jsx55("button", { type: "submit", disabled: busy || !assets.data, className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground disabled:opacity-50", children: busy ? "\u63D0\u4EA4\u4E2D\u2026" : "\u63D0\u4EA4" })
49506
49539
  ] })
@@ -49559,4 +49592,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
49559
49592
  js-yaml/dist/js-yaml.mjs:
49560
49593
  (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
49561
49594
  */
49562
- //# sourceMappingURL=chunk-XJLFFRQP.js.map
49595
+ //# sourceMappingURL=chunk-67GHJQK5.js.map