vibepulse 0.2.2 → 0.3.1-beta
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 +1 -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 +8 -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.js +2 -2
- package/.next/server/app/api/node/events/route.js.nft.json +1 -1
- package/.next/server/app/api/node/sessions/[id]/delete/route.js +2 -2
- package/.next/server/app/api/node/sessions/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/node/sessions/[id]/open-editor/route.js +2 -2
- package/.next/server/app/api/node/sessions/[id]/open-editor/route.js.nft.json +1 -1
- package/.next/server/app/api/node/sessions/route.js +6 -4
- package/.next/server/app/api/node/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/route.js +2 -2
- package/.next/server/app/api/nodes/route.js.nft.json +1 -1
- package/.next/server/app/api/opencode-config/route.js +2 -2
- package/.next/server/app/api/opencode-config/route.js.nft.json +1 -1
- package/.next/server/app/api/opencode-config/status/route.js +2 -2
- package/.next/server/app/api/opencode-config/status/route.js.nft.json +1 -1
- package/.next/server/app/api/opencode-events/route.js +3 -3
- package/.next/server/app/api/opencode-events/route.js.nft.json +1 -1
- package/.next/server/app/api/profiles/[id]/apply/route.js +2 -2
- 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 +3 -2
- package/.next/server/app/api/sessions/[id]/archive/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/delete/route.js +4 -3
- package/.next/server/app/api/sessions/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/open-editor/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/open-editor/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/restore/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/sessions/[id]/restore/route/build-manifest.json +11 -0
- package/.next/server/app/api/sessions/[id]/restore/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/sessions/[id]/restore/route.js +8 -0
- package/.next/server/app/api/sessions/[id]/restore/route.js.map +5 -0
- package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/sessions/[id]/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/route.js +5 -3
- package/.next/server/app/api/sessions/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_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/[root-of-the-server]__005eb0c5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__005eb0c5._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__09e90d57._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__09e90d57._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__18dd0ce9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18dd0ce9._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__19468536._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__19468536._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__1b87ec42._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1b87ec42._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__2b912935._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__2b912935._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__303d3bac._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__303d3bac._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__3fac2b91._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__3fac2b91._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__43440b8d._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__43440b8d._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__438f8bbe._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__438f8bbe._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__4a0bfb55._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__4a0bfb55._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__534c3949._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__534c3949._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__59160266._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__59160266._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__6f812da0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__6f812da0._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__71aac504._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__71aac504._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__907a8bf2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__907a8bf2._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__92089220._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__92089220._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__9b7bc2d0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__9b7bc2d0._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__b2640944._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__b2640944._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__c2267cf1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__c2267cf1._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__d7f7e6dd._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__6924c09d._.js.map → [root-of-the-server]__d7f7e6dd._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__d8e61048._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__d8e61048._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__f6d0d488._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__192ed2f4._.js.map → [root-of-the-server]__f6d0d488._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__fa559e1e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__fa559e1e._.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_restore_route_actions_af7d6b6c.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_restore_route_actions_af7d6b6c.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 +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_aca45402.js.map +1 -1
- 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 +2 -2
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_fa835ac3.js.map +1 -1
- package/.next/server/chunks/src_lib_opencodeConfig_ts_8e209941._.js +3 -0
- package/.next/server/chunks/src_lib_opencodeConfig_ts_8e209941._.js.map +1 -0
- package/.next/server/chunks/src_lib_session-providers_claudeCode_ts_0f9590ed._.js +3 -0
- package/.next/server/chunks/src_lib_session-providers_claudeCode_ts_0f9590ed._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__631e12d0._.js → [root-of-the-server]__c91a8380._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__631e12d0._.js.map → [root-of-the-server]__c91a8380._.js.map} +1 -1
- 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 +1 -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 +8 -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.js +2 -2
- package/.next/standalone/.next/server/app/api/node/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route.js +2 -2
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/delete/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route.js +2 -2
- package/.next/standalone/.next/server/app/api/node/sessions/[id]/open-editor/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/node/sessions/route.js +6 -4
- package/.next/standalone/.next/server/app/api/node/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/nodes/route.js +2 -2
- package/.next/standalone/.next/server/app/api/nodes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/opencode-config/route.js +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +3 -2
- 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 +4 -3
- 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.js +2 -2
- package/.next/standalone/.next/server/app/api/sessions/[id]/open-editor/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/restore/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/restore/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/restore/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/restore/route.js +8 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/restore/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/sessions/[id]/route.js +2 -2
- 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 +5 -3
- package/.next/standalone/.next/server/app/api/sessions/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_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +1 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__005eb0c5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09e90d57._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__18dd0ce9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19468536._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1b87ec42._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b912935._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__303d3bac._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3fac2b91._.js +5 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__43440b8d._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__438f8bbe._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4a0bfb55._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__534c3949._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__59160266._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6f812da0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__71aac504._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__907a8bf2._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__92089220._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9b7bc2d0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b2640944._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c2267cf1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d7f7e6dd._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d8e61048._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f6d0d488._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fa559e1e._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_restore_route_actions_af7d6b6c.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 +1 -1
- 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 +2 -2
- package/.next/standalone/.next/server/chunks/src_lib_opencodeConfig_ts_8e209941._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_session-providers_claudeCode_ts_0f9590ed._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__631e12d0._.js → [root-of-the-server]__c91a8380._.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/9e790b67c80f853c.js +13 -0
- package/.next/standalone/.next/static/chunks/c3dc8cd80979c971.css +3 -0
- package/.next/standalone/AGENTS.md +4 -0
- package/.next/standalone/README.md +54 -5
- package/.next/standalone/check-hsql.mjs +1 -1
- package/.next/standalone/docs/session-status-detection.md +36 -0
- package/.next/standalone/docs/superpowers/specs/2026-04-09-claude-capability-alignment-design.md +39 -0
- package/.next/standalone/eslint.config.mjs +1 -0
- package/.next/standalone/package-lock.json +74 -13
- package/.next/standalone/package.json +2 -2
- package/.next/standalone/src/app/api/node/events/route.ts +3 -3
- package/.next/standalone/src/app/api/node/sessions/[id]/archive/route.test.ts +60 -1
- package/.next/standalone/src/app/api/node/sessions/[id]/archive/route.ts +77 -22
- package/.next/standalone/src/app/api/node/sessions/[id]/delete/route.ts +6 -5
- package/.next/standalone/src/app/api/node/sessions/[id]/open-editor/route.ts +6 -5
- package/.next/standalone/src/app/api/node/sessions/route.test.ts +282 -0
- package/.next/standalone/src/app/api/node/sessions/route.ts +156 -30
- package/.next/standalone/src/app/api/opencode-config/route.test.ts +613 -0
- package/.next/standalone/src/app/api/opencode-config/route.ts +336 -185
- package/.next/standalone/src/app/api/opencode-events/route.test.ts +77 -1
- package/.next/standalone/src/app/api/opencode-events/route.ts +3 -3
- package/.next/standalone/src/app/api/opencode-models/route.test.ts +19 -0
- package/.next/standalone/src/app/api/opencode-models/route.ts +4 -1
- package/.next/standalone/src/app/api/profiles/[id]/apply/route.test.ts +227 -0
- package/.next/standalone/src/app/api/profiles/[id]/apply/route.ts +13 -9
- package/.next/standalone/src/app/api/sessions/[id]/archive/route.test.ts +126 -0
- package/.next/standalone/src/app/api/sessions/[id]/archive/route.ts +47 -12
- package/.next/standalone/src/app/api/sessions/[id]/delete/route.test.ts +140 -0
- package/.next/standalone/src/app/api/sessions/[id]/delete/route.ts +51 -16
- package/.next/standalone/src/app/api/sessions/[id]/open-editor/route.test.ts +74 -0
- package/.next/standalone/src/app/api/sessions/[id]/open-editor/route.ts +22 -2
- package/.next/standalone/src/app/api/sessions/[id]/restore/route.test.ts +186 -0
- package/.next/standalone/src/app/api/sessions/[id]/restore/route.ts +184 -0
- package/.next/standalone/src/app/api/sessions/[id]/route.ts +3 -3
- package/.next/standalone/src/app/api/sessions/route.test.ts +1955 -100
- package/.next/standalone/src/app/api/sessions/route.ts +361 -986
- package/.next/standalone/src/components/KanbanBoard.test.tsx +307 -1
- package/.next/standalone/src/components/KanbanBoard.tsx +106 -19
- package/.next/standalone/src/components/ProjectCard.test.tsx +420 -6
- package/.next/standalone/src/components/ProjectCard.tsx +238 -86
- package/.next/standalone/src/components/SessionCard.test.tsx +259 -8
- package/.next/standalone/src/components/SessionCard.tsx +182 -76
- package/.next/standalone/src/components/opencode-config/AgentConfigForm.test.tsx +141 -1
- package/.next/standalone/src/components/opencode-config/AgentConfigForm.tsx +99 -7
- package/.next/standalone/src/components/opencode-config/GeneralSettingsForm.test.tsx +11 -0
- package/.next/standalone/src/components/opencode-config/GeneralSettingsForm.tsx +41 -2
- package/.next/standalone/src/components/opencode-config/categories/CategoriesManager.tsx +3 -1
- package/.next/standalone/src/components/opencode-config/categories/CategoryConfigForm.test.tsx +106 -8
- package/.next/standalone/src/components/opencode-config/categories/CategoryConfigForm.tsx +82 -5
- package/.next/standalone/src/hooks/useHostSources.test.ts +0 -41
- package/.next/standalone/src/hooks/useOpencodeSync.test.ts +321 -1
- package/.next/standalone/src/hooks/useOpencodeSync.ts +16 -12
- package/.next/standalone/src/lib/claudeSessionOverrides.test.ts +75 -0
- package/.next/standalone/src/lib/claudeSessionOverrides.ts +169 -0
- package/.next/standalone/src/lib/fixtures/opencode-config/oh-my-openagent.v4.jsonc +70 -0
- package/.next/standalone/src/lib/fixtures/opencode-config/oh-my-openagent.v4.secret-like.jsonc +21 -0
- package/.next/standalone/src/lib/fixtures/opencode-config/oh-my-opencode.v3.jsonc +17 -0
- package/.next/standalone/src/lib/opencodeConfig.test.ts +430 -3
- package/.next/standalone/src/lib/opencodeConfig.ts +157 -4
- package/.next/standalone/src/lib/opencodeDiscovery.test.ts +241 -0
- package/.next/standalone/src/lib/opencodeDiscovery.ts +164 -9
- package/.next/standalone/src/lib/profiles/share.test.ts +92 -0
- package/.next/standalone/src/lib/profiles/share.ts +1 -0
- package/.next/standalone/src/lib/profiles/storage.test.ts +77 -1
- package/.next/standalone/src/lib/profiles/storage.ts +10 -9
- package/.next/standalone/src/lib/session-providers/claudeCode.test.ts +2288 -0
- package/.next/standalone/src/lib/session-providers/claudeCode.ts +1083 -0
- package/.next/standalone/src/lib/session-providers/localAggregator.test.ts +322 -0
- package/.next/standalone/src/lib/session-providers/localAggregator.ts +302 -0
- package/.next/standalone/src/lib/session-providers/opencodeProvider.test.ts +170 -0
- package/.next/standalone/src/lib/session-providers/opencodeProvider.ts +721 -0
- package/.next/standalone/src/lib/session-providers/opencodeSdkCompat.ts +92 -0
- package/.next/standalone/src/lib/session-providers/providerIds.test.ts +337 -0
- package/.next/standalone/src/lib/session-providers/providerIds.ts +176 -0
- package/.next/standalone/src/lib/session-providers/types.ts +131 -0
- package/.next/standalone/src/lib/transform.test.ts +253 -0
- package/.next/standalone/src/lib/transform.ts +96 -37
- package/.next/standalone/src/types/index.ts +23 -17
- package/.next/standalone/src/types/opencodeConfig.ts +55 -0
- package/.next/static/chunks/9e790b67c80f853c.js +13 -0
- package/.next/static/chunks/c3dc8cd80979c971.css +3 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/README.md +54 -5
- package/package.json +2 -2
- package/.next/server/chunks/[root-of-the-server]__1211da38._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1211da38._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__192ed2f4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__2b526e7a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__2b526e7a._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__2f981540._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__2f981540._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__3745b314._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__3745b314._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__56690af0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__56690af0._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__56f5f249._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__56f5f249._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__59175de4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__59175de4._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__64fffc02._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__64fffc02._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__6924c09d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__6c428a24._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__6c428a24._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__73a00b88._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__73a00b88._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__7e757f50._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7e757f50._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__89c5eeab._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__89c5eeab._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__8da6c5a8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__8da6c5a8._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__b796d06c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__b796d06c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__c2ce5c0f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__c2ce5c0f._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__db285678._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__db285678._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__e00a9200._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__e00a9200._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__e5df5e5f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__e5df5e5f._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__edbc8d9e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__edbc8d9e._.js.map +0 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1211da38._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__192ed2f4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b526e7a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2f981540._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3745b314._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__56690af0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__56f5f249._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__59175de4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__64fffc02._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6924c09d._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6c428a24._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__73a00b88._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7e757f50._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__89c5eeab._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8da6c5a8._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b796d06c._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c2ce5c0f._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__db285678._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e00a9200._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e5df5e5f._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__edbc8d9e._.js +0 -3
- package/.next/standalone/.next/static/chunks/65d5354ba0add961.js +0 -13
- package/.next/standalone/.next/static/chunks/f42202943f6742e5.css +0 -3
- package/.next/static/chunks/65d5354ba0add961.js +0 -13
- package/.next/static/chunks/f42202943f6742e5.css +0 -3
- /package/.next/standalone/.next/static/{5kq9DtuBFVxu4jsgmL5Q- → 0WaQ6UjiNBgvh531pJVh0}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{5kq9DtuBFVxu4jsgmL5Q- → 0WaQ6UjiNBgvh531pJVh0}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{5kq9DtuBFVxu4jsgmL5Q- → 0WaQ6UjiNBgvh531pJVh0}/_ssgManifest.js +0 -0
- /package/.next/static/{5kq9DtuBFVxu4jsgmL5Q- → 0WaQ6UjiNBgvh531pJVh0}/_buildManifest.js +0 -0
- /package/.next/static/{5kq9DtuBFVxu4jsgmL5Q- → 0WaQ6UjiNBgvh531pJVh0}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{5kq9DtuBFVxu4jsgmL5Q- → 0WaQ6UjiNBgvh531pJVh0}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/opencode-models/route.ts"],"sourcesContent":["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-models/route\",\n pathname: \"/api/opencode-models\",\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-models/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-models/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 { NextResponse } from 'next/server';\nimport { type ExecException } from 'child_process';\n\ntype ExecFn = (\n command: string,\n options: { timeout: number; env: NodeJS.ProcessEnv },\n callback: (error: ExecException | null, stdout: string, stderr: string) => void\n) => void;\n\nlet _execFn: ExecFn | null = null;\n\nfunction getExecFn(): ExecFn {\n if (_execFn) return _execFn;\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require('child_process').exec as ExecFn;\n}\n\nexport function setExecFn(fn: ExecFn | null) {\n _execFn = fn;\n}\n\nexport function handleExecResult(\n error: ExecException | null,\n stdout: string,\n stderr: string\n): { models: string[]; source: string; error?: string } {\n if (error) {\n console.error('[opencode-models] command failed', {\n command: 'opencode models',\n message: error.message,\n code: error.code,\n signal: error.signal,\n stderr: stderr || undefined,\n stdoutPreview: stdout ? stdout.slice(0, 300) : undefined,\n });\n return { models: [], source: 'error', error: error.message || 'Failed to fetch models from CLI' };\n }\n\n if (stderr) {\n console.warn('[opencode-models] stderr:', stderr);\n }\n\n try {\n const models = stdout.trim().split('\\n').filter(line => line.includes('/'));\n if (models.length === 0) {\n return { models: [], source: 'error', error: 'No models found. Please check your OpenCode installation.' };\n }\n return { models, source: 'opencode' };\n } catch {\n return { models: [], source: 'error', error: 'Failed to parse models output' };\n }\n}\n\nexport async function GET(): Promise<Response> {\n return new Promise<Response>((resolve) => {\n const parsedTimeout = Number(process.env.OPENCODE_MODELS_TIMEOUT_MS);\n const timeout = Number.isFinite(parsedTimeout) && parsedTimeout > 0 ? parsedTimeout : 15000;\n\n const opencodePath = `${process.env.HOME}/.opencode/bin:${process.env.PATH}`;\n\n getExecFn()('opencode models', { timeout, env: { ...process.env, PATH: opencodePath } }, (error, stdout, stderr) => {\n if (error) {\n console.error('[opencode-models] GET failed', {\n timeout,\n opencodePath,\n cwd: process.cwd(),\n home: process.env.HOME,\n path: process.env.PATH,\n });\n }\n const result = handleExecResult(error, stdout, stderr);\n const status = result.source === 'error' ? 503 : 200;\n return resolve(NextResponse.json(result, { status }));\n });\n });\n}\n"],"names":[],"mappings":"gkCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,KChBA,EAAA,EAAA,CAAA,CAAA,OASA,IAAI,EAAyB,KAQtB,SAAS,EAAU,CAAiB,EACzC,EAAU,CACZ,CAEO,SAAS,E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AAE,CAAD,EAAkB,GACnB,EAAQ,AADgB,GAAG,GACb,CAAC,EAAA,sBAAsB,GAIrC,EAAW,YAAY,EAAK,EAAD,AAAK,SAAS,CAAC,kBAAqB,EAAD,AAAS,GAAG,CAAC,kBAC3E,AAD6F,EACrF,GAAG,CAAC,gBAAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,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,GAAG,AAC1B,CACJ,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":[0]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/opencode-models/route.ts"],"sourcesContent":["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-models/route\",\n pathname: \"/api/opencode-models\",\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-models/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-models/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 { NextResponse } from 'next/server';\nimport { type ExecException } from 'child_process';\n\ntype ExecFn = (\n command: string,\n options: { timeout: number; env: NodeJS.ProcessEnv },\n callback: (error: ExecException | null, stdout: string, stderr: string) => void\n) => void;\n\nlet _execFn: ExecFn | null = null;\n\nfunction getExecFn(): ExecFn {\n if (_execFn) return _execFn;\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require('child_process').exec as ExecFn;\n}\n\nexport function setExecFn(fn: ExecFn | null) {\n _execFn = fn;\n}\n\nexport function handleExecResult(\n error: ExecException | null,\n stdout: string,\n stderr: string\n): { models: string[]; source: string; error?: string } {\n if (error) {\n console.error('[opencode-models] command failed', {\n command: 'opencode models',\n message: error.message,\n code: error.code,\n signal: error.signal,\n stderr: stderr || undefined,\n stdoutPreview: stdout ? stdout.slice(0, 300) : undefined,\n });\n return { models: [], source: 'error', error: error.message || 'Failed to fetch models from CLI' };\n }\n\n if (stderr) {\n console.warn('[opencode-models] stderr:', stderr);\n }\n\n try {\n const models = stdout\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.includes('/'));\n if (models.length === 0) {\n return { models: [], source: 'error', error: 'No models found. Please check your OpenCode installation.' };\n }\n return { models, source: 'opencode' };\n } catch {\n return { models: [], source: 'error', error: 'Failed to parse models output' };\n }\n}\n\nexport async function GET(): Promise<Response> {\n return new Promise<Response>((resolve) => {\n const parsedTimeout = Number(process.env.OPENCODE_MODELS_TIMEOUT_MS);\n const timeout = Number.isFinite(parsedTimeout) && parsedTimeout > 0 ? parsedTimeout : 15000;\n\n const opencodePath = `${process.env.HOME}/.opencode/bin:${process.env.PATH}`;\n\n getExecFn()('opencode models', { timeout, env: { ...process.env, PATH: opencodePath } }, (error, stdout, stderr) => {\n if (error) {\n console.error('[opencode-models] GET failed', {\n timeout,\n opencodePath,\n cwd: process.cwd(),\n home: process.env.HOME,\n path: process.env.PATH,\n });\n }\n const result = handleExecResult(error, stdout, stderr);\n const status = result.source === 'error' ? 503 : 200;\n return resolve(NextResponse.json(result, { status }));\n });\n });\n}\n"],"names":[],"mappings":"gkCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAA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A,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,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":[0]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[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"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},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"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},57181,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"),s=(0,n.join)(o,"oh-my-openagent.jsonc"),l=(0,n.join)(o,"oh-my-opencode.jsonc"),u="https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/master/assets/oh-my-openagent.schema.json";function d(e){let t="object"!=typeof e||null===e||Array.isArray(e)?{}:{...e};return{...t,openEditorTargetMode:"hub"===t.openEditorTargetMode?"hub":"remote"}}function p(e=s){return e!==s?e:(0,r.existsSync)(s)?s:(0,r.existsSync)(l)?l:s}function c(e=s){try{return(0,r.existsSync)(p(e))}catch{return!1}}function f(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}async function m(e=s){try{let r=await (0,t.readFile)(p(e),"utf-8");return(0,a.parse)(r,null,!1)}catch{return{}}}async function g(e,i=s){try{let o=(0,n.dirname)(i);(0,r.existsSync)(o)||(0,r.mkdirSync)(o,{recursive:!0});let l=i===s?{...e,$schema:e.$schema||u}:e,d=(0,a.stringify)(l,null,2);await (0,t.writeFile)(i,d,"utf-8")}catch(e){throw Error(`Failed to write config: ${e}`)}}e.s(["OH_MY_OPENAGENT_CONFIG_SCHEMA",0,u,"detectConfig",()=>c,"mergeConfig",()=>function e(t,r){let n={...t};for(let[t,i]of Object.entries(r)){let r=n[t];if(f(r)&&f(i)){n[t]=e(r,i);continue}n[t]=i}return n},"normalizeVibePulseConfig",()=>d,"readConfig",()=>m,"resolveConfigPath",()=>p,"writeConfig",()=>g])},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),o=e.i(57181);let s=(0,n.join)((0,i.homedir)(),".config","opencode","profiles"),l=(0,n.join)(s,"index.json");function u(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let d=[{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}],p={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},hephaestus:{model:"openai/gpt-5.4",variant:"medium",temperature:.2,top_p:.9},librarian:{model:"minimax-m2.7",temperature:.3,top_p:.9},explore:{model:"grok-code-fast-1",temperature:.1,top_p:.9},"multimodal-looker":{model:"openai/gpt-5.4",variant:"medium",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.4",variant:"xhigh"},deep:{model:"openai/gpt-5.4",variant:"medium"},artistry:{model:"google/gemini-3.1-pro",variant:"high"},quick:{model:"openai/gpt-5.4-mini",temperature:.1},"unspecified-low":{model:"anthropic/claude-sonnet-4-6",temperature:.2},"unspecified-high":{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2},writing:{model:"google/gemini-3-flash",temperature:.3}}}};function c(){(0,r.existsSync)(s)||(0,r.mkdirSync)(s,{recursive:!0})}function f(e){return(0,n.join)(s,`${e}.json`)}function m(e){if(!u(e))return{$schema:o.OH_MY_OPENAGENT_CONFIG_SCHEMA,agents:{}};let t=u(e.agents)?e.agents:{},r=u(e.categories)?e.categories:void 0,n="string"==typeof e.$schema&&e.$schema.trim().length>0?e.$schema:o.OH_MY_OPENAGENT_CONFIG_SCHEMA;return{...e,$schema:n,agents:t,categories:r}}function g(){return{version:1,profiles:[...d],activeProfileId:null,lastModified:new Date().toISOString()}}async function h(){let e=new Set(d.map(e=>e.id));for(let n of["coding","writing","debug","minimal"])if(!e.has(n)){let e=f(n);(0,r.existsSync)(e)&&await (0,t.unlink)(e)}for(let e of d){let t=p[e.id]||{agents:{}};await R(e.id,t)}}async function y(){return w(!0)}async function x(){return w(!1)}async function w(e){try{if(c(),!(0,r.existsSync)(l)){let e=g();return await v(e),await h(),e}let e=await (0,t.readFile)(l,"utf-8"),n=(0,a.parse)(e,null,!1),i=!1;for(let e of d)n.profiles.some(t=>t.id===e.id)||(n.profiles.push(e),i=!0);let o=new Set(d.map(e=>e.id)),s=n.profiles.length;return n.profiles=n.profiles.filter(e=>!e.isBuiltIn||o.has(e.id)),n.profiles.length!==s&&(i=!0),await h(),i&&(n.lastModified=new Date().toISOString(),await v(n)),n}catch(t){if(!e)throw t;return g()}}async function v(e){c(),e.lastModified=new Date().toISOString();let r=(0,a.stringify)(e,null,2);await (0,t.writeFile)(l,r,"utf-8")}async function E(e){try{let n=f(e);if(!(0,r.existsSync)(n))return{$schema:o.OH_MY_OPENAGENT_CONFIG_SCHEMA,agents:{}};let i=await (0,t.readFile)(n,"utf-8"),s=(0,a.parse)(i,null,!1),l=m(s);if(!s||"object"!=typeof s||"string"!=typeof s.$schema)try{await R(e,l)}catch{}return l}catch{return{$schema:o.OH_MY_OPENAGENT_CONFIG_SCHEMA,agents:{}}}}async function R(e,r){c();let n=f(e),i=(0,a.stringify)(m(r),null,2);await (0,t.writeFile)(n,i,"utf-8")}async function C(e){let n=(await y()).profiles.find(t=>t.id===e);if(n?.isBuiltIn){let t=p[e]||{agents:{}};return await R(e,t),!0}let i=f(e);return!!(0,r.existsSync)(i)&&(await (0,t.unlink)(i),!0)}async function _(e){return(await y()).profiles.find(t=>t.id===e)}async function A(e){let t=await y();t.activeProfileId=e,await v(t)}e.s(["deleteProfileConfig",()=>C,"getProfileById",()=>_,"readProfileConfig",()=>E,"readProfileIndex",()=>y,"readProfileIndexStrict",()=>x,"setActiveProfileId",()=>A,"writeProfileConfig",()=>R,"writeProfileIndex",()=>v])},13005,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),u=e.i(87718),d=e.i(95169),p=e.i(47587),c=e.i(66012),f=e.i(70101),m=e.i(26937),g=e.i(10372),h=e.i(93695);e.i(52474);var y=e.i(220),x=e.i(89171),w=e.i(53977),v=e.i(57181);async function E(e,{params:t}){try{let{id:e}=await t,r=await (0,w.getProfileById)(e);if(!r)return x.NextResponse.json({error:"Profile not found"},{status:404});let n=await (0,w.readProfileConfig)(e),i=await (0,v.readConfig)(),a=(0,v.mergeConfig)(i,n),o=!1;try{await (0,v.writeConfig)(a),o=!0,await (0,w.setActiveProfileId)(e)}catch(e){throw o&&await (0,v.writeConfig)(i),e}return x.NextResponse.json({message:"Profile applied successfully",profile:r,config:n})}catch(e){return console.error("Error applying profile:",e),x.NextResponse.json({error:"Internal server error"},{status:500})}}e.s(["POST",()=>E],4643);var R=e.i(4643);let C=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:R}),{workAsyncStorage:_,workUnitAsyncStorage:A,serverHooks:S}=C;function P(){return(0,n.patchFetch)({workAsyncStorage:_,workUnitAsyncStorage:A})}async function O(e,t,n){C.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/profiles/[id]/apply/route";x=x.replace(/\/index$/,"")||"/";let w=await C.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:v,params:E,nextConfig:R,parsedUrl:_,isDraftMode:A,prerenderManifest:S,routerServerContext:P,isOnDemandRevalidate:O,revalidateOnlyGenerated:b,resolvedPathname:N,clientReferenceManifest:I,serverActionsManifest:j}=w,T=(0,s.normalizeAppPath)(x),k=!!(S.dynamicRoutes[T]||S.routes[N]),H=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,_,!1):t.end("This page could not be found"),null);if(k&&!A){let e=!!S.routes[N],t=S.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(R.experimental.adapterPath)return await H();throw new h.NoFallbackError}}let M=null;!k||C.isDev||A||(M="/index"===(M=N)?"/":M);let q=!0===C.isDev||!k,$=k&&!q;j&&I&&(0,o.setManifestsSingleton)({page:x,clientReferenceManifest:I,serverActionsManifest:j});let F=e.method||"GET",D=(0,a.getTracer)(),U=D.getActiveScopeSpan(),G={params:E,prerenderManifest:S,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:q,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:R.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>C.onRequestError(e,t,n,i,P)},sharedContext:{buildId:v}},B=new l.NodeNextRequest(e),K=new l.NodeNextResponse(t),L=u.NextRequestAdapter.fromNodeNextRequest(B,(0,u.signalFromNodeResponse)(t));try{let o=async e=>C.handle(L,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=D.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.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,i.getRequestMeta)(e,"minimalMode"),l=async i=>{var a,l;let u=async({previousCacheEntry:r})=>{try{if(!s&&O&&b&&!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=G.renderOpts.fetchMetrics;let l=G.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let u=G.renderOpts.collectedTags;if(!k)return await (0,c.sendResponse)(B,K,a,G.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(a.headers);u&&(t[g.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:y.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 C.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:O})},!1,P),t}},d=await C.handleResponse({req:e,nextConfig:R,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:b,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:s});if(!k)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",O?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return s&&k||h.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,m.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(B,K,new Response(d.value.body,{headers:h,status:d.value.status||200})),null};U?await l(U):await D.withPropagatedContext(e.headers,()=>D.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${x}`,kind:a.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l))}catch(t){if(t instanceof h.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:O})},!1,P),k)throw t;return await (0,c.sendResponse)(B,K,new Response(null,{status:500})),null}}e.s(["handler",()=>O,"patchFetch",()=>P,"routeModule",()=>C,"serverHooks",()=>S,"workAsyncStorage",()=>_,"workUnitAsyncStorage",()=>A],13005)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__6f812da0._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/opencodeConfig.ts","../../../src/lib/profiles/storage.ts","../../../src/app/api/profiles/%5Bid%5D/apply/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { copyFile, readFile, rm, writeFile } from 'fs/promises';\nimport { existsSync, mkdirSync } from 'fs';\nimport { dirname, join, parse as parsePath } from 'path';\nimport { homedir } from 'os';\nimport { parse, stringify } from 'comment-json';\nimport type { OhMyOpenAgentConfig, OpenEditorTargetMode, VibePulseConfig } from '@/types/opencodeConfig';\n\nexport const CONFIG_DIR = join(homedir(), '.config', 'opencode');\nexport const CONFIG_PATH = join(CONFIG_DIR, 'oh-my-openagent.jsonc');\nexport const LEGACY_CONFIG_PATH = join(CONFIG_DIR, 'oh-my-opencode.jsonc');\nexport const PROJECT_CONFIG_DIR = '.opencode';\nexport const PROJECT_CONFIG_JSONC = 'oh-my-openagent.jsonc';\nexport const PROJECT_CONFIG_JSON = 'oh-my-openagent.json';\nexport const LEGACY_PROJECT_CONFIG_JSONC = 'oh-my-opencode.jsonc';\nexport const LEGACY_PROJECT_CONFIG_JSON = 'oh-my-opencode.json';\nexport const OH_MY_OPENAGENT_CONFIG_SCHEMA = 'https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/master/assets/oh-my-openagent.schema.json';\nexport const DEFAULT_OPEN_EDITOR_TARGET_MODE: OpenEditorTargetMode = 'remote';\nconst PROJECT_CONFIG_FILENAMES = [\n PROJECT_CONFIG_JSONC,\n PROJECT_CONFIG_JSON,\n LEGACY_PROJECT_CONFIG_JSONC,\n LEGACY_PROJECT_CONFIG_JSON,\n];\n\nexport type OpenCodeConfig = OhMyOpenAgentConfig;\n\nexport interface EffectiveConfigOptions {\n userConfigPath?: string;\n projectStartDir?: string;\n projectConfigPath?: string | null;\n}\n\nexport interface LegacyMigrationOptions {\n legacyPath?: string;\n canonicalPath?: string;\n backupPath?: string;\n now?: () => Date;\n writeCanonicalConfig?: (config: OpenCodeConfig, canonicalPath: string) => Promise<void>;\n}\n\nexport interface LegacyMigrationResult {\n migrated: boolean;\n legacyPath: string;\n canonicalPath: string;\n backupPath?: string;\n reason?: 'legacy-missing' | 'canonical-exists';\n}\n\nexport function normalizeOpenEditorTargetMode(value: unknown): OpenEditorTargetMode {\n return value === 'hub' ? 'hub' : DEFAULT_OPEN_EDITOR_TARGET_MODE;\n}\n\nexport function normalizeVibePulseConfig(value: unknown): VibePulseConfig {\n const vibepulse = typeof value === 'object' && value !== null && !Array.isArray(value)\n ? { ...(value as Record<string, unknown>) }\n : {};\n\n return {\n ...vibepulse,\n openEditorTargetMode: normalizeOpenEditorTargetMode(vibepulse.openEditorTargetMode),\n };\n}\n\nexport function getCanonicalUserConfigPath(): string {\n return CONFIG_PATH;\n}\n\nexport function getLegacyUserConfigPath(): string {\n return LEGACY_CONFIG_PATH;\n}\n\nexport function detectLegacyConfig(legacyPath: string = LEGACY_CONFIG_PATH): boolean {\n try {\n return existsSync(legacyPath);\n } catch {\n return false;\n }\n}\n\nexport function resolveConfigPath(configPath: string = CONFIG_PATH): string {\n if (configPath !== CONFIG_PATH) {\n return configPath;\n }\n\n if (existsSync(CONFIG_PATH)) {\n return CONFIG_PATH;\n }\n\n if (existsSync(LEGACY_CONFIG_PATH)) {\n return LEGACY_CONFIG_PATH;\n }\n\n return CONFIG_PATH;\n}\n\nexport function detectConfig(configPath: string = CONFIG_PATH): boolean {\n try {\n return existsSync(resolveConfigPath(configPath));\n } catch {\n return false;\n }\n}\n\nexport function findProjectConfigPath(startDir: string = process.cwd()): string | null {\n let currentDir = startDir;\n\n while (true) {\n for (const filename of PROJECT_CONFIG_FILENAMES) {\n const configPath = join(currentDir, PROJECT_CONFIG_DIR, filename);\n if (existsSync(configPath)) {\n return configPath;\n }\n }\n\n const parentDir = dirname(currentDir);\n if (parentDir === currentDir) {\n return null;\n }\n\n currentDir = parentDir;\n }\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function mergeConfig(base: OpenCodeConfig, overlay: OpenCodeConfig): OpenCodeConfig {\n const merged: Record<string, unknown> = { ...base };\n\n for (const [key, overlayValue] of Object.entries(overlay)) {\n const baseValue = merged[key];\n\n if (isPlainObject(baseValue) && isPlainObject(overlayValue)) {\n merged[key] = mergeConfig(baseValue as OpenCodeConfig, overlayValue as OpenCodeConfig);\n continue;\n }\n\n merged[key] = overlayValue;\n }\n\n return merged as OpenCodeConfig;\n}\n\nexport async function readConfig(configPath: string = CONFIG_PATH): Promise<OpenCodeConfig> {\n try {\n const content = await readFile(resolveConfigPath(configPath), 'utf-8');\n const config = parse(content, null, false) as OpenCodeConfig;\n return config;\n } catch {\n return {};\n }\n}\n\nasync function readLegacyConfigForMigration(legacyPath: string): Promise<OpenCodeConfig> {\n try {\n const content = await readFile(legacyPath, 'utf-8');\n return parse(content, null, false) as OpenCodeConfig;\n } catch (error) {\n throw new Error(`Failed to read legacy config: ${error}`);\n }\n}\n\nexport async function readEffectiveConfig(options: EffectiveConfigOptions = {}): Promise<OpenCodeConfig> {\n const userConfig = await readConfig(options.userConfigPath);\n const projectConfigPath = options.projectConfigPath === undefined\n ? findProjectConfigPath(options.projectStartDir)\n : options.projectConfigPath;\n\n if (!projectConfigPath) {\n return userConfig;\n }\n\n const projectConfig = await readConfig(projectConfigPath);\n return mergeConfig(userConfig, projectConfig);\n}\n\nexport async function writeConfig(\n config: OpenCodeConfig, \n configPath: string = CONFIG_PATH\n): Promise<void> {\n try {\n const configDir = dirname(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 || OH_MY_OPENAGENT_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\nfunction formatBackupTimestamp(date: Date): string {\n return date.toISOString().replace(/[:.]/g, '-');\n}\n\nfunction defaultBackupPath(legacyPath: string, date: Date): string {\n const parsed = parsePath(legacyPath);\n return join(parsed.dir, `${parsed.base}.backup-${formatBackupTimestamp(date)}`);\n}\n\nexport async function migrateLegacyConfig(options: LegacyMigrationOptions = {}): Promise<LegacyMigrationResult> {\n const legacyPath = options.legacyPath ?? LEGACY_CONFIG_PATH;\n const canonicalPath = options.canonicalPath ?? CONFIG_PATH;\n\n if (!existsSync(legacyPath)) {\n return { migrated: false, legacyPath, canonicalPath, reason: 'legacy-missing' };\n }\n\n if (existsSync(canonicalPath)) {\n return { migrated: false, legacyPath, canonicalPath, reason: 'canonical-exists' };\n }\n\n const backupPath = options.backupPath ?? defaultBackupPath(legacyPath, options.now?.() ?? new Date());\n const canonicalDir = dirname(canonicalPath);\n if (!existsSync(canonicalDir)) {\n mkdirSync(canonicalDir, { recursive: true });\n }\n\n await copyFile(legacyPath, backupPath);\n\n try {\n const legacyConfig = await readLegacyConfigForMigration(legacyPath);\n const writeCanonicalConfig = options.writeCanonicalConfig ?? writeConfig;\n await writeCanonicalConfig(legacyConfig, canonicalPath);\n return { migrated: true, legacyPath, canonicalPath, backupPath };\n } catch (error) {\n await rm(canonicalPath, { force: true });\n throw error;\n }\n}\n","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 { OH_MY_OPENAGENT_CONFIG_SCHEMA } from '../opencodeConfig';\nimport type { AgentConfig, CategoryConfig, ProfileConfig as SharedProfileConfig } 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 type ProfileConfig = SharedProfileConfig;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\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 hephaestus: {\n model: 'openai/gpt-5.4',\n variant: 'medium',\n temperature: 0.2,\n top_p: 0.9,\n },\n librarian: {\n model: 'minimax-m2.7',\n temperature: 0.3,\n top_p: 0.9,\n },\n explore: {\n model: 'grok-code-fast-1',\n temperature: 0.1,\n top_p: 0.9,\n },\n 'multimodal-looker': {\n model: 'openai/gpt-5.4',\n variant: 'medium',\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.4',\n variant: 'xhigh',\n },\n deep: {\n model: 'openai/gpt-5.4',\n variant: 'medium',\n },\n artistry: {\n model: 'google/gemini-3.1-pro',\n variant: 'high',\n },\n quick: {\n model: 'openai/gpt-5.4-mini',\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: 'anthropic/claude-opus-4-6',\n variant: 'max',\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 normalizeProfileConfig(config: unknown): ProfileConfig {\n if (!isRecord(config)) {\n return {\n $schema: OH_MY_OPENAGENT_CONFIG_SCHEMA,\n agents: {},\n };\n }\n\n const candidate = config;\n const agents =\n isRecord(candidate.agents)\n ? (candidate.agents as Record<string, AgentConfig>)\n : {};\n\n const categories =\n isRecord(candidate.categories)\n ? (candidate.categories as Record<string, CategoryConfig>)\n : undefined;\n\n const schema =\n typeof candidate.$schema === 'string' && candidate.$schema.trim().length > 0\n ? candidate.$schema\n : OH_MY_OPENAGENT_CONFIG_SCHEMA;\n\n return {\n ...candidate,\n $schema: schema,\n agents,\n categories,\n };\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 config = BUILTIN_PROFILE_CONFIGS[profile.id] || { agents: {} };\n await writeProfileConfig(profile.id, config);\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 {\n $schema: OH_MY_OPENAGENT_CONFIG_SCHEMA,\n agents: {},\n };\n }\n\n const content = await readFile(configPath, 'utf-8');\n const parsedConfig = parse(content, null, false) as unknown;\n const normalizedConfig = normalizeProfileConfig(parsedConfig);\n\n if (\n !parsedConfig ||\n typeof parsedConfig !== 'object' ||\n typeof (parsedConfig as { $schema?: unknown }).$schema !== 'string'\n ) {\n try {\n await writeProfileConfig(id, normalizedConfig);\n } catch {\n return normalizedConfig;\n }\n }\n\n return normalizedConfig;\n } catch {\n return {\n $schema: OH_MY_OPENAGENT_CONFIG_SCHEMA,\n agents: {},\n };\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(normalizeProfileConfig(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 { NextRequest, NextResponse } from 'next/server';\nimport {\n readProfileConfig,\n getProfileById,\n setActiveProfileId,\n} from '@/lib/profiles/storage';\nimport { mergeConfig, 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 const mergedConfig = mergeConfig(currentConfig, profileConfig);\n let configWasWritten = false;\n\n try {\n await writeConfig(mergedConfig);\n configWasWritten = true;\n await setActiveProfileId(id);\n } catch (error) {\n if (configWasWritten) {\n await writeConfig(currentConfig);\n }\n throw error;\n }\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\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AkB,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]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},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"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},33405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},99686,e=>{"use strict";var t=e.i(33405);let r=["/global/health","/doc"],n=new Set;function o(e){try{let t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return null;return t}catch{return null}}function i(){let e=Number(process.env.OPENCODE_DISCOVERY_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:5e3}function s(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 l(e){return Array.from(new Set(e.filter(e=>Number.isInteger(e)&&e>0&&e<=65535))).sort((e,t)=>e-t)}function u(e){let t=[];for(let r of e.matchAll(/--port(?:=(\d+)|\s+(\d+))\b/g)){let e=parseInt(r[1]??r[2]??"",10);Number.isFinite(e)&&t.push(e)}return t}function d(){let e=i(),d={timedOut:!1,timeoutMs:e,deadlineMs:Date.now()+e},c=function(e){let r={ports:[],shouldProbeDefaultPort:!1};try{let n=a(e);if(null===n)return r;for(let e of(0,t.execSync)("ps -axo command",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],timeout:n}).split("\n")){let t=e.trim();if(!t||!/\bopencode\b/.test(t))continue;let n=u(t);if(0===n.length){r.shouldProbeDefaultPort=!0;continue}for(let e of n)0===e?r.shouldProbeDefaultPort=!0:r.ports.push(e)}return r}catch(t){return s(t)&&(e.timedOut=!0),r}}(d),p=l([...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 i=t.match(/:(\d+)\s+\(LISTEN\)/);if(!i)continue;let s=parseInt(i[1],10);Number.isFinite(s)&&o.push(s)}return o}catch(t){return s(t)&&(e.timedOut=!0),[]}}(d),...c.ports]);for(let e of p)n.add(e);let f=new Set;for(let e of(c.shouldProbeDefaultPort&&!p.includes(4096)&&f.add(4096),n))p.includes(e)||f.add(e);let h=[];for(let e of f){let i=function(e,n){if(!Number.isInteger(e)||e<=0||e>65535)return"failed";for(let i of r){let r=a(n);if(null===r)return"timedOut";try{let n=Math.max(.001,r/1e3).toFixed(3),s=(0,t.execSync)(`curl -fsS --max-time ${n} http://127.0.0.1:${e}${i}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"],timeout:r}),a="string"==typeof s?s:String(s);if("/global/health"===i?function(e){let t=o(e);if(!t)return!1;let r=t.health,n=t.healthy,i=t.version;return("ok"===r||!0===n)&&"string"==typeof i&&/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(i)}(a):function(e){let t=o(e);if(!t||"string"!=typeof t.openapi||!/^3(?:\.\d+)?/.test(t.openapi))return!1;let r=t.info,n=r&&"object"==typeof r&&!Array.isArray(r)?r:null,i="string"==typeof n?.title?n.title:"",s="string"==typeof n?.description?n.description:"",a="string"==typeof t.title?t.title:"";return[i,s,a,"string"==typeof t.description?t.description:""].some(e=>/opencode/i.test(e))}(a))return"ok"}catch(e){if(s(e))return n.timedOut=!0,"timedOut"}}return"failed"}(e,d);"ok"===i?(n.add(e),h.push(e)):"failed"===i&&n.has(e)&&n.delete(e)}return{ports:l([...p,...h,...Array.from(n)]),timedOut:d.timedOut}}function c(){let e=i(),r={timedOut:!1,timeoutMs:e,deadlineMs:Date.now()+e},n=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),i=r[2];Number.isFinite(n)&&/\bopencode\b/.test(i)&&(u(i).length>0||o.push(n))}return Array.from(new Set(o))}catch(t){return s(t)&&(e.timedOut=!0),[]}}(r);if(!n.length)return{processes:[],timedOut:r.timedOut};let o=[],l=new Set;for(let e of n){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 s(e)&&(r.timedOut=!0),null}}(e,r);if(!n)continue;let i=`${e}:${n}`;l.has(i)||(l.add(i),o.push({pid:e,cwd:n}))}return{processes:o,timedOut:r.timedOut}}e.s(["discoverOpencodePortsWithMeta",()=>d,"discoverOpencodeProcessCwdsWithoutPortWithMeta",()=>c])},586,e=>{"use strict";function t(e,t){if(!e||""===e.trim())throw Error("Invalid hostId: cannot be empty");if(!t||""===t.trim())throw Error("Invalid sessionId: cannot be empty");if(e.includes(":")||t.includes(":"))throw Error("Invalid hostId or sessionId: colon character not allowed");return`${e}:${t}`}function r(e){if("string"!=typeof e)throw Error("Invalid sourceKey: must be a string");let t=e.split(":");if(2!==t.length)throw Error("Invalid sourceKey: must contain exactly one colon separator");let[r,n]=t,o=r.trim(),i=n.trim();if(""===o||""===i)throw Error("Invalid sourceKey: hostId and sessionId cannot be empty");return{hostId:o,sessionId:i}}function n(e){try{let{sessionId:t}=r(e);return t}catch{return null}}function o(e){if("string"!=typeof e)throw Error("Invalid action session id: must be a string");let t=e.trim();if(""===t)throw Error("Invalid action session id: cannot be empty");if(!t.includes(":"))return{hostId:"local",sessionId:t,isRemote:!1};let{hostId:n,sessionId:o}=r(t);return{hostId:n,sessionId:o,isRemote:"local"!==n}}function i(e){try{let t=o(e);return t.isRemote?null:t.sessionId}catch{return null}}e.s(["composeSourceKey",()=>t,"getSessionIdFromSourceKey",()=>n,"parseActionSessionReference",()=>o,"parseSourceKey",()=>r,"resolveLocalActionSessionId",()=>i])},96279,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),o=e.i(59756),i=e.i(61916),s=e.i(74677),a=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),f=e.i(70101),h=e.i(26937),m=e.i(10372),g=e.i(93695);e.i(52474);var y=e.i(220),x=e.i(99686),R=e.i(586),v=e.i(84044);async function E(e,{params:t}){let{id:r}=await t,n=function(e){if(!e.includes(":"))return e;try{let{hostId:t,sessionId:r}=(0,R.parseSourceKey)(e);return"local"===t?r:null}catch{return null}}(r);if(!n)return Response.json({error:"Session not found"},{status:404});let{ports:o,timedOut:i}=(0,x.discoverOpencodePortsWithMeta)();if(!o.length)return i?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{for(let e of o)try{let t=(0,v.createVibePulseOpencodeClient)(`http://localhost:${e}`),r=await (0,v.getOpencodeSession)(t,n);if(r.data)return Response.json({session:r.data})}catch{}return Response.json({error:"Session not found"},{status:404})}catch(e){return console.error("Error fetching session:",e),Response.json({error:"Failed to fetch session",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",()=>E],13346);var w=e.i(13346);let O=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/sessions/[id]/route.ts",nextConfigOutput:"standalone",userland:w}),{workAsyncStorage:b,workUnitAsyncStorage:C,serverHooks:I}=O;function S(){return(0,n.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:C})}async function P(e,t,n){O.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/sessions/[id]/route";x=x.replace(/\/index$/,"")||"/";let R=await O.prepare(e,t,{srcPage:x,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:v,params:E,nextConfig:w,parsedUrl:b,isDraftMode:C,prerenderManifest:I,routerServerContext:S,isOnDemandRevalidate:P,revalidateOnlyGenerated:A,resolvedPathname:T,clientReferenceManifest:N,serverActionsManifest:M}=R,_=(0,a.normalizeAppPath)(x),D=!!(I.dynamicRoutes[_]||I.routes[T]),k=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,b,!1):t.end("This page could not be found"),null);if(D&&!C){let e=!!I.routes[T],t=I.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(w.experimental.adapterPath)return await k();throw new g.NoFallbackError}}let j=null;!D||O.isDev||C||(j="/index"===(j=T)?"/":j);let q=!0===O.isDev||!D,$=D&&!q;M&&N&&(0,s.setManifestsSingleton)({page:x,clientReferenceManifest:N,serverActionsManifest:M});let U=e.method||"GET",H=(0,i.getTracer)(),F=H.getActiveScopeSpan(),K={params:E,prerenderManifest:I,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:q,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,o)=>O.onRequestError(e,t,n,o,S)},sharedContext:{buildId:v}},L=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),W=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let s=async e=>O.handle(W,K).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")!==d.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=`${U} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${x}`)}),a=!!(0,o.getRequestMeta)(e,"minimalMode"),l=async o=>{var i,l;let u=async({previousCacheEntry:r})=>{try{if(!a&&P&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(o);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let u=K.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(L,V,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[m.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:i.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:$,isOnDemandRevalidate:P})},!1,S),t}},d=await O.handleResponse({req:e,nextConfig:w,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:I,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:A,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:a});if(!D)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});a||t.setHeader("x-nextjs-cache",P?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let g=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return a&&D||g.delete(m.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||g.get("Cache-Control")||g.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(L,V,new Response(d.value.body,{headers:g,status:d.value.status||200})),null};F?await l(F):await H.withPropagatedContext(e.headers,()=>H.trace(d.BaseServerSpan.handleRequest,{spanName:`${U} ${x}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},l))}catch(t){if(t instanceof g.NoFallbackError||await O.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:P})},!1,S),D)throw t;return await (0,p.sendResponse)(L,V,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>S,"routeModule",()=>O,"serverHooks",()=>I,"workAsyncStorage",()=>b,"workUnitAsyncStorage",()=>C],96279)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__71aac504._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/opencodeDiscovery.ts","../../../src/lib/hostIdentity.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/sessions/%5Bid%5D/route.ts"],"sourcesContent":["import { execSync } from 'child_process';\n\nconst DEFAULT_DISCOVERY_COMMAND_TIMEOUT_MS = 5000;\nconst DEFAULT_OPENCODE_PORT = 4096;\nconst OPENCODE_PROBE_ENDPOINTS = ['/global/health', '/doc'] as const;\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\ntype ProcessPortDiscovery = {\n ports: number[];\n shouldProbeDefaultPort: boolean;\n};\n\ntype ProbeResult = 'ok' | 'failed' | 'timedOut';\n\nfunction parseJsonResponse(body: string): Record<string, unknown> | null {\n try {\n const parsed = JSON.parse(body) as unknown;\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n return null;\n }\n\n return parsed as Record<string, unknown>;\n } catch {\n return null;\n }\n}\n\nfunction isOpenCodeHealthResponse(body: string): boolean {\n const parsed = parseJsonResponse(body);\n if (!parsed) {\n return false;\n }\n\n const health = parsed.health;\n const healthy = parsed.healthy;\n const version = parsed.version;\n return (\n (health === 'ok' || healthy === true) &&\n typeof version === 'string' &&\n /^\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(version)\n );\n}\n\nfunction isOpenCodeDocsResponse(body: string): boolean {\n const parsed = parseJsonResponse(body);\n if (!parsed || typeof parsed.openapi !== 'string' || !/^3(?:\\.\\d+)?/.test(parsed.openapi)) {\n return false;\n }\n\n const info = parsed.info;\n const infoRecord = info && typeof info === 'object' && !Array.isArray(info) ? info as Record<string, unknown> : null;\n const title = typeof infoRecord?.title === 'string' ? infoRecord.title : '';\n const description = typeof infoRecord?.description === 'string' ? infoRecord.description : '';\n const rootTitle = typeof parsed.title === 'string' ? parsed.title : '';\n const rootDescription = typeof parsed.description === 'string' ? parsed.description : '';\n\n return [title, description, rootTitle, rootDescription].some((value) => /opencode/i.test(value));\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 isOpencodeCommand(command: string): boolean {\n return /\\bopencode\\b/.test(command);\n}\n\nfunction extractPortFlags(command: string): number[] {\n const ports: number[] = [];\n const matches = command.matchAll(/--port(?:=(\\d+)|\\s+(\\d+))\\b/g);\n\n for (const match of matches) {\n const parsedPort = parseInt(match[1] ?? match[2] ?? '', 10);\n if (Number.isFinite(parsedPort)) {\n ports.push(parsedPort);\n }\n }\n\n return ports;\n}\n\nfunction getPortsFromProcessArgs(state: DiscoveryState): ProcessPortDiscovery {\n const result: ProcessPortDiscovery = { ports: [], shouldProbeDefaultPort: false };\n\n try {\n const timeoutMs = getRemainingTimeoutMs(state);\n if (timeoutMs === null) {\n return result;\n }\n\n const output = execSync('ps -axo command', {\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: timeoutMs,\n });\n\n for (const line of output.split('\\n')) {\n const command = line.trim();\n if (!command || !isOpencodeCommand(command)) {\n continue;\n }\n\n const ports = extractPortFlags(command);\n if (ports.length === 0) {\n result.shouldProbeDefaultPort = true;\n continue;\n }\n\n for (const port of ports) {\n if (port === 0) {\n result.shouldProbeDefaultPort = true;\n } else {\n result.ports.push(port);\n }\n }\n }\n\n return result;\n } catch (error) {\n if (isCommandTimeoutError(error)) {\n state.timedOut = true;\n }\n return result;\n }\n}\n\nfunction probeOpencodePort(port: number, state: DiscoveryState): ProbeResult {\n if (!Number.isInteger(port) || port <= 0 || port > 65535) {\n return 'failed';\n }\n\n for (const endpoint of OPENCODE_PROBE_ENDPOINTS) {\n const timeoutMs = getRemainingTimeoutMs(state);\n if (timeoutMs === null) {\n return 'timedOut';\n }\n\n try {\n const timeoutSeconds = Math.max(0.001, timeoutMs / 1000).toFixed(3);\n const response = execSync(`curl -fsS --max-time ${timeoutSeconds} http://127.0.0.1:${port}${endpoint}`, {\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: timeoutMs,\n });\n\n const body = typeof response === 'string' ? response : String(response);\n const isValidProbe = endpoint === '/global/health'\n ? isOpenCodeHealthResponse(body)\n : isOpenCodeDocsResponse(body);\n\n if (isValidProbe) {\n return 'ok';\n }\n } catch (error) {\n if (isCommandTimeoutError(error)) {\n state.timedOut = true;\n return 'timedOut';\n }\n }\n }\n\n return 'failed';\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 processDiscovery = getPortsFromProcessArgs(state);\n const discoveredPorts = toUniqueSortedPorts([\n ...getPortsFromLsof(state),\n ...processDiscovery.ports,\n ]);\n\n for (const port of discoveredPorts) {\n knownPorts.add(port);\n }\n\n const probeCandidates = new Set<number>();\n if (processDiscovery.shouldProbeDefaultPort && !discoveredPorts.includes(DEFAULT_OPENCODE_PORT)) {\n probeCandidates.add(DEFAULT_OPENCODE_PORT);\n }\n\n for (const port of knownPorts) {\n if (!discoveredPorts.includes(port)) {\n probeCandidates.add(port);\n }\n }\n\n const probedPorts: number[] = [];\n for (const port of probeCandidates) {\n const probeResult = probeOpencodePort(port, state);\n if (probeResult === 'ok') {\n knownPorts.add(port);\n probedPorts.push(port);\n } else if (probeResult === 'failed' && knownPorts.has(port)) {\n knownPorts.delete(port);\n }\n }\n\n const ports = toUniqueSortedPorts([\n ...discoveredPorts,\n ...probedPorts,\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 (extractPortFlags(command).length > 0) 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","/**\n * Composes a composite source key from host ID and session ID.\n * Format: \"hostId:sessionId\"\n */\nexport function composeSourceKey(hostId: string, sessionId: string): string {\n if (!hostId || hostId.trim() === '') {\n throw new Error('Invalid hostId: cannot be empty');\n }\n if (!sessionId || sessionId.trim() === '') {\n throw new Error('Invalid sessionId: cannot be empty');\n }\n if (hostId.includes(':') || sessionId.includes(':')) {\n throw new Error('Invalid hostId or sessionId: colon character not allowed');\n }\n return `${hostId}:${sessionId}`;\n}\n\n/**\n * Parses a composite source key into host ID and session ID.\n * Throws if the key is not in the format \"hostId:sessionId\".\n */\nexport function parseSourceKey(sourceKey: string): { hostId: string; sessionId: string } {\n if (typeof sourceKey !== 'string') {\n throw new Error('Invalid sourceKey: must be a string');\n }\n\n const parts = sourceKey.split(':');\n if (parts.length !== 2) {\n throw new Error('Invalid sourceKey: must contain exactly one colon separator');\n }\n\n const [hostId, sessionId] = parts;\n const trimmedHostId = hostId.trim();\n const trimmedSessionId = sessionId.trim();\n if (trimmedHostId === '' || trimmedSessionId === '') {\n throw new Error('Invalid sourceKey: hostId and sessionId cannot be empty');\n }\n\n return { hostId: trimmedHostId, sessionId: trimmedSessionId };\n}\n\n/**\n * Extracts the host ID from a composite source key.\n * Returns null if the key is invalid.\n */\nexport function getHostIdFromSourceKey(sourceKey: string): string | null {\n try {\n const { hostId } = parseSourceKey(sourceKey);\n return hostId;\n } catch {\n return null;\n }\n}\n\n/**\n * Extracts the session ID from a composite source key.\n * Returns null if the key is invalid.\n */\nexport function getSessionIdFromSourceKey(sourceKey: string): string | null {\n try {\n const { sessionId } = parseSourceKey(sourceKey);\n return sessionId;\n } catch {\n return null;\n }\n}\n\n/**\n * Builds a composite source key from a host ID and session ID.\n */\nexport function buildSourceKey(hostId: string, sessionId: string): string {\n return composeSourceKey(hostId, sessionId);\n}\n\n/**\n * Checks if a source key matches a given host ID.\n */\nexport function isFromHost(sourceKey: string, hostId: string): boolean {\n const parsedHostId = getHostIdFromSourceKey(sourceKey);\n return parsedHostId === hostId;\n}\n\nexport interface ActionSessionReference {\n hostId: string;\n sessionId: string;\n isRemote: boolean;\n}\n\nexport function parseActionSessionReference(value: string): ActionSessionReference {\n if (typeof value !== 'string') {\n throw new Error('Invalid action session id: must be a string');\n }\n\n const trimmedValue = value.trim();\n if (trimmedValue === '') {\n throw new Error('Invalid action session id: cannot be empty');\n }\n\n if (!trimmedValue.includes(':')) {\n return {\n hostId: 'local',\n sessionId: trimmedValue,\n isRemote: false,\n };\n }\n\n const { hostId, sessionId } = parseSourceKey(trimmedValue);\n return {\n hostId,\n sessionId,\n isRemote: hostId !== 'local',\n };\n}\n\nexport function resolveLocalActionSessionId(value: string): string | null {\n try {\n const reference = parseActionSessionReference(value);\n return reference.isRemote ? null : reference.sessionId;\n } catch {\n return null;\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/sessions/[id]/route\",\n pathname: \"/api/sessions/[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/sessions/[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/sessions/[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 { discoverOpencodePortsWithMeta } from '@/lib/opencodeDiscovery';\nimport { parseSourceKey } from '@/lib/hostIdentity';\nimport { createVibePulseOpencodeClient, getOpencodeSession } from '@/lib/session-providers/opencodeSdkCompat';\n\nfunction resolveLocalSessionId(id: string): string | null {\n if (!id.includes(':')) {\n return id;\n }\n\n try {\n const { hostId, sessionId } = parseSourceKey(id);\n return hostId === 'local' ? sessionId : null;\n } catch {\n return null;\n }\n}\n\nexport async function GET(\n _: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n const sessionId = resolveLocalSessionId(id);\n\n if (!sessionId) {\n return Response.json({ error: 'Session not found' }, { status: 404 });\n }\n\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 for (const port of ports) {\n try {\n const client = createVibePulseOpencodeClient(`http://localhost:${port}`);\n const result = await getOpencodeSession(client, sessionId);\n if (result.data) {\n return Response.json({ session: result.data });\n }\n } catch {\n // Try next port\n }\n }\n return Response.json({ error: 'Session not found' }, { status: 404 });\n } catch (error) {\n console.error('Error fetching session:', error);\n return Response.json(\n {\n error: 'Failed to fetch session',\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"],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AAK,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":[2]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[54799,(e,t,n)=>{t.exports=e.x("crypto",()=>require("crypto"))},82414,e=>{"use strict";var t=e.i(22734),n=e.i(24868),r=e.i(46786),o=e.i(14747),a=e.i(54799),i=e.i(89196);let s=(0,o.join)((0,r.homedir)(),".config","vibepulse"),d=(0,o.join)(s,"nodes.jsonc");class l extends Error{code;constructor(e,t){super(t),this.name="NodeRegistryError",this.code=e}}function u(e){let t=e.trim();if(!t)return{ok:!1,error:"empty"};try{let e=new URL(t);if("http:"!==e.protocol&&"https:"!==e.protocol)return{ok:!1,error:"unsupported_protocol"};if(e.username||e.password)return{ok:!1,error:"credentials_not_allowed"};return{ok:!0,normalizedBaseUrl:(e.search="",e.hash="",e.toString().replace(/\/+$/,""))}}catch{return{ok:!1,error:"invalid"}}}function c(e){if(!e||"object"!=typeof e||"string"!=typeof e.nodeId||"string"!=typeof e.nodeLabel||"string"!=typeof e.baseUrl||"boolean"!=typeof e.enabled||"string"!=typeof e.token||"string"!=typeof e.createdAt||"string"!=typeof e.updatedAt)return null;let t=u(e.baseUrl);if(!t.ok)return null;let n=e.nodeId.trim(),r=e.nodeLabel.trim();return n&&r?{nodeId:n,nodeLabel:r,baseUrl:t.normalizedBaseUrl,enabled:e.enabled,token:e.token.trim(),createdAt:e.createdAt,updatedAt:e.updatedAt}:null}function p(){(0,t.existsSync)(s)||(0,t.mkdirSync)(s,{recursive:!0})}function f(){return{version:1,nodes:[]}}async function h(){try{if(p(),!(0,t.existsSync)(d)){let e=f();return await v(e),e}let e=await (0,n.readFile)(d,"utf-8"),r=(0,i.parse)(e,null,!1);if(!r||"object"!=typeof r||!Array.isArray(r.nodes))return f();let o=r.nodes.map(c).filter(e=>null!==e),a=[],s=new Set;for(let e of o)s.has(e.baseUrl)||(s.add(e.baseUrl),a.push(e));return{version:"number"==typeof r.version?r.version:1,nodes:a}}catch{return f()}}async function v(e){p();let t=(0,i.stringify)(e,null,2);await (0,n.writeFile)(d,t,"utf-8")}function b(e){return{nodeId:e.nodeId,nodeLabel:e.nodeLabel,baseUrl:e.baseUrl,enabled:e.enabled,createdAt:e.createdAt,updatedAt:e.updatedAt,tokenConfigured:e.token.trim().length>0}}function w(e){if("string"!=typeof e||""===e.trim())throw new l("node_label_required","nodeLabel is required and must be a non-empty string");return e.trim()}function m(e){if("string"!=typeof e||""===e.trim())throw new l("node_id_required","nodeId is required and must be a non-empty string");return e.trim()}function R(e){if(null==e)return"";if("string"!=typeof e)throw new l("invalid_token","token must be a string when provided");return e.trim()}function y(e){if("boolean"!=typeof e)throw new l("invalid_enabled","enabled must be a boolean");return e}function g(e){if("string"!=typeof e)throw new l("invalid_base_url","baseUrl must be a string");let t=u(e);if(!t.ok)throw new l("invalid_base_url",`baseUrl validation failed: ${t.error}`);return t.normalizedBaseUrl}function _(e,t,n){if(e.find(e=>e.baseUrl===t&&e.nodeId!==n))throw new l("duplicate_base_url",`A node with baseUrl '${t}' already exists`)}async function A(){return[...(await h()).nodes]}async function S(){return(await A()).map(b)}async function E(e){let t=w(e.nodeLabel),n=g(e.baseUrl),r=R(e.token),o=void 0===e.enabled||y(e.enabled),i=await h();_(i.nodes,n);let s=new Date().toISOString(),d={nodeId:(0,a.randomUUID)(),nodeLabel:t,baseUrl:n,enabled:o,token:r,createdAt:s,updatedAt:s};return i.nodes.push(d),await v(i),b(d)}async function k(e,t){let n=m(e);if(void 0===t.nodeLabel&&void 0===t.baseUrl&&void 0===t.token&&void 0===t.enabled)throw new l("no_updates","At least one update field is required");let r=await h(),o=r.nodes.findIndex(e=>e.nodeId===n);if(-1===o)throw new l("node_not_found",`Node '${n}' not found`);let a=r.nodes[o],i=void 0===t.nodeLabel?a.nodeLabel:w(t.nodeLabel),s=void 0===t.baseUrl?a.baseUrl:g(t.baseUrl),d=void 0===t.token?a.token:R(t.token),u=void 0===t.enabled?a.enabled:y(t.enabled);_(r.nodes,s,a.nodeId);let c={...a,nodeLabel:i,baseUrl:s,token:d,enabled:u,updatedAt:new Date().toISOString()};return r.nodes[o]=c,await v(r),b(c)}async function I(e,t){let n=m(e),r=await h(),o=r.nodes.findIndex(e=>e.nodeId===n);if(-1===o)throw new l("node_not_found",`Node '${n}' not found`);let a=r.nodes[o],i=void 0===t?!a.enabled:y(t),s={...a,enabled:i,updatedAt:new Date().toISOString()};return r.nodes[o]=s,await v(r),b(s)}async function C(e){let t=m(e),n=await h(),r=n.nodes.filter(e=>e.nodeId!==t);return r.length!==n.nodes.length&&(n.nodes=r,await v(n),!0)}e.s(["NodeRegistryError",()=>l,"createNode",()=>E,"deleteNode",()=>C,"listNodeRecords",()=>A,"listNodes",()=>S,"toggleNode",()=>I,"updateNode",()=>k])},12080,e=>{"use strict";var t=e.i(47909),n=e.i(74017),r=e.i(96250),o=e.i(59756),a=e.i(61916),i=e.i(74677),s=e.i(69741),d=e.i(16795),l=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),f=e.i(70101),h=e.i(26937),v=e.i(10372),b=e.i(93695);e.i(52474);var w=e.i(220),m=e.i(99686),R=e.i(586),y=e.i(82414),g=e.i(68817),_=e.i(39948),A=e.i(74579),S=e.i(17506);function E(){return Response.json({error:"Invalid action session id",reason:"invalid_action_session_id"},{status:400})}function k(){return Response.json({error:"Session not found",reason:"session_not_found"},{status:404})}function I(e,t,n="archive_request_failed"){return Response.json({error:"Failed to archive session",reason:n,...t?{message:t}:{}},{status:e})}async function C(e,t){let n=(await (0,y.listNodeRecords)()).find(t=>t.nodeId===e);if(!n||!n.enabled)return k();let r=new AbortController,o=!1,a=setTimeout(()=>{o=!0,r.abort()},5e3);try{let e=await fetch(`${n.baseUrl}/api/node/sessions/${t}/archive`,{method:"POST",headers:(0,g.createNodeRequestHeaders)(n.token),signal:r.signal});if(e.ok)return Response.json({success:!0});let o=await e.json().catch(()=>({}));return Response.json({error:"Remote archive failed",reason:"string"==typeof o.reason?o.reason:`node_request_failed_${e.status}`},{status:e.status})}catch{return Response.json({error:o?"Remote node request timed out":"Remote node request failed",reason:o?"upstream_timeout":"upstream_unreachable"},{status:o?504:503})}finally{clearTimeout(a)}}async function x(e,{params:t}){let n,r,{id:o}=await t;try{n=(0,R.parseActionSessionReference)(o)}catch{return E()}let a=(0,_.detectProviderFromRawId)(n.sessionId);if(!(0,_.getDefaultProviderContext)(a).capabilities.archive||"claude-code"===a&&n.isRemote){var i,s;let e;return i="archive",s=n.sessionId,e=(0,_.detectProviderFromRawId)(s),Response.json({error:"Session action not supported by provider",reason:"provider_capability_unsupported",provider:e,capability:i},{status:403})}if("claude-code"===a){await (0,S.markClaudeSessionArchived)((0,_.extractProviderRawId)(n.sessionId));let e=(0,R.resolveLocalActionSessionId)(o);return e&&((0,A.clearSessionForceUnarchived)(e),(0,A.markSessionStickyStatusBlocked)(e)),Response.json({success:!0})}let d=(0,R.resolveLocalActionSessionId)(o);if(!d&&n.isRemote)return C(n.hostId,n.sessionId);if(!d)return E();let{ports:l,timedOut:u}=(0,m.discoverOpencodePortsWithMeta)();if(!l.length)return u?Response.json({error:"OpenCode discovery timed out"},{status:503}):Response.json({error:"OpenCode server not found"},{status:503});let c=!1,p=null,f="archive_request_failed";for(let e of l)try{let t=`http://localhost:${e}`,n=await fetch(`${t}/session/${d}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({time:{archived:Date.now()}})});if(n.ok)return(0,A.clearSessionForceUnarchived)(d),(0,A.markSessionStickyStatusBlocked)(d),Response.json({success:!0});let o=await n.text();if(console.error(`Failed to archive session on port ${e}:`,o),404===n.status){c=!0;continue}p=n.status,r=o||void 0,f="archive_request_failed"}catch(t){console.error(`Failed to archive session on port ${e}:`,t),p=503,r=t instanceof Error?t.message:String(t),f="upstream_unreachable"}return null!==p?I(p,r,f):c?k():I(500)}e.s(["POST",()=>x],844);var U=e.i(844);let N=new t.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/archive/route",pathname:"/api/sessions/[id]/archive",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/sessions/[id]/archive/route.ts",nextConfigOutput:"standalone",userland:U}),{workAsyncStorage:P,workUnitAsyncStorage:O,serverHooks:T}=N;function q(){return(0,r.patchFetch)({workAsyncStorage:P,workUnitAsyncStorage:O})}async function j(e,t,r){N.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/sessions/[id]/archive/route";m=m.replace(/\/index$/,"")||"/";let R=await N.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:y,params:g,nextConfig:_,parsedUrl:A,isDraftMode:S,prerenderManifest:E,routerServerContext:k,isOnDemandRevalidate:I,revalidateOnlyGenerated:C,resolvedPathname:x,clientReferenceManifest:U,serverActionsManifest:P}=R,O=(0,s.normalizeAppPath)(m),T=!!(E.dynamicRoutes[O]||E.routes[x]),q=async()=>((null==k?void 0:k.render404)?await k.render404(e,t,A,!1):t.end("This page could not be found"),null);if(T&&!S){let e=!!E.routes[x],t=E.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(_.experimental.adapterPath)return await q();throw new b.NoFallbackError}}let j=null;!T||N.isDev||S||(j="/index"===(j=x)?"/":j);let $=!0===N.isDev||!T,D=T&&!$;P&&U&&(0,i.setManifestsSingleton)({page:m,clientReferenceManifest:U,serverActionsManifest:P});let H=e.method||"GET",L=(0,a.getTracer)(),F=L.getActiveScopeSpan(),M={params:g,prerenderManifest:E,renderOpts:{experimental:{authInterrupts:!!_.experimental.authInterrupts},cacheComponents:!!_.cacheComponents,supportsDynamicResponse:$,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:_.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,r,o)=>N.onRequestError(e,t,r,o,k)},sharedContext:{buildId:y}},B=new d.NodeNextRequest(e),K=new d.NodeNextResponse(t),z=l.NextRequestAdapter.fromNodeNextRequest(B,(0,l.signalFromNodeResponse)(t));try{let i=async e=>N.handle(z,M).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let n=L.getRootSpanAttributes();if(!n)return;if(n.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${n.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=n.get("next.route");if(r){let t=`${H} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t)}else e.updateName(`${H} ${m}`)}),s=!!(0,o.getRequestMeta)(e,"minimalMode"),d=async o=>{var a,d;let l=async({previousCacheEntry:n})=>{try{if(!s&&I&&C&&!n)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=M.renderOpts.fetchMetrics;let d=M.renderOpts.pendingWaitUntil;d&&r.waitUntil&&(r.waitUntil(d),d=void 0);let l=M.renderOpts.collectedTags;if(!T)return await (0,p.sendResponse)(B,K,a,M.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,r=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:r}}}}catch(t){throw(null==n?void 0:n.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:I})},!1,k),t}},u=await N.handleResponse({req:e,nextConfig:_,cacheKey:j,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:E,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:C,responseGenerator:l,waitUntil:r.waitUntil,isMinimalMode:s});if(!T)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(d=u.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",I?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let b=(0,f.fromNodeOutgoingHttpHeaders)(u.value.headers);return s&&T||b.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||b.get("Cache-Control")||b.set("Cache-Control",(0,h.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(B,K,new Response(u.value.body,{headers:b,status:u.value.status||200})),null};F?await d(F):await L.withPropagatedContext(e.headers,()=>L.trace(u.BaseServerSpan.handleRequest,{spanName:`${H} ${m}`,kind:a.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},d))}catch(t){if(t instanceof b.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:I})},!1,k),T)throw t;return await (0,p.sendResponse)(B,K,new Response(null,{status:500})),null}}e.s(["handler",()=>j,"patchFetch",()=>q,"routeModule",()=>N,"serverHooks",()=>T,"workAsyncStorage",()=>P,"workUnitAsyncStorage",()=>O],12080)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__907a8bf2._.js.map
|