failproofai 1.0.0-beta.5 → 1.0.0-beta.7

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 (368) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +1 -1
  6. package/.next/standalone/.next/routes-manifest.json +6 -0
  7. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page.js +3 -1
  9. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  13. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  14. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  15. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  16. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  17. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page.js +3 -1
  20. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  23. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  24. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  25. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  26. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  27. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  28. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  29. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  30. package/.next/standalone/.next/server/app/api/audit/invite/route.js +3 -2
  31. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/audit/run/route.js +4 -3
  33. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/audit/status/route.js +1 -1
  35. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/auth/login-request/route.js +2 -1
  37. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +3 -2
  39. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/auth/logout/route.js +3 -2
  41. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/auth/reminder/route.js +3 -2
  43. package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/auth/status/route.js +3 -2
  45. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +1 -1
  47. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  49. package/.next/standalone/.next/server/app/audit/page.js +5 -3
  50. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/index.html +1 -1
  53. package/.next/standalone/.next/server/app/index.rsc +15 -15
  54. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  55. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  56. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  57. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  58. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  59. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  60. package/.next/standalone/.next/server/app/page.js +3 -1
  61. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +10 -10
  64. package/.next/standalone/.next/server/app/policies/page.js +4 -2
  65. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  68. package/.next/standalone/.next/server/app/project/[name]/page.js +4 -2
  69. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  72. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  73. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +6 -4
  74. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  77. package/.next/standalone/.next/server/app/projects/page.js +4 -2
  78. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/settings/page/app-paths-manifest.json +3 -0
  81. package/.next/standalone/.next/server/app/settings/page/build-manifest.json +18 -0
  82. package/.next/standalone/.next/server/app/settings/page/next-font-manifest.json +6 -0
  83. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
  84. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +53 -0
  85. package/.next/standalone/.next/server/app/settings/page.js +18 -0
  86. package/.next/standalone/.next/server/app/settings/page.js.map +5 -0
  87. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -0
  88. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +3 -0
  89. package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
  90. package/.next/standalone/.next/server/chunks/{[externals]__1nl3dvw._.js → [externals]__0r-zamh._.js} +2 -2
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06hexd0._.js +3 -0
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__094p1f1._.js +3 -0
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_0xu5z._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ed01_d._.js +3 -0
  95. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g0vcwt._.js +3 -0
  96. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0h3lfmp._.js → [root-of-the-server]__0ky_n0r._.js} +2 -2
  97. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__18d-9oi._.js → [root-of-the-server]__0lk_935._.js} +2 -2
  98. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1p7s8-d._.js → [root-of-the-server]__0pbp9fe._.js} +2 -2
  99. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q-v9z2._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__10oa-v9._.js → [root-of-the-server]__0v2fpxe._.js} +2 -2
  101. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0sb_5m8._.js → [root-of-the-server]__131ebum._.js} +3 -3
  102. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-dh5jy._.js → [root-of-the-server]__1_ps0jw._.js} +2 -2
  103. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0l4vuqm._.js → [root-of-the-server]__1a7i2q4._.js} +1 -1
  104. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ibjy5x._.js +3 -0
  105. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1iny24d._.js +3 -0
  106. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tvn4wf._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tyedjt._.js +3 -0
  108. package/.next/standalone/.next/server/chunks/_0lxbzdq._.js +5 -0
  109. package/.next/standalone/.next/server/chunks/_1zuiiy3._.js +5 -0
  110. package/.next/standalone/.next/server/chunks/lib_telemetry_ts_0dctyyw._.js +5 -0
  111. package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +5 -5
  112. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06bp_fg._.js +5 -0
  114. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__074qmkp._.js +3 -0
  115. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0c_qcgp._.js +3 -0
  116. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kbc9bs._.js +3 -0
  117. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0spkm68._.js +10 -10
  118. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1a2hcb_._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0rtdfof._.js → [root-of-the-server]__1rdruw4._.js} +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1rv-sc9._.js +3 -0
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tyf0tc._.js +5 -0
  122. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1u-wx42._.js +4 -0
  123. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1v185mo._.js +3 -0
  124. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0rag5dg._.js → [root-of-the-server]__1yw368c._.js} +2 -2
  125. package/.next/standalone/.next/server/chunks/ssr/_0-yi74u._.js +3 -0
  126. package/.next/standalone/.next/server/chunks/ssr/_04mekdy._.js +3 -0
  127. package/.next/standalone/.next/server/chunks/ssr/_0r-dsre._.js +3 -0
  128. package/.next/standalone/.next/server/chunks/ssr/_0rjgfln._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/_0se484m._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/ssr/_0uz7o9y._.js +3 -0
  131. package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/_194yh9u._.js +3 -0
  133. package/.next/standalone/.next/server/chunks/ssr/_1fahg9e._.js +3 -0
  134. package/.next/standalone/.next/server/chunks/ssr/_1gmzkwj._.js +5 -0
  135. package/.next/standalone/.next/server/chunks/ssr/_1w8sola._.js +3 -0
  136. package/.next/standalone/.next/server/chunks/ssr/_1w_6p9g._.js +3 -0
  137. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +2 -2
  138. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +2 -2
  140. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0dwo94s.js +4 -0
  141. package/.next/standalone/.next/server/chunks/ssr/src_hooks_builtin-policies_ts_09j2ndl._.js +3 -0
  142. package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589g._.js +5 -0
  143. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  144. package/.next/standalone/.next/server/middleware.js +2 -2
  145. package/.next/standalone/.next/server/pages/404.html +1 -1
  146. package/.next/standalone/.next/server/pages/500.html +1 -1
  147. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/server-reference-manifest.json +54 -12
  149. package/.next/standalone/.next/static/chunks/0945ybz3fsvba.js +1 -0
  150. package/.next/standalone/.next/static/chunks/{0cr85wuc9gc9k.js → 0gr76ps8_zm26.js} +1 -1
  151. package/.next/standalone/.next/static/chunks/{2cqk4a9s893oy.js → 0m-m7wgtxdoav.js} +1 -1
  152. package/.next/standalone/.next/static/chunks/{1tp9dex23zs8y.js → 11l6oh9cyb35a.js} +1 -1
  153. package/.next/standalone/.next/static/chunks/166f8qnh03jqc.js +6 -0
  154. package/.next/standalone/.next/static/chunks/1bm0q12hgs22l.css +2 -0
  155. package/.next/standalone/.next/static/chunks/1v1gqvpjk62jm.js +1 -0
  156. package/.next/standalone/.next/static/chunks/{2s9g1dsde_ts1.js → 2aej0vi1fm87m.js} +1 -1
  157. package/.next/standalone/.next/static/chunks/{1bkynffp3q1f7.js → 2bxld6-rym3ah.js} +22 -22
  158. package/.next/standalone/.next/static/chunks/{2v1rpzrh2i1wv.js → 2p2kz4aj1tooj.js} +1 -1
  159. package/.next/standalone/.next/static/chunks/2uvhw57mf9lg_.css +2 -0
  160. package/.next/standalone/.next/static/chunks/36pc3_8fpb6ic.js +1 -0
  161. package/.next/standalone/.next/static/chunks/{2k285z07qce47.js → 3t1wr_kx6brwc.js} +1 -1
  162. package/.next/standalone/app/actions/get-hooks-config.ts +2 -1
  163. package/.next/standalone/app/actions/get-scheduled-audit.ts +70 -0
  164. package/.next/standalone/app/actions/update-scheduled-audit.ts +44 -0
  165. package/.next/standalone/app/api/audit/run/route.ts +28 -0
  166. package/.next/standalone/app/api/audit/status/route.ts +13 -1
  167. package/.next/standalone/app/api/auth/status/route.ts +1 -1
  168. package/.next/standalone/app/audit/_components/auth-dialog.css +159 -0
  169. package/.next/standalone/app/audit/_components/auth-dialog.tsx +3 -0
  170. package/.next/standalone/app/audit/audit-styles.css +6 -149
  171. package/.next/standalone/app/settings/page.tsx +31 -0
  172. package/.next/standalone/app/settings/settings-client.tsx +488 -0
  173. package/.next/standalone/components/navbar.tsx +2 -0
  174. package/.next/standalone/lib/auth/api-server-client.ts +2 -3
  175. package/.next/standalone/lib/auth/auth-store.ts +4 -4
  176. package/.next/standalone/lib/codex-sessions.ts +2 -1
  177. package/.next/standalone/lib/dashboard-host.ts +101 -0
  178. package/.next/standalone/lib/install-check.ts +22 -7
  179. package/.next/standalone/lib/pi-sessions.ts +99 -14
  180. package/.next/standalone/lib/telemetry-enabled.ts +54 -0
  181. package/.next/standalone/lib/telemetry-id.ts +52 -1
  182. package/.next/standalone/lib/telemetry.ts +8 -4
  183. package/.next/standalone/node_modules/react/cjs/react.development.js +1 -1
  184. package/.next/standalone/node_modules/react/cjs/react.production.js +1 -1
  185. package/.next/standalone/node_modules/react/package.json +3 -3
  186. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
  187. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
  188. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
  189. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
  190. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
  191. package/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
  192. package/.next/standalone/node_modules/react-dom/package.json +4 -4
  193. package/.next/standalone/package.json +7 -6
  194. package/.next/standalone/proxy.ts +89 -1
  195. package/.next/standalone/server.js +1 -1
  196. package/bin/failproofai.mjs +202 -86
  197. package/dist/cli.mjs +17803 -15346
  198. package/dist/worker.mjs +1620 -257
  199. package/lib/auth/api-server-client.ts +2 -3
  200. package/lib/auth/auth-store.ts +4 -4
  201. package/lib/codex-sessions.ts +2 -1
  202. package/lib/dashboard-host.ts +101 -0
  203. package/lib/install-check.ts +22 -7
  204. package/lib/pi-sessions.ts +99 -14
  205. package/lib/telemetry-enabled.ts +54 -0
  206. package/lib/telemetry-id.ts +52 -1
  207. package/lib/telemetry.ts +8 -4
  208. package/package.json +7 -6
  209. package/scripts/install-telemetry.mjs +8 -1
  210. package/scripts/launch.ts +25 -3
  211. package/scripts/parse-script-args.ts +17 -1
  212. package/scripts/prune-standalone.mjs +20 -0
  213. package/scripts/translate-docs/readme-translator.ts +163 -4
  214. package/scripts/validate-mdx.ts +153 -13
  215. package/src/audit/audit-lock.ts +285 -0
  216. package/src/audit/audit-schedule.ts +111 -0
  217. package/src/audit/cache.ts +18 -4
  218. package/src/audit/cli-adapters/goose.ts +2 -1
  219. package/src/audit/cli-adapters/hermes.ts +28 -10
  220. package/src/audit/cli.ts +191 -35
  221. package/src/audit/dashboard-cache.ts +2 -1
  222. package/src/hooks/builtin-policies.ts +100 -3
  223. package/src/hooks/cloud-connection.ts +160 -14
  224. package/src/hooks/cloud-enrollment-cli.ts +119 -21
  225. package/src/hooks/cloud-enrollment.ts +87 -17
  226. package/src/hooks/cloud-introspect.ts +147 -0
  227. package/src/hooks/cloud-managed-policies.ts +33 -2
  228. package/src/hooks/collector-config.ts +25 -43
  229. package/src/hooks/configure-wizard.ts +750 -318
  230. package/src/hooks/custom-hooks-loader.ts +125 -11
  231. package/src/hooks/daemon-client.ts +83 -17
  232. package/src/hooks/daemon-download.ts +54 -2
  233. package/src/hooks/daemon-service.ts +605 -29
  234. package/src/hooks/first-run-gate.ts +39 -0
  235. package/src/hooks/fp-config.ts +497 -0
  236. package/src/hooks/fp-home.ts +355 -0
  237. package/src/hooks/fp-reset.ts +332 -0
  238. package/src/hooks/handler.ts +42 -1
  239. package/src/hooks/hook-activity-store.ts +35 -20
  240. package/src/hooks/hook-logger.ts +2 -1
  241. package/src/hooks/hook-telemetry.ts +5 -1
  242. package/src/hooks/hooks-config.ts +4 -3
  243. package/src/hooks/loader-utils.ts +166 -5
  244. package/src/hooks/manager.ts +5 -4
  245. package/src/hooks/onboarding-attempt.ts +179 -0
  246. package/src/hooks/onboarding-lock.ts +119 -0
  247. package/src/hooks/policy-types.ts +0 -7
  248. package/src/hooks/session-pause-cli.ts +15 -13
  249. package/src/hooks/session-pause.ts +36 -4
  250. package/src/hooks/setup-state.ts +256 -0
  251. package/src/hooks/tui.ts +4 -4
  252. package/src/hooks/worker-server.ts +53 -1
  253. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0f8nu8d._.js +0 -3
  254. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0szqzl8._.js +0 -3
  255. package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +0 -3
  256. package/.next/standalone/.next/server/chunks/[root-of-the-server]__19120tr._.js +0 -3
  257. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fwl2mz._.js +0 -3
  258. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1myjm-d._.js +0 -3
  259. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1rhmvod._.js +0 -3
  260. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02r5bgf._.js +0 -4
  261. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__094nop3._.js +0 -3
  262. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e8sjqm._.js +0 -4
  263. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lkzqax._.js +0 -4
  264. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ls0gsr._.js +0 -4
  265. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n_uvv0._.js +0 -3
  266. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qucxyj._.js +0 -4
  267. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u02miy._.js +0 -4
  268. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14dd6h8._.js +0 -3
  269. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1gak4pd._.js +0 -3
  270. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1j4u3yd._.js +0 -4
  271. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1zqz4v8._.js +0 -4
  272. package/.next/standalone/.next/server/chunks/ssr/_1m_p7pi._.js +0 -3
  273. package/.next/standalone/.next/server/chunks/ssr/node_modules_html-to-image_es_index_12c_2cz.js +0 -3
  274. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1ezd2jf._.js +0 -5
  275. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1tnuifj._.js +0 -5
  276. package/.next/standalone/.next/static/chunks/0h7auy7hzjyhw.js +0 -1
  277. package/.next/standalone/.next/static/chunks/1bw4dfzflelcv.js +0 -1
  278. package/.next/standalone/.next/static/chunks/34sjdw8lv46e3.js +0 -6
  279. package/.next/standalone/.next/static/chunks/3i27c3hcriawq.css +0 -1
  280. package/.next/standalone/.next/static/chunks/3zdwnnthucs_1.css +0 -2
  281. package/.next/standalone/Cargo.lock +0 -2222
  282. package/.next/standalone/Cargo.toml +0 -9
  283. package/.next/standalone/crates/CLOUD_POLICIES.md +0 -136
  284. package/.next/standalone/crates/PROTOCOL.md +0 -122
  285. package/.next/standalone/crates/failproofaid/Cargo.toml +0 -25
  286. package/.next/standalone/crates/failproofaid/src/cloud_client.rs +0 -484
  287. package/.next/standalone/crates/failproofaid/src/cloud_policies.rs +0 -921
  288. package/.next/standalone/crates/failproofaid/src/lock.rs +0 -81
  289. package/.next/standalone/crates/failproofaid/src/main.rs +0 -639
  290. package/.next/standalone/crates/failproofaid/src/paths.rs +0 -201
  291. package/.next/standalone/crates/failproofaid/src/server.rs +0 -502
  292. package/.next/standalone/crates/failproofaid/src/worker.rs +0 -400
  293. package/.next/standalone/crates/failproofaid/tests/daemon_e2e.rs +0 -241
  294. package/.next/standalone/crates/fpai-collect/Cargo.toml +0 -43
  295. package/.next/standalone/crates/fpai-collect/src/config.rs +0 -420
  296. package/.next/standalone/crates/fpai-collect/src/cursor.rs +0 -520
  297. package/.next/standalone/crates/fpai-collect/src/delivery.rs +0 -472
  298. package/.next/standalone/crates/fpai-collect/src/filetail.rs +0 -487
  299. package/.next/standalone/crates/fpai-collect/src/health.rs +0 -369
  300. package/.next/standalone/crates/fpai-collect/src/lib.rs +0 -34
  301. package/.next/standalone/crates/fpai-collect/src/redact.rs +0 -516
  302. package/.next/standalone/crates/fpai-collect/src/sources/claude/mod.rs +0 -279
  303. package/.next/standalone/crates/fpai-collect/src/sources/claude/transform.rs +0 -619
  304. package/.next/standalone/crates/fpai-collect/src/sources/codex/mod.rs +0 -156
  305. package/.next/standalone/crates/fpai-collect/src/sources/codex/transform.rs +0 -715
  306. package/.next/standalone/crates/fpai-collect/src/sources/copilot/mod.rs +0 -158
  307. package/.next/standalone/crates/fpai-collect/src/sources/copilot/transform.rs +0 -512
  308. package/.next/standalone/crates/fpai-collect/src/sources/goose/mod.rs +0 -511
  309. package/.next/standalone/crates/fpai-collect/src/sources/goose/transform.rs +0 -586
  310. package/.next/standalone/crates/fpai-collect/src/sources/hermes/mod.rs +0 -318
  311. package/.next/standalone/crates/fpai-collect/src/sources/hermes/transform.rs +0 -579
  312. package/.next/standalone/crates/fpai-collect/src/sources/hooks/mod.rs +0 -314
  313. package/.next/standalone/crates/fpai-collect/src/sources/hooks/transform.rs +0 -448
  314. package/.next/standalone/crates/fpai-collect/src/sources/mod.rs +0 -23
  315. package/.next/standalone/crates/fpai-collect/src/sources/openclaw/mod.rs +0 -176
  316. package/.next/standalone/crates/fpai-collect/src/sources/openclaw/transform.rs +0 -500
  317. package/.next/standalone/crates/fpai-collect/src/sources/opencode/mod.rs +0 -315
  318. package/.next/standalone/crates/fpai-collect/src/sources/opencode/transform.rs +0 -493
  319. package/.next/standalone/crates/fpai-collect/src/sources/pi/mod.rs +0 -201
  320. package/.next/standalone/crates/fpai-collect/src/sources/pi/transform.rs +0 -533
  321. package/.next/standalone/crates/fpai-collect/src/spool.rs +0 -535
  322. package/.next/standalone/crates/fpai-collect/src/sqlitepoll.rs +0 -390
  323. package/.next/standalone/crates/fpai-collect/src/supervisor.rs +0 -423
  324. package/.next/standalone/crates/fpai-collect/src/uploader.rs +0 -600
  325. package/.next/standalone/crates/fpai-collect/tests/claude_source.rs +0 -739
  326. package/.next/standalone/crates/fpai-collect/tests/claude_subagents.rs +0 -394
  327. package/.next/standalone/crates/fpai-collect/tests/codex_source.rs +0 -976
  328. package/.next/standalone/crates/fpai-collect/tests/config.rs +0 -286
  329. package/.next/standalone/crates/fpai-collect/tests/copilot_source.rs +0 -1020
  330. package/.next/standalone/crates/fpai-collect/tests/delivery.rs +0 -281
  331. package/.next/standalone/crates/fpai-collect/tests/goose_source.rs +0 -1009
  332. package/.next/standalone/crates/fpai-collect/tests/hermes_source.rs +0 -1130
  333. package/.next/standalone/crates/fpai-collect/tests/hooks_source.rs +0 -622
  334. package/.next/standalone/crates/fpai-collect/tests/openclaw_source.rs +0 -855
  335. package/.next/standalone/crates/fpai-collect/tests/opencode_source.rs +0 -1478
  336. package/.next/standalone/crates/fpai-collect/tests/pi_source.rs +0 -1192
  337. package/.next/standalone/crates/fpai-collect/tests/supervisor.rs +0 -290
  338. package/.next/standalone/crates/fpai-collect/tests/uploader.rs +0 -506
  339. package/.next/standalone/crates/fpai-ipc/Cargo.toml +0 -16
  340. package/.next/standalone/crates/fpai-ipc/src/envelope.rs +0 -175
  341. package/.next/standalone/crates/fpai-ipc/src/framing.rs +0 -177
  342. package/.next/standalone/crates/fpai-ipc/src/lib.rs +0 -10
  343. package/.next/standalone/crates/fpai-ipc/src/peer.rs +0 -80
  344. package/.next/standalone/docker-hook-sync/Dockerfile +0 -79
  345. package/.next/standalone/docker-hook-sync/entrypoint.sh +0 -109
  346. package/.next/standalone/integration-suite/Dockerfile +0 -47
  347. package/.next/standalone/integration-suite/README.md +0 -129
  348. package/.next/standalone/integration-suite/canary-policies.mjs +0 -45
  349. package/.next/standalone/integration-suite/capture-tokens.sh +0 -48
  350. package/.next/standalone/integration-suite/ci-entrypoint.sh +0 -179
  351. package/.next/standalone/integration-suite/inject-tokens.sh +0 -44
  352. package/.next/standalone/integration-suite/install-clis.sh +0 -136
  353. package/.next/standalone/integration-suite/probe-cli.sh +0 -248
  354. package/.next/standalone/integration-suite/report.js +0 -120
  355. package/.next/standalone/integration-suite/run.sh +0 -159
  356. package/.next/standalone/openclaw-plugin/index.js +0 -223
  357. package/.next/standalone/openclaw-plugin/openclaw.plugin.json +0 -6
  358. package/.next/standalone/openclaw-plugin/package.json +0 -12
  359. package/.next/standalone/osv-scanner.toml +0 -17
  360. package/.next/standalone/pi-extension/index.ts +0 -524
  361. package/.next/standalone/pi-extension/package.json +0 -12
  362. package/.next/standalone/postcss.config.mjs +0 -8
  363. package/.next/standalone/readme-arch-hq.gif +0 -0
  364. package/.next/standalone/rust-toolchain.toml +0 -4
  365. package/src/auth/cli.ts +0 -371
  366. /package/.next/standalone/.next/static/{LOuwMmfomO6hQYfMQYs4K → LUaLkKg40nSkHrIajexIk}/_buildManifest.js +0 -0
  367. /package/.next/standalone/.next/static/{LOuwMmfomO6hQYfMQYs4K → LUaLkKg40nSkHrIajexIk}/_clientMiddlewareManifest.js +0 -0
  368. /package/.next/standalone/.next/static/{LOuwMmfomO6hQYfMQYs4K → LUaLkKg40nSkHrIajexIk}/_ssgManifest.js +0 -0
@@ -124,13 +124,13 @@ if (hookIdx >= 0) {
124
124
  // machine until `failproofai config` has installed failproofaid AND
125
125
  // written the daemonConfigured marker (Stage 4). Until then this is
126
126
  // byte-for-byte the same handleHookEvent(...) call below.
127
- const { isDaemonConfigured, tryDaemonHook } = await import("../src/hooks/daemon-client");
127
+ const { isDaemonConfigured, attemptDaemonHook } = await import("../src/hooks/daemon-client");
128
128
  if (isDaemonConfigured()) {
129
129
  const { readStdinPayload } = await import("../src/hooks/read-stdin");
130
130
  const { evaluateHookEvent } = await import("../src/hooks/handler");
131
131
  const stdinRead = await readStdinPayload();
132
132
 
133
- const daemonResult = await tryDaemonHook({
133
+ const attempt = await attemptDaemonHook({
134
134
  hookEvent: eventType,
135
135
  cli,
136
136
  stdin: stdinRead.payload,
@@ -140,21 +140,40 @@ if (hookIdx >= 0) {
140
140
  cwd: process.cwd(),
141
141
  });
142
142
 
143
- // No silent fallback to in-process evaluation here: this machine was
144
- // explicitly configured to run through the daemon, so an unreachable
145
- // daemon fails closed instead — a loud, correctly-shaped deny (real
146
- // per-CLI response shaping, not a generic denial) rather than a
147
- // silent downgrade. See the plan's "Confirmed scope decisions".
148
- const result =
149
- daemonResult ??
150
- (await evaluateHookEvent(eventType, cli, stdinRead.payload, {
151
- forceDecision: {
152
- decision: "deny",
153
- reason:
154
- "failproofaid could not be reached. This machine is configured to run hooks through it " +
155
- "— check the daemon (see `failproofai config`) rather than retrying blindly.",
156
- },
157
- }));
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.
148
+ //
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:
151
+ //
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.
163
+ let result;
164
+ if (attempt.ok) {
165
+ result = attempt.response;
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.";
173
+ result = await evaluateHookEvent(eventType, cli, stdinRead.payload, {
174
+ forceDecision: { decision: "deny", reason },
175
+ });
176
+ }
158
177
 
159
178
  if (result.stdout) process.stdout.write(result.stdout);
160
179
  if (result.stderr) process.stderr.write(result.stderr);
@@ -191,18 +210,8 @@ if (hookIdx >= 0) {
191
210
  * Error → unexpected; shows message only, exits 2
192
211
  */
193
212
  async function runCli() {
194
- // Report a fresh install / upgrade. Deliberately here rather than at module
195
- // scope: everything above this point is the --hook fast path, which runs on
196
- // every tool call. No-ops after the first run on a given version.
197
- try {
198
- const { maybeReportInstall } = await import("../lib/install-check");
199
- await maybeReportInstall(version);
200
- } catch {
201
- // never block a command on reporting
202
- }
203
-
204
213
  // --help / -h (only when not inside a subcommand that handles its own --help)
205
- const SUBCOMMANDS = ["policies", "policy", "auth", "audit", "config"];
214
+ const SUBCOMMANDS = ["policies", "policy", "audit", "config"];
206
215
  if ((args.includes("--help") || args.includes("-h")) && !SUBCOMMANDS.includes(args[0])) {
207
216
  const extraArgs = args.filter((a) => a !== "--help" && a !== "-h");
208
217
  if (extraArgs.length > 0) {
@@ -243,12 +252,6 @@ COMMANDS
243
252
 
244
253
  policies --help, -h Show this help for the policies command
245
254
 
246
- auth Sign in / out of FailproofAI from the CLI.
247
- login Email + OTP flow; writes ~/.failproofai/auth.json
248
- logout Revoke this session and remove auth.json
249
- whoami Print the currently authenticated identity
250
- auth --help, -h Show this help for the auth command
251
-
252
255
  audit Audit your agent's behavior, then open the
253
256
  dashboard at http://localhost:8020/audit
254
257
  audit --help, -h Show this help for the audit command
@@ -301,6 +304,112 @@ LINKS
301
304
  process.exit(0);
302
305
  }
303
306
 
307
+ // First-run onboarding — before any subcommand runs its own work.
308
+ //
309
+ // On a machine that has never been set up, the first thing the user typed is
310
+ // almost never the thing they need first, so we run the wizard and then let
311
+ // their original command proceed. Exemptions matter more than the rule:
312
+ //
313
+ // --hook never reaches here (it exits above) — it runs on every
314
+ // tool call, and a wizard on that path would hang an agent
315
+ // --version/--help answering "what is this" must not require setup
316
+ // config IS the wizard
317
+ // policies/policy explicit configuration actions. Intercepting these would
318
+ // fight the intent the user just stated, and would break
319
+ // non-interactive scripts that call them to do setup.
320
+ //
321
+ // `maybeFirstRunConfigure` is itself a no-op on a configured machine, on a
322
+ // non-TTY, and under sudo — so this is a cheap check, not a second gate.
323
+ // Layout check, before onboarding decides anything. A home written by an
324
+ // older layout is reset here — visibly, in a real command the user typed —
325
+ // rather than from a hook, which runs unattended once per tool call. A home
326
+ // written by a NEWER layout stops the command instead: that data is fine and
327
+ // an upgrade would read it, so deleting it would destroy something
328
+ // recoverable.
329
+ //
330
+ // `audit --scheduled` is the exception, and it takes the HOOK's branch: it is
331
+ // spawned by failproofaid on a timer, so "visibly, in a real command the user
332
+ // typed" is exactly what it is not. `checkLayoutForCli()` deletes
333
+ // config.toml and credentials.toml (see `resettablePaths`), so letting a
334
+ // background process reach it would silently revoke a user's
335
+ // `[telemetry] enabled = false`, erase their cloud enrolment, and switch off
336
+ // `[audit] auto` — the setting that scheduled the run — with the explanation
337
+ // going only to the service journal. Reachable on every machine at the next
338
+ // LAYOUT_VERSION bump, when a home carrying `auto = true` is by definition
339
+ // stale. Verified live: one scheduled tick took a home's whole config.
340
+ //
341
+ // `--help` / `--version` take the same exemption `first-run-gate.ts` gives
342
+ // them, and for a stronger reason. Those two answer "what is this / how do I
343
+ // use it"; the subcommands that parse their own help (`policies --help`) fall
344
+ // past the help block above and reach here, so without this a user typing
345
+ // `failproofai policies --help` had their home reset by a question. The
346
+ // adjacent, far less destructive first-run gate exempted help from the start.
347
+ let layoutWasReset = false;
348
+ {
349
+ const isHelpOrVersion =
350
+ args.includes("--help") || args.includes("-h") || args.includes("--version") || args.includes("-v");
351
+ if (args[0] === "audit" && args.includes("--scheduled")) {
352
+ const { layoutWarningForHook } = await import("../src/hooks/fp-reset");
353
+ const warning = layoutWarningForHook();
354
+ if (warning) {
355
+ // Exit 1, not 75: 75 means "another audit holds the lock" and is retried
356
+ // in fifteen minutes, which here would just re-warn four times an hour
357
+ // forever. A stale home is a real failure that `failproofai config`
358
+ // fixes, so it is reported and retried at the ordinary cadence.
359
+ console.error(warning);
360
+ process.exit(1);
361
+ }
362
+ } else if (!isHelpOrVersion) {
363
+ const { checkLayoutForCli } = await import("../src/hooks/fp-reset");
364
+ const check = await checkLayoutForCli();
365
+ for (const line of check.lines) console.error(line);
366
+ if (check.fatal) process.exit(1);
367
+ layoutWasReset = check.didReset;
368
+ }
369
+ }
370
+
371
+ // Report a fresh install / upgrade. AFTER the layout check above, never
372
+ // before: this writes the `last-version` marker, and while that file lived at
373
+ // the root of the home it was one of the landmarks `detectLayout()` reads as
374
+ // "layout 1". Running first meant the CLI created the file and then read it
375
+ // back as evidence of an old layout, so every genuinely fresh machine had its
376
+ // very first command open with "failproofai reorganised … Removed 1 item(s)
377
+ // from the old layout." Nothing was lost — there was nothing there — but
378
+ // training every new user to ignore that banner is expensive given what it
379
+ // says on a real layout-1 home. The file has also moved under `state/`, so
380
+ // the two are independent now; the order is kept because it is the correct
381
+ // one regardless.
382
+ //
383
+ // Deliberately not at module scope: everything above the CLI entry is the
384
+ // --hook fast path, which runs on every tool call. No-ops after the first run
385
+ // on a given version.
386
+ try {
387
+ const { maybeReportInstall } = await import("../lib/install-check");
388
+ await maybeReportInstall(version);
389
+ } catch {
390
+ // never block a command on reporting
391
+ }
392
+
393
+ const { shouldOfferFirstRun } = await import("../src/hooks/first-run-gate");
394
+ if (shouldOfferFirstRun(args) || layoutWasReset) {
395
+ try {
396
+ const { maybeFirstRunConfigure } = await import("../src/hooks/configure-wizard");
397
+ // `audit` runs its own scan immediately after this returns; firing the
398
+ // post-setup audit too would scan the whole history twice in a row.
399
+ //
400
+ // `force` after a reset: the home's policy config is gone, but the agent
401
+ // CLIs' settings files were deliberately left alone, so `isConfigured()`
402
+ // still reads true off `hasGlobalHooks` and setup would be skipped —
403
+ // leaving hooks firing against no policies, silently and permanently.
404
+ await maybeFirstRunConfigure(
405
+ {},
406
+ { postSetupAudit: args[0] !== "audit", force: layoutWasReset },
407
+ );
408
+ } catch {
409
+ // Onboarding is never allowed to block the command the user actually typed.
410
+ }
411
+ }
412
+
304
413
  // policies [--install|-i|--uninstall|-u|--help|-h] [names...] [--scope] [--beta] [--custom|-c <path>]
305
414
  if (args[0] === "policies") {
306
415
  const subArgs = args.slice(1);
@@ -566,19 +675,6 @@ EXAMPLES
566
675
  process.exit(0);
567
676
  }
568
677
 
569
- // auth — email-OTP login flow against the FailproofAI api-server.
570
- if (args[0] === "auth") {
571
- lastSubcommand = "auth";
572
- const { runAuthCli } = await import("../src/auth/cli");
573
- await runAuthCli(args.slice(1));
574
- await track("cli_auth_invoked", {
575
- args_count: args.length - 1,
576
- subcommand: args[1] ?? "help",
577
- exit_code: process.exitCode ?? 0,
578
- });
579
- process.exit(process.exitCode ?? 0);
580
- }
581
-
582
678
  // audit — scan local agent-CLI history, then launch the dashboard at /audit.
583
679
  if (args[0] === "audit") {
584
680
  lastSubcommand = "audit";
@@ -772,7 +868,7 @@ WHAT IT DOES
772
868
  FAILPROOF CLOUD
773
869
  failproofai config --connect <url> --token <key> [--machine-id <id>]
774
870
  Connect this machine to Failproof Cloud
775
- [--send-transcripts] also send full session transcripts
871
+ [--no-transcripts] decisions only, no transcripts
776
872
  failproofai config --disconnect Stop pulling policy and sending activity
777
873
  failproofai config --status Show connection and pause state
778
874
 
@@ -786,8 +882,10 @@ FAILPROOF CLOUD
786
882
  that file is world-readable. Connecting needs no sudo, and the machine id
787
883
  defaults to this host's name.
788
884
 
789
- Session transcripts carry prompts, file contents and whatever was pasted into
790
- a terminal, so they are NEVER sent unless --send-transcripts is passed.
885
+ Connecting sends BOTH policy decisions and full session transcripts. A
886
+ transcript carries prompts, file contents and whatever was pasted into a
887
+ terminal — that is the point of connecting, and it is stated here rather than
888
+ buried behind a flag nobody finds. Use --no-transcripts for decisions only.
791
889
 
792
890
  PAUSING ENFORCEMENT (one session, always time-boxed)
793
891
  failproofai config --pause Pause this directory's newest agent session (30m)
@@ -839,11 +937,15 @@ PAUSING ENFORCEMENT (one session, always time-boxed)
839
937
  url: valueAfter("--connect"),
840
938
  token: valueAfter("--token"),
841
939
  machineId: valueAfter("--machine-id"),
940
+ machineLabel: valueAfter("--machine-label"),
842
941
  defaultMachineId: hostname(),
843
- // Opt-in only. A transcript carries prompts, file contents and
844
- // whatever was pasted into a terminal, so it can never be a side
845
- // effect of connecting.
846
- sessions: args.includes("--send-transcripts"),
942
+ // Transcripts are what connecting is FOR, so they default on and the
943
+ // disclosure is made at the point of connection rather than hidden
944
+ // behind an opt-in flag most people never discover — a dashboard
945
+ // showing only decisions is the empty-dashboard problem in a
946
+ // different costume. --no-transcripts is the explicit way out, and
947
+ // `failproofai config --status` always says which is in effect.
948
+ sessions: !args.includes("--no-transcripts"),
847
949
  });
848
950
  }
849
951
  for (const line of result.lines) {
@@ -888,6 +990,9 @@ PAUSING ENFORCEMENT (one session, always time-boxed)
888
990
  if (wantsStatus) {
889
991
  const { connectionStatusLines } = await import("../src/hooks/cloud-enrollment-cli");
890
992
  for (const line of connectionStatusLines()) console.log(line);
993
+ // Always printed, including where reports can never work: "why am I
994
+ // not getting them?" is the question --status exists to answer, and an
995
+ // omitted line answers it with silence.
891
996
  console.log("");
892
997
  }
893
998
  for (const line of result.lines) {
@@ -907,10 +1012,36 @@ PAUSING ENFORCEMENT (one session, always time-boxed)
907
1012
  const result = await runConfigureWizard();
908
1013
  await track("cli_configure_invoked", {
909
1014
  applied: result.applied,
910
- scope: result.scope ?? null,
1015
+ // `target` and `scopes`, not `scope`: the wizard rework replaced that
1016
+ // field and nothing caught it, because `.mjs` is outside the tsconfig
1017
+ // include so `tsc --noEmit` never type-checks this file. Every
1018
+ // `cli_configure_invoked` since has reported `scope: null`.
1019
+ target: result.target ?? null,
1020
+ scopes: result.scopes ?? [],
911
1021
  cli_count: result.clis?.length ?? 0,
1022
+ abort: result.abort ?? null,
912
1023
  });
913
- process.exit(0);
1024
+ // `abort` is the field `WizardAbort` exists to expose, and exiting 0
1025
+ // regardless discarded it: a fleet script could not tell "the user pressed
1026
+ // Esc" from "this machine could not install the required daemon and is
1027
+ // unconfigured". Cancelling is not a failure; the other two are.
1028
+ await exitAfterFlush(!result.applied && result.abort && result.abort !== "cancelled" ? 1 : 0);
1029
+ return;
1030
+ }
1031
+
1032
+ // Shared by both "unknown thing" guards below, so a mistyped SUBCOMMAND gets
1033
+ // the same nearest-match treatment a mistyped flag already got.
1034
+ function levenshtein(a, b) {
1035
+ const m = a.length, n = b.length;
1036
+ const dp = Array.from({ length: m + 1 }, (_, i) =>
1037
+ Array.from({ length: n + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0))
1038
+ );
1039
+ for (let i = 1; i <= m; i++)
1040
+ for (let j = 1; j <= n; j++)
1041
+ dp[i][j] = a[i - 1] === b[j - 1]
1042
+ ? dp[i - 1][j - 1]
1043
+ : 1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);
1044
+ return dp[m][n];
914
1045
  }
915
1046
 
916
1047
  // Unknown flag guard — must appear after all known-flag branches
@@ -918,20 +1049,7 @@ PAUSING ENFORCEMENT (one session, always time-boxed)
918
1049
  const unknownFlag = args.find(a => a.startsWith("-") && !knownFlags.includes(a));
919
1050
 
920
1051
  if (unknownFlag) {
921
- function levenshtein(a, b) {
922
- const m = a.length, n = b.length;
923
- const dp = Array.from({ length: m + 1 }, (_, i) =>
924
- Array.from({ length: n + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0))
925
- );
926
- for (let i = 1; i <= m; i++)
927
- for (let j = 1; j <= n; j++)
928
- dp[i][j] = a[i - 1] === b[j - 1]
929
- ? dp[i - 1][j - 1]
930
- : 1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);
931
- return dp[m][n];
932
- }
933
-
934
- const primary = ["--version", "--help", "--hook", "policies", "policy", "auth", "audit"];
1052
+ const primary = ["--version", "--help", "--hook", "policies", "policy", "audit"];
935
1053
  const closest = primary.reduce((best, flag) => {
936
1054
  const dist = levenshtein(unknownFlag, flag);
937
1055
  return dist < best.dist ? { flag, dist } : best;
@@ -947,29 +1065,27 @@ PAUSING ENFORCEMENT (one session, always time-boxed)
947
1065
  // Unknown subcommand guard (non-flag args that aren't a known subcommand)
948
1066
  const unknownSubcommand = args.find(a => !a.startsWith("-") && !SUBCOMMANDS.includes(a));
949
1067
  if (unknownSubcommand) {
1068
+ // Nearest match rather than a hardcoded "policies", which was wrong for
1069
+ // every input that was not a typo of it. `auth` made that concrete: it was
1070
+ // a real subcommand until this release, so an old script or plain muscle
1071
+ // memory lands here, and answering "did you mean policies?" sends someone
1072
+ // to the one command that has nothing to do with what they typed.
1073
+ const nearest = SUBCOMMANDS.reduce(
1074
+ (best, name) => {
1075
+ const dist = levenshtein(unknownSubcommand, name);
1076
+ return dist < best.dist ? { name, dist } : best;
1077
+ },
1078
+ { name: SUBCOMMANDS[0], dist: Infinity },
1079
+ );
950
1080
  throw new CliError(
951
1081
  `Unknown command: ${unknownSubcommand}\n` +
952
- `Did you mean: failproofai policies?\n` +
1082
+ `Did you mean: failproofai ${nearest.name}?\n` +
953
1083
  `Run \`failproofai --help\` for usage details.`
954
1084
  );
955
1085
  }
956
1086
 
957
- // First-run onboarding — on the first bare `failproofai` invocation, run the
958
- // configure wizard (which also fires the post-setup audit) BEFORE the
959
- // dashboard. Unlike before, we then fall through to launch the dashboard, so a
960
- // fresh user gets: setup → audit → dashboard, and every later `failproofai`
961
- // goes straight to the dashboard. Best-effort: any error must not block launch.
962
- if (args.length === 0) {
963
- try {
964
- const { maybeFirstRunConfigure } = await import("../src/hooks/configure-wizard");
965
- await maybeFirstRunConfigure();
966
- } catch {
967
- // First-run onboarding is non-critical; fall through to the dashboard.
968
- }
969
- }
970
-
971
1087
  // Dashboard launch — always production mode. Runs on every bare `failproofai`
972
- // (after first-run onboarding, if any).
1088
+ // (first-run onboarding, if any, already ran above).
973
1089
  const { launch } = await import("../scripts/launch");
974
1090
  launch("start");
975
1091
  }