fleetlens 0.16.3 → 0.16.6

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 (215) hide show
  1. package/app/apps/web/.next/BUILD_ID +1 -1
  2. package/app/apps/web/.next/app-path-routes-manifest.json +1 -0
  3. package/app/apps/web/.next/build-manifest.json +3 -3
  4. package/app/apps/web/.next/prerender-manifest.json +32 -3
  5. package/app/apps/web/.next/routes-manifest.json +6 -0
  6. package/app/apps/web/.next/server/app/_global-error/page.js +2 -2
  7. package/app/apps/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/app/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/app/apps/web/.next/server/app/_global-error.html +1 -1
  10. package/app/apps/web/.next/server/app/_global-error.rsc +7 -7
  11. package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  12. package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  13. package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  14. package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  15. package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/app/apps/web/.next/server/app/_not-found/page.js +10 -9
  17. package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/app/apps/web/.next/server/app/agent/page.js +10 -9
  20. package/app/apps/web/.next/server/app/agent/page.js.nft.json +1 -1
  21. package/app/apps/web/.next/server/app/agent/page_client-reference-manifest.js +1 -1
  22. package/app/apps/web/.next/server/app/api/agent/chats/[id]/messages/route.js.nft.json +1 -1
  23. package/app/apps/web/.next/server/app/api/agent/index/route.js.nft.json +1 -1
  24. package/app/apps/web/.next/server/app/api/agent/mcp/route.js.nft.json +1 -1
  25. package/app/apps/web/.next/server/app/api/agent/suggestions/route.js.nft.json +1 -1
  26. package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
  27. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
  28. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
  29. package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
  30. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
  31. package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
  32. package/app/apps/web/.next/server/app/api/pdf/[key]/route.js.nft.json +1 -1
  33. package/app/apps/web/.next/server/app/api/projects/open-folder/route.js.nft.json +1 -1
  34. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  35. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
  36. package/app/apps/web/.next/server/app/api/settings/credentials/route.js.nft.json +1 -1
  37. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
  38. package/app/apps/web/.next/server/app/changelog/page.js +10 -9
  39. package/app/apps/web/.next/server/app/changelog/page.js.nft.json +1 -1
  40. package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
  41. package/app/apps/web/.next/server/app/day/[date]/page.js +10 -9
  42. package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
  43. package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
  44. package/app/apps/web/.next/server/app/day/page.js +10 -9
  45. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
  46. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
  47. package/app/apps/web/.next/server/app/digest/[date]/page.js +10 -9
  48. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
  49. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
  50. package/app/apps/web/.next/server/app/digest/page.js +10 -9
  51. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
  52. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  53. package/app/apps/web/.next/server/app/icon.svg/route/app-paths-manifest.json +3 -0
  54. package/app/apps/web/.next/server/app/icon.svg/route/build-manifest.json +9 -0
  55. package/app/apps/web/.next/server/app/icon.svg/route.js +7 -0
  56. package/app/apps/web/.next/server/app/icon.svg/route.js.map +5 -0
  57. package/app/apps/web/.next/server/app/icon.svg/route.js.nft.json +1 -0
  58. package/app/apps/web/.next/server/app/icon.svg.body +7 -0
  59. package/app/apps/web/.next/server/app/icon.svg.meta +1 -0
  60. package/app/apps/web/.next/server/app/insights/[key]/page.js +10 -9
  61. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  62. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  63. package/app/apps/web/.next/server/app/insights/page.js +10 -9
  64. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  65. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  66. package/app/apps/web/.next/server/app/page.js +10 -9
  67. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  68. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  69. package/app/apps/web/.next/server/app/parallelism/page.js +10 -9
  70. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  71. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  72. package/app/apps/web/.next/server/app/print/[key]/page.js +10 -9
  73. package/app/apps/web/.next/server/app/print/[key]/page.js.nft.json +1 -1
  74. package/app/apps/web/.next/server/app/print/[key]/page_client-reference-manifest.js +1 -1
  75. package/app/apps/web/.next/server/app/projects/[slug]/page.js +10 -9
  76. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  77. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  78. package/app/apps/web/.next/server/app/projects/page.js +10 -9
  79. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  80. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  81. package/app/apps/web/.next/server/app/runs/page.js +10 -9
  82. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
  83. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  84. package/app/apps/web/.next/server/app/sessions/[id]/page.js +10 -9
  85. package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  86. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  87. package/app/apps/web/.next/server/app/sessions/page.js +10 -9
  88. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  89. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  90. package/app/apps/web/.next/server/app/settings/page.js +10 -9
  91. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  92. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  93. package/app/apps/web/.next/server/app/team/onboarding/page.js +10 -9
  94. package/app/apps/web/.next/server/app/team/onboarding/page.js.nft.json +1 -1
  95. package/app/apps/web/.next/server/app/team/onboarding/page_client-reference-manifest.js +1 -1
  96. package/app/apps/web/.next/server/app/team/page.js +10 -9
  97. package/app/apps/web/.next/server/app/team/page.js.nft.json +1 -1
  98. package/app/apps/web/.next/server/app/team/page_client-reference-manifest.js +1 -1
  99. package/app/apps/web/.next/server/app/usage/page.js +10 -9
  100. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  101. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  102. package/app/apps/web/.next/server/app-paths-manifest.json +1 -0
  103. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0o.75vf._.js +3 -0
  104. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_icon_svg_route_actions_09mu110.js +3 -0
  105. package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0sr4wr_.js +1 -1
  106. package/app/apps/web/.next/server/chunks/packages_parser_dist_06d9se1._.js +1 -1
  107. package/app/apps/web/.next/server/chunks/packages_parser_dist_10ihc3~._.js +1 -1
  108. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-zxvif._.js +3 -0
  109. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01etyrg._.js +3 -0
  110. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01wj6p0._.js +3 -0
  111. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0lz4a~g._.js → [root-of-the-server]__021z658._.js} +2 -2
  112. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__07e35nb._.js +3 -0
  113. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__11xp-1u._.js → [root-of-the-server]__0a-_-_a._.js} +2 -2
  114. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0xy1qim._.js → [root-of-the-server]__0b6a93u._.js} +2 -2
  115. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0o1_g.~._.js → [root-of-the-server]__0fosdzf._.js} +2 -2
  116. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__04qodwp._.js → [root-of-the-server]__0h~6fzv._.js} +2 -2
  117. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ix~bkq._.js +3 -0
  118. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0j3r6mu._.js +3 -0
  119. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__10srpu0._.js → [root-of-the-server]__0m3g~yv._.js} +2 -2
  120. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__07~kk2~._.js → [root-of-the-server]__0n3n~yr._.js} +2 -2
  121. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0kml6jt._.js → [root-of-the-server]__0omu7re._.js} +2 -2
  122. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0.zquoa._.js → [root-of-the-server]__0ovph2e._.js} +2 -2
  123. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0ar_8wr._.js → [root-of-the-server]__0tz4w46._.js} +3 -3
  124. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0u0n8z~._.js +3 -0
  125. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0ufi3.w._.js → [root-of-the-server]__0wraeyz._.js} +2 -2
  126. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0u39afl._.js → [root-of-the-server]__0wy2-yx._.js} +2 -2
  127. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0blm9gz._.js → [root-of-the-server]__0ygwqfa._.js} +2 -2
  128. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0lmftab._.js → [root-of-the-server]__0z0wa91._.js} +2 -2
  129. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~.gwld._.js +3 -0
  130. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0.wm54e._.js → [root-of-the-server]__12mxxlm._.js} +2 -2
  131. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0tejjy_._.js → [root-of-the-server]__12s3gv9._.js} +2 -2
  132. package/app/apps/web/.next/server/chunks/ssr/_0k8yioi._.js +1 -1
  133. package/app/apps/web/.next/server/chunks/ssr/_0sz8~hl._.js +3 -0
  134. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0x014hn._.js +1 -1
  135. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
  136. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
  137. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_06u0kr8._.js +3 -0
  138. package/app/apps/web/.next/server/chunks/ssr/{node_modules_next_dist_06c_2qf._.js → node_modules_next_dist_0ve2ws3._.js} +2 -2
  139. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_00g~mhv.js +4 -0
  140. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_01.bezr.js +4 -0
  141. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0289ttk.js +4 -0
  142. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02eo3j_.js +4 -0
  143. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03vhmnm.js +4 -0
  144. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_07_oby5.js +4 -0
  145. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0bm6hj~.js +4 -0
  146. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0dd8f-e.js +4 -0
  147. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0e-9-6e.js +4 -0
  148. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hvl-ct.js +4 -0
  149. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0i1kx1j.js +4 -0
  150. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0j8zf-y.js +4 -0
  151. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0kpe55j.js +4 -0
  152. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0q1syx3.js +4 -0
  153. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0q4~c_f.js +4 -0
  154. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0w_~1n4.js +4 -0
  155. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0wcoddw.js +4 -0
  156. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0wil2ok.js +4 -0
  157. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0z65c3i.js +4 -0
  158. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0zaz56w.js +4 -0
  159. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0~onns0.js +4 -0
  160. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0mx_509._.js +1 -1
  161. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  162. package/app/apps/web/.next/server/middleware-manifest.json +5 -5
  163. package/app/apps/web/.next/server/pages/500.html +1 -1
  164. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  165. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  166. package/app/apps/web/.next/static/chunks/{0389wb_f0j78j.js → 0n1d620va1z.z.js} +1 -1
  167. package/app/apps/web/.next/static/chunks/1350ox0.qybjo.js +14 -0
  168. package/app/apps/web/.next/static/chunks/16gca31.pi4.o.css +1 -0
  169. package/app/apps/web/.next/static/media/icon.0h9o_.fpzdvkq.svg +7 -0
  170. package/app/apps/web/app/globals.css +19 -9
  171. package/app/apps/web/app/icon.svg +7 -0
  172. package/app/apps/web/components/sidebar.tsx +5 -11
  173. package/app/apps/web/lib/changelog-data.generated.ts +1 -1
  174. package/app/apps/web/package.json +1 -1
  175. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  176. package/dist/daemon-worker.js +392 -111
  177. package/dist/index.js +442 -155
  178. package/menubar/FleetlensMenubar.app/Contents/Info.plist +2 -2
  179. package/menubar/FleetlensMenubar.app/Contents/MacOS/FleetlensMenubar +0 -0
  180. package/package.json +1 -1
  181. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04eq6z2._.js +0 -3
  182. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__09rjz7_._.js +0 -3
  183. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_78i1t._.js +0 -3
  184. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0d5y90m._.js +0 -3
  185. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0i.q-1h._.js +0 -3
  186. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0j683am._.js +0 -3
  187. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0p1x6v2._.js +0 -3
  188. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0stu~~r._.js +0 -3
  189. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_0k0tl52._.js +0 -3
  190. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02rcy0h.js +0 -4
  191. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0602nef.js +0 -4
  192. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_07orc4m.js +0 -4
  193. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09aewh9.js +0 -4
  194. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09rx8oz.js +0 -4
  195. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d3d4wn.js +0 -4
  196. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0edz1ko.js +0 -4
  197. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0eq.n-n.js +0 -4
  198. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hcvt-s.js +0 -4
  199. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hshwu7.js +0 -4
  200. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hwycdb.js +0 -4
  201. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0jxvcfi.js +0 -4
  202. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nd5zu0.js +0 -4
  203. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0s5yhs4.js +0 -4
  204. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0uwo3v3.js +0 -4
  205. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0~g07z5.js +0 -4
  206. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_10cdrh2.js +0 -4
  207. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_10op6u-.js +0 -4
  208. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11j1qy0.js +0 -4
  209. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12n1lw_.js +0 -4
  210. package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12r67~s.js +0 -4
  211. package/app/apps/web/.next/static/chunks/0d~7p_ye7v7_5.css +0 -1
  212. package/app/apps/web/.next/static/chunks/0pt-1~k9ei92l.js +0 -14
  213. /package/app/apps/web/.next/static/{DoQvoHgeMQRMU3tniT_DK → 8slBxbEObd72azKwDvtmy}/_buildManifest.js +0 -0
  214. /package/app/apps/web/.next/static/{DoQvoHgeMQRMU3tniT_DK → 8slBxbEObd72azKwDvtmy}/_clientMiddlewareManifest.js +0 -0
  215. /package/app/apps/web/.next/static/{DoQvoHgeMQRMU3tniT_DK → 8slBxbEObd72azKwDvtmy}/_ssgManifest.js +0 -0
@@ -1525,11 +1525,11 @@ function defaultBranch(commonDir) {
1525
1525
  }
1526
1526
  return void 0;
1527
1527
  }
1528
- function readGitFolder(path9) {
1529
- if (!existsSync(path9))
1528
+ function readGitFolder(path10) {
1529
+ if (!existsSync(path10))
1530
1530
  return { exists: false, isWorktree: false };
1531
1531
  try {
1532
- const git = nearestDotGit(realpathOrSelf(path9));
1532
+ const git = nearestDotGit(realpathOrSelf(path10));
1533
1533
  if (!git)
1534
1534
  return { exists: true, isWorktree: false };
1535
1535
  const projectRoot = projectRootFromCommonDir(git.commonDir);
@@ -5644,18 +5644,6 @@ var init_fs = __esm({
5644
5644
  },
5645
5645
  async getSession(id) {
5646
5646
  return getCodexSession(id);
5647
- },
5648
- async usagePoller() {
5649
- const w = await getLatestCodexUsage();
5650
- if (!w)
5651
- return null;
5652
- return {
5653
- captured_at: (/* @__PURE__ */ new Date()).toISOString(),
5654
- agent: "codex",
5655
- five_hour: w.five_hour,
5656
- seven_day: w.seven_day,
5657
- plan_type: w.plan_type
5658
- };
5659
5647
  }
5660
5648
  };
5661
5649
  geminiSource = {
@@ -5711,15 +5699,15 @@ var init_fs = __esm({
5711
5699
  });
5712
5700
 
5713
5701
  // src/usage/storage.ts
5714
- import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync7, writeFileSync as writeFileSync3, existsSync as existsSync5 } from "node:fs";
5702
+ import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync8, writeFileSync as writeFileSync4, existsSync as existsSync6 } from "node:fs";
5715
5703
  import { dirname as dirname2 } from "node:path";
5716
5704
  function appendSnapshot(filePath, snapshot) {
5717
5705
  mkdirSync3(dirname2(filePath), { recursive: true });
5718
5706
  appendFileSync2(filePath, JSON.stringify(snapshot) + "\n", "utf8");
5719
5707
  }
5720
5708
  function readSnapshots(filePath) {
5721
- if (!existsSync5(filePath)) return [];
5722
- const content = readFileSync7(filePath, "utf8");
5709
+ if (!existsSync6(filePath)) return [];
5710
+ const content = readFileSync8(filePath, "utf8");
5723
5711
  const snapshots = [];
5724
5712
  for (const line of content.split("\n")) {
5725
5713
  if (!line.trim()) continue;
@@ -5731,8 +5719,8 @@ function readSnapshots(filePath) {
5731
5719
  return snapshots;
5732
5720
  }
5733
5721
  function pruneAgent(filePath, agent) {
5734
- if (!existsSync5(filePath)) return;
5735
- const kept = readFileSync7(filePath, "utf8").split("\n").filter((line) => {
5722
+ if (!existsSync6(filePath)) return;
5723
+ const kept = readFileSync8(filePath, "utf8").split("\n").filter((line) => {
5736
5724
  if (!line.trim()) return false;
5737
5725
  try {
5738
5726
  return JSON.parse(line).agent !== agent;
@@ -5741,7 +5729,7 @@ function pruneAgent(filePath, agent) {
5741
5729
  }
5742
5730
  });
5743
5731
  mkdirSync3(dirname2(filePath), { recursive: true });
5744
- writeFileSync3(filePath, kept.join("\n") + (kept.length ? "\n" : ""), "utf8");
5732
+ writeFileSync4(filePath, kept.join("\n") + (kept.length ? "\n" : ""), "utf8");
5745
5733
  }
5746
5734
  function latestClaudeCodeSnapshot(filePath) {
5747
5735
  const all = readSnapshots(filePath);
@@ -6244,7 +6232,7 @@ __export(file_probe_exports, {
6244
6232
  probeArtifactSignals: () => probeArtifactSignals
6245
6233
  });
6246
6234
  import { createHash } from "node:crypto";
6247
- import { existsSync as existsSync10, readdirSync as readdirSync3, statSync as statSync5 } from "node:fs";
6235
+ import { existsSync as existsSync11, readdirSync as readdirSync3, statSync as statSync5 } from "node:fs";
6248
6236
  import { homedir as homedir3 } from "node:os";
6249
6237
  import { join as join8, relative, resolve as resolve3, sep } from "node:path";
6250
6238
  import { execFileSync as execFileSync2 } from "node:child_process";
@@ -6254,15 +6242,15 @@ function pathHash(relPath) {
6254
6242
  function defaultScanRoots(extraRoots = []) {
6255
6243
  const roots = [];
6256
6244
  const home = join8(homedir3(), ".claude");
6257
- if (existsSync10(home)) roots.push({ root: home, label: "user" });
6245
+ if (existsSync11(home)) roots.push({ root: home, label: "user" });
6258
6246
  for (const e of extraRoots) {
6259
6247
  const r = resolve3(e, ".claude");
6260
- if (existsSync10(r) && r !== home) roots.push({ root: r, label: "project" });
6248
+ if (existsSync11(r) && r !== home) roots.push({ root: r, label: "project" });
6261
6249
  }
6262
6250
  return roots;
6263
6251
  }
6264
6252
  function listMarkdownFiles(dir) {
6265
- if (!existsSync10(dir)) return [];
6253
+ if (!existsSync11(dir)) return [];
6266
6254
  const out = [];
6267
6255
  let entries;
6268
6256
  try {
@@ -6332,7 +6320,7 @@ function scanAuthored(roots, subdir, day) {
6332
6320
  const out = [];
6333
6321
  for (const r of roots) {
6334
6322
  const dir = join8(r.root, subdir);
6335
- if (!existsSync10(dir)) continue;
6323
+ if (!existsSync11(dir)) continue;
6336
6324
  for (const f of listMarkdownFiles(dir)) {
6337
6325
  const firstSeen = firstSeenDateOf(f);
6338
6326
  if (firstSeen !== day) continue;
@@ -6346,7 +6334,7 @@ function scanEdited(roots, day) {
6346
6334
  const out = [];
6347
6335
  for (const r of roots) {
6348
6336
  const dir = join8(r.root, "skills");
6349
- if (!existsSync10(dir)) continue;
6337
+ if (!existsSync11(dir)) continue;
6350
6338
  for (const f of listMarkdownFiles(dir)) {
6351
6339
  const firstSeen = firstSeenDateOf(f);
6352
6340
  if (firstSeen === day) continue;
@@ -6369,10 +6357,10 @@ function claudemdLineDelta(extraRoots, authorEmail, day) {
6369
6357
  const candidates = [];
6370
6358
  for (const e of extraRoots) {
6371
6359
  const f = resolve3(e, "CLAUDE.md");
6372
- if (existsSync10(f)) candidates.push(f);
6360
+ if (existsSync11(f)) candidates.push(f);
6373
6361
  }
6374
6362
  const homeClaudeMd = join8(homedir3(), "CLAUDE.md");
6375
- if (existsSync10(homeClaudeMd)) candidates.push(homeClaudeMd);
6363
+ if (existsSync11(homeClaudeMd)) candidates.push(homeClaudeMd);
6376
6364
  for (const file of candidates) {
6377
6365
  try {
6378
6366
  const out = execFileSync2(
@@ -6429,7 +6417,7 @@ var init_file_probe = __esm({
6429
6417
 
6430
6418
  // src/daemon-worker.ts
6431
6419
  import { spawn as spawn2 } from "node:child_process";
6432
- import { closeSync, existsSync as existsSync17, mkdirSync as mkdirSync14, openSync, readFileSync as readFileSync20, writeFileSync as writeFileSync14 } from "node:fs";
6420
+ import { closeSync, existsSync as existsSync18, mkdirSync as mkdirSync14, openSync, readFileSync as readFileSync21, writeFileSync as writeFileSync15 } from "node:fs";
6433
6421
  import { dirname as dirname11, join as join12 } from "node:path";
6434
6422
  import { fileURLToPath } from "node:url";
6435
6423
 
@@ -6461,9 +6449,9 @@ function readFromCredentialsFile() {
6461
6449
  join(homedir(), ".claude", ".credentials.json"),
6462
6450
  join(homedir(), ".config", "claude", "credentials.json")
6463
6451
  ];
6464
- for (const path9 of candidates) {
6452
+ for (const path10 of candidates) {
6465
6453
  try {
6466
- const blob = readFileSync(path9, "utf8");
6454
+ const blob = readFileSync(path10, "utf8");
6467
6455
  const creds = extractCredentials(blob);
6468
6456
  if (creds) return creds;
6469
6457
  } catch {
@@ -6759,8 +6747,8 @@ async function refreshAccessToken(entry) {
6759
6747
  break;
6760
6748
  }
6761
6749
  }
6762
- const { writeFileSync: writeFileSync15 } = await import("node:fs");
6763
- writeFileSync15(p, JSON.stringify(raw, null, 2), "utf8");
6750
+ const { writeFileSync: writeFileSync16 } = await import("node:fs");
6751
+ writeFileSync16(p, JSON.stringify(raw, null, 2), "utf8");
6764
6752
  } catch {
6765
6753
  }
6766
6754
  return j.access_token;
@@ -6887,6 +6875,286 @@ async function fetchGrokUsage() {
6887
6875
  };
6888
6876
  }
6889
6877
 
6878
+ // src/usage/codex.ts
6879
+ import {
6880
+ existsSync as existsSync5,
6881
+ readFileSync as readFileSync7,
6882
+ writeFileSync as writeFileSync3
6883
+ } from "node:fs";
6884
+ import os9 from "node:os";
6885
+ import path9 from "node:path";
6886
+ var USAGE_URL = "https://chatgpt.com/backend-api/wham/usage";
6887
+ var REFRESH_URL2 = "https://auth.openai.com/oauth/token";
6888
+ var CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
6889
+ var FIVE_HOUR_SECONDS = 5 * 60 * 60;
6890
+ var SEVEN_DAY_SECONDS = 7 * 24 * 60 * 60;
6891
+ var REFRESH_BUFFER_MS2 = 5 * 60 * 1e3;
6892
+ var CodexApiError = class extends Error {
6893
+ constructor(message, code) {
6894
+ super(message);
6895
+ this.code = code;
6896
+ }
6897
+ };
6898
+ function codexHome() {
6899
+ const env = process.env.CODEX_HOME?.trim();
6900
+ if (env) return env;
6901
+ return path9.join(os9.homedir(), ".codex");
6902
+ }
6903
+ function authPath2() {
6904
+ return path9.join(codexHome(), "auth.json");
6905
+ }
6906
+ function loadAuth() {
6907
+ const p = authPath2();
6908
+ if (!existsSync5(p)) {
6909
+ throw new CodexApiError(
6910
+ "Codex not logged in. Run `codex` to authenticate.",
6911
+ "no_auth"
6912
+ );
6913
+ }
6914
+ let auth;
6915
+ try {
6916
+ auth = JSON.parse(readFileSync7(p, "utf8"));
6917
+ } catch {
6918
+ throw new CodexApiError(
6919
+ "Codex auth.json is unreadable. Run `codex` to log in again.",
6920
+ "no_auth"
6921
+ );
6922
+ }
6923
+ const access = auth.tokens?.access_token?.trim();
6924
+ if (!access) {
6925
+ if (auth.OPENAI_API_KEY?.trim()) {
6926
+ throw new CodexApiError(
6927
+ "Codex usage is not available for API-key-only auth. Sign in with a ChatGPT account via `codex`.",
6928
+ "api_key_only"
6929
+ );
6930
+ }
6931
+ throw new CodexApiError(
6932
+ "Codex auth has no access token. Run `codex` to log in.",
6933
+ "no_auth"
6934
+ );
6935
+ }
6936
+ return { auth, path: p };
6937
+ }
6938
+ function accessTokenExpiresAtMs(token) {
6939
+ const parts = token.split(".");
6940
+ if (parts.length < 2) return null;
6941
+ try {
6942
+ const pad = "=".repeat((4 - parts[1].length % 4) % 4);
6943
+ const json = Buffer.from(parts[1] + pad, "base64url").toString("utf8");
6944
+ const payload = JSON.parse(json);
6945
+ if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp)) {
6946
+ return null;
6947
+ }
6948
+ return payload.exp * 1e3;
6949
+ } catch {
6950
+ return null;
6951
+ }
6952
+ }
6953
+ function needsRefresh2(accessToken, lastRefresh, nowMs = Date.now()) {
6954
+ const expMs = accessTokenExpiresAtMs(accessToken);
6955
+ if (expMs !== null) {
6956
+ return nowMs >= expMs - REFRESH_BUFFER_MS2;
6957
+ }
6958
+ if (!lastRefresh) return false;
6959
+ const ms = Date.parse(lastRefresh);
6960
+ if (!Number.isFinite(ms)) return false;
6961
+ return nowMs - ms > 8 * 24 * 60 * 60 * 1e3;
6962
+ }
6963
+ async function refreshAccessToken2(auth, filePath) {
6964
+ const refresh = auth.tokens?.refresh_token?.trim();
6965
+ if (!refresh) return null;
6966
+ const body = new URLSearchParams({
6967
+ grant_type: "refresh_token",
6968
+ client_id: CLIENT_ID,
6969
+ refresh_token: refresh
6970
+ });
6971
+ let res;
6972
+ try {
6973
+ res = await fetch(REFRESH_URL2, {
6974
+ method: "POST",
6975
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
6976
+ body: body.toString()
6977
+ });
6978
+ } catch {
6979
+ return null;
6980
+ }
6981
+ if (!res.ok) return null;
6982
+ try {
6983
+ const j = await res.json();
6984
+ if (typeof j.access_token !== "string" || !j.access_token) return null;
6985
+ const next = {
6986
+ ...auth,
6987
+ tokens: {
6988
+ ...auth.tokens,
6989
+ access_token: j.access_token,
6990
+ refresh_token: j.refresh_token ?? auth.tokens?.refresh_token,
6991
+ id_token: j.id_token ?? auth.tokens?.id_token
6992
+ },
6993
+ last_refresh: (/* @__PURE__ */ new Date()).toISOString()
6994
+ };
6995
+ try {
6996
+ writeFileSync3(filePath, `${JSON.stringify(next, null, 2)}
6997
+ `, {
6998
+ encoding: "utf8",
6999
+ mode: 384
7000
+ });
7001
+ } catch {
7002
+ }
7003
+ return { accessToken: j.access_token, auth: next };
7004
+ } catch {
7005
+ return null;
7006
+ }
7007
+ }
7008
+ function authHeaders2(accessToken, accountId) {
7009
+ const headers = {
7010
+ Authorization: `Bearer ${accessToken}`,
7011
+ Accept: "application/json",
7012
+ "User-Agent": "fleetlens"
7013
+ };
7014
+ if (accountId?.trim()) {
7015
+ headers["ChatGPT-Account-Id"] = accountId.trim();
7016
+ }
7017
+ return headers;
7018
+ }
7019
+ function numberOf2(v) {
7020
+ if (typeof v === "number" && Number.isFinite(v)) return v;
7021
+ if (typeof v === "string" && v.trim()) {
7022
+ const n = Number(v);
7023
+ if (Number.isFinite(n)) return n;
7024
+ }
7025
+ return void 0;
7026
+ }
7027
+ function windowSeconds(raw) {
7028
+ if (!raw) return void 0;
7029
+ const sec = numberOf2(raw.limit_window_seconds);
7030
+ if (sec !== void 0) return sec;
7031
+ const minutes = numberOf2(raw.window_minutes);
7032
+ if (minutes !== void 0) return minutes * 60;
7033
+ return void 0;
7034
+ }
7035
+ function normalizeWindow2(raw, headerPercent, nowMs) {
7036
+ const used = numberOf2(raw?.used_percent) ?? headerPercent;
7037
+ if (used === void 0) return null;
7038
+ let resetsAt = null;
7039
+ const resetUnix = numberOf2(raw?.reset_at) ?? numberOf2(raw?.resets_at);
7040
+ if (resetUnix !== void 0) {
7041
+ resetsAt = new Date(resetUnix * 1e3).toISOString();
7042
+ } else {
7043
+ const after = numberOf2(raw?.reset_after_seconds);
7044
+ if (after !== void 0) {
7045
+ resetsAt = new Date(nowMs + after * 1e3).toISOString();
7046
+ }
7047
+ }
7048
+ return {
7049
+ utilization: Math.min(100, Math.max(0, used)),
7050
+ resets_at: resetsAt
7051
+ };
7052
+ }
7053
+ function parseCodexWhamUsage(body, headers = {}, nowMs = Date.now()) {
7054
+ if (!body || typeof body !== "object") {
7055
+ throw new CodexApiError("Codex usage response missing body", "parse");
7056
+ }
7057
+ const b = body;
7058
+ const rateLimit = b.rate_limit && typeof b.rate_limit === "object" ? b.rate_limit : {};
7059
+ const headerPrimary = numberOf2(headers["x-codex-primary-used-percent"]);
7060
+ const headerSecondary = numberOf2(headers["x-codex-secondary-used-percent"]);
7061
+ const primary = rateLimit.primary_window && typeof rateLimit.primary_window === "object" ? rateLimit.primary_window : null;
7062
+ const secondary = rateLimit.secondary_window && typeof rateLimit.secondary_window === "object" ? rateLimit.secondary_window : null;
7063
+ const candidates = [
7064
+ { raw: primary, headerPercent: headerPrimary, fallback: "five_hour" },
7065
+ { raw: secondary, headerPercent: headerSecondary, fallback: "seven_day" }
7066
+ ];
7067
+ let fiveHour = null;
7068
+ let sevenDay = null;
7069
+ for (const c of candidates) {
7070
+ const secs = windowSeconds(c.raw);
7071
+ const window = normalizeWindow2(c.raw, c.headerPercent, nowMs);
7072
+ if (!window) continue;
7073
+ if (secs === FIVE_HOUR_SECONDS) fiveHour = window;
7074
+ else if (secs === SEVEN_DAY_SECONDS) sevenDay = window;
7075
+ }
7076
+ if (!fiveHour || !sevenDay) {
7077
+ for (const c of candidates) {
7078
+ const secs = windowSeconds(c.raw);
7079
+ if (secs === FIVE_HOUR_SECONDS || secs === SEVEN_DAY_SECONDS) continue;
7080
+ const window = normalizeWindow2(c.raw, c.headerPercent, nowMs);
7081
+ if (!window) continue;
7082
+ if (c.fallback === "five_hour" && !fiveHour) fiveHour = window;
7083
+ else if (c.fallback === "seven_day" && !sevenDay) sevenDay = window;
7084
+ }
7085
+ }
7086
+ const planRaw = b.plan_type;
7087
+ const planType = typeof planRaw === "string" && planRaw.trim() ? planRaw.trim() : null;
7088
+ return {
7089
+ five_hour: fiveHour ?? { utilization: null, resets_at: null },
7090
+ seven_day: sevenDay ?? { utilization: null, resets_at: null },
7091
+ plan_type: planType
7092
+ };
7093
+ }
7094
+ async function fetchUsageResponse(accessToken, accountId) {
7095
+ let res;
7096
+ try {
7097
+ res = await fetch(USAGE_URL, {
7098
+ headers: authHeaders2(accessToken, accountId)
7099
+ });
7100
+ } catch (err) {
7101
+ throw new CodexApiError(
7102
+ `Network error reaching Codex usage: ${err.message}`,
7103
+ "network"
7104
+ );
7105
+ }
7106
+ const headers = {};
7107
+ res.headers.forEach((value, key) => {
7108
+ headers[key.toLowerCase()] = value;
7109
+ });
7110
+ let body = null;
7111
+ try {
7112
+ body = await res.json();
7113
+ } catch {
7114
+ }
7115
+ return { status: res.status, body, headers };
7116
+ }
7117
+ async function fetchCodexUsage() {
7118
+ const loaded = loadAuth();
7119
+ let auth = loaded.auth;
7120
+ let access = auth.tokens.access_token.trim();
7121
+ const accountId = auth.tokens?.account_id;
7122
+ if (needsRefresh2(access, auth.last_refresh)) {
7123
+ const refreshed = await refreshAccessToken2(auth, loaded.path);
7124
+ if (refreshed) {
7125
+ access = refreshed.accessToken;
7126
+ auth = refreshed.auth;
7127
+ }
7128
+ }
7129
+ let { status, body, headers } = await fetchUsageResponse(access, accountId);
7130
+ if (status === 401 || status === 403) {
7131
+ const refreshed = await refreshAccessToken2(auth, loaded.path);
7132
+ if (refreshed) {
7133
+ access = refreshed.accessToken;
7134
+ ({ status, body, headers } = await fetchUsageResponse(access, accountId));
7135
+ }
7136
+ }
7137
+ if (status < 200 || status >= 300) {
7138
+ throw new CodexApiError(
7139
+ `Codex usage returned HTTP ${status}`,
7140
+ status === 401 || status === 403 ? "no_auth" : "http"
7141
+ );
7142
+ }
7143
+ const windows = parseCodexWhamUsage(body, headers);
7144
+ return {
7145
+ captured_at: (/* @__PURE__ */ new Date()).toISOString(),
7146
+ agent: "codex",
7147
+ five_hour: windows.five_hour,
7148
+ seven_day: windows.seven_day,
7149
+ seven_day_opus: null,
7150
+ seven_day_sonnet: null,
7151
+ seven_day_oauth_apps: null,
7152
+ seven_day_cowork: null,
7153
+ extra_usage: null,
7154
+ plan_type: windows.plan_type
7155
+ };
7156
+ }
7157
+
6890
7158
  // src/daemon-worker.ts
6891
7159
  init_storage();
6892
7160
  init_fs();
@@ -6928,7 +7196,7 @@ import { randomUUID } from "node:crypto";
6928
7196
 
6929
7197
  // ../entries/dist/fs.js
6930
7198
  init_fs();
6931
- import { readFileSync as readFileSync9, readdirSync as readdirSync2, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, renameSync as renameSync3, existsSync as existsSync7 } from "node:fs";
7199
+ import { readFileSync as readFileSync10, readdirSync as readdirSync2, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, renameSync as renameSync3, existsSync as existsSync8 } from "node:fs";
6932
7200
  import { randomBytes } from "node:crypto";
6933
7201
  import { join as join5 } from "node:path";
6934
7202
 
@@ -7003,12 +7271,12 @@ var PROMPT_FRAME_ORIGIN = {
7003
7271
 
7004
7272
  // ../entries/dist/digest-fs.js
7005
7273
  init_fs();
7006
- import { readFileSync as readFileSync8, readdirSync, writeFileSync as writeFileSync4, renameSync as renameSync2, chmodSync, mkdirSync as mkdirSync4, existsSync as existsSync6 } from "node:fs";
7274
+ import { readFileSync as readFileSync9, readdirSync, writeFileSync as writeFileSync5, renameSync as renameSync2, chmodSync, mkdirSync as mkdirSync4, existsSync as existsSync7 } from "node:fs";
7007
7275
  import { dirname as dirname3, join as join4 } from "node:path";
7008
7276
  var digestsDirCached = null;
7009
- function parseDigestFile(path9, expectedVersion) {
7277
+ function parseDigestFile(path10, expectedVersion) {
7010
7278
  try {
7011
- const parsed = JSON.parse(readFileSync8(path9, "utf8"));
7279
+ const parsed = JSON.parse(readFileSync9(path10, "utf8"));
7012
7280
  if (!parsed || typeof parsed !== "object")
7013
7281
  return null;
7014
7282
  if (parsed.version !== expectedVersion)
@@ -7037,7 +7305,7 @@ function writeDayDigest(digest) {
7037
7305
  const final = dayDigestPath(digest.key);
7038
7306
  mkdirSync4(dirname3(final), { recursive: true });
7039
7307
  const tmp = `${final}.tmp`;
7040
- writeFileSync4(tmp, JSON.stringify(digest, null, 2), "utf8");
7308
+ writeFileSync5(tmp, JSON.stringify(digest, null, 2), "utf8");
7041
7309
  if (process.platform !== "win32") {
7042
7310
  try {
7043
7311
  chmodSync(tmp, 384);
@@ -7048,7 +7316,7 @@ function writeDayDigest(digest) {
7048
7316
  }
7049
7317
  function readDayDigest(date) {
7050
7318
  const p = dayDigestPath(date);
7051
- if (!existsSync6(p))
7319
+ if (!existsSync7(p))
7052
7320
  return null;
7053
7321
  return parseDigestFile(p, CURRENT_DAY_DIGEST_SCHEMA_VERSION);
7054
7322
  }
@@ -7070,7 +7338,7 @@ function writeWeekDigest(digest) {
7070
7338
  const final = weekDigestPath(digest.key);
7071
7339
  mkdirSync4(dirname3(final), { recursive: true });
7072
7340
  const tmp = `${final}.tmp`;
7073
- writeFileSync4(tmp, JSON.stringify(digest, null, 2), "utf8");
7341
+ writeFileSync5(tmp, JSON.stringify(digest, null, 2), "utf8");
7074
7342
  if (process.platform !== "win32") {
7075
7343
  try {
7076
7344
  chmodSync(tmp, 384);
@@ -7081,7 +7349,7 @@ function writeWeekDigest(digest) {
7081
7349
  }
7082
7350
  function readWeekDigest(monday) {
7083
7351
  const p = weekDigestPath(monday);
7084
- if (!existsSync6(p))
7352
+ if (!existsSync7(p))
7085
7353
  return null;
7086
7354
  return parseDigestFile(p, CURRENT_WEEK_DIGEST_SCHEMA_VERSION);
7087
7355
  }
@@ -7122,7 +7390,7 @@ function writeEntry(entry) {
7122
7390
  const final = pathFor(entry.session_id, entry.local_day);
7123
7391
  const tmp = tmpPathFor(final);
7124
7392
  const json = JSON.stringify(entry, null, 2);
7125
- writeFileSync5(tmp, json, { encoding: "utf8" });
7393
+ writeFileSync6(tmp, json, { encoding: "utf8" });
7126
7394
  renameSync3(tmp, final);
7127
7395
  }
7128
7396
  var PRESERVABLE_STATUSES = /* @__PURE__ */ new Set([
@@ -7154,22 +7422,22 @@ function writeEntryPreservingEnrichment(fresh) {
7154
7422
  toWrite = { ...fresh, enrichment: existing.enrichment };
7155
7423
  }
7156
7424
  const tmp = tmpPathFor(final);
7157
- writeFileSync5(tmp, JSON.stringify(toWrite, null, 2), { encoding: "utf8" });
7425
+ writeFileSync6(tmp, JSON.stringify(toWrite, null, 2), { encoding: "utf8" });
7158
7426
  renameSync3(tmp, final);
7159
7427
  }
7160
7428
  function readEntry(sessionId, localDay2) {
7161
7429
  const p = pathFor(sessionId, localDay2);
7162
- if (!existsSync7(p))
7430
+ if (!existsSync8(p))
7163
7431
  return null;
7164
- const raw = readFileSync9(p, "utf8");
7432
+ const raw = readFileSync10(p, "utf8");
7165
7433
  return JSON.parse(raw);
7166
7434
  }
7167
7435
  function entryExists(sessionId, localDay2) {
7168
- return existsSync7(pathFor(sessionId, localDay2));
7436
+ return existsSync8(pathFor(sessionId, localDay2));
7169
7437
  }
7170
7438
  function listEntryKeys() {
7171
7439
  const dir = entriesDir();
7172
- if (!existsSync7(dir))
7440
+ if (!existsSync8(dir))
7173
7441
  return [];
7174
7442
  return readdirSync2(dir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
7175
7443
  }
@@ -7188,7 +7456,7 @@ function listEntriesForDay(localDay2) {
7188
7456
 
7189
7457
  // src/perception/build-entries.ts
7190
7458
  init_dist();
7191
- import { statSync as statSync2, readFileSync as readFileSync10 } from "node:fs";
7459
+ import { statSync as statSync2, readFileSync as readFileSync11 } from "node:fs";
7192
7460
  import { basename as basename2, dirname as dirname4 } from "node:path";
7193
7461
 
7194
7462
  // ../entries/dist/signals.js
@@ -7928,7 +8196,7 @@ function decodeProjectDirName(projectDir) {
7928
8196
  }
7929
8197
  function buildEntriesForFile(filePath) {
7930
8198
  const stat = statSync2(filePath);
7931
- const raw = readFileSync10(filePath, "utf8");
8199
+ const raw = readFileSync11(filePath, "utf8");
7932
8200
  const rawLines = raw.split("\n").filter(Boolean).map((l) => {
7933
8201
  try {
7934
8202
  return JSON.parse(l);
@@ -8189,7 +8457,7 @@ function buildIngestPayload(inputs) {
8189
8457
  return {
8190
8458
  ingestId: randomUUID(),
8191
8459
  observedAt: (/* @__PURE__ */ new Date()).toISOString(),
8192
- cliVersion: "0.16.3",
8460
+ cliVersion: "0.16.6",
8193
8461
  ...richRollup || inputs.enrichedExtras || inputs.artifactSignals ? { schemaVersion: RICH_ROLLUP_SCHEMA_VERSION } : {},
8194
8462
  ...inputs.rollup ? { dailyRollup: inputs.rollup } : {},
8195
8463
  ...richRollup ? { richRollup } : {},
@@ -8216,7 +8484,7 @@ async function pushToTeamServer(config, payload) {
8216
8484
  }
8217
8485
 
8218
8486
  // src/team/git-remote.ts
8219
- import { existsSync as existsSync8, readFileSync as readFileSync11, statSync as statSync3 } from "node:fs";
8487
+ import { existsSync as existsSync9, readFileSync as readFileSync12, statSync as statSync3 } from "node:fs";
8220
8488
  import { dirname as dirname5, isAbsolute as isAbsolute2, join as join6, resolve as resolve2 } from "node:path";
8221
8489
  var GITHUB_URL_RE = /github\.com[:/]([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?$/;
8222
8490
  function parseGithubRemote(url) {
@@ -8242,12 +8510,12 @@ function gitConfigPathFor(dir) {
8242
8510
  const st = statSync3(dotGit, { throwIfNoEntry: false });
8243
8511
  if (!st) return null;
8244
8512
  if (st.isDirectory()) return join6(dotGit, "config");
8245
- const m = readFileSync11(dotGit, "utf8").match(/^gitdir:\s*(.+)\s*$/m);
8513
+ const m = readFileSync12(dotGit, "utf8").match(/^gitdir:\s*(.+)\s*$/m);
8246
8514
  if (!m) return null;
8247
8515
  const gd = isAbsolute2(m[1]) ? m[1] : resolve2(dir, m[1]);
8248
8516
  const commondirFile = join6(gd, "commondir");
8249
- if (existsSync8(commondirFile)) {
8250
- const common = readFileSync11(commondirFile, "utf8").trim();
8517
+ if (existsSync9(commondirFile)) {
8518
+ const common = readFileSync12(commondirFile, "utf8").trim();
8251
8519
  return join6(isAbsolute2(common) ? common : resolve2(gd, common), "config");
8252
8520
  }
8253
8521
  return join6(gd, "config");
@@ -8262,8 +8530,8 @@ function createRepoResolver() {
8262
8530
  try {
8263
8531
  for (let d = dir; ; d = dirname5(d)) {
8264
8532
  const config = gitConfigPathFor(d);
8265
- if (config && existsSync8(config)) {
8266
- const url = originUrl2(readFileSync11(config, "utf8"));
8533
+ if (config && existsSync9(config)) {
8534
+ const url = originUrl2(readFileSync12(config, "utf8"));
8267
8535
  repo = url ? parseGithubRemote(url) : null;
8268
8536
  break;
8269
8537
  }
@@ -8279,7 +8547,7 @@ function createRepoResolver() {
8279
8547
 
8280
8548
  // src/team/queue.ts
8281
8549
  init_fs();
8282
- import { readFileSync as readFileSync12, writeFileSync as writeFileSync6, appendFileSync as appendFileSync4, statSync as statSync4, mkdirSync as mkdirSync6 } from "node:fs";
8550
+ import { readFileSync as readFileSync13, writeFileSync as writeFileSync7, appendFileSync as appendFileSync4, statSync as statSync4, mkdirSync as mkdirSync6 } from "node:fs";
8283
8551
  import { dirname as dirname6 } from "node:path";
8284
8552
  var QUEUE_PATH = cclensPath("ingest-queue.jsonl");
8285
8553
  var MAX_SIZE_BYTES = 10 * 1024 * 1024;
@@ -8299,7 +8567,7 @@ function enqueuePayload(payload, queuePath = QUEUE_PATH) {
8299
8567
  function dequeuePayloads(queuePath = QUEUE_PATH) {
8300
8568
  let lines;
8301
8569
  try {
8302
- lines = readFileSync12(queuePath, "utf8").trim().split("\n").filter(Boolean);
8570
+ lines = readFileSync13(queuePath, "utf8").trim().split("\n").filter(Boolean);
8303
8571
  } catch {
8304
8572
  return [];
8305
8573
  }
@@ -8314,18 +8582,18 @@ function dequeuePayloads(queuePath = QUEUE_PATH) {
8314
8582
  } catch {
8315
8583
  }
8316
8584
  }
8317
- writeFileSync6(queuePath, "", "utf8");
8585
+ writeFileSync7(queuePath, "", "utf8");
8318
8586
  return valid.map((e) => e.payload);
8319
8587
  }
8320
8588
  function pruneOldest(queuePath) {
8321
8589
  let lines;
8322
8590
  try {
8323
- lines = readFileSync12(queuePath, "utf8").trim().split("\n").filter(Boolean);
8591
+ lines = readFileSync13(queuePath, "utf8").trim().split("\n").filter(Boolean);
8324
8592
  } catch {
8325
8593
  return;
8326
8594
  }
8327
8595
  const keep = lines.slice(Math.floor(lines.length / 2));
8328
- writeFileSync6(queuePath, keep.join("\n") + "\n", "utf8");
8596
+ writeFileSync7(queuePath, keep.join("\n") + "\n", "utf8");
8329
8597
  }
8330
8598
 
8331
8599
  // src/team/backfill.ts
@@ -8333,7 +8601,7 @@ init_storage();
8333
8601
  import { randomUUID as randomUUID2 } from "node:crypto";
8334
8602
 
8335
8603
  // src/usage/profile.ts
8336
- import { existsSync as existsSync9, mkdirSync as mkdirSync7, readFileSync as readFileSync13, writeFileSync as writeFileSync7 } from "node:fs";
8604
+ import { existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync14, writeFileSync as writeFileSync8 } from "node:fs";
8337
8605
  import { dirname as dirname7 } from "node:path";
8338
8606
  var PROFILE_ENDPOINT = "https://api.anthropic.com/api/oauth/profile";
8339
8607
  var BETA_HEADER2 = "oauth-2025-04-20";
@@ -8377,9 +8645,9 @@ async function fetchProfile(nowMs = Date.now()) {
8377
8645
  };
8378
8646
  }
8379
8647
  function readCachedProfile(cachePath) {
8380
- if (!existsSync9(cachePath)) return null;
8648
+ if (!existsSync10(cachePath)) return null;
8381
8649
  try {
8382
- const raw = JSON.parse(readFileSync13(cachePath, "utf8"));
8650
+ const raw = JSON.parse(readFileSync14(cachePath, "utf8"));
8383
8651
  if (typeof raw.fetchedAtMs !== "number" || !raw.profile) return null;
8384
8652
  return raw;
8385
8653
  } catch {
@@ -8388,7 +8656,7 @@ function readCachedProfile(cachePath) {
8388
8656
  }
8389
8657
  function writeCachedProfile(cachePath, profile, nowMs = Date.now()) {
8390
8658
  mkdirSync7(dirname7(cachePath), { recursive: true });
8391
- writeFileSync7(
8659
+ writeFileSync8(
8392
8660
  cachePath,
8393
8661
  JSON.stringify({ fetchedAtMs: nowMs, profile }, null, 2),
8394
8662
  { mode: 384 }
@@ -8548,13 +8816,13 @@ async function runTeamBackfill(log3 = noopLog, filePath = USAGE_LOG, configOverr
8548
8816
 
8549
8817
  // src/team/sync-log.ts
8550
8818
  init_fs();
8551
- import { readFileSync as readFileSync14 } from "node:fs";
8819
+ import { readFileSync as readFileSync15 } from "node:fs";
8552
8820
  var MAX_LINES = 300;
8553
8821
  var MAX_MSG_CHARS = 1900;
8554
8822
  function readPendingSyncLog(watermark) {
8555
8823
  let raw;
8556
8824
  try {
8557
- raw = readFileSync14(cclensPath("daemon.log"), "utf8");
8825
+ raw = readFileSync15(cclensPath("daemon.log"), "utf8");
8558
8826
  } catch {
8559
8827
  return { lines: [] };
8560
8828
  }
@@ -8574,13 +8842,13 @@ function readPendingSyncLog(watermark) {
8574
8842
 
8575
8843
  // src/team/last-push.ts
8576
8844
  init_fs();
8577
- import { writeFileSync as writeFileSync8, unlinkSync as unlinkSync2, mkdirSync as mkdirSync8 } from "node:fs";
8845
+ import { writeFileSync as writeFileSync9, unlinkSync as unlinkSync2, mkdirSync as mkdirSync8 } from "node:fs";
8578
8846
  import { join as join7 } from "node:path";
8579
8847
  var LAST_PUSH_FILE = "team-last-push.json";
8580
8848
  function write(record, dir) {
8581
8849
  const d = dir ?? cclensHome();
8582
8850
  mkdirSync8(d, { recursive: true });
8583
- writeFileSync8(join7(d, LAST_PUSH_FILE), JSON.stringify(record, null, 2), { mode: 384 });
8851
+ writeFileSync9(join7(d, LAST_PUSH_FILE), JSON.stringify(record, null, 2), { mode: 384 });
8584
8852
  }
8585
8853
  function writeLastPushSuccess(payload, dir) {
8586
8854
  write({ pushedAt: (/* @__PURE__ */ new Date()).toISOString(), ok: true, payload }, dir);
@@ -9180,7 +9448,7 @@ init_fs();
9180
9448
 
9181
9449
  // src/perception/state.ts
9182
9450
  init_fs();
9183
- import { existsSync as existsSync11, readFileSync as readFileSync15, writeFileSync as writeFileSync9, mkdirSync as mkdirSync9, renameSync as renameSync4 } from "node:fs";
9451
+ import { existsSync as existsSync12, readFileSync as readFileSync16, writeFileSync as writeFileSync10, mkdirSync as mkdirSync9, renameSync as renameSync4 } from "node:fs";
9184
9452
  import { dirname as dirname9 } from "node:path";
9185
9453
  var STALE_MS = 15 * 60 * 1e3;
9186
9454
  var pathCached = null;
@@ -9191,7 +9459,7 @@ function statePath() {
9191
9459
  }
9192
9460
  function readState() {
9193
9461
  const p = statePath();
9194
- if (!existsSync11(p)) {
9462
+ if (!existsSync12(p)) {
9195
9463
  return {
9196
9464
  sweep_in_progress: false,
9197
9465
  last_sweep_started_at: null,
@@ -9199,14 +9467,14 @@ function readState() {
9199
9467
  file_checkpoints: {}
9200
9468
  };
9201
9469
  }
9202
- const raw = readFileSync15(p, "utf8");
9470
+ const raw = readFileSync16(p, "utf8");
9203
9471
  return JSON.parse(raw);
9204
9472
  }
9205
9473
  function writeState(s) {
9206
9474
  const p = statePath();
9207
9475
  mkdirSync9(dirname9(p), { recursive: true });
9208
9476
  const tmp = `${p}.tmp`;
9209
- writeFileSync9(tmp, JSON.stringify(s, null, 2), "utf8");
9477
+ writeFileSync10(tmp, JSON.stringify(s, null, 2), "utf8");
9210
9478
  renameSync4(tmp, p);
9211
9479
  }
9212
9480
  function markSweepStart() {
@@ -9807,8 +10075,8 @@ function getErrorMap() {
9807
10075
 
9808
10076
  // ../../node_modules/zod/v3/helpers/parseUtil.js
9809
10077
  var makeIssue = (params) => {
9810
- const { data, path: path9, errorMaps, issueData } = params;
9811
- const fullPath = [...path9, ...issueData.path || []];
10078
+ const { data, path: path10, errorMaps, issueData } = params;
10079
+ const fullPath = [...path10, ...issueData.path || []];
9812
10080
  const fullIssue = {
9813
10081
  ...issueData,
9814
10082
  path: fullPath
@@ -9924,11 +10192,11 @@ var errorUtil;
9924
10192
 
9925
10193
  // ../../node_modules/zod/v3/types.js
9926
10194
  var ParseInputLazyPath = class {
9927
- constructor(parent, value, path9, key) {
10195
+ constructor(parent, value, path10, key) {
9928
10196
  this._cachedPath = [];
9929
10197
  this.parent = parent;
9930
10198
  this.data = value;
9931
- this._path = path9;
10199
+ this._path = path10;
9932
10200
  this._key = key;
9933
10201
  }
9934
10202
  get path() {
@@ -13462,12 +13730,12 @@ var ENRICHMENT_SYSTEM_PROMPT = SYSTEM_PROMPT;
13462
13730
  // ../entries/dist/llm-runner.js
13463
13731
  init_fs();
13464
13732
  import { spawn } from "node:child_process";
13465
- import { mkdirSync as mkdirSync11, appendFileSync as appendFileSync5, writeFileSync as writeFileSync11, existsSync as existsSync13 } from "node:fs";
13733
+ import { mkdirSync as mkdirSync11, appendFileSync as appendFileSync5, writeFileSync as writeFileSync12, existsSync as existsSync14 } from "node:fs";
13466
13734
  import { join as join11 } from "node:path";
13467
13735
  import { randomUUID as randomUUID4 } from "node:crypto";
13468
13736
 
13469
13737
  // ../entries/dist/tmux-runner.js
13470
- import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync10, existsSync as existsSync12, readdirSync as readdirSync5, realpathSync as realpathSync2, readFileSync as readFileSync16, unlinkSync as unlinkSync3, renameSync as renameSync5 } from "node:fs";
13738
+ import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync11, existsSync as existsSync13, readdirSync as readdirSync5, realpathSync as realpathSync2, readFileSync as readFileSync17, unlinkSync as unlinkSync3, renameSync as renameSync5 } from "node:fs";
13471
13739
  import { join as join10 } from "node:path";
13472
13740
  import { homedir as homedir5 } from "node:os";
13473
13741
  import { spawnSync } from "node:child_process";
@@ -13498,7 +13766,7 @@ function tmuxRunnerAvailable() {
13498
13766
  }
13499
13767
  function runtimeCwd() {
13500
13768
  const dir = join10(homedir5(), ".cclens", "runtime");
13501
- if (!existsSync12(dir))
13769
+ if (!existsSync13(dir))
13502
13770
  mkdirSync10(dir, { recursive: true });
13503
13771
  return realpathSync2(dir);
13504
13772
  }
@@ -13506,7 +13774,7 @@ function ensureRuntimeCwdTrusted(cwd) {
13506
13774
  const cfgPath = join10(homedir5(), ".claude.json");
13507
13775
  let cfg;
13508
13776
  try {
13509
- cfg = JSON.parse(readFileSync16(cfgPath, "utf8"));
13777
+ cfg = JSON.parse(readFileSync17(cfgPath, "utf8"));
13510
13778
  } catch {
13511
13779
  return;
13512
13780
  }
@@ -13521,7 +13789,7 @@ function ensureRuntimeCwdTrusted(cwd) {
13521
13789
  cfg.projects = projects;
13522
13790
  const tmp = `${cfgPath}.cclens-tmp-${process.pid}`;
13523
13791
  try {
13524
- writeFileSync10(tmp, JSON.stringify(cfg, null, 2));
13792
+ writeFileSync11(tmp, JSON.stringify(cfg, null, 2));
13525
13793
  renameSync5(tmp, cfgPath);
13526
13794
  } catch {
13527
13795
  try {
@@ -13552,13 +13820,13 @@ async function runClaudeUnderTmuxImpl(args) {
13552
13820
  const systemFile = join10(cwd, `system-${runId}.txt`);
13553
13821
  const userFile = join10(cwd, `user-${runId}.txt`);
13554
13822
  const wrapper = join10(cwd, `run-${runId}.sh`);
13555
- writeFileSync10(systemFile, args.systemPrompt);
13556
- writeFileSync10(userFile, args.reminder ? `${args.userPrompt}
13823
+ writeFileSync11(systemFile, args.systemPrompt);
13824
+ writeFileSync11(userFile, args.reminder ? `${args.userPrompt}
13557
13825
 
13558
13826
  ---
13559
13827
 
13560
13828
  ${args.reminder}` : args.userPrompt);
13561
- writeFileSync10(wrapper, `#!/bin/bash
13829
+ writeFileSync11(wrapper, `#!/bin/bash
13562
13830
  SYS="$(cat ${shellEscape(systemFile)})"
13563
13831
  USR="$(cat ${shellEscape(userFile)})"
13564
13832
  exec ${shellEscape(claudeBin)} \\
@@ -13655,10 +13923,10 @@ function snapshotAllTranscripts() {
13655
13923
  }
13656
13924
  return out;
13657
13925
  }
13658
- function readJsonlCwd(path9, maxLines = 8) {
13926
+ function readJsonlCwd(path10, maxLines = 8) {
13659
13927
  let raw;
13660
13928
  try {
13661
- raw = readFileSync16(path9, "utf8");
13929
+ raw = readFileSync17(path10, "utf8");
13662
13930
  } catch {
13663
13931
  return void 0;
13664
13932
  }
@@ -13712,10 +13980,10 @@ async function discoverTranscript(targetCwd, existingBefore, startMs, timeoutMs,
13712
13980
  }
13713
13981
  throw new TmuxRunError(`timeout waiting for claude to create the session transcript (cwd: ${targetCwd})`);
13714
13982
  }
13715
- function parseTranscript2(path9, defaultModel) {
13983
+ function parseTranscript2(path10, defaultModel) {
13716
13984
  let raw;
13717
13985
  try {
13718
- raw = readFileSync16(path9, "utf8");
13986
+ raw = readFileSync17(path10, "utf8");
13719
13987
  } catch {
13720
13988
  return { assembled: "", inputTokens: 0, outputTokens: 0, modelUsed: defaultModel, done: false };
13721
13989
  }
@@ -13790,7 +14058,7 @@ function shellEscape(s) {
13790
14058
  // ../entries/dist/llm-runner.js
13791
14059
  var RUNS_DIR = cclensPath("llm-runs");
13792
14060
  function ensureRunsDir() {
13793
- if (!existsSync13(RUNS_DIR)) {
14061
+ if (!existsSync14(RUNS_DIR)) {
13794
14062
  try {
13795
14063
  mkdirSync11(RUNS_DIR, { recursive: true });
13796
14064
  } catch {
@@ -13821,15 +14089,15 @@ function newRunId(kind) {
13821
14089
  function tracePath(runId) {
13822
14090
  return join11(RUNS_DIR, `${runId}.jsonl`);
13823
14091
  }
13824
- function safeAppend(path9, line) {
14092
+ function safeAppend(path10, line) {
13825
14093
  try {
13826
- appendFileSync5(path9, line);
14094
+ appendFileSync5(path10, line);
13827
14095
  } catch {
13828
14096
  }
13829
14097
  }
13830
- function safeWrite(path9, line) {
14098
+ function safeWrite(path10, line) {
13831
14099
  try {
13832
- writeFileSync11(path9, line);
14100
+ writeFileSync12(path10, line);
13833
14101
  } catch {
13834
14102
  }
13835
14103
  }
@@ -14218,7 +14486,7 @@ function applyEnrichmentError(entry, errorMessage, model, costUsd, generatedAt,
14218
14486
 
14219
14487
  // ../entries/dist/budget.js
14220
14488
  init_fs();
14221
- import { appendFileSync as appendFileSync6, readFileSync as readFileSync17, existsSync as existsSync14, mkdirSync as mkdirSync12 } from "node:fs";
14489
+ import { appendFileSync as appendFileSync6, readFileSync as readFileSync18, existsSync as existsSync15, mkdirSync as mkdirSync12 } from "node:fs";
14222
14490
  import { dirname as dirname10 } from "node:path";
14223
14491
  var spendPathCached = null;
14224
14492
  function spendPath() {
@@ -14234,12 +14502,12 @@ function appendSpend(record) {
14234
14502
  }
14235
14503
  function monthToDateSpend(now = /* @__PURE__ */ new Date()) {
14236
14504
  const p = spendPath();
14237
- if (!existsSync14(p))
14505
+ if (!existsSync15(p))
14238
14506
  return 0;
14239
14507
  const year = now.getUTCFullYear();
14240
14508
  const month = now.getUTCMonth();
14241
14509
  let total = 0;
14242
- const raw = readFileSync17(p, "utf8");
14510
+ const raw = readFileSync18(p, "utf8");
14243
14511
  for (const line of raw.split("\n")) {
14244
14512
  if (!line)
14245
14513
  continue;
@@ -14261,7 +14529,7 @@ function monthToDateSpend(now = /* @__PURE__ */ new Date()) {
14261
14529
 
14262
14530
  // ../entries/dist/pipeline-lock.js
14263
14531
  init_fs();
14264
- import { writeFileSync as writeFileSync12, unlinkSync as unlinkSync4, existsSync as existsSync15, readFileSync as readFileSync18, statSync as statSync7 } from "node:fs";
14532
+ import { writeFileSync as writeFileSync13, unlinkSync as unlinkSync4, existsSync as existsSync16, readFileSync as readFileSync19, statSync as statSync7 } from "node:fs";
14265
14533
  var STALE_MS2 = 60 * 1e3;
14266
14534
  var HEARTBEAT_MS = 30 * 1e3;
14267
14535
  var lockPathCached = null;
@@ -14273,7 +14541,7 @@ function lockPath() {
14273
14541
  return lockPathCached;
14274
14542
  }
14275
14543
  function touchLock() {
14276
- writeFileSync12(lockPath(), String(process.pid), "utf8");
14544
+ writeFileSync13(lockPath(), String(process.pid), "utf8");
14277
14545
  }
14278
14546
  function writeInteractiveLock() {
14279
14547
  touchLock();
@@ -14307,13 +14575,13 @@ function pidAlive(pid) {
14307
14575
  }
14308
14576
  function interactiveLockFresh(nowMs) {
14309
14577
  const p = lockPath();
14310
- if (!existsSync15(p))
14578
+ if (!existsSync16(p))
14311
14579
  return false;
14312
14580
  try {
14313
14581
  const mtime = statSync7(p).mtimeMs;
14314
14582
  if (nowMs - mtime > STALE_MS2)
14315
14583
  return false;
14316
- const pid = Number(readFileSync18(p, "utf8").trim());
14584
+ const pid = Number(readFileSync19(p, "utf8").trim());
14317
14585
  if (!Number.isFinite(pid) || pid <= 0)
14318
14586
  return false;
14319
14587
  if (!pidAlive(pid))
@@ -14328,7 +14596,7 @@ function interactiveLockFresh(nowMs) {
14328
14596
  var THIRTY_MIN_MS = 30 * 60 * 1e3;
14329
14597
 
14330
14598
  // ../entries/dist/settings.js
14331
- import { readFileSync as readFileSync19, writeFileSync as writeFileSync13, renameSync as renameSync6, chmodSync as chmodSync2, mkdirSync as mkdirSync13, existsSync as existsSync16 } from "node:fs";
14599
+ import { readFileSync as readFileSync20, writeFileSync as writeFileSync14, renameSync as renameSync6, chmodSync as chmodSync2, mkdirSync as mkdirSync13, existsSync as existsSync17 } from "node:fs";
14332
14600
  init_fs();
14333
14601
  var DEFAULT_SETTINGS = {
14334
14602
  ai_features: {
@@ -14360,10 +14628,10 @@ function fromDisk(d) {
14360
14628
  }
14361
14629
  function readSettings() {
14362
14630
  const p = settingsPath();
14363
- if (!existsSync16(p))
14631
+ if (!existsSync17(p))
14364
14632
  return DEFAULT_SETTINGS;
14365
14633
  try {
14366
- const raw = readFileSync19(p, "utf8");
14634
+ const raw = readFileSync20(p, "utf8");
14367
14635
  return fromDisk(JSON.parse(raw));
14368
14636
  } catch {
14369
14637
  return DEFAULT_SETTINGS;
@@ -17123,14 +17391,14 @@ async function getUpdateAvailability() {
17123
17391
  if (isDevMode()) return null;
17124
17392
  const latest = await fetchLatestVersion();
17125
17393
  if (latest === null) return {
17126
- current: "0.16.3",
17394
+ current: "0.16.6",
17127
17395
  latest: null,
17128
17396
  updateAvailable: false
17129
17397
  };
17130
17398
  return {
17131
- current: "0.16.3",
17399
+ current: "0.16.6",
17132
17400
  latest,
17133
- updateAvailable: shouldUpdate("0.16.3", latest)
17401
+ updateAvailable: shouldUpdate("0.16.6", latest)
17134
17402
  };
17135
17403
  }
17136
17404
 
@@ -17178,14 +17446,14 @@ var perceptionHandle = setInterval(async () => {
17178
17446
  }, PERCEPTION_INTERVAL_MS);
17179
17447
  function readUpdateState() {
17180
17448
  try {
17181
- return JSON.parse(readFileSync20(UPDATE_STATE, "utf8"));
17449
+ return JSON.parse(readFileSync21(UPDATE_STATE, "utf8"));
17182
17450
  } catch {
17183
17451
  return null;
17184
17452
  }
17185
17453
  }
17186
17454
  function writeUpdateState(state) {
17187
17455
  try {
17188
- writeFileSync14(UPDATE_STATE, JSON.stringify(state, null, 2), { mode: 384 });
17456
+ writeFileSync15(UPDATE_STATE, JSON.stringify(state, null, 2), { mode: 384 });
17189
17457
  } catch {
17190
17458
  }
17191
17459
  }
@@ -17230,7 +17498,7 @@ async function runDaemonUpdateCheck() {
17230
17498
  return;
17231
17499
  }
17232
17500
  const entry = cliEntryPath();
17233
- if (!existsSync17(entry)) {
17501
+ if (!existsSync18(entry)) {
17234
17502
  log2("warn", `update check found ${availability.latest}, but CLI entry is missing at ${entry}`);
17235
17503
  return;
17236
17504
  }
@@ -17309,6 +17577,19 @@ async function tick() {
17309
17577
  log2("warn", `zai poll failed: ${err.message}`);
17310
17578
  }
17311
17579
  }
17580
+ try {
17581
+ const codexSnapshot = await fetchCodexUsage();
17582
+ appendSnapshot(USAGE_LOG3, codexSnapshot);
17583
+ const fiveHour = codexSnapshot.five_hour.utilization === null ? "\u2014" : `${codexSnapshot.five_hour.utilization}%`;
17584
+ const sevenDay = codexSnapshot.seven_day.utilization === null ? "\u2014" : `${codexSnapshot.seven_day.utilization}%`;
17585
+ log2("info", `codex snapshot 5h=${fiveHour} 7d=${sevenDay}`);
17586
+ } catch (err) {
17587
+ if (err instanceof CodexApiError && (err.code === "no_auth" || err.code === "api_key_only")) {
17588
+ pruneAgent(USAGE_LOG3, "codex");
17589
+ } else {
17590
+ log2("warn", `codex poll failed: ${err.message}`);
17591
+ }
17592
+ }
17312
17593
  try {
17313
17594
  const grokSnapshot = await fetchGrokUsage();
17314
17595
  appendSnapshot(USAGE_LOG3, grokSnapshot);