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.
Files changed (379) hide show
  1. package/.next/standalone/.claude/settings.json +26 -26
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  11. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  13. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  15. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  20. package/.next/standalone/.next/server/app/_not-found.rsc +17 -17
  21. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +17 -17
  22. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  23. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  24. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  25. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  26. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/standalone/.next/server/app/index.html +1 -1
  28. package/.next/standalone/.next/server/app/index.rsc +16 -16
  29. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  30. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -16
  31. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  32. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +11 -11
  33. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  34. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  35. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  38. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  41. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  44. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  45. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  48. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +3 -0
  51. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kjo7d_._.js +1 -1
  52. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  53. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  54. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  55. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  56. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  57. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
  58. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.t2266._.js → [root-of-the-server]__0vn1ciw._.js} +2 -2
  59. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +2 -1
  60. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0pjorff._.js → [root-of-the-server]__0z-n~~r._.js} +2 -2
  61. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  62. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  63. package/.next/standalone/.next/server/chunks/ssr/_0x..fj-._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
  65. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  66. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  67. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  68. package/.next/standalone/.next/server/pages/404.html +2 -2
  69. package/.next/standalone/.next/server/pages/500.html +1 -1
  70. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  72. package/.next/standalone/.next/static/chunks/{0qi0ubup__3pj.js → 04wavch6dsfes.js} +1 -1
  73. package/.next/standalone/.next/static/chunks/{121a-0zn-knuy.js → 0drr--vxs_m-c.js} +1 -1
  74. package/.next/standalone/.next/static/chunks/{0jf9lx3rkmqx_.css → 0gu_a.a80ritd.css} +1 -1
  75. package/.next/standalone/.next/static/chunks/{07g0rbtaux_1t.js → 0i1ilz5554nv9.js} +1 -1
  76. package/.next/standalone/.next/static/chunks/{0j752uotyfvjh.js → 0keqg6-cjs8aa.js} +1 -1
  77. package/.next/standalone/.next/static/chunks/{0xyvis4r_y.8o.js → 0myzx7y.rqqi3.js} +2 -2
  78. package/.next/standalone/.next/static/chunks/{0a_xh94bt.y0j.js → 0zfrusm~j404v.js} +1 -1
  79. package/.next/standalone/.next/static/chunks/{0zfyfi1suoteq.js → 10xhknzfyigcu.js} +1 -1
  80. package/.next/standalone/.next/static/chunks/{04xfyqyhdxbxz.js → 16yg3xhkmdb9v.js} +1 -1
  81. package/.next/standalone/CHANGELOG.md +13 -0
  82. package/.next/standalone/CLAUDE.md +14 -0
  83. package/.next/standalone/README.md +16 -0
  84. package/.next/standalone/bun.lock +45 -0
  85. package/.next/standalone/dist/cli.mjs +12 -5
  86. package/.next/standalone/docs/ar/architecture.mdx +333 -0
  87. package/.next/standalone/docs/ar/built-in-policies.mdx +566 -0
  88. package/.next/standalone/docs/ar/cli/dashboard.mdx +28 -0
  89. package/.next/standalone/docs/ar/cli/environment-variables.mdx +34 -0
  90. package/.next/standalone/docs/ar/cli/hook.mdx +31 -0
  91. package/.next/standalone/docs/ar/cli/install-policies.mdx +49 -0
  92. package/.next/standalone/docs/ar/cli/list-policies.mdx +31 -0
  93. package/.next/standalone/docs/ar/cli/remove-policies.mdx +45 -0
  94. package/.next/standalone/docs/ar/cli/version.mdx +13 -0
  95. package/.next/standalone/docs/ar/configuration.mdx +223 -0
  96. package/.next/standalone/docs/ar/custom-policies.mdx +359 -0
  97. package/.next/standalone/docs/ar/dashboard.mdx +142 -0
  98. package/.next/standalone/docs/ar/examples.mdx +254 -0
  99. package/.next/standalone/docs/ar/for-agents.mdx +39 -0
  100. package/.next/standalone/docs/ar/getting-started.mdx +134 -0
  101. package/.next/standalone/docs/ar/introduction.mdx +58 -0
  102. package/.next/standalone/docs/ar/package-aliases.mdx +82 -0
  103. package/.next/standalone/docs/ar/testing.mdx +261 -0
  104. package/.next/standalone/docs/de/architecture.mdx +332 -0
  105. package/.next/standalone/docs/de/built-in-policies.mdx +564 -0
  106. package/.next/standalone/docs/de/cli/dashboard.mdx +28 -0
  107. package/.next/standalone/docs/de/cli/environment-variables.mdx +34 -0
  108. package/.next/standalone/docs/de/cli/hook.mdx +30 -0
  109. package/.next/standalone/docs/de/cli/install-policies.mdx +48 -0
  110. package/.next/standalone/docs/de/cli/list-policies.mdx +31 -0
  111. package/.next/standalone/docs/de/cli/remove-policies.mdx +44 -0
  112. package/.next/standalone/docs/de/cli/version.mdx +12 -0
  113. package/.next/standalone/docs/de/configuration.mdx +222 -0
  114. package/.next/standalone/docs/de/custom-policies.mdx +357 -0
  115. package/.next/standalone/docs/de/dashboard.mdx +142 -0
  116. package/.next/standalone/docs/de/examples.mdx +253 -0
  117. package/.next/standalone/docs/de/for-agents.mdx +38 -0
  118. package/.next/standalone/docs/de/getting-started.mdx +134 -0
  119. package/.next/standalone/docs/de/introduction.mdx +57 -0
  120. package/.next/standalone/docs/de/package-aliases.mdx +82 -0
  121. package/.next/standalone/docs/de/testing.mdx +260 -0
  122. package/.next/standalone/docs/docs.json +922 -35
  123. package/.next/standalone/docs/es/architecture.mdx +332 -0
  124. package/.next/standalone/docs/es/built-in-policies.mdx +564 -0
  125. package/.next/standalone/docs/es/cli/dashboard.mdx +28 -0
  126. package/.next/standalone/docs/es/cli/environment-variables.mdx +34 -0
  127. package/.next/standalone/docs/es/cli/hook.mdx +30 -0
  128. package/.next/standalone/docs/es/cli/install-policies.mdx +48 -0
  129. package/.next/standalone/docs/es/cli/list-policies.mdx +31 -0
  130. package/.next/standalone/docs/es/cli/remove-policies.mdx +44 -0
  131. package/.next/standalone/docs/es/cli/version.mdx +12 -0
  132. package/.next/standalone/docs/es/configuration.mdx +222 -0
  133. package/.next/standalone/docs/es/custom-policies.mdx +357 -0
  134. package/.next/standalone/docs/es/dashboard.mdx +142 -0
  135. package/.next/standalone/docs/es/examples.mdx +253 -0
  136. package/.next/standalone/docs/es/for-agents.mdx +38 -0
  137. package/.next/standalone/docs/es/getting-started.mdx +134 -0
  138. package/.next/standalone/docs/es/introduction.mdx +57 -0
  139. package/.next/standalone/docs/es/package-aliases.mdx +82 -0
  140. package/.next/standalone/docs/es/testing.mdx +260 -0
  141. package/.next/standalone/docs/fr/architecture.mdx +332 -0
  142. package/.next/standalone/docs/fr/built-in-policies.mdx +564 -0
  143. package/.next/standalone/docs/fr/cli/dashboard.mdx +28 -0
  144. package/.next/standalone/docs/fr/cli/environment-variables.mdx +34 -0
  145. package/.next/standalone/docs/fr/cli/hook.mdx +30 -0
  146. package/.next/standalone/docs/fr/cli/install-policies.mdx +48 -0
  147. package/.next/standalone/docs/fr/cli/list-policies.mdx +31 -0
  148. package/.next/standalone/docs/fr/cli/remove-policies.mdx +44 -0
  149. package/.next/standalone/docs/fr/cli/version.mdx +12 -0
  150. package/.next/standalone/docs/fr/configuration.mdx +222 -0
  151. package/.next/standalone/docs/fr/custom-policies.mdx +357 -0
  152. package/.next/standalone/docs/fr/dashboard.mdx +142 -0
  153. package/.next/standalone/docs/fr/examples.mdx +253 -0
  154. package/.next/standalone/docs/fr/for-agents.mdx +38 -0
  155. package/.next/standalone/docs/fr/getting-started.mdx +134 -0
  156. package/.next/standalone/docs/fr/introduction.mdx +57 -0
  157. package/.next/standalone/docs/fr/package-aliases.mdx +82 -0
  158. package/.next/standalone/docs/fr/testing.mdx +260 -0
  159. package/.next/standalone/docs/he/architecture.mdx +333 -0
  160. package/.next/standalone/docs/he/built-in-policies.mdx +564 -0
  161. package/.next/standalone/docs/he/cli/dashboard.mdx +28 -0
  162. package/.next/standalone/docs/he/cli/environment-variables.mdx +34 -0
  163. package/.next/standalone/docs/he/cli/hook.mdx +30 -0
  164. package/.next/standalone/docs/he/cli/install-policies.mdx +48 -0
  165. package/.next/standalone/docs/he/cli/list-policies.mdx +32 -0
  166. package/.next/standalone/docs/he/cli/remove-policies.mdx +44 -0
  167. package/.next/standalone/docs/he/cli/version.mdx +12 -0
  168. package/.next/standalone/docs/he/configuration.mdx +222 -0
  169. package/.next/standalone/docs/he/custom-policies.mdx +357 -0
  170. package/.next/standalone/docs/he/dashboard.mdx +142 -0
  171. package/.next/standalone/docs/he/examples.mdx +253 -0
  172. package/.next/standalone/docs/he/for-agents.mdx +38 -0
  173. package/.next/standalone/docs/he/getting-started.mdx +135 -0
  174. package/.next/standalone/docs/he/introduction.mdx +57 -0
  175. package/.next/standalone/docs/he/package-aliases.mdx +82 -0
  176. package/.next/standalone/docs/he/testing.mdx +260 -0
  177. package/.next/standalone/docs/hi/architecture.mdx +334 -0
  178. package/.next/standalone/docs/hi/built-in-policies.mdx +564 -0
  179. package/.next/standalone/docs/hi/cli/dashboard.mdx +28 -0
  180. package/.next/standalone/docs/hi/cli/environment-variables.mdx +34 -0
  181. package/.next/standalone/docs/hi/cli/hook.mdx +30 -0
  182. package/.next/standalone/docs/hi/cli/install-policies.mdx +48 -0
  183. package/.next/standalone/docs/hi/cli/list-policies.mdx +31 -0
  184. package/.next/standalone/docs/hi/cli/remove-policies.mdx +44 -0
  185. package/.next/standalone/docs/hi/cli/version.mdx +12 -0
  186. package/.next/standalone/docs/hi/configuration.mdx +222 -0
  187. package/.next/standalone/docs/hi/custom-policies.mdx +357 -0
  188. package/.next/standalone/docs/hi/dashboard.mdx +142 -0
  189. package/.next/standalone/docs/hi/examples.mdx +255 -0
  190. package/.next/standalone/docs/hi/for-agents.mdx +38 -0
  191. package/.next/standalone/docs/hi/getting-started.mdx +134 -0
  192. package/.next/standalone/docs/hi/introduction.mdx +57 -0
  193. package/.next/standalone/docs/hi/package-aliases.mdx +82 -0
  194. package/.next/standalone/docs/hi/testing.mdx +260 -0
  195. package/.next/standalone/docs/i18n/README.ar.md +312 -0
  196. package/.next/standalone/docs/i18n/README.de.md +307 -0
  197. package/.next/standalone/docs/i18n/README.es.md +307 -0
  198. package/.next/standalone/docs/i18n/README.fr.md +307 -0
  199. package/.next/standalone/docs/i18n/README.he.md +312 -0
  200. package/.next/standalone/docs/i18n/README.hi.md +307 -0
  201. package/.next/standalone/docs/i18n/README.it.md +307 -0
  202. package/.next/standalone/docs/i18n/README.ja.md +307 -0
  203. package/.next/standalone/docs/i18n/README.ko.md +307 -0
  204. package/.next/standalone/docs/i18n/README.pt-br.md +307 -0
  205. package/.next/standalone/docs/i18n/README.ru.md +308 -0
  206. package/.next/standalone/docs/i18n/README.tr.md +308 -0
  207. package/.next/standalone/docs/i18n/README.vi.md +308 -0
  208. package/.next/standalone/docs/i18n/README.zh.md +307 -0
  209. package/.next/standalone/docs/it/architecture.mdx +333 -0
  210. package/.next/standalone/docs/it/built-in-policies.mdx +564 -0
  211. package/.next/standalone/docs/it/cli/dashboard.mdx +28 -0
  212. package/.next/standalone/docs/it/cli/environment-variables.mdx +34 -0
  213. package/.next/standalone/docs/it/cli/hook.mdx +30 -0
  214. package/.next/standalone/docs/it/cli/install-policies.mdx +48 -0
  215. package/.next/standalone/docs/it/cli/list-policies.mdx +31 -0
  216. package/.next/standalone/docs/it/cli/remove-policies.mdx +44 -0
  217. package/.next/standalone/docs/it/cli/version.mdx +12 -0
  218. package/.next/standalone/docs/it/configuration.mdx +223 -0
  219. package/.next/standalone/docs/it/custom-policies.mdx +358 -0
  220. package/.next/standalone/docs/it/dashboard.mdx +142 -0
  221. package/.next/standalone/docs/it/examples.mdx +253 -0
  222. package/.next/standalone/docs/it/for-agents.mdx +38 -0
  223. package/.next/standalone/docs/it/getting-started.mdx +134 -0
  224. package/.next/standalone/docs/it/introduction.mdx +57 -0
  225. package/.next/standalone/docs/it/package-aliases.mdx +82 -0
  226. package/.next/standalone/docs/it/testing.mdx +260 -0
  227. package/.next/standalone/docs/ja/architecture.mdx +332 -0
  228. package/.next/standalone/docs/ja/built-in-policies.mdx +562 -0
  229. package/.next/standalone/docs/ja/cli/dashboard.mdx +28 -0
  230. package/.next/standalone/docs/ja/cli/environment-variables.mdx +34 -0
  231. package/.next/standalone/docs/ja/cli/hook.mdx +30 -0
  232. package/.next/standalone/docs/ja/cli/install-policies.mdx +48 -0
  233. package/.next/standalone/docs/ja/cli/list-policies.mdx +31 -0
  234. package/.next/standalone/docs/ja/cli/remove-policies.mdx +44 -0
  235. package/.next/standalone/docs/ja/cli/version.mdx +12 -0
  236. package/.next/standalone/docs/ja/configuration.mdx +222 -0
  237. package/.next/standalone/docs/ja/custom-policies.mdx +357 -0
  238. package/.next/standalone/docs/ja/dashboard.mdx +142 -0
  239. package/.next/standalone/docs/ja/examples.mdx +253 -0
  240. package/.next/standalone/docs/ja/for-agents.mdx +38 -0
  241. package/.next/standalone/docs/ja/getting-started.mdx +134 -0
  242. package/.next/standalone/docs/ja/introduction.mdx +57 -0
  243. package/.next/standalone/docs/ja/package-aliases.mdx +82 -0
  244. package/.next/standalone/docs/ja/testing.mdx +260 -0
  245. package/.next/standalone/docs/ko/architecture.mdx +332 -0
  246. package/.next/standalone/docs/ko/built-in-policies.mdx +562 -0
  247. package/.next/standalone/docs/ko/cli/dashboard.mdx +28 -0
  248. package/.next/standalone/docs/ko/cli/environment-variables.mdx +34 -0
  249. package/.next/standalone/docs/ko/cli/hook.mdx +30 -0
  250. package/.next/standalone/docs/ko/cli/install-policies.mdx +48 -0
  251. package/.next/standalone/docs/ko/cli/list-policies.mdx +31 -0
  252. package/.next/standalone/docs/ko/cli/remove-policies.mdx +44 -0
  253. package/.next/standalone/docs/ko/cli/version.mdx +12 -0
  254. package/.next/standalone/docs/ko/configuration.mdx +222 -0
  255. package/.next/standalone/docs/ko/custom-policies.mdx +357 -0
  256. package/.next/standalone/docs/ko/dashboard.mdx +142 -0
  257. package/.next/standalone/docs/ko/examples.mdx +253 -0
  258. package/.next/standalone/docs/ko/for-agents.mdx +38 -0
  259. package/.next/standalone/docs/ko/getting-started.mdx +134 -0
  260. package/.next/standalone/docs/ko/introduction.mdx +57 -0
  261. package/.next/standalone/docs/ko/package-aliases.mdx +82 -0
  262. package/.next/standalone/docs/ko/testing.mdx +260 -0
  263. package/.next/standalone/docs/pt-br/architecture.mdx +332 -0
  264. package/.next/standalone/docs/pt-br/built-in-policies.mdx +564 -0
  265. package/.next/standalone/docs/pt-br/cli/dashboard.mdx +28 -0
  266. package/.next/standalone/docs/pt-br/cli/environment-variables.mdx +34 -0
  267. package/.next/standalone/docs/pt-br/cli/hook.mdx +30 -0
  268. package/.next/standalone/docs/pt-br/cli/install-policies.mdx +48 -0
  269. package/.next/standalone/docs/pt-br/cli/list-policies.mdx +31 -0
  270. package/.next/standalone/docs/pt-br/cli/remove-policies.mdx +44 -0
  271. package/.next/standalone/docs/pt-br/cli/version.mdx +12 -0
  272. package/.next/standalone/docs/pt-br/configuration.mdx +222 -0
  273. package/.next/standalone/docs/pt-br/custom-policies.mdx +357 -0
  274. package/.next/standalone/docs/pt-br/dashboard.mdx +142 -0
  275. package/.next/standalone/docs/pt-br/examples.mdx +253 -0
  276. package/.next/standalone/docs/pt-br/for-agents.mdx +38 -0
  277. package/.next/standalone/docs/pt-br/getting-started.mdx +134 -0
  278. package/.next/standalone/docs/pt-br/introduction.mdx +57 -0
  279. package/.next/standalone/docs/pt-br/package-aliases.mdx +82 -0
  280. package/.next/standalone/docs/pt-br/testing.mdx +260 -0
  281. package/.next/standalone/docs/ru/architecture.mdx +334 -0
  282. package/.next/standalone/docs/ru/built-in-policies.mdx +562 -0
  283. package/.next/standalone/docs/ru/cli/dashboard.mdx +28 -0
  284. package/.next/standalone/docs/ru/cli/environment-variables.mdx +34 -0
  285. package/.next/standalone/docs/ru/cli/hook.mdx +30 -0
  286. package/.next/standalone/docs/ru/cli/install-policies.mdx +48 -0
  287. package/.next/standalone/docs/ru/cli/list-policies.mdx +32 -0
  288. package/.next/standalone/docs/ru/cli/remove-policies.mdx +44 -0
  289. package/.next/standalone/docs/ru/cli/version.mdx +12 -0
  290. package/.next/standalone/docs/ru/configuration.mdx +223 -0
  291. package/.next/standalone/docs/ru/custom-policies.mdx +357 -0
  292. package/.next/standalone/docs/ru/dashboard.mdx +142 -0
  293. package/.next/standalone/docs/ru/examples.mdx +254 -0
  294. package/.next/standalone/docs/ru/for-agents.mdx +38 -0
  295. package/.next/standalone/docs/ru/getting-started.mdx +134 -0
  296. package/.next/standalone/docs/ru/introduction.mdx +57 -0
  297. package/.next/standalone/docs/ru/package-aliases.mdx +82 -0
  298. package/.next/standalone/docs/ru/testing.mdx +260 -0
  299. package/.next/standalone/docs/tr/architecture.mdx +333 -0
  300. package/.next/standalone/docs/tr/built-in-policies.mdx +562 -0
  301. package/.next/standalone/docs/tr/cli/dashboard.mdx +28 -0
  302. package/.next/standalone/docs/tr/cli/environment-variables.mdx +34 -0
  303. package/.next/standalone/docs/tr/cli/hook.mdx +30 -0
  304. package/.next/standalone/docs/tr/cli/install-policies.mdx +48 -0
  305. package/.next/standalone/docs/tr/cli/list-policies.mdx +31 -0
  306. package/.next/standalone/docs/tr/cli/remove-policies.mdx +45 -0
  307. package/.next/standalone/docs/tr/cli/version.mdx +12 -0
  308. package/.next/standalone/docs/tr/configuration.mdx +223 -0
  309. package/.next/standalone/docs/tr/custom-policies.mdx +357 -0
  310. package/.next/standalone/docs/tr/dashboard.mdx +142 -0
  311. package/.next/standalone/docs/tr/examples.mdx +253 -0
  312. package/.next/standalone/docs/tr/for-agents.mdx +38 -0
  313. package/.next/standalone/docs/tr/getting-started.mdx +134 -0
  314. package/.next/standalone/docs/tr/introduction.mdx +57 -0
  315. package/.next/standalone/docs/tr/package-aliases.mdx +82 -0
  316. package/.next/standalone/docs/tr/testing.mdx +260 -0
  317. package/.next/standalone/docs/vi/architecture.mdx +333 -0
  318. package/.next/standalone/docs/vi/built-in-policies.mdx +564 -0
  319. package/.next/standalone/docs/vi/cli/dashboard.mdx +28 -0
  320. package/.next/standalone/docs/vi/cli/environment-variables.mdx +34 -0
  321. package/.next/standalone/docs/vi/cli/hook.mdx +30 -0
  322. package/.next/standalone/docs/vi/cli/install-policies.mdx +48 -0
  323. package/.next/standalone/docs/vi/cli/list-policies.mdx +31 -0
  324. package/.next/standalone/docs/vi/cli/remove-policies.mdx +44 -0
  325. package/.next/standalone/docs/vi/cli/version.mdx +13 -0
  326. package/.next/standalone/docs/vi/configuration.mdx +222 -0
  327. package/.next/standalone/docs/vi/custom-policies.mdx +357 -0
  328. package/.next/standalone/docs/vi/dashboard.mdx +142 -0
  329. package/.next/standalone/docs/vi/examples.mdx +253 -0
  330. package/.next/standalone/docs/vi/for-agents.mdx +38 -0
  331. package/.next/standalone/docs/vi/getting-started.mdx +134 -0
  332. package/.next/standalone/docs/vi/introduction.mdx +57 -0
  333. package/.next/standalone/docs/vi/package-aliases.mdx +82 -0
  334. package/.next/standalone/docs/vi/testing.mdx +260 -0
  335. package/.next/standalone/docs/zh/architecture.mdx +332 -0
  336. package/.next/standalone/docs/zh/built-in-policies.mdx +562 -0
  337. package/.next/standalone/docs/zh/cli/dashboard.mdx +28 -0
  338. package/.next/standalone/docs/zh/cli/environment-variables.mdx +34 -0
  339. package/.next/standalone/docs/zh/cli/hook.mdx +30 -0
  340. package/.next/standalone/docs/zh/cli/install-policies.mdx +48 -0
  341. package/.next/standalone/docs/zh/cli/list-policies.mdx +31 -0
  342. package/.next/standalone/docs/zh/cli/remove-policies.mdx +44 -0
  343. package/.next/standalone/docs/zh/cli/version.mdx +12 -0
  344. package/.next/standalone/docs/zh/configuration.mdx +222 -0
  345. package/.next/standalone/docs/zh/custom-policies.mdx +357 -0
  346. package/.next/standalone/docs/zh/dashboard.mdx +142 -0
  347. package/.next/standalone/docs/zh/examples.mdx +253 -0
  348. package/.next/standalone/docs/zh/for-agents.mdx +38 -0
  349. package/.next/standalone/docs/zh/getting-started.mdx +134 -0
  350. package/.next/standalone/docs/zh/introduction.mdx +57 -0
  351. package/.next/standalone/docs/zh/package-aliases.mdx +82 -0
  352. package/.next/standalone/docs/zh/testing.mdx +260 -0
  353. package/.next/standalone/package.json +8 -2
  354. package/.next/standalone/scripts/translate-docs/cache.ts +62 -0
  355. package/.next/standalone/scripts/translate-docs/cli.ts +357 -0
  356. package/.next/standalone/scripts/translate-docs/config.ts +248 -0
  357. package/.next/standalone/scripts/translate-docs/mdx-translator.ts +153 -0
  358. package/.next/standalone/scripts/translate-docs/mintlify-nav.ts +107 -0
  359. package/.next/standalone/scripts/translate-docs/readme-translator.ts +154 -0
  360. package/.next/standalone/scripts/translate-docs/translator.ts +68 -0
  361. package/.next/standalone/scripts/translate-docs/types.ts +43 -0
  362. package/.next/standalone/server.js +1 -1
  363. package/.next/standalone/src/hooks/manager.ts +10 -2
  364. package/README.md +16 -0
  365. package/dist/cli.mjs +12 -5
  366. package/package.json +8 -2
  367. package/scripts/translate-docs/cache.ts +62 -0
  368. package/scripts/translate-docs/cli.ts +357 -0
  369. package/scripts/translate-docs/config.ts +248 -0
  370. package/scripts/translate-docs/mdx-translator.ts +153 -0
  371. package/scripts/translate-docs/mintlify-nav.ts +107 -0
  372. package/scripts/translate-docs/readme-translator.ts +154 -0
  373. package/scripts/translate-docs/translator.ts +68 -0
  374. package/scripts/translate-docs/types.ts +43 -0
  375. package/src/hooks/manager.ts +10 -2
  376. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02nt~6d._.js +0 -3
  377. /package/.next/standalone/.next/static/{itedhTSyIDln6TUf41j5X → XqGmAwGDuJ6fEQgD-8y60}/_buildManifest.js +0 -0
  378. /package/.next/standalone/.next/static/{itedhTSyIDln6TUf41j5X → XqGmAwGDuJ6fEQgD-8y60}/_clientMiddlewareManifest.js +0 -0
  379. /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
+ ```