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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/nodeRegistry.ts","../../../src/app/api/sessions/%5Bid%5D/archive/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { existsSync, mkdirSync } from 'fs';\nimport { readFile, writeFile } from 'fs/promises';\nimport { homedir } from 'os';\nimport { join } from 'path';\nimport { randomUUID } from 'crypto';\nimport { parse, stringify } from 'comment-json';\n\nexport const NODES_CONFIG_DIR = join(homedir(), '.config', 'vibepulse');\nexport const NODE_REGISTRY_PATH = join(NODES_CONFIG_DIR, 'nodes.jsonc');\n\nexport interface StoredNodeRecord {\n nodeId: string;\n nodeLabel: string;\n baseUrl: string;\n enabled: boolean;\n token: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface PublicNodeRecord {\n nodeId: string;\n nodeLabel: string;\n baseUrl: string;\n enabled: boolean;\n createdAt: string;\n updatedAt: string;\n tokenConfigured: boolean;\n}\n\ninterface NodeRegistryFile {\n version: number;\n nodes: StoredNodeRecord[];\n}\n\nexport type NodeBaseUrlValidationError =\n | 'empty'\n | 'invalid'\n | 'unsupported_protocol'\n | 'credentials_not_allowed';\n\ntype NodeBaseUrlValidationResult =\n | { ok: true; normalizedBaseUrl: string }\n | { ok: false; error: NodeBaseUrlValidationError };\n\nexport type NodeRegistryErrorCode =\n | 'node_not_found'\n | 'node_label_required'\n | 'node_id_required'\n | 'invalid_token'\n | 'invalid_enabled'\n | 'invalid_base_url'\n | 'duplicate_base_url'\n | 'no_updates';\n\nexport class NodeRegistryError extends Error {\n readonly code: NodeRegistryErrorCode;\n\n constructor(code: NodeRegistryErrorCode, message: string) {\n super(message);\n this.name = 'NodeRegistryError';\n this.code = code;\n }\n}\n\nfunction normalizeParsedBaseUrl(url: URL): string {\n url.search = '';\n url.hash = '';\n return url.toString().replace(/\\/+$/, '');\n}\n\nexport function validateNodeBaseUrl(url: string): NodeBaseUrlValidationResult {\n const trimmedUrl = url.trim();\n if (!trimmedUrl) {\n return { ok: false, error: 'empty' };\n }\n\n try {\n const parsed = new URL(trimmedUrl);\n if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {\n return { ok: false, error: 'unsupported_protocol' };\n }\n\n if (parsed.username || parsed.password) {\n return { ok: false, error: 'credentials_not_allowed' };\n }\n\n return { ok: true, normalizedBaseUrl: normalizeParsedBaseUrl(parsed) };\n } catch {\n return { ok: false, error: 'invalid' };\n }\n}\n\nfunction normalizeStoredNode(node: unknown): StoredNodeRecord | null {\n if (!node || typeof node !== 'object') {\n return null;\n }\n\n const candidate = node as Record<string, unknown>;\n if (\n typeof candidate.nodeId !== 'string' ||\n typeof candidate.nodeLabel !== 'string' ||\n typeof candidate.baseUrl !== 'string' ||\n typeof candidate.enabled !== 'boolean' ||\n typeof candidate.token !== 'string' ||\n typeof candidate.createdAt !== 'string' ||\n typeof candidate.updatedAt !== 'string'\n ) {\n return null;\n }\n\n const validation = validateNodeBaseUrl(candidate.baseUrl);\n if (!validation.ok) {\n return null;\n }\n\n const nodeId = candidate.nodeId.trim();\n const nodeLabel = candidate.nodeLabel.trim();\n\n if (!nodeId || !nodeLabel) {\n return null;\n }\n\n return {\n nodeId,\n nodeLabel,\n baseUrl: validation.normalizedBaseUrl,\n enabled: candidate.enabled,\n token: candidate.token.trim(),\n createdAt: candidate.createdAt,\n updatedAt: candidate.updatedAt,\n };\n}\n\nfunction ensureNodesConfigDir(): void {\n if (!existsSync(NODES_CONFIG_DIR)) {\n mkdirSync(NODES_CONFIG_DIR, { recursive: true });\n }\n}\n\nfunction defaultRegistry(): NodeRegistryFile {\n return {\n version: 1,\n nodes: [],\n };\n}\n\nasync function readRegistryFile(): Promise<NodeRegistryFile> {\n try {\n ensureNodesConfigDir();\n\n if (!existsSync(NODE_REGISTRY_PATH)) {\n const initial = defaultRegistry();\n await writeRegistryFile(initial);\n return initial;\n }\n\n const raw = await readFile(NODE_REGISTRY_PATH, 'utf-8');\n const parsed = parse(raw, null, false) as unknown;\n\n if (!parsed || typeof parsed !== 'object') {\n return defaultRegistry();\n }\n\n const registry = parsed as Record<string, unknown>;\n if (!Array.isArray(registry.nodes)) {\n return defaultRegistry();\n }\n\n const normalizedNodes = registry.nodes\n .map(normalizeStoredNode)\n .filter((node): node is StoredNodeRecord => node !== null);\n\n const dedupedNodes: StoredNodeRecord[] = [];\n const seenBaseUrls = new Set<string>();\n for (const node of normalizedNodes) {\n if (seenBaseUrls.has(node.baseUrl)) {\n continue;\n }\n seenBaseUrls.add(node.baseUrl);\n dedupedNodes.push(node);\n }\n\n return {\n version: typeof registry.version === 'number' ? registry.version : 1,\n nodes: dedupedNodes,\n };\n } catch {\n return defaultRegistry();\n }\n}\n\nasync function writeRegistryFile(registry: NodeRegistryFile): Promise<void> {\n ensureNodesConfigDir();\n const content = stringify(registry, null, 2);\n await writeFile(NODE_REGISTRY_PATH, content, 'utf-8');\n}\n\nexport function sanitizeNodeRecord(node: StoredNodeRecord): PublicNodeRecord {\n return {\n nodeId: node.nodeId,\n nodeLabel: node.nodeLabel,\n baseUrl: node.baseUrl,\n enabled: node.enabled,\n createdAt: node.createdAt,\n updatedAt: node.updatedAt,\n tokenConfigured: node.token.trim().length > 0,\n };\n}\n\nfunction assertNodeLabel(label: unknown): string {\n if (typeof label !== 'string' || label.trim() === '') {\n throw new NodeRegistryError('node_label_required', 'nodeLabel is required and must be a non-empty string');\n }\n return label.trim();\n}\n\nfunction assertNodeId(nodeId: unknown): string {\n if (typeof nodeId !== 'string' || nodeId.trim() === '') {\n throw new NodeRegistryError('node_id_required', 'nodeId is required and must be a non-empty string');\n }\n return nodeId.trim();\n}\n\nfunction normalizeOptionalToken(token: unknown): string {\n if (token === undefined || token === null) {\n return '';\n }\n\n if (typeof token !== 'string') {\n throw new NodeRegistryError('invalid_token', 'token must be a string when provided');\n }\n\n return token.trim();\n}\n\nfunction assertEnabled(value: unknown): boolean {\n if (typeof value !== 'boolean') {\n throw new NodeRegistryError('invalid_enabled', 'enabled must be a boolean');\n }\n return value;\n}\n\nfunction assertAndNormalizeBaseUrl(baseUrl: unknown): string {\n if (typeof baseUrl !== 'string') {\n throw new NodeRegistryError('invalid_base_url', 'baseUrl must be a string');\n }\n\n const validation = validateNodeBaseUrl(baseUrl);\n if (!validation.ok) {\n throw new NodeRegistryError(\n 'invalid_base_url',\n `baseUrl validation failed: ${validation.error}`\n );\n }\n\n return validation.normalizedBaseUrl;\n}\n\nfunction assertUniqueBaseUrl(nodes: StoredNodeRecord[], normalizedBaseUrl: string, ignoreNodeId?: string): void {\n const duplicate = nodes.find(node => node.baseUrl === normalizedBaseUrl && node.nodeId !== ignoreNodeId);\n if (duplicate) {\n throw new NodeRegistryError(\n 'duplicate_base_url',\n `A node with baseUrl '${normalizedBaseUrl}' already exists`\n );\n }\n}\n\nexport async function listNodeRecords(): Promise<StoredNodeRecord[]> {\n const registry = await readRegistryFile();\n return [...registry.nodes];\n}\n\nexport async function listNodes(): Promise<PublicNodeRecord[]> {\n const nodes = await listNodeRecords();\n return nodes.map(sanitizeNodeRecord);\n}\n\nexport interface CreateNodeInput {\n nodeLabel: string;\n baseUrl: string;\n token?: string;\n enabled?: boolean;\n}\n\nexport interface UpdateNodeInput {\n nodeLabel?: string;\n baseUrl?: string;\n token?: string;\n enabled?: boolean;\n}\n\nexport async function createNode(input: CreateNodeInput): Promise<PublicNodeRecord> {\n const nodeLabel = assertNodeLabel(input.nodeLabel);\n const baseUrl = assertAndNormalizeBaseUrl(input.baseUrl);\n const token = normalizeOptionalToken(input.token);\n const enabled = input.enabled === undefined ? true : assertEnabled(input.enabled);\n\n const registry = await readRegistryFile();\n assertUniqueBaseUrl(registry.nodes, baseUrl);\n\n const now = new Date().toISOString();\n const record: StoredNodeRecord = {\n nodeId: randomUUID(),\n nodeLabel,\n baseUrl,\n enabled,\n token,\n createdAt: now,\n updatedAt: now,\n };\n\n registry.nodes.push(record);\n await writeRegistryFile(registry);\n\n return sanitizeNodeRecord(record);\n}\n\nexport async function updateNode(nodeIdInput: unknown, updates: UpdateNodeInput): Promise<PublicNodeRecord> {\n const nodeId = assertNodeId(nodeIdInput);\n\n const hasAnyUpdate =\n updates.nodeLabel !== undefined ||\n updates.baseUrl !== undefined ||\n updates.token !== undefined ||\n updates.enabled !== undefined;\n\n if (!hasAnyUpdate) {\n throw new NodeRegistryError('no_updates', 'At least one update field is required');\n }\n\n const registry = await readRegistryFile();\n const index = registry.nodes.findIndex(node => node.nodeId === nodeId);\n if (index === -1) {\n throw new NodeRegistryError('node_not_found', `Node '${nodeId}' not found`);\n }\n\n const current = registry.nodes[index];\n\n const nextNodeLabel = updates.nodeLabel === undefined ? current.nodeLabel : assertNodeLabel(updates.nodeLabel);\n const nextBaseUrl = updates.baseUrl === undefined ? current.baseUrl : assertAndNormalizeBaseUrl(updates.baseUrl);\n const nextToken = updates.token === undefined ? current.token : normalizeOptionalToken(updates.token);\n const nextEnabled = updates.enabled === undefined ? current.enabled : assertEnabled(updates.enabled);\n\n assertUniqueBaseUrl(registry.nodes, nextBaseUrl, current.nodeId);\n\n const updated: StoredNodeRecord = {\n ...current,\n nodeLabel: nextNodeLabel,\n baseUrl: nextBaseUrl,\n token: nextToken,\n enabled: nextEnabled,\n updatedAt: new Date().toISOString(),\n };\n\n registry.nodes[index] = updated;\n await writeRegistryFile(registry);\n\n return sanitizeNodeRecord(updated);\n}\n\nexport async function toggleNode(nodeIdInput: unknown, enabled?: unknown): Promise<PublicNodeRecord> {\n const nodeId = assertNodeId(nodeIdInput);\n\n const registry = await readRegistryFile();\n const index = registry.nodes.findIndex(node => node.nodeId === nodeId);\n if (index === -1) {\n throw new NodeRegistryError('node_not_found', `Node '${nodeId}' not found`);\n }\n\n const current = registry.nodes[index];\n const nextEnabled = enabled === undefined ? !current.enabled : assertEnabled(enabled);\n const updated: StoredNodeRecord = {\n ...current,\n enabled: nextEnabled,\n updatedAt: new Date().toISOString(),\n };\n\n registry.nodes[index] = updated;\n await writeRegistryFile(registry);\n\n return sanitizeNodeRecord(updated);\n}\n\nexport async function deleteNode(nodeIdInput: unknown): Promise<boolean> {\n const nodeId = assertNodeId(nodeIdInput);\n\n const registry = await readRegistryFile();\n const nextNodes = registry.nodes.filter(node => node.nodeId !== nodeId);\n if (nextNodes.length === registry.nodes.length) {\n return false;\n }\n\n registry.nodes = nextNodes;\n await writeRegistryFile(registry);\n return true;\n}\n","import { discoverOpencodePortsWithMeta } from '@/lib/opencodeDiscovery';\nimport { ActionSessionReference, parseActionSessionReference, resolveLocalActionSessionId } from '@/lib/hostIdentity';\nimport { listNodeRecords } from '@/lib/nodeRegistry';\nimport { createNodeRequestHeaders } from '@/lib/nodeProtocol';\nimport { detectProviderFromRawId, extractProviderRawId, getDefaultProviderContext } from '@/lib/session-providers/providerIds';\nimport {\n clearSessionForceUnarchived,\n markSessionStickyStatusBlocked,\n} from '@/lib/sessionArchiveOverrides';\nimport { markClaudeSessionArchived } from '@/lib/claudeSessionOverrides';\n\nconst REMOTE_NODE_ACTION_TIMEOUT_MS = 5_000;\n\nfunction createInvalidActionSessionIdResponse() {\n return Response.json(\n { error: 'Invalid action session id', reason: 'invalid_action_session_id' },\n { status: 400 }\n );\n}\n\nfunction createSessionNotFoundResponse() {\n return Response.json(\n { error: 'Session not found', reason: 'session_not_found' },\n { status: 404 }\n );\n}\n\nfunction createUnsupportedCapabilityResponse(capability: 'archive', sessionId: string) {\n const provider = detectProviderFromRawId(sessionId);\n\n return Response.json(\n {\n error: 'Session action not supported by provider',\n reason: 'provider_capability_unsupported',\n provider,\n capability,\n },\n { status: 403 }\n );\n}\n\nfunction createArchiveFailureResponse(\n status: number,\n message?: string,\n reason: 'archive_request_failed' | 'upstream_unreachable' = 'archive_request_failed'\n) {\n return Response.json(\n {\n error: 'Failed to archive session',\n reason,\n ...(message ? { message } : {}),\n },\n { status }\n );\n}\n\nasync function forwardRemoteArchive(hostId: string, sessionId: string): Promise<Response> {\n const nodeRecords = await listNodeRecords();\n const nodeRecord = nodeRecords.find((node) => node.nodeId === hostId);\n\n if (!nodeRecord || !nodeRecord.enabled) {\n return createSessionNotFoundResponse();\n }\n\n const abortController = new AbortController();\n let timedOut = false;\n const timeoutHandle = setTimeout(() => {\n timedOut = true;\n abortController.abort();\n }, REMOTE_NODE_ACTION_TIMEOUT_MS);\n\n try {\n const response = await fetch(`${nodeRecord.baseUrl}/api/node/sessions/${sessionId}/archive`, {\n method: 'POST',\n headers: createNodeRequestHeaders(nodeRecord.token),\n signal: abortController.signal,\n });\n\n if (response.ok) {\n return Response.json({ success: true });\n }\n\n const body = await response.json().catch(() => ({}));\n return Response.json(\n {\n error: 'Remote archive failed',\n reason: typeof body.reason === 'string' ? body.reason : `node_request_failed_${response.status}`,\n },\n { status: response.status }\n );\n } catch {\n return Response.json(\n {\n error: timedOut ? 'Remote node request timed out' : 'Remote node request failed',\n reason: timedOut ? 'upstream_timeout' : 'upstream_unreachable',\n },\n { status: timedOut ? 504 : 503 }\n );\n } finally {\n clearTimeout(timeoutHandle);\n }\n}\n\nexport async function POST(_: Request, { params }: { params: Promise<{ id: string }> }) {\n const { id } = await params;\n let actionTarget: ActionSessionReference;\n\n try {\n actionTarget = parseActionSessionReference(id);\n } catch {\n return createInvalidActionSessionIdResponse();\n }\n\n const provider = detectProviderFromRawId(actionTarget.sessionId);\n if (!getDefaultProviderContext(provider).capabilities.archive) {\n return createUnsupportedCapabilityResponse('archive', actionTarget.sessionId);\n }\n\n if (provider === 'claude-code' && actionTarget.isRemote) {\n return createUnsupportedCapabilityResponse('archive', actionTarget.sessionId);\n }\n\n if (provider === 'claude-code') {\n await markClaudeSessionArchived(extractProviderRawId(actionTarget.sessionId));\n const localSessionId = resolveLocalActionSessionId(id);\n if (localSessionId) {\n clearSessionForceUnarchived(localSessionId);\n markSessionStickyStatusBlocked(localSessionId);\n }\n return Response.json({ success: true });\n }\n\n const sessionId = resolveLocalActionSessionId(id);\n if (!sessionId && actionTarget.isRemote) {\n return forwardRemoteArchive(actionTarget.hostId, actionTarget.sessionId);\n }\n\n if (!sessionId) {\n return createInvalidActionSessionIdResponse();\n }\n\n const { ports, timedOut } = discoverOpencodePortsWithMeta();\n if (!ports.length) {\n if (timedOut) {\n return Response.json(\n { error: 'OpenCode discovery timed out' },\n { status: 503 }\n );\n }\n\n return Response.json(\n { error: 'OpenCode server not found' },\n { status: 503 }\n );\n }\n let sawNotFound = false;\n let lastFailureStatus: number | null = null;\n let lastFailureMessage: string | undefined;\n let lastFailureReason: 'archive_request_failed' | 'upstream_unreachable' = 'archive_request_failed';\n\n for (const port of ports) {\n try {\n const baseUrl = `http://localhost:${port}`;\n const response = await fetch(`${baseUrl}/session/${sessionId}`, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ time: { archived: Date.now() } })\n });\n if (response.ok) {\n clearSessionForceUnarchived(sessionId);\n markSessionStickyStatusBlocked(sessionId);\n return Response.json({ success: true });\n }\n\n const responseText = await response.text();\n console.error(`Failed to archive session on port ${port}:`, responseText);\n\n if (response.status === 404) {\n sawNotFound = true;\n continue;\n }\n\n lastFailureStatus = response.status;\n lastFailureMessage = responseText || undefined;\n lastFailureReason = 'archive_request_failed';\n } catch (error) {\n console.error(`Failed to archive session on port ${port}:`, error);\n lastFailureStatus = 503;\n lastFailureMessage = error instanceof Error ? error.message : String(error);\n lastFailureReason = 'upstream_unreachable';\n }\n }\n\n if (lastFailureStatus !== null) {\n return createArchiveFailureResponse(lastFailureStatus, lastFailureMessage, lastFailureReason);\n }\n\n if (sawNotFound) {\n return createSessionNotFoundResponse();\n }\n\n return createArchiveFailureResponse(500);\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]/archive/route\",\n pathname: \"/api/sessions/[id]/archive\",\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]/archive/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]/archive/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":[],"mappings":"sGAAA,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,OAEO,IAAM,EAAmB,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAO,AAAP,IAAW,UAAW,aAC9C,EAAqB,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAkB,cA+ClD,OAAM,UAA0B,MAC5B,IAA4B,AAErC,aAAY,CAA2B,CAAE,CAAe,CAAE,CACxD,KAAK,CAAC,GACN,IAAI,CAAC,IAAI,CAAG,oBACZ,IAAI,CAAC,IAAI,CAAG,CACd,CACF,CAQO,SAAS,EAAoB,CAAW,EAC7C,IAAM,EAAa,EAAI,IAAI,GAC3B,GAAI,CAAC,EACH,MAAO,CAAE,GADM,CACF,EAAO,MAAO,OAAQ,EAGrC,GAAI,CACF,IAAM,EAAS,IAAI,IAAI,GACvB,GAAwB,UAApB,EAAO,QAAQ,EAAoC,UAAU,CAA9B,EAAO,QAAQ,CAChD,MAAO,CAAE,IAAI,EAAO,MAAO,sBAAuB,EAGpD,GAAI,EAAO,QAAQ,EAAI,EAAO,QAAQ,CACpC,CADsC,KAC/B,CAAE,IAAI,EAAO,MAAO,yBAA0B,EAGvD,MAAO,CAAE,IAAI,EAAM,iBAAA,EArBrB,AAqBwC,EArBpC,MAAM,CAAG,GAqBkD,AApB/D,EAAI,IAAI,CAAG,GACJ,EAAI,QAAQ,GA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AAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[2]}
|
|
@@ -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"))},81951,e=>{"use strict";e.s(["RUNTIME_ROLE_ENV_VAR",0,"VIBEPULSE_RUNTIME_ROLE"])},68817,e=>{"use strict";var t=e.i(81951);let r="x-vibepulse-node-version",n={unauthorized:401,unsupported_node_version:426,node_misconfigured:503,upstream_unreachable:503,upstream_timeout:504};function o(e){return"string"!=typeof e?null:e.trim()||null}function i(e,t){let n=new Headers(t);n.set(r,"1");let i=o(e??null);return i&&n.set("authorization",`Bearer ${i}`),n}function s(e,t){return{ok:!1,reason:e,protocolVersion:"1",..."node_misconfigured"===e||"upstream_unreachable"===e||"upstream_timeout"===e?{degraded:!0}:{},...t??{}}}function a(e,t){return Response.json(s(e,t),{status:n[e]})}function u(e){return Response.json(e.body,{status:e.status})}function l(e,i={}){if("node"!==(i.runtimeRole??i.env?.[t.RUNTIME_ROLE_ENV_VAR]??process.env[t.RUNTIME_ROLE_ENV_VAR]))return{ok:!1,status:n.node_misconfigured,body:s("node_misconfigured")};let a=o(i.expectedToken)??function(e=process.env){return o(e.VIBEPULSE_NODE_TOKEN)}(i.env??process.env);if("1"!==e.headers.get(r))return{ok:!1,status:n.unsupported_node_version,body:s("unsupported_node_version")};if(a){var u;let t,r=(u=e.headers.get("authorization"),t=u?.match(/^Bearer\s+(.+)$/i),o(t?.[1]));if(!r||r!==a)return{ok:!1,status:n.unauthorized,body:s("unauthorized")}}return{ok:!0}}e.s(["NODE_PROTOCOL_VERSION",0,"1","createNodeFailureResponse",()=>a,"createNodeRequestHeaders",()=>i,"guardNodeRequest",()=>l,"toNodeRequestGuardResponse",()=>u])},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 u(e){return Array.from(new Set(e.filter(e=>Number.isInteger(e)&&e>0&&e<=65535))).sort((e,t)=>e-t)}function l(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=l(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=u([...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:u([...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)&&(l(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=[],u=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}`;u.has(i)||(u.add(i),o.push({pid:e,cwd:n}))}return{processes:o,timedOut:r.timedOut}}e.s(["discoverOpencodePortsWithMeta",()=>d,"discoverOpencodeProcessCwdsWithoutPortWithMeta",()=>c])},8322,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),u=e.i(16795),l=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 R=e.i(220),v=e.i(99686),y=e.i(33405);async function x(e,t){let r=function(e,t,r={}){let n=encodeURI(t.replace(/\\/g,"/")),o="string"==typeof r.remoteSshHost?r.remoteSshHost.trim():"";return"antigravity"===e?`antigravity://file${n.startsWith("/")?n:`/${n}`}`:o?`vscode://vscode-remote/ssh-remote+${o}${n.startsWith("/")?"":"/"}${n}`:`vscode://file${n.startsWith("/")?n:`/${n}`}`}(e,t),{command:n,args:o}=function(e,t=process.platform){return"darwin"===t?{command:"open",args:[e]}:"win32"===t?{command:"explorer",args:[e]}:{command:"xdg-open",args:[e]}}(r);return await new Promise((e,t)=>{(0,y.execFile)(n,o,r=>{r?t(r):e()})}),r}var E=e.i(68817),b=e.i(84044);async function O(e,{params:t}){var r,n;let o,i=(0,E.guardNodeRequest)(e);if(!i.ok)return(0,E.toNodeRequestGuardResponse)(i);let{id:s}=await t,a=!(o=s.trim())||o.includes(":")?null:o;if(!a)return Response.json({error:"Invalid node session id"},{status:400});let u="antigravity"===(n=((r=await e.json().catch(()=>({})))&&"object"==typeof r&&!Array.isArray(r)?r:{}).tool??"vscode")||"vscode"===n?n:null;if(!u)return Response.json({error:"Invalid open tool"},{status:400});let{ports:l,timedOut:d}=(0,v.discoverOpencodePortsWithMeta)();if(!l.length)return(0,E.createNodeFailureResponse)(d?"upstream_timeout":"upstream_unreachable",{role:"node",upstream:{kind:"opencode",reachable:!1}});let c=!1,p=[];for(let e of l)try{let t=(0,b.createVibePulseOpencodeClient)(`http://localhost:${e}`),r=await (0,b.getOpencodeSession)(t,a),n=r.data?.directory;if("string"!=typeof n||!n.trim()){c=!0;continue}try{let e=await x(u,n);return Response.json({success:!0,uri:e})}catch(e){return Response.json({error:"Editor unavailable",reason:"editor_unavailable",message:e instanceof Error?e.message:String(e)},{status:503})}}catch(e){p.push(e)}if(c)return Response.json({error:"Editor unavailable",reason:"editor_unavailable",message:"Session directory is missing or empty"},{status:503});if(p.length>0){let e=p[p.length-1],t=e?(0,b.formatOpencodeSdkError)(e):void 0;return p.every(e=>/not found|404/i.test((0,b.formatOpencodeSdkError)(e)))?Response.json({error:"Session not found",reason:"session_not_found"},{status:404}):Response.json({error:"Failed to open editor for session",reason:"upstream_unreachable",...t?{message:t}:{}},{status:503})}return Response.json({error:"Session not found",reason:"session_not_found"},{status:404})}e.s(["POST",()=>O,"dynamic",0,"force-dynamic"],35331);var _=e.i(35331);let w=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/node/sessions/[id]/open-editor/route",pathname:"/api/node/sessions/[id]/open-editor",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/node/sessions/[id]/open-editor/route.ts",nextConfigOutput:"standalone",userland:_}),{workAsyncStorage:N,workUnitAsyncStorage:S,serverHooks:P}=w;function C(){return(0,n.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:S})}async function A(e,t,n){w.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/node/sessions/[id]/open-editor/route";v=v.replace(/\/index$/,"")||"/";let y=await w.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:x,params:E,nextConfig:b,parsedUrl:O,isDraftMode:_,prerenderManifest:N,routerServerContext:S,isOnDemandRevalidate:P,revalidateOnlyGenerated:C,resolvedPathname:A,clientReferenceManifest:T,serverActionsManifest:I}=y,k=(0,a.normalizeAppPath)(v),M=!!(N.dynamicRoutes[k]||N.routes[A]),j=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,O,!1):t.end("This page could not be found"),null);if(M&&!_){let e=!!N.routes[A],t=N.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(b.experimental.adapterPath)return await j();throw new g.NoFallbackError}}let q=null;!M||w.isDev||_||(q="/index"===(q=A)?"/":q);let $=!0===w.isDev||!M,D=M&&!$;I&&T&&(0,s.setManifestsSingleton)({page:v,clientReferenceManifest:T,serverActionsManifest:I});let U=e.method||"GET",H=(0,i.getTracer)(),F=H.getActiveScopeSpan(),L={params:E,prerenderManifest:N,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts},cacheComponents:!!b.cacheComponents,supportsDynamicResponse:$,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:b.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,o)=>w.onRequestError(e,t,n,o,S)},sharedContext:{buildId:x}},V=new u.NodeNextRequest(e),W=new u.NodeNextResponse(t),B=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(t));try{let s=async e=>w.handle(B,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==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} ${v}`)}),a=!!(0,o.getRequestMeta)(e,"minimalMode"),u=async o=>{var i,u;let l=async({previousCacheEntry:r})=>{try{if(!a&&P&&C&&!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=L.renderOpts.fetchMetrics;let u=L.renderOpts.pendingWaitUntil;u&&n.waitUntil&&(n.waitUntil(u),u=void 0);let l=L.renderOpts.collectedTags;if(!M)return await (0,p.sendResponse)(V,W,i,L.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,n=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:R.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 w.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:P})},!1,S),t}},d=await w.handleResponse({req:e,nextConfig:b,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:C,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:a});if(!M)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(u=d.value)?void 0:u.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"),_&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let g=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return a&&M||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)(V,W,new Response(d.value.body,{headers:g,status:d.value.status||200})),null};F?await u(F):await H.withPropagatedContext(e.headers,()=>H.trace(d.BaseServerSpan.handleRequest,{spanName:`${U} ${v}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},u))}catch(t){if(t instanceof g.NoFallbackError||await w.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:P})},!1,S),M)throw t;return await (0,p.sendResponse)(V,W,new Response(null,{status:500})),null}}e.s(["handler",()=>A,"patchFetch",()=>C,"routeModule",()=>w,"serverHooks",()=>P,"workAsyncStorage",()=>N,"workUnitAsyncStorage",()=>S],8322)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__92089220._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/runtimeMode.ts","../../../src/lib/nodeProtocol.ts","../../../src/lib/opencodeDiscovery.ts","../../../src/app/api/node/sessions/%5Bid%5D/open-editor/route.ts","../../../src/lib/editorLauncher.server.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/lib/editorLauncher.ts"],"sourcesContent":["export const NODE_RUNTIME_FLAG = '--serve';\nexport const RUNTIME_ROLE_ENV_VAR = 'VIBEPULSE_RUNTIME_ROLE';\n\nexport type RuntimeRole = 'hub' | 'node';\n\nexport interface RuntimeMode {\n role: RuntimeRole;\n}\n\nfunction formatUsage(args: string[]): string {\n const renderedArgs = args.length > 0 ? args.join(' ') : '(none)';\n return `Unsupported arguments: ${renderedArgs}. Usage: vibepulse [${NODE_RUNTIME_FLAG}]`;\n}\n\nexport function resolveRuntimeMode(argv: string[]): RuntimeMode {\n if (!Array.isArray(argv)) {\n throw new TypeError('Runtime arguments must be provided as an array.');\n }\n\n if (argv.length === 0) {\n return { role: 'hub' };\n }\n\n if (argv.length === 1 && argv[0] === NODE_RUNTIME_FLAG) {\n return { role: 'node' };\n }\n\n throw new Error(formatUsage(argv));\n}\n","import { RUNTIME_ROLE_ENV_VAR } from '@/lib/runtimeMode';\n\nexport const NODE_PROTOCOL_VERSION_HEADER = 'x-vibepulse-node-version';\nexport const NODE_PROTOCOL_VERSION = '1';\nexport const NODE_SHARED_TOKEN_ENV_VAR = 'VIBEPULSE_NODE_TOKEN';\n\nexport type NodeFailureReason =\n | 'unauthorized'\n | 'unsupported_node_version'\n | 'node_misconfigured'\n | 'upstream_unreachable'\n | 'upstream_timeout';\n\nexport interface NodeFailurePayload {\n ok: false;\n reason: NodeFailureReason;\n protocolVersion: typeof NODE_PROTOCOL_VERSION;\n degraded?: boolean;\n [key: string]: unknown;\n}\n\nexport type NodeRequestGuardFailure = {\n ok: false;\n status: number;\n body: NodeFailurePayload;\n};\n\nexport type NodeRequestGuardResult =\n | { ok: true }\n | NodeRequestGuardFailure;\n\nexport interface NodeRequestGuardOptions {\n runtimeRole?: string | undefined;\n expectedToken?: string | undefined;\n env?: NodeJS.ProcessEnv;\n}\n\nconst NODE_FAILURE_STATUS: Record<NodeFailureReason, number> = {\n unauthorized: 401,\n unsupported_node_version: 426,\n node_misconfigured: 503,\n upstream_unreachable: 503,\n upstream_timeout: 504,\n};\n\nfunction trimToNull(value: string | null | undefined): string | null {\n if (typeof value !== 'string') {\n return null;\n }\n\n const trimmed = value.trim();\n return trimmed ? trimmed : null;\n}\n\nfunction readBearerToken(authorizationHeader: string | null): string | null {\n const match = authorizationHeader?.match(/^Bearer\\s+(.+)$/i);\n return trimToNull(match?.[1]);\n}\n\nfunction isDegradedReason(reason: NodeFailureReason): boolean {\n return reason === 'node_misconfigured' || reason === 'upstream_unreachable' || reason === 'upstream_timeout';\n}\n\nexport function getConfiguredNodeToken(env: NodeJS.ProcessEnv = process.env): string | null {\n return trimToNull(env[NODE_SHARED_TOKEN_ENV_VAR]);\n}\n\nexport function createNodeRequestHeaders(token?: string | null, headers?: HeadersInit): Headers {\n const requestHeaders = new Headers(headers);\n requestHeaders.set(NODE_PROTOCOL_VERSION_HEADER, NODE_PROTOCOL_VERSION);\n\n const trimmedToken = trimToNull(token ?? null);\n if (trimmedToken) {\n requestHeaders.set('authorization', `Bearer ${trimmedToken}`);\n }\n\n return requestHeaders;\n}\n\nexport function createNodeFailurePayload(\n reason: NodeFailureReason,\n extras?: Record<string, unknown>\n): NodeFailurePayload {\n return {\n ok: false,\n reason,\n protocolVersion: NODE_PROTOCOL_VERSION,\n ...(isDegradedReason(reason) ? { degraded: true } : {}),\n ...(extras ?? {}),\n };\n}\n\nexport function createNodeFailureResponse(\n reason: NodeFailureReason,\n extras?: Record<string, unknown>\n): Response {\n return Response.json(createNodeFailurePayload(reason, extras), {\n status: NODE_FAILURE_STATUS[reason],\n });\n}\n\nexport function toNodeRequestGuardResponse(failure: NodeRequestGuardFailure): Response {\n return Response.json(failure.body, { status: failure.status });\n}\n\nexport function guardNodeRequest(\n request: Request,\n options: NodeRequestGuardOptions = {}\n): NodeRequestGuardResult {\n const runtimeRole = options.runtimeRole ?? options.env?.[RUNTIME_ROLE_ENV_VAR] ?? process.env[RUNTIME_ROLE_ENV_VAR];\n if (runtimeRole !== 'node') {\n return {\n ok: false,\n status: NODE_FAILURE_STATUS.node_misconfigured,\n body: createNodeFailurePayload('node_misconfigured'),\n };\n }\n\n const expectedToken = trimToNull(options.expectedToken) ?? getConfiguredNodeToken(options.env ?? process.env);\n\n const version = request.headers.get(NODE_PROTOCOL_VERSION_HEADER);\n if (version !== NODE_PROTOCOL_VERSION) {\n return {\n ok: false,\n status: NODE_FAILURE_STATUS.unsupported_node_version,\n body: createNodeFailurePayload('unsupported_node_version'),\n };\n }\n\n if (expectedToken) {\n const presentedToken = readBearerToken(request.headers.get('authorization'));\n if (!presentedToken || presentedToken !== expectedToken) {\n return {\n ok: false,\n status: NODE_FAILURE_STATUS.unauthorized,\n body: createNodeFailurePayload('unauthorized'),\n };\n }\n }\n\n return { ok: true };\n}\n","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","import { discoverOpencodePortsWithMeta } from '@/lib/opencodeDiscovery';\nimport type { OpenEditorTool } from '@/lib/editorLauncher';\nimport { openEditorOnCurrentMachine } from '@/lib/editorLauncher.server';\nimport {\n createNodeFailureResponse,\n guardNodeRequest,\n toNodeRequestGuardResponse,\n} from '@/lib/nodeProtocol';\nimport { createVibePulseOpencodeClient, formatOpencodeSdkError, getOpencodeSession } from '@/lib/session-providers/opencodeSdkCompat';\n\nfunction resolveNodeLocalSessionId(id: string): string | null {\n const trimmedId = id.trim();\n if (!trimmedId || trimmedId.includes(':')) {\n return null;\n }\n\n return trimmedId;\n}\n\nfunction resolveOpenEditorTool(value: unknown): OpenEditorTool | null {\n return value === 'antigravity' || value === 'vscode' ? value : null;\n}\n\nfunction toRequestBodyRecord(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\nexport const dynamic = 'force-dynamic';\n\nexport async function POST(request: Request, { params }: { params: Promise<{ id: string }> }) {\n const guardResult = guardNodeRequest(request);\n if (!guardResult.ok) {\n return toNodeRequestGuardResponse(guardResult);\n }\n\n const { id } = await params;\n const sessionId = resolveNodeLocalSessionId(id);\n\n if (!sessionId) {\n return Response.json({ error: 'Invalid node session id' }, { status: 400 });\n }\n\n const parsedBody = await request.json().catch(() => ({}));\n const body = toRequestBodyRecord(parsedBody);\n const tool = resolveOpenEditorTool(body.tool ?? 'vscode');\n if (!tool) {\n return Response.json({ error: 'Invalid open tool' }, { status: 400 });\n }\n\n const { ports, timedOut } = discoverOpencodePortsWithMeta();\n if (!ports.length) {\n return createNodeFailureResponse(timedOut ? 'upstream_timeout' : 'upstream_unreachable', {\n role: 'node',\n upstream: {\n kind: 'opencode',\n reachable: false,\n },\n });\n }\n\n let sawMissingDirectory = false;\n const errors: Error[] = [];\n\n for (const port of ports) {\n try {\n const client = createVibePulseOpencodeClient(`http://localhost:${port}`);\n const result = await getOpencodeSession(client, sessionId);\n const directory = result.data?.directory;\n\n if (typeof directory !== 'string' || !directory.trim()) {\n sawMissingDirectory = true;\n continue;\n }\n\n try {\n const uri = await openEditorOnCurrentMachine(tool, directory);\n return Response.json({ success: true, uri });\n } catch (error) {\n return Response.json(\n {\n error: 'Editor unavailable',\n reason: 'editor_unavailable',\n message: error instanceof Error ? error.message : String(error),\n },\n { status: 503 }\n );\n }\n } catch (error) {\n errors.push(error as Error);\n }\n }\n\n if (sawMissingDirectory) {\n return Response.json(\n {\n error: 'Editor unavailable',\n reason: 'editor_unavailable',\n message: 'Session directory is missing or empty',\n },\n { status: 503 }\n );\n }\n\n if (errors.length > 0) {\n const lastError = errors[errors.length - 1];\n const lastErrorMessage = lastError ? formatOpencodeSdkError(lastError) : undefined;\n if (errors.every((error) => /not found|404/i.test(formatOpencodeSdkError(error)))) {\n return Response.json({ error: 'Session not found', reason: 'session_not_found' }, { status: 404 });\n }\n\n return Response.json(\n {\n error: 'Failed to open editor for session',\n reason: 'upstream_unreachable',\n ...(lastErrorMessage ? { message: lastErrorMessage } : {}),\n },\n { status: 503 }\n );\n }\n\n return Response.json({ error: 'Session not found', reason: 'session_not_found' }, { status: 404 });\n}\n","import { execFile } from 'child_process';\n\nimport { buildEditorUri, type OpenEditorTool } from './editorLauncher';\n\nexport function getEditorLaunchCommand(\n uri: string,\n platform: NodeJS.Platform = process.platform\n): { command: string; args: string[] } {\n if (platform === 'darwin') {\n return { command: 'open', args: [uri] };\n }\n\n if (platform === 'win32') {\n return { command: 'explorer', args: [uri] };\n }\n\n return { command: 'xdg-open', args: [uri] };\n}\n\nexport async function openEditorOnCurrentMachine(tool: OpenEditorTool, directory: string): Promise<string> {\n const uri = buildEditorUri(tool, directory);\n const { command, args } = getEditorLaunchCommand(uri);\n\n await new Promise<void>((resolve, reject) => {\n execFile(command, args, (error) => {\n if (error) {\n reject(error);\n return;\n }\n\n resolve();\n });\n });\n\n return uri;\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/node/sessions/[id]/open-editor/route\",\n pathname: \"/api/node/sessions/[id]/open-editor\",\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/node/sessions/[id]/open-editor/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/node/sessions/[id]/open-editor/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","export type OpenEditorTool = 'vscode' | 'antigravity';\n\nexport interface BuildEditorUriOptions {\n remoteSshHost?: string | null;\n}\n\nfunction toPosixPath(directory: string): string {\n return directory.replace(/\\\\/g, '/');\n}\n\nexport function buildEditorUri(tool: OpenEditorTool, directory: string, options: BuildEditorUriOptions = {}): string {\n const normalizedDirectory = toPosixPath(directory);\n const encodedPath = encodeURI(normalizedDirectory);\n const remoteSshHost = typeof options.remoteSshHost === 'string' ? options.remoteSshHost.trim() : '';\n\n if (tool === 'antigravity') {\n return `antigravity://file${encodedPath.startsWith('/') ? encodedPath : `/${encodedPath}`}`;\n }\n\n if (remoteSshHost) {\n return `vscode://vscode-remote/ssh-remote+${remoteSshHost}${encodedPath.startsWith('/') ? '' : '/'}${encodedPath}`;\n }\n\n return `vscode://file${encodedPath.startsWith('/') ? encodedPath : `/${encodedPath}`}`;\n}\n"],"names":[],"mappings":"g9BACoC,mDCDpC,IAAA,EAAA,EAAA,CAAA,CAAA,OAEO,IAAM,EAA+B,2BAmCtC,EAAyD,CAC7D,aAAc,IACd,yBAA0B,IAC1B,mBAAoB,IACpB,qBAAsB,IACtB,iBAAkB,GACpB,EAEA,SAAS,EAAW,CAAgC,QAClD,AAAqB,UAAjB,AAA2B,OAApB,EACF,KAGO,AACT,EADe,IAAI,IACT,AAAU,IAC7B,CAeO,SAAS,EAAyB,CAAqB,CAAE,CAAqB,EACnF,IAAM,EAAiB,IAAI,QAAQ,GACnC,EAAe,GAAG,CAAC,OAEnB,IAAM,EAAe,EAAW,GAAS,MAKzC,MAPiD,CAG7C,GACF,EAAe,GAAG,CAAC,KADH,WACoB,CAAC,OAAO,EAAE,EAAA,CAAc,EAGvD,CACT,CAEO,SAAS,EACd,CAAyB,CACzB,CAAgC,EAEhC,MAAO,CACL,IAAI,SACJ,EACA,iBAAiB,GACjB,GA3BgB,AA2BZ,AA3BC,0BAAmC,AAAW,4BAA0B,AAAW,qBA2BnE,EAAU,CAAE,UAAU,CAAK,EAAI,CAAC,CAAC,CACtD,GAAI,GAAU,CAAC,CAAC,AAClB,CACF,CAEO,SAAS,EACd,CAAyB,CACzB,CAAgC,EAEhC,OAAO,SAAS,IAAI,CAAC,EAAyB,EAAQ,GAAS,CAC7D,OAAQ,CAAmB,CAAC,EAAO,AACrC,EACF,CAEO,SAAS,EAA2B,CAAgC,EACzE,OAAO,SAAS,IAAI,CAAC,EAAQ,IAAI,CAAE,CAAE,OAAQ,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EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,CAChC,UACA,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":[5]}
|
|
@@ -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),i=e.i(14747),n=e.i(46786),a=e.i(89196);let o=(0,i.join)((0,n.homedir)(),".config","opencode"),s=(0,i.join)(o,"oh-my-openagent.jsonc"),l=(0,i.join)(o,"oh-my-opencode.jsonc"),u="https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/master/assets/oh-my-openagent.schema.json";function p(e){let t="object"!=typeof e||null===e||Array.isArray(e)?{}:{...e};return{...t,openEditorTargetMode:"hub"===t.openEditorTargetMode?"hub":"remote"}}function d(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)(d(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)(d(e),"utf-8");return(0,a.parse)(r,null,!1)}catch{return{}}}async function g(e,n=s){try{let o=(0,i.dirname)(n);(0,r.existsSync)(o)||(0,r.mkdirSync)(o,{recursive:!0});let l=n===s?{...e,$schema:e.$schema||u}:e,p=(0,a.stringify)(l,null,2);await (0,t.writeFile)(n,p,"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 i={...t};for(let[t,n]of Object.entries(r)){let r=i[t];if(f(r)&&f(n)){i[t]=e(r,n);continue}i[t]=n}return i},"normalizeVibePulseConfig",()=>p,"readConfig",()=>m,"resolveConfigPath",()=>d,"writeConfig",()=>g])},53977,e=>{"use strict";var t=e.i(24868),r=e.i(22734),i=e.i(14747),n=e.i(46786),a=e.i(89196),o=e.i(57181);let s=(0,i.join)((0,n.homedir)(),".config","opencode","profiles"),l=(0,i.join)(s,"index.json");function u(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let p=[{id:"balanced",name:"Balanced",emoji:"⚖️",description:"Balanced multi-model orchestration optimized for general coding tasks",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),isBuiltIn:!0}],d={balanced:{agents:{sisyphus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},oracle:{model:"openai/gpt-5.4",variant:"high",temperature:.2,top_p:.9},prometheus:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},metis:{model:"anthropic/claude-opus-4-6",variant:"max",temperature:.2,top_p:.9},momus:{model:"openai/gpt-5.4",variant:"medium",temperature:.2,top_p:.9},atlas:{model:"anthropic/claude-sonnet-4-6",temperature:.2,top_p:.9},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,i.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,i="string"==typeof e.$schema&&e.$schema.trim().length>0?e.$schema:o.OH_MY_OPENAGENT_CONFIG_SCHEMA;return{...e,$schema:i,agents:t,categories:r}}function g(){return{version:1,profiles:[...p],activeProfileId:null,lastModified:new Date().toISOString()}}async function h(){let e=new Set(p.map(e=>e.id));for(let i of["coding","writing","debug","minimal"])if(!e.has(i)){let e=f(i);(0,r.existsSync)(e)&&await (0,t.unlink)(e)}for(let e of p){let t=d[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"),i=(0,a.parse)(e,null,!1),n=!1;for(let e of p)i.profiles.some(t=>t.id===e.id)||(i.profiles.push(e),n=!0);let o=new Set(p.map(e=>e.id)),s=i.profiles.length;return i.profiles=i.profiles.filter(e=>!e.isBuiltIn||o.has(e.id)),i.profiles.length!==s&&(n=!0),await h(),n&&(i.lastModified=new Date().toISOString(),await v(i)),i}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 i=f(e);if(!(0,r.existsSync)(i))return{$schema:o.OH_MY_OPENAGENT_CONFIG_SCHEMA,agents:{}};let n=await (0,t.readFile)(i,"utf-8"),s=(0,a.parse)(n,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 i=f(e),n=(0,a.stringify)(m(r),null,2);await (0,t.writeFile)(i,n,"utf-8")}async function C(e){let i=(await y()).profiles.find(t=>t.id===e);if(i?.isBuiltIn){let t=d[e]||{agents:{}};return await R(e,t),!0}let n=f(e);return!!(0,r.existsSync)(n)&&(await (0,t.unlink)(n),!0)}async function A(e){return(await y()).profiles.find(t=>t.id===e)}async function S(e){let t=await y();t.activeProfileId=e,await v(t)}e.s(["deleteProfileConfig",()=>C,"getProfileById",()=>A,"readProfileConfig",()=>E,"readProfileIndex",()=>y,"readProfileIndexStrict",()=>x,"setActiveProfileId",()=>S,"writeProfileConfig",()=>R,"writeProfileIndex",()=>v])},11451,e=>{"use strict";function t(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function r(e){return t(e)?{...e,agents:t(e.agents)?e.agents:{},categories:t(e.categories)?e.categories:void 0}:{agents:{}}}function i(e,t){return{version:1,source:"vibepulse",exportedAt:new Date().toISOString(),profile:{id:e.id,name:e.name,emoji:e.emoji,description:e.description},config:r(t)}}function n(e){if(!t(e))throw Error("Imported profile file must be a JSON object");let i=e.profile;if(!t(i))throw Error("Imported profile file is missing a valid profile block");let n=i.id;if("string"!=typeof n||""===n.trim())throw Error("Imported profile id is required");if(!/^[a-zA-Z0-9_-]+$/.test(n.trim()))throw Error("Imported profile id must contain only letters, numbers, hyphens, and underscores");let a=i.name;if("string"!=typeof a||""===a.trim())throw Error("Imported profile name is required");let o=i.emoji,s=i.description;return{profile:{id:n.trim(),name:a.trim(),emoji:"string"==typeof o&&o.trim()?o:"⚙️",description:"string"==typeof s&&s.trim()?s.trim():void 0},config:r(e.config)}}e.s(["createExportedProfileFile",()=>i,"parseImportedProfileFile",()=>n])},96085,e=>{"use strict";var t=e.i(47909),r=e.i(74017),i=e.i(96250),n=e.i(59756),a=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),p=e.i(95169),d=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(11451);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 i=await (0,w.readProfileConfig)(e),n=(0,v.createExportedProfileFile)(r,i),a=`${r.id}.vibepulse-profile.json`;return new x.NextResponse(JSON.stringify(n,null,2),{headers:{"Content-Type":"application/json; charset=utf-8","Content-Disposition":`attachment; filename="${a}"`}})}catch{return x.NextResponse.json({error:"Internal server error"},{status:500})}}e.s(["GET",()=>E],50750);var R=e.i(50750);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/profiles/[id]/export/route",pathname:"/api/profiles/[id]/export",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/profiles/[id]/export/route.ts",nextConfigOutput:"standalone",userland:R}),{workAsyncStorage:A,workUnitAsyncStorage:S,serverHooks:_}=C;function b(){return(0,i.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:S})}async function P(e,t,i){C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/profiles/[id]/export/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==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:v,params:E,nextConfig:R,parsedUrl:A,isDraftMode:S,prerenderManifest:_,routerServerContext:b,isOnDemandRevalidate:P,revalidateOnlyGenerated:O,resolvedPathname:j,clientReferenceManifest:I,serverActionsManifest:N}=w,T=(0,s.normalizeAppPath)(x),k=!!(_.dynamicRoutes[T]||_.routes[j]),H=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,A,!1):t.end("This page could not be found"),null);if(k&&!S){let e=!!_.routes[j],t=_.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||S||(M="/index"===(M=j)?"/":M);let q=!0===C.isDev||!k,$=k&&!q;N&&I&&(0,o.setManifestsSingleton)({page:x,clientReferenceManifest:I,serverActionsManifest:N});let F=e.method||"GET",D=(0,a.getTracer)(),U=D.getActiveScopeSpan(),G={params:E,prerenderManifest:_,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:q,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:R.cacheLife,waitUntil:i.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,i,n)=>C.onRequestError(e,t,i,n,b)},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")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=r.get("next.route");if(i){let t=`${F} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t)}else e.updateName(`${F} ${x}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var a,l;let u=async({previousCacheEntry:r})=>{try{if(!s&&P&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let l=G.renderOpts.pendingWaitUntil;l&&i.waitUntil&&(i.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,i=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:i}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:P})},!1,b),t}},p=await C.handleResponse({req:e,nextConfig:R,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:i.waitUntil,isMinimalMode:s});if(!k)return null;if((null==p||null==(a=p.value)?void 0:a.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(l=p.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",P?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,f.fromNodeOutgoingHttpHeaders)(p.value.headers);return s&&k||h.delete(g.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,m.getCacheControlHeader)(p.cacheControl)),await (0,c.sendResponse)(B,K,new Response(p.value.body,{headers:h,status:p.value.status||200})),null};U?await l(U):await D.withPropagatedContext(e.headers,()=>D.trace(p.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,d.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:P})},!1,b),k)throw t;return await (0,c.sendResponse)(B,K,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>b,"routeModule",()=>C,"serverHooks",()=>_,"workAsyncStorage",()=>A,"workUnitAsyncStorage",()=>S],96085)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__9b7bc2d0._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/opencodeConfig.ts","../../../src/lib/profiles/storage.ts","../../../src/lib/profiles/share.ts","../../../src/app/api/profiles/%5Bid%5D/export/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 type { Profile, ProfileConfig } from '@/types/opencodeConfig';\n\nexport interface ExportedProfileFile {\n version: 1;\n source: 'vibepulse';\n exportedAt: string;\n profile: {\n id: string;\n name: string;\n emoji: string;\n description?: string;\n };\n config: ProfileConfig;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction normalizeConfig(value: unknown): ProfileConfig {\n if (!isRecord(value)) {\n return { agents: {} };\n }\n\n return {\n ...value,\n agents: isRecord(value.agents) ? (value.agents as ProfileConfig['agents']) : {},\n categories: isRecord(value.categories)\n ? (value.categories as NonNullable<ProfileConfig['categories']>)\n : undefined,\n };\n}\n\nexport function createExportedProfileFile(\n profile: Profile,\n config: ProfileConfig\n): ExportedProfileFile {\n return {\n version: 1,\n source: 'vibepulse',\n exportedAt: new Date().toISOString(),\n profile: {\n id: profile.id,\n name: profile.name,\n emoji: profile.emoji,\n description: profile.description,\n },\n config: normalizeConfig(config),\n };\n}\n\nexport function parseImportedProfileFile(value: unknown): {\n profile: ExportedProfileFile['profile'];\n config: ProfileConfig;\n} {\n if (!isRecord(value)) {\n throw new Error('Imported profile file must be a JSON object');\n }\n\n const profileValue = value.profile;\n if (!isRecord(profileValue)) {\n throw new Error('Imported profile file is missing a valid profile block');\n }\n\n const id = profileValue.id;\n if (typeof id !== 'string' || id.trim() === '') {\n throw new Error('Imported profile id is required');\n }\n\n if (!/^[a-zA-Z0-9_-]+$/.test(id.trim())) {\n throw new Error('Imported profile id must contain only letters, numbers, hyphens, and underscores');\n }\n\n const name = profileValue.name;\n if (typeof name !== 'string' || name.trim() === '') {\n throw new Error('Imported profile name is required');\n }\n\n const emojiValue = profileValue.emoji;\n const descriptionValue = profileValue.description;\n\n return {\n profile: {\n id: id.trim(),\n name: name.trim(),\n emoji: typeof emojiValue === 'string' && emojiValue.trim() ? emojiValue : '⚙️',\n description:\n typeof descriptionValue === 'string' && descriptionValue.trim()\n ? descriptionValue.trim()\n : undefined,\n },\n config: normalizeConfig(value.config),\n };\n}\n","import { NextResponse } from 'next/server';\nimport { getProfileById, readProfileConfig } from '@/lib/profiles/storage';\nimport { createExportedProfileFile } from '@/lib/profiles/share';\n\ninterface RouteParams {\n params: Promise<{ id: string }>;\n}\n\nexport async function GET(_request: Request, { params }: RouteParams) {\n try {\n const { id } = await params;\n const profile = await getProfileById(id);\n\n if (!profile) {\n return NextResponse.json({ error: 'Profile not found' }, { status: 404 });\n }\n\n const config = await readProfileConfig(id);\n const payload = createExportedProfileFile(profile, config);\n const filename = `${profile.id}.vibepulse-profile.json`;\n\n return new NextResponse(JSON.stringify(payload, null, 2), {\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n 'Content-Disposition': `attachment; filename=\"${filename}\"`,\n },\n });\n } catch {\n return NextResponse.json({ error: 'Internal server error' }, { status: 500 });\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]/export/route\",\n pathname: \"/api/profiles/[id]/export\",\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]/export/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]/export/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":[],"mappings":"qmCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGO,IAAM,EAAa,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,UAAW,YACxC,EAAc,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAY,yBAC/B,EAAqB,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAY,wBAMtC,EAAgC,2GAqC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rC,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,EACA,sBACJ,EACJ,GATmB,AAShB,EAAY,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[4]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[57181,e=>{"use strict";var t=e.i(24868),n=e.i(22734),r=e.i(14747),o=e.i(46786),i=e.i(89196);let a=(0,r.join)((0,o.homedir)(),".config","opencode"),d=(0,r.join)(a,"oh-my-openagent.jsonc"),s=(0,r.join)(a,"oh-my-opencode.jsonc"),l="https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/master/assets/oh-my-openagent.schema.json";function u(e){let t="object"!=typeof e||null===e||Array.isArray(e)?{}:{...e};return{...t,openEditorTargetMode:"hub"===t.openEditorTargetMode?"hub":"remote"}}function c(e=d){return e!==d?e:(0,n.existsSync)(d)?d:(0,n.existsSync)(s)?s:d}function f(e=d){try{return(0,n.existsSync)(c(e))}catch{return!1}}function b(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}async function p(e=d){try{let n=await (0,t.readFile)(c(e),"utf-8");return(0,i.parse)(n,null,!1)}catch{return{}}}async function y(e,o=d){try{let a=(0,r.dirname)(o);(0,n.existsSync)(a)||(0,n.mkdirSync)(a,{recursive:!0});let s=o===d?{...e,$schema:e.$schema||l}:e,u=(0,i.stringify)(s,null,2);await (0,t.writeFile)(o,u,"utf-8")}catch(e){throw Error(`Failed to write config: ${e}`)}}e.s(["OH_MY_OPENAGENT_CONFIG_SCHEMA",0,l,"detectConfig",()=>f,"mergeConfig",()=>function e(t,n){let r={...t};for(let[t,o]of Object.entries(n)){let n=r[t];if(b(n)&&b(o)){r[t]=e(n,o);continue}r[t]=o}return r},"normalizeVibePulseConfig",()=>u,"readConfig",()=>p,"resolveConfigPath",()=>c,"writeConfig",()=>y])},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),i=e.i(54799),a=e.i(89196);let d=(0,o.join)((0,r.homedir)(),".config","vibepulse"),s=(0,o.join)(d,"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 f(){(0,t.existsSync)(d)||(0,t.mkdirSync)(d,{recursive:!0})}function b(){return{version:1,nodes:[]}}async function p(){try{if(f(),!(0,t.existsSync)(s)){let e=b();return await y(e),e}let e=await (0,n.readFile)(s,"utf-8"),r=(0,a.parse)(e,null,!1);if(!r||"object"!=typeof r||!Array.isArray(r.nodes))return b();let o=r.nodes.map(c).filter(e=>null!==e),i=[],d=new Set;for(let e of o)d.has(e.baseUrl)||(d.add(e.baseUrl),i.push(e));return{version:"number"==typeof r.version?r.version:1,nodes:i}}catch{return b()}}async function y(e){f();let t=(0,a.stringify)(e,null,2);await (0,n.writeFile)(s,t,"utf-8")}function w(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 g(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 h(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 m(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 v(e){if("boolean"!=typeof e)throw new l("invalid_enabled","enabled must be a boolean");return e}function A(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 U(){return[...(await p()).nodes]}async function k(){return(await U()).map(w)}async function I(e){let t=g(e.nodeLabel),n=A(e.baseUrl),r=m(e.token),o=void 0===e.enabled||v(e.enabled),a=await p();_(a.nodes,n);let d=new Date().toISOString(),s={nodeId:(0,i.randomUUID)(),nodeLabel:t,baseUrl:n,enabled:o,token:r,createdAt:d,updatedAt:d};return a.nodes.push(s),await y(a),w(s)}async function S(e,t){let n=h(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 p(),o=r.nodes.findIndex(e=>e.nodeId===n);if(-1===o)throw new l("node_not_found",`Node '${n}' not found`);let i=r.nodes[o],a=void 0===t.nodeLabel?i.nodeLabel:g(t.nodeLabel),d=void 0===t.baseUrl?i.baseUrl:A(t.baseUrl),s=void 0===t.token?i.token:m(t.token),u=void 0===t.enabled?i.enabled:v(t.enabled);_(r.nodes,d,i.nodeId);let c={...i,nodeLabel:a,baseUrl:d,token:s,enabled:u,updatedAt:new Date().toISOString()};return r.nodes[o]=c,await y(r),w(c)}async function j(e,t){let n=h(e),r=await p(),o=r.nodes.findIndex(e=>e.nodeId===n);if(-1===o)throw new l("node_not_found",`Node '${n}' not found`);let i=r.nodes[o],a=void 0===t?!i.enabled:v(t),d={...i,enabled:a,updatedAt:new Date().toISOString()};return r.nodes[o]=d,await y(r),w(d)}async function x(e){let t=h(e),n=await p(),r=n.nodes.filter(e=>e.nodeId!==t);return r.length!==n.nodes.length&&(n.nodes=r,await y(n),!0)}e.s(["NodeRegistryError",()=>l,"createNode",()=>I,"deleteNode",()=>x,"listNodeRecords",()=>U,"listNodes",()=>k,"toggleNode",()=>j,"updateNode",()=>S])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__b2640944._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/opencodeConfig.ts","../../../src/lib/nodeRegistry.ts"],"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 { existsSync, mkdirSync } from 'fs';\nimport { readFile, writeFile } from 'fs/promises';\nimport { homedir } from 'os';\nimport { join } from 'path';\nimport { randomUUID } from 'crypto';\nimport { parse, stringify } from 'comment-json';\n\nexport const NODES_CONFIG_DIR = join(homedir(), '.config', 'vibepulse');\nexport const NODE_REGISTRY_PATH = join(NODES_CONFIG_DIR, 'nodes.jsonc');\n\nexport interface StoredNodeRecord {\n nodeId: string;\n nodeLabel: string;\n baseUrl: string;\n enabled: boolean;\n token: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface PublicNodeRecord {\n nodeId: string;\n nodeLabel: string;\n baseUrl: string;\n enabled: boolean;\n createdAt: string;\n updatedAt: string;\n tokenConfigured: boolean;\n}\n\ninterface NodeRegistryFile {\n version: number;\n nodes: StoredNodeRecord[];\n}\n\nexport type NodeBaseUrlValidationError =\n | 'empty'\n | 'invalid'\n | 'unsupported_protocol'\n | 'credentials_not_allowed';\n\ntype NodeBaseUrlValidationResult =\n | { ok: true; normalizedBaseUrl: string }\n | { ok: false; error: NodeBaseUrlValidationError };\n\nexport type NodeRegistryErrorCode =\n | 'node_not_found'\n | 'node_label_required'\n | 'node_id_required'\n | 'invalid_token'\n | 'invalid_enabled'\n | 'invalid_base_url'\n | 'duplicate_base_url'\n | 'no_updates';\n\nexport class NodeRegistryError extends Error {\n readonly code: NodeRegistryErrorCode;\n\n constructor(code: NodeRegistryErrorCode, message: string) {\n super(message);\n this.name = 'NodeRegistryError';\n this.code = code;\n }\n}\n\nfunction normalizeParsedBaseUrl(url: URL): string {\n url.search = '';\n url.hash = '';\n return url.toString().replace(/\\/+$/, '');\n}\n\nexport function validateNodeBaseUrl(url: string): NodeBaseUrlValidationResult {\n const trimmedUrl = url.trim();\n if (!trimmedUrl) {\n return { ok: false, error: 'empty' };\n }\n\n try {\n const parsed = new URL(trimmedUrl);\n if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {\n return { ok: false, error: 'unsupported_protocol' };\n }\n\n if (parsed.username || parsed.password) {\n return { ok: false, error: 'credentials_not_allowed' };\n }\n\n return { ok: true, normalizedBaseUrl: normalizeParsedBaseUrl(parsed) };\n } catch {\n return { ok: false, error: 'invalid' };\n }\n}\n\nfunction normalizeStoredNode(node: unknown): StoredNodeRecord | null {\n if (!node || typeof node !== 'object') {\n return null;\n }\n\n const candidate = node as Record<string, unknown>;\n if (\n typeof candidate.nodeId !== 'string' ||\n typeof candidate.nodeLabel !== 'string' ||\n typeof candidate.baseUrl !== 'string' ||\n typeof candidate.enabled !== 'boolean' ||\n typeof candidate.token !== 'string' ||\n typeof candidate.createdAt !== 'string' ||\n typeof candidate.updatedAt !== 'string'\n ) {\n return null;\n }\n\n const validation = validateNodeBaseUrl(candidate.baseUrl);\n if (!validation.ok) {\n return null;\n }\n\n const nodeId = candidate.nodeId.trim();\n const nodeLabel = candidate.nodeLabel.trim();\n\n if (!nodeId || !nodeLabel) {\n return null;\n }\n\n return {\n nodeId,\n nodeLabel,\n baseUrl: validation.normalizedBaseUrl,\n enabled: candidate.enabled,\n token: candidate.token.trim(),\n createdAt: candidate.createdAt,\n updatedAt: candidate.updatedAt,\n };\n}\n\nfunction ensureNodesConfigDir(): void {\n if (!existsSync(NODES_CONFIG_DIR)) {\n mkdirSync(NODES_CONFIG_DIR, { recursive: true });\n }\n}\n\nfunction defaultRegistry(): NodeRegistryFile {\n return {\n version: 1,\n nodes: [],\n };\n}\n\nasync function readRegistryFile(): Promise<NodeRegistryFile> {\n try {\n ensureNodesConfigDir();\n\n if (!existsSync(NODE_REGISTRY_PATH)) {\n const initial = defaultRegistry();\n await writeRegistryFile(initial);\n return initial;\n }\n\n const raw = await readFile(NODE_REGISTRY_PATH, 'utf-8');\n const parsed = parse(raw, null, false) as unknown;\n\n if (!parsed || typeof parsed !== 'object') {\n return defaultRegistry();\n }\n\n const registry = parsed as Record<string, unknown>;\n if (!Array.isArray(registry.nodes)) {\n return defaultRegistry();\n }\n\n const normalizedNodes = registry.nodes\n .map(normalizeStoredNode)\n .filter((node): node is StoredNodeRecord => node !== null);\n\n const dedupedNodes: StoredNodeRecord[] = [];\n const seenBaseUrls = new Set<string>();\n for (const node of normalizedNodes) {\n if (seenBaseUrls.has(node.baseUrl)) {\n continue;\n }\n seenBaseUrls.add(node.baseUrl);\n dedupedNodes.push(node);\n }\n\n return {\n version: typeof registry.version === 'number' ? registry.version : 1,\n nodes: dedupedNodes,\n };\n } catch {\n return defaultRegistry();\n }\n}\n\nasync function writeRegistryFile(registry: NodeRegistryFile): Promise<void> {\n ensureNodesConfigDir();\n const content = stringify(registry, null, 2);\n await writeFile(NODE_REGISTRY_PATH, content, 'utf-8');\n}\n\nexport function sanitizeNodeRecord(node: StoredNodeRecord): PublicNodeRecord {\n return {\n nodeId: node.nodeId,\n nodeLabel: node.nodeLabel,\n baseUrl: node.baseUrl,\n enabled: node.enabled,\n createdAt: node.createdAt,\n updatedAt: node.updatedAt,\n tokenConfigured: node.token.trim().length > 0,\n };\n}\n\nfunction assertNodeLabel(label: unknown): string {\n if (typeof label !== 'string' || label.trim() === '') {\n throw new NodeRegistryError('node_label_required', 'nodeLabel is required and must be a non-empty string');\n }\n return label.trim();\n}\n\nfunction assertNodeId(nodeId: unknown): string {\n if (typeof nodeId !== 'string' || nodeId.trim() === '') {\n throw new NodeRegistryError('node_id_required', 'nodeId is required and must be a non-empty string');\n }\n return nodeId.trim();\n}\n\nfunction normalizeOptionalToken(token: unknown): string {\n if (token === undefined || token === null) {\n return '';\n }\n\n if (typeof token !== 'string') {\n throw new NodeRegistryError('invalid_token', 'token must be a string when provided');\n }\n\n return token.trim();\n}\n\nfunction assertEnabled(value: unknown): boolean {\n if (typeof value !== 'boolean') {\n throw new NodeRegistryError('invalid_enabled', 'enabled must be a boolean');\n }\n return value;\n}\n\nfunction assertAndNormalizeBaseUrl(baseUrl: unknown): string {\n if (typeof baseUrl !== 'string') {\n throw new NodeRegistryError('invalid_base_url', 'baseUrl must be a string');\n }\n\n const validation = validateNodeBaseUrl(baseUrl);\n if (!validation.ok) {\n throw new NodeRegistryError(\n 'invalid_base_url',\n `baseUrl validation failed: ${validation.error}`\n );\n }\n\n return validation.normalizedBaseUrl;\n}\n\nfunction assertUniqueBaseUrl(nodes: StoredNodeRecord[], normalizedBaseUrl: string, ignoreNodeId?: string): void {\n const duplicate = nodes.find(node => node.baseUrl === normalizedBaseUrl && node.nodeId !== ignoreNodeId);\n if (duplicate) {\n throw new NodeRegistryError(\n 'duplicate_base_url',\n `A node with baseUrl '${normalizedBaseUrl}' already exists`\n );\n }\n}\n\nexport async function listNodeRecords(): Promise<StoredNodeRecord[]> {\n const registry = await readRegistryFile();\n return [...registry.nodes];\n}\n\nexport async function listNodes(): Promise<PublicNodeRecord[]> {\n const nodes = await listNodeRecords();\n return nodes.map(sanitizeNodeRecord);\n}\n\nexport interface CreateNodeInput {\n nodeLabel: string;\n baseUrl: string;\n token?: string;\n enabled?: boolean;\n}\n\nexport interface UpdateNodeInput {\n nodeLabel?: string;\n baseUrl?: string;\n token?: string;\n enabled?: boolean;\n}\n\nexport async function createNode(input: CreateNodeInput): Promise<PublicNodeRecord> {\n const nodeLabel = assertNodeLabel(input.nodeLabel);\n const baseUrl = assertAndNormalizeBaseUrl(input.baseUrl);\n const token = normalizeOptionalToken(input.token);\n const enabled = input.enabled === undefined ? true : assertEnabled(input.enabled);\n\n const registry = await readRegistryFile();\n assertUniqueBaseUrl(registry.nodes, baseUrl);\n\n const now = new Date().toISOString();\n const record: StoredNodeRecord = {\n nodeId: randomUUID(),\n nodeLabel,\n baseUrl,\n enabled,\n token,\n createdAt: now,\n updatedAt: now,\n };\n\n registry.nodes.push(record);\n await writeRegistryFile(registry);\n\n return sanitizeNodeRecord(record);\n}\n\nexport async function updateNode(nodeIdInput: unknown, updates: UpdateNodeInput): Promise<PublicNodeRecord> {\n const nodeId = assertNodeId(nodeIdInput);\n\n const hasAnyUpdate =\n updates.nodeLabel !== undefined ||\n updates.baseUrl !== undefined ||\n updates.token !== undefined ||\n updates.enabled !== undefined;\n\n if (!hasAnyUpdate) {\n throw new NodeRegistryError('no_updates', 'At least one update field is required');\n }\n\n const registry = await readRegistryFile();\n const index = registry.nodes.findIndex(node => node.nodeId === nodeId);\n if (index === -1) {\n throw new NodeRegistryError('node_not_found', `Node '${nodeId}' not found`);\n }\n\n const current = registry.nodes[index];\n\n const nextNodeLabel = updates.nodeLabel === undefined ? current.nodeLabel : assertNodeLabel(updates.nodeLabel);\n const nextBaseUrl = updates.baseUrl === undefined ? current.baseUrl : assertAndNormalizeBaseUrl(updates.baseUrl);\n const nextToken = updates.token === undefined ? current.token : normalizeOptionalToken(updates.token);\n const nextEnabled = updates.enabled === undefined ? current.enabled : assertEnabled(updates.enabled);\n\n assertUniqueBaseUrl(registry.nodes, nextBaseUrl, current.nodeId);\n\n const updated: StoredNodeRecord = {\n ...current,\n nodeLabel: nextNodeLabel,\n baseUrl: nextBaseUrl,\n token: nextToken,\n enabled: nextEnabled,\n updatedAt: new Date().toISOString(),\n };\n\n registry.nodes[index] = updated;\n await writeRegistryFile(registry);\n\n return sanitizeNodeRecord(updated);\n}\n\nexport async function toggleNode(nodeIdInput: unknown, enabled?: unknown): Promise<PublicNodeRecord> {\n const nodeId = assertNodeId(nodeIdInput);\n\n const registry = await readRegistryFile();\n const index = registry.nodes.findIndex(node => node.nodeId === nodeId);\n if (index === -1) {\n throw new NodeRegistryError('node_not_found', `Node '${nodeId}' not found`);\n }\n\n const current = registry.nodes[index];\n const nextEnabled = enabled === undefined ? !current.enabled : assertEnabled(enabled);\n const updated: StoredNodeRecord = {\n ...current,\n enabled: nextEnabled,\n updatedAt: new Date().toISOString(),\n };\n\n registry.nodes[index] = updated;\n await writeRegistryFile(registry);\n\n return sanitizeNodeRecord(updated);\n}\n\nexport async function deleteNode(nodeIdInput: unknown): Promise<boolean> {\n const nodeId = assertNodeId(nodeIdInput);\n\n const registry = await readRegistryFile();\n const nextNodes = registry.nodes.filter(node => node.nodeId !== nodeId);\n if (nextNodes.length === registry.nodes.length) {\n return false;\n }\n\n registry.nodes = nextNodes;\n await writeRegistryFile(registry);\n return true;\n}\n"],"names":[],"mappings":"uCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGO,IAAM,EAAa,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,UAAW,YACxC,EAAc,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,EAAY,yBAC/B,EAAqB,CAAA,E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