agentroam-runtime-darwin-arm64 0.2.0-preview.80 → 0.2.0-preview.82

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 (361) 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-build-manifest.json +8 -8
  5. package/runtime/.next/app-path-routes-manifest.json +1 -1
  6. package/runtime/.next/build-manifest.json +5 -5
  7. package/runtime/.next/prerender-manifest.json +1 -1
  8. package/runtime/.next/required-server-files.json +1 -1
  9. package/runtime/.next/server/app/_not-found/page.js +1 -1
  10. package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/runtime/.next/server/app/_not-found.html +1 -1
  12. package/runtime/.next/server/app/_not-found.rsc +1 -1
  13. package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
  14. package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
  15. package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
  16. package/runtime/.next/server/app/api/agent/composer/route.js +1 -0
  17. package/runtime/.next/server/app/api/agent/composer/route.js.nft.json +1 -0
  18. package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
  19. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  20. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  21. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  22. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  23. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  24. package/runtime/.next/server/app/api/agent/stream/route.js +2 -2
  25. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  26. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  27. package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
  28. package/runtime/.next/server/app/api/business/route.js +1 -1
  29. package/runtime/.next/server/app/api/calendar/route.js +2 -2
  30. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  31. package/runtime/.next/server/app/api/collaboration/route.js +2 -2
  32. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  33. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  34. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  35. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  36. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
  37. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  38. package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
  39. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +1 -1
  40. package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -1
  41. package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
  42. package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
  43. package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
  44. package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
  45. package/runtime/.next/server/app/api/memory/route.js +1 -1
  46. package/runtime/.next/server/app/api/messaging/route.js +1 -1
  47. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -1
  48. package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -1
  49. package/runtime/.next/server/app/api/notifications/route.js +1 -1
  50. package/runtime/.next/server/app/api/notifications/stream/route.js +2 -2
  51. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  52. package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
  53. package/runtime/.next/server/app/api/projects/check/route.js +1 -1
  54. package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
  55. package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
  56. package/runtime/.next/server/app/api/projects/route.js +1 -1
  57. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  58. package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
  59. package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
  60. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  61. package/runtime/.next/server/app/api/session-images/[id]/route.js +1 -1
  62. package/runtime/.next/server/app/api/session-views/route.js +1 -1
  63. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  64. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  65. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  66. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
  67. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  68. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  69. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  70. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  71. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  72. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  73. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  74. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  75. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  76. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  77. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  78. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  79. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  80. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  81. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  82. package/runtime/.next/server/app/api/settings/route.js +1 -1
  83. package/runtime/.next/server/app/api/skills/route.js +1 -1
  84. package/runtime/.next/server/app/api/todos/[id]/commands/route.js +1 -1
  85. package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -1
  86. package/runtime/.next/server/app/api/todos/[id]/route.js +1 -1
  87. package/runtime/.next/server/app/api/todos/route.js +1 -1
  88. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  89. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  90. package/runtime/.next/server/app/api/tools/route.js +1 -1
  91. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  92. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  93. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  94. package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
  95. package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
  96. package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
  97. package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
  98. package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
  99. package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
  100. package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
  101. package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
  102. package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
  103. package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
  104. package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
  105. package/runtime/.next/server/app/api/workspace-changes/route.js +1 -1
  106. package/runtime/.next/server/app/web/page.js +4 -4
  107. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  108. package/runtime/.next/server/app-paths-manifest.json +36 -35
  109. package/runtime/.next/server/chunks/5303.js +2 -2
  110. package/runtime/.next/server/chunks/5801.js +1 -1
  111. package/runtime/.next/server/chunks/9119.js +3 -3
  112. package/runtime/.next/server/middleware-build-manifest.js +1 -1
  113. package/runtime/.next/server/pages/404.html +1 -1
  114. package/runtime/.next/server/pages/500.html +1 -1
  115. package/runtime/.next/server/server-reference-manifest.json +1 -1
  116. package/runtime/.next/static/chunks/app/web/{error-f313c4014e78cef5.js → error-828d278147a0619d.js} +1 -1
  117. package/runtime/.next/static/chunks/app/web/layout-1127176e7e88e395.js +1 -0
  118. package/runtime/.next/static/chunks/app/web/{page-2e962377e57d3383.js → page-f008ab6dfeab7ce7.js} +1 -1
  119. package/runtime/.next/static/chunks/{main-68faabab5d101471.js → main-9c08f7656f9692e6.js} +1 -1
  120. package/runtime/.next/static/chunks/main-app-07d67f2d4e96ecb8.js +1 -0
  121. package/runtime/lib/remote-control/application/paced-video-sender.mjs +20 -1
  122. package/runtime/lib/remote-control/application/remote-video-session.mjs +18 -4
  123. package/runtime/lib/remote-control/helper-manager.mjs +36 -2
  124. package/runtime/lib/remote-control/infrastructure/native-video-encoder.mjs +15 -2
  125. package/runtime/lib/remote-control/infrastructure/werift-video-transport.mjs +3 -1
  126. package/runtime/lib/remote-control/macos-helper-app.mjs +85 -15
  127. package/runtime/lib/remote-control/macos-helper-permissions.mjs +113 -0
  128. package/runtime/lib/remote-control/remote-authorization.mjs +2 -2
  129. package/runtime/lib/remote-control/remote-video-signal.mjs +2 -0
  130. package/runtime/lib/todo-completion-worker.mjs +45 -0
  131. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  132. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  133. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  134. package/runtime/node_modules/.package-lock.json +129 -129
  135. package/runtime/node_modules/@agent/core/dist/index.js +286 -68
  136. package/runtime/node_modules/@agent/native-runtime/dist/index.js +444 -127
  137. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +75 -79
  138. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +52 -52
  139. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-2g5j09ba.mjs +16 -0
  140. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-59ydwk0g.mjs +17 -0
  141. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-q4cwy1ja.mjs → core-664d5mmy.mjs} +2 -2
  142. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-zn1abzvs.mjs → core-70sfhqm6.mjs} +2 -2
  143. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-95gcz3n1.mjs +38 -0
  144. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ew5sfvfe.mjs +39 -0
  145. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-gjhs7gf6.mjs +20 -0
  146. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-kvdt1szx.mjs +18 -0
  147. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-p654hjkr.mjs +22 -0
  148. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-q9bjbxkv.mjs +19 -0
  149. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-samdvsjh.mjs +33 -0
  150. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x6bt758j.mjs +17 -0
  151. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -12
  152. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +22 -22
  153. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +26 -26
  154. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +22 -23
  155. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +84 -83
  156. package/runtime/node_modules/caniuse-lite/package.json +1 -1
  157. package/runtime/node_modules/mediabunny/README.md +4 -0
  158. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +185 -127
  159. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +11 -11
  160. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +12 -12
  161. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +185 -127
  162. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +185 -127
  163. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.worker.js +8 -0
  164. package/runtime/node_modules/mediabunny/dist/modules/src/adts/adts-demuxer.js +4 -0
  165. package/runtime/node_modules/mediabunny/dist/modules/src/aes.js +6 -4
  166. package/runtime/node_modules/mediabunny/dist/modules/src/hls/hls-demuxer.js +6 -0
  167. package/runtime/node_modules/mediabunny/dist/modules/src/hls/hls-segmented-input.js +17 -5
  168. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-boxes.js +2 -1
  169. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js +12 -1
  170. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js +34 -18
  171. package/runtime/node_modules/mediabunny/dist/modules/src/matroska/matroska-demuxer.js +3 -0
  172. package/runtime/node_modules/mediabunny/dist/modules/src/media-sink.js +3 -8
  173. package/runtime/node_modules/mediabunny/dist/modules/src/media-source.js +5 -12
  174. package/runtime/node_modules/mediabunny/dist/modules/src/misc.js +19 -5
  175. package/runtime/node_modules/mediabunny/dist/modules/src/mp3/mp3-demuxer.js +4 -0
  176. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-demuxer.js +22 -13
  177. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-muxer.js +2 -2
  178. package/runtime/node_modules/mediabunny/dist/modules/src/segmented-input.js +70 -65
  179. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  180. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  181. package/runtime/node_modules/mediabunny/dist/modules/src/worker.js +26 -0
  182. package/runtime/node_modules/mediabunny/package.json +1 -1
  183. package/runtime/node_modules/mediabunny/src/adts/adts-demuxer.ts +5 -0
  184. package/runtime/node_modules/mediabunny/src/aes.ts +7 -4
  185. package/runtime/node_modules/mediabunny/src/hls/hls-demuxer.ts +7 -0
  186. package/runtime/node_modules/mediabunny/src/hls/hls-segmented-input.ts +19 -6
  187. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-boxes.ts +2 -1
  188. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-demuxer.ts +15 -1
  189. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-muxer.ts +37 -19
  190. package/runtime/node_modules/mediabunny/src/matroska/matroska-demuxer.ts +4 -0
  191. package/runtime/node_modules/mediabunny/src/media-sink.ts +3 -12
  192. package/runtime/node_modules/mediabunny/src/media-source.ts +5 -20
  193. package/runtime/node_modules/mediabunny/src/misc.ts +26 -5
  194. package/runtime/node_modules/mediabunny/src/mp3/mp3-demuxer.ts +5 -0
  195. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-demuxer.ts +30 -19
  196. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-muxer.ts +2 -2
  197. package/runtime/node_modules/mediabunny/src/segmented-input.ts +76 -79
  198. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  199. package/runtime/node_modules/mediabunny/src/worker.ts +28 -0
  200. package/runtime/package-lock.json +162 -162
  201. package/runtime/server.js +1 -1
  202. package/runtime/webapp/dist/assets/AIHubView-CNKanNZa.js +1 -0
  203. package/runtime/webapp/dist/assets/{AgentManager-dXI31b0a.js → AgentManager-B8TTqJaL.js} +2 -2
  204. package/runtime/webapp/dist/assets/AiHubPane-Coyn3P-J.js +1 -0
  205. package/runtime/webapp/dist/assets/App-BGIGpBp3.js +68 -0
  206. package/runtime/webapp/dist/assets/BrowserLivePanel-DnzJOz5w.js +61 -0
  207. package/runtime/webapp/dist/assets/CalendarPage-D0oaq2_l.js +1 -0
  208. package/runtime/webapp/dist/assets/{CalendarView-QfbrlL9X.js → CalendarView-QXZbXnXA.js} +3 -3
  209. package/runtime/webapp/dist/assets/CollaborationCreateDialog-CE8OML-A.js +1 -0
  210. package/runtime/webapp/dist/assets/CollaborationDashboard-CV18iiBO.js +1 -0
  211. package/runtime/webapp/dist/assets/{CollaborationPage-B1tiqgnG.js → CollaborationPage-B2mIAc-h.js} +2 -2
  212. package/runtime/webapp/dist/assets/{FilePreview-CPY6dP8Q.js → FilePreview-BCEiERA1.js} +9 -9
  213. package/runtime/webapp/dist/assets/{FileTree-BBgrOian.js → FileTree-CMbs1Gj3.js} +2 -2
  214. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-BxFS-0sF.js +1 -0
  215. package/runtime/webapp/dist/assets/FlowStudioPane-CVP0Q6zR.js +5 -0
  216. package/runtime/webapp/dist/assets/HostProjectPicker-DUUgM2Cm.js +1 -0
  217. package/runtime/webapp/dist/assets/{LSPServerList-B-R7HDSP.js → LSPServerList-COMVmsvb.js} +1 -1
  218. package/runtime/webapp/dist/assets/{MCPServerList-CTc0iAwT.js → MCPServerList-C_juD6B4.js} +1 -1
  219. package/runtime/webapp/dist/assets/{MemoryViewer-Dzh_miRv.js → MemoryViewer-Et2vysSN.js} +1 -1
  220. package/runtime/webapp/dist/assets/NewSessionWindow-DwJhkRJd.js +1 -0
  221. package/runtime/webapp/dist/assets/RemoteDesktopPage-Cqsea4X7.js +1 -0
  222. package/runtime/webapp/dist/assets/{RemoteDesktopTabBridge-BA_HQv3V.js → RemoteDesktopTabBridge-BFzNwpUn.js} +1 -1
  223. package/runtime/webapp/dist/assets/{RunningSessionsIcon-BvFSI9OF.js → RunningSessionsIcon-D_cOqmmk.js} +1 -1
  224. package/runtime/webapp/dist/assets/{SessionDashboard-DcPPoXe2.js → SessionDashboard-yjdEKypJ.js} +2 -2
  225. package/runtime/webapp/dist/assets/{SessionDashboardBridge-CjoeUy-v.js → SessionDashboardBridge-Kc_1Et9r.js} +1 -1
  226. package/runtime/webapp/dist/assets/{SettingsPanel-DmdXDQUm.js → SettingsPanel-t26XhKHP.js} +2 -2
  227. package/runtime/webapp/dist/assets/{SkillManager-CS_skFZj.js → SkillManager-nZU7b1sc.js} +1 -1
  228. package/runtime/webapp/dist/assets/{TaskPaneTerminal-BFHDRCb9.js → TaskPaneTerminal-BPaCKman.js} +1 -1
  229. package/runtime/webapp/dist/assets/{TerminalPane-Dr_nY9pI.js → TerminalPane-CiIpI1Id.js} +1 -1
  230. package/runtime/webapp/dist/assets/TodoPage-CG__S6_l.js +1 -0
  231. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-FEEApB15.js → abnfDiagram-VCTEODGH-DmKjGVfG.js} +1 -1
  232. package/runtime/webapp/dist/assets/{arc-CycwMc2c.js → arc-D6bpvBke.js} +1 -1
  233. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BFq9JapX.js → architectureDiagram-5GKGNRK7-NEKc2BYf.js} +1 -1
  234. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-DkOJ55Ag.js → blockDiagram-I7D4REHJ-V6G00twZ.js} +1 -1
  235. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-CRvi_3RM.js → c4Diagram-7LVT6UL2-CojA33V5.js} +1 -1
  236. package/runtime/webapp/dist/assets/{calendar-days-CLwKstxM.js → calendar-days-DXE_2mLa.js} +1 -1
  237. package/runtime/webapp/dist/assets/channel-D66Qxmo0.js +1 -0
  238. package/runtime/webapp/dist/assets/{check-8EVJMrTV.js → check-UipgMBET.js} +1 -1
  239. package/runtime/webapp/dist/assets/{chevron-down-ChNxfI2x.js → chevron-down-Dvinwg2S.js} +1 -1
  240. package/runtime/webapp/dist/assets/{chevron-right-Cbkc_d70.js → chevron-right-BGU3tcLA.js} +1 -1
  241. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Cklzvs8u.js → chunk-2Q5K7J3B-DObpPEgk.js} +1 -1
  242. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-NxozE5UP.js → chunk-5VM5RSS4-PaTzAg6w.js} +1 -1
  243. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-Dyb8E7YM.js → chunk-F27PBJKO-Pn4gut94.js} +1 -1
  244. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-BqbMMc1n.js → chunk-IMKFNOWR-nRaVFzK9.js} +1 -1
  245. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-do0R2H6U.js → chunk-JWPE2WC7-CxssjKKN.js} +1 -1
  246. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-B2HIaynf.js → chunk-POPQ4Y6H-CweDXr-B.js} +1 -1
  247. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-C_zmjkwn.js → chunk-SVP7TREG-C7T3FGE-.js} +1 -1
  248. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-Dh2bZgM1.js → chunk-TICWLB2K-Nc0H-0_V.js} +1 -1
  249. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-CnqciVDz.js → chunk-XXDRQBXY-D_GQGF5g.js} +1 -1
  250. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BAX0-S6b.js +1 -0
  251. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BAX0-S6b.js +1 -0
  252. package/runtime/webapp/dist/assets/{client-I0ZVCjOI.js → client-Bb0hpbIR.js} +1 -1
  253. package/runtime/webapp/dist/assets/{codeSyntax-C8n4_KZS.js → codeSyntax-DHonp3tF.js} +3 -3
  254. package/runtime/webapp/dist/assets/{collaboration-lVxWL5ce.js → collaboration-e_iziKU1.js} +1 -1
  255. package/runtime/webapp/dist/assets/composer-file-routing-CWyT7leB.js +6 -0
  256. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-CulKVUkj.js → cose-bilkent-JH36ORCC-Ac_FBan4.js} +1 -1
  257. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-C1LUI1_G.js → cynefin-OW5HDTMX-vr6c389q.js} +1 -1
  258. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-D3Ymzw_P.js → cynefinDiagram-5FMLGOSQ-sXmUCrp_.js} +1 -1
  259. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-DRaL0cGu.js → dagre-GXQ25YYZ-B0DmGxDv.js} +1 -1
  260. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-D8gLHoZo.js → diagram-S7CK7UJ4-Dn-2jJ6S.js} +1 -1
  261. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-CaVU0aQT.js → diagram-UQ7AKVKN-BcasYsju.js} +1 -1
  262. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-LFAKRvZz.js → diagram-VSXAHHWV-DCgGkc82.js} +1 -1
  263. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-DXpxUERc.js → diagram-VX7I27RA-Cjs0Ny4i.js} +1 -1
  264. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-vAiik55G.js → diagram-Z3DM3KII-0nyddp0v.js} +1 -1
  265. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-MaFL7Kgb.js → ebnfDiagram-PWID7BFC-By7gCUsz.js} +1 -1
  266. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-DuEu79B3.js → erDiagram-RLTQ6QDP-DdwBp45A.js} +1 -1
  267. package/runtime/webapp/dist/assets/{file-types-ZVLWtslN.js → file-types-nujx8XUw.js} +1 -1
  268. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-BAQ6nP2D.js → flowDiagram-HODETNUW-DbOwRaT9.js} +1 -1
  269. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-C48VBnPy.js → ganttDiagram-EL5Y4UJY-CG8obc7O.js} +3 -3
  270. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-BfWAh9Kr.js → gitGraphDiagram-WWUBYQGX-ru6aSu_g.js} +1 -1
  271. package/runtime/webapp/dist/assets/{history-D4E3D_aM.js → history-DaBh5_SJ.js} +1 -1
  272. package/runtime/webapp/dist/assets/{image-plus-DQV_EEAN.js → image-plus-Cm9jq1yo.js} +1 -1
  273. package/runtime/webapp/dist/assets/index-BAGzBXQc.css +1 -0
  274. package/runtime/webapp/dist/assets/index-YrEOkxAg.js +500 -0
  275. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-BM7P_-u_.js → infoDiagram-27XIBGKW-Crx1iSbW.js} +1 -1
  276. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-Cwd8XR-p.js → ishikawaDiagram-5VMMS53U-ClQPMEk5.js} +1 -1
  277. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-MOgiksTh.js → journeyDiagram-3NMN7TZE-DHso2Xht.js} +1 -1
  278. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-DulC5OLL.js → kanban-definition-UXKFOSKX-D6psIAhv.js} +1 -1
  279. package/runtime/webapp/dist/assets/{layout-Dku9sXQ7.js → layout-B6AVZ9v9.js} +1 -1
  280. package/runtime/webapp/dist/assets/{linear-B3-dddD7.js → linear-CEZOUjlB.js} +1 -1
  281. package/runtime/webapp/dist/assets/{list-todo-Bik5IY2r.js → list-todo-D9ChIz0f.js} +1 -1
  282. package/runtime/webapp/dist/assets/{loader-circle-C5C-IzGK.js → loader-circle-CAHZbD5s.js} +1 -1
  283. package/runtime/webapp/dist/assets/{locate-fixed-CHkezEEh.js → locate-fixed-2R48MVg_.js} +1 -1
  284. package/runtime/webapp/dist/assets/{mermaid.core-CRRXKysA.js → mermaid.core-DH0df9xk.js} +5 -5
  285. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-CaaP-nEb.js → mindmap-definition-YA3MSWOX-QWt8leZC.js} +1 -1
  286. package/runtime/webapp/dist/assets/{mobileViewport-CekmYKqS.js → mobileViewport-CKvpvxYc.js} +1 -1
  287. package/runtime/webapp/dist/assets/new-session-window-CiRwM3Od.js +191 -0
  288. package/runtime/webapp/dist/assets/{new-session-window-BfDMd-h3.css → new-session-window-DIU2v1uh.css} +1 -1
  289. package/runtime/webapp/dist/assets/{page-_fFyRId-.js → page-Cd9ci9uo.js} +6 -6
  290. package/runtime/webapp/dist/assets/{pause-BsmUCuwZ.js → pause-ddt7BLlm.js} +1 -1
  291. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-BqybPEwk.js → pegDiagram-XKGWAZYB-JNBt0nDx.js} +1 -1
  292. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-BX1H2lh2.js → pieDiagram-E7YTZNPT-g0hnDqNp.js} +1 -1
  293. package/runtime/webapp/dist/assets/{pin-BsEEYq8M.js → pin-BTP5lC_c.js} +1 -1
  294. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-Btnywv1k.js → quadrantDiagram-AXDQQJYC-mLZASjSm.js} +1 -1
  295. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-Da_TV1ER.js → railroadDiagram-O6MQD6OU-CAXNAZhB.js} +1 -1
  296. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-5V1Aow9h.js → requirementDiagram-BXWQKSXE-BC8y1ZXE.js} +1 -1
  297. package/runtime/webapp/dist/assets/{rotate-ccw-BbSby0GQ.js → rotate-ccw-CHFTy38a.js} +1 -1
  298. package/runtime/webapp/dist/assets/{rotate-cw-BMdX-ln4.js → rotate-cw-CFCtRFDl.js} +1 -1
  299. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-D_OIVihV.js → sankeyDiagram-P5KCCOFB-Boi5NPjT.js} +1 -1
  300. package/runtime/webapp/dist/assets/{send-Cb7EWSJF.js → send-CzCncLlt.js} +1 -1
  301. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-LKeF5Mri.js → sequenceDiagram-WJ2MYXX4-D4ccoVEB.js} +1 -1
  302. package/runtime/webapp/dist/assets/{session-dashboard-BFqNDCc8.js → session-dashboard-C0KfSCDl.js} +1 -1
  303. package/runtime/webapp/dist/assets/{session-tree-BK_qaCnb.js → session-tree-CTzXmV6R.js} +1 -1
  304. package/runtime/webapp/dist/assets/{shield-check-C-r87aMq.js → shield-check-Da6EGdIt.js} +1 -1
  305. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-B6j7Q_MN.js → sizeCapture-INFHLROL-Cd5jIVgK.js} +1 -1
  306. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-zhPFqHdQ.js → stateDiagram-D77RDMKH-DXlmaNwu.js} +1 -1
  307. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Dh6coc1l.js +1 -0
  308. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-C_FCENx1.js → swimlanes-42K2YHIH-DyhRB_e0.js} +1 -1
  309. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-BzriATjP.js +8 -0
  310. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-C3DBXjDU.js → timeline-definition-24CTP7MA-Bkfs9Mi-.js} +1 -1
  311. package/runtime/webapp/dist/assets/{trash-2-DjggJGbw.js → trash-2-C682LDDA.js} +1 -1
  312. package/runtime/webapp/dist/assets/{types-BQCEWNQz.js → types-CfOuS-6l.js} +1 -1
  313. package/runtime/webapp/dist/assets/{use-session-activity-BbTXGW7Z.js → use-session-activity-C9Cn92Hj.js} +1 -1
  314. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-CssdTIB0.js → vennDiagram-4TSXK5OY-APWT64sw.js} +1 -1
  315. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-C58K2vVU.js → wardleyDiagram-VM6X3IG4-H7xLoxwM.js} +1 -1
  316. package/runtime/webapp/dist/assets/{web-B4y8vdRZ.js → web-CT8e03DV.js} +1 -1
  317. package/runtime/webapp/dist/assets/{web-D9rJZXHW.js → web-DG022HwJ.js} +1 -1
  318. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CQi8bD6A.js → xychartDiagram-S5SC5T6Z-DIrxZ4UJ.js} +1 -1
  319. package/runtime/webapp/dist/assets/{zoom-out-iMMWRXJs.js → zoom-out-CRN76HNZ.js} +1 -1
  320. package/runtime/webapp/dist/index.html +2 -2
  321. package/runtime/ws-server.mjs +5 -0
  322. package/runtime/.next/static/chunks/app/web/layout-80fa1b5f4c96b0b5.js +0 -1
  323. package/runtime/.next/static/chunks/main-app-ea4c5663714943e2.js +0 -1
  324. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0e6mn0ck.mjs +0 -17
  325. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0ssqfy51.mjs +0 -18
  326. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-82ghff97.mjs +0 -39
  327. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-82yhcz2x.mjs +0 -17
  328. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-b8jr1m8m.mjs +0 -23
  329. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-cj0jh226.mjs +0 -17
  330. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ebtbxtjf.mjs +0 -28
  331. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-pb4erfqh.mjs +0 -42
  332. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rs058s2g.mjs +0 -16
  333. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-w6pv4szb.mjs +0 -18
  334. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-wjeh40nr.mjs +0 -20
  335. package/runtime/webapp/dist/assets/AIHubView-CM6ugXG3.js +0 -1
  336. package/runtime/webapp/dist/assets/AiHubPane-DFzC3nbd.js +0 -1
  337. package/runtime/webapp/dist/assets/App-mF6ELC07.js +0 -68
  338. package/runtime/webapp/dist/assets/BrowserLivePanel-CamAULwS.js +0 -61
  339. package/runtime/webapp/dist/assets/CalendarPage-BbYdGYWn.js +0 -1
  340. package/runtime/webapp/dist/assets/CollaborationCreateDialog-CWhmFQtA.js +0 -1
  341. package/runtime/webapp/dist/assets/CollaborationDashboard-XL5SnFOu.js +0 -1
  342. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-BXDuKlrL.js +0 -1
  343. package/runtime/webapp/dist/assets/FlowStudioPane-lnjLcd9c.js +0 -5
  344. package/runtime/webapp/dist/assets/HostProjectPicker-DN_vGqQb.js +0 -1
  345. package/runtime/webapp/dist/assets/NewSessionWindow-zjqAUfKb.js +0 -1
  346. package/runtime/webapp/dist/assets/RemoteDesktopPage-9AhztqA2.js +0 -1
  347. package/runtime/webapp/dist/assets/TodoPage-guIvBCW0.js +0 -1
  348. package/runtime/webapp/dist/assets/artifact-links-B0ApmgK6.js +0 -2
  349. package/runtime/webapp/dist/assets/channel-BwDuyJO4.js +0 -1
  350. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BfyV8P0w.js +0 -1
  351. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BfyV8P0w.js +0 -1
  352. package/runtime/webapp/dist/assets/composer-file-routing-qSvJpT-v.js +0 -6
  353. package/runtime/webapp/dist/assets/download-BE31-Qm0.js +0 -6
  354. package/runtime/webapp/dist/assets/index-DSgLFE4Q.js +0 -489
  355. package/runtime/webapp/dist/assets/index-zQk0NCEB.css +0 -1
  356. package/runtime/webapp/dist/assets/new-session-window-Dgl7UWPR.js +0 -190
  357. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DWnBZAiI.js +0 -1
  358. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-DOZCbCJP.js +0 -8
  359. package/runtime/webapp/dist/assets/x-BYUglEo9.js +0 -6
  360. /package/runtime/.next/static/{57IUKkg-db8mOGDMma8be → _rMvYWpbWkNWrFkCQx3rK}/_buildManifest.js +0 -0
  361. /package/runtime/.next/static/{57IUKkg-db8mOGDMma8be → _rMvYWpbWkNWrFkCQx3rK}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ import{r,u as f,j as a,X as g}from"./index-YrEOkxAg.js";import{c as h,r as j,u as v,S as x,T as k,C as y}from"./new-session-window-CiRwM3Od.js";import"./composer-file-routing-CWyT7leB.js";import"./loader-circle-CAHZbD5s.js";import"./RemoteDesktopTabBridge-BFzNwpUn.js";import"./check-UipgMBET.js";import"./RunningSessionsIcon-D_cOqmmk.js";import"./trash-2-C682LDDA.js";import"./file-types-nujx8XUw.js";import"./list-todo-D9ChIz0f.js";import"./chevron-right-BGU3tcLA.js";import"./chevron-down-Dvinwg2S.js";import"./session-tree-CTzXmV6R.js";import"./zoom-out-CRN76HNZ.js";import"./rotate-ccw-CHFTy38a.js";import"./use-session-activity-C9Cn92Hj.js";import"./client-Bb0hpbIR.js";import"./HostProjectPicker-DUUgM2Cm.js";function q(){const[m]=r.useState(()=>h()),[n,u]=r.useState(()=>{const t=j(window.location.search);return{agentType:(t==null?void 0:t.agentType)??"customer-agent",projectId:null,cwd:(t==null?void 0:t.workspacePath)??""}}),[e,i]=r.useState(null),[p,w]=r.useState([]),[s,c]=r.useState(""),l=f(t=>t.skin);r.useEffect(()=>{document.documentElement.setAttribute("data-skin",l)},[l]),r.useEffect(()=>{document.title=e!=null&&e.title?`${e.title} · AgentRoam`:"新建会话 · AgentRoam"},[e==null?void 0:e.title]),r.useEffect(()=>{let t=!0;return v.getState().loadFromSystem(),window.agentApi.getRuntimeHealth().then(o=>{t&&w(o)}).catch(()=>{}),()=>{t=!1}},[]);const d=async(t,o)=>{if(o){i(o);return}try{const S=await window.agentApi.getSession(t,{limit:1,view:"core"});i(S),c("")}catch{c("无法打开会话,请重试")}};return a.jsxs("main",{className:"new-session-window","aria-label":"会话小窗",children:[a.jsx(x,{viewedSessionId:(e==null?void 0:e.id)??null}),s&&a.jsx("div",{className:"new-session-window-error",role:"alert",children:s}),a.jsx(k,{draft:e?void 0:n,onDraftChange:u,children:a.jsx(y,{agentStore:m,desktopTaskPane:!0,activeAgentType:(e==null?void 0:e.agentType)??n.agentType,selectedProjectId:(e==null?void 0:e.projectId)??n.projectId,selectedSessionId:(e==null?void 0:e.id)??null,sessionSummary:e??void 0,sessionTitle:(e==null?void 0:e.title)??"新建会话",paneControls:a.jsx("button",{type:"button",className:"ui-icon-button new-session-window-close","aria-label":"关闭会话小窗",title:"关闭会话小窗",onClick:()=>window.close(),children:a.jsx(g,{size:17,"aria-hidden":"true"})}),workspacePath:(e==null?void 0:e.cwd)??n.cwd,runtimeHealth:p,focusComposerNonce:1,sessionCreationPending:!e&&!n.projectId,onSessionCreated:(t,o)=>d(t,o),onSelectSession:(t,o)=>{d(t,o)},onParallelSessionSelected:t=>{i(t)}})})]})}export{q as default};
@@ -0,0 +1 @@
1
+ import{r as t,u as r,j as E}from"./index-YrEOkxAg.js";import l from"./BrowserLivePanel-DnzJOz5w.js";import{R as f,a as d,b as w,r as g}from"./RemoteDesktopTabBridge-BFzNwpUn.js";import"./loader-circle-CAHZbD5s.js";import"./chevron-down-Dvinwg2S.js";import"./zoom-out-CRN76HNZ.js";import"./rotate-ccw-CHFTy38a.js";function b(){const[s,n]=t.useState(!1),[c,i]=t.useState(!1),[a,m]=t.useState(r.getState().skin);t.useEffect(()=>r.subscribe(e=>m(e.skin)),[]),t.useEffect(()=>{document.documentElement.dataset.skin=a,document.body.dataset.remoteDesktop="1"},[a]),t.useEffect(()=>{const e=u=>{const o=g(u,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 p=t.useCallback(e=>{window.parent.postMessage({type:d,fullscreen:e},location.origin)},[]);return E.jsx(l,{showPlayoutExperiment:!0,onFullscreenChange:p,open:c,active:s,onClose:()=>{i(!1),n(!1),window.parent.postMessage({type:w},location.origin)}})}export{b as default};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-DSgLFE4Q.js";/**
1
+ import{c as a}from"./index-YrEOkxAg.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 e}from"./index-DSgLFE4Q.js";/**
1
+ import{c as e}from"./index-YrEOkxAg.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 R,r as u,a as M,j as s,n as O,t as S,u as I,R as P,h as U,k as A}from"./index-DSgLFE4Q.js";import{b as G}from"./SessionDashboardBridge-CjoeUy-v.js";import{p as y,L as q,D as $}from"./session-dashboard-BFqNDCc8.js";import{A as N,S as B}from"./session-tree-BK_qaCnb.js";import{c as k,A as v,D as _}from"./client-I0ZVCjOI.js";import{u as V,a as X,P as Y}from"./use-session-activity-BbTXGW7Z.js";import{U as C}from"./collaboration-lVxWL5ce.js";import{X as H}from"./x-BYUglEo9.js";import{C as z}from"./chevron-down-ChNxfI2x.js";import{S as F}from"./shield-check-C-r87aMq.js";import{P as J}from"./pause-BsmUCuwZ.js";/**
1
+ import{c as R,r as u,a as M,j as s,n as O,v as S,u as I,R as P,h as U,X as G,k as A}from"./index-YrEOkxAg.js";import{b as q}from"./SessionDashboardBridge-Kc_1Et9r.js";import{p as y,L as B,D as $}from"./session-dashboard-C0KfSCDl.js";import{A as N,S as _}from"./session-tree-CTzXmV6R.js";import{c as k,A as v,D as V}from"./client-Bb0hpbIR.js";import{u as X,a as Y,P as H}from"./use-session-activity-C9Cn92Hj.js";import{U as C}from"./collaboration-e_iziKU1.js";import{C as z}from"./chevron-down-Dvinwg2S.js";import{S as F}from"./shield-check-Da6EGdIt.js";import{P as J}from"./pause-ddt7BLlm.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as R,r as u,a as M,j as s,n as O,t as S,u as I,R as P,h as U,k as A}fro
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const K=R("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);function Q({title:e,message:a,onClose:t,onRetry:r}){const l=u.useRef(null),d=u.useId();return u.useEffect(()=>{const o=l.current;return o==null||o.showModal(),()=>{o!=null&&o.open&&o.close()}},[]),M.createPortal(s.jsxs("dialog",{ref:l,className:"sidebar-delete-confirmation action-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":`${d}-title`,"aria-describedby":`${d}-message`,onCancel:o=>{o.preventDefault(),t()},onClick:o=>{if(o.target!==o.currentTarget)return;const c=o.currentTarget.getBoundingClientRect();(o.clientX<c.left||o.clientX>c.right||o.clientY<c.top||o.clientY>c.bottom)&&t()},children:[s.jsx("strong",{id:`${d}-title`,children:e}),s.jsx("p",{id:`${d}-message`,children:a}),s.jsxs("div",{className:"sidebar-delete-confirmation-actions",children:[s.jsx("button",{type:"button",autoFocus:!0,onClick:t,children:r?"关闭":"知道了"}),r&&s.jsx("button",{type:"button",className:"is-primary",onClick:()=>{t(),r()},children:"重试"})]})]}),document.body)}const W={notice:null,reported:{}};function Z(e,a){var t;if(a.type==="dismiss")return{...e,notice:null};if(a.type==="recover"){if(!(a.source in e.reported))return e;const r={...e.reported};return delete r[a.source],{reported:r,notice:((t=e.notice)==null?void 0:t.source)===a.source?null:e.notice}}return!a.repeat&&e.reported[a.notice.source]===a.notice.message?e:{notice:a.notice,reported:{...e.reported,[a.notice.source]:a.notice.message}}}function ss(){const[e,a]=u.useReducer(Z,W),t=u.useCallback((d,o=!1)=>a({type:"report",notice:d,repeat:o}),[]),r=u.useCallback(d=>a({type:"recover",source:d}),[]),l=u.useCallback(()=>a({type:"dismiss"}),[]);return{notice:e.notice,report:t,recover:r,dismiss:l}}function es(){const e=O(),a=V(),[t,r]=u.useState(null),{notice:l,report:d,recover:o,dismiss:c}=ss(),[b,f]=u.useState(!0),p=u.useRef(null),i=u.useRef(!0),g=u.useCallback(async(m=!0)=>{if(p.current||!S())return;const x=Symbol();p.current=x;try{const j=await k({action:"dashboard"});i.current&&p.current===x&&S()&&(r(j),j.discoveryError?d({source:"dashboard",title:"原生会话加载失败",message:j.discoveryError,onRetry:()=>void g()},m):o("dashboard"))}catch(j){i.current&&p.current===x&&S()&&d({source:"dashboard",title:"看板加载失败",message:j instanceof Error?j.message:"无法加载看板",onRetry:()=>void g()},m)}finally{p.current===x&&(p.current=null,i.current&&f(!1))}},[d,o]);return u.useEffect(()=>{if(!e)return;i.current=!0,o("dashboard"),f(!0),g(!1);const m=setInterval(()=>{S()&&g(!1)},5e3),x=()=>{g(!1)};return window.addEventListener("focus",x),()=>{i.current=!1,p.current=null,clearInterval(m),window.removeEventListener("focus",x)}},[e,g,o]),{snapshot:X(t,a),notice:l,dismissError:c,loading:b,refresh:g}}function ns(){return s.jsx("div",{className:"session-dashboard-loading",role:"status","aria-live":"polite","aria-label":"正在加载会话总览","aria-busy":"true",children:s.jsx("div",{className:"session-dashboard-loading-cards","aria-hidden":"true",children:[0,1,2].map(e=>s.jsxs("div",{className:"session-dashboard-loading-card",children:[s.jsx("span",{className:"session-dashboard-loading-icon"}),s.jsxs("span",{className:"session-dashboard-loading-lines",children:[s.jsx("i",{}),s.jsx("i",{})]}),s.jsx("span",{className:"session-dashboard-loading-dot"})]},e))})})}function as({incident:e,target:a,refresh:t,onOpen:r}){var l,d,o;return s.jsx($,{text:e.message,options:((l=e.question)==null?void 0:l.options)??e.options,recommendation:e.recommendation,multiSelect:(d=e.question)==null?void 0:d.multiSelect,sourceOnly:(o=e.question)==null?void 0:o.requiresSource,onSource:()=>r(a),onAnswer:async(c,b)=>{await k({action:"answerSupervision",groupId:e.groupId,incidentId:e.id,answer:c,selectedIndices:b}),await t()}})}function T({item:e,onOpenGroup:a,onOpenSession:t,refresh:r}){var j;const[l,d]=u.useState(!1),o=u.useId(),[c,b]=u.useState(""),[f,p]=u.useState(!1),i=e.supervision,g=((i==null?void 0:i.group)??e.group).members.find(n=>{var h;return n.id===((h=((i==null?void 0:i.group)??e.group).monitoring)==null?void 0:h.supervisorId)}),m=(i==null?void 0:i.incidents.filter(n=>n.status==="waiting"))??[],x=async n=>{p(!0),b("");try{await k(n==="apply"?{action:"applySupervision",groupId:e.group.id}:{action:"pauseSupervision",groupId:e.group.id,paused:!(i!=null&&i.paused)}),await r()}catch(h){b(h instanceof Error?h.message:"操作失败")}finally{p(!1)}};return s.jsxs("article",{className:`session-dashboard-group is-${e.status}`,children:[s.jsxs("div",{className:"session-dashboard-group-summary",children:[s.jsxs("button",{className:"session-dashboard-group-open","aria-label":`进入群聊:${e.group.name}`,onClick:()=>a(e),children:[s.jsx(C,{size:20}),s.jsxs("span",{children:[s.jsx("strong",{title:e.group.name,children:e.group.name}),s.jsx("small",{title:e.group.cwd,children:e.group.cwd})]}),s.jsx("span",{className:`session-dashboard-status is-${e.status}`,children:e.decisionCount?`${e.decisionCount} 待决策`:_[e.status]})]}),s.jsx("button",{className:"session-dashboard-group-toggle","aria-label":`${l?"收起":"展开"}群聊详情:${e.group.name}`,"aria-expanded":l,"aria-controls":o,onClick:()=>d(n=>!n),children:s.jsx(z,{size:16})})]}),l&&s.jsxs("div",{id:o,className:"session-dashboard-group-details",children:[s.jsx("p",{className:"session-dashboard-progress",children:e.progress}),s.jsxs("div",{className:"session-dashboard-meta",children:[s.jsxs("span",{children:[e.runningCount," 运行中"]}),s.jsxs("span",{className:e.decisionCount?"needs-attention":"",children:[e.decisionCount," 待决策"]}),g&&s.jsxs("span",{children:[s.jsx(F,{size:13}),g.name,i!=null&&i.paused?" · 已暂停监管":" · 监工"]})]}),s.jsxs("details",{className:"session-dashboard-linked",children:[s.jsxs("summary",{children:[s.jsx("span",{children:e.sessions.length?`${e.sessions.length} 条${(j=((i==null?void 0:i.group)??e.group).monitoring)!=null&&j.targets.length?"原始":"群内"}会话`:"暂无工作会话"}),s.jsx(z,{size:15})]}),s.jsx("div",{children:e.sessions.map(n=>s.jsxs("button",{className:"session-dashboard-session",onClick:()=>t(n),children:[s.jsx(B,{session:n}),s.jsx(A,{agentType:n.agentType,size:17}),s.jsxs("span",{className:"session-dashboard-session-text",children:[s.jsx("strong",{children:n.title}),s.jsx("small",{children:v[n.agentType]})]}),s.jsx("em",{children:n.status==="running"?"运行中":n.status==="failed"?"异常":n.status==="unknown"?"待核对":"空闲"}),s.jsx(N,{size:14})]},n.id))})]}),g&&s.jsxs("details",{className:"session-dashboard-policy",children:[s.jsx("summary",{children:"监工职责"}),s.jsx("p",{children:g.role||"关注意外中断与交接断档,在原任务授权内恢复;业务选择交由你决策。"}),s.jsxs("button",{disabled:f,onClick:()=>void x("pause"),children:[i!=null&&i.paused?s.jsx(Y,{size:13}):s.jsx(J,{size:13})," ",i!=null&&i.paused?"恢复监管":"暂停监管"]})]}),e.configurationChanged&&s.jsxs("p",{className:"session-dashboard-config",children:["群配置已更新,当前监工沿用原配置。",s.jsx("button",{disabled:f,onClick:()=>void x("apply"),children:"应用最新监管配置"})]}),e.questions.map(n=>s.jsx($,{text:n.text,options:n.options,onSource:()=>a({...e,discussionId:n.discussionId}),onAnswer:async(h,w)=>{await k(n.decisionRevision!==void 0?{action:"answerDecision",discussionId:n.discussionId,expectedRevision:n.decisionRevision,answer:h,messageId:crypto.randomUUID()}:{action:"answer",discussionId:n.discussionId,questionId:n.questionId,answer:h,selectedIndices:w}),await r()}},`${n.discussionId}:${n.questionId}`)),m.map(n=>{var w;const h=(w=i==null?void 0:i.group.monitoring)==null?void 0:w.targets.find(L=>L.id===n.sessionId);return h?s.jsx(as,{incident:n,target:h,refresh:r,onOpen:t},n.id):null}),!!(i!=null&&i.incidents.length)&&s.jsxs("details",{className:"session-dashboard-history",children:[s.jsx("summary",{children:"监工记录"}),i.incidents.slice(-6).reverse().map(n=>s.jsxs("p",{children:[s.jsx("time",{children:new Date(n.updatedAt).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})})," ",n.message," ",s.jsx("small",{children:n.status==="queued"?"排队中":n.status==="verifying"?"核对新进度中":n.status==="resolved"?"已处理":n.status==="waiting"?"等你处理":n.status==="dismissed"?"已结束":"处理中"})]},n.id))]}),c&&s.jsx("p",{className:"collab-error",role:"alert",children:c}),s.jsxs("button",{onClick:()=>a(e),children:["进入群聊 ",s.jsx(N,{size:14})]})]})]})}function D({session:e,showAgent:a=!1,onOpen:t}){return s.jsxs("button",{className:"session-dashboard-agent-session",onClick:()=>t(e),children:[a?s.jsx("span",{className:"session-dashboard-session-brand",role:"img","aria-label":v[e.agentType],title:v[e.agentType],children:s.jsx(A,{agentType:e.agentType,size:20})}):s.jsx("span",{className:"session-dashboard-running-dot"}),s.jsxs("span",{children:[s.jsx("strong",{children:e.title}),s.jsx("small",{title:e.cwd,children:e.cwd})]}),s.jsx("span",{children:"运行中"}),s.jsx(N,{size:15})]})}function is(e){const a=e.groups.map(r=>({kind:"group",id:`group:${r.group.id}`,updated:r.updated,item:r,priority:r.decisionCount>0||r.status==="waiting"?2:+(r.runningCount>0||r.status==="running")})),t=e.agents.flatMap(r=>r.sessions).map(r=>({kind:"session",id:`session:${r.id}`,updated:r.updated,priority:1,item:r}));return[...a,...t].sort((r,l)=>l.priority-r.priority||l.updated.localeCompare(r.updated)||r.id.localeCompare(l.id))}function js(e){const{snapshot:a,notice:t,dismissError:r,loading:l,refresh:d}=es(),o=I(n=>n.skin),c=I(n=>n.dashboardSessionsMerged),b=I(n=>n.setDashboardSessionsMerged);u.useEffect(()=>{document.documentElement.setAttribute("data-skin",o)},[o]),u.useEffect(()=>{window.parent!==window&&window.parent.postMessage({type:G},window.location.origin)},[]);const f=e.onOpenGroup??(n=>y({kind:"group",groupId:n.group.id,title:n.group.name,discussionId:n.discussionId})),p=e.onOpenSession??(n=>y({kind:"session",session:n})),i=e.onViewGroups??(()=>y({kind:"groups"})),g=e.onNewSession??(()=>y({kind:"new-session"})),m=(a==null?void 0:a.agents.reduce((n,h)=>n+h.sessions.length,0))??0,x=a&&c?is(a):[],j=(a==null?void 0:a.decisionTotal)??(a==null?void 0:a.groups.reduce((n,h)=>n+h.decisionCount,0))??0;return s.jsxs("main",{className:"session-dashboard",children:[s.jsxs("header",{className:"session-dashboard-heading",children:[s.jsxs("div",{children:[s.jsx("span",{className:"collab-eyebrow",children:"会话总览"}),s.jsxs("h1",{children:["Dashboard ",s.jsxs("span",{className:"session-dashboard-live",children:[s.jsx("i",{}),"实时"]})]}),s.jsx("p",{children:"在一个地方查看运行、交接与需要你决定的事。"})]}),s.jsxs("div",{className:"session-dashboard-toolbar",children:[s.jsxs("button",{onClick:()=>b(!c),"aria-pressed":c,title:c?"恢复按 Agent 分组":"合并显示群聊和所有 Agent 的运行会话",children:[c?s.jsx(K,{size:16}):s.jsx(q,{size:16}),s.jsx("span",{children:c?"按 Agent 分组":"合并会话"})]}),s.jsx("button",{onClick:()=>void d(),"aria-label":"刷新会话看板",children:s.jsx(P,{size:16})}),s.jsxs("button",{onClick:i,children:[s.jsx(C,{size:16}),"群聊列表"]}),s.jsxs("button",{className:"session-dashboard-new-session",onClick:g,children:[s.jsx(U,{size:16}),"创建会话"]}),e.onClose&&s.jsx("button",{onClick:e.onClose,"aria-label":"关闭会话看板",children:s.jsx(H,{size:17})})]})]}),s.jsxs("div",{className:"session-dashboard-stats",children:[s.jsxs("span",{children:[s.jsx(E,{size:16}),s.jsx("strong",{children:m}),"运行中的原始会话"]}),s.jsxs("span",{className:j?"needs-attention":"",children:[s.jsx("strong",{children:j}),"待你决策"]}),s.jsxs("span",{children:[s.jsx("strong",{children:(a==null?void 0:a.groupTotal)??0}),"协作群"]}),s.jsx("small",{children:"无变化时监工保持安静"})]}),t&&s.jsx(Q,{...t,onClose:r}),l&&!a&&s.jsx(ns,{}),a&&!c&&(a.groups.length?s.jsxs("section",{"aria-label":"群聊运行总览",children:[s.jsxs("div",{className:"session-dashboard-section-title",children:[s.jsxs("h2",{children:[s.jsx(C,{size:18}),"群聊 ",s.jsx("small",{children:"Top 10 · 运行中和待决策优先"})]}),s.jsxs("button",{onClick:i,children:["查看全部 ",a.groupTotal," ",s.jsx(N,{size:14})]})]}),s.jsx("div",{className:"session-dashboard-group-grid",children:a.groups.map(n=>s.jsx(T,{item:n,onOpenGroup:f,onOpenSession:p,refresh:d},n.group.id))})]}):s.jsx("div",{className:"session-dashboard-group-create",children:s.jsxs("button",{onClick:i,children:[s.jsx(C,{size:16}),"创建群聊,配置监工"]})})),a&&(c?s.jsxs("section",{className:"session-dashboard-agent","aria-label":"合并会话",children:[s.jsx("div",{className:"session-dashboard-section-title",children:s.jsxs("h2",{children:[s.jsx(E,{size:20}),"会话 ",s.jsxs("small",{children:[m," 运行中 · ",a.groupTotal," 群聊"]})]})}),x.length?s.jsx("div",{className:"session-dashboard-agent-grid",children:x.map(n=>n.kind==="group"?s.jsx(T,{item:n.item,onOpenGroup:f,onOpenSession:p,refresh:d},n.id):s.jsx(D,{session:n.item,showAgent:!0,onOpen:p},n.id))}):s.jsx("p",{className:"session-dashboard-agent-empty",children:"当前没有运行中的会话"})]}):a.agents.map(n=>s.jsxs("section",{className:"session-dashboard-agent","aria-label":`${v[n.agentType]} 运行会话`,children:[s.jsxs("div",{className:"session-dashboard-section-title",children:[s.jsxs("h2",{children:[s.jsx(A,{agentType:n.agentType,size:20}),v[n.agentType]," ",s.jsxs("small",{children:[n.sessions.length," 运行中"]})]}),s.jsxs("button",{onClick:()=>e.onViewAgent?e.onViewAgent(n.agentType):y({kind:"agent",agentType:n.agentType}),children:["查看全部 ",s.jsx(N,{size:14})]})]}),n.sessions.length?s.jsx("div",{className:"session-dashboard-agent-grid",children:n.sessions.map(h=>s.jsx(D,{session:h,onOpen:p},h.id))}):s.jsx("p",{className:"session-dashboard-agent-empty",children:"当前没有运行中的会话"})]},n.agentType)))]})}export{as as SupervisionIncidentDecision,js as default};
11
+ */const K=R("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);function Q({title:e,message:a,onClose:t,onRetry:r}){const l=u.useRef(null),d=u.useId();return u.useEffect(()=>{const o=l.current;return o==null||o.showModal(),()=>{o!=null&&o.open&&o.close()}},[]),M.createPortal(s.jsxs("dialog",{ref:l,className:"sidebar-delete-confirmation action-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":`${d}-title`,"aria-describedby":`${d}-message`,onCancel:o=>{o.preventDefault(),t()},onClick:o=>{if(o.target!==o.currentTarget)return;const c=o.currentTarget.getBoundingClientRect();(o.clientX<c.left||o.clientX>c.right||o.clientY<c.top||o.clientY>c.bottom)&&t()},children:[s.jsx("strong",{id:`${d}-title`,children:e}),s.jsx("p",{id:`${d}-message`,children:a}),s.jsxs("div",{className:"sidebar-delete-confirmation-actions",children:[s.jsx("button",{type:"button",autoFocus:!0,onClick:t,children:r?"关闭":"知道了"}),r&&s.jsx("button",{type:"button",className:"is-primary",onClick:()=>{t(),r()},children:"重试"})]})]}),document.body)}const W={notice:null,reported:{}};function Z(e,a){var t;if(a.type==="dismiss")return{...e,notice:null};if(a.type==="recover"){if(!(a.source in e.reported))return e;const r={...e.reported};return delete r[a.source],{reported:r,notice:((t=e.notice)==null?void 0:t.source)===a.source?null:e.notice}}return!a.repeat&&e.reported[a.notice.source]===a.notice.message?e:{notice:a.notice,reported:{...e.reported,[a.notice.source]:a.notice.message}}}function ss(){const[e,a]=u.useReducer(Z,W),t=u.useCallback((d,o=!1)=>a({type:"report",notice:d,repeat:o}),[]),r=u.useCallback(d=>a({type:"recover",source:d}),[]),l=u.useCallback(()=>a({type:"dismiss"}),[]);return{notice:e.notice,report:t,recover:r,dismiss:l}}function es(){const e=O(),a=X(),[t,r]=u.useState(null),{notice:l,report:d,recover:o,dismiss:c}=ss(),[b,f]=u.useState(!0),p=u.useRef(null),i=u.useRef(!0),g=u.useCallback(async(m=!0)=>{if(p.current||!S())return;const x=Symbol();p.current=x;try{const j=await k({action:"dashboard"});i.current&&p.current===x&&S()&&(r(j),j.discoveryError?d({source:"dashboard",title:"原生会话加载失败",message:j.discoveryError,onRetry:()=>void g()},m):o("dashboard"))}catch(j){i.current&&p.current===x&&S()&&d({source:"dashboard",title:"看板加载失败",message:j instanceof Error?j.message:"无法加载看板",onRetry:()=>void g()},m)}finally{p.current===x&&(p.current=null,i.current&&f(!1))}},[d,o]);return u.useEffect(()=>{if(!e)return;i.current=!0,o("dashboard"),f(!0),g(!1);const m=setInterval(()=>{S()&&g(!1)},5e3),x=()=>{g(!1)};return window.addEventListener("focus",x),()=>{i.current=!1,p.current=null,clearInterval(m),window.removeEventListener("focus",x)}},[e,g,o]),{snapshot:Y(t,a),notice:l,dismissError:c,loading:b,refresh:g}}function ns(){return s.jsx("div",{className:"session-dashboard-loading",role:"status","aria-live":"polite","aria-label":"正在加载会话总览","aria-busy":"true",children:s.jsx("div",{className:"session-dashboard-loading-cards","aria-hidden":"true",children:[0,1,2].map(e=>s.jsxs("div",{className:"session-dashboard-loading-card",children:[s.jsx("span",{className:"session-dashboard-loading-icon"}),s.jsxs("span",{className:"session-dashboard-loading-lines",children:[s.jsx("i",{}),s.jsx("i",{})]}),s.jsx("span",{className:"session-dashboard-loading-dot"})]},e))})})}function as({incident:e,target:a,refresh:t,onOpen:r}){var l,d,o;return s.jsx($,{text:e.message,options:((l=e.question)==null?void 0:l.options)??e.options,recommendation:e.recommendation,multiSelect:(d=e.question)==null?void 0:d.multiSelect,sourceOnly:(o=e.question)==null?void 0:o.requiresSource,onSource:()=>r(a),onAnswer:async(c,b)=>{await k({action:"answerSupervision",groupId:e.groupId,incidentId:e.id,answer:c,selectedIndices:b}),await t()}})}function T({item:e,onOpenGroup:a,onOpenSession:t,refresh:r}){var j;const[l,d]=u.useState(!1),o=u.useId(),[c,b]=u.useState(""),[f,p]=u.useState(!1),i=e.supervision,g=((i==null?void 0:i.group)??e.group).members.find(n=>{var h;return n.id===((h=((i==null?void 0:i.group)??e.group).monitoring)==null?void 0:h.supervisorId)}),m=(i==null?void 0:i.incidents.filter(n=>n.status==="waiting"))??[],x=async n=>{p(!0),b("");try{await k(n==="apply"?{action:"applySupervision",groupId:e.group.id}:{action:"pauseSupervision",groupId:e.group.id,paused:!(i!=null&&i.paused)}),await r()}catch(h){b(h instanceof Error?h.message:"操作失败")}finally{p(!1)}};return s.jsxs("article",{className:`session-dashboard-group is-${e.status}`,children:[s.jsxs("div",{className:"session-dashboard-group-summary",children:[s.jsxs("button",{className:"session-dashboard-group-open","aria-label":`进入群聊:${e.group.name}`,onClick:()=>a(e),children:[s.jsx(C,{size:20}),s.jsxs("span",{children:[s.jsx("strong",{title:e.group.name,children:e.group.name}),s.jsx("small",{title:e.group.cwd,children:e.group.cwd})]}),s.jsx("span",{className:`session-dashboard-status is-${e.status}`,children:e.decisionCount?`${e.decisionCount} 待决策`:V[e.status]})]}),s.jsx("button",{className:"session-dashboard-group-toggle","aria-label":`${l?"收起":"展开"}群聊详情:${e.group.name}`,"aria-expanded":l,"aria-controls":o,onClick:()=>d(n=>!n),children:s.jsx(z,{size:16})})]}),l&&s.jsxs("div",{id:o,className:"session-dashboard-group-details",children:[s.jsx("p",{className:"session-dashboard-progress",children:e.progress}),s.jsxs("div",{className:"session-dashboard-meta",children:[s.jsxs("span",{children:[e.runningCount," 运行中"]}),s.jsxs("span",{className:e.decisionCount?"needs-attention":"",children:[e.decisionCount," 待决策"]}),g&&s.jsxs("span",{children:[s.jsx(F,{size:13}),g.name,i!=null&&i.paused?" · 已暂停监管":" · 监工"]})]}),s.jsxs("details",{className:"session-dashboard-linked",children:[s.jsxs("summary",{children:[s.jsx("span",{children:e.sessions.length?`${e.sessions.length} 条${(j=((i==null?void 0:i.group)??e.group).monitoring)!=null&&j.targets.length?"原始":"群内"}会话`:"暂无工作会话"}),s.jsx(z,{size:15})]}),s.jsx("div",{children:e.sessions.map(n=>s.jsxs("button",{className:"session-dashboard-session",onClick:()=>t(n),children:[s.jsx(_,{session:n}),s.jsx(A,{agentType:n.agentType,size:17}),s.jsxs("span",{className:"session-dashboard-session-text",children:[s.jsx("strong",{children:n.title}),s.jsx("small",{children:v[n.agentType]})]}),s.jsx("em",{children:n.status==="running"?"运行中":n.status==="failed"?"异常":n.status==="unknown"?"待核对":"空闲"}),s.jsx(N,{size:14})]},n.id))})]}),g&&s.jsxs("details",{className:"session-dashboard-policy",children:[s.jsx("summary",{children:"监工职责"}),s.jsx("p",{children:g.role||"关注意外中断与交接断档,在原任务授权内恢复;业务选择交由你决策。"}),s.jsxs("button",{disabled:f,onClick:()=>void x("pause"),children:[i!=null&&i.paused?s.jsx(H,{size:13}):s.jsx(J,{size:13})," ",i!=null&&i.paused?"恢复监管":"暂停监管"]})]}),e.configurationChanged&&s.jsxs("p",{className:"session-dashboard-config",children:["群配置已更新,当前监工沿用原配置。",s.jsx("button",{disabled:f,onClick:()=>void x("apply"),children:"应用最新监管配置"})]}),e.questions.map(n=>s.jsx($,{text:n.text,options:n.options,onSource:()=>a({...e,discussionId:n.discussionId}),onAnswer:async(h,w)=>{await k(n.decisionRevision!==void 0?{action:"answerDecision",discussionId:n.discussionId,expectedRevision:n.decisionRevision,answer:h,messageId:crypto.randomUUID()}:{action:"answer",discussionId:n.discussionId,questionId:n.questionId,answer:h,selectedIndices:w}),await r()}},`${n.discussionId}:${n.questionId}`)),m.map(n=>{var w;const h=(w=i==null?void 0:i.group.monitoring)==null?void 0:w.targets.find(L=>L.id===n.sessionId);return h?s.jsx(as,{incident:n,target:h,refresh:r,onOpen:t},n.id):null}),!!(i!=null&&i.incidents.length)&&s.jsxs("details",{className:"session-dashboard-history",children:[s.jsx("summary",{children:"监工记录"}),i.incidents.slice(-6).reverse().map(n=>s.jsxs("p",{children:[s.jsx("time",{children:new Date(n.updatedAt).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})})," ",n.message," ",s.jsx("small",{children:n.status==="queued"?"排队中":n.status==="verifying"?"核对新进度中":n.status==="resolved"?"已处理":n.status==="waiting"?"等你处理":n.status==="dismissed"?"已结束":"处理中"})]},n.id))]}),c&&s.jsx("p",{className:"collab-error",role:"alert",children:c}),s.jsxs("button",{onClick:()=>a(e),children:["进入群聊 ",s.jsx(N,{size:14})]})]})]})}function D({session:e,showAgent:a=!1,onOpen:t}){return s.jsxs("button",{className:"session-dashboard-agent-session",onClick:()=>t(e),children:[a?s.jsx("span",{className:"session-dashboard-session-brand",role:"img","aria-label":v[e.agentType],title:v[e.agentType],children:s.jsx(A,{agentType:e.agentType,size:20})}):s.jsx("span",{className:"session-dashboard-running-dot"}),s.jsxs("span",{children:[s.jsx("strong",{children:e.title}),s.jsx("small",{title:e.cwd,children:e.cwd})]}),s.jsx("span",{children:"运行中"}),s.jsx(N,{size:15})]})}function is(e){const a=e.groups.map(r=>({kind:"group",id:`group:${r.group.id}`,updated:r.updated,item:r,priority:r.decisionCount>0||r.status==="waiting"?2:+(r.runningCount>0||r.status==="running")})),t=e.agents.flatMap(r=>r.sessions).map(r=>({kind:"session",id:`session:${r.id}`,updated:r.updated,priority:1,item:r}));return[...a,...t].sort((r,l)=>l.priority-r.priority||l.updated.localeCompare(r.updated)||r.id.localeCompare(l.id))}function xs(e){const{snapshot:a,notice:t,dismissError:r,loading:l,refresh:d}=es(),o=I(n=>n.skin),c=I(n=>n.dashboardSessionsMerged),b=I(n=>n.setDashboardSessionsMerged);u.useEffect(()=>{document.documentElement.setAttribute("data-skin",o)},[o]),u.useEffect(()=>{window.parent!==window&&window.parent.postMessage({type:q},window.location.origin)},[]);const f=e.onOpenGroup??(n=>y({kind:"group",groupId:n.group.id,title:n.group.name,discussionId:n.discussionId})),p=e.onOpenSession??(n=>y({kind:"session",session:n})),i=e.onViewGroups??(()=>y({kind:"groups"})),g=e.onNewSession??(()=>y({kind:"new-session"})),m=(a==null?void 0:a.agents.reduce((n,h)=>n+h.sessions.length,0))??0,x=a&&c?is(a):[],j=(a==null?void 0:a.decisionTotal)??(a==null?void 0:a.groups.reduce((n,h)=>n+h.decisionCount,0))??0;return s.jsxs("main",{className:"session-dashboard",children:[s.jsxs("header",{className:"session-dashboard-heading",children:[s.jsxs("div",{children:[s.jsx("span",{className:"collab-eyebrow",children:"会话总览"}),s.jsxs("h1",{children:["Dashboard ",s.jsxs("span",{className:"session-dashboard-live",children:[s.jsx("i",{}),"实时"]})]}),s.jsx("p",{children:"在一个地方查看运行、交接与需要你决定的事。"})]}),s.jsxs("div",{className:"session-dashboard-toolbar",children:[s.jsxs("button",{onClick:()=>b(!c),"aria-pressed":c,title:c?"恢复按 Agent 分组":"合并显示群聊和所有 Agent 的运行会话",children:[c?s.jsx(K,{size:16}):s.jsx(B,{size:16}),s.jsx("span",{children:c?"按 Agent 分组":"合并会话"})]}),s.jsx("button",{onClick:()=>void d(),"aria-label":"刷新会话看板",children:s.jsx(P,{size:16})}),s.jsxs("button",{onClick:i,children:[s.jsx(C,{size:16}),"群聊列表"]}),s.jsxs("button",{className:"session-dashboard-new-session",onClick:g,children:[s.jsx(U,{size:16}),"创建会话"]}),e.onClose&&s.jsx("button",{onClick:e.onClose,"aria-label":"关闭会话看板",children:s.jsx(G,{size:17})})]})]}),s.jsxs("div",{className:"session-dashboard-stats",children:[s.jsxs("span",{children:[s.jsx(E,{size:16}),s.jsx("strong",{children:m}),"运行中的原始会话"]}),s.jsxs("span",{className:j?"needs-attention":"",children:[s.jsx("strong",{children:j}),"待你决策"]}),s.jsxs("span",{children:[s.jsx("strong",{children:(a==null?void 0:a.groupTotal)??0}),"协作群"]}),s.jsx("small",{children:"无变化时监工保持安静"})]}),t&&s.jsx(Q,{...t,onClose:r}),l&&!a&&s.jsx(ns,{}),a&&!c&&(a.groups.length?s.jsxs("section",{"aria-label":"群聊运行总览",children:[s.jsxs("div",{className:"session-dashboard-section-title",children:[s.jsxs("h2",{children:[s.jsx(C,{size:18}),"群聊 ",s.jsx("small",{children:"Top 10 · 运行中和待决策优先"})]}),s.jsxs("button",{onClick:i,children:["查看全部 ",a.groupTotal," ",s.jsx(N,{size:14})]})]}),s.jsx("div",{className:"session-dashboard-group-grid",children:a.groups.map(n=>s.jsx(T,{item:n,onOpenGroup:f,onOpenSession:p,refresh:d},n.group.id))})]}):s.jsx("div",{className:"session-dashboard-group-create",children:s.jsxs("button",{onClick:i,children:[s.jsx(C,{size:16}),"创建群聊,配置监工"]})})),a&&(c?s.jsxs("section",{className:"session-dashboard-agent","aria-label":"合并会话",children:[s.jsx("div",{className:"session-dashboard-section-title",children:s.jsxs("h2",{children:[s.jsx(E,{size:20}),"会话 ",s.jsxs("small",{children:[m," 运行中 · ",a.groupTotal," 群聊"]})]})}),x.length?s.jsx("div",{className:"session-dashboard-agent-grid",children:x.map(n=>n.kind==="group"?s.jsx(T,{item:n.item,onOpenGroup:f,onOpenSession:p,refresh:d},n.id):s.jsx(D,{session:n.item,showAgent:!0,onOpen:p},n.id))}):s.jsx("p",{className:"session-dashboard-agent-empty",children:"当前没有运行中的会话"})]}):a.agents.map(n=>s.jsxs("section",{className:"session-dashboard-agent","aria-label":`${v[n.agentType]} 运行会话`,children:[s.jsxs("div",{className:"session-dashboard-section-title",children:[s.jsxs("h2",{children:[s.jsx(A,{agentType:n.agentType,size:20}),v[n.agentType]," ",s.jsxs("small",{children:[n.sessions.length," 运行中"]})]}),s.jsxs("button",{onClick:()=>e.onViewAgent?e.onViewAgent(n.agentType):y({kind:"agent",agentType:n.agentType}),children:["查看全部 ",s.jsx(N,{size:14})]})]}),n.sessions.length?s.jsx("div",{className:"session-dashboard-agent-grid",children:n.sessions.map(h=>s.jsx(D,{session:h,onOpen:p},h.id))}):s.jsx("p",{className:"session-dashboard-agent-empty",children:"当前没有运行中的会话"})]},n.agentType)))]})}export{as as SupervisionIncidentDecision,xs as default};
@@ -1 +1 @@
1
- import{i as d}from"./index-DSgLFE4Q.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-YrEOkxAg.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-DSgLFE4Q.js";import{u as ee}from"./new-session-window-Dgl7UWPR.js";import{A as te}from"./App-mF6ELC07.js";import"./artifact-links-B0ApmgK6.js";import"./composer-file-routing-qSvJpT-v.js";import"./loader-circle-C5C-IzGK.js";import"./x-BYUglEo9.js";import"./RemoteDesktopTabBridge-BA_HQv3V.js";import"./check-8EVJMrTV.js";import"./RunningSessionsIcon-BvFSI9OF.js";import"./trash-2-DjggJGbw.js";import"./download-BE31-Qm0.js";import"./file-types-ZVLWtslN.js";import"./list-todo-Bik5IY2r.js";import"./chevron-right-Cbkc_d70.js";import"./chevron-down-ChNxfI2x.js";import"./session-tree-BK_qaCnb.js";import"./zoom-out-iMMWRXJs.js";import"./rotate-ccw-BbSby0GQ.js";import"./use-session-activity-BbTXGW7Z.js";import"./client-I0ZVCjOI.js";import"./HostProjectPicker-DN_vGqQb.js";import"./CollaborationCreateDialog-CWhmFQtA.js";import"./types-BQCEWNQz.js";import"./collaboration-lVxWL5ce.js";import"./session-dashboard-BFqNDCc8.js";import"./SessionDashboardBridge-CjoeUy-v.js";import"./calendar-days-CLwKstxM.js";import"./rotate-cw-BMdX-ln4.js";import"./pin-BsEEYq8M.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./history-D4E3D_aM.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-YrEOkxAg.js";import{u as ee}from"./new-session-window-CiRwM3Od.js";import{A as te}from"./App-BGIGpBp3.js";import"./composer-file-routing-CWyT7leB.js";import"./loader-circle-CAHZbD5s.js";import"./RemoteDesktopTabBridge-BFzNwpUn.js";import"./check-UipgMBET.js";import"./RunningSessionsIcon-D_cOqmmk.js";import"./trash-2-C682LDDA.js";import"./file-types-nujx8XUw.js";import"./list-todo-D9ChIz0f.js";import"./chevron-right-BGU3tcLA.js";import"./chevron-down-Dvinwg2S.js";import"./session-tree-CTzXmV6R.js";import"./zoom-out-CRN76HNZ.js";import"./rotate-ccw-CHFTy38a.js";import"./use-session-activity-C9Cn92Hj.js";import"./client-Bb0hpbIR.js";import"./HostProjectPicker-DUUgM2Cm.js";import"./CollaborationCreateDialog-CE8OML-A.js";import"./types-CfOuS-6l.js";import"./collaboration-e_iziKU1.js";import"./session-dashboard-C0KfSCDl.js";import"./SessionDashboardBridge-Kc_1Et9r.js";import"./calendar-days-DXE_2mLa.js";import"./rotate-cw-CFCtRFDl.js";import"./pin-BTP5lC_c.js";import"./CollaborationTabBridge-Dxq4G1Uk.js";import"./history-DaBh5_SJ.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
- `).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};
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 Be(){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{Be as default};
@@ -1 +1 @@
1
- import{r as s,j as r}from"./index-DSgLFE4Q.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-YrEOkxAg.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 +1 @@
1
- import{j as a,u as b,r as m,d as h}from"./index-DSgLFE4Q.js";import y from"./TerminalPane-Dr_nY9pI.js";import{u as w}from"./mobileViewport-CekmYKqS.js";import"./RemoteDesktopTabBridge-BA_HQv3V.js";function S(o){const e=crypto.randomUUID();let s=WebSocket.CONNECTING;const c=n=>{var i;s!==WebSocket.CLOSED&&(s=WebSocket.CLOSED,u(),o.close(e).catch(()=>{}),(i=t.onclose)==null||i.call(t,new CloseEvent("close",{code:n})))},t={get readyState(){return s},binaryType:"arraybuffer",onopen:null,onmessage:null,onclose:null,onerror:null,send:n=>{s===WebSocket.OPEN&&o.send(e,n).catch(()=>{})},close:()=>c(1e3)},u=o.onFrame(n=>{var i,l;if(n.id===e){if(n.type==="open")s=WebSocket.OPEN,(i=t.onopen)==null||i.call(t,new Event("open"));else if(n.type==="close")c(n.code);else if(s===WebSocket.OPEN){const d=typeof n.data=="string"?n.data:new Uint8Array(n.data).buffer;(l=t.onmessage)==null||l.call(t,new MessageEvent("message",{data:d}))}}});return o.open(e).catch(()=>c(4001)),t}async function E(){const o=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if(!o.ok)throw new Error("终端连接验证失败");const{wsNonce:e}=await o.json();if(!e)throw new Error("终端连接验证失败");return e}function v({paneId:o,active:e,focused:s,transport:c}){const t=b(f=>f.skin),[u,n]=m.useState([]),[i,l]=m.useState(!0),[d,p]=m.useState(!1),r=w(()=>{},E,()=>p(!0),c?()=>S(c):void 0);return a.jsxs("div",{className:"task-pane-terminal",children:[a.jsx(y,{terminalId:`t-split-${o}`,title:"分屏终端",visible:e,autoFocus:s,state:r.state,rpc:r.rpc,onEvent:r.onEvent,onTerminalData:r.onTerminalData,onTerminalReset:r.onTerminalReset,sendTerminalInput:r.sendTerminalInput,keyOrder:u,keybarHidden:i,onKeyOrderChange:n,onKeybarHiddenChange:l,terminalTheme:h(t)}),!r.state.connected&&a.jsx("div",{className:"task-pane-terminal-connection",role:d||r.state.error?"alert":"status",children:d||r.state.error?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"无法连接本机终端"}),a.jsx("button",{type:"button",onClick:()=>{p(!1),r.reconnect()},children:"重试"})]}):"正在连接本机终端"})]})}function j(o){const e=typeof window>"u"?void 0:window.sharedServiceApi;return e&&!e.terminalSocket?a.jsx("div",{className:"task-pane-terminal-connection",role:"status",children:"请更新桌面端以连接本机终端"}):a.jsx(v,{...o,transport:e==null?void 0:e.terminalSocket})}export{j as default};
1
+ import{j as a,u as b,r as m,d as h}from"./index-YrEOkxAg.js";import y from"./TerminalPane-CiIpI1Id.js";import{u as w}from"./mobileViewport-CKvpvxYc.js";import"./RemoteDesktopTabBridge-BFzNwpUn.js";function S(o){const e=crypto.randomUUID();let s=WebSocket.CONNECTING;const c=n=>{var i;s!==WebSocket.CLOSED&&(s=WebSocket.CLOSED,u(),o.close(e).catch(()=>{}),(i=t.onclose)==null||i.call(t,new CloseEvent("close",{code:n})))},t={get readyState(){return s},binaryType:"arraybuffer",onopen:null,onmessage:null,onclose:null,onerror:null,send:n=>{s===WebSocket.OPEN&&o.send(e,n).catch(()=>{})},close:()=>c(1e3)},u=o.onFrame(n=>{var i,l;if(n.id===e){if(n.type==="open")s=WebSocket.OPEN,(i=t.onopen)==null||i.call(t,new Event("open"));else if(n.type==="close")c(n.code);else if(s===WebSocket.OPEN){const d=typeof n.data=="string"?n.data:new Uint8Array(n.data).buffer;(l=t.onmessage)==null||l.call(t,new MessageEvent("message",{data:d}))}}});return o.open(e).catch(()=>c(4001)),t}async function E(){const o=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if(!o.ok)throw new Error("终端连接验证失败");const{wsNonce:e}=await o.json();if(!e)throw new Error("终端连接验证失败");return e}function v({paneId:o,active:e,focused:s,transport:c}){const t=b(f=>f.skin),[u,n]=m.useState([]),[i,l]=m.useState(!0),[d,p]=m.useState(!1),r=w(()=>{},E,()=>p(!0),c?()=>S(c):void 0);return a.jsxs("div",{className:"task-pane-terminal",children:[a.jsx(y,{terminalId:`t-split-${o}`,title:"分屏终端",visible:e,autoFocus:s,state:r.state,rpc:r.rpc,onEvent:r.onEvent,onTerminalData:r.onTerminalData,onTerminalReset:r.onTerminalReset,sendTerminalInput:r.sendTerminalInput,keyOrder:u,keybarHidden:i,onKeyOrderChange:n,onKeybarHiddenChange:l,terminalTheme:h(t)}),!r.state.connected&&a.jsx("div",{className:"task-pane-terminal-connection",role:d||r.state.error?"alert":"status",children:d||r.state.error?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"无法连接本机终端"}),a.jsx("button",{type:"button",onClick:()=>{p(!1),r.reconnect()},children:"重试"})]}):"正在连接本机终端"})]})}function j(o){const e=typeof window>"u"?void 0:window.sharedServiceApi;return e&&!e.terminalSocket?a.jsx("div",{className:"task-pane-terminal-connection",role:"status",children:"请更新桌面端以连接本机终端"}):a.jsx(v,{...o,transport:e==null?void 0:e.terminalSocket})}export{j as default};
@@ -1,4 +1,4 @@
1
- import{r as I,j as He}from"./index-DSgLFE4Q.js";import{r as eo}from"./mobileViewport-CekmYKqS.js";import{c as to}from"./RemoteDesktopTabBridge-BA_HQv3V.js";/**
1
+ import{r as I,j as He}from"./index-YrEOkxAg.js";import{r as eo}from"./mobileViewport-CKvpvxYc.js";import{c as to}from"./RemoteDesktopTabBridge-BFzNwpUn.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-D0oaq2_l.js";import"./index-YrEOkxAg.js";import"./CalendarView-QXZbXnXA.js";import"./calendar-days-DXE_2mLa.js";import"./chevron-right-BGU3tcLA.js";import"./locate-fixed-2R48MVg_.js";import"./list-todo-D9ChIz0f.js";import"./chevron-down-Dvinwg2S.js";import"./check-UipgMBET.js";import"./pause-ddt7BLlm.js";export{o as default};
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-SVP7TREG-C_zmjkwn.js";import{p as f}from"./chunk-JWPE2WC7-do0R2H6U.js";import{_ as n,l as o}from"./mermaid.core-CRRXKysA.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-C1LUI1_G.js";import"./index-DSgLFE4Q.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-C7T3FGE-.js";import{p as f}from"./chunk-JWPE2WC7-CxssjKKN.js";import{_ as n,l as o}from"./mermaid.core-DH0df9xk.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-vr6c389q.js";import"./index-YrEOkxAg.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-CRRXKysA.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-DH0df9xk.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};