@kingsoftcloud/ksadk-web 0.3.5 → 0.3.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.
Files changed (171) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/RELEASE_PROVENANCE.json +2 -2
  3. package/dist-ksadk/assets/{ArtifactsPanel-9RUQms_7.js → ArtifactsPanel-CGbWlMNh.js} +1 -1
  4. package/dist-ksadk/assets/{CodeBlock-iq6mFygx.js → CodeBlock-b4C7upmO.js} +3 -3
  5. package/dist-ksadk/assets/{MathMessageMarkdown-DSd_MMwp.js → MathMessageMarkdown-DbdW5A4_.js} +4 -4
  6. package/dist-ksadk/assets/{MermaidBlock-B1tXyzN9.js → MermaidBlock-BEBN4Ksz.js} +6 -6
  7. package/dist-ksadk/assets/{NativeTerminalPanel-BTTm24gh.js → NativeTerminalPanel-zvL-WpAn.js} +1 -1
  8. package/dist-ksadk/assets/{abnfDiagram-VCTEODGH-CrPuGQ-J.js → abnfDiagram-VCTEODGH-BYafW7Za.js} +1 -1
  9. package/dist-ksadk/assets/{arc-LSpozW7f.js → arc-bTohInsS.js} +1 -1
  10. package/dist-ksadk/assets/architecture-7GRP2DOG-BW5UtSnx.js +1 -0
  11. package/dist-ksadk/assets/{architectureDiagram-5GKGNRK7-BiBddfc6.js → architectureDiagram-5GKGNRK7-Ch5Lbzsi.js} +1 -1
  12. package/dist-ksadk/assets/{blockDiagram-NRAW4CY4-Cfpt59CA.js → blockDiagram-NRAW4CY4-kqF4MDOG.js} +1 -1
  13. package/dist-ksadk/assets/{c4Diagram-UCG6FXSJ-TtkMYecK.js → c4Diagram-UCG6FXSJ-8uSRIODv.js} +1 -1
  14. package/dist-ksadk/assets/channel-CF5Up3hQ.js +1 -0
  15. package/dist-ksadk/assets/chunk-2Q5K7J3B-KkXX47WI.js +1 -0
  16. package/dist-ksadk/assets/{chunk-5VM5RSS4-QNTrS1KC.js → chunk-5VM5RSS4-DkhehZDr.js} +1 -1
  17. package/dist-ksadk/assets/{chunk-F27PBJKO-CHsVsbjO.js → chunk-F27PBJKO-BdXhtPe9.js} +1 -1
  18. package/dist-ksadk/assets/{chunk-G27WJ6UU-BiyNaPce.js → chunk-G27WJ6UU-DPTpvpwi.js} +1 -1
  19. package/dist-ksadk/assets/{chunk-JWPE2WC7-EjVrwIfj.js → chunk-JWPE2WC7-Pqoh38el.js} +1 -1
  20. package/dist-ksadk/assets/{chunk-LCL6LL3I-BCXNTVwQ.js → chunk-LCL6LL3I-DeU00qC-.js} +1 -1
  21. package/dist-ksadk/assets/{chunk-POPQ4Y6H-BNP6opFp.js → chunk-POPQ4Y6H-CzxScFkr.js} +1 -1
  22. package/dist-ksadk/assets/{chunk-RHFEMEQ7-CroPk1q-.js → chunk-RHFEMEQ7-DpqMx-ux.js} +1 -1
  23. package/dist-ksadk/assets/{chunk-SVP7TREG-8eF2thNo.js → chunk-SVP7TREG-C6t0SypQ.js} +1 -1
  24. package/dist-ksadk/assets/{chunk-XXDRQBXY-CfKEfSWB.js → chunk-XXDRQBXY-DVaeafZk.js} +1 -1
  25. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-Cz81acRQ.js +1 -0
  26. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-Cz81acRQ.js +1 -0
  27. package/dist-ksadk/assets/{cose-bilkent-JH36ORCC-NYLLr4y3.js → cose-bilkent-JH36ORCC-Bf9D3tzJ.js} +1 -1
  28. package/dist-ksadk/assets/cynefin-OW5HDTMX-DVWs8a2t.js +1 -0
  29. package/dist-ksadk/assets/{cynefinDiagram-5FMLGOSQ-1t2bjASn.js → cynefinDiagram-5FMLGOSQ-B9cY3iTz.js} +1 -1
  30. package/dist-ksadk/assets/{dagre-3AP2YEHR-CyCcpGXQ.js → dagre-3AP2YEHR-CSwlx3CB.js} +1 -1
  31. package/dist-ksadk/assets/{dagre-DIBkWWe5.js → dagre-UBpgon5q.js} +1 -1
  32. package/dist-ksadk/assets/{diagram-S7CK7UJ4-Qnyx09fY.js → diagram-S7CK7UJ4-C9akhN9a.js} +1 -1
  33. package/dist-ksadk/assets/{diagram-UQ7AKVKN-BBuBi2BK.js → diagram-UQ7AKVKN-CgedhTPI.js} +1 -1
  34. package/dist-ksadk/assets/{diagram-VSXAHHWV-Cu2pi7DX.js → diagram-VSXAHHWV-Cjucz5BY.js} +1 -1
  35. package/dist-ksadk/assets/{diagram-VX7I27RA-D1hy0wPv.js → diagram-VX7I27RA-Dd4Vleyn.js} +1 -1
  36. package/dist-ksadk/assets/{diagram-Z3DM3KII-DG_ukeOg.js → diagram-Z3DM3KII-CZ2jGtYW.js} +1 -1
  37. package/dist-ksadk/assets/{dist-Bami3Hbn.js → dist-B2_CVgKv.js} +1 -1
  38. package/dist-ksadk/assets/{dist-C8E2u2Gy.js → dist-B3FR1SKK.js} +1 -1
  39. package/dist-ksadk/assets/{dist-snMJ4dAH.js → dist-BIr4DSRq.js} +1 -1
  40. package/dist-ksadk/assets/{dist-32Woo6w8.js → dist-BgV_owcB.js} +1 -1
  41. package/dist-ksadk/assets/{dist-CgpyS7Tw.js → dist-Bj730Ib4.js} +1 -1
  42. package/dist-ksadk/assets/{dist-Dbb1c9iJ.js → dist-BnaTiyzN.js} +1 -1
  43. package/dist-ksadk/assets/{dist-BDYKkv8k.js → dist-C1NMAY5a.js} +1 -1
  44. package/dist-ksadk/assets/{dist-Bo0uuYGj.js → dist-C5_ZAZsG.js} +1 -1
  45. package/dist-ksadk/assets/{dist-Bzd96FWg.js → dist-CB9iJrvg.js} +1 -1
  46. package/dist-ksadk/assets/{dist-7mNpnBIq.js → dist-CFzsn6BG.js} +1 -1
  47. package/dist-ksadk/assets/{dist-BoDw8sHC.js → dist-Cf125P_m.js} +1 -1
  48. package/dist-ksadk/assets/{dist-D0t-jg0i.js → dist-ClYUxfeK.js} +1 -1
  49. package/dist-ksadk/assets/{dist-vM3yu1Iv.js → dist-DFD6Qa6T.js} +1 -1
  50. package/dist-ksadk/assets/{dist-_RQDZ9v3.js → dist-DVCOWtha.js} +1 -1
  51. package/dist-ksadk/assets/{dist-C6YcRSBB.js → dist-D_ctSS2i.js} +1 -1
  52. package/dist-ksadk/assets/{dist-BRFE6wml.js → dist-DiixqL0J.js} +1 -1
  53. package/dist-ksadk/assets/{dist-mo17RERT.js → dist-DoVSwoDb.js} +1 -1
  54. package/dist-ksadk/assets/{dist-dLCAHoLT.js → dist-DvFK7p5S.js} +1 -1
  55. package/dist-ksadk/assets/{dist-CsdC51-G.js → dist-QfkEHOlb.js} +1 -1
  56. package/dist-ksadk/assets/{dist-39frJg8c.js → dist-btbmmX5O.js} +1 -1
  57. package/dist-ksadk/assets/{dist-BbqgJcRm.js → dist-fBO2v5Kt.js} +1 -1
  58. package/dist-ksadk/assets/{dist-D2l4f5Dh.js → dist-ufY3F5p6.js} +1 -1
  59. package/dist-ksadk/assets/{ebnfDiagram-PWID7BFC-DuBo2W05.js → ebnfDiagram-PWID7BFC-Ci8NqqZu.js} +1 -1
  60. package/dist-ksadk/assets/{erDiagram-SSCWMZ5O-ZJrJetMD.js → erDiagram-SSCWMZ5O-CCIOhLZG.js} +1 -1
  61. package/dist-ksadk/assets/eventmodeling-NTZA5JFV-CQqR2hg3.js +1 -0
  62. package/dist-ksadk/assets/flowDiagram-A5DVABFB-DDRRbGPm.js +1 -0
  63. package/dist-ksadk/assets/{ganttDiagram-EL5Y4UJY-Bwk2yIEM.js → ganttDiagram-EL5Y4UJY-Cp_r9Hb6.js} +1 -1
  64. package/dist-ksadk/assets/gitGraph-4MIJSDKK-fgWEf7UD.js +1 -0
  65. package/dist-ksadk/assets/{gitGraphDiagram-WWUBYQGX-DWYLIagz.js → gitGraphDiagram-WWUBYQGX-Dlhc8Wr8.js} +1 -1
  66. package/dist-ksadk/assets/index-DcTML1Up.css +2 -0
  67. package/dist-ksadk/assets/index-Dh2XHqPK.js +244 -0
  68. package/dist-ksadk/assets/info-A6RAGUB7-BUecLTdt.js +1 -0
  69. package/dist-ksadk/assets/{infoDiagram-RXCK75RN-DMPen5_h.js → infoDiagram-RXCK75RN-CO0rRTRA.js} +1 -1
  70. package/dist-ksadk/assets/{ishikawaDiagram-5VMMS53U-DsPNKFIz.js → ishikawaDiagram-5VMMS53U-CHiaedSS.js} +1 -1
  71. package/dist-ksadk/assets/{journeyDiagram-EYS64GPL-BNbTP-8a.js → journeyDiagram-EYS64GPL-CHcCIB09.js} +1 -1
  72. package/dist-ksadk/assets/{kanban-definition-3QL26DDD-BKR6Itkv.js → kanban-definition-3QL26DDD-CJ_ebBZf.js} +1 -1
  73. package/dist-ksadk/assets/{katex-B0oLa8CR.js → katex-B4weu383.js} +1 -1
  74. package/dist-ksadk/assets/{linear-B3_la4oE.js → linear-V-MgYHW1.js} +1 -1
  75. package/dist-ksadk/assets/{mermaid-parser.core-B6PQSAV-.js → mermaid-parser.core-CBijEX_c.js} +2 -2
  76. package/dist-ksadk/assets/{mindmap-definition-FBJOCRG2-By8qFxGO.js → mindmap-definition-FBJOCRG2-Bc-pQvpp.js} +1 -1
  77. package/dist-ksadk/assets/packet-AYTQ26CC-BeW-btFv.js +1 -0
  78. package/dist-ksadk/assets/{pegDiagram-XKGWAZYB-K1kvFBKC.js → pegDiagram-XKGWAZYB-D7genGLl.js} +1 -1
  79. package/dist-ksadk/assets/pie-WAS4IAKB-X0xh4SaT.js +1 -0
  80. package/dist-ksadk/assets/{pieDiagram-E7YTZNPT-5XFtDn56.js → pieDiagram-E7YTZNPT-Bxj32zwD.js} +1 -1
  81. package/dist-ksadk/assets/{quadrantDiagram-AXDQQJYC-DQwy74C1.js → quadrantDiagram-AXDQQJYC-BURv2mGh.js} +1 -1
  82. package/dist-ksadk/assets/radar-RG4KPBEZ-DzRMSqjd.js +1 -0
  83. package/dist-ksadk/assets/railroad-74A4TZTK-Cc44icX-.js +1 -0
  84. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-D6S4BdV-.js +1 -0
  85. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-vD3aVE2o.js +1 -0
  86. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-CYbW_b4T.js +1 -0
  87. package/dist-ksadk/assets/{railroadDiagram-O6MQD6OU-cozhldnA.js → railroadDiagram-O6MQD6OU-CCsh3avW.js} +1 -1
  88. package/dist-ksadk/assets/{requirementDiagram-EFPCY7ZU-CElPZjXR.js → requirementDiagram-EFPCY7ZU-_FRRBKEd.js} +1 -1
  89. package/dist-ksadk/assets/{sankeyDiagram-P5KCCOFB-y_USXv4y.js → sankeyDiagram-P5KCCOFB-C-gr2o9M.js} +1 -1
  90. package/dist-ksadk/assets/{sequenceDiagram-WJ2MYXX4-BJbQk7Za.js → sequenceDiagram-WJ2MYXX4-D97NmfKg.js} +1 -1
  91. package/dist-ksadk/assets/{sizeCapture-X5ZJPWSS-DAaf435S.js → sizeCapture-X5ZJPWSS-DjrPC5FX.js} +1 -1
  92. package/dist-ksadk/assets/{stateDiagram-HBIQ2CUA-BiLbLu1I.js → stateDiagram-HBIQ2CUA-DzMNg1hh.js} +1 -1
  93. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-BIcjKFhF.js +1 -0
  94. package/dist-ksadk/assets/{swimlanes-XN3QIQJK-DxhmU8aj.js → swimlanes-XN3QIQJK-Cssf_CsU.js} +1 -1
  95. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-tq3K3Ybl.js +8 -0
  96. package/dist-ksadk/assets/{timeline-definition-24CTP7MA-D18EWv7u.js → timeline-definition-24CTP7MA-BWTHzyS1.js} +1 -1
  97. package/dist-ksadk/assets/treeView-Q6P3EWNA-DBXt3GdU.js +1 -0
  98. package/dist-ksadk/assets/treemap-WGGIJYW6-DrCy4E_l.js +1 -0
  99. package/dist-ksadk/assets/{vennDiagram-4TSXK5OY-rUBCuIGM.js → vennDiagram-4TSXK5OY-BSKgJsmR.js} +1 -1
  100. package/dist-ksadk/assets/wardley-WFR3VGLG-CefhOliM.js +1 -0
  101. package/dist-ksadk/assets/{wardleyDiagram-VM6X3IG4-CDZQ5sZK.js → wardleyDiagram-VM6X3IG4-eflHNoaZ.js} +1 -1
  102. package/dist-ksadk/assets/{xychartDiagram-S5SC5T6Z-CH_HdHYk.js → xychartDiagram-S5SC5T6Z-eYqrQ-v4.js} +1 -1
  103. package/dist-ksadk/index.html +2 -2
  104. package/dist-lib/App.d.ts +3 -1
  105. package/dist-lib/App.d.ts.map +1 -1
  106. package/dist-lib/{ArtifactsPanel-BX-TQaOJ.js → ArtifactsPanel-rz8e8OIc.js} +1 -1
  107. package/dist-lib/{AttachmentPreview-D8BjnDTd.js → AttachmentPreview-CBpwnWxP.js} +1 -1
  108. package/dist-lib/{CodeBlock-D3-ZCOb_.js → CodeBlock-DCUUY0PL.js} +2 -2
  109. package/dist-lib/{ConnectedComposer-BgTxuTfq.js → ConnectedComposer-DQ-yODJ-.js} +33 -34
  110. package/dist-lib/{ConnectedMessageList-BwRiSswQ.js → ConnectedMessageList-DfSvxYLL.js} +42 -42
  111. package/dist-lib/{MathMessageMarkdown-DwgeFqKs.js → MathMessageMarkdown-CBcDrAw-.js} +7 -7
  112. package/dist-lib/{MenuChip-BXivncgX.js → MenuChip-So0XESNz.js} +1 -1
  113. package/dist-lib/{NativeTerminalPanel-DyPvD5ij.js → NativeTerminalPanel-D2J75bIU.js} +1 -1
  114. package/dist-lib/{WorkspacePanelContainer-C-na8Ns1.js → WorkspacePanelContainer-Q8Tt_oXe.js} +682 -659
  115. package/dist-lib/{a2ui-TSXmGrT-.js → a2ui-BVAet3qy.js} +61 -44
  116. package/dist-lib/chat-composer.js +3 -3
  117. package/dist-lib/chat-timeline.js +2 -2
  118. package/dist-lib/components/AgentAuthorizationBoundary.d.ts +16 -0
  119. package/dist-lib/components/AgentAuthorizationBoundary.d.ts.map +1 -0
  120. package/dist-lib/components/chat/ContextUsageIndicator.d.ts.map +1 -1
  121. package/dist-lib/components.js +32 -32
  122. package/dist-lib/hooks/useAgentChat.d.ts.map +1 -1
  123. package/dist-lib/hooks/useBootstrap.d.ts +1 -1
  124. package/dist-lib/hooks/useBootstrap.d.ts.map +1 -1
  125. package/dist-lib/hooks/useInteractions.d.ts +1 -0
  126. package/dist-lib/hooks/useInteractions.d.ts.map +1 -1
  127. package/dist-lib/hooks/useSessionLifecycle.d.ts +2 -0
  128. package/dist-lib/hooks/useSessionLifecycle.d.ts.map +1 -1
  129. package/dist-lib/hooks.js +110 -109
  130. package/dist-lib/permission--lxoX90f.js +25 -0
  131. package/dist-lib/public/components.d.ts +2 -0
  132. package/dist-lib/public/components.d.ts.map +1 -1
  133. package/dist-lib/public/runtime.d.ts +2 -0
  134. package/dist-lib/public/runtime.d.ts.map +1 -1
  135. package/dist-lib/runtime.js +306 -274
  136. package/dist-lib/stores/permission.d.ts +1 -0
  137. package/dist-lib/stores/permission.d.ts.map +1 -1
  138. package/dist-lib/stores/session.d.ts +1 -0
  139. package/dist-lib/stores/session.d.ts.map +1 -1
  140. package/dist-lib/styles.css +1 -1
  141. package/dist-lib/{useSessionLifecycle-DuzkfGgL.js → useSessionLifecycle-DQCw8YmE.js} +614 -588
  142. package/dist-lib/utils/authorization-cache.d.ts +15 -0
  143. package/dist-lib/utils/authorization-cache.d.ts.map +1 -0
  144. package/dist-lib/utils/session.d.ts +1 -1
  145. package/dist-lib/utils/session.d.ts.map +1 -1
  146. package/package.json +1 -1
  147. package/dist-ksadk/assets/architecture-7GRP2DOG-DlLqIl7c.js +0 -1
  148. package/dist-ksadk/assets/channel-cg7jYcXF.js +0 -1
  149. package/dist-ksadk/assets/chunk-2Q5K7J3B-C4iMKTWb.js +0 -1
  150. package/dist-ksadk/assets/classDiagram-DTDB5LWJ-RtbaG_Dz.js +0 -1
  151. package/dist-ksadk/assets/classDiagram-v2-JRS7N3AN-RtbaG_Dz.js +0 -1
  152. package/dist-ksadk/assets/cynefin-OW5HDTMX-BRs0UJ32.js +0 -1
  153. package/dist-ksadk/assets/eventmodeling-NTZA5JFV-DCJzsswd.js +0 -1
  154. package/dist-ksadk/assets/flowDiagram-A5DVABFB-485rByL2.js +0 -1
  155. package/dist-ksadk/assets/gitGraph-4MIJSDKK-C5VB4yJL.js +0 -1
  156. package/dist-ksadk/assets/index-Cp5NEP4y.css +0 -2
  157. package/dist-ksadk/assets/index-j3aFdsSv.js +0 -244
  158. package/dist-ksadk/assets/info-A6RAGUB7-tqDdMmNT.js +0 -1
  159. package/dist-ksadk/assets/packet-AYTQ26CC-BxA-7Hkq.js +0 -1
  160. package/dist-ksadk/assets/pie-WAS4IAKB-3Tmx9EyU.js +0 -1
  161. package/dist-ksadk/assets/radar-RG4KPBEZ-D_bZK5Bu.js +0 -1
  162. package/dist-ksadk/assets/railroad-74A4TZTK-COy6RdCd.js +0 -1
  163. package/dist-ksadk/assets/railroad-abnf-HS5TGJTU-CrdA8h6r.js +0 -1
  164. package/dist-ksadk/assets/railroad-ebnf-LZEXJU2U-BnDti7-r.js +0 -1
  165. package/dist-ksadk/assets/railroad-peg-WCYAUIDC-DmYdbc7f.js +0 -1
  166. package/dist-ksadk/assets/stateDiagram-v2-4QOOHH4V-5rxHhPTD.js +0 -1
  167. package/dist-ksadk/assets/swimlanesDiagram-VK2B7HYN-B3Po2rui.js +0 -8
  168. package/dist-ksadk/assets/treeView-Q6P3EWNA-6G5wA0pE.js +0 -1
  169. package/dist-ksadk/assets/treemap-WGGIJYW6-BE9GnPbg.js +0 -1
  170. package/dist-ksadk/assets/wardley-WFR3VGLG-BYh81kWC.js +0 -1
  171. package/dist-lib/permission-BWkTcIzC.js +0 -24
@@ -1,29 +1,52 @@
1
- import { h as e } from "./a2ui-TSXmGrT-.js";
2
- import { o as t } from "./AttachmentPreview-D8BjnDTd.js";
3
- import { c as n } from "./ConnectedMessageList-BwRiSswQ.js";
4
- import { n as r, t as i } from "./sandbox-BTRIKAO6.js";
5
- import * as a from "react";
6
- import { Suspense as o, lazy as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
7
- import { ArrowUp as m, Code as h, Download as g, ExternalLink as _, Eye as v, FileCode2 as y, FileText as b, FolderOpen as x, Image as S, Loader2 as C, LoaderCircle as w, Maximize2 as T, MessageSquarePlus as E, MessageSquareText as ee, Minimize2 as te, MoreHorizontal as D, Package as ne, PanelLeft as re, PanelLeftClose as O, Pin as ie, PinOff as ae, RefreshCw as oe, Save as se, Search as ce, ShieldCheck as le, TerminalSquare as k, Trash2 as ue, Upload as de, X as fe } from "lucide-react";
8
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
9
- import * as N from "@radix-ui/react-dialog";
10
- import { cva as P } from "class-variance-authority";
11
- import { EditorView as F, crosshairCursor as I, drawSelection as L, dropCursor as R, highlightActiveLine as z, highlightActiveLineGutter as pe, keymap as me, lineNumbers as B, rectangularSelection as V } from "@codemirror/view";
12
- import { Compartment as H, EditorState as U } from "@codemirror/state";
13
- import { defaultKeymap as W, history as G, historyKeymap as K, indentWithTab as he } from "@codemirror/commands";
14
- import { LanguageDescription as ge, bracketMatching as _e, defaultHighlightStyle as ve, foldGutter as q, foldKeymap as J, indentOnInput as ye, syntaxHighlighting as be } from "@codemirror/language";
15
- import { oneDark as xe } from "@codemirror/theme-one-dark";
16
- import { highlightSelectionMatches as Se, searchKeymap as Y } from "@codemirror/search";
17
- import { autocompletion as Ce, closeBrackets as we, closeBracketsKeymap as Te, completionKeymap as Ee } from "@codemirror/autocomplete";
18
- import { languages as De } from "@codemirror/language-data";
1
+ import { _ as e, d as t, p as n, u as r } from "./a2ui-BVAet3qy.js";
2
+ import { o as i } from "./AttachmentPreview-CBpwnWxP.js";
3
+ import { n as a, t as o } from "./permission--lxoX90f.js";
4
+ import { c as s } from "./ConnectedMessageList-DfSvxYLL.js";
5
+ import { n as c, t as l } from "./sandbox-BTRIKAO6.js";
6
+ import * as u from "react";
7
+ import { Suspense as d, lazy as f, useCallback as p, useEffect as m, useId as h, useLayoutEffect as g, useMemo as _, useRef as v, useState as y } from "react";
8
+ import { ArrowUp as b, Code as x, Download as S, ExternalLink as C, Eye as w, FileCode2 as T, FileText as ee, FolderOpen as E, Image as te, Loader2 as ne, LoaderCircle as D, Maximize2 as re, MessageSquarePlus as ie, MessageSquareText as ae, Minimize2 as oe, MoreHorizontal as se, Package as ce, PanelLeft as O, PanelLeftClose as le, Pin as k, PinOff as A, RefreshCw as ue, Save as de, Search as fe, ShieldCheck as j, TerminalSquare as M, Trash2 as pe, Upload as me, X as he } from "lucide-react";
9
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
10
+ import * as I from "@radix-ui/react-dialog";
11
+ import { cva as ge } from "class-variance-authority";
12
+ import { EditorView as L, crosshairCursor as R, drawSelection as z, dropCursor as B, highlightActiveLine as V, highlightActiveLineGutter as H, keymap as U, lineNumbers as W, rectangularSelection as _e } from "@codemirror/view";
13
+ import { Compartment as G, EditorState as K } from "@codemirror/state";
14
+ import { defaultKeymap as ve, history as q, historyKeymap as J, indentWithTab as ye } from "@codemirror/commands";
15
+ import { LanguageDescription as be, bracketMatching as xe, defaultHighlightStyle as Se, foldGutter as Y, foldKeymap as Ce, indentOnInput as we, syntaxHighlighting as Te } from "@codemirror/language";
16
+ import { oneDark as Ee } from "@codemirror/theme-one-dark";
17
+ import { highlightSelectionMatches as De, searchKeymap as Oe } from "@codemirror/search";
18
+ import { autocompletion as ke, closeBrackets as Ae, closeBracketsKeymap as je, completionKeymap as Me } from "@codemirror/autocomplete";
19
+ import { languages as Ne } from "@codemirror/language-data";
20
+ //#region src/components/AgentAuthorizationBoundary.tsx
21
+ function Pe() {
22
+ return /* @__PURE__ */ P("div", {
23
+ className: "ksadk-web",
24
+ children: /* @__PURE__ */ P("div", {
25
+ role: "status",
26
+ className: "fixed inset-0 flex items-center justify-center bg-background text-sm text-text-muted",
27
+ children: "正在初始化会话身份…"
28
+ })
29
+ });
30
+ }
31
+ function Fe({ authorizationScopeKey: e, children: i }) {
32
+ let [s, c] = y(!1);
33
+ return g(() => {
34
+ if (n.enter(e) === "reload") {
35
+ window.location.reload();
36
+ return;
37
+ }
38
+ t.setState({ pinnedSessionIds: r() }), a.setState({ permissionMode: o() }), c(!0);
39
+ }, [e]), !s || !n.matches(e) ? /* @__PURE__ */ P(Pe, {}) : i;
40
+ }
41
+ //#endregion
19
42
  //#region src/components/ui/sheet.tsx
20
- var Oe = N.Root, ke = N.Portal, Ae = a.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ j(N.Overlay, {
21
- className: t("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", e),
22
- ...n,
23
- ref: r
43
+ var Ie = I.Root, Le = I.Portal, Re = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ P(I.Overlay, {
44
+ className: i("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", e),
45
+ ...t,
46
+ ref: n
24
47
  }));
25
- Ae.displayName = N.Overlay.displayName;
26
- var je = P("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", {
48
+ Re.displayName = I.Overlay.displayName;
49
+ var ze = ge("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", {
27
50
  variants: { side: {
28
51
  top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
29
52
  bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
@@ -31,229 +54,229 @@ var je = P("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out
31
54
  right: "inset-y-0 right-0 h-full border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"
32
55
  } },
33
56
  defaultVariants: { side: "right" }
34
- }), Me = a.forwardRef(({ side: e = "right", className: n, children: r, showOverlay: i = !0, showCloseButton: a = !0, ...o }, s) => /* @__PURE__ */ M(ke, { children: [i ? /* @__PURE__ */ j(Ae, {}) : null, /* @__PURE__ */ M(N.Content, {
57
+ }), Be = u.forwardRef(({ side: e = "right", className: t, children: n, showOverlay: r = !0, showCloseButton: a = !0, ...o }, s) => /* @__PURE__ */ F(Le, { children: [r ? /* @__PURE__ */ P(Re, {}) : null, /* @__PURE__ */ F(I.Content, {
35
58
  ref: s,
36
- className: t(je({ side: e }), n),
59
+ className: i(ze({ side: e }), t),
37
60
  ...o,
38
- children: [r, a ? /* @__PURE__ */ M(N.Close, {
61
+ children: [n, a ? /* @__PURE__ */ F(I.Close, {
39
62
  className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",
40
- children: [/* @__PURE__ */ j(fe, { className: "h-4 w-4" }), /* @__PURE__ */ j("span", {
63
+ children: [/* @__PURE__ */ P(he, { className: "h-4 w-4" }), /* @__PURE__ */ P("span", {
41
64
  className: "sr-only",
42
65
  children: "Close"
43
66
  })]
44
67
  }) : null]
45
68
  })] }));
46
- Me.displayName = N.Content.displayName;
47
- var Ne = ({ className: e, ...n }) => /* @__PURE__ */ j("div", {
48
- className: t("flex flex-col space-y-2 text-center sm:text-left", e),
49
- ...n
69
+ Be.displayName = I.Content.displayName;
70
+ var Ve = ({ className: e, ...t }) => /* @__PURE__ */ P("div", {
71
+ className: i("flex flex-col space-y-2 text-center sm:text-left", e),
72
+ ...t
50
73
  });
51
- Ne.displayName = "SheetHeader";
52
- var Pe = ({ className: e, ...n }) => /* @__PURE__ */ j("div", {
53
- className: t("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
54
- ...n
74
+ Ve.displayName = "SheetHeader";
75
+ var He = ({ className: e, ...t }) => /* @__PURE__ */ P("div", {
76
+ className: i("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
77
+ ...t
55
78
  });
56
- Pe.displayName = "SheetFooter";
57
- var Fe = a.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ j(N.Title, {
58
- ref: r,
59
- className: t("text-lg font-semibold text-foreground", e),
60
- ...n
79
+ He.displayName = "SheetFooter";
80
+ var Ue = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ P(I.Title, {
81
+ ref: n,
82
+ className: i("text-lg font-semibold text-foreground", e),
83
+ ...t
61
84
  }));
62
- Fe.displayName = N.Title.displayName;
63
- var Ie = a.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ j(N.Description, {
64
- ref: r,
65
- className: t("text-sm text-muted-foreground", e),
66
- ...n
85
+ Ue.displayName = I.Title.displayName;
86
+ var We = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ P(I.Description, {
87
+ ref: n,
88
+ className: i("text-sm text-muted-foreground", e),
89
+ ...t
67
90
  }));
68
- Ie.displayName = N.Description.displayName;
91
+ We.displayName = I.Description.displayName;
69
92
  //#endregion
70
93
  //#region src/components/chat/ChatHeader.tsx
71
- var Le = s(() => import("./NativeTerminalPanel-DyPvD5ij.js").then((e) => e.n).then((e) => ({ default: e.NativeTerminalPanel })));
72
- function Re({ availableModels: e, selectedModel: n, onSelectModel: r, selectedModelLabel: i, modelCatalogLoaded: a, modelSource: o, thinkingEnabled: s, thinkingMode: c, onSelectThinkingMode: l, compact: u = !1 }) {
73
- let d = t("rounded-full border border-slate-200 bg-white px-3 py-2 text-sm text-slate-700 outline-none transition-colors focus:ring-1 focus:ring-blue-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300", u ? "w-full" : "max-w-[13rem]"), f = e.length > 1 ? /* @__PURE__ */ j("select", {
74
- value: n,
75
- onChange: (e) => r(e.target.value),
94
+ var Ge = f(() => import("./NativeTerminalPanel-D2J75bIU.js").then((e) => e.n).then((e) => ({ default: e.NativeTerminalPanel })));
95
+ function Ke({ availableModels: e, selectedModel: t, onSelectModel: n, selectedModelLabel: r, modelCatalogLoaded: a, modelSource: o, thinkingEnabled: s, thinkingMode: c, onSelectThinkingMode: l, compact: u = !1 }) {
96
+ let d = i("rounded-full border border-slate-200 bg-white px-3 py-2 text-sm text-slate-700 outline-none transition-colors focus:ring-1 focus:ring-blue-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300", u ? "w-full" : "max-w-[13rem]"), f = e.length > 1 ? /* @__PURE__ */ P("select", {
97
+ value: t,
98
+ onChange: (e) => n(e.target.value),
76
99
  className: d,
77
- children: e.map((e) => /* @__PURE__ */ j("option", {
100
+ children: e.map((e) => /* @__PURE__ */ P("option", {
78
101
  value: e.id,
79
102
  children: e.display_name || e.id
80
103
  }, e.id))
81
- }) : i ? /* @__PURE__ */ j("span", {
82
- className: t(d, "inline-flex max-w-full items-center", u ? "justify-start" : ""),
83
- title: o || i,
84
- children: /* @__PURE__ */ j("span", {
104
+ }) : r ? /* @__PURE__ */ P("span", {
105
+ className: i(d, "inline-flex max-w-full items-center", u ? "justify-start" : ""),
106
+ title: o || r,
107
+ children: /* @__PURE__ */ P("span", {
85
108
  className: "truncate",
86
- children: i
109
+ children: r
87
110
  })
88
- }) : /* @__PURE__ */ j("span", {
111
+ }) : /* @__PURE__ */ P("span", {
89
112
  className: "text-sm text-slate-400",
90
113
  children: a ? "未配置模型" : "Loading models..."
91
- }), p = s ? /* @__PURE__ */ M("select", {
114
+ }), p = s ? /* @__PURE__ */ F("select", {
92
115
  value: c,
93
116
  onChange: (e) => l(e.target.value),
94
- className: t(d, u ? "" : "max-w-[9rem]"),
117
+ className: i(d, u ? "" : "max-w-[9rem]"),
95
118
  title: "控制模型 thinking/reasoning 参数",
96
119
  children: [
97
- /* @__PURE__ */ j("option", {
120
+ /* @__PURE__ */ P("option", {
98
121
  value: "auto",
99
122
  children: "思考自动"
100
123
  }),
101
- /* @__PURE__ */ j("option", {
124
+ /* @__PURE__ */ P("option", {
102
125
  value: "enabled",
103
126
  children: "开启思考"
104
127
  }),
105
- /* @__PURE__ */ j("option", {
128
+ /* @__PURE__ */ P("option", {
106
129
  value: "disabled",
107
130
  children: "关闭思考"
108
131
  })
109
132
  ]
110
133
  }) : null;
111
- return /* @__PURE__ */ M("div", {
112
- className: t("flex min-w-0 gap-2", u ? "w-full flex-col" : "items-center"),
134
+ return /* @__PURE__ */ F("div", {
135
+ className: i("flex min-w-0 gap-2", u ? "w-full flex-col" : "items-center"),
113
136
  children: [f, p]
114
137
  });
115
138
  }
116
- function ze({ agentName: e, currentSessionId: n, isMobile: r, sidebarOpen: i, mobileSidebarOpen: a, onToggleSidebar: s, availableModels: c, selectedModel: l, onSelectModel: u, selectedModelLabel: d, modelCatalogLoaded: f, modelSource: m, thinkingEnabled: h, thinkingMode: g, onSelectThinkingMode: v, mobileActionsOpen: y, onMobileActionsOpenChange: b, workspaceEnabled: S, onOpenWorkspace: C, nativeManagementLink: w, nativeTerminal: T, nativeLauncherMode: E = !1 }) {
117
- let [ee, te] = p(!1), ne = !!T?.Enabled, ie = j(r ? a ? O : re : i ? O : re, { className: "h-5 w-5" });
118
- return /* @__PURE__ */ M(A, { children: [
119
- /* @__PURE__ */ M("header", {
120
- className: t("flex flex-shrink-0 items-center justify-between border-b border-black/[0.06] bg-background/95 px-3 py-2 backdrop-blur dark:border-white/[0.08] dark:bg-background/95 sm:px-4", r ? "pt-[calc(var(--safe-area-top)+0.5rem)]" : "h-12"),
121
- children: [/* @__PURE__ */ M("div", {
139
+ function qe({ agentName: e, currentSessionId: t, isMobile: n, sidebarOpen: r, mobileSidebarOpen: a, onToggleSidebar: o, availableModels: s, selectedModel: c, onSelectModel: l, selectedModelLabel: u, modelCatalogLoaded: f, modelSource: p, thinkingEnabled: m, thinkingMode: h, onSelectThinkingMode: g, mobileActionsOpen: _, onMobileActionsOpenChange: v, workspaceEnabled: b, onOpenWorkspace: x, nativeManagementLink: S, nativeTerminal: w, nativeLauncherMode: T = !1 }) {
140
+ let [ee, te] = y(!1), ne = !!w?.Enabled, D = P(n ? a ? le : O : r ? le : O, { className: "h-5 w-5" });
141
+ return /* @__PURE__ */ F(N, { children: [
142
+ /* @__PURE__ */ F("header", {
143
+ className: i("flex flex-shrink-0 items-center justify-between border-b border-black/[0.06] bg-background/95 px-3 py-2 backdrop-blur dark:border-white/[0.08] dark:bg-background/95 sm:px-4", n ? "pt-[calc(var(--safe-area-top)+0.5rem)]" : "h-12"),
144
+ children: [/* @__PURE__ */ F("div", {
122
145
  className: "flex min-w-0 items-center gap-2",
123
- children: [E ? null : /* @__PURE__ */ j("button", {
146
+ children: [T ? null : /* @__PURE__ */ P("button", {
124
147
  type: "button",
125
- onClick: s,
148
+ onClick: o,
126
149
  className: "rounded-lg p-2 text-slate-500 transition-colors hover:bg-slate-100 dark:hover:bg-slate-800",
127
- "aria-label": r ? "打开历史记录" : "切换侧边栏",
128
- children: ie
129
- }), /* @__PURE__ */ M("div", {
150
+ "aria-label": n ? "打开历史记录" : "切换侧边栏",
151
+ children: D
152
+ }), /* @__PURE__ */ F("div", {
130
153
  className: "min-w-0",
131
- children: [/* @__PURE__ */ j("div", {
154
+ children: [/* @__PURE__ */ P("div", {
132
155
  className: "truncate text-sm font-semibold text-slate-900 dark:text-slate-100 sm:text-base",
133
156
  children: e
134
- }), /* @__PURE__ */ j("div", {
157
+ }), /* @__PURE__ */ P("div", {
135
158
  className: "text-[11px] text-slate-400 dark:text-slate-500",
136
- children: E ? "原生运行时入口" : "智能体"
159
+ children: T ? "原生运行时入口" : "智能体"
137
160
  })]
138
161
  })]
139
- }), r ? /* @__PURE__ */ j("button", {
162
+ }), n ? /* @__PURE__ */ P("button", {
140
163
  type: "button",
141
- onClick: () => b(!0),
164
+ onClick: () => v(!0),
142
165
  className: "rounded-lg p-2 text-slate-500 transition-colors hover:bg-slate-100 dark:hover:bg-slate-800",
143
166
  "aria-label": "打开会话操作",
144
- children: /* @__PURE__ */ j(D, { className: "h-5 w-5" })
145
- }) : /* @__PURE__ */ M("div", {
167
+ children: /* @__PURE__ */ P(se, { className: "h-5 w-5" })
168
+ }) : /* @__PURE__ */ F("div", {
146
169
  className: "flex min-w-0 items-center gap-2",
147
170
  children: [
148
- w ? /* @__PURE__ */ M("a", {
149
- href: w.href,
171
+ S ? /* @__PURE__ */ F("a", {
172
+ href: S.href,
150
173
  target: "_blank",
151
174
  rel: "noreferrer",
152
- title: w.title,
175
+ title: S.title,
153
176
  className: "inline-flex flex-shrink-0 items-center gap-1.5 whitespace-nowrap rounded-xl border border-slate-200 bg-slate-50 px-3 py-2 text-sm font-medium leading-none text-slate-700 transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300 dark:hover:bg-slate-700",
154
- children: [/* @__PURE__ */ j(_, { className: "h-4 w-4" }), /* @__PURE__ */ j("span", { children: w.label })]
177
+ children: [/* @__PURE__ */ P(C, { className: "h-4 w-4" }), /* @__PURE__ */ P("span", { children: S.label })]
155
178
  }) : null,
156
- S ? /* @__PURE__ */ M("button", {
179
+ b ? /* @__PURE__ */ F("button", {
157
180
  type: "button",
158
- onClick: C,
181
+ onClick: x,
159
182
  className: "inline-flex flex-shrink-0 items-center gap-1.5 whitespace-nowrap rounded-xl border border-slate-200 bg-slate-50 px-3 py-2 text-sm font-medium leading-none text-slate-700 transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300 dark:hover:bg-slate-700",
160
- children: [/* @__PURE__ */ j(x, { className: "h-4 w-4" }), /* @__PURE__ */ j("span", { children: "Workspace" })]
183
+ children: [/* @__PURE__ */ P(E, { className: "h-4 w-4" }), /* @__PURE__ */ P("span", { children: "Workspace" })]
161
184
  }) : null,
162
- ne ? /* @__PURE__ */ M("button", {
185
+ ne ? /* @__PURE__ */ F("button", {
163
186
  type: "button",
164
187
  onClick: () => te(!0),
165
188
  className: "inline-flex flex-shrink-0 items-center gap-1.5 whitespace-nowrap rounded-xl border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm font-medium leading-none text-emerald-800 transition hover:bg-emerald-100 dark:border-emerald-900/70 dark:bg-emerald-950/40 dark:text-emerald-200",
166
- children: [/* @__PURE__ */ j(k, { className: "h-4 w-4" }), /* @__PURE__ */ j("span", { children: "TUI" })]
189
+ children: [/* @__PURE__ */ P(M, { className: "h-4 w-4" }), /* @__PURE__ */ P("span", { children: "TUI" })]
167
190
  }) : null,
168
- !E && r ? /* @__PURE__ */ j(Re, {
169
- availableModels: c,
170
- selectedModel: l,
171
- onSelectModel: u,
172
- selectedModelLabel: d,
191
+ !T && n ? /* @__PURE__ */ P(Ke, {
192
+ availableModels: s,
193
+ selectedModel: c,
194
+ onSelectModel: l,
195
+ selectedModelLabel: u,
173
196
  modelCatalogLoaded: f,
174
- modelSource: m,
175
- thinkingEnabled: h,
176
- thinkingMode: g,
177
- onSelectThinkingMode: v,
197
+ modelSource: p,
198
+ thinkingEnabled: m,
199
+ thinkingMode: h,
200
+ onSelectThinkingMode: g,
178
201
  compact: !0
179
202
  }) : null,
180
- !E && n ? /* @__PURE__ */ M("span", {
203
+ !T && t ? /* @__PURE__ */ F("span", {
181
204
  className: "rounded bg-slate-50 px-2 py-1 text-xs font-mono text-slate-400 dark:bg-slate-800",
182
- children: ["ID: ", n.slice(0, 8)]
205
+ children: ["ID: ", t.slice(0, 8)]
183
206
  }) : null
184
207
  ]
185
208
  })]
186
209
  }),
187
- r ? /* @__PURE__ */ j(Oe, {
188
- open: y,
189
- onOpenChange: b,
190
- children: /* @__PURE__ */ M(Me, {
210
+ n ? /* @__PURE__ */ P(Ie, {
211
+ open: _,
212
+ onOpenChange: v,
213
+ children: /* @__PURE__ */ F(Be, {
191
214
  side: "bottom",
192
215
  className: "rounded-t-[1.75rem] border-slate-200 bg-white px-4 pb-[calc(var(--safe-area-bottom)+1rem)] pt-6 dark:border-slate-800 dark:bg-slate-900",
193
- children: [/* @__PURE__ */ M(Ne, {
216
+ children: [/* @__PURE__ */ F(Ve, {
194
217
  className: "text-left",
195
- children: [/* @__PURE__ */ j(Fe, { children: "会话设置" }), /* @__PURE__ */ j(Ie, {
218
+ children: [/* @__PURE__ */ P(Ue, { children: "会话设置" }), /* @__PURE__ */ P(We, {
196
219
  className: "sr-only",
197
220
  children: "调整当前会话的模型和 Workspace 操作。"
198
221
  })]
199
- }), /* @__PURE__ */ M("div", {
222
+ }), /* @__PURE__ */ F("div", {
200
223
  className: "mt-6 flex flex-col gap-4",
201
224
  children: [
202
- S ? /* @__PURE__ */ M("button", {
225
+ b ? /* @__PURE__ */ F("button", {
203
226
  type: "button",
204
227
  onClick: () => {
205
- b(!1), C();
228
+ v(!1), x();
206
229
  },
207
230
  className: "inline-flex items-center gap-2 rounded-xl border border-slate-200 bg-slate-50 px-3 py-3 text-sm font-medium text-slate-700 transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300 dark:hover:bg-slate-700",
208
- children: [/* @__PURE__ */ j(x, { className: "h-4 w-4" }), "工作区文件"]
231
+ children: [/* @__PURE__ */ P(E, { className: "h-4 w-4" }), "工作区文件"]
209
232
  }) : null,
210
- ne ? /* @__PURE__ */ M("button", {
233
+ ne ? /* @__PURE__ */ F("button", {
211
234
  type: "button",
212
235
  onClick: () => {
213
- b(!1), te(!0);
236
+ v(!1), te(!0);
214
237
  },
215
238
  className: "inline-flex items-center gap-2 rounded-xl border border-emerald-200 bg-emerald-50 px-3 py-3 text-sm font-medium text-emerald-800 transition hover:bg-emerald-100 dark:border-emerald-900/70 dark:bg-emerald-950/40 dark:text-emerald-200",
216
- children: [/* @__PURE__ */ j(k, { className: "h-4 w-4" }), "原生 TUI"]
239
+ children: [/* @__PURE__ */ P(M, { className: "h-4 w-4" }), "原生 TUI"]
217
240
  }) : null,
218
- w ? /* @__PURE__ */ M("a", {
219
- href: w.href,
241
+ S ? /* @__PURE__ */ F("a", {
242
+ href: S.href,
220
243
  target: "_blank",
221
244
  rel: "noreferrer",
222
- title: w.title,
223
- onClick: () => b(!1),
245
+ title: S.title,
246
+ onClick: () => v(!1),
224
247
  className: "inline-flex items-center gap-2 rounded-xl border border-slate-200 bg-slate-50 px-3 py-3 text-sm font-medium text-slate-700 transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300 dark:hover:bg-slate-700",
225
- children: [/* @__PURE__ */ j(_, { className: "h-4 w-4" }), w.label]
248
+ children: [/* @__PURE__ */ P(C, { className: "h-4 w-4" }), S.label]
226
249
  }) : null,
227
- E ? /* @__PURE__ */ j("div", {
250
+ T ? /* @__PURE__ */ P("div", {
228
251
  className: "rounded-2xl border border-slate-200 bg-slate-50 px-3 py-3 text-sm leading-6 text-slate-600 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300",
229
252
  children: "当前运行时对话在原生管理台中进行;这里保留管理入口和 Workspace 文件操作。"
230
- }) : /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ M("div", {
253
+ }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F("div", {
231
254
  className: "space-y-2",
232
- children: [/* @__PURE__ */ j("div", {
255
+ children: [/* @__PURE__ */ P("div", {
233
256
  className: "text-xs font-medium uppercase tracking-[0.12em] text-slate-400 dark:text-slate-500",
234
257
  children: "模型"
235
- }), /* @__PURE__ */ j(Re, {
236
- availableModels: c,
237
- selectedModel: l,
238
- onSelectModel: u,
239
- selectedModelLabel: d,
258
+ }), /* @__PURE__ */ P(Ke, {
259
+ availableModels: s,
260
+ selectedModel: c,
261
+ onSelectModel: l,
262
+ selectedModelLabel: u,
240
263
  modelCatalogLoaded: f,
241
- modelSource: m,
242
- thinkingEnabled: h,
243
- thinkingMode: g,
244
- onSelectThinkingMode: v,
264
+ modelSource: p,
265
+ thinkingEnabled: m,
266
+ thinkingMode: h,
267
+ onSelectThinkingMode: g,
245
268
  compact: !0
246
269
  })]
247
- }), /* @__PURE__ */ M("div", {
270
+ }), /* @__PURE__ */ F("div", {
248
271
  className: "space-y-2",
249
- children: [/* @__PURE__ */ j("div", {
272
+ children: [/* @__PURE__ */ P("div", {
250
273
  className: "text-xs font-medium uppercase tracking-[0.12em] text-slate-400 dark:text-slate-500",
251
274
  children: "当前会话"
252
- }), /* @__PURE__ */ j("div", {
275
+ }), /* @__PURE__ */ P("div", {
253
276
  className: "rounded-2xl border border-slate-200 bg-slate-50 px-3 py-3 text-sm text-slate-600 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300",
254
- children: n ? /* @__PURE__ */ j("span", {
277
+ children: t ? /* @__PURE__ */ P("span", {
255
278
  className: "break-all font-mono",
256
- children: n
279
+ children: t
257
280
  }) : "新对话尚未创建会话 ID"
258
281
  })]
259
282
  })] })
@@ -261,12 +284,12 @@ function ze({ agentName: e, currentSessionId: n, isMobile: r, sidebarOpen: i, mo
261
284
  })]
262
285
  })
263
286
  }) : null,
264
- T && ee ? /* @__PURE__ */ j(o, {
287
+ w && ee ? /* @__PURE__ */ P(d, {
265
288
  fallback: null,
266
- children: /* @__PURE__ */ j(Le, {
267
- capability: T,
289
+ children: /* @__PURE__ */ P(Ge, {
290
+ capability: w,
268
291
  open: ee,
269
- sessionId: n,
292
+ sessionId: t,
270
293
  onClose: () => te(!1)
271
294
  })
272
295
  }) : null
@@ -274,7 +297,7 @@ function ze({ agentName: e, currentSessionId: n, isMobile: r, sidebarOpen: i, mo
274
297
  }
275
298
  //#endregion
276
299
  //#region src/utils/session-list.js
277
- var Be = new Set([
300
+ var Je = new Set([
278
301
  "in_progress",
279
302
  "running",
280
303
  "resuming",
@@ -283,7 +306,7 @@ var Be = new Set([
283
306
  "queued",
284
307
  "pending",
285
308
  "accepted"
286
- ]), Ve = new Set([
309
+ ]), Ye = new Set([
287
310
  "failed",
288
311
  "error",
289
312
  "resume_failed",
@@ -292,8 +315,8 @@ var Be = new Set([
292
315
  "canceled",
293
316
  "aborted",
294
317
  "expired"
295
- ]), He = 300 * 1e3;
296
- function Ue(e) {
318
+ ]), Xe = 300 * 1e3;
319
+ function Ze(e) {
297
320
  let t = e?.UpdatedAt ?? e?.updated_at;
298
321
  if (typeof t == "string") {
299
322
  let e = Date.parse(t);
@@ -301,10 +324,10 @@ function Ue(e) {
301
324
  }
302
325
  return typeof t == "number" && Number.isFinite(t) ? t > 1e11 ? t : t * 1e3 : 0;
303
326
  }
304
- function We(e) {
327
+ function Qe(e) {
305
328
  return String(e || "").trim().toLowerCase();
306
329
  }
307
- function Ge(e) {
330
+ function $e(e) {
308
331
  if (!e) return "";
309
332
  let t = typeof e == "number" ? new Date(e > 1e11 ? e : e * 1e3) : new Date(e);
310
333
  return Number.isNaN(t.getTime()) ? "" : t.toLocaleString("zh-CN", {
@@ -316,7 +339,7 @@ function Ge(e) {
316
339
  hour12: !1
317
340
  });
318
341
  }
319
- function Ke(e) {
342
+ function et(e) {
320
343
  return [
321
344
  e?.Title,
322
345
  e?.Summary,
@@ -325,140 +348,140 @@ function Ke(e) {
325
348
  e?.SessionId,
326
349
  e?.Model?.display_name,
327
350
  e?.Model?.id
328
- ].map(We).join(" ");
351
+ ].map(Qe).join(" ");
329
352
  }
330
- function qe(e, t = {}) {
331
- if (!Be.has(We(e?.ActiveRunStatus))) return !1;
332
- let n = Ue(e);
353
+ function tt(e, t = {}) {
354
+ if (!Je.has(Qe(e?.ActiveRunStatus))) return !1;
355
+ let n = Ze(e);
333
356
  if (!n) return !0;
334
- let r = Number.isFinite(Number(t.now)) ? Number(t.now) : Date.now(), i = Number.isFinite(Number(t.activeStaleAfterMs)) ? Number(t.activeStaleAfterMs) : He;
357
+ let r = Number.isFinite(Number(t.now)) ? Number(t.now) : Date.now(), i = Number.isFinite(Number(t.activeStaleAfterMs)) ? Number(t.activeStaleAfterMs) : Xe;
335
358
  return r - n <= i;
336
359
  }
337
- function Je(e = [], t = "", n = {}) {
338
- let r = We(t), i = new Set(Array.isArray(n.pinnedSessionIds) ? n.pinnedSessionIds : []);
339
- return (Array.isArray(e) ? e : []).filter((e) => e?.SessionId).filter((e) => !r || Ke(e).includes(r)).slice().sort((e, t) => {
360
+ function nt(e = [], t = "", n = {}) {
361
+ let r = Qe(t), i = new Set(Array.isArray(n.pinnedSessionIds) ? n.pinnedSessionIds : []);
362
+ return (Array.isArray(e) ? e : []).filter((e) => e?.SessionId).filter((e) => !r || et(e).includes(r)).slice().sort((e, t) => {
340
363
  let r = +!!i.has(e.SessionId), a = +!!i.has(t.SessionId);
341
364
  if (r !== a) return a - r;
342
- let o = +!!qe(e, n), s = +!!qe(t, n);
343
- return o === s ? Ue(t) - Ue(e) : s - o;
365
+ let o = +!!tt(e, n), s = +!!tt(t, n);
366
+ return o === s ? Ze(t) - Ze(e) : s - o;
344
367
  });
345
368
  }
346
- function Ye(e, t = {}) {
347
- let n = qe(e, t), r = Ve.has(We(e?.ActiveRunStatus));
369
+ function rt(e, t = {}) {
370
+ let n = tt(e, t), r = Ye.has(Qe(e?.ActiveRunStatus));
348
371
  return {
349
372
  running: n,
350
373
  failed: r,
351
- label: n || r ? "" : Ge(e?.UpdatedAt ?? e?.updated_at)
374
+ label: n || r ? "" : $e(e?.UpdatedAt ?? e?.updated_at)
352
375
  };
353
376
  }
354
377
  //#endregion
355
378
  //#region src/components/chat/ChatSidebar.tsx
356
- function Xe({ sessions: e, currentSessionId: n, onCreateNewSession: r, onSelectSession: i, onDeleteSession: a, onTogglePinSession: o, onLoadMoreSessions: s, sessionTitle: c, pinnedSessionIds: l = [], hasMoreSessions: u = !1, isLoadingSessions: f = !1, className: m }) {
357
- let [h, g] = p(""), _ = d(() => Je(e, h, { pinnedSessionIds: l }), [
379
+ function it({ sessions: e, currentSessionId: t, onCreateNewSession: n, onSelectSession: r, onDeleteSession: a, onTogglePinSession: o, onLoadMoreSessions: s, sessionTitle: c, pinnedSessionIds: l = [], hasMoreSessions: u = !1, isLoadingSessions: d = !1, className: f }) {
380
+ let [p, m] = y(""), h = _(() => nt(e, p, { pinnedSessionIds: l }), [
358
381
  e,
359
382
  l,
360
- h
361
- ]), v = d(() => new Set(l), [l]);
362
- return /* @__PURE__ */ M("div", {
363
- className: t("flex h-full min-h-0 flex-col bg-sidebar", m),
383
+ p
384
+ ]), g = _(() => new Set(l), [l]);
385
+ return /* @__PURE__ */ F("div", {
386
+ className: i("flex h-full min-h-0 flex-col bg-sidebar", f),
364
387
  children: [
365
- /* @__PURE__ */ M("div", {
388
+ /* @__PURE__ */ F("div", {
366
389
  className: "flex flex-shrink-0 flex-col gap-2 border-b border-black/[0.06] px-3 py-3 dark:border-white/[0.08]",
367
- children: [/* @__PURE__ */ M("button", {
390
+ children: [/* @__PURE__ */ F("button", {
368
391
  type: "button",
369
- onClick: r,
392
+ onClick: n,
370
393
  className: "flex h-[34px] w-full items-center justify-between rounded-[10px] px-2.5 text-sm font-medium text-sidebar-text-secondary transition-colors hover:bg-sidebar-hover hover:text-sidebar-text",
371
- children: [/* @__PURE__ */ M("span", {
394
+ children: [/* @__PURE__ */ F("span", {
372
395
  className: "flex items-center gap-1.5",
373
- children: [/* @__PURE__ */ j(E, { className: "h-4 w-4" }), /* @__PURE__ */ j("span", { children: "新对话" })]
374
- }), /* @__PURE__ */ j("span", {
396
+ children: [/* @__PURE__ */ P(ie, { className: "h-4 w-4" }), /* @__PURE__ */ P("span", { children: "新对话" })]
397
+ }), /* @__PURE__ */ P("span", {
375
398
  className: "rounded border border-black/[0.08] px-1.5 py-0.5 text-[11px] text-sidebar-text-muted dark:border-white/[0.1]",
376
399
  children: "⌘ N"
377
400
  })]
378
- }), /* @__PURE__ */ M("label", {
401
+ }), /* @__PURE__ */ F("label", {
379
402
  className: "flex h-9 items-center gap-2 rounded-[10px] border border-black/[0.06] bg-background px-2.5 text-xs text-sidebar-text-muted focus-within:border-primary/40 dark:border-white/[0.08]",
380
- children: [/* @__PURE__ */ j(ce, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ j("input", {
381
- value: h,
382
- onChange: (e) => g(e.target.value),
403
+ children: [/* @__PURE__ */ P(fe, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("input", {
404
+ value: p,
405
+ onChange: (e) => m(e.target.value),
383
406
  className: "min-w-0 flex-1 bg-transparent text-sm text-sidebar-text outline-none placeholder:text-sidebar-text-muted",
384
407
  placeholder: "搜索会话、模型或摘要"
385
408
  })]
386
409
  })]
387
410
  }),
388
- /* @__PURE__ */ M("div", {
411
+ /* @__PURE__ */ F("div", {
389
412
  className: "min-h-0 flex-1 overflow-y-auto px-2 pb-4 pt-2 custom-scrollbar",
390
413
  onScroll: (e) => {
391
- if (!s || f || !u || h.trim()) return;
414
+ if (!s || d || !u || p.trim()) return;
392
415
  let t = e.currentTarget;
393
416
  t.scrollHeight - t.scrollTop - t.clientHeight < 200 && s();
394
417
  },
395
- children: [/* @__PURE__ */ M("div", {
418
+ children: [/* @__PURE__ */ F("div", {
396
419
  className: "px-2.5 py-2 text-xs font-medium text-sidebar-text-muted opacity-75",
397
- children: ["历史记录", h.trim() ? ` · ${_.length}` : ""]
398
- }), /* @__PURE__ */ M("div", {
420
+ children: ["历史记录", p.trim() ? ` · ${h.length}` : ""]
421
+ }), /* @__PURE__ */ F("div", {
399
422
  className: "flex flex-col gap-0.5",
400
- children: [_.length > 0 ? _.map((e) => {
401
- let r = Ye(e), s = v.has(e.SessionId), l = n === e.SessionId;
402
- return /* @__PURE__ */ M("div", {
403
- className: t("group relative flex h-[30px] items-center gap-1 rounded-[10px] border-l-2 border-transparent px-2 text-sm leading-5 transition-colors", l ? "border-l-2 border-primary bg-primary/10 font-medium text-sidebar-text" : r.running ? "cursor-pointer bg-primary/[0.035] text-sidebar-text" : "cursor-pointer text-sidebar-text-secondary hover:bg-sidebar-hover hover:text-sidebar-text"),
404
- children: [/* @__PURE__ */ M("button", {
423
+ children: [h.length > 0 ? h.map((e) => {
424
+ let n = rt(e), s = g.has(e.SessionId), l = t === e.SessionId;
425
+ return /* @__PURE__ */ F("div", {
426
+ className: i("group relative flex h-[30px] items-center gap-1 rounded-[10px] border-l-2 border-transparent px-2 text-sm leading-5 transition-colors", l ? "border-l-2 border-primary bg-primary/10 font-medium text-sidebar-text" : n.running ? "cursor-pointer bg-primary/[0.035] text-sidebar-text" : "cursor-pointer text-sidebar-text-secondary hover:bg-sidebar-hover hover:text-sidebar-text"),
427
+ children: [/* @__PURE__ */ F("button", {
405
428
  type: "button",
406
429
  "aria-current": l ? "page" : void 0,
407
430
  className: "flex min-w-0 flex-1 items-center gap-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-primary/60",
408
- onClick: () => i(e.SessionId),
409
- children: [/* @__PURE__ */ j("span", {
431
+ onClick: () => r(e.SessionId),
432
+ children: [/* @__PURE__ */ P("span", {
410
433
  className: "min-w-0 flex-1 truncate text-[13px]",
411
434
  children: c(e)
412
- }), r.running ? /* @__PURE__ */ j("span", {
435
+ }), n.running ? /* @__PURE__ */ P("span", {
413
436
  "aria-label": "运行中",
414
437
  className: "h-1.5 w-1.5 flex-shrink-0 animate-spin rounded-full border border-primary border-t-transparent"
415
- }) : r.failed ? /* @__PURE__ */ j("span", {
438
+ }) : n.failed ? /* @__PURE__ */ P("span", {
416
439
  "aria-label": "运行失败",
417
440
  title: "运行失败",
418
441
  className: "h-1.5 w-1.5 flex-shrink-0 rounded-full bg-rose-500/75"
419
- }) : r.label ? /* @__PURE__ */ j("span", {
442
+ }) : n.label ? /* @__PURE__ */ P("span", {
420
443
  className: "flex-shrink-0 text-[11px] leading-none text-sidebar-text-muted group-hover:hidden",
421
- children: r.label
444
+ children: n.label
422
445
  }) : null]
423
- }), /* @__PURE__ */ M("div", {
446
+ }), /* @__PURE__ */ F("div", {
424
447
  className: "absolute right-1 top-1/2 flex -translate-y-1/2 items-center justify-end gap-0.5 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",
425
- children: [/* @__PURE__ */ j("button", {
448
+ children: [/* @__PURE__ */ P("button", {
426
449
  type: "button",
427
450
  onClick: (t) => o(e.SessionId, t),
428
- className: t("flex h-6 w-6 items-center justify-center rounded-md text-sidebar-text-muted hover:bg-sidebar-active hover:text-sidebar-text", s && "text-primary opacity-100"),
451
+ className: i("flex h-6 w-6 items-center justify-center rounded-md text-sidebar-text-muted hover:bg-sidebar-active hover:text-sidebar-text", s && "text-primary opacity-100"),
429
452
  title: s ? "取消置顶" : "置顶会话",
430
453
  "aria-label": s ? "取消置顶会话" : "置顶会话",
431
- children: j(s ? ae : ie, { className: "h-3.5 w-3.5" })
432
- }), /* @__PURE__ */ j("button", {
454
+ children: P(s ? A : k, { className: "h-3.5 w-3.5" })
455
+ }), /* @__PURE__ */ P("button", {
433
456
  type: "button",
434
457
  onClick: (t) => a(e.SessionId, t),
435
458
  className: "flex h-6 w-6 items-center justify-center rounded-md text-sidebar-text-muted hover:bg-sidebar-active hover:text-rose-500",
436
459
  title: "删除会话",
437
- children: /* @__PURE__ */ j(ue, { className: "h-3.5 w-3.5" })
460
+ children: /* @__PURE__ */ P(pe, { className: "h-3.5 w-3.5" })
438
461
  })]
439
462
  })]
440
463
  }, e.SessionId);
441
- }) : /* @__PURE__ */ j("div", {
464
+ }) : /* @__PURE__ */ P("div", {
442
465
  className: "rounded-xl border border-dashed border-black/[0.08] px-3 py-8 text-center text-xs text-sidebar-text-muted dark:border-white/[0.1]",
443
466
  children: "没有匹配的会话"
444
- }), f ? /* @__PURE__ */ M("div", {
467
+ }), d ? /* @__PURE__ */ F("div", {
445
468
  className: "flex items-center justify-center gap-2 px-3 py-3 text-xs text-sidebar-text-muted",
446
- children: [/* @__PURE__ */ j(w, { className: "h-3.5 w-3.5 animate-spin" }), /* @__PURE__ */ j("span", { children: "加载中" })]
469
+ children: [/* @__PURE__ */ P(D, { className: "h-3.5 w-3.5 animate-spin" }), /* @__PURE__ */ P("span", { children: "加载中" })]
447
470
  }) : null]
448
471
  })]
449
472
  }),
450
- /* @__PURE__ */ M("div", {
473
+ /* @__PURE__ */ F("div", {
451
474
  className: "border-t border-black/[0.06] px-4 py-3 text-center dark:border-white/[0.08]",
452
475
  children: [
453
- /* @__PURE__ */ j("div", {
476
+ /* @__PURE__ */ P("div", {
454
477
  className: "text-[10px] font-medium tracking-[0.14em] text-sidebar-text-muted",
455
478
  children: "POWERED BY"
456
479
  }),
457
- /* @__PURE__ */ j("div", {
480
+ /* @__PURE__ */ P("div", {
458
481
  className: "mt-1 bg-gradient-to-r from-blue-600 to-indigo-500 bg-clip-text text-xs font-bold text-transparent dark:from-blue-400 dark:to-indigo-300",
459
482
  children: "Ksyun AgentEngine"
460
483
  }),
461
- /* @__PURE__ */ j("div", {
484
+ /* @__PURE__ */ P("div", {
462
485
  className: "mx-auto mt-2 max-w-[13rem] text-[10px] leading-4 text-sidebar-text-muted",
463
486
  children: "Agent 可能产生不准确的信息,请独立验证。"
464
487
  })
@@ -469,117 +492,117 @@ function Xe({ sessions: e, currentSessionId: n, onCreateNewSession: r, onSelectS
469
492
  }
470
493
  //#endregion
471
494
  //#region src/components/native/NativeRuntimeLauncher.tsx
472
- var Ze = s(() => import("./NativeTerminalPanel-DyPvD5ij.js").then((e) => e.n).then((e) => ({ default: e.NativeTerminalPanel })));
473
- function Qe({ productLabel: e = "原生运行时", nativeManagementLink: t, nativeTerminal: n, workspaceEnabled: r, onOpenWorkspace: i }) {
474
- let a = !!n?.Enabled, [s, c] = p(!1);
475
- return /* @__PURE__ */ M("section", {
495
+ var at = f(() => import("./NativeTerminalPanel-D2J75bIU.js").then((e) => e.n).then((e) => ({ default: e.NativeTerminalPanel })));
496
+ function ot({ productLabel: e = "原生运行时", nativeManagementLink: t, nativeTerminal: n, workspaceEnabled: r, onOpenWorkspace: i }) {
497
+ let a = !!n?.Enabled, [o, s] = y(!1);
498
+ return /* @__PURE__ */ F("section", {
476
499
  className: "flex min-h-0 flex-1 overflow-y-auto bg-[radial-gradient(circle_at_top_left,rgba(14,165,233,0.12),transparent_34%),linear-gradient(135deg,#f8fafc_0%,#ffffff_48%,#f1f5f9_100%)] px-4 py-8 dark:bg-[radial-gradient(circle_at_top_left,rgba(14,165,233,0.16),transparent_34%),linear-gradient(135deg,#020617_0%,#0f172a_52%,#111827_100%)] sm:px-8",
477
- children: [/* @__PURE__ */ j("div", {
500
+ children: [/* @__PURE__ */ P("div", {
478
501
  className: "mx-auto flex w-full max-w-5xl flex-col justify-center",
479
- children: /* @__PURE__ */ M("div", {
502
+ children: /* @__PURE__ */ F("div", {
480
503
  className: "overflow-hidden rounded-[2rem] border border-slate-200/80 bg-white/90 shadow-xl shadow-slate-200/60 backdrop-blur dark:border-slate-800 dark:bg-slate-900/85 dark:shadow-black/30",
481
- children: [/* @__PURE__ */ M("div", {
504
+ children: [/* @__PURE__ */ F("div", {
482
505
  className: "border-b border-slate-200/80 bg-slate-50/80 px-6 py-5 dark:border-slate-800 dark:bg-slate-950/40 sm:px-8",
483
506
  children: [
484
- /* @__PURE__ */ M("div", {
507
+ /* @__PURE__ */ F("div", {
485
508
  className: "inline-flex items-center gap-2 rounded-full border border-sky-200 bg-sky-50 px-3 py-1 text-xs font-medium text-sky-700 dark:border-sky-900/60 dark:bg-sky-950/50 dark:text-sky-300",
486
509
  children: [
487
- /* @__PURE__ */ j(le, { className: "h-3.5 w-3.5" }),
510
+ /* @__PURE__ */ P(j, { className: "h-3.5 w-3.5" }),
488
511
  e,
489
512
  " native runtime"
490
513
  ]
491
514
  }),
492
- /* @__PURE__ */ j("h1", {
515
+ /* @__PURE__ */ P("h1", {
493
516
  className: "mt-5 text-2xl font-semibold tracking-tight text-slate-950 dark:text-slate-50 sm:text-3xl",
494
517
  children: "对话请使用原生管理台"
495
518
  }),
496
- /* @__PURE__ */ j("p", {
519
+ /* @__PURE__ */ P("p", {
497
520
  className: "mt-3 max-w-2xl text-sm leading-6 text-slate-600 dark:text-slate-300 sm:text-base",
498
521
  children: "当前运行时的对话状态由原生管理台承载。AgentEngine Hosted UI 在这里保留统一入口和 Workspace 文件管理,不重复实现运行时内部已有的复杂对话状态机。"
499
522
  })
500
523
  ]
501
- }), /* @__PURE__ */ M("div", {
524
+ }), /* @__PURE__ */ F("div", {
502
525
  className: "grid gap-4 p-6 md:grid-cols-3 sm:p-8",
503
526
  children: [
504
- /* @__PURE__ */ M("div", {
527
+ /* @__PURE__ */ F("div", {
505
528
  className: "rounded-3xl border border-slate-200 bg-white p-5 dark:border-slate-800 dark:bg-slate-900",
506
529
  children: [
507
- /* @__PURE__ */ j("div", {
530
+ /* @__PURE__ */ P("div", {
508
531
  className: "flex h-11 w-11 items-center justify-center rounded-2xl bg-slate-950 text-white dark:bg-slate-100 dark:text-slate-950",
509
- children: /* @__PURE__ */ j(ee, { className: "h-5 w-5" })
532
+ children: /* @__PURE__ */ P(ae, { className: "h-5 w-5" })
510
533
  }),
511
- /* @__PURE__ */ j("h2", {
534
+ /* @__PURE__ */ P("h2", {
512
535
  className: "mt-4 text-base font-semibold text-slate-950 dark:text-slate-50",
513
536
  children: "原生管理台"
514
537
  }),
515
- /* @__PURE__ */ j("p", {
538
+ /* @__PURE__ */ P("p", {
516
539
  className: "mt-2 text-sm leading-6 text-slate-600 dark:text-slate-300",
517
540
  children: "使用原生管理台处理对话、工具卡片、思考流、审批、中断和运行时历史,避免跨状态机不一致。"
518
541
  }),
519
- t ? /* @__PURE__ */ M("a", {
542
+ t ? /* @__PURE__ */ F("a", {
520
543
  href: t.href,
521
544
  target: "_blank",
522
545
  rel: "noreferrer",
523
546
  title: t.title,
524
547
  className: "mt-5 inline-flex items-center gap-2 rounded-2xl bg-slate-950 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-950 dark:hover:bg-white",
525
548
  children: [
526
- /* @__PURE__ */ j(_, { className: "h-4 w-4" }),
549
+ /* @__PURE__ */ P(C, { className: "h-4 w-4" }),
527
550
  "打开",
528
551
  t.label
529
552
  ]
530
- }) : /* @__PURE__ */ j("div", {
553
+ }) : /* @__PURE__ */ P("div", {
531
554
  className: "mt-5 rounded-2xl border border-neutral-200 bg-neutral-50 px-4 py-3 text-sm leading-6 text-neutral-800 dark:border-neutral-900/60 dark:bg-neutral-950/30 dark:text-neutral-200",
532
555
  children: "当前访问模式不开放原生管理入口。需要完整对话体验时,请使用 owner/private 链接或 CLI。"
533
556
  })
534
557
  ]
535
558
  }),
536
- /* @__PURE__ */ M("div", {
559
+ /* @__PURE__ */ F("div", {
537
560
  className: "rounded-3xl border border-slate-200 bg-white p-5 dark:border-slate-800 dark:bg-slate-900",
538
561
  children: [
539
- /* @__PURE__ */ j("div", {
562
+ /* @__PURE__ */ P("div", {
540
563
  className: "flex h-11 w-11 items-center justify-center rounded-2xl bg-sky-100 text-sky-700 dark:bg-sky-950 dark:text-sky-300",
541
- children: /* @__PURE__ */ j(x, { className: "h-5 w-5" })
564
+ children: /* @__PURE__ */ P(E, { className: "h-5 w-5" })
542
565
  }),
543
- /* @__PURE__ */ j("h2", {
566
+ /* @__PURE__ */ P("h2", {
544
567
  className: "mt-4 text-base font-semibold text-slate-950 dark:text-slate-50",
545
568
  children: "Workspace 文件管理"
546
569
  }),
547
- /* @__PURE__ */ j("p", {
570
+ /* @__PURE__ */ P("p", {
548
571
  className: "mt-2 text-sm leading-6 text-slate-600 dark:text-slate-300",
549
572
  children: "文件浏览、上传、预览仍由 Hosted UI 提供,和原生管理台组合使用覆盖对话与工作区。"
550
573
  }),
551
- r ? /* @__PURE__ */ M("button", {
574
+ r ? /* @__PURE__ */ F("button", {
552
575
  type: "button",
553
576
  onClick: i,
554
577
  className: "mt-5 inline-flex items-center gap-2 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-2.5 text-sm font-medium text-slate-800 transition hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-slate-700",
555
- children: [/* @__PURE__ */ j(x, { className: "h-4 w-4" }), "打开 Workspace"]
556
- }) : /* @__PURE__ */ j("div", {
578
+ children: [/* @__PURE__ */ P(E, { className: "h-4 w-4" }), "打开 Workspace"]
579
+ }) : /* @__PURE__ */ P("div", {
557
580
  className: "mt-5 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm leading-6 text-slate-500 dark:border-slate-800 dark:bg-slate-950/40 dark:text-slate-400",
558
581
  children: "当前链接未开放 Workspace 文件管理。Owner 或 private 链接可使用该能力。"
559
582
  })
560
583
  ]
561
584
  }),
562
- /* @__PURE__ */ M("div", {
585
+ /* @__PURE__ */ F("div", {
563
586
  className: "rounded-3xl border border-slate-200 bg-white p-5 dark:border-slate-800 dark:bg-slate-900",
564
587
  children: [
565
- /* @__PURE__ */ j("div", {
588
+ /* @__PURE__ */ P("div", {
566
589
  className: "flex h-11 w-11 items-center justify-center rounded-2xl bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300",
567
- children: /* @__PURE__ */ j(k, { className: "h-5 w-5" })
590
+ children: /* @__PURE__ */ P(M, { className: "h-5 w-5" })
568
591
  }),
569
- /* @__PURE__ */ j("h2", {
592
+ /* @__PURE__ */ P("h2", {
570
593
  className: "mt-4 text-base font-semibold text-slate-950 dark:text-slate-50",
571
594
  children: "原生 TUI"
572
595
  }),
573
- /* @__PURE__ */ j("p", {
596
+ /* @__PURE__ */ P("p", {
574
597
  className: "mt-2 text-sm leading-6 text-slate-600 dark:text-slate-300",
575
598
  children: "如果运行时暴露安全的 ks-terminal.v1 通道,可以在这里进入原生终端 UI;share 链接不会开放该入口。"
576
599
  }),
577
- a ? /* @__PURE__ */ M("button", {
600
+ a ? /* @__PURE__ */ F("button", {
578
601
  type: "button",
579
- onClick: () => c(!0),
602
+ onClick: () => s(!0),
580
603
  className: "mt-5 inline-flex items-center gap-2 rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-2.5 text-sm font-medium text-emerald-800 transition hover:bg-emerald-100 dark:border-emerald-900/70 dark:bg-emerald-950/40 dark:text-emerald-200",
581
- children: [/* @__PURE__ */ j(k, { className: "h-4 w-4" }), "打开 TUI"]
582
- }) : /* @__PURE__ */ j("div", {
604
+ children: [/* @__PURE__ */ P(M, { className: "h-4 w-4" }), "打开 TUI"]
605
+ }) : /* @__PURE__ */ P("div", {
583
606
  className: "mt-5 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm leading-6 text-slate-500 dark:border-slate-800 dark:bg-slate-950/40 dark:text-slate-400",
584
607
  children: "当前运行时未声明可用的浏览器 TUI 能力。"
585
608
  })
@@ -588,83 +611,83 @@ function Qe({ productLabel: e = "原生运行时", nativeManagementLink: t, nati
588
611
  ]
589
612
  })]
590
613
  })
591
- }), n && s ? /* @__PURE__ */ j(o, {
614
+ }), n && o ? /* @__PURE__ */ P(d, {
592
615
  fallback: null,
593
- children: /* @__PURE__ */ j(Ze, {
616
+ children: /* @__PURE__ */ P(at, {
594
617
  capability: n,
595
- open: s,
596
- onClose: () => c(!1)
618
+ open: o,
619
+ onClose: () => s(!1)
597
620
  })
598
621
  }) : null]
599
622
  });
600
623
  }
601
624
  //#endregion
602
625
  //#region src/components/workspace/FileEditor.tsx
603
- function $e(e) {
626
+ function st(e) {
604
627
  let t = String(e || "").split("/").pop() || "", n = t.lastIndexOf(".");
605
628
  return n >= 0 ? t.slice(n) : "";
606
629
  }
607
- function et(e) {
608
- return ge.matchFilename(De, `file${e}`);
630
+ function ct(e) {
631
+ return be.matchFilename(Ne, `file${e}`);
609
632
  }
610
633
  function X({ content: e, path: t, readOnly: n = !1, onSave: r, onDirtyChange: i, onContentChange: a, getContentRef: o }) {
611
- let s = f(null), u = f(null), d = f(new H()), p = f(new H()), m = f(new H()), h = f(!1), g = f(r), _ = f(i), v = f(a);
612
- l(() => {
613
- g.current = r, _.current = i, v.current = a;
634
+ let s = v(null), c = v(null), l = v(new G()), u = v(new G()), d = v(new G()), f = v(!1), h = v(r), g = v(i), _ = v(a);
635
+ m(() => {
636
+ h.current = r, g.current = i, _.current = a;
614
637
  }, [
615
638
  r,
616
639
  i,
617
640
  a
618
641
  ]);
619
- let y = c((e) => {
620
- h.current !== e && (h.current = e, _.current?.(e));
642
+ let y = p((e) => {
643
+ f.current !== e && (f.current = e, g.current?.(e));
621
644
  }, []);
622
- return l(() => {
645
+ return m(() => {
623
646
  if (!s.current) return;
624
- let r = document.documentElement.classList.contains("dark"), i = me.of([{
647
+ let r = document.documentElement.classList.contains("dark"), i = U.of([{
625
648
  key: "Mod-s",
626
649
  run: (e) => {
627
650
  let t = e.state.doc.toString();
628
- return g.current?.(t), y(!1), !0;
651
+ return h.current?.(t), y(!1), !0;
629
652
  },
630
653
  preventDefault: !0
631
- }]), a = new F({
632
- state: U.create({
654
+ }]), a = new L({
655
+ state: K.create({
633
656
  doc: e,
634
657
  extensions: [
635
- B(),
636
- pe(),
637
- G(),
658
+ W(),
659
+ H(),
638
660
  q(),
639
- L(),
640
- R(),
641
- U.allowMultipleSelections.of(!0),
642
- ye(),
643
- be(ve, { fallback: !0 }),
644
- _e(),
661
+ Y(),
662
+ z(),
663
+ B(),
664
+ K.allowMultipleSelections.of(!0),
645
665
  we(),
646
- Ce(),
666
+ Te(Se, { fallback: !0 }),
667
+ xe(),
668
+ Ae(),
669
+ ke(),
670
+ _e(),
671
+ R(),
647
672
  V(),
648
- I(),
649
- z(),
650
- Se(),
651
- me.of([
652
- ...Te,
653
- ...W,
654
- ...Y,
655
- ...K,
673
+ De(),
674
+ U.of([
675
+ ...je,
676
+ ...ve,
677
+ ...Oe,
656
678
  ...J,
657
- ...Ee,
658
- he
679
+ ...Ce,
680
+ ...Me,
681
+ ye
659
682
  ]),
660
683
  i,
661
- F.updateListener.of((e) => {
662
- e.docChanged && (y(!0), v.current?.(e.state.doc.toString()));
684
+ L.updateListener.of((e) => {
685
+ e.docChanged && (y(!0), _.current?.(e.state.doc.toString()));
663
686
  }),
664
- m.current.of(U.readOnly.of(n)),
665
- d.current.of([]),
666
- p.current.of(r ? xe : []),
667
- F.theme({
687
+ d.current.of(K.readOnly.of(n)),
688
+ l.current.of([]),
689
+ u.current.of(r ? Ee : []),
690
+ L.theme({
668
691
  "&": { height: "100%" },
669
692
  ".cm-scroller": { overflow: "auto" }
670
693
  })
@@ -672,15 +695,15 @@ function X({ content: e, path: t, readOnly: n = !1, onSave: r, onDirtyChange: i,
672
695
  }),
673
696
  parent: s.current
674
697
  });
675
- u.current = a, o && (o.current = () => a.state.doc.toString());
676
- let c = et($e(t));
677
- return c && c.load().then((e) => {
678
- u.current && u.current.dispatch({ effects: d.current.reconfigure(e) });
698
+ c.current = a, o && (o.current = () => a.state.doc.toString());
699
+ let f = ct(st(t));
700
+ return f && f.load().then((e) => {
701
+ c.current && c.current.dispatch({ effects: l.current.reconfigure(e) });
679
702
  }).catch(() => {}), () => {
680
- a.destroy(), u.current = null, o && (o.current = null);
703
+ a.destroy(), c.current = null, o && (o.current = null);
681
704
  };
682
- }, []), l(() => {
683
- let t = u.current;
705
+ }, []), m(() => {
706
+ let t = c.current;
684
707
  if (!t) return;
685
708
  let n = t.state.doc.toString();
686
709
  n !== e && (t.dispatch({ changes: {
@@ -688,66 +711,66 @@ function X({ content: e, path: t, readOnly: n = !1, onSave: r, onDirtyChange: i,
688
711
  to: n.length,
689
712
  insert: e
690
713
  } }), y(!1));
691
- }, [e, y]), l(() => {
692
- let e = u.current;
714
+ }, [e, y]), m(() => {
715
+ let e = c.current;
693
716
  if (!e) return;
694
- let n = et($e(t));
717
+ let n = ct(st(t));
695
718
  n ? n.load().then((e) => {
696
- u.current && u.current.dispatch({ effects: d.current.reconfigure(e) });
697
- }).catch(() => {}) : e.dispatch({ effects: d.current.reconfigure([]) });
698
- }, [t]), l(() => {
699
- let e = u.current;
700
- e && e.dispatch({ effects: m.current.reconfigure(U.readOnly.of(n)) });
701
- }, [n]), l(() => {
719
+ c.current && c.current.dispatch({ effects: l.current.reconfigure(e) });
720
+ }).catch(() => {}) : e.dispatch({ effects: l.current.reconfigure([]) });
721
+ }, [t]), m(() => {
722
+ let e = c.current;
723
+ e && e.dispatch({ effects: d.current.reconfigure(K.readOnly.of(n)) });
724
+ }, [n]), m(() => {
702
725
  let e = new MutationObserver(() => {
703
- let e = u.current;
726
+ let e = c.current;
704
727
  if (!e) return;
705
728
  let t = document.documentElement.classList.contains("dark");
706
- e.dispatch({ effects: p.current.reconfigure(t ? xe : []) });
729
+ e.dispatch({ effects: u.current.reconfigure(t ? Ee : []) });
707
730
  });
708
731
  return e.observe(document.documentElement, {
709
732
  attributes: !0,
710
733
  attributeFilter: ["class"]
711
734
  }), () => e.disconnect();
712
- }, []), /* @__PURE__ */ j("div", {
735
+ }, []), /* @__PURE__ */ P("div", {
713
736
  ref: s,
714
737
  className: "h-full w-full overflow-hidden [&_.cm-editor]:h-full [&_.cm-scroller]:auto"
715
738
  });
716
739
  }
717
740
  //#endregion
718
741
  //#region src/components/workspace/FilePreview.tsx
719
- function tt({ content: e, objectUrl: t, kind: r, filename: i, path: a }) {
720
- return r === "markdown" ? /* @__PURE__ */ j(n, { content: e || "" }) : r === "image" && t ? /* @__PURE__ */ j("div", {
742
+ function lt({ content: e, objectUrl: t, kind: n, filename: r, path: i }) {
743
+ return n === "markdown" ? /* @__PURE__ */ P(s, { content: e || "" }) : n === "image" && t ? /* @__PURE__ */ P("div", {
721
744
  className: "flex items-center justify-center p-4",
722
- children: /* @__PURE__ */ j("img", {
745
+ children: /* @__PURE__ */ P("img", {
723
746
  src: t,
724
- alt: i,
747
+ alt: r,
725
748
  className: "max-h-[70vh] max-w-full rounded object-contain"
726
749
  })
727
- }) : r === "pdf" && t ? /* @__PURE__ */ j("iframe", {
750
+ }) : n === "pdf" && t ? /* @__PURE__ */ P("iframe", {
728
751
  src: t,
729
- title: i,
752
+ title: r,
730
753
  className: "h-full w-full border-0"
731
- }) : (r === "text" || r === "code") && e !== null ? /* @__PURE__ */ j(X, {
754
+ }) : (n === "text" || n === "code") && e !== null ? /* @__PURE__ */ P(X, {
732
755
  content: e,
733
- path: a || i,
756
+ path: i || r,
734
757
  readOnly: !0,
735
758
  onSave: () => {},
736
759
  onDirtyChange: () => {},
737
760
  getContentRef: { current: () => e || "" }
738
- }) : /* @__PURE__ */ j("div", {
761
+ }) : /* @__PURE__ */ P("div", {
739
762
  className: "flex h-full items-center justify-center px-6 text-center",
740
- children: /* @__PURE__ */ j("div", {
763
+ children: /* @__PURE__ */ P("div", {
741
764
  className: "w-full max-w-md rounded-2xl border border-dashed border-slate-300 bg-slate-50 px-5 py-5 text-slate-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400",
742
765
  children: "该文件类型暂不支持在线预览,请直接下载查看。"
743
766
  })
744
767
  });
745
768
  }
746
- var Z = "/_ksadk/workspace/v1/files", nt = new Set([
769
+ var Z = "/_ksadk/workspace/v1/files", ut = new Set([
747
770
  ".md",
748
771
  ".markdown",
749
772
  ".mdx"
750
- ]), rt = new Set([".pdf"]), it = new Set([
773
+ ]), dt = new Set([".pdf"]), ft = new Set([
751
774
  ".png",
752
775
  ".jpg",
753
776
  ".jpeg",
@@ -756,7 +779,7 @@ var Z = "/_ksadk/workspace/v1/files", nt = new Set([
756
779
  ".svg",
757
780
  ".bmp",
758
781
  ".ico"
759
- ]), at = new Set(/* @__PURE__ */ ".txt,.log,.json,.yaml,.yml,.xml,.html,.css,.js,.jsx,.ts,.tsx,.py,.sh,.sql,.csv,.tsv,.toml,.ini,.env,.lock,.conf,.c,.cc,.cpp,.go,.java,.rs".split(",")), ot = new Set([
782
+ ]), pt = new Set(/* @__PURE__ */ ".txt,.log,.json,.yaml,.yml,.xml,.html,.css,.js,.jsx,.ts,.tsx,.py,.sh,.sql,.csv,.tsv,.toml,.ini,.env,.lock,.conf,.c,.cc,.cpp,.go,.java,.rs".split(",")), mt = new Set([
760
783
  "application/json",
761
784
  "application/ld+json",
762
785
  "application/xml",
@@ -785,40 +808,40 @@ function Q(e) {
785
808
  }
786
809
  return n.length > 0 ? n.join("/") : ".";
787
810
  }
788
- function st(e) {
811
+ function ht(e) {
789
812
  let t = Q(e);
790
813
  return t === "." ? "" : t.split("/").filter(Boolean).map((e) => encodeURIComponent(e)).join("/");
791
814
  }
792
- function ct(e) {
793
- let t = st(e);
815
+ function gt(e) {
816
+ let t = ht(e);
794
817
  return t ? `${Z}/${t}` : Z;
795
818
  }
796
- function lt(e) {
819
+ function _t(e) {
797
820
  let t = Q(e);
798
821
  if (t === "." || !t.includes("/")) return `${Z}/`;
799
- let n = st(t.substring(0, t.lastIndexOf("/")));
822
+ let n = ht(t.substring(0, t.lastIndexOf("/")));
800
823
  return n ? `${Z}/${n}/` : `${Z}/`;
801
824
  }
802
- function ut(e) {
825
+ function vt(e) {
803
826
  return Q(e) === ".";
804
827
  }
805
- function dt(e) {
828
+ function yt(e) {
806
829
  let t = Q(e);
807
830
  return t === "." ? "/" : `/${t}`;
808
831
  }
809
- function ft(e) {
832
+ function bt(e) {
810
833
  let t = String(e || "").split("/").pop() || "", n = t.lastIndexOf(".");
811
834
  return n >= 0 ? t.slice(n).toLowerCase() : "";
812
835
  }
813
- function pt(e) {
836
+ function xt(e) {
814
837
  return String(e || "").split(";")[0].trim().toLowerCase();
815
838
  }
816
- var mt = new Set([".html", ".htm"]);
839
+ var St = new Set([".html", ".htm"]);
817
840
  function $({ path: e, mimeType: t }) {
818
- let n = ft(e), r = pt(t);
819
- return r === "text/html" || mt.has(n) ? "html" : r === "text/markdown" || nt.has(n) ? "markdown" : r === "application/pdf" || rt.has(n) ? "pdf" : r.startsWith("image/") || it.has(n) ? "image" : r.startsWith("text/") || ot.has(r) || at.has(n) ? "text" : "unsupported";
841
+ let n = bt(e), r = xt(t);
842
+ return r === "text/html" || St.has(n) ? "html" : r === "text/markdown" || ut.has(n) ? "markdown" : r === "application/pdf" || dt.has(n) ? "pdf" : r.startsWith("image/") || ft.has(n) ? "image" : r.startsWith("text/") || mt.has(r) || pt.has(n) ? "text" : "unsupported";
820
843
  }
821
- var ht = new Set([
844
+ var Ct = new Set([
822
845
  ".txt",
823
846
  ".log",
824
847
  ".csv",
@@ -828,11 +851,11 @@ var ht = new Set([
828
851
  ".conf",
829
852
  ".lock"
830
853
  ]);
831
- function gt({ path: e, mimeType: t }) {
832
- let n = ft(e), r = pt(t);
833
- return mt.has(n) || r === "text/html" ? "html" : r === "text/markdown" || nt.has(n) ? "markdown" : r === "application/pdf" || rt.has(n) || r.startsWith("image/") || it.has(n) ? null : ht.has(n) || r === "text/plain" ? "text" : r.startsWith("text/") || ot.has(r) || at.has(n) ? "code" : null;
854
+ function wt({ path: e, mimeType: t }) {
855
+ let n = bt(e), r = xt(t);
856
+ return St.has(n) || r === "text/html" ? "html" : r === "text/markdown" || ut.has(n) ? "markdown" : r === "application/pdf" || dt.has(n) || r.startsWith("image/") || ft.has(n) ? null : Ct.has(n) || r === "text/plain" ? "text" : r.startsWith("text/") || mt.has(r) || pt.has(n) ? "code" : null;
834
857
  }
835
- function _t({ isMobile: e }) {
858
+ function Tt({ isMobile: e }) {
836
859
  return e ? {
837
860
  renderMode: "sheet",
838
861
  modal: !0,
@@ -847,7 +870,7 @@ function _t({ isMobile: e }) {
847
870
  side: "right"
848
871
  };
849
872
  }
850
- function vt() {
873
+ function Et() {
851
874
  let e = 0;
852
875
  return {
853
876
  next(t) {
@@ -864,168 +887,168 @@ function vt() {
864
887
  }
865
888
  };
866
889
  }
867
- function yt({ workspaceFiles: e, accessMode: t }) {
890
+ function Dt({ workspaceFiles: e, accessMode: t }) {
868
891
  if (!e?.Enabled) return !1;
869
892
  let n = String(t || "").trim().toLowerCase();
870
893
  return n === "owner" || n === "private";
871
894
  }
872
895
  //#endregion
873
896
  //#region src/components/workspace/HtmlPreview.tsx
874
- function bt({ content: e, path: n, onSave: a, onDirtyChange: o, getContentRef: s, isMobile: d }) {
875
- let m = f(null), g = u(), [y, b] = p("preview"), x = lt(n), S = ct(n), C = c(() => i(e, {
876
- basePath: x,
877
- channelId: g
897
+ function Ot({ content: e, path: t, onSave: n, onDirtyChange: r, getContentRef: a, isMobile: o }) {
898
+ let s = v(null), u = h(), [d, f] = y("preview"), g = _t(t), _ = gt(t), b = p(() => l(e, {
899
+ basePath: g,
900
+ channelId: u
878
901
  }), [
879
902
  e,
880
- x,
881
- g
882
- ]), [w, T] = p(C());
883
- l(() => {
903
+ g,
904
+ u
905
+ ]), [S, T] = y(b());
906
+ m(() => {
884
907
  let e = setTimeout(() => {
885
- T(C());
908
+ T(b());
886
909
  }, 300);
887
910
  return () => clearTimeout(e);
888
- }, [C]), r(m, g);
889
- let E = c(() => {
890
- let e = new Blob([w], { type: "text/html;charset=utf-8" }), t = URL.createObjectURL(e), n = window.open(t, "_blank", "noopener,noreferrer");
891
- window.setTimeout(() => URL.revokeObjectURL(t), 3e4), n || window.open(S, "_blank", "noopener,noreferrer");
892
- }, [S, w]);
893
- return d ? /* @__PURE__ */ M("div", {
911
+ }, [b]), c(s, u);
912
+ let ee = p(() => {
913
+ let e = new Blob([S], { type: "text/html;charset=utf-8" }), t = URL.createObjectURL(e), n = window.open(t, "_blank", "noopener,noreferrer");
914
+ window.setTimeout(() => URL.revokeObjectURL(t), 3e4), n || window.open(_, "_blank", "noopener,noreferrer");
915
+ }, [_, S]);
916
+ return o ? /* @__PURE__ */ F("div", {
894
917
  className: "flex h-full flex-col",
895
- children: [/* @__PURE__ */ M("div", {
918
+ children: [/* @__PURE__ */ F("div", {
896
919
  className: "flex items-center gap-1 border-b border-slate-200 px-2 py-1.5 dark:border-slate-700",
897
- children: [/* @__PURE__ */ M("button", {
898
- onClick: () => b("editor"),
899
- className: t("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", y === "editor" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
900
- children: [/* @__PURE__ */ j(h, { className: "h-3.5 w-3.5" }), "编辑"]
901
- }), /* @__PURE__ */ M("button", {
902
- onClick: () => b("preview"),
903
- className: t("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", y === "preview" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
904
- children: [/* @__PURE__ */ j(v, { className: "h-3.5 w-3.5" }), "预览"]
920
+ children: [/* @__PURE__ */ F("button", {
921
+ onClick: () => f("editor"),
922
+ className: i("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", d === "editor" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
923
+ children: [/* @__PURE__ */ P(x, { className: "h-3.5 w-3.5" }), "编辑"]
924
+ }), /* @__PURE__ */ F("button", {
925
+ onClick: () => f("preview"),
926
+ className: i("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", d === "preview" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
927
+ children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), "预览"]
905
928
  })]
906
- }), y === "editor" ? /* @__PURE__ */ j(X, {
929
+ }), d === "editor" ? /* @__PURE__ */ P(X, {
907
930
  content: e,
908
- path: n,
909
- onSave: a,
910
- onDirtyChange: o,
911
- getContentRef: s
912
- }) : /* @__PURE__ */ j("iframe", {
913
- ref: m,
914
- srcDoc: w,
931
+ path: t,
932
+ onSave: n,
933
+ onDirtyChange: r,
934
+ getContentRef: a
935
+ }) : /* @__PURE__ */ P("iframe", {
936
+ ref: s,
937
+ srcDoc: S,
915
938
  sandbox: "allow-scripts allow-downloads allow-same-origin",
916
939
  title: "HTML 预览",
917
940
  className: "h-full w-full border-0 bg-white"
918
941
  })]
919
- }) : y === "editor" ? /* @__PURE__ */ M("div", {
942
+ }) : d === "editor" ? /* @__PURE__ */ F("div", {
920
943
  className: "relative flex h-full flex-col",
921
- children: [/* @__PURE__ */ j(X, {
944
+ children: [/* @__PURE__ */ P(X, {
922
945
  content: e,
923
- path: n,
924
- onSave: a,
925
- onDirtyChange: o,
926
- getContentRef: s
927
- }), /* @__PURE__ */ M("button", {
928
- onClick: () => b("preview"),
946
+ path: t,
947
+ onSave: n,
948
+ onDirtyChange: r,
949
+ getContentRef: a
950
+ }), /* @__PURE__ */ F("button", {
951
+ onClick: () => f("preview"),
929
952
  className: "absolute right-3 top-3 z-10 inline-flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white/90 px-2.5 py-1.5 text-xs font-medium text-slate-600 shadow-sm backdrop-blur-sm transition hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-800/90 dark:text-slate-300 dark:hover:bg-slate-700",
930
- children: [/* @__PURE__ */ j(v, { className: "h-3.5 w-3.5" }), "预览"]
953
+ children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), "预览"]
931
954
  })]
932
- }) : /* @__PURE__ */ M("div", {
955
+ }) : /* @__PURE__ */ F("div", {
933
956
  className: "relative flex h-full flex-col",
934
- children: [/* @__PURE__ */ j("iframe", {
935
- ref: m,
936
- srcDoc: w,
957
+ children: [/* @__PURE__ */ P("iframe", {
958
+ ref: s,
959
+ srcDoc: S,
937
960
  sandbox: "allow-scripts allow-downloads allow-same-origin",
938
961
  title: "HTML 预览",
939
962
  className: "h-full w-full border-0 bg-white"
940
- }), /* @__PURE__ */ M("div", {
963
+ }), /* @__PURE__ */ F("div", {
941
964
  className: "absolute right-3 top-3 z-10 flex gap-1.5",
942
- children: [/* @__PURE__ */ M("button", {
943
- onClick: E,
965
+ children: [/* @__PURE__ */ F("button", {
966
+ onClick: ee,
944
967
  className: "inline-flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white/90 px-2.5 py-1.5 text-xs font-medium text-slate-600 shadow-sm backdrop-blur-sm transition hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-800/90 dark:text-slate-300 dark:hover:bg-slate-700",
945
968
  title: "在新窗口中打开当前预览",
946
- children: [/* @__PURE__ */ j(_, { className: "h-3.5 w-3.5" }), "新窗口"]
947
- }), /* @__PURE__ */ M("button", {
948
- onClick: () => b("editor"),
969
+ children: [/* @__PURE__ */ P(C, { className: "h-3.5 w-3.5" }), "新窗口"]
970
+ }), /* @__PURE__ */ F("button", {
971
+ onClick: () => f("editor"),
949
972
  className: "inline-flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white/90 px-2.5 py-1.5 text-xs font-medium text-slate-600 shadow-sm backdrop-blur-sm transition hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-800/90 dark:text-slate-300 dark:hover:bg-slate-700",
950
- children: [/* @__PURE__ */ j(h, { className: "h-3.5 w-3.5" }), "编辑"]
973
+ children: [/* @__PURE__ */ P(x, { className: "h-3.5 w-3.5" }), "编辑"]
951
974
  })]
952
975
  })]
953
976
  });
954
977
  }
955
978
  //#endregion
956
979
  //#region src/components/workspace/MarkdownPreview.tsx
957
- function xt(e) {
980
+ function kt(e) {
958
981
  e.current && clearTimeout(e.current);
959
982
  }
960
- function St({ content: e, path: r, onSave: i, onDirtyChange: a, getContentRef: o, isMobile: s }) {
961
- let [c, u] = p("editor"), [d, m] = p(e), g = f(null);
962
- return l(() => (xt(g), g.current = setTimeout(() => m(e), 300), () => xt(g)), [e]), s ? /* @__PURE__ */ M("div", {
983
+ function At({ content: e, path: t, onSave: n, onDirtyChange: r, getContentRef: a, isMobile: o }) {
984
+ let [c, l] = y("editor"), [u, d] = y(e), f = v(null);
985
+ return m(() => (kt(f), f.current = setTimeout(() => d(e), 300), () => kt(f)), [e]), o ? /* @__PURE__ */ F("div", {
963
986
  className: "flex h-full flex-col",
964
- children: [/* @__PURE__ */ M("div", {
987
+ children: [/* @__PURE__ */ F("div", {
965
988
  className: "flex items-center gap-1 border-b border-slate-200/30 px-2 py-1.5 dark:border-slate-700/30",
966
- children: [/* @__PURE__ */ M("button", {
967
- onClick: () => u("editor"),
968
- className: t("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", c === "editor" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
969
- children: [/* @__PURE__ */ j(h, { className: "h-3.5 w-3.5" }), "编辑"]
970
- }), /* @__PURE__ */ M("button", {
971
- onClick: () => u("preview"),
972
- className: t("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", c === "preview" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
973
- children: [/* @__PURE__ */ j(v, { className: "h-3.5 w-3.5" }), "预览"]
989
+ children: [/* @__PURE__ */ F("button", {
990
+ onClick: () => l("editor"),
991
+ className: i("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", c === "editor" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
992
+ children: [/* @__PURE__ */ P(x, { className: "h-3.5 w-3.5" }), "编辑"]
993
+ }), /* @__PURE__ */ F("button", {
994
+ onClick: () => l("preview"),
995
+ className: i("flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors", c === "preview" ? "bg-slate-100 text-slate-900 dark:bg-slate-700 dark:text-slate-100" : "text-slate-500 hover:bg-slate-50 dark:text-slate-400 dark:hover:bg-slate-800"),
996
+ children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), "预览"]
974
997
  })]
975
- }), c === "editor" ? /* @__PURE__ */ j(X, {
998
+ }), c === "editor" ? /* @__PURE__ */ P(X, {
976
999
  content: e,
977
- path: r,
978
- onSave: i,
979
- onDirtyChange: a,
980
- getContentRef: o
981
- }) : /* @__PURE__ */ j("div", {
1000
+ path: t,
1001
+ onSave: n,
1002
+ onDirtyChange: r,
1003
+ getContentRef: a
1004
+ }) : /* @__PURE__ */ P("div", {
982
1005
  className: "flex-1 overflow-auto p-4",
983
- children: /* @__PURE__ */ j(n, { content: d })
1006
+ children: /* @__PURE__ */ P(s, { content: u })
984
1007
  })]
985
- }) : c === "editor" ? /* @__PURE__ */ M("div", {
1008
+ }) : c === "editor" ? /* @__PURE__ */ F("div", {
986
1009
  className: "relative flex h-full flex-col",
987
- children: [/* @__PURE__ */ j(X, {
1010
+ children: [/* @__PURE__ */ P(X, {
988
1011
  content: e,
989
- path: r,
990
- onSave: i,
991
- onDirtyChange: a,
992
- getContentRef: o
993
- }), /* @__PURE__ */ M("button", {
994
- onClick: () => u("preview"),
1012
+ path: t,
1013
+ onSave: n,
1014
+ onDirtyChange: r,
1015
+ getContentRef: a
1016
+ }), /* @__PURE__ */ F("button", {
1017
+ onClick: () => l("preview"),
995
1018
  className: "absolute right-3 top-3 z-10 inline-flex items-center gap-1.5 rounded-lg border border-slate-200/30 bg-white/90 px-2.5 py-1.5 text-xs font-medium text-slate-600 shadow-sm backdrop-blur-sm transition hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-800/90 dark:text-slate-300 dark:hover:bg-slate-700",
996
- children: [/* @__PURE__ */ j(v, { className: "h-3.5 w-3.5" }), "预览"]
1019
+ children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), "预览"]
997
1020
  })]
998
- }) : /* @__PURE__ */ M("div", {
1021
+ }) : /* @__PURE__ */ F("div", {
999
1022
  className: "relative flex h-full flex-col",
1000
- children: [/* @__PURE__ */ j("div", {
1023
+ children: [/* @__PURE__ */ P("div", {
1001
1024
  className: "flex-1 overflow-auto p-4",
1002
- children: /* @__PURE__ */ j(n, { content: d })
1003
- }), /* @__PURE__ */ M("button", {
1004
- onClick: () => u("editor"),
1025
+ children: /* @__PURE__ */ P(s, { content: u })
1026
+ }), /* @__PURE__ */ F("button", {
1027
+ onClick: () => l("editor"),
1005
1028
  className: "absolute right-3 top-3 z-10 inline-flex items-center gap-1.5 rounded-lg border border-slate-200/30 bg-white/90 px-2.5 py-1.5 text-xs font-medium text-slate-600 shadow-sm backdrop-blur-sm transition hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-800/90 dark:text-slate-300 dark:hover:bg-slate-700",
1006
- children: [/* @__PURE__ */ j(h, { className: "h-3.5 w-3.5" }), "编辑"]
1029
+ children: [/* @__PURE__ */ P(x, { className: "h-3.5 w-3.5" }), "编辑"]
1007
1030
  })]
1008
1031
  });
1009
1032
  }
1010
1033
  //#endregion
1011
1034
  //#region src/components/workspace/WorkspacePanel.tsx
1012
- var Ct = "/agentengine/api/v1/GetWorkspaceFileContent", wt = 4e3;
1013
- function Tt(e) {
1035
+ var jt = "/agentengine/api/v1/GetWorkspaceFileContent", Mt = 4e3;
1036
+ function Nt(e) {
1014
1037
  let t = Q(e);
1015
1038
  if (!t || t === ".") return ".";
1016
1039
  let n = t.split("/").filter(Boolean);
1017
1040
  return n.length <= 1 ? "." : n.slice(0, -1).join("/");
1018
1041
  }
1019
- function Et(e) {
1042
+ function Pt(e) {
1020
1043
  if (!e) return "";
1021
1044
  let t = Date.parse(e);
1022
1045
  return Number.isNaN(t) ? e : new Date(t).toLocaleString();
1023
1046
  }
1024
- function Dt(e) {
1047
+ function Ft(e) {
1025
1048
  let t = Number(e);
1026
1049
  return !Number.isFinite(t) || t <= 0 ? "0 B" : t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} GB`;
1027
1050
  }
1028
- var Ot = [
1051
+ var It = [
1029
1052
  {
1030
1053
  label: "Markdown",
1031
1054
  detail: ".md .markdown .mdx"
@@ -1047,35 +1070,35 @@ var Ot = [
1047
1070
  detail: "CSV TSV"
1048
1071
  }
1049
1072
  ];
1050
- function kt(e) {
1051
- return ct(e);
1073
+ function Lt(e) {
1074
+ return gt(e);
1052
1075
  }
1053
- function At({ label: e, showSupportedTypes: t = !1 }) {
1054
- return /* @__PURE__ */ j("div", {
1076
+ function Rt({ label: e, showSupportedTypes: t = !1 }) {
1077
+ return /* @__PURE__ */ P("div", {
1055
1078
  className: "flex h-full min-h-[16rem] flex-col items-center justify-center px-6 text-center",
1056
- children: /* @__PURE__ */ M("div", {
1079
+ children: /* @__PURE__ */ F("div", {
1057
1080
  className: "w-full max-w-md rounded-2xl border border-dashed border-slate-300 bg-slate-50 px-5 py-5 text-slate-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400",
1058
- children: [/* @__PURE__ */ j("div", { children: e }), t ? /* @__PURE__ */ M("div", {
1081
+ children: [/* @__PURE__ */ P("div", { children: e }), t ? /* @__PURE__ */ F("div", {
1059
1082
  className: "mt-4 text-left",
1060
1083
  children: [
1061
- /* @__PURE__ */ j("div", {
1084
+ /* @__PURE__ */ P("div", {
1062
1085
  className: "text-xs font-semibold uppercase tracking-[0.12em] text-slate-400",
1063
1086
  children: "支持在线预览"
1064
1087
  }),
1065
- /* @__PURE__ */ j("div", {
1088
+ /* @__PURE__ */ P("div", {
1066
1089
  className: "mt-2 grid gap-2",
1067
- children: Ot.map((e) => /* @__PURE__ */ M("div", {
1090
+ children: It.map((e) => /* @__PURE__ */ F("div", {
1068
1091
  className: "rounded-xl border border-slate-200 bg-white px-3 py-2 dark:border-slate-800 dark:bg-slate-950",
1069
- children: [/* @__PURE__ */ j("div", {
1092
+ children: [/* @__PURE__ */ P("div", {
1070
1093
  className: "text-sm font-medium text-slate-700 dark:text-slate-200",
1071
1094
  children: e.label
1072
- }), /* @__PURE__ */ j("div", {
1095
+ }), /* @__PURE__ */ P("div", {
1073
1096
  className: "mt-0.5 font-mono text-[11px] text-slate-400",
1074
1097
  children: e.detail
1075
1098
  })]
1076
1099
  }, e.label))
1077
1100
  }),
1078
- /* @__PURE__ */ j("div", {
1101
+ /* @__PURE__ */ P("div", {
1079
1102
  className: "mt-3 text-xs leading-5 text-slate-400",
1080
1103
  children: "Word、Excel、PPT 当前不支持在线预览,可下载后查看。"
1081
1104
  })
@@ -1084,20 +1107,20 @@ function At({ label: e, showSupportedTypes: t = !1 }) {
1084
1107
  })
1085
1108
  });
1086
1109
  }
1087
- function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a = !1, onToggleFullscreen: o, isMobile: s = !1, api: u }) {
1088
- let h = f(null), _ = f(null), [v, w] = p(!1), [E, ee] = p("."), [D, re] = p([]), [O, ie] = p(!1), [ae, ce] = p(!1), [le, k] = p(!1), [A, N] = p(""), [P, F] = p(null), [I, L] = p(null), [R, z] = p(!1), [pe, me] = p(!1), B = f(null), V = f(null), H = f("selection"), U = f(vt()), W = d(() => D.find((e) => e.Path === P) ?? null, [D, P]), G = d(() => W ? gt({
1089
- path: W.Path,
1090
- mimeType: W.MimeType
1091
- }) : null, [W]), K = c(() => R ? window.confirm("当前文件有未保存的更改,确定要离开吗?") : !0, [R]), he = n.ContentPath || Ct, ge = n.RootLabel || "Workspace", _e = ge ? `${ge.charAt(0).toUpperCase()}${ge.slice(1)}` : "Workspace", ve = dt(E), q = c(() => {
1092
- _.current &&= (URL.revokeObjectURL(_.current), null);
1110
+ function zt({ agentId: e, capability: t, open: n, onClose: r, isFullscreen: a = !1, onToggleFullscreen: o, isMobile: s = !1, api: c }) {
1111
+ let l = v(null), u = v(null), [d, f] = y(!1), [h, g] = y("."), [x, C] = y([]), [w, D] = y(!1), [ie, ae] = y(!1), [se, O] = y(!1), [le, k] = y(""), [A, fe] = y(null), [j, M] = y(null), [N, I] = y(!1), [ge, L] = y(!1), R = v(null), z = v(null), B = v("selection"), V = v(Et()), H = _(() => x.find((e) => e.Path === A) ?? null, [x, A]), U = _(() => H ? wt({
1112
+ path: H.Path,
1113
+ mimeType: H.MimeType
1114
+ }) : null, [H]), W = p(() => N ? window.confirm("当前文件有未保存的更改,确定要离开吗?") : !0, [N]), _e = t.ContentPath || jt, G = t.RootLabel || "Workspace", K = G ? `${G.charAt(0).toUpperCase()}${G.slice(1)}` : "Workspace", ve = yt(h), q = p(() => {
1115
+ u.current &&= (URL.revokeObjectURL(u.current), null);
1093
1116
  }, []);
1094
- l(() => () => q(), [q]);
1095
- let J = c(async (t, n = {}) => {
1117
+ m(() => () => q(), [q]);
1118
+ let J = p(async (t, n = {}) => {
1096
1119
  let r = !!n.background;
1097
- r ? ce(!0) : ie(!0), r || N("");
1120
+ r ? ae(!0) : D(!0), r || k("");
1098
1121
  try {
1099
- let n = await u.listWorkspaceFiles(e, t, !1), i = Q(String(n?.Path || t || ".")), a = Array.isArray(n?.Entries) ? n.Entries : [];
1100
- ee(i), re(a), H.current = r ? "background-refresh" : "selection", F((e) => {
1122
+ let n = await c.listWorkspaceFiles(e, t, !1), i = Q(String(n?.Path || t || ".")), a = Array.isArray(n?.Entries) ? n.Entries : [];
1123
+ g(i), C(a), B.current = r ? "background-refresh" : "selection", fe((e) => {
1101
1124
  if (e) {
1102
1125
  let t = a.find((t) => t.Path === e);
1103
1126
  if (t && t.Type === "file") return e;
@@ -1105,37 +1128,37 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1105
1128
  return a.find((e) => e.Type === "file")?.Path ?? null;
1106
1129
  });
1107
1130
  } catch (e) {
1108
- console.error("Failed to load workspace entries:", e), r || N(e instanceof Error ? e.message : String(e));
1131
+ console.error("Failed to load workspace entries:", e), r || k(e instanceof Error ? e.message : String(e));
1109
1132
  } finally {
1110
- r ? ce(!1) : ie(!1);
1133
+ r ? ae(!1) : D(!1);
1111
1134
  }
1112
- }, [e, u]);
1113
- l(() => {
1114
- !r || v || (w(!0), J("."));
1135
+ }, [e, c]);
1136
+ m(() => {
1137
+ !n || d || (f(!0), J("."));
1115
1138
  }, [
1116
- v,
1139
+ d,
1117
1140
  J,
1118
- r
1119
- ]), l(() => {
1120
- if (!r || R || !v) return;
1141
+ n
1142
+ ]), m(() => {
1143
+ if (!n || N || !d) return;
1121
1144
  let e = window.setInterval(() => {
1122
- J(E, { background: !0 });
1123
- }, wt);
1145
+ J(h, { background: !0 });
1146
+ }, Mt);
1124
1147
  return () => window.clearInterval(e);
1125
1148
  }, [
1126
- E,
1127
- R,
1128
- v,
1149
+ h,
1150
+ N,
1151
+ d,
1129
1152
  J,
1130
- r
1153
+ n
1131
1154
  ]);
1132
- let ye = c(async (t) => {
1133
- let n = U.current.next(t.Path), r = $({
1155
+ let ye = p(async (t) => {
1156
+ let n = V.current.next(t.Path), r = $({
1134
1157
  path: t.Path,
1135
1158
  mimeType: t.MimeType
1136
1159
  });
1137
- if (V.current = t.Path, r === "unsupported") {
1138
- q(), L({
1160
+ if (z.current = t.Path, r === "unsupported") {
1161
+ q(), M({
1139
1162
  path: t.Path,
1140
1163
  kind: r,
1141
1164
  status: "ready",
@@ -1143,15 +1166,15 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1143
1166
  });
1144
1167
  return;
1145
1168
  }
1146
- q(), L({
1169
+ q(), M({
1147
1170
  path: t.Path,
1148
1171
  kind: r,
1149
1172
  status: "loading",
1150
1173
  mimeType: t.MimeType ?? void 0
1151
1174
  });
1152
1175
  try {
1153
- let r = await u.getWorkspaceFileContent(e, t.Path, { asText: !1 });
1154
- if (!U.current.isCurrent(n)) return;
1176
+ let r = await c.getWorkspaceFileContent(e, t.Path, { asText: !1 });
1177
+ if (!V.current.isCurrent(n)) return;
1155
1178
  if (r instanceof Blob) {
1156
1179
  let e = t.MimeType || "", i = $({
1157
1180
  path: t.Path,
@@ -1159,7 +1182,7 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1159
1182
  });
1160
1183
  if (i === "image" || i === "pdf") {
1161
1184
  let n = URL.createObjectURL(r);
1162
- _.current = n, L({
1185
+ u.current = n, M({
1163
1186
  path: t.Path,
1164
1187
  kind: i,
1165
1188
  status: "ready",
@@ -1169,12 +1192,12 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1169
1192
  return;
1170
1193
  }
1171
1194
  let a = await r.text();
1172
- if (!U.current.isCurrent(n)) return;
1195
+ if (!V.current.isCurrent(n)) return;
1173
1196
  let o = $({
1174
1197
  path: t.Path,
1175
1198
  mimeType: e
1176
1199
  });
1177
- L({
1200
+ M({
1178
1201
  path: t.Path,
1179
1202
  kind: o,
1180
1203
  status: "ready",
@@ -1186,7 +1209,7 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1186
1209
  path: t.Path,
1187
1210
  mimeType: e
1188
1211
  });
1189
- L({
1212
+ M({
1190
1213
  path: t.Path,
1191
1214
  kind: n,
1192
1215
  status: "ready",
@@ -1195,8 +1218,8 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1195
1218
  });
1196
1219
  }
1197
1220
  } catch (e) {
1198
- if (!U.current.isCurrent(n)) return;
1199
- console.error("Failed to preview workspace file:", e), L({
1221
+ if (!V.current.isCurrent(n)) return;
1222
+ console.error("Failed to preview workspace file:", e), M({
1200
1223
  path: t.Path,
1201
1224
  kind: r,
1202
1225
  status: "error",
@@ -1206,349 +1229,349 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1206
1229
  }
1207
1230
  }, [
1208
1231
  e,
1209
- u,
1232
+ c,
1210
1233
  q
1211
1234
  ]);
1212
- l(() => {
1213
- if (!W || W.Type !== "file") {
1214
- q(), L(null), z(!1), V.current = null;
1235
+ m(() => {
1236
+ if (!H || H.Type !== "file") {
1237
+ q(), M(null), I(!1), z.current = null;
1215
1238
  return;
1216
1239
  }
1217
- if (H.current === "background-refresh" && V.current === W.Path) {
1218
- H.current = "selection";
1240
+ if (B.current === "background-refresh" && z.current === H.Path) {
1241
+ B.current = "selection";
1219
1242
  return;
1220
1243
  }
1221
- H.current = "selection", ye(W);
1244
+ B.current = "selection", ye(H);
1222
1245
  }, [
1223
1246
  q,
1224
1247
  ye,
1225
- W
1248
+ H
1226
1249
  ]);
1227
- let be = async (t) => {
1228
- if (!(!t || t.length === 0)) {
1229
- k(!0), N("");
1250
+ let be = async (n) => {
1251
+ if (!(!n || n.length === 0)) {
1252
+ O(!0), k("");
1230
1253
  try {
1231
- for (let r of Array.from(t)) {
1232
- if (r.size > n.MaxUploadBytes) throw Error(`文件 ${r.name} 超过上传上限`);
1233
- let t = ut(E) ? r.name : `${E}/${r.name}`, i = new FormData();
1234
- i.append("file", r), i.append("AgentId", e), i.append("Path", t), await u.addWorkspaceFile(i);
1254
+ for (let r of Array.from(n)) {
1255
+ if (r.size > t.MaxUploadBytes) throw Error(`文件 ${r.name} 超过上传上限`);
1256
+ let n = vt(h) ? r.name : `${h}/${r.name}`, i = new FormData();
1257
+ i.append("file", r), i.append("AgentId", e), i.append("Path", n), await c.addWorkspaceFile(i);
1235
1258
  }
1236
- await J(E);
1259
+ await J(h);
1237
1260
  } catch (e) {
1238
- console.error("Failed to upload workspace files:", e), N(e instanceof Error ? e.message : String(e));
1261
+ console.error("Failed to upload workspace files:", e), k(e instanceof Error ? e.message : String(e));
1239
1262
  } finally {
1240
- h.current && (h.current.value = ""), k(!1);
1263
+ l.current && (l.current.value = ""), O(!1);
1241
1264
  }
1242
1265
  }
1243
- }, xe = async (t) => {
1244
- if (!n.SupportsDelete) return;
1245
- let r = Q(t.Path);
1266
+ }, xe = async (n) => {
1267
+ if (!t.SupportsDelete) return;
1268
+ let r = Q(n.Path);
1246
1269
  if (window.confirm(`删除 ${r} ?`)) {
1247
- N("");
1270
+ k("");
1248
1271
  try {
1249
- await u.deleteWorkspaceFile(e, r), P && Q(P) === r && (F(null), z(!1)), await J(t.Type === "directory" && (Q(E) === r || Q(E).startsWith(`${r}/`)) ? Tt(r) : E);
1272
+ await c.deleteWorkspaceFile(e, r), A && Q(A) === r && (fe(null), I(!1)), await J(n.Type === "directory" && (Q(h) === r || Q(h).startsWith(`${r}/`)) ? Nt(r) : h);
1250
1273
  } catch (e) {
1251
- console.error("Failed to delete workspace file:", e), N(e instanceof Error ? e.message : String(e));
1274
+ console.error("Failed to delete workspace file:", e), k(e instanceof Error ? e.message : String(e));
1252
1275
  }
1253
1276
  }
1254
- }, Se = () => !W || W.Type !== "file" ? /* @__PURE__ */ j(At, {
1277
+ }, Se = () => !H || H.Type !== "file" ? /* @__PURE__ */ P(Rt, {
1255
1278
  label: "从左侧选择文件后在这里查看内容预览。",
1256
1279
  showSupportedTypes: !0
1257
- }) : !I || I.path !== W.Path || I.status === "loading" ? /* @__PURE__ */ j("div", {
1280
+ }) : !j || j.path !== H.Path || j.status === "loading" ? /* @__PURE__ */ P("div", {
1258
1281
  className: "flex h-full min-h-[16rem] items-center justify-center",
1259
- children: /* @__PURE__ */ M("div", {
1282
+ children: /* @__PURE__ */ F("div", {
1260
1283
  className: "inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white px-4 py-2 text-sm text-slate-500 shadow-sm dark:border-slate-800 dark:bg-slate-900 dark:text-slate-400",
1261
- children: [/* @__PURE__ */ j(C, { className: "h-4 w-4 animate-spin" }), "正在加载预览..."]
1284
+ children: [/* @__PURE__ */ P(ne, { className: "h-4 w-4 animate-spin" }), "正在加载预览..."]
1262
1285
  })
1263
- }) : I.status === "error" ? /* @__PURE__ */ j(At, { label: I.error || "文件预览加载失败。" }) : I.kind === "markdown" ? /* @__PURE__ */ j(St, {
1264
- content: I.content || "",
1265
- path: W.Path,
1286
+ }) : j.status === "error" ? /* @__PURE__ */ P(Rt, { label: j.error || "文件预览加载失败。" }) : j.kind === "markdown" ? /* @__PURE__ */ P(At, {
1287
+ content: j.content || "",
1288
+ path: H.Path,
1266
1289
  onSave: Y,
1267
- onDirtyChange: z,
1268
- getContentRef: B,
1290
+ onDirtyChange: I,
1291
+ getContentRef: R,
1269
1292
  isMobile: s
1270
- }) : I.kind === "image" && I.objectUrl ? /* @__PURE__ */ j(tt, {
1293
+ }) : j.kind === "image" && j.objectUrl ? /* @__PURE__ */ P(lt, {
1271
1294
  content: null,
1272
- objectUrl: I.objectUrl,
1295
+ objectUrl: j.objectUrl,
1273
1296
  kind: "image",
1274
- filename: W.Name,
1275
- mimeType: I.mimeType || ""
1276
- }) : I.kind === "pdf" && I.objectUrl ? /* @__PURE__ */ j(tt, {
1297
+ filename: H.Name,
1298
+ mimeType: j.mimeType || ""
1299
+ }) : j.kind === "pdf" && j.objectUrl ? /* @__PURE__ */ P(lt, {
1277
1300
  content: null,
1278
- objectUrl: I.objectUrl,
1301
+ objectUrl: j.objectUrl,
1279
1302
  kind: "pdf",
1280
- filename: W.Name,
1281
- mimeType: I.mimeType || ""
1282
- }) : I.kind === "html" ? /* @__PURE__ */ j(bt, {
1283
- content: I.content || "",
1284
- path: W.Path,
1303
+ filename: H.Name,
1304
+ mimeType: j.mimeType || ""
1305
+ }) : j.kind === "html" ? /* @__PURE__ */ P(Ot, {
1306
+ content: j.content || "",
1307
+ path: H.Path,
1285
1308
  onSave: Y,
1286
- onDirtyChange: z,
1287
- getContentRef: B,
1309
+ onDirtyChange: I,
1310
+ getContentRef: R,
1288
1311
  isMobile: s,
1289
1312
  agentId: e,
1290
- contentPath: he
1291
- }) : I.kind === "text" || I.kind === "code" ? /* @__PURE__ */ j(X, {
1292
- content: I.content || "",
1293
- path: W.Path,
1313
+ contentPath: _e
1314
+ }) : j.kind === "text" || j.kind === "code" ? /* @__PURE__ */ P(X, {
1315
+ content: j.content || "",
1316
+ path: H.Path,
1294
1317
  onSave: Y,
1295
- onDirtyChange: z,
1296
- getContentRef: B
1297
- }) : /* @__PURE__ */ j(tt, {
1318
+ onDirtyChange: I,
1319
+ getContentRef: R
1320
+ }) : /* @__PURE__ */ P(lt, {
1298
1321
  content: null,
1299
1322
  kind: "unsupported",
1300
- filename: W.Name,
1301
- mimeType: I.mimeType || ""
1323
+ filename: H.Name,
1324
+ mimeType: j.mimeType || ""
1302
1325
  }), Y = async (t) => {
1303
- if (W) {
1304
- me(!0), N("");
1326
+ if (H) {
1327
+ L(!0), k("");
1305
1328
  try {
1306
- let n = new Blob([t], { type: W.MimeType || "text/plain" }), r = new FormData();
1307
- r.append("file", n, W.Name), r.append("AgentId", e), r.append("Path", W.Path), await u.addWorkspaceFile(r), U.current.invalidate(), z(!1), L((e) => e && e.path === W.Path ? {
1329
+ let n = new Blob([t], { type: H.MimeType || "text/plain" }), r = new FormData();
1330
+ r.append("file", n, H.Name), r.append("AgentId", e), r.append("Path", H.Path), await c.addWorkspaceFile(r), V.current.invalidate(), I(!1), M((e) => e && e.path === H.Path ? {
1308
1331
  ...e,
1309
1332
  content: t
1310
- } : e), V.current = W.Path, await J(E, { background: !0 });
1333
+ } : e), z.current = H.Path, await J(h, { background: !0 });
1311
1334
  } catch (e) {
1312
- console.error("Failed to save workspace file:", e), N(e instanceof Error ? e.message : String(e));
1335
+ console.error("Failed to save workspace file:", e), k(e instanceof Error ? e.message : String(e));
1313
1336
  } finally {
1314
- me(!1);
1337
+ L(!1);
1315
1338
  }
1316
1339
  }
1317
- }, Ce = W?.Type === "file" && I?.path === W.Path && I.status === "ready" && (I.kind === "text" || I.kind === "code" || I.kind === "html" || I.kind === "markdown"), we = W?.Type === "file" && I?.path === W.Path && I.status === "ready" && I.kind === "pdf";
1318
- return /* @__PURE__ */ M("div", {
1340
+ }, Ce = H?.Type === "file" && j?.path === H.Path && j.status === "ready" && (j.kind === "text" || j.kind === "code" || j.kind === "html" || j.kind === "markdown"), we = H?.Type === "file" && j?.path === H.Path && j.status === "ready" && j.kind === "pdf";
1341
+ return /* @__PURE__ */ F("div", {
1319
1342
  className: "flex h-full min-h-[22rem] w-full min-w-0 flex-col bg-white text-slate-800 dark:bg-slate-950 dark:text-slate-200",
1320
- children: [/* @__PURE__ */ M("div", {
1343
+ children: [/* @__PURE__ */ F("div", {
1321
1344
  className: "flex h-14 flex-shrink-0 items-center gap-3 border-b border-slate-200/30 px-4 dark:border-slate-800/40",
1322
- children: [/* @__PURE__ */ M("div", {
1345
+ children: [/* @__PURE__ */ F("div", {
1323
1346
  className: "flex min-w-0 flex-1 items-center gap-3",
1324
1347
  children: [
1325
- /* @__PURE__ */ j("div", {
1348
+ /* @__PURE__ */ P("div", {
1326
1349
  className: "truncate text-sm font-semibold text-slate-900 dark:text-slate-100",
1327
- children: _e
1350
+ children: K
1328
1351
  }),
1329
- /* @__PURE__ */ j("div", { className: "hidden h-4 w-px bg-slate-200/70 dark:bg-slate-800 sm:block" }),
1330
- /* @__PURE__ */ M("div", {
1352
+ /* @__PURE__ */ P("div", { className: "hidden h-4 w-px bg-slate-200/70 dark:bg-slate-800 sm:block" }),
1353
+ /* @__PURE__ */ F("div", {
1331
1354
  className: "flex min-w-0 items-center gap-2",
1332
- children: [/* @__PURE__ */ j("span", {
1355
+ children: [/* @__PURE__ */ P("span", {
1333
1356
  className: "flex-shrink-0 text-xs text-slate-400",
1334
1357
  children: "当前目录"
1335
- }), /* @__PURE__ */ j("div", {
1358
+ }), /* @__PURE__ */ P("div", {
1336
1359
  className: "custom-scrollbar max-w-[min(42vw,34rem)] overflow-x-auto whitespace-nowrap rounded-md bg-slate-50 px-2 py-1 font-mono text-[11px] text-slate-600 dark:bg-slate-900 dark:text-slate-300",
1337
1360
  title: `${ve},来自 ListWorkspaceFiles 返回的 Data.Path 字段`,
1338
1361
  children: ve
1339
1362
  })]
1340
1363
  }),
1341
- /* @__PURE__ */ j("div", {
1364
+ /* @__PURE__ */ P("div", {
1342
1365
  className: "hidden truncate text-[11px] text-slate-400 xl:block",
1343
1366
  children: "工作区内相对路径,不是宿主机绝对路径。"
1344
1367
  })
1345
1368
  ]
1346
- }), /* @__PURE__ */ M("div", {
1369
+ }), /* @__PURE__ */ F("div", {
1347
1370
  className: "flex flex-shrink-0 items-center gap-1.5",
1348
1371
  children: [
1349
- /* @__PURE__ */ j("input", {
1350
- ref: h,
1372
+ /* @__PURE__ */ P("input", {
1373
+ ref: l,
1351
1374
  type: "file",
1352
1375
  multiple: !0,
1353
1376
  className: "hidden",
1354
1377
  onChange: (e) => void be(e.target.files)
1355
1378
  }),
1356
- /* @__PURE__ */ M("button", {
1379
+ /* @__PURE__ */ F("button", {
1357
1380
  type: "button",
1358
- onClick: () => h.current?.click(),
1359
- disabled: le,
1381
+ onClick: () => l.current?.click(),
1382
+ disabled: se,
1360
1383
  className: "inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium text-slate-600 transition hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-50 dark:text-slate-300 dark:hover:bg-slate-900",
1361
- title: `上传文件,上限 ${Math.floor(n.MaxUploadBytes / (1024 * 1024))}MB`,
1362
- children: [/* @__PURE__ */ j(de, { className: "h-3.5 w-3.5" }), le ? "上传中" : "上传"]
1384
+ title: `上传文件,上限 ${Math.floor(t.MaxUploadBytes / (1024 * 1024))}MB`,
1385
+ children: [/* @__PURE__ */ P(me, { className: "h-3.5 w-3.5" }), se ? "上传中" : "上传"]
1363
1386
  }),
1364
- /* @__PURE__ */ M("button", {
1387
+ /* @__PURE__ */ F("button", {
1365
1388
  type: "button",
1366
1389
  onClick: () => {
1367
- let e = new URLSearchParams({ Path: E }).toString();
1390
+ let e = new URLSearchParams({ Path: h }).toString();
1368
1391
  window.open(`/agentengine/api/v1/ExportWorkspaceZip?${e}`, "_blank", "noopener,noreferrer");
1369
1392
  },
1370
1393
  className: "inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium text-slate-600 transition hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-900",
1371
1394
  title: "导出当前目录为 ZIP",
1372
- children: [/* @__PURE__ */ j(ne, { className: "h-3.5 w-3.5" }), "导出"]
1395
+ children: [/* @__PURE__ */ P(ce, { className: "h-3.5 w-3.5" }), "导出"]
1373
1396
  }),
1374
- o ? /* @__PURE__ */ j("button", {
1397
+ o ? /* @__PURE__ */ P("button", {
1375
1398
  type: "button",
1376
1399
  onClick: o,
1377
1400
  className: "rounded-lg p-1.5 text-slate-500 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-900 dark:hover:text-slate-100",
1378
1401
  "aria-label": a ? "退出全屏" : "全屏查看 Workspace",
1379
1402
  title: a ? "退出全屏" : "全屏查看",
1380
- children: j(a ? te : T, { className: "h-4 w-4" })
1403
+ children: P(a ? oe : re, { className: "h-4 w-4" })
1381
1404
  }) : null,
1382
- i ? /* @__PURE__ */ j("button", {
1405
+ r ? /* @__PURE__ */ P("button", {
1383
1406
  type: "button",
1384
1407
  onClick: () => {
1385
- K() && i?.();
1408
+ W() && r?.();
1386
1409
  },
1387
1410
  className: "rounded-lg p-1.5 text-slate-500 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-900 dark:hover:text-slate-100",
1388
1411
  "aria-label": "关闭 Workspace",
1389
1412
  title: "关闭",
1390
- children: /* @__PURE__ */ j(fe, { className: "h-4 w-4" })
1413
+ children: /* @__PURE__ */ P(he, { className: "h-4 w-4" })
1391
1414
  }) : null
1392
1415
  ]
1393
1416
  })]
1394
- }), /* @__PURE__ */ M("div", {
1417
+ }), /* @__PURE__ */ F("div", {
1395
1418
  className: "flex min-h-0 flex-1 flex-col md:flex-row",
1396
- children: [/* @__PURE__ */ M("div", {
1419
+ children: [/* @__PURE__ */ F("div", {
1397
1420
  className: "flex w-full flex-col border-b border-slate-200/30 dark:border-slate-800/40 md:w-[13.5rem] md:border-b-0 md:border-r",
1398
- children: [/* @__PURE__ */ M("div", {
1421
+ children: [/* @__PURE__ */ F("div", {
1399
1422
  className: "flex h-14 flex-shrink-0 items-center border-b border-slate-200/30 px-3 dark:border-slate-800/40",
1400
- children: [/* @__PURE__ */ M("div", {
1423
+ children: [/* @__PURE__ */ F("div", {
1401
1424
  className: "flex items-center justify-between gap-2",
1402
- children: [/* @__PURE__ */ M("div", {
1425
+ children: [/* @__PURE__ */ F("div", {
1403
1426
  className: "min-w-0",
1404
- children: [/* @__PURE__ */ j("div", {
1427
+ children: [/* @__PURE__ */ P("div", {
1405
1428
  className: "text-xs font-medium text-slate-900 dark:text-slate-100",
1406
1429
  children: "文件"
1407
- }), /* @__PURE__ */ M("div", {
1430
+ }), /* @__PURE__ */ F("div", {
1408
1431
  className: "flex items-center gap-1 text-[11px] text-slate-400",
1409
- children: [/* @__PURE__ */ M("span", { children: [D.length, " 项"] }), ae ? /* @__PURE__ */ j(oe, {
1432
+ children: [/* @__PURE__ */ F("span", { children: [x.length, " 项"] }), ie ? /* @__PURE__ */ P(ue, {
1410
1433
  className: "h-3 w-3 animate-spin",
1411
1434
  "aria-label": "正在同步 Workspace 目录"
1412
1435
  }) : null]
1413
1436
  })]
1414
- }), /* @__PURE__ */ M("div", {
1437
+ }), /* @__PURE__ */ F("div", {
1415
1438
  className: "flex items-center gap-1",
1416
- children: [/* @__PURE__ */ j("button", {
1439
+ children: [/* @__PURE__ */ P("button", {
1417
1440
  type: "button",
1418
1441
  onClick: () => {
1419
- K() && J(Tt(E));
1442
+ W() && J(Nt(h));
1420
1443
  },
1421
- disabled: O || ut(E),
1444
+ disabled: w || vt(h),
1422
1445
  className: "rounded-md p-1.5 text-slate-500 transition hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-40 dark:text-slate-400 dark:hover:bg-slate-900",
1423
1446
  title: "返回上级目录",
1424
- children: /* @__PURE__ */ j(m, { className: "h-4 w-4" })
1425
- }), /* @__PURE__ */ j("button", {
1447
+ children: /* @__PURE__ */ P(b, { className: "h-4 w-4" })
1448
+ }), /* @__PURE__ */ P("button", {
1426
1449
  type: "button",
1427
1450
  onClick: () => {
1428
- K() && J(E);
1451
+ W() && J(h);
1429
1452
  },
1430
- disabled: O,
1453
+ disabled: w,
1431
1454
  className: "rounded-md p-1.5 text-slate-500 transition hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-40 dark:text-slate-400 dark:hover:bg-slate-900",
1432
1455
  title: "刷新目录",
1433
- children: /* @__PURE__ */ j(oe, { className: `h-4 w-4 ${O ? "animate-spin" : ""}` })
1456
+ children: /* @__PURE__ */ P(ue, { className: `h-4 w-4 ${w ? "animate-spin" : ""}` })
1434
1457
  })]
1435
1458
  })]
1436
- }), A ? /* @__PURE__ */ j("div", {
1459
+ }), le ? /* @__PURE__ */ P("div", {
1437
1460
  className: "mt-3 rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-600 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-300",
1438
- children: A
1461
+ children: le
1439
1462
  }) : null]
1440
- }), /* @__PURE__ */ j("div", {
1463
+ }), /* @__PURE__ */ P("div", {
1441
1464
  className: "custom-scrollbar min-h-0 flex-1 overflow-y-auto px-2 py-2",
1442
- children: !v && !r ? /* @__PURE__ */ j("div", {
1465
+ children: !d && !n ? /* @__PURE__ */ P("div", {
1443
1466
  className: "px-3 py-4 text-sm text-slate-400",
1444
1467
  children: "打开面板后加载 workspace 文件。"
1445
- }) : O ? /* @__PURE__ */ j("div", {
1468
+ }) : w ? /* @__PURE__ */ P("div", {
1446
1469
  className: "px-3 py-4 text-sm text-slate-400",
1447
1470
  children: "正在加载目录..."
1448
- }) : D.length === 0 ? /* @__PURE__ */ j("div", {
1471
+ }) : x.length === 0 ? /* @__PURE__ */ P("div", {
1449
1472
  className: "px-3 py-4 text-sm text-slate-400",
1450
1473
  children: "当前目录为空。"
1451
- }) : /* @__PURE__ */ j("div", {
1474
+ }) : /* @__PURE__ */ P("div", {
1452
1475
  className: "space-y-0.5",
1453
- children: D.map((e) => {
1454
- let r = $({
1476
+ children: x.map((e) => {
1477
+ let n = $({
1455
1478
  path: e.Path,
1456
1479
  mimeType: e.MimeType
1457
- }), i = P === e.Path, a = e.Type === "file" ? kt(e.Path) : "";
1458
- return /* @__PURE__ */ M("div", {
1480
+ }), r = A === e.Path, a = e.Type === "file" ? Lt(e.Path) : "";
1481
+ return /* @__PURE__ */ F("div", {
1459
1482
  title: e.Path,
1460
- className: t("group flex items-center gap-1 rounded-lg px-1.5 py-1 transition", i ? "bg-slate-100 text-slate-950 dark:bg-slate-800 dark:text-slate-50" : "text-slate-700 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-900"),
1461
- children: [/* @__PURE__ */ M("button", {
1483
+ className: i("group flex items-center gap-1 rounded-lg px-1.5 py-1 transition", r ? "bg-slate-100 text-slate-950 dark:bg-slate-800 dark:text-slate-50" : "text-slate-700 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-900"),
1484
+ children: [/* @__PURE__ */ F("button", {
1462
1485
  type: "button",
1463
1486
  onClick: () => {
1464
1487
  if (e.Type === "directory") {
1465
1488
  J(e.Path);
1466
1489
  return;
1467
1490
  }
1468
- P !== e.Path && !K() || F(e.Path);
1491
+ A !== e.Path && !W() || fe(e.Path);
1469
1492
  },
1470
1493
  className: "flex min-w-0 flex-1 items-center gap-2 text-left",
1471
- children: [/* @__PURE__ */ j("div", {
1472
- className: t("flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-md", i ? "text-slate-900 dark:text-slate-50" : "text-slate-400 dark:text-slate-500"),
1473
- children: e.Type === "directory" ? /* @__PURE__ */ j(x, { className: "h-3.5 w-3.5" }) : j(r === "image" ? S : r === "markdown" || r === "text" || r === "html" ? y : b, { className: "h-3.5 w-3.5" })
1474
- }), /* @__PURE__ */ M("div", {
1494
+ children: [/* @__PURE__ */ P("div", {
1495
+ className: i("flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-md", r ? "text-slate-900 dark:text-slate-50" : "text-slate-400 dark:text-slate-500"),
1496
+ children: e.Type === "directory" ? /* @__PURE__ */ P(E, { className: "h-3.5 w-3.5" }) : P(n === "image" ? te : n === "markdown" || n === "text" || n === "html" ? T : ee, { className: "h-3.5 w-3.5" })
1497
+ }), /* @__PURE__ */ F("div", {
1475
1498
  className: "min-w-0 flex-1",
1476
- children: [/* @__PURE__ */ j("div", {
1499
+ children: [/* @__PURE__ */ P("div", {
1477
1500
  className: "truncate text-[13px] leading-5",
1478
1501
  children: e.Name
1479
- }), /* @__PURE__ */ j("div", {
1480
- className: t("truncate text-[11px] leading-4", i ? "text-slate-500 dark:text-slate-400" : "text-slate-400"),
1481
- children: e.Type === "directory" ? "目录" : Dt(e.SizeBytes)
1502
+ }), /* @__PURE__ */ P("div", {
1503
+ className: i("truncate text-[11px] leading-4", r ? "text-slate-500 dark:text-slate-400" : "text-slate-400"),
1504
+ children: e.Type === "directory" ? "目录" : Ft(e.SizeBytes)
1482
1505
  })]
1483
1506
  })]
1484
- }), /* @__PURE__ */ M("div", {
1507
+ }), /* @__PURE__ */ F("div", {
1485
1508
  className: "flex flex-shrink-0 items-center gap-0.5 opacity-0 transition group-hover:opacity-100",
1486
- children: [e.Type === "file" ? /* @__PURE__ */ j("a", {
1509
+ children: [e.Type === "file" ? /* @__PURE__ */ P("a", {
1487
1510
  href: a,
1488
1511
  download: e.Name,
1489
- className: t("rounded-md p-1.5 transition", i ? "hover:bg-white dark:hover:bg-slate-700" : "hover:bg-slate-100 dark:hover:bg-slate-800"),
1512
+ className: i("rounded-md p-1.5 transition", r ? "hover:bg-white dark:hover:bg-slate-700" : "hover:bg-slate-100 dark:hover:bg-slate-800"),
1490
1513
  title: "下载",
1491
- children: /* @__PURE__ */ j(g, { className: "h-3.5 w-3.5" })
1492
- }) : null, n.SupportsDelete ? /* @__PURE__ */ j("button", {
1514
+ children: /* @__PURE__ */ P(S, { className: "h-3.5 w-3.5" })
1515
+ }) : null, t.SupportsDelete ? /* @__PURE__ */ P("button", {
1493
1516
  type: "button",
1494
1517
  onClick: () => void xe(e),
1495
- className: t("rounded-md p-1.5 transition", i ? "hover:bg-white dark:hover:bg-slate-700" : "hover:bg-slate-100 dark:hover:bg-slate-800"),
1518
+ className: i("rounded-md p-1.5 transition", r ? "hover:bg-white dark:hover:bg-slate-700" : "hover:bg-slate-100 dark:hover:bg-slate-800"),
1496
1519
  title: "删除",
1497
- children: /* @__PURE__ */ j(ue, { className: "h-3.5 w-3.5" })
1520
+ children: /* @__PURE__ */ P(pe, { className: "h-3.5 w-3.5" })
1498
1521
  }) : null]
1499
1522
  })]
1500
1523
  }, e.Path);
1501
1524
  })
1502
1525
  })
1503
1526
  })]
1504
- }), /* @__PURE__ */ M("div", {
1527
+ }), /* @__PURE__ */ F("div", {
1505
1528
  className: "flex min-h-0 min-w-0 flex-1 flex-col",
1506
- children: [/* @__PURE__ */ j("div", {
1529
+ children: [/* @__PURE__ */ P("div", {
1507
1530
  className: "flex h-14 flex-shrink-0 items-center border-b border-slate-200/30 px-4 dark:border-slate-800/40",
1508
- children: W ? /* @__PURE__ */ M("div", {
1531
+ children: H ? /* @__PURE__ */ F("div", {
1509
1532
  className: "flex w-full items-start justify-between gap-3",
1510
- children: [/* @__PURE__ */ M("div", {
1533
+ children: [/* @__PURE__ */ F("div", {
1511
1534
  className: "min-w-0",
1512
1535
  children: [
1513
- /* @__PURE__ */ j("div", {
1536
+ /* @__PURE__ */ P("div", {
1514
1537
  className: "truncate text-sm font-semibold text-slate-900 dark:text-slate-100",
1515
- children: W.Name
1538
+ children: H.Name
1516
1539
  }),
1517
- /* @__PURE__ */ j("div", {
1540
+ /* @__PURE__ */ P("div", {
1518
1541
  className: "mt-0.5 break-all font-mono text-[11px] text-slate-400",
1519
- children: W.Path
1542
+ children: H.Path
1520
1543
  }),
1521
- /* @__PURE__ */ M("div", {
1544
+ /* @__PURE__ */ F("div", {
1522
1545
  className: "mt-1 text-[11px] text-slate-400",
1523
1546
  children: [
1524
- Dt(W.SizeBytes),
1525
- W.MimeType ? ` · ${W.MimeType}` : "",
1526
- W.ModifiedAt ? ` · ${Et(W.ModifiedAt)}` : ""
1547
+ Ft(H.SizeBytes),
1548
+ H.MimeType ? ` · ${H.MimeType}` : "",
1549
+ H.ModifiedAt ? ` · ${Pt(H.ModifiedAt)}` : ""
1527
1550
  ]
1528
1551
  })
1529
1552
  ]
1530
- }), G === "text" || G === "code" || G === "html" || G === "markdown" ? /* @__PURE__ */ M("button", {
1553
+ }), U === "text" || U === "code" || U === "html" || U === "markdown" ? /* @__PURE__ */ F("button", {
1531
1554
  type: "button",
1532
1555
  onClick: () => {
1533
- let e = B.current;
1556
+ let e = R.current;
1534
1557
  e && Y(e());
1535
1558
  },
1536
- disabled: !R || pe,
1537
- className: t("inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition", R && !pe ? "bg-blue-600 text-white hover:bg-blue-700" : "text-slate-400 dark:text-slate-500 cursor-not-allowed"),
1538
- children: [/* @__PURE__ */ j(se, { className: "h-3.5 w-3.5" }), pe ? "保存中" : R ? "保存" : "已保存"]
1559
+ disabled: !N || ge,
1560
+ className: i("inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition", N && !ge ? "bg-blue-600 text-white hover:bg-blue-700" : "text-slate-400 dark:text-slate-500 cursor-not-allowed"),
1561
+ children: [/* @__PURE__ */ P(de, { className: "h-3.5 w-3.5" }), ge ? "保存中" : N ? "保存" : "已保存"]
1539
1562
  }) : null]
1540
- }) : /* @__PURE__ */ M("div", {
1563
+ }) : /* @__PURE__ */ F("div", {
1541
1564
  className: "w-full",
1542
- children: [/* @__PURE__ */ j("div", {
1565
+ children: [/* @__PURE__ */ P("div", {
1543
1566
  className: "text-sm font-semibold text-slate-900 dark:text-slate-100",
1544
1567
  children: "文件预览"
1545
- }), /* @__PURE__ */ j("div", {
1568
+ }), /* @__PURE__ */ P("div", {
1546
1569
  className: "mt-0.5 text-xs text-slate-500 dark:text-slate-400",
1547
1570
  children: "选择左侧文件后可在此查看内容。"
1548
1571
  })]
1549
1572
  })
1550
- }), /* @__PURE__ */ j("div", {
1551
- className: t("custom-scrollbar min-h-0 flex-1", we || Ce ? "overflow-hidden p-0" : "overflow-y-auto px-4 py-4"),
1573
+ }), /* @__PURE__ */ P("div", {
1574
+ className: i("custom-scrollbar min-h-0 flex-1", we || Ce ? "overflow-hidden p-0" : "overflow-y-auto px-4 py-4"),
1552
1575
  children: Se()
1553
1576
  })]
1554
1577
  })]
@@ -1557,54 +1580,54 @@ function jt({ agentId: e, capability: n, open: r, onClose: i, isFullscreen: a =
1557
1580
  }
1558
1581
  //#endregion
1559
1582
  //#region src/components/workspace/WorkspacePanelContainer.tsx
1560
- function Mt({ agentId: n, capability: r, workspacePanelOpen: i, workspacePanelWidth: a, workspacePanelFullscreen: o, isMobile: s, workspaceEnabled: c, workspaceFiles: l, workspacePanelPresentation: u, closeWorkspacePanel: d, handleWorkspacePanelResizeStart: f, api: p }) {
1583
+ function Bt({ agentId: t, capability: n, workspacePanelOpen: r, workspacePanelWidth: a, workspacePanelFullscreen: o, isMobile: s, workspaceEnabled: c, workspaceFiles: l, workspacePanelPresentation: u, closeWorkspacePanel: d, handleWorkspacePanelResizeStart: f, api: p }) {
1561
1584
  let m = u.renderMode === "inline", h = u.renderMode === "sheet";
1562
- return !c || !l ? null : /* @__PURE__ */ M(A, { children: [m ? /* @__PURE__ */ M(A, { children: [i && !o ? /* @__PURE__ */ j("div", {
1585
+ return !c || !l ? null : /* @__PURE__ */ F(N, { children: [m ? /* @__PURE__ */ F(N, { children: [r && !o ? /* @__PURE__ */ P("div", {
1563
1586
  role: "separator",
1564
1587
  "aria-label": "调整 Workspace 宽度",
1565
1588
  "aria-orientation": "vertical",
1566
1589
  onPointerDown: f,
1567
1590
  className: "hidden h-full w-1 cursor-col-resize bg-transparent transition-colors hover:bg-blue-200/60 dark:hover:bg-blue-900/50 md:block"
1568
- }) : null, /* @__PURE__ */ j("aside", {
1569
- style: i && !o ? { width: `${a}px` } : void 0,
1570
- className: t(o ? "fixed inset-0 z-40 flex h-[var(--app-height)] w-screen overflow-hidden bg-white dark:bg-slate-950" : "hidden h-full flex-shrink-0 overflow-hidden bg-white transition-[width] duration-200 ease-out dark:bg-slate-950 md:flex", i ? "border-l border-slate-200/30 dark:border-slate-800/40" : "w-0 border-l border-transparent"),
1571
- children: i ? /* @__PURE__ */ j(jt, {
1572
- agentId: n,
1573
- capability: r,
1574
- open: i,
1591
+ }) : null, /* @__PURE__ */ P("aside", {
1592
+ style: r && !o ? { width: `${a}px` } : void 0,
1593
+ className: i(o ? "fixed inset-0 z-40 flex h-[var(--app-height)] w-screen overflow-hidden bg-white dark:bg-slate-950" : "hidden h-full flex-shrink-0 overflow-hidden bg-white transition-[width] duration-200 ease-out dark:bg-slate-950 md:flex", r ? "border-l border-slate-200/30 dark:border-slate-800/40" : "w-0 border-l border-transparent"),
1594
+ children: r ? /* @__PURE__ */ P(zt, {
1595
+ agentId: t,
1596
+ capability: n,
1597
+ open: r,
1575
1598
  onClose: d,
1576
1599
  isFullscreen: o,
1577
1600
  onToggleFullscreen: () => e.getState().setWorkspacePanelFullscreen(!o),
1578
1601
  isMobile: s,
1579
1602
  api: p
1580
1603
  }) : null
1581
- })] }) : null, h ? /* @__PURE__ */ j(Oe, {
1582
- open: i,
1604
+ })] }) : null, h ? /* @__PURE__ */ P(Ie, {
1605
+ open: r,
1583
1606
  onOpenChange: (t) => {
1584
1607
  t || e.getState().setWorkspacePanelFullscreen(!1), e.getState().setWorkspacePanelOpen(t);
1585
1608
  },
1586
1609
  modal: u.modal,
1587
- children: /* @__PURE__ */ M(Me, {
1610
+ children: /* @__PURE__ */ F(Be, {
1588
1611
  side: u.side,
1589
1612
  showOverlay: u.showOverlay,
1590
1613
  onInteractOutside: (e) => {
1591
1614
  u.preventOutsideClose && e.preventDefault();
1592
1615
  },
1593
1616
  showCloseButton: !1,
1594
- className: t("border-slate-200 bg-white p-0 dark:border-slate-800 dark:bg-slate-950", s ? "h-[70vh] rounded-t-[1.75rem]" : "h-[calc(100vh-1.5rem)] w-[min(72rem,calc(100vw-1.5rem))] max-w-[calc(100vw-1.5rem)] rounded-l-[1.5rem] border-l shadow-2xl"),
1617
+ className: i("border-slate-200 bg-white p-0 dark:border-slate-800 dark:bg-slate-950", s ? "h-[70vh] rounded-t-[1.75rem]" : "h-[calc(100vh-1.5rem)] w-[min(72rem,calc(100vw-1.5rem))] max-w-[calc(100vw-1.5rem)] rounded-l-[1.5rem] border-l shadow-2xl"),
1595
1618
  children: [
1596
- /* @__PURE__ */ j(Fe, {
1619
+ /* @__PURE__ */ P(Ue, {
1597
1620
  className: "sr-only",
1598
1621
  children: "Workspace 文件"
1599
1622
  }),
1600
- /* @__PURE__ */ j(Ie, {
1623
+ /* @__PURE__ */ P(We, {
1601
1624
  className: "sr-only",
1602
1625
  children: "浏览、上传和预览 Workspace 文件。"
1603
1626
  }),
1604
- /* @__PURE__ */ j(jt, {
1605
- agentId: n,
1606
- capability: r,
1607
- open: i,
1627
+ /* @__PURE__ */ P(zt, {
1628
+ agentId: t,
1629
+ capability: n,
1630
+ open: r,
1608
1631
  onClose: d,
1609
1632
  isMobile: s,
1610
1633
  api: p
@@ -1614,4 +1637,4 @@ function Mt({ agentId: n, capability: r, workspacePanelOpen: i, workspacePanelWi
1614
1637
  }) : null] });
1615
1638
  }
1616
1639
  //#endregion
1617
- export { Xe as a, Me as c, Qe as i, Ie as l, yt as n, ze as o, _t as r, Oe as s, Mt as t, Fe as u };
1640
+ export { it as a, Be as c, Fe as d, Pe as f, ot as i, We as l, Dt as n, qe as o, Tt as r, Ie as s, Bt as t, Ue as u };