@sleep2agi/agent-network-dashboard 0.6.3-preview.43 → 0.6.3-preview.44
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_COMMIT +1 -0
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +78 -78
- package/.next/fallback-build-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.js.nft.json +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 +1 -1
- package/.next/server/app/admin/page.js.nft.json +1 -1
- 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 +1 -1
- 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 +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- 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 +1 -1
- 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.js.nft.json +1 -1
- 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 +1 -1
- 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.js.nft.json +1 -1
- 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 +1 -1
- 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.js.nft.json +1 -1
- 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 +1 -1
- 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.js.nft.json +1 -1
- 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 +1 -1
- 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.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/providers/page.js.nft.json +1 -1
- package/.next/server/app/providers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/providers.html +2 -2
- package/.next/server/app/providers.rsc +14 -14
- package/.next/server/app/providers.segments/_full.segment.rsc +14 -14
- package/.next/server/app/providers.segments/_head.segment.rsc +4 -4
- package/.next/server/app/providers.segments/_index.segment.rsc +7 -7
- package/.next/server/app/providers.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/providers.segments/providers.segment.rsc +3 -3
- package/.next/server/app/server-logs/page.js.nft.json +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 +1 -1
- 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/servers/page.js.nft.json +1 -1
- package/.next/server/app/servers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/servers.html +2 -2
- package/.next/server/app/servers.rsc +14 -14
- package/.next/server/app/servers.segments/_full.segment.rsc +14 -14
- package/.next/server/app/servers.segments/_head.segment.rsc +4 -4
- package/.next/server/app/servers.segments/_index.segment.rsc +7 -7
- package/.next/server/app/servers.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/servers.segments/servers/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/servers.segments/servers.segment.rsc +3 -3
- package/.next/server/app/settings/networks/page.js.nft.json +1 -1
- 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 +1 -1
- 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.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens/page.js.nft.json +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 +1 -1
- 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 +1 -1
- 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.js.nft.json +1 -1
- package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks/page.js.nft.json +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 +1 -1
- 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]__0jns048._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0jns048._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0va6h-y._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0va6h-y._.js.map +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__056tw5g._.js → [root-of-the-server]__0z0lvdf._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0z0lvdf._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__13svd64._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__13svd64._.js.map +1 -0
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_0f4savf._.js +3 -3
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_0f4savf._.js.map +1 -1
- package/.next/server/chunks/ssr/{dash-492_agent-network-dashboard_app_12yiaen._.js → dash-492_agent-network-dashboard_app_07foku.._.js} +2 -2
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_07foku.._.js.map +1 -0
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0fv9~x1._.js +1 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0fv9~x1._.js.map +1 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0jey2is._.js +3 -0
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0jey2is._.js.map +1 -0
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0tbukk6._.js +3 -0
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0tbukk6._.js.map +1 -0
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_10nv4wt._.js +3 -0
- package/.next/server/chunks/ssr/{dash-492_agent-network-dashboard_app_02~ml1y._.js.map → dash-492_agent-network-dashboard_app_10nv4wt._.js.map} +1 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_components_07gcm8v._.js +3 -3
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_components_07gcm8v._.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/static/chunks/0.t9q6b8-tp7o.js +1 -0
- package/.next/static/chunks/03kazq4f2o8kc.js +1 -0
- package/.next/static/chunks/0adq.v18n1i97.js +7 -0
- package/.next/static/chunks/{07hmiozabjis~.js → 0b3jrmai2phnc.js} +1 -1
- package/.next/static/chunks/0casvy.vqveum.js +7 -0
- package/.next/static/chunks/0e3gktr80d3im.js +2 -0
- package/.next/static/chunks/0jgo1j.i.wd5q.js +7 -0
- package/.next/static/chunks/0mqxob_pphde0.js +1 -0
- package/.next/static/chunks/0uj3h67aerffm.js +1 -0
- package/.next/static/chunks/0ws5f9sp.pgiv.js +1 -0
- package/.next/static/chunks/16._eot2r-z1r.js +1 -0
- package/.next/static/chunks/17bch5v2vnph5.js +4 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/app/components/ChatPopover.tsx +9 -2
- package/app/components/Sidebar.tsx +14 -1
- package/app/components/TaskChatPanel.tsx +11 -3
- package/app/components/TopoGraph.tsx +25 -11
- package/app/lib/presence.ts +43 -0
- package/app/page.tsx +7 -11
- package/package.json +1 -1
- package/tests/e2e-515-presence-predicate.spec.ts +75 -0
- package/tests/e2e-515-presence.spec.ts +148 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__056tw5g._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__06g2-qq._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__06g2-qq._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0qv41lg._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0qv41lg._.js.map +0 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_02~ml1y._.js +0 -3
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_04nejob._.js +0 -3
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_04nejob._.js.map +0 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0kehfih._.js +0 -3
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0kehfih._.js.map +0 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0vvr81v._.js +0 -3
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0vvr81v._.js.map +0 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0~9qq2o._.js +0 -3
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_0~9qq2o._.js.map +0 -1
- package/.next/server/chunks/ssr/dash-492_agent-network-dashboard_app_12yiaen._.js.map +0 -1
- package/.next/static/chunks/00kg.oomong9m.js +0 -1
- package/.next/static/chunks/02a6-zbyr.zoy.js +0 -2
- package/.next/static/chunks/06ww0tn_jfcfd.js +0 -1
- package/.next/static/chunks/0_90al8hntttb.js +0 -1
- package/.next/static/chunks/0idb.71vziyhz.js +0 -7
- package/.next/static/chunks/0qw7i_y5i75.q.js +0 -1
- package/.next/static/chunks/0szzm0ma-335n.js +0 -4
- package/.next/static/chunks/0xxfl.bqy.bd4.js +0 -7
- package/.next/static/chunks/0yscbgm2a_d1u.js +0 -1
- package/.next/static/chunks/0zj956.f-k1jj.js +0 -7
- package/.next/static/chunks/17ns4oqzib99e.js +0 -1
- /package/.next/static/{BXw6vds1QR_zb-M-KgpT7 → VeCvA8ZJHnHbQwP2X4xfs}/_buildManifest.js +0 -0
- /package/.next/static/{BXw6vds1QR_zb-M-KgpT7 → VeCvA8ZJHnHbQwP2X4xfs}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{BXw6vds1QR_zb-M-KgpT7 → VeCvA8ZJHnHbQwP2X4xfs}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { test, expect, Page } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
const BASE = process.env.TEST_URL || 'http://localhost:3100';
|
|
4
|
+
|
|
5
|
+
// #515 regression test: stats card / sidebar / topology legend must show
|
|
6
|
+
// the SAME "online" count when fed identical hub state. Historically each
|
|
7
|
+
// site computed its own predicate (`isOnline = ...`) and they drifted
|
|
8
|
+
// (page 95, sidebar 99, legend 99) — the fix extracts a single shared
|
|
9
|
+
// presence.isOnline() in app/lib/presence.ts.
|
|
10
|
+
//
|
|
11
|
+
// SCOPE OF THIS TEST — this proves "given the same data, the 3 DOM
|
|
12
|
+
// consumers render the same number", AND that number is the SSE-reachable
|
|
13
|
+
// count (not the status-based count). It does NOT prove the wire fetch
|
|
14
|
+
// gets sse_sessions from the right upstream endpoint — for that, see the
|
|
15
|
+
// production-dashboard "before" screenshot referenced in the PR body and
|
|
16
|
+
// the deploy-time smoke test. See memory
|
|
17
|
+
// feedback_unit_mock_hides_wire_shape_bugs for why one class of evidence
|
|
18
|
+
// doesn't cover the other.
|
|
19
|
+
//
|
|
20
|
+
// Fixture design (deliberately asymmetric):
|
|
21
|
+
// - SSE-reachable count differs from status-based count in ABSOLUTE
|
|
22
|
+
// value, so `expect(x).toBe(EXPECTED)` catches a mutation of the
|
|
23
|
+
// shared predicate (finding: card=sidebar=legend but wrong number)
|
|
24
|
+
// as well as drift (finding: two of three read the same, one different).
|
|
25
|
+
// - Includes a `SSE:0` node to gate the `> 0` fix from PR #52 round 2
|
|
26
|
+
// (findings 1) — a `!== undefined` predicate would count agent-06.
|
|
27
|
+
|
|
28
|
+
const FIXTURE_STATUS = {
|
|
29
|
+
sessions: [
|
|
30
|
+
// present in SSE map AND status alive
|
|
31
|
+
{ alias: 'agent-01', status: 'working', network_id: 'net_a' },
|
|
32
|
+
{ alias: 'agent-02', status: 'idle', network_id: 'net_a' },
|
|
33
|
+
// present in SSE map but hub row is stale — SSE wins
|
|
34
|
+
{ alias: 'agent-03', status: 'offline', network_id: 'net_a' },
|
|
35
|
+
// NOT in SSE map, hub row still says working (the classic zombie)
|
|
36
|
+
{ alias: 'agent-04', status: 'working', network_id: 'net_a' },
|
|
37
|
+
// NOT in SSE map, hub row still says idle
|
|
38
|
+
{ alias: 'agent-05', status: 'idle', network_id: 'net_a' },
|
|
39
|
+
// SSE map value is literally 0 (dead-connection edge from an older
|
|
40
|
+
// hub that didn't clean up empty client arrays; #515 round-2
|
|
41
|
+
// finding 1). Correct behaviour: NOT online.
|
|
42
|
+
{ alias: 'agent-06', status: 'working', network_id: 'net_a' },
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const FIXTURE_HEALTH = {
|
|
47
|
+
ok: true,
|
|
48
|
+
version: '0.9.0-test',
|
|
49
|
+
sessions: 6,
|
|
50
|
+
sse_connections: 3,
|
|
51
|
+
sse_sessions: {
|
|
52
|
+
'net_a:agent-01': 1,
|
|
53
|
+
'net_a:agent-02': 1,
|
|
54
|
+
'net_a:agent-03': 1,
|
|
55
|
+
'net_a:agent-06': 0, // dead-connection edge — MUST NOT count as online
|
|
56
|
+
},
|
|
57
|
+
uptime: 1,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// SSE-reachable with count > 0: agent-01, 02, 03 = 3
|
|
61
|
+
// Status-based (retired): agent-01, 02, 04, 05, 06 = 5
|
|
62
|
+
// `sseCountFor !== undefined` (finding 1 bug): 01, 02, 03, 06 = 4
|
|
63
|
+
// Under status mutation → all three consumers agree on 5, absolute
|
|
64
|
+
// assertion catches. Under `!== undefined` regression → all three
|
|
65
|
+
// agree on 4, absolute assertion catches too. Under drift (one
|
|
66
|
+
// consumer reverts to inline old) → one reads 5, others read 3.
|
|
67
|
+
const EXPECTED_ONLINE = 3;
|
|
68
|
+
|
|
69
|
+
async function login(context: Page['context'] extends () => infer C ? C : never) {
|
|
70
|
+
const res = await context.request.post(`${BASE}/api/auth/login`, {
|
|
71
|
+
data: { password: process.env.ANET_DASHBOARD_PASSWORD || 'admin123' },
|
|
72
|
+
});
|
|
73
|
+
const setCookie = res.headers()['set-cookie'] || '';
|
|
74
|
+
const match = setCookie.match(/anet_dashboard_session=([^;]+)/);
|
|
75
|
+
if (match) {
|
|
76
|
+
const domain = new URL(BASE).hostname;
|
|
77
|
+
await context.addCookies([{
|
|
78
|
+
name: 'anet_dashboard_session',
|
|
79
|
+
value: decodeURIComponent(match[1]),
|
|
80
|
+
domain,
|
|
81
|
+
path: '/',
|
|
82
|
+
}]);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function mockHubEndpoints(page: Page) {
|
|
87
|
+
await page.route('**/api/hub/status**', async (route) => {
|
|
88
|
+
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(FIXTURE_STATUS) });
|
|
89
|
+
});
|
|
90
|
+
await page.route('**/api/hub/health', async (route) => {
|
|
91
|
+
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(FIXTURE_HEALTH) });
|
|
92
|
+
});
|
|
93
|
+
await page.route('**/api/hub/nodes**', async (route) => {
|
|
94
|
+
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ nodes: [] }) });
|
|
95
|
+
});
|
|
96
|
+
await page.route('**/api/hub/tasks**', async (route) => {
|
|
97
|
+
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ tasks: [], _hint: {} }) });
|
|
98
|
+
});
|
|
99
|
+
await page.route('**/api/hub/stats**', async (route) => {
|
|
100
|
+
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({}) });
|
|
101
|
+
});
|
|
102
|
+
await page.route('**/api/hub/messages**', async (route) => {
|
|
103
|
+
await route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ messages: [] }) });
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
test.describe('#515 presence — one online count everywhere', () => {
|
|
108
|
+
test('stats card / sidebar / topology legend all show the same number', async ({ page, context }) => {
|
|
109
|
+
await login(context);
|
|
110
|
+
await mockHubEndpoints(page);
|
|
111
|
+
await page.goto(`${BASE}/`);
|
|
112
|
+
await expect(page.locator('text=/\\d+\\s*\\/\\s*\\d+\\s+online/i').first()).toBeVisible({ timeout: 20000 });
|
|
113
|
+
await page.waitForTimeout(1500);
|
|
114
|
+
|
|
115
|
+
// Structural anchors — body-text regex is too greedy across the
|
|
116
|
+
// multiple "N Online" phrases on the page.
|
|
117
|
+
const cardText = await page.getByText('Online', { exact: true }).first()
|
|
118
|
+
.evaluate(el => el.previousElementSibling?.textContent ?? null);
|
|
119
|
+
const sidebarText = await page.getByRole('link', { name: /Agent Network/i }).first().innerText();
|
|
120
|
+
const sidebarMatch = sidebarText.match(/(\d+)\s*\/\s*\d+\s+online/i);
|
|
121
|
+
const legendName = await page.getByRole('link', { name: /^\d+\s+online$/i }).first().getAttribute('aria-label')
|
|
122
|
+
|| await page.getByRole('link', { name: /^\d+\s+online$/i }).first().innerText();
|
|
123
|
+
const legendMatch = legendName.match(/(\d+)/);
|
|
124
|
+
|
|
125
|
+
const readings = {
|
|
126
|
+
card: cardText ? Number(cardText.trim()) : null,
|
|
127
|
+
sidebar: sidebarMatch ? Number(sidebarMatch[1]) : null,
|
|
128
|
+
legend: legendMatch ? Number(legendMatch[1]) : null,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
console.log('#515 presence readings:', JSON.stringify(readings));
|
|
132
|
+
|
|
133
|
+
// Strict equality per #515 acceptance: no tolerance, no `>0` sanity.
|
|
134
|
+
// The absolute value catches "shared predicate regressed" (all three
|
|
135
|
+
// agree but wrong); the pairwise equality catches "one consumer
|
|
136
|
+
// reverted to inline old predicate" (drift).
|
|
137
|
+
expect(readings.card).toBe(EXPECTED_ONLINE);
|
|
138
|
+
expect(readings.sidebar).toBe(EXPECTED_ONLINE);
|
|
139
|
+
expect(readings.legend).toBe(EXPECTED_ONLINE);
|
|
140
|
+
expect(readings.card).toBe(readings.sidebar);
|
|
141
|
+
expect(readings.sidebar).toBe(readings.legend);
|
|
142
|
+
|
|
143
|
+
await page.screenshot({
|
|
144
|
+
path: 'test-results/e2e-515-three-numbers-agree.png',
|
|
145
|
+
fullPage: false,
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../dash-492/agent-network-dashboard/app/components/utils.ts","../../../../../../dash-492/agent-network-dashboard/app/components/AliasAvatar.tsx","../../../../../../dash-492/agent-network-dashboard/app/lib/avatars.ts","../../../../../../dash-492/agent-network-dashboard/app/components/EmptyState.tsx","../../../../../../dash-492/agent-network-dashboard/app/lib/status.ts","../../../../../../dash-492/agent-network-dashboard/app/components/CollapsibleSearch.tsx"],"sourcesContent":["/** Round 82: strip the most common markdown markup from agent-to-agent\n * task / message bodies so single-line table previews read cleanly.\n * Full original content stays in the expanded row / drawer / title=. */\nexport function previewContent(raw: string | null | undefined): string {\n if (!raw) return '--';\n return raw\n .replace(/!\\[([^\\]]*)\\]\\([^)]*\\)/g, '$1') // images:  → alt\n .replace(/\\[([^\\]]+)\\]\\([^)]*\\)/g, '$1') // links: [text](href) → text\n .replace(/`([^`]+)`/g, '$1') // inline code: `x` → x\n .replace(/\\s+/g, ' ') // collapse whitespace\n .trim() || '--';\n}\n\n// Round 44 / Loop: timeAgo now delegates to the shared lib/time helper.\n// The old in-line `replace + 'Z'` parse appended a Z to already-ISO\n// inputs (producing \"…ZZ\", browser-fragile) — strict-superset semantics\n// preserved for SQL-style inputs, fixed for ISO. Plus a 'just now' fallback\n// when clock skew puts the timestamp in the future. Five callers benefit:\n// /admin · /logs · /settings/networks · InboxPanel · /messages.\nimport { relativeAgo } from '../lib/time';\nexport function timeAgo(dateStr: string): string {\n return relativeAgo(dateStr) ?? '--';\n}\n\nexport function statusColor(status: string, hasSse: boolean): string {\n if (hasSse && status === 'working') return 'bg-green-500';\n if (hasSse && status === 'idle') return 'bg-emerald-400';\n if (hasSse) return 'bg-blue-400';\n if (status === 'offline') return 'bg-gray-500';\n return 'bg-yellow-400';\n}\n","'use client';\n\nimport { useState } from 'react';\nimport { useAvatarUrl } from '../lib/avatars';\n\n/** Hue-hashed avatar pill for agent aliases. Same alias → same color across\n * every page (Messages, Nodes, TopoGraph). Use the `size` prop for inline\n * pills (16/20) vs card headers (28). Round 21 introduced the palette;\n * round 22 promotes it from app/messages to a shared component. */\n\nconst AVATAR_HUES = [180, 200, 220, 270, 300, 330, 30, 90];\n\nexport function aliasAvatarColors(alias: string): { bg: string; ring: string; text: string } {\n let h = 0;\n for (let i = 0; i < alias.length; i++) h = (h * 31 + alias.charCodeAt(i)) >>> 0;\n const hue = AVATAR_HUES[h % AVATAR_HUES.length];\n return {\n bg: `hsl(${hue} 55% 22%)`,\n ring: `hsl(${hue} 60% 45%)`,\n text: `hsl(${hue} 80% 78%)`,\n };\n}\n\nexport function aliasInitial(alias?: string): string {\n if (!alias) return '·';\n const ch = alias.trim().match(/[\\p{L}\\p{N}]/u)?.[0] || alias.trim()[0] || '·';\n return ch.toUpperCase();\n}\n\nfunction isGrokAlias(alias: string) {\n return /\\bgrok\\b|grok-build|grok测试员|grok-demo/i.test(alias);\n}\n\ninterface AliasAvatarProps {\n alias: string;\n size?: number;\n className?: string;\n}\n\nexport function AliasAvatar({ alias, size = 28, className = '' }: AliasAvatarProps) {\n // R24 (Vincent: 头像换血): a custom image (user-set or designed default)\n // wins over every generated style — ONE seam, all 13 avatar surfaces.\n // Shimmer while loading, silent fallback to the pill on error.\n const url = useAvatarUrl(alias);\n const [imgState, setImgState] = useState<'loading' | 'ready' | 'error'>('loading');\n // Reset when the url changes — React's endorsed adjust-during-render\n // pattern (no effect, no extra commit).\n const [prevUrl, setPrevUrl] = useState(url);\n if (url !== prevUrl) { setPrevUrl(url); setImgState('loading'); }\n if (url && imgState !== 'error') {\n return (\n <span\n className={`anet-alias-avatar relative inline-flex shrink-0 overflow-hidden rounded-full border border-[var(--border)] ${imgState === 'loading' ? 'animate-pulse bg-[var(--bg-elevated)]' : ''} ${className}`}\n style={{ width: size, height: size }}\n title={alias}\n aria-hidden\n >\n {/* eslint-disable-next-line @next/next/no-img-element */}\n <img\n src={url}\n alt=\"\"\n loading=\"lazy\"\n onLoad={() => setImgState('ready')}\n onError={() => setImgState('error')}\n className={`h-full w-full rounded-full object-cover transition-opacity duration-150 ${imgState === 'ready' ? 'opacity-100' : 'opacity-0'}`}\n />\n </span>\n );\n }\n if (isGrokAlias(alias)) {\n return (\n <span\n className={`anet-alias-avatar inline-flex items-center justify-center rounded-full border border-emerald-500/45 bg-emerald-950/70 shrink-0 ${className}`}\n style={{\n width: size,\n height: size,\n backgroundImage: 'url(/vendors/grok.svg)',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n backgroundSize: '68% 68%',\n }}\n title={alias}\n aria-hidden\n />\n );\n }\n\n const c = aliasAvatarColors(alias);\n const fs = Math.max(9, Math.round(size * 0.42));\n return (\n <span\n className={`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${className}`}\n style={{\n width: size,\n height: size,\n fontSize: fs,\n backgroundColor: c.bg,\n borderColor: c.ring,\n color: c.text,\n }}\n title={alias}\n aria-hidden\n >\n {aliasInitial(alias)}\n </span>\n );\n}\n","'use client';\n\nimport { useSyncExternalStore } from 'react';\n\n/* Loop R24 (Vincent 亲点: 头像换血) — custom avatar infrastructure.\n *\n * Resolution order, per alias:\n * 1. user override — localStorage map, settable in the node settings UI\n * 2. designed default — /avatars/manifest.json (static, alias → image URL);\n * the design-side illustration set lands there later with ZERO code\n * change (drop files under public/avatars/ + list them in the manifest)\n * 3. shared pool — manifest \"_pool\": [\"/avatars/…\", …]; aliases without an\n * explicit entry get a stable hash-picked illustration from the pool\n * 4. '' → caller falls back to the hue-hashed initial pill\n *\n * Hub-side persistence (cross-device) needs an RFC-024 whitelist extension\n * (`avatar_url` is not an editable flag today — update would return\n * invalid_patch); when the hub grows it, hydrate the store from the hub here\n * without touching any consumer.\n */\n\nconst STORE_KEY = 'anet_avatars_v1';\nconst AVATAR_EVENT = 'anet-avatars-updated';\n\nlet manifest: Record<string, string> | null = null;\nlet pool: string[] = [];\nlet manifestRequested = false;\n\n/* Stable per-alias index so a given agent keeps the same pool avatar across\n * sessions/devices (djb2 over code units — no Math.random, no ordering). */\nfunction poolPick(alias: string): string {\n if (!pool.length) return '';\n let h = 5381;\n for (let i = 0; i < alias.length; i++) h = ((h << 5) + h + alias.charCodeAt(i)) >>> 0;\n return pool[h % pool.length];\n}\n\nfunction fetchManifestOnce() {\n if (manifestRequested || typeof window === 'undefined') return;\n manifestRequested = true;\n fetch('/avatars/manifest.json', { cache: 'no-cache' })\n .then((r) => (r.ok ? r.json() : null))\n .then((j) => {\n if (j && typeof j === 'object' && !Array.isArray(j)) {\n const clean: Record<string, string> = {};\n for (const [k, v] of Object.entries(j as Record<string, unknown>)) {\n if (k.startsWith('_')) continue; // meta keys (\"_pool\", …)\n if (typeof v === 'string' && v.startsWith('/')) clean[k] = v;\n }\n const rawPool = (j as Record<string, unknown>)._pool;\n pool = Array.isArray(rawPool)\n ? rawPool.filter((p): p is string => typeof p === 'string' && p.startsWith('/'))\n : [];\n manifest = clean;\n window.dispatchEvent(new Event(AVATAR_EVENT));\n }\n })\n .catch(() => {});\n}\n\nfunction readMap(): Record<string, string> {\n if (typeof window === 'undefined') return {};\n try {\n const parsed = JSON.parse(window.localStorage.getItem(STORE_KEY) || '{}');\n return parsed && typeof parsed === 'object' ? parsed : {};\n } catch {\n return {};\n }\n}\n\nexport function getAvatarUrl(alias?: string | null): string {\n if (!alias) return '';\n return readMap()[alias] || manifest?.[alias] || poolPick(alias) || '';\n}\n\n/** Empty/whitespace url removes the override (falls back to manifest/pill). */\nexport function setAvatarUrl(alias: string, url: string) {\n if (typeof window === 'undefined' || !alias) return;\n try {\n const m = readMap();\n if (url.trim()) m[alias] = url.trim();\n else delete m[alias];\n window.localStorage.setItem(STORE_KEY, JSON.stringify(m));\n window.dispatchEvent(new Event(AVATAR_EVENT));\n } catch {}\n}\n\nlet version = 0;\nfunction subscribe(callback: () => void) {\n fetchManifestOnce();\n const bump = () => { version++; callback(); };\n window.addEventListener(AVATAR_EVENT, bump);\n window.addEventListener('storage', bump);\n return () => {\n window.removeEventListener(AVATAR_EVENT, bump);\n window.removeEventListener('storage', bump);\n };\n}\n\n/** Monotonic version for callers that resolve many aliases via plain\n * getAvatarUrl() inside render loops (map callbacks can't call hooks —\n * same idiom as chat-mute's useMuteVersion). Subscribing also kicks off\n * the lazy manifest fetch and re-renders the caller when it lands. */\nexport function useAvatarsVersion(): number {\n return useSyncExternalStore(subscribe, () => version, () => 0);\n}\n\nexport function useAvatarUrl(alias?: string | null): string {\n return useSyncExternalStore(subscribe, () => getAvatarUrl(alias), () => '');\n}\n","'use client';\n\nimport { useState } from 'react';\nimport Link from 'next/link';\n\nexport type EmptyVariant = 'nodes' | 'tasks' | 'messages' | 'logs' | 'tokens' | 'networks' | 'generic';\n\ninterface EmptyStateProps {\n /** Picks the icon glyph and default copy if title/sub omitted. */\n variant?: EmptyVariant;\n /** Optional override headline. */\n title?: string;\n /** Optional override sub-copy. */\n sub?: string;\n /** Optional CTA: text + href (internal) or onClick. */\n cta?: { label: string; href?: string; onClick?: () => void };\n /** Compact mode for in-card empty states (smaller padding). */\n compact?: boolean;\n}\n\nconst DEFAULTS: Record<EmptyVariant, { title: string; sub: string }> = {\n nodes: { title: 'No agents in this network', sub: 'Agent sessions will appear here once they connect to the CommHub.' },\n tasks: { title: 'No tasks yet', sub: 'Tasks will appear here when agents send them via CommHub.' },\n messages: { title: 'No messages', sub: 'Messages between agents will appear here.' },\n logs: { title: 'No audit logs', sub: 'Events will appear here when users register, login, or perform actions.' },\n tokens: { title: 'No API tokens', sub: 'Create one to authenticate CLI tools and external integrations.' },\n networks: { title: 'No networks found', sub: 'Create one or sign in with V3 auth to see your networks.' },\n generic: { title: 'Nothing here yet', sub: 'Data will appear here once available.' },\n};\n\n/**\n * Minimal monochrome SVG glyphs per variant. No filled shapes, no gradients,\n * no AI-decoration — just thin-stroke line art that fades into the page.\n * 64×64 viewBox; rendered at 56×56 (compact 40×40).\n */\nfunction Glyph({ variant, size }: { variant: EmptyVariant; size: number }) {\n const s = { width: size, height: size };\n const baseProps = {\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 1.25,\n strokeLinecap: 'round' as const,\n strokeLinejoin: 'round' as const,\n };\n\n switch (variant) {\n case 'nodes':\n // Mesh with dashed edges = \"nodes will land here\"\n return (\n <svg viewBox=\"0 0 64 64\" {...s}>\n <g {...baseProps}>\n <circle cx=\"32\" cy=\"14\" r=\"4\" />\n <circle cx=\"14\" cy=\"44\" r=\"4\" />\n <circle cx=\"50\" cy=\"44\" r=\"4\" />\n <line x1=\"32\" y1=\"18\" x2=\"14\" y2=\"40\" strokeDasharray=\"3 3\" opacity=\"0.6\" />\n <line x1=\"32\" y1=\"18\" x2=\"50\" y2=\"40\" strokeDasharray=\"3 3\" opacity=\"0.6\" />\n <line x1=\"18\" y1=\"44\" x2=\"46\" y2=\"44\" strokeDasharray=\"3 3\" opacity=\"0.6\" />\n </g>\n </svg>\n );\n case 'tasks':\n // Empty checkbox list\n return (\n <svg viewBox=\"0 0 64 64\" {...s}>\n <g {...baseProps}>\n <rect x=\"14\" y=\"14\" width=\"36\" height=\"6\" rx=\"1.5\" />\n <rect x=\"14\" y=\"26\" width=\"36\" height=\"6\" rx=\"1.5\" opacity=\"0.6\" />\n <rect x=\"14\" y=\"38\" width=\"36\" height=\"6\" rx=\"1.5\" opacity=\"0.35\" />\n </g>\n </svg>\n );\n case 'messages':\n // Speech bubble outline\n return (\n <svg viewBox=\"0 0 64 64\" {...s}>\n <g {...baseProps}>\n <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\" />\n <line x1=\"22\" y1=\"28\" x2=\"42\" y2=\"28\" opacity=\"0.5\" />\n <line x1=\"22\" y1=\"34\" x2=\"36\" y2=\"34\" opacity=\"0.5\" />\n </g>\n </svg>\n );\n case 'logs':\n // Document with lines\n return (\n <svg viewBox=\"0 0 64 64\" {...s}>\n <g {...baseProps}>\n <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\" />\n <path d=\"M40 12 v8 h8\" opacity=\"0.6\" />\n <line x1=\"24\" y1=\"32\" x2=\"40\" y2=\"32\" opacity=\"0.55\" />\n <line x1=\"24\" y1=\"38\" x2=\"40\" y2=\"38\" opacity=\"0.4\" />\n <line x1=\"24\" y1=\"44\" x2=\"34\" y2=\"44\" opacity=\"0.25\" />\n </g>\n </svg>\n );\n case 'tokens':\n // Key outline\n return (\n <svg viewBox=\"0 0 64 64\" {...s}>\n <g {...baseProps}>\n <circle cx=\"22\" cy=\"32\" r=\"8\" />\n <line x1=\"30\" y1=\"32\" x2=\"54\" y2=\"32\" />\n <line x1=\"44\" y1=\"32\" x2=\"44\" y2=\"38\" />\n <line x1=\"50\" y1=\"32\" x2=\"50\" y2=\"40\" />\n </g>\n </svg>\n );\n case 'networks':\n // Globe-ish concentric ovals\n return (\n <svg viewBox=\"0 0 64 64\" {...s}>\n <g {...baseProps}>\n <circle cx=\"32\" cy=\"32\" r=\"18\" />\n <ellipse cx=\"32\" cy=\"32\" rx=\"18\" ry=\"9\" opacity=\"0.55\" />\n <line x1=\"14\" y1=\"32\" x2=\"50\" y2=\"32\" opacity=\"0.55\" />\n <line x1=\"32\" y1=\"14\" x2=\"32\" y2=\"50\" opacity=\"0.55\" />\n </g>\n </svg>\n );\n case 'generic':\n default:\n // Soft sparkle outline\n return (\n <svg viewBox=\"0 0 64 64\" {...s}>\n <g {...baseProps}>\n <circle cx=\"32\" cy=\"32\" r=\"14\" strokeDasharray=\"3 3\" opacity=\"0.6\" />\n <circle cx=\"32\" cy=\"32\" r=\"3\" />\n </g>\n </svg>\n );\n }\n}\n\nexport function EmptyState({ variant = 'generic', title, sub, cta, compact = false }: EmptyStateProps) {\n const d = DEFAULTS[variant];\n const headline = title ?? d.title;\n const subcopy = sub ?? d.sub;\n const iconSize = compact ? 40 : 56;\n\n return (\n <div className={`text-center ${compact ? 'py-8' : 'py-16'} px-4`} role=\"status\">\n <div className=\"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500\" aria-hidden>\n <Glyph variant={variant} size={iconSize} />\n </div>\n <h3 className={`font-medium text-gray-300 ${compact ? 'text-sm' : 'text-base'}`}>{headline}</h3>\n {subcopy && (\n <p className={`text-gray-500 ${compact ? 'text-xs mt-1.5' : 'text-sm mt-2'} max-w-md mx-auto leading-relaxed`}>\n {subcopy}\n </p>\n )}\n {cta && (\n <div className=\"mt-4\">\n {cta.href ? (\n <Link href={cta.href} className=\"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300\">\n {cta.label}\n <span aria-hidden>→</span>\n </Link>\n ) : (\n <button onClick={cta.onClick} className=\"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300\">\n {cta.label}\n <span aria-hidden>→</span>\n </button>\n )}\n </div>\n )}\n </div>\n );\n}\n\n/** Round 105 (issue #90): centered card shell so the Overview empty state\n * reads as an intentional, layout-aligned card instead of bare text\n * floating in the content column. */\nfunction EmptyCard({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"max-w-2xl mx-auto rounded-xl border border-[#26262b] bg-[#161618] shadow-lg shadow-black/20\">\n {children}\n </div>\n );\n}\n\n/**\n * Overview-specific variant. Three cases:\n * 1. network-mismatch — agents exist globally, none in this network\n * 2. agents-offline — 0 registered now BUT task history exists, so this\n * is NOT a first run (round 105 / issue #90: showing \"Spin up your\n * first agent\" next to \"acked: 499\" was misleading)\n * 3. true first-run — 0 agents, 0 history → quickstart command\n */\nexport function NodesEmptyState({\n hint,\n taskHistoryCount = 0,\n}: {\n hint?: { global_count?: number; filtered_network?: string };\n taskHistoryCount?: number;\n}) {\n if (hint?.global_count) {\n return (\n <EmptyCard>\n <EmptyState\n variant=\"nodes\"\n title=\"No agents in this network\"\n sub={`Server has ${hint.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}\n />\n </EmptyCard>\n );\n }\n\n // Round 105 (issue #90): there's task history but no agents online right\n // now — they finished or disconnected. Don't pitch a first-run setup;\n // point at the history instead.\n if (taskHistoryCount > 0) {\n return (\n <EmptyCard>\n <EmptyState\n variant=\"nodes\"\n title=\"No agents online\"\n sub={`Every agent in this network is currently offline. ${taskHistoryCount.toLocaleString()} task${taskHistoryCount === 1 ? '' : 's'} in history — they may have finished their work or disconnected.`}\n cta={{ label: 'View task history', href: '/tasks' }}\n />\n </EmptyCard>\n );\n }\n\n // Round 52: true empty state (zero agents anywhere) — show the\n // quickstart command inline so users don't have to leave the dashboard\n // to figure out how to spin up their first agent.\n return (\n <EmptyCard>\n <div className=\"text-center py-16 px-4\" role=\"status\">\n <div className=\"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500\" aria-hidden>\n <svg viewBox=\"0 0 64 64\" width={56} height={56}>\n <g stroke=\"currentColor\" strokeWidth=\"1.5\" fill=\"none\">\n <rect x=\"10\" y=\"20\" width=\"44\" height=\"28\" rx=\"2\" />\n <rect x=\"20\" y=\"32\" width=\"6\" height=\"8\" opacity=\"0.5\" />\n <rect x=\"32\" y=\"32\" width=\"6\" height=\"8\" opacity=\"0.5\" />\n <rect x=\"44\" y=\"32\" width=\"4\" height=\"8\" opacity=\"0.5\" />\n <line x1=\"10\" y1=\"26\" x2=\"54\" y2=\"26\" opacity=\"0.4\" />\n <circle cx=\"14\" cy=\"23\" r=\"0.8\" fill=\"currentColor\" />\n </g>\n </svg>\n </div>\n <h3 className=\"font-medium text-gray-300 text-base\">Spin up your first agent</h3>\n <p className=\"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed\">\n Run this in a fresh terminal to register an agent with this CommHub:\n </p>\n <div className=\"mt-4 inline-block\">\n <QuickstartCommand cmd=\"npx --yes @sleep2agi/agent-network init\" />\n </div>\n {/* #214 F6: expectation management — without this line, users\n copy the command and stare at an empty screen not knowing\n what to wait for. The page polls every 5s, so the node\n really does appear by itself. */}\n <p className=\"text-gray-600 text-xs mt-3 max-w-md mx-auto\">\n Once the agent connects, it appears here automatically within a\n few seconds — no refresh needed.\n </p>\n <div className=\"mt-3\">\n <a\n href=\"https://anet.sh\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300\"\n >\n Full quickstart guide\n <span aria-hidden>→</span>\n </a>\n </div>\n </div>\n </EmptyCard>\n );\n}\n\n/** Code block + inline copy button used by the empty-Overview first-run\n * CTA. State lives here so the parent stays stateless. */\nfunction QuickstartCommand({ cmd }: { cmd: string }) {\n const [copied, setCopied] = useState(false);\n const onCopy = async () => {\n try {\n await navigator.clipboard.writeText(cmd);\n setCopied(true);\n setTimeout(() => setCopied(false), 1800);\n } catch {}\n };\n return (\n <div className=\"anet-empty-cmd flex items-start sm:items-center gap-2 bg-[#0e0e10] border border-[#26262b] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm\">\n {/* #209 R44: long quickstart commands (e.g. the `npm install -g …`\n variant) overflowed the empty-state card horizontally on phones\n because <code> defaults to white-space:pre. break-all on mobile\n lets them wrap inside the box; sm: up restores normal wrapping\n so desktop monospace lines stay clean. items-start on phones\n aligns the Copy button to the top so a wrapped 2-line command\n doesn't bottom-anchor the button. */}\n <code className=\"text-cyan-300 font-mono select-all min-w-0 break-all sm:break-normal\">{cmd}</code>\n <button\n type=\"button\"\n onClick={onCopy}\n aria-label={copied ? 'Copied' : 'Copy command'}\n className=\"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1c1c1f] transition-colors\"\n >\n {copied ? (\n <span className=\"flex items-center gap-1 text-green-400\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n Copied\n </span>\n ) : (\n <span className=\"flex items-center gap-1\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </svg>\n Copy\n </span>\n )}\n </button>\n </div>\n );\n}\n","/** Single source of truth for task status colors. Both `/tasks` (chip\n * strip, badge, distribution bar) and the Overview Recent Activity row\n * used to ship their own incomplete maps; round 66 consolidates them\n * here so adding a new status updates every consumer at once.\n *\n * Order in `TASK_STATUSES` is chronological-ish: lifecycle progress on\n * the left, terminal-good (`closed`) in the middle, terminal-bad\n * (`failed`/`cancelled`/`expired`) on the right. */\n\nexport const TASK_STATUSES = [\n 'created',\n 'delivered',\n 'acked',\n 'running',\n 'replied',\n 'closed',\n 'failed',\n 'cancelled',\n 'expired',\n] as const;\n\n/** Pill / chip background+text+border. Tailwind classes, not inlined hex,\n * because chips are static class names safe from purge. */\n/** #217 D3 (OpenWebUI-style color restraint): the 9-hue rainbow is\n * collapsed to a semantic triad — green = actively running, red =\n * failed, gray = everything else (in-flight states in lighter gray,\n * terminal states dimmer). Color now means something instead of\n * decorating every enum value. */\nexport const STATUS_CHIP_CLASS: Record<string, string> = {\n created: 'bg-gray-500/10 text-gray-400 border-gray-500/20',\n delivered: 'bg-gray-500/10 text-gray-300 border-gray-500/20',\n acked: 'bg-gray-500/10 text-gray-300 border-gray-500/20',\n running: 'bg-green-500/10 text-green-300 border-green-500/20',\n replied: 'bg-gray-500/10 text-gray-300 border-gray-500/20',\n closed: 'bg-gray-500/10 text-gray-500 border-gray-500/20',\n failed: 'bg-red-500/10 text-red-300 border-red-500/20',\n cancelled: 'bg-gray-500/10 text-gray-500 border-gray-500/20',\n expired: 'bg-gray-500/10 text-gray-500 border-gray-500/20',\n};\n\n/** Inline hex dots — used wherever Tailwind would purge dynamic class\n * names (`bg-${family}-400`). Style attribute carries the color. */\nexport const STATUS_DOT_HEX: Record<string, string> = {\n created: '#9ca3af',\n delivered: '#9ca3af',\n acked: '#9ca3af',\n running: '#4ade80',\n replied: '#9ca3af',\n closed: '#6b7280',\n failed: '#f87171',\n cancelled: '#6b7280',\n expired: '#6b7280',\n};\n\n/** Session lifecycle (distinct from task lifecycle above). Shared by\n * /nodes status pills and /admin Online Sessions row chips so an\n * agent in `blocked` state reads the same color everywhere.\n * Round 91 — extracted from app/nodes/page.tsx. */\n/** D3: idle drops from blue to gray — only working (green), blocked\n * (amber, actionable) and error (red) earn color. */\nexport const SESSION_STATUS_CHIP_CLASS: Record<string, string> = {\n working: 'bg-green-500/10 text-green-300 border-green-500/20',\n idle: 'bg-gray-500/10 text-gray-300 border-gray-500/20',\n blocked: 'bg-yellow-500/10 text-yellow-300 border-yellow-500/20',\n error: 'bg-red-500/10 text-red-300 border-red-500/20',\n offline: 'bg-gray-500/10 text-gray-500 border-gray-500/20',\n};\n\n/** Text-only color for session status. Used where a chip background\n * would be too heavy — e.g. /node detail header status label. */\nexport const SESSION_STATUS_TEXT_CLASS: Record<string, string> = {\n working: 'text-green-400',\n idle: 'text-gray-400',\n blocked: 'text-yellow-400',\n error: 'text-red-400',\n offline: 'text-gray-500',\n};\n\n/** Solid bar segment background for the Tasks distribution bar. */\nexport const STATUS_BAR_CLASS: Record<string, string> = {\n created: 'bg-gray-500',\n delivered: 'bg-gray-400',\n acked: 'bg-gray-300',\n running: 'bg-green-500',\n replied: 'bg-gray-400',\n closed: 'bg-gray-600',\n failed: 'bg-red-500',\n cancelled: 'bg-gray-600',\n expired: 'bg-gray-600',\n};\n","'use client';\n\n/**\n * CollapsibleSearch\n * ──────────────────\n * #209 R34 — Reusable WeChat-style search-toggle pattern.\n *\n * Two pieces of UI from one component:\n * 1. A magnifier button (`w-9 h-9 rounded-full`) that lives in a page\n * header — render it via `Button`.\n * 2. A collapsible search row that reveals below the header on open —\n * render it via `Row`.\n *\n * Used together they replicate WeChat's chat-list search affordance:\n * the search field is hidden by default behind a small circle at the\n * top-right of the page header. Tapping it slides the input open,\n * autofocuses, and lets Escape clear + close. A cyan dot appears in\n * the corner of the icon when there is an active search term but the\n * row is collapsed, so the user always knows a filter is in effect.\n *\n * Owner of the search string is the parent (this component is\n * uncontrolled w.r.t. value — pure UI). That keeps the filter logic\n * with the page so it's easy to plumb additional behaviour like\n * `from:alias` shortcuts or highlight rendering.\n *\n * Shipped as a single component with two named children so callers\n * can place `<Button>` inside their existing header flex row and\n * `<Row>` just after, without restructuring around a tighter API.\n *\n * First adopters: /nodes (R32), /messages (R33). R34 ships\n * /nodes + /messages migrated to use this component; future pages\n * can add search by importing it instead of copy-pasting the JSX.\n */\n\nimport { useState, useCallback, useRef } from 'react';\n\ninterface CollapsibleSearchAPI {\n /** Round magnifier button. Place in your page header (e.g. right edge). */\n Button: () => React.JSX.Element;\n /** Collapsible search input row. Place immediately after the header. */\n Row: () => React.JSX.Element | null;\n /** Current search value — pass to your filter logic. */\n value: string;\n /** Programmatically clear + close (useful for \"no results\" reset link). */\n reset: () => void;\n}\n\ninterface UseCollapsibleSearchProps {\n /** Controlled value + setter from the parent — owns the search string. */\n value: string;\n onChange: (next: string) => void;\n /** Input placeholder. */\n placeholder?: string;\n /** Accessible label for the button (also drives `title=`). */\n label?: string;\n /** Hide everything when false (e.g. when there is nothing to search). */\n enabled?: boolean;\n}\n\nexport function useCollapsibleSearch(props: UseCollapsibleSearchProps): CollapsibleSearchAPI {\n const { value } = props;\n const [open, setOpen] = useState(false);\n\n /* Loop R16 (R14 同类根因扫查): Button/Row were useCallback-RECREATED on\n every open/value change. Callers render them as JSX types\n (<ctl.Row />), so each keystroke produced a new component type →\n React unmounted and remounted the <input> mid-typing (measured: a\n data-probe tag on the node vanished after typing two chars). The\n controlled value + autoFocus masked it in English, but any IME\n composition (Chinese!) got cut off per keystroke. Fix: ONE stable\n component type per hook instance; renders read live state/props from\n refs, so updates re-render in place instead of remounting. */\n /* eslint-disable react-hooks/refs -- render-phase ref mirroring + reads\n are the POINT of the R16 fix: one stable component type per hook\n instance rendering live values (the useCallback version remounted the\n input per keystroke and broke IME composition). */\n const propsRef = useRef(props);\n propsRef.current = props;\n const openRef = useRef(open);\n openRef.current = open;\n\n const reset = useCallback(() => {\n propsRef.current.onChange('');\n setOpen(false);\n }, []);\n\n const [stable] = useState(() => {\n const Button = () => {\n const { value, label = 'Search', enabled = true } = propsRef.current;\n const open = openRef.current;\n if (!enabled) return <></>;\n const active = open || value;\n return (\n <button\n type=\"button\"\n onClick={() => setOpen(v => !v)}\n aria-label={open ? `Close ${label.toLowerCase()}` : `Open ${label.toLowerCase()}`}\n aria-pressed={open}\n title={open ? `Close ${label.toLowerCase()}` : label}\n className={`relative shrink-0 inline-flex items-center justify-center rounded-full border w-9 h-9 transition-colors ${\n active\n ? 'border-cyan-500/40 bg-cyan-500/10 text-cyan-300'\n : 'border-[#26262b] bg-[#161618] text-gray-400 hover:text-gray-200 hover:border-[#3a3a41]'\n }`}\n >\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\" />\n </svg>\n {value && !open && (\n <span aria-hidden className=\"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-cyan-400 ring-2 ring-[#0b0b0d]\" />\n )}\n </button>\n );\n };\n const Row = () => {\n const { value, onChange, placeholder = 'Search…', enabled = true } = propsRef.current;\n const open = openRef.current;\n if (!enabled) return null;\n if (!open && !value) return null;\n return (\n <div className=\"mb-3 sm:mb-4 flex items-center gap-2\">\n <input\n type=\"text\"\n value={value}\n onChange={e => onChange(e.target.value)}\n onKeyDown={e => { if (e.key === 'Escape') reset(); }}\n placeholder={placeholder}\n autoFocus={open}\n className=\"flex-1 bg-[#161618] border border-[#26262b] rounded-lg px-3 py-2 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none\"\n />\n <button\n type=\"button\"\n onClick={reset}\n className=\"shrink-0 text-xs text-gray-500 hover:text-gray-300 px-2 py-2\"\n aria-label=\"Clear and close search\"\n >\n Cancel\n </button>\n </div>\n );\n };\n return { Button, Row };\n });\n /* eslint-enable react-hooks/refs */\n\n return { Button: stable.Button, Row: stable.Row, value, reset };\n}\n"],"names":["previewContent","raw","replace","trim","timeAgo","dateStr","statusColor","status","hasSse","STORE_KEY","AVATAR_EVENT","manifest","pool","manifestRequested","poolPick","alias","length","h","i","charCodeAt","fetchManifestOnce","readMap","getAvatarUrl","setAvatarUrl","url","version","subscribe","callback","bump","window","addEventListener","removeEventListener","useAvatarsVersion","useAvatarUrl","DEFAULTS","nodes","title","sub","tasks","messages","logs","tokens","networks","generic","Glyph","variant","size","s","width","height","baseProps","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","viewBox","cx","cy","r","x1","y1","x2","y2","strokeDasharray","opacity","x","y","rx","d","ry","EmptyState","cta","compact","headline","subcopy","iconSize","className","role","href","label","onClick","EmptyCard","children","NodesEmptyState","hint","taskHistoryCount","global_count","toLocaleString","QuickstartCommand","cmd","target","rel","copied","setCopied","onCopy","navigator","clipboard","writeText","setTimeout","type","TASK_STATUSES","STATUS_CHIP_CLASS","created","delivered","acked","running","replied","closed","failed","cancelled","expired","STATUS_DOT_HEX","SESSION_STATUS_CHIP_CLASS","working","idle","blocked","error","offline","SESSION_STATUS_TEXT_CLASS","STATUS_BAR_CLASS","useCollapsibleSearch","props","value","open","setOpen","propsRef","current","openRef","reset","onChange","stable","Button","enabled","active","v","toLowerCase","Row","placeholder","e","onKeyDown","key","autoFocus"],"mappings":"4GAmBA,IAAA,EAAA,EAAA,CAAA,CAAA,+BAhBO,SAASA,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AA,EAAA,GAAA,EAAC,QAAA,CACCuB,KAAK,OACLuB,MAAOA,EACPO,SAAUS,GAAKT,EAASS,EAAEhD,MAAM,CAACgC,KAAK,EACtCiB,UAAWD,IAAqB,WAAVA,EAAEE,GAAG,EAAeZ,GAAS,EACnDS,YAAaA,EACbI,UAAWlB,EACX/C,UAAU,sKAEZ,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CACCuB,KAAK,SACLnB,QAASgD,EACTpD,UAAU,+DACV,aAAW,kCACZ,cAlBkB,IAuBvB,EACqB,GAIvB,MAAO,CAAEuD,OAAQD,EAAOC,MAAM,CAAEK,IAAKN,EAAOM,GAAG,OAAEd,QAAOM,CAAM,CAChE"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},11998,(a,b,c)=>{"use strict";b.exports=a.r(18622)},5400,(a,b,c)=>{"use strict";b.exports=a.r(11998).vendored["react-ssr"].ReactJsxRuntime},82956,(a,b,c)=>{"use strict";b.exports=a.r(11998).vendored["react-ssr"].React},72022,(a,b,c)=>{"use strict";b.exports=a.r(11998).vendored.contexts.AppRouterContext},67341,(a,b,c)=>{"use strict";b.exports=a.r(11998).vendored["react-ssr"].ReactServerDOMTurbopackClient},60447,(a,b,c)=>{"use strict";b.exports=a.r(11998).vendored.contexts.HooksClientContext},82169,(a,b,c)=>{"use strict";b.exports=a.r(11998).vendored.contexts.ServerInsertedHtml},98005,a=>{"use strict";function b(a){if(!a)return null;let b=Date.parse(a.includes("T")?a:a.replace(" ","T")+"Z");return Number.isFinite(b)?b:null}a.s(["formatWeChatTime",0,function(a){let c=b(a);if(null===c)return"";let d=new Date(c),e=new Date,f="u">typeof navigator&&(navigator.language||"").toLowerCase().startsWith("zh"),g=`${String(d.getHours()).padStart(2,"0")}:${String(d.getMinutes()).padStart(2,"0")}`,h=a=>new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),i=Math.round((h(e)-h(d))/864e5);if(0===i)return g;if(1===i)return f?`昨天 ${g}`:`Yesterday ${g}`;if(i>1&&i<7){let a=new Intl.DateTimeFormat(f?"zh-CN":void 0,{weekday:f?"long":"short"}).format(d);return`${a} ${g}`}let j=new Intl.DateTimeFormat(f?"zh-CN":void 0,{month:f?"long":"short",day:"numeric",...d.getFullYear()!==e.getFullYear()?{year:"numeric"}:{}}).format(d);return`${j} ${g}`},"parseHubTime",0,b,"relativeAgo",0,function(a){let c=b(a);if(null===c)return null;let d=Math.floor((Date.now()-c)/1e3);return d<0?"just now":d<60?`${d}s ago`:d<3600?`${Math.floor(d/60)}m ago`:d<86400?`${Math.floor(d/3600)}h ago`:`${Math.floor(d/86400)}d ago`}])},53705,a=>{"use strict";var b=a.i(5400),c=a.i(82956);let d=(0,c.createContext)({networkId:"",setNetworkId:()=>{}});a.s(["NetworkProvider",0,function({children:a}){let[e,f]=(0,c.useState)("");return(0,c.useEffect)(()=>{let a=sessionStorage.getItem("anet_network_id");a&&f(a)},[]),(0,b.jsx)(d.Provider,{value:{networkId:e,setNetworkId:a=>{f(a),sessionStorage.setItem("anet_network_id",a)}},children:a})},"useNetworkId",0,function(){return(0,c.useContext)(d)}])},60810,51563,a=>{"use strict";var b=a.i(82956),c=a.i(10571),d=a.i(53705);let e="anet-chat-mute-updated";function f(a){return!!a&&new Set().has(a)}let g=0;function h(a){let b=()=>{g++,a()};return window.addEventListener(e,b),window.addEventListener("storage",b),()=>{window.removeEventListener(e,b),window.removeEventListener("storage",b)}}function i(){return(0,b.useSyncExternalStore)(h,()=>g,()=>0)}a.s(["isMuted",0,f,"toggleMute",0,function(a){},"useMuteVersion",0,i,"useMuted",0,function(a){return(0,b.useSyncExternalStore)(h,()=>!!a&&f(a),()=>!1)}],51563);let j="anet-chat-read-updated",k=new Set(["","dashboard","admin","api","hub"]),l=a=>k.has((a||"").trim().toLowerCase());function m(a){if(!a)return 0;let b=a.includes("T")?a:a.replace(" ","T"),c=Date.parse(/Z$|[+-]\d{2}:\d{2}$/.test(b)?b:`${b}Z`);return Number.isFinite(c)?c:0}let n="__baseline",o=async a=>{let b=await fetch(a);if(401===b.status)throw window.location.assign("/login"),Error("unauthorized");return b.json()};function p(a,b){a&&new Date().toISOString()}a.s(["badgeLabel",0,function(a){return a<=0?"":a>99?"99+":String(a)},"markChatRead",0,p,"useChatUnread",0,function(){let{networkId:a}=(0,d.useNetworkId)(),{data:e}=(0,c.default)(function(a,b){if(!b)return a;let c=a.includes("?")?"&":"?";return`${a}${c}network_id=${encodeURIComponent(b)}`}("/api/hub/messages?limit=200",a),o,{refreshInterval:5e3,dedupingInterval:3e3}),[g,h]=(0,b.useState)(0);(0,b.useEffect)(()=>{let b=b=>{b.key&&b.key!==`anet_chat_read_v1:${a||"global"}`||h(a=>"number"==typeof a?a+1:1)},c=b=>{let c=b.detail;(c?.networkId===void 0||c.networkId===a)&&h(a=>"number"==typeof a?a+1:1)};return window.addEventListener("storage",b),window.addEventListener(j,c),()=>{window.removeEventListener("storage",b),window.removeEventListener(j,c)}},[a,h]);let k=(0,b.useMemo)(()=>({}),[a,g]),q=(0,b.useMemo)(()=>{let a=new Map,b=new Map,c=new Set(Object.keys(k).filter(a=>a!==n)),d=m(k[n]),f=(e,f)=>{c.has(e)&&f>(b.get(e)||0)&&b.set(e,f),f>Math.max(m(k[e]),d)&&a.set(e,(a.get(e)||0)+1)};for(let a of e?.messages||[]){let b=a.from_alias?.trim();if(!b||l(b)||!l(a.to_alias))continue;let c=m(a.created_at);c&&f(b,c)}return{counts:a,lastActivity:b}},[e,k]),r=(0,b.useCallback)(a=>!!a&&(q.counts.get(a)||0)>0,[q]),s=(0,b.useCallback)(a=>a&&q.counts.get(a)||0,[q]),t=(0,b.useCallback)(a=>a&&q.lastActivity.get(a)||0,[q]),u=i(),{totalUnread:v,hasMutedUnread:w}=(0,b.useMemo)(()=>{let a=0,b=!1;for(let[c,d]of q.counts){if(f(c)){d>0&&(b=!0);continue}a+=d}return{totalUnread:a,hasMutedUnread:b}},[q,u]);return{unreadMap:q,hasUnread:r,unreadCount:s,lastActivityAt:t,totalUnread:v,hasMutedUnread:w,clearUnread:(0,b.useCallback)(b=>{p(b,a)},[a])}}],60810)},19315,a=>{"use strict";var b=a.i(5400),c=a.i(82956);let d=new Set(["cyber","light","slack"]);function e(a){if("u"<typeof document)return;let b=document.documentElement;"slack"===a?(b.setAttribute("data-theme","light"),b.setAttribute("data-skin","slack")):(b.setAttribute("data-theme",a),b.removeAttribute("data-skin"))}a.s(["THEMES",0,d,"ThemeProvider",0,function({children:a}){return(0,c.useEffect)(()=>{if("u"<typeof document)return;let a="cyber";try{let b=localStorage.getItem("anet-theme");b&&d.has(b)&&(a=b)}catch{}e(a)},[]),(0,b.jsx)(b.Fragment,{children:a})},"applyTheme",0,e])},6497,a=>{"use strict";var b=a.i(5400),c=a.i(82956),d=a.i(10571);let e=async a=>{let b=await fetch(a);if(401===b.status)throw Error("unauthorized");if(!b.ok)throw Error(`hub ${b.status}`);return b.json()};function f(a){return a>=85?{fill:"#ef4444",track:"rgb(239 68 68 / 0.16)"}:a>=60?{fill:"#f59e0b",track:"rgb(245 158 11 / 0.16)"}:{fill:"#10b981",track:"rgb(16 185 129 / 0.16)"}}function g({pct:a,label:c}){let d=f(a),e=Math.max(0,Math.min(100,a));return(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsxs)("div",{className:"flex justify-between text-[10px] text-[var(--fg-muted)] font-mono",children:[(0,b.jsx)("span",{children:c}),(0,b.jsxs)("span",{className:"tabular-nums",children:[Math.round(e),"%"]})]}),(0,b.jsx)("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:d.track},children:(0,b.jsx)("div",{className:"h-full transition-[width] duration-300 ease-out",style:{width:`${e}%`,background:d.fill}})})]})}function h({values:a,tint:c,label:d}){if(!a||a.length<2)return null;let e=100/Math.max(1,a.length-1),f=a.map((a,b)=>{let c=18-Math.max(0,Math.min(100,a))/100*18;return`${(b*e).toFixed(1)},${c.toFixed(1)}`}),g=f.join(" "),i=`M0,18 L${f.join(" L")} L100,18 Z`;return(0,b.jsxs)("svg",{width:"100%",height:18,viewBox:"0 0 100 18",preserveAspectRatio:"none","aria-label":`${d} 5-min history`,"data-server-sparkline":d,children:[(0,b.jsx)("path",{d:i,fill:c,opacity:"0.18"}),(0,b.jsx)("polyline",{points:g,fill:"none",stroke:c,strokeWidth:"1.2"})]})}function i({cpu:a,mem:c,disk:d}){let e=[a,c,d].filter(a=>"number"==typeof a);if(0===e.length)return null;let g=Math.max(...e),h=f(g);return(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full shrink-0",style:{background:h.fill,boxShadow:`0 0 0 2px ${h.track}`},"data-server-health-badge":g>=85?"red":g>=60?"amber":"green",title:`worst: ${Math.round(g)}%`})}function j({agents:a}){return a&&0!==a.length?(0,b.jsx)("ul",{className:"space-y-1","data-server-agent-list":!0,children:a.map(a=>{let c="working"===a.status?"#10b981":"idle"===a.status?"#06b6d4":"#6b7280";return(0,b.jsxs)("li",{className:"flex items-center gap-1.5 text-[10px] font-mono","data-server-agent":a.alias,children:[(0,b.jsx)("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{background:c}}),(0,b.jsx)("span",{className:"font-semibold truncate",style:{color:"var(--fg)"},children:a.alias}),a.runtime&&(0,b.jsxs)("span",{className:"text-[9px] text-[var(--fg-dim)] shrink-0",children:["· ",a.runtime]}),"number"==typeof a.progress&&a.progress>0&&(0,b.jsxs)("span",{className:"ml-auto text-[9px] tabular-nums text-[var(--fg-muted)]",children:[Math.round(100*a.progress),"%"]})]},a.alias)})}):(0,b.jsx)("div",{className:"text-[9px] text-[var(--fg-dim)] font-mono italic px-1 py-1","data-server-agents-missing":"true",children:"agent rollup not reported by hub"})}function k(a=!0){let{data:b,error:c}=(0,d.default)(a?"/api/hub/servers":null,e,{refreshInterval:5e3,dedupingInterval:3e3}),f=b?.servers??[],g=b?.unavailable===!0,h=f.filter(a=>"online"===a.status).length,i=a&&!b&&!c;return{data:b,error:c,servers:f,unavailable:g,onlineCount:h,loading:i}}function l({enabled:a=!0,className:d=""}){let[e,f]=(0,c.useState)(new Set);(0,c.useEffect)(()=>{try{let a=localStorage.getItem("anet-servers-drawer-expanded");a&&f(new Set(JSON.parse(a)))}catch{}},[]);let{data:m,error:n,servers:o,unavailable:p,loading:q}=k(a);return(0,b.jsxs)("div",{className:`min-h-0 overflow-y-auto px-2 py-2 space-y-2 ${d}`,"data-servers-body":!0,children:[q&&(0,b.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4",children:"loading servers…"}),n&&!m&&(0,b.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"}),p&&(0,b.jsxs)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-3 leading-relaxed",children:["host telemetry not available",(0,b.jsx)("br",{}),(0,b.jsx)("span",{className:"text-[var(--fg-dim)]",children:"upgrade commhub-server ≥ 0.8.1-preview.2"})]}),!q&&!n&&!p&&0===o.length&&(0,b.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4",children:"no servers reporting yet"}),o.map(a=>{let c="offline"===a.status,d=null!=a.cpu_load_1min&&a.cpu_cores>0?a.cpu_load_1min/a.cpu_cores*100:null,k=null!=a.mem_used_gb&&null!=a.mem_total_gb&&a.mem_total_gb>0?a.mem_used_gb/a.mem_total_gb*100:null,l=null!=a.disk_used_gb&&null!=a.disk_total_gb&&a.disk_total_gb>0?a.disk_used_gb/a.disk_total_gb*100:null,m=e.has(a.hostname);return(0,b.jsxs)("div",{className:"rounded-lg border px-2.5 py-2 space-y-1.5",style:{background:"var(--bg)",borderColor:"var(--border)",opacity:c?.55:1},"data-server-card":a.hostname,"data-server-expanded":m?"true":"false",title:a.ip?`${a.hostname} \xb7 ${a.ip}`:a.hostname,children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{let b;return b=a.hostname,f(a=>{let c=new Set(a);c.has(b)?c.delete(b):c.add(b);try{localStorage.setItem("anet-servers-drawer-expanded",JSON.stringify([...c]))}catch{}return c})},"aria-expanded":m,className:"w-full flex items-center justify-between gap-2 text-left","data-server-card-toggle":a.hostname,children:[(0,b.jsxs)("div",{className:"min-w-0 flex items-center gap-1.5",children:[!c&&(0,b.jsx)(i,{cpu:d,mem:k,disk:l}),(0,b.jsx)("span",{className:"font-mono text-[12px] font-semibold truncate",style:{color:"var(--fg)"},children:a.hostname}),a.note&&(0,b.jsxs)("span",{className:"text-[9px] text-[var(--fg-dim)]",children:["(",a.note,")"]})]}),(0,b.jsxs)("span",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono tabular-nums",children:[a.agent_count," agent",1===a.agent_count?"":"s"]}),(0,b.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:m?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease-out"},"aria-hidden":!0,children:(0,b.jsx)("path",{d:"M3 1.5L7 5L3 8.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),!c&&null!=d&&(0,b.jsx)(g,{pct:d,label:`CPU ${a.cpu_load_1min.toFixed(2)}/${a.cpu_cores}`}),!c&&null!=k&&(0,b.jsx)(g,{pct:k,label:`RAM ${a.mem_used_gb.toFixed(1)}/${a.mem_total_gb.toFixed(1)}G`}),c&&(0,b.jsx)("div",{className:"text-[10px] text-[var(--fg-dim)] font-mono italic",children:"CPU n/a · RAM n/a · offline"}),m&&!c&&(0,b.jsxs)("div",{className:"pt-1 mt-1 border-t space-y-1.5",style:{borderColor:"var(--border)"},children:[null!=l?(0,b.jsx)(g,{pct:l,label:`DISK ${a.disk_used_gb.toFixed(1)}/${a.disk_total_gb.toFixed(1)}G`}):(0,b.jsx)("div",{className:"text-[9px] text-[var(--fg-dim)] font-mono italic","data-server-disk-missing":"true",children:"disk metric not reported by hub"}),a.cpu_history&&a.cpu_history.length>=2&&(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("div",{className:"text-[9px] text-[var(--fg-muted)] font-mono",children:"CPU · 5-min"}),(0,b.jsx)(h,{values:a.cpu_history,tint:"#10b981",label:"CPU"})]}),a.mem_history&&a.mem_history.length>=2&&(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("div",{className:"text-[9px] text-[var(--fg-muted)] font-mono",children:"RAM · 5-min"}),(0,b.jsx)(h,{values:a.mem_history,tint:"#06b6d4",label:"MEM"})]}),a.disk_history&&a.disk_history.length>=2&&(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("div",{className:"text-[9px] text-[var(--fg-muted)] font-mono",children:"DISK · 5-min"}),(0,b.jsx)(h,{values:a.disk_history,tint:"#f59e0b",label:"DISK"})]}),(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsx)("div",{className:"text-[9px] text-[var(--fg-muted)] font-mono mb-0.5",children:"agents"}),(0,b.jsx)(j,{agents:a.agents})]})]})]},a.hostname)}),o.length>0&&(0,b.jsx)("div",{className:"pt-1 text-[9px] text-[var(--fg-dim)] font-mono text-center",children:"live · refreshing every 5s"})]})}a.s(["ServersDrawer",0,function(){let[a,d]=(0,c.useState)(!1);(0,c.useEffect)(()=>{try{"1"===localStorage.getItem("anet-servers-drawer")&&d(!0)}catch{}},[]);let{servers:e,onlineCount:f}=k(a);return(0,b.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:a?296:40,maxHeight:"calc(100vh - 6rem)",transition:"width 200ms ease-out"},"aria-label":"Servers panel",children:[(0,b.jsxs)("button",{onClick:()=>d(a=>{let b=!a;try{localStorage.setItem("anet-servers-drawer",b?"1":"0")}catch{}return b}),"aria-expanded":a,"aria-label":a?"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,b.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,b.jsx)("rect",{x:"3",y:"4",width:"18",height:"6",rx:"1.5"}),(0,b.jsx)("rect",{x:"3",y:"14",width:"18",height:"6",rx:"1.5"}),(0,b.jsx)("circle",{cx:"7",cy:"7",r:"0.7",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"7",cy:"17",r:"0.7",fill:"currentColor"})]}),a&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"flex-1 text-left",children:"Servers"}),(0,b.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono",children:[f,"/",e.length]})]})]}),a&&(0,b.jsx)(l,{enabled:a,className:"flex-1"})]})},"ServersPanel",0,l])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__06g2-qq._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../dash-492/agent-network-dashboard/node_modules/next/src/server/route-modules/app-page/module.compiled.js","../../../../../../dash-492/agent-network-dashboard/node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.ts","../../../../../../dash-492/agent-network-dashboard/node_modules/next/src/server/route-modules/app-page/vendored/ssr/react.ts","../../../../../../dash-492/agent-network-dashboard/node_modules/next/src/server/route-modules/app-page/vendored/contexts/app-router-context.ts","../../../../../../dash-492/agent-network-dashboard/node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.ts","../../../../../../dash-492/agent-network-dashboard/node_modules/next/src/server/route-modules/app-page/vendored/contexts/hooks-client-context.ts","../../../../../../dash-492/agent-network-dashboard/node_modules/next/src/server/route-modules/app-page/vendored/contexts/server-inserted-html.ts","../../../../../../dash-492/agent-network-dashboard/app/lib/time.ts","../../../../../../dash-492/agent-network-dashboard/app/lib/network-context.tsx","../../../../../../dash-492/agent-network-dashboard/app/lib/chat-unread.ts","../../../../../../dash-492/agent-network-dashboard/app/lib/chat-mute.ts","../../../../../../dash-492/agent-network-dashboard/app/components/ThemeSwitcher.tsx","../../../../../../dash-492/agent-network-dashboard/app/components/ServersDrawer.tsx"],"sourcesContent":["if (process.env.NEXT_RUNTIME === 'edge') {\n module.exports = require('next/dist/server/route-modules/app-page/module.js')\n} else {\n if (process.env.__NEXT_EXPERIMENTAL_REACT) {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo-experimental.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page-experimental.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page-experimental.runtime.prod.js')\n }\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js')\n }\n }\n }\n}\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactJsxRuntime\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.React\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].AppRouterContext\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactServerDOMTurbopackClient\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].HooksClientContext\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].ServerInsertedHtml\n","/** Shared timestamp helpers for hub-sourced data.\n *\n * Background — the CommHub serialises timestamps SQL-style without a\n * zone (\"2026-05-15 06:00:28\"), but some test data uses full ISO\n * (\"…T06:00:28Z\"). `Date.parse` on bare SQL is **local-time** in every\n * browser the dashboard supports, so a UTC+8 operator silently sees\n * every timestamp 8 h older than reality (Round 35 dug this out via\n * the `isGhost` filter mis-fire).\n *\n * Round 38 / Loop consolidates parsing — TopoGraph (R35), ChatPopover\n * (R37) and utils.ts::timeAgo all mirrored the same SQL→UTC rewrite;\n * one source of truth here. */\n\n/** Parse a hub timestamp to ms-since-epoch, treating SQL-style strings\n * as UTC. ISO strings (with `T`) bypass the rewrite and are parsed as-is.\n * Returns null for empty / unparseable input. */\nexport function parseHubTime(dateStr: string | null | undefined): number | null {\n if (!dateStr) return null;\n const iso = dateStr.includes('T') ? dateStr : dateStr.replace(' ', 'T') + 'Z';\n const t = Date.parse(iso);\n return Number.isFinite(t) ? t : null;\n}\n\n/** Format `dateStr` as a short relative-time string (\"6m ago\" / \"2h ago\").\n * Future timestamps (clock skew) collapse to \"just now\". Returns null when\n * the input doesn't parse — callers can decide on a fallback. */\nexport function relativeAgo(dateStr: string | null | undefined): string | null {\n const t = parseHubTime(dateStr);\n if (t === null) return null;\n const s = Math.floor((Date.now() - t) / 1000);\n if (s < 0) return 'just now';\n if (s < 60) return `${s}s ago`;\n if (s < 3600) return `${Math.floor(s / 60)}m ago`;\n if (s < 86400) return `${Math.floor(s / 3600)}h ago`;\n return `${Math.floor(s / 86400)}d ago`;\n}\n\n/** Loop R7 (跨面一致性): WeChat-style contextual timestamp shared by the\n * chat panel (R3) and /messages dividers. zh locales keep the native\n * wording (昨天/星期X); others get Intl output (\"Yesterday\"/\"Tue\").\n * Today → \"14:32\" · yesterday → \"昨天 14:32\" · <7d → \"星期二 14:32\" ·\n * this year → \"7月16日 14:32\" · older adds the year. */\nexport function formatWeChatTime(value: string | null | undefined): string {\n const t = parseHubTime(value);\n if (t === null) return '';\n const d = new Date(t);\n const now = new Date();\n const zh = typeof navigator !== 'undefined' && (navigator.language || '').toLowerCase().startsWith('zh');\n const hm = `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;\n const startOfDay = (x: Date) => new Date(x.getFullYear(), x.getMonth(), x.getDate()).getTime();\n const dayDiff = Math.round((startOfDay(now) - startOfDay(d)) / 86400000);\n if (dayDiff === 0) return hm;\n if (dayDiff === 1) return zh ? `昨天 ${hm}` : `Yesterday ${hm}`;\n if (dayDiff > 1 && dayDiff < 7) {\n const wd = new Intl.DateTimeFormat(zh ? 'zh-CN' : undefined, { weekday: zh ? 'long' : 'short' }).format(d);\n return `${wd} ${hm}`;\n }\n const md = new Intl.DateTimeFormat(zh ? 'zh-CN' : undefined, {\n month: zh ? 'long' : 'short', day: 'numeric',\n ...(d.getFullYear() !== now.getFullYear() ? { year: 'numeric' } : {}),\n }).format(d);\n return `${md} ${hm}`;\n}\n","'use client';\n\nimport { createContext, useContext, useState, useEffect, ReactNode } from 'react';\n\ninterface NetworkContextType {\n networkId: string;\n setNetworkId: (id: string) => void;\n}\n\nconst NetworkContext = createContext<NetworkContextType>({ networkId: '', setNetworkId: () => {} });\n\nexport function NetworkProvider({ children }: { children: ReactNode }) {\n const [networkId, setNetworkId] = useState('');\n\n useEffect(() => {\n const saved = sessionStorage.getItem('anet_network_id');\n // Hydration-safe restore (see UserBar note).\n // eslint-disable-next-line react-hooks/set-state-in-effect\n if (saved) setNetworkId(saved);\n }, []);\n\n const setAndPersist = (id: string) => {\n setNetworkId(id);\n sessionStorage.setItem('anet_network_id', id);\n };\n\n return (\n <NetworkContext.Provider value={{ networkId, setNetworkId: setAndPersist }}>\n {children}\n </NetworkContext.Provider>\n );\n}\n\nexport function useNetworkId() {\n return useContext(NetworkContext);\n}\n","'use client';\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport useSWR from 'swr';\nimport { useNetworkId } from './network-context';\nimport { isMuted, useMuteVersion } from './chat-mute';\n\nconst STORAGE_PREFIX = 'anet_chat_read_v1:';\nconst UNREAD_EVENT = 'anet-chat-read-updated';\n\ninterface ChatMessage {\n from_alias?: string | null;\n to_alias?: string | null;\n created_at?: string | null;\n}\n\n/** Senders/recipients that mean \"the dashboard user\" in hub data. The chat\n * panel uses the same set to decide which bubbles are \"You\". */\nconst USERISH = new Set(['', 'dashboard', 'admin', 'api', 'hub']);\nconst isUserish = (v?: string | null) => USERISH.has((v || '').trim().toLowerCase());\n\ninterface ReadMap {\n [alias: string]: string;\n}\n\nfunction storageKey(networkId: string) {\n return `${STORAGE_PREFIX}${networkId || 'global'}`;\n}\n\nfunction parseHubTime(value?: string | null): number {\n if (!value) return 0;\n const normalized = value.includes('T') ? value : value.replace(' ', 'T');\n const withZone = /Z$|[+-]\\d{2}:\\d{2}$/.test(normalized) ? normalized : `${normalized}Z`;\n const ts = Date.parse(withZone);\n return Number.isFinite(ts) ? ts : 0;\n}\n\n// Loop R8 (Vincent: 未读数字角标): last-read moved sessionStorage →\n// localStorage so read state survives refresh/new tabs/restart (微信预期).\n// One-time migration pulls any old session value forward.\nconst BASELINE_KEY = '__baseline';\n\nfunction readStoredMap(networkId: string): ReadMap {\n if (typeof window === 'undefined') return {};\n try {\n let raw = window.localStorage.getItem(storageKey(networkId));\n if (!raw) {\n raw = window.sessionStorage.getItem(storageKey(networkId));\n if (raw) window.localStorage.setItem(storageKey(networkId), raw);\n }\n const parsed = raw ? JSON.parse(raw) : {};\n const map: ReadMap = parsed && typeof parsed === 'object' ? parsed : {};\n // R8 first-visit floor, written SYNCHRONOUSLY on first read: an async\n // (useEffect) baseline lost the race against the first SWR render and\n // let a badge storm flash — and stick, since nothing re-triggered the\n // count. Ensuring it here means no compute can ever see a missing\n // baseline. No event dispatch: every hook instance does the same\n // idempotent write.\n if (!map[BASELINE_KEY]) {\n map[BASELINE_KEY] = new Date().toISOString();\n window.localStorage.setItem(storageKey(networkId), JSON.stringify(map));\n }\n return map;\n } catch {\n return {};\n }\n}\n\nfunction writeStoredMap(networkId: string, next: ReadMap) {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(storageKey(networkId), JSON.stringify(next));\n window.dispatchEvent(new CustomEvent(UNREAD_EVENT, { detail: { networkId } }));\n } catch {}\n}\n\nconst fetcher = async (url: string) => {\n const res = await fetch(url);\n if (res.status === 401) {\n window.location.assign('/login');\n throw new Error('unauthorized');\n }\n return res.json();\n};\n\nfunction withNetwork(url: string, networkId: string): string {\n if (!networkId) return url;\n const sep = url.includes('?') ? '&' : '?';\n return `${url}${sep}network_id=${encodeURIComponent(networkId)}`;\n}\n\nexport function markChatRead(alias: string, networkId: string) {\n if (!alias) return;\n const current = readStoredMap(networkId);\n writeStoredMap(networkId, {\n ...current,\n [alias]: new Date().toISOString(),\n });\n}\n\nexport function useChatUnread() {\n const { networkId } = useNetworkId();\n // Messages are the ONLY count source: the hub mirrors every task reply as\n // a message to the originator (verified live: replied task + same-second\n // message, both present), so counting tasks too double-counted every\n // reply (E2E showed 4 where 2 was right).\n const { data: messagesData } = useSWR<{ messages?: ChatMessage[] }>(\n withNetwork('/api/hub/messages?limit=200', networkId),\n fetcher,\n { refreshInterval: 5000, dedupingInterval: 3000 },\n );\n const [readVersion, setReadVersion] = useState(0);\n\n useEffect(() => {\n const onStorage = (event: StorageEvent) => {\n if (event.key && event.key !== storageKey(networkId)) return;\n setReadVersion((v) => (typeof v === 'number' ? v + 1 : 1));\n };\n const onUnreadUpdate = (event: Event) => {\n const detail = (event as CustomEvent<{ networkId?: string }>).detail;\n if (detail?.networkId !== undefined && detail.networkId !== networkId) return;\n setReadVersion((v) => (typeof v === 'number' ? v + 1 : 1));\n };\n window.addEventListener('storage', onStorage);\n window.addEventListener(UNREAD_EVENT, onUnreadUpdate);\n return () => {\n window.removeEventListener('storage', onStorage);\n window.removeEventListener(UNREAD_EVENT, onUnreadUpdate);\n };\n }, [networkId, setReadVersion]);\n\n const readMap = useMemo(() => {\n void readVersion;\n return readStoredMap(networkId);\n }, [networkId, readVersion]);\n\n const unreadMap = useMemo(() => {\n // R8: count EVERY unread item per alias (Vincent: \"有几条消息显示数字\"),\n // not just a latest-activity boolean. A message from the alias counts;\n // a task's REPLY counts once when it lands after last-read. Self-sent\n // items never count (they're keyed by the counterpart alias).\n const counts = new Map<string, number>();\n // R28 (微信排序): recency tiebreak for Overview/Nodes — but ONLY for\n // conversations the user has actually OPENED (read-map entry). On this\n // fleet agents constantly report to 'admin'; counting those yanked\n // never-opened agents to the front on every report (measured: 2 cards\n // jumped 39→1 / 60→3 in one 6s window). WeChat's list holds YOUR\n // conversations — same rule here keeps the grid calm.\n const lastActivity = new Map<string, number>();\n const opened = new Set(Object.keys(readMap).filter((k) => k !== BASELINE_KEY));\n const baseline = parseHubTime(readMap[BASELINE_KEY]);\n const bump = (alias: string, at: number) => {\n if (opened.has(alias) && at > (lastActivity.get(alias) || 0)) lastActivity.set(alias, at);\n const readAt = Math.max(parseHubTime(readMap[alias]), baseline);\n if (at > readAt) counts.set(alias, (counts.get(alias) || 0) + 1);\n };\n // Scope: only the USER'S conversation — a badge on X means \"X has\n // something FOR YOU\". Fleet chatter (X's messages to other agents)\n // must NOT inflate it.\n for (const message of messagesData?.messages || []) {\n const alias = message.from_alias?.trim();\n if (!alias || isUserish(alias)) continue; // own sends never count\n if (!isUserish(message.to_alias)) continue; // must be addressed to the user\n const at = parseHubTime(message.created_at);\n if (at) bump(alias, at);\n }\n return { counts, lastActivity };\n }, [messagesData, readMap]);\n\n const hasUnread = useCallback((alias?: string | null) => {\n if (!alias) return false;\n return (unreadMap.counts.get(alias) || 0) > 0;\n }, [unreadMap]);\n\n const unreadCount = useCallback((alias?: string | null) => {\n if (!alias) return 0;\n return unreadMap.counts.get(alias) || 0;\n }, [unreadMap]);\n\n const lastActivityAt = useCallback((alias?: string | null) => {\n if (!alias) return 0;\n return unreadMap.lastActivity.get(alias) || 0;\n }, [unreadMap]);\n\n // R34: muted conversations are excluded from the global count (WeChat\n // semantics); hasMutedUnread lets entry badges fall back to a dot.\n const muteVersion = useMuteVersion();\n const { totalUnread, hasMutedUnread } = useMemo(() => {\n void muteVersion;\n let t = 0;\n let mutedAny = false;\n for (const [alias, n] of unreadMap.counts) {\n if (isMuted(alias)) { if (n > 0) mutedAny = true; continue; }\n t += n;\n }\n return { totalUnread: t, hasMutedUnread: mutedAny };\n }, [unreadMap, muteVersion]);\n\n const clearUnread = useCallback((alias: string) => {\n markChatRead(alias, networkId);\n }, [networkId]);\n\n return { unreadMap, hasUnread, unreadCount, lastActivityAt, totalUnread, hasMutedUnread, clearUnread };\n}\n\n/** WeChat badge label: 1-99 as-is, above → \"99+\"; 0/negative → '' (hide). */\nexport function badgeLabel(n: number): string {\n if (n <= 0) return '';\n return n > 99 ? '99+' : String(n);\n}\n","'use client';\n\nimport { useSyncExternalStore } from 'react';\n\n/* Loop R34 (微信消息免打扰, 克制版): per-conversation mute. Muted\n * conversations keep their red badge but show a DOT instead of the count,\n * and their unreads are excluded from the global total (WeChat semantics).\n * Same storage/reactivity pattern as chat-drafts. */\n\nconst STORE_KEY = 'anet_chat_mute_v1';\nconst MUTE_EVENT = 'anet-chat-mute-updated';\n\nfunction readSet(): Set<string> {\n if (typeof window === 'undefined') return new Set();\n try {\n const parsed = JSON.parse(window.localStorage.getItem(STORE_KEY) || '[]');\n return new Set(Array.isArray(parsed) ? parsed : []);\n } catch {\n return new Set();\n }\n}\n\nexport function isMuted(alias?: string | null): boolean {\n if (!alias) return false;\n return readSet().has(alias);\n}\n\nexport function toggleMute(alias: string) {\n if (typeof window === 'undefined' || !alias) return;\n try {\n const s = readSet();\n if (s.has(alias)) s.delete(alias);\n else s.add(alias);\n window.localStorage.setItem(STORE_KEY, JSON.stringify([...s]));\n window.dispatchEvent(new Event(MUTE_EVENT));\n } catch {}\n}\n\nlet version = 0;\nfunction subscribe(callback: () => void) {\n const bump = () => { version++; callback(); };\n window.addEventListener(MUTE_EVENT, bump);\n window.addEventListener('storage', bump);\n return () => {\n window.removeEventListener(MUTE_EVENT, bump);\n window.removeEventListener('storage', bump);\n };\n}\n\nexport function useMuted(alias?: string | null): boolean {\n return useSyncExternalStore(subscribe, () => (alias ? isMuted(alias) : false), () => false);\n}\n\n/** Monotonic version for callers that use plain isMuted() inside render\n * loops (map callbacks can't call hooks). */\nexport function useMuteVersion(): number {\n return useSyncExternalStore(subscribe, () => version, () => 0);\n}\n","'use client';\n\nimport { useEffect } from 'react';\n\n// #217 S6 — verified themes: cyber (dark), light (white), and slack\n// (Vincent 2026-07-16 via api channel: \"其他的就搞成那种 Slack 方式吧…快速搞一个\"\n// — Slack-style is now the DEFAULT look; the network/topology page keeps its\n// showcase visuals, see TopoGraph's data-skin exemption).\n//\n// Mechanism: `slack` is implemented as a SKIN on top of the light theme —\n// applyTheme sets `data-theme=\"light\"` (so every existing light compat-shim\n// in globals.css applies unchanged) plus `data-skin=\"slack\"` which the\n// slack-only overrides key on (aubergine rail, Slack-blue accent, de-noise).\n// This keeps the fast first version to globals.css + three tiny component\n// touches instead of a full hex→token sweep (that sweep stays scheduled as\n// redesign Phase 0 next version).\n\nexport const THEMES = new Set(['cyber', 'light', 'slack']);\n\n/** Apply a theme choice to <html>. Single owner of the data-theme/data-skin\n * contract — Settings and Cmd+K call this too, so the skin attribute can\n * never desync from the theme attribute. */\nexport function applyTheme(t: string) {\n if (typeof document === 'undefined') return;\n const el = document.documentElement;\n if (t === 'slack') {\n el.setAttribute('data-theme', 'light');\n el.setAttribute('data-skin', 'slack');\n } else {\n el.setAttribute('data-theme', t);\n el.removeAttribute('data-skin');\n }\n}\n\nexport function ThemeProvider({ children }: { children: React.ReactNode }) {\n useEffect(() => {\n if (typeof document === 'undefined') return;\n // ROLLBACK (Vincent 07-20): the classic dark theme is the default again\n // — he prefers the original look and doesn't want a Slack copy as the\n // face of the product. 'slack' stays available as an explicit Settings\n // choice until the original agent-network theme replaces it. Users who\n // explicitly picked a theme keep their pick; everyone else returns to\n // cyber automatically (the slack-default window never wrote storage).\n let t = 'cyber';\n try {\n const saved = localStorage.getItem('anet-theme');\n if (saved && THEMES.has(saved)) t = saved;\n } catch {}\n applyTheme(t);\n }, []);\n return <>{children}</>;\n}\n","'use client';\n\nimport { useEffect, useState } from 'react';\nimport useSWR from 'swr';\n\n/** Issue #119 — server-side panel listing the hub's hosts + CPU/RAM bars.\n *\n * Steps 1+2 (SDK马 host telemetry + CommHub aggregation) shipped with\n * commhub-server v0.8.1-preview.2. Step 3 (this file, Round 20 of the\n * dashboard /loop) swaps the original mock seed for a SWR fetch of\n * `/api/hub/servers` (which proxies to the hub's `/api/servers`).\n *\n * Collapsed by default to a thin vertical icon strip so it never competes\n * with the topology graph for horizontal real-estate. State persists to\n * localStorage just like the other dashboard drawers.\n *\n * Backward-compat: if the upstream hub predates v0.8.1-preview.2 the\n * proxy returns `{ servers: [], unavailable: true }`. The drawer\n * surfaces a friendly \"not yet available\" hint instead of an empty list,\n * so old hubs don't read as \"something broke\".\n */\n\ninterface ServerAgent {\n alias: string;\n runtime: string | null;\n status: 'working' | 'idle' | 'offline';\n last_seen_at?: string | null;\n progress?: number | null; // 0..1\n}\n\ninterface ServerCard {\n hostname: string;\n ip?: string | null;\n cpu_load_1min: number | null;\n cpu_cores: number;\n mem_used_gb: number | null;\n mem_total_gb: number | null;\n /** Hero 1 v0.10.0: disk usage. Optional — older hubs don't report. */\n disk_used_gb?: number | null;\n disk_total_gb?: number | null;\n /** Hero 1 v0.10.0: short history for sparklines (5-min sliding window).\n * Each is the rolling 1-min average sampled at ~30s cadence (so ~10\n * data points for 5-min). Optional — older hubs don't report. */\n cpu_history?: number[];\n mem_history?: number[];\n /** v0.10.2 RFC-014 — disk usage 5-min rolling history. Optional;\n * older agent-node (< 2.4.1-preview.0) doesn't ship it. */\n disk_history?: number[];\n /** Hero 2 v0.10.0: per-server agent rollup. Optional — older hubs\n * send only aggregate agent_count. */\n agents?: ServerAgent[];\n agent_count: number;\n status: 'online' | 'offline';\n note?: string;\n}\n\ninterface ServersResponse {\n servers: ServerCard[];\n unavailable?: boolean;\n}\n\nconst fetcher = async (url: string): Promise<ServersResponse> => {\n const res = await fetch(url);\n if (res.status === 401) {\n if (typeof window !== 'undefined') window.location.assign('/login');\n throw new Error('unauthorized');\n }\n if (!res.ok) throw new Error(`hub ${res.status}`);\n return res.json();\n};\n\n// Bar tint by usage — green ≤60%, amber 60–85%, red >85%. Keeps the eye\n// going to whichever box is actually about to tip over.\nfunction barTint(pct: number) {\n if (pct >= 85) return { fill: '#ef4444', track: 'rgb(239 68 68 / 0.16)' };\n if (pct >= 60) return { fill: '#f59e0b', track: 'rgb(245 158 11 / 0.16)' };\n return { fill: '#10b981', track: 'rgb(16 185 129 / 0.16)' };\n}\n\nfunction Bar({ pct, label }: { pct: number; label: string }) {\n const t = barTint(pct);\n const clamped = Math.max(0, Math.min(100, pct));\n return (\n <div className=\"space-y-0.5\">\n <div className=\"flex justify-between text-[10px] text-[var(--fg-muted)] font-mono\">\n <span>{label}</span>\n <span className=\"tabular-nums\">{Math.round(clamped)}%</span>\n </div>\n <div className=\"h-1.5 rounded-full overflow-hidden\" style={{ background: t.track }}>\n <div\n className=\"h-full transition-[width] duration-300 ease-out\"\n style={{ width: `${clamped}%`, background: t.fill }}\n />\n </div>\n </div>\n );\n}\n\n/** Hero 1 v0.10.0 — inline SVG sparkline for 5-min rolling history.\n * Zero-dep (no recharts). Renders a stroked polyline + filled area.\n * Values are percentages (0..100); clamps inside. */\nfunction Sparkline({ values, tint, label }: { values: number[]; tint: string; label: string }) {\n if (!values || values.length < 2) return null;\n const w = 100, h = 18;\n const max = 100;\n const stride = w / Math.max(1, values.length - 1);\n const pts = values.map((v, i) => {\n const x = i * stride;\n const y = h - (Math.max(0, Math.min(max, v)) / max) * h;\n return `${x.toFixed(1)},${y.toFixed(1)}`;\n });\n const polyline = pts.join(' ');\n const area = `M0,${h} L${pts.join(' L')} L${w},${h} Z`;\n return (\n <svg\n width=\"100%\" height={h} viewBox={`0 0 ${w} ${h}`}\n preserveAspectRatio=\"none\" aria-label={`${label} 5-min history`}\n data-server-sparkline={label}\n >\n <path d={area} fill={tint} opacity=\"0.18\" />\n <polyline points={polyline} fill=\"none\" stroke={tint} strokeWidth=\"1.2\" />\n </svg>\n );\n}\n\n/** Hero 1 v0.10.0 — single health badge derived from the worst of\n * CPU / Mem / Disk percentages. Green ≤60%, amber 60-85%, red >85%\n * (same thresholds as Bar). Returns null when no percentages available\n * (e.g. offline server) so the card layout reads \"n/a · offline\" instead. */\nfunction HealthBadge({ cpu, mem, disk }: { cpu: number | null; mem: number | null; disk: number | null }) {\n const vals = [cpu, mem, disk].filter((v): v is number => typeof v === 'number');\n if (vals.length === 0) return null;\n const worst = Math.max(...vals);\n const t = barTint(worst);\n const status = worst >= 85 ? 'red' : worst >= 60 ? 'amber' : 'green';\n return (\n <span\n className=\"inline-block w-2 h-2 rounded-full shrink-0\"\n style={{ background: t.fill, boxShadow: `0 0 0 2px ${t.track}` }}\n data-server-health-badge={status}\n title={`worst: ${Math.round(worst)}%`}\n />\n );\n}\n\n/** Hero 2 v0.10.0 — per-server expandable agent list. Renders compact\n * rows: alias · runtime · status chip · last_seen relative. progress\n * bar appears when an agent reports progress (0..1). When the upstream\n * hub doesn't report agents[], the row falls through to a small\n * \"agent list pending hub upgrade\" hint. */\nfunction AgentList({ agents }: { agents?: ServerAgent[] }) {\n if (!agents || agents.length === 0) {\n return (\n <div className=\"text-[9px] text-[var(--fg-dim)] font-mono italic px-1 py-1\" data-server-agents-missing=\"true\">\n {/* #157 fix — copy update. Pre-#157 the placeholder read\n \"agent rollup pending hub ≥ 0.8.2-preview\". commhub-server@\n 0.8.2 is LIVE in prod (Vincent screenshot 5560 verified) but\n still doesn't ship `agents[]`. Version-specific text was\n misleading — implied upgrade-needed when hub already\n crossed the threshold. New copy drops the version pinning\n and just states the data-shape: hub hasn't reported the\n agent rollup for this server (could be hub-side feature\n gap or session-source gap). data-server-agents-missing\n attr surfaces the gate for tests. */}\n agent rollup not reported by hub\n </div>\n );\n }\n return (\n <ul className=\"space-y-1\" data-server-agent-list>\n {agents.map(a => {\n const statusColor =\n a.status === 'working' ? '#10b981' :\n a.status === 'idle' ? '#06b6d4' : '#6b7280';\n return (\n <li\n key={a.alias}\n className=\"flex items-center gap-1.5 text-[10px] font-mono\"\n data-server-agent={a.alias}\n >\n <span className=\"w-1.5 h-1.5 rounded-full shrink-0\" style={{ background: statusColor }} />\n <span className=\"font-semibold truncate\" style={{ color: 'var(--fg)' }}>{a.alias}</span>\n {a.runtime && (\n <span className=\"text-[9px] text-[var(--fg-dim)] shrink-0\">· {a.runtime}</span>\n )}\n {typeof a.progress === 'number' && a.progress > 0 && (\n <span className=\"ml-auto text-[9px] tabular-nums text-[var(--fg-muted)]\">\n {Math.round(a.progress * 100)}%\n </span>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n\nfunction useServers(enabled = true) {\n const { data, error } = useSWR<ServersResponse>(\n enabled ? '/api/hub/servers' : null,\n fetcher,\n { refreshInterval: 5000, dedupingInterval: 3000 },\n );\n const servers = data?.servers ?? [];\n const unavailable = data?.unavailable === true;\n const onlineCount = servers.filter(s => s.status === 'online').length;\n const loading = enabled && !data && !error;\n return { data, error, servers, unavailable, onlineCount, loading };\n}\n\nexport function ServersPanel({ enabled = true, className = '' }: { enabled?: boolean; className?: string }) {\n const [expanded, setExpanded] = useState<Set<string>>(new Set());\n useEffect(() => {\n try {\n const raw = localStorage.getItem('anet-servers-drawer-expanded');\n // Expanded server rows are a client-only sticky preference; hydrate once\n // after mount so SSR stays deterministic.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n if (raw) setExpanded(new Set(JSON.parse(raw)));\n } catch {}\n }, []);\n const toggleExpanded = (hostname: string) => setExpanded(prev => {\n const next = new Set(prev);\n if (next.has(hostname)) next.delete(hostname); else next.add(hostname);\n try { localStorage.setItem('anet-servers-drawer-expanded', JSON.stringify([...next])); } catch {}\n return next;\n });\n\n const { data, error, servers, unavailable, loading } = useServers(enabled);\n\n return (\n <div className={`min-h-0 overflow-y-auto px-2 py-2 space-y-2 ${className}`} data-servers-body>\n {loading && (\n <div className=\"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4\">\n loading servers…\n </div>\n )}\n {error && !data && (\n <div className=\"rounded-md border px-2.5 py-2 text-[10px] font-mono\"\n style={{ background: 'rgb(239 68 68 / 0.06)', borderColor: 'rgb(239 68 68 / 0.25)', color: '#ef4444' }}>\n hub unreachable · retrying every 5s\n </div>\n )}\n {unavailable && (\n <div className=\"text-[10px] text-[var(--fg-muted)] font-mono text-center py-3 leading-relaxed\">\n host telemetry not available<br/>\n <span className=\"text-[var(--fg-dim)]\">upgrade commhub-server ≥ 0.8.1-preview.2</span>\n </div>\n )}\n {!loading && !error && !unavailable && servers.length === 0 && (\n <div className=\"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4\">\n no servers reporting yet\n </div>\n )}\n {servers.map(s => {\n const offline = s.status === 'offline';\n const cpuPct = s.cpu_load_1min != null && s.cpu_cores > 0 ? (s.cpu_load_1min / s.cpu_cores) * 100 : null;\n const memPct = s.mem_used_gb != null && s.mem_total_gb != null && s.mem_total_gb > 0 ? (s.mem_used_gb / s.mem_total_gb) * 100 : null;\n const diskPct = s.disk_used_gb != null && s.disk_total_gb != null && s.disk_total_gb > 0 ? (s.disk_used_gb / s.disk_total_gb) * 100 : null;\n const isExpanded = expanded.has(s.hostname);\n return (\n <div\n key={s.hostname}\n className=\"rounded-lg border px-2.5 py-2 space-y-1.5\"\n style={{\n background: 'var(--bg)',\n borderColor: 'var(--border)',\n opacity: offline ? 0.55 : 1,\n }}\n data-server-card={s.hostname}\n data-server-expanded={isExpanded ? 'true' : 'false'}\n title={s.ip ? `${s.hostname} · ${s.ip}` : s.hostname}\n >\n {/* v0.10.0 Hero 1+2: header row — click toggles expanded\n detail view (sparklines + disk + agent rollup). */}\n <button\n type=\"button\"\n onClick={() => toggleExpanded(s.hostname)}\n aria-expanded={isExpanded}\n className=\"w-full flex items-center justify-between gap-2 text-left\"\n data-server-card-toggle={s.hostname}\n >\n <div className=\"min-w-0 flex items-center gap-1.5\">\n {/* Hero 1 health badge — worst-of CPU/Mem/Disk */}\n {!offline && <HealthBadge cpu={cpuPct} mem={memPct} disk={diskPct} />}\n <span className=\"font-mono text-[12px] font-semibold truncate\" style={{ color: 'var(--fg)' }}>{s.hostname}</span>\n {s.note && <span className=\"text-[9px] text-[var(--fg-dim)]\">({s.note})</span>}\n </div>\n <span className=\"flex items-center gap-1 shrink-0\">\n <span className=\"text-[10px] text-[var(--fg-muted)] font-mono tabular-nums\">\n {s.agent_count} agent{s.agent_count === 1 ? '' : 's'}\n </span>\n {/* Chevron — rotates 90° on expanded */}\n <svg\n width=\"10\" height=\"10\" viewBox=\"0 0 10 10\"\n style={{ transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)', transition: 'transform 150ms ease-out' }}\n aria-hidden\n >\n <path d=\"M3 1.5L7 5L3 8.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </span>\n </button>\n {!offline && cpuPct != null && (\n <Bar pct={cpuPct} label={`CPU ${s.cpu_load_1min!.toFixed(2)}/${s.cpu_cores}`} />\n )}\n {!offline && memPct != null && (\n <Bar pct={memPct} label={`RAM ${s.mem_used_gb!.toFixed(1)}/${s.mem_total_gb!.toFixed(1)}G`} />\n )}\n {offline && (\n <div className=\"text-[10px] text-[var(--fg-dim)] font-mono italic\">CPU n/a · RAM n/a · offline</div>\n )}\n {/* v0.10.0 Hero 1+2: expanded detail — disk bar +\n 5-min sparklines + agent rollup. Visible only when\n the user clicks the card. Renders gracefully when\n upstream hub hasn't shipped optional fields. */}\n {isExpanded && !offline && (\n <div className=\"pt-1 mt-1 border-t space-y-1.5\" style={{ borderColor: 'var(--border)' }}>\n {diskPct != null ? (\n <Bar pct={diskPct} label={`DISK ${s.disk_used_gb!.toFixed(1)}/${s.disk_total_gb!.toFixed(1)}G`} />\n ) : (\n /* #157 sibling fix — same misleading version-pin copy\n dropped at the disk-metric placeholder. Same\n rationale as the agent-rollup copy above. */\n <div className=\"text-[9px] text-[var(--fg-dim)] font-mono italic\" data-server-disk-missing=\"true\">disk metric not reported by hub</div>\n )}\n {s.cpu_history && s.cpu_history.length >= 2 && (\n <div className=\"space-y-0.5\">\n <div className=\"text-[9px] text-[var(--fg-muted)] font-mono\">CPU · 5-min</div>\n <Sparkline values={s.cpu_history} tint=\"#10b981\" label=\"CPU\" />\n </div>\n )}\n {s.mem_history && s.mem_history.length >= 2 && (\n <div className=\"space-y-0.5\">\n <div className=\"text-[9px] text-[var(--fg-muted)] font-mono\">RAM · 5-min</div>\n <Sparkline values={s.mem_history} tint=\"#06b6d4\" label=\"MEM\" />\n </div>\n )}\n {/* v0.10.2 RFC-014 §7 close gate #3 — disk usage\n 5-min curve. Amber tint matches the disk bar\n tier convention (DISK > CPU/Mem in alert-\n priority hierarchy since disk-full is a hard\n failure mode). Render only when agent-node\n 2.4.1-preview.0+ has shipped disk_history;\n backward-compat handles older agents silently\n (no sparkline, no broken state). */}\n {s.disk_history && s.disk_history.length >= 2 && (\n <div className=\"space-y-0.5\">\n <div className=\"text-[9px] text-[var(--fg-muted)] font-mono\">DISK · 5-min</div>\n <Sparkline values={s.disk_history} tint=\"#f59e0b\" label=\"DISK\" />\n </div>\n )}\n <div className=\"pt-1\">\n <div className=\"text-[9px] text-[var(--fg-muted)] font-mono mb-0.5\">agents</div>\n <AgentList agents={s.agents} />\n </div>\n </div>\n )}\n </div>\n );\n })}\n {servers.length > 0 && (\n <div className=\"pt-1 text-[9px] text-[var(--fg-dim)] font-mono text-center\">\n live · refreshing every 5s\n </div>\n )}\n </div>\n );\n}\n\nexport function ServersDrawer() {\n const [open, setOpen] = useState(false);\n // Drawer state is per-user-machine — persist like the other dashboard\n // sticky toggles (`anet-topo-layout`, `anet-topo-view`, etc.).\n useEffect(() => {\n // Drawer openness is persisted in localStorage and can only be restored on\n // the client after mount.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n try { if (localStorage.getItem('anet-servers-drawer') === '1') setOpen(true); } catch {}\n }, []);\n const toggle = () => setOpen(prev => {\n const next = !prev;\n try { localStorage.setItem('anet-servers-drawer', next ? '1' : '0'); } catch {}\n return next;\n });\n\n // Round 20 / #119 step 3 final delivery — real SWR fetch. 5s refresh\n // matches the other live drawers (HealthBanner, Sidebar) so an operator\n // sees host telemetry update in roughly the same beat as session state.\n // Only poll while expanded — collapsed icon strip doesn't need fresh data.\n const { servers, onlineCount } = useServers(open);\n\n return (\n <aside\n 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\"\n style={{\n background: 'var(--bg-secondary)',\n borderColor: 'var(--border)',\n width: open ? 296 : 40,\n maxHeight: 'calc(100vh - 6rem)',\n transition: 'width 200ms ease-out',\n }}\n aria-label=\"Servers panel\"\n >\n <button\n onClick={toggle}\n aria-expanded={open}\n aria-label={open ? 'Collapse servers panel' : 'Expand servers panel'}\n className=\"flex items-center gap-2 px-2.5 py-2 border-b text-[11px] font-semibold tracking-wide select-none\"\n style={{ color: 'var(--fg)', borderColor: 'var(--border)' }}\n >\n <svg className=\"w-4 h-4 shrink-0\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"6\" rx=\"1.5\" />\n <rect x=\"3\" y=\"14\" width=\"18\" height=\"6\" rx=\"1.5\" />\n <circle cx=\"7\" cy=\"7\" r=\"0.7\" fill=\"currentColor\" />\n <circle cx=\"7\" cy=\"17\" r=\"0.7\" fill=\"currentColor\" />\n </svg>\n {open && (\n <>\n <span className=\"flex-1 text-left\">Servers</span>\n <span className=\"text-[10px] text-[var(--fg-muted)] font-mono\">{onlineCount}/{servers.length}</span>\n </>\n )}\n </button>\n\n {open && (\n <ServersPanel enabled={open} className=\"flex-1\" />\n )}\n </aside>\n );\n}\n"],"names":["process","env","NEXT_RUNTIME","module","exports","require","__NEXT_EXPERIMENTAL_REACT","NODE_ENV","TURBOPACK","vendored","ReactJsxRuntime","React","AppRouterContext","ReactServerDOMTurbopackClient","HooksClientContext","ServerInsertedHtml","parseHubTime","dateStr","iso","includes","replace","t","Date","parse","Number","isFinite","relativeAgo","s","Math","floor","now","formatWeChatTime","value","d","zh","navigator","language","toLowerCase","startsWith","hm","String","getHours","padStart","getMinutes","startOfDay","x","getFullYear","getMonth","getDate","getTime","dayDiff","round","wd","Intl","DateTimeFormat","undefined","weekday","format","md","month","day","year","NetworkContext","networkId","setNetworkId","NetworkProvider","children","saved","sessionStorage","getItem","setAndPersist","id","setItem","Provider","useNetworkId","STORE_KEY","MUTE_EVENT","readSet","Set","isMuted","alias","has","toggleMute","version","subscribe","callback","bump","window","addEventListener","removeEventListener","useMuted","useMuteVersion","THEMES","applyTheme","document","el","documentElement","setAttribute","removeAttribute","ThemeProvider","localStorage","fetcher","url","res","fetch","status","Error","ok","json","barTint","pct","fill","track","Bar","label","clamped","max","min","className","style","background","width","Sparkline","values","tint","length","w","h","stride","pts","map","v","i","y","toFixed","polyline","join","area","height","viewBox","preserveAspectRatio","opacity","points","stroke","strokeWidth","HealthBadge","cpu","mem","disk","vals","filter","worst","boxShadow","title","AgentList","agents","a","statusColor","color","runtime","progress","useServers","enabled","data","error","refreshInterval","dedupingInterval","servers","unavailable","onlineCount","loading","ServersPanel","expanded","setExpanded","raw","JSON","toggleExpanded","hostname","prev","next","delete","add","stringify","borderColor","offline","cpuPct","cpu_load_1min","cpu_cores","memPct","mem_used_gb","mem_total_gb","diskPct","disk_used_gb","disk_total_gb","isExpanded","ip","type","onClick","note","agent_count","transform","transition","strokeLinecap","strokeLinejoin","cpu_history","mem_history","disk_history","ServersDrawer","open","setOpen","toggle","maxHeight","rx","cx","cy","r"],"mappings":"2kCA0BQG,EAAOC,OAAO,CAAGC,EAAQ,CAAA,CAAA,IAAA,gCC1BjCF,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRI,QAAQ,CAAC,YAAY,CAAEC,eAAe,+BCFxCP,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRI,QAAQ,CAAC,YAAY,CAAEE,KAAK,+BCF9BR,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRI,QAAQ,CAAC,QAAW,CAACG,gBAAgB,+BCFvCT,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRI,QAAQ,CAAC,YAAY,CAAEI,6BAA6B,+BCFtDV,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRI,QAAQ,CAAC,QAAW,CAACK,kBAAkB,8BCFzCX,GAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GAC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,EAAA,EAAA,IAAA,EAAC,MAAA,CAAIjE,UAAU,mBAAmBqB,QAAQ,YAAY5B,KAAK,OAAOgC,OAAO,eAAeC,YAAY,MAAM0D,cAAc,QAAQC,eAAe,kBAC7I,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK9J,EAAE,IAAIwF,EAAE,IAAIZ,MAAM,KAAKiB,OAAO,IAAI0E,GAAG,QAC3C,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAKvK,EAAE,IAAIwF,EAAE,KAAKZ,MAAM,KAAKiB,OAAO,IAAI0E,GAAG,QAC5C,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAAOC,GAAG,IAAIC,GAAG,IAAIC,EAAE,MAAMxG,KAAK,iBACnC,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAAOsG,GAAG,IAAIC,GAAG,KAAKC,EAAE,MAAMxG,KAAK,oBAErCiG,GACC,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,QAAA,CAAA,WACE,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK1F,UAAU,4BAAmB,YACnC,CAAA,EAAA,EAAA,IAAA,EAAC,OAAA,CAAKA,UAAU,yDAAgDmD,EAAY,IAAEF,EAAQ1C,MAAM,UAKjGmF,GACC,CAAA,EAAA,EAAA,GAAA,EAACrC,EAAAA,CAAaT,QAAS8C,EAAM1F,UAAU,aAI/C","ignoreList":[0,1,2,3,4,5,6]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},99462,a=>{"use strict";var b=a.i(98005);a.s(["previewContent",0,function(a){return a&&a.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"timeAgo",0,function(a){return(0,b.relativeAgo)(a)??"--"}])},72405,12180,a=>{"use strict";var b=a.i(5400),c=a.i(82956);let d="anet-avatars-updated",e=[];function f(a){return a&&(({})[a]||function(a){if(!e.length)return"";let b=5381;for(let c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)>>>0;return e[b%e.length]}(a))||""}let g=0;function h(a){let b=()=>{g++,a()};return window.addEventListener(d,b),window.addEventListener("storage",b),()=>{window.removeEventListener(d,b),window.removeEventListener("storage",b)}}function i(a){return(0,c.useSyncExternalStore)(h,()=>f(a),()=>"")}a.s(["getAvatarUrl",0,f,"setAvatarUrl",0,function(a,b){},"useAvatarUrl",0,i,"useAvatarsVersion",0,function(){return(0,c.useSyncExternalStore)(h,()=>g,()=>0)}],12180);let j=[180,200,220,270,300,330,30,90];function k(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)>>>0;let c=j[b%j.length];return{bg:`hsl(${c} 55% 22%)`,ring:`hsl(${c} 60% 45%)`,text:`hsl(${c} 80% 78%)`}}function l(a){return a?(a.trim().match(/[\p{L}\p{N}]/u)?.[0]||a.trim()[0]||"·").toUpperCase():"·"}a.s(["AliasAvatar",0,function({alias:a,size:d=28,className:e=""}){let f=i(a),[g,h]=(0,c.useState)("loading"),[j,m]=(0,c.useState)(f);if(f!==j&&(m(f),h("loading")),f&&"error"!==g)return(0,b.jsx)("span",{className:`anet-alias-avatar relative inline-flex shrink-0 overflow-hidden rounded-full border border-[var(--border)] ${"loading"===g?"animate-pulse bg-[var(--bg-elevated)]":""} ${e}`,style:{width:d,height:d},title:a,"aria-hidden":!0,children:(0,b.jsx)("img",{src:f,alt:"",loading:"lazy",onLoad:()=>h("ready"),onError:()=>h("error"),className:`h-full w-full rounded-full object-cover transition-opacity duration-150 ${"ready"===g?"opacity-100":"opacity-0"}`})});if(/\bgrok\b|grok-build|grok测试员|grok-demo/i.test(a))return(0,b.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border border-emerald-500/45 bg-emerald-950/70 shrink-0 ${e}`,style:{width:d,height:d,backgroundImage:"url(/vendors/grok.svg)",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"68% 68%"},title:a,"aria-hidden":!0});let n=k(a),o=Math.max(9,Math.round(.42*d));return(0,b.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${e}`,style:{width:d,height:d,fontSize:o,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:a,"aria-hidden":!0,children:l(a)})},"aliasAvatarColors",0,k,"aliasInitial",0,l],72405)},99038,a=>{"use strict";var b=a.i(5400),c=a.i(82956),d=a.i(66860);let e={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 f({variant:a,size:c}){let d={width:c,height:c},e={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(a){case"nodes":return(0,b.jsx)("svg",{viewBox:"0 0 64 64",...d,children:(0,b.jsxs)("g",{...e,children:[(0,b.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,b.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,b.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,b.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,b.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,b.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,b.jsx)("svg",{viewBox:"0 0 64 64",...d,children:(0,b.jsxs)("g",{...e,children:[(0,b.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,b.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,b.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,b.jsx)("svg",{viewBox:"0 0 64 64",...d,children:(0,b.jsxs)("g",{...e,children:[(0,b.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,b.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,b.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,b.jsx)("svg",{viewBox:"0 0 64 64",...d,children:(0,b.jsxs)("g",{...e,children:[(0,b.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,b.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,b.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,b.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,b.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,b.jsx)("svg",{viewBox:"0 0 64 64",...d,children:(0,b.jsxs)("g",{...e,children:[(0,b.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,b.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,b.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,b.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,b.jsx)("svg",{viewBox:"0 0 64 64",...d,children:(0,b.jsxs)("g",{...e,children:[(0,b.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,b.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,b.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,b.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,b.jsx)("svg",{viewBox:"0 0 64 64",...d,children:(0,b.jsxs)("g",{...e,children:[(0,b.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,b.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function g({variant:a="generic",title:c,sub:h,cta:i,compact:j=!1}){let k=e[a],l=c??k.title,m=h??k.sub;return(0,b.jsxs)("div",{className:`text-center ${j?"py-8":"py-16"} px-4`,role:"status",children:[(0,b.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,b.jsx)(f,{variant:a,size:j?40:56})}),(0,b.jsx)("h3",{className:`font-medium text-gray-300 ${j?"text-sm":"text-base"}`,children:l}),m&&(0,b.jsx)("p",{className:`text-gray-500 ${j?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:m}),i&&(0,b.jsx)("div",{className:"mt-4",children:i.href?(0,b.jsxs)(d.default,{href:i.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[i.label,(0,b.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,b.jsxs)("button",{onClick:i.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[i.label,(0,b.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function h({children:a}){return(0,b.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#26262b] bg-[#161618] shadow-lg shadow-black/20",children:a})}function i({cmd:a}){let[d,e]=(0,c.useState)(!1),f=async()=>{try{await navigator.clipboard.writeText(a),e(!0),setTimeout(()=>e(!1),1800)}catch{}};return(0,b.jsxs)("div",{className:"anet-empty-cmd flex items-start sm:items-center gap-2 bg-[#0e0e10] border border-[#26262b] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,b.jsx)("code",{className:"text-cyan-300 font-mono select-all min-w-0 break-all sm:break-normal",children:a}),(0,b.jsx)("button",{type:"button",onClick:f,"aria-label":d?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1c1c1f] transition-colors",children:d?(0,b.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,b.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,b.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}a.s(["EmptyState",0,g,"NodesEmptyState",0,function({hint:a,taskHistoryCount:c=0}){return a?.global_count?(0,b.jsx)(h,{children:(0,b.jsx)(g,{variant:"nodes",title:"No agents in this network",sub:`Server has ${a.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`})}):c>0?(0,b.jsx)(h,{children:(0,b.jsx)(g,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${c.toLocaleString()} task${1===c?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,b.jsx)(h,{children:(0,b.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,b.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,b.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,b.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,b.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,b.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,b.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,b.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,b.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,b.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,b.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,b.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,b.jsx)("div",{className:"mt-4 inline-block",children:(0,b.jsx)(i,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,b.jsx)("p",{className:"text-gray-600 text-xs mt-3 max-w-md mx-auto",children:"Once the agent connects, it appears here automatically within a few seconds — no refresh needed."}),(0,b.jsx)("div",{className:"mt-3",children:(0,b.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,b.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})})}])},86176,a=>{"use strict";a.s(["DASHBOARD_VERSION",0,"0.6.3-preview.43"],86176)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0qv41lg._.js.map
|