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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) 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 +9 -9
  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/routes-manifest.json +1 -1
  10. package/runtime/.next/server/app/_not-found/page.js +1 -1
  11. package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/runtime/.next/server/app/_not-found.html +1 -1
  13. package/runtime/.next/server/app/_not-found.rsc +1 -1
  14. package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
  15. package/runtime/.next/server/app/api/agent/abort/route.js.nft.json +1 -1
  16. package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
  17. package/runtime/.next/server/app/api/agent/answer/route.js.nft.json +1 -1
  18. package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
  19. package/runtime/.next/server/app/api/agent/codex-sharing/route.js.nft.json +1 -1
  20. package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
  21. package/runtime/.next/server/app/api/agent/harness/status/route.js.nft.json +1 -1
  22. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  23. package/runtime/.next/server/app/api/agent/model/route.js.nft.json +1 -1
  24. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  25. package/runtime/.next/server/app/api/agent/models/route.js.nft.json +1 -1
  26. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  27. package/runtime/.next/server/app/api/agent/run/route.js.nft.json +1 -1
  28. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  29. package/runtime/.next/server/app/api/agent/runtime-health/route.js.nft.json +1 -1
  30. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  31. package/runtime/.next/server/app/api/agent/steer/route.js.nft.json +1 -1
  32. package/runtime/.next/server/app/api/agent/stream/route.js +4 -4
  33. package/runtime/.next/server/app/api/agent/stream/route.js.nft.json +1 -1
  34. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  35. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js.nft.json +1 -1
  36. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  37. package/runtime/.next/server/app/api/agent-workspaces/route.js.nft.json +1 -1
  38. package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
  39. package/runtime/.next/server/app/api/business/route.js +1 -1
  40. package/runtime/.next/server/app/api/business/route.js.nft.json +1 -1
  41. package/runtime/.next/server/app/api/calendar/route.js +2 -3
  42. package/runtime/.next/server/app/api/calendar/route.js.nft.json +1 -1
  43. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  44. package/runtime/.next/server/app/api/collaboration/route.js +9 -9
  45. package/runtime/.next/server/app/api/collaboration/route.js.nft.json +1 -1
  46. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  47. package/runtime/.next/server/app/api/engine-threads/route.js.nft.json +1 -1
  48. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  49. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  50. package/runtime/.next/server/app/api/flow/v1/catalog/route.js.nft.json +1 -1
  51. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  52. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js.nft.json +1 -1
  53. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
  54. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js.nft.json +1 -1
  55. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  56. package/runtime/.next/server/app/api/flow/v1/runs/route.js.nft.json +1 -1
  57. package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
  58. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +1 -0
  59. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js.nft.json +1 -0
  60. package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -0
  61. package/runtime/.next/server/app/api/internal/todo-mcp/route.js.nft.json +1 -0
  62. package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
  63. package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
  64. package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
  65. package/runtime/.next/server/app/api/mcp/servers.body +1 -1
  66. package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
  67. package/runtime/.next/server/app/api/memory/route.js +1 -1
  68. package/runtime/.next/server/app/api/messaging/route.js +1 -1
  69. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -0
  70. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js.nft.json +1 -0
  71. package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -0
  72. package/runtime/.next/server/app/api/notifications/[id]/route.js.nft.json +1 -0
  73. package/runtime/.next/server/app/api/notifications/route.js +1 -0
  74. package/runtime/.next/server/app/api/notifications/route.js.nft.json +1 -0
  75. package/runtime/.next/server/app/api/notifications/stream/route.js +4 -0
  76. package/runtime/.next/server/app/api/notifications/stream/route.js.nft.json +1 -0
  77. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  78. package/runtime/.next/server/app/api/plugins/load/route.js.nft.json +1 -1
  79. package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
  80. package/runtime/.next/server/app/api/projects/check/route.js +1 -1
  81. package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
  82. package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
  83. package/runtime/.next/server/app/api/projects/route.js +1 -1
  84. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  85. package/runtime/.next/server/app/api/push/subscribe/route.js.nft.json +1 -1
  86. package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
  87. package/runtime/.next/server/app/api/push/vapid/route.js +3 -3
  88. package/runtime/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
  89. package/runtime/.next/server/app/api/push/vapid.body +1 -1
  90. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  91. package/runtime/.next/server/app/api/remote-tools/register/route.js.nft.json +1 -1
  92. package/runtime/.next/server/app/api/session-images/[id]/route.js +1 -0
  93. package/runtime/.next/server/app/api/session-images/[id]/route.js.nft.json +1 -0
  94. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  95. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js.nft.json +1 -1
  96. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  97. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js.nft.json +1 -1
  98. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  99. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js.nft.json +1 -1
  100. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +3 -3
  101. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js.nft.json +1 -1
  102. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  103. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js.nft.json +1 -1
  104. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  105. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js.nft.json +1 -1
  106. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  107. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js.nft.json +1 -1
  108. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  109. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js.nft.json +1 -1
  110. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  111. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js.nft.json +1 -1
  112. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  113. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js.nft.json +1 -1
  114. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  115. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js.nft.json +1 -1
  116. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  117. package/runtime/.next/server/app/api/sessions/[id]/release/route.js.nft.json +1 -1
  118. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  119. package/runtime/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  120. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  121. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js.nft.json +1 -1
  122. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  123. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js.nft.json +1 -1
  124. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  125. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js.nft.json +1 -1
  126. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  127. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js.nft.json +1 -1
  128. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  129. package/runtime/.next/server/app/api/sessions/parallel/route.js.nft.json +1 -1
  130. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  131. package/runtime/.next/server/app/api/sessions/route.js.nft.json +1 -1
  132. package/runtime/.next/server/app/api/settings/route.js +1 -1
  133. package/runtime/.next/server/app/api/skills/route.js +1 -1
  134. package/runtime/.next/server/app/api/todos/[id]/commands/route.js +1 -0
  135. package/runtime/.next/server/app/api/todos/[id]/commands/route.js.nft.json +1 -0
  136. package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -0
  137. package/runtime/.next/server/app/api/todos/[id]/executions/route.js.nft.json +1 -0
  138. package/runtime/.next/server/app/api/todos/[id]/route.js +1 -0
  139. package/runtime/.next/server/app/api/todos/[id]/route.js.nft.json +1 -0
  140. package/runtime/.next/server/app/api/todos/route.js +1 -0
  141. package/runtime/.next/server/app/api/todos/route.js.nft.json +1 -0
  142. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  143. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js.nft.json +1 -1
  144. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  145. package/runtime/.next/server/app/api/tool-policies/route.js.nft.json +1 -1
  146. package/runtime/.next/server/app/api/tools/route.js +1 -1
  147. package/runtime/.next/server/app/api/tools/route.js.nft.json +1 -1
  148. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  149. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  150. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  151. package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
  152. package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
  153. package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
  154. package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
  155. package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
  156. package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
  157. package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
  158. package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
  159. package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
  160. package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
  161. package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
  162. package/runtime/.next/server/app/api/workspace-changes/route.js +1 -0
  163. package/runtime/.next/server/app/api/workspace-changes/route.js.nft.json +1 -0
  164. package/runtime/.next/server/app/web/page.js +4 -4
  165. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  166. package/runtime/.next/server/app-paths-manifest.json +45 -33
  167. package/runtime/.next/server/chunks/1298.js +1 -0
  168. package/runtime/.next/server/chunks/1973.js +1 -0
  169. package/runtime/.next/server/chunks/4621.js +1 -1
  170. package/runtime/.next/server/chunks/5303.js +1 -1
  171. package/runtime/.next/server/chunks/535.js +1 -0
  172. package/runtime/.next/server/chunks/5762.js +3 -3
  173. package/runtime/.next/server/chunks/5801.js +1 -0
  174. package/runtime/.next/server/chunks/5812.js +1 -0
  175. package/runtime/.next/server/chunks/685.js +1 -0
  176. package/runtime/.next/server/chunks/6977.js +1 -1
  177. package/runtime/.next/server/chunks/9119.js +15 -0
  178. package/runtime/.next/server/chunks/9457.js +1 -0
  179. package/runtime/.next/server/middleware-build-manifest.js +1 -1
  180. package/runtime/.next/server/pages/404.html +1 -1
  181. package/runtime/.next/server/pages/500.html +1 -1
  182. package/runtime/.next/server/server-reference-manifest.json +1 -1
  183. package/runtime/.next/static/chunks/753-90c7dd1ba08be9be.js +1 -0
  184. package/runtime/.next/static/chunks/app/web/{error-3cae58f0f14f0b4f.js → error-828d278147a0619d.js} +1 -1
  185. package/runtime/.next/static/chunks/app/web/layout-a8b7565989c1c063.js +1 -0
  186. package/runtime/.next/static/chunks/app/web/page-8ff95d45a0160843.js +1 -0
  187. package/runtime/.next/static/chunks/{main-d8ef9def37924b01.js → main-7240085c0ba42e9a.js} +1 -1
  188. package/runtime/.next/static/chunks/main-app-07d67f2d4e96ecb8.js +1 -0
  189. package/runtime/lib/desktop-discovery.mjs +12 -3
  190. package/runtime/lib/service-identity.mjs +17 -0
  191. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  192. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  193. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  194. package/runtime/node_modules/.package-lock.json +17 -17
  195. package/runtime/node_modules/@agent/core/dist/index.js +865 -7
  196. package/runtime/node_modules/@agent/native-runtime/dist/index.js +28979 -9946
  197. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +82 -90
  198. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +65 -64
  199. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0vfvgmex.mjs +39 -0
  200. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-x4kwpwv9.mjs → core-3h0s3zzg.mjs} +2 -2
  201. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-ba5rrckm.mjs → core-6w7w19rc.mjs} +2 -2
  202. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-8fprsbvz.mjs +42 -0
  203. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-avz7wgsg.mjs +23 -0
  204. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-b9ebje8h.mjs +20 -0
  205. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-tf03rfab.mjs → core-e1h3fbg3.mjs} +3 -3
  206. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-2h2qc9qv.mjs → core-ge6en8c9.mjs} +4 -4
  207. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-h6r54bwv.mjs → core-htcq9qj1.mjs} +2 -2
  208. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-sstebd83.mjs → core-nv0a4kre.mjs} +4 -4
  209. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y4qk5bdp.mjs +17 -0
  210. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-qj4dtgyt.mjs → core-yrdmz7je.mjs} +3 -3
  211. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-z276fcqp.mjs +28 -0
  212. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -11
  213. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +22 -22
  214. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +26 -26
  215. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +23 -25
  216. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +86 -90
  217. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +72 -45
  218. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +13 -13
  219. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +13 -13
  220. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +72 -45
  221. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +72 -45
  222. package/runtime/node_modules/mediabunny/dist/modules/src/input.js +6 -0
  223. package/runtime/node_modules/mediabunny/dist/modules/src/media-sink.js +52 -35
  224. package/runtime/node_modules/mediabunny/dist/modules/src/media-source.js +2 -0
  225. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-demuxer.js +7 -1
  226. package/runtime/node_modules/mediabunny/dist/modules/src/source.js +7 -4
  227. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  228. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  229. package/runtime/node_modules/mediabunny/dist/modules/src/wave/wave-demuxer.js +6 -6
  230. package/runtime/node_modules/mediabunny/package.json +1 -1
  231. package/runtime/node_modules/mediabunny/src/input.ts +7 -0
  232. package/runtime/node_modules/mediabunny/src/media-sink.ts +56 -37
  233. package/runtime/node_modules/mediabunny/src/media-source.ts +3 -0
  234. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-demuxer.ts +6 -1
  235. package/runtime/node_modules/mediabunny/src/source.ts +7 -4
  236. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  237. package/runtime/node_modules/mediabunny/src/wave/wave-demuxer.ts +6 -6
  238. package/runtime/node_modules/source-map-js/lib/quick-sort.js +92 -22
  239. package/runtime/node_modules/source-map-js/package.json +1 -1
  240. package/runtime/package-lock.json +41 -65
  241. package/runtime/server.js +1 -1
  242. package/runtime/webapp/dist/assets/AIHubView-CrtJMKfW.js +1 -0
  243. package/runtime/webapp/dist/assets/{AgentManager-CrN2B-tH.js → AgentManager-C2O-Dacy.js} +2 -2
  244. package/runtime/webapp/dist/assets/{AiHubPane-Du6ajSsx.js → AiHubPane-D2XWxc9R.js} +1 -1
  245. package/runtime/webapp/dist/assets/App-Bum2L4_E.js +63 -0
  246. package/runtime/webapp/dist/assets/App-CtLZIOFu.css +1 -0
  247. package/runtime/webapp/dist/assets/BrowserLivePanel-DkBugqrH.js +61 -0
  248. package/runtime/webapp/dist/assets/CalendarPage-DzYWlqoZ.js +1 -0
  249. package/runtime/webapp/dist/assets/CalendarView-BjjC_t12.css +1 -0
  250. package/runtime/webapp/dist/assets/CalendarView-HQls5G-1.js +31 -0
  251. package/runtime/webapp/dist/assets/CollaborationCreateDialog-BwiSJbjb.js +1 -0
  252. package/runtime/webapp/dist/assets/CollaborationDashboard-CNHt31kl.js +1 -0
  253. package/runtime/webapp/dist/assets/CollaborationPage-C4l-tTvn.js +6 -0
  254. package/runtime/webapp/dist/assets/{FilePreview-CevPpP6E.js → FilePreview-EGUAbGpH.js} +5 -5
  255. package/runtime/webapp/dist/assets/FileTree-aJGl1V0W.js +6 -0
  256. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-zpD91eB6.js +1 -0
  257. package/runtime/webapp/dist/assets/FlowStudioPane-K1o4pSkZ.js +5 -0
  258. package/runtime/webapp/dist/assets/HostProjectPicker-BvboCQ0a.js +1 -0
  259. package/runtime/webapp/dist/assets/{LSPServerList-BMY6dFfG.js → LSPServerList-BSLzGLtW.js} +1 -1
  260. package/runtime/webapp/dist/assets/{MCPServerList-c91QNM-g.js → MCPServerList-CeWTI1-m.js} +1 -1
  261. package/runtime/webapp/dist/assets/{MemoryViewer-C9IfWwzW.js → MemoryViewer-YcceFawC.js} +1 -1
  262. package/runtime/webapp/dist/assets/NewSessionWindow-C_HCQQnW.js +1 -0
  263. package/runtime/webapp/dist/assets/NewSessionWindow-DOLG1XEp.css +1 -0
  264. package/runtime/webapp/dist/assets/{RemoteDesktopPage-w8aL061W.js → RemoteDesktopPage-Cpzv8zH0.js} +1 -1
  265. package/runtime/webapp/dist/assets/{RunningSessionsIcon-B8Cr2-hp.js → RunningSessionsIcon-DmCYwIYD.js} +5 -5
  266. package/runtime/webapp/dist/assets/SessionDashboard-C58Mke8a.js +16 -0
  267. package/runtime/webapp/dist/assets/{SessionDashboardBridge-Bx4EXtos.js → SessionDashboardBridge-BPsNDY5Y.js} +1 -1
  268. package/runtime/webapp/dist/assets/{SettingsPanel-CS4XL2sd.js → SettingsPanel-CPBIPT-Z.js} +2 -2
  269. package/runtime/webapp/dist/assets/{SkillManager-5FZnR9My.js → SkillManager-_qaGEuOE.js} +1 -1
  270. package/runtime/webapp/dist/assets/{TerminalPane-CRrbd0i4.js → TerminalPane-mYe76Pgb.js} +2 -2
  271. package/runtime/webapp/dist/assets/TodoPage-DdF5_SkL.js +1 -0
  272. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-DBioGYiE.js → abnfDiagram-VCTEODGH-DLd8EeCY.js} +1 -1
  273. package/runtime/webapp/dist/assets/{arc-BRj_RXHL.js → arc-D4smlqs5.js} +1 -1
  274. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-CoCdq67U.js → architectureDiagram-5GKGNRK7-ByE3DRU4.js} +1 -1
  275. package/runtime/webapp/dist/assets/{arrow-right-Cqqb1zqH.js → arrow-right-BtIv2jiq.js} +1 -1
  276. package/runtime/webapp/dist/assets/artifact-links-4m1A00GO.js +2 -0
  277. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-CLisIPjq.js → blockDiagram-I7D4REHJ-BvTUm5vA.js} +3 -3
  278. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-BoLCIVW8.js → c4Diagram-7LVT6UL2-XKwj5RmQ.js} +1 -1
  279. package/runtime/webapp/dist/assets/calendar-days-BeI09qof.js +6 -0
  280. package/runtime/webapp/dist/assets/channel-wxCRUEc2.js +1 -0
  281. package/runtime/webapp/dist/assets/check-BdadwkYj.js +6 -0
  282. package/runtime/webapp/dist/assets/{chevron-down-DhZV290h.js → chevron-down-DwzPFeq8.js} +1 -1
  283. package/runtime/webapp/dist/assets/chevron-right-kcIXzCMb.js +6 -0
  284. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-CIQxwzU0.js → chunk-2Q5K7J3B-7A6CDWIw.js} +1 -1
  285. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-Buiv0MCN.js → chunk-5VM5RSS4-mkNEWbY6.js} +1 -1
  286. package/runtime/webapp/dist/assets/chunk-F27PBJKO-DKG-1HL0.js +1 -0
  287. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-C0NrkJOc.js → chunk-IMKFNOWR-kiJDyKM7.js} +1 -1
  288. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-CGON_UvB.js → chunk-JWPE2WC7-DS7C5_M7.js} +1 -1
  289. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-BXvOsc9g.js → chunk-POPQ4Y6H-DvgeK_lX.js} +1 -1
  290. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-ZD_qn-NK.js → chunk-SVP7TREG-BLo_2ua-.js} +3 -3
  291. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-DrB8f6RG.js → chunk-TICWLB2K-CJT6Qkz4.js} +1 -1
  292. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-CYgLMn5t.js → chunk-XXDRQBXY-D1OLqjNu.js} +1 -1
  293. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-Ct3Cgqrl.js +1 -0
  294. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-Ct3Cgqrl.js +1 -0
  295. package/runtime/webapp/dist/assets/{codeSyntax-DfQ5rLir.js → codeSyntax-Dd0hAazb.js} +3 -3
  296. package/runtime/webapp/dist/assets/collaboration-CAgt9AiV.js +6 -0
  297. package/runtime/webapp/dist/assets/composer-file-routing-DSC2Eojr.js +6 -0
  298. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-CDPnTlcy.js → cose-bilkent-JH36ORCC-CI6EKHP8.js} +1 -1
  299. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-DDCxhkA5.js → cynefin-OW5HDTMX-CJTXYieX.js} +1 -1
  300. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-CIJ1KBPA.js → cynefinDiagram-5FMLGOSQ-CPl1UVhy.js} +2 -2
  301. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-CFX8O3IJ.js → dagre-GXQ25YYZ-Dq3ZQGTN.js} +1 -1
  302. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-B8UX2IBH.js → diagram-S7CK7UJ4-DJyU-2Di.js} +3 -3
  303. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-Ce34DNrv.js → diagram-UQ7AKVKN-Csg8hC8m.js} +1 -1
  304. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-CVL_erWD.js → diagram-VSXAHHWV-B14uLH_N.js} +3 -3
  305. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-DBFHI7Dk.js → diagram-VX7I27RA-D2Ww2nHe.js} +1 -1
  306. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-Bw_QcSQY.js → diagram-Z3DM3KII-D_YC6AVP.js} +2 -2
  307. package/runtime/webapp/dist/assets/{download-D3xZPWnZ.js → download-COWHIKec.js} +1 -1
  308. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-DRly04dj.js → ebnfDiagram-PWID7BFC-s66xVEGY.js} +1 -1
  309. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-DTm817hG.js → erDiagram-RLTQ6QDP-CgZh5cEn.js} +1 -1
  310. package/runtime/webapp/dist/assets/{external-link-Cwu5rEgp.js → external-link-T3kil1jt.js} +1 -1
  311. package/runtime/webapp/dist/assets/{file-types-DKkhMnUV.js → file-types-0e-tNIVd.js} +2 -2
  312. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-tc8ygZtG.js → flowDiagram-HODETNUW-BISMKynN.js} +1 -1
  313. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-CsQFf1IN.js → ganttDiagram-EL5Y4UJY-Cbyu0NcF.js} +1 -1
  314. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-DAIxbmPX.js → gitGraphDiagram-WWUBYQGX-Cs6IQGBz.js} +7 -7
  315. package/runtime/webapp/dist/assets/history-Df4LXw6L.js +6 -0
  316. package/runtime/webapp/dist/assets/{image-plus-nplydLA5.js → image-plus-COHCHOpI.js} +1 -1
  317. package/runtime/webapp/dist/assets/index-CQTDnt74.css +1 -0
  318. package/runtime/webapp/dist/assets/index-CTJNAMck.js +489 -0
  319. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-CVcMW4UM.js → infoDiagram-27XIBGKW-4f3bFqNV.js} +1 -1
  320. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-zzlEtZ1l.js → ishikawaDiagram-5VMMS53U-D-cJ9vio.js} +4 -4
  321. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-q7NuIMSl.js → journeyDiagram-3NMN7TZE-CeToS0Qx.js} +1 -1
  322. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-DLYFZlKO.js → kanban-definition-UXKFOSKX-DStbIUk1.js} +7 -7
  323. package/runtime/webapp/dist/assets/{layout-PFWssIkE.js → layout-i2D4wlYd.js} +1 -1
  324. package/runtime/webapp/dist/assets/{linear-ZRVcojb1.js → linear-BcJhiCv3.js} +1 -1
  325. package/runtime/webapp/dist/assets/list-todo-7yETOqQe.js +6 -0
  326. package/runtime/webapp/dist/assets/{loader-circle-DIW9tlEz.js → loader-circle-CZdAfU-D.js} +1 -1
  327. package/runtime/webapp/dist/assets/locate-fixed-ByJuEKxC.js +6 -0
  328. package/runtime/webapp/dist/assets/{mermaid.core-C8Dl0Nah.js → mermaid.core-BjNFAB9I.js} +6 -6
  329. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-BcbqtwVk.js → mindmap-definition-YA3MSWOX-BUIHHUVG.js} +1 -1
  330. package/runtime/webapp/dist/assets/new-session-window-C7R76XMp.css +1 -0
  331. package/runtime/webapp/dist/assets/new-session-window-DwtkwFBQ.js +190 -0
  332. package/runtime/webapp/dist/assets/page-9-9EC7QM.js +86 -0
  333. package/runtime/webapp/dist/assets/pause-DXyBDZlg.js +6 -0
  334. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-BQN3zQuy.js → pegDiagram-XKGWAZYB-BY5Bio5e.js} +1 -1
  335. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-pOgxh3os.js → pieDiagram-E7YTZNPT-CF8DVW3F.js} +3 -3
  336. package/runtime/webapp/dist/assets/pin-2YlrlSJv.js +6 -0
  337. package/runtime/webapp/dist/assets/play-BxEpdvoI.js +6 -0
  338. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-BOg7ujzG.js → quadrantDiagram-AXDQQJYC-CXWHO3a-.js} +1 -1
  339. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-CWsN3juJ.js → railroadDiagram-O6MQD6OU-C20JeJZ-.js} +1 -1
  340. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-B0yrO7Oy.js → requirementDiagram-BXWQKSXE-IYd9UrO9.js} +3 -3
  341. package/runtime/webapp/dist/assets/{rotate-ccw-O4wnfQP7.js → rotate-ccw-CFIRtbUD.js} +1 -1
  342. package/runtime/webapp/dist/assets/{rotate-cw-CCJtlAtB.js → rotate-cw-B_vFqNsz.js} +1 -1
  343. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-5MS_e-3E.js → sankeyDiagram-P5KCCOFB-ysBhpblA.js} +2 -2
  344. package/runtime/webapp/dist/assets/{send-Cdg4ZVlp.js → send-DUE2vBoK.js} +1 -1
  345. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-C1w8qYSu.js → sequenceDiagram-WJ2MYXX4-CQMmk6cu.js} +4 -4
  346. package/runtime/webapp/dist/assets/session-dashboard-DnFhQhBN.js +1 -0
  347. package/runtime/webapp/dist/assets/{shield-check-CrjI2wPR.js → shield-check-Btyos6Iv.js} +1 -1
  348. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-BonKTynC.js → sizeCapture-INFHLROL-DekvKUn1.js} +1 -1
  349. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-D3mn6ZK5.js → stateDiagram-D77RDMKH-Ds_FEmbr.js} +1 -1
  350. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DxJ1ks_8.js +1 -0
  351. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-Bn9KWChU.js → swimlanes-42K2YHIH-cjPcEO_T.js} +1 -1
  352. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-JGHIAQXy.js +8 -0
  353. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-BfuhI7EF.js → timeline-definition-24CTP7MA-CEOprVt5.js} +1 -1
  354. package/runtime/webapp/dist/assets/{trash-2-BrfgMjfL.js → trash-2-DLDxY6J7.js} +4 -9
  355. package/runtime/webapp/dist/assets/{types-VnQ_cKrp.js → types-CFAnlTif.js} +1 -1
  356. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-CUFs5JyR.js → vennDiagram-4TSXK5OY-D82uxYY9.js} +5 -5
  357. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-C27HHz1A.js → wardleyDiagram-VM6X3IG4-JFt7Izt0.js} +1 -1
  358. package/runtime/webapp/dist/assets/{web-CeCHmdwO.js → web-BMqaP0jw.js} +1 -1
  359. package/runtime/webapp/dist/assets/{web-BOzkL-0Z.js → web-Q9VPRftY.js} +1 -1
  360. package/runtime/webapp/dist/assets/{x-DP1nC4qG.js → x-CeSbythI.js} +1 -1
  361. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CQwRrSTf.js → xychartDiagram-S5SC5T6Z-1WCa4SfL.js} +3 -3
  362. package/runtime/webapp/dist/assets/zoom-out-CRr_o1NV.js +16 -0
  363. package/runtime/webapp/dist/index.html +2 -2
  364. package/runtime/ws-server.mjs +23 -4
  365. package/runtime/.next/server/chunks/1614.js +0 -1
  366. package/runtime/.next/server/chunks/732.js +0 -1
  367. package/runtime/.next/server/chunks/7519.js +0 -15
  368. package/runtime/.next/server/chunks/7788.js +0 -1
  369. package/runtime/.next/static/chunks/333-9881c3d2c558a28d.js +0 -1
  370. package/runtime/.next/static/chunks/app/web/layout-d5d7d1c5c74eef3c.js +0 -1
  371. package/runtime/.next/static/chunks/app/web/page-7afa4cb0119e90b7.js +0 -1
  372. package/runtime/.next/static/chunks/main-app-7a6902a607752446.js +0 -1
  373. package/runtime/lib/voice-tts-gateway.mjs +0 -96
  374. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-9sxfsmzx.mjs +0 -18
  375. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-dnsvg8nc.mjs +0 -53
  376. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-k67vj6j9.mjs +0 -20
  377. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-qbjntcdf.mjs +0 -18
  378. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rn7tc54w.mjs +0 -17
  379. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-td7rt8zt.mjs +0 -17
  380. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y6bhrwmk.mjs +0 -47
  381. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ya1m7gzj.mjs +0 -18
  382. package/runtime/webapp/dist/assets/AIHubView-BMeOfqfm.js +0 -1
  383. package/runtime/webapp/dist/assets/App-CrZstnCH.css +0 -1
  384. package/runtime/webapp/dist/assets/App-zihaYk1L.js +0 -179
  385. package/runtime/webapp/dist/assets/BrowserLivePanel-CU_X6OU2.js +0 -56
  386. package/runtime/webapp/dist/assets/CollaborationCreateDialog-BmgYdwe7.js +0 -1
  387. package/runtime/webapp/dist/assets/CollaborationDashboard-mHU8iJYg.js +0 -1
  388. package/runtime/webapp/dist/assets/CollaborationPage-Br5fhNce.js +0 -6
  389. package/runtime/webapp/dist/assets/FileTree-CagcHV1N.js +0 -11
  390. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-CWVndCXp.js +0 -1
  391. package/runtime/webapp/dist/assets/FlowStudioPane-BZA-qvBj.js +0 -5
  392. package/runtime/webapp/dist/assets/SessionDashboard-CFXXTm_4.js +0 -21
  393. package/runtime/webapp/dist/assets/artifact-links-73OZyi5W.js +0 -7
  394. package/runtime/webapp/dist/assets/channel-JGVZzkSo.js +0 -1
  395. package/runtime/webapp/dist/assets/chunk-F27PBJKO-XBMwIl6X.js +0 -1
  396. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BnctJ00R.js +0 -1
  397. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BnctJ00R.js +0 -1
  398. package/runtime/webapp/dist/assets/collaboration-CQhzjwS_.js +0 -6
  399. package/runtime/webapp/dist/assets/composer-file-routing-D9orqwzY.js +0 -11
  400. package/runtime/webapp/dist/assets/index-B-d1Vs9E.css +0 -1
  401. package/runtime/webapp/dist/assets/index-DKm9ESDq.js +0 -489
  402. package/runtime/webapp/dist/assets/page-BG97oPXr.js +0 -91
  403. package/runtime/webapp/dist/assets/session-dashboard-BigU92sz.js +0 -6
  404. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-WEfEW-mH.js +0 -1
  405. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-D26_Nmko.js +0 -8
  406. package/runtime/webapp/dist/assets/zoom-out-Dg7YyzcP.js +0 -21
  407. package/runtime/webapp/dist/pcm-audio-worklet.js +0 -126
  408. /package/runtime/.next/static/{xuZ1UJWVNJ-rxb5YgETmd → alt-ud1W2PlWW6FLlkBcB}/_buildManifest.js +0 -0
  409. /package/runtime/.next/static/{xuZ1UJWVNJ-rxb5YgETmd → alt-ud1W2PlWW6FLlkBcB}/_ssgManifest.js +0 -0
@@ -982,6 +982,9 @@ export class UrlSource extends PathedSource {
982
982
  /** @internal */
983
983
  private async _runWorker(worker: ReadWorker) {
984
984
  let consecutiveReadFailures = 0;
985
+ const rangeEnd = this._length !== null
986
+ ? this._offset + this._length - 1
987
+ : '';
985
988
 
986
989
  // The outer loop is for resuming a request if it dies mid-response
987
990
  while (true) {
@@ -1000,7 +1003,7 @@ export class UrlSource extends PathedSource {
1000
1003
  mergeRequestInit(this._requestInit, {
1001
1004
  headers: {
1002
1005
  // Always sending a range request is a good way to probe if the server supports them
1003
- Range: `bytes=${worker.currentPos}-`,
1006
+ Range: `bytes=${worker.currentPos}-${rangeEnd}`,
1004
1007
  },
1005
1008
  signal: abortController.signal,
1006
1009
  }),
@@ -1008,8 +1011,8 @@ export class UrlSource extends PathedSource {
1008
1011
  () => abortController.signal.aborted,
1009
1012
  );
1010
1013
 
1011
- // Our ranges are always open-ended, so a 416 means the start lies past the end of the resource. If the
1012
- // response doesn't state the size, the end is right here when this worker has read its way up to it.
1014
+ // Servers clamp a range's end to the resource, so a 416 means the start lies past the end of the resource.
1015
+ // If the response doesn't state the size, the end is right here when this worker has read its way up to it.
1013
1016
  const unsatisfiedRangeMatch = response.status === 416
1014
1017
  ? /^bytes \*\/(\d+)$/.exec(response.headers.get('Content-Range') ?? '')
1015
1018
  : null;
@@ -2991,7 +2994,7 @@ export class RangedSource extends Source {
2991
2994
  this._offset + start,
2992
2995
  this._offset + end,
2993
2996
  this._offset + minReadPosition,
2994
- this._offset + maxReadPosition,
2997
+ this._offset + Math.min(maxReadPosition, this._length ?? Infinity),
2995
2998
  );
2996
2999
 
2997
3000
  const processResult = (result: ReadResult | null) => {
@@ -8,6 +8,6 @@
8
8
 
9
9
  // This file is generated by scripts/write-version.ts. Do not edit manually.
10
10
 
11
- export const VERSION = '1.66.0';
11
+ export const VERSION = '1.66.1';
12
12
 
13
13
  export const VERSIONED_NAME = `Mediabunny v${VERSION}`;
@@ -183,11 +183,10 @@ export class WaveDemuxer extends Demuxer {
183
183
  let formatTag = readU16(slice, littleEndian);
184
184
  const numChannels = readU16(slice, littleEndian);
185
185
  const sampleRate = readU32(slice, littleEndian);
186
- slice.skip(4); // Bytes per second
187
- const blockAlign = readU16(slice, littleEndian);
186
+ slice.skip(4 + 2); // Bytes per second, block align
188
187
 
189
- if (numChannels === 0 || sampleRate === 0 || blockAlign === 0) {
190
- throw new Error('Invalid WAVE file - channel count, sample rate and block align must be positive');
188
+ if (numChannels === 0 || sampleRate === 0) {
189
+ throw new Error('Invalid WAVE file - channel count and sample rate must be positive');
191
190
  }
192
191
 
193
192
  let bitsPerSample: number;
@@ -240,12 +239,13 @@ export class WaveDemuxer extends Demuxer {
240
239
  );
241
240
  }
242
241
 
242
+ const sampleSizeInBytes = Math.ceil(bitsPerSample / 8);
243
243
  this.audioInfo = {
244
244
  format: formatTag,
245
245
  numberOfChannels: numChannels,
246
246
  sampleRate,
247
- sampleSizeInBytes: Math.ceil(bitsPerSample / 8),
248
- blockSizeInBytes: blockAlign,
247
+ sampleSizeInBytes,
248
+ blockSizeInBytes: numChannels * sampleSizeInBytes,
249
249
  };
250
250
  }
251
251
 
@@ -14,8 +14,18 @@
14
14
  // fact, when sorting with a comparator, these costs outweigh the benefits of
15
15
  // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
16
16
  // a ~3500ms mean speed-up in `bench/bench.html`.
17
-
18
- function SortTemplate(comparator) {
17
+ //
18
+ // That only pays off while the JIT can inline the comparator, i.e. while the
19
+ // comparator call site in the sort sees a single comparator. The library sorts
20
+ // with four different comparators, so each one gets its own copy of the sort
21
+ // function (`doQuickSort0` .. `doQuickSort3` below). The copies have to be
22
+ // separate function literals in the source: closures created from the same
23
+ // literal share type feedback, and so did copies cloned with `new Function`
24
+ // from identical source text. Cloning with `new Function` also violates
25
+ // Content Security Policies that don't allow 'unsafe-eval', so the copies are
26
+ // written out by hand. Keep them identical. See:
27
+ // https://github.com/7rulnik/source-map-js/pull/29
28
+ // https://github.com/7rulnik/source-map-js/issues/81
19
29
 
20
30
  /**
21
31
  * Swap the elements indexed by `x` and `y` in the array `ary`.
@@ -57,7 +67,7 @@ function randomIntInRange(low, high) {
57
67
  * @param {Number} r
58
68
  * End index of the array
59
69
  */
60
- function doQuickSort(ary, comparator, p, r) {
70
+ function doQuickSort0(ary, comparator, p, r) {
61
71
  // If our lower bound is less than our upper bound, we (1) partition the
62
72
  // array into two pieces and (2) recurse on each half. If it is not, this is
63
73
  // the empty array and our base case.
@@ -98,28 +108,85 @@ function doQuickSort(ary, comparator, p, r) {
98
108
 
99
109
  // (2) Recurse on each half.
100
110
 
101
- doQuickSort(ary, comparator, p, q - 1);
102
- doQuickSort(ary, comparator, q + 1, r);
111
+ doQuickSort0(ary, comparator, p, q - 1);
112
+ doQuickSort0(ary, comparator, q + 1, r);
103
113
  }
104
114
  }
105
115
 
106
- return doQuickSort;
116
+ // Identical copies of `doQuickSort0`, see the comment at the top of the file.
117
+
118
+ function doQuickSort1(ary, comparator, p, r) {
119
+ if (p < r) {
120
+ var pivotIndex = randomIntInRange(p, r);
121
+ var i = p - 1;
122
+
123
+ swap(ary, pivotIndex, r);
124
+ var pivot = ary[r];
125
+
126
+ for (var j = p; j < r; j++) {
127
+ if (comparator(ary[j], pivot, false) <= 0) {
128
+ i += 1;
129
+ swap(ary, i, j);
130
+ }
131
+ }
132
+
133
+ swap(ary, i + 1, j);
134
+ var q = i + 1;
135
+
136
+ doQuickSort1(ary, comparator, p, q - 1);
137
+ doQuickSort1(ary, comparator, q + 1, r);
138
+ }
107
139
  }
108
140
 
109
- function cloneSort(comparator) {
110
- let template = SortTemplate.toString();
111
- let templateFn = new Function(`return ${template}`)();
112
- return templateFn(comparator);
141
+ function doQuickSort2(ary, comparator, p, r) {
142
+ if (p < r) {
143
+ var pivotIndex = randomIntInRange(p, r);
144
+ var i = p - 1;
145
+
146
+ swap(ary, pivotIndex, r);
147
+ var pivot = ary[r];
148
+
149
+ for (var j = p; j < r; j++) {
150
+ if (comparator(ary[j], pivot, false) <= 0) {
151
+ i += 1;
152
+ swap(ary, i, j);
153
+ }
154
+ }
155
+
156
+ swap(ary, i + 1, j);
157
+ var q = i + 1;
158
+
159
+ doQuickSort2(ary, comparator, p, q - 1);
160
+ doQuickSort2(ary, comparator, q + 1, r);
161
+ }
113
162
  }
114
163
 
115
- let isEvalAllowed = (function () {
116
- try {
117
- new Function('return 0')();
118
- return true;
119
- } catch {
120
- return false;
164
+ function doQuickSort3(ary, comparator, p, r) {
165
+ if (p < r) {
166
+ var pivotIndex = randomIntInRange(p, r);
167
+ var i = p - 1;
168
+
169
+ swap(ary, pivotIndex, r);
170
+ var pivot = ary[r];
171
+
172
+ for (var j = p; j < r; j++) {
173
+ if (comparator(ary[j], pivot, false) <= 0) {
174
+ i += 1;
175
+ swap(ary, i, j);
176
+ }
177
+ }
178
+
179
+ swap(ary, i + 1, j);
180
+ var q = i + 1;
181
+
182
+ doQuickSort3(ary, comparator, p, q - 1);
183
+ doQuickSort3(ary, comparator, q + 1, r);
121
184
  }
122
- })();
185
+ }
186
+
187
+ var sortCopies = [doQuickSort0, doQuickSort1, doQuickSort2, doQuickSort3];
188
+ var nextSortCopy = 0;
189
+ var sortCache = new WeakMap();
123
190
 
124
191
  /**
125
192
  * Sort the given array in-place with the given comparator function.
@@ -128,13 +195,16 @@ let isEvalAllowed = (function () {
128
195
  * An array to sort.
129
196
  * @param {function} comparator
130
197
  * Function to use to compare two items.
198
+ * @param {Number} start
199
+ * Index to start sorting from; items before it are left untouched.
131
200
  */
132
-
133
- let sortCache = new WeakMap();
134
201
  exports.quickSort = function (ary, comparator, start = 0) {
135
- let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate(comparator);
136
- if (doQuickSort === void 0) {
137
- doQuickSort = cloneSort(comparator);
202
+ var doQuickSort = sortCache.get(comparator);
203
+ if (doQuickSort === undefined) {
204
+ // Each comparator claims the next free copy. Should there ever be more
205
+ // comparators than copies, the extra ones share the last copy: still
206
+ // correct, just slower for the comparators sharing it.
207
+ doQuickSort = sortCopies[Math.min(nextSortCopy++, sortCopies.length - 1)];
138
208
  sortCache.set(comparator, doQuickSort);
139
209
  }
140
210
  doQuickSort(ary, comparator, start, ary.length - 1);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "source-map-js",
3
3
  "description": "Generates and consumes source maps",
4
- "version": "1.2.2",
4
+ "version": "1.2.3",
5
5
  "homepage": "https://github.com/7rulnik/source-map-js",
6
6
  "author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",
7
7
  "contributors": [
@@ -27,22 +27,22 @@
27
27
  }
28
28
  },
29
29
  "node_modules/@anthropic-ai/claude-agent-sdk": {
30
- "version": "0.3.326",
31
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.326.tgz",
32
- "integrity": "sha512-BUTSky/4YWfL/MxC+4kV0NDbJFjbJPoQMFEk/s9G6hV9LUfYPMbsWz94bFQ7ZIo2ubj2xwJ2c2NVxkNlQhVw+Q==",
30
+ "version": "0.3.328",
31
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.328.tgz",
32
+ "integrity": "sha512-YcOWlpXVm7etPjPVrvSJEfynDksMiG11zvEybSBnk1EVWji6rSjU75HbbhJ8XPEB2ECEwRRP597Udu6IWMtsDw==",
33
33
  "license": "SEE LICENSE IN README.md",
34
34
  "engines": {
35
35
  "node": ">=18.14.0"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.326",
39
- "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.326",
40
- "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.326",
41
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.326",
42
- "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.326",
43
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.326",
44
- "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.326",
45
- "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.326"
38
+ "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.328",
39
+ "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.328",
40
+ "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.328",
41
+ "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.328",
42
+ "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.328",
43
+ "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.328",
44
+ "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.328",
45
+ "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.328"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@anthropic-ai/sdk": ">=0.93.0",
@@ -51,9 +51,9 @@
51
51
  }
52
52
  },
53
53
  "node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
54
- "version": "0.3.326",
55
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.326.tgz",
56
- "integrity": "sha512-D3ZbowCMdKNet0YPZlsJxdJUW1t1Q8KLy1BwNd+5eilf18TlCRtWZlm8DrewFLmu/gxBK7gcsq6uysrIVbPyQg==",
54
+ "version": "0.3.328",
55
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.328.tgz",
56
+ "integrity": "sha512-vjBASSSZFNs5M84XONCM4xAJMKPD0E9RtF0UDQ/a1Qqt5L+slNxhSADkH5n0tEM5HJMK7j9DCPi+0FVOBpZr3w==",
57
57
  "cpu": [
58
58
  "arm64"
59
59
  ],
@@ -64,9 +64,9 @@
64
64
  ]
65
65
  },
66
66
  "node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
67
- "version": "0.3.326",
68
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.326.tgz",
69
- "integrity": "sha512-m8K3Im2S8STdAVBrriuDZyJcnjsu/Vc3476wIOqTAefnCCdtdZ4AHcOcWxt+4KIHE5Vx1qT2qacTRrQBaVVweA==",
67
+ "version": "0.3.328",
68
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.328.tgz",
69
+ "integrity": "sha512-pkZuDNi16H4yJFo6cS2sw8mFj7m7ESAxV74t2gQ9EFzZOpXbQoJqhPBHNEZJ2q/+kr/3vHUtRc2W6jURA6nS+A==",
70
70
  "cpu": [
71
71
  "x64"
72
72
  ],
@@ -77,15 +77,12 @@
77
77
  ]
78
78
  },
79
79
  "node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
80
- "version": "0.3.326",
81
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.326.tgz",
82
- "integrity": "sha512-nYVN8jCcH490DCXIvby7rllzQFxLzKeKClfo2u/yv7mx3ipZQv344caULL/amwZ8w8GUzYyZ8hnS6pI9goSq+A==",
80
+ "version": "0.3.328",
81
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.328.tgz",
82
+ "integrity": "sha512-VvsUzOEf7r3ZtOPfliNGxqknsIvxEmnUOtQnq4+uw7MsfiALKR4s0bx2SP32UuXpqbmqxR1gn456D27XgsAmnA==",
83
83
  "cpu": [
84
84
  "arm64"
85
85
  ],
86
- "libc": [
87
- "glibc"
88
- ],
89
86
  "license": "SEE LICENSE IN LICENSE.md",
90
87
  "optional": true,
91
88
  "os": [
@@ -93,15 +90,12 @@
93
90
  ]
94
91
  },
95
92
  "node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
96
- "version": "0.3.326",
97
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.326.tgz",
98
- "integrity": "sha512-baSsuP2/wuWujRpHjKT4WkJB5lhttqKq9jcTfY2KRtQpylbk8E5PWcct/pmwJfNCKIUoE8CD+JpmoWzsdd5Ajw==",
93
+ "version": "0.3.328",
94
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.328.tgz",
95
+ "integrity": "sha512-4Vui26/OZwr8AU7FpAt+R5s/1AKmj5qDorUZIqF1MMfdjAQf8/ut/+HyEkuMom/MVF2JeQLdvnFFFmbfgmAq/g==",
99
96
  "cpu": [
100
97
  "arm64"
101
98
  ],
102
- "libc": [
103
- "musl"
104
- ],
105
99
  "license": "SEE LICENSE IN LICENSE.md",
106
100
  "optional": true,
107
101
  "os": [
@@ -109,15 +103,12 @@
109
103
  ]
110
104
  },
111
105
  "node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
112
- "version": "0.3.326",
113
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.326.tgz",
114
- "integrity": "sha512-WMhDY07gk2O0E8FXTbrVYmPjSLFaYPDCPwsNueVxm6vZ7ek+lPaKuOMAxTb1K07TzSmTOexoWeX2Y9VrbVDMpw==",
106
+ "version": "0.3.328",
107
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.328.tgz",
108
+ "integrity": "sha512-saP4fWgVZj1n7MYCqvTKADHXIc/hIAMRDpLVpXD5xB0IT68vhWgIMkzIrsg5P02P6zA49TDuoijbP1YBUEXT4A==",
115
109
  "cpu": [
116
110
  "x64"
117
111
  ],
118
- "libc": [
119
- "glibc"
120
- ],
121
112
  "license": "SEE LICENSE IN LICENSE.md",
122
113
  "optional": true,
123
114
  "os": [
@@ -125,15 +116,12 @@
125
116
  ]
126
117
  },
127
118
  "node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
128
- "version": "0.3.326",
129
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.326.tgz",
130
- "integrity": "sha512-kK9VO3uFqNd4wgeU0Cefluam5AdPu6mvF1nn6aboGy8TA5NoxlWTmA4/AwMhK39zK1S9Q2OjeX0JtAahYlIchw==",
119
+ "version": "0.3.328",
120
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.328.tgz",
121
+ "integrity": "sha512-oJowzzjhWGbdBGyRjqV9CT0nfh4A4/fEI11LjX6b1SkhrNNgy9QT2HzSe8A2yNlliOWo1xJl6nAHT8pLwMNlVg==",
131
122
  "cpu": [
132
123
  "x64"
133
124
  ],
134
- "libc": [
135
- "musl"
136
- ],
137
125
  "license": "SEE LICENSE IN LICENSE.md",
138
126
  "optional": true,
139
127
  "os": [
@@ -141,9 +129,9 @@
141
129
  ]
142
130
  },
143
131
  "node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
144
- "version": "0.3.326",
145
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.326.tgz",
146
- "integrity": "sha512-S+Ai+HhGRVFfTDmYWRfTrdWF3b4KMsfLSThZCqRJ0WCOKOXrRShMKV1hqqHBljx/wkMDPCpY0V/9S/e6w57eGQ==",
132
+ "version": "0.3.328",
133
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.328.tgz",
134
+ "integrity": "sha512-FkqzA++c+giPH2k8svb0egWDiGDkvSLQJTp5bq7QFXOxPEael4ct1yjKit/Yu6Sd48uLEgNT1waBYbyApPzhOw==",
147
135
  "cpu": [
148
136
  "arm64"
149
137
  ],
@@ -154,9 +142,9 @@
154
142
  ]
155
143
  },
156
144
  "node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
157
- "version": "0.3.326",
158
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.326.tgz",
159
- "integrity": "sha512-Yn1gZXYFuHmjHz7SpHx4TqDcRDsC8TfwWcntJdYjFzMWm+caPAp6QRqr/aTvirjqVA1D+D8Rd29xhuytpE3xTQ==",
145
+ "version": "0.3.328",
146
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.328.tgz",
147
+ "integrity": "sha512-9Wd0XrZ0QWkgtcKxObcYDvUpQjUzN3Uq4Chbvu1SOWOoKPfQdD40dwRQMCeKx2KGxAfMrggJ7I3JYnvRWAFYjg==",
160
148
  "cpu": [
161
149
  "x64"
162
150
  ],
@@ -239,9 +227,6 @@
239
227
  "cpu": [
240
228
  "arm64"
241
229
  ],
242
- "libc": [
243
- "glibc"
244
- ],
245
230
  "license": "MIT",
246
231
  "optional": true,
247
232
  "os": [
@@ -258,9 +243,6 @@
258
243
  "cpu": [
259
244
  "arm64"
260
245
  ],
261
- "libc": [
262
- "musl"
263
- ],
264
246
  "license": "MIT",
265
247
  "optional": true,
266
248
  "os": [
@@ -277,9 +259,6 @@
277
259
  "cpu": [
278
260
  "x64"
279
261
  ],
280
- "libc": [
281
- "glibc"
282
- ],
283
262
  "license": "MIT",
284
263
  "optional": true,
285
264
  "os": [
@@ -296,9 +275,6 @@
296
275
  "cpu": [
297
276
  "x64"
298
277
  ],
299
- "libc": [
300
- "musl"
301
- ],
302
278
  "license": "MIT",
303
279
  "optional": true,
304
280
  "os": [
@@ -1182,9 +1158,9 @@
1182
1158
  }
1183
1159
  },
1184
1160
  "node_modules/mediabunny": {
1185
- "version": "1.66.0",
1186
- "resolved": "http://nexus.17usoft.com/repository/npm-all/mediabunny/-/mediabunny-1.66.0.tgz",
1187
- "integrity": "sha512-0Zff/qLkY1ZRyjBEt2vQjLeMigmU/dFKwJLpiPyCiskIel2f2R2kqMxaLYbeHN+rmyz4PVwwLSnU9anjUHHeJQ==",
1161
+ "version": "1.66.1",
1162
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/mediabunny/-/mediabunny-1.66.1.tgz",
1163
+ "integrity": "sha512-Jl+EfJbUASHtWVtOAGX8AK5WyNNG1RNJGjccAXcI2R6wQmIkdAzpyVgyCxvc5DXGSSRAuhGIevCPs43mXDq2ug==",
1188
1164
  "license": "MPL-2.0",
1189
1165
  "workspaces": [
1190
1166
  ".",
@@ -1548,9 +1524,9 @@
1548
1524
  }
1549
1525
  },
1550
1526
  "node_modules/source-map-js": {
1551
- "version": "1.2.2",
1552
- "resolved": "http://nexus.17usoft.com/repository/npm-all/source-map-js/-/source-map-js-1.2.2.tgz",
1553
- "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
1527
+ "version": "1.2.3",
1528
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/source-map-js/-/source-map-js-1.2.3.tgz",
1529
+ "integrity": "sha512-xj+WrAkyv5Qp+t7r9N5HvCBu7g1qOe6CKRNpq22X1GGcPEQADFU54v5qsPVs3/vrUFQ7XivFrcAVKA2stI0kWA==",
1554
1530
  "license": "BSD-3-Clause",
1555
1531
  "engines": {
1556
1532
  "node": ">=0.10.0"
package/runtime/server.js CHANGED
@@ -15,7 +15,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
15
15
  const hostname = process.env.HOSTNAME || '0.0.0.0'
16
16
 
17
17
  let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
18
- const nextConfig = {"env":{},"eslint":{"ignoreDuringBuilds":false},"typescript":{"ignoreBuildErrors":false,"tsconfigPath":"tsconfig.json"},"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.js","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"analyticsId":"","images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"inline","remotePatterns":[],"unoptimized":false},"devIndicators":{"buildActivity":true,"buildActivityPosition":"bottom-right"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"optimizeFonts":true,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":null,"httpAgentOptions":{"keepAlive":true},"outputFileTracing":true,"staticPageGenerationTimeout":60,"swcMinify":true,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"experimental":{"multiZoneDraftMode":false,"prerenderEarlyExit":false,"serverMinification":true,"serverSourceMaps":false,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","middlewarePrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":10,"memoryBasedWorkersCount":false,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"outputFileTracingRoot":"/Users/caoqu/agentroam-release-20261117-75","swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"adjustFontFallbacks":false,"adjustFontFallbacksWithSizeAdjust":false,"typedRoutes":false,"instrumentationHook":false,"bundlePagesExternals":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"missingSuspenseWithCSRBailout":true,"optimizeServerReact":true,"useEarlyImport":false,"staleTimes":{"dynamic":30,"static":300},"serverComponentsExternalPackages":["@anthropic-ai/claude-agent-sdk","@agent/core","@agent/computer-use","@agent/native-runtime"],"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"configFileName":"next.config.js"}
18
+ const nextConfig = {"env":{},"eslint":{"ignoreDuringBuilds":false},"typescript":{"ignoreBuildErrors":false,"tsconfigPath":"tsconfig.json"},"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.js","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"analyticsId":"","images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"inline","remotePatterns":[],"unoptimized":false},"devIndicators":{"buildActivity":true,"buildActivityPosition":"bottom-right"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"optimizeFonts":true,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":null,"httpAgentOptions":{"keepAlive":true},"outputFileTracing":true,"staticPageGenerationTimeout":60,"swcMinify":true,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"experimental":{"multiZoneDraftMode":false,"prerenderEarlyExit":false,"serverMinification":true,"serverSourceMaps":false,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","middlewarePrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":10,"memoryBasedWorkersCount":false,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"outputFileTracingRoot":"/Users/caoqu/team-agent/customer-agent","swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"adjustFontFallbacks":false,"adjustFontFallbacksWithSizeAdjust":false,"typedRoutes":false,"instrumentationHook":false,"bundlePagesExternals":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"missingSuspenseWithCSRBailout":true,"optimizeServerReact":true,"useEarlyImport":false,"staleTimes":{"dynamic":30,"static":300},"serverComponentsExternalPackages":["@anthropic-ai/claude-agent-sdk","@agent/core","@agent/computer-use","@agent/native-runtime"],"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"configFileName":"next.config.js"}
19
19
 
20
20
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
21
21
 
@@ -0,0 +1 @@
1
+ import{r as s,j as t,e as je}from"./index-CTJNAMck.js";import{a as ke,P as Ee}from"./new-session-window-DwtkwFBQ.js";import{A as Ae,T as Re}from"./trash-2-DLDxY6J7.js";import{C as Ie}from"./check-BdadwkYj.js";import{C as ze}from"./chevron-down-DwzPFeq8.js";import{S as He}from"./send-DUE2vBoK.js";import{X as Ne}from"./x-CeSbythI.js";import"./artifact-links-4m1A00GO.js";import"./composer-file-routing-DSC2Eojr.js";import"./loader-circle-CZdAfU-D.js";import"./clipboard-BvwmdR4z.js";import"./RunningSessionsIcon-DmCYwIYD.js";import"./file-types-0e-tNIVd.js";import"./list-todo-7yETOqQe.js";import"./chevron-right-kcIXzCMb.js";import"./arrow-right-BtIv2jiq.js";import"./zoom-out-CRr_o1NV.js";import"./rotate-ccw-CFIRtbUD.js";import"./download-COWHIKec.js";import"./play-BxEpdvoI.js";import"./HostProjectPicker-BvboCQ0a.js";const B=4,Me=4e6,Le=8,Pe=.12;function Oe(a,c,r=Pe){if(c<=0)return[];const p=Array.from({length:c},(f,b)=>{const g=Number(a[b]);return Number.isFinite(g)&&g>0?g:1}),h=p.reduce((f,b)=>f+b,0),d=p.map(f=>f/h).map(f=>Math.max(f,r)),y=d.reduce((f,b)=>f+b,0);return d.map(f=>f/y)}function De(a,c,r,p=Le){if(c<=1||a.width<=0||a.height<=0)return a.width<=0||a.height<=0?[]:[{x:Math.round(a.x),y:Math.round(a.y),width:Math.round(a.width),height:Math.round(a.height)}];const h=Math.min(c,6),v=p*(h-1),d=a.width-v;if(d<=0)return[];const y=Oe(r,h),f=[];let b=a.x;for(let g=0;g<h;g+=1){const k=g===h-1?a.x+a.width-b:Math.floor(d*y[g]);f.push({x:Math.round(b),y:Math.round(a.y),width:Math.round(k),height:Math.round(a.height)}),b+=k+p}return f}function $e({siteId:a,name:c,onSetup:r}){const p=window.agentApi,[h,v]=s.useState(null),[d,y]=s.useState({connected:!1,tabs:[]}),[f,b]=s.useState(""),[g,w]=s.useState(!1),[k,S]=s.useState(Date.now()),[O,H]=s.useState(!0),R=s.useRef(null),N=!d.paused&&d.compatible!==!1&&d.tabs.some(u=>u.siteId===a);s.useEffect(()=>{let u=!1,M=!1,D=!1;p.hubChromeStatus().then(x=>{!u&&!M&&y(x)}),typeof p.hubChromeConversation!="function"?b("请重启 AI Hub 桌面端以启用消息面板"):p.hubChromeConversation(a).then(x=>{!u&&!D&&v(x)});const L=p.onHubChromeEvent(x=>{x.type==="chrome-conversation"&&x.conversation.siteId===a&&(D=!0,v(A=>!A||x.conversation.revision>A.revision?x.conversation:A),b("")),x.type==="chrome-status"&&(M=!0,y(x.status),x.status.tabs.some(A=>A.siteId===a)||(v(null),b(""))),x.type==="chrome-page-error"&&x.siteId===a&&b(x.error)}),I=setInterval(()=>S(Date.now()),1e3);return()=>{u=!0,L(),clearInterval(I)}},[p,a]),s.useLayoutEffect(()=>{O&&R.current&&(R.current.scrollTop=R.current.scrollHeight)},[h==null?void 0:h.revision,O]);const C=N&&!!h&&k-h.receivedAt>6e3,G=d.paused?"Chrome 网页连接已暂停,点击下方按钮即可恢复。":d.connected&&d.compatible===!1?"请从「连接 Chrome」加载新版自动连接扩展。":N?h?h.generating?"正在回复…":h.composerAvailable?"已同步 · 从下方输入框发送消息":"未找到输入框,请在 Chrome 检查页面":"正在读取网页对话…":"在日常 Chrome 中打开并登录此站点,扩展会自动接入;若已暂停,请在扩展中恢复自动连接。";return t.jsxs("div",{"data-aihub-native-pane":a,style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsx("div",{role:"status",style:{padding:"10px 16px",fontSize:12,lineHeight:1.6,color:"var(--text-secondary)",borderBottom:"1px solid var(--border-subtle)"},children:G}),t.jsx("div",{ref:R,onScroll:()=>{const u=R.current;u&&H(u.scrollHeight-u.scrollTop-u.clientHeight<60)},style:{flex:1,minHeight:0,overflow:"auto",padding:"18px 16px",overflowWrap:"anywhere"},children:N?h!=null&&h.messages.length?h.messages.map(u=>t.jsxs("article",{"data-message-id":u.id,style:{marginBottom:24,padding:u.role==="user"?"12px 14px":"0 2px",borderRadius:12,background:u.role==="user"?"var(--bg-deep)":"transparent"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8,fontSize:12,color:"var(--text-muted)"},children:[t.jsx("strong",{children:u.role==="user"?"你":c}),t.jsx("button",{className:"ui-icon-button ui-icon-button--auto","aria-label":`复制 ${u.role==="user"?"消息":c+" 回复"}`,style:{padding:"2px 5px",fontSize:11},onClick:()=>{navigator.clipboard.writeText(u.content).catch(()=>b("未能复制,请选择文字复制"))},children:"复制"})]}),t.jsx("div",{style:{fontSize:15,lineHeight:1.8,whiteSpace:"pre-wrap",color:"var(--text-primary)"},children:ke(u.content)})]},`${h.conversationId}:${u.id}`)):t.jsx("p",{style:{margin:"32px 0",color:"var(--text-muted)",fontSize:15,lineHeight:1.8},children:"连接后会显示当前网页对话。可以在下方输入消息,也可以在 Chrome 中继续聊天。"}):t.jsxs("div",{style:{display:"grid",gap:14,paddingTop:36,textAlign:"center",justifyItems:"center"},children:[t.jsx("strong",{style:{fontSize:18},children:d.paused?`${c} 已暂停`:`连接 ${c}`}),t.jsx("span",{style:{fontSize:14,color:"var(--text-secondary)",lineHeight:1.7},children:d.paused?"取消 Chrome 的调试提示也会暂停连接,无需重新登录。":"登录态保留在 Chrome,回复会以文字显示在这里。"}),d.paused&&t.jsx("button",{className:"ui-icon-button ui-icon-button--auto",disabled:g,style:{padding:"8px 12px",color:"var(--accent)"},onClick:async()=>{w(!0),b("");try{y(await p.hubChromeResume())}catch(u){b(u instanceof Error?u.message:"恢复连接失败,请检查 Chrome 扩展")}finally{w(!1)}},children:g?"正在恢复…":"恢复全部 Chrome 连接"}),t.jsx("button",{className:"ui-icon-button ui-icon-button--auto",style:{padding:"8px 12px"},onClick:()=>{p.hubOpenChrome(a).catch(()=>b("无法打开 Chrome,请检查是否已安装"))},children:"登录 / 打开原网页"}),t.jsx("button",{className:"ui-icon-button ui-icon-button--auto",style:{padding:"8px 12px"},onClick:r,children:"连接设置"})]})}),!O&&t.jsx("button",{className:"ui-icon-button ui-icon-button--auto",style:{alignSelf:"center",padding:"7px 12px",margin:8},onClick:()=>H(!0),children:"回到最新回复 ↓"}),(f||C)&&t.jsx("div",{role:f?"alert":"status",title:f||"暂未收到网页更新,请检查 Chrome 标签页或扩展连接;不代表 AI 已停止回答",style:{padding:"6px 16px",fontSize:12,lineHeight:1.6,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:f?"var(--danger)":"var(--text-muted)"},children:f||"同步暂未更新"})]})}function We({onClose:a}){const c=window.agentApi,[r,p]=s.useState(""),[h,v]=s.useState(!1),[d,y]=s.useState(""),[f,b]=s.useState(!1);s.useEffect(()=>{let w=!0;c.hubChromeStatus().then(S=>{w&&b(S.connected&&S.compatible!==!1)}).catch(()=>{w&&p("暂时无法检测插件连接,请稍后重试")});const k=c.onHubChromeEvent(S=>{S.type==="chrome-status"&&b(S.status.connected&&S.status.compatible!==!1)});return()=>{w=!1,k()}},[c]);const g=async()=>{v(!0),p("");try{const w=await c.hubChromeInstallExtension();y(w.path),p(w.browserOpened?"已打开 Chrome 扩展管理页,插件目录路径已复制。":"未能打开 Chrome。请先安装或打开 Google Chrome,再进入 chrome://extensions;插件目录路径已复制。")}catch{p("未能准备插件,请确认桌面端已启动,稍后重试。")}finally{v(!1)}};return t.jsxs("div",{"data-aihub-chrome-setup":"",style:{flexShrink:0,padding:"12px 18px",background:"var(--bg-elevated)",borderBottom:"1px solid var(--border-subtle)",fontSize:12},children:[t.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",marginBottom:8},children:[t.jsx("strong",{children:"连接日常 Google Chrome"}),t.jsx("span",{role:"status",children:f?"扩展已连接":"等待扩展连接"}),t.jsx("button",{className:"ui-icon-button ui-icon-button--auto",style:{marginLeft:"auto"},onClick:a,children:"收起"})]}),t.jsx("p",{style:{margin:"0 0 8px",lineHeight:1.7},children:"插件已随桌面端附带,无需另行下载。首次加载需要在 Chrome 中确认;加载后自动连接,连接成功后此引导会自动收起。已安装时刷新 AI Hub 扩展即可更新。"}),t.jsxs("ol",{style:{margin:0,paddingLeft:20,lineHeight:1.9},children:[t.jsx("li",{children:"点击「安装浏览器插件」,在打开的 Chrome 扩展管理页开启「开发者模式」。"}),t.jsx("li",{children:"选择「加载已解压的扩展程序」,选中 ai-hub-chrome-extension 文件夹。macOS 文件选择窗口可按 ⌘⇧G,粘贴已复制的路径并打开。"}),t.jsx("li",{children:"在同一个 Chrome 中完成网站登录,即可回到 AI Hub 查看回复并同步发送。取消 Chrome 顶部的调试提示会暂停连接;在 AI Hub 点击「恢复全部 Chrome 连接」即可继续。"})]}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:8},children:[t.jsx("button",{type:"button",disabled:h,className:"ui-icon-button ui-icon-button--auto",onClick:()=>void g(),style:{padding:"5px 10px"},children:h?"正在打开…":"安装浏览器插件"}),t.jsx("button",{type:"button",className:"ui-icon-button ui-icon-button--auto",onClick:()=>{c.hubChromeRevealExtension().catch(()=>p("未能打开扩展目录"))},style:{padding:"5px 10px"},children:"打开插件文件夹"}),r&&t.jsx("span",{role:"status",children:r})]}),d&&t.jsxs("p",{style:{margin:"8px 0 0",overflowWrap:"anywhere",userSelect:"text"},children:["插件目录:",d]})]})}const Ge=["chatgpt","gemini","grok"];function _(a){return Ge.includes(a)}const Te=52,K=30,Be=4;function _e(a,c){return a.includes(c)?a.length>1?a.filter(r=>r!==c):a:a.length<Be?[...a,c]:a}function Fe(a){return(a.trim()[0]||"?").toUpperCase()}function ue(a){try{const c=new URL(a);return c.protocol==="http:"||c.protocol==="https:"}catch{return!1}}function ht({onExit:a,conversationId:c}){const r=typeof window<"u"?window.agentApi:void 0,p=typeof(r==null?void 0:r.hubGetConfig)=="function",[h,v]=s.useState([]),[d,y]=s.useState([]),[f,b]=s.useState([]),[g,w]=s.useState(null),[k,S]=s.useState({}),[O,H]=s.useState({}),[R,N]=s.useState({}),[C,G]=s.useState(""),[u,M]=s.useState([]),[D,L]=s.useState(""),[I,x]=s.useState(!1),A=s.useRef(null),Y=s.useRef(null),[E,V]=s.useState(!1),[q,J]=s.useState([]),[P,T]=s.useState(!1),[Q,F]=s.useState(!1),[U,Z]=s.useState(""),[$,ee]=s.useState(""),[he,z]=s.useState(!1),[pe,ge]=s.useState([]);s.useEffect(()=>{if(!(r!=null&&r.hubChromeStatus))return;let e=!1,i=!1;const n=l=>{if(e)return;const m=l.connected&&l.compatible!==!1;ge(m?l.tabs.map(W=>W.siteId):[]),m?z(!1):i||z(!0),i=!0};r.hubChromeStatus().then(n).catch(()=>{!e&&!i&&(i=!0,z(!0))});const o=r.onHubChromeEvent(l=>{l.type==="chrome-status"&&n(l.status)});return()=>{e=!0,o()}},[r]);const te=s.useRef(null),ne=s.useRef(null);s.useRef(0),s.useLayoutEffect(()=>{const e=Y.current;e&&(e.style.height="32px",C&&(e.style.height=`${Math.max(32,Math.min(e.scrollHeight,120))}px`))},[C,d.length]);const ie=async e=>{if(!(E||I)){x(!0),L("");try{if(e.length+u.length>B)throw new Error(`最多添加 ${B} 张图片`);const i=await Promise.all(e.map(async n=>{if(!/^image\/(png|jpeg|webp)$/.test(n.type))throw new Error("请选择 PNG、JPEG 或 WebP 图片");if(n.size*4/3+32>Me)throw new Error("单张图片不能超过约 3 MB");return new Promise((o,l)=>{const m=new FileReader;m.onload=()=>o(String(m.result)),m.onerror=()=>l(new Error("图片读取失败,请重试")),m.readAsDataURL(n)})}));M(n=>[...n,...i].slice(0,B))}catch(i){L(i instanceof Error?i.message:"图片读取失败")}finally{x(!1)}}},j=s.useMemo(()=>g?De(g,d.length,f):[],[g,d.length,f]);s.useEffect(()=>{if(!p||j.length===0)return;const e=d.map((i,n)=>{const o=j[n];return{siteId:i,...c?{conversationId:c}:{},x:o.x,y:o.y+K,width:o.width,height:Math.max(o.height-K,0)}});r==null||r.hubSetBounds(e)},[p,r,j,d,c]),s.useEffect(()=>{if(p)for(const e of d)r==null||r.hubOpenSite(e,c??void 0)},[p,r,d,c]),s.useEffect(()=>{if(!p)return;const e=te.current;if(!e)return;const i=()=>{const l=e.getBoundingClientRect();w(m=>m&&Math.abs(m.x-l.x)<.5&&Math.abs(m.y-l.y)<.5&&Math.abs(m.width-l.width)<.5&&Math.abs(m.height-l.height)<.5?m:{x:l.x,y:l.y,width:l.width,height:l.height})},n={current:0},o=new ResizeObserver(()=>{cancelAnimationFrame(n.current),n.current=requestAnimationFrame(i)});return o.observe(e),i(),()=>{o.disconnect(),cancelAnimationFrame(n.current)}},[p,Q]),s.useEffect(()=>{if(!P)return;const e=n=>{var o;(o=ne.current)!=null&&o.contains(n.target)||T(!1)},i=()=>T(!1);return document.addEventListener("pointerdown",e),window.addEventListener("blur",i),()=>{document.removeEventListener("pointerdown",e),window.removeEventListener("blur",i)}},[P]),s.useEffect(()=>{if(!p||!r)return;let e=!1;r.hubGetConfig().then(n=>{e||(v(n.sites),y(o=>o.length>0?o:n.sites.slice(0,1).map(l=>l.id)))});const i=r.onHubEvent(n=>{n.type==="load-failed"?(S(o=>({...o,[n.siteId]:n.errorCode??-1})),H(o=>({...o,[n.siteId]:!1}))):n.type==="loaded"?(S(o=>{if(!(n.siteId in o))return o;const l={...o};return delete l[n.siteId],l}),H(o=>({...o,[n.siteId]:!1}))):n.type==="loading"?(H(o=>({...o,[n.siteId]:!0})),N(o=>{if(!(n.siteId in o))return o;const l={...o};return delete l[n.siteId],l})):n.type==="google-auth-external"&&N(o=>({...o,[n.siteId]:!0}))});return()=>{e=!0,i(),r.hubHideAll()}},[p,r]),s.useEffect(()=>{const e=Math.max(d.length,0);b(i=>i.length===e?i:Array.from({length:e},()=>e>0?1/e:0))},[d.length]);const fe=s.useCallback(e=>{y(i=>_e(i,e))},[]),oe=s.useCallback(e=>{S(i=>{const n={...i};return delete n[e],n}),r==null||r.hubReload(e,c??void 0),r==null||r.hubOpenSite(e,c??void 0)},[r,c]),be=s.useCallback(e=>{d.length<=1||(r==null||r.hubCloseSite(e,c??void 0),y(i=>i.filter(n=>n!==e)))},[r,d.length,c]),re=s.useCallback(async()=>{const e=C.trim();if(!(!e&&u.length===0||!r||E||I||d.length===0)){V(!0);try{const i=await r.hubBroadcast(e,d,u),n=i.map(o=>({...o,at:Date.now()}));J(n),i.length>0&&i.every(o=>o.ok)&&(G(""),M([]),L("")),setTimeout(()=>{J(o=>o.filter(l=>!l.ok||Date.now()-l.at<8e3))},8200)}catch(i){L(i instanceof Error?i.message:"发送失败,请重试")}finally{V(!1)}}},[r,C,u,I,E,d]),me=s.useCallback(async()=>{if(!r||!ue($))return;const e=$.trim(),i=U.trim()||new URL(e).hostname,n={id:`custom-${Math.random().toString(36).slice(2,10)}`,name:i,url:e,adapter:"generic"},o=await r.hubSetConfig({version:1,sites:[...h,n]});v(o.sites),Z(""),ee(""),F(!1)},[r,U,$,h]),xe=s.useCallback(async e=>{if(!r||h.length<=1)return;r.hubCloseSite(e,c??void 0);const i=await r.hubSetConfig({version:1,sites:h.filter(n=>n.id!==e)});v(i.sites),y(n=>{const o=n.filter(l=>l!==e);return o.length>0?o:i.sites.slice(0,1).map(l=>l.id)})},[r,h,c]),ye=s.useCallback((e,i)=>{i.preventDefault();const n=j.length,o=n>1?8:0,l=((g==null?void 0:g.width)??0)-o*(n-1);if(l<=0)return;const m=i.clientX,W=[...f],ve=j[e].width,we=W[e]+W[e+1],se=Se=>{const Ce=Se.clientX-m,le=80,de=we*l,ce=Math.min(Math.max(ve+Ce,le),de-le),X=[...W];X[e]=ce/l,X[e+1]=(de-ce)/l,b(X)},ae=()=>{window.removeEventListener("pointermove",se),window.removeEventListener("pointerup",ae)};window.addEventListener("pointermove",se),window.addEventListener("pointerup",ae)},[f,j,g]);return p?t.jsxs("div",{style:{position:"absolute",inset:0,zIndex:30,display:"flex",flexDirection:"column",background:"var(--bg-workspace)"},children:[t.jsxs("div",{className:"aihub-topbar",style:{height:Te,display:"flex",alignItems:"center",gap:10,padding:"0 14px",borderBottom:"1px solid var(--border-subtle)",WebkitAppRegion:"drag"},children:[t.jsx("button",{type:"button",onClick:a,title:"返回会话列表","aria-label":"返回会话列表",className:"ui-icon-button",style:{WebkitAppRegion:"no-drag",width:34,height:34,flexShrink:0},children:t.jsx(Ae,{size:18,"aria-hidden":"true"})}),t.jsx("strong",{style:{fontSize:14,color:"var(--text-secondary)"},children:"AI Hub"}),t.jsx("button",{type:"button",className:"ui-icon-button ui-icon-button--auto",onClick:()=>z(e=>!e),style:{WebkitAppRegion:"no-drag",marginLeft:"auto",padding:"5px 10px"},children:"连接 Chrome"})]}),he&&t.jsx(We,{onClose:()=>z(!1)}),t.jsxs("div",{ref:te,style:{flex:1,position:"relative",overflow:"hidden",minHeight:0},children:[j.map((e,i)=>{const n=d[i],o=h.find(m=>m.id===n),l=n in k;return t.jsxs("div",{"data-aihub-pane":n,style:{position:"absolute",left:e.x-((g==null?void 0:g.x)??0),top:e.y-((g==null?void 0:g.y)??0),width:e.width,height:e.height,display:"flex",flexDirection:"column",borderRight:i<j.length-1?"1px solid var(--border-subtle)":void 0},children:[t.jsxs("div",{style:{height:K,display:"flex",alignItems:"center",gap:6,padding:"0 8px",borderBottom:"1px solid var(--border-subtle)",fontSize:12,color:"var(--text-secondary)"},children:[t.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:_(n)?pe.includes(n)?"var(--success)":"var(--text-muted)":l?"#f7768e":O[n]?"var(--accent-glow)":"#9ece6a",flexShrink:0}}),t.jsx("span",{style:{flex:1,minWidth:40,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(o==null?void 0:o.name)??n}),R[n]&&t.jsx("span",{title:"Google 登录已在系统浏览器打开,登录状态不会同步回 AI Hub。如需继续内嵌使用,请选择邮箱登录。","aria-label":"Google 登录受限",style:{flexShrink:0,fontSize:10,padding:"1px 6px",borderRadius:999,color:"#f7768e",border:"1px solid currentColor",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:"Google 登录已转至浏览器,内嵌请用邮箱"}),_(n)&&t.jsx("button",{type:"button","aria-label":`打开 ${(o==null?void 0:o.name)??n} Chrome 页面`,title:"在日常 Chrome 中登录或查看页面",className:"ui-icon-button ui-icon-button--auto",onClick:()=>{r.hubOpenChrome(n).catch(()=>z(!0))},style:{padding:"2px 6px",fontSize:11},children:"Chrome ↗"}),t.jsx("button",{type:"button",title:"刷新","aria-label":`刷新 ${(o==null?void 0:o.name)??n}`,onClick:()=>oe(n),className:"ui-icon-button",style:{padding:2},children:"⟳"}),d.length>1&&t.jsx("button",{type:"button",title:"关闭页面","aria-label":`关闭 ${(o==null?void 0:o.name)??n}`,onClick:()=>be(n),className:"ui-icon-button",style:{padding:2},children:"×"})]}),t.jsxs("div",{style:{flex:1,position:"relative",background:"var(--bg-surface)"},children:[_(n)&&t.jsx($e,{siteId:n,name:(o==null?void 0:o.name)??n,onSetup:()=>z(!0)}),!_(n)&&l&&t.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:t.jsxs("div",{style:{textAlign:"center",display:"grid",gap:10,color:"var(--text-muted)",fontSize:12},children:[t.jsxs("span",{children:["页面加载失败(",k[n],")"]}),t.jsx("button",{type:"button",onClick:()=>oe(n),className:"ui-icon-button ui-icon-button--auto",style:{justifySelf:"center",padding:"5px 12px"},children:"重试"})]})})]}),i<j.length-1&&t.jsx("div",{"data-aihub-divider":i,onPointerDown:m=>ye(i,m),title:"拖动调整宽度",style:{position:"absolute",top:0,bottom:0,right:-5,width:10,cursor:"col-resize",zIndex:5}})]},n)}),j.length===0&&t.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",color:"var(--text-muted)",fontSize:13},children:"从输入框选择一个 AI 站点"})]}),t.jsxs("div",{style:{borderTop:"1px solid var(--border-subtle)",padding:"8px 12px 10px",display:"flex",flexDirection:"column",gap:8,background:"var(--bg-surface)"},children:[t.jsxs("div",{ref:ne,style:{position:"relative",display:"flex",flexDirection:"column",gap:8},children:[P&&t.jsxs("div",{role:"listbox","aria-label":"选择要发送的 AI 站点","data-aihub-site-picker":"",style:{width:"min(320px, 100%)",maxHeight:280,overflowY:"auto",padding:4,border:"1px solid var(--border-default)",borderRadius:8,background:"var(--bg-workspace)",boxShadow:"0 -8px 24px rgba(0, 0, 0, 0.12)"},children:[h.map(e=>{const i=d.includes(e.id),n=e.id.startsWith("custom-");return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsxs("button",{type:"button",role:"option","aria-selected":i,onClick:()=>fe(e.id),style:{minWidth:0,flex:1,display:"flex",alignItems:"center",gap:8,padding:"8px 9px",border:0,borderRadius:6,background:i?"var(--bg-glass)":"transparent",color:"var(--text-secondary)",cursor:"pointer",textAlign:"left"},children:[t.jsx("span",{"aria-hidden":"true",style:{width:20,height:20,display:"grid",placeItems:"center",borderRadius:"50%",border:`1px solid ${i?"var(--accent)":"var(--border-default)"}`,background:i?"var(--accent)":"transparent",color:i?"var(--bg-workspace)":"transparent",flexShrink:0},children:t.jsx(Ie,{size:13,strokeWidth:2.5})}),t.jsx("span",{"aria-hidden":"true",style:{width:24,height:24,display:"grid",placeItems:"center",borderRadius:6,background:"var(--accent-glow)",fontSize:12,fontWeight:600,flexShrink:0},children:Fe(e.name)}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:13},children:e.name})]}),n&&t.jsx("button",{type:"button",title:`删除站点 ${e.name}`,"aria-label":`删除站点 ${e.name}`,onClick:()=>void xe(e.id),className:"ui-icon-button",style:{width:30,height:30,padding:0,flexShrink:0},children:t.jsx(Re,{size:14,"aria-hidden":"true"})})]},e.id)}),t.jsx("div",{style:{height:1,margin:"4px 6px",background:"var(--border-subtle)"}}),Q?t.jsxs("div",{style:{display:"grid",gap:6,padding:6},children:[t.jsx("input",{value:U,onChange:e=>Z(e.target.value),placeholder:"名称(可选)",style:{minWidth:0,padding:"7px 8px",borderRadius:6,border:"1px solid var(--border-default)",background:"var(--bg-surface)",color:"var(--text-secondary)",fontSize:12}}),t.jsx("input",{value:$,onChange:e=>ee(e.target.value),placeholder:"https://...",style:{minWidth:0,padding:"7px 8px",borderRadius:6,border:"1px solid var(--border-default)",background:"var(--bg-surface)",color:"var(--text-secondary)",fontSize:12}}),t.jsxs("div",{style:{display:"flex",gap:6},children:[t.jsx("button",{type:"button",onClick:()=>void me(),disabled:!ue($),className:"ui-icon-button ui-icon-button--auto",style:{padding:"5px 10px",fontSize:12},children:"添加"}),t.jsx("button",{type:"button",onClick:()=>F(!1),className:"ui-icon-button ui-icon-button--auto",style:{padding:"5px 10px",fontSize:12},children:"取消"})]})]}):t.jsxs("button",{type:"button",onClick:()=>F(!0),className:"ui-icon-button ui-icon-button--auto",style:{width:"100%",justifyContent:"flex-start",gap:7,padding:"7px 9px",fontSize:12},children:[t.jsx(je,{size:14,"aria-hidden":"true"}),"添加站点"]})]}),t.jsxs("div",{"data-aihub-composer":"",style:{display:"flex",alignItems:"center",gap:8,minHeight:48,padding:"6px 8px",borderRadius:8,border:"1px solid var(--border-default)",background:"var(--bg-workspace)"},children:[t.jsxs("button",{type:"button",onClick:()=>T(e=>!e),"aria-haspopup":"listbox","aria-expanded":P,"aria-label":"选择 AI 站点",title:"选择 AI 站点",className:"ui-icon-button ui-icon-button--auto",style:{height:34,gap:5,padding:"0 10px",fontSize:12,whiteSpace:"nowrap",flexShrink:0},children:[d.length," 个 AI",t.jsx(ze,{size:14,"aria-hidden":"true",style:{transform:P?"rotate(180deg)":void 0}})]}),t.jsx("input",{ref:A,type:"file",accept:"image/png,image/jpeg,image/webp",multiple:!0,hidden:!0,onChange:e=>{const i=Array.from(e.target.files??[]);e.target.value="",ie(i)}}),t.jsx("button",{type:"button","aria-label":"添加图片附件",title:"添加图片附件(也可粘贴截图)",disabled:E||I||u.length>=B,onClick:()=>{var e;return(e=A.current)==null?void 0:e.click()},className:"ui-icon-button",style:{width:34,height:34,padding:0,flexShrink:0},children:t.jsx(Ee,{size:17,"aria-hidden":"true"})}),t.jsx("textarea",{ref:Y,"aria-label":"发送给选中的 AI",disabled:E,value:C,onChange:e=>G(e.target.value),onPaste:e=>{const i=Array.from(e.clipboardData.files);i.length!==0&&(e.preventDefault(),ie(i))},onKeyDown:e=>{e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||(e.key==="Enter"&&(!e.shiftKey||e.metaKey||e.ctrlKey)?(e.preventDefault(),re()):e.key==="Escape"&&P&&(e.preventDefault(),T(!1)))},rows:1,placeholder:`一次输入,发到 ${d.length} 个选中的 AI(Enter 发送,Shift+Enter 换行)`,style:{flex:1,minWidth:0,height:32,minHeight:32,maxHeight:120,boxSizing:"border-box",resize:"none",padding:"4px 2px",border:0,outline:"none",boxShadow:"none",background:"transparent",color:"var(--text-primary)",fontSize:13,lineHeight:1.5,textAlign:C?"left":"center"}}),t.jsx("button",{type:"button",onClick:()=>void re(),disabled:!C.trim()&&u.length===0||E||I||d.length===0,title:"同步发送(Enter)","aria-label":"同步发送",className:"ui-icon-button",style:{width:36,height:36,padding:0,borderRadius:"50%",background:(C.trim()||u.length>0)&&!E?"var(--accent)":"var(--bg-glass)",color:(C.trim()||u.length>0)&&!E?"var(--bg-workspace)":"var(--text-muted)",flexShrink:0},children:t.jsx(He,{size:16,"aria-hidden":"true"})})]})]}),u.length>0&&t.jsx("div",{"aria-label":"待发送图片",style:{display:"flex",gap:8,flexWrap:"wrap"},children:u.map((e,i)=>t.jsxs("div",{style:{position:"relative",width:56,height:56},children:[t.jsx("img",{src:e,alt:`附件 ${i+1}`,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:6}}),t.jsx("button",{type:"button","aria-label":`移除附件 ${i+1}`,disabled:E,onClick:()=>M(n=>n.filter((o,l)=>l!==i)),className:"ui-icon-button",style:{position:"absolute",top:0,right:0,padding:2,background:"var(--bg-workspace)"},children:t.jsx(Ne,{size:12})})]},`${i}-${e.length}`))}),D&&t.jsx("div",{role:"alert",style:{fontSize:12,color:"var(--text-secondary)",textAlign:"center"},children:D}),q.length>0&&t.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center",minHeight:18},children:q.map(e=>{var i;return t.jsx("span",{role:"status",style:{fontSize:11,padding:"3px 10px",borderRadius:999,color:e.ok?"#9ece6a":"#f7768e",background:"var(--bg-glass)",whiteSpace:"normal",overflowWrap:"anywhere"},children:(((i=h.find(n=>n.id===e.siteId))==null?void 0:i.name)??e.siteId)+(e.ok?" ✓":` ✕ ${e.reason??"失败"}`)},e.siteId)})})]})]}):t.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",background:"var(--bg-workspace)",zIndex:30},children:t.jsxs("div",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:13,display:"grid",gap:12},children:[t.jsx("span",{children:"AI Hub 仅在桌面端可用"}),t.jsx("button",{type:"button",onClick:a,className:"ui-icon-button ui-icon-button--auto",style:{justifySelf:"center",padding:"6px 14px"},children:"返回"})]})})}export{ht as default,_e as toggleHubSiteSelection};