failproofai 1.0.0-beta.2 → 1.0.0-beta.21
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 +2 -1
- package/.next/standalone/.next/build-manifest.json +6 -6
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +3 -3
- 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 +3 -1
- 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 +3 -3
- 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 +3 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- 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.js +3 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +4 -3
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +3 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +3 -2
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +3 -2
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js +3 -2
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js +3 -2
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +5 -3
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- 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 -2
- package/.next/standalone/.next/server/app/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +3 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +30 -18
- package/.next/standalone/.next/server/app/policies/page.js +5 -3
- 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 +3 -3
- 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 +4 -2
- 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 +3 -3
- 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 +6 -4
- 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 +3 -3
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +4 -2
- 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/settings/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +18 -0
- package/.next/standalone/.next/server/app/settings/page/next-font-manifest.json +6 -0
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +53 -0
- package/.next/standalone/.next/server/app/settings/page.js +18 -0
- package/.next/standalone/.next/server/app/settings/page.js.map +5 -0
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
- package/.next/standalone/.next/server/chunks/[externals]__0h9_83k._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[externals]__1nl3dvw._.js → [externals]__0r-zamh._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[externals]__1ifpkx-._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0l4vuqm._.js → [root-of-the-server]__00ni9za._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06hexd0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08y94xv._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__094p1f1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_0xu5z._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ed01_d._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-dh5jy._.js → [root-of-the-server]__0effm9m._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g0vcwt._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__18d-9oi._.js → [root-of-the-server]__0ix8gm7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0h3lfmp._.js → [root-of-the-server]__0ji11a-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__10oa-v9._.js → [root-of-the-server]__0ojwjxl._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__16le-kd._.js → [root-of-the-server]__0pbp9fe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q-v9z2._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vb5fl2._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0sb_5m8._.js → [root-of-the-server]__131ebum._.js} +4 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ibjy5x._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tvn4wf._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__20d06rh._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_telemetry_ts_0dctyyw._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +5 -5
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +2 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +2 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[externals]__1aq139v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-wfhrp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06bp_fg._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__074qmkp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1apb7k_._.js → [root-of-the-server]__0_1tiya._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__170799-._.js → [root-of-the-server]__0spkm68._.js} +11 -11
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t281d4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17itmx-._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__01od0m6._.js → [root-of-the-server]__1n2vcv4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1qapotl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1rv-sc9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tlvv9a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1u-wx42._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1v185mo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0-yi74u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0rjgfln._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0vo2qyt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0xej-0e._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_10399ge._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_149k9oy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1_hwp06._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1ctse6u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1e19atl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1mnhi_r._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1ror7k9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1sdgprl._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0dwo94s.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +2 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589g._.js +4 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +6 -6
- package/.next/standalone/.next/server/middleware.js +2 -2
- 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 +74 -20
- package/.next/standalone/.next/static/chunks/{03fmihek9n986.js → 06zgzyh3wv1ig.js} +1 -1
- package/.next/standalone/.next/static/chunks/0km-jn9o5xyqs.css +2 -0
- package/.next/standalone/.next/static/chunks/{1hdhteui932bq.js → 0qmo2t50kpb30.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2sbelanzvxvv0.js → 113g8wtal6_c4.js} +22 -22
- package/.next/standalone/.next/static/chunks/16p68cybetr31.js +1 -0
- package/.next/standalone/.next/static/chunks/18wqn0_3mzylf.js +1 -0
- package/.next/standalone/.next/static/chunks/1v1gqvpjk62jm.js +1 -0
- package/.next/standalone/.next/static/chunks/{0fi645si-uiiq.js → 1xq1m8h14tnlj.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3hp8ulqknybil.js → 1y3vwogqb88dx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3vs4ay36tjds_.js → 1zmh-b0ulrqu7.js} +1 -1
- package/.next/standalone/.next/static/chunks/23kev26by1e4f.js +1 -0
- package/.next/standalone/.next/static/chunks/299lhw60e8gr6.js +1 -0
- package/.next/standalone/.next/static/chunks/{18rvdw5v72364.js → 2adbpdaxp5ygq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2j94uwkb4s3qr.js → 2kbqcw-6swmav.js} +1 -1
- package/.next/standalone/.next/static/chunks/2n9n5m0963pdg.js +6 -0
- package/.next/standalone/.next/static/chunks/2uvhw57mf9lg_.css +2 -0
- package/.next/standalone/.next/static/chunks/{31feojxhjyjpl.js → 30nrrpwymht5m.js} +1 -1
- package/.next/standalone/.next/static/chunks/31coz11ia5vc4.js +1 -0
- package/.next/standalone/.next/static/chunks/{turbopack-1lsv92x7klwrn.js → turbopack-3diub4ctvn1n0.js} +1 -1
- package/.next/standalone/SECURITY.md +8 -2
- package/.next/standalone/app/actions/get-active-pauses.ts +16 -0
- package/.next/standalone/app/actions/get-hooks-config.ts +2 -2
- package/.next/standalone/app/actions/get-scheduled-audit.ts +70 -0
- package/.next/standalone/app/actions/update-scheduled-audit.ts +44 -0
- package/.next/standalone/app/api/audit/run/route.ts +28 -0
- package/.next/standalone/app/api/audit/status/route.ts +13 -1
- package/.next/standalone/app/api/auth/status/route.ts +1 -1
- package/.next/standalone/app/audit/_components/audit-dashboard.tsx +1 -3
- package/.next/standalone/app/audit/_components/audit-progress-strip.tsx +1 -1
- package/.next/standalone/app/audit/_components/auth-dialog.css +159 -0
- package/.next/standalone/app/audit/_components/auth-dialog.tsx +3 -0
- package/.next/standalone/app/audit/_components/come-back-better-section.tsx +1 -1
- package/.next/standalone/app/audit/_components/empty-state.tsx +0 -1
- package/.next/standalone/app/audit/_components/how-to-improve-section.tsx +1 -1
- package/.next/standalone/app/audit/_components/quirks-section.tsx +0 -1
- package/.next/standalone/app/audit/_components/report-footer.tsx +0 -2
- package/.next/standalone/app/audit/_components/run-progress.tsx +1 -1
- package/.next/standalone/app/audit/_components/strengths-section.tsx +0 -1
- package/.next/standalone/app/audit/audit-styles.css +6 -149
- package/.next/standalone/app/components/pause-notices.tsx +111 -0
- package/.next/standalone/app/components/raw-log-viewer.tsx +1 -1
- package/.next/standalone/app/components/toast.tsx +1 -1
- package/.next/standalone/app/policies/hooks-client.tsx +84 -8
- package/.next/standalone/app/settings/page.tsx +31 -0
- package/.next/standalone/app/settings/settings-client.tsx +487 -0
- package/.next/standalone/components/navbar.tsx +2 -0
- package/.next/standalone/lib/auth/api-server-client.ts +2 -3
- package/.next/standalone/lib/auth/auth-store.ts +4 -5
- package/.next/standalone/lib/codex-sessions.ts +2 -1
- package/.next/standalone/lib/dashboard-host.ts +101 -0
- package/.next/standalone/lib/install-check.ts +22 -7
- package/.next/standalone/lib/pi-sessions.ts +99 -14
- package/.next/standalone/lib/telemetry-enabled.ts +54 -0
- package/.next/standalone/lib/telemetry-id.ts +52 -1
- package/.next/standalone/lib/telemetry.ts +8 -4
- 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 +3 -3
- 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 +4 -4
- package/.next/standalone/package.json +23 -12
- package/.next/standalone/proxy.ts +111 -1
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai-worker.mjs +1 -1
- package/bin/failproofai.mjs +1041 -81
- package/bin/failproofaid-shim.mjs +4 -4
- package/dist/cli.mjs +18513 -10474
- package/dist/worker.mjs +1223 -299
- package/lib/auth/api-server-client.ts +2 -3
- package/lib/auth/auth-store.ts +4 -5
- package/lib/codex-sessions.ts +2 -1
- package/lib/dashboard-host.ts +101 -0
- package/lib/install-check.ts +22 -7
- package/lib/pi-sessions.ts +99 -14
- package/lib/telemetry-enabled.ts +54 -0
- package/lib/telemetry-id.ts +52 -1
- package/lib/telemetry.ts +8 -4
- package/package.json +23 -12
- package/scripts/build-daemon-packages.mjs +247 -0
- package/scripts/daemon-platforms.mjs +42 -0
- package/scripts/dev-hook.mjs +46 -5
- package/scripts/install-telemetry.mjs +8 -1
- package/scripts/launch.ts +25 -3
- package/scripts/parse-script-args.ts +27 -1
- package/scripts/prune-standalone.mjs +26 -0
- package/scripts/publish-aliases.mjs +62 -41
- package/scripts/repro-npm-install.sh +155 -0
- package/scripts/translate-docs/cache.ts +1 -1
- package/scripts/translate-docs/cli.ts +2 -2
- package/scripts/translate-docs/mintlify-nav.ts +1 -1
- package/scripts/translate-docs/readme-translator.ts +163 -4
- package/scripts/validate-mdx.ts +153 -13
- package/src/audit/audit-lock.ts +285 -0
- package/src/audit/audit-schedule.ts +111 -0
- package/src/audit/cache.ts +18 -5
- package/src/audit/cli-adapters/goose.ts +2 -1
- package/src/audit/cli-adapters/hermes.ts +28 -10
- package/src/audit/cli.ts +191 -35
- package/src/audit/dashboard-cache.ts +2 -3
- package/src/audit/report.ts +0 -1
- package/src/hooks/backfill-cli.ts +247 -0
- package/src/hooks/builtin-policies.ts +391 -3
- package/src/hooks/cloud-connection.ts +354 -0
- package/src/hooks/cloud-enrollment-cli.ts +439 -0
- package/src/hooks/cloud-enrollment.ts +284 -0
- package/src/hooks/cloud-introspect.ts +147 -0
- package/src/hooks/cloud-managed-policies.ts +206 -0
- package/src/hooks/collector-config.ts +218 -0
- package/src/hooks/configure-wizard.ts +1211 -233
- package/src/hooks/custom-hooks-loader.ts +243 -37
- package/src/hooks/daemon-client.ts +136 -33
- package/src/hooks/daemon-download.ts +264 -31
- package/src/hooks/daemon-service.ts +1124 -76
- package/src/hooks/first-run-gate.ts +50 -0
- package/src/hooks/flush-cli.ts +180 -0
- package/src/hooks/fp-config.ts +835 -0
- package/src/hooks/fp-home.ts +714 -0
- package/src/hooks/fp-reset.ts +1363 -0
- package/src/hooks/handler.ts +185 -6
- package/src/hooks/harness-cli.ts +386 -0
- package/src/hooks/hook-activity-store.ts +171 -24
- package/src/hooks/hook-logger.ts +2 -2
- package/src/hooks/hook-telemetry.ts +5 -1
- package/src/hooks/hooks-config.ts +4 -3
- package/src/hooks/integrations.ts +0 -1
- package/src/hooks/loader-utils.ts +172 -9
- package/src/hooks/manager.ts +41 -5
- package/src/hooks/migrations.ts +450 -0
- package/src/hooks/onboarding-attempt.ts +195 -0
- package/src/hooks/onboarding-lock.ts +118 -0
- package/src/hooks/policy-types.ts +28 -0
- package/src/hooks/session-pause-cli.ts +159 -0
- package/src/hooks/session-pause.ts +267 -0
- package/src/hooks/setup-state.ts +256 -0
- package/src/hooks/tui.ts +209 -9
- package/src/hooks/uninstall-cli.ts +418 -0
- package/src/hooks/worker-server.ts +134 -15
- package/.next/standalone/.next/server/chunks/[externals]__14odj07._.js +0 -3
- package/.next/standalone/.next/server/chunks/[externals]__1s61mel._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0id_xf7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0longh-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19120tr._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fwl2mz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1myjm-d._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1rhmvod._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[externals]__1_g_b3t._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0114ewg._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02r5bgf._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e8sjqm._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lkzqax._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nb0syg._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qucxyj._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u02miy._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uno39i._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14dd6h8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ath6v_._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1psjybo._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1zqz4v8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_1m_p7pi._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_html-to-image_es_index_0oy_-36.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1ezd2jf._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1tnuifj._.js +0 -5
- package/.next/standalone/.next/static/chunks/0h7auy7hzjyhw.js +0 -1
- package/.next/standalone/.next/static/chunks/0zbxssxh53n-3.js +0 -1
- package/.next/standalone/.next/static/chunks/2mazwb1qmur1p.js +0 -1
- package/.next/standalone/.next/static/chunks/2pujpnfx4pws6.css +0 -2
- package/.next/standalone/.next/static/chunks/33u59vf_8xpd-.js +0 -1
- package/.next/standalone/.next/static/chunks/3i27c3hcriawq.css +0 -1
- package/.next/standalone/.next/static/chunks/3s7myk_co0gbh.js +0 -1
- package/.next/standalone/.next/static/chunks/40k1_v4os4cw6.js +0 -6
- package/.next/standalone/Cargo.lock +0 -428
- package/.next/standalone/Cargo.toml +0 -9
- package/.next/standalone/crates/PROTOCOL.md +0 -122
- package/.next/standalone/crates/failproofaid/Cargo.toml +0 -18
- package/.next/standalone/crates/failproofaid/src/lock.rs +0 -81
- package/.next/standalone/crates/failproofaid/src/main.rs +0 -83
- package/.next/standalone/crates/failproofaid/src/paths.rs +0 -172
- package/.next/standalone/crates/failproofaid/src/server.rs +0 -502
- package/.next/standalone/crates/failproofaid/src/worker.rs +0 -400
- package/.next/standalone/crates/failproofaid/tests/daemon_e2e.rs +0 -241
- package/.next/standalone/crates/fpai-ipc/Cargo.toml +0 -16
- package/.next/standalone/crates/fpai-ipc/src/envelope.rs +0 -175
- package/.next/standalone/crates/fpai-ipc/src/framing.rs +0 -177
- package/.next/standalone/crates/fpai-ipc/src/lib.rs +0 -10
- package/.next/standalone/crates/fpai-ipc/src/peer.rs +0 -80
- package/.next/standalone/docker-hook-sync/Dockerfile +0 -79
- package/.next/standalone/docker-hook-sync/entrypoint.sh +0 -109
- package/.next/standalone/integration-suite/Dockerfile +0 -47
- package/.next/standalone/integration-suite/README.md +0 -129
- package/.next/standalone/integration-suite/canary-policies.mjs +0 -45
- package/.next/standalone/integration-suite/capture-tokens.sh +0 -48
- package/.next/standalone/integration-suite/ci-entrypoint.sh +0 -179
- package/.next/standalone/integration-suite/inject-tokens.sh +0 -44
- package/.next/standalone/integration-suite/install-clis.sh +0 -136
- package/.next/standalone/integration-suite/probe-cli.sh +0 -248
- package/.next/standalone/integration-suite/report.js +0 -120
- package/.next/standalone/integration-suite/run.sh +0 -159
- package/.next/standalone/openclaw-plugin/index.js +0 -223
- package/.next/standalone/openclaw-plugin/openclaw.plugin.json +0 -6
- package/.next/standalone/openclaw-plugin/package.json +0 -12
- package/.next/standalone/osv-scanner.toml +0 -17
- package/.next/standalone/pi-extension/index.ts +0 -524
- package/.next/standalone/pi-extension/package.json +0 -12
- package/.next/standalone/postcss.config.mjs +0 -8
- package/.next/standalone/readme-arch-hq.gif +0 -0
- package/.next/standalone/rust-toolchain.toml +0 -4
- package/src/auth/cli.ts +0 -371
- /package/.next/standalone/.next/static/{NWAjs0tHFyzk97gRGG09r → VjEdIL6W5uBsvEzknXqV9}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{NWAjs0tHFyzk97gRGG09r → VjEdIL6W5uBsvEzknXqV9}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{NWAjs0tHFyzk97gRGG09r → VjEdIL6W5uBsvEzknXqV9}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/0zbxssxh53n-3.js","static/chunks/1__i9af9g78vd.js","static/chunks/3kmwfieo15mr2.js","static/chunks/31fmsp1soxi07.js","static/chunks/03fmihek9n986.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=function(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let e=document?.currentScript?.getAttribute?.("src")??"",t=e.indexOf("?");return t>=0?e.slice(t):""}(),n=["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];var o,i=((o=i||{})[o.Runtime=0]="Runtime",o[o.Parent=1]="Parent",o[o.Update=2]="Update",o);let l=new WeakMap;function s(e,t){this.m=e,this.e=t}let u=s.prototype,a=Object.prototype.hasOwnProperty,c="u">typeof Symbol&&Symbol.toStringTag;function f(e,t,r){a.call(e,t)||Object.defineProperty(e,t,r)}function p(e,t){let r=e[t];return r||(r=h(t),e[t]=r),r}function h(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function d(e,t){f(e,"__esModule",{value:!0}),c&&f(e,c,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)f(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?f(e,n,{get:o,set:t[r++],enumerable:!0}):f(e,n,{get:o,enumerable:!0})}Object.seal(e)}function m(e,t){(null!=t?p(this.c,t):this.m).exports=e}u.s=function(e,t){let r,n;null!=t?n=(r=p(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,d(n,e)},u.j=function(e,t){var r,n;let o,i,s;null!=t?i=(o=p(this.c,t)).exports:(o=this.m,i=this.e);let u=(r=o,n=i,(s=l.get(r))||(l.set(r,s=[]),r.exports=r.namespaceObject=new Proxy(n,{get(e,t){if(a.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of s){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of s)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),s);"object"==typeof e&&null!==e&&u.push(e)},u.v=m,u.n=function(e,t){let r;(r=null!=t?p(this.c,t):this.m).exports=r.namespaceObject=e};let b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y=[null,b({}),b([]),b(b)];function g(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!y.includes(t);t=b(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),d(t,n),t}function O(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=g(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function w(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function k(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}u.i=O,u.A=function(e){return this.r(e)(O.bind(this))},u.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},u.r=function(e){return B(e,this.m).exports},u.f=function(e){function t(t){if(t=w(t),a.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=w(t),a.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let j=Symbol("turbopack queues"),U=Symbol("turbopack exports"),v=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}u.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:i,reject:l,promise:s}=k(),u=Object.assign(s,{[U]:r.exports,[j]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[U]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(j in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[U]:{},[j]:e=>e(t)};return e.then(e=>{r[U]=e,C(t)},e=>{r[v]=e,C(t)}),r}}return{[U]:e,[j]:()=>{}}}),r=()=>t.map(e=>{if(e[v])throw e[v];return e[U]}),{promise:i,resolve:l}=k(),s=Object.assign(()=>l(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[j](u)),s.queueCount?i:r()},function(e){e?l(u[v]=e):i(u[U]),C(n)}),n&&-1===n.status&&(n.status=0)};let P=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}P.prototype=URL.prototype,u.U=P,u.z=function(e){throw Error("dynamic usage of require is not supported")},u.g=globalThis;let S=s.prototype,$=new Map;u.M=$;let _=new Map,E=new Map;async function T(e,t,r){let n;if("string"==typeof r)return M(e,t,N(r));let o=r.included||[],i=o.map(e=>!!$.has(e)||_.get(e));if(i.length>0&&i.every(e=>e))return void await Promise.all(i);let l=r.moduleChunks||[],s=l.map(e=>E.get(e)).filter(e=>e);if(s.length>0){if(s.length===l.length)return void await Promise.all(s);let r=new Set;for(let e of l)E.has(e)||r.add(e);for(let n of r){let r=M(e,t,N(n));E.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=M(e,t,N(r.path)),l))E.has(o)||E.set(o,n)}for(let e of o)_.has(e)||_.set(e,n);await n}S.l=function(e){return T(i.Parent,this.m.id,e)};let x=Promise.resolve(void 0),A=new WeakMap;function M(t,r,n){let o=e.loadChunkCached(t,n),l=A.get(o);if(void 0===l){let e=A.set.bind(A,o,x);l=o.then(e).catch(e=>{let o;switch(t){case i.Runtime:o=`as a runtime dependency of chunk ${r}`;break;case i.Parent:o=`from module ${r}`;break;case i.Update:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),A.set(o,l)}return l}function N(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}S.L=function(e){return M(i.Parent,this.m.id,e)},S.R=function(e){let t=this.r(e);return t?.default??t},S.P=function(e){return`/ROOT/${e??""}`},S.q=function(e,t){m.call(this,`${e}${r}`,t)},S.b=function(e,t,o,i){let l="SharedWorker"===e.name,s=[o.map(e=>N(e)).reverse(),r];for(let e of n)s.push(globalThis[e]);let u=new URL(N(t),location.origin),a=JSON.stringify(s);return l?u.searchParams.set("params",a):u.hash="#params="+encodeURIComponent(a),new e(u,i?{...i,type:void 0}:void 0)};let K=/\.js(?:\?[^#]*)?(?:#.*)?$/,q=/\.css(?:\?[^#]*)?(?:#.*)?$/;function L(e){return q.test(e)}u.w=function(t,r,n){return e.loadWebAssembly(i.Parent,this.m.id,t,r,n)},u.u=function(t,r){return e.loadWebAssemblyModule(i.Parent,this.m.id,t,r)};let I={};u.c=I;let B=(e,t)=>{let r=I[e];if(r){if(r.error)throw r.error;return r}return W(e,i.Parent,t.id)};function W(e,t,r){let n=$.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let o=h(e),i=o.exports;I[e]=o;let l=new s(o,i);try{n(l,o,i)}catch(e){throw o.error=e,e}return o.namespaceObject&&o.exports!==o.namespaceObject&&g(o.exports,o.namespaceObject),o}function F(t){let r,n=function(e){if("string"==typeof e)return e;if(e)return{src:e.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}(t[0]);return 2===t.length?r=t[1]:(r=void 0,!function(e,t){let r=1;for(;r<e.length;){let n,o=r+1;for(;o<e.length&&"function"!=typeof e[o];)o++;if(o===e.length)throw Error("malformed chunk format, expected a factory function");let i=e[o];for(let i=r;i<o;i++){let r=e[i],o=t.get(r);if(o){n=o;break}}let l=n??i,s=!1;for(let n=r;n<o;n++){let r=e[n];t.has(r)||(s||(l===i&&Object.defineProperty(i,"name",{value:"module evaluation"}),s=!0),t.set(r,l))}r=o+1}}(t,$)),e.registerChunk(n,r)}let X=new Map;function D(e){let t=X.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},X.set(e,t)}return t}e={async registerChunk(e,r){let n=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(e.src.replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(e);if(D("string"==typeof e?N(e):e.src).resolve(),null!=r){for(let e of r.otherChunks)D(N("string"==typeof e?e:e.path));if(await Promise.all(r.otherChunks.map(e=>T(i.Runtime,n,e))),r.runtimeModuleIds.length>0)for(let e of r.runtimeModuleIds)!function(e,t){let r=I[t];if(r){if(r.error)throw r.error;return}W(t,i.Runtime,e)}(n,e)}},loadChunkCached:(e,t)=>(function(e,t){let r=D(t);if(r.loadingStarted)return r.promise;if(e===i.Runtime)return r.loadingStarted=!0,L(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(L(t));else if(K.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(L(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(K.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let i=fetch(N(r)),{instance:l}=await WebAssembly.instantiateStreaming(i,o);return l.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(N(r));return await WebAssembly.compileStreaming(o)}};let H=globalThis.TURBOPACK;globalThis.TURBOPACK={push:F},H.forEach(F)})();
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/31coz11ia5vc4.js","static/chunks/1__i9af9g78vd.js","static/chunks/3kmwfieo15mr2.js","static/chunks/31fmsp1soxi07.js","static/chunks/06zgzyh3wv1ig.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=function(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let e=document?.currentScript?.getAttribute?.("src")??"",t=e.indexOf("?");return t>=0?e.slice(t):""}(),n=["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];var o,i=((o=i||{})[o.Runtime=0]="Runtime",o[o.Parent=1]="Parent",o[o.Update=2]="Update",o);let l=new WeakMap;function s(e,t){this.m=e,this.e=t}let u=s.prototype,a=Object.prototype.hasOwnProperty,c="u">typeof Symbol&&Symbol.toStringTag;function f(e,t,r){a.call(e,t)||Object.defineProperty(e,t,r)}function p(e,t){let r=e[t];return r||(r=h(t),e[t]=r),r}function h(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function d(e,t){f(e,"__esModule",{value:!0}),c&&f(e,c,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)f(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?f(e,n,{get:o,set:t[r++],enumerable:!0}):f(e,n,{get:o,enumerable:!0})}Object.seal(e)}function m(e,t){(null!=t?p(this.c,t):this.m).exports=e}u.s=function(e,t){let r,n;null!=t?n=(r=p(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,d(n,e)},u.j=function(e,t){var r,n;let o,i,s;null!=t?i=(o=p(this.c,t)).exports:(o=this.m,i=this.e);let u=(r=o,n=i,(s=l.get(r))||(l.set(r,s=[]),r.exports=r.namespaceObject=new Proxy(n,{get(e,t){if(a.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of s){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of s)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),s);"object"==typeof e&&null!==e&&u.push(e)},u.v=m,u.n=function(e,t){let r;(r=null!=t?p(this.c,t):this.m).exports=r.namespaceObject=e};let b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y=[null,b({}),b([]),b(b)];function g(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!y.includes(t);t=b(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),d(t,n),t}function w(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=g(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function O(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function k(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}u.i=w,u.A=function(e){return this.r(e)(w.bind(this))},u.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},u.r=function(e){return B(e,this.m).exports},u.f=function(e){function t(t){if(t=O(t),a.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=O(t),a.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let j=Symbol("turbopack queues"),v=Symbol("turbopack exports"),U=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}u.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:i,reject:l,promise:s}=k(),u=Object.assign(s,{[v]:r.exports,[j]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[v]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(j in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[v]:{},[j]:e=>e(t)};return e.then(e=>{r[v]=e,C(t)},e=>{r[U]=e,C(t)}),r}}return{[v]:e,[j]:()=>{}}}),r=()=>t.map(e=>{if(e[U])throw e[U];return e[v]}),{promise:i,resolve:l}=k(),s=Object.assign(()=>l(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[j](u)),s.queueCount?i:r()},function(e){e?l(u[U]=e):i(u[v]),C(n)}),n&&-1===n.status&&(n.status=0)};let P=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}P.prototype=URL.prototype,u.U=P,u.z=function(e){throw Error("dynamic usage of require is not supported")},u.g=globalThis;let S=s.prototype,$=new Map;u.M=$;let _=new Map,E=new Map;async function T(e,t,r){let n;if("string"==typeof r)return M(e,t,N(r));let o=r.included||[],i=o.map(e=>!!$.has(e)||_.get(e));if(i.length>0&&i.every(e=>e))return void await Promise.all(i);let l=r.moduleChunks||[],s=l.map(e=>E.get(e)).filter(e=>e);if(s.length>0){if(s.length===l.length)return void await Promise.all(s);let r=new Set;for(let e of l)E.has(e)||r.add(e);for(let n of r){let r=M(e,t,N(n));E.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=M(e,t,N(r.path)),l))E.has(o)||E.set(o,n)}for(let e of o)_.has(e)||_.set(e,n);await n}S.l=function(e){return T(i.Parent,this.m.id,e)};let A=Promise.resolve(void 0),x=new WeakMap;function M(t,r,n){let o=e.loadChunkCached(t,n),l=x.get(o);if(void 0===l){let e=x.set.bind(x,o,A);l=o.then(e).catch(e=>{let o;switch(t){case i.Runtime:o=`as a runtime dependency of chunk ${r}`;break;case i.Parent:o=`from module ${r}`;break;case i.Update:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),x.set(o,l)}return l}function N(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}S.L=function(e){return M(i.Parent,this.m.id,e)},S.R=function(e){let t=this.r(e);return t?.default??t},S.P=function(e){return`/ROOT/${e??""}`},S.q=function(e,t){m.call(this,`${e}${r}`,t)},S.b=function(e,t,o,i){let l="SharedWorker"===e.name,s=[o.map(e=>N(e)).reverse(),r];for(let e of n)s.push(globalThis[e]);let u=new URL(N(t),location.origin),a=JSON.stringify(s);return l?u.searchParams.set("params",a):u.hash="#params="+encodeURIComponent(a),new e(u,i?{...i,type:void 0}:void 0)};let K=/\.js(?:\?[^#]*)?(?:#.*)?$/,q=/\.css(?:\?[^#]*)?(?:#.*)?$/;function L(e){return q.test(e)}u.w=function(t,r,n){return e.loadWebAssembly(i.Parent,this.m.id,t,r,n)},u.u=function(t,r){return e.loadWebAssemblyModule(i.Parent,this.m.id,t,r)};let I={};u.c=I;let B=(e,t)=>{let r=I[e];if(r){if(r.error)throw r.error;return r}return W(e,i.Parent,t.id)};function W(e,t,r){let n=$.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let o=h(e),i=o.exports;I[e]=o;let l=new s(o,i);try{n(l,o,i)}catch(e){throw o.error=e,e}return o.namespaceObject&&o.exports!==o.namespaceObject&&g(o.exports,o.namespaceObject),o}function F(t){let r,n=function(e){if("string"==typeof e)return e;if(e)return{src:e.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}(t[0]);return 2===t.length?r=t[1]:(r=void 0,!function(e,t){let r=1;for(;r<e.length;){let n,o=r+1;for(;o<e.length&&"function"!=typeof e[o];)o++;if(o===e.length)throw Error("malformed chunk format, expected a factory function");let i=e[o];for(let i=r;i<o;i++){let r=e[i],o=t.get(r);if(o){n=o;break}}let l=n??i,s=!1;for(let n=r;n<o;n++){let r=e[n];t.has(r)||(s||(l===i&&Object.defineProperty(i,"name",{value:"module evaluation"}),s=!0),t.set(r,l))}r=o+1}}(t,$)),e.registerChunk(n,r)}let X=new Map;function D(e){let t=X.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},X.set(e,t)}return t}e={async registerChunk(e,r){let n=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(e.src.replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(e);if(D("string"==typeof e?N(e):e.src).resolve(),null!=r){for(let e of r.otherChunks)D(N("string"==typeof e?e:e.path));if(await Promise.all(r.otherChunks.map(e=>T(i.Runtime,n,e))),r.runtimeModuleIds.length>0)for(let e of r.runtimeModuleIds)!function(e,t){let r=I[t];if(r){if(r.error)throw r.error;return}W(t,i.Runtime,e)}(n,e)}},loadChunkCached:(e,t)=>(function(e,t){let r=D(t);if(r.loadingStarted)return r.promise;if(e===i.Runtime)return r.loadingStarted=!0,L(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(L(t));else if(K.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(L(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(K.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let i=fetch(N(r)),{instance:l}=await WebAssembly.instantiateStreaming(i,o);return l.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(N(r));return await WebAssembly.compileStreaming(o)}};let H=globalThis.TURBOPACK;globalThis.TURBOPACK={push:F},H.forEach(F)})();
|
|
@@ -35,8 +35,10 @@ advisories **and** the [OpenSSF malicious-packages feed](https://github.com/ossf
|
|
|
35
35
|
|
|
36
36
|
**Policy: block on any finding.** The gate fails on *any* known-vulnerable or
|
|
37
37
|
malicious package in the tree — not just newly introduced ones. It runs on every
|
|
38
|
-
PR, on pushes to `main`, and
|
|
39
|
-
dependency was already merged).
|
|
38
|
+
PR, on pushes to `main`, and daily (to catch advisories disclosed after a
|
|
39
|
+
dependency was already merged). A daily run that fails on `main` — where there's
|
|
40
|
+
no PR author already looking at the check — also posts to Slack, via the
|
|
41
|
+
`SLACK_WEBHOOK_URL` repository secret.
|
|
40
42
|
|
|
41
43
|
### 2. Socket — behavioral early-warning
|
|
42
44
|
|
|
@@ -71,3 +73,7 @@ These steps live outside the repo and require admin access:
|
|
|
71
73
|
3. *(Optional)* For a Socket CI gate in addition to the App, add a
|
|
72
74
|
`SOCKET_SECURITY_API_KEY` repository secret and the Socket CI action — deferred
|
|
73
75
|
until tuned, since behavioral findings can have false positives.
|
|
76
|
+
4. **Slack alert on a failed daily scan**: set the `SLACK_WEBHOOK_URL` repository
|
|
77
|
+
secret to a Slack Incoming Webhook URL (the same secret `integration-suite`
|
|
78
|
+
already posts to). Without it, the daily job still runs and still fails CI on a
|
|
79
|
+
finding — it just skips the Slack POST and logs that the secret is unset.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
import { listActivePauses } from "@/src/hooks/session-pause";
|
|
4
|
+
import type { ActivePause } from "@/src/hooks/session-pause";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Sessions whose enforcement is paused right now.
|
|
8
|
+
*
|
|
9
|
+
* Read live rather than derived from activity rows: a pause set seconds ago has
|
|
10
|
+
* produced no rows yet, and that is exactly the moment someone needs to be told
|
|
11
|
+
* the machine is unguarded. Expiry is applied at read time, so an expired pause
|
|
12
|
+
* simply stops appearing.
|
|
13
|
+
*/
|
|
14
|
+
export async function getActivePausesAction(): Promise<ActivePause[]> {
|
|
15
|
+
return listActivePauses();
|
|
16
|
+
}
|
|
@@ -11,8 +11,8 @@ import { customPolicyId, conventionPolicyId, discoverPolicyFiles } from "@/src/h
|
|
|
11
11
|
import { findProjectConfigDir } from "@/src/hooks/hooks-config";
|
|
12
12
|
import { readFile } from "node:fs/promises";
|
|
13
13
|
import { existsSync } from "node:fs";
|
|
14
|
-
import { homedir } from "node:os";
|
|
15
14
|
import { basename, resolve } from "node:path";
|
|
15
|
+
import { customPoliciesDir } from "@/src/hooks/fp-home";
|
|
16
16
|
|
|
17
17
|
export interface PolicyParamSpec {
|
|
18
18
|
type: string;
|
|
@@ -108,7 +108,7 @@ async function discoverConventionPolicies(
|
|
|
108
108
|
// resolving at the exact cwd disagrees with it from any subdirectory.
|
|
109
109
|
const launchCwd = process.env.FAILPROOFAI_LAUNCH_CWD || process.cwd();
|
|
110
110
|
const projectDir = resolve(findProjectConfigDir(launchCwd), ".failproofai", "policies");
|
|
111
|
-
const userDir =
|
|
111
|
+
const userDir = customPoliciesDir();
|
|
112
112
|
|
|
113
113
|
const dirs: { scope: "project" | "user"; dir: string }[] = [
|
|
114
114
|
{ scope: "project", dir: projectDir },
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read side of the /settings "Scheduled audit" section. Reads only — the write
|
|
5
|
+
* counterparts live in `update-scheduled-audit.ts`, mirroring the
|
|
6
|
+
* get-hooks-config / update-hooks-config split.
|
|
7
|
+
*
|
|
8
|
+
* ## CLI ⟷ dashboard parity (state it here so the two cannot silently diverge)
|
|
9
|
+
*
|
|
10
|
+
* Every field this returns is the same `config.toml` / state the CLI reads:
|
|
11
|
+
* - `auto` ⟷ `config.toml [audit] auto` (readConfig / updateConfig;
|
|
12
|
+
* the same key the `failproofai config` wizard sets)
|
|
13
|
+
* - `intervalDays` ⟷ `config.toml [audit] interval_days` (readConfig owns the
|
|
14
|
+
* 1..90 clamp — see fp-config.readIntervalDays)
|
|
15
|
+
* - `daemon` ⟷ `systemctl status failproofaid@<user>` (daemonServiceStatus)
|
|
16
|
+
* - `schedule` ⟷ `state/audit-schedule.json` (daemon-written; readAuditSchedule)
|
|
17
|
+
* There is no bespoke dashboard storage here: writing goes through the exact
|
|
18
|
+
* same `updateConfig` the CLI uses, so a value set on either side is identical.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { readConfig } from "@/src/hooks/fp-config";
|
|
22
|
+
import { readAuditSchedule } from "@/src/audit/audit-schedule";
|
|
23
|
+
import { daemonServiceStatus, type DaemonServiceStatus } from "@/src/hooks/daemon-service";
|
|
24
|
+
import { readDashboardCacheMeta } from "@/src/audit/dashboard-cache";
|
|
25
|
+
|
|
26
|
+
export interface ScheduledAuditSchedule {
|
|
27
|
+
nextDueAtMs: number | null;
|
|
28
|
+
lastAttemptAtMs: number | null;
|
|
29
|
+
lastRunAtMs: number | null;
|
|
30
|
+
lastExitCode: number | null;
|
|
31
|
+
schemaAhead: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ScheduledAuditView {
|
|
35
|
+
/** `[audit] auto` — whether the daemon scans on a timer. */
|
|
36
|
+
auto: boolean;
|
|
37
|
+
/** `[audit] interval_days`, already clamped to 1..90 by readConfig. */
|
|
38
|
+
intervalDays: number;
|
|
39
|
+
/** The systemd/launchd service state. The scheduler cannot run without a
|
|
40
|
+
* running daemon, so a settings page that hides this reads "on but silent". */
|
|
41
|
+
daemon: DaemonServiceStatus;
|
|
42
|
+
/** The daemon's persisted schedule, or null when no scheduled scan has run. */
|
|
43
|
+
schedule: ScheduledAuditSchedule | null;
|
|
44
|
+
/** ISO time of the most recent audit RESULT on disk (scheduled OR manual),
|
|
45
|
+
* or null if no audit has ever produced a dashboard. Distinct from
|
|
46
|
+
* `schedule.lastRunAtMs`, which is scheduled runs only. */
|
|
47
|
+
lastResultAt: string | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function getScheduledAuditAction(): Promise<ScheduledAuditView> {
|
|
51
|
+
const config = readConfig();
|
|
52
|
+
const schedule = readAuditSchedule();
|
|
53
|
+
const meta = readDashboardCacheMeta();
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
auto: config.audit.auto,
|
|
57
|
+
intervalDays: config.audit.intervalDays,
|
|
58
|
+
daemon: daemonServiceStatus(),
|
|
59
|
+
schedule: schedule
|
|
60
|
+
? {
|
|
61
|
+
nextDueAtMs: schedule.nextDueAtMs,
|
|
62
|
+
lastAttemptAtMs: schedule.lastAttemptAtMs,
|
|
63
|
+
lastRunAtMs: schedule.lastRunAtMs,
|
|
64
|
+
lastExitCode: schedule.lastExitCode,
|
|
65
|
+
schemaAhead: schedule.schemaAhead,
|
|
66
|
+
}
|
|
67
|
+
: null,
|
|
68
|
+
lastResultAt: meta?.cachedAt ?? null,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Write side of the /settings "Scheduled audit" section. Every write goes
|
|
5
|
+
* through `updateConfig` — never a raw file write — so the layout-2 config
|
|
6
|
+
* helpers stay the single writer of `config.toml` and the dashboard can never
|
|
7
|
+
* disagree with what the CLI reads.
|
|
8
|
+
*
|
|
9
|
+
* ## CLI ⟷ dashboard parity
|
|
10
|
+
* - `setAutoAuditAction(enabled)` ⟷ `[audit] auto` (updateConfig)
|
|
11
|
+
* - `setAuditIntervalAction(days)` ⟷ `[audit] interval_days` (updateConfig)
|
|
12
|
+
* Both keys are exactly what the `failproofai config` wizard writes, so a value
|
|
13
|
+
* set here is indistinguishable from one set on the CLI.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { readConfig, updateConfig } from "@/src/hooks/fp-config";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Turn the scheduled scan on or off.
|
|
20
|
+
*
|
|
21
|
+
* Returns the value actually stored (re-read), so an optimistic UI can confirm
|
|
22
|
+
* against the source of truth rather than assume its own guess landed.
|
|
23
|
+
*/
|
|
24
|
+
export async function setAutoAuditAction(enabled: boolean): Promise<{ auto: boolean }> {
|
|
25
|
+
const next = updateConfig({ audit: { auto: enabled } });
|
|
26
|
+
return { auto: next.audit.auto };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Set the days between scheduled scans.
|
|
31
|
+
*
|
|
32
|
+
* The clamp lives in `fp-config.readIntervalDays` (1..90, with 0/negatives/
|
|
33
|
+
* fractions falling back to the default) and is DELIBERATELY not reimplemented
|
|
34
|
+
* here: we write the raw value and then RE-READ, so what we return to the UI is
|
|
35
|
+
* exactly what the config decided to keep. Reflecting the re-read value is how a
|
|
36
|
+
* hand-typed 3650 shows up in the dashboard as the 90 the config actually
|
|
37
|
+
* enforces, with no second copy of the bounds to drift.
|
|
38
|
+
*/
|
|
39
|
+
export async function setAuditIntervalAction(days: number): Promise<{ intervalDays: number }> {
|
|
40
|
+
updateConfig({ audit: { intervalDays: days } });
|
|
41
|
+
// Re-read through readConfig so the returned value carries the config's own
|
|
42
|
+
// clamp, not the raw input.
|
|
43
|
+
return { intervalDays: readConfig().audit.intervalDays };
|
|
44
|
+
}
|
|
@@ -17,6 +17,7 @@ import { writeDashboardCache } from "@/src/audit/dashboard-cache";
|
|
|
17
17
|
import { INTEGRATION_TYPES, type IntegrationType } from "@/src/hooks/types";
|
|
18
18
|
import type { RunAuditOptions } from "@/src/audit/types";
|
|
19
19
|
import { finishRun, tryAcquireRun } from "../_state";
|
|
20
|
+
import { acquireAuditLock } from "@/src/audit/audit-lock";
|
|
20
21
|
import { initTelemetry, trackEvent } from "@/lib/telemetry";
|
|
21
22
|
import { sanitizeErrorMessage } from "@/lib/telemetry-sanitize";
|
|
22
23
|
|
|
@@ -90,6 +91,26 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
|
|
|
90
91
|
);
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
// The in-memory lock above only serialises runs WITHIN this Next.js process.
|
|
95
|
+
// The scheduled daemon child and a manual `failproofai audit` are separate
|
|
96
|
+
// processes writing the same sha1-keyed per-transcript cache and the same
|
|
97
|
+
// single-slot dashboard cache — three writers, and the module singleton is
|
|
98
|
+
// blind to the other two. Take the cross-process lock as well so this run
|
|
99
|
+
// cannot co-write that cache with one of them. Held ⇒ back the in-memory lock
|
|
100
|
+
// out and report "already running" — the same 409 the client already treats
|
|
101
|
+
// as "poll the in-flight run"; /api/audit/status reflects the cross-process
|
|
102
|
+
// lock via readActiveAuditLock, so the poll waits out the external scan rather
|
|
103
|
+
// than reading the machine as idle. This is information, not an error.
|
|
104
|
+
const auditLock = acquireAuditLock("dashboard");
|
|
105
|
+
if (!auditLock.ok) {
|
|
106
|
+
finishRun(null); // release the in-memory lock we just took
|
|
107
|
+
trackEvent("audit_run_rejected", { source: "dashboard", reason: "cross_process_lock" });
|
|
108
|
+
return NextResponse.json(
|
|
109
|
+
{ error: "Audit already running", status: "already-running" },
|
|
110
|
+
{ status: 409 },
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
93
114
|
// Mirror the CLI's cli_audit_* funnel for the dashboard path (which shares the
|
|
94
115
|
// same runAudit() core but previously emitted no server telemetry at all).
|
|
95
116
|
trackEvent("audit_run_started", {
|
|
@@ -133,6 +154,13 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
|
|
|
133
154
|
error_message: sanitizeErrorMessage(err),
|
|
134
155
|
});
|
|
135
156
|
finishRun(err instanceof Error ? err.message : String(err));
|
|
157
|
+
} finally {
|
|
158
|
+
// Release the cross-process lock the moment the scan settles — before the
|
|
159
|
+
// in-memory lock is even relevant again — so the next scheduled tick or a
|
|
160
|
+
// `failproofai audit` is not locked out longer than the scan actually ran.
|
|
161
|
+
// Idempotent and never throws; the process-exit hook is the backstop if
|
|
162
|
+
// this task is killed outright.
|
|
163
|
+
auditLock.lock.release();
|
|
136
164
|
}
|
|
137
165
|
})();
|
|
138
166
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { NextResponse } from "next/server";
|
|
10
10
|
import { readDashboardCache } from "@/src/audit/dashboard-cache";
|
|
11
|
+
import { readActiveAuditLock } from "@/src/audit/audit-lock";
|
|
11
12
|
import { getRunState } from "../_state";
|
|
12
13
|
|
|
13
14
|
export const dynamic = "force-dynamic";
|
|
@@ -15,8 +16,19 @@ export const dynamic = "force-dynamic";
|
|
|
15
16
|
export async function GET(): Promise<NextResponse> {
|
|
16
17
|
const state = getRunState();
|
|
17
18
|
const cache = readDashboardCache();
|
|
19
|
+
// `running` must answer "is a scan running on this MACHINE", not just "in this
|
|
20
|
+
// process". The in-memory state only sees dashboard-initiated runs; a
|
|
21
|
+
// scheduled daemon child or a `failproofai audit` writes the same cache from
|
|
22
|
+
// another process and holds the cross-process lock instead. Fold that in so a
|
|
23
|
+
// client polling after a 409 (or the settings page on mount) sees the machine
|
|
24
|
+
// as busy and waits it out, rather than reading idle and clobbering a live
|
|
25
|
+
// scan's cache. `readActiveAuditLock` applies the same dead-pid/age staleness
|
|
26
|
+
// rules as acquire, so a crashed run's leftover lockfile never wedges this at
|
|
27
|
+
// "running" forever.
|
|
28
|
+
const externalLock = readActiveAuditLock();
|
|
29
|
+
const externallyRunning = externalLock !== null && externalLock.pid !== process.pid;
|
|
18
30
|
return NextResponse.json({
|
|
19
|
-
running: state.running,
|
|
31
|
+
running: state.running || externallyRunning,
|
|
20
32
|
startedAt: state.startedAt ?? null,
|
|
21
33
|
cachedAt: cache?.cachedAt ?? null,
|
|
22
34
|
error: state.error,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Returns the currently signed-in identity by reading the local
|
|
5
5
|
* `~/.failproofai/auth.json` cache. No round-trip to the api-server — the
|
|
6
|
-
* file is the source of truth
|
|
6
|
+
* file is the source of truth for who is signed in on this machine.
|
|
7
7
|
* This keeps the dashboard UI and the CLI consistent regardless of whether
|
|
8
8
|
* the api-server is reachable.
|
|
9
9
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Empty / running states fall back to EmptyState and RunProgress.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
18
18
|
import { getAuditResultAction } from "@/app/actions/get-audit-result";
|
|
19
19
|
import type { AuditResult, RunAuditOptions } from "@/src/audit/types";
|
|
20
20
|
import { classifyAgent } from "@/src/audit/archetypes";
|
|
@@ -227,8 +227,6 @@ export function AuditDashboard({ initial, projectFromUrl, totalCatalogSize }: Pr
|
|
|
227
227
|
const result = cache.status === "cached" ? cache.result : null;
|
|
228
228
|
if (!result) return null;
|
|
229
229
|
const cachedAt = cache.status === "cached" ? cache.cachedAt : null;
|
|
230
|
-
const params = cache.status === "cached" ? cache.params : undefined;
|
|
231
|
-
|
|
232
230
|
/* ---- scanned but zero sessions --------------------------------- */
|
|
233
231
|
if (result.transcripts.scanned === 0) {
|
|
234
232
|
return (
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Reuses the existing `RerunError.kind` discrimination to render a red
|
|
16
16
|
* error strip with kind-specific copy when a run dies.
|
|
17
17
|
*/
|
|
18
|
-
import
|
|
18
|
+
import { useEffect, useState } from "react";
|
|
19
19
|
import type { RerunError } from "./rerun-button";
|
|
20
20
|
|
|
21
21
|
export type RerunStatus =
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/* Styles for <AuthDialog> — co-located with the component and imported by it,
|
|
2
|
+
* NOT living in a route stylesheet.
|
|
3
|
+
*
|
|
4
|
+
* Why here: the dialog was first used only on /audit, so these rules used to sit
|
|
5
|
+
* in audit-styles.css (route-scoped to /audit). The /settings page reuses the
|
|
6
|
+
* same component to lead a signed-out user into the existing OTP login flow, and
|
|
7
|
+
* a route stylesheet would not load there — the modal would render unstyled.
|
|
8
|
+
* Importing this file from auth-dialog.tsx makes the CSS travel with the
|
|
9
|
+
* component to every route that renders it. Every var below is defined in
|
|
10
|
+
* globals.css :root, so it resolves anywhere.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
.auth-dialog-backdrop {
|
|
14
|
+
position: fixed; inset: 0; z-index: 10000;
|
|
15
|
+
display: grid; place-items: center;
|
|
16
|
+
padding: 32px 16px;
|
|
17
|
+
background: rgba(8,8,10,0.7);
|
|
18
|
+
backdrop-filter: blur(6px);
|
|
19
|
+
-webkit-backdrop-filter: blur(6px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.auth-dialog {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
max-width: 420px;
|
|
26
|
+
padding: 28px 28px 24px;
|
|
27
|
+
border: 1px solid var(--line-2);
|
|
28
|
+
background: var(--bg-2);
|
|
29
|
+
font-family: var(--font-mono);
|
|
30
|
+
color: var(--ink);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.auth-close {
|
|
34
|
+
position: absolute; top: 12px; right: 14px;
|
|
35
|
+
font-family: var(--font-mono); font-size: 20px;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
color: var(--dim);
|
|
38
|
+
background: transparent; border: none; padding: 4px 8px;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
transition: color 120ms;
|
|
41
|
+
}
|
|
42
|
+
.auth-close:hover { color: var(--accent-pink); }
|
|
43
|
+
.auth-close:disabled { color: var(--line-2); cursor: not-allowed; }
|
|
44
|
+
|
|
45
|
+
.auth-headline {
|
|
46
|
+
font-family: var(--font-mono);
|
|
47
|
+
font-size: 18px;
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
letter-spacing: 0;
|
|
50
|
+
line-height: 1.3;
|
|
51
|
+
text-transform: none;
|
|
52
|
+
color: var(--ink);
|
|
53
|
+
margin: 0 0 8px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.auth-sub {
|
|
57
|
+
font-family: var(--font-mono); font-size: 12px;
|
|
58
|
+
line-height: 1.55; color: var(--ink-2);
|
|
59
|
+
margin: 0 0 18px;
|
|
60
|
+
}
|
|
61
|
+
.auth-sub .auth-email {
|
|
62
|
+
color: var(--accent-pink);
|
|
63
|
+
}
|
|
64
|
+
.auth-sub .auth-ok {
|
|
65
|
+
color: var(--accent-green);
|
|
66
|
+
margin-right: 6px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.auth-form { display: flex; flex-direction: column; gap: 10px; }
|
|
70
|
+
|
|
71
|
+
.auth-field-label {
|
|
72
|
+
font-family: var(--font-mono); font-size: 10px;
|
|
73
|
+
letter-spacing: 0.22em; text-transform: uppercase;
|
|
74
|
+
color: var(--accent-green);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.auth-input {
|
|
78
|
+
width: 100%;
|
|
79
|
+
padding: 11px 14px;
|
|
80
|
+
background: var(--bg);
|
|
81
|
+
border: 1px solid var(--line-2);
|
|
82
|
+
color: var(--ink);
|
|
83
|
+
font-family: var(--font-mono); font-size: 14px;
|
|
84
|
+
letter-spacing: 0.03em;
|
|
85
|
+
outline: none;
|
|
86
|
+
transition: border-color 120ms, box-shadow 120ms;
|
|
87
|
+
}
|
|
88
|
+
.auth-input:focus {
|
|
89
|
+
border-color: var(--accent-pink);
|
|
90
|
+
box-shadow: 0 0 0 1px var(--accent-pink-soft);
|
|
91
|
+
}
|
|
92
|
+
.auth-input:disabled {
|
|
93
|
+
opacity: 0.55; cursor: not-allowed;
|
|
94
|
+
}
|
|
95
|
+
.auth-input-code {
|
|
96
|
+
letter-spacing: 0.5em;
|
|
97
|
+
text-align: center;
|
|
98
|
+
font-size: 18px;
|
|
99
|
+
font-variant-numeric: tabular-nums;
|
|
100
|
+
}
|
|
101
|
+
.auth-input::placeholder { color: var(--dim); }
|
|
102
|
+
|
|
103
|
+
.auth-error {
|
|
104
|
+
font-family: var(--font-mono); font-size: 12px;
|
|
105
|
+
color: var(--accent-pink);
|
|
106
|
+
padding: 8px 12px;
|
|
107
|
+
background: var(--accent-pink-bg);
|
|
108
|
+
border: 1px solid var(--accent-pink);
|
|
109
|
+
border-left-width: 3px;
|
|
110
|
+
letter-spacing: 0.02em;
|
|
111
|
+
margin-top: 4px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.auth-actions {
|
|
115
|
+
display: flex; gap: 10px; flex-wrap: wrap;
|
|
116
|
+
margin-top: 14px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.auth-btn {
|
|
120
|
+
display: inline-flex; align-items: center; gap: 8px;
|
|
121
|
+
padding: 10px 16px;
|
|
122
|
+
font-family: var(--font-mono); font-size: 12px;
|
|
123
|
+
letter-spacing: 0.06em;
|
|
124
|
+
background: transparent;
|
|
125
|
+
border: 1px solid var(--line-2);
|
|
126
|
+
color: var(--ink);
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
transition: all 120ms ease;
|
|
129
|
+
}
|
|
130
|
+
.auth-btn:hover:not(:disabled) {
|
|
131
|
+
border-color: var(--ink); background: rgba(255,255,255,0.04);
|
|
132
|
+
}
|
|
133
|
+
.auth-btn:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
134
|
+
.auth-btn.primary {
|
|
135
|
+
border-color: var(--accent-pink);
|
|
136
|
+
color: var(--accent-pink);
|
|
137
|
+
background: var(--accent-pink-bg);
|
|
138
|
+
}
|
|
139
|
+
.auth-btn.primary:hover:not(:disabled) {
|
|
140
|
+
background: var(--accent-pink); color: var(--bg);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.auth-back {
|
|
144
|
+
align-self: flex-start;
|
|
145
|
+
margin-top: 4px;
|
|
146
|
+
background: transparent; border: none; padding: 6px 0;
|
|
147
|
+
font-family: var(--font-mono); font-size: 11px;
|
|
148
|
+
letter-spacing: 0.1em; color: var(--dim);
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
transition: color 120ms;
|
|
151
|
+
}
|
|
152
|
+
.auth-back:hover:not(:disabled) { color: var(--ink-2); }
|
|
153
|
+
.auth-back:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
154
|
+
|
|
155
|
+
@media (max-width: 520px) {
|
|
156
|
+
.auth-dialog { padding: 26px 22px 22px; }
|
|
157
|
+
.auth-actions { flex-direction: column; align-items: stretch; }
|
|
158
|
+
.auth-btn { justify-content: center; }
|
|
159
|
+
}
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
17
17
|
import { usePostHog } from "@/contexts/PostHogContext";
|
|
18
18
|
import { fetchWithTimeout, isAbortError } from "@/lib/fetch-with-timeout";
|
|
19
|
+
// Co-located so the dialog is styled on EVERY route that renders it (/audit and
|
|
20
|
+
// /settings), not only the one route stylesheet these rules used to live in.
|
|
21
|
+
import "./auth-dialog.css";
|
|
19
22
|
|
|
20
23
|
export interface AuthedUser {
|
|
21
24
|
id: string;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* link sits under the reminder card so the affordance survives without
|
|
19
19
|
* dominating the layout.
|
|
20
20
|
*/
|
|
21
|
-
import
|
|
21
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
22
22
|
import { usePostHog } from "@/contexts/PostHogContext";
|
|
23
23
|
import { isAbortError } from "@/lib/fetch-with-timeout";
|
|
24
24
|
import { AuthDialog, type AuthedUser } from "./auth-dialog";
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* sharp `.btn-press` action button. Sized so it occupies the same vertical
|
|
13
13
|
* space as the loaded dashboard does on its hero — no more cramped popover.
|
|
14
14
|
*/
|
|
15
|
-
import React from "react";
|
|
16
15
|
import { triggerRun } from "./rerun-button";
|
|
17
16
|
import { usePostHog } from "@/contexts/PostHogContext";
|
|
18
17
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* A single "install all" button at the section header copies the
|
|
11
11
|
* combined install command for every prescribed policy.
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import { useMemo, useState } from "react";
|
|
14
14
|
import type { AuditResult } from "@/src/audit/types";
|
|
15
15
|
import { type Grade, tierName } from "@/src/audit/scoring";
|
|
16
16
|
import { usePostHog } from "@/contexts/PostHogContext";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* pink "▮▮" / dim "○" markers, and a marquee progress bar at the bottom
|
|
17
17
|
* filling pink-on-dark as the run advances.
|
|
18
18
|
*/
|
|
19
|
-
import
|
|
19
|
+
import { useEffect, useState } from "react";
|
|
20
20
|
|
|
21
21
|
const STAGES = [
|
|
22
22
|
{ label: "discovering transcripts", detail: "walking ~/.claude, ~/.codex, ~/.cursor, …" },
|