failproofai 0.0.10 → 0.0.11-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +7 -7
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +4 -4
  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 +4 -4
  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/build-manifest.json +4 -4
  18. package/.next/standalone/.next/server/app/_not-found/page/next-font-manifest.json +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  20. package/.next/standalone/.next/server/app/_not-found/page.js +4 -4
  21. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  24. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  25. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  26. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  27. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  28. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  29. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  30. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  31. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +1 -1
  32. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/index.html +1 -1
  34. package/.next/standalone/.next/server/app/index.rsc +16 -16
  35. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  36. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -16
  37. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  38. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  39. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +3 -3
  40. package/.next/standalone/.next/server/app/page/build-manifest.json +4 -4
  41. package/.next/standalone/.next/server/app/page/next-font-manifest.json +1 -1
  42. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  43. package/.next/standalone/.next/server/app/page.js +4 -4
  44. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +4 -4
  47. package/.next/standalone/.next/server/app/policies/page/next-font-manifest.json +1 -1
  48. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  49. package/.next/standalone/.next/server/app/policies/page.js +4 -4
  50. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +4 -4
  53. package/.next/standalone/.next/server/app/project/[name]/page/next-font-manifest.json +1 -1
  54. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  55. package/.next/standalone/.next/server/app/project/[name]/page.js +4 -4
  56. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +4 -4
  59. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/next-font-manifest.json +1 -1
  60. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  61. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  62. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +4 -4
  63. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +4 -4
  66. package/.next/standalone/.next/server/app/projects/page/next-font-manifest.json +1 -1
  67. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  68. package/.next/standalone/.next/server/app/projects/page.js +4 -4
  69. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d_ob4n._.js +1 -1
  72. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__044xt9.._.js → [root-of-the-server]__0fwb7ao._.js} +2 -2
  73. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g48iv.._.js +1 -1
  74. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j8-xkl._.js +1 -1
  75. package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0bdfoky.js +1 -1
  76. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_05pz9._._.js +1 -1
  77. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  78. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-wn51s._.js +4 -0
  79. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01as125._.js +3 -0
  80. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__098zro9._.js +19 -0
  81. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__02r.cjq._.js → [root-of-the-server]__09v.ljl._.js} +2 -2
  82. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0agrcb8._.js +4 -0
  83. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b7hkr~._.js +3 -0
  84. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ehh6vp._.js +4 -0
  85. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g8l0tu._.js +3 -0
  86. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4l6hl._.js +3 -0
  87. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ye1w50._.js → [root-of-the-server]__0k5n2kz._.js} +3 -3
  88. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lp08ll._.js +3 -0
  89. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0yaqw._.js +4 -0
  90. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o21f.o._.js +3 -0
  91. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t8juvy._.js +4 -0
  92. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10xgshr._.js → [root-of-the-server]__0tcyn68._.js} +2 -2
  93. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ts150~._.js +3 -0
  94. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0podumr._.js → [root-of-the-server]__0uylufv._.js} +3 -3
  95. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ymlddl._.js +5 -5
  96. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03grs._.js +3 -0
  97. package/.next/standalone/.next/server/chunks/ssr/app_0cdqd9w._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +2 -2
  100. package/.next/standalone/.next/server/chunks/ssr/lib_utils_ts_068jk73._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/ssr/node_modules_0ttbz1~._.js +1 -1
  102. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_06u0kr8._.js +1 -1
  103. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0a_7sdg.js +2 -2
  105. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0ef3uwk.js +2 -2
  106. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0j79~gv.js +2 -2
  107. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0pbja1x.js +2 -2
  108. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0r6o0i2.js +2 -2
  109. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11y81~_.js +2 -2
  110. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12or2kf.js +2 -2
  111. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0mebn66._.js +1 -1
  112. package/.next/standalone/.next/server/functions-config-manifest.json +2 -2
  113. package/.next/standalone/.next/server/middleware-build-manifest.js +7 -7
  114. package/.next/standalone/.next/server/next-font-manifest.js +1 -1
  115. package/.next/standalone/.next/server/next-font-manifest.json +6 -6
  116. package/.next/standalone/.next/server/pages/404.html +1 -1
  117. package/.next/standalone/.next/server/pages/500.html +1 -1
  118. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  120. package/.next/standalone/.next/static/chunks/07kpqoo7kuckx.js +6 -0
  121. package/.next/standalone/.next/static/chunks/0a40sy4tk8ioe.js +1 -0
  122. package/.next/standalone/.next/static/chunks/{12l2t63hkyo2q.js → 0azb~vy9ds_uy.js} +1 -1
  123. package/.next/standalone/.next/static/chunks/{0j171xiqge4rv.js → 0bke.~atnsbeb.js} +1 -1
  124. package/.next/standalone/.next/static/chunks/{0lt8ko3lw.5yt.js → 0bv1oyxspkpkb.js} +1 -1
  125. package/.next/standalone/.next/static/chunks/{179yytvmam0ug.js → 0dvhi-prcsh3~.js} +1 -1
  126. package/.next/standalone/.next/static/chunks/0f5p9plm.aqlp.css +2 -0
  127. package/.next/standalone/.next/static/chunks/0ffvlbgzgnlw7.js +2 -0
  128. package/.next/standalone/.next/static/chunks/{150i0n26fnvso.js → 0n1n67imq.udf.js} +1 -1
  129. package/.next/standalone/.next/static/chunks/0spktq7xqab9h.js +1 -0
  130. package/.next/standalone/.next/static/chunks/{14lii11wmo450.js → 118q3uljozd5z.js} +1 -1
  131. package/.next/standalone/.next/static/chunks/{0pkl..xgo-qox.js → 11w14gnqzprir.js} +1 -1
  132. package/.next/standalone/.next/static/chunks/{0rnqmir4cd5p9.js → 17mubwtqwijpu.js} +1 -1
  133. package/.next/standalone/.next/static/chunks/{turbopack-05z7a19q43zfq.js → turbopack-0nh.aopesgj~5.js} +1 -1
  134. package/.next/standalone/.next/static/media/4fa387ec64143e14-s.0.qu-9752pffj.woff2 +0 -0
  135. package/.next/standalone/.next/static/media/5ce348bf30bf5439-s.0ee55_hj9qcer.woff2 +0 -0
  136. package/.next/standalone/.next/static/media/6306c77e7c8268e4-s.0mao5jbfbduzp.woff2 +0 -0
  137. package/.next/standalone/.next/static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2 +0 -0
  138. package/.next/standalone/.next/static/media/7d817b4c03b0c5f1-s.0uzt.a6d44yda.woff2 +0 -0
  139. package/.next/standalone/.next/static/media/bbc41e54d2fcbd21-s.0mvwgmnhv29no.woff2 +0 -0
  140. package/.next/standalone/.next/static/{dAuQps6jUwCz9X1Q5FFOO → tGVQM5SE3NvbVu0gbAJm7}/_clientMiddlewareManifest.js +2 -2
  141. package/.next/standalone/app/policies/hooks-client.tsx +111 -14
  142. package/.next/standalone/components/navbar.tsx +1 -1
  143. package/.next/standalone/components/reach-developers.tsx +2 -2
  144. package/.next/standalone/lib/claude-sessions.ts +181 -0
  145. package/.next/standalone/node_modules/@next/env/package.json +1 -1
  146. package/.next/standalone/node_modules/next/dist/build/static-paths/app.js +2 -1
  147. package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
  148. package/.next/standalone/node_modules/next/dist/build/utils.js +2 -1
  149. package/.next/standalone/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +2 -2
  150. package/.next/standalone/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +8 -2
  151. package/.next/standalone/node_modules/next/dist/client/route-params.js +23 -6
  152. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +13 -13
  153. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +11 -11
  154. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +2 -2
  155. package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +10 -10
  156. package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  157. package/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +3 -6
  158. package/.next/standalone/node_modules/next/dist/server/app-render/app-render.js +62 -9
  159. package/.next/standalone/node_modules/next/dist/server/app-render/collect-segment-data.js +16 -0
  160. package/.next/standalone/node_modules/next/dist/server/app-render/create-component-tree.js +49 -19
  161. package/.next/standalone/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +8 -20
  162. package/.next/standalone/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +8 -7
  163. package/.next/standalone/node_modules/next/dist/server/app-render/use-flight-response.js +2 -2
  164. package/.next/standalone/node_modules/next/dist/server/async-storage/work-store.js +2 -1
  165. package/.next/standalone/node_modules/next/dist/server/base-server.js +13 -5
  166. package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
  167. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
  168. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  169. package/.next/standalone/node_modules/next/dist/server/dev/static-paths-worker.js +2 -1
  170. package/.next/standalone/node_modules/next/dist/server/image-optimizer.js +22 -2
  171. package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  172. package/.next/standalone/node_modules/next/dist/server/lib/is-rsc-request.js +18 -0
  173. package/.next/standalone/node_modules/next/dist/server/lib/mock-request.js +30 -5
  174. package/.next/standalone/node_modules/next/dist/server/lib/patch-set-header.js +7 -0
  175. package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +6 -3
  176. package/.next/standalone/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +18 -4
  177. package/.next/standalone/node_modules/next/dist/server/lib/server-ipc/utils.js +3 -1
  178. package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
  179. package/.next/standalone/node_modules/next/dist/server/next-server.js +1 -1
  180. package/.next/standalone/node_modules/next/dist/server/request/fallback-params.js +27 -1
  181. package/.next/standalone/node_modules/next/dist/server/route-modules/app-route/module.js +1 -0
  182. package/.next/standalone/node_modules/next/dist/server/route-modules/route-module.js +11 -1
  183. package/.next/standalone/node_modules/next/dist/server/server-utils.js +19 -2
  184. package/.next/standalone/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +5 -5
  185. package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1 -1
  186. package/.next/standalone/node_modules/next/dist/server/web/adapter.js +4 -1
  187. package/.next/standalone/node_modules/next/dist/server/web/edge-route-module-wrapper.js +2 -1
  188. package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  189. package/.next/standalone/node_modules/next/dist/{server → shared/lib}/htmlescape.js +15 -0
  190. package/.next/standalone/node_modules/next/dist/shared/lib/router/routes/app.js +13 -1
  191. package/.next/standalone/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +56 -10
  192. package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  193. package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  194. package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
  195. package/.next/standalone/node_modules/next/package.json +15 -15
  196. package/.next/standalone/node_modules/react/cjs/react.development.js +1 -1
  197. package/.next/standalone/node_modules/react/cjs/react.production.js +1 -1
  198. package/.next/standalone/node_modules/react/package.json +1 -1
  199. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
  200. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
  201. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
  202. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
  203. package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
  204. package/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
  205. package/.next/standalone/node_modules/react-dom/package.json +2 -2
  206. package/.next/standalone/package.json +5 -5
  207. package/.next/standalone/proxy.ts +1 -1
  208. package/.next/standalone/server.js +1 -1
  209. package/README.md +4 -4
  210. package/bin/failproofai.mjs +230 -73
  211. package/dist/cli.mjs +3028 -1453
  212. package/lib/claude-sessions.ts +181 -0
  213. package/package.json +5 -5
  214. package/scripts/launch.ts +1 -1
  215. package/scripts/postinstall.mjs +89 -1
  216. package/src/audit/cache.ts +113 -0
  217. package/src/audit/cli-adapters/claude.ts +97 -0
  218. package/src/audit/cli-adapters/codex.ts +56 -0
  219. package/src/audit/cli-adapters/copilot.ts +51 -0
  220. package/src/audit/cli-adapters/cursor.ts +51 -0
  221. package/src/audit/cli-adapters/gemini.ts +51 -0
  222. package/src/audit/cli-adapters/index.ts +70 -0
  223. package/src/audit/cli-adapters/opencode.ts +52 -0
  224. package/src/audit/cli-adapters/pi.ts +51 -0
  225. package/src/audit/cli-adapters/shared.ts +85 -0
  226. package/src/audit/detectors/find-from-root.ts +27 -0
  227. package/src/audit/detectors/git-commit-no-verify.ts +22 -0
  228. package/src/audit/detectors/index.ts +33 -0
  229. package/src/audit/detectors/prefer-edit-over-read-cat.ts +31 -0
  230. package/src/audit/detectors/prefer-edit-over-sed-awk.ts +27 -0
  231. package/src/audit/detectors/prefer-write-over-heredoc.ts +36 -0
  232. package/src/audit/detectors/redundant-cd-cwd.ts +28 -0
  233. package/src/audit/detectors/reread-after-edit.ts +58 -0
  234. package/src/audit/detectors/sleep-polling-loop.ts +34 -0
  235. package/src/audit/index.ts +369 -0
  236. package/src/audit/replay.ts +121 -0
  237. package/src/audit/report.ts +349 -0
  238. package/src/audit/telemetry.ts +113 -0
  239. package/src/audit/types.ts +193 -0
  240. package/src/hooks/builtin-policies.ts +79 -1
  241. package/src/hooks/custom-hooks-loader.ts +19 -3
  242. package/src/hooks/first-run-nudge.ts +146 -0
  243. package/src/hooks/handler.ts +21 -102
  244. package/src/hooks/install-prompt.ts +34 -4
  245. package/src/hooks/manager.ts +72 -5
  246. package/src/hooks/policy-evaluator.ts +19 -4
  247. package/src/hooks/policy-registry.ts +1 -1
  248. package/src/hooks/policy-types.ts +9 -0
  249. package/src/hooks/tool-name-canonicalize.ts +65 -0
  250. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0609ezh._.js +0 -3
  251. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07_-mkc._.js +0 -3
  252. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09z7o2x._.js +0 -19
  253. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0_sh2n0._.js +0 -3
  254. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e9o9ri._.js +0 -4
  255. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l6swv1._.js +0 -3
  256. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0logebz._.js +0 -3
  257. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mi5ejy._.js +0 -4
  258. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0odijkc._.js +0 -3
  259. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rkxer-._.js +0 -3
  260. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rl2kwi._.js +0 -4
  261. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vg0uey._.js +0 -4
  262. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x5limi._.js +0 -3
  263. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10._f0s._.js +0 -4
  264. package/.next/standalone/.next/static/chunks/01q52wg_amm60.js +0 -2
  265. package/.next/standalone/.next/static/chunks/0kqar56yl~41o.js +0 -6
  266. package/.next/standalone/.next/static/chunks/0ml1.ck_5t36i.js +0 -1
  267. package/.next/standalone/.next/static/chunks/0zig0fh30t6ou.js +0 -1
  268. package/.next/standalone/.next/static/chunks/17rm86uz2nd5a.css +0 -2
  269. package/.next/standalone/.next/static/media/4fa387ec64143e14-s.0q3udbd2bu5yp.woff2 +0 -0
  270. package/.next/standalone/.next/static/media/797e433ab948586e-s.p.0.q-h669a_dqa.woff2 +0 -0
  271. package/.next/standalone/.next/static/media/bbc41e54d2fcbd21-s.0gw~uztddq1df.woff2 +0 -0
  272. package/src/auth/login.ts +0 -104
  273. package/src/auth/logout.ts +0 -50
  274. package/src/auth/token-store.ts +0 -64
  275. package/src/relay/daemon.ts +0 -362
  276. package/src/relay/pid.ts +0 -76
  277. package/src/relay/queue.ts +0 -225
  278. /package/.next/standalone/.next/static/{dAuQps6jUwCz9X1Q5FFOO → tGVQM5SE3NvbVu0gbAJm7}/_buildManifest.js +0 -0
  279. /package/.next/standalone/.next/static/{dAuQps6jUwCz9X1Q5FFOO → tGVQM5SE3NvbVu0gbAJm7}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/12pt~2f.c1sha.js","static/chunks/150i0n26fnvso.js","static/chunks/0rnqmir4cd5p9.js","static/chunks/01q52wg_amm60.js","static/chunks/07uz2g0_38qia.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=function(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let e=document?.currentScript?.getAttribute?.("src")??"",t=e.indexOf("?");return t>=0?e.slice(t):""}(),n=["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];var o,i=((o=i||{})[o.Runtime=0]="Runtime",o[o.Parent=1]="Parent",o[o.Update=2]="Update",o);let l=new WeakMap;function s(e,t){this.m=e,this.e=t}let u=s.prototype,a=Object.prototype.hasOwnProperty,c="u">typeof Symbol&&Symbol.toStringTag;function f(e,t,r){a.call(e,t)||Object.defineProperty(e,t,r)}function p(e,t){let r=e[t];return r||(r=h(t),e[t]=r),r}function h(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function d(e,t){f(e,"__esModule",{value:!0}),c&&f(e,c,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)f(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?f(e,n,{get:o,set:t[r++],enumerable:!0}):f(e,n,{get:o,enumerable:!0})}Object.seal(e)}function m(e,t){(null!=t?p(this.c,t):this.m).exports=e}u.s=function(e,t){let r,n;null!=t?n=(r=p(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,d(n,e)},u.j=function(e,t){var r,n;let o,i,s;null!=t?i=(o=p(this.c,t)).exports:(o=this.m,i=this.e);let u=(r=o,n=i,(s=l.get(r))||(l.set(r,s=[]),r.exports=r.namespaceObject=new Proxy(n,{get(e,t){if(a.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of s){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of s)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),s);"object"==typeof e&&null!==e&&u.push(e)},u.v=m,u.n=function(e,t){let r;(r=null!=t?p(this.c,t):this.m).exports=r.namespaceObject=e};let b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y=[null,b({}),b([]),b(b)];function g(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!y.includes(t);t=b(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),d(t,n),t}function O(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=g(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function w(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function j(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}u.i=O,u.A=function(e){return this.r(e)(O.bind(this))},u.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},u.r=function(e){return B(e,this.m).exports},u.f=function(e){function t(t){if(t=w(t),a.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=w(t),a.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let k=Symbol("turbopack queues"),U=Symbol("turbopack exports"),v=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}u.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:i,reject:l,promise:s}=j(),u=Object.assign(s,{[U]:r.exports,[k]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[U]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(k in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[U]:{},[k]:e=>e(t)};return e.then(e=>{r[U]=e,C(t)},e=>{r[v]=e,C(t)}),r}}return{[U]:e,[k]:()=>{}}}),r=()=>t.map(e=>{if(e[v])throw e[v];return e[U]}),{promise:i,resolve:l}=j(),s=Object.assign(()=>l(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[k](u)),s.queueCount?i:r()},function(e){e?l(u[v]=e):i(u[U]),C(n)}),n&&-1===n.status&&(n.status=0)};let P=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}P.prototype=URL.prototype,u.U=P,u.z=function(e){throw Error("dynamic usage of require is not supported")},u.g=globalThis;let S=s.prototype,$=new Map;u.M=$;let _=new Map,E=new Map;async function T(e,t,r){let n;if("string"==typeof r)return M(e,t,q(r));let o=r.included||[],i=o.map(e=>!!$.has(e)||_.get(e));if(i.length>0&&i.every(e=>e))return void await Promise.all(i);let l=r.moduleChunks||[],s=l.map(e=>E.get(e)).filter(e=>e);if(s.length>0){if(s.length===l.length)return void await Promise.all(s);let r=new Set;for(let e of l)E.has(e)||r.add(e);for(let n of r){let r=M(e,t,q(n));E.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=M(e,t,q(r.path)),l))E.has(o)||E.set(o,n)}for(let e of o)_.has(e)||_.set(e,n);await n}S.l=function(e){return T(i.Parent,this.m.id,e)};let A=Promise.resolve(void 0),x=new WeakMap;function M(t,r,n){let o=e.loadChunkCached(t,n),l=x.get(o);if(void 0===l){let e=x.set.bind(x,o,A);l=o.then(e).catch(e=>{let o;switch(t){case i.Runtime:o=`as a runtime dependency of chunk ${r}`;break;case i.Parent:o=`from module ${r}`;break;case i.Update:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),x.set(o,l)}return l}function q(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}S.L=function(e){return M(i.Parent,this.m.id,e)},S.R=function(e){let t=this.r(e);return t?.default??t},S.P=function(e){return`/ROOT/${e??""}`},S.q=function(e,t){m.call(this,`${e}${r}`,t)},S.b=function(e,t,o,i){let l="SharedWorker"===e.name,s=[o.map(e=>q(e)).reverse(),r];for(let e of n)s.push(globalThis[e]);let u=new URL(q(t),location.origin),a=JSON.stringify(s);return l?u.searchParams.set("params",a):u.hash="#params="+encodeURIComponent(a),new e(u,i?{...i,type:void 0}:void 0)};let N=/\.js(?:\?[^#]*)?(?:#.*)?$/,K=/\.css(?:\?[^#]*)?(?:#.*)?$/;function L(e){return K.test(e)}u.w=function(t,r,n){return e.loadWebAssembly(i.Parent,this.m.id,t,r,n)},u.u=function(t,r){return e.loadWebAssemblyModule(i.Parent,this.m.id,t,r)};let I={};u.c=I;let B=(e,t)=>{let r=I[e];if(r){if(r.error)throw r.error;return r}return W(e,i.Parent,t.id)};function W(e,t,r){let n=$.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let o=h(e),i=o.exports;I[e]=o;let l=new s(o,i);try{n(l,o,i)}catch(e){throw o.error=e,e}return o.namespaceObject&&o.exports!==o.namespaceObject&&g(o.exports,o.namespaceObject),o}function F(t){let r,n=function(e){if("string"==typeof e)return e;if(e)return{src:e.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}(t[0]);return 2===t.length?r=t[1]:(r=void 0,!function(e,t){let r=1;for(;r<e.length;){let n,o=r+1;for(;o<e.length&&"function"!=typeof e[o];)o++;if(o===e.length)throw Error("malformed chunk format, expected a factory function");let i=e[o];for(let i=r;i<o;i++){let r=e[i],o=t.get(r);if(o){n=o;break}}let l=n??i,s=!1;for(let n=r;n<o;n++){let r=e[n];t.has(r)||(s||(l===i&&Object.defineProperty(i,"name",{value:"module evaluation"}),s=!0),t.set(r,l))}r=o+1}}(t,$)),e.registerChunk(n,r)}let X=new Map;function D(e){let t=X.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},X.set(e,t)}return t}e={async registerChunk(e,r){let n=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(e.src.replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(e);if(D("string"==typeof e?q(e):e.src).resolve(),null!=r){for(let e of r.otherChunks)D(q("string"==typeof e?e:e.path));if(await Promise.all(r.otherChunks.map(e=>T(i.Runtime,n,e))),r.runtimeModuleIds.length>0)for(let e of r.runtimeModuleIds)!function(e,t){let r=I[t];if(r){if(r.error)throw r.error;return}W(t,i.Runtime,e)}(n,e)}},loadChunkCached:(e,t)=>(function(e,t){let r=D(t);if(r.loadingStarted)return r.promise;if(e===i.Runtime)return r.loadingStarted=!0,L(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(L(t));else if(N.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(L(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(N.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let i=fetch(q(r)),{instance:l}=await WebAssembly.instantiateStreaming(i,o);return l.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(q(r));return await WebAssembly.compileStreaming(o)}};let H=globalThis.TURBOPACK;globalThis.TURBOPACK={push:F},H.forEach(F)})();
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/12pt~2f.c1sha.js","static/chunks/0n1n67imq.udf.js","static/chunks/17mubwtqwijpu.js","static/chunks/0ffvlbgzgnlw7.js","static/chunks/07uz2g0_38qia.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=function(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let e=document?.currentScript?.getAttribute?.("src")??"",t=e.indexOf("?");return t>=0?e.slice(t):""}(),n=["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];var o,i=((o=i||{})[o.Runtime=0]="Runtime",o[o.Parent=1]="Parent",o[o.Update=2]="Update",o);let l=new WeakMap;function s(e,t){this.m=e,this.e=t}let u=s.prototype,a=Object.prototype.hasOwnProperty,c="u">typeof Symbol&&Symbol.toStringTag;function f(e,t,r){a.call(e,t)||Object.defineProperty(e,t,r)}function p(e,t){let r=e[t];return r||(r=h(t),e[t]=r),r}function h(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function d(e,t){f(e,"__esModule",{value:!0}),c&&f(e,c,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)f(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?f(e,n,{get:o,set:t[r++],enumerable:!0}):f(e,n,{get:o,enumerable:!0})}Object.seal(e)}function m(e,t){(null!=t?p(this.c,t):this.m).exports=e}u.s=function(e,t){let r,n;null!=t?n=(r=p(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,d(n,e)},u.j=function(e,t){var r,n;let o,i,s;null!=t?i=(o=p(this.c,t)).exports:(o=this.m,i=this.e);let u=(r=o,n=i,(s=l.get(r))||(l.set(r,s=[]),r.exports=r.namespaceObject=new Proxy(n,{get(e,t){if(a.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of s){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of s)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),s);"object"==typeof e&&null!==e&&u.push(e)},u.v=m,u.n=function(e,t){let r;(r=null!=t?p(this.c,t):this.m).exports=r.namespaceObject=e};let b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y=[null,b({}),b([]),b(b)];function g(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!y.includes(t);t=b(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),d(t,n),t}function w(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=g(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function O(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function j(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}u.i=w,u.A=function(e){return this.r(e)(w.bind(this))},u.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},u.r=function(e){return B(e,this.m).exports},u.f=function(e){function t(t){if(t=O(t),a.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=O(t),a.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let k=Symbol("turbopack queues"),U=Symbol("turbopack exports"),v=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}u.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:i,reject:l,promise:s}=j(),u=Object.assign(s,{[U]:r.exports,[k]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[U]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(k in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[U]:{},[k]:e=>e(t)};return e.then(e=>{r[U]=e,C(t)},e=>{r[v]=e,C(t)}),r}}return{[U]:e,[k]:()=>{}}}),r=()=>t.map(e=>{if(e[v])throw e[v];return e[U]}),{promise:i,resolve:l}=j(),s=Object.assign(()=>l(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[k](u)),s.queueCount?i:r()},function(e){e?l(u[v]=e):i(u[U]),C(n)}),n&&-1===n.status&&(n.status=0)};let P=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}P.prototype=URL.prototype,u.U=P,u.z=function(e){throw Error("dynamic usage of require is not supported")},u.g=globalThis;let S=s.prototype,$=new Map;u.M=$;let _=new Map,E=new Map;async function T(e,t,r){let n;if("string"==typeof r)return M(e,t,q(r));let o=r.included||[],i=o.map(e=>!!$.has(e)||_.get(e));if(i.length>0&&i.every(e=>e))return void await Promise.all(i);let l=r.moduleChunks||[],s=l.map(e=>E.get(e)).filter(e=>e);if(s.length>0){if(s.length===l.length)return void await Promise.all(s);let r=new Set;for(let e of l)E.has(e)||r.add(e);for(let n of r){let r=M(e,t,q(n));E.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=M(e,t,q(r.path)),l))E.has(o)||E.set(o,n)}for(let e of o)_.has(e)||_.set(e,n);await n}S.l=function(e){return T(i.Parent,this.m.id,e)};let A=Promise.resolve(void 0),x=new WeakMap;function M(t,r,n){let o=e.loadChunkCached(t,n),l=x.get(o);if(void 0===l){let e=x.set.bind(x,o,A);l=o.then(e).catch(e=>{let o;switch(t){case i.Runtime:o=`as a runtime dependency of chunk ${r}`;break;case i.Parent:o=`from module ${r}`;break;case i.Update:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),x.set(o,l)}return l}function q(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}S.L=function(e){return M(i.Parent,this.m.id,e)},S.R=function(e){let t=this.r(e);return t?.default??t},S.P=function(e){return`/ROOT/${e??""}`},S.q=function(e,t){m.call(this,`${e}${r}`,t)},S.b=function(e,t,o,i){let l="SharedWorker"===e.name,s=[o.map(e=>q(e)).reverse(),r];for(let e of n)s.push(globalThis[e]);let u=new URL(q(t),location.origin),a=JSON.stringify(s);return l?u.searchParams.set("params",a):u.hash="#params="+encodeURIComponent(a),new e(u,i?{...i,type:void 0}:void 0)};let N=/\.js(?:\?[^#]*)?(?:#.*)?$/,K=/\.css(?:\?[^#]*)?(?:#.*)?$/;function L(e){return K.test(e)}u.w=function(t,r,n){return e.loadWebAssembly(i.Parent,this.m.id,t,r,n)},u.u=function(t,r){return e.loadWebAssemblyModule(i.Parent,this.m.id,t,r)};let I={};u.c=I;let B=(e,t)=>{let r=I[e];if(r){if(r.error)throw r.error;return r}return W(e,i.Parent,t.id)};function W(e,t,r){let n=$.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let o=h(e),i=o.exports;I[e]=o;let l=new s(o,i);try{n(l,o,i)}catch(e){throw o.error=e,e}return o.namespaceObject&&o.exports!==o.namespaceObject&&g(o.exports,o.namespaceObject),o}function F(t){let r,n=function(e){if("string"==typeof e)return e;if(e)return{src:e.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}(t[0]);return 2===t.length?r=t[1]:(r=void 0,!function(e,t){let r=1;for(;r<e.length;){let n,o=r+1;for(;o<e.length&&"function"!=typeof e[o];)o++;if(o===e.length)throw Error("malformed chunk format, expected a factory function");let i=e[o];for(let i=r;i<o;i++){let r=e[i],o=t.get(r);if(o){n=o;break}}let l=n??i,s=!1;for(let n=r;n<o;n++){let r=e[n];t.has(r)||(s||(l===i&&Object.defineProperty(i,"name",{value:"module evaluation"}),s=!0),t.set(r,l))}r=o+1}}(t,$)),e.registerChunk(n,r)}let X=new Map;function D(e){let t=X.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},X.set(e,t)}return t}e={async registerChunk(e,r){let n=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(e.src.replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(e);if(D("string"==typeof e?q(e):e.src).resolve(),null!=r){for(let e of r.otherChunks)D(q("string"==typeof e?e:e.path));if(await Promise.all(r.otherChunks.map(e=>T(i.Runtime,n,e))),r.runtimeModuleIds.length>0)for(let e of r.runtimeModuleIds)!function(e,t){let r=I[t];if(r){if(r.error)throw r.error;return}W(t,i.Runtime,e)}(n,e)}},loadChunkCached:(e,t)=>(function(e,t){let r=D(t);if(r.loadingStarted)return r.promise;if(e===i.Runtime)return r.loadingStarted=!0,L(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(L(t));else if(N.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(L(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(N.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let i=fetch(q(r)),{instance:l}=await WebAssembly.instantiateStreaming(i,o);return l.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(q(r));return await WebAssembly.compileStreaming(o)}};let H=globalThis.TURBOPACK;globalThis.TURBOPACK={push:F},H.forEach(F)})();
@@ -1,6 +1,6 @@
1
1
  self.__MIDDLEWARE_MATCHERS = [
2
2
  {
3
- "regexp": "^(?:\\/(_next\\/data\\/[^/]{1,}))?(?:\\/((?!_next\\/static|_next\\/image|favicon\\.ico|icon\\.png|exospheresmall).*))(\\.json)?[\\/#\\?]?$",
4
- "originalSource": "/((?!_next/static|_next/image|favicon\\.ico|icon\\.png|exospheresmall).*)"
3
+ "regexp": "^(?:\\/(_next\\/data\\/[^/]{1,}))?(?:\\/((?!_next\\/static|_next\\/image|favicon\\.ico|icon\\.png).*))(\\.json|\\.rsc|\\.segments\\/.+\\.segment\\.rsc)?[\\/#\\?]?$",
4
+ "originalSource": "/((?!_next/static|_next/image|favicon\\.ico|icon\\.png).*)"
5
5
  }
6
6
  ];self.__MIDDLEWARE_MATCHERS_CB && self.__MIDDLEWARE_MATCHERS_CB()
@@ -26,6 +26,7 @@ import { togglePolicyAction } from "@/app/actions/update-hooks-config";
26
26
  import { installHooksWebAction, removeHooksWebAction } from "@/app/actions/install-hooks-web";
27
27
  import { updatePolicyParamsAction } from "@/app/actions/update-policy-params";
28
28
  import { useAutoRefresh } from "@/contexts/AutoRefreshContext";
29
+ import { usePostHog } from "@/contexts/PostHogContext";
29
30
  import { useUrlParams } from "@/lib/use-url-params";
30
31
  import { pageToParam, paramToPage } from "@/lib/url-filter-serializers";
31
32
  import { getCliLabel, getCliBadgeClasses, KNOWN_CLI_IDS, isKnownCli, type CliId } from "@/lib/cli-registry";
@@ -208,10 +209,12 @@ function DurationDisplay({ ms }: { ms: number }) {
208
209
 
209
210
  // -- Copy Button --
210
211
 
211
- function CopyButton({ text }: { text: string }) {
212
+ function CopyButton({ text, field }: { text: string; field?: string }) {
212
213
  const [copied, setCopied] = useState(false);
214
+ const { capture } = usePostHog();
213
215
  const handleCopy = async (e: React.MouseEvent) => {
214
216
  e.stopPropagation();
217
+ capture("activity_copy_clicked", { field: field ?? "unknown" });
215
218
  try {
216
219
  await navigator.clipboard.writeText(text);
217
220
  setCopied(true);
@@ -321,12 +324,12 @@ function DetailPanel({
321
324
  <span className="font-mono text-foreground">
322
325
  {item.sessionId ?? "\u2014"}
323
326
  </span>
324
- {item.sessionId && <CopyButton text={item.sessionId} />}
327
+ {item.sessionId && <CopyButton text={item.sessionId} field="session_id" />}
325
328
  </div>
326
329
  <div>
327
330
  <span className="text-muted-foreground">CWD: </span>
328
331
  <span className="font-mono text-foreground">{item.cwd ?? "\u2014"}</span>
329
- {item.cwd && <CopyButton text={item.cwd} />}
332
+ {item.cwd && <CopyButton text={item.cwd} field="cwd" />}
330
333
  </div>
331
334
  <div>
332
335
  <span className="text-muted-foreground">Transcript: </span>
@@ -366,6 +369,7 @@ function ActivityTab({
366
369
  onSwitchTab?: (tab: "activity" | "policies") => void;
367
370
  }) {
368
371
  const { intervalSec } = useAutoRefresh();
372
+ const { capture } = usePostHog();
369
373
  const url = useUrlParams();
370
374
  const mountedRef = useRef(false);
371
375
 
@@ -385,6 +389,7 @@ function ActivityTab({
385
389
  return isKnownCli(v) ? v : "";
386
390
  });
387
391
  const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
392
+ const filterTelemetryFirstRunRef = useRef(true);
388
393
  const filtersRef = useRef({ filterDecision, filterEventType, filterPolicy, filterSessionId, filterCli });
389
394
  filtersRef.current = { filterDecision, filterEventType, filterPolicy, filterSessionId, filterCli };
390
395
 
@@ -444,6 +449,28 @@ function ActivityTab({
444
449
  setPage(1);
445
450
  setExpandedRow(null);
446
451
  fetchData(1);
452
+ // Skip the initial render — filters are initialized from URL params, not
453
+ // from a user action. Only fire on real user-driven changes.
454
+ if (filterTelemetryFirstRunRef.current) {
455
+ filterTelemetryFirstRunRef.current = false;
456
+ return;
457
+ }
458
+ capture("activity_filter_changed", {
459
+ active_filter_count:
460
+ (filterDecision !== "" ? 1 : 0) +
461
+ (filterEventType !== "" ? 1 : 0) +
462
+ (filterPolicy !== "" ? 1 : 0) +
463
+ (filterSessionId !== "" ? 1 : 0) +
464
+ (filterCli !== "" ? 1 : 0),
465
+ has_decision: filterDecision !== "",
466
+ has_event_type: filterEventType !== "",
467
+ has_policy: filterPolicy !== "",
468
+ has_session: filterSessionId !== "",
469
+ has_cli: filterCli !== "",
470
+ decision: filterDecision || null,
471
+ event_type: filterEventType || null,
472
+ cli: filterCli || null,
473
+ });
447
474
  }, 300);
448
475
  return () => {
449
476
  if (debounceRef.current) clearTimeout(debounceRef.current);
@@ -455,7 +482,17 @@ function ActivityTab({
455
482
  const totalPages = data?.totalPages ?? 1;
456
483
 
457
484
  const toggleRow = (idx: number) => {
458
- setExpandedRow((prev) => (prev === idx ? null : idx));
485
+ setExpandedRow((prev) => {
486
+ const next = prev === idx ? null : idx;
487
+ const item = items[idx];
488
+ capture("activity_row_toggled", {
489
+ expanded: next !== null,
490
+ decision: item?.decision ?? null,
491
+ policy_name: item?.policyName ?? null,
492
+ event_type: item?.eventType ?? null,
493
+ });
494
+ return next;
495
+ });
459
496
  };
460
497
 
461
498
  return (
@@ -652,6 +689,11 @@ function ActivityTab({
652
689
  currentPage={page}
653
690
  totalPages={totalPages}
654
691
  onPageChange={(p) => {
692
+ capture("activity_pagination_changed", {
693
+ from_page: page,
694
+ to_page: p,
695
+ total_pages: totalPages,
696
+ });
655
697
  setPage(p);
656
698
  setExpandedRow(null);
657
699
  }}
@@ -886,6 +928,7 @@ function ErrorToast({
886
928
  onInstall: () => void;
887
929
  isPending: boolean;
888
930
  }) {
931
+ const { capture } = usePostHog();
889
932
  return createPortal(
890
933
  <div
891
934
  className="fixed top-4 right-4 z-[9999] w-full max-w-sm"
@@ -923,7 +966,11 @@ function ErrorToast({
923
966
  <div className="mt-3 flex gap-2">
924
967
  <Button
925
968
  size="sm"
926
- onClick={() => { onDismiss(); onInstall(); }}
969
+ onClick={() => {
970
+ capture("hooks_install_from_error_clicked", { error_message: message.slice(0, 200) });
971
+ onDismiss();
972
+ onInstall();
973
+ }}
927
974
  disabled={isPending}
928
975
  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"
929
976
  >
@@ -953,6 +1000,15 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
953
1000
  const [configuringPolicy, setConfiguringPolicy] = useState<PolicyInfo | null>(null);
954
1001
  const [checkedClis, setCheckedClis] = useState<Set<IntegrationType>>(() => new Set());
955
1002
  const cliCheckboxesInitializedRef = useRef(false);
1003
+ const { capture } = usePostHog();
1004
+
1005
+ const fireActionError = useCallback(
1006
+ (errorType: string, message: string) => {
1007
+ capture("action_error_displayed", { error_type: errorType, error_message: message.slice(0, 200) });
1008
+ setActionError(message);
1009
+ },
1010
+ [capture],
1011
+ );
956
1012
 
957
1013
  const reload = useCallback(async () => {
958
1014
  try {
@@ -1002,8 +1058,15 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
1002
1058
  const toggleCli = (id: IntegrationType) => {
1003
1059
  setCheckedClis((prev) => {
1004
1060
  const next = new Set(prev);
1005
- if (next.has(id)) next.delete(id);
1006
- else next.add(id);
1061
+ const willCheck = !next.has(id);
1062
+ if (willCheck) next.add(id);
1063
+ else next.delete(id);
1064
+ const cliInfo = config?.clis.find((c) => c.id === id);
1065
+ capture("cli_selection_toggled", {
1066
+ cli_id: id,
1067
+ checked: willCheck,
1068
+ current_state: cliInfo?.installed ? "installed" : cliInfo?.detected ? "detected" : "inactive",
1069
+ });
1007
1070
  return next;
1008
1071
  });
1009
1072
  };
@@ -1033,7 +1096,7 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
1033
1096
  try {
1034
1097
  await togglePolicyAction(name, !currentlyEnabled);
1035
1098
  } catch {
1036
- setActionError("Failed to save policy change.");
1099
+ fireActionError("policy_toggle", "Failed to save policy change.");
1037
1100
  reload();
1038
1101
  }
1039
1102
  });
@@ -1042,13 +1105,19 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
1042
1105
  const handleApply = () => {
1043
1106
  const { toInstall, toRemove } = pendingChanges;
1044
1107
  if (toInstall.length === 0 && toRemove.length === 0) return;
1108
+ capture("cli_install_remove_submitted", {
1109
+ to_install: toInstall,
1110
+ to_remove: toRemove,
1111
+ count_install: toInstall.length,
1112
+ count_remove: toRemove.length,
1113
+ });
1045
1114
  startTransition(async () => {
1046
1115
  try {
1047
1116
  setActionError(null);
1048
1117
  if (toInstall.length > 0) await installHooksWebAction("user", toInstall);
1049
1118
  if (toRemove.length > 0) await removeHooksWebAction("user", toRemove);
1050
1119
  } catch (e) {
1051
- setActionError(e instanceof Error ? e.message : "Failed to apply changes.");
1120
+ fireActionError("cli_apply", e instanceof Error ? e.message : "Failed to apply changes.");
1052
1121
  } finally {
1053
1122
  // Always resync so a partial-success batch (install OK, remove failed)
1054
1123
  // doesn't leave the UI showing stale install state on the next click.
@@ -1064,12 +1133,13 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
1064
1133
  // Reinstall button. Use Apply for first-time installs.
1065
1134
  const targets = Array.from(installedCliSet).filter((id) => checkedClis.has(id));
1066
1135
  if (targets.length === 0) return;
1136
+ capture("cli_reinstall_submitted", { cli_ids: targets, count: targets.length });
1067
1137
  startTransition(async () => {
1068
1138
  try {
1069
1139
  setActionError(null);
1070
1140
  await installHooksWebAction("user", targets);
1071
1141
  } catch (e) {
1072
- setActionError(e instanceof Error ? e.message : "Failed to reinstall.");
1142
+ fireActionError("cli_reinstall", e instanceof Error ? e.message : "Failed to reinstall.");
1073
1143
  } finally {
1074
1144
  await reload();
1075
1145
  }
@@ -1086,7 +1156,7 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
1086
1156
  await updatePolicyParamsAction(policyName, params);
1087
1157
  await reload();
1088
1158
  } catch (e) {
1089
- setActionError(e instanceof Error ? e.message : "Failed to save configuration.");
1159
+ fireActionError("param_update", e instanceof Error ? e.message : "Failed to save configuration.");
1090
1160
  }
1091
1161
  });
1092
1162
  };
@@ -1111,7 +1181,10 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
1111
1181
  {configuringPolicy && (
1112
1182
  <PolicyConfigModal
1113
1183
  policy={configuringPolicy}
1114
- onClose={() => setConfiguringPolicy(null)}
1184
+ onClose={() => {
1185
+ capture("policy_config_modal_closed", { policy_name: configuringPolicy.name, action: "cancel" });
1186
+ setConfiguringPolicy(null);
1187
+ }}
1115
1188
  onSave={handleSaveParams}
1116
1189
  />
1117
1190
  )}
@@ -1379,7 +1452,19 @@ function PoliciesTab({ onHooksInstallChange }: { onHooksInstallChange?: (install
1379
1452
  {policy.params && Object.keys(policy.params).length > 0 && (
1380
1453
  <button
1381
1454
  className="shrink-0 mt-0.5 text-muted-foreground hover:text-primary transition-colors"
1382
- onClick={() => setConfiguringPolicy(policy)}
1455
+ onClick={() => {
1456
+ const customizedCount = Object.entries(policy.params ?? {}).filter(([k, spec]) => {
1457
+ const currentVal = policy.currentParams?.[k] ?? spec.default;
1458
+ return JSON.stringify(currentVal) !== JSON.stringify(spec.default);
1459
+ }).length;
1460
+ capture("policy_config_modal_opened", {
1461
+ policy_name: policy.name,
1462
+ param_count: Object.keys(policy.params ?? {}).length,
1463
+ has_customized_params: customizedCount > 0,
1464
+ customized_count: customizedCount,
1465
+ });
1466
+ setConfiguringPolicy(policy);
1467
+ }}
1383
1468
  title="Edit parameters"
1384
1469
  >
1385
1470
  <Settings className="h-3.5 w-3.5" />
@@ -1483,9 +1568,11 @@ function TabBar({
1483
1568
 
1484
1569
  export default function HooksClient({ initialTab = "activity" }: { initialTab?: "activity" | "policies" }) {
1485
1570
  const url = useUrlParams();
1571
+ const { capture } = usePostHog();
1486
1572
  const [activeTab, setActiveTab] = useState<"activity" | "policies">(initialTab);
1487
1573
  const [hooksInstalled, setHooksInstalled] = useState<boolean | undefined>(undefined);
1488
1574
  const [policyCounts, setPolicyCounts] = useState<{ enabled: number; total: number } | null>(null);
1575
+ const [installedCliLabels, setInstalledCliLabels] = useState<string[]>([]);
1489
1576
 
1490
1577
  useEffect(() => {
1491
1578
  getHooksConfigAction()
@@ -1495,11 +1582,21 @@ export default function HooksClient({ initialTab = "activity" }: { initialTab?:
1495
1582
  enabled: cfg.enabledPolicies.length,
1496
1583
  total: cfg.policies.length + (cfg.customPolicies?.length ?? 0),
1497
1584
  });
1585
+ setInstalledCliLabels(cfg.clis.filter((c) => c.installed).map((c) => c.label));
1498
1586
  })
1499
1587
  .catch(() => setHooksInstalled(undefined));
1500
1588
  }, []);
1501
1589
 
1590
+ const evaluationsHeading = installedCliLabels.length === 0
1591
+ ? "Policy evaluations"
1592
+ : installedCliLabels.length <= 3
1593
+ ? `Policy evaluations across ${installedCliLabels.join(", ")}`
1594
+ : `Policy evaluations across ${installedCliLabels.length} agents`;
1595
+
1502
1596
  const handleTabChange = (tab: "activity" | "policies") => {
1597
+ if (tab !== activeTab) {
1598
+ capture("policies_tab_switched", { tab, from_tab: activeTab });
1599
+ }
1503
1600
  setActiveTab(tab);
1504
1601
  url.setAll({ tab: tab === "activity" ? undefined : tab });
1505
1602
  };
@@ -1529,7 +1626,7 @@ export default function HooksClient({ initialTab = "activity" }: { initialTab?:
1529
1626
  <p className="text-sm text-muted-foreground mt-1">
1530
1627
  {activeTab === "activity" ? (
1531
1628
  <>
1532
- Policy evaluations for Claude
1629
+ {evaluationsHeading}
1533
1630
  {policyCounts && (
1534
1631
  <span className="text-muted-foreground/60">
1535
1632
  {" · "}enabled policies{" "}
@@ -24,7 +24,7 @@ export const Navbar: React.FC<{ disabledPages?: string[] }> = ({ disabledPages =
24
24
  <div className="flex items-center justify-between h-16">
25
25
  <div className="flex items-center gap-3">
26
26
  <a
27
- href="https://github.com/exospherehost/failproofai"
27
+ href="https://github.com/failproofai/failproofai"
28
28
  target="_blank"
29
29
  rel="noopener noreferrer"
30
30
  className="flex items-center hover:opacity-80 transition-opacity"
@@ -5,14 +5,14 @@ import React, { useState, useCallback } from "react";
5
5
  import { GitBranch, Lightbulb, Bug, MessageSquare, ChevronDown, Star, BookOpen, Hash } from "lucide-react";
6
6
  import { Button } from "@/components/ui/button";
7
7
 
8
- const GITHUB_REPO = "https://github.com/exospherehost/failproofai";
8
+ const GITHUB_REPO = "https://github.com/failproofai/failproofai";
9
9
  const CONTACT_EMAIL = "failproofai@exosphere.host";
10
10
 
11
11
  const options = [
12
12
  {
13
13
  label: "Star us on GitHub",
14
14
  icon: Star,
15
- href: "https://github.com/exospherehost/failproofai",
15
+ href: "https://github.com/failproofai/failproofai",
16
16
  },
17
17
  {
18
18
  label: "Documentation",
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Claude Code session transcript discovery helpers.
3
+ *
4
+ * Claude stores transcripts at:
5
+ * <CLAUDE_PROJECTS_PATH>/<encoded-cwd>/<sessionId>.jsonl
6
+ *
7
+ * Subagent transcripts (when a session spawned subagents) live alongside:
8
+ * <CLAUDE_PROJECTS_PATH>/<encoded-cwd>/<sessionId>/subagents/<agentId>.jsonl
9
+ *
10
+ * The parser for these files lives in `lib/log-entries.ts` (`parseLogContent`,
11
+ * `parseSessionLog`). This module exposes discovery only — the audit pipeline
12
+ * and any future Claude-specific tool walk the directory layout via these
13
+ * helpers instead of re-implementing the path conventions.
14
+ *
15
+ * Mirrors the shape of `lib/cursor-sessions.ts` for parity across CLIs.
16
+ */
17
+ import { readdirSync, statSync, existsSync } from "node:fs";
18
+ import { join, basename } from "node:path";
19
+ import { getClaudeProjectsPath, decodeFolderName } from "./paths";
20
+
21
+ const UUID_RE = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
22
+
23
+ export interface ClaudeProjectFolder {
24
+ /** Encoded folder name on disk (e.g. "-home-user-project"). */
25
+ name: string;
26
+ /** Decoded filesystem path (e.g. "/home/user/project"). */
27
+ cwd: string;
28
+ /** Absolute path of the encoded folder. */
29
+ path: string;
30
+ }
31
+
32
+ export interface ClaudeTranscriptFile {
33
+ projectName: string;
34
+ /** Decoded cwd of the project. */
35
+ cwd: string;
36
+ sessionId: string;
37
+ /** Absolute path of `<sessionId>.jsonl`. */
38
+ transcriptPath: string;
39
+ mtimeMs: number;
40
+ sizeBytes: number;
41
+ /** True when this is a subagent transcript spawned from a parent session. */
42
+ isSubagent: boolean;
43
+ }
44
+
45
+ /** Returns the Claude projects root, honoring the CLAUDE_PROJECTS_PATH env var. */
46
+ export function getClaudeProjectsRoot(): string {
47
+ return getClaudeProjectsPath();
48
+ }
49
+
50
+ /** Lists all Claude project folders (one per encoded cwd). Returns [] if the
51
+ * projects root doesn't exist. Filenames that don't look like Claude project
52
+ * encodings are still included — encoding is permissive. */
53
+ export function listClaudeProjects(): ClaudeProjectFolder[] {
54
+ const root = getClaudeProjectsRoot();
55
+ let entries: import("node:fs").Dirent[];
56
+ try {
57
+ entries = readdirSync(root, { withFileTypes: true });
58
+ } catch {
59
+ return [];
60
+ }
61
+ return entries
62
+ .filter((e) => e.isDirectory())
63
+ .map((e) => ({
64
+ name: e.name,
65
+ cwd: decodeFolderName(e.name),
66
+ path: join(root, e.name),
67
+ }));
68
+ }
69
+
70
+ /** Lists every JSONL transcript under one Claude project folder, including
71
+ * subagent transcripts under `<sessionId>/subagents/`. Returns [] on missing
72
+ * or unreadable paths. */
73
+ export function listClaudeTranscripts(project: ClaudeProjectFolder): ClaudeTranscriptFile[] {
74
+ const out: ClaudeTranscriptFile[] = [];
75
+ let entries: import("node:fs").Dirent[];
76
+ try {
77
+ entries = readdirSync(project.path, { withFileTypes: true });
78
+ } catch {
79
+ return out;
80
+ }
81
+
82
+ for (const entry of entries) {
83
+ if (entry.isFile() && entry.name.endsWith(".jsonl")) {
84
+ const sessionId = entry.name.slice(0, -".jsonl".length);
85
+ if (!UUID_RE.test(sessionId)) continue;
86
+ const transcriptPath = join(project.path, entry.name);
87
+ try {
88
+ const s = statSync(transcriptPath);
89
+ out.push({
90
+ projectName: project.name,
91
+ cwd: project.cwd,
92
+ sessionId,
93
+ transcriptPath,
94
+ mtimeMs: s.mtimeMs,
95
+ sizeBytes: s.size,
96
+ isSubagent: false,
97
+ });
98
+ } catch {
99
+ // unreadable — skip
100
+ }
101
+ } else if (entry.isDirectory() && UUID_RE.test(entry.name)) {
102
+ // Subagent transcripts at <sessionId>/subagents/<agentId>.jsonl
103
+ const subDir = join(project.path, entry.name, "subagents");
104
+ if (!existsSync(subDir)) continue;
105
+ let subEntries: import("node:fs").Dirent[];
106
+ try {
107
+ subEntries = readdirSync(subDir, { withFileTypes: true });
108
+ } catch {
109
+ continue;
110
+ }
111
+ for (const sub of subEntries) {
112
+ if (!sub.isFile() || !sub.name.endsWith(".jsonl")) continue;
113
+ const agentId = sub.name.slice(0, -".jsonl".length);
114
+ const transcriptPath = join(subDir, sub.name);
115
+ try {
116
+ const s = statSync(transcriptPath);
117
+ out.push({
118
+ projectName: project.name,
119
+ cwd: project.cwd,
120
+ sessionId: agentId,
121
+ transcriptPath,
122
+ mtimeMs: s.mtimeMs,
123
+ sizeBytes: s.size,
124
+ isSubagent: true,
125
+ });
126
+ } catch {
127
+ // unreadable — skip
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ return out;
134
+ }
135
+
136
+ /** Convenience: locate one Claude transcript file by session ID across all
137
+ * project folders. Returns null if not found. */
138
+ export function findClaudeTranscript(sessionId: string): string | null {
139
+ if (!UUID_RE.test(sessionId)) return null;
140
+ for (const project of listClaudeProjects()) {
141
+ const candidate = join(project.path, `${sessionId}.jsonl`);
142
+ if (existsSync(candidate)) return candidate;
143
+ // Subagent fallback
144
+ let entries: import("node:fs").Dirent[];
145
+ try {
146
+ entries = readdirSync(project.path, { withFileTypes: true });
147
+ } catch {
148
+ continue;
149
+ }
150
+ for (const entry of entries) {
151
+ if (!entry.isDirectory() || !UUID_RE.test(entry.name)) continue;
152
+ const subCandidate = join(project.path, entry.name, "subagents", `${sessionId}.jsonl`);
153
+ if (existsSync(subCandidate)) return subCandidate;
154
+ }
155
+ }
156
+ return null;
157
+ }
158
+
159
+ /** For tests: list all session IDs across all projects. */
160
+ export function _listAllSessionIds(): string[] {
161
+ const ids: string[] = [];
162
+ for (const project of listClaudeProjects()) {
163
+ for (const t of listClaudeTranscripts(project)) {
164
+ ids.push(t.sessionId);
165
+ }
166
+ }
167
+ return ids;
168
+ }
169
+
170
+ /** For tests: stat one transcript file. */
171
+ export function _statTranscript(path: string): { mtimeMs: number; sizeBytes: number } | null {
172
+ try {
173
+ const s = statSync(path);
174
+ return { mtimeMs: s.mtimeMs, sizeBytes: s.size };
175
+ } catch {
176
+ return null;
177
+ }
178
+ }
179
+
180
+ /** Re-export for callers that want to construct paths from a basename. */
181
+ export { basename };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/env",
3
- "version": "16.2.4",
3
+ "version": "16.2.6",
4
4
  "keywords": [
5
5
  "react",
6
6
  "next",
@@ -531,7 +531,7 @@ function createReplacements(segment, paramValue) {
531
531
  encodeURIComponent)
532
532
  };
533
533
  }
534
- async function buildAppStaticPaths({ dir, page, route, distDir, cacheComponents, authInterrupts, segments, isrFlushToDisk, cacheHandler, cacheLifeProfiles, requestHeaders, cacheHandlers, cacheMaxMemorySize, fetchCacheKeyPrefix, nextConfigOutput, ComponentMod, isRoutePPREnabled = false, partialFallbacksEnabled = false, buildId, rootParamKeys }) {
534
+ async function buildAppStaticPaths({ dir, page, route, distDir, cacheComponents, authInterrupts, segments, isrFlushToDisk, cacheHandler, cacheLifeProfiles, requestHeaders, cacheHandlers, cacheMaxMemorySize, fetchCacheKeyPrefix, nextConfigOutput, ComponentMod, isRoutePPREnabled = false, partialFallbacksEnabled = false, buildId, deploymentId, rootParamKeys }) {
535
535
  if (segments.some((generate)=>{
536
536
  var _generate_config;
537
537
  return ((_generate_config = generate.config) == null ? void 0 : _generate_config.dynamicParams) === true;
@@ -574,6 +574,7 @@ async function buildAppStaticPaths({ dir, page, route, distDir, cacheComponents,
574
574
  onAfterTaskError: afterRunner.context.onTaskError
575
575
  },
576
576
  buildId,
577
+ deploymentId,
577
578
  previouslyRevalidatedTags: []
578
579
  });
579
580
  const routeParams = await ComponentMod.workAsyncStorage.run(store, generateRouteStaticParams, segments, store, ComponentMod.workUnitAsyncStorage, isRoutePPREnabled, rootParamKeys);
@@ -134,7 +134,7 @@ var HmrTarget = /*#__PURE__*/ function(HmrTarget) {
134
134
  HmrTarget["Server"] = "server";
135
135
  return HmrTarget;
136
136
  }({});
137
- const nextVersion = "16.2.4";
137
+ const nextVersion = "16.2.6";
138
138
  const ArchName = (0, _os.arch)();
139
139
  const PlatformName = (0, _os.platform)();
140
140
  function infoLog(...args) {
@@ -565,7 +565,7 @@ function printCustomRoutes({ redirects, rewrites, headers, onMatchHeaders }) {
565
565
  printRoutes(combinedRewrites, 'Rewrites');
566
566
  }
567
567
  }
568
- async function isPageStatic({ dir, page, distDir, configFileName, httpAgentOptions, locales, defaultLocale, parentId, pageRuntime, edgeInfo, pageType, cacheComponents, authInterrupts, originalAppPath, isrFlushToDisk, cacheMaxMemorySize, nextConfigOutput, cacheHandler, cacheHandlers, cacheLifeProfiles, pprConfig, partialFallbacksEnabled, buildId, clientAssetToken, sriEnabled }) {
568
+ async function isPageStatic({ dir, page, distDir, configFileName, httpAgentOptions, locales, defaultLocale, parentId, pageRuntime, edgeInfo, pageType, cacheComponents, authInterrupts, originalAppPath, isrFlushToDisk, cacheMaxMemorySize, nextConfigOutput, cacheHandler, cacheHandlers, cacheLifeProfiles, pprConfig, partialFallbacksEnabled, buildId, deploymentId, clientAssetToken, sriEnabled }) {
569
569
  // Skip page data collection for synthetic _global-error routes
570
570
  if (page === _constants1.UNDERSCORE_GLOBAL_ERROR_ROUTE) {
571
571
  return {
@@ -700,6 +700,7 @@ async function isPageStatic({ dir, page, distDir, configFileName, httpAgentOptio
700
700
  isRoutePPREnabled,
701
701
  partialFallbacksEnabled,
702
702
  buildId,
703
+ deploymentId,
703
704
  rootParamKeys
704
705
  }));
705
706
  }
@@ -312,7 +312,7 @@ async function createFetch(url, headers, fetchPriority, shouldImmediatelyDecode,
312
312
  // search param to it. This should not leak outside of this function, so we
313
313
  // track them separately.
314
314
  let fetchUrl = new URL(url);
315
- (0, _setcachebustingsearchparam.setCacheBustingSearchParam)(fetchUrl, headers);
315
+ await (0, _setcachebustingsearchparam.setCacheBustingSearchParam)(fetchUrl, headers);
316
316
  let processed = fetch(fetchUrl, fetchOptions).then(processFetch);
317
317
  let fetchPromise = processed.then(({ response })=>response);
318
318
  // Immediately pass the fetch promise to the Flight client so that the debug
@@ -367,7 +367,7 @@ async function createFetch(url, headers, fetchPriority, shouldImmediatelyDecode,
367
367
  // fetch again.
368
368
  // TODO: We should abort the previous request.
369
369
  fetchUrl = new URL(responseUrl);
370
- (0, _setcachebustingsearchparam.setCacheBustingSearchParam)(fetchUrl, headers);
370
+ await (0, _setcachebustingsearchparam.setCacheBustingSearchParam)(fetchUrl, headers);
371
371
  processed = fetch(fetchUrl, fetchOptions).then(processFetch);
372
372
  fetchPromise = processed.then(({ response })=>response);
373
373
  flightResponsePromise = shouldImmediatelyDecode ? createFromNextFetch(fetchPromise, headers) : null;