failproofai 1.0.4-beta.8 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +5 -5
  3. package/.next/standalone/.next/prerender-manifest.json +4 -4
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
  6. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js +2 -2
  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 +6 -6
  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/_tree.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
  16. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
  18. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
  22. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  23. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +13 -13
  24. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  25. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/audit/run/route.js +4 -4
  27. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +1 -1
  34. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/audit/page/build-manifest.json +2 -2
  36. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +4 -37
  37. package/.next/standalone/.next/server/app/audit/page.js +2 -2
  38. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/index.html +1 -1
  41. package/.next/standalone/.next/server/app/index.rsc +14 -14
  42. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +13 -13
  43. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  44. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  45. package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
  46. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  47. package/.next/standalone/.next/server/app/page.js +2 -2
  48. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
  51. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
  52. package/.next/standalone/.next/server/app/policies/page.js +4 -4
  53. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
  56. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  57. package/.next/standalone/.next/server/app/project/[name]/page.js +4 -4
  58. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
  61. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  62. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  63. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +5 -5
  64. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
  67. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  68. package/.next/standalone/.next/server/app/projects/page.js +3 -3
  69. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
  72. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +4 -15
  73. package/.next/standalone/.next/server/app/settings/page.js +4 -4
  74. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/chunks/{[externals]__0hmcwgg._.js → [externals]__0-9ti7z._.js} +1 -1
  77. package/.next/standalone/.next/server/chunks/{[externals]__14b7cc6._.js → [externals]__0u3wrvq._.js} +1 -1
  78. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-219ec._.js +3 -0
  79. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04_h-a5._.js +3 -0
  80. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08dchfu._.js +1 -1
  81. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
  82. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rv7m0k._.js +1 -1
  83. package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1le9jqc._.js +3 -0
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1legmza._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1p-qi2t._.js +5 -0
  87. package/.next/standalone/.next/server/chunks/_0tovk6q._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/_0trp3yc._.js +1 -1
  89. package/.next/standalone/.next/server/chunks/{_1_eakl4._.js → _1-akg6w._.js} +2 -2
  90. package/.next/standalone/.next/server/chunks/_1ek68ln._.js +10 -10
  91. package/.next/standalone/.next/server/chunks/_1vslkoe._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/lib_telemetry_ts_0dctyyw._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__187jks6._.js → [root-of-the-server]__00-s7h8._.js} +1 -1
  96. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013jr2b._.js +4 -0
  97. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01wy8d-._.js +4 -0
  98. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02npjtd._.js +4 -0
  99. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1fa1jd9._.js → [root-of-the-server]__09flfsx._.js} +2 -2
  100. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da85px._.js +4 -0
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ftmoxc._.js +4 -0
  102. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kokc8z._.js → [root-of-the-server]__0n_lxhg._.js} +1 -1
  103. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oa1lav._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p-5p8u._.js +4 -0
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s740oi._.js +6 -0
  106. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1kpd1za._.js → [root-of-the-server]__190won8._.js} +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ctpynv._.js +3 -0
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1nq7ivq._.js +3 -0
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1p2otjt._.js +4 -0
  110. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00y9ww2._.js → [root-of-the-server]__1sc84bb._.js} +2 -21
  111. package/.next/standalone/.next/server/chunks/ssr/_02yoeej._.js +3 -0
  112. package/.next/standalone/.next/server/chunks/ssr/{_00bqkhj._.js → _04rbnaq._.js} +2 -2
  113. package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/ssr/{_0s-77v5._.js → _0h_douw._.js} +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/_1_ozgif._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/_1ddpc5g._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/ssr/_1es2j7i._.js +14 -51
  118. package/.next/standalone/.next/server/chunks/ssr/{_14c6q09._.js → _1if9ixi._.js} +2 -21
  119. package/.next/standalone/.next/server/chunks/ssr/{_07t3jol._.js → _1u8-lu2._.js} +2 -2
  120. package/.next/standalone/.next/server/chunks/ssr/_1ylae7o._.js +3 -0
  121. package/.next/standalone/.next/server/chunks/ssr/_1zopuov._.js +3 -0
  122. package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +2 -2
  123. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +69 -1
  124. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/app_settings_settings-client_tsx_20lq-mq._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/lib_openclaw-projects_ts_0qxq3bp._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/node_modules_13n822a._.js +1 -1
  129. package/.next/standalone/.next/server/chunks/ssr/node_modules_html-to-image_es_index_1ao30b1.js +3 -0
  130. package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589g._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-home_ts_0je3xkv._.js +1 -1
  133. package/.next/standalone/.next/server/middleware-build-manifest.js +5 -5
  134. package/.next/standalone/.next/server/pages/404.html +1 -1
  135. package/.next/standalone/.next/server/pages/500.html +1 -1
  136. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/server-reference-manifest.json +21 -65
  138. package/.next/standalone/.next/static/chunks/{1302duobnz07l.js → 0-tyrpwuc3lla.js} +1 -1
  139. package/.next/standalone/.next/static/chunks/0ca7octhod0g2.js +69 -0
  140. package/.next/standalone/.next/static/chunks/0u64yey446k4f.css +1 -0
  141. package/.next/standalone/.next/static/chunks/{2n85g-crgcx5j.js → 1j6o9min_6qa9.js} +1 -1
  142. package/.next/standalone/.next/static/chunks/27cl8h-c2w7cd.js +1 -0
  143. package/.next/standalone/.next/static/chunks/{0jpd8dv2vk930.css → 29-iqnp9v_axt.css} +1 -1
  144. package/.next/standalone/.next/static/chunks/{3uyhmm01g64k4.css → 2k9f4tyv04809.css} +0 -1
  145. package/.next/standalone/.next/static/chunks/{1chm9piluggc-.js → 2lwipmv5etc8m.js} +1 -1
  146. package/.next/standalone/.next/static/chunks/2pd16tn5qmx13.js +1 -0
  147. package/.next/standalone/.next/static/chunks/{2ukucf6g-kbs5.js → 2u8vh73tpw28_.js} +1 -1
  148. package/.next/standalone/.next/static/chunks/{1_x7pqemw5n_w.js → 31u94yukw9fz-.js} +1 -1
  149. package/.next/standalone/.next/static/chunks/{2mizt96igig1y.js → 3p9_8x5ezce-9.js} +1 -1
  150. package/.next/standalone/.next/static/chunks/3qfoeqhy5l10x.js +1 -0
  151. package/.next/standalone/.next/static/chunks/{0vm4wdx3w-2_w.js → 3tjji451hrgc0.js} +1 -1
  152. package/.next/standalone/.next/static/chunks/3zkg2s2vzxc3d.js +1 -0
  153. package/.next/standalone/.next/static/chunks/{turbopack-3s3c-u_u_l0u9.js → turbopack-3p73obe0xmrxm.js} +1 -1
  154. package/.next/standalone/.opencode/plugins/failproofai.mjs +27 -51
  155. package/.next/standalone/app/actions/get-scheduled-audit.ts +0 -5
  156. package/.next/standalone/app/actions/update-scheduled-audit.ts +57 -18
  157. package/.next/standalone/app/api/auth/status/route.ts +2 -3
  158. package/.next/standalone/app/audit/_components/audit-dashboard.tsx +34 -140
  159. package/.next/standalone/app/audit/_components/audit-poster.tsx +10 -29
  160. package/.next/standalone/app/audit/_components/come-back-better-section.tsx +1 -6
  161. package/.next/standalone/app/audit/_components/empty-state.tsx +1 -4
  162. package/.next/standalone/app/audit/_components/how-to-improve-section.tsx +5 -19
  163. package/.next/standalone/app/audit/_components/share-templates.ts +44 -110
  164. package/.next/standalone/app/audit/audit-styles.css +1 -132
  165. package/.next/standalone/app/settings/page.tsx +1 -1
  166. package/.next/standalone/app/settings/settings-client.tsx +45 -50
  167. package/.next/standalone/lib/auth/api-server-client.ts +5 -33
  168. package/.next/standalone/lib/claude-sessions.ts +27 -101
  169. package/.next/standalone/lib/codex-sessions.ts +4 -20
  170. package/.next/standalone/lib/copilot-sessions.ts +1 -32
  171. package/.next/standalone/lib/cursor-sessions.ts +5 -62
  172. package/.next/standalone/lib/download-session.ts +13 -58
  173. package/.next/standalone/lib/openclaw-projects.ts +18 -54
  174. package/.next/standalone/lib/openclaw-sessions.ts +17 -75
  175. package/.next/standalone/lib/sqlite-reader.ts +1 -78
  176. package/.next/standalone/package.json +9 -9
  177. package/.next/standalone/server.js +1 -1
  178. package/bin/failproofai.mjs +1 -1
  179. package/dist/cli.mjs +664 -2121
  180. package/dist/worker.mjs +105 -422
  181. package/lib/auth/api-server-client.ts +5 -33
  182. package/lib/claude-sessions.ts +27 -101
  183. package/lib/codex-sessions.ts +4 -20
  184. package/lib/copilot-sessions.ts +1 -32
  185. package/lib/cursor-sessions.ts +5 -62
  186. package/lib/download-session.ts +13 -58
  187. package/lib/openclaw-projects.ts +18 -54
  188. package/lib/openclaw-sessions.ts +17 -75
  189. package/lib/sqlite-reader.ts +1 -78
  190. package/package.json +9 -9
  191. package/pi-extension/index.ts +5 -50
  192. package/src/audit/cache.ts +0 -6
  193. package/src/audit/cli-adapters/claude.ts +0 -13
  194. package/src/audit/cli-login.ts +1 -4
  195. package/src/audit/cli.ts +7 -157
  196. package/src/audit/harm-report.ts +4 -111
  197. package/src/audit/index.ts +15 -286
  198. package/src/audit/machine-store.ts +9 -8
  199. package/src/audit/redact-example.ts +15 -324
  200. package/src/audit/report-harm.ts +37 -33
  201. package/src/audit/report.ts +3 -6
  202. package/src/audit/schedule-cli.ts +33 -54
  203. package/src/audit/scoring.ts +0 -49
  204. package/src/audit/types.ts +0 -52
  205. package/src/hooks/builtin-policies.ts +2 -67
  206. package/src/hooks/configure-wizard.ts +0 -55
  207. package/src/hooks/fp-config.ts +48 -83
  208. package/src/hooks/fp-home.ts +0 -27
  209. package/src/hooks/integrations.ts +14 -51
  210. package/src/hooks/uninstall-cli.ts +2 -17
  211. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0faqz9x._.js +0 -22
  212. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zyc_nm._.js +0 -3
  213. package/.next/standalone/.next/server/chunks/[root-of-the-server]__112b4go._.js +0 -24
  214. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l71g3y._.js +0 -22
  215. package/.next/standalone/.next/server/chunks/lib_openclaw-projects_ts_0gc-p24._.js +0 -3
  216. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-4ja6q._.js +0 -4
  217. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00cr3xu._.js +0 -4
  218. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04px77e._.js +0 -4
  219. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0egr5s1._.js +0 -6
  220. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0i0l1di._.js +0 -4
  221. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n2txhk._.js +0 -3
  222. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0r3c1_0._.js +0 -4
  223. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17xnxlx._.js +0 -4
  224. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ckpmkk._.js +0 -4
  225. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1kaotix._.js +0 -22
  226. package/.next/standalone/.next/server/chunks/ssr/_04ng_6x._.js +0 -3
  227. package/.next/standalone/.next/server/chunks/ssr/_0l2hi_d._.js +0 -3
  228. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_rerun-button_tsx_0blihgw._.js +0 -3
  229. package/.next/standalone/.next/static/chunks/0igq884ziuv-8.js +0 -1
  230. package/.next/standalone/.next/static/chunks/349jkb79v5g6z.js +0 -1
  231. package/.next/standalone/.next/static/chunks/3a4gth64hwtwf.js +0 -1
  232. package/.next/standalone/app/actions/get-leaks.ts +0 -104
  233. package/.next/standalone/app/audit/_components/leak-section.tsx +0 -192
  234. package/.next/standalone/lib/openclaw-db.ts +0 -271
  235. package/lib/openclaw-db.ts +0 -271
  236. package/src/audit/desktop-notify.ts +0 -420
  237. package/src/audit/leak-fingerprint.ts +0 -198
  238. package/src/audit/leak-record.ts +0 -248
  239. package/src/audit/leak-scan.ts +0 -268
  240. package/src/audit/leak-store.ts +0 -220
  241. package/src/audit/macos-notifier.ts +0 -298
  242. package/src/hooks/notice.ts +0 -24
  243. /package/.next/standalone/.next/static/{DNhaAH8iPGH0tIuxee5_2 → dg8VQ7Ejlo0Qsh_x92oIt}/_buildManifest.js +0 -0
  244. /package/.next/standalone/.next/static/{DNhaAH8iPGH0tIuxee5_2 → dg8VQ7Ejlo0Qsh_x92oIt}/_clientMiddlewareManifest.js +0 -0
  245. /package/.next/standalone/.next/static/{DNhaAH8iPGH0tIuxee5_2 → dg8VQ7Ejlo0Qsh_x92oIt}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[41857,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5050);let e=(0,d.createServerReference)("00ec75074abbe38fb07dd02bebbddca6aa52297c57",d.callServer,void 0,d.findSourceMapURL,"getScheduledAuditAction"),f=(0,d.createServerReference)("40c430e304b419d0daee78f88bc9779a0d8c3421f9",d.callServer,void 0,d.findSourceMapURL,"setAutoAuditAction"),g=(0,d.createServerReference)("40ceac8cce167924ddaec572bd4276556a00f4f7bb",d.callServer,void 0,d.findSourceMapURL,"setAuditNotifyAction"),h=(0,d.createServerReference)("405d922211894c9e4ef994cbad770a83a9eff5f462",d.callServer,void 0,d.findSourceMapURL,"setAuditIntervalAction");var i=a.i(89564),j=a.i(10765),k=a.i(17094);let l=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function m(a){if((0,k.isAbortError)(a))return"request timed out. check your network and try again.";let b=a instanceof Error?a.message:String(a);return`network error: ${b}`}function n({open:a,headline:d="where to route the reminder?",subhead:e="we'll send a one-time code to confirm.",onClose:f,onAuthed:g,source:h="unknown"}){let{capture:i}=(0,j.usePostHog)(),[o,p]=(0,c.useState)({kind:"email",error:null}),[q,r]=(0,c.useState)(!1),s=(0,c.useRef)(!1),t=(0,c.useRef)(null),u=(0,c.useRef)(null);(0,c.useEffect)(()=>{a&&(p({kind:"email",error:null}),r(!1),s.current=!1,i("audit_auth_dialog_opened",{source:h}))},[i,a,h]);let v=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(a){v.current=!0;return}v.current&&!s.current&&i("audit_auth_dialog_dismissed",{source:h,step:o.kind}),v.current=!1},[i,a,h,o.kind]),(0,c.useEffect)(()=>{if(!a)return;let b=setTimeout(()=>{"email"===o.kind?t.current?.focus():"code"===o.kind&&u.current?.focus()},50);return()=>clearTimeout(b)},[a,o.kind]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{"Escape"!==a.key||q||f()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a,q,f]);let w="code"===o.kind&&o.resendIn>0;(0,c.useEffect)(()=>{if(!w)return;let a=setInterval(()=>{p(a=>"code"===a.kind?{...a,resendIn:Math.max(0,a.resendIn-1)}:a)},1e3);return()=>clearInterval(a)},[w]);let x=(0,c.useCallback)(async(a,b={})=>{let{isResend:c=!1}=b,d=a=>{c?p(b=>"code"===b.kind?{...b,error:a}:b):p({kind:"email",error:a})};r(!0);try{let b=await (0,k.fetchWithTimeout)("/api/auth/login-request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({email:a})}),c=await b.json().catch(()=>({}));if(!b.ok){let a=c.message??"could not send code.";"rate_limited"===c.code&&void 0!==c.retry_after_secs?a=`too many tries. wait ${c.retry_after_secs}s and try again.`:"upstream_unreachable"===c.code&&(a="api-server unreachable. check your network."),d(a);return}p({kind:"code",email:a,error:null,expiresIn:c.expires_in??600,resendIn:c.resend_available_in??30})}catch(a){d(m(a))}finally{r(!1)}},[]),y=(0,c.useCallback)(async(a,b)=>{r(!0);try{let c=await (0,k.fetchWithTimeout)("/api/auth/login-verify",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({email:a,code:b})}),d=await c.json().catch(()=>({}));if(!c.ok||!d.authenticated||!d.user){let a=d.message??"invalid code.";"invalid_code"===d.code&&(a="wrong code, or it expired. try again."),p(b=>"code"===b.kind?{...b,error:a}:b);return}s.current=!0,i("audit_auth_dialog_succeeded",{source:h}),p({kind:"done",user:d.user}),g(d.user)}catch(b){let a=m(b);p(b=>"code"===b.kind?{...b,error:a}:b)}finally{r(!1)}},[i,g,h]),z=(0,c.useCallback)(async a=>{if(a.preventDefault(),q||"email"!==o.kind)return;let b=String(new FormData(a.currentTarget).get("email")??"").trim().toLowerCase();l.test(b)?await x(b):p({kind:"email",error:"that doesn't look like an email."})},[q,o,x]),A=(0,c.useCallback)(async a=>{if(a.preventDefault(),q||"code"!==o.kind)return;let b=String(new FormData(a.currentTarget).get("code")??"").trim();b.length<4||b.length>12?p(a=>"code"===a.kind?{...a,error:"code is 4–12 characters."}:a):await y(o.email,b)},[q,o,y]),B=(0,c.useCallback)(async()=>{"code"!==o.kind||o.resendIn>0||q||await x(o.email,{isResend:!0})},[o,q,x]);return a?(0,b.jsx)("div",{className:"auth-dialog-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"auth-dialog-title",onClick:a=>{q||a.target!==a.currentTarget||f()},children:(0,b.jsxs)("div",{className:"auth-dialog",children:[(0,b.jsx)("button",{type:"button",className:"auth-close",onClick:f,disabled:q,"aria-label":"close",children:"×"}),(0,b.jsx)("h2",{id:"auth-dialog-title",className:"auth-headline",children:d}),"email"===o.kind&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"auth-sub",children:e}),(0,b.jsxs)("form",{onSubmit:z,className:"auth-form",children:[(0,b.jsx)("input",{ref:t,id:"auth-dialog-email",name:"email",type:"email",autoComplete:"email",inputMode:"email",spellCheck:!1,placeholder:"you@yourdomain.com",disabled:q,className:"auth-input",required:!0}),o.error&&(0,b.jsx)("div",{className:"auth-error",children:o.error}),(0,b.jsxs)("div",{className:"auth-actions",children:[(0,b.jsx)("button",{type:"submit",className:"auth-btn primary",disabled:q,children:q?"sending…":"send code"}),(0,b.jsx)("button",{type:"button",className:"auth-btn",onClick:f,disabled:q,children:"cancel"})]})]})]}),"code"===o.kind&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"auth-sub",children:["code sent to ",(0,b.jsx)("span",{className:"auth-email",children:o.email}),". expires in ",Math.ceil(o.expiresIn/60)," min."]}),(0,b.jsxs)("form",{onSubmit:A,className:"auth-form",children:[(0,b.jsx)("input",{ref:u,id:"auth-dialog-code",name:"code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",spellCheck:!1,placeholder:"123456",disabled:q,className:"auth-input auth-input-code",maxLength:12,required:!0}),o.error&&(0,b.jsx)("div",{className:"auth-error",children:o.error}),(0,b.jsxs)("div",{className:"auth-actions",children:[(0,b.jsx)("button",{type:"submit",className:"auth-btn primary",disabled:q,children:q?"verifying…":"verify"}),(0,b.jsx)("button",{type:"button",className:"auth-btn",onClick:B,disabled:q||o.resendIn>0,children:o.resendIn>0?`resend in ${o.resendIn}s`:"resend code"})]}),(0,b.jsx)("button",{type:"button",className:"auth-back",onClick:()=>p({kind:"email",error:null}),disabled:q,children:"← use a different email"})]})]}),"done"===o.kind&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"auth-sub",children:[(0,b.jsx)("span",{className:"auth-ok",children:"✓"})," signed in as"," ",(0,b.jsx)("span",{className:"auth-email",children:o.user.email}),"."]}),(0,b.jsx)("div",{className:"auth-actions",children:(0,b.jsx)("button",{type:"button",className:"auth-btn primary",onClick:f,children:"continue"})})]})]})}):null}var o=a.i(18952),p=a.i(80977);function q(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function r(a,b){let c=a-b;if(c<=0)return"now";let d=Math.floor(c/864e5),e=Math.floor(c%864e5/36e5);return d>0?e>0?`${d}d ${e}h`:`${d}d`:e>0?`${e}h`:`${Math.max(1,Math.floor(c/6e4))}m`}function s(a){return a.toLocaleString("en-US")}function t({label:a,value:c,sub:d,tone:e}){return(0,b.jsxs)("div",{className:"set-stat",children:[(0,b.jsx)("div",{className:"set-stat-label",children:a}),(0,b.jsx)("div",{className:`set-stat-value${e?` ${e}`:""}`,children:c}),(0,b.jsx)("div",{className:"set-stat-sub",children:d??" "})]})}function u({lastRunAtMs:a,nextDueAtMs:c,now:d}){if(null==a||null==c||c<=a)return null;let e=Math.min(100,Math.max(0,(d-a)/(c-a)*100));return(0,b.jsxs)("div",{className:"tape","aria-hidden":"true",children:[(0,b.jsxs)("div",{className:"tape-rail",children:[(0,b.jsx)("div",{className:"tape-fill",style:{width:`${e}%`}}),(0,b.jsx)("div",{className:"tape-now",style:{left:`${e}%`}})]}),(0,b.jsxs)("div",{className:"tape-ends",children:[(0,b.jsxs)("span",{children:["last scan · ",q(a)]}),(0,b.jsxs)("span",{className:"tape-next",children:["next · ",r(c,d)]})]})]})}function v({enabled:a,onChange:c,disabled:d,label:e}){return(0,b.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-label":e,disabled:d,onClick:c,className:"sw","data-on":a?"true":"false",children:(0,b.jsx)("span",{className:"sw-knob"})})}let w=[{label:"reads",body:"every session transcript on disk — your prompts, the files your agents read and wrote, and command output."},{label:"runs",body:"entirely on this machine. the transcripts never leave it."},{label:"sends",body:"only the newest masked credential exposure, its CLI, time, location, and this machine's name — only when email is configured."}];a.s(["default",0,function({initial:a}){let[d,j]=(0,c.useState)(a),[k,l]=(0,c.useState)(a?.auto??!1),[m,x]=(0,c.useState)(a?.notify??!0),[y,z]=(0,c.useState)(a?.intervalDays??7),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(null===a),[I,J]=(0,c.useState)(0),K=(0,c.useRef)(!0),L=(0,c.useRef)(null!==a),M=(0,c.useCallback)(async()=>{try{let a=await e();if(!K.current)return;j(a),L.current=!0,l(a.auto),x(a.notify),z(a.intervalDays),J(Date.now()),H(!1)}catch{K.current&&!L.current&&H(!0)}},[]);(0,c.useEffect)(()=>(K.current=!0,M(),()=>{K.current=!1}),[M]),(0,c.useEffect)(()=>{let a=()=>void M();return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[M]);let N=d?.signedInAs??null,O=d?.daemon==="running",P=d?.daemon==="unsupported-platform",Q=d?.schedule??null,R=d?.lastScan??null,S=Q?.lastExitCode!=null&&0!==Q.lastExitCode&&75!==Q.lastExitCode,T=(0,c.useCallback)(async()=>{B(!0);try{let a=await f(!0);l(a.auto),(0,o.toast)("scheduled audits on."),await M()}catch{l(!1),(0,o.toast)("could not turn that on.")}finally{B(!1)}},[M]),U=(0,c.useCallback)(async()=>{if(k){B(!0);try{let a=await f(!1);a.ok&&l(a.auto),(0,o.toast)("scheduled audits off."),await M()}catch{(0,o.toast)("could not turn that off.")}finally{B(!1)}return}await T()},[k,T,M]),V=(0,c.useCallback)(async()=>{let a=!m;B(!0);try{let b=await g(a);x(b.notify),j(a=>a?{...a,notify:b.notify}:a),(0,o.toast)(b.notify?"system notifications on.":"system notifications off.")}catch{(0,o.toast)(`could not turn system notifications ${a?"on":"off"}.`)}finally{B(!1)}},[m]),W=(0,c.useCallback)(async a=>{B(!0);try{let b=await h(a);z(b.intervalDays),j(a=>a?{...a,intervalDays:b.intervalDays}:a),(0,o.toast)(`scanning every ${b.intervalDays} day${1===b.intervalDays?"":"s"}.`)}catch{z(d?.intervalDays??7),(0,o.toast)("could not save that.")}finally{B(!1)}},[d?.intervalDays]),X=(0,c.useCallback)(async()=>{B(!0);try{await fetch("/api/auth/logout",{method:"POST"}),(0,o.toast)("signed out. scans and desktop notifications continue; email alerts pause."),await M()}catch{(0,o.toast)("could not sign out.")}finally{B(!1)}},[M]),Y=(0,c.useCallback)(async()=>{if(!C){D(!0);try{await (0,i.triggerRun)({cli:[],since:"all",noCache:!1}),(0,o.toast)("scan complete."),await M()}catch(a){(0,o.toast)(a instanceof i.RerunError&&"timeout"===a.kind?"the scan is taking a while — it will finish in the background.":"the scan could not be completed.")}finally{D(!1)}}},[M,C]),Z=(0,c.useCallback)(async a=>{F(!1),await M(),await T()},[T,M]),$=d?O?{value:"running",sub:null!=d.daemonStartedAtMs&&I>0?`up ${function(a){let b=Math.floor(a/864e5);if(b>0)return`${b}d`;let c=Math.floor(a/36e5);return c>0?`${c}h`:`${Math.max(1,Math.floor(a/6e4))}m`}(Math.max(0,I-d.daemonStartedAtMs))}`:"",tone:"ok"}:P?{value:"unavailable",sub:"not on this platform"}:"not-installed"===d.daemon?{value:"not installed",sub:"run failproofai config",tone:"warn"}:"unknown"===d.daemon?{value:"unknown",sub:"could not read it"}:{value:"stopped",sub:"run failproofai config",tone:"warn"}:{value:"…",sub:"reading"},_=k?Q?.nextDueAtMs==null?{value:"pending",sub:"after the next scan"}:{value:I>0?r(Q.nextDueAtMs,I):"—",sub:q(Q.nextDueAtMs)}:{value:"off",sub:"nothing scheduled"},aa=R?{value:(0,p.formatRelativeTime)(Date.parse(R.finishedAt)),sub:null!=R.sessionsScanned?`${s(R.sessionsScanned)} sessions`:"scanned"}:{value:"none yet",sub:"run one below"},ab=R?null==R.findings?{value:"—",sub:"unreadable"}:{value:s(R.findings),sub:"this scan",...R.findings>0?{tone:"warn"}:{}}:{value:"—",sub:"no scan yet"};return(0,b.jsxs)("main",{className:"report",children:[(0,b.jsxs)("section",{className:"section set-sec",children:[(0,b.jsxs)("div",{className:"set-mast",children:[(0,b.jsx)("h1",{className:"set-title",children:"settings"}),(0,b.jsx)("p",{className:"set-lede",children:"keeping watch, so you don't have to."})]}),G?(0,b.jsx)("div",{className:"set-console",children:(0,b.jsx)("div",{className:"set-cell",children:(0,b.jsxs)("p",{className:"set-warn",children:["could not read this machine's settings. check that the dashboard can reach ",(0,b.jsx)("code",{children:"~/.failproofai/config.json"}),"."]})})}):(0,b.jsxs)("div",{className:"set-console",children:[(0,b.jsxs)("div",{className:"set-stats",children:[(0,b.jsx)(t,{label:"daemon",...$}),(0,b.jsx)(t,{label:"next scan",..._}),(0,b.jsx)(t,{label:"last scan",...aa}),(0,b.jsx)(t,{label:"findings",...ab})]}),(0,b.jsxs)("div",{className:"set-cols",children:[(0,b.jsxs)("div",{className:"set-cell set-config",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"scheduled audit"}),(0,b.jsxs)("div",{className:"set-row set-row-main",children:[(0,b.jsx)(v,{enabled:k,disabled:A||null===d,onChange:()=>void U(),label:k?"turn off scheduled audits":"turn on scheduled audits"}),(0,b.jsxs)("div",{className:"set-row-copy",children:[(0,b.jsx)("span",{className:"set-strong",children:k?"scanning on a schedule.":"scan on a schedule."}),(0,b.jsx)("span",{className:"set-dim",children:k?N?"scheduled scans are active; the latest masked leak is emailed.":"scheduled scans are active. add an email below for masked alerts.":"off. nothing runs and nothing is sent."})]})]}),(0,b.jsxs)("div",{className:"set-row set-row-interval",children:[(0,b.jsx)("span",{className:"set-dim",children:"scan every"}),(0,b.jsx)("input",{type:"number",className:"set-num",min:1,max:90,value:y,disabled:A||null===d,"aria-label":"days between scheduled scans",onChange:a=>z(Number(a.target.value)),onBlur:a=>{let b=Number(a.target.value);Number.isFinite(b)?b!==d?.intervalDays&&W(b):z(d?.intervalDays??7)}}),(0,b.jsx)("span",{className:"set-dim",children:"days"}),(0,b.jsxs)("span",{className:"set-hint",children:[1,"–",90]})]}),(0,b.jsxs)("div",{className:"set-row set-row-main",children:[(0,b.jsx)(v,{enabled:m,disabled:A||null===d,onChange:()=>void V(),label:m?"turn off system notifications":"turn on system notifications"}),(0,b.jsxs)("div",{className:"set-row-copy",children:[(0,b.jsx)("span",{className:"set-strong",children:"system notifications."}),(0,b.jsx)("span",{className:"set-dim",children:m?"on when a scheduled scan finds credentials.":"off. scheduled scans and email alerts continue."})]})]}),(0,b.jsx)("div",{className:"set-rule"}),(0,b.jsx)("div",{className:"set-row set-row-identity",children:N?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-dim",children:"reports go to"}),(0,b.jsx)("span",{className:"set-email",children:N.email}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:A,onClick:()=>void X(),children:"sign out"})]}):k?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-warn",children:"signed out — scheduled scans continue; email alerts are paused."}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:A,onClick:()=>F(!0),children:"add email alerts"})]}):(0,b.jsx)("span",{className:"set-dim",children:"scans and system notifications work without an account. add email later if you want alerts in your inbox."})}),k&&d&&!O&&(0,b.jsx)("p",{className:"set-warn",children:P?"the background service isn't available on this platform, so scheduled scans can't run here. you can still run one now.":"not-installed"===d.daemon?"the background service isn't installed, so nothing will run on the timer. install it with `failproofai config`.":"the background service is stopped, so nothing will run until it starts. repair it with `failproofai config`."}),S&&(0,b.jsxs)("p",{className:"set-warn",children:["the last scheduled scan exited ",Q?.lastExitCode,". the next one will still run."]}),(0,b.jsx)("div",{className:"set-actions",children:(0,b.jsx)("button",{type:"button",className:"btn btn-press",disabled:C,onClick:()=>void Y(),children:C?"[ scanning… ]":"[ run a scan now ]"})})]}),(0,b.jsxs)("div",{className:"set-cell set-how",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"how it works"}),(0,b.jsx)("dl",{className:"set-how-list",children:w.map(a=>(0,b.jsxs)("div",{className:"set-how-row",children:[(0,b.jsx)("dt",{className:"set-how-label",children:a.label}),(0,b.jsx)("dd",{className:"set-how-body",children:a.body})]},a.label))})]})]})]}),k&&I>0&&(0,b.jsx)(u,{lastRunAtMs:Q?.lastRunAtMs??null,nextDueAtMs:Q?.nextDueAtMs??null,now:I})]}),(0,b.jsx)(n,{open:E,source:"settings_scheduled_audit",headline:"where should the report go?",subhead:"we'll send a one-time code to confirm.",onClose:()=>F(!1),onAuthed:a=>void Z(a)})]})}],41857)}];
1
+ module.exports=[41857,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5050);let e=(0,d.createServerReference)("00f6b50473064890b0c44f3b8c2fa386cc1b19bfbb",d.callServer,void 0,d.findSourceMapURL,"getScheduledAuditAction"),f=(0,d.createServerReference)("401684fac4cdbd736839609820cbfd5214a2fef3de",d.callServer,void 0,d.findSourceMapURL,"setAutoAuditAction"),g=(0,d.createServerReference)("40ef91b7bce96f7703710c0e91b75e7376497ee007",d.callServer,void 0,d.findSourceMapURL,"setAuditIntervalAction");var h=a.i(89564),i=a.i(4543),j=a.i(18952),k=a.i(80977);function l(a){return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function m(a,b){let c=a-b;if(c<=0)return"now";let d=Math.floor(c/864e5),e=Math.floor(c%864e5/36e5);return d>0?e>0?`${d}d ${e}h`:`${d}d`:e>0?`${e}h`:`${Math.max(1,Math.floor(c/6e4))}m`}function n(a){return a.toLocaleString("en-US")}function o({label:a,value:c,sub:d,tone:e}){return(0,b.jsxs)("div",{className:"set-stat",children:[(0,b.jsx)("div",{className:"set-stat-label",children:a}),(0,b.jsx)("div",{className:`set-stat-value${e?` ${e}`:""}`,children:c}),(0,b.jsx)("div",{className:"set-stat-sub",children:d??" "})]})}function p({lastRunAtMs:a,nextDueAtMs:c,now:d}){if(null==a||null==c||c<=a)return null;let e=Math.min(100,Math.max(0,(d-a)/(c-a)*100));return(0,b.jsxs)("div",{className:"tape","aria-hidden":"true",children:[(0,b.jsxs)("div",{className:"tape-rail",children:[(0,b.jsx)("div",{className:"tape-fill",style:{width:`${e}%`}}),(0,b.jsx)("div",{className:"tape-now",style:{left:`${e}%`}})]}),(0,b.jsxs)("div",{className:"tape-ends",children:[(0,b.jsxs)("span",{children:["last scan · ",l(a)]}),(0,b.jsxs)("span",{className:"tape-next",children:["next · ",m(c,d)]})]})]})}function q({enabled:a,onChange:c,disabled:d,label:e}){return(0,b.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-label":e,disabled:d,onClick:c,className:"sw","data-on":a?"true":"false",children:(0,b.jsx)("span",{className:"sw-knob"})})}let r=[{label:"reads",body:"every session transcript on disk — your prompts, the files your agents read and wrote, and command output."},{label:"runs",body:"entirely on this machine. the transcripts never leave it."},{label:"sends",body:"counts, redacted examples, and this machine's name — and only when a scan finds something harmful."}];a.s(["default",0,function({initial:a}){let[d,s]=(0,c.useState)(a),[t,u]=(0,c.useState)(a?.auto??!1),[v,w]=(0,c.useState)(a?.intervalDays??7),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(!1),[D,E]=(0,c.useState)(null===a),[F,G]=(0,c.useState)(0),H=(0,c.useRef)(!0),I=(0,c.useRef)(null!==a),J=(0,c.useCallback)(async()=>{try{let a=await e();if(!H.current)return;s(a),I.current=!0,u(a.auto),w(a.intervalDays),G(Date.now()),E(!1)}catch{H.current&&!I.current&&E(!0)}},[]);(0,c.useEffect)(()=>(H.current=!0,J(),()=>{H.current=!1}),[J]),(0,c.useEffect)(()=>{let a=()=>void J();return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[J]);let K=d?.signedInAs??null,L=d?.daemon==="running",M=d?.daemon==="unsupported-platform",N=d?.schedule??null,O=d?.lastScan??null,P=N?.lastExitCode!=null&&0!==N.lastExitCode&&75!==N.lastExitCode,Q=(0,c.useCallback)(async()=>{y(!0);try{let a=await f(!0);if(!a.ok){if(u(!1),"unreachable"===a.reason)return void(0,j.toast)("could not reach the server. check your connection and try again.");await J(),C(!0),(0,j.toast)("that sign-in expired. one more code and it's on.");return}u(a.auto),(0,j.toast)("scheduled audits on."),await J()}catch{u(!1),(0,j.toast)("could not turn that on.")}finally{y(!1)}},[J]),R=(0,c.useCallback)(async()=>{if(t){y(!0);try{let a=await f(!1);a.ok&&u(a.auto),(0,j.toast)("scheduled audits off."),await J()}catch{(0,j.toast)("could not turn that off.")}finally{y(!1)}return}K?await Q():C(!0)},[t,Q,J,K]),S=(0,c.useCallback)(async a=>{y(!0);try{let b=await g(a);w(b.intervalDays),s(a=>a?{...a,intervalDays:b.intervalDays}:a),(0,j.toast)(`scanning every ${b.intervalDays} day${1===b.intervalDays?"":"s"}.`)}catch{w(d?.intervalDays??7),(0,j.toast)("could not save that.")}finally{y(!1)}},[d?.intervalDays]),T=(0,c.useCallback)(async()=>{y(!0);try{await fetch("/api/auth/logout",{method:"POST"}),(0,j.toast)("signed out. scans continue; digests pause."),await J()}catch{(0,j.toast)("could not sign out.")}finally{y(!1)}},[J]),U=(0,c.useCallback)(async()=>{if(!z){A(!0);try{await (0,h.triggerRun)({cli:[],since:"all",noCache:!1}),(0,j.toast)("scan complete."),await J()}catch(a){(0,j.toast)(a instanceof h.RerunError&&"timeout"===a.kind?"the scan is taking a while — it will finish in the background.":"the scan could not be completed.")}finally{A(!1)}}},[J,z]),V=(0,c.useCallback)(async a=>{C(!1),await J(),await Q()},[Q,J]),W=d?L?{value:"running",sub:null!=d.daemonStartedAtMs&&F>0?`up ${function(a){let b=Math.floor(a/864e5);if(b>0)return`${b}d`;let c=Math.floor(a/36e5);return c>0?`${c}h`:`${Math.max(1,Math.floor(a/6e4))}m`}(Math.max(0,F-d.daemonStartedAtMs))}`:"",tone:"ok"}:M?{value:"unavailable",sub:"not on this platform"}:"not-installed"===d.daemon?{value:"not installed",sub:"run failproofai config",tone:"warn"}:"unknown"===d.daemon?{value:"unknown",sub:"could not read it"}:{value:"stopped",sub:"run failproofai config",tone:"warn"}:{value:"…",sub:"reading"},X=t?N?.nextDueAtMs==null?{value:"pending",sub:"after the next scan"}:{value:F>0?m(N.nextDueAtMs,F):"—",sub:l(N.nextDueAtMs)}:{value:"off",sub:"nothing scheduled"},Y=O?{value:(0,k.formatRelativeTime)(Date.parse(O.finishedAt)),sub:null!=O.sessionsScanned?`${n(O.sessionsScanned)} sessions`:"scanned"}:{value:"none yet",sub:"run one below"},Z=O?null==O.findings?{value:"—",sub:"unreadable"}:{value:n(O.findings),sub:"this scan",...O.findings>0?{tone:"warn"}:{}}:{value:"—",sub:"no scan yet"};return(0,b.jsxs)("main",{className:"report",children:[(0,b.jsxs)("section",{className:"section set-sec",children:[(0,b.jsxs)("div",{className:"set-mast",children:[(0,b.jsx)("h1",{className:"set-title",children:"settings"}),(0,b.jsx)("p",{className:"set-lede",children:"keeping watch, so you don't have to."})]}),D?(0,b.jsx)("div",{className:"set-console",children:(0,b.jsx)("div",{className:"set-cell",children:(0,b.jsxs)("p",{className:"set-warn",children:["could not read this machine's settings. check that the dashboard can reach ",(0,b.jsx)("code",{children:"~/.failproofai/config.json"}),"."]})})}):(0,b.jsxs)("div",{className:"set-console",children:[(0,b.jsxs)("div",{className:"set-stats",children:[(0,b.jsx)(o,{label:"daemon",...W}),(0,b.jsx)(o,{label:"next scan",...X}),(0,b.jsx)(o,{label:"last scan",...Y}),(0,b.jsx)(o,{label:"findings",...Z})]}),(0,b.jsxs)("div",{className:"set-cols",children:[(0,b.jsxs)("div",{className:"set-cell set-config",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"scheduled audit"}),(0,b.jsxs)("div",{className:"set-row set-row-main",children:[(0,b.jsx)(q,{enabled:t,disabled:x||null===d,onChange:()=>void R(),label:t?"turn off scheduled audits":"turn on scheduled audits"}),(0,b.jsxs)("div",{className:"set-row-copy",children:[(0,b.jsx)("span",{className:"set-strong",children:t?"scanning on a schedule.":"scan on a schedule."}),(0,b.jsx)("span",{className:"set-dim",children:t?"you'll get an email only when a scan finds something.":"off. nothing runs and nothing is sent."})]})]}),(0,b.jsxs)("div",{className:"set-row set-row-interval",children:[(0,b.jsx)("span",{className:"set-dim",children:"scan every"}),(0,b.jsx)("input",{type:"number",className:"set-num",min:1,max:90,value:v,disabled:x||null===d,"aria-label":"days between scheduled scans",onChange:a=>w(Number(a.target.value)),onBlur:a=>{let b=Number(a.target.value);Number.isFinite(b)?b!==d?.intervalDays&&S(b):w(d?.intervalDays??7)}}),(0,b.jsx)("span",{className:"set-dim",children:"days"}),(0,b.jsxs)("span",{className:"set-hint",children:[1,"–",90]})]}),(0,b.jsx)("div",{className:"set-rule"}),(0,b.jsx)("div",{className:"set-row set-row-identity",children:K?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-dim",children:"reports go to"}),(0,b.jsx)("span",{className:"set-email",children:K.email}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:x,onClick:()=>void T(),children:"sign out"})]}):t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"set-warn",children:"signed out — scans continue, digests are paused."}),(0,b.jsx)("button",{type:"button",className:"set-link",disabled:x,onClick:()=>C(!0),children:"sign in to resume"})]}):(0,b.jsx)("span",{className:"set-dim",children:"turning this on asks for an email, so there is somewhere to send the report."})}),t&&d&&!L&&(0,b.jsx)("p",{className:"set-warn",children:M?"the background service isn't available on this platform, so scheduled scans can't run here. you can still run one now.":"not-installed"===d.daemon?"the background service isn't installed, so nothing will run on the timer. install it with `failproofai config`.":"the background service is stopped, so nothing will run until it starts. repair it with `failproofai config`."}),P&&(0,b.jsxs)("p",{className:"set-warn",children:["the last scheduled scan exited ",N?.lastExitCode,". the next one will still run."]}),(0,b.jsx)("div",{className:"set-actions",children:(0,b.jsx)("button",{type:"button",className:"btn btn-press",disabled:z,onClick:()=>void U(),children:z?"[ scanning… ]":"[ run a scan now ]"})})]}),(0,b.jsxs)("div",{className:"set-cell set-how",children:[(0,b.jsx)("h2",{className:"set-cell-title",children:"how it works"}),(0,b.jsx)("dl",{className:"set-how-list",children:r.map(a=>(0,b.jsxs)("div",{className:"set-how-row",children:[(0,b.jsx)("dt",{className:"set-how-label",children:a.label}),(0,b.jsx)("dd",{className:"set-how-body",children:a.body})]},a.label))})]})]})]}),t&&F>0&&(0,b.jsx)(p,{lastRunAtMs:N?.lastRunAtMs??null,nextDueAtMs:N?.nextDueAtMs??null,now:F})]}),(0,b.jsx)(i.AuthDialog,{open:B,source:"settings_scheduled_audit",headline:"where should the report go?",subhead:"we'll send a one-time code to confirm.",onClose:()=>C(!1),onAuthed:a=>void V(a)})]})}],41857)}];
2
2
 
3
3
  //# sourceMappingURL=app_settings_settings-client_tsx_20lq-mq._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[96877,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(34900),e=a.i(87488),f=a.i(33432),g=a.i(32460);function h(a){return"string"==typeof a&&a.length>0?a:void 0}async function i(){let a=(0,e.listOpenClawTranscripts)(),d=new Map,f=new Map;for(let g of a){let a=d.get(g.agentId);a||(a=function(a){let d,f=new Map,g=(0,c.join)((0,e.openclawHome)(),"agents",a,"sessions","sessions.json");try{d=JSON.parse((0,b.readFileSync)(g,"utf-8"))}catch{return f}if(!d||"object"!=typeof d)return f;for(let a of Object.values(d)){if(!a||"object"!=typeof a)continue;let b=h(a.sessionId);if(!b)continue;let c=a.origin&&"object"==typeof a.origin?a.origin:{},d="number"==typeof a.lastInteractionAt?a.lastInteractionAt:"number"==typeof a.updatedAt?a.updatedAt:void 0;f.set(b,{lastMs:d,channel:h(a.lastChannel)??h(c.provider)??h(c.surface),chatType:h(a.chatType)??h(c.chatType),label:h(c.label),chatId:h(a.lastTo)??h(c.from)})}return f}(g.agentId),d.set(g.agentId,a));let i=a.get(g.sessionId);f.set(`${g.agentId}\0${g.sessionId}`,{sessionId:g.sessionId,agentId:g.agentId,channel:i?.channel??"local",label:i?.label,chatType:i?.chatType,chatId:i?.chatId,transcriptPath:g.transcriptPath,mtimeMs:i?.lastMs??g.mtimeMs,sizeBytes:g.sizeBytes})}for(let a of(await (0,g.listOpenClawSqliteSessions)((0,e.openclawHome)(),(0,e.listOpenClawAgents)())))f.set(`${a.agentId}\0${a.sessionId}`,a);return[...f.values()].sort((a,b)=>b.mtimeMs-a.mtimeMs)}let j=(0,d.runtimeCache)(i,2);function k(a,b){return`openclaw-${a}-${b}`}function l(a,b){return`openclaw:${a}:${b}`}function m(a){if(!a.startsWith("openclaw-"))return[];let b=a.slice(9);if(!b)return[];let c=[];for(let a of(0,e.listOpenClawAgents)().sort((a,b)=>b.length-a.length)){let d=`${a}-`;b.startsWith(d)&&b.length>d.length&&c.push({agentId:a,channel:b.slice(d.length)})}return c.push({agentId:null,channel:b}),c}async function n(){let a=await i(),b=new Map;for(let c of a){let a=JSON.stringify([c.agentId,c.channel]),d=b.get(a);d?(d.latest=Math.max(d.latest,c.mtimeMs),d.count+=1):b.set(a,{agentId:c.agentId,channel:c.channel,latest:c.mtimeMs,count:1})}let c=[];for(let{agentId:a,channel:d,latest:e,count:g}of b.values()){let b=new Date(e);c.push({name:k(a,d),path:l(a,d),isDirectory:!0,lastModified:b,lastModifiedFormatted:(0,f.formatDate)(b),cli:["openclaw"],sessionCount:g})}return c.sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime()),c}async function o(a){let b=m(a);if(0===b.length)return{cwd:null,sessions:[]};let c=await i(),d=a=>c.filter(b=>b.channel===a.channel&&(null===a.agentId||b.agentId===a.agentId)),e=b[0],g=d(e);if(0===g.length)for(let a of b.slice(1)){let b=d(a);if(b.length>0){e=a,g=b;break}}let{agentId:h,channel:j}=e;return{cwd:null===h?`openclaw:${j}`:l(h,j),sessions:g.map(a=>{let b=new Date(a.mtimeMs);return{name:a.label??a.chatId??a.sessionId,path:a.sessionId,lastModified:b,lastModifiedFormatted:(0,f.formatDate)(b),sessionId:a.sessionId,cli:"openclaw",channelId:a.chatId,channelType:a.chatType}})}}let p=(0,d.runtimeCache)(n,2),q=(0,d.runtimeCache)(a=>o(a),2,{maxSize:50});a.s(["getCachedOpenClawProjects",0,p,"getCachedOpenClawSessions",0,j,"getCachedOpenClawSessionsByEncodedName",0,q,"getOpenClawProjects",0,n,"getOpenClawSessions",0,i,"getOpenClawSessionsByEncodedName",0,o,"openClawProjectName",0,k,"openClawProjectNameCandidates",0,m,"openClawProjectPath",0,l,"parseOpenClawProjectName",0,function(a){return m(a)[0]??null}])}];
1
+ module.exports=[96877,a=>{"use strict";var b=a.i(2157),c=a.i(50227),d=a.i(34900),e=a.i(87488),f=a.i(33432);function g(a){return"string"==typeof a&&a.length>0?a:void 0}async function h(){let a=(0,e.listOpenClawTranscripts)(),d=new Map,f=[];for(let h of a){let a=d.get(h.agentId);a||(a=function(a){let d,f=new Map,h=(0,c.join)((0,e.openclawHome)(),"agents",a,"sessions","sessions.json");try{d=JSON.parse((0,b.readFileSync)(h,"utf-8"))}catch{return f}if(!d||"object"!=typeof d)return f;for(let a of Object.values(d)){if(!a||"object"!=typeof a)continue;let b=g(a.sessionId);if(!b)continue;let c=a.origin&&"object"==typeof a.origin?a.origin:{},d="number"==typeof a.lastInteractionAt?a.lastInteractionAt:"number"==typeof a.updatedAt?a.updatedAt:void 0;f.set(b,{lastMs:d,channel:g(a.lastChannel)??g(c.provider)??g(c.surface),chatType:g(a.chatType)??g(c.chatType),label:g(c.label),chatId:g(a.lastTo)??g(c.from)})}return f}(h.agentId),d.set(h.agentId,a));let i=a.get(h.sessionId);f.push({sessionId:h.sessionId,agentId:h.agentId,channel:i?.channel??"local",label:i?.label,chatType:i?.chatType,chatId:i?.chatId,transcriptPath:h.transcriptPath,mtimeMs:i?.lastMs??h.mtimeMs,sizeBytes:h.sizeBytes})}return f.sort((a,b)=>b.mtimeMs-a.mtimeMs),f}let i=(0,d.runtimeCache)(h,2);function j(a,b){return`openclaw-${a}-${b}`}function k(a,b){return`openclaw:${a}:${b}`}function l(a){if(!a.startsWith("openclaw-"))return[];let b=a.slice(9);if(!b)return[];let c=[];for(let a of(0,e.listOpenClawAgents)().sort((a,b)=>b.length-a.length)){let d=`${a}-`;b.startsWith(d)&&b.length>d.length&&c.push({agentId:a,channel:b.slice(d.length)})}return c.push({agentId:null,channel:b}),c}async function m(){let a=await h(),b=new Map;for(let c of a){let a=JSON.stringify([c.agentId,c.channel]),d=b.get(a);d?(d.latest=Math.max(d.latest,c.mtimeMs),d.count+=1):b.set(a,{agentId:c.agentId,channel:c.channel,latest:c.mtimeMs,count:1})}let c=[];for(let{agentId:a,channel:d,latest:e,count:g}of b.values()){let b=new Date(e);c.push({name:j(a,d),path:k(a,d),isDirectory:!0,lastModified:b,lastModifiedFormatted:(0,f.formatDate)(b),cli:["openclaw"],sessionCount:g})}return c.sort((a,b)=>b.lastModified.getTime()-a.lastModified.getTime()),c}async function n(a){let b=l(a);if(0===b.length)return{cwd:null,sessions:[]};let c=await h(),d=a=>c.filter(b=>b.channel===a.channel&&(null===a.agentId||b.agentId===a.agentId)),e=b[0],g=d(e);if(0===g.length)for(let a of b.slice(1)){let b=d(a);if(b.length>0){e=a,g=b;break}}let{agentId:i,channel:j}=e;return{cwd:null===i?`openclaw:${j}`:k(i,j),sessions:g.map(a=>{let b=new Date(a.mtimeMs);return{name:a.label??a.chatId??a.sessionId,path:a.sessionId,lastModified:b,lastModifiedFormatted:(0,f.formatDate)(b),sessionId:a.sessionId,cli:"openclaw",channelId:a.chatId,channelType:a.chatType}})}}let o=(0,d.runtimeCache)(m,2),p=(0,d.runtimeCache)(a=>n(a),2,{maxSize:50});a.s(["getCachedOpenClawProjects",0,o,"getCachedOpenClawSessions",0,i,"getCachedOpenClawSessionsByEncodedName",0,p,"getOpenClawProjects",0,m,"getOpenClawSessions",0,h,"getOpenClawSessionsByEncodedName",0,n,"openClawProjectName",0,j,"openClawProjectNameCandidates",0,l,"openClawProjectPath",0,k,"parseOpenClawProjectName",0,function(a){return l(a)[0]??null}])}];
2
2
 
3
3
  //# sourceMappingURL=lib_openclaw-projects_ts_0qxq3bp._.js.map