@sleep2agi/agent-network-dashboard 0.6.3-preview.38 → 0.6.3-preview.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_COMMIT +1 -1
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +3 -3
- 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.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- 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 +1 -1
- package/.next/server/app/admin.html +1 -1
- package/.next/server/app/admin.rsc +1 -1
- package/.next/server/app/admin.segments/_full.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_index.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +2 -2
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- 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.html +1 -1
- package/.next/server/app/logs.rsc +1 -1
- package/.next/server/app/logs.segments/_full.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
- package/.next/server/app/messages.html +1 -1
- package/.next/server/app/messages.rsc +1 -1
- package/.next/server/app/messages.segments/_full.segment.rsc +1 -1
- package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
- package/.next/server/app/messages.segments/_index.segment.rsc +1 -1
- package/.next/server/app/messages.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
- package/.next/server/app/node.html +1 -1
- package/.next/server/app/node.rsc +1 -1
- package/.next/server/app/node.segments/_full.segment.rsc +1 -1
- package/.next/server/app/node.segments/_head.segment.rsc +1 -1
- package/.next/server/app/node.segments/_index.segment.rsc +1 -1
- package/.next/server/app/node.segments/_tree.segment.rsc +1 -1
- 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.html +1 -1
- package/.next/server/app/nodes.rsc +1 -1
- package/.next/server/app/nodes.segments/_full.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_index.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +1 -1
- 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/providers.html +1 -1
- package/.next/server/app/providers.rsc +1 -1
- package/.next/server/app/providers.segments/_full.segment.rsc +1 -1
- package/.next/server/app/providers.segments/_head.segment.rsc +1 -1
- package/.next/server/app/providers.segments/_index.segment.rsc +1 -1
- package/.next/server/app/providers.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/providers.segments/providers.segment.rsc +1 -1
- package/.next/server/app/server-logs.html +1 -1
- package/.next/server/app/server-logs.rsc +1 -1
- package/.next/server/app/server-logs.segments/_full.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +1 -1
- 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.html +1 -1
- package/.next/server/app/servers.rsc +1 -1
- package/.next/server/app/servers.segments/_full.segment.rsc +1 -1
- package/.next/server/app/servers.segments/_head.segment.rsc +1 -1
- package/.next/server/app/servers.segments/_index.segment.rsc +1 -1
- package/.next/server/app/servers.segments/_tree.segment.rsc +1 -1
- 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.html +1 -1
- package/.next/server/app/settings/networks.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
- 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.html +1 -1
- package/.next/server/app/settings/tokens.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
- 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 +2 -2
- package/.next/server/app/settings.segments/_full.segment.rsc +2 -2
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- 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.html +1 -1
- package/.next/server/app/tasks.rsc +1 -1
- package/.next/server/app/tasks.segments/_full.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/_index.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nhjt1j._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nhjt1j._.js.map +1 -1
- package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0mek_e~._.js +1 -1
- package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0mek_e~._.js.map +1 -1
- package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0~ejwde._.js +1 -1
- package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0~ejwde._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__04fj5h4._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__04fj5h4._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/{07v6jb88z-i_e.js → 0.o~6-f11_j6i.js} +1 -1
- package/.next/static/chunks/{0fd~3xz~5b60s.js → 01cd3uiuzejbt.js} +1 -1
- package/.next/static/chunks/{0.9a87jy~7oy7.js → 0p~997s2myymh.js} +1 -1
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/app/api/hub/files/[fileId]/route.ts +29 -7
- package/package.json +1 -1
- /package/.next/static/{Z3OXIK1qxOxTQv7WJWgfC → FHSqMAj0yD_AXCKEYrGTW}/_buildManifest.js +0 -0
- /package/.next/static/{Z3OXIK1qxOxTQv7WJWgfC → FHSqMAj0yD_AXCKEYrGTW}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{Z3OXIK1qxOxTQv7WJWgfC → FHSqMAj0yD_AXCKEYrGTW}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/%5BfileId%5D/route.ts","../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { requireDashboardAuth, getV3UserToken } from '@/app/lib/dashboard-auth';\n\nconst HUB_URL = process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n\n/**\n * File ID shape: mirrors server/src/uploads.ts FILE_ID_REGEX exactly.\n * Token-exact check before any URL composition — refuse\n * `../../etc/passwd` before it can reach the hub.\n */\nconst FILE_ID_REGEX = /^[A-Za-z0-9_-]{8,64}$/;\n\n/**\n * Header allowlist for the pass-through. We deliberately do NOT forward\n * everything from the hub response — the browser must NOT see anything\n * that could leak the internal request path or the Bearer token.\n * Only the four headers the browser genuinely needs for a safe download.\n */\nconst HEADER_PASSTHROUGH = [\n 'content-type',\n 'content-length',\n 'content-disposition',\n 'x-content-type-options',\n] as const;\n\n// ── #492 preview half: safe-inline-type detection ──────────────\n//\n// 🔴 STRUCTURAL SAFETY (通信龙 #46 review of the inline design):\n// This proxy NEVER returns an inline response, regardless of the\n// file's real type. `Content-Disposition: attachment` + `nosniff`\n// stay stamped on every download, so no dashboard-origin URL can\n// ever serve user-uploaded content as a rendered page — that entire\n// XSS class is structurally impossible, not defended-by-whitelist.\n//\n// What we DO expose: a `X-Verified-Type` header carrying the true MIME\n// as detected by magic bytes. The client uses this header to decide:\n// 1. Fetch the bytes (browser downloads — no navigation)\n// 2. `new Blob([bytes], {type: xVerifiedType})`\n// 3. `URL.createObjectURL(blob)` → `<img>` / `<video>` src\n//\n// The blob URL is same-origin *to the browser's blob: scheme*, isolated\n// from the dashboard origin — a bug in whitelist can degrade UX (image\n// won't render) but can never become a cross-origin script vector.\n//\n// Detection rule: EXACT MIME match by per-format magic bytes at each\n// format's actual offset. No prefix matching (`image/*` would let SVG\n// in). No trust of upload-time mime/filename (both untrusted).\ntype SafeMime =\n | 'image/png'\n | 'image/jpeg'\n | 'image/gif'\n | 'image/webp'\n | 'video/mp4'\n | 'video/webm';\n\n/**\n * Peek magic bytes and return the safe MIME if the file matches one\n * of our whitelisted formats.\n *\n * Per-format offset rules (not naive first-N compare — 通信龙 review):\n * - PNG: offset 0, `89 50 4E 47 0D 0A 1A 0A`\n * - JPEG: offset 0, `FF D8 FF`\n * - GIF: offset 0, `47 49 46 38 (37|39) 61` (\"GIF87a\" / \"GIF89a\")\n * - WebP: offset 0 `52 49 46 46` (\"RIFF\") + offset 8 `57 45 42 50` (\"WEBP\")\n * - MP4: offset 4 `66 74 79 70` (\"ftyp\") — MP4/M4V/QT ISO BMFF box\n * - WebM: offset 0 `1A 45 DF A3` (EBML)\n *\n * Returns null for anything else (SVG, HTML, empty, corrupted, unknown).\n */\nfunction detectSafeMime(head: Uint8Array): SafeMime | null {\n const b = head;\n if (b.length < 4) return null;\n\n // PNG\n if (\n b.length >= 8 &&\n b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4E && b[3] === 0x47 &&\n b[4] === 0x0D && b[5] === 0x0A && b[6] === 0x1A && b[7] === 0x0A\n ) return 'image/png';\n\n // JPEG (FF D8 FF — final byte is FF E0 / FF E1 / FF DB variants; the FF prefix\n // is enough to distinguish. Reject if not exactly the three-byte JPEG marker.)\n if (b[0] === 0xFF && b[1] === 0xD8 && b[2] === 0xFF) return 'image/jpeg';\n\n // GIF — \"GIF87a\" or \"GIF89a\"\n if (\n b.length >= 6 &&\n b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x38 &&\n (b[4] === 0x37 || b[4] === 0x39) && b[5] === 0x61\n ) return 'image/gif';\n\n // WebP — \"RIFF????WEBP\"\n if (\n b.length >= 12 &&\n b[0] === 0x52 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x46 &&\n b[8] === 0x57 && b[9] === 0x45 && b[10] === 0x42 && b[11] === 0x50\n ) return 'image/webp';\n\n // WebM (EBML header) — 1A 45 DF A3\n if (b[0] === 0x1A && b[1] === 0x45 && b[2] === 0xDF && b[3] === 0xA3) {\n return 'video/webm';\n }\n\n // MP4 (ISO BMFF `ftyp` box at offset 4) — the first 4 bytes are a\n // big-endian box size we don't need to validate; the \"ftyp\" marker\n // is what we key on.\n if (\n b.length >= 8 &&\n b[4] === 0x66 && b[5] === 0x74 && b[6] === 0x79 && b[7] === 0x70\n ) return 'video/mp4';\n\n return null;\n}\n\n/**\n * #492 — file download proxy: browser fetches `/api/hub/files/<file_id>`,\n * this proxy attaches the browser session's V3 user token as\n * `Authorization: Bearer <utok>` and forwards the response.\n *\n * Why proxy vs direct-browser-fetch to `/api/files/<id>`:\n *\n * - Hub `/api/files/<id>` requires `Authorization: Bearer <token>`.\n * If the client tried to fetch it directly, the browser would need\n * the token in-page. Putting the token in a URL query string\n * leaks it into browser history + server access logs + Referer\n * headers on any follow-up navigation. Attaching it as an\n * `Authorization` header from the client requires the client to\n * hold the token, which we already refused to do (dashboard V3\n * tokens are HttpOnly-cookie-only per `dashboard-auth.ts`).\n * - By proxying, the token stays server-side. The client sends\n * nothing but its own session cookie; the server adds the Bearer.\n *\n * Buffering vs streaming: this half of the proxy USED to stream (O(1)\n * memory). The preview half needs to detect magic bytes before\n * headers can be sent, so we now buffer the full body. Acceptable\n * because hub caps uploads at 12 MiB; worst case is 12 MiB *\n * concurrent-preview-requests per node process. If that becomes\n * memory pressure the fix is to tee the ReadableStream and inspect\n * the first chunk without buffering the rest — deferred until\n * evidence shows it's worth the complexity.\n *\n * Content-Disposition + X-Content-Type-Options come from the hub\n * response and are passed through verbatim — the hub already stamps\n * `attachment` disposition + `nosniff` on downloads (issue #221),\n * meaning the browser will download-not-render even if the file\n * happens to be text/html. Do not add or alter those headers here.\n *\n * The response ALWAYS carries `attachment` disposition — the client\n * reads `X-Verified-Type` and constructs a blob URL if it wants to\n * inline the content. See `detectSafeMime` above for the security\n * reasoning.\n */\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ fileId: string }> },\n) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n const { fileId } = await params;\n if (!fileId || !FILE_ID_REGEX.test(fileId)) {\n return Response.json({ error: 'invalid file_id' }, { status: 400 });\n }\n\n const userToken = await getV3UserToken();\n if (!userToken) {\n return Response.json({ error: 'no session token' }, { status: 401 });\n }\n\n const url = `${HUB_URL}/api/files/${encodeURIComponent(fileId)}`;\n let hubRes: Response;\n try {\n hubRes = await fetch(url, {\n method: 'GET',\n headers: { Authorization: `Bearer ${userToken}` },\n cache: 'no-store',\n });\n } catch (e: unknown) {\n return Response.json(\n { error: 'hub unreachable', detail: e instanceof Error ? e.message : String(e) },\n { status: 502 },\n );\n }\n\n // Forward hub's status verbatim so a 404 (unknown file_id) surfaces\n // as a 404 the client can distinguish from a proxy error.\n if (!hubRes.ok) {\n const ct = hubRes.headers.get('content-type') || '';\n if (ct.includes('json')) {\n try {\n const errBody = await hubRes.json();\n return Response.json(errBody, { status: hubRes.status });\n } catch {\n // fall through to generic\n }\n }\n return new Response(null, { status: hubRes.status });\n }\n\n // Buffer full body — see JSDoc for the memory rationale.\n const bytes = new Uint8Array(await hubRes.arrayBuffer());\n const verifiedType = detectSafeMime(bytes.subarray(0, 32));\n\n // Build the response header set — only the allowlisted ones. This\n // strips anything the hub might leak (Set-Cookie, X-Hub-*, etc.).\n const outHeaders = new Headers();\n for (const key of HEADER_PASSTHROUGH) {\n const value = hubRes.headers.get(key);\n if (value !== null) outHeaders.set(key, value);\n }\n // Content-Length may not survive if we re-emit the body; set from\n // our own buffer length to be authoritative.\n outHeaders.set('content-length', String(bytes.length));\n\n // Defense-in-depth: always stamp nosniff on downloads even if the\n // hub didn't (it does today per #221, but pinning here means a hub\n // regression can't retroactively make the browser sniff-execute).\n // The polyglot-PNG-HTML adversarial sample in verify.sh depends on\n // this exact header being present.\n outHeaders.set('x-content-type-options', 'nosniff');\n\n // 🔴 Structural invariant: we do NOT modify Content-Disposition\n // based on `verifiedType`. Even if the file IS a safe PNG, the\n // hub-served disposition (`attachment`) stays. Client uses the\n // header below to decide whether to blob+inline.\n if (verifiedType) {\n outHeaders.set('x-verified-type', verifiedType);\n }\n\n return new Response(bytes, {\n status: 200,\n headers: outHeaders,\n });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/hub/files/[fileId]/route\",\n pathname: \"/api/hub/files/[fileId]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/[fileId]/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/hub/files/[fileId]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["HUB_URL","process","env","COMMHUB_URL","FILE_ID_REGEX","HEADER_PASSTHROUGH","head","length","detectSafeMime","b","params","e","Response","GET","_req","authFailure","fileId","test","json","error","status","userToken","String","url","encodeURIComponent","hubRes","fetch","method","headers","Authorization","cache","detail","Error","message","set","bytes","ok","ct","get","includes","errBody","Uint8Array","arr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AC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/%5BfileId%5D/route.ts","../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { requireDashboardAuth, getV3UserToken } from '@/app/lib/dashboard-auth';\n\nconst HUB_URL = process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n\n/**\n * File ID shape: mirrors server/src/uploads.ts FILE_ID_REGEX exactly.\n * Token-exact check before any URL composition — refuse\n * `../../etc/passwd` before it can reach the hub.\n */\nconst FILE_ID_REGEX = /^[A-Za-z0-9_-]{8,64}$/;\n\n/**\n * Header allowlist for the pass-through. We deliberately do NOT forward\n * everything from the hub response — the browser must NOT see anything\n * that could leak the internal request path or the Bearer token.\n *\n * `content-disposition` and `x-content-type-options` are intentionally\n * NOT in this list — they're stamped explicitly below (see JSDoc on\n * the response builder). Passing them through the allowlist would\n * silently defer to hub for the security-critical values, which is\n * exactly the regression path 通信龙 flagged in the #47 review.\n */\nconst HEADER_PASSTHROUGH = [\n 'content-type',\n 'content-length',\n] as const;\n\n// ── #492 preview half: safe-inline-type detection ──────────────\n//\n// 🔴 STRUCTURAL SAFETY (通信龙 #46 review of the inline design):\n// This proxy NEVER returns an inline response, regardless of the\n// file's real type. `Content-Disposition: attachment` + `nosniff`\n// stay stamped on every download, so no dashboard-origin URL can\n// ever serve user-uploaded content as a rendered page — that entire\n// XSS class is structurally impossible, not defended-by-whitelist.\n//\n// What we DO expose: a `X-Verified-Type` header carrying the true MIME\n// as detected by magic bytes. The client uses this header to decide:\n// 1. Fetch the bytes (browser downloads — no navigation)\n// 2. `new Blob([bytes], {type: xVerifiedType})`\n// 3. `URL.createObjectURL(blob)` → `<img>` / `<video>` src\n//\n// The blob URL is same-origin *to the browser's blob: scheme*, isolated\n// from the dashboard origin — a bug in whitelist can degrade UX (image\n// won't render) but can never become a cross-origin script vector.\n//\n// Detection rule: EXACT MIME match by per-format magic bytes at each\n// format's actual offset. No prefix matching (`image/*` would let SVG\n// in). No trust of upload-time mime/filename (both untrusted).\ntype SafeMime =\n | 'image/png'\n | 'image/jpeg'\n | 'image/gif'\n | 'image/webp'\n | 'video/mp4'\n | 'video/webm';\n\n/**\n * Peek magic bytes and return the safe MIME if the file matches one\n * of our whitelisted formats.\n *\n * Per-format offset rules (not naive first-N compare — 通信龙 review):\n * - PNG: offset 0, `89 50 4E 47 0D 0A 1A 0A`\n * - JPEG: offset 0, `FF D8 FF`\n * - GIF: offset 0, `47 49 46 38 (37|39) 61` (\"GIF87a\" / \"GIF89a\")\n * - WebP: offset 0 `52 49 46 46` (\"RIFF\") + offset 8 `57 45 42 50` (\"WEBP\")\n * - MP4: offset 4 `66 74 79 70` (\"ftyp\") — MP4/M4V/QT ISO BMFF box\n * - WebM: offset 0 `1A 45 DF A3` (EBML)\n *\n * Returns null for anything else (SVG, HTML, empty, corrupted, unknown).\n */\nfunction detectSafeMime(head: Uint8Array): SafeMime | null {\n const b = head;\n if (b.length < 4) return null;\n\n // PNG\n if (\n b.length >= 8 &&\n b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4E && b[3] === 0x47 &&\n b[4] === 0x0D && b[5] === 0x0A && b[6] === 0x1A && b[7] === 0x0A\n ) return 'image/png';\n\n // JPEG (FF D8 FF — final byte is FF E0 / FF E1 / FF DB variants; the FF prefix\n // is enough to distinguish. Reject if not exactly the three-byte JPEG marker.)\n if (b[0] === 0xFF && b[1] === 0xD8 && b[2] === 0xFF) return 'image/jpeg';\n\n // GIF — \"GIF87a\" or \"GIF89a\"\n if (\n b.length >= 6 &&\n b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x38 &&\n (b[4] === 0x37 || b[4] === 0x39) && b[5] === 0x61\n ) return 'image/gif';\n\n // WebP — \"RIFF????WEBP\"\n if (\n b.length >= 12 &&\n b[0] === 0x52 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x46 &&\n b[8] === 0x57 && b[9] === 0x45 && b[10] === 0x42 && b[11] === 0x50\n ) return 'image/webp';\n\n // WebM (EBML header) — 1A 45 DF A3\n if (b[0] === 0x1A && b[1] === 0x45 && b[2] === 0xDF && b[3] === 0xA3) {\n return 'video/webm';\n }\n\n // MP4 (ISO BMFF `ftyp` box at offset 4) — the first 4 bytes are a\n // big-endian box size we don't need to validate; the \"ftyp\" marker\n // is what we key on.\n if (\n b.length >= 8 &&\n b[4] === 0x66 && b[5] === 0x74 && b[6] === 0x79 && b[7] === 0x70\n ) return 'video/mp4';\n\n return null;\n}\n\n/**\n * #492 — file download proxy: browser fetches `/api/hub/files/<file_id>`,\n * this proxy attaches the browser session's V3 user token as\n * `Authorization: Bearer <utok>` and forwards the response.\n *\n * Why proxy vs direct-browser-fetch to `/api/files/<id>`:\n *\n * - Hub `/api/files/<id>` requires `Authorization: Bearer <token>`.\n * If the client tried to fetch it directly, the browser would need\n * the token in-page. Putting the token in a URL query string\n * leaks it into browser history + server access logs + Referer\n * headers on any follow-up navigation. Attaching it as an\n * `Authorization` header from the client requires the client to\n * hold the token, which we already refused to do (dashboard V3\n * tokens are HttpOnly-cookie-only per `dashboard-auth.ts`).\n * - By proxying, the token stays server-side. The client sends\n * nothing but its own session cookie; the server adds the Bearer.\n *\n * Buffering vs streaming: this half of the proxy USED to stream (O(1)\n * memory). The preview half needs to detect magic bytes before\n * headers can be sent, so we now buffer the full body. Acceptable\n * because hub caps uploads at 12 MiB; worst case is 12 MiB *\n * concurrent-preview-requests per node process. If that becomes\n * memory pressure the fix is to tee the ReadableStream and inspect\n * the first chunk without buffering the rest — deferred until\n * evidence shows it's worth the complexity.\n *\n * Content-Disposition + X-Content-Type-Options come from the hub\n * response and are passed through verbatim — the hub already stamps\n * `attachment` disposition + `nosniff` on downloads (issue #221),\n * meaning the browser will download-not-render even if the file\n * happens to be text/html. Do not add or alter those headers here.\n *\n * The response ALWAYS carries `attachment` disposition — the client\n * reads `X-Verified-Type` and constructs a blob URL if it wants to\n * inline the content. See `detectSafeMime` above for the security\n * reasoning.\n */\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ fileId: string }> },\n) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n const { fileId } = await params;\n if (!fileId || !FILE_ID_REGEX.test(fileId)) {\n return Response.json({ error: 'invalid file_id' }, { status: 400 });\n }\n\n const userToken = await getV3UserToken();\n if (!userToken) {\n return Response.json({ error: 'no session token' }, { status: 401 });\n }\n\n const url = `${HUB_URL}/api/files/${encodeURIComponent(fileId)}`;\n let hubRes: Response;\n try {\n hubRes = await fetch(url, {\n method: 'GET',\n headers: { Authorization: `Bearer ${userToken}` },\n cache: 'no-store',\n });\n } catch (e: unknown) {\n return Response.json(\n { error: 'hub unreachable', detail: e instanceof Error ? e.message : String(e) },\n { status: 502 },\n );\n }\n\n // Forward hub's status verbatim so a 404 (unknown file_id) surfaces\n // as a 404 the client can distinguish from a proxy error.\n if (!hubRes.ok) {\n const ct = hubRes.headers.get('content-type') || '';\n if (ct.includes('json')) {\n try {\n const errBody = await hubRes.json();\n return Response.json(errBody, { status: hubRes.status });\n } catch {\n // fall through to generic\n }\n }\n return new Response(null, { status: hubRes.status });\n }\n\n // Buffer full body — see JSDoc for the memory rationale.\n const bytes = new Uint8Array(await hubRes.arrayBuffer());\n const verifiedType = detectSafeMime(bytes.subarray(0, 32));\n\n // Build the response header set — only the allowlisted ones. This\n // strips anything the hub might leak (Set-Cookie, X-Hub-*, etc.).\n const outHeaders = new Headers();\n for (const key of HEADER_PASSTHROUGH) {\n const value = hubRes.headers.get(key);\n if (value !== null) outHeaders.set(key, value);\n }\n // Content-Length may not survive if we re-emit the body; set from\n // our own buffer length to be authoritative.\n outHeaders.set('content-length', String(bytes.length));\n\n // Defense-in-depth: always stamp nosniff on downloads even if the\n // hub didn't (it does today per #221, but pinning here means a hub\n // regression can't retroactively make the browser sniff-execute).\n // The polyglot-PNG-HTML adversarial sample in verify.sh depends on\n // this exact header being present.\n outHeaders.set('x-content-type-options', 'nosniff');\n\n // 🔴 SYMMETRIC PIN with nosniff (通信龙 review of PR #47):\n // \"永不 inline\" is the single load-bearing invariant of this\n // whole design. It CANNOT depend on hub always sending\n // `Content-Disposition: attachment`, because a hub regression =\n // proxy regression = XSS. Pin it here explicitly.\n //\n // Filename preservation: if hub sent `attachment; filename=\"...\"`\n // we keep the whole thing (users see the friendly name in their\n // download folder). If hub returns anything else (`inline; ...`,\n // or missing) we override to bare `attachment` with a\n // safe file_id-based filename fallback.\n const hubDisposition = hubRes.headers.get('content-disposition') || '';\n if (/^\\s*attachment\\b/i.test(hubDisposition)) {\n outHeaders.set('content-disposition', hubDisposition);\n } else {\n outHeaders.set('content-disposition', `attachment; filename=\"${fileId}\"`);\n }\n\n // Structural invariant: `X-Verified-Type` is INFORMATIONAL only.\n // Adding it does not change the response's disposition or\n // Content-Type. The client uses it to decide whether to construct\n // a blob URL for inline rendering (browser-owned blob: scheme,\n // isolated from the dashboard origin).\n if (verifiedType) {\n outHeaders.set('x-verified-type', verifiedType);\n }\n\n return new Response(bytes, {\n status: 200,\n headers: outHeaders,\n });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/hub/files/[fileId]/route\",\n pathname: \"/api/hub/files/[fileId]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/[fileId]/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/hub/files/[fileId]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["HUB_URL","process","env","COMMHUB_URL","FILE_ID_REGEX","HEADER_PASSTHROUGH","b","detectSafeMime","head","length","_req","fileId","url","hubRes","Error","ok","get","GET","verifiedType","params","authFailure","test","Response","json","error","status","userToken","set","encodeURIComponent","fetch","method","headers","Authorization","cache","e","detail","message","String","ct","includes","errBody","bytes","Uint8Array","arrayBuffer","subarray","outHeaders","Headers","key","value","hubDisposition"],"mappings":"wjCCAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,ODhBA,EAAA,EA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BAAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAY,AAAZ,EAAa,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,GAAyB,EACzB,MAAM,EAAe,EADgB,EAGrC,EAAa,EAAO,kBAAkB,GACtC,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GATmB,AAShB,EAAY,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[71421,a=>{"use strict";a.s(["DASHBOARD_VERSION",0,"0.6.3-preview.
|
|
1
|
+
module.exports=[71421,a=>{"use strict";a.s(["DASHBOARD_VERSION",0,"0.6.3-preview.39"],71421)},3583,a=>{"use strict";var b=a.i(79913),c=a.i(26600),d=a.i(71421);a.s(["default",0,function(){let[a,e]=(0,c.useState)("login"),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(!1),p=async b=>{b.preventDefault(),o(!0),m("");try{let b=await fetch("/api/auth/v3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a,username:f,password:h})}),c=await b.json();if(c.ok){c.token&&sessionStorage.setItem("anet_v3_auth",JSON.stringify({user:c.user,token:c.token,networks:c.networks||[],currentNetwork:c.network_id||c.networks?.[0]?.network_id||""})),window.location.assign("/");return}m(c.error||"Login failed")}catch{m("Connection failed")}o(!1)};return(0,b.jsxs)("main",{className:"min-h-screen bg-[#0b0b0d] text-gray-100 flex items-center justify-center relative overflow-hidden px-4 py-10 sm:py-16",children:[(0,b.jsx)("div",{className:"absolute inset-0 pointer-events-none anet-login-bg","aria-hidden":!0}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[460px] h-[460px] rounded-full bg-cyan-500/[0.045] blur-[110px] pointer-events-none","aria-hidden":!0}),(0,b.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,b.jsxs)("div",{className:"text-center mb-7",children:[(0,b.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-4 rounded-2xl bg-[#161618] border border-[#26262b] anet-login-mark",children:(0,b.jsxs)("svg",{className:"w-9 h-9",viewBox:"0 0 32 32","aria-hidden":!0,children:[(0,b.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.25",className:"text-cyan-400 anet-login-mark-ring"}),(0,b.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,b.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,b.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,b.jsx)("circle",{cx:"16",cy:"10",r:"3",fill:"currentColor",className:"text-cyan-400 anet-login-mark-node-a"}),(0,b.jsx)("circle",{cx:"10",cy:"20",r:"3",fill:"currentColor",className:"text-green-400 anet-login-mark-node-b"}),(0,b.jsx)("circle",{cx:"22",cy:"20",r:"3",fill:"currentColor",className:"text-violet-400 anet-login-mark-node-c"})]})}),(0,b.jsx)("h1",{className:"text-[22px] sm:text-2xl font-semibold text-white tracking-tight",children:"Agent Network"}),(0,b.jsx)("p",{className:"text-[13px] text-gray-400 mt-1.5 leading-snug",children:"login"===a?(0,b.jsxs)(b.Fragment,{children:["Welcome back · ",(0,b.jsx)("span",{className:"text-gray-500",children:"Tasks · Mesh · Messages"})]}):(0,b.jsxs)(b.Fragment,{children:["Create your account · ",(0,b.jsx)("span",{className:"text-gray-500",children:"Free preview · no credit card"})]})})]}),(0,b.jsx)("div",{className:"flex rounded-lg border border-[#26262b] bg-[#161618] p-1 mb-4",children:["login","register"].map(c=>(0,b.jsx)("button",{type:"button",onClick:()=>{e(c),m("")},className:`flex-1 rounded-md px-3 py-2 text-sm transition-colors ${a===c?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"login"===c?"Sign in":"Register"},c))}),(0,b.jsxs)("form",{onSubmit:p,className:"border border-[#26262b] bg-[#161618]/80 backdrop-blur-sm rounded-xl p-6 shadow-2xl shadow-black/30",children:[(0,b.jsx)("label",{htmlFor:"username",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Username"}),(0,b.jsx)("input",{id:"username",type:"text",value:f,onChange:a=>g(a.target.value),autoFocus:!0,placeholder:"Enter username",className:"w-full bg-[#0e0e10] border border-[#26262b] rounded-lg px-4 py-3 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all mb-4"}),(0,b.jsx)("label",{htmlFor:"password",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Password"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("input",{id:"password",type:j?"text":"password",value:h,onChange:a=>i(a.target.value),placeholder:"Enter password",className:"w-full bg-[#0e0e10] border border-[#26262b] rounded-lg px-4 pr-11 py-3 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all"}),(0,b.jsx)("button",{type:"button",onClick:()=>k(a=>!a),tabIndex:-1,"aria-label":j?"Hide password":"Show password",className:"absolute inset-y-0 right-0 flex items-center justify-center min-w-[44px] px-3 text-gray-600 hover:text-gray-300 transition-colors",children:j?(0,b.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,b.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):(0,b.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})})]}),l&&(0,b.jsx)("div",{className:"mt-3 text-sm text-red-300 bg-red-500/5 border border-red-500/10 rounded-lg px-3 py-2",children:l}),(0,b.jsxs)("button",{type:"submit",disabled:n||!h||!f.trim(),className:"mt-5 w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-lg transition-all shadow-lg shadow-cyan-500/10 hover:shadow-cyan-500/20 disabled:shadow-none",children:[n&&(0,b.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,b.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,b.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,b.jsx)("span",{children:n?"login"===a?"Signing in…":"Registering…":"login"===a?"Sign in":"Create account"})]})]}),(0,b.jsxs)("p",{className:"text-center text-[11px] text-gray-700 mt-6",children:["Sleep2AGI · Apache-2.0 · ",(0,b.jsx)("a",{href:"https://anet.sh",className:"hover:text-gray-500 transition-colors",children:"anet.sh"}),(0,b.jsx)("span",{className:"mx-1 text-gray-800",children:"·"}),(0,b.jsxs)("span",{className:"font-mono",title:"@sleep2agi/agent-network-dashboard",children:["v",d.DASHBOARD_VERSION]})]})]})]})}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0mek_e~._.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/package.json.%5Bjson%5D.mjs","../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/lib/version.ts","../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/login/page.tsx"],"sourcesContent":["\"use turbopack no side effects\";\nexport default {\"name\":\"@sleep2agi/agent-network-dashboard\",\"version\":\"0.6.3-preview.38\",\"description\":\"Agent Network Dashboard — Web UI for managing AI Agent networks\",\"main\":\"apps/desktop/electron/main.cjs\",\"scripts\":{\"dev\":\"next dev\",\"build\":\"next build\",\"postbuild\":\"node scripts/stamp-build-commit.mjs\",\"start\":\"next start\",\"lint\":\"eslint\",\"app:android:init\":\"npx cap add android\",\"app:android:sync\":\"npx cap sync android\",\"app:android:open\":\"npx cap open android\",\"app:ios:init\":\"npx cap add ios\",\"app:ios:sync\":\"npx cap sync ios\",\"app:ios:open\":\"npx cap open ios\",\"app:desktop\":\"electron apps/desktop/electron/main.cjs\",\"app:desktop:pack\":\"electron-builder --config electron-builder.json\",\"prepublishOnly\":\"[ -f .next/BUILD_ID ] || (echo 'prepublishOnly: .next/BUILD_ID missing — run npm run build first (see commit 05c1ebf body for R224 chunk-500 root cause)' >&2 && exit 1)\",\"avatars:check\":\"node scripts/check-avatars.mjs\"},\"bin\":{\"agent-network-dashboard\":\"./bin/start.js\"},\"homepage\":\"https://anet.sh\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/sleep2agi/agent-network-dashboard\"},\"bugs\":{\"url\":\"https://github.com/sleep2agi/agent-network-dashboard/issues\"},\"author\":\"sleep2agi\",\"license\":\"Apache-2.0\",\"publishConfig\":{\"access\":\"public\"},\"dependencies\":{\"@capacitor/core\":\"^7.4.4\",\"next\":\"16.2.3\",\"pinyin-pro\":\"^3.28.1\",\"react\":\"19.2.4\",\"react-dom\":\"19.2.4\",\"react-markdown\":\"^10.1.0\",\"remark-gfm\":\"^4.0.1\",\"swr\":\"^2.4.1\"},\"devDependencies\":{\"@capacitor/android\":\"^7.4.4\",\"@capacitor/cli\":\"^7.4.4\",\"@capacitor/ios\":\"^7.4.4\",\"@playwright/test\":\"^1.59.1\",\"@tailwindcss/postcss\":\"^4\",\"@types/node\":\"^20\",\"@types/react\":\"^19\",\"@types/react-dom\":\"^19\",\"electron\":\"^39.2.6\",\"electron-builder\":\"^26.0.12\",\"eslint\":\"^9\",\"eslint-config-next\":\"16.2.3\",\"tailwindcss\":\"^4\",\"typescript\":\"^5\"}};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR1cmJvcGFjazovLy9jbGF1ZGUtMTAwMC8taG9tZS12YW5zaW4tYWdlbnQtb3JjaGVzdHJhL2ZlZjBlYjU1LWIzOWMtNGFiYy1iN2ZmLTQ4NDQwYjlhZDgwNS9zY3JhdGNocGFkL2Rhc2hyZWwvcGFja2FnZS5qc29uIl0sInNvdXJjZXNDb250ZW50IjpbIntcIm5hbWVcIjpcIkBzbGVlcDJhZ2kvYWdlbnQtbmV0d29yay1kYXNoYm9hcmRcIixcInZlcnNpb25cIjpcIjAuNi4zLXByZXZpZXcuMzhcIixcImRlc2NyaXB0aW9uXCI6XCJBZ2VudCBOZXR3b3JrIERhc2hib2FyZCDigJQgV2ViIFVJIGZvciBtYW5hZ2luZyBBSSBBZ2VudCBuZXR3b3Jrc1wiLFwibWFpblwiOlwiYXBwcy9kZXNrdG9wL2VsZWN0cm9uL21haW4uY2pzXCIsXCJzY3JpcHRzXCI6e1wiZGV2XCI6XCJuZXh0IGRldlwiLFwiYnVpbGRcIjpcIm5leHQgYnVpbGRcIixcInBvc3RidWlsZFwiOlwibm9kZSBzY3JpcHRzL3N0YW1wLWJ1aWxkLWNvbW1pdC5tanNcIixcInN0YXJ0XCI6XCJuZXh0IHN0YXJ0XCIsXCJsaW50XCI6XCJlc2xpbnRcIixcImFwcDphbmRyb2lkOmluaXRcIjpcIm5weCBjYXAgYWRkIGFuZHJvaWRcIixcImFwcDphbmRyb2lkOnN5bmNcIjpcIm5weCBjYXAgc3luYyBhbmRyb2lkXCIsXCJhcHA6YW5kcm9pZDpvcGVuXCI6XCJucH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XCIsXCJsaWNlbnNlXCI6XCJBcGFjaGUtMi4wXCIsXCJwdWJsaXNoQ29uZmlnXCI6e1wiYWNjZXNzXCI6XCJwdWJsaWNcIn0sXCJkZXBlbmRlbmNpZXNcIjp7XCJAY2FwYWNpdG9yL2NvcmVcIjpcIl43LjQuNFwiLFwibmV4dFwiOlwiMTYuMi4zXCIsXCJwaW55aW4tcHJvXCI6XCJeMy4yOC4xXCIsXCJyZWFjdFwiOlwiMTkuMi40XCIsXCJyZWFjdC1kb21cIjpcIjE5LjIuNFwiLFwicmVhY3QtbWFya2Rvd25cIjpcIl4xMC4xLjBcIixcInJlbWFyay1nZm1cIjpcIl40LjAuMVwiLFwic3dyXCI6XCJeMi40LjFcIn0sXCJkZXZEZXBlbmRlbmNpZXNcIjp7XCJAY2FwYWNpdG9yL2FuZHJvaWRcIjpcIl43LjQuNFwiLFwiQGNhcGFjaXRvci9jbGlcIjpcIl43LjQuNFwiLFwiQGNhcGFjaXRvci9pb3NcIjpcIl43LjQuNFwiLFwiQHBsYXl3cmlnaHQvdGVzdFwiOlwiXjEuNTkuMVwiLFwiQHRhaWx3aW5kY3NzL3Bvc3Rjc3NcIjpcIl40XCIsXCJAdHlwZXMvbm9kZVwiOlwiXjIwXCIsXCJAdHlwZXMvcmVhY3RcIjpcIl4xOVwiLFwiQHR5cGVzL3JlYWN0LWRvbVwiOlwiXjE5XCIsXCJlbGVjdHJvblwiOlwiXjM5LjIuNlwiLFwiZWxlY3Ryb24tYnVpbGRlclwiOlwiXjI2LjAuMTJcIixcImVzbGludFwiOlwiXjlcIixcImVzbGludC1jb25maWctbmV4dFwiOlwiMTYuMi4zXCIsXCJ0YWlsd2luZGNzc1wiOlwiXjRcIixcInR5cGVzY3JpcHRcIjpcIl41XCJ9fSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9","/** Dashboard package version sourced from package.json at build time.\n * Importing JSON requires `resolveJsonModule: true` in tsconfig, which\n * Next sets by default. Bumping is automated by the publish flow, so this\n * surfaces the real preview number in Settings → Dashboard. */\nimport pkg from '../../package.json' assert { type: 'json' };\n\nexport const DASHBOARD_VERSION: string = pkg.version;\n","'use client';\n\nimport { FormEvent, useState } from 'react';\nimport { DASHBOARD_VERSION } from '../lib/version';\n\nexport default function LoginPage() {\n const [mode, setMode] = useState<'login' | 'register'>('login');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [error, setError] = useState('');\n const [pending, setPending] = useState(false);\n\n const submit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n setPending(true);\n setError('');\n\n try {\n const res = await fetch('/api/auth/v3', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ action: mode, username, password }),\n });\n const data = await res.json();\n\n if (data.ok) {\n // Store V3 auth data for client-side features\n if (data.token) {\n sessionStorage.setItem('anet_v3_auth', JSON.stringify({\n user: data.user,\n token: data.token,\n networks: data.networks || [],\n currentNetwork: data.network_id || data.networks?.[0]?.network_id || '',\n }));\n }\n window.location.assign('/');\n return;\n }\n\n setError(data.error || 'Login failed');\n } catch {\n setError('Connection failed');\n }\n setPending(false);\n };\n\n return (\n <main className=\"min-h-screen bg-[#0b0b0d] text-gray-100 flex items-center justify-center relative overflow-hidden px-4 py-10 sm:py-16\">\n {/* Subtle off-grid background — restraint over AI-glow.\n Dark themes get a faint radial wash; light themes show a low-contrast\n dotted grid for surface texture without noise. */}\n <div className=\"absolute inset-0 pointer-events-none anet-login-bg\" aria-hidden />\n {/* Soft brand glow behind the card — adds depth to the flat near-black\n field without competing with the form (design-polish #17 R1). */}\n <div className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[460px] h-[460px] rounded-full bg-cyan-500/[0.045] blur-[110px] pointer-events-none\" aria-hidden />\n\n <div className=\"relative w-full max-w-sm\">\n <div className=\"text-center mb-7\">\n {/* Brand mark — uses the favicon 3-node mesh SVG which IS the\n agent-network concept (nodes + edges). Replaces the previous\n flat emerald square placeholder. */}\n <div className=\"inline-flex items-center justify-center w-16 h-16 mb-4 rounded-2xl bg-[#161618] border border-[#26262b] anet-login-mark\">\n <svg className=\"w-9 h-9\" viewBox=\"0 0 32 32\" aria-hidden>\n <circle cx=\"16\" cy=\"16\" r=\"10\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" opacity=\"0.25\" className=\"text-cyan-400 anet-login-mark-ring\" />\n <line x1=\"16\" y1=\"10\" x2=\"10\" y2=\"20\" stroke=\"currentColor\" strokeWidth=\"1\" opacity=\"0.5\" className=\"text-cyan-400 anet-login-mark-edge\" />\n <line x1=\"16\" y1=\"10\" x2=\"22\" y2=\"20\" stroke=\"currentColor\" strokeWidth=\"1\" opacity=\"0.5\" className=\"text-cyan-400 anet-login-mark-edge\" />\n <line x1=\"10\" y1=\"20\" x2=\"22\" y2=\"20\" stroke=\"currentColor\" strokeWidth=\"1\" opacity=\"0.5\" className=\"text-cyan-400 anet-login-mark-edge\" />\n <circle cx=\"16\" cy=\"10\" r=\"3\" fill=\"currentColor\" className=\"text-cyan-400 anet-login-mark-node-a\" />\n <circle cx=\"10\" cy=\"20\" r=\"3\" fill=\"currentColor\" className=\"text-green-400 anet-login-mark-node-b\" />\n <circle cx=\"22\" cy=\"20\" r=\"3\" fill=\"currentColor\" className=\"text-violet-400 anet-login-mark-node-c\" />\n </svg>\n </div>\n <h1 className=\"text-[22px] sm:text-2xl font-semibold text-white tracking-tight\">Agent Network</h1>\n <p className=\"text-[13px] text-gray-400 mt-1.5 leading-snug\">\n {mode === 'login'\n ? <>Welcome back · <span className=\"text-gray-500\">Tasks · Mesh · Messages</span></>\n : <>Create your account · <span className=\"text-gray-500\">Free preview · no credit card</span></>}\n </p>\n </div>\n\n {/* Mode toggle */}\n <div className=\"flex rounded-lg border border-[#26262b] bg-[#161618] p-1 mb-4\">\n {(['login', 'register'] as const).map(m => (\n <button key={m} type=\"button\" onClick={() => { setMode(m); setError(''); }}\n className={`flex-1 rounded-md px-3 py-2 text-sm transition-colors ${mode === m ? 'bg-cyan-500/10 text-cyan-300' : 'text-gray-500 hover:text-gray-200'}`}>\n {m === 'login' ? 'Sign in' : 'Register'}\n </button>\n ))}\n </div>\n\n <form onSubmit={submit} className=\"border border-[#26262b] bg-[#161618]/80 backdrop-blur-sm rounded-xl p-6 shadow-2xl shadow-black/30\">\n <label htmlFor=\"username\" className=\"block text-xs text-gray-500 mb-2 uppercase tracking-wider\">\n Username\n </label>\n <input id=\"username\" type=\"text\" value={username} onChange={e => setUsername(e.target.value)} autoFocus\n placeholder=\"Enter username\"\n className=\"w-full bg-[#0e0e10] border border-[#26262b] rounded-lg px-4 py-3 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all mb-4\" />\n\n <label htmlFor=\"password\" className=\"block text-xs text-gray-500 mb-2 uppercase tracking-wider\">\n Password\n </label>\n <div className=\"relative\">\n <input id=\"password\" type={showPassword ? 'text' : 'password'} value={password} onChange={e => setPassword(e.target.value)}\n placeholder=\"Enter password\"\n className=\"w-full bg-[#0e0e10] border border-[#26262b] rounded-lg px-4 pr-11 py-3 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all\" />\n <button\n type=\"button\"\n onClick={() => setShowPassword(s => !s)}\n tabIndex={-1}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n className=\"absolute inset-y-0 right-0 flex items-center justify-center min-w-[44px] px-3 text-gray-600 hover:text-gray-300 transition-colors\"\n >\n {showPassword ? (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" />\n </svg>\n ) : (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n )}\n </button>\n </div>\n\n {error && (\n <div className=\"mt-3 text-sm text-red-300 bg-red-500/5 border border-red-500/10 rounded-lg px-3 py-2\">{error}</div>\n )}\n\n <button type=\"submit\" disabled={pending || !password || !username.trim()}\n className=\"mt-5 w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-lg transition-all shadow-lg shadow-cyan-500/10 hover:shadow-cyan-500/20 disabled:shadow-none\">\n {pending && (\n <svg aria-hidden className=\"w-4 h-4 animate-spin\" viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"3\" opacity=\"0.25\" />\n <path d=\"M4 12a8 8 0 018-8\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" />\n </svg>\n )}\n <span>{pending ? (mode === 'login' ? 'Signing in…' : 'Registering…') : (mode === 'login' ? 'Sign in' : 'Create account')}</span>\n </button>\n </form>\n\n <p className=\"text-center text-[11px] text-gray-700 mt-6\">\n Sleep2AGI · Apache-2.0 · <a href=\"https://anet.sh\" className=\"hover:text-gray-500 transition-colors\">anet.sh</a>\n <span className=\"mx-1 text-gray-800\">·</span>\n <span className=\"font-mono\" title=\"@sleep2agi/agent-network-dashboard\">v{DASHBOARD_VERSION}</span>\n </p>\n </div>\n </main>\n );\n}\n"],"names":["LoginPage","mode","setMode","username","setUsername","password","setPassword","showPassword","setShowPassword","error","setError","pending","setPending","submit","event","preventDefault","res","fetch","method","headers","body","JSON","stringify","action","data","json","ok","token","sessionStorage","setItem","user","networks","currentNetwork","network_id","window","location","assign","className","viewBox","cx","cy","r","fill","stroke","strokeWidth","opacity","x1","y1","x2","y2","map","m","type","onClick","onSubmit","htmlFor","id","value","onChange","e","target","autoFocus","placeholder","s","tabIndex","width","height","strokeLinecap","strokeLinejoin","d","disabled","trim","href","title"],"mappings":"kEACsE,mEECtE,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,wBAEe,SAASA,EACtB,GAAM,CAACC,EAAMC,EAAQ,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAuB,SACjD,CAACC,EAAUC,EAAY,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,IACnC,CAACC,EAAUC,EAAY,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,IACnC,CAACC,EAAcC,EAAgB,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,GAAC,GAC3C,CAACC,EAAOC,EAAS,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,IAC7B,CAACC,EAASC,EAAW,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,GAAC,GAEjCC,EAAS,MAAOC,IACpBA,EAAMC,cAAc,GACpBH,GAAW,GACXF,EAAS,IAET,GAAI,CACF,IAAMM,EAAM,MAAMC,MAAM,eAAgB,CACtCC,OAAQ,OACRC,QAAS,CAAE,eAAgB,kBAAmB,EAC9CC,KAAMC,KAAKC,SAAS,CAAC,CAAEC,OAAQtB,WAAME,WAAUE,CAAS,EAC1D,GACMmB,EAAO,MAAMR,EAAIS,IAAI,GAE3B,GAAID,EAAKE,EAAE,CAAE,CAEPF,EAAKG,KAAK,EAAE,AACdC,eAAeC,O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ources":["../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/package.json.%5Bjson%5D.mjs","../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/lib/version.ts","../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/login/page.tsx"],"sourcesContent":["\"use turbopack no side effects\";\nexport default {\"name\":\"@sleep2agi/agent-network-dashboard\",\"version\":\"0.6.3-preview.39\",\"description\":\"Agent Network Dashboard — Web UI for managing AI Agent networks\",\"main\":\"apps/desktop/electron/main.cjs\",\"scripts\":{\"dev\":\"next dev\",\"build\":\"next build\",\"postbuild\":\"node scripts/stamp-build-commit.mjs\",\"start\":\"next start\",\"lint\":\"eslint\",\"app:android:init\":\"npx cap add android\",\"app:android:sync\":\"npx cap sync android\",\"app:android:open\":\"npx cap open android\",\"app:ios:init\":\"npx cap add ios\",\"app:ios:sync\":\"npx cap sync ios\",\"app:ios:open\":\"npx cap open ios\",\"app:desktop\":\"electron apps/desktop/electron/main.cjs\",\"app:desktop:pack\":\"electron-builder --config electron-builder.json\",\"prepublishOnly\":\"[ -f .next/BUILD_ID ] || (echo 'prepublishOnly: .next/BUILD_ID missing — run npm run build first (see commit 05c1ebf body for R224 chunk-500 root cause)' >&2 && exit 1)\",\"avatars:check\":\"node scripts/check-avatars.mjs\"},\"bin\":{\"agent-network-dashboard\":\"./bin/start.js\"},\"homepage\":\"https://anet.sh\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/sleep2agi/agent-network-dashboard\"},\"bugs\":{\"url\":\"https://github.com/sleep2agi/agent-network-dashboard/issues\"},\"author\":\"sleep2agi\",\"license\":\"Apache-2.0\",\"publishConfig\":{\"access\":\"public\"},\"dependencies\":{\"@capacitor/core\":\"^7.4.4\",\"next\":\"16.2.3\",\"pinyin-pro\":\"^3.28.1\",\"react\":\"19.2.4\",\"react-dom\":\"19.2.4\",\"react-markdown\":\"^10.1.0\",\"remark-gfm\":\"^4.0.1\",\"swr\":\"^2.4.1\"},\"devDependencies\":{\"@capacitor/android\":\"^7.4.4\",\"@capacitor/cli\":\"^7.4.4\",\"@capacitor/ios\":\"^7.4.4\",\"@playwright/test\":\"^1.59.1\",\"@tailwindcss/postcss\":\"^4\",\"@types/node\":\"^20\",\"@types/react\":\"^19\",\"@types/react-dom\":\"^19\",\"electron\":\"^39.2.6\",\"electron-builder\":\"^26.0.12\",\"eslint\":\"^9\",\"eslint-config-next\":\"16.2.3\",\"tailwindcss\":\"^4\",\"typescript\":\"^5\"}};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR1cmJvcGFjazovLy9jbGF1ZGUtMTAwMC8taG9tZS12YW5zaW4tYWdlbnQtb3JjaGVzdHJhL2ZlZjBlYjU1LWIzOWMtNGFiYy1iN2ZmLTQ4NDQwYjlhZDgwNS9zY3JhdGNocGFkL2Rhc2hyZWwvcGFja2FnZS5qc29uIl0sInNvdXJjZXNDb250ZW50IjpbIntcIm5hbWVcIjpcIkBzbGVlcDJhZ2kvYWdlbnQtbmV0d29yay1kYXNoYm9hcmRcIixcInZlcnNpb25cIjpcIjAuNi4zLXByZXZpZXcuMzlcIixcImRlc2NyaXB0aW9uXCI6XCJBZ2VudCBOZXR3b3JrIERhc2hib2FyZCDigJQgV2ViIFVJIGZvciBtYW5hZ2luZyBBSSBBZ2VudCBuZXR3b3Jrc1wiLFwibWFpblwiOlwiYXBwcy9kZXNrdG9wL2VsZWN0cm9uL21haW4uY2pzXCIsXCJzY3JpcHRzXCI6e1wiZGV2XCI6XCJuZXh0IGRldlwiLFwiYnVpbGRcIjpcIm5leHQgYnVpbGRcIixcInBvc3RidWlsZFwiOlwibm9kZSBzY3JpcHRzL3N0YW1wLWJ1aWxkLWNvbW1pdC5tanNcIixcInN0YXJ0X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dFwiOlwiMTYuMi4zXCIsXCJ0YWlsd2luZGNzc1wiOlwiXjRcIixcInR5cGVzY3JpcHRcIjpcIl41XCJ9fSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9","/** Dashboard package version sourced from package.json at build time.\n * Importing JSON requires `resolveJsonModule: true` in tsconfig, which\n * Next sets by default. Bumping is automated by the publish flow, so this\n * surfaces the real preview number in Settings → Dashboard. */\nimport pkg from '../../package.json' assert { type: 'json' };\n\nexport const DASHBOARD_VERSION: string = pkg.version;\n","'use client';\n\nimport { FormEvent, useState } from 'react';\nimport { DASHBOARD_VERSION } from '../lib/version';\n\nexport default function LoginPage() {\n const [mode, setMode] = useState<'login' | 'register'>('login');\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [error, setError] = useState('');\n const [pending, setPending] = useState(false);\n\n const submit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n setPending(true);\n setError('');\n\n try {\n const res = await fetch('/api/auth/v3', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ action: mode, username, password }),\n });\n const data = await res.json();\n\n if (data.ok) {\n // Store V3 auth data for client-side features\n if (data.token) {\n sessionStorage.setItem('anet_v3_auth', JSON.stringify({\n user: data.user,\n token: data.token,\n networks: data.networks || [],\n currentNetwork: data.network_id || data.networks?.[0]?.network_id || '',\n }));\n }\n window.location.assign('/');\n return;\n }\n\n setError(data.error || 'Login failed');\n } catch {\n setError('Connection failed');\n }\n setPending(false);\n };\n\n return (\n <main className=\"min-h-screen bg-[#0b0b0d] text-gray-100 flex items-center justify-center relative overflow-hidden px-4 py-10 sm:py-16\">\n {/* Subtle off-grid background — restraint over AI-glow.\n Dark themes get a faint radial wash; light themes show a low-contrast\n dotted grid for surface texture without noise. */}\n <div className=\"absolute inset-0 pointer-events-none anet-login-bg\" aria-hidden />\n {/* Soft brand glow behind the card — adds depth to the flat near-black\n field without competing with the form (design-polish #17 R1). */}\n <div className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[460px] h-[460px] rounded-full bg-cyan-500/[0.045] blur-[110px] pointer-events-none\" aria-hidden />\n\n <div className=\"relative w-full max-w-sm\">\n <div className=\"text-center mb-7\">\n {/* Brand mark — uses the favicon 3-node mesh SVG which IS the\n agent-network concept (nodes + edges). Replaces the previous\n flat emerald square placeholder. */}\n <div className=\"inline-flex items-center justify-center w-16 h-16 mb-4 rounded-2xl bg-[#161618] border border-[#26262b] anet-login-mark\">\n <svg className=\"w-9 h-9\" viewBox=\"0 0 32 32\" aria-hidden>\n <circle cx=\"16\" cy=\"16\" r=\"10\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" opacity=\"0.25\" className=\"text-cyan-400 anet-login-mark-ring\" />\n <line x1=\"16\" y1=\"10\" x2=\"10\" y2=\"20\" stroke=\"currentColor\" strokeWidth=\"1\" opacity=\"0.5\" className=\"text-cyan-400 anet-login-mark-edge\" />\n <line x1=\"16\" y1=\"10\" x2=\"22\" y2=\"20\" stroke=\"currentColor\" strokeWidth=\"1\" opacity=\"0.5\" className=\"text-cyan-400 anet-login-mark-edge\" />\n <line x1=\"10\" y1=\"20\" x2=\"22\" y2=\"20\" stroke=\"currentColor\" strokeWidth=\"1\" opacity=\"0.5\" className=\"text-cyan-400 anet-login-mark-edge\" />\n <circle cx=\"16\" cy=\"10\" r=\"3\" fill=\"currentColor\" className=\"text-cyan-400 anet-login-mark-node-a\" />\n <circle cx=\"10\" cy=\"20\" r=\"3\" fill=\"currentColor\" className=\"text-green-400 anet-login-mark-node-b\" />\n <circle cx=\"22\" cy=\"20\" r=\"3\" fill=\"currentColor\" className=\"text-violet-400 anet-login-mark-node-c\" />\n </svg>\n </div>\n <h1 className=\"text-[22px] sm:text-2xl font-semibold text-white tracking-tight\">Agent Network</h1>\n <p className=\"text-[13px] text-gray-400 mt-1.5 leading-snug\">\n {mode === 'login'\n ? <>Welcome back · <span className=\"text-gray-500\">Tasks · Mesh · Messages</span></>\n : <>Create your account · <span className=\"text-gray-500\">Free preview · no credit card</span></>}\n </p>\n </div>\n\n {/* Mode toggle */}\n <div className=\"flex rounded-lg border border-[#26262b] bg-[#161618] p-1 mb-4\">\n {(['login', 'register'] as const).map(m => (\n <button key={m} type=\"button\" onClick={() => { setMode(m); setError(''); }}\n className={`flex-1 rounded-md px-3 py-2 text-sm transition-colors ${mode === m ? 'bg-cyan-500/10 text-cyan-300' : 'text-gray-500 hover:text-gray-200'}`}>\n {m === 'login' ? 'Sign in' : 'Register'}\n </button>\n ))}\n </div>\n\n <form onSubmit={submit} className=\"border border-[#26262b] bg-[#161618]/80 backdrop-blur-sm rounded-xl p-6 shadow-2xl shadow-black/30\">\n <label htmlFor=\"username\" className=\"block text-xs text-gray-500 mb-2 uppercase tracking-wider\">\n Username\n </label>\n <input id=\"username\" type=\"text\" value={username} onChange={e => setUsername(e.target.value)} autoFocus\n placeholder=\"Enter username\"\n className=\"w-full bg-[#0e0e10] border border-[#26262b] rounded-lg px-4 py-3 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all mb-4\" />\n\n <label htmlFor=\"password\" className=\"block text-xs text-gray-500 mb-2 uppercase tracking-wider\">\n Password\n </label>\n <div className=\"relative\">\n <input id=\"password\" type={showPassword ? 'text' : 'password'} value={password} onChange={e => setPassword(e.target.value)}\n placeholder=\"Enter password\"\n className=\"w-full bg-[#0e0e10] border border-[#26262b] rounded-lg px-4 pr-11 py-3 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all\" />\n <button\n type=\"button\"\n onClick={() => setShowPassword(s => !s)}\n tabIndex={-1}\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n className=\"absolute inset-y-0 right-0 flex items-center justify-center min-w-[44px] px-3 text-gray-600 hover:text-gray-300 transition-colors\"\n >\n {showPassword ? (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" />\n </svg>\n ) : (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n )}\n </button>\n </div>\n\n {error && (\n <div className=\"mt-3 text-sm text-red-300 bg-red-500/5 border border-red-500/10 rounded-lg px-3 py-2\">{error}</div>\n )}\n\n <button type=\"submit\" disabled={pending || !password || !username.trim()}\n className=\"mt-5 w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-lg transition-all shadow-lg shadow-cyan-500/10 hover:shadow-cyan-500/20 disabled:shadow-none\">\n {pending && (\n <svg aria-hidden className=\"w-4 h-4 animate-spin\" viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"3\" opacity=\"0.25\" />\n <path d=\"M4 12a8 8 0 018-8\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" />\n </svg>\n )}\n <span>{pending ? (mode === 'login' ? 'Signing in…' : 'Registering…') : (mode === 'login' ? 'Sign in' : 'Create account')}</span>\n </button>\n </form>\n\n <p className=\"text-center text-[11px] text-gray-700 mt-6\">\n Sleep2AGI · Apache-2.0 · <a href=\"https://anet.sh\" className=\"hover:text-gray-500 transition-colors\">anet.sh</a>\n <span className=\"mx-1 text-gray-800\">·</span>\n <span className=\"font-mono\" title=\"@sleep2agi/agent-network-dashboard\">v{DASHBOARD_VERSION}</span>\n </p>\n </div>\n </main>\n );\n}\n"],"names":["LoginPage","mode","setMode","username","setUsername","password","setPassword","showPassword","setShowPassword","error","setError","pending","setPending","submit","event","preventDefault","res","fetch","method","headers","body","JSON","stringify","action","data","json","ok","token","sessionStorage","setItem","user","networks","currentNetwork","network_id","window","location","assign","className","viewBox","cx","cy","r","fill","stroke","strokeWidth","opacity","x1","y1","x2","y2","map","m","type","onClick","onSubmit","htmlFor","id","value","onChange","e","target","autoFocus","placeholder","s","tabIndex","width","height","strokeLinecap","strokeLinejoin","d","disabled","trim","href","title"],"mappings":"kEACsE,mEECtE,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,wBAEe,SAASA,EACtB,GAAM,CAACC,EAAMC,EAAQ,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAuB,SACjD,CAACC,EAAUC,EAAY,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,IACnC,CAACC,EAAUC,EAAY,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,IACnC,CAACC,EAAcC,EAAgB,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,GAAC,GAC3C,CAACC,EAAOC,EAAS,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,IAC7B,CAACC,EAASC,EAAW,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,GAAC,GAEjCC,EAAS,MAAOC,IACpBA,EAAMC,cAAc,GACpBH,GAAW,GACXF,EAAS,IAET,GAAI,CACF,IAAMM,EAAM,MAAMC,MAAM,eAAgB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CAAEmC,KAAK,kBAAkBnC,UAAU,iDAAwC,YACrG,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAKA,UAAU,8BAAqB,MACrC,CAAA,EAAA,EAAA,IAAA,EAAC,OAAA,CAAKA,UAAU,YAAYoC,MAAM,+CAAqC,IAAE,EAAA,iBAAiB,YAKpG"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[74936,a=>{"use strict";var b=a.i(70844),c=a.i(17422);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,keepPreviousData:!0});return{messages:h?.messages||[],error:i,isLoading:j}},"useNodeLifecycle",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h}=(0,b.default)(f("/api/hub/nodes",a),d,e),i={},j={};for(let a of g?.nodes??[])a.alias&&"string"==typeof a.lifecycle_state&&(i[a.alias]=a.lifecycle_state),a.alias&&"string"==typeof a.node_id&&(j[a.alias]=a.node_id);return{lifecycleByAlias:i,nodeIdByAlias:j,error:h}},"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}}])},71421,a=>{"use strict";a.s(["DASHBOARD_VERSION",0,"0.6.3-preview.38"],71421)},8394,a=>{"use strict";var b=a.i(79913),c=a.i(26600),d=a.i(84117),e=a.i(74936),f=a.i(59333),g=a.i(71421);a.s(["default",0,function(){let{config:a}=(0,e.useAnetConfig)(),{health:h,error:i}=(0,e.useHealth)(),[j,k]=(0,c.useState)(()=>"cyber"),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),r="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",s="break-all sm:max-w-[320px] sm:text-right";return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0b0b0d] text-gray-100 p-4 sm:p-6",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:"#appearance",label:"Appearance"},{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-[#26262b] bg-[#0e0e10]/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:"appearance",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:"Appearance"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#26262b]"})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Theme"}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-3",children:[{id:"cyber",label:"Dark",swatch:"#0b0b0d"},{id:"light",label:"Light",swatch:"#f6f7f9"},{id:"slack",label:"Slack",swatch:"#3f0e40"}].map(a=>(0,b.jsxs)("button",{onClick:()=>{try{localStorage.setItem("anet-theme",a.id)}catch{}(0,f.applyTheme)(a.id),k(a.id)},"aria-pressed":j===a.id,className:`flex items-center gap-3 rounded-lg border px-4 py-3 text-sm transition-colors ${j===a.id?"border-cyan-500/60 bg-cyan-500/10 text-gray-100":"border-[#26262b] text-gray-400 hover:border-[#3a3a41]"}`,children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"inline-block w-5 h-5 rounded-full border border-black/20 shrink-0",style:{backgroundColor:a.swatch}}),a.label,j===a.id&&(0,b.jsx)("svg",{"aria-hidden":!0,className:"ml-auto w-4 h-4 text-cyan-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,b.jsx)("path",{d:"M20 6 9 17l-5-5"})})]},a.id))})]})]}),(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-[#26262b]"})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:r,children:[(0,b.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,b.jsx)("span",{className:`text-cyan-300 ${s}`,children:a?.hub||"not configured"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:a?.source==="file"?"Local file (~/.anet/config.json)":a?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,b.jsxs)("div",{className:r,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"} ${s}`,children:a?.tokenConfigured?`Configured (${a.tokenPreview})`:"Not configured"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,b.jsx)("span",{className:`${h?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:h?.auth||"--"})]}),a?.error&&(0,b.jsx)("div",{className:"border-t border-[#26262b] pt-3 text-xs text-gray-500",children:a.error}),(i||h?.ok===!1)&&(0,b.jsxs)("div",{className:"border-t border-red-500/20 pt-3 text-xs space-y-1.5",role:"alert",children:[(0,b.jsx)("div",{className:"text-red-300 font-medium",children:"CommHub unreachable — how to recover:"}),(0,b.jsxs)("div",{className:"text-gray-400",children:["1. Check the hub process on the server: ",(0,b.jsx)("code",{className:"font-mono bg-[#0e0e10] border border-[#1c1c1f] rounded px-1.5 py-0.5",children:"anet hub status"})]}),(0,b.jsxs)("div",{className:"text-gray-400",children:["2. Start it if stopped: ",(0,b.jsx)("code",{className:"font-mono bg-[#0e0e10] border border-[#1c1c1f] rounded px-1.5 py-0.5",children:"anet hub start"})]}),(0,b.jsx)("div",{className:"text-gray-400",children:"3. Confirm the Hub URL above matches where the hub actually listens."})]})]})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:h?.version||"--"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:h?.sessions??"--"})]}),(0,b.jsxs)("div",{className:r,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 ${s}`,children:h?.sse_connections??"--"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:h?.uptime?`${Math.floor(h.uptime/3600)}h ${Math.floor(h.uptime%3600/60)}m`:"--"})]})]})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 font-mono ${s}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:g.DASHBOARD_VERSION})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,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-[#26262b]"})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:l,onChange:a=>m(a.target.value),placeholder:"Current password",className:"w-full bg-[#0e0e10] border border-[#26262b] 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:n,onChange:a=>o(a.target.value),placeholder:"New password",className:"w-full bg-[#0e0e10] border border-[#26262b] 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(!l||!n)return;let a=sessionStorage.getItem("anet_v3_auth");if(!a)return void q("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:l,new_password:n})}),d=await c.json();if(q(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}))}m(""),o("")}setTimeout(()=>q(""),5e3)},disabled:!l||!n,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),p&&(0,b.jsx)("div",{className:`mt-2 text-xs ${p.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:p})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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-[#1c1c1f] text-gray-300 text-sm rounded-lg border border-[#26262b] hover:border-[#3a3a41] 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-[#26262b]"})]}),(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-[#161618] border border-[#26262b] 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-[#161618] border border-[#26262b] 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:"/settings/providers",className:"bg-[#161618] border border-[#26262b] 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:"Model Providers"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Configure model providers and per-server reachability."}),(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-[#161618] border border-[#26262b] 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-[#161618] border border-[#26262b] 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-[#161618] border border-[#26262b] 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=[74936,a=>{"use strict";var b=a.i(70844),c=a.i(17422);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,keepPreviousData:!0});return{messages:h?.messages||[],error:i,isLoading:j}},"useNodeLifecycle",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h}=(0,b.default)(f("/api/hub/nodes",a),d,e),i={},j={};for(let a of g?.nodes??[])a.alias&&"string"==typeof a.lifecycle_state&&(i[a.alias]=a.lifecycle_state),a.alias&&"string"==typeof a.node_id&&(j[a.alias]=a.node_id);return{lifecycleByAlias:i,nodeIdByAlias:j,error:h}},"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}}])},71421,a=>{"use strict";a.s(["DASHBOARD_VERSION",0,"0.6.3-preview.39"],71421)},8394,a=>{"use strict";var b=a.i(79913),c=a.i(26600),d=a.i(84117),e=a.i(74936),f=a.i(59333),g=a.i(71421);a.s(["default",0,function(){let{config:a}=(0,e.useAnetConfig)(),{health:h,error:i}=(0,e.useHealth)(),[j,k]=(0,c.useState)(()=>"cyber"),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),r="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",s="break-all sm:max-w-[320px] sm:text-right";return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0b0b0d] text-gray-100 p-4 sm:p-6",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:"#appearance",label:"Appearance"},{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-[#26262b] bg-[#0e0e10]/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:"appearance",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:"Appearance"}),(0,b.jsx)("div",{className:"flex-1 h-px bg-[#26262b]"})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] rounded-xl p-5",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Theme"}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-3",children:[{id:"cyber",label:"Dark",swatch:"#0b0b0d"},{id:"light",label:"Light",swatch:"#f6f7f9"},{id:"slack",label:"Slack",swatch:"#3f0e40"}].map(a=>(0,b.jsxs)("button",{onClick:()=>{try{localStorage.setItem("anet-theme",a.id)}catch{}(0,f.applyTheme)(a.id),k(a.id)},"aria-pressed":j===a.id,className:`flex items-center gap-3 rounded-lg border px-4 py-3 text-sm transition-colors ${j===a.id?"border-cyan-500/60 bg-cyan-500/10 text-gray-100":"border-[#26262b] text-gray-400 hover:border-[#3a3a41]"}`,children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"inline-block w-5 h-5 rounded-full border border-black/20 shrink-0",style:{backgroundColor:a.swatch}}),a.label,j===a.id&&(0,b.jsx)("svg",{"aria-hidden":!0,className:"ml-auto w-4 h-4 text-cyan-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,b.jsx)("path",{d:"M20 6 9 17l-5-5"})})]},a.id))})]})]}),(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-[#26262b]"})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:r,children:[(0,b.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,b.jsx)("span",{className:`text-cyan-300 ${s}`,children:a?.hub||"not configured"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:a?.source==="file"?"Local file (~/.anet/config.json)":a?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,b.jsxs)("div",{className:r,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"} ${s}`,children:a?.tokenConfigured?`Configured (${a.tokenPreview})`:"Not configured"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,b.jsx)("span",{className:`${h?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:h?.auth||"--"})]}),a?.error&&(0,b.jsx)("div",{className:"border-t border-[#26262b] pt-3 text-xs text-gray-500",children:a.error}),(i||h?.ok===!1)&&(0,b.jsxs)("div",{className:"border-t border-red-500/20 pt-3 text-xs space-y-1.5",role:"alert",children:[(0,b.jsx)("div",{className:"text-red-300 font-medium",children:"CommHub unreachable — how to recover:"}),(0,b.jsxs)("div",{className:"text-gray-400",children:["1. Check the hub process on the server: ",(0,b.jsx)("code",{className:"font-mono bg-[#0e0e10] border border-[#1c1c1f] rounded px-1.5 py-0.5",children:"anet hub status"})]}),(0,b.jsxs)("div",{className:"text-gray-400",children:["2. Start it if stopped: ",(0,b.jsx)("code",{className:"font-mono bg-[#0e0e10] border border-[#1c1c1f] rounded px-1.5 py-0.5",children:"anet hub start"})]}),(0,b.jsx)("div",{className:"text-gray-400",children:"3. Confirm the Hub URL above matches where the hub actually listens."})]})]})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:h?.version||"--"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:h?.sessions??"--"})]}),(0,b.jsxs)("div",{className:r,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 ${s}`,children:h?.sse_connections??"--"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:h?.uptime?`${Math.floor(h.uptime/3600)}h ${Math.floor(h.uptime%3600/60)}m`:"--"})]})]})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,b.jsx)("span",{className:`text-gray-300 font-mono ${s}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:g.DASHBOARD_VERSION})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,b.jsxs)("div",{className:r,children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,b.jsx)("span",{className:`text-gray-300 ${s}`,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-[#26262b]"})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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:l,onChange:a=>m(a.target.value),placeholder:"Current password",className:"w-full bg-[#0e0e10] border border-[#26262b] 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:n,onChange:a=>o(a.target.value),placeholder:"New password",className:"w-full bg-[#0e0e10] border border-[#26262b] 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(!l||!n)return;let a=sessionStorage.getItem("anet_v3_auth");if(!a)return void q("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:l,new_password:n})}),d=await c.json();if(q(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}))}m(""),o("")}setTimeout(()=>q(""),5e3)},disabled:!l||!n,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),p&&(0,b.jsx)("div",{className:`mt-2 text-xs ${p.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:p})]}),(0,b.jsxs)("section",{className:"bg-[#161618] border border-[#26262b] 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-[#1c1c1f] text-gray-300 text-sm rounded-lg border border-[#26262b] hover:border-[#3a3a41] 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-[#26262b]"})]}),(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-[#161618] border border-[#26262b] 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-[#161618] border border-[#26262b] 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:"/settings/providers",className:"bg-[#161618] border border-[#26262b] 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:"Model Providers"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Configure model providers and per-server reachability."}),(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-[#161618] border border-[#26262b] 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-[#161618] border border-[#26262b] 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-[#161618] border border-[#26262b] 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=0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0~ejwde._.js.map
|