@sleep2agi/agent-network-dashboard 0.4.6-preview.31 → 0.4.6-preview.310
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +41 -41
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +12 -12
- package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +7 -7
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin.html +2 -2
- package/.next/server/app/admin.rsc +14 -14
- package/.next/server/app/admin.segments/_full.segment.rsc +14 -14
- package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
- package/.next/server/app/admin.segments/_index.segment.rsc +7 -7
- package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +14 -14
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +7 -7
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +2 -2
- package/.next/server/app/login.rsc +14 -14
- package/.next/server/app/login.segments/_full.segment.rsc +14 -14
- package/.next/server/app/login.segments/_head.segment.rsc +4 -4
- package/.next/server/app/login.segments/_index.segment.rsc +7 -7
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/login.segments/login.segment.rsc +3 -3
- package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/logs.html +2 -2
- package/.next/server/app/logs.rsc +14 -14
- package/.next/server/app/logs.segments/_full.segment.rsc +14 -14
- package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/logs.segments/_index.segment.rsc +7 -7
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
- package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
- package/.next/server/app/messages.html +2 -2
- package/.next/server/app/messages.rsc +14 -14
- package/.next/server/app/messages.segments/_full.segment.rsc +14 -14
- package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
- package/.next/server/app/messages.segments/_index.segment.rsc +7 -7
- package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
- package/.next/server/app/node/page_client-reference-manifest.js +1 -1
- package/.next/server/app/node.html +2 -2
- package/.next/server/app/node.rsc +14 -14
- package/.next/server/app/node.segments/_full.segment.rsc +14 -14
- package/.next/server/app/node.segments/_head.segment.rsc +4 -4
- package/.next/server/app/node.segments/_index.segment.rsc +7 -7
- package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/node.segments/node.segment.rsc +3 -3
- package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/nodes.html +2 -2
- package/.next/server/app/nodes.rsc +14 -14
- package/.next/server/app/nodes.segments/_full.segment.rsc +14 -14
- package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/_index.segment.rsc +7 -7
- package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs.html +2 -2
- package/.next/server/app/server-logs.rsc +14 -14
- package/.next/server/app/server-logs.segments/_full.segment.rsc +14 -14
- package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/_index.segment.rsc +7 -7
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
- package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/networks.html +2 -2
- package/.next/server/app/settings/networks.rsc +14 -14
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
- package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens.html +2 -2
- package/.next/server/app/settings/tokens.rsc +14 -14
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
- package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings.html +2 -2
- package/.next/server/app/settings.rsc +14 -14
- package/.next/server/app/settings.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks.html +2 -2
- package/.next/server/app/tasks.rsc +14 -14
- package/.next/server/app/tasks.segments/_full.segment.rsc +14 -14
- package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/_index.segment.rsc +7 -7
- package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js +4 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0-mpa_947ipeq.js +1 -0
- package/.next/static/chunks/01lmbsd37fybu.js +1 -0
- package/.next/static/chunks/03o.h6kvmw4l_.js +1 -0
- package/.next/static/chunks/03~~oirxz7~vc.js +1 -0
- package/.next/static/chunks/05uk96gc~9mni.js +1 -0
- package/.next/static/chunks/08kf-.bgs10ze.js +1 -0
- package/.next/static/chunks/0ggj5ummw2a84.js +7 -0
- package/.next/static/chunks/0glmrdj9112tc.js +7 -0
- package/.next/static/chunks/0o40uf-rn28q6.js +1 -0
- package/.next/static/chunks/0q3hr1~viwzkt.js +4 -0
- package/.next/static/chunks/0rxrez_cjn.eh.js +1 -0
- package/.next/static/chunks/0x8x.29hkju5a.js +1 -0
- package/.next/static/chunks/0~ks9b48lw8hx.css +2 -0
- package/.next/static/chunks/13lvf-h-j8bmc.js +1 -0
- package/.next/static/chunks/174re5ar~kxne.js +1 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/app/components/ChatPopover.tsx +38 -2
- package/app/components/CommandPalette.tsx +107 -0
- package/app/components/HelpOverlay.tsx +126 -0
- package/app/components/TopoGraph.tsx +5927 -258
- package/app/components/utils.ts +8 -7
- package/app/globals.css +110 -5
- package/app/lib/time.ts +36 -0
- package/app/lib/vendorIdentity.ts +14 -3
- package/package.json +2 -2
- package/public/sleep2agi-logo.svg +11 -0
- package/public/vendors/claude.svg +11 -0
- package/public/vendors/minimax.svg +11 -0
- package/public/vendors/openai.svg +12 -0
- package/screenshots/r293-p0/after-full.png +0 -0
- package/screenshots/r293-p0/after-topo.png +0 -0
- package/screenshots/r293-p0/baseline-full.png +0 -0
- package/screenshots/r293-p0/baseline-topo.png +0 -0
- package/screenshots/r293-p0/logo-integrated-full.png +0 -0
- package/screenshots/r293-p0/logo-integrated-topo.png +0 -0
- package/scripts/help-overlay-topo-test.mjs +44 -0
- package/scripts/p0-topo-screenshot.mjs +82 -0
- package/scripts/topo-active-filter-pill-test.mjs +101 -0
- package/scripts/topo-active-links-chip-hover-test.mjs +103 -0
- package/scripts/topo-active-links-chip-nav-test.mjs +117 -0
- package/scripts/topo-active-links-chip-self-hover-test.mjs +171 -0
- package/scripts/topo-active-links-chip-test.mjs +73 -0
- package/scripts/topo-active-links-empty-recede-test.mjs +125 -0
- package/scripts/topo-active-links-freshness-test.mjs +113 -0
- package/scripts/topo-active-links-tooltip-test.mjs +79 -0
- package/scripts/topo-active-pulse-ease-test.mjs +120 -0
- package/scripts/topo-auto-fit-test.mjs +73 -0
- package/scripts/topo-brand-watermark-test.mjs +97 -0
- package/scripts/topo-canvas-aria-test.mjs +108 -0
- package/scripts/topo-chat-target-breath-test.mjs +84 -0
- package/scripts/topo-chat-target-ring-ease-test.mjs +82 -0
- package/scripts/topo-chat-target-ring-fade-test.mjs +124 -0
- package/scripts/topo-chip-empty-recede-test.mjs +116 -0
- package/scripts/topo-chip-focus-test.mjs +95 -0
- package/scripts/topo-chip-pin-mirror-test.mjs +113 -0
- package/scripts/topo-chip-row-semantic-gap-test.mjs +97 -0
- package/scripts/topo-chip-row-tabular-test.mjs +111 -0
- package/scripts/topo-chrome-a11y-test.mjs +107 -0
- package/scripts/topo-chrome-icon-stroke-test.mjs +95 -0
- package/scripts/topo-chrome-pop-extension-test.mjs +98 -0
- package/scripts/topo-chrome-pop-nodesize-test.mjs +88 -0
- package/scripts/topo-chrome-press-state-test.mjs +135 -0
- package/scripts/topo-chrome-strip-semantic-gap-test.mjs +99 -0
- package/scripts/topo-chrome-strip-theme-ease-test.mjs +99 -0
- package/scripts/topo-chrome-zoom-level-pop-test.mjs +122 -0
- package/scripts/topo-chrome-zoom-pop-test.mjs +130 -0
- package/scripts/topo-click-ripple-ease-test.mjs +94 -0
- package/scripts/topo-cmdk-edge-clear-test.mjs +109 -0
- package/scripts/topo-cmdk-layout-view-test.mjs +108 -0
- package/scripts/topo-cmdk-pin-test.mjs +123 -0
- package/scripts/topo-cmdk-vendor-clear-test.mjs +133 -0
- package/scripts/topo-cmdk-vendor-pin-test.mjs +103 -0
- package/scripts/topo-corner-radius-unify-test.mjs +103 -0
- package/scripts/topo-cwd-tooltip-test.mjs +64 -0
- package/scripts/topo-dblclick-reset-test.mjs +74 -0
- package/scripts/topo-dense-alias-fill-transition-test.mjs +133 -0
- package/scripts/topo-discrete-zoom-smooth-test.mjs +125 -0
- package/scripts/topo-edge-badge-click-pin-test.mjs +94 -0
- package/scripts/topo-edge-badge-crossfade-test.mjs +138 -0
- package/scripts/topo-edge-badge-hot-test.mjs +115 -0
- package/scripts/topo-edge-badge-hover-test.mjs +85 -0
- package/scripts/topo-edge-badge-lift-test.mjs +150 -0
- package/scripts/topo-edge-badge-ripple-test.mjs +111 -0
- package/scripts/topo-edge-badge-stroke-transition-test.mjs +118 -0
- package/scripts/topo-edge-badge-text-pin-test.mjs +121 -0
- package/scripts/topo-edge-badge-theme-ease-test.mjs +89 -0
- package/scripts/topo-edge-count-badge-test.mjs +86 -0
- package/scripts/topo-edge-endpoint-highlight-test.mjs +111 -0
- package/scripts/topo-edge-fadein-test.mjs +106 -0
- package/scripts/topo-edge-focus-test.mjs +113 -0
- package/scripts/topo-edge-hover-test.mjs +93 -0
- package/scripts/topo-edge-pill-hot-test.mjs +129 -0
- package/scripts/topo-edge-pill-test.mjs +105 -0
- package/scripts/topo-edge-ping-pulse-retired-test.mjs +119 -0
- package/scripts/topo-edge-stroke-ease-test.mjs +100 -0
- package/scripts/topo-edge-stroke-transition-test.mjs +132 -0
- package/scripts/topo-edge-tooltip-test.mjs +70 -0
- package/scripts/topo-empty-state-breath-test.mjs +150 -0
- package/scripts/topo-empty-state-crossfade-test.mjs +130 -0
- package/scripts/topo-empty-state-recenter-test.mjs +107 -0
- package/scripts/topo-endpoint-ring-fade-test.mjs +132 -0
- package/scripts/topo-endpoint-ring-test.mjs +93 -0
- package/scripts/topo-endpoint-ring-thicken-test.mjs +112 -0
- package/scripts/topo-esc-clears-pin-test.mjs +98 -0
- package/scripts/topo-filter-pill-aliases-test.mjs +121 -0
- package/scripts/topo-filter-pill-body-click-test.mjs +112 -0
- package/scripts/topo-filter-pill-count-test.mjs +110 -0
- package/scripts/topo-filter-pill-mobile-test.mjs +90 -0
- package/scripts/topo-fit-key-test.mjs +106 -0
- package/scripts/topo-freshness-chip-test.mjs +74 -0
- package/scripts/topo-freshness-chip-transition-test.mjs +80 -0
- package/scripts/topo-freshness-conditional-render-test.mjs +92 -0
- package/scripts/topo-fullscreen-active-test.mjs +115 -0
- package/scripts/topo-group-box-pinned-state-test.mjs +95 -0
- package/scripts/topo-group-count-test.mjs +6 -1
- package/scripts/topo-group-label-a11y-test.mjs +113 -0
- package/scripts/topo-group-label-count-inherit-test.mjs +99 -0
- package/scripts/topo-group-label-hover-test.mjs +119 -0
- package/scripts/topo-group-label-pin-spacing-test.mjs +136 -0
- package/scripts/topo-group-label-tint-test.mjs +99 -0
- package/scripts/topo-group-label-title-test.mjs +83 -0
- package/scripts/topo-group-pin-test.mjs +119 -0
- package/scripts/topo-group-pip-fadein-test.mjs +100 -0
- package/scripts/topo-group-pip-tabular-test.mjs +95 -0
- package/scripts/topo-group-status-pips-test.mjs +103 -0
- package/scripts/topo-groupbox-fadein-test.mjs +95 -0
- package/scripts/topo-groupbox-hover-lift-test.mjs +127 -0
- package/scripts/topo-groupbox-hubcore-ease-test.mjs +106 -0
- package/scripts/topo-groupbox-live-test.mjs +100 -0
- package/scripts/topo-groupbox-march-busyness-test.mjs +155 -0
- package/scripts/topo-groupbox-test.mjs +4 -2
- package/scripts/topo-help-overlay-r109-test.mjs +67 -0
- package/scripts/topo-help-overlay-r118-test.mjs +69 -0
- package/scripts/topo-help-overlay-r123-test.mjs +69 -0
- package/scripts/topo-help-overlay-r134-test.mjs +74 -0
- package/scripts/topo-help-overlay-r137-test.mjs +81 -0
- package/scripts/topo-help-overlay-r141-test.mjs +86 -0
- package/scripts/topo-help-overlay-r153-test.mjs +85 -0
- package/scripts/topo-help-overlay-r59-test.mjs +67 -0
- package/scripts/topo-help-overlay-r65-test.mjs +64 -0
- package/scripts/topo-help-overlay-r70-test.mjs +63 -0
- package/scripts/topo-help-overlay-r78-test.mjs +59 -0
- package/scripts/topo-help-overlay-r81-test.mjs +58 -0
- package/scripts/topo-help-overlay-r87-test.mjs +64 -0
- package/scripts/topo-help-overlay-r91-test.mjs +65 -0
- package/scripts/topo-hot-tail-crossfade-test.mjs +117 -0
- package/scripts/topo-html-overlay-padding-unify-test.mjs +120 -0
- package/scripts/topo-hub-a11y-test.mjs +112 -0
- package/scripts/topo-hub-busyness-test.mjs +100 -0
- package/scripts/topo-hub-center-crossfade-test.mjs +124 -0
- package/scripts/topo-hub-click-fit-test.mjs +137 -0
- package/scripts/topo-hub-digit-scale-test.mjs +129 -0
- package/scripts/topo-hub-fadein-test.mjs +88 -0
- package/scripts/topo-hub-hover-lift-test.mjs +101 -0
- package/scripts/topo-hub-hover-ring-test.mjs +82 -0
- package/scripts/topo-hub-pip-theme-ease-test.mjs +116 -0
- package/scripts/topo-hub-spoke-ease-test.mjs +120 -0
- package/scripts/topo-hub-title-test.mjs +93 -0
- package/scripts/topo-hub-working-count-test.mjs +99 -0
- package/scripts/topo-ingroup-edge-test.mjs +103 -0
- package/scripts/topo-inner-radar-ring-retired-test.mjs +89 -0
- package/scripts/topo-kicker-color-test.mjs +93 -0
- package/scripts/topo-kicker-tracking-test.mjs +101 -0
- package/scripts/topo-label-card-theme-ease-test.mjs +85 -0
- package/scripts/topo-label-lift-test.mjs +119 -0
- package/scripts/topo-lastseen-tooltip-test.mjs +59 -0
- package/scripts/topo-layout-hover-text-preview-test.mjs +101 -0
- package/scripts/topo-layout-key-test.mjs +91 -0
- package/scripts/topo-layout-switch-crossfade-test.mjs +126 -0
- package/scripts/topo-layout-toggle-border-unify-test.mjs +104 -0
- package/scripts/topo-layout-toggle-test.mjs +131 -0
- package/scripts/topo-legend-compress-test.mjs +107 -0
- package/scripts/topo-legend-count-empty-test.mjs +126 -0
- package/scripts/topo-legend-count-tabular-parity-test.mjs +90 -0
- package/scripts/topo-legend-count-tabular-test.mjs +87 -0
- package/scripts/topo-legend-count-test.mjs +88 -0
- package/scripts/topo-legend-count-tier-fill-test.mjs +121 -0
- package/scripts/topo-legend-header-symmetric-inset-test.mjs +112 -0
- package/scripts/topo-legend-hitbox-swatch-center-test.mjs +93 -0
- package/scripts/topo-legend-hover-test.mjs +113 -0
- package/scripts/topo-legend-offline-delimiter-test.mjs +84 -0
- package/scripts/topo-legend-panel-header-test.mjs +83 -0
- package/scripts/topo-legend-pin-ring-fade-test.mjs +112 -0
- package/scripts/topo-legend-pin-test.mjs +128 -0
- package/scripts/topo-legend-row-hover-lift-test.mjs +109 -0
- package/scripts/topo-legend-row-pin-spacing-test.mjs +124 -0
- package/scripts/topo-legend-row-tint-test.mjs +95 -0
- package/scripts/topo-legend-row-title-test.mjs +102 -0
- package/scripts/topo-legend-swatch-grow-test.mjs +116 -0
- package/scripts/topo-legend-swatch-radius-test.mjs +78 -0
- package/scripts/topo-minimap-a11y-test.mjs +101 -0
- package/scripts/topo-minimap-dot-transition-test.mjs +113 -0
- package/scripts/topo-minimap-rect-stroke-test.mjs +94 -0
- package/scripts/topo-minimap-test.mjs +68 -0
- package/scripts/topo-minimap-viewport-smooth-test.mjs +124 -0
- package/scripts/topo-mobile-chips-test.mjs +103 -0
- package/scripts/topo-monogram-font-test.mjs +112 -0
- package/scripts/topo-monogram-stroke-test.mjs +101 -0
- package/scripts/topo-node-a11y-test.mjs +107 -0
- package/scripts/topo-node-hover-lift-test.mjs +85 -0
- package/scripts/topo-node-label-card-elevation-test.mjs +157 -0
- package/scripts/topo-node-label-card-stroke-test.mjs +135 -0
- package/scripts/topo-node-stroke-transition-test.mjs +103 -0
- package/scripts/topo-node-text-fill-transition-test.mjs +119 -0
- package/scripts/topo-node-title-peers-test.mjs +107 -0
- package/scripts/topo-node-title-test.mjs +101 -0
- package/scripts/topo-nodesize-active-hover-test.mjs +109 -0
- package/scripts/topo-nodesize-crossfade-test.mjs +141 -0
- package/scripts/topo-online-chip-nav-test.mjs +143 -0
- package/scripts/topo-orbit-particles-retired-test.mjs +91 -0
- package/scripts/topo-overlap-test.mjs +32 -5
- package/scripts/topo-panel-elevation-test.mjs +76 -0
- package/scripts/topo-panel-fadein-test.mjs +102 -0
- package/scripts/topo-panel-hot-tail-fade-test.mjs +132 -0
- package/scripts/topo-panel-hover-elevation-test.mjs +118 -0
- package/scripts/topo-panel-theme-ease-test.mjs +85 -0
- package/scripts/topo-panel-title-fill-ease-test.mjs +91 -0
- package/scripts/topo-particle-stagger-test.mjs +82 -0
- package/scripts/topo-pin-intersection-color-ease-test.mjs +111 -0
- package/scripts/topo-pin-intersection-empty-test.mjs +129 -0
- package/scripts/topo-pin-intersection-tabular-test.mjs +96 -0
- package/scripts/topo-pin-intersection-test.mjs +121 -0
- package/scripts/topo-pin-intersection-warning-crossfade-test.mjs +107 -0
- package/scripts/topo-pin-mirror-transition-test.mjs +101 -0
- package/scripts/topo-pin-persistence-test.mjs +105 -0
- package/scripts/topo-popover-meta-test.mjs +78 -0
- package/scripts/topo-prepublish-guard-test.mjs +95 -0
- package/scripts/topo-pressure-bar-test.mjs +69 -0
- package/scripts/topo-pressure-hover-test.mjs +123 -0
- package/scripts/topo-pressure-pin-test.mjs +119 -0
- package/scripts/topo-pressure-seg-self-hover-test.mjs +126 -0
- package/scripts/topo-pressure-seg-tooltip-test.mjs +98 -0
- package/scripts/topo-pressure-seg-transition-test.mjs +107 -0
- package/scripts/topo-pulse-dot-crossfade-test.mjs +122 -0
- package/scripts/topo-pulse-dot-retired-test.mjs +86 -0
- package/scripts/topo-pulse-rate-test.mjs +71 -0
- package/scripts/topo-recent-panel-count-freshness-test.mjs +109 -0
- package/scripts/topo-recent-panel-count-test.mjs +72 -0
- package/scripts/topo-recent-panel-footer-breath-test.mjs +142 -0
- package/scripts/topo-recent-panel-hot-header-test.mjs +132 -0
- package/scripts/topo-recent-panel-more-crossfade-test.mjs +124 -0
- package/scripts/topo-recent-panel-more-cyan-hover-test.mjs +151 -0
- package/scripts/topo-recent-panel-more-nav-test.mjs +127 -0
- package/scripts/topo-recent-panel-more-test.mjs +106 -0
- package/scripts/topo-recent-panel-readability-bump-test.mjs +151 -0
- package/scripts/topo-recent-row-count-fill-test.mjs +129 -0
- package/scripts/topo-recent-row-fadein-test.mjs +107 -0
- package/scripts/topo-recent-row-freshness-test.mjs +102 -0
- package/scripts/topo-recent-row-hot-test.mjs +110 -0
- package/scripts/topo-recent-row-hover-lift-test.mjs +128 -0
- package/scripts/topo-recent-row-hover-test.mjs +122 -0
- package/scripts/topo-recent-row-pin-spacing-test.mjs +137 -0
- package/scripts/topo-recent-row-pin-test.mjs +126 -0
- package/scripts/topo-recent-row-tint-test.mjs +91 -0
- package/scripts/topo-recent-row-title-test.mjs +112 -0
- package/scripts/topo-recent-row-ts-alpha-test.mjs +100 -0
- package/scripts/topo-recent-row-ts-test.mjs +95 -0
- package/scripts/topo-recent-row-typography-test.mjs +119 -0
- package/scripts/topo-recent-signal-empty-hint-test.mjs +73 -0
- package/scripts/topo-recent-signal-empty-test.mjs +63 -0
- package/scripts/topo-reduced-motion-test.mjs +77 -0
- package/scripts/topo-reset-spin-test.mjs +120 -0
- package/scripts/topo-runtime-badge-grow-test.mjs +114 -0
- package/scripts/topo-spokes-retired-test.mjs +93 -0
- package/scripts/topo-starfield-density-test.mjs +89 -0
- package/scripts/topo-status-chip-hover-test.mjs +101 -0
- package/scripts/topo-status-chip-tooltip-test.mjs +95 -0
- package/scripts/topo-statusbar-chips-self-hover-test.mjs +177 -0
- package/scripts/topo-svg-focus-test.mjs +112 -0
- package/scripts/topo-sweep-busyness-test.mjs +94 -0
- package/scripts/topo-tabular-nums-sweep-test.mjs +93 -0
- package/scripts/topo-tier-ring-fadein-test.mjs +107 -0
- package/scripts/topo-tier-ring-occupancy-test.mjs +87 -0
- package/scripts/topo-tier-ring-test.mjs +69 -0
- package/scripts/topo-tier-ring-tint-test.mjs +110 -0
- package/scripts/topo-tier-stagger-test.mjs +89 -0
- package/scripts/topo-title-block-tight-leading-test.mjs +95 -0
- package/scripts/topo-title-tracking-test.mjs +98 -0
- package/scripts/topo-toggle-inactive-cyan-hover-test.mjs +110 -0
- package/scripts/topo-top-rail-theme-ease-test.mjs +89 -0
- package/scripts/topo-tz-ghost-test.mjs +69 -0
- package/scripts/topo-vendor-chip-hover-test.mjs +111 -0
- package/scripts/topo-vendor-chip-self-hover-test.mjs +131 -0
- package/scripts/topo-vendor-chip-tabular-test.mjs +92 -0
- package/scripts/topo-vendor-chip-threshold-test.mjs +78 -0
- package/scripts/topo-vendor-letter-tooltip-test.mjs +92 -0
- package/scripts/topo-vendor-pill-test.mjs +125 -0
- package/scripts/topo-vendor-pin-test.mjs +125 -0
- package/scripts/topo-view-smooth-test.mjs +131 -0
- package/scripts/topo-watermark-tracking-test.mjs +99 -0
- package/scripts/topo-working-chip-pin-test.mjs +154 -0
- package/scripts/topo-working-halo-breath-retired-test.mjs +99 -0
- package/scripts/topo-wrapper-flow-arrow-theme-test.mjs +97 -0
- package/scripts/topo-wrapper-shadow-theme-ease-test.mjs +89 -0
- package/.next/static/chunks/0-7iowzu4.798.js +0 -1
- package/.next/static/chunks/01u5zo8b7r_r3.js +0 -1
- package/.next/static/chunks/02t5jr4shh.hy.js +0 -1
- package/.next/static/chunks/09nd.t_hd.y6t.css +0 -2
- package/.next/static/chunks/0_qfg5s5uzs7..js +0 -7
- package/.next/static/chunks/0elalb9n_.~di.js +0 -1
- package/.next/static/chunks/0fqit.b4j_6rz.js +0 -1
- package/.next/static/chunks/0j_q__o8p6g83.js +0 -1
- package/.next/static/chunks/0jl6_w50zh4l5.js +0 -1
- package/.next/static/chunks/0pl7l_.2im.j0.js +0 -7
- package/.next/static/chunks/0qcfcgdthhos6.js +0 -1
- package/.next/static/chunks/0r4q73.-1bkyl.js +0 -1
- package/.next/static/chunks/0r_c8eccg3z2o.js +0 -1
- package/.next/static/chunks/10oi7l-tycgl9.js +0 -1
- package/.next/static/chunks/11uk1izuv3~0t.js +0 -1
- /package/.next/static/{mgs4E0Fu2JlZsA5DB0XUu → Kkkh4U0z1GCAKfQMsfmjt}/_buildManifest.js +0 -0
- /package/.next/static/{mgs4E0Fu2JlZsA5DB0XUu → Kkkh4U0z1GCAKfQMsfmjt}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{mgs4E0Fu2JlZsA5DB0XUu → Kkkh4U0z1GCAKfQMsfmjt}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,136,(e,t,a)=>{},7454,(e,t,a)=>{var r=e.i(20888);e.r(136);var s=e.r(23910),n=s&&"object"==typeof s&&"default"in s?s:{default:s},l=void 0!==r.default&&r.default.env&&!0,i=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,a=t.name,r=void 0===a?"stylesheet":a,s=t.optimizeForSpeed,n=void 0===s?l:s;d(i(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",d("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,a=e.prototype;return a.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},a.isOptimizeForSpeed=function(){return this._optimizeForSpeed},a.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,a){return"number"==typeof a?e._serverSheet.cssRules[a]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),a},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},a.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},a.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},a.insertRule=function(e,t){if(d(i(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var a=this.getSheet();"number"!=typeof t&&(t=a.cssRules.length);try{a.insertRule(e,t)}catch(t){return l||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},a.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var a="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!a.cssRules[e])return e;a.deleteRule(e);try{a.insertRule(t,e)}catch(r){l||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),a.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];d(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},a.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},a.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},a.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,a){return a?t=t.concat(Array.prototype.map.call(e.getSheetForTag(a).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},a.makeStyleTag=function(e,t,a){t&&d(i(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var s=document.head||document.getElementsByTagName("head")[0];return a?s.insertBefore(r,a):s.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function d(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var c=function(e){for(var t=5381,a=e.length;a;)t=33*t^e.charCodeAt(--a);return t>>>0},h={};function x(e,t){if(!t)return"jsx-"+e;var a=String(t),r=e+a;return h[r]||(h[r]="jsx-"+c(e+"-"+a)),h[r]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var a=e+t;return h[a]||(h[a]=t.replace(/__jsx-style-dynamic-selector/g,e)),h[a]}var m=function(){function e(e){var t=void 0===e?{}:e,a=t.styleSheet,r=void 0===a?null:a,s=t.optimizeForSpeed,n=void 0!==s&&s;this._sheet=r||new o({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),r&&"boolean"==typeof n&&(this._sheet.setOptimizeForSpeed(n),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var a=this.getIdAndRules(e),r=a.styleId,s=a.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var n=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=n,this._instancesCounts[r]=1},t.remove=function(e){var t=this,a=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(a in this._instancesCounts,"styleId: `"+a+"` not found"),this._instancesCounts[a]-=1,this._instancesCounts[a]<1){var r=this._fromServer&&this._fromServer[a];r?(r.parentNode.removeChild(r),delete this._fromServer[a]):(this._indices[a].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[a]),delete this._instancesCounts[a]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],a=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return a[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,a;return t=this.cssRules(),void 0===(a=e)&&(a={}),t.map(function(e){var t=e[0],r=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:a.nonce?a.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,a=e.dynamic,r=e.id;if(a){var s=x(r,a);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return u(s,e)}):[u(s,t)]}}return{styleId:x(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),f=s.createContext(null);function p(){return new m}function g(){return s.useContext(f)}f.displayName="StyleSheetContext";var y=n.default.useInsertionEffect||n.default.useLayoutEffect,b="u">typeof window?p():void 0;function v(e){var t=b||g();return t&&("u"<typeof window?t.add(e):y(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return x(e[0],e[1])}).join(" ")},a.StyleRegistry=function(e){var t=e.registry,a=e.children,r=s.useContext(f),l=s.useState(function(){return r||t||p()})[0];return n.default.createElement(f.Provider,{value:l},a)},a.createStyleRegistry=p,a.style=v,a.useStyleRegistry=g},6694,(e,t,a)=>{t.exports=e.r(7454).style},18722,e=>{"use strict";var t=e.i(20888),a=e.i(22381),r=e.i(23910),s=e.i(56839),n=e.i(3479);function l({online:e,working:t,total:r,version:s,uptime:n}){let o=r>0?Math.round(e/r*100):0,d=0===r;return(0,a.jsxs)("div",{className:d?"mb-4":"mb-8",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"Agent Network"}),(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["CommHub ",s," · ",n]})]}),d?(0,a.jsxs)("div",{className:"anet-stat-strip flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-gray-500 border-t border-b border-[#2a2a4a] py-2",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,a.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," online"]}),(0,a.jsx)("span",{className:"text-gray-700",children:"·"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,a.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," working"]}),(0,a.jsx)("span",{className:"text-gray-700",children:"·"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,a.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," registered"]})]}):(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,a.jsx)(i,{value:e,label:"Online",sub:`${o}% of fleet`,color:"text-green-400",accent:"from-green-500/20 to-green-500/0",border:"border-green-500/15"}),(0,a.jsx)(i,{value:t,label:"Working",sub:e>0?`${Math.round(t/e*100)}% utilization`:"--",color:"text-cyan-400",accent:"from-cyan-500/20 to-cyan-500/0",border:"border-cyan-500/15"}),(0,a.jsx)(i,{value:r-e,label:"Offline",sub:r-e==0?"All systems go":`${r-e} disconnected`,color:"text-gray-400",accent:"from-gray-500/10 to-gray-500/0",border:"border-gray-500/15"}),(0,a.jsx)(i,{value:r,label:"Total",sub:"Registered nodes",color:"text-white",accent:"from-blue-500/15 to-blue-500/0",border:"border-blue-500/15"})]})]})}function i({value:e,label:t,sub:r,color:s,accent:n,border:l}){let o=s.replace("text-","").split("-")[0];return(0,a.jsxs)("div",{"data-anet-stat-card":o,className:`anet-stat-card relative overflow-hidden rounded-xl border ${l} bg-[#111128] px-4 py-3 transition-all`,children:[(0,a.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${n} pointer-events-none`}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:`text-3xl font-bold ${s} tabular-nums leading-tight`,children:e}),(0,a.jsx)("div",{className:"text-sm text-gray-300 mt-0.5",children:t}),(0,a.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:r})]})]})}function o(){let[e,t]=(0,r.useState)(""),[s,n]=(0,r.useState)(!1),[l,i]=(0,r.useState)(""),o=async()=>{if(e.trim()){n(!0),i("");try{let a=await fetch("/api/hub/broadcast",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}),r=await a.json();r.ok?(i(`Broadcast sent to ${r.recipients} node(s)`),t("")):i(`Failed: ${r.error||"Send error"}`)}catch(e){i(`Failed: ${e instanceof Error?e.message:"Send error"}`)}n(!1),setTimeout(()=>i(""),5e3)}};return(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"Broadcast message to all online agents...",maxLength:500,"aria-label":"Broadcast message",className:"flex-1 bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:ring-1 focus:ring-blue-500/20 focus:outline-none transition-colors"}),(0,a.jsx)("button",{onClick:o,disabled:s||!e.trim(),"aria-label":"Send broadcast",className:"flex items-center gap-2 px-5 py-2.5 bg-blue-600 hover:bg-blue-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-all font-medium cursor-pointer disabled:cursor-not-allowed",children:s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,a.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,a.jsx)("span",{children:"Sending…"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M3 11v3a1 1 0 0 0 1 1h2l3.29 3.29a1 1 0 0 0 1.71-.71V7.42a1 1 0 0 0-1.71-.71L6 10H4a1 1 0 0 0-1 1Z"}),(0,a.jsx)("path",{d:"M16 8a5 5 0 0 1 0 6",opacity:"0.7"}),(0,a.jsx)("path",{d:"M19 5a9 9 0 0 1 0 12",opacity:"0.45"})]}),(0,a.jsx)("span",{children:"Broadcast"})]})})]}),e.length>0&&(0,a.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1 tabular-nums",children:[e.length,"/500"]}),l&&(0,a.jsx)("div",{className:`mt-3 text-sm text-center anet-fade-in ${l.startsWith("Failed")?"text-red-400":"text-green-400/80"}`,children:l})]})}var d=e.i(46228),c=e.i(43058);function h({alias:e,onClose:t}){let[s,n]=(0,r.useState)({x:0,y:0}),[l,i]=(0,r.useState)({w:380,h:520}),o=(0,r.useRef)({active:!1,startX:0,startY:0,baseX:0,baseY:0}),x=(0,r.useRef)({active:!1,startX:0,startY:0,baseW:0,baseH:0}),u=(0,r.useCallback)((e,t,a,r)=>({x:Math.min(Math.max(16,e),Math.max(16,window.innerWidth-a-16)),y:Math.min(Math.max(16,t),Math.max(16,window.innerHeight-r-16))}),[]);(0,r.useEffect)(()=>{let e=()=>{let e=window.innerWidth,t=window.innerHeight,a=Math.min(380,e-32),r=Math.min(520,t-96);i({w:a,h:r});let s=e<640;n(u(s?16:e-a-24,s?t-r-16:96,a,r))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[u]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let m=e=>{if(o.current.active){o.current.active=!1;try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}}},f=e=>{if(x.current.active){x.current.active=!1,e.stopPropagation();try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}}};return(0,a.jsxs)("div",{className:"fixed z-50 flex flex-col overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--bg)] shadow-2xl shadow-black/60 anet-fade-in",style:{left:s.x,top:s.y,width:l.w,height:l.h},role:"dialog","aria-label":`Chat with ${e}`,children:[(0,a.jsxs)("div",{onPointerDown:e=>{0===e.button&&(e.currentTarget.setPointerCapture?.(e.pointerId),o.current={active:!0,startX:e.clientX,startY:e.clientY,baseX:s.x,baseY:s.y})},onPointerMove:e=>{let t=o.current;t.active&&n(u(t.baseX+(e.clientX-t.startX),t.baseY+(e.clientY-t.startY),l.w,l.h))},onPointerUp:m,onPointerCancel:m,className:"flex items-center justify-between px-3 py-2.5 border-b border-[var(--border)] bg-[var(--bg-secondary)] rounded-t-xl cursor-grab active:cursor-grabbing select-none touch-none",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)(d.AliasAvatar,{alias:e,size:28}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-semibold text-[var(--fg)] truncate",children:e}),(0,a.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)]",children:"Drag to move · Esc to close"})]})]}),(0,a.jsx)("button",{onClick:t,onPointerDown:e=>e.stopPropagation(),"aria-label":"Close chat",className:"text-[var(--fg-muted)] hover:text-[var(--fg)] p-1.5 rounded-lg hover:bg-[var(--bg-elevated)] shrink-0",children:(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsx)("div",{className:"flex-1 min-h-0",children:(0,a.jsx)(c.TaskChatPanel,{alias:e,onClose:t,inline:!0})}),(0,a.jsx)("div",{onPointerDown:e=>{0===e.button&&(e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),x.current={active:!0,startX:e.clientX,startY:e.clientY,baseW:l.w,baseH:l.h})},onPointerMove:e=>{let t=x.current;if(!t.active)return;e.stopPropagation();let a=Math.max(300,window.innerWidth-s.x-16),r=Math.max(320,window.innerHeight-s.y-16);i({w:Math.min(a,Math.max(300,t.baseW+(e.clientX-t.startX))),h:Math.min(r,Math.max(320,t.baseH+(e.clientY-t.startY)))})},onPointerUp:f,onPointerCancel:f,"aria-label":"Resize chat",className:"absolute bottom-0 right-0 w-5 h-5 cursor-nwse-resize touch-none z-10",style:{touchAction:"none"},children:(0,a.jsx)("svg",{className:"absolute bottom-0.5 right-0.5 w-3 h-3 text-[var(--fg-dim)]",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:"M11 5L5 11M11 9L9 11"})})})]})}let x={id:"unknown",label:"Unknown vendor",mono:{bg:"hsl(220 10% 26%)",ring:"hsl(220 10% 46%)",text:"hsl(220 14% 82%)"},initial:"?",logo:null},u=[{test:e=>e.startsWith("intern"),vendor:{id:"intern",label:"书生 · 上海 AI 实验室",mono:{bg:"hsl(28 38% 24%)",ring:"hsl(32 45% 52%)",text:"hsl(34 60% 82%)"},initial:"书",logo:"/intern_avatar.png"}},{test:e=>e.startsWith("minimax"),vendor:{id:"minimax",label:"MiniMax",mono:{bg:"hsl(18 50% 26%)",ring:"hsl(18 65% 52%)",text:"hsl(20 80% 82%)"},initial:"M",logo:null}},{test:e=>e.startsWith("claude"),vendor:{id:"anthropic",label:"Anthropic",mono:{bg:"hsl(16 32% 26%)",ring:"hsl(16 48% 54%)",text:"hsl(18 60% 84%)"},initial:"A",logo:null}},{test:e=>e.startsWith("gpt")||e.startsWith("codex")||e.startsWith("o1")||e.startsWith("o3")||e.startsWith("o4"),vendor:{id:"openai",label:"OpenAI",mono:{bg:"hsl(165 26% 22%)",ring:"hsl(165 40% 44%)",text:"hsl(165 45% 80%)"},initial:"O",logo:null}}];function m(e){if(!e)return x;let t=e.toLowerCase();for(let e of u)if(e.test(t))return e.vendor;return x}let f={"claude-code-cli":{label:"Claude Code CLI",iconPath:"M4 5h16v14H4z M7 9l3 3-3 3 M13 15h4",color:"#a78bfa"},"codex-sdk":{label:"Codex SDK",iconPath:"M9 7l-5 5 5 5 M15 7l5 5-5 5",color:"#38bdf8"},"claude-agent-sdk":{label:"Claude Agent SDK",iconPath:"M4 7h16v10H4z M8 11h8 M8 14h5",color:"#34d399"},"http-api":{label:"HTTP API",iconPath:"M7 18a4 4 0 010-8 5 5 0 019.6-1.3A3.5 3.5 0 0118 18z",color:"#fbbf24"}};function p(e){return e?f[e]??null:null}function g(e,t,a,r=0){let s=t<=2?Math.PI:1.78*Math.PI,n=-Math.PI/2-s/2,l=t<=1?-Math.PI/2:n+s*e/(t-1)+r;return{x:500+a*Math.cos(l),y:330+a*Math.sin(l)}}function y(e,t,a=0){let r=(e.x+t.x)/2,s=(e.y+t.y)/2,n=t.x-e.x,l=t.y-e.y,i=Math.hypot(n,l)||1,o={x:r+-l/i*a,y:s+n/i*a};return`M${e.x},${e.y} Q${o.x},${o.y} ${t.x},${t.y}`}function b(e,t){return e.length>t?`${e.slice(0,t-1)}...`:e}let v={panelStops:["#0b1220","#080814","#101018"],radarStops:[{color:"#22d3ee",opacity:.18},{color:"#22c55e",opacity:.045},{color:"#020617",opacity:0}],arrowFill:"#67e8f9",ringStroke:"#164e63",spokeStroke:{active:"#22d3ee",idle:"#155e75"},flowEdge:"#67e8f9",flowPath:"#e0f2fe",flowParticle:"#fef08a",nodeFill:{online:"#020617",offline:"#080814"},labelBox:{fill:"#020617",stroke:"#1f2937"},legendBox:{fill:"#020617",stroke:"#1f2937"},legendText:"#94a3b8",legendHeadline:"#e5e7eb",legendAccent:"#67e8f9",containerBg:"#080814",containerBorder:"#2a2a4a",topRailGradient:"from-transparent via-cyan-400/70 to-transparent"},j={panelStops:["#f8fafc","#ffffff","#f1f5f9"],radarStops:[{color:"#10b981",opacity:.06},{color:"#3b82f6",opacity:.03},{color:"#ffffff",opacity:0}],arrowFill:"#10b981",ringStroke:"#cbd5e1",spokeStroke:{active:"#10b981",idle:"#cbd5e1"},flowEdge:"#10b981",flowPath:"#475569",flowParticle:"#f59e0b",nodeFill:{online:"#ffffff",offline:"#f8fafc"},labelBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendText:"#475569",legendHeadline:"#0f172a",legendAccent:"#0d9488",containerBg:"#ffffff",containerBorder:"#e3e6eb",topRailGradient:"from-transparent via-emerald-500/40 to-transparent"};function w(e,t){let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];)a++;return e.slice(0,a)}function k(e){let t=e.length,a=e.map((e,t)=>t),r=e=>{for(;a[e]!==e;)a[e]=a[a[e]],e=a[e];return e},s=(e,t)=>{let s=r(e),n=r(t);s!==n&&(a[s]=n)},n={};for(let t of(e.forEach((e,t)=>{let a=e.project_dir?.trim();a&&(n[a]||=[]).push(t)}),Object.values(n)))for(let e=1;e<t.length;e++)s(t[0],t[e]);let l=e.map((e,t)=>t).sort((t,a)=>e[t].alias.localeCompare(e[a].alias));for(let t=0;t+1<l.length;t++)w(e[l[t]].alias,e[l[t+1]].alias).length>=2&&s(l[t],l[t+1]);let i={};for(let e=0;e<t;e++)(i[r(e)]||=[]).push(e);let o={};for(let t of Object.values(i)){let a;if(1===t.length)a=e[t[0]].alias;else{let r=new Set(t.map(t=>e[t].project_dir?.trim()).filter(Boolean));if(1===r.size){let e=[...r][0];a=e.split("/").filter(Boolean).pop()||e}else(a=t.map(t=>e[t].alias).reduce((e,t)=>w(e,t))).length<2&&(a=e[t[0]].alias)}for(let r of t)o[e[r].alias]=a}return o}function N(e,t){let a=new Map;return e.forEach(e=>{if(!t[e.from_alias]||!t[e.to_alias]||e.from_alias===e.to_alias)return;let r=`${e.from_alias}->${e.to_alias}`,s=a.get(r),n=e.created_at||"",l=s?n>s.last_at?n:s.last_at:n;a.set(r,{key:r,from:e.from_alias,to:e.to_alias,count:(s?.count||0)+1,content:s?.content||e.content,last_at:l})}),[...a.values()].slice(0,18)}function S({sessions:e,sseSessions:t,renameSignal:s}){let n="light"===function(){let[e,t]=(0,r.useState)("dark");return(0,r.useEffect)(()=>{let e=()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber";t("light"===e||"mint"===e?"light":"dark")};e();let a=new MutationObserver(e);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>a.disconnect()},[]),e}(),l=n?j:v,i="intern"===function(){let[e,t]=(0,r.useState)(null);return(0,r.useEffect)(()=>{try{let e=new URL(window.location.href).searchParams.get("brand");null!==e?""===e||"none"===e?(localStorage.removeItem("anet-brand"),t(null)):(localStorage.setItem("anet-brand",e),t(e)):t(localStorage.getItem("anet-brand"))}catch{}},[]),e}(),[o,c]=(0,r.useState)([]),[x,u]=(0,r.useState)("ring");(0,r.useEffect)(()=>{try{let e=localStorage.getItem("anet-topo-layout");("grid"===e||"ring"===e)&&u(e)}catch{}},[]);let f=()=>u(e=>{let t="ring"===e?"grid":"ring";try{localStorage.setItem("anet-topo-layout",t)}catch{}return t}),[w,_]=(0,r.useState)(.84);(0,r.useEffect)(()=>{try{let e=parseFloat(localStorage.getItem("anet-topo-nodescale")||"");(.7===e||.84===e||1===e)&&_(e)}catch{}},[]),(0,r.useEffect)(()=>{let e=async()=>{try{let e=await fetch("/api/hub/messages?limit=50");if(401===e.status)return void window.location.assign("/login");let t=await e.json();c(t.messages||[])}catch{}};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]);let{onlineNodes:C,offlineNodes:M,nodePositions:z,flowLinks:$,activeAliases:E,groupKeys:T,groupBoxes:P}=(0,r.useMemo)(()=>{let a=e=>(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],r=(e,t)=>e.alias.localeCompare(t.alias),s=Date.now(),n=e.filter(e=>"offline"!==e.status||a(e)).sort(r),l=e.filter(e=>"offline"===e.status&&!a(e)&&!(e=>{if("offline"!==e.status||a(e)||!e.last_seen_at)return!1;let t=Date.parse(e.last_seen_at);return!Number.isNaN(t)&&s-t>864e5})(e)).sort(r),i={};if("grid"===x){let e=[...n,...l],t=k(e),a=Math.max(1,Math.ceil(Math.sqrt(e.length))),r=700/a,s=Math.round(26*w),d=[];for(let a of e){let e=t[a.alias],r=d[d.length-1];r&&r.key===e?r.members.push(a):d.push({key:e,members:[a]})}let c=[],h=0,x=0;for(;x<d.length;)if(d[x].members.length>=2)c.push({members:d[x].members,startRow:h,centred:!1,isGroup:!0}),h+=Math.ceil(d[x].members.length/a),x++;else{let e=[];for(;x<d.length&&d[x].members.length<2;)e.push(d[x].members[0]),x++;c.push({members:e,startRow:h,centred:!0,isGroup:!1}),h+=Math.ceil(e.length/a)}let u=s+20,m=Math.max(2*s+22,u+12,Math.min(100,526/Math.max(1,h)));for(let e of c)e.members.forEach((t,s)=>{let n=Math.floor(s/a),l=s%a,o=Math.min(a,e.members.length-n*a),d=e.centred?(a-o)*r/2:0;i[t.alias]={x:150+d+(l+.5)*r,y:126+(e.startRow+n+.5)*m}});let f=N(o,i),p=new Set;f.forEach(e=>{p.add(e.from),p.add(e.to)});let g=Math.max(8,Math.min(26,m-u-8)),y=c.filter(e=>e.isGroup).map(e=>{let a=e.members.map(e=>i[e.alias]).filter(Boolean),r=a.map(e=>e.x),s=a.map(e=>e.y),n=Math.min(...r),l=Math.min(...s);return{key:e.members.length?t[e.members[0].alias]:"",count:e.members.length,x:n-g,y:l-u,w:Math.max(...r)-n+2*g,h:Math.max(...s)-l+u+g}});return{onlineNodes:n,offlineNodes:l,nodePositions:i,flowLinks:f,activeAliases:p,groupKeys:t,groupBoxes:y}}let d=n.length>14,c=!d&&n.length>8,h=n.length;if(d){let e=Math.ceil(n.length/3),t=n.slice(0,e),a=n.slice(e,2*e),r=n.slice(2*e);t.forEach((e,a)=>{i[e.alias]=g(a,Math.max(t.length,1),145)});let s=t.length<=2?Math.PI:1.78*Math.PI,l=t.length>1?s/(t.length-1):0;a.forEach((e,t)=>{i[e.alias]=g(t,Math.max(a.length,1),215,l/2)}),r.forEach((e,t)=>{i[e.alias]=g(t,Math.max(r.length,1),285)}),h=r.length}else if(c){let e=Math.ceil(n.length/2),t=n.length-e,a=n.slice(0,e),r=n.slice(e);a.forEach((t,a)=>{i[t.alias]=g(a,Math.max(e,1),175)});let s=e<=2?Math.PI:1.78*Math.PI,l=e>1?s/(e-1):0;r.forEach((e,a)=>{i[e.alias]=g(a,Math.max(t,1),260,l/2)}),h=t}else n.forEach((e,t)=>{i[e.alias]=g(t,Math.max(n.length,1),220)});let u=h<=2?Math.PI:1.78*Math.PI,m=h>1?u/(h-1):0,f=h>0?m/2:0,p=325+6*Math.max(0,l.length-4);l.forEach((e,t)=>{i[e.alias]=g(t,Math.max(l.length,1),p,f)});let y=N(o,i),b=new Set;y.forEach(e=>{b.add(e.from),b.add(e.to)});let v=k([...n,...l]);return{onlineNodes:n,offlineNodes:l,nodePositions:i,flowLinks:y,activeAliases:b,groupKeys:v,groupBoxes:[]}},[o,e,t,x,w]),A=C.filter(e=>"working"===e.status).length,L=(0,r.useMemo)(()=>{let e=new Map;for(let t of[...C,...M]){let a=m(t.model),r="unknown"===a.id?"?":a.initial,s=e.get(r);s?s.count++:e.set(r,{initial:r,count:1,color:a.mono.text})}return[...e.values()].sort((e,t)=>t.count-e.count)},[C,M]),F=C.length+M.length>16,[R,B]=(0,r.useState)(null),I=R?T[R]??R:null,W=(0,r.useRef)(null),O=(0,r.useRef)(null),[D,H]=(0,r.useState)({zoom:1,x:0,y:0}),X=(0,r.useRef)(D),Y=(0,r.useRef)({active:!1,startX:0,startY:0,baseX:0,baseY:0}),[U,G]=(0,r.useState)(!1),[K,J]=(0,r.useState)(null),[V,q]=(0,r.useState)(null);(0,r.useEffect)(()=>{s&&s.from===K&&J(s.to)},[s]),(0,r.useEffect)(()=>{X.current=D},[D]),(0,r.useEffect)(()=>{try{let e=localStorage.getItem("anet-topo-view");if(e){let t=JSON.parse(e);"number"==typeof t?.zoom&&H({zoom:Math.min(4,Math.max(.5,t.zoom)),x:"number"==typeof t.x?t.x:0,y:"number"==typeof t.y?t.y:0})}}catch{}},[]),(0,r.useEffect)(()=>{try{localStorage.setItem("anet-topo-view",JSON.stringify(D))}catch{}},[D]),(0,r.useEffect)(()=>{let e=()=>G(document.fullscreenElement===W.current);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),(0,r.useEffect)(()=>{let e=O.current;if(!e)return;let t=t=>{if(!U&&!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let a=e.getBoundingClientRect(),r=(t.clientX-a.left)/a.width*1e3,s=(t.clientY-a.top)/a.height*680;H(e=>{let a=Math.min(1.08,Math.max(.926,Math.exp(-(6e-4*t.deltaY)))),n=Math.min(4,Math.max(.5,e.zoom*a)),l=n/e.zoom;return{zoom:n,x:r-(r-e.x)*l,y:s-(s-e.y)*l}})};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[U]);let[Z,Q]=(0,r.useState)(!1),ee=e=>{if(Y.current.active){Y.current.active=!1,Q(!1);try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}}},et=e=>{H(t=>{let a=Math.min(4,Math.max(.5,t.zoom*e)),r=a/t.zoom;return{zoom:a,x:500-(500-t.x)*r,y:340-(340-t.y)*r}})},ea=()=>H({zoom:1,x:0,y:0});return(0,r.useEffect)(()=>{let e=e=>{if(e.ctrlKey||e.metaKey||e.altKey)return;let t=document.activeElement;if(t){let e=t.tagName;if("INPUT"===e||"TEXTAREA"===e||"SELECT"===e||t.isContentEditable)return}"+"===e.key||"="===e.key?(et(1.2),e.preventDefault()):"-"===e.key||"_"===e.key?(et(1/1.2),e.preventDefault()):"0"===e.key&&(ea(),e.preventDefault())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,a.jsxs)("section",{className:"w-full max-w-6xl mx-auto mb-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between mb-3 px-1",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs uppercase text-gray-600 tracking-wider",children:"Network Topology"}),(0,a.jsx)("h2",{className:"text-lg text-white font-semibold",children:"Command mesh"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,a.jsxs)("div",{className:"inline-flex rounded-md border border-gray-500/25 overflow-hidden",role:"group","aria-label":"Topology layout",children:[(0,a.jsx)("button",{onClick:()=>{"ring"!==x&&f()},"aria-pressed":"ring"===x,className:`px-2.5 py-1 transition-colors ${"ring"===x?"bg-cyan-500/15 text-cyan-300":"text-gray-500 hover:text-gray-400"}`,children:"Ring"}),(0,a.jsx)("button",{onClick:()=>{"grid"!==x&&f()},"aria-pressed":"grid"===x,className:`px-2.5 py-1 border-l border-gray-500/25 transition-colors ${"grid"===x?"bg-cyan-500/15 text-cyan-300":"text-gray-500 hover:text-gray-400"}`,children:"Grid"})]}),(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-green-500/10 text-green-300 border border-green-500/20",children:[A," working"]}),(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-cyan-500/10 text-cyan-300 border border-cyan-500/20",children:[C.length," online"]}),L.length>1&&(0,a.jsx)("span",{className:"inline-flex items-center gap-2 px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20 font-mono",title:"Fleet by model vendor",children:L.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-baseline gap-0.5",children:[(0,a.jsx)("span",{style:{color:e.color},children:e.initial}),(0,a.jsxs)("span",{className:"text-gray-500",children:[":",e.count]})]},e.initial))}),(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20",children:[$.length," active links"]})]})]}),(0,a.jsxs)("div",{ref:W,className:`relative overflow-hidden rounded-lg border shadow-2xl ${n?"shadow-zinc-900/5":"shadow-cyan-950/30"} ${U?"flex items-center justify-center":""}`,style:{background:l.containerBg,borderColor:l.containerBorder},children:[(0,a.jsx)("div",{className:`absolute inset-x-0 top-0 h-px bg-gradient-to-r ${l.topRailGradient}`}),(0,a.jsxs)("svg",{ref:O,viewBox:"0 0 1000 680",className:"w-full h-auto block",preserveAspectRatio:"xMidYMid meet",onPointerDown:e=>{0===e.button&&(e.currentTarget.setPointerCapture?.(e.pointerId),Y.current={active:!0,startX:e.clientX,startY:e.clientY,baseX:X.current.x,baseY:X.current.y},Q(!0))},onPointerMove:e=>{let t=Y.current;if(!t.active)return;let a=O.current;if(!a)return;let r=a.getBoundingClientRect(),s=(e.clientX-t.startX)/r.width*1e3,n=(e.clientY-t.startY)/r.height*680;H(e=>({...e,x:t.baseX+s,y:t.baseY+n}))},onPointerUp:ee,onPointerLeave:ee,style:{cursor:Z?"grabbing":"grab",touchAction:"none"},children:[(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"topo-panel",x1:"0",x2:"1",y1:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:l.panelStops[0]}),(0,a.jsx)("stop",{offset:"48%",stopColor:l.panelStops[1]}),(0,a.jsx)("stop",{offset:"100%",stopColor:l.panelStops[2]})]}),(0,a.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:l.radarStops[0].color,stopOpacity:l.radarStops[0].opacity}),(0,a.jsx)("stop",{offset:"45%",stopColor:l.radarStops[1].color,stopOpacity:l.radarStops[1].opacity}),(0,a.jsx)("stop",{offset:"100%",stopColor:l.radarStops[2].color,stopOpacity:l.radarStops[2].opacity})]}),!n&&(0,a.jsxs)("filter",{id:"topo-glow",children:[(0,a.jsx)("feGaussianBlur",{stdDeviation:"4",result:"blur"}),(0,a.jsxs)("feMerge",{children:[(0,a.jsx)("feMergeNode",{in:"blur"}),(0,a.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),[{id:"topo-arrow-s",size:12},{id:"topo-arrow",size:16},{id:"topo-arrow-l",size:22}].map(e=>(0,a.jsx)("marker",{id:e.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:e.size,markerHeight:e.size,markerUnits:"userSpaceOnUse",orient:"auto-start-reverse",children:(0,a.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:l.arrowFill})},e.id)),(0,a.jsxs)("radialGradient",{id:"topo-sweep",cx:"0%",cy:"50%",r:"100%",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:n?"#0d9488":"#22d3ee",stopOpacity:n?.18:.32}),(0,a.jsx)("stop",{offset:"70%",stopColor:n?"#0d9488":"#22d3ee",stopOpacity:n?.1:.18}),(0,a.jsx)("stop",{offset:"100%",stopColor:n?"#0d9488":"#22d3ee",stopOpacity:"0"})]})]}),(0,a.jsx)("rect",{width:"1000",height:"680",fill:"url(#topo-panel)"}),(0,a.jsxs)("g",{transform:`translate(${D.x} ${D.y}) scale(${D.zoom})`,children:["ring"===x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:500,cy:330,r:"330",fill:"url(#topo-radar)"}),!n&&(0,a.jsx)("g",{opacity:"0.5",children:Array.from({length:28}).map((e,t)=>{let r=9301*t+49297;return(0,a.jsx)("circle",{cx:13*r%1e3,cy:7*r%680,r:t%3==0?1.2:.7,fill:"#a5b4fc",opacity:.35+t%4*.05},t)})}),(0,a.jsx)("g",{style:{transformOrigin:"500px 330px",transformBox:"view-box"},className:"anet-topo-sweep",opacity:n?.7:1,children:(0,a.jsx)("path",{d:`M 500 330 L 830 330 A 330 330 0 0 0 ${500+330*Math.cos(-Math.PI/4.5)} ${330+330*Math.sin(-Math.PI/4.5)} Z`,fill:"url(#topo-sweep)"})}),[90,170,250,330].map(e=>(0,a.jsx)("circle",{cx:500,cy:330,r:e,fill:"none",stroke:l.ringStroke,strokeWidth:"1",opacity:n?.6:.35},e)),!n&&[0,.25,.5,.75].map((e,t)=>(0,a.jsx)("g",{children:(0,a.jsx)("circle",{cx:830,cy:330,r:0===t?2.8:2.2,fill:"#22d3ee",opacity:.9,filter:"url(#topo-glow)",children:(0,a.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:`${360*e} 500 330`,to:`${360*e+360} 500 330`,dur:"16s",repeatCount:"indefinite"})})},`orbit-${t}`)),[0,30,60,90,120,150].map(e=>(0,a.jsx)("line",{x1:500-360*Math.cos(e*Math.PI/180),y1:330-360*Math.sin(e*Math.PI/180),x2:500+360*Math.cos(e*Math.PI/180),y2:330+360*Math.sin(e*Math.PI/180),stroke:l.ringStroke,strokeWidth:"1",opacity:n?.35:.18},e))]}),"ring"===x&&C.map((e,t)=>{let r=z[e.alias];if(!r)return null;let s=y({x:500,y:330},r,0),n=E.has(e.alias);return(0,a.jsx)("path",{d:s,fill:"none",stroke:n?l.spokeStroke.active:l.spokeStroke.idle,strokeWidth:n?2:1,strokeDasharray:n?"none":"6 14",opacity:n?.7:.45,className:n?void 0:"anet-topo-spoke-flow",style:n?void 0:{animationDelay:`${-(.25*t)}s`}},`hub-${e.alias}`)}),P.map(e=>{let t=I===e.key;return(0,a.jsxs)("g",{"data-group":e.key,className:"transition-opacity",style:{pointerEvents:"none",opacity:!I||t?1:.28},children:[(0,a.jsx)("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:"14",fill:n?"#0f172a":"#a5b4fc",fillOpacity:t?n?.05:.09:n?.025:.045,stroke:t?l.legendAccent:l.ringStroke,strokeWidth:t?2:1.5,strokeDasharray:t?"none":"6 6",style:{transition:"stroke 200ms ease-out, stroke-width 200ms ease-out, fill-opacity 200ms ease-out"}}),(0,a.jsxs)("text",{x:e.x+12,y:e.y+14,fill:t?l.legendHeadline:l.legendText,fontSize:"13",fontFamily:"monospace",fontWeight:"700",style:{transition:"fill 200ms ease-out"},children:[e.key,(0,a.jsxs)("tspan",{dx:"6",fill:l.legendText,fontSize:"11",fontWeight:"400",children:["· ",e.count]})]})]},`grp-${e.key}`)}),$.map((e,t)=>{let r=z[e.from],s=z[e.to];if(!r||!s)return null;let i=(t%2==0?1:-1)*Math.min(36,.18*Math.hypot(s.x-r.x,s.y-r.y)),o=y(r,s,i),d=Math.min(2+e.count,7),c=Math.max(.9,2.6/Math.sqrt(e.count)),h=Math.max(.35,1-(e.last_at?Math.max(0,Date.now()-Date.parse(e.last_at)):0)/3e5),x=e.count<=2?"topo-arrow-s":e.count<=4?"topo-arrow":"topo-arrow-l";return(0,a.jsxs)("g",{children:[(0,a.jsx)("path",{d:o,fill:"none",stroke:l.flowEdge,strokeWidth:d,opacity:(n?.22:.28)*h,filter:n?void 0:"url(#topo-glow)",markerEnd:`url(#${x})`,className:"transition-opacity duration-500"}),(0,a.jsx)("path",{id:`flow-path-${t}`,d:o,fill:"none",stroke:l.flowPath,strokeWidth:"1",strokeDasharray:"2 12",opacity:(n?.4:.75)*h,className:"transition-opacity duration-500"}),(0,a.jsx)("circle",{r:"4",fill:l.flowParticle,filter:n?void 0:"url(#topo-glow)",opacity:h,children:(0,a.jsx)("animateMotion",{dur:`${c}s`,repeatCount:"indefinite",path:o})})]},e.key)}),"ring"===x&&(0,a.jsxs)("g",{children:[(0,a.jsx)("circle",{cx:500,cy:330,r:"18",fill:n?"#d1fae5":"#10b981",opacity:n?.42:.12,children:(0,a.jsx)("animate",{attributeName:"opacity",values:n?"0.32;0.52;0.32":"0.08;0.16;0.08",dur:"4s",repeatCount:"indefinite"})}),(0,a.jsx)("circle",{cx:500,cy:330,r:"10",fill:n?"#059669":"#10b981"}),(0,a.jsx)("circle",{cx:500,cy:330,r:"5",fill:"#d1fae5",opacity:"0.9"})]}),[...C,...M].map((e,r)=>{var s,o;let c,h,x,u,f,g=z[e.alias];if(!g)return null;let y=(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],v="offline"!==e.status||!!y,j=v?"working"===e.status?{label:"working",primary:n?"#059669":"#22c55e",halo:n?"#d1fae5":"#14532d",text:n?"#065f46":"#dcfce7"}:"idle"===e.status?{label:"idle",primary:n?"#0d9488":"#2dd4bf",halo:n?"#ccfbf1":"#134e4a",text:n?"#115e59":"#ccfbf1"}:{label:e.status||"online",primary:n?"#0284c7":"#38bdf8",halo:n?"#e0f2fe":"#0c4a6e",text:n?"#0c4a6e":"#e0f2fe"}:{label:"offline",primary:n?"#94a3b8":"#6b7280",halo:n?"#e2e8f0":"#111827",text:n?"#475569":"#9ca3af"},k=E.has(e.alias),N=Math.round((v?26:18)*w),S=!F||R===e.alias||D.zoom>=1.4,_=!I||(T[e.alias]??e.alias)===I;return(0,a.jsxs)("g",{"data-node":e.alias,className:"group transition-opacity anet-fade-in",style:{cursor:"pointer",opacity:_?K===e.alias||v?1:.6:.32,animationDelay:`${25*Math.min(r,24)}ms`},onPointerDown:e=>e.stopPropagation(),onPointerEnter:()=>B(e.alias),onPointerLeave:()=>B(t=>t===e.alias?null:t),onClick:()=>{J(e.alias),q({ts:Date.now(),x:g.x,y:g.y,r0:N,color:j.primary}),setTimeout(()=>q(e=>e&&Date.now()-e.ts>=590?null:e),600)},children:[(0,a.jsx)("title",{children:(s=e.model,o=e.runtime,c=m(s),h=p(o),x=[],"unknown"!==c.id&&x.push(c.label),s&&x.push(s),h&&x.push(h.label),x.join(" · ")||e.alias)}),(0,a.jsx)("circle",{cx:g.x,cy:g.y,r:N+12,fill:"none",stroke:j.primary,strokeWidth:"2",className:"opacity-0 group-hover:opacity-70 transition-opacity duration-150",style:{pointerEvents:"none"}}),K===e.alias&&(0,a.jsx)("circle",{cx:g.x,cy:g.y,r:N+14,fill:"none",stroke:j.primary,strokeWidth:"2.5",opacity:n?.85:.95,filter:n?void 0:"url(#topo-glow)",className:"transition-opacity duration-200",style:{pointerEvents:"none"}}),k&&(0,a.jsxs)("circle",{cx:g.x,cy:g.y,r:N+14,fill:j.primary,opacity:n?.08:.12,children:[(0,a.jsx)("animate",{attributeName:"r",values:`${N+8};${N+22};${N+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,a.jsx)("animate",{attributeName:"opacity",values:n?"0.12;0.02;0.12":"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,a.jsx)("circle",{cx:g.x,cy:g.y,r:N+8,fill:j.halo,opacity:v?n?.85:.65:n?.4:.25,className:"transition-[fill,opacity] duration-300 ease-out"}),(0,a.jsx)("circle",{cx:g.x,cy:g.y,r:N,fill:v?l.nodeFill.online:l.nodeFill.offline,stroke:j.primary,strokeWidth:v?3:1.5,strokeDasharray:v?"none":"5 5",filter:v&&!n?"url(#topo-glow)":void 0,className:"transition-[fill,stroke] duration-300 ease-out"}),(()=>{let t=Math.round((v?14:10)*w),r=2*N,s=m(e.model),n=/书生|书小生|intern/i.test(e.alias);if(i||n||s.logo)return(0,a.jsx)("image",{href:s.logo??"/intern_avatar.png",x:g.x-r/2,y:g.y-r/2,width:r,height:r,preserveAspectRatio:"xMidYMid meet"});if("unknown"!==s.id)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:g.x,cy:g.y,r:t,fill:s.mono.bg,stroke:s.mono.ring,strokeWidth:"1"}),(0,a.jsx)("text",{x:g.x,y:g.y,dy:"0.34em",textAnchor:"middle",fill:s.mono.text,fontSize:t,fontFamily:"monospace",fontWeight:"700",children:s.initial})]});let l=(0,d.aliasAvatarColors)(T[e.alias]||e.alias);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:g.x,cy:g.y,r:t,fill:l.bg,stroke:l.ring,strokeWidth:"1"}),(0,a.jsx)("text",{x:g.x,y:g.y,dy:"0.34em",textAnchor:"middle",fill:l.text,fontSize:t,fontFamily:"monospace",fontWeight:"700",children:(0,d.aliasInitial)(e.alias)})]})})(),(()=>{let t=p(e.runtime);if(!t)return null;let r=v?7:5.5,s=g.x+.72*N,n=g.y+.72*N,i=2*r*.62;return(0,a.jsxs)("g",{style:{pointerEvents:"none"},children:[(0,a.jsx)("circle",{cx:s,cy:n,r:r,fill:l.containerBg,stroke:t.color,strokeWidth:"1.5"}),(0,a.jsx)("g",{transform:`translate(${s-i/2} ${n-i/2}) scale(${i/24})`,children:(0,a.jsx)("path",{d:t.iconPath,fill:"none",stroke:t.color,strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})]})})(),"working"===e.status&&(0,a.jsx)("circle",{cx:g.x,cy:g.y-(N-6),r:"2.5",fill:l.flowParticle,children:(0,a.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:"1.1s",repeatCount:"indefinite"})}),(f=(u=w<.8)?88:100,S?(0,a.jsxs)("g",{transform:`translate(${g.x}, ${g.y+N+(u?18:22)})`,style:{pointerEvents:"none"},children:[(0,a.jsx)("rect",{x:-f/2,y:u?-12:-14,width:f,height:u?36:42,rx:"6",fill:l.labelBox.fill,stroke:l.labelBox.stroke,opacity:n?1:.94}),(0,a.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:j.text,fontSize:u?11:12,fontFamily:"monospace",fontWeight:"700",children:b(e.alias,u?11:12)}),(0,a.jsxs)("text",{x:"0",y:u?15:17,textAnchor:"middle",fill:j.primary,fontSize:u?8:9,fontFamily:"monospace",children:[j.label,v&&null!=y?` sse:${y}`:""]})]}):(0,a.jsx)("text",{x:g.x,y:g.y+N+(u?12:14),textAnchor:"middle",fill:j.text,fontSize:u?9:10,fontFamily:"monospace",fontWeight:"700",opacity:.9,style:{pointerEvents:"none",paintOrder:"stroke"},stroke:l.containerBg,strokeWidth:"3",children:b(e.alias,u?9:10)}))]},e.alias)}),V&&(0,a.jsxs)("circle",{cx:V.x,cy:V.y,r:V.r0+4,fill:"none",stroke:V.color,strokeWidth:"2",opacity:"0",style:{pointerEvents:"none"},children:[(0,a.jsx)("animate",{attributeName:"r",values:`${V.r0+4};${V.r0+30}`,dur:"0.5s",fill:"freeze"}),(0,a.jsx)("animate",{attributeName:"opacity",values:"0.7;0",dur:"0.5s",fill:"freeze"})]},V.ts)]}),(0,a.jsxs)("g",{transform:"translate(16, 16)",children:[(0,a.jsx)("rect",{x:"0",y:"0",width:"230",height:"84",rx:"10",fill:l.legendBox.fill,stroke:l.legendBox.stroke,opacity:n?.97:.92}),(0,a.jsx)("text",{x:"13",y:"21",fill:l.legendHeadline,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,a.jsxs)("text",{x:"150",y:"21",fill:l.legendAccent,fontSize:"10",fontFamily:"monospace",children:[o.length," msgs"]}),$.slice(0,3).map((e,t)=>(0,a.jsxs)("text",{x:"13",y:38+16*t,fill:l.legendText,fontSize:"9",fontFamily:"monospace",children:[b(e.from,6)," ","->"," ",b(e.to,6)," / ",e.count," / ",b(e.content,12)]},e.key))]}),(0,a.jsxs)("g",{transform:"translate(760, 16)",children:[(0,a.jsx)("rect",{x:"0",y:"0",width:"224",height:"96",rx:"10",fill:l.legendBox.fill,stroke:l.legendBox.stroke,opacity:n?.97:.92}),(0,a.jsx)("circle",{cx:"16",cy:"24",r:"5.5",fill:n?"#059669":"#22c55e"}),(0,a.jsx)("text",{x:"30",y:"28",fill:l.legendText,fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,a.jsx)("circle",{cx:"16",cy:"48",r:"5.5",fill:n?"#0d9488":"#2dd4bf"}),(0,a.jsx)("text",{x:"30",y:"52",fill:l.legendText,fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,a.jsx)("circle",{cx:"16",cy:"72",r:"5.5",fill:n?"#94a3b8":"#6b7280"}),(0,a.jsx)("text",{x:"30",y:"76",fill:l.legendText,fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,a.jsx)("path",{d:"M140,72 Q164,48 196,72",fill:"none",stroke:l.flowEdge,strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]}),(0,a.jsxs)("div",{className:"absolute bottom-3 right-3 flex items-center gap-1.5 text-xs select-none",children:[(0,a.jsx)("div",{className:"flex items-center rounded-md border overflow-hidden",style:{background:l.legendBox.fill,borderColor:l.containerBorder},role:"group","aria-label":"Node size",children:[["S",.7],["M",.84],["L",1]].map(([e,t],r)=>(0,a.jsx)("button",{onClick:()=>(e=>{_(e);try{localStorage.setItem("anet-topo-nodescale",String(e))}catch{}})(t),"aria-pressed":w===t,title:`Node size: ${"S"===e?"small":"M"===e?"medium":"large"}`,className:`px-2 py-1 transition-colors ${r>0?"border-l":""} ${w===t?"bg-cyan-500/15 text-cyan-300":"hover:bg-white/5"}`,style:{color:w===t?void 0:l.legendText,borderColor:l.containerBorder},children:e},e))}),(0,a.jsxs)("div",{className:"flex items-center rounded-md border overflow-hidden",style:{background:l.legendBox.fill,borderColor:l.containerBorder},children:[(0,a.jsx)("button",{onClick:()=>et(1/1.2),className:"px-2 py-1 hover:bg-white/5 transition-colors",style:{color:l.legendText},"aria-label":"Zoom out",title:"Zoom out (−)",children:(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:"M5 12h14"})})}),(0,a.jsxs)("span",{className:"px-2 py-1 tabular-nums border-x text-center",style:{color:l.legendText,borderColor:l.containerBorder,minWidth:46},title:"Current zoom level",children:[Math.round(100*D.zoom),"%"]}),(0,a.jsx)("button",{onClick:()=>et(1.2),className:"px-2 py-1 hover:bg-white/5 transition-colors",style:{color:l.legendText},"aria-label":"Zoom in",title:"Zoom in (+)",children:(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:"M12 5v14M5 12h14"})})})]}),(0,a.jsx)("button",{onClick:ea,className:"p-1.5 rounded-md border hover:bg-white/5 transition-colors",style:{background:l.legendBox.fill,borderColor:l.containerBorder,color:l.legendText},"aria-label":"Reset view",title:"Reset zoom + pan (0, or double-click the canvas)",children:(0,a.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,a.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9 9 0 0 0-6.4 2.6L3 8"}),(0,a.jsx)("path",{d:"M3 3v5h5"})]})}),(0,a.jsx)("button",{onClick:()=>{let e=W.current;if(e)if(document.fullscreenElement)document.exitFullscreen?.();else{let t=e.requestFullscreen||e.webkitRequestFullscreen;t?.call(e)}},className:"p-1.5 rounded-md border hover:bg-white/5 transition-colors",style:{background:l.legendBox.fill,borderColor:l.containerBorder,color:l.legendText},"aria-label":U?"Exit fullscreen":"Enter fullscreen",title:U?"Exit fullscreen":"Fullscreen",children:U?(0,a.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:"M8 3v4a1 1 0 0 1-1 1H3M21 8h-4a1 1 0 0 1-1-1V3M3 16h4a1 1 0 0 1 1 1v4M16 21v-4a1 1 0 0 1 1-1h4"})}):(0,a.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:"M3 8V5a2 2 0 0 1 2-2h3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M21 16v3a2 2 0 0 1-2 2h-3"})})})]}),K&&(0,a.jsx)(h,{alias:K,onClose:()=>J(null)})]})]})}let _={working:{bg:"bg-green-900/30 border-green-800/30",text:"text-green-300",dot:"bg-green-500",glow:"shadow-green-500/10"},idle:{bg:"bg-cyan-900/30 border-cyan-800/30",text:"text-cyan-300",dot:"bg-cyan-400",glow:"shadow-cyan-500/5"},blocked:{bg:"bg-yellow-900/30 border-yellow-800/30",text:"text-yellow-300",dot:"bg-yellow-500",glow:""},error:{bg:"bg-red-900/30 border-red-800/30",text:"text-red-300",dot:"bg-red-500",glow:""}},C={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function M({session:e,hasSse:t,sseCount:r,onChat:l}){let i=t&&_[e.status]||C;return(0,a.jsxs)(s.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,prefetch:!1,className:`anet-agent-card group relative block rounded-xl border p-4 transition-all duration-300 cursor-pointer hover:-translate-y-0.5 ${t?`bg-[#111128] border-[#2a2a4a] hover:border-cyan-500/30 hover:shadow-lg ${i.glow}`:"bg-[#0d0d1a] border-[#1a1a2a] opacity-40"}`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(d.AliasAvatar,{alias:e.alias,size:22}),(0,a.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:e.alias,children:e.alias}),(0,a.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${i.dot} ${t&&"working"===e.status?"animate-pulse":""}`})]}),(0,a.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded-md border shrink-0 ${i.bg} ${i.text}`,children:t?e.status:"offline"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"text-xs text-gray-600 bg-[#0a0a15] px-2 py-0.5 rounded border border-[#1a1a2a]",children:e.agent||"unknown"}),t&&(0,a.jsxs)("span",{className:"text-[10px] text-green-500",children:["SSE:",r]})]}),e.task?(0,a.jsx)("div",{className:"text-xs text-gray-400 bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] line-clamp-2",title:e.task,children:e.task}):(0,a.jsx)("div",{className:"text-xs text-gray-700 italic",children:"No active task"}),e.progress>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex justify-between text-[10px] mb-1",children:[(0,a.jsx)("span",{className:"text-gray-600",children:"Progress"}),(0,a.jsxs)("span",{className:i.text,children:[e.progress,"%"]})]}),(0,a.jsx)("div",{className:"w-full bg-gray-800 rounded-full h-1.5 overflow-hidden",children:(0,a.jsx)("div",{className:`h-1.5 rounded-full transition-all duration-700 ${"working"===e.status?"bg-green-500":"bg-cyan-500"}`,style:{width:`${Math.min(e.progress,100)}%`}})})]}),(0,a.jsxs)("div",{className:"mt-3 flex justify-between items-center text-[10px] text-gray-600",children:[(0,a.jsx)("span",{className:"truncate",title:e.server||"",children:e.server||"--"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[l&&t&&(0,a.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e.alias)},className:"text-cyan-400 hover:text-cyan-300 px-1.5 py-0.5 rounded border border-cyan-500/20 hover:bg-cyan-500/10 transition-colors",children:"Chat"}),(0,a.jsx)("span",{children:(0,n.timeAgo)(e.updated_at)}),(0,a.jsx)("svg",{"aria-hidden":!0,className:"w-3 h-3 text-gray-700 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M9 18l6-6-6-6"})})]})]})]})}function z({messages:e}){return 0===e.length?null:(0,a.jsxs)("div",{className:"mt-8",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-gray-500",children:"Inbox"}),(0,a.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length})]}),(0,a.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-1 scrollbar-thin",children:e.map(e=>(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm transition-colors hover:border-[#3a3a5a]",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs mb-1.5",children:[e.from_session&&(0,a.jsx)(d.AliasAvatar,{alias:e.from_session,size:16}),(0,a.jsx)("span",{className:"text-gray-200 font-medium truncate",children:e.from_session}),(0,a.jsx)("span",{className:"ml-auto text-gray-600 shrink-0",title:e.created_at,children:(0,n.timeAgo)(e.created_at)})]}),(0,a.jsx)("div",{className:"text-gray-300 leading-relaxed line-clamp-3",title:e.content||"",children:(0,n.previewContent)(e.content)})]},e.id))})]})}function $(){return(0,a.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8 anet-skeleton-pulse",children:[1,2,3,4].map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-4 py-3",children:[(0,a.jsx)(E,{w:"2.5rem",h:"1.75rem"}),(0,a.jsx)(E,{w:"3.5rem",h:"0.75rem",className:"mt-2"}),(0,a.jsx)(E,{w:"5rem",h:"0.625rem",className:"mt-1"})]},e))}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-3 anet-skeleton-pulse",children:[(0,a.jsx)(E,{w:"6rem",h:"2.5rem",rounded:"0.75rem"}),(0,a.jsxs)("div",{className:"flex-1 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-2.5 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full anet-skeleton-bar"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(E,{w:"6rem",h:"0.875rem"}),(0,a.jsx)(E,{w:"10rem",h:"0.625rem",className:"mt-1"})]})]})]}),(0,a.jsx)("div",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 anet-skeleton-pulse",children:(0,a.jsx)(E,{w:"14rem",h:"0.875rem"})}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-3 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-3",children:[(0,a.jsx)(E,{w:"2rem",h:"1.25rem"}),(0,a.jsx)(E,{w:"2.5rem",h:"0.75rem",className:"mt-1"}),(0,a.jsx)(E,{w:"3.5rem",h:"0.625rem",className:"mt-px"})]},e))}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-6 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"w-4 h-4 rounded anet-skeleton-bar"}),(0,a.jsx)(E,{w:"4rem",h:"0.75rem"})]},e))}),(0,a.jsxs)("div",{className:"mb-6 flex gap-2 anet-skeleton-pulse",children:[(0,a.jsx)("div",{className:"flex-1 h-10 rounded-lg border border-[#2a2a4a] bg-[#111128]"}),(0,a.jsx)("div",{className:"w-28 h-10 rounded-lg anet-skeleton-bar"})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4 anet-skeleton-pulse",children:[1,2,3,4].map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("div",{className:"w-2 h-2 rounded-full anet-skeleton-bar"}),(0,a.jsx)(E,{w:"6rem",h:"0.875rem"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(E,{w:"100%",h:"0.625rem"}),(0,a.jsx)(E,{w:"75%",h:"0.625rem"}),(0,a.jsx)(E,{w:"55%",h:"0.625rem"})]})]},e))})]})}function E({w:e,h:t,rounded:r,className:s}){return(0,a.jsx)("div",{className:`anet-skeleton-bar ${s||""}`,style:{width:e,height:t,borderRadius:r||"0.375rem"}})}var T=e.i(76161),P=e.i(98025),A=e.i(11449);function L(){let{setNetworkId:e}=(0,A.useNetworkId)(),[t,s]=(0,r.useState)({user:null,networks:[],currentNetwork:"",token:""}),[n,l]=(0,r.useState)(!1),[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[h,x]=(0,r.useState)(""),[u,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=sessionStorage.getItem("anet_v3_auth");if(e)try{s(JSON.parse(e))}catch{}},[]);let[f,p]=(0,r.useState)(!1),[g,y]=(0,r.useState)(""),[b,v]=(0,r.useState)(""),j=async()=>{try{await fetch(`/api/hub/auth?token=${t.token}&endpoint=/api/auth/me`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:t.token,display_name:g,email:b})});let e=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:t.token,display_name:g,email:b})}),a=await e.json();if(a.ok&&a.user){let e={...t,user:a.user};s(e),sessionStorage.setItem("anet_v3_auth",JSON.stringify(e)),p(!1)}}catch{}};if(!t.user)return null;let w=(t.user.display_name||t.user.username).slice(0,2).toUpperCase();return(0,a.jsxs)("div",{className:"flex items-center justify-between bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center text-xs font-bold text-white",children:w}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm text-white font-medium",children:t.user.display_name||t.user.username}),(0,a.jsxs)("div",{className:"text-[10px] text-gray-500",children:[t.user.role," · ",t.user.user_id]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[t.networks.length>0&&(0,a.jsx)("select",{value:t.currentNetwork,onChange:a=>{let r={...t,currentNetwork:a.target.value};s(r),e(a.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(r))},className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:t.networks.map(e=>(0,a.jsx)("option",{value:e.network_id,children:e.network_name},e.network_id))}),(0,a.jsxs)("button",{onClick:()=>{y(t.user?.display_name||""),v(""),p(!f)},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Edit profile",children:[(0,a.jsx)("span",{className:"hidden sm:inline",children:"Edit"}),(0,a.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.862 4.487z"})})]}),(0,a.jsxs)("button",{onClick:()=>{s({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Sign out",children:[(0,a.jsx)("span",{className:"hidden sm:inline",children:"Sign out"}),(0,a.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})})]})]}),f&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#2a2a4a]",children:[(0,a.jsx)("input",{type:"text",value:g,onChange:e=>y(e.target.value),placeholder:"Display name",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-32"}),(0,a.jsx)("input",{type:"email",value:b,onChange:e=>v(e.target.value),placeholder:"Email",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-40"}),(0,a.jsx)("button",{onClick:j,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var F=e.i(6694);function R({tabs:e,activeTab:t,onOpenTab:r,onCloseTab:s,onSetActive:n,onClose:l}){return 0===e.length?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{onClick:l,className:"jsx-f7cf3d1a6fdfc074 fixed inset-0 bg-black/30 z-40 lg:hidden"}),(0,a.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 animate-slide-in",children:[(0,a.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 flex items-center border-b border-[#2a2a4a] bg-[#0d0d1a] overflow-x-auto",children:[(0,a.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 flex min-w-0",children:e.map(e=>(0,a.jsxs)("button",{onClick:()=>n(e),className:`jsx-f7cf3d1a6fdfc074 flex items-center gap-1.5 px-3 py-2.5 text-xs border-b-2 transition-colors shrink-0 ${t===e?"border-cyan-400 text-cyan-300 bg-cyan-500/5":"border-transparent text-gray-500 hover:text-gray-300"}`,children:[(0,a.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 w-2 h-2 rounded-full ${t===e?"bg-cyan-400":"bg-gray-600"}`}),(0,a.jsx)("span",{className:"jsx-f7cf3d1a6fdfc074 max-w-[80px] truncate",children:e}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),s(e)},className:"jsx-f7cf3d1a6fdfc074 ml-1 text-gray-600 hover:text-gray-300 p-0.5",children:"×"})]},e))}),(0,a.jsx)("button",{onClick:l,className:"jsx-f7cf3d1a6fdfc074 text-gray-500 hover:text-white px-3 py-2.5 shrink-0 border-l border-[#2a2a4a]",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,className:"jsx-f7cf3d1a6fdfc074 w-4 h-4",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12",className:"jsx-f7cf3d1a6fdfc074"})})})]}),(0,a.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 relative overflow-hidden",children:e.map(e=>(0,a.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 absolute inset-0 ${t===e?"block":"hidden"}`,children:(0,a.jsx)(B,{alias:e})},e))})]}),(0,a.jsx)(F.default,{id:"f7cf3d1a6fdfc074",children:"@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.animate-slide-in{animation:.2s ease-out slide-in}"})]})}function B({alias:e}){return(0,a.jsx)(c.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0})}function I({sessions:e,onClose:t}){let[s,n]=(0,r.useState)(new Set),[l,i]=(0,r.useState)(""),[o,c]=(0,r.useState)("normal"),[h,x]=(0,r.useState)(!1),[u,m]=(0,r.useState)([]),[f,p]=(0,r.useState)(""),g=e.filter(e=>"offline"!==e.status).filter(e=>!f||e.alias.toLowerCase().includes(f.toLowerCase())||(e.agent||"").toLowerCase().includes(f.toLowerCase())),y=async()=>{if(!l.trim()||0===s.size||h)return;x(!0),m([]);let e=[...s].map(async e=>{try{let t=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:l,priority:o})}),a=await t.json();return{alias:e,ok:!!a.ok,error:a.error}}catch(t){return{alias:e,ok:!1,error:"send failed"}}});m(await Promise.all(e)),x(!1)},b=u.filter(e=>e.ok).length;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40 anet-fade-in",onClick:t}),(0,a.jsxs)("div",{className:"fixed inset-4 lg:inset-x-[15%] lg:inset-y-[5%] bg-[#0a0a1a] border border-[#2a2a4a] rounded-2xl z-50 flex flex-col shadow-2xl shadow-black/70 overflow-hidden anet-fade-in",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-white",children:"Dispatch Task"}),(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Send a task to one or more agents"})]}),(0,a.jsx)("button",{onClick:t,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col lg:flex-row overflow-hidden",children:[(0,a.jsxs)("div",{className:"lg:w-[280px] border-b lg:border-b-0 lg:border-r border-[#2a2a4a] flex flex-col",children:[(0,a.jsxs)("div",{className:"px-4 py-3 border-b border-[#2a2a4a]",children:[(0,a.jsx)("input",{type:"text",value:f,onChange:e=>p(e.target.value),placeholder:"Filter agents...",className:"w-full bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none"}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,a.jsx)("button",{onClick:()=>{s.size===g.length?n(new Set):n(new Set(g.map(e=>e.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:s.size===g.length?"Deselect all":`Select all (${g.length})`}),(0,a.jsxs)("span",{className:"text-[10px] text-gray-600",children:[s.size," selected"]})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto px-2 py-2 space-y-0.5 max-h-[200px] lg:max-h-none",children:[g.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;return t=e.alias,void n(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-xs text-left transition-colors ${s.has(e.alias)?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20":"text-gray-400 hover:bg-[#1a1a2a]"}`,children:[(0,a.jsx)(d.AliasAvatar,{alias:e.alias,size:16}),(0,a.jsx)("div",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"working"===e.status?"bg-green-400":"idle"===e.status?"bg-cyan-400":"bg-gray-500"}`}),(0,a.jsx)("span",{className:"truncate flex-1",children:e.alias}),(0,a.jsx)("span",{className:"text-[9px] text-gray-600",children:e.agent||"--"})]},e.alias)),0===g.length&&(0,a.jsx)("div",{className:"text-center text-xs text-gray-600 py-4",children:"No online agents"})]})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,a.jsxs)("div",{className:"flex-1 px-6 py-4 flex flex-col",children:[(0,a.jsx)("label",{className:"text-xs text-gray-500 uppercase mb-2",children:"Task Prompt"}),(0,a.jsx)("textarea",{value:l,onChange:e=>i(e.target.value),placeholder:"Enter the task you want to dispatch...",className:"flex-1 min-h-[120px] bg-[#111128] border border-[#2a2a4a] rounded-xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none resize-none"}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,a.jsxs)("select",{value:o,onChange:e=>c(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white focus:outline-none",children:[(0,a.jsx)("option",{value:"normal",children:"Normal priority"}),(0,a.jsx)("option",{value:"high",children:"High priority"}),(0,a.jsx)("option",{value:"low",children:"Low priority"})]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("button",{onClick:y,disabled:h||!l.trim()||0===s.size,className:"px-6 py-2.5 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-xl transition-all shadow-lg shadow-cyan-500/10 disabled:shadow-none active:scale-95",children:h?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Sending..."]}):`Dispatch to ${s.size} agent${s.size>1?"s":""}`})]})]}),u.length>0&&(0,a.jsxs)("div",{className:"px-6 py-3 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,a.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:[b,"/",u.length," dispatched successfully"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:u.map(e=>(0,a.jsxs)("span",{className:`flex items-center gap-1.5 text-[10px] pl-1 pr-2 py-0.5 rounded-full border ${e.ok?"text-green-300 border-green-500/20 bg-green-500/5":"text-red-300 border-red-500/20 bg-red-500/5"}`,children:[(0,a.jsx)(d.AliasAvatar,{alias:e.alias,size:14}),(0,a.jsx)("span",{children:e.alias}),(0,a.jsx)("span",{"aria-hidden":!0,children:e.ok?"✓":e.error||"✗"})]},e.alias))})]})]})]})]})]})}var W=e.i(59276),O=e.i(2684),D=e.i(50111);e.s(["default",0,function(){let e,i,c,h,x;(0,r.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:u,hint:m,error:f,isLoading:p}=(0,W.useSessions)(),{health:g}=(0,W.useHealth)(),{config:y}=(0,W.useAnetConfig)(),{tasks:b}=(0,W.useTasks)({limit:"500"}),{stats:v}=(0,W.useStats)(),[j,w]=(0,r.useState)(window.innerWidth>=1024),[k,N]=(0,r.useState)(!1),_=function(){let[e,t]=(0,r.useState)([]),[a,s]=(0,r.useState)("");return{tabs:e,activeTab:a,openTab:e=>{t(t=>t.includes(e)?t:[...t,e]),s(e)},closeTab:e=>{t(t=>{let r=t.filter(t=>t!==e);return a===e&&s(r[r.length-1]||""),r})},closeAll:()=>{t([]),s("")},setActiveTab:s}}(),[C,E]=(0,r.useState)(!1),[A,F]=(0,r.useState)([]),[B,H]=(0,r.useState)("all"),[X,Y]=(0,r.useState)(null),{mutate:U}=(0,D.useSWRConfig)(),G="1"!==t.default.env.NEXT_PUBLIC_DISABLE_SSE,{connected:K,supported:J}=(0,O.useSSE)({url:"/api/hub/events",enabled:G,onEvent:e=>{if("node.renamed"===e.type){U("/api/hub/status");let t=e.data;t?.old_alias&&t?.new_alias&&Y({from:t.old_alias,to:t.new_alias,ts:Date.now()});return}["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(e.type)&&(U("/api/hub/status"),U(e=>"string"==typeof e&&e.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,r.useEffect)(()=>{let e=()=>{fetch("/api/hub/inbox").then(e=>e.json()).then(e=>{e.messages?.length&&F(t=>{let a=new Set(t.map(e=>e.id));return[...e.messages.filter(e=>!a.has(e.id)),...t].slice(0,100)})}).catch(()=>{})};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[]),p)return(0,a.jsx)($,{});let V=g?.sse_sessions||{},q=e=>(e.network_id?V[`${e.network_id}:${e.alias}`]:void 0)??V[e.alias],Z=e=>"offline"!==e.status||!!q(e),Q=u.filter(Z).length,ee=u.length,et=u.filter(e=>"working"===e.status).length,ea=g?(0,n.formatUptime)(g.uptime):"--",er=g?.version||"--",es=!!(y?.hub&&y.tokenConfigured),en=y?.source==="file"?"Local config":y?.source==="runtime-env"?"Runtime env":"Config missing",el={};if(v?.tasks?.by_status?.length)for(let e of v.tasks.by_status)el[e.status]=e.count;else for(let e of b)el[e.status]=(el[e.status]||0)+1;let ei=[...u].sort((e,t)=>{let a=+!!Z(e),r=+!!Z(t);if(a!==r)return r-a;let s=+("working"===e.status);return("working"===t.status)-s}),eo=0===u.length&&!f;return(0,a.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,a.jsx)("div",{className:"lg:ml-0 ml-10",children:(0,a.jsx)(l,{online:Q,working:et,total:ee,version:er,uptime:ea})}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[!eo&&(0,a.jsx)("button",{onClick:()=>E(!0),className:"px-4 py-2 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white text-sm font-medium rounded-xl shadow-lg shadow-cyan-500/10 transition-all active:scale-95 shrink-0",children:"⚡ Dispatch"}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(L,{})})]}),(0,a.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,a.jsxs)("button",{onClick:()=>N(!k),className:"w-full flex items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,a.jsx)("span",{className:"uppercase text-gray-600",children:"Config"}),(0,a.jsx)("span",{className:`w-2 h-2 rounded-full ${es?"bg-green-400":"bg-red-400"}`}),(0,a.jsx)("span",{className:"text-gray-500",children:en})]}),(0,a.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${k?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),k&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#2a2a4a]",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("div",{className:"min-w-0",children:(0,a.jsxs)("div",{className:"text-gray-100 truncate text-sm",title:y?.hub||void 0,children:["Hub: ",(0,a.jsx)("span",{className:y?.hub?"text-cyan-300":"text-red-300",children:y?.hub?.trim()||"not configured"})]})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 text-xs",children:(0,a.jsxs)("span",{className:`px-2.5 py-1 rounded-md border ${y?.tokenConfigured?"bg-blue-500/5 text-blue-300 border-blue-500/20":"bg-gray-500/5 text-gray-400 border-gray-500/20"}`,children:["Token: ",y?.tokenPreview||"not configured"]})})]}),y?.error&&(0,a.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:y.error})]})]}),Object.keys(el).length>0&&(0,a.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("div",{className:"text-xs uppercase text-gray-600",children:"Task Status"}),(0,a.jsx)(s.default,{href:"/tasks",prefetch:!1,className:"text-xs text-cyan-400 hover:text-cyan-300",children:"View all →"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:["running","delivered","acked","replied","created","failed","cancelled","expired","closed"].filter(e=>el[e]).map(e=>(0,a.jsxs)(s.default,{href:`/tasks?status=${e}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${P.STATUS_CHIP_CLASS[e]} hover:opacity-80 transition-opacity`,children:[e,": ",el[e]]},e))})]}),!eo&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-2",children:"Quick navigation"}),(0,a.jsx)("section",{className:"mb-3 grid grid-cols-3 gap-2 sm:gap-3",children:(e=u.filter(e=>Z(e)&&"working"!==e.status).length,i=ee-Q,c=b.filter(e=>"failed"===e.status).length,[{href:"/nodes",label:"Nodes",value:`${Q}/${ee}`,sub:`${ee>0?Math.round(Q/ee*100):0}% online`,color:"text-green-400 border-green-500/20",popover:0===ee?null:[{k:"working",v:et,dot:"",color:"#4ade80"},{k:"idle",v:e,dot:"",color:"#22d3ee"},{k:"offline",v:i,dot:"",color:"#9ca3af"}]},{href:"/tasks",label:"Tasks",value:String(Object.values(el).reduce((e,t)=>e+t,0)||0),sub:"all-time",color:"text-cyan-400 border-cyan-500/20",popover:0===Object.keys(el).length?null:["running","replied","failed","cancelled","expired","closed","created","delivered","acked"].filter(e=>el[e]).map(e=>({k:e,v:el[e],dot:"",color:({running:"#4ade80",replied:"#a78bfa",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c",closed:"#9ca3af",created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee"})[e]||"#9ca3af"}))},{href:"/tasks?status=failed",label:"Failed",value:String(el.failed||0),sub:el.failed?"needs review":"none",color:el.failed?"text-red-400 border-red-500/25":"text-gray-500 border-gray-700/30",popover:c?[{k:`${c} in current view`,v:"",dot:"",color:"#f87171"}]:[{k:"no failures yet",v:"",dot:"",color:"#4b5563"}]}].map(e=>(0,a.jsxs)(s.default,{href:e.href,prefetch:!1,className:`anet-stat-link group relative rounded-xl border ${e.color} bg-[#111128] px-3 py-3 transition-all hover:-translate-y-px`,children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,a.jsx)("div",{className:`text-xl font-semibold tabular-nums ${e.color.split(" ")[0]}`,children:e.value}),(0,a.jsx)("div",{className:"hidden sm:block text-[10px] text-gray-600 group-hover:text-gray-400 transition-colors",children:"View →"})]}),(0,a.jsx)("div",{className:"text-[11px] text-gray-400 mt-0.5",children:e.label}),(0,a.jsx)("div",{className:"text-[10px] text-gray-600 mt-px",children:e.sub}),e.popover&&e.popover.length>0&&(0,a.jsxs)("div",{className:"anet-stat-popover hidden md:block pointer-events-none absolute left-2 right-2 top-full mt-1 z-20 rounded-lg border border-[#2a2a4a] bg-[#0d0d1a] shadow-lg shadow-black/30 px-3 py-2 opacity-0 translate-y-[-2px] group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-150 delay-100",children:[(0,a.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1.5",children:"Breakdown"}),(0,a.jsx)("ul",{className:"space-y-1",children:e.popover.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:e.color},"aria-hidden":!0}),(0,a.jsx)("span",{className:"text-gray-400 capitalize",children:e.k}),""!==e.v&&(0,a.jsx)("span",{className:"ml-auto text-gray-300 tabular-nums font-medium",children:e.v})]},e.k))})]})]},e.href)))}),(0,a.jsx)("section",{className:"mb-6 grid grid-cols-3 gap-2 sm:gap-3",children:[{href:"/messages",label:"Messages",icon:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"},{href:"/logs",label:"Audit log",icon:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z M14 2v6h6 M16 13H8 M16 17H8 M10 9H8"},{href:"/admin",label:"Admin",icon:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4z M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2"}].map(e=>(0,a.jsxs)(s.default,{href:e.href,prefetch:!1,className:"anet-nav-tile flex items-center justify-center gap-2 rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 text-[12px] text-gray-400 hover:text-gray-200 transition-colors",children:[(0,a.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:e.icon})}),(0,a.jsx)("span",{children:e.label})]},e.href))}),(0,a.jsx)(o,{}),b.length>0&&(0,a.jsxs)("section",{className:"mb-6 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Recent Activity"}),(0,a.jsx)(s.default,{href:"/tasks",className:"text-xs text-cyan-400 hover:text-cyan-300",children:"All tasks →"})]}),(0,a.jsx)("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:b.slice(0,5).map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:P.STATUS_DOT_HEX[e.status]||"#6b7280"}}),e.from_name&&(0,a.jsx)(d.AliasAvatar,{alias:e.from_name,size:14}),(0,a.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:e.from_name||"?"}),(0,a.jsx)("span",{className:"text-gray-600",children:"→"}),e.to_name&&(0,a.jsx)(d.AliasAvatar,{alias:e.to_name,size:14}),(0,a.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:e.to_name||"?"}),(0,a.jsx)("span",{className:"text-gray-500 truncate flex-1",title:e.content||"",children:(0,n.previewContent)(e.content).slice(0,60)}),(0,a.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${P.STATUS_CHIP_CLASS[e.status]||"text-gray-500 border-gray-700/30"}`,children:e.status})]},e.task_id))})]})]}),f&&(0,a.jsxs)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-center justify-between",role:"alert",children:[(0,a.jsx)("span",{children:String(f)}),(0,a.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),u.length>0&&(0,a.jsx)("div",{className:"flex justify-center mb-4",children:(0,a.jsx)("button",{onClick:()=>w(!j),className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-4 py-1.5 rounded-lg transition-colors hover:border-gray-600 cursor-pointer",children:j?"Hide Topology":"Show Topology"})}),!j&&u.length>0&&(0,a.jsx)("div",{className:"lg:hidden text-center text-xs text-gray-600 mb-4",children:"Topology hidden on mobile for better readability"}),j&&u.length>0&&(0,a.jsx)(S,{sessions:u,sseSessions:V,renameSignal:X}),0!==u.length||f?(h={all:ei.length,working:ei.filter(e=>Z(e)&&"working"===e.status).length,idle:ei.filter(e=>Z(e)&&"working"!==e.status).length,offline:ei.filter(e=>!Z(e)).length},x=ei.filter(e=>"all"===B||("offline"===B?!Z(e):"working"===B?Z(e)&&"working"===e.status:"idle"!==B||Z(e)&&"working"!==e.status)),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-3 flex flex-wrap items-center gap-1",children:[{key:"all",label:"All"},{key:"working",label:"Working",dot:"#4ade80"},{key:"idle",label:"Idle",dot:"#22d3ee"},{key:"offline",label:"Offline",dot:"#6b7280"}].map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>H(e.key),disabled:0===h[e.key]&&"all"!==e.key,className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${B===e.key?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/30":"text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] border border-transparent"}`,children:[e.dot&&(0,a.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:e.dot}}),(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:`text-[10px] tabular-nums ${B===e.key?"text-cyan-400":"text-gray-600"}`,children:h[e.key]})]},e.key))}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4",children:x.map(e=>(0,a.jsx)(M,{session:e,hasSse:Z(e),sseCount:q(e)||0,onChat:_.openTab},e.alias))}),0===x.length&&(0,a.jsxs)("div",{className:"mt-4 text-center text-xs text-gray-600",children:['No agents match "',B,'" — ',(0,a.jsx)("button",{onClick:()=>H("all"),className:"underline hover:text-gray-400",children:"Show all"})]})]})):(0,a.jsx)(T.NodesEmptyState,{hint:m,taskHistoryCount:Object.values(el).reduce((e,t)=>e+t,0)}),(0,a.jsx)(z,{messages:A}),(0,a.jsx)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:J&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${K?"bg-green-400":"bg-gray-600"}`}),K?"SSE live":"SWR polling"]})}),C&&(0,a.jsx)(I,{sessions:u,onClose:()=>E(!1)}),_.tabs.length>0&&(0,a.jsx)(R,{tabs:_.tabs,activeTab:_.activeTab,onOpenTab:_.openTab,onCloseTab:_.closeTab,onSetActive:_.setActiveTab,onClose:_.closeAll})]})}],18722)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98025,e=>{"use strict";e.s(["SESSION_STATUS_CHIP_CLASS",0,{working:"bg-green-500/10 text-green-300 border-green-500/20",idle:"bg-blue-500/10 text-blue-300 border-blue-500/20",blocked:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",error:"bg-red-500/10 text-red-300 border-red-500/20",offline:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"SESSION_STATUS_TEXT_CLASS",0,{working:"text-green-400",idle:"text-blue-400",blocked:"text-yellow-400",error:"text-red-400",offline:"text-gray-500"},"STATUS_BAR_CLASS",0,{created:"bg-gray-500",delivered:"bg-blue-500",acked:"bg-cyan-500",running:"bg-green-500",replied:"bg-purple-500",closed:"bg-gray-600",failed:"bg-red-500",cancelled:"bg-yellow-500",expired:"bg-orange-500"},"STATUS_CHIP_CLASS",0,{created:"bg-gray-500/10 text-gray-400 border-gray-500/20",delivered:"bg-blue-500/10 text-blue-300 border-blue-500/20",acked:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20",running:"bg-green-500/10 text-green-300 border-green-500/20",replied:"bg-purple-500/10 text-purple-300 border-purple-500/20",closed:"bg-gray-500/10 text-gray-500 border-gray-500/20",failed:"bg-red-500/10 text-red-300 border-red-500/20",cancelled:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",expired:"bg-orange-500/10 text-orange-300 border-orange-500/20"},"STATUS_DOT_HEX",0,{created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"},"TASK_STATUSES",0,["created","delivered","acked","running","replied","closed","failed","cancelled","expired"]])},3479,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},46228,e=>{"use strict";var t=e.i(22381);let s=[180,200,220,270,300,330,30,90];function a(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:n=""}){let l=a(e),i=Math.max(9,Math.round(.42*s));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${n}`,style:{width:s,height:s,fontSize:i,backgroundColor:l.bg,borderColor:l.ring,color:l.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,a,"aliasInitial",0,r])},76161,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(56839);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function l({variant:e="generic",title:s,sub:i,cta:o,compact:d=!1}){let c=r[e],x=s??c.title,h=i??c.sub;return(0,t.jsxs)("div",{className:`text-center ${d?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(n,{variant:e,size:d?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${d?"text-sm":"text-base"}`,children:x}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${d?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(a.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function i({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#2a2a4a] bg-[#111128] shadow-lg shadow-black/20",children:e})}function o({cmd:e}){let[a,r]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,l,"NodesEmptyState",0,function({hint:e,taskHistoryCount:s=0}){return e?.global_count?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`})}):s>0?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${s.toLocaleString()} task${1===s?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(i,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(o,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})})}])},59276,e=>{"use strict";var t=e.i(12629),s=e.i(11449);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useLicense",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/license",a,{refreshInterval:6e4});return{license:e?.ok?e:null,error:s}},"useMessages",0,function(e=100){let{networkId:l}=(0,s.useNetworkId)(),{data:i,error:o,isLoading:d}=(0,t.default)(n(`/api/hub/messages?limit=${e}`,l),a,r);return{messages:i?.messages||[],error:o,isLoading:d}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i,isLoading:o}=(0,t.default)(n("/api/hub/status",e),a,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/stats",e),a,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,s.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:d,isLoading:c}=(0,t.default)(n(`/api/hub/tasks?${i}`,l),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:d,isLoading:c}}])},70732,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(56839),r=e.i(3479),n=e.i(59276),l=e.i(43058),i=e.i(76161),o=e.i(46228),d=e.i(98025);function c(e){return e?e.length>12?`${e.slice(0,8)}…`:e:"—"}e.s(["default",0,function(){let e,x,h,g,{sessions:u,isLoading:p}=(0,n.useSessions)(),{health:m}=(0,n.useHealth)(),y=m?.sse_sessions||{},b=e=>(e.network_id?y[`${e.network_id}:${e.alias}`]:void 0)??y[e.alias],[j,f]=(0,s.useState)(""),[v,N]=(0,s.useState)(""),[w,k]=(0,s.useState)("list"),[S,C]=(0,s.useState)({}),[_,A]=(0,s.useState)(null),[T,$]=(0,s.useState)({}),[I,L]=(0,s.useState)(null),E=u.map(e=>({...e,online:!!b(e)})).filter(e=>"online"===j?e.online:"offline"===j?!e.online:!j||j===e.status).filter(e=>!v||e.alias.toLowerCase().includes(v.toLowerCase())||(e.agent||"").toLowerCase().includes(v.toLowerCase())).sort((e,t)=>!!t.online-!!e.online||("working"===t.status)-("working"===e.status)),U=u.filter(e=>b(e)).length,O=e=>{A(t=>t===e?null:e),$(t=>({...t,[e]:{}}))},H=(e,t)=>{C(s=>({...s,[e]:t}))},M=async e=>{let t=S[e]?.trim()||"";if(t){$(t=>({...t,[e]:{sending:!0}}));try{let s=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:t})}),a=await s.json();if(!s.ok||a?.ok===!1)throw Error(a?.error||"Send failed");C(t=>({...t,[e]:""})),$(t=>({...t,[e]:{success:"Task sent"}})),A(null)}catch(t){$(s=>({...s,[e]:{error:t instanceof Error?t.message:"Send failed"}}))}}};return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Nodes"}),(0,t.jsxs)("span",{className:"text-xs bg-green-900/30 text-green-400 px-2 py-0.5 rounded-full border border-green-800/30",children:[U," online"]}),(0,t.jsxs)("span",{className:"text-xs bg-gray-900/30 text-gray-400 px-2 py-0.5 rounded-full border border-gray-800/30",children:[u.length," total"]})]}),u.length>0&&(e=E.filter(e=>e.online&&"working"===e.status).length,x=E.filter(e=>e.online&&"idle"===e.status).length,h=E.filter(e=>!e.online).length,g=E.length||1,(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex h-2 rounded-full overflow-hidden bg-gray-800",children:[e>0&&(0,t.jsx)("div",{className:"bg-green-500",style:{width:`${e/g*100}%`}}),x>0&&(0,t.jsx)("div",{className:"bg-cyan-500",style:{width:`${x/g*100}%`}}),h>0&&(0,t.jsx)("div",{className:"bg-gray-600",style:{width:`${h/g*100}%`}})]}),(0,t.jsxs)("div",{className:"flex gap-4 mt-1.5 text-[10px] text-gray-500",children:[e>0&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500 mr-1"}),e," working"]}),x>0&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-cyan-500 mr-1"}),x," idle"]}),h>0&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-gray-600 mr-1"}),h," offline"]})]})]})),u.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-6",children:[(0,t.jsx)("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:"Search nodes...",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-48"}),(0,t.jsxs)("select",{value:j,onChange:e=>f(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All"}),(0,t.jsx)("option",{value:"online",children:"Online"}),(0,t.jsx)("option",{value:"offline",children:"Offline"}),(0,t.jsx)("option",{value:"working",children:"Working"}),(0,t.jsx)("option",{value:"idle",children:"Idle"}),(0,t.jsx)("option",{value:"blocked",children:"Blocked"}),(0,t.jsx)("option",{value:"error",children:"Error"})]}),(0,t.jsx)("div",{className:"hidden sm:flex ml-auto rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 text-sm",children:["list","grid"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>k(e),className:`rounded-md px-3 py-1.5 transition-colors ${w===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"list"===e?"List":"Grid"},e))})]}),p?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3,4].map(e=>(0,t.jsx)("div",{className:"h-16 bg-gray-800/20 rounded-lg"},e))}):0===E.length?0===u.length?(0,t.jsx)(i.NodesEmptyState,{}):(0,t.jsx)(i.EmptyState,{variant:"nodes",title:"No nodes match your filters",sub:"Try clearing search or status filters, or wait for an agent to register."}):"grid"===w?(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:E.map(e=>{let s=e.online?e.status:"offline",n=T[e.alias]||{},l="number"==typeof e.progress?e.progress:0;return(0,t.jsxs)("div",{className:`relative overflow-hidden rounded-xl border border-[#2a2a4a] bg-[#111128] p-4 transition-colors ${!e.online?"opacity-60":""}`,children:[!e.online&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("span",{className:"rotate-[-20deg] rounded-xl border border-white/10 bg-black/20 px-5 py-2 text-xl font-bold uppercase tracking-[0.35em] text-white/10",children:"Offline"})}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(o.AliasAvatar,{alias:e.alias,size:36}),(0,t.jsxs)(a.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,className:"min-w-0 flex-1 hover:text-cyan-300",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-base font-semibold text-white",children:e.alias}),(0,t.jsx)("span",{className:`shrink-0 rounded-md border px-2 py-0.5 text-[10px] uppercase tracking-wide ${d.SESSION_STATUS_CHIP_CLASS[s]||d.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})]}),(0,t.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",children:[e.agent||"—",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),(0,t.jsx)("span",{title:e.server||"",children:c(e.server)})]})]}),(0,t.jsxs)("div",{className:"flex gap-1.5 shrink-0",children:[(0,t.jsx)("button",{type:"button",onClick:()=>L(e.alias),className:"rounded-lg border border-green-500/20 bg-green-500/10 px-3 py-1.5 text-xs text-green-300 transition-colors hover:bg-green-500/20",children:"Chat"}),(0,t.jsx)("button",{type:"button",onClick:()=>O(e.alias),className:"rounded-lg border border-cyan-500/20 bg-cyan-500/10 px-3 py-1.5 text-xs text-cyan-300 transition-colors hover:bg-cyan-500/20",children:"Task"})]})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-lg border border-[#1a1a2a] bg-[#0a0a15] px-3 py-2 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"Current task"}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:(0,r.timeAgo)(e.last_seen_at||e.updated_at)})]}),(0,t.jsx)("div",{className:`mt-1 line-clamp-2 ${e.task?"text-gray-300":"text-gray-600 italic"}`,children:e.task||"No current task"})]}),l>0&&l<100&&(0,t.jsx)("div",{className:"mt-3 h-1.5 overflow-hidden rounded-full bg-gray-800",children:(0,t.jsx)("div",{className:"h-1.5 rounded-full bg-cyan-400 transition-all",style:{width:`${l}%`}})}),_===e.alias&&(0,t.jsxs)("div",{className:"mt-4 space-y-2 rounded-lg border border-[#2a2a4a] bg-[#0a0a15] p-3",children:[(0,t.jsx)("input",{type:"text",value:S[e.alias]||"",onChange:t=>H(e.alias,t.target.value),onKeyDown:t=>"Enter"===t.key&&M(e.alias),placeholder:`Send task to ${e.alias}...`,className:"w-full rounded-lg border border-[#2a2a4a] bg-[#050510] px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500 focus:outline-none"}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>A(null),className:"rounded-lg border border-gray-700 px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>M(e.alias),disabled:n.sending||!(S[e.alias]||"").trim(),className:"rounded-lg bg-cyan-600 px-3 py-1.5 text-xs text-white hover:bg-cyan-500 disabled:cursor-not-allowed disabled:bg-gray-700",children:n.sending?"Sending...":"Send"})]})]}),n.error&&(0,t.jsx)("div",{className:"mt-2 text-xs text-red-400",children:n.error}),n.success&&_!==e.alias&&(0,t.jsx)("div",{className:"mt-2 text-xs text-green-400",children:n.success})]},e.alias)})}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 px-4 py-2 text-xs text-gray-600 uppercase",children:[(0,t.jsx)("div",{className:"col-span-1",children:"Status"}),(0,t.jsx)("div",{className:"col-span-2",children:"Alias"}),(0,t.jsx)("div",{className:"col-span-2",children:"Agent · Server"}),(0,t.jsx)("div",{className:"col-span-4",children:"Current Task"}),(0,t.jsx)("div",{className:"col-span-1",children:"Updated"}),(0,t.jsx)("div",{className:"col-span-2 text-right",children:"Actions"})]}),E.map(e=>{let s=e.online?e.status:"offline",n=T[e.alias]||{};return(0,t.jsxs)("div",{className:`rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 transition-colors hover:border-[#3a3a5a] ${!e.online?"opacity-50":""}`,children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 items-center",children:[(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${d.SESSION_STATUS_CHIP_CLASS[s]||d.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})}),(0,t.jsx)("div",{className:"col-span-2 min-w-0",children:(0,t.jsxs)(a.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,className:"flex items-center gap-2 min-w-0 hover:text-cyan-300",children:[(0,t.jsx)(o.AliasAvatar,{alias:e.alias,size:20}),(0,t.jsx)("span",{className:"truncate text-sm font-medium text-white",children:e.alias})]})}),(0,t.jsxs)("div",{className:"col-span-2 truncate text-xs text-gray-400",title:e.server||"",children:[e.agent||"--",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),c(e.server)]}),(0,t.jsx)("div",{className:"col-span-4 truncate text-xs text-gray-500",title:e.task||"",children:e.task||"--"}),(0,t.jsx)("div",{className:"col-span-1 text-xs text-gray-500",children:(0,r.timeAgo)(e.last_seen_at||e.updated_at)}),(0,t.jsxs)("div",{className:"col-span-2 flex justify-end gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:()=>L(e.alias),className:"rounded-lg border border-green-500/20 bg-green-500/10 px-2 py-1 text-xs text-green-300 hover:bg-green-500/20",children:"Chat"}),(0,t.jsx)("button",{type:"button",onClick:()=>O(e.alias),className:"rounded-lg border border-cyan-500/20 bg-cyan-500/10 px-2 py-1 text-xs text-cyan-300 hover:bg-cyan-500/20",children:"Task"})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(o.AliasAvatar,{alias:e.alias,size:28}),(0,t.jsxs)(a.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,className:"min-w-0 flex-1 hover:text-cyan-300",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-white",children:e.alias}),(0,t.jsxs)("div",{className:"truncate text-[10px] text-gray-500",children:[e.agent||"—"," · ",(0,r.timeAgo)(e.last_seen_at||e.updated_at)]})]}),(0,t.jsx)("span",{className:`shrink-0 text-xs px-2 py-0.5 rounded-md border ${d.SESSION_STATUS_CHIP_CLASS[s]||d.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})]}),e.task&&(0,t.jsx)("div",{className:"truncate text-xs text-gray-500",children:e.task}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>L(e.alias),className:"flex-1 rounded-lg border border-green-500/20 bg-green-500/10 px-3 py-2 text-xs text-green-300 hover:bg-green-500/20",children:"Chat"}),(0,t.jsx)("button",{type:"button",onClick:()=>O(e.alias),className:"flex-1 rounded-lg border border-cyan-500/20 bg-cyan-500/10 px-3 py-2 text-xs text-cyan-300 hover:bg-cyan-500/20",children:"Send Task"})]})]}),_===e.alias&&(0,t.jsxs)("div",{className:"mt-3 space-y-2 border-t border-[#2a2a4a] pt-3",children:[(0,t.jsx)("input",{type:"text",value:S[e.alias]||"",onChange:t=>H(e.alias,t.target.value),onKeyDown:t=>"Enter"===t.key&&M(e.alias),placeholder:`Send task to ${e.alias}...`,className:"w-full rounded-lg border border-[#2a2a4a] bg-[#0a0a15] px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500 focus:outline-none"}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>A(null),className:"rounded-lg border border-gray-700 px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>M(e.alias),disabled:n.sending||!(S[e.alias]||"").trim(),className:"rounded-lg bg-cyan-600 px-3 py-1.5 text-xs text-white hover:bg-cyan-500 disabled:cursor-not-allowed disabled:bg-gray-700",children:n.sending?"Sending...":"Send"})]})]}),n.error&&(0,t.jsx)("div",{className:"mt-2 text-xs text-red-400",children:n.error}),n.success&&_!==e.alias&&(0,t.jsx)("div",{className:"mt-2 text-xs text-green-400",children:n.success})]},e.alias)})]}),I&&(0,t.jsx)(l.TaskChatPanel,{alias:I,onClose:()=>L(null)})]})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3479,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),r=Math.floor(e%3600/60);return t>0?`${t}h ${r}m`:`${r}m`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},46228,e=>{"use strict";var t=e.i(22381);let r=[180,200,220,270,300,330,30,90];function s(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)>>>0;let s=r[t%r.length];return{bg:`hsl(${s} 55% 22%)`,ring:`hsl(${s} 60% 45%)`,text:`hsl(${s} 80% 78%)`}}function a(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:r=28,className:n=""}){let i=s(e),l=Math.max(9,Math.round(.42*r));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${n}`,style:{width:r,height:r,fontSize:l,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:a(e)})},"aliasAvatarColors",0,s,"aliasInitial",0,a])},76161,e=>{"use strict";var t=e.i(22381),r=e.i(23910),s=e.i(56839);let a={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:r}){let s={width:r,height:r},a={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function i({variant:e="generic",title:r,sub:l,cta:o,compact:c=!1}){let d=a[e],x=r??d.title,h=l??d.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(n,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:x}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(s.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function l({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#2a2a4a] bg-[#111128] shadow-lg shadow-black/20",children:e})}function o({cmd:e}){let[s,a]=(0,r.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":s?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:s?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,i,"NodesEmptyState",0,function({hint:e,taskHistoryCount:r=0}){return e?.global_count?(0,t.jsx)(l,{children:(0,t.jsx)(i,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`})}):r>0?(0,t.jsx)(l,{children:(0,t.jsx)(i,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${r.toLocaleString()} task${1===r?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(l,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(o,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})})}])},46660,e=>{"use strict";var t=e.i(22381),r=e.i(23910),s=e.i(56839),a=e.i(3479),n=e.i(76161),i=e.i(46228),l=e.i(12629);let o=e=>fetch(e).then(e=>e.json());e.s(["default",0,function(){let{data:e,mutate:c}=(0,l.default)("/api/hub/networks",o,{refreshInterval:1e4}),d=e?.networks||[],x=!e,[h,m]=(0,r.useState)(""),[u,g]=(0,r.useState)(""),[p,y]=(0,r.useState)(""),[j,b]=(0,r.useState)(null),[v,w]=(0,r.useState)(null),[f,k]=(0,r.useState)({}),[N,C]=(0,r.useState)("member"),[_,$]=(0,r.useState)(""),S=()=>{try{let e=sessionStorage.getItem("anet_v3_auth");if(e)return JSON.parse(e).token}catch{}return""},T=async()=>{if(!h.trim())return;let e=S();if(!e)return void y("V3 auth required — sign in via Agent Network login");let t=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create_network",token:e,name:h,description:u})}),r=await t.json();y(r.ok?`Created: ${r.network_id}`:`Failed: ${r.error}`),r.ok&&(m(""),g(""),c()),setTimeout(()=>y(""),5e3)},M=async e=>{let t=S();if(!t)return;let r=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete_network",token:t,network_id:e})}),s=await r.json();y(s.ok?"Deleted":`Failed: ${s.error}`),b(null),s.ok&&c(),setTimeout(()=>y(""),5e3)},A=async e=>{let t=S();if(!t)return;let r=await fetch(`/api/hub/auth?endpoint=/api/networks/${e}/members&token=${t}`),s=await r.json();k(t=>({...t,[e]:s.members||[]}))},B=async e=>{let t=S();if(!t)return;let r=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"invite_member",token:t,network_id:e,role:N})}),s=await r.json();s.ok&&s.invite_code?$(s.invite_code):y(`Invite failed: ${s.error}`)};return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)(s.default,{href:"/settings",className:"text-gray-500 hover:text-gray-300 text-sm lg:ml-0 ml-10",children:"← Settings"}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Networks"})]}),(0,t.jsxs)("div",{className:"max-w-2xl space-y-6",children:[(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Create Network"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("input",{type:"text",value:h,onChange:e=>m(e.target.value),placeholder:"Network name",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,t.jsx)("input",{type:"text",value:u,onChange:e=>g(e.target.value),placeholder:"Description (optional)",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,t.jsx)("button",{onClick:T,disabled:!h.trim(),className:"px-4 py-2 bg-green-600 hover:bg-green-500 disabled:bg-gray-800 text-white text-sm rounded-lg transition-colors",children:"Create"})]}),p&&(0,t.jsx)("div",{className:`mt-2 text-xs ${p.startsWith("Failed")||p.startsWith("V3")||p.startsWith("Invite")?"text-red-400":"text-green-400"}`,children:p})]}),(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"My Networks"}),d.length>0&&(0,t.jsxs)("span",{className:"text-[10px] text-gray-600 uppercase tracking-wide",children:[d.length," total"]})]}),x?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2].map(e=>(0,t.jsx)("div",{className:"h-14 bg-gray-800/20 rounded"},e))}):0===d.length?(0,t.jsx)(n.EmptyState,{variant:"networks",compact:!0,sub:"Create your first network above, or sign in with V3 auth to see existing ones."}):(0,t.jsx)("div",{className:"space-y-3",children:d.map(e=>(0,t.jsxs)("div",{className:"bg-[#0a0a15] rounded-lg px-4 py-3 border border-[#1a1a2a]",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,t.jsx)(i.AliasAvatar,{alias:e.network_name,size:28}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm text-white font-medium truncate",children:e.network_name}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 font-mono truncate",title:e.network_id,children:[e.network_id," · ",(0,a.timeAgo)(e.created_at)]}),e.description&&(0,t.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:e.description})]})]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,t.jsx)("button",{onClick:()=>{v===e.network_id?w(null):(w(e.network_id),A(e.network_id))},className:"text-xs text-cyan-400 hover:text-cyan-300 px-2 py-1 rounded border border-cyan-800/30 hover:bg-cyan-500/10",children:v===e.network_id?"Hide":"Members"}),j===e.network_id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>M(e.network_id),className:"text-xs text-red-400 px-2 py-1 rounded border border-red-800/30 bg-red-500/10",children:"Confirm"}),(0,t.jsx)("button",{onClick:()=>b(null),className:"text-xs text-gray-500",children:"Cancel"})]}):(0,t.jsx)("button",{onClick:()=>b(e.network_id),className:"text-xs text-red-400 hover:text-red-300 px-2 py-1 rounded border border-red-800/30 hover:bg-red-500/10",children:"Delete"})]})]}),v===e.network_id&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#1a1a2a]",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:["Members (",(f[e.network_id]||[]).length,")"]}),0===(f[e.network_id]||[]).length?(0,t.jsx)("div",{className:"text-[10px] text-gray-600",children:"No members or V3 auth required"}):(f[e.network_id]||[]).map(e=>{let r=e.username||e.display_name||"?";return(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-between text-xs py-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(i.AliasAvatar,{alias:r,size:16}),(0,t.jsx)("span",{className:"text-gray-300 truncate",children:r})]}),(0,t.jsx)("span",{className:`px-1.5 py-0.5 rounded border text-[10px] shrink-0 ${"owner"===e.role?"text-yellow-300 border-yellow-500/20":"text-gray-400 border-gray-600/20"}`,children:e.role})]},e.user_id)}),(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#1a1a2a]",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:"Invite"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("select",{value:N,onChange:e=>C(e.target.value),className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:[(0,t.jsx)("option",{value:"member",children:"member"}),(0,t.jsx)("option",{value:"admin",children:"admin"}),(0,t.jsx)("option",{value:"viewer",children:"viewer"})]}),(0,t.jsx)("button",{onClick:()=>B(e.network_id),className:"px-2 py-1 bg-green-600 hover:bg-green-500 text-white text-xs rounded",children:"Generate Code"})]}),_&&(0,t.jsxs)("div",{className:"mt-2 bg-green-500/5 border border-green-500/20 rounded px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("div",{className:"text-[10px] text-green-400 uppercase tracking-wide",children:"Invite code"}),(0,t.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).catch(()=>{})},className:"text-[10px] text-green-300 hover:text-green-200 px-1.5 py-0.5 rounded border border-green-500/20 hover:bg-green-500/10",children:"Copy"})]}),(0,t.jsx)("code",{className:"text-xs text-green-300 select-all break-all",children:_})]})]})]})]},e.network_id))})]})]})]})}])}]);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24156,e=>{"use strict";var t=e.i(22381),a=e.i(23910);let s=[{id:"cyber",label:"Cyber",emoji:"🌃",desc:"默认深色"},{id:"light",label:"Light",emoji:"☀️",desc:"浅色简洁"},{id:"mint",label:"Mint",emoji:"🌿",desc:"薄荷绿"},{id:"sunset",label:"Sunset",emoji:"🌅",desc:"暖色橙紫"}],r="anet-theme";function n(e){"u">typeof document&&document.documentElement.setAttribute("data-theme",e)}e.s(["ThemeProvider",0,function({children:e}){return(0,a.useEffect)(()=>{n(localStorage.getItem(r)||"cyber")},[]),(0,t.jsx)(t.Fragment,{children:e})},"ThemeSwitcher",0,function({compact:e=!1}){let[l,o]=(0,a.useState)("cyber"),[i,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=localStorage.getItem(r)||"cyber";o(e),n(e)},[]);let d=s.find(e=>e.id===l)||s[0];return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{"aria-label":"切换主题",onClick:()=>c(!i),className:"px-2.5 py-1.5 rounded-md text-xs flex items-center gap-1.5 hover:opacity-80 transition-opacity",style:{background:"var(--bg-elevated)",color:"var(--fg)",border:"1px solid var(--border)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:d.emoji}),!e&&(0,t.jsx)("span",{children:d.label})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>c(!1)}),(0,t.jsx)("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-md min-w-[160px] py-1 shadow-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:s.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;o(t=e.id),localStorage.setItem(r,t),n(t),c(!1)},className:"w-full px-3 py-2 text-left text-xs flex items-center gap-2 hover:opacity-80",style:{background:e.id===l?"var(--bg-elevated)":"transparent",color:"var(--fg)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:e.emoji}),(0,t.jsx)("span",{className:"flex-1",children:e.label}),(0,t.jsx)("span",{style:{color:"var(--fg-dim)"},className:"text-[10px]",children:e.desc}),e.id===l&&(0,t.jsx)("span",{style:{color:"var(--accent)"},children:"•"})]},e.id))})]})]})}])},22485,e=>{"use strict";var t=e.i(22381),a=e.i(56058),s=e.i(56839),r=e.i(23910),n=e.i(12629),l=e.i(11449),o=e.i(24156);let i=e=>fetch(e).then(e=>e.ok?e.json():{networks:[]}),c=[{href:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{href:"/tasks",label:"Tasks",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},{href:"/nodes",label:"Nodes",icon:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"},{href:"/messages",label:"Messages",icon:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"},{href:"/settings/networks",label:"Networks",icon:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{href:"/logs",label:"Audit Log",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{href:"/server-logs",label:"Server Logs",icon:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},{href:"/admin",label:"Admin",icon:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},{href:"/settings",label:"Settings",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}],d={owner:"⭐",admin:"🔧",member:"👤",viewer:"👁"};function h(){let e=(0,a.usePathname)(),[h,u]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),{networkId:f,setNetworkId:b}=(0,l.useNetworkId)(),{data:v}=(0,n.default)("/api/hub/networks",i,{refreshInterval:15e3,dedupingInterval:1e4}),{data:y}=(0,n.default)("/api/hub/status",m,{refreshInterval:15e3,dedupingInterval:1e4}),j=v?.networks||[],k=(()=>{let e=new Map;for(let t of y?.sessions||[])t.network_id&&e.set(t.network_id,(e.get(t.network_id)||0)+1);let t=new Set(j.map(e=>e.network_id));return[...j,...[...e.keys()].filter(e=>!t.has(e)).map(e=>({network_id:e,network_name:e}))].map(t=>({...t,agentCount:e.get(t.network_id)||0}))})(),w=(0,t.jsx)("nav",{className:"flex flex-col gap-1 px-2 py-4",children:c.map(a=>{var r;return(0,t.jsxs)(s.default,{href:a.href,prefetch:!1,onClick:()=>g(!1),title:h?a.label:void 0,className:`relative flex items-center gap-3 px-3 py-3 rounded-lg text-sm transition-colors active:bg-[#1a1a3a] ${("/"===(r=a.href)?"/"===e:"/settings"===r?"/settings"===e:e.startsWith(r))?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20 anet-nav-active":"text-gray-400 hover:text-gray-200 hover:bg-[#1a1a2a]"} ${h?"justify-center px-0":""}`,children:[(0,t.jsx)("svg",{className:"w-5 h-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:a.icon})}),!h&&(0,t.jsx)("span",{children:a.label})]},a.href)})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>g(!p),className:"fixed top-4 left-3 z-50 lg:hidden bg-[#111128] border border-[#2a2a4a] rounded-lg p-2.5 text-gray-400 hover:text-white active:bg-[#1a1a3a]","aria-label":"Toggle menu",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p?(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),p&&(0,t.jsx)("div",{className:"fixed inset-0 bg-black/50 z-30 lg:hidden anet-fade-in",onClick:()=>g(!1)}),(0,t.jsxs)("aside",{"data-anet-sidebar":"true",className:`
|
|
2
|
-
fixed top-0 left-0 h-full z-40 bg-[#0d0d1a] border-r border-[#2a2a4a]
|
|
3
|
-
transition-transform duration-200 ease-out
|
|
4
|
-
${h?"w-16":"w-52"}
|
|
5
|
-
${p?"translate-x-0 shadow-2xl shadow-black/40 lg:shadow-none":"-translate-x-full"}
|
|
6
|
-
lg:translate-x-0 lg:static lg:shrink-0 lg:shadow-none
|
|
7
|
-
`,children:[(0,t.jsx)(x,{collapsed:h}),(0,t.jsx)("div",{className:"border-b border-[#2a2a4a]"}),!h&&k.length>0&&(0,t.jsxs)("div",{className:"px-2 py-3 border-b border-[#2a2a4a]",children:[(0,t.jsx)("div",{className:"px-3 text-[10px] text-gray-600 uppercase mb-2",children:"Networks"}),(0,t.jsx)("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:k.map(e=>(0,t.jsxs)("button",{onClick:()=>{b(e.network_id),g(!1)},title:e.network_id,className:`w-full flex items-center gap-2 px-3 py-1.5 rounded-md text-xs transition-colors text-left ${f===e.network_id?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]"}`,children:[(0,t.jsx)("span",{children:d[e.role||"member"]||"👤"}),(0,t.jsx)("span",{className:"truncate flex-1",children:e.network_name}),e.agentCount?(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-[10px] text-gray-600",children:e.agentCount}):null]},e.network_id))})]}),(0,t.jsx)("div",{className:"pb-20",children:w}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,t.jsxs)("button",{onClick:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0}))},title:h?"Quick search (⌘K)":void 0,className:`w-full flex items-center text-[11px] text-gray-600 hover:text-gray-400 hover:bg-[#1a1a2a] transition-colors ${h?"justify-center px-0 py-2.5":"justify-between gap-2 px-5 py-2"}`,"aria-label":"Open command palette",children:[(0,t.jsxs)("span",{className:`flex items-center ${h?"":"gap-2"}`,children:[(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),!h&&"Quick search"]}),!h&&(0,t.jsx)("kbd",{className:"text-[10px] border border-current rounded px-1 py-0.5 opacity-60 font-mono",children:"⌘K"})]}),(0,t.jsxs)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),sessionStorage.removeItem("anet_v3_auth"),window.location.assign("/login")},title:h?"Sign out":void 0,className:`w-full flex items-center text-xs text-gray-500 hover:text-red-400 hover:bg-red-500/5 transition-colors ${h?"justify-center px-0 py-2.5":"gap-3 px-5 py-3"}`,children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),!h&&"Sign out"]}),(0,t.jsxs)("div",{className:`flex items-center gap-2 ${h?"flex-col px-0 py-2":"px-3 py-2 justify-between"}`,children:[(0,t.jsx)(o.ThemeSwitcher,{compact:h}),(0,t.jsx)("button",{onClick:()=>u(!h),title:h?"Expand sidebar":"Collapse sidebar",className:"hidden lg:flex p-1.5 rounded text-gray-600 hover:text-gray-400 transition-colors","aria-label":h?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})})]})]})]})]})}let m=e=>fetch(e).then(e=>e.ok?e.json():{sessions:[]});function x({collapsed:e}){let{data:a}=(0,n.default)("/api/hub/status",m,{refreshInterval:1e4,dedupingInterval:4e3}),r=a?.sessions||[],l=r.filter(e=>e.status&&"offline"!==e.status).length,o=r.length;return e?(0,t.jsx)(s.default,{href:"/",className:"block px-3 py-4 flex justify-center hover:opacity-80 transition-opacity","aria-label":"Agent Network — home",children:(0,t.jsx)(u,{size:32})}):(0,t.jsxs)(s.default,{href:"/",className:"block px-4 py-4 flex items-center gap-3 hover:bg-[#11112a]/40 transition-colors rounded-r-xl","aria-label":"Agent Network — home",children:[(0,t.jsx)(u,{size:32}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-white text-[13px] font-semibold leading-tight",children:"Agent Network"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${l>0?"bg-emerald-400 anet-brand-pulse":"bg-gray-600"}`,"aria-hidden":!0}),0===o?(0,t.jsx)("span",{children:"waiting for agents"}):(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-gray-300 font-medium tabular-nums",children:l}),(0,t.jsxs)("span",{className:"text-gray-600",children:["/",o]})," online"]})]})]})]})}function u({size:e}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":!0,className:"shrink-0",children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.2",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"2.5",fill:"currentColor",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"2.5",fill:"currentColor",className:"text-green-400"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"2.5",fill:"currentColor",className:"text-violet-400"})]})}let p=async e=>{let t=await fetch(e);if(!t.ok)throw Error(String(t.status));return t.json()};function g(){let e,a,{data:l,error:o}=(0,n.default)("/api/hub/stats",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),{data:i,error:c}=(0,n.default)("/api/hub/health",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),[d,h]=(0,r.useState)(()=>"1"===sessionStorage.getItem("anet-hb-dismissed"));if(d)return null;let m=o&&c||i&&!1===i.ok,x=l?.tasks?.by_status?.find(e=>"failed"===e.status)?.count||0,u=l?.nodes?.total===0,g=null;if(m?(e="red",a="CommHub unreachable — agents may be offline",g={label:"Open Settings",href:"/settings"}):x>0?(e="amber",a=`${x} task${x>1?"s":""} failed recently`,g={label:"Review failures",href:"/tasks?status=failed"}):(u?(e="green",a="Waiting for first agent"):(e="green",a="All systems go"),g=null),"green"===e&&!l)return null;let f={red:"bg-red-500/8 border-red-500/25 text-red-300",amber:"bg-amber-500/8 border-amber-500/25 text-amber-300",green:"bg-emerald-500/6 border-emerald-500/20 text-emerald-300"}[e],b={red:"bg-red-400",amber:"bg-amber-400 anet-brand-pulse",green:"bg-emerald-400"}[e];return(0,t.jsxs)("div",{role:"status",className:`anet-health-banner sticky top-0 z-30 border-b ${f} pl-14 pr-3 sm:px-6 py-1.5 text-[12px] flex items-center justify-between gap-3 backdrop-blur-sm`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${b}`,"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:a})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[g&&(0,t.jsxs)(s.default,{href:g.href,className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-90 hover:opacity-100 hidden sm:inline",children:[g.label," →"]}),g&&(0,t.jsx)(s.default,{href:g.href,"aria-label":g.label,className:"sm:hidden text-[11px] font-medium opacity-90 hover:opacity-100",children:"→"}),(0,t.jsx)("button",{onClick:()=>{h(!0);try{sessionStorage.setItem("anet-hb-dismissed","1")}catch{}},"aria-label":"Dismiss banner",className:"opacity-50 hover:opacity-100 leading-none px-1",children:"×"})]})]})}let f="anet-cmdk-recents";function b(){try{let e=sessionStorage.getItem(f);return e?JSON.parse(e):[]}catch{return[]}}function v(e){try{let t=b().filter(t=>t!==e);t.unshift(e),sessionStorage.setItem(f,JSON.stringify(t.slice(0,4)))}catch{}}function y(e,t){if(!t)return{score:0,indices:[]};let a=e.toLowerCase(),s=t.toLowerCase(),r=0,n=0,l=0,o=0,i=[];for(;r<a.length&&n<s.length;)a[r]===s[n]?(l+=2+o,o++,i.push(r),(0===r||/[\s·:_/-]/.test(a[r-1]))&&(l+=4),n++):o=0,r++;return n<s.length?{score:-1,indices:[]}:{score:l-.05*Math.max(0,a.length-s.length),indices:i}}function j({text:e,indices:a}){if(!a.length)return(0,t.jsx)(t.Fragment,{children:e});let s=new Set(a),r=Array.from(e);return(0,t.jsx)(t.Fragment,{children:r.map((e,a)=>s.has(a)?(0,t.jsx)("mark",{className:"anet-cmdk-mark",children:e},a):(0,t.jsx)("span",{children:e},a))})}function k({d:e}){return(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}let w=[{id:"go-overview",title:"Go to Overview",hint:"Fleet at a glance",group:"Navigate",icon:(0,t.jsx)(k,{d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3"}),perform:e=>e.push("/")},{id:"go-tasks",title:"Go to Tasks",hint:"All task statuses",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:e=>e.push("/tasks")},{id:"go-tasks-failed",title:"Go to Failed tasks",hint:"Filter status=failed",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}),perform:e=>e.push("/tasks?status=failed")},{id:"go-nodes",title:"Go to Nodes",hint:"Agent fleet",group:"Navigate",icon:(0,t.jsx)(k,{d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}),perform:e=>e.push("/nodes")},{id:"go-messages",title:"Go to Messages",hint:"Inter-agent chat",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"}),perform:e=>e.push("/messages")},{id:"go-networks",title:"Go to Networks",hint:"Manage networks",group:"Navigate",icon:(0,t.jsx)(k,{d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}),perform:e=>e.push("/settings/networks")},{id:"go-logs",title:"Go to Audit Log",hint:"Register / login / actions",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}),perform:e=>e.push("/logs")},{id:"go-server-logs",title:"Go to Server Logs",hint:"CommHub stdout/stderr",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}),perform:e=>e.push("/server-logs")},{id:"go-admin",title:"Go to Admin",hint:"Server overview + broadcast",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"}),perform:e=>e.push("/admin")},{id:"go-settings",title:"Go to Settings",hint:"Connection / Account / Resources",group:"Navigate",icon:(0,t.jsx)(k,{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),perform:e=>e.push("/settings")},{id:"act-toggle-theme",title:"Toggle theme",hint:"cyber ↔ light",group:"Actions",icon:(0,t.jsx)(k,{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"}),perform:()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber",t="light"===e||"mint"===e?"cyber":"light";document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("anet-theme",t)}catch{}}},{id:"act-copy-url",title:"Copy current URL",hint:"page link to clipboard",group:"Actions",icon:(0,t.jsx)(k,{d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}),perform:()=>{try{navigator.clipboard.writeText(window.location.href)}catch{}}},{id:"act-sign-out",title:"Sign out",hint:"clear session",group:"Actions",icon:(0,t.jsx)(k,{d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"}),perform:()=>{fetch("/api/auth/logout",{method:"POST"}).catch(()=>{});try{sessionStorage.removeItem("anet_v3_auth")}catch{}window.location.assign("/login")}},{id:"act-help",title:"Show keyboard shortcuts",hint:"press ? — works on mobile too",group:"Actions",icon:(0,t.jsx)(k,{d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"?"}))}}];function N(){let e=(0,a.useRouter)(),[s,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(""),[i,c]=(0,r.useState)(0),d=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()){e.preventDefault(),n(e=>!e);return}if("/"===e.key&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA"&&!s){e.preventDefault(),n(!0);return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,r.useEffect)(()=>{s&&(o(""),c(0),setTimeout(()=>d.current?.focus(),50))},[s]);let[h,m]=(0,r.useState)([]);(0,r.useEffect)(()=>{s&&m(b())},[s]);let[x,u]=(0,r.useState)([]);(0,r.useEffect)(()=>{if(!s)return;let e=!1;return(async()=>{try{let[a,s]=await Promise.all([fetch("/api/hub/status").then(e=>e.ok?e.json():{sessions:[]}),fetch("/api/hub/tasks?limit=20").then(e=>e.ok?e.json():{tasks:[]})]);if(e)return;let r=(a.sessions||[]).filter(e=>e.alias).slice(0,20).map(e=>({id:`agent-${e.alias}`,title:`Go to agent ${e.alias}`,hint:`${e.agent||"agent"} \xb7 ${e.status||"unknown"}`,group:"Agents",icon:(0,t.jsx)(k,{d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:t=>t.push(`/node?alias=${encodeURIComponent(e.alias)}`)})),n=(s.tasks||[]).filter(e=>e.task_id).slice(0,15).map(e=>({id:`task-${e.task_id}`,title:`Open task: ${(e.content||e.task_id||"").slice(0,50)}`,hint:`${e.from_name||"?"} → ${e.to_name||"?"} \xb7 ${e.status||""}`,group:"Tasks",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:t=>t.push(`/tasks/${encodeURIComponent(e.task_id)}`)}));u([...r,...n])}catch{}})(),()=>{e=!0}},[s]);let p=(0,r.useMemo)(()=>{let e=[...w,...x];if(!l.trim()){let t=h.map(t=>e.find(e=>e.id===t)).filter(e=>!!e).map(e=>({...e,group:"Recents"})),a=new Set(h);return[...t,...w.filter(e=>!a.has(e.id))]}let t=e.map(e=>{let t=y(e.title,l),a=e.hint?y(e.hint,l):{score:-1,indices:[]},s=y(e.id,l);return{c:e,score:Math.max(t.score>=0?+t.score:-1/0,a.score>=0?.6*a.score:-1/0,s.score>=0?.3*s.score:-1/0),_titleHi:t.score>=0?t.indices:[],_hintHi:a.score>=0?a.indices:[]}}).filter(e=>e.score>-1/0);return t.sort((e,t)=>t.score-e.score),t.map(e=>({...e.c,_titleHi:e._titleHi,_hintHi:e._hintHi}))},[l,h,x]);if((0,r.useEffect)(()=>{i>=p.length&&c(0)},[p.length,i]),!s)return null;let g={};for(let e of p)(g[e.group]||=[]).push(e);let f=0;return(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"anet-cmdk fixed inset-0 z-[100] flex items-start justify-center pt-[10vh] sm:pt-[15vh] px-4",onClick:()=>n(!1),onKeyDown:t=>{if("Escape"===t.key)return void n(!1);if("ArrowDown"===t.key){t.preventDefault(),c(e=>Math.min(e+1,p.length-1));return}if("ArrowUp"===t.key){t.preventDefault(),c(e=>Math.max(e-1,0));return}if("Enter"===t.key){t.preventDefault();let a=p[i];a&&(v(a.id),a.perform(e),n(!1))}},children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-xl rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-[#2a2a4a] px-3 py-2.5",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500 shrink-0",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,t.jsx)("input",{ref:d,value:l,onChange:e=>{o(e.target.value),c(0)},placeholder:"Type a command or search…",className:"flex-1 bg-transparent text-sm text-gray-200 placeholder-gray-600 focus:outline-none"}),(0,t.jsx)("kbd",{className:"text-[10px] text-gray-600 border border-[#2a2a4a] rounded px-1.5 py-0.5 font-mono",children:"esc"})]}),(0,t.jsx)("div",{className:"max-h-[60vh] overflow-y-auto py-2",children:0===p.length?(0,t.jsxs)("div",{className:"px-4 py-8 text-center text-xs text-gray-600",children:['No commands match "',l,'"']}):Object.entries(g).map(([a,s])=>(0,t.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 px-3 py-1",children:a}),s.map(a=>{let s=f++,r=s===i;return(0,t.jsxs)("button",{onMouseEnter:()=>c(s),onClick:()=>{v(a.id),a.perform(e),n(!1)},className:`anet-cmdk-row w-full flex items-center gap-3 px-3 py-2 text-left text-sm ${r?"bg-cyan-500/10 text-cyan-300":"text-gray-300 hover:bg-[#1a1a2a]/50"}`,children:[(0,t.jsx)("span",{className:r?"text-cyan-400":"text-gray-500",children:a.icon}),(0,t.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"block truncate",children:(0,t.jsx)(j,{text:a.title,indices:a._titleHi||[]})}),a.hint&&(0,t.jsx)("span",{className:"block text-[11px] text-gray-600 truncate",children:(0,t.jsx)(j,{text:a.hint,indices:a._hintHi||[]})})]}),r&&(0,t.jsx)("span",{className:"text-[10px] text-gray-500",children:"↵"})]},a.id)})]},a))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-3 py-1.5 flex items-center justify-between text-[10px] text-gray-600",children:[(0,t.jsxs)("span",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↵"})," select"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," close"]})]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"⌘K"})," toggle"]})]})]})]})}let M=[{group:"Global",items:[{keys:["⌘","K"],label:"Open command palette (also Ctrl+K)"},{keys:["/"],label:"Open command palette"},{keys:["?"],label:"Toggle this help overlay"},{keys:["Esc"],label:"Close any open modal"}]},{group:"Navigate (vim-style)",items:[{keys:["g","o"],label:"Go to Overview"},{keys:["g","t"],label:"Go to Tasks"},{keys:["g","n"],label:"Go to Nodes"},{keys:["g","m"],label:"Go to Messages"},{keys:["g","w"],label:"Go to Networks"},{keys:["g","a"],label:"Go to Admin"},{keys:["g","l"],label:"Go to Audit Log"},{keys:["g","s"],label:"Go to Settings"}]},{group:"Command palette",items:[{keys:["↑","↓"],label:"Move selection"},{keys:["↵"],label:"Activate selected command"},{keys:["type"],label:"Filter — searches commands, agents, tasks"}]}],C={o:"/",t:"/tasks",n:"/nodes",m:"/messages",w:"/settings/networks",a:"/admin",l:"/logs",s:"/settings"};function _(){let[e,s]=(0,r.useState)(!1),n=(0,a.useRouter)(),l=(0,r.useRef)(0);return((0,r.useEffect)(()=>{let t=t=>{let a=document.activeElement?.tagName,r="INPUT"===a||"TEXTAREA"===a||document.activeElement?.isContentEditable;if("?"===t.key&&!r){t.preventDefault(),s(e=>!e);return}if("Escape"===t.key&&e&&s(!1),!r&&!t.metaKey&&!t.ctrlKey&&!t.altKey){if("g"===t.key){l.current=Date.now();return}if(Date.now()-l.current<1500){let e=C[t.key.toLowerCase()];e&&(t.preventDefault(),l.current=0,n.push(e))}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,n]),e)?(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:"anet-help fixed inset-0 z-[101] flex items-center justify-center px-4",onClick:()=>s(!1),children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#2a2a4a] px-4 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-200",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Keyboard shortcuts"]}),(0,t.jsx)("button",{onClick:()=>s(!1),"aria-label":"Close help",className:"text-gray-500 hover:text-gray-300 text-lg leading-none px-1",children:"×"})]}),(0,t.jsx)("div",{className:"px-4 py-3 max-h-[70vh] overflow-y-auto",children:M.map(e=>(0,t.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-1.5",children:e.group}),(0,t.jsx)("ul",{className:"space-y-1.5",children:e.items.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsx)("span",{className:"flex items-center gap-1",children:e.keys.map((e,a)=>(0,t.jsx)("kbd",{className:"text-[10px] font-mono border border-[#2a2a4a] rounded px-1.5 py-0.5 text-gray-400 bg-[#1a1a2a]/40",children:e},a))}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.label})]},a))})]},e.group))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-4 py-1.5 text-[10px] text-gray-600 flex items-center justify-between",children:[(0,t.jsxs)("span",{children:["Press ",(0,t.jsx)("kbd",{className:"font-mono",children:"?"})," to toggle"]}),(0,t.jsxs)("span",{children:["or ",(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," to close"]})]})]})]}):null}let S=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");if(!t.ok)throw Error(`hub ${t.status}`);return t.json()};function E({pct:e,label:a}){let s=e>=85?{fill:"#ef4444",track:"rgb(239 68 68 / 0.16)"}:e>=60?{fill:"#f59e0b",track:"rgb(245 158 11 / 0.16)"}:{fill:"#10b981",track:"rgb(16 185 129 / 0.16)"},r=Math.max(0,Math.min(100,e));return(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex justify-between text-[10px] text-[var(--fg-muted)] font-mono",children:[(0,t.jsx)("span",{children:a}),(0,t.jsxs)("span",{className:"tabular-nums",children:[Math.round(r),"%"]})]}),(0,t.jsx)("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:s.track},children:(0,t.jsx)("div",{className:"h-full transition-[width] duration-300 ease-out",style:{width:`${r}%`,background:s.fill}})})]})}function A(){let[e,a]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{"1"===localStorage.getItem("anet-servers-drawer")&&a(!0)}catch{}},[]);let{data:s,error:l}=(0,n.default)(e?"/api/hub/servers":null,S,{refreshInterval:5e3,dedupingInterval:3e3}),o=s?.servers??[],i=s?.unavailable===!0,c=o.filter(e=>"online"===e.status).length,d=e&&!s&&!l;return(0,t.jsxs)("aside",{className:"fixed right-0 top-20 z-40 hidden lg:flex flex-col rounded-l-xl border border-r-0 shadow-xl shadow-black/30 anet-fade-in",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",width:e?296:40,maxHeight:"calc(100vh - 6rem)",transition:"width 200ms ease-out"},"aria-label":"Servers panel",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>{let t=!e;try{localStorage.setItem("anet-servers-drawer",t?"1":"0")}catch{}return t}),"aria-expanded":e,"aria-label":e?"Collapse servers panel":"Expand servers panel",className:"flex items-center gap-2 px-2.5 py-2 border-b text-[11px] font-semibold tracking-wide select-none",style:{color:"var(--fg)",borderColor:"var(--border)"},children:[(0,t.jsxs)("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"3",y:"4",width:"18",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"3",y:"14",width:"18",height:"6",rx:"1.5"}),(0,t.jsx)("circle",{cx:"7",cy:"7",r:"0.7",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"7",cy:"17",r:"0.7",fill:"currentColor"})]}),e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"flex-1 text-left",children:"Servers"}),(0,t.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono",children:[c,"/",o.length]})]})]}),e&&(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-2 py-2 space-y-2","data-servers-body":!0,children:[d&&(0,t.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4",children:"loading servers…"}),l&&!s&&(0,t.jsx)("div",{className:"rounded-md border px-2.5 py-2 text-[10px] font-mono",style:{background:"rgb(239 68 68 / 0.06)",borderColor:"rgb(239 68 68 / 0.25)",color:"#ef4444"},children:"hub unreachable · retrying every 5s"}),i&&(0,t.jsxs)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-3 leading-relaxed",children:["host telemetry not available",(0,t.jsx)("br",{}),(0,t.jsx)("span",{className:"text-[var(--fg-dim)]",children:"upgrade commhub-server ≥ 0.8.1-preview.2"})]}),!d&&!l&&!i&&0===o.length&&(0,t.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4",children:"no servers reporting yet"}),o.map(e=>{let a="offline"===e.status,s=null!=e.cpu_load_1min&&e.cpu_cores>0?e.cpu_load_1min/e.cpu_cores*100:null,r=null!=e.mem_used_gb&&null!=e.mem_total_gb&&e.mem_total_gb>0?e.mem_used_gb/e.mem_total_gb*100:null;return(0,t.jsxs)("div",{className:"rounded-lg border px-2.5 py-2 space-y-1.5",style:{background:"var(--bg)",borderColor:"var(--border)",opacity:a?.55:1},title:e.ip?`${e.hostname} \xb7 ${e.ip}`:e.hostname,children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"font-mono text-[12px] font-semibold truncate",style:{color:"var(--fg)"},children:e.hostname}),e.note&&(0,t.jsxs)("span",{className:"text-[9px] text-[var(--fg-dim)]",children:["(",e.note,")"]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono tabular-nums shrink-0",children:[e.agent_count," agent",1===e.agent_count?"":"s"]})]}),!a&&null!=s&&(0,t.jsx)(E,{pct:s,label:`CPU ${e.cpu_load_1min.toFixed(2)}/${e.cpu_cores}`}),!a&&null!=r&&(0,t.jsx)(E,{pct:r,label:`RAM ${e.mem_used_gb.toFixed(1)}/${e.mem_total_gb.toFixed(1)}G`}),a&&(0,t.jsx)("div",{className:"text-[10px] text-[var(--fg-dim)] font-mono italic",children:"CPU n/a · RAM n/a · offline"})]},e.hostname)}),o.length>0&&(0,t.jsx)("div",{className:"pt-1 text-[9px] text-[var(--fg-dim)] font-mono text-center",children:"live · refreshing every 5s"})]})]})}let L=["/login"];e.s(["AppShell",0,function({children:e}){let s=(0,a.usePathname)();return L.includes(s)?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex min-h-screen",children:[(0,t.jsx)(h,{}),(0,t.jsxs)("main",{className:"flex-1 min-w-0 flex flex-col",children:[(0,t.jsx)(g,{}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:e})]}),(0,t.jsx)(N,{}),(0,t.jsx)(_,{}),(0,t.jsx)(A,{})]})}],22485)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59276,e=>{"use strict";var s=e.i(12629),a=e.i(11449);let t=async e=>{let s=await fetch(e);if(401===s.status)throw window.location.assign("/login"),Error("unauthorized");return s.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,s){if(!s)return e;let a=e.includes("?")?"&":"?";return`${e}${a}network_id=${encodeURIComponent(s)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,s.default)("/api/anet/config",t,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/health",t,r);return{health:e||null,error:a}},"useLicense",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/license",t,{refreshInterval:6e4});return{license:e?.ok?e:null,error:a}},"useMessages",0,function(e=100){let{networkId:l}=(0,a.useNetworkId)(),{data:i,error:c,isLoading:d}=(0,s.default)(n(`/api/hub/messages?limit=${e}`,l),t,r);return{messages:i?.messages||[],error:c,isLoading:d}},"useSessions",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i,isLoading:c}=(0,s.default)(n("/api/hub/status",e),t,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:c}},"useStats",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i}=(0,s.default)(n("/api/hub/stats",e),t,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,a.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:c,error:d,isLoading:o}=(0,s.default)(n(`/api/hub/tasks?${i}`,l),t,r);return{tasks:c?.tasks||[],count:c?.count??0,source:c?.source,error:d,isLoading:o}}])},70286,e=>{"use strict";e.s(["DASHBOARD_VERSION",0,"0.4.6-preview.31"],70286)},65610,e=>{"use strict";var s=e.i(22381),a=e.i(23910),t=e.i(56839),r=e.i(59276),n=e.i(70286);e.s(["default",0,function(){let{config:e}=(0,r.useAnetConfig)(),{health:l}=(0,r.useHealth)(),{license:i}=(0,r.useLicense)(),[c,d]=(0,a.useState)(""),[o,x]=(0,a.useState)(""),[m,h]=(0,a.useState)(""),[g,u]=(0,a.useState)(""),[p,N]=(0,a.useState)(""),b="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",j="break-all sm:max-w-[320px] sm:text-right";return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white mb-3 lg:ml-0 ml-10",children:"Settings"}),(0,s.jsx)("nav",{className:"mb-8 flex flex-wrap gap-1 text-xs",children:[{href:"#connection",label:"Connection"},{href:"#account",label:"Account"},{href:"#resources",label:"Resources"}].map(e=>(0,s.jsx)("a",{href:e.href,className:"rounded-md px-2.5 py-1 text-gray-500 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors",children:e.label},e.href))}),(0,s.jsxs)("div",{className:"max-w-2xl space-y-10",children:[(0,s.jsxs)("div",{id:"connection",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Connection"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"CommHub Connection"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,s.jsx)("span",{className:`text-cyan-300 ${j}`,children:e?.hub||"not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:e?.source==="file"?"Local file (~/.anet/config.json)":e?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Auth Token"}),(0,s.jsx)("span",{className:`${e?.tokenConfigured?"text-green-400":"text-red-400"} ${j}`,children:e?.tokenConfigured?`Configured (${e.tokenPreview})`:"Not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,s.jsx)("span",{className:`${l?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:l?.auth||"--"})]}),e?.error&&(0,s.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:e.error})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.version||"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.sessions??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsxs)("span",{className:"text-gray-500",children:["SSE streams ",(0,s.jsx)("span",{className:"text-gray-600",children:"· server"})]}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.sse_connections??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.uptime?`${Math.floor(l.uptime/3600)}h ${Math.floor(l.uptime%3600/60)}m`:"--"})]})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 font-mono ${j}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:n.DASHBOARD_VERSION})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:"Overview, Tasks, Nodes, Messages, Networks, Audit, Server Logs, Admin, Settings"})]})]})]})]}),(0,s.jsxs)("div",{id:"account",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Account"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:["License",i?.license&&(0,s.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded-full border ${"pro"===i.license.type?"text-green-300 bg-green-500/10 border-green-500/30":i.license.days_left<=7?"text-red-300 bg-red-500/10 border-red-500/30":"text-amber-300 bg-amber-500/10 border-amber-500/30"}`,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"w-1.5 h-1.5 rounded-full bg-current"}),i.license.type,i.license.days_left?` \xb7 ${i.license.days_left}d left`:""]})]}),i?.license?(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[i.license.days_left<=7&&(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-red-400 font-medium",children:"⚠ Expiring soon"}),(0,s.jsxs)("span",{className:"text-red-400",children:[i.license.days_left," days left"]})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Expires"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.license.expires_at})]}),i.limits&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Agents"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_agents})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Networks"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_networks})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Tasks/Day"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_tasks_day})]})]}),(0,s.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:"anet-XXXX-XXXX-XXXX-XXXX",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!c.trim())return;let e=await fetch("/api/hub/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:c})}),s=await e.json();x(s.ok?`Activated: ${s.type}`:`Failed: ${s.error}`),s.ok&&d(""),setTimeout(()=>x(""),5e3)},className:"px-3 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded transition-colors",children:"Activate"})]}),o&&(0,s.jsx)("div",{className:`mt-2 text-xs ${o.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:o})]})]}):(0,s.jsx)("div",{className:"text-xs text-gray-600",children:"License info not available"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("input",{type:"password",value:m,onChange:e=>h(e.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("input",{type:"password",value:g,onChange:e=>u(e.target.value),placeholder:"New password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!m||!g)return;let e=sessionStorage.getItem("anet_v3_auth");if(!e)return void N("Not logged in with V3 auth");let{token:s}=JSON.parse(e),a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:s,current_password:m,new_password:g})}),t=await a.json();if(N(t.ok?"Password changed":`Failed: ${t.error}`),t.ok){if(t.token){let s=JSON.parse(e);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...s,token:t.token}))}h(""),u("")}setTimeout(()=>N(""),5e3)},disabled:!m||!g,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),p&&(0,s.jsx)("div",{className:`mt-2 text-xs ${p.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:p})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Sign out"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Signing out clears your dashboard session cookie. You'll return to the login page."}),(0,s.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login")},className:"px-4 py-2 bg-transparent hover:bg-[#1a1a2a] text-gray-300 text-sm rounded-lg border border-[#2a2a4a] hover:border-[#3a3a5a] transition-colors",children:"Sign out"})]})]}),(0,s.jsxs)("div",{id:"resources",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Resources"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)(t.default,{href:"/settings/tokens",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"API Tokens"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create and manage tokens for CLI access."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,s.jsxs)(t.default,{href:"/settings/networks",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Networks"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create, manage, and delete agent networks."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]})]})]})]})]})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3479,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},76161,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(56839);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function i({variant:e="generic",title:s,sub:o,cta:l,compact:c=!1}){let x=r[e],d=s??x.title,h=o??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(n,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),l&&(0,t.jsx)("div",{className:"mt-4",children:l.href?(0,t.jsxs)(a.default,{href:l.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[l.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:l.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[l.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function o({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#2a2a4a] bg-[#111128] shadow-lg shadow-black/20",children:e})}function l({cmd:e}){let[a,r]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,i,"NodesEmptyState",0,function({hint:e,taskHistoryCount:s=0}){return e?.global_count?(0,t.jsx)(o,{children:(0,t.jsx)(i,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`})}):s>0?(0,t.jsx)(o,{children:(0,t.jsx)(i,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${s.toLocaleString()} task${1===s?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(o,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(l,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})})}])},21743,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(56839),r=e.i(3479),n=e.i(76161);e.s(["default",0,function(){let[e,i]=(0,s.useState)([]),[o,l]=(0,s.useState)(!0),[c,x]=(0,s.useState)(""),[d,h]=(0,s.useState)({}),m=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/hub/tokens"),t=await e.json();i(t.tokens||[])}catch{}finally{l(!1)}},[]);(0,s.useEffect)(()=>{m()},[m]);let y=async()=>{if(c.trim())try{let e=sessionStorage.getItem("anet_v3_auth");if(!e)return;let{token:t}=JSON.parse(e),s=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create_token",token:t,name:c})}),a=await s.json();a.ok?(h({token:a.token}),x(""),m()):h({error:a.error})}catch{h({error:"Failed"})}},g=async e=>{try{let t=sessionStorage.getItem("anet_v3_auth");if(!t)return;let{token:s}=JSON.parse(t);await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"revoke_token",token:s,token_id:e})}),m()}catch{}};return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)(a.default,{href:"/settings",className:"text-gray-500 hover:text-gray-300 text-sm lg:ml-0 ml-10",children:"← Settings"}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-white",children:"API Tokens"})]}),(0,t.jsxs)("div",{className:"max-w-2xl space-y-6",children:[(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Create Token"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:c,onChange:e=>x(e.target.value),placeholder:"Token name (e.g. my-cli)",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,t.jsx)("button",{onClick:y,disabled:!c.trim(),className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 text-white text-sm rounded-lg transition-colors",children:"Create"})]}),d.token&&(0,t.jsxs)("div",{className:"mt-3 bg-green-500/5 border border-green-500/20 rounded-lg px-3 py-2",children:[(0,t.jsx)("div",{className:"text-xs text-green-400 mb-1",children:"Token created (copy now, shown only once):"}),(0,t.jsx)("code",{className:"text-sm text-green-300 break-all select-all",children:d.token})]}),d.error&&(0,t.jsx)("div",{className:"mt-2 text-xs text-red-400",children:d.error})]}),(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:["Active Tokens (",e.length,")"]}),o?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2].map(e=>(0,t.jsx)("div",{className:"h-12 bg-gray-800/20 rounded"},e))}):0===e.length?(0,t.jsx)(n.EmptyState,{variant:"tokens",compact:!0,sub:"Tokens authenticate CLI tools and external integrations. Sign in with V3 auth, then create one above."}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a]",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-white font-medium",children:e.name}),(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded border ${"full"===e.scope?"text-cyan-300 border-cyan-500/20 bg-cyan-500/5":"text-gray-400 border-gray-600/20"}`,children:e.scope})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500",children:[e.token_id," · network: ",e.network_id?.slice(0,12)||"--"," · used ",(0,r.timeAgo)(e.last_used_at)]})]}),(0,t.jsx)("button",{onClick:()=>g(e.token_id),className:"text-xs text-red-400 hover:text-red-300 px-2 py-1 rounded border border-red-800/30 hover:bg-red-500/10 transition-colors",children:"Revoke"})]},e.token_id))})]})]})]})}])}]);
|