@sleep2agi/agent-network-dashboard 0.5.7-preview.47 → 0.5.7-preview.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +16 -16
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin.html +2 -2
- package/.next/server/app/admin.rsc +2 -2
- package/.next/server/app/admin.segments/_full.segment.rsc +2 -2
- package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_index.segment.rsc +2 -2
- package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +2 -2
- package/.next/server/app/login.rsc +3 -3
- package/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/login.segments/login.segment.rsc +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 +3 -3
- package/.next/server/app/logs.segments/_full.segment.rsc +3 -3
- package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs.segment.rsc +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 +3 -3
- package/.next/server/app/messages.segments/_full.segment.rsc +3 -3
- package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
- package/.next/server/app/messages.segments/_index.segment.rsc +2 -2
- package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages.segment.rsc +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 +2 -2
- package/.next/server/app/node.segments/_full.segment.rsc +2 -2
- package/.next/server/app/node.segments/_head.segment.rsc +1 -1
- package/.next/server/app/node.segments/_index.segment.rsc +2 -2
- package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/node.segments/node.segment.rsc +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 +3 -3
- package/.next/server/app/nodes.segments/_full.segment.rsc +3 -3
- package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_index.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs.html +2 -2
- package/.next/server/app/server-logs.rsc +2 -2
- package/.next/server/app/server-logs.segments/_full.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/server-logs.segment.rsc +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 +2 -2
- package/.next/server/app/servers.segments/_full.segment.rsc +2 -2
- package/.next/server/app/servers.segments/_head.segment.rsc +1 -1
- package/.next/server/app/servers.segments/_index.segment.rsc +2 -2
- package/.next/server/app/servers.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/servers.segments/servers/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/servers.segments/servers.segment.rsc +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 +3 -3
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +3 -3
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens.html +2 -2
- package/.next/server/app/settings/tokens.rsc +3 -3
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +3 -3
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
- package/.next/server/app/settings.html +2 -2
- package/.next/server/app/settings.rsc +3 -3
- package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks.html +2 -2
- package/.next/server/app/tasks.rsc +3 -3
- package/.next/server/app/tasks.segments/_full.segment.rsc +3 -3
- package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/_index.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0sv~g.o._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0sv~g.o._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0torghd._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0torghd._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0gd.4pc._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0gd.4pc._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.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/03kyu004kl1qj.js +1 -0
- package/.next/static/chunks/{0g3j4r~1enez5.js → 0culai--~hapi.js} +1 -1
- package/.next/static/chunks/0d9nib7jp9zjh.js +1 -0
- package/.next/static/chunks/0jq89vl3g9-kk.js +1 -0
- package/.next/static/chunks/0n76d78e295ed.js +1 -0
- package/.next/static/chunks/0nlfzv79l6q9y.js +1 -0
- package/.next/static/chunks/{0s_yub.bd9t3..js → 0n~uo2wa5pz-x.js} +1 -1
- package/.next/static/chunks/{0_m0zx8f~zx54.js → 0w0z2mm3gdvcj.js} +1 -1
- package/.next/static/chunks/{0s~r82s5v0-_8.css → 144i5lff1w9v0.css} +1 -1
- package/.next/static/chunks/{0-1tbudgpkr6z.js → 169xiu8c3p8bc.js} +1 -1
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/app/components/EmptyState.tsx +9 -2
- package/package.json +1 -1
- package/.next/static/chunks/00b-ysl~m~dr~.js +0 -1
- package/.next/static/chunks/00d~isei247an.js +0 -1
- package/.next/static/chunks/0gp-mz_4aqk3r.js +0 -1
- package/.next/static/chunks/0ti3v67ixu43p.js +0 -1
- package/.next/static/chunks/0urrkhru4u8d2.js +0 -1
- /package/.next/static/{M74YRxMJUFRUThJfq4OGt → BFK7pYZUtXtjXk-HUKQjq}/_buildManifest.js +0 -0
- /package/.next/static/{M74YRxMJUFRUThJfq4OGt → BFK7pYZUtXtjXk-HUKQjq}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{M74YRxMJUFRUThJfq4OGt → BFK7pYZUtXtjXk-HUKQjq}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../agent-network-dashboard/app/lib/status.ts","../../../../../agent-network-dashboard/app/lib/time.ts","../../../../../agent-network-dashboard/app/components/utils.ts","../../../../../agent-network-dashboard/app/components/AliasAvatar.tsx","../../../../../agent-network-dashboard/app/components/EmptyState.tsx","../../../../../agent-network-dashboard/app/lib/hooks.ts","../../../../../agent-network-dashboard/app/components/CollapsibleSearch.tsx","../../../../../agent-network-dashboard/app/nodes/page.tsx"],"sourcesContent":["/** 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\nexport type TaskStatus = typeof TASK_STATUSES[number];\n\n/** Pill / chip background+text+border. Tailwind classes, not inlined hex,\n * because chips are static class names safe from purge. */\nexport const STATUS_CHIP_CLASS: Record<string, string> = {\n created: 'bg-gray-500/10 text-gray-400 border-gray-500/20',\n delivered: 'bg-blue-500/10 text-blue-300 border-blue-500/20',\n acked: 'bg-cyan-500/10 text-cyan-300 border-cyan-500/20',\n running: 'bg-green-500/10 text-green-300 border-green-500/20',\n replied: 'bg-purple-500/10 text-purple-300 border-purple-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-yellow-500/10 text-yellow-300 border-yellow-500/20',\n expired: 'bg-orange-500/10 text-orange-300 border-orange-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: '#60a5fa',\n acked: '#22d3ee',\n running: '#4ade80',\n replied: '#a78bfa',\n closed: '#6b7280',\n failed: '#f87171',\n cancelled: '#facc15',\n expired: '#fb923c',\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. */\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-blue-500/10 text-blue-300 border-blue-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-blue-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-blue-500',\n acked: 'bg-cyan-500',\n running: 'bg-green-500',\n replied: 'bg-purple-500',\n closed: 'bg-gray-600',\n failed: 'bg-red-500',\n cancelled: 'bg-yellow-500',\n expired: 'bg-orange-500',\n};\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","/** 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\nexport function formatUptime(seconds: number): string {\n const h = Math.floor(seconds / 3600);\n const m = Math.floor((seconds % 3600) / 60);\n if (h > 0) return `${h}h ${m}m`;\n return `${m}m`;\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 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 { 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-[#2a2a4a] bg-[#111128] 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 <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-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm\">\n <code className=\"text-cyan-300 font-mono select-all\">{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-[#1a1a2a] 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","import useSWR from 'swr';\nimport { Session, Health, AnetConfig } from '../components/types';\nimport { useNetworkId } from './network-context';\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\nconst SWR_OPTIONS = { refreshInterval: 5000, dedupingInterval: 3000 };\n\n/** Append network_id to URL if set */\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 useSessions() {\n const { networkId } = useNetworkId();\n const { data, error, isLoading } = useSWR<{ sessions: Session[]; _hint?: { global_count?: number; filtered_network?: string } }>(\n withNetwork('/api/hub/status', networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return { sessions: data?.sessions || [], hint: data?._hint, error, isLoading };\n}\n\nexport function useHealth() {\n const { data, error } = useSWR<Health>('/api/hub/health', fetcher, SWR_OPTIONS);\n return { health: data || null, error };\n}\n\nexport function useAnetConfig() {\n const { data } = useSWR<AnetConfig>('/api/anet/config', fetcher, { refreshInterval: 30000 });\n return { config: data || null };\n}\n\nexport function useTasks(params?: Record<string, string>) {\n const { networkId } = useNetworkId();\n const query = new URLSearchParams({ limit: '100', ...params }).toString();\n const { data, error, isLoading } = useSWR(\n withNetwork(`/api/hub/tasks?${query}`, networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return {\n tasks: data?.tasks || [],\n count: data?.count ?? 0,\n source: data?.source,\n error,\n isLoading,\n };\n}\n\nexport function useStats() {\n const { networkId } = useNetworkId();\n const { data, error } = useSWR(withNetwork('/api/hub/stats', networkId), fetcher, SWR_OPTIONS);\n return { stats: data?.ok ? data : null, error };\n}\n\nexport function useMessages(limit = 100) {\n const { networkId } = useNetworkId();\n const { data, error, isLoading } = useSWR(\n withNetwork(`/api/hub/messages?limit=${limit}`, networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return { messages: data?.messages || [], error, isLoading };\n}\n\nexport function useNodeSession(alias: string) {\n const { data, error, isLoading } = useSWR(\n alias ? `/api/hub/session?alias=${encodeURIComponent(alias)}` : null,\n fetcher,\n SWR_OPTIONS,\n );\n return {\n session: data?.session || null,\n inbox: data?.inbox || [],\n sse: data?.sse || 0,\n error,\n isLoading,\n };\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 } 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({\n value,\n onChange,\n placeholder = 'Search…',\n label = 'Search',\n enabled = true,\n}: UseCollapsibleSearchProps): CollapsibleSearchAPI {\n const [open, setOpen] = useState(false);\n\n const reset = useCallback(() => {\n onChange('');\n setOpen(false);\n }, [onChange]);\n\n const Button = useCallback(() => {\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-[#2a2a4a] bg-[#111128] text-gray-400 hover:text-gray-200 hover:border-[#3a3a5a]'\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-[#0a0a1a]\" />\n )}\n </button>\n );\n }, [open, value, label, enabled]);\n\n const Row = useCallback(() => {\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-[#111128] border border-[#2a2a4a] 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 }, [open, value, onChange, placeholder, reset, enabled]);\n\n return { Button, Row, value, reset };\n}\n","'use client';\n\nimport { useState } from 'react';\nimport { timeAgo } from '../components/utils';\nimport { useSessions, useHealth } from '../lib/hooks';\nimport { TaskChatPanel } from '../components/TaskChatPanel';\nimport { EmptyState, NodesEmptyState } from '../components/EmptyState';\nimport { AliasAvatar } from '../components/AliasAvatar';\nimport { useCollapsibleSearch } from '../components/CollapsibleSearch';\nimport type { Session } from '../components/types';\nimport { SESSION_STATUS_CHIP_CLASS as STATUS_COLORS } from '../lib/status';\nimport { useChatUnread } from '../lib/chat-unread';\n\n/** Round 81: shorten long server hostnames (Alibaba `iZ…oyZ` style)\n * for table display. Returns the original string unchanged when ≤12\n * chars. Full value should stay in `title=` for hover + screen-readers. */\nfunction shortServer(server: string | null | undefined): string {\n if (!server) return '—';\n return server.length > 12 ? `${server.slice(0, 8)}…` : server;\n}\n\ntype ViewMode = 'list' | 'grid';\ntype SessionRow = Session & { online: boolean };\n\nexport default function NodesPage() {\n const { sessions, isLoading: loading } = useSessions();\n const { health } = useHealth();\n const { hasUnread } = useChatUnread();\n const sseMap = health?.sse_sessions || {};\n // SSE keys are `network_id:alias` since server v0.7+. Look up with the\n // composite key first, fall back to alias-only for legacy hubs.\n const sseFor = (s: { alias: string; network_id?: string }) =>\n (s.network_id ? sseMap[`${s.network_id}:${s.alias}`] : undefined) ?? sseMap[s.alias];\n const [filterStatus, setFilterStatus] = useState('');\n const [search, setSearch] = useState('');\n const [viewMode, setViewMode] = useState<ViewMode>('list');\n const [chatAlias, setChatAlias] = useState<string | null>(null);\n // #209 R32→R34: the WeChat-style magnifier-toggle search was hand-rolled\n // inline in R32. R34 extracted it to a shared hook so /nodes, /messages,\n // and any future search surface stay visually + behaviourally identical.\n // The hook returns a Button (place in header) + Row (place after header).\n const searchCtl = useCollapsibleSearch({\n value: search,\n onChange: setSearch,\n placeholder: 'Search nodes…',\n label: 'Search nodes',\n enabled: sessions.length > 0,\n });\n\n const filtered: SessionRow[] = sessions\n .map(s => ({ ...s, online: !!sseFor(s) }))\n .filter(s => {\n if (filterStatus === 'online') return s.online;\n if (filterStatus === 'offline') return !s.online;\n if (filterStatus && filterStatus !== s.status) return false;\n return true;\n })\n .filter(s => !search || s.alias.toLowerCase().includes(search.toLowerCase()) || (s.agent || '').toLowerCase().includes(search.toLowerCase()))\n .sort((a, b) => (b.online ? 1 : 0) - (a.online ? 1 : 0) || (b.status === 'working' ? 1 : 0) - (a.status === 'working' ? 1 : 0));\n\n const onlineCount = sessions.filter(s => sseFor(s)).length;\n\n return (\n <div className=\"min-h-screen max-w-full overflow-x-hidden bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono\">\n {/* #209 R31 (mobile vertical rhythm — goal \"大幅提升移动端体验\",\n extending R28's Overview pattern + R30's /tasks pattern):\n this header row + the status-bar wrapper + the filter row\n below all drop mb-6 → mb-4 sm:mb-6. Three spots × 8 px =\n ~24 px scroll reclaim on /nodes before the first card.\n #209 R32: search affordance moved to top-right magnifier\n button (Vincent WeChat ref msg 563). justify-between makes\n the title cluster hug left, button hugs right. */}\n <div className=\"flex items-center gap-4 mb-4 sm:mb-6\">\n <div className=\"flex items-center gap-3 min-w-0 flex-1\">\n <h1 className=\"text-2xl font-bold text-white lg:ml-0 ml-10\">Nodes</h1>\n <span className=\"text-xs bg-green-900/30 text-green-400 px-2 py-0.5 rounded-full border border-green-800/30 shrink-0\">\n {onlineCount} online\n </span>\n <span className=\"text-xs bg-gray-900/30 text-gray-400 px-2 py-0.5 rounded-full border border-gray-800/30 shrink-0\">\n {sessions.length} total\n </span>\n </div>\n <searchCtl.Button />\n </div>\n\n {/* #209 R34: shared <CollapsibleSearch> component handles row reveal,\n autofocus, Escape, and Cancel. enabled=sessions.length>0 hides\n everything until there's content to search. */}\n <searchCtl.Row />\n\n {/* Status bar */}\n {sessions.length > 0 && (() => {\n const working = filtered.filter(s => s.online && s.status === 'working').length;\n const idle = filtered.filter(s => s.online && s.status === 'idle').length;\n const offline = filtered.filter(s => !s.online).length;\n const total = filtered.length || 1;\n return (\n <div className=\"mb-4 sm:mb-6\">\n <div className=\"flex h-2 rounded-full overflow-hidden bg-gray-800\">\n {working > 0 && <div className=\"bg-green-500\" style={{ width: `${(working/total)*100}%` }} />}\n {idle > 0 && <div className=\"bg-cyan-500\" style={{ width: `${(idle/total)*100}%` }} />}\n {offline > 0 && <div className=\"bg-gray-600\" style={{ width: `${(offline/total)*100}%` }} />}\n </div>\n <div className=\"flex gap-4 mt-1.5 text-[10px] text-gray-500\">\n {working > 0 && <span><span className=\"inline-block w-2 h-2 rounded-full bg-green-500 mr-1\" />{working} working</span>}\n {idle > 0 && <span><span className=\"inline-block w-2 h-2 rounded-full bg-cyan-500 mr-1\" />{idle} idle</span>}\n {offline > 0 && <span><span className=\"inline-block w-2 h-2 rounded-full bg-gray-600 mr-1\" />{offline} offline</span>}\n </div>\n </div>\n );\n })()}\n\n {/* Round 74: hide the filter+view chrome when there are no nodes\n anywhere — these controls have nothing to act on, and they only\n push the onboarding CTA further down. When at least one session\n exists, the chrome is back even if the current filter happens\n to hide everything (so users can clear filters). */}\n {sessions.length > 0 && (\n <div className=\"flex flex-wrap gap-3 mb-4 sm:mb-6\">\n {/* R32: the inline search input was moved to the top-right\n magnifier toggle above. The status select + List/Grid\n toggle stay here. */}\n <select\n value={filterStatus}\n onChange={e => setFilterStatus(e.target.value)}\n className=\"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-base sm:text-sm text-white focus:border-blue-500/50 focus:outline-none\"\n >\n <option value=\"\">All</option>\n <option value=\"online\">Online</option>\n <option value=\"offline\">Offline</option>\n <option value=\"working\">Working</option>\n <option value=\"idle\">Idle</option>\n <option value=\"blocked\">Blocked</option>\n <option value=\"error\">Error</option>\n </select>\n {/* Round 80: List/Grid toggle hidden on mobile — Grid uses\n grid-cols-1 below `md` and List degrades to the same single\n column, so the toggle has no visual effect under sm and only\n steals a row of vertical space. */}\n <div className=\"hidden sm:flex ml-auto rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 text-sm\">\n {(['list', 'grid'] as const).map(mode => (\n <button\n key={mode}\n type=\"button\"\n onClick={() => setViewMode(mode)}\n className={`rounded-md px-3 py-1.5 transition-colors ${\n viewMode === mode\n ? 'bg-cyan-500/10 text-cyan-300'\n : 'text-gray-500 hover:text-gray-200'\n }`}\n >\n {mode === 'list' ? 'List' : 'Grid'}\n </button>\n ))}\n </div>\n </div>\n )}\n\n {loading ? (\n <div className=\"animate-pulse space-y-2\">\n {[1,2,3,4].map(i => <div key={i} className=\"h-16 bg-gray-800/20 rounded-lg\" />)}\n </div>\n ) : filtered.length === 0 ? (\n sessions.length === 0 ? (\n /* Round 73: first-run case — no agents anywhere. Use the same\n onboarding empty state as the Overview (NodesEmptyState\n includes the `npx … init` quickstart command). Previously this\n was the \"No nodes match your filters\" copy, which was wrong\n for new users who have no filters applied. */\n <NodesEmptyState />\n ) : (\n <EmptyState\n variant=\"nodes\"\n title=\"No nodes match your filters\"\n sub=\"Try clearing search or status filters, or wait for an agent to register.\"\n />\n )\n ) : viewMode === 'grid' ? (\n <div className=\"grid min-w-0 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4\">\n {filtered.map(s => {\n const statusKey = s.online ? s.status : 'offline';\n const progress = typeof s.progress === 'number' ? s.progress : 0;\n const unread = hasUnread(s.alias);\n\n return (\n <div\n key={s.alias}\n role=\"button\"\n tabIndex={0}\n onClick={() => setChatAlias(s.alias)}\n onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setChatAlias(s.alias); } }}\n className={`relative min-w-0 max-w-full overflow-hidden rounded-xl border border-[#2a2a4a] bg-[#111128] p-4 transition-colors hover:border-cyan-500/40 cursor-pointer ${!s.online ? 'opacity-60' : ''}`}\n >\n {!s.online && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <span className=\"rotate-[-20deg] rounded-xl border border-white/10 bg-black/20 px-5 py-2 text-xl font-bold uppercase tracking-[0.35em] text-white/10\">\n Offline\n </span>\n </div>\n )}\n <div className=\"flex items-start gap-3\">\n <div className=\"relative shrink-0\">\n <AliasAvatar alias={s.alias} size={36} />\n {unread && <span className=\"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#111128] bg-red-500\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"truncate text-base font-semibold text-white\">{s.alias}</span>\n {unread && <span className=\"shrink-0 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-red-300\">New</span>}\n <span className={`shrink-0 rounded-md border px-2 py-0.5 text-[10px] uppercase tracking-wide ${STATUS_COLORS[statusKey] || STATUS_COLORS.offline}`}>\n {statusKey}\n </span>\n </div>\n <div className=\"mt-0.5 truncate text-xs text-gray-500\">\n {(s.agent || '—')}<span className=\"text-gray-700 mx-1.5\">·</span><span title={s.server || ''}>{shortServer(s.server)}</span>\n </div>\n </div>\n <span className=\"hidden shrink-0 rounded-lg border border-cyan-500/15 bg-cyan-500/5 px-2 py-1 text-[10px] text-cyan-300/70 sm:inline\">Tap to chat</span>\n </div>\n\n <div className=\"mt-3 rounded-lg border border-[#1a1a2a] bg-[#0a0a15] px-3 py-2 text-xs\">\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-[10px] uppercase tracking-wide text-gray-600\">Current task</span>\n <span className=\"text-[10px] text-gray-600\">{timeAgo(s.last_seen_at || s.updated_at)}</span>\n </div>\n <div className={`mt-1 line-clamp-2 ${s.task ? 'text-gray-300' : 'text-gray-600 italic'}`}>\n {s.task || 'No current task'}\n </div>\n </div>\n\n {progress > 0 && progress < 100 && (\n <div className=\"mt-3 h-1.5 overflow-hidden rounded-full bg-gray-800\">\n <div className=\"h-1.5 rounded-full bg-cyan-400 transition-all\" style={{ width: `${progress}%` }} />\n </div>\n )}\n\n </div>\n );\n })}\n </div>\n ) : (\n <div className=\"space-y-1 sm:space-y-2\">\n {/* Round 94: AGENT + SERVER merged into one `agent · server`\n cell. Round mobile-command: node row itself opens chat, so\n the old Chat / Send Task action column is gone. */}\n <div className=\"hidden sm:grid sm:grid-cols-10 gap-2 px-4 py-2 text-xs text-gray-600 uppercase\">\n <div className=\"col-span-1\">Status</div>\n <div className=\"col-span-2\">Alias</div>\n <div className=\"col-span-2\">Agent · Server</div>\n <div className=\"col-span-4\">Current Task</div>\n <div className=\"col-span-1\">Updated</div>\n </div>\n {filtered.map(s => {\n const statusKey = s.online ? s.status : 'offline';\n const unread = hasUnread(s.alias);\n\n return (\n <div\n key={s.alias}\n role=\"button\"\n tabIndex={0}\n onClick={() => setChatAlias(s.alias)}\n onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setChatAlias(s.alias); } }}\n className={`rounded-lg border border-[#2a2a4a] bg-[#111128] px-3 py-2 sm:px-4 sm:py-3 transition-colors hover:border-cyan-500/40 cursor-pointer ${!s.online ? 'opacity-50' : ''}`}\n >\n <div className=\"hidden sm:grid sm:grid-cols-10 gap-2 items-center\">\n <div className=\"col-span-1\">\n <span className={`text-xs px-2 py-0.5 rounded-md border ${STATUS_COLORS[statusKey] || STATUS_COLORS.offline}`}>\n {statusKey}\n </span>\n </div>\n <div className=\"col-span-2 min-w-0\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <div className=\"relative shrink-0\">\n <AliasAvatar alias={s.alias} size={20} />\n {unread && <span className=\"absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full border border-[#111128] bg-red-500\" />}\n </div>\n <span className=\"truncate text-sm font-medium text-white\">{s.alias}</span>\n {unread && <span className=\"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300\">New</span>}\n </div>\n </div>\n <div className=\"col-span-2 truncate text-xs text-gray-400\" title={s.server || ''}>\n <span className=\"truncate\">{s.agent || '--'}<span className=\"text-gray-700 mx-1.5\">·</span>{shortServer(s.server)}</span>\n </div>\n <div className=\"col-span-4 truncate text-xs text-gray-500\" title={s.task || ''}>{s.task || '--'}</div>\n <div className=\"col-span-1 text-xs text-gray-500\">{timeAgo(s.last_seen_at || s.updated_at)}</div>\n </div>\n {/* R7 of #190: mobile node row was ~340px tall × ~150\n rows = the 51k page. Wins this round, in priority\n order: (1) drop the per-row \"Tap anywhere to chat\"\n hint — useful once, redundant 149 times; the cyan\n border on hover/focus still teaches it. (2) tighten\n space-y-2 → space-y-1 so the avatar/task gap is\n 4px tighter on every row. */}\n <div className=\"sm:hidden space-y-1\">\n <div className=\"flex items-center gap-2.5\">\n <div className=\"relative shrink-0\">\n <AliasAvatar alias={s.alias} size={28} />\n {unread && <span className=\"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#111128] bg-red-500\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <div className=\"truncate text-sm font-medium text-white\">{s.alias}</div>\n {unread && <span className=\"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300\">New</span>}\n </div>\n <div className=\"truncate text-[10px] text-gray-500\">{s.agent || '—'} · {timeAgo(s.last_seen_at || s.updated_at)}</div>\n </div>\n <span className={`shrink-0 text-xs px-2 py-0.5 rounded-md border ${STATUS_COLORS[statusKey] || STATUS_COLORS.offline}`}>\n {statusKey}\n </span>\n </div>\n {s.task && <div className=\"truncate text-xs text-gray-500\">{s.task}</div>}\n </div>\n </div>\n );\n })}\n </div>\n )}\n\n {chatAlias && <TaskChatPanel alias={chatAlias} onClose={() => setChatAlias(null)} />}\n </div>\n );\n}\n"],"names":["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","parseHubTime","dateStr","iso","includes","replace","t","Date","parse","Number","isFinite","relativeAgo","s","Math","floor","now","AVATAR_HUES","aliasAvatarColors","alias","h","i","length","charCodeAt","hue","bg","ring","text","aliasInitial","ch","trim","match","toUpperCase","isGrokAlias","test","AliasAvatar","size","className","style","width","height","backgroundImage","backgroundPosition","backgroundRepeat","backgroundSize","title","c","fs","max","round","fontSize","backgroundColor","borderColor","color","DEFAULTS","nodes","sub","tasks","messages","logs","tokens","networks","generic","Glyph","variant","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","role","href","label","onClick","EmptyCard","children","NodesEmptyState","hint","taskHistoryCount","global_count","toLocaleString","QuickstartCommand","cmd","target","rel","copied","setCopied","onCopy","navigator","clipboard","writeText","setTimeout","type","fetcher","url","res","fetch","status","window","location","assign","Error","json","SWR_OPTIONS","refreshInterval","dedupingInterval","withNetwork","networkId","sep","encodeURIComponent","useSessions","data","isLoading","sessions","_hint","useHealth","health","useAnetConfig","config","useTasks","params","query","URLSearchParams","limit","toString","count","source","useStats","stats","ok","useMessages","useNodeSession","session","inbox","sse","useCollapsibleSearch","value","onChange","placeholder","enabled","open","setOpen","reset","Button","active","v","toLowerCase","Row","e","onKeyDown","key","autoFocus","shortServer","server","slice","NodesPage","loading","hasUnread","sseMap","sse_sessions","sseFor","network_id","undefined","filterStatus","setFilterStatus","search","setSearch","viewMode","setViewMode","chatAlias","setChatAlias","searchCtl","filtered","map","online","filter","agent","sort","a","b","onlineCount","total","mode","statusKey","progress","unread","tabIndex","preventDefault","last_seen_at","updated_at","task","onClose"],"mappings":"+IAuDiE,CAC/Da,QAAS,qDACTC,KAAS,kDACTC,QAAS,wDACTC,MAAS,+CACTC,QAAS,iDACX,gCAIiE,CAC/DJ,QAAS,iBACTC,KAAS,gBACTC,QAAS,kBACTC,MAAS,eACTC,QAAS,eACX,uBAGwD,CACtDf,QAAW,cACXC,UAAW,cACXC,MAAW,cACXC,QAAW,eACXC,QAAW,gBACXC,OAAW,cACXC,OAAW,aACXC,UAAW,gBACXC,QAAW,eACb,wBA3DyD,CACvDR,QAAW,kDACXC,UAAW,kDACXC,MAAW,kDACXC,QAAW,qDACXC,QA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EAAI,EAAA,yBAAa,CAAC9M,OAAO,CAAA,CAAE,UACnH8M,OAGJhM,EAAEuM,IAAI,EAAI,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI/K,UAAU,0CAAkCxB,EAAEuM,IAAI,QArD/DvM,EAAEM,KAAK,CAyDlB,MAIH4K,GAAa,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,aAAa,CAAA,CAAC5K,MAAO4K,EAAWsB,QAAS,IAAMrB,EAAa,UAGjF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../agent-network-dashboard/app/lib/status.ts","../../../../../agent-network-dashboard/app/lib/time.ts","../../../../../agent-network-dashboard/app/components/utils.ts","../../../../../agent-network-dashboard/app/components/AliasAvatar.tsx","../../../../../agent-network-dashboard/app/components/EmptyState.tsx","../../../../../agent-network-dashboard/app/lib/hooks.ts","../../../../../agent-network-dashboard/app/components/CollapsibleSearch.tsx","../../../../../agent-network-dashboard/app/nodes/page.tsx"],"sourcesContent":["/** 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\nexport type TaskStatus = typeof TASK_STATUSES[number];\n\n/** Pill / chip background+text+border. Tailwind classes, not inlined hex,\n * because chips are static class names safe from purge. */\nexport const STATUS_CHIP_CLASS: Record<string, string> = {\n created: 'bg-gray-500/10 text-gray-400 border-gray-500/20',\n delivered: 'bg-blue-500/10 text-blue-300 border-blue-500/20',\n acked: 'bg-cyan-500/10 text-cyan-300 border-cyan-500/20',\n running: 'bg-green-500/10 text-green-300 border-green-500/20',\n replied: 'bg-purple-500/10 text-purple-300 border-purple-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-yellow-500/10 text-yellow-300 border-yellow-500/20',\n expired: 'bg-orange-500/10 text-orange-300 border-orange-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: '#60a5fa',\n acked: '#22d3ee',\n running: '#4ade80',\n replied: '#a78bfa',\n closed: '#6b7280',\n failed: '#f87171',\n cancelled: '#facc15',\n expired: '#fb923c',\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. */\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-blue-500/10 text-blue-300 border-blue-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-blue-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-blue-500',\n acked: 'bg-cyan-500',\n running: 'bg-green-500',\n replied: 'bg-purple-500',\n closed: 'bg-gray-600',\n failed: 'bg-red-500',\n cancelled: 'bg-yellow-500',\n expired: 'bg-orange-500',\n};\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","/** 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\nexport function formatUptime(seconds: number): string {\n const h = Math.floor(seconds / 3600);\n const m = Math.floor((seconds % 3600) / 60);\n if (h > 0) return `${h}h ${m}m`;\n return `${m}m`;\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 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 { 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-[#2a2a4a] bg-[#111128] 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 <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-[#0a0a15] border border-[#2a2a4a] 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-[#1a1a2a] 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","import useSWR from 'swr';\nimport { Session, Health, AnetConfig } from '../components/types';\nimport { useNetworkId } from './network-context';\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\nconst SWR_OPTIONS = { refreshInterval: 5000, dedupingInterval: 3000 };\n\n/** Append network_id to URL if set */\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 useSessions() {\n const { networkId } = useNetworkId();\n const { data, error, isLoading } = useSWR<{ sessions: Session[]; _hint?: { global_count?: number; filtered_network?: string } }>(\n withNetwork('/api/hub/status', networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return { sessions: data?.sessions || [], hint: data?._hint, error, isLoading };\n}\n\nexport function useHealth() {\n const { data, error } = useSWR<Health>('/api/hub/health', fetcher, SWR_OPTIONS);\n return { health: data || null, error };\n}\n\nexport function useAnetConfig() {\n const { data } = useSWR<AnetConfig>('/api/anet/config', fetcher, { refreshInterval: 30000 });\n return { config: data || null };\n}\n\nexport function useTasks(params?: Record<string, string>) {\n const { networkId } = useNetworkId();\n const query = new URLSearchParams({ limit: '100', ...params }).toString();\n const { data, error, isLoading } = useSWR(\n withNetwork(`/api/hub/tasks?${query}`, networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return {\n tasks: data?.tasks || [],\n count: data?.count ?? 0,\n source: data?.source,\n error,\n isLoading,\n };\n}\n\nexport function useStats() {\n const { networkId } = useNetworkId();\n const { data, error } = useSWR(withNetwork('/api/hub/stats', networkId), fetcher, SWR_OPTIONS);\n return { stats: data?.ok ? data : null, error };\n}\n\nexport function useMessages(limit = 100) {\n const { networkId } = useNetworkId();\n const { data, error, isLoading } = useSWR(\n withNetwork(`/api/hub/messages?limit=${limit}`, networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return { messages: data?.messages || [], error, isLoading };\n}\n\nexport function useNodeSession(alias: string) {\n const { data, error, isLoading } = useSWR(\n alias ? `/api/hub/session?alias=${encodeURIComponent(alias)}` : null,\n fetcher,\n SWR_OPTIONS,\n );\n return {\n session: data?.session || null,\n inbox: data?.inbox || [],\n sse: data?.sse || 0,\n error,\n isLoading,\n };\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 } 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({\n value,\n onChange,\n placeholder = 'Search…',\n label = 'Search',\n enabled = true,\n}: UseCollapsibleSearchProps): CollapsibleSearchAPI {\n const [open, setOpen] = useState(false);\n\n const reset = useCallback(() => {\n onChange('');\n setOpen(false);\n }, [onChange]);\n\n const Button = useCallback(() => {\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-[#2a2a4a] bg-[#111128] text-gray-400 hover:text-gray-200 hover:border-[#3a3a5a]'\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-[#0a0a1a]\" />\n )}\n </button>\n );\n }, [open, value, label, enabled]);\n\n const Row = useCallback(() => {\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-[#111128] border border-[#2a2a4a] 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 }, [open, value, onChange, placeholder, reset, enabled]);\n\n return { Button, Row, value, reset };\n}\n","'use client';\n\nimport { useState } from 'react';\nimport { timeAgo } from '../components/utils';\nimport { useSessions, useHealth } from '../lib/hooks';\nimport { TaskChatPanel } from '../components/TaskChatPanel';\nimport { EmptyState, NodesEmptyState } from '../components/EmptyState';\nimport { AliasAvatar } from '../components/AliasAvatar';\nimport { useCollapsibleSearch } from '../components/CollapsibleSearch';\nimport type { Session } from '../components/types';\nimport { SESSION_STATUS_CHIP_CLASS as STATUS_COLORS } from '../lib/status';\nimport { useChatUnread } from '../lib/chat-unread';\n\n/** Round 81: shorten long server hostnames (Alibaba `iZ…oyZ` style)\n * for table display. Returns the original string unchanged when ≤12\n * chars. Full value should stay in `title=` for hover + screen-readers. */\nfunction shortServer(server: string | null | undefined): string {\n if (!server) return '—';\n return server.length > 12 ? `${server.slice(0, 8)}…` : server;\n}\n\ntype ViewMode = 'list' | 'grid';\ntype SessionRow = Session & { online: boolean };\n\nexport default function NodesPage() {\n const { sessions, isLoading: loading } = useSessions();\n const { health } = useHealth();\n const { hasUnread } = useChatUnread();\n const sseMap = health?.sse_sessions || {};\n // SSE keys are `network_id:alias` since server v0.7+. Look up with the\n // composite key first, fall back to alias-only for legacy hubs.\n const sseFor = (s: { alias: string; network_id?: string }) =>\n (s.network_id ? sseMap[`${s.network_id}:${s.alias}`] : undefined) ?? sseMap[s.alias];\n const [filterStatus, setFilterStatus] = useState('');\n const [search, setSearch] = useState('');\n const [viewMode, setViewMode] = useState<ViewMode>('list');\n const [chatAlias, setChatAlias] = useState<string | null>(null);\n // #209 R32→R34: the WeChat-style magnifier-toggle search was hand-rolled\n // inline in R32. R34 extracted it to a shared hook so /nodes, /messages,\n // and any future search surface stay visually + behaviourally identical.\n // The hook returns a Button (place in header) + Row (place after header).\n const searchCtl = useCollapsibleSearch({\n value: search,\n onChange: setSearch,\n placeholder: 'Search nodes…',\n label: 'Search nodes',\n enabled: sessions.length > 0,\n });\n\n const filtered: SessionRow[] = sessions\n .map(s => ({ ...s, online: !!sseFor(s) }))\n .filter(s => {\n if (filterStatus === 'online') return s.online;\n if (filterStatus === 'offline') return !s.online;\n if (filterStatus && filterStatus !== s.status) return false;\n return true;\n })\n .filter(s => !search || s.alias.toLowerCase().includes(search.toLowerCase()) || (s.agent || '').toLowerCase().includes(search.toLowerCase()))\n .sort((a, b) => (b.online ? 1 : 0) - (a.online ? 1 : 0) || (b.status === 'working' ? 1 : 0) - (a.status === 'working' ? 1 : 0));\n\n const onlineCount = sessions.filter(s => sseFor(s)).length;\n\n return (\n <div className=\"min-h-screen max-w-full overflow-x-hidden bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono\">\n {/* #209 R31 (mobile vertical rhythm — goal \"大幅提升移动端体验\",\n extending R28's Overview pattern + R30's /tasks pattern):\n this header row + the status-bar wrapper + the filter row\n below all drop mb-6 → mb-4 sm:mb-6. Three spots × 8 px =\n ~24 px scroll reclaim on /nodes before the first card.\n #209 R32: search affordance moved to top-right magnifier\n button (Vincent WeChat ref msg 563). justify-between makes\n the title cluster hug left, button hugs right. */}\n <div className=\"flex items-center gap-4 mb-4 sm:mb-6\">\n <div className=\"flex items-center gap-3 min-w-0 flex-1\">\n <h1 className=\"text-2xl font-bold text-white lg:ml-0 ml-10\">Nodes</h1>\n <span className=\"text-xs bg-green-900/30 text-green-400 px-2 py-0.5 rounded-full border border-green-800/30 shrink-0\">\n {onlineCount} online\n </span>\n <span className=\"text-xs bg-gray-900/30 text-gray-400 px-2 py-0.5 rounded-full border border-gray-800/30 shrink-0\">\n {sessions.length} total\n </span>\n </div>\n <searchCtl.Button />\n </div>\n\n {/* #209 R34: shared <CollapsibleSearch> component handles row reveal,\n autofocus, Escape, and Cancel. enabled=sessions.length>0 hides\n everything until there's content to search. */}\n <searchCtl.Row />\n\n {/* Status bar */}\n {sessions.length > 0 && (() => {\n const working = filtered.filter(s => s.online && s.status === 'working').length;\n const idle = filtered.filter(s => s.online && s.status === 'idle').length;\n const offline = filtered.filter(s => !s.online).length;\n const total = filtered.length || 1;\n return (\n <div className=\"mb-4 sm:mb-6\">\n <div className=\"flex h-2 rounded-full overflow-hidden bg-gray-800\">\n {working > 0 && <div className=\"bg-green-500\" style={{ width: `${(working/total)*100}%` }} />}\n {idle > 0 && <div className=\"bg-cyan-500\" style={{ width: `${(idle/total)*100}%` }} />}\n {offline > 0 && <div className=\"bg-gray-600\" style={{ width: `${(offline/total)*100}%` }} />}\n </div>\n <div className=\"flex gap-4 mt-1.5 text-[10px] text-gray-500\">\n {working > 0 && <span><span className=\"inline-block w-2 h-2 rounded-full bg-green-500 mr-1\" />{working} working</span>}\n {idle > 0 && <span><span className=\"inline-block w-2 h-2 rounded-full bg-cyan-500 mr-1\" />{idle} idle</span>}\n {offline > 0 && <span><span className=\"inline-block w-2 h-2 rounded-full bg-gray-600 mr-1\" />{offline} offline</span>}\n </div>\n </div>\n );\n })()}\n\n {/* Round 74: hide the filter+view chrome when there are no nodes\n anywhere — these controls have nothing to act on, and they only\n push the onboarding CTA further down. When at least one session\n exists, the chrome is back even if the current filter happens\n to hide everything (so users can clear filters). */}\n {sessions.length > 0 && (\n <div className=\"flex flex-wrap gap-3 mb-4 sm:mb-6\">\n {/* R32: the inline search input was moved to the top-right\n magnifier toggle above. The status select + List/Grid\n toggle stay here. */}\n <select\n value={filterStatus}\n onChange={e => setFilterStatus(e.target.value)}\n className=\"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-base sm:text-sm text-white focus:border-blue-500/50 focus:outline-none\"\n >\n <option value=\"\">All</option>\n <option value=\"online\">Online</option>\n <option value=\"offline\">Offline</option>\n <option value=\"working\">Working</option>\n <option value=\"idle\">Idle</option>\n <option value=\"blocked\">Blocked</option>\n <option value=\"error\">Error</option>\n </select>\n {/* Round 80: List/Grid toggle hidden on mobile — Grid uses\n grid-cols-1 below `md` and List degrades to the same single\n column, so the toggle has no visual effect under sm and only\n steals a row of vertical space. */}\n <div className=\"hidden sm:flex ml-auto rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 text-sm\">\n {(['list', 'grid'] as const).map(mode => (\n <button\n key={mode}\n type=\"button\"\n onClick={() => setViewMode(mode)}\n className={`rounded-md px-3 py-1.5 transition-colors ${\n viewMode === mode\n ? 'bg-cyan-500/10 text-cyan-300'\n : 'text-gray-500 hover:text-gray-200'\n }`}\n >\n {mode === 'list' ? 'List' : 'Grid'}\n </button>\n ))}\n </div>\n </div>\n )}\n\n {loading ? (\n <div className=\"animate-pulse space-y-2\">\n {[1,2,3,4].map(i => <div key={i} className=\"h-16 bg-gray-800/20 rounded-lg\" />)}\n </div>\n ) : filtered.length === 0 ? (\n sessions.length === 0 ? (\n /* Round 73: first-run case — no agents anywhere. Use the same\n onboarding empty state as the Overview (NodesEmptyState\n includes the `npx … init` quickstart command). Previously this\n was the \"No nodes match your filters\" copy, which was wrong\n for new users who have no filters applied. */\n <NodesEmptyState />\n ) : (\n <EmptyState\n variant=\"nodes\"\n title=\"No nodes match your filters\"\n sub=\"Try clearing search or status filters, or wait for an agent to register.\"\n />\n )\n ) : viewMode === 'grid' ? (\n <div className=\"grid min-w-0 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4\">\n {filtered.map(s => {\n const statusKey = s.online ? s.status : 'offline';\n const progress = typeof s.progress === 'number' ? s.progress : 0;\n const unread = hasUnread(s.alias);\n\n return (\n <div\n key={s.alias}\n role=\"button\"\n tabIndex={0}\n onClick={() => setChatAlias(s.alias)}\n onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setChatAlias(s.alias); } }}\n className={`relative min-w-0 max-w-full overflow-hidden rounded-xl border border-[#2a2a4a] bg-[#111128] p-4 transition-colors hover:border-cyan-500/40 cursor-pointer ${!s.online ? 'opacity-60' : ''}`}\n >\n {!s.online && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <span className=\"rotate-[-20deg] rounded-xl border border-white/10 bg-black/20 px-5 py-2 text-xl font-bold uppercase tracking-[0.35em] text-white/10\">\n Offline\n </span>\n </div>\n )}\n <div className=\"flex items-start gap-3\">\n <div className=\"relative shrink-0\">\n <AliasAvatar alias={s.alias} size={36} />\n {unread && <span className=\"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#111128] bg-red-500\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"truncate text-base font-semibold text-white\">{s.alias}</span>\n {unread && <span className=\"shrink-0 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-red-300\">New</span>}\n <span className={`shrink-0 rounded-md border px-2 py-0.5 text-[10px] uppercase tracking-wide ${STATUS_COLORS[statusKey] || STATUS_COLORS.offline}`}>\n {statusKey}\n </span>\n </div>\n <div className=\"mt-0.5 truncate text-xs text-gray-500\">\n {(s.agent || '—')}<span className=\"text-gray-700 mx-1.5\">·</span><span title={s.server || ''}>{shortServer(s.server)}</span>\n </div>\n </div>\n <span className=\"hidden shrink-0 rounded-lg border border-cyan-500/15 bg-cyan-500/5 px-2 py-1 text-[10px] text-cyan-300/70 sm:inline\">Tap to chat</span>\n </div>\n\n <div className=\"mt-3 rounded-lg border border-[#1a1a2a] bg-[#0a0a15] px-3 py-2 text-xs\">\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-[10px] uppercase tracking-wide text-gray-600\">Current task</span>\n <span className=\"text-[10px] text-gray-600\">{timeAgo(s.last_seen_at || s.updated_at)}</span>\n </div>\n <div className={`mt-1 line-clamp-2 ${s.task ? 'text-gray-300' : 'text-gray-600 italic'}`}>\n {s.task || 'No current task'}\n </div>\n </div>\n\n {progress > 0 && progress < 100 && (\n <div className=\"mt-3 h-1.5 overflow-hidden rounded-full bg-gray-800\">\n <div className=\"h-1.5 rounded-full bg-cyan-400 transition-all\" style={{ width: `${progress}%` }} />\n </div>\n )}\n\n </div>\n );\n })}\n </div>\n ) : (\n <div className=\"space-y-1 sm:space-y-2\">\n {/* Round 94: AGENT + SERVER merged into one `agent · server`\n cell. Round mobile-command: node row itself opens chat, so\n the old Chat / Send Task action column is gone. */}\n <div className=\"hidden sm:grid sm:grid-cols-10 gap-2 px-4 py-2 text-xs text-gray-600 uppercase\">\n <div className=\"col-span-1\">Status</div>\n <div className=\"col-span-2\">Alias</div>\n <div className=\"col-span-2\">Agent · Server</div>\n <div className=\"col-span-4\">Current Task</div>\n <div className=\"col-span-1\">Updated</div>\n </div>\n {filtered.map(s => {\n const statusKey = s.online ? s.status : 'offline';\n const unread = hasUnread(s.alias);\n\n return (\n <div\n key={s.alias}\n role=\"button\"\n tabIndex={0}\n onClick={() => setChatAlias(s.alias)}\n onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setChatAlias(s.alias); } }}\n className={`rounded-lg border border-[#2a2a4a] bg-[#111128] px-3 py-2 sm:px-4 sm:py-3 transition-colors hover:border-cyan-500/40 cursor-pointer ${!s.online ? 'opacity-50' : ''}`}\n >\n <div className=\"hidden sm:grid sm:grid-cols-10 gap-2 items-center\">\n <div className=\"col-span-1\">\n <span className={`text-xs px-2 py-0.5 rounded-md border ${STATUS_COLORS[statusKey] || STATUS_COLORS.offline}`}>\n {statusKey}\n </span>\n </div>\n <div className=\"col-span-2 min-w-0\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <div className=\"relative shrink-0\">\n <AliasAvatar alias={s.alias} size={20} />\n {unread && <span className=\"absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full border border-[#111128] bg-red-500\" />}\n </div>\n <span className=\"truncate text-sm font-medium text-white\">{s.alias}</span>\n {unread && <span className=\"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300\">New</span>}\n </div>\n </div>\n <div className=\"col-span-2 truncate text-xs text-gray-400\" title={s.server || ''}>\n <span className=\"truncate\">{s.agent || '--'}<span className=\"text-gray-700 mx-1.5\">·</span>{shortServer(s.server)}</span>\n </div>\n <div className=\"col-span-4 truncate text-xs text-gray-500\" title={s.task || ''}>{s.task || '--'}</div>\n <div className=\"col-span-1 text-xs text-gray-500\">{timeAgo(s.last_seen_at || s.updated_at)}</div>\n </div>\n {/* R7 of #190: mobile node row was ~340px tall × ~150\n rows = the 51k page. Wins this round, in priority\n order: (1) drop the per-row \"Tap anywhere to chat\"\n hint — useful once, redundant 149 times; the cyan\n border on hover/focus still teaches it. (2) tighten\n space-y-2 → space-y-1 so the avatar/task gap is\n 4px tighter on every row. */}\n <div className=\"sm:hidden space-y-1\">\n <div className=\"flex items-center gap-2.5\">\n <div className=\"relative shrink-0\">\n <AliasAvatar alias={s.alias} size={28} />\n {unread && <span className=\"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#111128] bg-red-500\" />}\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <div className=\"truncate text-sm font-medium text-white\">{s.alias}</div>\n {unread && <span className=\"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300\">New</span>}\n </div>\n <div className=\"truncate text-[10px] text-gray-500\">{s.agent || '—'} · {timeAgo(s.last_seen_at || s.updated_at)}</div>\n </div>\n <span className={`shrink-0 text-xs px-2 py-0.5 rounded-md border ${STATUS_COLORS[statusKey] || STATUS_COLORS.offline}`}>\n {statusKey}\n </span>\n </div>\n {s.task && <div className=\"truncate text-xs text-gray-500\">{s.task}</div>}\n </div>\n </div>\n );\n })}\n </div>\n )}\n\n {chatAlias && <TaskChatPanel alias={chatAlias} onClose={() => setChatAlias(null)} />}\n </div>\n );\n}\n"],"names":["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","parseHubTime","dateStr","iso","includes","replace","t","Date","parse","Number","isFinite","relativeAgo","s","Math","floor","now","AVATAR_HUES","aliasAvatarColors","alias","h","i","length","charCodeAt","hue","bg","ring","text","aliasInitial","ch","trim","match","toUpperCase","isGrokAlias","test","AliasAvatar","size","className","style","width","height","backgroundImage","backgroundPosition","backgroundRepeat","backgroundSize","title","c","fs","max","round","fontSize","backgroundColor","borderColor","color","DEFAULTS","nodes","sub","tasks","messages","logs","tokens","networks","generic","Glyph","variant","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","role","href","label","onClick","EmptyCard","children","NodesEmptyState","hint","taskHistoryCount","global_count","toLocaleString","QuickstartCommand","cmd","target","rel","copied","setCopied","onCopy","navigator","clipboard","writeText","setTimeout","type","fetcher","url","res","fetch","status","window","location","assign","Error","json","SWR_OPTIONS","refreshInterval","dedupingInterval","withNetwork","networkId","sep","encodeURIComponent","useSessions","data","isLoading","sessions","_hint","useHealth","health","useAnetConfig","config","useTasks","params","query","URLSearchParams","limit","toString","count","source","useStats","stats","ok","useMessages","useNodeSession","session","inbox","sse","useCollapsibleSearch","value","onChange","placeholder","enabled","open","setOpen","reset","Button","active","v","toLowerCase","Row","e","onKeyDown","key","autoFocus","shortServer","server","slice","NodesPage","loading","hasUnread","sseMap","sse_sessions","sseFor","network_id","undefined","filterStatus","setFilterStatus","search","setSearch","viewMode","setViewMode","chatAlias","setChatAlias","searchCtl","filtered","map","online","filter","agent","sort","a","b","onlineCount","total","mode","statusKey","progress","unread","tabIndex","preventDefault","last_seen_at","updated_at","task","onClose"],"mappings":"+IAuDiE,CAC/Da,QAAS,qDACTC,KAAS,kDACTC,QAAS,wDACTC,MAAS,+CACTC,QAAS,iDACX,gCAIiE,CAC/DJ,QAAS,iBACTC,KAAS,gBACTC,QAAS,kBACTC,MAAS,eACTC,QAAS,eACX,uBAGwD,CACtDf,QAAW,cACXC,UAAW,cACXC,MAAW,cACXC,QAAW,eACXC,QAAW,gBACXC,OAAW,cACXC,OAAW,aACXC,UAAW,gBACXC,QAAW,eACb,wBA3DyD,CACvDR,QAAW,kDACXC,UAAW,kDACXC,MAAW,kDACXC,QAAW,qDACXC,QAAW,wDACXC,OAAW,kDACXC,OAAW,+CACXC,UAAW,wDACXC,QAAW,uDACb,qBAIsD,CACpDR,QAAW,UACXC,UAAW,UACXC,MAAW,UACXC,QAAW,UACXC,QAAW,UACXC,OAAW,UACXC,OAAW,UACXC,UAAW,UACXC,QAAW,SACb,oBAxC6B,CAC3B,UACA,YACA,QACA,UACA,UACA,SACA,SACA,YACA,UACD,iCCHM,SAASU,EAAaC,CAAkC,EAC7D,GAAI,CAACA,EAAS,OAAO,KAErB,IAAMI,EAAIC,KAAKC,KAAK,CAACL,AADTD,EAAQE,QAAQ,CAAC,KAAOF,EAAUA,EAAQG,OAAO,CAAC,IAAK,KAAO,KAE1E,OAAOI,OAAOC,QAAQ,CAACJ,GAAKA,EAAI,IAClC,CAKO,SAASK,EAAYT,CAAkC,EAC5D,IAAMI,EAAIL,EAAaC,GACvB,GAAU,OA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AAA,EAAA,GAAA,EAAC,EAAA,WAAW,CAAA,CAAClB,MAAON,EAAEM,KAAK,CAAEiB,KAAM,KAClC2K,GAAU,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK1K,UAAU,0FAE7B,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAIA,UAAU,2BACb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAIA,UAAU,4CACb,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAIA,UAAU,mDAA2CxB,EAAEM,KAAK,GAChE4L,GAAU,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK1K,UAAU,2HAAkH,WAE/I,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAIA,UAAU,+CAAsCxB,EAAEyL,KAAK,EAAI,IAAI,MAAI,CAAA,EAAA,EAAA,OAAA,AAAO,EAACzL,EAAEqM,YAAY,EAAIrM,EAAEsM,UAAU,QAEhH,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK9K,UAAW,CAAC,+CAA+C,EAAE,EAAA,yBAAa,CAACwK,EAAU,EAAI,EAAA,yBAAa,CAAC9M,OAAO,CAAA,CAAE,UACnH8M,OAGJhM,EAAEuM,IAAI,EAAI,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI/K,UAAU,0CAAkCxB,EAAEuM,IAAI,QArD/DvM,EAAEM,KAAK,CAyDlB,MAIH4K,GAAa,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,aAAa,CAAA,CAAC5K,MAAO4K,EAAWsB,QAAS,IAAMrB,EAAa,UAGjF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[9943,a=>{"use strict";var b=a.i(57389),c=a.i(59202);let d=async a=>{let b=await fetch(a);if(401===b.status)throw window.location.assign("/login"),Error("unauthorized");return b.json()},e={refreshInterval:5e3,dedupingInterval:3e3};function f(a,b){if(!b)return a;let c=a.includes("?")?"&":"?";return`${a}${c}network_id=${encodeURIComponent(b)}`}a.s(["useAnetConfig",0,function(){let{data:a}=(0,b.default)("/api/anet/config",d,{refreshInterval:3e4});return{config:a||null}},"useHealth",0,function(){let{data:a,error:c}=(0,b.default)("/api/hub/health",d,e);return{health:a||null,error:c}},"useMessages",0,function(a=100){let{networkId:g}=(0,c.useNetworkId)(),{data:h,error:i,isLoading:j}=(0,b.default)(f(`/api/hub/messages?limit=${a}`,g),d,e);return{messages:h?.messages||[],error:i,isLoading:j}},"useSessions",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h,isLoading:i}=(0,b.default)(f("/api/hub/status",a),d,e);return{sessions:g?.sessions||[],hint:g?._hint,error:h,isLoading:i}},"useStats",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h}=(0,b.default)(f("/api/hub/stats",a),d,e);return{stats:g?.ok?g:null,error:h}},"useTasks",0,function(a){let{networkId:g}=(0,c.useNetworkId)(),h=new URLSearchParams({limit:"100",...a}).toString(),{data:i,error:j,isLoading:k}=(0,b.default)(f(`/api/hub/tasks?${h}`,g),d,e);return{tasks:i?.tasks||[],count:i?.count??0,source:i?.source,error:j,isLoading:k}}])},88531,a=>{"use strict";a.s(["DASHBOARD_VERSION",0,"0.5.7-preview.47"],88531)},26176,a=>{"use strict";var b=a.i(64247),c=a.i(54413),d=a.i(88534),e=a.i(9943),f=a.i(88531);a.s(["default",0,function(){let{config:a}=(0,e.useAnetConfig)(),{health:g}=(0,e.useHealth)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),n="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",o="break-all sm:max-w-[320px] sm:text-right";return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold text-white mb-3 lg:ml-0 ml-10",children:"Settings"}),(0,b.jsx)("nav",{className:"mb-4 sm:mb-8 flex flex-wrap gap-2 text-xs",children:[{href:"#connection",label:"Connection"},{href:"#account",label:"Account"},{href:"#resources",label:"Resources"}].map(a=>(0,b.jsx)("a",{href:a.href,className:"inline-flex min-h-[44px] items-center rounded-md border border-[#2a2a4a] bg-[#0a0a15]/60 px-3 py-2 text-gray-400 hover:border-cyan-500/50 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors",children:a.label},a.href))}),(0,b.jsxs)("div",{className:"max-w-2xl space-y-10",children:[(0,b.jsxs)("div",{id:"connection",className:"space-y-4 scroll-mt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,b.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Connection"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"CommHub Connection"}),(0,b.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,b.jsx)("span",{className:`text-cyan-300 ${o}`,children:a?.hub||"not configured"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:a?.source==="file"?"Local file (~/.anet/config.json)":a?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Auth Token"}),(0,b.jsx)("span",{className:`${a?.tokenConfigured?"text-green-400":"text-red-400"} ${o}`,children:a?.tokenConfigured?`Configured (${a.tokenPreview})`:"Not configured"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,b.jsx)("span",{className:`${g?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:g?.auth||"--"})]}),a?.error&&(0,b.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:a.error})]})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,b.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.version||"--"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.sessions??"--"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsxs)("span",{className:"text-gray-500",children:["SSE streams ",(0,b.jsx)("span",{className:"text-gray-600",children:"· server"})]}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.sse_connections??"--"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.uptime?`${Math.floor(g.uptime/3600)}h ${Math.floor(g.uptime%3600/60)}m`:"--"})]})]})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,b.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 font-mono ${o}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:f.DASHBOARD_VERSION})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:"Overview, Tasks, Nodes, Messages, Networks, Audit, Server Logs, Admin, Settings"})]})]})]})]}),(0,b.jsxs)("div",{id:"account",className:"space-y-4 scroll-mt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,b.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Account"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("input",{type:"password",value:h,onChange:a=>i(a.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,b.jsx)("input",{type:"password",value:j,onChange:a=>k(a.target.value),placeholder:"New password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,b.jsx)("button",{onClick:async()=>{if(!h||!j)return;let a=sessionStorage.getItem("anet_v3_auth");if(!a)return void m("Not logged in with V3 auth");let{token:b}=JSON.parse(a),c=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:b,current_password:h,new_password:j})}),d=await c.json();if(m(d.ok?"Password changed":`Failed: ${d.error}`),d.ok){if(d.token){let b=JSON.parse(a);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...b,token:d.token}))}i(""),k("")}setTimeout(()=>m(""),5e3)},disabled:!h||!j,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),l&&(0,b.jsx)("div",{className:`mt-2 text-xs ${l.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:l})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Sign out"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Signing out clears your dashboard session cookie. You'll return to the login page."}),(0,b.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login")},className:"px-4 py-2 bg-transparent hover:bg-[#1a1a2a] text-gray-300 text-sm rounded-lg border border-[#2a2a4a] hover:border-[#3a3a5a] transition-colors",children:"Sign out"})]})]}),(0,b.jsxs)("div",{id:"resources",className:"space-y-4 scroll-mt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,b.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Resources"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)(d.default,{href:"/settings/tokens",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"API Tokens"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create and manage tokens for CLI access."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,b.jsxs)(d.default,{href:"/settings/networks",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Networks"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create, manage, and delete agent networks."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,b.jsxs)(d.default,{href:"/messages",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Messages"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Global timeline of CommHub messages across all agents."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Open →"})]}),(0,b.jsxs)(d.default,{href:"/logs",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Audit Log"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Authentication, token rotations, and admin actions."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Open →"})]}),(0,b.jsxs)(d.default,{href:"/server-logs",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Server Logs"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Live stdout / stderr from the CommHub server."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Open →"})]})]})]})]})]})}])}];
|
|
1
|
+
module.exports=[9943,a=>{"use strict";var b=a.i(57389),c=a.i(59202);let d=async a=>{let b=await fetch(a);if(401===b.status)throw window.location.assign("/login"),Error("unauthorized");return b.json()},e={refreshInterval:5e3,dedupingInterval:3e3};function f(a,b){if(!b)return a;let c=a.includes("?")?"&":"?";return`${a}${c}network_id=${encodeURIComponent(b)}`}a.s(["useAnetConfig",0,function(){let{data:a}=(0,b.default)("/api/anet/config",d,{refreshInterval:3e4});return{config:a||null}},"useHealth",0,function(){let{data:a,error:c}=(0,b.default)("/api/hub/health",d,e);return{health:a||null,error:c}},"useMessages",0,function(a=100){let{networkId:g}=(0,c.useNetworkId)(),{data:h,error:i,isLoading:j}=(0,b.default)(f(`/api/hub/messages?limit=${a}`,g),d,e);return{messages:h?.messages||[],error:i,isLoading:j}},"useSessions",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h,isLoading:i}=(0,b.default)(f("/api/hub/status",a),d,e);return{sessions:g?.sessions||[],hint:g?._hint,error:h,isLoading:i}},"useStats",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h}=(0,b.default)(f("/api/hub/stats",a),d,e);return{stats:g?.ok?g:null,error:h}},"useTasks",0,function(a){let{networkId:g}=(0,c.useNetworkId)(),h=new URLSearchParams({limit:"100",...a}).toString(),{data:i,error:j,isLoading:k}=(0,b.default)(f(`/api/hub/tasks?${h}`,g),d,e);return{tasks:i?.tasks||[],count:i?.count??0,source:i?.source,error:j,isLoading:k}}])},88531,a=>{"use strict";a.s(["DASHBOARD_VERSION",0,"0.5.7-preview.48"],88531)},26176,a=>{"use strict";var b=a.i(64247),c=a.i(54413),d=a.i(88534),e=a.i(9943),f=a.i(88531);a.s(["default",0,function(){let{config:a}=(0,e.useAnetConfig)(),{health:g}=(0,e.useHealth)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),n="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",o="break-all sm:max-w-[320px] sm:text-right";return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold text-white mb-3 lg:ml-0 ml-10",children:"Settings"}),(0,b.jsx)("nav",{className:"mb-4 sm:mb-8 flex flex-wrap gap-2 text-xs",children:[{href:"#connection",label:"Connection"},{href:"#account",label:"Account"},{href:"#resources",label:"Resources"}].map(a=>(0,b.jsx)("a",{href:a.href,className:"inline-flex min-h-[44px] items-center rounded-md border border-[#2a2a4a] bg-[#0a0a15]/60 px-3 py-2 text-gray-400 hover:border-cyan-500/50 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors",children:a.label},a.href))}),(0,b.jsxs)("div",{className:"max-w-2xl space-y-10",children:[(0,b.jsxs)("div",{id:"connection",className:"space-y-4 scroll-mt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,b.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Connection"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"CommHub Connection"}),(0,b.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,b.jsx)("span",{className:`text-cyan-300 ${o}`,children:a?.hub||"not configured"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:a?.source==="file"?"Local file (~/.anet/config.json)":a?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Auth Token"}),(0,b.jsx)("span",{className:`${a?.tokenConfigured?"text-green-400":"text-red-400"} ${o}`,children:a?.tokenConfigured?`Configured (${a.tokenPreview})`:"Not configured"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,b.jsx)("span",{className:`${g?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:g?.auth||"--"})]}),a?.error&&(0,b.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:a.error})]})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,b.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.version||"--"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.sessions??"--"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsxs)("span",{className:"text-gray-500",children:["SSE streams ",(0,b.jsx)("span",{className:"text-gray-600",children:"· server"})]}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.sse_connections??"--"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:g?.uptime?`${Math.floor(g.uptime/3600)}h ${Math.floor(g.uptime%3600/60)}m`:"--"})]})]})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,b.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 font-mono ${o}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:f.DASHBOARD_VERSION})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,b.jsxs)("div",{className:n,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,b.jsx)("span",{className:`text-gray-300 ${o}`,children:"Overview, Tasks, Nodes, Messages, Networks, Audit, Server Logs, Admin, Settings"})]})]})]})]}),(0,b.jsxs)("div",{id:"account",className:"space-y-4 scroll-mt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,b.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Account"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("input",{type:"password",value:h,onChange:a=>i(a.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,b.jsx)("input",{type:"password",value:j,onChange:a=>k(a.target.value),placeholder:"New password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,b.jsx)("button",{onClick:async()=>{if(!h||!j)return;let a=sessionStorage.getItem("anet_v3_auth");if(!a)return void m("Not logged in with V3 auth");let{token:b}=JSON.parse(a),c=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:b,current_password:h,new_password:j})}),d=await c.json();if(m(d.ok?"Password changed":`Failed: ${d.error}`),d.ok){if(d.token){let b=JSON.parse(a);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...b,token:d.token}))}i(""),k("")}setTimeout(()=>m(""),5e3)},disabled:!h||!j,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),l&&(0,b.jsx)("div",{className:`mt-2 text-xs ${l.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:l})]}),(0,b.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Sign out"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Signing out clears your dashboard session cookie. You'll return to the login page."}),(0,b.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login")},className:"px-4 py-2 bg-transparent hover:bg-[#1a1a2a] text-gray-300 text-sm rounded-lg border border-[#2a2a4a] hover:border-[#3a3a5a] transition-colors",children:"Sign out"})]})]}),(0,b.jsxs)("div",{id:"resources",className:"space-y-4 scroll-mt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,b.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Resources"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)(d.default,{href:"/settings/tokens",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"API Tokens"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create and manage tokens for CLI access."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,b.jsxs)(d.default,{href:"/settings/networks",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Networks"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create, manage, and delete agent networks."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,b.jsxs)(d.default,{href:"/messages",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Messages"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Global timeline of CommHub messages across all agents."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Open →"})]}),(0,b.jsxs)(d.default,{href:"/logs",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Audit Log"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Authentication, token rotations, and admin actions."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Open →"})]}),(0,b.jsxs)(d.default,{href:"/server-logs",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Server Logs"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Live stdout / stderr from the CommHub server."}),(0,b.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Open →"})]})]})]})]})]})}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=agent-network-dashboard_app_01jhlxz._.js.map
|