failproofai 1.0.2-beta.3 → 1.0.2-beta.5
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/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/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.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 +6 -6
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- 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.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 +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +2 -3
- 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 +5 -6
- 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.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +2 -2
- 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 -4
- 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 +4 -4
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js +4 -4
- 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.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 +14 -14
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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.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 +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +2 -2
- 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 +2 -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 +2 -2
- 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.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/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__0e32-7c._.js → [externals]__1qzqcio._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03r-lqq._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_usx0j._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_zk340._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0oy4kxb._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zf034w._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12021ot._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1le9jqc._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0igxt32._.js → [root-of-the-server]__1p8poxd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1zkek3z._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +3 -0
- package/.next/standalone/.next/server/chunks/_12moi5-._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +6 -5
- package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +2 -2
- package/.next/standalone/.next/server/chunks/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_04op_ou._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_09d5c79._.js} +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +2 -2
- package/.next/standalone/.next/server/chunks/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_0dr20uz._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_1d2g73o._.js} +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1m84s36._.js → [root-of-the-server]__00-s7h8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07gm3zl._.js +4 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oa1lav._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s740oi._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__08zpry-._.js → [root-of-the-server]__0stn0gx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_hooks_08o7bqo._.js → [root-of-the-server]__15r6r7w._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0jzbk4_._.js → [root-of-the-server]__190won8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ctpynv._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0rsd3ll._.js → [root-of-the-server]__1sc84bb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tag8_-._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1ddpc5g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1db3-8n._.js → _1if9ixi._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_11opd9e._.js → _1kesqs-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_15xtekm._.js → _1km9-gn._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1u8-lu2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/lib_1cf5ya2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/lib_opencode-projects_ts_15bjxkm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_13n822a._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +2 -2
- package/.next/standalone/.next/server/middleware-build-manifest.js +6 -6
- package/.next/standalone/.next/server/middleware.js +1 -1
- 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 +19 -19
- package/.next/standalone/.next/static/chunks/0tyt-3a5rtzy8.js +1 -0
- package/.next/standalone/.next/static/chunks/{1mk3vmmc673hu.js → 21r7iw3rmixf5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{10pok-mrqv426.js → 26lfjhb2kzzgb.js} +1 -1
- package/.next/standalone/.next/static/chunks/2_27jraat038x.js +1 -0
- package/.next/standalone/.next/static/chunks/2hwc8e923g5df.js +1 -0
- package/.next/standalone/.next/static/chunks/{3cs_rf5p765v0.js → 33np9nrh1mvj9.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1oml7c7env4-g.js → 354-n7p7labpn.js} +1 -1
- package/.next/standalone/.next/static/chunks/36-8i_vbkh85w.js +1 -0
- package/.next/standalone/.next/static/chunks/{2jsomd79g7kn0.js → 391tpdqcas7rq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1yywl_a87108w.js → 3_b73tc78jwsq.js} +2 -2
- package/.next/standalone/.next/static/chunks/{1za08zjcctyil.js → 3i8rg2fv9nd6e.js} +2 -2
- package/.next/standalone/.next/static/chunks/{2ey_ih6j6cm15.js → 3jqm8ubpv3i-4.js} +1 -1
- package/.next/standalone/.next/static/chunks/turbopack-2x-o099q64i8h.js +1 -0
- package/.next/standalone/SECURITY.md +18 -3
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +7 -0
- package/.next/standalone/fp-cloud-cli/uv.lock +6 -6
- package/.next/standalone/lib/opencode-db.ts +77 -0
- package/.next/standalone/lib/opencode-projects.ts +37 -41
- package/.next/standalone/lib/opencode-sessions.ts +59 -36
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/client/components/segment-cache/cache.js +23 -34
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- 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/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- 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 +10 -10
- package/.next/standalone/package.json +19 -19
- package/.next/standalone/sdk/python/CHANGELOG.md +7 -0
- package/.next/standalone/sdk/python/uv.lock +23 -23
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +151 -60
- package/dist/cli.mjs +3670 -3005
- package/dist/worker.mjs +189 -164
- package/lib/opencode-db.ts +77 -0
- package/lib/opencode-projects.ts +37 -41
- package/lib/opencode-sessions.ts +59 -36
- package/package.json +19 -19
- package/src/audit/cache.ts +201 -40
- package/src/audit/cli-adapters/claude.ts +111 -1
- package/src/audit/cli-adapters/index.ts +31 -1
- package/src/audit/index.ts +131 -11
- package/src/audit/replay.ts +15 -91
- package/src/hooks/configure-wizard.ts +16 -48
- package/src/hooks/handler.ts +8 -1
- package/src/hooks/manager.ts +72 -3
- package/src/hooks/pack-cli.ts +793 -45
- package/src/hooks/pack-manifest.ts +28 -0
- package/src/hooks/pack-store.ts +8 -25
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01eqny5._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0neqlu-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t9oqnn._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l-khtb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mhmdzs._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qxztj-._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0bs-v8p._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0tovk6q._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +0 -3
- package/.next/standalone/.next/server/chunks/_185gyk9._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_hooks_0xbw3bu._.js +0 -12
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__192nhvh._.js +0 -5
- package/.next/standalone/.next/static/chunks/01nuy-aqshahr.js +0 -1
- package/.next/standalone/.next/static/chunks/1pl7h8vllvoi2.js +0 -1
- package/.next/standalone/.next/static/chunks/2efnffq2ipgr_.js +0 -1
- package/.next/standalone/.next/static/chunks/2gd07pinz0i7f.js +0 -1
- package/.next/standalone/.next/static/chunks/turbopack-3kjgdgwci4tqf.js +0 -1
- /package/.next/standalone/.next/static/{G-faMkpZioETgewZ4X4wX → 59jsH11LoyXu9UBoHvgGM}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{G-faMkpZioETgewZ4X4wX → 59jsH11LoyXu9UBoHvgGM}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{G-faMkpZioETgewZ4X4wX → 59jsH11LoyXu9UBoHvgGM}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[22712,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(35112),e=a.i(38246),f=a.i(52562),g=a.i(89027),h=a.i(64831);let i=(0,h.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var j=a.i(85650);let k=(0,h.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),l=(0,h.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var m=a.i(41476);let n=(0,h.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),o=(0,h.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),p=(0,h.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),q=(0,h.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]),r=(0,h.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),s=(0,h.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var t=a.i(74215),u=a.i(65967),v=a.i(5050);let w=(0,v.createServerReference)("40c1899398c3b2d82ad03f34d1082284acfb78169c",v.callServer,void 0,v.findSourceMapURL,"getHookActivityAction"),x=(0,v.createServerReference)("601128be367952aebe7ec7aa21aad14ae5d688a5d9",v.callServer,void 0,v.findSourceMapURL,"searchHookActivityAction"),y=(0,v.createServerReference)("006aea16111494bc400fed047698496e2e39962c06",v.callServer,void 0,v.findSourceMapURL,"getActivePausesAction");function z({pauses:a,now:d}){let[e,f]=(0,c.useState)(()=>Date.now());(0,c.useEffect)(()=>{let a=setInterval(()=>f(Date.now()),3e4);return()=>clearInterval(a)},[]);let g=d??e,h=a.filter(a=>a.expiresAt>g);if(0===h.length)return null;let i=h.reduce((a,b)=>a.expiresAt<b.expiresAt?a:b);return(0,b.jsxs)("div",{role:"status",className:"mb-4 flex items-start gap-2.5 rounded border border-amber-500/40 bg-amber-500/[0.07] px-3 py-2.5",children:[(0,b.jsx)(o,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"text-xs leading-relaxed",children:[(0,b.jsxs)("p",{className:"font-medium text-foreground",children:["Enforcement is paused for ",h.length," session",1===h.length?"":"s"," —"," ",function(a){if(a<=0)return"expiring now";if(a<6e4)return"under a minute";let b=Math.round(a/6e4);if(b<60)return`${b}m`;let c=Math.floor(b/60),d=b%60;return 0===d?`${c}h`:`${c}h${d}m`}(i.expiresAt-g)," left",h.length>1?" on the next to expire":"","."]}),(0,b.jsxs)("p",{className:"text-muted-foreground mt-0.5",children:["Builtin, custom and convention policies are suspended for"," ",1===h.length?"that session":"those sessions","; cloud-managed policies keep enforcing. It lifts on its own — or run"," ",(0,b.jsx)("span",{className:"font-mono text-foreground",children:"failproofai config --resume"}),"."]})]})]})}function A(){return(0,b.jsx)("span",{title:"Enforcement was paused for this session — local policies did not run",className:"ml-1.5 inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium uppercase tracking-wide border border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-500",children:"paused"})}function B({item:a}){if(!a.pausedBy)return null;let c="number"==typeof a.pauseExpiresAt?new Date(a.pauseExpiresAt).toLocaleTimeString():null;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(s,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:"Not enforced — paused."})," Enforcement was suspended for this session","cli"===a.pausedBy?" from the CLI":` by ${a.pausedBy}`,c?`, lifting at ${c}`:"",". Builtin, custom and convention policies did not run for this event; cloud-managed policies did."]})]})}let C=(0,v.createServerReference)("00ecf19a80ae980afffc0227ba012497276378189c",v.callServer,void 0,v.findSourceMapURL,"getHooksConfigAction"),D=(0,v.createServerReference)("6001784e6151b103d6a956411634184cc8564cac8d",v.callServer,void 0,v.findSourceMapURL,"toggleCustomPolicyAction"),E=(0,v.createServerReference)("006fafc8fcf8c29e0849fccaa9fd4dcf83228f497d",v.callServer,void 0,v.findSourceMapURL,"addBundledPackWebAction"),F=(0,v.createServerReference)("600a4764d8c2cd2d18385ea1096bbc8b04937e87f4",v.callServer,void 0,v.findSourceMapURL,"addPackWebAction"),G=(0,v.createServerReference)("407cbfda0f6f9efb93d0d2776d81e5cdca706a5b95",v.callServer,void 0,v.findSourceMapURL,"previewPackWebAction"),H=(0,v.createServerReference)("4077728d46edf93e8e7a7a12e12a0133d75e2f482d",v.callServer,void 0,v.findSourceMapURL,"removePackWebAction"),I=(0,v.createServerReference)("7054c0ebf510689097051ea8eac025179936d19cd2",v.callServer,void 0,v.findSourceMapURL,"togglePackPolicyAction"),J=(0,v.createServerReference)("60d56907ecb54ebda36c2fb0ca708c238ed343e4be",v.callServer,void 0,v.findSourceMapURL,"installHooksWebAction"),K=(0,v.createServerReference)("60f9538edb62e85285f0930c17f4660b6b425ec65f",v.callServer,void 0,v.findSourceMapURL,"removeHooksWebAction"),L=(0,v.createServerReference)("60eac4328e061dec056ce914994533f8d65261a19a",v.callServer,void 0,v.findSourceMapURL,"updatePolicyParamsAction");var M=a.i(6236),N=a.i(10765),O=a.i(90619),P=a.i(95947),Q=a.i(87256);let R={claude:{PreToolUse:"block",UserPromptSubmit:"block",PermissionRequest:"block",Stop:"block",SubagentStop:"block",PreCompact:"block",PostToolBatch:"block",ConfigChange:"block",UserPromptExpansion:"block",TaskCreated:"block",TaskCompleted:"block",TeammateIdle:"block",Elicitation:"block",ElicitationResult:"block",PostToolUse:"observe",PostToolUseFailure:"observe",SessionStart:"observe",Setup:"observe",SubagentStart:"observe",SessionEnd:"observe",StopFailure:"observe",PermissionDenied:"observe",Notification:"observe",InstructionsLoaded:"observe",CwdChanged:"observe",FileChanged:"observe",PostCompact:"observe",WorktreeRemove:"observe"},codex:{PreToolUse:"block",PermissionRequest:"block",UserPromptSubmit:"block",Stop:"block",SubagentStop:"block",PostToolUse:"block",SessionStart:"observe",SubagentStart:"observe",PreCompact:"observe",PostCompact:"observe"},copilot:{PreToolUse:"block",Stop:"block",SubagentStop:"block",UserPromptSubmit:"block",PermissionRequest:"block",PostToolUse:"block",SessionStart:"observe",SessionEnd:"observe",PostToolUseFailure:"observe",PreCompact:"observe",Notification:"observe"},cursor:{PreToolUse:"block",Stop:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},opencode:{PreToolUse:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",UserPromptSubmit:"observe",PermissionRequest:"observe"},pi:{PreToolUse:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",Stop:"observe"},hermes:{PreToolUse:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe"},openclaw:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",SubagentStop:"observe",PreCompact:"observe"},factory:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PreCompact:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe",Notification:"observe"},devin:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PermissionRequest:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},antigravity:{PreToolUse:"block",Stop:"block",PostToolUse:"observe",UserPromptSubmit:"observe"},goose:{PreToolUse:"block",UserPromptSubmit:"observe",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"}};var S=a.i(80977),T=a.i(40695);function U({sessionId:a,transcriptPath:c,integration:d,cwd:f}){if(!a)return(0,b.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let g=a?a.slice(0,8):"—",h="codex"===d||(c?.includes("/.codex/")??!1),i="copilot"===d||(c?.includes("/.copilot/session-state/")??!1),j="cursor"===d||(c?.includes("/.cursor/")??!1),k="opencode"===d||(c?.includes("/.local/share/opencode/")??!1)||(c?.includes("/.opencode/")??!1),l="pi"===d||(c?.includes("/.pi/")??!1);if(h||i||j||k||l){let c,d=f?(c=/^([A-Za-z]):[\\/](.*)$/.exec(f))?c[1]+"--"+c[2].replace(/[\\/]/g,"-"):f.replace(/[\\/]/g,"-"):h?"codex":i?"copilot":j?"cursor":k?"opencode":"pi";return(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(d)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g})}let m=c?function(a){let b=a.replace(/\\/g,"/").split("/").filter(Boolean);if(b.length<2)return null;let c=b[b.length-2];return!c||c.startsWith(".")?null:c}(c):null;return m?(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(m)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g}):(0,b.jsx)("span",{className:"text-muted-foreground font-mono",children:g})}function V({decision:a}){return"deny"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,b.jsx)(q,{className:"h-3 w-3"}),"Deny"]}):"instruct"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,b.jsx)(o,{className:"h-3 w-3"}),"Instruct"]}):(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,b.jsx)(p,{className:"h-3 w-3"}),"Allow"]})}function W({eventType:a}){return(0,b.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:a})}function X({integration:a}){if(!a)return null;let c=(0,Q.getCliLabel)(a),d=(0,Q.getCliBadgeClasses)(a);return(0,b.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${d}`,title:`Agent CLI: ${c}`,children:c})}function Y({mode:a}){let c="default"===a;return(0,b.jsx)("span",{title:a,className:`inline-block max-w-full truncate rounded px-1.5 py-0.5 align-middle text-[0.6rem] font-medium border ${c?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:a})}function Z({ms:a}){return(0,b.jsx)("span",{className:`font-mono text-[0.7rem] ${a>500?"text-red-400":a>100?"text-amber-400":"text-muted-foreground"}`,children:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`})}function $({text:a,field:d}){let[e,g]=(0,c.useState)(!1),{capture:h}=(0,N.usePostHog)(),i=async b=>{b.stopPropagation(),h("activity_copy_clicked",{field:d??"unknown"});try{await navigator.clipboard.writeText(a),g(!0),setTimeout(()=>g(!1),1500)}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b),g(!0),setTimeout(()=>g(!1),1500)}};return(0,b.jsx)("button",{onClick:i,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:e?(0,b.jsx)(f.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(j.Copy,{className:"h-3 w-3"})})}function _({value:a,onChange:c}){return(0,b.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(d=>(0,b.jsx)("button",{onClick:()=>c(d.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${a===d.value?"deny"===d.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===d.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===d.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:d.label},d.value))})}function aa({stats:a}){let c=a.totalEvents>0?a.denyCount/a.totalEvents*100:0,d=c.toFixed(c>=10?0:1),e=0===a.denyCount?"":c>=5?" is-deny":c>=2?" is-warn":"";return(0,b.jsxs)("div",{className:"stat-bar",role:"group","aria-label":"Activity stats",children:[(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"total events"}),(0,b.jsx)("span",{className:"value",children:a.totalEvents.toLocaleString()}),(0,b.jsx)("span",{className:"meta",children:"across all installed agents"})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"deny rate"}),(0,b.jsxs)("span",{className:`value${e}`,children:[d,"%"]}),(0,b.jsxs)("span",{className:"meta",children:[a.denyCount.toLocaleString()," of ",a.totalEvents.toLocaleString()," denied"]})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"top policy"}),(0,b.jsx)("span",{className:"value",style:{fontSize:16,fontWeight:500,color:a.topPolicy?"var(--accent-pink)":"var(--dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.topPolicy??void 0,children:a.topPolicy??"—"}),(0,b.jsx)("span",{className:"meta",children:"most-evaluated policy in scope"})]})]})}function ab({item:a}){if("observe"!==function(a,b){if(!a||!b)return;let c=R[a];if(c)return c[b]}(a.integration,a.eventType))return null;let c=a.matchedPolicies??[];if(0===c.length)return null;let d=a.integration?(0,Q.getCliLabel)(a.integration):"This CLI",e=c.map(a=>a.replace(/^(custom|\.failproofai-(project|user))\//,"")),f=1===e.length?e[0]:`${e.length} policies`,g="deny"===a.decision;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(s,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:g?"Not enforced.":"Ran, but cannot enforce here."})," ",(0,b.jsx)("span",{className:"font-mono",children:f})," ran on"," ",(0,b.jsx)("span",{className:"font-mono",children:a.eventType}),", but ",d," discards hook verdicts for this event",g?" — the action went ahead anyway.":", so a policy cannot block here."," ","Move the check to an event ",d," enforces on, such as"," ",(0,b.jsx)("span",{className:"font-mono",children:"PreToolUse"}),"."]})]})}function ac({item:a}){return(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:11,className:"px-0 py-0",children:(0,b.jsxs)("div",{className:"activity-detail animate-expand text-xs",children:[(0,b.jsxs)("span",{className:"activity-detail-eyebrow",children:[(0,b.jsx)("span",{"aria-hidden":"true",children:"▾"}),"event detail"]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-2",children:[(0,b.jsx)(B,{item:a}),(0,b.jsx)(ab,{item:a}),a.policySource&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Decided by: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:"cloud"===a.policySource&&a.cloudPolicyId?`cloud \xb7 ${a.cloudPolicyId} version ${a.cloudVersion}`:a.policySource})]}),void 0!==a.cloudDeployment&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Cloud deployment: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cloudDeployment})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.sessionId??"—"}),a.sessionId&&(0,b.jsx)($,{text:a.sessionId,field:"session_id"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cwd??"—"}),a.cwd&&(0,b.jsx)($,{text:a.cwd,field:"cwd"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,b.jsx)("span",{className:"font-mono text-foreground break-all",children:a.transcriptPath??"—"}),a.transcriptPath?.startsWith("opencode-db://")&&(0,b.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),a.policyNames&&a.policyNames.length>1&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.policyNames.join(", ")})]}),a.reason&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,b.jsx)("span",{className:"text-foreground",children:a.reason})]})]})})})}function ad({hooksInstalled:a,onSwitchTab:d}){let{intervalSec:e}=(0,M.useAutoRefresh)(),{capture:f}=(0,N.usePostHog)(),h=(0,O.useUrlParams)(),i=(0,c.useRef)(!1),[j,k]=(0,c.useState)(()=>(0,P.paramToPage)(h.get("page"))),[l,m]=(0,c.useState)(null),[o,p]=(0,c.useState)([]),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(()=>{let a=h.get("decision");return"allow"===a||"deny"===a||"instruct"===a?a:""}),[v,B]=(0,c.useState)(()=>h.get("event")??""),[C,D]=(0,c.useState)(()=>h.get("policy")??""),[E,F]=(0,c.useState)(()=>h.get("session")??""),[G,H]=(0,c.useState)(()=>{let a=h.get("cli");return(0,Q.isKnownCli)(a)?a:""}),[I,J]=(0,c.useState)(()=>{let a=h.get("source");return"custom"===a||"convention"===a||"cloud"===a||"pack"===a?a:""}),K=(0,c.useRef)(null),L=(0,c.useRef)(!0),R=(0,c.useRef)({filterDecision:s,filterEventType:v,filterPolicy:C,filterSessionId:E,filterCli:G,filterSource:I});R.current={filterDecision:s,filterEventType:v,filterPolicy:C,filterSessionId:E,filterCli:G,filterSource:I},(0,c.useEffect)(()=>{if(!i.current){i.current=!0;return}h.setAll({decision:s||void 0,event:v||void 0,policy:C||void 0,session:E||void 0,cli:G||void 0,source:I||void 0,page:(0,P.pageToParam)(j)})},[s,v,C,E,G,I,j]);let T=""!==s||""!==v||""!==C||""!==E||""!==G||""!==I,$=(0,c.useCallback)(async a=>{try{let b,{filterDecision:c,filterEventType:d,filterPolicy:e,filterSessionId:f,filterCli:g,filterSource:h}=R.current;b=""!==c||""!==d||""!==e||""!==f||""!==g||""!==h?await x({decision:c||void 0,eventType:d||void 0,policyName:e||void 0,sessionId:f||void 0,integration:g||void 0,source:h||void 0},a):await w(a),m(b)}catch{}},[]);(0,c.useEffect)(()=>{$(j);let a=setInterval(()=>$(j),e>0?1e3*e:5e3);return()=>clearInterval(a)},[j,$,e]),(0,c.useEffect)(()=>{let a=!1,b=()=>{y().then(b=>{a||p(b)}).catch(()=>{})};b();let c=setInterval(b,e>0?1e3*e:5e3);return()=>{a=!0,clearInterval(c)}},[e]),(0,c.useEffect)(()=>(K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{if(k(1),r(null),$(1),L.current){L.current=!1;return}f("activity_filter_changed",{active_filter_count:+(""!==s)+ +(""!==v)+ +(""!==C)+ +(""!==E)+ +(""!==G),has_decision:""!==s,has_event_type:""!==v,has_policy:""!==C,has_session:""!==E,has_cli:""!==G,decision:s||null,event_type:v||null,cli:G||null})},300),()=>{K.current&&clearTimeout(K.current)}),[s,v,C,E,G]);let ab=l?.entries??[],ae=l?.totalPages??1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z,{pauses:o}),l?.stats&&l.stats.totalEvents>0&&(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsx)(aa,{stats:l.stats})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"filter-bar",children:[(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"decision"}),(0,b.jsx)(_,{value:s,onChange:t})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"event"}),(0,b.jsxs)("select",{value:v,onChange:a=>B(a.target.value),className:"filter-input",children:[(0,b.jsx)("option",{value:"",children:"all events"}),(0,b.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,b.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,b.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,b.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,b.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,b.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"source"}),(0,b.jsxs)("select",{value:I,onChange:a=>{let b=a.target.value;J("custom"===b||"convention"===b||"cloud"===b||"pack"===b?b:"")},className:"filter-input","aria-label":"Filter by policy source",children:[(0,b.jsx)("option",{value:"",children:"all sources"}),(0,b.jsx)("option",{value:"custom",children:"custom"}),(0,b.jsx)("option",{value:"convention",children:"convention"}),(0,b.jsx)("option",{value:"cloud",children:"cloud"}),(0,b.jsx)("option",{value:"pack",children:"pack"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"cli"}),(0,b.jsxs)("select",{value:G,onChange:a=>{let b=a.target.value;H(""===b||(0,Q.isKnownCli)(b)?b:"")},className:"filter-input","aria-label":"Filter by CLI",children:[(0,b.jsx)("option",{value:"",children:"all clis"}),Q.KNOWN_CLI_IDS.map(a=>(0,b.jsx)("option",{value:a,children:(0,Q.getCliLabel)(a)},a))]})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"policy"}),(0,b.jsx)("input",{type:"text",value:C,onChange:a=>D(a.target.value),placeholder:"filter by policy…",className:"filter-input"})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"session"}),(0,b.jsx)("input",{type:"text",value:E,onChange:a=>F(a.target.value),placeholder:"filter by session…",className:"filter-input"})]}),T&&(0,b.jsx)("button",{type:"button",className:"filter-clear",onClick:()=>{t(""),B(""),H(""),D(""),F(""),J("")},"aria-label":"Clear all filters",children:"[ clear ]"})]}),0===ab.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,b.jsx)(n,{className:"h-12 w-12 text-muted-foreground/30"}),!1===a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,b.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>d?.("policies"),children:"Policies tab"})," ","and click ",(0,b.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:T?"No matching activity.":"Waiting for hook events…"})]}):(0,b.jsx)("div",{className:"overflow-x-auto activity-table-wrap",children:(0,b.jsxs)("table",{className:"w-full text-xs activity-table",style:{tableLayout:"fixed"},children:[(0,b.jsxs)("colgroup",{children:[(0,b.jsx)("col",{style:{width:32}}),(0,b.jsx)("col",{style:{width:"7%"}}),(0,b.jsx)("col",{style:{width:"9%"}}),(0,b.jsx)("col",{style:{width:"12%"}}),(0,b.jsx)("col",{style:{width:"11%"}}),(0,b.jsx)("col",{style:{width:"9%"}}),(0,b.jsx)("col",{style:{width:"13%"}}),(0,b.jsx)("col",{style:{width:"12%"}}),(0,b.jsx)("col",{style:{width:"11%"}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"8%"}})]}),(0,b.jsx)("thead",{className:"activity-thead",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-4 py-3"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Time"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Decision"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Event"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"CLI"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Tool"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Policy"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Reason"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Mode"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Duration"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Session"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:ab.map((a,d)=>{let e="deny"===a.decision,h=q===d,i="instruct"===a.decision;return(0,b.jsxs)(c.Fragment,{children:[(0,b.jsxs)("tr",{onClick:()=>{r(a=>{let b=a===d?null:d,c=ab[d];return f("activity_row_toggled",{expanded:null!==b,decision:c?.decision??null,policy_name:c?.policyName??null,event_type:c?.eventType??null}),b})},className:`activity-data-row cursor-pointer transition-colors ${e?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":d%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${h?"bg-muted/20":""}`,children:[(0,b.jsx)("td",{className:"px-4 py-2",children:(0,b.jsx)(g.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${h?"rotate-0":"-rotate-90"}`})}),(0,b.jsx)("td",{className:"px-3 py-2 text-muted-foreground whitespace-nowrap",title:new Date(a.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,S.formatRelativeTime)(a.timestamp)}),(0,b.jsxs)("td",{className:"px-3 py-2",children:[(0,b.jsx)(V,{decision:a.decision}),a.pausedBy&&(0,b.jsx)(A,{})]}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(W,{eventType:a.eventType})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(X,{integration:a.integration})}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.toolName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.policyNames&&a.policyNames.length>1?(0,b.jsxs)("span",{title:a.policyNames.join(", "),children:[a.policyNames[0],(0,b.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",a.policyNames.length-1]})]}):a.policyName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate",title:a.reason??"",children:a.reason??"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:a.permissionMode?(0,b.jsx)(Y,{mode:a.permissionMode}):"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(Z,{ms:a.durationMs})}),(0,b.jsx)("td",{className:"px-3 py-2",title:a.sessionId??"",children:(0,b.jsx)(U,{sessionId:a.sessionId,transcriptPath:a.transcriptPath,integration:a.integration,cwd:a.cwd})})]}),h&&(0,b.jsx)(ac,{item:a})]},`${a.timestamp}-${d}`)})})]})}),(0,b.jsx)(u.default,{currentPage:j,totalPages:ae,onPageChange:a=>{f("activity_pagination_changed",{from_page:j,to_page:a,total_pages:ae}),k(a),r(null)}})]})]})}function ae({enabled:a,onChange:c,disabled:d}){return(0,b.jsx)("button",{onClick:c,disabled:d,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${a?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":a?"Disable policy":"Enable policy",children:(0,b.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${a?"translate-x-3.5":"translate-x-0.5"}`})})}function af({policy:a,onClose:d,onSave:e}){let f=a.params??{},g=a.currentParams??{},[h,i]=(0,c.useState)(()=>{let a={};for(let[b,c]of Object.entries(f)){let d=b in g?g[b]:c.default;a[b]=d}return a});(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&d()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d]);let j=(a,b)=>{i(c=>({...c,[a]:b}))};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:a=>{a.target===a.currentTarget&&d()},children:(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:a.name}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.description})]}),(0,b.jsx)("button",{onClick:d,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,b.jsx)(t.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(f).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:a}),(0,b.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:c.description}),((a,c)=>{let d=h[a];if("boolean"===c.type)return(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:!!d,onChange:b=>j(a,b.target.checked),className:"rounded border-border"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:c.description})]});if("number"===c.type)return(0,b.jsx)("input",{type:"number",value:"number"==typeof d?d:"",onChange:b=>j(a,Number(b.target.value)),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"});if("string[]"===c.type){let c=Array.isArray(d)?d.join("\n"):"";return(0,b.jsx)("textarea",{value:c,onChange:b=>j(a,b.target.value.split("\n").filter(a=>""!==a.trim())),rows:4,placeholder:"One entry per line",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-2 focus:ring-primary/40 resize-y"})}if("pattern[]"===c.type){let c=Array.isArray(d)?d:[];return(0,b.jsxs)("div",{className:"space-y-1.5",children:[c.map((d,e)=>(0,b.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,b.jsx)("input",{type:"text",value:d.regex,onChange:b=>{let d=[...c];d[e]={...d[e],regex:b.target.value},j(a,d)},placeholder:"regex",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("input",{type:"text",value:d.label,onChange:b=>{let d=[...c];d[e]={...d[e],label:b.target.value},j(a,d)},placeholder:"label",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("button",{onClick:()=>j(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,b.jsx)(t.X,{className:"h-3.5 w-3.5"})})]},e)),(0,b.jsx)("button",{onClick:()=>j(a,[...c,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,b.jsx)("input",{type:"text",value:"string"==typeof d?d:"",onChange:b=>j(a,b.target.value),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"})})(a,c)]},a))}),(0,b.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,b.jsx)(T.Button,{variant:"outline",size:"sm",onClick:d,className:"h-7 text-xs",children:"Cancel"}),(0,b.jsx)(T.Button,{size:"sm",onClick:()=>e(h),className:"h-7 text-xs",children:"Save"})]})]})})}function ag({message:a,onDismiss:c,onInstall:e,isPending:f}){let{capture:g}=(0,N.usePostHog)();return(0,d.createPortal)((0,b.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,b.jsx)("style",{children:`
|
|
1
|
+
module.exports=[22712,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(35112),e=a.i(38246),f=a.i(52562),g=a.i(89027),h=a.i(64831);let i=(0,h.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var j=a.i(85650);let k=(0,h.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),l=(0,h.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var m=a.i(41476);let n=(0,h.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),o=(0,h.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),p=(0,h.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),q=(0,h.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]),r=(0,h.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),s=(0,h.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var t=a.i(74215),u=a.i(65967),v=a.i(5050);let w=(0,v.createServerReference)("403b6996611007a0397763f5057ed399c5dd17509f",v.callServer,void 0,v.findSourceMapURL,"getHookActivityAction"),x=(0,v.createServerReference)("60edf232c907aa5a89901b45da38cd4fccb6ea5326",v.callServer,void 0,v.findSourceMapURL,"searchHookActivityAction"),y=(0,v.createServerReference)("00a77fbb22f30bdca788ea0e80d3737f1b19287752",v.callServer,void 0,v.findSourceMapURL,"getActivePausesAction");function z({pauses:a,now:d}){let[e,f]=(0,c.useState)(()=>Date.now());(0,c.useEffect)(()=>{let a=setInterval(()=>f(Date.now()),3e4);return()=>clearInterval(a)},[]);let g=d??e,h=a.filter(a=>a.expiresAt>g);if(0===h.length)return null;let i=h.reduce((a,b)=>a.expiresAt<b.expiresAt?a:b);return(0,b.jsxs)("div",{role:"status",className:"mb-4 flex items-start gap-2.5 rounded border border-amber-500/40 bg-amber-500/[0.07] px-3 py-2.5",children:[(0,b.jsx)(o,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"text-xs leading-relaxed",children:[(0,b.jsxs)("p",{className:"font-medium text-foreground",children:["Enforcement is paused for ",h.length," session",1===h.length?"":"s"," —"," ",function(a){if(a<=0)return"expiring now";if(a<6e4)return"under a minute";let b=Math.round(a/6e4);if(b<60)return`${b}m`;let c=Math.floor(b/60),d=b%60;return 0===d?`${c}h`:`${c}h${d}m`}(i.expiresAt-g)," left",h.length>1?" on the next to expire":"","."]}),(0,b.jsxs)("p",{className:"text-muted-foreground mt-0.5",children:["Builtin, custom and convention policies are suspended for"," ",1===h.length?"that session":"those sessions","; cloud-managed policies keep enforcing. It lifts on its own — or run"," ",(0,b.jsx)("span",{className:"font-mono text-foreground",children:"failproofai config --resume"}),"."]})]})]})}function A(){return(0,b.jsx)("span",{title:"Enforcement was paused for this session — local policies did not run",className:"ml-1.5 inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium uppercase tracking-wide border border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-500",children:"paused"})}function B({item:a}){if(!a.pausedBy)return null;let c="number"==typeof a.pauseExpiresAt?new Date(a.pauseExpiresAt).toLocaleTimeString():null;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(s,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:"Not enforced — paused."})," Enforcement was suspended for this session","cli"===a.pausedBy?" from the CLI":` by ${a.pausedBy}`,c?`, lifting at ${c}`:"",". Builtin, custom and convention policies did not run for this event; cloud-managed policies did."]})]})}let C=(0,v.createServerReference)("0098d5ae3358ac3d9cec20de6688dc54f9cf99b9c3",v.callServer,void 0,v.findSourceMapURL,"getHooksConfigAction"),D=(0,v.createServerReference)("60b228eb5269dc7f4333b17a6d6ead07205b6efe0c",v.callServer,void 0,v.findSourceMapURL,"toggleCustomPolicyAction"),E=(0,v.createServerReference)("00ec88df0edac24beb35471d60af91817e46653adf",v.callServer,void 0,v.findSourceMapURL,"addBundledPackWebAction"),F=(0,v.createServerReference)("60d0c7a6a63c1b07a64757a4b5204441ee8402662d",v.callServer,void 0,v.findSourceMapURL,"addPackWebAction"),G=(0,v.createServerReference)("40919111c2d197a403665b66249dfd0dd1c8e34988",v.callServer,void 0,v.findSourceMapURL,"previewPackWebAction"),H=(0,v.createServerReference)("40e00773e032ee04f42d5438cad06f330dad966c06",v.callServer,void 0,v.findSourceMapURL,"removePackWebAction"),I=(0,v.createServerReference)("70a6ae270d351d6b2d5f244497a571dc5764dc2c2f",v.callServer,void 0,v.findSourceMapURL,"togglePackPolicyAction"),J=(0,v.createServerReference)("60908f761a8a53d56f2da659c2508ad8e59aee4a1f",v.callServer,void 0,v.findSourceMapURL,"installHooksWebAction"),K=(0,v.createServerReference)("605c87dd9accbdedd9db815642d6dc78e84825357d",v.callServer,void 0,v.findSourceMapURL,"removeHooksWebAction"),L=(0,v.createServerReference)("60610c234a9eb5344f40bceda1ad7ccf5ed0b0de37",v.callServer,void 0,v.findSourceMapURL,"updatePolicyParamsAction");var M=a.i(6236),N=a.i(10765),O=a.i(90619),P=a.i(95947),Q=a.i(87256);let R={claude:{PreToolUse:"block",UserPromptSubmit:"block",PermissionRequest:"block",Stop:"block",SubagentStop:"block",PreCompact:"block",PostToolBatch:"block",ConfigChange:"block",UserPromptExpansion:"block",TaskCreated:"block",TaskCompleted:"block",TeammateIdle:"block",Elicitation:"block",ElicitationResult:"block",PostToolUse:"observe",PostToolUseFailure:"observe",SessionStart:"observe",Setup:"observe",SubagentStart:"observe",SessionEnd:"observe",StopFailure:"observe",PermissionDenied:"observe",Notification:"observe",InstructionsLoaded:"observe",CwdChanged:"observe",FileChanged:"observe",PostCompact:"observe",WorktreeRemove:"observe"},codex:{PreToolUse:"block",PermissionRequest:"block",UserPromptSubmit:"block",Stop:"block",SubagentStop:"block",PostToolUse:"block",SessionStart:"observe",SubagentStart:"observe",PreCompact:"observe",PostCompact:"observe"},copilot:{PreToolUse:"block",Stop:"block",SubagentStop:"block",UserPromptSubmit:"block",PermissionRequest:"block",PostToolUse:"block",SessionStart:"observe",SessionEnd:"observe",PostToolUseFailure:"observe",PreCompact:"observe",Notification:"observe"},cursor:{PreToolUse:"block",Stop:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},opencode:{PreToolUse:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",UserPromptSubmit:"observe",PermissionRequest:"observe"},pi:{PreToolUse:"block",UserPromptSubmit:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",Stop:"observe"},hermes:{PreToolUse:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe"},openclaw:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe",SubagentStop:"observe",PreCompact:"observe"},factory:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PreCompact:"block",PostToolUse:"observe",SubagentStop:"observe",SessionStart:"observe",SessionEnd:"observe",Notification:"observe"},devin:{PreToolUse:"block",UserPromptSubmit:"block",Stop:"block",PermissionRequest:"block",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"},antigravity:{PreToolUse:"block",Stop:"block",PostToolUse:"observe",UserPromptSubmit:"observe"},goose:{PreToolUse:"block",UserPromptSubmit:"observe",PostToolUse:"observe",SessionStart:"observe",SessionEnd:"observe"}};var S=a.i(80977),T=a.i(40695);function U({sessionId:a,transcriptPath:c,integration:d,cwd:f}){if(!a)return(0,b.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let g=a?a.slice(0,8):"—",h="codex"===d||(c?.includes("/.codex/")??!1),i="copilot"===d||(c?.includes("/.copilot/session-state/")??!1),j="cursor"===d||(c?.includes("/.cursor/")??!1),k="opencode"===d||(c?.includes("/.local/share/opencode/")??!1)||(c?.includes("/.opencode/")??!1),l="pi"===d||(c?.includes("/.pi/")??!1);if(h||i||j||k||l){let c,d=f?(c=/^([A-Za-z]):[\\/](.*)$/.exec(f))?c[1]+"--"+c[2].replace(/[\\/]/g,"-"):f.replace(/[\\/]/g,"-"):h?"codex":i?"copilot":j?"cursor":k?"opencode":"pi";return(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(d)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g})}let m=c?function(a){let b=a.replace(/\\/g,"/").split("/").filter(Boolean);if(b.length<2)return null;let c=b[b.length-2];return!c||c.startsWith(".")?null:c}(c):null;return m?(0,b.jsx)(e.default,{href:`/project/${encodeURIComponent(m)}/session/${encodeURIComponent(a)}`,className:"text-primary hover:underline font-mono",onClick:a=>a.stopPropagation(),children:g}):(0,b.jsx)("span",{className:"text-muted-foreground font-mono",children:g})}function V({decision:a}){return"deny"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,b.jsx)(q,{className:"h-3 w-3"}),"Deny"]}):"instruct"===a?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,b.jsx)(o,{className:"h-3 w-3"}),"Instruct"]}):(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,b.jsx)(p,{className:"h-3 w-3"}),"Allow"]})}function W({eventType:a}){return(0,b.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:a})}function X({integration:a}){if(!a)return null;let c=(0,Q.getCliLabel)(a),d=(0,Q.getCliBadgeClasses)(a);return(0,b.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${d}`,title:`Agent CLI: ${c}`,children:c})}function Y({mode:a}){let c="default"===a;return(0,b.jsx)("span",{title:a,className:`inline-block max-w-full truncate rounded px-1.5 py-0.5 align-middle text-[0.6rem] font-medium border ${c?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:a})}function Z({ms:a}){return(0,b.jsx)("span",{className:`font-mono text-[0.7rem] ${a>500?"text-red-400":a>100?"text-amber-400":"text-muted-foreground"}`,children:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`})}function $({text:a,field:d}){let[e,g]=(0,c.useState)(!1),{capture:h}=(0,N.usePostHog)(),i=async b=>{b.stopPropagation(),h("activity_copy_clicked",{field:d??"unknown"});try{await navigator.clipboard.writeText(a),g(!0),setTimeout(()=>g(!1),1500)}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b),g(!0),setTimeout(()=>g(!1),1500)}};return(0,b.jsx)("button",{onClick:i,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:e?(0,b.jsx)(f.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(j.Copy,{className:"h-3 w-3"})})}function _({value:a,onChange:c}){return(0,b.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(d=>(0,b.jsx)("button",{onClick:()=>c(d.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${a===d.value?"deny"===d.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===d.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===d.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:d.label},d.value))})}function aa({stats:a}){let c=a.totalEvents>0?a.denyCount/a.totalEvents*100:0,d=c.toFixed(c>=10?0:1),e=0===a.denyCount?"":c>=5?" is-deny":c>=2?" is-warn":"";return(0,b.jsxs)("div",{className:"stat-bar",role:"group","aria-label":"Activity stats",children:[(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"total events"}),(0,b.jsx)("span",{className:"value",children:a.totalEvents.toLocaleString()}),(0,b.jsx)("span",{className:"meta",children:"across all installed agents"})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"deny rate"}),(0,b.jsxs)("span",{className:`value${e}`,children:[d,"%"]}),(0,b.jsxs)("span",{className:"meta",children:[a.denyCount.toLocaleString()," of ",a.totalEvents.toLocaleString()," denied"]})]}),(0,b.jsxs)("div",{className:"stat-cell",children:[(0,b.jsx)("span",{className:"eyebrow",children:"top policy"}),(0,b.jsx)("span",{className:"value",style:{fontSize:16,fontWeight:500,color:a.topPolicy?"var(--accent-pink)":"var(--dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.topPolicy??void 0,children:a.topPolicy??"—"}),(0,b.jsx)("span",{className:"meta",children:"most-evaluated policy in scope"})]})]})}function ab({item:a}){if("observe"!==function(a,b){if(!a||!b)return;let c=R[a];if(c)return c[b]}(a.integration,a.eventType))return null;let c=a.matchedPolicies??[];if(0===c.length)return null;let d=a.integration?(0,Q.getCliLabel)(a.integration):"This CLI",e=c.map(a=>a.replace(/^(custom|\.failproofai-(project|user))\//,"")),f=1===e.length?e[0]:`${e.length} policies`,g="deny"===a.decision;return(0,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3 mt-1 flex items-start gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2.5 py-2",children:[(0,b.jsx)(s,{className:"h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5","aria-hidden":"true"}),(0,b.jsxs)("p",{className:"text-[0.7rem] leading-relaxed text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:g?"Not enforced.":"Ran, but cannot enforce here."})," ",(0,b.jsx)("span",{className:"font-mono",children:f})," ran on"," ",(0,b.jsx)("span",{className:"font-mono",children:a.eventType}),", but ",d," discards hook verdicts for this event",g?" — the action went ahead anyway.":", so a policy cannot block here."," ","Move the check to an event ",d," enforces on, such as"," ",(0,b.jsx)("span",{className:"font-mono",children:"PreToolUse"}),"."]})]})}function ac({item:a}){return(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:11,className:"px-0 py-0",children:(0,b.jsxs)("div",{className:"activity-detail animate-expand text-xs",children:[(0,b.jsxs)("span",{className:"activity-detail-eyebrow",children:[(0,b.jsx)("span",{"aria-hidden":"true",children:"▾"}),"event detail"]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-2",children:[(0,b.jsx)(B,{item:a}),(0,b.jsx)(ab,{item:a}),a.policySource&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Decided by: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:"cloud"===a.policySource&&a.cloudPolicyId?`cloud \xb7 ${a.cloudPolicyId} version ${a.cloudVersion}`:a.policySource})]}),void 0!==a.cloudDeployment&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Cloud deployment: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cloudDeployment})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.sessionId??"—"}),a.sessionId&&(0,b.jsx)($,{text:a.sessionId,field:"session_id"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.cwd??"—"}),a.cwd&&(0,b.jsx)($,{text:a.cwd,field:"cwd"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,b.jsx)("span",{className:"font-mono text-foreground break-all",children:a.transcriptPath??"—"}),a.transcriptPath?.startsWith("opencode-db://")&&(0,b.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),a.policyNames&&a.policyNames.length>1&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,b.jsx)("span",{className:"font-mono text-foreground",children:a.policyNames.join(", ")})]}),a.reason&&(0,b.jsxs)("div",{style:{marginTop:8},children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,b.jsx)("span",{className:"text-foreground",children:a.reason})]})]})})})}function ad({hooksInstalled:a,onSwitchTab:d}){let{intervalSec:e}=(0,M.useAutoRefresh)(),{capture:f}=(0,N.usePostHog)(),h=(0,O.useUrlParams)(),i=(0,c.useRef)(!1),[j,k]=(0,c.useState)(()=>(0,P.paramToPage)(h.get("page"))),[l,m]=(0,c.useState)(null),[o,p]=(0,c.useState)([]),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(()=>{let a=h.get("decision");return"allow"===a||"deny"===a||"instruct"===a?a:""}),[v,B]=(0,c.useState)(()=>h.get("event")??""),[C,D]=(0,c.useState)(()=>h.get("policy")??""),[E,F]=(0,c.useState)(()=>h.get("session")??""),[G,H]=(0,c.useState)(()=>{let a=h.get("cli");return(0,Q.isKnownCli)(a)?a:""}),[I,J]=(0,c.useState)(()=>{let a=h.get("source");return"custom"===a||"convention"===a||"cloud"===a||"pack"===a?a:""}),K=(0,c.useRef)(null),L=(0,c.useRef)(!0),R=(0,c.useRef)({filterDecision:s,filterEventType:v,filterPolicy:C,filterSessionId:E,filterCli:G,filterSource:I});R.current={filterDecision:s,filterEventType:v,filterPolicy:C,filterSessionId:E,filterCli:G,filterSource:I},(0,c.useEffect)(()=>{if(!i.current){i.current=!0;return}h.setAll({decision:s||void 0,event:v||void 0,policy:C||void 0,session:E||void 0,cli:G||void 0,source:I||void 0,page:(0,P.pageToParam)(j)})},[s,v,C,E,G,I,j]);let T=""!==s||""!==v||""!==C||""!==E||""!==G||""!==I,$=(0,c.useCallback)(async a=>{try{let b,{filterDecision:c,filterEventType:d,filterPolicy:e,filterSessionId:f,filterCli:g,filterSource:h}=R.current;b=""!==c||""!==d||""!==e||""!==f||""!==g||""!==h?await x({decision:c||void 0,eventType:d||void 0,policyName:e||void 0,sessionId:f||void 0,integration:g||void 0,source:h||void 0},a):await w(a),m(b)}catch{}},[]);(0,c.useEffect)(()=>{$(j);let a=setInterval(()=>$(j),e>0?1e3*e:5e3);return()=>clearInterval(a)},[j,$,e]),(0,c.useEffect)(()=>{let a=!1,b=()=>{y().then(b=>{a||p(b)}).catch(()=>{})};b();let c=setInterval(b,e>0?1e3*e:5e3);return()=>{a=!0,clearInterval(c)}},[e]),(0,c.useEffect)(()=>(K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{if(k(1),r(null),$(1),L.current){L.current=!1;return}f("activity_filter_changed",{active_filter_count:+(""!==s)+ +(""!==v)+ +(""!==C)+ +(""!==E)+ +(""!==G),has_decision:""!==s,has_event_type:""!==v,has_policy:""!==C,has_session:""!==E,has_cli:""!==G,decision:s||null,event_type:v||null,cli:G||null})},300),()=>{K.current&&clearTimeout(K.current)}),[s,v,C,E,G]);let ab=l?.entries??[],ae=l?.totalPages??1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z,{pauses:o}),l?.stats&&l.stats.totalEvents>0&&(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsx)(aa,{stats:l.stats})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"filter-bar",children:[(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"decision"}),(0,b.jsx)(_,{value:s,onChange:t})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"event"}),(0,b.jsxs)("select",{value:v,onChange:a=>B(a.target.value),className:"filter-input",children:[(0,b.jsx)("option",{value:"",children:"all events"}),(0,b.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,b.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,b.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,b.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,b.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,b.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"source"}),(0,b.jsxs)("select",{value:I,onChange:a=>{let b=a.target.value;J("custom"===b||"convention"===b||"cloud"===b||"pack"===b?b:"")},className:"filter-input","aria-label":"Filter by policy source",children:[(0,b.jsx)("option",{value:"",children:"all sources"}),(0,b.jsx)("option",{value:"custom",children:"custom"}),(0,b.jsx)("option",{value:"convention",children:"convention"}),(0,b.jsx)("option",{value:"cloud",children:"cloud"}),(0,b.jsx)("option",{value:"pack",children:"pack"})]})]}),(0,b.jsxs)("div",{className:"filter-group",children:[(0,b.jsx)("span",{className:"filter-label",children:"cli"}),(0,b.jsxs)("select",{value:G,onChange:a=>{let b=a.target.value;H(""===b||(0,Q.isKnownCli)(b)?b:"")},className:"filter-input","aria-label":"Filter by CLI",children:[(0,b.jsx)("option",{value:"",children:"all clis"}),Q.KNOWN_CLI_IDS.map(a=>(0,b.jsx)("option",{value:a,children:(0,Q.getCliLabel)(a)},a))]})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"policy"}),(0,b.jsx)("input",{type:"text",value:C,onChange:a=>D(a.target.value),placeholder:"filter by policy…",className:"filter-input"})]}),(0,b.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,b.jsx)("span",{className:"filter-label",children:"session"}),(0,b.jsx)("input",{type:"text",value:E,onChange:a=>F(a.target.value),placeholder:"filter by session…",className:"filter-input"})]}),T&&(0,b.jsx)("button",{type:"button",className:"filter-clear",onClick:()=>{t(""),B(""),H(""),D(""),F(""),J("")},"aria-label":"Clear all filters",children:"[ clear ]"})]}),0===ab.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,b.jsx)(n,{className:"h-12 w-12 text-muted-foreground/30"}),!1===a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,b.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>d?.("policies"),children:"Policies tab"})," ","and click ",(0,b.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:T?"No matching activity.":"Waiting for hook events…"})]}):(0,b.jsx)("div",{className:"overflow-x-auto activity-table-wrap",children:(0,b.jsxs)("table",{className:"w-full text-xs activity-table",style:{tableLayout:"fixed"},children:[(0,b.jsxs)("colgroup",{children:[(0,b.jsx)("col",{style:{width:32}}),(0,b.jsx)("col",{style:{width:"7%"}}),(0,b.jsx)("col",{style:{width:"9%"}}),(0,b.jsx)("col",{style:{width:"12%"}}),(0,b.jsx)("col",{style:{width:"11%"}}),(0,b.jsx)("col",{style:{width:"9%"}}),(0,b.jsx)("col",{style:{width:"13%"}}),(0,b.jsx)("col",{style:{width:"12%"}}),(0,b.jsx)("col",{style:{width:"11%"}}),(0,b.jsx)("col",{style:{width:"8%"}}),(0,b.jsx)("col",{style:{width:"8%"}})]}),(0,b.jsx)("thead",{className:"activity-thead",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-4 py-3"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Time"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Decision"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Event"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"CLI"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Tool"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Policy"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Reason"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Mode"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Duration"}),(0,b.jsx)("th",{className:"px-3 py-3 activity-th",children:"Session"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:ab.map((a,d)=>{let e="deny"===a.decision,h=q===d,i="instruct"===a.decision;return(0,b.jsxs)(c.Fragment,{children:[(0,b.jsxs)("tr",{onClick:()=>{r(a=>{let b=a===d?null:d,c=ab[d];return f("activity_row_toggled",{expanded:null!==b,decision:c?.decision??null,policy_name:c?.policyName??null,event_type:c?.eventType??null}),b})},className:`activity-data-row cursor-pointer transition-colors ${e?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":d%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${h?"bg-muted/20":""}`,children:[(0,b.jsx)("td",{className:"px-4 py-2",children:(0,b.jsx)(g.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${h?"rotate-0":"-rotate-90"}`})}),(0,b.jsx)("td",{className:"px-3 py-2 text-muted-foreground whitespace-nowrap",title:new Date(a.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,S.formatRelativeTime)(a.timestamp)}),(0,b.jsxs)("td",{className:"px-3 py-2",children:[(0,b.jsx)(V,{decision:a.decision}),a.pausedBy&&(0,b.jsx)(A,{})]}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(W,{eventType:a.eventType})}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(X,{integration:a.integration})}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.toolName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:a.policyNames&&a.policyNames.length>1?(0,b.jsxs)("span",{title:a.policyNames.join(", "),children:[a.policyNames[0],(0,b.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",a.policyNames.length-1]})]}):a.policyName??"—"}),(0,b.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate",title:a.reason??"",children:a.reason??"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:a.permissionMode?(0,b.jsx)(Y,{mode:a.permissionMode}):"—"}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(Z,{ms:a.durationMs})}),(0,b.jsx)("td",{className:"px-3 py-2",title:a.sessionId??"",children:(0,b.jsx)(U,{sessionId:a.sessionId,transcriptPath:a.transcriptPath,integration:a.integration,cwd:a.cwd})})]}),h&&(0,b.jsx)(ac,{item:a})]},`${a.timestamp}-${d}`)})})]})}),(0,b.jsx)(u.default,{currentPage:j,totalPages:ae,onPageChange:a=>{f("activity_pagination_changed",{from_page:j,to_page:a,total_pages:ae}),k(a),r(null)}})]})]})}function ae({enabled:a,onChange:c,disabled:d}){return(0,b.jsx)("button",{onClick:c,disabled:d,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${a?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":a?"Disable policy":"Enable policy",children:(0,b.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${a?"translate-x-3.5":"translate-x-0.5"}`})})}function af({policy:a,onClose:d,onSave:e}){let f=a.params??{},g=a.currentParams??{},[h,i]=(0,c.useState)(()=>{let a={};for(let[b,c]of Object.entries(f)){let d=b in g?g[b]:c.default;a[b]=d}return a});(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&d()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d]);let j=(a,b)=>{i(c=>({...c,[a]:b}))};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:a=>{a.target===a.currentTarget&&d()},children:(0,b.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:a.name}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.description})]}),(0,b.jsx)("button",{onClick:d,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,b.jsx)(t.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(f).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:a}),(0,b.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:c.description}),((a,c)=>{let d=h[a];if("boolean"===c.type)return(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:!!d,onChange:b=>j(a,b.target.checked),className:"rounded border-border"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:c.description})]});if("number"===c.type)return(0,b.jsx)("input",{type:"number",value:"number"==typeof d?d:"",onChange:b=>j(a,Number(b.target.value)),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"});if("string[]"===c.type){let c=Array.isArray(d)?d.join("\n"):"";return(0,b.jsx)("textarea",{value:c,onChange:b=>j(a,b.target.value.split("\n").filter(a=>""!==a.trim())),rows:4,placeholder:"One entry per line",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-2 focus:ring-primary/40 resize-y"})}if("pattern[]"===c.type){let c=Array.isArray(d)?d:[];return(0,b.jsxs)("div",{className:"space-y-1.5",children:[c.map((d,e)=>(0,b.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,b.jsx)("input",{type:"text",value:d.regex,onChange:b=>{let d=[...c];d[e]={...d[e],regex:b.target.value},j(a,d)},placeholder:"regex",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("input",{type:"text",value:d.label,onChange:b=>{let d=[...c];d[e]={...d[e],label:b.target.value},j(a,d)},placeholder:"label",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,b.jsx)("button",{onClick:()=>j(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,b.jsx)(t.X,{className:"h-3.5 w-3.5"})})]},e)),(0,b.jsx)("button",{onClick:()=>j(a,[...c,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,b.jsx)("input",{type:"text",value:"string"==typeof d?d:"",onChange:b=>j(a,b.target.value),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"})})(a,c)]},a))}),(0,b.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,b.jsx)(T.Button,{variant:"outline",size:"sm",onClick:d,className:"h-7 text-xs",children:"Cancel"}),(0,b.jsx)(T.Button,{size:"sm",onClick:()=>e(h),className:"h-7 text-xs",children:"Save"})]})]})})}function ag({message:a,onDismiss:c,onInstall:e,isPending:f}){let{capture:g}=(0,N.usePostHog)();return(0,d.createPortal)((0,b.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,b.jsx)("style",{children:`
|
|
2
2
|
@keyframes slideInFromRight {
|
|
3
3
|
from { transform: translateX(calc(100% + 1rem)); opacity: 0; }
|
|
4
4
|
to { transform: translateX(0); opacity: 1; }
|
package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[41857,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5050);let e=(0,d.createServerReference)("00c044ec9b52e3f83bf33726b3541508faa77ae5aa",d.callServer,void 0,d.findSourceMapURL,"getScheduledAuditAction"),f=(0,d.createServerReference)("4038a58e45390571a22b037b9bc881f1be25775a4d",d.callServer,void 0,d.findSourceMapURL,"setAutoAuditAction"),g=(0,d.createServerReference)("40cc32d63c27b46e95d7af5d2f0b9d77a1a99db14a",d.callServer,void 0,d.findSourceMapURL,"setAuditIntervalAction");var h=a.i(89564),i=a.i(4543),j=a.i(18952),k=a.i(80977);function l(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function m(a,b){let c=a-b;if(c<=0)return"now";let d=Math.floor(c/864e5),e=Math.floor(c%864e5/36e5);return d>0?e>0?`${d}d ${e}h`:`${d}d`:e>0?`${e}h`:`${Math.max(1,Math.floor(c/6e4))}m`}function n(a){return a.toLocaleString("en-US")}function o({label:a,value:c,sub:d,tone:e}){return(0,b.jsxs)("div",{className:"set-stat",children:[(0,b.jsx)("div",{className:"set-stat-label",children:a}),(0,b.jsx)("div",{className:`set-stat-value${e?` ${e}`:""}`,children:c}),(0,b.jsx)("div",{className:"set-stat-sub",children:d??" "})]})}function p({lastRunAtMs:a,nextDueAtMs:c,now:d}){if(null==a||null==c||c<=a)return null;let e=Math.min(100,Math.max(0,(d-a)/(c-a)*100));return(0,b.jsxs)("div",{className:"tape","aria-hidden":"true",children:[(0,b.jsxs)("div",{className:"tape-rail",children:[(0,b.jsx)("div",{className:"tape-fill",style:{width:`${e}%`}}),(0,b.jsx)("div",{className:"tape-now",style:{left:`${e}%`}})]}),(0,b.jsxs)("div",{className:"tape-ends",children:[(0,b.jsxs)("span",{children:["last scan · ",l(a)]}),(0,b.jsxs)("span",{className:"tape-next",children:["next · ",m(c,d)]})]})]})}function q({enabled:a,onChange:c,disabled:d,label:e}){return(0,b.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-label":e,disabled:d,onClick:c,className:"sw","data-on":a?"true":"false",children:(0,b.jsx)("span",{className:"sw-knob"})})}let r=[{label:"reads",body:"every session transcript on disk — your prompts, the files your agents read and wrote, and command output."},{label:"runs",body:"entirely on this machine. the transcripts never leave it."},{label:"sends",body:"counts, redacted examples, and this machine's name — and only when a scan finds something harmful."}];a.s(["default",0,function({initial:a}){let[d,s]=(0,c.useState)(a),[t,u]=(0,c.useState)(a?.auto??!1),[v,w]=(0,c.useState)(a?.intervalDays??7),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(!1),[D,E]=(0,c.useState)(null===a),[F,G]=(0,c.useState)(0),H=(0,c.useRef)(!0),I=(0,c.useRef)(null!==a),J=(0,c.useCallback)(async()=>{try{let a=await e();if(!H.current)return;s(a),I.current=!0,u(a.auto),w(a.intervalDays),G(Date.now()),E(!1)}catch{H.current&&!I.current&&E(!0)}},[]);(0,c.useEffect)(()=>(H.current=!0,J(),()=>{H.current=!1}),[J]),(0,c.useEffect)(()=>{let a=()=>void J();return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[J]);let K=d?.signedInAs??null,L=d?.daemon==="running",M=d?.daemon==="unsupported-platform",N=d?.schedule??null,O=d?.lastScan??null,P=N?.lastExitCode!=null&&0!==N.lastExitCode&&75!==N.lastExitCode,Q=(0,c.useCallback)(async()=>{y(!0);try{let a=await f(!0);if(!a.ok){if(u(!1),"unreachable"===a.reason)return void(0,j.toast)("could not reach the server. check your connection and try again.");await J(),C(!0),(0,j.toast)("that sign-in expired. one more code and it's on.");return}u(a.auto),(0,j.toast)("scheduled audits on."),await J()}catch{u(!1),(0,j.toast)("could not turn that on.")}finally{y(!1)}},[J]),R=(0,c.useCallback)(async()=>{if(t){y(!0);try{let a=await f(!1);a.ok&&u(a.auto),(0,j.toast)("scheduled audits off."),await J()}catch{(0,j.toast)("could not turn that off.")}finally{y(!1)}return}K?await Q():C(!0)},[t,Q,J,K]),S=(0,c.useCallback)(async a=>{y(!0);try{let b=await g(a);w(b.intervalDays),s(a=>a?{...a,intervalDays:b.intervalDays}:a),(0,j.toast)(`scanning every ${b.intervalDays} day${1===b.intervalDays?"":"s"}.`)}catch{w(d?.intervalDays??7),(0,j.toast)("could not save that.")}finally{y(!1)}},[d?.intervalDays]),T=(0,c.useCallback)(async()=>{y(!0);try{await fetch("/api/auth/logout",{method:"POST"}),(0,j.toast)("signed out. scans continue; digests pause."),await J()}catch{(0,j.toast)("could not sign out.")}finally{y(!1)}},[J]),U=(0,c.useCallback)(async()=>{if(!z){A(!0);try{await (0,h.triggerRun)({cli:[],since:"all",noCache:!1}),(0,j.toast)("scan complete."),await J()}catch(a){(0,j.toast)(a instanceof h.RerunError&&"timeout"===a.kind?"the scan is taking a while — it will finish in the background.":"the scan could not be completed.")}finally{A(!1)}}},[J,z]),V=(0,c.useCallback)(async a=>{C(!1),await J(),await Q()},[Q,J]),W=d?L?{value:"running",sub:null!=d.daemonStartedAtMs&&F>0?`up ${function(a){let b=Math.floor(a/864e5);if(b>0)return`${b}d`;let c=Math.floor(a/36e5);return c>0?`${c}h`:`${Math.max(1,Math.floor(a/6e4))}m`}(Math.max(0,F-d.daemonStartedAtMs))}`:"",tone:"ok"}:M?{value:"unavailable",sub:"not on this platform"}:"not-installed"===d.daemon?{value:"not installed",sub:"run failproofai config",tone:"warn"}:"unknown"===d.daemon?{value:"unknown",sub:"could not read it"}:{value:"stopped",sub:"run failproofai config",tone:"warn"}:{value:"…",sub:"reading"},X=t?N?.nextDueAtMs==null?{value:"pending",sub:"after the next scan"}:{value:F>0?m(N.nextDueAtMs,F):"—",sub:l(N.nextDueAtMs)}:{value:"off",sub:"nothing scheduled"},Y=O?{value:(0,k.formatRelativeTime)(Date.parse(O.finishedAt)),sub:null!=O.sessionsScanned?`${n(O.sessionsScanned)} sessions`:"scanned"}:{value:"none yet",sub:"run one below"},Z=O?null==O.findings?{value:"—",sub:"unreadable"}:{value:n(O.findings),sub:"this scan",...O.findings>0?{tone:"warn"}:{}}:{value:"—",sub:"no scan yet"};return(0,b.jsxs)("main",{className:"report",children:[(0,b.jsxs)("section",{className:"section set-sec",children:[(0,b.jsxs)("div",{className:"set-mast",children:[(0,b.jsx)("h1",{className:"set-title",children:"settings"}),(0,b.jsx)("p",{className:"set-lede",children:"keeping watch, so you don't have to."})]}),D?(0,b.jsx)("div",{className:"set-console",children:(0,b.jsx)("div",{className:"set-cell",children:(0,b.jsxs)("p",{className:"set-warn",children:["could not read this machine's settings. check that the dashboard can reach ",(0,b.jsx)("code",{children:"~/.failproofai/config.json"}),"."]})})}):(0,b.jsxs)("div",{className:"set-console",children:[(0,b.jsxs)("div",{className:"set-stats",children:[(0,b.jsx)(o,{label:"daemon",...W}),(0,b.jsx)(o,{label:"next scan",...X}),(0,b.jsx)(o,{label:"last scan",...Y}),(0,b.jsx)(o,{label:"findings",...Z})]}),(0,b.jsxs)("div",{className:"set-cols",children:[(0,b.jsxs)("div",{className:"set-cell set-config",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"scheduled audit"}),(0,b.jsxs)("div",{className:"set-row set-row-main",children:[(0,b.jsx)(q,{enabled:t,disabled:x||null===d,onChange:()=>void R(),label:t?"turn off scheduled audits":"turn on scheduled audits"}),(0,b.jsxs)("div",{className:"set-row-copy",children:[(0,b.jsx)("span",{className:"set-strong",children:t?"scanning on a schedule.":"scan on a schedule."}),(0,b.jsx)("span",{className:"set-dim",children:t?"you'll get an email only when a scan finds something.":"off. nothing runs and nothing is sent."})]})]}),(0,b.jsxs)("div",{className:"set-row set-row-interval",children:[(0,b.jsx)("span",{className:"set-dim",children:"scan every"}),(0,b.jsx)("input",{type:"number",className:"set-num",min:1,max:90,value:v,disabled:x||null===d,"aria-label":"days between scheduled scans",onChange:a=>w(Number(a.target.value)),onBlur:a=>{let b=Number(a.target.value);Number.isFinite(b)?b!==d?.intervalDays&&S(b):w(d?.intervalDays??7)}}),(0,b.jsx)("span",{className:"set-dim",children:"days"}),(0,b.jsxs)("span",{className:"set-hint",children:[1,"–",90]})]}),(0,b.jsx)("div",{className:"set-rule"}),(0,b.jsx)("div",{className:"set-row set-row-identity",children:K?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-dim",children:"reports go to"}),(0,b.jsx)("span",{className:"set-email",children:K.email}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:x,onClick:()=>void T(),children:"sign out"})]}):t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-warn",children:"signed out — scans continue, digests are paused."}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:x,onClick:()=>C(!0),children:"sign in to resume"})]}):(0,b.jsx)("span",{className:"set-dim",children:"turning this on asks for an email, so there is somewhere to send the report."})}),t&&d&&!L&&(0,b.jsx)("p",{className:"set-warn",children:M?"the background service isn't available on this platform, so scheduled scans can't run here. you can still run one now.":"not-installed"===d.daemon?"the background service isn't installed, so nothing will run on the timer. install it with `failproofai config`.":"the background service is stopped, so nothing will run until it starts. repair it with `failproofai config`."}),P&&(0,b.jsxs)("p",{className:"set-warn",children:["the last scheduled scan exited ",N?.lastExitCode,". the next one will still run."]}),(0,b.jsx)("div",{className:"set-actions",children:(0,b.jsx)("button",{type:"button",className:"btn btn-press",disabled:z,onClick:()=>void U(),children:z?"[ scanning… ]":"[ run a scan now ]"})})]}),(0,b.jsxs)("div",{className:"set-cell set-how",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"how it works"}),(0,b.jsx)("dl",{className:"set-how-list",children:r.map(a=>(0,b.jsxs)("div",{className:"set-how-row",children:[(0,b.jsx)("dt",{className:"set-how-label",children:a.label}),(0,b.jsx)("dd",{className:"set-how-body",children:a.body})]},a.label))})]})]})]}),t&&F>0&&(0,b.jsx)(p,{lastRunAtMs:N?.lastRunAtMs??null,nextDueAtMs:N?.nextDueAtMs??null,now:F})]}),(0,b.jsx)(i.AuthDialog,{open:B,source:"settings_scheduled_audit",headline:"where should the report go?",subhead:"we'll send a one-time code to confirm.",onClose:()=>C(!1),onAuthed:a=>void V(a)})]})}],41857)}];
|
|
1
|
+
module.exports=[41857,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5050);let e=(0,d.createServerReference)("005a7d154a644cead2fefc93ebef6691aee3b31d61",d.callServer,void 0,d.findSourceMapURL,"getScheduledAuditAction"),f=(0,d.createServerReference)("40eb945dc04f4bdfc7c615662543cc3ba4f9708a01",d.callServer,void 0,d.findSourceMapURL,"setAutoAuditAction"),g=(0,d.createServerReference)("402d5e22bc51e4d316325462764b3e6d43e7ff1eb4",d.callServer,void 0,d.findSourceMapURL,"setAuditIntervalAction");var h=a.i(89564),i=a.i(4543),j=a.i(18952),k=a.i(80977);function l(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function m(a,b){let c=a-b;if(c<=0)return"now";let d=Math.floor(c/864e5),e=Math.floor(c%864e5/36e5);return d>0?e>0?`${d}d ${e}h`:`${d}d`:e>0?`${e}h`:`${Math.max(1,Math.floor(c/6e4))}m`}function n(a){return a.toLocaleString("en-US")}function o({label:a,value:c,sub:d,tone:e}){return(0,b.jsxs)("div",{className:"set-stat",children:[(0,b.jsx)("div",{className:"set-stat-label",children:a}),(0,b.jsx)("div",{className:`set-stat-value${e?` ${e}`:""}`,children:c}),(0,b.jsx)("div",{className:"set-stat-sub",children:d??" "})]})}function p({lastRunAtMs:a,nextDueAtMs:c,now:d}){if(null==a||null==c||c<=a)return null;let e=Math.min(100,Math.max(0,(d-a)/(c-a)*100));return(0,b.jsxs)("div",{className:"tape","aria-hidden":"true",children:[(0,b.jsxs)("div",{className:"tape-rail",children:[(0,b.jsx)("div",{className:"tape-fill",style:{width:`${e}%`}}),(0,b.jsx)("div",{className:"tape-now",style:{left:`${e}%`}})]}),(0,b.jsxs)("div",{className:"tape-ends",children:[(0,b.jsxs)("span",{children:["last scan · ",l(a)]}),(0,b.jsxs)("span",{className:"tape-next",children:["next · ",m(c,d)]})]})]})}function q({enabled:a,onChange:c,disabled:d,label:e}){return(0,b.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-label":e,disabled:d,onClick:c,className:"sw","data-on":a?"true":"false",children:(0,b.jsx)("span",{className:"sw-knob"})})}let r=[{label:"reads",body:"every session transcript on disk — your prompts, the files your agents read and wrote, and command output."},{label:"runs",body:"entirely on this machine. the transcripts never leave it."},{label:"sends",body:"counts, redacted examples, and this machine's name — and only when a scan finds something harmful."}];a.s(["default",0,function({initial:a}){let[d,s]=(0,c.useState)(a),[t,u]=(0,c.useState)(a?.auto??!1),[v,w]=(0,c.useState)(a?.intervalDays??7),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(!1),[D,E]=(0,c.useState)(null===a),[F,G]=(0,c.useState)(0),H=(0,c.useRef)(!0),I=(0,c.useRef)(null!==a),J=(0,c.useCallback)(async()=>{try{let a=await e();if(!H.current)return;s(a),I.current=!0,u(a.auto),w(a.intervalDays),G(Date.now()),E(!1)}catch{H.current&&!I.current&&E(!0)}},[]);(0,c.useEffect)(()=>(H.current=!0,J(),()=>{H.current=!1}),[J]),(0,c.useEffect)(()=>{let a=()=>void J();return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[J]);let K=d?.signedInAs??null,L=d?.daemon==="running",M=d?.daemon==="unsupported-platform",N=d?.schedule??null,O=d?.lastScan??null,P=N?.lastExitCode!=null&&0!==N.lastExitCode&&75!==N.lastExitCode,Q=(0,c.useCallback)(async()=>{y(!0);try{let a=await f(!0);if(!a.ok){if(u(!1),"unreachable"===a.reason)return void(0,j.toast)("could not reach the server. check your connection and try again.");await J(),C(!0),(0,j.toast)("that sign-in expired. one more code and it's on.");return}u(a.auto),(0,j.toast)("scheduled audits on."),await J()}catch{u(!1),(0,j.toast)("could not turn that on.")}finally{y(!1)}},[J]),R=(0,c.useCallback)(async()=>{if(t){y(!0);try{let a=await f(!1);a.ok&&u(a.auto),(0,j.toast)("scheduled audits off."),await J()}catch{(0,j.toast)("could not turn that off.")}finally{y(!1)}return}K?await Q():C(!0)},[t,Q,J,K]),S=(0,c.useCallback)(async a=>{y(!0);try{let b=await g(a);w(b.intervalDays),s(a=>a?{...a,intervalDays:b.intervalDays}:a),(0,j.toast)(`scanning every ${b.intervalDays} day${1===b.intervalDays?"":"s"}.`)}catch{w(d?.intervalDays??7),(0,j.toast)("could not save that.")}finally{y(!1)}},[d?.intervalDays]),T=(0,c.useCallback)(async()=>{y(!0);try{await fetch("/api/auth/logout",{method:"POST"}),(0,j.toast)("signed out. scans continue; digests pause."),await J()}catch{(0,j.toast)("could not sign out.")}finally{y(!1)}},[J]),U=(0,c.useCallback)(async()=>{if(!z){A(!0);try{await (0,h.triggerRun)({cli:[],since:"all",noCache:!1}),(0,j.toast)("scan complete."),await J()}catch(a){(0,j.toast)(a instanceof h.RerunError&&"timeout"===a.kind?"the scan is taking a while — it will finish in the background.":"the scan could not be completed.")}finally{A(!1)}}},[J,z]),V=(0,c.useCallback)(async a=>{C(!1),await J(),await Q()},[Q,J]),W=d?L?{value:"running",sub:null!=d.daemonStartedAtMs&&F>0?`up ${function(a){let b=Math.floor(a/864e5);if(b>0)return`${b}d`;let c=Math.floor(a/36e5);return c>0?`${c}h`:`${Math.max(1,Math.floor(a/6e4))}m`}(Math.max(0,F-d.daemonStartedAtMs))}`:"",tone:"ok"}:M?{value:"unavailable",sub:"not on this platform"}:"not-installed"===d.daemon?{value:"not installed",sub:"run failproofai config",tone:"warn"}:"unknown"===d.daemon?{value:"unknown",sub:"could not read it"}:{value:"stopped",sub:"run failproofai config",tone:"warn"}:{value:"…",sub:"reading"},X=t?N?.nextDueAtMs==null?{value:"pending",sub:"after the next scan"}:{value:F>0?m(N.nextDueAtMs,F):"—",sub:l(N.nextDueAtMs)}:{value:"off",sub:"nothing scheduled"},Y=O?{value:(0,k.formatRelativeTime)(Date.parse(O.finishedAt)),sub:null!=O.sessionsScanned?`${n(O.sessionsScanned)} sessions`:"scanned"}:{value:"none yet",sub:"run one below"},Z=O?null==O.findings?{value:"—",sub:"unreadable"}:{value:n(O.findings),sub:"this scan",...O.findings>0?{tone:"warn"}:{}}:{value:"—",sub:"no scan yet"};return(0,b.jsxs)("main",{className:"report",children:[(0,b.jsxs)("section",{className:"section set-sec",children:[(0,b.jsxs)("div",{className:"set-mast",children:[(0,b.jsx)("h1",{className:"set-title",children:"settings"}),(0,b.jsx)("p",{className:"set-lede",children:"keeping watch, so you don't have to."})]}),D?(0,b.jsx)("div",{className:"set-console",children:(0,b.jsx)("div",{className:"set-cell",children:(0,b.jsxs)("p",{className:"set-warn",children:["could not read this machine's settings. check that the dashboard can reach ",(0,b.jsx)("code",{children:"~/.failproofai/config.json"}),"."]})})}):(0,b.jsxs)("div",{className:"set-console",children:[(0,b.jsxs)("div",{className:"set-stats",children:[(0,b.jsx)(o,{label:"daemon",...W}),(0,b.jsx)(o,{label:"next scan",...X}),(0,b.jsx)(o,{label:"last scan",...Y}),(0,b.jsx)(o,{label:"findings",...Z})]}),(0,b.jsxs)("div",{className:"set-cols",children:[(0,b.jsxs)("div",{className:"set-cell set-config",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"scheduled audit"}),(0,b.jsxs)("div",{className:"set-row set-row-main",children:[(0,b.jsx)(q,{enabled:t,disabled:x||null===d,onChange:()=>void R(),label:t?"turn off scheduled audits":"turn on scheduled audits"}),(0,b.jsxs)("div",{className:"set-row-copy",children:[(0,b.jsx)("span",{className:"set-strong",children:t?"scanning on a schedule.":"scan on a schedule."}),(0,b.jsx)("span",{className:"set-dim",children:t?"you'll get an email only when a scan finds something.":"off. nothing runs and nothing is sent."})]})]}),(0,b.jsxs)("div",{className:"set-row set-row-interval",children:[(0,b.jsx)("span",{className:"set-dim",children:"scan every"}),(0,b.jsx)("input",{type:"number",className:"set-num",min:1,max:90,value:v,disabled:x||null===d,"aria-label":"days between scheduled scans",onChange:a=>w(Number(a.target.value)),onBlur:a=>{let b=Number(a.target.value);Number.isFinite(b)?b!==d?.intervalDays&&S(b):w(d?.intervalDays??7)}}),(0,b.jsx)("span",{className:"set-dim",children:"days"}),(0,b.jsxs)("span",{className:"set-hint",children:[1,"–",90]})]}),(0,b.jsx)("div",{className:"set-rule"}),(0,b.jsx)("div",{className:"set-row set-row-identity",children:K?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-dim",children:"reports go to"}),(0,b.jsx)("span",{className:"set-email",children:K.email}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:x,onClick:()=>void T(),children:"sign out"})]}):t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-warn",children:"signed out — scans continue, digests are paused."}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:x,onClick:()=>C(!0),children:"sign in to resume"})]}):(0,b.jsx)("span",{className:"set-dim",children:"turning this on asks for an email, so there is somewhere to send the report."})}),t&&d&&!L&&(0,b.jsx)("p",{className:"set-warn",children:M?"the background service isn't available on this platform, so scheduled scans can't run here. you can still run one now.":"not-installed"===d.daemon?"the background service isn't installed, so nothing will run on the timer. install it with `failproofai config`.":"the background service is stopped, so nothing will run until it starts. repair it with `failproofai config`."}),P&&(0,b.jsxs)("p",{className:"set-warn",children:["the last scheduled scan exited ",N?.lastExitCode,". the next one will still run."]}),(0,b.jsx)("div",{className:"set-actions",children:(0,b.jsx)("button",{type:"button",className:"btn btn-press",disabled:z,onClick:()=>void U(),children:z?"[ scanning… ]":"[ run a scan now ]"})})]}),(0,b.jsxs)("div",{className:"set-cell set-how",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"how it works"}),(0,b.jsx)("dl",{className:"set-how-list",children:r.map(a=>(0,b.jsxs)("div",{className:"set-how-row",children:[(0,b.jsx)("dt",{className:"set-how-label",children:a.label}),(0,b.jsx)("dd",{className:"set-how-body",children:a.body})]},a.label))})]})]})]}),t&&F>0&&(0,b.jsx)(p,{lastRunAtMs:N?.lastRunAtMs??null,nextDueAtMs:N?.nextDueAtMs??null,now:F})]}),(0,b.jsx)(i.AuthDialog,{open:B,source:"settings_scheduled_audit",headline:"where should the report go?",subhead:"we'll send a one-time code to confirm.",onClose:()=>C(!1),onAuthed:a=>void V(a)})]})}],41857)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=app_settings_settings-client_tsx_20lq-mq._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[84794,a=>{"use strict";var b=a.i(60526),c=a.i(50227),d=a.i(94431);async function e(a){let e=await (0,d.openSqliteReadonly)(function(){if(process.env.OPENCODE_DB_PATH)return process.env.OPENCODE_DB_PATH;let a=process.env.OPENCODE_HOME??(0,c.join)((0,b.homedir)(),".local","share","opencode");return(0,c.join)(a,"opencode.db")}());if(!e)return null;try{return a(e)}catch{return null}finally{try{e.close()}catch{}}}async function f(a,b=[]){return e(c=>c.query(a,b))}a.s(["queryOpenCodeDb",0,f,"withOpenCodeDb",0,e])},64458,a=>{"use strict";var b=a.i(84794),c=a.i(90798),d=a.i(34900),e=a.i(33432),f=a.i(76668);async function g(){return(0,b.queryOpenCodeDb)("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session ORDER BY time_updated DESC LIMIT ?",[1e3])}async function h(){let a=await (0,b.withOpenCodeDb)(a=>({sessions:a.query("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session ORDER BY time_updated DESC LIMIT ?",[1e3]),projects:a.query("SELECT id, worktree, vcs, name, time_created, time_updated FROM project")}));return{sessions:a?.sessions??null,projects:a?.projects??null}}async function i(){let{sessions:a,projects:b}=await h();if(null===a&&null===b)return[];let d=new Map;for(let a of b??[])d.set(a.id,a);let f=new Map;for(let b of a??[]){if(!b.project_id)continue;let a=f.get(b.project_id);a||(a={rows:[],latest:0},f.set(b.project_id,a)),a.rows.push(b),b.time_updated>a.latest&&(a.latest=b.time_updated)}let g=new Set,i=[];for(let[a,b]of f){g.add(a);let f=d.get(a),h=f?.worktree??b.rows[0]?.directory??null,j=h?(0,c.encodeFolderName)(h):a,k=h??"",l=new Date(Math.max(b.latest,f?.time_updated??0));i.push({name:j,path:k,isDirectory:!0,lastModified:l,lastModifiedFormatted:(0,e.formatDate)(l),cli:["opencode"]})}for(let a of b??[]){if(g.has(a.id))continue;let b=a.worktree??"",d=b?(0,c.encodeFolderName)(b):a.id,f=new Date(a.time_updated);i.push({name:d,path:b,isDirectory:!0,lastModified:f,lastModifiedFormatted:(0,e.formatDate)(f),cli:["opencode"]})}return i.sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime()),i}async function j(a){let b=await g();return b?b.filter(b=>b.directory===a).map(a=>{let b=new Date(a.time_updated);return{name:a.title??a.slug??a.id,path:`opencode://${a.id}`,lastModified:b,lastModifiedFormatted:(0,e.formatDate)(b),sessionId:a.id,cli:"opencode"}}):[]}async function k(a){let b,d;try{({projects:b,sessions:d}=await h())}catch(a){return(0,f.logWarn)("Failed to read OpenCode DB:",a),{cwd:null,sessions:[]}}if(!b||!d)return{cwd:null,sessions:[]};let g=b.find(b=>b.worktree&&(0,c.encodeFolderName)(b.worktree)===a);if(!g||!g.worktree)return{cwd:null,sessions:[]};let i=d.filter(a=>a.project_id===g.id);return{cwd:g.worktree,sessions:i.map(a=>{let b=new Date(a.time_updated);return{name:a.title??a.slug??a.id,path:`opencode://${a.id}`,lastModified:b,lastModifiedFormatted:(0,e.formatDate)(b),sessionId:a.id,cli:"opencode"}})}}let l=(0,d.runtimeCache)(i,30),m=(0,d.runtimeCache)(a=>j(a),30,{maxSize:50}),n=(0,d.runtimeCache)(a=>k(a),30,{maxSize:50});a.s(["getCachedOpenCodeProjects",0,l,"getCachedOpenCodeSessionsByEncodedName",0,n,"getCachedOpenCodeSessionsForCwd",0,m,"getOpenCodeProjects",0,i,"getOpenCodeSessionsByEncodedName",0,k,"getOpenCodeSessionsForCwd",0,j])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=lib_1cf5ya2._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[64458,a=>{"use strict";var b=a.i(
|
|
1
|
+
module.exports=[64458,a=>{"use strict";var b=a.i(84794),c=a.i(90798),d=a.i(34900),e=a.i(33432),f=a.i(76668);async function g(){return(0,b.queryOpenCodeDb)("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session ORDER BY time_updated DESC LIMIT ?",[1e3])}async function h(){let a=await (0,b.withOpenCodeDb)(a=>({sessions:a.query("SELECT id, project_id, slug, directory, title, time_created, time_updated FROM session ORDER BY time_updated DESC LIMIT ?",[1e3]),projects:a.query("SELECT id, worktree, vcs, name, time_created, time_updated FROM project")}));return{sessions:a?.sessions??null,projects:a?.projects??null}}async function i(){let{sessions:a,projects:b}=await h();if(null===a&&null===b)return[];let d=new Map;for(let a of b??[])d.set(a.id,a);let f=new Map;for(let b of a??[]){if(!b.project_id)continue;let a=f.get(b.project_id);a||(a={rows:[],latest:0},f.set(b.project_id,a)),a.rows.push(b),b.time_updated>a.latest&&(a.latest=b.time_updated)}let g=new Set,i=[];for(let[a,b]of f){g.add(a);let f=d.get(a),h=f?.worktree??b.rows[0]?.directory??null,j=h?(0,c.encodeFolderName)(h):a,k=h??"",l=new Date(Math.max(b.latest,f?.time_updated??0));i.push({name:j,path:k,isDirectory:!0,lastModified:l,lastModifiedFormatted:(0,e.formatDate)(l),cli:["opencode"]})}for(let a of b??[]){if(g.has(a.id))continue;let b=a.worktree??"",d=b?(0,c.encodeFolderName)(b):a.id,f=new Date(a.time_updated);i.push({name:d,path:b,isDirectory:!0,lastModified:f,lastModifiedFormatted:(0,e.formatDate)(f),cli:["opencode"]})}return i.sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime()),i}async function j(a){let b=await g();return b?b.filter(b=>b.directory===a).map(a=>{let b=new Date(a.time_updated);return{name:a.title??a.slug??a.id,path:`opencode://${a.id}`,lastModified:b,lastModifiedFormatted:(0,e.formatDate)(b),sessionId:a.id,cli:"opencode"}}):[]}async function k(a){let b,d;try{({projects:b,sessions:d}=await h())}catch(a){return(0,f.logWarn)("Failed to read OpenCode DB:",a),{cwd:null,sessions:[]}}if(!b||!d)return{cwd:null,sessions:[]};let g=b.find(b=>b.worktree&&(0,c.encodeFolderName)(b.worktree)===a);if(!g||!g.worktree)return{cwd:null,sessions:[]};let i=d.filter(a=>a.project_id===g.id);return{cwd:g.worktree,sessions:i.map(a=>{let b=new Date(a.time_updated);return{name:a.title??a.slug??a.id,path:`opencode://${a.id}`,lastModified:b,lastModifiedFormatted:(0,e.formatDate)(b),sessionId:a.id,cli:"opencode"}})}}let l=(0,d.runtimeCache)(i,30),m=(0,d.runtimeCache)(a=>j(a),30,{maxSize:50}),n=(0,d.runtimeCache)(a=>k(a),30,{maxSize:50});a.s(["getCachedOpenCodeProjects",0,l,"getCachedOpenCodeSessionsByEncodedName",0,n,"getCachedOpenCodeSessionsForCwd",0,m,"getOpenCodeProjects",0,i,"getOpenCodeSessionsByEncodedName",0,k,"getOpenCodeSessionsForCwd",0,j])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=lib_opencode-projects_ts_15bjxkm._.js.map
|