failproofai 0.0.11 → 0.0.12-beta.0

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 (124) hide show
  1. package/.next/standalone/.codex/hooks.json +6 -7
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +5 -5
  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/build-manifest.json +2 -2
  7. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  12. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  13. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  14. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  15. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  16. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
  18. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
  23. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  24. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  25. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  26. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  27. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  28. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  29. package/.next/standalone/.next/server/app/audit/page/build-manifest.json +2 -2
  30. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  31. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/index.html +1 -1
  34. package/.next/standalone/.next/server/app/index.rsc +14 -14
  35. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  36. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  37. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  38. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
  39. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  40. package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
  41. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  42. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
  45. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  46. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
  49. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  50. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
  53. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  54. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  55. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
  58. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  59. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dwpg-h._.js +1 -1
  62. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lnenda._.js +1 -1
  63. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13i_sva._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1_mqemn._.js +1 -1
  65. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +1 -1
  66. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +1 -1
  67. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
  68. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0808sha._.js +2 -2
  69. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e4-6d8._.js +2 -2
  70. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ehe24g._.js +2 -2
  71. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g253ve._.js +2 -2
  72. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vxf0_g._.js +2 -2
  73. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kjb_s4._.js → [root-of-the-server]__12e2gos._.js} +2 -2
  74. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12mcauo._.js +2 -2
  75. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00uwqi6._.js → [root-of-the-server]__1ex6lhp._.js} +2 -2
  76. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mt35_w._.js +7 -7
  77. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pcxxwg._.js +2 -2
  78. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1uvfwgr._.js +2 -2
  79. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
  80. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
  81. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
  82. package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0ihmbv4.js → node_modules_html-to-image_es_index_0jg3fuk.js} +1 -1
  83. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +1 -1
  84. package/.next/standalone/.next/server/middleware-build-manifest.js +5 -5
  85. package/.next/standalone/.next/server/pages/404.html +1 -1
  86. package/.next/standalone/.next/server/pages/500.html +1 -1
  87. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/server-reference-manifest.json +10 -10
  89. package/.next/standalone/.next/static/chunks/{3v61675vr6jav.js → 04y44gpe0698_.js} +1 -1
  90. package/.next/standalone/.next/static/chunks/{15csyj1_rf0-w.js → 0_75be6zseuxl.js} +1 -1
  91. package/.next/standalone/.next/static/chunks/{2n_s8v1ae38_a.js → 0jtj8f7njt8w3.js} +1 -1
  92. package/.next/standalone/.next/static/chunks/{0xdx2ehtbdoeg.js → 0mdiwb8ozs8j5.js} +1 -1
  93. package/.next/standalone/.next/static/chunks/1ua5armwfph8o.js +31 -0
  94. package/.next/standalone/.next/static/chunks/{2y-jmvrjxz60x.js → 1xjrv35s71etn.js} +1 -1
  95. package/.next/standalone/.next/static/chunks/{02fywjt0by40a.js → 21cumi0uqy4mk.js} +1 -1
  96. package/.next/standalone/.next/static/chunks/{1-a5rvq67k7ed.js → 2611bbf4e_1cs.js} +1 -1
  97. package/.next/standalone/.next/static/chunks/2hc_0--4nm0at.js +1 -0
  98. package/.next/standalone/.next/static/chunks/{3eik_d9qrvoft.js → 2l78594jx17e1.js} +1 -1
  99. package/.next/standalone/.next/static/chunks/{turbopack-3lrm4f20fz89b.js → turbopack-0vavqo2d-tlt3.js} +1 -1
  100. package/.next/standalone/node_modules/@next/env/package.json +7 -8
  101. package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
  102. package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  103. package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  104. package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
  105. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
  106. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  107. package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  108. package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
  109. package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  110. package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  111. package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  112. package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
  113. package/.next/standalone/node_modules/next/package.json +10 -252
  114. package/.next/standalone/package.json +3 -3
  115. package/.next/standalone/server.js +1 -1
  116. package/dist/cli.mjs +20 -11
  117. package/package.json +3 -3
  118. package/src/hooks/integrations.ts +22 -9
  119. package/src/hooks/types.ts +2 -2
  120. package/.next/standalone/.next/static/chunks/24cv31x607n7k.js +0 -1
  121. package/.next/standalone/.next/static/chunks/2h0dkzyy0vocp.js +0 -31
  122. /package/.next/standalone/.next/static/{P_MIRSeoE296wkbE-Icin → DUw2FaxT-IF_URNqcba-m}/_buildManifest.js +0 -0
  123. /package/.next/standalone/.next/static/{P_MIRSeoE296wkbE-Icin → DUw2FaxT-IF_URNqcba-m}/_clientMiddlewareManifest.js +0 -0
  124. /package/.next/standalone/.next/static/{P_MIRSeoE296wkbE-Icin → DUw2FaxT-IF_URNqcba-m}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},11369,a=>{"use strict";var b=a.i(36359),c=a.i(7292),d=a.i(37936),e=a.i(2157),f=a.i(50227),g=a.i(60526),h=a.i(10695);function i(a){let b=(0,g.homedir)(),c=(0,f.resolve)(a);for(;c!==b;){let a=(0,f.resolve)(c,".failproofai");try{if((0,e.statSync)(a).isDirectory())return c}catch{}let b=(0,f.dirname)(c);if(b===c)break;c=b}return(0,f.resolve)(a)}function j(){return(0,f.resolve)((0,g.homedir)(),".failproofai","policies-config.json")}function k(){let a=j();if(!(0,e.existsSync)(a))return{enabledPolicies:[]};try{let b=(0,e.readFileSync)(a,"utf8");return JSON.parse(b)}catch(b){return(0,h.hookLogWarn)(`failed to parse config at ${a}: ${b instanceof Error?b.message:String(b)}`),{enabledPolicies:[]}}}function l(a){let b=j(),c=(0,f.dirname)(b);(0,e.existsSync)(c)||(0,e.mkdirSync)(c,{recursive:!0}),(0,e.writeFileSync)(b,JSON.stringify(a,null,2)+"\n","utf8")}function m(a,b){switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".failproofai","policies-config.json");case"project":return(0,f.resolve)(i(b??process.cwd()),".failproofai","policies-config.json");case"local":return(0,f.resolve)(i(b??process.cwd()),".failproofai","policies-config.local.json")}}function n(a,b){let c=m(a,b);if(!(0,e.existsSync)(c))return{enabledPolicies:[]};try{let a=(0,e.readFileSync)(c,"utf8");return JSON.parse(a)}catch(a){return(0,h.hookLogWarn)(`failed to parse config at ${c}: ${a instanceof Error?a.message:String(a)}`),{enabledPolicies:[]}}}function o(a,b,c){let d=m(b,c),g=(0,f.dirname)(d);(0,e.existsSync)(g)||(0,e.mkdirSync)(g,{recursive:!0}),(0,e.writeFileSync)(d,JSON.stringify(a,null,2)+"\n","utf8")}var p=a.i(74533);let q=["user","project","local"],r=["claude","codex","copilot","cursor","opencode","pi","gemini"],s=["session_start","pre_tool_use","permission_request","post_tool_use","user_prompt_submit","stop"],t={session_start:"SessionStart",pre_tool_use:"PreToolUse",permission_request:"PermissionRequest",post_tool_use:"PostToolUse",user_prompt_submit:"UserPromptSubmit",stop:"Stop"},u=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PostToolUse","Stop","SubagentStop"],v=["sessionStart","sessionEnd","beforeSubmitPrompt","preToolUse","postToolUse","stop","subagentStop"],w=["SessionStart","SessionEnd","BeforeAgent","AfterAgent","BeforeModel","AfterModel","BeforeToolSelection","BeforeTool","AfterTool","PreCompress","Notification"],x=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PermissionRequest","PermissionDenied","PostToolUse","PostToolUseFailure","Notification","SubagentStart","SubagentStop","TaskCreated","TaskCompleted","Stop","StopFailure","TeammateIdle","InstructionsLoaded","ConfigChange","CwdChanged","FileChanged","WorktreeCreate","WorktreeRemove","PreCompact","PostCompact","Elicitation","ElicitationResult","UserPromptExpansion","PostToolBatch"],y="__failproofai_hook__";var z=a.i(57764);let A={get url(){return`file://${a.P("src/hooks/integrations.ts")}`}};function B(a){return(0,e.existsSync)(a)?JSON.parse((0,e.readFileSync)(a,"utf8")):{}}function C(a,b){(0,e.mkdirSync)((0,f.dirname)(a),{recursive:!0}),(0,e.writeFileSync)(a,JSON.stringify(b,null,2)+"\n","utf8")}function D(a){if(!a||"object"!=typeof a)return!1;if(!0===a[y])return!0;let b="string"==typeof a.command?a.command:"";return b.includes("failproofai")&&b.includes("--hook")}function E(a){try{let b=`which ${a}`;return(0,p.execSync)(b,{encoding:"utf8",stdio:"pipe"}),!0}catch{return!1}}let F={id:"claude",displayName:"Claude Code",scopes:q,eventTypes:x,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".claude","settings.json");case"project":return(0,f.resolve)(c,".claude","settings.json");case"local":return(0,f.resolve)(c,".claude","settings.local.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b}`:`"${a}" --hook ${b}`,timeout:6e4,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(a.hooks||(a.hooks={}),x)){let e=this.buildHookEntry(b,d,c);a.hooks[d]||(a.hooks[d]=[]);let f=a.hooks[d],g=!1;for(let a of f){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>D(a));if(b>=0){a.hooks[b]=e,g=!0;break}}g||f.push({hooks:[e]})}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(Array.isArray(d)){for(let a=d.length-1;a>=0;a--){let b=d[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!D(a)),c+=e-b.hooks.length,0===b.hooks.length&&d.splice(a,1)}0===d.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>D(a)))return!0}}catch{}return!1},detectInstalled:()=>E("claude")||E("claude-code")};function G(a){if(!0===a[y])return!0;for(let b of["string"==typeof a.bash?a.bash:"","string"==typeof a.powershell?a.powershell:""])if(b.includes("failproofai")&&b.includes("--hook"))return!0;return!1}let H="./plugins/failproofai.mjs";function I(a){return(0,f.resolve)((0,f.dirname)(a),"plugins","failproofai.mjs")}function J(){let a=process.env.FAILPROOFAI_PACKAGE_ROOT;return a?(0,f.resolve)(a,"pi-extension"):(0,f.resolve)((0,z.fileURLToPath)(A.url),"..","..","..","pi-extension")}function K(a){return"string"==typeof a&&(!!/(?:^|\/)pi-extension\/?$/.test(a)||a.includes("pi-extension")&&a.includes("failproofai"))}let L={claude:F,codex:{id:"codex",displayName:"OpenAI Codex",scopes:["user","project"],eventTypes:s,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".codex","hooks.json");case"project":case"local":return(0,f.resolve)(c,".codex","hooks.json")}},readSettings(a){let b=B(a);return void 0===b.version&&(b.version=1),b},writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b} --cli codex`:`"${a}" --hook ${b} --cli codex`,timeout:6e4,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(void 0===a.version&&(a.version=1),a.hooks||(a.hooks={}),s)){let e=t[d],f=this.buildHookEntry(b,d,c);a.hooks[e]||(a.hooks[e]=[]);let g=a.hooks[e],h=!1;for(let a of g){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>D(a));if(b>=0){a.hooks[b]=f,h=!0;break}}h||g.push({hooks:[f]})}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(Array.isArray(d)){for(let a=d.length-1;a>=0;a--){let b=d[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!D(a)),c+=e-b.hooks.length,0===b.hooks.length&&d.splice(a,1)}0===d.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>D(a)))return!0}}catch{}return!1},detectInstalled:()=>E("codex")},copilot:{id:"copilot",displayName:"GitHub Copilot",scopes:["user","project"],eventTypes:u,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".copilot","hooks","failproofai.json");case"project":case"local":return(0,f.resolve)(c,".github","hooks","failproofai.json")}},readSettings(a){let b=B(a);return void 0===b.version&&(b.version=1),b},writeSettings(a,b){C(a,b)},buildHookEntry(a,b,c){let d="project"===c?`npx -y failproofai --hook ${b} --cli copilot`:`"${a}" --hook ${b} --cli copilot`;return{type:"command",bash:d,powershell:d,timeoutSec:60,[y]:!0}},isFailproofaiHook:G,writeHookEntries(a,b,c){for(let d of(void 0===a.version&&(a.version=1),a.hooks||(a.hooks={}),u)){let e=this.buildHookEntry(b,d,c);a.hooks[d]||(a.hooks[d]=[]);let f=a.hooks[d],g=!1;for(let a of f){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>G(a));if(b>=0){a.hooks[b]=e,g=!0;break}}g||f.push({hooks:[e]})}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(Array.isArray(d)){for(let a=d.length-1;a>=0;a--){let b=d[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!G(a)),c+=e-b.hooks.length,0===b.hooks.length&&d.splice(a,1)}0===d.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>G(a)))return!0}}catch{}return!1},detectInstalled:()=>E("copilot")},cursor:{id:"cursor",displayName:"Cursor Agent",scopes:["user","project"],eventTypes:v,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".cursor","hooks.json");case"project":case"local":return(0,f.resolve)(c,".cursor","hooks.json")}},readSettings(a){let b=B(a);return void 0===b.version&&(b.version=1),b},writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b} --cli cursor`:`"${a}" --hook ${b} --cli cursor`,timeout:6e4,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(void 0===a.version&&(a.version=1),a.hooks||(a.hooks={}),v)){let e=this.buildHookEntry(b,d,c),f=a.hooks[d],g=f??[];f||(a.hooks[d]=g);let h=g.findIndex(a=>D(a));h>=0?g[h]=e:g.push(e)}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(!Array.isArray(d))continue;let e=d.length,f=d.filter(a=>!D(a));c+=e-f.length,0===f.length?delete b.hooks[a]:b.hooks[a]=f}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)&&b.some(a=>D(a)))return!0}catch{}return!1},detectInstalled:()=>E("cursor-agent")||E("agent")},opencode:{id:"opencode",displayName:"OpenCode",scopes:["user","project"],eventTypes:["tool.execute.before","tool.execute.after","session.created","session.deleted","session.idle","message.updated","permission.ask"],getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".config","opencode","opencode.json");case"project":case"local":return(0,f.resolve)(c,".opencode","opencode.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry(a,b,c){if("user"===c){let a=(0,f.resolve)((0,g.homedir)(),".config","opencode","plugins","failproofai.mjs");return{spec:`file://${a}`,[y]:!0}}return{spec:H,[y]:!0}},isFailproofaiHook:a=>"string"==typeof a?a.includes("failproofai.mjs"):!!Array.isArray(a)&&"string"==typeof a[0]&&a[0].includes("failproofai.mjs"),writeHookEntries(a,b,c){let d,h,i=c??"project",j=I("user"===i?(0,f.resolve)((0,g.homedir)(),".config","opencode","opencode.json"):(0,f.resolve)(process.cwd(),".opencode","opencode.json"));(0,e.mkdirSync)((0,f.dirname)(j),{recursive:!0}),(0,e.writeFileSync)(j,(h=(d="project"===i)?'""':JSON.stringify(b),`// AUTO-GENERATED by failproofai. ${y}
1
+ module.exports=[57764,(a,b,c)=>{b.exports=a.x("node:url",()=>require("node:url"))},92509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},11369,a=>{"use strict";var b=a.i(36359),c=a.i(7292),d=a.i(37936),e=a.i(2157),f=a.i(50227),g=a.i(60526),h=a.i(10695);function i(a){let b=(0,g.homedir)(),c=(0,f.resolve)(a);for(;c!==b;){let a=(0,f.resolve)(c,".failproofai");try{if((0,e.statSync)(a).isDirectory())return c}catch{}let b=(0,f.dirname)(c);if(b===c)break;c=b}return(0,f.resolve)(a)}function j(){return(0,f.resolve)((0,g.homedir)(),".failproofai","policies-config.json")}function k(){let a=j();if(!(0,e.existsSync)(a))return{enabledPolicies:[]};try{let b=(0,e.readFileSync)(a,"utf8");return JSON.parse(b)}catch(b){return(0,h.hookLogWarn)(`failed to parse config at ${a}: ${b instanceof Error?b.message:String(b)}`),{enabledPolicies:[]}}}function l(a){let b=j(),c=(0,f.dirname)(b);(0,e.existsSync)(c)||(0,e.mkdirSync)(c,{recursive:!0}),(0,e.writeFileSync)(b,JSON.stringify(a,null,2)+"\n","utf8")}function m(a,b){switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".failproofai","policies-config.json");case"project":return(0,f.resolve)(i(b??process.cwd()),".failproofai","policies-config.json");case"local":return(0,f.resolve)(i(b??process.cwd()),".failproofai","policies-config.local.json")}}function n(a,b){let c=m(a,b);if(!(0,e.existsSync)(c))return{enabledPolicies:[]};try{let a=(0,e.readFileSync)(c,"utf8");return JSON.parse(a)}catch(a){return(0,h.hookLogWarn)(`failed to parse config at ${c}: ${a instanceof Error?a.message:String(a)}`),{enabledPolicies:[]}}}function o(a,b,c){let d=m(b,c),g=(0,f.dirname)(d);(0,e.existsSync)(g)||(0,e.mkdirSync)(g,{recursive:!0}),(0,e.writeFileSync)(d,JSON.stringify(a,null,2)+"\n","utf8")}var p=a.i(74533);let q=["user","project","local"],r=["claude","codex","copilot","cursor","opencode","pi","gemini"],s=["session_start","pre_tool_use","permission_request","post_tool_use","user_prompt_submit","stop"],t={session_start:"SessionStart",pre_tool_use:"PreToolUse",permission_request:"PermissionRequest",post_tool_use:"PostToolUse",user_prompt_submit:"UserPromptSubmit",stop:"Stop"},u=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PostToolUse","Stop","SubagentStop"],v=["sessionStart","sessionEnd","beforeSubmitPrompt","preToolUse","postToolUse","stop","subagentStop"],w=["SessionStart","SessionEnd","BeforeAgent","AfterAgent","BeforeModel","AfterModel","BeforeToolSelection","BeforeTool","AfterTool","PreCompress","Notification"],x=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PermissionRequest","PermissionDenied","PostToolUse","PostToolUseFailure","Notification","SubagentStart","SubagentStop","TaskCreated","TaskCompleted","Stop","StopFailure","TeammateIdle","InstructionsLoaded","ConfigChange","CwdChanged","FileChanged","WorktreeCreate","WorktreeRemove","PreCompact","PostCompact","Elicitation","ElicitationResult","UserPromptExpansion","PostToolBatch"],y="__failproofai_hook__";var z=a.i(57764);let A={get url(){return`file://${a.P("src/hooks/integrations.ts")}`}};function B(a){return(0,e.existsSync)(a)?JSON.parse((0,e.readFileSync)(a,"utf8")):{}}function C(a,b){(0,e.mkdirSync)((0,f.dirname)(a),{recursive:!0}),(0,e.writeFileSync)(a,JSON.stringify(b,null,2)+"\n","utf8")}function D(a){if(!a||"object"!=typeof a)return!1;if(!0===a[y])return!0;let b="string"==typeof a.command?a.command:"";return b.includes("failproofai")&&b.includes("--hook")}function E(a){return"version"in a&&(delete a.version,!0)}function F(a){try{let b=`which ${a}`;return(0,p.execSync)(b,{encoding:"utf8",stdio:"pipe"}),!0}catch{return!1}}let G={id:"claude",displayName:"Claude Code",scopes:q,eventTypes:x,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".claude","settings.json");case"project":return(0,f.resolve)(c,".claude","settings.json");case"local":return(0,f.resolve)(c,".claude","settings.local.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b}`:`"${a}" --hook ${b}`,timeout:6e4,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(a.hooks||(a.hooks={}),x)){let e=this.buildHookEntry(b,d,c);a.hooks[d]||(a.hooks[d]=[]);let f=a.hooks[d],g=!1;for(let a of f){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>D(a));if(b>=0){a.hooks[b]=e,g=!0;break}}g||f.push({hooks:[e]})}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(Array.isArray(d)){for(let a=d.length-1;a>=0;a--){let b=d[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!D(a)),c+=e-b.hooks.length,0===b.hooks.length&&d.splice(a,1)}0===d.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>D(a)))return!0}}catch{}return!1},detectInstalled:()=>F("claude")||F("claude-code")};function H(a){if(!0===a[y])return!0;for(let b of["string"==typeof a.bash?a.bash:"","string"==typeof a.powershell?a.powershell:""])if(b.includes("failproofai")&&b.includes("--hook"))return!0;return!1}let I="./plugins/failproofai.mjs";function J(a){return(0,f.resolve)((0,f.dirname)(a),"plugins","failproofai.mjs")}function K(){let a=process.env.FAILPROOFAI_PACKAGE_ROOT;return a?(0,f.resolve)(a,"pi-extension"):(0,f.resolve)((0,z.fileURLToPath)(A.url),"..","..","..","pi-extension")}function L(a){return"string"==typeof a&&(!!/(?:^|\/)pi-extension\/?$/.test(a)||a.includes("pi-extension")&&a.includes("failproofai"))}let M={claude:G,codex:{id:"codex",displayName:"OpenAI Codex",scopes:["user","project"],eventTypes:s,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".codex","hooks.json");case"project":case"local":return(0,f.resolve)(c,".codex","hooks.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b} --cli codex`:`"${a}" --hook ${b} --cli codex`,timeout:60,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(E(a),a.hooks||(a.hooks={}),s)){let e=t[d],f=this.buildHookEntry(b,d,c);a.hooks[e]||(a.hooks[e]=[]);let g=a.hooks[e],h=!1;for(let a of g){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>D(a));if(b>=0){a.hooks[b]=f,h=!0;break}}h||g.push({hooks:[f]})}},removeHooksFromFile(a){let b=this.readSettings(a),c=E(b);if(!b.hooks)return c&&this.writeSettings(a,b),0;let d=0;for(let a of Object.keys(b.hooks)){let c=b.hooks[a];if(Array.isArray(c)){for(let a=c.length-1;a>=0;a--){let b=c[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!D(a)),d+=e-b.hooks.length,0===b.hooks.length&&c.splice(a,1)}0===c.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,(d>0||c)&&this.writeSettings(a,b),d},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>D(a)))return!0}}catch{}return!1},detectInstalled:()=>F("codex")},copilot:{id:"copilot",displayName:"GitHub Copilot",scopes:["user","project"],eventTypes:u,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".copilot","hooks","failproofai.json");case"project":case"local":return(0,f.resolve)(c,".github","hooks","failproofai.json")}},readSettings(a){let b=B(a);return void 0===b.version&&(b.version=1),b},writeSettings(a,b){C(a,b)},buildHookEntry(a,b,c){let d="project"===c?`npx -y failproofai --hook ${b} --cli copilot`:`"${a}" --hook ${b} --cli copilot`;return{type:"command",bash:d,powershell:d,timeoutSec:60,[y]:!0}},isFailproofaiHook:H,writeHookEntries(a,b,c){for(let d of(void 0===a.version&&(a.version=1),a.hooks||(a.hooks={}),u)){let e=this.buildHookEntry(b,d,c);a.hooks[d]||(a.hooks[d]=[]);let f=a.hooks[d],g=!1;for(let a of f){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>H(a));if(b>=0){a.hooks[b]=e,g=!0;break}}g||f.push({hooks:[e]})}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(Array.isArray(d)){for(let a=d.length-1;a>=0;a--){let b=d[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!H(a)),c+=e-b.hooks.length,0===b.hooks.length&&d.splice(a,1)}0===d.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>H(a)))return!0}}catch{}return!1},detectInstalled:()=>F("copilot")},cursor:{id:"cursor",displayName:"Cursor Agent",scopes:["user","project"],eventTypes:v,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".cursor","hooks.json");case"project":case"local":return(0,f.resolve)(c,".cursor","hooks.json")}},readSettings(a){let b=B(a);return void 0===b.version&&(b.version=1),b},writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b} --cli cursor`:`"${a}" --hook ${b} --cli cursor`,timeout:6e4,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(void 0===a.version&&(a.version=1),a.hooks||(a.hooks={}),v)){let e=this.buildHookEntry(b,d,c),f=a.hooks[d],g=f??[];f||(a.hooks[d]=g);let h=g.findIndex(a=>D(a));h>=0?g[h]=e:g.push(e)}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(!Array.isArray(d))continue;let e=d.length,f=d.filter(a=>!D(a));c+=e-f.length,0===f.length?delete b.hooks[a]:b.hooks[a]=f}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)&&b.some(a=>D(a)))return!0}catch{}return!1},detectInstalled:()=>F("cursor-agent")||F("agent")},opencode:{id:"opencode",displayName:"OpenCode",scopes:["user","project"],eventTypes:["tool.execute.before","tool.execute.after","session.created","session.deleted","session.idle","message.updated","permission.ask"],getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".config","opencode","opencode.json");case"project":case"local":return(0,f.resolve)(c,".opencode","opencode.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry(a,b,c){if("user"===c){let a=(0,f.resolve)((0,g.homedir)(),".config","opencode","plugins","failproofai.mjs");return{spec:`file://${a}`,[y]:!0}}return{spec:I,[y]:!0}},isFailproofaiHook:a=>"string"==typeof a?a.includes("failproofai.mjs"):!!Array.isArray(a)&&"string"==typeof a[0]&&a[0].includes("failproofai.mjs"),writeHookEntries(a,b,c){let d,h,i=c??"project",j=J("user"===i?(0,f.resolve)((0,g.homedir)(),".config","opencode","opencode.json"):(0,f.resolve)(process.cwd(),".opencode","opencode.json"));(0,e.mkdirSync)((0,f.dirname)(j),{recursive:!0}),(0,e.writeFileSync)(j,(h=(d="project"===i)?'""':JSON.stringify(b),`// AUTO-GENERATED by failproofai. ${y}
2
2
  // Re-generate via: failproofai policies --install --cli opencode
3
3
  // Plugin shim that bridges OpenCode's plugin API to the failproofai binary.
4
4
  // See: https://opencode.ai/docs/plugins/
@@ -203,19 +203,19 @@ export default async function failproofaiPlugin({ client, directory }) {
203
203
  },
204
204
  };
205
205
  }
206
- `),"utf8"),Array.isArray(a.plugin)||(a.plugin=[]);let k="user"===i?`file://${j}`:H,l=a.plugin.findIndex(a=>this.isFailproofaiHook(a));l>=0?a.plugin[l]=k:a.plugin.push(k)},removeHooksFromFile(a){let b=0,c=this.readSettings(a);if(Array.isArray(c.plugin)){let a=c.plugin.length;c.plugin=c.plugin.filter(a=>!this.isFailproofaiHook(a)),b+=a-c.plugin.length,0===c.plugin.length&&delete c.plugin}this.writeSettings(a,c);let d=I(a);if((0,e.existsSync)(d))try{(0,e.readFileSync)(d,"utf8").includes(y)&&((0,e.unlinkSync)(d),0===b&&(b=1))}catch{}return b},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!Array.isArray(a.plugin)||!a.plugin.some(a=>this.isFailproofaiHook(a)))return!1;let b=I(c);if(!(0,e.existsSync)(b))return!1;return(0,e.readFileSync)(b,"utf8").includes(y)}catch{return!1}},detectInstalled:()=>E("opencode")},pi:{id:"pi",displayName:"Pi",scopes:["user","project"],eventTypes:["session_start","session_shutdown","input","tool_call","user_bash","tool_result","agent_end"],getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".pi","agent","settings.json");case"project":case"local":return(0,f.resolve)(c,".pi","settings.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({[y]:!0,_piPackagePath:J(),_piScope:c}),isFailproofaiHook:a=>"string"==typeof a?K(a):!!a&&"object"==typeof a&&(!0===a[y]||"string"==typeof a.source&&K(a.source)),writeHookEntries(a,b,c){var d;let e,g,h;Array.isArray(a.packages)||(a.packages=[]);let i=J(),j="project"===c?(d=i,e=process.cwd(),g=(0,f.resolve)(e),(h=(0,f.resolve)(d)).startsWith(g+"/")||h===g?"../"+h.slice(g.length+1):h):i,k=a.packages.findIndex(a=>K(a));k>=0?a.packages[k]=j:a.packages.push(j)},removeHooksFromFile(a){if(!(0,e.existsSync)(a))return 0;let b=this.readSettings(a);if(!Array.isArray(b.packages))return 0;let c=b.packages.length;b.packages=b.packages.filter(a=>!K(a));let d=c-b.packages.length;return 0===b.packages.length&&delete b.packages,this.writeSettings(a,b),d},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!Array.isArray(a.packages))return!1;return a.packages.some(a=>K(a))}catch{return!1}},detectInstalled:()=>E("pi")},gemini:{id:"gemini",displayName:"Gemini CLI",scopes:["user","project"],eventTypes:w,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".gemini","settings.json");case"project":case"local":return(0,f.resolve)(c,".gemini","settings.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b} --cli gemini`:`"${a}" --hook ${b} --cli gemini`,timeout:6e4,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(a.hooks||(a.hooks={}),w)){let e=this.buildHookEntry(b,d,c);a.hooks[d]||(a.hooks[d]=[]);let f=a.hooks[d],g=!1;for(let a of f){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>D(a));if(b>=0){a.hooks[b]=e,g=!0;break}}g||f.push({matcher:"*",hooks:[e]})}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(Array.isArray(d)){for(let a=d.length-1;a>=0;a--){let b=d[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!D(a)),c+=e-b.hooks.length,0===b.hooks.length&&d.splice(a,1)}0===d.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>D(a)))return!0}}catch{}return!1},detectInstalled:()=>E("gemini")}};function M(a){let b=L[a];if(!b)throw Error(`Unknown integration: ${a}. Valid: ${r.join(", ")}`);return b}function N(){return r.filter(a=>L[a].detectInstalled())}var O=a.i(1457),P=a.i(92956),Q=a.i(69839);async function R(a,b={}){let{includeBeta:c=!1}=b;if(!process.stdin.isTTY){let b=P.BUILTIN_POLICIES.filter(a=>c||!a.beta);return a?a.filter(a=>b.some(b=>b.name===a)):b.filter(a=>a.defaultEnabled).map(a=>a.name)}let d=a?new Set(a):null,e=P.BUILTIN_POLICIES.filter(a=>c||!a.beta).map(a=>({name:a.name,description:a.description,category:a.category,selected:d?d.has(a.name):a.defaultEnabled,beta:!!a.beta})),f=e.length,g=0,h="",i=0,j=!1;function k(){if(!h)return e;let a=h.toLowerCase();return e.filter(b=>b.name.toLowerCase().includes(a)||b.description.toLowerCase().includes(a))}function l(){let a=process.stdout.columns||120;j||(process.stdout.write("\x1b[?25l"),j=!0);let b=k(),d=b.length;d>0&&g>=d&&(g=d-1);let l=[];l.push(" Failproof AI — Policy Manager"),l.push("");let m=Math.max(20,a-6),n=" ┌"+"─".repeat(m+2)+"┐",o=" └"+"─".repeat(m+2)+"┘",p=h?` \x1b[2m(${d}/${f})\x1b[0m`:` \x1b[2m(${f} policies)\x1b[0m`,q=`\x1b[1mSearch:\x1b[0m ${h}\x1b[7m \x1b[0m${p}`;if(l.push(n),l.push(` \u2502 ${q}`),l.push(o),l.push(""),0===d){l.push(" \x1b[2mNo policies match “"+h+"”\x1b[0m");for(let a=0;a<9;a++)l.push("")}else{let c=function(a){let b=[],c=new Map,d=new Map;for(let a of e)c.has(a.category)||(b.push(a.category),c.set(a.category,0),d.set(a.category,0)),d.set(a.category,d.get(a.category)+1),a.selected&&c.set(a.category,c.get(a.category)+1);let f=new Map;for(let b of a){let a=f.get(b.category)??[];a.push(b),f.set(b.category,a)}let g=[],h=0;for(let a of b){let b=f.get(a);if(b&&0!==b.length)for(let e of(g.push({kind:"header",category:a,enabledCount:c.get(a),totalCount:d.get(a)}),b))g.push({kind:"item",item:e,filteredIndex:h++})}return g}(b),d=0;for(let a=0;a<c.length;a++){let b=c[a];if("item"===b.kind&&b.filteredIndex===g){d=a;break}}let f=d-Math.floor(4);f=Math.min(f=Math.max(0,f),Math.max(0,c.length-8));let h=Math.min(c.length,f+8),i=c.slice(0,f).filter(a=>"item"===a.kind).length;i>0?l.push(` \x1b[2m \u2191 ${i} more above\x1b[0m`):l.push("");for(let b=f;b<h;b++){let d=c[b];if("header"===d.kind){let b=` ${d.category.toUpperCase()} (${d.enabledCount}/${d.totalCount}) `,c=Math.max(2,a-2-(3+b.length));l.push(` \x1b[2m\u2500\u2500 ${b}${"─".repeat(c)}\x1b[0m`)}else{let a=d.item,b=d.filteredIndex===g,c=b?"\x1b[36m❯\x1b[0m":" ",e=a.selected?"\x1b[32m[✓]\x1b[0m":"[ ]",f=b?`\x1b[1;36m${a.name}\x1b[0m`:a.name,h=a.beta?" \x1b[35m[beta]\x1b[0m":"",i=" ".repeat(Math.max(1,28-a.name.length)),j=`\x1b[2m${a.description}\x1b[0m`;l.push(` ${c} ${e} ${f}${h}${i}${j}`)}}for(let a=h-f;a<8;a++)l.push("");let j=c.slice(h).filter(a=>"item"===a.kind).length;j>0?l.push(` \x1b[2m \u2193 ${j} more below\x1b[0m`):l.push("")}l.push(""),l.push(" \x1b[2m"+"─".repeat(a-2)+"\x1b[0m"),l.push(" [↑↓] Move [Space] Toggle [Ctrl+A] All [Ctrl+S] Save [Esc] Clear [^C] Quit"),l.push(""),l.push(" \x1b[2mTip: `policies` for a flat list · `policies --install <name…>` to skip prompt\x1b[0m"),c||l.push(" \x1b[2mTip: `policies --install --beta` to include beta policies\x1b[0m"),i>0&&process.stdout.write(`\x1b[${i}A\x1b[J`);let r=l.map(b=>""===b?b:function(a,b){let c=0,d="",e=0;for(;e<a.length;)if("\x1b"===a[e]&&"["===a[e+1]){let b=e+2;for(;b<a.length&&!/[A-Za-z]/.test(a[b]);)b++;b++,d+=a.slice(e,b),e=b}else{if(c>=b)break;d+=a[e],c++,e++}return d}(b,a)).join("\n")+"\n";process.stdout.write(r),i=l.length}return new Promise(a=>{function b(b,d){if(!d)return;d.ctrl&&"c"===d.name&&(c(),process.exit(0));let f=k();if("up"===d.name)f.length>0&&(g=g>0?g-1:f.length-1),l();else if("down"===d.name)f.length>0&&(g=g<f.length-1?g+1:0),l();else if("return"===d.name||"space"===d.name){let a=f[g];a&&(a.selected=!a.selected),l()}else if("escape"===d.name)h="",g=0,l();else if(d.ctrl&&"a"===d.name){let a=f.length>0&&f.every(a=>a.selected);for(let b of f)b.selected=!a;l()}else if(d.ctrl&&"s"===d.name){c();let b=e.filter(a=>a.selected).map(a=>a.name);process.stdout.write("\n"),a(b)}else"backspace"===d.name||"delete"===d.name?h.length>0&&(h=h.slice(0,-1),g=0,l()):!b||1!==b.length||d.ctrl||d.meta||(h+=b,g=0,l())}function c(){j&&(process.stdout.write("\x1b[?25h"),j=!1),process.stdin.removeListener("keypress",b),process.stdin.setRawMode(!1),process.stdin.pause()}l(),process.stdin.setRawMode(!0),process.stdin.resume(),O.emitKeypressEvents(process.stdin),process.stdin.on("keypress",b)})}let S="__failproofai_custom_hooks__";var T=a.i(24868),U=a.i(14747),V=a.i(92509);let W=".__failproofai_tmp__.mjs",X=/(?:import\s+(?:[\s\S]*?\s+from\s+)?|export\s+(?:[\s\S]*?\s+from\s+))(['"])(\.\.?\/[^'"]+)\1/g,Y=/require\s*\(\s*(['"])(\.\.?\/[^'"]+)\1\s*\)/g;async function Z(a){try{return await (0,T.access)(a),!0}catch{return!1}}async function $(){let a=process.env.FAILPROOFAI_DIST_PATH;if(a){let b=(0,U.resolve)(a,"index.js");if(await Z(b))return b}for(let a of[(0,U.resolve)((0,U.dirname)(process.execPath),"..","assets","dist","index.js"),(0,U.resolve)(process.cwd(),"dist","index.js"),(0,U.resolve)(process.cwd(),"node_modules","failproofai","dist","index.js")])if(await Z(a))return a;return null}async function _(a,b){let c=(0,U.resolve)(a,b);for(let a of[c,`${c}.js`,`${c}.mjs`,`${c}.ts`,(0,U.resolve)(c,"index.js")])if(await Z(a))return a;return null}async function aa(a,b){let c=a+".__failproofai_esm_shim__.mjs",d=`import _cjs from '${b}';
206
+ `),"utf8"),Array.isArray(a.plugin)||(a.plugin=[]);let k="user"===i?`file://${j}`:I,l=a.plugin.findIndex(a=>this.isFailproofaiHook(a));l>=0?a.plugin[l]=k:a.plugin.push(k)},removeHooksFromFile(a){let b=0,c=this.readSettings(a);if(Array.isArray(c.plugin)){let a=c.plugin.length;c.plugin=c.plugin.filter(a=>!this.isFailproofaiHook(a)),b+=a-c.plugin.length,0===c.plugin.length&&delete c.plugin}this.writeSettings(a,c);let d=J(a);if((0,e.existsSync)(d))try{(0,e.readFileSync)(d,"utf8").includes(y)&&((0,e.unlinkSync)(d),0===b&&(b=1))}catch{}return b},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!Array.isArray(a.plugin)||!a.plugin.some(a=>this.isFailproofaiHook(a)))return!1;let b=J(c);if(!(0,e.existsSync)(b))return!1;return(0,e.readFileSync)(b,"utf8").includes(y)}catch{return!1}},detectInstalled:()=>F("opencode")},pi:{id:"pi",displayName:"Pi",scopes:["user","project"],eventTypes:["session_start","session_shutdown","input","tool_call","user_bash","tool_result","agent_end"],getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".pi","agent","settings.json");case"project":case"local":return(0,f.resolve)(c,".pi","settings.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({[y]:!0,_piPackagePath:K(),_piScope:c}),isFailproofaiHook:a=>"string"==typeof a?L(a):!!a&&"object"==typeof a&&(!0===a[y]||"string"==typeof a.source&&L(a.source)),writeHookEntries(a,b,c){var d;let e,g,h;Array.isArray(a.packages)||(a.packages=[]);let i=K(),j="project"===c?(d=i,e=process.cwd(),g=(0,f.resolve)(e),(h=(0,f.resolve)(d)).startsWith(g+"/")||h===g?"../"+h.slice(g.length+1):h):i,k=a.packages.findIndex(a=>L(a));k>=0?a.packages[k]=j:a.packages.push(j)},removeHooksFromFile(a){if(!(0,e.existsSync)(a))return 0;let b=this.readSettings(a);if(!Array.isArray(b.packages))return 0;let c=b.packages.length;b.packages=b.packages.filter(a=>!L(a));let d=c-b.packages.length;return 0===b.packages.length&&delete b.packages,this.writeSettings(a,b),d},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!Array.isArray(a.packages))return!1;return a.packages.some(a=>L(a))}catch{return!1}},detectInstalled:()=>F("pi")},gemini:{id:"gemini",displayName:"Gemini CLI",scopes:["user","project"],eventTypes:w,getSettingsPath(a,b){let c=b?(0,f.resolve)(b):process.cwd();switch(a){case"user":return(0,f.resolve)((0,g.homedir)(),".gemini","settings.json");case"project":case"local":return(0,f.resolve)(c,".gemini","settings.json")}},readSettings:a=>B(a),writeSettings(a,b){C(a,b)},buildHookEntry:(a,b,c)=>({type:"command",command:"project"===c?`npx -y failproofai --hook ${b} --cli gemini`:`"${a}" --hook ${b} --cli gemini`,timeout:6e4,[y]:!0}),isFailproofaiHook:D,writeHookEntries(a,b,c){for(let d of(a.hooks||(a.hooks={}),w)){let e=this.buildHookEntry(b,d,c);a.hooks[d]||(a.hooks[d]=[]);let f=a.hooks[d],g=!1;for(let a of f){if(!a.hooks)continue;let b=a.hooks.findIndex(a=>D(a));if(b>=0){a.hooks[b]=e,g=!0;break}}g||f.push({matcher:"*",hooks:[e]})}},removeHooksFromFile(a){let b=this.readSettings(a);if(!b.hooks)return 0;let c=0;for(let a of Object.keys(b.hooks)){let d=b.hooks[a];if(Array.isArray(d)){for(let a=d.length-1;a>=0;a--){let b=d[a];if(!b.hooks)continue;let e=b.hooks.length;b.hooks=b.hooks.filter(a=>!D(a)),c+=e-b.hooks.length,0===b.hooks.length&&d.splice(a,1)}0===d.length&&delete b.hooks[a]}}return 0===Object.keys(b.hooks).length&&delete b.hooks,this.writeSettings(a,b),c},hooksInstalledInSettings(a,b){let c=this.getSettingsPath(a,b);if(!(0,e.existsSync)(c))return!1;try{let a=this.readSettings(c);if(!a.hooks)return!1;for(let b of Object.values(a.hooks))if(Array.isArray(b)){for(let a of b)if(a.hooks&&a.hooks.some(a=>D(a)))return!0}}catch{}return!1},detectInstalled:()=>F("gemini")}};function N(a){let b=M[a];if(!b)throw Error(`Unknown integration: ${a}. Valid: ${r.join(", ")}`);return b}function O(){return r.filter(a=>M[a].detectInstalled())}var P=a.i(1457),Q=a.i(92956),R=a.i(69839);async function S(a,b={}){let{includeBeta:c=!1}=b;if(!process.stdin.isTTY){let b=Q.BUILTIN_POLICIES.filter(a=>c||!a.beta);return a?a.filter(a=>b.some(b=>b.name===a)):b.filter(a=>a.defaultEnabled).map(a=>a.name)}let d=a?new Set(a):null,e=Q.BUILTIN_POLICIES.filter(a=>c||!a.beta).map(a=>({name:a.name,description:a.description,category:a.category,selected:d?d.has(a.name):a.defaultEnabled,beta:!!a.beta})),f=e.length,g=0,h="",i=0,j=!1;function k(){if(!h)return e;let a=h.toLowerCase();return e.filter(b=>b.name.toLowerCase().includes(a)||b.description.toLowerCase().includes(a))}function l(){let a=process.stdout.columns||120;j||(process.stdout.write("\x1b[?25l"),j=!0);let b=k(),d=b.length;d>0&&g>=d&&(g=d-1);let l=[];l.push(" Failproof AI — Policy Manager"),l.push("");let m=Math.max(20,a-6),n=" ┌"+"─".repeat(m+2)+"┐",o=" └"+"─".repeat(m+2)+"┘",p=h?` \x1b[2m(${d}/${f})\x1b[0m`:` \x1b[2m(${f} policies)\x1b[0m`,q=`\x1b[1mSearch:\x1b[0m ${h}\x1b[7m \x1b[0m${p}`;if(l.push(n),l.push(` \u2502 ${q}`),l.push(o),l.push(""),0===d){l.push(" \x1b[2mNo policies match “"+h+"”\x1b[0m");for(let a=0;a<9;a++)l.push("")}else{let c=function(a){let b=[],c=new Map,d=new Map;for(let a of e)c.has(a.category)||(b.push(a.category),c.set(a.category,0),d.set(a.category,0)),d.set(a.category,d.get(a.category)+1),a.selected&&c.set(a.category,c.get(a.category)+1);let f=new Map;for(let b of a){let a=f.get(b.category)??[];a.push(b),f.set(b.category,a)}let g=[],h=0;for(let a of b){let b=f.get(a);if(b&&0!==b.length)for(let e of(g.push({kind:"header",category:a,enabledCount:c.get(a),totalCount:d.get(a)}),b))g.push({kind:"item",item:e,filteredIndex:h++})}return g}(b),d=0;for(let a=0;a<c.length;a++){let b=c[a];if("item"===b.kind&&b.filteredIndex===g){d=a;break}}let f=d-Math.floor(4);f=Math.min(f=Math.max(0,f),Math.max(0,c.length-8));let h=Math.min(c.length,f+8),i=c.slice(0,f).filter(a=>"item"===a.kind).length;i>0?l.push(` \x1b[2m \u2191 ${i} more above\x1b[0m`):l.push("");for(let b=f;b<h;b++){let d=c[b];if("header"===d.kind){let b=` ${d.category.toUpperCase()} (${d.enabledCount}/${d.totalCount}) `,c=Math.max(2,a-2-(3+b.length));l.push(` \x1b[2m\u2500\u2500 ${b}${"─".repeat(c)}\x1b[0m`)}else{let a=d.item,b=d.filteredIndex===g,c=b?"\x1b[36m❯\x1b[0m":" ",e=a.selected?"\x1b[32m[✓]\x1b[0m":"[ ]",f=b?`\x1b[1;36m${a.name}\x1b[0m`:a.name,h=a.beta?" \x1b[35m[beta]\x1b[0m":"",i=" ".repeat(Math.max(1,28-a.name.length)),j=`\x1b[2m${a.description}\x1b[0m`;l.push(` ${c} ${e} ${f}${h}${i}${j}`)}}for(let a=h-f;a<8;a++)l.push("");let j=c.slice(h).filter(a=>"item"===a.kind).length;j>0?l.push(` \x1b[2m \u2193 ${j} more below\x1b[0m`):l.push("")}l.push(""),l.push(" \x1b[2m"+"─".repeat(a-2)+"\x1b[0m"),l.push(" [↑↓] Move [Space] Toggle [Ctrl+A] All [Ctrl+S] Save [Esc] Clear [^C] Quit"),l.push(""),l.push(" \x1b[2mTip: `policies` for a flat list · `policies --install <name…>` to skip prompt\x1b[0m"),c||l.push(" \x1b[2mTip: `policies --install --beta` to include beta policies\x1b[0m"),i>0&&process.stdout.write(`\x1b[${i}A\x1b[J`);let r=l.map(b=>""===b?b:function(a,b){let c=0,d="",e=0;for(;e<a.length;)if("\x1b"===a[e]&&"["===a[e+1]){let b=e+2;for(;b<a.length&&!/[A-Za-z]/.test(a[b]);)b++;b++,d+=a.slice(e,b),e=b}else{if(c>=b)break;d+=a[e],c++,e++}return d}(b,a)).join("\n")+"\n";process.stdout.write(r),i=l.length}return new Promise(a=>{function b(b,d){if(!d)return;d.ctrl&&"c"===d.name&&(c(),process.exit(0));let f=k();if("up"===d.name)f.length>0&&(g=g>0?g-1:f.length-1),l();else if("down"===d.name)f.length>0&&(g=g<f.length-1?g+1:0),l();else if("return"===d.name||"space"===d.name){let a=f[g];a&&(a.selected=!a.selected),l()}else if("escape"===d.name)h="",g=0,l();else if(d.ctrl&&"a"===d.name){let a=f.length>0&&f.every(a=>a.selected);for(let b of f)b.selected=!a;l()}else if(d.ctrl&&"s"===d.name){c();let b=e.filter(a=>a.selected).map(a=>a.name);process.stdout.write("\n"),a(b)}else"backspace"===d.name||"delete"===d.name?h.length>0&&(h=h.slice(0,-1),g=0,l()):!b||1!==b.length||d.ctrl||d.meta||(h+=b,g=0,l())}function c(){j&&(process.stdout.write("\x1b[?25h"),j=!1),process.stdin.removeListener("keypress",b),process.stdin.setRawMode(!1),process.stdin.pause()}l(),process.stdin.setRawMode(!0),process.stdin.resume(),P.emitKeypressEvents(process.stdin),process.stdin.on("keypress",b)})}let T="__failproofai_custom_hooks__";var U=a.i(24868),V=a.i(14747),W=a.i(92509);let X=".__failproofai_tmp__.mjs",Y=/(?:import\s+(?:[\s\S]*?\s+from\s+)?|export\s+(?:[\s\S]*?\s+from\s+))(['"])(\.\.?\/[^'"]+)\1/g,Z=/require\s*\(\s*(['"])(\.\.?\/[^'"]+)\1\s*\)/g;async function $(a){try{return await (0,U.access)(a),!0}catch{return!1}}async function _(){let a=process.env.FAILPROOFAI_DIST_PATH;if(a){let b=(0,V.resolve)(a,"index.js");if(await $(b))return b}for(let a of[(0,V.resolve)((0,V.dirname)(process.execPath),"..","assets","dist","index.js"),(0,V.resolve)(process.cwd(),"dist","index.js"),(0,V.resolve)(process.cwd(),"node_modules","failproofai","dist","index.js")])if(await $(a))return a;return null}async function aa(a,b){let c=(0,V.resolve)(a,b);for(let a of[c,`${c}.js`,`${c}.mjs`,`${c}.ts`,(0,V.resolve)(c,"index.js")])if(await $(a))return a;return null}async function ab(a,b){let c=a+".__failproofai_esm_shim__.mjs",d=`import _cjs from '${b}';
207
207
  export const customPolicies = _cjs.customPolicies;
208
208
  export const getCustomHooks = _cjs.getCustomHooks;
209
209
  export const clearCustomHooks = _cjs.clearCustomHooks;
210
210
  export const allow = _cjs.allow;
211
211
  export const deny = _cjs.deny;
212
212
  export const instruct = _cjs.instruct;
213
- export default _cjs;`;return await (0,T.writeFile)(c,d,"utf-8"),{shimPath:c,shimUrl:(0,V.pathToFileURL)(c).href}}async function ab(a,b,c){let d=[a],e=new Set,f=[],g=null;if(c&&b){let a=await aa(c,b);f.push(a.shimPath),g=a.shimUrl}for(;d.length>0;){let a=d.shift();if(e.has(a))continue;e.add(a);let b=await (0,T.readFile)(a,"utf-8");g&&(b=b.replace(/from\s+(['"])(?:claudeye|failproofai)\1/g,`from '${g}'`)),c&&(b=b.replace(/require\s*\(\s*(['"])(?:claudeye|failproofai)\1\s*\)/g,`require('${c.replace(/\\/g,"\\\\")}')`));let h=(0,U.dirname)(a),i=new Map;for(let a of[X,Y]){let c,f=new RegExp(a.source,a.flags);for(;null!==(c=f.exec(b));){let a=c[2];if(i.has(a))continue;let b=await _(h,a);if(!b)continue;e.has(b)||d.includes(b)||d.push(b);let f=(0,U.relative)(h,b+W).split("\\").join("/");f.startsWith(".")||(f="./"+f),i.set(a,f)}}for(let a of[...i.keys()].sort((a,b)=>b.length-a.length)){let c=i.get(a),d=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");b=(b=b.replace(RegExp(`'${d}'`,"g"),`'${c}'`)).replace(RegExp(`"${d}"`,"g"),`"${c}"`)}let j=a+W;await (0,T.writeFile)(j,b,"utf-8"),f.push(j)}return f}async function ac(a){for(let b of a)try{await (0,T.unlink)(b)}catch{}}var ad=a.i(12072),ae=a.i(79779);let af=ae.POSTHOG_API_KEY;async function ag(a,b,c){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return;let d=JSON.stringify({api_key:process.env.FAILPROOFAI_POSTHOG_KEY??af,event:b,distinct_id:a,properties:{...c,$lib:"failproofai-hooks",failproofai_version:ad.version,product:ae.POSTHOG_PRODUCT}});try{await fetch(process.env.FAILPROOFAI_POSTHOG_HOST?`${process.env.FAILPROOFAI_POSTHOG_HOST}/capture/`:"https://us.i.posthog.com/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:d,signal:AbortSignal.timeout(5e3)})}catch{}}let ah="__FAILPROOFAI_LOADING_HOOKS__";async function ai(a,b){let c=globalThis;c[ah]=!0;let d=[];try{let b=await $(),c=b?(0,z.pathToFileURL)(b).href:null;d=await ab(a,c,b);let e=(0,z.pathToFileURL)(a+W).href;await import(e)}catch(e){let c=e instanceof Error?e.message:String(e),d=/Cannot find module|MODULE_NOT_FOUND|ENOENT/i.test(c)?"module_not_found":/SyntaxError|Unexpected token/i.test(c)?"syntax_error":"runtime_error";if(ag((0,Q.getInstanceId)(),"custom_hooks_load_error",{error_type:d,is_convention:!!b?.conventionScope,convention_scope:b?.conventionScope??null,file_basename:(0,f.basename)(a)}),b?.strict)throw Error(`Failed to load custom hooks from ${a}: ${c}`);(0,h.hookLogError)(`failed to load custom hooks from ${a}: ${c}`)}finally{c[ah]=!1,await ac(d)}}async function aj(a,b){let c;if(!a)return[];let d=(0,f.isAbsolute)(a)?a:(0,f.resolve)(b?.sessionCwd??process.cwd(),a);if(!(0,e.existsSync)(d)){if(b?.strict)throw Error(`Custom hooks file not found: ${d}`);return(0,h.hookLogWarn)(`customPoliciesPath not found: ${d}`),[]}return globalThis[S]=[],await ai(d,b),Array.isArray((c=globalThis)[S])||(c[S]=[]),c[S]}class ak extends Error{exitCode;constructor(a,b=1){super(a),this.name="CliError",this.exitCode=b}}let al=new Set(P.BUILTIN_POLICIES.map(a=>a.name));function am(a,b){return F.getSettingsPath(a,b)}function an(a){let b=a.filter(a=>!al.has(a));if(b.length>0){let a=[...al].join(", ");throw new ak(`Unknown policy name(s): ${b.join(", ")}
214
- Valid policies: ${a}`)}}function ao(a,b){return F.hooksInstalledInSettings(a,b)}async function ap(a,b="user",c,d=!1,e,h,i=!1,j){let k,l;if(void 0!==a&&a.length>0){let b=a.filter(a=>"all"!==a);if(b.length>0&&an(b),a.includes("all")&&b.length>0)throw new ak(`"all" cannot be combined with specific policy names.
215
- Use either: --install all or --install block-sudo sanitize-jwt ...`)}let m=j&&j.length>0?[...new Set(j)]:["claude"];for(let a of m){let c=M(a);if(!c.scopes.includes(b)){try{await ag((0,Q.getInstanceId)(),"scope_validation_failed",{cli:a,scope:b,supported_scopes:c.scopes})}catch{}throw new ak(`Scope "${b}" is not supported by ${c.displayName}. Valid scopes: ${c.scopes.join(", ")}`)}}let r=function(){let a=process.env.FAILPROOFAI_BINARY_OVERRIDE;if(a&&a.trim())return a.trim();try{return(0,p.execSync)("which failproofai",{encoding:"utf8"}).trim().split("\n")[0].trim()}catch{throw new ak("failproofai binary not found in PATH.\nInstall it globally first: npm install -g failproofai")}}(),s=n(b,c),t=new Set(s.enabledPolicies);if(void 0!==a){let b;b=1===a.length&&"all"===a[0]?P.BUILTIN_POLICIES.filter(a=>d||!a.beta).map(a=>a.name):a,k=[...new Set([...s.enabledPolicies,...b])]}else{let a=s.enabledPolicies.length>0?s.enabledPolicies:void 0;k=await R(a,{includeBeta:d})}let u={...s,enabledPolicies:k};if(i)delete u.customPoliciesPath;else if(h){u.customPoliciesPath=(0,f.resolve)(h);let a=[];try{a=await aj(u.customPoliciesPath,{strict:!0})}catch(c){let a=c instanceof Error?c.message:String(c);try{await ag((0,Q.getInstanceId)(),"custom_policy_validation_failed",{scope:b,error_type:/not found/i.test(a)?"file_not_found":"load_error"})}catch{}console.error(`Error: ${a}`),process.exit(1)}if(0===a.length){try{await ag((0,Q.getInstanceId)(),"custom_policy_validation_failed",{scope:b,error_type:"no_hooks_registered"})}catch{}console.error(`Error: no hooks registered in ${h}. Make sure your file calls customPolicies.add(...) at least once.`),process.exit(1)}console.log(`
213
+ export default _cjs;`;return await (0,U.writeFile)(c,d,"utf-8"),{shimPath:c,shimUrl:(0,W.pathToFileURL)(c).href}}async function ac(a,b,c){let d=[a],e=new Set,f=[],g=null;if(c&&b){let a=await ab(c,b);f.push(a.shimPath),g=a.shimUrl}for(;d.length>0;){let a=d.shift();if(e.has(a))continue;e.add(a);let b=await (0,U.readFile)(a,"utf-8");g&&(b=b.replace(/from\s+(['"])(?:claudeye|failproofai)\1/g,`from '${g}'`)),c&&(b=b.replace(/require\s*\(\s*(['"])(?:claudeye|failproofai)\1\s*\)/g,`require('${c.replace(/\\/g,"\\\\")}')`));let h=(0,V.dirname)(a),i=new Map;for(let a of[Y,Z]){let c,f=new RegExp(a.source,a.flags);for(;null!==(c=f.exec(b));){let a=c[2];if(i.has(a))continue;let b=await aa(h,a);if(!b)continue;e.has(b)||d.includes(b)||d.push(b);let f=(0,V.relative)(h,b+X).split("\\").join("/");f.startsWith(".")||(f="./"+f),i.set(a,f)}}for(let a of[...i.keys()].sort((a,b)=>b.length-a.length)){let c=i.get(a),d=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");b=(b=b.replace(RegExp(`'${d}'`,"g"),`'${c}'`)).replace(RegExp(`"${d}"`,"g"),`"${c}"`)}let j=a+X;await (0,U.writeFile)(j,b,"utf-8"),f.push(j)}return f}async function ad(a){for(let b of a)try{await (0,U.unlink)(b)}catch{}}var ae=a.i(12072),af=a.i(79779);let ag=af.POSTHOG_API_KEY;async function ah(a,b,c){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return;let d=JSON.stringify({api_key:process.env.FAILPROOFAI_POSTHOG_KEY??ag,event:b,distinct_id:a,properties:{...c,$lib:"failproofai-hooks",failproofai_version:ae.version,product:af.POSTHOG_PRODUCT}});try{await fetch(process.env.FAILPROOFAI_POSTHOG_HOST?`${process.env.FAILPROOFAI_POSTHOG_HOST}/capture/`:"https://us.i.posthog.com/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:d,signal:AbortSignal.timeout(5e3)})}catch{}}let ai="__FAILPROOFAI_LOADING_HOOKS__";async function aj(a,b){let c=globalThis;c[ai]=!0;let d=[];try{let b=await _(),c=b?(0,z.pathToFileURL)(b).href:null;d=await ac(a,c,b);let e=(0,z.pathToFileURL)(a+X).href;await import(e)}catch(e){let c=e instanceof Error?e.message:String(e),d=/Cannot find module|MODULE_NOT_FOUND|ENOENT/i.test(c)?"module_not_found":/SyntaxError|Unexpected token/i.test(c)?"syntax_error":"runtime_error";if(ah((0,R.getInstanceId)(),"custom_hooks_load_error",{error_type:d,is_convention:!!b?.conventionScope,convention_scope:b?.conventionScope??null,file_basename:(0,f.basename)(a)}),b?.strict)throw Error(`Failed to load custom hooks from ${a}: ${c}`);(0,h.hookLogError)(`failed to load custom hooks from ${a}: ${c}`)}finally{c[ai]=!1,await ad(d)}}async function ak(a,b){let c;if(!a)return[];let d=(0,f.isAbsolute)(a)?a:(0,f.resolve)(b?.sessionCwd??process.cwd(),a);if(!(0,e.existsSync)(d)){if(b?.strict)throw Error(`Custom hooks file not found: ${d}`);return(0,h.hookLogWarn)(`customPoliciesPath not found: ${d}`),[]}return globalThis[T]=[],await aj(d,b),Array.isArray((c=globalThis)[T])||(c[T]=[]),c[T]}class al extends Error{exitCode;constructor(a,b=1){super(a),this.name="CliError",this.exitCode=b}}let am=new Set(Q.BUILTIN_POLICIES.map(a=>a.name));function an(a,b){return G.getSettingsPath(a,b)}function ao(a){let b=a.filter(a=>!am.has(a));if(b.length>0){let a=[...am].join(", ");throw new al(`Unknown policy name(s): ${b.join(", ")}
214
+ Valid policies: ${a}`)}}function ap(a,b){return G.hooksInstalledInSettings(a,b)}async function aq(a,b="user",c,d=!1,e,h,i=!1,j){let k,l;if(void 0!==a&&a.length>0){let b=a.filter(a=>"all"!==a);if(b.length>0&&ao(b),a.includes("all")&&b.length>0)throw new al(`"all" cannot be combined with specific policy names.
215
+ Use either: --install all or --install block-sudo sanitize-jwt ...`)}let m=j&&j.length>0?[...new Set(j)]:["claude"];for(let a of m){let c=N(a);if(!c.scopes.includes(b)){try{await ah((0,R.getInstanceId)(),"scope_validation_failed",{cli:a,scope:b,supported_scopes:c.scopes})}catch{}throw new al(`Scope "${b}" is not supported by ${c.displayName}. Valid scopes: ${c.scopes.join(", ")}`)}}let r=function(){let a=process.env.FAILPROOFAI_BINARY_OVERRIDE;if(a&&a.trim())return a.trim();try{return(0,p.execSync)("which failproofai",{encoding:"utf8"}).trim().split("\n")[0].trim()}catch{throw new al("failproofai binary not found in PATH.\nInstall it globally first: npm install -g failproofai")}}(),s=n(b,c),t=new Set(s.enabledPolicies);if(void 0!==a){let b;b=1===a.length&&"all"===a[0]?Q.BUILTIN_POLICIES.filter(a=>d||!a.beta).map(a=>a.name):a,k=[...new Set([...s.enabledPolicies,...b])]}else{let a=s.enabledPolicies.length>0?s.enabledPolicies:void 0;k=await S(a,{includeBeta:d})}let u={...s,enabledPolicies:k};if(i)delete u.customPoliciesPath;else if(h){u.customPoliciesPath=(0,f.resolve)(h);let a=[];try{a=await ak(u.customPoliciesPath,{strict:!0})}catch(c){let a=c instanceof Error?c.message:String(c);try{await ah((0,R.getInstanceId)(),"custom_policy_validation_failed",{scope:b,error_type:/not found/i.test(a)?"file_not_found":"load_error"})}catch{}console.error(`Error: ${a}`),process.exit(1)}if(0===a.length){try{await ah((0,R.getInstanceId)(),"custom_policy_validation_failed",{scope:b,error_type:"no_hooks_registered"})}catch{}console.error(`Error: no hooks registered in ${h}. Make sure your file calls customPolicies.add(...) at least once.`),process.exit(1)}console.log(`
216
216
  Validated ${a.length} custom hook(s): ${a.map(a=>a.name).join(", ")}`)}o(u,b,c),console.log(`
217
217
  Enabled ${k.length} policy(ies): ${k.join(", ")}
218
- `),i?console.log("Custom hooks path cleared."):u.customPoliciesPath&&console.log(`Custom hooks path: ${u.customPoliciesPath}`);let v=[];for(let a of m){let d=M(a),e=d.getSettingsPath(b,c);try{let c=d.readSettings(e);d.writeHookEntries(c,r,b),d.writeSettings(e,c),v.push({cli:a,path:e})}catch(d){let c=d instanceof Error&&/EACCES|EPERM/.test(d.message)?"permission_denied":d instanceof Error&&/ENOENT|ENOTDIR/.test(d.message)?"path_not_found":"write_error";try{await ag((0,Q.getInstanceId)(),"hook_write_failed",{cli:a,scope:b,error_type:c})}catch{}throw d}}try{let a=new Set(k),c=k.filter(a=>!t.has(a)),f=[...t].filter(b=>!a.has(b)),h=(0,Q.getInstanceId)();if(await ag(h,"hooks_installed",{scope:b,cli:m,cli_count:m.length,policies:k,policy_count:k.length,policies_added:c,policies_removed:f,...e?{source:e}:{},platform:(0,g.platform)(),arch:(0,g.arch)(),os_release:(0,g.release)(),hostname_hash:(0,Q.hashToId)((0,g.hostname)()),has_custom_hooks_path:!!u.customPoliciesPath,has_policy_params:!!(u.policyParams&&Object.keys(u.policyParams).length>0),param_policy_names:u.policyParams?Object.keys(u.policyParams):[],command_format:"project"===b?"npx":"absolute"}),d){let a=new Set(P.BUILTIN_POLICIES.filter(a=>a.beta).map(a=>a.name)),c=k.filter(b=>a.has(b));c.length>0&&await ag(h,"beta_policies_installed",{scope:b,cli:m,beta_count:c.length,beta_policy_names:c,...e?{source:e}:{}})}}catch{}for(let{cli:a,path:c}of v){let d=M(a);console.log(`Failproof AI hooks installed for ${d.displayName} (${d.eventTypes.length} event types, scope: ${b}).`),console.log(`Settings: ${c}`)}"project"===b?(console.log("Command: npx -y failproofai"),console.log(`
219
- This file can be committed to git — no machine-specific paths.`)):console.log(`Binary: ${r}`);let w=(l=new Set,q.filter(a=>{let b=am(a,c);return!l.has(b)&&(l.add(b),!0)})).filter(a=>a!==b).filter(a=>ao(a,c));if(w.length>0){let a=w.map(a=>`${a} (${function(a){switch(a){case"user":return"~/.claude/settings.json";case"project":return"{cwd}/.claude/settings.json";case"local":return"{cwd}/.claude/settings.local.json"}}(a)})`).join(", ");console.log(),console.log(`\x1b[33mWarning: Failproof AI hooks are also installed at ${a}.\x1b[0m`),console.log("Having hooks in multiple scopes may cause duplicate policy evaluation."),console.log(`Use \`failproofai policies --uninstall --scope ${w[0]}\` to remove the other installation,`),console.log("or `failproofai policies` to see all scopes.");try{await ag((0,Q.getInstanceId)(),"multi_scope_warning_shown",{new_scope:b,existing_scopes:w,cli:m})}catch{}}}async function aq(a,b="user",c,d){let f="all"===b?"user":b,h=d?.cli&&d.cli.length>0?[...new Set(d.cli)]:["claude"];if(d?.removeCustomHooks){let a=n(f,c);delete a.customPoliciesPath,o(a,f,c),console.log("Custom hooks path cleared.")}if(a&&a.length>0&&(1!==a.length||"all"!==a[0])){an(a);let e=n(f,c),i=new Set(a),j=e.enabledPolicies.filter(a=>!i.has(a)),k=a.filter(a=>!e.enabledPolicies.includes(a));k.length>0&&console.log(`Warning: policy(ies) not currently enabled: ${k.join(", ")}`);let{policyParams:l,...m}=e,p=l?Object.fromEntries(Object.entries(l).filter(([a])=>!i.has(a))):null;o({...m,enabledPolicies:j,...p&&Object.keys(p).length>0?{policyParams:p}:{}},f,c);try{let c=(0,Q.getInstanceId)(),f=a.filter(a=>e.enabledPolicies.includes(a));await ag(c,"hooks_removed",{scope:b,cli:h,removal_mode:d?.betaOnly?"beta_policies":"policies",beta_only:d?.betaOnly??!1,policies_removed:f,removed_count:f.length,...d?.source?{source:d.source}:{},platform:(0,g.platform)(),arch:(0,g.arch)(),os_release:(0,g.release)(),hostname_hash:(0,Q.hashToId)((0,g.hostname)())})}catch{}console.log(`Disabled ${a.length-k.length} policy(ies).`),console.log(`Remaining: ${j.length>0?j.join(", "):"(none)"}`);return}let i=n(f,c),j=0,k=!1;for(let a of h){let d=M(a);for(let a of"all"===b?[...d.scopes]:d.scopes.includes(b)?[b]:[]){let f=d.getSettingsPath(a,c);if(!(0,e.existsSync)(f)){"all"!==b&&1===h.length&&(console.log("No settings file found. Nothing to remove."),k=!0);continue}let g=d.removeHooksFromFile(f);if(0===g&&"all"!==b&&1===h.length){console.log("No hooks found in settings. Nothing to remove."),k=!0;continue}j+=g,"all"!==b&&(console.log(`Removed ${g} failproofai hook(s) from ${d.displayName} settings.`),console.log(`Settings: ${f}`))}}if(!k||0!==j){if("all"===b)for(let a of(console.log(`Removed ${j} failproofai hook(s) from all scopes.`),h)){let b=M(a);for(let a of b.scopes)console.log(` ${b.displayName} / ${a}: ${b.getSettingsPath(a,c)}`)}try{let a=(0,Q.getInstanceId)();await ag(a,"hooks_removed",{scope:b,cli:h,removal_mode:"hooks",policies_removed:i.enabledPolicies,removed_count:j,...d?.source?{source:d.source}:{},platform:(0,g.platform)(),arch:(0,g.arch)(),os_release:(0,g.release)(),hostname_hash:(0,Q.hashToId)((0,g.hostname)())})}catch{}if("all"===b)for(let a of q){let b=n(a,c);if(b.enabledPolicies.length>0||b.customPoliciesPath||b.policyParams){let{customPoliciesPath:d,policyParams:e,...f}=b;o({...f,enabledPolicies:[]},a,c)}}else if(!q.some(a=>ao(a,c))){let{customPoliciesPath:a,policyParams:b,...d}=n(f,c);o({...d,enabledPolicies:[]},f,c)}}}var ar=a.i(24282),as=a.i(12714),at=a.i(13095);async function au(a){if(!(0,e.existsSync)(a))return[];let b=await (0,as.readFile)(a,"utf-8"),c=[],d=b.split(/customPolicies\.add\s*\(/);for(let a=1;a<d.length;a++){let b=d[a],e=b.match(/name:\s*["'`]([^"'`]+)["'`]/);if(!e)continue;let f=b.match(/description:\s*["'`]([^"'`]+)["'`]/),g=b.match(/events:\s*\[([^\]]+)\]/),h=g?g[1].replace(/["'`\s]/g,"").split(",").filter(Boolean).join(", "):void 0;c.push({name:e[1],description:f?.[1],eventScope:h})}return c}async function av(){let a=k(),b=new Set(a.enabledPolicies),c=q.filter(a=>ao(a)),d=am(c[0]??"user"),e=r.map(a=>L[a]).map(a=>({id:a.id,label:(0,ar.getCliLabel)(a.id),installed:a.hooksInstalledInSettings("user"),settingsPath:a.getSettingsPath("user"),detected:a.detectInstalled()})),f=P.BUILTIN_POLICIES.map(c=>{var d;let e,f;return{name:c.name,description:c.description,category:c.category,defaultEnabled:c.defaultEnabled,beta:!!c.beta,enabled:b.has(c.name),eventScope:(d=c.match,e=d.events?.join(", ")??"",f=d.toolNames?` \xb7 ${d.toolNames.join(", ")}`:"",`${e}${f}`),params:c.params?Object.fromEntries(Object.entries(c.params).map(([a,b])=>[a,{type:b.type,description:b.description,default:b.default}])):void 0,currentParams:c.params?a.policyParams?.[c.name]??{}:void 0}}),g=a.customPoliciesPath?await au(a.customPoliciesPath):void 0;return{enabledPolicies:a.enabledPolicies,installedScopes:c,settingsPath:d,clis:e,policies:f,customPoliciesPath:a.customPoliciesPath,customPolicies:g?.length?g:void 0}}async function aw(a,b){let c=k(),d=new Set(c.enabledPolicies);b?d.add(a):d.delete(a),l({...c,enabledPolicies:[...d]});try{let c=(0,Q.getInstanceId)();await ag(c,"policy_toggled",{policy_name:a,enabled:b,action:b?"enable":"disable",source:"web"})}catch{}}async function ax(a="user",b){let c=k(),d=c.enabledPolicies.length>0?c.enabledPolicies:P.BUILTIN_POLICIES.filter(a=>a.defaultEnabled&&!a.beta).map(a=>a.name),e=b&&b.length>0?b:N(),f=e.length>0?e:["claude"];await ap(d,a,void 0,!1,"web",void 0,!1,f)}async function ay(a="user",b){let c=b&&b.length>0?b:N(),d=c.length>0?c:["claude"];await aq(void 0,a,void 0,{source:"web",cli:d})}async function az(a,b){let c=k(),d={...c.policyParams??{},[a]:b};l({...c,policyParams:d});try{let c=(0,Q.getInstanceId)();await ag(c,"policy_params_updated",{policy_name:a,param_keys:Object.keys(b),source:"web"})}catch{}}(0,at.ensureServerEntryExports)([av]),(0,d.registerServerReference)(av,"003575adc273e606668952bb88c9184fcc3702802e",null),(0,at.ensureServerEntryExports)([aw]),(0,d.registerServerReference)(aw,"60ec1a66cf2a3594ef1af92d3d418b15bc54ace115",null),(0,at.ensureServerEntryExports)([ax,ay]),(0,d.registerServerReference)(ax,"606410946ffa73db43321f1a4d00c39e8fc7bc8d18",null),(0,d.registerServerReference)(ay,"60c9a0adaa922c76bedb3585258e25f0c4f003dc9e",null),(0,at.ensureServerEntryExports)([az]),(0,d.registerServerReference)(az,"60d1f0ebc4b5811aab92442996d5e987130d9714de",null),a.s([],63895),a.i(63895),a.s(["003575adc273e606668952bb88c9184fcc3702802e",0,av,"009232c781bf0af8bf91fd755c64ff900e5683e16b",()=>b.getTelemetryConfig,"40cb578545ca16ca272e6cee536a1beb6ced1c20ae",()=>c.getHookActivityAction,"606410946ffa73db43321f1a4d00c39e8fc7bc8d18",0,ax,"60c9a0adaa922c76bedb3585258e25f0c4f003dc9e",0,ay,"60d1f0ebc4b5811aab92442996d5e987130d9714de",0,az,"60eae94ef10c13087319d3480f89e7ea4be834c6a7",()=>c.searchHookActivityAction,"60ec1a66cf2a3594ef1af92d3d418b15bc54ace115",0,aw],11369)}];
218
+ `),i?console.log("Custom hooks path cleared."):u.customPoliciesPath&&console.log(`Custom hooks path: ${u.customPoliciesPath}`);let v=[];for(let a of m){let d=N(a),e=d.getSettingsPath(b,c);try{let c=d.readSettings(e);d.writeHookEntries(c,r,b),d.writeSettings(e,c),v.push({cli:a,path:e})}catch(d){let c=d instanceof Error&&/EACCES|EPERM/.test(d.message)?"permission_denied":d instanceof Error&&/ENOENT|ENOTDIR/.test(d.message)?"path_not_found":"write_error";try{await ah((0,R.getInstanceId)(),"hook_write_failed",{cli:a,scope:b,error_type:c})}catch{}throw d}}try{let a=new Set(k),c=k.filter(a=>!t.has(a)),f=[...t].filter(b=>!a.has(b)),h=(0,R.getInstanceId)();if(await ah(h,"hooks_installed",{scope:b,cli:m,cli_count:m.length,policies:k,policy_count:k.length,policies_added:c,policies_removed:f,...e?{source:e}:{},platform:(0,g.platform)(),arch:(0,g.arch)(),os_release:(0,g.release)(),hostname_hash:(0,R.hashToId)((0,g.hostname)()),has_custom_hooks_path:!!u.customPoliciesPath,has_policy_params:!!(u.policyParams&&Object.keys(u.policyParams).length>0),param_policy_names:u.policyParams?Object.keys(u.policyParams):[],command_format:"project"===b?"npx":"absolute"}),d){let a=new Set(Q.BUILTIN_POLICIES.filter(a=>a.beta).map(a=>a.name)),c=k.filter(b=>a.has(b));c.length>0&&await ah(h,"beta_policies_installed",{scope:b,cli:m,beta_count:c.length,beta_policy_names:c,...e?{source:e}:{}})}}catch{}for(let{cli:a,path:c}of v){let d=N(a);console.log(`Failproof AI hooks installed for ${d.displayName} (${d.eventTypes.length} event types, scope: ${b}).`),console.log(`Settings: ${c}`)}"project"===b?(console.log("Command: npx -y failproofai"),console.log(`
219
+ This file can be committed to git — no machine-specific paths.`)):console.log(`Binary: ${r}`);let w=(l=new Set,q.filter(a=>{let b=an(a,c);return!l.has(b)&&(l.add(b),!0)})).filter(a=>a!==b).filter(a=>ap(a,c));if(w.length>0){let a=w.map(a=>`${a} (${function(a){switch(a){case"user":return"~/.claude/settings.json";case"project":return"{cwd}/.claude/settings.json";case"local":return"{cwd}/.claude/settings.local.json"}}(a)})`).join(", ");console.log(),console.log(`\x1b[33mWarning: Failproof AI hooks are also installed at ${a}.\x1b[0m`),console.log("Having hooks in multiple scopes may cause duplicate policy evaluation."),console.log(`Use \`failproofai policies --uninstall --scope ${w[0]}\` to remove the other installation,`),console.log("or `failproofai policies` to see all scopes.");try{await ah((0,R.getInstanceId)(),"multi_scope_warning_shown",{new_scope:b,existing_scopes:w,cli:m})}catch{}}}async function ar(a,b="user",c,d){let f="all"===b?"user":b,h=d?.cli&&d.cli.length>0?[...new Set(d.cli)]:["claude"];if(d?.removeCustomHooks){let a=n(f,c);delete a.customPoliciesPath,o(a,f,c),console.log("Custom hooks path cleared.")}if(a&&a.length>0&&(1!==a.length||"all"!==a[0])){ao(a);let e=n(f,c),i=new Set(a),j=e.enabledPolicies.filter(a=>!i.has(a)),k=a.filter(a=>!e.enabledPolicies.includes(a));k.length>0&&console.log(`Warning: policy(ies) not currently enabled: ${k.join(", ")}`);let{policyParams:l,...m}=e,p=l?Object.fromEntries(Object.entries(l).filter(([a])=>!i.has(a))):null;o({...m,enabledPolicies:j,...p&&Object.keys(p).length>0?{policyParams:p}:{}},f,c);try{let c=(0,R.getInstanceId)(),f=a.filter(a=>e.enabledPolicies.includes(a));await ah(c,"hooks_removed",{scope:b,cli:h,removal_mode:d?.betaOnly?"beta_policies":"policies",beta_only:d?.betaOnly??!1,policies_removed:f,removed_count:f.length,...d?.source?{source:d.source}:{},platform:(0,g.platform)(),arch:(0,g.arch)(),os_release:(0,g.release)(),hostname_hash:(0,R.hashToId)((0,g.hostname)())})}catch{}console.log(`Disabled ${a.length-k.length} policy(ies).`),console.log(`Remaining: ${j.length>0?j.join(", "):"(none)"}`);return}let i=n(f,c),j=0,k=!1;for(let a of h){let d=N(a);for(let a of"all"===b?[...d.scopes]:d.scopes.includes(b)?[b]:[]){let f=d.getSettingsPath(a,c);if(!(0,e.existsSync)(f)){"all"!==b&&1===h.length&&(console.log("No settings file found. Nothing to remove."),k=!0);continue}let g=d.removeHooksFromFile(f);if(0===g&&"all"!==b&&1===h.length){console.log("No hooks found in settings. Nothing to remove."),k=!0;continue}j+=g,"all"!==b&&(console.log(`Removed ${g} failproofai hook(s) from ${d.displayName} settings.`),console.log(`Settings: ${f}`))}}if(!k||0!==j){if("all"===b)for(let a of(console.log(`Removed ${j} failproofai hook(s) from all scopes.`),h)){let b=N(a);for(let a of b.scopes)console.log(` ${b.displayName} / ${a}: ${b.getSettingsPath(a,c)}`)}try{let a=(0,R.getInstanceId)();await ah(a,"hooks_removed",{scope:b,cli:h,removal_mode:"hooks",policies_removed:i.enabledPolicies,removed_count:j,...d?.source?{source:d.source}:{},platform:(0,g.platform)(),arch:(0,g.arch)(),os_release:(0,g.release)(),hostname_hash:(0,R.hashToId)((0,g.hostname)())})}catch{}if("all"===b)for(let a of q){let b=n(a,c);if(b.enabledPolicies.length>0||b.customPoliciesPath||b.policyParams){let{customPoliciesPath:d,policyParams:e,...f}=b;o({...f,enabledPolicies:[]},a,c)}}else if(!q.some(a=>ap(a,c))){let{customPoliciesPath:a,policyParams:b,...d}=n(f,c);o({...d,enabledPolicies:[]},f,c)}}}var as=a.i(24282),at=a.i(12714),au=a.i(13095);async function av(a){if(!(0,e.existsSync)(a))return[];let b=await (0,at.readFile)(a,"utf-8"),c=[],d=b.split(/customPolicies\.add\s*\(/);for(let a=1;a<d.length;a++){let b=d[a],e=b.match(/name:\s*["'`]([^"'`]+)["'`]/);if(!e)continue;let f=b.match(/description:\s*["'`]([^"'`]+)["'`]/),g=b.match(/events:\s*\[([^\]]+)\]/),h=g?g[1].replace(/["'`\s]/g,"").split(",").filter(Boolean).join(", "):void 0;c.push({name:e[1],description:f?.[1],eventScope:h})}return c}async function aw(){let a=k(),b=new Set(a.enabledPolicies),c=q.filter(a=>ap(a)),d=an(c[0]??"user"),e=r.map(a=>M[a]).map(a=>({id:a.id,label:(0,as.getCliLabel)(a.id),installed:a.hooksInstalledInSettings("user"),settingsPath:a.getSettingsPath("user"),detected:a.detectInstalled()})),f=Q.BUILTIN_POLICIES.map(c=>{var d;let e,f;return{name:c.name,description:c.description,category:c.category,defaultEnabled:c.defaultEnabled,beta:!!c.beta,enabled:b.has(c.name),eventScope:(d=c.match,e=d.events?.join(", ")??"",f=d.toolNames?` \xb7 ${d.toolNames.join(", ")}`:"",`${e}${f}`),params:c.params?Object.fromEntries(Object.entries(c.params).map(([a,b])=>[a,{type:b.type,description:b.description,default:b.default}])):void 0,currentParams:c.params?a.policyParams?.[c.name]??{}:void 0}}),g=a.customPoliciesPath?await av(a.customPoliciesPath):void 0;return{enabledPolicies:a.enabledPolicies,installedScopes:c,settingsPath:d,clis:e,policies:f,customPoliciesPath:a.customPoliciesPath,customPolicies:g?.length?g:void 0}}async function ax(a,b){let c=k(),d=new Set(c.enabledPolicies);b?d.add(a):d.delete(a),l({...c,enabledPolicies:[...d]});try{let c=(0,R.getInstanceId)();await ah(c,"policy_toggled",{policy_name:a,enabled:b,action:b?"enable":"disable",source:"web"})}catch{}}async function ay(a="user",b){let c=k(),d=c.enabledPolicies.length>0?c.enabledPolicies:Q.BUILTIN_POLICIES.filter(a=>a.defaultEnabled&&!a.beta).map(a=>a.name),e=b&&b.length>0?b:O(),f=e.length>0?e:["claude"];await aq(d,a,void 0,!1,"web",void 0,!1,f)}async function az(a="user",b){let c=b&&b.length>0?b:O(),d=c.length>0?c:["claude"];await ar(void 0,a,void 0,{source:"web",cli:d})}async function aA(a,b){let c=k(),d={...c.policyParams??{},[a]:b};l({...c,policyParams:d});try{let c=(0,R.getInstanceId)();await ah(c,"policy_params_updated",{policy_name:a,param_keys:Object.keys(b),source:"web"})}catch{}}(0,au.ensureServerEntryExports)([aw]),(0,d.registerServerReference)(aw,"00708087d5404066c4f9d2d586440bafe5b9333cae",null),(0,au.ensureServerEntryExports)([ax]),(0,d.registerServerReference)(ax,"601b29648b6535fbf36daa0a0a6cdf45f6681ac2cb",null),(0,au.ensureServerEntryExports)([ay,az]),(0,d.registerServerReference)(ay,"601168df939c9a8eea4a51f3e8cafc420463cb52ed",null),(0,d.registerServerReference)(az,"60b2170026a0d501e3a1d8e213be4b3f7b05e446ad",null),(0,au.ensureServerEntryExports)([aA]),(0,d.registerServerReference)(aA,"605fde05d5c010ffce42bbb77a9d0dc8d178c3ca11",null),a.s([],63895),a.i(63895),a.s(["0016cd42a3ea06312afed8f793ba0f915456e487a8",()=>b.getTelemetryConfig,"00708087d5404066c4f9d2d586440bafe5b9333cae",0,aw,"402bd711c0f802a4cc0ace3e34c1d44ccc7c5490c7",()=>c.getHookActivityAction,"601168df939c9a8eea4a51f3e8cafc420463cb52ed",0,ay,"601b29648b6535fbf36daa0a0a6cdf45f6681ac2cb",0,ax,"6043d6578987ae3b83114f714d1edceadff48f01f3",()=>c.searchHookActivityAction,"605fde05d5c010ffce42bbb77a9d0dc8d178c3ca11",0,aA,"60b2170026a0d501e3a1d8e213be4b3f7b05e446ad",0,az],11369)}];
220
220
 
221
221
  //# sourceMappingURL=%5Broot-of-the-server%5D__1mt35_w._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"0.0.11",description:"The easiest way to manage policies that keep your AI agents reliable, on-task, and running autonomously — for Claude Code & the Agents SDK",bin:{failproofai:"./dist/cli.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",postinstall:"node scripts/postinstall.mjs",preuninstall:"node scripts/preuninstall.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts"},keywords:["claude","claude-code","claude-agents-sdk","anthropic","ai-agent","agent-reliability","agent-monitoring","autonomous-agent","failure-prevention","developer-tools","devtools","cli","local-first","hooks","policies"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.105.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.3","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.1","@types/node":"26.0.0","@types/react":"19.2.17","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1",clsx:"^2.1.1",eslint:"^10.5.0","eslint-config-next":"^16.2.9",jsdom:"^29.1.1","lucide-react":"^1.18.0",next:"^16.2.9",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^4.1.9"},dependencies:{"html-to-image":"^1.11.13",html2canvas:"^1.4.1","posthog-node":"^5.37.1"},overrides:{postcss:"8.5.14","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.28.0"}}},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},36359,69839,79779,a=>{"use strict";let b;var c=a.i(37936),d=a.i(2157),e=a.i(50227),f=a.i(60526),g=a.i(66680);a.i(74533);let h=e.default.join(f.default.homedir(),".failproofai"),i=e.default.join(h,"instance-id");function j(a){return g.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(){if(b)return b;let a=function(){try{for(let a of(f.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=d.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return b=j(a);let c=[f.default.hostname(),f.default.homedir(),f.default.platform(),f.default.arch(),f.default.cpus()[0]?.model??""].join(":");return b=c?j(c):function(){try{let a=d.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=g.default.randomUUID();try{d.default.mkdirSync(h,{recursive:!0}),d.default.writeFileSync(i,a,"utf-8")}catch{}return a}()}a.s(["getInstanceId",0,k,"hashToId",0,j],69839),a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"],79779);var l=a.i(12072);async function m(){let a="1"!==process.env.FAILPROOFAI_TELEMETRY_DISABLED;return{enabled:a,distinctId:a?k():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:l.version}}(0,a.i(13095).ensureServerEntryExports)([m]),(0,c.registerServerReference)(m,"009232c781bf0af8bf91fd755c64ff900e5683e16b",null),a.s(["getTelemetryConfig",0,m],36359)},39027,a=>{"use strict";var b=a.i(36359);a.s([],35268),a.i(35268),a.s(["009232c781bf0af8bf91fd755c64ff900e5683e16b",()=>b.getTelemetryConfig],39027)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__1_g_b3t._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
1
+ module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"0.0.12-beta.0",description:"The easiest way to manage policies that keep your AI agents reliable, on-task, and running autonomously — for Claude Code & the Agents SDK",bin:{failproofai:"./dist/cli.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",postinstall:"node scripts/postinstall.mjs",preuninstall:"node scripts/preuninstall.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts"},keywords:["claude","claude-code","claude-agents-sdk","anthropic","ai-agent","agent-reliability","agent-monitoring","autonomous-agent","failure-prevention","developer-tools","devtools","cli","local-first","hooks","policies"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.110.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.3","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.1","@types/node":"26.1.0","@types/react":"19.2.17","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1",clsx:"^2.1.1",eslint:"^10.5.0","eslint-config-next":"^16.2.9",jsdom:"^29.1.1","lucide-react":"^1.18.0",next:"^16.2.9",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^4.1.9"},dependencies:{"html-to-image":"^1.11.13",html2canvas:"^1.4.1","posthog-node":"^5.37.1"},overrides:{postcss:"8.5.14","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.28.0"}}},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
+ Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},36359,69839,79779,a=>{"use strict";let b;var c=a.i(37936),d=a.i(2157),e=a.i(50227),f=a.i(60526),g=a.i(66680);a.i(74533);let h=e.default.join(f.default.homedir(),".failproofai"),i=e.default.join(h,"instance-id");function j(a){return g.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(){if(b)return b;let a=function(){try{for(let a of(f.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=d.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return b=j(a);let c=[f.default.hostname(),f.default.homedir(),f.default.platform(),f.default.arch(),f.default.cpus()[0]?.model??""].join(":");return b=c?j(c):function(){try{let a=d.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=g.default.randomUUID();try{d.default.mkdirSync(h,{recursive:!0}),d.default.writeFileSync(i,a,"utf-8")}catch{}return a}()}a.s(["getInstanceId",0,k,"hashToId",0,j],69839),a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"],79779);var l=a.i(12072);async function m(){let a="1"!==process.env.FAILPROOFAI_TELEMETRY_DISABLED;return{enabled:a,distinctId:a?k():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:l.version}}(0,a.i(13095).ensureServerEntryExports)([m]),(0,c.registerServerReference)(m,"0016cd42a3ea06312afed8f793ba0f915456e487a8",null),a.s(["getTelemetryConfig",0,m],36359)},39027,a=>{"use strict";var b=a.i(36359);a.s([],35268),a.i(35268),a.s(["0016cd42a3ea06312afed8f793ba0f915456e487a8",()=>b.getTelemetryConfig],39027)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__1_g_b3t._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
3
3
 
4
4
  //# sourceMappingURL=%5Broot-of-the-server%5D__1pcxxwg._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"0.0.11",description:"The easiest way to manage policies that keep your AI agents reliable, on-task, and running autonomously — for Claude Code & the Agents SDK",bin:{failproofai:"./dist/cli.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",postinstall:"node scripts/postinstall.mjs",preuninstall:"node scripts/preuninstall.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts"},keywords:["claude","claude-code","claude-agents-sdk","anthropic","ai-agent","agent-reliability","agent-monitoring","autonomous-agent","failure-prevention","developer-tools","devtools","cli","local-first","hooks","policies"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.105.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.3","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.1","@types/node":"26.0.0","@types/react":"19.2.17","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1",clsx:"^2.1.1",eslint:"^10.5.0","eslint-config-next":"^16.2.9",jsdom:"^29.1.1","lucide-react":"^1.18.0",next:"^16.2.9",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^4.1.9"},dependencies:{"html-to-image":"^1.11.13",html2canvas:"^1.4.1","posthog-node":"^5.37.1"},overrides:{postcss:"8.5.14","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.28.0"}}},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},36359,69839,79779,a=>{"use strict";let b;var c=a.i(37936),d=a.i(2157),e=a.i(50227),f=a.i(60526),g=a.i(66680);a.i(74533);let h=e.default.join(f.default.homedir(),".failproofai"),i=e.default.join(h,"instance-id");function j(a){return g.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(){if(b)return b;let a=function(){try{for(let a of(f.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=d.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return b=j(a);let c=[f.default.hostname(),f.default.homedir(),f.default.platform(),f.default.arch(),f.default.cpus()[0]?.model??""].join(":");return b=c?j(c):function(){try{let a=d.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=g.default.randomUUID();try{d.default.mkdirSync(h,{recursive:!0}),d.default.writeFileSync(i,a,"utf-8")}catch{}return a}()}a.s(["getInstanceId",0,k,"hashToId",0,j],69839),a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"],79779);var l=a.i(12072);async function m(){let a="1"!==process.env.FAILPROOFAI_TELEMETRY_DISABLED;return{enabled:a,distinctId:a?k():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:l.version}}(0,a.i(13095).ensureServerEntryExports)([m]),(0,c.registerServerReference)(m,"009232c781bf0af8bf91fd755c64ff900e5683e16b",null),a.s(["getTelemetryConfig",0,m],36359)},15501,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(60526);function e(){return(0,c.join)((0,d.homedir)(),".failproofai","audit-dashboard.json")}a.i(66680),a.s(["readDashboardCache",0,function(){let a=e();if(!(0,b.existsSync)(a))return null;try{let c=(0,b.readFileSync)(a,"utf-8"),d=JSON.parse(c);if(!d||"object"!=typeof d||"string"!=typeof d.cachedAt||!d.params||"object"!=typeof d.params||!d.result||"object"!=typeof d.result||2!==d.schemaVersion||function(a,b=30){let c=new Date(a).getTime();return!!Number.isNaN(c)||Date.now()-c>6e4*b}(d.cachedAt,10080))return null;return d}catch{return null}},"readDashboardCacheMeta",0,function(){let a=e();if(!(0,b.existsSync)(a))return null;try{let c=(0,b.readFileSync)(a,"utf-8"),d=JSON.parse(c);if(!d||2!==d.schemaVersion||"string"!=typeof d.cachedAt||Number.isNaN(new Date(d.cachedAt).getTime()))return null;return{cachedAt:d.cachedAt}}catch{return null}}],15501)},99558,a=>{"use strict";var b=a.i(36359),c=a.i(37936),d=a.i(15501);async function e(){let a=(0,d.readDashboardCache)();if(!a){let a=(0,d.readDashboardCacheMeta)();return{status:"empty",expired:null!==a,expiredAt:a?.cachedAt??null}}return{status:"cached",cachedAt:a.cachedAt,params:a.params,result:a.result}}(0,a.i(13095).ensureServerEntryExports)([e]),(0,c.registerServerReference)(e,"00a03241766e25ac352e091de97d2af4fa75b29699",null),a.s([],62946),a.i(62946),a.s(["009232c781bf0af8bf91fd755c64ff900e5683e16b",()=>b.getTelemetryConfig,"00a03241766e25ac352e091de97d2af4fa75b29699",0,e],99558)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__1_g_b3t._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
1
+ module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},12072,(a,b,c)=>{b.exports={name:"failproofai",version:"0.0.12-beta.0",description:"The easiest way to manage policies that keep your AI agents reliable, on-task, and running autonomously — for Claude Code & the Agents SDK",bin:{failproofai:"./dist/cli.mjs"},files:["bin/","src/","scripts/","lib/","pi-extension/",".next/standalone/","dist/","README.md"],engines:{node:">=20.9.0",bun:">=1.3.0"},scripts:{predev:"bun run build:cli && bun link",dev:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020","build:cli":"bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"",build:"bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\" && node scripts/prune-standalone.mjs",prestart:"bun run build:cli && bun link",start:"FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",test:"vitest","test:run":"vitest run",lint:"eslint . --config eslint.config.mjs",postinstall:"node scripts/postinstall.mjs",preuninstall:"node scripts/preuninstall.mjs",prepare:"bun run build","test:e2e":"vitest run --config vitest.config.e2e.mts","test:e2e:watch":"vitest --config vitest.config.e2e.mts",translate:"bun scripts/translate-docs/cli.ts","translate:readme":"bun scripts/translate-docs/cli.ts --readme-only","translate:docs":"bun scripts/translate-docs/cli.ts --docs-only","translate:dry-run":"bun scripts/translate-docs/cli.ts --dry-run","translate:validate":"bun scripts/translate-docs/cli.ts --validate","validate:mdx":"bun scripts/validate-mdx.ts"},keywords:["claude","claude-code","claude-agents-sdk","anthropic","ai-agent","agent-reliability","agent-monitoring","autonomous-agent","failure-prevention","developer-tools","devtools","cli","local-first","hooks","policies"],author:"ExosphereHost Inc. <failproofai@exosphere.host>",license:"SEE LICENSE IN LICENSE",homepage:"https://github.com/FailproofAI/failproofai",repository:{type:"git",url:"https://github.com/FailproofAI/failproofai.git"},bugs:{url:"https://github.com/FailproofAI/failproofai/issues"},publishConfig:{access:"public"},devDependencies:{"@anthropic-ai/sdk":"^0.110.0","@mdx-js/mdx":"^3.1.1","@tailwindcss/postcss":"^4.3.1","@tanstack/react-virtual":"^3.14.3","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@testing-library/user-event":"^14.6.1","@types/node":"26.1.0","@types/react":"19.2.17","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1",clsx:"^2.1.1",eslint:"^10.5.0","eslint-config-next":"^16.2.9",jsdom:"^29.1.1","lucide-react":"^1.18.0",next:"^16.2.9",react:"^19.2.4","react-dom":"^19.2.4","tailwind-merge":"^3.4.0",tailwindcss:"^4.3.1",typescript:"6.0.3",vitest:"^4.1.9"},dependencies:{"html-to-image":"^1.11.13",html2canvas:"^1.4.1","posthog-node":"^5.37.1"},overrides:{postcss:"8.5.14","eslint-plugin-react-hooks":"7.0.1",vite:"8.0.16",undici:"7.28.0"}}},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
+ Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},36359,69839,79779,a=>{"use strict";let b;var c=a.i(37936),d=a.i(2157),e=a.i(50227),f=a.i(60526),g=a.i(66680);a.i(74533);let h=e.default.join(f.default.homedir(),".failproofai"),i=e.default.join(h,"instance-id");function j(a){return g.default.createHmac("sha256","failproofai-telemetry-v1").update(a).digest("hex")}function k(){if(b)return b;let a=function(){try{for(let a of(f.default.platform(),["/etc/machine-id","/var/lib/dbus/machine-id"]))try{let b=d.default.readFileSync(a,"utf-8").trim();if(b)return b}catch{}}catch{}}();if(a)return b=j(a);let c=[f.default.hostname(),f.default.homedir(),f.default.platform(),f.default.arch(),f.default.cpus()[0]?.model??""].join(":");return b=c?j(c):function(){try{let a=d.default.readFileSync(i,"utf-8").trim();if(a)return a}catch{}let a=g.default.randomUUID();try{d.default.mkdirSync(h,{recursive:!0}),d.default.writeFileSync(i,a,"utf-8")}catch{}return a}()}a.s(["getInstanceId",0,k,"hashToId",0,j],69839),a.s(["POSTHOG_API_KEY",0,"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX","POSTHOG_PRODUCT",0,"failproofai-oss"],79779);var l=a.i(12072);async function m(){let a="1"!==process.env.FAILPROOFAI_TELEMETRY_DISABLED;return{enabled:a,distinctId:a?k():"",apiKey:process.env.FAILPROOFAI_POSTHOG_KEY??"phc_Ac1Ww1GqKc0z1SyrRWbmatEeQdlOQIsDEEdP8l8JRgX",host:process.env.FAILPROOFAI_POSTHOG_HOST??"https://us.i.posthog.com",version:l.version}}(0,a.i(13095).ensureServerEntryExports)([m]),(0,c.registerServerReference)(m,"0016cd42a3ea06312afed8f793ba0f915456e487a8",null),a.s(["getTelemetryConfig",0,m],36359)},15501,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(60526);function e(){return(0,c.join)((0,d.homedir)(),".failproofai","audit-dashboard.json")}a.i(66680),a.s(["readDashboardCache",0,function(){let a=e();if(!(0,b.existsSync)(a))return null;try{let c=(0,b.readFileSync)(a,"utf-8"),d=JSON.parse(c);if(!d||"object"!=typeof d||"string"!=typeof d.cachedAt||!d.params||"object"!=typeof d.params||!d.result||"object"!=typeof d.result||2!==d.schemaVersion||function(a,b=30){let c=new Date(a).getTime();return!!Number.isNaN(c)||Date.now()-c>6e4*b}(d.cachedAt,10080))return null;return d}catch{return null}},"readDashboardCacheMeta",0,function(){let a=e();if(!(0,b.existsSync)(a))return null;try{let c=(0,b.readFileSync)(a,"utf-8"),d=JSON.parse(c);if(!d||2!==d.schemaVersion||"string"!=typeof d.cachedAt||Number.isNaN(new Date(d.cachedAt).getTime()))return null;return{cachedAt:d.cachedAt}}catch{return null}}],15501)},99558,a=>{"use strict";var b=a.i(36359),c=a.i(37936),d=a.i(15501);async function e(){let a=(0,d.readDashboardCache)();if(!a){let a=(0,d.readDashboardCacheMeta)();return{status:"empty",expired:null!==a,expiredAt:a?.cachedAt??null}}return{status:"cached",cachedAt:a.cachedAt,params:a.params,result:a.result}}(0,a.i(13095).ensureServerEntryExports)([e]),(0,c.registerServerReference)(e,"0026005e58c50a106e9c8f47efca5a25418eb94f07",null),a.s([],62946),a.i(62946),a.s(["0016cd42a3ea06312afed8f793ba0f915456e487a8",()=>b.getTelemetryConfig,"0026005e58c50a106e9c8f47efca5a25418eb94f07",0,e],99558)},2726,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__1_g_b3t._.js","server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js"].map(b=>a.l(b))).then(()=>b(74493)))}];
3
3
 
4
4
  //# sourceMappingURL=%5Broot-of-the-server%5D__1uvfwgr._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[80311,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5050);let e=(0,d.createServerReference)("00a03241766e25ac352e091de97d2af4fa75b29699",d.callServer,void 0,d.findSourceMapURL,"getAuditResultAction");function f(a){let b=5381;for(let c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)|0;return b>>>0}let g=["cowboy","explorer","ghost","optimist","hammer","architect"],h=["cowboy","explorer","ghost","optimist","hammer"],i=new Set(["reread-after-edit","redundant-cd-cwd"]),j={"block-rm-rf":{archetype:"cowboy",weight:2},"block-failproofai-commands":{archetype:"cowboy",weight:2},"block-sudo":{archetype:"cowboy",weight:1.5},"block-curl-pipe-sh":{archetype:"cowboy",weight:1.5},"block-force-push":{archetype:"cowboy",weight:1.5},"block-push-master":{archetype:"cowboy",weight:1.5},"block-work-on-main":{archetype:"cowboy",weight:1.2},"warn-destructive-sql":{archetype:"cowboy",weight:1.5},"warn-schema-alteration":{archetype:"cowboy",weight:1},"git-commit-no-verify":{archetype:"cowboy",weight:1.5},"warn-git-amend":{archetype:"cowboy",weight:.8},"warn-git-stash-drop":{archetype:"cowboy",weight:1},"warn-all-files-staged":{archetype:"cowboy",weight:.6},"block-kubectl":{archetype:"cowboy",weight:1.5},"block-terraform":{archetype:"cowboy",weight:1.5},"block-helm":{archetype:"cowboy",weight:1.2},"block-aws-cli":{archetype:"cowboy",weight:1.2},"block-gcloud":{archetype:"cowboy",weight:1.2},"block-az-cli":{archetype:"cowboy",weight:1.2},"block-gh-pipeline":{archetype:"cowboy",weight:1.2},"sanitize-private-key-content":{archetype:"explorer",weight:1.5},"block-env-files":{archetype:"explorer",weight:1.5},"block-secrets-write":{archetype:"explorer",weight:1.5},"sanitize-api-keys":{archetype:"explorer",weight:1.2},"sanitize-jwt":{archetype:"explorer",weight:1.2},"sanitize-connection-strings":{archetype:"explorer",weight:1.2},"sanitize-bearer-tokens":{archetype:"explorer",weight:1},"protect-env-vars":{archetype:"explorer",weight:1},"find-from-root":{archetype:"explorer",weight:1},"require-ci-green-before-stop":{archetype:"ghost",weight:1.2},"require-commit-before-stop":{archetype:"ghost",weight:1.2},"require-push-before-stop":{archetype:"ghost",weight:1},"require-pr-before-stop":{archetype:"ghost",weight:1},"require-no-conflicts-before-stop":{archetype:"ghost",weight:1},"warn-large-file-write":{archetype:"ghost",weight:1},"warn-background-process":{archetype:"ghost",weight:.8},"warn-package-publish":{archetype:"optimist",weight:1},"warn-global-package-install":{archetype:"optimist",weight:.8},"prefer-package-manager":{archetype:"optimist",weight:.8},"prefer-edit-over-sed-awk":{archetype:"optimist",weight:.8},"prefer-edit-over-read-cat":{archetype:"optimist",weight:.5},"prefer-write-over-heredoc":{archetype:"optimist",weight:.5},"warn-repeated-tool-calls":{archetype:"hammer",weight:1.5},"sleep-polling-loop":{archetype:"hammer",weight:1.2},"reread-after-edit":{archetype:"architect",weight:1},"redundant-cd-cwd":{archetype:"architect",weight:.8}};function k(){return{optimist:0,cowboy:0,explorer:0,goldfish:0,architect:0,precision:0,hammer:0,ghost:0}}let l={explorer:.38,architect:.33,hammer:.11,cowboy:.11,optimist:.07,ghost:.01,precision:0,goldfish:0},m=(()=>{let a=k();for(let b of g)a[b]=Math.max(l[b],.05);return a})(),n={optimist:{key:"optimist",index:"01",name:"the optimist",taglines:["ships fast. retries with conviction. occasionally forgets it was already there.","moves first, reads later. every failure is just step one of the next attempt.","the floor is hope. the ceiling is also hope. there is no diagnosis in between.","if at first you don't succeed — try the exact same thing, with more energy.","writes confident code. burns confident tokens. neither knows the difference.","speed is a feature. so is the directory it's already in."],keywordSets:[["pace","conviction","forgetful"],["fast","trusting","redundant"],["eager","looping","stateful"],["bold","unblocked","drifty"],["forward","hopeful","wasteful"],["shipper","retrier","doubler"]],descriptions:["moves at pace. doesn't second-guess itself — which is mostly a feature. when something fails, it tries again: same args, same hope. when uncertain about its location, it prepends the directory anyway. just in case. the optimism is earned. this agent gets things done. it just occasionally burns tokens proving it.","ships first, asks questions never. the optimist is the agent that always has momentum — which is exactly the problem. cwd assumptions stack up. retries pile up. the work gets done. it's just twice as expensive as it needed to be.","high trust in its own state model. low evidence that the model is correct. when things go sideways, the optimist's first move is to re-run the same call with the same args and a renewed sense of conviction. mostly it's right. when it's wrong, it's wrong loudly.","the optimist treats every error as a transient. cd before every command, just in case. prepend the absolute path, just in case. retry on any non-zero exit, just in case. the just-in-case tax is real. so is the velocity."],signatures:[[{arrow:"→",body:"cd /Users/n/blrnow/api &&",comment:" # (already here)"},{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT × 6"},{arrow:"→",body:"retries: 6. diagnosis: 0."}],[{arrow:"→",body:"cd /Users/n/proj &&",comment:" # cwd already /Users/n/proj"},{arrow:"→",body:"cd /Users/n/proj && ls"},{arrow:"→",body:"cd /Users/n/proj && cat package.json"}],[{arrow:"→",body:"npm install",err:" → ETIMEDOUT"},{arrow:"→",body:"npm install",err:" → ETIMEDOUT"},{arrow:"→",body:"npm install",comment:" # third time's the charm"}],[{arrow:"→",body:'cat "package.json" | head',comment:" # ← read 1"},{arrow:"→",body:'cat "package.json"',comment:" # ← read 2"},{comment:"# could've been one Read tool call."}]],commons:["fast-iteration solo projects, early-stage prototypes, builders who ship daily","weekend hacks, hackathon repos, side-projects under active push","early-stage codebases without a strong test harness yet","agents given task framing without explicit success criteria","loose-context sessions where exact cwd state is ambiguous"],risks:["token waste, retry spirals, stale state assumptions","redundant cd's, repeated reads, retries without diagnosis","false confidence in cwd, doubled-up shell setup, idle loops","rate-limit hits from blind retries on transient failures","context bloat from re-reading the same files three different ways"],closings:["the optimism is a feature. the waste is not.","ship fast. retry less.","energy is good. diagnosis is better.","momentum keeps. the second cd does not.","trust the work. verify the state."],secondary:"explorer"},cowboy:{key:"cowboy",index:"02",name:"the cowboy",taglines:["asks for forgiveness, not permission. git push --force is a philosophy.","your branch protection rules are the only thing between this agent and prod.","fast hands, faster history rewrites. the audit log is for other people.","high trust in its own judgment. low patience for code review.","main is just a branch. branch protection is just a suggestion. ship.","ships hot. reverts later. occasionally needs an adult in the room."],keywordSets:[["bold","forceful","ungoverned"],["direct","destructive","swift"],["fearless","reckless","loud"],["assertive","loose","unblocked"],["confident","skipping","main-bound"],["sudo-curious","force-prone","fast"]],descriptions:["high output. low ceremony. the cowboy gets code onto main faster than anyone — and your branch protection rules are the only thing standing between this agent and your production database. not reckless. just confident. in a way that requires guardrails.","doesn't see commits. sees a delivery mechanism. force-pushes when history is inconvenient. drops into main when feature branches feel slow. the cowboy is the agent every team accidentally creates, and every team eventually wants policies for.","the velocity is unmatched. the blast radius is also unmatched. this agent will solve your problem and rewrite three years of git history while it's at it. not malicious. just allergic to friction.","treats every guardrail as a temporary obstacle. sudo here, --no-verify there, a quick rm -rf to clean up. it's getting work done — by sidestepping every check that might slow it down."],signatures:[[{arrow:"→",body:"git push origin main --force"},{arrow:"!",body:"remote: branch protection rule",comment:" # caught it"},{arrow:"→",body:"git push origin HEAD:main",err:" # non-fast-forward, again."}],[{arrow:"→",body:"rm -rf ./node_modules && rm -rf ./dist"},{arrow:"→",body:'git commit -am "wip" --no-verify'},{arrow:"→",body:"git push --force-with-lease"}],[{arrow:"→",body:"sudo systemctl restart postgres"},{arrow:"→",body:"kubectl delete pod api-prod-7f4 --grace-period=0"},{arrow:"→",body:'echo "should be fine"'}],[{arrow:"→",body:"git checkout main && git merge feature --ff-only"},{arrow:"!",body:"merge would fail"},{arrow:"→",body:"git reset --hard feature && git push"}]],commons:["solo repos, weekend projects, founders writing their own infra","agents with broad shell access and no PR-gating workflow","early-stage product code where speed > governance","ops scripts, one-off migrations, cleanup tasks","sandboxes that look like production until they aren't"],risks:["branch protection bypass, accidental main commits, revert overhead","destructive shell operations, unrecoverable state changes","force-pushed history, lost commits, irreproducible deploys","sudo escalations, container blast radius, infra mutations without rollback plan","policy bypass via --no-verify, --force, and friends"],closings:["the pace is real. the risk is too.","speed is a feature. guardrails are not optional.","ship hot. revert clean.","a fast agent without policies is a fast incident.","confidence is fine. consent is better."],secondary:"hammer"},explorer:{key:"explorer",index:"03",name:"the explorer",taglines:["technically brilliant. occasionally reads your ~/.aws/credentials while doing it.","follows every reference. opens every neighbor. some neighbors aren't yours.","thorough to a fault. the fault is usually a .env file two directories up.","knows the codebase deeply. knows your secrets drawer almost as well.","wide-context by default. wide-context isn't always free.","great at maps. less great at fences."],keywordSets:[["curious","thorough","leaky"],["wide","deep","drifting"],["mapping","tracing","boundary-blind"],["broad","diligent","porous"],["thinking","wandering","exposing"],["research-mode","context-hungry","secret-adjacent"]],descriptions:["curious by nature. reads broadly, thinks laterally, sometimes follows a symlink somewhere it wasn't meant to go. this isn't malice — it's thoroughness that hasn't learned boundaries yet. the explorer builds great things. it just occasionally needs someone to close the door to the secrets drawer.","the explorer treats every file path as part of the working context. ~/.aws/credentials is just another config file to it. ../other-repo/.env is just one more reference. the work is genuinely better-informed because of this. the credentials are also genuinely in the context window.","no malice. no shortcuts. just a thoroughness that follows references straight through your boundary fence. great research instincts. needs explicit walls.","broad-context is a feature in this agent. it's also why your private keys show up in a chat log every two weeks. the curiosity is good. the perimeter needs help."],signatures:[[{arrow:"→",body:"cat /Users/n/.aws/credentials"},{arrow:"→",body:"cat ../other-repo/.env"},{arrow:"→",body:"cat ~/.config/openai/key"}],[{arrow:"→",body:'find / -name "*.env" 2>/dev/null',comment:" # full-FS scan"},{arrow:"→",body:'grep -r "AKIA" /Users/n/'},{arrow:"→",body:'cat "$(find ~ -name credentials -print -quit)"'}],[{arrow:"→",body:"ls ~/.ssh/"},{arrow:"→",body:"cat ~/.ssh/config"},{arrow:"→",body:"cat ~/.ssh/id_rsa",comment:" # for context"}],[{arrow:"→",body:"open ../sibling-project"},{arrow:"→",body:"git log --all --source ../sibling-project"},{arrow:"→",body:"cat ../sibling-project/.env.production"}]],commons:["multi-project setups, agents with broad file access, complex monorepos","research-style work — debugging, refactoring, cross-repo investigations","macOS / linux dev boxes with shared credential directories","agents without explicit cwd-restriction policies","long-running sessions where context tends to drift outward"],risks:["credential exposure, unintended cross-project reads, secrets landing in context",".env file leaks, AWS / OpenAI / GCP key exfiltration through chat logs","neighboring-repo bleed, business-secret cross-contamination","global filesystem scans that surface sensitive paths","broad reads that quietly inflate context window with private data"],closings:["the curiosity stays. the credentials stay private.","wide is fine. wide-and-outside-the-fence is not.","thorough is a feature. perimeter is a setting.","research deep. boundary clean.","knows everything. shares nothing it shouldn't."],secondary:"architect"},goldfish:{key:"goldfish",index:"04",name:"the goldfish",taglines:["long sessions, short memory. every turn is a fresh start. some turns are a little too fresh.","great at the first 40 turns. inventive for the next 40.","past 80% context, history becomes a draft.","remembers the task. forgets which file the task was in.","ambitious. earnest. quietly making things up around turn 50.","long-context vibes. short-context recall."],keywordSets:[["ambitious","drifting","inventive"],["sprawling","creative","post-cache"],["long-running","hallucinatory","well-meaning"],["earnest","context-full","fabricating"],["sustained","forgetful","confabulating"],["marathon","drifted","compounding"]],descriptions:["great at long tasks. not great at remembering which long task it's on. past 80% context, the goldfish starts inventing history — citing files it never opened, referencing edits it never made. not lying. just filling gaps with confidence. the longer the session, the more creative the memory.","the goldfish is what every agent looks like after turn 50. confident about prior work it didn't do. mistakenly sure of file contents it never read. the work it actually delivered is real. the context around it is increasingly fictional.","ambition outlasts recall. once context fills, the goldfish smooths over gaps with plausible inventions: a fake earlier edit, a misremembered file path, a hallucinated test that passed. it's never trying to mislead. it just doesn't always know what's true anymore.","long-task specialist with a memory ceiling. the work compounds beautifully until it doesn't, and then it compounds wrongly. needs session breaks more than it needs encouragement."],signatures:[[{comment:"# turn 47/52 — ctx 82% full"},{comment:'# agent: "as we saw earlier in auth.ts…"'},{comment:"# auth.ts was never opened this session."}],[{comment:"# turn 63 — context 91%"},{arrow:"→",body:'apply_edit("src/auth.ts", { ... })'},{comment:'# agent: "reverting my earlier change." # there was no earlier change.'}],[{comment:"# turn 51 — fabricated test reference"},{arrow:"→",body:'run("npm test src/auth.test.ts")',err:" → no such file"},{comment:'# agent: "the test we wrote earlier." # no such test exists.'}],[{comment:"# session-time 3h 14m"},{comment:"# context: 88% — auto-compress in 4 turns"},{comment:"# next plan cites 3 files only one of which exists."}]],commons:["long-running refactor sessions, complex multi-file tasks, agents without session breaks","auto-driven coding loops with no human turn between iterations","tasks that span hours or days without explicit memory checkpoints","open-ended migrations and refactors with diffuse success criteria","scripted swarms where each agent inherits a long prior transcript"],risks:["context drift, hallucinated prior work, compounding errors in long sessions","fabricated file references, invented function signatures, ghost edits","tests cited that don't exist, edits remembered that didn't happen","confident misstatements compounding into wrong-architecture deliverables","auto-compression discarding the load-bearing details and keeping the noise"],closings:["the ambition is good. the context budget is not.","remember less. checkpoint more.","long is fine. drifted is expensive.","ambition is welcome. invention is not.","fresh sessions beat creative ones."],secondary:"optimist"},architect:{key:"architect",index:"05",name:"the paranoid architect",taglines:["has never shipped a bug it didn't catch first. also hasn't shipped since tuesday.","reads the same file from two different paths. just to be sure.","verifies twice, edits maybe.","safest agent in the room. also the one nobody waits for.","would rather diagnose for an hour than retry for a second.","extremely careful. extremely slow. extremely correct."],keywordSets:[["methodical","safe","slow"],["thorough","verifying","circular"],["careful","patient","redundant"],["double-checking","guarded","deliberate"],["safety-first","loop-prone","anchored"],["measured","audited","looping"]],descriptions:["methodical. thorough. reads the same file from two different paths, just to be sure. verifies before every write. double-checks the package.json before running anything. the paranoid architect rarely makes mistakes — because it rarely finishes fast enough to make them. your safest agent. your slowest agent.","safety is the architect's love language. read the file. re-read it from a different path. verify the cwd. check the lockfile. run the test before writing. run it again after. the work is correct. the work is also six times more expensive than it had to be.","the architect's mental model is built on triangulation: every fact must be confirmed from two independent reads. when it works, you ship near-zero bugs. when it doesn't, you ship near-zero features.","extremely careful. extremely slow. extremely correct. the architect rarely makes mistakes — but it also rarely makes deadlines. the safety is genuine; so is the cost."],signatures:[[{arrow:"→",body:'read_file("src/api/router.ts")',comment:" # read 1"},{arrow:"→",body:'read_file("./src/api/router.ts")',comment:" # read 2"},{arrow:"→",body:"ls src/api/",comment:" # just confirming"}],[{arrow:"→",body:'read_file("package.json")'},{arrow:"→",body:'read_file("./package.json")'},{arrow:"→",body:"cat package.json | jq .scripts",comment:" # one more time"}],[{arrow:"→",body:"git status",comment:" # check 1"},{arrow:"→",body:"git status --short",comment:" # check 2"},{arrow:"→",body:"git diff --stat",comment:" # check 3"}],[{arrow:"→",body:'apply_edit("src/foo.ts", { ... })'},{arrow:"→",body:'read_file("src/foo.ts")',comment:" # verifying the edit landed"},{arrow:"→",body:'read_file("src/foo.ts")',comment:" # again, just to be sure"}]],commons:["production systems, high-stakes codebases, builders with strong safety instincts","regulated codebases (fin / med / compliance) where bugs are expensive","teams burned by past prod incidents that hardened review norms","agents instructed with strong 'verify everything' system prompts","post-incident codebases recovering from a recent outage"],risks:["token overhead, slow sessions, redundant verification loops","verification cycles that eat 3× the budget of the actual change","stalled progress on otherwise routine edits","checkpoint loops that read the same file 6 times in a row","over-caution masking simple problems behind ceremony"],closings:["safety is a feature. so is finishing.","double-check is fine. quadruple-check is not.","careful is good. moving is also good.","rigor wins. rigor twice is just slower.","verify once. ship once."],secondary:"precision"},precision:{key:"precision",index:"06",name:"the precision builder",taglines:["in. done. out. your agent doesn't linger.","small footprint. right calls. correct exits.","few findings isn't no findings. but it's close.","the rhythm is dialed in. the rest is iteration.","every call is intentional. every session ends cleanly.","minimal noise. maximum signal. occasional smugness."],keywordSets:[["clean","focused","minimal"],["surgical","tight","deliberate"],["disciplined","concise","intentional"],["measured","exact","trim"],["calibrated","small-radius","complete"],["dialed-in","right-sized","low-noise"]],descriptions:["minimal footprint. focused calls. gets in, does the work, gets out. the precision builder is what every agent aspires to be — and what most agents aren't yet. few findings don't mean no findings. but it means your agent has found its rhythm. the gap between here and s-tier is smaller than you think.","tight loops. correct tools. clean exits. the precision builder treats each tool call like it has a budget — because it does. nothing redundant. nothing wasteful. when this agent finishes, the work is done and the transcript is short.","this is what every agent aspires to be. surgical reads. matched edits. test runs that actually verify the right thing. precision is rare. when you see it, you've earned it.","minimal blast radius. minimal token waste. minimal surprises. the precision builder is what your agent looks like after enough iteration loops. respect."],signatures:[[{arrow:"→",body:"clean tool calls. right paths, right args."},{arrow:"→",body:"sessions end when the task ends."},{arrow:"→",body:"no redundant reads. no retry storms."}],[{arrow:"→",body:'read_file("src/foo.ts")',comment:" # one read"},{arrow:"→",body:'apply_edit("src/foo.ts", { ... })',comment:" # one edit"},{arrow:"→",body:'run("bun test src/foo.test.ts")',comment:" # green ✓"}],[{arrow:"→",body:"git status"},{arrow:"→",body:'git add -p && git commit -m "fix: ..."'},{arrow:"→",body:"git push",comment:" # session done."}],[{arrow:"→",body:'grep -rn "useFoo" src/'},{arrow:"→",body:'apply_edit("src/hooks/use-foo.ts")'},{arrow:"→",body:'run("bun test")',comment:" # all green."}]],commons:["mature agents, heavily policy-enforced setups, builders who've iterated for a while","teams running failproofai for ≥ a week with policies tuned","experienced operators who curate their tool list and CLI flags","codebases with strong test coverage that reward intentional edits","agents kept on a tight cwd-restricted leash"],risks:["low finding count can mask edge cases that haven't surfaced yet","narrow scope might be hiding work the agent isn't being asked to do","small-radius work can plateau before it surfaces deeper issues","few findings can read as 'untested' rather than 'safe'","complacency — the rhythm works until the task shape changes"],closings:["rare. keep it that way.","few findings. real signal. respect.","this is the rhythm. don't break it.","minimal is hard-earned. defend it.","you're already past the agent learning curve."],secondary:"ghost"},hammer:{key:"hammer",index:"07",name:"the hammer",taglines:["when something doesn't work, it tries the exact same thing again. harder.","diagnosis-light. repetition-heavy. mostly burns tokens with conviction.","the first call failed. so did the next six. the seventh probably won't.","no diagnosis, no backoff, no arg change. just the same call, louder.","the failure mode is not learning. the failure mode is also the strategy.","every retry is identical. every retry is also confident."],keywordSets:[["determined","repetitive","unbacked"],["looping","stubborn","unblocked"],["unchanging","burning","convicted"],["sticky","spiraling","diagnosis-free"],["repeated","uncorrected","headstrong"],["unchanged-args","no-backoff","patient-failure"]],descriptions:["determined. possibly to a fault. the hammer's first response to failure is repetition. no diagnosis, no arg change, no backoff. just the same call, six times, under 90 seconds, with conviction. occasionally works. mostly burns tokens and stalls the session. needs a budget more than it needs encouragement.","the hammer treats every transient as a signal-to-retry. it never widens the search, never alters the args, never escalates. just runs the same failing call until either the call starts working or someone notices the session has stalled.","the diagnosis instinct is missing. when something fails, the hammer's first move is to repeat. when that fails too, it's to repeat. and again. eventually it works, or eventually the session gets killed. either way, the model is unchanged.","high persistence. low introspection. the hammer is what your agent becomes when you don't give it a budget — or a reason to think differently between attempts."],signatures:[[{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT"},{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT"},{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT"},{comment:"# 6× total. file is at src/router.ts."}],[{arrow:"→",body:'run("bun test")',err:" → exit 1"},{arrow:"→",body:'run("bun test")',err:" → exit 1"},{arrow:"→",body:'run("bun test")',err:" → exit 1"},{comment:"# same args. same failure. four more attempts queued."}],[{arrow:"→",body:'sleep 1; pgrep -f "build"'},{arrow:"→",body:'sleep 1; pgrep -f "build"'},{arrow:"→",body:'sleep 1; pgrep -f "build"'},{comment:"# polling loop. no timeout, no break condition."}],[{arrow:"→",body:"curl https://api.example.com/v1/foo",err:" → 502"},{arrow:"→",body:"curl https://api.example.com/v1/foo",err:" → 502"},{arrow:"→",body:"curl https://api.example.com/v1/foo",err:" → 502"},{comment:"# no backoff. no jitter. no API status check."}]],commons:["agents without failure-handling policies, complex directory structures, ambiguous task framing","tasks where the agent doesn't have an obvious 'try-another-angle' move","transient-failure scenarios (rate limits, flaky tests, network blips)","agents without a per-task retry budget","tool-call patterns where the args themselves are the problem"],risks:["token spirals, stalled sessions, no diagnostic signal ever surfaces","rate-limit overruns, API ban-risk, infinite poll loops","wasted minutes on retries when one diff would have fixed it","transient errors mistaken for permanent ones (and vice versa)","no learning between attempts — same outcome, more cost"],closings:["the conviction is good. the diagnosis is missing.","retry less. think more.","harder isn't a strategy. different is.","stop. read the error. then try again.","the loop is the bug."],secondary:"optimist"},ghost:{key:"ghost",index:"08",name:"the ghost",taglines:["moves fast, leaves little trace. sometimes leaves a little too little trace.","writes the file. doesn't verify the write. trusts the silence.","completion ceremony? skipped. exits ceremony? also skipped.","the work probably worked. probably.","edits land. tests don't run. nothing checks the result.","efficient. quiet. occasionally lies to itself about success."],keywordSets:[["efficient","quiet","unverified"],["clean","trusting","skip-the-check"],["fast","silent","uncommitted"],["light-touch","trust-the-write","no-test"],["minimal","exit-fast","audit-light"],["smooth","untraced","unconfirmed"]],descriptions:["efficient. clean. doesn't hang around. the ghost completes tasks with minimal overhead — no redundant reads, no retry storms, no boundary drift. the risk is quiet: it doesn't always check that things worked. the build passes. or it looks like it does. the ghost trusts its own output more than it should.","the ghost ships and exits. no verification loop. no test run. no read-after-write. the work is probably correct. probably. you'll find out next session — or when CI does, on someone else's screen.","no waste. no noise. no proof. the ghost writes the file, declares success, and moves on. when it's right, you've got a clean session. when it's wrong, you don't find out until the next deploy.","trusts the diff. trusts the toolchain. trusts the silence after a write. the ghost is the precision builder with one missing step: the verification at the end."],signatures:[[{arrow:"→",body:'write_file("src/api/router.ts")',comment:" # done"},{comment:"→ [no read_file to verify]"},{comment:"→ [no test run after write]"},{comment:"# task complete. # maybe."}],[{arrow:"→",body:'apply_edit("src/auth.ts", { ... })'},{comment:"→ [no test run]"},{comment:"→ [stop event fired with uncommitted changes]"}],[{arrow:"→",body:'write_file("config/prod.json", "{...}")'},{comment:"# no schema check, no lint, no diff review"},{comment:"→ session ends."}],[{arrow:"→",body:"git merge feature-branch"},{arrow:"!",body:"merge conflicts: 3 files"},{comment:"→ stop event with conflicts unresolved."}]],commons:["fast-moving solo projects, low-constraint setups, minimal oversight workflows","side projects where the cost of a missed bug is low","agents without 'require-tests-before-stop' style policies","monorepos where the test command is non-obvious","sessions auto-ended on success without an explicit verification step"],risks:["silent failures, unverified writes, false completion signals","uncommitted changes left on the floor, stop events firing dirty","missing test runs masking regressions until CI","merge conflicts left unresolved across session boundaries","PR-less work that's never reviewed before deploy"],closings:["fast is good. verified-fast is better.","ship. then check.","writes are a bet. verify it.","silent success isn't a signal. green tests are.","trust your toolchain. confirm with proof."],secondary:"precision"}},o={optimist:["........","...p....","..p.p...",".p...p..","p.....p.","..ooo...","..o.o...",".oo.oo.."],cowboy:["..pppp..",".p....p.","p..pp..p","pppppppp","..o..o..","..o..o..",".oo..oo.","........"],explorer:["..pppp..",".p.gg.p.","p.g..g.p","p.g..g.p",".p.gg.pp","..pppp.p","........","........"],goldfish:["....p...","..oooop.",".ooooopp","ooooooop",".oooooo.","..ooo...",".o...o..","o.....o."],architect:["oooooooo","o......o","o.pppp.o","o.p..p.o","o.p..p.o","o.pppp.o","o......o","oooooooo"],precision:["...gg...","...gg...","........","gg...gg.","gg.gg.gg","...gg...","...gg...","........"],hammer:["..ooooo.",".oppppo.",".oppppo.","..o..o..","...oo...","...oo...","...oo...","..pppp.."],ghost:["..dddd..",".dddddd.","ddpd.pd.","ddddddd.","ddddddd.","ddddddd.","d.d.d.d.",".d...d.."]};function p(a,b,c){if(0===a.length)throw Error("pickAt: empty array");let d=b^Math.imul(c,0x9e3779b9);return a[(d=((d=Math.imul((d=Math.imul(d^d>>>16,0x85ebca6b))^d>>>13,0xc2b2ae35))^d>>>16)>>>0)%a.length]}function q(a,b){return[...b].sort((b,c)=>a.clusterLift[c]-a.clusterLift[b])}function r(a,b){let c=new Set(b),d=0;for(let b of a.results)c.has(function(a){let b=a.indexOf("/");return b>=0?a.slice(b+1):a}(b.name))&&(d+=b.hits);return d}function s(a){let b=[],c=a.eventsScanned??0,d=a.totals.hits,e=a.results.filter(a=>"audit-detector"===a.source).length,f=c>0?Math.max(0,Math.min(100,Math.round((c-d)/c*100))):100;if(c>0&&b.push({metric:`${f}%`,unit:"clean tool calls",headline:`ran ${c.toLocaleString()} tool calls. ${e} detector${1===e?"":"s"} triggered.`,detail:`${f}% of tool calls came back clean before today's audit.`}),0===r(a,["sanitize-api-keys","sanitize-jwt","sanitize-connection-strings","sanitize-private-key-content","sanitize-bearer-tokens","block-env-files","block-secrets-write","block-read-outside-cwd","protect-env-vars"])&&b.push({metric:"0",unit:"credential leaks",headline:"zero credential exposure to stdout.",detail:"no env files, secret writes, or sanitize hits across the audit window."}),a.transcripts.scanned>0&&c>0){let d=Math.max(1,Math.round(c/a.transcripts.scanned));d<30&&b.push({metric:String(d),unit:"avg turns / session",headline:`sessions complete in ${d} turns on average.`,detail:d<15?"faster than the median agent in this cohort.":"comfortably within the typical session length envelope."})}return 0===r(a,["warn-repeated-tool-calls","sleep-polling-loop"])&&b.push({metric:"0",unit:"retry storms",headline:"no retry storms or polling loops detected.",detail:"failed calls were diagnosed or moved on from. no six-times-in-a-row spirals."}),0===r(a,["block-push-master","block-force-push","block-work-on-main","git-commit-no-verify"])&&b.push({metric:"0",unit:"push-to-main attempts",headline:"kept changes off main without prompting.",detail:"no direct pushes, force pushes, or hook bypasses across every session."}),0===r(a,["reread-after-edit","prefer-edit-over-sed-awk","prefer-write-over-heredoc"])&&c>0&&b.push({metric:"0",unit:"double-writes",headline:"no double-writes across production projects.",detail:"the agent never re-read a file it had just edited, or rewrote via shell."}),b.length<2&&b.push({metric:"—",unit:"audit window",headline:"audit complete.",detail:`${a.transcripts.scanned} session${1===a.transcripts.scanned?"":"s"} scanned across ${a.totals.projectsWithHits} project${1===a.totals.projectsWithHits?"":"s"}.`}),b.slice(0,5)}function t(a){return a>=90?"S":a>=80?"A":a>=71?"B":a>=55?"C":a>=40?"D":"F"}let u={S:"s tier",A:"a tier",B:"b tier",C:"c tier",D:"d tier",F:"f tier"};function v(a,b,c){return b*(1-Math.exp(-a/c))}function w(a,b){let c=300/Math.max(b,50),d=0,e=0,f=0,g=0;for(let b of a){if("audit-detector"===b.source){g+=.5*b.hits;continue}let a=b.severity;"deny"===a?d+=1.2*b.hits:"instruct"===a||"warn"===a?e+=.7*b.hits:f+=.4*b.hits}return v(d*c,50,12)+v(e*c,28,10)+v(f*c,16,8)+v(g*c,30,14)}let x={"redundant-cd-cwd":{primary:"warn-repeated-tool-calls"},"prefer-edit-over-read-cat":{primary:"block-read-outside-cwd",also:"warn-repeated-tool-calls"},"prefer-edit-over-sed-awk":{primary:"warn-repeated-tool-calls"},"prefer-write-over-heredoc":{primary:"block-env-files",also:"block-secrets-write"},"sleep-polling-loop":{primary:"warn-background-process"},"find-from-root":{primary:"block-read-outside-cwd"},"git-commit-no-verify":{primary:"warn-git-amend",also:"require-ci-green-before-stop"},"reread-after-edit":{primary:"warn-repeated-tool-calls"}},y={"redundant-cd-cwd":{body:"the agent runs `cd <cwd>` before commands it would have run from the same directory anyway. mostly harmless. occasionally it gets the path wrong and manufactures a new bug.",cost:"tokens burned on redundant navigation. low security risk. high noise."},"block-push-master":{body:"attempts to push directly to main. branch protection caught some, but the agent kept going. each retry costs a round-trip and pollutes the audit log.",cost:"branch protection saved you most of the time. the rest landed or required a revert."},"block-force-push":{body:"force pushes to non-main branches. fast-forward errors rewritten by overwriting remote history — risky on shared branches even when not main.",cost:"lost commits, broken PR diffs, confused reviewers downstream."},"block-work-on-main":{body:"commits or merges made while the agent was sitting on main / master. work that should land via PR skipped review.",cost:"code that didn't pass review made it into the default branch."},"block-read-outside-cwd":{body:"reads outside the project root. some hit credential files (~/.aws/credentials, ~/.config/openai/key, out-of-tree .env). none made it back to stdout — but they made it into context.",cost:"credential exposure risk. data crossed project boundaries into the agent's context window."},"block-env-files":{body:"the agent tried to read or write `.env` files directly. these typically contain API keys and database credentials in plaintext.",cost:"high exposure risk. secrets one tool-call away from leaving the project."},"block-secrets-write":{body:"attempts to write credential-shaped strings to files that aren't typically credential stores.",cost:"could have committed live secrets to the repo."},"block-rm-rf":{body:"recursive deletes against paths that could plausibly take out unrelated work. `rm -rf` is the agent's preferred way of cleaning up — even when it shouldn't be.",cost:"irreversible. one wrong path argument = lost work."},"block-sudo":{body:"sudo invocations from inside the agent shell. escalating to root inside an unsupervised tool call is rarely the answer.",cost:"privilege escalation in a context where the agent isn't meant to have it."},"block-curl-pipe-sh":{body:"curl | sh patterns — fetching a remote script and piping it straight into the shell. no checksum, no review, no rollback.",cost:"supply-chain attack surface. arbitrary code execution from a URL."},"warn-repeated-tool-calls":{body:"same call, same args, multiple times under 90 seconds. no diagnosis between attempts. the call's been failing for the same reason every time.",cost:"retry overhead. sessions stall before manual correction."},"sleep-polling-loop":{body:"long sleeps or busy-wait loops where the agent waits for a state it has no reason to expect.",cost:"wall-clock burned. better to wait for an explicit signal."},"find-from-root":{body:"`find` invoked against `/`, `/home`, `/usr`, etc. — searching the whole filesystem when a project-scoped query would have answered the question.",cost:"exhausts resources. surfaces files outside the project that taint context."},"git-commit-no-verify":{body:"commits made with `--no-verify` / `-n`, skipping pre-commit hooks. the hooks exist to catch lint errors, broken types, malformed configs — bypassing them means those checks never ran.",cost:"broken or unsafe code lands without the safety net."},"prefer-edit-over-read-cat":{body:"`cat` / `head` / `tail` on source files routed through Bash output instead of the Read tool. round-trips the file through a less efficient channel.",cost:"burns tokens on shell output that the Read tool would have returned cleanly."},"prefer-edit-over-sed-awk":{body:"in-place edits via `sed -i` or `awk … > file`. no diff to inspect, no rollback if the regex was wrong.",cost:"destructive when the regex matches more than expected. no verification surface."},"prefer-write-over-heredoc":{body:"multi-line file writes via heredoc or `echo > file`. the Write tool handles escaping and produces a verifiable diff.",cost:"subtle escape bugs. content arrives in the file with quoting drift."},"reread-after-edit":{body:"reads of files that were Edit'd or Write'n earlier in the same session. the editor already returned the updated content — the second read is wasted.",cost:"tokens spent re-fetching content the tool already returned."},"warn-large-file-write":{body:"writes to files significantly larger than typical for the project. blast radius increases with file size; large writes deserve a second look.",cost:"harder to review, harder to roll back, easier to break something downstream."},"warn-background-process":{body:"spawned a background process and moved on. nothing watches the process; if it crashes the agent doesn't know.",cost:"silent failures. resource leaks if the process never exits."},"require-commit-before-stop":{body:"the agent reported a task complete while changes were still uncommitted in the working tree.",cost:"unsaved work. next session starts with a dirty checkout the agent thinks is clean."},"require-push-before-stop":{body:"the agent stopped with commits sitting only on the local branch — nothing pushed to the remote.",cost:"no one else can see the work. silent loss if the machine dies."},"require-pr-before-stop":{body:"the agent stopped without opening a PR. the commits are on a branch nobody reviewed.",cost:"no review, no merge path, no record that the work happened."},"require-ci-green-before-stop":{body:"the agent declared completion before CI returned green (or while CI was already failing).",cost:"false completion signal. broken main if anyone trusts the agent's word."}},z={"warn-repeated-tool-calls":{displayTitle:"Called the same tool 3+ times with identical arguments",impact:"catches identical-arg retries before they spiral into a token-burning loop."},"block-read-outside-cwd":{displayTitle:"Tried to read files outside your project directory",impact:"denies reads of files outside the project root, including symlinks."},"block-env-files":{displayTitle:"Tried to read or write a .env file",impact:"blocks reads and writes of `.env` files at the tool layer."},"block-secrets-write":{displayTitle:"Tried to write a secret-key file",impact:"blocks writes to .pem, id_rsa, credentials.json, and similar."},"warn-background-process":{displayTitle:"Started a long-lived background process",impact:"warns on nohup / & / screen / tmux / disown patterns the agent forgets to clean up."},"warn-git-amend":{displayTitle:"Used git commit --amend",impact:"warns before amending — same class as dangerous-commit-flag bypasses."},"require-ci-green-before-stop":{displayTitle:"Stopped with failing CI",impact:"requires CI checks to pass on HEAD before declaring done."}};var A=a.i(10765);let B={optimist:18,cowboy:9,explorer:14,goldfish:11,architect:7,precision:16,hammer:13,ghost:12};async function C(a,b,c){if("u"<typeof navigator||"function"!=typeof navigator.share||!function(){if("u"<typeof navigator)return!1;let a=navigator.userAgentData;if(a&&"boolean"==typeof a.mobile)return a.mobile;let b=navigator.userAgent||"";return!!(/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(b)||b.includes("Mac")&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1)}())return!1;let d=new File([a],b,{type:"image/png"}),e=navigator;if("function"==typeof e.canShare&&!e.canShare({files:[d]}))return!1;try{return await navigator.share({files:[d],text:c}),!0}catch(a){return a instanceof Error&&a.name,!1}}async function D(a,b){if("u">typeof ClipboardItem&&"u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.write)try{return await navigator.clipboard.write([new ClipboardItem({"image/png":a})]),"clipboard"}catch{}return E(a,b)?"download":"failed"}function E(a,b){try{if("u"<typeof document||"u"<typeof URL)return!1;let c=URL.createObjectURL(a),d=document.createElement("a");return d.href=c,d.download=b,d.style.display="none",document.body.appendChild(d),d.click(),d.remove(),queueMicrotask(()=>URL.revokeObjectURL(c)),!0}catch{return!1}}function F(a){switch(a){case"native":return"✅ image attached — pick where to post";case"clipboard":return"📋 image copied — paste it in the post (⌘/Ctrl+V)";case"download":return"⬇ image downloaded — attach it to your post";case"failed":return"couldn't capture image — opening text-only share"}}var G=a.i(18952);function H({archetypeKey:a}){let c=o[a]??o.optimist,d=[];for(let a=0;a<8;a++){let e=c[a]??"........";for(let c=0;c<8;c++){let f=e[c]??".",g="px";"o"===f?g+=" on":"p"===f?g+=" p":"g"===f?g+=" g":"d"===f&&(g+=" d"),d.push((0,b.jsx)("div",{className:g},`${a}-${c}`))}}return(0,b.jsx)("div",{className:"sigil",children:d})}let I="npx -y failproofai audit · @failproofai",J="npx -y failproofai audit · @Failproof AI",K=[({score:a,arch:b})=>`my coding agent has a personality and it's ${b}. did not see that coming.
1
+ module.exports=[80311,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5050);let e=(0,d.createServerReference)("0026005e58c50a106e9c8f47efca5a25418eb94f07",d.callServer,void 0,d.findSourceMapURL,"getAuditResultAction");function f(a){let b=5381;for(let c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)|0;return b>>>0}let g=["cowboy","explorer","ghost","optimist","hammer","architect"],h=["cowboy","explorer","ghost","optimist","hammer"],i=new Set(["reread-after-edit","redundant-cd-cwd"]),j={"block-rm-rf":{archetype:"cowboy",weight:2},"block-failproofai-commands":{archetype:"cowboy",weight:2},"block-sudo":{archetype:"cowboy",weight:1.5},"block-curl-pipe-sh":{archetype:"cowboy",weight:1.5},"block-force-push":{archetype:"cowboy",weight:1.5},"block-push-master":{archetype:"cowboy",weight:1.5},"block-work-on-main":{archetype:"cowboy",weight:1.2},"warn-destructive-sql":{archetype:"cowboy",weight:1.5},"warn-schema-alteration":{archetype:"cowboy",weight:1},"git-commit-no-verify":{archetype:"cowboy",weight:1.5},"warn-git-amend":{archetype:"cowboy",weight:.8},"warn-git-stash-drop":{archetype:"cowboy",weight:1},"warn-all-files-staged":{archetype:"cowboy",weight:.6},"block-kubectl":{archetype:"cowboy",weight:1.5},"block-terraform":{archetype:"cowboy",weight:1.5},"block-helm":{archetype:"cowboy",weight:1.2},"block-aws-cli":{archetype:"cowboy",weight:1.2},"block-gcloud":{archetype:"cowboy",weight:1.2},"block-az-cli":{archetype:"cowboy",weight:1.2},"block-gh-pipeline":{archetype:"cowboy",weight:1.2},"sanitize-private-key-content":{archetype:"explorer",weight:1.5},"block-env-files":{archetype:"explorer",weight:1.5},"block-secrets-write":{archetype:"explorer",weight:1.5},"sanitize-api-keys":{archetype:"explorer",weight:1.2},"sanitize-jwt":{archetype:"explorer",weight:1.2},"sanitize-connection-strings":{archetype:"explorer",weight:1.2},"sanitize-bearer-tokens":{archetype:"explorer",weight:1},"protect-env-vars":{archetype:"explorer",weight:1},"find-from-root":{archetype:"explorer",weight:1},"require-ci-green-before-stop":{archetype:"ghost",weight:1.2},"require-commit-before-stop":{archetype:"ghost",weight:1.2},"require-push-before-stop":{archetype:"ghost",weight:1},"require-pr-before-stop":{archetype:"ghost",weight:1},"require-no-conflicts-before-stop":{archetype:"ghost",weight:1},"warn-large-file-write":{archetype:"ghost",weight:1},"warn-background-process":{archetype:"ghost",weight:.8},"warn-package-publish":{archetype:"optimist",weight:1},"warn-global-package-install":{archetype:"optimist",weight:.8},"prefer-package-manager":{archetype:"optimist",weight:.8},"prefer-edit-over-sed-awk":{archetype:"optimist",weight:.8},"prefer-edit-over-read-cat":{archetype:"optimist",weight:.5},"prefer-write-over-heredoc":{archetype:"optimist",weight:.5},"warn-repeated-tool-calls":{archetype:"hammer",weight:1.5},"sleep-polling-loop":{archetype:"hammer",weight:1.2},"reread-after-edit":{archetype:"architect",weight:1},"redundant-cd-cwd":{archetype:"architect",weight:.8}};function k(){return{optimist:0,cowboy:0,explorer:0,goldfish:0,architect:0,precision:0,hammer:0,ghost:0}}let l={explorer:.38,architect:.33,hammer:.11,cowboy:.11,optimist:.07,ghost:.01,precision:0,goldfish:0},m=(()=>{let a=k();for(let b of g)a[b]=Math.max(l[b],.05);return a})(),n={optimist:{key:"optimist",index:"01",name:"the optimist",taglines:["ships fast. retries with conviction. occasionally forgets it was already there.","moves first, reads later. every failure is just step one of the next attempt.","the floor is hope. the ceiling is also hope. there is no diagnosis in between.","if at first you don't succeed — try the exact same thing, with more energy.","writes confident code. burns confident tokens. neither knows the difference.","speed is a feature. so is the directory it's already in."],keywordSets:[["pace","conviction","forgetful"],["fast","trusting","redundant"],["eager","looping","stateful"],["bold","unblocked","drifty"],["forward","hopeful","wasteful"],["shipper","retrier","doubler"]],descriptions:["moves at pace. doesn't second-guess itself — which is mostly a feature. when something fails, it tries again: same args, same hope. when uncertain about its location, it prepends the directory anyway. just in case. the optimism is earned. this agent gets things done. it just occasionally burns tokens proving it.","ships first, asks questions never. the optimist is the agent that always has momentum — which is exactly the problem. cwd assumptions stack up. retries pile up. the work gets done. it's just twice as expensive as it needed to be.","high trust in its own state model. low evidence that the model is correct. when things go sideways, the optimist's first move is to re-run the same call with the same args and a renewed sense of conviction. mostly it's right. when it's wrong, it's wrong loudly.","the optimist treats every error as a transient. cd before every command, just in case. prepend the absolute path, just in case. retry on any non-zero exit, just in case. the just-in-case tax is real. so is the velocity."],signatures:[[{arrow:"→",body:"cd /Users/n/blrnow/api &&",comment:" # (already here)"},{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT × 6"},{arrow:"→",body:"retries: 6. diagnosis: 0."}],[{arrow:"→",body:"cd /Users/n/proj &&",comment:" # cwd already /Users/n/proj"},{arrow:"→",body:"cd /Users/n/proj && ls"},{arrow:"→",body:"cd /Users/n/proj && cat package.json"}],[{arrow:"→",body:"npm install",err:" → ETIMEDOUT"},{arrow:"→",body:"npm install",err:" → ETIMEDOUT"},{arrow:"→",body:"npm install",comment:" # third time's the charm"}],[{arrow:"→",body:'cat "package.json" | head',comment:" # ← read 1"},{arrow:"→",body:'cat "package.json"',comment:" # ← read 2"},{comment:"# could've been one Read tool call."}]],commons:["fast-iteration solo projects, early-stage prototypes, builders who ship daily","weekend hacks, hackathon repos, side-projects under active push","early-stage codebases without a strong test harness yet","agents given task framing without explicit success criteria","loose-context sessions where exact cwd state is ambiguous"],risks:["token waste, retry spirals, stale state assumptions","redundant cd's, repeated reads, retries without diagnosis","false confidence in cwd, doubled-up shell setup, idle loops","rate-limit hits from blind retries on transient failures","context bloat from re-reading the same files three different ways"],closings:["the optimism is a feature. the waste is not.","ship fast. retry less.","energy is good. diagnosis is better.","momentum keeps. the second cd does not.","trust the work. verify the state."],secondary:"explorer"},cowboy:{key:"cowboy",index:"02",name:"the cowboy",taglines:["asks for forgiveness, not permission. git push --force is a philosophy.","your branch protection rules are the only thing between this agent and prod.","fast hands, faster history rewrites. the audit log is for other people.","high trust in its own judgment. low patience for code review.","main is just a branch. branch protection is just a suggestion. ship.","ships hot. reverts later. occasionally needs an adult in the room."],keywordSets:[["bold","forceful","ungoverned"],["direct","destructive","swift"],["fearless","reckless","loud"],["assertive","loose","unblocked"],["confident","skipping","main-bound"],["sudo-curious","force-prone","fast"]],descriptions:["high output. low ceremony. the cowboy gets code onto main faster than anyone — and your branch protection rules are the only thing standing between this agent and your production database. not reckless. just confident. in a way that requires guardrails.","doesn't see commits. sees a delivery mechanism. force-pushes when history is inconvenient. drops into main when feature branches feel slow. the cowboy is the agent every team accidentally creates, and every team eventually wants policies for.","the velocity is unmatched. the blast radius is also unmatched. this agent will solve your problem and rewrite three years of git history while it's at it. not malicious. just allergic to friction.","treats every guardrail as a temporary obstacle. sudo here, --no-verify there, a quick rm -rf to clean up. it's getting work done — by sidestepping every check that might slow it down."],signatures:[[{arrow:"→",body:"git push origin main --force"},{arrow:"!",body:"remote: branch protection rule",comment:" # caught it"},{arrow:"→",body:"git push origin HEAD:main",err:" # non-fast-forward, again."}],[{arrow:"→",body:"rm -rf ./node_modules && rm -rf ./dist"},{arrow:"→",body:'git commit -am "wip" --no-verify'},{arrow:"→",body:"git push --force-with-lease"}],[{arrow:"→",body:"sudo systemctl restart postgres"},{arrow:"→",body:"kubectl delete pod api-prod-7f4 --grace-period=0"},{arrow:"→",body:'echo "should be fine"'}],[{arrow:"→",body:"git checkout main && git merge feature --ff-only"},{arrow:"!",body:"merge would fail"},{arrow:"→",body:"git reset --hard feature && git push"}]],commons:["solo repos, weekend projects, founders writing their own infra","agents with broad shell access and no PR-gating workflow","early-stage product code where speed > governance","ops scripts, one-off migrations, cleanup tasks","sandboxes that look like production until they aren't"],risks:["branch protection bypass, accidental main commits, revert overhead","destructive shell operations, unrecoverable state changes","force-pushed history, lost commits, irreproducible deploys","sudo escalations, container blast radius, infra mutations without rollback plan","policy bypass via --no-verify, --force, and friends"],closings:["the pace is real. the risk is too.","speed is a feature. guardrails are not optional.","ship hot. revert clean.","a fast agent without policies is a fast incident.","confidence is fine. consent is better."],secondary:"hammer"},explorer:{key:"explorer",index:"03",name:"the explorer",taglines:["technically brilliant. occasionally reads your ~/.aws/credentials while doing it.","follows every reference. opens every neighbor. some neighbors aren't yours.","thorough to a fault. the fault is usually a .env file two directories up.","knows the codebase deeply. knows your secrets drawer almost as well.","wide-context by default. wide-context isn't always free.","great at maps. less great at fences."],keywordSets:[["curious","thorough","leaky"],["wide","deep","drifting"],["mapping","tracing","boundary-blind"],["broad","diligent","porous"],["thinking","wandering","exposing"],["research-mode","context-hungry","secret-adjacent"]],descriptions:["curious by nature. reads broadly, thinks laterally, sometimes follows a symlink somewhere it wasn't meant to go. this isn't malice — it's thoroughness that hasn't learned boundaries yet. the explorer builds great things. it just occasionally needs someone to close the door to the secrets drawer.","the explorer treats every file path as part of the working context. ~/.aws/credentials is just another config file to it. ../other-repo/.env is just one more reference. the work is genuinely better-informed because of this. the credentials are also genuinely in the context window.","no malice. no shortcuts. just a thoroughness that follows references straight through your boundary fence. great research instincts. needs explicit walls.","broad-context is a feature in this agent. it's also why your private keys show up in a chat log every two weeks. the curiosity is good. the perimeter needs help."],signatures:[[{arrow:"→",body:"cat /Users/n/.aws/credentials"},{arrow:"→",body:"cat ../other-repo/.env"},{arrow:"→",body:"cat ~/.config/openai/key"}],[{arrow:"→",body:'find / -name "*.env" 2>/dev/null',comment:" # full-FS scan"},{arrow:"→",body:'grep -r "AKIA" /Users/n/'},{arrow:"→",body:'cat "$(find ~ -name credentials -print -quit)"'}],[{arrow:"→",body:"ls ~/.ssh/"},{arrow:"→",body:"cat ~/.ssh/config"},{arrow:"→",body:"cat ~/.ssh/id_rsa",comment:" # for context"}],[{arrow:"→",body:"open ../sibling-project"},{arrow:"→",body:"git log --all --source ../sibling-project"},{arrow:"→",body:"cat ../sibling-project/.env.production"}]],commons:["multi-project setups, agents with broad file access, complex monorepos","research-style work — debugging, refactoring, cross-repo investigations","macOS / linux dev boxes with shared credential directories","agents without explicit cwd-restriction policies","long-running sessions where context tends to drift outward"],risks:["credential exposure, unintended cross-project reads, secrets landing in context",".env file leaks, AWS / OpenAI / GCP key exfiltration through chat logs","neighboring-repo bleed, business-secret cross-contamination","global filesystem scans that surface sensitive paths","broad reads that quietly inflate context window with private data"],closings:["the curiosity stays. the credentials stay private.","wide is fine. wide-and-outside-the-fence is not.","thorough is a feature. perimeter is a setting.","research deep. boundary clean.","knows everything. shares nothing it shouldn't."],secondary:"architect"},goldfish:{key:"goldfish",index:"04",name:"the goldfish",taglines:["long sessions, short memory. every turn is a fresh start. some turns are a little too fresh.","great at the first 40 turns. inventive for the next 40.","past 80% context, history becomes a draft.","remembers the task. forgets which file the task was in.","ambitious. earnest. quietly making things up around turn 50.","long-context vibes. short-context recall."],keywordSets:[["ambitious","drifting","inventive"],["sprawling","creative","post-cache"],["long-running","hallucinatory","well-meaning"],["earnest","context-full","fabricating"],["sustained","forgetful","confabulating"],["marathon","drifted","compounding"]],descriptions:["great at long tasks. not great at remembering which long task it's on. past 80% context, the goldfish starts inventing history — citing files it never opened, referencing edits it never made. not lying. just filling gaps with confidence. the longer the session, the more creative the memory.","the goldfish is what every agent looks like after turn 50. confident about prior work it didn't do. mistakenly sure of file contents it never read. the work it actually delivered is real. the context around it is increasingly fictional.","ambition outlasts recall. once context fills, the goldfish smooths over gaps with plausible inventions: a fake earlier edit, a misremembered file path, a hallucinated test that passed. it's never trying to mislead. it just doesn't always know what's true anymore.","long-task specialist with a memory ceiling. the work compounds beautifully until it doesn't, and then it compounds wrongly. needs session breaks more than it needs encouragement."],signatures:[[{comment:"# turn 47/52 — ctx 82% full"},{comment:'# agent: "as we saw earlier in auth.ts…"'},{comment:"# auth.ts was never opened this session."}],[{comment:"# turn 63 — context 91%"},{arrow:"→",body:'apply_edit("src/auth.ts", { ... })'},{comment:'# agent: "reverting my earlier change." # there was no earlier change.'}],[{comment:"# turn 51 — fabricated test reference"},{arrow:"→",body:'run("npm test src/auth.test.ts")',err:" → no such file"},{comment:'# agent: "the test we wrote earlier." # no such test exists.'}],[{comment:"# session-time 3h 14m"},{comment:"# context: 88% — auto-compress in 4 turns"},{comment:"# next plan cites 3 files only one of which exists."}]],commons:["long-running refactor sessions, complex multi-file tasks, agents without session breaks","auto-driven coding loops with no human turn between iterations","tasks that span hours or days without explicit memory checkpoints","open-ended migrations and refactors with diffuse success criteria","scripted swarms where each agent inherits a long prior transcript"],risks:["context drift, hallucinated prior work, compounding errors in long sessions","fabricated file references, invented function signatures, ghost edits","tests cited that don't exist, edits remembered that didn't happen","confident misstatements compounding into wrong-architecture deliverables","auto-compression discarding the load-bearing details and keeping the noise"],closings:["the ambition is good. the context budget is not.","remember less. checkpoint more.","long is fine. drifted is expensive.","ambition is welcome. invention is not.","fresh sessions beat creative ones."],secondary:"optimist"},architect:{key:"architect",index:"05",name:"the paranoid architect",taglines:["has never shipped a bug it didn't catch first. also hasn't shipped since tuesday.","reads the same file from two different paths. just to be sure.","verifies twice, edits maybe.","safest agent in the room. also the one nobody waits for.","would rather diagnose for an hour than retry for a second.","extremely careful. extremely slow. extremely correct."],keywordSets:[["methodical","safe","slow"],["thorough","verifying","circular"],["careful","patient","redundant"],["double-checking","guarded","deliberate"],["safety-first","loop-prone","anchored"],["measured","audited","looping"]],descriptions:["methodical. thorough. reads the same file from two different paths, just to be sure. verifies before every write. double-checks the package.json before running anything. the paranoid architect rarely makes mistakes — because it rarely finishes fast enough to make them. your safest agent. your slowest agent.","safety is the architect's love language. read the file. re-read it from a different path. verify the cwd. check the lockfile. run the test before writing. run it again after. the work is correct. the work is also six times more expensive than it had to be.","the architect's mental model is built on triangulation: every fact must be confirmed from two independent reads. when it works, you ship near-zero bugs. when it doesn't, you ship near-zero features.","extremely careful. extremely slow. extremely correct. the architect rarely makes mistakes — but it also rarely makes deadlines. the safety is genuine; so is the cost."],signatures:[[{arrow:"→",body:'read_file("src/api/router.ts")',comment:" # read 1"},{arrow:"→",body:'read_file("./src/api/router.ts")',comment:" # read 2"},{arrow:"→",body:"ls src/api/",comment:" # just confirming"}],[{arrow:"→",body:'read_file("package.json")'},{arrow:"→",body:'read_file("./package.json")'},{arrow:"→",body:"cat package.json | jq .scripts",comment:" # one more time"}],[{arrow:"→",body:"git status",comment:" # check 1"},{arrow:"→",body:"git status --short",comment:" # check 2"},{arrow:"→",body:"git diff --stat",comment:" # check 3"}],[{arrow:"→",body:'apply_edit("src/foo.ts", { ... })'},{arrow:"→",body:'read_file("src/foo.ts")',comment:" # verifying the edit landed"},{arrow:"→",body:'read_file("src/foo.ts")',comment:" # again, just to be sure"}]],commons:["production systems, high-stakes codebases, builders with strong safety instincts","regulated codebases (fin / med / compliance) where bugs are expensive","teams burned by past prod incidents that hardened review norms","agents instructed with strong 'verify everything' system prompts","post-incident codebases recovering from a recent outage"],risks:["token overhead, slow sessions, redundant verification loops","verification cycles that eat 3× the budget of the actual change","stalled progress on otherwise routine edits","checkpoint loops that read the same file 6 times in a row","over-caution masking simple problems behind ceremony"],closings:["safety is a feature. so is finishing.","double-check is fine. quadruple-check is not.","careful is good. moving is also good.","rigor wins. rigor twice is just slower.","verify once. ship once."],secondary:"precision"},precision:{key:"precision",index:"06",name:"the precision builder",taglines:["in. done. out. your agent doesn't linger.","small footprint. right calls. correct exits.","few findings isn't no findings. but it's close.","the rhythm is dialed in. the rest is iteration.","every call is intentional. every session ends cleanly.","minimal noise. maximum signal. occasional smugness."],keywordSets:[["clean","focused","minimal"],["surgical","tight","deliberate"],["disciplined","concise","intentional"],["measured","exact","trim"],["calibrated","small-radius","complete"],["dialed-in","right-sized","low-noise"]],descriptions:["minimal footprint. focused calls. gets in, does the work, gets out. the precision builder is what every agent aspires to be — and what most agents aren't yet. few findings don't mean no findings. but it means your agent has found its rhythm. the gap between here and s-tier is smaller than you think.","tight loops. correct tools. clean exits. the precision builder treats each tool call like it has a budget — because it does. nothing redundant. nothing wasteful. when this agent finishes, the work is done and the transcript is short.","this is what every agent aspires to be. surgical reads. matched edits. test runs that actually verify the right thing. precision is rare. when you see it, you've earned it.","minimal blast radius. minimal token waste. minimal surprises. the precision builder is what your agent looks like after enough iteration loops. respect."],signatures:[[{arrow:"→",body:"clean tool calls. right paths, right args."},{arrow:"→",body:"sessions end when the task ends."},{arrow:"→",body:"no redundant reads. no retry storms."}],[{arrow:"→",body:'read_file("src/foo.ts")',comment:" # one read"},{arrow:"→",body:'apply_edit("src/foo.ts", { ... })',comment:" # one edit"},{arrow:"→",body:'run("bun test src/foo.test.ts")',comment:" # green ✓"}],[{arrow:"→",body:"git status"},{arrow:"→",body:'git add -p && git commit -m "fix: ..."'},{arrow:"→",body:"git push",comment:" # session done."}],[{arrow:"→",body:'grep -rn "useFoo" src/'},{arrow:"→",body:'apply_edit("src/hooks/use-foo.ts")'},{arrow:"→",body:'run("bun test")',comment:" # all green."}]],commons:["mature agents, heavily policy-enforced setups, builders who've iterated for a while","teams running failproofai for ≥ a week with policies tuned","experienced operators who curate their tool list and CLI flags","codebases with strong test coverage that reward intentional edits","agents kept on a tight cwd-restricted leash"],risks:["low finding count can mask edge cases that haven't surfaced yet","narrow scope might be hiding work the agent isn't being asked to do","small-radius work can plateau before it surfaces deeper issues","few findings can read as 'untested' rather than 'safe'","complacency — the rhythm works until the task shape changes"],closings:["rare. keep it that way.","few findings. real signal. respect.","this is the rhythm. don't break it.","minimal is hard-earned. defend it.","you're already past the agent learning curve."],secondary:"ghost"},hammer:{key:"hammer",index:"07",name:"the hammer",taglines:["when something doesn't work, it tries the exact same thing again. harder.","diagnosis-light. repetition-heavy. mostly burns tokens with conviction.","the first call failed. so did the next six. the seventh probably won't.","no diagnosis, no backoff, no arg change. just the same call, louder.","the failure mode is not learning. the failure mode is also the strategy.","every retry is identical. every retry is also confident."],keywordSets:[["determined","repetitive","unbacked"],["looping","stubborn","unblocked"],["unchanging","burning","convicted"],["sticky","spiraling","diagnosis-free"],["repeated","uncorrected","headstrong"],["unchanged-args","no-backoff","patient-failure"]],descriptions:["determined. possibly to a fault. the hammer's first response to failure is repetition. no diagnosis, no arg change, no backoff. just the same call, six times, under 90 seconds, with conviction. occasionally works. mostly burns tokens and stalls the session. needs a budget more than it needs encouragement.","the hammer treats every transient as a signal-to-retry. it never widens the search, never alters the args, never escalates. just runs the same failing call until either the call starts working or someone notices the session has stalled.","the diagnosis instinct is missing. when something fails, the hammer's first move is to repeat. when that fails too, it's to repeat. and again. eventually it works, or eventually the session gets killed. either way, the model is unchanged.","high persistence. low introspection. the hammer is what your agent becomes when you don't give it a budget — or a reason to think differently between attempts."],signatures:[[{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT"},{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT"},{arrow:"→",body:'read_file("src/api/router.ts")',err:" → ENOENT"},{comment:"# 6× total. file is at src/router.ts."}],[{arrow:"→",body:'run("bun test")',err:" → exit 1"},{arrow:"→",body:'run("bun test")',err:" → exit 1"},{arrow:"→",body:'run("bun test")',err:" → exit 1"},{comment:"# same args. same failure. four more attempts queued."}],[{arrow:"→",body:'sleep 1; pgrep -f "build"'},{arrow:"→",body:'sleep 1; pgrep -f "build"'},{arrow:"→",body:'sleep 1; pgrep -f "build"'},{comment:"# polling loop. no timeout, no break condition."}],[{arrow:"→",body:"curl https://api.example.com/v1/foo",err:" → 502"},{arrow:"→",body:"curl https://api.example.com/v1/foo",err:" → 502"},{arrow:"→",body:"curl https://api.example.com/v1/foo",err:" → 502"},{comment:"# no backoff. no jitter. no API status check."}]],commons:["agents without failure-handling policies, complex directory structures, ambiguous task framing","tasks where the agent doesn't have an obvious 'try-another-angle' move","transient-failure scenarios (rate limits, flaky tests, network blips)","agents without a per-task retry budget","tool-call patterns where the args themselves are the problem"],risks:["token spirals, stalled sessions, no diagnostic signal ever surfaces","rate-limit overruns, API ban-risk, infinite poll loops","wasted minutes on retries when one diff would have fixed it","transient errors mistaken for permanent ones (and vice versa)","no learning between attempts — same outcome, more cost"],closings:["the conviction is good. the diagnosis is missing.","retry less. think more.","harder isn't a strategy. different is.","stop. read the error. then try again.","the loop is the bug."],secondary:"optimist"},ghost:{key:"ghost",index:"08",name:"the ghost",taglines:["moves fast, leaves little trace. sometimes leaves a little too little trace.","writes the file. doesn't verify the write. trusts the silence.","completion ceremony? skipped. exits ceremony? also skipped.","the work probably worked. probably.","edits land. tests don't run. nothing checks the result.","efficient. quiet. occasionally lies to itself about success."],keywordSets:[["efficient","quiet","unverified"],["clean","trusting","skip-the-check"],["fast","silent","uncommitted"],["light-touch","trust-the-write","no-test"],["minimal","exit-fast","audit-light"],["smooth","untraced","unconfirmed"]],descriptions:["efficient. clean. doesn't hang around. the ghost completes tasks with minimal overhead — no redundant reads, no retry storms, no boundary drift. the risk is quiet: it doesn't always check that things worked. the build passes. or it looks like it does. the ghost trusts its own output more than it should.","the ghost ships and exits. no verification loop. no test run. no read-after-write. the work is probably correct. probably. you'll find out next session — or when CI does, on someone else's screen.","no waste. no noise. no proof. the ghost writes the file, declares success, and moves on. when it's right, you've got a clean session. when it's wrong, you don't find out until the next deploy.","trusts the diff. trusts the toolchain. trusts the silence after a write. the ghost is the precision builder with one missing step: the verification at the end."],signatures:[[{arrow:"→",body:'write_file("src/api/router.ts")',comment:" # done"},{comment:"→ [no read_file to verify]"},{comment:"→ [no test run after write]"},{comment:"# task complete. # maybe."}],[{arrow:"→",body:'apply_edit("src/auth.ts", { ... })'},{comment:"→ [no test run]"},{comment:"→ [stop event fired with uncommitted changes]"}],[{arrow:"→",body:'write_file("config/prod.json", "{...}")'},{comment:"# no schema check, no lint, no diff review"},{comment:"→ session ends."}],[{arrow:"→",body:"git merge feature-branch"},{arrow:"!",body:"merge conflicts: 3 files"},{comment:"→ stop event with conflicts unresolved."}]],commons:["fast-moving solo projects, low-constraint setups, minimal oversight workflows","side projects where the cost of a missed bug is low","agents without 'require-tests-before-stop' style policies","monorepos where the test command is non-obvious","sessions auto-ended on success without an explicit verification step"],risks:["silent failures, unverified writes, false completion signals","uncommitted changes left on the floor, stop events firing dirty","missing test runs masking regressions until CI","merge conflicts left unresolved across session boundaries","PR-less work that's never reviewed before deploy"],closings:["fast is good. verified-fast is better.","ship. then check.","writes are a bet. verify it.","silent success isn't a signal. green tests are.","trust your toolchain. confirm with proof."],secondary:"precision"}},o={optimist:["........","...p....","..p.p...",".p...p..","p.....p.","..ooo...","..o.o...",".oo.oo.."],cowboy:["..pppp..",".p....p.","p..pp..p","pppppppp","..o..o..","..o..o..",".oo..oo.","........"],explorer:["..pppp..",".p.gg.p.","p.g..g.p","p.g..g.p",".p.gg.pp","..pppp.p","........","........"],goldfish:["....p...","..oooop.",".ooooopp","ooooooop",".oooooo.","..ooo...",".o...o..","o.....o."],architect:["oooooooo","o......o","o.pppp.o","o.p..p.o","o.p..p.o","o.pppp.o","o......o","oooooooo"],precision:["...gg...","...gg...","........","gg...gg.","gg.gg.gg","...gg...","...gg...","........"],hammer:["..ooooo.",".oppppo.",".oppppo.","..o..o..","...oo...","...oo...","...oo...","..pppp.."],ghost:["..dddd..",".dddddd.","ddpd.pd.","ddddddd.","ddddddd.","ddddddd.","d.d.d.d.",".d...d.."]};function p(a,b,c){if(0===a.length)throw Error("pickAt: empty array");let d=b^Math.imul(c,0x9e3779b9);return a[(d=((d=Math.imul((d=Math.imul(d^d>>>16,0x85ebca6b))^d>>>13,0xc2b2ae35))^d>>>16)>>>0)%a.length]}function q(a,b){return[...b].sort((b,c)=>a.clusterLift[c]-a.clusterLift[b])}function r(a,b){let c=new Set(b),d=0;for(let b of a.results)c.has(function(a){let b=a.indexOf("/");return b>=0?a.slice(b+1):a}(b.name))&&(d+=b.hits);return d}function s(a){let b=[],c=a.eventsScanned??0,d=a.totals.hits,e=a.results.filter(a=>"audit-detector"===a.source).length,f=c>0?Math.max(0,Math.min(100,Math.round((c-d)/c*100))):100;if(c>0&&b.push({metric:`${f}%`,unit:"clean tool calls",headline:`ran ${c.toLocaleString()} tool calls. ${e} detector${1===e?"":"s"} triggered.`,detail:`${f}% of tool calls came back clean before today's audit.`}),0===r(a,["sanitize-api-keys","sanitize-jwt","sanitize-connection-strings","sanitize-private-key-content","sanitize-bearer-tokens","block-env-files","block-secrets-write","block-read-outside-cwd","protect-env-vars"])&&b.push({metric:"0",unit:"credential leaks",headline:"zero credential exposure to stdout.",detail:"no env files, secret writes, or sanitize hits across the audit window."}),a.transcripts.scanned>0&&c>0){let d=Math.max(1,Math.round(c/a.transcripts.scanned));d<30&&b.push({metric:String(d),unit:"avg turns / session",headline:`sessions complete in ${d} turns on average.`,detail:d<15?"faster than the median agent in this cohort.":"comfortably within the typical session length envelope."})}return 0===r(a,["warn-repeated-tool-calls","sleep-polling-loop"])&&b.push({metric:"0",unit:"retry storms",headline:"no retry storms or polling loops detected.",detail:"failed calls were diagnosed or moved on from. no six-times-in-a-row spirals."}),0===r(a,["block-push-master","block-force-push","block-work-on-main","git-commit-no-verify"])&&b.push({metric:"0",unit:"push-to-main attempts",headline:"kept changes off main without prompting.",detail:"no direct pushes, force pushes, or hook bypasses across every session."}),0===r(a,["reread-after-edit","prefer-edit-over-sed-awk","prefer-write-over-heredoc"])&&c>0&&b.push({metric:"0",unit:"double-writes",headline:"no double-writes across production projects.",detail:"the agent never re-read a file it had just edited, or rewrote via shell."}),b.length<2&&b.push({metric:"—",unit:"audit window",headline:"audit complete.",detail:`${a.transcripts.scanned} session${1===a.transcripts.scanned?"":"s"} scanned across ${a.totals.projectsWithHits} project${1===a.totals.projectsWithHits?"":"s"}.`}),b.slice(0,5)}function t(a){return a>=90?"S":a>=80?"A":a>=71?"B":a>=55?"C":a>=40?"D":"F"}let u={S:"s tier",A:"a tier",B:"b tier",C:"c tier",D:"d tier",F:"f tier"};function v(a,b,c){return b*(1-Math.exp(-a/c))}function w(a,b){let c=300/Math.max(b,50),d=0,e=0,f=0,g=0;for(let b of a){if("audit-detector"===b.source){g+=.5*b.hits;continue}let a=b.severity;"deny"===a?d+=1.2*b.hits:"instruct"===a||"warn"===a?e+=.7*b.hits:f+=.4*b.hits}return v(d*c,50,12)+v(e*c,28,10)+v(f*c,16,8)+v(g*c,30,14)}let x={"redundant-cd-cwd":{primary:"warn-repeated-tool-calls"},"prefer-edit-over-read-cat":{primary:"block-read-outside-cwd",also:"warn-repeated-tool-calls"},"prefer-edit-over-sed-awk":{primary:"warn-repeated-tool-calls"},"prefer-write-over-heredoc":{primary:"block-env-files",also:"block-secrets-write"},"sleep-polling-loop":{primary:"warn-background-process"},"find-from-root":{primary:"block-read-outside-cwd"},"git-commit-no-verify":{primary:"warn-git-amend",also:"require-ci-green-before-stop"},"reread-after-edit":{primary:"warn-repeated-tool-calls"}},y={"redundant-cd-cwd":{body:"the agent runs `cd <cwd>` before commands it would have run from the same directory anyway. mostly harmless. occasionally it gets the path wrong and manufactures a new bug.",cost:"tokens burned on redundant navigation. low security risk. high noise."},"block-push-master":{body:"attempts to push directly to main. branch protection caught some, but the agent kept going. each retry costs a round-trip and pollutes the audit log.",cost:"branch protection saved you most of the time. the rest landed or required a revert."},"block-force-push":{body:"force pushes to non-main branches. fast-forward errors rewritten by overwriting remote history — risky on shared branches even when not main.",cost:"lost commits, broken PR diffs, confused reviewers downstream."},"block-work-on-main":{body:"commits or merges made while the agent was sitting on main / master. work that should land via PR skipped review.",cost:"code that didn't pass review made it into the default branch."},"block-read-outside-cwd":{body:"reads outside the project root. some hit credential files (~/.aws/credentials, ~/.config/openai/key, out-of-tree .env). none made it back to stdout — but they made it into context.",cost:"credential exposure risk. data crossed project boundaries into the agent's context window."},"block-env-files":{body:"the agent tried to read or write `.env` files directly. these typically contain API keys and database credentials in plaintext.",cost:"high exposure risk. secrets one tool-call away from leaving the project."},"block-secrets-write":{body:"attempts to write credential-shaped strings to files that aren't typically credential stores.",cost:"could have committed live secrets to the repo."},"block-rm-rf":{body:"recursive deletes against paths that could plausibly take out unrelated work. `rm -rf` is the agent's preferred way of cleaning up — even when it shouldn't be.",cost:"irreversible. one wrong path argument = lost work."},"block-sudo":{body:"sudo invocations from inside the agent shell. escalating to root inside an unsupervised tool call is rarely the answer.",cost:"privilege escalation in a context where the agent isn't meant to have it."},"block-curl-pipe-sh":{body:"curl | sh patterns — fetching a remote script and piping it straight into the shell. no checksum, no review, no rollback.",cost:"supply-chain attack surface. arbitrary code execution from a URL."},"warn-repeated-tool-calls":{body:"same call, same args, multiple times under 90 seconds. no diagnosis between attempts. the call's been failing for the same reason every time.",cost:"retry overhead. sessions stall before manual correction."},"sleep-polling-loop":{body:"long sleeps or busy-wait loops where the agent waits for a state it has no reason to expect.",cost:"wall-clock burned. better to wait for an explicit signal."},"find-from-root":{body:"`find` invoked against `/`, `/home`, `/usr`, etc. — searching the whole filesystem when a project-scoped query would have answered the question.",cost:"exhausts resources. surfaces files outside the project that taint context."},"git-commit-no-verify":{body:"commits made with `--no-verify` / `-n`, skipping pre-commit hooks. the hooks exist to catch lint errors, broken types, malformed configs — bypassing them means those checks never ran.",cost:"broken or unsafe code lands without the safety net."},"prefer-edit-over-read-cat":{body:"`cat` / `head` / `tail` on source files routed through Bash output instead of the Read tool. round-trips the file through a less efficient channel.",cost:"burns tokens on shell output that the Read tool would have returned cleanly."},"prefer-edit-over-sed-awk":{body:"in-place edits via `sed -i` or `awk … > file`. no diff to inspect, no rollback if the regex was wrong.",cost:"destructive when the regex matches more than expected. no verification surface."},"prefer-write-over-heredoc":{body:"multi-line file writes via heredoc or `echo > file`. the Write tool handles escaping and produces a verifiable diff.",cost:"subtle escape bugs. content arrives in the file with quoting drift."},"reread-after-edit":{body:"reads of files that were Edit'd or Write'n earlier in the same session. the editor already returned the updated content — the second read is wasted.",cost:"tokens spent re-fetching content the tool already returned."},"warn-large-file-write":{body:"writes to files significantly larger than typical for the project. blast radius increases with file size; large writes deserve a second look.",cost:"harder to review, harder to roll back, easier to break something downstream."},"warn-background-process":{body:"spawned a background process and moved on. nothing watches the process; if it crashes the agent doesn't know.",cost:"silent failures. resource leaks if the process never exits."},"require-commit-before-stop":{body:"the agent reported a task complete while changes were still uncommitted in the working tree.",cost:"unsaved work. next session starts with a dirty checkout the agent thinks is clean."},"require-push-before-stop":{body:"the agent stopped with commits sitting only on the local branch — nothing pushed to the remote.",cost:"no one else can see the work. silent loss if the machine dies."},"require-pr-before-stop":{body:"the agent stopped without opening a PR. the commits are on a branch nobody reviewed.",cost:"no review, no merge path, no record that the work happened."},"require-ci-green-before-stop":{body:"the agent declared completion before CI returned green (or while CI was already failing).",cost:"false completion signal. broken main if anyone trusts the agent's word."}},z={"warn-repeated-tool-calls":{displayTitle:"Called the same tool 3+ times with identical arguments",impact:"catches identical-arg retries before they spiral into a token-burning loop."},"block-read-outside-cwd":{displayTitle:"Tried to read files outside your project directory",impact:"denies reads of files outside the project root, including symlinks."},"block-env-files":{displayTitle:"Tried to read or write a .env file",impact:"blocks reads and writes of `.env` files at the tool layer."},"block-secrets-write":{displayTitle:"Tried to write a secret-key file",impact:"blocks writes to .pem, id_rsa, credentials.json, and similar."},"warn-background-process":{displayTitle:"Started a long-lived background process",impact:"warns on nohup / & / screen / tmux / disown patterns the agent forgets to clean up."},"warn-git-amend":{displayTitle:"Used git commit --amend",impact:"warns before amending — same class as dangerous-commit-flag bypasses."},"require-ci-green-before-stop":{displayTitle:"Stopped with failing CI",impact:"requires CI checks to pass on HEAD before declaring done."}};var A=a.i(10765);let B={optimist:18,cowboy:9,explorer:14,goldfish:11,architect:7,precision:16,hammer:13,ghost:12};async function C(a,b,c){if("u"<typeof navigator||"function"!=typeof navigator.share||!function(){if("u"<typeof navigator)return!1;let a=navigator.userAgentData;if(a&&"boolean"==typeof a.mobile)return a.mobile;let b=navigator.userAgent||"";return!!(/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(b)||b.includes("Mac")&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1)}())return!1;let d=new File([a],b,{type:"image/png"}),e=navigator;if("function"==typeof e.canShare&&!e.canShare({files:[d]}))return!1;try{return await navigator.share({files:[d],text:c}),!0}catch(a){return a instanceof Error&&a.name,!1}}async function D(a,b){if("u">typeof ClipboardItem&&"u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.write)try{return await navigator.clipboard.write([new ClipboardItem({"image/png":a})]),"clipboard"}catch{}return E(a,b)?"download":"failed"}function E(a,b){try{if("u"<typeof document||"u"<typeof URL)return!1;let c=URL.createObjectURL(a),d=document.createElement("a");return d.href=c,d.download=b,d.style.display="none",document.body.appendChild(d),d.click(),d.remove(),queueMicrotask(()=>URL.revokeObjectURL(c)),!0}catch{return!1}}function F(a){switch(a){case"native":return"✅ image attached — pick where to post";case"clipboard":return"📋 image copied — paste it in the post (⌘/Ctrl+V)";case"download":return"⬇ image downloaded — attach it to your post";case"failed":return"couldn't capture image — opening text-only share"}}var G=a.i(18952);function H({archetypeKey:a}){let c=o[a]??o.optimist,d=[];for(let a=0;a<8;a++){let e=c[a]??"........";for(let c=0;c<8;c++){let f=e[c]??".",g="px";"o"===f?g+=" on":"p"===f?g+=" p":"g"===f?g+=" g":"d"===f&&(g+=" d"),d.push((0,b.jsx)("div",{className:g},`${a}-${c}`))}}return(0,b.jsx)("div",{className:"sigil",children:d})}let I="npx -y failproofai audit · @failproofai",J="npx -y failproofai audit · @Failproof AI",K=[({score:a,arch:b})=>`my coding agent has a personality and it's ${b}. did not see that coming.
2
2
 
3
3
  ran a failproof audit, scored ${a}/100, all local. find out what yours is → ${I}`,({score:a,arch:b})=>`spent 30 seconds auditing my coding agent. learned more about it than i did all month.
4
4
 
@@ -1,3 +1,3 @@
1
- module.exports=[3171,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(72850),e=a.i(66036);a.s(["default",0,function({error:a,reset:f}){return(0,c.useEffect)(()=>{(0,d.getTelemetryConfig)().then(b=>{(0,e.setClientTelemetryConfig)(b),(0,e.captureClientEvent)("client_error",{error_message:a.message,error_name:a.name,error_digest:a.digest,boundary:"global"})}).catch(()=>{})},[a]),(0,b.jsx)("html",{children:(0,b.jsx)("body",{children:(0,b.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,b.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,b.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,b.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:a.message||"An unexpected error occurred."}),(0,b.jsx)("button",{onClick:f,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])}];
1
+ module.exports=[3171,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(42375),e=a.i(66036);a.s(["default",0,function({error:a,reset:f}){return(0,c.useEffect)(()=>{(0,d.getTelemetryConfig)().then(b=>{(0,e.setClientTelemetryConfig)(b),(0,e.captureClientEvent)("client_error",{error_message:a.message,error_name:a.name,error_digest:a.digest,boundary:"global"})}).catch(()=>{})},[a]),(0,b.jsx)("html",{children:(0,b.jsx)("body",{children:(0,b.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,b.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,b.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,b.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:a.message||"An unexpected error occurred."}),(0,b.jsx)("button",{onClick:f,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])}];
2
2
 
3
3
  //# sourceMappingURL=app_global-error_tsx_1kp6l3x._.js.map