@blade-hq/agent-react 2612.0.0-beta.98 → 2612.0.0-beta.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +3 -2
  2. package/dist/McpAppCard-ADVDKC2C.js +171 -0
  3. package/dist/McpAppCard-ADVDKC2C.js.map +1 -0
  4. package/dist/McpAppFrame-VEOUJL5E.js +9 -0
  5. package/dist/PlanGraph-3D5PCSIJ.js +189 -0
  6. package/dist/PlanGraph-3D5PCSIJ.js.map +1 -0
  7. package/dist/{chunk-FTBMG7TK.js → SessionPluginConfigForm-DWVDFK6A.js} +2 -3
  8. package/dist/chat/AskUserQuestionBlock.d.ts +2 -1
  9. package/dist/chat/ChatPanel.d.ts +3 -1
  10. package/dist/chat/CurrentPlanPanel.d.ts +2 -1
  11. package/dist/chat/LightComposer.d.ts +1 -1
  12. package/dist/chat/LiteMessageList.d.ts +9 -0
  13. package/dist/chat/RelatedWork.d.ts +24 -0
  14. package/dist/chat/index.d.ts +1 -0
  15. package/dist/chat/plan/PlanGraph.d.ts +26 -0
  16. package/dist/chat/plan/PlanSurface.d.ts +9 -0
  17. package/dist/chat/plan/presentation.d.ts +18 -0
  18. package/dist/chat/runtime/actions.d.ts +1 -0
  19. package/dist/chat/runtime/environment.d.ts +5 -0
  20. package/dist/chat/runtime/session-source.d.ts +2 -0
  21. package/dist/chat.css +181 -0
  22. package/dist/{chunk-CJQINCIP.js → chunk-3RFYXI6V.js} +51 -71
  23. package/dist/chunk-3RFYXI6V.js.map +1 -0
  24. package/dist/chunk-5JAFIDDP.js +1386 -0
  25. package/dist/chunk-5JAFIDDP.js.map +1 -0
  26. package/dist/{chunk-RULD2XDA.js → chunk-67JW6ASD.js} +1561 -1199
  27. package/dist/chunk-67JW6ASD.js.map +1 -0
  28. package/dist/chunk-7WR2KG5O.js +50 -0
  29. package/dist/chunk-7WR2KG5O.js.map +1 -0
  30. package/dist/chunk-FR3ON5R4.js +30 -0
  31. package/dist/chunk-FR3ON5R4.js.map +1 -0
  32. package/dist/chunk-GRUDJLWG.js +8 -0
  33. package/dist/chunk-GRUDJLWG.js.map +1 -0
  34. package/dist/{chunk-Q5NLUZAK.js → chunk-GZHQQXYI.js} +8 -9
  35. package/dist/chunk-GZHQQXYI.js.map +1 -0
  36. package/dist/{chunk-RHUJ77ZZ.js → chunk-IOIKCFRO.js} +36 -1566
  37. package/dist/chunk-IOIKCFRO.js.map +1 -0
  38. package/dist/{chunk-IOKIQSWP.js → chunk-J6BSKVVK.js} +37 -19
  39. package/dist/chunk-J6BSKVVK.js.map +1 -0
  40. package/dist/{chunk-AGCHJFE7.js → chunk-MG4RF573.js} +4 -4
  41. package/dist/{chunk-AGCHJFE7.js.map → chunk-MG4RF573.js.map} +1 -1
  42. package/dist/{chunk-KJDDAZZY.js → chunk-SVCTJ4VS.js} +145 -25
  43. package/dist/chunk-SVCTJ4VS.js.map +1 -0
  44. package/dist/{chunk-FXTAY3LE.js → chunk-WEOW475M.js} +17 -17
  45. package/dist/{chunk-FXTAY3LE.js.map → chunk-WEOW475M.js.map} +1 -1
  46. package/dist/{chunk-6Z7T6BOB.js → chunk-YBTELD7P.js} +7 -5
  47. package/dist/{chunk-6Z7T6BOB.js.map → chunk-YBTELD7P.js.map} +1 -1
  48. package/dist/components/AgentChat.d.ts +3 -0
  49. package/dist/components/McpAppCard.d.ts +1 -7
  50. package/dist/components/ReplayBar.d.ts +7 -1
  51. package/dist/components/lazy-mcp-app-card.d.ts +1 -0
  52. package/dist/components/lazy-mcp-app-frame.d.ts +1 -0
  53. package/dist/components/lazy-session-plugin-config-form.d.ts +1 -0
  54. package/dist/components/mcp-app-context.d.ts +7 -0
  55. package/dist/connectors.js +3 -3
  56. package/dist/embed/entry.d.ts +4 -0
  57. package/dist/embed/load-plan-graph.d.ts +2 -0
  58. package/dist/embed/plan-graph-chunk.d.ts +1 -0
  59. package/dist/index.d.ts +2 -0
  60. package/dist/index.js +14 -9
  61. package/dist/internal.d.ts +4 -4
  62. package/dist/internal.js +29 -17
  63. package/dist/internal.js.map +1 -1
  64. package/dist/questions.js +5 -4
  65. package/dist/questions.js.map +1 -1
  66. package/dist/rich-input/ChatInput.d.ts +3 -1
  67. package/dist/rich-input/ComposerControls.d.ts +21 -0
  68. package/dist/rich-input/index.d.ts +1 -0
  69. package/dist/rich-input.js +315 -258
  70. package/dist/rich-input.js.map +1 -1
  71. package/dist/style.full.css +182 -1
  72. package/dist/tool-details.js +6 -5
  73. package/dist/tool-details.js.map +1 -1
  74. package/package.json +2 -2
  75. package/public-api.md +31 -2
  76. package/dist/SessionPluginConfigForm-DWLJEYBY.js +0 -9
  77. package/dist/chunk-CJQINCIP.js.map +0 -1
  78. package/dist/chunk-IOKIQSWP.js.map +0 -1
  79. package/dist/chunk-KJDDAZZY.js.map +0 -1
  80. package/dist/chunk-Q5NLUZAK.js.map +0 -1
  81. package/dist/chunk-RHUJ77ZZ.js.map +0 -1
  82. package/dist/chunk-RULD2XDA.js.map +0 -1
  83. /package/dist/{SessionPluginConfigForm-DWLJEYBY.js.map → McpAppFrame-VEOUJL5E.js.map} +0 -0
  84. /package/dist/{chunk-FTBMG7TK.js.map → SessionPluginConfigForm-DWVDFK6A.js.map} +0 -0
@@ -9,8 +9,9 @@ import {
9
9
  useComposerChannels,
10
10
  useDismissedBackgroundTasks,
11
11
  visibleSkills
12
- } from "./chunk-Q5NLUZAK.js";
12
+ } from "./chunk-GZHQQXYI.js";
13
13
  import {
14
+ BackgroundLogDialog,
14
15
  MODEL_REASONING_LEVELS_KEY,
15
16
  PREFERRED_MODEL_KEY,
16
17
  RichInputServicesProvider,
@@ -46,12 +47,11 @@ import {
46
47
  useSessionDataInvalidation,
47
48
  useSessionSkills,
48
49
  useSkillStats
49
- } from "./chunk-KJDDAZZY.js";
50
- import "./chunk-AGCHJFE7.js";
50
+ } from "./chunk-SVCTJ4VS.js";
51
+ import "./chunk-MG4RF573.js";
51
52
  import {
52
53
  cn,
53
54
  notifyChat,
54
- useBladeClient,
55
55
  useChatEnvironment,
56
56
  useChatRenderMode,
57
57
  useChatSessionDetail,
@@ -59,7 +59,10 @@ import {
59
59
  useSessionHandle,
60
60
  useSessionSource,
61
61
  useSessionState
62
- } from "./chunk-CJQINCIP.js";
62
+ } from "./chunk-3RFYXI6V.js";
63
+ import {
64
+ useBladeClient
65
+ } from "./chunk-FR3ON5R4.js";
63
66
  import {
64
67
  Dialog,
65
68
  DialogClose,
@@ -68,8 +71,7 @@ import {
68
71
  cn as cn2,
69
72
  dist_exports4 as dist_exports,
70
73
  usePortalContainer
71
- } from "./chunk-FXTAY3LE.js";
72
- import "./chunk-FTBMG7TK.js";
74
+ } from "./chunk-WEOW475M.js";
73
75
  import {
74
76
  Archive,
75
77
  ArrowUp,
@@ -78,6 +80,7 @@ import {
78
80
  Check,
79
81
  ChevronDown,
80
82
  ChevronRight,
83
+ Ellipsis,
81
84
  EyeOff,
82
85
  File,
83
86
  FileCode2,
@@ -102,7 +105,7 @@ import {
102
105
  Square,
103
106
  Terminal,
104
107
  X
105
- } from "./chunk-IOKIQSWP.js";
108
+ } from "./chunk-J6BSKVVK.js";
106
109
  import {
107
110
  __commonJS,
108
111
  __require,
@@ -394,14 +397,12 @@ function TaskCard({
394
397
  ] });
395
398
  }
396
399
  function BackgroundTasksPill({ sessionId }) {
397
- const client = useBladeClient();
398
400
  const session = useSessionHandle(sessionId);
399
401
  const { data: tasks = NO_TASKS } = useBackgroundTaskList(sessionId);
400
402
  const dismissed = useDismissedBackgroundTasks(sessionId);
401
403
  const [open, setOpen] = useState(false);
402
404
  const [historyOverride, setHistoryOverride] = useState(null);
403
405
  const [logTask, setLogTask] = useState(null);
404
- const [logDialogOpen, setLogDialogOpen] = useState(false);
405
406
  const { activeTasks, historyTasks, runningCount, attentionCount } = useMemo(
406
407
  () => splitTasks(tasks, dismissed),
407
408
  [tasks, dismissed]
@@ -417,29 +418,7 @@ function BackgroundTasksPill({ sessionId }) {
417
418
  backgroundTaskDismissals.dismiss(sessionId, taskId);
418
419
  setHistoryOverride(false);
419
420
  };
420
- const openTaskLog = async (task) => {
421
- const title = `${task.id} ${task.description || task.command || "\u540E\u53F0\u4EFB\u52A1"}`;
422
- setLogTask({ id: task.id, title, output: "", loading: true, error: null });
423
- setLogDialogOpen(true);
424
- try {
425
- const detail = await client.sessions.getBackgroundTask(sessionId, task.id, 300);
426
- setLogTask({
427
- id: task.id,
428
- title,
429
- output: detail.output || "\u6682\u65E0\u8F93\u51FA",
430
- loading: false,
431
- error: null
432
- });
433
- } catch {
434
- setLogTask({
435
- id: task.id,
436
- title,
437
- output: "",
438
- loading: false,
439
- error: "\u65E5\u5FD7\u5DF2\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u53EF\u80FD\u5DF2\u88AB\u6E05\u7406"
440
- });
441
- }
442
- };
421
+ const openTaskLog = setLogTask;
443
422
  const requestStopTask = (task) => {
444
423
  const name = `${task.id}\uFF08${task.description || task.command || "\u540E\u53F0\u4EFB\u52A1"}\uFF09`;
445
424
  if (session) {
@@ -448,39 +427,15 @@ function BackgroundTasksPill({ sessionId }) {
448
427
  closePanel();
449
428
  };
450
429
  return /* @__PURE__ */ jsxs(Fragment, { children: [
451
- /* @__PURE__ */ jsx(
452
- Dialog,
430
+ logTask && /* @__PURE__ */ jsx(
431
+ BackgroundLogDialog,
453
432
  {
454
- open: logDialogOpen,
455
- onOpenChange: (nextOpen) => {
456
- if (!nextOpen) setLogDialogOpen(false);
457
- },
458
- children: /* @__PURE__ */ jsxs(
459
- DialogContent,
460
- {
461
- showCloseButton: false,
462
- className: "flex max-h-[82vh] w-full max-w-3xl flex-col gap-0 overflow-hidden p-0",
463
- children: [
464
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-[hsl(var(--border))] px-4 py-3", children: [
465
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
466
- /* @__PURE__ */ jsx(DialogTitle, { className: "truncate text-sm font-medium text-[hsl(var(--foreground))]", children: logTask?.title }),
467
- /* @__PURE__ */ jsx("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u540E\u53F0\u4EFB\u52A1\u65E5\u5FD7" })
468
- ] }),
469
- /* @__PURE__ */ jsx(
470
- "button",
471
- {
472
- type: "button",
473
- onClick: () => setLogDialogOpen(false),
474
- className: "rounded-md border border-[hsl(var(--border))] px-2.5 py-1 text-xs text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))]",
475
- children: "\u5173\u95ED"
476
- }
477
- )
478
- ] }),
479
- /* @__PURE__ */ jsx("pre", { className: "min-h-64 flex-1 overflow-auto whitespace-pre-wrap p-4 font-mono text-xs leading-5 text-[hsl(var(--foreground))]", children: logTask?.loading ? "\u52A0\u8F7D\u4E2D..." : logTask?.error || logTask?.output })
480
- ]
481
- }
482
- )
483
- }
433
+ sessionId,
434
+ taskId: logTask.id,
435
+ title: logTask.description || "\u540E\u53F0\u4EFB\u52A1\u65E5\u5FD7",
436
+ onClose: () => setLogTask(null)
437
+ },
438
+ logTask.id
484
439
  ),
485
440
  /* @__PURE__ */ jsxs(
486
441
  "div",
@@ -568,6 +523,44 @@ function BackgroundTasksPill({ sessionId }) {
568
523
  ] });
569
524
  }
570
525
 
526
+ // src/rich-input/ChatInput.tsx
527
+ import { BladeApiError } from "@blade-hq/agent-client";
528
+
529
+ // src/rich-input/ComposerControls.tsx
530
+ import { useState as useState2 } from "react";
531
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
532
+ var originalOrder = ["upload", "reference", "voice", "model", "mode", "workspace"];
533
+ function hasCustomComposerPlacement(placement) {
534
+ return Boolean(placement && (placement.more.length || placement.direct.length !== originalOrder.length || placement.direct.some((id, index) => id !== originalOrder[index])));
535
+ }
536
+ function ComposerControlMenu({ label, icon, children }) {
537
+ return /* @__PURE__ */ jsxs2(dist_exports.Root, { children: [
538
+ /* @__PURE__ */ jsx2(dist_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs2("button", { type: "button", "aria-label": label, title: label, className: "inline-flex h-8 shrink-0 items-center gap-1 rounded-full px-2 text-xs text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]", children: [
539
+ icon,
540
+ /* @__PURE__ */ jsx2("span", { "data-composer-label": true, className: "hidden sm:inline", children: label })
541
+ ] }) }),
542
+ /* @__PURE__ */ jsx2(dist_exports.Portal, { children: /* @__PURE__ */ jsx2(dist_exports.Content, { side: "top", align: "start", sideOffset: 8, collisionPadding: 12, className: "z-50 max-h-[70vh] w-[min(300px,calc(100vw-2rem))] overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-2 text-[hsl(var(--popover-foreground))] shadow-lg", children }) })
543
+ ] });
544
+ }
545
+ function ComposerControls({ placement, controls, moreContent, children }) {
546
+ const [open, setOpen] = useState2(false);
547
+ if (!hasCustomComposerPlacement(placement)) return children;
548
+ const more = placement.more.filter((id) => controls[id]);
549
+ return /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "aria-label": "\u8F93\u5165\u9009\u9879", children: [
550
+ placement.direct.filter((id) => controls[id]).map((id) => /* @__PURE__ */ jsx2("div", { "data-composer-control": id, children: controls[id] }, id)),
551
+ more.length || moreContent ? /* @__PURE__ */ jsxs2(dist_exports.Root, { open, onOpenChange: setOpen, children: [
552
+ /* @__PURE__ */ jsx2(dist_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs2("button", { type: "button", "aria-label": "\u66F4\u591A", title: "\u66F4\u591A", className: "inline-flex h-8 items-center gap-1 rounded-full px-2 text-xs text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]", children: [
553
+ /* @__PURE__ */ jsx2(Ellipsis, { size: 17 }),
554
+ /* @__PURE__ */ jsx2("span", { className: "hidden sm:inline", children: "\u66F4\u591A" })
555
+ ] }) }),
556
+ /* @__PURE__ */ jsx2(dist_exports.Portal, { children: /* @__PURE__ */ jsxs2(dist_exports.Content, { side: "top", align: "start", sideOffset: 8, collisionPadding: 12, className: "z-40 max-h-[70vh] w-[min(320px,calc(100vw-2rem))] overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-2 text-[hsl(var(--popover-foreground))] shadow-lg [&_[data-composer-label]]:inline", children: [
557
+ more.map((id) => /* @__PURE__ */ jsx2("div", { "data-composer-control": id, children: controls[id] }, id)),
558
+ moreContent
559
+ ] }) })
560
+ ] }) : null
561
+ ] });
562
+ }
563
+
571
564
  // ../../node_modules/.pnpm/orderedmap@2.1.1/node_modules/orderedmap/dist/index.js
572
565
  function OrderedMap(content) {
573
566
  this.content = content;
@@ -18910,9 +18903,9 @@ var import_shim = __toESM(require_shim(), 1);
18910
18903
  import { createContext, useContext, useMemo as useMemo2 } from "react";
18911
18904
  import React, { forwardRef } from "react";
18912
18905
  import ReactDOM from "react-dom";
18913
- import { Fragment as Fragment3, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
18906
+ import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
18914
18907
  var import_shim2 = __toESM(require_shim(), 1);
18915
- import { useDebugValue as useDebugValue2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
18908
+ import { useDebugValue as useDebugValue2, useEffect as useEffect2, useRef as useRef2, useState as useState22 } from "react";
18916
18909
 
18917
18910
  // ../../node_modules/.pnpm/fast-equals@5.4.0/node_modules/fast-equals/dist/es/index.mjs
18918
18911
  var { getOwnPropertyNames, getOwnPropertySymbols } = Object;
@@ -19357,7 +19350,7 @@ var import_with_selector = __toESM(require_with_selector(), 1);
19357
19350
  import { useDebugValue, useEffect as useEffect3, useLayoutEffect, useState as useState3 } from "react";
19358
19351
  import { jsx as jsx22, jsxs as jsxs22 } from "react/jsx-runtime";
19359
19352
  import { createContext as createContext2, createElement, useContext as useContext2 } from "react";
19360
- import { jsx as jsx3 } from "react/jsx-runtime";
19353
+ import { jsx as jsx32 } from "react/jsx-runtime";
19361
19354
  import React3 from "react";
19362
19355
  import { jsx as jsx4 } from "react/jsx-runtime";
19363
19356
  import React4 from "react";
@@ -19387,7 +19380,7 @@ var Portals = ({ contentComponent }) => {
19387
19380
  contentComponent.getSnapshot,
19388
19381
  contentComponent.getServerSnapshot
19389
19382
  );
19390
- return /* @__PURE__ */ jsx2(Fragment3, { children: Object.values(renderers) });
19383
+ return /* @__PURE__ */ jsx3(Fragment3, { children: Object.values(renderers) });
19391
19384
  };
19392
19385
  function getInstance() {
19393
19386
  const subscribers = /* @__PURE__ */ new Set();
@@ -19507,9 +19500,9 @@ var PureEditorContent = class extends React.Component {
19507
19500
  }
19508
19501
  render() {
19509
19502
  const { editor, innerRef, ...rest } = this.props;
19510
- return /* @__PURE__ */ jsxs2(Fragment3, { children: [
19511
- /* @__PURE__ */ jsx2("div", { ref: mergeRefs(innerRef, this.editorContentRef), ...rest }),
19512
- (editor == null ? void 0 : editor.contentComponent) && /* @__PURE__ */ jsx2(Portals, { contentComponent: editor.contentComponent })
19503
+ return /* @__PURE__ */ jsxs3(Fragment3, { children: [
19504
+ /* @__PURE__ */ jsx3("div", { ref: mergeRefs(innerRef, this.editorContentRef), ...rest }),
19505
+ (editor == null ? void 0 : editor.contentComponent) && /* @__PURE__ */ jsx3(Portals, { contentComponent: editor.contentComponent })
19513
19506
  ] });
19514
19507
  }
19515
19508
  };
@@ -19836,7 +19829,7 @@ var EditorInstanceManager = class _EditorInstanceManager {
19836
19829
  function useEditor(options = {}, deps = []) {
19837
19830
  const mostRecentOptions = useRef2(options);
19838
19831
  mostRecentOptions.current = options;
19839
- const [instanceManager] = useState2(() => new EditorInstanceManager(mostRecentOptions));
19832
+ const [instanceManager] = useState22(() => new EditorInstanceManager(mostRecentOptions));
19840
19833
  const editor = (0, import_shim2.useSyncExternalStore)(
19841
19834
  instanceManager.subscribe,
19842
19835
  instanceManager.getEditor,
@@ -25299,7 +25292,7 @@ function PopoverContent({
25299
25292
 
25300
25293
  // src/rich-input/ModelSelector.tsx
25301
25294
  import { useEffect as useEffect6, useMemo as useMemo4, useState as useState5 } from "react";
25302
- import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
25295
+ import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
25303
25296
  var inputModalityLabels = {
25304
25297
  text: "\u6587\u672C",
25305
25298
  image: "\u56FE\u7247",
@@ -25343,8 +25336,8 @@ function ModelCatalogPopoverBody({
25343
25336
  ...matches2.filter((model) => model.personal !== true)
25344
25337
  ];
25345
25338
  }, [models, query]);
25346
- return /* @__PURE__ */ jsxs3(Fragment4, { children: [
25347
- /* @__PURE__ */ jsxs3("div", { className: "border-b border-border p-2", children: [
25339
+ return /* @__PURE__ */ jsxs4(Fragment4, { children: [
25340
+ /* @__PURE__ */ jsxs4("div", { className: "border-b border-border p-2", children: [
25348
25341
  /* @__PURE__ */ jsx12(
25349
25342
  "input",
25350
25343
  {
@@ -25361,12 +25354,12 @@ function ModelCatalogPopoverBody({
25361
25354
  {
25362
25355
  className: "overflow-y-auto p-1",
25363
25356
  style: { maxHeight: "min(220px, max(0px, calc(var(--radix-popover-content-available-height) - 49px)))" },
25364
- children: isFetching ? /* @__PURE__ */ jsxs3("output", { className: "flex items-center justify-center gap-2 px-3 py-6 text-xs text-muted-foreground", children: [
25357
+ children: isFetching ? /* @__PURE__ */ jsxs4("output", { className: "flex items-center justify-center gap-2 px-3 py-6 text-xs text-muted-foreground", children: [
25365
25358
  /* @__PURE__ */ jsx12(LoaderCircle, { size: 14, className: "animate-spin", "aria-hidden": "true" }),
25366
25359
  "\u6B63\u5728\u52A0\u8F7D\u5019\u9009\u6A21\u578B..."
25367
- ] }) : models.length === 0 ? /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between gap-2 px-3 py-3 text-xs text-muted-foreground", children: [
25360
+ ] }) : models.length === 0 ? /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-2 px-3 py-3 text-xs text-muted-foreground", children: [
25368
25361
  /* @__PURE__ */ jsx12("span", { children: "\u5F53\u524D\u6682\u65E0\u53EF\u7528\u6A21\u578B" }),
25369
- /* @__PURE__ */ jsxs3(
25362
+ /* @__PURE__ */ jsxs4(
25370
25363
  "button",
25371
25364
  {
25372
25365
  type: "button",
@@ -25381,7 +25374,7 @@ function ModelCatalogPopoverBody({
25381
25374
  ] }) : filteredModels.length === 0 ? /* @__PURE__ */ jsx12("div", { className: "px-3 py-2 text-xs text-muted-foreground", children: "\u6CA1\u6709\u5339\u914D\u7684\u6A21\u578B" }) : filteredModels.map((model) => {
25382
25375
  const inputLabel = formatInputModalities(model);
25383
25376
  const title = model.id === model.label ? `${model.id}\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${inputLabel}` : `${model.label} (${model.id})\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${inputLabel}`;
25384
- return /* @__PURE__ */ jsxs3(
25377
+ return /* @__PURE__ */ jsxs4(
25385
25378
  "button",
25386
25379
  {
25387
25380
  type: "button",
@@ -25389,11 +25382,11 @@ function ModelCatalogPopoverBody({
25389
25382
  className: `flex w-full items-center justify-between gap-3 rounded-lg px-3 py-2 text-left text-xs transition-colors ${model.id === value ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent hover:text-foreground"}`,
25390
25383
  title,
25391
25384
  children: [
25392
- /* @__PURE__ */ jsxs3("span", { className: "min-w-0 truncate", children: [
25385
+ /* @__PURE__ */ jsxs4("span", { className: "min-w-0 truncate", children: [
25393
25386
  model.label,
25394
25387
  model.personal ? /* @__PURE__ */ jsx12("span", { className: "ml-1.5 rounded border border-border/70 bg-background/80 px-1 py-0.5 text-[10px] font-normal text-muted-foreground", children: "\u6211\u7684" }) : null
25395
25388
  ] }),
25396
- /* @__PURE__ */ jsxs3("span", { className: "flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: [
25389
+ /* @__PURE__ */ jsxs4("span", { className: "flex shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: [
25397
25390
  inputLabel,
25398
25391
  model.id === value ? /* @__PURE__ */ jsx12(Check, { size: 13, "aria-label": "\u5DF2\u9009\u62E9" }) : null
25399
25392
  ] })
@@ -25427,9 +25420,9 @@ function BannerModelSelector({
25427
25420
  setMobileAnchor(null);
25428
25421
  }
25429
25422
  }
25430
- return /* @__PURE__ */ jsx12("div", { className: "relative shrink-0", children: /* @__PURE__ */ jsxs3(Popover, { open: isOpen, onOpenChange: handleOpenChange, children: [
25423
+ return /* @__PURE__ */ jsx12("div", { className: "relative shrink-0", children: /* @__PURE__ */ jsxs4(Popover, { open: isOpen, onOpenChange: handleOpenChange, children: [
25431
25424
  mobileAnchor ? /* @__PURE__ */ jsx12(PopoverAnchor, { virtualRef: mobileAnchor }) : null,
25432
- /* @__PURE__ */ jsx12(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(
25425
+ /* @__PURE__ */ jsx12(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs4(
25433
25426
  "button",
25434
25427
  {
25435
25428
  type: "button",
@@ -25518,7 +25511,7 @@ function StandardModelSelector({
25518
25511
  const activeInputLabel = activeModel ? formatInputModalities(activeModel) : "";
25519
25512
  const selectorTitle = selectedUnavailable ? `${label}\uFF0C\u5F53\u524D\u6A21\u578B\u76EE\u5F55\u4E2D\u4E0D\u53EF\u7528` : activeInputLabel ? `${label}\uFF0C\u652F\u6301\u8F93\u5165\uFF1A${activeInputLabel}` : label;
25520
25513
  if (!canSelect) {
25521
- return /* @__PURE__ */ jsxs3(
25514
+ return /* @__PURE__ */ jsxs4(
25522
25515
  "div",
25523
25516
  {
25524
25517
  className: `flex min-w-0 items-center gap-1 rounded-lg py-[5px] text-muted-foreground ${compact ? "ml-auto px-1.5" : "px-2.5"}`,
@@ -25537,9 +25530,9 @@ function StandardModelSelector({
25537
25530
  }
25538
25531
  );
25539
25532
  }
25540
- return /* @__PURE__ */ jsx12("div", { className: `relative min-w-0 ${compact ? "ml-auto" : ""}`, children: /* @__PURE__ */ jsxs3(Popover, { open: isOpen, onOpenChange: handleOpenChange, children: [
25533
+ return /* @__PURE__ */ jsx12("div", { className: `relative min-w-0 ${compact ? "ml-auto" : ""}`, children: /* @__PURE__ */ jsxs4(Popover, { open: isOpen, onOpenChange: handleOpenChange, children: [
25541
25534
  mobileAnchor ? /* @__PURE__ */ jsx12(PopoverAnchor, { virtualRef: mobileAnchor }) : null,
25542
- /* @__PURE__ */ jsx12(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(
25535
+ /* @__PURE__ */ jsx12(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs4(
25543
25536
  "button",
25544
25537
  {
25545
25538
  type: "button",
@@ -25605,7 +25598,7 @@ function tokenPressureOf(stats) {
25605
25598
  }
25606
25599
 
25607
25600
  // src/rich-input/ProgressCircle.tsx
25608
- import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
25601
+ import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
25609
25602
  var LEVEL_STYLES = {
25610
25603
  normal: {
25611
25604
  strokeClass: "stroke-slate-400",
@@ -25636,14 +25629,14 @@ function ProgressCircle({
25636
25629
  const circumference = 2 * Math.PI * radius;
25637
25630
  const dashOffset = circumference * (1 - clamped / 100);
25638
25631
  const styles = LEVEL_STYLES[level];
25639
- return /* @__PURE__ */ jsxs4("div", { className: cn("group/context relative inline-flex", className), children: [
25632
+ return /* @__PURE__ */ jsxs5("div", { className: cn("group/context relative inline-flex", className), children: [
25640
25633
  /* @__PURE__ */ jsx13(
25641
25634
  "button",
25642
25635
  {
25643
25636
  type: "button",
25644
25637
  "aria-label": `\u4E0A\u4E0B\u6587\u5DF2\u4F7F\u7528 ${Math.round(clamped)}%`,
25645
25638
  className: "relative inline-flex cursor-help items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] focus-visible:ring-offset-2 focus-visible:ring-offset-[hsl(var(--background))]",
25646
- children: /* @__PURE__ */ jsxs4("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-hidden": "true", children: [
25639
+ children: /* @__PURE__ */ jsxs5("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-hidden": "true", children: [
25647
25640
  /* @__PURE__ */ jsx13(
25648
25641
  "circle",
25649
25642
  {
@@ -25678,7 +25671,7 @@ function ProgressCircle({
25678
25671
  }
25679
25672
 
25680
25673
  // src/rich-input/SkillStatusBar.tsx
25681
- import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
25674
+ import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
25682
25675
  var EMPTY_SKILL_STATS = {
25683
25676
  loaded_skill_count: 0,
25684
25677
  loaded_skill_names: [],
@@ -25730,7 +25723,7 @@ function HoverPanel({
25730
25723
  title,
25731
25724
  children
25732
25725
  }) {
25733
- return /* @__PURE__ */ jsx14("div", { className: "absolute bottom-full left-0 z-40 hidden w-80 max-w-[min(22rem,calc(100vw-2rem))] pb-2 group-hover/skill:block group-focus-within/skill:block", children: /* @__PURE__ */ jsxs5("div", { className: "rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-3 py-2 text-[11px] text-[hsl(var(--popover-foreground))] shadow-[var(--swf-shadow-overlay)]", children: [
25726
+ return /* @__PURE__ */ jsx14("div", { className: "absolute bottom-full left-0 z-40 hidden w-80 max-w-[min(22rem,calc(100vw-2rem))] pb-2 group-hover/skill:block group-focus-within/skill:block", children: /* @__PURE__ */ jsxs6("div", { className: "rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] px-3 py-2 text-[11px] text-[hsl(var(--popover-foreground))] shadow-[var(--swf-shadow-overlay)]", children: [
25734
25727
  /* @__PURE__ */ jsx14("div", { className: "mb-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-[hsl(var(--muted-foreground))]", children: title }),
25735
25728
  children
25736
25729
  ] }) });
@@ -25790,16 +25783,16 @@ function SkillStatusBar({
25790
25783
  };
25791
25784
  }
25792
25785
  return {
25793
- detail: /* @__PURE__ */ jsxs5("div", { className: "space-y-1", children: [
25794
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-3 border-t border-[hsl(var(--border))] pt-1", children: [
25786
+ detail: /* @__PURE__ */ jsxs6("div", { className: "space-y-1", children: [
25787
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-3 border-t border-[hsl(var(--border))] pt-1", children: [
25795
25788
  /* @__PURE__ */ jsx14("span", { className: "text-[hsl(var(--muted-foreground))]", children: "\u4F1A\u8BDD\u6D88\u606F\u4F30\u7B97" }),
25796
25789
  /* @__PURE__ */ jsx14("span", { className: "font-mono", children: formatTokenNumber(contextStats.tokens_used) })
25797
25790
  ] }),
25798
- contextStats.context_window > 0 ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-3", children: [
25791
+ contextStats.context_window > 0 ? /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-3", children: [
25799
25792
  /* @__PURE__ */ jsx14("span", { className: "text-[hsl(var(--muted-foreground))]", children: "\u4E0A\u4E0B\u6587\u7A97\u53E3" }),
25800
25793
  /* @__PURE__ */ jsx14("span", { className: "font-mono", children: formatCompactNumber(contextStats.context_window) })
25801
25794
  ] }) : /* @__PURE__ */ jsx14("div", { className: "pt-1 text-[hsl(var(--muted-foreground))]", children: "\u672A\u914D\u7F6E\u4E0A\u4E0B\u6587\u7A97\u53E3\u5927\u5C0F\uFF0C\u53EF\u901A\u8FC7 CONTEXT_WINDOW \u73AF\u5883\u53D8\u91CF\u8BBE\u7F6E" }),
25802
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-3", children: [
25795
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-3", children: [
25803
25796
  /* @__PURE__ */ jsx14("span", { className: "text-[hsl(var(--muted-foreground))]", children: "\u6574\u7406\u9608\u503C" }),
25804
25797
  /* @__PURE__ */ jsx14("span", { className: "font-mono", children: contextStats.compaction_ratio > 0 ? `${Math.round(contextStats.compaction_ratio * 100)}%` : "\u5DF2\u7981\u7528" })
25805
25798
  ] })
@@ -25811,8 +25804,8 @@ function SkillStatusBar({
25811
25804
  const containerClass = vertical ? "text-[11px] text-[hsl(var(--muted-foreground))]" : "bg-[hsl(var(--background))] px-5 pt-2";
25812
25805
  const innerClass = vertical ? "" : "mx-auto max-w-3xl";
25813
25806
  const listClass = vertical ? "flex flex-col items-stretch gap-1.5 text-[11px] text-[hsl(var(--muted-foreground))]" : "flex flex-wrap items-center gap-2 text-[10px] text-[hsl(var(--muted-foreground))]";
25814
- return /* @__PURE__ */ jsx14("div", { className: cn(containerClass, className), children: /* @__PURE__ */ jsx14("div", { className: cn(innerClass, innerClassName), children: /* @__PURE__ */ jsxs5("div", { className: listClass, children: [
25815
- tokenSummary ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2.5 py-1", children: [
25807
+ return /* @__PURE__ */ jsx14("div", { className: cn(containerClass, className), children: /* @__PURE__ */ jsx14("div", { className: cn(innerClass, innerClassName), children: /* @__PURE__ */ jsxs6("div", { className: listClass, children: [
25808
+ tokenSummary ? /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2.5 py-1", children: [
25816
25809
  /* @__PURE__ */ jsx14(
25817
25810
  ProgressCircle,
25818
25811
  {
@@ -25824,7 +25817,7 @@ function SkillStatusBar({
25824
25817
  /* @__PURE__ */ jsx14("span", { className: "font-mono", children: tokenSummary.label }),
25825
25818
  tokenSummary.warn ? /* @__PURE__ */ jsx14("span", { className: "rounded-full border border-[hsl(var(--swf-danger)/0.25)] bg-[hsl(var(--swf-danger-soft))] px-1.5 py-0.5 text-[10px] font-medium text-[hsl(var(--swf-danger))]", children: "\u5EFA\u8BAE\u6574\u7406\u5BF9\u8BDD" }) : null
25826
25819
  ] }) : null,
25827
- connectionStatus !== "connected" ? /* @__PURE__ */ jsxs5(
25820
+ connectionStatus !== "connected" ? /* @__PURE__ */ jsxs6(
25828
25821
  "div",
25829
25822
  {
25830
25823
  className: cn(
@@ -25837,16 +25830,16 @@ function SkillStatusBar({
25837
25830
  ]
25838
25831
  }
25839
25832
  ) : null,
25840
- items.map((item, index) => /* @__PURE__ */ jsxs5(
25833
+ items.map((item, index) => /* @__PURE__ */ jsxs6(
25841
25834
  "div",
25842
25835
  {
25843
25836
  className: "flex items-center gap-2 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2.5 py-1",
25844
25837
  children: [
25845
25838
  index > 0 && !tokenPressure && /* @__PURE__ */ jsx14("span", { className: "hidden text-[hsl(var(--border))]", children: "\xB7" }),
25846
25839
  /* @__PURE__ */ jsx14("span", { className: `inline-block h-1.5 w-1.5 rounded-full ${item.dotClass}` }),
25847
- item.key === "loaded" ? /* @__PURE__ */ jsxs5("div", { className: "group/skill relative flex items-center gap-1.5", children: [
25840
+ item.key === "loaded" ? /* @__PURE__ */ jsxs6("div", { className: "group/skill relative flex items-center gap-1.5", children: [
25848
25841
  /* @__PURE__ */ jsx14("span", { className: "font-mono", children: item.text }),
25849
- loadedReady && sessionSkills.length > 0 ? /* @__PURE__ */ jsx14(HoverPanel, { title: "\u5DF2\u52A0\u8F7D\u6280\u80FD", children: sessionSkills.length > 0 ? /* @__PURE__ */ jsx14("div", { className: "max-h-40 overflow-y-auto", children: sessionSkills.map((skill) => /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-2 py-1 leading-relaxed", children: [
25842
+ loadedReady && sessionSkills.length > 0 ? /* @__PURE__ */ jsx14(HoverPanel, { title: "\u5DF2\u52A0\u8F7D\u6280\u80FD", children: sessionSkills.length > 0 ? /* @__PURE__ */ jsx14("div", { className: "max-h-40 overflow-y-auto", children: sessionSkills.map((skill) => /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-2 py-1 leading-relaxed", children: [
25850
25843
  /* @__PURE__ */ jsx14("span", { className: "mt-1.5 inline-block h-2 w-2 shrink-0 rounded-full border border-[hsl(var(--swf-success))] bg-transparent" }),
25851
25844
  /* @__PURE__ */ jsx14("span", { className: "break-words", children: skillDisplayName(skill) })
25852
25845
  ] }, skill.skill_id)) }) : null }) : null
@@ -25869,7 +25862,7 @@ function SkillStatusBar({
25869
25862
 
25870
25863
  // src/rich-input/InputActionSubmenu.tsx
25871
25864
  import { useSyncExternalStore as useSyncExternalStore3 } from "react";
25872
- import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
25865
+ import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
25873
25866
  var narrowQuery = "(max-width: 639px)";
25874
25867
  function subscribeToViewport(onChange) {
25875
25868
  const media = window.matchMedia(narrowQuery);
@@ -25879,8 +25872,8 @@ function subscribeToViewport(onChange) {
25879
25872
  var isNarrowViewport = () => window.matchMedia(narrowQuery).matches;
25880
25873
  function InputActionSubmenu({ label, icon, open, onOpenChange, children, disabled = false }) {
25881
25874
  const narrow = useSyncExternalStore3(subscribeToViewport, isNarrowViewport, () => false);
25882
- return /* @__PURE__ */ jsxs6(dist_exports.Root, { open, onOpenChange, children: [
25883
- /* @__PURE__ */ jsx15(dist_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs6(
25875
+ return /* @__PURE__ */ jsxs7(dist_exports.Root, { open, onOpenChange, children: [
25876
+ /* @__PURE__ */ jsx15(dist_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
25884
25877
  "button",
25885
25878
  {
25886
25879
  type: "button",
@@ -26051,7 +26044,7 @@ async function getSkillSuggestions(query, options) {
26051
26044
  }
26052
26045
 
26053
26046
  // src/rich-input/ConnectButton.tsx
26054
- import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
26047
+ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
26055
26048
  function ConnectButton({
26056
26049
  sessionId,
26057
26050
  open,
@@ -26131,7 +26124,7 @@ function ConnectButton({
26131
26124
  }
26132
26125
  );
26133
26126
  }
26134
- return /* @__PURE__ */ jsxs7(dist_exports.Root, { open: isOpen, onOpenChange: setOpen, children: [
26127
+ return /* @__PURE__ */ jsxs8(dist_exports.Root, { open: isOpen, onOpenChange: setOpen, children: [
26135
26128
  /* @__PURE__ */ jsx16(dist_exports.Trigger, { asChild: true, children: /* @__PURE__ */ jsx16(
26136
26129
  "button",
26137
26130
  {
@@ -26858,7 +26851,7 @@ function listUserHomeDir(client, dirPath) {
26858
26851
  }
26859
26852
 
26860
26853
  // src/rich-input/FileCompletionMenu.tsx
26861
- import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
26854
+ import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
26862
26855
  var ROOT_DIR = ".";
26863
26856
  function installSuggestionOutsideDismiss(container, onDismiss) {
26864
26857
  const onPointerDown = (event) => {
@@ -27099,9 +27092,9 @@ var FileCompletionMenuContent = forwardRef2(function FileCompletionMenuContent2(
27099
27092
  };
27100
27093
  const showGroupLabels = pluginItems.length > 0 || topicItems.length > 0 || Boolean(topicError);
27101
27094
  const fileEmptyLabel = scope === "session" && !sessionId ? "\u6682\u65E0\u4F1A\u8BDD" : filteredEntries.length === 0 ? "\u6CA1\u6709\u6587\u4EF6" : null;
27102
- return /* @__PURE__ */ jsxs8("div", { className: "max-h-64 overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] py-1 shadow-[var(--swf-shadow-overlay)]", children: [
27095
+ return /* @__PURE__ */ jsxs9("div", { className: "max-h-64 overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] py-1 shadow-[var(--swf-shadow-overlay)]", children: [
27103
27096
  pluginError ? /* @__PURE__ */ jsx17("output", { className: "block px-3 py-2 text-xs text-muted-foreground", children: pluginError }) : null,
27104
- pluginItems.map((item, index) => /* @__PURE__ */ jsxs8(
27097
+ pluginItems.map((item, index) => /* @__PURE__ */ jsxs9(
27105
27098
  "button",
27106
27099
  {
27107
27100
  ref: selectedRef(index),
@@ -27119,12 +27112,12 @@ var FileCompletionMenuContent = forwardRef2(function FileCompletionMenuContent2(
27119
27112
  },
27120
27113
  `${item.plugin}:${item.server}:${item.id}`
27121
27114
  )),
27122
- topicItems.length > 0 || topicError ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
27115
+ topicItems.length > 0 || topicError ? /* @__PURE__ */ jsxs9(Fragment5, { children: [
27123
27116
  /* @__PURE__ */ jsx17("div", { className: "px-3 pt-1 pb-0.5 text-xs font-medium text-muted-foreground", children: "\u5DE5\u4F5C\u7A7A\u95F4\u8D44\u4EA7" }),
27124
27117
  topicError ? /* @__PURE__ */ jsx17("output", { className: "block px-3 py-2 text-xs text-muted-foreground", children: topicError }) : null,
27125
27118
  topicItems.map((item, topicIndex) => {
27126
27119
  const index = pluginItems.length + topicIndex;
27127
- return /* @__PURE__ */ jsxs8("button", { ref: selectedRef(index), type: "button", title: item.path, className: rowClassName(index), onMouseDown: (event) => {
27120
+ return /* @__PURE__ */ jsxs9("button", { ref: selectedRef(index), type: "button", title: item.path, className: rowClassName(index), onMouseDown: (event) => {
27128
27121
  event.preventDefault();
27129
27122
  handleSelect(item);
27130
27123
  }, children: [
@@ -27136,7 +27129,7 @@ var FileCompletionMenuContent = forwardRef2(function FileCompletionMenuContent2(
27136
27129
  showGroupLabels ? /* @__PURE__ */ jsx17("div", { className: "px-3 pt-1 pb-0.5 text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: "\u6587\u4EF6" }) : null,
27137
27130
  fileEmptyLabel ? /* @__PURE__ */ jsx17("div", { className: "px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]", children: fileEmptyLabel }) : filteredEntries.map((entry, fileIndex) => {
27138
27131
  const index = pluginItems.length + topicItems.length + fileIndex;
27139
- return /* @__PURE__ */ jsxs8(
27132
+ return /* @__PURE__ */ jsxs9(
27140
27133
  "button",
27141
27134
  {
27142
27135
  ref: selectedRef(index),
@@ -27160,7 +27153,7 @@ var FileCompletionMenuContent = forwardRef2(function FileCompletionMenuContent2(
27160
27153
 
27161
27154
  // src/rich-input/SkillCompletionMenu.tsx
27162
27155
  import { forwardRef as forwardRef3, useCallback as useCallback5, useImperativeHandle as useImperativeHandle2, useState as useState10 } from "react";
27163
- import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
27156
+ import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
27164
27157
  var SkillCompletionMenu = forwardRef3(
27165
27158
  function SkillCompletionMenu2({ command: command2, items }, ref) {
27166
27159
  const [rawSelectedIndex, setRawSelectedIndex] = useState10(0);
@@ -27207,10 +27200,10 @@ var SkillCompletionMenu = forwardRef3(
27207
27200
  );
27208
27201
  const commandItems = items.filter((item) => item.type === "command");
27209
27202
  const skillItems = items.filter((item) => item.type === "skill");
27210
- return /* @__PURE__ */ jsx18("div", { className: "max-h-64 overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] py-1 shadow-[var(--swf-shadow-overlay)]", children: items.length === 0 ? /* @__PURE__ */ jsx18("div", { className: "px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]", children: "\u6CA1\u6709\u5339\u914D\u7684\u547D\u4EE4\u6216\u6280\u80FD" }) : /* @__PURE__ */ jsxs9("div", { children: [
27211
- commandItems.length > 0 ? /* @__PURE__ */ jsxs9("div", { className: "px-2 pb-1 pt-1", children: [
27203
+ return /* @__PURE__ */ jsx18("div", { className: "max-h-64 overflow-y-auto rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] py-1 shadow-[var(--swf-shadow-overlay)]", children: items.length === 0 ? /* @__PURE__ */ jsx18("div", { className: "px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]", children: "\u6CA1\u6709\u5339\u914D\u7684\u547D\u4EE4\u6216\u6280\u80FD" }) : /* @__PURE__ */ jsxs10("div", { children: [
27204
+ commandItems.length > 0 ? /* @__PURE__ */ jsxs10("div", { className: "px-2 pb-1 pt-1", children: [
27212
27205
  /* @__PURE__ */ jsx18("div", { className: "px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-[hsl(var(--muted-foreground))]", children: "\u547D\u4EE4" }),
27213
- commandItems.map((item, index) => /* @__PURE__ */ jsxs9(
27206
+ commandItems.map((item, index) => /* @__PURE__ */ jsxs10(
27214
27207
  "button",
27215
27208
  {
27216
27209
  ref: (element) => {
@@ -27226,7 +27219,7 @@ var SkillCompletionMenu = forwardRef3(
27226
27219
  className: `flex w-full items-start gap-2 rounded-lg px-2 py-1.5 text-left transition-colors ${index === selectedIndex ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))]" : "text-[hsl(var(--popover-foreground))] hover:bg-[hsl(var(--accent))]"}`,
27227
27220
  children: [
27228
27221
  /* @__PURE__ */ jsx18("span", { className: "pt-0.5 text-sm", children: "\u21BB" }),
27229
- /* @__PURE__ */ jsxs9("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
27222
+ /* @__PURE__ */ jsxs10("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
27230
27223
  /* @__PURE__ */ jsx18("span", { className: "text-sm font-medium", children: item.label }),
27231
27224
  /* @__PURE__ */ jsx18("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: item.description })
27232
27225
  ] })
@@ -27235,11 +27228,11 @@ var SkillCompletionMenu = forwardRef3(
27235
27228
  item.id
27236
27229
  ))
27237
27230
  ] }) : null,
27238
- skillItems.length > 0 ? /* @__PURE__ */ jsxs9("div", { className: "px-2 pb-1 pt-1", children: [
27231
+ skillItems.length > 0 ? /* @__PURE__ */ jsxs10("div", { className: "px-2 pb-1 pt-1", children: [
27239
27232
  /* @__PURE__ */ jsx18("div", { className: "px-1 pb-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-[hsl(var(--muted-foreground))]", children: "\u6280\u80FD" }),
27240
27233
  skillItems.map((item, skillIndex) => {
27241
27234
  const index = commandItems.length + skillIndex;
27242
- return /* @__PURE__ */ jsxs9(
27235
+ return /* @__PURE__ */ jsxs10(
27243
27236
  "button",
27244
27237
  {
27245
27238
  ref: (element) => {
@@ -27254,7 +27247,7 @@ var SkillCompletionMenu = forwardRef3(
27254
27247
  },
27255
27248
  className: `flex w-full flex-col gap-0.5 rounded-lg px-2 py-1.5 text-left transition-colors ${index === selectedIndex ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))]" : "text-[hsl(var(--popover-foreground))] hover:bg-[hsl(var(--accent))]"}`,
27256
27249
  children: [
27257
- /* @__PURE__ */ jsxs9("span", { className: "flex items-center gap-1.5", children: [
27250
+ /* @__PURE__ */ jsxs10("span", { className: "flex items-center gap-1.5", children: [
27258
27251
  /* @__PURE__ */ jsx18("span", { className: "text-sm font-medium", children: skillDisplayName(item) }),
27259
27252
  item.hasFlow ? /* @__PURE__ */ jsx18(
27260
27253
  "span",
@@ -27278,7 +27271,7 @@ var SkillCompletionMenu = forwardRef3(
27278
27271
  );
27279
27272
 
27280
27273
  // src/rich-input/FileSizeLimitDialog.tsx
27281
- import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
27274
+ import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
27282
27275
  function FileSizeLimitDialog({
27283
27276
  open,
27284
27277
  onOpenChange,
@@ -27289,11 +27282,11 @@ function FileSizeLimitDialog({
27289
27282
  return null;
27290
27283
  }
27291
27284
  const limitText = formatFileSize(limitBytes);
27292
- return /* @__PURE__ */ jsx19(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs10(DialogContent, { showCloseButton: false, className: "w-full max-w-lg gap-0 p-0", children: [
27293
- /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
27294
- /* @__PURE__ */ jsxs10("div", { children: [
27285
+ return /* @__PURE__ */ jsx19(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs11(DialogContent, { showCloseButton: false, className: "w-full max-w-lg gap-0 p-0", children: [
27286
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3", children: [
27287
+ /* @__PURE__ */ jsxs11("div", { children: [
27295
27288
  /* @__PURE__ */ jsx19(DialogTitle, { className: "text-sm font-semibold text-[hsl(var(--foreground))]", children: "\u9644\u4EF6\u8D85\u8FC7\u5927\u5C0F\u9650\u5236" }),
27296
- /* @__PURE__ */ jsxs10("p", { className: "mt-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
27289
+ /* @__PURE__ */ jsxs11("p", { className: "mt-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
27297
27290
  "\u5355\u4E2A\u9644\u4EF6\u6700\u5927\u652F\u6301 ",
27298
27291
  limitText,
27299
27292
  "\u3002\u4EE5\u4E0B\u6587\u4EF6\u672A\u52A0\u5165\u9644\u4EF6\u5217\u8868\u3002"
@@ -27308,7 +27301,7 @@ function FileSizeLimitDialog({
27308
27301
  }
27309
27302
  )
27310
27303
  ] }),
27311
- /* @__PURE__ */ jsx19("div", { className: "max-h-[min(50vh,24rem)] overflow-auto px-4 py-3", children: /* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-2", children: files.map((file) => /* @__PURE__ */ jsxs10(
27304
+ /* @__PURE__ */ jsx19("div", { className: "max-h-[min(50vh,24rem)] overflow-auto px-4 py-3", children: /* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-2", children: files.map((file) => /* @__PURE__ */ jsxs11(
27312
27305
  "div",
27313
27306
  {
27314
27307
  className: "flex items-center justify-between gap-3 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--accent))] px-3 py-2",
@@ -27397,7 +27390,7 @@ function reasoningLevelLabel(level) {
27397
27390
  }
27398
27391
 
27399
27392
  // src/rich-input/ReasoningModeSelect.tsx
27400
- import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
27393
+ import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
27401
27394
  function ReasoningModeSelect({
27402
27395
  level,
27403
27396
  levels,
@@ -27405,8 +27398,8 @@ function ReasoningModeSelect({
27405
27398
  disabledReason,
27406
27399
  onChange
27407
27400
  }) {
27408
- return /* @__PURE__ */ jsxs11("label", { className: "flex w-full flex-col gap-1 px-3 py-2", children: [
27409
- /* @__PURE__ */ jsxs11("span", { className: "flex w-full items-center gap-2", children: [
27401
+ return /* @__PURE__ */ jsxs12("label", { className: "flex w-full flex-col gap-1 px-3 py-2", children: [
27402
+ /* @__PURE__ */ jsxs12("span", { className: "flex w-full items-center gap-2", children: [
27410
27403
  /* @__PURE__ */ jsx20(Brain, { size: 14, className: `shrink-0 ${chatTone("reasoning").text}`, "aria-hidden": "true" }),
27411
27404
  /* @__PURE__ */ jsx20("span", { className: "shrink-0", children: "\u601D\u8003\u6A21\u5F0F" }),
27412
27405
  /* @__PURE__ */ jsx20(
@@ -27427,9 +27420,9 @@ function ReasoningModeSelect({
27427
27420
  }
27428
27421
 
27429
27422
  // src/rich-input/PlanningToggle.tsx
27430
- import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
27423
+ import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
27431
27424
  function PlanningToggle({ enabled, onChange, disabled }) {
27432
- return /* @__PURE__ */ jsxs12(
27425
+ return /* @__PURE__ */ jsxs13(
27433
27426
  "button",
27434
27427
  {
27435
27428
  type: "button",
@@ -27441,11 +27434,11 @@ function PlanningToggle({ enabled, onChange, disabled }) {
27441
27434
  disabled,
27442
27435
  className: "flex w-full items-center justify-between gap-3 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--accent))] disabled:cursor-not-allowed disabled:opacity-50",
27443
27436
  children: [
27444
- /* @__PURE__ */ jsxs12("span", { className: "flex items-center gap-2", children: [
27437
+ /* @__PURE__ */ jsxs13("span", { className: "flex items-center gap-2", children: [
27445
27438
  /* @__PURE__ */ jsx21(Lightbulb, { size: 14, className: "text-[#F97316]", "aria-hidden": "true" }),
27446
27439
  "\u89C4\u5212\u6A21\u5F0F"
27447
27440
  ] }),
27448
- /* @__PURE__ */ jsxs12("span", { className: "flex items-center gap-2", children: [
27441
+ /* @__PURE__ */ jsxs13("span", { className: "flex items-center gap-2", children: [
27449
27442
  /* @__PURE__ */ jsx21("span", { className: "text-[hsl(var(--muted-foreground))]", children: enabled ? "\u5F00" : "\u5173" }),
27450
27443
  /* @__PURE__ */ jsx21(
27451
27444
  "span",
@@ -27488,7 +27481,7 @@ function ComposerAttachmentViewport({
27488
27481
  }
27489
27482
 
27490
27483
  // src/rich-input/ChatInput.tsx
27491
- import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
27484
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
27492
27485
  var RECENT_SESSION_LIMIT = 50;
27493
27486
  var DOUBLE_ESCAPE_MS = 450;
27494
27487
  function getEditorText(editor) {
@@ -27659,7 +27652,7 @@ function ComposerFilePill({
27659
27652
  const isFailed = isFile && attachment.status === "failed";
27660
27653
  const isUploading = isFile && attachment.status === "uploading";
27661
27654
  const uploadPercent = isUploading && typeof attachment.uploadProgress === "number" ? Math.max(0, Math.min(100, Math.round(attachment.uploadProgress * 100))) : null;
27662
- return /* @__PURE__ */ jsxs13(
27655
+ return /* @__PURE__ */ jsxs14(
27663
27656
  "div",
27664
27657
  {
27665
27658
  className: `relative flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full border px-2.5 py-1 text-[11px] ${isFailed ? "border-[hsl(var(--swf-danger)/0.3)] bg-[hsl(var(--swf-danger-soft))] text-[hsl(var(--swf-danger))]" : "border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--foreground))]"}`,
@@ -27679,7 +27672,7 @@ function ComposerFilePill({
27679
27672
  }
27680
27673
  ) : /* @__PURE__ */ jsx24(Icon, { size: 12, className: "relative z-10 shrink-0 text-[hsl(var(--muted-foreground))]" }),
27681
27674
  /* @__PURE__ */ jsx24("span", { className: "relative z-10 max-w-32 truncate", children: attachment.name }),
27682
- uploadPercent !== null ? /* @__PURE__ */ jsxs13("span", { className: "relative z-10 font-mono text-[10px] tabular-nums text-[hsl(var(--muted-foreground))]", children: [
27675
+ uploadPercent !== null ? /* @__PURE__ */ jsxs14("span", { className: "relative z-10 font-mono text-[10px] tabular-nums text-[hsl(var(--muted-foreground))]", children: [
27683
27676
  uploadPercent,
27684
27677
  "%"
27685
27678
  ] }) : null,
@@ -27829,14 +27822,14 @@ ${upload.rawResultStr.slice(0, CONTEXT_INLINE_THRESHOLD)}...`
27829
27822
  onKeyDown: (e) => {
27830
27823
  if (e.key === "Escape") onClose();
27831
27824
  },
27832
- children: /* @__PURE__ */ jsxs13(
27825
+ children: /* @__PURE__ */ jsxs14(
27833
27826
  "div",
27834
27827
  {
27835
27828
  className: "w-full max-w-lg flex flex-col rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] shadow-[var(--swf-shadow-overlay)]",
27836
27829
  onClick: (e) => e.stopPropagation(),
27837
27830
  onKeyDown: (e) => e.stopPropagation(),
27838
27831
  children: [
27839
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-5 py-3", children: [
27832
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-5 py-3", children: [
27840
27833
  /* @__PURE__ */ jsx24("h4", { className: "text-sm font-semibold text-[hsl(var(--foreground))]", children: "\u6DFB\u52A0\u4E0A\u4E0B\u6587" }),
27841
27834
  /* @__PURE__ */ jsx24(
27842
27835
  "button",
@@ -27848,9 +27841,9 @@ ${upload.rawResultStr.slice(0, CONTEXT_INLINE_THRESHOLD)}...`
27848
27841
  }
27849
27842
  )
27850
27843
  ] }),
27851
- /* @__PURE__ */ jsxs13("div", { className: "px-5 py-4 space-y-3", children: [
27852
- /* @__PURE__ */ jsxs13("div", { className: "relative", children: [
27853
- /* @__PURE__ */ jsxs13(
27844
+ /* @__PURE__ */ jsxs14("div", { className: "px-5 py-4 space-y-3", children: [
27845
+ /* @__PURE__ */ jsxs14("div", { className: "relative", children: [
27846
+ /* @__PURE__ */ jsxs14(
27854
27847
  "button",
27855
27848
  {
27856
27849
  type: "button",
@@ -27863,10 +27856,10 @@ ${upload.rawResultStr.slice(0, CONTEXT_INLINE_THRESHOLD)}...`
27863
27856
  ]
27864
27857
  }
27865
27858
  ),
27866
- showSessionPicker && /* @__PURE__ */ jsx24("div", { className: "absolute left-0 top-full z-10 mt-1 max-h-48 w-full overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] shadow-[var(--swf-shadow-overlay)]", children: loadingSessions ? /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 px-3 py-2.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
27859
+ showSessionPicker && /* @__PURE__ */ jsx24("div", { className: "absolute left-0 top-full z-10 mt-1 max-h-48 w-full overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] shadow-[var(--swf-shadow-overlay)]", children: loadingSessions ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 px-3 py-2.5 text-xs text-[hsl(var(--muted-foreground))]", children: [
27867
27860
  /* @__PURE__ */ jsx24(LoaderCircle, { size: 12, className: "animate-spin" }),
27868
27861
  "\u52A0\u8F7D\u4F1A\u8BDD\u5217\u8868\u2026"
27869
- ] }) : sessions.length === 0 ? /* @__PURE__ */ jsx24("div", { className: "px-3 py-2.5 text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u5176\u4ED6\u4F1A\u8BDD" }) : sessions.map((s) => /* @__PURE__ */ jsxs13(
27862
+ ] }) : sessions.length === 0 ? /* @__PURE__ */ jsx24("div", { className: "px-3 py-2.5 text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u5176\u4ED6\u4F1A\u8BDD" }) : sessions.map((s) => /* @__PURE__ */ jsxs14(
27870
27863
  "button",
27871
27864
  {
27872
27865
  type: "button",
@@ -27881,7 +27874,7 @@ ${upload.rawResultStr.slice(0, CONTEXT_INLINE_THRESHOLD)}...`
27881
27874
  s.id
27882
27875
  )) })
27883
27876
  ] }),
27884
- /* @__PURE__ */ jsxs13("div", { children: [
27877
+ /* @__PURE__ */ jsxs14("div", { children: [
27885
27878
  /* @__PURE__ */ jsx24("label", { htmlFor: "ctx-label", className: "block text-xs font-medium text-[hsl(var(--foreground))] mb-1", children: "\u6807\u7B7E" }),
27886
27879
  /* @__PURE__ */ jsx24(
27887
27880
  "input",
@@ -27894,9 +27887,9 @@ ${upload.rawResultStr.slice(0, CONTEXT_INLINE_THRESHOLD)}...`
27894
27887
  }
27895
27888
  )
27896
27889
  ] }),
27897
- /* @__PURE__ */ jsxs13("div", { children: [
27890
+ /* @__PURE__ */ jsxs14("div", { children: [
27898
27891
  /* @__PURE__ */ jsx24("label", { htmlFor: "ctx-content", className: "block text-xs font-medium text-[hsl(var(--foreground))] mb-1", children: "\u5185\u5BB9" }),
27899
- isImportProcessing && /* @__PURE__ */ jsxs13("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
27892
+ isImportProcessing && /* @__PURE__ */ jsxs14("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
27900
27893
  /* @__PURE__ */ jsx24(LoaderCircle, { size: 12, className: "animate-spin" }),
27901
27894
  "\u6B63\u5728\u5904\u7406\u5BFC\u5165\u5185\u5BB9\u5E76\u5199\u5165 workspace/context\uFF0C\u5B8C\u6210\u540E\u53EF\u70B9\u51FB\u201C\u786E\u5B9A\u201D"
27902
27895
  ] }),
@@ -27913,7 +27906,7 @@ ${upload.rawResultStr.slice(0, CONTEXT_INLINE_THRESHOLD)}...`
27913
27906
  )
27914
27907
  ] })
27915
27908
  ] }),
27916
- /* @__PURE__ */ jsxs13("div", { className: "flex justify-end gap-2 border-t border-[hsl(var(--border))] px-5 py-3", children: [
27909
+ /* @__PURE__ */ jsxs14("div", { className: "flex justify-end gap-2 border-t border-[hsl(var(--border))] px-5 py-3", children: [
27917
27910
  /* @__PURE__ */ jsx24(
27918
27911
  "button",
27919
27912
  {
@@ -27954,8 +27947,8 @@ function ComposerContextPill({
27954
27947
  }) {
27955
27948
  const [showDetail, setShowDetail] = useState11(false);
27956
27949
  const tokenK = formatTokenK(content);
27957
- return /* @__PURE__ */ jsxs13(Fragment6, { children: [
27958
- /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--accent))] px-2.5 py-1 text-[11px] text-[hsl(var(--foreground))]", children: [
27950
+ return /* @__PURE__ */ jsxs14(Fragment6, { children: [
27951
+ /* @__PURE__ */ jsxs14("div", { className: "flex shrink-0 items-center gap-1.5 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--accent))] px-2.5 py-1 text-[11px] text-[hsl(var(--foreground))]", children: [
27959
27952
  imageUrl ? /* @__PURE__ */ jsx24(
27960
27953
  "button",
27961
27954
  {
@@ -28004,15 +27997,15 @@ function ComposerContextPill({
28004
27997
  onKeyDown: (e) => {
28005
27998
  if (e.key === "Escape") setShowDetail(false);
28006
27999
  },
28007
- children: /* @__PURE__ */ jsxs13(
28000
+ children: /* @__PURE__ */ jsxs14(
28008
28001
  "div",
28009
28002
  {
28010
28003
  className: "w-full max-w-4xl max-h-[85vh] flex flex-col rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] shadow-[var(--swf-shadow-overlay)]",
28011
28004
  onClick: (e) => e.stopPropagation(),
28012
28005
  onKeyDown: (e) => e.stopPropagation(),
28013
28006
  children: [
28014
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-6 py-3", children: [
28015
- /* @__PURE__ */ jsxs13("div", { className: "min-w-0", children: [
28007
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between border-b border-[hsl(var(--border))] px-6 py-3", children: [
28008
+ /* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
28016
28009
  /* @__PURE__ */ jsx24("h4", { className: "truncate text-xs font-semibold text-[hsl(var(--foreground))]", children: label }),
28017
28010
  imageUrl ? /* @__PURE__ */ jsx24("p", { className: "mt-0.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: "\u5DF2\u9644\u52A0\u9009\u4E2D\u533A\u57DF\u622A\u56FE\uFF0C\u975E\u591A\u6A21\u6001\u6A21\u578B\u4F1A\u81EA\u52A8\u5FFD\u7565\u56FE\u7247\u3002" }) : null
28018
28011
  ] }),
@@ -28026,7 +28019,7 @@ function ComposerContextPill({
28026
28019
  }
28027
28020
  )
28028
28021
  ] }),
28029
- /* @__PURE__ */ jsxs13("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children: [
28022
+ /* @__PURE__ */ jsxs14("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children: [
28030
28023
  imageUrl ? /* @__PURE__ */ jsx24("div", { className: "mb-4 rounded-xl border border-[hsl(var(--border))] bg-white p-2", children: /* @__PURE__ */ jsx24("img", { src: imageUrl, alt: "\u9009\u4E2D\u533A\u57DF\u622A\u56FE", className: "max-h-72 max-w-full rounded-lg object-contain" }) }) : null,
28031
28024
  /* @__PURE__ */ jsx24("pre", { className: "whitespace-pre-wrap break-words font-mono text-[11px] leading-[1.6] text-[hsl(var(--foreground)/0.85)]", children: content })
28032
28025
  ] })
@@ -28062,6 +28055,7 @@ function showVoiceInputErrorToast(environment, error) {
28062
28055
  });
28063
28056
  }
28064
28057
  function ChatInput({
28058
+ controlPlacement,
28065
28059
  sessionId: sessionIdProp,
28066
28060
  onSend,
28067
28061
  onStop,
@@ -28850,7 +28844,8 @@ ${append2.text}` : append2.text;
28850
28844
  if (result.uploaded.length > 0) {
28851
28845
  invalidation.filesUploaded(uploadSessionId);
28852
28846
  }
28853
- } catch {
28847
+ } catch (error) {
28848
+ notifyChat(environment, "error", error instanceof BladeApiError ? error.message : "\u9644\u4EF6\u4E0A\u4F20\u5931\u8D25");
28854
28849
  setComposerAttachments(
28855
28850
  (prev) => prev.map(
28856
28851
  (a) => pendingFiles.some((pending) => pending.id === a.id) && a.kind === "file" && a.status === "uploading" ? { ...a, status: "failed" } : a
@@ -29005,15 +29000,97 @@ ${append2.text}` : append2.text;
29005
29000
  );
29006
29001
  });
29007
29002
  const canContinueGeneration = Boolean(activeSessionId) && hasRecoverableLastTurn && !isStreaming && !isCompacting && !hasComposerContent && !isRecording && !isSubmitting && connectionStatus === "connected" && !isModelLoading && hasAvailableModel;
29003
+ const uploadControls = /* @__PURE__ */ jsxs14(Fragment6, { children: [
29004
+ /* @__PURE__ */ jsxs14(
29005
+ "button",
29006
+ {
29007
+ type: "button",
29008
+ onClick: () => {
29009
+ setActionMenuOpen(false);
29010
+ fileInputRef.current?.click();
29011
+ },
29012
+ className: "flex w-full items-center gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-[hsl(var(--accent))]",
29013
+ children: [
29014
+ /* @__PURE__ */ jsx24(Paperclip, { size: 16 }),
29015
+ "\u4E0A\u4F20\u6587\u4EF6"
29016
+ ]
29017
+ }
29018
+ ),
29019
+ /* @__PURE__ */ jsxs14(
29020
+ "button",
29021
+ {
29022
+ type: "button",
29023
+ onClick: () => {
29024
+ setActionMenuOpen(false);
29025
+ folderInputRef.current?.click();
29026
+ },
29027
+ className: "flex w-full items-center gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-[hsl(var(--accent))]",
29028
+ children: [
29029
+ /* @__PURE__ */ jsx24(FolderUp, { size: 16 }),
29030
+ "\u4E0A\u4F20\u6587\u4EF6\u5939"
29031
+ ]
29032
+ }
29033
+ )
29034
+ ] });
29035
+ const modeControls = /* @__PURE__ */ jsxs14(Fragment6, { children: [
29036
+ onToggleMode ? /* @__PURE__ */ jsx24(
29037
+ PlanningToggle,
29038
+ {
29039
+ enabled: isPlanning,
29040
+ onChange: () => {
29041
+ setMoreOptionsOpen(false);
29042
+ setActionMenuOpen(false);
29043
+ onToggleMode();
29044
+ },
29045
+ disabled: isBusy
29046
+ }
29047
+ ) : null,
29048
+ thinkingAvailable && reasoningLevels.length > 0 ? /* @__PURE__ */ jsx24(
29049
+ ReasoningModeSelect,
29050
+ {
29051
+ level: selectedReasoningLevel,
29052
+ levels: reasoningLevels,
29053
+ disabled: isCompacting,
29054
+ disabledReason: developer ? "\u5BF9\u8BDD\u6574\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574" : "\u5904\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574",
29055
+ onChange: model.setReasoningLevel
29056
+ }
29057
+ ) : null
29058
+ ] });
29059
+ const modelControl = /* @__PURE__ */ jsx24(Fragment6, { children: /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2", children: [
29060
+ /* @__PURE__ */ jsx24(Sparkles, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
29061
+ /* @__PURE__ */ jsx24("span", { className: "shrink-0", children: "\u6A21\u578B" }),
29062
+ /* @__PURE__ */ jsx24(
29063
+ ModelSelector,
29064
+ {
29065
+ disabled: isModelLoading,
29066
+ value: selectedModel,
29067
+ onValueChange: model.selectModel,
29068
+ compact: true,
29069
+ placement: "top"
29070
+ }
29071
+ )
29072
+ ] }) });
29073
+ const voiceControl = !isStreaming && !isCompacting && asrEnabled && (isRecording || isVoiceStarting || !hasComposerContent) ? /* @__PURE__ */ jsx24(
29074
+ "button",
29075
+ {
29076
+ type: "button",
29077
+ onClick: voice.toggle,
29078
+ "aria-label": isRecording || isVoiceStarting ? "\u505C\u6B62\u8BED\u97F3\u8F93\u5165" : "\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",
29079
+ title: isVoiceStarting ? "\u6B63\u5728\u8FDE\u63A5\u8BED\u97F3\u8F93\u5165\uFF0C\u70B9\u51FB\u53D6\u6D88" : isRecording ? "\u505C\u6B62\u8BED\u97F3\u8F93\u5165" : "\u8BED\u97F3\u8F93\u5165",
29080
+ className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full transition-colors duration-150 disabled:opacity-40 ${isRecording ? "bg-[hsl(var(--swf-success-soft))] text-[hsl(var(--swf-success))]" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]"}`,
29081
+ children: isVoiceStarting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 18, className: "animate-spin" }) : isRecording ? /* @__PURE__ */ jsx24(VoiceWaveform, { level: voiceLevel, size: 18 }) : /* @__PURE__ */ jsx24(Mic, { size: 19, strokeWidth: 1.85 })
29082
+ }
29083
+ ) : null;
29084
+ const customPlacement = hasCustomComposerPlacement(controlPlacement);
29008
29085
  const hasMoreOptions = !lite;
29009
29086
  const showQueueShortcut = Boolean(input.trim()) && !isSendDisabled && !isStopping && !isRecording && (!isStreaming || queueWhileRunning && !hasRunningSendBlockers());
29010
- return /* @__PURE__ */ jsxs13(Fragment6, { children: [
29011
- /* @__PURE__ */ jsx24("div", { className: `px-5 pb-3 pt-0 ${className ?? ""}`, children: /* @__PURE__ */ jsxs13("div", { className: `mx-auto ${maxWidthClassName} ${innerClassName ?? ""}`, children: [
29012
- statusBarAddon || !lite && activeSessionId ? /* @__PURE__ */ jsxs13("div", { className: "mb-2 flex flex-wrap items-center gap-2 empty:mb-0", children: [
29087
+ return /* @__PURE__ */ jsxs14(Fragment6, { children: [
29088
+ /* @__PURE__ */ jsx24("div", { className: `px-5 pb-3 pt-0 ${className ?? ""}`, children: /* @__PURE__ */ jsxs14("div", { className: `mx-auto ${maxWidthClassName} ${innerClassName ?? ""}`, children: [
29089
+ statusBarAddon || !lite && activeSessionId ? /* @__PURE__ */ jsxs14("div", { className: "mb-2 flex flex-wrap items-center gap-2 empty:mb-0", children: [
29013
29090
  statusBarAddon,
29014
29091
  !lite && activeSessionId ? /* @__PURE__ */ jsx24(BackgroundTasksPill, { sessionId: activeSessionId }) : null
29015
29092
  ] }) : null,
29016
- (!isModelLoading || bannerModelPickerOpen) && !hasAvailableModel ? /* @__PURE__ */ jsxs13("div", { className: "mb-2 flex items-center justify-between gap-3 rounded-xl border border-[hsl(var(--destructive))]/30 bg-[hsl(var(--destructive))]/8 px-3 py-1.5 text-xs text-[hsl(var(--destructive))]", children: [
29093
+ (!isModelLoading || bannerModelPickerOpen) && !hasAvailableModel ? /* @__PURE__ */ jsxs14("div", { className: "mb-2 flex items-center justify-between gap-3 rounded-xl border border-[hsl(var(--destructive))]/30 bg-[hsl(var(--destructive))]/8 px-3 py-1.5 text-xs text-[hsl(var(--destructive))]", children: [
29017
29094
  /* @__PURE__ */ jsx24("span", { className: "min-w-0 flex-1 leading-5", children: modelAvailabilityMessage || "\u6A21\u578B\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u6216\u91CD\u65B0\u9009\u62E9\u6A21\u578B" }),
29018
29095
  /* @__PURE__ */ jsx24(
29019
29096
  ModelSelector,
@@ -29061,15 +29138,15 @@ ${append2.text}` : append2.text;
29061
29138
  if (files.length > 0) void stableAppendFiles(files);
29062
29139
  });
29063
29140
  },
29064
- children: /* @__PURE__ */ jsxs13(
29141
+ children: /* @__PURE__ */ jsxs14(
29065
29142
  "div",
29066
29143
  {
29067
29144
  className: `overflow-visible border bg-[hsl(var(--card))] transition-[box-shadow,border-color] duration-200 ${mergesWithPanelAbove ? "rounded-b-[28px]" : "rounded-[28px]"} ${isRecording ? "border-[hsl(var(--swf-success))]!" : isPlanning ? dragging || isEditorFocused ? "border-[hsl(var(--swf-warning)/0.6)]" : "border-[hsl(var(--swf-warning)/0.3)]" : dragging || isEditorFocused ? "border-[hsl(var(--primary)/0.45)] shadow-[0_2px_16px_-4px_hsl(var(--foreground)/0.1)]" : "border-[hsl(var(--border)/0.85)] shadow-xs"}`,
29068
29145
  children: [
29069
29146
  dragging && /* @__PURE__ */ jsx24("div", { className: `pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-[hsl(var(--primary)/0.06)] ${mergesWithPanelAbove ? "rounded-b-[28px]" : "rounded-[28px]"}`, children: /* @__PURE__ */ jsx24("span", { className: "rounded-full bg-[hsl(var(--primary)/0.12)] px-4 py-2 text-sm font-medium text-[hsl(var(--primary))]", children: "\u677E\u624B\u5F15\u7528\u6587\u4EF6" }) }),
29070
29147
  planPanel,
29071
- composerAttachments.length > 0 && /* @__PURE__ */ jsxs13(ComposerAttachmentViewport, { className: "flex flex-col gap-2 border-b border-[hsl(var(--border))] px-4 py-2", children: [
29072
- imageAttachments.length > 0 && /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-3 gap-2", children: imageAttachments.map((attachment) => /* @__PURE__ */ jsxs13(
29148
+ composerAttachments.length > 0 && /* @__PURE__ */ jsxs14(ComposerAttachmentViewport, { className: "flex flex-col gap-2 border-b border-[hsl(var(--border))] px-4 py-2", children: [
29149
+ imageAttachments.length > 0 && /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-3 gap-2", children: imageAttachments.map((attachment) => /* @__PURE__ */ jsxs14(
29073
29150
  "div",
29074
29151
  {
29075
29152
  className: "relative overflow-hidden rounded-xl border border-[hsl(var(--border))]",
@@ -29106,7 +29183,7 @@ ${append2.text}` : append2.text;
29106
29183
  attachment.id
29107
29184
  )) })
29108
29185
  ] }),
29109
- hasPendingContexts || isSkillEditor ? /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1.5 border-b border-[hsl(var(--border))] px-4 py-2", children: [
29186
+ hasPendingContexts || isSkillEditor ? /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-1.5 border-b border-[hsl(var(--border))] px-4 py-2", children: [
29110
29187
  pendingContexts?.map((context) => /* @__PURE__ */ jsx24(
29111
29188
  ComposerContextPill,
29112
29189
  {
@@ -29148,8 +29225,8 @@ ${append2.text}` : append2.text;
29148
29225
  ),
29149
29226
  attachments ? /* @__PURE__ */ jsx24("div", { className: "border-b border-[hsl(var(--border))] px-4 py-3", children: attachments }) : null,
29150
29227
  slotAboveTextarea ? /* @__PURE__ */ jsx24("div", { className: "border-b border-[hsl(var(--border))] px-4 py-2", children: slotAboveTextarea }) : null,
29151
- /* @__PURE__ */ jsxs13("div", { className: "flex items-end gap-1.5 px-2.5 py-2", children: [
29152
- /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center self-end", children: [
29228
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-end gap-1.5 px-2.5 py-2", children: [
29229
+ /* @__PURE__ */ jsxs14("div", { className: "flex shrink-0 items-center self-end", children: [
29153
29230
  /* @__PURE__ */ jsx24(
29154
29231
  "input",
29155
29232
  {
@@ -29182,7 +29259,57 @@ ${append2.text}` : append2.text;
29182
29259
  ...{ webkitdirectory: "" }
29183
29260
  }
29184
29261
  ),
29185
- /* @__PURE__ */ jsxs13(
29262
+ /* @__PURE__ */ jsx24(ComposerControls, { placement: controlPlacement, controls: {
29263
+ upload: /* @__PURE__ */ jsx24(ComposerControlMenu, { label: "\u4E0A\u4F20", icon: /* @__PURE__ */ jsx24(Paperclip, { size: 16 }), children: uploadControls }),
29264
+ reference: /* @__PURE__ */ jsxs14(ComposerControlMenu, { label: "\u5F15\u7528\u4E0E\u6280\u80FD", icon: /* @__PURE__ */ jsx24(Sparkles, { size: 16 }), children: [
29265
+ " ",
29266
+ /* @__PURE__ */ jsx24(
29267
+ ConnectButton,
29268
+ {
29269
+ variant: "submenu",
29270
+ sessionId: activeSessionId,
29271
+ open: connectMenuOpen,
29272
+ onOpenChange: (open) => {
29273
+ setConnectMenuOpen(open);
29274
+ if (open) setMoreOptionsOpen(false);
29275
+ }
29276
+ }
29277
+ ),
29278
+ /* @__PURE__ */ jsx24("button", { type: "button", onClick: () => editor?.chain().focus().insertContent("@").run(), className: "block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-[hsl(var(--accent))]", children: "\u5F15\u7528\u6587\u4EF6" }),
29279
+ /* @__PURE__ */ jsx24("button", { type: "button", onClick: () => editor?.chain().focus().insertContent("/").run(), className: "block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-[hsl(var(--accent))]", children: "\u9009\u62E9\u6280\u80FD" })
29280
+ ] }),
29281
+ mode: !lite ? /* @__PURE__ */ jsx24(ComposerControlMenu, { label: "\u6A21\u5F0F", icon: /* @__PURE__ */ jsx24(SlidersHorizontal, { size: 16 }), children: modeControls }) : null,
29282
+ model: modelControl,
29283
+ voice: voiceControl
29284
+ }, moreContent: !lite && (onCommand && canCreateBoardTask || activeSessionId) ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
29285
+ onCommand && canCreateBoardTask ? /* @__PURE__ */ jsx24(dist_exports.Close, { asChild: true, children: /* @__PURE__ */ jsxs14(
29286
+ "button",
29287
+ {
29288
+ type: "button",
29289
+ onClick: () => {
29290
+ void onCommand("create_board_task");
29291
+ },
29292
+ className: "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-xs transition-colors hover:bg-[hsl(var(--accent))]",
29293
+ children: [
29294
+ /* @__PURE__ */ jsx24(ListPlus, { size: 14, className: "shrink-0" }),
29295
+ /* @__PURE__ */ jsx24("span", { children: "\u521B\u5EFA\u540E\u53F0\u4EFB\u52A1" })
29296
+ ]
29297
+ }
29298
+ ) }) : null,
29299
+ activeSessionId ? /* @__PURE__ */ jsxs14("div", { className: "border-t border-[hsl(var(--border))] px-3 py-2.5", children: [
29300
+ /* @__PURE__ */ jsx24(
29301
+ SkillStatusBarComponent,
29302
+ {
29303
+ sessionId: activeSessionId,
29304
+ onOpenSkills,
29305
+ vertical: true,
29306
+ className: skillStatusBarClassName,
29307
+ innerClassName: skillStatusBarInnerClassName
29308
+ }
29309
+ ),
29310
+ composerHint ? /* @__PURE__ */ jsx24("div", { className: "mt-2 border-t border-[hsl(var(--border))] pt-2 text-[hsl(var(--muted-foreground))]", children: composerHint }) : null
29311
+ ] }) : null
29312
+ ] }) : null, children: /* @__PURE__ */ jsxs14(
29186
29313
  dist_exports.Root,
29187
29314
  {
29188
29315
  open: actionMenuOpen,
@@ -29204,7 +29331,7 @@ ${append2.text}` : append2.text;
29204
29331
  children: /* @__PURE__ */ jsx24(Plus, { size: 20, strokeWidth: 1.85 })
29205
29332
  }
29206
29333
  ) }),
29207
- /* @__PURE__ */ jsx24(dist_exports.Portal, { children: /* @__PURE__ */ jsxs13(
29334
+ /* @__PURE__ */ jsx24(dist_exports.Portal, { children: /* @__PURE__ */ jsxs14(
29208
29335
  dist_exports.Content,
29209
29336
  {
29210
29337
  side: "top",
@@ -29212,36 +29339,7 @@ ${append2.text}` : append2.text;
29212
29339
  sideOffset: 8,
29213
29340
  className: "z-30 w-[min(240px,calc(100vw-2rem))] origin-(--radix-popover-content-transform-origin) overflow-visible rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-sm text-[hsl(var(--popover-foreground))] shadow-[var(--swf-shadow-overlay)] outline-none 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=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
29214
29341
  children: [
29215
- /* @__PURE__ */ jsxs13(
29216
- "button",
29217
- {
29218
- type: "button",
29219
- onClick: () => {
29220
- setActionMenuOpen(false);
29221
- fileInputRef.current?.click();
29222
- },
29223
- className: "flex w-full items-center gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-[hsl(var(--accent))]",
29224
- children: [
29225
- /* @__PURE__ */ jsx24(Paperclip, { size: 16 }),
29226
- "\u4E0A\u4F20\u6587\u4EF6"
29227
- ]
29228
- }
29229
- ),
29230
- /* @__PURE__ */ jsxs13(
29231
- "button",
29232
- {
29233
- type: "button",
29234
- onClick: () => {
29235
- setActionMenuOpen(false);
29236
- folderInputRef.current?.click();
29237
- },
29238
- className: "flex w-full items-center gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-[hsl(var(--accent))]",
29239
- children: [
29240
- /* @__PURE__ */ jsx24(FolderUp, { size: 16 }),
29241
- "\u4E0A\u4F20\u6587\u4EF6\u5939"
29242
- ]
29243
- }
29244
- ),
29342
+ uploadControls,
29245
29343
  /* @__PURE__ */ jsx24(
29246
29344
  ConnectButton,
29247
29345
  {
@@ -29254,7 +29352,7 @@ ${append2.text}` : append2.text;
29254
29352
  }
29255
29353
  }
29256
29354
  ),
29257
- hasMoreOptions ? /* @__PURE__ */ jsxs13(Fragment6, { children: [
29355
+ hasMoreOptions ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
29258
29356
  /* @__PURE__ */ jsx24("div", { className: "my-1 h-px bg-[hsl(var(--border)/0.75)]" }),
29259
29357
  /* @__PURE__ */ jsx24(
29260
29358
  InputActionSubmenu,
@@ -29266,8 +29364,8 @@ ${append2.text}` : append2.text;
29266
29364
  setMoreOptionsOpen(open);
29267
29365
  if (open) setConnectMenuOpen(false);
29268
29366
  },
29269
- children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-0.5 py-0.5 text-xs", children: [
29270
- onCommand && canCreateBoardTask && !lite ? /* @__PURE__ */ jsxs13(
29367
+ children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-0.5 py-0.5 text-xs", children: [
29368
+ onCommand && canCreateBoardTask && !lite ? /* @__PURE__ */ jsxs14(
29271
29369
  "button",
29272
29370
  {
29273
29371
  type: "button",
@@ -29283,43 +29381,9 @@ ${append2.text}` : append2.text;
29283
29381
  ]
29284
29382
  }
29285
29383
  ) : null,
29286
- onToggleMode ? /* @__PURE__ */ jsx24(
29287
- PlanningToggle,
29288
- {
29289
- enabled: isPlanning,
29290
- onChange: () => {
29291
- setMoreOptionsOpen(false);
29292
- setActionMenuOpen(false);
29293
- onToggleMode();
29294
- },
29295
- disabled: isBusy
29296
- }
29297
- ) : null,
29298
- thinkingAvailable && reasoningLevels.length > 0 ? /* @__PURE__ */ jsx24(
29299
- ReasoningModeSelect,
29300
- {
29301
- level: selectedReasoningLevel,
29302
- levels: reasoningLevels,
29303
- disabled: isCompacting,
29304
- disabledReason: developer ? "\u5BF9\u8BDD\u6574\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574" : "\u5904\u7406\u5B8C\u6210\u540E\u53EF\u8C03\u6574",
29305
- onChange: model.setReasoningLevel
29306
- }
29307
- ) : null,
29308
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2", children: [
29309
- /* @__PURE__ */ jsx24(Sparkles, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
29310
- /* @__PURE__ */ jsx24("span", { className: "shrink-0", children: "\u6A21\u578B" }),
29311
- /* @__PURE__ */ jsx24(
29312
- ModelSelector,
29313
- {
29314
- disabled: isModelLoading,
29315
- value: selectedModel,
29316
- onValueChange: model.selectModel,
29317
- compact: true,
29318
- placement: "top"
29319
- }
29320
- )
29321
- ] }),
29322
- activeSessionId && moreOptionsOpen ? /* @__PURE__ */ jsxs13("div", { className: "border-t border-[hsl(var(--border))] px-3 py-2.5", children: [
29384
+ modeControls,
29385
+ modelControl,
29386
+ activeSessionId && moreOptionsOpen ? /* @__PURE__ */ jsxs14("div", { className: "border-t border-[hsl(var(--border))] px-3 py-2.5", children: [
29323
29387
  /* @__PURE__ */ jsx24(
29324
29388
  SkillStatusBarComponent,
29325
29389
  {
@@ -29341,30 +29405,20 @@ ${append2.text}` : append2.text;
29341
29405
  ) })
29342
29406
  ]
29343
29407
  }
29344
- )
29408
+ ) })
29345
29409
  ] }),
29346
- /* @__PURE__ */ jsxs13("div", { className: "relative min-w-0 flex-1 self-center", children: [
29410
+ /* @__PURE__ */ jsxs14("div", { className: "relative min-w-0 flex-1 self-center", children: [
29347
29411
  input.length === 0 && /* @__PURE__ */ jsx24("div", { className: "pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 select-none truncate text-[15px] leading-6 text-[hsl(var(--muted-foreground)/0.65)]", children: placeholder }),
29348
29412
  /* @__PURE__ */ jsx24(EditorContent, { editor })
29349
29413
  ] }),
29350
- /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center gap-1.5 self-end", children: [
29351
- showQueueShortcut && /* @__PURE__ */ jsxs13("span", { className: "mr-1 hidden text-[11px] text-[hsl(var(--muted-foreground))] sm:inline", children: [
29414
+ /* @__PURE__ */ jsxs14("div", { className: "flex shrink-0 items-center gap-1.5 self-end", children: [
29415
+ showQueueShortcut && /* @__PURE__ */ jsxs14("span", { className: "mr-1 hidden text-[11px] text-[hsl(var(--muted-foreground))] sm:inline", children: [
29352
29416
  queueShortcutLabel(),
29353
29417
  " \xB7 \u6392\u961F\u6D88\u606F"
29354
29418
  ] }),
29355
29419
  slotBeforeSend,
29356
- !isStreaming && !isCompacting && asrEnabled && (isRecording || isVoiceStarting || !hasComposerContent) ? /* @__PURE__ */ jsx24(
29357
- "button",
29358
- {
29359
- type: "button",
29360
- onClick: voice.toggle,
29361
- "aria-label": isRecording || isVoiceStarting ? "\u505C\u6B62\u8BED\u97F3\u8F93\u5165" : "\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",
29362
- title: isVoiceStarting ? "\u6B63\u5728\u8FDE\u63A5\u8BED\u97F3\u8F93\u5165\uFF0C\u70B9\u51FB\u53D6\u6D88" : isRecording ? "\u505C\u6B62\u8BED\u97F3\u8F93\u5165" : "\u8BED\u97F3\u8F93\u5165",
29363
- className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full transition-colors duration-150 disabled:opacity-40 ${isRecording ? "bg-[hsl(var(--swf-success-soft))] text-[hsl(var(--swf-success))]" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]"}`,
29364
- children: isVoiceStarting ? /* @__PURE__ */ jsx24(LoaderCircle, { size: 18, className: "animate-spin" }) : isRecording ? /* @__PURE__ */ jsx24(VoiceWaveform, { level: voiceLevel, size: 18 }) : /* @__PURE__ */ jsx24(Mic, { size: 19, strokeWidth: 1.85 })
29365
- }
29366
- ) : null,
29367
- isStreaming ? /* @__PURE__ */ jsxs13(Fragment6, { children: [
29420
+ !customPlacement ? voiceControl : null,
29421
+ isStreaming ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
29368
29422
  submitWhileRunning && hasComposerContent && !isSendDisabled && !isRecording ? /* @__PURE__ */ jsx24(
29369
29423
  "button",
29370
29424
  {
@@ -29399,7 +29453,7 @@ ${append2.text}` : append2.text;
29399
29453
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[hsl(var(--primary)/0.22)] text-[hsl(var(--primary))] opacity-70",
29400
29454
  children: /* @__PURE__ */ jsx24(LoaderCircle, { size: 16, className: "animate-spin" })
29401
29455
  }
29402
- ) : canContinueGeneration ? /* @__PURE__ */ jsxs13(
29456
+ ) : canContinueGeneration ? /* @__PURE__ */ jsxs14(
29403
29457
  "button",
29404
29458
  {
29405
29459
  type: "button",
@@ -29452,7 +29506,7 @@ ${append2.text}` : append2.text;
29452
29506
 
29453
29507
  // src/rich-input/SkillActionMenu.tsx
29454
29508
  import { useEffect as useEffect10, useState as useState12 } from "react";
29455
- import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
29509
+ import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
29456
29510
  function SkillActionMenu({ open, onOpenChange, renderMode, onSelect, onManage, disabled }) {
29457
29511
  return /* @__PURE__ */ jsx25(InputActionSubmenu, { label: "\u6280\u80FD", icon: /* @__PURE__ */ jsx25(Sparkles, { size: 16, "aria-hidden": "true" }), open, onOpenChange, disabled, children: /* @__PURE__ */ jsx25(SkillPicker, { renderMode, onSelect, onManage }) });
29458
29512
  }
@@ -29472,12 +29526,12 @@ function SkillPicker({ renderMode, onSelect, onManage }) {
29472
29526
  active = false;
29473
29527
  };
29474
29528
  }, [client, renderMode, query]);
29475
- return /* @__PURE__ */ jsxs14(Fragment7, { children: [
29476
- /* @__PURE__ */ jsxs14("label", { className: "m-1 flex items-center gap-2 rounded-lg bg-[hsl(var(--muted))] px-3 py-2", children: [
29529
+ return /* @__PURE__ */ jsxs15(Fragment7, { children: [
29530
+ /* @__PURE__ */ jsxs15("label", { className: "m-1 flex items-center gap-2 rounded-lg bg-[hsl(var(--muted))] px-3 py-2", children: [
29477
29531
  /* @__PURE__ */ jsx25(Search, { size: 14, "aria-hidden": "true" }),
29478
29532
  /* @__PURE__ */ jsx25("input", { "aria-label": "\u641C\u7D22\u6280\u80FD", placeholder: "\u641C\u7D22\u6280\u80FD", value: query, onChange: (event) => setQuery(event.target.value), className: "min-w-0 flex-1 bg-transparent outline-none" })
29479
29533
  ] }),
29480
- /* @__PURE__ */ jsx25("div", { className: "max-h-60 overflow-y-auto", children: skills === null ? /* @__PURE__ */ jsx25("p", { className: "px-3 py-2 text-[hsl(var(--muted-foreground))]", children: "\u52A0\u8F7D\u6280\u80FD\u4E2D\u2026" }) : skills.length ? skills.map((skill) => skill.type === "skill" ? /* @__PURE__ */ jsxs14("button", { type: "button", onClick: () => onSelect(skill), className: "flex w-full flex-col gap-1 rounded-lg px-3 py-2 text-left hover:bg-[hsl(var(--accent))] focus-visible:bg-[hsl(var(--accent))]", children: [
29534
+ /* @__PURE__ */ jsx25("div", { className: "max-h-60 overflow-y-auto", children: skills === null ? /* @__PURE__ */ jsx25("p", { className: "px-3 py-2 text-[hsl(var(--muted-foreground))]", children: "\u52A0\u8F7D\u6280\u80FD\u4E2D\u2026" }) : skills.length ? skills.map((skill) => skill.type === "skill" ? /* @__PURE__ */ jsxs15("button", { type: "button", onClick: () => onSelect(skill), className: "flex w-full flex-col gap-1 rounded-lg px-3 py-2 text-left hover:bg-[hsl(var(--accent))] focus-visible:bg-[hsl(var(--accent))]", children: [
29481
29535
  /* @__PURE__ */ jsx25("span", { children: skillDisplayName(skill) }),
29482
29536
  /* @__PURE__ */ jsx25("span", { className: "line-clamp-2 text-[11px] text-[hsl(var(--muted-foreground))]", children: skill.description })
29483
29537
  ] }, skill.skillId) : null) : /* @__PURE__ */ jsx25("p", { className: "px-3 py-2 text-[hsl(var(--muted-foreground))]", children: "\u6CA1\u6709\u5339\u914D\u7684\u6280\u80FD" }) }),
@@ -29491,6 +29545,8 @@ export {
29491
29545
  BackgroundTasksPill,
29492
29546
  ChatInput,
29493
29547
  ComposerAttachmentViewport,
29548
+ ComposerControlMenu,
29549
+ ComposerControls,
29494
29550
  ConnectButton,
29495
29551
  FileCompletionMenu,
29496
29552
  FileMention,
@@ -29539,6 +29595,7 @@ export {
29539
29595
  getTopicAssetSuggestionItems,
29540
29596
  getUnsupportedImageFiles,
29541
29597
  getUserHomeSuggestionItems,
29598
+ hasCustomComposerPlacement,
29542
29599
  installSuggestionOutsideDismiss,
29543
29600
  invalidateSlashSuggestions,
29544
29601
  isImageFile,