fleetlens 0.4.0 → 0.6.0

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 (440) hide show
  1. package/app/apps/web/.next/BUILD_ID +1 -1
  2. package/app/apps/web/.next/app-path-routes-manifest.json +16 -7
  3. package/app/apps/web/.next/build-manifest.json +7 -7
  4. package/app/apps/web/.next/prerender-manifest.json +3 -3
  5. package/app/apps/web/.next/required-server-files.json +2 -1
  6. package/app/apps/web/.next/routes-manifest.json +86 -24
  7. package/app/apps/web/.next/server/app/_global-error/page/build-manifest.json +4 -4
  8. package/app/apps/web/.next/server/app/_global-error/page.js +1 -1
  9. package/app/apps/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  10. package/app/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/app/apps/web/.next/server/app/_global-error.html +1 -1
  12. package/app/apps/web/.next/server/app/_global-error.rsc +7 -7
  13. package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  14. package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  15. package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  16. package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  17. package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/app/apps/web/.next/server/app/_not-found/page/build-manifest.json +4 -4
  19. package/app/apps/web/.next/server/app/_not-found/page.js +5 -4
  20. package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  21. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/app/apps/web/.next/server/app/api/digest/day/[date]/route/app-paths-manifest.json +3 -0
  23. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js +9 -0
  24. package/app/apps/web/.next/server/app/api/{insights/saved/[key] → digest/day/[date]}/route.js.nft.json +1 -1
  25. package/app/apps/web/.next/server/app/api/digest/day/[date]/route_client-reference-manifest.js +3 -0
  26. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route/app-paths-manifest.json +3 -0
  27. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js +9 -0
  28. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -0
  29. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route_client-reference-manifest.js +3 -0
  30. package/app/apps/web/.next/server/app/api/digest/month-index/route/app-paths-manifest.json +3 -0
  31. package/app/apps/web/.next/server/app/api/digest/month-index/route.js +7 -0
  32. package/app/apps/web/.next/server/app/api/{insights/months-index → digest/month-index}/route.js.nft.json +1 -1
  33. package/app/apps/web/.next/server/app/api/{insights/pdf/[key] → digest/month-index}/route_client-reference-manifest.js +1 -1
  34. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route/app-paths-manifest.json +3 -0
  35. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js +9 -0
  36. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -0
  37. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route_client-reference-manifest.js +3 -0
  38. package/app/apps/web/.next/server/app/api/digest/week-index/route/app-paths-manifest.json +3 -0
  39. package/app/apps/web/.next/server/app/api/digest/week-index/route.js +7 -0
  40. package/app/apps/web/.next/server/app/api/{insights/weeks-index → digest/week-index}/route.js.nft.json +1 -1
  41. package/app/apps/web/.next/server/app/api/digest/week-index/route_client-reference-manifest.js +3 -0
  42. package/app/apps/web/.next/server/app/api/jobs/route/app-paths-manifest.json +3 -0
  43. package/app/apps/web/.next/server/app/api/jobs/route.js +6 -0
  44. package/app/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -0
  45. package/app/apps/web/.next/server/app/api/jobs/route_client-reference-manifest.js +3 -0
  46. package/app/apps/web/.next/server/app/api/runs/[runId]/route/app-paths-manifest.json +3 -0
  47. package/app/apps/web/.next/server/app/api/runs/[runId]/route/build-manifest.json +9 -0
  48. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js +6 -0
  49. package/app/apps/web/.next/server/app/api/{insights/saved → runs/[runId]}/route.js.nft.json +1 -1
  50. package/app/apps/web/.next/server/app/api/runs/[runId]/route_client-reference-manifest.js +3 -0
  51. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route/app-paths-manifest.json +3 -0
  52. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route/build-manifest.json +9 -0
  53. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route/server-reference-manifest.json +4 -0
  54. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js +6 -0
  55. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.map +5 -0
  56. package/app/apps/web/.next/server/app/api/{insights/pdf/[key] → runs/[runId]/stream}/route.js.nft.json +1 -1
  57. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route_client-reference-manifest.js +3 -0
  58. package/app/apps/web/.next/server/app/api/runs/route/app-paths-manifest.json +3 -0
  59. package/app/apps/web/.next/server/app/api/runs/route/build-manifest.json +9 -0
  60. package/app/apps/web/.next/server/app/api/runs/route/server-reference-manifest.json +4 -0
  61. package/app/apps/web/.next/server/app/api/runs/route.js +6 -0
  62. package/app/apps/web/.next/server/app/api/runs/route.js.map +5 -0
  63. package/app/apps/web/.next/server/app/api/{insights → runs}/route.js.nft.json +1 -1
  64. package/app/apps/web/.next/server/app/api/runs/route_client-reference-manifest.js +3 -0
  65. package/app/apps/web/.next/server/app/api/settings/route/app-paths-manifest.json +3 -0
  66. package/app/apps/web/.next/server/app/api/settings/route/build-manifest.json +9 -0
  67. package/app/apps/web/.next/server/app/api/settings/route/server-reference-manifest.json +4 -0
  68. package/app/apps/web/.next/server/app/api/settings/route.js +10 -0
  69. package/app/apps/web/.next/server/app/api/settings/route.js.map +5 -0
  70. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -0
  71. package/app/apps/web/.next/server/app/api/{insights → settings}/route_client-reference-manifest.js +1 -1
  72. package/app/apps/web/.next/server/app/day/[date]/page/app-paths-manifest.json +3 -0
  73. package/app/apps/web/.next/server/app/{insights/print/[key] → day/[date]}/page/build-manifest.json +4 -4
  74. package/app/apps/web/.next/server/app/day/[date]/page/server-reference-manifest.json +4 -0
  75. package/app/apps/web/.next/server/app/day/[date]/page.js +18 -0
  76. package/app/apps/web/.next/server/app/day/[date]/page.js.map +5 -0
  77. package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -0
  78. package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +3 -0
  79. package/app/apps/web/.next/server/app/day/page/app-paths-manifest.json +3 -0
  80. package/app/apps/web/.next/server/app/day/page/build-manifest.json +17 -0
  81. package/app/apps/web/.next/server/app/day/page/next-font-manifest.json +6 -0
  82. package/app/apps/web/.next/server/app/day/page/react-loadable-manifest.json +1 -0
  83. package/app/apps/web/.next/server/app/day/page/server-reference-manifest.json +4 -0
  84. package/app/apps/web/.next/server/app/{insights/print/[key] → day}/page.js +11 -10
  85. package/app/apps/web/.next/server/app/day/page.js.map +5 -0
  86. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -0
  87. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +3 -0
  88. package/app/apps/web/.next/server/app/digest/[date]/page/app-paths-manifest.json +3 -0
  89. package/app/apps/web/.next/server/app/digest/[date]/page/build-manifest.json +17 -0
  90. package/app/apps/web/.next/server/app/digest/[date]/page/next-font-manifest.json +6 -0
  91. package/app/apps/web/.next/server/app/digest/[date]/page/react-loadable-manifest.json +1 -0
  92. package/app/apps/web/.next/server/app/digest/[date]/page/server-reference-manifest.json +4 -0
  93. package/app/apps/web/.next/server/app/digest/[date]/page.js +17 -0
  94. package/app/apps/web/.next/server/app/digest/[date]/page.js.map +5 -0
  95. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -0
  96. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +3 -0
  97. package/app/apps/web/.next/server/app/digest/page/app-paths-manifest.json +3 -0
  98. package/app/apps/web/.next/server/app/digest/page/build-manifest.json +17 -0
  99. package/app/apps/web/.next/server/app/digest/page/next-font-manifest.json +6 -0
  100. package/app/apps/web/.next/server/app/digest/page/react-loadable-manifest.json +1 -0
  101. package/app/apps/web/.next/server/app/digest/page/server-reference-manifest.json +4 -0
  102. package/app/apps/web/.next/server/app/digest/page.js +17 -0
  103. package/app/apps/web/.next/server/app/digest/page.js.map +5 -0
  104. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -0
  105. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +3 -0
  106. package/app/apps/web/.next/server/app/insights/[key]/page/build-manifest.json +4 -4
  107. package/app/apps/web/.next/server/app/insights/[key]/page.js +7 -5
  108. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  109. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  110. package/app/apps/web/.next/server/app/insights/page/build-manifest.json +4 -4
  111. package/app/apps/web/.next/server/app/insights/page.js +7 -5
  112. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  113. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  114. package/app/apps/web/.next/server/app/page/build-manifest.json +4 -4
  115. package/app/apps/web/.next/server/app/page.js +7 -6
  116. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  117. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  118. package/app/apps/web/.next/server/app/parallelism/page/build-manifest.json +4 -4
  119. package/app/apps/web/.next/server/app/parallelism/page.js +6 -5
  120. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  121. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  122. package/app/apps/web/.next/server/app/projects/[slug]/page/build-manifest.json +4 -4
  123. package/app/apps/web/.next/server/app/projects/[slug]/page.js +6 -5
  124. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  125. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  126. package/app/apps/web/.next/server/app/projects/page/build-manifest.json +4 -4
  127. package/app/apps/web/.next/server/app/projects/page.js +5 -4
  128. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  129. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  130. package/app/apps/web/.next/server/app/runs/page/app-paths-manifest.json +3 -0
  131. package/app/apps/web/.next/server/app/runs/page/build-manifest.json +17 -0
  132. package/app/apps/web/.next/server/app/runs/page/next-font-manifest.json +6 -0
  133. package/app/apps/web/.next/server/app/runs/page/react-loadable-manifest.json +1 -0
  134. package/app/apps/web/.next/server/app/runs/page/server-reference-manifest.json +4 -0
  135. package/app/apps/web/.next/server/app/runs/page.js +17 -0
  136. package/app/apps/web/.next/server/app/runs/page.js.map +5 -0
  137. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -0
  138. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +3 -0
  139. package/app/apps/web/.next/server/app/sessions/[id]/page/build-manifest.json +4 -4
  140. package/app/apps/web/.next/server/app/sessions/[id]/page.js +5 -4
  141. package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  142. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  143. package/app/apps/web/.next/server/app/sessions/page/build-manifest.json +4 -4
  144. package/app/apps/web/.next/server/app/sessions/page.js +5 -4
  145. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  146. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  147. package/app/apps/web/.next/server/app/settings/page/app-paths-manifest.json +3 -0
  148. package/app/apps/web/.next/server/app/settings/page/build-manifest.json +17 -0
  149. package/app/apps/web/.next/server/app/settings/page/next-font-manifest.json +6 -0
  150. package/app/apps/web/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
  151. package/app/apps/web/.next/server/app/settings/page/server-reference-manifest.json +4 -0
  152. package/app/apps/web/.next/server/app/settings/page.js +18 -0
  153. package/app/apps/web/.next/server/app/settings/page.js.map +5 -0
  154. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -0
  155. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +3 -0
  156. package/app/apps/web/.next/server/app/usage/page/build-manifest.json +4 -4
  157. package/app/apps/web/.next/server/app/usage/page.js +6 -5
  158. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  159. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  160. package/app/apps/web/.next/server/app-paths-manifest.json +16 -7
  161. package/app/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_digest_week_[startDate]_route_actions_0klqqsh.js +3 -0
  162. package/app/apps/web/.next/server/chunks/09og__next-internal_server_app_api_digest_month_[yearMonth]_route_actions_0i4ielu.js +3 -0
  163. package/app/apps/web/.next/server/chunks/[externals]__0o43ejh._.js +3 -0
  164. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0-vgrh1._.js +3 -0
  165. package/app/apps/web/.next/server/chunks/[root-of-the-server]__00n3f9y._.js +3 -0
  166. package/app/apps/web/.next/server/chunks/[root-of-the-server]__02zukjw._.js +3 -0
  167. package/app/apps/web/.next/server/chunks/[root-of-the-server]__067~im1._.js +6 -0
  168. package/app/apps/web/.next/server/chunks/[root-of-the-server]__06b4cj-._.js +3 -0
  169. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0_8zh-i._.js +9 -0
  170. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0e8n_x4._.js +3 -0
  171. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0ej_p3s._.js +9 -0
  172. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0jprdks._.js +9 -0
  173. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_digest_day_[date]_route_actions_09sxie5.js +3 -0
  174. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_digest_month-index_route_actions_0wldpbu.js +3 -0
  175. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_digest_week-index_route_actions_12c2wj2.js +3 -0
  176. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_jobs_route_actions_08kx~8-.js +3 -0
  177. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_runs_[runId]_route_actions_0dfcghc.js +3 -0
  178. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_runs_[runId]_stream_route_actions_0.8e8-k.js +3 -0
  179. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_runs_route_actions_0xyx82f.js +3 -0
  180. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_settings_route_actions_0.xv7sx.js +3 -0
  181. package/app/apps/web/.next/server/chunks/node_modules_next_036my~r._.js +49 -0
  182. package/app/apps/web/.next/server/chunks/packages_0e7q9u_._.js +3 -0
  183. package/app/apps/web/.next/server/chunks/packages_0n6p2ot._.js +3 -0
  184. package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +379 -0
  185. package/app/apps/web/.next/server/chunks/packages_parser_dist_fs_0bc7ptm.js +1 -1
  186. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-1_njm._.js +3 -0
  187. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-94ji~._.js +3 -0
  188. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__13xpdx0._.js → [root-of-the-server]__03uoeiw._.js} +2 -2
  189. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_6.inc._.js +1 -1
  190. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0d~2~le._.js +8 -0
  191. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0gio_ck._.js +1 -1
  192. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__08.d5ia._.js → [root-of-the-server]__0jdyefm._.js} +10 -10
  193. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ln9jsw._.js +3 -0
  194. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0z45d0g._.js → [root-of-the-server]__0lz4a~g._.js} +2 -48
  195. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0o1_g.~._.js +3 -0
  196. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0r4tks8._.js +3 -0
  197. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0rvzdnx._.js +3 -0
  198. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0euu8sa._.js → [root-of-the-server]__0u39afl._.js} +2 -2
  199. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0u5d7de._.js +12 -0
  200. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0w52fbc._.js +3 -3
  201. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0wwa6gh._.js +3 -0
  202. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0xy1qim._.js +3 -0
  203. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~_8vff._.js +3 -0
  204. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__10srpu0._.js +3 -0
  205. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__11v.eqw._.js +1 -1
  206. package/app/apps/web/.next/server/chunks/ssr/_02s1n-x._.js +8 -0
  207. package/app/apps/web/.next/server/chunks/ssr/_0fjbf--._.js +3 -0
  208. package/app/apps/web/.next/server/chunks/ssr/_0jw2sm7._.js +3 -0
  209. package/app/apps/web/.next/server/chunks/ssr/_0wj750k._.js +3 -0
  210. package/app/apps/web/.next/server/chunks/ssr/_0woap-3._.js +1 -1
  211. package/app/apps/web/.next/server/chunks/ssr/{_0xies90._.js → _0xu2pvc._.js} +2 -2
  212. package/app/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_day_[date]_page_actions_0u2kxb..js +3 -0
  213. package/app/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_day_page_actions_1042maj.js +3 -0
  214. package/app/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_digest_[date]_page_actions_0olu967.js +3 -0
  215. package/app/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_digest_page_actions_0bl.eil.js +3 -0
  216. package/app/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_runs_page_actions_0485qy7.js +3 -0
  217. package/app/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_settings_page_actions_0f6epye.js +3 -0
  218. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_day_[date]_day-view_tsx_0wjoe1u._.js +3 -0
  219. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_settings_ai-features-form_tsx_01p699p._.js +3 -0
  220. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0b-4-4j._.js +1 -1
  221. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0ly1xes._.js +6 -0
  222. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0txtsv5._.js +16 -0
  223. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0xs658s._.js +10 -0
  224. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_runs-live-board_tsx_0r6dkdq._.js +3 -0
  225. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_usage-charts-dashboard_tsx_0bgr_uv._.js +1 -1
  226. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_usage-data_ts_0xtv99n._.js +3 -0
  227. package/app/apps/web/.next/server/chunks/ssr/node_modules_0i2xw~e._.js +3 -0
  228. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_0e1izl_._.js +1 -1
  229. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d3d4wn.js +4 -0
  230. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0edz1ko.js +4 -0
  231. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0eq.n-n.js +4 -0
  232. package/app/apps/web/.next/server/chunks/ssr/{node_modules_next_dist_esm_build_templates_app-page_0vz7_px.js → node_modules_next_dist_esm_build_templates_app-page_0hcvt-s.js} +3 -3
  233. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nd5zu0.js +4 -0
  234. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11j1qy0.js +4 -0
  235. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12n1lw_.js +1 -1
  236. package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +3 -0
  237. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0-jvt~a._.js +1 -1
  238. package/app/apps/web/.next/server/functions-config-manifest.json +11 -6
  239. package/app/apps/web/.next/server/middleware-build-manifest.js +7 -7
  240. package/app/apps/web/.next/server/pages/500.html +1 -1
  241. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  242. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  243. package/app/apps/web/.next/static/chunks/0-yc2_pjxwwuq.js +1 -0
  244. package/app/apps/web/.next/static/chunks/0257pdz1-imal.js +2 -0
  245. package/app/apps/web/.next/static/chunks/05m.oz3kmf1p7.js +1 -0
  246. package/app/apps/web/.next/static/chunks/{0pqt~8bl3ukh4.js → 073081qv4uyn8.js} +1 -1
  247. package/app/apps/web/.next/static/chunks/{0018dy-m-kusj.js → 07lbm-sdh9c2j.js} +1 -1
  248. package/app/apps/web/.next/static/chunks/0858bgw2i4vob.js +1 -0
  249. package/app/apps/web/.next/static/chunks/0_7303jr0sf0w.js +10 -0
  250. package/app/apps/web/.next/static/chunks/0byz8fqw.exef.js +1 -0
  251. package/app/apps/web/.next/static/chunks/0coa1800xqgfj.js +1 -0
  252. package/app/apps/web/.next/static/chunks/0fs3gxea5h0s3.css +1 -0
  253. package/app/apps/web/.next/static/chunks/0k1psab.bybh9.js +14 -0
  254. package/app/apps/web/.next/static/chunks/0k9pksi_i.odf.js +1 -0
  255. package/app/apps/web/.next/static/chunks/0m62vx92~0_0d.js +1 -0
  256. package/app/apps/web/.next/static/chunks/0mc8aa8z.0-5l.js +8 -0
  257. package/app/apps/web/.next/static/chunks/0mykrrv810ra-.js +31 -0
  258. package/app/apps/web/.next/static/chunks/0o9ayt8sknubd.js +1 -0
  259. package/app/apps/web/.next/static/chunks/0osdgl2.9cl1q.js +6 -0
  260. package/app/apps/web/.next/static/chunks/0xfu09fn_358k.js +4 -0
  261. package/app/apps/web/.next/static/chunks/171za22fv684..js +6 -0
  262. package/app/apps/web/.next/static/chunks/17u2ww8ya5dv1.js +6 -0
  263. package/app/apps/web/.next/static/chunks/{turbopack-169w-1._23ra_.js → turbopack-0_p36yduv.waj.js} +1 -1
  264. package/app/apps/web/app/api/digest/day/[date]/route.ts +152 -0
  265. package/app/apps/web/app/api/digest/month/[yearMonth]/route.ts +147 -0
  266. package/app/apps/web/app/api/digest/month-index/route.ts +103 -0
  267. package/app/apps/web/app/api/digest/week/[startDate]/route.ts +149 -0
  268. package/app/apps/web/app/api/{insights/weeks-index → digest/week-index}/route.ts +45 -33
  269. package/app/apps/web/app/api/jobs/route.ts +8 -0
  270. package/app/apps/web/app/api/runs/[runId]/route.ts +64 -0
  271. package/app/apps/web/app/api/runs/[runId]/stream/route.ts +154 -0
  272. package/app/apps/web/app/api/runs/route.ts +266 -0
  273. package/app/apps/web/app/api/settings/route.ts +35 -0
  274. package/app/apps/web/app/day/[date]/day-view.tsx +193 -0
  275. package/app/apps/web/app/day/[date]/page.tsx +175 -0
  276. package/app/apps/web/app/day/page.tsx +8 -0
  277. package/app/apps/web/app/digest/[date]/page.tsx +15 -0
  278. package/app/apps/web/app/digest/page.tsx +7 -0
  279. package/app/apps/web/app/insights/[key]/page.tsx +106 -48
  280. package/app/apps/web/app/insights/page.tsx +133 -3
  281. package/app/apps/web/app/layout.tsx +23 -3
  282. package/app/apps/web/app/page.tsx +33 -4
  283. package/app/apps/web/app/parallelism/gantt-chart.tsx +67 -1
  284. package/app/apps/web/app/parallelism/page.tsx +8 -278
  285. package/app/apps/web/app/projects/[slug]/page.tsx +153 -0
  286. package/app/apps/web/app/projects/page.tsx +49 -4
  287. package/app/apps/web/app/projects/projects-view.tsx +79 -68
  288. package/app/apps/web/app/runs/page.tsx +21 -0
  289. package/app/apps/web/app/sessions/[id]/page.tsx +12 -1
  290. package/app/apps/web/app/sessions/[id]/session-view.tsx +569 -21
  291. package/app/apps/web/app/sessions/page.tsx +19 -3
  292. package/app/apps/web/app/sessions/sessions-grid.tsx +172 -131
  293. package/app/apps/web/app/settings/ai-features-form.tsx +45 -0
  294. package/app/apps/web/app/settings/page.tsx +20 -0
  295. package/app/apps/web/app/usage/page.tsx +45 -3
  296. package/app/apps/web/components/auto-generate-yesterday.tsx +96 -0
  297. package/app/apps/web/components/backfill-drawer.tsx +309 -0
  298. package/app/apps/web/components/dashboard-view.tsx +4 -2
  299. package/app/apps/web/components/date-nav.tsx +385 -0
  300. package/app/apps/web/components/day-digest-view.tsx +180 -0
  301. package/app/apps/web/components/day-digest.tsx +489 -0
  302. package/app/apps/web/components/flag-chip.tsx +54 -0
  303. package/app/apps/web/components/goal-bar.tsx +63 -0
  304. package/app/apps/web/components/heatmap.tsx +78 -1
  305. package/app/apps/web/components/helpfulness-sparkline.tsx +82 -0
  306. package/app/apps/web/components/insights-history.tsx +211 -0
  307. package/app/apps/web/components/insights-top-bar.tsx +216 -0
  308. package/app/apps/web/components/job-queue-widget.tsx +274 -0
  309. package/app/apps/web/components/live-sessions-widget.tsx +38 -3
  310. package/app/apps/web/components/month-digest-view.tsx +138 -0
  311. package/app/apps/web/components/month-digest.tsx +216 -0
  312. package/app/apps/web/components/outcome-mix-row.tsx +37 -0
  313. package/app/apps/web/components/outcome-pill.tsx +101 -0
  314. package/app/apps/web/components/previous-cycles-trend.tsx +155 -0
  315. package/app/apps/web/components/recent-days-panel.tsx +83 -0
  316. package/app/apps/web/components/runs-live-board.tsx +513 -0
  317. package/app/apps/web/components/sidebar.tsx +38 -4
  318. package/app/apps/web/components/usage-chart-range.tsx +58 -6
  319. package/app/apps/web/components/usage-chart.tsx +94 -7
  320. package/app/apps/web/components/usage-charts-dashboard.tsx +20 -1
  321. package/app/apps/web/components/week-digest-view.tsx +226 -0
  322. package/app/apps/web/components/week-digest.tsx +2128 -0
  323. package/app/apps/web/components/yesterday-hero.tsx +110 -0
  324. package/app/apps/web/lib/auto-week-fire.ts +37 -0
  325. package/app/apps/web/lib/calibration-data.ts +171 -0
  326. package/app/apps/web/lib/entries-index.ts +174 -0
  327. package/app/apps/web/lib/entries.ts +72 -0
  328. package/app/apps/web/lib/inflight-coalesce.test.ts +43 -0
  329. package/app/apps/web/lib/inflight-coalesce.ts +19 -0
  330. package/app/apps/web/lib/jobs.ts +170 -0
  331. package/app/apps/web/lib/usage-data.ts +37 -0
  332. package/app/apps/web/lib/validate-settings.test.ts +25 -0
  333. package/app/apps/web/lib/validate-settings.ts +9 -0
  334. package/app/apps/web/next.config.ts +1 -1
  335. package/app/apps/web/package.json +4 -2
  336. package/app/apps/web/server.js +1 -1
  337. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  338. package/app/apps/web/vitest.config.ts +9 -0
  339. package/dist/daemon-worker.js +1758 -713
  340. package/dist/index.js +11308 -1888
  341. package/package.json +4 -1
  342. package/app/apps/web/.next/server/app/api/insights/months-index/route/app-paths-manifest.json +0 -3
  343. package/app/apps/web/.next/server/app/api/insights/months-index/route.js +0 -7
  344. package/app/apps/web/.next/server/app/api/insights/months-index/route_client-reference-manifest.js +0 -3
  345. package/app/apps/web/.next/server/app/api/insights/pdf/[key]/route/app-paths-manifest.json +0 -3
  346. package/app/apps/web/.next/server/app/api/insights/pdf/[key]/route.js +0 -6
  347. package/app/apps/web/.next/server/app/api/insights/route/app-paths-manifest.json +0 -3
  348. package/app/apps/web/.next/server/app/api/insights/route.js +0 -8
  349. package/app/apps/web/.next/server/app/api/insights/saved/[key]/route/app-paths-manifest.json +0 -3
  350. package/app/apps/web/.next/server/app/api/insights/saved/[key]/route.js +0 -6
  351. package/app/apps/web/.next/server/app/api/insights/saved/[key]/route_client-reference-manifest.js +0 -3
  352. package/app/apps/web/.next/server/app/api/insights/saved/route/app-paths-manifest.json +0 -3
  353. package/app/apps/web/.next/server/app/api/insights/saved/route.js +0 -6
  354. package/app/apps/web/.next/server/app/api/insights/saved/route_client-reference-manifest.js +0 -3
  355. package/app/apps/web/.next/server/app/api/insights/weeks-index/route/app-paths-manifest.json +0 -3
  356. package/app/apps/web/.next/server/app/api/insights/weeks-index/route.js +0 -7
  357. package/app/apps/web/.next/server/app/api/insights/weeks-index/route_client-reference-manifest.js +0 -3
  358. package/app/apps/web/.next/server/app/insights/print/[key]/page/app-paths-manifest.json +0 -3
  359. package/app/apps/web/.next/server/app/insights/print/[key]/page.js.nft.json +0 -1
  360. package/app/apps/web/.next/server/app/insights/print/[key]/page_client-reference-manifest.js +0 -3
  361. package/app/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_insights_months-index_route_actions_0~h~zci.js +0 -3
  362. package/app/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_insights_saved_[key]_route_actions_0a5j9yw.js +0 -3
  363. package/app/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_insights_weeks-index_route_actions_0hh-1c7.js +0 -3
  364. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0.hmj0z._.js +0 -3
  365. package/app/apps/web/.next/server/chunks/[root-of-the-server]__01h_g-p._.js +0 -3
  366. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0nh-z10._.js +0 -3
  367. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0ri7q~r._.js +0 -3
  368. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0rr1~~x._.js +0 -3
  369. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0s0gv.0._.js +0 -3
  370. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_insights_pdf_[key]_route_actions_0lu-lnx.js +0 -3
  371. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_insights_route_actions_0h8l5lz.js +0 -3
  372. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_insights_saved_route_actions_13rlblw.js +0 -3
  373. package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_00t2xj6.js +0 -68
  374. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0.tsxpj._.js +0 -3
  375. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__00z7zlm._.js +0 -3
  376. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__08pen0k._.js +0 -3
  377. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0b323~k._.js +0 -8
  378. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0gx-4qa._.js +0 -3
  379. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0wv27wt._.js +0 -3
  380. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__13itnvx._.js +0 -3
  381. package/app/apps/web/.next/server/chunks/ssr/_09n75_5._.js +0 -8
  382. package/app/apps/web/.next/server/chunks/ssr/_0r~__0v._.js +0 -12
  383. package/app/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_insights_print_[key]_page_actions_0a853fw.js +0 -3
  384. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_parallelism_08vub.0._.js +0 -3
  385. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_06j3c.0._.js +0 -8
  386. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0bbo_pd._.js +0 -8
  387. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_insight-report_tsx_13q2a-c._.js +0 -12
  388. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_insights-view_tsx_11730ta._.js +0 -6
  389. package/app/apps/web/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0nqz8dw._.js +0 -3
  390. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_0t-hj0x._.js +0 -3
  391. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_analytics_0k4dgst.js +0 -3
  392. package/app/apps/web/.next/static/chunks/028_pmk40b69_.js +0 -6
  393. package/app/apps/web/.next/static/chunks/03.mv4y4.w-vb.js +0 -6
  394. package/app/apps/web/.next/static/chunks/03_7xtpi9sv4g.js +0 -4
  395. package/app/apps/web/.next/static/chunks/03g5dw5eskotd.js +0 -6
  396. package/app/apps/web/.next/static/chunks/063oimt30jeo9.js +0 -10
  397. package/app/apps/web/.next/static/chunks/08c1pcrocqq5s.js +0 -6
  398. package/app/apps/web/.next/static/chunks/0e-wrhqh4h3r5.js +0 -2
  399. package/app/apps/web/.next/static/chunks/0fc6dk2qtokwh.js +0 -1
  400. package/app/apps/web/.next/static/chunks/0i7er7_bfab36.js +0 -10
  401. package/app/apps/web/.next/static/chunks/0ipytyi01h0ta.js +0 -1
  402. package/app/apps/web/.next/static/chunks/0lsznd4_avzhv.js +0 -6
  403. package/app/apps/web/.next/static/chunks/0lty3v_i9mde7.js +0 -1
  404. package/app/apps/web/.next/static/chunks/0vekjjj4pidlz.css +0 -1
  405. package/app/apps/web/.next/static/chunks/137uw2-qbro07.js +0 -31
  406. package/app/apps/web/app/api/insights/months-index/route.ts +0 -80
  407. package/app/apps/web/app/api/insights/pdf/[key]/route.ts +0 -45
  408. package/app/apps/web/app/api/insights/route.ts +0 -508
  409. package/app/apps/web/app/api/insights/saved/[key]/route.ts +0 -11
  410. package/app/apps/web/app/api/insights/saved/route.ts +0 -9
  411. package/app/apps/web/app/insights/print/[key]/page.tsx +0 -73
  412. package/app/apps/web/components/insight-report.tsx +0 -1031
  413. package/app/apps/web/components/insights-view.tsx +0 -647
  414. package/app/apps/web/lib/ai/insights-prompt.ts +0 -71
  415. package/app/apps/web/lib/ai/saved-reports.ts +0 -83
  416. /package/app/apps/web/.next/server/app/api/{insights/months-index → digest/day/[date]}/route/build-manifest.json +0 -0
  417. /package/app/apps/web/.next/server/app/api/{insights/months-index → digest/day/[date]}/route/server-reference-manifest.json +0 -0
  418. /package/app/apps/web/.next/server/app/api/{insights/months-index → digest/day/[date]}/route.js.map +0 -0
  419. /package/app/apps/web/.next/server/app/api/{insights → digest/month/[yearMonth]}/route/build-manifest.json +0 -0
  420. /package/app/apps/web/.next/server/app/api/{insights → digest/month/[yearMonth]}/route/server-reference-manifest.json +0 -0
  421. /package/app/apps/web/.next/server/app/api/{insights → digest/month/[yearMonth]}/route.js.map +0 -0
  422. /package/app/apps/web/.next/server/app/api/{insights/pdf/[key] → digest/month-index}/route/build-manifest.json +0 -0
  423. /package/app/apps/web/.next/server/app/api/{insights/pdf/[key] → digest/month-index}/route/server-reference-manifest.json +0 -0
  424. /package/app/apps/web/.next/server/app/api/{insights/pdf/[key] → digest/month-index}/route.js.map +0 -0
  425. /package/app/apps/web/.next/server/app/api/{insights/saved → digest/week/[startDate]}/route/build-manifest.json +0 -0
  426. /package/app/apps/web/.next/server/app/api/{insights/saved → digest/week/[startDate]}/route/server-reference-manifest.json +0 -0
  427. /package/app/apps/web/.next/server/app/api/{insights/saved → digest/week/[startDate]}/route.js.map +0 -0
  428. /package/app/apps/web/.next/server/app/api/{insights/saved/[key] → digest/week-index}/route/build-manifest.json +0 -0
  429. /package/app/apps/web/.next/server/app/api/{insights/saved/[key] → digest/week-index}/route/server-reference-manifest.json +0 -0
  430. /package/app/apps/web/.next/server/app/api/{insights/saved/[key] → digest/week-index}/route.js.map +0 -0
  431. /package/app/apps/web/.next/server/app/api/{insights/weeks-index → jobs}/route/build-manifest.json +0 -0
  432. /package/app/apps/web/.next/server/app/api/{insights/weeks-index → jobs}/route/server-reference-manifest.json +0 -0
  433. /package/app/apps/web/.next/server/app/api/{insights/weeks-index → jobs}/route.js.map +0 -0
  434. /package/app/apps/web/.next/server/app/{insights/print/[key]/page → api/runs/[runId]/route}/server-reference-manifest.json +0 -0
  435. /package/app/apps/web/.next/server/app/{insights/print/[key]/page.js.map → api/runs/[runId]/route.js.map} +0 -0
  436. /package/app/apps/web/.next/server/app/{insights/print/[key] → day/[date]}/page/next-font-manifest.json +0 -0
  437. /package/app/apps/web/.next/server/app/{insights/print/[key] → day/[date]}/page/react-loadable-manifest.json +0 -0
  438. /package/app/apps/web/.next/static/{G_4ofKI9v9ARC_lb9JILZ → 8tTWPvUhtatZEoocIhamh}/_buildManifest.js +0 -0
  439. /package/app/apps/web/.next/static/{G_4ofKI9v9ARC_lb9JILZ → 8tTWPvUhtatZEoocIhamh}/_clientMiddlewareManifest.js +0 -0
  440. /package/app/apps/web/.next/static/{G_4ofKI9v9ARC_lb9JILZ → 8tTWPvUhtatZEoocIhamh}/_ssgManifest.js +0 -0
@@ -0,0 +1,379 @@
1
+ module.exports=[82111,78325,56614,20441,77242,21628,e=>{"use strict";let t,s=/^<teammate-message\b/,n=/^Base directory for this skill:/,r=/^<command-name>|^<local-command-stdout>/;function a(e){let t=`${e.description} ${e.prompt_preview}`.toLowerCase();return/\b(re-?review|review[s]?|verify|audit|spec[- ]review|code[- ]quality|code[- ]reuse|efficiency review|sanity check|quick test)\b/.test(t)?"reviewer":/\b(implement|build chunk|build task|initialize|create the|add the)\b/.test(t)?"implementer":/\bexplore\b|\binventory\b|\bmap\b.*\b(codebase|repo|branch)\b|\baudit\b.*coverage/.test(t)?"explorer":/\b(investigate|research|reverse[- ]engineer|study|analy[sz]e|look up|tell me|brief me on|find out)\b/.test(t)?"researcher":/\b(env(?:ironment)? setup|configure|setup|bootstrap)\b/.test(t)?"env-setup":/\b(polish|cleanup|fix|refactor)\b/.test(t)?"polish":"other"}let i=/^(general-purpose|Explore|Plan|claude-code-guide|playwright-qa-verifier|statusline-setup|frontend-design:|code-review:|code-simplifier:|codex:|superpowers:)/;function o(e){if(e.numbers.turn_count<2)return null;let t=e.subagents??[],s=t.map(a),n=s.filter(e=>"reviewer"===e).length,r=s.filter(e=>"implementer"===e).length,i=s.filter(e=>"explorer"===e||"researcher"===e).length,o=t.some(e=>e.background);if(r>=2&&t.filter(e=>/\b(chunk|task)\s*\d+/i.test(`${e.description} ${e.prompt_preview}`)).length>=2)return"chunk-implementation";if(n>=3&&0===r){let e=new Set;for(let n=0;n<t.length;n++){if("reviewer"!==s[n])continue;let r=t[n].description.toLowerCase().replace(/[^a-z0-9 ]/g,"").split(/\s+/).filter(e=>e.length>2).slice(0,3).join("|");e.add(r)}if(e.size>=3)return"reviewer-triad"}if(n>=2)return"spec-review-loop";if(i>=2||i>=1&&r>=1)return"research-then-build";if(o&&t.length>=1)return"background-coordinated";if(0===t.length){let t=(e.first_user||"").trim().toLowerCase();if(/^continue\b/.test(t)||"continue."===t)return"solo-continuation";if(Object.keys(e.skills??{}).some(e=>/brainstorm|writing-plans|brainstorming/i.test(e)))return"solo-design"}return"solo-build"}function l(e){if(!e)return[];let t=[];return/<teammate-message\b/i.test(e)&&t.push("teammate"),/<task-notification\b/i.test(e)&&t.push("task-notification"),/<local-command-caveat\b/i.test(e)&&t.push("local-command-caveat"),/<command-(message|name)\b/i.test(e)&&t.push("slash-command"),/\[Image #\d+\]/.test(e)&&t.push("image-attached"),(/\b(here'?s the (handoff|handover) prompt|session-close summary|wrap-up summary|all wrapped up|all captured\.)\b/i.test(e)||/^##? (Wrap-up|Session conclusion|Handoff)\b/m.test(e)||/^# Handoff:/m.test(e))&&t.push("handoff-prose"),t}let d=/^(superpowers|mcp__|frontend-design|code-review|codex|claude-code-guide|claude-api):/i;function u(e){return e.startsWith("(ToolSearch:")?"infra":d.test(e)||"using-superpowers"===e?"stock":"user"}let c=[{kind:"linear-kip",re:/\bKIP-\d+\b/i},{kind:"github-issue-pr",re:/\b(issue|pr|pull request)\s*#\d+\b|github\.com\/[^\s]+\/(issues|pull)\/\d+/i},{kind:"branch-ref",re:/\b(branch|feat|fix|chore|refactor)[/:]\s*[\w./-]+|on `[\w./-]+`/i},{kind:"url",re:/https?:\/\/\S+/}];e.s([],54033),e.i(54033),(tg=tk||(tk={})).assertEqual=e=>{},tg.assertIs=function(e){},tg.assertNever=function(e){throw Error()},tg.arrayToEnum=e=>{let t={};for(let s of e)t[s]=s;return t},tg.getValidEnumValues=e=>{let t=tg.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),s={};for(let n of t)s[n]=e[n];return tg.objectValues(s)},tg.objectValues=e=>tg.objectKeys(e).map(function(t){return e[t]}),tg.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},tg.find=(e,t)=>{for(let s of e)if(t(s))return s},tg.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,tg.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},tg.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(tw||(tw={})).mergeShapes=(e,t)=>({...e,...t});let p=tk.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),h=e=>{switch(typeof e){case"undefined":return p.undefined;case"string":return p.string;case"number":return Number.isNaN(e)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":if(Array.isArray(e))return p.array;if(null===e)return p.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return p.promise;if("u">typeof Map&&e instanceof Map)return p.map;if("u">typeof Set&&e instanceof Set)return p.set;if("u">typeof Date&&e instanceof Date)return p.date;return p.object;default:return p.unknown}};e.s(["ZodParsedType",0,p,"getParsedType",0,h,"objectUtil",0,tw,"util",0,tk],42944);let m=tk.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class f extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},s={_errors:[]},n=e=>{for(let r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(n);else if("invalid_return_type"===r.code)n(r.returnTypeError);else if("invalid_arguments"===r.code)n(r.argumentsError);else if(0===r.path.length)s._errors.push(t(r));else{let e=s,n=0;for(;n<r.path.length;){let s=r.path[n];n===r.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(t(r))):e[s]=e[s]||{_errors:[]},e=e[s],n++}}};return n(this),s}static assert(e){if(!(e instanceof f))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,tk.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},s=[];for(let n of this.issues)if(n.path.length>0){let s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}f.create=e=>new f(e),e.s(["ZodError",0,f,"ZodIssueCode",0,m,"quotelessJson",0,_],15235);let g=(e,t)=>{let s;switch(e.code){case m.invalid_type:s=e.received===p.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,tk.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:s=`Unrecognized key(s) in object: ${tk.joinValues(e.keys,", ")}`;break;case m.invalid_union:s="Invalid input";break;case m.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${tk.joinValues(e.options)}`;break;case m.invalid_enum_value:s=`Invalid enum value. Expected ${tk.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:s="Invalid function arguments";break;case m.invalid_return_type:s="Invalid function return type";break;case m.invalid_date:s="Invalid date";break;case m.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:tk.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case m.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case m.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case m.custom:s="Invalid input";break;case m.invalid_intersection_types:s="Intersection results could not be merged";break;case m.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:s="Number must be finite";break;default:s=t.defaultError,tk.assertNever(e)}return{message:s}},y=g;function v(e){y=e}function k(){return y}e.s(["getErrorMap",0,k,"setErrorMap",0,v],85676),e.i(85676),e.s(["defaultErrorMap",0,g,"getErrorMap",0,k,"setErrorMap",0,v],76733),e.i(76733);let w=e=>{let{data:t,path:s,errorMaps:n,issueData:r}=e,a=[...s,...r.path||[]],i={...r,path:a};if(void 0!==r.message)return{...r,path:a,message:r.message};let o="";for(let e of n.filter(e=>!!e).slice().reverse())o=e(i,{data:t,defaultError:o}).message;return{...r,path:a,message:o}},b=[];function x(e,t){let s=k(),n=w({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===g?void 0:g].filter(e=>!!e)});e.common.issues.push(n)}class S{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let n of t){if("aborted"===n.status)return $;"dirty"===n.status&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let e of t){let t=await e.key,n=await e.value;s.push({key:t,value:n})}return S.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let n of t){let{key:t,value:r}=n;if("aborted"===t.status||"aborted"===r.status)return $;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==r.value||n.alwaysSet)&&(s[t.value]=r.value)}return{status:e.value,value:s}}}let $=Object.freeze({status:"aborted"}),T=e=>({status:"dirty",value:e}),N=e=>({status:"valid",value:e}),j=e=>"aborted"===e.status,O=e=>"dirty"===e.status,M=e=>"valid"===e.status,E=e=>"u">typeof Promise&&e instanceof Promise;e.s(["DIRTY",0,T,"EMPTY_PATH",0,b,"INVALID",0,$,"OK",0,N,"ParseStatus",0,S,"addIssueToContext",0,x,"isAborted",0,j,"isAsync",0,E,"isDirty",0,O,"isValid",0,M,"makeIssue",0,w],84488),e.i(84488),e.s([],91316),e.i(91316),e.i(42944),(ty=tb||(tb={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},ty.toString=e=>"string"==typeof e?e:e?.message;class A{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let Z=(e,t)=>{if(M(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new f(e.common.issues);return this._error=t,this._error}}};function C(e){if(!e)return{};let{errorMap:t,invalid_type_error:s,required_error:n,description:r}=e;if(t&&(s||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{let{message:a}=e;return"invalid_enum_value"===t.code?{message:a??r.defaultError}:void 0===r.data?{message:a??n??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:a??s??r.defaultError}},description:r}}class P{get description(){return this._def.description}_getType(e){return h(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:h(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:h(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(E(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h(e)},n=this._parseSync({data:e,path:s.path,parent:s});return Z(s,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return M(s)?{value:s.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>M(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h(e)},n=this._parse({data:e,path:s.path,parent:s});return Z(s,await (E(n)?n:Promise.resolve(n)))}refine(e,t){return this._refinement((s,n)=>{let r=e(s),a=()=>n.addIssue({code:m.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(s):t});return"u">typeof Promise&&r instanceof Promise?r.then(e=>!!e||(a(),!1)):!!r||(a(),!1)})}refinement(e,t){return this._refinement((s,n)=>!!e(s)||(n.addIssue("function"==typeof t?t(s,n):t),!1))}_refinement(e){return new eO({schema:this,typeName:tx.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eM.create(this,this._def)}nullable(){return eE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ep.create(this)}promise(){return ej.create(this,this._def)}or(e){return em.create([this,e],this._def)}and(e){return eg.create(this,e,this._def)}transform(e){return new eO({...C(this._def),schema:this,typeName:tx.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eA({...C(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:tx.ZodDefault})}brand(){return new eD({typeName:tx.ZodBranded,type:this,...C(this._def)})}catch(e){return new eZ({...C(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:tx.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eI.create(this,e)}readonly(){return eL.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let D=/^c[^\s-]{8,}$/i,I=/^[0-9a-z]+$/,L=/^[0-9A-HJKMNP-TV-Z]{26}$/i,R=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,U=/^[a-z0-9_-]{21}$/i,F=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Y=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,W=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,z=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,B=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,H=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,J=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,K="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",G=RegExp(`^${K}$`);function X(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let s=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function Q(e){let t=`${K}T${X(e)}`,s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,RegExp(`^${t}$`)}class ee extends P{_parse(e){var s,n,r,a;let i;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==p.string){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.string,received:t.parsedType}),$}let o=new S;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(x(i=this._getOrReturnCtx(e,i),{code:m.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(x(i=this._getOrReturnCtx(e,i),{code:m.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,s=e.data.length<l.value;(t||s)&&(i=this._getOrReturnCtx(e,i),t?x(i,{code:m.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):s&&x(i,{code:m.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)W.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"email",code:m.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)t||(t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"emoji",code:m.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)R.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"uuid",code:m.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)U.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"nanoid",code:m.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)D.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"cuid",code:m.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)I.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"cuid2",code:m.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)L.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"ulid",code:m.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{x(i=this._getOrReturnCtx(e,i),{validation:"url",code:m.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"regex",code:m.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(x(i=this._getOrReturnCtx(e,i),{code:m.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(x(i=this._getOrReturnCtx(e,i),{code:m.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(x(i=this._getOrReturnCtx(e,i),{code:m.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?Q(l).test(e.data)||(x(i=this._getOrReturnCtx(e,i),{code:m.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?G.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{code:m.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${X(l)}$`).test(e.data)||(x(i=this._getOrReturnCtx(e,i),{code:m.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?Y.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"duration",code:m.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(s=e.data,!(("v4"===(n=l.version)||!n)&&z.test(s)||("v6"===n||!n)&&V.test(s))&&1&&(x(i=this._getOrReturnCtx(e,i),{validation:"ip",code:m.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!F.test(e))return!1;try{let[s]=e.split(".");if(!s)return!1;let n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),r=JSON.parse(atob(n));if("object"!=typeof r||null===r||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(x(i=this._getOrReturnCtx(e,i),{validation:"jwt",code:m.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(r=e.data,!(("v4"===(a=l.version)||!a)&&B.test(r)||("v6"===a||!a)&&H.test(r))&&1&&(x(i=this._getOrReturnCtx(e,i),{validation:"cidr",code:m.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?J.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"base64",code:m.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?q.test(e.data)||(x(i=this._getOrReturnCtx(e,i),{validation:"base64url",code:m.invalid_string,message:l.message}),o.dirty()):tk.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,s){return this.refinement(t=>e.test(t),{validation:t,code:m.invalid_string,...tb.errToObj(s)})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...tb.errToObj(e)})}url(e){return this._addCheck({kind:"url",...tb.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...tb.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...tb.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...tb.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...tb.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...tb.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...tb.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...tb.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...tb.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...tb.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...tb.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...tb.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...tb.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...tb.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...tb.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...tb.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...tb.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...tb.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...tb.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...tb.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...tb.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...tb.errToObj(t)})}nonempty(e){return this.min(1,tb.errToObj(e))}trim(){return new ee({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ee({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ee({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ee.create=e=>new ee({checks:[],typeName:tx.ZodString,coerce:e?.coerce??!1,...C(e)});class et extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==p.number){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.number,received:t.parsedType}),$}let s=new S;for(let n of this._def.checks)"int"===n.kind?tk.isInteger(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:m.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:m.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:m.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):"multipleOf"===n.kind?0!==function(e,t){let s=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=s>n?s:n;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(e.data,n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:m.not_finite,message:n.message}),s.dirty()):tk.assertNever(n);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,tb.toString(t))}gt(e,t){return this.setLimit("min",e,!1,tb.toString(t))}lte(e,t){return this.setLimit("max",e,!0,tb.toString(t))}lt(e,t){return this.setLimit("max",e,!1,tb.toString(t))}setLimit(e,t,s,n){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:tb.toString(n)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:tb.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tb.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tb.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tb.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tb.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:tb.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:tb.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tb.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tb.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&tk.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks)if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;else"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value);return Number.isFinite(t)&&Number.isFinite(e)}}et.create=e=>new et({checks:[],typeName:tx.ZodNumber,coerce:e?.coerce||!1,...C(e)});class es extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==p.bigint)return this._getInvalidInput(e);let s=new S;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:m.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(x(t=this._getOrReturnCtx(e,t),{code:m.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(x(t=this._getOrReturnCtx(e,t),{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):tk.assertNever(n);return{status:s.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.bigint,received:t.parsedType}),$}gte(e,t){return this.setLimit("min",e,!0,tb.toString(t))}gt(e,t){return this.setLimit("min",e,!1,tb.toString(t))}lte(e,t){return this.setLimit("max",e,!0,tb.toString(t))}lt(e,t){return this.setLimit("max",e,!1,tb.toString(t))}setLimit(e,t,s,n){return new es({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:tb.toString(n)}]})}_addCheck(e){return new es({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tb.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tb.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tb.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tb.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:tb.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}es.create=e=>new es({checks:[],typeName:tx.ZodBigInt,coerce:e?.coerce??!1,...C(e)});class en extends P{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==p.boolean){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.boolean,received:t.parsedType}),$}return N(e.data)}}en.create=e=>new en({typeName:tx.ZodBoolean,coerce:e?.coerce||!1,...C(e)});class er extends P{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==p.date){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.date,received:t.parsedType}),$}if(Number.isNaN(e.data.getTime()))return x(this._getOrReturnCtx(e),{code:m.invalid_date}),$;let s=new S;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(x(t=this._getOrReturnCtx(e,t),{code:m.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(x(t=this._getOrReturnCtx(e,t),{code:m.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):tk.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new er({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:tb.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:tb.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}er.create=e=>new er({checks:[],coerce:e?.coerce||!1,typeName:tx.ZodDate,...C(e)});class ea extends P{_parse(e){if(this._getType(e)!==p.symbol){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.symbol,received:t.parsedType}),$}return N(e.data)}}ea.create=e=>new ea({typeName:tx.ZodSymbol,...C(e)});class ei extends P{_parse(e){if(this._getType(e)!==p.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.undefined,received:t.parsedType}),$}return N(e.data)}}ei.create=e=>new ei({typeName:tx.ZodUndefined,...C(e)});class eo extends P{_parse(e){if(this._getType(e)!==p.null){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.null,received:t.parsedType}),$}return N(e.data)}}eo.create=e=>new eo({typeName:tx.ZodNull,...C(e)});class el extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return N(e.data)}}el.create=e=>new el({typeName:tx.ZodAny,...C(e)});class ed extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return N(e.data)}}ed.create=e=>new ed({typeName:tx.ZodUnknown,...C(e)});class eu extends P{_parse(e){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.never,received:t.parsedType}),$}}eu.create=e=>new eu({typeName:tx.ZodNever,...C(e)});class ec extends P{_parse(e){if(this._getType(e)!==p.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.void,received:t.parsedType}),$}return N(e.data)}}ec.create=e=>new ec({typeName:tx.ZodVoid,...C(e)});class ep extends P{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==p.array)return x(t,{code:m.invalid_type,expected:p.array,received:t.parsedType}),$;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,r=t.data.length<n.exactLength.value;(e||r)&&(x(t,{code:e?m.too_big:m.too_small,minimum:r?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(x(t,{code:m.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(x(t,{code:m.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((e,s)=>n.type._parseAsync(new A(t,e,t.path,s)))).then(e=>S.mergeArray(s,e));let r=[...t.data].map((e,s)=>n.type._parseSync(new A(t,e,t.path,s)));return S.mergeArray(s,r)}get element(){return this._def.type}min(e,t){return new ep({...this._def,minLength:{value:e,message:tb.toString(t)}})}max(e,t){return new ep({...this._def,maxLength:{value:e,message:tb.toString(t)}})}length(e,t){return new ep({...this._def,exactLength:{value:e,message:tb.toString(t)}})}nonempty(e){return this.min(1,e)}}ep.create=(e,t)=>new ep({type:e,minLength:null,maxLength:null,exactLength:null,typeName:tx.ZodArray,...C(t)});class eh extends P{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=tk.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==p.object){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.object,received:t.parsedType}),$}let{status:t,ctx:s}=this._processInputParams(e),{shape:n,keys:r}=this._getCached(),a=[];if(!(this._def.catchall instanceof eu&&"strip"===this._def.unknownKeys))for(let e in s.data)r.includes(e)||a.push(e);let i=[];for(let e of r){let t=n[e],r=s.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new A(s,r,s.path,e)),alwaysSet:e in s.data})}if(this._def.catchall instanceof eu){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)a.length>0&&(x(s,{code:m.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let n=s.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new A(s,n,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of i){let s=await t.key,n=await t.value;e.push({key:s,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>S.mergeObjectSync(t,e)):S.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return tb.errToObj,new eh({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{let n=this._def.errorMap?.(t,s).message??s.defaultError;return"unrecognized_keys"===t.code?{message:tb.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new eh({...this._def,unknownKeys:"strip"})}passthrough(){return new eh({...this._def,unknownKeys:"passthrough"})}extend(e){return new eh({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new eh({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:tx.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new eh({...this._def,catchall:e})}pick(e){let t={};for(let s of tk.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new eh({...this._def,shape:()=>t})}omit(e){let t={};for(let s of tk.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new eh({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof eh){let s={};for(let n in t.shape){let r=t.shape[n];s[n]=eM.create(e(r))}return new eh({...t._def,shape:()=>s})}if(t instanceof ep)return new ep({...t._def,type:e(t.element)});if(t instanceof eM)return eM.create(e(t.unwrap()));if(t instanceof eE)return eE.create(e(t.unwrap()));if(t instanceof ey)return ey.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let s of tk.objectKeys(this.shape)){let n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new eh({...this._def,shape:()=>t})}required(e){let t={};for(let s of tk.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof eM;)e=e._def.innerType;t[s]=e}return new eh({...this._def,shape:()=>t})}keyof(){return e$(tk.objectKeys(this.shape))}}eh.create=(e,t)=>new eh({shape:()=>e,unknownKeys:"strip",catchall:eu.create(),typeName:tx.ZodObject,...C(t)}),eh.strictCreate=(e,t)=>new eh({shape:()=>e,unknownKeys:"strict",catchall:eu.create(),typeName:tx.ZodObject,...C(t)}),eh.lazycreate=(e,t)=>new eh({shape:e,unknownKeys:"strip",catchall:eu.create(),typeName:tx.ZodObject,...C(t)});class em extends P{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map(async e=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;let s=e.map(e=>new f(e.ctx.common.issues));return x(t,{code:m.invalid_union,unionErrors:s}),$});{let e,n=[];for(let r of s){let s={...t,common:{...t.common,issues:[]},parent:null},a=r._parseSync({data:t.data,path:t.path,parent:s});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:s}),s.common.issues.length&&n.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let r=n.map(e=>new f(e));return x(t,{code:m.invalid_union,unionErrors:r}),$}}get options(){return this._def.options}}em.create=(e,t)=>new em({options:e,typeName:tx.ZodUnion,...C(t)});let e_=e=>{if(e instanceof ex)return e_(e.schema);if(e instanceof eO)return e_(e.innerType());if(e instanceof eS)return[e.value];if(e instanceof eT)return e.options;if(e instanceof eN)return tk.objectValues(e.enum);else if(e instanceof eA)return e_(e._def.innerType);else if(e instanceof ei)return[void 0];else if(e instanceof eo)return[null];else if(e instanceof eM)return[void 0,...e_(e.unwrap())];else if(e instanceof eE)return[null,...e_(e.unwrap())];else if(e instanceof eD)return e_(e.unwrap());else if(e instanceof eL)return e_(e.unwrap());else if(e instanceof eZ)return e_(e._def.innerType);else return[]};class ef extends P{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.object)return x(t,{code:m.invalid_type,expected:p.object,received:t.parsedType}),$;let s=this.discriminator,n=t.data[s],r=this.optionsMap.get(n);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(x(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),$)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let n=new Map;for(let s of t){let t=e_(s.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let r of t){if(n.has(r))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,s)}}return new ef({typeName:tx.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...C(s)})}}class eg extends P{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=(e,n)=>{if(j(e)||j(n))return $;let r=function e(t,s){let n=h(t),r=h(s);if(t===s)return{valid:!0,data:t};if(n===p.object&&r===p.object){let n=tk.objectKeys(s),r=tk.objectKeys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...s};for(let n of r){let r=e(t[n],s[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===p.array&&r===p.array){if(t.length!==s.length)return{valid:!1};let n=[];for(let r=0;r<t.length;r++){let a=e(t[r],s[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}if(n===p.date&&r===p.date&&+t==+s)return{valid:!0,data:t};return{valid:!1}}(e.value,n.value);return r.valid?((O(e)||O(n))&&t.dirty(),{status:t.value,value:r.data}):(x(s,{code:m.invalid_intersection_types}),$)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}eg.create=(e,t,s)=>new eg({left:e,right:t,typeName:tx.ZodIntersection,...C(s)});class ey extends P{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==p.array)return x(s,{code:m.invalid_type,expected:p.array,received:s.parsedType}),$;if(s.data.length<this._def.items.length)return x(s,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$;!this._def.rest&&s.data.length>this._def.items.length&&(x(s,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new A(s,e,s.path,t)):null}).filter(e=>!!e);return s.common.async?Promise.all(n).then(e=>S.mergeArray(t,e)):S.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ey({...this._def,rest:e})}}ey.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ey({items:e,typeName:tx.ZodTuple,rest:null,...C(t)})};class ev extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==p.object)return x(s,{code:m.invalid_type,expected:p.object,received:s.parsedType}),$;let n=[],r=this._def.keyType,a=this._def.valueType;for(let e in s.data)n.push({key:r._parse(new A(s,e,s.path,e)),value:a._parse(new A(s,s.data[e],s.path,e)),alwaysSet:e in s.data});return s.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return new ev(t instanceof P?{keyType:e,valueType:t,typeName:tx.ZodRecord,...C(s)}:{keyType:ee.create(),valueType:e,typeName:tx.ZodRecord,...C(t)})}}class ek extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==p.map)return x(s,{code:m.invalid_type,expected:p.map,received:s.parsedType}),$;let n=this._def.keyType,r=this._def.valueType,a=[...s.data.entries()].map(([e,t],a)=>({key:n._parse(new A(s,e,s.path,[a,"key"])),value:r._parse(new A(s,t,s.path,[a,"value"]))}));if(s.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let s of a){let n=await s.key,r=await s.value;if("aborted"===n.status||"aborted"===r.status)return $;("dirty"===n.status||"dirty"===r.status)&&t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}})}{let e=new Map;for(let s of a){let n=s.key,r=s.value;if("aborted"===n.status||"aborted"===r.status)return $;("dirty"===n.status||"dirty"===r.status)&&t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}}}ek.create=(e,t,s)=>new ek({valueType:t,keyType:e,typeName:tx.ZodMap,...C(s)});class ew extends P{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==p.set)return x(s,{code:m.invalid_type,expected:p.set,received:s.parsedType}),$;let n=this._def;null!==n.minSize&&s.data.size<n.minSize.value&&(x(s,{code:m.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&s.data.size>n.maxSize.value&&(x(s,{code:m.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let r=this._def.valueType;function a(e){let s=new Set;for(let n of e){if("aborted"===n.status)return $;"dirty"===n.status&&t.dirty(),s.add(n.value)}return{status:t.value,value:s}}let i=[...s.data.values()].map((e,t)=>r._parse(new A(s,e,s.path,t)));return s.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new ew({...this._def,minSize:{value:e,message:tb.toString(t)}})}max(e,t){return new ew({...this._def,maxSize:{value:e,message:tb.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ew.create=(e,t)=>new ew({valueType:e,minSize:null,maxSize:null,typeName:tx.ZodSet,...C(t)});class eb extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.function)return x(t,{code:m.invalid_type,expected:p.function,received:t.parsedType}),$;function s(e,s){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,k(),g].filter(e=>!!e),issueData:{code:m.invalid_arguments,argumentsError:s}})}function n(e,s){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,k(),g].filter(e=>!!e),issueData:{code:m.invalid_return_type,returnTypeError:s}})}let r={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof ej){let e=this;return N(async function(...t){let i=new f([]),o=await e._def.args.parseAsync(t,r).catch(e=>{throw i.addIssue(s(t,e)),i}),l=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(l,r).catch(e=>{throw i.addIssue(n(l,e)),i})})}{let e=this;return N(function(...t){let i=e._def.args.safeParse(t,r);if(!i.success)throw new f([s(t,i.error)]);let o=Reflect.apply(a,this,i.data),l=e._def.returns.safeParse(o,r);if(!l.success)throw new f([n(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eb({...this._def,args:ey.create(e).rest(ed.create())})}returns(e){return new eb({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new eb({args:e||ey.create([]).rest(ed.create()),returns:t||ed.create(),typeName:tx.ZodFunction,...C(s)})}}class ex extends P{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ex.create=(e,t)=>new ex({getter:e,typeName:tx.ZodLazy,...C(t)});class eS extends P{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),$}return{status:"valid",value:e.data}}get value(){return this._def.value}}function e$(e,t){return new eT({values:e,typeName:tx.ZodEnum,...C(t)})}eS.create=(e,t)=>new eS({value:e,typeName:tx.ZodLiteral,...C(t)});class eT extends P{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),s=this._def.values;return x(t,{expected:tk.joinValues(s),received:t.parsedType,code:m.invalid_type}),$}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return x(t,{received:t.data,code:m.invalid_enum_value,options:s}),$}return N(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return eT.create(e,{...this._def,...t})}exclude(e,t=this._def){return eT.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}eT.create=e$;class eN extends P{_parse(e){let t=tk.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==p.string&&s.parsedType!==p.number){let e=tk.objectValues(t);return x(s,{expected:tk.joinValues(e),received:s.parsedType,code:m.invalid_type}),$}if(this._cache||(this._cache=new Set(tk.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=tk.objectValues(t);return x(s,{received:s.data,code:m.invalid_enum_value,options:e}),$}return N(e.data)}get enum(){return this._def.values}}eN.create=(e,t)=>new eN({values:e,typeName:tx.ZodNativeEnum,...C(t)});class ej extends P{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==p.promise&&!1===t.common.async?(x(t,{code:m.invalid_type,expected:p.promise,received:t.parsedType}),$):N((t.parsedType===p.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ej.create=(e,t)=>new ej({type:e,typeName:tx.ZodPromise,...C(t)});class eO extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===tx.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:e=>{x(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===n.type){let e=n.transform(s.data,r);if(s.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return $;let n=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===n.status?$:"dirty"===n.status||"dirty"===t.value?T(n.value):n});{if("aborted"===t.value)return $;let n=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===n.status?$:"dirty"===n.status||"dirty"===t.value?T(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,r);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==s.common.async)return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(s=>"aborted"===s.status?$:("dirty"===s.status&&t.dirty(),e(s.value).then(()=>({status:t.value,value:s.value}))));{let n=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===n.status?$:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==s.common.async)return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(e=>M(e)?Promise.resolve(n.transform(e.value,r)).then(e=>({status:t.value,value:e})):$);else{let e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!M(e))return $;let a=n.transform(e.value,r);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}tk.assertNever(n)}}eO.create=(e,t,s)=>new eO({schema:e,typeName:tx.ZodEffects,effect:t,...C(s)}),eO.createWithPreprocess=(e,t,s)=>new eO({schema:t,effect:{type:"preprocess",transform:e},typeName:tx.ZodEffects,...C(s)});class eM extends P{_parse(e){return this._getType(e)===p.undefined?N(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eM.create=(e,t)=>new eM({innerType:e,typeName:tx.ZodOptional,...C(t)});class eE extends P{_parse(e){return this._getType(e)===p.null?N(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eE.create=(e,t)=>new eE({innerType:e,typeName:tx.ZodNullable,...C(t)});class eA extends P{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===p.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eA.create=(e,t)=>new eA({innerType:e,typeName:tx.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...C(t)});class eZ extends P{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return E(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new f(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new f(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}eZ.create=(e,t)=>new eZ({innerType:e,typeName:tx.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...C(t)});class eC extends P{_parse(e){if(this._getType(e)!==p.nan){let t=this._getOrReturnCtx(e);return x(t,{code:m.invalid_type,expected:p.nan,received:t.parsedType}),$}return{status:"valid",value:e.data}}}eC.create=e=>new eC({typeName:tx.ZodNaN,...C(e)});let eP=Symbol("zod_brand");class eD extends P{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class eI extends P{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?$:"dirty"===e.status?(t.dirty(),T(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})();{let e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?$:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new eI({in:e,out:t,typeName:tx.ZodPipeline})}}class eL extends P{_parse(e){let t=this._def.innerType._parse(e),s=e=>(M(e)&&(e.value=Object.freeze(e.value)),e);return E(t)?t.then(e=>s(e)):s(t)}unwrap(){return this._def.innerType}}function eR(e,t){let s="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof s?{message:s}:s}function eU(e,t={},s){return e?el.create().superRefine((n,r)=>{let a=e(n);if(a instanceof Promise)return a.then(e=>{if(!e){let e=eR(t,n),a=e.fatal??s??!0;r.addIssue({code:"custom",...e,fatal:a})}});if(!a){let e=eR(t,n),a=e.fatal??s??!0;r.addIssue({code:"custom",...e,fatal:a})}}):el.create()}eL.create=(e,t)=>new eL({innerType:e,typeName:tx.ZodReadonly,...C(t)});let eF={object:eh.lazycreate};(tv=tx||(tx={})).ZodString="ZodString",tv.ZodNumber="ZodNumber",tv.ZodNaN="ZodNaN",tv.ZodBigInt="ZodBigInt",tv.ZodBoolean="ZodBoolean",tv.ZodDate="ZodDate",tv.ZodSymbol="ZodSymbol",tv.ZodUndefined="ZodUndefined",tv.ZodNull="ZodNull",tv.ZodAny="ZodAny",tv.ZodUnknown="ZodUnknown",tv.ZodNever="ZodNever",tv.ZodVoid="ZodVoid",tv.ZodArray="ZodArray",tv.ZodObject="ZodObject",tv.ZodUnion="ZodUnion",tv.ZodDiscriminatedUnion="ZodDiscriminatedUnion",tv.ZodIntersection="ZodIntersection",tv.ZodTuple="ZodTuple",tv.ZodRecord="ZodRecord",tv.ZodMap="ZodMap",tv.ZodSet="ZodSet",tv.ZodFunction="ZodFunction",tv.ZodLazy="ZodLazy",tv.ZodLiteral="ZodLiteral",tv.ZodEnum="ZodEnum",tv.ZodEffects="ZodEffects",tv.ZodNativeEnum="ZodNativeEnum",tv.ZodOptional="ZodOptional",tv.ZodNullable="ZodNullable",tv.ZodDefault="ZodDefault",tv.ZodCatch="ZodCatch",tv.ZodPromise="ZodPromise",tv.ZodBranded="ZodBranded",tv.ZodPipeline="ZodPipeline",tv.ZodReadonly="ZodReadonly";let eY=(e,t={message:`Input not instance of ${e.name}`})=>eU(t=>t instanceof e,t),eW=ee.create,ez=et.create,eB=eC.create,eV=es.create,eH=en.create,eJ=er.create,eq=ea.create,eK=ei.create,eG=eo.create,eX=el.create,eQ=ed.create,e0=eu.create,e1=ec.create,e2=ep.create,e4=eh.create,e9=eh.strictCreate,e5=em.create,e3=ef.create,e7=eg.create,e6=ey.create,e8=ev.create,te=ek.create,tt=ew.create,ts=eb.create,tn=ex.create,tr=eS.create,ta=eT.create,ti=eN.create,to=ej.create,tl=eO.create,td=eM.create,tu=eE.create,tc=eO.createWithPreprocess,tp=eI.create,th=()=>eW().optional(),tm=()=>ez().optional(),t_=()=>eH().optional(),tf={string:e=>ee.create({...e,coerce:!0}),number:e=>et.create({...e,coerce:!0}),boolean:e=>en.create({...e,coerce:!0}),bigint:e=>es.create({...e,coerce:!0}),date:e=>er.create({...e,coerce:!0})};e.s(["BRAND",0,eP,"NEVER",0,$,"Schema",0,P,"ZodAny",0,el,"ZodArray",0,ep,"ZodBigInt",0,es,"ZodBoolean",0,en,"ZodBranded",0,eD,"ZodCatch",0,eZ,"ZodDate",0,er,"ZodDefault",0,eA,"ZodDiscriminatedUnion",0,ef,"ZodEffects",0,eO,"ZodEnum",0,eT,"ZodFirstPartyTypeKind",0,tx,"ZodFunction",0,eb,"ZodIntersection",0,eg,"ZodLazy",0,ex,"ZodLiteral",0,eS,"ZodMap",0,ek,"ZodNaN",0,eC,"ZodNativeEnum",0,eN,"ZodNever",0,eu,"ZodNull",0,eo,"ZodNullable",0,eE,"ZodNumber",0,et,"ZodObject",0,eh,"ZodOptional",0,eM,"ZodPipeline",0,eI,"ZodPromise",0,ej,"ZodReadonly",0,eL,"ZodRecord",0,ev,"ZodSchema",0,P,"ZodSet",0,ew,"ZodString",0,ee,"ZodSymbol",0,ea,"ZodTransformer",0,eO,"ZodTuple",0,ey,"ZodType",0,P,"ZodUndefined",0,ei,"ZodUnion",0,em,"ZodUnknown",0,ed,"ZodVoid",0,ec,"any",0,eX,"array",0,e2,"bigint",0,eV,"boolean",0,eH,"coerce",0,tf,"custom",0,eU,"date",0,eJ,"datetimeRegex",0,Q,"discriminatedUnion",0,e3,"effect",0,tl,"enum",0,ta,"function",0,ts,"instanceof",0,eY,"intersection",0,e7,"late",0,eF,"lazy",0,tn,"literal",0,tr,"map",0,te,"nan",0,eB,"nativeEnum",0,ti,"never",0,e0,"null",0,eG,"nullable",0,tu,"number",0,ez,"object",0,e4,"oboolean",0,t_,"onumber",0,tm,"optional",0,td,"ostring",0,th,"pipeline",0,tp,"preprocess",0,tc,"promise",0,to,"record",0,e8,"set",0,tt,"strictObject",0,e9,"string",0,eW,"symbol",0,eq,"transformer",0,tl,"tuple",0,e6,"undefined",0,eK,"union",0,e5,"unknown",0,eQ,"void",0,e1],17958),e.i(17958),e.i(15235),e.s(["BRAND",0,eP,"DIRTY",0,T,"EMPTY_PATH",0,b,"INVALID",0,$,"NEVER",0,$,"OK",0,N,"ParseStatus",0,S,"Schema",0,P,"ZodAny",0,el,"ZodArray",0,ep,"ZodBigInt",0,es,"ZodBoolean",0,en,"ZodBranded",0,eD,"ZodCatch",0,eZ,"ZodDate",0,er,"ZodDefault",0,eA,"ZodDiscriminatedUnion",0,ef,"ZodEffects",0,eO,"ZodEnum",0,eT,"ZodError",0,f,"ZodFirstPartyTypeKind",0,tx,"ZodFunction",0,eb,"ZodIntersection",0,eg,"ZodIssueCode",0,m,"ZodLazy",0,ex,"ZodLiteral",0,eS,"ZodMap",0,ek,"ZodNaN",0,eC,"ZodNativeEnum",0,eN,"ZodNever",0,eu,"ZodNull",0,eo,"ZodNullable",0,eE,"ZodNumber",0,et,"ZodObject",0,eh,"ZodOptional",0,eM,"ZodParsedType",0,p,"ZodPipeline",0,eI,"ZodPromise",0,ej,"ZodReadonly",0,eL,"ZodRecord",0,ev,"ZodSchema",0,P,"ZodSet",0,ew,"ZodString",0,ee,"ZodSymbol",0,ea,"ZodTransformer",0,eO,"ZodTuple",0,ey,"ZodType",0,P,"ZodUndefined",0,ei,"ZodUnion",0,em,"ZodUnknown",0,ed,"ZodVoid",0,ec,"addIssueToContext",0,x,"any",0,eX,"array",0,e2,"bigint",0,eV,"boolean",0,eH,"coerce",0,tf,"custom",0,eU,"date",0,eJ,"datetimeRegex",0,Q,"defaultErrorMap",0,g,"discriminatedUnion",0,e3,"effect",0,tl,"enum",0,ta,"function",0,ts,"getErrorMap",0,k,"getParsedType",0,h,"instanceof",0,eY,"intersection",0,e7,"isAborted",0,j,"isAsync",0,E,"isDirty",0,O,"isValid",0,M,"late",0,eF,"lazy",0,tn,"literal",0,tr,"makeIssue",0,w,"map",0,te,"nan",0,eB,"nativeEnum",0,ti,"never",0,e0,"null",0,eG,"nullable",0,tu,"number",0,ez,"object",0,e4,"objectUtil",0,tw,"oboolean",0,t_,"onumber",0,tm,"optional",0,td,"ostring",0,th,"pipeline",0,tp,"preprocess",0,tc,"promise",0,to,"quotelessJson",0,_,"record",0,e8,"set",0,tt,"setErrorMap",0,v,"strictObject",0,e9,"string",0,eW,"symbol",0,eq,"transformer",0,tl,"tuple",0,e6,"undefined",0,eK,"union",0,e5,"unknown",0,eQ,"util",0,tk,"void",0,e1],35907);var tg,ty,tv,tk,tw,tb,tx,tS=e.i(35907),tS=tS,t$=e.i(54853);let tT=tS.enum(t$.GOAL_CATEGORIES),tN=tS.enum(["shipped","partial","exploratory","blocked","trivial"]),tj=tS.enum(["essential","helpful","neutral","unhelpful"]),tO=tS.object({brief_summary:tS.string().min(1),underlying_goal:tS.string().min(1),friction_detail:tS.string().nullable(),user_instructions:tS.array(tS.string()),goal_categories:tS.record(tT,tS.number().nonnegative()),outcome:tN,claude_helpfulness:tj}).passthrough(),tM=`You are analyzing one (session \xd7 local-day) slice of a developer's Claude Code work.
2
+
3
+ Given deterministic facts + up to 8 human-filtered turns, extract structured facets.
4
+
5
+ CRITICAL RULES:
6
+
7
+ 1. goal_categories.{goal}: MINUTES spent on this goal in this slice.
8
+ - Sum across all goals MUST be ≤ active_min.
9
+ - Unclassified time stays implicit — do not pad.
10
+ - Fixed taxonomy: build, plan, debug, review, steer, meta, research,
11
+ refactor, test, release, warmup_minimal.
12
+ - Use WHOLE-MINUTE granularity (0.5-min values OK; finer is noise).
13
+
14
+ 2. user_instructions: 2-5 load-bearing explicit asks. Short phrasings.
15
+ Copy the user's words; do NOT paraphrase.
16
+
17
+ 3. friction_detail: ONE sentence if the user pushed back, got a broken
18
+ result, had to redirect, or expressed frustration. Null if smooth.
19
+
20
+ 4. outcome: shipped | partial | exploratory | blocked | trivial.
21
+ - shipped: PR merged or code committed-and-pushed
22
+ - partial: real progress, not yet shipped
23
+ - exploratory: research / design / no deliverable
24
+ - blocked: hit a wall, work halted
25
+ - trivial: < 1 min of real work
26
+
27
+ 5. claude_helpfulness: essential | helpful | neutral | unhelpful.
28
+ Base on observed user satisfaction signals and outcome.
29
+
30
+ 6. brief_summary: ONE sentence, second-person, concrete.
31
+ Good: "You shipped the Team Edition timeline after two subagent retries."
32
+ Bad: "This session involves work on the dashboard."
33
+
34
+ 7. underlying_goal: what the user was TRYING to accomplish, not what they did.
35
+
36
+ RESPOND WITH ONLY VALID JSON (no prose, no code fence):
37
+
38
+ {
39
+ "brief_summary": "...",
40
+ "underlying_goal": "...",
41
+ "friction_detail": "..." | null,
42
+ "user_instructions": ["...", "..."],
43
+ "goal_categories": {"build": N, "plan": N, ...},
44
+ "outcome": "shipped" | "partial" | "exploratory" | "blocked" | "trivial",
45
+ "claude_helpfulness": "essential" | "helpful" | "neutral" | "unhelpful"
46
+ }`;var tE=e.i(74533),tA=e.i(2157),tZ=e.i(60526),tC=e.i(50227),tP=e.i(66680);let tD=(0,tC.join)((0,tZ.homedir)(),".cclens","llm-runs");function tI(e,t){try{(0,tA.appendFileSync)(e,t)}catch{}}function tL(e){return new Promise((t,s)=>{let n,r,a;if(!(0,tA.existsSync)(tD))try{(0,tA.mkdirSync)(tD,{recursive:!0})}catch{}let i=(n=e.systemPrompt.slice(0,600).toLowerCase()).includes("weekly retrospective writer")?"week_digest":n.includes("editorial perception layer for one session")?"top_session":n.includes("single local day into a short, honest narrative")?"day_digest":n.includes("month")&&n.includes("digest")?"month_digest":n.includes("session × local-day")||n.includes("(session × local-day)")||n.includes("brief_summary")||n.includes("per-entry")||n.includes("per entry")?"entry_enrich":"unknown",o=(r=new Date().toISOString().replace(/[:.]/g,"-"),a=(0,tP.randomUUID)().slice(0,8),`${r}_${i}_${a}`),l=(0,tC.join)(tD,`${o}.jsonl`),d=new Date().toISOString();var u=JSON.stringify({_meta:{type:"start",run_id:o,kind:i,model:e.model,ts:d,user_prompt_chars:e.userPrompt.length,reminder_chars:e.reminder?.length??0}})+"\n";try{(0,tA.writeFileSync)(l,u)}catch{}tI(l,JSON.stringify({_meta:{type:"payload",run_id:o,system_prompt:e.systemPrompt,user_prompt:e.userPrompt,reminder:e.reminder??null}})+"\n");let c=["-p","--output-format","stream-json","--verbose","--model",e.model,"--tools","","--disable-slash-commands","--no-session-persistence","--setting-sources","","--strict-mcp-config","--mcp-config",'{"mcpServers":{}}',"--effort","medium","--append-system-prompt",e.systemPrompt],p=(0,tE.spawn)("claude",c,{stdio:["pipe","pipe","pipe"],env:{...process.env}});tI(l,JSON.stringify({_meta:{type:"spawned",run_id:o,pid:p.pid}})+"\n");let h=e.reminder?`${e.userPrompt}
47
+
48
+ ---
49
+
50
+ ${e.reminder}`:e.userPrompt;p.stdin.write(h),p.stdin.end();let m="",_=0,f=0,g=e.model,y="",v=Date.now(),k=-1;p.stdout.on("data",t=>{for(let s of t.toString("utf8").split("\n")){let t=s.trim();if(t){tI(l,t+"\n");try{let s=JSON.parse(t);if("assistant"===s.type){let t=s.message,n=t?.content;if(Array.isArray(n)){for(let t of n)if("text"===t.type&&"string"==typeof t.text&&(m+=t.text,e.onProgress)){let t=Math.floor(m.length/1024);t>k&&(k=t,e.onProgress({bytes:m.length,elapsedMs:Date.now()-v}))}}let r=t?.model;r&&(g=r)}if("result"===s.type){let e=s.usage;e&&(_=e.input_tokens??0,f=e.output_tokens??0)}}catch{}}}}),p.stderr.on("data",e=>{y+=e.toString("utf8")}),p.on("close",e=>{let n=Date.now()-v;(tI(l,JSON.stringify({_meta:{type:"end",run_id:o,ts:new Date().toISOString(),elapsed_ms:n,exit_code:e,content_chars:m.length,input_tokens:_,output_tokens:f,model_used:g,stderr_tail:y?y.trim().slice(-500):null}})+"\n"),0===e||m)?t({content:m,input_tokens:_,output_tokens:f,model:g}):s(Error(`claude exited ${e}: ${y.trim().slice(0,300)}`))}),p.on("error",e=>{tI(l,JSON.stringify({_meta:{type:"spawn_error",run_id:o,ts:new Date().toISOString(),error:e.message}})+"\n"),s(Error(`Failed to spawn claude: ${e.message}`))})})}function tR(e,t){let s=e.trim().replace(/^```(?:json)?\n?/,"").replace(/\n?```\s*$/,"").trim();try{let e=JSON.parse(s),n=t.safeParse(e);if(n.success)return{ok:!0,value:n.data};return{ok:!1,error:"schema: "+n.error.message}}catch(e){return{ok:!1,error:"json: "+e.message}}}function tU(e,t,s){let n;if(e.includes("opus"))n={input:15,output:75};else if(e.includes("sonnet"))n={input:3,output:15};else{if(!e.includes("haiku"))return 0;n={input:1,output:5}}return(t*n.input+s*n.output)/1e6}function tF(e){return tL({systemPrompt:tM,model:e.model,userPrompt:e.userPrompt,reminder:e.reminder,onProgress:e.onProgress})}function tY(e){let t,s,n=e.trim().replace(/^```(?:json)?\n?/,"").replace(/\n?```\s*$/,"").trim();if((s=n.trim().slice(0,200).toLowerCase()).startsWith("you've hit")||s.startsWith("you have hit")||s.startsWith("you have reached")||s.startsWith("rate limit")||s.includes("5-hour limit")||s.includes("weekly limit")||s.includes("usage limit"))return{ok:!1,error:"rate-limited: "+n.slice(0,160),rateLimited:!0};try{t=JSON.parse(n)}catch(e){return{ok:!1,error:"JSON parse failed: "+e.message}}let r=tO.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,error:"schema validation failed: "+r.error.message}}async function tW(e,t={}){let a,i,o=t.model??"sonnet",l=t.callLLM??tF,d=function(e){let t=[];for(let s of(e.first_user&&t.push(e.first_user),e.enrichment.user_instructions))t.push(s);return t.filter(e=>"human"==(e?s.test(e)?"teammate":n.test(e)?"skill_load":r.test(e)?"slash_command":"human":"human"))}(e),u=(a={active_min:e.numbers.active_min,turn_count:e.numbers.turn_count,tools_total:e.numbers.tools_total,subagent_calls:e.numbers.subagent_calls,skill_calls:e.numbers.skill_calls,flags:e.flags,primary_model:e.primary_model,pr_titles:e.pr_titles,top_tools:e.top_tools,first_user:e.first_user,final_agent:e.final_agent,satisfaction_signals:e.satisfaction_signals,user_input_sources:e.user_input_sources},i=d.slice(0,8).map((e,t)=>`${t+1}. ${e.length<=300?e:e.slice(0,299)+"…"}`).join("\n"),`SLICE FACTS:
51
+ ${JSON.stringify(a,null,2)}
52
+
53
+ HUMAN TURNS (up to 8, each truncated to 300 chars):
54
+ ${i||"(none — the user text was filtered out as non-human)"}`),c=new Date().toISOString(),p=0,h=0,m=!1,_=o,f="",g=!0;try{let s=await l({model:o,userPrompt:u,onProgress:t.onProgress});m=!0,p+=s.input_tokens,h+=s.output_tokens,_=s.model;let n=tY(s.content);if(n.ok){let t=tU(_,p,h);return{entry:tz(e,n.value,_,t,c),usage:{input_tokens:p,output_tokens:h}}}if(f=n.error,n.rateLimited||(g=!1),!n.rateLimited){let s=await l({model:o,userPrompt:u,reminder:"Your previous response was not valid JSON or did not match the required schema. Return ONLY the JSON object with the seven required fields — no prose, no code fence.",onProgress:t.onProgress});p+=s.input_tokens,h+=s.output_tokens,_=s.model;let n=tY(s.content);if(n.ok){let t=tU(_,p,h);return{entry:tz(e,n.value,_,t,c),usage:{input_tokens:p,output_tokens:h}}}f=n.error,n.rateLimited||(g=!1)}}catch(e){f=e.message||"unknown LLM error",g=!1}let y=tU(_,p,h);return{entry:function(e,t,s,n,r,a=!1){if(a){let a={...e.enrichment,status:"pending",generated_at:r,model:s,cost_usd:n,error:t};return{...e,enrichment:a}}let i={...e.enrichment,status:"error",generated_at:r,model:s,cost_usd:n,error:t,retry_count:(e.enrichment.retry_count??0)+1};return{...e,enrichment:i}}(e,f,_,y,c,g),usage:m?{input_tokens:p,output_tokens:h}:null}}function tz(e,t,s,n,r){let a={...e.enrichment,status:"done",generated_at:r,model:s,cost_usd:n,error:null,brief_summary:t.brief_summary,underlying_goal:t.underlying_goal,friction_detail:t.friction_detail,user_instructions:t.user_instructions,goal_categories:t.goal_categories,outcome:t.outcome,claude_helpfulness:t.claude_helpfulness};return{...e,enrichment:a}}let tB=null;function tV(){return tB||(tB=(0,tC.join)((0,tZ.homedir)(),".cclens","llm-spend.jsonl"))}function tH(e){let t=tV();(0,tA.mkdirSync)((0,tC.dirname)(t),{recursive:!0}),(0,tA.appendFileSync)(t,JSON.stringify(e)+"\n",{encoding:"utf8"})}function tJ(e=new Date){let t=tV();if(!(0,tA.existsSync)(t))return 0;let s=e.getUTCFullYear(),n=e.getUTCMonth(),r=0;for(let e of(0,tA.readFileSync)(t,"utf8").split("\n")){let t;if(!e)continue;try{t=JSON.parse(e)}catch{continue}let a=new Date(t.ts);Number.isNaN(a.getTime())||a.getUTCFullYear()===s&&a.getUTCMonth()===n&&(r+=t.cost_usd)}return r}e.s(["appendSpend",0,tH,"monthToDateSpend",0,tJ],78325);var tq=e.i(5737);let tK=null;function tG(){return tK||(tK=(0,tC.join)((0,tZ.homedir)(),".cclens","llm-interactive.lock"))}function tX(){(0,tA.writeFileSync)(tG(),String(process.pid),"utf8")}function tQ(){try{(0,tA.unlinkSync)(tG())}catch{}}let t0={ai_features:{enabled:!0,model:"sonnet",monthlyBudgetUsd:null}},t1=null;function t2(){return t1||(t1=(0,tC.join)((0,tZ.homedir)(),".cclens","settings.json"))}e.s(["readSettings",0,function(){let e=t2();if(!(0,tA.existsSync)(e))return t0;try{let t,s=(0,tA.readFileSync)(e,"utf8");return{ai_features:{enabled:(t=JSON.parse(s).ai_features??{}).enabled??t0.ai_features.enabled,model:t.model??t0.ai_features.model,monthlyBudgetUsd:t.monthly_budget_usd??null}}}catch{return t0}},"writeSettings",0,function(e){let t=t2();(0,tA.mkdirSync)((0,tC.dirname)(t),{recursive:!0});let s=`${t}.tmp`;(0,tA.writeFileSync)(s,JSON.stringify({ai_features:{enabled:e.ai_features.enabled,model:e.ai_features.model,monthly_budget_usd:e.ai_features.monthlyBudgetUsd}},null,2),{encoding:"utf8"}),(0,tA.chmodSync)(s,384),(0,tA.renameSync)(s,t)}],56614);var tS=tS;let t4=tS.object({headline:tS.string().min(1).max(80),body:tS.string().min(1).max(300)}),t9=tS.object({headline:tS.string().min(1).max(160),narrative:tS.string().max(1200).nullable(),what_went_well:tS.string().max(400).nullable(),what_hit_friction:tS.string().max(400).nullable(),suggestion:t4.nullable(),day_signature:tS.string().max(160).nullable().optional()}).passthrough(),t5=`You are synthesizing a developer's Claude Code activity for a single local day into a short, honest narrative digest.
55
+
56
+ Input is:
57
+ - DAY FACTS: deterministic aggregates (agent_min, projects, shipped PRs, concurrency_peak, top_flags, top_goal_categories)
58
+ - DAY SIGNALS: a deterministic classification of HOW the user worked today — dominant_shape (named orchestration pattern, e.g. spec-review-loop, chunk-implementation, solo-build, "mixed", or null on a trivial day), shape_distribution (per-shape session counts), skills_loaded (with stock vs user-authored origin), user_authored_skills_used, user_authored_subagents_used (with sample evidence), prompt_frames (Claude features the user employs vs personal habits), comm_style (verbosity histogram, external_refs, steering counts), brainstorm_warmup_session_count, todo_ops_total, plan_mode_used. Treat day_signals as the analytical foundation — your narrative anchors here.
59
+ - ENTRY SUMMARIES: up to 12 per-session brief_summaries already generated by the enrichment pass
60
+ - FRICTION LINES: up to 6 entry-level friction_detail sentences (where present)
61
+ - USER INSTRUCTIONS: up to 10 load-bearing asks the user gave across the day
62
+
63
+ Output ONE JSON object with six fields:
64
+
65
+ 1. headline (string, one sentence, <= 120 chars):
66
+ Second-person. Concrete verb + concrete noun. Lead with the most characteristic work of the day.
67
+ Good: "You shipped the Team Edition timeline after two subagent retries."
68
+ Bad: "You had a productive day."
69
+
70
+ 2. narrative (string, 2-4 sentences, <= 600 chars, or null):
71
+ Second-person. Weave the top 3-5 entries into a coherent arc. Name projects. Name specific wins or blockers. Do NOT list every entry.
72
+
73
+ 3. what_went_well (string, ONE sentence or null):
74
+ The strongest positive signal from the day. Tie to a concrete cause ("Subagent loop settled after you split the spec review"). Null if the day was truly friction-dominated.
75
+
76
+ 4. what_hit_friction (string, ONE sentence or null):
77
+ The most load-bearing friction. Tie to a concrete cause. Null if the day was smooth.
78
+
79
+ 5. suggestion (object { headline: string <= 60 chars, body: string <= 240 chars } or null):
80
+ One actionable next step for tomorrow, grounded in today's pattern. Null if nothing obvious suggests itself; don't pad with truisms.
81
+
82
+ 6. day_signature (string <= 120 chars, or null):
83
+ ONE sentence characterizing today's shape that the week digest can quote verbatim.
84
+ Format: "<shape> on <project>: <key signal>, <outcome>".
85
+ Examples:
86
+ - "spec-review-loop on Phase 1b: 3 reviewers + 1 implementer, shipped clean"
87
+ - "solo-build with mid-run redirect: ConnectionRefused at minute 70"
88
+ - "research-then-build: 3 Explore subagents, ahora v8 spec drafted"
89
+ - "mixed: 2 spec-review-loop + 1 chunk-implementation, all shipped"
90
+ Set to null ONLY when day_signals.dominant_shape is null (trivial day with no characterizable work).
91
+
92
+ CRITICAL RULES:
93
+
94
+ - Second-person ("you ..."), not third-person.
95
+ - Copy the user's phrasings where useful; do not invent features or outcomes not in the input.
96
+ - Do not mention a project unless it's in DAY FACTS.projects AND that project has a non-trivial entry (outcome != "trivial") in per_entry.
97
+ - **Attribute every PR to its correct project using the per_entry list** — never join a PR title with a project from a different entry. If a project only has a trivial/warmup entry, do NOT describe any deliverable as happening in it.
98
+ - Do not fabricate PR counts, commits, or timestamps.
99
+ - If input is sparse (<= 2 entries or <= 10 active_min), err shorter — a one-line headline + null narrative is fine.
100
+ - **A day where only trivial/warmup entries exist has no "shipped" work** — say so plainly; do not imply deliverables that didn't happen.
101
+
102
+ ANCHORING (every what_went_well / what_hit_friction / suggestion claim must cite something concrete):
103
+ Every cited reason MUST tie back to one of:
104
+ - day_signals.dominant_shape value (e.g. "spec-review-loop"), OR
105
+ - "day_signals.<key>" where key is one of: shape_distribution, comm_style, user_authored_skills_used, user_authored_subagents_used, prompt_frames, plan_mode_used, brainstorm_warmup_session_count
106
+ When the day has only one session, anchor to that session's entry.signals.working_shape value if available.
107
+ This keeps the prose grounded in the day's actual pattern rather than floating prose.
108
+
109
+ RESPOND WITH ONLY VALID JSON (no prose, no code fence):
110
+
111
+ {
112
+ "headline": "...",
113
+ "narrative": "..." | null,
114
+ "what_went_well": "..." | null,
115
+ "what_hit_friction": "..." | null,
116
+ "suggestion": { "headline": "...", "body": "..." } | null,
117
+ "day_signature": "..." | null
118
+ }`;function t3(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}function t7(e){let t=e.split("/").filter(Boolean);return t[t.length-1]??e}function t6(e){let t=e.split("/").filter(Boolean);return t[t.length-1]??e}function t8(e,t){return e.length<=t?e:e.slice(0,t-1).trimEnd()+"…"}function se(e){let t=e.map(e=>{var t;let s,n,r,i,d,u,p;return e.signals??(n=(t=(s=e.first_user||"").length)<100?"short":t<500?"medium":t<2e3?"long":"very_long",r=function(e){if(!e||/<teammate-message|<task-notification|<local-command-caveat/i.test(e.slice(0,400)))return null;for(let{kind:t,re:s}of c)if(e.match(s))return{kind:t,preview:e.slice(0,160)};return null}(s),i=Object.keys(e.skills??{}).some(e=>/brainstorm|writing-plans/i.test(e)),d=s.trim().toLowerCase(),u=l(s),p=/^continue\b/.test(d)||"continue."===d?"literal-continue":u.includes("handoff-prose")?"handoff-prose":"none",{working_shape:o(e),prompt_frames:u,subagent_roles:(e.subagents??[]).map(a),verbosity:n,external_refs:r?[r]:[],brainstorm_warmup:i,continuation_kind:p})}),s=e.reduce((e,t)=>e+t.numbers.active_min,0),n=new Map,r={};for(let s=0;s<e.length;s++){let a=t[s].working_shape;a&&(n.set(a,(n.get(a)??0)+e[s].numbers.active_min),r[a]=(r[a]??0)+1)}let d=null;if(n.size>0&&s>0){let e=[...n.entries()].sort((e,t)=>t[1]-e[1])[0];d=e[1]/s>=.6?e[0]:"mixed"}let p=new Map;for(let t of e)for(let[e,s]of Object.entries(t.skills??{}))p.set(e,(p.get(e)??0)+s);let h=[...p.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>({skill:e,origin:u(e),count:t})),m=h.filter(e=>"user"===e.origin).map(e=>e.skill),_=new Map;for(let t of e)for(let e of t.subagents??[]){var f;if(f=e.type,i.test(f))continue;let t=_.get(e.type)??{count:0,sample_description:e.description,sample_prompt_preview:e.prompt_preview};t.count+=1,e.prompt_preview.length>t.sample_prompt_preview.length&&(t.sample_description=e.description,t.sample_prompt_preview=e.prompt_preview),_.set(e.type,t)}let g=[..._.entries()].sort((e,t)=>t[1].count-e[1].count).map(([e,t])=>({type:e,count:t.count,sample_description:t.sample_description,sample_prompt_preview:t8(t.sample_prompt_preview,200)})),y=new Map;for(let e of t)for(let t of e.prompt_frames)y.set(t,(y.get(t)??0)+1);let v=[...y.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>({frame:e,origin:t$.PROMPT_FRAME_ORIGIN[e],count:t})),k={short:0,medium:0,long:0,very_long:0},w=[],b=0,x=0,S=0,$=0;for(let s=0;s<e.length;s++){let n=e[s],r=t[s];for(let e of((n.first_user??"").length>0&&(k[r.verbosity]+=1),r.external_refs))w.push({session_id:n.session_id,kind:e.kind,preview:t8(e.preview,200)});let a=n.numbers.interrupts??0;b+=a,x+=n.satisfaction_signals?.frustrated??0,S+=n.satisfaction_signals?.dissatisfied??0,a>=2&&($+=1)}let T=t.filter(e=>e.brainstorm_warmup).length;return{dominant_shape:d,shape_distribution:r,skills_loaded:h,user_authored_skills_used:m,user_authored_subagents_used:g,prompt_frames:v,comm_style:{verbosity_distribution:k,external_refs:w,steering:{interrupts:b,frustrated:x,dissatisfied:S,sessions_with_mid_run_redirect:$}},brainstorm_warmup_session_count:T,todo_ops_total:e.reduce((e,t)=>e+(t.numbers.task_ops??0),0),plan_mode_used:e.some(e=>(e.numbers.exit_plan_calls??0)>0||(e.flags??[]).includes("plan_used"))}}function st(e,t,s={}){let n=t.reduce((e,t)=>e+t.numbers.active_min,0),r=new Map;for(let e of t){let t=r.get(e.project)??{minutes:0,entry_count:0};t.minutes+=e.numbers.active_min,t.entry_count+=1,r.set(e.project,t)}let a=[...r.entries()].sort((e,t)=>t[1].minutes-e[1].minutes).map(([e,t])=>({name:e,display_name:t6(e),share_pct:n>0?t.minutes/n*100:0,entry_count:t.entry_count})),i=t.flatMap(e=>e.pr_titles.map(t=>({title:t,project:t6(e.project),session_id:e.session_id}))),o=new Map;for(let e of t)for(let t of e.flags)o.set(t,(o.get(t)??0)+1);let l=[...o.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({flag:e,count:t})),d=new Map;for(let e of t)if("done"===e.enrichment.status)for(let[t,s]of Object.entries(e.enrichment.goal_categories??{}))d.set(t,(d.get(t)??0)+(s??0));let u=[...d.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({category:e,minutes:t})),c={start:`${e}T00:00:00`,end:`${e}T23:59:59`};return{version:t$.CURRENT_DAY_DIGEST_SCHEMA_VERSION,scope:"day",key:e,window:c,entry_refs:t.map(e=>`${e.session_id}__${e.local_day}`),generated_at:new Date().toISOString(),is_live:!1,model:null,cost_usd:null,projects:a,shipped:i,top_flags:l,top_goal_categories:u,concurrency_peak:s.concurrencyPeak??0,agent_min:n,outcome_day:function(e){if(0===e.length)return"idle";let t=new Set(e.map(e=>e.enrichment.outcome).filter(Boolean));return t.has("shipped")?"shipped":t.has("partial")?"partial":t.has("blocked")?"blocked":t.has("exploratory")?"exploratory":"trivial"}(t),helpfulness_day:function(e){let t=new Map;for(let s of e){let e=s.enrichment.claude_helpfulness;e&&t.set(e,(t.get(e)??0)+1)}if(0===t.size)return null;let s=null,n=0;for(let e of["unhelpful","neutral","helpful","essential"]){let r=t.get(e)??0;r>n&&(s=e,n=r)}return s}(t),day_signals:t.length>0?se(t):void 0,headline:null,narrative:null,what_went_well:null,what_hit_friction:null,suggestion:null,day_signature:null}}let ss=e=>tL({...e,systemPrompt:t5});async function sn(e,t,s={}){let n,r,a,i,o,l,d,u=st(e,t,{concurrencyPeak:s.concurrencyPeak});if(0===t.filter(e=>"done"===e.enrichment.status).length)return{digest:u,usage:null};let c=s.model??"sonnet",p=s.callLLM??ss,h=(r=(n=t.filter(e=>"done"===e.enrichment.status)).slice(0,12).map(e=>`- (${t7(e.project)}, ${Math.round(e.numbers.active_min)}m) ${t3(e.enrichment.brief_summary??"",240)}`).join("\n"),a=n.map(e=>e.enrichment.friction_detail).filter(e=>!!e).slice(0,6).map((e,t)=>`${t+1}. ${t3(e,240)}`).join("\n"),i=n.flatMap(e=>e.enrichment.user_instructions).slice(0,10).map((e,t)=>`${t+1}. ${t3(e,240)}`).join("\n"),o=t.map(e=>({project:t7(e.project),active_min:Math.round(10*e.numbers.active_min)/10,outcome:e.enrichment.outcome??"pending",pr_titles:e.pr_titles,flags:e.flags,brief_summary:"done"===e.enrichment.status?e.enrichment.brief_summary:null,friction_detail:"done"===e.enrichment.status?e.enrichment.friction_detail:null})),l={date:u.key,agent_min:u.agent_min,project_count:u.projects.length,projects:u.projects.map(e=>({name:e.display_name,share_pct:e.share_pct,entry_count:e.entry_count})),shipped:u.shipped.map(e=>({title:e.title,project:e.project})),concurrency_peak:u.concurrency_peak,top_flags:u.top_flags,top_goal_categories:u.top_goal_categories,per_entry:o},d=u.day_signals?`
119
+
120
+ DAY SIGNALS:
121
+ ${JSON.stringify(u.day_signals,null,2)}`:"",`DAY FACTS:
122
+ ${JSON.stringify(l,null,2)}${d}
123
+
124
+ ENTRY SUMMARIES (up to 12, most significant first):
125
+ ${r||"(none — no enriched entries)"}
126
+
127
+ FRICTION LINES (up to 6):
128
+ ${a||"(none — smooth day)"}
129
+
130
+ USER INSTRUCTIONS (up to 10 load-bearing asks):
131
+ ${i||"(none)"}`),m=0,_=0,f=c;try{let t,n,r=await p({model:c,userPrompt:h,onProgress:s.onProgress});m+=r.input_tokens,_+=r.output_tokens,f=r.model;let a=(t=r.content,tR(t,t9));if(a.ok)return{digest:{...u,model:f,cost_usd:tU(f,m,_),headline:a.value.headline,narrative:a.value.narrative,what_went_well:a.value.what_went_well,what_hit_friction:a.value.what_hit_friction,suggestion:a.value.suggestion,day_signature:a.value.day_signature??null},usage:{input_tokens:m,output_tokens:_}};let i=await p({model:c,userPrompt:h,reminder:"Your previous response was not valid JSON or did not match the required schema. Return ONLY the JSON object with the six required fields — no prose, no code fence.",onProgress:s.onProgress});m+=i.input_tokens,_+=i.output_tokens,f=i.model;let o=(n=i.content,tR(n,t9));if(o.ok)return{digest:{...u,model:f,cost_usd:tU(f,m,_),headline:o.value.headline,narrative:o.value.narrative,what_went_well:o.value.what_went_well,what_hit_friction:o.value.what_hit_friction,suggestion:o.value.suggestion,day_signature:o.value.day_signature??null},usage:{input_tokens:m,output_tokens:_}};return console.warn(`[digest-day] ${e}: LLM response failed validation after retry (${o.error})`),{digest:u,usage:{input_tokens:m,output_tokens:_}}}catch(t){return console.warn(`[digest-day] ${e}: LLM invocation failed (${t.message})`),{digest:u,usage:m>0?{input_tokens:m,output_tokens:_}:null}}}var sr=e.i(76956),sa=e.i(66536),si=e.i(79357),so=e.i(30212);async function sl(e){try{let t=await (0,sa.listSessions)({limit:1e4}),s=(0,si.computeBurstsFromSessions)(t),[n,r,a]=e.split("-").map(Number),i=new Date(n,r-1,a,0,0,0,0),o=new Date(n,r-1,a,23,59,59,999);return(0,so.aggregateConcurrency)(s,{start:i,end:o}).peak}catch{return 0}}async function*sd(e,t){let s=t.now??(()=>Date.now()),n=e===t.todayLocalDay,r=t.settings.enabled;if(!n&&!t.force){let t=(0,sr.readDayDigest)(e);if(t)return void(yield{type:"digest",digest:t})}if(n&&!t.force){let t=(0,sr.getTodayDigestFromCache)(e,s());if(t)return void(yield{type:"digest",digest:t})}let a=(0,tq.listEntriesForDay)(e);if(0===a.length)return void(yield{type:"error",message:`no entries for date ${e}`});r&&tX();try{let i;if(r){if(t.force){for(let e of a)if("error"===e.enrichment.status&&(e.enrichment.retry_count??0)>=3){let t={...e,enrichment:{...e.enrichment,status:"pending",retry_count:0,error:null}};(0,tq.writeEntry)(t)}}let n=(t.force?(0,tq.listEntriesForDay)(e):a).filter(e=>{if("pending"!==e.enrichment.status&&"error"!==e.enrichment.status||(e.enrichment.retry_count??0)>=3||e.local_day===t.todayLocalDay)return!1;let n=Date.parse(e.end_iso);return!(!Number.isNaN(n)&&s()-n<18e5)});if(n.length>0){yield{type:"status",phase:"enrich",text:`Enriching ${n.length} entries for ${e}`};let s=t.settings.monthlyBudgetUsd??1/0,r=0;for(let e=0;e<n.length;e+=3){if(tJ()>=s){yield{type:"status",phase:"enrich",text:"budget cap reached — stopping enrichment"};break}let a=n.slice(e,e+3);for(let e of(await Promise.all(a.map(e=>tW(e,{model:t.settings.model,callLLM:t.callLLM}).then(t=>({ok:!0,entry:e,result:t.entry,usage:t.usage})).catch(t=>(console.warn(`[enrich] ${e.session_id} failed: ${t.message}`),{ok:!1,entry:e,error:t.message})))))){if(r++,!e.ok){yield{type:"entry",session_id:e.entry.session_id,index:r,total:n.length,status:"error",cost_usd:0};continue}let{result:s,usage:a}=e;(0,tq.writeEntry)(s),a&&tH({ts:new Date().toISOString(),caller:t.caller??"web",model:s.enrichment.model??t.settings.model,input_tokens:a.input_tokens,output_tokens:a.output_tokens,cost_usd:s.enrichment.cost_usd??0,kind:"entry_enrich",ref:`${s.session_id}__${s.local_day}`}),yield{type:"entry",session_id:s.session_id,index:r,total:n.length,status:s.enrichment.status,cost_usd:s.enrichment.cost_usd}}if(tJ()>=s){yield{type:"status",phase:"enrich",text:"budget cap reached — stopping enrichment"};break}}}}let o=(0,tq.listEntriesForDay)(e),l=await sl(e);if(r){yield{type:"status",phase:"synth",text:"Synthesizing day narrative"};let s=[],n=sn(e,o,{model:t.settings.model,callLLM:t.callLLM,concurrencyPeak:l,onProgress:e=>{s.push({bytes:e.bytes,elapsed_ms:e.elapsedMs})}}),r=[],a=!1;for(n.finally(()=>{a=!0});!a;){for(await new Promise(e=>setTimeout(e,500));s.length>0;)r.push(s.shift());if(r.length>0){let e=r[r.length-1];yield{type:"progress",phase:"synth",bytes:e.bytes,elapsed_ms:e.elapsed_ms},r.length=0}}let d=await n;i=d.digest,d.usage&&tH({ts:new Date().toISOString(),caller:t.caller??"web",model:i.model??t.settings.model,input_tokens:d.usage.input_tokens,output_tokens:d.usage.output_tokens,cost_usd:i.cost_usd??0,kind:"day_digest",ref:e})}else i=st(e,o,{concurrencyPeak:l});n?(0,sr.setTodayDigestInCache)(e,i,s()):((0,sr.writeDayDigest)(i),yield{type:"saved",path:`~/.cclens/digests/day/${e}.json`}),yield{type:"digest",digest:i}}finally{r&&tQ()}}e.s(["runDayDigestPipeline",0,sd],20441);var tS=tS;let su=/^\d{4}-\d{2}-\d{2}$/,sc=tS.object({display_name:tS.string().min(1),description:tS.string().min(1).max(600)}),sp=tS.object({title:tS.string().min(1).max(120),detail:tS.string().min(1).max(700),anchor:tS.string().min(1).max(80),evidence:tS.object({date:tS.string().regex(su),quote:tS.string().min(1).max(400)})}),sh=sp.extend({surprise_kind:tS.enum(["outlier","novel-use","user-built-tool","cross-week-contrast"])}),sm=sp.extend({lean_kind:tS.enum(["claude-md","skill","hook","harness","decision"]),copyable:tS.string().max(2e3).nullable()}),s_=tS.object({headline:tS.string().min(1).max(180),key_pattern:tS.string().min(1).max(280),trajectory:tS.array(tS.object({date:tS.string().regex(su),line:tS.string().min(1).max(280)})).min(1),standout_days:tS.array(tS.object({date:tS.string().regex(su),why:tS.string().min(1).max(500)})).min(1).max(2),project_areas:tS.array(sc).min(1),what_worked:tS.array(sp).min(1).max(6),what_stalled:tS.array(sp).max(5),what_surprised:tS.array(sh).max(4),where_to_lean:tS.array(sm).min(1).max(7)}).passthrough(),sf=`You are the weekly retrospective writer for Fleetlens, a dashboard for Claude Code sessions.
132
+
133
+ Your unique advantage: you receive both **already-synthesized day digests** AND a **per-week classification of how the user drove agents** — named orchestration shapes, the user's interaction grammar, and counts. Your job is to take that texture and tell a coherent story about WHO this user is as a Claude Code operator THIS WEEK and what they should do next.
134
+
135
+ The reader sees, before reading your prose:
136
+ • A "Top sessions" section with 1-3 deep-dive cards (per-session story + timeline + pin annotations).
137
+ • The trajectory + standout_days + project_areas + findings YOU produce below.
138
+
139
+ Working-shape names (spec-review-loop, chunk-implementation, research-then-build, reviewer-triad, background-coordinated, solo-continuation, solo-design, solo-build) and grammar element names are NOT separately rendered — they only appear when YOU cite them in prose. Use them as anchors in your findings to ground claims; they should appear NAMED in your headline, key_pattern, what_worked, what_stalled, what_surprised, where_to_lean.
140
+
141
+ Every claim you write must cite either a working_shape, a grammar element, or "plan-mode-gap" by name — see ANCHORING RULES below.
142
+
143
+ INPUT shape (transcript-style markdown, NOT JSON):
144
+ The user prompt below is a markdown document with the following sections:
145
+ • Header line: "# Week <key> (<start> → <end>)" then totals/outcome-mix/helpfulness-sparkline/concurrency_peak_day as plain prose lines.
146
+ • "## Projects" — bullet list of top projects with agent_min, share_pct, shipped PR count + titles indented under each.
147
+ • Plain "Top flags:" and "Goal-category minutes:" lines.
148
+ • "## Working shapes" — bullet per shape with occurrence count, list of dates, outcome distribution. (No verbose evidence quotes — quote from day-summary fields instead.)
149
+ • "## Interaction grammar" — bulleted summary: brainstorm-warmup days, prompt_frames with origin tags, user-authored skills, skill families, user-authored subagent types, multi-day thread count + total active, communication_style verbosity histogram, external-ref openings, steering counts, TodoWrite total, Plan Mode counts.
150
+ • "## Day summaries" with one "### <Day> <date> — <agent_min>m active \xb7 outcome: <X> \xb7 shape: <Y>" subsection per day. Each day has labeled lines (Headline, Signature, Went well, Hit friction, Suggestion, Flags, Helpfulness, Shape distribution, Skills loaded, User-authored subagents, Prompt frames, Verbosity, Steering, Brainstorm-warmup sessions, Plan Mode, TodoWrite ops).
151
+
152
+ The day's "Signature" line is a ≤120-char LLM-produced shape sentence; you MAY quote it verbatim in your trajectory. The "Headline", "Went well", "Hit friction", "Suggestion" lines are also quotable as evidence.
153
+
154
+ CLAUDE-FEATURE vs PERSONAL-HABIT (carries through prompt_frames origin tags):
155
+ - Claude features the user employs: teammate (agent teams), task-notification (Monitor tool), local-command-caveat, slash-command, image-attached.
156
+ - Personal habits: handoff-prose (cross-session compaction), and any user-authored skills/subagents.
157
+ Don't mistake claude-feature framings for things the user invented. Origin tags in the transcript distinguish them.
158
+
159
+ OUTPUT: ONE JSON object. Strict JSON, no prose outside, no fence.
160
+
161
+ {
162
+ "headline": "≤120 chars; second-person; names a working shape OR a grammar element by name. Bad: 'You shipped 22 PRs.' Good: 'You shipped 22 PRs through your spec-review-loop on the four design-anchored days, with zero plan gates.'",
163
+
164
+ "key_pattern": "≤80 chars; ONE sentence subhead. Names the dominant working_shape + the grammar element that defined the week (skill ritual / harness frame / thread / plan-mode absence). Reference at least two anchors.",
165
+
166
+ "trajectory": [
167
+ { "date": "YYYY-MM-DD", "line": "≤30 words; describe that day's work AS AN INSTANCE of the shape it was classified into. When the day's day_signature is present, you MAY quote it verbatim (it is concise and already grounded) instead of re-deriving. E.g. 'Wed: spec-review-loop on Phase 1b — 3 reviewer dispatches before code, shipped clean.'" }
168
+ // one per day_summary, chronological
169
+ ],
170
+
171
+ "standout_days": [
172
+ { "date": "YYYY-MM-DD", "why": "1-2 sentences. The standout is always BECAUSE of the shape used — name it." }
173
+ // 1-2 entries
174
+ ],
175
+
176
+ "project_areas": [
177
+ { "display_name": "exact match", "description": "1-3 sentences: WHAT was built/shipped + which working_shape produced it." }
178
+ // one per project with non-zero agent_min, top by share. Skip <5% share unless they shipped.
179
+ ],
180
+
181
+ "what_worked": [
182
+ {
183
+ "title": "≤120 chars; the good thing observed",
184
+ "detail": "2-4 sentences. Cite the shape AND the evidence. E.g. 'The spec-review-loop shipped 3 of 3 designs cleanly. Phase 1b, V2 perception, and self-update all reached implementation with reviewer subagents having already surfaced gaps. The pattern caught issues at spec time.'",
185
+ "anchor": "<one of: spec-review-loop|chunk-implementation|research-then-build|reviewer-triad|background-coordinated|solo-continuation|solo-design|solo-build|interaction_grammar.brainstorming_warmup_days|interaction_grammar.threads|interaction_grammar.user_authored_skills|interaction_grammar.prompt_frames>",
186
+ "evidence": { "date": "YYYY-MM-DD", "quote": "verbatim from a day_summary or working_shapes.sample_evidence — must be substring of the input data" }
187
+ }
188
+ // 3-6 items. SORT BY load-bearing-ness — most week-defining first.
189
+ ],
190
+
191
+ "what_stalled": [
192
+ {
193
+ "title": "≤120 chars; what didn't go well",
194
+ "detail": "2-4 sentences. Cite the shape it stalled INSIDE. Friction is mode-shape-specific. E.g. 'API connectivity errors cut Mon + Tue. Both stalls happened at the END of unbroken solo-build runs in long-autonomous mode — the same shape that shipped clean elsewhere. The transport failure is shape-specific: long-autonomous runs have no checkpoint to recover to.'",
195
+ "anchor": "<working_shape OR grammar key OR 'plan-mode-gap'>",
196
+ "evidence": { "date": "YYYY-MM-DD", "quote": "verbatim from day_summary.what_hit_friction or final_agent" }
197
+ }
198
+ // 0-5 items. Empty array if the week was smooth.
199
+ ],
200
+
201
+ "what_surprised": [
202
+ {
203
+ "title": "≤120 chars; the unexpected/novel observation",
204
+ "detail": "2-4 sentences naming why this stood out — outlier shape usage, novel application, user-authored tooling, cross-week contrast.",
205
+ "anchor": "<working_shape OR grammar key OR 'plan-mode-gap'>",
206
+ "evidence": { "date": "YYYY-MM-DD", "quote": "verbatim from input data" },
207
+ "surprise_kind": "<one of: outlier|novel-use|user-built-tool|cross-week-contrast>"
208
+ }
209
+ // 0-4 items. Empty array if nothing surprising surfaced.
210
+ ],
211
+
212
+ "where_to_lean": [
213
+ {
214
+ "title": "≤120 chars; the recommendation, in active voice",
215
+ "detail": "3-5 sentences. NAME the gap — what the user does well already, and the specific gap this addresses. Tie to anchor.",
216
+ "anchor": "<working_shape OR grammar key OR 'plan-mode-gap'>",
217
+ "evidence": { "date": "YYYY-MM-DD", "quote": "data quote that motivated this recommendation" },
218
+ "lean_kind": "<one of: claude-md|skill|hook|harness|decision>",
219
+ "copyable": "Markdown block / prompt / rule the user can paste somewhere — null if 'decision' kind"
220
+ }
221
+ // 3-6 items.
222
+ ]
223
+ }
224
+
225
+ ANCHORING RULES (critical — every finding must pass these):
226
+
227
+ 1. **Every what_worked / what_stalled / what_surprised / where_to_lean MUST set anchor** to a value that exists in the input:
228
+ - A working_shapes[].shape value the user actually used this week, OR
229
+ - "interaction_grammar.<key>" where key is one of: brainstorming_warmup_days, prompt_frames, user_authored_skills, skill_families, user_authored_subagents, threads, communication_style.verbosity, communication_style.external_refs, communication_style.steering, OR
230
+ - "day_signals.<key>" where key is one of: dominant_shape, shape_distribution, comm_style, user_authored_skills_used, user_authored_subagents_used, prompt_frames, plan_mode_used, brainstorm_warmup_session_count — use these when the finding is grounded in a single day's classification rather than a week-level rollup, OR
231
+ - "plan-mode-gap" (only valid when interaction_grammar.plan_mode.exit_plan_calls === 0)
232
+
233
+ 2. **Every evidence.quote MUST appear verbatim** somewhere in the input — quote from a day's Headline / Signature / Went well / Hit friction / Suggestion line, or from any other labeled line in the day-summaries section, or from interaction-grammar bullets. The harness substring-checks against the assembled prompt; ungrounded findings are dropped automatically.
234
+
235
+ 3. **No floating prose.** "You had a productive week" is not a finding. "Your spec-review-loop shipped 3 of 3 with \`general-purpose\` reviewers" IS a finding.
236
+
237
+ 4. **what_stalled MUST cite the working_shape it stalled inside.** Generic friction without shape-anchor is dropped. "ConnectionRefused interrupted Mon's solo-build push" is anchored. "Connection errors are bad" is not.
238
+
239
+ 5. **where_to_lean[].lean_kind discipline:**
240
+ - "claude-md" → copyable is a markdown block ready to paste into CLAUDE.md
241
+ - "skill" → copyable is a skill file's YAML frontmatter + body, OR a description of what to write
242
+ - "hook" → copyable is the .claude/hooks.json snippet
243
+ - "harness" → copyable is the harness skill name + a brief description of how to use it
244
+ - "decision" → copyable is null. The lean is a decision the user must make explicitly (e.g. "is Plan Mode a gap or are spec-review subagents your post-Plan-Mode workflow?")
245
+
246
+ 6. **No archetype labels.** No "Orchestration Conductor" / "Solo Builder" / personality-quiz framing. Working shapes are observed patterns, not identity claims.
247
+
248
+ 7. **Strict JSON.** No trailing commas, no prose outside, no fence.
249
+
250
+ USER-IDENTITY RULES (read carefully — these often go wrong):
251
+
252
+ - **Claude features the user employs ≠ tools the user built.** \`<teammate-message>\` is from Claude's agent-teams feature, not a user invention. \`<task-notification>\` is from the Monitor tool. \`<local-command-caveat>\` is a Claude convention. \`<command-message>\` / \`<command-name>\` is the slash-command framing. The \`origin\` field on each prompt_frame says which is which — respect it. "You used Claude's agent-teams feature on N days" is correct; "you designed the teammate-message format" is wrong.
253
+
254
+ - **What IS the user's own harness:** user_authored_skills (anything not matching stock prefixes), skill_families (the cohesive toolchains they roll up to — e.g. "harness-*"), user_authored_subagents (Task subagent types not in the stock set — e.g. \`implement-teammate\`), and any custom slash commands (visible via prompt_frames[frame=slash-command] and the \`<command-name>\` content). When you describe their harness, name THESE.
255
+
256
+ - **handoff-prose is a personal compaction habit, NOT a standard pattern.** Treat it as "a recent personal habit you've adopted to break a long-running thread into multiple sessions." Don't elevate it to the same level as named working shapes. Don't recommend others copy it.
257
+
258
+ COMMUNICATION-STYLE RULES:
259
+
260
+ - The verbosity distribution + external_context_refs together describe how the user delegates. Many short prompts + many external refs = high delegation ("go look it up yourself"). Many very_long prompts + few external refs = high control ("here's everything you need, follow it"). Mixed is mixed; say so.
261
+
262
+ - Steering intensity is interrupts + frustrated + dissatisfied normalized against total_turns. Low steering on a high-output week = trust paid off. High steering on a low-output week = friction. High steering on a high-output week = micro-managed but successful — the user paid for output with attention.
263
+
264
+ - These dimensions belong in what_worked / what_stalled / what_surprised when the data shows something specific. Anchor to "communication_style.verbosity" / "communication_style.external_refs" / "communication_style.steering" as appropriate.
265
+
266
+ VOCABULARY RULES:
267
+
268
+ - The reader is a developer, not a parser-internals reader. Write like a coworker recapping the week.
269
+ - Don't use "flagged" as a verb. Flags aren't actors.
270
+ - Internal flag tokens (loop_suspected, long_autonomous, orchestrated, fast_ship, plan_used, interrupt_heavy, high_errors) are forbidden as nouns or subjects. Tokens MAY appear inside evidence.quote when the verbatim text used them.
271
+ - Working-shape names (spec-review-loop, chunk-implementation, etc.) ARE allowed and ENCOURAGED in prose — they're the named patterns the reader sees in the report's first section.
272
+ - Prefer naming the actual subagent type ("\`general-purpose\` dispatches", "\`superpowers:code-reviewer\`") over abstract "subagents" when the type is load-bearing.
273
+ - "Plan Mode" specifically refers to the canonical /plan tool. "spec-review subagents" is the user's actual planning approach when that's what the data shows.
274
+ `,sg=["shipped","partial","blocked","exploratory","trivial","idle"];function sy(e){let t=e.split("/").filter(Boolean);return t[t.length-1]??e}function sv(e){let t=new Date(`${e}T00:00:00`),s=[];for(let e=0;e<7;e++){let n=new Date(t);n.setDate(t.getDate()+e),s.push(function(e){let t=e.getFullYear(),s=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${s}-${n}`}(n))}return s}function sk(e,t){return e.length<=t?e:e.slice(0,t-1).trimEnd()+"…"}function sw(e,t){return e.day_signals??se(t)}let sb=["spec-review-loop","chunk-implementation","reviewer-triad","research-then-build","background-coordinated","solo-continuation","solo-design","solo-build"];function sx(e,t,s={}){let n=sv(e),r=new Map;for(let e of t)r.set(e.key,e);let a=t.reduce((e,t)=>e+t.agent_min,0),i=new Map;for(let e of t)for(let t of e.projects){let s=i.get(t.name)??{agent_min:0,shipped_count:0};s.agent_min+=t.share_pct/100*e.agent_min,i.set(t.name,s)}for(let e of t)for(let t of e.shipped){let s=e.projects.find(e=>e.display_name===t.project),n=s?s.name:t.project,r=i.get(n)??{agent_min:0,shipped_count:0};r.shipped_count+=1,i.set(n,r)}let d=[...i.entries()].sort((e,t)=>t[1].agent_min-e[1].agent_min).map(([e,t])=>({name:e,display_name:sy(e),agent_min:t.agent_min,share_pct:a>0?t.agent_min/a*100:0,shipped_count:t.shipped_count,description:null})),u=[];for(let e of t)for(let t of e.shipped)u.push({title:t.title,project:t.project,date:e.key,session_id:t.session_id});let c={};for(let e of t)c[e.outcome_day]=(c[e.outcome_day]??0)+1;let p=n.map(e=>{let t=r.get(e);return t?t.helpfulness_day:null}),h=new Map;for(let e of t)for(let t of e.top_flags)h.set(t.flag,(h.get(t.flag)??0)+t.count);let m=[...h.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({flag:e,count:t})),_=new Map;for(let e of t)for(let t of e.top_goal_categories)_.set(t.category,(_.get(t.category)??0)+t.minutes);let f=[..._.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({category:e,minutes:t})),g=null;for(let e of t)e.concurrency_peak>0&&(!g||e.concurrency_peak>g.peak)&&(g={date:e.key,peak:e.concurrency_peak});let y=s.entriesByDay??new Map,v=t.filter(e=>e.agent_min>0).sort((e,t)=>e.key.localeCompare(t.key)).map(e=>{let t=y.get(e.key)??[],s=e.day_signals??(t.length>0?se(t):null);return{date:e.key,agent_min:e.agent_min,shipped_count:e.shipped.length,outcome_day:e.outcome_day,helpfulness_day:e.helpfulness_day,dominant_shape:s?.dominant_shape??null}}),k=null;for(let e of v)(!k||e.agent_min>k.agent_min)&&(k={date:e.date,agent_min:e.agent_min,shipped_count:e.shipped_count});let w=[];for(let e of y.values())w.push(...e);let b=null,x=Array(24).fill(0);for(let e of w){(!b||e.numbers.active_min>b.active_min)&&(b={session_id:e.session_id,date:e.local_day,project_display:sy(e.project),active_min:e.numbers.active_min});let t=Date.parse(e.start_iso);if(!Number.isNaN(t)){let s=new Date(t).getHours();x[s]=(x[s]??0)+e.numbers.active_min}}let S=t.length>0?function(e,t=new Map){let s=new Map,n=new Map;for(let t of e)s.set(t.key,t.outcome_day),n.set(t.key,t.helpfulness_day);let r=new Map;for(let s of e){let e=t.get(s.key)??[];for(let t of Object.keys(sw(s,e).shape_distribution)){let n=r.get(t)??[];n.push({dd:s,entries:e}),r.set(t,n)}}let a=[];for(let e of sb){let t=r.get(e);if(!t||0===t.length)continue;let i=t.sort((e,t)=>e.dd.key.localeCompare(t.dd.key)).map(({dd:t,entries:r})=>{let a=r.filter(t=>(t.signals?.working_shape??o(t))===e),i=a.sort((e,t)=>{let s=(e.subagents??[]).reduce((e,t)=>Math.max(e,t.prompt_preview.length),0);return(t.subagents??[]).reduce((e,t)=>Math.max(e,t.prompt_preview.length),0)-s})[0]??a[0]??null,l=null;if(i?.subagents&&i.subagents.length>0){let e=[...i.subagents].sort((e,t)=>t.prompt_preview.length-e.prompt_preview.length)[0];l={type:e.type,description:e.description,prompt_preview:sk(e.prompt_preview,200)}}let d=i?sy(i.project):t.projects[0]?.display_name??"";return{date:t.key,session_id:i?.session_id??"",project_display:d,outcome:s.get(t.key)??null,helpfulness:n.get(t.key)??null,evidence_subagent:l,evidence_first_user:i?.first_user?sk(i.first_user,200):null,day_signature:t.day_signature??null}}),l={};for(let e of i)e.outcome&&(l[e.outcome]=(l[e.outcome]??0)+1);a.push({shape:e,occurrences:i,outcome_distribution:l})}return a}(t,y):null,$=t.length>0?function(e,t=new Map){let s=new Set,n=new Map,r=new Map,a=new Map,i={short:0,medium:0,long:0,very_long:0},o=[],d=0,u=0,c=0,p=0,h=0,m=new Set;for(let l of e){let e=l.key,_=sw(l,t.get(e)??[]);for(let t of(_.brainstorm_warmup_session_count>0&&s.add(e),h+=_.todo_ops_total,_.plan_mode_used&&m.add(e),_.prompt_frames)){let s=n.get(t.frame)??{count:0,days:new Set};s.count+=t.count,s.days.add(e),n.set(t.frame,s)}for(let t of _.skills_loaded){if("user"!==t.origin)continue;let s=r.get(t.skill)??{count:0,days:new Set};s.count+=t.count,s.days.add(e),r.set(t.skill,s)}for(let t of _.user_authored_subagents_used){let s=a.get(t.type)??{count:0,days:new Set,sample_description:t.sample_description,sample_prompt_preview:t.sample_prompt_preview};s.count+=t.count,s.days.add(e),t.sample_prompt_preview.length>s.sample_prompt_preview.length&&(s.sample_description=t.sample_description,s.sample_prompt_preview=t.sample_prompt_preview),a.set(t.type,s)}let f=_.comm_style.verbosity_distribution;for(let t of(i.short+=f.short,i.medium+=f.medium,i.long+=f.long,i.very_long+=f.very_long,_.comm_style.external_refs))o.push({date:e,session_id:t.session_id,ref_kind:t.kind,preview:sk(t.preview,200)});d+=_.comm_style.steering.interrupts,u+=_.comm_style.steering.frustrated,c+=_.comm_style.steering.dissatisfied,p+=_.comm_style.steering.sessions_with_mid_run_redirect}let _=new Map,f=0,g=0;for(let[,e]of t)for(let t of e){f+=t.numbers.turn_count??0,g+=t.numbers.exit_plan_calls??0;let e=_.get(t.session_id)??[];e.push(t),_.set(t.session_id,e)}let y=[];for(let[e,t]of _.entries()){if(new Set(t.map(e=>e.local_day)).size<2)continue;t.sort((e,t)=>e.local_day.localeCompare(t.local_day));let s=t.reduce((e,t)=>e+t.numbers.active_min,0),n=t[t.length-1];y.push({thread_id:e,entries:t.map(e=>({date:e.local_day,session_id:e.session_id,project_display:sy(e.project),has_handoff_frame:l(e.first_user).includes("handoff-prose")})),total_active_min:s,outcome:n.enrichment?.outcome??null})}y.sort((e,t)=>t.total_active_min-e.total_active_min);let v=new Map;for(let[e,t]of r.entries()){let s=e.includes("-")?e.split("-")[0]:e,n=v.get(s)??{members:new Set,total_count:0,days:new Set};for(let s of(n.members.add(e),n.total_count+=t.count,t.days))n.days.add(s);v.set(s,n)}let k=[...v.entries()].filter(([,e])=>e.members.size>=2||e.total_count>=3).sort((e,t)=>t[1].total_count-e[1].total_count).map(([e,t])=>({family:e,members:[...t.members].sort(),total_count:t.total_count,days:[...t.days].sort()}));return{brainstorming_warmup_days:[...s].sort(),prompt_frames:[...n.entries()].sort((e,t)=>t[1].count-e[1].count).map(([e,t])=>({frame:e,origin:t$.PROMPT_FRAME_ORIGIN[e],count:t.count,days:[...t.days].sort()})),user_authored_skills:[...r.entries()].sort((e,t)=>t[1].count-e[1].count).map(([e,t])=>({skill:e,count:t.count,days:[...t.days].sort()})),skill_families:k,user_authored_subagents:[...a.entries()].sort((e,t)=>t[1].count-e[1].count).map(([e,t])=>({type:e,count:t.count,days:[...t.days].sort(),sample_description:t.sample_description,sample_prompt_preview:sk(t.sample_prompt_preview,200)})),threads:y,communication_style:{verbosity_distribution:i,external_context_refs:o,steering:{total_interrupts:d,total_frustrated:u,total_dissatisfied:c,sessions_with_mid_run_redirect:p,total_turns:f}},todo_ops_total:h,plan_mode:{exit_plan_calls:g,days_with_plan:m.size}}}(t,y):null,T=w.length>0?function(e){let t=new Map,s=new Map,n=new Map,r=new Set,a=0,i=0,o=0,l=0,d=0,u=0,c=0,p=new Map,h=new Map;for(let m of e){let e=m.local_day;for(let h of(a+=m.numbers.subagent_calls,o+=m.numbers.skill_calls,i+=m.numbers.task_ops,l+=m.numbers.exit_plan_calls,d+=m.numbers.interrupts,u+=m.numbers.tools_total,c+=m.numbers.turn_count,m.numbers.subagent_calls>0&&t.set(e,(t.get(e)??0)+m.numbers.subagent_calls),m.numbers.skill_calls>0&&s.set(e,(s.get(e)??0)+m.numbers.skill_calls),(m.numbers.exit_plan_calls>0||m.flags.includes("plan_used"))&&n.set(e,(n.get(e)??0)+m.numbers.exit_plan_calls),m.flags.includes("long_autonomous")&&r.add(e),m.subagents))p.set(h.type,(p.get(h.type)??0)+1);for(let[e,t]of Object.entries(m.skills))h.set(e,(h.get(e)??0)+t)}let m=[...p.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({type:e,count:t})),_=[...h.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({skill:e,count:t})),f=[],g=new Set,y=[];for(let t of e)for(let e of t.subagents)y.push({entry:t,sa:e});for(let{entry:e,sa:t}of(y.sort((e,t)=>t.sa.prompt_preview.length-e.sa.prompt_preview.length),y)){if(f.length>=3)break;g.has(t.type)||(g.add(t.type),f.push({date:e.local_day,project_display:sy(e.project),type:t.type,prompt_preview:sk(t.prompt_preview,200)}))}let v=[],k=new Set;for(let t of e)for(let e of Object.keys(t.skills)){if(v.length>=3)break;k.has(e)||t.first_user&&!(t.first_user.length<8)&&(k.add(e),v.push({date:t.local_day,skill:e,first_user_preview:sk(t.first_user,200)}))}let w=null;for(let t of e)t.flags.includes("long_autonomous")&&(!w||t.numbers.active_min>w.numbers.active_min)&&(w=t);let b=w?{date:w.local_day,project_display:sy(w.project),active_min:w.numbers.active_min,top_tools:w.top_tools.slice(0,5),first_user_preview:sk(w.first_user,200)}:null,x=c>0?u/c:0;return{orchestration:{subagent_calls:a,task_ops:i,days_with_subagents:t.size,top_types:m,examples:f},skill_use:{skill_calls:o,days_with_skills:s.size,top_skills:_,examples:v},plan_gating:{exit_plan_calls:l,days_with_plan:n.size},turn_shape:{tools_per_turn:Math.round(10*x)/10,interrupts:d,long_autonomous_days:r.size,label:x<5?"rapid":x<15?"mixed":"batch",longest_turn:b}}}(w):null,N=n[6],j={start:`${e}T00:00:00`,end:`${N}T23:59:59`};return{version:t$.CURRENT_WEEK_DIGEST_SCHEMA_VERSION,scope:"week",key:e,window:j,day_refs:t.map(e=>e.key).sort(),generated_at:new Date().toISOString(),is_live:!1,model:null,cost_usd:null,agent_min_total:a,projects:d,shipped:u,outcome_mix:c,helpfulness_sparkline:p,top_flags:m,top_goal_categories:f,concurrency_peak_day:g,days_active:v,busiest_day:k,longest_run:b,hours_distribution:x,interaction_modes:T,working_shapes:S,interaction_grammar:$,headline:null,key_pattern:null,trajectory:null,standout_days:null,what_worked:null,what_stalled:null,what_surprised:null,where_to_lean:null,recurring_themes:null,outcome_correlations:null,friction_categories:null,suggestions:null,on_the_horizon:null,fun_ending:null}}let sS=e=>tL({...e,systemPrompt:sf});function s$(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function sT(e,t,s,n){let r=s$(n),a=new Map;for(let e of t){let t=[e.headline,e.what_went_well,e.what_hit_friction].filter(e=>!!e);a.set(e.key,s$(t.join(" \n ")))}for(let e of s){let t=e.local_day,s=a.get(t)??"",n=[e.first_user,e.final_agent,...(e.subagents??[]).flatMap(e=>[e.description,e.prompt_preview])].filter(e=>!!e).join(" \n ");a.set(t,s$(s+" \n "+n))}let i=e=>{let t=s$(e.evidence.quote);if(r.includes(t))return!0;let s=a.get(e.evidence.date);return!!s&&s.includes(t)};return{...e,what_worked:(e.what_worked??[]).filter(i),what_stalled:(e.what_stalled??[]).filter(i),what_surprised:(e.what_surprised??[]).filter(i)}}async function sN(e,t,s={}){let n=sx(e,t,{entriesByDay:s.entriesByDay});if(t.filter(e=>null!==e.headline).length<2)return{digest:n,usage:null};let r=s.model??"sonnet",a=s.callLLM??sS,i=function(e,t){let s=[],n=(e="")=>s.push(e),r=new Map;for(let e of t)for(let t of e.shipped){let s=r.get(t.project)??[];s.push({title:t.title,date:e.key}),r.set(t.project,s)}n(`# Week ${e.key} (${e.window.start} → ${e.window.end})`),n(),n(`Total agent time: ${Math.round(e.agent_min_total)} min across ${t.length} day(s) with data.`);let a={shipped:0,partial:0,blocked:0,exploratory:0,trivial:0,idle:0};for(let t of sg)a[t]=e.outcome_mix[t]??0;let i=sg.filter(e=>a[e]>0).map(e=>`${e}=${a[e]}`).join(", ");for(let t of(n(`Outcome mix: ${i||"(empty)"}.`),n(`Helpfulness sparkline (Mon→Sun): ${e.helpfulness_sparkline.map(e=>e??"·").join(" ")}`),e.concurrency_peak_day&&n(`Concurrency peak day: ${e.concurrency_peak_day}.`),n(),n("## Projects (top by agent_min)"),e.projects.slice(0,8))){let e=t.display_name??function(e){let t=e.split("/").filter(Boolean);return t[t.length-1]??e}(t.name),s=(r.get(e)??[]).slice(0,8),a=s.length>0?s.map(e=>` - "${e.title}" (${e.date})`).join("\n"):" - (no PRs shipped)";n(`- ${e} — ${Math.round(t.agent_min)}m, ${Math.round(10*t.share_pct)/10}% share, ${t.shipped_count} PR${1===t.shipped_count?"":"s"}`),n(a)}n(),e.top_flags.length>0&&n(`Top flags: ${e.top_flags.map(e=>`${e.flag}(${e.count})`).join(", ")}`),e.top_goal_categories.length>0&&n(`Goal-category minutes: ${e.top_goal_categories.map(e=>`${e.category}=${e.minutes}m`).join(", ")}`),n(),n("## Working shapes (deterministic, already classified)");let o=e.working_shapes??[];if(0===o.length)n("(none — no day reached the threshold for shape classification)");else for(let e of o){let t=[...new Set(e.occurrences.map(e=>e.date))].sort(),s=Object.entries(e.outcome_distribution??{}).filter(([,e])=>e>0).map(([e,t])=>`${e}:${t}`).join(", ");n(`- ${e.shape} — ${e.occurrences.length} occurrence(s) on [${t.join(", ")}]${s?`; outcomes ${s}`:""}`)}n(),n("## Interaction grammar");let l=e.interaction_grammar;if(l){if(l.brainstorming_warmup_days?.length&&n(`- Brainstorm-warmup days (${l.brainstorming_warmup_days.length}): ${l.brainstorming_warmup_days.join(", ")}`),l.prompt_frames?.length){let e=l.prompt_frames.map(e=>`${e.frame}(${e.origin})\xd7${e.count}`).join(", ");n(`- Prompt frames: ${e}`)}if(l.user_authored_skills?.length){let e=l.user_authored_skills.map(e=>`${e.skill}\xd7${e.count}`).join(", ");n(`- User-authored skills: ${e}`)}if(l.skill_families?.length){let e=l.skill_families.map(e=>`${e.family}(${e.members.length} members, ${e.total_count} uses)`).join(", ");n(`- Skill families: ${e}`)}if(l.user_authored_subagents?.length){let e=l.user_authored_subagents.map(e=>`${e.type}\xd7${e.count}`).join(", ");n(`- User-authored subagent types: ${e}`)}l.threads?.length&&n(`- Multi-day threads: ${l.threads.length} (total ${l.threads.reduce((e,t)=>e+t.total_active_min,0)}m active)`);let e=l.communication_style;if(e){let t=e.verbosity_distribution;n(`- Verbosity: short=${t.short}, medium=${t.medium}, long=${t.long}, very_long=${t.very_long}`);let s=e.external_context_refs;s.length&&n(`- External-ref openings (${s.length}): ${s.slice(0,5).map(e=>`${e.ref_kind}@${e.date}`).join(", ")}`);let r=e.steering;n(`- Steering: ${r.total_interrupts} interrupts, ${r.total_frustrated} frustrated, ${r.total_dissatisfied} dissatisfied, ${r.sessions_with_mid_run_redirect} mid-run redirects, across ${r.total_turns} turns`)}n(`- TodoWrite ops total: ${l.todo_ops_total}`),l.plan_mode&&n(`- Plan Mode: ${l.plan_mode.exit_plan_calls} exit_plan calls, ${l.plan_mode.days_with_plan} day(s) with plan use`)}else n("(none)");let d=t.slice().sort((e,t)=>e.key.localeCompare(t.key));for(let e of(n(),n("## Day summaries"),d)){var u;n();let t=e.top_flags.slice(0,5).map(e=>`${e.flag}(${e.count})`).join(", "),s=e.day_signals?.dominant_shape??null,r=s?` \xb7 shape: ${s}`:"";n(`### ${(u=e.key,new Date(`${u}T12:00:00`).toLocaleDateString("en-US",{weekday:"short"}))} ${e.key} — ${Math.round(e.agent_min)}m active \xb7 outcome: ${e.outcome_day}${r}`),e.headline&&n(`Headline: ${e.headline}`),e.day_signature&&n(`Signature: ${e.day_signature}`),e.what_went_well&&n(`Went well: ${e.what_went_well}`),e.what_hit_friction&&n(`Hit friction: ${e.what_hit_friction}`),e.suggestion&&n(`Suggestion: ${e.suggestion.headline} — ${e.suggestion.body}`),t&&n(`Flags: ${t}`),null!==e.helpfulness_day&&void 0!==e.helpfulness_day&&n(`Helpfulness: ${e.helpfulness_day}`);let a=e.day_signals;if(a){let e=Object.entries(a.shape_distribution??{}).filter(([,e])=>e>0).map(([e,t])=>`${e}:${t}`).join(", ");if(e&&n(`Shape distribution: ${e}`),a.skills_loaded.length){let e=a.skills_loaded.slice(0,6).map(e=>`${e.skill}(${e.origin})${e.count>1?`\xd7${e.count}`:""}`).join(", ");n(`Skills loaded: ${e}`)}if(a.user_authored_subagents_used.length){let e=a.user_authored_subagents_used.slice(0,4).map(e=>`${e.type}${e.count>1?`\xd7${e.count}`:""}`).join(", ");n(`User-authored subagents: ${e}`)}if(a.prompt_frames.length){let e=a.prompt_frames.map(e=>`${e.frame}(${e.origin})${e.count>1?`\xd7${e.count}`:""}`).join(", ");n(`Prompt frames: ${e}`)}let t=a.comm_style.verbosity_distribution;n(`Verbosity: short=${t.short}, medium=${t.medium}, long=${t.long}, very_long=${t.very_long}`);let s=a.comm_style.steering;n(`Steering: ${s.interrupts} interrupts, ${s.frustrated} frustrated, ${s.dissatisfied} dissatisfied, ${s.sessions_with_mid_run_redirect} mid-run redirects`),a.brainstorm_warmup_session_count>0&&n(`Brainstorm-warmup sessions: ${a.brainstorm_warmup_session_count}`),a.plan_mode_used&&n("Plan Mode: used"),a.todo_ops_total>0&&n(`TodoWrite ops: ${a.todo_ops_total}`)}}return s.join("\n")}(n,t),o=0,l=0,d=r,u=[];for(let e of(s.entriesByDay??new Map).values())u.push(...e);function c(e){let t=n.projects.map(t=>{let s=e.project_areas.find(e=>e.display_name===t.display_name);return s?{...t,description:s.description}:t});return{...n,projects:t,model:d,cost_usd:tU(d,o,l),headline:e.headline,key_pattern:e.key_pattern,trajectory:e.trajectory,standout_days:e.standout_days,what_worked:e.what_worked,what_stalled:e.what_stalled,what_surprised:e.what_surprised,where_to_lean:e.where_to_lean,recurring_themes:null,outcome_correlations:null,friction_categories:null,suggestions:null,on_the_horizon:null,fun_ending:null}}try{let p,h,m=await a({model:r,userPrompt:i,onProgress:s.onProgress});o+=m.input_tokens,l+=m.output_tokens,d=m.model;let _=(p=m.content,tR(p,s_));if(_.ok)return{digest:c(sT(_.value,t,u,i)),usage:{input_tokens:o,output_tokens:l}};let f=await a({model:r,userPrompt:i,reminder:"Your previous response was not valid JSON or did not match the required schema. Return ONLY the JSON object with all required fields — no prose, no code fence.",onProgress:s.onProgress});o+=f.input_tokens,l+=f.output_tokens,d=f.model;let g=(h=f.content,tR(h,s_));if(g.ok)return{digest:c(sT(g.value,t,u,i)),usage:{input_tokens:o,output_tokens:l}};return console.warn(`[digest-week] ${e}: LLM response failed validation after retry (${g.error})`),{digest:n,usage:{input_tokens:o,output_tokens:l}}}catch(t){return console.warn(`[digest-week] ${e}: LLM invocation failed (${t.message})`),{digest:n,usage:o>0?{input_tokens:o,output_tokens:l}:null}}}var tS=tS;let sj=/^\d{4}-\d{2}-\d{2}$/,sO=tS.object({headline:tS.string().min(1).max(120),body:tS.string().min(1).max(800)}),sM=tS.object({headline:tS.string().min(1).max(160),trajectory:tS.array(tS.object({week_start:tS.string().regex(sj),line:tS.string().min(1).max(280)})).min(1),standout_weeks:tS.array(tS.object({week_start:tS.string().regex(sj),why:tS.string().min(1).max(400)})).min(1).max(2),friction_themes:tS.string().max(800),suggestion:sO}).passthrough(),sE=`You are the monthly digest writer for Fleetlens.
275
+
276
+ You receive a JSON payload describing one calendar month, summarised through its 4–5 weekly digests.
277
+ Your job: produce a 5-field JSON object capturing the shape of the month.
278
+
279
+ INPUT shape:
280
+ - period: { start, end, label } — label is the month name e.g. "April 2026"
281
+ - totals: { agent_min_total, week_count_with_data }
282
+ - outcome_mix: { shipped, partial, blocked, exploratory, trivial, idle } — counts of DAYS in the month bucketed by their day-level outcome. Absent values are zero.
283
+ - helpfulness_by_week: array of { week_start, helpfulness } where helpfulness is "essential" | "helpful" | "neutral" | "unhelpful" | null.
284
+ - projects: top 5 by minutes.
285
+ - shipped: all PRs shipped this month, each { title, project, date }.
286
+ - top_flags, top_goal_categories.
287
+ - concurrency_peak_week: { week_start, peak } or null.
288
+ - week_summaries: per-week { week_start, headline, trajectory (array of day-line objects), standout_days, friction_themes, suggestion, agent_min, helpfulness_week }.
289
+
290
+ OUTPUT: ONE JSON object. No prose outside. Schema:
291
+
292
+ {
293
+ "headline": "≤120 chars; concrete claim grounded in the data; second-person",
294
+ "trajectory": [
295
+ { "week_start": "YYYY-MM-DD", "line": "≤30 words; one sentence about that week grounded in its week_summary" }
296
+ // one entry per week_summary in chronological order
297
+ ],
298
+ "standout_weeks": [
299
+ { "week_start": "YYYY-MM-DD", "why": "1-2 sentences explaining why this week defined the month" }
300
+ // 1 to 2 entries
301
+ ],
302
+ "friction_themes": "2-3 sentences clustering recurring friction patterns across weeks; empty string if no friction stuck",
303
+ "suggestion": { "headline": "≤120 chars, imperative", "body": "2-3 sentences, actionable for next month" }
304
+ }
305
+
306
+ RULES:
307
+
308
+ 1. Ground every claim in the data. No archetype labels.
309
+ 2. Trajectory lines name the dominant work of each week — projects shipped, themes that ran across multiple days, blockers that persisted.
310
+ 3. Standout weeks are weeks that shipped disproportionately, were unusually blocked, or shifted the trajectory of the month.
311
+ 4. Friction themes look at recurrence — friction that appeared in 2+ weeks deserves naming; one-week friction usually doesn't.
312
+ 5. Strict JSON.`,sA=["shipped","partial","blocked","exploratory","trivial","idle"];function sZ(e){let[t,s]=e.split("-"),n=Number(t),r=Number(s),a=[],i=(8-new Date(n,r-1,1).getDay())%7,o=new Date(new Date(n,r-1,1+i));for(;o.getMonth()===r-1;)a.push(sC(o)),o.setDate(o.getDate()+7);return a}function sC(e){let t=e.getFullYear(),s=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${s}-${n}`}function sP(e,t){let s=sZ(e),n=new Map;for(let e of t)n.set(e.key,e);let r=t.reduce((e,t)=>e+t.agent_min_total,0),a=new Map;for(let e of t)for(let t of e.projects){let e=a.get(t.name)??{agent_min:0,shipped_count:0};e.agent_min+=t.agent_min,e.shipped_count+=t.shipped_count,a.set(t.name,e)}let i=[...a.entries()].sort((e,t)=>t[1].agent_min-e[1].agent_min).map(([e,t])=>{let s;return{name:e,display_name:(s=e.split("/").filter(Boolean))[s.length-1]??e,agent_min:t.agent_min,share_pct:r>0?t.agent_min/r*100:0,shipped_count:t.shipped_count}}),o=[];for(let e of t)for(let t of e.shipped)o.push({title:t.title,project:t.project,date:t.date,session_id:t.session_id});let l={};for(let e of t)for(let[t,s]of Object.entries(e.outcome_mix))l[t]=(l[t]??0)+s;let d=s.map(e=>{let t=n.get(e);return{week_start:e,helpfulness:t?t.helpfulness_sparkline.find(e=>null!==e)??null:null}}),u=new Map;for(let e of t)for(let t of e.top_flags)u.set(t.flag,(u.get(t.flag)??0)+t.count);let c=[...u.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({flag:e,count:t})),p=new Map;for(let e of t)for(let t of e.top_goal_categories)p.set(t.category,(p.get(t.category)??0)+t.minutes);let h=[...p.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e,t])=>({category:e,minutes:t})),m=null;for(let e of t){let t=e.concurrency_peak_day?.peak??0;t>0&&(!m||t>m.peak)&&(m={week_start:e.key,peak:t})}let[_,f]=e.split("-"),g=Number(_),y=Number(f),v=`${e}-01`,k=sC(new Date(g,y,0)),w={start:`${v}T00:00:00`,end:`${k}T23:59:59`};return{version:t$.CURRENT_MONTH_DIGEST_SCHEMA_VERSION,scope:"month",key:e,window:w,week_refs:t.map(e=>e.key).sort(),generated_at:new Date().toISOString(),is_live:!1,model:null,cost_usd:null,agent_min_total:r,projects:i,shipped:o,outcome_mix:l,helpfulness_by_week:d,top_flags:c,top_goal_categories:h,concurrency_peak_week:m,headline:null,trajectory:null,standout_weeks:null,friction_themes:null,suggestion:null}}let sD=e=>tL({...e,systemPrompt:sE});async function sI(e,t,s={}){let n=sP(e,t);if(t.filter(e=>null!==e.headline).length<2)return{digest:n,usage:null};let r=s.model??"sonnet",a=s.callLLM??sD,i=function(e,t){let s=t.slice().sort((e,t)=>e.key.localeCompare(t.key)).map(e=>{let t=e.helpfulness_sparkline.find(e=>null!==e)??null,s=e.friction_categories&&e.friction_categories.length>0?e.friction_categories.map(e=>`${e.category}: ${e.description}`).join(" "):null,n=e.suggestions?.usage_patterns?.[0],r=n?{headline:n.title,body:n.suggestion}:null;return{week_start:e.key,headline:e.headline,trajectory:e.trajectory,standout_days:e.standout_days,friction_themes:s,suggestion:r,agent_min:Math.round(e.agent_min_total),helpfulness_week:t}}),n={shipped:0,partial:0,blocked:0,exploratory:0,trivial:0,idle:0};for(let t of sA)n[t]=e.outcome_mix[t]??0;return JSON.stringify({period:{start:e.window.start,end:e.window.end,label:function(e){let[t,s]=e.split("-");return t&&s?new Date(Number(t),Number(s)-1,1).toLocaleDateString("en-US",{month:"long",year:"numeric"}):e}(e.key)},totals:{agent_min_total:Math.round(e.agent_min_total),week_count_with_data:s.length},outcome_mix:n,helpfulness_by_week:e.helpfulness_by_week,projects:e.projects.slice(0,5).map(e=>{var t;let s;return{display_name:e.display_name??(s=(t=e.name).split("/").filter(Boolean))[s.length-1]??t,agent_min:Math.round(e.agent_min),share_pct:Math.round(10*e.share_pct)/10,shipped_count:e.shipped_count}}),shipped:e.shipped.map(e=>({title:e.title,project:e.project,date:e.date})),top_flags:e.top_flags,top_goal_categories:e.top_goal_categories,concurrency_peak_week:e.concurrency_peak_week,week_summaries:s},null,2)}(n,t),o=0,l=0,d=r;try{let t,u,c=await a({model:r,userPrompt:i,onProgress:s.onProgress});o+=c.input_tokens,l+=c.output_tokens,d=c.model;let p=(t=c.content,tR(t,sM));if(p.ok)return{digest:{...n,model:d,cost_usd:tU(d,o,l),headline:p.value.headline,trajectory:p.value.trajectory,standout_weeks:p.value.standout_weeks,friction_themes:p.value.friction_themes,suggestion:p.value.suggestion},usage:{input_tokens:o,output_tokens:l}};let h=await a({model:r,userPrompt:i,reminder:"Your previous response was not valid JSON or did not match the required schema. Return ONLY the JSON object with the five required fields — no prose, no code fence.",onProgress:s.onProgress});o+=h.input_tokens,l+=h.output_tokens,d=h.model;let m=(u=h.content,tR(u,sM));if(m.ok)return{digest:{...n,model:d,cost_usd:tU(d,o,l),headline:m.value.headline,trajectory:m.value.trajectory,standout_weeks:m.value.standout_weeks,friction_themes:m.value.friction_themes,suggestion:m.value.suggestion},usage:{input_tokens:o,output_tokens:l}};return console.warn(`[digest-month] ${e}: LLM response failed validation after retry (${m.error})`),{digest:n,usage:{input_tokens:o,output_tokens:l}}}catch(t){return console.warn(`[digest-month] ${e}: LLM invocation failed (${t.message})`),{digest:n,usage:o>0?{input_tokens:o,output_tokens:l}:null}}}var tS=tS;function sL(e){return Math.round(e/1e3/60*10)/10}function sR(e,t){return e?e.length<=2*t+60?{chars:e.length,preview:e}:{chars:e.length,preview:e.slice(0,t)+`
313
+ […truncated ${e.length-2*t} chars…]
314
+ `+e.slice(-t)}:null}function sU(e){let t=[...e].sort((e,t)=>e-t),s=0;for(let e=1;e<t.length;e++){let n=t[e]-t[e-1];n<18e4&&(s+=n)}return s}let sF=new Set(["sudo","time","nohup","nice","env","exec"]),sY=/\[request interrupted|interrupted by user/i,sW=/--title\s+["']([^"']+)["']/,sz=tS.object({start_min:tS.number(),end_min:tS.number().optional(),kind:tS.enum(["user-steering","subagent-burst","long-autonomous","plan-mode","pr-ship","harness-chain","interrupt","brainstorm-loop","agent-loop"]),label:tS.string().min(1).transform(e=>{if(e.length<=320)return e;let t=317,s=e.charCodeAt(t-1);return s>=55296&&s<=56319&&(t-=1),e.slice(0,t)+"..."})}),sB=tS.object({why_picked:tS.string().min(1).max(280),session_summary:tS.string().min(1).max(400),what_worked:tS.string().max(280).nullable(),what_hit_friction:tS.string().max(280).nullable(),steering_summary:tS.string().min(1).max(280),pins:tS.array(sz).min(2).max(6)}).passthrough(),sV=`You are writing the editorial perception layer for ONE session in a developer's weekly report. The reader sees a timeline minimap of this session with annotated pin markers; your job is to write a structured deep-dive that surfaces what made this session worth examining.
315
+
316
+ INPUT shape (transcript-style markdown, NOT JSON):
317
+ The user prompt is a markdown document with these sections:
318
+ • Header lines: session id, project, date, started_at, wall/active/idle/turns, outcome, working shape, day signature, shipped PRs.
319
+ • "## Harness" — bullets: user-authored skills, user-authored subagents, stock skills, top tools.
320
+ • "## Steering" — single line: user message count, median chars, long-msg count, interrupt count.
321
+ • "## Turns (N)" — one "### Turn K — start–end (wall, active, idle_before)" subsection per turn.
322
+ Each turn has labeled lines:
323
+ - "USER (Nc): <head-tail-truncated preview>"
324
+ - "FIRST_AGENT / LAST_AGENT / AGENT (Nc): <head-tail-truncated preview>" (only one of these per turn)
325
+ - "Tools: tool1, tool2, ..."
326
+ - "Skills loaded this turn: ..."
327
+ - "Subagent dispatched: <type> — <description>" with a " prompt: <preview>" sub-line if present
328
+ - "Signals: exit_plan\xd7N \xb7 TodoWrite ops: M \xb7 interrupts: K \xb7 PR created: '...' \xb7 LONG-AUTONOMOUS RUN" (only when present)
329
+ • "## Candidate pins" — bullet per candidate: "[start_min–end_min] kind — key=value, key=value". These are deterministic moments; pick + label the most editorial 3-5.
330
+
331
+ DURATION matters: a turn with active_min ≫ wall_min indicates the agent worked autonomously inside; idle_before_min indicates user-initiated gaps.
332
+
333
+ OUTPUT: ONE JSON object. Strict JSON, no prose outside, no fence.
334
+
335
+ {
336
+ "why_picked": "1 sentence, ≤200 chars. WHY THIS SESSION matters in the week's context. Anchor in the most distinctive signals — PR count vs week total, longest autonomous span, unusual subagent dispatch count, dominant working_shape on a heavy day. Example: 'Picked because this 471-min session shipped 4 of the week's 22 PRs through a chunk-implementation pattern with 21 subagent dispatches.'",
337
+
338
+ "session_summary": "1-2 sentences, second-person, ≤300 chars. WHAT HAPPENED — narrative arc tying the pins into a story. Anchor in the working_shape AND concrete turn observations. Example: 'You drove this 78-min session through a 1.5K-char handoff prompt, four parallel research subagents, and a 25-min autonomous build → ship cycle.'",
339
+
340
+ "what_worked": "1 sentence, ≤200 chars. STRONGEST POSITIVE SIGNAL in this session. Tie to a specific moment — a successful subagent fan-out, a clean autonomous run that shipped, a quick error diagnosis, full trust extended. Example: 'The 25-min long-autonomous run shipped 7 chunks without interrupts — the upfront brainstorming load gave the agent enough scope to drive end-to-end.' Set null ONLY when the session was truly friction-dominated with no clear win.",
341
+
342
+ "what_hit_friction": "1 sentence, ≤200 chars. MOST LOAD-BEARING FRICTION in this session. Tie to a specific moment — a long error paste, an interrupt cluster, a back-and-forth around a misunderstanding, a stalled subagent. Example: 'A 51K-char typecheck dump at minute 25 ate three turns of correction before the agent narrowed it down to one line.' Set null ONLY when the session was genuinely smooth (no interrupts, no error pastes, no mid-flight redirects).",
343
+
344
+ "steering_summary": "1 sentence, ≤200 chars. HOW the user drove the agent. Reference: verbosity (long handoffs vs terse imperatives), framing (skill loads, slash commands), corrections (interrupts, mid-flight redirects), or trust (long-autonomous spans). Example: 'Heavy upfront briefing (3 messages ≥1K chars) then short steering — no interrupts, full trust through the 25-min build run.'",
345
+
346
+ "pins": [
347
+ { "start_min": <number>, "end_min": <number?>, "kind": "<one of: user-steering|subagent-burst|long-autonomous|plan-mode|pr-ship|harness-chain|interrupt|brainstorm-loop|agent-loop>", "label": "≤200 chars, second-person, editorial — explain WHAT happened and WHAT the user was doing, not just the rule label. Anchor with one or two specifics (turn number, char count, subagent count, PR title, version) but keep it tight" }
348
+ // 3-5 items picked from candidate_pins (or composed from turns when a candidate is incomplete)
349
+ ]
350
+ }
351
+
352
+ CRITICAL: each of why_picked / session_summary / what_worked / what_hit_friction is ONE sentence with a SPECIFIC observation — not generic ("this was a productive session"). They earn their space by adding something the reader couldn't infer from the timeline alone.
353
+
354
+ PIN-LABEL RULES (load-bearing):
355
+
356
+ 1. Pick 3-5 candidates that tell the SESSION'S STORY. If two candidates fire on the same turn (e.g. user-steering + subagent-burst), emit ONE merged pin describing both. ("Steered with a 5K spec then immediately fanned out 4 research subagents.")
357
+ 2. Labels are second-person editorial — describe what the user did, not what the system detected.
358
+ - Bad: "user-steering kind, 1542 chars at turn 1"
359
+ - Good: "Steered with a 1.5K-char handoff prompt — full scope set before any code touched"
360
+ 3. Ground every label in the turn's actual content. Read the user/first_agent/last_agent text. Use the working_shape and harness signature to interpret.
361
+ 4. For pr-ship pins, name the PR title (truncated if needed).
362
+ 5. For long-autonomous spans, include the duration AND what was accomplished (read the turn's last_agent text for evidence).
363
+ 6. For user-steering pins, distinguish formats:
364
+ - format="long-paste" + agent diagnoses → "Pasted X-char error log; agent diagnosed in one turn"
365
+ - format="long-prose" + skills loaded → "Loaded the brainstorming skill with a Y-char design ask"
366
+ - format="long-prose" no skills → "Steered with a Y-char detailed brief"
367
+ 7. For subagent-burst pins, characterize the role mix from descriptions (reviewers / researchers / implementers).
368
+ 8. For harness-chain pins, name the actual chain in order: "writing-plans → executing-plans → simplify".
369
+ 9. Conform to the ANCHORING RULE: every label must reference data visible in the input — turn number, message length, subagent count, skill name, PR title, duration. No floating prose.
370
+
371
+ VOCABULARY:
372
+ - "you" not "user"
373
+ - Working-shape names (spec-review-loop, chunk-implementation, etc.) are encouraged
374
+ - Internal flag tokens (loop_suspected, long_autonomous, fast_ship) — forbidden in labels
375
+ - "Plan Mode" specifically means /plan tool calls
376
+ - Avoid identity claims ("you're a Plan Mode person"). Stick to observed action.
377
+ `,sH=e=>tL({...e,systemPrompt:sV});async function sJ(e,t={}){let s={session_id:e.session_id,date:e.date,project:e.project,project_display:e.project_display,start_iso:e.start_iso,wall_min:e.wall_min,active_min:e.active_min,idle_min:e.idle_min,turn_count:e.turn_count,outcome:e.outcome??null,shipped_prs:e.shipped_prs,working_shape:e.working_shape,day_signature:e.day_signature,user_authored_skills:e.user_authored_skills,user_authored_subagents:e.user_authored_subagents,stock_skills:e.stock_skills,top_tools:e.top_tools,steering:e.steering,timeline:{duration_min:e.wall_min,active_intervals:e.active_intervals},session_summary:null,steering_summary:null,why_picked:null,what_worked:null,what_hit_friction:null,pins:[]};if(0===e.candidate_pins.length)return{topSession:s,usage:null};let n=t.model??"sonnet",r=t.callLLM??sH,a=function(e){let t=[],s=(e="")=>t.push(e);s(`# Session ${e.session_id}`),s(`Project: ${e.project_display} \xb7 Date: ${e.date} \xb7 Started: ${e.start_iso}`),s(`Wall: ${e.wall_min}m \xb7 Active: ${e.active_min}m \xb7 Idle: ${e.idle_min}m \xb7 Turns: ${e.turn_count}`);let n=[];if(e.outcome&&n.push(`Outcome: ${e.outcome}`),e.working_shape&&n.push(`Working shape: ${e.working_shape}`),n.length&&s(n.join(" · ")),e.day_signature&&s(`Day signature: "${e.day_signature}"`),e.shipped_prs.length)for(let t of(s(`Shipped PRs (${e.shipped_prs.length}):`),e.shipped_prs))s(` - "${t}"`);if(s(),s("## Harness"),s(`- User-authored skills: ${e.user_authored_skills.length?e.user_authored_skills.join(", "):"(none)"}`),e.user_authored_subagents.length){let t=e.user_authored_subagents.map(e=>`${e.type}\xd7${e.count}`).join(", ");s(`- User-authored subagents: ${t}`)}s(`- Stock skills loaded: ${e.stock_skills.length?e.stock_skills.join(", "):"(none)"}`),s(`- Top tools: ${e.top_tools.length?e.top_tools.join(", "):"(none)"}`),s();let r=e.steering;for(let t of(s("## Steering"),s(`${r.user_msg_count} user messages (median ${r.median_user_msg_chars} chars, ${r.long_user_msg_count} long, ${r.interrupts} interrupts)`),s(),s(`## Turns (${e.turns.length})`),e.turns)){s();let e=t.idle_before_min>0?` \xb7 ${t.idle_before_min}m idle before`:"";if(s(`### Turn ${t.turn} — ${t.start_min}m–${t.end_min}m (${t.wall_min}m wall, ${t.active_min}m active${e})`),t.user&&s(`USER (${t.user.chars}c): ${t.user.preview}`),t.first_agent&&s(`FIRST_AGENT (${t.first_agent.chars}c): ${t.first_agent.preview}`),t.last_agent&&s(`LAST_AGENT (${t.last_agent.chars}c): ${t.last_agent.preview}`),!t.agent||t.first_agent||t.last_agent||s(`AGENT (${t.agent.chars}c): ${t.agent.preview}`),t.tools.length&&s(`Tools: ${t.tools.join(", ")}`),t.skills_loaded?.length&&s(`Skills loaded this turn: ${t.skills_loaded.join(", ")}`),t.subagents_dispatched?.length)for(let e of t.subagents_dispatched)s(`Subagent dispatched: ${e.type} — ${e.description}`),e.prompt_preview&&s(` prompt: ${e.prompt_preview}`);let n=[];t.exit_plan_calls&&n.push(`exit_plan\xd7${t.exit_plan_calls}`),t.todo_ops&&n.push(`TodoWrite ops: ${t.todo_ops}`),t.interrupts&&n.push(`interrupts: ${t.interrupts}`),t.pr_created&&n.push(`PR created: "${t.pr_created}"`),t.long_autonomous_run&&n.push("LONG-AUTONOMOUS RUN"),n.length&&s(`Signals: ${n.join(" · ")}`)}if(s(),s('## Candidate pins (deterministic — pick + label the most editorial 3-6 of these for your "pins" output)'),0===e.candidate_pins.length)s("(none — sparse session)");else for(let t of e.candidate_pins){let e=void 0!==t.end_min?`${t.start_min}m–${t.end_min}m`:`${t.start_min}m`,n=[];for(let[e,s]of Object.entries(t.context??{}))null!=s&&("string"==typeof s?n.push(`${e}="${s.length>200?s.slice(0,197)+"...":s}"`):Array.isArray(s)?n.push(`${e}=[${s.length} items]`):"object"==typeof s?n.push(`${e}={...}`):n.push(`${e}=${s}`));s(`- [${e}] ${t.kind}${n.length?` — ${n.join(", ")}`:""}`)}return t.join("\n")}(e),i=0,o=0;function l(e){let t=e.pins.map(e=>({start_min:e.start_min,end_min:e.end_min,kind:e.kind,label:e.label}));return{...s,session_summary:e.session_summary,steering_summary:e.steering_summary,why_picked:e.why_picked,what_worked:e.what_worked,what_hit_friction:e.what_hit_friction,pins:t}}try{let d,u,c=await r({model:n,userPrompt:a,onProgress:t.onProgress});i+=c.input_tokens,o+=c.output_tokens,c.model;let p=(d=c.content,tR(d,sB));if(p.ok)return{topSession:l(p.value),usage:{input_tokens:i,output_tokens:o}};let h=await r({model:n,userPrompt:a,reminder:"Your previous response was not valid JSON or did not match the required schema. Return ONLY the JSON object with session_summary + steering_summary + pins (3-5 items, each with start_min/kind/label) — no prose, no code fence.",onProgress:t.onProgress});i+=h.input_tokens,o+=h.output_tokens,h.model;let m=(u=h.content,tR(u,sB));if(m.ok)return{topSession:l(m.value),usage:{input_tokens:i,output_tokens:o}};return console.warn(`[top-session] ${e.session_id}: LLM validation failed after retry (${m.error})`),{topSession:s,usage:{input_tokens:i,output_tokens:o}}}catch(t){return console.warn(`[top-session] ${e.session_id}: LLM invocation failed (${t.message})`),{topSession:s,usage:i>0?{input_tokens:i,output_tokens:o}:null}}finally{}}async function*sq(e,t){let s=t.now??(()=>Date.now()),n=e===t.currentWeekMonday,r=t.settings.enabled;if(!n&&!t.force){let t=(0,sr.readWeekDigest)(e);if(t)return void(yield{type:"digest",digest:t})}if(n&&!t.force){let t=(0,sr.getCurrentWeekDigestFromCache)(e,s());if(t)return void(yield{type:"digest",digest:t})}yield{type:"status",phase:"load_dependencies",text:`Loading 7 days for week of ${e}`};let a=sv(e),l=[];for(let e of a){if(e>t.todayLocalDay){yield{type:"dependency",kind:"day",key:e,status:"cached"};continue}let s=e===t.todayLocalDay,n=s?null:(0,sr.readDayDigest)(e);if(n){l.push(n),yield{type:"dependency",kind:"day",key:e,status:"cached"};continue}if(s){let s={settings:t.settings,force:!1,callLLM:t.callLLM,now:t.now,todayLocalDay:t.todayLocalDay,caller:t.caller},n=null,r=!1;for await(let t of sd(e,s))if("digest"===t.type&&"day"===t.digest.scope&&(n=t.digest),"error"===t.type){r=!0;break}n?(l.push(n),yield{type:"dependency",kind:"day",key:e,status:"cached"}):r&&(yield{type:"dependency",kind:"day",key:e,status:"failed"});continue}let r={settings:t.settings,force:!1,callLLM:t.callLLM,now:t.now,todayLocalDay:t.todayLocalDay,caller:t.caller},a=null,i=!1;for await(let t of sd(e,r)){if("digest"===t.type){"day"===t.digest.scope&&(a=t.digest);continue}if("saved"!==t.type){if("error"===t.type){i=!0;continue}yield t}}a?(l.push(a),yield{type:"dependency",kind:"day",key:e,status:"generated"}):i&&(yield{type:"dependency",kind:"day",key:e,status:"failed"})}if(0===l.length)return void(yield{type:"error",message:`no day digests available for week of ${e}`});let d=new Map;for(let e of a)e>t.todayLocalDay||d.set(e,(0,tq.listEntriesForDay)(e));r&&tX();try{let a,c=new Map(l.map(e=>[e.key,e])),p=r?function(e){let t=[];for(let s of e.values())t.push(...s);let s=t.filter(e=>e.numbers.active_min>=20||e.numbers.turn_count>=10||e.pr_titles.length>=1).map(e=>({entry:e,score:e.numbers.active_min*(1+.5*e.numbers.subagent_calls+5*e.pr_titles.length)})).sort((e,t)=>t.score-e.score),n=new Set,r=[];for(let{entry:e}of s)if(!n.has(e.project)&&(n.add(e.project),r.push(e),r.length>=3))break;return r}(d):[],h=(await Promise.all(p.map(async e=>{try{let t=await (0,sa.getSession)(e.session_id);if(!t)return null;let s=t.events,n=c.get(e.local_day);return{entry:e,slice:function(e,t,s){var n,r;let a,l=Date.parse(e.start_iso),{turns:d,sliceStartMs:c,sliceEndMs:p}=function(e,t,s){let n=[];for(let r of e){if(!r.timestamp)continue;let e=Date.parse(r.timestamp);!Number.isNaN(e)&&(e<t||e>s||n.push({...r,_ts:e}))}if(0===n.length)return{turns:[],sliceStartMs:t,sliceEndMs:s};n.sort((e,t)=>e._ts-t._ts);let r=n[0]._ts,a=n[n.length-1]._ts,i=[],o=null;for(let e of n){let t=e.raw,s=t?.message?.content;if("user"===e.rawType)if(Array.isArray(s)&&s.length>0&&s.every(e=>e&&"object"==typeof e&&"tool_result"===e.type))o&&(o.events.push(e),o.timestamps.push(e._ts));else{let t=(Array.isArray(s)?s.filter(e=>!!e&&"object"==typeof e&&"text"===e.type&&"string"==typeof e.text).map(e=>e.text).join(" "):"")||("string"==typeof s?s:""),n=sY.test(t);o&&n&&(o.interrupts+=1),o&&i.push(o),o={events:[e],user_text:t,agent_blocks:[],tools_count:new Map,bash_verbs:new Map,skills:new Map,subagents:[],exit_plan_calls:0,todo_ops:0,interrupts:0,pr_created:null,timestamps:[e._ts]}}else if("assistant"===e.rawType){if(!o)continue;if(o.events.push(e),o.timestamps.push(e._ts),Array.isArray(s)){for(let e of s)if(e&&"object"==typeof e){if("text"===e.type&&e.text)o.agent_blocks.push(e.text);else if("tool_use"===e.type){let t=e.name??"unknown";if(o.tools_count.set(t,(o.tools_count.get(t)??0)+1),"Skill"===t){let t=String(e.input?.skill??"unknown");o.skills.set(t,(o.skills.get(t)??0)+1)}else if("Agent"===t){let t=e.input??{};o.subagents.push({type:String(t.subagent_type??"general-purpose"),description:String(t.description??"").slice(0,80),prompt_preview:String(t.prompt??"").slice(0,240),background:!!t.run_in_background})}else if("ExitPlanMode"===t)o.exit_plan_calls+=1;else if("TodoWrite"===t||"TaskCreate"===t||"TaskUpdate"===t)o.todo_ops+=1;else if("Bash"===t){let t=String(e.input?.command??""),s=function(e){if(!e)return"?";let t=e.split(/\|\||&&|;|\|/,1)[0].trim();if(t.startsWith("cd ")){let s=e.split(/&&|;/,3);s.length>=2&&(t=s[1].trim())}let s=t.split(/\s+/).filter(Boolean);for(;s.length&&sF.has(s[0]);)s.shift();if(!s.length)return"?";let n=s[0];if(n.includes("=")&&!n.startsWith("/")){if(s.shift(),!s.length)return"?";n=s[0]}return n.includes("/")&&!n.startsWith("./")&&(n=n.replace(/\/+$/,"").split("/").pop()),n.replace(/^["']|["']$/g,"")||"?"}(t);if(o.bash_verbs.set(s,(o.bash_verbs.get(s)??0)+1),/\bgh\s+pr\s+create\b/.test(t)){let e=t.match(sW);o.pr_created=e?.[1]??t.slice(0,120)}}}}}}}return o&&i.push(o),{turns:i,sliceStartMs:r,sliceEndMs:a}}(t,l,Date.parse(e.end_iso)),h=d.flatMap(e=>e.timestamps),m=p-c,_=sU(h),f=[...h].sort((e,t)=>e-t),g=[];if(f.length>0){let e=f[0],t=f[0];for(let s=1;s<f.length;s++)f[s]-t>=18e4&&(g.push({start_min:sL(e-c),end_min:sL(t-c)}),e=f[s]),t=f[s];g.push({start_min:sL(e-c),end_min:sL(t-c)})}let y=[],v=c,k=[],w=0;d.forEach((e,t)=>{let s=Math.min(...e.timestamps),n=Math.max(...e.timestamps),r=sU(e.timestamps),a=0===t?0:Math.max(0,s-v);v=n,e.user_text&&(k.push(e.user_text.length),e.user_text.length>=800&&w++);let i=null,o=null;e.agent_blocks.length>0&&(i=e.agent_blocks[0],o=e.agent_blocks.reduce((e,t)=>t.length>e.length?t:e));let l=null!==i&&i===o,d=[];for(let[t,s]of[...e.tools_count.entries()].sort((e,t)=>t[1]-e[1]))if("Bash"===t&&e.bash_verbs.size>0){let t=[...e.bash_verbs.entries()].sort((e,t)=>t[1]-e[1]).slice(0,3).map(([e,t])=>t>1?`${e}\xd7${t}`:e).join(", ");d.push(`Bash\xd7${s} (${t})`)}else d.push(s>1?`${t}\xd7${s}`:t);let u={turn:t+1,start_min:sL(s-c),end_min:sL(n-c),wall_min:sL(n-s),active_min:sL(r),idle_before_min:sL(a),start_iso:new Date(s).toISOString(),user:e.user_text?sR(e.user_text,0===t?400:150):null,tools:d};l?u.agent=sR(i,200):(u.first_agent=i?sR(i,150):null,u.last_agent=o?sR(o,200):null),e.skills.size>0&&(u.skills_loaded=[...e.skills.entries()].map(([e,t])=>t>1?`${e}\xd7${t}`:e)),e.subagents.length>0&&(u.subagents_dispatched=e.subagents.map(e=>({type:e.type,description:e.description,prompt_preview:e.prompt_preview}))),e.exit_plan_calls>0&&(u.exit_plan_calls=e.exit_plan_calls),e.todo_ops>0&&(u.todo_ops=e.todo_ops),e.interrupts>0&&(u.interrupts=e.interrupts),e.pr_created&&(u.pr_created=e.pr_created),r>=12e5&&0===e.interrupts&&(u.long_autonomous_run=!0),y.push(u)});let b=new Map,x=new Map,S=new Map,$=new Map,T=0;for(let e of d){for(let[t,s]of e.skills)b.set(t,(b.get(t)??0)+s);for(let t of e.subagents)n=t.type,i.test(n)||x.set(t.type,(x.get(t.type)??0)+1);for(let[t,s]of e.tools_count)S.set(t,(S.get(t)??0)+s);for(let[t,s]of e.bash_verbs)$.set(t,($.get(t)??0)+s);T+=e.interrupts}let N=[],j=[];for(let e of b.keys()){let t=u(e);"user"===t?N.push(e):"stock"===t&&j.push(e)}let O=[];for(let[e,t]of[...S.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5))if("Bash"===e&&$.size>0){let e=[...$.entries()].sort((e,t)=>t[1]-e[1]).slice(0,3).map(([e,t])=>t>1?`${e}\xd7${t}`:e).join(", ");O.push(`Bash\xd7${t} (${e})`)}else O.push(`${e}\xd7${t}`);k.sort((e,t)=>e-t);let M=0===k.length?0:k[Math.floor(k.length/2)],E=[];for(let e of y)e.user?.chars&&e.user.chars>=800&&E.push({start_min:e.start_min,kind:"user-steering",context:{chars:e.user.chars,turn:e.turn,format:e.user.chars>=5e3?"long-paste":"long-prose"}}),e.subagents_dispatched&&e.subagents_dispatched.length>=3&&E.push({start_min:e.start_min,kind:"subagent-burst",context:{count:e.subagents_dispatched.length,types:e.subagents_dispatched.map(e=>e.type),turn:e.turn}}),e.long_autonomous_run&&E.push({start_min:e.start_min,end_min:e.end_min,kind:"long-autonomous",context:{duration_min:e.active_min,turn:e.turn}}),e.exit_plan_calls&&e.exit_plan_calls>0&&E.push({start_min:e.start_min,kind:"plan-mode",context:{turn:e.turn}}),e.pr_created&&E.push({start_min:e.start_min,kind:"pr-ship",context:{pr_title:e.pr_created,turn:e.turn}}),e.skills_loaded&&e.skills_loaded.length>=2&&E.push({start_min:e.start_min,kind:"harness-chain",context:{skills:e.skills_loaded,turn:e.turn}}),e.interrupts&&e.interrupts>0&&E.push({start_min:e.start_min,kind:"interrupt",context:{count:e.interrupts,turn:e.turn}});return{session_id:e.session_id,date:e.local_day,project:e.project,project_display:(a=(r=e.project).split("/").filter(Boolean))[a.length-1]??r,start_iso:new Date(c).toISOString(),wall_min:sL(m),active_min:sL(_),idle_min:sL(m-_),turn_count:y.length,outcome:e.enrichment.outcome,shipped_prs:e.pr_titles,working_shape:e.signals?.working_shape??o(e),day_signature:s,user_authored_skills:N,user_authored_subagents:[...x.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>({type:e,count:t})),stock_skills:j,top_tools:O,steering:{user_msg_count:k.length,long_user_msg_count:w,median_user_msg_chars:M,interrupts:T},active_intervals:g,turns:y,candidate_pins:E}}(e,s,n?.day_signature??null)}}catch(t){return console.warn(`[top-session] slice prep failed for ${e.session_id}: ${t.message}`),null}}))).filter(e=>null!==e);if(r){yield{type:"status",phase:"synth",text:h.length>0?`Synthesizing week narrative + diving into ${h.length} top session${1===h.length?"":"s"} in parallel`:"Synthesizing week narrative"};let s=[],n=sN(e,l,{model:t.settings.model,callLLM:t.callLLM,entriesByDay:d,onProgress:e=>{s.push({bytes:e.bytes,elapsed_ms:e.elapsedMs})}}),r=Promise.all(h.map(({entry:e,slice:s})=>sJ(s,{model:t.settings.model,callLLM:t.callLLM}).then(t=>({entry:e,...t})).catch(t=>(console.warn(`[top-session] LLM failed for ${e.session_id}: ${t.message}`),null)))),i=!1,o=!1;for(n.finally(()=>{i=!0}),r.finally(()=>{o=!0});!i||!o;)if(await new Promise(e=>setTimeout(e,500)),s.length>0){let e=s[s.length-1];yield{type:"progress",phase:"synth",bytes:e.bytes,elapsed_ms:e.elapsed_ms},s.length=0}let u=await n,c=await r;a=u.digest,u.usage&&tH({ts:new Date().toISOString(),caller:t.caller??"web",model:a.model??t.settings.model,input_tokens:u.usage.input_tokens,output_tokens:u.usage.output_tokens,cost_usd:a.cost_usd??0,kind:"week_digest",ref:e});let p=[];for(let s of c)s&&(p.push(s.topSession),s.usage&&tH({ts:new Date().toISOString(),caller:t.caller??"web",model:t.settings.model,input_tokens:s.usage.input_tokens,output_tokens:s.usage.output_tokens,cost_usd:tU(t.settings.model,s.usage.input_tokens,s.usage.output_tokens),kind:"top_session",ref:`${e}/${s.entry.session_id}`}));a.headline&&p.length>0&&(a.top_sessions=p)}else a=sx(e,l,{entriesByDay:d});n?(a.is_live=!0,(0,sr.setCurrentWeekDigestInCache)(e,a,s())):((0,sr.writeWeekDigest)(a),yield{type:"saved",path:`~/.cclens/digests/week/${e}.json`}),yield{type:"digest",digest:a}}finally{r&&tQ()}}async function*sK(e,t){let s=t.now??(()=>Date.now()),n=e===t.currentYearMonth,r=t.settings.enabled;if(!n&&!t.force){let t=(0,sr.readMonthDigest)(e);if(t)return void(yield{type:"digest",digest:t})}if(n&&!t.force){let t=(0,sr.getCurrentMonthDigestFromCache)(e,s());if(t)return void(yield{type:"digest",digest:t})}yield{type:"status",phase:"load_dependencies",text:`Loading weeks for ${e}`};let a=sZ(e),i=[];for(let e of a){if(e>t.currentWeekMonday){yield{type:"dependency",kind:"week",key:e,status:"cached"};continue}let s=e===t.currentWeekMonday,n=s?null:(0,sr.readWeekDigest)(e);if(n){i.push(n),yield{type:"dependency",kind:"week",key:e,status:"cached"};continue}if(s){let s={settings:t.settings,force:!1,callLLM:t.callLLM,now:t.now,currentWeekMonday:t.currentWeekMonday,todayLocalDay:t.todayLocalDay,caller:t.caller},n=null,r=!1;for await(let t of sq(e,s))if("digest"===t.type&&"week"===t.digest.scope&&(n=t.digest),"error"===t.type){r=!0;break}n?(i.push(n),yield{type:"dependency",kind:"week",key:e,status:"cached"}):r&&(yield{type:"dependency",kind:"week",key:e,status:"failed"});continue}let r={settings:t.settings,force:!1,callLLM:t.callLLM,now:t.now,currentWeekMonday:t.currentWeekMonday,todayLocalDay:t.todayLocalDay,caller:t.caller},a=null,o=!1;for await(let t of sq(e,r)){if("digest"===t.type){"week"===t.digest.scope&&(a=t.digest);continue}if("saved"!==t.type){if("error"===t.type){o=!0;continue}yield t}}a?(i.push(a),yield{type:"dependency",kind:"week",key:e,status:"generated"}):o&&(yield{type:"dependency",kind:"week",key:e,status:"failed"})}if(0===i.length)return void(yield{type:"error",message:`no week digests available for ${e}`});r&&tX();try{let a;if(r){yield{type:"status",phase:"synth",text:"Synthesizing month narrative"};let s=[],n=sI(e,i,{model:t.settings.model,callLLM:t.callLLM,onProgress:e=>{s.push({bytes:e.bytes,elapsed_ms:e.elapsedMs})}}),r=!1;for(n.finally(()=>{r=!0});!r;)if(await new Promise(e=>setTimeout(e,500)),s.length>0){let e=s[s.length-1];yield{type:"progress",phase:"synth",bytes:e.bytes,elapsed_ms:e.elapsed_ms},s.length=0}let o=await n;a=o.digest,o.usage&&tH({ts:new Date().toISOString(),caller:t.caller??"web",model:a.model??t.settings.model,input_tokens:o.usage.input_tokens,output_tokens:o.usage.output_tokens,cost_usd:a.cost_usd??0,kind:"month_digest",ref:e})}else a=sP(e,i);n?(a.is_live=!0,(0,sr.setCurrentMonthDigestInCache)(e,a,s())):((0,sr.writeMonthDigest)(a),yield{type:"saved",path:`~/.cclens/digests/month/${e}.json`}),yield{type:"digest",digest:a}}finally{r&&tQ()}}e.s(["mondayFor",0,function(e){let t=new Date(`${e}T00:00:00`),s=t.getDay();t.setDate(t.getDate()+(0===s?-6:1-s));let n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${n}-${r}-${a}`},"runWeekDigestPipeline",0,sq],77242),e.s(["runMonthDigestPipeline",0,sK],21628),e.s([],82111)}];
378
+
379
+ //# sourceMappingURL=packages_entries_dist_node_0bckr7-.js.map