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
@@ -8,6 +8,20 @@
8
8
  - **Package manager:** bun (`bun install`, `bun run <script>`). Do not use npm/yarn to
9
9
  install deps locally.
10
10
 
11
+ ## Dev hooks (this repo only)
12
+
13
+ This repo's `.claude/settings.json` uses `bun ./bin/failproofai.mjs --hook <EventType>`
14
+ instead of the standard `npx -y failproofai` command. This is because `npx -y failproofai`
15
+ creates a self-referencing conflict when run inside the failproofai project itself.
16
+
17
+ For all other repos, the recommended approach is `npx -y failproofai`, installed via:
18
+ ```bash
19
+ failproofai policies --install --scope project
20
+ ```
21
+
22
+ Do **not** run `failproofai policies --install --scope project` from this repo — it will
23
+ overwrite the local binary path back to `npx -y failproofai`.
24
+
11
25
  ## Workflow rules
12
26
 
13
27
  ### One PR per branch
@@ -15,6 +15,8 @@
15
15
  [![CI](https://img.shields.io/github/actions/workflow/status/exospherehost/failproofai/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/exospherehost/failproofai/actions)
16
16
  [![Slack](https://img.shields.io/badge/Slack-join%20us-4A154B?style=flat-square&logo=slack)](https://join.slack.com/t/failproofai/shared_invite/zt-3v63b7k5e-O3NBHmj8X6n9gZSGDx6ggQ)
17
17
 
18
+ **Translations**: [简体中文](docs/i18n/README.zh.md) | [日本語](docs/i18n/README.ja.md) | [한국어](docs/i18n/README.ko.md) | [Español](docs/i18n/README.es.md) | [Português](docs/i18n/README.pt-br.md) | [Deutsch](docs/i18n/README.de.md) | [Français](docs/i18n/README.fr.md) | [Русский](docs/i18n/README.ru.md) | [हिन्दी](docs/i18n/README.hi.md) | [Türkçe](docs/i18n/README.tr.md) | [Tiếng Việt](docs/i18n/README.vi.md) | [Italiano](docs/i18n/README.it.md) | [العربية](docs/i18n/README.ar.md) | [עברית](docs/i18n/README.he.md)
19
+
18
20
  The easiest way to manage policies that keep your AI agents reliable, on-task, and running autonomously - for **Claude Code** & the **Agents SDK**.
19
21
 
20
22
  - **30 Built-in Policies** - Catch common agent failure modes out of the box. Block destructive commands, prevent secret leakage, keep agents inside project boundaries, detect loops, and more.
@@ -274,6 +276,16 @@ docker run --rm -p 3000:3000 -v $(pwd)/docs:/app/docs failproofai-docs
274
276
 
275
277
  ---
276
278
 
279
+ ## Note for failproofai contributors
280
+
281
+ This repo's `.claude/settings.json` uses `bun ./bin/failproofai.mjs --hook <EventType>` instead of the standard `npx -y failproofai` command. This is because running `npx -y failproofai` inside the failproofai project itself creates a self-referencing conflict.
282
+
283
+ For all other repos, the recommended approach is `npx -y failproofai`, installed via:
284
+
285
+ ```bash
286
+ failproofai policies --install --scope project
287
+ ```
288
+
277
289
  ## Contributing
278
290
 
279
291
  See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -283,3 +295,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
283
295
  ## License
284
296
 
285
297
  See [LICENSE](LICENSE).
298
+
299
+ ---
300
+
301
+ Built and Maintained by **ExosphereHost: Reliability Research Lab for Your Agents**. We help enterprises and startups improve the reliability of their AI agents through our own agents, software, and expertise. Learn more at [exosphere.host](https://exosphere.host).
@@ -8,6 +8,7 @@
8
8
  "posthog-node": "^5.28.11",
9
9
  },
10
10
  "devDependencies": {
11
+ "@anthropic-ai/sdk": "^0.39.0",
11
12
  "@tailwindcss/postcss": "^4.1.18",
12
13
  "@tanstack/react-virtual": "^3.13.18",
13
14
  "@testing-library/jest-dom": "^6.9.1",
@@ -37,6 +38,8 @@
37
38
 
38
39
  "@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="],
39
40
 
41
+ "@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.39.0", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-eMyDIPRZbt1CCLErRCi3exlAvNkBtRe+kW5vvJyef93PmNr/clstYgHhtvmkxN82nlKgzyGPCyGxrm0JQ1ZIdg=="],
42
+
40
43
  "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
41
44
 
42
45
  "@babel/compat-data": ["@babel/compat-data@7.29.0", "", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="],
@@ -343,6 +346,8 @@
343
346
 
344
347
  "@types/node": ["@types/node@25.6.0", "", { "dependencies": { "undici-types": "~7.19.0" } }, "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ=="],
345
348
 
349
+ "@types/node-fetch": ["@types/node-fetch@2.6.13", "", { "dependencies": { "@types/node": "*", "form-data": "^4.0.4" } }, "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw=="],
350
+
346
351
  "@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="],
347
352
 
348
353
  "@types/react-dom": ["@types/react-dom@19.2.3", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],
@@ -425,10 +430,14 @@
425
430
 
426
431
  "@vitest/utils": ["@vitest/utils@4.1.4", "", { "dependencies": { "@vitest/pretty-format": "4.1.4", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" } }, "sha512-13QMT+eysM5uVGa1rG4kegGYNp6cnQcsTc67ELFbhNLQO+vgsygtYJx2khvdt4gVQqSSpC/KT5FZZxUpP3Oatw=="],
427
432
 
433
+ "abort-controller": ["abort-controller@3.0.0", "", { "dependencies": { "event-target-shim": "^5.0.0" } }, "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg=="],
434
+
428
435
  "acorn": ["acorn@8.16.0", "", { "bin": "bin/acorn" }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
429
436
 
430
437
  "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
431
438
 
439
+ "agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="],
440
+
432
441
  "ajv": ["ajv@6.14.0", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw=="],
433
442
 
434
443
  "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
@@ -459,6 +468,8 @@
459
468
 
460
469
  "async-function": ["async-function@1.0.0", "", {}, "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA=="],
461
470
 
471
+ "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
472
+
462
473
  "available-typed-arrays": ["available-typed-arrays@1.0.7", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="],
463
474
 
464
475
  "axe-core": ["axe-core@4.11.1", "", {}, "sha512-BASOg+YwO2C+346x3LZOeoovTIoTrRqEsqMa6fmfAV0P+U9mFr9NsyOEpiYvFjbc64NMrSswhV50WdXzdb/Z5A=="],
@@ -489,6 +500,8 @@
489
500
 
490
501
  "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
491
502
 
503
+ "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="],
504
+
492
505
  "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
493
506
 
494
507
  "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
@@ -515,6 +528,8 @@
515
528
 
516
529
  "define-properties": ["define-properties@1.2.1", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="],
517
530
 
531
+ "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],
532
+
518
533
  "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="],
519
534
 
520
535
  "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
@@ -591,6 +606,8 @@
591
606
 
592
607
  "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="],
593
608
 
609
+ "event-target-shim": ["event-target-shim@5.0.1", "", {}, "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="],
610
+
594
611
  "expect-type": ["expect-type@1.3.0", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="],
595
612
 
596
613
  "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
@@ -617,6 +634,12 @@
617
634
 
618
635
  "for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="],
619
636
 
637
+ "form-data": ["form-data@4.0.5", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w=="],
638
+
639
+ "form-data-encoder": ["form-data-encoder@1.7.2", "", {}, "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A=="],
640
+
641
+ "formdata-node": ["formdata-node@4.4.1", "", { "dependencies": { "node-domexception": "1.0.0", "web-streams-polyfill": "4.0.0-beta.3" } }, "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ=="],
642
+
620
643
  "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
621
644
 
622
645
  "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
@@ -665,6 +688,8 @@
665
688
 
666
689
  "hermes-parser": ["hermes-parser@0.25.1", "", { "dependencies": { "hermes-estree": "0.25.1" } }, "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA=="],
667
690
 
691
+ "humanize-ms": ["humanize-ms@1.2.1", "", { "dependencies": { "ms": "^2.0.0" } }, "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ=="],
692
+
668
693
  "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
669
694
 
670
695
  "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
@@ -797,6 +822,10 @@
797
822
 
798
823
  "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="],
799
824
 
825
+ "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
826
+
827
+ "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
828
+
800
829
  "min-indent": ["min-indent@1.0.1", "", {}, "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="],
801
830
 
802
831
  "minimatch": ["minimatch@10.2.4", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg=="],
@@ -813,8 +842,12 @@
813
842
 
814
843
  "next": ["next@16.2.3", "", { "dependencies": { "@next/env": "16.2.3", "@swc/helpers": "0.5.15", "baseline-browser-mapping": "^2.9.19", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.2.3", "@next/swc-darwin-x64": "16.2.3", "@next/swc-linux-arm64-gnu": "16.2.3", "@next/swc-linux-arm64-musl": "16.2.3", "@next/swc-linux-x64-gnu": "16.2.3", "@next/swc-linux-x64-musl": "16.2.3", "@next/swc-win32-arm64-msvc": "16.2.3", "@next/swc-win32-x64-msvc": "16.2.3", "sharp": "^0.34.5" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-9V3zV4oZFza3PVev5/poB9g0dEafVcgNyQ8eTRop8GvxZjV2G15FC5ARuG1eFD42QgeYkzJBJzHghNP8Ad9xtA=="],
815
844
 
845
+ "node-domexception": ["node-domexception@1.0.0", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],
846
+
816
847
  "node-exports-info": ["node-exports-info@1.6.0", "", { "dependencies": { "array.prototype.flatmap": "^1.3.3", "es-errors": "^1.3.0", "object.entries": "^1.1.9", "semver": "^6.3.1" } }, "sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw=="],
817
848
 
849
+ "node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
850
+
818
851
  "node-releases": ["node-releases@2.0.27", "", {}, "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA=="],
819
852
 
820
853
  "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
@@ -971,6 +1004,8 @@
971
1004
 
972
1005
  "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
973
1006
 
1007
+ "tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="],
1008
+
974
1009
  "ts-api-utils": ["ts-api-utils@2.4.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA=="],
975
1010
 
976
1011
  "tsconfig-paths": ["tsconfig-paths@3.15.0", "", { "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg=="],
@@ -1007,8 +1042,14 @@
1007
1042
 
1008
1043
  "vitest": ["vitest@4.1.4", "", { "dependencies": { "@vitest/expect": "4.1.4", "@vitest/mocker": "4.1.4", "@vitest/pretty-format": "4.1.4", "@vitest/runner": "4.1.4", "@vitest/snapshot": "4.1.4", "@vitest/spy": "4.1.4", "@vitest/utils": "4.1.4", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^4.0.0-rc.1", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.1.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.1.4", "@vitest/browser-preview": "4.1.4", "@vitest/browser-webdriverio": "4.1.4", "@vitest/coverage-istanbul": "4.1.4", "@vitest/coverage-v8": "4.1.4", "@vitest/ui": "4.1.4", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-tFuJqTxKb8AvfyqMfnavXdzfy3h3sWZRWwfluGbkeR7n0HUev+FmNgZ8SDrRBTVrVCjgH5cA21qGbCffMNtWvg=="],
1009
1044
 
1045
+ "web-streams-polyfill": ["web-streams-polyfill@4.0.0-beta.3", "", {}, "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug=="],
1046
+
1047
+ "webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="],
1048
+
1010
1049
  "whatwg-mimetype": ["whatwg-mimetype@3.0.0", "", {}, "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q=="],
1011
1050
 
1051
+ "whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="],
1052
+
1012
1053
  "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
1013
1054
 
1014
1055
  "which-boxed-primitive": ["which-boxed-primitive@1.1.1", "", { "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", "is-number-object": "^1.1.1", "is-string": "^1.1.1", "is-symbol": "^1.1.1" } }, "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA=="],
@@ -1033,6 +1074,8 @@
1033
1074
 
1034
1075
  "zod-validation-error": ["zod-validation-error@4.0.2", "", { "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" } }, "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ=="],
1035
1076
 
1077
+ "@anthropic-ai/sdk/@types/node": ["@types/node@18.19.130", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg=="],
1078
+
1036
1079
  "@babel/core/json5": ["json5@2.2.3", "", { "bin": "lib/cli.js" }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
1037
1080
 
1038
1081
  "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
@@ -1097,6 +1140,8 @@
1097
1140
 
1098
1141
  "tinyglobby/picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
1099
1142
 
1143
+ "@anthropic-ai/sdk/@types/node/undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
1144
+
1100
1145
  "@types/ws/@types/node/undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
1101
1146
 
1102
1147
  "eslint-plugin-import/minimatch/brace-expansion": ["brace-expansion@1.1.12", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg=="],
@@ -1914,7 +1914,7 @@ var init_hook_activity_store = __esm(() => {
1914
1914
  });
1915
1915
 
1916
1916
  // package.json
1917
- var version2 = "0.0.2-beta.8";
1917
+ var version2 = "0.0.2-beta.9";
1918
1918
  var init_package = () => {};
1919
1919
 
1920
1920
  // src/posthog-key.ts
@@ -2681,7 +2681,7 @@ Enabled ${selectedPolicies.length} policy(ies): ${selectedPolicies.join(", ")}`)
2681
2681
  settings.hooks = {};
2682
2682
  }
2683
2683
  for (const eventType of HOOK_EVENT_TYPES) {
2684
- const command = `"${binaryPath}" --hook ${eventType}`;
2684
+ const command = scope === "project" ? `npx -y failproofai --hook ${eventType}` : `"${binaryPath}" --hook ${eventType}`;
2685
2685
  const hookEntry = {
2686
2686
  type: "command",
2687
2687
  command,
@@ -2726,12 +2726,19 @@ Enabled ${selectedPolicies.length} policy(ies): ${selectedPolicies.join(", ")}`)
2726
2726
  hostname_hash: hashToId(hostname()),
2727
2727
  has_custom_hooks_path: !!configToWrite.customPoliciesPath,
2728
2728
  has_policy_params: !!(configToWrite.policyParams && Object.keys(configToWrite.policyParams).length > 0),
2729
- param_policy_names: configToWrite.policyParams ? Object.keys(configToWrite.policyParams) : []
2729
+ param_policy_names: configToWrite.policyParams ? Object.keys(configToWrite.policyParams) : [],
2730
+ command_format: scope === "project" ? "npx" : "absolute"
2730
2731
  });
2731
2732
  } catch {}
2732
2733
  console.log(`Failproof AI hooks installed for all ${HOOK_EVENT_TYPES.length} event types (scope: ${scope}).`);
2733
2734
  console.log(`Settings: ${settingsPath}`);
2734
- console.log(`Binary: ${binaryPath}`);
2735
+ if (scope === "project") {
2736
+ console.log(`Command: npx -y failproofai`);
2737
+ console.log(`
2738
+ This file can be committed to git — no machine-specific paths.`);
2739
+ } else {
2740
+ console.log(`Binary: ${binaryPath}`);
2741
+ }
2735
2742
  const otherScopes = deduplicateScopes(HOOK_SCOPES, cwd).filter((s) => s !== scope);
2736
2743
  const duplicates = otherScopes.filter((s) => hooksInstalledInSettings(s, cwd));
2737
2744
  if (duplicates.length > 0) {
@@ -3199,7 +3206,7 @@ import { realpathSync as realpathSync2 } from "fs";
3199
3206
  import { dirname as dirname5, resolve as resolve8 } from "path";
3200
3207
  import { fileURLToPath as fileURLToPath2 } from "url";
3201
3208
  // package.json
3202
- var version = "0.0.2-beta.8";
3209
+ var version = "0.0.2-beta.9";
3203
3210
 
3204
3211
  // bin/failproofai.mjs
3205
3212
  if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
@@ -0,0 +1,333 @@
1
+ ---
2
+ ---
3
+ title: العمارة
4
+ description: "كيف يعمل معالج الخطاف وتحميل الإعدادات وتقييم السياسات بشكل داخلي"
5
+ icon: sitemap
6
+ ---
7
+
8
+ تشرح هذه الوثيقة كيفية عمل failproofai بشكل داخلي: كيف يعترض نظام الخطاف استدعاءات أدوات الوكيل، وكيفية تحميل الإعدادات ودمجها، وكيفية تقييم السياسات، وكيفية مراقبة لوحة المعلومات لنشاط الوكيل.
9
+
10
+ ---
11
+
12
+ ## نظرة عامة
13
+
14
+ يحتوي failproofai على نظامين فرعيين مستقلين:
15
+
16
+ 1. **معالج الخطاف** - عملية CLI سريعة يستدعيها Claude Code عند كل استدعاء لأداة وكيل. يقيّم السياسات ويعيد قراراً.
17
+ 2. **مراقب الوكيل (لوحة المعلومات)** - تطبيق ويب Next.js لمراقبة جلسات الوكيل وإدارة السياسات.
18
+
19
+ يشترك كلا النظامين الفرعيين في ملفات الإعدادات في `~/.failproofai/` وفي دليل المشروع `.failproofai/`، لكنهما يعملان كعمليات منفصلة ولا يتواصلان إلا من خلال نظام الملفات.
20
+
21
+ ---
22
+
23
+ ## معالج الخطاف
24
+
25
+ ### التكامل مع Claude Code
26
+
27
+ عندما تقوم بتشغيل `failproofai policies --install`، يتم كتابة إدخالات مثل هذه في `~/.claude/settings.json`:
28
+
29
+ ```json
30
+ {
31
+ "hooks": {
32
+ "PreToolUse": [
33
+ {
34
+ "matcher": "",
35
+ "hooks": [
36
+ {
37
+ "type": "command",
38
+ "command": "failproofai --hook PreToolUse"
39
+ }
40
+ ]
41
+ }
42
+ ],
43
+ "PostToolUse": [ ... ]
44
+ }
45
+ }
46
+ ```
47
+
48
+ بعد ذلك يستدعي Claude Code `failproofai --hook PreToolUse` كعملية فرعية قبل كل استدعاء أداة، مما يمرر حمولة JSON على stdin.
49
+
50
+ ### تنسيق الحمولة
51
+
52
+ ```json
53
+ {
54
+ "session_id": "abc123",
55
+ "transcript_path": "/home/user/.claude/projects/myproject/sessions/abc123.jsonl",
56
+ "cwd": "/home/user/myproject",
57
+ "permission_mode": "default",
58
+ "hook_event_name": "PreToolUse",
59
+ "tool_name": "Bash",
60
+ "tool_input": { "command": "sudo apt install nodejs" }
61
+ }
62
+ ```
63
+
64
+ بالنسبة لأحداث `PostToolUse`، تحتوي الحمولة أيضاً على `tool_result` مع مخرجات الأداة.
65
+
66
+ يفرض المعالج حداً أقصى بحجم 1 ميجابايت للـ stdin. يتم تجاهل الحمولات التي تتجاوز هذا الحد وجميع السياسات تسمح بشكل ضمني.
67
+
68
+ ### تنسيق الاستجابة
69
+
70
+ **Deny (PreToolUse):**
71
+ ```json
72
+ {
73
+ "hookSpecificOutput": {
74
+ "permissionDecision": "deny",
75
+ "permissionDecisionReason": "Blocked by failproofai: sudo command blocked"
76
+ }
77
+ }
78
+ ```
79
+
80
+ **Deny (PostToolUse):**
81
+ ```json
82
+ {
83
+ "hookSpecificOutput": {
84
+ "additionalContext": "Blocked by failproofai because: API key detected in output"
85
+ }
86
+ }
87
+ ```
88
+
89
+ **Instruct (أي حدث باستثناء Stop):**
90
+ ```json
91
+ {
92
+ "hookSpecificOutput": {
93
+ "additionalContext": "Instruction from failproofai: Verify tests pass before committing."
94
+ }
95
+ }
96
+ ```
97
+
98
+ **حدث Stop instruct:**
99
+ - رمز الخروج: `2`
100
+ - السبب المكتوب إلى stderr (وليس stdout)
101
+
102
+ **Allow:**
103
+ - رمز الخروج: `0`
104
+ - stdout فارغ
105
+
106
+ **السماح مع رسالة (نسخة تجريبية):**
107
+
108
+ منذ v0.0.2-beta.3، يسمح `allow(message)` لسياسة بإرسال سياق معلوماتي مرة أخرى إلى Claude حتى عند السماح بالعملية. يكتب معالج الخطاف JSON التالي إلى **stdout** (وليس ملف إعدادات — هذه هي استجابة المعالج إلى Claude Code، تماماً مثل استجابات deny و instruct أعلاه):
109
+
110
+ ```json
111
+ // مكتوب إلى stdout بواسطة عملية معالج الخطاف
112
+ {
113
+ "hookSpecificOutput": {
114
+ "additionalContext": "All CI checks passed on branch 'feat/my-feature'."
115
+ }
116
+ }
117
+ ```
118
+ - رمز الخروج: `0` (العملية مسموحة)
119
+ - عندما تعيد عدة سياسات `allow` مع رسالة، يتم دمج رسائلهم بفاصل أسطر جديدة في سلسلة `additionalContext` واحدة
120
+ - إذا لم توفر أي سياسة رسالة، يكون stdout فارغاً (نفس الحالة السابقة)
121
+
122
+ ### خط أنابيب المعالجة
123
+
124
+ `src/hooks/handler.ts` ينفذ خط الأنابيب الكامل:
125
+
126
+ ```text
127
+ stdin JSON
128
+ → parse payload (max 1 MB)
129
+ → extract session metadata (session_id, cwd, tool_name, tool_input, etc.)
130
+ → readMergedHooksConfig(cwd) ← merges project + local + global config
131
+ → register enabled builtin policies with resolved params
132
+ → load custom policies from customPoliciesPath (if set)
133
+ → register custom policies into policy registry
134
+ → evaluate all policies (builtins first, then custom)
135
+ → first deny short-circuits
136
+ → instruct decisions accumulate
137
+ → allow messages accumulate
138
+ → write JSON decision to stdout
139
+ → persist event to ~/.failproofai/hook-activity.jsonl
140
+ → exit
141
+ ```
142
+
143
+ تعمل العملية بأكملها في أقل من 100ms للحمولات النموذجية بدون استدعاءات LLM.
144
+
145
+ ---
146
+
147
+ ## تحميل الإعدادات
148
+
149
+ `src/hooks/hooks-config.ts` ينفذ تحميل إعدادات بثلاث نطاقات.
150
+
151
+ ```text
152
+ [1] {cwd}/.failproofai/policies-config.json ← project (highest priority)
153
+ [2] {cwd}/.failproofai/policies-config.local.json ← local
154
+ [3] ~/.failproofai/policies-config.json ← global (lowest priority)
155
+ ```
156
+
157
+ منطق الدمج:
158
+ - `enabledPolicies` - اتحاد منقح الازدواجية عبر جميع الملفات الثلاثة
159
+ - `policyParams` - لكل سياسة، الملف الأول الذي يعرّفها يفوز بالكامل
160
+ - `customPoliciesPath` - الملف الأول الذي يعرّفه يفوز
161
+ - `llm` - الملف الأول الذي يعرّفه يفوز
162
+
163
+ تستخدم لوحة المعلومات الويب `readHooksConfig()` (عام فقط) للقراءة والكتابة، لأنه لا يتم استدعاؤها مع مسار cwd للمشروع.
164
+
165
+ ---
166
+
167
+ ## تقييم السياسة
168
+
169
+ `src/hooks/policy-evaluator.ts` ينفذ السياسات بالترتيب.
170
+
171
+ لكل سياسة:
172
+
173
+ 1. ابحث عن مخطط `params` للسياسة (إن وجد).
174
+ 2. اقرأ `policyParams[policy.name]` من الإعدادات المدمجة.
175
+ 3. ادمج القيم المقدمة من المستخدم فوق الافتراضيات المخطط لها لإنتاج `ctx.params`.
176
+ 4. استدعِ `policy.fn(ctx)` مع السياق المحلول.
177
+ 5. إذا كانت النتيجة `deny`، توقف على الفور وأرجع هذا القرار.
178
+ 6. إذا كانت النتيجة `instruct`، اجمع الرسالة وتابع.
179
+ 7. إذا كانت النتيجة `allow`، انتقل إلى السياسة التالية.
180
+
181
+ بعد تشغيل جميع السياسات:
182
+ - إذا تم إرجاع أي `deny`، أرسل استجابة deny.
183
+ - إذا تم جمع أي استجابات `instruct`، أرسل استجابة instruct واحدة مع دمج جميع الرسائل.
184
+ - بخلاف ذلك، أرسل استجابة allow (stdout فارغ، خروج 0).
185
+
186
+ ---
187
+
188
+ ## السياسات المدمجة
189
+
190
+ `src/hooks/builtin-policies.ts` يعرّف جميع السياسات المدمجة الـ 26 كائنات `BuiltinPolicyDefinition`:
191
+
192
+ ```typescript
193
+ interface BuiltinPolicyDefinition {
194
+ name: string;
195
+ description: string;
196
+ fn: (ctx: PolicyContext) => PolicyResult;
197
+ match: {
198
+ events: HookEventType[];
199
+ tools?: string[];
200
+ };
201
+ defaultEnabled: boolean;
202
+ category: string;
203
+ beta?: boolean;
204
+ params?: PolicyParamsSchema;
205
+ }
206
+ ```
207
+
208
+ السياسات التي تقبل `params` تعلن عن `PolicyParamsSchema` مع أنواع وافتراضيات لكل معامل. يُدرج مُقيّم السياسة القيم المحلولة في `ctx.params` قبل استدعاء `fn`. تقرأ دوال السياسة `ctx.params` دون حماية null لأن الافتراضيات يتم تطبيقها دائماً أولاً.
209
+
210
+ يستخدم مطابقة الأنماط داخل السياسات رموز الأوامر المحللة (argv)، وليس مطابقة السلاسل الخام. هذا يمنع التجاوز عبر حقن مشغل shell (على سبيل المثال، نمط لـ `sudo systemctl status *` لا يمكن تجاوزه بإضافة `; rm -rf /` للأمر).
211
+
212
+ ---
213
+
214
+ ## السياسات المخصصة
215
+
216
+ `src/hooks/custom-hooks-registry.ts` ينفذ سجل مدعوم بـ `globalThis`:
217
+
218
+ ```typescript
219
+ const REGISTRY_KEY = "__failproofai_custom_hooks__";
220
+
221
+ export const customPolicies = {
222
+ add(hook: CustomHook): void { ... }
223
+ };
224
+
225
+ export function getCustomHooks(): CustomHook[] { ... }
226
+ export function clearCustomHooks(): void { ... } // used in tests
227
+ ```
228
+
229
+ `src/hooks/custom-hooks-loader.ts` يحمّل ملف السياسة الخاص بالمستخدم:
230
+
231
+ 1. اقرأ `customPoliciesPath` من الإعدادات؛ تخطّ إذا كان غائباً.
232
+ 2. حل إلى مسار مطلق؛ تحقق من وجود الملف.
233
+ 3. أعد كتابة جميع استيرادات `from "failproofai"` إلى مسار dist الفعلي بحيث تحل `customPolicies` إلى سجل `globalThis` نفسه.
234
+ 4. أعد كتابة الاستيرادات المحلية الانتقالية بشكل متكرر لضمان التوافق مع ESM.
235
+ 5. اكتب ملفات `.mjs` مؤقتة و `import()` ملف الإدخال.
236
+ 6. استدعِ `getCustomHooks()` لاسترجاع الخطاطيف المسجلة.
237
+ 7. نظف جميع الملفات المؤقتة في كتلة `finally`.
238
+
239
+ عند حدوث أي خطأ (ملف غير موجود، خطأ في الصيغة، فشل الاستيراد)، يتم تسجيل الخطأ إلى `~/.failproofai/hook.log` والمحمّل يعيد مصفوفة فارغة. السياسات المدمجة لا تتأثر.
240
+
241
+ يتم تقييم السياسات المخصصة بعد جميع السياسات المدمجة. رفض السياسة المخصصة `deny` يوقف السياسات المخصصة الأخرى (لكن جميع البرامج المدمجة قد عملت بالفعل عند هذه النقطة).
242
+
243
+ ---
244
+
245
+ ## تسجيل النشاط
246
+
247
+ بعد كل حدث خطاف، يُلحق المعالج سطر JSONL بـ `~/.failproofai/hook-activity.jsonl`:
248
+
249
+ ```json
250
+ {
251
+ "timestamp": "2026-04-06T12:34:56.789Z",
252
+ "sessionId": "abc123",
253
+ "eventType": "PreToolUse",
254
+ "toolName": "Bash",
255
+ "policyName": "block-sudo",
256
+ "decision": "deny",
257
+ "reason": "sudo command blocked by failproofai",
258
+ "durationMs": 12
259
+ }
260
+ ```
261
+
262
+ سطر واحد لكل سياسة اتخذت قراراً غير allow. قرارات Allow لا يتم تسجيلها (للحفاظ على صغر حجم الملف).
263
+
264
+ ---
265
+
266
+ ## معمارية لوحة المعلومات
267
+
268
+ لوحة المعلومات هي تطبيق **Next.js 16** يستخدم App Router مع React Server Components و Server Actions.
269
+
270
+ ```text
271
+ app/
272
+ layout.tsx ← Root layout (theme, telemetry, nav)
273
+ projects/page.tsx ← Server component: list all Claude projects
274
+ project/[name]/page.tsx ← Server component: list sessions in a project
275
+ project/[name]/session/
276
+ [sessionId]/page.tsx ← Server component: render session viewer
277
+ policies/page.tsx ← Client component: policy management + activity log
278
+ actions/
279
+ get-hooks-config.ts ← Read config + policy list
280
+ update-hooks-config.ts ← Toggle policy on/off
281
+ update-policy-params.ts ← Update policy parameters
282
+ get-hook-activity.ts ← Paginate/search activity log
283
+ install-hooks-web.ts ← Install/remove hooks from the browser
284
+ api/
285
+ download/[project]/[session]/route.ts ← Export session as ZIP/JSONL
286
+ ```
287
+
288
+ **تدفق البيانات:**
289
+
290
+ - مكونات الصفحة استدعاء `lib/projects.ts` و `lib/log-entries.ts` لقراءة بيانات المشروع/الجلسة مباشرة من نظام الملفات (لا طبقة API للقراءات).
291
+ - صفحة السياسات استخدام Server Actions لجميع الطفرات (تبديل، تحديث المعاملات، التثبيت/الإزالة).
292
+ - عارض الجلسة يحلل تنسيق نسخة Claude JSONL ويعرض جدول زمني للرسائل واستدعاءات الأدوات.
293
+
294
+ **قرارات التصميم الرئيسية:**
295
+
296
+ - لا توجد قاعدة بيانات - جميع الحالة المستمرة موجودة في ملفات عادية (`~/.failproofai/`, `~/.claude/projects/`).
297
+ - Server Actions للطفرات - لا حاجة لـ REST API لعمليات CRUD.
298
+ - React Server Components لصفحات القراءة - حمل أولي أسرع، بدون حزمة عميل لجلب البيانات.
299
+ - مكونات العميل فقط حيث تكون التفاعلية مطلوبة (تبديل السياسة، بحث النشاط، عارض السجل).
300
+
301
+ ---
302
+
303
+ ## تخطيط الملفات
304
+
305
+ ```text
306
+ failproofai/
307
+ ├── bin/
308
+ │ └── failproofai.mjs # CLI router (hook / dashboard / install / etc.)
309
+ ├── src/hooks/
310
+ │ ├── handler.ts # Hook event pipeline
311
+ │ ├── builtin-policies.ts # 26 policy definitions
312
+ │ ├── policy-evaluator.ts # Policy execution engine
313
+ │ ├── policy-registry.ts # Policy registration and lookup
314
+ │ ├── policy-types.ts # TypeScript interfaces
315
+ │ ├── hooks-config.ts # Multi-scope config loading
316
+ │ ├── custom-hooks-registry.ts # globalThis-backed hook registry
317
+ │ ├── custom-hooks-loader.ts # ESM loader for user JS hooks
318
+ │ ├── manager.ts # install / remove / list operations
319
+ │ ├── install-prompt.ts # Interactive policy selection prompt
320
+ │ ├── hook-logger.ts # Logging to hook.log
321
+ │ ├── hook-activity-store.ts # Persist activity to hook-activity.jsonl
322
+ │ └── llm-client.ts # LLM API client (for AI-powered policies)
323
+ ├── app/ # Next.js dashboard (pages + server actions)
324
+ ├── lib/ # Shared utilities
325
+ │ ├── projects.ts # Enumerate Claude projects from filesystem
326
+ │ ├── log-entries.ts # Parse Claude transcript JSONL format
327
+ │ ├── paths.ts # Resolve system paths
328
+ │ └── ...
329
+ ├── components/ # Shared React UI components
330
+ ├── contexts/ # React context providers (theme, auto-refresh, telemetry)
331
+ ├── examples/ # Example custom hook files
332
+ └── __tests__/ # Unit and E2E tests
333
+ ```