failproofai 0.0.6-beta.2 → 0.0.6-beta.4

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 (511) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +7 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  10. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  11. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  12. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  13. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  19. package/.next/standalone/.next/server/app/_not-found.rsc +17 -17
  20. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +17 -17
  21. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  22. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  23. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  24. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  25. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  26. package/.next/standalone/.next/server/app/index.html +1 -1
  27. package/.next/standalone/.next/server/app/index.rsc +16 -16
  28. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  29. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -16
  30. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  31. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +11 -11
  32. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  33. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  34. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  37. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  40. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  43. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  44. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  47. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
  50. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  51. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  52. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  53. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  54. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  55. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
  56. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0i5kvry._.js → [root-of-the-server]__0om-5pe._.js} +2 -2
  57. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +2 -2
  58. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__05akje6._.js → [root-of-the-server]__111.vxi._.js} +2 -2
  59. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  60. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  61. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
  62. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  63. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0mebn66._.js +1 -1
  65. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  66. package/.next/standalone/.next/server/pages/404.html +2 -2
  67. package/.next/standalone/.next/server/pages/500.html +1 -1
  68. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  70. package/.next/standalone/.next/static/chunks/{05j1px0r8yzh6.js → 02dqjyv6_9mhq.js} +2 -2
  71. package/.next/standalone/.next/static/chunks/{14cl9poem30dq.js → 070orfsl6.xal.js} +1 -1
  72. package/.next/standalone/.next/static/chunks/0mir9jdxn35~s.css +1 -0
  73. package/.next/standalone/.next/static/chunks/{00j0rr7rh8ef8.js → 0o547jv-k_k35.js} +1 -1
  74. package/.next/standalone/.next/static/chunks/{0ijk_kek9_wyx.js → 0pk2h2.mjxy.m.js} +1 -1
  75. package/.next/standalone/.next/static/chunks/{0xpl.oscrakvx.js → 0rcwkbh24w38b.js} +1 -1
  76. package/.next/standalone/.next/static/chunks/{1052sguyd-.ka.js → 140xx_tfr~lm_.js} +1 -1
  77. package/.next/standalone/.next/static/chunks/{0npb~873.wvg3.js → 169_e4dq~1~b6.js} +1 -1
  78. package/.next/standalone/.next/static/chunks/{0badv41uxa56..js → 17ne4p.1sw1jy.js} +1 -1
  79. package/.next/standalone/next.config.ts +6 -0
  80. package/.next/standalone/package.json +2 -2
  81. package/.next/standalone/server.js +1 -1
  82. package/bin/failproofai.mjs +91 -4
  83. package/dist/cli.mjs +1155 -54
  84. package/package.json +2 -2
  85. package/scripts/prune-standalone.mjs +128 -0
  86. package/src/auth/login.ts +104 -0
  87. package/src/auth/logout.ts +50 -0
  88. package/src/auth/token-store.ts +64 -0
  89. package/src/hooks/builtin-policies.ts +22 -20
  90. package/src/hooks/handler.ts +35 -15
  91. package/src/relay/daemon.ts +362 -0
  92. package/src/relay/pid.ts +76 -0
  93. package/src/relay/queue.ts +225 -0
  94. package/.next/standalone/.claude/settings.json +0 -316
  95. package/.next/standalone/.failproofai/policies/review-policies.mjs +0 -113
  96. package/.next/standalone/.failproofai/policies/workflow-policies.mjs +0 -63
  97. package/.next/standalone/.failproofai/policies-config.json +0 -39
  98. package/.next/standalone/.next/static/chunks/0gu_a.a80ritd.css +0 -1
  99. package/.next/standalone/AGENTS.md +0 -80
  100. package/.next/standalone/CHANGELOG.md +0 -151
  101. package/.next/standalone/CLAUDE.md +0 -165
  102. package/.next/standalone/CONTRIBUTING.md +0 -76
  103. package/.next/standalone/Dockerfile.docs +0 -12
  104. package/.next/standalone/LICENSE +0 -42
  105. package/.next/standalone/README.md +0 -301
  106. package/.next/standalone/bin/failproofai.mjs +0 -352
  107. package/.next/standalone/bun.lock +0 -1119
  108. package/.next/standalone/components.json +0 -23
  109. package/.next/standalone/dist/cli.mjs +0 -3595
  110. package/.next/standalone/dist/index.js +0 -80
  111. package/.next/standalone/docs/ar/architecture.mdx +0 -334
  112. package/.next/standalone/docs/ar/built-in-policies.mdx +0 -574
  113. package/.next/standalone/docs/ar/cli/dashboard.mdx +0 -28
  114. package/.next/standalone/docs/ar/cli/environment-variables.mdx +0 -34
  115. package/.next/standalone/docs/ar/cli/hook.mdx +0 -31
  116. package/.next/standalone/docs/ar/cli/install-policies.mdx +0 -48
  117. package/.next/standalone/docs/ar/cli/list-policies.mdx +0 -31
  118. package/.next/standalone/docs/ar/cli/remove-policies.mdx +0 -43
  119. package/.next/standalone/docs/ar/cli/version.mdx +0 -13
  120. package/.next/standalone/docs/ar/configuration.mdx +0 -223
  121. package/.next/standalone/docs/ar/custom-policies.mdx +0 -354
  122. package/.next/standalone/docs/ar/dashboard.mdx +0 -142
  123. package/.next/standalone/docs/ar/examples.mdx +0 -307
  124. package/.next/standalone/docs/ar/for-agents.mdx +0 -39
  125. package/.next/standalone/docs/ar/getting-started.mdx +0 -187
  126. package/.next/standalone/docs/ar/introduction.mdx +0 -58
  127. package/.next/standalone/docs/ar/package-aliases.mdx +0 -82
  128. package/.next/standalone/docs/ar/testing.mdx +0 -261
  129. package/.next/standalone/docs/architecture.mdx +0 -332
  130. package/.next/standalone/docs/built-in-policies.mdx +0 -574
  131. package/.next/standalone/docs/cli/dashboard.mdx +0 -28
  132. package/.next/standalone/docs/cli/environment-variables.mdx +0 -34
  133. package/.next/standalone/docs/cli/hook.mdx +0 -30
  134. package/.next/standalone/docs/cli/install-policies.mdx +0 -47
  135. package/.next/standalone/docs/cli/list-policies.mdx +0 -31
  136. package/.next/standalone/docs/cli/remove-policies.mdx +0 -43
  137. package/.next/standalone/docs/cli/version.mdx +0 -12
  138. package/.next/standalone/docs/configuration.mdx +0 -222
  139. package/.next/standalone/docs/custom-policies.mdx +0 -353
  140. package/.next/standalone/docs/dashboard.mdx +0 -142
  141. package/.next/standalone/docs/de/architecture.mdx +0 -332
  142. package/.next/standalone/docs/de/built-in-policies.mdx +0 -574
  143. package/.next/standalone/docs/de/cli/dashboard.mdx +0 -28
  144. package/.next/standalone/docs/de/cli/environment-variables.mdx +0 -34
  145. package/.next/standalone/docs/de/cli/hook.mdx +0 -30
  146. package/.next/standalone/docs/de/cli/install-policies.mdx +0 -47
  147. package/.next/standalone/docs/de/cli/list-policies.mdx +0 -31
  148. package/.next/standalone/docs/de/cli/remove-policies.mdx +0 -43
  149. package/.next/standalone/docs/de/cli/version.mdx +0 -12
  150. package/.next/standalone/docs/de/configuration.mdx +0 -222
  151. package/.next/standalone/docs/de/custom-policies.mdx +0 -353
  152. package/.next/standalone/docs/de/dashboard.mdx +0 -142
  153. package/.next/standalone/docs/de/examples.mdx +0 -307
  154. package/.next/standalone/docs/de/for-agents.mdx +0 -38
  155. package/.next/standalone/docs/de/getting-started.mdx +0 -186
  156. package/.next/standalone/docs/de/introduction.mdx +0 -57
  157. package/.next/standalone/docs/de/package-aliases.mdx +0 -82
  158. package/.next/standalone/docs/de/testing.mdx +0 -260
  159. package/.next/standalone/docs/docs.json +0 -1002
  160. package/.next/standalone/docs/es/architecture.mdx +0 -332
  161. package/.next/standalone/docs/es/built-in-policies.mdx +0 -574
  162. package/.next/standalone/docs/es/cli/dashboard.mdx +0 -28
  163. package/.next/standalone/docs/es/cli/environment-variables.mdx +0 -34
  164. package/.next/standalone/docs/es/cli/hook.mdx +0 -30
  165. package/.next/standalone/docs/es/cli/install-policies.mdx +0 -47
  166. package/.next/standalone/docs/es/cli/list-policies.mdx +0 -31
  167. package/.next/standalone/docs/es/cli/remove-policies.mdx +0 -43
  168. package/.next/standalone/docs/es/cli/version.mdx +0 -12
  169. package/.next/standalone/docs/es/configuration.mdx +0 -222
  170. package/.next/standalone/docs/es/custom-policies.mdx +0 -353
  171. package/.next/standalone/docs/es/dashboard.mdx +0 -142
  172. package/.next/standalone/docs/es/examples.mdx +0 -307
  173. package/.next/standalone/docs/es/for-agents.mdx +0 -38
  174. package/.next/standalone/docs/es/getting-started.mdx +0 -186
  175. package/.next/standalone/docs/es/introduction.mdx +0 -57
  176. package/.next/standalone/docs/es/package-aliases.mdx +0 -82
  177. package/.next/standalone/docs/es/testing.mdx +0 -260
  178. package/.next/standalone/docs/examples.mdx +0 -307
  179. package/.next/standalone/docs/favicon.ico +0 -0
  180. package/.next/standalone/docs/for-agents.mdx +0 -38
  181. package/.next/standalone/docs/fr/architecture.mdx +0 -332
  182. package/.next/standalone/docs/fr/built-in-policies.mdx +0 -574
  183. package/.next/standalone/docs/fr/cli/dashboard.mdx +0 -28
  184. package/.next/standalone/docs/fr/cli/environment-variables.mdx +0 -34
  185. package/.next/standalone/docs/fr/cli/hook.mdx +0 -30
  186. package/.next/standalone/docs/fr/cli/install-policies.mdx +0 -47
  187. package/.next/standalone/docs/fr/cli/list-policies.mdx +0 -31
  188. package/.next/standalone/docs/fr/cli/remove-policies.mdx +0 -43
  189. package/.next/standalone/docs/fr/cli/version.mdx +0 -12
  190. package/.next/standalone/docs/fr/configuration.mdx +0 -222
  191. package/.next/standalone/docs/fr/custom-policies.mdx +0 -353
  192. package/.next/standalone/docs/fr/dashboard.mdx +0 -142
  193. package/.next/standalone/docs/fr/examples.mdx +0 -307
  194. package/.next/standalone/docs/fr/for-agents.mdx +0 -38
  195. package/.next/standalone/docs/fr/getting-started.mdx +0 -186
  196. package/.next/standalone/docs/fr/introduction.mdx +0 -57
  197. package/.next/standalone/docs/fr/package-aliases.mdx +0 -82
  198. package/.next/standalone/docs/fr/testing.mdx +0 -260
  199. package/.next/standalone/docs/getting-started.mdx +0 -186
  200. package/.next/standalone/docs/he/architecture.mdx +0 -333
  201. package/.next/standalone/docs/he/built-in-policies.mdx +0 -574
  202. package/.next/standalone/docs/he/cli/dashboard.mdx +0 -28
  203. package/.next/standalone/docs/he/cli/environment-variables.mdx +0 -34
  204. package/.next/standalone/docs/he/cli/hook.mdx +0 -30
  205. package/.next/standalone/docs/he/cli/install-policies.mdx +0 -47
  206. package/.next/standalone/docs/he/cli/list-policies.mdx +0 -32
  207. package/.next/standalone/docs/he/cli/remove-policies.mdx +0 -43
  208. package/.next/standalone/docs/he/cli/version.mdx +0 -12
  209. package/.next/standalone/docs/he/configuration.mdx +0 -223
  210. package/.next/standalone/docs/he/custom-policies.mdx +0 -353
  211. package/.next/standalone/docs/he/dashboard.mdx +0 -142
  212. package/.next/standalone/docs/he/examples.mdx +0 -307
  213. package/.next/standalone/docs/he/for-agents.mdx +0 -38
  214. package/.next/standalone/docs/he/getting-started.mdx +0 -186
  215. package/.next/standalone/docs/he/introduction.mdx +0 -57
  216. package/.next/standalone/docs/he/package-aliases.mdx +0 -82
  217. package/.next/standalone/docs/he/testing.mdx +0 -260
  218. package/.next/standalone/docs/hi/architecture.mdx +0 -334
  219. package/.next/standalone/docs/hi/built-in-policies.mdx +0 -576
  220. package/.next/standalone/docs/hi/cli/dashboard.mdx +0 -28
  221. package/.next/standalone/docs/hi/cli/environment-variables.mdx +0 -34
  222. package/.next/standalone/docs/hi/cli/hook.mdx +0 -30
  223. package/.next/standalone/docs/hi/cli/install-policies.mdx +0 -47
  224. package/.next/standalone/docs/hi/cli/list-policies.mdx +0 -31
  225. package/.next/standalone/docs/hi/cli/remove-policies.mdx +0 -43
  226. package/.next/standalone/docs/hi/cli/version.mdx +0 -12
  227. package/.next/standalone/docs/hi/configuration.mdx +0 -222
  228. package/.next/standalone/docs/hi/custom-policies.mdx +0 -354
  229. package/.next/standalone/docs/hi/dashboard.mdx +0 -142
  230. package/.next/standalone/docs/hi/examples.mdx +0 -309
  231. package/.next/standalone/docs/hi/for-agents.mdx +0 -38
  232. package/.next/standalone/docs/hi/getting-started.mdx +0 -187
  233. package/.next/standalone/docs/hi/introduction.mdx +0 -57
  234. package/.next/standalone/docs/hi/package-aliases.mdx +0 -82
  235. package/.next/standalone/docs/hi/testing.mdx +0 -260
  236. package/.next/standalone/docs/i18n/README.ar.md +0 -312
  237. package/.next/standalone/docs/i18n/README.de.md +0 -307
  238. package/.next/standalone/docs/i18n/README.es.md +0 -307
  239. package/.next/standalone/docs/i18n/README.fr.md +0 -307
  240. package/.next/standalone/docs/i18n/README.he.md +0 -312
  241. package/.next/standalone/docs/i18n/README.hi.md +0 -307
  242. package/.next/standalone/docs/i18n/README.it.md +0 -307
  243. package/.next/standalone/docs/i18n/README.ja.md +0 -307
  244. package/.next/standalone/docs/i18n/README.ko.md +0 -307
  245. package/.next/standalone/docs/i18n/README.pt-br.md +0 -307
  246. package/.next/standalone/docs/i18n/README.ru.md +0 -308
  247. package/.next/standalone/docs/i18n/README.tr.md +0 -307
  248. package/.next/standalone/docs/i18n/README.vi.md +0 -307
  249. package/.next/standalone/docs/i18n/README.zh.md +0 -307
  250. package/.next/standalone/docs/introduction.mdx +0 -57
  251. package/.next/standalone/docs/it/architecture.mdx +0 -334
  252. package/.next/standalone/docs/it/built-in-policies.mdx +0 -574
  253. package/.next/standalone/docs/it/cli/dashboard.mdx +0 -28
  254. package/.next/standalone/docs/it/cli/environment-variables.mdx +0 -34
  255. package/.next/standalone/docs/it/cli/hook.mdx +0 -30
  256. package/.next/standalone/docs/it/cli/install-policies.mdx +0 -47
  257. package/.next/standalone/docs/it/cli/list-policies.mdx +0 -31
  258. package/.next/standalone/docs/it/cli/remove-policies.mdx +0 -43
  259. package/.next/standalone/docs/it/cli/version.mdx +0 -12
  260. package/.next/standalone/docs/it/configuration.mdx +0 -222
  261. package/.next/standalone/docs/it/custom-policies.mdx +0 -353
  262. package/.next/standalone/docs/it/dashboard.mdx +0 -142
  263. package/.next/standalone/docs/it/examples.mdx +0 -307
  264. package/.next/standalone/docs/it/for-agents.mdx +0 -38
  265. package/.next/standalone/docs/it/getting-started.mdx +0 -186
  266. package/.next/standalone/docs/it/introduction.mdx +0 -57
  267. package/.next/standalone/docs/it/package-aliases.mdx +0 -82
  268. package/.next/standalone/docs/it/testing.mdx +0 -260
  269. package/.next/standalone/docs/ja/architecture.mdx +0 -332
  270. package/.next/standalone/docs/ja/built-in-policies.mdx +0 -572
  271. package/.next/standalone/docs/ja/cli/dashboard.mdx +0 -28
  272. package/.next/standalone/docs/ja/cli/environment-variables.mdx +0 -34
  273. package/.next/standalone/docs/ja/cli/hook.mdx +0 -30
  274. package/.next/standalone/docs/ja/cli/install-policies.mdx +0 -47
  275. package/.next/standalone/docs/ja/cli/list-policies.mdx +0 -31
  276. package/.next/standalone/docs/ja/cli/remove-policies.mdx +0 -43
  277. package/.next/standalone/docs/ja/cli/version.mdx +0 -12
  278. package/.next/standalone/docs/ja/configuration.mdx +0 -222
  279. package/.next/standalone/docs/ja/custom-policies.mdx +0 -353
  280. package/.next/standalone/docs/ja/dashboard.mdx +0 -142
  281. package/.next/standalone/docs/ja/examples.mdx +0 -307
  282. package/.next/standalone/docs/ja/for-agents.mdx +0 -38
  283. package/.next/standalone/docs/ja/getting-started.mdx +0 -186
  284. package/.next/standalone/docs/ja/introduction.mdx +0 -57
  285. package/.next/standalone/docs/ja/package-aliases.mdx +0 -82
  286. package/.next/standalone/docs/ja/testing.mdx +0 -260
  287. package/.next/standalone/docs/ko/architecture.mdx +0 -332
  288. package/.next/standalone/docs/ko/built-in-policies.mdx +0 -572
  289. package/.next/standalone/docs/ko/cli/dashboard.mdx +0 -28
  290. package/.next/standalone/docs/ko/cli/environment-variables.mdx +0 -34
  291. package/.next/standalone/docs/ko/cli/hook.mdx +0 -30
  292. package/.next/standalone/docs/ko/cli/install-policies.mdx +0 -47
  293. package/.next/standalone/docs/ko/cli/list-policies.mdx +0 -31
  294. package/.next/standalone/docs/ko/cli/remove-policies.mdx +0 -43
  295. package/.next/standalone/docs/ko/cli/version.mdx +0 -12
  296. package/.next/standalone/docs/ko/configuration.mdx +0 -222
  297. package/.next/standalone/docs/ko/custom-policies.mdx +0 -353
  298. package/.next/standalone/docs/ko/dashboard.mdx +0 -142
  299. package/.next/standalone/docs/ko/examples.mdx +0 -307
  300. package/.next/standalone/docs/ko/for-agents.mdx +0 -38
  301. package/.next/standalone/docs/ko/getting-started.mdx +0 -186
  302. package/.next/standalone/docs/ko/introduction.mdx +0 -57
  303. package/.next/standalone/docs/ko/package-aliases.mdx +0 -82
  304. package/.next/standalone/docs/ko/testing.mdx +0 -260
  305. package/.next/standalone/docs/logo/dark.svg +0 -21
  306. package/.next/standalone/docs/logo/exosphere-dark.png +0 -0
  307. package/.next/standalone/docs/logo/exosphere-light.png +0 -0
  308. package/.next/standalone/docs/logo/light.svg +0 -21
  309. package/.next/standalone/docs/package-aliases.mdx +0 -82
  310. package/.next/standalone/docs/pt-br/architecture.mdx +0 -332
  311. package/.next/standalone/docs/pt-br/built-in-policies.mdx +0 -574
  312. package/.next/standalone/docs/pt-br/cli/dashboard.mdx +0 -28
  313. package/.next/standalone/docs/pt-br/cli/environment-variables.mdx +0 -34
  314. package/.next/standalone/docs/pt-br/cli/hook.mdx +0 -30
  315. package/.next/standalone/docs/pt-br/cli/install-policies.mdx +0 -47
  316. package/.next/standalone/docs/pt-br/cli/list-policies.mdx +0 -31
  317. package/.next/standalone/docs/pt-br/cli/remove-policies.mdx +0 -43
  318. package/.next/standalone/docs/pt-br/cli/version.mdx +0 -12
  319. package/.next/standalone/docs/pt-br/configuration.mdx +0 -222
  320. package/.next/standalone/docs/pt-br/custom-policies.mdx +0 -353
  321. package/.next/standalone/docs/pt-br/dashboard.mdx +0 -142
  322. package/.next/standalone/docs/pt-br/examples.mdx +0 -307
  323. package/.next/standalone/docs/pt-br/for-agents.mdx +0 -38
  324. package/.next/standalone/docs/pt-br/getting-started.mdx +0 -186
  325. package/.next/standalone/docs/pt-br/introduction.mdx +0 -57
  326. package/.next/standalone/docs/pt-br/package-aliases.mdx +0 -82
  327. package/.next/standalone/docs/pt-br/testing.mdx +0 -260
  328. package/.next/standalone/docs/ru/architecture.mdx +0 -333
  329. package/.next/standalone/docs/ru/built-in-policies.mdx +0 -574
  330. package/.next/standalone/docs/ru/cli/dashboard.mdx +0 -28
  331. package/.next/standalone/docs/ru/cli/environment-variables.mdx +0 -34
  332. package/.next/standalone/docs/ru/cli/hook.mdx +0 -30
  333. package/.next/standalone/docs/ru/cli/install-policies.mdx +0 -48
  334. package/.next/standalone/docs/ru/cli/list-policies.mdx +0 -32
  335. package/.next/standalone/docs/ru/cli/remove-policies.mdx +0 -43
  336. package/.next/standalone/docs/ru/cli/version.mdx +0 -12
  337. package/.next/standalone/docs/ru/configuration.mdx +0 -222
  338. package/.next/standalone/docs/ru/custom-policies.mdx +0 -354
  339. package/.next/standalone/docs/ru/dashboard.mdx +0 -142
  340. package/.next/standalone/docs/ru/examples.mdx +0 -309
  341. package/.next/standalone/docs/ru/for-agents.mdx +0 -38
  342. package/.next/standalone/docs/ru/getting-started.mdx +0 -186
  343. package/.next/standalone/docs/ru/introduction.mdx +0 -57
  344. package/.next/standalone/docs/ru/package-aliases.mdx +0 -82
  345. package/.next/standalone/docs/ru/testing.mdx +0 -260
  346. package/.next/standalone/docs/testing.mdx +0 -260
  347. package/.next/standalone/docs/tr/architecture.mdx +0 -333
  348. package/.next/standalone/docs/tr/built-in-policies.mdx +0 -574
  349. package/.next/standalone/docs/tr/cli/dashboard.mdx +0 -28
  350. package/.next/standalone/docs/tr/cli/environment-variables.mdx +0 -34
  351. package/.next/standalone/docs/tr/cli/hook.mdx +0 -30
  352. package/.next/standalone/docs/tr/cli/install-policies.mdx +0 -47
  353. package/.next/standalone/docs/tr/cli/list-policies.mdx +0 -31
  354. package/.next/standalone/docs/tr/cli/remove-policies.mdx +0 -44
  355. package/.next/standalone/docs/tr/cli/version.mdx +0 -12
  356. package/.next/standalone/docs/tr/configuration.mdx +0 -222
  357. package/.next/standalone/docs/tr/custom-policies.mdx +0 -353
  358. package/.next/standalone/docs/tr/dashboard.mdx +0 -142
  359. package/.next/standalone/docs/tr/examples.mdx +0 -308
  360. package/.next/standalone/docs/tr/for-agents.mdx +0 -38
  361. package/.next/standalone/docs/tr/getting-started.mdx +0 -186
  362. package/.next/standalone/docs/tr/introduction.mdx +0 -57
  363. package/.next/standalone/docs/tr/package-aliases.mdx +0 -82
  364. package/.next/standalone/docs/tr/testing.mdx +0 -260
  365. package/.next/standalone/docs/vi/architecture.mdx +0 -334
  366. package/.next/standalone/docs/vi/built-in-policies.mdx +0 -575
  367. package/.next/standalone/docs/vi/cli/dashboard.mdx +0 -28
  368. package/.next/standalone/docs/vi/cli/environment-variables.mdx +0 -34
  369. package/.next/standalone/docs/vi/cli/hook.mdx +0 -30
  370. package/.next/standalone/docs/vi/cli/install-policies.mdx +0 -47
  371. package/.next/standalone/docs/vi/cli/list-policies.mdx +0 -31
  372. package/.next/standalone/docs/vi/cli/remove-policies.mdx +0 -43
  373. package/.next/standalone/docs/vi/cli/version.mdx +0 -13
  374. package/.next/standalone/docs/vi/configuration.mdx +0 -222
  375. package/.next/standalone/docs/vi/custom-policies.mdx +0 -353
  376. package/.next/standalone/docs/vi/dashboard.mdx +0 -142
  377. package/.next/standalone/docs/vi/examples.mdx +0 -308
  378. package/.next/standalone/docs/vi/for-agents.mdx +0 -38
  379. package/.next/standalone/docs/vi/getting-started.mdx +0 -186
  380. package/.next/standalone/docs/vi/introduction.mdx +0 -57
  381. package/.next/standalone/docs/vi/package-aliases.mdx +0 -82
  382. package/.next/standalone/docs/vi/testing.mdx +0 -260
  383. package/.next/standalone/docs/zh/architecture.mdx +0 -332
  384. package/.next/standalone/docs/zh/built-in-policies.mdx +0 -572
  385. package/.next/standalone/docs/zh/cli/dashboard.mdx +0 -28
  386. package/.next/standalone/docs/zh/cli/environment-variables.mdx +0 -34
  387. package/.next/standalone/docs/zh/cli/hook.mdx +0 -30
  388. package/.next/standalone/docs/zh/cli/install-policies.mdx +0 -47
  389. package/.next/standalone/docs/zh/cli/list-policies.mdx +0 -31
  390. package/.next/standalone/docs/zh/cli/remove-policies.mdx +0 -43
  391. package/.next/standalone/docs/zh/cli/version.mdx +0 -12
  392. package/.next/standalone/docs/zh/configuration.mdx +0 -222
  393. package/.next/standalone/docs/zh/custom-policies.mdx +0 -353
  394. package/.next/standalone/docs/zh/dashboard.mdx +0 -142
  395. package/.next/standalone/docs/zh/examples.mdx +0 -307
  396. package/.next/standalone/docs/zh/for-agents.mdx +0 -38
  397. package/.next/standalone/docs/zh/getting-started.mdx +0 -186
  398. package/.next/standalone/docs/zh/introduction.mdx +0 -57
  399. package/.next/standalone/docs/zh/package-aliases.mdx +0 -82
  400. package/.next/standalone/docs/zh/testing.mdx +0 -260
  401. package/.next/standalone/eslint.config.mjs +0 -15
  402. package/.next/standalone/examples/convention-policies/security-policies.mjs +0 -40
  403. package/.next/standalone/examples/convention-policies/workflow-policies.mjs +0 -41
  404. package/.next/standalone/examples/policies-advanced/index.js +0 -103
  405. package/.next/standalone/examples/policies-advanced/utils.js +0 -35
  406. package/.next/standalone/examples/policies-basic.js +0 -77
  407. package/.next/standalone/examples/policies-notification.js +0 -104
  408. package/.next/standalone/node_modules/@img/colour/color.cjs +0 -1594
  409. package/.next/standalone/node_modules/@img/colour/index.cjs +0 -1
  410. package/.next/standalone/node_modules/@img/colour/package.json +0 -45
  411. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
  412. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  413. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
  414. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  415. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -42
  416. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/versions.json +0 -30
  417. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  418. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  419. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  420. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  421. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
  422. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  423. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  424. package/.next/standalone/node_modules/@img/sharp-linux-x64/package.json +0 -46
  425. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  426. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
  427. package/.next/standalone/node_modules/detect-libc/lib/detect-libc.js +0 -313
  428. package/.next/standalone/node_modules/detect-libc/lib/elf.js +0 -39
  429. package/.next/standalone/node_modules/detect-libc/lib/filesystem.js +0 -51
  430. package/.next/standalone/node_modules/detect-libc/lib/process.js +0 -24
  431. package/.next/standalone/node_modules/detect-libc/package.json +0 -44
  432. package/.next/standalone/node_modules/sharp/lib/channel.js +0 -177
  433. package/.next/standalone/node_modules/sharp/lib/colour.js +0 -195
  434. package/.next/standalone/node_modules/sharp/lib/composite.js +0 -212
  435. package/.next/standalone/node_modules/sharp/lib/constructor.js +0 -499
  436. package/.next/standalone/node_modules/sharp/lib/index.js +0 -16
  437. package/.next/standalone/node_modules/sharp/lib/input.js +0 -809
  438. package/.next/standalone/node_modules/sharp/lib/is.js +0 -143
  439. package/.next/standalone/node_modules/sharp/lib/libvips.js +0 -207
  440. package/.next/standalone/node_modules/sharp/lib/operation.js +0 -1016
  441. package/.next/standalone/node_modules/sharp/lib/output.js +0 -1666
  442. package/.next/standalone/node_modules/sharp/lib/resize.js +0 -595
  443. package/.next/standalone/node_modules/sharp/lib/sharp.js +0 -121
  444. package/.next/standalone/node_modules/sharp/lib/utility.js +0 -291
  445. package/.next/standalone/node_modules/sharp/node_modules/semver/classes/comparator.js +0 -143
  446. package/.next/standalone/node_modules/sharp/node_modules/semver/classes/range.js +0 -557
  447. package/.next/standalone/node_modules/sharp/node_modules/semver/classes/semver.js +0 -333
  448. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/cmp.js +0 -54
  449. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/coerce.js +0 -62
  450. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/compare.js +0 -7
  451. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/eq.js +0 -5
  452. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/gt.js +0 -5
  453. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/gte.js +0 -5
  454. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/lt.js +0 -5
  455. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/lte.js +0 -5
  456. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/neq.js +0 -5
  457. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/parse.js +0 -18
  458. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/satisfies.js +0 -12
  459. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/constants.js +0 -37
  460. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/debug.js +0 -11
  461. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/identifiers.js +0 -29
  462. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/lrucache.js +0 -42
  463. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/parse-options.js +0 -17
  464. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/re.js +0 -223
  465. package/.next/standalone/node_modules/sharp/node_modules/semver/package.json +0 -78
  466. package/.next/standalone/node_modules/sharp/package.json +0 -202
  467. package/.next/standalone/scripts/alias-proxy.js +0 -18
  468. package/.next/standalone/scripts/dev.ts +0 -3
  469. package/.next/standalone/scripts/install-telemetry.mjs +0 -108
  470. package/.next/standalone/scripts/launch.ts +0 -83
  471. package/.next/standalone/scripts/parse-script-args.ts +0 -87
  472. package/.next/standalone/scripts/postinstall.mjs +0 -121
  473. package/.next/standalone/scripts/preuninstall.mjs +0 -131
  474. package/.next/standalone/scripts/publish-aliases.mjs +0 -87
  475. package/.next/standalone/scripts/start.ts +0 -3
  476. package/.next/standalone/scripts/sync-hook-events-prompt.md +0 -60
  477. package/.next/standalone/scripts/translate-docs/cache.ts +0 -62
  478. package/.next/standalone/scripts/translate-docs/cli.ts +0 -357
  479. package/.next/standalone/scripts/translate-docs/config.ts +0 -248
  480. package/.next/standalone/scripts/translate-docs/mdx-translator.ts +0 -153
  481. package/.next/standalone/scripts/translate-docs/mintlify-nav.ts +0 -107
  482. package/.next/standalone/scripts/translate-docs/readme-translator.ts +0 -154
  483. package/.next/standalone/scripts/translate-docs/translator.ts +0 -68
  484. package/.next/standalone/scripts/translate-docs/types.ts +0 -43
  485. package/.next/standalone/src/cli-error.ts +0 -18
  486. package/.next/standalone/src/hooks/builtin-policies.ts +0 -1613
  487. package/.next/standalone/src/hooks/custom-hooks-loader.ts +0 -205
  488. package/.next/standalone/src/hooks/custom-hooks-registry.ts +0 -30
  489. package/.next/standalone/src/hooks/handler.ts +0 -202
  490. package/.next/standalone/src/hooks/hook-activity-store.ts +0 -349
  491. package/.next/standalone/src/hooks/hook-logger.ts +0 -133
  492. package/.next/standalone/src/hooks/hook-telemetry.ts +0 -43
  493. package/.next/standalone/src/hooks/hooks-config.ts +0 -166
  494. package/.next/standalone/src/hooks/install-prompt.ts +0 -357
  495. package/.next/standalone/src/hooks/llm-client.ts +0 -90
  496. package/.next/standalone/src/hooks/loader-utils.ts +0 -178
  497. package/.next/standalone/src/hooks/manager.ts +0 -692
  498. package/.next/standalone/src/hooks/policy-evaluator.ts +0 -224
  499. package/.next/standalone/src/hooks/policy-helpers.ts +0 -16
  500. package/.next/standalone/src/hooks/policy-registry.ts +0 -90
  501. package/.next/standalone/src/hooks/policy-types.ts +0 -77
  502. package/.next/standalone/src/hooks/types.ts +0 -63
  503. package/.next/standalone/src/index.ts +0 -19
  504. package/.next/standalone/src/posthog-key.ts +0 -5
  505. package/.next/standalone/tailwind.config.ts +0 -11
  506. package/.next/standalone/tsconfig.json +0 -42
  507. package/.next/standalone/vitest.config.e2e.mts +0 -24
  508. package/.next/standalone/vitest.config.mts +0 -23
  509. /package/.next/standalone/.next/static/{A9pNTZdoYJTVyPAYwQMx5 → wOkJXoch1UmRAmyIuKZWc}/_buildManifest.js +0 -0
  510. /package/.next/standalone/.next/static/{A9pNTZdoYJTVyPAYwQMx5 → wOkJXoch1UmRAmyIuKZWc}/_clientMiddlewareManifest.js +0 -0
  511. /package/.next/standalone/.next/static/{A9pNTZdoYJTVyPAYwQMx5 → wOkJXoch1UmRAmyIuKZWc}/_ssgManifest.js +0 -0
@@ -1,31 +0,0 @@
1
- ---
2
- title: 列出策略
3
- description: "查看已启用的策略、其参数以及自定义策略"
4
- ---
5
-
6
- ```bash
7
- failproofai policies
8
- ```
9
-
10
- 显示所有策略及其状态、已配置的参数和自定义策略。
11
-
12
- ## 示例输出
13
-
14
- ```text
15
- Failproof AI Hook Policies (user)
16
-
17
- Status Name Description
18
- ────── ──────────────────────────────────────────────────────────────
19
- ✓ block-sudo Block sudo commands
20
- allowPatterns: ["sudo systemctl status"]
21
- ✓ block-rm-rf Block recursive deletions
22
- ✗ block-curl-pipe-sh Block curl|bash patterns
23
- ✓ sanitize-api-keys Redact API keys from output
24
- additionalPatterns: [{ regex: "MY_TOKEN_...", label: "..." }]
25
-
26
- ── Custom Policies (/home/alice/myproject/my-policies.js) ──────────────
27
- ✓ require-jira-ticket Block commits without ticket
28
- ✓ approval-gate Approval gate for destructive ops
29
- ```
30
-
31
- `policyParams` 中的未知键会在此处标记出来,帮助你尽早发现拼写错误。
@@ -1,43 +0,0 @@
1
- ---
2
- title: 卸载策略
3
- description: "从 Claude Code 的设置中移除钩子条目"
4
- ---
5
-
6
- ```bash
7
- failproofai policies --uninstall [policy-names...] [options]
8
- ```
9
-
10
- 从 Claude Code 的 `settings.json` 中移除 failproofai 钩子条目。
11
-
12
- 别名:`failproofai p -u`
13
-
14
- ## 选项
15
-
16
- | 标志 | 描述 |
17
- |------|------|
18
- | `--scope user` | 从全局设置中移除(默认) |
19
- | `--scope project` | 从项目设置中移除 |
20
- | `--scope local` | 从本地设置中移除 |
21
- | `--scope all` | 从所有作用域中一次性移除 |
22
- | `--custom` / `-c` | 从配置中清除 `customPoliciesPath` |
23
-
24
- ## 行为说明
25
-
26
- - **未指定策略名称** — 从设置文件中移除所有 failproofai 钩子条目
27
- - **指定具体名称** — 禁用对应策略,但保留已安装的钩子
28
-
29
- ## 示例
30
-
31
- ```bash
32
- # 全局移除所有钩子
33
- failproofai policies --uninstall
34
-
35
- # 禁用特定策略(保留已安装的钩子)
36
- failproofai policies --uninstall block-sudo
37
-
38
- # 从所有作用域中移除钩子
39
- failproofai policies --uninstall --scope all
40
-
41
- # 清除自定义策略路径
42
- failproofai policies --uninstall --custom
43
- ```
@@ -1,12 +0,0 @@
1
- ---
2
- title: 查看版本
3
- description: "打印已安装的 failproofai 版本"
4
- ---
5
-
6
- ```bash
7
- failproofai --version
8
- # or
9
- failproofai -v
10
- ```
11
-
12
- 打印已安装的版本号。
@@ -1,222 +0,0 @@
1
- ---
2
- title: 配置
3
- description: "配置文件格式、三层作用域系统及合并规则"
4
- icon: gear
5
- ---
6
-
7
- failproofai 使用 JSON 配置文件来控制哪些策略处于激活状态、它们的行为方式,以及自定义策略的加载路径。配置设计上便于与团队共享——将其提交到代码仓库,每位开发者都能获得相同的 Agent 安全保障。
8
-
9
- ---
10
-
11
- ## 配置作用域
12
-
13
- 共有三个配置作用域,按优先级顺序进行评估:
14
-
15
- | 作用域 | 文件路径 | 用途 |
16
- |-------|-----------|---------|
17
- | **project(项目)** | `.failproofai/policies-config.json` | 仓库级设置,提交至版本控制 |
18
- | **local(本地)** | `.failproofai/policies-config.local.json` | 个人仓库级覆盖,已加入 gitignore |
19
- | **global(全局)** | `~/.failproofai/policies-config.json` | 适用于所有项目的用户级默认设置 |
20
-
21
- 当 failproofai 接收到 hook 事件时,会加载并合并当前工作目录下存在的全部三个文件。
22
-
23
- ### 合并规则
24
-
25
- **`enabledPolicies`** — 取三个作用域的并集。任意层级启用的策略均处于激活状态。
26
-
27
- ```text
28
- project: ["block-sudo"]
29
- local: ["block-rm-rf"]
30
- global: ["block-sudo", "sanitize-api-keys"]
31
-
32
- resolved: ["block-sudo", "block-rm-rf", "sanitize-api-keys"] ← 去重后的并集
33
- ```
34
-
35
- **`policyParams`** — 对于某个策略,最先定义其参数的作用域完全生效。策略参数内部的值不会进行深度合并。
36
-
37
- ```text
38
- project: block-sudo → { allowPatterns: ["sudo apt-get update"] }
39
- global: block-sudo → { allowPatterns: ["sudo systemctl status"] }
40
-
41
- resolved: { allowPatterns: ["sudo apt-get update"] } ← project 优先,global 被忽略
42
- ```
43
-
44
- ```text
45
- project: (无 block-sudo 条目)
46
- local: (无 block-sudo 条目)
47
- global: block-sudo → { allowPatterns: ["sudo systemctl status"] }
48
-
49
- resolved: { allowPatterns: ["sudo systemctl status"] } ← 回退至 global
50
- ```
51
-
52
- **`customPoliciesPath`** — 最先定义它的作用域生效。
53
-
54
- **`llm`** — 最先定义它的作用域生效。
55
-
56
- ---
57
-
58
- ## 配置文件格式
59
-
60
- ```json
61
- {
62
- "enabledPolicies": [
63
- "block-sudo",
64
- "block-rm-rf",
65
- "block-push-master",
66
- "sanitize-api-keys",
67
- "sanitize-jwt",
68
- "block-env-files",
69
- "block-read-outside-cwd"
70
- ],
71
- "policyParams": {
72
- "block-sudo": {
73
- "allowPatterns": ["sudo systemctl status", "sudo journalctl"]
74
- },
75
- "block-push-master": {
76
- "protectedBranches": ["main", "release", "prod"]
77
- },
78
- "block-rm-rf": {
79
- "allowPaths": ["/tmp"]
80
- },
81
- "block-read-outside-cwd": {
82
- "allowPaths": ["/shared/data", "/opt/company"]
83
- },
84
- "sanitize-api-keys": {
85
- "additionalPatterns": [
86
- { "regex": "myco_[A-Za-z0-9]{32}", "label": "MyCo API key" }
87
- ]
88
- },
89
- "warn-large-file-write": {
90
- "thresholdKb": 512
91
- }
92
- },
93
- "customPoliciesPath": "/home/alice/myproject/my-policies.js"
94
- }
95
- ```
96
-
97
- ---
98
-
99
- ## 字段说明
100
-
101
- ### `enabledPolicies`
102
-
103
- 类型:`string[]`
104
-
105
- 需要启用的策略名称列表。名称必须与 `failproofai policies` 命令显示的策略标识符完全匹配。完整列表请参阅[内置策略](/zh/built-in-policies)。
106
-
107
- 未包含在 `enabledPolicies` 中的策略处于非激活状态,即使在 `policyParams` 中存在相应条目也不例外。
108
-
109
- ### `policyParams`
110
-
111
- 类型:`Record<string, Record<string, unknown>>`
112
-
113
- 各策略的参数覆盖配置。外层键为策略名称,内层键为策略专属参数。每个策略的可用参数详见[内置策略](/zh/built-in-policies)。
114
-
115
- 若某策略有参数但未指定,则使用该策略的内置默认值。未配置 `policyParams` 的用户与旧版本行为完全一致。
116
-
117
- 策略参数块中的未知键在 hook 触发时会被静默忽略,但在执行 `failproofai policies` 时会作为警告提示。
118
-
119
- #### `hint`(通用参数)
120
-
121
- 类型:`string`(可选)
122
-
123
- 当策略返回 `deny` 或 `instruct` 时,附加到原因说明末尾的消息。可用于为 Claude 提供可操作的指引,而无需修改策略本身。
124
-
125
- 适用于所有策略类型——内置策略、自定义策略(`custom/`)、项目约定策略(`.failproofai-project/`)以及用户约定策略(`.failproofai-user/`)。
126
-
127
- ```json
128
- {
129
- "policyParams": {
130
- "block-force-push": {
131
- "hint": "Try creating a fresh branch instead."
132
- },
133
- "block-sudo": {
134
- "allowPatterns": ["sudo apt-get"],
135
- "hint": "Use apt-get directly without sudo."
136
- },
137
- "custom/my-policy": {
138
- "hint": "Ask the user for approval first."
139
- }
140
- }
141
- }
142
- ```
143
-
144
- 当 `block-force-push` 拒绝操作时,Claude 会看到:*"Force-pushing is blocked. Try creating a fresh branch instead."*
145
-
146
- 非字符串值和空字符串会被静默忽略。若未设置 `hint`,行为保持不变(向后兼容)。
147
-
148
- ### `customPoliciesPath`
149
-
150
- 类型:`string`(绝对路径)
151
-
152
- 包含自定义 hook 策略的 JavaScript 文件路径。该字段通常由 `failproofai policies --install --custom <path>` 自动设置(路径在存储前会被解析为绝对路径)。
153
-
154
- 每次 hook 事件触发时,该文件都会被重新加载,不存在缓存机制。自定义策略的编写详情请参阅[自定义策略](/zh/custom-policies)。
155
-
156
- ### 基于约定的策略
157
-
158
- 除了显式的 `customPoliciesPath` 之外,failproofai 还会自动发现并加载 `.failproofai/policies/` 目录中的策略文件:
159
-
160
- | 层级 | 目录 | 作用域 |
161
- |-------|-----------|-------|
162
- | 项目 | `.failproofai/policies/` | 通过版本控制与团队共享 |
163
- | 用户 | `~/.failproofai/policies/` | 个人级别,适用于所有项目 |
164
-
165
- **文件匹配规则:** 仅加载匹配 `*policies.{js,mjs,ts}` 的文件(例如 `security-policies.mjs`、`workflow-policies.js`),目录中的其他文件会被忽略。
166
-
167
- **无需额外配置:** 约定策略无需在 `policies-config.json` 中添加任何条目,只需将文件放入对应目录,下次 hook 事件触发时即可自动加载。
168
-
169
- **联合加载:** 项目级和用户级约定目录都会被扫描,两个层级中所有匹配的文件均会被加载(与 `customPoliciesPath` 的首个作用域优先规则不同)。
170
-
171
- 更多详情和示例请参阅[自定义策略](/zh/custom-policies)。
172
-
173
- ### `llm`
174
-
175
- 类型:`object`(可选)
176
-
177
- 针对需要进行 AI 调用的策略的 LLM 客户端配置。大多数场景下无需配置。
178
-
179
- ```json
180
- {
181
- "llm": {
182
- "model": "claude-sonnet-4-6",
183
- "apiKey": "sk-ant-..."
184
- }
185
- }
186
- ```
187
-
188
- ---
189
-
190
- ## 通过 CLI 管理配置
191
-
192
- `policies --install` 和 `policies --uninstall` 命令写入的是 Claude Code 的 `settings.json`(即 hook 入口点),而 `policies-config.json` 则是由您直接管理的文件。两者相互独立:
193
-
194
- - **`settings.json`** — 指示 Claude Code 在每次工具调用时执行 `failproofai --hook <event>`
195
- - **`policies-config.json`** — 指示 failproofai 评估哪些策略以及使用哪些参数
196
-
197
- 您可以随时直接编辑 `policies-config.json`,更改将在下一次 hook 事件时立即生效,无需重启。
198
-
199
- ---
200
-
201
- ## 示例:包含团队默认设置的项目级配置
202
-
203
- 将 `.failproofai/policies-config.json` 提交到代码仓库:
204
-
205
- ```json
206
- {
207
- "enabledPolicies": [
208
- "block-sudo",
209
- "block-rm-rf",
210
- "block-push-master",
211
- "sanitize-api-keys",
212
- "block-env-files"
213
- ],
214
- "policyParams": {
215
- "block-push-master": {
216
- "protectedBranches": ["main", "release", "hotfix"]
217
- }
218
- }
219
- }
220
- ```
221
-
222
- 每位开发者可以创建 `.failproofai/policies-config.local.json`(已加入 gitignore)来进行个人级别的覆盖,而不会影响其他团队成员。
@@ -1,353 +0,0 @@
1
- ---
2
- title: 自定义策略
3
- description: "用 JavaScript 编写自定义策略——强制执行项目规范、防止偏离、检测失败、与外部系统集成"
4
- icon: code
5
- ---
6
-
7
- 自定义策略允许你为任何 Agent 行为编写规则:强制执行项目规范、防止偏离、限制危险操作、检测卡住的 Agent,或与 Slack、审批工作流等进行集成。它们使用与内置策略相同的 Hook 事件系统和 `allow`、`deny`、`instruct` 决策机制。
8
-
9
- ---
10
-
11
- ## 快速示例
12
-
13
- ```js
14
- // my-policies.js
15
- import { customPolicies, allow, deny, instruct } from "failproofai";
16
-
17
- customPolicies.add({
18
- name: "no-production-writes",
19
- description: "Block writes to paths containing 'production'",
20
- match: { events: ["PreToolUse"] },
21
- fn: async (ctx) => {
22
- if (ctx.toolName !== "Write" && ctx.toolName !== "Edit") return allow();
23
- const path = ctx.toolInput?.file_path ?? "";
24
- if (path.includes("production")) {
25
- return deny("Writes to production paths are blocked");
26
- }
27
- return allow();
28
- },
29
- });
30
- ```
31
-
32
- 安装:
33
-
34
- ```bash
35
- failproofai policies --install --custom ./my-policies.js
36
- ```
37
-
38
- ---
39
-
40
- ## 两种加载自定义策略的方式
41
-
42
- ### 方式一:基于约定(推荐)
43
-
44
- 将 `*policies.{js,mjs,ts}` 文件放入 `.failproofai/policies/` 目录,它们会被自动加载——无需任何参数或配置变更。这与 git hooks 的工作方式类似:放入文件即可生效。
45
-
46
- ```
47
- # 项目级别——提交到 git,与团队共享
48
- .failproofai/policies/security-policies.mjs
49
- .failproofai/policies/workflow-policies.mjs
50
-
51
- # 用户级别——个人配置,适用于所有项目
52
- ~/.failproofai/policies/my-policies.mjs
53
- ```
54
-
55
- **工作原理:**
56
- - 项目目录和用户目录都会被扫描(取并集,而非以第一个作用域为准)
57
- - 每个目录内的文件按字母顺序加载。可以用 `01-`、`02-` 前缀来控制加载顺序
58
- - 只加载匹配 `*policies.{js,mjs,ts}` 的文件,其他文件会被忽略
59
- - 每个文件独立加载(单文件失败不影响其他文件)
60
- - 可与显式 `--custom` 和内置策略共存
61
-
62
- <Tip>
63
- 基于约定的策略是为组织建立质量标准的最简单方式。将 `.failproofai/policies/` 提交到 git,每位团队成员就能自动获得相同的规则——无需任何个人配置。随着团队发现新的失败模式,只需添加策略并推送。随着时间推移,这些策略会成为随每次贡献不断完善的活质量标准。
64
- </Tip>
65
-
66
- ### 方式二:显式文件路径
67
-
68
- ```bash
69
- # 使用自定义策略文件安装
70
- failproofai policies --install --custom ./my-policies.js
71
-
72
- # 替换策略文件路径
73
- failproofai policies --install --custom ./new-policies.js
74
-
75
- # 从配置中移除自定义策略路径
76
- failproofai policies --uninstall --custom
77
- ```
78
-
79
- 解析后的绝对路径会以 `customPoliciesPath` 的形式存储在 `policies-config.json` 中。每次 Hook 事件触发时都会重新加载该文件,事件之间不存在缓存。
80
-
81
- ### 两种方式同时使用
82
-
83
- 基于约定的策略和显式 `--custom` 文件可以共存。加载顺序如下:
84
-
85
- 1. 显式 `customPoliciesPath` 文件(如已配置)
86
- 2. 项目约定文件(`{cwd}/.failproofai/policies/`,按字母顺序)
87
- 3. 用户约定文件(`~/.failproofai/policies/`,按字母顺序)
88
-
89
- ---
90
-
91
- ## API
92
-
93
- ### 导入
94
-
95
- ```js
96
- import { customPolicies, allow, deny, instruct } from "failproofai";
97
- ```
98
-
99
- ### `customPolicies.add(hook)`
100
-
101
- 注册一个策略。可以在同一文件中多次调用以注册多个策略。
102
-
103
- ```ts
104
- customPolicies.add({
105
- name: string; // 必填 - 唯一标识符
106
- description?: string; // 在 `failproofai policies` 输出中显示
107
- match?: { events?: HookEventType[] }; // 按事件类型过滤;省略则匹配所有事件
108
- fn: (ctx: PolicyContext) => PolicyResult | Promise<PolicyResult>;
109
- });
110
- ```
111
-
112
- ### 决策辅助函数
113
-
114
- | 函数 | 效果 | 适用场景 |
115
- |----------|--------|----------|
116
- | `allow()` | 静默允许操作 | 操作安全,无需任何消息 |
117
- | `deny(message)` | 阻止操作 | Agent 不应执行此操作 |
118
- | `instruct(message)` | 添加上下文但不阻止 | 为 Agent 提供额外上下文以保持在正确轨道上 |
119
-
120
- `deny(message)` - 消息会以 `"Blocked by failproofai:"` 为前缀显示给 Claude。单个 `deny` 会短路所有后续评估。
121
-
122
- `instruct(message)` - 消息会追加到 Claude 当前工具调用的上下文中。所有 `instruct` 消息会被累积并一起送达。
123
-
124
- <Tip>
125
- 你可以通过在 `policyParams` 中添加 `hint` 字段,为任何 `deny` 或 `instruct` 消息追加额外指导——无需修改代码。这同样适用于自定义(`custom/`)、项目约定(`.failproofai-project/`)和用户约定(`.failproofai-user/`)策略。详情请参阅[配置 → hint](/zh/configuration#hint-cross-cutting)。
126
- </Tip>
127
-
128
- ### 信息性 allow 消息
129
-
130
- `allow(message)` 允许操作**并**向 Claude 发送一条信息性消息。该消息通过 Hook 处理器的 stdout 响应中的 `additionalContext` 机制送达——与 `instruct` 使用相同的机制,但语义不同:它是状态更新,而非警告。
131
-
132
- | 函数 | 效果 | 适用场景 |
133
- |----------|--------|----------|
134
- | `allow(message)` | 允许操作并向 Claude 发送上下文 | 确认检查通过,或说明为何跳过某项检查 |
135
-
136
- 使用场景:
137
- - **状态确认:** `allow("All CI checks passed.")` — 告知 Claude 一切正常
138
- - **失败开放说明:** `allow("GitHub CLI not installed, skipping CI check.")` — 告知 Claude 某项检查被跳过的原因,使其拥有完整上下文
139
- - **消息累积:** 如果多个策略各自返回 `allow(message)`,所有消息会以换行符拼接后一起送达
140
-
141
- ```js
142
- customPolicies.add({
143
- name: "confirm-branch-status",
144
- match: { events: ["Stop"] },
145
- fn: async (ctx) => {
146
- const cwd = ctx.session?.cwd;
147
- if (!cwd) return allow("No working directory, skipping branch check.");
148
-
149
- // ... check branch status ...
150
- if (allPushed) {
151
- return allow("Branch is up to date with remote.");
152
- }
153
- return deny("Unpushed changes detected.");
154
- },
155
- });
156
- ```
157
-
158
- ### `PolicyContext` 字段
159
-
160
- | 字段 | 类型 | 描述 |
161
- |-------|------|-------------|
162
- | `eventType` | `string` | `"PreToolUse"`、`"PostToolUse"`、`"Notification"`、`"Stop"` |
163
- | `toolName` | `string \| undefined` | 被调用的工具(如 `"Bash"`、`"Write"`、`"Read"`) |
164
- | `toolInput` | `Record<string, unknown> \| undefined` | 工具的输入参数 |
165
- | `payload` | `Record<string, unknown>` | 来自 Claude Code 的完整原始事件载荷 |
166
- | `session` | `SessionMetadata \| undefined` | 会话上下文(见下文) |
167
-
168
- ### `SessionMetadata` 字段
169
-
170
- | 字段 | 类型 | 描述 |
171
- |-------|------|-------------|
172
- | `sessionId` | `string` | Claude Code 会话标识符 |
173
- | `cwd` | `string` | Claude Code 会话的工作目录 |
174
- | `transcriptPath` | `string` | 会话 JSONL 记录文件的路径 |
175
-
176
- ### 事件类型
177
-
178
- | 事件 | 触发时机 | `toolInput` 内容 |
179
- |-------|--------------|----------------------|
180
- | `PreToolUse` | Claude 运行工具之前 | 工具的输入(如 Bash 的 `{ command: "..." }`) |
181
- | `PostToolUse` | 工具完成之后 | 工具的输入 + `tool_result`(输出结果) |
182
- | `Notification` | Claude 发送通知时 | `{ message: "...", notification_type: "idle" \| "permission_prompt" \| ... }` - Hook 必须始终返回 `allow()`,不能阻止通知 |
183
- | `Stop` | Claude 会话结束时 | 空 |
184
-
185
- ---
186
-
187
- ## 评估顺序
188
-
189
- 策略按以下顺序评估:
190
-
191
- 1. 内置策略(按定义顺序)
192
- 2. 来自 `customPoliciesPath` 的显式自定义策略(按 `.add()` 顺序)
193
- 3. 项目 `.failproofai/policies/` 中的约定策略(文件按字母顺序,文件内按 `.add()` 顺序)
194
- 4. 用户 `~/.failproofai/policies/` 中的约定策略(文件按字母顺序,文件内按 `.add()` 顺序)
195
-
196
- <Note>
197
- 第一个 `deny` 会短路所有后续策略。所有 `instruct` 消息会被累积并一起送达。
198
- </Note>
199
-
200
- ---
201
-
202
- ## 传递性导入
203
-
204
- 自定义策略文件可以使用相对路径导入本地模块:
205
-
206
- ```js
207
- // my-policies.js
208
- import { isBlockedPath } from "./utils.js";
209
- import { checkApproval } from "./approval-client.js";
210
-
211
- customPolicies.add({
212
- name: "approval-gate",
213
- fn: async (ctx) => {
214
- if (ctx.toolName !== "Bash") return allow();
215
- const approved = await checkApproval(ctx.toolInput?.command, ctx.session?.sessionId);
216
- return approved ? allow() : deny("Approval required for this command");
217
- },
218
- });
219
- ```
220
-
221
- 所有从入口文件可达的相对导入都会被解析。实现方式是将 `from "failproofai"` 的导入重写为实际的 dist 路径,并创建临时 `.mjs` 文件以确保 ESM 兼容性。
222
-
223
- ---
224
-
225
- ## 事件类型过滤
226
-
227
- 使用 `match.events` 限制策略的触发时机:
228
-
229
- ```js
230
- customPolicies.add({
231
- name: "require-summary-on-stop",
232
- match: { events: ["Stop"] },
233
- fn: async (ctx) => {
234
- // 仅在会话结束时触发
235
- // ctx.session.transcriptPath 包含完整的会话日志
236
- return allow();
237
- },
238
- });
239
- ```
240
-
241
- 完全省略 `match` 则会在每种事件类型上触发。
242
-
243
- ---
244
-
245
- ## 错误处理与失败模式
246
-
247
- 自定义策略采用**失败开放**机制:错误不会阻止内置策略运行,也不会导致 Hook 处理器崩溃。
248
-
249
- | 失败情况 | 行为 |
250
- |---------|----------|
251
- | `customPoliciesPath` 未设置 | 不运行显式自定义策略;约定策略和内置策略正常继续 |
252
- | 文件未找到 | 警告记录到 `~/.failproofai/hook.log`;内置策略继续运行 |
253
- | 语法/导入错误(显式) | 错误记录到 `~/.failproofai/hook.log`;跳过显式自定义策略 |
254
- | 语法/导入错误(约定) | 错误记录;跳过该文件,其他约定文件仍然加载 |
255
- | `fn` 运行时抛出异常 | 错误记录;该 Hook 视为 `allow`;其他 Hook 继续运行 |
256
- | `fn` 执行超过 10 秒 | 超时记录;视为 `allow` |
257
- | 约定目录不存在 | 不运行约定策略;不报错 |
258
-
259
- <Tip>
260
- 要调试自定义策略错误,可以监视日志文件:
261
-
262
- ```bash
263
- tail -f ~/.failproofai/hook.log
264
- ```
265
- </Tip>
266
-
267
- ---
268
-
269
- ## 完整示例:多个策略
270
-
271
- ```js
272
- // my-policies.js
273
- import { customPolicies, allow, deny, instruct } from "failproofai";
274
-
275
- // 防止 Agent 写入 secrets/ 目录
276
- customPolicies.add({
277
- name: "block-secrets-dir",
278
- description: "Prevent agent from writing to secrets/ directory",
279
- match: { events: ["PreToolUse"] },
280
- fn: async (ctx) => {
281
- if (!["Write", "Edit"].includes(ctx.toolName ?? "")) return allow();
282
- const path = ctx.toolInput?.file_path ?? "";
283
- if (path.includes("secrets/")) return deny("Writing to secrets/ is not permitted");
284
- return allow();
285
- },
286
- });
287
-
288
- // 引导 Agent 保持正轨:提交前先验证测试
289
- customPolicies.add({
290
- name: "remind-test-before-commit",
291
- description: "Keep the agent on track: verify tests pass before committing",
292
- match: { events: ["PreToolUse"] },
293
- fn: async (ctx) => {
294
- if (ctx.toolName !== "Bash") return allow();
295
- const cmd = ctx.toolInput?.command ?? "";
296
- if (/git\s+commit/.test(cmd)) {
297
- return instruct("Verify all tests pass before committing. Run `bun test` if you haven't already.");
298
- }
299
- return allow();
300
- },
301
- });
302
-
303
- // 在冻结期间防止计划外的依赖变更
304
- customPolicies.add({
305
- name: "dependency-freeze",
306
- description: "Prevent unplanned dependency changes during freeze period",
307
- match: { events: ["PreToolUse"] },
308
- fn: async (ctx) => {
309
- if (ctx.toolName !== "Bash") return allow();
310
- const cmd = ctx.toolInput?.command ?? "";
311
- const isInstall = /^(npm install|yarn add|bun add|pnpm add)\s+\S/.test(cmd);
312
- if (isInstall && process.env.DEPENDENCY_FREEZE === "1") {
313
- return deny("Package installs are frozen. Unset DEPENDENCY_FREEZE to allow.");
314
- }
315
- return allow();
316
- },
317
- });
318
-
319
- export { customPolicies };
320
- ```
321
-
322
- ---
323
-
324
- ## 示例文件
325
-
326
- `examples/` 目录包含可直接运行的策略文件:
327
-
328
- | 文件 | 内容 |
329
- |------|----------|
330
- | `examples/policies-basic.js` | 五个涵盖常见 Agent 失败模式的入门策略 |
331
- | `examples/policies-advanced/index.js` | 高级模式:传递性导入、异步调用、输出清理和会话结束 Hook |
332
- | `examples/convention-policies/security-policies.mjs` | 基于约定的安全策略(阻止 .env 写入、防止 git 历史重写) |
333
- | `examples/convention-policies/workflow-policies.mjs` | 基于约定的工作流策略(测试提醒、审计文件写入) |
334
-
335
- ### 使用显式文件示例
336
-
337
- ```bash
338
- failproofai policies --install --custom ./examples/policies-basic.js
339
- ```
340
-
341
- ### 使用基于约定的示例
342
-
343
- ```bash
344
- # 复制到项目级别
345
- mkdir -p .failproofai/policies
346
- cp examples/convention-policies/*.mjs .failproofai/policies/
347
-
348
- # 或复制到用户级别
349
- mkdir -p ~/.failproofai/policies
350
- cp examples/convention-policies/*.mjs ~/.failproofai/policies/
351
- ```
352
-
353
- 无需安装命令——文件会在下次 Hook 事件触发时自动被加载。