failproofai 0.0.2-beta.8 → 0.0.2-beta.9
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/.claude/settings.json +26 -26
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- 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/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 +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/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 +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +17 -17
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +17 -17
- 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 +11 -11
- 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/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +16 -16
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- 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/server-reference-manifest.json +8 -8
- 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/server-reference-manifest.json +1 -1
- 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/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.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/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/chunks/[root-of-the-server]__0g72weg._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kjo7d_._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.t2266._.js → [root-of-the-server]__0vn1ciw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +2 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0pjorff._.js → [root-of-the-server]__0z-n~~r._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0x..fj-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +2 -2
- 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 +9 -9
- package/.next/standalone/.next/static/chunks/{0qi0ubup__3pj.js → 04wavch6dsfes.js} +1 -1
- package/.next/standalone/.next/static/chunks/{121a-0zn-knuy.js → 0drr--vxs_m-c.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0jf9lx3rkmqx_.css → 0gu_a.a80ritd.css} +1 -1
- package/.next/standalone/.next/static/chunks/{07g0rbtaux_1t.js → 0i1ilz5554nv9.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0j752uotyfvjh.js → 0keqg6-cjs8aa.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0xyvis4r_y.8o.js → 0myzx7y.rqqi3.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0a_xh94bt.y0j.js → 0zfrusm~j404v.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0zfyfi1suoteq.js → 10xhknzfyigcu.js} +1 -1
- package/.next/standalone/.next/static/chunks/{04xfyqyhdxbxz.js → 16yg3xhkmdb9v.js} +1 -1
- package/.next/standalone/CHANGELOG.md +13 -0
- package/.next/standalone/CLAUDE.md +14 -0
- package/.next/standalone/README.md +16 -0
- package/.next/standalone/bun.lock +45 -0
- package/.next/standalone/dist/cli.mjs +12 -5
- package/.next/standalone/docs/ar/architecture.mdx +333 -0
- package/.next/standalone/docs/ar/built-in-policies.mdx +566 -0
- package/.next/standalone/docs/ar/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ar/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ar/cli/hook.mdx +31 -0
- package/.next/standalone/docs/ar/cli/install-policies.mdx +49 -0
- package/.next/standalone/docs/ar/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/ar/cli/remove-policies.mdx +45 -0
- package/.next/standalone/docs/ar/cli/version.mdx +13 -0
- package/.next/standalone/docs/ar/configuration.mdx +223 -0
- package/.next/standalone/docs/ar/custom-policies.mdx +359 -0
- package/.next/standalone/docs/ar/dashboard.mdx +142 -0
- package/.next/standalone/docs/ar/examples.mdx +254 -0
- package/.next/standalone/docs/ar/for-agents.mdx +39 -0
- package/.next/standalone/docs/ar/getting-started.mdx +134 -0
- package/.next/standalone/docs/ar/introduction.mdx +58 -0
- package/.next/standalone/docs/ar/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ar/testing.mdx +261 -0
- package/.next/standalone/docs/de/architecture.mdx +332 -0
- package/.next/standalone/docs/de/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/de/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/de/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/de/cli/hook.mdx +30 -0
- package/.next/standalone/docs/de/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/de/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/de/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/de/cli/version.mdx +12 -0
- package/.next/standalone/docs/de/configuration.mdx +222 -0
- package/.next/standalone/docs/de/custom-policies.mdx +357 -0
- package/.next/standalone/docs/de/dashboard.mdx +142 -0
- package/.next/standalone/docs/de/examples.mdx +253 -0
- package/.next/standalone/docs/de/for-agents.mdx +38 -0
- package/.next/standalone/docs/de/getting-started.mdx +134 -0
- package/.next/standalone/docs/de/introduction.mdx +57 -0
- package/.next/standalone/docs/de/package-aliases.mdx +82 -0
- package/.next/standalone/docs/de/testing.mdx +260 -0
- package/.next/standalone/docs/docs.json +922 -35
- package/.next/standalone/docs/es/architecture.mdx +332 -0
- package/.next/standalone/docs/es/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/es/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/es/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/es/cli/hook.mdx +30 -0
- package/.next/standalone/docs/es/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/es/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/es/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/es/cli/version.mdx +12 -0
- package/.next/standalone/docs/es/configuration.mdx +222 -0
- package/.next/standalone/docs/es/custom-policies.mdx +357 -0
- package/.next/standalone/docs/es/dashboard.mdx +142 -0
- package/.next/standalone/docs/es/examples.mdx +253 -0
- package/.next/standalone/docs/es/for-agents.mdx +38 -0
- package/.next/standalone/docs/es/getting-started.mdx +134 -0
- package/.next/standalone/docs/es/introduction.mdx +57 -0
- package/.next/standalone/docs/es/package-aliases.mdx +82 -0
- package/.next/standalone/docs/es/testing.mdx +260 -0
- package/.next/standalone/docs/fr/architecture.mdx +332 -0
- package/.next/standalone/docs/fr/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/fr/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/fr/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/fr/cli/hook.mdx +30 -0
- package/.next/standalone/docs/fr/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/fr/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/fr/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/fr/cli/version.mdx +12 -0
- package/.next/standalone/docs/fr/configuration.mdx +222 -0
- package/.next/standalone/docs/fr/custom-policies.mdx +357 -0
- package/.next/standalone/docs/fr/dashboard.mdx +142 -0
- package/.next/standalone/docs/fr/examples.mdx +253 -0
- package/.next/standalone/docs/fr/for-agents.mdx +38 -0
- package/.next/standalone/docs/fr/getting-started.mdx +134 -0
- package/.next/standalone/docs/fr/introduction.mdx +57 -0
- package/.next/standalone/docs/fr/package-aliases.mdx +82 -0
- package/.next/standalone/docs/fr/testing.mdx +260 -0
- package/.next/standalone/docs/he/architecture.mdx +333 -0
- package/.next/standalone/docs/he/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/he/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/he/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/he/cli/hook.mdx +30 -0
- package/.next/standalone/docs/he/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/he/cli/list-policies.mdx +32 -0
- package/.next/standalone/docs/he/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/he/cli/version.mdx +12 -0
- package/.next/standalone/docs/he/configuration.mdx +222 -0
- package/.next/standalone/docs/he/custom-policies.mdx +357 -0
- package/.next/standalone/docs/he/dashboard.mdx +142 -0
- package/.next/standalone/docs/he/examples.mdx +253 -0
- package/.next/standalone/docs/he/for-agents.mdx +38 -0
- package/.next/standalone/docs/he/getting-started.mdx +135 -0
- package/.next/standalone/docs/he/introduction.mdx +57 -0
- package/.next/standalone/docs/he/package-aliases.mdx +82 -0
- package/.next/standalone/docs/he/testing.mdx +260 -0
- package/.next/standalone/docs/hi/architecture.mdx +334 -0
- package/.next/standalone/docs/hi/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/hi/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/hi/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/hi/cli/hook.mdx +30 -0
- package/.next/standalone/docs/hi/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/hi/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/hi/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/hi/cli/version.mdx +12 -0
- package/.next/standalone/docs/hi/configuration.mdx +222 -0
- package/.next/standalone/docs/hi/custom-policies.mdx +357 -0
- package/.next/standalone/docs/hi/dashboard.mdx +142 -0
- package/.next/standalone/docs/hi/examples.mdx +255 -0
- package/.next/standalone/docs/hi/for-agents.mdx +38 -0
- package/.next/standalone/docs/hi/getting-started.mdx +134 -0
- package/.next/standalone/docs/hi/introduction.mdx +57 -0
- package/.next/standalone/docs/hi/package-aliases.mdx +82 -0
- package/.next/standalone/docs/hi/testing.mdx +260 -0
- package/.next/standalone/docs/i18n/README.ar.md +312 -0
- package/.next/standalone/docs/i18n/README.de.md +307 -0
- package/.next/standalone/docs/i18n/README.es.md +307 -0
- package/.next/standalone/docs/i18n/README.fr.md +307 -0
- package/.next/standalone/docs/i18n/README.he.md +312 -0
- package/.next/standalone/docs/i18n/README.hi.md +307 -0
- package/.next/standalone/docs/i18n/README.it.md +307 -0
- package/.next/standalone/docs/i18n/README.ja.md +307 -0
- package/.next/standalone/docs/i18n/README.ko.md +307 -0
- package/.next/standalone/docs/i18n/README.pt-br.md +307 -0
- package/.next/standalone/docs/i18n/README.ru.md +308 -0
- package/.next/standalone/docs/i18n/README.tr.md +308 -0
- package/.next/standalone/docs/i18n/README.vi.md +308 -0
- package/.next/standalone/docs/i18n/README.zh.md +307 -0
- package/.next/standalone/docs/it/architecture.mdx +333 -0
- package/.next/standalone/docs/it/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/it/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/it/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/it/cli/hook.mdx +30 -0
- package/.next/standalone/docs/it/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/it/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/it/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/it/cli/version.mdx +12 -0
- package/.next/standalone/docs/it/configuration.mdx +223 -0
- package/.next/standalone/docs/it/custom-policies.mdx +358 -0
- package/.next/standalone/docs/it/dashboard.mdx +142 -0
- package/.next/standalone/docs/it/examples.mdx +253 -0
- package/.next/standalone/docs/it/for-agents.mdx +38 -0
- package/.next/standalone/docs/it/getting-started.mdx +134 -0
- package/.next/standalone/docs/it/introduction.mdx +57 -0
- package/.next/standalone/docs/it/package-aliases.mdx +82 -0
- package/.next/standalone/docs/it/testing.mdx +260 -0
- package/.next/standalone/docs/ja/architecture.mdx +332 -0
- package/.next/standalone/docs/ja/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/ja/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ja/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ja/cli/hook.mdx +30 -0
- package/.next/standalone/docs/ja/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/ja/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/ja/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/ja/cli/version.mdx +12 -0
- package/.next/standalone/docs/ja/configuration.mdx +222 -0
- package/.next/standalone/docs/ja/custom-policies.mdx +357 -0
- package/.next/standalone/docs/ja/dashboard.mdx +142 -0
- package/.next/standalone/docs/ja/examples.mdx +253 -0
- package/.next/standalone/docs/ja/for-agents.mdx +38 -0
- package/.next/standalone/docs/ja/getting-started.mdx +134 -0
- package/.next/standalone/docs/ja/introduction.mdx +57 -0
- package/.next/standalone/docs/ja/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ja/testing.mdx +260 -0
- package/.next/standalone/docs/ko/architecture.mdx +332 -0
- package/.next/standalone/docs/ko/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/ko/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ko/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ko/cli/hook.mdx +30 -0
- package/.next/standalone/docs/ko/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/ko/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/ko/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/ko/cli/version.mdx +12 -0
- package/.next/standalone/docs/ko/configuration.mdx +222 -0
- package/.next/standalone/docs/ko/custom-policies.mdx +357 -0
- package/.next/standalone/docs/ko/dashboard.mdx +142 -0
- package/.next/standalone/docs/ko/examples.mdx +253 -0
- package/.next/standalone/docs/ko/for-agents.mdx +38 -0
- package/.next/standalone/docs/ko/getting-started.mdx +134 -0
- package/.next/standalone/docs/ko/introduction.mdx +57 -0
- package/.next/standalone/docs/ko/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ko/testing.mdx +260 -0
- package/.next/standalone/docs/pt-br/architecture.mdx +332 -0
- package/.next/standalone/docs/pt-br/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/pt-br/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/pt-br/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/pt-br/cli/hook.mdx +30 -0
- package/.next/standalone/docs/pt-br/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/pt-br/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/pt-br/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/pt-br/cli/version.mdx +12 -0
- package/.next/standalone/docs/pt-br/configuration.mdx +222 -0
- package/.next/standalone/docs/pt-br/custom-policies.mdx +357 -0
- package/.next/standalone/docs/pt-br/dashboard.mdx +142 -0
- package/.next/standalone/docs/pt-br/examples.mdx +253 -0
- package/.next/standalone/docs/pt-br/for-agents.mdx +38 -0
- package/.next/standalone/docs/pt-br/getting-started.mdx +134 -0
- package/.next/standalone/docs/pt-br/introduction.mdx +57 -0
- package/.next/standalone/docs/pt-br/package-aliases.mdx +82 -0
- package/.next/standalone/docs/pt-br/testing.mdx +260 -0
- package/.next/standalone/docs/ru/architecture.mdx +334 -0
- package/.next/standalone/docs/ru/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/ru/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/ru/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/ru/cli/hook.mdx +30 -0
- package/.next/standalone/docs/ru/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/ru/cli/list-policies.mdx +32 -0
- package/.next/standalone/docs/ru/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/ru/cli/version.mdx +12 -0
- package/.next/standalone/docs/ru/configuration.mdx +223 -0
- package/.next/standalone/docs/ru/custom-policies.mdx +357 -0
- package/.next/standalone/docs/ru/dashboard.mdx +142 -0
- package/.next/standalone/docs/ru/examples.mdx +254 -0
- package/.next/standalone/docs/ru/for-agents.mdx +38 -0
- package/.next/standalone/docs/ru/getting-started.mdx +134 -0
- package/.next/standalone/docs/ru/introduction.mdx +57 -0
- package/.next/standalone/docs/ru/package-aliases.mdx +82 -0
- package/.next/standalone/docs/ru/testing.mdx +260 -0
- package/.next/standalone/docs/tr/architecture.mdx +333 -0
- package/.next/standalone/docs/tr/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/tr/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/tr/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/tr/cli/hook.mdx +30 -0
- package/.next/standalone/docs/tr/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/tr/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/tr/cli/remove-policies.mdx +45 -0
- package/.next/standalone/docs/tr/cli/version.mdx +12 -0
- package/.next/standalone/docs/tr/configuration.mdx +223 -0
- package/.next/standalone/docs/tr/custom-policies.mdx +357 -0
- package/.next/standalone/docs/tr/dashboard.mdx +142 -0
- package/.next/standalone/docs/tr/examples.mdx +253 -0
- package/.next/standalone/docs/tr/for-agents.mdx +38 -0
- package/.next/standalone/docs/tr/getting-started.mdx +134 -0
- package/.next/standalone/docs/tr/introduction.mdx +57 -0
- package/.next/standalone/docs/tr/package-aliases.mdx +82 -0
- package/.next/standalone/docs/tr/testing.mdx +260 -0
- package/.next/standalone/docs/vi/architecture.mdx +333 -0
- package/.next/standalone/docs/vi/built-in-policies.mdx +564 -0
- package/.next/standalone/docs/vi/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/vi/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/vi/cli/hook.mdx +30 -0
- package/.next/standalone/docs/vi/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/vi/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/vi/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/vi/cli/version.mdx +13 -0
- package/.next/standalone/docs/vi/configuration.mdx +222 -0
- package/.next/standalone/docs/vi/custom-policies.mdx +357 -0
- package/.next/standalone/docs/vi/dashboard.mdx +142 -0
- package/.next/standalone/docs/vi/examples.mdx +253 -0
- package/.next/standalone/docs/vi/for-agents.mdx +38 -0
- package/.next/standalone/docs/vi/getting-started.mdx +134 -0
- package/.next/standalone/docs/vi/introduction.mdx +57 -0
- package/.next/standalone/docs/vi/package-aliases.mdx +82 -0
- package/.next/standalone/docs/vi/testing.mdx +260 -0
- package/.next/standalone/docs/zh/architecture.mdx +332 -0
- package/.next/standalone/docs/zh/built-in-policies.mdx +562 -0
- package/.next/standalone/docs/zh/cli/dashboard.mdx +28 -0
- package/.next/standalone/docs/zh/cli/environment-variables.mdx +34 -0
- package/.next/standalone/docs/zh/cli/hook.mdx +30 -0
- package/.next/standalone/docs/zh/cli/install-policies.mdx +48 -0
- package/.next/standalone/docs/zh/cli/list-policies.mdx +31 -0
- package/.next/standalone/docs/zh/cli/remove-policies.mdx +44 -0
- package/.next/standalone/docs/zh/cli/version.mdx +12 -0
- package/.next/standalone/docs/zh/configuration.mdx +222 -0
- package/.next/standalone/docs/zh/custom-policies.mdx +357 -0
- package/.next/standalone/docs/zh/dashboard.mdx +142 -0
- package/.next/standalone/docs/zh/examples.mdx +253 -0
- package/.next/standalone/docs/zh/for-agents.mdx +38 -0
- package/.next/standalone/docs/zh/getting-started.mdx +134 -0
- package/.next/standalone/docs/zh/introduction.mdx +57 -0
- package/.next/standalone/docs/zh/package-aliases.mdx +82 -0
- package/.next/standalone/docs/zh/testing.mdx +260 -0
- package/.next/standalone/package.json +8 -2
- package/.next/standalone/scripts/translate-docs/cache.ts +62 -0
- package/.next/standalone/scripts/translate-docs/cli.ts +357 -0
- package/.next/standalone/scripts/translate-docs/config.ts +248 -0
- package/.next/standalone/scripts/translate-docs/mdx-translator.ts +153 -0
- package/.next/standalone/scripts/translate-docs/mintlify-nav.ts +107 -0
- package/.next/standalone/scripts/translate-docs/readme-translator.ts +154 -0
- package/.next/standalone/scripts/translate-docs/translator.ts +68 -0
- package/.next/standalone/scripts/translate-docs/types.ts +43 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/hooks/manager.ts +10 -2
- package/README.md +16 -0
- package/dist/cli.mjs +12 -5
- package/package.json +8 -2
- package/scripts/translate-docs/cache.ts +62 -0
- package/scripts/translate-docs/cli.ts +357 -0
- package/scripts/translate-docs/config.ts +248 -0
- package/scripts/translate-docs/mdx-translator.ts +153 -0
- package/scripts/translate-docs/mintlify-nav.ts +107 -0
- package/scripts/translate-docs/readme-translator.ts +154 -0
- package/scripts/translate-docs/translator.ts +68 -0
- package/scripts/translate-docs/types.ts +43 -0
- package/src/hooks/manager.ts +10 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02nt~6d._.js +0 -3
- /package/.next/standalone/.next/static/{itedhTSyIDln6TUf41j5X → XqGmAwGDuJ6fEQgD-8y60}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{itedhTSyIDln6TUf41j5X → XqGmAwGDuJ6fEQgD-8y60}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{itedhTSyIDln6TUf41j5X → XqGmAwGDuJ6fEQgD-8y60}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Alias de Paquetes
|
|
3
|
+
description: "Alias registrados para prevención de typosquatting y cómo funcionan"
|
|
4
|
+
icon: copy
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Paquete oficial
|
|
8
|
+
|
|
9
|
+
El paquete npm canónico es **`failproofai`**:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g failproofai
|
|
13
|
+
# or
|
|
14
|
+
bun add -g failproofai
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Por qué tenemos los alias registrados
|
|
20
|
+
|
|
21
|
+
El typosquatting es un ataque común a la cadena de suministro en el que un actor malicioso registra un nombre de paquete que difiere por una sola tecla del paquete popular. Los usuarios que escriben mal el comando de instalación terminan ejecutando código controlado por el atacante con acceso completo al sistema — exactamente el tipo de amenaza que Failproof AI está diseñado para defender.
|
|
22
|
+
|
|
23
|
+
Para eliminar esta superficie de ataque, **registramos de forma preventiva todas las variantes ortográficas y de formato más comunes** de `failproofai` en npm. Ninguno de estos nombres puede ser registrado por terceros. Cada uno es un proxy ligero que instala y delega al paquete real `failproofai`.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Alias registrados
|
|
28
|
+
|
|
29
|
+
**Variantes de formato** - diferentes formas de escribir "failproof ai":
|
|
30
|
+
|
|
31
|
+
| Paquete | Estado |
|
|
32
|
+
|---------|--------|
|
|
33
|
+
| `failproof` | ✅ Publicado |
|
|
34
|
+
| `failproof-ai` | ⏳ Pendiente de aprobación de npm |
|
|
35
|
+
| `fail-proof-ai` | ⏳ Pendiente de aprobación de npm |
|
|
36
|
+
| `failproof_ai` | ⏳ Pendiente de aprobación de npm |
|
|
37
|
+
| `fail_proof_ai` | ⏳ Pendiente de aprobación de npm |
|
|
38
|
+
| `fail-proofai` | ⏳ Pendiente de aprobación de npm |
|
|
39
|
+
|
|
40
|
+
**Errores tipográficos `failprof*`** - falta una `o` en "proof":
|
|
41
|
+
|
|
42
|
+
| Paquete | Estado |
|
|
43
|
+
|---------|--------|
|
|
44
|
+
| `failprof` | ✅ Publicado |
|
|
45
|
+
| `failprof-ai` | ✅ Publicado |
|
|
46
|
+
| `failprofai` | ⏳ Pendiente de aprobación de npm |
|
|
47
|
+
| `fail-prof-ai` | ⏳ Pendiente de aprobación de npm |
|
|
48
|
+
| `failprof_ai` | ⏳ Pendiente de aprobación de npm |
|
|
49
|
+
|
|
50
|
+
**Errores tipográficos `faliproof*`** - `a` e `i` transpuestas:
|
|
51
|
+
|
|
52
|
+
| Paquete | Estado |
|
|
53
|
+
|---------|--------|
|
|
54
|
+
| `faliproof` | ✅ Publicado |
|
|
55
|
+
| `faliproof-ai` | ✅ Publicado |
|
|
56
|
+
| `faliproofai` | ⏳ Pendiente de aprobación de npm |
|
|
57
|
+
|
|
58
|
+
> **¿Por qué están pendientes?** La política de prevención de spam de npm bloquea nombres que, tras eliminar la puntuación y aplicar comprobaciones de similitud, se normalizan a la misma cadena que un paquete existente. Hemos contactado con el soporte de npm para reservar estos nombres con fines de protección contra squatting. Se activarán una vez aprobados.
|
|
59
|
+
|
|
60
|
+
Puedes verificar que cualquier alias publicado nos pertenece:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm info failproof
|
|
64
|
+
# Look for: "ExosphereHost Inc." in the maintainers field
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Cómo funcionan los alias
|
|
70
|
+
|
|
71
|
+
Cada paquete alias:
|
|
72
|
+
|
|
73
|
+
1. Incluye `failproofai` como dependencia, por lo que el paquete real (incluida la configuración de su hook `postinstall`) se ejecuta durante la instalación
|
|
74
|
+
2. Expone un binario con su propio nombre (p. ej. `failprof-ai`) que redirige todos los argumentos al binario `failproofai`
|
|
75
|
+
|
|
76
|
+
El proxy es un script de Node de dos líneas; no contiene ninguna lógica adicional, no realiza llamadas de red ni recopila datos más allá de lo que hace el propio `failproofai`.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Si encuentras un nombre que nos hemos perdido
|
|
81
|
+
|
|
82
|
+
Abre un issue en [exospherehost/failproofai](https://github.com/exospherehost/failproofai/issues) y lo registraremos.
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Pruebas
|
|
3
|
+
description: "Pruebas unitarias, pruebas E2E y utilidades de prueba"
|
|
4
|
+
icon: flask-vial
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
failproofai cuenta con dos suites de pruebas: **pruebas unitarias** (rápidas, con mocks) y **pruebas end-to-end** (invocaciones reales de subprocesos).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Ejecutar las pruebas
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Ejecutar todas las pruebas unitarias una vez
|
|
15
|
+
bun run test:run
|
|
16
|
+
|
|
17
|
+
# Ejecutar pruebas unitarias en modo watch
|
|
18
|
+
bun run test
|
|
19
|
+
|
|
20
|
+
# Ejecutar pruebas E2E (requiere configuración previa; ver más abajo)
|
|
21
|
+
bun run test:e2e
|
|
22
|
+
|
|
23
|
+
# Verificar tipos sin compilar
|
|
24
|
+
bunx tsc --noEmit
|
|
25
|
+
|
|
26
|
+
# Linting
|
|
27
|
+
bun run lint
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Pruebas unitarias
|
|
33
|
+
|
|
34
|
+
Las pruebas unitarias se encuentran en `__tests__/` y utilizan [Vitest](https://vitest.dev) con `happy-dom`.
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
__tests__/
|
|
38
|
+
hooks/
|
|
39
|
+
builtin-policies.test.ts # Lógica de políticas para cada builtin
|
|
40
|
+
hooks-config.test.ts # Carga de configuración y fusión de scopes
|
|
41
|
+
policy-evaluator.test.ts # Inyección de parámetros y orden de evaluación
|
|
42
|
+
custom-hooks-registry.test.ts # Registro globalThis: add/get/clear
|
|
43
|
+
custom-hooks-loader.test.ts # Loader ESM, imports transitivos, manejo de errores
|
|
44
|
+
manager.test.ts # Operaciones install/remove/list
|
|
45
|
+
components/
|
|
46
|
+
sessions-list.test.tsx # Componente de lista de sesiones
|
|
47
|
+
project-list.test.tsx # Componente de lista de proyectos
|
|
48
|
+
...
|
|
49
|
+
lib/
|
|
50
|
+
logger.test.ts
|
|
51
|
+
paths.test.ts
|
|
52
|
+
date-filters.test.ts
|
|
53
|
+
telemetry.test.ts
|
|
54
|
+
...
|
|
55
|
+
actions/
|
|
56
|
+
get-hooks-config.test.ts
|
|
57
|
+
get-hook-activity.test.ts
|
|
58
|
+
...
|
|
59
|
+
contexts/
|
|
60
|
+
ThemeContext.test.tsx
|
|
61
|
+
AutoRefreshContext.test.tsx
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Escribir una prueba unitaria para una política
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
68
|
+
import { getBuiltinPolicies } from "../../src/hooks/builtin-policies";
|
|
69
|
+
import { allow, deny } from "../../src/hooks/policy-types";
|
|
70
|
+
|
|
71
|
+
describe("block-sudo", () => {
|
|
72
|
+
const policy = getBuiltinPolicies().find((p) => p.name === "block-sudo")!;
|
|
73
|
+
|
|
74
|
+
it("denies sudo commands", () => {
|
|
75
|
+
const ctx = {
|
|
76
|
+
eventType: "PreToolUse" as const,
|
|
77
|
+
payload: {},
|
|
78
|
+
toolName: "Bash",
|
|
79
|
+
toolInput: { command: "sudo apt install nodejs" },
|
|
80
|
+
params: { allowPatterns: [] },
|
|
81
|
+
};
|
|
82
|
+
expect(policy.fn(ctx)).toEqual(deny("sudo command blocked by failproofai"));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("allows non-sudo commands", () => {
|
|
86
|
+
const ctx = {
|
|
87
|
+
eventType: "PreToolUse" as const,
|
|
88
|
+
payload: {},
|
|
89
|
+
toolName: "Bash",
|
|
90
|
+
toolInput: { command: "ls -la" },
|
|
91
|
+
params: { allowPatterns: [] },
|
|
92
|
+
};
|
|
93
|
+
expect(policy.fn(ctx)).toEqual(allow());
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("allows patterns in allowPatterns", () => {
|
|
97
|
+
const ctx = {
|
|
98
|
+
eventType: "PreToolUse" as const,
|
|
99
|
+
payload: {},
|
|
100
|
+
toolName: "Bash",
|
|
101
|
+
toolInput: { command: "sudo systemctl status nginx" },
|
|
102
|
+
params: { allowPatterns: ["sudo systemctl status"] },
|
|
103
|
+
};
|
|
104
|
+
expect(policy.fn(ctx)).toEqual(allow());
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Pruebas end-to-end
|
|
112
|
+
|
|
113
|
+
Las pruebas E2E invocan el binario real de `failproofai` como un subproceso, envían un payload JSON a stdin y verifican la salida por stdout y el código de salida. Esto prueba el flujo de integración completo que utiliza Claude Code.
|
|
114
|
+
|
|
115
|
+
### Configuración
|
|
116
|
+
|
|
117
|
+
Las pruebas E2E ejecutan el binario directamente desde el código fuente del repositorio. Antes de la primera ejecución, compila el bundle CJS que utilizan los archivos de hooks personalizados cuando importan desde `'failproofai'`:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bun build src/index.ts --outdir dist --target node --format cjs
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Luego ejecuta las pruebas:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
bun run test:e2e
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Recompila `dist/` cada vez que modifiques la API pública de hooks (`src/hooks/custom-hooks-registry.ts`, `src/hooks/policy-helpers.ts` o `src/hooks/policy-types.ts`).
|
|
130
|
+
|
|
131
|
+
### Estructura de las pruebas E2E
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
__tests__/e2e/
|
|
135
|
+
helpers/
|
|
136
|
+
hook-runner.ts # Lanza el binario, envía el payload JSON, captura código de salida + stdout + stderr
|
|
137
|
+
fixture-env.ts # Directorios temporales aislados por prueba con archivos de configuración
|
|
138
|
+
payloads.ts # Factorías de payloads precisas para cada tipo de evento de Claude
|
|
139
|
+
hooks/
|
|
140
|
+
builtin-policies.e2e.test.ts # Cada política builtin con subproceso real
|
|
141
|
+
custom-hooks.e2e.test.ts # Carga y evaluación de hooks personalizados
|
|
142
|
+
config-scopes.e2e.test.ts # Fusión de configuración entre scopes: project/local/global
|
|
143
|
+
policy-params.e2e.test.ts # Inyección de parámetros para cada política parametrizada
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Uso de los helpers E2E
|
|
147
|
+
|
|
148
|
+
**`FixtureEnv`** — entorno aislado por prueba:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { createFixtureEnv } from "../helpers/fixture-env";
|
|
152
|
+
|
|
153
|
+
const env = createFixtureEnv();
|
|
154
|
+
// env.cwd - directorio temporal; pásalo como payload.cwd para que detecte .failproofai/policies-config.json
|
|
155
|
+
// env.home - directorio home aislado; evita que ~/.failproofai real interfiera
|
|
156
|
+
|
|
157
|
+
env.writeConfig({
|
|
158
|
+
enabledPolicies: ["block-sudo"],
|
|
159
|
+
policyParams: {
|
|
160
|
+
"block-sudo": { allowPatterns: ["sudo systemctl status"] },
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`createFixtureEnv()` registra la limpieza con `afterEach` automáticamente.
|
|
166
|
+
|
|
167
|
+
**`runHook`** — invocar el binario:
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { runHook } from "../helpers/hook-runner";
|
|
171
|
+
import { Payloads } from "../helpers/payloads";
|
|
172
|
+
|
|
173
|
+
const result = await runHook(
|
|
174
|
+
"PreToolUse",
|
|
175
|
+
Payloads.preToolUse.bash("sudo apt install nodejs", env.cwd),
|
|
176
|
+
{ homeDir: env.home }
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
expect(result.exitCode).toBe(0);
|
|
180
|
+
expect(result.parsed?.hookSpecificOutput?.permissionDecision).toBe("deny");
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**`Payloads`** — factorías de payloads predefinidas:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
Payloads.preToolUse.bash(command, cwd)
|
|
187
|
+
Payloads.preToolUse.write(filePath, content, cwd)
|
|
188
|
+
Payloads.preToolUse.read(filePath, cwd)
|
|
189
|
+
Payloads.postToolUse.bash(command, output, cwd)
|
|
190
|
+
Payloads.postToolUse.read(filePath, content, cwd)
|
|
191
|
+
Payloads.notification(message, cwd)
|
|
192
|
+
Payloads.stop(cwd)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Escribir una prueba E2E
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { describe, it, expect } from "vitest";
|
|
199
|
+
import { createFixtureEnv } from "../helpers/fixture-env";
|
|
200
|
+
import { runHook } from "../helpers/hook-runner";
|
|
201
|
+
import { Payloads } from "../helpers/payloads";
|
|
202
|
+
|
|
203
|
+
describe("block-rm-rf (E2E)", () => {
|
|
204
|
+
it("denies rm -rf", async () => {
|
|
205
|
+
const env = createFixtureEnv();
|
|
206
|
+
env.writeConfig({ enabledPolicies: ["block-rm-rf"] });
|
|
207
|
+
|
|
208
|
+
const result = await runHook(
|
|
209
|
+
"PreToolUse",
|
|
210
|
+
Payloads.preToolUse.bash("rm -rf /", env.cwd),
|
|
211
|
+
{ homeDir: env.home }
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
expect(result.exitCode).toBe(0);
|
|
215
|
+
expect(result.parsed?.hookSpecificOutput?.permissionDecision).toBe("deny");
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it("allows non-recursive rm", async () => {
|
|
219
|
+
const env = createFixtureEnv();
|
|
220
|
+
env.writeConfig({ enabledPolicies: ["block-rm-rf"] });
|
|
221
|
+
|
|
222
|
+
const result = await runHook(
|
|
223
|
+
"PreToolUse",
|
|
224
|
+
Payloads.preToolUse.bash("rm /tmp/file.txt", env.cwd),
|
|
225
|
+
{ homeDir: env.home }
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
expect(result.exitCode).toBe(0);
|
|
229
|
+
expect(result.stdout).toBe(""); // allow → stdout vacío
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Formas de respuesta E2E
|
|
235
|
+
|
|
236
|
+
| Decisión | Código de salida | stdout |
|
|
237
|
+
|----------|-----------------|--------|
|
|
238
|
+
| `PreToolUse` deny | `0` | `{"hookSpecificOutput":{"permissionDecision":"deny","permissionDecisionReason":"..."}}` |
|
|
239
|
+
| `PostToolUse` deny | `0` | `{"hookSpecificOutput":{"additionalContext":"Blocked ... because: ..."}}` |
|
|
240
|
+
| Instruct (no Stop) | `0` | `{"hookSpecificOutput":{"additionalContext":"Instruction from failproofai: ..."}}` |
|
|
241
|
+
| Stop instruct | `2` | stdout vacío; motivo en stderr |
|
|
242
|
+
| Allow | `0` | cadena vacía |
|
|
243
|
+
|
|
244
|
+
### Configuración de Vitest
|
|
245
|
+
|
|
246
|
+
Las pruebas E2E utilizan `vitest.config.e2e.mts` con:
|
|
247
|
+
|
|
248
|
+
- `environment: "node"` — no se necesitan globales del navegador
|
|
249
|
+
- `pool: "forks"` — aislamiento real de procesos (las pruebas lanzan subprocesos)
|
|
250
|
+
- `testTimeout: 20_000` — 20 segundos por prueba (arranque del binario + evaluación del hook)
|
|
251
|
+
|
|
252
|
+
El pool `forks` es importante: los workers basados en hilos comparten `globalThis`, lo que puede interferir con pruebas que lanzan subprocesos. Los forks basados en procesos evitan este problema.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## CI
|
|
257
|
+
|
|
258
|
+
La ejecución completa de CI (`bun run lint && bunx tsc --noEmit && bun run test:run && bun run build`) debe pasar antes de hacer merge. La suite E2E se ejecuta como un job de CI separado en paralelo.
|
|
259
|
+
|
|
260
|
+
Consulta [Contributing](../CONTRIBUTING.md) para ver el checklist completo previo al merge.
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Architecture
|
|
3
|
+
description: "Fonctionnement interne du gestionnaire de hooks, du chargement de la configuration et de l'évaluation des politiques"
|
|
4
|
+
icon: sitemap
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Ce document explique le fonctionnement interne de failproofai : comment le système de hooks intercepte les appels d'outils des agents, comment la configuration est chargée et fusionnée, comment les politiques sont évaluées, et comment le tableau de bord surveille l'activité des agents.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Vue d'ensemble
|
|
12
|
+
|
|
13
|
+
failproofai comporte deux sous-systèmes indépendants :
|
|
14
|
+
|
|
15
|
+
1. **Gestionnaire de hooks** - Un sous-processus CLI rapide que Claude Code invoque à chaque appel d'outil d'agent. Il évalue les politiques et retourne une décision.
|
|
16
|
+
2. **Moniteur d'agent (Tableau de bord)** - Une application web Next.js pour surveiller les sessions d'agent et gérer les politiques.
|
|
17
|
+
|
|
18
|
+
Les deux sous-systèmes partagent les fichiers de configuration dans `~/.failproofai/` et le répertoire `.failproofai/` du projet, mais s'exécutent en tant que processus séparés et ne communiquent qu'à travers le système de fichiers.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Gestionnaire de hooks
|
|
23
|
+
|
|
24
|
+
### Intégration avec Claude Code
|
|
25
|
+
|
|
26
|
+
Lorsque vous exécutez `failproofai policies --install`, des entrées comme celle-ci sont écrites dans `~/.claude/settings.json` :
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"hooks": {
|
|
31
|
+
"PreToolUse": [
|
|
32
|
+
{
|
|
33
|
+
"matcher": "",
|
|
34
|
+
"hooks": [
|
|
35
|
+
{
|
|
36
|
+
"type": "command",
|
|
37
|
+
"command": "failproofai --hook PreToolUse"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"PostToolUse": [ ... ]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Claude Code invoque ensuite `failproofai --hook PreToolUse` en tant que sous-processus avant chaque appel d'outil, en transmettant un payload JSON sur stdin.
|
|
48
|
+
|
|
49
|
+
### Format du payload
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"session_id": "abc123",
|
|
54
|
+
"transcript_path": "/home/user/.claude/projects/myproject/sessions/abc123.jsonl",
|
|
55
|
+
"cwd": "/home/user/myproject",
|
|
56
|
+
"permission_mode": "default",
|
|
57
|
+
"hook_event_name": "PreToolUse",
|
|
58
|
+
"tool_name": "Bash",
|
|
59
|
+
"tool_input": { "command": "sudo apt install nodejs" }
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Pour les événements `PostToolUse`, le payload contient également `tool_result` avec la sortie de l'outil.
|
|
64
|
+
|
|
65
|
+
Le gestionnaire impose une limite de 1 Mo sur stdin. Les payloads dépassant cette limite sont ignorés et toutes les politiques autorisent implicitement.
|
|
66
|
+
|
|
67
|
+
### Format de la réponse
|
|
68
|
+
|
|
69
|
+
**Refus (PreToolUse) :**
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"hookSpecificOutput": {
|
|
73
|
+
"permissionDecision": "deny",
|
|
74
|
+
"permissionDecisionReason": "Blocked by failproofai: sudo command blocked"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Refus (PostToolUse) :**
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"hookSpecificOutput": {
|
|
83
|
+
"additionalContext": "Blocked by failproofai because: API key detected in output"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Instruction (tout événement sauf Stop) :**
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"hookSpecificOutput": {
|
|
92
|
+
"additionalContext": "Instruction from failproofai: Verify tests pass before committing."
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Instruction sur l'événement Stop :**
|
|
98
|
+
- Code de sortie : `2`
|
|
99
|
+
- Raison écrite sur stderr (pas sur stdout)
|
|
100
|
+
|
|
101
|
+
**Autorisation :**
|
|
102
|
+
- Code de sortie : `0`
|
|
103
|
+
- stdout vide
|
|
104
|
+
|
|
105
|
+
**Autorisation avec message (bêta) :**
|
|
106
|
+
|
|
107
|
+
Depuis la version v0.0.2-beta.3, `allow(message)` permet à une politique d'envoyer un contexte informatif à Claude même lorsque l'opération est autorisée. Le gestionnaire de hooks écrit le JSON suivant sur **stdout** (pas dans un fichier de configuration — il s'agit de la réponse du gestionnaire à Claude Code, tout comme les réponses de refus et d'instruction ci-dessus) :
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
// Written to stdout by the hook handler process
|
|
111
|
+
{
|
|
112
|
+
"hookSpecificOutput": {
|
|
113
|
+
"additionalContext": "All CI checks passed on branch 'feat/my-feature'."
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
- Code de sortie : `0` (l'opération est autorisée)
|
|
118
|
+
- Lorsque plusieurs politiques retournent `allow` avec un message, leurs messages sont joints par des sauts de ligne en une seule chaîne `additionalContext`
|
|
119
|
+
- Si aucune politique ne fournit de message, stdout est vide (comme auparavant)
|
|
120
|
+
|
|
121
|
+
### Pipeline de traitement
|
|
122
|
+
|
|
123
|
+
`src/hooks/handler.ts` implémente le pipeline complet :
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
stdin JSON
|
|
127
|
+
→ analyser le payload (max 1 Mo)
|
|
128
|
+
→ extraire les métadonnées de session (session_id, cwd, tool_name, tool_input, etc.)
|
|
129
|
+
→ readMergedHooksConfig(cwd) ← fusionne la config projet + locale + globale
|
|
130
|
+
→ enregistrer les politiques intégrées activées avec les paramètres résolus
|
|
131
|
+
→ charger les politiques personnalisées depuis customPoliciesPath (si défini)
|
|
132
|
+
→ enregistrer les politiques personnalisées dans le registre de politiques
|
|
133
|
+
→ évaluer toutes les politiques (intégrées en premier, puis personnalisées)
|
|
134
|
+
→ le premier refus court-circuite
|
|
135
|
+
→ les décisions d'instruction s'accumulent
|
|
136
|
+
→ les messages d'autorisation s'accumulent
|
|
137
|
+
→ écrire la décision JSON sur stdout
|
|
138
|
+
→ persister l'événement dans ~/.failproofai/hook-activity.jsonl
|
|
139
|
+
→ quitter
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
L'ensemble du processus s'exécute en moins de 100 ms pour les payloads typiques, sans aucun appel LLM.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Chargement de la configuration
|
|
147
|
+
|
|
148
|
+
`src/hooks/hooks-config.ts` implémente le chargement de configuration à trois portées.
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
[1] {cwd}/.failproofai/policies-config.json ← projet (priorité la plus haute)
|
|
152
|
+
[2] {cwd}/.failproofai/policies-config.local.json ← local
|
|
153
|
+
[3] ~/.failproofai/policies-config.json ← global (priorité la plus basse)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Logique de fusion :
|
|
157
|
+
- `enabledPolicies` - union dédupliquée sur les trois fichiers
|
|
158
|
+
- `policyParams` - par clé de politique, le premier fichier qui la définit l'emporte entièrement
|
|
159
|
+
- `customPoliciesPath` - le premier fichier qui le définit l'emporte
|
|
160
|
+
- `llm` - le premier fichier qui le définit l'emporte
|
|
161
|
+
|
|
162
|
+
Le tableau de bord web utilise `readHooksConfig()` (global uniquement) pour la lecture et l'écriture, car il n'est pas invoqué avec un répertoire de travail de projet.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Évaluation des politiques
|
|
167
|
+
|
|
168
|
+
`src/hooks/policy-evaluator.ts` exécute les politiques dans l'ordre.
|
|
169
|
+
|
|
170
|
+
Pour chaque politique :
|
|
171
|
+
|
|
172
|
+
1. Rechercher le schéma `params` de la politique (si elle en possède un).
|
|
173
|
+
2. Lire `policyParams[policy.name]` depuis la configuration fusionnée.
|
|
174
|
+
3. Fusionner les valeurs fournies par l'utilisateur sur les valeurs par défaut du schéma pour produire `ctx.params`.
|
|
175
|
+
4. Appeler `policy.fn(ctx)` avec le contexte résolu.
|
|
176
|
+
5. Si le résultat est `deny`, s'arrêter immédiatement et retourner cette décision.
|
|
177
|
+
6. Si le résultat est `instruct`, accumuler le message et continuer.
|
|
178
|
+
7. Si le résultat est `allow`, passer à la politique suivante.
|
|
179
|
+
|
|
180
|
+
Après l'exécution de toutes les politiques :
|
|
181
|
+
- Si un `deny` a été retourné, émettre la réponse de refus.
|
|
182
|
+
- Si des retours `instruct` ont été collectés, émettre une seule réponse d'instruction avec tous les messages joints.
|
|
183
|
+
- Sinon, émettre une réponse d'autorisation (stdout vide, code de sortie 0).
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Politiques intégrées
|
|
188
|
+
|
|
189
|
+
`src/hooks/builtin-policies.ts` définit les 26 politiques intégrées sous forme d'objets `BuiltinPolicyDefinition` :
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
interface BuiltinPolicyDefinition {
|
|
193
|
+
name: string;
|
|
194
|
+
description: string;
|
|
195
|
+
fn: (ctx: PolicyContext) => PolicyResult;
|
|
196
|
+
match: {
|
|
197
|
+
events: HookEventType[];
|
|
198
|
+
tools?: string[];
|
|
199
|
+
};
|
|
200
|
+
defaultEnabled: boolean;
|
|
201
|
+
category: string;
|
|
202
|
+
beta?: boolean;
|
|
203
|
+
params?: PolicyParamsSchema;
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Les politiques qui acceptent des `params` déclarent un `PolicyParamsSchema` avec les types et les valeurs par défaut de chaque paramètre. L'évaluateur de politiques injecte les valeurs résolues dans `ctx.params` avant d'appeler `fn`. Les fonctions de politique lisent `ctx.params` sans vérification de nullité, car les valeurs par défaut sont toujours appliquées en premier.
|
|
208
|
+
|
|
209
|
+
La correspondance de motifs à l'intérieur des politiques utilise des tokens de commande analysés (argv), et non une correspondance de chaînes brutes. Cela empêche le contournement via l'injection d'opérateurs shell (par exemple, un motif pour `sudo systemctl status *` ne peut pas être contourné en ajoutant `; rm -rf /` à la commande).
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Politiques personnalisées
|
|
214
|
+
|
|
215
|
+
`src/hooks/custom-hooks-registry.ts` implémente un registre basé sur `globalThis` :
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
const REGISTRY_KEY = "__failproofai_custom_hooks__";
|
|
219
|
+
|
|
220
|
+
export const customPolicies = {
|
|
221
|
+
add(hook: CustomHook): void { ... }
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export function getCustomHooks(): CustomHook[] { ... }
|
|
225
|
+
export function clearCustomHooks(): void { ... } // used in tests
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`src/hooks/custom-hooks-loader.ts` charge le fichier de politique de l'utilisateur :
|
|
229
|
+
|
|
230
|
+
1. Lire `customPoliciesPath` depuis la configuration ; ignorer si absent.
|
|
231
|
+
2. Résoudre le chemin absolu ; vérifier que le fichier existe.
|
|
232
|
+
3. Réécrire tous les imports `from "failproofai"` vers le chemin dist réel afin que `customPolicies` résolve vers le même registre `globalThis`.
|
|
233
|
+
4. Réécrire récursivement les imports locaux transitifs pour assurer la compatibilité ESM.
|
|
234
|
+
5. Écrire des fichiers `.mjs` temporaires et `import()` le fichier d'entrée.
|
|
235
|
+
6. Appeler `getCustomHooks()` pour récupérer les hooks enregistrés.
|
|
236
|
+
7. Nettoyer tous les fichiers temporaires dans un bloc `finally`.
|
|
237
|
+
|
|
238
|
+
En cas d'erreur (fichier introuvable, erreur de syntaxe, échec d'import), l'erreur est consignée dans `~/.failproofai/hook.log` et le chargeur retourne un tableau vide. Les politiques intégrées ne sont pas affectées.
|
|
239
|
+
|
|
240
|
+
Les politiques personnalisées sont évaluées après toutes les politiques intégrées. Un `deny` d'une politique personnalisée court-circuite quand même les politiques personnalisées suivantes (mais toutes les politiques intégrées ont déjà été exécutées à ce stade).
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Journalisation de l'activité
|
|
245
|
+
|
|
246
|
+
Après chaque événement de hook, le gestionnaire ajoute une ligne JSONL dans `~/.failproofai/hook-activity.jsonl` :
|
|
247
|
+
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"timestamp": "2026-04-06T12:34:56.789Z",
|
|
251
|
+
"sessionId": "abc123",
|
|
252
|
+
"eventType": "PreToolUse",
|
|
253
|
+
"toolName": "Bash",
|
|
254
|
+
"policyName": "block-sudo",
|
|
255
|
+
"decision": "deny",
|
|
256
|
+
"reason": "sudo command blocked by failproofai",
|
|
257
|
+
"durationMs": 12
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Une ligne par politique ayant pris une décision autre que allow. Les décisions d'autorisation ne sont pas journalisées (pour maintenir la taille du fichier réduite).
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Architecture du tableau de bord
|
|
266
|
+
|
|
267
|
+
Le tableau de bord est une application **Next.js 16** utilisant l'App Router avec des React Server Components et des Server Actions.
|
|
268
|
+
|
|
269
|
+
```text
|
|
270
|
+
app/
|
|
271
|
+
layout.tsx ← Mise en page racine (thème, télémétrie, nav)
|
|
272
|
+
projects/page.tsx ← Composant serveur : liste tous les projets Claude
|
|
273
|
+
project/[name]/page.tsx ← Composant serveur : liste les sessions d'un projet
|
|
274
|
+
project/[name]/session/
|
|
275
|
+
[sessionId]/page.tsx ← Composant serveur : affiche le visualiseur de session
|
|
276
|
+
policies/page.tsx ← Composant client : gestion des politiques + journal d'activité
|
|
277
|
+
actions/
|
|
278
|
+
get-hooks-config.ts ← Lire la config + la liste des politiques
|
|
279
|
+
update-hooks-config.ts ← Activer/désactiver une politique
|
|
280
|
+
update-policy-params.ts ← Mettre à jour les paramètres d'une politique
|
|
281
|
+
get-hook-activity.ts ← Paginer/rechercher dans le journal d'activité
|
|
282
|
+
install-hooks-web.ts ← Installer/supprimer les hooks depuis le navigateur
|
|
283
|
+
api/
|
|
284
|
+
download/[project]/[session]/route.ts ← Exporter une session en ZIP/JSONL
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Flux de données :**
|
|
288
|
+
|
|
289
|
+
- Les composants de page appellent `lib/projects.ts` et `lib/log-entries.ts` pour lire les données de projet/session directement depuis le système de fichiers (pas de couche API pour les lectures).
|
|
290
|
+
- La page Politiques utilise des Server Actions pour toutes les mutations (activation/désactivation, mise à jour des paramètres, installation/suppression).
|
|
291
|
+
- Le visualiseur de session analyse le format de transcript JSONL de Claude et affiche une chronologie des messages et des appels d'outils.
|
|
292
|
+
|
|
293
|
+
**Décisions de conception clés :**
|
|
294
|
+
|
|
295
|
+
- Pas de base de données - tout l'état persistant est dans des fichiers simples (`~/.failproofai/`, `~/.claude/projects/`).
|
|
296
|
+
- Server Actions pour les mutations - aucune API REST nécessaire pour les opérations CRUD.
|
|
297
|
+
- React Server Components pour les pages de lecture - chargement initial plus rapide, pas de bundle client pour la récupération des données.
|
|
298
|
+
- Composants client uniquement là où l'interactivité est nécessaire (bascules de politique, recherche d'activité, visualiseur de journal).
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Organisation des fichiers
|
|
303
|
+
|
|
304
|
+
```text
|
|
305
|
+
failproofai/
|
|
306
|
+
├── bin/
|
|
307
|
+
│ └── failproofai.mjs # Routeur CLI (hook / dashboard / install / etc.)
|
|
308
|
+
├── src/hooks/
|
|
309
|
+
│ ├── handler.ts # Pipeline d'événements de hook
|
|
310
|
+
│ ├── builtin-policies.ts # 26 définitions de politiques
|
|
311
|
+
│ ├── policy-evaluator.ts # Moteur d'exécution des politiques
|
|
312
|
+
│ ├── policy-registry.ts # Enregistrement et recherche de politiques
|
|
313
|
+
│ ├── policy-types.ts # Interfaces TypeScript
|
|
314
|
+
│ ├── hooks-config.ts # Chargement de configuration multi-portée
|
|
315
|
+
│ ├── custom-hooks-registry.ts # Registre de hooks basé sur globalThis
|
|
316
|
+
│ ├── custom-hooks-loader.ts # Chargeur ESM pour les hooks JS utilisateur
|
|
317
|
+
│ ├── manager.ts # Opérations install / remove / list
|
|
318
|
+
│ ├── install-prompt.ts # Invite de sélection interactive des politiques
|
|
319
|
+
│ ├── hook-logger.ts # Journalisation vers hook.log
|
|
320
|
+
│ ├── hook-activity-store.ts # Persistance de l'activité dans hook-activity.jsonl
|
|
321
|
+
│ └── llm-client.ts # Client API LLM (pour les politiques pilotées par IA)
|
|
322
|
+
├── app/ # Tableau de bord Next.js (pages + server actions)
|
|
323
|
+
├── lib/ # Utilitaires partagés
|
|
324
|
+
│ ├── projects.ts # Enumération des projets Claude depuis le système de fichiers
|
|
325
|
+
│ ├── log-entries.ts # Analyse du format JSONL des transcripts Claude
|
|
326
|
+
│ ├── paths.ts # Résolution des chemins système
|
|
327
|
+
│ └── ...
|
|
328
|
+
├── components/ # Composants React UI partagés
|
|
329
|
+
├── contexts/ # Fournisseurs de contexte React (thème, actualisation automatique, télémétrie)
|
|
330
|
+
├── examples/ # Exemples de fichiers de hooks personnalisés
|
|
331
|
+
└── __tests__/ # Tests unitaires et E2E
|
|
332
|
+
```
|