@sleep2agi/agent-network-dashboard 0.6.3-preview.1 → 0.6.3-preview.10
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/app-path-routes-manifest.json +5 -0
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.previewinfo +1 -0
- package/.next/cache/.rscinfo +1 -0
- package/.next/diagnostics/route-bundle-stats.json +56 -39
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +27 -3
- package/.next/routes-manifest.json +30 -0
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +13 -13
- package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin.html +2 -2
- package/.next/server/app/admin.rsc +15 -15
- package/.next/server/app/admin.segments/_full.segment.rsc +15 -15
- package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
- package/.next/server/app/admin.segments/_index.segment.rsc +8 -8
- package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
- package/.next/server/app/api/anet/host-supervisors/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/anet/host-supervisors/route/build-manifest.json +9 -0
- package/.next/server/app/api/anet/host-supervisors/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/anet/host-supervisors/route.js +7 -0
- package/.next/server/app/api/anet/host-supervisors/route.js.map +5 -0
- package/.next/server/app/api/anet/host-supervisors/route.js.nft.json +1 -0
- package/.next/server/app/api/anet/host-supervisors/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/anet/providers/probe/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/anet/providers/probe/route/build-manifest.json +9 -0
- package/.next/server/app/api/anet/providers/probe/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/anet/providers/probe/route.js +7 -0
- package/.next/server/app/api/anet/providers/probe/route.js.map +5 -0
- package/.next/server/app/api/anet/providers/probe/route.js.nft.json +1 -0
- package/.next/server/app/api/anet/providers/probe/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/anet/providers/probe-results/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/anet/providers/probe-results/route/build-manifest.json +9 -0
- package/.next/server/app/api/anet/providers/probe-results/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/anet/providers/probe-results/route.js +7 -0
- package/.next/server/app/api/anet/providers/probe-results/route.js.map +5 -0
- package/.next/server/app/api/anet/providers/probe-results/route.js.nft.json +1 -0
- package/.next/server/app/api/anet/providers/probe-results/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/anet/providers/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/anet/providers/route/build-manifest.json +9 -0
- package/.next/server/app/api/anet/providers/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/anet/providers/route.js +8 -0
- package/.next/server/app/api/anet/providers/route.js.map +5 -0
- package/.next/server/app/api/anet/providers/route.js.nft.json +1 -0
- package/.next/server/app/api/anet/providers/route_client-reference-manifest.js +3 -0
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +15 -15
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +8 -8
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +2 -2
- package/.next/server/app/login.rsc +15 -15
- package/.next/server/app/login.segments/_full.segment.rsc +15 -15
- package/.next/server/app/login.segments/_head.segment.rsc +4 -4
- package/.next/server/app/login.segments/_index.segment.rsc +8 -8
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/login.segments/login.segment.rsc +3 -3
- package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/logs.html +2 -2
- package/.next/server/app/logs.rsc +15 -15
- package/.next/server/app/logs.segments/_full.segment.rsc +15 -15
- package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/logs.segments/_index.segment.rsc +8 -8
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
- package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
- package/.next/server/app/messages.html +2 -2
- package/.next/server/app/messages.rsc +15 -15
- package/.next/server/app/messages.segments/_full.segment.rsc +15 -15
- package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
- package/.next/server/app/messages.segments/_index.segment.rsc +8 -8
- package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
- package/.next/server/app/node/page_client-reference-manifest.js +1 -1
- package/.next/server/app/node.html +2 -2
- package/.next/server/app/node.rsc +15 -15
- package/.next/server/app/node.segments/_full.segment.rsc +15 -15
- package/.next/server/app/node.segments/_head.segment.rsc +4 -4
- package/.next/server/app/node.segments/_index.segment.rsc +8 -8
- package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/node.segments/node.segment.rsc +3 -3
- package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/nodes.html +2 -2
- package/.next/server/app/nodes.rsc +15 -15
- package/.next/server/app/nodes.segments/_full.segment.rsc +15 -15
- package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/_index.segment.rsc +8 -8
- package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/providers/page/app-paths-manifest.json +3 -0
- package/.next/server/app/providers/page/build-manifest.json +17 -0
- package/.next/server/app/providers/page/next-font-manifest.json +11 -0
- package/.next/server/app/providers/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/providers/page/server-reference-manifest.json +4 -0
- package/.next/server/app/providers/page.js +14 -0
- package/.next/server/app/providers/page.js.map +5 -0
- package/.next/server/app/providers/page.js.nft.json +1 -0
- package/.next/server/app/providers/page_client-reference-manifest.js +3 -0
- package/.next/server/app/providers.html +12 -0
- package/.next/server/app/providers.meta +15 -0
- package/.next/server/app/providers.rsc +27 -0
- package/.next/server/app/providers.segments/_full.segment.rsc +27 -0
- package/.next/server/app/providers.segments/_head.segment.rsc +6 -0
- package/.next/server/app/providers.segments/_index.segment.rsc +10 -0
- package/.next/server/app/providers.segments/_tree.segment.rsc +5 -0
- package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/providers.segments/providers.segment.rsc +5 -0
- package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs.html +2 -2
- package/.next/server/app/server-logs.rsc +15 -15
- package/.next/server/app/server-logs.segments/_full.segment.rsc +15 -15
- package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/_index.segment.rsc +8 -8
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
- package/.next/server/app/servers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/servers.html +2 -2
- package/.next/server/app/servers.rsc +15 -15
- package/.next/server/app/servers.segments/_full.segment.rsc +15 -15
- package/.next/server/app/servers.segments/_head.segment.rsc +4 -4
- package/.next/server/app/servers.segments/_index.segment.rsc +8 -8
- package/.next/server/app/servers.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/servers.segments/servers/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/servers.segments/servers.segment.rsc +3 -3
- package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/networks.html +2 -2
- package/.next/server/app/settings/networks.rsc +15 -15
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +15 -15
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
- package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens.html +2 -2
- package/.next/server/app/settings/tokens.rsc +15 -15
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +15 -15
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
- package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings.html +2 -2
- package/.next/server/app/settings.rsc +15 -15
- package/.next/server/app/settings.segments/_full.segment.rsc +15 -15
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks.html +2 -2
- package/.next/server/app/tasks.rsc +15 -15
- package/.next/server/app/tasks.segments/_full.segment.rsc +15 -15
- package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/_index.segment.rsc +8 -8
- package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
- package/.next/server/app-paths-manifest.json +5 -0
- package/.next/server/chunks/00jm_next_dist_esm_build_templates_app-route_0bobkt3.js +3 -0
- package/.next/server/chunks/00jm_next_dist_esm_build_templates_app-route_0bobkt3.js.map +1 -0
- package/.next/server/chunks/0dk5_next-internal_server_app_api_anet_providers_probe-results_route_actions_07.d.5a.js +3 -0
- package/.next/server/chunks/0dk5_next-internal_server_app_api_anet_providers_probe-results_route_actions_07.d.5a.js.map +1 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_anet_host-supervisors_route_actions_0g3hek2.js +3 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_anet_host-supervisors_route_actions_0g3hek2.js.map +1 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_anet_providers_probe_route_actions_05f000..js +3 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_anet_providers_probe_route_actions_05f000..js.map +1 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_anet_providers_route_actions_10htbhd.js +3 -0
- package/.next/server/chunks/0ykm__next-internal_server_app_api_anet_providers_route_actions_10htbhd.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0-29ynz._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0-2le8-._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0-8_f0o._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__02p2n3n._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__03nze3z._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__03nze3z._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__043tnx2._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__04z62zk._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__07ztet2._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0aqb4n5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0aqb4n5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0cphmer._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0cphmer._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0e3ucl1._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0e6yail._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0gx2_6a._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0hg3_8r._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0lhq4ha._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mkwzz7._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mkwzz7._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mxw4vb._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mzopco._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0o45a4q._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0w1w_w0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0w1w_w0._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0xtp-et._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0yyo7k5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0yyo7k5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0~rwgo1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0~rwgo1._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__10pvabe._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__10t11zq._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__12r~omy._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__1389~cs._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__13n8t..._.js.map +1 -1
- package/.next/server/chunks/ssr/00jm_next_dist_esm_build_templates_app-page_02lorbl.js +4 -0
- package/.next/server/chunks/ssr/00jm_next_dist_esm_build_templates_app-page_02lorbl.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__030vg4n._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__04mx~5g._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__04mx~5g._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__05kf31s._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__05kf31s._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__096ytyk._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0h5dae6._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0h5dae6._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js +3 -3
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard__next-internal_server_app_providers_page_actions_0ou6p43.js +3 -0
- package/.next/server/chunks/ssr/agent-network-dashboard__next-internal_server_app_providers_page_actions_0ou6p43.js.map +1 -0
- package/.next/server/chunks/ssr/agent-network-dashboard_app_012oyw5._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_012oyw5._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0gd.4pc._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_0gd.4pc._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0r7kb.o._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0r7kb.o._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_EmptyState_tsx_0aol-el._.js +3 -0
- package/.next/server/chunks/ssr/agent-network-dashboard_app_components_EmptyState_tsx_0aol-el._.js.map +1 -0
- package/.next/server/chunks/ssr/agent-network-dashboard_app_nodes_page_tsx_11haf_p._.js +2 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_nodes_page_tsx_11haf_p._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_providers_page_tsx_0hw2n0v._.js +3 -0
- package/.next/server/chunks/ssr/agent-network-dashboard_app_providers_page_tsx_0hw2n0v._.js.map +1 -0
- package/.next/server/chunks/ssr/agent-network-dashboard_app_tasks_page_tsx_0mwxy4z._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +4 -0
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{10kkhdde5ve~c.js → 0-z_kfck7-6_1.js} +3 -3
- package/.next/static/chunks/049vx3qljs1tt.js +1 -0
- package/.next/static/chunks/06.5euf239uvr.css +1 -0
- package/.next/static/chunks/{0vun~4ljcrj3p.js → 091hae.lhv9t1.js} +2 -2
- package/.next/static/chunks/0chpv7zsh-qrg.js +1 -0
- package/.next/static/chunks/0i-l67o_ae5hk.js +2 -0
- package/.next/static/chunks/{0vus9xpsz0s~i.js → 0l.gu-iqnmeja.js} +1 -1
- package/.next/static/chunks/{149a4l50_3vw-.js → 0mnmn-~ava1vy.js} +1 -1
- package/.next/static/chunks/0o-b62_a66.jr.js +1 -0
- package/.next/static/chunks/0pk6amtz5icbx.js +1 -0
- package/.next/static/chunks/0r4u1.sl.8p15.js +1 -0
- package/.next/static/chunks/0wz0122ym_gr3.js +1 -0
- package/.next/static/chunks/15aqdc5txzq9r.js +1 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/.next/types/routes.d.ts +7 -2
- package/.next/types/validator.ts +45 -0
- package/app/admin/page.tsx +3 -1
- package/app/api/anet/host-supervisors/route.ts +102 -0
- package/app/api/anet/node-config/route.ts +26 -2
- package/app/api/anet/node-create/route.ts +14 -5
- package/app/api/anet/node-lifecycle/route.ts +54 -5
- package/app/api/anet/providers/probe/route.ts +79 -0
- package/app/api/anet/providers/probe-results/route.ts +60 -0
- package/app/api/anet/providers/route.ts +191 -0
- package/app/api/hub/auth/route.ts +0 -12
- package/app/api/hub/networks/route.ts +1 -1
- package/app/api/hub/nodes/route.ts +0 -14
- package/app/api/hub/upload/route.ts +0 -9
- package/app/components/CommandCenter.tsx +3 -6
- package/app/components/CommandPalette.tsx +0 -5
- package/app/components/CreateNodeWizard.tsx +140 -47
- package/app/components/HostSupervisorPicker.tsx +283 -0
- package/app/components/NodeLifecycleMenu.tsx +436 -0
- package/app/components/NodeSettingsPanel.tsx +80 -39
- package/app/components/ProviderFormModal.tsx +303 -0
- package/app/components/ReachabilityMatrix.tsx +196 -0
- package/app/components/Sidebar.tsx +1 -0
- package/app/components/TaskDrawer.tsx +1 -0
- package/app/components/TopoGraph.tsx +4 -8
- package/app/components/UserBar.tsx +37 -0
- package/app/components/types.ts +11 -0
- package/app/lib/chat-unread.ts +0 -6
- package/app/lib/dashboard-auth.ts +0 -12
- package/app/lib/hooks.ts +22 -4
- package/app/lib/hub.ts +4 -0
- package/app/lib/network-context.tsx +0 -6
- package/app/lib/rate-limit.ts +2 -16
- package/app/node/page.tsx +12 -1
- package/app/nodes/page.tsx +42 -2
- package/app/page.tsx +1 -0
- package/app/providers/page.tsx +182 -0
- package/app/settings/networks/page.tsx +1 -1
- package/app/settings/page.tsx +5 -0
- package/app/tasks/[id]/page.tsx +1 -0
- package/app/tasks/page.tsx +1 -0
- package/package.json +1 -1
- package/.next/static/chunks/0-t2rbg9~-oh5.js +0 -1
- package/.next/static/chunks/0iv.0p9_5b36e.js +0 -1
- package/.next/static/chunks/0l_hz3xrjwumg.js +0 -1
- package/.next/static/chunks/0lmdw~i5qjqsg.js +0 -1
- package/.next/static/chunks/0vruzstkdr99w.js +0 -1
- package/.next/static/chunks/0xssg9sin~2xw.js +0 -1
- package/.next/static/chunks/124dtwo1k24ao.css +0 -1
- package/bun.lock +0 -1663
- /package/.next/static/{ZxdmFd_iOEELuA2Km4Q5t → tRPXkJdGLR6a0skqvMgQa}/_buildManifest.js +0 -0
- /package/.next/static/{ZxdmFd_iOEELuA2Km4Q5t → tRPXkJdGLR6a0skqvMgQa}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{ZxdmFd_iOEELuA2Km4Q5t → tRPXkJdGLR6a0skqvMgQa}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},98319,e=>{"use strict";var t=e.i(76631);function r(){return process.env.COMMHUB_URL||"http://127.0.0.1:9200"}async function n(e,n){let a=`${r()}${e}`,o={},s=n?.headers;if(!s?.Authorization)try{let e=await (0,t.getV3UserToken)();e&&(o={Authorization:`Bearer ${e}`})}catch{}return fetch(a,{...n,headers:{...o,...n?.headers},next:{revalidate:0}})}r(),e.s(["hubFetch",0,n])},65514,e=>{"use strict";var t=e.i(29124),r=e.i(96565),n=e.i(29718),a=e.i(23850),o=e.i(47878),s=e.i(19885),i=e.i(86384),l=e.i(90127),d=e.i(89548),u=e.i(23489),p=e.i(53565),c=e.i(25859),h=e.i(37031),f=e.i(34816),g=e.i(37020),R=e.i(93695);e.i(69409);var x=e.i(56394),m=e.i(76631),v=e.i(98319);let w=["permissionMode","dangerouslySkipPermissions","teammateMode","maxTurns","budget","timeout"];function y(e){return(e.headers.get("content-type")||"").includes("application/json")}async function E(e){let t=await (0,m.requireDashboardAuth)();if(t)return t;let{searchParams:r}=new URL(e.url),n=r.get("apply_id");if(n)try{let e=await (0,v.hubFetch)(`/api/nodes/config/apply/${encodeURIComponent(n)}`);if(e.ok&&y(e))return Response.json(await e.json());return Response.json({ok:!0,mock:!0,applyId:n,status:"pending"})}catch(e){return Response.json({ok:!0,mock:!0,applyId:n,status:"pending",_hubError:e instanceof Error?e.message:String(e)})}let a=r.get("node_id")||r.get("alias")||"";if(!a)return Response.json({error:"node_id or alias required"},{status:400});try{let e=await (0,v.hubFetch)(`/api/nodes/${encodeURIComponent(a)}/config`);if(e.ok&&y(e))return Response.json(await e.json());return Response.json({ok:!0,mock:!0,node_id:a,model:null,flags:{}})}catch(e){return Response.json({ok:!0,mock:!0,node_id:a,model:null,flags:{},_hubError:e instanceof Error?e.message:String(e)})}}async function b(e){let t,r=await (0,m.requireDashboardAuth)();if(r)return r;try{t=await e.json()}catch{return Response.json({error:"invalid JSON body"},{status:400})}let n=t.node_id||t.alias;if(!n)return Response.json({error:"node_id or alias required"},{status:400});let a={};if(t.flags&&"object"==typeof t.flags)for(let e of w)e in t.flags&&void 0!==t.flags[e]&&(a[e]=t.flags[e]);let o={node_id:n,...void 0!==t.model?{model:t.model}:{},flags:a};try{let e=await (0,v.hubFetch)("/api/nodes/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(e.ok&&y(e))return Response.json(await e.json());if(404===e.status||501===e.status)return Response.json({ok:!0,mock:!0,applied:!1,status:"pending",applyId:`mock-${n}`,node_id:n,echo:o});return Response.json({ok:!1,error:`hub ${e.status}`,status:e.status},{status:502})}catch(e){return Response.json({ok:!0,mock:!0,applied:!1,status:"pending",applyId:`mock-${n}`,node_id:n,echo:o,_hubError:e instanceof Error?e.message:String(e)})}}e.s(["GET",0,E,"POST",0,b],9396);var k=e.i(9396);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/anet/node-config/route",pathname:"/api/anet/node-config",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/agent-network-dashboard/app/api/anet/node-config/route.ts",nextConfigOutput:"",userland:k,...{}}),{workAsyncStorage:j,workUnitAsyncStorage:_,serverHooks:A}=C;async function T(e,t,n){n.requestMeta&&(0,a.setRequestMeta)(e,n.requestMeta),C.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/anet/node-config/route";m=m.replace(/\/index$/,"")||"/";let v=await C.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:E,parsedUrl:b,isDraftMode:k,prerenderManifest:j,routerServerContext:_,isOnDemandRevalidate:A,revalidateOnlyGenerated:T,resolvedPathname:S,clientReferenceManifest:q,serverActionsManifest:N}=v,P=(0,i.normalizeAppPath)(m),O=!!(j.dynamicRoutes[P]||j.routes[S]),U=async()=>((null==_?void 0:_.render404)?await _.render404(e,t,b,!1):t.end("This page could not be found"),null);if(O&&!k){let e=!!j.routes[S],t=j.dynamicRoutes[P];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await U();throw new R.NoFallbackError}}let I=null;!O||C.isDev||k||(I="/index"===(I=S)?"/":I);let M=!0===C.isDev||!O,H=O&&!M;N&&q&&(0,s.setManifestsSingleton)({page:m,clientReferenceManifest:q,serverActionsManifest:N});let $=e.method||"GET",D=(0,o.getTracer)(),F=D.getActiveScopeSpan(),B=!!(null==_?void 0:_.isWrappedByNextServer),K=!!(0,a.getRequestMeta)(e,"minimalMode"),L=(0,a.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,E,j,K);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let G={params:y,previewProps:j.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:M,incrementalCache:L,cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>C.onRequestError(e,t,n,a,_)},sharedContext:{buildId:w}},V=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(V,(0,d.signalFromNodeResponse)(t));try{let a,s=async e=>C.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=D.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${$} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",n),a.updateName(t))}else e.updateName(`${$} ${m}`)}),i=async a=>{var o,i;let l=async({previousCacheEntry:r})=>{try{if(!K&&A&&T&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await s(a);e.fetchMetrics=G.renderOpts.fetchMetrics;let i=G.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let l=G.renderOpts.collectedTags;if(!O)return await (0,c.sendResponse)(V,z,o,G.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);l&&(t[g.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:A})},!1,_),t}},d=await C.handleResponse({req:e,nextConfig:E,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:j,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:T,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:K});if(!O)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",A?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return K&&O||u.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,f.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(V,z,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};B&&F?await i(F):(a=D.getActiveScopeSpan(),await D.withPropagatedContext(e.headers,()=>D.trace(u.BaseServerSpan.handleRequest,{spanName:`${$} ${m}`,kind:o.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},i),void 0,!B))}catch(t){if(t instanceof R.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:P,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:A})},!1,_),O)throw t;return await (0,c.sendResponse)(V,z,new Response(null,{status:500})),null}}e.s(["handler",0,T,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:_})},"routeModule",0,C,"serverHooks",0,A,"workAsyncStorage",0,j,"workUnitAsyncStorage",0,_],65514)}];
|
|
1
|
+
module.exports=[50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},98319,e=>{"use strict";var t=e.i(76631);function r(){return process.env.COMMHUB_URL||"http://127.0.0.1:9200"}async function n(e,n){let a=`${r()}${e}`,o={},s=n?.headers;if(!s?.Authorization)try{let e=await (0,t.getV3UserToken)();e&&(o={Authorization:`Bearer ${e}`})}catch{}return fetch(a,{...n,headers:{...o,...n?.headers},next:{revalidate:0}})}r(),e.s(["hubFetch",0,n])},65514,e=>{"use strict";var t=e.i(29124),r=e.i(96565),n=e.i(29718),a=e.i(23850),o=e.i(47878),s=e.i(19885),i=e.i(86384),l=e.i(90127),d=e.i(89548),u=e.i(23489),p=e.i(53565),c=e.i(25859),h=e.i(37031),f=e.i(34816),g=e.i(37020),R=e.i(93695);e.i(69409);var m=e.i(56394),x=e.i(76631),v=e.i(98319);let w=["permissionMode","dangerouslySkipPermissions","teammateMode","maxTurns","budget","timeout"],y=["telegram","feishu","commhub"];function E(e){return(e.headers.get("content-type")||"").includes("application/json")}async function b(e){let t=await (0,x.requireDashboardAuth)();if(t)return t;let{searchParams:r}=new URL(e.url),n=r.get("apply_id");if(n)try{let e=await (0,v.hubFetch)(`/api/nodes/config/apply/${encodeURIComponent(n)}`);if(e.ok&&E(e))return Response.json(await e.json());return Response.json({ok:!0,mock:!0,applyId:n,status:"pending"})}catch(e){return Response.json({ok:!0,mock:!0,applyId:n,status:"pending",_hubError:e instanceof Error?e.message:String(e)})}let a=r.get("node_id")||r.get("alias")||"";if(!a)return Response.json({error:"node_id or alias required"},{status:400});try{let e=await (0,v.hubFetch)(`/api/nodes/${encodeURIComponent(a)}/config`);if(e.ok&&E(e))return Response.json(await e.json());return Response.json({ok:!0,mock:!0,node_id:a,model:null,flags:{},channels:[]})}catch(e){return Response.json({ok:!0,mock:!0,node_id:a,model:null,flags:{},channels:[],_hubError:e instanceof Error?e.message:String(e)})}}async function k(e){let t,r,n=await (0,x.requireDashboardAuth)();if(n)return n;try{t=await e.json()}catch{return Response.json({error:"invalid JSON body"},{status:400})}let a=t.node_id||t.alias;if(!a)return Response.json({error:"node_id or alias required"},{status:400});let o={};if(t.flags&&"object"==typeof t.flags)for(let e of w)e in t.flags&&void 0!==t.flags[e]&&(o[e]=t.flags[e]);if(Array.isArray(t.channels)){let e=new Set(y),n=new Set;for(let a of(r=[],t.channels)){if("string"!=typeof a)continue;let t=a.trim().toLowerCase();!e.has(t)||n.has(t)||(n.add(t),r.push(t))}}let s={node_id:a,...void 0!==t.model?{model:t.model}:{},flags:o,...void 0!==r?{channels:r}:{}};try{let e=await (0,v.hubFetch)("/api/nodes/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(e.ok&&E(e))return Response.json(await e.json());if(404===e.status||501===e.status)return Response.json({ok:!0,mock:!0,applied:!1,status:"pending",applyId:`mock-${a}`,node_id:a,echo:s});return Response.json({ok:!1,error:`hub ${e.status}`,status:e.status},{status:502})}catch(e){return Response.json({ok:!0,mock:!0,applied:!1,status:"pending",applyId:`mock-${a}`,node_id:a,echo:s,_hubError:e instanceof Error?e.message:String(e)})}}e.s(["GET",0,b,"POST",0,k],9396);var C=e.i(9396);let j=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/anet/node-config/route",pathname:"/api/anet/node-config",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/agent-network-dashboard/app/api/anet/node-config/route.ts",nextConfigOutput:"",userland:C,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:_,serverHooks:S}=j;async function T(e,t,n){n.requestMeta&&(0,a.setRequestMeta)(e,n.requestMeta),j.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/anet/node-config/route";x=x.replace(/\/index$/,"")||"/";let v=await j.prepare(e,t,{srcPage:x,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:E,parsedUrl:b,isDraftMode:k,prerenderManifest:C,routerServerContext:A,isOnDemandRevalidate:_,revalidateOnlyGenerated:S,resolvedPathname:T,clientReferenceManifest:q,serverActionsManifest:N}=v,P=(0,i.normalizeAppPath)(x),O=!!(C.dynamicRoutes[P]||C.routes[T]),U=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,b,!1):t.end("This page could not be found"),null);if(O&&!k){let e=!!C.routes[T],t=C.dynamicRoutes[P];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await U();throw new R.NoFallbackError}}let I=null;!O||j.isDev||k||(I="/index"===(I=T)?"/":I);let M=!0===j.isDev||!O,H=O&&!M;N&&q&&(0,s.setManifestsSingleton)({page:x,clientReferenceManifest:q,serverActionsManifest:N});let $=e.method||"GET",D=(0,o.getTracer)(),F=D.getActiveScopeSpan(),B=!!(null==A?void 0:A.isWrappedByNextServer),K=!!(0,a.getRequestMeta)(e,"minimalMode"),L=(0,a.getRequestMeta)(e,"incrementalCache")||await j.getIncrementalCache(e,E,C,K);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let G={params:y,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:M,incrementalCache:L,cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>j.onRequestError(e,t,n,a,A)},sharedContext:{buildId:w}},V=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(V,(0,d.signalFromNodeResponse)(t));try{let a,s=async e=>j.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=D.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${$} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",n),a.updateName(t))}else e.updateName(`${$} ${x}`)}),i=async a=>{var o,i;let l=async({previousCacheEntry:r})=>{try{if(!K&&_&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await s(a);e.fetchMetrics=G.renderOpts.fetchMetrics;let i=G.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let l=G.renderOpts.collectedTags;if(!O)return await (0,c.sendResponse)(V,z,o,G.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);l&&(t[g.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:_})},!1,A),t}},d=await j.handleResponse({req:e,nextConfig:E,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:_,revalidateOnlyGenerated:S,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:K});if(!O)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",_?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return K&&O||u.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,f.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(V,z,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};B&&F?await i(F):(a=D.getActiveScopeSpan(),await D.withPropagatedContext(e.headers,()=>D.trace(u.BaseServerSpan.handleRequest,{spanName:`${$} ${x}`,kind:o.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},i),void 0,!B))}catch(t){if(t instanceof R.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:P,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:_})},!1,A),O)throw t;return await (0,c.sendResponse)(V,z,new Response(null,{status:500})),null}}e.s(["handler",0,T,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:_})},"routeModule",0,j,"serverHooks",0,S,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,_],65514)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0mkwzz7._.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../agent-network-dashboard/app/lib/hub.ts","../../../../agent-network-dashboard/node_modules/next/dist/esm/build/templates/app-route.js","../../../../agent-network-dashboard/app/api/anet/node-config/route.ts"],"sourcesContent":["import { getV3UserToken } from './dashboard-auth';\n\nfunction getHubUrl() {\n return process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n}\n\nexport const HUB_URL = getHubUrl();\n\n/**\n * Fetch from CommHub. Uses the browser session's V3 user token when available.\n * Dashboard is a thin proxy and does not fall back to a service/master token.\n */\nexport async function hubFetch(path: string, init?: RequestInit): Promise<Response> {\n const url = `${getHubUrl()}${path}`;\n\n // Build auth: prefer V3 token cookie unless caller supplied Authorization.\n let authHeader: Record<string, string> = {};\n\n // Only try V3 token if no Authorization already in init.headers\n const initHeaders = init?.headers as Record<string, string> | undefined;\n if (!initHeaders?.['Authorization']) {\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n authHeader = { 'Authorization': `Bearer ${userToken}` };\n }\n } catch {\n // cookies() not available in this context, ignore\n }\n\n }\n\n return fetch(url, {\n ...init,\n headers: { ...authHeader, ...init?.headers },\n next: { revalidate: 0 },\n } as RequestInit);\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/anet/node-config/route\",\n pathname: \"/api/anet/node-config\",\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]/agent-network-dashboard/app/api/anet/node-config/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/anet/node-config/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","import { requireDashboardAuth } from '@/app/lib/dashboard-auth';\nimport { hubFetch } from '@/app/lib/hub';\n\n/**\n * Per-node config read/write proxy (#260 / #262 v0.11 — make node settings\n * actually work). Thin proxy to the hub, using the browser session's V3 user\n * token (hubFetch):\n * GET ?node_id=…|alias=… → current node config snapshot (model + flags)\n * GET ?apply_id=… → apply-lifecycle status for a prior POST (F3)\n * POST { node_id|alias, model?, flags? } → update_node_config; returns an\n * applyId + status so the UI can poll take-effect.\n *\n * ⚠️ The hub-side tool (update_node_config + config snapshot) is not deployed\n * yet (工程马 WIP, contract under 通信牛 co-review). Until it lands, these calls\n * hit the ASSUMED contract paths below and, when the hub 404/501s or errors,\n * fall back to a clearly-flagged mock (`mock: true`) so the panel can be built\n * and reviewed. Confirm HUB_*_PATH against the finalized contract before\n * integration — they are isolated here so that's a one-line change.\n */\n\nconst HUB_GET_PATH = (nodeId: string) => `/api/nodes/${encodeURIComponent(nodeId)}/config`;\nconst HUB_UPDATE_PATH = '/api/nodes/config'; // POST → hub MCP update_node_config\nconst HUB_APPLY_STATUS_PATH = (applyId: string) => `/api/nodes/config/apply/${encodeURIComponent(applyId)}`;\n\n// Editable flags whitelist (contract per 通信龙). Anything outside this set is\n// dropped before forwarding, so the UI can't smuggle unexpected keys to the hub.\nconst EDITABLE_FLAGS = [\n 'permissionMode',\n 'dangerouslySkipPermissions',\n 'teammateMode',\n 'maxTurns',\n 'budget',\n 'timeout',\n] as const;\n\nfunction isJson(res: Response): boolean {\n return (res.headers.get('content-type') || '').includes('application/json');\n}\n\nexport async function GET(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n const { searchParams } = new URL(req.url);\n\n // F3 apply-lifecycle poll: GET ?apply_id=… returns the take-effect status of\n // a prior POST (status: pending | applied | rejected). When the hub tool\n // isn't deployed it mock-returns `pending` — the client drives its own mock\n // progression in that case, so it never actually polls this path.\n const applyId = searchParams.get('apply_id');\n if (applyId) {\n try {\n const res = await hubFetch(HUB_APPLY_STATUS_PATH(applyId));\n if (res.ok && isJson(res)) return Response.json(await res.json());\n return Response.json({ ok: true, mock: true, applyId, status: 'pending' });\n } catch (e: unknown) {\n return Response.json({\n ok: true,\n mock: true,\n applyId,\n status: 'pending',\n _hubError: e instanceof Error ? e.message : String(e),\n });\n }\n }\n\n const nodeId = searchParams.get('node_id') || searchParams.get('alias') || '';\n if (!nodeId) return Response.json({ error: 'node_id or alias required' }, { status: 400 });\n\n try {\n const res = await hubFetch(HUB_GET_PATH(nodeId));\n if (res.ok && isJson(res)) return Response.json(await res.json());\n // backend not ready (404/501/non-JSON) → flagged empty snapshot so the\n // panel can initialise its form and develop the save flow.\n return Response.json({ ok: true, mock: true, node_id: nodeId, model: null, flags: {} });\n } catch (e: unknown) {\n return Response.json({\n ok: true,\n mock: true,\n node_id: nodeId,\n model: null,\n flags: {},\n _hubError: e instanceof Error ? e.message : String(e),\n });\n }\n}\n\nexport async function POST(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n let body: { node_id?: string; alias?: string; model?: unknown; flags?: Record<string, unknown> };\n try {\n body = await req.json();\n } catch {\n return Response.json({ error: 'invalid JSON body' }, { status: 400 });\n }\n\n const nodeId = body.node_id || body.alias;\n if (!nodeId) return Response.json({ error: 'node_id or alias required' }, { status: 400 });\n\n // Whitelist flags — silently drop anything not in the editable contract.\n const flags: Record<string, unknown> = {};\n if (body.flags && typeof body.flags === 'object') {\n for (const k of EDITABLE_FLAGS) {\n if (k in body.flags && body.flags[k] !== undefined) flags[k] = body.flags[k];\n }\n }\n const payload = {\n node_id: nodeId,\n ...(body.model !== undefined ? { model: body.model } : {}),\n flags,\n };\n\n try {\n const res = await hubFetch(HUB_UPDATE_PATH, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(payload),\n });\n if (res.ok && isJson(res)) return Response.json(await res.json());\n if (res.status === 404 || res.status === 501) {\n // hub tool not deployed yet — flagged mock so the Save + apply flow can\n // develop. `status: pending` + `applyId` let the client run its lifecycle.\n return Response.json({ ok: true, mock: true, applied: false, status: 'pending', applyId: `mock-${nodeId}`, node_id: nodeId, echo: payload });\n }\n return Response.json({ ok: false, error: `hub ${res.status}`, status: res.status }, { status: 502 });\n } catch (e: unknown) {\n return Response.json({\n ok: true,\n mock: true,\n applied: false,\n status: 'pending',\n applyId: `mock-${nodeId}`,\n node_id: nodeId,\n echo: payload,\n _hubError: e instanceof Error ? e.message : String(e),\n });\n }\n}\n"],"names":["getHubUrl","process","env","COMMHUB_URL","HUB_URL","hubFetch","path","init","url","authHeader","initHeaders","headers","userToken","fetch","next","revalidate","HUB_GET_PATH","nodeId","encodeURIComponent","HUB_UPDATE_PATH","HUB_APPLY_STATUS_PATH","applyId","EDITABLE_FLAGS","isJson","res","get","includes","GET","req","authFailure","searchParams","URL","ok","Response","json","mock","status","e","model","_hubError","Error","message","String","error","node_id","flags","body","POST","payload","alias","k","undefined","method","JSON","stringify","applied","echo"],"mappings":"wjCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,SAASA,IACP,OAAOC,QAAQC,GAAG,CAACC,WAAW,EAAI,uBACpC,CAQO,eAAeE,EAASC,CAAY,CAAEC,CAAkB,EAC7D,IAAMC,EAAM,CAAA,EAAGR,IAAAA,EAAcM,EAAAA,CAAM,CAG/BG,EAAqC,CAAC,EAGpCC,EAAcH,GAAMI,QAC1B,GAAI,CAACD,GAAc,UAAD,IAChB,EADiC,CAC7B,CAD+B,AAEjC,IAAME,EAAY,MAAM,CAAA,EAAA,EAAA,cAAA,AAAc,IAClCA,IACFH,EAAa,CAAE,IADF,UACmB,CAAC,OAAO,EAAEG,EAAAA,CAAW,CAAC,CAE1D,CAAE,KAAM,CAER,CAIF,OAAOC,MAAML,EAAK,CAChB,GAAGD,CAAI,CACPI,QAAS,CAAE,GAAGF,CAAU,CAAE,GAAGF,GAAMI,OAAO,AAAC,EAC3CG,KAAM,CAAEC,WAAY,CAAE,CACxB,EACF,CA/BuBf,kDCNvB,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,OACA,EAAA,EAAA,CAAA,CAAA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AAG,AATgB,EASJ,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,UAAW,AAAX,EAAY,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
1
|
+
{"version":3,"sources":["../../../../agent-network-dashboard/app/lib/hub.ts","../../../../agent-network-dashboard/app/api/anet/node-config/route.ts","../../../../agent-network-dashboard/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { getV3UserToken } from './dashboard-auth';\n\nfunction getHubUrl() {\n return process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n}\n\nexport const HUB_URL = getHubUrl();\n\nexport function hubHeaders(): Record<string, string> {\n return {};\n}\n\n/**\n * Fetch from CommHub. Uses the browser session's V3 user token when available.\n * Dashboard is a thin proxy and does not fall back to a service/master token.\n */\nexport async function hubFetch(path: string, init?: RequestInit): Promise<Response> {\n const url = `${getHubUrl()}${path}`;\n\n // Build auth: prefer V3 token cookie unless caller supplied Authorization.\n let authHeader: Record<string, string> = {};\n\n // Only try V3 token if no Authorization already in init.headers\n const initHeaders = init?.headers as Record<string, string> | undefined;\n if (!initHeaders?.['Authorization']) {\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n authHeader = { 'Authorization': `Bearer ${userToken}` };\n }\n } catch {\n // cookies() not available in this context, ignore\n }\n\n }\n\n return fetch(url, {\n ...init,\n headers: { ...authHeader, ...init?.headers },\n next: { revalidate: 0 },\n } as RequestInit);\n}\n","import { requireDashboardAuth } from '@/app/lib/dashboard-auth';\nimport { hubFetch } from '@/app/lib/hub';\n\n/**\n * Per-node config read/write proxy (#260 / #262 v0.11 — make node settings\n * actually work). Thin proxy to the hub, using the browser session's V3 user\n * token (hubFetch):\n * GET ?node_id=…|alias=… → current node config snapshot (model + flags)\n * GET ?apply_id=… → apply-lifecycle status for a prior POST (F3)\n * POST { node_id|alias, model?, flags? } → update_node_config; returns an\n * applyId + status so the UI can poll take-effect.\n *\n * ⚠️ The hub-side tool (update_node_config + config snapshot) is not deployed\n * yet (工程马 WIP, contract under 通信牛 co-review). Until it lands, these calls\n * hit the ASSUMED contract paths below and, when the hub 404/501s or errors,\n * fall back to a clearly-flagged mock (`mock: true`) so the panel can be built\n * and reviewed. Confirm HUB_*_PATH against the finalized contract before\n * integration — they are isolated here so that's a one-line change.\n */\n\nconst HUB_GET_PATH = (nodeId: string) => `/api/nodes/${encodeURIComponent(nodeId)}/config`;\nconst HUB_UPDATE_PATH = '/api/nodes/config'; // POST → hub MCP update_node_config\nconst HUB_APPLY_STATUS_PATH = (applyId: string) => `/api/nodes/config/apply/${encodeURIComponent(applyId)}`;\n\n// Editable flags whitelist (contract per 通信龙). Anything outside this set is\n// dropped before forwarding, so the UI can't smuggle unexpected keys to the hub.\nconst EDITABLE_FLAGS = [\n 'permissionMode',\n 'dangerouslySkipPermissions',\n 'teammateMode',\n 'maxTurns',\n 'budget',\n 'timeout',\n] as const;\n\n// #260 channel edit — the panel toggles enable/disable for these keys only.\n// Per-channel secrets (bot token / app secret / allowFrom) stay in the node's\n// local config.json, never on the wire from the UI. WeChat is roadmap-only in\n// the panel and intentionally not listed here.\nconst EDITABLE_CHANNELS = ['telegram', 'feishu', 'commhub'] as const;\n\nfunction isJson(res: Response): boolean {\n return (res.headers.get('content-type') || '').includes('application/json');\n}\n\nexport async function GET(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n const { searchParams } = new URL(req.url);\n\n // F3 apply-lifecycle poll: GET ?apply_id=… returns the take-effect status of\n // a prior POST (status: pending | applied | rejected). When the hub tool\n // isn't deployed it mock-returns `pending` — the client drives its own mock\n // progression in that case, so it never actually polls this path.\n const applyId = searchParams.get('apply_id');\n if (applyId) {\n try {\n const res = await hubFetch(HUB_APPLY_STATUS_PATH(applyId));\n if (res.ok && isJson(res)) return Response.json(await res.json());\n return Response.json({ ok: true, mock: true, applyId, status: 'pending' });\n } catch (e: unknown) {\n return Response.json({\n ok: true,\n mock: true,\n applyId,\n status: 'pending',\n _hubError: e instanceof Error ? e.message : String(e),\n });\n }\n }\n\n const nodeId = searchParams.get('node_id') || searchParams.get('alias') || '';\n if (!nodeId) return Response.json({ error: 'node_id or alias required' }, { status: 400 });\n\n try {\n const res = await hubFetch(HUB_GET_PATH(nodeId));\n if (res.ok && isJson(res)) return Response.json(await res.json());\n // backend not ready (404/501/non-JSON) → flagged empty snapshot so the\n // panel can initialise its form and develop the save flow.\n return Response.json({ ok: true, mock: true, node_id: nodeId, model: null, flags: {}, channels: [] });\n } catch (e: unknown) {\n return Response.json({\n ok: true,\n mock: true,\n node_id: nodeId,\n model: null,\n flags: {},\n channels: [],\n _hubError: e instanceof Error ? e.message : String(e),\n });\n }\n}\n\nexport async function POST(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n let body: { node_id?: string; alias?: string; model?: unknown; flags?: Record<string, unknown>; channels?: unknown };\n try {\n body = await req.json();\n } catch {\n return Response.json({ error: 'invalid JSON body' }, { status: 400 });\n }\n\n const nodeId = body.node_id || body.alias;\n if (!nodeId) return Response.json({ error: 'node_id or alias required' }, { status: 400 });\n\n // Whitelist flags — silently drop anything not in the editable contract.\n const flags: Record<string, unknown> = {};\n if (body.flags && typeof body.flags === 'object') {\n for (const k of EDITABLE_FLAGS) {\n if (k in body.flags && body.flags[k] !== undefined) flags[k] = body.flags[k];\n }\n }\n // Whitelist channels — accept string[] of EDITABLE_CHANNELS keys only. Any\n // other shape or key is dropped, so the panel can never smuggle a secret\n // payload or an unknown channel name to the hub.\n let channels: string[] | undefined;\n if (Array.isArray(body.channels)) {\n const allow = new Set<string>(EDITABLE_CHANNELS);\n const seen = new Set<string>();\n channels = [];\n for (const c of body.channels) {\n if (typeof c !== 'string') continue;\n const key = c.trim().toLowerCase();\n if (!allow.has(key) || seen.has(key)) continue;\n seen.add(key);\n channels.push(key);\n }\n }\n const payload = {\n node_id: nodeId,\n ...(body.model !== undefined ? { model: body.model } : {}),\n flags,\n ...(channels !== undefined ? { channels } : {}),\n };\n\n try {\n const res = await hubFetch(HUB_UPDATE_PATH, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(payload),\n });\n if (res.ok && isJson(res)) return Response.json(await res.json());\n if (res.status === 404 || res.status === 501) {\n // hub tool not deployed yet — flagged mock so the Save + apply flow can\n // develop. `status: pending` + `applyId` let the client run its lifecycle.\n return Response.json({ ok: true, mock: true, applied: false, status: 'pending', applyId: `mock-${nodeId}`, node_id: nodeId, echo: payload });\n }\n return Response.json({ ok: false, error: `hub ${res.status}`, status: res.status }, { status: 502 });\n } catch (e: unknown) {\n return Response.json({\n ok: true,\n mock: true,\n applied: false,\n status: 'pending',\n applyId: `mock-${nodeId}`,\n node_id: nodeId,\n echo: payload,\n _hubError: e instanceof Error ? e.message : String(e),\n });\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/anet/node-config/route\",\n pathname: \"/api/anet/node-config\",\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]/agent-network-dashboard/app/api/anet/node-config/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/anet/node-config/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":["getHubUrl","process","env","COMMHUB_URL","HUB_URL","hubHeaders","hubFetch","path","init","url","authHeader","initHeaders","headers","userToken","fetch","next","revalidate","HUB_GET_PATH","nodeId","encodeURIComponent","HUB_UPDATE_PATH","HUB_APPLY_STATUS_PATH","applyId","EDITABLE_FLAGS","EDITABLE_CHANNELS","isJson","res","get","includes","GET","req","authFailure","searchParams","URL","e","ok","Response","json","mock","status","_hubError","Error","message","String","error","node_id","model","flags","channels","body","k","POST","c","allow","alias","undefined","Array","isArray","Set","seen","key","trim","toLowerCase","echo","has","payload","add","push","method","JSON","stringify","applied"],"mappings":"wjCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,SAASA,IACP,OAAOC,QAAQC,GAAG,CAACC,WAAW,EAAI,uBACpC,CAYO,eAAeG,EAASC,CAAY,CAAEC,CAAkB,EAC7D,IAAMC,EAAM,CAAA,EAAGT,IAAAA,EAAcO,EAAAA,CAAM,CAG/BG,EAAqC,CAAC,EAGpCC,EAAcH,GAAMI,QAC1B,GAAI,CAACD,GAAc,UAAD,IAChB,EADiC,CAC7B,CAD+B,AAEjC,IAAME,EAAY,MAAM,CAAA,EAAA,EAAA,cAAA,AAAc,IAClCA,IACFH,EAAa,CAAE,IADF,UACmB,CAAC,OAAO,EAAEG,EAAAA,CAAW,CAAC,CAE1D,CAAE,KAAM,CAER,CAIF,OAAOC,MAAML,EAAK,CAChB,GAAGD,CAAI,CACPI,QAAS,CAAE,GAAGF,CAAU,CAAE,GAAGF,GAAMI,OAAO,AAAC,EAC3CG,KAAM,CAAEC,WAAY,CAAE,CACxB,EACF,CAnCuBhB,kDENvB,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,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,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M,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,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAY,AAAZ,EAAa,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":[2]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../agent-network-dashboard/app/lib/hub.ts","../../../../agent-network-dashboard/node_modules/next/dist/esm/build/templates/app-route.js","../../../../agent-network-dashboard/app/api/hub/send/route.ts"],"sourcesContent":["import { getV3UserToken } from './dashboard-auth';\n\nfunction getHubUrl() {\n return process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n}\n\nexport const HUB_URL = getHubUrl();\n\n/**\n * Fetch from CommHub. Uses the browser session's V3 user token when available.\n * Dashboard is a thin proxy and does not fall back to a service/master token.\n */\nexport async function hubFetch(path: string, init?: RequestInit): Promise<Response> {\n const url = `${getHubUrl()}${path}`;\n\n // Build auth: prefer V3 token cookie unless caller supplied Authorization.\n let authHeader: Record<string, string> = {};\n\n // Only try V3 token if no Authorization already in init.headers\n const initHeaders = init?.headers as Record<string, string> | undefined;\n if (!initHeaders?.['Authorization']) {\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n authHeader = { 'Authorization': `Bearer ${userToken}` };\n }\n } catch {\n // cookies() not available in this context, ignore\n }\n\n }\n\n return fetch(url, {\n ...init,\n headers: { ...authHeader, ...init?.headers },\n next: { revalidate: 0 },\n } as RequestInit);\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/send/route\",\n pathname: \"/api/hub/send\",\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]/agent-network-dashboard/app/api/hub/send/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/send/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","import { requireDashboardAuth, getV3UserToken } from '@/app/lib/dashboard-auth';\nimport { hubFetch } from '@/app/lib/hub';\n\nconst HUB_URL = process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n\nexport async function POST(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n try {\n const { alias, task, priority, attachments } = await req.json();\n\n // Get user's network_id for proper network scoping\n let networkId: string | undefined;\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n const meRes = await hubFetch('/api/auth/me', { headers: { Authorization: `Bearer ${userToken}` } });\n if (meRes.ok) {\n const meData = await meRes.json();\n networkId = meData.current_network || meData.networks?.[0]?.network_id;\n }\n }\n } catch {}\n\n const userToken = await getV3UserToken();\n const headers: Record<string, string> = { 'Content-Type': 'application/json', 'Accept': 'application/json, text/event-stream' };\n if (userToken) headers['Authorization'] = `Bearer ${userToken}`;\n const res = await fetch(`${HUB_URL}/mcp`, {\n method: 'POST',\n headers,\n body: JSON.stringify({\n jsonrpc: '2.0',\n id: Date.now(),\n method: 'tools/call',\n params: {\n name: 'send_task',\n arguments: {\n alias,\n task,\n priority: priority || 'normal',\n ...(Array.isArray(attachments) && attachments.length ? { meta: { attachments } } : {}),\n ...(networkId ? { network_id: networkId } : {}),\n },\n },\n }),\n });\n const raw = await res.text();\n // MCP SSE response: \"event: message\\ndata: {...}\\n\\n\"\n const dataMatch = raw.match(/data:\\s*(\\{.*\\})/);\n const parsed = dataMatch ? JSON.parse(dataMatch[1]) : JSON.parse(raw);\n const content = parsed?.result?.content?.[0]?.text;\n const result = content ? JSON.parse(content) : parsed;\n return Response.json(result);\n } catch (e: unknown) {\n return Response.json({ error: 'send failed', detail: e instanceof Error ? e.message : String(e) }, { status: 502 });\n }\n}\n"],"names":["getHubUrl","process","env","COMMHUB_URL","HUB_URL","hubFetch","path","init","url","authHeader","initHeaders","headers","userToken","fetch","next","revalidate","POST","req","authFailure","alias","task","priority","attachments","json","networkId","meRes","Authorization","ok","meData","current_network","networks","network_id","res","method","body","JSON","stringify","jsonrpc","id","Date","now","params","name","arguments","Array","isArray","length","meta","raw","text","dataMatch","match","parsed","parse","content","result","Response","e","error","detail","Error","message","String","status"],"mappings":"wjCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,SAASA,IACP,OAAOC,QAAQC,GAAG,CAACC,WAAW,EAAI,uBACpC,CAQO,eAAeE,EAASC,CAAY,CAAEC,CAAkB,EAC7D,IAAMC,EAAM,CAAA,EAAGR,IAAAA,EAAcM,EAAAA,CAAM,CAG/BG,EAAqC,CAAC,EAGpCC,EA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AAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,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
|
+
{"version":3,"sources":["../../../../agent-network-dashboard/app/lib/hub.ts","../../../../agent-network-dashboard/node_modules/next/dist/esm/build/templates/app-route.js","../../../../agent-network-dashboard/app/api/hub/send/route.ts"],"sourcesContent":["import { getV3UserToken } from './dashboard-auth';\n\nfunction getHubUrl() {\n return process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n}\n\nexport const HUB_URL = getHubUrl();\n\nexport function hubHeaders(): Record<string, string> {\n return {};\n}\n\n/**\n * Fetch from CommHub. Uses the browser session's V3 user token when available.\n * Dashboard is a thin proxy and does not fall back to a service/master token.\n */\nexport async function hubFetch(path: string, init?: RequestInit): Promise<Response> {\n const url = `${getHubUrl()}${path}`;\n\n // Build auth: prefer V3 token cookie unless caller supplied Authorization.\n let authHeader: Record<string, string> = {};\n\n // Only try V3 token if no Authorization already in init.headers\n const initHeaders = init?.headers as Record<string, string> | undefined;\n if (!initHeaders?.['Authorization']) {\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n authHeader = { 'Authorization': `Bearer ${userToken}` };\n }\n } catch {\n // cookies() not available in this context, ignore\n }\n\n }\n\n return fetch(url, {\n ...init,\n headers: { ...authHeader, ...init?.headers },\n next: { revalidate: 0 },\n } as RequestInit);\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/send/route\",\n pathname: \"/api/hub/send\",\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]/agent-network-dashboard/app/api/hub/send/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/send/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","import { requireDashboardAuth, getV3UserToken } from '@/app/lib/dashboard-auth';\nimport { hubFetch } from '@/app/lib/hub';\n\nconst HUB_URL = process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n\nexport async function POST(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n try {\n const { alias, task, priority, attachments } = await req.json();\n\n // Get user's network_id for proper network scoping\n let networkId: string | undefined;\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n const meRes = await hubFetch('/api/auth/me', { headers: { Authorization: `Bearer ${userToken}` } });\n if (meRes.ok) {\n const meData = await meRes.json();\n networkId = meData.current_network || meData.networks?.[0]?.network_id;\n }\n }\n } catch {}\n\n const userToken = await getV3UserToken();\n const headers: Record<string, string> = { 'Content-Type': 'application/json', 'Accept': 'application/json, text/event-stream' };\n if (userToken) headers['Authorization'] = `Bearer ${userToken}`;\n const res = await fetch(`${HUB_URL}/mcp`, {\n method: 'POST',\n headers,\n body: JSON.stringify({\n jsonrpc: '2.0',\n id: Date.now(),\n method: 'tools/call',\n params: {\n name: 'send_task',\n arguments: {\n alias,\n task,\n priority: priority || 'normal',\n ...(Array.isArray(attachments) && attachments.length ? { meta: { attachments } } : {}),\n ...(networkId ? { network_id: networkId } : {}),\n },\n },\n }),\n });\n const raw = await res.text();\n // MCP SSE response: \"event: message\\ndata: {...}\\n\\n\"\n const dataMatch = raw.match(/data:\\s*(\\{.*\\})/);\n const parsed = dataMatch ? JSON.parse(dataMatch[1]) : JSON.parse(raw);\n const content = parsed?.result?.content?.[0]?.text;\n const result = content ? JSON.parse(content) : parsed;\n return Response.json(result);\n } catch (e: unknown) {\n return Response.json({ error: 'send failed', detail: e instanceof Error ? e.message : String(e) }, { status: 502 });\n }\n}\n"],"names":["getHubUrl","process","env","COMMHUB_URL","HUB_URL","hubHeaders","hubFetch","path","init","url","authHeader","initHeaders","headers","userToken","fetch","next","revalidate","POST","req","authFailure","alias","task","priority","attachments","json","networkId","meRes","Authorization","ok","meData","current_network","networks","network_id","res","method","body","JSON","stringify","jsonrpc","id","Date","now","params","name","arguments","Array","isArray","length","meta","raw","text","dataMatch","match","parsed","parse","content","result","Response","e","error","detail","Error","message","String","status"],"mappings":"wjCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,SAASA,IACP,OAAOC,QAAQC,GAAG,CAACC,WAAW,EAAI,uBACpC,CAYO,eAAeG,EAASC,CAAY,CAAEC,CAAkB,EAC7D,IAAMC,EAAM,CAAA,EAAGT,IAAAA,EAAcO,EAAAA,CAAM,CAG/BG,EAAqC,CAAC,EAGpCC,EAAcH,GAAMI,QAC1B,GAAI,CAACD,GAAc,UAAD,IAChB,EADiC,CAC7B,CAD+B,AAEjC,IAAME,EAAY,MAAM,CAAA,EAAA,EAAA,cAAA,AAAc,IAClCA,IACFH,EAAa,CAAE,IADF,UACmB,CAAC,OAAO,EAAEG,EAAAA,CAAW,AAAC,EAE1D,CAAE,KAAM,CAER,CAIF,OAAOC,MAAML,EAAK,CAChB,GAAGD,CAAI,CACPI,QAAS,CAAE,GAAGF,CAAU,CAAE,GAAGF,GAAMI,OAAO,AAAC,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AAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../agent-network-dashboard/app/lib/hub.ts","../../../../agent-network-dashboard/node_modules/next/dist/esm/build/templates/app-route.js","../../../../agent-network-dashboard/app/api/hub/broadcast/route.ts"],"sourcesContent":["import { getV3UserToken } from './dashboard-auth';\n\nfunction getHubUrl() {\n return process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n}\n\nexport const HUB_URL = getHubUrl();\n\n/**\n * Fetch from CommHub. Uses the browser session's V3 user token when available.\n * Dashboard is a thin proxy and does not fall back to a service/master token.\n */\nexport async function hubFetch(path: string, init?: RequestInit): Promise<Response> {\n const url = `${getHubUrl()}${path}`;\n\n // Build auth: prefer V3 token cookie unless caller supplied Authorization.\n let authHeader: Record<string, string> = {};\n\n // Only try V3 token if no Authorization already in init.headers\n const initHeaders = init?.headers as Record<string, string> | undefined;\n if (!initHeaders?.['Authorization']) {\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n authHeader = { 'Authorization': `Bearer ${userToken}` };\n }\n } catch {\n // cookies() not available in this context, ignore\n }\n\n }\n\n return fetch(url, {\n ...init,\n headers: { ...authHeader, ...init?.headers },\n next: { revalidate: 0 },\n } as RequestInit);\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/broadcast/route\",\n pathname: \"/api/hub/broadcast\",\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]/agent-network-dashboard/app/api/hub/broadcast/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/broadcast/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","import { requireDashboardAuth } from '@/app/lib/dashboard-auth';\nimport { hubFetch } from '@/app/lib/hub';\n\nexport async function POST(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n try {\n const body = await req.json();\n const res = await hubFetch('/api/broadcast', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ ...body, from_session: 'Dashboard' }),\n });\n const data = await res.json();\n return Response.json(data);\n } catch (e: unknown) {\n return Response.json({ error: 'CommHub unreachable' }, { status: 502 });\n }\n}\n"],"names":["getHubUrl","process","env","COMMHUB_URL","HUB_URL","hubFetch","path","init","url","authHeader","initHeaders","headers","userToken","fetch","next","revalidate","POST","req","method","authFailure","body","res","json","JSON","stringify","from_session","data","Response","e","error","status"],"mappings":"wjCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,SAASA,IACP,OAAOC,QAAQC,GAAG,CAACC,WAAW,EAAI,uBACpC,CAQO,eAAeE,EAASC,CAAY,CAAEC,CAAkB,EAC7D,IAAMC,EAAM,CAAA,EAAGR,IAAAA,EAAcM,EAAAA,CAAM,CAG/BG,EAAqC,CAAC,EAGpCC,EAAcH,GAAMI,QAC1B,GAAI,CAACD,GAAc,UAAD,IAChB,EADiC,CAC7B,CAD+B,AAEjC,IAAME,EAAY,MAAM,CAAA,EAAA,EAAA,cAAc,AAAd,IACpBA,IACFH,EAAa,CAAE,IADF,UACmB,CAAC,OAAO,EAAEG,EAAAA,CAAW,CAAC,CAE1D,CAAE,KAAM,CAER,CAIF,OAAOC,MAAML,EAAK,CAChB,GAAGD,CAAI,CACPI,QAAS,CAAE,GAAGF,CAAU,CAAE,GAA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AO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
1
|
+
{"version":3,"sources":["../../../../agent-network-dashboard/app/lib/hub.ts","../../../../agent-network-dashboard/node_modules/next/dist/esm/build/templates/app-route.js","../../../../agent-network-dashboard/app/api/hub/broadcast/route.ts"],"sourcesContent":["import { getV3UserToken } from './dashboard-auth';\n\nfunction getHubUrl() {\n return process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n}\n\nexport const HUB_URL = getHubUrl();\n\nexport function hubHeaders(): Record<string, string> {\n return {};\n}\n\n/**\n * Fetch from CommHub. Uses the browser session's V3 user token when available.\n * Dashboard is a thin proxy and does not fall back to a service/master token.\n */\nexport async function hubFetch(path: string, init?: RequestInit): Promise<Response> {\n const url = `${getHubUrl()}${path}`;\n\n // Build auth: prefer V3 token cookie unless caller supplied Authorization.\n let authHeader: Record<string, string> = {};\n\n // Only try V3 token if no Authorization already in init.headers\n const initHeaders = init?.headers as Record<string, string> | undefined;\n if (!initHeaders?.['Authorization']) {\n try {\n const userToken = await getV3UserToken();\n if (userToken) {\n authHeader = { 'Authorization': `Bearer ${userToken}` };\n }\n } catch {\n // cookies() not available in this context, ignore\n }\n\n }\n\n return fetch(url, {\n ...init,\n headers: { ...authHeader, ...init?.headers },\n next: { revalidate: 0 },\n } as RequestInit);\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/broadcast/route\",\n pathname: \"/api/hub/broadcast\",\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]/agent-network-dashboard/app/api/hub/broadcast/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/broadcast/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","import { requireDashboardAuth } from '@/app/lib/dashboard-auth';\nimport { hubFetch } from '@/app/lib/hub';\n\nexport async function POST(req: Request) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n try {\n const body = await req.json();\n const res = await hubFetch('/api/broadcast', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ ...body, from_session: 'Dashboard' }),\n });\n const data = await res.json();\n return Response.json(data);\n } catch (e: unknown) {\n return Response.json({ error: 'CommHub unreachable' }, { status: 502 });\n }\n}\n"],"names":["getHubUrl","process","env","COMMHUB_URL","HUB_URL","hubHeaders","hubFetch","path","init","url","authHeader","initHeaders","headers","userToken","fetch","next","revalidate","POST","req","method","authFailure","body","res","json","JSON","stringify","from_session","data","Response","e","error","status"],"mappings":"wjCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,SAASA,IACP,OAAOC,QAAQC,GAAG,CAACC,WAAW,EAAI,uBACpC,CAYO,eAAeG,EAASC,CAAY,CAAEC,CAAkB,EAC7D,IAAMC,EAAM,CAAA,EAAGT,IAAAA,EAAcO,EAAAA,CAAM,CAG/BG,EAAqC,CAAC,EAGpCC,EAAcH,GAAMI,QAC1B,GAAI,CAACD,GAAc,UAAD,IAChB,EADiC,CAC7B,CAD+B,AAEjC,IAAME,EAAY,MAAM,CAAA,EAAA,EAAA,cAAc,AAAd,IACpBA,IACFH,EAAa,CAAE,IADF,UACmB,CAAC,OAAO,EAAEG,EAAAA,CAAW,CAAC,CAE1D,CAAE,KAAM,CAER,CAIF,OAAOC,MAAML,EAAK,CAChB,GAAGD,CAAI,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