failproofai 0.0.12 → 0.0.13-beta.1

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 (203) hide show
  1. package/.next/standalone/.cursor/hooks.json +6 -6
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  12. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  13. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  14. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  15. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  16. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  23. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  24. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  25. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  26. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  27. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  28. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  29. package/.next/standalone/.next/server/app/api/audit/invite/route.js +2 -2
  30. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/audit/run/route.js +3 -2
  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 +1 -1
  34. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +2 -2
  36. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/auth/logout/route.js +2 -2
  38. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/auth/reminder/route.js +2 -2
  40. package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/auth/status/route.js +2 -2
  42. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +1 -1
  44. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  46. package/.next/standalone/.next/server/app/audit/page.js +1 -1
  47. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/index.html +1 -1
  50. package/.next/standalone/.next/server/app/index.rsc +15 -15
  51. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  52. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  53. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  54. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  55. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  56. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  57. package/.next/standalone/.next/server/app/page.js +1 -1
  58. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  61. package/.next/standalone/.next/server/app/policies/page.js +2 -2
  62. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  65. package/.next/standalone/.next/server/app/project/[name]/page.js +3 -2
  66. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  69. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  70. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +3 -2
  71. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  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 +2 -2
  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/chunks/[root-of-the-server]__0_0xu5z._.js +1 -1
  78. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cefjd9._.js +3 -0
  79. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ekj92q._.js +3 -0
  80. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0hv08mx._.js +3 -0
  81. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0obaznk._.js +3 -0
  82. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xvsnvt._.js +3 -0
  83. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12v-lma._.js +3 -0
  84. package/.next/standalone/.next/server/chunks/[root-of-the-server]__136y39g._.js +3 -0
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13h8pzr._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fwl2mz._.js +3 -0
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1hkdkmz._.js +3 -0
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1i9rknc._.js +3 -0
  89. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mrihkj._.js +3 -0
  90. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1myjm-d._.js +3 -0
  91. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0cycwg6._.js → [root-of-the-server]__1tvn4wf._.js} +2 -2
  92. package/.next/standalone/.next/server/chunks/_1z062h5._.js +3 -0
  93. package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +5 -5
  94. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__015_i4t._.js +4 -0
  96. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03lv-pe._.js +4 -0
  97. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04bqvos._.js +3 -0
  98. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ntd0fz._.js → [root-of-the-server]__099afy6._.js} +2 -2
  99. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dqgs96._.js +3 -0
  100. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hdsupo._.js +4 -0
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q5rfxg._.js +3 -0
  102. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qeuy9c._.js +4 -0
  103. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qukut7._.js +4 -0
  104. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s89hoe._.js +4 -0
  105. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ehe24g._.js → [root-of-the-server]__0ynf7tx._.js} +3 -3
  106. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__170799-._.js +245 -0
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1d8omgc._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ql-mch._.js +3 -0
  109. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vh88nr._.js → [root-of-the-server]__1qlh4jx._.js} +2 -2
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1tkjqka._.js +4 -0
  111. package/.next/standalone/.next/server/chunks/ssr/_05whahf._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/_0ul5rf_._.js +3 -0
  113. package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/ssr/_11v0g3z._.js +3 -0
  115. package/.next/standalone/.next/server/chunks/ssr/_1p0-leb._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/lib_hermes-projects_ts_05b8-it._.js +3 -0
  120. package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0bppeyf.js → node_modules_html-to-image_es_index_0pv57nx.js} +1 -1
  121. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  122. package/.next/standalone/.next/server/pages/404.html +1 -1
  123. package/.next/standalone/.next/server/pages/500.html +1 -1
  124. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/server-reference-manifest.json +10 -10
  126. package/.next/standalone/.next/static/chunks/{3jk5y-qgnnti_.js → 0b6rdtcge_3ec.js} +1 -1
  127. package/.next/standalone/.next/static/chunks/{09l7dfsd4xapi.js → 0pj_6lbbjd000.js} +1 -1
  128. package/.next/standalone/.next/static/chunks/{0ys-mwok1j9kp.js → 0xnrgonfdeivm.js} +1 -1
  129. package/.next/standalone/.next/static/chunks/{00_ypuitb29l0.js → 105w_oznq-van.js} +1 -1
  130. package/.next/standalone/.next/static/chunks/{3pb3m-89k7ts2.js → 13tbm6i1swiru.js} +1 -1
  131. package/.next/standalone/.next/static/chunks/{36yb_gsfgfga4.js → 1fhuj4fjovzp5.js} +1 -1
  132. package/.next/standalone/.next/static/chunks/209ful1jrphvy.js +1 -0
  133. package/.next/standalone/.next/static/chunks/{0qw65r3wfs089.js → 23odnajn2ltwu.js} +1 -1
  134. package/.next/standalone/.next/static/chunks/25s52un3k_wht.css +2 -0
  135. package/.next/standalone/.next/static/chunks/36r2vgi6854za.js +6 -0
  136. package/.next/standalone/.next/static/chunks/3b77kulbdbrqw.js +1 -0
  137. package/.next/standalone/.next/static/chunks/3rjg-1s5ouu5r.js +1 -0
  138. package/.next/standalone/app/components/sessions-list.tsx +19 -0
  139. package/.next/standalone/app/project/[name]/page.tsx +9 -4
  140. package/.next/standalone/app/project/[name]/session/[sessionId]/page.tsx +26 -5
  141. package/.next/standalone/assets/logos/hermes-dark.svg +1 -0
  142. package/.next/standalone/assets/logos/hermes-light.svg +1 -0
  143. package/.next/standalone/docker-hook-sync/Dockerfile +75 -0
  144. package/.next/standalone/docker-hook-sync/entrypoint.sh +109 -0
  145. package/.next/standalone/lib/cli-registry.ts +6 -1
  146. package/.next/standalone/lib/download-session.ts +16 -0
  147. package/.next/standalone/lib/hermes-projects.ts +164 -0
  148. package/.next/standalone/lib/hermes-sessions.ts +273 -0
  149. package/.next/standalone/lib/projects.ts +14 -3
  150. package/.next/standalone/lib/sqlite-reader.ts +102 -0
  151. package/.next/standalone/package.json +5 -3
  152. package/.next/standalone/server.js +1 -1
  153. package/README.md +10 -1
  154. package/bin/failproofai.mjs +17 -16
  155. package/dist/cli.mjs +7779 -229
  156. package/lib/cli-registry.ts +6 -1
  157. package/lib/download-session.ts +16 -0
  158. package/lib/hermes-projects.ts +164 -0
  159. package/lib/hermes-sessions.ts +273 -0
  160. package/lib/projects.ts +14 -3
  161. package/lib/sql-js-asm.d.ts +26 -0
  162. package/lib/sqlite-reader.ts +102 -0
  163. package/package.json +5 -3
  164. package/scripts/sync-agent-cli-harnesses-prompt.md +222 -0
  165. package/src/audit/cli-adapters/hermes.ts +58 -0
  166. package/src/audit/cli-adapters/index.ts +6 -0
  167. package/src/hooks/handler.ts +8 -0
  168. package/src/hooks/install-prompt.ts +7 -3
  169. package/src/hooks/integrations.ts +191 -10
  170. package/src/hooks/policy-evaluator.ts +42 -0
  171. package/src/hooks/resolve-transcript-path.ts +4 -0
  172. package/src/hooks/tool-name-canonicalize.ts +6 -0
  173. package/src/hooks/types.ts +107 -1
  174. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dwpg-h._.js +0 -3
  175. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lnenda._.js +0 -3
  176. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13i_sva._.js +0 -3
  177. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1_mqemn._.js +0 -3
  178. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1m2_4t0._.js +0 -3
  179. package/.next/standalone/.next/server/chunks/node_modules_0-tu4ot._.js +0 -3
  180. package/.next/standalone/.next/server/chunks/node_modules_0ttxbz7._.js +0 -3
  181. package/.next/standalone/.next/server/chunks/node_modules_1bnh1y0._.js +0 -3
  182. package/.next/standalone/.next/server/chunks/node_modules_1epycqa._.js +0 -3
  183. package/.next/standalone/.next/server/chunks/node_modules_1wpdcgo._.js +0 -3
  184. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0808sha._.js +0 -4
  185. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e4-6d8._.js +0 -4
  186. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0f62vu9._.js +0 -3
  187. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g253ve._.js +0 -4
  188. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k65l27._.js +0 -3
  189. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vxf0_g._.js +0 -4
  190. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12mcauo._.js +0 -4
  191. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1e-x7j4._.js +0 -3
  192. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mt35_w._.js +0 -221
  193. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pcxxwg._.js +0 -4
  194. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1uvfwgr._.js +0 -4
  195. package/.next/standalone/.next/static/chunks/0f7d7hnbh4djs.js +0 -1
  196. package/.next/standalone/.next/static/chunks/1o0xa47736gi9.css +0 -2
  197. package/.next/standalone/.next/static/chunks/2ey-m4-p9z7e0.js +0 -6
  198. package/.next/standalone/.next/static/chunks/2wbuxnsvux4di.js +0 -1
  199. package/.next/standalone/.next/static/chunks/3-veva26100-4.js +0 -1
  200. package/scripts/sync-hook-events-prompt.md +0 -179
  201. /package/.next/standalone/.next/static/{PdZTBvCBXzDRLe-duL9yC → 31ZoDDYKHEIN_TrgKv85t}/_buildManifest.js +0 -0
  202. /package/.next/standalone/.next/static/{PdZTBvCBXzDRLe-duL9yC → 31ZoDDYKHEIN_TrgKv85t}/_clientMiddlewareManifest.js +0 -0
  203. /package/.next/standalone/.next/static/{PdZTBvCBXzDRLe-duL9yC → 31ZoDDYKHEIN_TrgKv85t}/_ssgManifest.js +0 -0
@@ -1,6 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,64245,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(74080),n=e.i(22016),a=e.i(84026),l=e.i(29407),i=e.i(16306),o=e.i(82954),c=e.i(16327),d=e.i(8734),m=e.i(89664),x=e.i(66794);let u=(0,e.i(56420).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var p=e.i(63676),h=e.i(73520),g=e.i(95187);let f=(0,g.createServerReference)("40ca1217fd00a1a91470fe9bc39c6bc79f7f644f1b",g.callServer,void 0,g.findSourceMapURL,"getHookActivityAction");var b=e.i(16726);let j=(0,g.createServerReference)("002e4b4804211049eabce98a33d5e504c8e3a8636b",g.callServer,void 0,g.findSourceMapURL,"getHooksConfigAction"),v=(0,g.createServerReference)("60453f7538b03688cace67614381baad062b620c98",g.callServer,void 0,g.findSourceMapURL,"togglePolicyAction"),y=(0,g.createServerReference)("60861e402f06d29bd857cb0243561a2c554f0e636a",g.callServer,void 0,g.findSourceMapURL,"installHooksWebAction"),N=(0,g.createServerReference)("601c938feb9edadded683c2a66b8400e9c6f9c2fc2",g.callServer,void 0,g.findSourceMapURL,"removeHooksWebAction"),w=(0,g.createServerReference)("60ac4dc6ef6acb23cd468a3b1b5630435206cbf98f",g.callServer,void 0,g.findSourceMapURL,"updatePolicyParamsAction");var k=e.i(85881),S=e.i(12344),C=e.i(80060),_=e.i(2711),P=e.i(24578),I=e.i(34713),T=e.i(67881);function $({sessionId:e,transcriptPath:s,integration:r,cwd:a}){if(!e)return(0,t.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let l=e?e.slice(0,8):"—",i="codex"===r||(s?.includes("/.codex/")??!1),o="copilot"===r||(s?.includes("/.copilot/session-state/")??!1),c="cursor"===r||(s?.includes("/.cursor/")??!1),d="opencode"===r||(s?.includes("/.local/share/opencode/")??!1)||(s?.includes("/.opencode/")??!1),m="pi"===r||(s?.includes("/.pi/")??!1),x="gemini"===r||(s?.includes("/.gemini/")??!1);if(i||o||c||d||m||x){let s,r=a?(s=/^([A-Za-z]):[\\/](.*)$/.exec(a))?s[1]+"--"+s[2].replace(/[\\/]/g,"-"):a.replace(/[\\/]/g,"-"):i?"codex":o?"copilot":c?"cursor":d?"opencode":m?"pi":"gemini";return(0,t.jsx)(n.default,{href:`/project/${encodeURIComponent(r)}/session/${encodeURIComponent(e)}`,className:"text-primary hover:underline font-mono",onClick:e=>e.stopPropagation(),children:l})}let u=s?function(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);if(t.length<2)return null;let s=t[t.length-2];return!s||s.startsWith(".")?null:s}(s):null;return u?(0,t.jsx)(n.default,{href:`/project/${encodeURIComponent(u)}/session/${encodeURIComponent(e)}`,className:"text-primary hover:underline font-mono",onClick:e=>e.stopPropagation(),children:l}):(0,t.jsx)("span",{className:"text-muted-foreground font-mono",children:l})}function A({decision:e}){return"deny"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,t.jsx)(l.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,t.jsx)(i.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,t.jsx)(a.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function R({eventType:e}){return(0,t.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function L({integration:e}){if(!e)return null;let s=(0,P.getCliLabel)(e),r=(0,P.getCliBadgeClasses)(e);return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${r}`,title:`Agent CLI: ${s}`,children:s})}function E({mode:e}){let s="default"===e;return(0,t.jsx)("span",{title:e,className:`inline-block max-w-full truncate rounded px-1.5 py-0.5 align-middle text-[0.6rem] font-medium border ${s?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function U({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function z({text:e,field:r}){let[n,a]=(0,s.useState)(!1),{capture:l}=(0,S.usePostHog)(),i=async t=>{t.stopPropagation(),l("activity_copy_clicked",{field:r??"unknown"});try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),a(!0),setTimeout(()=>a(!1),1500)}};return(0,t.jsx)("button",{onClick:i,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:n?(0,t.jsx)(m.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(d.Copy,{className:"h-3 w-3"})})}function F({value:e,onChange:s}){return(0,t.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(r=>(0,t.jsx)("button",{onClick:()=>s(r.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===r.value?"deny"===r.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===r.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===r.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.label},r.value))})}function D({stats:e}){let s=e.totalEvents>0?e.denyCount/e.totalEvents*100:0,r=s.toFixed(s>=10?0:1),n=0===e.denyCount?"":s>=5?" is-deny":s>=2?" is-warn":"";return(0,t.jsxs)("div",{className:"stat-bar",role:"group","aria-label":"Activity stats",children:[(0,t.jsxs)("div",{className:"stat-cell",children:[(0,t.jsx)("span",{className:"eyebrow",children:"total events"}),(0,t.jsx)("span",{className:"value",children:e.totalEvents.toLocaleString()}),(0,t.jsx)("span",{className:"meta",children:"across all installed agents"})]}),(0,t.jsxs)("div",{className:"stat-cell",children:[(0,t.jsx)("span",{className:"eyebrow",children:"deny rate"}),(0,t.jsxs)("span",{className:`value${n}`,children:[r,"%"]}),(0,t.jsxs)("span",{className:"meta",children:[e.denyCount.toLocaleString()," of ",e.totalEvents.toLocaleString()," denied"]})]}),(0,t.jsxs)("div",{className:"stat-cell",children:[(0,t.jsx)("span",{className:"eyebrow",children:"top policy"}),(0,t.jsx)("span",{className:"value",style:{fontSize:16,fontWeight:500,color:e.topPolicy?"var(--accent-pink)":"var(--dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.topPolicy??void 0,children:e.topPolicy??"—"}),(0,t.jsx)("span",{className:"meta",children:"most-evaluated policy in scope"})]})]})}function O({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:11,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"activity-detail animate-expand text-xs",children:[(0,t.jsxs)("span",{className:"activity-detail-eyebrow",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\\u25be"}),"event detail"]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(z,{text:e.sessionId,field:"session_id"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(z,{text:e.cwd,field:"cwd"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"}),e.transcriptPath?.startsWith("opencode-db://")&&(0,t.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function B({hooksInstalled:e,onSwitchTab:r}){let{intervalSec:n}=(0,k.useAutoRefresh)(),{capture:a}=(0,S.usePostHog)(),l=(0,C.useUrlParams)(),i=(0,s.useRef)(!1),[d,m]=(0,s.useState)(()=>(0,_.paramToPage)(l.get("page"))),[x,u]=(0,s.useState)(null),[p,g]=(0,s.useState)(null),[j,v]=(0,s.useState)(()=>{let e=l.get("decision");return"allow"===e||"deny"===e||"instruct"===e?e:""}),[y,N]=(0,s.useState)(()=>l.get("event")??""),[w,T]=(0,s.useState)(()=>l.get("policy")??""),[z,W]=(0,s.useState)(()=>l.get("session")??""),[H,M]=(0,s.useState)(()=>{let e=l.get("cli");return(0,P.isKnownCli)(e)?e:""}),X=(0,s.useRef)(null),J=(0,s.useRef)(!0),K=(0,s.useRef)({filterDecision:j,filterEventType:y,filterPolicy:w,filterSessionId:z,filterCli:H});K.current={filterDecision:j,filterEventType:y,filterPolicy:w,filterSessionId:z,filterCli:H},(0,s.useEffect)(()=>{if(!i.current){i.current=!0;return}l.setAll({decision:j||void 0,event:y||void 0,policy:w||void 0,session:z||void 0,cli:H||void 0,page:(0,_.pageToParam)(d)})},[j,y,w,z,H,d]);let q=""!==j||""!==y||""!==w||""!==z||""!==H,G=(0,s.useCallback)(async e=>{try{let t,{filterDecision:s,filterEventType:r,filterPolicy:n,filterSessionId:a,filterCli:l}=K.current;t=""!==s||""!==r||""!==n||""!==a||""!==l?await (0,b.searchHookActivityAction)({decision:s||void 0,eventType:r||void 0,policyName:n||void 0,sessionId:a||void 0,integration:l||void 0},e):await f(e),u(t)}catch{}},[]);(0,s.useEffect)(()=>{G(d);let e=setInterval(()=>G(d),n>0?1e3*n:5e3);return()=>clearInterval(e)},[d,G,n]),(0,s.useEffect)(()=>(X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{if(m(1),g(null),G(1),J.current){J.current=!1;return}a("activity_filter_changed",{active_filter_count:+(""!==j)+ +(""!==y)+ +(""!==w)+ +(""!==z)+ +(""!==H),has_decision:""!==j,has_event_type:""!==y,has_policy:""!==w,has_session:""!==z,has_cli:""!==H,decision:j||null,event_type:y||null,cli:H||null})},300),()=>{X.current&&clearTimeout(X.current)}),[j,y,w,z,H]);let V=x?.entries??[],Z=x?.totalPages??1;return(0,t.jsxs)(t.Fragment,{children:[x?.stats&&x.stats.totalEvents>0&&(0,t.jsx)("div",{style:{marginBottom:18},children:(0,t.jsx)(D,{stats:x.stats})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"filter-bar",children:[(0,t.jsxs)("div",{className:"filter-group",children:[(0,t.jsx)("span",{className:"filter-label",children:"decision"}),(0,t.jsx)(F,{value:j,onChange:v})]}),(0,t.jsxs)("div",{className:"filter-group",children:[(0,t.jsx)("span",{className:"filter-label",children:"event"}),(0,t.jsxs)("select",{value:y,onChange:e=>N(e.target.value),className:"filter-input",children:[(0,t.jsx)("option",{value:"",children:"all events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]})]}),(0,t.jsxs)("div",{className:"filter-group",children:[(0,t.jsx)("span",{className:"filter-label",children:"cli"}),(0,t.jsxs)("select",{value:H,onChange:e=>{let t=e.target.value;M(""===t||(0,P.isKnownCli)(t)?t:"")},className:"filter-input","aria-label":"Filter by CLI",children:[(0,t.jsx)("option",{value:"",children:"all clis"}),P.KNOWN_CLI_IDS.map(e=>(0,t.jsx)("option",{value:e,children:(0,P.getCliLabel)(e)},e))]})]}),(0,t.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,t.jsx)("span",{className:"filter-label",children:"policy"}),(0,t.jsx)("input",{type:"text",value:w,onChange:e=>T(e.target.value),placeholder:"filter by policy\\u2026",className:"filter-input"})]}),(0,t.jsxs)("div",{className:"filter-group filter-group--grow",children:[(0,t.jsx)("span",{className:"filter-label",children:"session"}),(0,t.jsx)("input",{type:"text",value:z,onChange:e=>W(e.target.value),placeholder:"filter by session…",className:"filter-input"})]}),q&&(0,t.jsx)("button",{type:"button",className:"filter-clear",onClick:()=>{v(""),N(""),M(""),T(""),W("")},"aria-label":"Clear all filters",children:"[ clear ]"})]}),0===V.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,t.jsx)(o.Shield,{className:"h-12 w-12 text-muted-foreground/30"}),!1===e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,t.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>r?.("policies"),children:"Policies tab"})," ","and click ",(0,t.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:q?"No matching activity.":"Waiting for hook events…"})]}):(0,t.jsx)("div",{className:"overflow-x-auto activity-table-wrap",children:(0,t.jsxs)("table",{className:"w-full text-xs activity-table",style:{tableLayout:"fixed"},children:[(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{style:{width:32}}),(0,t.jsx)("col",{style:{width:"7%"}}),(0,t.jsx)("col",{style:{width:"9%"}}),(0,t.jsx)("col",{style:{width:"12%"}}),(0,t.jsx)("col",{style:{width:"11%"}}),(0,t.jsx)("col",{style:{width:"9%"}}),(0,t.jsx)("col",{style:{width:"13%"}}),(0,t.jsx)("col",{style:{width:"12%"}}),(0,t.jsx)("col",{style:{width:"11%"}}),(0,t.jsx)("col",{style:{width:"8%"}}),(0,t.jsx)("col",{style:{width:"8%"}})]}),(0,t.jsx)("thead",{className:"activity-thead",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-4 py-3"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Time"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"CLI"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-3 activity-th",children:"Session"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:V.map((e,r)=>{let n="deny"===e.decision,l=p===r,i="instruct"===e.decision;return(0,t.jsxs)(s.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{g(e=>{let t=e===r?null:r,s=V[r];return a("activity_row_toggled",{expanded:null!==t,decision:s?.decision??null,policy_name:s?.policyName??null,event_type:s?.eventType??null}),t})},className:`activity-data-row cursor-pointer transition-colors ${n?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":r%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${l?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(c.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${l?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,I.formatRelativeTime)(e.timestamp)}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(A,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(R,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(L,{integration:e.integration})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,t.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,t.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(E,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(U,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",title:e.sessionId??"",children:(0,t.jsx)($,{sessionId:e.sessionId,transcriptPath:e.transcriptPath,integration:e.integration,cwd:e.cwd})})]}),l&&(0,t.jsx)(O,{item:e})]},`${e.timestamp}-${r}`)})})]})}),(0,t.jsx)(h.default,{currentPage:d,totalPages:Z,onPageChange:e=>{a("activity_pagination_changed",{from_page:d,to_page:e,total_pages:Z}),m(e),g(null)}})]})]})}function W({enabled:e,onChange:s,disabled:r}){return(0,t.jsx)("button",{onClick:s,disabled:r,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${e?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":e?"Disable policy":"Enable policy",children:(0,t.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${e?"translate-x-3.5":"translate-x-0.5"}`})})}function H({policy:e,onClose:r,onSave:n}){let a=e.params??{},l=e.currentParams??{},[i,o]=(0,s.useState)(()=>{let e={};for(let[t,s]of Object.entries(a)){let r=t in l?l[t]:s.default;e[t]=r}return e});(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&r()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r]);let c=(e,t)=>{o(s=>({...s,[e]:t}))};return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:e=>{e.target===e.currentTarget&&r()},children:(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description})]}),(0,t.jsx)("button",{onClick:r,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(p.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(a).map(([e,s])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:e}),(0,t.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:s.description}),((e,s)=>{let r=i[e];if("boolean"===s.type)return(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:!!r,onChange:t=>c(e,t.target.checked),className:"rounded border-border"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:s.description})]});if("number"===s.type)return(0,t.jsx)("input",{type:"number",value:"number"==typeof r?r:"",onChange:t=>c(e,Number(t.target.value)),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"});if("string[]"===s.type){let s=Array.isArray(r)?r.join("\n"):"";return(0,t.jsx)("textarea",{value:s,onChange:t=>c(e,t.target.value.split("\n").filter(e=>""!==e.trim())),rows:4,placeholder:"One entry per line",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-2 focus:ring-primary/40 resize-y"})}if("pattern[]"===s.type){let s=Array.isArray(r)?r:[];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[s.map((r,n)=>(0,t.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,t.jsx)("input",{type:"text",value:r.regex,onChange:t=>{let r=[...s];r[n]={...r[n],regex:t.target.value},c(e,r)},placeholder:"regex",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,t.jsx)("input",{type:"text",value:r.label,onChange:t=>{let r=[...s];r[n]={...r[n],label:t.target.value},c(e,r)},placeholder:"label",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,t.jsx)("button",{onClick:()=>c(e,s.filter((e,t)=>t!==n)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,t.jsx)(p.X,{className:"h-3.5 w-3.5"})})]},n)),(0,t.jsx)("button",{onClick:()=>c(e,[...s,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,t.jsx)("input",{type:"text",value:"string"==typeof r?r:"",onChange:t=>c(e,t.target.value),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"})})(e,s)]},e))}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,t.jsx)(T.Button,{variant:"outline",size:"sm",onClick:r,className:"h-7 text-xs",children:"Cancel"}),(0,t.jsx)(T.Button,{size:"sm",onClick:()=>n(i),className:"h-7 text-xs",children:"Save"})]})]})})}function M({message:e,onDismiss:s,onInstall:n,isPending:a}){let{capture:l}=(0,S.usePostHog)();return(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,t.jsx)("style",{children:`
2
- @keyframes slideInFromRight {
3
- from { transform: translateX(calc(100% + 1rem)); opacity: 0; }
4
- to { transform: translateX(0); opacity: 1; }
5
- }
6
- `}),(0,t.jsxs)("div",{className:"rounded-lg border border-red-500/40 bg-red-950/95 shadow-2xl shadow-red-900/40 overflow-hidden backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"h-0.5 w-full bg-gradient-to-r from-red-600 via-red-400 to-red-600"}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"shrink-0 mt-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 ring-2 ring-red-500/30",children:(0,t.jsx)(p.X,{className:"h-3 w-3 text-white",strokeWidth:3})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-[0.65rem] font-bold uppercase tracking-widest text-red-400 mb-0.5",children:"Error"}),(0,t.jsx)("p",{className:"text-sm text-red-100 leading-snug",children:e})]}),(0,t.jsx)("button",{onClick:s,className:"shrink-0 -mt-0.5 -mr-0.5 rounded p-0.5 text-red-400/60 transition-colors hover:bg-red-500/20 hover:text-red-200","aria-label":"Dismiss",children:(0,t.jsx)(p.X,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)(T.Button,{size:"sm",onClick:()=>{l("hooks_install_from_error_clicked",{error_message:e.slice(0,200)}),s(),n()},disabled:a,className:"h-7 flex-1 border-0 bg-red-500 px-3 text-xs font-semibold text-white hover:bg-red-400 disabled:opacity-50",children:"Install hooks"}),(0,t.jsx)(T.Button,{variant:"ghost",size:"sm",onClick:s,className:"h-7 px-3 text-xs text-red-400 hover:bg-red-500/10 hover:text-red-200",children:"Dismiss"})]})]})]})]}),document.body)}function X({onHooksInstallChange:e}){let[r,n]=(0,s.useState)(null),[a,l]=(0,s.useTransition)(),[i,c]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),[g,f]=(0,s.useState)(()=>new Set),b=(0,s.useRef)(!1),{capture:k}=(0,S.usePostHog)(),C=(0,s.useCallback)((e,t)=>{k("action_error_displayed",{error_type:e,error_message:t.slice(0,200)}),c(t)},[k]),_=(0,s.useCallback)(async()=>{try{let t=await j();n(t),e?.(t.clis.some(e=>e.installed))}catch{}},[e]);(0,s.useEffect)(()=>{_()},[_]),(0,s.useEffect)(()=>{r&&(b.current?f(new Set(r.clis.filter(e=>e.installed).map(e=>e.id))):(b.current=!0,f(new Set(r.clis.filter(e=>e.installed||e.detected).map(e=>e.id)))))},[r?.clis]);let I=(0,s.useMemo)(()=>new Set((r?.clis??[]).filter(e=>e.installed).map(e=>e.id)),[r?.clis]),$=(0,s.useMemo)(()=>{let e=[],t=[];for(let s of r?.clis??[]){let r=g.has(s.id);r&&!I.has(s.id)&&e.push(s.id),!r&&I.has(s.id)&&t.push(s.id)}return{toInstall:e,toRemove:t}},[r?.clis,g,I]),A=$.toInstall.length>0||$.toRemove.length>0,R=()=>{let{toInstall:e,toRemove:t}=$;(0!==e.length||0!==t.length)&&(k("cli_install_remove_submitted",{to_install:e,to_remove:t,count_install:e.length,count_remove:t.length}),l(async()=>{try{c(null),e.length>0&&await y("user",e),t.length>0&&await N("user",t)}catch(e){C("cli_apply",e instanceof Error?e.message:"Failed to apply changes.")}finally{await _()}}))};if(!r)return(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})});let L=r.clis.some(e=>e.installed),E=I.size,U=g.size,z=Array.from(new Set(r.policies.map(e=>e.category)));return(0,t.jsxs)(t.Fragment,{children:[p&&(0,t.jsx)(H,{policy:p,onClose:()=>{k("policy_config_modal_closed",{policy_name:p.name,action:"cancel"}),h(null)},onSave:e=>{if(!p)return;let t=p.name;h(null),l(async()=>{try{c(null),await w(t,e),await _()}catch(e){C("param_update",e instanceof Error?e.message:"Failed to save configuration.")}})}}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 px-5 py-3.5 border-b border-border/60 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full transition-shadow ${L?"bg-emerald-400 shadow-[0_0_8px_rgba(52,211,153,0.6)]":"bg-muted-foreground/40"}`,"aria-hidden":!0}),(0,t.jsx)("span",{className:"text-[0.65rem] uppercase tracking-[0.2em] font-mono text-foreground/90",children:"Integrations"})]}),(0,t.jsx)("span",{className:"text-[0.65rem] font-mono text-muted-foreground/40",children:"·"}),(0,t.jsxs)("div",{className:"text-[0.65rem] uppercase tracking-[0.2em] font-mono text-muted-foreground",children:[(0,t.jsx)("span",{className:"text-foreground tabular-nums",children:E.toString().padStart(2,"0")}),(0,t.jsxs)("span",{className:"opacity-50",children:[" / 0",r.clis.length," active"]})]}),A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-[0.65rem] font-mono text-muted-foreground/40",children:"·"}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[0.65rem] uppercase tracking-[0.2em] font-mono text-pink-400",children:[(0,t.jsx)("span",{className:"h-1 w-1 rounded-full bg-pink-400 animate-pulse"}),$.toInstall.length+$.toRemove.length," pending"]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsx)(T.Button,{variant:"outline",size:"sm",onClick:()=>{let e=Array.from(I).filter(e=>g.has(e));0!==e.length&&(k("cli_reinstall_submitted",{cli_ids:e,count:e.length}),l(async()=>{try{c(null),await y("user",e)}catch(e){C("cli_reinstall",e instanceof Error?e.message:"Failed to reinstall.")}finally{await _()}}))},disabled:a||0===U,className:"text-xs h-7 px-3 font-mono",children:"Reinstall"}),(0,t.jsx)(T.Button,{variant:"default",size:"sm",onClick:R,disabled:a||!A,className:"text-xs h-7 px-3 font-mono",children:"Apply changes"})]})]}),(0,t.jsx)("div",{className:"divide-y divide-border/30 border-b border-border/60",children:r.clis.map((e,s)=>{let n=g.has(e.id),l=I.has(e.id),i=n!==l,o=(0,P.getCliBadgeClasses)(e.id),c=o.split(" ").find(e=>e.startsWith("text-"))??"text-foreground";return(0,t.jsxs)("label",{className:`group relative flex items-center gap-3 pl-6 pr-5 py-3 cursor-pointer transition-colors hover:bg-muted/15 ${i?"bg-pink-500/[0.04]":""}`,children:[(0,t.jsx)("div",{className:`absolute left-0 top-0 bottom-0 w-[3px] ${c} bg-current transition-opacity ${n?"opacity-100":"opacity-25 group-hover:opacity-60"}`,"aria-hidden":!0}),(0,t.jsx)("div",{className:"font-mono text-[0.65rem] text-muted-foreground/40 tabular-nums w-6 select-none",children:(s+1).toString().padStart(2,"0")}),(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)("input",{type:"checkbox",checked:n,onChange:()=>{var t;return t=e.id,void f(e=>{let s=new Set(e),n=!s.has(t);n?s.add(t):s.delete(t);let a=r?.clis.find(e=>e.id===t);return k("cli_selection_toggled",{cli_id:t,checked:n,current_state:a?.installed?"installed":a?.detected?"detected":"inactive"}),s})},disabled:a,className:"sr-only peer","aria-label":`Toggle ${e.label}`}),(0,t.jsx)("div",{className:`h-[18px] w-[18px] rounded-sm border transition-all peer-focus-visible:ring-2 peer-focus-visible:ring-primary/40 ${n?"bg-primary border-primary":"bg-background/50 border-border group-hover:border-foreground/40"}`,children:n&&(0,t.jsx)("svg",{viewBox:"0 0 18 18",className:"h-full w-full text-primary-foreground",fill:"none","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M4 9.5L7.5 12.5L14 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,t.jsx)("div",{className:"min-w-[150px] shrink-0",children:(0,t.jsx)("div",{className:"text-sm font-medium text-foreground",children:e.label})}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[l?(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border ${o}`,children:[(0,t.jsx)("span",{className:"h-1 w-1 rounded-full bg-current shadow-[0_0_4px_currentColor]"}),"Active"]}):e.detected?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-border/60 text-muted-foreground/80 bg-muted/20",children:[(0,t.jsx)("span",{className:"h-1 w-1 rounded-full bg-current opacity-60"}),"Detected"]}):(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-border/30 text-muted-foreground/40",children:"Inactive"}),i&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-sm text-[0.6rem] uppercase tracking-[0.15em] font-mono border border-pink-500/40 text-pink-400 bg-pink-500/10",children:n?"+ install":"− remove"})]}),(0,t.jsx)("div",{className:"ml-auto hidden lg:block text-[0.7rem] font-mono text-muted-foreground/50 truncate max-w-[420px] group-hover:text-muted-foreground/80 transition-colors",title:e.settingsPath,children:e.settingsPath})]},e.id)})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 bg-muted/5",children:[(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:r.enabledPolicies.length})," / ",r.policies.length+(r.customPolicies?.length??0)," ","policies enabled"]}),L&&(0,t.jsxs)("span",{className:"text-[0.65rem] text-muted-foreground/60",children:["· shared across ",E," active CLI",1===E?"":"s"]})]}),i&&(0,t.jsx)("div",{className:"px-4 py-2 bg-red-500/10 border-b border-red-500/20 text-xs text-red-400",children:i}),d&&(0,t.jsx)(M,{message:d,onDismiss:()=>m(null),onInstall:R,isPending:a}),z.map(e=>{let s=r.policies.filter(t=>t.category===e),i=s.filter(e=>e.enabled).length;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:e}),(0,t.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[i," / ",s.length," enabled"]})]}),s.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,t.jsx)(W,{enabled:e.enabled,onChange:()=>{var t,s;return t=e.name,s=e.enabled,void(!r||(!r.clis.some(e=>e.installed)?m("Policies are not installed. Install policies to continue."):(m(null),n(e=>e?{...e,policies:e.policies.map(e=>e.name===t?{...e,enabled:!s}:e),enabledPolicies:s?e.enabledPolicies.filter(e=>e!==t):[...e.enabledPolicies,t]}:e),l(async()=>{try{await v(t,!s)}catch{C("policy_toggle","Failed to save policy change."),_()}}))))},disabled:a})}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:e.name}),e.beta&&(0,t.jsx)("span",{className:"shrink-0 text-[0.6rem] px-1 py-0.5 rounded border bg-violet-500/10 text-violet-400 border-violet-500/20",children:"beta"})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:e.description}),e.eventScope&&(0,t.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:e.eventScope}),e.params&&Object.keys(e.params).length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:Object.entries(e.params).map(([s,r])=>{let n=e.currentParams?.[s]??r.default,a=JSON.stringify(n)!==JSON.stringify(r.default);return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 font-mono text-[0.6rem] px-1.5 py-0.5 rounded border ${a?"bg-primary/10 text-primary/70 border-primary/20":"bg-muted/40 text-muted-foreground/55 border-border/40"}`,children:[(0,t.jsxs)("span",{className:"opacity-70",children:[s,":"]}),(0,t.jsx)("span",{children:function(e,t){if("string[]"===e||"pattern[]"===e){let s=Array.isArray(t)?t:[];return 0===s.length?"none":"pattern[]"===e?`${s.length} pattern${1!==s.length?"s":""}`:1===s.length?String(s[0]).slice(0,24):`${s.length} values`}return"boolean"===e?t?"on":"off":null==t||""===t?"—":String(t).slice(0,32)}(r.type,n)})]},s)})})]}),e.params&&Object.keys(e.params).length>0&&(0,t.jsx)("button",{className:"shrink-0 mt-0.5 text-muted-foreground hover:text-primary transition-colors",onClick:()=>{let t=Object.entries(e.params??{}).filter(([t,s])=>JSON.stringify(e.currentParams?.[t]??s.default)!==JSON.stringify(s.default)).length;k("policy_config_modal_opened",{policy_name:e.name,param_count:Object.keys(e.params??{}).length,has_customized_params:t>0,customized_count:t}),h(e)},title:"Edit parameters",children:(0,t.jsx)(x.Settings,{className:"h-3.5 w-3.5"})})]},e.name))]},e)}),r.customPoliciesPath&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:"Custom Policies"}),(0,t.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[r.customPolicies?.length??0," detected"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,t.jsx)(u,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:r.customPoliciesPath})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,t.jsx)(o.Shield,{className:"h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5"}),(0,t.jsx)("p",{className:"text-[0.7rem] text-muted-foreground/70 leading-relaxed",children:"Custom policies are always active. To add, remove, or reorder them, edit the JS file above."})]}),r.customPolicies?.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,t.jsx)("div",{className:"h-4 w-7 shrink-0 mt-0.5"}),(0,t.jsx)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:(0,t.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:e.name})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:e.description}),e.eventScope&&(0,t.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:e.eventScope})]})]},e.name))]})]})]})}function J({activeTab:e,onChange:s}){return(0,t.jsx)("div",{className:"tabs",style:{padding:0,marginBottom:24},children:[{id:"activity",label:"Activity"},{id:"policies",label:"Configure"}].map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>s(r.id),className:`tab${e===r.id?" is-active":""}`,children:r.label.toLowerCase()},r.id))})}e.s(["default",0,function({initialTab:e="activity"}){let r=(0,C.useUrlParams)(),{capture:n}=(0,S.usePostHog)(),[a,l]=(0,s.useState)(e),[i,o]=(0,s.useState)(void 0),[c,d]=(0,s.useState)(null),[m,x]=(0,s.useState)([]);(0,s.useEffect)(()=>{j().then(e=>{o(e.clis.some(e=>e.installed)),d({enabled:e.enabledPolicies.length,total:e.policies.length+(e.customPolicies?.length??0)}),x(e.clis.filter(e=>e.installed).map(e=>e.label))}).catch(()=>o(void 0))},[]);let u=0===m.length?"Policy evaluations":m.length<=3?`Policy evaluations across ${m.join(", ")}`:`Policy evaluations across ${m.length} agents`,p=e=>{e!==a&&n("policies_tab_switched",{tab:e,from_tab:a}),l(e),r.setAll({tab:"activity"===e?void 0:e})};return(0,t.jsx)("main",{className:"report",children:(0,t.jsxs)("section",{className:"section","data-screen-label":"policies",children:[(0,t.jsx)("h2",{style:{fontFamily:"var(--font-mono)",fontSize:24,fontWeight:600,letterSpacing:"-0.01em",color:"var(--ink)",margin:"0 0 16px"},children:"activity"===a?"Policies":"Configure Policies"}),"activity"===a?(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:32,flexWrap:"wrap",margin:"0 0 24px"},children:[(0,t.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:14,color:"var(--ink-2)",lineHeight:1.7,flex:"1 1 480px",minWidth:0},children:[u,c&&(0,t.jsxs)("span",{style:{color:"var(--dim)"},children:[" · ","enabled policies"," ",(0,t.jsxs)("span",{style:{color:"var(--ink)",fontVariantNumeric:"tabular-nums"},children:[c.enabled,"/",c.total]})]})]}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6,flex:"0 0 auto"},children:[(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,letterSpacing:"0.22em",textTransform:"uppercase",color:"var(--dim)"},children:"want to change which policies fire?"}),(0,t.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>p("policies"),children:"[ configure policies → ]"})]})]}):(0,t.jsx)("p",{style:{fontFamily:"var(--font-mono)",fontSize:14,color:"var(--ink-2)",lineHeight:1.7,maxWidth:720,margin:"0 0 24px"},children:"switch policies on or off across your installed agent CLIs."}),(0,t.jsx)(J,{activeTab:a,onChange:p}),"activity"===a?(0,t.jsx)(B,{hooksInstalled:i,onSwitchTab:p}):(0,t.jsx)(X,{onHooksInstallChange:o})]})})}],64245)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43418,e=>{"use strict";var t=e.i(43476),r=e.i(24578);e.s(["CliBadge",0,function({cli:e}){let a=(0,r.getCliLabel)(e),n=(0,r.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 ${n}`,title:`Agent CLI: ${a}`,children:a})}])},62706,20087,30005,66595,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,r){if("all"===t)return e;if("custom"===t){let t,a,n=r.from?((t=new Date(r.from)).setHours(0,0,0,0),t):null,l=r.to?((a=new Date(r.to)).setHours(23,59,59,999),a):null;return e.filter(e=>(!n||!(e.lastModified<n))&&(!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=[],r){let[a,n]=(0,t.useState)(r?.filterPreset??"all"),[l,s]=(0,t.useState)(r?.dateRange??{from:null,to:null}),[o,i]=(0,t.useState)(r?.currentPage??1),d=`${a}|${JSON.stringify(l)}|${JSON.stringify(e)}`,[c,u]=(0,t.useState)(d);d!==c&&(u(d),i(1));let m=(0,t.useCallback)(e=>{n(e),"custom"!==e&&s({from:null,to:null})},[]);return{filterPreset:a,dateRange:l,currentPage:o,setCurrentPage:i,handlePresetChange:m,handleDateRangeChange:(0,t.useCallback)((e,t)=>{n("custom"),s(r=>({...r,[e]:t?new Date(t):null}))},[]),clearFilters:(0,t.useCallback)(()=>{n("all"),s({from:null,to:null})},[])}}],30005);var r=e.i(56420);let a=(0,r.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],66595);var n=e.i(43476);let l=(0,r.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:r,onChange:a,"aria-label":s}){let o=null!=r?r:t?t.toISOString().split("T")[0]:"";return(0,n.jsxs)("div",{className:"relative group",children:[(0,n.jsx)("input",{type:"date",id:e,value:o,onChange:e=>a(e.target.value),"aria-label":s,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,n.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 r=document.getElementById(e);r&&"function"==typeof r.showPicker?r.showPicker():r?.click()},children:(0,n.jsx)(l,{className:"w-4 h-4 text-primary group-hover:text-primary/80 transition-colors"})})]})}],85898)},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),r=e.i(24071),a=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:n,onPageChange:l}){if(n<=1)return null;let s=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:s(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r.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(n<=7)return Array.from({length:n},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),a=Math.min(n-1,e+1);e<=3&&(a=Math.min(5,n-1)),e>=n-2&&(r=Math.max(2,n-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=a;e++)t.push(e);return a<n-1&&t.push("ellipsis-end"),t.push(n),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>l(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>l(e+1),disabled:e===n,className:s(e===n),"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"})]})]})}])},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"},gemini:{id:"gemini",label:"Gemini CLI",badgeClasses:"bg-sky-500/10 text-sky-400 border-sky-500/20"}};e.s(["KNOWN_CLI_IDS",0,["claude","codex","copilot","cursor","opencode","pi","gemini"],"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)}])},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function a(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${a}`}function n(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[r,a,n]=e.split("-").map(Number);return new Date(r,a-1,n,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),a=(0,t.useRouter)(),n=(0,t.usePathname)(),l=(0,r.useRef)(null),s=(0,r.useCallback)(t=>e.get(t),[e]),o=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),i=(0,r.useCallback)(t=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,a]of Object.entries(t))void 0===a||""===a?r.delete(e):r.set(e,a);let l=r.toString(),s=l?`${n}?${l}`:n;a.replace(s,{scroll:!1})},150)},[e,n,a]);return(0,r.useEffect)(()=>()=>{l.current&&clearTimeout(l.current)},[]),{get:s,getAll:o,setAll:i}}],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:n(e),to:n(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},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)},45425,(e,t,r)=>{var a;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/os-browserify/"),(a={}).endianness=function(){return"LE"},a.hostname=function(){return"u">typeof location?location.hostname:""},a.loadavg=function(){return[]},a.uptime=function(){return 0},a.freemem=function(){return Number.MAX_VALUE},a.totalmem=function(){return Number.MAX_VALUE},a.cpus=function(){return[]},a.type=function(){return"Browser"},a.release=function(){return"u">typeof navigator?navigator.appVersion:""},a.networkInterfaces=a.getNetworkInterfaces=function(){return{}},a.arch=function(){return"javascript"},a.platform=function(){return"browser"},a.tmpdir=a.tmpDir=function(){return"/tmp"},a.EOL="\n",a.homedir=function(){return"/"},t.exports=a},41790,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,a="",n=0,l=-1,s=0,o=0;o<=e.length;++o){if(o<e.length)r=e.charCodeAt(o);else if(47===r)break;else r=47;if(47===r){if(l===o-1||1===s);else if(l!==o-1&&2===s){if(a.length<2||2!==n||46!==a.charCodeAt(a.length-1)||46!==a.charCodeAt(a.length-2)){if(a.length>2){var i=a.lastIndexOf("/");if(i!==a.length-1){-1===i?(a="",n=0):n=(a=a.slice(0,i)).length-1-a.lastIndexOf("/"),l=o,s=0;continue}}else if(2===a.length||1===a.length){a="",n=0,l=o,s=0;continue}}t&&(a.length>0?a+="/..":a="..",n=2)}else a.length>0?a+="/"+e.slice(l+1,o):a=e.slice(l+1,o),n=o-l-1;l=o,s=0}else 46===r&&-1!==s?++s:s=-1}return a}var a={resolve:function(){for(var e,a,n="",l=!1,s=arguments.length-1;s>=-1&&!l;s--)s>=0?a=arguments[s]:(void 0===e&&(e=""),a=e),t(a),0!==a.length&&(n=a+"/"+n,l=47===a.charCodeAt(0));if(n=r(n,!l),l)if(n.length>0)return"/"+n;else return"/";return n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var a=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!a)).length||a||(e="."),e.length>0&&n&&(e+="/"),a)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var n=arguments[r];t(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":a.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=a.resolve(e))===(r=a.resolve(r)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var l=e.length,s=l-n,o=1;o<r.length&&47===r.charCodeAt(o);++o);for(var i=r.length-o,d=s<i?s:i,c=-1,u=0;u<=d;++u){if(u===d){if(i>d){if(47===r.charCodeAt(o+u))return r.slice(o+u+1);else if(0===u)return r.slice(o+u)}else s>d&&(47===e.charCodeAt(n+u)?c=u:0===u&&(c=0));break}var m=e.charCodeAt(n+u);if(m!==r.charCodeAt(o+u))break;47===m&&(c=u)}var f="";for(u=n+c+1;u<=l;++u)(u===l||47===e.charCodeAt(u))&&(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(o+c):(o+=c,47===r.charCodeAt(o)&&++o,r.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),a=47===r,n=-1,l=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!l){n=s;break}}else l=!1;return -1===n?a?"/":".":a&&1===n?"//":e.slice(0,n)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var a,n=0,l=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var o=r.length-1,i=-1;for(a=e.length-1;a>=0;--a){var d=e.charCodeAt(a);if(47===d){if(!s){n=a+1;break}}else -1===i&&(s=!1,i=a+1),o>=0&&(d===r.charCodeAt(o)?-1==--o&&(l=a):(o=-1,l=i))}return n===l?l=i:-1===l&&(l=e.length),e.slice(n,l)}for(a=e.length-1;a>=0;--a)if(47===e.charCodeAt(a)){if(!s){n=a+1;break}}else -1===l&&(s=!1,l=a+1);return -1===l?"":e.slice(n,l)},extname:function(e){t(e);for(var r=-1,a=0,n=-1,l=!0,s=0,o=e.length-1;o>=0;--o){var i=e.charCodeAt(o);if(47===i){if(!l){a=o+1;break}continue}-1===n&&(l=!1,n=o+1),46===i?-1===r?r=o:1!==s&&(s=1):-1!==r&&(s=-1)}return -1===r||-1===n||0===s||1===s&&r===n-1&&r===a+1?"":e.slice(r,n)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,a={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return a;var n=e.charCodeAt(0),l=47===n;l?(a.root="/",r=1):r=0;for(var s=-1,o=0,i=-1,d=!0,c=e.length-1,u=0;c>=r;--c){if(47===(n=e.charCodeAt(c))){if(!d){o=c+1;break}continue}-1===i&&(d=!1,i=c+1),46===n?-1===s?s=c:1!==u&&(u=1):-1!==s&&(u=-1)}return -1===s||-1===i||0===u||1===u&&s===i-1&&s===o+1?-1!==i&&(0===o&&l?a.base=a.name=e.slice(1,i):a.base=a.name=e.slice(o,i)):(0===o&&l?(a.name=e.slice(1,s),a.base=e.slice(1,i)):(a.name=e.slice(o,s),a.base=e.slice(o,i)),a.ext=e.slice(s,i)),o>0?a.dir=e.slice(0,o-1):l&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,e.exports=a}},r={};function a(t){var n=r[t];if(void 0!==n)return n.exports;var l=r[t]={exports:{}},s=!0;try{e[t](l,l.exports,a),s=!1}finally{s&&delete r[t]}return l.exports}a.ab="/ROOT/node_modules/next/dist/compiled/path-browserify/",t.exports=a(114)}()},62481,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(43418);e.i(47167),e.i(45425),e.i(41790);var n=e.i(62706),l=e.i(20087),s=e.i(30005),o=e.i(80060),i=e.i(2711),d=e.i(24578);let c=(0,e.i(56420).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=e.i(66595),m=e.i(63676),f=e.i(22016),h=e.i(73520),g=e.i(85898);function p({date:e,formatted:r}){return(0,t.jsx)("span",{children:r||(0,n.formatDate)(e)})}e.s(["default",0,function({folders:e}){let n=(0,o.useUrlParams)(),x=(0,r.useRef)(!1),[b,v]=(0,r.useState)(()=>(0,i.paramToKeywords)(n.get("q"))),[y,C]=(0,r.useState)(""),[j,N]=(0,r.useState)(()=>{let e=n.get("cli");return(0,d.isKnownCli)(e)?e:""}),{filterPreset:w,dateRange:k,currentPage:A,setCurrentPage:P,handlePresetChange:T,handleDateRangeChange:S,clearFilters:M}=(0,s.useFilterState)(b,{filterPreset:(0,i.paramToPreset)(n.get("preset")),dateRange:(0,i.paramsToDateRange)(n.get("from"),n.get("to")),currentPage:(0,i.paramToPage)(n.get("page"))});(0,r.useEffect)(()=>{if(!x.current){x.current=!0;return}n.setAll({preset:(0,i.presetToParam)(w),...(0,i.dateRangeToParams)(k),q:(0,i.keywordsToParam)(b),page:(0,i.pageToParam)(A),cli:j||void 0})},[w,k,b,A,j]);let R=e=>{let t=e.trim();t&&!b.includes(t)&&(v([...b,t]),C(""))},D=()=>{v([]),C("")},E=(0,r.useMemo)(()=>(0,l.rehydrateDates)(e),[e]),_=(0,r.useMemo)(()=>{let e=(0,l.filterByDate)(E,w,k);return b.length>0&&(e=e.filter(e=>{let t=e.name.toLowerCase();return b.every(e=>{let r=e.trim().toLowerCase().replace(/\//g,"-");return 0===r.length||t.includes(r)})})),j&&(e=e.filter(e=>e.cli.includes(j))),e.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime())},[E,w,k,b,j]),I=Math.max(1,Math.ceil(_.length/l.ITEMS_PER_PAGE));(0,r.useEffect)(()=>{A>I&&P(I)},[A,I,P]);let L=(A-1)*l.ITEMS_PER_PAGE,O=Math.min(L+l.ITEMS_PER_PAGE,_.length),F=_.slice(L,O);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Filter by:"}),l.FILTER_PRESETS.map(e=>(0,t.jsx)("button",{onClick:()=>T(e.value),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${w===e.value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:e.label},e.value)),(0,t.jsx)("span",{className:"ml-2 text-sm font-medium text-foreground",children:"CLI:"}),(0,t.jsxs)("select",{"aria-label":"Filter by CLI",value:j,onChange:e=>{let t=e.target.value;N(""===t||(0,d.isKnownCli)(t)?t:"")},className:"px-2 py-1.5 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",children:[(0,t.jsx)("option",{value:"",children:"All CLIs"}),d.KNOWN_CLI_IDS.map(e=>(0,t.jsx)("option",{value:e,children:(0,d.getCliLabel)(e)},e))]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Search,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Search Keywords:"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"text",value:y,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),R(y))},placeholder:"Enter keyword and press Enter",className:"px-3 py-2 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-[250px]","aria-label":"Add keyword"}),(0,t.jsx)("button",{onClick:()=>R(y),className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Add keyword",children:"Add"})]}),b.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[b.map((e,r)=>(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-sm",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("button",{onClick:()=>{v(b.filter((e,t)=>t!==r))},className:"hover:text-foreground transition-colors p-0.5 rounded hover:bg-muted/80","aria-label":`Remove keyword ${e}`,children:(0,t.jsx)(m.X,{className:"w-3.5 h-3.5"})})]},r)),(0,t.jsx)("button",{onClick:D,className:"px-2 py-1.5 text-xs bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Clear all keywords",children:"Clear all"})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Custom Range:"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.default,{id:"date-from",value:k.from,onChange:e=>S("from",e),"aria-label":"Filter from date"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,t.jsx)(g.default,{id:"date-to",value:k.to,onChange:e=>S("to",e),"aria-label":"Filter to date"})]}),("all"!==w||null!==k.from||null!==k.to||b.length>0||""!==j)&&(0,t.jsx)("button",{onClick:()=>{M(),D(),N("")},className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors",children:"Clear"})]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:0===_.length?(0,t.jsx)(t.Fragment,{children:"No projects found"}):(0,t.jsxs)(t.Fragment,{children:["Showing ",L+1,"-",O," of ",_.length," projects",_.length!==E.length&&(0,t.jsxs)("span",{className:"ml-1",children:["(filtered from ",E.length," total)"]}),b.length>0&&(0,t.jsxs)("span",{className:"ml-1",children:["with ",b.length," keyword",1!==b.length?"s":""]})]})})]})}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border bg-muted/50",children:[(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground w-12",children:(0,t.jsx)("span",{className:"sr-only",children:"Icon"})}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground max-w-md",children:"Agent Root"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground hidden md:table-cell",children:"Path"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground",children:"Last Modified"})]})}),(0,t.jsx)("tbody",{children:0===F.length?(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:4,className:"px-4 py-8 text-center text-muted-foreground",children:"No projects found matching the selected filter."})}):F.map(e=>{var r;return(0,t.jsxs)("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors",children:[(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)(c,{className:"w-5 h-5 text-primary"})}),(0,t.jsx)("td",{className:"px-4 py-3 max-w-md",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(f.default,{href:`/project/${encodeURIComponent(e.name)}`,className:"font-semibold text-foreground hover:text-primary transition-colors break-words break-all inline-block max-w-full",children:(r=e.name,/^[A-Za-z]--/.test(r)?r[0]+":/"+r.slice(3).replace(/-/g,"/"):r.replace(/-/g,"/"))}),e.cli.map(e=>(0,t.jsx)(a.CliBadge,{cli:e},e))]})}),(0,t.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground hidden md:table-cell truncate max-w-md",children:e.path}),(0,t.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground",children:(0,t.jsx)(p,{date:e.lastModified,formatted:e.lastModifiedFormatted})})]},e.name)})})]})}),_.length>0&&(0,t.jsx)(h.default,{currentPage:A,totalPages:I,onPageChange:P})]})]})}],62481)}]);
@@ -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,16726,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)("6068408008ea5b7eb6e1549e857620b736a06cca6a",a.callServer,void 0,a.findSourceMapURL,"searchHookActivityAction");e.s(["searchHookActivityAction",0,r],16726)},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 i=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:i(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:i(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),i=(0,a.useCallback)(t=>e.get(t),[e]),o=(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(),i=s?`${l}?${s}`:l;r.replace(i,{scroll:!1})},150)},[e,l,r]);return(0,a.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),{get:i,getAll:o,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"},gemini:{id:"gemini",label:"Gemini CLI",badgeClasses:"bg-sky-500/10 text-sky-400 border-sky-500/20"}};e.s(["KNOWN_CLI_IDS",0,["claude","codex","copilot","cursor","opencode","pi","gemini"],"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,179 +0,0 @@
1
- You are an automated agent running in GitHub Actions to keep failproofai's hook
2
- event types in sync with the upstream documentation for **every** agent CLI we
3
- integrate with.
4
-
5
- failproofai integrates with seven agent CLIs. Each one has its own hook event
6
- surface, tracked as a separate `as const` array in `src/hooks/types.ts`:
7
-
8
- | CLI | Array constant | Casing convention | Has `*EVENT_MAP`? |
9
- |----------------|-----------------------------|-------------------|--------------------|
10
- | Claude Code | `HOOK_EVENT_TYPES` | PascalCase | no (canonical) |
11
- | OpenAI Codex | `CODEX_HOOK_EVENT_TYPES` | snake_case | yes (`CODEX_EVENT_MAP`) |
12
- | GitHub Copilot | `COPILOT_HOOK_EVENT_TYPES` | PascalCase | no |
13
- | Cursor Agent | `CURSOR_HOOK_EVENT_TYPES` | camelCase | yes (`CURSOR_EVENT_MAP`) |
14
- | OpenCode | `OPENCODE_HOOK_EVENT_TYPES` | dot.namespaced | yes (`OPENCODE_EVENT_MAP`) |
15
- | Pi | `PI_HOOK_EVENT_TYPES` | snake_case | yes (`PI_EVENT_MAP`) |
16
- | Gemini CLI | `GEMINI_HOOK_EVENT_TYPES` | PascalCase | yes (`GEMINI_EVENT_MAP`) |
17
-
18
- ## Your task
19
-
20
- ### 1. Fetch upstream docs and extract the canonical event-name list per CLI
21
-
22
- | CLI | Docs URL(s) |
23
- |-----------|------------------------------------------------------------------------------------|
24
- | Claude | https://code.claude.com/docs/en/hooks (primary, full reference table) |
25
- | | https://code.claude.com/docs/en/hooks-guide (secondary, summary table) |
26
- | Codex | https://developers.openai.com/codex/hooks |
27
- | Copilot | https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-hooks |
28
- | Cursor | https://cursor.com/docs/hooks |
29
- | OpenCode | https://opencode.ai/docs/plugins/ |
30
- | Pi | https://www.npmjs.com/package/@mariozechner/pi-coding-agent |
31
- | Gemini | https://geminicli.com/docs/hooks/ |
32
-
33
- For each CLI, use `WebFetch` on its docs URL(s) and extract the complete list of
34
- hook event-type names from the lifecycle / triggers / "Available events" table
35
- or section. Where two URLs are listed (Claude only), union the results and
36
- prefer the reference page if they disagree.
37
-
38
- **Use the upstream casing exactly as it appears in the docs.** Do not normalize:
39
- - Codex really is snake_case (`pre_tool_use`, `permission_request`, …).
40
- - Cursor really is camelCase (`preToolUse`, `beforeSubmitPrompt`, …).
41
- - OpenCode really is dot-namespaced (`tool.execute.before`, `session.idle`, …).
42
- - Pi really is snake_case (`tool_call`, `user_bash`, `session_shutdown`, …).
43
-
44
- If a docs URL returns 404, redirects to a stub, or the page does not expose a
45
- parseable event list, mark that CLI as `unverified` for this run and skip its
46
- diff. **Do not invent events. Do not guess from prior knowledge.** Pi is the
47
- most likely `unverified` candidate because its event surface is documented
48
- primarily in the package source (`@mariozechner/pi-coding-agent` on npm), and
49
- the README may not include a clean enumeration.
50
-
51
- ### 2. Read the current array values
52
-
53
- Read `src/hooks/types.ts` and extract the current value of each
54
- `*HOOK_EVENT_TYPES` array.
55
-
56
- ### 3. Diff each verified CLI
57
-
58
- For every verified CLI, compute:
59
- - **added**: events in upstream docs but NOT in the array
60
- - **removed**: events in the array but NOT in upstream docs
61
-
62
- ### 4. If no verified CLI has drift
63
-
64
- Write the following JSON to `.sync-hook-events-output.json` in the repo root:
65
- ```json
66
- { "changed": false }
67
- ```
68
- Then stop. (`unverified` alone is NOT drift — the docs may simply be unreachable
69
- today.)
70
-
71
- ### 5. If one or more verified CLIs have drift
72
-
73
- #### a. Update arrays in `src/hooks/types.ts`
74
-
75
- For each CLI with drift:
76
- - **Append additions** just before `] as const`, preserving casing.
77
- - **Delete removals** from the array. If the CLI has an `*EVENT_MAP` (see the
78
- table at the top), also delete the same key from that map block — TypeScript's
79
- `Record<XxxHookEventType, HookEventType>` is exhaustive, and a stale key would
80
- fail the build.
81
-
82
- #### b. Update hardcoded test counts (only two CLIs need this)
83
-
84
- Other CLIs reference `*HOOK_EVENT_TYPES.length` directly in tests, so no
85
- hardcoded-count fixup is needed for them.
86
-
87
- - If `HOOK_EVENT_TYPES` (Claude) changed: in `__tests__/hooks/manager.test.ts`,
88
- update the test description string `installs hooks for all <N> event types`
89
- AND both `expect(Object.keys(written.hooks)).toHaveLength(<N>)` assertions to
90
- the new total.
91
- - If `GEMINI_HOOK_EVENT_TYPES` changed: in `__tests__/hooks/integrations.test.ts`,
92
- update the `expect(gemini.eventTypes).toHaveLength(<N>)` assertion AND the test
93
- description string `writeHookEntries writes the matcher-wrapper schema for all
94
- <N> events with matcher='*'`.
95
-
96
- Locate these by searching for the current count number.
97
-
98
- #### c. Do NOT add `*EVENT_MAP` entries for newly-added events
99
-
100
- Each new agent-side event needs a canonical Claude PascalCase mapping that
101
- requires human judgement (e.g. "is this a `PreToolUse`-class event? a
102
- `SessionStart`? a passthrough no-op?"). For Codex, Cursor, OpenCode, Pi, and
103
- Gemini drift, **leave the corresponding `*EVENT_MAP` untouched**. The
104
- TypeScript build will fail with `Property '<event>' is missing in type
105
- Record<...>` and the `<MAP> keys exactly match` test will fail — both are
106
- intentional and surfaced in the PR body. The reviewer adds the map entries,
107
- pushes a fixup commit, and CI goes green before merge.
108
-
109
- For Claude and Copilot drift only, no event map exists — the build stays green
110
- on the auto-commit alone.
111
-
112
- #### d. Do NOT touch `GEMINI_TOOL_MAP`
113
-
114
- That table maps Gemini's tool names (not event names) and is updated through
115
- a different process. New tools surfaced by Gemini docs are out of scope for
116
- this prompt.
117
-
118
- ### 6. Write the structured output
119
-
120
- Write to `.sync-hook-events-output.json` in the repo root:
121
- ```json
122
- {
123
- "changed": true,
124
- "diffs": {
125
- "claude": { "added": ["..."], "removed": ["..."] },
126
- "codex": { "added": [], "removed": [] },
127
- "copilot": { "added": [], "removed": [] },
128
- "cursor": { "added": ["..."], "removed": [] },
129
- "opencode": { "added": [], "removed": [] },
130
- "pi": { "unverified": true },
131
- "gemini": { "added": [], "removed": [] }
132
- },
133
- "prTitle": "[auto] sync hook event types with upstream agent CLI docs",
134
- "prBody": "<markdown — see below>"
135
- }
136
- ```
137
-
138
- Include a key for every CLI that was checked. Use `{"unverified": true}` (and
139
- omit `added`/`removed`) for any CLI whose docs could not be parsed.
140
-
141
- The `prBody` MUST be a Markdown string containing, in order:
142
-
143
- 1. **Summary table** — one row per CLI:
144
- `| CLI | status | added | removed |` where status is one of
145
- `up to date`, `drift`, or `unverified`.
146
- 2. **Per-CLI sections** — one section per CLI with non-empty drift, listing
147
- added and removed events as bullet lists.
148
- 3. **Reviewer checklist** — for every newly-added event in a CLI that has an
149
- `*EVENT_MAP`, an unchecked checkbox reminding the reviewer to add the
150
- mapping. Use `"???"` as the canonical value placeholder; **do not guess**:
151
- ```text
152
- - [ ] Add `<event>: "???"` to `<MAP_NAME>` in `src/hooks/types.ts`
153
- (canonical Claude `HookEventType` chosen by reviewer)
154
- ```
155
- 4. **Sources** — a list of the docs URL(s) consulted per CLI.
156
- 5. **Unverified notes** — for each `unverified` CLI, one short line explaining
157
- why (404, page lacked a parseable event list, etc.).
158
- 6. **Final note** (verbatim):
159
- > **CI is expected to fail on this PR if a CLI with an `*EVENT_MAP` gained
160
- > new events. A reviewer must add the missing map entries before merging.
161
- > For drift in Claude or Copilot only (no event map), CI should pass on
162
- > this commit alone. CI must pass and this PR must be reviewed before
163
- > merging.**
164
-
165
- ## Constraints
166
-
167
- - **Only edit these files**:
168
- - `src/hooks/types.ts`
169
- - `__tests__/hooks/manager.test.ts`
170
- - `__tests__/hooks/integrations.test.ts`
171
- - `.sync-hook-events-output.json`
172
- - Do NOT run any shell commands (no git, no gh, no bun, no curl).
173
- - Do NOT modify `src/hooks/integrations.ts`, `src/hooks/policy-evaluator.ts`,
174
- `src/hooks/manager.ts`, `src/hooks/handler.ts`, or any other source file.
175
- - Do NOT add entries to any `*EVENT_MAP` or to `GEMINI_TOOL_MAP` for
176
- newly-added events. Removing keys from a map when their array entry is
177
- removed IS allowed (and required to keep the build green).
178
- - Do NOT invent events. If WebFetch fails or the docs don't expose a clean
179
- event list, mark the CLI `unverified` and move on.