agentroam-runtime-darwin-arm64 0.2.0-preview.76 → 0.2.0-preview.77

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 (319) hide show
  1. package/manifest.json +2 -2
  2. package/package.json +1 -1
  3. package/runtime/.next/BUILD_ID +1 -1
  4. package/runtime/.next/app-path-routes-manifest.json +1 -1
  5. package/runtime/.next/build-manifest.json +2 -2
  6. package/runtime/.next/prerender-manifest.json +1 -1
  7. package/runtime/.next/server/app/_not-found.html +1 -1
  8. package/runtime/.next/server/app/_not-found.rsc +1 -1
  9. package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
  10. package/runtime/.next/server/app/api/agent/abort/route.js.nft.json +1 -1
  11. package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
  12. package/runtime/.next/server/app/api/agent/answer/route.js.nft.json +1 -1
  13. package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
  14. package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
  15. package/runtime/.next/server/app/api/agent/harness/status/route.js.nft.json +1 -1
  16. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  17. package/runtime/.next/server/app/api/agent/model/route.js.nft.json +1 -1
  18. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  19. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  20. package/runtime/.next/server/app/api/agent/run/route.js.nft.json +1 -1
  21. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  22. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  23. package/runtime/.next/server/app/api/agent/steer/route.js.nft.json +1 -1
  24. package/runtime/.next/server/app/api/agent/stream/route.js +3 -3
  25. package/runtime/.next/server/app/api/agent/stream/route.js.nft.json +1 -1
  26. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  27. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js.nft.json +1 -1
  28. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  29. package/runtime/.next/server/app/api/agent-workspaces/route.js.nft.json +1 -1
  30. package/runtime/.next/server/app/api/business/route.js +1 -1
  31. package/runtime/.next/server/app/api/business/route.js.nft.json +1 -1
  32. package/runtime/.next/server/app/api/calendar/route.js +2 -2
  33. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  34. package/runtime/.next/server/app/api/collaboration/route.js +4 -4
  35. package/runtime/.next/server/app/api/collaboration/route.js.nft.json +1 -1
  36. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  37. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  38. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  39. package/runtime/.next/server/app/api/flow/v1/catalog/route.js.nft.json +1 -1
  40. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  41. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js.nft.json +1 -1
  42. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +1 -1
  43. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js.nft.json +1 -1
  44. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  45. package/runtime/.next/server/app/api/flow/v1/runs/route.js.nft.json +1 -1
  46. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +1 -4
  47. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js.nft.json +1 -1
  48. package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -1
  49. package/runtime/.next/server/app/api/internal/todo-mcp/route.js.nft.json +1 -1
  50. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -1
  51. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js.nft.json +1 -1
  52. package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -1
  53. package/runtime/.next/server/app/api/notifications/[id]/route.js.nft.json +1 -1
  54. package/runtime/.next/server/app/api/notifications/route.js +1 -1
  55. package/runtime/.next/server/app/api/notifications/route.js.nft.json +1 -1
  56. package/runtime/.next/server/app/api/notifications/stream/route.js +1 -1
  57. package/runtime/.next/server/app/api/notifications/stream/route.js.nft.json +1 -1
  58. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  59. package/runtime/.next/server/app/api/plugins/load/route.js.nft.json +1 -1
  60. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  61. package/runtime/.next/server/app/api/push/subscribe/route.js.nft.json +1 -1
  62. package/runtime/.next/server/app/api/push/vapid/route.js +3 -3
  63. package/runtime/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
  64. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  65. package/runtime/.next/server/app/api/remote-tools/register/route.js.nft.json +1 -1
  66. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  67. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  68. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  69. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +3 -3
  70. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  71. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  72. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js.nft.json +1 -1
  73. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  74. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js.nft.json +1 -1
  75. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  76. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js.nft.json +1 -1
  77. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  78. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  79. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  80. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js.nft.json +1 -1
  81. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  82. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  83. package/runtime/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  84. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  85. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  86. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js.nft.json +1 -1
  87. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  88. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  89. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  90. package/runtime/.next/server/app/api/sessions/parallel/route.js.nft.json +1 -1
  91. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  92. package/runtime/.next/server/app/api/sessions/route.js.nft.json +1 -1
  93. package/runtime/.next/server/app/api/todos/[id]/commands/route.js +1 -1
  94. package/runtime/.next/server/app/api/todos/[id]/commands/route.js.nft.json +1 -1
  95. package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -1
  96. package/runtime/.next/server/app/api/todos/[id]/executions/route.js.nft.json +1 -1
  97. package/runtime/.next/server/app/api/todos/[id]/route.js +1 -1
  98. package/runtime/.next/server/app/api/todos/[id]/route.js.nft.json +1 -1
  99. package/runtime/.next/server/app/api/todos/route.js +1 -1
  100. package/runtime/.next/server/app/api/todos/route.js.nft.json +1 -1
  101. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  102. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js.nft.json +1 -1
  103. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  104. package/runtime/.next/server/app/api/tool-policies/route.js.nft.json +1 -1
  105. package/runtime/.next/server/app/api/tools/route.js +1 -1
  106. package/runtime/.next/server/app/api/tools/route.js.nft.json +1 -1
  107. package/runtime/.next/server/app-paths-manifest.json +36 -36
  108. package/runtime/.next/server/chunks/535.js +1 -0
  109. package/runtime/.next/server/chunks/5762.js +3 -3
  110. package/runtime/.next/server/chunks/5801.js +1 -1
  111. package/runtime/.next/server/chunks/5812.js +1 -0
  112. package/runtime/.next/server/chunks/685.js +1 -0
  113. package/runtime/.next/server/chunks/9119.js +4 -4
  114. package/runtime/.next/server/chunks/9457.js +1 -4
  115. package/runtime/.next/server/pages/404.html +1 -1
  116. package/runtime/.next/server/pages/500.html +1 -1
  117. package/runtime/.next/server/server-reference-manifest.json +1 -1
  118. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  119. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  120. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  121. package/runtime/node_modules/.package-lock.json +17 -17
  122. package/runtime/node_modules/@agent/core/dist/index.js +9 -4
  123. package/runtime/node_modules/@agent/native-runtime/dist/index.js +439 -90
  124. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +81 -85
  125. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +65 -65
  126. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0vfvgmex.mjs +39 -0
  127. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-k19jejpn.mjs → core-3h0s3zzg.mjs} +2 -2
  128. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-a8ty0dnc.mjs → core-6w7w19rc.mjs} +2 -2
  129. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-8fprsbvz.mjs +42 -0
  130. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-avz7wgsg.mjs +23 -0
  131. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-b9ebje8h.mjs +20 -0
  132. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-kag24kjr.mjs → core-e1h3fbg3.mjs} +3 -3
  133. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-ae73vzp2.mjs → core-ge6en8c9.mjs} +4 -4
  134. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-e93r8awg.mjs → core-htcq9qj1.mjs} +2 -2
  135. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-v6sp3qjw.mjs → core-nv0a4kre.mjs} +4 -4
  136. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y4qk5bdp.mjs +17 -0
  137. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-nfa6p2rw.mjs → core-yrdmz7je.mjs} +3 -3
  138. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-z276fcqp.mjs +28 -0
  139. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -12
  140. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -21
  141. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -25
  142. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +23 -25
  143. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +85 -85
  144. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +72 -45
  145. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +13 -13
  146. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +13 -13
  147. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +72 -45
  148. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +72 -45
  149. package/runtime/node_modules/mediabunny/dist/modules/src/input.js +6 -0
  150. package/runtime/node_modules/mediabunny/dist/modules/src/media-sink.js +52 -35
  151. package/runtime/node_modules/mediabunny/dist/modules/src/media-source.js +2 -0
  152. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-demuxer.js +7 -1
  153. package/runtime/node_modules/mediabunny/dist/modules/src/source.js +7 -4
  154. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  155. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  156. package/runtime/node_modules/mediabunny/dist/modules/src/wave/wave-demuxer.js +6 -6
  157. package/runtime/node_modules/mediabunny/package.json +1 -1
  158. package/runtime/node_modules/mediabunny/src/input.ts +7 -0
  159. package/runtime/node_modules/mediabunny/src/media-sink.ts +56 -37
  160. package/runtime/node_modules/mediabunny/src/media-source.ts +3 -0
  161. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-demuxer.ts +6 -1
  162. package/runtime/node_modules/mediabunny/src/source.ts +7 -4
  163. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  164. package/runtime/node_modules/mediabunny/src/wave/wave-demuxer.ts +6 -6
  165. package/runtime/node_modules/source-map-js/lib/quick-sort.js +92 -22
  166. package/runtime/node_modules/source-map-js/package.json +1 -1
  167. package/runtime/package-lock.json +41 -65
  168. package/runtime/webapp/dist/assets/{AIHubView-DF0D5qd2.js → AIHubView-CrtJMKfW.js} +1 -1
  169. package/runtime/webapp/dist/assets/{AgentManager-Ccj6ZefC.js → AgentManager-C2O-Dacy.js} +1 -1
  170. package/runtime/webapp/dist/assets/{AiHubPane-3PRSxzO0.js → AiHubPane-D2XWxc9R.js} +1 -1
  171. package/runtime/webapp/dist/assets/App-Bum2L4_E.js +63 -0
  172. package/runtime/webapp/dist/assets/{BrowserLivePanel-BZDtF0ne.js → BrowserLivePanel-DkBugqrH.js} +13 -18
  173. package/runtime/webapp/dist/assets/{CalendarPage-B8Jo-3Da.js → CalendarPage-DzYWlqoZ.js} +1 -1
  174. package/runtime/webapp/dist/assets/CalendarView-BjjC_t12.css +1 -0
  175. package/runtime/webapp/dist/assets/CalendarView-HQls5G-1.js +31 -0
  176. package/runtime/webapp/dist/assets/{CollaborationCreateDialog-CU1t0iYL.js → CollaborationCreateDialog-BwiSJbjb.js} +1 -1
  177. package/runtime/webapp/dist/assets/{CollaborationDashboard-BZhWQXzn.js → CollaborationDashboard-CNHt31kl.js} +1 -1
  178. package/runtime/webapp/dist/assets/{CollaborationPage-BwRJN55v.js → CollaborationPage-C4l-tTvn.js} +2 -2
  179. package/runtime/webapp/dist/assets/{FilePreview-Oo8sZH0t.js → FilePreview-EGUAbGpH.js} +3 -3
  180. package/runtime/webapp/dist/assets/{FileTree-qJTRdDPQ.js → FileTree-aJGl1V0W.js} +1 -1
  181. package/runtime/webapp/dist/assets/{FileWorkspaceDrawer-D40WNAqC.js → FileWorkspaceDrawer-zpD91eB6.js} +1 -1
  182. package/runtime/webapp/dist/assets/{FlowStudioPane-C1tgSbGo.js → FlowStudioPane-K1o4pSkZ.js} +1 -1
  183. package/runtime/webapp/dist/assets/{HostProjectPicker-BEfXuqxT.js → HostProjectPicker-BvboCQ0a.js} +1 -1
  184. package/runtime/webapp/dist/assets/{LSPServerList-DQRv04aP.js → LSPServerList-BSLzGLtW.js} +1 -1
  185. package/runtime/webapp/dist/assets/{MCPServerList-BmsejJC9.js → MCPServerList-CeWTI1-m.js} +1 -1
  186. package/runtime/webapp/dist/assets/{MemoryViewer-qZMdVrli.js → MemoryViewer-YcceFawC.js} +1 -1
  187. package/runtime/webapp/dist/assets/NewSessionWindow-C_HCQQnW.js +1 -0
  188. package/runtime/webapp/dist/assets/NewSessionWindow-DOLG1XEp.css +1 -0
  189. package/runtime/webapp/dist/assets/{RemoteDesktopPage-Dz_6-rOL.js → RemoteDesktopPage-Cpzv8zH0.js} +1 -1
  190. package/runtime/webapp/dist/assets/{RunningSessionsIcon-DJxTmxZn.js → RunningSessionsIcon-DmCYwIYD.js} +1 -1
  191. package/runtime/webapp/dist/assets/{SessionDashboard-DuR9r_ZP.js → SessionDashboard-C58Mke8a.js} +1 -1
  192. package/runtime/webapp/dist/assets/{SessionDashboardBridge-BHVjvDHa.js → SessionDashboardBridge-BPsNDY5Y.js} +1 -1
  193. package/runtime/webapp/dist/assets/{SettingsPanel-B-g919uV.js → SettingsPanel-CPBIPT-Z.js} +1 -1
  194. package/runtime/webapp/dist/assets/{SkillManager-nrWIOtEO.js → SkillManager-_qaGEuOE.js} +1 -1
  195. package/runtime/webapp/dist/assets/{TerminalPane-C4HiD2IC.js → TerminalPane-mYe76Pgb.js} +1 -1
  196. package/runtime/webapp/dist/assets/TodoPage-DdF5_SkL.js +1 -0
  197. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-BXRYzdBT.js → abnfDiagram-VCTEODGH-DLd8EeCY.js} +1 -1
  198. package/runtime/webapp/dist/assets/{arc-BeG7yjCw.js → arc-D4smlqs5.js} +1 -1
  199. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-DIQbpqn7.js → architectureDiagram-5GKGNRK7-ByE3DRU4.js} +1 -1
  200. package/runtime/webapp/dist/assets/{arrow-right-B03zMFiC.js → arrow-right-BtIv2jiq.js} +1 -1
  201. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-DvgKV01C.js → blockDiagram-I7D4REHJ-BvTUm5vA.js} +1 -1
  202. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-DIr7nDIg.js → c4Diagram-7LVT6UL2-XKwj5RmQ.js} +1 -1
  203. package/runtime/webapp/dist/assets/{calendar-days-D1OJEOKr.js → calendar-days-BeI09qof.js} +1 -1
  204. package/runtime/webapp/dist/assets/channel-wxCRUEc2.js +1 -0
  205. package/runtime/webapp/dist/assets/{check-BDiCDSY5.js → check-BdadwkYj.js} +1 -1
  206. package/runtime/webapp/dist/assets/{chevron-down-DIt_NscV.js → chevron-down-DwzPFeq8.js} +1 -1
  207. package/runtime/webapp/dist/assets/{chevron-right-DVhYkZeF.js → chevron-right-kcIXzCMb.js} +1 -1
  208. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Cykdc4to.js → chunk-2Q5K7J3B-7A6CDWIw.js} +1 -1
  209. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-DL-gBU30.js → chunk-5VM5RSS4-mkNEWbY6.js} +1 -1
  210. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-z0F9O96j.js → chunk-F27PBJKO-DKG-1HL0.js} +1 -1
  211. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-DcSgatN1.js → chunk-IMKFNOWR-kiJDyKM7.js} +1 -1
  212. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-BmG1ozp9.js → chunk-JWPE2WC7-DS7C5_M7.js} +1 -1
  213. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-BK2jifSN.js → chunk-POPQ4Y6H-DvgeK_lX.js} +1 -1
  214. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-DtInGjiG.js → chunk-SVP7TREG-BLo_2ua-.js} +1 -1
  215. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-DWdiL4Y6.js → chunk-TICWLB2K-CJT6Qkz4.js} +1 -1
  216. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-w8UYxZUB.js → chunk-XXDRQBXY-D1OLqjNu.js} +1 -1
  217. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-Ct3Cgqrl.js +1 -0
  218. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-Ct3Cgqrl.js +1 -0
  219. package/runtime/webapp/dist/assets/{codeSyntax-Cprr1Nm9.js → codeSyntax-Dd0hAazb.js} +1 -1
  220. package/runtime/webapp/dist/assets/collaboration-CAgt9AiV.js +6 -0
  221. package/runtime/webapp/dist/assets/composer-file-routing-DSC2Eojr.js +6 -0
  222. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-BJgwy7Y5.js → cose-bilkent-JH36ORCC-CI6EKHP8.js} +1 -1
  223. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BssWa1kU.js → cynefin-OW5HDTMX-CJTXYieX.js} +1 -1
  224. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-Bv_-fuG_.js → cynefinDiagram-5FMLGOSQ-CPl1UVhy.js} +1 -1
  225. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-BjA5n2Zi.js → dagre-GXQ25YYZ-Dq3ZQGTN.js} +1 -1
  226. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-CCT38L0E.js → diagram-S7CK7UJ4-DJyU-2Di.js} +1 -1
  227. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-4fLw8kje.js → diagram-UQ7AKVKN-Csg8hC8m.js} +1 -1
  228. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-43_Qj0Se.js → diagram-VSXAHHWV-B14uLH_N.js} +1 -1
  229. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-BHEXgMDZ.js → diagram-VX7I27RA-D2Ww2nHe.js} +1 -1
  230. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-BRTSiXVr.js → diagram-Z3DM3KII-D_YC6AVP.js} +1 -1
  231. package/runtime/webapp/dist/assets/{download-CuYS63Ny.js → download-COWHIKec.js} +1 -1
  232. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-B4GImY-o.js → ebnfDiagram-PWID7BFC-s66xVEGY.js} +1 -1
  233. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-EmEsAxWS.js → erDiagram-RLTQ6QDP-CgZh5cEn.js} +1 -1
  234. package/runtime/webapp/dist/assets/{external-link-Baeyco26.js → external-link-T3kil1jt.js} +1 -1
  235. package/runtime/webapp/dist/assets/{file-types-CykGmGsd.js → file-types-0e-tNIVd.js} +1 -1
  236. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-sky_wmbX.js → flowDiagram-HODETNUW-BISMKynN.js} +1 -1
  237. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-Cc71xV1j.js → ganttDiagram-EL5Y4UJY-Cbyu0NcF.js} +1 -1
  238. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-z7uQ8-8z.js → gitGraphDiagram-WWUBYQGX-Cs6IQGBz.js} +1 -1
  239. package/runtime/webapp/dist/assets/{history-C7WUwl_W.js → history-Df4LXw6L.js} +1 -1
  240. package/runtime/webapp/dist/assets/{image-plus-B2RK1ogI.js → image-plus-COHCHOpI.js} +1 -1
  241. package/runtime/webapp/dist/assets/index-CQTDnt74.css +1 -0
  242. package/runtime/webapp/dist/assets/{index-d8fS3JdV.js → index-CTJNAMck.js} +52 -52
  243. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DXLEePz0.js → infoDiagram-27XIBGKW-4f3bFqNV.js} +1 -1
  244. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-DCFXm_zQ.js → ishikawaDiagram-5VMMS53U-D-cJ9vio.js} +1 -1
  245. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-DHWCpvY6.js → journeyDiagram-3NMN7TZE-CeToS0Qx.js} +1 -1
  246. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-D_uP81aw.js → kanban-definition-UXKFOSKX-DStbIUk1.js} +1 -1
  247. package/runtime/webapp/dist/assets/{layout-Bcu83-1p.js → layout-i2D4wlYd.js} +1 -1
  248. package/runtime/webapp/dist/assets/{linear-CPim5SQa.js → linear-BcJhiCv3.js} +1 -1
  249. package/runtime/webapp/dist/assets/{list-todo-F1W4yBLx.js → list-todo-7yETOqQe.js} +1 -1
  250. package/runtime/webapp/dist/assets/{loader-circle-DesEGpVH.js → loader-circle-CZdAfU-D.js} +1 -1
  251. package/runtime/webapp/dist/assets/{locate-fixed-UXM91vCS.js → locate-fixed-ByJuEKxC.js} +1 -1
  252. package/runtime/webapp/dist/assets/{mermaid.core-CyzKk3O2.js → mermaid.core-BjNFAB9I.js} +5 -5
  253. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-0MHQpQro.js → mindmap-definition-YA3MSWOX-BUIHHUVG.js} +1 -1
  254. package/runtime/webapp/dist/assets/new-session-window-C7R76XMp.css +1 -0
  255. package/runtime/webapp/dist/assets/new-session-window-DwtkwFBQ.js +190 -0
  256. package/runtime/webapp/dist/assets/{page-C2e368Dx.js → page-9-9EC7QM.js} +3 -3
  257. package/runtime/webapp/dist/assets/{pause-_h6c8qPD.js → pause-DXyBDZlg.js} +1 -1
  258. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-BNinoE-7.js → pegDiagram-XKGWAZYB-BY5Bio5e.js} +1 -1
  259. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-CfPzV9yb.js → pieDiagram-E7YTZNPT-CF8DVW3F.js} +1 -1
  260. package/runtime/webapp/dist/assets/{pin-BcXr5230.js → pin-2YlrlSJv.js} +1 -1
  261. package/runtime/webapp/dist/assets/{play-BdB0D0rZ.js → play-BxEpdvoI.js} +1 -1
  262. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-0qLb33lM.js → quadrantDiagram-AXDQQJYC-CXWHO3a-.js} +1 -1
  263. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-DNU4eRJt.js → railroadDiagram-O6MQD6OU-C20JeJZ-.js} +1 -1
  264. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-BWJRwKX8.js → requirementDiagram-BXWQKSXE-IYd9UrO9.js} +1 -1
  265. package/runtime/webapp/dist/assets/{rotate-ccw-BdZpOTYP.js → rotate-ccw-CFIRtbUD.js} +1 -1
  266. package/runtime/webapp/dist/assets/{rotate-cw-D-zPMe4i.js → rotate-cw-B_vFqNsz.js} +1 -1
  267. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-CGW9pvun.js → sankeyDiagram-P5KCCOFB-ysBhpblA.js} +1 -1
  268. package/runtime/webapp/dist/assets/{send-DCVOqOap.js → send-DUE2vBoK.js} +1 -1
  269. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-CeVAD519.js → sequenceDiagram-WJ2MYXX4-CQMmk6cu.js} +1 -1
  270. package/runtime/webapp/dist/assets/session-dashboard-DnFhQhBN.js +1 -0
  271. package/runtime/webapp/dist/assets/{shield-check-DrxVJwVC.js → shield-check-Btyos6Iv.js} +1 -1
  272. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-Dj5SukiO.js → sizeCapture-INFHLROL-DekvKUn1.js} +1 -1
  273. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-UtRSslyd.js → stateDiagram-D77RDMKH-Ds_FEmbr.js} +1 -1
  274. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DxJ1ks_8.js +1 -0
  275. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-DKbrz8SF.js → swimlanes-42K2YHIH-cjPcEO_T.js} +1 -1
  276. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-JGHIAQXy.js +8 -0
  277. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-mtVdMOBL.js → timeline-definition-24CTP7MA-CEOprVt5.js} +1 -1
  278. package/runtime/webapp/dist/assets/{trash-2-Bbhd8-xd.js → trash-2-DLDxY6J7.js} +1 -1
  279. package/runtime/webapp/dist/assets/{types-CMhUwzwJ.js → types-CFAnlTif.js} +1 -1
  280. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-ZcuGEhJx.js → vennDiagram-4TSXK5OY-D82uxYY9.js} +1 -1
  281. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-CnAYI2ZE.js → wardleyDiagram-VM6X3IG4-JFt7Izt0.js} +1 -1
  282. package/runtime/webapp/dist/assets/{web-BH9JgWsL.js → web-BMqaP0jw.js} +1 -1
  283. package/runtime/webapp/dist/assets/{web-CBiaPgEe.js → web-Q9VPRftY.js} +1 -1
  284. package/runtime/webapp/dist/assets/{x-1GQMVfza.js → x-CeSbythI.js} +1 -1
  285. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-B_uJt0Bg.js → xychartDiagram-S5SC5T6Z-1WCa4SfL.js} +1 -1
  286. package/runtime/webapp/dist/assets/{zoom-out-BNKdrTFD.js → zoom-out-CRr_o1NV.js} +8 -3
  287. package/runtime/webapp/dist/index.html +2 -2
  288. package/runtime/ws-server.mjs +11 -0
  289. package/runtime/.next/server/chunks/2480.js +0 -4
  290. package/runtime/.next/server/chunks/3604.js +0 -4
  291. package/runtime/.next/server/chunks/732.js +0 -1
  292. package/runtime/.next/server/chunks/7788.js +0 -1
  293. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-25bstexa.mjs +0 -17
  294. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-4ps8vwh1.mjs +0 -42
  295. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-9a7zb9bm.mjs +0 -53
  296. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-dsa3p77h.mjs +0 -18
  297. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-eqz9ara6.mjs +0 -18
  298. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-esw7xtkz.mjs +0 -17
  299. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ey906mbk.mjs +0 -20
  300. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-mhczx7zp.mjs +0 -18
  301. package/runtime/webapp/dist/assets/App-HomcUet2.js +0 -63
  302. package/runtime/webapp/dist/assets/CalendarView-BD7GhA0i.js +0 -36
  303. package/runtime/webapp/dist/assets/CalendarView-DHi-mzjY.css +0 -1
  304. package/runtime/webapp/dist/assets/NewSessionWindow-BOCZ0mXT.css +0 -1
  305. package/runtime/webapp/dist/assets/NewSessionWindow-uzVK5LVS.js +0 -1
  306. package/runtime/webapp/dist/assets/TodoPage-Bn6j6kR6.js +0 -1
  307. package/runtime/webapp/dist/assets/channel-Cchxg6Fx.js +0 -1
  308. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BGv4sK1I.js +0 -1
  309. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BGv4sK1I.js +0 -1
  310. package/runtime/webapp/dist/assets/collaboration-acdqOxaY.js +0 -6
  311. package/runtime/webapp/dist/assets/composer-file-routing-BsSxfxUa.js +0 -6
  312. package/runtime/webapp/dist/assets/index-B_fTpc5K.css +0 -1
  313. package/runtime/webapp/dist/assets/new-session-window-B4BJYrds.css +0 -1
  314. package/runtime/webapp/dist/assets/new-session-window-fsYu53Ht.js +0 -188
  315. package/runtime/webapp/dist/assets/session-dashboard-BAYi5acZ.js +0 -1
  316. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Se3lznH6.js +0 -1
  317. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-C-Zsmae7.js +0 -8
  318. /package/runtime/.next/static/{q4ez_w8bVMUW1e57Cd7GC → alt-ud1W2PlWW6FLlkBcB}/_buildManifest.js +0 -0
  319. /package/runtime/.next/static/{q4ez_w8bVMUW1e57Cd7GC → alt-ud1W2PlWW6FLlkBcB}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- import{r as n,a as D,j as e,R,P as z}from"./index-d8fS3JdV.js";import{F as B,D as H,P as I,a as K,b as M,c as T,d as J,N as W,e as O,f as V,g as X,h as q,i as G,j as Q}from"./file-types-CykGmGsd.js";import{X as U}from"./x-1GQMVfza.js";import{A as Y}from"./trash-2-Bbhd8-xd.js";import{C as Z}from"./chevron-right-DVhYkZeF.js";const _={folder:{icon:G,label:"文件夹"},code:{icon:q,label:"代码文件"},style:{icon:z,label:"样式文件"},image:{icon:X,label:"图片文件"},video:{icon:V,label:"视频文件"},audio:{icon:O,label:"音频文件"},markdown:{icon:W,label:"Markdown 文件"},text:{icon:J,label:"文本文件"},json:{icon:T,label:"JSON 文件"},archive:{icon:M,label:"压缩文件"},spreadsheet:{icon:K,label:"表格文件"},presentation:{icon:I,label:"演示文件"},database:{icon:H,label:"数据库文件"},file:{icon:B,label:"文件"}};function ee(a,d){return d==="directory"?"folder":Q(a)}const x=a=>a.replace(/\\/g,"/").replace(/\/+$/,"")||"/";function te(a,d){for(const l of d){if(!(l!=null&&l.trim()))continue;const h=x(l);if(h.split("/").some(o=>o==="."||o===".."))continue;const p=a.map(x).filter(o=>h===o||h.startsWith(o==="/"?"/":`${o}/`)).sort((o,c)=>c.length-o.length)[0];if(p)return{root:p,current:h}}const s=a[0]?x(a[0]):"";return{root:s,current:s}}function se(a,d){const s=x(a),l=x(d),p=[{label:s==="/"?"/":s.split("/").filter(Boolean).pop()||s,path:s}];if(l===s)return p;const o=l.slice(s==="/"?1:s.length+1);let c=s;for(const i of o.split("/").filter(Boolean))c=c==="/"?`/${i}`:`${c}/${i}`,p.push({label:i,path:c});return p}function ce({open:a,initialPath:d,onCancel:s,onConfirm:l}){const[h,p]=n.useState([]),[o,c]=n.useState(""),[i,y]=n.useState(""),[E,g]=n.useState([]),[b,k]=n.useState(!1),[F,u]=n.useState(""),[v,P]=n.useState(!1),[C,w]=n.useState(!1),m=n.useMemo(()=>o&&i?se(o,i):[],[o,i]),j=async t=>{if(window.agentApi){k(!0),w(!1),u(""),y(t),g([]);try{const r=await window.agentApi.listProjectDirectories(t);g(r),w(!0)}catch(r){u(r instanceof Error?r.message:"无法读取目录")}finally{k(!1)}}};if(n.useEffect(()=>{if(!a||!window.agentApi)return;let t=!1;return k(!0),u(""),c(""),y(""),w(!1),g([]),window.agentApi.getProjectPickerLocation().then(async({roots:r,initialPath:N})=>{if(t)return;p(r);const f=te(r,[d,N]);c(f.root),f.current?await j(f.current):u("未配置可用的宿主机目录")}).catch(r=>{t||u(r instanceof Error?r.message:"无法读取宿主机目录")}).finally(()=>{t||k(!1)}),()=>{t=!0}},[a,d]),n.useEffect(()=>{if(!a)return;const t=r=>{r.key==="Escape"&&s()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[a,s]),!a)return null;const S=t=>{c(t),j(t)},$=()=>{m.length<=1||j(m[m.length-2].path)},A=async()=>{if(!(!i||!C||v)){P(!0),u("");try{await l(i)}catch(t){u(t instanceof Error?t.message:"项目导入失败")}finally{P(!1)}}};return D.createPortal(e.jsx("div",{className:"host-project-picker-backdrop",role:"presentation",onMouseDown:t=>{t.target===t.currentTarget&&s()},children:e.jsxs("section",{className:"host-project-picker",role:"dialog","aria-modal":"true","aria-labelledby":"host-project-picker-title",children:[e.jsxs("header",{className:"host-project-picker-header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"host-project-picker-title",children:"选择宿主机项目"}),e.jsx("p",{children:"文件将直接在运行 AgentRoam 的机器上读写"})]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:s,"aria-label":"关闭目录选择器",title:"关闭",children:e.jsx(U,{size:16,"aria-hidden":"true"})})]}),h.length>1&&e.jsxs("label",{className:"host-project-picker-root",children:[e.jsx("span",{children:"根目录"}),e.jsx("select",{value:o,onChange:t=>S(t.target.value),children:h.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("nav",{className:"host-project-picker-nav","aria-label":"当前目录",children:[e.jsx("button",{type:"button",className:"ui-icon-button",onClick:$,disabled:m.length<=1,"aria-label":"返回上级目录",title:"返回上级目录",children:e.jsx(Y,{size:16,"aria-hidden":"true"})}),e.jsxs("div",{className:"host-project-picker-breadcrumbs",children:[!i&&e.jsx("span",{children:b?"正在定位工作目录…":"未能加载工作目录"}),m.map((t,r)=>e.jsxs("span",{children:[r>0&&e.jsx("i",{children:"/"}),e.jsx("button",{type:"button",onClick:()=>void j(t.path),children:t.label})]},t.path))]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:()=>i&&void j(i),disabled:!i||b,"aria-label":"刷新目录",title:"刷新目录",children:e.jsx(R,{size:15,"aria-hidden":"true"})})]}),o==="/"&&e.jsx("div",{className:"host-project-picker-warning",children:"当前允许访问宿主机根目录,请谨慎选择项目。"}),e.jsx("div",{className:"host-project-picker-list","aria-busy":b,children:b?e.jsx("div",{className:"host-project-picker-state",children:"正在读取目录…"}):F?e.jsx("div",{className:"host-project-picker-state is-error",children:F}):E.length===0?e.jsx("div",{className:"host-project-picker-state",children:"此目录为空"}):E.map(t=>{const r=ee(t.name,t.kind),{icon:N,label:f}=_[r],L=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`host-project-picker-entry-icon is-${r}`,"aria-hidden":"true",children:e.jsx(N,{size:18,strokeWidth:1.8})}),e.jsx("span",{className:"host-project-picker-name",children:t.name})]});return t.kind==="file"?e.jsx("div",{className:"host-project-picker-row is-file",title:f,children:L},`${t.name}:${t.path}`):e.jsxs("button",{type:"button",className:"host-project-picker-row is-directory",onClick:()=>void j(t.path),title:f,children:[L,t.hasChildren&&e.jsx("span",{className:"host-project-picker-chevron","aria-hidden":"true",children:e.jsx(Z,{size:16})})]},`${t.name}:${t.path}`)})}),e.jsxs("footer",{className:"host-project-picker-footer",children:[e.jsx("code",{title:i,children:i}),e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"host-project-picker-cancel",onClick:s,children:"取消"}),e.jsx("button",{type:"button",className:"host-project-picker-confirm",disabled:!i||!C||b||v,onClick:()=>void A(),children:v?"正在导入…":"选择此文件夹"})]})]})]})}),document.body)}export{ce as H};
1
+ import{r as n,a as D,j as e,R,P as z}from"./index-CTJNAMck.js";import{F as B,D as H,P as I,a as K,b as M,c as T,d as J,N as W,e as O,f as V,g as X,h as q,i as G,j as Q}from"./file-types-0e-tNIVd.js";import{X as U}from"./x-CeSbythI.js";import{A as Y}from"./trash-2-DLDxY6J7.js";import{C as Z}from"./chevron-right-kcIXzCMb.js";const _={folder:{icon:G,label:"文件夹"},code:{icon:q,label:"代码文件"},style:{icon:z,label:"样式文件"},image:{icon:X,label:"图片文件"},video:{icon:V,label:"视频文件"},audio:{icon:O,label:"音频文件"},markdown:{icon:W,label:"Markdown 文件"},text:{icon:J,label:"文本文件"},json:{icon:T,label:"JSON 文件"},archive:{icon:M,label:"压缩文件"},spreadsheet:{icon:K,label:"表格文件"},presentation:{icon:I,label:"演示文件"},database:{icon:H,label:"数据库文件"},file:{icon:B,label:"文件"}};function ee(a,d){return d==="directory"?"folder":Q(a)}const x=a=>a.replace(/\\/g,"/").replace(/\/+$/,"")||"/";function te(a,d){for(const l of d){if(!(l!=null&&l.trim()))continue;const h=x(l);if(h.split("/").some(o=>o==="."||o===".."))continue;const p=a.map(x).filter(o=>h===o||h.startsWith(o==="/"?"/":`${o}/`)).sort((o,c)=>c.length-o.length)[0];if(p)return{root:p,current:h}}const s=a[0]?x(a[0]):"";return{root:s,current:s}}function se(a,d){const s=x(a),l=x(d),p=[{label:s==="/"?"/":s.split("/").filter(Boolean).pop()||s,path:s}];if(l===s)return p;const o=l.slice(s==="/"?1:s.length+1);let c=s;for(const i of o.split("/").filter(Boolean))c=c==="/"?`/${i}`:`${c}/${i}`,p.push({label:i,path:c});return p}function ce({open:a,initialPath:d,onCancel:s,onConfirm:l}){const[h,p]=n.useState([]),[o,c]=n.useState(""),[i,y]=n.useState(""),[E,g]=n.useState([]),[b,k]=n.useState(!1),[F,u]=n.useState(""),[v,P]=n.useState(!1),[C,w]=n.useState(!1),m=n.useMemo(()=>o&&i?se(o,i):[],[o,i]),j=async t=>{if(window.agentApi){k(!0),w(!1),u(""),y(t),g([]);try{const r=await window.agentApi.listProjectDirectories(t);g(r),w(!0)}catch(r){u(r instanceof Error?r.message:"无法读取目录")}finally{k(!1)}}};if(n.useEffect(()=>{if(!a||!window.agentApi)return;let t=!1;return k(!0),u(""),c(""),y(""),w(!1),g([]),window.agentApi.getProjectPickerLocation().then(async({roots:r,initialPath:N})=>{if(t)return;p(r);const f=te(r,[d,N]);c(f.root),f.current?await j(f.current):u("未配置可用的宿主机目录")}).catch(r=>{t||u(r instanceof Error?r.message:"无法读取宿主机目录")}).finally(()=>{t||k(!1)}),()=>{t=!0}},[a,d]),n.useEffect(()=>{if(!a)return;const t=r=>{r.key==="Escape"&&s()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[a,s]),!a)return null;const S=t=>{c(t),j(t)},$=()=>{m.length<=1||j(m[m.length-2].path)},A=async()=>{if(!(!i||!C||v)){P(!0),u("");try{await l(i)}catch(t){u(t instanceof Error?t.message:"项目导入失败")}finally{P(!1)}}};return D.createPortal(e.jsx("div",{className:"host-project-picker-backdrop",role:"presentation",onMouseDown:t=>{t.target===t.currentTarget&&s()},children:e.jsxs("section",{className:"host-project-picker",role:"dialog","aria-modal":"true","aria-labelledby":"host-project-picker-title",children:[e.jsxs("header",{className:"host-project-picker-header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"host-project-picker-title",children:"选择宿主机项目"}),e.jsx("p",{children:"文件将直接在运行 AgentRoam 的机器上读写"})]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:s,"aria-label":"关闭目录选择器",title:"关闭",children:e.jsx(U,{size:16,"aria-hidden":"true"})})]}),h.length>1&&e.jsxs("label",{className:"host-project-picker-root",children:[e.jsx("span",{children:"根目录"}),e.jsx("select",{value:o,onChange:t=>S(t.target.value),children:h.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("nav",{className:"host-project-picker-nav","aria-label":"当前目录",children:[e.jsx("button",{type:"button",className:"ui-icon-button",onClick:$,disabled:m.length<=1,"aria-label":"返回上级目录",title:"返回上级目录",children:e.jsx(Y,{size:16,"aria-hidden":"true"})}),e.jsxs("div",{className:"host-project-picker-breadcrumbs",children:[!i&&e.jsx("span",{children:b?"正在定位工作目录…":"未能加载工作目录"}),m.map((t,r)=>e.jsxs("span",{children:[r>0&&e.jsx("i",{children:"/"}),e.jsx("button",{type:"button",onClick:()=>void j(t.path),children:t.label})]},t.path))]}),e.jsx("button",{type:"button",className:"ui-icon-button",onClick:()=>i&&void j(i),disabled:!i||b,"aria-label":"刷新目录",title:"刷新目录",children:e.jsx(R,{size:15,"aria-hidden":"true"})})]}),o==="/"&&e.jsx("div",{className:"host-project-picker-warning",children:"当前允许访问宿主机根目录,请谨慎选择项目。"}),e.jsx("div",{className:"host-project-picker-list","aria-busy":b,children:b?e.jsx("div",{className:"host-project-picker-state",children:"正在读取目录…"}):F?e.jsx("div",{className:"host-project-picker-state is-error",children:F}):E.length===0?e.jsx("div",{className:"host-project-picker-state",children:"此目录为空"}):E.map(t=>{const r=ee(t.name,t.kind),{icon:N,label:f}=_[r],L=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`host-project-picker-entry-icon is-${r}`,"aria-hidden":"true",children:e.jsx(N,{size:18,strokeWidth:1.8})}),e.jsx("span",{className:"host-project-picker-name",children:t.name})]});return t.kind==="file"?e.jsx("div",{className:"host-project-picker-row is-file",title:f,children:L},`${t.name}:${t.path}`):e.jsxs("button",{type:"button",className:"host-project-picker-row is-directory",onClick:()=>void j(t.path),title:f,children:[L,t.hasChildren&&e.jsx("span",{className:"host-project-picker-chevron","aria-hidden":"true",children:e.jsx(Z,{size:16})})]},`${t.name}:${t.path}`)})}),e.jsxs("footer",{className:"host-project-picker-footer",children:[e.jsx("code",{title:i,children:i}),e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"host-project-picker-cancel",onClick:s,children:"取消"}),e.jsx("button",{type:"button",className:"host-project-picker-confirm",disabled:!i||!C||b||v,onClick:()=>void A(),children:v?"正在导入…":"选择此文件夹"})]})]})]})}),document.body)}export{ce as H};
@@ -1,4 +1,4 @@
1
- import{r as l,j as e}from"./index-d8fS3JdV.js";const L=[{label:"TypeScript / JavaScript",language:"typescript",fileTypes:".ts,.tsx,.js,.jsx",command:"typescript-language-server",args:"--stdio"},{label:"Python (pylsp)",language:"python",fileTypes:".py",command:"pylsp",args:""},{label:"Python (pyright)",language:"python",fileTypes:".py",command:"pyright-langserver",args:"--stdio"},{label:"Rust (rust-analyzer)",language:"rust",fileTypes:".rs",command:"rust-analyzer",args:""},{label:"Go (gopls)",language:"go",fileTypes:".go",command:"gopls",args:""},{label:"C/C++ (clangd)",language:"cpp",fileTypes:".c,.cpp,.cc,.h,.hpp",command:"clangd",args:""},{label:"Java (jdtls via brew)",language:"java",fileTypes:".java",command:"jdtls",args:"--data /tmp/jdtls-workspace"}],y={id:"",name:"",language:"",fileTypes:"",command:"",args:"",envRaw:""};function P(){const[v,w]=l.useState([]),[t,o]=l.useState(y),[x,h]=l.useState(!1),[d,m]=l.useState(null),[f,b]=l.useState(null),g=async()=>{var n;if((n=window.agentApi)!=null&&n.lspList)try{const a=await window.agentApi.lspList();w(a)}catch(a){console.error("[LSP] load error",a)}};l.useEffect(()=>{g()},[]);const k=n=>{o(a=>({...a,name:n.label,language:n.language,fileTypes:n.fileTypes,command:n.command,args:n.args}))},T=n=>{m(n.id),o({id:n.id,name:n.name,language:n.language,fileTypes:n.fileTypes.join(","),command:n.command,args:n.args.join(" "),envRaw:n.env?Object.entries(n.env).map(([a,r])=>`${a}=${r}`).join(`
1
+ import{r as l,j as e}from"./index-CTJNAMck.js";const L=[{label:"TypeScript / JavaScript",language:"typescript",fileTypes:".ts,.tsx,.js,.jsx",command:"typescript-language-server",args:"--stdio"},{label:"Python (pylsp)",language:"python",fileTypes:".py",command:"pylsp",args:""},{label:"Python (pyright)",language:"python",fileTypes:".py",command:"pyright-langserver",args:"--stdio"},{label:"Rust (rust-analyzer)",language:"rust",fileTypes:".rs",command:"rust-analyzer",args:""},{label:"Go (gopls)",language:"go",fileTypes:".go",command:"gopls",args:""},{label:"C/C++ (clangd)",language:"cpp",fileTypes:".c,.cpp,.cc,.h,.hpp",command:"clangd",args:""},{label:"Java (jdtls via brew)",language:"java",fileTypes:".java",command:"jdtls",args:"--data /tmp/jdtls-workspace"}],y={id:"",name:"",language:"",fileTypes:"",command:"",args:"",envRaw:""};function P(){const[v,w]=l.useState([]),[t,o]=l.useState(y),[x,h]=l.useState(!1),[d,m]=l.useState(null),[f,b]=l.useState(null),g=async()=>{var n;if((n=window.agentApi)!=null&&n.lspList)try{const a=await window.agentApi.lspList();w(a)}catch(a){console.error("[LSP] load error",a)}};l.useEffect(()=>{g()},[]);const k=n=>{o(a=>({...a,name:n.label,language:n.language,fileTypes:n.fileTypes,command:n.command,args:n.args}))},T=n=>{m(n.id),o({id:n.id,name:n.name,language:n.language,fileTypes:n.fileTypes.join(","),command:n.command,args:n.args.join(" "),envRaw:n.env?Object.entries(n.env).map(([a,r])=>`${a}=${r}`).join(`
2
2
  `):""}),b(null)},j=()=>{m(null),o(y)},R=async()=>{var S;if(!((S=window.agentApi)!=null&&S.lspSave))return;const n=t.name.trim(),a=t.command.trim();if(!n||!a)return;let r;if(t.envRaw.trim()){r={};for(const p of t.envRaw.split(`
3
3
  `)){const u=p.indexOf("=");u>0&&(r[p.slice(0,u).trim()]=p.slice(u+1).trim())}}const F={id:d??crypto.randomUUID(),name:n,language:t.language.trim(),fileTypes:t.fileTypes.split(",").map(p=>p.trim()).filter(Boolean),command:a,args:t.args.trim()?t.args.trim().split(/\s+/):[],env:r,enabled:!0};h(!0);try{await window.agentApi.lspSave(F),await g(),j()}finally{h(!1)}},z=async n=>{var a;(a=window.agentApi)!=null&&a.lspDelete&&confirm("删除此 LSP 服务器配置?")&&(await window.agentApi.lspDelete(n),await g())},C=async n=>{var a;(a=window.agentApi)!=null&&a.lspSetEnabled&&(await window.agentApi.lspSetEnabled(n.id,!n.enabled),await g())},c=d!==null;return c&&d===null||!d&&t.name,e.jsxs("div",{style:{padding:"40px 48px",maxWidth:720,animation:"fadeInUp 0.4s var(--ease-out)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:24},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontSize:20,fontWeight:600,color:"var(--text-primary)",margin:0},children:"LSP 服务器"}),e.jsxs("p",{style:{fontSize:13,color:"var(--text-muted)",margin:"4px 0 0"},children:["配置 Language Server Protocol 服务器,让 Agent 可通过"," ",e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:12,color:"var(--text-secondary)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:4},children:"lsp_diagnostics"}),"、",e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:12,color:"var(--text-secondary)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:4},children:"lsp_hover"}),"、",e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:12,color:"var(--text-secondary)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:4},children:"lsp_definition"})," ","等工具进行代码分析。"]})]}),!c&&e.jsx("button",{onClick:()=>{m(""),o(y)},style:{padding:"8px 16px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer",flexShrink:0},children:"+ 添加服务器"})]}),v.length===0&&!c&&e.jsx("div",{style:{color:"var(--text-muted)",fontSize:14,padding:"40px 0",textAlign:"center"},children:"尚未配置任何 LSP 服务器"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:c?24:0},children:v.map(n=>e.jsxs("div",{style:{background:"var(--bg-glass)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",cursor:"pointer"},onClick:()=>b(f===n.id?null:n.id),children:[e.jsx("div",{onClick:a=>{a.stopPropagation(),C(n)},style:{width:32,height:18,borderRadius:9,background:n.enabled?"var(--success, #34d399)":"var(--border-default)",position:"relative",cursor:"pointer",flexShrink:0,transition:"background 0.2s"},children:e.jsx("div",{style:{position:"absolute",top:2,left:n.enabled?16:2,width:14,height:14,borderRadius:"50%",background:"#fff",transition:"left 0.2s"}})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontWeight:500,fontSize:13,color:"var(--text-primary)"},children:n.name}),e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:2},children:[n.language,n.fileTypes.length>0?` · ${n.fileTypes.join(", ")}`:""]})]}),e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"var(--font-mono, monospace)",flexShrink:0},children:[n.command,n.args.length?" "+n.args.join(" "):""]}),e.jsx("button",{onClick:a=>{a.stopPropagation(),T(n)},style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:13,padding:"2px 8px",fontFamily:"var(--font-body)"},children:"编辑"}),e.jsx("button",{onClick:a=>{a.stopPropagation(),z(n.id)},style:{background:"none",border:"none",cursor:"pointer",color:"var(--danger, #f43f5e)",fontSize:13,padding:"2px 8px",fontFamily:"var(--font-body)"},children:"删除"}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2.5",strokeLinecap:"round",style:{flexShrink:0,transition:"transform 0.2s",transform:f===n.id?"rotate(180deg)":"none"},children:e.jsx("path",{d:"M6 9l6 6 6-6"})})]}),f===n.id&&e.jsxs("div",{style:{padding:"12px 16px",fontSize:12,color:"var(--text-muted)",borderTop:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",gap:6},children:[e.jsxs("div",{children:[e.jsx("span",{style:{color:"var(--text-secondary)",fontWeight:500},children:"命令:"}),e.jsxs("code",{style:{fontFamily:"var(--font-mono, monospace)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:4},children:[n.command," ",n.args.join(" ")]})]}),n.fileTypes.length>0&&e.jsxs("div",{children:[e.jsx("span",{style:{color:"var(--text-secondary)",fontWeight:500},children:"文件类型:"}),n.fileTypes.join(", ")]}),n.env&&Object.keys(n.env).length>0&&e.jsxs("div",{children:[e.jsx("span",{style:{color:"var(--text-secondary)",fontWeight:500},children:"环境变量:"}),Object.entries(n.env).map(([a,r])=>`${a}=${r}`).join(", ")]})]})]},n.id))}),c&&e.jsxs("div",{style:{padding:"20px 24px",borderRadius:"var(--radius-md)",border:"1px solid var(--border-glow)",background:"var(--bg-glass)"},children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:d?"编辑 LSP 服务器":"添加 LSP 服务器"}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:i,children:"快速预设"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:L.map(n=>e.jsx("button",{onClick:()=>k(n),style:{background:"var(--bg-deep)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"4px 10px",fontSize:11,cursor:"pointer",color:"var(--text-secondary)",fontFamily:"var(--font-body)"},children:n.label},n.label))})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[e.jsxs("div",{children:[e.jsxs("label",{style:i,children:["名称 ",e.jsx("span",{style:{color:"var(--danger, #f43f5e)",textTransform:"none"},children:"*"})]}),e.jsx("input",{value:t.name,onChange:n=>o(a=>({...a,name:n.target.value})),placeholder:"TypeScript Language Server",style:s})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:"语言"}),e.jsx("input",{value:t.language,onChange:n=>o(a=>({...a,language:n.target.value})),placeholder:"typescript",style:s})]})]}),e.jsxs("div",{children:[e.jsxs("label",{style:i,children:["文件类型",e.jsx("span",{style:{textTransform:"none",letterSpacing:0,fontWeight:400,marginLeft:6,color:"var(--text-muted)"},children:"逗号分隔,如 .ts,.tsx"})]}),e.jsx("input",{value:t.fileTypes,onChange:n=>o(a=>({...a,fileTypes:n.target.value})),placeholder:".ts,.tsx,.js,.jsx",style:s})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[e.jsxs("div",{children:[e.jsxs("label",{style:i,children:["命令 ",e.jsx("span",{style:{color:"var(--danger, #f43f5e)",textTransform:"none"},children:"*"})]}),e.jsx("input",{value:t.command,onChange:n=>o(a=>({...a,command:n.target.value})),placeholder:"typescript-language-server",style:{...s,fontFamily:"var(--font-mono, monospace)"}})]}),e.jsxs("div",{children:[e.jsxs("label",{style:i,children:["参数",e.jsx("span",{style:{textTransform:"none",letterSpacing:0,fontWeight:400,marginLeft:6,color:"var(--text-muted)"},children:"空格分隔"})]}),e.jsx("input",{value:t.args,onChange:n=>o(a=>({...a,args:n.target.value})),placeholder:"--stdio",style:{...s,fontFamily:"var(--font-mono, monospace)"}})]})]}),e.jsxs("div",{children:[e.jsxs("label",{style:i,children:["环境变量",e.jsx("span",{style:{textTransform:"none",letterSpacing:0,fontWeight:400,marginLeft:6,color:"var(--text-muted)"},children:"每行 KEY=VALUE"})]}),e.jsx("textarea",{value:t.envRaw,onChange:n=>o(a=>({...a,envRaw:n.target.value})),placeholder:`NODE_ENV=production
4
4
  TSPROTOCOL_LOG=verbose`,rows:3,style:{...s,fontFamily:"var(--font-mono, monospace)",resize:"vertical"}})]}),t.language==="java"&&e.jsxs("div",{style:{background:"rgba(234,179,8,0.08)",border:"1px solid rgba(234,179,8,0.3)",borderRadius:"var(--radius-sm)",padding:"10px 14px",fontSize:12,color:"var(--text-secondary)",lineHeight:1.65},children:[e.jsx("strong",{style:{color:"rgba(202,138,4,1)"},children:"Java 提示:"})," ","使用 ",e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:3},children:"jdtls"})," 预设需先通过"," ",e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:3},children:"brew install jdtls"})," ","安装包装脚本。若手动安装,请将命令改为"," ",e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:3},children:"java"}),", 并在参数中填入完整的 JVM 参数和"," ",e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",background:"var(--bg-deep)",padding:"1px 5px",borderRadius:3},children:"-jar .../launcher.jar -data /path/to/workspace"}),"。"]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:20},children:[e.jsx("button",{onClick:()=>void R(),disabled:x||!t.name.trim()||!t.command.trim(),style:{padding:"8px 20px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer",opacity:x||!t.name.trim()||!t.command.trim()?.45:1,fontFamily:"var(--font-body)"},children:x?"保存中…":"保存"}),e.jsx("button",{onClick:j,style:{padding:"8px 20px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"transparent",color:"var(--text-secondary)",fontSize:13,fontWeight:600,cursor:"pointer",fontFamily:"var(--font-body)"},children:"取消"})]})]})]})}const s={width:"100%",padding:"8px 10px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-primary)",fontSize:13,fontFamily:"var(--font-body)",outline:"none",boxSizing:"border-box"},i={fontSize:11,color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:4,display:"block"};export{P as default};
@@ -1,4 +1,4 @@
1
- import{r as d,j as t}from"./index-d8fS3JdV.js";const B={id:"",name:"",command:"",args:"",url:"",headersRaw:""};function oe(){const[S,f]=d.useState([]),[s,U]=d.useState("stdio"),[a,u]=d.useState(B),[T,I]=d.useState(!1),[g,b]=d.useState({id:!1,command:!1,url:!1}),[j,W]=d.useState({}),[E,H]=d.useState({}),[_,P]=d.useState(new Set),[p,v]=d.useState(null),[x,w]=d.useState(""),[k,D]=d.useState(!1),y=async e=>{var i;if(!((i=window.agentApi)!=null&&i.mcpProbe))return;P(n=>new Set([...n,e.id])),H(n=>{const o={...n};return delete o[e.id],o});const r=new Promise((n,o)=>setTimeout(()=>o(new Error("连接超时(15s)")),15e3));try{const n=await Promise.race([window.agentApi.mcpProbe(e),r]);W(o=>({...o,[e.id]:n}))}catch(n){const o=n instanceof Error?n.message:String(n);console.warn(`[MCP] probe failed for ${e.id}:`,o),W(l=>{const F={...l};return delete F[e.id],F}),H(l=>({...l,[e.id]:o})),(e.transport==="sse"||/401|403|unauthorized|forbidden|需要认证|访问被拒绝/i.test(o))&&(w(""),v({server:e}))}finally{P(n=>{const o=new Set(n);return o.delete(e.id),o})}};d.useEffect(()=>{window.agentApi&&window.agentApi.mcpList().then(e=>{f(e),e.filter(r=>r.enabled!==!1).forEach(r=>y(r))}).catch(console.error)},[]);const[h,L]=d.useState(""),[M,z]=d.useState(""),[C,O]=d.useState(!1),V=async()=>{z("");let e;try{e=JSON.parse(h.trim());const r=e.mcpServers??e,i=Object.entries(r);if(i.length===0){z("未找到任何服务器");return}O(!0);const n=[];for(const[l,F]of i){const c=F,J=c.name||l,N=c.disabled!==!0;let R;if(c.url||c.type==="streamableHttp"||c.type==="sse"){const re=c.type==="sse"?"sse":"streamableHttp";R={id:l,name:J,transport:re,url:c.url,headers:c.headers??{},env:c.env??{},enabled:N}}else R={id:l,name:J,transport:"stdio",command:c.command,args:c.args??[],env:c.env??{},enabled:N};await window.agentApi.mcpSave(R),n.push(R)}const o=await window.agentApi.mcpList();f(o),L(""),n.filter(l=>l.enabled!==!1).forEach(l=>y(l))}catch(r){z(r instanceof Error?r.message:"JSON 解析失败")}finally{O(!1)}},K=()=>a.id.trim()!==""&&a.command.trim()!=="",Y=()=>a.id.trim()!==""&&a.url.trim()!=="",q=e=>{const r={};for(const i of e.split(`
1
+ import{r as d,j as t}from"./index-CTJNAMck.js";const B={id:"",name:"",command:"",args:"",url:"",headersRaw:""};function oe(){const[S,f]=d.useState([]),[s,U]=d.useState("stdio"),[a,u]=d.useState(B),[T,I]=d.useState(!1),[g,b]=d.useState({id:!1,command:!1,url:!1}),[j,W]=d.useState({}),[E,H]=d.useState({}),[_,P]=d.useState(new Set),[p,v]=d.useState(null),[x,w]=d.useState(""),[k,D]=d.useState(!1),y=async e=>{var i;if(!((i=window.agentApi)!=null&&i.mcpProbe))return;P(n=>new Set([...n,e.id])),H(n=>{const o={...n};return delete o[e.id],o});const r=new Promise((n,o)=>setTimeout(()=>o(new Error("连接超时(15s)")),15e3));try{const n=await Promise.race([window.agentApi.mcpProbe(e),r]);W(o=>({...o,[e.id]:n}))}catch(n){const o=n instanceof Error?n.message:String(n);console.warn(`[MCP] probe failed for ${e.id}:`,o),W(l=>{const F={...l};return delete F[e.id],F}),H(l=>({...l,[e.id]:o})),(e.transport==="sse"||/401|403|unauthorized|forbidden|需要认证|访问被拒绝/i.test(o))&&(w(""),v({server:e}))}finally{P(n=>{const o=new Set(n);return o.delete(e.id),o})}};d.useEffect(()=>{window.agentApi&&window.agentApi.mcpList().then(e=>{f(e),e.filter(r=>r.enabled!==!1).forEach(r=>y(r))}).catch(console.error)},[]);const[h,L]=d.useState(""),[M,z]=d.useState(""),[C,O]=d.useState(!1),V=async()=>{z("");let e;try{e=JSON.parse(h.trim());const r=e.mcpServers??e,i=Object.entries(r);if(i.length===0){z("未找到任何服务器");return}O(!0);const n=[];for(const[l,F]of i){const c=F,J=c.name||l,N=c.disabled!==!0;let R;if(c.url||c.type==="streamableHttp"||c.type==="sse"){const re=c.type==="sse"?"sse":"streamableHttp";R={id:l,name:J,transport:re,url:c.url,headers:c.headers??{},env:c.env??{},enabled:N}}else R={id:l,name:J,transport:"stdio",command:c.command,args:c.args??[],env:c.env??{},enabled:N};await window.agentApi.mcpSave(R),n.push(R)}const o=await window.agentApi.mcpList();f(o),L(""),n.filter(l=>l.enabled!==!1).forEach(l=>y(l))}catch(r){z(r instanceof Error?r.message:"JSON 解析失败")}finally{O(!1)}},K=()=>a.id.trim()!==""&&a.command.trim()!=="",Y=()=>a.id.trim()!==""&&a.url.trim()!=="",q=e=>{const r={};for(const i of e.split(`
2
2
  `)){const n=i.indexOf(":");if(n<1)continue;const o=i.slice(0,n).trim(),l=i.slice(n+1).trim();o&&(r[o]=l)}return r},G=async()=>{if(b({id:!0,command:!0,url:!0}),!(s==="stdio"&&!K())&&!((s==="sse"||s==="streamableHttp")&&!Y())){I(!0);try{const e=s==="sse"||s==="streamableHttp"?q(a.headersRaw):{},r=s==="stdio"?{id:a.id,name:a.name||a.id,transport:"stdio",command:a.command,args:a.args.split(" ").filter(Boolean),enabled:!0}:{id:a.id,name:a.name||a.id,transport:s,url:a.url,headers:e,enabled:!0};await window.agentApi.mcpSave(r);const i=await window.agentApi.mcpList();f(i),u(B),b({id:!1,command:!1,url:!1}),y(r)}catch(e){console.error("Failed to save MCP server",e)}finally{I(!1)}}},Q=async e=>{await window.agentApi.mcpDelete(e),f(S.filter(r=>r.id!==e))},X=async(e,r)=>{await window.agentApi.mcpSetEnabled(e,r),f(S.map(i=>i.id===e?{...i,enabled:r}:i))},$=async()=>{if(!(!p||!x.trim())){D(!0);try{const e=p.server.transport==="streamableHttp"?{...p.server,headers:{...p.server.headers??{},Authorization:`Bearer ${x.trim()}`}}:{...p.server,env:{...p.server.env??{},Authorization:`Bearer ${x.trim()}`}};await window.agentApi.mcpSave(e);const r=await window.agentApi.mcpList();f(r),v(null),w("");const i=r.find(n=>n.id===e.id)??e;y(i)}finally{D(!1)}}},Z=e=>e==="stdio"?"本地":e==="streamableHttp"?"HTTP":"SSE",ee=e=>e==="stdio"?"#68d391":e==="streamableHttp"?"#f6ad55":"#63b3ed",te=e=>e==="stdio"?"rgba(154,230,180,0.15)":e==="streamableHttp"?"rgba(246,173,85,0.15)":"rgba(99,179,237,0.15)";return t.jsxs("div",{style:{padding:"40px 48px",maxWidth:660,animation:"fadeInUp 0.4s var(--ease-out)"},children:[t.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:28,color:"var(--text-primary)",fontWeight:400,marginBottom:8,letterSpacing:"-0.02em"},children:"MCP 服务器"}),t.jsx("p",{style:{color:"var(--text-muted)",fontSize:14,marginBottom:32},children:"通过模型上下文协议连接外部工具。"}),t.jsxs("div",{style:{padding:20,background:"var(--bg-glass)",borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",marginBottom:28,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[t.jsx("h3",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",margin:0},children:"添加服务器"}),t.jsx("div",{style:{display:"flex",background:"var(--bg-surface)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",overflow:"hidden"},children:["stdio","sse","streamableHttp"].map(e=>t.jsx("button",{onClick:()=>{U(e),b({id:!1,command:!1,url:!1}),u(r=>({...B,id:r.id,name:r.name}))},style:{padding:"5px 14px",border:"none",fontSize:12,fontWeight:500,cursor:"pointer",fontFamily:"var(--font-body)",transition:"background 0.15s",background:s===e?"var(--accent)":"transparent",color:s===e?"var(--text-inverse)":"var(--text-muted)"},children:e==="stdio"?"本地 stdio":e==="sse"?"远程 SSE":"HTTP"},e))})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[t.jsxs("div",{style:{display:"flex",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4},children:[t.jsx("input",{value:a.id,onChange:e=>u(r=>({...r,id:e.target.value})),onBlur:()=>b(e=>({...e,id:!0})),placeholder:"服务器 ID *",style:{...m,...g.id&&!a.id?A:{}}}),g.id&&!a.id&&t.jsx("span",{style:{fontSize:11,color:"var(--danger)"},children:"必填"})]}),t.jsx("input",{value:a.name,onChange:e=>u(r=>({...r,name:e.target.value})),placeholder:"显示名称",style:{...m,flex:1}})]}),s==="stdio"?t.jsxs("div",{style:{display:"flex",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4},children:[t.jsx("input",{value:a.command,onChange:e=>u(r=>({...r,command:e.target.value})),onBlur:()=>b(e=>({...e,command:!0})),placeholder:"命令(如 npx)*",style:{...m,...g.command&&!a.command?A:{}}}),g.command&&!a.command&&t.jsx("span",{style:{fontSize:11,color:"var(--danger)"},children:"必填"})]}),t.jsx("input",{value:a.args,onChange:e=>u(r=>({...r,args:e.target.value})),placeholder:"参数(如 -y @anthropic/mcp-server)",style:{...m,flex:2}})]}):t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("input",{value:a.url,onChange:e=>u(r=>({...r,url:e.target.value})),onBlur:()=>b(e=>({...e,url:!0})),placeholder:s==="streamableHttp"?"HTTP URL(如 http://host/mcp)*":"SSE URL(如 https://mcp.example.com/sse)*",style:{...m,...g.url&&!a.url?A:{}}}),g.url&&!a.url&&t.jsx("span",{style:{fontSize:11,color:"var(--danger)"},children:"必填"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("label",{style:{fontSize:12,color:"var(--text-muted)"},children:"请求头(每行 key: value)"}),t.jsx("textarea",{value:a.headersRaw,onChange:e=>u(r=>({...r,headersRaw:e.target.value})),placeholder:`access_token: abc123
3
3
  Authorization: Bearer sk-...`,rows:3,style:{...m,fontFamily:"var(--font-mono)",fontSize:12,resize:"vertical"}})]})]}),t.jsx("button",{onClick:G,disabled:T,style:{alignSelf:"flex-start",padding:"10px 22px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"var(--text-inverse)",fontSize:13,fontWeight:600,cursor:T?"not-allowed":"pointer",fontFamily:"var(--font-body)"},children:T?"保存中…":"添加服务器"})]})]}),t.jsxs("div",{style:{marginBottom:28,padding:20,background:"var(--bg-glass)",borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[t.jsx("h3",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",margin:"0 0 8px"},children:"导入 JSON 配置"}),t.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:"0 0 10px"},children:"兼容 Claude Desktop / Cursor 格式,粘贴后点导入。"}),t.jsx("textarea",{value:h,onChange:e=>{L(e.target.value),z("")},placeholder:`{
4
4
  "my-server": {
@@ -1 +1 @@
1
- import{r,j as t}from"./index-d8fS3JdV.js";function E(){const[f,m]=r.useState([]),[g,B]=r.useState(""),[n,b]=r.useState(null),[h,o]=r.useState(!1),[y,a]=r.useState(""),[S,s]=r.useState(""),[j,i]=r.useState("user"),[w,d]=r.useState(""),[k,l]=r.useState(null),[v,c]=r.useState("success"),p=async()=>{if(window.agentApi){const e=await window.agentApi.listMemories();m(e)}};r.useEffect(()=>{p()},[]);const z=async()=>{if(!g.trim()){p();return}if(window.agentApi){const e=await window.agentApi.searchMemories(g);m(e.map(u=>u.entry))}},R=async()=>{if(!(!y.trim()||!window.agentApi))try{await window.agentApi.setMemory({name:y.trim(),description:S,type:j,content:w,created:(n==null?void 0:n.created)??new Date().toISOString(),updated:new Date().toISOString()}),o(!1),b(null),a(""),s(""),d(""),i("user"),l("保存成功"),c("success"),await p()}catch(e){l(e instanceof Error?e.message:"保存失败"),c("error")}},W=e=>{b(e),a(e.name),s(e.description),i(e.type),d(e.content),o(!0)};return t.jsxs("div",{style:{padding:"40px 48px",maxWidth:720,animation:"fadeInUp 0.4s var(--ease-out)"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:24},children:[t.jsxs("div",{children:[t.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:28,color:"var(--text-primary)",fontWeight:400,letterSpacing:"-0.02em"},children:"记忆"}),t.jsx("p",{style:{color:"var(--text-muted)",fontSize:14,marginTop:4},children:"跨会话的持久化知识库。"})]}),t.jsx("button",{onClick:()=>{o(!0),b(null),a(""),s(""),d(""),i("user")},style:{padding:"10px 20px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"var(--text-inverse)",fontSize:13,fontWeight:600,cursor:"pointer",fontFamily:"var(--font-body)"},children:"+ 新建"})]}),t.jsxs("div",{style:{display:"flex",gap:8,marginBottom:24},children:[t.jsx("input",{value:g,onChange:e=>B(e.target.value),onKeyDown:e=>e.key==="Enter"&&z(),placeholder:"搜索记忆...",style:{flex:1,padding:"10px 14px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-primary)",fontSize:14,outline:"none",fontFamily:"var(--font-body)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"}}),t.jsx("button",{onClick:z,style:C,children:"搜索"})]}),k&&t.jsx("div",{style:{padding:"10px 12px",borderRadius:"var(--radius-sm)",border:v==="success"?"1px solid rgba(52,211,153,0.35)":"1px solid rgba(244,63,94,0.35)",background:v==="success"?"rgba(52,211,153,0.08)":"rgba(244,63,94,0.08)",color:v==="success"?"var(--success)":"var(--danger)",fontSize:13,marginBottom:16},children:k}),h&&t.jsxs("div",{style:{padding:20,marginBottom:24,background:"var(--bg-glass)",borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[t.jsx("input",{value:y,onChange:e=>a(e.target.value),placeholder:"名称",style:{...x,marginBottom:10},disabled:!!n}),t.jsx("input",{value:S,onChange:e=>s(e.target.value),placeholder:"描述",style:{...x,marginBottom:10}}),t.jsxs("select",{value:j,onChange:e=>i(e.target.value),style:{...x,marginBottom:10},children:[t.jsx("option",{value:"user",children:"用户"}),t.jsx("option",{value:"feedback",children:"反馈"}),t.jsx("option",{value:"project",children:"项目"}),t.jsx("option",{value:"reference",children:"参考"})]}),t.jsx("textarea",{value:w,onChange:e=>d(e.target.value),placeholder:"内容",rows:5,style:{...x,marginBottom:12,resize:"vertical"}}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx("button",{onClick:R,style:{padding:"9px 20px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--success)",color:"#000",fontSize:13,fontWeight:600,cursor:"pointer",fontFamily:"var(--font-body)"},children:"保存"}),t.jsx("button",{onClick:()=>o(!1),style:C,children:"取消"})]})]}),f.map(e=>t.jsxs("div",{style:{padding:"14px 16px",marginBottom:8,background:"var(--bg-glass)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",transition:"border-color 0.2s"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[t.jsx("span",{style:{color:"var(--text-primary)",fontWeight:600,fontSize:14},children:e.name}),t.jsx("span",{style:{fontSize:10,padding:"2px 8px",borderRadius:10,background:"rgba(255,255,255,0.04)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:500},children:e.type})]}),t.jsxs("div",{style:{display:"flex",gap:6},children:[t.jsx("button",{onClick:()=>W(e),style:F,children:"编辑"}),t.jsx("button",{onClick:async()=>{if(window.agentApi)try{await window.agentApi.deleteMemory(e.name),l("删除成功"),c("success"),await p()}catch(u){l(u instanceof Error?u.message:"删除失败"),c("error")}},style:{...F,color:"var(--danger)"},children:"删除"})]})]}),e.description&&t.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:4},children:e.description}),t.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4,lineHeight:1.5},children:[e.content.slice(0,180),e.content.length>180?"…":""]})]},e.name)),f.length===0&&!h&&t.jsx("div",{style:{color:"var(--text-muted)",fontSize:14,padding:"60px 0",textAlign:"center"},children:"暂无记忆,点击「新建」创建一条。"})]})}const x={width:"100%",padding:"11px 14px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-surface)",color:"var(--text-primary)",fontSize:14,outline:"none",fontFamily:"var(--font-body)",boxSizing:"border-box"},C={padding:"10px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-secondary)",fontSize:13,fontWeight:500,cursor:"pointer",fontFamily:"var(--font-body)"},F={padding:"4px 10px",borderRadius:6,fontSize:11,border:"none",background:"rgba(255,255,255,0.05)",color:"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-body)",fontWeight:500};export{E as default};
1
+ import{r,j as t}from"./index-CTJNAMck.js";function E(){const[f,m]=r.useState([]),[g,B]=r.useState(""),[n,b]=r.useState(null),[h,o]=r.useState(!1),[y,a]=r.useState(""),[S,s]=r.useState(""),[j,i]=r.useState("user"),[w,d]=r.useState(""),[k,l]=r.useState(null),[v,c]=r.useState("success"),p=async()=>{if(window.agentApi){const e=await window.agentApi.listMemories();m(e)}};r.useEffect(()=>{p()},[]);const z=async()=>{if(!g.trim()){p();return}if(window.agentApi){const e=await window.agentApi.searchMemories(g);m(e.map(u=>u.entry))}},R=async()=>{if(!(!y.trim()||!window.agentApi))try{await window.agentApi.setMemory({name:y.trim(),description:S,type:j,content:w,created:(n==null?void 0:n.created)??new Date().toISOString(),updated:new Date().toISOString()}),o(!1),b(null),a(""),s(""),d(""),i("user"),l("保存成功"),c("success"),await p()}catch(e){l(e instanceof Error?e.message:"保存失败"),c("error")}},W=e=>{b(e),a(e.name),s(e.description),i(e.type),d(e.content),o(!0)};return t.jsxs("div",{style:{padding:"40px 48px",maxWidth:720,animation:"fadeInUp 0.4s var(--ease-out)"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:24},children:[t.jsxs("div",{children:[t.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:28,color:"var(--text-primary)",fontWeight:400,letterSpacing:"-0.02em"},children:"记忆"}),t.jsx("p",{style:{color:"var(--text-muted)",fontSize:14,marginTop:4},children:"跨会话的持久化知识库。"})]}),t.jsx("button",{onClick:()=>{o(!0),b(null),a(""),s(""),d(""),i("user")},style:{padding:"10px 20px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"var(--text-inverse)",fontSize:13,fontWeight:600,cursor:"pointer",fontFamily:"var(--font-body)"},children:"+ 新建"})]}),t.jsxs("div",{style:{display:"flex",gap:8,marginBottom:24},children:[t.jsx("input",{value:g,onChange:e=>B(e.target.value),onKeyDown:e=>e.key==="Enter"&&z(),placeholder:"搜索记忆...",style:{flex:1,padding:"10px 14px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-primary)",fontSize:14,outline:"none",fontFamily:"var(--font-body)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"}}),t.jsx("button",{onClick:z,style:C,children:"搜索"})]}),k&&t.jsx("div",{style:{padding:"10px 12px",borderRadius:"var(--radius-sm)",border:v==="success"?"1px solid rgba(52,211,153,0.35)":"1px solid rgba(244,63,94,0.35)",background:v==="success"?"rgba(52,211,153,0.08)":"rgba(244,63,94,0.08)",color:v==="success"?"var(--success)":"var(--danger)",fontSize:13,marginBottom:16},children:k}),h&&t.jsxs("div",{style:{padding:20,marginBottom:24,background:"var(--bg-glass)",borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[t.jsx("input",{value:y,onChange:e=>a(e.target.value),placeholder:"名称",style:{...x,marginBottom:10},disabled:!!n}),t.jsx("input",{value:S,onChange:e=>s(e.target.value),placeholder:"描述",style:{...x,marginBottom:10}}),t.jsxs("select",{value:j,onChange:e=>i(e.target.value),style:{...x,marginBottom:10},children:[t.jsx("option",{value:"user",children:"用户"}),t.jsx("option",{value:"feedback",children:"反馈"}),t.jsx("option",{value:"project",children:"项目"}),t.jsx("option",{value:"reference",children:"参考"})]}),t.jsx("textarea",{value:w,onChange:e=>d(e.target.value),placeholder:"内容",rows:5,style:{...x,marginBottom:12,resize:"vertical"}}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx("button",{onClick:R,style:{padding:"9px 20px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--success)",color:"#000",fontSize:13,fontWeight:600,cursor:"pointer",fontFamily:"var(--font-body)"},children:"保存"}),t.jsx("button",{onClick:()=>o(!1),style:C,children:"取消"})]})]}),f.map(e=>t.jsxs("div",{style:{padding:"14px 16px",marginBottom:8,background:"var(--bg-glass)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",transition:"border-color 0.2s"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[t.jsx("span",{style:{color:"var(--text-primary)",fontWeight:600,fontSize:14},children:e.name}),t.jsx("span",{style:{fontSize:10,padding:"2px 8px",borderRadius:10,background:"rgba(255,255,255,0.04)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:500},children:e.type})]}),t.jsxs("div",{style:{display:"flex",gap:6},children:[t.jsx("button",{onClick:()=>W(e),style:F,children:"编辑"}),t.jsx("button",{onClick:async()=>{if(window.agentApi)try{await window.agentApi.deleteMemory(e.name),l("删除成功"),c("success"),await p()}catch(u){l(u instanceof Error?u.message:"删除失败"),c("error")}},style:{...F,color:"var(--danger)"},children:"删除"})]})]}),e.description&&t.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:4},children:e.description}),t.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4,lineHeight:1.5},children:[e.content.slice(0,180),e.content.length>180?"…":""]})]},e.name)),f.length===0&&!h&&t.jsx("div",{style:{color:"var(--text-muted)",fontSize:14,padding:"60px 0",textAlign:"center"},children:"暂无记忆,点击「新建」创建一条。"})]})}const x={width:"100%",padding:"11px 14px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-surface)",color:"var(--text-primary)",fontSize:14,outline:"none",fontFamily:"var(--font-body)",boxSizing:"border-box"},C={padding:"10px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-secondary)",fontSize:13,fontWeight:500,cursor:"pointer",fontFamily:"var(--font-body)"},F={padding:"4px 10px",borderRadius:6,fontSize:11,border:"none",background:"rgba(255,255,255,0.05)",color:"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-body)",fontWeight:500};export{E as default};
@@ -0,0 +1 @@
1
+ import{r,u as f,j as a}from"./index-CTJNAMck.js";import{c as g,r as h,u as j,T as v,C as x}from"./new-session-window-DwtkwFBQ.js";import{X as y}from"./x-CeSbythI.js";import"./artifact-links-4m1A00GO.js";import"./composer-file-routing-DSC2Eojr.js";import"./loader-circle-CZdAfU-D.js";import"./clipboard-BvwmdR4z.js";import"./check-BdadwkYj.js";import"./RunningSessionsIcon-DmCYwIYD.js";import"./file-types-0e-tNIVd.js";import"./trash-2-DLDxY6J7.js";import"./list-todo-7yETOqQe.js";import"./chevron-right-kcIXzCMb.js";import"./chevron-down-DwzPFeq8.js";import"./arrow-right-BtIv2jiq.js";import"./zoom-out-CRr_o1NV.js";import"./rotate-ccw-CFIRtbUD.js";import"./download-COWHIKec.js";import"./play-BxEpdvoI.js";import"./HostProjectPicker-BvboCQ0a.js";function B(){const[m]=r.useState(()=>g()),[n,u]=r.useState(()=>{const e=h(window.location.search);return{agentType:(e==null?void 0:e.agentType)??"customer-agent",projectId:null,cwd:(e==null?void 0:e.workspacePath)??""}}),[t,i]=r.useState(null),[p,w]=r.useState([]),[s,c]=r.useState(""),l=f(e=>e.skin);r.useEffect(()=>{document.documentElement.setAttribute("data-skin",l)},[l]),r.useEffect(()=>{document.title=t!=null&&t.title?`${t.title} · AgentRoam`:"新建会话 · AgentRoam"},[t==null?void 0:t.title]),r.useEffect(()=>{let e=!0;return j.getState().loadFromSystem(),window.agentApi.getRuntimeHealth().then(o=>{e&&w(o)}).catch(()=>{}),()=>{e=!1}},[]);const d=async(e,o)=>{if(o){i(o);return}try{const S=await window.agentApi.getSession(e,{limit:1,view:"core"});i(S),c("")}catch{c("无法打开会话,请重试")}};return a.jsxs("main",{className:"new-session-window","aria-label":"会话小窗",children:[s&&a.jsx("div",{className:"new-session-window-error",role:"alert",children:s}),a.jsx(v,{draft:t?void 0:n,onDraftChange:u,children:a.jsx(x,{agentStore:m,desktopTaskPane:!0,activeAgentType:(t==null?void 0:t.agentType)??n.agentType,selectedProjectId:(t==null?void 0:t.projectId)??n.projectId,selectedSessionId:(t==null?void 0:t.id)??null,sessionSummary:t??void 0,sessionTitle:(t==null?void 0:t.title)??"新建会话",paneControls:a.jsx("button",{type:"button",className:"ui-icon-button new-session-window-close","aria-label":"关闭会话小窗",title:"关闭会话小窗",onClick:()=>window.close(),children:a.jsx(y,{size:17,"aria-hidden":"true"})}),workspacePath:(t==null?void 0:t.cwd)??n.cwd,runtimeHealth:p,focusComposerNonce:1,sessionCreationPending:!t&&!n.projectId,onSessionCreated:(e,o)=>d(e,o),onSelectSession:(e,o)=>{d(e,o)},onParallelSessionSelected:e=>{i(e)}})})]})}export{B as default};
@@ -0,0 +1 @@
1
+ .new-session-window{width:100%;height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:var(--bg-workspace);--session-window-gutter: clamp(12px, 2.35vw, 20px)}.new-session-window .task-pane-conversation{display:flex;flex-direction:column;flex:1;min-height:0}.new-session-window .chat-view{width:100%;min-height:0;flex:1;--chat-lane-width: 100%;--chat-header-height: 44px;--chat-header-padding: 0 var(--session-window-gutter);--chat-messages-padding: 10px var(--session-window-gutter);--chat-input-padding: 0 var(--session-window-gutter)}.new-session-window-close{flex-shrink:0;-webkit-app-region:no-drag}.new-session-window .chat-input-area{flex-shrink:0}.new-session-window .composer-text-input{height:clamp(56px,15dvh,88px);min-height:0}.new-session-window .empty-session-welcome{height:100%;min-height:0;padding:8px 0}.new-session-window .empty-session-welcome__core,.new-session-window .empty-session-welcome__starters{display:none}.new-session-window .task-pane-workspace-error,.new-session-window-error{display:flex;gap:8px;padding:10px var(--session-window-gutter);color:var(--danger);font-size:12px}.new-session-window .task-pane-workspace-error button{color:var(--accent);background:transparent;cursor:pointer}
@@ -1 +1 @@
1
- import{r as t,u as a,j as u}from"./index-d8fS3JdV.js";import l from"./BrowserLivePanel-BZDtF0ne.js";import{R as f,a as d,b as w,r as g}from"./RemoteDesktopTabBridge-Cp9mLtcY.js";import"./loader-circle-DesEGpVH.js";import"./chevron-down-DIt_NscV.js";import"./clipboard-BvwmdR4z.js";import"./rotate-ccw-BdZpOTYP.js";import"./x-1GQMVfza.js";import"./zoom-out-BNKdrTFD.js";import"./external-link-Baeyco26.js";function x(){const[s,n]=t.useState(!1),[m,i]=t.useState(!1),[r,p]=t.useState(a.getState().skin);t.useEffect(()=>a.subscribe(e=>p(e.skin)),[]),t.useEffect(()=>{document.documentElement.dataset.skin=r,document.body.dataset.remoteDesktop="1"},[r]),t.useEffect(()=>{const e=E=>{const o=g(E,location.origin,window.parent);o!==null&&(n(o),o&&i(!0))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]),t.useEffect(()=>{if(!s)return;const e=requestAnimationFrame(()=>{window.parent.postMessage({type:f},location.origin)});return()=>cancelAnimationFrame(e)},[s]);const c=t.useCallback(e=>{window.parent.postMessage({type:d,fullscreen:e},location.origin)},[]);return u.jsx(l,{onFullscreenChange:c,open:m,active:s,onClose:()=>{i(!1),n(!1),window.parent.postMessage({type:w},location.origin)}})}export{x as default};
1
+ import{r as t,u as a,j as u}from"./index-CTJNAMck.js";import l from"./BrowserLivePanel-DkBugqrH.js";import{R as f,a as d,b as w,r as g}from"./RemoteDesktopTabBridge-Cp9mLtcY.js";import"./loader-circle-CZdAfU-D.js";import"./chevron-down-DwzPFeq8.js";import"./clipboard-BvwmdR4z.js";import"./zoom-out-CRr_o1NV.js";import"./rotate-ccw-CFIRtbUD.js";import"./x-CeSbythI.js";import"./external-link-T3kil1jt.js";function x(){const[s,n]=t.useState(!1),[m,i]=t.useState(!1),[r,p]=t.useState(a.getState().skin);t.useEffect(()=>a.subscribe(e=>p(e.skin)),[]),t.useEffect(()=>{document.documentElement.dataset.skin=r,document.body.dataset.remoteDesktop="1"},[r]),t.useEffect(()=>{const e=E=>{const o=g(E,location.origin,window.parent);o!==null&&(n(o),o&&i(!0))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]),t.useEffect(()=>{if(!s)return;const e=requestAnimationFrame(()=>{window.parent.postMessage({type:f},location.origin)});return()=>cancelAnimationFrame(e)},[s]);const c=t.useCallback(e=>{window.parent.postMessage({type:d,fullscreen:e},location.origin)},[]);return u.jsx(l,{onFullscreenChange:c,open:m,active:s,onClose:()=>{i(!1),n(!1),window.parent.postMessage({type:w},location.origin)}})}export{x as default};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-d8fS3JdV.js";/**
1
+ import{c as e}from"./index-CTJNAMck.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as z,r as u,a as L,j as s,h as O,m as w,u as I,R as P,e as U,A}from"./index-d8fS3JdV.js";import{b as G}from"./SessionDashboardBridge-BHVjvDHa.js";import{u as q,a as B,p as y,D as R}from"./session-dashboard-BAYi5acZ.js";import{c as C,U as S,A as N,D as _}from"./collaboration-acdqOxaY.js";import{X as V}from"./x-1GQMVfza.js";import{A as v}from"./arrow-right-B03zMFiC.js";import{C as E}from"./chevron-down-DIt_NscV.js";import{S as X}from"./shield-check-DrxVJwVC.js";import{P as Y}from"./play-BdB0D0rZ.js";import{P as H}from"./pause-_h6c8qPD.js";/**
1
+ import{c as z,r as u,a as L,j as s,h as O,m as w,u as I,R as P,e as U,A}from"./index-CTJNAMck.js";import{b as G}from"./SessionDashboardBridge-BPsNDY5Y.js";import{u as q,a as B,p as y,D as R}from"./session-dashboard-DnFhQhBN.js";import{c as C,U as S,A as N,D as _}from"./collaboration-CAgt9AiV.js";import{X as V}from"./x-CeSbythI.js";import{A as v}from"./arrow-right-BtIv2jiq.js";import{C as E}from"./chevron-down-DwzPFeq8.js";import{S as X}from"./shield-check-Btyos6Iv.js";import{P as Y}from"./play-BxEpdvoI.js";import{P as H}from"./pause-DXyBDZlg.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{i as d}from"./index-d8fS3JdV.js";const n="agentroam:session-dashboard-navigate:v1",p="agentroam:session-dashboard-ready:v1",c="agentroam:session-dashboard-chat-ready:v1",l="agentroam:session-dashboard-applied:v1",a=o=>typeof o=="string"&&/^[\w-]{1,200}$/.test(o);function I(o,r,i){var t;if(!i||o.source!==i||o.origin!==r||((t=o.data)==null?void 0:t.type)!==n)return null;const s=o.data.intent;if(!s)return null;if(s.kind==="dashboard"||s.kind==="groups"||s.kind==="new-session")return{kind:s.kind};if(s.kind==="agent"&&d(s.agentType))return{kind:"agent",agentType:s.agentType};if(s.kind==="group"&&a(s.groupId)&&typeof s.title=="string"&&s.title.length>0&&s.title.length<=100&&(s.discussionId===void 0||a(s.discussionId)))return{kind:"group",groupId:s.groupId,title:s.title,...s.discussionId?{discussionId:s.discussionId}:{}};if(s.kind==="session"&&s.session&&typeof s.session=="object"){const e=s.session;if(typeof e.id=="string"&&e.id.length>0&&e.id.length<=400&&d(e.agentType)&&typeof e.title=="string"&&e.title.length<=1e3&&typeof e.cwd=="string"&&e.cwd.length<=4e3&&(e.projectId===void 0||typeof e.projectId=="string"&&e.projectId.length<=400))return{kind:"session",session:{id:e.id,agentType:e.agentType,title:e.title,cwd:e.cwd,...e.projectId?{projectId:e.projectId}:{}}}}return null}function u(o){document.body.dataset.agentroamChatNavigation==="ready"?window.dispatchEvent(new CustomEvent(n,{detail:o})):window.parent!==window?window.parent.postMessage({type:n,intent:o},window.location.origin):o.kind==="group"?location.assign(`?view=collaboration&groupId=${encodeURIComponent(o.groupId)}${o.discussionId?`&discussionId=${encodeURIComponent(o.discussionId)}`:""}`):o.kind==="groups"?location.assign("?view=collaboration-dashboard"):o.kind==="dashboard"?location.assign("?view=session-dashboard"):o.kind==="agent"?location.assign(`?agent=${encodeURIComponent(o.agentType)}`):o.kind==="new-session"?location.assign("/app/?newSession=1"):location.assign(`?agent=${encodeURIComponent(o.session.agentType)}&session=${encodeURIComponent(o.session.id)}`)}export{l as S,c as a,p as b,n as c,u as p,I as r};
1
+ import{i as d}from"./index-CTJNAMck.js";const n="agentroam:session-dashboard-navigate:v1",p="agentroam:session-dashboard-ready:v1",c="agentroam:session-dashboard-chat-ready:v1",l="agentroam:session-dashboard-applied:v1",a=o=>typeof o=="string"&&/^[\w-]{1,200}$/.test(o);function I(o,r,i){var t;if(!i||o.source!==i||o.origin!==r||((t=o.data)==null?void 0:t.type)!==n)return null;const s=o.data.intent;if(!s)return null;if(s.kind==="dashboard"||s.kind==="groups"||s.kind==="new-session")return{kind:s.kind};if(s.kind==="agent"&&d(s.agentType))return{kind:"agent",agentType:s.agentType};if(s.kind==="group"&&a(s.groupId)&&typeof s.title=="string"&&s.title.length>0&&s.title.length<=100&&(s.discussionId===void 0||a(s.discussionId)))return{kind:"group",groupId:s.groupId,title:s.title,...s.discussionId?{discussionId:s.discussionId}:{}};if(s.kind==="session"&&s.session&&typeof s.session=="object"){const e=s.session;if(typeof e.id=="string"&&e.id.length>0&&e.id.length<=400&&d(e.agentType)&&typeof e.title=="string"&&e.title.length<=1e3&&typeof e.cwd=="string"&&e.cwd.length<=4e3&&(e.projectId===void 0||typeof e.projectId=="string"&&e.projectId.length<=400))return{kind:"session",session:{id:e.id,agentType:e.agentType,title:e.title,cwd:e.cwd,...e.projectId?{projectId:e.projectId}:{}}}}return null}function u(o){document.body.dataset.agentroamChatNavigation==="ready"?window.dispatchEvent(new CustomEvent(n,{detail:o})):window.parent!==window?window.parent.postMessage({type:n,intent:o},window.location.origin):o.kind==="group"?location.assign(`?view=collaboration&groupId=${encodeURIComponent(o.groupId)}${o.discussionId?`&discussionId=${encodeURIComponent(o.discussionId)}`:""}`):o.kind==="groups"?location.assign("?view=collaboration-dashboard"):o.kind==="dashboard"?location.assign("?view=session-dashboard"):o.kind==="agent"?location.assign(`?agent=${encodeURIComponent(o.agentType)}`):o.kind==="new-session"?location.assign("/app/?newSession=1"):location.assign(`?agent=${encodeURIComponent(o.session.agentType)}&session=${encodeURIComponent(o.session.id)}`)}export{l as S,c as a,p as b,n as c,u as p,I as r};
@@ -1,4 +1,4 @@
1
- import{r as c,j as e}from"./index-d8fS3JdV.js";import{u as ee}from"./new-session-window-fsYu53Ht.js";import{A as te}from"./App-HomcUet2.js";import"./artifact-links-4m1A00GO.js";import"./RunningSessionsIcon-DJxTmxZn.js";import"./chevron-down-DIt_NscV.js";import"./x-1GQMVfza.js";import"./arrow-right-B03zMFiC.js";import"./loader-circle-DesEGpVH.js";import"./file-types-CykGmGsd.js";import"./trash-2-Bbhd8-xd.js";import"./composer-file-routing-BsSxfxUa.js";import"./clipboard-BvwmdR4z.js";import"./check-BDiCDSY5.js";import"./zoom-out-BNKdrTFD.js";import"./rotate-ccw-BdZpOTYP.js";import"./download-CuYS63Ny.js";import"./list-todo-F1W4yBLx.js";import"./chevron-right-DVhYkZeF.js";import"./play-BdB0D0rZ.js";import"./HostProjectPicker-BEfXuqxT.js";import"./collaboration-acdqOxaY.js";import"./session-dashboard-BAYi5acZ.js";import"./SessionDashboardBridge-BHVjvDHa.js";import"./calendar-days-D1OJEOKr.js";import"./rotate-cw-D-zPMe4i.js";import"./external-link-Baeyco26.js";import"./pin-BcXr5230.js";import"./CollaborationCreateDialog-CU1t0iYL.js";import"./types-CMhUwzwJ.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./history-C7WUwl_W.js";function se(s){if(!s.trim())return null;const i=Number(s);return Number.isSafeInteger(i)&&i>=0?i:null}const oe=()=>({id:"",name:"",enabled:!0,allowedTools:[],filesystem:{readRoots:[],writeRoots:[],followSymlinks:!1},commands:{mode:"deny",programs:[],inheritedEnvironment:[]},network:"deny",limits:{timeoutMs:12e4,maxOutputBytes:1048576}});function ne({onNotice:s}){const[i,p]=c.useState([]),[l,S]=c.useState([]),[t,n]=c.useState(null),[x,h]=c.useState(!1),w=c.useMemo(()=>[...l].sort(),[l]),N=async()=>{var a;if(!((a=window.agentApi)!=null&&a.listToolPolicies))return;const o=await window.agentApi.listToolPolicies();p(o.policies),S(o.tools)};c.useEffect(()=>{N().catch(o=>s(String(o),"error"))},[]);const D=async()=>{var o;if(!(!t||!((o=window.agentApi)!=null&&o.saveToolPolicy)))try{await window.agentApi.saveToolPolicy(t,x),await N(),n(null),s("工具策略已保存","success")}catch(a){s(a instanceof Error?a.message:"工具策略保存失败","error")}},_=async o=>{var a;if((a=window.agentApi)!=null&&a.deleteToolPolicy)try{await window.agentApi.deleteToolPolicy(o),await N(),(t==null?void 0:t.id)===o&&n(null),s("工具策略已删除","success")}catch(v){s(v instanceof Error?v.message:"工具策略删除失败","error")}};return e.jsxs("section",{className:"tool-policy-manager",children:[e.jsxs("div",{className:"settings-head-row",children:[e.jsx("h3",{children:"工具执行策略"}),e.jsx("button",{type:"button",className:"tool-policy-button",onClick:()=>{n(oe()),h(!1)},children:"+ 添加"})]}),e.jsxs("div",{className:"tool-policy-list",children:[i.map(o=>e.jsxs("div",{className:"tool-policy-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsxs("small",{children:[o.id," · ",o.enabled?"已启用":"已停用"]})]}),e.jsxs("div",{className:"tool-policy-actions",children:[e.jsx("button",{type:"button",onClick:()=>{n(structuredClone(o)),h(!0)},children:"编辑"}),e.jsx("button",{type:"button",className:"is-danger",onClick:()=>void _(o.id),children:"删除"})]})]},o.id)),i.length===0&&e.jsx("div",{className:"tool-policy-empty",children:"暂无工具执行策略"})]}),t&&e.jsxs("div",{className:"tool-policy-form",children:[e.jsxs("div",{className:"tool-policy-grid two",children:[e.jsx(m,{label:"策略 ID",children:e.jsx("input",{value:t.id,disabled:x,onChange:o=>n({...t,id:o.target.value})})}),e.jsx(m,{label:"名称",children:e.jsx("input",{value:t.name,onChange:o=>n({...t,name:o.target.value})})})]}),e.jsxs("label",{className:"tool-policy-check",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:o=>n({...t,enabled:o.target.checked})}),"启用"]}),e.jsx(m,{label:"允许的工具",children:e.jsx("div",{className:"tool-policy-tools",children:w.map(o=>e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:t.allowedTools.includes(o),onChange:()=>n({...t,allowedTools:ie(t.allowedTools,o)})}),o]},o))})}),e.jsxs("div",{className:"tool-policy-grid two",children:[e.jsx(m,{label:"只读根目录(每行一个)",children:e.jsx("textarea",{value:t.filesystem.readRoots.join(`
1
+ import{r as c,j as e}from"./index-CTJNAMck.js";import{u as ee}from"./new-session-window-DwtkwFBQ.js";import{A as te}from"./App-Bum2L4_E.js";import"./artifact-links-4m1A00GO.js";import"./composer-file-routing-DSC2Eojr.js";import"./loader-circle-CZdAfU-D.js";import"./x-CeSbythI.js";import"./clipboard-BvwmdR4z.js";import"./check-BdadwkYj.js";import"./RunningSessionsIcon-DmCYwIYD.js";import"./file-types-0e-tNIVd.js";import"./trash-2-DLDxY6J7.js";import"./list-todo-7yETOqQe.js";import"./chevron-right-kcIXzCMb.js";import"./chevron-down-DwzPFeq8.js";import"./arrow-right-BtIv2jiq.js";import"./zoom-out-CRr_o1NV.js";import"./rotate-ccw-CFIRtbUD.js";import"./download-COWHIKec.js";import"./play-BxEpdvoI.js";import"./HostProjectPicker-BvboCQ0a.js";import"./collaboration-CAgt9AiV.js";import"./session-dashboard-DnFhQhBN.js";import"./SessionDashboardBridge-BPsNDY5Y.js";import"./calendar-days-BeI09qof.js";import"./rotate-cw-B_vFqNsz.js";import"./external-link-T3kil1jt.js";import"./pin-2YlrlSJv.js";import"./CollaborationCreateDialog-BwiSJbjb.js";import"./types-CFAnlTif.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./history-Df4LXw6L.js";function se(s){if(!s.trim())return null;const i=Number(s);return Number.isSafeInteger(i)&&i>=0?i:null}const oe=()=>({id:"",name:"",enabled:!0,allowedTools:[],filesystem:{readRoots:[],writeRoots:[],followSymlinks:!1},commands:{mode:"deny",programs:[],inheritedEnvironment:[]},network:"deny",limits:{timeoutMs:12e4,maxOutputBytes:1048576}});function ne({onNotice:s}){const[i,p]=c.useState([]),[l,S]=c.useState([]),[t,n]=c.useState(null),[x,h]=c.useState(!1),w=c.useMemo(()=>[...l].sort(),[l]),N=async()=>{var a;if(!((a=window.agentApi)!=null&&a.listToolPolicies))return;const o=await window.agentApi.listToolPolicies();p(o.policies),S(o.tools)};c.useEffect(()=>{N().catch(o=>s(String(o),"error"))},[]);const D=async()=>{var o;if(!(!t||!((o=window.agentApi)!=null&&o.saveToolPolicy)))try{await window.agentApi.saveToolPolicy(t,x),await N(),n(null),s("工具策略已保存","success")}catch(a){s(a instanceof Error?a.message:"工具策略保存失败","error")}},_=async o=>{var a;if((a=window.agentApi)!=null&&a.deleteToolPolicy)try{await window.agentApi.deleteToolPolicy(o),await N(),(t==null?void 0:t.id)===o&&n(null),s("工具策略已删除","success")}catch(v){s(v instanceof Error?v.message:"工具策略删除失败","error")}};return e.jsxs("section",{className:"tool-policy-manager",children:[e.jsxs("div",{className:"settings-head-row",children:[e.jsx("h3",{children:"工具执行策略"}),e.jsx("button",{type:"button",className:"tool-policy-button",onClick:()=>{n(oe()),h(!1)},children:"+ 添加"})]}),e.jsxs("div",{className:"tool-policy-list",children:[i.map(o=>e.jsxs("div",{className:"tool-policy-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsxs("small",{children:[o.id," · ",o.enabled?"已启用":"已停用"]})]}),e.jsxs("div",{className:"tool-policy-actions",children:[e.jsx("button",{type:"button",onClick:()=>{n(structuredClone(o)),h(!0)},children:"编辑"}),e.jsx("button",{type:"button",className:"is-danger",onClick:()=>void _(o.id),children:"删除"})]})]},o.id)),i.length===0&&e.jsx("div",{className:"tool-policy-empty",children:"暂无工具执行策略"})]}),t&&e.jsxs("div",{className:"tool-policy-form",children:[e.jsxs("div",{className:"tool-policy-grid two",children:[e.jsx(m,{label:"策略 ID",children:e.jsx("input",{value:t.id,disabled:x,onChange:o=>n({...t,id:o.target.value})})}),e.jsx(m,{label:"名称",children:e.jsx("input",{value:t.name,onChange:o=>n({...t,name:o.target.value})})})]}),e.jsxs("label",{className:"tool-policy-check",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:o=>n({...t,enabled:o.target.checked})}),"启用"]}),e.jsx(m,{label:"允许的工具",children:e.jsx("div",{className:"tool-policy-tools",children:w.map(o=>e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:t.allowedTools.includes(o),onChange:()=>n({...t,allowedTools:ie(t.allowedTools,o)})}),o]},o))})}),e.jsxs("div",{className:"tool-policy-grid two",children:[e.jsx(m,{label:"只读根目录(每行一个)",children:e.jsx("textarea",{value:t.filesystem.readRoots.join(`
2
2
  `),onChange:o=>n({...t,filesystem:{...t.filesystem,readRoots:U(o.target.value)}})})}),e.jsx(m,{label:"可写根目录(每行一个)",children:e.jsx("textarea",{value:t.filesystem.writeRoots.join(`
3
3
  `),onChange:o=>n({...t,filesystem:{...t.filesystem,writeRoots:U(o.target.value)}})})})]}),e.jsxs("label",{className:"tool-policy-check",children:[e.jsx("input",{type:"checkbox",checked:t.filesystem.followSymlinks,onChange:o=>n({...t,filesystem:{...t.filesystem,followSymlinks:o.target.checked}})}),"允许根目录内符号链接"]}),e.jsxs("div",{className:"tool-policy-grid three",children:[e.jsx(m,{label:"命令模式",children:e.jsxs("select",{value:t.commands.mode,onChange:o=>n({...t,commands:{...t.commands,mode:o.target.value}}),children:[e.jsx("option",{value:"deny",children:"禁止"}),e.jsx("option",{value:"allowlist",children:"白名单"}),e.jsx("option",{value:"unrestricted",children:"不限制"})]})}),e.jsx(m,{label:"网络模式",children:e.jsxs("select",{value:t.network,onChange:o=>n({...t,network:o.target.value}),children:[e.jsx("option",{value:"deny",children:"禁止"}),e.jsx("option",{value:"read-only",children:"只读"}),e.jsx("option",{value:"allow",children:"允许"})]})}),e.jsx(m,{label:"继承环境变量",children:e.jsx("input",{value:t.commands.inheritedEnvironment.join(", "),onChange:o=>n({...t,commands:{...t.commands,inheritedEnvironment:C(o.target.value)}})})})]}),t.commands.mode==="allowlist"&&e.jsxs("div",{className:"tool-policy-programs",children:[e.jsxs("div",{className:"settings-head-row",children:[e.jsx("h4",{children:"允许的程序"}),e.jsx("button",{type:"button",onClick:()=>n({...t,commands:{...t.commands,programs:[...t.commands.programs,{executable:""}]}}),children:"+ 程序"})]}),t.commands.programs.map((o,a)=>e.jsx(re,{program:o,onChange:v=>n({...t,commands:{...t.commands,programs:ae(t.commands.programs,a,v)}}),onDelete:()=>n({...t,commands:{...t.commands,programs:t.commands.programs.filter((v,j)=>j!==a)}})},a))]}),e.jsxs("div",{className:"tool-policy-grid two",children:[e.jsx(m,{label:"超时(毫秒)",children:e.jsx("input",{type:"number",min:100,max:6e5,value:t.limits.timeoutMs,onChange:o=>n({...t,limits:{...t.limits,timeoutMs:Number(o.target.value)}})})}),e.jsx(m,{label:"最大输出(字节)",children:e.jsx("input",{type:"number",min:1024,max:10485760,value:t.limits.maxOutputBytes,onChange:o=>n({...t,limits:{...t.limits,maxOutputBytes:Number(o.target.value)}})})})]}),e.jsxs("div",{className:"tool-policy-actions",children:[e.jsx("button",{type:"button",className:"is-primary",onClick:()=>void D(),children:"保存策略"}),e.jsx("button",{type:"button",onClick:()=>n(null),children:"取消"})]})]})]})}function re({program:s,onChange:i,onDelete:p}){return e.jsxs("div",{className:"tool-policy-program",children:[e.jsxs("div",{className:"tool-policy-grid two",children:[e.jsx(m,{label:"可执行文件",children:e.jsx("input",{value:s.executable,onChange:l=>i({...s,executable:l.target.value})})}),e.jsx(m,{label:"子命令",children:e.jsx("input",{value:(s.subcommands??[]).join(", "),onChange:l=>i({...s,subcommands:C(l.target.value)})})})]}),e.jsxs("div",{className:"tool-policy-grid three",children:[e.jsx(m,{label:"允许参数",children:e.jsx("input",{value:(s.allowedFlags??[]).join(", "),onChange:l=>i({...s,allowedFlags:C(l.target.value)})})}),e.jsx(m,{label:"禁止参数",children:e.jsx("input",{value:(s.deniedFlags??[]).join(", "),onChange:l=>i({...s,deniedFlags:C(l.target.value)})})}),e.jsx(m,{label:"路径参数",children:e.jsx("input",{value:(s.pathFlags??[]).join(", "),onChange:l=>i({...s,pathFlags:C(l.target.value)})})})]}),e.jsxs("div",{className:"tool-policy-program-footer",children:[e.jsx(m,{label:"位置路径索引",children:e.jsx("input",{value:(s.positionalPathIndexes??[]).join(", "),onChange:l=>i({...s,positionalPathIndexes:C(l.target.value).map(Number)})})}),e.jsx("button",{type:"button",className:"is-danger",onClick:p,children:"删除程序"})]})]})}function m({label:s,children:i}){return e.jsxs("label",{className:"tool-policy-field",children:[e.jsx("span",{children:s}),i]})}function U(s){return s.split(`
4
4
  `).map(i=>i.trim()).filter(Boolean)}function C(s){return s.split(",").map(i=>i.trim()).filter(Boolean)}function ie(s,i){return s.includes(i)?s.filter(p=>p!==i):[...s,i]}function ae(s,i,p){return s.map((l,S)=>S===i?p:l)}const le=[{value:"anthropic",label:"Anthropic"},{value:"openai",label:"OpenAI"},{value:"deepseek",label:"DeepSeek"},{value:"aihub",label:"AI Hub(网页版)"}],H={anthropic:"claude-sonnet-4-6",openai:"gpt-4o",deepseek:"deepseek-chat",aihub:"deepseek"},R={anthropic:120,openai:300,deepseek:300,aihub:240};function L(){return{name:"",provider:"anthropic",modelId:"claude-sonnet-4-6",apiKey:"",baseUrl:"",maxOutputTokens:16384,requestTimeoutSeconds:R.anthropic}}function Ue(){const{maxIterations:s,contextWindow:i,isConfigured:p,profiles:l,activeProfileId:S,taskNotifications:t,setField:n,loadFromSystem:x,saveToSystem:h,addProfile:w,updateProfile:N,deleteProfile:D,switchActiveProfile:_}=ee(),[o,a]=c.useState(null),[v,j]=c.useState("success"),[y,k]=c.useState(null),[W,K]=c.useState(String(s)),[B,M]=c.useState(String(Math.round((i??100)*1e3)));c.useEffect(()=>{K(String(s))},[s]),c.useEffect(()=>{M(String(Math.round((i??100)*1e3)))},[i]);const[T,E]=c.useState(null),[z,A]=c.useState(!1),[u,P]=c.useState(L());c.useEffect(()=>{x()},[]),c.useEffect(()=>{if(!y)return;const r=window.setTimeout(()=>k(null),y.type==="error"?4e3:2500);return()=>window.clearTimeout(r)},[y]);const G=()=>{A(!0),E(null),P(L())},J=r=>{A(!1),E(r.id),P({name:r.name,provider:r.provider,modelId:r.modelId,apiKey:["managed","__agentroam_stored_secret__"].includes(r.apiKey)?"":r.apiKey,baseUrl:r.baseUrl,maxOutputTokens:r.maxOutputTokens??16384,requestTimeoutSeconds:r.requestTimeoutSeconds??R[r.provider]??300})},F=()=>{E(null),A(!1)},q=async()=>{const r=u.provider!=="aihub",d=T?l.find(I=>I.id===T):void 0,g=d?["managed","__agentroam_stored_secret__"].includes(d.apiKey):!1;if(!u.name.trim()||r&&!u.apiKey.trim()&&!g||!u.modelId.trim()){a(r?"名称、API Key 和模型 ID 为必填项":"名称和模型 ID(AI Hub 站点 ID)为必填项"),j("error");return}if(u.maxOutputTokens!==void 0&&(!Number.isInteger(u.maxOutputTokens)||u.maxOutputTokens<256||u.maxOutputTokens>131072)){a("单轮最大输出请输入 256 到 131072 之间的整数 tokens"),j("error");return}if(u.requestTimeoutSeconds!==void 0&&(!Number.isInteger(u.requestTimeoutSeconds)||u.requestTimeoutSeconds<30||u.requestTimeoutSeconds>1800)){a("单次请求超时请输入 30 到 1800 之间的整数秒"),j("error");return}try{z?w(u):T&&N(T,u),await h(),E(null),A(!1),a(null),k({message:"模型配置保存成功",type:"success"})}catch(I){k({message:I instanceof Error?I.message:"模型配置保存失败",type:"error"})}},Q=async r=>{D(r),setTimeout(()=>h(),0)},X=async r=>{await _(r),a("已切换模型"),j("success"),setTimeout(()=>a(null),1500)},Y=async()=>{a(null);const r=se(W);if(r===null){a("最大迭代次数不能为空,请输入非负整数;0 表示无限制。"),j("error");return}const d=Number(B);if(!Number.isInteger(d)||d<1024||d>2e6){a("上下文窗口请输入 1024 到 2000000 之间的整数 tokens,例如 8192。"),j("error");return}n("maxIterations",r),n("contextWindow",d/1e3);try{await h(),a(null),k({message:"设置保存成功",type:"success"})}catch(g){k({message:g instanceof Error?g.message:"设置保存失败",type:"error"})}},Z=z||T!==null;return e.jsxs("div",{style:{padding:"40px 48px",maxWidth:640,animation:"fadeInUp 0.4s var(--ease-out)"},children:[e.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:28,color:"var(--text-primary)",fontWeight:400,marginBottom:8,letterSpacing:"-0.02em"},children:"设置"}),e.jsx("p",{style:{color:"var(--text-muted)",fontSize:14,marginBottom:36},children:"管理模型提供商和运行参数。工作目录在项目设置中配置。"}),e.jsxs("section",{style:{marginBottom:40},children:[e.jsxs("div",{className:"settings-head-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[e.jsx("h3",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.06em",margin:0},children:"模型提供商"}),e.jsx("button",{onClick:G,style:ce,children:"+ 添加"})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[l.length===0&&!Z&&e.jsx("div",{style:{padding:"20px 16px",borderRadius:"var(--radius-sm)",border:"1px dashed var(--border-subtle)",textAlign:"center",color:"var(--text-muted)",fontSize:13},children:"暂无配置,点击「+ 添加」创建第一个模型提供商"}),l.map(r=>{const d=r.id===S,g=r.id===T,I=["managed","__agentroam_stored_secret__"].includes(r.apiKey);return e.jsxs("div",{style:{borderRadius:"var(--radius-sm)",border:`1px solid ${d?"var(--accent)":"var(--border-default)"}`,background:d?"var(--accent-dim)":"var(--bg-surface)",overflow:"hidden",transition:"border-color 0.2s"},children:[e.jsxs("div",{className:"profile-row",style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px"},children:[e.jsx("span",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",padding:"2px 7px",borderRadius:4,background:d?"var(--accent)":"var(--bg-deep)",color:d?"#fff":"var(--text-muted)",flexShrink:0},children:r.provider}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.name||r.modelId}),e.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.modelId})]}),d&&e.jsx("span",{style:{fontSize:11,color:"var(--accent)",fontWeight:600,flexShrink:0},children:"● 使用中"}),e.jsxs("div",{className:"profile-row-actions",style:{display:"flex",gap:6,flexShrink:0},children:[!d&&e.jsx("button",{onClick:()=>X(r.id),style:O,children:"切换"}),e.jsx("button",{onClick:()=>g?F():J(r),style:O,children:g?"收起":"编辑"}),e.jsx("button",{onClick:()=>Q(r.id),style:{...O,color:"var(--danger)",borderColor:"rgba(244,63,94,0.25)"},children:"删除"})]})]}),g&&e.jsx(V,{draft:u,setDraft:P,hasStoredApiKey:I,onSave:q,onCancel:F})]},r.id)}),z&&e.jsxs("div",{style:{borderRadius:"var(--radius-sm)",border:"1px solid var(--accent)",background:"var(--bg-surface)"},children:[e.jsx("div",{style:{padding:"10px 14px 0",fontSize:13,fontWeight:600,color:"var(--accent)"},children:"新建提供商"}),e.jsx(V,{draft:u,setDraft:P,hasStoredApiKey:!1,onSave:q,onCancel:F})]})]})]}),e.jsxs("section",{children:[e.jsx("h3",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:14},children:"常规"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs(b,{label:"最大迭代次数",children:[e.jsx("input",{type:"number",value:W,onChange:r=>K(r.target.value),min:0,step:1,style:f}),e.jsx("div",{style:{fontSize:12,opacity:.65},children:"输入 0 表示不限制迭代次数。"})]}),e.jsxs(b,{label:"上下文窗口(tokens,输入与输出合计)",children:[e.jsx("input",{type:"number",value:B,onChange:r=>M(r.target.value),min:1024,max:2e6,step:1,style:f}),e.jsx("div",{style:{fontSize:12,opacity:.65},children:"8K 模型填 8192;不能超过模型服务实际启动的上下文大小。"})]})]})]}),e.jsxs("section",{style:{marginTop:40},children:[e.jsx("h3",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:14},children:"桌面提醒"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[["completionEnabled","任务完成通知"],["approvalEnabled","需要审批或回答时通知"],["todoEnabled","待办提醒与执行结果"],["soundEnabled","播放提示音"],["notifyWhileForeground","应用在前台时也显示系统通知"]].map(([r,d])=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,color:"var(--text-primary)",fontSize:14},children:[e.jsx("input",{type:"checkbox",checked:t[r]??!0,onChange:g=>n("taskNotifications",{...t,[r]:g.target.checked})}),d]},r))})]}),e.jsx(ne,{onNotice:(r,d)=>k({message:r,type:d})}),e.jsxs("div",{style:{marginTop:28,display:"flex",gap:14,alignItems:"center"},children:[e.jsx("button",{onClick:Y,style:$,children:"保存"}),e.jsx("span",{style:{padding:"7px 14px",borderRadius:"var(--radius-sm)",fontSize:12,fontWeight:500,background:p?"rgba(52,211,153,0.1)":"rgba(255,255,255,0.04)",color:p?"var(--success)":"var(--text-muted)",border:`1px solid ${p?"rgba(52,211,153,0.2)":"var(--border-subtle)"}`},children:p?"● 已连接":"○ 未配置"})]}),o&&e.jsx("div",{style:{marginTop:12,padding:"10px 12px",borderRadius:"var(--radius-sm)",border:v==="success"?"1px solid rgba(52,211,153,0.35)":"1px solid rgba(244,63,94,0.35)",background:v==="success"?"rgba(52,211,153,0.08)":"rgba(244,63,94,0.08)",color:v==="success"?"var(--success)":"var(--danger)",fontSize:13},children:o}),e.jsx(te,{message:(y==null?void 0:y.message)??null,type:(y==null?void 0:y.type)??"success"})]})}function V({draft:s,setDraft:i,hasStoredApiKey:p,onSave:l,onCancel:S}){const t=(n,x)=>i(h=>{const w={...h,[n]:x};return n==="provider"&&!h.modelId&&(w.modelId=H[x]??""),w});return e.jsxs("div",{style:{padding:"12px 14px 14px",display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[e.jsx(b,{label:"名称",children:e.jsx("input",{value:s.name,onChange:n=>t("name",n.target.value),placeholder:"我的 Claude",style:f})}),e.jsx(b,{label:"提供商",children:e.jsx("select",{value:s.provider,onChange:n=>{const x=n.target.value;i(h=>({...h,provider:x,modelId:H[x]??"",requestTimeoutSeconds:R[x]??300}))},style:f,children:le.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))})})]}),e.jsx(b,{label:"模型 ID",children:e.jsx("input",{value:s.modelId,onChange:n=>t("modelId",n.target.value),placeholder:s.provider==="aihub"?"deepseek":"claude-sonnet-4-6",style:f})}),e.jsx(b,{label:"单轮最大输出(tokens)",children:e.jsx("input",{type:"number",value:s.maxOutputTokens??16384,onChange:n=>i(x=>({...x,maxOutputTokens:Number(n.target.value)})),min:256,max:131072,step:1024,style:f})}),e.jsx(b,{label:"单次请求超时(秒)",children:e.jsx("input",{type:"number",value:s.requestTimeoutSeconds??R[s.provider]??300,onChange:n=>i(x=>({...x,requestTimeoutSeconds:Number(n.target.value)})),min:30,max:1800,step:30,style:f})}),s.provider==="aihub"?e.jsx("div",{style:{padding:"8px 10px",background:"rgba(96,165,250,0.08)",border:"1px solid rgba(96,165,250,0.2)",borderRadius:8,fontSize:12,lineHeight:1.6},children:"AI Hub 网页模型来源:模型 ID 填 AI Hub 站点 ID(deepseek / chatgpt / gemini / grok 或自定义站点),无需 API Key。 运行时由桌面端 AI Hub 把上下文模拟人为发送给该站点并抓取回复;支持通过受控 JSON 协议调用 Agent 工具。需要桌面 App 在线且站点已登录。"}):e.jsxs(e.Fragment,{children:[e.jsx(b,{label:"API 密钥",children:e.jsx("input",{type:"password",value:s.apiKey,onChange:n=>t("apiKey",n.target.value),placeholder:p?"••••••••••••":"sk-...","aria-label":p?"API 密钥(已保存)":"API 密钥",style:f})}),e.jsx(b,{label:"接口地址(可选)",children:e.jsx("input",{value:s.baseUrl,onChange:n=>t("baseUrl",n.target.value),placeholder:"https://api.anthropic.com",style:f})})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:2},children:[e.jsx("button",{onClick:l,style:$,children:"保存"}),e.jsx("button",{onClick:S,style:de,children:"取消"})]})]})}function b({label:s,children:i}){return e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-secondary)",marginBottom:6,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.06em"},children:s}),i]})}const f={width:"100%",padding:"9px 12px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-primary)",fontSize:14,outline:"none",fontFamily:"var(--font-body)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxSizing:"border-box"},$={padding:"11px 28px",borderRadius:"var(--radius-sm)",border:"1px solid transparent",background:"var(--accent)",color:"var(--text-inverse)",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:"var(--font-body)",boxShadow:"0 2px 16px var(--accent-glow)",transition:"transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out)"},de={padding:"11px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-secondary)",fontSize:14,fontWeight:500,cursor:"pointer",fontFamily:"var(--font-body)",whiteSpace:"nowrap",transition:"all 0.15s var(--ease-out)"},ce={padding:"6px 14px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-secondary)",fontSize:13,fontWeight:500,cursor:"pointer",fontFamily:"var(--font-body)"},O={padding:"4px 10px",borderRadius:6,border:"1px solid var(--border-subtle)",background:"transparent",color:"var(--text-muted)",fontSize:12,cursor:"pointer",fontFamily:"var(--font-body)"};export{Ue as default};
@@ -1 +1 @@
1
- import{r as s,j as r}from"./index-d8fS3JdV.js";const R=()=>({name:"",description:"",triggers:[],prompt:"",filePath:"",enabled:!0});function E(){const[x,b]=s.useState([]),[t,a]=s.useState(null),[c,p]=s.useState(!1),[f,m]=s.useState(null),[g,v]=s.useState("success"),[h,u]=s.useState(""),i=(e,n="success")=>{m(e),v(n),setTimeout(()=>m(null),3e3)},o=async()=>{if(!window.agentApi)return;const e=await window.agentApi.listSkills();b(e)};s.useEffect(()=>{o()},[]);const y=e=>{a({...e}),u((e.triggers??[]).join(", ")),p(!1)},j=()=>{a(R()),u(""),p(!0)},w=()=>{a(null),p(!1)},S=async()=>{if(!t||!window.agentApi)return;if(!t.name.trim()){i("名称不能为空","error");return}const e=h.split(",").map(n=>n.trim()).filter(Boolean);try{await window.agentApi.saveSkill({name:t.name.trim(),description:t.description,triggers:e,prompt:t.prompt,filePath:t.filePath??""}),i(c?"技能已创建":"技能已保存"),a(null),await o()}catch(n){i(n instanceof Error?n.message:"保存失败","error")}},z=async e=>{if(window.agentApi)try{await window.agentApi.deleteSkill(e),i("已删除"),(t==null?void 0:t.name)===e&&a(null),await o()}catch(n){i(n instanceof Error?n.message:"删除失败","error")}},k=async e=>{if(!window.agentApi)return;const n=!e.enabled;await window.agentApi.setSkillEnabled(e.name,n),await o()},C=async()=>{if(window.agentApi)try{const e=await window.agentApi.importSkill();if(!e)return;i(`已导入技能「${e.name}」,本次会话立即生效`),await o()}catch(e){i(e instanceof Error?e.message:"导入失败","error")}},d={width:"100%",padding:"8px 10px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-primary)",fontSize:13,fontFamily:"var(--font-body)",outline:"none",boxSizing:"border-box"},l={fontSize:11,color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:4,display:"block"};return r.jsxs("div",{style:{padding:"40px 48px",maxWidth:720,animation:"fadeInUp 0.4s var(--ease-out)"},children:[r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:24},children:[r.jsxs("div",{children:[r.jsx("h2",{style:{fontSize:20,fontWeight:600,color:"var(--text-primary)",margin:0},children:"技能管理"}),r.jsx("p",{style:{fontSize:13,color:"var(--text-muted)",margin:"4px 0 0"},children:"配置触发词和提示词,让 Agent 自动激活专属技能"})]}),r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsx("button",{onClick:C,style:{padding:"8px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"transparent",color:"var(--text-secondary)",fontSize:13,fontWeight:600,cursor:"pointer"},children:"↓ 导入技能"}),r.jsx("button",{onClick:j,style:{padding:"8px 16px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:"+ 新建技能"})]})]}),f&&r.jsx("div",{style:{marginBottom:16,padding:"8px 12px",borderRadius:"var(--radius-sm)",border:g==="success"?"1px solid rgba(52,211,153,0.35)":"1px solid rgba(244,63,94,0.35)",background:g==="success"?"rgba(52,211,153,0.08)":"rgba(244,63,94,0.08)",color:g==="success"?"var(--success)":"var(--danger)",fontSize:13},children:f}),t&&r.jsxs("div",{style:{marginBottom:24,padding:"20px 24px",borderRadius:"var(--radius-md)",border:"1px solid var(--border-glow)",background:"var(--bg-glass)"},children:[r.jsx("h3",{style:{margin:"0 0 16px",fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:c?"新建技能":`编辑:${t.name}`}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[r.jsxs("div",{children:[r.jsx("label",{style:l,children:"名称"}),r.jsx("input",{style:d,value:t.name,disabled:!c,onChange:e=>a({...t,name:e.target.value}),placeholder:"技能唯一标识,如 code-review"})]}),r.jsxs("div",{children:[r.jsx("label",{style:l,children:"描述"}),r.jsx("input",{style:d,value:t.description,onChange:e=>a({...t,description:e.target.value}),placeholder:"简短说明这个技能的用途"})]}),r.jsxs("div",{children:[r.jsx("label",{style:l,children:"触发词(逗号分隔)"}),r.jsx("input",{style:d,value:h,onChange:e=>u(e.target.value),placeholder:"代码审查, review, 审查代码"})]}),r.jsxs("div",{children:[r.jsx("label",{style:l,children:"提示词"}),r.jsx("textarea",{style:{...d,minHeight:120,resize:"vertical"},value:t.prompt,onChange:e=>a({...t,prompt:e.target.value}),placeholder:"当触发词匹配时,注入到系统提示的内容..."})]})]}),r.jsxs("div",{style:{display:"flex",gap:8,marginTop:16},children:[r.jsx("button",{onClick:S,style:{padding:"8px 20px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:"保存"}),r.jsx("button",{onClick:w,style:{padding:"8px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"transparent",color:"var(--text-secondary)",fontSize:13,cursor:"pointer"},children:"取消"})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[x.length===0&&!t&&r.jsx("div",{style:{color:"var(--text-muted)",fontSize:13,padding:"20px 0",textAlign:"center"},children:"暂无技能,点击「新建技能」创建第一个"}),x.map(e=>{var n;return r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:"14px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",background:"var(--bg-glass)",opacity:e.enabled===!1?.5:1},children:[r.jsx("button",{onClick:()=>k(e),title:e.enabled===!1?"已禁用,点击启用":"点击禁用",style:{flexShrink:0,marginTop:2,width:32,height:18,borderRadius:9,border:"none",background:e.enabled===!1?"var(--border-default)":"var(--accent)",cursor:"pointer",position:"relative",transition:"background 0.2s"},children:r.jsx("span",{style:{position:"absolute",top:2,left:e.enabled===!1?2:14,width:14,height:14,borderRadius:"50%",background:"#fff",transition:"left 0.2s"}})}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:2},children:[r.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:e.name}),((n=e.triggers)==null?void 0:n.length)>0&&r.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:["触发词:",e.triggers.slice(0,3).join(" · "),e.triggers.length>3?" ...":""]})]}),e.description&&r.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:4},children:e.description}),e.prompt&&r.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"var(--font-mono)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",opacity:.7},children:[e.prompt.slice(0,80),e.prompt.length>80?"...":""]})]}),r.jsxs("div",{style:{display:"flex",gap:6,flexShrink:0},children:[r.jsx("button",{onClick:()=>y(e),style:{padding:"5px 12px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"transparent",color:"var(--text-secondary)",fontSize:12,cursor:"pointer"},children:"编辑"}),r.jsx("button",{onClick:()=>z(e.name),style:{padding:"5px 12px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(244,63,94,0.3)",background:"transparent",color:"var(--danger)",fontSize:12,cursor:"pointer"},children:"删除"})]})]},e.name)})]})]})}export{E as default};
1
+ import{r as s,j as r}from"./index-CTJNAMck.js";const R=()=>({name:"",description:"",triggers:[],prompt:"",filePath:"",enabled:!0});function E(){const[x,b]=s.useState([]),[t,a]=s.useState(null),[c,p]=s.useState(!1),[f,m]=s.useState(null),[g,v]=s.useState("success"),[h,u]=s.useState(""),i=(e,n="success")=>{m(e),v(n),setTimeout(()=>m(null),3e3)},o=async()=>{if(!window.agentApi)return;const e=await window.agentApi.listSkills();b(e)};s.useEffect(()=>{o()},[]);const y=e=>{a({...e}),u((e.triggers??[]).join(", ")),p(!1)},j=()=>{a(R()),u(""),p(!0)},w=()=>{a(null),p(!1)},S=async()=>{if(!t||!window.agentApi)return;if(!t.name.trim()){i("名称不能为空","error");return}const e=h.split(",").map(n=>n.trim()).filter(Boolean);try{await window.agentApi.saveSkill({name:t.name.trim(),description:t.description,triggers:e,prompt:t.prompt,filePath:t.filePath??""}),i(c?"技能已创建":"技能已保存"),a(null),await o()}catch(n){i(n instanceof Error?n.message:"保存失败","error")}},z=async e=>{if(window.agentApi)try{await window.agentApi.deleteSkill(e),i("已删除"),(t==null?void 0:t.name)===e&&a(null),await o()}catch(n){i(n instanceof Error?n.message:"删除失败","error")}},k=async e=>{if(!window.agentApi)return;const n=!e.enabled;await window.agentApi.setSkillEnabled(e.name,n),await o()},C=async()=>{if(window.agentApi)try{const e=await window.agentApi.importSkill();if(!e)return;i(`已导入技能「${e.name}」,本次会话立即生效`),await o()}catch(e){i(e instanceof Error?e.message:"导入失败","error")}},d={width:"100%",padding:"8px 10px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"var(--bg-glass)",color:"var(--text-primary)",fontSize:13,fontFamily:"var(--font-body)",outline:"none",boxSizing:"border-box"},l={fontSize:11,color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:4,display:"block"};return r.jsxs("div",{style:{padding:"40px 48px",maxWidth:720,animation:"fadeInUp 0.4s var(--ease-out)"},children:[r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:24},children:[r.jsxs("div",{children:[r.jsx("h2",{style:{fontSize:20,fontWeight:600,color:"var(--text-primary)",margin:0},children:"技能管理"}),r.jsx("p",{style:{fontSize:13,color:"var(--text-muted)",margin:"4px 0 0"},children:"配置触发词和提示词,让 Agent 自动激活专属技能"})]}),r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsx("button",{onClick:C,style:{padding:"8px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"transparent",color:"var(--text-secondary)",fontSize:13,fontWeight:600,cursor:"pointer"},children:"↓ 导入技能"}),r.jsx("button",{onClick:j,style:{padding:"8px 16px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:"+ 新建技能"})]})]}),f&&r.jsx("div",{style:{marginBottom:16,padding:"8px 12px",borderRadius:"var(--radius-sm)",border:g==="success"?"1px solid rgba(52,211,153,0.35)":"1px solid rgba(244,63,94,0.35)",background:g==="success"?"rgba(52,211,153,0.08)":"rgba(244,63,94,0.08)",color:g==="success"?"var(--success)":"var(--danger)",fontSize:13},children:f}),t&&r.jsxs("div",{style:{marginBottom:24,padding:"20px 24px",borderRadius:"var(--radius-md)",border:"1px solid var(--border-glow)",background:"var(--bg-glass)"},children:[r.jsx("h3",{style:{margin:"0 0 16px",fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:c?"新建技能":`编辑:${t.name}`}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[r.jsxs("div",{children:[r.jsx("label",{style:l,children:"名称"}),r.jsx("input",{style:d,value:t.name,disabled:!c,onChange:e=>a({...t,name:e.target.value}),placeholder:"技能唯一标识,如 code-review"})]}),r.jsxs("div",{children:[r.jsx("label",{style:l,children:"描述"}),r.jsx("input",{style:d,value:t.description,onChange:e=>a({...t,description:e.target.value}),placeholder:"简短说明这个技能的用途"})]}),r.jsxs("div",{children:[r.jsx("label",{style:l,children:"触发词(逗号分隔)"}),r.jsx("input",{style:d,value:h,onChange:e=>u(e.target.value),placeholder:"代码审查, review, 审查代码"})]}),r.jsxs("div",{children:[r.jsx("label",{style:l,children:"提示词"}),r.jsx("textarea",{style:{...d,minHeight:120,resize:"vertical"},value:t.prompt,onChange:e=>a({...t,prompt:e.target.value}),placeholder:"当触发词匹配时,注入到系统提示的内容..."})]})]}),r.jsxs("div",{style:{display:"flex",gap:8,marginTop:16},children:[r.jsx("button",{onClick:S,style:{padding:"8px 20px",borderRadius:"var(--radius-sm)",border:"none",background:"var(--accent)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:"保存"}),r.jsx("button",{onClick:w,style:{padding:"8px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"transparent",color:"var(--text-secondary)",fontSize:13,cursor:"pointer"},children:"取消"})]})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[x.length===0&&!t&&r.jsx("div",{style:{color:"var(--text-muted)",fontSize:13,padding:"20px 0",textAlign:"center"},children:"暂无技能,点击「新建技能」创建第一个"}),x.map(e=>{var n;return r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:"14px 16px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",background:"var(--bg-glass)",opacity:e.enabled===!1?.5:1},children:[r.jsx("button",{onClick:()=>k(e),title:e.enabled===!1?"已禁用,点击启用":"点击禁用",style:{flexShrink:0,marginTop:2,width:32,height:18,borderRadius:9,border:"none",background:e.enabled===!1?"var(--border-default)":"var(--accent)",cursor:"pointer",position:"relative",transition:"background 0.2s"},children:r.jsx("span",{style:{position:"absolute",top:2,left:e.enabled===!1?2:14,width:14,height:14,borderRadius:"50%",background:"#fff",transition:"left 0.2s"}})}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:2},children:[r.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:e.name}),((n=e.triggers)==null?void 0:n.length)>0&&r.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:["触发词:",e.triggers.slice(0,3).join(" · "),e.triggers.length>3?" ...":""]})]}),e.description&&r.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:4},children:e.description}),e.prompt&&r.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"var(--font-mono)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",opacity:.7},children:[e.prompt.slice(0,80),e.prompt.length>80?"...":""]})]}),r.jsxs("div",{style:{display:"flex",gap:6,flexShrink:0},children:[r.jsx("button",{onClick:()=>y(e),style:{padding:"5px 12px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-default)",background:"transparent",color:"var(--text-secondary)",fontSize:12,cursor:"pointer"},children:"编辑"}),r.jsx("button",{onClick:()=>z(e.name),style:{padding:"5px 12px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(244,63,94,0.3)",background:"transparent",color:"var(--danger)",fontSize:12,cursor:"pointer"},children:"删除"})]})]},e.name)})]})]})}export{E as default};
@@ -1,4 +1,4 @@
1
- import{r as O,j as He}from"./index-d8fS3JdV.js";import{r as Zn}from"./page-C2e368Dx.js";import{c as Qn}from"./clipboard-BvwmdR4z.js";import"./RunningSessionsIcon-DJxTmxZn.js";import"./x-1GQMVfza.js";import"./chevron-down-DIt_NscV.js";import"./check-BDiCDSY5.js";import"./trash-2-Bbhd8-xd.js";import"./external-link-Baeyco26.js";import"./chevron-right-DVhYkZeF.js";import"./calendar-days-D1OJEOKr.js";import"./artifact-links-4m1A00GO.js";import"./pin-BcXr5230.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./SessionDashboardBridge-BHVjvDHa.js";import"./RemoteDesktopTabBridge-Cp9mLtcY.js";/**
1
+ import{r as O,j as He}from"./index-CTJNAMck.js";import{r as Zn}from"./page-9-9EC7QM.js";import{c as Qn}from"./clipboard-BvwmdR4z.js";import"./RunningSessionsIcon-DmCYwIYD.js";import"./x-CeSbythI.js";import"./chevron-down-DwzPFeq8.js";import"./check-BdadwkYj.js";import"./trash-2-DLDxY6J7.js";import"./external-link-T3kil1jt.js";import"./chevron-right-kcIXzCMb.js";import"./calendar-days-BeI09qof.js";import"./artifact-links-4m1A00GO.js";import"./pin-2YlrlSJv.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./SessionDashboardBridge-BPsNDY5Y.js";import"./RemoteDesktopTabBridge-Cp9mLtcY.js";/**
2
2
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
3
  * @license MIT
4
4
  *
@@ -0,0 +1 @@
1
+ import o from"./CalendarPage-DzYWlqoZ.js";import"./index-CTJNAMck.js";import"./CalendarView-HQls5G-1.js";import"./calendar-days-BeI09qof.js";import"./x-CeSbythI.js";import"./chevron-right-kcIXzCMb.js";import"./locate-fixed-ByJuEKxC.js";import"./list-todo-7yETOqQe.js";import"./chevron-down-DwzPFeq8.js";import"./check-BdadwkYj.js";import"./pause-DXyBDZlg.js";export{o as default};
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-SVP7TREG-DtInGjiG.js";import{p as f}from"./chunk-JWPE2WC7-BmG1ozp9.js";import{_ as n,l as o}from"./mermaid.core-CyzKk3O2.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-BssWa1kU.js";import"./index-d8fS3JdV.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-SVP7TREG-BLo_2ua-.js";import{p as f}from"./chunk-JWPE2WC7-DS7C5_M7.js";import{_ as n,l as o}from"./mermaid.core-BjNFAB9I.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-CJTXYieX.js";import"./index-CTJNAMck.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
@@ -1 +1 @@
1
- import{H as ln,I as un,J as Q,K as I,L as K,M as an,N as y,O as tn,P as j,Q as _,R as rn,S as o,T as on,V as sn,W as fn}from"./mermaid.core-CyzKk3O2.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,L,u){var D=q-l,i=O-h,n=L-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function U(l,h,q,O,v,R,L){var u=l-q,D=h-O,i=(L?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,M=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),H=(P*g-m*E)/A,J=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=H-M,e=J-t,r=w-M,N=p-t;return x*x+e*e>r*r+N*N&&(H=w,J=p),{cx:H,cy:J,x01:-n,y01:-d,x11:H*(v/T-1),y11:J*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),O=null,v=gn,R=dn,L=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,M=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(M>tn-y)u.moveTo(s*Q(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*Q(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=M,E=M,H=L.apply(this,arguments)/2,J=H>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(J>y){var N=sn(J/a*I(H)),z=sn(J/s*I(H));(P-=N*2)>y?(N*=t?1:-1,A+=N,T-=N):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var V=s*Q(m),W=s*I(m),B=a*Q(T),C=a*I(T);if(w>y){var F=s*Q(g),G=s*I(g),X=a*Q(A),Y=a*I(A),S;if(M<un)if(S=pn(V,W,X,Y,F,G,B,C)){var Z=V-S[0],$=W-S[1],k=F-S[0],b=G-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=U(X,Y,V,W,s,x,t),r=U(F,G,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(V,W),u.arc(0,0,s,m,g,!t)):u.moveTo(V,W),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=U(B,C,F,G,a,-p,t),r=U(V,W,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[Q(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:K(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:K(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:K(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:K(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:K(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:K(+n),i):R},i.padAngle=function(n){return arguments.length?(L=typeof n=="function"?n:K(+n),i):L},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
1
+ import{H as ln,I as un,J as Q,K as I,L as K,M as an,N as y,O as tn,P as j,Q as _,R as rn,S as o,T as on,V as sn,W as fn}from"./mermaid.core-BjNFAB9I.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,L,u){var D=q-l,i=O-h,n=L-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function U(l,h,q,O,v,R,L){var u=l-q,D=h-O,i=(L?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,M=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),H=(P*g-m*E)/A,J=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=H-M,e=J-t,r=w-M,N=p-t;return x*x+e*e>r*r+N*N&&(H=w,J=p),{cx:H,cy:J,x01:-n,y01:-d,x11:H*(v/T-1),y11:J*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),O=null,v=gn,R=dn,L=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,M=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(M>tn-y)u.moveTo(s*Q(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*Q(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=M,E=M,H=L.apply(this,arguments)/2,J=H>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(J>y){var N=sn(J/a*I(H)),z=sn(J/s*I(H));(P-=N*2)>y?(N*=t?1:-1,A+=N,T-=N):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var V=s*Q(m),W=s*I(m),B=a*Q(T),C=a*I(T);if(w>y){var F=s*Q(g),G=s*I(g),X=a*Q(A),Y=a*I(A),S;if(M<un)if(S=pn(V,W,X,Y,F,G,B,C)){var Z=V-S[0],$=W-S[1],k=F-S[0],b=G-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=U(X,Y,V,W,s,x,t),r=U(F,G,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(V,W),u.arc(0,0,s,m,g,!t)):u.moveTo(V,W),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=U(B,C,F,G,a,-p,t),r=U(V,W,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[Q(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:K(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:K(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:K(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:K(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:K(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:K(+n),i):R},i.padAngle=function(n){return arguments.length?(L=typeof n=="function"?n:K(+n),i):L},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};