@hirra/vibemeter 0.1.2 → 0.1.4
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 +7 -1
- package/.next/build-manifest.json +7 -8
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +16 -12
- package/.next/required-server-files.js +5 -4
- package/.next/required-server-files.json +5 -4
- package/.next/routes-manifest.json +36 -0
- package/.next/server/app/_global-error/page/build-manifest.json +4 -5
- package/.next/server/app/_global-error/page.js +4 -4
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +4 -5
- package/.next/server/app/_not-found/page.js +5 -4
- 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/admin/page/build-manifest.json +4 -5
- package/.next/server/app/admin/page.js +7 -5
- package/.next/server/app/admin/page.js.nft.json +1 -1
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/codex-accounts/route.js +1 -1
- package/.next/server/app/api/codex-accounts/route.js.nft.json +1 -1
- package/.next/server/app/api/float/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/float/route/build-manifest.json +9 -0
- package/.next/server/app/api/float/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/float/route.js +8 -0
- package/.next/server/app/api/float/route.js.map +5 -0
- package/.next/server/app/api/float/route.js.nft.json +1 -0
- package/.next/server/app/api/float/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/import-sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/tags/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/alerts/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/settings/alerts/route/build-manifest.json +9 -0
- package/.next/server/app/api/settings/alerts/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/settings/alerts/route.js +9 -0
- package/.next/server/app/api/settings/alerts/route.js.map +5 -0
- package/.next/server/app/api/settings/alerts/route.js.nft.json +1 -0
- package/.next/server/app/api/settings/alerts/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/settings/notify/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/settings/notify/route/build-manifest.json +9 -0
- package/.next/server/app/api/settings/notify/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/settings/notify/route.js +7 -0
- package/.next/server/app/api/settings/notify/route.js.map +5 -0
- package/.next/server/app/api/settings/notify/route.js.nft.json +1 -0
- package/.next/server/app/api/settings/notify/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/usage/route.js +1 -1
- package/.next/server/app/api/usage/route.js.nft.json +1 -1
- package/.next/server/app/float/page/app-paths-manifest.json +3 -0
- package/.next/server/app/float/page/build-manifest.json +16 -0
- package/.next/server/app/float/page/next-font-manifest.json +11 -0
- package/.next/server/app/float/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/float/page/server-reference-manifest.json +4 -0
- package/.next/server/app/float/page.js +15 -0
- package/.next/server/app/float/page.js.map +5 -0
- package/.next/server/app/float/page.js.nft.json +1 -0
- package/.next/server/app/float/page_client-reference-manifest.js +3 -0
- package/.next/server/app/install.sh/route/app-paths-manifest.json +3 -0
- package/.next/server/app/install.sh/route/build-manifest.json +9 -0
- package/.next/server/app/install.sh/route/server-reference-manifest.json +4 -0
- package/.next/server/app/install.sh/route.js +6 -0
- package/.next/server/app/install.sh/route.js.map +5 -0
- package/.next/server/app/install.sh/route.js.nft.json +1 -0
- package/.next/server/app/install.sh/route_client-reference-manifest.js +3 -0
- package/.next/server/app/install.sh.body +108 -0
- package/.next/server/app/install.sh.meta +1 -0
- package/.next/server/app/page/build-manifest.json +4 -5
- package/.next/server/app/page.js +8 -5
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page/app-paths-manifest.json +3 -0
- package/.next/server/app/settings/page/build-manifest.json +16 -0
- package/.next/server/app/settings/page/next-font-manifest.json +11 -0
- package/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/settings/page/server-reference-manifest.json +4 -0
- package/.next/server/app/settings/page.js +17 -0
- package/.next/server/app/settings/page.js.map +5 -0
- package/.next/server/app/settings/page.js.nft.json +1 -0
- package/.next/server/app/settings/page_client-reference-manifest.js +3 -0
- package/.next/server/app-paths-manifest.json +7 -1
- package/.next/server/chunks/[externals]__0_i~3ox._.js +3 -0
- package/.next/server/chunks/[externals]__0_i~3ox._.js.map +1 -0
- package/.next/server/chunks/[externals]__13p_1zh._.js +3 -0
- package/.next/server/chunks/[externals]__13p_1zh._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__01t2c3w._.js +38 -0
- package/.next/server/chunks/[root-of-the-server]__01t2c3w._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__0g0u0lm._.js → [root-of-the-server]__024yzee._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__00q0o~z._.js → [root-of-the-server]__082iwfa._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0chedn~._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mwf0bn._.js +38 -0
- package/.next/server/chunks/[root-of-the-server]__0mwf0bn._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__0-74syk._.js → [root-of-the-server]__0ru3_it._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0u6y_k1._.js +111 -0
- package/.next/server/chunks/[root-of-the-server]__0u6y_k1._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__0866q87._.js → [root-of-the-server]__0xa4dzi._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__13415c6._.js +96 -0
- package/.next/server/chunks/[root-of-the-server]__13415c6._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__13j_28o._.js +96 -0
- package/.next/server/chunks/[root-of-the-server]__13j_28o._.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_float_route_actions_012j~jr.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_float_route_actions_012j~jr.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_settings_alerts_route_actions_0ydcyko.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_settings_alerts_route_actions_0ydcyko.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_settings_notify_route_actions_0-j35mb.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_settings_notify_route_actions_0-j35mb.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_install_sh_route_actions_0cj-6me.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_install_sh_route_actions_0cj-6me.js.map +1 -0
- package/.next/server/chunks/node_modules_next_06f88ko._.js +19 -0
- package/.next/server/chunks/node_modules_next_06f88ko._.js.map +1 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_03jj5jj.js +18 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_03jj5jj.js.map +1 -0
- package/.next/server/chunks/src_12i1qk5._.js +3 -0
- package/.next/server/chunks/src_12i1qk5._.js.map +1 -0
- package/.next/server/chunks/src_lib_alerts_ticker_ts_0n6oy1d._.js +169 -0
- package/.next/server/chunks/src_lib_alerts_ticker_ts_0n6oy1d._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__03mt8o0._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__03mt8o0._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__098zro9._.js → [root-of-the-server]__090jxzh._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__090jxzh._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__09hgk-7._.js → [root-of-the-server]__0c3j40u._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0c3j40u._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0ot4nev._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0ot4nev._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0q_~l2m._.js +90 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0q_~l2m._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__0cqes87._.js → [root-of-the-server]__0qt26ty._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0qt26ty._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0s5.uhg._.js +55 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0s5.uhg._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0x~-phx._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0x~-phx._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0y_zq8k._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0y_zq8k._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__08qr2ji._.js → [root-of-the-server]__0~953ob._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0~953ob._.js.map +1 -0
- package/.next/server/chunks/ssr/_0-9j34y._.js +70 -0
- package/.next/server/chunks/ssr/_0-9j34y._.js.map +1 -0
- package/.next/server/chunks/ssr/_0jxmm9h._.js +6 -0
- package/.next/server/chunks/ssr/_0jxmm9h._.js.map +1 -0
- package/.next/server/chunks/ssr/_0lfe3wr._.js +3 -0
- package/.next/server/chunks/ssr/_0lfe3wr._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_0i2xw~e._.js → _0nvprxh._.js} +5 -2
- package/.next/server/chunks/ssr/_0nvprxh._.js.map +1 -0
- package/.next/server/chunks/ssr/_0pugb10._.js +6 -0
- package/.next/server/chunks/ssr/_0pugb10._.js.map +1 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_float_page_actions_0x6hm4p.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_float_page_actions_0x6hm4p.js.map +1 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_settings_page_actions_0mr68ai.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_settings_page_actions_0mr68ai.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_11~q6fv._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_11~q6fv._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_09jzzl8._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_09jzzl8._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_0e1izl_._.js → node_modules_next_dist_0h9llsw._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_06b_a87.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_06b_a87.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0p_u4px.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0p_u4px.js.map +1 -0
- package/.next/server/chunks/ssr/src_0urkups._.js +3 -0
- package/.next/server/chunks/ssr/src_0urkups._.js.map +1 -0
- package/.next/server/chunks/ssr/src_components_0ox9d~w._.js +3 -0
- package/.next/server/chunks/ssr/src_components_0ox9d~w._.js.map +1 -0
- package/.next/server/chunks/ssr/src_components_CodexAccountsPanel_tsx_0n9xjzi._.js +1 -1
- package/.next/server/chunks/ssr/src_components_CodexAccountsPanel_tsx_0n9xjzi._.js.map +1 -1
- package/.next/server/chunks/ssr/src_components_FloatingWidget_tsx_089.6oo._.js +3 -0
- package/.next/server/chunks/ssr/src_components_FloatingWidget_tsx_089.6oo._.js.map +1 -0
- package/.next/server/chunks/ssr/src_lib_i18n_client_tsx_07pysgz._.js +3 -0
- package/.next/server/chunks/ssr/src_lib_i18n_client_tsx_07pysgz._.js.map +1 -0
- package/.next/server/edge/chunks/_0-m5tdn._.js +3 -0
- package/.next/server/edge/chunks/_0-m5tdn._.js.map +1 -0
- package/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_0mz-5sp.js.map +1 -0
- package/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_0mz-5sp.js +3 -0
- package/.next/server/functions-config-manifest.json +4 -1
- package/.next/server/instrumentation/middleware-manifest.json +12 -0
- package/.next/server/instrumentation.js +4 -0
- package/.next/server/instrumentation.js.map +5 -0
- package/.next/server/instrumentation.js.nft.json +1 -0
- package/.next/server/middleware-build-manifest.js +7 -8
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +8 -0
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages-manifest.json +0 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0bymg5d-lqs0o.js +5 -0
- package/.next/static/chunks/0ebdqsutnp8y4.js +1 -0
- package/.next/static/chunks/0i3~mnai-l497.js +1 -0
- package/.next/static/chunks/0idj4tdmyr934.js +1 -0
- package/.next/static/chunks/10eoi4q2wk80z.js +1 -0
- package/.next/static/chunks/10refkmyp9rbl.css +3 -0
- package/.next/static/chunks/{07lhk_q6pmm3r.js → 10u3y4bw1ayzs.js} +1 -1
- package/.next/static/chunks/{00gq-v0e07i1q.js → 115dplafwys-z.js} +1 -1
- package/.next/static/chunks/12-9memveha-v.js +1 -0
- package/.next/static/chunks/163s8y.j70104.js +4 -0
- package/.next/static/chunks/turbopack-0k9twle9a8sh6.js +1 -0
- package/.next/types/routes.d.ts +8 -2
- package/.next/types/validator.ts +54 -0
- package/README.md +57 -17
- package/bin/vibemeter-float.swift +970 -0
- package/bin/vibemeter-notify.sh +172 -0
- package/bin/vibemeter.mjs +385 -7
- package/package.json +2 -1
- package/public/demo1.png +0 -0
- package/public/float-ball.png +0 -0
- package/public/float-collapsed.png +0 -0
- package/public/float-expanded.png +0 -0
- package/public/pay-alipay.jpg +0 -0
- package/.next/server/app/_not-found.html +0 -1
- package/.next/server/app/_not-found.meta +0 -16
- package/.next/server/app/_not-found.rsc +0 -16
- package/.next/server/app/_not-found.segments/_full.segment.rsc +0 -16
- package/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
- package/.next/server/app/_not-found.segments/_index.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +0 -2
- package/.next/server/chunks/[root-of-the-server]__0y68a5d._.js +0 -96
- package/.next/server/chunks/[root-of-the-server]__0y68a5d._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__054lv8d._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__054lv8d._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__08qr2ji._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__098zro9._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__09hgk-7._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0cqes87._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0l.drdn._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0l.drdn._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js +0 -120
- package/.next/server/chunks/ssr/[root-of-the-server]__0v1zqf~._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0v73tbn._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0v73tbn._.js.map +0 -1
- package/.next/server/chunks/ssr/_0ye~8el._.js +0 -7
- package/.next/server/chunks/ssr/_0ye~8el._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_0ck2~9g._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_0ck2~9g._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_0i2xw~e._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_0e1izl_._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_0gsjr7_._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_0gsjr7_._.js.map +0 -1
- package/.next/server/pages/404.html +0 -1
- package/.next/static/chunks/002~6040mndie.css +0 -3
- package/.next/static/chunks/02g3221oh~3le.js +0 -2
- package/.next/static/chunks/0erq0bmub6w_z.js +0 -2
- package/.next/static/chunks/0ljfidstam_7k.js +0 -1
- package/.next/static/chunks/0pqt~8bl3ukh4.js +0 -4
- package/.next/static/chunks/turbopack-14vio.b1b9i4l.js +0 -1
- /package/.next/server/chunks/{[root-of-the-server]__0g0u0lm._.js.map → [root-of-the-server]__024yzee._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__00q0o~z._.js.map → [root-of-the-server]__082iwfa._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__0-74syk._.js.map → [root-of-the-server]__0ru3_it._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__0866q87._.js.map → [root-of-the-server]__0xa4dzi._.js.map} +0 -0
- /package/.next/static/{Ong62ufsHaRU36s0QK5ZZ → _Y03MiN6NI16Ms86q6vCJ}/_buildManifest.js +0 -0
- /package/.next/static/{Ong62ufsHaRU36s0QK5ZZ → _Y03MiN6NI16Ms86q6vCJ}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{Ong62ufsHaRU36s0QK5ZZ → _Y03MiN6NI16Ms86q6vCJ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/next/src/shared/lib/action-revalidation-kind.ts","../../../node_modules/next/src/server/web/spec-extension/adapters/request-cookies.ts","../../../node_modules/next/src/server/create-deduped-by-callsite-server-error-logger.ts","../../../node_modules/next/src/server/request/cookies.ts","../../../node_modules/next/src/server/web/spec-extension/adapters/headers.ts","../../../node_modules/next/src/server/request/headers.ts","../../../node_modules/next/src/server/request/draft-mode.ts","../../../node_modules/next/headers.js","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/settings/notify/route.ts","../../../src/lib/notify-installer.ts","../../../src/lib/i18n/server.ts","../../../src/lib/i18n/types.ts"],"sourcesContent":["export type ActionRevalidationKind = 0 | 1 | 2\n\nexport const ActionDidNotRevalidate = 0\nexport const ActionDidRevalidateStaticAndDynamic = 1\nexport const ActionDidRevalidateDynamicOnly = 2\n","import { RequestCookies } from '../cookies'\n\nimport { ResponseCookies } from '../cookies'\nimport { ReflectAdapter } from './reflect'\nimport { workAsyncStorage } from '../../../app-render/work-async-storage.external'\nimport type { RequestStore } from '../../../app-render/work-unit-async-storage.external'\nimport { ActionDidRevalidateStaticAndDynamic } from '../../../../shared/lib/action-revalidation-kind'\n\n/**\n * @internal\n */\nexport class ReadonlyRequestCookiesError extends Error {\n constructor() {\n super(\n 'Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'\n )\n }\n\n public static callable() {\n throw new ReadonlyRequestCookiesError()\n }\n}\n\n// We use this to type some APIs but we don't construct instances directly\nexport type { ResponseCookies }\n\n// The `cookies()` API is a mix of request and response cookies. For `.get()` methods,\n// we want to return the request cookie if it exists. For mutative methods like `.set()`,\n// we want to return the response cookie.\nexport type ReadonlyRequestCookies = Omit<\n RequestCookies,\n 'set' | 'clear' | 'delete'\n> &\n Pick<ResponseCookies, 'set' | 'delete'>\n\nexport class RequestCookiesAdapter {\n public static seal(cookies: RequestCookies): ReadonlyRequestCookies {\n return new Proxy(cookies as any, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'clear':\n case 'delete':\n case 'set':\n return ReadonlyRequestCookiesError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n}\n\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies')\n\nexport function getModifiedCookieValues(\n cookies: ResponseCookies\n): ResponseCookie[] {\n const modified: ResponseCookie[] | undefined = (cookies as unknown as any)[\n SYMBOL_MODIFY_COOKIE_VALUES\n ]\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return []\n }\n\n return modified\n}\n\ntype SetCookieArgs =\n | [key: string, value: string, cookie?: Partial<ResponseCookie>]\n | [options: ResponseCookie]\n\nexport function appendMutableCookies(\n headers: Headers,\n mutableCookies: ResponseCookies\n): boolean {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies)\n if (modifiedCookieValues.length === 0) {\n return false\n }\n\n // Return a new response that extends the response with\n // the modified cookies as fallbacks. `res` cookies\n // will still take precedence.\n const resCookies = new ResponseCookies(headers)\n const returnedCookies = resCookies.getAll()\n\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues) {\n resCookies.set(cookie)\n }\n\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies) {\n resCookies.set(cookie)\n }\n\n return true\n}\n\ntype ResponseCookie = NonNullable<\n ReturnType<InstanceType<typeof ResponseCookies>['get']>\n>\n\nexport class MutableRequestCookiesAdapter {\n public static wrap(\n cookies: RequestCookies,\n onUpdateCookies?: (cookies: string[]) => void\n ): ResponseCookies {\n const responseCookies = new ResponseCookies(new Headers())\n for (const cookie of cookies.getAll()) {\n responseCookies.set(cookie)\n }\n\n let modifiedValues: ResponseCookie[] = []\n const modifiedCookies = new Set<string>()\n const updateResponseCookies = () => {\n // TODO-APP: change method of getting workStore\n const workStore = workAsyncStorage.getStore()\n if (workStore) {\n workStore.pathWasRevalidated = ActionDidRevalidateStaticAndDynamic\n }\n\n const allCookies = responseCookies.getAll()\n modifiedValues = allCookies.filter((c) => modifiedCookies.has(c.name))\n if (onUpdateCookies) {\n const serializedCookies: string[] = []\n for (const cookie of modifiedValues) {\n const tempCookies = new ResponseCookies(new Headers())\n tempCookies.set(cookie)\n serializedCookies.push(tempCookies.toString())\n }\n\n onUpdateCookies(serializedCookies)\n }\n }\n\n const wrappedCookies = new Proxy(responseCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n // A special symbol to get the modified cookie values\n case SYMBOL_MODIFY_COOKIE_VALUES:\n return modifiedValues\n\n // TODO: Throw error if trying to set a cookie after the response\n // headers have been set.\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.delete(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.set(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n return wrappedCookies\n }\n}\n\nexport function createCookiesWithMutableAccessCheck(\n requestStore: RequestStore\n): ResponseCookies {\n const wrappedCookies = new Proxy(requestStore.mutableCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().delete')\n target.delete(...args)\n return wrappedCookies\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().set')\n target.set(...args)\n return wrappedCookies\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n return wrappedCookies\n}\n\nexport function areCookiesMutableInCurrentPhase(requestStore: RequestStore) {\n return requestStore.phase === 'action'\n}\n\n/** Ensure that cookies() starts throwing on mutation\n * if we changed phases and can no longer mutate.\n *\n * This can happen when going:\n * 'render' -> 'after'\n * 'action' -> 'render'\n * */\nfunction ensureCookiesAreStillMutable(\n requestStore: RequestStore,\n _callingExpression: string\n) {\n if (!areCookiesMutableInCurrentPhase(requestStore)) {\n // TODO: maybe we can give a more precise error message based on callingExpression?\n throw new ReadonlyRequestCookiesError()\n }\n}\n\nexport function responseCookiesToRequestCookies(\n responseCookies: ResponseCookies\n): RequestCookies {\n const requestCookies = new RequestCookies(new Headers())\n for (const cookie of responseCookies.getAll()) {\n requestCookies.set(cookie)\n }\n return requestCookies\n}\n","import * as React from 'react'\n\nconst errorRef: { current: null | Error } = { current: null }\n\n// React.cache is currently only available in canary/experimental React channels.\nconst cache =\n typeof React.cache === 'function'\n ? React.cache\n : (fn: (key: unknown) => void) => fn\n\n// When Cache Components is enabled, we record these as errors so that they\n// are captured by the dev overlay as it's more critical to fix these\n// when enabled.\nconst logErrorOrWarn = process.env.__NEXT_CACHE_COMPONENTS\n ? console.error\n : console.warn\n\n// We don't want to dedupe across requests.\n// The developer might've just attempted to fix the warning so we should warn again if it still happens.\nconst flushCurrentErrorIfNew = cache(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key\n (key: unknown) => {\n try {\n logErrorOrWarn(errorRef.current)\n } finally {\n errorRef.current = null\n }\n }\n)\n\n/**\n * Creates a function that logs an error message that is deduped by the userland\n * callsite.\n * This requires no indirection between the call of this function and the userland\n * callsite i.e. there's only a single library frame above this.\n * Do not use on the Client where sourcemaps and ignore listing might be enabled.\n * Only use that for warnings need a fix independent of the callstack.\n *\n * @param getMessage\n * @returns\n */\nexport function createDedupedByCallsiteServerErrorLoggerDev<Args extends any[]>(\n getMessage: (...args: Args) => Error\n) {\n return function logDedupedError(...args: Args) {\n const message = getMessage(...args)\n\n if (process.env.NODE_ENV !== 'production') {\n const callStackFrames = new Error().stack?.split('\\n')\n if (callStackFrames === undefined || callStackFrames.length < 4) {\n logErrorOrWarn(message)\n } else {\n // Error:\n // logDedupedError\n // asyncApiBeingAccessedSynchronously\n // <userland callsite>\n // TODO: This breaks if sourcemaps with ignore lists are enabled.\n const key = callStackFrames[4]\n errorRef.current = message\n flushCurrentErrorIfNew(key)\n }\n } else {\n logErrorOrWarn(message)\n }\n }\n}\n","import {\n type ReadonlyRequestCookies,\n areCookiesMutableInCurrentPhase,\n RequestCookiesAdapter,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { RequestCookies } from '../web/spec-extension/cookies'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n delayUntilRuntimeStage,\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nexport function cookies(): Promise<ReadonlyRequestCookies> {\n const callingExpression = 'cookies'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n // TODO(after): clarify that this only applies to pages?\n `Route ${workStore.route} used \\`cookies()\\` inside \\`after()\\`. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`cookies()\\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // cookies object without tracking\n const underlyingCookies = createEmptyCookies()\n return makeUntrackedCookies(underlyingCookies)\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`cookies()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n const error = new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, cookies)\n workStore.invalidDynamicUsageError ??= error\n throw error\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`cookies()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`cookies()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n return makeHangingCookies(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`cookies`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // We need track dynamic access here eagerly to keep continuity with\n // how cookies has worked in PPR without cacheComponents.\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // We track dynamic access here so we don't need to wrap the cookies\n // in individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime':\n return delayUntilRuntimeStage(\n workUnitStore,\n makeUntrackedCookies(workUnitStore.cookies)\n )\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedCookies(workUnitStore.cookies)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n let underlyingCookies: ReadonlyRequestCookies\n\n if (areCookiesMutableInCurrentPhase(workUnitStore)) {\n // We can't conditionally return different types here based on the context.\n // To avoid confusion, we always return the readonly type here.\n underlyingCookies =\n workUnitStore.userspaceMutableCookies as unknown as ReadonlyRequestCookies\n } else {\n underlyingCookies = workUnitStore.cookies\n }\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedCookiesWithDevWarnings(\n workUnitStore,\n underlyingCookies,\n workStore?.route\n )\n } else if (workUnitStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(workUnitStore)\n if (underlyingCookies === workUnitStore.mutableCookies) {\n return early\n ? workUnitStore.asyncApiPromises.earlyMutableCookies\n : workUnitStore.asyncApiPromises.mutableCookies\n } else {\n return early\n ? workUnitStore.asyncApiPromises.earlyCookies\n : workUnitStore.asyncApiPromises.cookies\n }\n } else {\n return makeUntrackedCookies(underlyingCookies)\n }\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\nfunction createEmptyCookies(): ReadonlyRequestCookies {\n return RequestCookiesAdapter.seal(new RequestCookies(new Headers({})))\n}\n\ninterface CacheLifetime {}\nconst CachedCookies = new WeakMap<\n CacheLifetime,\n Promise<ReadonlyRequestCookies>\n>()\n\nfunction makeHangingCookies(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyRequestCookies> {\n const cachedPromise = CachedCookies.get(prerenderStore)\n if (cachedPromise) {\n return cachedPromise\n }\n\n const promise = makeHangingPromise<ReadonlyRequestCookies>(\n prerenderStore.renderSignal,\n workStore.route,\n '`cookies()`'\n )\n CachedCookies.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookies(\n underlyingCookies: ReadonlyRequestCookies\n): Promise<ReadonlyRequestCookies> {\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = Promise.resolve(underlyingCookies)\n CachedCookies.set(underlyingCookies, promise)\n\n return promise\n}\n\nfunction makeUntrackedCookiesWithDevWarnings(\n requestStore: RequestStore,\n underlyingCookies: ReadonlyRequestCookies,\n route?: string\n): Promise<ReadonlyRequestCookies> {\n if (requestStore.asyncApiPromises) {\n const early = isInEarlyRenderStage(requestStore)\n let promise: Promise<ReadonlyRequestCookies>\n if (underlyingCookies === requestStore.mutableCookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyMutableCookies\n : requestStore.asyncApiPromises.mutableCookies\n } else if (underlyingCookies === requestStore.cookies) {\n promise = early\n ? requestStore.asyncApiPromises.earlyCookies\n : requestStore.asyncApiPromises.cookies\n } else {\n throw new InvariantError(\n 'Received an underlying cookies object that does not match either `cookies` or `mutableCookies`'\n )\n }\n return instrumentCookiesPromiseWithDevWarnings(promise, route)\n }\n\n const cachedCookies = CachedCookies.get(underlyingCookies)\n if (cachedCookies) {\n return cachedCookies\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingCookies,\n requestStore,\n RenderStage.Runtime\n )\n\n const proxiedPromise = instrumentCookiesPromiseWithDevWarnings(promise, route)\n\n CachedCookies.set(underlyingCookies, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createCookiesAccessError\n)\n\nfunction instrumentCookiesPromiseWithDevWarnings(\n promise: Promise<ReadonlyRequestCookies>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n size: replaceableWarningDescriptor(promise, 'size', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n getAll: replaceableWarningDescriptor(promise, 'getAll', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n clear: replaceableWarningDescriptor(promise, 'clear', route),\n toString: replaceableWarningDescriptor(promise, 'toString', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`cookies().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...cookies()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createCookiesAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`cookies()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n","import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super()\n\n this.headers = new Proxy(headers, {\n get(target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === 'symbol') {\n return ReflectAdapter.get(target, prop, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver)\n },\n set(target, prop, value, receiver) {\n if (typeof prop === 'symbol') {\n return ReflectAdapter.set(target, prop, value, receiver)\n }\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver)\n },\n has(target, prop) {\n if (typeof prop === 'symbol') return ReflectAdapter.has(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */\n public static seal(headers: Headers): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(headers, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'append':\n case 'delete':\n case 'set':\n return ReadonlyHeadersError.callable\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n }\n\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\n\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n","import {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport {\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n type PrerenderStoreModern,\n type RequestStore,\n isInEarlyRenderStage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n postponeWithTracking,\n throwToInterruptStaticGeneration,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n delayUntilRuntimeStage,\n makeDevtoolsIOAwarePromise,\n makeHangingPromise,\n} from '../dynamic-rendering-utils'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { isRequestAPICallableInsideAfter } from './utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from '../app-render/staged-rendering'\n\n/**\n * This function allows you to read the HTTP incoming request headers in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and\n * [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).\n *\n * Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)\n */\nexport function headers(): Promise<ReadonlyHeaders> {\n const callingExpression = 'headers'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n if (\n workUnitStore &&\n workUnitStore.phase === 'after' &&\n !isRequestAPICallableInsideAfter()\n ) {\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`after()\\`. This is not supported. If you need this data inside an \\`after()\\` callback, use \\`headers()\\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`\n )\n }\n\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n const underlyingHeaders = HeadersAdapter.seal(new Headers({}))\n return makeUntrackedHeaders(underlyingHeaders)\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache': {\n const error = new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, headers)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside a function cached with \\`unstable_cache()\\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \\`headers()\\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`headers()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n case 'prerender':\n case 'prerender-client':\n case 'validation-client':\n case 'private-cache':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`headers()\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n return makeHangingHeaders(workStore, workUnitStore)\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`headers`'\n throw new InvariantError(\n `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n // PPR Prerender (no cacheComponents)\n // We are prerendering with PPR. We need track dynamic access here eagerly\n // to keep continuity with how headers has worked in PPR without cacheComponents.\n // TODO consider switching the semantic to throw on property access instead\n return postponeWithTracking(\n workStore.route,\n callingExpression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n // Legacy Prerender\n // We are in a legacy static generation mode while prerendering\n // We track dynamic access here so we don't need to wrap the headers in\n // individual property access tracking.\n return throwToInterruptStaticGeneration(\n callingExpression,\n workStore,\n workUnitStore\n )\n case 'prerender-runtime':\n return delayUntilRuntimeStage(\n workUnitStore,\n makeUntrackedHeaders(workUnitStore.headers)\n )\n case 'private-cache':\n // Private caches are delayed until the runtime stage in use-cache-wrapper,\n // so we don't need an additional delay here.\n return makeUntrackedHeaders(workUnitStore.headers)\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n\n if (process.env.NODE_ENV === 'development') {\n // Semantically we only need the dev tracking when running in `next dev`\n // but since you would never use next dev with production NODE_ENV we use this\n // as a proxy so we can statically exclude this code from production builds.\n return makeUntrackedHeadersWithDevWarnings(\n workUnitStore.headers,\n workStore?.route,\n workUnitStore\n )\n } else if (workUnitStore.asyncApiPromises) {\n return isInEarlyRenderStage(workUnitStore)\n ? workUnitStore.asyncApiPromises.earlyHeaders\n : workUnitStore.asyncApiPromises.headers\n } else {\n return makeUntrackedHeaders(workUnitStore.headers)\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n }\n\n // If we end up here, there was no work store or work unit store present.\n throwForMissingRequestStore(callingExpression)\n}\n\ninterface CacheLifetime {}\nconst CachedHeaders = new WeakMap<CacheLifetime, Promise<ReadonlyHeaders>>()\n\nfunction makeHangingHeaders(\n workStore: WorkStore,\n prerenderStore: PrerenderStoreModern\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(prerenderStore)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeHangingPromise<ReadonlyHeaders>(\n prerenderStore.renderSignal,\n workStore.route,\n '`headers()`'\n )\n CachedHeaders.set(prerenderStore, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeaders(\n underlyingHeaders: ReadonlyHeaders\n): Promise<ReadonlyHeaders> {\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = Promise.resolve(underlyingHeaders)\n CachedHeaders.set(underlyingHeaders, promise)\n\n return promise\n}\n\nfunction makeUntrackedHeadersWithDevWarnings(\n underlyingHeaders: ReadonlyHeaders,\n route: string | undefined,\n requestStore: RequestStore\n): Promise<ReadonlyHeaders> {\n if (requestStore.asyncApiPromises) {\n const promise = isInEarlyRenderStage(requestStore)\n ? requestStore.asyncApiPromises.earlyHeaders\n : requestStore.asyncApiPromises.headers\n return instrumentHeadersPromiseWithDevWarnings(promise, route)\n }\n\n const cachedHeaders = CachedHeaders.get(underlyingHeaders)\n if (cachedHeaders) {\n return cachedHeaders\n }\n\n const promise = makeDevtoolsIOAwarePromise(\n underlyingHeaders,\n requestStore,\n RenderStage.Runtime\n )\n\n const proxiedPromise = instrumentHeadersPromiseWithDevWarnings(promise, route)\n\n CachedHeaders.set(underlyingHeaders, proxiedPromise)\n\n return proxiedPromise\n}\n\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createHeadersAccessError\n)\n\nfunction instrumentHeadersPromiseWithDevWarnings(\n promise: Promise<ReadonlyHeaders>,\n route: string | undefined\n) {\n Object.defineProperties(promise, {\n [Symbol.iterator]: replaceableWarningDescriptorForSymbolIterator(\n promise,\n route\n ),\n append: replaceableWarningDescriptor(promise, 'append', route),\n delete: replaceableWarningDescriptor(promise, 'delete', route),\n get: replaceableWarningDescriptor(promise, 'get', route),\n has: replaceableWarningDescriptor(promise, 'has', route),\n set: replaceableWarningDescriptor(promise, 'set', route),\n getSetCookie: replaceableWarningDescriptor(promise, 'getSetCookie', route),\n forEach: replaceableWarningDescriptor(promise, 'forEach', route),\n keys: replaceableWarningDescriptor(promise, 'keys', route),\n values: replaceableWarningDescriptor(promise, 'values', route),\n entries: replaceableWarningDescriptor(promise, 'entries', route),\n })\n return promise\n}\n\nfunction replaceableWarningDescriptor(\n target: unknown,\n prop: string,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, `\\`headers().${prop}\\``)\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction replaceableWarningDescriptorForSymbolIterator(\n target: unknown,\n route: string | undefined\n) {\n return {\n enumerable: false,\n get() {\n warnForSyncAccess(route, '`...headers()` or similar iteration')\n return undefined\n },\n set(value: unknown) {\n Object.defineProperty(target, Symbol.iterator, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n })\n },\n configurable: true,\n }\n}\n\nfunction createHeadersAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`headers()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n","import {\n getDraftModeProviderForCacheScope,\n throwForMissingRequestStore,\n} from '../app-render/work-unit-async-storage.external'\n\nimport type { DraftModeProvider } from '../async-storage/draft-mode-provider'\n\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport {\n abortAndThrowOnSynchronousRequestDataAccess,\n postponeWithTracking,\n trackDynamicDataInDynamicRender,\n} from '../app-render/dynamic-rendering'\nimport { createDedupedByCallsiteServerErrorLoggerDev } from '../create-deduped-by-callsite-server-error-logger'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { DynamicServerError } from '../../client/components/hooks-server-context'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { delayUntilRuntimeStage } from '../dynamic-rendering-utils'\nimport { ReflectAdapter } from '../web/spec-extension/adapters/reflect'\n\nexport function draftMode(): Promise<DraftMode> {\n const callingExpression = 'draftMode'\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workStore || !workUnitStore) {\n throwForMissingRequestStore(callingExpression)\n }\n\n switch (workUnitStore.type) {\n case 'prerender-runtime':\n // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky\n return delayUntilRuntimeStage(\n workUnitStore,\n createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)\n )\n case 'request':\n return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)\n\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n // Inside of `\"use cache\"` or `unstable_cache`, draft mode is available if\n // the outmost work unit store is a request store (or a runtime prerender),\n // and if draft mode is enabled.\n const draftModeProvider = getDraftModeProviderForCacheScope(\n workStore,\n workUnitStore\n )\n\n if (draftModeProvider) {\n return createOrGetCachedDraftMode(draftModeProvider, workStore)\n }\n\n // Otherwise, we fall through to providing an empty draft mode.\n // eslint-disable-next-line no-fallthrough\n case 'prerender':\n case 'prerender-ppr':\n case 'prerender-legacy':\n // Return empty draft mode\n return createOrGetCachedDraftMode(null, workStore)\n case 'prerender-client':\n case 'validation-client': {\n const exportName = '`draftMode`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n }\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`${callingExpression}()\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n\n default:\n return workUnitStore satisfies never\n }\n}\n\nfunction createOrGetCachedDraftMode(\n draftModeProvider: DraftModeProvider | null,\n workStore: WorkStore | undefined\n): Promise<DraftMode> {\n const cacheKey = draftModeProvider ?? NullDraftMode\n const cachedDraftMode = CachedDraftModes.get(cacheKey)\n\n if (cachedDraftMode) {\n return cachedDraftMode\n }\n\n if (process.env.NODE_ENV === 'development' && !workStore?.isPrefetchRequest) {\n const route = workStore?.route\n return createDraftModeWithDevWarnings(draftModeProvider, route)\n } else {\n return Promise.resolve(new DraftMode(draftModeProvider))\n }\n}\n\ninterface CacheLifetime {}\nconst NullDraftMode = {}\nconst CachedDraftModes = new WeakMap<CacheLifetime, Promise<DraftMode>>()\n\nfunction createDraftModeWithDevWarnings(\n underlyingProvider: null | DraftModeProvider,\n route: undefined | string\n): Promise<DraftMode> {\n const instance = new DraftMode(underlyingProvider)\n const promise = Promise.resolve(instance)\n\n const proxiedPromise = new Proxy(promise, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'isEnabled':\n warnForSyncAccess(route, `\\`draftMode().${prop}\\``)\n break\n case 'enable':\n case 'disable': {\n warnForSyncAccess(route, `\\`draftMode().${prop}()\\``)\n break\n }\n default: {\n // We only warn for well-defined properties of the draftMode object.\n }\n }\n\n return ReflectAdapter.get(target, prop, receiver)\n },\n })\n\n return proxiedPromise\n}\n\nclass DraftMode {\n /**\n * @internal - this declaration is stripped via `tsc --stripInternal`\n */\n private readonly _provider: null | DraftModeProvider\n\n constructor(provider: null | DraftModeProvider) {\n this._provider = provider\n }\n get isEnabled() {\n if (this._provider !== null) {\n return this._provider.isEnabled\n }\n return false\n }\n public enable() {\n // We have a store we want to track dynamic data access to ensure we\n // don't statically generate routes that manipulate draft mode.\n trackDynamicDraftMode('draftMode().enable()', this.enable)\n if (this._provider !== null) {\n this._provider.enable()\n }\n }\n public disable() {\n trackDynamicDraftMode('draftMode().disable()', this.disable)\n if (this._provider !== null) {\n this._provider.disable()\n }\n }\n}\nconst warnForSyncAccess = createDedupedByCallsiteServerErrorLoggerDev(\n createDraftModeAccessError\n)\n\nfunction createDraftModeAccessError(\n route: string | undefined,\n expression: string\n) {\n const prefix = route ? `Route \"${route}\" ` : 'This route '\n return new Error(\n `${prefix}used ${expression}. ` +\n `\\`draftMode()\\` returns a Promise and must be unwrapped with \\`await\\` or \\`React.use()\\` before accessing its properties. ` +\n `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`\n )\n}\n\nfunction trackDynamicDraftMode(expression: string, constructorOpt: Function) {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workStore) {\n // We have a store we want to track dynamic data access to ensure we\n // don't statically generate routes that manipulate draft mode.\n if (workUnitStore?.phase === 'after') {\n throw new Error(\n `Route ${workStore.route} used \"${expression}\" inside \\`after()\\`. The enabled status of \\`draftMode()\\` can be read inside \\`after()\\` but you cannot enable or disable \\`draftMode()\\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n )\n }\n\n if (workStore.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'private-cache': {\n const error = new Error(\n `Route ${workStore.route} used \"${expression}\" inside \"use cache\". The enabled status of \\`draftMode()\\` can be read in caches but you must not enable or disable \\`draftMode()\\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n Error.captureStackTrace(error, constructorOpt)\n workStore.invalidDynamicUsageError ??= error\n throw error\n }\n case 'unstable-cache':\n throw new Error(\n `Route ${workStore.route} used \"${expression}\" inside a function cached with \\`unstable_cache()\\`. The enabled status of \\`draftMode()\\` can be read in caches but you must not enable or disable \\`draftMode()\\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`\n )\n\n case 'prerender':\n case 'prerender-runtime': {\n const error = new Error(\n `Route ${workStore.route} used ${expression} without first calling \\`await connection()\\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`\n )\n return abortAndThrowOnSynchronousRequestDataAccess(\n workStore.route,\n expression,\n error,\n workUnitStore\n )\n }\n case 'prerender-client':\n case 'validation-client':\n const exportName = '`draftMode`'\n throw new InvariantError(\n `${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`\n )\n case 'prerender-ppr':\n return postponeWithTracking(\n workStore.route,\n expression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n const err = new DynamicServerError(\n `Route ${workStore.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n workStore.dynamicUsageDescription = expression\n workStore.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n trackDynamicDataInDynamicRender(workUnitStore)\n break\n case 'generate-static-params':\n throw new Error(\n `Route ${workStore.route} used \\`${expression}\\` inside \\`generateStaticParams\\`. This is not supported because \\`generateStaticParams\\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`\n )\n default:\n workUnitStore satisfies never\n }\n }\n }\n}\n","module.exports.cookies = require('./dist/server/request/cookies').cookies\nmodule.exports.headers = require('./dist/server/request/headers').headers\nmodule.exports.draftMode = require('./dist/server/request/draft-mode').draftMode\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/settings/notify/route\",\n pathname: \"/api/settings/notify\",\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/settings/notify/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/settings/notify/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, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { NextResponse } from 'next/server';\nimport { getNotifyStatus, installNotifyHooks, uninstallNotifyHooks } from '@/lib/notify-installer';\nimport { getServerLocale } from '@/lib/i18n/server';\n\nexport const runtime = 'nodejs';\nexport const dynamic = 'force-dynamic';\n\nfunction errorResponse(error: unknown, status = 400) {\n return NextResponse.json(\n { error: error instanceof Error ? error.message : 'Notify settings operation failed' },\n { status },\n );\n}\n\nexport async function GET() {\n try {\n return NextResponse.json({ status: getNotifyStatus() });\n } catch (error) {\n return errorResponse(error, 500);\n }\n}\n\nexport async function POST(request: Request) {\n try {\n const body = (await request.json().catch(() => ({}))) as {\n action?: string;\n stop?: boolean;\n notification?: boolean;\n codex?: boolean;\n };\n\n if (body.action === 'install') {\n const locale = await getServerLocale();\n const result = installNotifyHooks({\n stop: body.stop ?? true,\n notification: body.notification ?? false,\n codex: body.codex ?? true,\n locale,\n });\n return NextResponse.json({ result, status: getNotifyStatus() });\n }\n\n if (body.action === 'uninstall') {\n const result = uninstallNotifyHooks();\n return NextResponse.json({ result, status: getNotifyStatus() });\n }\n\n return errorResponse(new Error('Unsupported action'));\n } catch (error) {\n return errorResponse(error);\n }\n}\n","// Server-side helpers for managing the macOS voice-notification hooks that\n// Vibemeter installs into Claude Code and Codex. The CLI in bin/vibemeter.mjs\n// implements the same operations for terminal use; this module is the path\n// that the /settings UI calls through the API.\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync, statSync } from 'node:fs';\nimport { spawnSync } from 'node:child_process';\nimport { homedir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\n\nconst HOOK_MARKER = 'vibemeter-notify.sh';\nconst NOTIFY_SCRIPT = resolve(process.cwd(), 'bin', 'vibemeter-notify.sh');\nconst FLOAT_SWIFT = resolve(process.cwd(), 'bin', 'vibemeter-float.swift');\nconst CLAUDE_SETTINGS_PATH = join(homedir(), '.claude', 'settings.json');\nconst CODEX_CONFIG_PATH = join(homedir(), '.codex', 'config.toml');\nconst DATA_DIR = process.env.VIBEMETER_DATA_DIR ?? join(homedir(), '.vibemeter');\nconst APP_BUNDLE = join(DATA_DIR, 'Vibemeter.app');\nconst APP_BINARY = join(APP_BUNDLE, 'Contents', 'MacOS', 'Vibemeter');\nconst APP_INFO_PLIST = join(APP_BUNDLE, 'Contents', 'Info.plist');\n\nconst INFO_PLIST = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>CFBundleName</key><string>Vibemeter</string>\n <key>CFBundleDisplayName</key><string>Vibemeter</string>\n <key>CFBundleIdentifier</key><string>com.hirra.vibemeter</string>\n <key>CFBundleExecutable</key><string>Vibemeter</string>\n <key>CFBundlePackageType</key><string>APPL</string>\n <key>CFBundleVersion</key><string>1</string>\n <key>CFBundleShortVersionString</key><string>1.0</string>\n <key>LSMinimumSystemVersion</key><string>11.0</string>\n <key>LSUIElement</key><true/>\n <key>NSHighResolutionCapable</key><true/>\n</dict>\n</plist>\n`;\n\nfunction ensureAppBundle(): { built: boolean; path: string | null; error?: string } {\n if (!existsSync(FLOAT_SWIFT)) return { built: false, path: null, error: 'float swift source missing' };\n const stale = !existsSync(APP_BINARY) || statSync(APP_BINARY).mtimeMs < statSync(FLOAT_SWIFT).mtimeMs;\n if (!stale && existsSync(APP_INFO_PLIST)) return { built: false, path: APP_BINARY };\n mkdirSync(dirname(APP_BINARY), { recursive: true });\n writeFileSync(APP_INFO_PLIST, INFO_PLIST);\n const r = spawnSync('/usr/bin/swiftc', [FLOAT_SWIFT, '-o', APP_BINARY], { stdio: 'pipe' });\n if (r.status !== 0) return { built: false, path: null, error: r.stderr?.toString().trim() || `swiftc exit ${r.status}` };\n return { built: true, path: APP_BINARY };\n}\n\nexport type NotifyStatus = {\n scriptPath: string;\n scriptExists: boolean;\n claudeSettingsPath: string;\n codexConfigPath: string;\n claudeStop: boolean;\n claudeNotification: boolean;\n codex: boolean;\n codexForeign: string | null;\n codexConfigExists: boolean;\n};\n\ntype ClaudeHookEntry = { hooks?: Array<{ type?: string; command?: string; async?: boolean }> };\n\nfunction readJsonSafe(path: string): Record<string, unknown> | null {\n try { return JSON.parse(readFileSync(path, 'utf8')); }\n catch { return null; }\n}\n\nfunction timestampTag() {\n const d = new Date();\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}${pad(d.getHours())}${pad(d.getMinutes())}${pad(d.getSeconds())}`;\n}\n\nfunction backupOnce(path: string, tag: string): string | null {\n if (!existsSync(path)) return null;\n const bak = `${path}.bak-vibemeter-${tag}`;\n copyFileSync(path, bak);\n return bak;\n}\n\nfunction shellQuote(s: string): string {\n if (/^[A-Za-z0-9_\\-./]+$/.test(s)) return s;\n return `'${String(s).replace(/'/g, `'\\\\''`)}'`;\n}\n\nfunction hookCommand(statusArg: string, locale: string): string {\n return `VIBEMETER_NOTIFY_LOCALE=${shellQuote(locale)} ${shellQuote(NOTIFY_SCRIPT)} Claude ${statusArg}`;\n}\n\nfunction writeJsonPretty(path: string, obj: unknown) {\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, JSON.stringify(obj, null, 2) + '\\n');\n}\n\nfunction hasOurHook(settings: Record<string, unknown> | null, event: string): boolean {\n const hooks = (settings?.hooks ?? {}) as Record<string, unknown>;\n const list = hooks[event];\n if (!Array.isArray(list)) return false;\n return (list as ClaudeHookEntry[]).some((entry) =>\n Array.isArray(entry?.hooks) && entry.hooks.some((h) => typeof h?.command === 'string' && h.command.includes(HOOK_MARKER)),\n );\n}\n\nfunction ensureHook(settings: Record<string, unknown>, event: string, statusArg: string, locale: string): boolean {\n if (!settings.hooks || typeof settings.hooks !== 'object') settings.hooks = {};\n const hooks = settings.hooks as Record<string, unknown>;\n const list = (Array.isArray(hooks[event]) ? hooks[event] : []) as ClaudeHookEntry[];\n // Replace any existing Vibemeter hook so re-applying with a new locale\n // updates the env prefix in place rather than appending a duplicate.\n const filtered = list\n .map((entry) => {\n if (!Array.isArray(entry?.hooks)) return entry;\n const kept = entry.hooks.filter((h) => !(typeof h?.command === 'string' && h.command.includes(HOOK_MARKER)));\n return kept.length ? { ...entry, hooks: kept } : null;\n })\n .filter((e): e is ClaudeHookEntry => e !== null);\n filtered.push({ hooks: [{ type: 'command', command: hookCommand(statusArg, locale), async: true }] });\n hooks[event] = filtered;\n return true;\n}\n\nfunction stripHook(settings: Record<string, unknown>, event: string): boolean {\n const hooks = (settings.hooks ?? {}) as Record<string, unknown>;\n const list = hooks[event];\n if (!Array.isArray(list)) return false;\n const before = list as ClaudeHookEntry[];\n const after = before\n .map((entry) => {\n if (!Array.isArray(entry?.hooks)) return entry;\n const kept = entry.hooks.filter((h) => !(typeof h?.command === 'string' && h.command.includes(HOOK_MARKER)));\n return kept.length ? { ...entry, hooks: kept } : null;\n })\n .filter((e): e is ClaudeHookEntry => e !== null);\n if (after.length === before.length) return false;\n if (after.length === 0) delete hooks[event];\n else hooks[event] = after;\n return true;\n}\n\nexport function getNotifyStatus(): NotifyStatus {\n const settings = readJsonSafe(CLAUDE_SETTINGS_PATH);\n let codexInstalled = false;\n let codexForeign: string | null = null;\n if (existsSync(CODEX_CONFIG_PATH)) {\n const lines = readFileSync(CODEX_CONFIG_PATH, 'utf8').split(/\\r?\\n/);\n for (const line of lines) {\n if (/^\\s*\\[/.test(line)) break;\n if (/^\\s*notify\\s*=/.test(line)) {\n if (line.includes(HOOK_MARKER)) codexInstalled = true;\n else codexForeign = line.trim();\n break;\n }\n }\n }\n return {\n scriptPath: NOTIFY_SCRIPT,\n scriptExists: existsSync(NOTIFY_SCRIPT),\n claudeSettingsPath: CLAUDE_SETTINGS_PATH,\n codexConfigPath: CODEX_CONFIG_PATH,\n claudeStop: hasOurHook(settings, 'Stop'),\n claudeNotification: hasOurHook(settings, 'Notification'),\n codex: codexInstalled,\n codexForeign,\n codexConfigExists: existsSync(CODEX_CONFIG_PATH),\n };\n}\n\nexport function installNotifyHooks(opts: { stop?: boolean; notification?: boolean; codex?: boolean; locale?: string }): {\n changed: boolean;\n claudeBackup: string | null;\n codexBackup: string | null;\n codexSkipped?: 'no-config' | 'foreign-notify';\n codexForeign?: string | null;\n appBundleBuilt?: boolean;\n appBundleError?: string;\n} {\n if (!existsSync(NOTIFY_SCRIPT)) {\n throw new Error(`vibemeter-notify.sh not found at ${NOTIFY_SCRIPT}`);\n }\n // Build the bundled .app eagerly so banners are attributed to Vibemeter\n // (with its own icon) rather than falling back to osascript on the first\n // hook firing.\n const app = ensureAppBundle();\n const locale = opts.locale === 'en' ? 'en' : 'zh';\n const settings = readJsonSafe(CLAUDE_SETTINGS_PATH) ?? {};\n let claudeChanged = false;\n if (opts.stop) claudeChanged = ensureHook(settings, 'Stop', 'complete', locale) || claudeChanged;\n if (opts.notification) claudeChanged = ensureHook(settings, 'Notification', 'needs_input', locale) || claudeChanged;\n let claudeBackup: string | null = null;\n if (claudeChanged) {\n claudeBackup = backupOnce(CLAUDE_SETTINGS_PATH, timestampTag());\n writeJsonPretty(CLAUDE_SETTINGS_PATH, settings);\n }\n\n let codexBackup: string | null = null;\n let codexSkipped: 'no-config' | 'foreign-notify' | undefined;\n let codexForeign: string | null | undefined;\n let codexChanged = false;\n if (opts.codex) {\n if (!existsSync(CODEX_CONFIG_PATH)) {\n codexSkipped = 'no-config';\n } else {\n const original = readFileSync(CODEX_CONFIG_PATH, 'utf8');\n const lines = original.split(/\\r?\\n/);\n let notifyIndex = -1;\n for (let i = 0; i < lines.length; i++) {\n if (/^\\s*\\[/.test(lines[i])) break;\n if (/^\\s*notify\\s*=/.test(lines[i])) { notifyIndex = i; break; }\n }\n const want = `notify = [\"sh\", \"-c\", ${JSON.stringify(`VIBEMETER_NOTIFY_LOCALE=${locale} ${NOTIFY_SCRIPT.replace(/'/g, `'\\\\''`)} Codex complete`)}]`;\n if (notifyIndex >= 0) {\n if (lines[notifyIndex].trim() === want) {\n codexChanged = false;\n } else if (!lines[notifyIndex].includes(HOOK_MARKER)) {\n codexSkipped = 'foreign-notify';\n codexForeign = lines[notifyIndex].trim();\n } else {\n lines[notifyIndex] = want;\n codexChanged = true;\n }\n } else {\n let insertAt = lines.findIndex((l) => /^\\s*\\[/.test(l));\n if (insertAt < 0) insertAt = lines.length;\n lines.splice(insertAt, 0, want);\n codexChanged = true;\n }\n if (codexChanged) {\n codexBackup = backupOnce(CODEX_CONFIG_PATH, timestampTag());\n writeFileSync(CODEX_CONFIG_PATH, lines.join('\\n'));\n }\n }\n }\n\n return {\n changed: claudeChanged || codexChanged,\n claudeBackup,\n codexBackup,\n codexSkipped,\n codexForeign,\n appBundleBuilt: app.built,\n appBundleError: app.error,\n };\n}\n\nexport function uninstallNotifyHooks(): {\n changed: boolean;\n claudeBackup: string | null;\n codexBackup: string | null;\n} {\n const settings = readJsonSafe(CLAUDE_SETTINGS_PATH);\n let claudeChanged = false;\n if (settings) {\n const stopRemoved = stripHook(settings, 'Stop');\n const notifRemoved = stripHook(settings, 'Notification');\n claudeChanged = stopRemoved || notifRemoved;\n if (claudeChanged && settings.hooks && typeof settings.hooks === 'object' && Object.keys(settings.hooks).length === 0) {\n delete settings.hooks;\n }\n }\n let claudeBackup: string | null = null;\n if (claudeChanged) {\n claudeBackup = backupOnce(CLAUDE_SETTINGS_PATH, timestampTag());\n writeJsonPretty(CLAUDE_SETTINGS_PATH, settings as Record<string, unknown>);\n }\n\n let codexBackup: string | null = null;\n let codexChanged = false;\n if (existsSync(CODEX_CONFIG_PATH)) {\n const lines = readFileSync(CODEX_CONFIG_PATH, 'utf8').split(/\\r?\\n/);\n for (let i = 0; i < lines.length; i++) {\n if (/^\\s*\\[/.test(lines[i])) break;\n if (/^\\s*notify\\s*=/.test(lines[i]) && lines[i].includes(HOOK_MARKER)) {\n lines.splice(i, 1);\n codexChanged = true;\n break;\n }\n }\n if (codexChanged) {\n codexBackup = backupOnce(CODEX_CONFIG_PATH, timestampTag());\n writeFileSync(CODEX_CONFIG_PATH, lines.join('\\n'));\n }\n }\n\n return { changed: claudeChanged || codexChanged, claudeBackup, codexBackup };\n}\n","// Server-only helper. Reads the locale cookie inside RSC / route handlers.\n\nimport 'server-only';\nimport { cookies } from 'next/headers';\nimport { LOCALE_COOKIE, normalizeLocale, type Locale } from './types';\n\nexport async function getServerLocale(): Promise<Locale> {\n const store = await cookies();\n return normalizeLocale(store.get(LOCALE_COOKIE)?.value);\n}\n","// Locale types + constants. Default Chinese — toggle via cookie + header switcher.\n\nexport type Locale = 'zh' | 'en';\nexport const LOCALES: readonly Locale[] = ['zh', 'en'] as const;\nexport const DEFAULT_LOCALE: Locale = 'zh';\nexport const LOCALE_COOKIE = 'vibemeter_locale';\n\nexport function isLocale(v: unknown): v is Locale {\n return v === 'zh' || v === 'en';\n}\n\nexport function normalizeLocale(v: unknown): Locale {\n return isLocale(v) ? v : DEFAULT_LOCALE;\n}\n"],"names":["ActionDidNotRevalidate","ActionDidRevalidateDynamicOnly","ActionDidRevalidateStaticAndDynamic","MutableRequestCookiesAdapter","ReadonlyRequestCookiesError","RequestCookiesAdapter","appendMutableCookies","areCookiesMutableInCurrentPhase","createCookiesWithMutableAccessCheck","getModifiedCookieValues","responseCookiesToRequestCookies","Error","constructor","callable","seal","cookies","Proxy","get","target","prop","receiver","ReflectAdapter","SYMBOL_MODIFY_COOKIE_VALUES","Symbol","for","modified","Array","isArray","length","headers","mutableCookies","modifiedCookieValues","resCookies","ResponseCookies","returnedCookies","getAll","cookie","set","wrap","onUpdateCookies","responseCookies","Headers","modifiedValues","modifiedCookies","Set","updateResponseCookies","workStore","workAsyncStorage","getStore","pathWasRevalidated","allCookies","filter","c","has","name","serializedCookies","tempCookies","push","toString","wrappedCookies","args","add","delete","requestStore","ensureCookiesAreStillMutable","phase","_callingExpression","requestCookies","RequestCookies","createDedupedByCallsiteServerErrorLoggerDev","errorRef","current","cache","React","fn","logErrorOrWarn","process","env","__NEXT_CACHE_COMPONENTS","console","error","warn","flushCurrentErrorIfNew","key","getMessage","logDedupedError","message","NODE_ENV","callStackFrames","stack","split","undefined","callingExpression","workUnitStore","workUnitAsyncStorage","isRequestAPICallableInsideAfter","route","forceStatic","underlyingCookies","createEmptyCookies","makeUntrackedCookies","dynamicShouldError","StaticGenBailoutError","type","captureStackTrace","invalidDynamicUsageError","makeHangingCookies","exportName","InvariantError","postponeWithTracking","dynamicTracking","throwToInterruptStaticGeneration","delayUntilRuntimeStage","trackDynamicDataInDynamicRender","userspaceMutableCookies","makeUntrackedCookiesWithDevWarnings","asyncApiPromises","early","isInEarlyRenderStage","earlyMutableCookies","earlyCookies","throwForMissingRequestStore","CachedCookies","WeakMap","prerenderStore","cachedPromise","promise","makeHangingPromise","renderSignal","cachedCookies","Promise","resolve","instrumentCookiesPromiseWithDevWarnings","makeDevtoolsIOAwarePromise","RenderStage","Runtime","proxiedPromise","warnForSyncAccess","createCookiesAccessError","Object","defineProperties","iterator","replaceableWarningDescriptorForSymbolIterator","size","replaceableWarningDescriptor","clear","enumerable","value","defineProperty","writable","configurable","expression","prefix","HeadersAdapter","ReadonlyHeadersError","lowercased","toLowerCase","original","keys","find","o","deleteProperty","merge","join","from","append","existing","forEach","callbackfn","thisArg","entries","call","values","underlyingHeaders","makeUntrackedHeaders","makeHangingHeaders","makeUntrackedHeadersWithDevWarnings","earlyHeaders","CachedHeaders","cachedHeaders","instrumentHeadersPromiseWithDevWarnings","createHeadersAccessError","getSetCookie","draftMode","createOrGetCachedDraftMode","draftModeProvider","getDraftModeProviderForCacheScope","cacheKey","NullDraftMode","cachedDraftMode","CachedDraftModes","isPrefetchRequest","createDraftModeWithDevWarnings","DraftMode","underlyingProvider","instance","provider","_provider","isEnabled","enable","trackDynamicDraftMode","disable","createDraftModeAccessError","constructorOpt","abortAndThrowOnSynchronousRequestDataAccess","revalidate","err","DynamicServerError","dynamicUsageDescription","dynamicUsageStack","module","exports","HOOK_MARKER","NOTIFY_SCRIPT","cwd","FLOAT_SWIFT","CLAUDE_SETTINGS_PATH","CODEX_CONFIG_PATH","DATA_DIR","VIBEMETER_DATA_DIR","APP_BUNDLE","APP_BINARY","APP_INFO_PLIST","INFO_PLIST","ensureAppBundle","built","path","stale","mtimeMs","recursive","r","stdio","status","stderr","trim","String","padStart","d","readJsonSafe","JSON","parse","timestampTag","Date","pad","n","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","backupOnce","tag","bak","shellQuote","s","test","event","h","replace","command","hookCommand","statusArg","locale","writeJsonPretty","obj","stringify","hasOurHook","settings","entry","hooks","list","some","includes","async","ensureHook","filtered","map","kept","e","after","stripHook","before","scriptPath","getNotifyStatus","codexInstalled","codexForeign","lines","line","scriptExists","claudeSettingsPath","codexConfigPath","claudeStop","claudeNotification","codex","codexConfigExists","claudeChanged","installNotifyHooks","opts","codexChanged","i","app","stop","notification","claudeBackup","insertAt","codexBackup","codexSkipped","notifyIndex","want","findIndex","l","splice","changed","appBundleBuilt","appBundleError","uninstallNotifyHooks","stopRemoved","notifRemoved"],"mappings":"qGAEaA,sBAAsB,CAAA,kBAAtBA,GAEAC,8BAA8B,CAAA,kBAA9BA,GADAC,mCAAmC,CAAA,kBAAnCA,uEADN,IAAMF,EAAyB,EACzBE,EAAsC,EACtCD,EAAiC,wFCmGjCE,4BAA4B,CAAA,kBAA5BA,GA5FAC,2BAA2B,CAAA,kBAA3BA,GAwBAC,qBAAqB,CAAA,kBAArBA,GAoCGC,oBAAoB,CAAA,kBAApBA,GAwIAC,+BAA+B,CAAA,kBAA/BA,GA3BAC,mCAAmC,CAAA,kBAAnCA,GA9HAC,uBAAuB,CAAA,kBAAvBA,GA8KAC,+BAA+B,CAAA,kBAA/BA,+EApOe,CAAA,CAAA,IAAA,KAGA,CAAA,CAAA,IAAA,OACE,CAAA,CAAA,IAAA,OAEmB,CAAA,CAAA,IAAA,EAK7C,OAAMN,UAAoCO,MAC/CC,aAAc,CACZ,KAAK,CACH,mJAEJ,CAEA,OAAcC,UAAW,CACvB,MAAM,IAAIT,CACZ,CACF,CAcO,MAAMC,EACX,OAAcS,KAAKC,CAAuB,CAA0B,CAClE,OAAO,IAAIC,MAAMD,EAAgB,CAC/BE,IAAIC,CAAM,CAAEC,CAAI,CAAEC,CAAQ,EACxB,OAAQD,GACN,IAAK,QACL,IAAK,SACL,IAAK,MACH,OAAOf,EAA4BS,QAA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AAO,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,mCA5TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAW,AAAX,EAAY,kBACf,uBACA,CACJ,EACJ","ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports=[81343,e=>{"use strict";var t=e.i(47909),n=e.i(74017),r=e.i(96250),i=e.i(59756),a=e.i(61916),s=e.i(74677),l=e.i(69741),o=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),h=e.i(66012),m=e.i(70101),f=e.i(26937),p=e.i(10372),g=e.i(93695);e.i(52474);var w=e.i(220),y=e.i(89171);let b=new Set([45009,45033]);async function $(e,t){try{let n=new AbortController,r=setTimeout(()=>n.abort(),1e4),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({msgtype:"markdown",markdown:{content:t}}),signal:n.signal});clearTimeout(r);let a=await i.json().catch(()=>({}));if(a?.errcode===0)return{success:!0,message:"推送成功",retriable:!1};return{success:!1,message:`errcode=${a?.errcode} ${a?.errmsg??""}`.trim(),retriable:"number"==typeof a?.errcode&&b.has(a.errcode)}}catch(e){return{success:!1,message:e instanceof Error?e.message:String(e),retriable:!0}}}async function _(e,t,n){if(!e)return{success:!1,message:"webhook 为空",channel:"wxwork"};let r=function(e,t){let n=`## ${e}
|
|
2
|
+
`;if(n.length+t.length<=3800)return[n+t];let r=t.split(/\n\n+/),i=[],a="";for(let e of r){let t=a?`${a}
|
|
3
|
+
|
|
4
|
+
${e}`:e;if(n.length+t.length<=3800){a=t;continue}if(a&&i.push(a),n.length+e.length>3800){let t=e.split("\n"),r="";for(let e of t){let t=r?`${r}
|
|
5
|
+
${e}`:e;n.length+t.length<=3800?r=t:(r&&i.push(r),r=e.length>3800-n.length?e.slice(0,3800-n.length):e)}a=r}else a=e}return a&&i.push(a),i.map((t,n)=>{let r=i.length>1?` (${n+1}/${i.length})`:"";return`## ${e}${r}
|
|
6
|
+
${t}`})}(t,n);if(1===r.length){let t=await $(e,r[0]);if(t.success||!t.retriable)return{success:t.success,message:t.message,channel:"wxwork",attempts:1};await new Promise(e=>setTimeout(e,5e3));let n=await $(e,r[0]);return{success:n.success,message:n.success?n.message:`${t.message} → 重试: ${n.message}`,channel:"wxwork",attempts:2}}let i=[];for(let t=0;t<r.length;t++){let n=await $(e,r[t]);n.success||i.push(`#${t+1}/${r.length}: ${n.message}`),t<r.length-1&&await new Promise(e=>setTimeout(e,600))}return 0===i.length?{success:!0,message:`推送成功(分 ${r.length} 片)`,channel:"wxwork",attempts:r.length}:{success:!1,message:i.join(" | "),channel:"wxwork",attempts:r.length}}async function x(e,t,n,r){if(!e)return{success:!1,message:"webhook 为空",channel:"generic"};try{let i=new AbortController,a=setTimeout(()=>i.abort(),1e4),s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...r??{}},body:JSON.stringify({source:"vibemeter",title:t,body:n,timestamp:new Date().toISOString()}),signal:i.signal});if(clearTimeout(a),s.ok)return{success:!0,message:`HTTP ${s.status}`,channel:"generic",attempts:1};let l=await s.text().catch(()=>"");return{success:!1,message:`HTTP ${s.status} ${l.slice(0,200)}`.trim(),channel:"generic",attempts:1}}catch(e){return{success:!1,message:e instanceof Error?e.message:String(e),channel:"generic",attempts:1}}}async function k(e,t,n){return"wxwork"===e.type?_(e.webhook,t,n):x(e.webhook,t,n,e.headers)}function S(e,t=0){return null==e||Number.isNaN(e)?"—":`${e.toFixed(t)}%`}function C(e,t){if(!e)return"—";let n=e-Date.now();if(n<=0)return"en"===t?"just now":"已重置";let r=Math.round(n/6e4);if("en"===t){if(r<60)return`in ${r} min`;let e=Math.floor(r/60),t=r%60;return 0===t?`in ${e}h`:`in ${e}h ${t}m`}if(r<60)return`${r} 分钟后`;let i=Math.floor(r/60),a=r%60;return 0===a?`${i} 小时后`:`${i} 小时 ${a} 分后`}function E(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):"—"}let R={zh:{claude_5h_remaining_pct:"Claude Code · 5h 剩余",claude_weekly_remaining_pct:"Claude Code · 本周剩余",codex_5h_remaining_pct:"Codex · 5h 剩余",codex_weekly_remaining_pct:"Codex · 本周剩余"},en:{claude_5h_remaining_pct:"Claude Code · 5h remaining",claude_weekly_remaining_pct:"Claude Code · weekly remaining",codex_5h_remaining_pct:"Codex · 5h remaining",codex_weekly_remaining_pct:"Codex · weekly remaining"}},v={zh:{claude_5h:"Claude Code · 5h 窗口",claude_weekly:"Claude Code · 本周窗口",codex_5h:"Codex · 5h 窗口",codex_weekly:"Codex · 本周窗口"},en:{claude_5h:"Claude Code · 5h window",claude_weekly:"Claude Code · weekly window",codex_5h:"Codex · 5h window",codex_weekly:"Codex · weekly window"}};function A(e,t){let n=e.quotas.map(e=>(function(e,t,n){if(!e)return null;let r=[];return(null!=e.remaining5h&&r.push("en"===n?`5h: ${S(e.remaining5h)} left (resets ${E(e.resetAt5h)})`:`5h 剩 ${S(e.remaining5h)} (重置 ${E(e.resetAt5h)})`),null!=e.remainingWeekly&&r.push("en"===n?`weekly: ${S(e.remainingWeekly)} left (resets ${E(e.resetAtWeekly)})`:`本周剩 ${S(e.remainingWeekly)} (重置 ${E(e.resetAtWeekly)})`),0===r.length)?null:`- **${t}**:${r.join(" · ")}`})(e,e.accountLabel?`${e.label} \xb7 ${e.accountLabel}`:e.label,t)).filter(e=>!!e);return n.length?n.join("\n"):"en"===t?"(no readable quota data)":"(暂无可读取的额度信息)"}function N(e,t="zh"){let n=new Date().toLocaleString("en"===t?"en-US":"zh-CN",{month:"2-digit",day:"2-digit",weekday:"short"}),r="en"===t?`Vibemeter \xb7 ${n} quota summary`:`Vibemeter \xb7 ${n} 额度摘要`,i=[A(e,t),"","en"===t?`Sessions today: ${e.todaySessions} \xb7 cumulative: ${e.totalSessions}`:`今日会话:${e.todaySessions} \xb7 累计会话:${e.totalSessions}`];return e.lastSession&&i.push("en"===t?`Latest: ${e.lastSession.tool} \xb7 ${e.lastSession.project}${e.lastSession.title?` \xb7 ${e.lastSession.title}`:""}`:`最近:${e.lastSession.tool} \xb7 ${e.lastSession.project}${e.lastSession.title?` \xb7 ${e.lastSession.title}`:""}`),{title:r,body:i.join("\n")}}var T=e.i(93818),j=e.i(80909),P=e.i(2157),I=e.i(50227),O=e.i(77930);let q={channels:[],rules:[]},D={rules:{}};function F(){return I.default.join((0,O.dataDir)(),"alerts.json")}function U(){return I.default.join((0,O.dataDir)(),"alerts-state.json")}function H(e,t){try{if(!(0,P.existsSync)(e))return t;return JSON.parse((0,P.readFileSync)(e,"utf8"))}catch{return t}}function M(e,t,n){if((0,P.mkdirSync)(I.default.dirname(e),{recursive:!0}),(0,P.writeFileSync)(e,JSON.stringify(t,null,2)+"\n"),n)try{(0,P.chmodSync)(e,384)}catch{}}function L(){let e=H(F(),q),t="en"===e.pushLocale||"zh"===e.pushLocale?e.pushLocale:"zh";return{channels:Array.isArray(e.channels)?e.channels:[],rules:Array.isArray(e.rules)?e.rules:[],pushLocale:t}}function W(){return{rules:H(U(),D).rules??{}}}function z(e,t){return e.quotas.find(e=>e.agent===t)??null}function V(e,t){return t.map(t=>e.channels.find(e=>e.id===t)).filter(e=>!!e)}async function B(e=new Date){let t=L();if(!t.rules.length)return{fired:[],evaluated:0};(0,j.importUsageSnapshots)();let n=W(),r=await (0,T.getFloatStats)(),i="en"===t.pushLocale?"en":"zh",a=[],s={};for(let l of t.rules){if(!l.enabled)continue;let o=n.rules[l.id];if("threshold"===l.kind){let e=function(e,t,n,r){let i=function(e,t){let[n,r]=t.startsWith("claude_")?["claude-code",t.slice(7)]:["codex",t.slice(6)],i=z(e,n);return i?"5h_remaining_pct"===r?i.remaining5h:"weekly_remaining_pct"===r?i.remainingWeekly:null:null}(n,e.metric);if(null==i)return null;let a=t?.kind!=="threshold"||t.armed,s=t?.kind==="threshold"?t.lastFiredAt:null;if(i>=e.below+5)return a?null:{kind:"threshold",armed:!0,lastFiredAt:s};if(i<e.below&&a){let{title:t,body:a}=function(e,t,n,r="zh"){let i=R[r][e.metric];return{title:"en"===r?`⚠️ Vibemeter \xb7 ${i} is ${S(t)}`:`⚠️ Vibemeter \xb7 ${i} 已 ${S(t)}`,body:"en"===r?[`**${i}** crossed the threshold (< ${e.below}%); currently ${S(t)}.`,"\nCurrent quota across channels:",A(n,r)].join("\n"):[`**${i}** 跌破阈值(< ${e.below}%),当前 ${S(t)}。`,"\n当前各通道额度:",A(n,r)].join("\n")}}(e,i,n,r);return{rule:e,channels:[],title:t,body:a,nextState:{kind:"threshold",armed:!1,lastFiredAt:Date.now()}}}return null}(l,o,r,i);if(!e)continue;if("rule"in e){let n=V(t,l.channelIds);n.length&&a.push({...e,channels:n}),s[l.id]=e.nextState}else s[l.id]=e}else if("daily"===l.kind){let n=function(e,t,n,r,i){let a=function(e=new Date){let t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}(i);if((t?.kind==="daily"?t.lastFiredDay:null)===a||i.getHours()<e.hour||i.getHours()===e.hour&&i.getMinutes()<e.minute)return null;let{title:s,body:l}=N(n,r);return{rule:e,channels:[],title:s,body:l,nextState:{kind:"daily",lastFiredDay:a}}}(l,o,r,i,e);if(!n)continue;let u=V(t,l.channelIds);if(!u.length)continue;a.push({...n,channels:u}),s[l.id]=n.nextState}else if("reset_reminder"===l.kind){let n=function(e,t,n,r,i){let a=z(n,e.metric.startsWith("claude_")?"claude-code":"codex");if(!a)return null;let{remaining:s,resetAt:l}=e.metric.endsWith("_weekly")?{remaining:a.remainingWeekly,resetAt:a.resetAtWeekly}:{remaining:a.remaining5h,resetAt:a.resetAt5h};if(null==l)return null;let o=(l-i)/6e4;if(o<=0||o>e.minutesBefore||null==s||s<e.remainingPctAbove||(t?.kind==="reset_reminder"?t.lastFiredForResetAt:null)===l)return null;let{title:u,body:c}=function(e,t,n,r="zh"){let i=v[r][e.metric];return{title:"en"===r?`⏰ ${i} resets ${C(n,r)} \xb7 ${S(t)} unused`:`⏰ ${i} ${C(n,r)}重置 \xb7 还剩 ${S(t)}`,body:"en"===r?`**${i}** resets ${C(n,r)}.
|
|
7
|
+
${S(t)} is still unused — burn it before it expires.
|
|
8
|
+
|
|
9
|
+
Resets at: ${E(n)}`:`**${i}** 即将重置(${C(n,r)})。
|
|
10
|
+
当前还剩 ${S(t)} 未用 —— 趁额度作废前用掉它。
|
|
11
|
+
|
|
12
|
+
重置时间:${E(n)}`}}(e,s,l,r);return{rule:e,channels:[],title:u,body:c,nextState:{kind:"reset_reminder",lastFiredForResetAt:l}}}(l,o,r,i,e.getTime());if(!n)continue;let u=V(t,l.channelIds);if(!u.length)continue;a.push({...n,channels:u}),s[l.id]=n.nextState}}let l=[];for(let e of a)for(let t of e.channels){let n=await k(t,e.title,e.body);l.push({ruleId:e.rule.id,channelId:t.id,success:n.success,message:n.message})}if(Object.keys(s).length){var o;o={rules:{...n.rules,...s}},M(U(),o,!1)}return{fired:l,evaluated:t.rules.filter(e=>e.enabled).length}}function K(e){return{channels:e.channels.map(e=>({...e,webhook:function(e){if(!e)return"";if(e.length<=12)return"••••";let t=e.slice(-6);return`${e.slice(0,8)}••••${t}`}(e.webhook)})),rules:e.rules,pushLocale:e.pushLocale??"zh"}}function G(e,t=400){return y.NextResponse.json({error:e instanceof Error?e.message:"Alert settings operation failed"},{status:t})}function J(e){if(!e||"object"!=typeof e)throw Error("Invalid channel");let t=String(e.id??"").trim(),n=e.type;if("wxwork"!==n&&"generic"!==n)throw Error("Unknown channel type");let r=String(e.label??"").trim()||"channel",i=String(e.webhook??"");if(!t)throw Error("Channel id required");return{id:t,type:n,label:r,webhook:i,headers:e.headers&&"object"==typeof e.headers&&!Array.isArray(e.headers)?Object.fromEntries(Object.entries(e.headers).map(([e,t])=>[String(e),String(t)])):void 0}}function X(e){if(!e||"object"!=typeof e)throw Error("Invalid rule");let t=String(e.id??"").trim();if(!t)throw Error("Rule id required");let n=Array.isArray(e.channelIds)?e.channelIds.map(String):[],r=!1!==e.enabled,i=null!=e.label?String(e.label):void 0;if("threshold"===e.kind){let a=String(e.metric??""),s=Number(e.below);if(!Number.isFinite(s)||s<=0||s>100)throw Error("threshold.below must be 0-100");if(!["claude_5h_remaining_pct","claude_weekly_remaining_pct","codex_5h_remaining_pct","codex_weekly_remaining_pct"].includes(a))throw Error("threshold.metric invalid");return{id:t,kind:"threshold",label:i,metric:a,below:s,channelIds:n,enabled:r}}if("daily"===e.kind){let a=Number(e.hour),s=Number(e.minute);if(!Number.isInteger(a)||a<0||a>23)throw Error("daily.hour 0-23");if(!Number.isInteger(s)||s<0||s>59)throw Error("daily.minute 0-59");return{id:t,kind:"daily",label:i,hour:a,minute:s,channelIds:n,enabled:r}}if("reset_reminder"===e.kind){let a=String(e.metric??""),s=Number(e.minutesBefore),l=Number(e.remainingPctAbove);if(!["claude_5h","claude_weekly","codex_5h","codex_weekly"].includes(a))throw Error("reset_reminder.metric invalid");if(!Number.isFinite(s)||s<=0||s>20160)throw Error("reset_reminder.minutesBefore 1-20160");if(!Number.isFinite(l)||l<0||l>100)throw Error("reset_reminder.remainingPctAbove 0-100");return{id:t,kind:"reset_reminder",label:i,metric:a,minutesBefore:s,remainingPctAbove:l,channelIds:n,enabled:r}}throw Error(`Unknown rule.kind: ${String(e.kind)}`)}async function Y(){try{let e=L();return y.NextResponse.json({config:K(e),state:W(),configPath:F(),hasAnyChannel:e.channels.length>0})}catch(e){return G(e,500)}}async function Z(e){try{var t;let n,r=await e.json().catch(()=>null);if(!r?.config)return G(Error("config required"));let i=(r.config.channels??[]).map(J),a=(r.config.rules??[]).map(X),s="en"===r.config.pushLocale?"en":"zh",l=L(),o={channels:(t=l.channels,n=new Map(t.map(e=>[e.id,e.webhook])),i.map(e=>{let t=n.get(e.id),r="__VIBEMETER_WEBHOOK_UNCHANGED__"===e.webhook&&null!=t?t:e.webhook;return{...e,webhook:r}})),rules:a,pushLocale:s};return M(F(),o,!0),y.NextResponse.json({config:K(o)})}catch(e){return G(e)}}async function Q(e){try{let t=await e.json().catch(()=>({}));if("test"===t.action){if(!t.channelId)return G(Error("channelId required"));let e=L(),n=e.channels.find(e=>e.id===t.channelId);if(!n)return G(Error("channel not found"),404);let r=function(e="zh"){return"en"===e?{title:"Vibemeter · push channel test",body:`This is a test push from Vibemeter, sent at ${new Date().toLocaleString("en-US")}.
|
|
13
|
+
|
|
14
|
+
Getting this means your webhook is wired up correctly. You can now configure thresholds, daily summaries, and reset reminders.`}:{title:"Vibemeter · 推送通道测试",body:`这是一条来自 Vibemeter 的测试推送,发送时间:${new Date().toLocaleString("zh-CN")}
|
|
15
|
+
|
|
16
|
+
收到这条消息说明 webhook 配置无误。可以放心配置阈值 / 每日 / 重置规则了。`}}(e.pushLocale),i=await k(n,r.title,r.body);return y.NextResponse.json({result:i})}if("send-now"===t.action){if(!t.channelId)return G(Error("channelId required"));let e=L(),n=e.channels.find(e=>e.id===t.channelId);if(!n)return G(Error("channel not found"),404);let r=await (0,T.getFloatStats)(),i=N(r,e.pushLocale),a=await k(n,i.title,i.body);return y.NextResponse.json({result:a})}if("run-now"===t.action){let e=await B();return y.NextResponse.json({report:e})}return G(Error("Unsupported action"))}catch(e){return G(e)}}e.s(["GET",0,Y,"POST",0,Q,"PUT",0,Z,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],54534);var ee=e.i(54534);let et=new t.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/settings/alerts/route",pathname:"/api/settings/alerts",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/settings/alerts/route.ts",nextConfigOutput:"",userland:ee,...{}}),{workAsyncStorage:en,workUnitAsyncStorage:er,serverHooks:ei}=et;async function ea(e,t,r){r.requestMeta&&(0,i.setRequestMeta)(e,r.requestMeta),et.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/settings/alerts/route";y=y.replace(/\/index$/,"")||"/";let b=await et.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!b)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:$,deploymentId:_,params:x,nextConfig:k,parsedUrl:S,isDraftMode:C,prerenderManifest:E,routerServerContext:R,isOnDemandRevalidate:v,revalidateOnlyGenerated:A,resolvedPathname:N,clientReferenceManifest:T,serverActionsManifest:j}=b,P=(0,l.normalizeAppPath)(y),I=!!(E.dynamicRoutes[P]||E.routes[N]),O=async()=>((null==R?void 0:R.render404)?await R.render404(e,t,S,!1):t.end("This page could not be found"),null);if(I&&!C){let e=!!E.routes[N],t=E.dynamicRoutes[P];if(t&&!1===t.fallback&&!e){if(k.adapterPath)return await O();throw new g.NoFallbackError}}let q=null;!I||et.isDev||C||(q="/index"===(q=N)?"/":q);let D=!0===et.isDev||!I,F=I&&!D;j&&T&&(0,s.setManifestsSingleton)({page:y,clientReferenceManifest:T,serverActionsManifest:j});let U=e.method||"GET",H=(0,a.getTracer)(),M=H.getActiveScopeSpan(),L=!!(null==R?void 0:R.isWrappedByNextServer),W=!!(0,i.getRequestMeta)(e,"minimalMode"),z=(0,i.getRequestMeta)(e,"incrementalCache")||await et.getIncrementalCache(e,k,E,W);null==z||z.resetRequestCache(),globalThis.__incrementalCache=z;let V={params:x,previewProps:E.preview,renderOpts:{experimental:{authInterrupts:!!k.experimental.authInterrupts},cacheComponents:!!k.cacheComponents,supportsDynamicResponse:D,incrementalCache:z,cacheLifeProfiles:k.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,r,i)=>et.onRequestError(e,t,r,i,R)},sharedContext:{buildId:$,deploymentId:_}},B=new o.NodeNextRequest(e),K=new o.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(B,(0,u.signalFromNodeResponse)(t));try{let i,s=async e=>et.handle(G,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let n=H.getRootSpanAttributes();if(!n)return;if(n.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${n.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=n.get("next.route");if(r){let t=`${U} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",r),i.updateName(t))}else e.updateName(`${U} ${y}`)}),l=async i=>{var a,l;let o=async({previousCacheEntry:n})=>{try{if(!W&&v&&A&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=V.renderOpts.fetchMetrics;let l=V.renderOpts.pendingWaitUntil;l&&r.waitUntil&&(r.waitUntil(l),l=void 0);let o=V.renderOpts.collectedTags;if(!I)return await (0,h.sendResponse)(B,K,a,V.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(a.headers);o&&(t[p.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=p.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,r=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=p.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:r}}}}catch(t){throw(null==n?void 0:n.isStale)&&await et.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:v})},!1,R),t}},u=await et.handleResponse({req:e,nextConfig:k,cacheKey:q,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:E,isRoutePPREnabled:!1,isOnDemandRevalidate:v,revalidateOnlyGenerated:A,responseGenerator:o,waitUntil:r.waitUntil,isMinimalMode:W});if(!I)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});W||t.setHeader("x-nextjs-cache",v?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,m.fromNodeOutgoingHttpHeaders)(u.value.headers);return W&&I||c.delete(p.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,h.sendResponse)(B,K,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};L&&M?await l(M):(i=H.getActiveScopeSpan(),await H.withPropagatedContext(e.headers,()=>H.trace(c.BaseServerSpan.handleRequest,{spanName:`${U} ${y}`,kind:a.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},l),void 0,!L))}catch(t){if(t instanceof g.NoFallbackError||await et.onRequestError(e,t,{routerKind:"App Router",routePath:P,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:v})},!1,R),I)throw t;return await (0,h.sendResponse)(B,K,new Response(null,{status:500})),null}}e.s(["handler",0,ea,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:en,workUnitAsyncStorage:er})},"routeModule",0,et,"serverHooks",0,ei,"workAsyncStorage",0,en,"workUnitAsyncStorage",0,er],81343)}];
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_03jj5jj.js.map
|
package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_03jj5jj.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/app/api/settings/alerts/route.ts","../../../src/lib/alerts/push/wxwork.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/lib/alerts/storage.ts","../../../src/lib/alerts/dispatch.ts","../../../src/lib/alerts/format.ts","../../../src/lib/alerts/runner.ts","../../../src/lib/alerts/push/generic.ts","../../../src/lib/alerts/types.ts"],"sourcesContent":["// Alert settings API. Webhook secrets are masked on GET and never echoed\n// to logs. PUT accepts the sentinel `WEBHOOK_UNCHANGED_SENTINEL` to preserve\n// an existing webhook without the UI having to round-trip the plaintext.\n\nimport { NextResponse } from 'next/server';\nimport { dispatch } from '@/lib/alerts/dispatch';\nimport { formatDailySummary, formatTestMessage } from '@/lib/alerts/format';\nimport { getFloatStats } from '@/lib/float-stats';\nimport { runAlertsOnce } from '@/lib/alerts/runner';\nimport {\n alertsConfigPath,\n maskWebhook,\n readAlertConfig,\n readAlertState,\n WEBHOOK_UNCHANGED_SENTINEL,\n writeAlertConfig,\n} from '@/lib/alerts/storage';\nimport type { AlertChannel, AlertConfig, AlertRule, PushLocale } from '@/lib/alerts/types';\n\nexport const runtime = 'nodejs';\nexport const dynamic = 'force-dynamic';\n\nfunction maskConfig(config: AlertConfig): AlertConfig {\n return {\n channels: config.channels.map((c) => ({ ...c, webhook: maskWebhook(c.webhook) })),\n rules: config.rules,\n pushLocale: config.pushLocale ?? 'zh',\n };\n}\n\nfunction errorResponse(error: unknown, status = 400) {\n return NextResponse.json(\n { error: error instanceof Error ? error.message : 'Alert settings operation failed' },\n { status },\n );\n}\n\nfunction validateChannel(c: unknown): AlertChannel {\n if (!c || typeof c !== 'object') throw new Error('Invalid channel');\n const obj = c as Record<string, unknown>;\n const id = String(obj.id ?? '').trim();\n const type = obj.type;\n if (type !== 'wxwork' && type !== 'generic') throw new Error('Unknown channel type');\n const label = String(obj.label ?? '').trim() || 'channel';\n const webhook = String(obj.webhook ?? '');\n if (!id) throw new Error('Channel id required');\n const headers = obj.headers && typeof obj.headers === 'object' && !Array.isArray(obj.headers)\n ? Object.fromEntries(Object.entries(obj.headers as Record<string, unknown>).map(([k, v]) => [String(k), String(v)]))\n : undefined;\n return { id, type, label, webhook, headers };\n}\n\nfunction validateRule(r: unknown): AlertRule {\n if (!r || typeof r !== 'object') throw new Error('Invalid rule');\n const obj = r as Record<string, unknown>;\n const id = String(obj.id ?? '').trim();\n if (!id) throw new Error('Rule id required');\n const channelIds = Array.isArray(obj.channelIds) ? obj.channelIds.map(String) : [];\n const enabled = obj.enabled !== false;\n const label = obj.label != null ? String(obj.label) : undefined;\n if (obj.kind === 'threshold') {\n const metric = String(obj.metric ?? '');\n const below = Number(obj.below);\n if (!Number.isFinite(below) || below <= 0 || below > 100) throw new Error('threshold.below must be 0-100');\n const allowed = ['claude_5h_remaining_pct', 'claude_weekly_remaining_pct', 'codex_5h_remaining_pct', 'codex_weekly_remaining_pct'] as const;\n if (!allowed.includes(metric as (typeof allowed)[number])) {\n throw new Error('threshold.metric invalid');\n }\n return { id, kind: 'threshold', label, metric: metric as (typeof allowed)[number], below, channelIds, enabled };\n }\n if (obj.kind === 'daily') {\n const hour = Number(obj.hour);\n const minute = Number(obj.minute);\n if (!Number.isInteger(hour) || hour < 0 || hour > 23) throw new Error('daily.hour 0-23');\n if (!Number.isInteger(minute) || minute < 0 || minute > 59) throw new Error('daily.minute 0-59');\n return { id, kind: 'daily', label, hour, minute, channelIds, enabled };\n }\n if (obj.kind === 'reset_reminder') {\n const metric = String(obj.metric ?? '');\n const minutesBefore = Number(obj.minutesBefore);\n const remainingPctAbove = Number(obj.remainingPctAbove);\n const allowedReset = ['claude_5h', 'claude_weekly', 'codex_5h', 'codex_weekly'] as const;\n if (!allowedReset.includes(metric as (typeof allowedReset)[number])) throw new Error('reset_reminder.metric invalid');\n if (!Number.isFinite(minutesBefore) || minutesBefore <= 0 || minutesBefore > 14 * 24 * 60) throw new Error('reset_reminder.minutesBefore 1-20160');\n if (!Number.isFinite(remainingPctAbove) || remainingPctAbove < 0 || remainingPctAbove > 100) throw new Error('reset_reminder.remainingPctAbove 0-100');\n return { id, kind: 'reset_reminder', label, metric: metric as (typeof allowedReset)[number], minutesBefore, remainingPctAbove, channelIds, enabled };\n }\n throw new Error(`Unknown rule.kind: ${String(obj.kind)}`);\n}\n\nfunction mergeWebhooks(incoming: AlertChannel[], existing: AlertChannel[]): AlertChannel[] {\n const byId = new Map(existing.map((c) => [c.id, c.webhook] as const));\n return incoming.map((c) => {\n const prev = byId.get(c.id);\n const webhook = c.webhook === WEBHOOK_UNCHANGED_SENTINEL && prev != null ? prev : c.webhook;\n return { ...c, webhook };\n });\n}\n\nexport async function GET() {\n try {\n const config = readAlertConfig();\n return NextResponse.json({\n config: maskConfig(config),\n state: readAlertState(),\n configPath: alertsConfigPath(),\n hasAnyChannel: config.channels.length > 0,\n });\n } catch (error) {\n return errorResponse(error, 500);\n }\n}\n\nexport async function PUT(request: Request) {\n try {\n const body = (await request.json().catch(() => null)) as { config?: AlertConfig } | null;\n if (!body?.config) return errorResponse(new Error('config required'));\n\n const channels = (body.config.channels ?? []).map(validateChannel);\n const rules = (body.config.rules ?? []).map(validateRule);\n const pushLocale: PushLocale = body.config.pushLocale === 'en' ? 'en' : 'zh';\n\n const existing = readAlertConfig();\n const merged: AlertConfig = {\n channels: mergeWebhooks(channels, existing.channels),\n rules,\n pushLocale,\n };\n writeAlertConfig(merged);\n return NextResponse.json({ config: maskConfig(merged) });\n } catch (error) {\n return errorResponse(error);\n }\n}\n\nexport async function POST(request: Request) {\n try {\n const body = (await request.json().catch(() => ({}))) as { action?: string; channelId?: string };\n\n if (body.action === 'test') {\n if (!body.channelId) return errorResponse(new Error('channelId required'));\n const config = readAlertConfig();\n const channel = config.channels.find((c) => c.id === body.channelId);\n if (!channel) return errorResponse(new Error('channel not found'), 404);\n const msg = formatTestMessage(config.pushLocale);\n const result = await dispatch(channel, msg.title, msg.body);\n return NextResponse.json({ result });\n }\n\n if (body.action === 'send-now') {\n if (!body.channelId) return errorResponse(new Error('channelId required'));\n const config = readAlertConfig();\n const channel = config.channels.find((c) => c.id === body.channelId);\n if (!channel) return errorResponse(new Error('channel not found'), 404);\n const stats = await getFloatStats();\n const msg = formatDailySummary(stats, config.pushLocale);\n const result = await dispatch(channel, msg.title, msg.body);\n return NextResponse.json({ result });\n }\n\n if (body.action === 'run-now') {\n const report = await runAlertsOnce();\n return NextResponse.json({ report });\n }\n\n return errorResponse(new Error('Unsupported action'));\n } catch (error) {\n return errorResponse(error);\n }\n}\n","// WeChat Work group bot webhook — based on the stocks repo's wxwork pusher.\n// Chunks long markdown (4096 char limit, we leave a budget for headings),\n// retries on transient errcodes (45009/45033 = rate limit / concurrency).\n\nconst RETRY_DELAY_MS = 5000;\nconst RETRIABLE_ERRCODES = new Set([45009, 45033]);\nconst MAX_CHUNK = 3800;\n\nexport interface PushResult {\n success: boolean;\n message: string;\n channel: string;\n attempts?: number;\n}\n\ninterface AttemptOutcome {\n success: boolean;\n message: string;\n retriable: boolean;\n}\n\nasync function attemptPush(webhook: string, content: string): Promise<AttemptOutcome> {\n try {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), 10_000);\n const res = await fetch(webhook, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ msgtype: 'markdown', markdown: { content } }),\n signal: controller.signal,\n });\n clearTimeout(timer);\n const data = (await res.json().catch(() => ({}))) as { errcode?: number; errmsg?: string };\n if (data?.errcode === 0) return { success: true, message: '推送成功', retriable: false };\n return {\n success: false,\n message: `errcode=${data?.errcode} ${data?.errmsg ?? ''}`.trim(),\n retriable: typeof data?.errcode === 'number' && RETRIABLE_ERRCODES.has(data.errcode),\n };\n } catch (error: unknown) {\n return {\n success: false,\n message: error instanceof Error ? error.message : String(error),\n retriable: true,\n };\n }\n}\n\nfunction chunkBody(title: string, body: string): string[] {\n const head = `## ${title}\\n`;\n if (head.length + body.length <= MAX_CHUNK) return [head + body];\n\n const paragraphs = body.split(/\\n\\n+/);\n const chunks: string[] = [];\n let current = '';\n for (const para of paragraphs) {\n const candidate = current ? `${current}\\n\\n${para}` : para;\n if (head.length + candidate.length <= MAX_CHUNK) {\n current = candidate;\n continue;\n }\n if (current) chunks.push(current);\n if (head.length + para.length > MAX_CHUNK) {\n const lines = para.split('\\n');\n let buf = '';\n for (const line of lines) {\n const c = buf ? `${buf}\\n${line}` : line;\n if (head.length + c.length <= MAX_CHUNK) {\n buf = c;\n } else {\n if (buf) chunks.push(buf);\n buf = line.length > MAX_CHUNK - head.length ? line.slice(0, MAX_CHUNK - head.length) : line;\n }\n }\n current = buf;\n } else {\n current = para;\n }\n }\n if (current) chunks.push(current);\n return chunks.map((c, i) => {\n const tag = chunks.length > 1 ? ` (${i + 1}/${chunks.length})` : '';\n return `## ${title}${tag}\\n${c}`;\n });\n}\n\nexport async function pushWxwork(webhook: string, title: string, body: string): Promise<PushResult> {\n if (!webhook) return { success: false, message: 'webhook 为空', channel: 'wxwork' };\n const chunks = chunkBody(title, body);\n\n if (chunks.length === 1) {\n const first = await attemptPush(webhook, chunks[0]);\n if (first.success || !first.retriable) {\n return { success: first.success, message: first.message, channel: 'wxwork', attempts: 1 };\n }\n await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));\n const second = await attemptPush(webhook, chunks[0]);\n return {\n success: second.success,\n message: second.success ? second.message : `${first.message} → 重试: ${second.message}`,\n channel: 'wxwork',\n attempts: 2,\n };\n }\n\n const failures: string[] = [];\n for (let i = 0; i < chunks.length; i++) {\n const r = await attemptPush(webhook, chunks[i]);\n if (!r.success) failures.push(`#${i + 1}/${chunks.length}: ${r.message}`);\n if (i < chunks.length - 1) await new Promise((res) => setTimeout(res, 600));\n }\n if (failures.length === 0) {\n return { success: true, message: `推送成功(分 ${chunks.length} 片)`, channel: 'wxwork', attempts: chunks.length };\n }\n return { success: false, message: failures.join(' | '), channel: 'wxwork', attempts: chunks.length };\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/settings/alerts/route\",\n pathname: \"/api/settings/alerts\",\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/settings/alerts/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/settings/alerts/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, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","// On-disk persistence for the alerts feature. Lives in <dataDir>/alerts.json\n// (user-local, NEVER in the repo or shipped npm bundle). 0600 perms because\n// the file contains webhook URLs that are effectively secrets.\n\nimport { existsSync, readFileSync, writeFileSync, chmodSync, mkdirSync } from 'node:fs';\nimport path from 'node:path';\nimport { dataDir } from '@/lib/data-dir';\nimport { EMPTY_CONFIG, EMPTY_STATE, type AlertConfig, type AlertState } from './types';\n\nconst CONFIG_FILE = 'alerts.json';\nconst STATE_FILE = 'alerts-state.json';\n\nexport function alertsConfigPath(): string {\n return path.join(dataDir(), CONFIG_FILE);\n}\n\nexport function alertsStatePath(): string {\n return path.join(dataDir(), STATE_FILE);\n}\n\nfunction readJson<T>(file: string, fallback: T): T {\n try {\n if (!existsSync(file)) return fallback;\n return JSON.parse(readFileSync(file, 'utf8')) as T;\n } catch {\n return fallback;\n }\n}\n\nfunction writeJson(file: string, data: unknown, secret: boolean) {\n mkdirSync(path.dirname(file), { recursive: true });\n writeFileSync(file, JSON.stringify(data, null, 2) + '\\n');\n if (secret) {\n try { chmodSync(file, 0o600); } catch { /* best-effort */ }\n }\n}\n\nexport function readAlertConfig(): AlertConfig {\n const raw = readJson<Partial<AlertConfig>>(alertsConfigPath(), EMPTY_CONFIG);\n const pushLocale = raw.pushLocale === 'en' || raw.pushLocale === 'zh' ? raw.pushLocale : 'zh';\n return {\n channels: Array.isArray(raw.channels) ? raw.channels : [],\n rules: Array.isArray(raw.rules) ? raw.rules : [],\n pushLocale,\n };\n}\n\nexport function writeAlertConfig(config: AlertConfig): void {\n writeJson(alertsConfigPath(), config, true);\n}\n\nexport function readAlertState(): AlertState {\n const raw = readJson<Partial<AlertState>>(alertsStatePath(), EMPTY_STATE);\n return { rules: raw.rules ?? {} };\n}\n\nexport function writeAlertState(state: AlertState): void {\n // State file doesn't contain secrets but mirror perms anyway.\n writeJson(alertsStatePath(), state, false);\n}\n\n// Masks the webhook so the value is safe to return from APIs and render in\n// the Settings UI without leaking the secret. We keep just enough trailing\n// chars to recognise which channel a row belongs to.\nexport function maskWebhook(webhook: string): string {\n if (!webhook) return '';\n if (webhook.length <= 12) return '••••';\n const tail = webhook.slice(-6);\n return `${webhook.slice(0, 8)}••••${tail}`;\n}\n\n// Sentinel passed from the UI on PUT when the user did not edit an existing\n// webhook field. The API merges these back against the stored value so a\n// round-trip GET→PUT never leaks the masked form into storage.\nexport const WEBHOOK_UNCHANGED_SENTINEL = '__VIBEMETER_WEBHOOK_UNCHANGED__';\n","// Channel dispatch — picks the right pusher and returns a uniform result.\n\nimport type { AlertChannel } from './types';\nimport { pushWxwork, type PushResult } from './push/wxwork';\nimport { pushGeneric } from './push/generic';\n\nexport async function dispatch(channel: AlertChannel, title: string, body: string): Promise<PushResult> {\n if (channel.type === 'wxwork') {\n return pushWxwork(channel.webhook, title, body);\n }\n return pushGeneric(channel.webhook, title, body, channel.headers);\n}\n","// Markdown formatters for alert messages. Both Chinese and English variants\n// live here side by side — the user's `pushLocale` setting picks which one\n// to render. Independent of UI locale because push targets (group chats)\n// may have a different language audience than the dashboard viewer.\n\nimport type { FloatQuota, FloatStats } from '@/lib/float-stats';\nimport type { AlertMetric, AlertRule, PushLocale, ResetMetric } from './types';\n\nfunction pct(value: number | null | undefined, digits = 0): string {\n if (value == null || Number.isNaN(value)) return '—';\n return `${value.toFixed(digits)}%`;\n}\n\nfunction shortTimeUntil(target: number | null | undefined, locale: PushLocale): string {\n if (!target) return '—';\n const diff = target - Date.now();\n if (diff <= 0) return locale === 'en' ? 'just now' : '已重置';\n const mins = Math.round(diff / 60_000);\n if (locale === 'en') {\n if (mins < 60) return `in ${mins} min`;\n const h = Math.floor(mins / 60);\n const r = mins % 60;\n return r === 0 ? `in ${h}h` : `in ${h}h ${r}m`;\n }\n if (mins < 60) return `${mins} 分钟后`;\n const h = Math.floor(mins / 60);\n const r = mins % 60;\n return r === 0 ? `${h} 小时后` : `${h} 小时 ${r} 分后`;\n}\n\nfunction clockTime(ts: number | null | undefined): string {\n if (!ts) return '—';\n return new Date(ts).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' });\n}\n\nconst METRIC_LABELS: Record<PushLocale, Record<AlertMetric, string>> = {\n zh: {\n claude_5h_remaining_pct: 'Claude Code · 5h 剩余',\n claude_weekly_remaining_pct: 'Claude Code · 本周剩余',\n codex_5h_remaining_pct: 'Codex · 5h 剩余',\n codex_weekly_remaining_pct: 'Codex · 本周剩余',\n },\n en: {\n claude_5h_remaining_pct: 'Claude Code · 5h remaining',\n claude_weekly_remaining_pct: 'Claude Code · weekly remaining',\n codex_5h_remaining_pct: 'Codex · 5h remaining',\n codex_weekly_remaining_pct: 'Codex · weekly remaining',\n },\n};\n\nconst RESET_LABELS: Record<PushLocale, Record<ResetMetric, string>> = {\n zh: {\n claude_5h: 'Claude Code · 5h 窗口',\n claude_weekly: 'Claude Code · 本周窗口',\n codex_5h: 'Codex · 5h 窗口',\n codex_weekly: 'Codex · 本周窗口',\n },\n en: {\n claude_5h: 'Claude Code · 5h window',\n claude_weekly: 'Claude Code · weekly window',\n codex_5h: 'Codex · 5h window',\n codex_weekly: 'Codex · weekly window',\n },\n};\n\nfunction quotaLine(q: FloatQuota | null, label: string, locale: PushLocale): string | null {\n if (!q) return null;\n const segments: string[] = [];\n if (q.remaining5h != null) {\n segments.push(locale === 'en'\n ? `5h: ${pct(q.remaining5h)} left (resets ${clockTime(q.resetAt5h)})`\n : `5h 剩 ${pct(q.remaining5h)} (重置 ${clockTime(q.resetAt5h)})`);\n }\n if (q.remainingWeekly != null) {\n segments.push(locale === 'en'\n ? `weekly: ${pct(q.remainingWeekly)} left (resets ${clockTime(q.resetAtWeekly)})`\n : `本周剩 ${pct(q.remainingWeekly)} (重置 ${clockTime(q.resetAtWeekly)})`);\n }\n if (segments.length === 0) return null;\n return `- **${label}**:${segments.join(' · ')}`;\n}\n\nfunction quotasMarkdown(stats: FloatStats, locale: PushLocale): string {\n const lines = stats.quotas\n .map((q) => quotaLine(q, q.accountLabel ? `${q.label} · ${q.accountLabel}` : q.label, locale))\n .filter((l): l is string => !!l);\n return lines.length\n ? lines.join('\\n')\n : locale === 'en'\n ? '(no readable quota data)'\n : '(暂无可读取的额度信息)';\n}\n\nexport function formatDailySummary(stats: FloatStats, locale: PushLocale = 'zh'): { title: string; body: string } {\n const dateLabel = new Date().toLocaleString(locale === 'en' ? 'en-US' : 'zh-CN', { month: '2-digit', day: '2-digit', weekday: 'short' });\n const title = locale === 'en' ? `Vibemeter · ${dateLabel} quota summary` : `Vibemeter · ${dateLabel} 额度摘要`;\n const lines = [\n quotasMarkdown(stats, locale),\n '',\n locale === 'en'\n ? `Sessions today: ${stats.todaySessions} · cumulative: ${stats.totalSessions}`\n : `今日会话:${stats.todaySessions} · 累计会话:${stats.totalSessions}`,\n ];\n if (stats.lastSession) {\n lines.push(\n locale === 'en'\n ? `Latest: ${stats.lastSession.tool} · ${stats.lastSession.project}${stats.lastSession.title ? ` · ${stats.lastSession.title}` : ''}`\n : `最近:${stats.lastSession.tool} · ${stats.lastSession.project}${stats.lastSession.title ? ` · ${stats.lastSession.title}` : ''}`,\n );\n }\n return { title, body: lines.join('\\n') };\n}\n\nexport function formatThresholdAlert(\n rule: Extract<AlertRule, { kind: 'threshold' }>,\n currentValue: number,\n stats: FloatStats,\n locale: PushLocale = 'zh',\n): { title: string; body: string } {\n const metricLabel = METRIC_LABELS[locale][rule.metric];\n const title = locale === 'en'\n ? `⚠️ Vibemeter · ${metricLabel} is ${pct(currentValue)}`\n : `⚠️ Vibemeter · ${metricLabel} 已 ${pct(currentValue)}`;\n const body = locale === 'en'\n ? [\n `**${metricLabel}** crossed the threshold (< ${rule.below}%); currently ${pct(currentValue)}.`,\n '',\n 'Current quota across channels:',\n quotasMarkdown(stats, locale),\n ].join('\\n')\n : [\n `**${metricLabel}** 跌破阈值(< ${rule.below}%),当前 ${pct(currentValue)}。`,\n '',\n '当前各通道额度:',\n quotasMarkdown(stats, locale),\n ].join('\\n');\n return { title, body };\n}\n\nexport function formatResetReminder(\n rule: Extract<AlertRule, { kind: 'reset_reminder' }>,\n quota: FloatQuota,\n remaining: number | null,\n resetAt: number | null,\n locale: PushLocale = 'zh',\n): { title: string; body: string } {\n void quota;\n const label = RESET_LABELS[locale][rule.metric];\n const title = locale === 'en'\n ? `⏰ ${label} resets ${shortTimeUntil(resetAt, locale)} · ${pct(remaining)} unused`\n : `⏰ ${label} ${shortTimeUntil(resetAt, locale)}重置 · 还剩 ${pct(remaining)}`;\n const body = locale === 'en'\n ? [\n `**${label}** resets ${shortTimeUntil(resetAt, locale)}.`,\n `${pct(remaining)} is still unused — burn it before it expires.`,\n '',\n `Resets at: ${clockTime(resetAt)}`,\n ].join('\\n')\n : [\n `**${label}** 即将重置(${shortTimeUntil(resetAt, locale)})。`,\n `当前还剩 ${pct(remaining)} 未用 —— 趁额度作废前用掉它。`,\n '',\n `重置时间:${clockTime(resetAt)}`,\n ].join('\\n');\n return { title, body };\n}\n\nexport function formatTestMessage(locale: PushLocale = 'zh'): { title: string; body: string } {\n return locale === 'en'\n ? {\n title: 'Vibemeter · push channel test',\n body: [\n `This is a test push from Vibemeter, sent at ${new Date().toLocaleString('en-US')}.`,\n '',\n 'Getting this means your webhook is wired up correctly. You can now configure thresholds, daily summaries, and reset reminders.',\n ].join('\\n'),\n }\n : {\n title: 'Vibemeter · 推送通道测试',\n body: [\n `这是一条来自 Vibemeter 的测试推送,发送时间:${new Date().toLocaleString('zh-CN')}`,\n '',\n '收到这条消息说明 webhook 配置无误。可以放心配置阈值 / 每日 / 重置规则了。',\n ].join('\\n'),\n };\n}\n","// Periodic alert evaluator. Reads current quotas + rule state, decides which\n// rules should fire, dispatches messages, and persists updated state.\n//\n// Hysteresis: a threshold rule fires once when value crosses below `below`\n// and is rearmed only once it climbs back above `below + HYSTERESIS_PCT`,\n// preventing flapping on a value oscillating around the boundary.\n\nimport { getFloatStats, type FloatQuota, type FloatStats } from '@/lib/float-stats';\nimport { importUsageSnapshots } from '@/lib/collectors/session-importer';\nimport { dispatch } from './dispatch';\nimport { formatDailySummary, formatResetReminder, formatThresholdAlert } from './format';\nimport { readAlertConfig, readAlertState, writeAlertState } from './storage';\nimport type {\n AlertChannel,\n AlertConfig,\n AlertMetric,\n AlertRule,\n AlertState,\n PushLocale,\n ResetMetric,\n RuleState,\n} from './types';\n\nconst HYSTERESIS_PCT = 5;\n\nfunction quotaFor(stats: FloatStats, agent: 'claude-code' | 'codex'): FloatQuota | null {\n return stats.quotas.find((q) => q.agent === agent) ?? null;\n}\n\nfunction metricValue(stats: FloatStats, metric: AlertMetric): number | null {\n const [agentToken, window] = (() => {\n if (metric.startsWith('claude_')) return ['claude-code' as const, metric.slice('claude_'.length)];\n return ['codex' as const, metric.slice('codex_'.length)];\n })();\n const q = quotaFor(stats, agentToken);\n if (!q) return null;\n if (window === '5h_remaining_pct') return q.remaining5h;\n if (window === 'weekly_remaining_pct') return q.remainingWeekly;\n return null;\n}\n\nfunction resetQuota(stats: FloatStats, metric: ResetMetric): FloatQuota | null {\n const agent = metric.startsWith('claude_') ? 'claude-code' : 'codex';\n return quotaFor(stats, agent);\n}\n\nfunction resetWindowFields(quota: FloatQuota, metric: ResetMetric): { remaining: number | null; resetAt: number | null } {\n if (metric.endsWith('_weekly')) return { remaining: quota.remainingWeekly, resetAt: quota.resetAtWeekly };\n return { remaining: quota.remaining5h, resetAt: quota.resetAt5h };\n}\n\nfunction todayKey(d: Date = new Date()): string {\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n}\n\nfunction channelsByIds(config: AlertConfig, ids: string[]): AlertChannel[] {\n return ids.map((id) => config.channels.find((c) => c.id === id)).filter((c): c is AlertChannel => !!c);\n}\n\ninterface PendingFire {\n rule: AlertRule;\n channels: AlertChannel[];\n title: string;\n body: string;\n nextState: RuleState;\n}\n\nfunction evaluateThreshold(\n rule: Extract<AlertRule, { kind: 'threshold' }>,\n prev: RuleState | undefined,\n stats: FloatStats,\n locale: PushLocale,\n): PendingFire | RuleState | null {\n const value = metricValue(stats, rule.metric);\n if (value == null) return null;\n const prevArmed = prev?.kind === 'threshold' ? prev.armed : true;\n const prevLastFiredAt = prev?.kind === 'threshold' ? prev.lastFiredAt : null;\n\n // Rearm when comfortably above threshold.\n if (value >= rule.below + HYSTERESIS_PCT) {\n if (!prevArmed) return { kind: 'threshold', armed: true, lastFiredAt: prevLastFiredAt };\n return null;\n }\n // Fire when below threshold and still armed.\n if (value < rule.below && prevArmed) {\n const { title, body } = formatThresholdAlert(rule, value, stats, locale);\n return {\n rule,\n channels: [], // filled in by caller\n title,\n body,\n nextState: { kind: 'threshold', armed: false, lastFiredAt: Date.now() },\n };\n }\n return null;\n}\n\nfunction evaluateDaily(\n rule: Extract<AlertRule, { kind: 'daily' }>,\n prev: RuleState | undefined,\n stats: FloatStats,\n locale: PushLocale,\n now: Date,\n): PendingFire | null {\n const day = todayKey(now);\n const prevDay = prev?.kind === 'daily' ? prev.lastFiredDay : null;\n if (prevDay === day) return null;\n if (now.getHours() < rule.hour) return null;\n if (now.getHours() === rule.hour && now.getMinutes() < rule.minute) return null;\n\n const { title, body } = formatDailySummary(stats, locale);\n return {\n rule,\n channels: [],\n title,\n body,\n nextState: { kind: 'daily', lastFiredDay: day },\n };\n}\n\nfunction evaluateResetReminder(\n rule: Extract<AlertRule, { kind: 'reset_reminder' }>,\n prev: RuleState | undefined,\n stats: FloatStats,\n locale: PushLocale,\n nowMs: number,\n): PendingFire | null {\n const q = resetQuota(stats, rule.metric);\n if (!q) return null;\n const { remaining, resetAt } = resetWindowFields(q, rule.metric);\n if (resetAt == null) return null;\n const minutesAway = (resetAt - nowMs) / 60_000;\n if (minutesAway <= 0 || minutesAway > rule.minutesBefore) return null;\n // \"Use it or lose it\" — only nudge while there's still meaningful unused quota.\n if (remaining == null || remaining < rule.remainingPctAbove) return null;\n const prevReset = prev?.kind === 'reset_reminder' ? prev.lastFiredForResetAt : null;\n if (prevReset === resetAt) return null;\n\n const { title, body } = formatResetReminder(rule, q, remaining, resetAt, locale);\n return {\n rule,\n channels: [],\n title,\n body,\n nextState: { kind: 'reset_reminder', lastFiredForResetAt: resetAt },\n };\n}\n\nexport interface RunReport {\n fired: Array<{ ruleId: string; channelId: string; success: boolean; message: string }>;\n evaluated: number;\n}\n\nexport async function runAlertsOnce(now: Date = new Date()): Promise<RunReport> {\n const config = readAlertConfig();\n if (!config.rules.length) return { fired: [], evaluated: 0 };\n\n importUsageSnapshots();\n\n const state = readAlertState();\n const stats = await getFloatStats();\n const pushLocale: PushLocale = config.pushLocale === 'en' ? 'en' : 'zh';\n\n const pending: PendingFire[] = [];\n const stateUpdates: Record<string, RuleState> = {};\n\n for (const rule of config.rules) {\n if (!rule.enabled) continue;\n const prev = state.rules[rule.id];\n if (rule.kind === 'threshold') {\n const r = evaluateThreshold(rule, prev, stats, pushLocale);\n if (!r) continue;\n // Threshold evaluator can return a rearm-only RuleState (no fire).\n if ('rule' in r) {\n const channels = channelsByIds(config, rule.channelIds);\n if (channels.length) pending.push({ ...r, channels });\n stateUpdates[rule.id] = r.nextState;\n } else {\n stateUpdates[rule.id] = r;\n }\n } else if (rule.kind === 'daily') {\n const r = evaluateDaily(rule, prev, stats, pushLocale, now);\n if (!r) continue;\n const channels = channelsByIds(config, rule.channelIds);\n if (!channels.length) continue;\n pending.push({ ...r, channels });\n stateUpdates[rule.id] = r.nextState;\n } else if (rule.kind === 'reset_reminder') {\n const r = evaluateResetReminder(rule, prev, stats, pushLocale, now.getTime());\n if (!r) continue;\n const channels = channelsByIds(config, rule.channelIds);\n if (!channels.length) continue;\n pending.push({ ...r, channels });\n stateUpdates[rule.id] = r.nextState;\n }\n }\n\n const fired: RunReport['fired'] = [];\n for (const p of pending) {\n for (const ch of p.channels) {\n const res = await dispatch(ch, p.title, p.body);\n fired.push({ ruleId: p.rule.id, channelId: ch.id, success: res.success, message: res.message });\n }\n }\n\n if (Object.keys(stateUpdates).length) {\n const merged: AlertState = { rules: { ...state.rules, ...stateUpdates } };\n writeAlertState(merged);\n }\n\n return { fired, evaluated: config.rules.filter((r) => r.enabled).length };\n}\n","// Generic webhook — POSTs a JSON body with title/body/timestamp. Good for\n// self-hosted receivers (Bark, ntfy, Slack-shaped, …) where the receiver\n// adapts the payload itself. No retry — generic endpoints rarely have a\n// well-known transient error contract.\n\nimport type { PushResult } from './wxwork';\nexport type { PushResult } from './wxwork';\n\nexport async function pushGeneric(\n webhook: string,\n title: string,\n body: string,\n headers?: Record<string, string>,\n): Promise<PushResult> {\n if (!webhook) return { success: false, message: 'webhook 为空', channel: 'generic' };\n try {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), 10_000);\n const res = await fetch(webhook, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...(headers ?? {}) },\n body: JSON.stringify({\n source: 'vibemeter',\n title,\n body,\n timestamp: new Date().toISOString(),\n }),\n signal: controller.signal,\n });\n clearTimeout(timer);\n if (res.ok) return { success: true, message: `HTTP ${res.status}`, channel: 'generic', attempts: 1 };\n const text = await res.text().catch(() => '');\n return {\n success: false,\n message: `HTTP ${res.status} ${text.slice(0, 200)}`.trim(),\n channel: 'generic',\n attempts: 1,\n };\n } catch (error: unknown) {\n return {\n success: false,\n message: error instanceof Error ? error.message : String(error),\n channel: 'generic',\n attempts: 1,\n };\n }\n}\n","// Alert configuration types. Stored in `<dataDir>/alerts.json` (user-local,\n// never in the repo) and read by both the runtime ticker and the Settings UI.\n\nexport type AlertMetric =\n | 'claude_5h_remaining_pct'\n | 'claude_weekly_remaining_pct'\n | 'codex_5h_remaining_pct'\n | 'codex_weekly_remaining_pct';\n\nexport type ResetMetric = 'claude_5h' | 'claude_weekly' | 'codex_5h' | 'codex_weekly';\n\nexport type ChannelType = 'wxwork' | 'generic';\n\nexport interface AlertChannel {\n id: string;\n type: ChannelType;\n label: string;\n webhook: string;\n // Generic webhook can add custom headers; wxwork ignores this.\n headers?: Record<string, string>;\n}\n\nexport type AlertRule =\n | {\n id: string;\n kind: 'threshold';\n label?: string;\n metric: AlertMetric;\n below: number; // percent, e.g. 20 → fire when remaining < 20%\n channelIds: string[];\n enabled: boolean;\n }\n | {\n id: string;\n kind: 'daily';\n label?: string;\n hour: number; // 0–23, local time\n minute: number; // 0–59\n channelIds: string[];\n enabled: boolean;\n }\n | {\n id: string;\n kind: 'reset_reminder';\n label?: string;\n metric: ResetMetric;\n minutesBefore: number; // e.g. 60 → fire 60 min before the window resets\n remainingPctAbove: number; // \"use it or lose it\" — only nudge when there's still quota worth saving\n channelIds: string[];\n enabled: boolean;\n };\n\nexport type PushLocale = 'zh' | 'en';\n\nexport interface AlertConfig {\n channels: AlertChannel[];\n rules: AlertRule[];\n pushLocale?: PushLocale;\n}\n\nexport type RuleState =\n | {\n kind: 'threshold';\n lastFiredAt: number | null;\n armed: boolean; // true ⇒ value is above threshold; next downward cross will fire\n }\n | {\n kind: 'daily';\n lastFiredDay: string | null; // YYYY-MM-DD in the rule's local TZ\n }\n | {\n kind: 'reset_reminder';\n lastFiredForResetAt: number | null; // resetAt value at the moment of last fire\n };\n\nexport interface AlertState {\n // keyed by rule id\n rules: Record<string, RuleState>;\n}\n\nexport const EMPTY_CONFIG: AlertConfig = { channels: [], rules: [] };\nexport const EMPTY_STATE: AlertState = { rules: {} };\n"],"names":["RETRY_DELAY_MS","RETRIABLE_ERRCODES","Set","MAX_CHUNK","content","res","webhook","controller","timer","chunkBody","title","fetch","signal","method","attemptPush","body","head","catch","AbortController","setTimeout","data","abort","message","headers","JSON","stringify","msgtype","markdown","retriable","errcode","current","clearTimeout","success","json","errmsg","trim","has","length","error","String","Error","paragraphs","candidate","push","split","buf","chunks","line","lines","c","para","first","slice","i","channel","second","failures","map","tag","r","Promise","pushWxwork","attempts","join"],"mappings":"uCEAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,E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-0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[23322,s=>{"use strict";async function e(){let{startAlertsTicker:e}=await s.A(49001);e()}s.s(["register",0,e])},49001,s=>{s.v(e=>Promise.all(["server/chunks/[externals]__0_i~3ox._.js","server/chunks/src_lib_alerts_ticker_ts_0n6oy1d._.js"].map(e=>s.l(e))).then(()=>e(70353)))}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=src_12i1qk5._.js.map
|