failproofai 0.0.14 → 0.0.15-beta.1
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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js +1 -1
- 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 +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 +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +2 -2
- 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 +20 -8
- 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 +4 -4
- 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 +4 -4
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +3 -3
- 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/chunks/[root-of-the-server]__0-219ec._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0hv08mx._.js → [root-of-the-server]__0-dh5jy._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04_h-a5._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06cuf1y._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0obaznk._.js → [root-of-the-server]__0h3lfmp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jnjf2t._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0xvsnvt._.js → [root-of-the-server]__0l4vuqm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0longh-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sb_5m8._.js +4 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xuaoik._.js +6 -4
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1hkdkmz._.js → [root-of-the-server]__10oa-v9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__16le-kd._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1i9rknc._.js → [root-of-the-server]__18d-9oi._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19120tr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fwl2mz._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1is3glr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1myjm-d._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +6 -6
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hdsupo._.js → [root-of-the-server]__0114ewg._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01od0m6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02r5bgf._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e8sjqm._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lkzqax._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lpvwqm._.js +21 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ynf7tx._.js → [root-of-the-server]__0qucxyj._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u02miy._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uno39i._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1s2b6h0._.js → [root-of-the-server]__0x3anhr._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y4wf1u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__170799-._.js +10 -10
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00cz9as._.js → [root-of-the-server]__1apb7k_._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ath6v_._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1nq7ivq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1py795m._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1qapotl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1zqz4v8._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_077y5np._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1-3unkg._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1e19atl._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1m_p7pi._.js +3 -0
- 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_components_project-list_tsx_1ke6anr._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/lib_0xkhw_v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/lib_hermes-projects_ts_05b8-it._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/lib_openclaw-projects_ts_0qxq3bp._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0gkzjaa.js → node_modules_html-to-image_es_index_1wnt2ya.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +6 -6
- 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 +22 -10
- package/.next/standalone/.next/static/chunks/{29o4j32z643_a.js → 05h7pau8d3rpj.js} +1 -1
- package/.next/standalone/.next/static/chunks/0oos4ntyvkmjl.js +1 -0
- package/.next/standalone/.next/static/chunks/0tuwf_7uhfn2y.js +6 -0
- package/.next/standalone/.next/static/chunks/1hdhteui932bq.js +1 -0
- package/.next/standalone/.next/static/chunks/1l6q2-8m0gk19.js +1 -0
- package/.next/standalone/.next/static/chunks/2geqsiz0n8e3w.js +1 -0
- package/.next/standalone/.next/static/chunks/{3-ogr79xqbw0h.js → 2mazwb1qmur1p.js} +1 -1
- package/.next/standalone/.next/static/chunks/2pujpnfx4pws6.css +2 -0
- package/.next/standalone/.next/static/chunks/{1ua5armwfph8o.js → 31fmsp1soxi07.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3s8aaig91937v.js → 37-so-zy208k7.js} +1 -1
- package/.next/standalone/.next/static/chunks/3a_o5v_sl858j.js +1 -0
- package/.next/standalone/.next/static/chunks/{02jcotghcxrbu.js → 3kmwfieo15mr2.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2uh_4k4m296z5.js → 3p66lo2y-ezfr.js} +1 -1
- package/.next/standalone/.next/static/chunks/{06z_ex1ts3n4s.js → 412ajx6jkb5_i.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-10hj8t5pf33tu.js → turbopack-1lsv92x7klwrn.js} +1 -1
- package/.next/standalone/app/actions/get-hooks-config.ts +125 -8
- package/.next/standalone/app/actions/update-hooks-config.ts +38 -1
- package/.next/standalone/app/components/project-list.tsx +229 -42
- package/.next/standalone/app/policies/hooks-client.tsx +149 -27
- package/.next/standalone/app/project/[name]/page.tsx +12 -2
- package/.next/standalone/integration-suite/README.md +43 -1
- package/.next/standalone/integration-suite/ci-entrypoint.sh +21 -6
- package/.next/standalone/integration-suite/install-clis.sh +58 -13
- package/.next/standalone/integration-suite/probe-cli.sh +51 -11
- package/.next/standalone/integration-suite/report.js +52 -6
- package/.next/standalone/integration-suite/run.sh +55 -3
- package/.next/standalone/lib/hermes-profiles.ts +156 -0
- package/.next/standalone/lib/hermes-projects.ts +91 -25
- package/.next/standalone/lib/hermes-sessions.ts +65 -10
- package/.next/standalone/lib/openclaw-projects.ts +111 -18
- package/.next/standalone/lib/openclaw-sessions.ts +20 -0
- package/.next/standalone/lib/paths.ts +36 -0
- package/.next/standalone/lib/project-tree.ts +193 -0
- package/.next/standalone/lib/projects.ts +22 -0
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/next-config-ts/transpile-config.js +3 -114
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/cli/next-test.js +2 -1
- package/.next/standalone/node_modules/next/dist/compiled/http-proxy/index.js +5 -5
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +11 -10
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +11 -10
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +9 -9
- package/.next/standalone/node_modules/next/dist/lib/install-dependencies.js +1 -1
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/lib/typescript/loadTsConfig.js +181 -0
- package/.next/standalone/node_modules/next/dist/lib/typescript/missingDependencyError.js +1 -1
- package/.next/standalone/node_modules/next/dist/lib/typescript/runTypeCheckCli.js +53 -0
- package/.next/standalone/node_modules/next/dist/lib/typescript/runTypeScriptCli.js +256 -0
- package/.next/standalone/node_modules/next/dist/lib/verify-typescript-setup.js +97 -56
- package/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +129 -34
- package/.next/standalone/node_modules/next/dist/server/app-render/manifests-singleton.js +52 -4
- package/.next/standalone/node_modules/next/dist/server/config-schema.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/config-shared.js +1 -2
- 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/image-optimizer.js +8 -27
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/index.js +90 -53
- package/.next/standalone/node_modules/next/dist/server/lib/patch-fetch.js +15 -2
- package/.next/standalone/node_modules/next/dist/server/lib/router-utils/proxy-request.js +4 -0
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +1 -1
- package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- package/.next/standalone/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +2 -1
- package/.next/standalone/node_modules/next/dist/shared/lib/server-reference-info.js +12 -0
- 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 +7 -6
- package/.next/standalone/pi-extension/index.ts +38 -5
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +14 -13
- package/dist/cli.mjs +789 -399
- package/lib/hermes-profiles.ts +156 -0
- package/lib/hermes-projects.ts +91 -25
- package/lib/hermes-sessions.ts +65 -10
- package/lib/openclaw-projects.ts +111 -18
- package/lib/openclaw-sessions.ts +20 -0
- package/lib/paths.ts +36 -0
- package/lib/project-tree.ts +193 -0
- package/lib/projects.ts +22 -0
- package/package.json +7 -6
- package/pi-extension/index.ts +38 -5
- package/scripts/launch.ts +7 -0
- package/src/audit/cli-adapters/hermes.ts +6 -3
- package/src/audit/cli-adapters/openclaw.ts +17 -13
- package/src/hooks/configure-wizard.ts +24 -2
- package/src/hooks/custom-hooks-loader.ts +90 -13
- package/src/hooks/enforcement-capability.ts +266 -0
- package/src/hooks/handler.ts +20 -3
- package/src/hooks/hook-activity-store.ts +14 -0
- package/src/hooks/hooks-config.ts +90 -6
- package/src/hooks/integrations.ts +123 -19
- package/src/hooks/manager.ts +206 -75
- package/src/hooks/policy-evaluator.ts +59 -7
- package/src/hooks/policy-types.ts +31 -0
- package/src/hooks/types.ts +50 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q2nbsl._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d9qen3._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mrihkj._.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_openclaw-projects_ts_0gc-p24._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__015_i4t._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__030k0c6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03lv-pe._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__042d3cd._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09q1168._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qeuy9c._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s89hoe._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zf8xlq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17ai7sy._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1d8omgc._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1fax1sl._.js +0 -19
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tkjqka._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_05whahf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0_9_ytf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1kje4fm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1p0-leb._.js +0 -3
- package/.next/standalone/.next/static/chunks/0o0ut0ugd0_-s.js +0 -1
- package/.next/standalone/.next/static/chunks/0xl97x-874k-u.js +0 -1
- package/.next/standalone/.next/static/chunks/19d7hqx8udopz.js +0 -1
- package/.next/standalone/.next/static/chunks/36j05kb2x323i.css +0 -2
- package/.next/standalone/.next/static/chunks/370sj2lgkw5ey.js +0 -1
- package/.next/standalone/.next/static/chunks/3w7g0n0iwwnbs.js +0 -1
- package/.next/standalone/.next/static/chunks/42oeva1-w0z2d.js +0 -6
- /package/.next/standalone/.next/static/{WQRKgSfFekLcC_pvyzp4S → nhn6Tt0--xZKdgVGIqR6E}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{WQRKgSfFekLcC_pvyzp4S → nhn6Tt0--xZKdgVGIqR6E}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{WQRKgSfFekLcC_pvyzp4S → nhn6Tt0--xZKdgVGIqR6E}/_ssgManifest.js +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { useState, useMemo, useEffect, useRef } from "react";
|
|
8
8
|
import { ProjectFolder } from "@/lib/projects";
|
|
9
9
|
import { CliBadge } from "./cli-badge";
|
|
10
|
-
import {
|
|
10
|
+
import { projectDisplayName } from "@/lib/paths";
|
|
11
11
|
import { formatDate } from "@/lib/format-date";
|
|
12
12
|
import {
|
|
13
13
|
FILTER_PRESETS,
|
|
@@ -24,7 +24,13 @@ import {
|
|
|
24
24
|
pageToParam, paramToPage,
|
|
25
25
|
} from "@/lib/url-filter-serializers";
|
|
26
26
|
import { KNOWN_CLI_IDS, getCliLabel, isKnownCli, type CliId } from "@/lib/cli-registry";
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
buildProjectTree,
|
|
29
|
+
visibleTreeRows,
|
|
30
|
+
collapsibleKeys,
|
|
31
|
+
type ProjectTreeNode,
|
|
32
|
+
} from "@/lib/project-tree";
|
|
33
|
+
import { ChevronDown, ChevronRight, Folder, Search, X } from "lucide-react";
|
|
28
34
|
import Link from "next/link";
|
|
29
35
|
import PaginationControls from "./pagination-controls";
|
|
30
36
|
import DatePickerInput from "./date-picker-input";
|
|
@@ -44,6 +50,126 @@ function normalizeKeywordForSearch(keyword: string): string {
|
|
|
44
50
|
return keyword.trim().toLowerCase().replace(/\//g, "-");
|
|
45
51
|
}
|
|
46
52
|
|
|
53
|
+
/** Where collapsed folder rows are remembered between visits. */
|
|
54
|
+
const COLLAPSED_STORAGE_KEY = "failproofai.projects.collapsed";
|
|
55
|
+
|
|
56
|
+
function readCollapsed(): string[] {
|
|
57
|
+
try {
|
|
58
|
+
const raw = window.localStorage.getItem(COLLAPSED_STORAGE_KEY);
|
|
59
|
+
const parsed = raw ? JSON.parse(raw) : null;
|
|
60
|
+
return Array.isArray(parsed) ? parsed.filter((k) => typeof k === "string") : [];
|
|
61
|
+
} catch {
|
|
62
|
+
// Private mode / disabled storage / corrupt value — everything stays expanded.
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function persistCollapsed(keys: Set<string>): void {
|
|
68
|
+
try {
|
|
69
|
+
window.localStorage.setItem(COLLAPSED_STORAGE_KEY, JSON.stringify([...keys]));
|
|
70
|
+
} catch {
|
|
71
|
+
// Storage unavailable — collapsing still works for this session.
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* One row of the projects table — a leaf project, or a folder grouping the
|
|
77
|
+
* gateway CLIs' (profile/agent, channel) hierarchy.
|
|
78
|
+
*
|
|
79
|
+
* Both shapes render as a `<tr>` in the SAME table so the Path and Last
|
|
80
|
+
* Modified columns stay aligned down the page; depth becomes left padding on
|
|
81
|
+
* the name cell rather than a nested table.
|
|
82
|
+
*/
|
|
83
|
+
function ProjectRow({
|
|
84
|
+
node,
|
|
85
|
+
collapsed,
|
|
86
|
+
interactive,
|
|
87
|
+
onToggle,
|
|
88
|
+
}: {
|
|
89
|
+
node: ProjectTreeNode;
|
|
90
|
+
collapsed: boolean;
|
|
91
|
+
/** False while a search force-expands the tree — see the folder branch below. */
|
|
92
|
+
interactive: boolean;
|
|
93
|
+
onToggle: (key: string) => void;
|
|
94
|
+
}) {
|
|
95
|
+
const isFolder = node.children.length > 0;
|
|
96
|
+
const project = node.project;
|
|
97
|
+
const Chevron = collapsed ? ChevronRight : ChevronDown;
|
|
98
|
+
|
|
99
|
+
// Depth is indentation, capped so a deep gateway path can't push the name off
|
|
100
|
+
// a narrow screen.
|
|
101
|
+
//
|
|
102
|
+
// Applied to the icon cell as well as the name, not just the name: the icon
|
|
103
|
+
// lives in its own <td>, so indenting only the name left every child's folder
|
|
104
|
+
// icon sitting at the same x as its parent's. The row then read as a flat
|
|
105
|
+
// list with ragged text rather than a hierarchy. Shifting both by the same
|
|
106
|
+
// amount moves icon and label together, so a child visibly starts to the
|
|
107
|
+
// right of its parent's icon.
|
|
108
|
+
const indent = { paddingLeft: `${Math.min(node.depth, 4) * 1.25}rem` };
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<tr className="border-b border-border hover:bg-muted/50 transition-colors">
|
|
112
|
+
<td className="px-4 py-3">
|
|
113
|
+
<div style={indent}>
|
|
114
|
+
<Folder className={`w-5 h-5 ${isFolder ? "text-muted-foreground" : "text-primary"}`} />
|
|
115
|
+
</div>
|
|
116
|
+
</td>
|
|
117
|
+
<td className="px-4 py-3 max-w-md">
|
|
118
|
+
<div className="flex flex-wrap items-center gap-2" style={indent}>
|
|
119
|
+
{isFolder ? (
|
|
120
|
+
// While a search is active the tree is force-expanded, so a toggle
|
|
121
|
+
// could only flip hidden state: it would look interactive, do
|
|
122
|
+
// nothing on screen, and silently invert what gets remembered once
|
|
123
|
+
// the search is cleared. Render it inert instead.
|
|
124
|
+
interactive ? (
|
|
125
|
+
<button
|
|
126
|
+
type="button"
|
|
127
|
+
onClick={() => onToggle(node.key)}
|
|
128
|
+
aria-expanded={!collapsed}
|
|
129
|
+
aria-label={`${collapsed ? "Expand" : "Collapse"} ${node.label}`}
|
|
130
|
+
className="flex items-center gap-1 font-semibold text-foreground hover:text-primary transition-colors break-words break-all text-left"
|
|
131
|
+
>
|
|
132
|
+
<Chevron className="w-4 h-4 shrink-0" />
|
|
133
|
+
{node.label}
|
|
134
|
+
</button>
|
|
135
|
+
) : (
|
|
136
|
+
<span className="flex items-center gap-1 font-semibold text-foreground break-words break-all">
|
|
137
|
+
<Chevron className="w-4 h-4 shrink-0" />
|
|
138
|
+
{node.label}
|
|
139
|
+
</span>
|
|
140
|
+
)
|
|
141
|
+
) : project ? (
|
|
142
|
+
<Link
|
|
143
|
+
href={`/project/${encodeURIComponent(project.name)}`}
|
|
144
|
+
className="font-semibold text-foreground hover:text-primary transition-colors break-words break-all inline-block max-w-full"
|
|
145
|
+
>
|
|
146
|
+
{/* Leaves of a gateway tree show only their own segment; a
|
|
147
|
+
filesystem project keeps its full decoded path. */}
|
|
148
|
+
{node.depth > 0 ? node.label : projectDisplayName(project.name, project.path)}
|
|
149
|
+
</Link>
|
|
150
|
+
) : (
|
|
151
|
+
<span className="font-semibold text-foreground">{node.label}</span>
|
|
152
|
+
)}
|
|
153
|
+
{node.cli.map((c) => (
|
|
154
|
+
<CliBadge key={c} cli={c} />
|
|
155
|
+
))}
|
|
156
|
+
{isFolder && node.sessionCount !== undefined && (
|
|
157
|
+
<span className="text-xs text-muted-foreground">
|
|
158
|
+
{node.sessionCount} session{node.sessionCount === 1 ? "" : "s"}
|
|
159
|
+
</span>
|
|
160
|
+
)}
|
|
161
|
+
</div>
|
|
162
|
+
</td>
|
|
163
|
+
<td className="px-4 py-3 text-sm text-muted-foreground hidden md:table-cell truncate max-w-md">
|
|
164
|
+
{project ? project.path : ""}
|
|
165
|
+
</td>
|
|
166
|
+
<td className="px-4 py-3 text-sm text-muted-foreground">
|
|
167
|
+
<DateDisplay date={node.lastModified} formatted={node.lastModifiedFormatted} />
|
|
168
|
+
</td>
|
|
169
|
+
</tr>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
47
173
|
export default function ProjectList({ folders }: ProjectListProps) {
|
|
48
174
|
const url = useUrlParams();
|
|
49
175
|
const mountedRef = useRef(false);
|
|
@@ -127,13 +253,88 @@ export default function ProjectList({ folders }: ProjectListProps) {
|
|
|
127
253
|
return filtered.sort((a, b) => b.lastModified.getTime() - a.lastModified.getTime());
|
|
128
254
|
}, [normalizedFolders, filterPreset, dateRange, keywords, filterCli]);
|
|
129
255
|
|
|
130
|
-
|
|
256
|
+
// ── Folder tree ──
|
|
257
|
+
//
|
|
258
|
+
// Built from ALL filtered projects, never from a page slice: a gateway root's
|
|
259
|
+
// channels are individual projects interleaved by recency, so slicing first
|
|
260
|
+
// would split one profile across two pages — rendering the root twice, each
|
|
261
|
+
// time rolling up only the sessions that happened to land on that page, with
|
|
262
|
+
// the true total shown nowhere. Grouping is pure presentation; project names,
|
|
263
|
+
// and therefore every /project/<name> link, are untouched.
|
|
264
|
+
const tree = useMemo(() => buildProjectTree(filteredFolders), [filteredFolders]);
|
|
265
|
+
|
|
266
|
+
// Pagination walks TOP-LEVEL rows. With no gateway CLIs every root is exactly
|
|
267
|
+
// one project, so the page size and the reported range are identical to the
|
|
268
|
+
// flat table's; a gateway CLI simply folds its channels into one entry.
|
|
269
|
+
const totalPages = Math.max(1, Math.ceil(tree.length / ITEMS_PER_PAGE));
|
|
131
270
|
useEffect(() => {
|
|
132
271
|
if (currentPage > totalPages) setCurrentPage(totalPages);
|
|
133
272
|
}, [currentPage, totalPages, setCurrentPage]);
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
const
|
|
273
|
+
const rootStart = (currentPage - 1) * ITEMS_PER_PAGE;
|
|
274
|
+
const rootEnd = Math.min(rootStart + ITEMS_PER_PAGE, tree.length);
|
|
275
|
+
const pageRoots = useMemo(() => tree.slice(rootStart, rootEnd), [tree, rootStart, rootEnd]);
|
|
276
|
+
|
|
277
|
+
// The summary counts PROJECTS, so derive its range from the projects the
|
|
278
|
+
// displayed roots actually cover rather than from the row indices.
|
|
279
|
+
const projectsBefore = tree
|
|
280
|
+
.slice(0, rootStart)
|
|
281
|
+
.reduce((sum, node) => sum + node.projectCount, 0);
|
|
282
|
+
const projectsOnPage = pageRoots.reduce((sum, node) => sum + node.projectCount, 0);
|
|
283
|
+
const startIndex = projectsBefore;
|
|
284
|
+
const endIndex = projectsBefore + projectsOnPage;
|
|
285
|
+
|
|
286
|
+
// Collapsed (not expanded) is what we persist: a profile or agent appearing
|
|
287
|
+
// for the first time should be visible, not hidden behind a click nobody
|
|
288
|
+
// knows to make. Loaded in an effect, never during render — reading
|
|
289
|
+
// localStorage while rendering would desync the server-rendered HTML.
|
|
290
|
+
const [collapsed, setCollapsed] = useState<Set<string>>(() => new Set());
|
|
291
|
+
useEffect(() => {
|
|
292
|
+
setCollapsed(new Set(readCollapsed()));
|
|
293
|
+
}, []);
|
|
294
|
+
|
|
295
|
+
const toggleCollapsed = (key: string) => {
|
|
296
|
+
setCollapsed((prev) => {
|
|
297
|
+
const next = new Set(prev);
|
|
298
|
+
if (next.has(key)) next.delete(key);
|
|
299
|
+
else next.add(key);
|
|
300
|
+
persistCollapsed(next);
|
|
301
|
+
return next;
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
// A search that matched something must not leave the match hidden inside a
|
|
306
|
+
// collapsed folder, so an active search force-expands everything.
|
|
307
|
+
const searching = keywords.length > 0;
|
|
308
|
+
const visibleRows = useMemo(
|
|
309
|
+
() => visibleTreeRows(pageRoots, (key) => !searching && collapsed.has(key)),
|
|
310
|
+
[pageRoots, collapsed, searching],
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
// Keys the bulk toggle acts on: everything collapsible in the CURRENT view
|
|
314
|
+
// (this page, this filter). It must never be used to REPLACE the stored set —
|
|
315
|
+
// see toggleAll.
|
|
316
|
+
const pageCollapsibleKeys = useMemo(() => collapsibleKeys(pageRoots), [pageRoots]);
|
|
317
|
+
// The label, though, follows what is on SCREEN. Judging it by the whole page's
|
|
318
|
+
// keys would keep saying "Collapse all" after a root was collapsed, because
|
|
319
|
+
// its hidden descendants are still expanded — a button that then does nothing
|
|
320
|
+
// visible.
|
|
321
|
+
const visibleCollapsibleKeys = visibleRows.filter((n) => n.children.length > 0).map((n) => n.key);
|
|
322
|
+
const anyExpanded = visibleCollapsibleKeys.some((k) => !collapsed.has(k));
|
|
323
|
+
|
|
324
|
+
const toggleAll = () => {
|
|
325
|
+
setCollapsed((prev) => {
|
|
326
|
+
// MERGE, never replace: the stored set spans every page and filter, so
|
|
327
|
+
// assigning this view's keys wholesale would silently discard collapses
|
|
328
|
+
// the user made elsewhere.
|
|
329
|
+
const next = new Set(prev);
|
|
330
|
+
for (const key of pageCollapsibleKeys) {
|
|
331
|
+
if (anyExpanded) next.add(key);
|
|
332
|
+
else next.delete(key);
|
|
333
|
+
}
|
|
334
|
+
persistCollapsed(next);
|
|
335
|
+
return next;
|
|
336
|
+
});
|
|
337
|
+
};
|
|
137
338
|
|
|
138
339
|
return (
|
|
139
340
|
<div className="space-y-4">
|
|
@@ -266,11 +467,20 @@ export default function ProjectList({ folders }: ProjectListProps) {
|
|
|
266
467
|
</div>
|
|
267
468
|
|
|
268
469
|
{/* Results Count */}
|
|
269
|
-
<div className="text-sm text-muted-foreground">
|
|
470
|
+
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground">
|
|
471
|
+
{pageCollapsibleKeys.length > 0 && !searching && (
|
|
472
|
+
<button
|
|
473
|
+
type="button"
|
|
474
|
+
onClick={toggleAll}
|
|
475
|
+
className="text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors"
|
|
476
|
+
>
|
|
477
|
+
{anyExpanded ? "Collapse all" : "Expand all"}
|
|
478
|
+
</button>
|
|
479
|
+
)}
|
|
270
480
|
{filteredFolders.length === 0 ? (
|
|
271
|
-
|
|
481
|
+
<span>No projects found</span>
|
|
272
482
|
) : (
|
|
273
|
-
|
|
483
|
+
<span>
|
|
274
484
|
Showing {startIndex + 1}-{endIndex} of {filteredFolders.length} projects
|
|
275
485
|
{filteredFolders.length !== normalizedFolders.length && (
|
|
276
486
|
<span className="ml-1">
|
|
@@ -282,7 +492,7 @@ export default function ProjectList({ folders }: ProjectListProps) {
|
|
|
282
492
|
with {keywords.length} keyword{keywords.length !== 1 ? "s" : ""}
|
|
283
493
|
</span>
|
|
284
494
|
)}
|
|
285
|
-
|
|
495
|
+
</span>
|
|
286
496
|
)}
|
|
287
497
|
</div>
|
|
288
498
|
</div>
|
|
@@ -309,44 +519,21 @@ export default function ProjectList({ folders }: ProjectListProps) {
|
|
|
309
519
|
</tr>
|
|
310
520
|
</thead>
|
|
311
521
|
<tbody>
|
|
312
|
-
{
|
|
522
|
+
{visibleRows.length === 0 ? (
|
|
313
523
|
<tr>
|
|
314
524
|
<td colSpan={4} className="px-4 py-8 text-center text-muted-foreground">
|
|
315
525
|
No projects found matching the selected filter.
|
|
316
526
|
</td>
|
|
317
527
|
</tr>
|
|
318
528
|
) : (
|
|
319
|
-
|
|
320
|
-
<
|
|
321
|
-
key={
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
<td className="px-4 py-3 max-w-md">
|
|
328
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
329
|
-
<Link
|
|
330
|
-
href={`/project/${encodeURIComponent(folder.name)}`}
|
|
331
|
-
className="font-semibold text-foreground hover:text-primary transition-colors break-words break-all inline-block max-w-full"
|
|
332
|
-
>
|
|
333
|
-
{decodeFolderName(folder.name)}
|
|
334
|
-
</Link>
|
|
335
|
-
{folder.cli.map((c) => (
|
|
336
|
-
<CliBadge key={c} cli={c} />
|
|
337
|
-
))}
|
|
338
|
-
</div>
|
|
339
|
-
</td>
|
|
340
|
-
<td className="px-4 py-3 text-sm text-muted-foreground hidden md:table-cell truncate max-w-md">
|
|
341
|
-
{folder.path}
|
|
342
|
-
</td>
|
|
343
|
-
<td className="px-4 py-3 text-sm text-muted-foreground">
|
|
344
|
-
<DateDisplay
|
|
345
|
-
date={folder.lastModified}
|
|
346
|
-
formatted={folder.lastModifiedFormatted}
|
|
347
|
-
/>
|
|
348
|
-
</td>
|
|
349
|
-
</tr>
|
|
529
|
+
visibleRows.map((node) => (
|
|
530
|
+
<ProjectRow
|
|
531
|
+
key={node.key}
|
|
532
|
+
node={node}
|
|
533
|
+
collapsed={!searching && collapsed.has(node.key)}
|
|
534
|
+
interactive={!searching}
|
|
535
|
+
onToggle={toggleCollapsed}
|
|
536
|
+
/>
|
|
350
537
|
))
|
|
351
538
|
)}
|
|
352
539
|
</tbody>
|
|
@@ -3,25 +3,14 @@
|
|
|
3
3
|
import React, { useState, useEffect, useCallback, useMemo, useRef, useTransition } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import Link from "next/link";
|
|
6
|
-
import {
|
|
7
|
-
ShieldCheck,
|
|
8
|
-
ShieldX,
|
|
9
|
-
ShieldAlert,
|
|
10
|
-
Shield,
|
|
11
|
-
ChevronDown,
|
|
12
|
-
Copy,
|
|
13
|
-
Check,
|
|
14
|
-
Settings,
|
|
15
|
-
Code,
|
|
16
|
-
X,
|
|
17
|
-
} from "lucide-react";
|
|
6
|
+
import { Check, ChevronDown, Code, Copy, Settings, Shield, ShieldAlert, ShieldCheck, ShieldX, TriangleAlert, X } from "lucide-react";
|
|
18
7
|
import PaginationControls from "@/app/components/pagination-controls";
|
|
19
8
|
import { getHookActivityAction, searchHookActivityAction } from "@/app/actions/get-hook-activity";
|
|
20
9
|
import type { HookActivityPayload } from "@/app/actions/get-hook-activity";
|
|
21
10
|
import { getHooksConfigAction } from "@/app/actions/get-hooks-config";
|
|
22
11
|
import type { HooksConfigPayload, PolicyInfo, CustomPolicyInfo } from "@/app/actions/get-hooks-config";
|
|
23
12
|
import type { IntegrationType } from "@/src/hooks/types";
|
|
24
|
-
import { togglePolicyAction } from "@/app/actions/update-hooks-config";
|
|
13
|
+
import { toggleCustomPolicyAction, togglePolicyAction } from "@/app/actions/update-hooks-config";
|
|
25
14
|
import { installHooksWebAction, removeHooksWebAction } from "@/app/actions/install-hooks-web";
|
|
26
15
|
import { updatePolicyParamsAction } from "@/app/actions/update-policy-params";
|
|
27
16
|
import { useAutoRefresh } from "@/contexts/AutoRefreshContext";
|
|
@@ -29,6 +18,7 @@ import { usePostHog } from "@/contexts/PostHogContext";
|
|
|
29
18
|
import { useUrlParams } from "@/lib/use-url-params";
|
|
30
19
|
import { pageToParam, paramToPage } from "@/lib/url-filter-serializers";
|
|
31
20
|
import { getCliLabel, getCliBadgeClasses, KNOWN_CLI_IDS, isKnownCli, type CliId } from "@/lib/cli-registry";
|
|
21
|
+
import { enforcementFor } from "@/src/hooks/enforcement-capability";
|
|
32
22
|
import { formatRelativeTime } from "@/lib/format-duration";
|
|
33
23
|
import { Button } from "@/components/ui/button";
|
|
34
24
|
|
|
@@ -330,6 +320,58 @@ function StatsBar({ stats }: { stats: HookActivityPayload["stats"] }) {
|
|
|
330
320
|
|
|
331
321
|
// -- Expandable Detail Panel --
|
|
332
322
|
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* "Your policy ran, but this event cannot block on this CLI."
|
|
326
|
+
*
|
|
327
|
+
* Renders ONLY when the (cli, event) pair is a verified `observe`. A pair we
|
|
328
|
+
* have not traced returns undefined from `enforcementFor` and this renders
|
|
329
|
+
* nothing — a hedge ("capability unverified") would still be a claim, and
|
|
330
|
+
* unverified claims are the failure this whole matrix exists to prevent.
|
|
331
|
+
*
|
|
332
|
+
* The deny case matters more than the allow case: the row already says
|
|
333
|
+
* "denied", the activity store recorded a deny, and telemetry counted one — so
|
|
334
|
+
* without this note the UI actively reports enforcement that did not happen.
|
|
335
|
+
*/
|
|
336
|
+
function EnforcementNote({
|
|
337
|
+
item,
|
|
338
|
+
}: {
|
|
339
|
+
item: HookActivityPayload["entries"][number];
|
|
340
|
+
}) {
|
|
341
|
+
const capability = enforcementFor(
|
|
342
|
+
item.integration as IntegrationType | undefined,
|
|
343
|
+
item.eventType,
|
|
344
|
+
);
|
|
345
|
+
if (capability !== "observe") return null;
|
|
346
|
+
|
|
347
|
+
const ran = item.matchedPolicies ?? [];
|
|
348
|
+
// Rows written before matchedPolicies existed have no list; naming no policy
|
|
349
|
+
// is better than implying none ran.
|
|
350
|
+
if (ran.length === 0) return null;
|
|
351
|
+
|
|
352
|
+
const cli = item.integration ? getCliLabel(item.integration as IntegrationType) : "This CLI";
|
|
353
|
+
const names = ran.map((n) => n.replace(/^(custom|\.failproofai-(project|user))\//, ""));
|
|
354
|
+
const label = names.length === 1 ? names[0] : `${names.length} policies`;
|
|
355
|
+
const denied = item.decision === "deny";
|
|
356
|
+
|
|
357
|
+
return (
|
|
358
|
+
<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">
|
|
359
|
+
<TriangleAlert className="h-3.5 w-3.5 shrink-0 text-amber-500/80 mt-0.5" aria-hidden="true" />
|
|
360
|
+
<p className="text-[0.7rem] leading-relaxed text-muted-foreground">
|
|
361
|
+
<span className="font-medium text-foreground">
|
|
362
|
+
{denied ? "Not enforced." : "Ran, but cannot enforce here."}
|
|
363
|
+
</span>{" "}
|
|
364
|
+
<span className="font-mono">{label}</span> ran on{" "}
|
|
365
|
+
<span className="font-mono">{item.eventType}</span>, but {cli} discards hook
|
|
366
|
+
verdicts for this event
|
|
367
|
+
{denied ? " — the action went ahead anyway." : ", so a policy cannot block here."}{" "}
|
|
368
|
+
Move the check to an event {cli} enforces on, such as{" "}
|
|
369
|
+
<span className="font-mono">PreToolUse</span>.
|
|
370
|
+
</p>
|
|
371
|
+
</div>
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
|
|
333
375
|
function DetailPanel({
|
|
334
376
|
item,
|
|
335
377
|
}: {
|
|
@@ -340,10 +382,11 @@ function DetailPanel({
|
|
|
340
382
|
<td colSpan={11} className="px-0 py-0">
|
|
341
383
|
<div className="activity-detail animate-expand text-xs">
|
|
342
384
|
<span className="activity-detail-eyebrow">
|
|
343
|
-
<span aria-hidden="true"
|
|
385
|
+
<span aria-hidden="true">{"\u25BE"}</span>
|
|
344
386
|
event detail
|
|
345
387
|
</span>
|
|
346
388
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-2">
|
|
389
|
+
<EnforcementNote item={item} />
|
|
347
390
|
<div>
|
|
348
391
|
<span className="text-muted-foreground">Session ID: </span>
|
|
349
392
|
<span className="font-mono text-foreground">
|
|
@@ -1171,6 +1214,26 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
|
|
|
1171
1214
|
});
|
|
1172
1215
|
};
|
|
1173
1216
|
|
|
1217
|
+
const handleCustomToggle = (id: string, currentlyEnabled: boolean) => {
|
|
1218
|
+
if (!config) return;
|
|
1219
|
+
setConfig((prev) => prev ? {
|
|
1220
|
+
...prev,
|
|
1221
|
+
customPolicies: prev.customPolicies?.map((p) => p.id === id ? { ...p, enabled: !currentlyEnabled } : p),
|
|
1222
|
+
conventionPolicies: prev.conventionPolicies.map((entry) => ({
|
|
1223
|
+
...entry,
|
|
1224
|
+
policies: entry.policies.map((p) => p.id === id ? { ...p, enabled: !currentlyEnabled } : p),
|
|
1225
|
+
})),
|
|
1226
|
+
} : prev);
|
|
1227
|
+
startTransition(async () => {
|
|
1228
|
+
try {
|
|
1229
|
+
await toggleCustomPolicyAction(id, !currentlyEnabled);
|
|
1230
|
+
} catch {
|
|
1231
|
+
fireActionError("custom_policy_toggle", "Failed to save custom policy change.");
|
|
1232
|
+
reload();
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1174
1237
|
const handleApply = () => {
|
|
1175
1238
|
const { toInstall, toRemove } = pendingChanges;
|
|
1176
1239
|
if (toInstall.length === 0 && toRemove.length === 0) return;
|
|
@@ -1233,7 +1296,7 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
|
|
|
1233
1296
|
if (!config) {
|
|
1234
1297
|
return (
|
|
1235
1298
|
<div className="flex items-center justify-center py-16">
|
|
1236
|
-
<span className="text-sm text-muted-foreground">Loading\u2026</span>
|
|
1299
|
+
<span className="text-sm text-muted-foreground">Loading{"\u2026"}</span>
|
|
1237
1300
|
</div>
|
|
1238
1301
|
);
|
|
1239
1302
|
}
|
|
@@ -1427,7 +1490,7 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
|
|
|
1427
1490
|
<span className="text-xs text-muted-foreground">
|
|
1428
1491
|
<span className="font-semibold text-foreground">{config.enabledPolicies.length}</span>
|
|
1429
1492
|
{" / "}
|
|
1430
|
-
{config.policies.length + (config.customPolicies?.length ?? 0)}{" "}
|
|
1493
|
+
{config.policies.length + (config.customPolicies?.length ?? 0) + (config.conventionPolicies?.reduce((n, e) => n + e.policies.length, 0) ?? 0)}{" "}
|
|
1431
1494
|
policies enabled
|
|
1432
1495
|
</span>
|
|
1433
1496
|
{installed && (
|
|
@@ -1546,7 +1609,7 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
|
|
|
1546
1609
|
})}
|
|
1547
1610
|
|
|
1548
1611
|
{/* Custom policies section */}
|
|
1549
|
-
{config.customPoliciesPath && (
|
|
1612
|
+
{(config.customPoliciesPaths?.length || config.customPoliciesPath) && (
|
|
1550
1613
|
<div>
|
|
1551
1614
|
{/* Section header — matches category header style */}
|
|
1552
1615
|
<div className="flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50">
|
|
@@ -1557,26 +1620,28 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
|
|
|
1557
1620
|
{config.customPolicies?.length ?? 0} detected
|
|
1558
1621
|
</span>
|
|
1559
1622
|
</div>
|
|
1560
|
-
{
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1623
|
+
{(config.customPoliciesPaths ?? [config.customPoliciesPath!]).map((path) => (
|
|
1624
|
+
<div key={path} className="flex items-center gap-3 px-4 py-3 border-b border-border/20">
|
|
1625
|
+
<Code className="h-3.5 w-3.5 text-muted-foreground shrink-0" />
|
|
1626
|
+
<span className="text-xs font-mono text-muted-foreground truncate">{path}</span>
|
|
1627
|
+
</div>
|
|
1628
|
+
))}
|
|
1565
1629
|
{/* Reconfigure notice */}
|
|
1566
1630
|
<div className="flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10">
|
|
1567
1631
|
<Shield className="h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5" />
|
|
1568
1632
|
<p className="text-[0.7rem] text-muted-foreground/70 leading-relaxed">
|
|
1569
|
-
|
|
1633
|
+
Re-run the install command to add, remove, or reorder files.
|
|
1570
1634
|
</p>
|
|
1571
1635
|
</div>
|
|
1572
1636
|
{/* Rich policy rows — mirrors built-in layout without toggle */}
|
|
1573
1637
|
{config.customPolicies?.map((policy) => (
|
|
1574
1638
|
<div
|
|
1575
|
-
key={policy.
|
|
1639
|
+
key={policy.id}
|
|
1576
1640
|
className="flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors"
|
|
1577
1641
|
>
|
|
1578
|
-
|
|
1579
|
-
|
|
1642
|
+
<div className="mt-0.5 shrink-0">
|
|
1643
|
+
<PolicyToggle enabled={policy.enabled} onChange={() => handleCustomToggle(policy.id, policy.enabled)} disabled={isPending} />
|
|
1644
|
+
</div>
|
|
1580
1645
|
<div className="flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5">
|
|
1581
1646
|
<span className="text-xs font-mono text-foreground truncate">{policy.name}</span>
|
|
1582
1647
|
</div>
|
|
@@ -1596,6 +1661,60 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
|
|
|
1596
1661
|
))}
|
|
1597
1662
|
</div>
|
|
1598
1663
|
)}
|
|
1664
|
+
|
|
1665
|
+
{/* Convention policies — discovered from .failproofai/policies/, never
|
|
1666
|
+
from config, so they are grouped by the file that declares them. */}
|
|
1667
|
+
{config.conventionPolicies?.map((entry) => (
|
|
1668
|
+
<div key={entry.path}>
|
|
1669
|
+
<div className="flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50">
|
|
1670
|
+
<span className="text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground">
|
|
1671
|
+
Convention Policies — {entry.scope === "project" ? "Project" : "User"}
|
|
1672
|
+
</span>
|
|
1673
|
+
<span className="text-[0.7rem] text-muted-foreground">
|
|
1674
|
+
{entry.policies.length} hook{entry.policies.length === 1 ? "" : "s"}
|
|
1675
|
+
</span>
|
|
1676
|
+
</div>
|
|
1677
|
+
<div className="flex items-center gap-3 px-4 py-3 border-b border-border/20">
|
|
1678
|
+
<Code className="h-3.5 w-3.5 text-muted-foreground shrink-0" />
|
|
1679
|
+
<span className="text-xs font-mono text-muted-foreground truncate">{entry.path}</span>
|
|
1680
|
+
</div>
|
|
1681
|
+
{entry.policies.length === 0 ? (
|
|
1682
|
+
<div className="flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10">
|
|
1683
|
+
<Shield className="h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5" />
|
|
1684
|
+
<p className="text-[0.7rem] text-muted-foreground/70 leading-relaxed">
|
|
1685
|
+
No policies could be read from this file. It is still loaded at runtime —
|
|
1686
|
+
run <span className="font-mono">failproofai policies</span> to see what it registers.
|
|
1687
|
+
</p>
|
|
1688
|
+
</div>
|
|
1689
|
+
) : (
|
|
1690
|
+
entry.policies.map((policy) => (
|
|
1691
|
+
<div
|
|
1692
|
+
key={`${entry.path}:${policy.name}`}
|
|
1693
|
+
className="flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors"
|
|
1694
|
+
>
|
|
1695
|
+
<div className="mt-0.5 shrink-0">
|
|
1696
|
+
<PolicyToggle enabled={policy.enabled} onChange={() => handleCustomToggle(policy.id, policy.enabled)} disabled={isPending} />
|
|
1697
|
+
</div>
|
|
1698
|
+
<div className="flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5">
|
|
1699
|
+
<span className="text-xs font-mono text-foreground truncate">{policy.name}</span>
|
|
1700
|
+
</div>
|
|
1701
|
+
<div className="flex-1 min-w-0">
|
|
1702
|
+
{policy.description && (
|
|
1703
|
+
<span className="text-xs text-muted-foreground leading-relaxed">
|
|
1704
|
+
{policy.description}
|
|
1705
|
+
</span>
|
|
1706
|
+
)}
|
|
1707
|
+
{policy.eventScope && (
|
|
1708
|
+
<span className="block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block">
|
|
1709
|
+
{policy.eventScope}
|
|
1710
|
+
</span>
|
|
1711
|
+
)}
|
|
1712
|
+
</div>
|
|
1713
|
+
</div>
|
|
1714
|
+
))
|
|
1715
|
+
)}
|
|
1716
|
+
</div>
|
|
1717
|
+
))}
|
|
1599
1718
|
</div>
|
|
1600
1719
|
</>
|
|
1601
1720
|
);
|
|
@@ -1646,7 +1765,10 @@ export default function HooksClient({ initialTab = "activity" }: { initialTab?:
|
|
|
1646
1765
|
setHooksInstalled(cfg.clis.some((c) => c.installed));
|
|
1647
1766
|
setPolicyCounts({
|
|
1648
1767
|
enabled: cfg.enabledPolicies.length,
|
|
1649
|
-
total:
|
|
1768
|
+
total:
|
|
1769
|
+
cfg.policies.length +
|
|
1770
|
+
(cfg.customPolicies?.length ?? 0) +
|
|
1771
|
+
(cfg.conventionPolicies?.reduce((n, e) => n + e.policies.length, 0) ?? 0),
|
|
1650
1772
|
});
|
|
1651
1773
|
setInstalledCliLabels(cfg.clis.filter((c) => c.installed).map((c) => c.label));
|
|
1652
1774
|
})
|
|
@@ -13,7 +13,7 @@ import { getCachedDevinSessionsByEncodedName } from "@/lib/devin-projects";
|
|
|
13
13
|
import { getCachedAntigravitySessionsByEncodedName } from "@/lib/antigravity-projects";
|
|
14
14
|
import { getCachedGooseSessionsByEncodedName } from "@/lib/goose-projects";
|
|
15
15
|
import { logWarn } from "@/lib/logger";
|
|
16
|
-
import { decodeFolderName } from "@/lib/paths";
|
|
16
|
+
import { decodeFolderName, projectDisplayName, isSyntheticProjectPath } from "@/lib/paths";
|
|
17
17
|
import { notFound } from "next/navigation";
|
|
18
18
|
import { existsSync } from "fs";
|
|
19
19
|
import { stat } from "fs/promises";
|
|
@@ -150,7 +150,17 @@ export default async function ProjectPage({ params }: ProjectPageProps) {
|
|
|
150
150
|
back to projects
|
|
151
151
|
</Link>
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
{/* Gateway projects carry a synthetic `hermes:profile:source` root; show
|
|
154
|
+
the same slash form the projects panel does, so the page you land on
|
|
155
|
+
is titled what you clicked. Everything else keeps the LITERAL cwd
|
|
156
|
+
recovered above — passing it through projectDisplayName would discard
|
|
157
|
+
it and re-derive a lossy name from the slug, turning a real
|
|
158
|
+
`/home/u/my-app` into `/home/u/my/app`. */}
|
|
159
|
+
<h1 className="project-page-title">
|
|
160
|
+
{isSyntheticProjectPath(canonicalRoot)
|
|
161
|
+
? projectDisplayName(name, canonicalRoot)
|
|
162
|
+
: canonicalRoot}
|
|
163
|
+
</h1>
|
|
154
164
|
|
|
155
165
|
<div className="project-page-meta">
|
|
156
166
|
<span className="label">path</span>
|