failproofai 0.0.10 → 0.0.11-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +9 -1
- package/.next/standalone/.next/build-manifest.json +10 -10
- package/.next/standalone/.next/prerender-manifest.json +3 -32
- package/.next/standalone/.next/required-server-files.json +2 -1
- package/.next/standalone/.next/routes-manifest.json +51 -3
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js +6 -6
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/_not-found/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +12 -13
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +16 -16
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/audit/invite/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +7 -0
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/audit/invite/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/audit/run/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/audit/run/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/audit/run/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/audit/run/route.js +8 -0
- package/.next/standalone/.next/server/app/api/audit/run/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/audit/run/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/audit/status/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/audit/status/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/audit/status/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/audit/status/route.js +6 -0
- package/.next/standalone/.next/server/app/api/audit/status/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/audit/status/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +6 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/status/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/status/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/status/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/status/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/status/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/status/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +3 -3
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +18 -0
- package/.next/standalone/.next/server/app/audit/page/next-font-manifest.json +6 -0
- package/.next/standalone/.next/server/app/audit/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +29 -0
- package/.next/standalone/.next/server/app/audit/page.js +17 -0
- package/.next/standalone/.next/server/app/audit/page.js.map +5 -0
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +16 -17
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -17
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -3
- package/.next/standalone/.next/server/app/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +14 -15
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/policies/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/policies/page.js +16 -16
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/project/[name]/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js +16 -17
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +19 -20
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/projects/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +15 -16
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +9 -1
- package/.next/standalone/.next/server/chunks/[externals]__14odj07._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[externals]__0z0j--b._.js → [externals]__1nl3dvw._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__0-p9.k~._.js → [externals]__1s61mel._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]_node_os_06ur78j._.js → [externals]_node_os_0by37l-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0kjo7d_._.js → [root-of-the-server]__0_0xu5z._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cag8qd._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0z-180.._.js → [root-of-the-server]__0cycwg6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__08px0ym._.js → [root-of-the-server]__0f7mikp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q-v9z2._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rv7m0k._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0g48iv.._.js → [root-of-the-server]__0sb_5m8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0j8-xkl._.js → [root-of-the-server]__0xuaoik._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13h8pzr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1_mqemn._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0vlhtkc._.js → [root-of-the-server]__1hgv_75._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0wu7fr7._.js → [root-of-the-server]__1jm9fw6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1legmza._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__044xt9.._.js → [root-of-the-server]__1m2_4t0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0yfq1yr._.js → [root-of-the-server]__1mhmdzs._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0zso~62._.js → [root-of-the-server]__1ou2ehh._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qxztj-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1r1h8v9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1rhmvod._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1uatkiv._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0.~nmr9._.js → [root-of-the-server]__1w9zl9-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1y6gxxb._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_0ebx_lc._.js → _0p53ge1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_audit_invite_route_actions_0-2n5sy.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_audit_run_route_actions_1qgp9io.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_audit_status_route_actions_1f7pjof.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_login-request_route_actions_1c49co0.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_login-verify_route_actions_1r3slzk.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_logout_route_actions_0regwyr.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_reminder_route_actions_1kjgxf8.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_status_route_actions_1aho9zu.js +3 -0
- package/.next/standalone/.next/server/chunks/{_next-internal_server_app_api_download_[project]_[session]_route_actions_0wb00i-.js → _next-internal_server_app_api_download_[project]_[session]_route_actions_1is7vs7.js} +1 -1
- package/.next/standalone/.next/server/chunks/{lib_logger_ts_047tt9f._.js → lib_logger_ts_07e65t5._.js} +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_0-tu4ot._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_0ttxbz7._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_1bnh1y0._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_1epycqa._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_1wpdcgo._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +23 -0
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +3 -0
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[externals]__12dv.x0._.js → [externals]__1_g_b3t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[externals]_node_async_hooks_0v0ln8c._.js → [externals]_node_async_hooks_1gjz99j._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01tn1ou._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0808sha._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e4-6d8._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ehe24g._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0f62vu9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g253ve._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h12me5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k65l27._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vxf0_g._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11rtg6s._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12mcauo._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14dd6h8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0t5l7a5._.js → [root-of-the-server]__1d8omgc._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10xgshr._.js → [root-of-the-server]__1dky4g0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1e-x7j4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1fax1sl._.js +19 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mt35_w._.js +221 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pcxxwg._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1usf8v2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1uvfwgr._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1w6v_1u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__212nf49._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_03d7qyt._.js → _05whahf._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0il3fl1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0xb8ngh._.js → _1kje4fm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0zx~s__._.js → _1p0-leb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_04qfs8z._.js → app_087bt9w._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_0uosk1e._.js → app_1fvisnp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_13f0ohr._.js → app_209u41o._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +65 -0
- package/.next/standalone/.next/server/chunks/ssr/app_audit_loading_tsx_1j1kc6j._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{app_error_tsx_11t4ysq._.js → app_error_tsx_1zds1ns._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_global-error_tsx_0m9qisk._.js → app_global-error_tsx_113y3za._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +8 -0
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_error_tsx_0.9-fod._.js → app_project_[name]_error_tsx_1v02_5n._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_loading_tsx_03g9xy0._.js → app_project_[name]_loading_tsx_05-l4uf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_session_[sessionId]_error_tsx_0ler-mr._.js → app_project_[name]_session_[sessionId]_error_tsx_0-lj3nd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_session_[sessionId]_loading_tsx_0c0e3yx._.js → app_project_[name]_session_[sessionId]_loading_tsx_0l4aixs._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_projects_loading_tsx_20-3u8b._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{lib_codex-projects_ts_0eosib~._.js → lib_codex-projects_ts_0pqlw37._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_copilot-projects_ts_0r8xkn8._.js → lib_copilot-projects_ts_19wl7tp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_cursor-projects_ts_0qt1scg._.js → lib_cursor-projects_ts_18-iwyk._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_gemini-projects_ts_0sl~yqr._.js → lib_gemini-projects_ts_1c7bgx-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_opencode-projects_ts_0op9gyp._.js → lib_opencode-projects_ts_15bjxkm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_pi-projects_ts_103tsh1._.js → lib_pi-projects_ts_1wikofb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/lib_utils_ts_0az0sfq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_1ynf7el._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_html-to-image_es_index_0nye1s3.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_html-to-image_es_index_1ao30b1.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_0rd0oc-._.js → node_modules_next_1a1kch7._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0uboya6._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_11dij6w._.js → node_modules_next_dist_1d_onnt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_client_components_0inhx6q._.js → node_modules_next_dist_client_components_0wpq8j3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js → node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js → node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-uvagv.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03c7gi5.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09p-8om.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0v-kfiu.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0xrgzyz.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1806lsc.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1j6dd-e.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1sa65r-.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1ezd2jf._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1tnuifj._.js +5 -0
- package/.next/standalone/.next/server/functions-config-manifest.json +2 -2
- package/.next/standalone/.next/server/instrumentation.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +10 -10
- package/.next/standalone/.next/server/middleware.js +2 -2
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +2 -21
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +27 -9
- package/.next/standalone/.next/static/{dAuQps6jUwCz9X1Q5FFOO → DOSSF5hRUtt3-QZEm-ZIk}/_clientMiddlewareManifest.js +2 -2
- package/.next/standalone/.next/static/chunks/{0pkl..xgo-qox.js → 02e80j0576qfu.js} +1 -1
- package/.next/standalone/.next/static/chunks/{07uz2g0_38qia.js → 03fmihek9n986.js} +1 -1
- package/.next/standalone/.next/static/chunks/0f7d7hnbh4djs.js +1 -0
- package/.next/standalone/.next/static/chunks/0h7auy7hzjyhw.js +1 -0
- package/.next/standalone/.next/static/chunks/0wwt5o04i4zwh.js +1 -0
- package/.next/standalone/.next/static/chunks/0zbxssxh53n-3.js +1 -0
- package/.next/standalone/.next/static/chunks/13f1kmjea-0md.js +2 -0
- package/.next/standalone/.next/static/chunks/13xzda05yw19e.js +1 -0
- package/.next/standalone/.next/static/chunks/{150i0n26fnvso.js → 1__i9af9g78vd.js} +1 -1
- package/.next/standalone/.next/static/chunks/1uxa5lm6yco79.js +1 -0
- package/.next/standalone/.next/static/chunks/20dqelk3xz_ya.css +1 -0
- package/.next/standalone/.next/static/chunks/{0j171xiqge4rv.js → 29lzaddhez98q.js} +1 -1
- package/.next/standalone/.next/static/chunks/29nrs5xs9c4hx.css +2 -0
- package/.next/standalone/.next/static/chunks/{0lt8ko3lw.5yt.js → 2b_e9tyly10lo.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0rnqmir4cd5p9.js → 2h0dkzyy0vocp.js} +1 -1
- package/.next/standalone/.next/static/chunks/2lp3a3a3_4_9o.js +63 -0
- package/.next/standalone/.next/static/chunks/{179yytvmam0ug.js → 2nt_slonrn0rw.js} +1 -1
- package/.next/standalone/.next/static/chunks/2plcgtv_tkv9t.js +1 -0
- package/.next/standalone/.next/static/chunks/33k2epr1iz8_z.js +6 -0
- package/.next/standalone/.next/static/chunks/{0d3shmwh5_nmn.js → 33u59vf_8xpd-.js} +1 -1
- package/.next/standalone/.next/static/chunks/3zkg2s2vzxc3d.js +1 -0
- package/.next/standalone/.next/static/chunks/{turbopack-05z7a19q43zfq.js → turbopack-3lrm4f20fz89b.js} +1 -1
- package/.next/standalone/SECURITY.md +73 -0
- package/.next/standalone/app/actions/get-audit-result.ts +35 -0
- package/.next/standalone/app/api/audit/_state.ts +79 -0
- package/.next/standalone/app/api/audit/invite/route.ts +183 -0
- package/.next/standalone/app/api/audit/run/route.ts +103 -0
- package/.next/standalone/app/api/audit/status/route.ts +24 -0
- package/.next/standalone/app/api/auth/login-request/route.ts +91 -0
- package/.next/standalone/app/api/auth/login-verify/route.ts +98 -0
- package/.next/standalone/app/api/auth/logout/route.ts +48 -0
- package/.next/standalone/app/api/auth/reminder/route.ts +213 -0
- package/.next/standalone/app/api/auth/status/route.ts +42 -0
- package/.next/standalone/app/audit/_components/audit-dashboard.tsx +397 -0
- package/.next/standalone/app/audit/_components/audit-poster.tsx +326 -0
- package/.next/standalone/app/audit/_components/audit-progress-strip.tsx +98 -0
- package/.next/standalone/app/audit/_components/auth-dialog.tsx +375 -0
- package/.next/standalone/app/audit/_components/come-back-better-section.tsx +333 -0
- package/.next/standalone/app/audit/_components/empty-state.tsx +152 -0
- package/.next/standalone/app/audit/_components/how-to-improve-section.tsx +187 -0
- package/.next/standalone/app/audit/_components/invite-dialog.tsx +227 -0
- package/.next/standalone/app/audit/_components/quirks-section.tsx +75 -0
- package/.next/standalone/app/audit/_components/report-footer.tsx +35 -0
- package/.next/standalone/app/audit/_components/rerun-button.tsx +119 -0
- package/.next/standalone/app/audit/_components/run-progress.tsx +120 -0
- package/.next/standalone/app/audit/_components/share-templates.ts +94 -0
- package/.next/standalone/app/audit/_components/sigil.tsx +36 -0
- package/.next/standalone/app/audit/_components/strengths-section.tsx +45 -0
- package/.next/standalone/app/audit/audit-styles.css +1178 -0
- package/.next/standalone/app/audit/loading.tsx +24 -0
- package/.next/standalone/app/audit/page.tsx +63 -0
- package/.next/standalone/app/components/sessions-list.tsx +77 -80
- package/.next/standalone/app/globals.css +754 -139
- package/.next/standalone/app/layout.tsx +6 -8
- package/.next/standalone/app/policies/hooks-client.tsx +340 -141
- package/.next/standalone/app/project/[name]/page.tsx +31 -37
- package/.next/standalone/app/projects/loading.tsx +30 -8
- package/.next/standalone/app/projects/page.tsx +66 -17
- package/.next/standalone/assets/audit/Audit Report.html +22 -0
- package/.next/standalone/assets/audit/Show Off Your Agent.html +22 -0
- package/.next/standalone/assets/audit/archetypes.jsx +277 -0
- package/.next/standalone/assets/audit/assets/fonts/bitcount-prop-single.woff2 +0 -0
- package/.next/standalone/assets/audit/audit.jsx +825 -0
- package/.next/standalone/assets/audit/poster-styles.css +424 -0
- package/.next/standalone/assets/audit/poster.jsx +247 -0
- package/.next/standalone/assets/audit/screenshots/poster-optimist.png +0 -0
- package/.next/standalone/assets/audit/screenshots/poster-scrolled.png +0 -0
- package/.next/standalone/assets/audit/styles.css +1225 -0
- package/.next/standalone/assets/audit/tweaks-panel.jsx +425 -0
- package/.next/standalone/assets/logos/company/icon.svg +1 -0
- package/.next/standalone/assets/logos/company/logo.svg +1 -0
- package/.next/standalone/components/navbar.tsx +119 -65
- package/.next/standalone/components/reach-developers.tsx +39 -11
- package/.next/standalone/lib/atomic-write.ts +67 -0
- package/.next/standalone/lib/auth/api-server-client.ts +306 -0
- package/.next/standalone/lib/auth/auth-store.ts +250 -0
- package/.next/standalone/lib/claude-sessions.ts +181 -0
- package/.next/standalone/lib/client-telemetry.ts +2 -0
- package/.next/standalone/lib/fetch-with-timeout.ts +59 -0
- package/.next/standalone/lib/share-card.ts +144 -0
- package/.next/standalone/lib/telemetry.ts +12 -7
- package/.next/standalone/node_modules/@next/env/package.json +2 -2
- package/.next/standalone/node_modules/next/dist/build/static-paths/app.js +2 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/build/utils.js +2 -1
- package/.next/standalone/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +2 -2
- package/.next/standalone/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +8 -2
- package/.next/standalone/node_modules/next/dist/client/dev/debug-channel.js +102 -2
- package/.next/standalone/node_modules/next/dist/client/route-params.js +23 -6
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +13 -13
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +13 -13
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +10 -10
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +21 -14
- package/.next/standalone/node_modules/next/dist/server/app-render/app-render.js +62 -9
- package/.next/standalone/node_modules/next/dist/server/app-render/collect-segment-data.js +16 -0
- package/.next/standalone/node_modules/next/dist/server/app-render/create-component-tree.js +49 -19
- package/.next/standalone/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +8 -20
- package/.next/standalone/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +8 -7
- package/.next/standalone/node_modules/next/dist/server/app-render/use-flight-response.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/async-storage/work-store.js +2 -1
- package/.next/standalone/node_modules/next/dist/server/base-server.js +13 -5
- package/.next/standalone/node_modules/next/dist/server/config-schema.js +1 -0
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/static-paths-worker.js +2 -1
- package/.next/standalone/node_modules/next/dist/server/image-optimizer.js +22 -2
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/encode-cache-tag.js +45 -0
- package/.next/standalone/node_modules/next/dist/server/lib/implicit-tags.js +6 -3
- package/.next/standalone/node_modules/next/dist/server/lib/is-rsc-request.js +18 -0
- package/.next/standalone/node_modules/next/dist/server/lib/mock-request.js +30 -5
- package/.next/standalone/node_modules/next/dist/server/lib/patch-fetch.js +5 -1
- package/.next/standalone/node_modules/next/dist/server/lib/patch-set-header.js +7 -0
- package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +6 -3
- package/.next/standalone/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +18 -4
- package/.next/standalone/node_modules/next/dist/server/lib/server-ipc/utils.js +3 -1
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/next-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/request/fallback-params.js +27 -1
- package/.next/standalone/node_modules/next/dist/server/route-modules/app-route/module.js +1 -0
- package/.next/standalone/node_modules/next/dist/server/route-modules/route-module.js +11 -1
- package/.next/standalone/node_modules/next/dist/server/server-utils.js +19 -2
- package/.next/standalone/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +5 -5
- package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/web/adapter.js +4 -1
- package/.next/standalone/node_modules/next/dist/server/web/edge-route-module-wrapper.js +2 -1
- package/.next/standalone/node_modules/next/dist/server/web/spec-extension/revalidate.js +4 -3
- package/.next/standalone/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +6 -2
- package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- package/.next/standalone/node_modules/next/dist/{server → shared/lib}/htmlescape.js +15 -0
- package/.next/standalone/node_modules/next/dist/shared/lib/router/routes/app.js +13 -1
- package/.next/standalone/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +56 -10
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +15 -15
- package/.next/standalone/node_modules/react/cjs/react.development.js +1 -1
- package/.next/standalone/node_modules/react/cjs/react.production.js +1 -1
- package/.next/standalone/node_modules/react/package.json +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/package.json +2 -2
- package/.next/standalone/osv-scanner.toml +17 -0
- package/.next/standalone/package.json +26 -18
- package/.next/standalone/proxy.ts +1 -1
- package/.next/standalone/public/audit/fonts/bitcount-prop-single.woff2 +0 -0
- package/.next/standalone/public/icon.svg +1 -0
- package/.next/standalone/public/logo.svg +1 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/templates/bitcount-font/README.md +42 -0
- package/.next/standalone/templates/bitcount-font/bitcount-prop-single.woff2 +0 -0
- package/.next/standalone/templates/bitcount-font/bitcount.css +49 -0
- package/.next/standalone/templates/bitcount-font/fonts.ts.example +23 -0
- package/README.md +12 -5
- package/bin/failproofai.mjs +263 -70
- package/dist/cli.mjs +3830 -1617
- package/lib/atomic-write.ts +67 -0
- package/lib/auth/api-server-client.ts +306 -0
- package/lib/auth/auth-store.ts +250 -0
- package/lib/claude-sessions.ts +181 -0
- package/lib/client-telemetry.ts +2 -0
- package/lib/fetch-with-timeout.ts +59 -0
- package/lib/share-card.ts +144 -0
- package/lib/telemetry.ts +12 -7
- package/package.json +26 -18
- package/scripts/install-telemetry.mjs +4 -0
- package/scripts/launch.ts +2 -2
- package/scripts/postinstall.mjs +89 -1
- package/src/audit/archetypes.ts +944 -0
- package/src/audit/cache.ts +151 -0
- package/src/audit/cli-adapters/claude.ts +97 -0
- package/src/audit/cli-adapters/codex.ts +56 -0
- package/src/audit/cli-adapters/copilot.ts +51 -0
- package/src/audit/cli-adapters/cursor.ts +51 -0
- package/src/audit/cli-adapters/gemini.ts +51 -0
- package/src/audit/cli-adapters/index.ts +70 -0
- package/src/audit/cli-adapters/opencode.ts +52 -0
- package/src/audit/cli-adapters/pi.ts +51 -0
- package/src/audit/cli-adapters/shared.ts +85 -0
- package/src/audit/cli.ts +319 -0
- package/src/audit/dashboard-cache.ts +158 -0
- package/src/audit/detectors/find-from-root.ts +27 -0
- package/src/audit/detectors/git-commit-no-verify.ts +22 -0
- package/src/audit/detectors/index.ts +33 -0
- package/src/audit/detectors/prefer-edit-over-read-cat.ts +31 -0
- package/src/audit/detectors/prefer-edit-over-sed-awk.ts +27 -0
- package/src/audit/detectors/prefer-write-over-heredoc.ts +36 -0
- package/src/audit/detectors/redundant-cd-cwd.ts +28 -0
- package/src/audit/detectors/reread-after-edit.ts +58 -0
- package/src/audit/detectors/sleep-polling-loop.ts +34 -0
- package/src/audit/features.ts +314 -0
- package/src/audit/findings.ts +298 -0
- package/src/audit/index.ts +387 -0
- package/src/audit/open-browser.ts +69 -0
- package/src/audit/replay.ts +147 -0
- package/src/audit/report.ts +349 -0
- package/src/audit/scoring.ts +174 -0
- package/src/audit/social-proof.ts +34 -0
- package/src/audit/strengths.ts +138 -0
- package/src/audit/types.ts +216 -0
- package/src/auth/cli.ts +359 -0
- package/src/hooks/builtin-policies.ts +81 -2
- package/src/hooks/custom-hooks-loader.ts +19 -3
- package/src/hooks/first-run-nudge.ts +146 -0
- package/src/hooks/handler.ts +21 -102
- package/src/hooks/hook-telemetry.ts +2 -2
- package/src/hooks/install-prompt.ts +34 -4
- package/src/hooks/manager.ts +72 -5
- package/src/hooks/policy-evaluator.ts +19 -4
- package/src/hooks/policy-registry.ts +21 -1
- package/src/hooks/policy-types.ts +9 -0
- package/src/hooks/tool-name-canonicalize.ts +65 -0
- package/src/posthog-key.ts +9 -0
- package/.next/standalone/.next/server/app/icon.png/route/app-paths-manifest.json +0 -3
- package/.next/standalone/.next/server/app/icon.png/route.js +0 -7
- package/.next/standalone/.next/server/app/icon.png/route.js.nft.json +0 -1
- package/.next/standalone/.next/server/app/icon.png.body +0 -0
- package/.next/standalone/.next/server/app/icon.png.meta +0 -1
- package/.next/standalone/.next/server/chunks/[externals]_next_dist_0sqmaqd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06.arfm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0__i0h0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d_ob4n._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fe7_q_._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fw.e.h._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pxn0e1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xv0jh2._.js +0 -3
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_icon_png_route_actions_12.gv.r.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0bdfoky.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_05pz9._._.js +0 -3
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02r.cjq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0370~qj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0609ezh._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07_-mkc._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09z7o2x._.js +0 -19
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0_sh2n0._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e9o9ri._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l6swv1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0logebz._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mi5ejy._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0odijkc._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0podumr._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rkxer-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rl2kwi._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vg0uey._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x5limi._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ye1w50._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ymlddl._.js +0 -223
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10._f0s._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/app_0cdqd9w._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +0 -8
- package/.next/standalone/.next/server/chunks/ssr/app_projects_loading_tsx_13veom4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/lib_utils_ts_068jk73._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0ttbz1~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_06u0kr8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +0 -6
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0a_7sdg.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0ef3uwk.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0j79~gv.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0pbja1x.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0r6o0i2.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11y81~_.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12or2kf.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0mebn66._.js +0 -3
- package/.next/standalone/.next/static/chunks/01q52wg_amm60.js +0 -2
- package/.next/standalone/.next/static/chunks/0kqar56yl~41o.js +0 -6
- package/.next/standalone/.next/static/chunks/0ml1.ck_5t36i.js +0 -1
- package/.next/standalone/.next/static/chunks/0w6fzf.07a24u.js +0 -1
- package/.next/standalone/.next/static/chunks/0zig0fh30t6ou.js +0 -1
- package/.next/standalone/.next/static/chunks/12l2t63hkyo2q.js +0 -1
- package/.next/standalone/.next/static/chunks/12pt~2f.c1sha.js +0 -1
- package/.next/standalone/.next/static/chunks/14lii11wmo450.js +0 -4
- package/.next/standalone/.next/static/chunks/17rm86uz2nd5a.css +0 -2
- package/.next/standalone/.next/static/media/4fa387ec64143e14-s.0q3udbd2bu5yp.woff2 +0 -0
- package/.next/standalone/.next/static/media/797e433ab948586e-s.p.0.q-h669a_dqa.woff2 +0 -0
- package/.next/standalone/.next/static/media/bbc41e54d2fcbd21-s.0gw~uztddq1df.woff2 +0 -0
- package/.next/standalone/.next/static/media/icon.0a.gigb3_x5pd.png +0 -0
- package/.next/standalone/app/icon.png +0 -0
- package/src/auth/login.ts +0 -104
- package/src/auth/logout.ts +0 -50
- package/src/auth/token-store.ts +0 -64
- package/src/relay/daemon.ts +0 -362
- package/src/relay/pid.ts +0 -76
- package/src/relay/queue.ts +0 -225
- /package/.next/standalone/.next/server/app/{icon.png → api/audit/invite}/route/build-manifest.json +0 -0
- /package/.next/standalone/.next/server/app/{icon.png → api/audit/invite}/route.js.map +0 -0
- /package/.next/standalone/.next/static/{dAuQps6jUwCz9X1Q5FFOO → DOSSF5hRUtt3-QZEm-ZIk}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{dAuQps6jUwCz9X1Q5FFOO → DOSSF5hRUtt3-QZEm-ZIk}/_ssgManifest.js +0 -0
- /package/.next/standalone/.next/static/chunks/{03~yq9q893hmn.js → 0cz1d0mv5g_q7.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{0xbo5nl6w4lka.js → 2wbuxnsvux4di.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{0_s0luks5tay-.js → 35fgpd_feci6x.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{15fklyav5py5m.js → 3xpjn3cdgm-7m.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{17.b3suj8zjjj.js → 4448_qq7bd963.js} +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/audit/invite
|
|
3
|
+
*
|
|
4
|
+
* Browser-facing proxy for the api-server's POST /v0/invite — the user
|
|
5
|
+
* supplies a list of friend emails, the api-server composes invite emails
|
|
6
|
+
* (Cc'ing the sender so the recipient sees who invited them), and dispatches
|
|
7
|
+
* them through the same email infrastructure that backs the OTP flow.
|
|
8
|
+
*
|
|
9
|
+
* Auth: requires an active session — same cookie/refresh-token contract as
|
|
10
|
+
* /api/auth/reminder. Anonymous calls get 401 so the front-end can route to
|
|
11
|
+
* the AuthDialog before retrying.
|
|
12
|
+
*
|
|
13
|
+
* Validation: max 10 recipients per call, each must look like an email.
|
|
14
|
+
* Anything beyond that gets a 400 and never reaches upstream.
|
|
15
|
+
*
|
|
16
|
+
* Contract for the upstream endpoint is handed over to the platform team
|
|
17
|
+
* separately.
|
|
18
|
+
*/
|
|
19
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
20
|
+
import { whoAmI } from "@/lib/auth/auth-store";
|
|
21
|
+
import { AuthApiError, sendInvites } from "@/lib/auth/api-server-client";
|
|
22
|
+
import { initTelemetry, trackEvent } from "@/lib/telemetry";
|
|
23
|
+
|
|
24
|
+
export const dynamic = "force-dynamic";
|
|
25
|
+
|
|
26
|
+
const MAX_RECIPIENTS = 10;
|
|
27
|
+
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
28
|
+
|
|
29
|
+
interface InviteBody {
|
|
30
|
+
to?: unknown;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export async function POST(req: NextRequest): Promise<NextResponse> {
|
|
34
|
+
await initTelemetry();
|
|
35
|
+
const who = await whoAmI();
|
|
36
|
+
if (!who) {
|
|
37
|
+
trackEvent("audit_invite_sent", { status: "unauthorized", source: "dashboard" });
|
|
38
|
+
return NextResponse.json(
|
|
39
|
+
{ code: "unauthorized", message: "Sign in before sending invites." },
|
|
40
|
+
{ status: 401 },
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let body: InviteBody = {};
|
|
45
|
+
const raw = await req.text();
|
|
46
|
+
if (raw.trim().length > 0) {
|
|
47
|
+
try {
|
|
48
|
+
const parsed = JSON.parse(raw);
|
|
49
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
50
|
+
trackEvent("audit_invite_sent", {
|
|
51
|
+
status: "validation_error",
|
|
52
|
+
source: "dashboard",
|
|
53
|
+
reason: "not_an_object",
|
|
54
|
+
user_id: who.me.id,
|
|
55
|
+
});
|
|
56
|
+
return NextResponse.json(
|
|
57
|
+
{ code: "validation_error", message: "Request body must be a JSON object." },
|
|
58
|
+
{ status: 400 },
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
body = parsed as InviteBody;
|
|
62
|
+
} catch {
|
|
63
|
+
trackEvent("audit_invite_sent", {
|
|
64
|
+
status: "validation_error",
|
|
65
|
+
source: "dashboard",
|
|
66
|
+
reason: "malformed_json",
|
|
67
|
+
user_id: who.me.id,
|
|
68
|
+
});
|
|
69
|
+
return NextResponse.json(
|
|
70
|
+
{ code: "validation_error", message: "Request body is not valid JSON." },
|
|
71
|
+
{ status: 400 },
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!Array.isArray(body.to)) {
|
|
77
|
+
trackEvent("audit_invite_sent", {
|
|
78
|
+
status: "validation_error",
|
|
79
|
+
source: "dashboard",
|
|
80
|
+
reason: "missing_to",
|
|
81
|
+
user_id: who.me.id,
|
|
82
|
+
});
|
|
83
|
+
return NextResponse.json(
|
|
84
|
+
{ code: "validation_error", message: "`to` must be a list of email addresses." },
|
|
85
|
+
{ status: 400 },
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const normalised: string[] = [];
|
|
90
|
+
const seen = new Set<string>();
|
|
91
|
+
for (const entry of body.to) {
|
|
92
|
+
if (typeof entry !== "string") continue;
|
|
93
|
+
const e = entry.trim().toLowerCase();
|
|
94
|
+
if (!e || !EMAIL_RE.test(e)) continue;
|
|
95
|
+
if (e === who.me.email.toLowerCase()) continue; // can't invite yourself
|
|
96
|
+
if (seen.has(e)) continue;
|
|
97
|
+
seen.add(e);
|
|
98
|
+
normalised.push(e);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (normalised.length === 0) {
|
|
102
|
+
trackEvent("audit_invite_sent", {
|
|
103
|
+
status: "validation_error",
|
|
104
|
+
source: "dashboard",
|
|
105
|
+
reason: "no_valid_recipients",
|
|
106
|
+
user_id: who.me.id,
|
|
107
|
+
input_count: Array.isArray(body.to) ? body.to.length : 0,
|
|
108
|
+
});
|
|
109
|
+
return NextResponse.json(
|
|
110
|
+
{
|
|
111
|
+
code: "validation_error",
|
|
112
|
+
message: "Provide at least one valid email address (other than your own).",
|
|
113
|
+
},
|
|
114
|
+
{ status: 400 },
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (normalised.length > MAX_RECIPIENTS) {
|
|
119
|
+
trackEvent("audit_invite_sent", {
|
|
120
|
+
status: "validation_error",
|
|
121
|
+
source: "dashboard",
|
|
122
|
+
reason: "too_many_recipients",
|
|
123
|
+
user_id: who.me.id,
|
|
124
|
+
input_count: normalised.length,
|
|
125
|
+
});
|
|
126
|
+
return NextResponse.json(
|
|
127
|
+
{
|
|
128
|
+
code: "validation_error",
|
|
129
|
+
message: `Up to ${MAX_RECIPIENTS} recipients per invite batch. Please send the rest in a follow-up.`,
|
|
130
|
+
},
|
|
131
|
+
{ status: 400 },
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
try {
|
|
136
|
+
const result = await sendInvites(who.auth.access_token, normalised);
|
|
137
|
+
trackEvent("audit_invite_sent", {
|
|
138
|
+
status: "success",
|
|
139
|
+
source: "dashboard",
|
|
140
|
+
user_id: who.me.id,
|
|
141
|
+
sent_count: result.sent.length,
|
|
142
|
+
failed_count: result.failed.length,
|
|
143
|
+
});
|
|
144
|
+
return NextResponse.json(result, { status: 200 });
|
|
145
|
+
} catch (err) {
|
|
146
|
+
if (err instanceof AuthApiError) {
|
|
147
|
+
trackEvent("audit_invite_sent", {
|
|
148
|
+
status: "failed",
|
|
149
|
+
source: "dashboard",
|
|
150
|
+
user_id: who.me.id,
|
|
151
|
+
error_code: err.code,
|
|
152
|
+
http_status: err.status,
|
|
153
|
+
recipient_count: normalised.length,
|
|
154
|
+
});
|
|
155
|
+
const httpStatus = err.status >= 200 && err.status < 600 ? err.status : 504;
|
|
156
|
+
return NextResponse.json(
|
|
157
|
+
{
|
|
158
|
+
code: err.code,
|
|
159
|
+
message: err.message,
|
|
160
|
+
...(err.retryAfterSecs !== undefined ? { retry_after_secs: err.retryAfterSecs } : {}),
|
|
161
|
+
},
|
|
162
|
+
{ status: httpStatus },
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
// Don't surface the raw upstream message to either telemetry or the
|
|
166
|
+
// client. Network/DNS errors can carry internal hostnames, IPs, or
|
|
167
|
+
// fragment payload bytes that have no business leaving the proxy.
|
|
168
|
+
// Log the error name only (bounded) and return a stable generic.
|
|
169
|
+
const errorName = err instanceof Error ? err.name : "unknown";
|
|
170
|
+
trackEvent("audit_invite_sent", {
|
|
171
|
+
status: "failed",
|
|
172
|
+
source: "dashboard",
|
|
173
|
+
user_id: who.me.id,
|
|
174
|
+
error_code: "upstream_unreachable",
|
|
175
|
+
error_name: errorName.slice(0, 50),
|
|
176
|
+
recipient_count: normalised.length,
|
|
177
|
+
});
|
|
178
|
+
return NextResponse.json(
|
|
179
|
+
{ code: "upstream_unreachable", message: "Invite service is unreachable. Please try again in a moment." },
|
|
180
|
+
{ status: 502 },
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/audit/run — start a `runAudit()` call in the background and return
|
|
3
|
+
* `202 { status: "started" }` immediately. The run is fire-and-forget: it
|
|
4
|
+
* executes as a detached task in this long-lived server process (NOT awaited by
|
|
5
|
+
* the handler), writes the dashboard cache on success, and records its outcome
|
|
6
|
+
* in `_state.ts`. The client (rerun-button.tsx) polls /api/audit/status until
|
|
7
|
+
* the run finishes — there is deliberately no per-request or per-run time cap,
|
|
8
|
+
* so a cold all-history scan runs to completion however long it takes.
|
|
9
|
+
*
|
|
10
|
+
* Concurrency: a module-level singleton in `_state.ts` guards against
|
|
11
|
+
* overlapping runs — the second concurrent POST gets a 409. The client then
|
|
12
|
+
* just falls back to polling /status for the in-flight run.
|
|
13
|
+
*/
|
|
14
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
15
|
+
import { runAudit } from "@/src/audit";
|
|
16
|
+
import { writeDashboardCache } from "@/src/audit/dashboard-cache";
|
|
17
|
+
import { INTEGRATION_TYPES, type IntegrationType } from "@/src/hooks/types";
|
|
18
|
+
import type { RunAuditOptions } from "@/src/audit/types";
|
|
19
|
+
import { finishRun, tryAcquireRun } from "../_state";
|
|
20
|
+
|
|
21
|
+
export const dynamic = "force-dynamic";
|
|
22
|
+
|
|
23
|
+
interface RunBody {
|
|
24
|
+
since?: string;
|
|
25
|
+
cli?: string[];
|
|
26
|
+
project?: string[];
|
|
27
|
+
policy?: string[];
|
|
28
|
+
noCache?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const VALID_CLIS = new Set<string>(INTEGRATION_TYPES);
|
|
32
|
+
|
|
33
|
+
function sanitize(body: RunBody): RunAuditOptions {
|
|
34
|
+
const opts: RunAuditOptions = {};
|
|
35
|
+
if (typeof body.since === "string" && body.since.trim()) {
|
|
36
|
+
opts.since = body.since.trim();
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(body.cli) && body.cli.length > 0) {
|
|
39
|
+
const valid = body.cli.filter((c): c is IntegrationType =>
|
|
40
|
+
typeof c === "string" && VALID_CLIS.has(c)
|
|
41
|
+
);
|
|
42
|
+
if (valid.length > 0) opts.clis = valid;
|
|
43
|
+
}
|
|
44
|
+
if (Array.isArray(body.project) && body.project.length > 0) {
|
|
45
|
+
opts.projects = body.project.filter((p) => typeof p === "string");
|
|
46
|
+
}
|
|
47
|
+
if (Array.isArray(body.policy) && body.policy.length > 0) {
|
|
48
|
+
opts.policies = body.policy.filter((p) => typeof p === "string");
|
|
49
|
+
}
|
|
50
|
+
if (body.noCache === true) opts.noCache = true;
|
|
51
|
+
return opts;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function POST(request: NextRequest): Promise<NextResponse> {
|
|
55
|
+
let body: RunBody = {};
|
|
56
|
+
try {
|
|
57
|
+
const raw = await request.text();
|
|
58
|
+
if (raw.trim().length > 0) {
|
|
59
|
+
const parsed: unknown = JSON.parse(raw);
|
|
60
|
+
// JSON.parse("null") returns null and JSON.parse("[]") returns an
|
|
61
|
+
// array — both pass the catch but break sanitize()'s field access.
|
|
62
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
63
|
+
return NextResponse.json(
|
|
64
|
+
{ error: "Request body must be a JSON object" },
|
|
65
|
+
{ status: 400 },
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
body = parsed as RunBody;
|
|
69
|
+
}
|
|
70
|
+
} catch {
|
|
71
|
+
return NextResponse.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const opts = sanitize(body);
|
|
75
|
+
|
|
76
|
+
if (!tryAcquireRun()) {
|
|
77
|
+
return NextResponse.json(
|
|
78
|
+
{ error: "Audit already running", status: "already-running" },
|
|
79
|
+
{ status: 409 },
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Fire-and-forget: a cold, all-history scan can run far longer than any HTTP
|
|
84
|
+
// request should stay open — and longer than Node's `server.requestTimeout`
|
|
85
|
+
// on the standalone production server. Start runAudit() as a detached task in
|
|
86
|
+
// this long-lived server process and return immediately; the client polls
|
|
87
|
+
// /api/audit/status until `running` flips false. The task settles the lock
|
|
88
|
+
// via finishRun() in its own try/catch, surfacing any error through /status.
|
|
89
|
+
void (async () => {
|
|
90
|
+
try {
|
|
91
|
+
const result = await runAudit(opts);
|
|
92
|
+
// The cache is the only channel by which a detached run's result reaches
|
|
93
|
+
// the client (the POST already returned 202), so a failed persist is a
|
|
94
|
+
// failed run from the user's view — surface it instead of reporting OK.
|
|
95
|
+
const persisted = writeDashboardCache(opts, result);
|
|
96
|
+
finishRun(persisted ? null : "audit finished but its result could not be saved");
|
|
97
|
+
} catch (err) {
|
|
98
|
+
finishRun(err instanceof Error ? err.message : String(err));
|
|
99
|
+
}
|
|
100
|
+
})();
|
|
101
|
+
|
|
102
|
+
return NextResponse.json({ status: "started" }, { status: 202 });
|
|
103
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /api/audit/status — lightweight poll endpoint. Client polls this at
|
|
3
|
+
* 1s while a run is in flight; switches off polling once `running: false`.
|
|
4
|
+
*
|
|
5
|
+
* Also returns the cache's `cachedAt` so the client can detect that a new
|
|
6
|
+
* result has landed (older `cachedAt` value in client → refetch via the
|
|
7
|
+
* server action).
|
|
8
|
+
*/
|
|
9
|
+
import { NextResponse } from "next/server";
|
|
10
|
+
import { readDashboardCache } from "@/src/audit/dashboard-cache";
|
|
11
|
+
import { getRunState } from "../_state";
|
|
12
|
+
|
|
13
|
+
export const dynamic = "force-dynamic";
|
|
14
|
+
|
|
15
|
+
export async function GET(): Promise<NextResponse> {
|
|
16
|
+
const state = getRunState();
|
|
17
|
+
const cache = readDashboardCache();
|
|
18
|
+
return NextResponse.json({
|
|
19
|
+
running: state.running,
|
|
20
|
+
startedAt: state.startedAt ?? null,
|
|
21
|
+
cachedAt: cache?.cachedAt ?? null,
|
|
22
|
+
error: state.error,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/auth/login-request
|
|
3
|
+
*
|
|
4
|
+
* Browser-facing proxy for the api-server's /v0/auth/login/request. Keeps the
|
|
5
|
+
* api-server URL server-side so the browser only ever talks to the local
|
|
6
|
+
* dashboard.
|
|
7
|
+
*/
|
|
8
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
9
|
+
import { AuthApiError, requestLoginCode } from "@/lib/auth/api-server-client";
|
|
10
|
+
import { initTelemetry, trackEvent } from "@/lib/telemetry";
|
|
11
|
+
|
|
12
|
+
export const dynamic = "force-dynamic";
|
|
13
|
+
|
|
14
|
+
interface RequestBody {
|
|
15
|
+
email?: unknown;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function POST(req: NextRequest): Promise<NextResponse> {
|
|
19
|
+
await initTelemetry();
|
|
20
|
+
let body: RequestBody = {};
|
|
21
|
+
try {
|
|
22
|
+
body = (await req.json()) as RequestBody;
|
|
23
|
+
} catch {
|
|
24
|
+
trackEvent("audit_otp_requested", { status: "validation_error", reason: "invalid_json" });
|
|
25
|
+
return NextResponse.json({ code: "validation_error", message: "Invalid JSON body" }, { status: 400 });
|
|
26
|
+
}
|
|
27
|
+
if (typeof body.email !== "string" || !body.email.trim()) {
|
|
28
|
+
trackEvent("audit_otp_requested", { status: "validation_error", reason: "missing_email" });
|
|
29
|
+
return NextResponse.json(
|
|
30
|
+
{ code: "validation_error", message: "email is required" },
|
|
31
|
+
{ status: 400 },
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
// Telemetry sends the raw (normalised) email so PostHog can identify the
|
|
35
|
+
// sender. Core login logic still uses the original `body.email`.
|
|
36
|
+
const email = body.email.trim().toLowerCase();
|
|
37
|
+
try {
|
|
38
|
+
const r = await requestLoginCode(body.email);
|
|
39
|
+
trackEvent("audit_otp_requested", {
|
|
40
|
+
status: "success",
|
|
41
|
+
email,
|
|
42
|
+
source: "dashboard",
|
|
43
|
+
expires_in: r.expires_in,
|
|
44
|
+
resend_available_in: r.resend_available_in,
|
|
45
|
+
});
|
|
46
|
+
return NextResponse.json(
|
|
47
|
+
{
|
|
48
|
+
status: r.status,
|
|
49
|
+
expires_in: r.expires_in,
|
|
50
|
+
resend_available_in: r.resend_available_in,
|
|
51
|
+
},
|
|
52
|
+
{ status: 200 },
|
|
53
|
+
);
|
|
54
|
+
} catch (err) {
|
|
55
|
+
if (err instanceof AuthApiError) {
|
|
56
|
+
trackEvent("audit_otp_requested", {
|
|
57
|
+
status: "failed",
|
|
58
|
+
email,
|
|
59
|
+
source: "dashboard",
|
|
60
|
+
error_code: err.code,
|
|
61
|
+
http_status: err.status,
|
|
62
|
+
retry_after_secs: err.retryAfterSecs ?? null,
|
|
63
|
+
});
|
|
64
|
+
// AuthApiError uses `status: 0` for client-side timeouts; NextResponse
|
|
65
|
+
// (the Response constructor) rejects any status < 200 with a
|
|
66
|
+
// RangeError. Surface the timeout as 504 so the browser sees a real
|
|
67
|
+
// status code, not a 500 stack trace.
|
|
68
|
+
const httpStatus = err.status >= 200 && err.status < 600 ? err.status : 504;
|
|
69
|
+
return NextResponse.json(
|
|
70
|
+
{
|
|
71
|
+
code: err.code,
|
|
72
|
+
message: err.message,
|
|
73
|
+
...(err.retryAfterSecs !== undefined ? { retry_after_secs: err.retryAfterSecs } : {}),
|
|
74
|
+
},
|
|
75
|
+
{ status: httpStatus },
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
79
|
+
trackEvent("audit_otp_requested", {
|
|
80
|
+
status: "failed",
|
|
81
|
+
email,
|
|
82
|
+
source: "dashboard",
|
|
83
|
+
error_code: "upstream_unreachable",
|
|
84
|
+
error_message: message.slice(0, 200),
|
|
85
|
+
});
|
|
86
|
+
return NextResponse.json(
|
|
87
|
+
{ code: "upstream_unreachable", message: `api-server unreachable: ${message}` },
|
|
88
|
+
{ status: 502 },
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/auth/login-verify
|
|
3
|
+
*
|
|
4
|
+
* Browser-facing proxy: verifies the OTP with the api-server, persists the
|
|
5
|
+
* resulting tokens to ~/.failproofai/auth.json on the local dashboard host,
|
|
6
|
+
* and returns *only* the user identity to the browser. The refresh token
|
|
7
|
+
* never leaves the local filesystem.
|
|
8
|
+
*/
|
|
9
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
10
|
+
import { AuthApiError, verifyLoginCode } from "@/lib/auth/api-server-client";
|
|
11
|
+
import { authFromTokenResponse, writeAuth } from "@/lib/auth/auth-store";
|
|
12
|
+
import { initTelemetry, trackEvent } from "@/lib/telemetry";
|
|
13
|
+
import { getInstanceId } from "@/lib/telemetry-id";
|
|
14
|
+
|
|
15
|
+
export const dynamic = "force-dynamic";
|
|
16
|
+
|
|
17
|
+
interface VerifyBody {
|
|
18
|
+
email?: unknown;
|
|
19
|
+
code?: unknown;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function POST(req: NextRequest): Promise<NextResponse> {
|
|
23
|
+
let body: VerifyBody = {};
|
|
24
|
+
try {
|
|
25
|
+
body = (await req.json()) as VerifyBody;
|
|
26
|
+
} catch {
|
|
27
|
+
return NextResponse.json({ code: "validation_error", message: "Invalid JSON body" }, { status: 400 });
|
|
28
|
+
}
|
|
29
|
+
if (typeof body.email !== "string" || !body.email.trim()) {
|
|
30
|
+
return NextResponse.json(
|
|
31
|
+
{ code: "validation_error", message: "email is required" },
|
|
32
|
+
{ status: 400 },
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
if (typeof body.code !== "string" || !body.code.trim()) {
|
|
36
|
+
return NextResponse.json(
|
|
37
|
+
{ code: "validation_error", message: "code is required" },
|
|
38
|
+
{ status: 400 },
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
// `initTelemetry` never throws — its internal try/catch is total.
|
|
42
|
+
await initTelemetry();
|
|
43
|
+
try {
|
|
44
|
+
const tokens = await verifyLoginCode(body.email, body.code);
|
|
45
|
+
writeAuth(authFromTokenResponse(tokens));
|
|
46
|
+
// Identity stitch: this event's distinct_id IS the device random id
|
|
47
|
+
// (getInstanceId()), so attaching the verified email + user_id — and
|
|
48
|
+
// persisting them as person properties via `$set` — maps the verified
|
|
49
|
+
// account onto the anonymous device person in PostHog.
|
|
50
|
+
trackEvent("audit_user_identity_linked", {
|
|
51
|
+
source: "audit_set_reminder_auth_dialog",
|
|
52
|
+
user_id: tokens.user.id,
|
|
53
|
+
email: tokens.user.email,
|
|
54
|
+
local_random_id: getInstanceId(),
|
|
55
|
+
$set: { email: tokens.user.email, user_id: tokens.user.id },
|
|
56
|
+
});
|
|
57
|
+
trackEvent("audit_otp_verified", {
|
|
58
|
+
status: "success",
|
|
59
|
+
source: "dashboard",
|
|
60
|
+
user_id: tokens.user.id,
|
|
61
|
+
email: tokens.user.email,
|
|
62
|
+
});
|
|
63
|
+
return NextResponse.json(
|
|
64
|
+
{
|
|
65
|
+
authenticated: true,
|
|
66
|
+
user: { id: tokens.user.id, email: tokens.user.email },
|
|
67
|
+
},
|
|
68
|
+
{ status: 200 },
|
|
69
|
+
);
|
|
70
|
+
} catch (err) {
|
|
71
|
+
if (err instanceof AuthApiError) {
|
|
72
|
+
trackEvent("audit_otp_verified", {
|
|
73
|
+
status: "failed",
|
|
74
|
+
source: "dashboard",
|
|
75
|
+
error_code: err.code,
|
|
76
|
+
http_status: err.status,
|
|
77
|
+
});
|
|
78
|
+
// AuthApiError uses `status: 0` for client-side timeouts; map those to
|
|
79
|
+
// 504 so NextResponse.json doesn't reject with a RangeError.
|
|
80
|
+
const httpStatus = err.status >= 200 && err.status < 600 ? err.status : 504;
|
|
81
|
+
return NextResponse.json(
|
|
82
|
+
{ code: err.code, message: err.message },
|
|
83
|
+
{ status: httpStatus },
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
87
|
+
trackEvent("audit_otp_verified", {
|
|
88
|
+
status: "failed",
|
|
89
|
+
source: "dashboard",
|
|
90
|
+
error_code: "upstream_unreachable",
|
|
91
|
+
error_message: message.slice(0, 200),
|
|
92
|
+
});
|
|
93
|
+
return NextResponse.json(
|
|
94
|
+
{ code: "upstream_unreachable", message: `api-server unreachable: ${message}` },
|
|
95
|
+
{ status: 502 },
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/auth/logout
|
|
3
|
+
*
|
|
4
|
+
* Reads the locally-stored session, asks the api-server to revoke it, and
|
|
5
|
+
* deletes ~/.failproofai/auth.json regardless of upstream success — local
|
|
6
|
+
* intent to log out takes precedence.
|
|
7
|
+
*/
|
|
8
|
+
import { NextResponse } from "next/server";
|
|
9
|
+
import { AuthApiError, logoutSession } from "@/lib/auth/api-server-client";
|
|
10
|
+
import { deleteAuth, readAuth } from "@/lib/auth/auth-store";
|
|
11
|
+
import { initTelemetry, trackEvent } from "@/lib/telemetry";
|
|
12
|
+
|
|
13
|
+
export const dynamic = "force-dynamic";
|
|
14
|
+
|
|
15
|
+
export async function POST(): Promise<NextResponse> {
|
|
16
|
+
await initTelemetry();
|
|
17
|
+
const existing = readAuth();
|
|
18
|
+
if (!existing) {
|
|
19
|
+
trackEvent("audit_user_logged_out", {
|
|
20
|
+
source: "dashboard",
|
|
21
|
+
had_session: false,
|
|
22
|
+
upstream: "noop",
|
|
23
|
+
});
|
|
24
|
+
return NextResponse.json({ authenticated: false }, { status: 200 });
|
|
25
|
+
}
|
|
26
|
+
let upstream: "revoked" | "skipped" | "failed" = "skipped";
|
|
27
|
+
let upstreamError: string | null = null;
|
|
28
|
+
try {
|
|
29
|
+
await logoutSession(existing.access_token, existing.refresh_token);
|
|
30
|
+
upstream = "revoked";
|
|
31
|
+
} catch (err) {
|
|
32
|
+
if (err instanceof AuthApiError && err.status === 401) {
|
|
33
|
+
upstream = "revoked"; // token already invalid server-side
|
|
34
|
+
} else {
|
|
35
|
+
upstream = "failed";
|
|
36
|
+
upstreamError = err instanceof Error ? err.message.slice(0, 200) : String(err).slice(0, 200);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
deleteAuth();
|
|
40
|
+
trackEvent("audit_user_logged_out", {
|
|
41
|
+
source: "dashboard",
|
|
42
|
+
had_session: true,
|
|
43
|
+
upstream,
|
|
44
|
+
upstream_error: upstreamError,
|
|
45
|
+
user_id: existing.user.id,
|
|
46
|
+
});
|
|
47
|
+
return NextResponse.json({ authenticated: false, upstream }, { status: 200 });
|
|
48
|
+
}
|