failproofai 1.0.13-beta.3 → 1.0.14

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 (382) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +44 -44
  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 +6 -6
  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 -3
  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 +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  13. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  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 +6 -6
  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 +3 -4
  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 +6 -6
  22. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +6 -6
  23. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  24. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  25. package/.next/standalone/.next/server/app/api/audit/invite/route.js +3 -4
  26. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/audit/run/route.js +22 -23
  28. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/audit/status/route.js +2 -3
  30. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/auth/login-request/route.js +4 -5
  32. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +4 -5
  34. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/auth/logout/route.js +4 -5
  36. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/auth/status/route.js +3 -4
  38. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +2 -3
  40. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/audit/page/build-manifest.json +6 -6
  42. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  43. package/.next/standalone/.next/server/app/audit/page.js +5 -6
  44. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/index.html +1 -1
  47. package/.next/standalone/.next/server/app/index.rsc +6 -6
  48. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  49. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +6 -6
  50. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  51. package/.next/standalone/.next/server/app/page/build-manifest.json +6 -6
  52. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  53. package/.next/standalone/.next/server/app/page.js +4 -5
  54. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +6 -6
  57. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
  58. package/.next/standalone/.next/server/app/policies/page.js +4 -5
  59. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +6 -6
  62. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  63. package/.next/standalone/.next/server/app/project/[name]/page.js +20 -21
  64. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +6 -6
  67. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  68. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  69. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +8 -9
  70. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +6 -6
  73. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  74. package/.next/standalone/.next/server/app/projects/page.js +6 -7
  75. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/settings/page/build-manifest.json +6 -6
  78. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  79. package/.next/standalone/.next/server/app/settings/page.js +3 -4
  80. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1a2d0ewycsp6k._.js → [externals]__0h0p9dmv_e7r7._.js} +2 -2
  83. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1am_1tz0o0aqz._.js → [externals]__1_407huhlmj1m._.js} +2 -2
  84. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__031qp1lkow_kc._.js → [externals]__1rlxpymm37wel._.js} +2 -2
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03s1za0hn71yp._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__048f1wnr8pysf._.js +63 -0
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07a0sa6fuw5_b._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l-oi4gdtmlo5._.js +3 -0
  89. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0spt0kv8azrpl._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yvyp5b7jmlc4._.js +1 -1
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__145vo_drnuvas._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1lh8c0mmhdrbj._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1oclamblhzhrf._.js +7 -7
  94. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qjnp3fa0e5g3._.js +3 -0
  95. package/.next/standalone/.next/server/chunks/[turbopack]_runtime.js +7 -9
  96. package/.next/standalone/.next/server/chunks/_02sa8fcu9_9xo._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/_09dz7xva4ce_2._.js +18 -18
  98. package/.next/standalone/.next/server/chunks/_0hf5q4xzyg40j._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/_1-2owkp-1_987._.js +1 -1
  102. package/.next/standalone/.next/server/chunks/_13ltj8a9z92o8._.js +1 -1
  103. package/.next/standalone/.next/server/chunks/_15k37au70vjvg._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/_18rfu4__wjhwb._.js +1 -1
  105. package/.next/standalone/.next/server/chunks/_19011-u44143j._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/_1ek68lnh2daur._.js +2 -2
  107. package/.next/standalone/.next/server/chunks/_1fz8m31sndkcu._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/_1ogwigfb0163w._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/_1vslkoe35wok6._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/lib_11qmqmccehybz._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/lib_1sezqnatvr8j-._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oigsgz07._.js +1 -2
  113. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p77cu37y._.js +1 -2
  114. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/src_hooks_0_em82s16zfym._.js +2 -2
  116. package/.next/standalone/.next/server/chunks/ssr/[externals]__0ilfh9mfnzsth._.js +3 -0
  117. package/.next/standalone/.next/server/chunks/ssr/[externals]__0ohnuzsaozaca._.js +3 -0
  118. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__097i34ct1o88x._.js → [externals]__12qr51qgrrt6o._.js} +2 -2
  119. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__021vebe-4il8s._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0evgy902m9h5e._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ezoipo-r7_5k._.js +14 -0
  124. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h1jw32uvrhh0._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10v5cyxvj64j4._.js → [root-of-the-server]__0tfnj3v_mp6rv._.js} +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-9s1nsw-5q8o._.js +1 -1
  129. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15bi9em2xe0x2._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__20dt376-socef._.js → [root-of-the-server]__1e00l_e_8r_-g._.js} +1 -1
  135. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mc9-zlnh656_._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ob2uzmms1adf._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ed1zh4scn7-k._.js → [root-of-the-server]__1tq3x9i_3_860._.js} +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1utel1l1-u64v._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vofkb2oq7p7e._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vxwetblyf8vp._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1xwr4hi-on27i._.js +3 -0
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__2158020r_amn9._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/[turbopack]_runtime.js +7 -9
  145. package/.next/standalone/.next/server/chunks/ssr/_0-f9uotv7v2n9._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/_00e4_rvim31u_._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/_0bseae9u7g98r._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +2 -2
  149. package/.next/standalone/.next/server/chunks/ssr/_0kqw2_f1ywmpo._.js +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/_0mouhaflye1ro._.js +1 -1
  151. package/.next/standalone/.next/server/chunks/ssr/_0ouu886szh6yj._.js +10 -10
  152. package/.next/standalone/.next/server/chunks/ssr/_0p1cb69sml__f._.js +3 -0
  153. package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
  154. package/.next/standalone/.next/server/chunks/ssr/_0tfqha481f033._.js +2 -2
  155. package/.next/standalone/.next/server/chunks/ssr/_1_ozgifqv1ssi._.js +1 -1
  156. package/.next/standalone/.next/server/chunks/ssr/_1a516zcgtqius._.js +1 -1
  157. package/.next/standalone/.next/server/chunks/ssr/_1ddpc5gj57uuf._.js +1 -1
  158. package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
  159. package/.next/standalone/.next/server/chunks/ssr/_1ew6ra24vt-ij._.js +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/_1or8gixmrpv5i._.js +1 -1
  161. package/.next/standalone/.next/server/chunks/ssr/_1s8zk-upxzp00._.js +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/_1u9tpla2o6utw._.js +1 -1
  163. package/.next/standalone/.next/server/chunks/ssr/_1v4_ul3sj2lq_._.js +1 -1
  164. package/.next/standalone/.next/server/chunks/ssr/_1y3xzro8ca8t6._.js +1 -1
  165. package/.next/standalone/.next/server/chunks/ssr/_20hn4gn87nsjc._.js +1 -1
  166. package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
  167. package/.next/standalone/.next/server/chunks/ssr/app_087bt9wus25zs._.js +1 -1
  168. package/.next/standalone/.next/server/chunks/ssr/app_0trz6ik19xz5_._.js +1 -1
  169. package/.next/standalone/.next/server/chunks/ssr/app_1fvisnppn1unv._.js +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/app_209u41o446my6._.js +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
  172. package/.next/standalone/.next/server/chunks/ssr/app_audit_0hku_y73ischw._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
  176. package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/lib_16jvhmthj_k3a._.js +1 -1
  178. package/.next/standalone/.next/server/chunks/ssr/node_modules_05vgn62--7c5e._.js +1 -1
  179. package/.next/standalone/.next/server/chunks/ssr/node_modules_0dad4au22rq0p._.js +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/node_modules_0gxlxpuufujz9._.js +2 -2
  181. package/.next/standalone/.next/server/chunks/ssr/node_modules_0ptcnmeaxvd_a._.js +2 -2
  182. package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_1p-is71j0j7fb.js → node_modules_html-to-image_es_index_0r9i9nq3-ei-l.js} +1 -1
  183. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_0bz67659f5z-3._.js +4 -4
  184. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0-amwqbrge23p._.js +6 -0
  185. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0ocrceo0c9psx._.js +4 -4
  186. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1alv566ojmz5j._.js +4 -4
  187. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1et9oq9q9-y3v._.js +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1khq67j4vo9y4._.js +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j32_ibz4._.js +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_shared_lib_0ftnv26hg1lry._.js +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0dagmbznysrc2._.js +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js +1 -2
  193. package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
  194. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0-q0ummbuhlg5._.js +1 -1
  195. package/.next/standalone/.next/server/chunks/ssr/src_hooks_06kzv9ddabn3_._.js +2 -2
  196. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0agdmptetetdt._.js +2 -2
  197. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0g194syq7r7ql._.js +1 -1
  198. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0mdwgjisv4fub._.js +2 -2
  199. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4l1tzrm._.js +2 -2
  200. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1kx9e0dx_1-8o._.js +1 -1
  201. package/.next/standalone/.next/server/middleware-build-manifest.js +44 -44
  202. package/.next/standalone/.next/server/pages/404.html +1 -1
  203. package/.next/standalone/.next/server/pages/500.html +1 -1
  204. package/.next/standalone/.next/server/preview-props.json +3 -3
  205. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  206. package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
  207. package/.next/standalone/.next/static/chunks/0tiuj32d-qcy3.js +1 -0
  208. package/.next/standalone/.next/static/chunks/0ztuix-ip2oiv.js +1 -0
  209. package/.next/standalone/.next/static/chunks/{0h7mkux811w5b.js → 107jrtkeylnrv.js} +1 -1
  210. package/.next/standalone/.next/static/chunks/110hwwc6agsr8.js +1 -0
  211. package/.next/standalone/.next/static/chunks/19e9khxgv8fb8.js +1 -0
  212. package/.next/standalone/.next/static/chunks/1dudxmlwx2n3q.js +1 -0
  213. package/.next/standalone/.next/static/chunks/1i9zuw01f0ogt.js +22 -0
  214. package/.next/standalone/.next/static/chunks/2codb6nb412m9.js +1 -0
  215. package/.next/standalone/.next/static/chunks/2hqfk_jgesiw2.js +1 -0
  216. package/.next/standalone/.next/static/chunks/2k6xp6kdy7lmd.js +1 -0
  217. package/.next/standalone/.next/static/chunks/2maurwweshrsj.js +1 -0
  218. package/.next/standalone/.next/static/chunks/2wh64znsc_mo2.js +1 -0
  219. package/.next/standalone/.next/static/chunks/2wye36b3mbzpa.js +31 -0
  220. package/.next/standalone/.next/static/chunks/{2sthn8c56n9m_.js → 2zlfhyqvlvf7o.js} +1 -1
  221. package/.next/standalone/.next/static/chunks/3hk5y4kny2ktd.js +1 -0
  222. package/.next/standalone/.next/static/chunks/3i_9ugyh1q1o1.js +1 -0
  223. package/.next/standalone/.next/static/chunks/3o30fiw7llng3.js +1 -0
  224. package/.next/standalone/.next/static/chunks/3v49ogp389dun.js +1 -0
  225. package/.next/standalone/.next/static/chunks/41ujrab732qi3.css +2 -0
  226. package/.next/standalone/.next/static/chunks/435eshlryosz1.js +1 -0
  227. package/.next/standalone/.next/static/chunks/436g_rqa42mr7.js +1 -0
  228. package/.next/standalone/.next/static/chunks/436nql0jk__xy.js +1 -0
  229. package/.next/standalone/.next/static/chunks/{turbopack-3-ry682tkyiqk.js → turbopack-2u1d16houkiyo.js} +1 -1
  230. package/.next/standalone/SECURITY.md +19 -4
  231. package/.next/standalone/fp-cloud-cli/CHANGELOG.md +13 -3
  232. package/.next/standalone/fp-cloud-cli/README.md +14 -7
  233. package/.next/standalone/fp-cloud-cli/fp_cli/_version.py +1 -1
  234. package/.next/standalone/fp-cloud-cli/fp_cli/app.py +2 -8
  235. package/.next/standalone/fp-cloud-cli/fp_cli/auth.py +325 -3
  236. package/.next/standalone/fp-cloud-cli/fp_cli/cloud_output.py +3 -3
  237. package/.next/standalone/fp-cloud-cli/fp_cli/commands/account_cmds.py +1 -11
  238. package/.next/standalone/fp-cloud-cli/fp_cli/commands/auth_cmds.py +218 -51
  239. package/.next/standalone/fp-cloud-cli/fp_cli/commands/orgs_cmds.py +1 -1
  240. package/.next/standalone/fp-cloud-cli/fp_cli/output.py +112 -135
  241. package/.next/standalone/fp-cloud-cli/fp_cli/permissions.py +10 -1
  242. package/.next/standalone/fp-cloud-cli/fp_cli/select.py +85 -6
  243. package/.next/standalone/fp-cloud-cli/fp_cli/theme.py +21 -21
  244. package/.next/standalone/fp-cloud-cli/pyproject.toml +1 -1
  245. package/.next/standalone/fp-cloud-cli/skill/SKILL.md +4 -4
  246. package/.next/standalone/fp-cloud-cli/skill/references/commands.md +4 -4
  247. package/.next/standalone/fp-cloud-cli/tests/fake_cloud_smoke.py +2 -2
  248. package/.next/standalone/fp-cloud-cli/tests/test_browser_login.py +943 -0
  249. package/.next/standalone/fp-cloud-cli/tests/test_cloud_account.py +0 -2
  250. package/.next/standalone/fp-cloud-cli/tests/test_cloud_agent.py +4 -8
  251. package/.next/standalone/fp-cloud-cli/tests/test_cloud_human_views.py +0 -4
  252. package/.next/standalone/fp-cloud-cli/tests/test_commands.py +3 -3
  253. package/.next/standalone/fp-cloud-cli/tests/test_dashboards_agent.py +3 -3
  254. package/.next/standalone/fp-cloud-cli/tests/test_facets.py +1 -1
  255. package/.next/standalone/fp-cloud-cli/tests/test_keys_queries.py +19 -2
  256. package/.next/standalone/fp-cloud-cli/tests/test_operator.py +1 -1
  257. package/.next/standalone/fp-cloud-cli/tests/test_orgs.py +1 -1
  258. package/.next/standalone/fp-cloud-cli/tests/test_output.py +19 -19
  259. package/.next/standalone/fp-cloud-cli/tests/test_round4_behaviour.py +3 -2
  260. package/.next/standalone/fp-cloud-cli/tests/test_screen_language.py +86 -25
  261. package/.next/standalone/fp-cloud-cli/tests/test_whoami.py +1 -1
  262. package/.next/standalone/fp-cloud-cli/uv.lock +200 -13
  263. package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
  264. package/.next/standalone/node_modules/@next/env/package.json +1 -1
  265. package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
  266. package/.next/standalone/node_modules/next/dist/compiled/fast-jwt/index.js +3 -0
  267. package/.next/standalone/node_modules/next/dist/compiled/fast-jwt/package.json +1 -0
  268. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +23 -23
  269. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +23 -23
  270. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +1 -1
  271. package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +7 -7
  272. package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  273. package/.next/standalone/node_modules/next/dist/server/api-utils/node/api-resolver.js +8 -5
  274. package/.next/standalone/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +8 -2
  275. package/.next/standalone/node_modules/next/dist/server/app-render/app-render.js +52 -14
  276. package/.next/standalone/node_modules/next/dist/server/app-render/async-local-storage.js +1 -1
  277. package/.next/standalone/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +19 -3
  278. package/.next/standalone/node_modules/next/dist/server/app-render/turbopack-bootstrap-script.js +50 -0
  279. package/.next/standalone/node_modules/next/dist/server/base-server.js +8 -0
  280. package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
  281. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +59 -10
  282. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  283. package/.next/standalone/node_modules/next/dist/server/dev/turbopack-utils.js +15 -0
  284. package/.next/standalone/node_modules/next/dist/server/image-optimizer/detect-content-type.js +24 -20
  285. package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  286. package/.next/standalone/node_modules/next/dist/server/lib/dev-bundler-service.js +3 -0
  287. package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +1 -1
  288. package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
  289. package/.next/standalone/node_modules/next/dist/server/lib/trace/tracer.js +1 -1
  290. package/.next/standalone/node_modules/next/dist/server/next-server.js +10 -2
  291. package/.next/standalone/node_modules/next/dist/server/render.js +2 -2
  292. package/.next/standalone/node_modules/next/dist/server/route-modules/app-page/parse-request-headers.js +1 -2
  293. package/.next/standalone/node_modules/next/dist/server/send-response.js +12 -0
  294. package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +69 -6
  295. package/.next/standalone/node_modules/next/dist/server/web/adapter.js +5 -1
  296. package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  297. package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  298. package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
  299. package/.next/standalone/node_modules/next/package.json +10 -10
  300. package/.next/standalone/package.json +13 -12
  301. package/.next/standalone/sdk/python/skill/SKILL.md +5 -0
  302. package/.next/standalone/sdk/python/uv.lock +83 -51
  303. package/.next/standalone/sdk/typescript/CHANGELOG.md +48 -5
  304. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package-lock.json +0 -9
  305. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package.json +2 -1
  306. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package-lock.json +72 -44
  307. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package.json +2 -1
  308. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/package-lock.json +72 -44
  309. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/package.json +3 -0
  310. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package-lock.json +18 -332
  311. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package.json +4 -2
  312. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package-lock.json +925 -296
  313. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package.json +3 -8
  314. package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package-lock.json +279 -277
  315. package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package.json +2 -2
  316. package/.next/standalone/sdk/typescript/package-lock.json +31 -61
  317. package/.next/standalone/sdk/typescript/package.json +3 -0
  318. package/.next/standalone/server.js +1 -1
  319. package/dist/cli.mjs +443 -245
  320. package/dist/worker.mjs +30 -2
  321. package/hermes-plugin/plugin.yaml +1 -1
  322. package/openclaw-plugin/daemon-client.js +254 -0
  323. package/openclaw-plugin/hooks.js +187 -0
  324. package/openclaw-plugin/index.js +17 -211
  325. package/package.json +13 -12
  326. package/src/hooks/antigravity-path-guard.ts +73 -0
  327. package/src/hooks/daemon-service.ts +188 -18
  328. package/src/hooks/delivery-health.ts +11 -1
  329. package/src/hooks/enforcement-capability.ts +1 -1
  330. package/src/hooks/handler.ts +24 -0
  331. package/src/hooks/integrations.ts +5 -2
  332. package/src/hooks/shell-quote.ts +9 -0
  333. package/src/hooks/uninstall-cli.ts +30 -8
  334. package/.next/standalone/.next/server/chunks/[root-of-the-server]__038kwryp970nh._.js +0 -3
  335. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08atcie7jzswm._.js +0 -3
  336. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0car70pylmvor._.js +0 -3
  337. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1j6kfp0vzu5rw._.js +0 -3
  338. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l0ayum_hqqsw._.js +0 -3
  339. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1o9rznwc0w7og._.js +0 -3
  340. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1v1-l-83czzsr._.js +0 -63
  341. package/.next/standalone/.next/server/chunks/node_modules_@opentelemetry_api_build_esm_index_0oo58a7rymoxh.js +0 -3
  342. package/.next/standalone/.next/server/chunks/node_modules_@opentelemetry_api_build_esm_index_1jp9ij0_ddtgk.js +0 -3
  343. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__070rqh7scntiu._.js +0 -3
  344. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__075uro8t92s0_._.js +0 -14
  345. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0alpzjn3450sr._.js +0 -3
  346. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0aup10z2o8zc1._.js +0 -3
  347. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bioghlkjf7s7._.js +0 -3
  348. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nhm28v58ty9z._.js +0 -3
  349. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vse4qi496ol-._.js +0 -3
  350. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__190xwrr5zrfi3._.js +0 -3
  351. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1guwlpkyurdn9._.js +0 -3
  352. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1k96jctukf65_._.js +0 -3
  353. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1sj-wn2jp6va5._.js +0 -3
  354. package/.next/standalone/.next/server/chunks/ssr/_1tcvpgd7hugnx._.js +0 -3
  355. package/.next/standalone/.next/server/chunks/ssr/node_modules_@opentelemetry_api_build_esm_index_0ntwr8lzj6p2i.js +0 -3
  356. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +0 -6
  357. package/.next/standalone/.next/static/chunks/095l2av-xsus2.js +0 -1
  358. package/.next/standalone/.next/static/chunks/1024g0jaymm46.js +0 -1
  359. package/.next/standalone/.next/static/chunks/165ezyyx0j1ft.js +0 -22
  360. package/.next/standalone/.next/static/chunks/19l5hbzn475am.js +0 -1
  361. package/.next/standalone/.next/static/chunks/1s__s2o5zcfcy.js +0 -1
  362. package/.next/standalone/.next/static/chunks/1uxq_gbvdti30.js +0 -1
  363. package/.next/standalone/.next/static/chunks/26c4gmdpsthv6.css +0 -2
  364. package/.next/standalone/.next/static/chunks/2_sj5ssr_m_wm.js +0 -1
  365. package/.next/standalone/.next/static/chunks/2ojf3r8g4tn7s.js +0 -1
  366. package/.next/standalone/.next/static/chunks/2tjfp9dirxnku.js +0 -1
  367. package/.next/standalone/.next/static/chunks/2zyrjasvbmwpq.js +0 -1
  368. package/.next/standalone/.next/static/chunks/31fan-ze541d1.js +0 -1
  369. package/.next/standalone/.next/static/chunks/32s3y34p0t2pe.js +0 -1
  370. package/.next/standalone/.next/static/chunks/36re0fegaocq-.js +0 -1
  371. package/.next/standalone/.next/static/chunks/3eonfpk9jyceg.js +0 -1
  372. package/.next/standalone/.next/static/chunks/3fhk60ouw_ae6.js +0 -1
  373. package/.next/standalone/.next/static/chunks/3m9g1l6-yh0s3.js +0 -1
  374. package/.next/standalone/.next/static/chunks/3uaguc-tbu_ik.js +0 -1
  375. package/.next/standalone/.next/static/chunks/3xgxl1s_in776.js +0 -31
  376. package/.next/standalone/.next/static/chunks/3zwff_ax3hust.js +0 -1
  377. package/.next/standalone/node_modules/next/dist/compiled/jsonwebtoken/index.js +0 -11
  378. package/.next/standalone/node_modules/next/dist/compiled/jsonwebtoken/package.json +0 -1
  379. package/.next/standalone/node_modules/next/dist/lib/semver-noop.js +0 -18
  380. /package/.next/standalone/.next/static/{fHR90vZ5ls7d-K8cH9hxe → -iBiSmrLiylRKLAg77zlQ}/_buildManifest.js +0 -0
  381. /package/.next/standalone/.next/static/{fHR90vZ5ls7d-K8cH9hxe → -iBiSmrLiylRKLAg77zlQ}/_clientMiddlewareManifest.js +0 -0
  382. /package/.next/standalone/.next/static/{fHR90vZ5ls7d-K8cH9hxe → -iBiSmrLiylRKLAg77zlQ}/_ssgManifest.js +0 -0
package/dist/cli.mjs CHANGED
@@ -29,7 +29,7 @@ var __esm = (fn, res, err) => () => {
29
29
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
30
30
 
31
31
  // package.json
32
- var version2 = "1.0.13-beta.3", package_default;
32
+ var version2 = "1.0.14", package_default;
33
33
  var init_package = __esm(() => {
34
34
  package_default = {
35
35
  name: "failproofai",
@@ -121,14 +121,14 @@ var init_package = __esm(() => {
121
121
  "@testing-library/jest-dom": "^7.0.0",
122
122
  "@testing-library/react": "^16.3.2",
123
123
  "@testing-library/user-event": "^14.6.5",
124
- "@types/node": "26.6.5",
124
+ "@types/node": "26.6.6",
125
125
  "@types/react": "19.3.0",
126
126
  "@types/react-dom": "^19.2.3",
127
127
  "@vitejs/plugin-react": "^6.1.0",
128
128
  clsx: "^2.1.1",
129
129
  eslint: "^10.9.0",
130
130
  "eslint-config-next": "^16.3.2",
131
- jsdom: "^30.0.1",
131
+ jsdom: "^31.0.0",
132
132
  "lucide-react": "^1.33.0",
133
133
  next: "^16.3.8",
134
134
  react: "^19.2.4",
@@ -156,19 +156,20 @@ var init_package = __esm(() => {
156
156
  "brace-expansion": "5.0.12",
157
157
  sharp: "0.35.5",
158
158
  "source-map-js": "1.2.2",
159
- browserslist: "4.28.8"
159
+ browserslist: "4.28.8",
160
+ minimatch: "11.0.3"
160
161
  },
161
162
  optionalDependencies: {
162
- "@failproofai/failproofaid-linux-x64": "1.0.13-beta.3",
163
- "@failproofai/failproofaid-linux-arm64": "1.0.13-beta.3",
164
- "@failproofai/failproofaid-darwin-x64": "1.0.13-beta.3",
165
- "@failproofai/failproofaid-darwin-arm64": "1.0.13-beta.3"
163
+ "@failproofai/failproofaid-linux-x64": "1.0.14",
164
+ "@failproofai/failproofaid-linux-arm64": "1.0.14",
165
+ "@failproofai/failproofaid-darwin-x64": "1.0.14",
166
+ "@failproofai/failproofaid-darwin-arm64": "1.0.14"
166
167
  },
167
168
  failproofaidBinaries: {
168
- "linux-x64": "86f8b544b95d33b3464c916dff72e1a1436340d98c480dc8f83d1696dda1e5fe",
169
- "linux-arm64": "d09376e5608e1379c247087386473f4ff1fcaa264022e570cc00f2cbb66b09fb",
170
- "darwin-x64": "95f485247270fef7f4676e383ec586e339451c87dcd0480e1a12d721a62bec4b",
171
- "darwin-arm64": "f8c0d43dba6d78facb00a0a265c188238e50223aedab2c17b3e66c202edacf5d"
169
+ "linux-x64": "bd686a8ba981ea51189392376f43ac32ec785d0f01147cea2e4dde594b7750c8",
170
+ "linux-arm64": "04294f8cf6d5ea0325d4338cf5fc9a60c400b38b9496abf7e43dcdc1e6ee5180",
171
+ "darwin-x64": "d0eddda2163fd61c65389fdaea9dbf70aed82a492e2afc1095a28273bba629a7",
172
+ "darwin-arm64": "1663f332438fa6cc41da69c1cb351507509a07419c1349f6b29a9cf5b5c3a3ce"
172
173
  }
173
174
  };
174
175
  });
@@ -6040,6 +6041,31 @@ var init_builtin_policies = __esm(() => {
6040
6041
  }));
6041
6042
  });
6042
6043
 
6044
+ // src/hooks/antigravity-path-guard.ts
6045
+ function antigravityPathGuardActive(paused, cloudPolicies) {
6046
+ return !paused || cloudPolicies.some((p) => p.effect !== "observe");
6047
+ }
6048
+ function antigravityCallLacksPath(eventType, toolName, toolInput) {
6049
+ if (eventType !== "PreToolUse")
6050
+ return false;
6051
+ if (!toolName || !ANTIGRAVITY_PATH_GUARD_MATCH.toolNames?.includes(toolName))
6052
+ return false;
6053
+ const path = toolInput?.file_path;
6054
+ return typeof path !== "string" || path.trim() === "";
6055
+ }
6056
+ function antigravityPathGuard(ctx) {
6057
+ if (!antigravityCallLacksPath(ctx.eventType, ctx.toolName, ctx.toolInput))
6058
+ return allow();
6059
+ return deny(`failproofai could not find a file path in this ${ctx.toolName ?? "file"} call, so it cannot check it against your policies. ` + "Your Antigravity version may have changed its tool arguments: update failproofai.");
6060
+ }
6061
+ var ANTIGRAVITY_PATH_GUARD_NAME = "failproofai/antigravity-file-path-required", ANTIGRAVITY_PATH_GUARD_DESCRIPTION = "Refuse an Antigravity file tool call with no file path failproofai can check.", ANTIGRAVITY_PATH_GUARD_MATCH;
6062
+ var init_antigravity_path_guard = __esm(() => {
6063
+ ANTIGRAVITY_PATH_GUARD_MATCH = {
6064
+ events: ["PreToolUse"],
6065
+ toolNames: ["Read", "Write", "Edit"]
6066
+ };
6067
+ });
6068
+
6043
6069
  // node_modules/yaml/dist/nodes/identity.js
6044
6070
  var require_identity = __commonJS(function(exports) {
6045
6071
  var ALIAS = Symbol.for("yaml.alias");
@@ -13319,6 +13345,11 @@ var init_daemon_download = __esm(() => {
13319
13345
  init_fp_home();
13320
13346
  });
13321
13347
 
13348
+ // src/hooks/shell-quote.ts
13349
+ function shellQuote(value) {
13350
+ return `'${value.replace(/'/g, `'\\''`)}'`;
13351
+ }
13352
+
13322
13353
  // src/hooks/daemon-client.ts
13323
13354
  import { createConnection as createConnection2 } from "node:net";
13324
13355
  import { existsSync as existsSync10 } from "node:fs";
@@ -13495,12 +13526,14 @@ import {
13495
13526
  mkdirSync as mkdirSync7,
13496
13527
  mkdtempSync,
13497
13528
  readFileSync as readFileSync7,
13529
+ readdirSync as readdirSync2,
13530
+ statSync as statSync10,
13498
13531
  writeFileSync as writeFileSync5,
13499
13532
  unlinkSync,
13500
13533
  rmSync as rmSync5
13501
13534
  } from "node:fs";
13502
13535
  import { homedir as homedir5, tmpdir, userInfo } from "node:os";
13503
- import { resolve as resolve8 } from "node:path";
13536
+ import { dirname as dirname7, resolve as resolve8 } from "node:path";
13504
13537
  import { execFileSync as execFileSync2 } from "node:child_process";
13505
13538
  function setDaemonConfigured(value, installedVersion) {
13506
13539
  try {
@@ -13574,9 +13607,6 @@ function resolveCliCommand() {
13574
13607
  return null;
13575
13608
  return `${shellQuote(process.execPath)} ${shellQuote(cliScript)}`;
13576
13609
  }
13577
- function shellQuote(value) {
13578
- return `'${value.replace(/'/g, `'\\''`)}'`;
13579
- }
13580
13610
  function workerScriptPath() {
13581
13611
  if (process.env.FAILPROOFAI_WORKER_CMD)
13582
13612
  return null;
@@ -13612,6 +13642,63 @@ function systemdUnitDir() {
13612
13642
  function systemdUnitPath(user = serviceUser()) {
13613
13643
  return resolve8(systemdUnitDir(), systemdUnitName(user));
13614
13644
  }
13645
+ function systemBinaryRoot(user = serviceUser()) {
13646
+ return resolve8(process.env.FAILPROOFAI_SYSTEM_BIN_DIR || "/opt/failproofai", user);
13647
+ }
13648
+ function systemBinaryDir() {
13649
+ return resolve8(systemBinaryRoot(), "bin");
13650
+ }
13651
+ function daemonSystemBinaryDir() {
13652
+ return process.platform === "linux" ? systemBinaryRoot() : null;
13653
+ }
13654
+ function systemBinaryTarget(binaryPath) {
13655
+ if (process.platform !== "linux" || process.env.FAILPROOFAI_DAEMON_BINARY)
13656
+ return null;
13657
+ try {
13658
+ if (!statSync10(binaryPath).isFile())
13659
+ return null;
13660
+ } catch {
13661
+ return null;
13662
+ }
13663
+ return resolve8(systemBinaryDir(), `failproofaid-${version2}`);
13664
+ }
13665
+ function selinuxEnabled() {
13666
+ return existsSync11("/sys/fs/selinux/enforce");
13667
+ }
13668
+ function stageSystemBinary(binaryPath) {
13669
+ const target = systemBinaryTarget(binaryPath);
13670
+ if (!target)
13671
+ return binaryPath;
13672
+ const dir = systemBinaryDir();
13673
+ const staging = `${target}.${process.pid}.tmp`;
13674
+ runPrivileged("install", ["-d", "-m", "0755", dir]);
13675
+ try {
13676
+ runPrivileged("install", ["-m", "0755", binaryPath, staging]);
13677
+ runPrivileged("mv", ["-f", staging, target]);
13678
+ } catch (err) {
13679
+ try {
13680
+ runPrivileged("rm", ["-f", staging]);
13681
+ } catch {}
13682
+ throw err;
13683
+ }
13684
+ if (selinuxEnabled()) {
13685
+ const root = systemBinaryRoot();
13686
+ try {
13687
+ runPrivileged("restorecon", ["-R", root]);
13688
+ } catch (err) {
13689
+ hookLogWarn(`restorecon on ${root} failed: ${err instanceof Error ? err.message : String(err)}`);
13690
+ }
13691
+ }
13692
+ return target;
13693
+ }
13694
+ function pruneSystemBinaries(current) {
13695
+ try {
13696
+ const dir = systemBinaryDir();
13697
+ const stale = readdirSync2(dir).filter((f) => f.startsWith("failproofaid-")).map((f) => resolve8(dir, f)).filter((p) => p !== current).map((p) => ({ p, mtime: statSync10(p).mtimeMs })).sort((a, b) => b.mtime - a.mtime).slice(1);
13698
+ for (const { p } of stale)
13699
+ runPrivileged("rm", ["-f", p]);
13700
+ } catch {}
13701
+ }
13615
13702
  function legacySystemdUserUnitPath() {
13616
13703
  return resolve8(homedir5(), ".config", "systemd", "user", "failproofaid.service");
13617
13704
  }
@@ -13792,9 +13879,17 @@ ${envBlock} <key>StandardOutPath</key>
13792
13879
  }
13793
13880
  function daemonInstallCommands(binaryPath, workerCmd, cliCmd) {
13794
13881
  if (process.platform === "linux") {
13882
+ const target = systemBinaryTarget(binaryPath);
13883
+ const dir = systemBinaryDir();
13884
+ const stage = target ? [
13885
+ `sudo install -d -m 0755 ${shellQuote(dir)}`,
13886
+ `sudo install -m 0755 ${shellQuote(binaryPath)} ${shellQuote(target)}`,
13887
+ `{ sudo restorecon -R ${shellQuote(systemBinaryRoot())} 2>/dev/null || true; }`
13888
+ ] : [];
13795
13889
  return [
13890
+ ...stage,
13796
13891
  `sudo tee ${systemdUnitPath()} <<'EOF'
13797
- ${systemdUnitContents(binaryPath, workerCmd, cliCmd)}EOF`,
13892
+ ${systemdUnitContents(target ?? binaryPath, workerCmd, cliCmd)}EOF`,
13798
13893
  "sudo systemctl daemon-reload",
13799
13894
  `sudo systemctl enable ${systemdUnitName()}`,
13800
13895
  `sudo systemctl restart ${systemdUnitName()}`
@@ -13822,9 +13917,11 @@ async function installDaemonService() {
13822
13917
  };
13823
13918
  }
13824
13919
  removeLegacyUserService();
13920
+ let execPath = binaryPath;
13825
13921
  try {
13826
13922
  if (process.platform === "linux") {
13827
- writePrivilegedFile(systemdUnitPath(), systemdUnitContents(binaryPath, workerCmd, cliCmd));
13923
+ execPath = stageSystemBinary(binaryPath);
13924
+ writePrivilegedFile(systemdUnitPath(), systemdUnitContents(execPath, workerCmd, cliCmd));
13828
13925
  runPrivileged("systemctl", ["daemon-reload"]);
13829
13926
  runPrivileged("systemctl", ["enable", systemdUnitName()]);
13830
13927
  restartSystemdUnit();
@@ -13848,6 +13945,8 @@ async function installDaemonService() {
13848
13945
  hookLogWarn(`daemon service install failed: ${reason}`);
13849
13946
  return { installed: false, reason };
13850
13947
  }
13948
+ if (execPath !== binaryPath)
13949
+ pruneSystemBinaries(execPath);
13851
13950
  return { installed: true };
13852
13951
  }
13853
13952
  async function probeDaemon() {
@@ -14071,15 +14170,22 @@ async function uninstallDaemonService() {
14071
14170
  try {
14072
14171
  if (process.platform === "linux") {
14073
14172
  const unitPath = systemdUnitPath();
14074
- if (!existsSync11(unitPath))
14075
- return;
14076
- try {
14077
- runPrivileged("systemctl", ["disable", "--now", systemdUnitName()]);
14078
- } catch {}
14079
- runPrivileged("rm", ["-f", unitPath]);
14080
- try {
14081
- runPrivileged("systemctl", ["daemon-reload"]);
14082
- } catch {}
14173
+ if (existsSync11(unitPath)) {
14174
+ try {
14175
+ runPrivileged("systemctl", ["disable", "--now", systemdUnitName()]);
14176
+ } catch {}
14177
+ runPrivileged("rm", ["-f", unitPath]);
14178
+ try {
14179
+ runPrivileged("systemctl", ["daemon-reload"]);
14180
+ } catch {}
14181
+ }
14182
+ const binRoot = systemBinaryRoot();
14183
+ if (existsSync11(binRoot)) {
14184
+ runPrivileged("rm", ["-rf", binRoot]);
14185
+ try {
14186
+ runPrivileged("rmdir", [dirname7(binRoot)]);
14187
+ } catch {}
14188
+ }
14083
14189
  } else {
14084
14190
  const plistPath = launchdPlistPath();
14085
14191
  if (!existsSync11(plistPath))
@@ -14162,9 +14268,9 @@ var init_daemon_service = __esm(() => {
14162
14268
  // src/hooks/codex-system-hooks.ts
14163
14269
  import { execSync as execSync3 } from "node:child_process";
14164
14270
  import { createHash as createHash4 } from "node:crypto";
14165
- import { accessSync, chmodSync as chmodSync5, constants as fsConstants3, existsSync as existsSync12, readFileSync as readFileSync8, rmSync as rmSync6, statSync as statSync10 } from "node:fs";
14271
+ import { accessSync, chmodSync as chmodSync5, constants as fsConstants3, existsSync as existsSync12, readFileSync as readFileSync8, rmSync as rmSync6, statSync as statSync11 } from "node:fs";
14166
14272
  import { homedir as homedir6 } from "node:os";
14167
- import { dirname as dirname7, resolve as resolve9 } from "node:path";
14273
+ import { dirname as dirname8, resolve as resolve9 } from "node:path";
14168
14274
  function codexSystemConfigPath() {
14169
14275
  const override = process.env.FAILPROOFAI_CODEX_SYSTEM_CONFIG;
14170
14276
  if (override !== undefined)
@@ -14286,9 +14392,9 @@ function resolvedPath(deps) {
14286
14392
  return deps.path !== undefined ? deps.path : codexSystemConfigPath();
14287
14393
  }
14288
14394
  function writableDirectly(path) {
14289
- let dir = dirname7(path);
14395
+ let dir = dirname8(path);
14290
14396
  while (!existsSync12(dir)) {
14291
- const parent = dirname7(dir);
14397
+ const parent = dirname8(dir);
14292
14398
  if (parent === dir)
14293
14399
  return false;
14294
14400
  dir = parent;
@@ -14304,7 +14410,7 @@ function writableDirectly(path) {
14304
14410
  }
14305
14411
  function fileMode(path) {
14306
14412
  try {
14307
- return (statSync10(path).mode & 511).toString(8).padStart(4, "0");
14413
+ return (statSync11(path).mode & 511).toString(8).padStart(4, "0");
14308
14414
  } catch {
14309
14415
  return "0644";
14310
14416
  }
@@ -14315,7 +14421,7 @@ function writeSystemFile(path, contents, mode, direct) {
14315
14421
  chmodSync5(path, parseInt(mode, 8));
14316
14422
  return;
14317
14423
  }
14318
- runPrivileged("install", ["-d", "-m", "0755", dirname7(path)]);
14424
+ runPrivileged("install", ["-d", "-m", "0755", dirname8(path)]);
14319
14425
  writePrivilegedFile(path, contents, mode);
14320
14426
  }
14321
14427
  function removeSystemFile(path, direct) {
@@ -14681,19 +14787,19 @@ var init_codex_system_hooks = __esm(() => {
14681
14787
  });
14682
14788
 
14683
14789
  // lib/hermes-profiles.ts
14684
- import { existsSync as existsSync13, readdirSync as readdirSync2 } from "node:fs";
14790
+ import { existsSync as existsSync13, readdirSync as readdirSync3 } from "node:fs";
14685
14791
  import { homedir as homedir7 } from "node:os";
14686
- import { basename as basename2, dirname as dirname8, join as join4, resolve as resolve10 } from "node:path";
14792
+ import { basename as basename2, dirname as dirname9, join as join4, resolve as resolve10 } from "node:path";
14687
14793
  function hermesRoot() {
14688
14794
  const env = (process.env.HERMES_HOME || "").trim();
14689
14795
  if (env) {
14690
14796
  let home = resolve10(env);
14691
- const parent = dirname8(home);
14797
+ const parent = dirname9(home);
14692
14798
  if (basename2(parent) === PROFILES_DIR)
14693
- home = dirname8(parent);
14799
+ home = dirname9(parent);
14694
14800
  const base = basename2(home);
14695
14801
  if (base === STANDARD_HOME || base.startsWith(SIBLING_HOME_PREFIX)) {
14696
- return join4(dirname8(home), STANDARD_HOME);
14802
+ return join4(dirname9(home), STANDARD_HOME);
14697
14803
  }
14698
14804
  return home;
14699
14805
  }
@@ -14716,7 +14822,7 @@ function listHermesProfiles() {
14716
14822
  const seen = new Set([HERMES_DEFAULT_PROFILE]);
14717
14823
  let names = [];
14718
14824
  try {
14719
- names = readdirSync2(join4(root, PROFILES_DIR), { withFileTypes: true }).filter((e) => (e.isDirectory() || e.isSymbolicLink()) && !e.name.startsWith(".")).map((e) => e.name).sort();
14825
+ names = readdirSync3(join4(root, PROFILES_DIR), { withFileTypes: true }).filter((e) => (e.isDirectory() || e.isSymbolicLink()) && !e.name.startsWith(".")).map((e) => e.name).sort();
14720
14826
  } catch {}
14721
14827
  for (const name of names) {
14722
14828
  if (seen.has(name))
@@ -14727,9 +14833,9 @@ function listHermesProfiles() {
14727
14833
  if (basename2(root) !== STANDARD_HOME)
14728
14834
  return out;
14729
14835
  let siblings = [];
14730
- const parent = dirname8(root);
14836
+ const parent = dirname9(root);
14731
14837
  try {
14732
- siblings = readdirSync2(parent, { withFileTypes: true }).filter((entry) => (entry.isDirectory() || entry.isSymbolicLink()) && entry.name.startsWith(SIBLING_HOME_PREFIX) && entry.name.length > SIBLING_HOME_PREFIX.length && existsSync13(join4(parent, entry.name, "config.yaml"))).map((entry) => ({
14838
+ siblings = readdirSync3(parent, { withFileTypes: true }).filter((entry) => (entry.isDirectory() || entry.isSymbolicLink()) && entry.name.startsWith(SIBLING_HOME_PREFIX) && entry.name.length > SIBLING_HOME_PREFIX.length && existsSync13(join4(parent, entry.name, "config.yaml"))).map((entry) => ({
14733
14839
  name: entry.name.slice(SIBLING_HOME_PREFIX.length),
14734
14840
  home: join4(parent, entry.name)
14735
14841
  })).sort((a, b) => a.name.localeCompare(b.name));
@@ -14770,9 +14876,9 @@ var PROFILES_DIR = "profiles", STANDARD_HOME = ".hermes", SIBLING_HOME_PREFIX =
14770
14876
  var init_hermes_profiles = () => {};
14771
14877
 
14772
14878
  // lib/openclaw-profiles.ts
14773
- import { existsSync as existsSync14, readdirSync as readdirSync3 } from "node:fs";
14879
+ import { existsSync as existsSync14, readdirSync as readdirSync4 } from "node:fs";
14774
14880
  import { homedir as homedir8 } from "node:os";
14775
- import { basename as basename3, dirname as dirname9, join as join5, resolve as resolve11 } from "node:path";
14881
+ import { basename as basename3, dirname as dirname10, join as join5, resolve as resolve11 } from "node:path";
14776
14882
  function openclawProfileHome() {
14777
14883
  const stateDir = (process.env.OPENCLAW_STATE_DIR ?? "").trim();
14778
14884
  if (stateDir)
@@ -14782,7 +14888,7 @@ function openclawProfileHome() {
14782
14888
  return resolve11(openclawHome);
14783
14889
  const configPath = (process.env.OPENCLAW_CONFIG_PATH || "").trim();
14784
14890
  if (configPath)
14785
- return dirname9(resolve11(configPath));
14891
+ return dirname10(resolve11(configPath));
14786
14892
  return join5(homedir8(), ".openclaw");
14787
14893
  }
14788
14894
  function listOpenClawProfiles() {
@@ -14791,14 +14897,14 @@ function listOpenClawProfiles() {
14791
14897
  if (activeBase !== ".openclaw" && !activeBase.startsWith(".openclaw-")) {
14792
14898
  return [{ name: OPENCLAW_DEFAULT_PROFILE, home: activeHome }];
14793
14899
  }
14794
- const parent = dirname9(activeHome);
14900
+ const parent = dirname10(activeHome);
14795
14901
  const defaultHome = join5(parent, ".openclaw");
14796
14902
  const out = [
14797
14903
  { name: OPENCLAW_DEFAULT_PROFILE, home: defaultHome }
14798
14904
  ];
14799
14905
  let entries;
14800
14906
  try {
14801
- entries = readdirSync3(parent, { withFileTypes: true });
14907
+ entries = readdirSync4(parent, { withFileTypes: true });
14802
14908
  } catch {
14803
14909
  return out;
14804
14910
  }
@@ -14828,7 +14934,7 @@ import {
14828
14934
  symlinkSync,
14829
14935
  unlinkSync as unlinkSync2
14830
14936
  } from "node:fs";
14831
- import { resolve as resolve12, dirname as dirname10, basename as basename4 } from "node:path";
14937
+ import { resolve as resolve12, dirname as dirname11, basename as basename4 } from "node:path";
14832
14938
  import { fileURLToPath } from "node:url";
14833
14939
  import { homedir as homedir9 } from "node:os";
14834
14940
  function readJsonFile(path) {
@@ -14938,7 +15044,7 @@ function isMarkedCopilotHook(hook) {
14938
15044
  return false;
14939
15045
  }
14940
15046
  function opencodePluginFilePath(settingsPath) {
14941
- return resolve12(dirname10(settingsPath), "plugins", "failproofai.mjs");
15047
+ return resolve12(dirname11(settingsPath), "plugins", "failproofai.mjs");
14942
15048
  }
14943
15049
  function buildOpenCodePluginShim(binaryPath, scope) {
14944
15050
  const useNpx = scope === "project";
@@ -15178,7 +15284,7 @@ function getHermesPluginSourcePath() {
15178
15284
  const fromEnv = process.env.FAILPROOFAI_PACKAGE_ROOT;
15179
15285
  if (fromEnv)
15180
15286
  return resolve12(fromEnv, HERMES_PLUGIN_SOURCE_DIR);
15181
- return findHermesPluginSourcePath(dirname10(fileURLToPath(import.meta.url)));
15287
+ return findHermesPluginSourcePath(dirname11(fileURLToPath(import.meta.url)));
15182
15288
  }
15183
15289
  function findHermesPluginSourcePath(startDir) {
15184
15290
  let dir = resolve12(startDir);
@@ -15186,7 +15292,7 @@ function findHermesPluginSourcePath(startDir) {
15186
15292
  const candidate = resolve12(dir, HERMES_PLUGIN_SOURCE_DIR);
15187
15293
  if (existsSync15(resolve12(candidate, "plugin.yaml")))
15188
15294
  return candidate;
15189
- const parent = dirname10(dir);
15295
+ const parent = dirname11(dir);
15190
15296
  if (parent === dir)
15191
15297
  break;
15192
15298
  dir = parent;
@@ -15194,7 +15300,7 @@ function findHermesPluginSourcePath(startDir) {
15194
15300
  return resolve12(startDir, "..", "..", HERMES_PLUGIN_SOURCE_DIR);
15195
15301
  }
15196
15302
  function hermesPluginPathForSettings(settingsPath) {
15197
- return resolve12(dirname10(settingsPath), "plugins", HERMES_PLUGIN_ID);
15303
+ return resolve12(dirname11(settingsPath), "plugins", HERMES_PLUGIN_ID);
15198
15304
  }
15199
15305
  function pathPresent(path) {
15200
15306
  try {
@@ -15208,7 +15314,7 @@ function hasAllHermesPluginFiles(dir) {
15208
15314
  return HERMES_PLUGIN_FILES.every((file) => existsSync15(resolve12(dir, file)));
15209
15315
  }
15210
15316
  function hermesLinkRecordPath(pluginPath) {
15211
- return resolve12(dirname10(pluginPath), HERMES_LINK_RECORD);
15317
+ return resolve12(dirname11(pluginPath), HERMES_LINK_RECORD);
15212
15318
  }
15213
15319
  function readHermesLinkRecord(pluginPath) {
15214
15320
  try {
@@ -15231,10 +15337,10 @@ function isOwnedHermesPluginLink(pluginPath, target) {
15231
15337
  return true;
15232
15338
  if (samePath(target, getHermesPluginSourcePath()))
15233
15339
  return true;
15234
- const pkgRoot = dirname10(resolve12(target));
15340
+ const pkgRoot = dirname11(resolve12(target));
15235
15341
  if (basename4(resolve12(target)) !== HERMES_PLUGIN_SOURCE_DIR)
15236
15342
  return false;
15237
- if (basename4(pkgRoot) !== "failproofai" || basename4(dirname10(pkgRoot)) !== "node_modules")
15343
+ if (basename4(pkgRoot) !== "failproofai" || basename4(dirname11(pkgRoot)) !== "node_modules")
15238
15344
  return false;
15239
15345
  try {
15240
15346
  const pkg = JSON.parse(readFileSync9(resolve12(pkgRoot, "package.json"), "utf8"));
@@ -15266,7 +15372,7 @@ function hermesPluginState(settingsPath) {
15266
15372
  if (isLink) {
15267
15373
  let target;
15268
15374
  try {
15269
- target = resolve12(dirname10(pluginPath), readlinkSync2(pluginPath));
15375
+ target = resolve12(dirname11(pluginPath), readlinkSync2(pluginPath));
15270
15376
  } catch {
15271
15377
  return { kind: "foreign" };
15272
15378
  }
@@ -15311,7 +15417,7 @@ function installHermesPlugin(settingsPath, deps = {}) {
15311
15417
  }
15312
15418
  return "unchanged";
15313
15419
  }
15314
- mkdirSync8(dirname10(destination), { recursive: true });
15420
+ mkdirSync8(dirname11(destination), { recursive: true });
15315
15421
  const suffix = `${process.pid}-${Date.now()}`;
15316
15422
  const temporary = `${destination}.install-${suffix}`;
15317
15423
  let linked = false;
@@ -16117,7 +16223,7 @@ var init_integrations = __esm(() => {
16117
16223
  const effectiveScope = scope ?? "project";
16118
16224
  const settingsPath = effectiveScope === "user" ? resolve12(homedir9(), ".config", "opencode", "opencode.json") : resolve12(process.cwd(), ".opencode", "opencode.json");
16119
16225
  const pluginPath = opencodePluginFilePath(settingsPath);
16120
- mkdirSync8(dirname10(pluginPath), { recursive: true });
16226
+ mkdirSync8(dirname11(pluginPath), { recursive: true });
16121
16227
  writeConfigFileAtomic(pluginPath, buildOpenCodePluginShim(binaryPath, effectiveScope), { symlinks: "replace" });
16122
16228
  if (!Array.isArray(s.plugin))
16123
16229
  s.plugin = [];
@@ -16337,6 +16443,7 @@ var init_integrations = __esm(() => {
16337
16443
  openclaw = {
16338
16444
  id: "openclaw",
16339
16445
  displayName: "OpenClaw",
16446
+ requiresHealthyDaemon: true,
16340
16447
  scopes: OPENCLAW_HOOK_SCOPES,
16341
16448
  eventTypes: OPENCLAW_HOOK_EVENT_TYPES,
16342
16449
  getSettingsPath() {
@@ -19228,7 +19335,7 @@ var init_custom_hooks_registry = __esm(() => {
19228
19335
  // src/hooks/loader-utils.ts
19229
19336
  import { readFile as readFile2, writeFile as writeFile2, unlink, access, mkdir, lstat } from "fs/promises";
19230
19337
  import { tmpdir as tmpdir2 } from "os";
19231
- import { resolve as resolve13, dirname as dirname11, relative as relative2, join as join6 } from "path";
19338
+ import { resolve as resolve13, dirname as dirname12, relative as relative2, join as join6 } from "path";
19232
19339
  import { pathToFileURL } from "url";
19233
19340
  import { createHash as createHash5 } from "crypto";
19234
19341
  function isTmpArtifact(name) {
@@ -19269,7 +19376,7 @@ async function findDistIndex() {
19269
19376
  return candidate;
19270
19377
  }
19271
19378
  const candidates = [
19272
- resolve13(dirname11(process.execPath), "..", "assets", "dist", "index.js"),
19379
+ resolve13(dirname12(process.execPath), "..", "assets", "dist", "index.js"),
19273
19380
  resolve13(process.cwd(), "dist", "index.js"),
19274
19381
  resolve13(process.cwd(), "node_modules", "failproofai", "dist", "index.js")
19275
19382
  ];
@@ -19360,7 +19467,7 @@ async function rewriteFileTree(entryPath, distUrl, distIndex, tmpSuffix = TMP_SU
19360
19467
  if (distIndex) {
19361
19468
  code = code.replace(/require\s*\(\s*(['"])(?:claudeye|failproofai)\1\s*\)/g, `require('${distIndex.replace(/\\/g, "\\\\")}')`);
19362
19469
  }
19363
- const dir = dirname11(filePath);
19470
+ const dir = dirname12(filePath);
19364
19471
  const rewrites = new Map;
19365
19472
  for (const re of [LOCAL_IMPORT_RE, LOCAL_REQUIRE_RE]) {
19366
19473
  const freshRe = new RegExp(re.source, re.flags);
@@ -19583,7 +19690,7 @@ var init_telemetry_id2 = __esm(() => {
19583
19690
  // src/hooks/custom-hooks-loader.ts
19584
19691
  import { resolve as resolve14, isAbsolute as isAbsolute2, basename as basename5 } from "node:path";
19585
19692
  import { randomUUID } from "crypto";
19586
- import { existsSync as existsSync16, readdirSync as readdirSync4 } from "node:fs";
19693
+ import { existsSync as existsSync16, readdirSync as readdirSync5 } from "node:fs";
19587
19694
  import { readFile as readFile3 } from "node:fs/promises";
19588
19695
  import { pathToFileURL as pathToFileURL2 } from "node:url";
19589
19696
  import { createHash as createHash6 } from "node:crypto";
@@ -19591,7 +19698,7 @@ function discoverPolicyFiles(dir) {
19591
19698
  if (!existsSync16(dir))
19592
19699
  return [];
19593
19700
  try {
19594
- const entries = readdirSync4(dir, { withFileTypes: true });
19701
+ const entries = readdirSync5(dir, { withFileTypes: true });
19595
19702
  return entries.filter((e) => e.isFile() && CONVENTION_FILE_RE.test(e.name)).sort((a, b) => a.name.localeCompare(b.name)).map((e) => resolve14(dir, e.name));
19596
19703
  } catch {
19597
19704
  return [];
@@ -19601,7 +19708,7 @@ function findSkippedPolicyFiles(dir) {
19601
19708
  if (!existsSync16(dir))
19602
19709
  return [];
19603
19710
  try {
19604
- return readdirSync4(dir, { withFileTypes: true }).filter((e) => e.isFile() && LOADABLE_EXT_RE.test(e.name) && !CONVENTION_FILE_RE.test(e.name) && !e.name.endsWith(".d.ts") && !isTmpArtifact(e.name)).map((e) => e.name).sort((a, b) => a.localeCompare(b));
19711
+ return readdirSync5(dir, { withFileTypes: true }).filter((e) => e.isFile() && LOADABLE_EXT_RE.test(e.name) && !CONVENTION_FILE_RE.test(e.name) && !e.name.endsWith(".d.ts") && !isTmpArtifact(e.name)).map((e) => e.name).sort((a, b) => a.localeCompare(b));
19605
19712
  } catch {
19606
19713
  return [];
19607
19714
  }
@@ -21448,7 +21555,7 @@ var init_pack_cli = __esm(() => {
21448
21555
  // src/hooks/pack-store.ts
21449
21556
  import { createHash as createHash7 } from "node:crypto";
21450
21557
  import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as readFileSync10, renameSync as renameSync6, rmSync as rmSync8, writeFileSync as writeFileSync7 } from "node:fs";
21451
- import { dirname as dirname12, resolve as resolve15 } from "node:path";
21558
+ import { dirname as dirname13, resolve as resolve15 } from "node:path";
21452
21559
  function baseUrl2() {
21453
21560
  return (process.env.FAILPROOFAI_PACK_BASE_URL || DEFAULT_BASE_URL2).replace(/\/+$/, "");
21454
21561
  }
@@ -21619,7 +21726,7 @@ function sha256(bytes) {
21619
21726
  function writeAtomic(target, bytes) {
21620
21727
  const tempPath = `${target}.${process.pid}.tmp`;
21621
21728
  try {
21622
- mkdirSync9(dirname12(target), { recursive: true });
21729
+ mkdirSync9(dirname13(target), { recursive: true });
21623
21730
  writeFileSync7(tempPath, bytes);
21624
21731
  renameSync6(tempPath, target);
21625
21732
  } catch (err) {
@@ -22964,10 +23071,10 @@ import {
22964
23071
  writeFileSync as writeFileSync8,
22965
23072
  appendFileSync as appendFileSync2,
22966
23073
  renameSync as renameSync7,
22967
- readdirSync as readdirSync5,
23074
+ readdirSync as readdirSync6,
22968
23075
  mkdirSync as mkdirSync10,
22969
23076
  existsSync as existsSync18,
22970
- statSync as statSync11,
23077
+ statSync as statSync12,
22971
23078
  unlinkSync as unlinkSync3
22972
23079
  } from "node:fs";
22973
23080
  import { join as join7 } from "node:path";
@@ -22988,7 +23095,7 @@ function acquireLock() {
22988
23095
  if (e.code !== "EEXIST")
22989
23096
  return;
22990
23097
  try {
22991
- const s = statSync11(lockPath);
23098
+ const s = statSync12(lockPath);
22992
23099
  if (Date.now() - s.mtimeMs > LOCK_STALE_MS) {
22993
23100
  writeFileSync8(lockPath, String(process.pid), "utf-8");
22994
23101
  return;
@@ -23176,7 +23283,7 @@ function readJsonlFile(filePath) {
23176
23283
  }
23177
23284
  function getArchiveFiles() {
23178
23285
  try {
23179
- const files = readdirSync5(storeDirValue());
23286
+ const files = readdirSync6(storeDirValue());
23180
23287
  return files.filter((f) => f.startsWith("page-") && f.endsWith(".jsonl")).sort((a, b) => {
23181
23288
  const partsA = a.slice(5, -6).split("-");
23182
23289
  const partsB = b.slice(5, -6).split("-");
@@ -23200,7 +23307,7 @@ var init_hook_activity_store = __esm(() => {
23200
23307
  });
23201
23308
 
23202
23309
  // src/hooks/delivery-health.ts
23203
- import { existsSync as existsSync19, readFileSync as readFileSync12, readdirSync as readdirSync6, statSync as statSync12 } from "node:fs";
23310
+ import { existsSync as existsSync19, readFileSync as readFileSync12, readdirSync as readdirSync7, statSync as statSync13 } from "node:fs";
23204
23311
  import { join as join8 } from "node:path";
23205
23312
  function parseParkedName(name) {
23206
23313
  const poison = name.endsWith(POISON_SUFFIX);
@@ -23217,6 +23324,16 @@ function parseParkedName(name) {
23217
23324
  base = base.slice(0, cIdx);
23218
23325
  }
23219
23326
  }
23327
+ for (const suffix of [".r", ".s"]) {
23328
+ const idx = base.lastIndexOf(suffix);
23329
+ if (idx === -1)
23330
+ continue;
23331
+ const raw = base.slice(idx + 2);
23332
+ const n = Number(raw);
23333
+ if (/^\+?\d+$/.test(raw) && Number.isInteger(n) && n >= 0 && n <= 4294967295) {
23334
+ base = base.slice(0, idx);
23335
+ }
23336
+ }
23220
23337
  const aIdx = base.lastIndexOf(".a");
23221
23338
  if (aIdx !== -1) {
23222
23339
  const n = Number(base.slice(aIdx + 2));
@@ -23242,7 +23359,7 @@ function deliveryHealth(home, now = Date.now(), connectedAt = home ? undefined :
23242
23359
  return EMPTY;
23243
23360
  let entries;
23244
23361
  try {
23245
- entries = readdirSync6(dir);
23362
+ entries = readdirSync7(dir);
23246
23363
  } catch {
23247
23364
  return EMPTY;
23248
23365
  }
@@ -23258,7 +23375,7 @@ function deliveryHealth(home, now = Date.now(), connectedAt = home ? undefined :
23258
23375
  const parsed = parseParkedName(name);
23259
23376
  let mtime;
23260
23377
  try {
23261
- mtime = statSync12(join8(dir, name)).mtimeMs;
23378
+ mtime = statSync13(join8(dir, name)).mtimeMs;
23262
23379
  } catch {
23263
23380
  continue;
23264
23381
  }
@@ -24016,7 +24133,7 @@ var init_cursor_projects = __esm(() => {
24016
24133
  });
24017
24134
 
24018
24135
  // lib/sqlite-reader.ts
24019
- import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync13 } from "node:fs";
24136
+ import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync14 } from "node:fs";
24020
24137
  import initSqlJs from "sql.js/dist/sql-asm.js";
24021
24138
  async function tryNodeSqlite(dbPath) {
24022
24139
  try {
@@ -24041,7 +24158,7 @@ function loadSqlJs() {
24041
24158
  return sqlPromise;
24042
24159
  }
24043
24160
  function fileVersion2(path) {
24044
- const stat = statSync13(path);
24161
+ const stat = statSync14(path);
24045
24162
  return { size: stat.size, mtimeMs: stat.mtimeMs, ctimeMs: stat.ctimeMs };
24046
24163
  }
24047
24164
  function sameVersion(a, b) {
@@ -24992,7 +25109,7 @@ var init_openclaw_db = __esm(() => {
24992
25109
 
24993
25110
  // lib/openclaw-sessions.ts
24994
25111
  import { readFile as readFile7 } from "node:fs/promises";
24995
- import { readdirSync as readdirSync7, statSync as statSync14 } from "node:fs";
25112
+ import { readdirSync as readdirSync8, statSync as statSync15 } from "node:fs";
24996
25113
  import { homedir as homedir16 } from "node:os";
24997
25114
  import { join as join17 } from "node:path";
24998
25115
  function openclawHome() {
@@ -25115,7 +25232,7 @@ function openclawLinesToLogEntries(lines, source = "session") {
25115
25232
  }
25116
25233
  function listOpenClawAgents() {
25117
25234
  try {
25118
- return readdirSync7(join17(openclawHome(), "agents"), { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => d.name).sort();
25235
+ return readdirSync8(join17(openclawHome(), "agents"), { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => d.name).sort();
25119
25236
  } catch {
25120
25237
  return [];
25121
25238
  }
@@ -25125,7 +25242,7 @@ function listOpenClawTranscripts() {
25125
25242
  const out = [];
25126
25243
  let agentIds;
25127
25244
  try {
25128
- agentIds = readdirSync7(agentsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
25245
+ agentIds = readdirSync8(agentsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
25129
25246
  } catch {
25130
25247
  return out;
25131
25248
  }
@@ -25133,7 +25250,7 @@ function listOpenClawTranscripts() {
25133
25250
  const sessionsDir = join17(agentsDir, agentId, "sessions");
25134
25251
  let files;
25135
25252
  try {
25136
- files = readdirSync7(sessionsDir);
25253
+ files = readdirSync8(sessionsDir);
25137
25254
  } catch {
25138
25255
  continue;
25139
25256
  }
@@ -25145,7 +25262,7 @@ function listOpenClawTranscripts() {
25145
25262
  continue;
25146
25263
  const transcriptPath = join17(sessionsDir, file);
25147
25264
  try {
25148
- const st = statSync14(transcriptPath);
25265
+ const st = statSync15(transcriptPath);
25149
25266
  out.push({
25150
25267
  agentId,
25151
25268
  sessionId,
@@ -25390,7 +25507,7 @@ var init_openclaw_projects = __esm(() => {
25390
25507
 
25391
25508
  // lib/factory-sessions.ts
25392
25509
  import { readFile as readFile8 } from "node:fs/promises";
25393
- import { readdirSync as readdirSync8, statSync as statSync15 } from "node:fs";
25510
+ import { readdirSync as readdirSync9, statSync as statSync16 } from "node:fs";
25394
25511
  import { homedir as homedir17 } from "node:os";
25395
25512
  import { join as join19 } from "node:path";
25396
25513
  function factoryHome() {
@@ -25536,7 +25653,7 @@ function listFactoryTranscripts() {
25536
25653
  const out = [];
25537
25654
  let projectDirs;
25538
25655
  try {
25539
- projectDirs = readdirSync8(root, { withFileTypes: true }).filter((d) => d.isDirectory());
25656
+ projectDirs = readdirSync9(root, { withFileTypes: true }).filter((d) => d.isDirectory());
25540
25657
  } catch {
25541
25658
  return out;
25542
25659
  }
@@ -25546,7 +25663,7 @@ function listFactoryTranscripts() {
25546
25663
  const projectPath = join19(root, projectName);
25547
25664
  let files;
25548
25665
  try {
25549
- files = readdirSync8(projectPath);
25666
+ files = readdirSync9(projectPath);
25550
25667
  } catch {
25551
25668
  continue;
25552
25669
  }
@@ -25558,7 +25675,7 @@ function listFactoryTranscripts() {
25558
25675
  continue;
25559
25676
  const transcriptPath = join19(projectPath, file);
25560
25677
  try {
25561
- const st = statSync15(transcriptPath);
25678
+ const st = statSync16(transcriptPath);
25562
25679
  out.push({ projectName, cwd, sessionId, transcriptPath, mtimeMs: st.mtimeMs, sizeBytes: st.size });
25563
25680
  } catch {}
25564
25681
  }
@@ -25978,7 +26095,7 @@ var init_devin_projects = __esm(() => {
25978
26095
 
25979
26096
  // lib/antigravity-sessions.ts
25980
26097
  import { readFile as readFile9 } from "node:fs/promises";
25981
- import { readdirSync as readdirSync9, statSync as statSync16 } from "node:fs";
26098
+ import { readdirSync as readdirSync10, statSync as statSync17 } from "node:fs";
25982
26099
  import { homedir as homedir19 } from "node:os";
25983
26100
  import { join as join21 } from "node:path";
25984
26101
  function antigravityHome() {
@@ -26103,7 +26220,7 @@ function listAntigravityTranscripts() {
26103
26220
  const out = [];
26104
26221
  let convoDirs;
26105
26222
  try {
26106
- convoDirs = readdirSync9(root, { withFileTypes: true }).filter((d) => d.isDirectory());
26223
+ convoDirs = readdirSync10(root, { withFileTypes: true }).filter((d) => d.isDirectory());
26107
26224
  } catch {
26108
26225
  return out;
26109
26226
  }
@@ -26113,7 +26230,7 @@ function listAntigravityTranscripts() {
26113
26230
  continue;
26114
26231
  const transcriptPath = join21(root, conversationId, rel);
26115
26232
  try {
26116
- const st = statSync16(transcriptPath);
26233
+ const st = statSync17(transcriptPath);
26117
26234
  if (!st.isFile())
26118
26235
  continue;
26119
26236
  out.push({ conversationId, transcriptPath, mtimeMs: st.mtimeMs, sizeBytes: st.size });
@@ -26126,7 +26243,7 @@ function findAntigravityTranscript(conversationId) {
26126
26243
  return null;
26127
26244
  const transcriptPath = join21(antigravityBrainRoot(), conversationId, antigravityTranscriptRelPath());
26128
26245
  try {
26129
- if (statSync16(transcriptPath).isFile())
26246
+ if (statSync17(transcriptPath).isFile())
26130
26247
  return transcriptPath;
26131
26248
  } catch {}
26132
26249
  return null;
@@ -27041,9 +27158,9 @@ var init_log_entries = __esm(() => {
27041
27158
  });
27042
27159
 
27043
27160
  // lib/codex-sessions.ts
27044
- import { readFileSync as readFileSync15, readdirSync as readdirSync10, existsSync as existsSync22, writeFileSync as writeFileSync9, mkdirSync as mkdirSync11, statSync as statSync17 } from "node:fs";
27161
+ import { readFileSync as readFileSync15, readdirSync as readdirSync11, existsSync as existsSync22, writeFileSync as writeFileSync9, mkdirSync as mkdirSync11, statSync as statSync18 } from "node:fs";
27045
27162
  import { readFile as readFile11 } from "node:fs/promises";
27046
- import { dirname as dirname13, join as join27 } from "node:path";
27163
+ import { dirname as dirname14, join as join27 } from "node:path";
27047
27164
  import { homedir as homedir21 } from "node:os";
27048
27165
  function readCache() {
27049
27166
  try {
@@ -27056,7 +27173,7 @@ function readCache() {
27056
27173
  }
27057
27174
  function writeCacheEntry(sessionId, path) {
27058
27175
  try {
27059
- mkdirSync11(dirname13(CACHE_PATH), { recursive: true });
27176
+ mkdirSync11(dirname14(CACHE_PATH), { recursive: true });
27060
27177
  const cache = readCache();
27061
27178
  cache[sessionId] = path;
27062
27179
  writeFileSync9(CACHE_PATH, JSON.stringify(cache), "utf-8");
@@ -27064,7 +27181,7 @@ function writeCacheEntry(sessionId, path) {
27064
27181
  }
27065
27182
  function dirSearch(dir, sessionId) {
27066
27183
  try {
27067
- for (const f of readdirSync10(dir, { withFileTypes: true })) {
27184
+ for (const f of readdirSync11(dir, { withFileTypes: true })) {
27068
27185
  if (f.isFile() && f.name.includes(sessionId) && f.name.endsWith(".jsonl")) {
27069
27186
  return join27(dir, f.name);
27070
27187
  }
@@ -27094,13 +27211,13 @@ function findCodexTranscript(sessionId) {
27094
27211
  }
27095
27212
  }
27096
27213
  try {
27097
- for (const y of readdirSync10(root, { withFileTypes: true })) {
27214
+ for (const y of readdirSync11(root, { withFileTypes: true })) {
27098
27215
  if (!y.isDirectory())
27099
27216
  continue;
27100
- for (const m of readdirSync10(join27(root, y.name), { withFileTypes: true })) {
27217
+ for (const m of readdirSync11(join27(root, y.name), { withFileTypes: true })) {
27101
27218
  if (!m.isDirectory())
27102
27219
  continue;
27103
- for (const d of readdirSync10(join27(root, y.name, m.name), { withFileTypes: true })) {
27220
+ for (const d of readdirSync11(join27(root, y.name, m.name), { withFileTypes: true })) {
27104
27221
  if (!d.isDirectory())
27105
27222
  continue;
27106
27223
  const hit = dirSearch(join27(root, y.name, m.name, d.name), sessionId);
@@ -27369,7 +27486,7 @@ var init_resolve_permission_mode = __esm(() => {
27369
27486
  });
27370
27487
 
27371
27488
  // lib/copilot-sessions.ts
27372
- import { readFileSync as readFileSync17, readdirSync as readdirSync11, existsSync as existsSync23, statSync as statSync18 } from "node:fs";
27489
+ import { readFileSync as readFileSync17, readdirSync as readdirSync12, existsSync as existsSync23, statSync as statSync19 } from "node:fs";
27373
27490
  import { readFile as readFile12 } from "node:fs/promises";
27374
27491
  import { join as join28, resolve as resolve17, sep as sep2 } from "node:path";
27375
27492
  import { homedir as homedir22 } from "node:os";
@@ -27586,7 +27703,7 @@ var init_copilot_sessions = __esm(() => {
27586
27703
  });
27587
27704
 
27588
27705
  // lib/cursor-sessions.ts
27589
- import { readFileSync as readFileSync18, readdirSync as readdirSync12, existsSync as existsSync24, statSync as statSync19 } from "node:fs";
27706
+ import { readFileSync as readFileSync18, readdirSync as readdirSync13, existsSync as existsSync24, statSync as statSync20 } from "node:fs";
27590
27707
  import { readFile as readFile13 } from "node:fs/promises";
27591
27708
  import { basename as basename6, join as join29, resolve as resolve18, sep as sep3 } from "node:path";
27592
27709
  import { homedir as homedir23 } from "node:os";
@@ -27600,7 +27717,7 @@ function getCursorSessionDir(sessionId) {
27600
27717
  const projectsRoot = resolve18(home, NEW_PROJECTS_DIR2);
27601
27718
  let projectEntries = [];
27602
27719
  try {
27603
- projectEntries = readdirSync12(projectsRoot, { withFileTypes: true });
27720
+ projectEntries = readdirSync13(projectsRoot, { withFileTypes: true });
27604
27721
  } catch {}
27605
27722
  for (const entry of projectEntries) {
27606
27723
  if (!entry.isDirectory())
@@ -27842,7 +27959,7 @@ var init_cursor_sessions = __esm(() => {
27842
27959
  });
27843
27960
 
27844
27961
  // lib/pi-sessions.ts
27845
- import { readFileSync as readFileSync19, readdirSync as readdirSync13, existsSync as existsSync25, statSync as statSync20 } from "node:fs";
27962
+ import { readFileSync as readFileSync19, readdirSync as readdirSync14, existsSync as existsSync25, statSync as statSync21 } from "node:fs";
27846
27963
  import { readFile as readFile14 } from "node:fs/promises";
27847
27964
  import { join as join30, resolve as resolve19, sep as sep4 } from "node:path";
27848
27965
  import { homedir as homedir24 } from "node:os";
@@ -27858,7 +27975,7 @@ function findPiTranscript(sessionId) {
27858
27975
  const root = resolve19(getPiSessionStateRoot());
27859
27976
  let cwdDirs;
27860
27977
  try {
27861
- cwdDirs = readdirSync13(root);
27978
+ cwdDirs = readdirSync14(root);
27862
27979
  } catch {
27863
27980
  return null;
27864
27981
  }
@@ -27868,7 +27985,7 @@ function findPiTranscript(sessionId) {
27868
27985
  continue;
27869
27986
  let files;
27870
27987
  try {
27871
- files = readdirSync13(cwdPath);
27988
+ files = readdirSync14(cwdPath);
27872
27989
  } catch {
27873
27990
  continue;
27874
27991
  }
@@ -28518,7 +28635,7 @@ var init_pack_failclosed = __esm(() => {
28518
28635
  });
28519
28636
 
28520
28637
  // src/hooks/session-pause.ts
28521
- import { existsSync as existsSync27, mkdirSync as mkdirSync12, readdirSync as readdirSync14, readFileSync as readFileSync21, rmSync as rmSync10 } from "node:fs";
28638
+ import { existsSync as existsSync27, mkdirSync as mkdirSync12, readdirSync as readdirSync15, readFileSync as readFileSync21, rmSync as rmSync10 } from "node:fs";
28522
28639
  import { createHash as createHash8 } from "node:crypto";
28523
28640
  import { join as join31, resolve as resolve21 } from "node:path";
28524
28641
  function pauseStateDir() {
@@ -28632,7 +28749,7 @@ function listActivePauses(now = Date.now()) {
28632
28749
  const out = [];
28633
28750
  let names;
28634
28751
  try {
28635
- names = readdirSync14(dir);
28752
+ names = readdirSync15(dir);
28636
28753
  } catch {
28637
28754
  return [];
28638
28755
  }
@@ -28683,14 +28800,14 @@ import {
28683
28800
  existsSync as existsSync28,
28684
28801
  mkdirSync as mkdirSync13,
28685
28802
  readFileSync as readFileSync22,
28686
- readdirSync as readdirSync15,
28803
+ readdirSync as readdirSync16,
28687
28804
  renameSync as renameSync9,
28688
28805
  rmSync as rmSync11,
28689
28806
  rmdirSync,
28690
- statSync as statSync21,
28807
+ statSync as statSync22,
28691
28808
  writeFileSync as writeFileSync11
28692
28809
  } from "node:fs";
28693
- import { dirname as dirname14, isAbsolute as isAbsolute3, relative as relative4, resolve as resolve22 } from "node:path";
28810
+ import { dirname as dirname15, isAbsolute as isAbsolute3, relative as relative4, resolve as resolve22 } from "node:path";
28694
28811
  function migrateConventionPolicies() {
28695
28812
  const from = legacy.customPoliciesDir();
28696
28813
  if (!existsSync28(from))
@@ -28699,7 +28816,7 @@ function migrateConventionPolicies() {
28699
28816
  const mergeInto = (dir, dest, prefix) => {
28700
28817
  let entries;
28701
28818
  try {
28702
- entries = readdirSync15(dir, { withFileTypes: true });
28819
+ entries = readdirSync16(dir, { withFileTypes: true });
28703
28820
  } catch {
28704
28821
  return;
28705
28822
  }
@@ -28721,7 +28838,7 @@ function migrateConventionPolicies() {
28721
28838
  } catch {}
28722
28839
  continue;
28723
28840
  }
28724
- if (entry.isDirectory() && statSync21(target).isDirectory()) {
28841
+ if (entry.isDirectory() && statSync22(target).isDirectory()) {
28725
28842
  mergeInto(source, target, `${name}/`);
28726
28843
  try {
28727
28844
  rmdirSync(source);
@@ -28745,7 +28862,7 @@ function migrateLegacySpool() {
28745
28862
  continue;
28746
28863
  try {
28747
28864
  mkdirSync13(to, { recursive: true });
28748
- for (const entry of readdirSync15(from, { withFileTypes: true })) {
28865
+ for (const entry of readdirSync16(from, { withFileTypes: true })) {
28749
28866
  if (!entry.isFile())
28750
28867
  continue;
28751
28868
  let name = entry.name;
@@ -28772,7 +28889,7 @@ function migrateHookActivity() {
28772
28889
  return [];
28773
28890
  const moved = [];
28774
28891
  try {
28775
- const entries = readdirSync15(from, { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".jsonl"));
28892
+ const entries = readdirSync16(from, { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".jsonl"));
28776
28893
  if (entries.length === 0)
28777
28894
  return [];
28778
28895
  const to = hookActivityDir();
@@ -28888,7 +29005,7 @@ function writeCarriedPolicyConfig(carried) {
28888
29005
  }
28889
29006
  } catch {}
28890
29007
  try {
28891
- mkdirSync13(dirname14(to), { recursive: true });
29008
+ mkdirSync13(dirname15(to), { recursive: true });
28892
29009
  writeFileSync11(to, JSON.stringify({ ...existing, ...carried }, null, 2) + `
28893
29010
  `, "utf8");
28894
29011
  } catch {
@@ -29080,12 +29197,12 @@ var init_untraced_note = __esm(() => {
29080
29197
  });
29081
29198
 
29082
29199
  // src/hooks/agent-roster.ts
29083
- import { lstatSync as lstatSync4, readFileSync as readFileSync24, statSync as statSync22 } from "node:fs";
29200
+ import { lstatSync as lstatSync4, readFileSync as readFileSync24, statSync as statSync23 } from "node:fs";
29084
29201
  import { homedir as homedir26 } from "node:os";
29085
- import { dirname as dirname15, resolve as resolve23 } from "node:path";
29202
+ import { dirname as dirname16, resolve as resolve23 } from "node:path";
29086
29203
  function installedHookAt2(path, cli) {
29087
29204
  try {
29088
- const stat = statSync22(path);
29205
+ const stat = statSync23(path);
29089
29206
  if (!stat.isFile() || stat.size > 131072)
29090
29207
  return false;
29091
29208
  const text = readFileSync24(path, "utf8");
@@ -29143,7 +29260,7 @@ function runtimeAgentSettingsPath2(cli, cwd, userHome = homedir26(), hookScope)
29143
29260
  if (installedHookAt2(path, cli))
29144
29261
  matches.add(path);
29145
29262
  }
29146
- const parent = dirname15(dir);
29263
+ const parent = dirname16(dir);
29147
29264
  if (parent === dir)
29148
29265
  break;
29149
29266
  dir = parent;
@@ -29236,8 +29353,8 @@ var init_agent_roster2 = __esm(() => {
29236
29353
  });
29237
29354
 
29238
29355
  // src/hooks/semantic/jev-config.ts
29239
- import { closeSync as closeSync3, constants as fsConstants4, fstatSync as fstatSync2, openSync as openSync3, readSync as readSync2, statSync as statSync23 } from "node:fs";
29240
- import { dirname as dirname16 } from "node:path";
29356
+ import { closeSync as closeSync3, constants as fsConstants4, fstatSync as fstatSync2, openSync as openSync3, readSync as readSync2, statSync as statSync24 } from "node:fs";
29357
+ import { dirname as dirname17 } from "node:path";
29241
29358
  function parseJevMode(raw) {
29242
29359
  return raw === "off" || raw === "observe" || raw === "enforce" ? raw : null;
29243
29360
  }
@@ -29497,7 +29614,7 @@ function looseConfigDirMode(path) {
29497
29614
  if (!modesAreMeaningful())
29498
29615
  return null;
29499
29616
  try {
29500
- const mode = statSync23(dirname16(path)).mode & 511;
29617
+ const mode = statSync24(dirname17(path)).mode & 511;
29501
29618
  return (mode & DIR_WRITABLE_BY_OTHERS2) !== 0 ? mode : null;
29502
29619
  } catch {
29503
29620
  return null;
@@ -29558,8 +29675,8 @@ function inspectJevConfig() {
29558
29675
  path,
29559
29676
  mode,
29560
29677
  reason: "too-open",
29561
- problem: `its directory ${dirname16(path)} is ${dirMode.toString(8).padStart(4, "0")} — other users can write there, ` + `so they can put their own config in its place; it must be owner-only (chmod 700 ${dirname16(path)})`,
29562
- fix: `chmod 700 ${dirname16(path)}`
29678
+ problem: `its directory ${dirname17(path)} is ${dirMode.toString(8).padStart(4, "0")} — other users can write there, ` + `so they can put their own config in its place; it must be owner-only (chmod 700 ${dirname17(path)})`,
29679
+ fix: `chmod 700 ${dirname17(path)}`
29563
29680
  };
29564
29681
  }
29565
29682
  if (st.size > MAX_CONFIG_BYTES)
@@ -29678,14 +29795,14 @@ function jevInputsVersion() {
29678
29795
  process.platform,
29679
29796
  credentials,
29680
29797
  statVersion(credentials),
29681
- statVersion(dirname16(credentials)),
29798
+ statVersion(dirname17(credentials)),
29682
29799
  config,
29683
29800
  statVersion(config)
29684
29801
  ].join("\x00");
29685
29802
  }
29686
29803
  function statVersion(path) {
29687
29804
  try {
29688
- const st = statSync23(path, { bigint: true });
29805
+ const st = statSync24(path, { bigint: true });
29689
29806
  return `${st.dev}:${st.ino}:${st.mode}:${st.size}:${st.mtimeNs}:${st.ctimeNs}`;
29690
29807
  } catch (err) {
29691
29808
  return `-${err.code ?? "error"}`;
@@ -29913,9 +30030,9 @@ var init_cloud_jev_health = __esm(() => {
29913
30030
  });
29914
30031
 
29915
30032
  // src/hooks/semantic/facts.ts
29916
- import { existsSync as existsSync30, readFileSync as readFileSync25, statSync as statSync24 } from "node:fs";
30033
+ import { existsSync as existsSync30, readFileSync as readFileSync25, statSync as statSync25 } from "node:fs";
29917
30034
  import { homedir as homedir27 } from "node:os";
29918
- import { dirname as dirname17, isAbsolute as isAbsolute4, resolve as resolve24 } from "node:path";
30035
+ import { dirname as dirname18, isAbsolute as isAbsolute4, resolve as resolve24 } from "node:path";
29919
30036
  function classifyTool(toolName) {
29920
30037
  if (SHELL_TOOLS.has(toolName))
29921
30038
  return { toolClass: "shell", toolIsKnown: true };
@@ -30142,7 +30259,7 @@ function findGitDir(start) {
30142
30259
  const candidate = resolve24(dir, ".git");
30143
30260
  if (existsSync30(candidate))
30144
30261
  return candidate;
30145
- const parent = dirname17(dir);
30262
+ const parent = dirname18(dir);
30146
30263
  if (parent === dir)
30147
30264
  return null;
30148
30265
  dir = parent;
@@ -30153,7 +30270,7 @@ function findProjectRoot(cwd) {
30153
30270
  if (!cwd)
30154
30271
  return null;
30155
30272
  const gitDir = findGitDir(cwd);
30156
- return gitDir ? dirname17(gitDir) : cwd;
30273
+ return gitDir ? dirname18(gitDir) : cwd;
30157
30274
  }
30158
30275
  function readCurrentBranch(cwd) {
30159
30276
  if (!cwd)
@@ -30163,12 +30280,12 @@ function readCurrentBranch(cwd) {
30163
30280
  if (!gitPath)
30164
30281
  return null;
30165
30282
  let headFile = resolve24(gitPath, "HEAD");
30166
- if (statSync24(gitPath).isFile()) {
30283
+ if (statSync25(gitPath).isFile()) {
30167
30284
  const pointer = readFileSync25(gitPath, "utf8").trim();
30168
30285
  const m = /^gitdir:\s*(.+)$/.exec(pointer);
30169
30286
  if (!m)
30170
30287
  return null;
30171
- headFile = resolve24(dirname17(gitPath), m[1], "HEAD");
30288
+ headFile = resolve24(dirname18(gitPath), m[1], "HEAD");
30172
30289
  }
30173
30290
  const head = readFileSync25(headFile, "utf8").trim();
30174
30291
  const ref = /^ref:\s*refs\/heads\/(.+)$/.exec(head);
@@ -30563,15 +30680,15 @@ import {
30563
30680
  closeSync as closeSync4,
30564
30681
  mkdirSync as mkdirSync14,
30565
30682
  openSync as openSync4,
30566
- readdirSync as readdirSync16,
30683
+ readdirSync as readdirSync17,
30567
30684
  readFileSync as readFileSync26,
30568
30685
  readSync as readSync3,
30569
30686
  renameSync as renameSync10,
30570
- statSync as statSync25,
30687
+ statSync as statSync26,
30571
30688
  unlinkSync as unlinkSync4,
30572
30689
  writeFileSync as writeFileSync12
30573
30690
  } from "node:fs";
30574
- import { dirname as dirname18, resolve as resolve25 } from "node:path";
30691
+ import { dirname as dirname19, resolve as resolve25 } from "node:path";
30575
30692
  function intentProfileKey(profile) {
30576
30693
  if (validAgentIdentity(profile.agent))
30577
30694
  return `${profile.agent.integration}.${profile.agent.instanceId}`;
@@ -30597,7 +30714,7 @@ function storeDirChain(innermost = sessionsDir()) {
30597
30714
  chain.push(dir);
30598
30715
  if (dir === home)
30599
30716
  break;
30600
- const parent = dirname18(dir);
30717
+ const parent = dirname19(dir);
30601
30718
  if (parent === dir)
30602
30719
  break;
30603
30720
  dir = parent;
@@ -30610,7 +30727,7 @@ function looseIntentStoreDir(innermost) {
30610
30727
  for (const dir of storeDirChain(innermost)) {
30611
30728
  let mode;
30612
30729
  try {
30613
- mode = statSync25(dir).mode & 511;
30730
+ mode = statSync26(dir).mode & 511;
30614
30731
  } catch {
30615
30732
  continue;
30616
30733
  }
@@ -30618,7 +30735,7 @@ function looseIntentStoreDir(innermost) {
30618
30735
  continue;
30619
30736
  try {
30620
30737
  chmodSync7(dir, mode & ~DIR_WRITABLE_BY_OTHERS3);
30621
- if ((statSync25(dir).mode & DIR_WRITABLE_BY_OTHERS3) !== 0)
30738
+ if ((statSync26(dir).mode & DIR_WRITABLE_BY_OTHERS3) !== 0)
30622
30739
  return dir;
30623
30740
  } catch {
30624
30741
  return dir;
@@ -30655,7 +30772,7 @@ function appendPrompt(slot, entry) {
30655
30772
  }
30656
30773
  function fileExists2(path) {
30657
30774
  try {
30658
- statSync25(path);
30775
+ statSync26(path);
30659
30776
  return true;
30660
30777
  } catch {
30661
30778
  return false;
@@ -30665,12 +30782,12 @@ function pruneExpiredSessions(now = Date.now()) {
30665
30782
  const root = sessionsDir();
30666
30783
  let removed = pruneDir(root, now);
30667
30784
  try {
30668
- for (const name of readdirSync16(root)) {
30785
+ for (const name of readdirSync17(root)) {
30669
30786
  if (!PROFILE_DIR_RE.test(name))
30670
30787
  continue;
30671
30788
  const dir = resolve25(root, name);
30672
30789
  try {
30673
- if (statSync25(dir).isDirectory())
30790
+ if (statSync26(dir).isDirectory())
30674
30791
  removed += pruneDir(dir, now);
30675
30792
  } catch {}
30676
30793
  }
@@ -30680,12 +30797,12 @@ function pruneExpiredSessions(now = Date.now()) {
30680
30797
  function pruneDir(dir, now) {
30681
30798
  let removed = 0;
30682
30799
  try {
30683
- for (const name of readdirSync16(dir)) {
30800
+ for (const name of readdirSync17(dir)) {
30684
30801
  if (!SESSION_FILE_RE3.test(name))
30685
30802
  continue;
30686
30803
  const path = resolve25(dir, name);
30687
30804
  try {
30688
- const st = statSync25(path);
30805
+ const st = statSync26(path);
30689
30806
  if (st.isFile() && now - st.mtimeMs > INTENT_MAX_AGE_MS) {
30690
30807
  unlinkSync4(path);
30691
30808
  removed++;
@@ -31000,7 +31117,7 @@ function visitLinesBackwards(transcriptPath, maxBytes, visit) {
31000
31117
  return;
31001
31118
  let fd;
31002
31119
  try {
31003
- const st = statSync25(path);
31120
+ const st = statSync26(path);
31004
31121
  if (!st.isFile() || st.size === 0)
31005
31122
  return;
31006
31123
  fd = openSync4(path, "r");
@@ -31636,7 +31753,7 @@ var init_jev_client = __esm(() => {
31636
31753
 
31637
31754
  // src/hooks/semantic/evaluator.ts
31638
31755
  import { createHash as createHash9 } from "node:crypto";
31639
- import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync15, renameSync as renameSync11, statSync as statSync26 } from "node:fs";
31756
+ import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync15, renameSync as renameSync11, statSync as statSync27 } from "node:fs";
31640
31757
  import { resolve as resolve26 } from "node:path";
31641
31758
  function storeCut(message) {
31642
31759
  return typeof message === "string" && message.length >= MAX_USER_MESSAGE_CHARS - STORE_CUT_SLACK && OMISSION_MARK.test(message);
@@ -31810,7 +31927,7 @@ function appendVerdictLog(row) {
31810
31927
  const file = verdictLogFile();
31811
31928
  mkdirSync15(semanticDir(), { recursive: true, mode: 448 });
31812
31929
  try {
31813
- if (statSync26(file).size > VERDICT_LOG_MAX_BYTES)
31930
+ if (statSync27(file).size > VERDICT_LOG_MAX_BYTES)
31814
31931
  renameSync11(file, `${file}.1`);
31815
31932
  } catch {}
31816
31933
  appendFileSync3(file, JSON.stringify(row) + `
@@ -32535,7 +32652,7 @@ var init_jev_throttle = __esm(() => {
32535
32652
  });
32536
32653
 
32537
32654
  // src/hooks/semantic/session-root.ts
32538
- import { mkdirSync as mkdirSync16, readdirSync as readdirSync17, readFileSync as readFileSync27, statSync as statSync27, unlinkSync as unlinkSync5, writeFileSync as writeFileSync13 } from "node:fs";
32655
+ import { mkdirSync as mkdirSync16, readdirSync as readdirSync18, readFileSync as readFileSync27, statSync as statSync28, unlinkSync as unlinkSync5, writeFileSync as writeFileSync13 } from "node:fs";
32539
32656
  import { isAbsolute as isAbsolute5, resolve as resolve27 } from "node:path";
32540
32657
  function validRoot(v) {
32541
32658
  return typeof v === "string" && isAbsolute5(v) && resolve27(v) === v && v !== "/";
@@ -32546,7 +32663,7 @@ function storeIsOurs() {
32546
32663
  if (looseIntentStoreDir() !== null)
32547
32664
  return false;
32548
32665
  try {
32549
- const mode = statSync27(rootsDir()).mode & 511;
32666
+ const mode = statSync28(rootsDir()).mode & 511;
32550
32667
  return (mode & DIR_WRITABLE_BY_OTHERS4) === 0;
32551
32668
  } catch {
32552
32669
  return true;
@@ -32564,12 +32681,12 @@ function pruneSessionRoots(now = Date.now()) {
32564
32681
  let removed = 0;
32565
32682
  try {
32566
32683
  const dir = rootsDir();
32567
- for (const name of readdirSync17(dir)) {
32684
+ for (const name of readdirSync18(dir)) {
32568
32685
  if (!ROOT_FILE_RE.test(name))
32569
32686
  continue;
32570
32687
  const path = resolve27(dir, name);
32571
32688
  try {
32572
- const st = statSync27(path);
32689
+ const st = statSync28(path);
32573
32690
  if (st.isFile() && now - st.mtimeMs > SESSION_ROOT_MAX_AGE_MS) {
32574
32691
  unlinkSync5(path);
32575
32692
  removed++;
@@ -33349,6 +33466,9 @@ async function evaluateHookEvent(eventType, cli = "claude", stdinPayload, opts)
33349
33466
  cli
33350
33467
  });
33351
33468
  }
33469
+ if (cli === "antigravity" && antigravityPathGuardActive(Boolean(activePause), cloudManagedPolicies) && antigravityCallLacksPath(canonicalEventType, parsed.tool_name, parsed.tool_input)) {
33470
+ registerPolicy(ANTIGRAVITY_PATH_GUARD_NAME, ANTIGRAVITY_PATH_GUARD_DESCRIPTION, antigravityPathGuard, ANTIGRAVITY_PATH_GUARD_MATCH);
33471
+ }
33352
33472
  cloudDeployment = cloudManagedPolicies[0]?.deployment ?? readCloudJevState().deployment ?? undefined;
33353
33473
  let installedPacks = [];
33354
33474
  try {
@@ -33660,6 +33780,7 @@ var init_handler = __esm(() => {
33660
33780
  init_tool_name_canonicalize();
33661
33781
  init_hooks_config();
33662
33782
  init_builtin_policies();
33783
+ init_antigravity_path_guard();
33663
33784
  init_policy_evaluator();
33664
33785
  init_policy_registry();
33665
33786
  init_custom_hooks_loader();
@@ -34508,8 +34629,8 @@ var init_collector_config = __esm(() => {
34508
34629
  });
34509
34630
 
34510
34631
  // src/hooks/flush-cli.ts
34511
- import { existsSync as existsSync32, mkdirSync as mkdirSync17, writeFileSync as writeFileSync14, readdirSync as readdirSync18, statSync as statSync28 } from "node:fs";
34512
- import { dirname as dirname19, join as join33 } from "node:path";
34632
+ import { existsSync as existsSync32, mkdirSync as mkdirSync17, writeFileSync as writeFileSync14, readdirSync as readdirSync19, statSync as statSync29 } from "node:fs";
34633
+ import { dirname as dirname20, join as join33 } from "node:path";
34513
34634
  function flushRequestPath(home) {
34514
34635
  return join33(failproofaiHome(home), "state", "flush-request.json");
34515
34636
  }
@@ -34519,14 +34640,14 @@ function spoolDirs(home) {
34519
34640
  if (!existsSync32(root))
34520
34641
  return dirs;
34521
34642
  try {
34522
- return dirs.concat(readdirSync18(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== "failed").map((e) => join33(root, e.name)));
34643
+ return dirs.concat(readdirSync19(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== "failed").map((e) => join33(root, e.name)));
34523
34644
  } catch {
34524
34645
  return dirs;
34525
34646
  }
34526
34647
  }
34527
34648
  function parkedBatches(home) {
34528
34649
  try {
34529
- return readdirSync18(failedDir(home)).filter((f) => f.endsWith(".jsonl")).length;
34650
+ return readdirSync19(failedDir(home)).filter((f) => f.endsWith(".jsonl")).length;
34530
34651
  } catch {
34531
34652
  return 0;
34532
34653
  }
@@ -34543,14 +34664,14 @@ function spoolBacklog(home, now = Date.now()) {
34543
34664
  for (const dir of spoolDirs(home)) {
34544
34665
  let names;
34545
34666
  try {
34546
- names = readdirSync18(dir).filter((f) => f.endsWith(".jsonl"));
34667
+ names = readdirSync19(dir).filter((f) => f.endsWith(".jsonl"));
34547
34668
  } catch {
34548
34669
  continue;
34549
34670
  }
34550
34671
  count += names.length;
34551
34672
  for (const name of names) {
34552
34673
  try {
34553
- const mtime = statSync28(join33(dir, name)).mtimeMs;
34674
+ const mtime = statSync29(join33(dir, name)).mtimeMs;
34554
34675
  if (oldest === undefined || mtime < oldest)
34555
34676
  oldest = mtime;
34556
34677
  } catch {}
@@ -34612,7 +34733,7 @@ async function runFlushCommand(opts = {}) {
34612
34733
  return { exitCode: 0, pending: 0, lines: nothing };
34613
34734
  }
34614
34735
  const path = flushRequestPath(home);
34615
- mkdirSync17(dirname19(path), { recursive: true });
34736
+ mkdirSync17(dirname20(path), { recursive: true });
34616
34737
  writeFileSync14(path, `${JSON.stringify({ requestedAtMs: Date.now() }, null, 2)}
34617
34738
  `, {
34618
34739
  mode: 384
@@ -34656,7 +34777,7 @@ import {
34656
34777
  rmSync as rmSync12,
34657
34778
  writeFileSync as writeFileSync15
34658
34779
  } from "node:fs";
34659
- import { basename as basename7, dirname as dirname20, join as join34, resolve as resolve28 } from "node:path";
34780
+ import { basename as basename7, dirname as dirname21, join as join34, resolve as resolve28 } from "node:path";
34660
34781
  function migrateToLayout4() {
34661
34782
  const moves = [
34662
34783
  { from: legacy.authJson(), to: auditSessionFile() },
@@ -34678,7 +34799,7 @@ function migrateToLayout4() {
34678
34799
  rmSync12(from, { force: true });
34679
34800
  continue;
34680
34801
  }
34681
- mkdirSync18(dirname20(to), { recursive: true });
34802
+ mkdirSync18(dirname21(to), { recursive: true });
34682
34803
  try {
34683
34804
  renameSync12(from, to);
34684
34805
  } catch {
@@ -35115,7 +35236,7 @@ var init_install_telemetry = () => {};
35115
35236
 
35116
35237
  // lib/install-check.ts
35117
35238
  import { existsSync as existsSync34, readFileSync as readFileSync30, writeFileSync as writeFileSync17, mkdirSync as mkdirSync20 } from "node:fs";
35118
- import { dirname as dirname21, resolve as resolve29 } from "node:path";
35239
+ import { dirname as dirname22, resolve as resolve29 } from "node:path";
35119
35240
  import { platform as platform2, arch as arch2, release, homedir as homedir29, hostname as hostname2 } from "node:os";
35120
35241
  import { createHmac as createHmac2 } from "node:crypto";
35121
35242
  function hashToId4(raw) {
@@ -35249,7 +35370,7 @@ async function maybeReportInstall(version) {
35249
35370
  enabled_policy_count: hooks.policyCount
35250
35371
  }, { version, timeoutMs: REPORT_TIMEOUT_MS, enabled: telemetryEnabled }));
35251
35372
  try {
35252
- mkdirSync20(dirname21(versionFile), { recursive: true });
35373
+ mkdirSync20(dirname22(versionFile), { recursive: true });
35253
35374
  writeFileSync17(versionFile, version, "utf8");
35254
35375
  } catch {}
35255
35376
  await Promise.all(events.map((p) => p.catch(() => {})));
@@ -36717,7 +36838,7 @@ var init_cloud_introspect = __esm(() => {
36717
36838
 
36718
36839
  // src/hooks/credential-recovery.ts
36719
36840
  import { createHash as createHash11 } from "node:crypto";
36720
- import { existsSync as existsSync40, mkdirSync as mkdirSync22, readdirSync as readdirSync19, renameSync as renameSync13 } from "node:fs";
36841
+ import { existsSync as existsSync40, mkdirSync as mkdirSync22, readdirSync as readdirSync20, renameSync as renameSync13 } from "node:fs";
36721
36842
  import { join as join38 } from "node:path";
36722
36843
  function previousOrgDirectory(id) {
36723
36844
  const safe = id && /^[A-Za-z0-9_-]{1,128}$/.test(id) ? id : id ? createHash11("sha256").update(id).digest("hex") : "unknown";
@@ -36728,7 +36849,7 @@ function recoverCredentialRefusals(sameOrg, oldOrgId) {
36728
36849
  if (!existsSync40(dir))
36729
36850
  return 0;
36730
36851
  let recovered = 0;
36731
- for (const name of readdirSync19(dir)) {
36852
+ for (const name of readdirSync20(dir)) {
36732
36853
  if (!/\.c(401|403)\.jsonl$/.test(name) || name.startsWith("."))
36733
36854
  continue;
36734
36855
  const targetDir = sameOrg ? dir : join38(previousOrgDirectory(oldOrgId), "failed");
@@ -36765,11 +36886,11 @@ import {
36765
36886
  readSync as readSync4,
36766
36887
  renameSync as renameSync14,
36767
36888
  rmSync as rmSync15,
36768
- statSync as statSync29,
36889
+ statSync as statSync30,
36769
36890
  unlinkSync as unlinkSync6,
36770
36891
  writeFileSync as writeFileSync18
36771
36892
  } from "node:fs";
36772
- import { dirname as dirname22 } from "node:path";
36893
+ import { dirname as dirname23 } from "node:path";
36773
36894
  import { randomBytes as randomBytes3 } from "node:crypto";
36774
36895
  function writeCloudJevConfig(cloudBase) {
36775
36896
  const first = writeCloudJevConfigIfAbsent(cloudBase);
@@ -36850,7 +36971,7 @@ function writeCloudJevConfigIfAbsent(cloudBase) {
36850
36971
  return kept(path, cloudBase);
36851
36972
  const body = `${JSON.stringify({ provider: JEV_CLOUD_PROVIDER, baseUrl, mode: CLOUD_JEV_INITIAL_MODE }, null, 2)}
36852
36973
  `;
36853
- const dir = dirname22(path);
36974
+ const dir = dirname23(path);
36854
36975
  const tmp = `${path}.${process.pid}.${randomBytes3(6).toString("hex")}.tmp`;
36855
36976
  try {
36856
36977
  if (!existsSync41(dir))
@@ -36915,7 +37036,7 @@ function tightenDir(dir) {
36915
37036
  if (process.platform === "win32")
36916
37037
  return;
36917
37038
  try {
36918
- const before = statSync29(dir).mode & 511;
37039
+ const before = statSync30(dir).mode & 511;
36919
37040
  if ((before & 18) !== 0)
36920
37041
  chmodSync9(dir, before & ~18);
36921
37042
  } catch {}
@@ -37338,8 +37459,8 @@ var init_cloud_connection = __esm(() => {
37338
37459
  });
37339
37460
 
37340
37461
  // src/hooks/setup-state.ts
37341
- import { existsSync as existsSync42, realpathSync as realpathSync4, statSync as statSync30 } from "node:fs";
37342
- import { dirname as dirname23, resolve as resolve32 } from "node:path";
37462
+ import { existsSync as existsSync42, realpathSync as realpathSync4, statSync as statSync31 } from "node:fs";
37463
+ import { dirname as dirname24, resolve as resolve32 } from "node:path";
37343
37464
  import { homedir as homedir31 } from "node:os";
37344
37465
  function globalConfigPath(home = homedir31()) {
37345
37466
  return globalPolicyConfigFile(home);
@@ -37352,7 +37473,7 @@ function legacyMarkerPath(home) {
37352
37473
  }
37353
37474
  function isDir(path) {
37354
37475
  try {
37355
- return statSync30(path).isDirectory();
37476
+ return statSync31(path).isDirectory();
37356
37477
  } catch {
37357
37478
  return false;
37358
37479
  }
@@ -37363,7 +37484,7 @@ function findProjectRoot2(start, home = homedir31()) {
37363
37484
  while (dir !== resolvedHome) {
37364
37485
  if (isDir(resolve32(dir, ".failproofai")))
37365
37486
  return dir;
37366
- const parent = dirname23(dir);
37487
+ const parent = dirname24(dir);
37367
37488
  if (parent === dir)
37368
37489
  break;
37369
37490
  dir = parent;
@@ -37413,7 +37534,7 @@ var init_setup_state = __esm(() => {
37413
37534
 
37414
37535
  // src/hooks/onboarding-attempt.ts
37415
37536
  import { existsSync as existsSync43, mkdirSync as mkdirSync24, readFileSync as readFileSync34, rmSync as rmSync17, writeFileSync as writeFileSync19 } from "node:fs";
37416
- import { dirname as dirname24 } from "node:path";
37537
+ import { dirname as dirname25 } from "node:path";
37417
37538
  function readOnboardingAttempt() {
37418
37539
  const path = onboardingAttemptFile();
37419
37540
  if (!existsSync43(path))
@@ -37438,7 +37559,7 @@ function readOnboardingAttempt() {
37438
37559
  function recordOnboardingAttempt(reason, cliVersion, daemonStatus, now = Date.now()) {
37439
37560
  try {
37440
37561
  const path = onboardingAttemptFile();
37441
- mkdirSync24(dirname24(path), { recursive: true });
37562
+ mkdirSync24(dirname25(path), { recursive: true });
37442
37563
  const record = {
37443
37564
  schemaVersion: SCHEMA_VERSION3,
37444
37565
  reason,
@@ -37546,7 +37667,7 @@ var init_onboarding_lock = __esm(() => {
37546
37667
  });
37547
37668
 
37548
37669
  // lib/claude-sessions.ts
37549
- import { readdirSync as readdirSync20, statSync as statSync31, existsSync as existsSync44 } from "node:fs";
37670
+ import { readdirSync as readdirSync21, statSync as statSync32, existsSync as existsSync44 } from "node:fs";
37550
37671
  import { join as join39, basename as basename9 } from "node:path";
37551
37672
  function getClaudeProjectsRoot() {
37552
37673
  return getClaudeProjectsPath();
@@ -37555,7 +37676,7 @@ function listClaudeProjects() {
37555
37676
  const root = getClaudeProjectsRoot();
37556
37677
  let entries;
37557
37678
  try {
37558
- entries = readdirSync20(root, { withFileTypes: true });
37679
+ entries = readdirSync21(root, { withFileTypes: true });
37559
37680
  } catch {
37560
37681
  return [];
37561
37682
  }
@@ -37569,7 +37690,7 @@ function listClaudeTranscripts(project) {
37569
37690
  const out = [];
37570
37691
  let entries;
37571
37692
  try {
37572
- entries = readdirSync20(project.path, { withFileTypes: true });
37693
+ entries = readdirSync21(project.path, { withFileTypes: true });
37573
37694
  } catch {
37574
37695
  return out;
37575
37696
  }
@@ -37580,7 +37701,7 @@ function listClaudeTranscripts(project) {
37580
37701
  continue;
37581
37702
  const transcriptPath = join39(project.path, entry.name);
37582
37703
  try {
37583
- const s = statSync31(transcriptPath);
37704
+ const s = statSync32(transcriptPath);
37584
37705
  out.push({
37585
37706
  projectName: project.name,
37586
37707
  cwd: project.cwd,
@@ -37597,7 +37718,7 @@ function listClaudeTranscripts(project) {
37597
37718
  continue;
37598
37719
  let subEntries;
37599
37720
  try {
37600
- subEntries = readdirSync20(subDir, { withFileTypes: true });
37721
+ subEntries = readdirSync21(subDir, { withFileTypes: true });
37601
37722
  } catch {
37602
37723
  continue;
37603
37724
  }
@@ -37607,7 +37728,7 @@ function listClaudeTranscripts(project) {
37607
37728
  const agentId = sub.name.slice(0, -".jsonl".length);
37608
37729
  const transcriptPath = join39(subDir, sub.name);
37609
37730
  try {
37610
- const s = statSync31(transcriptPath);
37731
+ const s = statSync32(transcriptPath);
37611
37732
  out.push({
37612
37733
  projectName: project.name,
37613
37734
  cwd: project.cwd,
@@ -37823,7 +37944,7 @@ var init_claude = __esm(() => {
37823
37944
  });
37824
37945
 
37825
37946
  // src/audit/cli-adapters/codex.ts
37826
- import { statSync as statSync32 } from "node:fs";
37947
+ import { statSync as statSync33 } from "node:fs";
37827
37948
  async function listCodexTranscriptMetadata(opts = {}) {
37828
37949
  const projectFilter = opts.projects ? new Set(opts.projects) : null;
37829
37950
  const sinceMs = opts.sinceMs ?? 0;
@@ -37840,7 +37961,7 @@ async function listCodexTranscriptMetadata(opts = {}) {
37840
37961
  continue;
37841
37962
  let sizeBytes = 0;
37842
37963
  try {
37843
- sizeBytes = statSync32(s.path).size;
37964
+ sizeBytes = statSync33(s.path).size;
37844
37965
  } catch {}
37845
37966
  if (!s.sessionId)
37846
37967
  continue;
@@ -37874,7 +37995,7 @@ var init_codex = __esm(() => {
37874
37995
  });
37875
37996
 
37876
37997
  // src/audit/cli-adapters/copilot.ts
37877
- import { statSync as statSync33 } from "node:fs";
37998
+ import { statSync as statSync34 } from "node:fs";
37878
37999
  async function listCopilotTranscriptMetadata(opts = {}) {
37879
38000
  const projectFilter = opts.projects ? new Set(opts.projects) : null;
37880
38001
  const sinceMs = opts.sinceMs ?? 0;
@@ -37891,7 +38012,7 @@ async function listCopilotTranscriptMetadata(opts = {}) {
37891
38012
  continue;
37892
38013
  let sizeBytes = 0;
37893
38014
  try {
37894
- sizeBytes = statSync33(s.path).size;
38015
+ sizeBytes = statSync34(s.path).size;
37895
38016
  } catch {}
37896
38017
  if (!s.sessionId)
37897
38018
  continue;
@@ -37925,7 +38046,7 @@ var init_copilot = __esm(() => {
37925
38046
  });
37926
38047
 
37927
38048
  // src/audit/cli-adapters/cursor.ts
37928
- import { statSync as statSync34 } from "node:fs";
38049
+ import { statSync as statSync35 } from "node:fs";
37929
38050
  async function listCursorTranscriptMetadata(opts = {}) {
37930
38051
  const projectFilter = opts.projects ? new Set(opts.projects) : null;
37931
38052
  const sinceMs = opts.sinceMs ?? 0;
@@ -37942,7 +38063,7 @@ async function listCursorTranscriptMetadata(opts = {}) {
37942
38063
  continue;
37943
38064
  let sizeBytes = 0;
37944
38065
  try {
37945
- sizeBytes = statSync34(s.path).size;
38066
+ sizeBytes = statSync35(s.path).size;
37946
38067
  } catch {}
37947
38068
  if (!s.sessionId)
37948
38069
  continue;
@@ -38183,7 +38304,7 @@ var init_opencode = __esm(() => {
38183
38304
  });
38184
38305
 
38185
38306
  // src/audit/cli-adapters/pi.ts
38186
- import { statSync as statSync35 } from "node:fs";
38307
+ import { statSync as statSync36 } from "node:fs";
38187
38308
  async function listPiTranscriptMetadata(opts = {}) {
38188
38309
  const projectFilter = opts.projects ? new Set(opts.projects) : null;
38189
38310
  const sinceMs = opts.sinceMs ?? 0;
@@ -38200,7 +38321,7 @@ async function listPiTranscriptMetadata(opts = {}) {
38200
38321
  continue;
38201
38322
  let sizeBytes = 0;
38202
38323
  try {
38203
- sizeBytes = statSync35(s.path).size;
38324
+ sizeBytes = statSync36(s.path).size;
38204
38325
  } catch {}
38205
38326
  if (!s.sessionId)
38206
38327
  continue;
@@ -39859,7 +39980,7 @@ var init_api_server_client = __esm(() => {
39859
39980
  });
39860
39981
 
39861
39982
  // lib/auth/auth-store.ts
39862
- import { existsSync as existsSync47, readFileSync as readFileSync39, readdirSync as readdirSync21, rmSync as rmSync19 } from "node:fs";
39983
+ import { existsSync as existsSync47, readFileSync as readFileSync39, readdirSync as readdirSync22, rmSync as rmSync19 } from "node:fs";
39863
39984
  import { join as join41, resolve as resolve33 } from "node:path";
39864
39985
  function getAuthFilePath() {
39865
39986
  const override = process.env.FAILPROOFAI_AUTH_DIR;
@@ -39900,7 +40021,7 @@ function deleteAuth() {
39900
40021
  const root = migrationsDir();
39901
40022
  if (!existsSync47(root))
39902
40023
  return;
39903
- for (const entry of readdirSync21(root)) {
40024
+ for (const entry of readdirSync22(root)) {
39904
40025
  if (!entry.startsWith("backup-layout"))
39905
40026
  continue;
39906
40027
  const copy = resolve33(root, entry, "auth.json");
@@ -40495,7 +40616,7 @@ var init_cli = __esm(() => {
40495
40616
  // src/hooks/configure-wizard.ts
40496
40617
  import { existsSync as existsSync49, mkdirSync as mkdirSync28, writeFileSync as writeFileSync23, readFileSync as readFileSync41 } from "node:fs";
40497
40618
  import { homedir as homedir34 } from "node:os";
40498
- import { dirname as dirname25, resolve as resolve34, sep as sep5 } from "node:path";
40619
+ import { dirname as dirname26, resolve as resolve34, sep as sep5 } from "node:path";
40499
40620
  async function emit(event, props) {
40500
40621
  try {
40501
40622
  await trackHookEvent2(getInstanceId2(), event, props);
@@ -40684,7 +40805,7 @@ function firstRunMarkerPath() {
40684
40805
  }
40685
40806
  function markLauncherSeen() {
40686
40807
  try {
40687
- mkdirSync28(dirname25(firstRunMarkerPath()), { recursive: true });
40808
+ mkdirSync28(dirname26(firstRunMarkerPath()), { recursive: true });
40688
40809
  writeFileSync23(firstRunMarkerPath(), "1", "utf8");
40689
40810
  } catch {}
40690
40811
  }
@@ -41511,8 +41632,8 @@ var init_configure_wizard = __esm(() => {
41511
41632
  });
41512
41633
 
41513
41634
  // src/hooks/flush-cli.ts
41514
- import { existsSync as existsSync50, mkdirSync as mkdirSync29, writeFileSync as writeFileSync24, readdirSync as readdirSync22, statSync as statSync36 } from "node:fs";
41515
- import { dirname as dirname26, join as join42 } from "node:path";
41635
+ import { existsSync as existsSync50, mkdirSync as mkdirSync29, writeFileSync as writeFileSync24, readdirSync as readdirSync23, statSync as statSync37 } from "node:fs";
41636
+ import { dirname as dirname27, join as join42 } from "node:path";
41516
41637
  function flushRequestPath2(home) {
41517
41638
  return join42(failproofaiHome(home), "state", "flush-request.json");
41518
41639
  }
@@ -41522,14 +41643,14 @@ function spoolDirs2(home) {
41522
41643
  if (!existsSync50(root))
41523
41644
  return dirs;
41524
41645
  try {
41525
- return dirs.concat(readdirSync22(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== "failed").map((e) => join42(root, e.name)));
41646
+ return dirs.concat(readdirSync23(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== "failed").map((e) => join42(root, e.name)));
41526
41647
  } catch {
41527
41648
  return dirs;
41528
41649
  }
41529
41650
  }
41530
41651
  function parkedBatches2(home) {
41531
41652
  try {
41532
- return readdirSync22(failedDir(home)).filter((f) => f.endsWith(".jsonl")).length;
41653
+ return readdirSync23(failedDir(home)).filter((f) => f.endsWith(".jsonl")).length;
41533
41654
  } catch {
41534
41655
  return 0;
41535
41656
  }
@@ -41546,14 +41667,14 @@ function spoolBacklog2(home, now = Date.now()) {
41546
41667
  for (const dir of spoolDirs2(home)) {
41547
41668
  let names;
41548
41669
  try {
41549
- names = readdirSync22(dir).filter((f) => f.endsWith(".jsonl"));
41670
+ names = readdirSync23(dir).filter((f) => f.endsWith(".jsonl"));
41550
41671
  } catch {
41551
41672
  continue;
41552
41673
  }
41553
41674
  count += names.length;
41554
41675
  for (const name of names) {
41555
41676
  try {
41556
- const mtime = statSync36(join42(dir, name)).mtimeMs;
41677
+ const mtime = statSync37(join42(dir, name)).mtimeMs;
41557
41678
  if (oldest === undefined || mtime < oldest)
41558
41679
  oldest = mtime;
41559
41680
  } catch {}
@@ -41615,7 +41736,7 @@ async function runFlushCommand2(opts = {}) {
41615
41736
  return { exitCode: 0, pending: 0, lines: nothing };
41616
41737
  }
41617
41738
  const path = flushRequestPath2(home);
41618
- mkdirSync29(dirname26(path), { recursive: true });
41739
+ mkdirSync29(dirname27(path), { recursive: true });
41619
41740
  writeFileSync24(path, `${JSON.stringify({ requestedAtMs: Date.now() }, null, 2)}
41620
41741
  `, {
41621
41742
  mode: 384
@@ -44144,7 +44265,7 @@ var init_main = __esm(() => {
44144
44265
  // src/hooks/otel-writers.ts
44145
44266
  import { homedir as homedir35 } from "node:os";
44146
44267
  import { resolve as resolve35 } from "node:path";
44147
- import { accessSync as accessSync2, constants, readdirSync as readdirSync23, statSync as statSync37 } from "node:fs";
44268
+ import { accessSync as accessSync2, constants, readdirSync as readdirSync24, statSync as statSync38 } from "node:fs";
44148
44269
  function vscodeSettingsPath(home = homedir35(), platform = process.platform) {
44149
44270
  if (platform === "darwin")
44150
44271
  return resolve35(home, "Library/Application Support/Code/User/settings.json");
@@ -44159,7 +44280,7 @@ function vscodeInstalled(home = homedir35(), platform = process.platform) {
44159
44280
  const executable = (path) => {
44160
44281
  try {
44161
44282
  accessSync2(path, platform === "win32" ? constants.F_OK : constants.X_OK);
44162
- return statSync37(path).isFile();
44283
+ return statSync38(path).isFile();
44163
44284
  } catch {
44164
44285
  return false;
44165
44286
  }
@@ -44171,7 +44292,7 @@ function vscodeInstalled(home = homedir35(), platform = process.platform) {
44171
44292
  return true;
44172
44293
  return [".vscode", ".vscode-insiders"].some((folder) => {
44173
44294
  try {
44174
- return readdirSync23(resolve35(home, folder, "extensions"), { withFileTypes: true }).some((entry) => entry.isDirectory() && /^github\.copilot(?:-chat)?-\d/i.test(entry.name));
44295
+ return readdirSync24(resolve35(home, folder, "extensions"), { withFileTypes: true }).some((entry) => entry.isDirectory() && /^github\.copilot(?:-chat)?-\d/i.test(entry.name));
44175
44296
  } catch {
44176
44297
  return false;
44177
44298
  }
@@ -44394,11 +44515,11 @@ import {
44394
44515
  existsSync as existsSync52,
44395
44516
  mkdirSync as mkdirSync30,
44396
44517
  readFileSync as readFileSync42,
44397
- statSync as statSync38,
44518
+ statSync as statSync39,
44398
44519
  unlinkSync as unlinkSync8,
44399
44520
  writeFileSync as writeFileSync25
44400
44521
  } from "node:fs";
44401
- import { dirname as dirname27 } from "node:path";
44522
+ import { dirname as dirname28 } from "node:path";
44402
44523
  import { createHash as createHash13, randomUUID as randomUUID6 } from "node:crypto";
44403
44524
  import { homedir as homedir36 } from "node:os";
44404
44525
  import { connect } from "node:net";
@@ -44458,13 +44579,13 @@ function credential() {
44458
44579
  function backupOnce(path, original) {
44459
44580
  if (existsSync52(`${path}.failproofai-bak`))
44460
44581
  return;
44461
- mkdirSync30(dirname27(path), { recursive: true });
44582
+ mkdirSync30(dirname28(path), { recursive: true });
44462
44583
  writeFileSync25(`${path}.failproofai-bak`, original ?? "", { flag: "wx", mode: 384 });
44463
44584
  chmodSync11(`${path}.failproofai-bak`, 384);
44464
44585
  }
44465
44586
  function savePrivate(agent, state) {
44466
44587
  const path = otelAgentStateFile(agent);
44467
- mkdirSync30(dirname27(path), { recursive: true, mode: 448 });
44588
+ mkdirSync30(dirname28(path), { recursive: true, mode: 448 });
44468
44589
  writeConfigFileAtomic(path, JSON.stringify(state), { backup: false, mode: 384 });
44469
44590
  chmodSync11(path, 384);
44470
44591
  }
@@ -44569,7 +44690,7 @@ async function enableAgent(agent, yes, localFlag, content, options) {
44569
44690
  const next = editAgentConfig(original ?? "", agent, [...released, ...writes]);
44570
44691
  const state = oldState ?? {
44571
44692
  original,
44572
- originalMode: original === null ? undefined : statSync38(file).mode & 511,
44693
+ originalMode: original === null ? undefined : statSync39(file).mode & 511,
44573
44694
  writtenHash: "",
44574
44695
  previous: writes.map((w) => ({ path: w.path, value: getSetting(parsed, w.path) }))
44575
44696
  };
@@ -45247,8 +45368,8 @@ var init_jev_stats = __esm(() => {
45247
45368
  });
45248
45369
 
45249
45370
  // src/hooks/jev-cli.ts
45250
- import { chmodSync as chmodSync12, existsSync as existsSync53, statSync as statSync39, unlinkSync as unlinkSync9 } from "node:fs";
45251
- import { dirname as dirname28 } from "node:path";
45371
+ import { chmodSync as chmodSync12, existsSync as existsSync53, statSync as statSync40, unlinkSync as unlinkSync9 } from "node:fs";
45372
+ import { dirname as dirname29 } from "node:path";
45252
45373
  function jevHeader(name, meta, opts) {
45253
45374
  return [screenKit(opts).header(meta ? `${name} · ${meta}` : name)];
45254
45375
  }
@@ -45829,13 +45950,13 @@ async function setupRun(argv, deps, opts) {
45829
45950
  }
45830
45951
  let fileMode = null;
45831
45952
  try {
45832
- fileMode = statSync39(path).mode & 511;
45953
+ fileMode = statSync40(path).mode & 511;
45833
45954
  } catch {}
45834
- const dir = dirname28(path);
45955
+ const dir = dirname29(path);
45835
45956
  let tightenedDir = null;
45836
45957
  if (process.platform !== "win32") {
45837
45958
  try {
45838
- const before = statSync39(dir).mode & 511;
45959
+ const before = statSync40(dir).mode & 511;
45839
45960
  if ((before & 18) !== 0) {
45840
45961
  const after = before & -19;
45841
45962
  chmodSync12(dir, after);
@@ -45957,15 +46078,15 @@ async function cloudSetup(values, bools, opts) {
45957
46078
  }
45958
46079
  if (process.platform !== "win32") {
45959
46080
  try {
45960
- const dir = dirname28(path);
45961
- const before = statSync39(dir).mode & 511;
46081
+ const dir = dirname29(path);
46082
+ const before = statSync40(dir).mode & 511;
45962
46083
  if ((before & 18) !== 0)
45963
46084
  chmodSync12(dir, before & -19);
45964
46085
  } catch {}
45965
46086
  }
45966
46087
  let fileMode = null;
45967
46088
  try {
45968
- fileMode = statSync39(path).mode & 511;
46089
+ fileMode = statSync40(path).mode & 511;
45969
46090
  } catch {}
45970
46091
  const cfg = checked.value;
45971
46092
  const route = jevRoute(cfg);
@@ -46594,7 +46715,7 @@ import {
46594
46715
  openSync as openSync8,
46595
46716
  readFileSync as readFileSync43,
46596
46717
  readSync as readSync6,
46597
- statSync as statSync40,
46718
+ statSync as statSync41,
46598
46719
  writeFileSync as writeFileSync26
46599
46720
  } from "node:fs";
46600
46721
  function detectLayout2() {
@@ -46678,7 +46799,7 @@ import {
46678
46799
  rmSync as rmSync21,
46679
46800
  writeFileSync as writeFileSync27
46680
46801
  } from "node:fs";
46681
- import { basename as basename10, dirname as dirname29, join as join43, resolve as resolve38 } from "node:path";
46802
+ import { basename as basename10, dirname as dirname30, join as join43, resolve as resolve38 } from "node:path";
46682
46803
  function migrateToLayout42() {
46683
46804
  const moves = [
46684
46805
  { from: legacy.authJson(), to: auditSessionFile() },
@@ -46700,7 +46821,7 @@ function migrateToLayout42() {
46700
46821
  rmSync21(from, { force: true });
46701
46822
  continue;
46702
46823
  }
46703
- mkdirSync32(dirname29(to), { recursive: true });
46824
+ mkdirSync32(dirname30(to), { recursive: true });
46704
46825
  try {
46705
46826
  renameSync15(from, to);
46706
46827
  } catch {
@@ -46939,12 +47060,14 @@ import {
46939
47060
  mkdirSync as mkdirSync33,
46940
47061
  mkdtempSync as mkdtempSync2,
46941
47062
  readFileSync as readFileSync45,
47063
+ readdirSync as readdirSync25,
47064
+ statSync as statSync42,
46942
47065
  writeFileSync as writeFileSync28,
46943
47066
  unlinkSync as unlinkSync10,
46944
47067
  rmSync as rmSync22
46945
47068
  } from "node:fs";
46946
47069
  import { homedir as homedir38, tmpdir as tmpdir3, userInfo as userInfo2 } from "node:os";
46947
- import { resolve as resolve39 } from "node:path";
47070
+ import { dirname as dirname31, resolve as resolve39 } from "node:path";
46948
47071
  import { execFileSync as execFileSync3 } from "node:child_process";
46949
47072
  function isDaemonSupportedPlatform2() {
46950
47073
  return process.platform === "linux" || process.platform === "darwin";
@@ -46999,7 +47122,7 @@ function resolveWorkerCommand2() {
46999
47122
  const workerScript = resolve39(packageRoot, "dist", "worker.mjs");
47000
47123
  if (!existsSync56(workerScript))
47001
47124
  return null;
47002
- return `${shellQuote2(process.execPath)} ${shellQuote2(workerScript)}`;
47125
+ return `${shellQuote(process.execPath)} ${shellQuote(workerScript)}`;
47003
47126
  }
47004
47127
  function resolveCliCommand2() {
47005
47128
  if (process.env.FAILPROOFAI_CLI_CMD)
@@ -47010,10 +47133,7 @@ function resolveCliCommand2() {
47010
47133
  const cliScript = resolve39(packageRoot, "dist", "cli.mjs");
47011
47134
  if (!existsSync56(cliScript))
47012
47135
  return null;
47013
- return `${shellQuote2(process.execPath)} ${shellQuote2(cliScript)}`;
47014
- }
47015
- function shellQuote2(value) {
47016
- return `'${value.replace(/'/g, `'\\''`)}'`;
47136
+ return `${shellQuote(process.execPath)} ${shellQuote(cliScript)}`;
47017
47137
  }
47018
47138
  function workerScriptPath2() {
47019
47139
  if (process.env.FAILPROOFAI_WORKER_CMD)
@@ -47050,6 +47170,60 @@ function systemdUnitDir2() {
47050
47170
  function systemdUnitPath2(user = serviceUser2()) {
47051
47171
  return resolve39(systemdUnitDir2(), systemdUnitName2(user));
47052
47172
  }
47173
+ function systemBinaryRoot2(user = serviceUser2()) {
47174
+ return resolve39(process.env.FAILPROOFAI_SYSTEM_BIN_DIR || "/opt/failproofai", user);
47175
+ }
47176
+ function systemBinaryDir2() {
47177
+ return resolve39(systemBinaryRoot2(), "bin");
47178
+ }
47179
+ function systemBinaryTarget2(binaryPath) {
47180
+ if (process.platform !== "linux" || process.env.FAILPROOFAI_DAEMON_BINARY)
47181
+ return null;
47182
+ try {
47183
+ if (!statSync42(binaryPath).isFile())
47184
+ return null;
47185
+ } catch {
47186
+ return null;
47187
+ }
47188
+ return resolve39(systemBinaryDir2(), `failproofaid-${version2}`);
47189
+ }
47190
+ function selinuxEnabled2() {
47191
+ return existsSync56("/sys/fs/selinux/enforce");
47192
+ }
47193
+ function stageSystemBinary2(binaryPath) {
47194
+ const target = systemBinaryTarget2(binaryPath);
47195
+ if (!target)
47196
+ return binaryPath;
47197
+ const dir = systemBinaryDir2();
47198
+ const staging = `${target}.${process.pid}.tmp`;
47199
+ runPrivileged2("install", ["-d", "-m", "0755", dir]);
47200
+ try {
47201
+ runPrivileged2("install", ["-m", "0755", binaryPath, staging]);
47202
+ runPrivileged2("mv", ["-f", staging, target]);
47203
+ } catch (err) {
47204
+ try {
47205
+ runPrivileged2("rm", ["-f", staging]);
47206
+ } catch {}
47207
+ throw err;
47208
+ }
47209
+ if (selinuxEnabled2()) {
47210
+ const root = systemBinaryRoot2();
47211
+ try {
47212
+ runPrivileged2("restorecon", ["-R", root]);
47213
+ } catch (err) {
47214
+ hookLogWarn(`restorecon on ${root} failed: ${err instanceof Error ? err.message : String(err)}`);
47215
+ }
47216
+ }
47217
+ return target;
47218
+ }
47219
+ function pruneSystemBinaries2(current) {
47220
+ try {
47221
+ const dir = systemBinaryDir2();
47222
+ const stale = readdirSync25(dir).filter((f) => f.startsWith("failproofaid-")).map((f) => resolve39(dir, f)).filter((p) => p !== current).map((p) => ({ p, mtime: statSync42(p).mtimeMs })).sort((a, b) => b.mtime - a.mtime).slice(1);
47223
+ for (const { p } of stale)
47224
+ runPrivileged2("rm", ["-f", p]);
47225
+ } catch {}
47226
+ }
47053
47227
  function legacySystemdUserUnitPath2() {
47054
47228
  return resolve39(homedir38(), ".config", "systemd", "user", "failproofaid.service");
47055
47229
  }
@@ -47222,9 +47396,17 @@ ${envBlock} <key>StandardOutPath</key>
47222
47396
  }
47223
47397
  function daemonInstallCommands2(binaryPath, workerCmd, cliCmd) {
47224
47398
  if (process.platform === "linux") {
47399
+ const target = systemBinaryTarget2(binaryPath);
47400
+ const dir = systemBinaryDir2();
47401
+ const stage = target ? [
47402
+ `sudo install -d -m 0755 ${shellQuote(dir)}`,
47403
+ `sudo install -m 0755 ${shellQuote(binaryPath)} ${shellQuote(target)}`,
47404
+ `{ sudo restorecon -R ${shellQuote(systemBinaryRoot2())} 2>/dev/null || true; }`
47405
+ ] : [];
47225
47406
  return [
47407
+ ...stage,
47226
47408
  `sudo tee ${systemdUnitPath2()} <<'EOF'
47227
- ${systemdUnitContents2(binaryPath, workerCmd, cliCmd)}EOF`,
47409
+ ${systemdUnitContents2(target ?? binaryPath, workerCmd, cliCmd)}EOF`,
47228
47410
  "sudo systemctl daemon-reload",
47229
47411
  `sudo systemctl enable ${systemdUnitName2()}`,
47230
47412
  `sudo systemctl restart ${systemdUnitName2()}`
@@ -47252,9 +47434,11 @@ async function installDaemonService2() {
47252
47434
  };
47253
47435
  }
47254
47436
  removeLegacyUserService2();
47437
+ let execPath = binaryPath;
47255
47438
  try {
47256
47439
  if (process.platform === "linux") {
47257
- writePrivilegedFile2(systemdUnitPath2(), systemdUnitContents2(binaryPath, workerCmd, cliCmd));
47440
+ execPath = stageSystemBinary2(binaryPath);
47441
+ writePrivilegedFile2(systemdUnitPath2(), systemdUnitContents2(execPath, workerCmd, cliCmd));
47258
47442
  runPrivileged2("systemctl", ["daemon-reload"]);
47259
47443
  runPrivileged2("systemctl", ["enable", systemdUnitName2()]);
47260
47444
  restartSystemdUnit2();
@@ -47278,6 +47462,8 @@ async function installDaemonService2() {
47278
47462
  hookLogWarn(`daemon service install failed: ${reason}`);
47279
47463
  return { installed: false, reason };
47280
47464
  }
47465
+ if (execPath !== binaryPath)
47466
+ pruneSystemBinaries2(execPath);
47281
47467
  return { installed: true };
47282
47468
  }
47283
47469
  async function probeDaemon2() {
@@ -47515,12 +47701,14 @@ function survey(cwd) {
47515
47701
  daemonConfigured = readConfig().daemon.configured;
47516
47702
  } catch {}
47517
47703
  const servicePath = isDaemonSupportedPlatform() ? daemonServiceFilePath() : null;
47704
+ const stagedBinaryDir = isDaemonSupportedPlatform() ? daemonSystemBinaryDir() : null;
47518
47705
  return {
47519
47706
  clis,
47520
47707
  skillDirs: installedAgentSkillDirs(),
47521
47708
  codexSystemPath: codexSystemHooksPresent() ? codexSystemConfigPath() : null,
47522
47709
  servicePath,
47523
47710
  serviceInstalled: !!servicePath && existsSync57(servicePath),
47711
+ stagedBinaryDir: stagedBinaryDir && existsSync57(stagedBinaryDir) ? stagedBinaryDir : null,
47524
47712
  daemonConfigured,
47525
47713
  homeExists: existsSync57(failproofaiHome())
47526
47714
  };
@@ -47532,7 +47720,7 @@ async function runUninstallCommand(opts = {}) {
47532
47720
  const many = (n, one) => `${n} ${one}${n === 1 ? "" : "s"}`;
47533
47721
  const errText = (err) => err instanceof Error ? err.message : String(err);
47534
47722
  const lines = [];
47535
- const nothingToDo = found.clis.length === 0 && found.skillDirs.length === 0 && !found.serviceInstalled && !found.daemonConfigured && !(opts.purge && found.homeExists);
47723
+ const nothingToDo = found.clis.length === 0 && found.skillDirs.length === 0 && !found.serviceInstalled && !found.stagedBinaryDir && !found.daemonConfigured && !(opts.purge && found.homeExists);
47536
47724
  if (nothingToDo) {
47537
47725
  return {
47538
47726
  exitCode: 0,
@@ -47550,6 +47738,8 @@ ${home} still holds settings and history. Delete it with \`failproofai uninstal
47550
47738
  removals.push(`the failproofai skill from ${many(found.skillDirs.length, "agent folder")}`);
47551
47739
  if (found.serviceInstalled)
47552
47740
  removals.push("the failproofaid service (needs sudo)");
47741
+ else if (found.stagedBinaryDir)
47742
+ removals.push(`the failproofaid binary in ${found.stagedBinaryDir} (needs sudo)`);
47553
47743
  if (purging)
47554
47744
  removals.push(home);
47555
47745
  const releasesDaemon = found.daemonConfigured && !found.serviceInstalled;
@@ -47643,7 +47833,7 @@ ${home} still holds settings and history. Delete it with \`failproofai uninstal
47643
47833
  ${installedAgentSkillDirs().join(`
47644
47834
  `)}`);
47645
47835
  }
47646
- if (found.serviceInstalled) {
47836
+ if (found.serviceInstalled || found.stagedBinaryDir) {
47647
47837
  elevateOnce();
47648
47838
  const byHand = (servicePath) => `
47649
47839
  Remove it as root:
@@ -47654,8 +47844,14 @@ Check it with \`${daemonStatusCommand()}\`` : "");
47654
47844
  await uninstallDaemonService();
47655
47845
  if (found.servicePath && existsSync57(found.servicePath)) {
47656
47846
  failures.push("The failproofaid service is still there, most often because sudo was not available." + byHand(found.servicePath));
47657
- } else {
47847
+ } else if (found.stagedBinaryDir && existsSync57(found.stagedBinaryDir)) {
47848
+ failures.push(`The failproofaid binary in ${found.stagedBinaryDir} is still there, most often because sudo was not available.` + `
47849
+ Remove it as root:
47850
+ \`sudo rm -rf ${shellQuote(found.stagedBinaryDir)}\``);
47851
+ } else if (found.serviceInstalled) {
47658
47852
  lines.push(kit.ok("Stopped and removed the failproofaid service."));
47853
+ } else {
47854
+ lines.push(kit.ok(`Removed the failproofaid binary from ${found.stagedBinaryDir}.`));
47659
47855
  }
47660
47856
  } catch (err) {
47661
47857
  failures.push(`Could not remove the failproofaid service: ${errText(err)}` + (found.servicePath && existsSync57(found.servicePath) ? byHand(found.servicePath) : ""));
@@ -47683,13 +47879,15 @@ ${home} was kept. Delete it with \`failproofai uninstall --purge\`` : "")));
47683
47879
  }
47684
47880
  function manualServiceRemoval(servicePath) {
47685
47881
  if (process.platform === "darwin") {
47686
- return [`sudo launchctl unload -w ${servicePath}`, `sudo rm -f ${servicePath}`];
47882
+ return [`sudo launchctl unload -w ${shellQuote(servicePath)}`, `sudo rm -f ${shellQuote(servicePath)}`];
47687
47883
  }
47688
47884
  const unit = servicePath.split("/").pop() ?? servicePath;
47885
+ const binDir = daemonSystemBinaryDir();
47689
47886
  return [
47690
47887
  `sudo systemctl disable --now ${unit}`,
47691
- `sudo rm -f ${servicePath}`,
47692
- `sudo systemctl daemon-reload`
47888
+ `sudo rm -f ${shellQuote(servicePath)}`,
47889
+ `sudo systemctl daemon-reload`,
47890
+ ...binDir ? [`sudo rm -rf ${shellQuote(binDir)}`] : []
47693
47891
  ];
47694
47892
  }
47695
47893
  var init_uninstall_cli = __esm(() => {
@@ -47707,8 +47905,8 @@ var init_uninstall_cli = __esm(() => {
47707
47905
  import { execFileSync as execFileSync4 } from "node:child_process";
47708
47906
  import { homedir as homedir39, tmpdir as tmpdir4 } from "node:os";
47709
47907
  import { createHash as createHash14 } from "node:crypto";
47710
- import { copyFileSync as copyFileSync5, existsSync as existsSync58, mkdirSync as mkdirSync34, mkdtempSync as mkdtempSync3, readFileSync as readFileSync46, readdirSync as readdirSync24, realpathSync as realpathSync5, rmSync as rmSync24, statSync as statSync41, writeFileSync as writeFileSync29 } from "node:fs";
47711
- import { basename as basename11, dirname as dirname30, isAbsolute as isAbsolute6, join as join44, relative as relative5, resolve as resolve40, sep as sep6 } from "node:path";
47908
+ import { copyFileSync as copyFileSync5, existsSync as existsSync58, mkdirSync as mkdirSync34, mkdtempSync as mkdtempSync3, readFileSync as readFileSync46, readdirSync as readdirSync26, realpathSync as realpathSync5, rmSync as rmSync24, statSync as statSync43, writeFileSync as writeFileSync29 } from "node:fs";
47909
+ import { basename as basename11, dirname as dirname32, isAbsolute as isAbsolute6, join as join44, relative as relative5, resolve as resolve40, sep as sep6 } from "node:path";
47712
47910
  function parseList(rest, ...flags) {
47713
47911
  let found = false;
47714
47912
  const out = [];
@@ -48298,7 +48496,7 @@ function inferTaggedVersion(entryPath, sources) {
48298
48496
  function findEntry(dir) {
48299
48497
  let names;
48300
48498
  try {
48301
- names = readdirSync24(dir);
48499
+ names = readdirSync26(dir);
48302
48500
  } catch {
48303
48501
  return [];
48304
48502
  }
@@ -48308,7 +48506,7 @@ function findEntry(dir) {
48308
48506
  continue;
48309
48507
  const full = resolve40(dir, name);
48310
48508
  try {
48311
- if (statSync41(full).size > 512 * 1024)
48509
+ if (statSync43(full).size > 512 * 1024)
48312
48510
  continue;
48313
48511
  const text = readFileSync46(full, "utf8");
48314
48512
  if (/from\s+["']failproofai["']/.test(text) && /(?:customPolicies|semanticPolicies)\s*\.\s*add\s*\(/.test(text)) {
@@ -48327,7 +48525,7 @@ function withLocalImports(sources) {
48327
48525
  const file = queue.shift();
48328
48526
  let text;
48329
48527
  try {
48330
- if (statSync41(file).size > 512 * 1024)
48528
+ if (statSync43(file).size > 512 * 1024)
48331
48529
  continue;
48332
48530
  text = readFileSync46(file, "utf8");
48333
48531
  } catch {
@@ -48335,13 +48533,13 @@ function withLocalImports(sources) {
48335
48533
  }
48336
48534
  for (const re of LOCAL_IMPORT_RES) {
48337
48535
  for (const match of text.matchAll(re)) {
48338
- const base = resolve40(dirname30(file), match[1]);
48536
+ const base = resolve40(dirname32(file), match[1]);
48339
48537
  for (const ext of LOCAL_IMPORT_EXTENSIONS) {
48340
48538
  const candidate = base + ext;
48341
48539
  if (seen.has(candidate))
48342
48540
  break;
48343
48541
  try {
48344
- if (!statSync41(candidate).isFile())
48542
+ if (!statSync43(candidate).isFile())
48345
48543
  continue;
48346
48544
  } catch {
48347
48545
  continue;
@@ -48588,7 +48786,7 @@ esac
48588
48786
  return true;
48589
48787
  } finally {
48590
48788
  try {
48591
- rmSync24(dirname30(askpass), { recursive: true, force: true });
48789
+ rmSync24(dirname32(askpass), { recursive: true, force: true });
48592
48790
  } catch {}
48593
48791
  }
48594
48792
  }
@@ -51100,14 +51298,14 @@ var init_parse_script_args = () => {};
51100
51298
 
51101
51299
  // scripts/install-diagnosis.mjs
51102
51300
  import { existsSync as existsSync60, readFileSync as readFileSync48, realpathSync as realpathSync6 } from "node:fs";
51103
- import { dirname as dirname31, resolve as resolve43 } from "node:path";
51301
+ import { dirname as dirname33, resolve as resolve43 } from "node:path";
51104
51302
  import { homedir as homedir40, platform as platform5 } from "node:os";
51105
51303
  import { spawnSync } from "node:child_process";
51106
51304
  function findPackageRoot(start) {
51107
51305
  try {
51108
51306
  let dir = realpathSync6(start);
51109
51307
  if (existsSync60(dir) && !existsSync60(resolve43(dir, "package.json"))) {
51110
- dir = dirname31(dir);
51308
+ dir = dirname33(dir);
51111
51309
  }
51112
51310
  while (true) {
51113
51311
  const pkgPath = resolve43(dir, "package.json");
@@ -51118,7 +51316,7 @@ function findPackageRoot(start) {
51118
51316
  return dir;
51119
51317
  } catch {}
51120
51318
  }
51121
- const parent = dirname31(dir);
51319
+ const parent = dirname33(dir);
51122
51320
  if (parent === dir)
51123
51321
  return null;
51124
51322
  dir = parent;
@@ -51649,7 +51847,7 @@ var init_launch_ready = () => {};
51649
51847
  // scripts/launch.ts
51650
51848
  import { spawn as spawn2 } from "child_process";
51651
51849
  import { realpathSync as realpathSync7, existsSync as existsSync61 } from "node:fs";
51652
- import { resolve as resolve44, dirname as dirname32 } from "node:path";
51850
+ import { resolve as resolve44, dirname as dirname34 } from "node:path";
51653
51851
  import { fileURLToPath as fileURLToPath2 } from "node:url";
51654
51852
  function launch(mode, options = {}) {
51655
51853
  const { loggingLevel, disableTelemetry, allowedDevOrigins, host, remainingArgs } = parseScriptArgs(process.argv.slice(2));
@@ -51685,7 +51883,7 @@ ${k.caution(exposedBindWarning(exposed.host))}
51685
51883
  process.env.PORT = port;
51686
51884
  process.env.HOSTNAME = bindHost;
51687
51885
  cmd = "node";
51688
- const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve44(dirname32(realpathSync7(fileURLToPath2(import.meta.url))), "..");
51886
+ const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve44(dirname34(realpathSync7(fileURLToPath2(import.meta.url))), "..");
51689
51887
  const serverJsPath = resolve44(packageRoot, ".next/standalone/server.js");
51690
51888
  if (!existsSync61(serverJsPath)) {
51691
51889
  let shadowMessage = null;
@@ -52914,7 +53112,7 @@ var init_session_pause_cli2 = __esm(() => {
52914
53112
  // scripts/launch.ts
52915
53113
  import { spawn as spawn3 } from "child_process";
52916
53114
  import { realpathSync as realpathSync8, existsSync as existsSync62 } from "node:fs";
52917
- import { resolve as resolve46, dirname as dirname33 } from "node:path";
53115
+ import { resolve as resolve46, dirname as dirname35 } from "node:path";
52918
53116
  import { fileURLToPath as fileURLToPath3 } from "node:url";
52919
53117
  function launch2(mode, options = {}) {
52920
53118
  const { loggingLevel, disableTelemetry, allowedDevOrigins, host, remainingArgs } = parseScriptArgs(process.argv.slice(2));
@@ -52950,7 +53148,7 @@ ${k.caution(exposedBindWarning(exposed.host))}
52950
53148
  process.env.PORT = port;
52951
53149
  process.env.HOSTNAME = bindHost;
52952
53150
  cmd = "node";
52953
- const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve46(dirname33(realpathSync8(fileURLToPath3(import.meta.url))), "..");
53151
+ const packageRoot = process.env.FAILPROOFAI_PACKAGE_ROOT ?? resolve46(dirname35(realpathSync8(fileURLToPath3(import.meta.url))), "..");
52954
53152
  const serverJsPath = resolve46(packageRoot, ".next/standalone/server.js");
52955
53153
  if (!existsSync62(serverJsPath)) {
52956
53154
  let shadowMessage = null;
@@ -53072,17 +53270,17 @@ var init_cli_error2 = __esm(() => {
53072
53270
 
53073
53271
  // bin/failproofai.mjs
53074
53272
  import { realpathSync as realpathSync9 } from "fs";
53075
- import { dirname as dirname34, resolve as resolve47 } from "path";
53273
+ import { dirname as dirname36, resolve as resolve47 } from "path";
53076
53274
  import { fileURLToPath as fileURLToPath4 } from "url";
53077
53275
  // package.json
53078
- var version = "1.0.13-beta.3";
53276
+ var version = "1.0.14";
53079
53277
 
53080
53278
  // bin/failproofai.mjs
53081
53279
  if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
53082
- process.env.FAILPROOFAI_PACKAGE_ROOT = resolve47(dirname34(realpathSync9(fileURLToPath4(import.meta.url))), "..");
53280
+ process.env.FAILPROOFAI_PACKAGE_ROOT = resolve47(dirname36(realpathSync9(fileURLToPath4(import.meta.url))), "..");
53083
53281
  }
53084
53282
  if (!process.env.FAILPROOFAI_DIST_PATH) {
53085
- process.env.FAILPROOFAI_DIST_PATH = resolve47(dirname34(realpathSync9(fileURLToPath4(import.meta.url))), "..", "dist");
53283
+ process.env.FAILPROOFAI_DIST_PATH = resolve47(dirname36(realpathSync9(fileURLToPath4(import.meta.url))), "..", "dist");
53086
53284
  }
53087
53285
  var args = process.argv.slice(2);
53088
53286
  if (args[0] === "p" || args[0] === "policy")