failproofai 1.0.0-beta.6 → 1.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +10 -10
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -4
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06hexd0._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +3 -3
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1e7-pa7._.js → [root-of-the-server]__0ommekk._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0spkm68._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1rv-sc9._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1_a_gwn._.js → [root-of-the-server]__1tkyag1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tyf0tc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1u-wx42._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1v185mo._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_04mekdy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0igtyj5._.js → _0i4l3_6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0r-dsre._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0rjgfln._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0se484m._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0uz7o9y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1fahg9e._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1w8sola._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1w_6p9g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +15 -15
- package/.next/standalone/.next/static/chunks/02vvywmww22zz.js +1 -0
- package/.next/standalone/.next/static/chunks/{34fa65k0cldkj.js → 0_-focvo4cuiv.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3f_939wi3kfnx.js → 1fwh-2un_l-eo.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3p1vpm2_-tfwm.js → 1zrdsxe91qq6i.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0_2n13i94rnw5.js → 2047vah_v4emu.js} +1 -1
- package/.next/standalone/.next/static/chunks/{35v07j9gc1pvr.js → 23hl78dzffun4.js} +1 -1
- package/.next/standalone/.next/static/chunks/2bw0stk-s-1dd.js +1 -0
- package/.next/standalone/.next/static/chunks/{3rbpw_waieafm.js → 2r_j5wrkbu5wm.js} +1 -1
- package/.next/standalone/.next/static/chunks/{23557z4e6dtsr.js → 3m8onpqrjxzu5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{28zkwzu50puki.js → 3yn1y6ckypqwp.js} +1 -1
- package/.next/standalone/package.json +5 -5
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +143 -27
- package/dist/cli.mjs +1288 -118
- package/dist/worker.mjs +77 -6
- package/package.json +5 -5
- package/scripts/repro-npm-install.sh +155 -0
- package/src/hooks/builtin-policies.ts +154 -2
- package/src/hooks/configure-wizard.ts +70 -6
- package/src/hooks/daemon-client.ts +35 -0
- package/src/hooks/daemon-service.ts +237 -24
- package/src/hooks/first-run-gate.ts +9 -1
- package/src/hooks/fp-home.ts +13 -0
- package/src/hooks/fp-reset.ts +25 -0
- package/src/hooks/onboarding-attempt.ts +179 -0
- package/src/hooks/uninstall-cli.ts +345 -0
- package/src/hooks/worker-server.ts +12 -2
- package/.next/standalone/.next/static/chunks/3081gykdubv8b.js +0 -1
- package/.next/standalone/.next/static/chunks/40ffnfpkeyvb0.js +0 -1
- /package/.next/standalone/.next/static/{Ptn8aBQl_cnNgOd0ebyv0 → gOR8i03AeQm1VnIayDHVV}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{Ptn8aBQl_cnNgOd0ebyv0 → gOR8i03AeQm1VnIayDHVV}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{Ptn8aBQl_cnNgOd0ebyv0 → gOR8i03AeQm1VnIayDHVV}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89664,e=>{"use strict";let t=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],89664)},8734,e=>{"use strict";let t=(0,e.i(56420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],8734)},34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=Math.round(e/100);if(t<600)return`${(t/10).toFixed(1)}s`;let a=Math.round(e/1e3);if(a<3600){let e=Math.floor(a/60);return`${e}m ${a%60}s`}let r=Math.round(e/6e4),l=Math.floor(r/60);return`${l}h ${r%60}m`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},66794,e=>{"use strict";let t=(0,e.i(56420).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],66794)},82954,e=>{"use strict";let t=(0,e.i(56420).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",0,t],82954)},16306,e=>{"use strict";let t=(0,e.i(56420).default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,t],16306)},84026,54959,e=>{"use strict";var t=e.i(56420);let a=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,a],84026);let r=(0,t.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["ShieldX",0,r],54959)},
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89664,e=>{"use strict";let t=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],89664)},8734,e=>{"use strict";let t=(0,e.i(56420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],8734)},34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=Math.round(e/100);if(t<600)return`${(t/10).toFixed(1)}s`;let a=Math.round(e/1e3);if(a<3600){let e=Math.floor(a/60);return`${e}m ${a%60}s`}let r=Math.round(e/6e4),l=Math.floor(r/60);return`${l}h ${r%60}m`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},66794,e=>{"use strict";let t=(0,e.i(56420).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],66794)},82954,e=>{"use strict";let t=(0,e.i(56420).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",0,t],82954)},16306,e=>{"use strict";let t=(0,e.i(56420).default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,t],16306)},84026,54959,e=>{"use strict";var t=e.i(56420);let a=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,a],84026);let r=(0,t.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["ShieldX",0,r],54959)},50164,e=>{"use strict";var t=e.i(95187);let a=(0,t.createServerReference)("60d15eff562dfa7c0bcc4cc48c04400fd116cb8759",t.callServer,void 0,t.findSourceMapURL,"searchHookActivityAction");e.s(["searchHookActivityAction",0,a])},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},73520,e=>{"use strict";var t=e.i(43476),a=e.i(24071),r=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:l,onPageChange:s}){if(l<=1)return null;let o=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>s(e-1),disabled:1===e,className:o(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(a.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(l<=7)return Array.from({length:l},(e,t)=>t+1);let t=[1],a=Math.max(2,e-1),r=Math.min(l-1,e+1);e<=3&&(r=Math.min(5,l-1)),e>=l-2&&(a=Math.max(2,l-4)),a>2&&t.push("ellipsis-start");for(let e=a;e<=r;e++)t.push(e);return r<l-1&&t.push("ellipsis-end"),t.push(l),t})().map(a=>"string"==typeof a?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},a):(0,t.jsx)("button",{onClick:()=>s(a),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===a?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${a}`,"aria-current":e===a?"page":void 0,children:a},a))}),(0,t.jsxs)("button",{onClick:()=>s(e+1),disabled:e===l,className:o(e===l),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(r.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),a=e.i(71645);function r(e){let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${a}-${r}`}function l(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[a,r,l]=e.split("-").map(Number);return new Date(a,r-1,l,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),r=(0,t.useRouter)(),l=(0,t.usePathname)(),s=(0,a.useRef)(null),o=(0,a.useCallback)(t=>e.get(t),[e]),i=(0,a.useCallback)(()=>new URLSearchParams(e.toString()),[e]),n=(0,a.useCallback)(t=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{let a=new URLSearchParams(e.toString());for(let[e,r]of Object.entries(t))void 0===r||""===r?a.delete(e):a.set(e,r);let s=a.toString(),o=s?`${l}?${s}`:l;r.replace(o,{scroll:!1})},150)},[e,l,r]);return(0,a.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),{get:o,getAll:i,setAll:n}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=r(e.from)),e.to&&(t.to=r(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:l(e),to:l(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},24578,e=>{"use strict";let t={claude:{id:"claude",label:"Claude Code",badgeClasses:"bg-orange-500/10 text-orange-400 border-orange-500/20"},codex:{id:"codex",label:"OpenAI Codex",badgeClasses:"bg-purple-500/10 text-purple-400 border-purple-500/20"},copilot:{id:"copilot",label:"GitHub Copilot",badgeClasses:"bg-blue-500/10 text-blue-400 border-blue-500/20"},cursor:{id:"cursor",label:"Cursor Agent",badgeClasses:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20"},opencode:{id:"opencode",label:"OpenCode",badgeClasses:"bg-amber-500/10 text-amber-400 border-amber-500/20"},pi:{id:"pi",label:"Pi",badgeClasses:"bg-pink-500/10 text-pink-400 border-pink-500/20"},hermes:{id:"hermes",label:"Hermes",badgeClasses:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20"},openclaw:{id:"openclaw",label:"OpenClaw",badgeClasses:"bg-teal-500/10 text-teal-400 border-teal-500/20"},factory:{id:"factory",label:"Factory Droid",badgeClasses:"bg-rose-500/10 text-rose-400 border-rose-500/20"},devin:{id:"devin",label:"Devin CLI",badgeClasses:"bg-violet-500/10 text-violet-400 border-violet-500/20"},antigravity:{id:"antigravity",label:"Antigravity CLI",badgeClasses:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"},goose:{id:"goose",label:"Goose",badgeClasses:"bg-lime-500/10 text-lime-400 border-lime-500/20"}};e.s(["KNOWN_CLI_IDS",0,["claude","codex","copilot","cursor","opencode","pi","hermes","openclaw","factory","devin","antigravity","goose"],"getCliBadgeClasses",0,function(e){return t[e]?.badgeClasses??t.claude.badgeClasses},"getCliLabel",0,function(e){return t[e]?.label??e},"isKnownCli",0,function(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(t,e)}])},63676,e=>{"use strict";let t=(0,e.i(56420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],63676)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=Math.round(e/100);if(t<600)return`${(t/10).toFixed(1)}s`;let n=Math.round(e/1e3);if(n<3600){let e=Math.floor(n/60);return`${e}m ${n%60}s`}let a=Math.round(e/6e4),r=Math.floor(a/60);return`${r}h ${a%60}m`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},86616,29054,e=>{"use strict";function t(e,n={},a=15e3){let r=AbortSignal.timeout(a),i=n.signal?AbortSignal.any([n.signal,r]):r;return fetch(e,{...n,signal:i})}function n(e){if(null===e||"object"!=typeof e)return!1;let t=e.name;return"AbortError"===t||"TimeoutError"===t}e.s(["fetchWithTimeout",0,t,"isAbortError",0,n],29054);class a extends Error{kind;constructor(e,t){super(t),this.kind=e,this.name="RerunError"}}async function r(e){try{let n=await t("/api/audit/run",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({cli:e.cli.length>0?e.cli:void 0,since:"all"===e.since?void 0:e.since,noCache:!!e.noCache||void 0})});if(!n.ok&&409!==n.status){let e=await n.text().catch(()=>"");throw console.error("audit run failed:",n.status,e),new a("post_failed",`audit run failed (${n.status})`)}}catch(e){if(e instanceof a)throw e;throw console.error("audit run request failed:",e),new a(n(e)?"timeout":"network","audit run request failed")}let r=0;for(;;){await new Promise(e=>setTimeout(e,1e3));let e=null;try{let n=await t("/api/audit/status",{cache:"no-store"});n.ok&&(e=await n.json())}catch{}if(null===e){if(++r>=10)throw new a("network","audit status poll lost the server");continue}if(r=0,!e.running){if(e.error)throw new a("post_failed",e.error);return}}}e.s(["RerunError",0,a,"triggerRun",0,r],86616)},93237,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(95187);let r=(0,a.createServerReference)("001ee9ecf3b6a08a26259fa859a53dce97b26c02f6",a.callServer,void 0,a.findSourceMapURL,"getScheduledAuditAction"),i=(0,a.createServerReference)("40d3df57211a3cbab30cf50fb8b8c513e73cfaca01",a.callServer,void 0,a.findSourceMapURL,"setAutoAuditAction"),s=(0,a.createServerReference)("40eccb4a231fd231c804b875fb7fe399f1fd1555b9",a.callServer,void 0,a.findSourceMapURL,"setAuditIntervalAction");var l=e.i(86616),o=e.i(55574),c=e.i(29054),d=e.i(34713);function u(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function h({enabled:e,onChange:n,disabled:a,label:r}){return(0,t.jsx)("button",{type:"button",onClick:n,disabled:a,role:"switch","aria-checked":e,"aria-label":r,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${e?"bg-emerald-500":"bg-muted-foreground/30"}`,children:(0,t.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${e?"translate-x-3.5":"translate-x-0.5"}`})})}let f={ok:{fg:"var(--accent-green)",bg:"rgba(102,209,181,0.10)",bd:"rgba(102,209,181,0.30)"},warn:{fg:"var(--amber)",bg:"rgba(232,196,106,0.10)",bd:"rgba(232,196,106,0.30)"},bad:{fg:"var(--accent-pink)",bg:"rgba(228,88,124,0.10)",bd:"rgba(228,88,124,0.30)"},muted:{fg:"var(--ink-2)",bg:"transparent",bd:"var(--line-2)"}};function p({tone:e,children:n}){let a=f[e];return(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 9px",fontFamily:"var(--font-mono)",fontSize:11,letterSpacing:"0.04em",color:a.fg,background:a.bg,border:`1px solid ${a.bd}`,textTransform:"uppercase"},children:n})}let g={fontFamily:"var(--font-mono)",fontSize:16,fontWeight:600,letterSpacing:"-0.01em",color:"var(--ink)",margin:"0 0 4px"},m={fontFamily:"var(--font-mono)",fontSize:13,color:"var(--ink-2)",lineHeight:1.65,margin:0},y={...m,color:"var(--dim)",fontSize:12},x={color:"var(--ink)",fontVariantLigatures:"none"};function b({children:e}){return(0,t.jsx)("code",{style:{fontFamily:"var(--font-mono)",fontSize:12,color:"var(--accent-green)",background:"var(--bg-2)",border:"1px solid var(--line-2)",padding:"1px 6px",whiteSpace:"nowrap"},children:e})}function v({view:e,onReload:a}){let r,[f,j]=(0,n.useState)(e.auto),[w,S]=(0,n.useState)(e.intervalDays),[k,T]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),[R,C]=(0,n.useState)(!1),[D,$]=(0,n.useState)(!1);(0,n.useEffect)(()=>j(e.auto),[e.auto]),(0,n.useEffect)(()=>S(e.intervalDays),[e.intervalDays]),(0,n.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await (0,c.fetchWithTimeout)("/api/audit/status",{cache:"no-store"});if(t.ok&&!e){let e=await t.json();C(!!e.running)}}catch{}})(),()=>{e=!0}},[]);let E="running"!==e.daemon,N="unsupported-platform"===e.daemon,F=(0,n.useCallback)(async()=>{let e=!f;j(e),T(!0);try{let t=await i(e);j(t.auto),(0,o.toast)(t.auto?"Scheduled scanning on.":"Scheduled scanning off."),await a()}catch{j(!e),(0,o.toast)("Could not save that.")}finally{T(!1)}},[f,a]),I=(0,n.useCallback)(async t=>{M(!0);try{let e=await s(t);S(e.intervalDays),(0,o.toast)(`Scanning every ${e.intervalDays} day${1===e.intervalDays?"":"s"}.`)}catch{S(e.intervalDays),(0,o.toast)("Could not save that.")}finally{M(!1)}},[e.intervalDays]),L=(0,n.useCallback)(async()=>{if(!D&&!R){$(!0),C(!0);try{await (0,l.triggerRun)({cli:[],since:"all",noCache:!1}),(0,o.toast)("Audit complete."),await a()}catch(t){let e=t instanceof l.RerunError&&"timeout"===t.kind?"The scan is taking a while — it will finish in the background.":"The scan could not be completed.";(0,o.toast)(e)}finally{$(!1),C(!1)}}},[D,R,a]),W=e.schedule,z=W?.lastExitCode!=null&&0!==W.lastExitCode&&75!==W.lastExitCode;return(0,t.jsxs)("div",{className:"panel",style:{padding:20,marginBottom:20},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{style:g,children:"Scheduled audit"}),(0,t.jsx)("p",{style:y,children:"Scan this machine on a timer, in the background."})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:["running"===e.daemon&&(0,t.jsx)(p,{tone:"ok",children:"daemon running"}),"stopped"===e.daemon&&(0,t.jsx)(p,{tone:"warn",children:"daemon stopped"}),"not-installed"===e.daemon&&(0,t.jsx)(p,{tone:"warn",children:"daemon not installed"}),"unsupported-platform"===e.daemon&&(0,t.jsx)(p,{tone:"muted",children:"daemon unavailable"})]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:12,marginTop:18},children:[(0,t.jsx)("div",{style:{marginTop:2},children:(0,t.jsx)(h,{enabled:f,onChange:F,disabled:k||N,label:f?"Turn off scheduled scanning":"Turn on scheduled scanning"})}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("p",{style:{...m,color:"var(--ink)"},children:f?"Scanning this machine on a schedule.":"Scan this machine on a schedule."}),(0,t.jsxs)("p",{style:{...m,marginTop:6},children:["The scan reads the ",(0,t.jsx)("span",{style:x,children:"contents"})," of every session transcript on disk across all installed agent CLIs — your prompts, the files they read and wrote, and command output. It runs entirely on this machine. Nothing is sent anywhere unless you also turn on emailed reports below."]})]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:16,flexWrap:"wrap"},children:[(0,t.jsx)("label",{htmlFor:"scan-interval",style:{...m},children:"Scan every"}),(0,t.jsx)("input",{id:"scan-interval",type:"number",min:1,max:90,step:1,value:w,disabled:A||N,onChange:e=>S(Number(e.target.value)),onBlur:t=>{let n=Number(t.target.value);Number.isFinite(n)?n!==e.intervalDays&&I(n):S(e.intervalDays)},style:{width:64,padding:"6px 8px",background:"var(--bg)",border:"1px solid var(--line-2)",color:"var(--ink)",fontFamily:"var(--font-mono)",fontSize:13,textAlign:"center"}}),(0,t.jsxs)("span",{style:m,children:["day",1===w?"":"s","."]}),(0,t.jsx)("span",{style:y,children:"1–90; the config keeps it in range."})]}),(0,t.jsxs)("div",{style:{marginTop:18,paddingTop:16,borderTop:"1px dashed var(--line)",display:"flex",flexDirection:"column",gap:6},children:[R&&(0,t.jsx)("p",{style:{...m,color:"var(--accent-green)"},children:"A scan is running now…"}),W?.lastRunAtMs!=null?(0,t.jsxs)("p",{style:m,children:["Last scheduled scan:"," ",(0,t.jsx)("span",{style:x,children:u(W.lastRunAtMs)})," ",(0,t.jsxs)("span",{style:y,children:["(",(0,d.formatRelativeTime)(W.lastRunAtMs),")"]})]}):e.lastResultAt?(0,t.jsxs)("p",{style:m,children:["Last audit result:"," ",(0,t.jsx)("span",{style:x,children:u(new Date(e.lastResultAt).getTime())})," ",(0,t.jsx)("span",{style:y,children:"(no scheduled scan has run yet)"})]}):(0,t.jsx)("p",{style:m,children:"No scan has run yet."}),f?W?.nextDueAtMs!=null?(0,t.jsxs)("p",{style:m,children:["Next scan due:"," ",(0,t.jsx)("span",{style:x,children:u(W.nextDueAtMs)})," ",(0,t.jsxs)("span",{style:y,children:["(",(r=W.nextDueAtMs-Date.now())<=0?"now":r<36e5?`in ${Math.max(1,Math.floor(r/6e4))}m`:r<864e5?`in ${Math.floor(r/36e5)}h`:`in ${Math.floor(r/864e5)}d`,")"]})]}):(0,t.jsxs)("p",{style:m,children:["Next scan:"," ",(0,t.jsx)("span",{style:y,children:"the daemon will schedule it shortly."})]}):(0,t.jsx)("p",{style:y,children:"Scheduled scanning is off — no scan is scheduled."}),z&&(0,t.jsxs)("p",{style:{...m,color:"var(--amber)"},children:["The last scheduled scan exited with code ",W?.lastExitCode,". It will retry on the next tick."]}),W?.schemaAhead&&(0,t.jsx)("p",{style:y,children:"A newer daemon wrote this schedule; some fields may not be shown."})]}),f&&E&&(0,t.jsx)("p",{style:{...m,color:"var(--amber)",marginTop:14},children:N?(0,t.jsx)(t.Fragment,{children:"The background daemon isn't available on this platform, so scheduled scans can't run here. You can still run one now, and use the audit page."}):"not-installed"===e.daemon?(0,t.jsxs)(t.Fragment,{children:["Scheduled scanning is on, but the background service isn't installed, so nothing will run on the timer yet. Install it with ",(0,t.jsx)(b,{children:"failproofai config"}),"."]}):(0,t.jsxs)(t.Fragment,{children:["Scheduled scanning is on, but the background service is stopped, so nothing will run until it starts. Reinstall or repair it with ",(0,t.jsx)(b,{children:"failproofai config"}),"."]})}),(0,t.jsx)("div",{style:{marginTop:18},children:(0,t.jsx)("button",{type:"button",className:"btn",onClick:L,disabled:D||R,children:D||R?"[ scanning… ]":"[ run a scan now ]"})})]})}e.s(["default",0,function(){let[e,a]=(0,n.useState)(null),[i,s]=(0,n.useState)(!0),[l,o]=(0,n.useState)(!1),c=(0,n.useRef)(!0),d=(0,n.useCallback)(async()=>{let e=await r();c.current&&a(e)},[]);return(0,n.useEffect)(()=>(c.current=!0,(async()=>{try{await d()}catch{c.current&&o(!0)}finally{c.current&&s(!1)}})(),()=>{c.current=!1}),[d]),(0,t.jsx)("main",{className:"report",children:(0,t.jsxs)("section",{className:"section","data-screen-label":"settings",children:[(0,t.jsx)("h2",{style:{fontFamily:"var(--font-mono)",fontSize:24,fontWeight:600,letterSpacing:"-0.01em",color:"var(--ink)",margin:"0 0 8px"},children:"Settings"}),(0,t.jsx)("p",{style:{...m,maxWidth:720,margin:"0 0 24px"},children:"Machine-level controls for scheduled scanning and emailed reports."}),i?(0,t.jsx)("p",{style:y,children:"Loading…"}):l||!e?(0,t.jsx)("p",{style:{...m,color:"var(--accent-pink)"},children:"Could not load settings. Refresh to try again."}):(0,t.jsx)(v,{view:e,onReload:d})]})})}],93237)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=Math.round(e/100);if(t<600)return`${(t/10).toFixed(1)}s`;let n=Math.round(e/1e3);if(n<3600){let e=Math.floor(n/60);return`${e}m ${n%60}s`}let a=Math.round(e/6e4),r=Math.floor(a/60);return`${r}h ${a%60}m`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},86616,29054,e=>{"use strict";function t(e,n={},a=15e3){let r=AbortSignal.timeout(a),i=n.signal?AbortSignal.any([n.signal,r]):r;return fetch(e,{...n,signal:i})}function n(e){if(null===e||"object"!=typeof e)return!1;let t=e.name;return"AbortError"===t||"TimeoutError"===t}e.s(["fetchWithTimeout",0,t,"isAbortError",0,n],29054);class a extends Error{kind;constructor(e,t){super(t),this.kind=e,this.name="RerunError"}}async function r(e){try{let n=await t("/api/audit/run",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({cli:e.cli.length>0?e.cli:void 0,since:"all"===e.since?void 0:e.since,noCache:!!e.noCache||void 0})});if(!n.ok&&409!==n.status){let e=await n.text().catch(()=>"");throw console.error("audit run failed:",n.status,e),new a("post_failed",`audit run failed (${n.status})`)}}catch(e){if(e instanceof a)throw e;throw console.error("audit run request failed:",e),new a(n(e)?"timeout":"network","audit run request failed")}let r=0;for(;;){await new Promise(e=>setTimeout(e,1e3));let e=null;try{let n=await t("/api/audit/status",{cache:"no-store"});n.ok&&(e=await n.json())}catch{}if(null===e){if(++r>=10)throw new a("network","audit status poll lost the server");continue}if(r=0,!e.running){if(e.error)throw new a("post_failed",e.error);return}}}e.s(["RerunError",0,a,"triggerRun",0,r],86616)},93237,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(95187);let r=(0,a.createServerReference)("00cb80fcf09ddd676bf696dfc51f20e3b07fddb948",a.callServer,void 0,a.findSourceMapURL,"getScheduledAuditAction"),i=(0,a.createServerReference)("400d4066ae4ea7c220eeae7986f3d44690855eb4a8",a.callServer,void 0,a.findSourceMapURL,"setAutoAuditAction"),s=(0,a.createServerReference)("409a7e01647e87ce57fd37938d85df5ba7dcb7b532",a.callServer,void 0,a.findSourceMapURL,"setAuditIntervalAction");var l=e.i(86616),o=e.i(55574),c=e.i(29054),d=e.i(34713);function u(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function h({enabled:e,onChange:n,disabled:a,label:r}){return(0,t.jsx)("button",{type:"button",onClick:n,disabled:a,role:"switch","aria-checked":e,"aria-label":r,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${e?"bg-emerald-500":"bg-muted-foreground/30"}`,children:(0,t.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${e?"translate-x-3.5":"translate-x-0.5"}`})})}let f={ok:{fg:"var(--accent-green)",bg:"rgba(102,209,181,0.10)",bd:"rgba(102,209,181,0.30)"},warn:{fg:"var(--amber)",bg:"rgba(232,196,106,0.10)",bd:"rgba(232,196,106,0.30)"},bad:{fg:"var(--accent-pink)",bg:"rgba(228,88,124,0.10)",bd:"rgba(228,88,124,0.30)"},muted:{fg:"var(--ink-2)",bg:"transparent",bd:"var(--line-2)"}};function p({tone:e,children:n}){let a=f[e];return(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 9px",fontFamily:"var(--font-mono)",fontSize:11,letterSpacing:"0.04em",color:a.fg,background:a.bg,border:`1px solid ${a.bd}`,textTransform:"uppercase"},children:n})}let g={fontFamily:"var(--font-mono)",fontSize:16,fontWeight:600,letterSpacing:"-0.01em",color:"var(--ink)",margin:"0 0 4px"},m={fontFamily:"var(--font-mono)",fontSize:13,color:"var(--ink-2)",lineHeight:1.65,margin:0},y={...m,color:"var(--dim)",fontSize:12},x={color:"var(--ink)",fontVariantLigatures:"none"};function b({children:e}){return(0,t.jsx)("code",{style:{fontFamily:"var(--font-mono)",fontSize:12,color:"var(--accent-green)",background:"var(--bg-2)",border:"1px solid var(--line-2)",padding:"1px 6px",whiteSpace:"nowrap"},children:e})}function v({view:e,onReload:a}){let r,[f,j]=(0,n.useState)(e.auto),[w,S]=(0,n.useState)(e.intervalDays),[k,T]=(0,n.useState)(!1),[A,M]=(0,n.useState)(!1),[R,C]=(0,n.useState)(!1),[D,$]=(0,n.useState)(!1);(0,n.useEffect)(()=>j(e.auto),[e.auto]),(0,n.useEffect)(()=>S(e.intervalDays),[e.intervalDays]),(0,n.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await (0,c.fetchWithTimeout)("/api/audit/status",{cache:"no-store"});if(t.ok&&!e){let e=await t.json();C(!!e.running)}}catch{}})(),()=>{e=!0}},[]);let E="running"!==e.daemon,N="unsupported-platform"===e.daemon,F=(0,n.useCallback)(async()=>{let e=!f;j(e),T(!0);try{let t=await i(e);j(t.auto),(0,o.toast)(t.auto?"Scheduled scanning on.":"Scheduled scanning off."),await a()}catch{j(!e),(0,o.toast)("Could not save that.")}finally{T(!1)}},[f,a]),I=(0,n.useCallback)(async t=>{M(!0);try{let e=await s(t);S(e.intervalDays),(0,o.toast)(`Scanning every ${e.intervalDays} day${1===e.intervalDays?"":"s"}.`)}catch{S(e.intervalDays),(0,o.toast)("Could not save that.")}finally{M(!1)}},[e.intervalDays]),L=(0,n.useCallback)(async()=>{if(!D&&!R){$(!0),C(!0);try{await (0,l.triggerRun)({cli:[],since:"all",noCache:!1}),(0,o.toast)("Audit complete."),await a()}catch(t){let e=t instanceof l.RerunError&&"timeout"===t.kind?"The scan is taking a while — it will finish in the background.":"The scan could not be completed.";(0,o.toast)(e)}finally{$(!1),C(!1)}}},[D,R,a]),W=e.schedule,z=W?.lastExitCode!=null&&0!==W.lastExitCode&&75!==W.lastExitCode;return(0,t.jsxs)("div",{className:"panel",style:{padding:20,marginBottom:20},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{style:g,children:"Scheduled audit"}),(0,t.jsx)("p",{style:y,children:"Scan this machine on a timer, in the background."})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:["running"===e.daemon&&(0,t.jsx)(p,{tone:"ok",children:"daemon running"}),"stopped"===e.daemon&&(0,t.jsx)(p,{tone:"warn",children:"daemon stopped"}),"not-installed"===e.daemon&&(0,t.jsx)(p,{tone:"warn",children:"daemon not installed"}),"unsupported-platform"===e.daemon&&(0,t.jsx)(p,{tone:"muted",children:"daemon unavailable"})]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:12,marginTop:18},children:[(0,t.jsx)("div",{style:{marginTop:2},children:(0,t.jsx)(h,{enabled:f,onChange:F,disabled:k||N,label:f?"Turn off scheduled scanning":"Turn on scheduled scanning"})}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("p",{style:{...m,color:"var(--ink)"},children:f?"Scanning this machine on a schedule.":"Scan this machine on a schedule."}),(0,t.jsxs)("p",{style:{...m,marginTop:6},children:["The scan reads the ",(0,t.jsx)("span",{style:x,children:"contents"})," of every session transcript on disk across all installed agent CLIs — your prompts, the files they read and wrote, and command output. It runs entirely on this machine. Nothing is sent anywhere unless you also turn on emailed reports below."]})]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:16,flexWrap:"wrap"},children:[(0,t.jsx)("label",{htmlFor:"scan-interval",style:{...m},children:"Scan every"}),(0,t.jsx)("input",{id:"scan-interval",type:"number",min:1,max:90,step:1,value:w,disabled:A||N,onChange:e=>S(Number(e.target.value)),onBlur:t=>{let n=Number(t.target.value);Number.isFinite(n)?n!==e.intervalDays&&I(n):S(e.intervalDays)},style:{width:64,padding:"6px 8px",background:"var(--bg)",border:"1px solid var(--line-2)",color:"var(--ink)",fontFamily:"var(--font-mono)",fontSize:13,textAlign:"center"}}),(0,t.jsxs)("span",{style:m,children:["day",1===w?"":"s","."]}),(0,t.jsx)("span",{style:y,children:"1–90; the config keeps it in range."})]}),(0,t.jsxs)("div",{style:{marginTop:18,paddingTop:16,borderTop:"1px dashed var(--line)",display:"flex",flexDirection:"column",gap:6},children:[R&&(0,t.jsx)("p",{style:{...m,color:"var(--accent-green)"},children:"A scan is running now…"}),W?.lastRunAtMs!=null?(0,t.jsxs)("p",{style:m,children:["Last scheduled scan:"," ",(0,t.jsx)("span",{style:x,children:u(W.lastRunAtMs)})," ",(0,t.jsxs)("span",{style:y,children:["(",(0,d.formatRelativeTime)(W.lastRunAtMs),")"]})]}):e.lastResultAt?(0,t.jsxs)("p",{style:m,children:["Last audit result:"," ",(0,t.jsx)("span",{style:x,children:u(new Date(e.lastResultAt).getTime())})," ",(0,t.jsx)("span",{style:y,children:"(no scheduled scan has run yet)"})]}):(0,t.jsx)("p",{style:m,children:"No scan has run yet."}),f?W?.nextDueAtMs!=null?(0,t.jsxs)("p",{style:m,children:["Next scan due:"," ",(0,t.jsx)("span",{style:x,children:u(W.nextDueAtMs)})," ",(0,t.jsxs)("span",{style:y,children:["(",(r=W.nextDueAtMs-Date.now())<=0?"now":r<36e5?`in ${Math.max(1,Math.floor(r/6e4))}m`:r<864e5?`in ${Math.floor(r/36e5)}h`:`in ${Math.floor(r/864e5)}d`,")"]})]}):(0,t.jsxs)("p",{style:m,children:["Next scan:"," ",(0,t.jsx)("span",{style:y,children:"the daemon will schedule it shortly."})]}):(0,t.jsx)("p",{style:y,children:"Scheduled scanning is off — no scan is scheduled."}),z&&(0,t.jsxs)("p",{style:{...m,color:"var(--amber)"},children:["The last scheduled scan exited with code ",W?.lastExitCode,". It will retry on the next tick."]}),W?.schemaAhead&&(0,t.jsx)("p",{style:y,children:"A newer daemon wrote this schedule; some fields may not be shown."})]}),f&&E&&(0,t.jsx)("p",{style:{...m,color:"var(--amber)",marginTop:14},children:N?(0,t.jsx)(t.Fragment,{children:"The background daemon isn't available on this platform, so scheduled scans can't run here. You can still run one now, and use the audit page."}):"not-installed"===e.daemon?(0,t.jsxs)(t.Fragment,{children:["Scheduled scanning is on, but the background service isn't installed, so nothing will run on the timer yet. Install it with ",(0,t.jsx)(b,{children:"failproofai config"}),"."]}):(0,t.jsxs)(t.Fragment,{children:["Scheduled scanning is on, but the background service is stopped, so nothing will run until it starts. Reinstall or repair it with ",(0,t.jsx)(b,{children:"failproofai config"}),"."]})}),(0,t.jsx)("div",{style:{marginTop:18},children:(0,t.jsx)("button",{type:"button",className:"btn",onClick:L,disabled:D||R,children:D||R?"[ scanning… ]":"[ run a scan now ]"})})]})}e.s(["default",0,function(){let[e,a]=(0,n.useState)(null),[i,s]=(0,n.useState)(!0),[l,o]=(0,n.useState)(!1),c=(0,n.useRef)(!0),d=(0,n.useCallback)(async()=>{let e=await r();c.current&&a(e)},[]);return(0,n.useEffect)(()=>(c.current=!0,(async()=>{try{await d()}catch{c.current&&o(!0)}finally{c.current&&s(!1)}})(),()=>{c.current=!1}),[d]),(0,t.jsx)("main",{className:"report",children:(0,t.jsxs)("section",{className:"section","data-screen-label":"settings",children:[(0,t.jsx)("h2",{style:{fontFamily:"var(--font-mono)",fontSize:24,fontWeight:600,letterSpacing:"-0.01em",color:"var(--ink)",margin:"0 0 8px"},children:"Settings"}),(0,t.jsx)("p",{style:{...m,maxWidth:720,margin:"0 0 24px"},children:"Machine-level controls for scheduled scanning and emailed reports."}),i?(0,t.jsx)("p",{style:y,children:"Loading…"}):l||!e?(0,t.jsx)("p",{style:{...m,color:"var(--accent-pink)"},children:"Could not load settings. Refresh to try again."}):(0,t.jsx)(v,{view:e,onReload:d})]})})}],93237)}]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "failproofai",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"description": "The easiest way to manage policies that keep your AI agents reliable, on-task, and running autonomously — for Claude Code & the Agents SDK",
|
|
5
5
|
"bin": {
|
|
6
6
|
"failproofai": "./dist/cli.mjs",
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
"sharp": "0.35.0"
|
|
115
115
|
},
|
|
116
116
|
"optionalDependencies": {
|
|
117
|
-
"@failproofai/failproofaid-linux-x64": "1.0.0-beta.
|
|
118
|
-
"@failproofai/failproofaid-linux-arm64": "1.0.0-beta.
|
|
119
|
-
"@failproofai/failproofaid-darwin-x64": "1.0.0-beta.
|
|
120
|
-
"@failproofai/failproofaid-darwin-arm64": "1.0.0-beta.
|
|
117
|
+
"@failproofai/failproofaid-linux-x64": "1.0.0-beta.8",
|
|
118
|
+
"@failproofai/failproofaid-linux-arm64": "1.0.0-beta.8",
|
|
119
|
+
"@failproofai/failproofaid-darwin-x64": "1.0.0-beta.8",
|
|
120
|
+
"@failproofai/failproofaid-darwin-arm64": "1.0.0-beta.8"
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
|
|
|
9
9
|
const hostname = process.env.HOSTNAME || '0.0.0.0'
|
|
10
10
|
|
|
11
11
|
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
|
|
12
|
-
const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"1.0.0-beta.
|
|
12
|
+
const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"1.0.0-beta.8"},"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/failproofai/failproofai","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":false,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"partialFallbacks":false,"dynamicOnHover":false,"varyParams":false,"prefetchInlining":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":false,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","outputFileTracingExcludes":{"*":["node_modules/@img/**","node_modules/sharp/**"]},"turbopack":{"root":"/home/runner/work/failproofai/failproofai"},"distDirRoot":".next"}
|
|
13
13
|
|
|
14
14
|
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
|
|
15
15
|
|
package/bin/failproofai.mjs
CHANGED
|
@@ -140,39 +140,38 @@ if (hookIdx >= 0) {
|
|
|
140
140
|
cwd: process.cwd(),
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
-
//
|
|
144
|
-
//
|
|
143
|
+
// On a daemon-configured machine the daemon is the ONLY evaluator. Every
|
|
144
|
+
// way of not getting an answer from it denies, and in-process evaluation
|
|
145
|
+
// is never reached from this branch — that is what "all enforcement is
|
|
146
|
+
// routed through the daemon" means, and a fallback here would be a second
|
|
147
|
+
// policy engine reachable by breaking the first.
|
|
145
148
|
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
// via npm and the daemon has not been reinstalled yet. Falling back to
|
|
149
|
-
// in-process costs latency and NOTHING else: it is the same policy engine
|
|
150
|
-
// producing the same decisions. Denying here would take a working machine
|
|
151
|
-
// offline to protect nothing, on an upgrade the user never asked to be
|
|
152
|
-
// interrupted by — and it would do it to every machine in a fleet at once,
|
|
153
|
-
// the moment PROTOCOL_VERSION is ever bumped.
|
|
149
|
+
// The two failures still differ in what the USER has to do, so they are
|
|
150
|
+
// told apart in the message and nowhere else:
|
|
154
151
|
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
//
|
|
152
|
+
// protocol-mismatch: a daemon answered, so it is alive; the CLI and the
|
|
153
|
+
// daemon are different versions, which is what an `npm update` that
|
|
154
|
+
// has not been followed by `failproofai config` looks like. The remedy
|
|
155
|
+
// is an upgrade, and naming it is the difference between a one-command
|
|
156
|
+
// fix and a support ticket. `daemonVersionSkew()` has already been
|
|
157
|
+
// hinting this on every CLI command.
|
|
158
|
+
//
|
|
159
|
+
// unreachable: nothing answered. A stopped service, a deleted socket and
|
|
160
|
+
// deliberate tampering are indistinguishable from here — and a machine
|
|
161
|
+
// where stopping one service silently disables every guardrail is not
|
|
162
|
+
// a guarded machine.
|
|
158
163
|
let result;
|
|
159
164
|
if (attempt.ok) {
|
|
160
165
|
result = attempt.response;
|
|
161
|
-
} else if (attempt.failure === "protocol-mismatch") {
|
|
162
|
-
console.error(
|
|
163
|
-
"[failproofai] failproofaid speaks a different protocol version than this CLI — " +
|
|
164
|
-
"evaluating in-process instead (slower, identical policies). " +
|
|
165
|
-
"Run `failproofai config` to update the daemon.",
|
|
166
|
-
);
|
|
167
|
-
result = await evaluateHookEvent(eventType, cli, stdinRead.payload);
|
|
168
166
|
} else {
|
|
167
|
+
const reason =
|
|
168
|
+
attempt.failure === "protocol-mismatch"
|
|
169
|
+
? "failproofaid is running a different protocol version than this CLI, so it " +
|
|
170
|
+
"cannot evaluate this call. Run `failproofai config` to update the daemon."
|
|
171
|
+
: "failproofaid could not be reached. This machine is configured to run hooks through it " +
|
|
172
|
+
"— check the daemon (see `failproofai config`) rather than retrying blindly.";
|
|
169
173
|
result = await evaluateHookEvent(eventType, cli, stdinRead.payload, {
|
|
170
|
-
forceDecision: {
|
|
171
|
-
decision: "deny",
|
|
172
|
-
reason:
|
|
173
|
-
"failproofaid could not be reached. This machine is configured to run hooks through it " +
|
|
174
|
-
"— check the daemon (see `failproofai config`) rather than retrying blindly.",
|
|
175
|
-
},
|
|
174
|
+
forceDecision: { decision: "deny", reason },
|
|
176
175
|
});
|
|
177
176
|
}
|
|
178
177
|
|
|
@@ -212,7 +211,7 @@ if (hookIdx >= 0) {
|
|
|
212
211
|
*/
|
|
213
212
|
async function runCli() {
|
|
214
213
|
// --help / -h (only when not inside a subcommand that handles its own --help)
|
|
215
|
-
const SUBCOMMANDS = ["policies", "policy", "audit", "config"];
|
|
214
|
+
const SUBCOMMANDS = ["policies", "policy", "audit", "config", "uninstall"];
|
|
216
215
|
if ((args.includes("--help") || args.includes("-h")) && !SUBCOMMANDS.includes(args[0])) {
|
|
217
216
|
const extraArgs = args.filter((a) => a !== "--help" && a !== "-h");
|
|
218
217
|
if (extraArgs.length > 0) {
|
|
@@ -257,6 +256,16 @@ COMMANDS
|
|
|
257
256
|
dashboard at http://localhost:8020/audit
|
|
258
257
|
audit --help, -h Show this help for the audit command
|
|
259
258
|
|
|
259
|
+
uninstall Remove failproofai from this machine: hook
|
|
260
|
+
entries from every agent CLI, and the daemon
|
|
261
|
+
service. Run this BEFORE \`npm rm -g failproofai\`
|
|
262
|
+
— npm runs no uninstall script, so removing the
|
|
263
|
+
package alone leaves both behind.
|
|
264
|
+
--purge Also delete ~/.failproofai (settings,
|
|
265
|
+
credentials, audit history, daemon binary)
|
|
266
|
+
--dry-run Show what would be removed, change nothing
|
|
267
|
+
--yes, -y Skip the confirmation prompt
|
|
268
|
+
|
|
260
269
|
--version, -v Print version and exit
|
|
261
270
|
--help, -h Show this help message
|
|
262
271
|
|
|
@@ -411,6 +420,113 @@ LINKS
|
|
|
411
420
|
}
|
|
412
421
|
}
|
|
413
422
|
|
|
423
|
+
// uninstall [--purge] [--dry-run] [--yes|-y]
|
|
424
|
+
//
|
|
425
|
+
// Top-level, and deliberately NOT a flag on `policies`. `policies --uninstall`
|
|
426
|
+
// disables policies; this removes the product — hook entries across every
|
|
427
|
+
// agent CLI plus the root-owned daemon service — and the two must not be one
|
|
428
|
+
// keystroke apart.
|
|
429
|
+
if (args[0] === "uninstall") {
|
|
430
|
+
const subArgs = args.slice(1);
|
|
431
|
+
if (subArgs.includes("--help") || subArgs.includes("-h")) {
|
|
432
|
+
console.log(`
|
|
433
|
+
failproofai uninstall — remove failproofai from this machine
|
|
434
|
+
|
|
435
|
+
USAGE
|
|
436
|
+
failproofai uninstall [--purge] [--dry-run] [--yes]
|
|
437
|
+
|
|
438
|
+
WHAT IT REMOVES
|
|
439
|
+
• failproofai hook entries from every agent CLI that has them
|
|
440
|
+
• the failproofaid daemon service (needs sudo)
|
|
441
|
+
• the "require the daemon" flag — cleared FIRST, so a partial uninstall can
|
|
442
|
+
never leave this machine denying every tool call
|
|
443
|
+
|
|
444
|
+
OPTIONS
|
|
445
|
+
--purge Also delete ~/.failproofai — settings, credentials, audit
|
|
446
|
+
history and the downloaded daemon binary. Off by default so a
|
|
447
|
+
reinstall keeps your history.
|
|
448
|
+
--dry-run Print what would be removed and change nothing.
|
|
449
|
+
--yes, -y Skip the confirmation prompt. Required when there is no TTY.
|
|
450
|
+
|
|
451
|
+
WHY THIS EXISTS
|
|
452
|
+
npm runs no uninstall script, so \`npm rm -g failproofai\` removes the package
|
|
453
|
+
and leaves the hook entries and the service behind. Run this first, then:
|
|
454
|
+
npm rm -g failproofai
|
|
455
|
+
`);
|
|
456
|
+
process.exit(0);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
const KNOWN = new Set(["--purge", "--dry-run", "--yes", "-y"]);
|
|
460
|
+
const unknown = subArgs.find((a) => !KNOWN.has(a));
|
|
461
|
+
if (unknown) {
|
|
462
|
+
throw new CliError(
|
|
463
|
+
`Unexpected argument: ${unknown}\nRun \`failproofai uninstall --help\` for usage.`,
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
lastSubcommand = "uninstall_command";
|
|
468
|
+
const { runUninstallCommand } = await import("../src/hooks/uninstall-cli");
|
|
469
|
+
const purge = subArgs.includes("--purge");
|
|
470
|
+
const dryRun = subArgs.includes("--dry-run");
|
|
471
|
+
const yes = subArgs.includes("--yes") || subArgs.includes("-y");
|
|
472
|
+
|
|
473
|
+
// Set only when the prompt actually rendered the plan, which is the one
|
|
474
|
+
// case where printing it again would duplicate it.
|
|
475
|
+
let planWasShown = false;
|
|
476
|
+
const result = await runUninstallCommand({
|
|
477
|
+
purge,
|
|
478
|
+
dryRun,
|
|
479
|
+
yes,
|
|
480
|
+
cwd: process.cwd(),
|
|
481
|
+
// Only offered when a person can actually answer. Without a TTY the
|
|
482
|
+
// command requires --yes rather than assuming consent — see the module.
|
|
483
|
+
confirm: process.stdin.isTTY
|
|
484
|
+
? async (planLines) => {
|
|
485
|
+
planWasShown = true;
|
|
486
|
+
const { selectOne } = await import("../src/hooks/tui");
|
|
487
|
+
// "No" first, so the default landing position on Enter is the
|
|
488
|
+
// non-destructive one.
|
|
489
|
+
const answer = await selectOne({
|
|
490
|
+
message: purge
|
|
491
|
+
? "Remove failproofai and DELETE ~/.failproofai?"
|
|
492
|
+
: "Remove failproofai from this machine?",
|
|
493
|
+
body: planLines,
|
|
494
|
+
choices: [
|
|
495
|
+
{ label: "No, cancel", value: false },
|
|
496
|
+
{ label: purge ? "Yes, remove and purge" : "Yes, remove it", value: true },
|
|
497
|
+
],
|
|
498
|
+
});
|
|
499
|
+
return answer === true;
|
|
500
|
+
}
|
|
501
|
+
: undefined,
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
// The prompt already rendered the plan as its body; re-printing it would
|
|
505
|
+
// show the same block twice. `planLines` is reported by the command rather
|
|
506
|
+
// than guessed from the text — see UninstallResult.
|
|
507
|
+
const skip = planWasShown ? result.planLines : 0;
|
|
508
|
+
for (const line of result.lines.slice(skip)) {
|
|
509
|
+
if (result.exitCode === 0) console.log(line);
|
|
510
|
+
else console.error(line);
|
|
511
|
+
}
|
|
512
|
+
// NOT after a purge. `track` resolves the instance id, and `getInstanceId()`
|
|
513
|
+
// lazily WRITES ~/.failproofai/state/telemetry-id — which re-created the
|
|
514
|
+
// whole directory seconds after the purge deleted it, leaving a machine the
|
|
515
|
+
// user had just wiped holding a brand-new tracking identifier and making
|
|
516
|
+
// the command's own "✓ deleted" line false. A purge means gone; nothing
|
|
517
|
+
// gets to touch the home afterwards, least of all telemetry.
|
|
518
|
+
if (!result.purged) {
|
|
519
|
+
await track("cli_uninstall_command", {
|
|
520
|
+
ok: result.exitCode === 0,
|
|
521
|
+
purge,
|
|
522
|
+
dry_run: dryRun,
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
lastSubcommand = null;
|
|
526
|
+
await exitAfterFlush(result.exitCode);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
|
|
414
530
|
// policies [--install|-i|--uninstall|-u|--help|-h] [names...] [--scope] [--beta] [--custom|-c <path>]
|
|
415
531
|
if (args[0] === "policies") {
|
|
416
532
|
const subArgs = args.slice(1);
|