agentroam-runtime-darwin-arm64 0.2.0-preview.78 → 0.2.0-preview.79

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 (304) 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 +3 -3
  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/harness/status/route.js +1 -1
  17. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  18. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  19. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  20. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  21. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  22. package/runtime/.next/server/app/api/agent/stream/route.js +3 -3
  23. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  24. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  25. package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
  26. package/runtime/.next/server/app/api/business/route.js +1 -1
  27. package/runtime/.next/server/app/api/calendar/route.js +2 -2
  28. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  29. package/runtime/.next/server/app/api/collaboration/route.js +2 -2
  30. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  31. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  32. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  33. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  34. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
  35. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  36. package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
  37. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +1 -1
  38. package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -1
  39. package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
  40. package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
  41. package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
  42. package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
  43. package/runtime/.next/server/app/api/memory/route.js +1 -1
  44. package/runtime/.next/server/app/api/messaging/route.js +1 -1
  45. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -1
  46. package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -1
  47. package/runtime/.next/server/app/api/notifications/route.js +1 -1
  48. package/runtime/.next/server/app/api/notifications/stream/route.js +2 -2
  49. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  50. package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
  51. package/runtime/.next/server/app/api/projects/check/route.js +1 -1
  52. package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
  53. package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
  54. package/runtime/.next/server/app/api/projects/route.js +1 -1
  55. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  56. package/runtime/.next/server/app/api/push/unsubscribe/route.js +3 -3
  57. package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
  58. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  59. package/runtime/.next/server/app/api/session-images/[id]/route.js +1 -1
  60. package/runtime/.next/server/app/api/session-views/route.js +1 -1
  61. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  62. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  63. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  64. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
  65. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  66. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  67. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  68. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  69. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  70. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  71. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  72. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  73. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  74. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  75. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  76. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  77. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  78. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  79. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  80. package/runtime/.next/server/app/api/settings/route.js +1 -1
  81. package/runtime/.next/server/app/api/skills/route.js +1 -1
  82. package/runtime/.next/server/app/api/todos/[id]/commands/route.js +1 -1
  83. package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -1
  84. package/runtime/.next/server/app/api/todos/[id]/route.js +1 -1
  85. package/runtime/.next/server/app/api/todos/route.js +1 -1
  86. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  87. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  88. package/runtime/.next/server/app/api/tools/route.js +1 -1
  89. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  90. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  91. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  92. package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
  93. package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
  94. package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
  95. package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
  96. package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
  97. package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
  98. package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
  99. package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
  100. package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
  101. package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
  102. package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
  103. package/runtime/.next/server/app/api/workspace-changes/route.js +1 -1
  104. package/runtime/.next/server/app/web/page.js +4 -4
  105. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  106. package/runtime/.next/server/app-paths-manifest.json +44 -44
  107. package/runtime/.next/server/chunks/1298.js +1 -1
  108. package/runtime/.next/server/chunks/5303.js +2 -2
  109. package/runtime/.next/server/chunks/6703.js +1 -1
  110. package/runtime/.next/server/chunks/9119.js +2 -2
  111. package/runtime/.next/server/chunks/9457.js +1 -1
  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-828d278147a0619d.js → error-fac7681c6397fcd7.js} +1 -1
  117. package/runtime/.next/static/chunks/app/web/layout-79492e587e5930cf.js +1 -0
  118. package/runtime/.next/static/chunks/app/web/{page-bafdaa23fa1dc1c4.js → page-0f06deb6eb4d49e0.js} +1 -1
  119. package/runtime/.next/static/chunks/main-app-0c7cccb2825ad747.js +1 -0
  120. package/runtime/lib/mesh/headscale-client.mjs +81 -0
  121. package/runtime/lib/mesh/mesh-gateway.mjs +168 -0
  122. package/runtime/lib/mesh/mesh-service.mjs +158 -0
  123. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  124. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  125. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  126. package/runtime/node_modules/.package-lock.json +17 -17
  127. package/runtime/node_modules/@agent/native-runtime/dist/index.js +46 -16
  128. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +58 -58
  129. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +46 -46
  130. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-n0k9q0s3.mjs → core-2g5j09ba.mjs} +2 -2
  131. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-59ydwk0g.mjs +17 -0
  132. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-76wf4hmr.mjs → core-664d5mmy.mjs} +2 -2
  133. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-ypdsx2xc.mjs → core-70sfhqm6.mjs} +2 -2
  134. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-95gcz3n1.mjs +38 -0
  135. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ew5sfvfe.mjs +39 -0
  136. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-gjhs7gf6.mjs +20 -0
  137. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-31xm3p73.mjs → core-kvdt1szx.mjs} +4 -4
  138. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-p654hjkr.mjs +22 -0
  139. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-q9bjbxkv.mjs +19 -0
  140. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-samdvsjh.mjs +33 -0
  141. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-09fdstw7.mjs → core-x6bt758j.mjs} +3 -3
  142. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -12
  143. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -21
  144. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -25
  145. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +22 -22
  146. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +78 -78
  147. package/runtime/node_modules/caniuse-lite/package.json +1 -1
  148. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +17 -3
  149. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +3 -3
  150. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +3 -3
  151. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +17 -3
  152. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +17 -3
  153. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js +4 -1
  154. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js +7 -2
  155. package/runtime/node_modules/mediabunny/dist/modules/src/matroska/matroska-demuxer.js +3 -0
  156. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-muxer.js +2 -2
  157. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  158. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  159. package/runtime/node_modules/mediabunny/package.json +1 -1
  160. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-demuxer.ts +5 -1
  161. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-muxer.ts +10 -2
  162. package/runtime/node_modules/mediabunny/src/matroska/matroska-demuxer.ts +4 -0
  163. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-muxer.ts +2 -2
  164. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  165. package/runtime/package-lock.json +41 -41
  166. package/runtime/server.js +1 -1
  167. package/runtime/webapp/dist/assets/{AIHubView-C0eIFauh.js → AIHubView-4kqTaPjO.js} +1 -1
  168. package/runtime/webapp/dist/assets/{AgentManager-B7kG8iLS.js → AgentManager-CDgiLqF_.js} +1 -1
  169. package/runtime/webapp/dist/assets/{AiHubPane-DB6b6Via.js → AiHubPane-C070jRHe.js} +1 -1
  170. package/runtime/webapp/dist/assets/App-iZlxRHaL.js +68 -0
  171. package/runtime/webapp/dist/assets/{BrowserLivePanel-BgftwEHQ.js → BrowserLivePanel-DxjgVXXK.js} +1 -1
  172. package/runtime/webapp/dist/assets/{CalendarPage-sg7SzvUh.js → CalendarPage-CxPVBlzd.js} +1 -1
  173. package/runtime/webapp/dist/assets/{CalendarView-C5z_2esa.js → CalendarView-CS-OG-13.js} +1 -1
  174. package/runtime/webapp/dist/assets/{CollaborationCreateDialog-DuEnjSu9.js → CollaborationCreateDialog-tI6S1cha.js} +1 -1
  175. package/runtime/webapp/dist/assets/{CollaborationDashboard-O13tTlEe.js → CollaborationDashboard-DSZa3Cns.js} +1 -1
  176. package/runtime/webapp/dist/assets/{CollaborationPage-DIKDOl8G.js → CollaborationPage-COyvllTJ.js} +1 -1
  177. package/runtime/webapp/dist/assets/{FilePreview-BfkF9hjw.js → FilePreview-CcJXlLge.js} +3 -3
  178. package/runtime/webapp/dist/assets/{FileTree-pbVSSQnM.js → FileTree-BuhW-pqR.js} +1 -1
  179. package/runtime/webapp/dist/assets/{FileWorkspaceDrawer-YcKPTu23.js → FileWorkspaceDrawer-ByWXnJ0B.js} +1 -1
  180. package/runtime/webapp/dist/assets/{FlowStudioPane-D7gzm1M_.js → FlowStudioPane-CxQ-QIOf.js} +1 -1
  181. package/runtime/webapp/dist/assets/{HostProjectPicker-7zvVzftL.js → HostProjectPicker--J4_JpSW.js} +1 -1
  182. package/runtime/webapp/dist/assets/{LSPServerList-BfbJdHYJ.js → LSPServerList-fkagcDVv.js} +1 -1
  183. package/runtime/webapp/dist/assets/{MCPServerList-A1SAlHdR.js → MCPServerList-w7tetX3J.js} +1 -1
  184. package/runtime/webapp/dist/assets/{MemoryViewer-fFtBJzgz.js → MemoryViewer-Xac9EeaV.js} +1 -1
  185. package/runtime/webapp/dist/assets/{NewSessionWindow-Ce2M6IVa.js → NewSessionWindow-C460-gxX.js} +1 -1
  186. package/runtime/webapp/dist/assets/{RemoteDesktopPage-kP5Qzh6n.js → RemoteDesktopPage-BniHztmt.js} +1 -1
  187. package/runtime/webapp/dist/assets/{RemoteDesktopTabBridge-tJcxPHnZ.js → RemoteDesktopTabBridge-BF1dFltY.js} +1 -1
  188. package/runtime/webapp/dist/assets/{RunningSessionsIcon-DuoG6Hgs.js → RunningSessionsIcon-D6rY-IzV.js} +1 -1
  189. package/runtime/webapp/dist/assets/{SessionDashboard-DGfTYjbZ.js → SessionDashboard-D868NjZ_.js} +1 -1
  190. package/runtime/webapp/dist/assets/{SessionDashboardBridge-Cw8Y0s5_.js → SessionDashboardBridge-AhmhQ1Xn.js} +1 -1
  191. package/runtime/webapp/dist/assets/{SettingsPanel-DCME-IZC.js → SettingsPanel-DoDRBreZ.js} +1 -1
  192. package/runtime/webapp/dist/assets/{SkillManager-CFHcSwEr.js → SkillManager-Da7bpT-s.js} +1 -1
  193. package/runtime/webapp/dist/assets/{TaskPaneTerminal-BozZNjMj.js → TaskPaneTerminal-DTDU88Rr.js} +1 -1
  194. package/runtime/webapp/dist/assets/{TerminalPane-CPlks8Nc.js → TerminalPane-_dVVs00I.js} +1 -1
  195. package/runtime/webapp/dist/assets/TodoPage-Bqu8bqNk.js +1 -0
  196. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-DoUDteiL.js → abnfDiagram-VCTEODGH-D3GW7M1R.js} +1 -1
  197. package/runtime/webapp/dist/assets/{arc-Cao4pQp2.js → arc-CkEemU1L.js} +1 -1
  198. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BvZ3G5rB.js → architectureDiagram-5GKGNRK7-GYQtcFLY.js} +1 -1
  199. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-DNv3qaVA.js → blockDiagram-I7D4REHJ-D5_bj13P.js} +1 -1
  200. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-DtL8WSam.js → c4Diagram-7LVT6UL2-Cyg1YunN.js} +1 -1
  201. package/runtime/webapp/dist/assets/{calendar-days-DpxojDWK.js → calendar-days-B1Mn3x8A.js} +1 -1
  202. package/runtime/webapp/dist/assets/channel-CnNsi-lz.js +1 -0
  203. package/runtime/webapp/dist/assets/{check-CY3GCzxa.js → check-D-yTByNl.js} +1 -1
  204. package/runtime/webapp/dist/assets/{chevron-down-FeW7FcBS.js → chevron-down-hiPnZS_M.js} +1 -1
  205. package/runtime/webapp/dist/assets/{chevron-right-Bnd4FK8S.js → chevron-right-DKsui_wS.js} +1 -1
  206. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Jc2d8B_h.js → chunk-2Q5K7J3B-ZYdmLJUM.js} +1 -1
  207. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-BbY9artS.js → chunk-5VM5RSS4-C-zA5MxE.js} +1 -1
  208. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-B9uG6DBE.js → chunk-F27PBJKO-cWERJSPb.js} +1 -1
  209. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-Dta3lxIg.js → chunk-IMKFNOWR-BDqkH2_j.js} +1 -1
  210. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-DhBjDzbj.js → chunk-JWPE2WC7-D0hOf4wm.js} +1 -1
  211. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-D51fNP6n.js → chunk-POPQ4Y6H-bGKHqXLU.js} +1 -1
  212. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-DQ8c4Knv.js → chunk-SVP7TREG-DbzwWcno.js} +1 -1
  213. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-BIDOV_Vx.js → chunk-TICWLB2K-CmCx8YTb.js} +1 -1
  214. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-C-y59lCL.js → chunk-XXDRQBXY-COAufrJq.js} +1 -1
  215. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-DVRTvUTS.js +1 -0
  216. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-DVRTvUTS.js +1 -0
  217. package/runtime/webapp/dist/assets/{client-ZvcI0WiM.js → client-5Hu1eVTX.js} +1 -1
  218. package/runtime/webapp/dist/assets/{codeSyntax-DlCdufoQ.js → codeSyntax-Jy5nWtHv.js} +1 -1
  219. package/runtime/webapp/dist/assets/{collaboration-CeiB1Ihl.js → collaboration-DRFqpcAz.js} +1 -1
  220. package/runtime/webapp/dist/assets/{composer-file-routing-CFoCNmv7.js → composer-file-routing-BtvXnu_o.js} +1 -1
  221. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-Do2xoVHK.js → cose-bilkent-JH36ORCC-BU8MmGqT.js} +1 -1
  222. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-CRC3uGN6.js → cynefin-OW5HDTMX-BHXgPQGq.js} +1 -1
  223. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-BD90NfUx.js → cynefinDiagram-5FMLGOSQ-DSJJ_PpM.js} +1 -1
  224. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-BeO7O01r.js → dagre-GXQ25YYZ-pJr8jDyF.js} +1 -1
  225. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-DGvd2V5u.js → diagram-S7CK7UJ4-BZ_7PPQn.js} +1 -1
  226. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-_Ns2BTM0.js → diagram-UQ7AKVKN-c8pu5Rp4.js} +1 -1
  227. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-D45wsjUv.js → diagram-VSXAHHWV-D1xao_j-.js} +1 -1
  228. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-B_898k8e.js → diagram-VX7I27RA-CnBWGCHa.js} +1 -1
  229. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-CdbHDj9L.js → diagram-Z3DM3KII-D-TCo4OF.js} +1 -1
  230. package/runtime/webapp/dist/assets/{download-Cy_rpjte.js → download-B2jLl85N.js} +1 -1
  231. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-eqVvfCy6.js → ebnfDiagram-PWID7BFC-BGBuf1T3.js} +1 -1
  232. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-eRQEDuTP.js → erDiagram-RLTQ6QDP-D8rCYH4y.js} +1 -1
  233. package/runtime/webapp/dist/assets/{file-types-BsWJSk07.js → file-types-BZ8YZAV-.js} +1 -1
  234. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-BLS4V7Zd.js → flowDiagram-HODETNUW-BJGQL6in.js} +1 -1
  235. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-C1JdU9e_.js → ganttDiagram-EL5Y4UJY-K9o-Kk2M.js} +1 -1
  236. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-kAprA0xM.js → gitGraphDiagram-WWUBYQGX-BC2r8pLT.js} +1 -1
  237. package/runtime/webapp/dist/assets/{history-BGr6tFSR.js → history-Ci0s2eVL.js} +1 -1
  238. package/runtime/webapp/dist/assets/{image-plus-Cr9rDqvd.js → image-plus-Cx4LQVvj.js} +1 -1
  239. package/runtime/webapp/dist/assets/{index-CrjQF-VW.js → index-D1AQffdA.js} +3 -3
  240. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DzUFk2zb.js → infoDiagram-27XIBGKW-bFnrh7W7.js} +1 -1
  241. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-DETvimW1.js → ishikawaDiagram-5VMMS53U-Qun77xRt.js} +1 -1
  242. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-ZmlLOhVV.js → journeyDiagram-3NMN7TZE-DjCfoBNX.js} +1 -1
  243. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-Q5j9iBkD.js → kanban-definition-UXKFOSKX-BJGlhVsx.js} +1 -1
  244. package/runtime/webapp/dist/assets/{layout-xVYWH0Cz.js → layout-CYTxygXU.js} +1 -1
  245. package/runtime/webapp/dist/assets/{linear-BD5xYHq0.js → linear-CzJGOwUm.js} +1 -1
  246. package/runtime/webapp/dist/assets/{list-todo-BJrNf0OF.js → list-todo-CP9DqU2D.js} +1 -1
  247. package/runtime/webapp/dist/assets/{loader-circle-BSDHoDXf.js → loader-circle-xEKTnlp3.js} +1 -1
  248. package/runtime/webapp/dist/assets/{locate-fixed-BBOLeIa6.js → locate-fixed-CfEojGOl.js} +1 -1
  249. package/runtime/webapp/dist/assets/{mermaid.core-XNny-og5.js → mermaid.core-BTbaaIjb.js} +5 -5
  250. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-CCuaFOfd.js → mindmap-definition-YA3MSWOX-eiKdbp4J.js} +1 -1
  251. package/runtime/webapp/dist/assets/{mobileViewport-Ckhq6eml.js → mobileViewport-DF1R6qR2.js} +1 -1
  252. package/runtime/webapp/dist/assets/{new-session-window-ThRZvGVK.js → new-session-window-BFILhYAe.js} +24 -24
  253. package/runtime/webapp/dist/assets/{page-DK2ooc8J.js → page-B-CkpInM.js} +3 -3
  254. package/runtime/webapp/dist/assets/{pause-BF1q8wFt.js → pause-C-ecDo3W.js} +1 -1
  255. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-Dt2wEt-q.js → pegDiagram-XKGWAZYB-BuvePvoF.js} +1 -1
  256. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-Bv5PR_0B.js → pieDiagram-E7YTZNPT-Csgh2lYE.js} +1 -1
  257. package/runtime/webapp/dist/assets/{pin-ByCe4NyB.js → pin-CjmuX5Tq.js} +1 -1
  258. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-mUp15pA4.js → quadrantDiagram-AXDQQJYC-8Bbl_RHv.js} +1 -1
  259. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-CU79-JOl.js → railroadDiagram-O6MQD6OU-CvYQkIeK.js} +1 -1
  260. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-DosZrbGa.js → requirementDiagram-BXWQKSXE-CytOuQX4.js} +1 -1
  261. package/runtime/webapp/dist/assets/{rotate-ccw-DtSpwbK7.js → rotate-ccw-HY6j6nBt.js} +1 -1
  262. package/runtime/webapp/dist/assets/{rotate-cw-DdQZP8we.js → rotate-cw-CyYR2IEw.js} +1 -1
  263. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-BWbz07Kw.js → sankeyDiagram-P5KCCOFB-BoyI7ZhF.js} +1 -1
  264. package/runtime/webapp/dist/assets/{send-CtGGbUpC.js → send-jSK0YaRl.js} +1 -1
  265. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-DeUcGtwv.js → sequenceDiagram-WJ2MYXX4-Ckvtmn2N.js} +1 -1
  266. package/runtime/webapp/dist/assets/{session-dashboard-7G2sKgmw.js → session-dashboard-B4lyuZYF.js} +1 -1
  267. package/runtime/webapp/dist/assets/{session-tree-Ck5Wp7h-.js → session-tree-CEy-pW8A.js} +1 -1
  268. package/runtime/webapp/dist/assets/{shield-check-BIxrmOwR.js → shield-check-CFebh9do.js} +1 -1
  269. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-DPrrG2Kd.js → sizeCapture-INFHLROL-yUQjHNrI.js} +1 -1
  270. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-CtlmJgrm.js → stateDiagram-D77RDMKH-Dj8oPHDB.js} +1 -1
  271. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Csg946NK.js +1 -0
  272. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-rMtOxOkm.js → swimlanes-42K2YHIH-GDjg8QNS.js} +1 -1
  273. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-BUnuRfXp.js +8 -0
  274. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-D0C5B_7F.js → timeline-definition-24CTP7MA-DFDHsxzp.js} +1 -1
  275. package/runtime/webapp/dist/assets/{trash-2-CT_MslWu.js → trash-2-BF9eI5Bh.js} +1 -1
  276. package/runtime/webapp/dist/assets/{types-pH-pRUSS.js → types-BuPq0iQM.js} +1 -1
  277. package/runtime/webapp/dist/assets/{use-session-activity-B9xAOlzA.js → use-session-activity-Ceb8OBjB.js} +1 -1
  278. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-B8iPk0Tm.js → vennDiagram-4TSXK5OY-DR5HBqo1.js} +1 -1
  279. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-Cb60IRaS.js → wardleyDiagram-VM6X3IG4-Bb6pROnE.js} +1 -1
  280. package/runtime/webapp/dist/assets/{web-D-dNOCeI.js → web-BV7fxnr4.js} +1 -1
  281. package/runtime/webapp/dist/assets/{web-DTj73nYv.js → web-C8kCU9om.js} +1 -1
  282. package/runtime/webapp/dist/assets/{x-3I6TKNBE.js → x-uSekqXJV.js} +1 -1
  283. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-DWXthhJz.js → xychartDiagram-S5SC5T6Z-CrpaVklx.js} +1 -1
  284. package/runtime/webapp/dist/assets/{zoom-out-417ojKB8.js → zoom-out-B59mGU6c.js} +1 -1
  285. package/runtime/webapp/dist/index.html +1 -1
  286. package/runtime/ws-server.mjs +9 -0
  287. package/runtime/.next/static/chunks/app/web/layout-1127176e7e88e395.js +0 -1
  288. package/runtime/.next/static/chunks/main-app-07d67f2d4e96ecb8.js +0 -1
  289. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-7sb5cs8h.mjs +0 -39
  290. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-cfz10gtb.mjs +0 -24
  291. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-p9759xd0.mjs +0 -22
  292. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rszpc155.mjs +0 -17
  293. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ttfdej7v.mjs +0 -20
  294. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y906qay4.mjs +0 -28
  295. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-yp8w8nva.mjs +0 -38
  296. package/runtime/webapp/dist/assets/App-m33SPX0n.js +0 -68
  297. package/runtime/webapp/dist/assets/TodoPage-BuDedc75.js +0 -1
  298. package/runtime/webapp/dist/assets/channel-Dz0U21-m.js +0 -1
  299. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-CL_0n_9Y.js +0 -1
  300. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-CL_0n_9Y.js +0 -1
  301. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-C9bL7Wc5.js +0 -1
  302. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-x5ntdS3v.js +0 -8
  303. /package/runtime/.next/static/{N0n_ri0ArZV5CvaOg_qnx → Ra6nQooMsDWN9-yjPL93f}/_buildManifest.js +0 -0
  304. /package/runtime/.next/static/{N0n_ri0ArZV5CvaOg_qnx → Ra6nQooMsDWN9-yjPL93f}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{7589:function(e,n,t){Promise.resolve().then(t.t.bind(t,7709,23)),Promise.resolve().then(t.t.bind(t,5613,23)),Promise.resolve().then(t.t.bind(t,6554,23)),Promise.resolve().then(t.t.bind(t,1338,23)),Promise.resolve().then(t.t.bind(t,9011,23)),Promise.resolve().then(t.t.bind(t,1573,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[37,183],function(){return n(5130),n(7589)}),_N_E=e.O()}]);
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Headscale v1 REST 最小客户端(服务端唯一实现)。
3
+ * 认证:Authorization: Bearer <api key>(headscale apikeys create 签发)。
4
+ * 官方响应包装:{user} / {preAuthKey} / {nodes:[…]};错误体可能是 {message} 或 {error}。
5
+ */
6
+
7
+ export class HeadscaleHttpError extends Error {
8
+ constructor(status, detail) {
9
+ super(`headscale API ${status}: ${detail}`);
10
+ this.status = status;
11
+ this.detail = detail;
12
+ }
13
+ }
14
+
15
+ export function createHeadscaleClient({ baseUrl, apiKey, request = fetch, timeoutMs = 15_000 }) {
16
+ const base = new URL(baseUrl).origin;
17
+
18
+ async function api(method, path, body) {
19
+ const controller = new AbortController();
20
+ const timer = setTimeout(() => controller.abort(new Error("headscale request timed out")), timeoutMs);
21
+ timer.unref?.();
22
+ try {
23
+ const response = await request(`${base}${path}`, {
24
+ method,
25
+ headers: { authorization: `Bearer ${apiKey}`, "content-type": "application/json" },
26
+ ...(body === undefined ? {} : { body: JSON.stringify(body) }),
27
+ redirect: "error",
28
+ signal: controller.signal,
29
+ });
30
+ const raw = await response.text();
31
+ if (!response.ok) {
32
+ let detail = raw.slice(0, 400);
33
+ try {
34
+ const parsed = JSON.parse(raw);
35
+ detail = typeof parsed.message === "string" ? parsed.message : typeof parsed.error === "string" ? parsed.error : detail;
36
+ } catch { /* 保留原文 */ }
37
+ throw new HeadscaleHttpError(response.status, detail);
38
+ }
39
+ return raw ? JSON.parse(raw) : {};
40
+ } finally {
41
+ clearTimeout(timer);
42
+ }
43
+ }
44
+
45
+ return {
46
+ baseUrl: base,
47
+ async getOrCreateUser(name) {
48
+ let user;
49
+ try {
50
+ user = (await api("POST", "/api/v1/user", { name })).user;
51
+ } catch (error) {
52
+ if (!(error instanceof HeadscaleHttpError) || (error.status !== 409 && !/already exists|UNIQUE constraint/i.test(error.detail))) throw error;
53
+ const result = await api("GET", `/api/v1/user?name=${encodeURIComponent(name)}`);
54
+ user = result.users?.find(candidate => candidate.name === name);
55
+ }
56
+ if (!/^[1-9][0-9]*$/.test(String(user?.id))) throw new Error("Headscale 未返回有效用户 ID");
57
+ return String(user.id);
58
+ },
59
+ async createPreAuthKey(user, { expirationSeconds = 900 } = {}) {
60
+ const expiration = new Date(Date.now() + expirationSeconds * 1000).toISOString();
61
+ const result = await api("POST", "/api/v1/preauthkey", {
62
+ user, reusable: false, ephemeral: false, expiration,
63
+ });
64
+ const key = result?.preAuthKey?.key;
65
+ if (typeof key !== "string" || !key) throw new Error("headscale preauthkey response missing key");
66
+ return { key, expiresAt: typeof result.preAuthKey.expiration === "string" ? result.preAuthKey.expiration : null };
67
+ },
68
+ async listNodes() {
69
+ const result = await api("GET", "/api/v1/node");
70
+ return (Array.isArray(result?.nodes) ? result.nodes : []).map((node) => ({
71
+ id: String(node?.id ?? ""),
72
+ name: typeof node?.name === "string" ? node.name : "",
73
+ ipAddresses: Array.isArray(node?.ipAddresses) ? node.ipAddresses : [],
74
+ user: typeof node?.user === "string" ? node.user : typeof node?.user?.name === "string" ? node.user.name : null,
75
+ })).filter((node) => node.id && node.name);
76
+ },
77
+ async deleteNode(id) {
78
+ await api("DELETE", `/api/v1/node/${encodeURIComponent(id)}`);
79
+ },
80
+ };
81
+ }
@@ -0,0 +1,168 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { isIPv4 } from "node:net";
3
+ import { HeadscaleHttpError } from "./headscale-client.mjs";
4
+ import { createMeshService } from "./mesh-service.mjs";
5
+
6
+ const LOOPBACK = new Set(["127.0.0.1", "::1", "::ffff:127.0.0.1"]);
7
+ const httpError = (status, message) => Object.assign(new Error(message), { status });
8
+
9
+ async function readJson(req) {
10
+ if (!req.headers["content-type"]?.toLowerCase().startsWith("application/json")) throw httpError(415, "JSON required");
11
+ let body = "";
12
+ for await (const chunk of req) {
13
+ body += chunk;
14
+ if (body.length > 4096) throw httpError(413, "Request too large");
15
+ }
16
+ let value;
17
+ try { value = JSON.parse(body || "{}"); } catch { throw httpError(400, "Invalid JSON"); }
18
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw httpError(400, "JSON object required");
19
+ return value;
20
+ }
21
+
22
+ function nodeName(value, fallback) {
23
+ if (value === undefined) return fallback;
24
+ if (typeof value !== "string" || !/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i.test(value)) {
25
+ throw httpError(400, "设备名只能使用字母、数字和中划线");
26
+ }
27
+ return value.toLowerCase();
28
+ }
29
+
30
+ /** The parent CLI owns the userspace daemon. Requests correlate only over private IPC. */
31
+ export function createMeshRuntimeBridge(parent = process) {
32
+ const pending = new Map();
33
+ const receive = message => {
34
+ if (message?.type === "agentroam:mesh-result") pending.get(message.id)?.(message.error);
35
+ };
36
+ const disconnect = () => {
37
+ for (const finish of pending.values()) finish("组网服务进程已断开", 503);
38
+ };
39
+ parent.on("message", receive);
40
+ parent.on("disconnect", disconnect);
41
+ return {
42
+ run(action, name) {
43
+ if (!parent.connected) throw httpError(503, "组网需要由 AgentRoam CLI 启动服务");
44
+ return new Promise((resolve, reject) => {
45
+ const id = randomUUID();
46
+ const finish = (error, status = 502) => {
47
+ clearTimeout(timer);
48
+ pending.delete(id);
49
+ if (error) reject(httpError(status, error)); else resolve();
50
+ };
51
+ const timer = setTimeout(() => finish("组网操作等待超时,请查看组网状态", 504), 120_000);
52
+ pending.set(id, finish);
53
+ try {
54
+ parent.send({ type: "agentroam:mesh-run", id, action, name }, error => {
55
+ if (error) finish("无法联系组网服务进程", 503);
56
+ });
57
+ } catch { finish("无法联系组网服务进程", 503); }
58
+ });
59
+ },
60
+ close() {
61
+ parent.off("message", receive);
62
+ parent.off("disconnect", disconnect);
63
+ disconnect();
64
+ },
65
+ };
66
+ }
67
+
68
+ export function createMeshGateway({ dataDir, env = process.env, request = fetch, serviceId, audit = () => {}, service, runtime, authenticateDesktop = () => false }) {
69
+ const mesh = service ?? createMeshService({ dataDir, env, request, serviceId });
70
+ const json = (res, status, body) => {
71
+ res.writeHead(status, { "content-type": "application/json", "cache-control": "no-store" });
72
+ res.end(JSON.stringify(body));
73
+ };
74
+
75
+ async function mintForPhone(name) {
76
+ if (!mesh.configured) throw httpError(503, "该电脑尚未配置组网控制面");
77
+ const state = await mesh.status();
78
+ if (state.phase !== "joined" || !state.dnsName) throw httpError(409, "请先让电脑加入组网");
79
+ const issued = await mesh.mintNodeKey({ nodeName: name });
80
+ return { ...issued, accessUrl: `http://${state.dnsName}` };
81
+ }
82
+
83
+ async function handleAdmin(req, res, action) {
84
+ if (!authenticateDesktop(req) || !LOOPBACK.has(req.socket?.remoteAddress) ||
85
+ Object.keys(req.headers).some(name => /^(forwarded$|x-forwarded-|x-real-ip$|cf-)/i.test(name))) {
86
+ throw httpError(403, "该操作需要本机桌面授权");
87
+ }
88
+ if (action === "nodes" && req.method === "GET") {
89
+ json(res, 200, { nodes: await mesh.listNodes() });
90
+ return;
91
+ }
92
+ if (req.method !== "POST") throw httpError(405, "Method not allowed");
93
+ const body = await readJson(req);
94
+ switch (action) {
95
+ case "key": {
96
+ if (body.device !== "desktop" && body.device !== "phone") throw httpError(400, "无效设备类型");
97
+ const name = nodeName(body.nodeName, body.device);
98
+ const issued = body.device === "phone" ? await mintForPhone(name) : await mesh.mintNodeKey({ nodeName: name });
99
+ audit("mesh.key", "desktop", "success");
100
+ json(res, 200, issued);
101
+ return;
102
+ }
103
+ case "onboard":
104
+ case "offboard":
105
+ if (!runtime) throw httpError(503, "组网服务未运行");
106
+ await runtime.run(action, nodeName(body.nodeName));
107
+ break;
108
+ case "report":
109
+ if (typeof body.tailnetIPv4 !== "string" || !isIPv4(body.tailnetIPv4) || !/^100\.(?:6[4-9]|[7-9][0-9]|1[01][0-9]|12[0-7])(?:\.\d{1,3}){2}$/.test(body.tailnetIPv4)) {
110
+ throw httpError(400, "无效的组网 IPv4 地址");
111
+ }
112
+ if (typeof body.dnsName !== "string" || !/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?\.[a-z0-9]+$/i.test(body.dnsName)) {
113
+ throw httpError(400, "无效的 MagicDNS 地址");
114
+ }
115
+ await mesh.markJoined({ hostname: nodeName(body.hostname, "desktop"), tailnetIPv4: body.tailnetIPv4,
116
+ dnsName: body.dnsName });
117
+ break;
118
+ case "error":
119
+ await mesh.markError(typeof body.message === "string" ? body.message : "组网失败");
120
+ break;
121
+ case "left": {
122
+ const state = await mesh.status();
123
+ if (state.tailnetIPv4) await mesh.removeDesktopNode(state.tailnetIPv4);
124
+ await mesh.markOffboarded();
125
+ break;
126
+ }
127
+ default:
128
+ throw httpError(404, "Unknown mesh admin action");
129
+ }
130
+ json(res, 200, await mesh.status());
131
+ }
132
+
133
+ return {
134
+ service: mesh,
135
+ async handle(req, res) {
136
+ const path = new URL(req.url || "/", "http://gateway.local").pathname;
137
+ if (!path.startsWith("/api/mesh/")) return false;
138
+ try {
139
+ const deviceId = req.headers["x-agentroam-device-id"];
140
+ if (path === "/api/mesh/status") {
141
+ if (req.method !== "GET") throw httpError(405, "Method not allowed");
142
+ if (!deviceId && !authenticateDesktop(req)) throw httpError(401, "请先完成设备配对");
143
+ json(res, 200, await mesh.status());
144
+ } else if (path === "/api/mesh/join") {
145
+ if (req.method !== "POST") throw httpError(405, "Method not allowed");
146
+ if (!deviceId) throw httpError(401, "请先完成设备配对");
147
+ const body = await readJson(req);
148
+ const issued = await mintForPhone(nodeName(body.nodeName, "phone"));
149
+ audit("mesh.join", String(deviceId), "success");
150
+ json(res, 200, issued);
151
+ } else if (path.startsWith("/api/mesh/admin/")) {
152
+ await handleAdmin(req, res, path.slice("/api/mesh/admin/".length));
153
+ } else {
154
+ throw httpError(404, "Not found");
155
+ }
156
+ } catch (error) {
157
+ if (error instanceof HeadscaleHttpError) {
158
+ json(res, 502, { error: `Headscale 请求失败(HTTP ${error.status})` });
159
+ return true;
160
+ }
161
+ const status = Number.isInteger(error?.status) && error.status >= 400 && error.status < 500 ? error.status
162
+ : [502, 503, 504].includes(error?.status) ? error.status : 502;
163
+ json(res, status, { error: status === 502 && !error.status ? "组网控制面请求失败,请检查服务日志和配置" : error.message });
164
+ }
165
+ return true;
166
+ },
167
+ };
168
+ }
@@ -0,0 +1,158 @@
1
+ import { createHash, randomBytes } from "node:crypto";
2
+ import { mkdir, readFile, writeFile, rename } from "node:fs/promises";
3
+ import { join, resolve } from "node:path";
4
+ import { createHeadscaleClient } from "./headscale-client.mjs";
5
+
6
+ /**
7
+ * Mesh 控制面装配与节点状态:
8
+ * - 控制面凭据从环境读取,不进 settings、日志和浏览器;
9
+ * - 每台安装实例使用独立的 Headscale 用户。
10
+ * - 节点状态落在 <dataDir>/mesh/state.json(CLI onboarding 写入,服务端只读)。
11
+ */
12
+ const MACHINE_ID_PATTERN = /^[a-z0-9-]{1,32}$/i;
13
+
14
+ export function meshUserFor(machineId) {
15
+ const source = typeof machineId === "string" && MACHINE_ID_PATTERN.test(machineId)
16
+ ? machineId
17
+ : createHash("sha256").update(String(machineId ?? "")).digest("hex").slice(0, 12);
18
+ return `agentroam-${source}`.slice(0, 63).toLowerCase();
19
+ }
20
+
21
+ export function createMeshService({ dataDir, env = process.env, request = fetch, serviceId = resolve(dataDir), now = () => Date.now() }) {
22
+ const controlPlaneUrl = typeof env.AGENT_HEADSCALE_URL === "string" && env.AGENT_HEADSCALE_URL.trim()
23
+ ? env.AGENT_HEADSCALE_URL.trim()
24
+ : null;
25
+ const apiKey = typeof env.AGENT_HEADSCALE_API_KEY === "string" && env.AGENT_HEADSCALE_API_KEY.trim()
26
+ ? env.AGENT_HEADSCALE_API_KEY.trim()
27
+ : null;
28
+ const credential = env.AGENTROAM_MESH_CREDENTIAL?.trim();
29
+ const statePath = join(dataDir, "mesh", "state.json");
30
+ let client = null;
31
+ let enrollmentId = null;
32
+ if (controlPlaneUrl && (apiKey || credential)) {
33
+ try {
34
+ const url = new URL(controlPlaneUrl);
35
+ const local = ["127.0.0.1", "localhost", "[::1]"].includes(url.hostname);
36
+ if ((url.protocol === "https:" || (local && url.protocol === "http:")) &&
37
+ url.pathname === "/" && !url.username && !url.password && !url.search && !url.hash) {
38
+ if (credential && !apiKey && url.protocol === "https:" && /^[A-Za-z0-9_-]{43}$/.test(credential)) {
39
+ client = createEnrollmentClient(url.origin, credential, request);
40
+ enrollmentId = createHash("sha256").update(credential).digest("hex");
41
+ } else if (apiKey && !credential) {
42
+ client = createHeadscaleClient({ baseUrl: url.origin, apiKey, request });
43
+ }
44
+ }
45
+ } catch { /* Invalid settings leave the mesh unavailable. */ }
46
+ }
47
+ const manualUser = meshUserFor(createHash("sha256").update(serviceId).digest("hex").slice(0, 24));
48
+
49
+ async function readState() {
50
+ try {
51
+ const parsed = JSON.parse(await readFile(statePath, "utf8"));
52
+ return parsed && typeof parsed === "object" ? parsed : null;
53
+ } catch { return null; }
54
+ }
55
+
56
+ async function writeState(next) {
57
+ const directory = join(dataDir, "mesh");
58
+ await mkdir(directory, { recursive: true, mode: 0o700 });
59
+ const temporary = `${statePath}.${randomBytes(8).toString("hex")}.tmp`;
60
+ await writeFile(temporary, `${JSON.stringify({ ...next, updatedAt: new Date(now()).toISOString() }, null, 2)}\n`, { mode: 0o600 });
61
+ await rename(temporary, statePath);
62
+ }
63
+
64
+ /** 对外状态:绝不含 API key 或节点密钥。 */
65
+ async function status() {
66
+ const state = await readState();
67
+ const matchingState = client && state?.controlPlaneUrl === client.baseUrl
68
+ && (state.enrollmentId ?? null) === enrollmentId ? state : null;
69
+ const dnsName = matchingState?.dnsName ?? null;
70
+ const phase = matchingState?.phase ?? (client ? "ready" : "unconfigured");
71
+ return {
72
+ configured: Boolean(client),
73
+ controlPlaneUrl: client?.baseUrl ?? null,
74
+ phase,
75
+ hostname: matchingState?.hostname ?? null,
76
+ tailnetIPv4: matchingState?.tailnetIPv4 ?? null,
77
+ dnsName,
78
+ accessUrl: phase === "joined" && dnsName ? `http://${dnsName}` : null,
79
+ user: matchingState?.user ?? null,
80
+ joinedAt: matchingState?.joinedAt ?? null,
81
+ lastError: matchingState?.lastError ?? null,
82
+ updatedAt: matchingState?.updatedAt ?? null,
83
+ };
84
+ }
85
+
86
+ function requireClient() {
87
+ if (!client) throw Object.assign(new Error("未配置 AGENT_HEADSCALE_URL / AGENT_HEADSCALE_API_KEY"), { status: 503 });
88
+ return client;
89
+ }
90
+
91
+ let activeUser = null;
92
+
93
+ return {
94
+ configured: Boolean(client),
95
+ controlPlaneUrl: client?.baseUrl ?? null,
96
+ status,
97
+ async mintNodeKey({ nodeName }) {
98
+ const headscale = requireClient();
99
+ if (enrollmentId) {
100
+ const issued = await headscale.mintNodeKey();
101
+ activeUser = issued.user;
102
+ return { ...issued, nodeName };
103
+ }
104
+ const key = await headscale.createPreAuthKey(await headscale.getOrCreateUser(manualUser));
105
+ return { loginServer: headscale.baseUrl, authkey: key.key, expiresAt: key.expiresAt, user: manualUser, nodeName };
106
+ },
107
+ async listNodes() {
108
+ const nodes = await requireClient().listNodes();
109
+ return enrollmentId ? nodes : nodes.filter(node => node.user === manualUser);
110
+ },
111
+ async markJoined({ hostname, tailnetIPv4, dnsName }) {
112
+ const current = await status();
113
+ let user = manualUser;
114
+ if (enrollmentId) user = activeUser ?? current.user ?? (await client.listNodes()).find(node => node.ipAddresses.includes(tailnetIPv4))?.user ?? null;
115
+ await writeState({ phase: "joined", controlPlaneUrl: client.baseUrl, ...(enrollmentId && { enrollmentId }), hostname, tailnetIPv4, dnsName, user,
116
+ joinedAt: current.tailnetIPv4 === tailnetIPv4 && current.joinedAt || new Date(now()).toISOString(), lastError: null });
117
+ },
118
+ async markError(message) {
119
+ const previous = await readState();
120
+ await writeState({ ...(previous ?? {}), controlPlaneUrl: client?.baseUrl, enrollmentId, phase: "error", lastError: String(message ?? "unknown error").slice(0, 500) });
121
+ },
122
+ async markOffboarded() {
123
+ await writeState({ phase: "offboarded", controlPlaneUrl: client?.baseUrl, enrollmentId, lastError: null });
124
+ },
125
+ async removeDesktopNode(tailnetIPv4) {
126
+ const nodes = await this.listNodes();
127
+ const node = nodes.find(candidate => candidate.ipAddresses.includes(tailnetIPv4));
128
+ if (node) {
129
+ try { await requireClient().deleteNode(node.id); }
130
+ catch (error) { if (error.status !== 404) throw error; }
131
+ }
132
+ },
133
+ };
134
+ }
135
+
136
+ function createEnrollmentClient(baseUrl, credential, request) {
137
+ async function api(method, path) {
138
+ const response = await request(`${baseUrl}/agentroam-enrollment/v1/${path}`, {
139
+ method, headers: { authorization: `Bearer ${credential}` },
140
+ redirect: "error", signal: AbortSignal.timeout(30_000),
141
+ });
142
+ if (!response.ok) throw new Error(`组网服务请求失败 (HTTP ${response.status})`);
143
+ return response.json();
144
+ }
145
+
146
+ return {
147
+ baseUrl,
148
+ async mintNodeKey() {
149
+ const { authkey, expiresAt, user, loginServer } = await api("POST", "node-key");
150
+ if (loginServer !== baseUrl || typeof authkey !== "string" || !authkey || !/^agentroam-invite-[a-f0-9]{24}$/.test(user)) {
151
+ throw new Error("组网服务返回无效的设备凭据");
152
+ }
153
+ return { loginServer, authkey, expiresAt, user };
154
+ },
155
+ async listNodes() { return (await api("GET", "nodes")).nodes; },
156
+ async deleteNode(id) { await api("DELETE", `nodes/${encodeURIComponent(id)}`); },
157
+ };
158
+ }
@@ -1 +1 @@
1
- {"bundleId":"com.agentroam.remote-desktop","version":"0.2.0-preview.78"}
1
+ {"bundleId":"com.agentroam.remote-desktop","version":"0.2.0-preview.79"}
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Resources/agentroam-component.json</key>
8
8
  <data>
9
- eb5H0ARpjLr8R3P/5lPpFg8ftrQ=
9
+ O5H1CAWO2hBnhvS9UEoIXbq4eMQ=
10
10
  </data>
11
11
  <key>Resources/app-icon.icns</key>
12
12
  <data>
@@ -19,7 +19,7 @@
19
19
  <dict>
20
20
  <key>hash2</key>
21
21
  <data>
22
- gBfhgAYpltsl8aWEkJJ49pmVSg0QvE6b/YosSvnp1Ak=
22
+ uSlFaRtuAr4C2AD5+t8m4xvBvYZ+a/38f91aCHS5w88=
23
23
  </data>
24
24
  </dict>
25
25
  <key>Resources/app-icon.icns</key>
@@ -4,22 +4,22 @@
4
4
  "requires": true,
5
5
  "packages": {
6
6
  "node_modules/@anthropic-ai/claude-agent-sdk": {
7
- "version": "0.3.331",
8
- "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.331.tgz",
9
- "integrity": "sha512-ml/MPqgO95tG5zcApBFxEyoDk57d9htP09R8AtPbKPUCHpsobf84IjkN4zhGvQgk8zsA9dXoeMGrQcCc8gQE/w==",
7
+ "version": "0.3.332",
8
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.332.tgz",
9
+ "integrity": "sha512-N0ejnrTLMNJYXkvhdmLEy8QSfjym2ljJCkUBCrLKesYNGgqooi8zHDHawNsi+An6zav/ImPnpi27sbRsRjfcOw==",
10
10
  "license": "SEE LICENSE IN README.md",
11
11
  "engines": {
12
12
  "node": ">=18.14.0"
13
13
  },
14
14
  "optionalDependencies": {
15
- "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.331",
16
- "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.331",
17
- "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.331",
18
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.331",
19
- "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.331",
20
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.331",
21
- "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.331",
22
- "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.331"
15
+ "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.332",
16
+ "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.332",
17
+ "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.332",
18
+ "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.332",
19
+ "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.332",
20
+ "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.332",
21
+ "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.332",
22
+ "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.332"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@anthropic-ai/sdk": ">=0.93.0",
@@ -488,9 +488,9 @@
488
488
  }
489
489
  },
490
490
  "node_modules/caniuse-lite": {
491
- "version": "1.0.30001827",
492
- "resolved": "http://nexus.17usoft.com/repository/npm-all/caniuse-lite/-/caniuse-lite-1.0.30001827.tgz",
493
- "integrity": "sha512-YWEDr46gSO81M8w6uPbaIy4++IXsirx2asUqvllNiD4BPf75ibxclUjWEqp8ObCenRv+UM2n5Y8xuRPT8V8FrQ==",
491
+ "version": "1.0.30001828",
492
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/caniuse-lite/-/caniuse-lite-1.0.30001828.tgz",
493
+ "integrity": "sha512-7MWeT+3DlrpuDybTWHl4Zb1Z80Z1fLLnOXuBjDXebzDVcqnEWUlV8JcbASg8B8BhcW8QT2UiR1KAtzYFIZHZYA==",
494
494
  "funding": [
495
495
  {
496
496
  "type": "opencollective",
@@ -887,9 +887,9 @@
887
887
  }
888
888
  },
889
889
  "node_modules/mediabunny": {
890
- "version": "1.66.3",
891
- "resolved": "http://nexus.17usoft.com/repository/npm-all/mediabunny/-/mediabunny-1.66.3.tgz",
892
- "integrity": "sha512-ugNU19umLxfjMaJLWKYUaFTWtmg+k0rwF6bmL5YfSX+BbCHGAOTxsecRzuHKX/OA+tO81pkI/2pNIo8nZdJZmA==",
890
+ "version": "1.66.4",
891
+ "resolved": "http://nexus.17usoft.com/repository/npm-all/mediabunny/-/mediabunny-1.66.4.tgz",
892
+ "integrity": "sha512-VIPwwaVpY5mUnf9mAOJlBii4P1nHK05X8//veRjJrddn514BSOuYaMrUy1UReLMVVsm85id6eMu0z5K71Kkf+g==",
893
893
  "license": "MPL-2.0",
894
894
  "workspaces": [
895
895
  ".",
@@ -40197,6 +40197,10 @@ async function acpAttachmentBlocks(attachments, localFiles) {
40197
40197
  var ACP_CLI_LABELS = { grok: "Grok CLI", agy: "Antigravity CLI" };
40198
40198
  var SESSION_TIMEOUT_MS = 45000;
40199
40199
  var CATALOG_TIMEOUT_MS = 8000;
40200
+ var GROK_SESSION_MODES = [
40201
+ { value: "default", label: "默认", description: "工具审批遵循 Grok CLI 当前规则" },
40202
+ { value: "plan", label: "计划", description: "使用 Grok 的原生计划模式" }
40203
+ ];
40200
40204
  function isoTime(value) {
40201
40205
  if (typeof value !== "string")
40202
40206
  return;
@@ -40233,6 +40237,8 @@ class AcpCliClient {
40233
40237
  questions = new Map;
40234
40238
  unsubscribe;
40235
40239
  models = [];
40240
+ modelCatalogRequest;
40241
+ sessionCloseSupported = false;
40236
40242
  imageSupported = false;
40237
40243
  embeddedContextSupported = false;
40238
40244
  disposed = false;
@@ -40289,6 +40295,7 @@ class AcpCliClient {
40289
40295
  }
40290
40296
  const capabilities = nativeRecord(result.agentCapabilities);
40291
40297
  const catalog = nativeRecord(capabilities.sessionCapabilities);
40298
+ this.sessionCloseSupported = "close" in catalog;
40292
40299
  const prompt = nativeRecord(capabilities.promptCapabilities);
40293
40300
  this.imageSupported = prompt.image === true;
40294
40301
  this.embeddedContextSupported = prompt.embeddedContext === true;
@@ -40366,12 +40373,21 @@ class AcpCliClient {
40366
40373
  if (!session?.cwd)
40367
40374
  throw new RuntimeSessionError(`${this.label} session not found`, "SESSION_NOT_FOUND");
40368
40375
  const projection = new AcpSessionProjection;
40376
+ let reportedMode;
40369
40377
  const unsubscribe = this.rpc.onNotification((method, params) => {
40370
- if (method === "session/update" && params.sessionId === id)
40371
- projection.update(nativeRecord(params.update));
40378
+ if (method !== "session/update" || params.sessionId !== id)
40379
+ return;
40380
+ const update = nativeRecord(params.update);
40381
+ if (update.sessionUpdate === "current_mode_update" && typeof update.currentModeId === "string") {
40382
+ reportedMode = update.currentModeId;
40383
+ }
40384
+ projection.update(update);
40372
40385
  });
40373
40386
  try {
40374
40387
  const config = await this.rpc.request("session/load", { sessionId: id, cwd: session.cwd, mcpServers: [] }, SESSION_TIMEOUT_MS);
40388
+ if (reportedMode !== undefined) {
40389
+ config.modes = { ...nativeRecord(config.modes), currentModeId: reportedMode };
40390
+ }
40375
40391
  projection.finishTurn();
40376
40392
  const result = { projection, config };
40377
40393
  this.residents.set(id, result);
@@ -40398,6 +40414,20 @@ class AcpCliClient {
40398
40414
  }
40399
40415
  async listModels() {
40400
40416
  await this.connect();
40417
+ if (this.models.length || !this.localFiles || !this.sessionCloseSupported)
40418
+ return this.models;
40419
+ return this.modelCatalogRequest ??= this.loadAntigravityModelCatalog(this.localFiles).finally(() => {
40420
+ this.modelCatalogRequest = undefined;
40421
+ });
40422
+ }
40423
+ async loadAntigravityModelCatalog(files) {
40424
+ const config = await this.rpc.request("session/new", { cwd: await files.root(), mcpServers: [] }, SESSION_TIMEOUT_MS);
40425
+ if (typeof config.sessionId !== "string" || !config.sessionId) {
40426
+ throw new RuntimeSessionError(`${this.label} returned no session ID`, "NATIVE_PROTOCOL_ERROR");
40427
+ }
40428
+ await this.rpc.request("session/close", { sessionId: config.sessionId }, CATALOG_TIMEOUT_MS);
40429
+ if (!this.models.length)
40430
+ this.models = acpModels(config);
40401
40431
  return this.models;
40402
40432
  }
40403
40433
  captureConfig(id, resident, config) {
@@ -40406,14 +40436,13 @@ class AcpCliClient {
40406
40436
  if (models.length)
40407
40437
  this.models = models;
40408
40438
  const session = this.sessions.get(id);
40409
- if (session)
40410
- session.nativePermissions = modeOptions(resident.config) ?? (this.agentType === "grok" ? {
40411
- currentValue: session.nativePermissions?.currentValue ?? "default",
40412
- options: [
40413
- { value: "default", label: "默认", description: "工具审批遵循 Grok CLI 当前规则" },
40414
- { value: "plan", label: "计划", description: "先规划,使用 Grok 的原生计划模式" }
40415
- ]
40416
- } : undefined);
40439
+ if (!session)
40440
+ return;
40441
+ const permissions = modeOptions(resident.config);
40442
+ session.nativePermissions = this.agentType === "grok" && !permissions?.options.length ? {
40443
+ currentValue: permissions?.currentValue ?? "default",
40444
+ options: GROK_SESSION_MODES
40445
+ } : permissions;
40417
40446
  }
40418
40447
  async setConfig(id, resident, category, value) {
40419
40448
  const selector = acpConfig(resident.config, category);
@@ -40435,7 +40464,7 @@ class AcpCliClient {
40435
40464
  if (!current?.options.some((option) => option.value === mode)) {
40436
40465
  throw new RuntimeSessionError(`${this.label} does not offer permission mode ${mode}`, "OPERATION_NOT_SUPPORTED");
40437
40466
  }
40438
- if (await this.setConfig(id, resident, "mode", mode) || current.currentValue === mode)
40467
+ if (await this.setConfig(id, resident, "mode", mode) || nativeRecord(resident.config.modes).currentModeId === mode)
40439
40468
  return;
40440
40469
  await this.rpc.request("session/set_mode", { sessionId: id, modeId: mode });
40441
40470
  this.captureConfig(id, resident, { modes: {
@@ -43824,15 +43853,16 @@ class NativeRuntimeBrokerHost {
43824
43853
  return this.runtime.mutateNativeGoal(sessionId, parseNativeGoalMutation(mutation));
43825
43854
  }
43826
43855
  setPermissionMode(sessionId, permissionMode) {
43827
- if (decodeNativeSessionId(sessionId).agentType === "deepseek-harness") {
43828
- throw new RuntimeSessionError("DeepSeek Harness uses its native permission presets", "OPERATION_NOT_SUPPORTED");
43856
+ const { agentType, nativeSessionId } = decodeNativeSessionId(sessionId);
43857
+ if (agentType === "deepseek-harness" || agentType === "grok" || agentType === "agy") {
43858
+ throw new RuntimeSessionError(`${agentType} uses its native permission presets`, "OPERATION_NOT_SUPPORTED");
43829
43859
  }
43830
43860
  const run = this.state.activeRun(sessionId);
43831
43861
  const mode = this.state.setPermissionMode(sessionId, permissionMode);
43832
43862
  const base = {
43833
43863
  id: sessionId,
43834
- agentType: decodeNativeSessionId(sessionId).agentType,
43835
- nativeSessionId: decodeNativeSessionId(sessionId).nativeSessionId,
43864
+ agentType,
43865
+ nativeSessionId,
43836
43866
  title: "Native session",
43837
43867
  cwd: "",
43838
43868
  created: new Date().toISOString(),
@@ -52315,4 +52345,4 @@ export {
52315
52345
  AcpCliRuntimeAdapter
52316
52346
  };
52317
52347
 
52318
- //# debugId=96D21DECFC76D47664756E2164756E21
52348
+ //# debugId=29C7AAB993648CEE64756E2164756E21