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 dei Pacchetti
|
|
3
|
+
description: "Alias registrati per la prevenzione del typosquatting e come funzionano"
|
|
4
|
+
icon: copy
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Pacchetto ufficiale
|
|
8
|
+
|
|
9
|
+
Il pacchetto npm canonico è **`failproofai`**:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g failproofai
|
|
13
|
+
# or
|
|
14
|
+
bun add -g failproofai
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Perché possediamo i nomi degli alias
|
|
20
|
+
|
|
21
|
+
Il typosquatting è un attacco comune alla supply chain in cui un malintenzionato registra un nome di pacchetto che è a una pressione di tasto di distanza da un pacchetto popolare. Gli utenti ignari che digitano male il comando di installazione finiscono per eseguire codice controllato dall'attaccante con accesso completo al sistema - esattamente il tipo di minaccia che Failproof AI è progettato per difendere.
|
|
22
|
+
|
|
23
|
+
Per eliminare questa superficie di attacco, **possediamo preventivamente tutte le comuni varianti di ortografia e formattazione** di `failproofai` su npm. Nessuno di questi nomi può essere registrato da terzi. Ognuno di essi è un proxy sottile che installa e delega al vero pacchetto `failproofai`.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Alias registrati
|
|
28
|
+
|
|
29
|
+
**Varianti di formattazione** - diversi modi di scrivere "failproof ai":
|
|
30
|
+
|
|
31
|
+
| Pacchetto | Stato |
|
|
32
|
+
|---------|--------|
|
|
33
|
+
| `failproof` | ✅ Pubblicato |
|
|
34
|
+
| `failproof-ai` | ⏳ In attesa di supporto npm |
|
|
35
|
+
| `fail-proof-ai` | ⏳ In attesa di supporto npm |
|
|
36
|
+
| `failproof_ai` | ⏳ In attesa di supporto npm |
|
|
37
|
+
| `fail_proof_ai` | ⏳ In attesa di supporto npm |
|
|
38
|
+
| `fail-proofai` | ⏳ In attesa di supporto npm |
|
|
39
|
+
|
|
40
|
+
**Errori di digitazione `failprof*`** - manca una `o` da "proof":
|
|
41
|
+
|
|
42
|
+
| Pacchetto | Stato |
|
|
43
|
+
|---------|--------|
|
|
44
|
+
| `failprof` | ✅ Pubblicato |
|
|
45
|
+
| `failprof-ai` | ✅ Pubblicato |
|
|
46
|
+
| `failprofai` | ⏳ In attesa di supporto npm |
|
|
47
|
+
| `fail-prof-ai` | ⏳ In attesa di supporto npm |
|
|
48
|
+
| `failprof_ai` | ⏳ In attesa di supporto npm |
|
|
49
|
+
|
|
50
|
+
**Errori di digitazione `faliproof*`** - `a` e `i` invertite:
|
|
51
|
+
|
|
52
|
+
| Pacchetto | Stato |
|
|
53
|
+
|---------|--------|
|
|
54
|
+
| `faliproof` | ✅ Pubblicato |
|
|
55
|
+
| `faliproof-ai` | ✅ Pubblicato |
|
|
56
|
+
| `faliproofai` | ⏳ In attesa di supporto npm |
|
|
57
|
+
|
|
58
|
+
> **Perché in sospeso?** La politica anti-spam di npm blocca i nomi che si normalizzano alla stessa stringa di un pacchetto esistente dopo aver rimosso la punteggiatura e eseguito controlli di somiglianza. Abbiamo contattato il supporto npm per riservare questi nomi a scopo di prevenzione del typosquatting. Saranno attivati una volta approvati.
|
|
59
|
+
|
|
60
|
+
Puoi verificare che qualsiasi alias pubblicato sia di nostra proprietà:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm info failproof
|
|
64
|
+
# Cercare: "ExosphereHost Inc." nel campo maintainers
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Come funzionano gli alias
|
|
70
|
+
|
|
71
|
+
Ogni pacchetto alias:
|
|
72
|
+
|
|
73
|
+
1. Elenca `failproofai` come dipendenza - in modo che il vero pacchetto (inclusa la configurazione del suo hook `postinstall`) venga eseguito all'installazione
|
|
74
|
+
2. Espone un binario che corrisponde al suo nome (ad es. `failprof-ai`) che inoltra tutti gli argomenti al binario `failproofai`
|
|
75
|
+
|
|
76
|
+
Il proxy è uno script Node a due righe; non c'è logica, nessuna chiamata di rete e nessuna raccolta dati oltre a quella che fa `failproofai` stesso.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Se trovi un nome che ci è sfuggito
|
|
81
|
+
|
|
82
|
+
Apri un issue su [exospherehost/failproofai](https://github.com/exospherehost/failproofai/issues) e lo registreremo.
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Test
|
|
3
|
+
description: "Unit test, test end-to-end e assistenti di test"
|
|
4
|
+
icon: flask-vial
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
failproofai dispone di due suite di test: **unit test** (veloci, con mock) e **test end-to-end** (invocazioni reali di subprocess).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Esecuzione dei test
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Esegui tutti gli unit test una sola volta
|
|
15
|
+
bun run test:run
|
|
16
|
+
|
|
17
|
+
# Esegui gli unit test in modalità watch
|
|
18
|
+
bun run test
|
|
19
|
+
|
|
20
|
+
# Esegui i test E2E (richiede setup - vedi sotto)
|
|
21
|
+
bun run test:e2e
|
|
22
|
+
|
|
23
|
+
# Verifica i tipi senza compilare
|
|
24
|
+
bunx tsc --noEmit
|
|
25
|
+
|
|
26
|
+
# Linting
|
|
27
|
+
bun run lint
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Unit test
|
|
33
|
+
|
|
34
|
+
Gli unit test si trovano in `__tests__/` e utilizzano [Vitest](https://vitest.dev) con `happy-dom`.
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
__tests__/
|
|
38
|
+
hooks/
|
|
39
|
+
builtin-policies.test.ts # Logica delle policy per ogni builtin
|
|
40
|
+
hooks-config.test.ts # Caricamento della config e merge dello scope
|
|
41
|
+
policy-evaluator.test.ts # Iniezione di parametri e ordine di valutazione
|
|
42
|
+
custom-hooks-registry.test.ts # Registry di globalThis add/get/clear
|
|
43
|
+
custom-hooks-loader.test.ts # Loader ESM, importazioni transitive, gestione errori
|
|
44
|
+
manager.test.ts # Operazioni install/remove/list
|
|
45
|
+
components/
|
|
46
|
+
sessions-list.test.tsx # Componente lista sessioni
|
|
47
|
+
project-list.test.tsx # Componente lista progetti
|
|
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
|
+
### Scrivere un unit test per una policy
|
|
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
|
+
## Test end-to-end
|
|
112
|
+
|
|
113
|
+
I test E2E invocano il binario `failproofai` reale come subprocess, inviano un payload JSON a stdin e effettuano asserzioni sull'output stdout e il codice di uscita. Questo verifica il percorso di integrazione completo che utilizza Claude Code.
|
|
114
|
+
|
|
115
|
+
### Setup
|
|
116
|
+
|
|
117
|
+
I test E2E eseguono il binario direttamente dal codice sorgente del repository. Prima della prima esecuzione, compila il bundle CJS che i file di custom hook utilizzano quando importano da `'failproofai'`:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bun build src/index.ts --outdir dist --target node --format cjs
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Quindi esegui i test:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
bun run test:e2e
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Ricompila `dist/` ogni volta che modifichi l'API pubblica dei hook (`src/hooks/custom-hooks-registry.ts`, `src/hooks/policy-helpers.ts`, o `src/hooks/policy-types.ts`).
|
|
130
|
+
|
|
131
|
+
### Struttura dei test E2E
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
__tests__/e2e/
|
|
135
|
+
helpers/
|
|
136
|
+
hook-runner.ts # Avvia il binario, invia payload JSON, cattura codice di uscita + stdout + stderr
|
|
137
|
+
fixture-env.ts # Directory temp isolate per test con file di config
|
|
138
|
+
payloads.ts # Factory di payload conformi a Claude per ogni tipo di evento
|
|
139
|
+
hooks/
|
|
140
|
+
builtin-policies.e2e.test.ts # Ogni policy builtin con subprocess reale
|
|
141
|
+
custom-hooks.e2e.test.ts # Caricamento e valutazione di custom hook
|
|
142
|
+
config-scopes.e2e.test.ts # Merge della configurazione tra project/local/global
|
|
143
|
+
policy-params.e2e.test.ts # Iniezione di parametri per ogni policy parametrizzata
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Utilizzo degli helper E2E
|
|
147
|
+
|
|
148
|
+
**`FixtureEnv`** - ambiente isolato per ogni test:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { createFixtureEnv } from "../helpers/fixture-env";
|
|
152
|
+
|
|
153
|
+
const env = createFixtureEnv();
|
|
154
|
+
// env.cwd - directory temporanea; passa come payload.cwd per raccogliere .failproofai/policies-config.json
|
|
155
|
+
// env.home - directory home isolata; nessun vero ~/.failproofai in conflitto
|
|
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 pulizia `afterEach` automaticamente.
|
|
166
|
+
|
|
167
|
+
**`runHook`** - invoca il 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`** - factory di payload già pronti:
|
|
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
|
+
### Scrivere un test 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 vuoto
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Forme di risposta E2E
|
|
235
|
+
|
|
236
|
+
| Decisione | Codice di uscita | stdout |
|
|
237
|
+
|-----------|------------------|--------|
|
|
238
|
+
| `PreToolUse` deny | `0` | `{"hookSpecificOutput":{"permissionDecision":"deny","permissionDecisionReason":"..."}}` |
|
|
239
|
+
| `PostToolUse` deny | `0` | `{"hookSpecificOutput":{"additionalContext":"Blocked ... because: ..."}}` |
|
|
240
|
+
| Instruct (non-Stop) | `0` | `{"hookSpecificOutput":{"additionalContext":"Instruction from failproofai: ..."}}` |
|
|
241
|
+
| Stop instruct | `2` | stdout vuoto; ragione in stderr |
|
|
242
|
+
| Allow | `0` | stringa vuota |
|
|
243
|
+
|
|
244
|
+
### Config di Vitest
|
|
245
|
+
|
|
246
|
+
I test E2E utilizzano `vitest.config.e2e.mts` con:
|
|
247
|
+
|
|
248
|
+
- `environment: "node"` - nessuna global del browser necessaria
|
|
249
|
+
- `pool: "forks"` - vera isolazione dei processi (i test avviano subprocess)
|
|
250
|
+
- `testTimeout: 20_000` - 20s per test (startup del binario + valutazione hook)
|
|
251
|
+
|
|
252
|
+
Il pool `forks` è importante: i worker basati su thread condividono `globalThis`, il che può interferire con i test che avviano subprocess. I fork basati su processi evitano questo problema.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## CI
|
|
257
|
+
|
|
258
|
+
L'esecuzione CI completa (`bun run lint && bunx tsc --noEmit && bun run test:run && bun run build`) è richiesta per essere approvata prima di fare merge. La suite E2E viene eseguita come un job CI separato in parallelo.
|
|
259
|
+
|
|
260
|
+
Consulta [Contributing](../CONTRIBUTING.md) per la checklist completa pre-merge.
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: アーキテクチャ
|
|
3
|
+
description: "フックハンドラー、設定の読み込み、ポリシー評価が内部でどのように機能するか"
|
|
4
|
+
icon: sitemap
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
このドキュメントでは、failproofai の内部動作を説明します。フックシステムがエージェントのツール呼び出しをどのようにインターセプトするか、設定がどのように読み込まれてマージされるか、ポリシーがどのように評価されるか、そしてダッシュボードがエージェントの活動をどのように監視するかについて解説します。
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 概要
|
|
12
|
+
|
|
13
|
+
failproofai には2つの独立したサブシステムがあります。
|
|
14
|
+
|
|
15
|
+
1. **フックハンドラー** - Claude Code がエージェントのすべてのツール呼び出し時に起動する高速な CLI サブプロセス。ポリシーを評価し、決定を返します。
|
|
16
|
+
2. **エージェントモニター(ダッシュボード)** - エージェントセッションの監視とポリシー管理を行う Next.js ウェブアプリケーション。
|
|
17
|
+
|
|
18
|
+
どちらのサブシステムも `~/.failproofai/` およびプロジェクトの `.failproofai/` ディレクトリにある設定ファイルを共有しますが、それぞれ独立したプロセスとして動作し、ファイルシステムを通じてのみ通信します。
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## フックハンドラー
|
|
23
|
+
|
|
24
|
+
### Claude Code との統合
|
|
25
|
+
|
|
26
|
+
`failproofai policies --install` を実行すると、以下のようなエントリが `~/.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 は各ツール呼び出しの前に `failproofai --hook PreToolUse` をサブプロセスとして起動し、stdin に JSON ペイロードを渡します。
|
|
48
|
+
|
|
49
|
+
### ペイロードの形式
|
|
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
|
+
`PostToolUse` イベントの場合、ペイロードにはツールの出力を含む `tool_result` も含まれます。
|
|
64
|
+
|
|
65
|
+
ハンドラーは stdin の上限を 1 MB に制限しています。これを超えるペイロードは破棄され、すべてのポリシーは暗黙的に allow となります。
|
|
66
|
+
|
|
67
|
+
### レスポンスの形式
|
|
68
|
+
|
|
69
|
+
**Deny(PreToolUse):**
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"hookSpecificOutput": {
|
|
73
|
+
"permissionDecision": "deny",
|
|
74
|
+
"permissionDecisionReason": "Blocked by failproofai: sudo command blocked"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Deny(PostToolUse):**
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"hookSpecificOutput": {
|
|
83
|
+
"additionalContext": "Blocked by failproofai because: API key detected in output"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Instruct(Stop 以外のすべてのイベント):**
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"hookSpecificOutput": {
|
|
92
|
+
"additionalContext": "Instruction from failproofai: Verify tests pass before committing."
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Stop イベントの instruct:**
|
|
98
|
+
- 終了コード: `2`
|
|
99
|
+
- 理由は stdout ではなく stderr に書き込まれます
|
|
100
|
+
|
|
101
|
+
**Allow:**
|
|
102
|
+
- 終了コード: `0`
|
|
103
|
+
- stdout は空
|
|
104
|
+
|
|
105
|
+
**メッセージ付き Allow(ベータ):**
|
|
106
|
+
|
|
107
|
+
v0.0.2-beta.3 以降、`allow(message)` を使用することで、操作が許可されている場合でもポリシーが Claude に情報コンテキストを返せるようになりました。フックハンドラーは以下の JSON を **stdout** に書き込みます(設定ファイルではありません。上記の deny や instruct のレスポンスと同様に、Claude Code へのハンドラープロセスのレスポンスです)。
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
// フックハンドラープロセスによって stdout に書き込まれます
|
|
111
|
+
{
|
|
112
|
+
"hookSpecificOutput": {
|
|
113
|
+
"additionalContext": "All CI checks passed on branch 'feat/my-feature'."
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
- 終了コード: `0`(操作は許可されます)
|
|
118
|
+
- 複数のポリシーがメッセージ付きで `allow` を返した場合、それらのメッセージは改行で結合されて単一の `additionalContext` 文字列になります
|
|
119
|
+
- どのポリシーもメッセージを提供しない場合、stdout は空(従来と同じ)
|
|
120
|
+
|
|
121
|
+
### 処理パイプライン
|
|
122
|
+
|
|
123
|
+
`src/hooks/handler.ts` が完全なパイプラインを実装しています。
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
stdin JSON
|
|
127
|
+
→ ペイロードのパース(最大 1 MB)
|
|
128
|
+
→ セッションメタデータの抽出(session_id、cwd、tool_name、tool_input など)
|
|
129
|
+
→ readMergedHooksConfig(cwd) ← プロジェクト + ローカル + グローバル設定をマージ
|
|
130
|
+
→ 解決済みパラメーターで有効なビルトインポリシーを登録
|
|
131
|
+
→ customPoliciesPath からカスタムポリシーを読み込み(設定されている場合)
|
|
132
|
+
→ カスタムポリシーをポリシーレジストリに登録
|
|
133
|
+
→ すべてのポリシーを評価(ビルトインが先、次にカスタム)
|
|
134
|
+
→ 最初の deny で短絡
|
|
135
|
+
→ instruct の決定を蓄積
|
|
136
|
+
→ allow メッセージを蓄積
|
|
137
|
+
→ JSON 決定を stdout に書き込み
|
|
138
|
+
→ イベントを ~/.failproofai/hook-activity.jsonl に永続化
|
|
139
|
+
→ 終了
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
プロセス全体は、LLM 呼び出しなしで典型的なペイロードに対して 100ms 未満で実行されます。
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 設定の読み込み
|
|
147
|
+
|
|
148
|
+
`src/hooks/hooks-config.ts` が3スコープの設定読み込みを実装しています。
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
[1] {cwd}/.failproofai/policies-config.json ← プロジェクト(最高優先度)
|
|
152
|
+
[2] {cwd}/.failproofai/policies-config.local.json ← ローカル
|
|
153
|
+
[3] ~/.failproofai/policies-config.json ← グローバル(最低優先度)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
マージロジック:
|
|
157
|
+
- `enabledPolicies` - 3つのファイル全体で重複排除された和集合
|
|
158
|
+
- `policyParams` - ポリシーごとのキー。最初に定義されたファイルが完全に優先
|
|
159
|
+
- `customPoliciesPath` - 最初に定義されたファイルが優先
|
|
160
|
+
- `llm` - 最初に定義されたファイルが優先
|
|
161
|
+
|
|
162
|
+
ウェブダッシュボードはプロジェクトの cwd で起動されないため、読み取りと書き込みには `readHooksConfig()`(グローバルのみ)を使用します。
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## ポリシー評価
|
|
167
|
+
|
|
168
|
+
`src/hooks/policy-evaluator.ts` がポリシーを順番に実行します。
|
|
169
|
+
|
|
170
|
+
各ポリシーについて:
|
|
171
|
+
|
|
172
|
+
1. ポリシーの `params` スキーマを検索します(存在する場合)。
|
|
173
|
+
2. マージされた設定から `policyParams[policy.name]` を読み取ります。
|
|
174
|
+
3. スキーマのデフォルト値にユーザー提供の値をマージして `ctx.params` を生成します。
|
|
175
|
+
4. 解決されたコンテキストと共に `policy.fn(ctx)` を呼び出します。
|
|
176
|
+
5. 結果が `deny` の場合、即座に停止してその決定を返します。
|
|
177
|
+
6. 結果が `instruct` の場合、メッセージを蓄積して続行します。
|
|
178
|
+
7. 結果が `allow` の場合、次のポリシーに進みます。
|
|
179
|
+
|
|
180
|
+
すべてのポリシーの実行後:
|
|
181
|
+
- `deny` が返された場合、deny レスポンスを出力します。
|
|
182
|
+
- `instruct` の結果が収集された場合、すべてのメッセージを結合した単一の instruct レスポンスを出力します。
|
|
183
|
+
- それ以外の場合、allow レスポンスを出力します(stdout 空、終了コード 0)。
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## ビルトインポリシー
|
|
188
|
+
|
|
189
|
+
`src/hooks/builtin-policies.ts` が `BuiltinPolicyDefinition` オブジェクトとして26個のビルトインポリシーをすべて定義しています。
|
|
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
|
+
`params` を受け付けるポリシーは、各パラメーターの型とデフォルト値を含む `PolicyParamsSchema` を宣言します。ポリシーエバリュエーターは `fn` を呼び出す前に解決済みの値を `ctx.params` に注入します。デフォルト値は常に最初に適用されるため、ポリシー関数は null チェックなしで `ctx.params` を読み取ります。
|
|
208
|
+
|
|
209
|
+
ポリシー内のパターンマッチングは生の文字列マッチングではなく、パース済みのコマンドトークン(argv)を使用します。これにより、シェル演算子の挿入によるバイパスを防ぎます(例: `sudo systemctl status *` のパターンに `; rm -rf /` を追加してもバイパスできません)。
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## カスタムポリシー
|
|
214
|
+
|
|
215
|
+
`src/hooks/custom-hooks-registry.ts` が `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 { ... } // テストで使用
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`src/hooks/custom-hooks-loader.ts` がユーザーのポリシーファイルを読み込みます。
|
|
229
|
+
|
|
230
|
+
1. 設定から `customPoliciesPath` を読み取り、存在しない場合はスキップします。
|
|
231
|
+
2. 絶対パスに解決し、ファイルの存在を確認します。
|
|
232
|
+
3. `customPolicies` が同じ `globalThis` レジストリに解決されるよう、すべての `from "failproofai"` インポートを実際の dist パスに書き換えます。
|
|
233
|
+
4. ESM 互換性を確保するため、推移的なローカルインポートを再帰的に書き換えます。
|
|
234
|
+
5. 一時的な `.mjs` ファイルを書き込み、エントリファイルを `import()` します。
|
|
235
|
+
6. `getCustomHooks()` を呼び出して登録済みフックを取得します。
|
|
236
|
+
7. `finally` ブロックですべての一時ファイルを削除します。
|
|
237
|
+
|
|
238
|
+
エラー(ファイルが見つからない、構文エラー、インポートの失敗など)が発生した場合、エラーは `~/.failproofai/hook.log` に記録され、ローダーは空の配列を返します。ビルトインポリシーには影響しません。
|
|
239
|
+
|
|
240
|
+
カスタムポリシーはすべてのビルトインポリシーの後に評価されます。カスタムポリシーの `deny` はそれ以降のカスタムポリシーの実行を短絡させますが(その時点ではすべてのビルトインはすでに実行済みです)。
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## アクティビティログ
|
|
245
|
+
|
|
246
|
+
各フックイベントの後、ハンドラーは `~/.failproofai/hook-activity.jsonl` に 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
|
+
allow 以外の決定を下したポリシー1件につき1行。allow の決定はログに記録されません(ファイルサイズを小さく保つため)。
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## ダッシュボードのアーキテクチャ
|
|
266
|
+
|
|
267
|
+
ダッシュボードは、React Server Components と Server Actions を使用した App Router 採用の **Next.js 16** アプリケーションです。
|
|
268
|
+
|
|
269
|
+
```text
|
|
270
|
+
app/
|
|
271
|
+
layout.tsx ← ルートレイアウト(テーマ、テレメトリー、ナビゲーション)
|
|
272
|
+
projects/page.tsx ← サーバーコンポーネント: すべての Claude プロジェクトを一覧表示
|
|
273
|
+
project/[name]/page.tsx ← サーバーコンポーネント: プロジェクト内のセッションを一覧表示
|
|
274
|
+
project/[name]/session/
|
|
275
|
+
[sessionId]/page.tsx ← サーバーコンポーネント: セッションビューアーを表示
|
|
276
|
+
policies/page.tsx ← クライアントコンポーネント: ポリシー管理 + アクティビティログ
|
|
277
|
+
actions/
|
|
278
|
+
get-hooks-config.ts ← 設定とポリシーリストの読み取り
|
|
279
|
+
update-hooks-config.ts ← ポリシーのオン/オフ切り替え
|
|
280
|
+
update-policy-params.ts ← ポリシーパラメーターの更新
|
|
281
|
+
get-hook-activity.ts ← アクティビティログのページング/検索
|
|
282
|
+
install-hooks-web.ts ← ブラウザからのフックのインストール/削除
|
|
283
|
+
api/
|
|
284
|
+
download/[project]/[session]/route.ts ← セッションを ZIP/JSONL としてエクスポート
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**データフロー:**
|
|
288
|
+
|
|
289
|
+
- ページコンポーネントは `lib/projects.ts` と `lib/log-entries.ts` を呼び出し、ファイルシステムからプロジェクト/セッションデータを直接読み取ります(読み取りに API レイヤーは不要)。
|
|
290
|
+
- ポリシーページはすべての変更操作(切り替え、パラメーター更新、インストール/削除)に Server Actions を使用します。
|
|
291
|
+
- セッションビューアーは Claude の JSONL トランスクリプト形式をパースし、メッセージとツール呼び出しのタイムラインをレンダリングします。
|
|
292
|
+
|
|
293
|
+
**主要な設計上の決定事項:**
|
|
294
|
+
|
|
295
|
+
- データベースなし - すべての永続状態はプレーンファイル(`~/.failproofai/`、`~/.claude/projects/`)に保存されます。
|
|
296
|
+
- 変更操作には Server Actions を使用 - CRUD 操作に REST API は不要。
|
|
297
|
+
- 読み取りページには React Server Components を使用 - 初期ロードが高速で、データフェッチのクライアントバンドルが不要。
|
|
298
|
+
- クライアントコンポーネントはインタラクティブ性が必要な場合のみ使用(ポリシーの切り替え、アクティビティ検索、ログビューアー)。
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## ファイル構成
|
|
303
|
+
|
|
304
|
+
```text
|
|
305
|
+
failproofai/
|
|
306
|
+
├── bin/
|
|
307
|
+
│ └── failproofai.mjs # CLI ルーター(フック / ダッシュボード / インストール など)
|
|
308
|
+
├── src/hooks/
|
|
309
|
+
│ ├── handler.ts # フックイベントパイプライン
|
|
310
|
+
│ ├── builtin-policies.ts # 26のポリシー定義
|
|
311
|
+
│ ├── policy-evaluator.ts # ポリシー実行エンジン
|
|
312
|
+
│ ├── policy-registry.ts # ポリシーの登録と検索
|
|
313
|
+
│ ├── policy-types.ts # TypeScript インターフェース
|
|
314
|
+
│ ├── hooks-config.ts # マルチスコープ設定読み込み
|
|
315
|
+
│ ├── custom-hooks-registry.ts # globalThis バックのフックレジストリ
|
|
316
|
+
│ ├── custom-hooks-loader.ts # ユーザー JS フック用の ESM ローダー
|
|
317
|
+
│ ├── manager.ts # インストール / 削除 / 一覧操作
|
|
318
|
+
│ ├── install-prompt.ts # インタラクティブなポリシー選択プロンプト
|
|
319
|
+
│ ├── hook-logger.ts # hook.log へのロギング
|
|
320
|
+
│ ├── hook-activity-store.ts # hook-activity.jsonl へのアクティビティの永続化
|
|
321
|
+
│ └── llm-client.ts # LLM API クライアント(AI 搭載ポリシー用)
|
|
322
|
+
├── app/ # Next.js ダッシュボード(ページ + サーバーアクション)
|
|
323
|
+
├── lib/ # 共有ユーティリティ
|
|
324
|
+
│ ├── projects.ts # ファイルシステムから Claude プロジェクトを列挙
|
|
325
|
+
│ ├── log-entries.ts # Claude トランスクリプトの JSONL 形式をパース
|
|
326
|
+
│ ├── paths.ts # システムパスの解決
|
|
327
|
+
│ └── ...
|
|
328
|
+
├── components/ # 共有 React UI コンポーネント
|
|
329
|
+
├── contexts/ # React コンテキストプロバイダー(テーマ、自動更新、テレメトリー)
|
|
330
|
+
├── examples/ # カスタムフックファイルの例
|
|
331
|
+
└── __tests__/ # ユニットテストと E2E テスト
|
|
332
|
+
```
|