vibepulse 0.1.12 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +8 -0
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +56 -0
- package/.next/server/app/_global-error/page.js +1 -1
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/node/events/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/node/events/route/build-manifest.json +11 -0
- package/.next/server/app/api/node/events/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/node/events/route.js +7 -0
- package/.next/server/app/api/node/events/route.js.map +5 -0
- package/.next/server/app/api/node/events/route.js.nft.json +1 -0
- package/.next/server/app/api/node/events/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/node/health/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/node/health/route/build-manifest.json +11 -0
- package/.next/server/app/api/node/health/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/node/health/route.js +6 -0
- package/.next/server/app/api/node/health/route.js.map +5 -0
- package/.next/server/app/api/node/health/route.js.nft.json +1 -0
- package/.next/server/app/api/node/health/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/node/sessions/[id]/archive/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/node/sessions/[id]/archive/route/build-manifest.json +11 -0
- package/.next/server/app/api/node/sessions/[id]/archive/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/node/sessions/[id]/archive/route.js +6 -0
- package/.next/server/app/api/node/sessions/[id]/archive/route.js.map +5 -0
- package/.next/server/app/api/node/sessions/[id]/archive/route.js.nft.json +1 -0
- package/.next/server/app/api/node/sessions/[id]/archive/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/node/sessions/[id]/delete/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/node/sessions/[id]/delete/route/build-manifest.json +11 -0
- package/.next/server/app/api/node/sessions/[id]/delete/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/node/sessions/[id]/delete/route.js +7 -0
- package/.next/server/app/api/node/sessions/[id]/delete/route.js.map +5 -0
- package/.next/server/app/api/node/sessions/[id]/delete/route.js.nft.json +1 -0
- package/.next/server/app/api/node/sessions/[id]/delete/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/node/sessions/[id]/open-editor/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/node/sessions/[id]/open-editor/route/build-manifest.json +11 -0
- package/.next/server/app/api/node/sessions/[id]/open-editor/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/node/sessions/[id]/open-editor/route.js +7 -0
- package/.next/server/app/api/node/sessions/[id]/open-editor/route.js.map +5 -0
- package/.next/server/app/api/node/sessions/[id]/open-editor/route.js.nft.json +1 -0
- package/.next/server/app/api/node/sessions/[id]/open-editor/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/node/sessions/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/node/sessions/route/build-manifest.json +11 -0
- package/.next/server/app/api/node/sessions/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/node/sessions/route.js +9 -0
- package/.next/server/app/api/node/sessions/route.js.map +5 -0
- package/.next/server/app/api/node/sessions/route.js.nft.json +1 -0
- package/.next/server/app/api/node/sessions/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/nodes/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/nodes/route/build-manifest.json +11 -0
- package/.next/server/app/api/nodes/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/nodes/route.js +8 -0
- package/.next/server/app/api/nodes/route.js.map +5 -0
- package/.next/server/app/api/nodes/route.js.nft.json +1 -0
- package/.next/server/app/api/nodes/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/opencode-config/route.js +1 -1
- package/.next/server/app/api/opencode-config/route.js.nft.json +1 -1
- package/.next/server/app/api/opencode-config/status/route.js +1 -1
- package/.next/server/app/api/opencode-config/status/route.js.nft.json +1 -1
- package/.next/server/app/api/opencode-events/route.js +4 -2
- package/.next/server/app/api/opencode-events/route.js.nft.json +1 -1
- package/.next/server/app/api/profiles/[id]/apply/route.js +1 -1
- package/.next/server/app/api/profiles/[id]/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/profiles/[id]/export/route.js +2 -2
- package/.next/server/app/api/profiles/[id]/export/route.js.nft.json +1 -1
- package/.next/server/app/api/profiles/[id]/route.js +2 -2
- package/.next/server/app/api/profiles/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/profiles/import/route.js +2 -2
- package/.next/server/app/api/profiles/import/route.js.nft.json +1 -1
- package/.next/server/app/api/profiles/route.js +2 -2
- package/.next/server/app/api/profiles/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/archive/route.js +2 -1
- package/.next/server/app/api/sessions/[id]/archive/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/delete/route.js +3 -2
- package/.next/server/app/api/sessions/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/open-editor/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/sessions/[id]/open-editor/route/build-manifest.json +11 -0
- package/.next/server/app/api/sessions/[id]/open-editor/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/sessions/[id]/open-editor/route.js +7 -0
- package/.next/server/app/api/sessions/[id]/open-editor/route.js.map +5 -0
- package/.next/server/app/api/sessions/[id]/open-editor/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/open-editor/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/route.js +3 -3
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +8 -0
- package/.next/server/chunks/{[root-of-the-server]__172a07b6._.js → [externals]_next_dist_84e7390b._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1211da38._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1211da38._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__192ed2f4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__192ed2f4._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__1b87ec42._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1b87ec42._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__2b526e7a._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__2b526e7a._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__2f981540._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__2f981540._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__3745b314._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__3745b314._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__56690af0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__56690af0._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__56f5f249._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__56f5f249._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__59175de4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__59175de4._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__64fffc02._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__64fffc02._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__6c428a24._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__6c428a24._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__73a00b88._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__73a00b88._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__7e757f50._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__7e757f50._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__89c5eeab._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__89c5eeab._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__8da6c5a8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__8da6c5a8._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__b796d06c._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__b796d06c._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__c2ce5c0f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__c2ce5c0f._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__d8e61048._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__d8e61048._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__db285678._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__db285678._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__e00a9200._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__e00a9200._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__e5df5e5f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__e5df5e5f._.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_events_route_actions_f1abd32d.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_events_route_actions_f1abd32d.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_health_route_actions_c4c4c077.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_health_route_actions_c4c4c077.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_sessions_[id]_archive_route_actions_237255a5.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_sessions_[id]_archive_route_actions_237255a5.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_sessions_[id]_delete_route_actions_e5d426f6.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_sessions_[id]_delete_route_actions_e5d426f6.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_sessions_route_actions_6b564c5a.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_node_sessions_route_actions_6b564c5a.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_nodes_route_actions_3e496ee8.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_nodes_route_actions_3e496ee8.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_open-editor_route_actions_eaebf476.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_open-editor_route_actions_eaebf476.js.map +1 -0
- package/.next/server/chunks/ce889_server_app_api_node_sessions_[id]_open-editor_route_actions_791cdf5b.js +3 -0
- package/.next/server/chunks/ce889_server_app_api_node_sessions_[id]_open-editor_route_actions_791cdf5b.js.map +1 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_7e181e75.js +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_7e181e75.js.map +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_aca45402.js +3 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_aca45402.js.map +1 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_b054aff3.js +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_b054aff3.js.map +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_fa835ac3.js +5 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_fa835ac3.js.map +1 -0
- package/.next/{standalone/.next/server/chunks/ssr/[root-of-the-server]__39eef6a5._.js → server/chunks/ssr/[root-of-the-server]__631e12d0._.js} +2 -2
- package/.next/{standalone/.next/server/chunks/ssr/[root-of-the-server]__535a2208._.js → server/chunks/ssr/[root-of-the-server]__a8cd3911._.js} +2 -2
- package/.next/server/chunks/ssr/src_app_page_tsx_a7111f3e._.js +3 -3
- package/.next/server/chunks/ssr/src_app_page_tsx_a7111f3e._.js.map +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +8 -0
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +56 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/node/events/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/node/events/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/node/events/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/node/events/route.js +7 -0
- package/.next/standalone/.next/server/app/api/node/events/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/node/events/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/node/events/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/node/health/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/node/health/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/node/health/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/node/health/route.js +6 -0
- package/.next/standalone/.next/server/app/api/node/health/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/node/health/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/node/health/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/archive/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/archive/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/archive/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/archive/route.js +6 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/archive/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/archive/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/archive/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route.js +7 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route.js +7 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/node/sessions/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/node/sessions/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/node/sessions/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/node/sessions/route.js +9 -0
- package/.next/standalone/.next/server/app/api/node/sessions/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/node/sessions/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/node/sessions/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/nodes/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/nodes/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/nodes/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/nodes/route.js +8 -0
- package/.next/standalone/.next/server/app/api/nodes/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/nodes/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/nodes/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/opencode-config/route.js +1 -1
- package/.next/standalone/.next/server/app/api/opencode-config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/opencode-config/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/opencode-config/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/opencode-events/route.js +4 -2
- package/.next/standalone/.next/server/app/api/opencode-events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/profiles/[id]/apply/route.js +1 -1
- package/.next/standalone/.next/server/app/api/profiles/[id]/apply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/profiles/[id]/export/route.js +2 -2
- package/.next/standalone/.next/server/app/api/profiles/[id]/export/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/profiles/[id]/route.js +2 -2
- package/.next/standalone/.next/server/app/api/profiles/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/profiles/import/route.js +2 -2
- package/.next/standalone/.next/server/app/api/profiles/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/profiles/route.js +2 -2
- package/.next/standalone/.next/server/app/api/profiles/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/archive/route.js +2 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/archive/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/delete/route.js +3 -2
- package/.next/standalone/.next/server/app/api/sessions/[id]/delete/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route.js +7 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js +3 -3
- package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page.js +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +8 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__172a07b6._.js → [externals]_next_dist_84e7390b._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1211da38._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__192ed2f4._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1b87ec42._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b526e7a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2f981540._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3745b314._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__56690af0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__56f5f249._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__59175de4._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__64fffc02._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6c428a24._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__73a00b88._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7e757f50._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__89c5eeab._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8da6c5a8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b796d06c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c2ce5c0f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d8e61048._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__db285678._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e00a9200._.js +5 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e5df5e5f._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_node_events_route_actions_f1abd32d.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_node_health_route_actions_c4c4c077.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_node_sessions_[id]_archive_route_actions_237255a5.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_node_sessions_[id]_delete_route_actions_e5d426f6.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_node_sessions_route_actions_6b564c5a.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_nodes_route_actions_3e496ee8.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_open-editor_route_actions_eaebf476.js +3 -0
- package/.next/standalone/.next/server/chunks/ce889_server_app_api_node_sessions_[id]_open-editor_route_actions_791cdf5b.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_7e181e75.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_aca45402.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_b054aff3.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_fa835ac3.js +5 -0
- package/.next/{server/chunks/ssr/[root-of-the-server]__39eef6a5._.js → standalone/.next/server/chunks/ssr/[root-of-the-server]__631e12d0._.js} +2 -2
- package/.next/{server/chunks/ssr/[root-of-the-server]__535a2208._.js → standalone/.next/server/chunks/ssr/[root-of-the-server]__a8cd3911._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_app_page_tsx_a7111f3e._.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/7ac19aaef01f4a03.js +13 -0
- package/.next/standalone/.next/static/chunks/f42202943f6742e5.css +3 -0
- package/.next/standalone/AGENTS.md +85 -0
- package/.next/standalone/README.md +76 -0
- package/.next/standalone/__mocks__/child_process.ts +4 -0
- package/.next/standalone/bin/dev-runtime.js +58 -0
- package/.next/standalone/bin/vibepulse.js +87 -0
- package/.next/standalone/check-hsql.mjs +71 -0
- package/.next/standalone/docs/session-status-detection.md +258 -0
- package/.next/standalone/eslint.config.mjs +31 -0
- package/.next/standalone/next.config.ts +8 -0
- package/.next/standalone/package-lock.json +10312 -0
- package/.next/standalone/package.json +4 -2
- package/.next/standalone/postcss.config.mjs +7 -0
- package/.next/standalone/public/readme-cover.png +0 -0
- package/.next/standalone/src/AGENTS.md +41 -0
- package/.next/standalone/src/app/api/AGENTS.md +40 -0
- package/.next/standalone/src/app/api/node/events/route.test.ts +196 -0
- package/.next/standalone/src/app/api/node/events/route.ts +259 -0
- package/.next/standalone/src/app/api/node/health/route.test.ts +190 -0
- package/.next/standalone/src/app/api/node/health/route.ts +48 -0
- package/.next/standalone/src/app/api/node/sessions/[id]/archive/route.test.ts +128 -0
- package/.next/standalone/src/app/api/node/sessions/[id]/archive/route.ts +97 -0
- package/.next/standalone/src/app/api/node/sessions/[id]/delete/route.test.ts +113 -0
- package/.next/standalone/src/app/api/node/sessions/[id]/delete/route.ts +81 -0
- package/.next/standalone/src/app/api/node/sessions/[id]/open-editor/route.test.ts +206 -0
- package/.next/standalone/src/app/api/node/sessions/[id]/open-editor/route.ts +123 -0
- package/.next/standalone/src/app/api/node/sessions/route.test.ts +408 -0
- package/.next/standalone/src/app/api/node/sessions/route.ts +1094 -0
- package/.next/standalone/src/app/api/nodes/route.test.ts +237 -0
- package/.next/standalone/src/app/api/nodes/route.ts +176 -0
- package/.next/standalone/src/app/api/opencode-config/route.test.ts +86 -0
- package/.next/standalone/src/app/api/opencode-config/route.ts +376 -0
- package/.next/standalone/src/app/api/opencode-config/status/route.ts +31 -0
- package/.next/standalone/src/app/api/opencode-events/route.test.ts +624 -0
- package/.next/standalone/src/app/api/opencode-events/route.ts +508 -0
- package/.next/standalone/src/app/api/opencode-models/route.test.ts +167 -0
- package/.next/standalone/src/app/api/opencode-models/route.ts +76 -0
- package/.next/standalone/src/app/api/profiles/[id]/apply/route.ts +49 -0
- package/.next/standalone/src/app/api/profiles/[id]/export/route.ts +31 -0
- package/.next/standalone/src/app/api/profiles/[id]/route.ts +160 -0
- package/.next/standalone/src/app/api/profiles/import/route.test.js +107 -0
- package/.next/standalone/src/app/api/profiles/import/route.ts +65 -0
- package/.next/standalone/src/app/api/profiles/route.ts +107 -0
- package/.next/standalone/src/app/api/sessions/[id]/archive/route.test.ts +136 -0
- package/.next/standalone/src/app/api/sessions/[id]/archive/route.ts +170 -0
- package/.next/standalone/src/app/api/sessions/[id]/delete/route.test.ts +113 -0
- package/.next/standalone/src/app/api/sessions/[id]/delete/route.ts +137 -0
- package/.next/standalone/src/app/api/sessions/[id]/open-editor/route.test.ts +218 -0
- package/.next/standalone/src/app/api/sessions/[id]/open-editor/route.ts +85 -0
- package/.next/standalone/src/app/api/sessions/[id]/route.test.ts +531 -0
- package/.next/standalone/src/app/api/sessions/[id]/route.ts +75 -0
- package/.next/standalone/src/app/api/sessions/route.test.ts +1298 -0
- package/.next/standalone/src/app/api/sessions/route.ts +1695 -0
- package/.next/standalone/src/app/favicon.ico +0 -0
- package/.next/standalone/src/app/globals.css +66 -0
- package/.next/standalone/src/app/layout.tsx +37 -0
- package/.next/standalone/src/app/page.test.tsx +134 -0
- package/.next/standalone/src/app/page.tsx +358 -0
- package/.next/standalone/src/components/AGENTS.md +42 -0
- package/.next/standalone/src/components/ErrorBoundary.tsx +72 -0
- package/.next/standalone/src/components/KanbanBoard.test.tsx +704 -0
- package/.next/standalone/src/components/KanbanBoard.tsx +852 -0
- package/.next/standalone/src/components/LoadingState.tsx +37 -0
- package/.next/standalone/src/components/ProjectCard.test.tsx +773 -0
- package/.next/standalone/src/components/ProjectCard.tsx +595 -0
- package/.next/standalone/src/components/QueryProvider.tsx +25 -0
- package/.next/standalone/src/components/SessionCard.test.tsx +566 -0
- package/.next/standalone/src/components/SessionCard.tsx +434 -0
- package/.next/standalone/src/components/SessionList.tsx +60 -0
- package/.next/standalone/src/components/host-config/HostManagerDialog.test.tsx +252 -0
- package/.next/standalone/src/components/host-config/HostManagerDialog.tsx +476 -0
- package/.next/standalone/src/components/opencode-config/AgentConfigForm.test.tsx +72 -0
- package/.next/standalone/src/components/opencode-config/AgentConfigForm.tsx +483 -0
- package/.next/standalone/src/components/opencode-config/AgentModelSelector.tsx +284 -0
- package/.next/standalone/src/components/opencode-config/AgentsConfigPanel.tsx +162 -0
- package/.next/standalone/src/components/opencode-config/ConfigButton.tsx +43 -0
- package/.next/standalone/src/components/opencode-config/ConfigPanel.tsx +91 -0
- package/.next/standalone/src/components/opencode-config/FullscreenConfigPanel.tsx +435 -0
- package/.next/standalone/src/components/opencode-config/GeneralSettingsForm.test.tsx +91 -0
- package/.next/standalone/src/components/opencode-config/GeneralSettingsForm.tsx +288 -0
- package/.next/standalone/src/components/opencode-config/categories/CategoriesList.tsx +382 -0
- package/.next/standalone/src/components/opencode-config/categories/CategoriesManager.test.tsx +111 -0
- package/.next/standalone/src/components/opencode-config/categories/CategoriesManager.tsx +174 -0
- package/.next/standalone/src/components/opencode-config/categories/CategoryConfigForm.tsx +453 -0
- package/.next/standalone/src/components/opencode-config/profiles/ProfileCard.tsx +140 -0
- package/.next/standalone/src/components/opencode-config/profiles/ProfileEditor.tsx +446 -0
- package/.next/standalone/src/components/opencode-config/profiles/ProfileList.tsx +446 -0
- package/.next/standalone/src/components/opencode-config/profiles/ProfileManager.test.tsx +225 -0
- package/.next/standalone/src/components/opencode-config/profiles/ProfileManager.tsx +405 -0
- package/.next/standalone/src/components/ui/Tabs.tsx +59 -0
- package/.next/standalone/src/hooks/useHostSources.test.ts +509 -0
- package/.next/standalone/src/hooks/useHostSources.ts +299 -0
- package/.next/standalone/src/hooks/useOpencodeSync.test.ts +387 -0
- package/.next/standalone/src/hooks/useOpencodeSync.ts +571 -0
- package/.next/standalone/src/index.ts +2 -0
- package/.next/standalone/src/lib/editorLauncher.server.ts +36 -0
- package/.next/standalone/src/lib/editorLauncher.test.ts +35 -0
- package/.next/standalone/src/lib/editorLauncher.ts +25 -0
- package/.next/standalone/src/lib/hostAccent.test.ts +58 -0
- package/.next/standalone/src/lib/hostAccent.ts +46 -0
- package/.next/standalone/src/lib/hostIdentity.test.ts +187 -0
- package/.next/standalone/src/lib/hostIdentity.ts +122 -0
- package/.next/standalone/src/lib/hostSourcesStorage.test.ts +141 -0
- package/.next/standalone/src/lib/hostSourcesStorage.ts +72 -0
- package/.next/standalone/src/lib/nodeProtocol.test.ts +159 -0
- package/.next/standalone/src/lib/nodeProtocol.ts +142 -0
- package/.next/standalone/src/lib/nodeRegistry.test.ts +173 -0
- package/.next/standalone/src/lib/nodeRegistry.ts +398 -0
- package/.next/standalone/src/lib/notificationSound.ts +292 -0
- package/.next/standalone/src/lib/opencodeConfig.test.ts +100 -0
- package/.next/standalone/src/lib/opencodeConfig.ts +76 -0
- package/.next/standalone/src/lib/opencodeDiscovery.ts +275 -0
- package/.next/standalone/src/lib/profiles/share.test.ts +91 -0
- package/.next/standalone/src/lib/profiles/share.ts +93 -0
- package/.next/standalone/src/lib/profiles/storage.test.ts +108 -0
- package/.next/standalone/src/lib/profiles/storage.ts +370 -0
- package/.next/standalone/src/lib/runtimeMode.test.ts +29 -0
- package/.next/standalone/src/lib/runtimeMode.ts +29 -0
- package/.next/standalone/src/lib/sessionActionErrors.ts +37 -0
- package/.next/standalone/src/lib/sessionArchiveOverrides.test.ts +43 -0
- package/.next/standalone/src/lib/sessionArchiveOverrides.ts +116 -0
- package/.next/standalone/src/lib/transform.test.ts +121 -0
- package/.next/standalone/src/lib/transform.ts +193 -0
- package/.next/standalone/src/test/setup.ts +8 -0
- package/.next/standalone/src/types/index.ts +152 -0
- package/.next/standalone/src/types/opencodeConfig.ts +149 -0
- package/.next/standalone/tsconfig.json +34 -0
- package/.next/standalone/tsconfig.lib.json +17 -0
- package/.next/standalone/vitest.config.ts +16 -0
- package/.next/static/chunks/7ac19aaef01f4a03.js +13 -0
- package/.next/static/chunks/f42202943f6742e5.css +3 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/.next/types/routes.d.ts +9 -1
- package/.next/types/validator.ts +72 -0
- package/README.md +28 -11
- package/bin/dev-runtime.js +58 -0
- package/bin/vibepulse.js +72 -39
- package/package.json +4 -2
- package/public/readme-cover.png +0 -0
- package/.next/server/chunks/[externals]_next_dist_16542d6b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__07488412._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__07488412._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__07649a30._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__07649a30._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__172a07b6._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1bf88ae0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1bf88ae0._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__2c3e3de2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__2c3e3de2._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__560e7c61._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__560e7c61._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__9f034d03._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__9f034d03._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__a84faf4b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__a84faf4b._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__b92251ea._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__b92251ea._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__e7a766a0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__e7a766a0._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__f234882e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__f234882e._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__f85221b8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__f85221b8._.js.map +0 -1
- package/.next/standalone/.next/server/chunks/[externals]_next_dist_16542d6b._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07488412._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07649a30._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1bf88ae0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2c3e3de2._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__560e7c61._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9f034d03._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a84faf4b._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b92251ea._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e7a766a0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f234882e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f85221b8._.js +0 -3
- package/.next/standalone/.next/static/chunks/ca49cb2092c277d2.js +0 -13
- package/.next/standalone/.next/static/chunks/dc07499869593595.css +0 -3
- package/.next/static/chunks/ca49cb2092c277d2.js +0 -13
- package/.next/static/chunks/dc07499869593595.css +0 -3
- /package/.next/server/chunks/{[externals]_next_dist_16542d6b._.js.map → [externals]_next_dist_84e7390b._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__39eef6a5._.js.map → [root-of-the-server]__631e12d0._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__535a2208._.js.map → [root-of-the-server]__a8cd3911._.js.map} +0 -0
- /package/.next/standalone/.next/static/{78EwnRx2m70qyfCL0X4sH → Fw2R3y-fHX4B2SWxNy_4X}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{78EwnRx2m70qyfCL0X4sH → Fw2R3y-fHX4B2SWxNy_4X}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{78EwnRx2m70qyfCL0X4sH → Fw2R3y-fHX4B2SWxNy_4X}/_ssgManifest.js +0 -0
- /package/.next/static/{78EwnRx2m70qyfCL0X4sH → Fw2R3y-fHX4B2SWxNy_4X}/_buildManifest.js +0 -0
- /package/.next/static/{78EwnRx2m70qyfCL0X4sH → Fw2R3y-fHX4B2SWxNy_4X}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{78EwnRx2m70qyfCL0X4sH → Fw2R3y-fHX4B2SWxNy_4X}/_ssgManifest.js +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[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"))},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"))},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"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},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"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},53977,e=>{"use strict";var t=e.i(24868),r=e.i(22734),i=e.i(14747),n=e.i(46786),a=e.i(89196);let o=(0,i.join)((0,n.homedir)(),".config","opencode","profiles"),s=(0,i.join)(o,"index.json"),l=[{id:"balanced",name:"Balanced",emoji:"⚖️",description:"Balanced multi-model orchestration optimized for general coding tasks",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isBuiltIn:!0}],d={balanced:{agents:{sisyphus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},oracle:{model:"openai/gpt-5.4",variant:"high",temperature:.2,top_p:.9},prometheus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},metis:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},momus:{model:"openai/gpt-5.4",variant:"medium",temperature:.2,top_p:.9},atlas:{model:"anthropic/claude-sonnet-4-6",temperature:.2,top_p:.9},hepheastus:{model:"openai/gpt-5.3-codex",variant:"xhigh",temperature:.2,top_p:.9},librarian:{model:"anthropic/claude-sonnet-4-6",temperature:.3,top_p:.9},explore:{model:"anthropic/claude-haiku-4-5",temperature:.1,top_p:.9},"multimodal-looker":{model:"google/gemini-3.1-pro",variant:"high",temperature:.2,top_p:.9},"frontend-ui-ux":{model:"google/gemini-3.1-pro",variant:"high",temperature:.3,top_p:.9}},categories:{"visual-engineering":{model:"google/gemini-3.1-pro",variant:"high"},ultrabrain:{model:"openai/gpt-5.3-codex",variant:"xhigh"},deep:{model:"openai/gpt-5.3-codex",variant:"medium"},artistry:{model:"google/gemini-3.1-pro",variant:"high"},quick:{model:"anthropic/claude-haiku-4-5",temperature:.1},"unspecified-low":{model:"anthropic/claude-sonnet-4-6",temperature:.2},"unspecified-high":{model:"openai/gpt-5.4",variant:"high",temperature:.2},writing:{model:"google/gemini-3-flash",temperature:.3}}}};function u(){(0,r.existsSync)(o)||(0,r.mkdirSync)(o,{recursive:!0})}function p(e){return(0,i.join)(o,`${e}.json`)}function c(){return{version:1,profiles:[...l],activeProfileId:null,lastModified:new Date().toISOString()}}async function f(){let e=new Set(l.map(e=>e.id));for(let i of["coding","writing","debug","minimal"])if(!e.has(i)){let e=p(i);(0,r.existsSync)(e)&&await (0,t.unlink)(e)}for(let e of l){let r=p(e.id),i=d[e.id]||{agents:{}},n=(0,a.stringify)(i,null,2);await (0,t.writeFile)(r,n,"utf-8")}}async function g(){return h(!0)}async function m(){return h(!1)}async function h(e){try{if(u(),!(0,r.existsSync)(s)){let e=c();return await x(e),await f(),e}let e=await (0,t.readFile)(s,"utf-8"),i=(0,a.parse)(e,null,!1),n=!1;for(let e of l)i.profiles.some(t=>t.id===e.id)||(i.profiles.push(e),n=!0);let o=new Set(l.map(e=>e.id)),d=i.profiles.length;return i.profiles=i.profiles.filter(e=>!e.isBuiltIn||o.has(e.id)),i.profiles.length!==d&&(n=!0),await f(),n&&(i.lastModified=new Date().toISOString(),await x(i)),i}catch(t){if(!e)throw t;return c()}}async function x(e){u(),e.lastModified=new Date().toISOString();let r=(0,a.stringify)(e,null,2);await (0,t.writeFile)(s,r,"utf-8")}async function w(e){try{let i=p(e);if(!(0,r.existsSync)(i))return{agents:{}};let n=await (0,t.readFile)(i,"utf-8");return(0,a.parse)(n,null,!1)}catch{return{agents:{}}}}async function v(e,r){u();let i=p(e),n=(0,a.stringify)(r,null,2);await (0,t.writeFile)(i,n,"utf-8")}async function y(e){let i=(await g()).profiles.find(t=>t.id===e);if(i?.isBuiltIn){let t=d[e]||{agents:{}};return await v(e,t),!0}let n=p(e);return!!(0,r.existsSync)(n)&&(await (0,t.unlink)(n),!0)}async function R(e){return(await g()).profiles.find(t=>t.id===e)}async function P(e){let t=await g();t.activeProfileId=e,await x(t)}e.s(["deleteProfileConfig",()=>y,"getProfileById",()=>R,"readProfileConfig",()=>w,"readProfileIndex",()=>g,"readProfileIndexStrict",()=>m,"setActiveProfileId",()=>P,"writeProfileConfig",()=>v,"writeProfileIndex",()=>x])},30754,e=>{"use strict";var t=e.i(47909),r=e.i(74017),i=e.i(96250),n=e.i(59756),a=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),p=e.i(47587),c=e.i(66012),f=e.i(70101),g=e.i(26937),m=e.i(10372),h=e.i(93695);e.i(52474);var x=e.i(220),w=e.i(89171),v=e.i(53977);async function y(e,{params:t}){try{let{id:e}=await t,r=await (0,v.getProfileById)(e);if(!r)return w.NextResponse.json({error:"Profile not found"},{status:404});let i=await (0,v.readProfileConfig)(e);return w.NextResponse.json({profile:r,config:i})}catch(e){return console.error("Error reading profile:",e),w.NextResponse.json({error:"Internal server error"},{status:500})}}async function R(e,{params:t}){try{let{id:r}=await t,i=await (0,v.getProfileById)(r);if(!i)return w.NextResponse.json({error:"Profile not found"},{status:404});let n=await e.json();if(!n||"object"!=typeof n)return w.NextResponse.json({error:"Invalid request body"},{status:400});let a=n.profile||n,{name:o,description:s,emoji:l}=a,d=n.config||a.config;if(void 0!==o){if("string"!=typeof o||""===o.trim())return w.NextResponse.json({error:"name must be a non-empty string"},{status:400});i.name=o.trim()}void 0!==s&&(i.description=s?.trim()||void 0),void 0!==l&&(i.emoji=l||"⚙️"),i.updatedAt=new Date().toISOString();let u=await (0,v.readProfileIndex)(),p=u.profiles.findIndex(e=>e.id===r);if(-1===p)return w.NextResponse.json({error:"Profile not found in index"},{status:404});return u.profiles[p]=i,await (0,v.writeProfileIndex)(u),d&&"object"==typeof d&&await (0,v.writeProfileConfig)(r,{agents:d.agents||{},categories:d.categories}),w.NextResponse.json({profile:i})}catch(e){return console.error("Error updating profile:",e),w.NextResponse.json({error:"Internal server error"},{status:500})}}async function P(e,{params:t}){try{let{id:e}=await t,r=await (0,v.getProfileById)(e);if(!r)return w.NextResponse.json({error:"Profile not found"},{status:404});if(r.isBuiltIn)return await (0,v.deleteProfileConfig)(e),w.NextResponse.json({message:"Built-in profile reset to defaults",profile:r});let i=await (0,v.readProfileIndex)();return i.profiles=i.profiles.filter(t=>t.id!==e),i.activeProfileId===e&&(i.activeProfileId=null),await (0,v.writeProfileIndex)(i),await (0,v.deleteProfileConfig)(e),w.NextResponse.json({message:"Profile deleted successfully"})}catch(e){return console.error("Error deleting profile:",e),w.NextResponse.json({error:"Internal server error"},{status:500})}}e.s(["DELETE",()=>P,"GET",()=>y,"PUT",()=>R],44170);var E=e.i(44170);let I=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/profiles/[id]/route",pathname:"/api/profiles/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/profiles/[id]/route.ts",nextConfigOutput:"standalone",userland:E}),{workAsyncStorage:C,workUnitAsyncStorage:j,serverHooks:S}=I;function b(){return(0,i.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:j})}async function N(e,t,i){I.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/profiles/[id]/route";w=w.replace(/\/index$/,"")||"/";let v=await I.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:y,params:R,nextConfig:P,parsedUrl:E,isDraftMode:C,prerenderManifest:j,routerServerContext:S,isOnDemandRevalidate:b,revalidateOnlyGenerated:N,resolvedPathname:A,clientReferenceManifest:_,serverActionsManifest:k}=v,O=(0,s.normalizeAppPath)(w),T=!!(j.dynamicRoutes[O]||j.routes[A]),q=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,E,!1):t.end("This page could not be found"),null);if(T&&!C){let e=!!j.routes[A],t=j.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(P.experimental.adapterPath)return await q();throw new h.NoFallbackError}}let D=null;!T||I.isDev||C||(D="/index"===(D=A)?"/":D);let H=!0===I.isDev||!T,U=T&&!H;k&&_&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:_,serverActionsManifest:k});let B=e.method||"GET",M=(0,a.getTracer)(),F=M.getActiveScopeSpan(),$={params:R,prerenderManifest:j,renderOpts:{experimental:{authInterrupts:!!P.experimental.authInterrupts},cacheComponents:!!P.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:P.cacheLife,waitUntil:i.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,i,n)=>I.onRequestError(e,t,i,n,S)},sharedContext:{buildId:y}},K=new l.NodeNextRequest(e),L=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(K,(0,d.signalFromNodeResponse)(t));try{let o=async e=>I.handle(G,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.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 i=r.get("next.route");if(i){let t=`${B} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t)}else e.updateName(`${B} ${w}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var a,l;let d=async({previousCacheEntry:r})=>{try{if(!s&&b&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(n);e.fetchMetrics=$.renderOpts.fetchMetrics;let l=$.renderOpts.pendingWaitUntil;l&&i.waitUntil&&(i.waitUntil(l),l=void 0);let d=$.renderOpts.collectedTags;if(!T)return await (0,c.sendResponse)(K,L,a,$.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[m.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,i=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:i}}}}catch(t){throw(null==r?void 0:r.isStale)&&await I.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:b})},!1,S),t}},u=await I.handleResponse({req:e,nextConfig:P,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:j,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:N,responseGenerator:d,waitUntil:i.waitUntil,isMinimalMode:s});if(!T)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",b?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,f.fromNodeOutgoingHttpHeaders)(u.value.headers);return s&&T||h.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,g.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(K,L,new Response(u.value.body,{headers:h,status:u.value.status||200})),null};F?await l(F):await M.withPropagatedContext(e.headers,()=>M.trace(u.BaseServerSpan.handleRequest,{spanName:`${B} ${w}`,kind:a.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},l))}catch(t){if(t instanceof h.NoFallbackError||await I.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:b})},!1,S),T)throw t;return await (0,c.sendResponse)(K,L,new Response(null,{status:500})),null}}e.s(["handler",()=>N,"patchFetch",()=>b,"routeModule",()=>I,"serverHooks",()=>S,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>j],30754)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__560e7c61._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/profiles/storage.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/profiles/%5Bid%5D/route.ts"],"sourcesContent":["import { readFile, writeFile, unlink } from 'fs/promises';\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\nimport { parse, stringify } from 'comment-json';\nimport type { AgentConfig, CategoryConfig } from '@/types/opencodeConfig';\n\nexport const PROFILES_DIR = join(homedir(), '.config', 'opencode', 'profiles');\nexport const PROFILE_INDEX_PATH = join(PROFILES_DIR, 'index.json');\n\nexport interface Profile {\n id: string;\n name: string;\n emoji: string;\n description?: string;\n createdAt: string;\n updatedAt: string;\n isDefault?: boolean;\n isBuiltIn?: boolean;\n}\n\nexport interface ProfileIndex {\n version: number;\n profiles: Profile[];\n activeProfileId: string | null;\n lastModified: string;\n}\n\nexport interface ProfileConfig {\n agents: Record<string, AgentConfig>;\n categories?: Record<string, CategoryConfig>;\n}\n\nconst BUILTIN_PROFILES: Profile[] = [\n {\n id: 'balanced',\n name: 'Balanced',\n emoji: '⚖️',\n description: 'Balanced multi-model orchestration optimized for general coding tasks',\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n isBuiltIn: true,\n },\n];\n\nconst BUILTIN_PROFILE_CONFIGS: Record<string, ProfileConfig> = {\n balanced: {\n agents: {\n sisyphus: {\n model: 'anthropic/claude-opus-4-6',\n variant: 'max',\n temperature: 0.2,\n top_p: 0.9,\n },\n oracle: {\n model: 'openai/gpt-5.4',\n variant: 'high',\n temperature: 0.2,\n top_p: 0.9,\n },\n prometheus: {\n model: 'anthropic/claude-opus-4-6',\n variant: 'max',\n temperature: 0.2,\n top_p: 0.9,\n },\n metis: {\n model: 'anthropic/claude-opus-4-6',\n variant: 'max',\n temperature: 0.2,\n top_p: 0.9,\n },\n momus: {\n model: 'openai/gpt-5.4',\n variant: 'medium',\n temperature: 0.2,\n top_p: 0.9,\n },\n atlas: {\n model: 'anthropic/claude-sonnet-4-6',\n temperature: 0.2,\n top_p: 0.9,\n },\n hepheastus: {\n model: 'openai/gpt-5.3-codex',\n variant: 'xhigh',\n temperature: 0.2,\n top_p: 0.9,\n },\n librarian: {\n model: 'anthropic/claude-sonnet-4-6',\n temperature: 0.3,\n top_p: 0.9,\n },\n explore: {\n model: 'anthropic/claude-haiku-4-5',\n temperature: 0.1,\n top_p: 0.9,\n },\n 'multimodal-looker': {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n temperature: 0.2,\n top_p: 0.9,\n },\n 'frontend-ui-ux': {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n temperature: 0.3,\n top_p: 0.9,\n },\n },\n categories: {\n 'visual-engineering': {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n },\n ultrabrain: {\n model: 'openai/gpt-5.3-codex',\n variant: 'xhigh',\n },\n deep: {\n model: 'openai/gpt-5.3-codex',\n variant: 'medium',\n },\n artistry: {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n },\n quick: {\n model: 'anthropic/claude-haiku-4-5',\n temperature: 0.1,\n },\n 'unspecified-low': {\n model: 'anthropic/claude-sonnet-4-6',\n temperature: 0.2,\n },\n 'unspecified-high': {\n model: 'openai/gpt-5.4',\n variant: 'high',\n temperature: 0.2,\n },\n writing: {\n model: 'google/gemini-3-flash',\n temperature: 0.3,\n },\n },\n },\n};\n\nexport function ensureProfilesDir(): void {\n if (!existsSync(PROFILES_DIR)) {\n mkdirSync(PROFILES_DIR, { recursive: true });\n }\n}\n\nfunction getProfileConfigPath(id: string): string {\n return join(PROFILES_DIR, `${id}.json`);\n}\n\nfunction createDefaultProfileIndex(): ProfileIndex {\n return {\n version: 1,\n profiles: [...BUILTIN_PROFILES],\n activeProfileId: null,\n lastModified: new Date().toISOString(),\n };\n}\n\nasync function createBuiltinProfileConfigs(): Promise<void> {\n const validBuiltinIds = new Set(BUILTIN_PROFILES.map(p => p.id));\n const deprecatedBuiltinIds = ['coding', 'writing', 'debug', 'minimal'];\n\n for (const deprecatedId of deprecatedBuiltinIds) {\n if (!validBuiltinIds.has(deprecatedId)) {\n const deprecatedConfigPath = getProfileConfigPath(deprecatedId);\n if (existsSync(deprecatedConfigPath)) {\n await unlink(deprecatedConfigPath);\n }\n }\n }\n\n for (const profile of BUILTIN_PROFILES) {\n const configPath = getProfileConfigPath(profile.id);\n const config = BUILTIN_PROFILE_CONFIGS[profile.id] || { agents: {} };\n const content = stringify(config, null, 2);\n await writeFile(configPath, content, 'utf-8');\n }\n}\n\nexport async function readProfileIndex(): Promise<ProfileIndex> {\n return readProfileIndexInternal(true);\n}\n\nexport async function readProfileIndexStrict(): Promise<ProfileIndex> {\n return readProfileIndexInternal(false);\n}\n\nasync function readProfileIndexInternal(fallbackOnError: boolean): Promise<ProfileIndex> {\n try {\n ensureProfilesDir();\n\n if (!existsSync(PROFILE_INDEX_PATH)) {\n const defaultIndex = createDefaultProfileIndex();\n await writeProfileIndex(defaultIndex);\n await createBuiltinProfileConfigs();\n return defaultIndex;\n }\n\n const content = await readFile(PROFILE_INDEX_PATH, 'utf-8');\n const index = parse(content, null, false) as unknown as ProfileIndex;\n \n // Ensure all built-in profiles exist in the index\n let modified = false;\n for (const builtinProfile of BUILTIN_PROFILES) {\n const exists = index.profiles.some(p => p.id === builtinProfile.id);\n if (!exists) {\n index.profiles.push(builtinProfile);\n modified = true;\n }\n }\n \n // Remove built-in profiles that are no longer in BUILTIN_PROFILES\n const builtinIds = new Set(BUILTIN_PROFILES.map(p => p.id));\n const oldLength = index.profiles.length;\n index.profiles = index.profiles.filter(p => !p.isBuiltIn || builtinIds.has(p.id));\n if (index.profiles.length !== oldLength) {\n modified = true;\n }\n \n await createBuiltinProfileConfigs();\n \n if (modified) {\n index.lastModified = new Date().toISOString();\n await writeProfileIndex(index);\n }\n \n return index;\n } catch (error) {\n if (!fallbackOnError) {\n throw error;\n }\n return createDefaultProfileIndex();\n }\n}\n\nexport async function writeProfileIndex(index: ProfileIndex): Promise<void> {\n ensureProfilesDir();\n \n index.lastModified = new Date().toISOString();\n const content = stringify(index, null, 2);\n \n await writeFile(PROFILE_INDEX_PATH, content, 'utf-8');\n}\n\n\nexport async function readProfileConfig(id: string): Promise<ProfileConfig> {\n try {\n const configPath = getProfileConfigPath(id);\n \n if (!existsSync(configPath)) {\n return { agents: {} };\n }\n \n const content = await readFile(configPath, 'utf-8');\n const config = parse(content, null, false) as unknown as ProfileConfig;\n return config;\n } catch {\n return { agents: {} };\n }\n}\n\nexport async function writeProfileConfig(\n id: string, \n config: ProfileConfig\n): Promise<void> {\n ensureProfilesDir();\n \n const configPath = getProfileConfigPath(id);\n const content = stringify(config, null, 2);\n \n await writeFile(configPath, content, 'utf-8');\n}\n\nexport async function deleteProfileConfig(id: string): Promise<boolean> {\n const index = await readProfileIndex();\n const profile = index.profiles.find(p => p.id === id);\n \n if (profile?.isBuiltIn) {\n const defaultConfig = BUILTIN_PROFILE_CONFIGS[id] || { agents: {} };\n await writeProfileConfig(id, defaultConfig);\n return true;\n }\n \n const configPath = getProfileConfigPath(id);\n \n if (!existsSync(configPath)) {\n return false;\n }\n \n await unlink(configPath);\n return true;\n}\n\nexport async function getProfileById(id: string): Promise<Profile | undefined> {\n const index = await readProfileIndex();\n return index.profiles.find(p => p.id === id);\n}\n\nexport async function getActiveProfileId(): Promise<string | null> {\n const index = await readProfileIndex();\n return index.activeProfileId;\n}\n\nexport async function setActiveProfileId(id: string | null): Promise<void> {\n const index = await readProfileIndex();\n index.activeProfileId = id;\n await writeProfileIndex(index);\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 } 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 = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/profiles/[id]/route\",\n pathname: \"/api/profiles/[id]\",\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]/src/app/api/profiles/[id]/route.ts\",\n nextConfigOutput,\n userland\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 (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/profiles/[id]/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.experimental.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 context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, '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 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 } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\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 (activeSpan) {\n await handleResponse(activeSpan);\n } else {\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));\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 { NextRequest, NextResponse } from 'next/server';\nimport {\n readProfileIndex,\n writeProfileIndex,\n getProfileById,\n readProfileConfig,\n writeProfileConfig,\n deleteProfileConfig,\n} from '@/lib/profiles/storage';\n\n\ninterface RouteParams {\n params: Promise<{ id: string }>;\n}\n\nexport async function GET(_request: NextRequest, { params }: RouteParams) {\n try {\n const { id } = await params;\n const profile = await getProfileById(id);\n\n if (!profile) {\n return NextResponse.json(\n { error: 'Profile not found' },\n { status: 404 }\n );\n }\n\n const config = await readProfileConfig(id);\n\n return NextResponse.json({\n profile,\n config,\n });\n } catch (error) {\n console.error('Error reading profile:', error);\n return NextResponse.json(\n { error: 'Internal server error' },\n { status: 500 }\n );\n }\n}\n\nexport async function PUT(request: NextRequest, { params }: RouteParams) {\n try {\n const { id } = await params;\n const profile = await getProfileById(id);\n\n if (!profile) {\n return NextResponse.json(\n { error: 'Profile not found' },\n { status: 404 }\n );\n }\n\n const body = await request.json();\n\n if (!body || typeof body !== 'object') {\n return NextResponse.json(\n { error: 'Invalid request body' },\n { status: 400 }\n );\n }\n\n // Support both { name, ... } and { profile: { name, ... }, config } formats\n const profileData = body.profile || body;\n const { name, description, emoji } = profileData;\n const config = body.config || profileData.config;\n\n if (name !== undefined) {\n if (typeof name !== 'string' || name.trim() === '') {\n return NextResponse.json(\n { error: 'name must be a non-empty string' },\n { status: 400 }\n );\n }\n profile.name = name.trim();\n }\n\n if (description !== undefined) {\n profile.description = description?.trim() || undefined;\n }\n\n if (emoji !== undefined) {\n profile.emoji = emoji || '⚙️';\n }\n\n profile.updatedAt = new Date().toISOString();\n\n const index = await readProfileIndex();\n const profileIndex = index.profiles.findIndex(p => p.id === id);\n\n if (profileIndex === -1) {\n return NextResponse.json(\n { error: 'Profile not found in index' },\n { status: 404 }\n );\n }\n\n index.profiles[profileIndex] = profile;\n await writeProfileIndex(index);\n\n if (config && typeof config === 'object') {\n await writeProfileConfig(id, {\n agents: config.agents || {},\n categories: config.categories,\n });\n }\n\n return NextResponse.json({ profile });\n } catch (error) {\n console.error('Error updating profile:', error);\n return NextResponse.json(\n { error: 'Internal server error' },\n { status: 500 }\n );\n }\n}\n\nexport async function DELETE(_request: NextRequest, { params }: RouteParams) {\n try {\n const { id } = await params;\n const profile = await getProfileById(id);\n\n if (!profile) {\n return NextResponse.json(\n { error: 'Profile not found' },\n { status: 404 }\n );\n }\n\n if (profile.isBuiltIn) {\n await deleteProfileConfig(id);\n\n return NextResponse.json({\n message: 'Built-in profile reset to defaults',\n profile,\n });\n }\n\n const index = await readProfileIndex();\n index.profiles = index.profiles.filter(p => p.id !== id);\n\n if (index.activeProfileId === id) {\n index.activeProfileId = null;\n }\n\n await writeProfileIndex(index);\n await deleteProfileConfig(id);\n\n return NextResponse.json({\n message: 'Profile deleted successfully',\n });\n } catch (error) {\n console.error('Error deleting profile:', error);\n return NextResponse.json(\n { error: 'Internal server error' },\n { status: 500 }\n );\n }\n}\n"],"names":[],"mappings":"8iCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA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,MAAM,EAAe,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GACvB,AAD0B,CAE9B,EAAG,GAEf,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,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[1]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
module.exports=[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"))},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"))},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"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},33405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},99686,e=>{"use strict";var t=e.i(33405);let r=new Set;function n(){let e=Number(process.env.OPENCODE_DISCOVERY_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:5e3}function o(e){if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return"ETIMEDOUT"===e.code||t.includes("timed out")||t.includes("etimedout")}function a(e){let t=e.deadlineMs-Date.now();return t<=0?(e.timedOut=!0,null):Math.max(1,Math.min(e.timeoutMs,t))}function i(e){return Array.from(new Set(e.filter(e=>Number.isInteger(e)&&e>0&&e<=65535))).sort((e,t)=>e-t)}function s(){let e=n(),s={timedOut:!1,timeoutMs:e,deadlineMs:Date.now()+e},l=i([...function(e){try{let r=a(e);if(null===r)return[];let n=(0,t.execSync)("lsof -nP -iTCP -sTCP:LISTEN",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],timeout:r}).split("\n"),o=[];for(let e of n){let t=e.trim();if(!t||t.startsWith("COMMAND"))continue;let r=t.split(/\s+/),n=r[0]?.toLowerCase();if("opencode"!==n)continue;let a=t.match(/:(\d+)\s+\(LISTEN\)/);if(!a)continue;let i=parseInt(a[1],10);Number.isFinite(i)&&o.push(i)}return o}catch(t){return o(t)&&(e.timedOut=!0),[]}}(s),...function(e){try{let r=a(e);if(null===r)return[];return[...(0,t.execSync)("ps -axo command",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],timeout:r}).matchAll(/\bopencode\b[^\n]*\b--port(?:=|\s+)(\d+)\b/g)].map(e=>parseInt(e[1],10)).filter(e=>Number.isFinite(e))}catch(t){return o(t)&&(e.timedOut=!0),[]}}(s)]);for(let e of l)r.add(e);return{ports:i([...l,...Array.from(r)]),timedOut:s.timedOut}}function l(){let e=n(),r={timedOut:!1,timeoutMs:e,deadlineMs:Date.now()+e},i=function(e){try{let r=a(e);if(null===r)return[];let n=(0,t.execSync)("ps -axo pid=,command=",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],timeout:r}),o=[];for(let e of n.split("\n")){let t=e.trim();if(!t)continue;let r=t.match(/^(\d+)\s+(.+)$/);if(!r)continue;let n=parseInt(r[1],10),a=r[2];Number.isFinite(n)&&/\bopencode\b/.test(a)&&(/\b--port(?:=|\s+)\d+\b/.test(a)||o.push(n))}return Array.from(new Set(o))}catch(t){return o(t)&&(e.timedOut=!0),[]}}(r);if(!i.length)return{processes:[],timedOut:r.timedOut};let s=[],l=new Set;for(let e of i){let n=function(e,r){try{let n=a(r);if(null===n)return null;let o=(0,t.execSync)(`lsof -nP -a -p ${e} -d cwd -Fn`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"],timeout:n}).split("\n").find(e=>e.startsWith("n")&&e.length>1);if(!o)return null;return o.slice(1)}catch(e){return o(e)&&(r.timedOut=!0),null}}(e,r);if(!n)continue;let i=`${e}:${n}`;l.has(i)||(l.add(i),s.push({pid:e,cwd:n}))}return{processes:s,timedOut:r.timedOut}}e.s(["discoverOpencodePortsWithMeta",()=>s,"discoverOpencodeProcessCwdsWithoutPortWithMeta",()=>l])},46418,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),o=e.i(59756),a=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),m=e.i(70101),f=e.i(26937),h=e.i(10372),v=e.i(93695);e.i(52474);var g=e.i(220);e.i(39354);var x=e.i(34959),w=e.i(99686);async function E(e,t,r){let n=r??new AbortController,o=(0,x.createOpencodeClient)({baseUrl:`http://localhost:${e}`}),a=null,i=new Promise((r,o)=>{a=setTimeout(()=>{n.abort(),o(Error(`OpenCode event stream preflight timed out for port ${e} after ${t}ms`))},t)});try{let t=await Promise.race([o.global.event({signal:n.signal}),i]);return{port:e,stream:t.stream,controller:n}}finally{a&&clearTimeout(a)}}async function y(e){let t=new TextEncoder,{ports:r,timedOut:n}=(0,w.discoverOpencodePortsWithMeta)();if(!r.length)return n?Response.json({error:"OpenCode discovery timed out",hint:"Host process discovery exceeded timeout. Retry shortly, or increase OPENCODE_DISCOVERY_TIMEOUT_MS."},{status:503}):Response.json({error:"OpenCode server not found",hint:"Make sure OpenCode is running with an exposed API port. Example: opencode --port <PORT> (VibePulse auto-detects active ports)."},{status:503});try{let n,o=(n=Number(process.env.OPENCODE_EVENTS_PREFLIGHT_TIMEOUT_MS),Number.isFinite(n)&&n>0?n:2500),a=new Map,i=r.map(e=>{let t=new AbortController;return a.set(e,t),E(e,o,t)}),s=await Promise.any(i).catch(async()=>{for(let e of(await Promise.allSettled(i)))"rejected"===e.status&&console.warn("Failed to connect to OpenCode port during preflight:",e.reason);return null});if(!s)return Response.json({error:"Failed to connect to OpenCode event stream",hint:"Detected OpenCode ports but event streaming handshake failed. Ensure OpenCode API is reachable and retry."},{status:503});for(let[e,t]of a.entries())e!==s.port&&t.abort();let l=null,d=new ReadableStream({async start(n){let a=!1,i=new Set([s.controller]),d=new Set,u=e=>{try{return n.enqueue(t.encode(`data: ${JSON.stringify(e)}
|
|
2
|
-
|
|
3
|
-
`)),!0}catch{return!1}},c=()=>{try{n.close()}catch{}},p=()=>{l?l():(a=!0,c())};l=()=>{for(let e of(a=!0,i))e.abort();Promise.allSettled(Array.from(d).map(e=>e.return?.())),e.signal.removeEventListener("abort",p),c()},e.signal.addEventListener("abort",p);let m=async e=>{let t=e.stream[Symbol.asyncIterator]();d.add(t);try{for(;!a;){let e=await t.next();if(e.done)break;let r=e.value;if(a||!u(r))break}}catch(t){console.warn("OpenCode event stream failed for port:",e.port,t)}finally{d.delete(t),console.warn("OpenCode event stream disconnected for port:",e.port)}};try{let e=m(s),t=r.filter(e=>e!==s.port).map(async e=>{if(!a)try{let t=await E(e,o);if(i.add(t.controller),a){t.controller.abort(),i.delete(t.controller);return}await m(t),i.delete(t.controller)}catch(t){console.warn("Failed to connect to OpenCode port:",e,t)}});await Promise.allSettled([e,...t])}catch(e){console.error("Error in event stream:",e)}finally{a=!0,l=null,e.signal.removeEventListener("abort",p),c()}},cancel(){l&&l()}});return new Response(d,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("Error creating event stream:",e),Response.json({error:"Failed to create event stream",details:e instanceof Error?e.message:String(e),hint:"Make sure OpenCode is running with an exposed API port. Example: opencode --port <PORT> (VibePulse auto-detects active ports)."},{status:500})}}e.s(["GET",()=>y],94866);var R=e.i(94866);let O=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/opencode-events/route",pathname:"/api/opencode-events",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/opencode-events/route.ts",nextConfigOutput:"standalone",userland:R}),{workAsyncStorage:C,workUnitAsyncStorage:b,serverHooks:P}=O;function T(){return(0,n.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:b})}async function S(e,t,n){O.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/opencode-events/route";x=x.replace(/\/index$/,"")||"/";let w=await O.prepare(e,t,{srcPage:x,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:E,params:y,nextConfig:R,parsedUrl:C,isDraftMode:b,prerenderManifest:P,routerServerContext:T,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,resolvedPathname:N,clientReferenceManifest:M,serverActionsManifest:I}=w,_=(0,s.normalizeAppPath)(x),k=!!(P.dynamicRoutes[_]||P.routes[N]),D=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,C,!1):t.end("This page could not be found"),null);if(k&&!b){let e=!!P.routes[N],t=P.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(R.experimental.adapterPath)return await D();throw new v.NoFallbackError}}let q=null;!k||O.isDev||b||(q="/index"===(q=N)?"/":q);let U=!0===O.isDev||!k,j=k&&!U;I&&M&&(0,i.setManifestsSingleton)({page:x,clientReferenceManifest:M,serverActionsManifest:I});let F=e.method||"GET",H=(0,a.getTracer)(),$=H.getActiveScopeSpan(),L={params:y,prerenderManifest:P,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:R.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,o)=>O.onRequestError(e,t,n,o,T)},sharedContext:{buildId:E}},K=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(K,(0,d.signalFromNodeResponse)(t));try{let i=async e=>O.handle(W,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.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=`${F} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${F} ${x}`)}),s=!!(0,o.getRequestMeta)(e,"minimalMode"),l=async o=>{var a,l;let d=async({previousCacheEntry:r})=>{try{if(!s&&S&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(o);e.fetchMetrics=L.renderOpts.fetchMetrics;let l=L.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=L.renderOpts.collectedTags;if(!k)return await (0,p.sendResponse)(K,V,a,L.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[h.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,n=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await O.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:S})},!1,T),t}},u=await O.handleResponse({req:e,nextConfig:R,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:A,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:s});if(!k)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",S?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let v=(0,m.fromNodeOutgoingHttpHeaders)(u.value.headers);return s&&k||v.delete(h.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||v.get("Cache-Control")||v.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(K,V,new Response(u.value.body,{headers:v,status:u.value.status||200})),null};$?await l($):await H.withPropagatedContext(e.headers,()=>H.trace(u.BaseServerSpan.handleRequest,{spanName:`${F} ${x}`,kind:a.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l))}catch(t){if(t instanceof v.NoFallbackError||await O.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:S})},!1,T),k)throw t;return await (0,p.sendResponse)(K,V,new Response(null,{status:500})),null}}e.s(["handler",()=>S,"patchFetch",()=>T,"routeModule",()=>O,"serverHooks",()=>P,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>b],46418)}];
|
|
4
|
-
|
|
5
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__9f034d03._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/opencodeDiscovery.ts","../../../src/app/api/opencode-events/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { execSync } from 'child_process';\n\nconst DEFAULT_DISCOVERY_COMMAND_TIMEOUT_MS = 5000;\nconst knownPorts = new Set<number>();\n\nexport type OpencodeProcessCwd = {\n pid: number;\n cwd: string;\n};\n\nexport type OpencodePortDiscoveryResult = {\n ports: number[];\n timedOut: boolean;\n};\n\nexport type OpencodeProcessCwdDiscoveryResult = {\n processes: OpencodeProcessCwd[];\n timedOut: boolean;\n};\n\ntype DiscoveryState = {\n timedOut: boolean;\n timeoutMs: number;\n deadlineMs: number;\n};\n\nfunction getDiscoveryCommandTimeoutMs(): number {\n const parsedTimeout = Number(process.env.OPENCODE_DISCOVERY_TIMEOUT_MS);\n return Number.isFinite(parsedTimeout) && parsedTimeout > 0\n ? parsedTimeout\n : DEFAULT_DISCOVERY_COMMAND_TIMEOUT_MS;\n}\n\nfunction isCommandTimeoutError(error: unknown): boolean {\n if (!(error instanceof Error)) {\n return false;\n }\n\n type TimeoutLikeError = Error & {\n code?: string;\n signal?: string;\n killed?: boolean;\n };\n\n const timeoutError = error as TimeoutLikeError;\n const message = timeoutError.message.toLowerCase();\n return timeoutError.code === 'ETIMEDOUT' || message.includes('timed out') || message.includes('etimedout');\n}\n\nfunction getRemainingTimeoutMs(state: DiscoveryState): number | null {\n const remainingMs = state.deadlineMs - Date.now();\n if (remainingMs <= 0) {\n state.timedOut = true;\n return null;\n }\n\n return Math.max(1, Math.min(state.timeoutMs, remainingMs));\n}\n\nfunction toUniqueSortedPorts(ports: number[]): number[] {\n return Array.from(\n new Set(ports.filter((port) => Number.isInteger(port) && port > 0 && port <= 65535))\n ).sort((a, b) => a - b);\n}\n\nfunction getPortsFromLsof(state: DiscoveryState): number[] {\n try {\n const timeoutMs = getRemainingTimeoutMs(state);\n if (timeoutMs === null) {\n return [];\n }\n\n const output = execSync('lsof -nP -iTCP -sTCP:LISTEN', {\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: timeoutMs,\n });\n const lines = output.split('\\n');\n const ports: number[] = [];\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith('COMMAND')) {\n continue;\n }\n\n const parts = trimmed.split(/\\s+/);\n const command = parts[0]?.toLowerCase();\n if (command !== 'opencode') {\n continue;\n }\n\n const match = trimmed.match(/:(\\d+)\\s+\\(LISTEN\\)/);\n if (!match) {\n continue;\n }\n\n const port = parseInt(match[1], 10);\n if (Number.isFinite(port)) {\n ports.push(port);\n }\n }\n\n return ports;\n } catch (error) {\n if (isCommandTimeoutError(error)) {\n state.timedOut = true;\n }\n return [];\n }\n}\n\nfunction getPortsFromProcessArgs(state: DiscoveryState): number[] {\n try {\n const timeoutMs = getRemainingTimeoutMs(state);\n if (timeoutMs === null) {\n return [];\n }\n\n const output = execSync('ps -axo command', {\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: timeoutMs,\n });\n const matches = [...output.matchAll(/\\bopencode\\b[^\\n]*\\b--port(?:=|\\s+)(\\d+)\\b/g)];\n return matches\n .map((match) => parseInt(match[1], 10))\n .filter((port) => Number.isFinite(port));\n } catch (error) {\n if (isCommandTimeoutError(error)) {\n state.timedOut = true;\n }\n return [];\n }\n}\n\nexport function discoverOpencodePorts(): number[] {\n return discoverOpencodePortsWithMeta().ports;\n}\n\nexport function discoverOpencodePortsWithMeta(): OpencodePortDiscoveryResult {\n const timeoutMs = getDiscoveryCommandTimeoutMs();\n const state: DiscoveryState = {\n timedOut: false,\n timeoutMs,\n deadlineMs: Date.now() + timeoutMs,\n };\n\n const discoveredPorts = toUniqueSortedPorts([\n ...getPortsFromLsof(state),\n ...getPortsFromProcessArgs(state),\n ]);\n\n for (const port of discoveredPorts) {\n knownPorts.add(port);\n }\n\n const ports = toUniqueSortedPorts([\n ...discoveredPorts,\n ...Array.from(knownPorts),\n ]);\n\n return {\n ports,\n timedOut: state.timedOut,\n };\n}\n\nfunction getOpencodePidsWithoutPortFlag(state: DiscoveryState): number[] {\n try {\n const timeoutMs = getRemainingTimeoutMs(state);\n if (timeoutMs === null) {\n return [];\n }\n\n const output = execSync('ps -axo pid=,command=', {\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: timeoutMs,\n });\n\n const pids: number[] = [];\n const lines = output.split('\\n');\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n\n const match = trimmed.match(/^(\\d+)\\s+(.+)$/);\n if (!match) continue;\n\n const pid = parseInt(match[1], 10);\n const command = match[2];\n\n if (!Number.isFinite(pid)) continue;\n if (!/\\bopencode\\b/.test(command)) continue;\n if (/\\b--port(?:=|\\s+)\\d+\\b/.test(command)) continue;\n\n pids.push(pid);\n }\n\n return Array.from(new Set(pids));\n } catch (error) {\n if (isCommandTimeoutError(error)) {\n state.timedOut = true;\n }\n return [];\n }\n}\n\nfunction getCwdForPid(pid: number, state: DiscoveryState): string | null {\n try {\n const timeoutMs = getRemainingTimeoutMs(state);\n if (timeoutMs === null) {\n return null;\n }\n\n const output = execSync(`lsof -nP -a -p ${pid} -d cwd -Fn`, {\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: timeoutMs,\n });\n\n const cwdLine = output\n .split('\\n')\n .find((line) => line.startsWith('n') && line.length > 1);\n\n if (!cwdLine) return null;\n return cwdLine.slice(1);\n } catch (error) {\n if (isCommandTimeoutError(error)) {\n state.timedOut = true;\n }\n return null;\n }\n}\n\nexport function discoverOpencodeProcessCwdsWithoutPort(): OpencodeProcessCwd[] {\n return discoverOpencodeProcessCwdsWithoutPortWithMeta().processes;\n}\n\nexport function discoverOpencodeProcessCwdsWithoutPortWithMeta(): OpencodeProcessCwdDiscoveryResult {\n const timeoutMs = getDiscoveryCommandTimeoutMs();\n const state: DiscoveryState = {\n timedOut: false,\n timeoutMs,\n deadlineMs: Date.now() + timeoutMs,\n };\n\n const pids = getOpencodePidsWithoutPortFlag(state);\n if (!pids.length) {\n return {\n processes: [],\n timedOut: state.timedOut,\n };\n }\n\n const processes: OpencodeProcessCwd[] = [];\n const seen = new Set<string>();\n\n for (const pid of pids) {\n const cwd = getCwdForPid(pid, state);\n if (!cwd) continue;\n\n const key = `${pid}:${cwd}`;\n if (seen.has(key)) continue;\n seen.add(key);\n processes.push({ pid, cwd });\n }\n\n return {\n processes,\n timedOut: state.timedOut,\n };\n}\n","import { createOpencodeClient } from '@opencode-ai/sdk';\nimport { discoverOpencodePortsWithMeta } from '@/lib/opencodeDiscovery';\n\nconst DEFAULT_EVENTS_PREFLIGHT_TIMEOUT_MS = 2500;\n\ntype ConnectedStream = {\n port: number;\n stream: AsyncIterable<unknown>;\n controller: AbortController;\n};\n\nfunction getPreflightTimeoutMs(): number {\n const parsedTimeout = Number(process.env.OPENCODE_EVENTS_PREFLIGHT_TIMEOUT_MS);\n return Number.isFinite(parsedTimeout) && parsedTimeout > 0\n ? parsedTimeout\n : DEFAULT_EVENTS_PREFLIGHT_TIMEOUT_MS;\n}\n\nasync function connectEventStreamWithTimeout(\n port: number,\n timeoutMs: number,\n controller?: AbortController\n): Promise<ConnectedStream> {\n const connectionController = controller ?? new AbortController();\n const client = createOpencodeClient({ baseUrl: `http://localhost:${port}` });\n\n let timerId: ReturnType<typeof setTimeout> | null = null;\n const timeoutPromise = new Promise<never>((_, reject) => {\n timerId = setTimeout(() => {\n connectionController.abort();\n reject(new Error(`OpenCode event stream preflight timed out for port ${port} after ${timeoutMs}ms`));\n }, timeoutMs);\n });\n\n try {\n const connection = await Promise.race([\n client.global.event({ signal: connectionController.signal }),\n timeoutPromise,\n ]);\n return {\n port,\n stream: connection.stream as AsyncIterable<unknown>,\n controller: connectionController,\n };\n } finally {\n if (timerId) {\n clearTimeout(timerId);\n }\n }\n}\n\nexport async function GET(request: Request) {\n const encoder = new TextEncoder();\n const { ports, timedOut } = discoverOpencodePortsWithMeta();\n \n if (!ports.length) {\n if (timedOut) {\n return Response.json(\n {\n error: 'OpenCode discovery timed out',\n hint: 'Host process discovery exceeded timeout. Retry shortly, or increase OPENCODE_DISCOVERY_TIMEOUT_MS.'\n },\n { status: 503 }\n );\n }\n\n return Response.json(\n {\n error: 'OpenCode server not found',\n hint: 'Make sure OpenCode is running with an exposed API port. Example: opencode --port <PORT> (VibePulse auto-detects active ports).'\n },\n { status: 503 }\n );\n }\n\n try {\n const preflightTimeoutMs = getPreflightTimeoutMs();\n const preflightControllers = new Map<number, AbortController>();\n const preflightAttempts = ports.map((port) => {\n const controller = new AbortController();\n preflightControllers.set(port, controller);\n return connectEventStreamWithTimeout(port, preflightTimeoutMs, controller);\n });\n\n const firstConnectedStream = await Promise.any(preflightAttempts).catch(async () => {\n const settled = await Promise.allSettled(preflightAttempts);\n for (const result of settled) {\n if (result.status === 'rejected') {\n console.warn('Failed to connect to OpenCode port during preflight:', result.reason);\n }\n }\n return null;\n });\n\n if (!firstConnectedStream) {\n return Response.json(\n {\n error: 'Failed to connect to OpenCode event stream',\n hint: 'Detected OpenCode ports but event streaming handshake failed. Ensure OpenCode API is reachable and retry.',\n },\n { status: 503 }\n );\n }\n\n for (const [port, controller] of preflightControllers.entries()) {\n if (port !== firstConnectedStream.port) {\n controller.abort();\n }\n }\n\n let teardown: (() => void) | null = null;\n const stream = new ReadableStream({\n async start(controller) {\n let isClosed = false;\n const activeControllers = new Set<AbortController>([firstConnectedStream.controller]);\n const activeIterators = new Set<AsyncIterator<unknown>>();\n const enqueueEvent = (event: unknown) => {\n try {\n controller.enqueue(encoder.encode(`data: ${JSON.stringify(event)}\\n\\n`));\n return true;\n } catch {\n return false;\n }\n };\n\n const closeControllerSafely = () => {\n try {\n controller.close();\n } catch {\n // Connection may already be closed\n }\n };\n\n const onAbort = () => {\n if (teardown) {\n teardown();\n return;\n }\n isClosed = true;\n closeControllerSafely();\n };\n\n teardown = () => {\n isClosed = true;\n for (const activeController of activeControllers) {\n activeController.abort();\n }\n void Promise.allSettled(Array.from(activeIterators).map((iterator) => iterator.return?.()));\n request.signal.removeEventListener('abort', onAbort);\n closeControllerSafely();\n };\n\n request.signal.addEventListener('abort', onAbort);\n\n const streamEvents = async (connected: { port: number; stream: AsyncIterable<unknown> }) => {\n const iterator = connected.stream[Symbol.asyncIterator]();\n activeIterators.add(iterator);\n try {\n while (!isClosed) {\n const next = await iterator.next();\n if (next.done) {\n break;\n }\n const event = next.value;\n if (isClosed) break;\n if (!enqueueEvent(event)) {\n break;\n }\n }\n } catch (error) {\n console.warn('OpenCode event stream failed for port:', connected.port, error);\n } finally {\n activeIterators.delete(iterator);\n console.warn('OpenCode event stream disconnected for port:', connected.port);\n }\n };\n \n try {\n const primaryTask = streamEvents(firstConnectedStream);\n\n const remainingPorts = ports.filter((port) => port !== firstConnectedStream.port);\n const secondaryTasks = remainingPorts.map(async (port) => {\n if (isClosed) {\n return;\n }\n\n try {\n const connected = await connectEventStreamWithTimeout(port, preflightTimeoutMs);\n activeControllers.add(connected.controller);\n if (isClosed) {\n connected.controller.abort();\n activeControllers.delete(connected.controller);\n return;\n }\n await streamEvents(connected);\n activeControllers.delete(connected.controller);\n } catch (error) {\n console.warn('Failed to connect to OpenCode port:', port, error);\n }\n });\n\n await Promise.allSettled([primaryTask, ...secondaryTasks]);\n } catch (error) {\n console.error('Error in event stream:', error);\n } finally {\n isClosed = true;\n teardown = null;\n request.signal.removeEventListener('abort', onAbort);\n closeControllerSafely();\n }\n },\n cancel() {\n if (teardown) {\n teardown();\n }\n },\n });\n\n return new Response(stream, {\n headers: {\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache',\n Connection: 'keep-alive',\n },\n });\n } catch (error) {\n console.error('Error creating event stream:', error);\n return Response.json(\n {\n error: 'Failed to create event stream',\n details: error instanceof Error ? error.message : String(error),\n hint: 'Make sure OpenCode is running with an exposed API port. Example: opencode --port <PORT> (VibePulse auto-detects active ports).'\n },\n { status: 500 }\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 } 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 = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/opencode-events/route\",\n pathname: \"/api/opencode-events\",\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]/src/app/api/opencode-events/route.ts\",\n nextConfigOutput,\n userland\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 (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/opencode-events/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.experimental.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 context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, '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 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 } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\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 (activeSpan) {\n await handleResponse(activeSpan);\n } else {\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));\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":[],"mappings":"64BAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAGA,IAAM,EAAa,IAAI,IAuBvB,SAAS,IACP,IAAM,EAAgB,OAAO,QAAQ,GAAG,CAAC,6BAA6B,EACtE,OAAO,OAAO,QAAQ,CAAC,IAAkB,EAAgB,EACrD,EA3BuC,GA6B7C,CAEA,SAAS,CAHH,CAGyB,CAAc,EAC3C,GAAI,CAAC,CAAC,aAAiB,KAAA,CAAK,CAC1B,EAD6B,KACtB,EAUT,IAAM,EAAU,EAAa,OAAO,CAAC,WAAW,GAChD,MAA6B,cAFR,AAEd,EAAa,IAAI,EAAoB,EAAQ,QAAQ,CAAC,cAAgB,EAAQ,QAAQ,CAAC,YAChG,CAEA,SAAS,EAAsB,CAAqB,EAClD,IAAM,EAAc,EAAM,UAAU,CAAG,KAAK,GAAG,UAC/C,AAAI,GAAe,GAAG,AACpB,EAAM,QAAQ,EAAG,EACV,MAGF,KAAK,GAAG,CAAC,EAAG,KAAK,GAAG,CAAC,EAAM,SAAS,CAAE,GAC/C,CAEA,SAAS,EAAoB,CAAe,EAC1C,OAAO,MAAM,IAAI,CACf,IAAI,IAAI,EAAM,MAAM,CAAC,AAAC,GAAS,OAAO,SAAS,CAAC,IAAS,EAAO,GAAK,GAAQ,SAC7E,IAAI,CAAC,CAAC,EAAG,IAAM,EAAI,EACvB,CA6EO,SAAS,IACd,IAAM,EAAY,IACZ,EAAwB,CAC5B,UAAU,EACV,YACA,WAAY,KAAK,GAAG,GAAK,CAC3B,EAEM,EAAkB,EAAoB,IACvC,AApFP,S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5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[2]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[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"))},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"))},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"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},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"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},53977,e=>{"use strict";var t=e.i(24868),r=e.i(22734),i=e.i(14747),a=e.i(46786),n=e.i(89196);let o=(0,i.join)((0,a.homedir)(),".config","opencode","profiles"),s=(0,i.join)(o,"index.json"),l=[{id:"balanced",name:"Balanced",emoji:"⚖️",description:"Balanced multi-model orchestration optimized for general coding tasks",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isBuiltIn:!0}],d={balanced:{agents:{sisyphus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},oracle:{model:"openai/gpt-5.4",variant:"high",temperature:.2,top_p:.9},prometheus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},metis:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},momus:{model:"openai/gpt-5.4",variant:"medium",temperature:.2,top_p:.9},atlas:{model:"anthropic/claude-sonnet-4-6",temperature:.2,top_p:.9},hepheastus:{model:"openai/gpt-5.3-codex",variant:"xhigh",temperature:.2,top_p:.9},librarian:{model:"anthropic/claude-sonnet-4-6",temperature:.3,top_p:.9},explore:{model:"anthropic/claude-haiku-4-5",temperature:.1,top_p:.9},"multimodal-looker":{model:"google/gemini-3.1-pro",variant:"high",temperature:.2,top_p:.9},"frontend-ui-ux":{model:"google/gemini-3.1-pro",variant:"high",temperature:.3,top_p:.9}},categories:{"visual-engineering":{model:"google/gemini-3.1-pro",variant:"high"},ultrabrain:{model:"openai/gpt-5.3-codex",variant:"xhigh"},deep:{model:"openai/gpt-5.3-codex",variant:"medium"},artistry:{model:"google/gemini-3.1-pro",variant:"high"},quick:{model:"anthropic/claude-haiku-4-5",temperature:.1},"unspecified-low":{model:"anthropic/claude-sonnet-4-6",temperature:.2},"unspecified-high":{model:"openai/gpt-5.4",variant:"high",temperature:.2},writing:{model:"google/gemini-3-flash",temperature:.3}}}};function u(){(0,r.existsSync)(o)||(0,r.mkdirSync)(o,{recursive:!0})}function p(e){return(0,i.join)(o,`${e}.json`)}function c(){return{version:1,profiles:[...l],activeProfileId:null,lastModified:new Date().toISOString()}}async function f(){let e=new Set(l.map(e=>e.id));for(let i of["coding","writing","debug","minimal"])if(!e.has(i)){let e=p(i);(0,r.existsSync)(e)&&await (0,t.unlink)(e)}for(let e of l){let r=p(e.id),i=d[e.id]||{agents:{}},a=(0,n.stringify)(i,null,2);await (0,t.writeFile)(r,a,"utf-8")}}async function g(){return m(!0)}async function h(){return m(!1)}async function m(e){try{if(u(),!(0,r.existsSync)(s)){let e=c();return await x(e),await f(),e}let e=await (0,t.readFile)(s,"utf-8"),i=(0,n.parse)(e,null,!1),a=!1;for(let e of l)i.profiles.some(t=>t.id===e.id)||(i.profiles.push(e),a=!0);let o=new Set(l.map(e=>e.id)),d=i.profiles.length;return i.profiles=i.profiles.filter(e=>!e.isBuiltIn||o.has(e.id)),i.profiles.length!==d&&(a=!0),await f(),a&&(i.lastModified=new Date().toISOString(),await x(i)),i}catch(t){if(!e)throw t;return c()}}async function x(e){u(),e.lastModified=new Date().toISOString();let r=(0,n.stringify)(e,null,2);await (0,t.writeFile)(s,r,"utf-8")}async function w(e){try{let i=p(e);if(!(0,r.existsSync)(i))return{agents:{}};let a=await (0,t.readFile)(i,"utf-8");return(0,n.parse)(a,null,!1)}catch{return{agents:{}}}}async function v(e,r){u();let i=p(e),a=(0,n.stringify)(r,null,2);await (0,t.writeFile)(i,a,"utf-8")}async function y(e){let i=(await g()).profiles.find(t=>t.id===e);if(i?.isBuiltIn){let t=d[e]||{agents:{}};return await v(e,t),!0}let a=p(e);return!!(0,r.existsSync)(a)&&(await (0,t.unlink)(a),!0)}async function R(e){return(await g()).profiles.find(t=>t.id===e)}async function C(e){let t=await g();t.activeProfileId=e,await x(t)}e.s(["deleteProfileConfig",()=>y,"getProfileById",()=>R,"readProfileConfig",()=>w,"readProfileIndex",()=>g,"readProfileIndexStrict",()=>h,"setActiveProfileId",()=>C,"writeProfileConfig",()=>v,"writeProfileIndex",()=>x])},57181,e=>{"use strict";var t=e.i(24868),r=e.i(22734),i=e.i(14747),a=e.i(46786),n=e.i(89196);let o=(0,i.join)((0,a.homedir)(),".config","opencode"),s=(0,i.join)(o,"oh-my-opencode.jsonc");function l(e=s){try{return(0,r.existsSync)(e)}catch{return!1}}async function d(e=s){try{let r=await (0,t.readFile)(e,"utf-8");return(0,n.parse)(r,null,!1)}catch{return{}}}async function u(e,a=s){try{let o=(0,i.join)(a,"..");(0,r.existsSync)(o)||(0,r.mkdirSync)(o,{recursive:!0});let l=a===s?{...e,$schema:e.$schema||"https://opencode.ai/config.json"}:e,d=(0,n.stringify)(l,null,2);await (0,t.writeFile)(a,d,"utf-8")}catch(e){throw Error(`Failed to write config: ${e}`)}}e.s(["CONFIG_PATH",0,s,"detectConfig",()=>l,"readConfig",()=>d,"writeConfig",()=>u])},13005,e=>{"use strict";var t=e.i(47909),r=e.i(74017),i=e.i(96250),a=e.i(59756),n=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),p=e.i(47587),c=e.i(66012),f=e.i(70101),g=e.i(26937),h=e.i(10372),m=e.i(93695);e.i(52474);var x=e.i(220),w=e.i(89171),v=e.i(53977),y=e.i(57181);async function R(e,{params:t}){try{let{id:e}=await t,r=await (0,v.getProfileById)(e);if(!r)return w.NextResponse.json({error:"Profile not found"},{status:404});let i=await (0,v.readProfileConfig)(e),a={...await (0,y.readConfig)(),agents:i.agents,categories:i.categories};return await (0,y.writeConfig)(a),await (0,v.setActiveProfileId)(e),w.NextResponse.json({message:"Profile applied successfully",profile:r,config:i})}catch(e){return console.error("Error applying profile:",e),w.NextResponse.json({error:"Internal server error"},{status:500})}}e.s(["POST",()=>R],4643);var C=e.i(4643);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/profiles/[id]/apply/route",pathname:"/api/profiles/[id]/apply",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/profiles/[id]/apply/route.ts",nextConfigOutput:"standalone",userland:C}),{workAsyncStorage:S,workUnitAsyncStorage:P,serverHooks:A}=E;function I(){return(0,i.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:P})}async function b(e,t,i){E.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/profiles/[id]/apply/route";w=w.replace(/\/index$/,"")||"/";let v=await E.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:y,params:R,nextConfig:C,parsedUrl:S,isDraftMode:P,prerenderManifest:A,routerServerContext:I,isOnDemandRevalidate:b,revalidateOnlyGenerated:_,resolvedPathname:j,clientReferenceManifest:k,serverActionsManifest:O}=v,N=(0,s.normalizeAppPath)(w),T=!!(A.dynamicRoutes[N]||A.routes[j]),q=async()=>((null==I?void 0:I.render404)?await I.render404(e,t,S,!1):t.end("This page could not be found"),null);if(T&&!P){let e=!!A.routes[j],t=A.dynamicRoutes[N];if(t&&!1===t.fallback&&!e){if(C.experimental.adapterPath)return await q();throw new m.NoFallbackError}}let D=null;!T||E.isDev||P||(D="/index"===(D=j)?"/":D);let H=!0===E.isDev||!T,F=T&&!H;O&&k&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:k,serverActionsManifest:O});let U=e.method||"GET",M=(0,n.getTracer)(),$=M.getActiveScopeSpan(),B={params:R,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:C.cacheLife,waitUntil:i.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,i,a)=>E.onRequestError(e,t,i,a,I)},sharedContext:{buildId:y}},K=new l.NodeNextRequest(e),L=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(K,(0,d.signalFromNodeResponse)(t));try{let o=async e=>E.handle(G,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.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 i=r.get("next.route");if(i){let t=`${U} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${w}`)}),s=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var n,l;let d=async({previousCacheEntry:r})=>{try{if(!s&&b&&_&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(a);e.fetchMetrics=B.renderOpts.fetchMetrics;let l=B.renderOpts.pendingWaitUntil;l&&i.waitUntil&&(i.waitUntil(l),l=void 0);let d=B.renderOpts.collectedTags;if(!T)return await (0,c.sendResponse)(K,L,n,B.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(n.headers);d&&(t[h.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,i=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:i}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:b})},!1,I),t}},u=await E.handleResponse({req:e,nextConfig:C,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:_,responseGenerator:d,waitUntil:i.waitUntil,isMinimalMode:s});if(!T)return null;if((null==u||null==(n=u.value)?void 0:n.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",b?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),P&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,f.fromNodeOutgoingHttpHeaders)(u.value.headers);return s&&T||m.delete(h.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,g.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(K,L,new Response(u.value.body,{headers:m,status:u.value.status||200})),null};$?await l($):await M.withPropagatedContext(e.headers,()=>M.trace(u.BaseServerSpan.handleRequest,{spanName:`${U} ${w}`,kind:n.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},l))}catch(t){if(t instanceof m.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:b})},!1,I),T)throw t;return await (0,c.sendResponse)(K,L,new Response(null,{status:500})),null}}e.s(["handler",()=>b,"patchFetch",()=>I,"routeModule",()=>E,"serverHooks",()=>A,"workAsyncStorage",()=>S,"workUnitAsyncStorage",()=>P],13005)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__a84faf4b._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/profiles/storage.ts","../../../src/lib/opencodeConfig.ts","../../../src/app/api/profiles/%5Bid%5D/apply/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { readFile, writeFile, unlink } from 'fs/promises';\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\nimport { parse, stringify } from 'comment-json';\nimport type { AgentConfig, CategoryConfig } from '@/types/opencodeConfig';\n\nexport const PROFILES_DIR = join(homedir(), '.config', 'opencode', 'profiles');\nexport const PROFILE_INDEX_PATH = join(PROFILES_DIR, 'index.json');\n\nexport interface Profile {\n id: string;\n name: string;\n emoji: string;\n description?: string;\n createdAt: string;\n updatedAt: string;\n isDefault?: boolean;\n isBuiltIn?: boolean;\n}\n\nexport interface ProfileIndex {\n version: number;\n profiles: Profile[];\n activeProfileId: string | null;\n lastModified: string;\n}\n\nexport interface ProfileConfig {\n agents: Record<string, AgentConfig>;\n categories?: Record<string, CategoryConfig>;\n}\n\nconst BUILTIN_PROFILES: Profile[] = [\n {\n id: 'balanced',\n name: 'Balanced',\n emoji: '⚖️',\n description: 'Balanced multi-model orchestration optimized for general coding tasks',\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n isBuiltIn: true,\n },\n];\n\nconst BUILTIN_PROFILE_CONFIGS: Record<string, ProfileConfig> = {\n balanced: {\n agents: {\n sisyphus: {\n model: 'anthropic/claude-opus-4-6',\n variant: 'max',\n temperature: 0.2,\n top_p: 0.9,\n },\n oracle: {\n model: 'openai/gpt-5.4',\n variant: 'high',\n temperature: 0.2,\n top_p: 0.9,\n },\n prometheus: {\n model: 'anthropic/claude-opus-4-6',\n variant: 'max',\n temperature: 0.2,\n top_p: 0.9,\n },\n metis: {\n model: 'anthropic/claude-opus-4-6',\n variant: 'max',\n temperature: 0.2,\n top_p: 0.9,\n },\n momus: {\n model: 'openai/gpt-5.4',\n variant: 'medium',\n temperature: 0.2,\n top_p: 0.9,\n },\n atlas: {\n model: 'anthropic/claude-sonnet-4-6',\n temperature: 0.2,\n top_p: 0.9,\n },\n hepheastus: {\n model: 'openai/gpt-5.3-codex',\n variant: 'xhigh',\n temperature: 0.2,\n top_p: 0.9,\n },\n librarian: {\n model: 'anthropic/claude-sonnet-4-6',\n temperature: 0.3,\n top_p: 0.9,\n },\n explore: {\n model: 'anthropic/claude-haiku-4-5',\n temperature: 0.1,\n top_p: 0.9,\n },\n 'multimodal-looker': {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n temperature: 0.2,\n top_p: 0.9,\n },\n 'frontend-ui-ux': {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n temperature: 0.3,\n top_p: 0.9,\n },\n },\n categories: {\n 'visual-engineering': {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n },\n ultrabrain: {\n model: 'openai/gpt-5.3-codex',\n variant: 'xhigh',\n },\n deep: {\n model: 'openai/gpt-5.3-codex',\n variant: 'medium',\n },\n artistry: {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n },\n quick: {\n model: 'anthropic/claude-haiku-4-5',\n temperature: 0.1,\n },\n 'unspecified-low': {\n model: 'anthropic/claude-sonnet-4-6',\n temperature: 0.2,\n },\n 'unspecified-high': {\n model: 'openai/gpt-5.4',\n variant: 'high',\n temperature: 0.2,\n },\n writing: {\n model: 'google/gemini-3-flash',\n temperature: 0.3,\n },\n },\n },\n};\n\nexport function ensureProfilesDir(): void {\n if (!existsSync(PROFILES_DIR)) {\n mkdirSync(PROFILES_DIR, { recursive: true });\n }\n}\n\nfunction getProfileConfigPath(id: string): string {\n return join(PROFILES_DIR, `${id}.json`);\n}\n\nfunction createDefaultProfileIndex(): ProfileIndex {\n return {\n version: 1,\n profiles: [...BUILTIN_PROFILES],\n activeProfileId: null,\n lastModified: new Date().toISOString(),\n };\n}\n\nasync function createBuiltinProfileConfigs(): Promise<void> {\n const validBuiltinIds = new Set(BUILTIN_PROFILES.map(p => p.id));\n const deprecatedBuiltinIds = ['coding', 'writing', 'debug', 'minimal'];\n\n for (const deprecatedId of deprecatedBuiltinIds) {\n if (!validBuiltinIds.has(deprecatedId)) {\n const deprecatedConfigPath = getProfileConfigPath(deprecatedId);\n if (existsSync(deprecatedConfigPath)) {\n await unlink(deprecatedConfigPath);\n }\n }\n }\n\n for (const profile of BUILTIN_PROFILES) {\n const configPath = getProfileConfigPath(profile.id);\n const config = BUILTIN_PROFILE_CONFIGS[profile.id] || { agents: {} };\n const content = stringify(config, null, 2);\n await writeFile(configPath, content, 'utf-8');\n }\n}\n\nexport async function readProfileIndex(): Promise<ProfileIndex> {\n return readProfileIndexInternal(true);\n}\n\nexport async function readProfileIndexStrict(): Promise<ProfileIndex> {\n return readProfileIndexInternal(false);\n}\n\nasync function readProfileIndexInternal(fallbackOnError: boolean): Promise<ProfileIndex> {\n try {\n ensureProfilesDir();\n\n if (!existsSync(PROFILE_INDEX_PATH)) {\n const defaultIndex = createDefaultProfileIndex();\n await writeProfileIndex(defaultIndex);\n await createBuiltinProfileConfigs();\n return defaultIndex;\n }\n\n const content = await readFile(PROFILE_INDEX_PATH, 'utf-8');\n const index = parse(content, null, false) as unknown as ProfileIndex;\n \n // Ensure all built-in profiles exist in the index\n let modified = false;\n for (const builtinProfile of BUILTIN_PROFILES) {\n const exists = index.profiles.some(p => p.id === builtinProfile.id);\n if (!exists) {\n index.profiles.push(builtinProfile);\n modified = true;\n }\n }\n \n // Remove built-in profiles that are no longer in BUILTIN_PROFILES\n const builtinIds = new Set(BUILTIN_PROFILES.map(p => p.id));\n const oldLength = index.profiles.length;\n index.profiles = index.profiles.filter(p => !p.isBuiltIn || builtinIds.has(p.id));\n if (index.profiles.length !== oldLength) {\n modified = true;\n }\n \n await createBuiltinProfileConfigs();\n \n if (modified) {\n index.lastModified = new Date().toISOString();\n await writeProfileIndex(index);\n }\n \n return index;\n } catch (error) {\n if (!fallbackOnError) {\n throw error;\n }\n return createDefaultProfileIndex();\n }\n}\n\nexport async function writeProfileIndex(index: ProfileIndex): Promise<void> {\n ensureProfilesDir();\n \n index.lastModified = new Date().toISOString();\n const content = stringify(index, null, 2);\n \n await writeFile(PROFILE_INDEX_PATH, content, 'utf-8');\n}\n\n\nexport async function readProfileConfig(id: string): Promise<ProfileConfig> {\n try {\n const configPath = getProfileConfigPath(id);\n \n if (!existsSync(configPath)) {\n return { agents: {} };\n }\n \n const content = await readFile(configPath, 'utf-8');\n const config = parse(content, null, false) as unknown as ProfileConfig;\n return config;\n } catch {\n return { agents: {} };\n }\n}\n\nexport async function writeProfileConfig(\n id: string, \n config: ProfileConfig\n): Promise<void> {\n ensureProfilesDir();\n \n const configPath = getProfileConfigPath(id);\n const content = stringify(config, null, 2);\n \n await writeFile(configPath, content, 'utf-8');\n}\n\nexport async function deleteProfileConfig(id: string): Promise<boolean> {\n const index = await readProfileIndex();\n const profile = index.profiles.find(p => p.id === id);\n \n if (profile?.isBuiltIn) {\n const defaultConfig = BUILTIN_PROFILE_CONFIGS[id] || { agents: {} };\n await writeProfileConfig(id, defaultConfig);\n return true;\n }\n \n const configPath = getProfileConfigPath(id);\n \n if (!existsSync(configPath)) {\n return false;\n }\n \n await unlink(configPath);\n return true;\n}\n\nexport async function getProfileById(id: string): Promise<Profile | undefined> {\n const index = await readProfileIndex();\n return index.profiles.find(p => p.id === id);\n}\n\nexport async function getActiveProfileId(): Promise<string | null> {\n const index = await readProfileIndex();\n return index.activeProfileId;\n}\n\nexport async function setActiveProfileId(id: string | null): Promise<void> {\n const index = await readProfileIndex();\n index.activeProfileId = id;\n await writeProfileIndex(index);\n}\n","import { readFile, writeFile } from 'fs/promises';\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\nimport { parse, stringify } from 'comment-json';\n\nexport const CONFIG_DIR = join(homedir(), '.config', 'opencode');\nexport const CONFIG_PATH = join(CONFIG_DIR, 'oh-my-opencode.jsonc');\nexport const OPEN_CODE_CONFIG_SCHEMA = 'https://opencode.ai/config.json';\n\nexport type OpenCodeConfig = {\n $schema?: string;\n agents?: Record<string, unknown>;\n [key: string]: unknown;\n};\n\nexport function detectConfig(configPath: string = CONFIG_PATH): boolean {\n try {\n return existsSync(configPath);\n } catch {\n return false;\n }\n}\n\nexport async function readConfig(configPath: string = CONFIG_PATH): Promise<OpenCodeConfig> {\n try {\n const content = await readFile(configPath, 'utf-8');\n const config = parse(content, null, false) as OpenCodeConfig;\n return config;\n } catch {\n return {};\n }\n}\n\nexport async function writeConfig(\n config: OpenCodeConfig, \n configPath: string = CONFIG_PATH\n): Promise<void> {\n try {\n const configDir = join(configPath, '..');\n if (!existsSync(configDir)) {\n mkdirSync(configDir, { recursive: true });\n }\n\n const shouldEnforceSchema = configPath === CONFIG_PATH;\n const configWithSchema: OpenCodeConfig = shouldEnforceSchema\n ? {\n ...config,\n $schema: config.$schema || OPEN_CODE_CONFIG_SCHEMA,\n }\n : config;\n\n const content = stringify(configWithSchema, null, 2);\n await writeFile(configPath, content, 'utf-8');\n } catch (error) {\n throw new Error(`Failed to write config: ${error}`);\n }\n}\n","import { NextRequest, NextResponse } from 'next/server';\nimport {\n readProfileConfig,\n getProfileById,\n setActiveProfileId,\n} from '@/lib/profiles/storage';\nimport { readConfig, writeConfig } from '@/lib/opencodeConfig';\n\ninterface RouteParams {\n params: Promise<{ id: string }>;\n}\n\nexport async function POST(_request: NextRequest, { params }: RouteParams) {\n try {\n const { id } = await params;\n const profile = await getProfileById(id);\n\n if (!profile) {\n return NextResponse.json(\n { error: 'Profile not found' },\n { status: 404 }\n );\n }\n\n const profileConfig = await readProfileConfig(id);\n const currentConfig = await readConfig();\n\n const mergedConfig = {\n ...currentConfig,\n agents: profileConfig.agents,\n categories: profileConfig.categories,\n };\n\n await writeConfig(mergedConfig);\n await setActiveProfileId(id);\n\n return NextResponse.json({\n message: 'Profile applied successfully',\n profile,\n config: profileConfig,\n });\n } catch (error) {\n console.error('Error applying profile:', error);\n return NextResponse.json(\n { error: 'Internal server error' },\n { status: 500 }\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 } 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 = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/profiles/[id]/apply/route\",\n pathname: \"/api/profiles/[id]/apply\",\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]/src/app/api/profiles/[id]/apply/route.ts\",\n nextConfigOutput,\n userland\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 (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/profiles/[id]/apply/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.experimental.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 context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, '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 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 } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\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 (activeSpan) {\n await handleResponse(activeSpan);\n } else {\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));\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":[],"mappings":"8iCAAA,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,OAGO,IAAM,EAAe,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,UAAW,WAAY,YACtD,EAAqB,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAc,cAyB/C,EAA8B,CAClC,CACE,GAAI,WACJ,KAAM,WACN,MAAO,KACP,YAAa,wEACb,UAAW,IAAI,OAAO,WAAW,GACjC,UAAW,IAAI,OAAO,WAAW,GACjC,UAAW,EACb,EACD,CAEK,EAAyD,CAC7D,SAAU,CACR,OAAQ,CACN,SAAU,CACR,MAAO,4BACP,QAAS,MACT,YAAa,GACb,MAAO,EACT,EACA,OAAQ,CACN,MAAO,iBACP,QAAS,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AAe,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,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[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"))},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"))},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"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},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"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},53977,e=>{"use strict";var t=e.i(24868),r=e.i(22734),n=e.i(14747),i=e.i(46786),a=e.i(89196);let o=(0,n.join)((0,i.homedir)(),".config","opencode","profiles"),s=(0,n.join)(o,"index.json"),l=[{id:"balanced",name:"Balanced",emoji:"⚖️",description:"Balanced multi-model orchestration optimized for general coding tasks",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isBuiltIn:!0}],d={balanced:{agents:{sisyphus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},oracle:{model:"openai/gpt-5.4",variant:"high",temperature:.2,top_p:.9},prometheus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},metis:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},momus:{model:"openai/gpt-5.4",variant:"medium",temperature:.2,top_p:.9},atlas:{model:"anthropic/claude-sonnet-4-6",temperature:.2,top_p:.9},hepheastus:{model:"openai/gpt-5.3-codex",variant:"xhigh",temperature:.2,top_p:.9},librarian:{model:"anthropic/claude-sonnet-4-6",temperature:.3,top_p:.9},explore:{model:"anthropic/claude-haiku-4-5",temperature:.1,top_p:.9},"multimodal-looker":{model:"google/gemini-3.1-pro",variant:"high",temperature:.2,top_p:.9},"frontend-ui-ux":{model:"google/gemini-3.1-pro",variant:"high",temperature:.3,top_p:.9}},categories:{"visual-engineering":{model:"google/gemini-3.1-pro",variant:"high"},ultrabrain:{model:"openai/gpt-5.3-codex",variant:"xhigh"},deep:{model:"openai/gpt-5.3-codex",variant:"medium"},artistry:{model:"google/gemini-3.1-pro",variant:"high"},quick:{model:"anthropic/claude-haiku-4-5",temperature:.1},"unspecified-low":{model:"anthropic/claude-sonnet-4-6",temperature:.2},"unspecified-high":{model:"openai/gpt-5.4",variant:"high",temperature:.2},writing:{model:"google/gemini-3-flash",temperature:.3}}}};function u(){(0,r.existsSync)(o)||(0,r.mkdirSync)(o,{recursive:!0})}function p(e){return(0,n.join)(o,`${e}.json`)}function c(){return{version:1,profiles:[...l],activeProfileId:null,lastModified:new Date().toISOString()}}async function f(){let e=new Set(l.map(e=>e.id));for(let n of["coding","writing","debug","minimal"])if(!e.has(n)){let e=p(n);(0,r.existsSync)(e)&&await (0,t.unlink)(e)}for(let e of l){let r=p(e.id),n=d[e.id]||{agents:{}},i=(0,a.stringify)(n,null,2);await (0,t.writeFile)(r,i,"utf-8")}}async function g(){return h(!0)}async function m(){return h(!1)}async function h(e){try{if(u(),!(0,r.existsSync)(s)){let e=c();return await x(e),await f(),e}let e=await (0,t.readFile)(s,"utf-8"),n=(0,a.parse)(e,null,!1),i=!1;for(let e of l)n.profiles.some(t=>t.id===e.id)||(n.profiles.push(e),i=!0);let o=new Set(l.map(e=>e.id)),d=n.profiles.length;return n.profiles=n.profiles.filter(e=>!e.isBuiltIn||o.has(e.id)),n.profiles.length!==d&&(i=!0),await f(),i&&(n.lastModified=new Date().toISOString(),await x(n)),n}catch(t){if(!e)throw t;return c()}}async function x(e){u(),e.lastModified=new Date().toISOString();let r=(0,a.stringify)(e,null,2);await (0,t.writeFile)(s,r,"utf-8")}async function w(e){try{let n=p(e);if(!(0,r.existsSync)(n))return{agents:{}};let i=await (0,t.readFile)(n,"utf-8");return(0,a.parse)(i,null,!1)}catch{return{agents:{}}}}async function v(e,r){u();let n=p(e),i=(0,a.stringify)(r,null,2);await (0,t.writeFile)(n,i,"utf-8")}async function y(e){let n=(await g()).profiles.find(t=>t.id===e);if(n?.isBuiltIn){let t=d[e]||{agents:{}};return await v(e,t),!0}let i=p(e);return!!(0,r.existsSync)(i)&&(await (0,t.unlink)(i),!0)}async function R(e){return(await g()).profiles.find(t=>t.id===e)}async function E(e){let t=await g();t.activeProfileId=e,await x(t)}e.s(["deleteProfileConfig",()=>y,"getProfileById",()=>R,"readProfileConfig",()=>w,"readProfileIndex",()=>g,"readProfileIndexStrict",()=>m,"setActiveProfileId",()=>E,"writeProfileConfig",()=>v,"writeProfileIndex",()=>x])},62851,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),i=e.i(59756),a=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),p=e.i(47587),c=e.i(66012),f=e.i(70101),g=e.i(26937),m=e.i(10372),h=e.i(93695);e.i(52474);var x=e.i(220),w=e.i(89171),v=e.i(53977);async function y(){try{let e=await (0,v.readProfileIndex)();return w.NextResponse.json({profiles:e.profiles,activeProfileId:e.activeProfileId})}catch(e){return console.error("Error reading profiles:",e),w.NextResponse.json({error:"Internal server error"},{status:500})}}async function R(e){try{let t=await e.json();if(!t||"object"!=typeof t)return w.NextResponse.json({error:"Invalid request body"},{status:400});let r=t.profile||t,{id:n,name:i,emoji:a,description:o}=r,s=t.config||r.config;if(!n||"string"!=typeof n||""===n.trim())return w.NextResponse.json({error:"id is required and must be a non-empty string"},{status:400});if(!i||"string"!=typeof i||""===i.trim())return w.NextResponse.json({error:"name is required and must be a non-empty string"},{status:400});if(await (0,v.getProfileById)(n))return w.NextResponse.json({error:`Profile with id '${n}' already exists`},{status:400});if(!/^[a-zA-Z0-9_-]+$/.test(n))return w.NextResponse.json({error:"id must contain only letters, numbers, hyphens, and underscores"},{status:400});let l=new Date().toISOString(),d={id:n.trim(),name:i.trim(),emoji:a||"⚙️",description:o?.trim()||void 0,createdAt:l,updatedAt:l},u=await (0,v.readProfileIndex)();if(u.profiles.push(d),await (0,v.writeProfileIndex)(u),s&&"object"==typeof s){let e={agents:s.agents||{},categories:s.categories};await (0,v.writeProfileConfig)(n,e)}else await (0,v.writeProfileConfig)(n,{agents:{}});return w.NextResponse.json({profile:d},{status:201})}catch(e){return console.error("Error creating profile:",e),w.NextResponse.json({error:"Internal server error"},{status:500})}}e.s(["GET",()=>y,"POST",()=>R],77081);var E=e.i(77081);let P=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/profiles/route",pathname:"/api/profiles",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/profiles/route.ts",nextConfigOutput:"standalone",userland:E}),{workAsyncStorage:S,workUnitAsyncStorage:C,serverHooks:I}=P;function b(){return(0,n.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:C})}async function j(e,t,n){P.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/profiles/route";w=w.replace(/\/index$/,"")||"/";let v=await P.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,params:R,nextConfig:E,parsedUrl:S,isDraftMode:C,prerenderManifest:I,routerServerContext:b,isOnDemandRevalidate:j,revalidateOnlyGenerated:A,resolvedPathname:N,clientReferenceManifest:_,serverActionsManifest:k}=v,O=(0,s.normalizeAppPath)(w),T=!!(I.dynamicRoutes[O]||I.routes[N]),q=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,S,!1):t.end("This page could not be found"),null);if(T&&!C){let e=!!I.routes[N],t=I.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await q();throw new h.NoFallbackError}}let D=null;!T||P.isDev||C||(D="/index"===(D=N)?"/":D);let H=!0===P.isDev||!T,U=T&&!H;k&&_&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:_,serverActionsManifest:k});let M=e.method||"GET",F=(0,a.getTracer)(),B=F.getActiveScopeSpan(),$={params:R,prerenderManifest:I,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>P.onRequestError(e,t,n,i,b)},sharedContext:{buildId:y}},K=new l.NodeNextRequest(e),L=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(K,(0,d.signalFromNodeResponse)(t));try{let o=async e=>P.handle(G,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.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=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${w}`)}),s=!!(0,i.getRequestMeta)(e,"minimalMode"),l=async i=>{var a,l;let d=async({previousCacheEntry:r})=>{try{if(!s&&j&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(i);e.fetchMetrics=$.renderOpts.fetchMetrics;let l=$.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=$.renderOpts.collectedTags;if(!T)return await (0,c.sendResponse)(K,L,a,$.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[m.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,n=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:j})},!1,b),t}},u=await P.handleResponse({req:e,nextConfig:E,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:I,isRoutePPREnabled:!1,isOnDemandRevalidate:j,revalidateOnlyGenerated:A,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:s});if(!T)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",j?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,f.fromNodeOutgoingHttpHeaders)(u.value.headers);return s&&T||h.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,g.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(K,L,new Response(u.value.body,{headers:h,status:u.value.status||200})),null};B?await l(B):await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${w}`,kind:a.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof h.NoFallbackError||await P.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:j})},!1,b),T)throw t;return await (0,c.sendResponse)(K,L,new Response(null,{status:500})),null}}e.s(["handler",()=>j,"patchFetch",()=>b,"routeModule",()=>P,"serverHooks",()=>I,"workAsyncStorage",()=>S,"workUnitAsyncStorage",()=>C],62851)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__b92251ea._.js.map
|