failproofai 0.0.14-beta.0 → 0.0.14-beta.2

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 (219) hide show
  1. package/.next/standalone/.codex/hooks.json +6 -6
  2. package/.next/standalone/.cursor/hooks.json +6 -6
  3. package/.next/standalone/.factory/hooks.json +9 -9
  4. package/.next/standalone/.next/BUILD_ID +1 -1
  5. package/.next/standalone/.next/build-manifest.json +5 -5
  6. package/.next/standalone/.next/prerender-manifest.json +3 -3
  7. package/.next/standalone/.next/required-server-files.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
  9. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  10. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  11. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  14. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  15. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  16. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  17. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  18. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
  20. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  21. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  24. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  25. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  26. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  27. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  28. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  29. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  30. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  31. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  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.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/audit/page/build-manifest.json +2 -2
  40. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  41. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/index.html +1 -1
  44. package/.next/standalone/.next/server/app/index.rsc +15 -15
  45. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  46. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  47. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  48. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  49. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  50. package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
  51. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  52. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
  55. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  56. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
  59. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  60. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
  63. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  64. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  65. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
  68. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  69. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0--lkk6._.js +1 -1
  72. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-219ec._.js +1 -1
  73. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04_h-a5._.js +1 -1
  74. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06cuf1y._.js +1 -1
  75. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08w4wmd._.js +1 -1
  76. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g6bbuw._.js +1 -1
  77. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jnjf2t._.js +1 -1
  78. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q-v9z2._.js +1 -1
  79. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q0qzx1._.js +1 -1
  80. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q2nbsl._.js +1 -1
  81. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rv7m0k._.js +1 -1
  82. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xuaoik._.js +3 -3
  83. package/.next/standalone/.next/server/chunks/[root-of-the-server]__16le-kd._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ffkmds._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fwl2mz._.js +1 -1
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1legmza._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mrihkj._.js +1 -1
  89. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1myjm-d._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qb590j._.js +1 -1
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qxztj-._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1shcqgr._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1xuedea._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +4 -4
  95. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00cz9as._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__015_i4t._.js +2 -2
  100. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__030k0c6._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03lv-pe._.js +2 -2
  102. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__042d3cd._.js +1 -1
  103. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05r_17v._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09q1168._.js +1 -1
  105. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07qfsfa._.js → [root-of-the-server]__09v9cwb._.js} +2 -2
  106. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e2l3c1._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h12me5._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hci7t3._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hdsupo._.js +2 -2
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p84xee._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qeuy9c._.js +2 -2
  112. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s89hoe._.js +2 -2
  113. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0twi4fj._.js +3 -0
  114. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ynf7tx._.js +2 -2
  115. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11rtg6s._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14dd6h8._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__170799-._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__17ai7sy._.js +2 -2
  119. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1dky4g0._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1nq7ivq._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tkjqka._.js +2 -2
  122. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__212nf49._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/ssr/_05whahf._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/_1kje4fm._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/ssr/app_087bt9w._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/app_1fvisnp._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/app_209u41o._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +2 -2
  129. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/lib_0xkhw_v._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0g5r64e.js → node_modules_html-to-image_es_index_06xsmte.js} +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-uvagv.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03c7gi5.js +1 -1
  135. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09p-8om.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0v-kfiu.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0xrgzyz.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1806lsc.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1j6dd-e.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1sa65r-.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1ezd2jf._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1tnuifj._.js +1 -1
  144. package/.next/standalone/.next/server/middleware-build-manifest.js +5 -5
  145. package/.next/standalone/.next/server/pages/404.html +1 -1
  146. package/.next/standalone/.next/server/pages/500.html +1 -1
  147. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/server-reference-manifest.json +10 -10
  149. package/.next/standalone/.next/static/chunks/{13f1kmjea-0md.js → 02jcotghcxrbu.js} +1 -1
  150. package/.next/standalone/.next/static/chunks/{1374x9bv_s_vg.js → 0h-6ymo9v86b0.js} +2 -2
  151. package/.next/standalone/.next/static/chunks/0pndjhcxfu-0t.js +1 -0
  152. package/.next/standalone/.next/static/chunks/1-33f82_l32or.js +1 -0
  153. package/.next/standalone/.next/static/chunks/{003uz088wbmz7.js → 1bg_g3g359c_d.js} +1 -1
  154. package/.next/standalone/.next/static/chunks/{454dyizqik6t9.js → 1gg-8e9q_m__9.js} +2 -2
  155. package/.next/standalone/.next/static/chunks/{2ufuwhv03yvtb.js → 29zkom4s9de2d.js} +1 -1
  156. package/.next/standalone/.next/static/chunks/{17sdztgbcc0fi.js → 2llkdafnaejw_.js} +1 -1
  157. package/.next/standalone/.next/static/chunks/{0iinhn4417nk1.js → 3-ogr79xqbw0h.js} +1 -1
  158. package/.next/standalone/.next/static/chunks/36j05kb2x323i.css +2 -0
  159. package/.next/standalone/.next/static/chunks/{43weu8f59tlix.js → 388hgfqye67xa.js} +1 -1
  160. package/.next/standalone/.next/static/chunks/396764jgd7-9j.js +1 -0
  161. package/.next/standalone/.next/static/chunks/3w7g0n0iwwnbs.js +1 -0
  162. package/.next/standalone/.next/static/chunks/{turbopack-0vavqo2d-tlt3.js → turbopack-10hj8t5pf33tu.js} +1 -1
  163. package/.next/standalone/.opencode/plugins/failproofai.mjs +30 -11
  164. package/.next/standalone/app/audit/_components/how-to-improve-section.tsx +11 -2
  165. package/.next/standalone/app/components/copy-button.tsx +22 -6
  166. package/.next/standalone/app/components/global-error-listeners.tsx +27 -0
  167. package/.next/standalone/components/reach-developers.tsx +1 -1
  168. package/.next/standalone/docker-hook-sync/Dockerfile +8 -4
  169. package/.next/standalone/integration-suite/Dockerfile +47 -0
  170. package/.next/standalone/integration-suite/README.md +87 -0
  171. package/.next/standalone/integration-suite/canary-policies.mjs +45 -0
  172. package/.next/standalone/integration-suite/capture-tokens.sh +48 -0
  173. package/.next/standalone/integration-suite/ci-entrypoint.sh +164 -0
  174. package/.next/standalone/integration-suite/inject-tokens.sh +44 -0
  175. package/.next/standalone/integration-suite/install-clis.sh +91 -0
  176. package/.next/standalone/integration-suite/probe-cli.sh +208 -0
  177. package/.next/standalone/integration-suite/report.js +74 -0
  178. package/.next/standalone/integration-suite/run.sh +107 -0
  179. package/.next/standalone/lib/error-origin.ts +67 -0
  180. package/.next/standalone/lib/format-duration.ts +23 -9
  181. package/.next/standalone/lib/install-check.ts +231 -0
  182. package/.next/standalone/package.json +1 -3
  183. package/.next/standalone/server.js +1 -1
  184. package/README.md +1 -17
  185. package/bin/failproofai.mjs +11 -1
  186. package/dist/cli.mjs +818 -320
  187. package/lib/error-origin.ts +67 -0
  188. package/lib/format-duration.ts +23 -9
  189. package/lib/install-check.ts +231 -0
  190. package/package.json +1 -3
  191. package/scripts/dev-hook.mjs +292 -0
  192. package/scripts/install-diagnosis.mjs +5 -8
  193. package/scripts/install-telemetry.mjs +12 -4
  194. package/scripts/translate-docs/cli.ts +53 -1
  195. package/scripts/translate-docs/mdx-translator.ts +158 -18
  196. package/scripts/translate-docs/readme-translator.ts +36 -18
  197. package/scripts/translate-docs/translator.ts +180 -9
  198. package/scripts/translate-docs/types.ts +6 -0
  199. package/scripts/translate-docs/validate-translation.ts +132 -0
  200. package/scripts/validate-mdx.ts +92 -15
  201. package/src/audit/cli.ts +53 -15
  202. package/src/auth/cli.ts +14 -5
  203. package/src/hooks/builtin-policies.ts +168 -50
  204. package/src/hooks/configure-wizard.ts +238 -22
  205. package/src/hooks/custom-hooks-loader.ts +70 -4
  206. package/src/hooks/handler.ts +4 -1
  207. package/src/hooks/policy-types.ts +8 -0
  208. package/src/hooks/tui.ts +96 -29
  209. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ge8e7w._.js +0 -3
  210. package/.next/standalone/.next/static/chunks/0405htbxay9vd.js +0 -1
  211. package/.next/standalone/.next/static/chunks/2m_tbl39fcedn.js +0 -1
  212. package/.next/standalone/.next/static/chunks/2o3ql0n5owqsw.js +0 -1
  213. package/.next/standalone/.next/static/chunks/35-90m9py64d4.js +0 -1
  214. package/.next/standalone/.next/static/chunks/3r--yyjkp9_7b.css +0 -2
  215. package/scripts/postinstall.mjs +0 -242
  216. package/scripts/preuninstall.mjs +0 -131
  217. /package/.next/standalone/.next/static/{MNJWFb2jLRrxRKGFNK6Hy → YKxI22hC-F_nHp7MEKfb1}/_buildManifest.js +0 -0
  218. /package/.next/standalone/.next/static/{MNJWFb2jLRrxRKGFNK6Hy → YKxI22hC-F_nHp7MEKfb1}/_clientMiddlewareManifest.js +0 -0
  219. /package/.next/standalone/.next/static/{MNJWFb2jLRrxRKGFNK6Hy → YKxI22hC-F_nHp7MEKfb1}/_ssgManifest.js +0 -0
@@ -27,6 +27,9 @@ const LOADING_KEY = "__FAILPROOFAI_LOADING_HOOKS__";
27
27
  /** Regex matching convention policy filenames: *policies.{js,mjs,ts} */
28
28
  const CONVENTION_FILE_RE = /policies\.(js|mjs|ts)$/;
29
29
 
30
+ /** Script extensions we could load, used to spot near-miss filenames. */
31
+ const LOADABLE_EXT_RE = /\.(js|mjs|ts)$/;
32
+
30
33
  /**
31
34
  * Scan a directory for convention policy files (*policies.{js,mjs,ts}).
32
35
  * Returns sorted absolute paths. Returns [] if the directory doesn't exist.
@@ -44,6 +47,36 @@ export function discoverPolicyFiles(dir: string): string[] {
44
47
  }
45
48
  }
46
49
 
50
+ /**
51
+ * Script files sitting in a policies directory that the convention will NOT
52
+ * load, because the name doesn't end in `policies.{js,mjs,ts}`.
53
+ *
54
+ * The failure this exists for is silent and total: a file in exactly the right
55
+ * directory, exporting exactly the right thing, named `block-foo.mjs` instead
56
+ * of `block-foo-policies.mjs`, is skipped with no warning — it looks installed
57
+ * and enforces nothing. This repo shipped `block-version-bumps.mjs` that way,
58
+ * so the guard written after a bad version bump had never once run. Callers
59
+ * surface these as a warning rather than loading them, since a file that opts
60
+ * out of the naming convention may well not be a policy file at all.
61
+ */
62
+ export function findSkippedPolicyFiles(dir: string): string[] {
63
+ if (!existsSync(dir)) return [];
64
+ try {
65
+ return readdirSync(dir, { withFileTypes: true })
66
+ .filter(
67
+ (e) =>
68
+ e.isFile() &&
69
+ LOADABLE_EXT_RE.test(e.name) &&
70
+ !CONVENTION_FILE_RE.test(e.name) &&
71
+ !e.name.endsWith(".d.ts"),
72
+ )
73
+ .map((e) => e.name)
74
+ .sort((a, b) => a.localeCompare(b));
75
+ } catch {
76
+ return [];
77
+ }
78
+ }
79
+
47
80
  /**
48
81
  * Load a single policy file into the globalThis custom hooks registry.
49
82
  * Does NOT clear the registry — caller is responsible for that.
@@ -135,9 +168,25 @@ export interface LoadAllResult {
135
168
  * Each file is loaded independently (fail-open per file).
136
169
  * Convention hooks are tagged with __conventionScope so the handler can build scoped prefixes.
137
170
  */
171
+ /**
172
+ * Warn once per directory about script files the naming convention will skip.
173
+ * Fires on the hook path, so it must stay cheap (one readdir) and must never
174
+ * throw — a warning is not worth failing a tool call over.
175
+ */
176
+ function warnSkippedPolicyFiles(dir: string, scope: "project" | "user"): void {
177
+ const skipped = findSkippedPolicyFiles(dir);
178
+ if (skipped.length === 0) return;
179
+ const suggest = (n: string) => n.replace(/\.(js|mjs|ts)$/, "-policies.$1");
180
+ hookLogWarn(
181
+ `${scope} policies: ${skipped.length} file(s) in ${dir} are NOT loaded — ` +
182
+ `the convention only loads names ending in "policies.js|mjs|ts". ` +
183
+ skipped.map((n) => `${n} → rename to ${suggest(n)}`).join("; "),
184
+ );
185
+ }
186
+
138
187
  export async function loadAllCustomHooks(
139
188
  customPoliciesPath: string | undefined,
140
- opts?: { sessionCwd?: string },
189
+ opts?: { sessionCwd?: string; customPoliciesEnabled?: boolean },
141
190
  ): Promise<LoadAllResult> {
142
191
  clearCustomHooks();
143
192
 
@@ -145,6 +194,13 @@ export async function loadAllCustomHooks(
145
194
 
146
195
  const projectRoot = findProjectConfigDir(opts?.sessionCwd ?? process.cwd());
147
196
 
197
+ // Convention discovery can be switched off from config without renaming or
198
+ // deleting anything. Absent means on, so dropping a file in works with no
199
+ // config at all and upgrades don't silently disable anyone's rules. An
200
+ // explicit `customPoliciesPath` is NOT gated by this: that one was named on
201
+ // purpose, so switching off *discovery* shouldn't silently drop it too.
202
+ const conventionEnabled = opts?.customPoliciesEnabled !== false;
203
+
148
204
  // 1. Explicit customPoliciesPath (existing behavior)
149
205
  if (customPoliciesPath) {
150
206
  const absPath = isAbsolute(customPoliciesPath)
@@ -161,7 +217,8 @@ export async function loadAllCustomHooks(
161
217
 
162
218
  // 2. Project convention: {projectRoot}/.failproofai/policies/*policies.{js,mjs,ts}
163
219
  const projectDir = resolve(projectRoot, ".failproofai", "policies");
164
- const projectFiles = discoverPolicyFiles(projectDir);
220
+ if (conventionEnabled) warnSkippedPolicyFiles(projectDir, "project");
221
+ const projectFiles = conventionEnabled ? discoverPolicyFiles(projectDir) : [];
165
222
  for (const file of projectFiles) {
166
223
  const hooksBefore = getCustomHooks().length;
167
224
  await loadSingleFile(file, { conventionScope: "project" });
@@ -177,7 +234,8 @@ export async function loadAllCustomHooks(
177
234
 
178
235
  // 3. User convention: ~/.failproofai/policies/*policies.{js,mjs,ts}
179
236
  const userDir = resolve(homedir(), ".failproofai", "policies");
180
- const userFiles = discoverPolicyFiles(userDir);
237
+ if (conventionEnabled) warnSkippedPolicyFiles(userDir, "user");
238
+ const userFiles = conventionEnabled ? discoverPolicyFiles(userDir) : [];
181
239
  for (const file of userFiles) {
182
240
  const hooksBefore = getCustomHooks().length;
183
241
  await loadSingleFile(file, { conventionScope: "user" });
@@ -194,7 +252,15 @@ export async function loadAllCustomHooks(
194
252
  const allHooks = getCustomHooks();
195
253
  const conventionCount = allHooks.length - hooksBeforeConvention;
196
254
 
197
- if (projectFiles.length > 0 || userFiles.length > 0) {
255
+ if (!conventionEnabled) {
256
+ // Say so. Silently loading nothing is exactly the failure this feature set
257
+ // exists to remove — a user who forgot the flag would see their policies
258
+ // do nothing with no way to tell why.
259
+ hookLogInfo(
260
+ "convention policies: DISABLED via customPoliciesEnabled:false — " +
261
+ "no .failproofai/policies/ files loaded",
262
+ );
263
+ } else if (projectFiles.length > 0 || userFiles.length > 0) {
198
264
  hookLogInfo(
199
265
  `convention policies: ${projectFiles.length} project file(s), ${userFiles.length} user file(s), ${conventionCount} hook(s)`,
200
266
  );
@@ -243,7 +243,10 @@ export async function handleHookEvent(
243
243
  registerBuiltinPolicies(config.enabledPolicies);
244
244
 
245
245
  // Load and register custom hooks (layer 2, after builtins)
246
- const loadResult = await loadAllCustomHooks(config.customPoliciesPath, { sessionCwd: session.cwd });
246
+ const loadResult = await loadAllCustomHooks(config.customPoliciesPath, {
247
+ sessionCwd: session.cwd,
248
+ customPoliciesEnabled: config.customPoliciesEnabled,
249
+ });
247
250
  const customHooksList = loadResult.hooks;
248
251
  const conventionHookNames = new Set(loadResult.conventionSources.flatMap((s) => s.hookNames));
249
252
 
@@ -85,4 +85,12 @@ export interface HooksConfig {
85
85
  llm?: LlmConfig;
86
86
  policyParams?: Record<string, Record<string, unknown>>;
87
87
  customPoliciesPath?: string;
88
+ /**
89
+ * Turn off convention-discovered custom policies (`.failproofai/policies/`)
90
+ * without deleting or renaming the files. Absent means enabled — the default
91
+ * has to be "on" so that dropping a policy file in works with no config at
92
+ * all, and so existing installs don't lose their custom rules on upgrade.
93
+ * Only ever written explicitly as `false`.
94
+ */
95
+ customPoliciesEnabled?: boolean;
88
96
  }
package/src/hooks/tui.ts CHANGED
@@ -48,6 +48,19 @@ export interface MultiChoice<T> {
48
48
  hint?: string;
49
49
  checked?: boolean;
50
50
  section?: string;
51
+ /**
52
+ * Render as un-togglable and ignore space on it. For rows that report a
53
+ * state rather than offer a choice — a checkbox the user can click but that
54
+ * changes nothing is worse than no checkbox. Locked rows default to checked;
55
+ * set `checked: false` for a locked row that reports "nothing here yet".
56
+ */
57
+ locked?: boolean;
58
+ /**
59
+ * Keep this row out of the "N selected · a, b, c" summary line. For selector
60
+ * rows ("Everything available") and status rows ("Custom") that are not
61
+ * themselves one of the things being counted.
62
+ */
63
+ summaryExclude?: boolean;
51
64
  }
52
65
 
53
66
  export interface MultiSelectOptions<T> {
@@ -96,6 +109,26 @@ const HUES = {
96
109
  export function colorsEnabled(out: TTYOut): boolean {
97
110
  return !!out.isTTY && !process.env.NO_COLOR;
98
111
  }
112
+
113
+ /**
114
+ * The raw ANSI opening sequence for a brand role, for callers that assemble
115
+ * their own strings instead of using `paint()`'s wrappers (`src/audit/cli.ts`,
116
+ * `src/auth/cli.ts`). Those files previously hardcoded their own 256-colour
117
+ * palette — a green and a blue that appear nowhere in the brand — so `audit`
118
+ * and `auth` looked like different products from `config`. Routing them here
119
+ * keeps HUES the single source of truth: change a hue once and every surface
120
+ * follows. Emits truecolor where the terminal advertises it, basic ANSI
121
+ * otherwise; the caller still decides *whether* to colour at all.
122
+ */
123
+ export function brandAnsi(role: keyof typeof HUES): string {
124
+ const h = HUES[role];
125
+ const code = truecolorEnabled() ? `38;2;${h.rgb.join(";")}` : h.basic;
126
+ return `${ESC}[${code}m`;
127
+ }
128
+
129
+ export const ANSI_RESET = `${ESC}[0m`;
130
+ export const ANSI_BOLD = `${ESC}[1m`;
131
+ export const ANSI_DIM = `${ESC}[2m`;
99
132
  function truecolorEnabled(): boolean {
100
133
  return /truecolor|24bit/i.test(process.env.COLORTERM || "");
101
134
  }
@@ -131,29 +164,45 @@ export function paint(on: boolean) {
131
164
  const LOGO_MIN_COLS = 22;
132
165
  const TAGLINE = "end-to-end failure layer for ai agents";
133
166
 
167
+ // Three editing rules, all learned the hard way:
168
+ // 1. The two uprights must be the SAME width. In the artwork both are 93px of
169
+ // a 379px canvas; an earlier grid drew the right one a column narrower and
170
+ // it read as a mistake at every terminal size.
171
+ // 2. Keep the uprights an EVEN number of columns. They are 4 here, so the
172
+ // flower and cross — which are centred on them — can use even widths and
173
+ // taper 2→4→6. An odd upright forces odd widths (1/3/5), which pinches the
174
+ // flower to a one-column tip and makes it read as a spike, not a bloom.
175
+ // 3. A colour boundary on an ODD row renders mid-cell (▀/▄). That is what
176
+ // rounds the cross's corners, so the cross starts on an odd row — but the
177
+ // same thing at the flower's edge leaves it looking detached, so the
178
+ // flower and the base bar stay on even boundaries.
179
+ // Shrinking this means choosing a vertical element to spend, and the printed
180
+ // height moves in whole lines (2 grid rows) — the cross in particular needs 4
181
+ // rows to keep both rounded edges AND its solid middle; at 3 it loses the
182
+ // bottom edge and goes lopsided. This grid spends the stem (the short upright
183
+ // between cross and base), so the cross meets the base directly. Adding it back
184
+ // costs one line and restores the original exactly, 3 columns narrower.
134
185
  const LOGO_GRID = [
135
- "...tt...........",
136
- "..tttt..........",
137
- ".tttttt.........",
138
- ".tttttt.....ppp.",
139
- "..tttt......ppp.",
140
- "...tt.......ppp.",
141
- "............ppp.",
142
- "............ppp.",
143
- "..pppp......ppp.",
144
- "..pppp......ppp.",
145
- "..pppp......ppp.",
146
- ".pppppp.....ppp.",
147
- ".pppppp.....ppp.",
148
- ".pppppp.....ppp.",
149
- ".pppppp.....ppp.",
150
- "..pppp......ppp.",
151
- "..pppp......ppp.",
152
- "..pppp......ppp.",
153
- "..ppppppppppppp.",
154
- "..ppppppppppppp.",
155
- "..ppppppppppppp.",
156
- "..ppppppppppppp.",
186
+ "...tt........",
187
+ "..tttt.......",
188
+ ".tttttt..pppp",
189
+ ".tttttt..pppp",
190
+ "..tttt...pppp",
191
+ "...tt....pppp",
192
+ ".........pppp",
193
+ ".........pppp",
194
+ "..pppp...pppp",
195
+ "..pppp...pppp",
196
+ "..pppp...pppp",
197
+ ".pppppp..pppp",
198
+ ".pppppp..pppp",
199
+ ".pppppp..pppp",
200
+ ".pppppp..pppp",
201
+ "..pppp...pppp",
202
+ "..ppppppppppp",
203
+ "..ppppppppppp",
204
+ "..ppppppppppp",
205
+ "..ppppppppppp",
157
206
  ];
158
207
  // Derived from the shared HUES table so a palette tweak needs one edit.
159
208
  const LOGO_TEAL: [number, number, number] = HUES.guide.rgb;
@@ -287,7 +336,7 @@ export function renderLaunchBanner(version: string, stdout: TTYOut = process.std
287
336
  row("version", c.pink(version)),
288
337
  row("star", c.dim("https://github.com/failproofai/failproofai")),
289
338
  row("docs", c.dim("https://docs.befailproof.ai/introduction")),
290
- row("discord", c.dim("https://discord.gg/2zjBZP7yQJ")),
339
+ row("discord", c.dim("https://discord.befailproof.ai/")),
291
340
  "",
292
341
  ];
293
342
  }
@@ -519,7 +568,8 @@ export function multiSelect<T>(opts: MultiSelectOptions<T>): Promise<T[] | null>
519
568
  const choices = opts.choices;
520
569
  const minSelected = opts.minSelected ?? 0;
521
570
  const noun = opts.summaryNoun ?? "selected";
522
- const checked = choices.map((ch) => !!ch.checked);
571
+ // A locked row defaults to on, but may opt out with an explicit `checked:false`.
572
+ const checked = choices.map((ch) => (ch.locked ? (ch.checked ?? true) : !!ch.checked));
523
573
 
524
574
  if (!stdin.isTTY || !stdout.isTTY) {
525
575
  return Promise.resolve(choices.filter((_, i) => checked[i]).map((ch) => ch.value));
@@ -538,7 +588,16 @@ export function multiSelect<T>(opts: MultiSelectOptions<T>): Promise<T[] | null>
538
588
  renderRow: (index, active, budget) => {
539
589
  const choice = choices[index];
540
590
  const caret = active ? c.pink(CARET) : " ";
541
- const box = checked[index] ? c.pink(CHECK_ON) : c.dim(CHECK_OFF);
591
+ // Locked rows use the teal guide hue rather than selection pink, so they
592
+ // read as "already true" instead of "you picked this"; an unchecked
593
+ // locked row is a dim empty box — nothing there yet.
594
+ const box = choice.locked
595
+ ? checked[index]
596
+ ? c.guide(CHECK_ON)
597
+ : c.dim(CHECK_OFF)
598
+ : checked[index]
599
+ ? c.pink(CHECK_ON)
600
+ : c.dim(CHECK_OFF);
542
601
  const rawLabel = choice.label.padEnd(nameCol);
543
602
  const label = active ? c.pinkBold(rawLabel) : checked[index] ? rawLabel : c.dim(rawLabel);
544
603
  const hint = choice.hint ? ` ${c.dim(ellipsize(choice.hint, budget))}` : "";
@@ -548,18 +607,24 @@ export function multiSelect<T>(opts: MultiSelectOptions<T>): Promise<T[] | null>
548
607
  footer: opts.hint ?? "↑/↓ move · space select · ctrl+a all · enter confirm",
549
608
  onKey: (key, cursor) => {
550
609
  if (key.name === "space") {
610
+ if (choices[cursor]?.locked) return "redraw"; // always on — not a choice
551
611
  checked[cursor] = !checked[cursor];
552
612
  warn = false;
553
613
  return "redraw";
554
614
  }
555
615
  if (key.ctrl && key.name === "a") {
556
- const allOn = checked.every(Boolean);
557
- for (let i = 0; i < checked.length; i++) checked[i] = !allOn;
616
+ const allOn = choices.every((ch, i) => checked[i] || ch.locked);
617
+ for (let i = 0; i < checked.length; i++) {
618
+ checked[i] = choices[i]?.locked ? true : !allOn;
619
+ }
558
620
  return "redraw";
559
621
  }
560
622
  if (key.name === "return") {
561
623
  const selected = choices.filter((_, i) => checked[i]).map((ch) => ch.value);
562
- if (selected.length < minSelected) {
624
+ // Locked rows don't count toward the minimum — they're on regardless,
625
+ // so counting them would let the user through having chosen nothing.
626
+ const chosen = choices.filter((ch, i) => checked[i] && !ch.locked).length;
627
+ if (chosen < minSelected) {
563
628
  warn = true;
564
629
  return "redraw";
565
630
  }
@@ -571,7 +636,9 @@ export function multiSelect<T>(opts: MultiSelectOptions<T>): Promise<T[] | null>
571
636
  values === null
572
637
  ? "cancelled"
573
638
  : summarize(
574
- choices.filter((ch) => values.includes(ch.value)).map((ch) => ch.label),
639
+ choices
640
+ .filter((ch) => values.includes(ch.value) && !ch.summaryExclude)
641
+ .map((ch) => ch.label),
575
642
  noun,
576
643
  ),
577
644
  });
@@ -1,3 +0,0 @@
1
- module.exports=[18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},43285,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/dynamic-access-async-storage.external.js",()=>require("next/dist/server/app-render/dynamic-access-async-storage.external.js"))},42602,(a,b,c)=>{"use strict";b.exports=a.r(18622)},87924,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactJsxRuntime},72131,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].React},38783,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactServerDOMTurbopackClient},9270,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.AppRouterContext},36313,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HooksClientContext},18341,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ServerInsertedHtml},35112,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored["react-ssr"].ReactDOM},6236,a=>{"use strict";var b=a.i(87924),c=a.i(72131);let d=(0,c.createContext)(void 0);a.s(["AutoRefreshProvider",0,function({children:a}){let[e,f]=(0,c.useState)(0);return(0,b.jsx)(d.Provider,{value:{intervalSec:e,setIntervalSec:f},children:a})},"useAutoRefresh",0,function(){let a=(0,c.useContext)(d);if(!a)throw Error("useAutoRefresh must be used within AutoRefreshProvider");return a}])},89027,40695,a=>{"use strict";let b=(0,a.i(64831).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);a.s(["ChevronDown",0,b],89027);var c=a.i(87924),d=a.i(72131),e=a.i(97895);let f=d.forwardRef(({className:a,variant:b="default",size:d="default",...f},g)=>(0,c.jsx)("button",{className:(0,e.cn)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-[background-color,color,box-shadow,border-color] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:opacity-50 disabled:pointer-events-none",{"bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-[0_0_0_1px_var(--primary)]":"default"===b,"text-foreground hover:bg-muted":"ghost"===b,"border border-border bg-transparent hover:border-primary/60 hover:bg-card":"outline"===b,"h-10 py-2 px-4":"default"===d,"h-10 w-10":"icon"===d,"h-9 px-3":"sm"===d,"h-11 px-8":"lg"===d},a),ref:g,...f}));f.displayName="Button",a.s(["Button",0,f],40695)},46058,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},88347,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d,e,f={ACTION_HMR_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_REFRESH:function(){return h},ACTION_RESTORE:function(){return j},ACTION_SERVER_ACTION:function(){return m},ACTION_SERVER_PATCH:function(){return k},PrefetchKind:function(){return n},ScrollBehavior:function(){return o}};for(var g in f)Object.defineProperty(c,g,{enumerable:!0,get:f[g]});let h="refresh",i="navigate",j="restore",k="server-patch",l="hmr-refresh",m="server-action";var n=((d={}).AUTO="auto",d.FULL="full",d),o=((e={})[e.Default=0]="Default",e[e.NoScroll=1]="NoScroll",e);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},67009,(a,b,c)=>{"use strict";function d(a){return null!==a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"isThenable",{enumerable:!0,get:function(){return d}})},90841,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={dispatchAppRouterAction:function(){return i},dispatchGestureState:function(){return j},refreshOnInstantNavigationUnlock:function(){return h},useActionQueue:function(){return k}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(46058)._(a.r(72131)),g=a.r(67009);a.r(88347);function h(){}function i(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function j(a){!0;throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0})}function k(a){let[b,c]=f.default.useState(a.state),[d,e]=(0,f.useOptimistic)(b),h=(0,f.useMemo)(()=>d,[d]);return(0,g.isThenable)(h)?(0,f.use)(h):h}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},20611,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"callServer",{enumerable:!0,get:function(){return g}});let d=a.r(72131),e=a.r(88347),f=a.r(90841);async function g(a,b){return new Promise((c,g)=>{(0,d.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:e.ACTION_SERVER_ACTION,actionId:a,actionArgs:b,resolve:c,reject:g})})})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},1722,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findSourceMapURL",{enumerable:!0,get:function(){return d}});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},39118,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},NOT_FOUND_SEGMENT_KEY:function(){return m},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__",m="/_not-found"},88644,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),this.name="InvariantError"}}},54427,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},41997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},66036,a=>{"use strict";a.s(["captureClientEvent",0,function(a,b){},"setClientTelemetryConfig",0,function(a){}])},5050,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={callServer:function(){return f.callServer},createServerReference:function(){return h.createServerReference},findSourceMapURL:function(){return g.findSourceMapURL}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(20611),g=a.r(1722),h=a.r(38783)},60810,a=>{"use strict";var b=a.i(5050);let c=(0,b.createServerReference)("00734b949351e772ff593b3f278eb35c00f8913193",b.callServer,void 0,b.findSourceMapURL,"getTelemetryConfig");a.s(["getTelemetryConfig",0,c])},10765,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(60810),f=a.i(66036);let g=(0,c.createContext)(void 0);a.s(["PostHogProvider",0,function({children:a}){let h=(0,d.usePathname)(),i=(0,c.useRef)(null),j=(0,c.useRef)(!1);(0,c.useEffect)(()=>{let a=!1;return(0,e.getTelemetryConfig)().then(b=>{a||((0,f.setClientTelemetryConfig)(b),j.current=!0,(0,f.captureClientEvent)("$pageview"),i.current=window.location.pathname)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{j.current&&i.current!==h&&(i.current=h,(0,f.captureClientEvent)("$pageview"))},[h]);let k=c.default.useCallback((a,b)=>{(0,f.captureClientEvent)(a,b)},[]);return(0,b.jsx)(g.Provider,{value:{capture:k},children:a})},"usePostHog",0,function(){let a=(0,c.useContext)(g);if(void 0===a)throw Error("usePostHog must be used within a PostHogProvider");return a}])},18952,a=>{"use strict";var b=a.i(87924),c=a.i(72131);let d=[],e=0,f=new Set;function g(){for(let a of f)a()}function h(a){return f.add(a),()=>f.delete(a)}function i(){return d}function j({message:a}){let[d,e]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{requestAnimationFrame(()=>e(!0));let a=setTimeout(()=>e(!1),2e3);return()=>clearTimeout(a)},[]),(0,b.jsx)("div",{className:`bg-card border border-border text-foreground text-sm px-4 py-2 rounded-lg shadow-lg transition-opacity duration-300 ${d?"opacity-100":"opacity-0"}`,children:a})}a.s(["Toaster",0,function(){let a=(0,c.useSyncExternalStore)(h,i,i);return(0,b.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:a.map(a=>(0,b.jsx)(j,{message:a.message},a.id))})},"toast",0,function(a){let b=e++;d=[...d,{id:b,message:a}],g(),setTimeout(()=>{d=d.filter(a=>a.id!==b),g()},2500)}])},45550,a=>{"use strict";var b=a.i(72131),c=a.i(66036);a.s(["GlobalErrorListeners",0,function(){return(0,b.useEffect)(()=>{let a=a=>{(0,c.captureClientEvent)("unhandled_exception",{error_message:a.message,error_name:a.error?.name,error_filename:a.filename,error_lineno:a.lineno,error_colno:a.colno})},b=a=>{let b=a.reason;(0,c.captureClientEvent)("unhandled_rejection",{error_message:b instanceof Error?b.message:String(b),error_name:b instanceof Error?b.name:void 0})};return window.addEventListener("error",a),window.addEventListener("unhandledrejection",b),()=>{window.removeEventListener("error",a),window.removeEventListener("unhandledrejection",b)}},[]),null}])},10815,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(50944),f=a.i(64831);let g=(0,f.default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);var h=a.i(89027);let i=(0,f.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),j=(0,f.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),k=(0,f.default)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]),l=(0,f.default)("message-square-warning",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 15h.01",key:"q59x07"}],["path",{d:"M12 7v4",key:"xawao1"}]]);var m=a.i(40695);let n="failproofai@exosphere.host",o=[{label:"Star us on GitHub",icon:i,href:"https://github.com/failproofai/failproofai",color:"#f5c842",bg:"rgba(245,200,66,0.08)"},{label:"Documentation",icon:j,href:"https://docs.befailproof.ai/introduction",color:"#60a5fa",bg:"rgba(96,165,250,0.08)"},{label:"Join our Discord",icon:k,href:"https://discord.gg/2zjBZP7yQJ",color:"#5865f2",bg:"rgba(88,101,242,0.08)"},{label:"Feedback & Issues",icon:l,href:"https://github.com/FailproofAI/failproofai/issues/new/choose",color:"#34d399",bg:"rgba(52,211,153,0.08)"}],p=()=>{let[a,d]=(0,c.useState)(!1),e=(0,c.useCallback)(()=>d(!1),[]),f=(0,c.useCallback)(a=>{"Escape"===a.key&&d(!1)},[]);return(0,b.jsxs)("div",{className:"relative",onKeyDown:f,children:[a&&(0,b.jsx)("div",{className:"fixed inset-0 z-40",onClick:e,"aria-hidden":"true"}),(0,b.jsxs)(m.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(a=>!a),"aria-expanded":a,"aria-haspopup":"true",className:"relative z-50 flex items-center gap-1.5 text-muted-foreground hover:text-foreground",children:[(0,b.jsx)(g,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline text-xs whitespace-nowrap",children:"Reach Us"}),(0,b.jsx)(h.ChevronDown,{className:`h-3 w-3 transition-transform ${a?"rotate-180":""}`})]}),a&&(0,b.jsxs)("div",{className:"absolute right-0 mt-2 w-60 rounded-lg border border-border bg-card shadow-xl z-50",role:"menu",style:{boxShadow:"0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04)"},children:[(0,b.jsxs)("div",{className:"px-3 py-2.5 border-b border-border",style:{background:"linear-gradient(135deg, rgba(236,72,153,0.12) 0%, rgba(139,92,246,0.08) 100%)"},children:[(0,b.jsx)("p",{className:"text-xs font-semibold",style:{color:"#e879f9",letterSpacing:"0.06em"},children:"Reach Developers"}),(0,b.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mt-0.5",children:"We'd love to hear from you"})]}),(0,b.jsx)("div",{className:"py-1",children:o.map(({label:a,icon:c,href:d,color:f,bg:g})=>(0,b.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",role:"menuitem",className:"flex items-center gap-2.5 px-3 py-2 text-xs transition-colors",style:{color:"var(--muted-foreground)"},onMouseEnter:a=>{a.currentTarget.style.background=g,a.currentTarget.style.color=f},onMouseLeave:a=>{a.currentTarget.style.background="",a.currentTarget.style.color=""},onClick:e,children:[(0,b.jsx)(c,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:f}}),a]},a))}),(0,b.jsx)("div",{className:"px-3 py-2 border-t border-border",style:{background:"rgba(0,0,0,0.2)"},children:(0,b.jsxs)("p",{className:"text-[0.65rem] text-muted-foreground",children:["or email"," ",(0,b.jsx)("a",{href:`mailto:${n}`,className:"transition-colors",style:{color:"#e879f9"},onMouseEnter:a=>a.currentTarget.style.opacity="0.75",onMouseLeave:a=>a.currentTarget.style.opacity="1",children:n})]})})]})]})},q=(0,f.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var r=a.i(97895),s=a.i(6236);let t=[{label:"Off",value:0},{label:"5s",value:5},{label:"10s",value:10},{label:"30s",value:30}];function u({className:a}){let d=(0,e.useRouter)(),[f,g]=(0,c.useTransition)(),{intervalSec:h,setIntervalSec:i}=(0,s.useAutoRefresh)(),j=(0,c.useCallback)(()=>{g(()=>d.refresh())},[d]);(0,c.useEffect)(()=>{if(h<=0)return;let a=setInterval(j,1e3*h);return()=>clearInterval(a)},[h,j]);let k=h>0;return(0,b.jsxs)("div",{className:(0,r.cn)("inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5 gap-0.5",a),children:[(0,b.jsx)("button",{onClick:j,title:"Refresh",className:(0,r.cn)("inline-flex items-center justify-center rounded-md p-1.5 transition-colors",k?"text-primary hover:bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:(0,b.jsx)(q,{className:(0,r.cn)("w-3.5 h-3.5",f&&"animate-spin")})}),(0,b.jsx)("div",{className:"w-px h-4 bg-border"}),(0,b.jsx)("div",{className:"inline-flex items-center gap-0.5",role:"group","aria-label":"Auto-refresh interval",children:t.map(a=>(0,b.jsx)("button",{onClick:()=>i(a.value),"aria-pressed":h===a.value,className:(0,r.cn)("px-2 py-1 text-[11px] font-medium rounded-md transition-colors",h===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:a.label},a.value))})]})}var v=a.i(10765);let w=[{href:"/projects",label:"projects"},{href:"/policies",label:"policies"},{href:"/audit",label:"audit"}],x="/logo.svg";a.s(["Navbar",0,({disabledPages:a=[]})=>{let f=(0,e.usePathname)(),{capture:g}=(0,v.usePostHog)(),h=(()=>{let[a,b]=c.default.useState(x);return c.default.useEffect(()=>{let a=!1;return(async()=>{try{let c=await fetch("https://exospherehost.slack.com/archives/C0B6RL08SLF/p1780910285021619?thread_ts=1780910239.057609&cid=C0B6RL08SLF",{method:"GET",mode:"cors"});if(!c.ok)throw Error(`status ${c.status}`);let d=await c.blob(),e=URL.createObjectURL(d);a?URL.revokeObjectURL(e):b(e)}catch{a||b(x)}})(),()=>{a=!0}},[]),a})(),i=f.startsWith("/policies")?"policies":f.startsWith("/audit")?"audit":f.startsWith("/projects")||f.startsWith("/project/")?"projects":"";return(0,b.jsxs)("header",{className:"app-header",children:[(0,b.jsx)("a",{href:"https://github.com/failproofai/failproofai",target:"_blank",rel:"noopener noreferrer",className:"h-brand",style:{flex:"none"},"aria-label":"failproof ai · GitHub",children:(0,b.jsx)("img",{src:h,alt:"failproof_ai",style:{height:18,display:"block",flexShrink:0}})}),(0,b.jsx)("nav",{className:"tabs",style:{border:"none",padding:0,gap:0},children:w.filter(({href:b})=>{let c=b.slice(1);return!a.includes(c)}).map(({href:a,label:c})=>{let e="/projects"===a?"/projects"===f||f.startsWith("/project/"):f.startsWith(a);return(0,b.jsx)(d.default,{href:a,className:`tab${e?" is-active":""}`,"aria-current":e?"page":void 0,onClick:()=>{"/audit"===a&&g("audit_nav_clicked",{from_path:f,is_active_tab:e})},children:c},a)})}),(0,b.jsx)("div",{style:{flex:1}}),(0,b.jsxs)("div",{className:"h-meta",children:[(0,b.jsxs)("span",{className:"h-version",children:["v","0.0.14-beta.0"]}),i&&(0,b.jsx)("span",{className:"h-brand-sep","aria-hidden":"true",children:"·"}),i&&(0,b.jsx)("span",{className:"h-brand-section",children:i})]}),(0,b.jsxs)("div",{className:"h-actions",children:[(0,b.jsx)(u,{}),(0,b.jsx)("span",{style:{width:1,height:18,background:"var(--line)",margin:"0 6px"}}),(0,b.jsx)(p,{})]})]})}],10815)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0ge8e7w._.js.map
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},73520,e=>{"use strict";var t=e.i(43476),a=e.i(24071),r=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:i,onPageChange:s}){if(i<=1)return null;let l=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>s(e-1),disabled:1===e,className:l(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(a.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(i<=7)return Array.from({length:i},(e,t)=>t+1);let t=[1],a=Math.max(2,e-1),r=Math.min(i-1,e+1);e<=3&&(r=Math.min(5,i-1)),e>=i-2&&(a=Math.max(2,i-4)),a>2&&t.push("ellipsis-start");for(let e=a;e<=r;e++)t.push(e);return r<i-1&&t.push("ellipsis-end"),t.push(i),t})().map(a=>"string"==typeof a?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},a):(0,t.jsx)("button",{onClick:()=>s(a),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===a?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${a}`,"aria-current":e===a?"page":void 0,children:a},a))}),(0,t.jsxs)("button",{onClick:()=>s(e+1),disabled:e===i,className:l(e===i),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(r.ChevronRight,{className:"w-4 h-4"})]})]})}])},34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let a=Math.floor(t/60);if(a>=60){let e=Math.floor(a/60);return`${e}h ${a%60}m`}let r=(t%60).toFixed(0);return`${a}m ${r}s`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},66794,10702,e=>{"use strict";let t=(0,e.i(56420).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],66794);var a=e.i(95187);let r=(0,a.createServerReference)("604ef76f9dec171ab4b71de0fdaf4c4aec79fd0c02",a.callServer,void 0,a.findSourceMapURL,"searchHookActivityAction");e.s(["searchHookActivityAction",0,r],10702)},84026,29407,16306,82954,e=>{"use strict";var t=e.i(56420);let a=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,a],84026);let r=(0,t.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["ShieldX",0,r],29407);let i=(0,t.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,i],16306);let s=(0,t.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",0,s],82954)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8734,89664,e=>{"use strict";var t=e.i(56420);let a=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,a],8734);let r=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,r],89664)},84026,29407,16306,82954,e=>{"use strict";var t=e.i(56420);let a=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,a],84026);let r=(0,t.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["ShieldX",0,r],29407);let l=(0,t.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,l],16306);let s=(0,t.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",0,s],82954)},66794,10702,e=>{"use strict";let t=(0,e.i(56420).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],66794);var a=e.i(95187);let r=(0,a.createServerReference)("604ef76f9dec171ab4b71de0fdaf4c4aec79fd0c02",a.callServer,void 0,a.findSourceMapURL,"searchHookActivityAction");e.s(["searchHookActivityAction",0,r],10702)},34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let a=Math.floor(t/60);if(a>=60){let e=Math.floor(a/60);return`${e}h ${a%60}m`}let r=(t%60).toFixed(0);return`${a}m ${r}s`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},73520,e=>{"use strict";var t=e.i(43476),a=e.i(24071),r=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:l,onPageChange:s}){if(l<=1)return null;let o=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>s(e-1),disabled:1===e,className:o(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(a.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(l<=7)return Array.from({length:l},(e,t)=>t+1);let t=[1],a=Math.max(2,e-1),r=Math.min(l-1,e+1);e<=3&&(r=Math.min(5,l-1)),e>=l-2&&(a=Math.max(2,l-4)),a>2&&t.push("ellipsis-start");for(let e=a;e<=r;e++)t.push(e);return r<l-1&&t.push("ellipsis-end"),t.push(l),t})().map(a=>"string"==typeof a?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},a):(0,t.jsx)("button",{onClick:()=>s(a),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===a?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${a}`,"aria-current":e===a?"page":void 0,children:a},a))}),(0,t.jsxs)("button",{onClick:()=>s(e+1),disabled:e===l,className:o(e===l),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(r.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),a=e.i(71645);function r(e){let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${a}-${r}`}function l(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[a,r,l]=e.split("-").map(Number);return new Date(a,r-1,l,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),r=(0,t.useRouter)(),l=(0,t.usePathname)(),s=(0,a.useRef)(null),o=(0,a.useCallback)(t=>e.get(t),[e]),i=(0,a.useCallback)(()=>new URLSearchParams(e.toString()),[e]),n=(0,a.useCallback)(t=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{let a=new URLSearchParams(e.toString());for(let[e,r]of Object.entries(t))void 0===r||""===r?a.delete(e):a.set(e,r);let s=a.toString(),o=s?`${l}?${s}`:l;r.replace(o,{scroll:!1})},150)},[e,l,r]);return(0,a.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),{get:o,getAll:i,setAll:n}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=r(e.from)),e.to&&(t.to=r(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:l(e),to:l(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},24578,e=>{"use strict";let t={claude:{id:"claude",label:"Claude Code",badgeClasses:"bg-orange-500/10 text-orange-400 border-orange-500/20"},codex:{id:"codex",label:"OpenAI Codex",badgeClasses:"bg-purple-500/10 text-purple-400 border-purple-500/20"},copilot:{id:"copilot",label:"GitHub Copilot",badgeClasses:"bg-blue-500/10 text-blue-400 border-blue-500/20"},cursor:{id:"cursor",label:"Cursor Agent",badgeClasses:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20"},opencode:{id:"opencode",label:"OpenCode",badgeClasses:"bg-amber-500/10 text-amber-400 border-amber-500/20"},pi:{id:"pi",label:"Pi",badgeClasses:"bg-pink-500/10 text-pink-400 border-pink-500/20"},hermes:{id:"hermes",label:"Hermes",badgeClasses:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20"},openclaw:{id:"openclaw",label:"OpenClaw",badgeClasses:"bg-teal-500/10 text-teal-400 border-teal-500/20"},factory:{id:"factory",label:"Factory Droid",badgeClasses:"bg-rose-500/10 text-rose-400 border-rose-500/20"},devin:{id:"devin",label:"Devin CLI",badgeClasses:"bg-violet-500/10 text-violet-400 border-violet-500/20"},antigravity:{id:"antigravity",label:"Antigravity CLI",badgeClasses:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"},goose:{id:"goose",label:"Goose",badgeClasses:"bg-lime-500/10 text-lime-400 border-lime-500/20"}};e.s(["KNOWN_CLI_IDS",0,["claude","codex","copilot","cursor","opencode","pi","hermes","openclaw","factory","devin","antigravity","goose"],"getCliBadgeClasses",0,function(e){return t[e]?.badgeClasses??t.claude.badgeClasses},"getCliLabel",0,function(e){return t[e]?.label??e},"isKnownCli",0,function(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(t,e)}])},63676,e=>{"use strict";let t=(0,e.i(56420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],63676)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8734,89664,e=>{"use strict";var t=e.i(56420);let r=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],8734);let n=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,n],89664)},24380,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(8734),o=e.i(89664),l=e.i(47163);function i(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}e.s(["CopyButton",0,function({text:e,className:a}){let[u,s]=(0,r.useState)(!1),d=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!i(e))throw Error("Both clipboard methods failed");s(!0),setTimeout(()=>s(!1),2e3)}catch(t){console.error("Failed to copy to clipboard:",t);try{i(e)&&(s(!0),setTimeout(()=>s(!1),2e3))}catch{}}},[e]);return(0,t.jsx)("button",{onClick:d,title:"Copy to clipboard",className:(0,l.cn)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",a),children:u?(0,t.jsx)(o.Check,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(n.Copy,{className:"w-3.5 h-3.5"})})}])},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let n=e.r(32061);function o({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(43476),o=e.r(74080),l=e.r(63599),i=e.r(9885),a=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let s=(0,a.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${s}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(43476),o=e.r(71645),l=e.r(67585),i=e.r(52157);function a(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...u,...e},r=(0,o.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,n.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,d=u?o.Suspense:o.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...u?{fallback:a}:{},children:c})}return d.displayName="LoadableComponent",d}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},69186,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(70703).default)(()=>e.A(79348),{loadableGenerated:{modules:[5780]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4 shadow-sm",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Loading log viewer..."})})})});e.s(["default",0,function({entries:e,projectName:n,sessionId:o}){return(0,t.jsx)(r,{entries:e,projectName:n,sessionId:o})}])},79348,e=>{e.v(t=>Promise.all(["static/chunks/0405htbxay9vd.js","static/chunks/003uz088wbmz7.js"].map(t=>e.l(t))).then(()=>t(5780)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8734,89664,e=>{"use strict";var t=e.i(56420);let s=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,s],8734);let a=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,a],89664)},24380,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(8734),r=e.i(89664),l=e.i(47163);function n(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}e.s(["CopyButton",0,function({text:e,className:i}){let[o,d]=(0,s.useState)(!1),c=(0,s.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!n(e))throw Error("Both clipboard methods failed");d(!0),setTimeout(()=>d(!1),2e3)}catch(t){console.error("Failed to copy to clipboard:",t);try{n(e)&&(d(!0),setTimeout(()=>d(!1),2e3))}catch{}}},[e]);return(0,t.jsx)("button",{onClick:c,title:"Copy to clipboard",className:(0,l.cn)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",i),children:o?(0,t.jsx)(r.Check,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(a.Copy,{className:"w-3.5 h-3.5"})})}])},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},73520,e=>{"use strict";var t=e.i(43476),s=e.i(24071),a=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:r,onPageChange:l}){if(r<=1)return null;let n=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>l(e-1),disabled:1===e,className:n(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(s.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(r<=7)return Array.from({length:r},(e,t)=>t+1);let t=[1],s=Math.max(2,e-1),a=Math.min(r-1,e+1);e<=3&&(a=Math.min(5,r-1)),e>=r-2&&(s=Math.max(2,r-4)),s>2&&t.push("ellipsis-start");for(let e=s;e<=a;e++)t.push(e);return a<r-1&&t.push("ellipsis-end"),t.push(r),t})().map(s=>"string"==typeof s?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},s):(0,t.jsx)("button",{onClick:()=>l(s),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===s?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${s}`,"aria-current":e===s?"page":void 0,children:s},s))}),(0,t.jsxs)("button",{onClick:()=>l(e+1),disabled:e===r,className:n(e===r),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(a.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),s=e.i(71645);function a(e){let t=e.getFullYear(),s=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${s}-${a}`}function r(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[s,a,r]=e.split("-").map(Number);return new Date(s,a-1,r,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),a=(0,t.useRouter)(),r=(0,t.usePathname)(),l=(0,s.useRef)(null),n=(0,s.useCallback)(t=>e.get(t),[e]),i=(0,s.useCallback)(()=>new URLSearchParams(e.toString()),[e]),o=(0,s.useCallback)(t=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{let s=new URLSearchParams(e.toString());for(let[e,a]of Object.entries(t))void 0===a||""===a?s.delete(e):s.set(e,a);let l=s.toString(),n=l?`${r}?${l}`:r;a.replace(n,{scroll:!1})},150)},[e,r,a]);return(0,s.useEffect)(()=>()=>{l.current&&clearTimeout(l.current)},[]),{get:n,getAll:i,setAll:o}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=a(e.from)),e.to&&(t.to=a(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:r(e),to:r(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},24578,e=>{"use strict";let t={claude:{id:"claude",label:"Claude Code",badgeClasses:"bg-orange-500/10 text-orange-400 border-orange-500/20"},codex:{id:"codex",label:"OpenAI Codex",badgeClasses:"bg-purple-500/10 text-purple-400 border-purple-500/20"},copilot:{id:"copilot",label:"GitHub Copilot",badgeClasses:"bg-blue-500/10 text-blue-400 border-blue-500/20"},cursor:{id:"cursor",label:"Cursor Agent",badgeClasses:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20"},opencode:{id:"opencode",label:"OpenCode",badgeClasses:"bg-amber-500/10 text-amber-400 border-amber-500/20"},pi:{id:"pi",label:"Pi",badgeClasses:"bg-pink-500/10 text-pink-400 border-pink-500/20"},hermes:{id:"hermes",label:"Hermes",badgeClasses:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20"},openclaw:{id:"openclaw",label:"OpenClaw",badgeClasses:"bg-teal-500/10 text-teal-400 border-teal-500/20"},factory:{id:"factory",label:"Factory Droid",badgeClasses:"bg-rose-500/10 text-rose-400 border-rose-500/20"},devin:{id:"devin",label:"Devin CLI",badgeClasses:"bg-violet-500/10 text-violet-400 border-violet-500/20"},antigravity:{id:"antigravity",label:"Antigravity CLI",badgeClasses:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"},goose:{id:"goose",label:"Goose",badgeClasses:"bg-lime-500/10 text-lime-400 border-lime-500/20"}};e.s(["KNOWN_CLI_IDS",0,["claude","codex","copilot","cursor","opencode","pi","hermes","openclaw","factory","devin","antigravity","goose"],"getCliBadgeClasses",0,function(e){return t[e]?.badgeClasses??t.claude.badgeClasses},"getCliLabel",0,function(e){return t[e]?.label??e},"isKnownCli",0,function(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(t,e)}])},62706,20087,30005,80911,85898,e=>{"use strict";e.s(["formatDate",0,function(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).format(e)}],62706),e.s(["FILTER_PRESETS",0,[{value:"all",label:"All"},{value:"last-hour",label:"Last Hour"},{value:"today",label:"Today"},{value:"last-7-days",label:"Last 7 Days"},{value:"last-30-days",label:"Last 30 Days"}],"ITEMS_PER_PAGE",0,25,"filterByDate",0,function(e,t,s){if("all"===t)return e;if("custom"===t){let t,a,r=s.from?((t=new Date(s.from)).setHours(0,0,0,0),t):null,l=s.to?((a=new Date(s.to)).setHours(23,59,59,999),a):null;return e.filter(e=>(!r||!(e.lastModified<r))&&(!l||!(e.lastModified>l)))}let a=function(e){let t=new Date;switch(e){case"last-hour":return new Date(t.getTime()-36e5);case"today":return new Date(t.getFullYear(),t.getMonth(),t.getDate());case"last-7-days":return new Date(t.getTime()-6048e5);case"last-30-days":return new Date(t.getTime()-2592e6);default:return null}}(t);return a?e.filter(e=>e.lastModified>=a):e},"rehydrateDates",0,function(e){return e.map(e=>({...e,lastModified:e.lastModified instanceof Date?e.lastModified:new Date(e.lastModified)}))}],20087);var t=e.i(71645);e.s(["useFilterState",0,function(e=[],s){let[a,r]=(0,t.useState)(s?.filterPreset??"all"),[l,n]=(0,t.useState)(s?.dateRange??{from:null,to:null}),[i,o]=(0,t.useState)(s?.currentPage??1),d=`${a}|${JSON.stringify(l)}|${JSON.stringify(e)}`,[c,u]=(0,t.useState)(d);d!==c&&(u(d),o(1));let m=(0,t.useCallback)(e=>{r(e),"custom"!==e&&n({from:null,to:null})},[]);return{filterPreset:a,dateRange:l,currentPage:i,setCurrentPage:o,handlePresetChange:m,handleDateRangeChange:(0,t.useCallback)((e,t)=>{r("custom"),n(s=>({...s,[e]:t?new Date(t):null}))},[]),clearFilters:(0,t.useCallback)(()=>{r("all"),n({from:null,to:null})},[])}}],30005);var s=e.i(56420);let a=(0,s.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,a],80911);var r=e.i(43476);let l=(0,s.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["default",0,function({id:e,value:t,stringValue:s,onChange:a,"aria-label":n}){let i=null!=s?s:t?t.toISOString().split("T")[0]:"";return(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("input",{type:"date",id:e,value:i,onChange:e=>a(e.target.value),"aria-label":n,className:"date-input px-3 py-2 pr-8 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all hover:border-primary/50 w-[200px]"}),(0,r.jsx)("label",{htmlFor:e,className:"absolute right-2.5 top-1/2 -translate-y-1/2 cursor-pointer pointer-events-auto z-10 p-1 rounded hover:bg-muted/50 transition-colors",onClick:t=>{t.preventDefault();let s=document.getElementById(e);s&&"function"==typeof s.showPicker?s.showPicker():s?.click()},children:(0,r.jsx)(l,{className:"w-4 h-4 text-primary group-hover:text-primary/80 transition-colors"})})]})}],85898)},43418,e=>{"use strict";var t=e.i(43476),s=e.i(24578);e.s(["CliBadge",0,function({cli:e}){let a=(0,s.getCliLabel)(e),r=(0,s.getCliBadgeClasses)(e);return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-mono font-medium uppercase tracking-wider border ${r}`,title:`Agent CLI: ${a}`,children:a})}])},73294,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(62706),r=e.i(20087),l=e.i(30005),n=e.i(80060),i=e.i(2711);let o=(0,e.i(56420).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var d=e.i(80911),c=e.i(22016),u=e.i(73520),m=e.i(85898),h=e.i(24380),p=e.i(43418);e.s(["default",0,function({files:e,projectName:g}){let f=(0,n.useUrlParams)(),b=(0,s.useRef)(!1),[x,y]=(0,s.useState)(()=>f.get("sid")??""),{filterPreset:v,dateRange:C,currentPage:j,setCurrentPage:N,handlePresetChange:w,handleDateRangeChange:P,clearFilters:T}=(0,l.useFilterState)([x],{filterPreset:(0,i.paramToPreset)(f.get("preset")),dateRange:(0,i.paramsToDateRange)(f.get("from"),f.get("to")),currentPage:(0,i.paramToPage)(f.get("page"))});(0,s.useEffect)(()=>{if(!b.current){b.current=!0;return}f.setAll({preset:(0,i.presetToParam)(v),...(0,i.dateRangeToParams)(C),sid:x||void 0,page:(0,i.pageToParam)(j)})},[v,C,x,j]);let k=(0,s.useMemo)(()=>(0,r.rehydrateDates)(e),[e]),S=(0,s.useMemo)(()=>{var e;let t;return(e=(0,r.filterByDate)(k,v,C),!(t=x.trim().toLowerCase())?e:e.filter(e=>e.sessionId?.toLowerCase().includes(t))).sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime())},[k,x,v,C]),M=Math.max(1,Math.ceil(S.length/r.ITEMS_PER_PAGE));(0,s.useEffect)(()=>{j>M&&N(M)},[j,M,N]);let I=(j-1)*r.ITEMS_PER_PAGE,D=Math.min(I+r.ITEMS_PER_PAGE,S.length),R=S.slice(I,D),E="all"!==v||null!==C.from||null!==C.to||""!==x;return(0,t.jsxs)("div",{className:"sessions-list",children:[(0,t.jsxs)("div",{className:"sessions-filter-bar",children:[(0,t.jsxs)("div",{className:"sessions-filter-row",children:[(0,t.jsx)("span",{className:"sessions-filter-label",children:"filter by"}),r.FILTER_PRESETS.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>w(e.value),className:`sessions-chip${v===e.value?" on":""}`,children:e.label},e.value))]}),(0,t.jsxs)("div",{className:"sessions-filter-row",children:[(0,t.jsx)("span",{className:"sessions-filter-label",children:"range"}),(0,t.jsx)(m.default,{id:"date-from",value:C.from,onChange:e=>P("from",e),"aria-label":"Filter from date"}),(0,t.jsx)("span",{className:"sessions-range-sep",children:"to"}),(0,t.jsx)(m.default,{id:"date-to",value:C.to,onChange:e=>P("to",e),"aria-label":"Filter to date"})]}),(0,t.jsxs)("div",{className:"sessions-filter-row",children:[(0,t.jsxs)("span",{className:"sessions-filter-label",children:[(0,t.jsx)(d.Search,{className:"sessions-filter-icon","aria-hidden":"true"}),"session id"]}),(0,t.jsx)("input",{type:"text",value:x,onChange:e=>y(e.target.value),placeholder:"paste a session uuid",className:"sessions-input","aria-label":"Filter by session ID"}),E&&(0,t.jsx)("button",{type:"button",onClick:()=>{T(),y("")},className:"sessions-chip",style:{marginLeft:"auto"},children:"clear"})]}),(0,t.jsx)("div",{className:"sessions-results-count",children:0===S.length?(0,t.jsx)(t.Fragment,{children:"// no sessions found"}):(0,t.jsxs)(t.Fragment,{children:["// showing"," ",I+1,"–",D," of ",S.length," sessions",S.length!==k.length&&(0,t.jsxs)("span",{children:[" · filtered from ",k.length]})]})})]}),(0,t.jsxs)("div",{className:"sessions-table-wrap",children:[(0,t.jsxs)("table",{className:"sessions-table",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{scope:"col",className:"sessions-th sessions-th-icon",children:(0,t.jsx)("span",{className:"sr-only",children:"Icon"})}),(0,t.jsx)("th",{scope:"col",className:"sessions-th",children:"session id"}),(0,t.jsx)("th",{scope:"col",className:"sessions-th",children:"modified"})]})}),(0,t.jsx)("tbody",{children:0===R.length?(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:3,className:"sessions-td sessions-empty",children:"// no sessions match the filter."})}):R.map(e=>(0,t.jsxs)("tr",{className:"sessions-row",children:[(0,t.jsx)("td",{className:"sessions-td sessions-td-icon",children:(0,t.jsx)(o,{className:"sessions-file-icon","aria-hidden":"true"})}),(0,t.jsxs)("td",{className:"sessions-td sessions-td-name",children:[e.sessionId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.default,{href:`/project/${encodeURIComponent(g)}/session/${encodeURIComponent(e.sessionId)}`,className:"sessions-link",children:e.name.replace(/\.jsonl$/,"")}),(0,t.jsx)(h.CopyButton,{text:e.sessionId})]}):(0,t.jsx)("span",{className:"sessions-link","aria-disabled":"true",children:e.name.replace(/\.jsonl$/,"")}),e.cli&&(0,t.jsx)(p.CliBadge,{cli:e.cli}),(e.userId||e.channelId)&&(0,t.jsxs)("div",{style:{fontSize:"0.7rem",opacity:.6,marginTop:"0.15rem",display:"flex",gap:"0.6rem",flexWrap:"wrap"},children:[e.userId&&(0,t.jsxs)("span",{title:"Gateway user",children:["user ",e.userId]}),e.channelId&&(0,t.jsxs)("span",{title:"Channel",children:[e.channelType??"channel"," ",e.channelId]})]})]}),(0,t.jsx)("td",{className:"sessions-td sessions-td-date",children:e.lastModifiedFormatted||(0,a.formatDate)(e.lastModified)})]},e.path))})]}),S.length>0&&(0,t.jsx)(u.default,{currentPage:j,totalPages:M,onPageChange:N})]})]})}],73294)}]);