fleetlens 0.16.4 → 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.
- package/app/apps/web/.next/BUILD_ID +1 -1
- package/app/apps/web/.next/app-path-routes-manifest.json +1 -0
- package/app/apps/web/.next/build-manifest.json +3 -3
- package/app/apps/web/.next/prerender-manifest.json +32 -3
- package/app/apps/web/.next/routes-manifest.json +6 -0
- package/app/apps/web/.next/server/app/_global-error/page.js +2 -2
- package/app/apps/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/_global-error.html +1 -1
- package/app/apps/web/.next/server/app/_global-error.rsc +7 -7
- package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/apps/web/.next/server/app/_not-found/page.js +10 -9
- package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/agent/page.js +10 -9
- package/app/apps/web/.next/server/app/agent/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/agent/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/api/agent/chats/[id]/messages/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/mcp/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/agent/suggestions/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/pdf/[key]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/projects/open-folder/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/settings/credentials/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/changelog/page.js +10 -9
- package/app/apps/web/.next/server/app/changelog/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/[date]/page.js +10 -9
- package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/day/page.js +10 -9
- package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/[date]/page.js +10 -9
- package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/digest/page.js +10 -9
- package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/icon.svg/route/app-paths-manifest.json +3 -0
- package/app/apps/web/.next/server/app/icon.svg/route/build-manifest.json +9 -0
- package/app/apps/web/.next/server/app/icon.svg/route.js +7 -0
- package/app/apps/web/.next/server/app/icon.svg/route.js.map +5 -0
- package/app/apps/web/.next/server/app/icon.svg/route.js.nft.json +1 -0
- package/app/apps/web/.next/server/app/icon.svg.body +7 -0
- package/app/apps/web/.next/server/app/icon.svg.meta +1 -0
- package/app/apps/web/.next/server/app/insights/[key]/page.js +10 -9
- package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/insights/page.js +10 -9
- package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/page.js +10 -9
- package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/parallelism/page.js +10 -9
- package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/print/[key]/page.js +10 -9
- package/app/apps/web/.next/server/app/print/[key]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/print/[key]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/[slug]/page.js +10 -9
- package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/projects/page.js +10 -9
- package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/runs/page.js +10 -9
- package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/[id]/page.js +10 -9
- package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/sessions/page.js +10 -9
- package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/settings/page.js +10 -9
- package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/team/onboarding/page.js +10 -9
- package/app/apps/web/.next/server/app/team/onboarding/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/team/onboarding/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/team/page.js +10 -9
- package/app/apps/web/.next/server/app/team/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/team/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app/usage/page.js +10 -9
- package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
- package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/app-paths-manifest.json +1 -0
- package/app/apps/web/.next/server/chunks/[root-of-the-server]__0o.75vf._.js +3 -0
- package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_icon_svg_route_actions_09mu110.js +3 -0
- package/app/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0sr4wr_.js +1 -1
- package/app/apps/web/.next/server/chunks/packages_parser_dist_06d9se1._.js +1 -1
- package/app/apps/web/.next/server/chunks/packages_parser_dist_10ihc3~._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-zxvif._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01etyrg._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01wj6p0._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0lz4a~g._.js → [root-of-the-server]__021z658._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__07e35nb._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__11xp-1u._.js → [root-of-the-server]__0a-_-_a._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0xy1qim._.js → [root-of-the-server]__0b6a93u._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0o1_g.~._.js → [root-of-the-server]__0fosdzf._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__04qodwp._.js → [root-of-the-server]__0h~6fzv._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ix~bkq._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0j3r6mu._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__10srpu0._.js → [root-of-the-server]__0m3g~yv._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__07~kk2~._.js → [root-of-the-server]__0n3n~yr._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0kml6jt._.js → [root-of-the-server]__0omu7re._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0.zquoa._.js → [root-of-the-server]__0ovph2e._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0ar_8wr._.js → [root-of-the-server]__0tz4w46._.js} +3 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0u0n8z~._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0ufi3.w._.js → [root-of-the-server]__0wraeyz._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0u39afl._.js → [root-of-the-server]__0wy2-yx._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0blm9gz._.js → [root-of-the-server]__0ygwqfa._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0lmftab._.js → [root-of-the-server]__0z0wa91._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~.gwld._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0.wm54e._.js → [root-of-the-server]__12mxxlm._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0tejjy_._.js → [root-of-the-server]__12s3gv9._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/_0k8yioi._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/_0sz8~hl._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0x014hn._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_06u0kr8._.js +3 -0
- package/app/apps/web/.next/server/chunks/ssr/{node_modules_next_dist_06c_2qf._.js → node_modules_next_dist_0ve2ws3._.js} +2 -2
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_00g~mhv.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_01.bezr.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0289ttk.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02eo3j_.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03vhmnm.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_07_oby5.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0bm6hj~.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0dd8f-e.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0e-9-6e.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hvl-ct.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0i1kx1j.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0j8zf-y.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0kpe55j.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0q1syx3.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0q4~c_f.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0w_~1n4.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0wcoddw.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0wil2ok.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0z65c3i.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0zaz56w.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0~onns0.js +4 -0
- package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0mx_509._.js +1 -1
- package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/app/apps/web/.next/server/middleware-manifest.json +5 -5
- package/app/apps/web/.next/server/pages/500.html +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/app/apps/web/.next/static/chunks/{0389wb_f0j78j.js → 0n1d620va1z.z.js} +1 -1
- package/app/apps/web/.next/static/chunks/1350ox0.qybjo.js +14 -0
- package/app/apps/web/.next/static/media/icon.0h9o_.fpzdvkq.svg +7 -0
- package/app/apps/web/app/icon.svg +7 -0
- package/app/apps/web/components/sidebar.tsx +5 -11
- package/app/apps/web/lib/changelog-data.generated.ts +1 -1
- package/app/apps/web/package.json +1 -1
- package/app/apps/web/tsconfig.tsbuildinfo +1 -1
- package/dist/daemon-worker.js +392 -111
- package/dist/index.js +442 -155
- package/menubar/FleetlensMenubar.app/Contents/Info.plist +2 -2
- package/menubar/FleetlensMenubar.app/Contents/MacOS/FleetlensMenubar +0 -0
- package/package.json +1 -1
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04eq6z2._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__09rjz7_._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_78i1t._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0d5y90m._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0i.q-1h._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0j683am._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0p1x6v2._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0stu~~r._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_0k0tl52._.js +0 -3
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02rcy0h.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0602nef.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_07orc4m.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09aewh9.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09rx8oz.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d3d4wn.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0edz1ko.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0eq.n-n.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hcvt-s.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hshwu7.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0hwycdb.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0jxvcfi.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nd5zu0.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0s5yhs4.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0uwo3v3.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0~g07z5.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_10cdrh2.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_10op6u-.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11j1qy0.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12n1lw_.js +0 -4
- package/app/apps/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12r67~s.js +0 -4
- package/app/apps/web/.next/static/chunks/13hdlcc0bj_zt.js +0 -14
- /package/app/apps/web/.next/static/{cKCY-h3trXN9_kNrMfxWd → 8slBxbEObd72azKwDvtmy}/_buildManifest.js +0 -0
- /package/app/apps/web/.next/static/{cKCY-h3trXN9_kNrMfxWd → 8slBxbEObd72azKwDvtmy}/_clientMiddlewareManifest.js +0 -0
- /package/app/apps/web/.next/static/{cKCY-h3trXN9_kNrMfxWd → 8slBxbEObd72azKwDvtmy}/_ssgManifest.js +0 -0
package/dist/index.js
CHANGED
|
@@ -1593,11 +1593,11 @@ function defaultBranch(commonDir) {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
return void 0;
|
|
1595
1595
|
}
|
|
1596
|
-
function readGitFolder(
|
|
1597
|
-
if (!existsSync(
|
|
1596
|
+
function readGitFolder(path10) {
|
|
1597
|
+
if (!existsSync(path10))
|
|
1598
1598
|
return { exists: false, isWorktree: false };
|
|
1599
1599
|
try {
|
|
1600
|
-
const git = nearestDotGit(realpathOrSelf(
|
|
1600
|
+
const git = nearestDotGit(realpathOrSelf(path10));
|
|
1601
1601
|
if (!git)
|
|
1602
1602
|
return { exists: true, isWorktree: false };
|
|
1603
1603
|
const projectRoot = projectRootFromCommonDir(git.commonDir);
|
|
@@ -5712,18 +5712,6 @@ var init_fs = __esm({
|
|
|
5712
5712
|
},
|
|
5713
5713
|
async getSession(id) {
|
|
5714
5714
|
return getCodexSession(id);
|
|
5715
|
-
},
|
|
5716
|
-
async usagePoller() {
|
|
5717
|
-
const w = await getLatestCodexUsage();
|
|
5718
|
-
if (!w)
|
|
5719
|
-
return null;
|
|
5720
|
-
return {
|
|
5721
|
-
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5722
|
-
agent: "codex",
|
|
5723
|
-
five_hour: w.five_hour,
|
|
5724
|
-
seven_day: w.seven_day,
|
|
5725
|
-
plan_type: w.plan_type
|
|
5726
|
-
};
|
|
5727
5715
|
}
|
|
5728
5716
|
};
|
|
5729
5717
|
geminiSource = {
|
|
@@ -5809,9 +5797,9 @@ function onDiskVersion() {
|
|
|
5809
5797
|
try {
|
|
5810
5798
|
const here = dirname3(fileURLToPath(import.meta.url));
|
|
5811
5799
|
const pkg = JSON.parse(readFileSync5(join3(here, "..", "package.json"), "utf8"));
|
|
5812
|
-
return pkg.version ?? "0.16.
|
|
5800
|
+
return pkg.version ?? "0.16.6";
|
|
5813
5801
|
} catch {
|
|
5814
|
-
return "0.16.
|
|
5802
|
+
return "0.16.6";
|
|
5815
5803
|
}
|
|
5816
5804
|
}
|
|
5817
5805
|
function getServerStatus() {
|
|
@@ -5823,7 +5811,7 @@ function getServerStatus() {
|
|
|
5823
5811
|
return { running: false };
|
|
5824
5812
|
}
|
|
5825
5813
|
function isServerStale(status2) {
|
|
5826
|
-
return status2.running === true && status2.version !== "0.16.
|
|
5814
|
+
return status2.running === true && status2.version !== "0.16.6";
|
|
5827
5815
|
}
|
|
5828
5816
|
async function ensureCurrentServer(opts = {}) {
|
|
5829
5817
|
const status2 = getServerStatus();
|
|
@@ -6262,9 +6250,9 @@ Installed: ${PACKAGE_NAME}@${verify.installedVersion} at ${verify.installedPath
|
|
|
6262
6250
|
console.warn(
|
|
6263
6251
|
` \u2022 reinstall in the correct Node env: 'npm install -g ${PACKAGE_NAME}@latest'`
|
|
6264
6252
|
);
|
|
6265
|
-
} else if (verify.installedVersion !== "0.16.
|
|
6253
|
+
} else if (verify.installedVersion !== "0.16.6") {
|
|
6266
6254
|
console.log(
|
|
6267
|
-
` \u2192 This process is still running ${"0.16.
|
|
6255
|
+
` \u2192 This process is still running ${"0.16.6"}. Next invocation will use ${verify.installedVersion}.`
|
|
6268
6256
|
);
|
|
6269
6257
|
}
|
|
6270
6258
|
}
|
|
@@ -6299,14 +6287,14 @@ async function getUpdateAvailability() {
|
|
|
6299
6287
|
if (isDevMode()) return null;
|
|
6300
6288
|
const latest = await fetchLatestVersion();
|
|
6301
6289
|
if (latest === null) return {
|
|
6302
|
-
current: "0.16.
|
|
6290
|
+
current: "0.16.6",
|
|
6303
6291
|
latest: null,
|
|
6304
6292
|
updateAvailable: false
|
|
6305
6293
|
};
|
|
6306
6294
|
return {
|
|
6307
|
-
current: "0.16.
|
|
6295
|
+
current: "0.16.6",
|
|
6308
6296
|
latest,
|
|
6309
|
-
updateAvailable: shouldUpdate("0.16.
|
|
6297
|
+
updateAvailable: shouldUpdate("0.16.6", latest)
|
|
6310
6298
|
};
|
|
6311
6299
|
}
|
|
6312
6300
|
async function checkForUpdate() {
|
|
@@ -6396,7 +6384,7 @@ async function restartServices(state) {
|
|
|
6396
6384
|
}
|
|
6397
6385
|
async function forceUpdate() {
|
|
6398
6386
|
const latest = await fetchLatestVersion();
|
|
6399
|
-
const current = "0.16.
|
|
6387
|
+
const current = "0.16.6";
|
|
6400
6388
|
if (latest === null) {
|
|
6401
6389
|
console.error("Could not reach npm registry. Check your network.");
|
|
6402
6390
|
process.exit(1);
|
|
@@ -6809,7 +6797,7 @@ async function status() {
|
|
|
6809
6797
|
console.log(`Server: running on ${url} (PID ${server.pid}, v${ver})`);
|
|
6810
6798
|
if (isServerStale(server)) {
|
|
6811
6799
|
console.log(
|
|
6812
|
-
` \u26A0 serving stale ${ver} (CLI is ${"0.16.
|
|
6800
|
+
` \u26A0 serving stale ${ver} (CLI is ${"0.16.6"}) \u2014 run 'fleetlens start' to restart on the current version`
|
|
6813
6801
|
);
|
|
6814
6802
|
}
|
|
6815
6803
|
} else {
|
|
@@ -6848,7 +6836,7 @@ async function web(args2) {
|
|
|
6848
6836
|
const open = args2.includes("--open");
|
|
6849
6837
|
const positional = args2.filter((a) => !a.startsWith("--"));
|
|
6850
6838
|
const rawPath = positional[0] ?? "";
|
|
6851
|
-
const
|
|
6839
|
+
const path10 = rawPath.startsWith("/") ? rawPath : rawPath ? `/${rawPath}` : "";
|
|
6852
6840
|
let result;
|
|
6853
6841
|
try {
|
|
6854
6842
|
result = await ensureCurrentServer({});
|
|
@@ -6856,7 +6844,7 @@ async function web(args2) {
|
|
|
6856
6844
|
console.error(`Failed to start: ${err.message}`);
|
|
6857
6845
|
process.exit(1);
|
|
6858
6846
|
}
|
|
6859
|
-
const url = `http://localhost:${result.port}${
|
|
6847
|
+
const url = `http://localhost:${result.port}${path10}`;
|
|
6860
6848
|
if (result.restarted) {
|
|
6861
6849
|
console.log(`fleetlens restarted on http://localhost:${result.port} (PID ${result.pid}) \u2014 replaced stale ${result.previousVersion ?? "unknown"} server`);
|
|
6862
6850
|
}
|
|
@@ -6917,9 +6905,9 @@ function readFromCredentialsFile() {
|
|
|
6917
6905
|
join7(homedir4(), ".claude", ".credentials.json"),
|
|
6918
6906
|
join7(homedir4(), ".config", "claude", "credentials.json")
|
|
6919
6907
|
];
|
|
6920
|
-
for (const
|
|
6908
|
+
for (const path10 of candidates) {
|
|
6921
6909
|
try {
|
|
6922
|
-
const blob = readFileSync10(
|
|
6910
|
+
const blob = readFileSync10(path10, "utf8");
|
|
6923
6911
|
const creds = extractCredentials(blob);
|
|
6924
6912
|
if (creds) return creds;
|
|
6925
6913
|
} catch {
|
|
@@ -7112,8 +7100,8 @@ async function refreshAccessToken(entry) {
|
|
|
7112
7100
|
break;
|
|
7113
7101
|
}
|
|
7114
7102
|
}
|
|
7115
|
-
const { writeFileSync:
|
|
7116
|
-
|
|
7103
|
+
const { writeFileSync: writeFileSync18 } = await import("node:fs");
|
|
7104
|
+
writeFileSync18(p, JSON.stringify(raw, null, 2), "utf8");
|
|
7117
7105
|
} catch {
|
|
7118
7106
|
}
|
|
7119
7107
|
return j.access_token;
|
|
@@ -7259,6 +7247,292 @@ var init_grok2 = __esm({
|
|
|
7259
7247
|
}
|
|
7260
7248
|
});
|
|
7261
7249
|
|
|
7250
|
+
// src/usage/codex.ts
|
|
7251
|
+
import {
|
|
7252
|
+
existsSync as existsSync9,
|
|
7253
|
+
readFileSync as readFileSync12,
|
|
7254
|
+
writeFileSync as writeFileSync6
|
|
7255
|
+
} from "node:fs";
|
|
7256
|
+
import os9 from "node:os";
|
|
7257
|
+
import path9 from "node:path";
|
|
7258
|
+
function codexHome() {
|
|
7259
|
+
const env = process.env.CODEX_HOME?.trim();
|
|
7260
|
+
if (env) return env;
|
|
7261
|
+
return path9.join(os9.homedir(), ".codex");
|
|
7262
|
+
}
|
|
7263
|
+
function authPath2() {
|
|
7264
|
+
return path9.join(codexHome(), "auth.json");
|
|
7265
|
+
}
|
|
7266
|
+
function loadAuth() {
|
|
7267
|
+
const p = authPath2();
|
|
7268
|
+
if (!existsSync9(p)) {
|
|
7269
|
+
throw new CodexApiError(
|
|
7270
|
+
"Codex not logged in. Run `codex` to authenticate.",
|
|
7271
|
+
"no_auth"
|
|
7272
|
+
);
|
|
7273
|
+
}
|
|
7274
|
+
let auth;
|
|
7275
|
+
try {
|
|
7276
|
+
auth = JSON.parse(readFileSync12(p, "utf8"));
|
|
7277
|
+
} catch {
|
|
7278
|
+
throw new CodexApiError(
|
|
7279
|
+
"Codex auth.json is unreadable. Run `codex` to log in again.",
|
|
7280
|
+
"no_auth"
|
|
7281
|
+
);
|
|
7282
|
+
}
|
|
7283
|
+
const access = auth.tokens?.access_token?.trim();
|
|
7284
|
+
if (!access) {
|
|
7285
|
+
if (auth.OPENAI_API_KEY?.trim()) {
|
|
7286
|
+
throw new CodexApiError(
|
|
7287
|
+
"Codex usage is not available for API-key-only auth. Sign in with a ChatGPT account via `codex`.",
|
|
7288
|
+
"api_key_only"
|
|
7289
|
+
);
|
|
7290
|
+
}
|
|
7291
|
+
throw new CodexApiError(
|
|
7292
|
+
"Codex auth has no access token. Run `codex` to log in.",
|
|
7293
|
+
"no_auth"
|
|
7294
|
+
);
|
|
7295
|
+
}
|
|
7296
|
+
return { auth, path: p };
|
|
7297
|
+
}
|
|
7298
|
+
function accessTokenExpiresAtMs(token) {
|
|
7299
|
+
const parts = token.split(".");
|
|
7300
|
+
if (parts.length < 2) return null;
|
|
7301
|
+
try {
|
|
7302
|
+
const pad2 = "=".repeat((4 - parts[1].length % 4) % 4);
|
|
7303
|
+
const json = Buffer.from(parts[1] + pad2, "base64url").toString("utf8");
|
|
7304
|
+
const payload = JSON.parse(json);
|
|
7305
|
+
if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp)) {
|
|
7306
|
+
return null;
|
|
7307
|
+
}
|
|
7308
|
+
return payload.exp * 1e3;
|
|
7309
|
+
} catch {
|
|
7310
|
+
return null;
|
|
7311
|
+
}
|
|
7312
|
+
}
|
|
7313
|
+
function needsRefresh2(accessToken, lastRefresh, nowMs = Date.now()) {
|
|
7314
|
+
const expMs = accessTokenExpiresAtMs(accessToken);
|
|
7315
|
+
if (expMs !== null) {
|
|
7316
|
+
return nowMs >= expMs - REFRESH_BUFFER_MS2;
|
|
7317
|
+
}
|
|
7318
|
+
if (!lastRefresh) return false;
|
|
7319
|
+
const ms = Date.parse(lastRefresh);
|
|
7320
|
+
if (!Number.isFinite(ms)) return false;
|
|
7321
|
+
return nowMs - ms > 8 * 24 * 60 * 60 * 1e3;
|
|
7322
|
+
}
|
|
7323
|
+
async function refreshAccessToken2(auth, filePath) {
|
|
7324
|
+
const refresh = auth.tokens?.refresh_token?.trim();
|
|
7325
|
+
if (!refresh) return null;
|
|
7326
|
+
const body = new URLSearchParams({
|
|
7327
|
+
grant_type: "refresh_token",
|
|
7328
|
+
client_id: CLIENT_ID,
|
|
7329
|
+
refresh_token: refresh
|
|
7330
|
+
});
|
|
7331
|
+
let res;
|
|
7332
|
+
try {
|
|
7333
|
+
res = await fetch(REFRESH_URL2, {
|
|
7334
|
+
method: "POST",
|
|
7335
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
7336
|
+
body: body.toString()
|
|
7337
|
+
});
|
|
7338
|
+
} catch {
|
|
7339
|
+
return null;
|
|
7340
|
+
}
|
|
7341
|
+
if (!res.ok) return null;
|
|
7342
|
+
try {
|
|
7343
|
+
const j = await res.json();
|
|
7344
|
+
if (typeof j.access_token !== "string" || !j.access_token) return null;
|
|
7345
|
+
const next = {
|
|
7346
|
+
...auth,
|
|
7347
|
+
tokens: {
|
|
7348
|
+
...auth.tokens,
|
|
7349
|
+
access_token: j.access_token,
|
|
7350
|
+
refresh_token: j.refresh_token ?? auth.tokens?.refresh_token,
|
|
7351
|
+
id_token: j.id_token ?? auth.tokens?.id_token
|
|
7352
|
+
},
|
|
7353
|
+
last_refresh: (/* @__PURE__ */ new Date()).toISOString()
|
|
7354
|
+
};
|
|
7355
|
+
try {
|
|
7356
|
+
writeFileSync6(filePath, `${JSON.stringify(next, null, 2)}
|
|
7357
|
+
`, {
|
|
7358
|
+
encoding: "utf8",
|
|
7359
|
+
mode: 384
|
|
7360
|
+
});
|
|
7361
|
+
} catch {
|
|
7362
|
+
}
|
|
7363
|
+
return { accessToken: j.access_token, auth: next };
|
|
7364
|
+
} catch {
|
|
7365
|
+
return null;
|
|
7366
|
+
}
|
|
7367
|
+
}
|
|
7368
|
+
function authHeaders2(accessToken, accountId) {
|
|
7369
|
+
const headers = {
|
|
7370
|
+
Authorization: `Bearer ${accessToken}`,
|
|
7371
|
+
Accept: "application/json",
|
|
7372
|
+
"User-Agent": "fleetlens"
|
|
7373
|
+
};
|
|
7374
|
+
if (accountId?.trim()) {
|
|
7375
|
+
headers["ChatGPT-Account-Id"] = accountId.trim();
|
|
7376
|
+
}
|
|
7377
|
+
return headers;
|
|
7378
|
+
}
|
|
7379
|
+
function numberOf2(v) {
|
|
7380
|
+
if (typeof v === "number" && Number.isFinite(v)) return v;
|
|
7381
|
+
if (typeof v === "string" && v.trim()) {
|
|
7382
|
+
const n = Number(v);
|
|
7383
|
+
if (Number.isFinite(n)) return n;
|
|
7384
|
+
}
|
|
7385
|
+
return void 0;
|
|
7386
|
+
}
|
|
7387
|
+
function windowSeconds(raw) {
|
|
7388
|
+
if (!raw) return void 0;
|
|
7389
|
+
const sec = numberOf2(raw.limit_window_seconds);
|
|
7390
|
+
if (sec !== void 0) return sec;
|
|
7391
|
+
const minutes = numberOf2(raw.window_minutes);
|
|
7392
|
+
if (minutes !== void 0) return minutes * 60;
|
|
7393
|
+
return void 0;
|
|
7394
|
+
}
|
|
7395
|
+
function normalizeWindow2(raw, headerPercent, nowMs) {
|
|
7396
|
+
const used = numberOf2(raw?.used_percent) ?? headerPercent;
|
|
7397
|
+
if (used === void 0) return null;
|
|
7398
|
+
let resetsAt = null;
|
|
7399
|
+
const resetUnix = numberOf2(raw?.reset_at) ?? numberOf2(raw?.resets_at);
|
|
7400
|
+
if (resetUnix !== void 0) {
|
|
7401
|
+
resetsAt = new Date(resetUnix * 1e3).toISOString();
|
|
7402
|
+
} else {
|
|
7403
|
+
const after = numberOf2(raw?.reset_after_seconds);
|
|
7404
|
+
if (after !== void 0) {
|
|
7405
|
+
resetsAt = new Date(nowMs + after * 1e3).toISOString();
|
|
7406
|
+
}
|
|
7407
|
+
}
|
|
7408
|
+
return {
|
|
7409
|
+
utilization: Math.min(100, Math.max(0, used)),
|
|
7410
|
+
resets_at: resetsAt
|
|
7411
|
+
};
|
|
7412
|
+
}
|
|
7413
|
+
function parseCodexWhamUsage(body, headers = {}, nowMs = Date.now()) {
|
|
7414
|
+
if (!body || typeof body !== "object") {
|
|
7415
|
+
throw new CodexApiError("Codex usage response missing body", "parse");
|
|
7416
|
+
}
|
|
7417
|
+
const b = body;
|
|
7418
|
+
const rateLimit = b.rate_limit && typeof b.rate_limit === "object" ? b.rate_limit : {};
|
|
7419
|
+
const headerPrimary = numberOf2(headers["x-codex-primary-used-percent"]);
|
|
7420
|
+
const headerSecondary = numberOf2(headers["x-codex-secondary-used-percent"]);
|
|
7421
|
+
const primary = rateLimit.primary_window && typeof rateLimit.primary_window === "object" ? rateLimit.primary_window : null;
|
|
7422
|
+
const secondary = rateLimit.secondary_window && typeof rateLimit.secondary_window === "object" ? rateLimit.secondary_window : null;
|
|
7423
|
+
const candidates = [
|
|
7424
|
+
{ raw: primary, headerPercent: headerPrimary, fallback: "five_hour" },
|
|
7425
|
+
{ raw: secondary, headerPercent: headerSecondary, fallback: "seven_day" }
|
|
7426
|
+
];
|
|
7427
|
+
let fiveHour = null;
|
|
7428
|
+
let sevenDay = null;
|
|
7429
|
+
for (const c of candidates) {
|
|
7430
|
+
const secs = windowSeconds(c.raw);
|
|
7431
|
+
const window = normalizeWindow2(c.raw, c.headerPercent, nowMs);
|
|
7432
|
+
if (!window) continue;
|
|
7433
|
+
if (secs === FIVE_HOUR_SECONDS) fiveHour = window;
|
|
7434
|
+
else if (secs === SEVEN_DAY_SECONDS) sevenDay = window;
|
|
7435
|
+
}
|
|
7436
|
+
if (!fiveHour || !sevenDay) {
|
|
7437
|
+
for (const c of candidates) {
|
|
7438
|
+
const secs = windowSeconds(c.raw);
|
|
7439
|
+
if (secs === FIVE_HOUR_SECONDS || secs === SEVEN_DAY_SECONDS) continue;
|
|
7440
|
+
const window = normalizeWindow2(c.raw, c.headerPercent, nowMs);
|
|
7441
|
+
if (!window) continue;
|
|
7442
|
+
if (c.fallback === "five_hour" && !fiveHour) fiveHour = window;
|
|
7443
|
+
else if (c.fallback === "seven_day" && !sevenDay) sevenDay = window;
|
|
7444
|
+
}
|
|
7445
|
+
}
|
|
7446
|
+
const planRaw = b.plan_type;
|
|
7447
|
+
const planType = typeof planRaw === "string" && planRaw.trim() ? planRaw.trim() : null;
|
|
7448
|
+
return {
|
|
7449
|
+
five_hour: fiveHour ?? { utilization: null, resets_at: null },
|
|
7450
|
+
seven_day: sevenDay ?? { utilization: null, resets_at: null },
|
|
7451
|
+
plan_type: planType
|
|
7452
|
+
};
|
|
7453
|
+
}
|
|
7454
|
+
async function fetchUsageResponse(accessToken, accountId) {
|
|
7455
|
+
let res;
|
|
7456
|
+
try {
|
|
7457
|
+
res = await fetch(USAGE_URL, {
|
|
7458
|
+
headers: authHeaders2(accessToken, accountId)
|
|
7459
|
+
});
|
|
7460
|
+
} catch (err) {
|
|
7461
|
+
throw new CodexApiError(
|
|
7462
|
+
`Network error reaching Codex usage: ${err.message}`,
|
|
7463
|
+
"network"
|
|
7464
|
+
);
|
|
7465
|
+
}
|
|
7466
|
+
const headers = {};
|
|
7467
|
+
res.headers.forEach((value, key) => {
|
|
7468
|
+
headers[key.toLowerCase()] = value;
|
|
7469
|
+
});
|
|
7470
|
+
let body = null;
|
|
7471
|
+
try {
|
|
7472
|
+
body = await res.json();
|
|
7473
|
+
} catch {
|
|
7474
|
+
}
|
|
7475
|
+
return { status: res.status, body, headers };
|
|
7476
|
+
}
|
|
7477
|
+
async function fetchCodexUsage() {
|
|
7478
|
+
const loaded = loadAuth();
|
|
7479
|
+
let auth = loaded.auth;
|
|
7480
|
+
let access = auth.tokens.access_token.trim();
|
|
7481
|
+
const accountId = auth.tokens?.account_id;
|
|
7482
|
+
if (needsRefresh2(access, auth.last_refresh)) {
|
|
7483
|
+
const refreshed = await refreshAccessToken2(auth, loaded.path);
|
|
7484
|
+
if (refreshed) {
|
|
7485
|
+
access = refreshed.accessToken;
|
|
7486
|
+
auth = refreshed.auth;
|
|
7487
|
+
}
|
|
7488
|
+
}
|
|
7489
|
+
let { status: status2, body, headers } = await fetchUsageResponse(access, accountId);
|
|
7490
|
+
if (status2 === 401 || status2 === 403) {
|
|
7491
|
+
const refreshed = await refreshAccessToken2(auth, loaded.path);
|
|
7492
|
+
if (refreshed) {
|
|
7493
|
+
access = refreshed.accessToken;
|
|
7494
|
+
({ status: status2, body, headers } = await fetchUsageResponse(access, accountId));
|
|
7495
|
+
}
|
|
7496
|
+
}
|
|
7497
|
+
if (status2 < 200 || status2 >= 300) {
|
|
7498
|
+
throw new CodexApiError(
|
|
7499
|
+
`Codex usage returned HTTP ${status2}`,
|
|
7500
|
+
status2 === 401 || status2 === 403 ? "no_auth" : "http"
|
|
7501
|
+
);
|
|
7502
|
+
}
|
|
7503
|
+
const windows = parseCodexWhamUsage(body, headers);
|
|
7504
|
+
return {
|
|
7505
|
+
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7506
|
+
agent: "codex",
|
|
7507
|
+
five_hour: windows.five_hour,
|
|
7508
|
+
seven_day: windows.seven_day,
|
|
7509
|
+
seven_day_opus: null,
|
|
7510
|
+
seven_day_sonnet: null,
|
|
7511
|
+
seven_day_oauth_apps: null,
|
|
7512
|
+
seven_day_cowork: null,
|
|
7513
|
+
extra_usage: null,
|
|
7514
|
+
plan_type: windows.plan_type
|
|
7515
|
+
};
|
|
7516
|
+
}
|
|
7517
|
+
var USAGE_URL, REFRESH_URL2, CLIENT_ID, FIVE_HOUR_SECONDS, SEVEN_DAY_SECONDS, REFRESH_BUFFER_MS2, CodexApiError;
|
|
7518
|
+
var init_codex2 = __esm({
|
|
7519
|
+
"src/usage/codex.ts"() {
|
|
7520
|
+
"use strict";
|
|
7521
|
+
USAGE_URL = "https://chatgpt.com/backend-api/wham/usage";
|
|
7522
|
+
REFRESH_URL2 = "https://auth.openai.com/oauth/token";
|
|
7523
|
+
CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
|
|
7524
|
+
FIVE_HOUR_SECONDS = 5 * 60 * 60;
|
|
7525
|
+
SEVEN_DAY_SECONDS = 7 * 24 * 60 * 60;
|
|
7526
|
+
REFRESH_BUFFER_MS2 = 5 * 60 * 1e3;
|
|
7527
|
+
CodexApiError = class extends Error {
|
|
7528
|
+
constructor(message, code) {
|
|
7529
|
+
super(message);
|
|
7530
|
+
this.code = code;
|
|
7531
|
+
}
|
|
7532
|
+
};
|
|
7533
|
+
}
|
|
7534
|
+
});
|
|
7535
|
+
|
|
7262
7536
|
// src/usage/format.ts
|
|
7263
7537
|
function formatUsage(snapshot) {
|
|
7264
7538
|
const rows = [
|
|
@@ -7635,10 +7909,22 @@ Usage:
|
|
|
7635
7909
|
} catch {
|
|
7636
7910
|
}
|
|
7637
7911
|
}
|
|
7912
|
+
try {
|
|
7913
|
+
appendSnapshot(USAGE_LOG2, await fetchCodexUsage());
|
|
7914
|
+
} catch (err) {
|
|
7915
|
+
if (err instanceof CodexApiError && (err.code === "no_auth" || err.code === "api_key_only")) {
|
|
7916
|
+
} else {
|
|
7917
|
+
console.warn(
|
|
7918
|
+
`codex usage: ${err.message}`
|
|
7919
|
+
);
|
|
7920
|
+
}
|
|
7921
|
+
}
|
|
7638
7922
|
try {
|
|
7639
7923
|
appendSnapshot(USAGE_LOG2, await fetchGrokUsage());
|
|
7640
7924
|
} catch (err) {
|
|
7641
|
-
if (
|
|
7925
|
+
if (err instanceof GrokApiError && err.code === "no_auth") {
|
|
7926
|
+
} else {
|
|
7927
|
+
console.warn(`grok usage: ${err.message}`);
|
|
7642
7928
|
}
|
|
7643
7929
|
}
|
|
7644
7930
|
}
|
|
@@ -7657,6 +7943,7 @@ var init_usage = __esm({
|
|
|
7657
7943
|
"use strict";
|
|
7658
7944
|
init_api();
|
|
7659
7945
|
init_grok2();
|
|
7946
|
+
init_codex2();
|
|
7660
7947
|
init_format();
|
|
7661
7948
|
init_storage();
|
|
7662
7949
|
init_fs();
|
|
@@ -8988,11 +9275,11 @@ var init_dist2 = __esm({
|
|
|
8988
9275
|
});
|
|
8989
9276
|
|
|
8990
9277
|
// ../entries/dist/digest-fs.js
|
|
8991
|
-
import { readFileSync as
|
|
9278
|
+
import { readFileSync as readFileSync13, readdirSync, writeFileSync as writeFileSync7, renameSync as renameSync2, chmodSync, mkdirSync as mkdirSync6, existsSync as existsSync10 } from "node:fs";
|
|
8992
9279
|
import { dirname as dirname8, join as join8 } from "node:path";
|
|
8993
|
-
function parseDigestFile(
|
|
9280
|
+
function parseDigestFile(path10, expectedVersion) {
|
|
8994
9281
|
try {
|
|
8995
|
-
const parsed = JSON.parse(
|
|
9282
|
+
const parsed = JSON.parse(readFileSync13(path10, "utf8"));
|
|
8996
9283
|
if (!parsed || typeof parsed !== "object")
|
|
8997
9284
|
return null;
|
|
8998
9285
|
if (parsed.version !== expectedVersion)
|
|
@@ -9011,11 +9298,11 @@ function digestsDir() {
|
|
|
9011
9298
|
digestsDirCached = envOverride ?? cclensPath("digests");
|
|
9012
9299
|
return digestsDirCached;
|
|
9013
9300
|
}
|
|
9014
|
-
function __setDigestsDirForTest(
|
|
9015
|
-
digestsDirCached =
|
|
9016
|
-
mkdirSync6(join8(
|
|
9017
|
-
mkdirSync6(join8(
|
|
9018
|
-
mkdirSync6(join8(
|
|
9301
|
+
function __setDigestsDirForTest(path10) {
|
|
9302
|
+
digestsDirCached = path10;
|
|
9303
|
+
mkdirSync6(join8(path10, "day"), { recursive: true });
|
|
9304
|
+
mkdirSync6(join8(path10, "week"), { recursive: true });
|
|
9305
|
+
mkdirSync6(join8(path10, "month"), { recursive: true });
|
|
9019
9306
|
}
|
|
9020
9307
|
function dayDigestPath(date) {
|
|
9021
9308
|
return join8(digestsDir(), "day", `${date}.json`);
|
|
@@ -9030,7 +9317,7 @@ function writeDayDigest(digest2) {
|
|
|
9030
9317
|
const final = dayDigestPath(digest2.key);
|
|
9031
9318
|
mkdirSync6(dirname8(final), { recursive: true });
|
|
9032
9319
|
const tmp = `${final}.tmp`;
|
|
9033
|
-
|
|
9320
|
+
writeFileSync7(tmp, JSON.stringify(digest2, null, 2), "utf8");
|
|
9034
9321
|
if (process.platform !== "win32") {
|
|
9035
9322
|
try {
|
|
9036
9323
|
chmodSync(tmp, 384);
|
|
@@ -9041,7 +9328,7 @@ function writeDayDigest(digest2) {
|
|
|
9041
9328
|
}
|
|
9042
9329
|
function readDayDigest(date) {
|
|
9043
9330
|
const p = dayDigestPath(date);
|
|
9044
|
-
if (!
|
|
9331
|
+
if (!existsSync10(p))
|
|
9045
9332
|
return null;
|
|
9046
9333
|
return parseDigestFile(p, CURRENT_DAY_DIGEST_SCHEMA_VERSION);
|
|
9047
9334
|
}
|
|
@@ -9066,7 +9353,7 @@ function writeWeekDigest(digest2) {
|
|
|
9066
9353
|
const final = weekDigestPath(digest2.key);
|
|
9067
9354
|
mkdirSync6(dirname8(final), { recursive: true });
|
|
9068
9355
|
const tmp = `${final}.tmp`;
|
|
9069
|
-
|
|
9356
|
+
writeFileSync7(tmp, JSON.stringify(digest2, null, 2), "utf8");
|
|
9070
9357
|
if (process.platform !== "win32") {
|
|
9071
9358
|
try {
|
|
9072
9359
|
chmodSync(tmp, 384);
|
|
@@ -9077,13 +9364,13 @@ function writeWeekDigest(digest2) {
|
|
|
9077
9364
|
}
|
|
9078
9365
|
function readWeekDigest(monday) {
|
|
9079
9366
|
const p = weekDigestPath(monday);
|
|
9080
|
-
if (!
|
|
9367
|
+
if (!existsSync10(p))
|
|
9081
9368
|
return null;
|
|
9082
9369
|
return parseDigestFile(p, CURRENT_WEEK_DIGEST_SCHEMA_VERSION);
|
|
9083
9370
|
}
|
|
9084
9371
|
function listWeekDigestKeys() {
|
|
9085
9372
|
const dir = join8(digestsDir(), "week");
|
|
9086
|
-
if (!
|
|
9373
|
+
if (!existsSync10(dir))
|
|
9087
9374
|
return [];
|
|
9088
9375
|
return readdirSync(dir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length)).filter((k) => /^\d{4}-\d{2}-\d{2}$/.test(k));
|
|
9089
9376
|
}
|
|
@@ -9103,7 +9390,7 @@ function writeMonthDigest(digest2) {
|
|
|
9103
9390
|
const final = monthDigestPath(digest2.key);
|
|
9104
9391
|
mkdirSync6(dirname8(final), { recursive: true });
|
|
9105
9392
|
const tmp = `${final}.tmp`;
|
|
9106
|
-
|
|
9393
|
+
writeFileSync7(tmp, JSON.stringify(digest2, null, 2), "utf8");
|
|
9107
9394
|
if (process.platform !== "win32") {
|
|
9108
9395
|
try {
|
|
9109
9396
|
chmodSync(tmp, 384);
|
|
@@ -9114,13 +9401,13 @@ function writeMonthDigest(digest2) {
|
|
|
9114
9401
|
}
|
|
9115
9402
|
function readMonthDigest(yearMonth) {
|
|
9116
9403
|
const p = monthDigestPath(yearMonth);
|
|
9117
|
-
if (!
|
|
9404
|
+
if (!existsSync10(p))
|
|
9118
9405
|
return null;
|
|
9119
9406
|
return parseDigestFile(p, CURRENT_MONTH_DIGEST_SCHEMA_VERSION);
|
|
9120
9407
|
}
|
|
9121
9408
|
function listMonthDigestKeys() {
|
|
9122
9409
|
const dir = join8(digestsDir(), "month");
|
|
9123
|
-
if (!
|
|
9410
|
+
if (!existsSync10(dir))
|
|
9124
9411
|
return [];
|
|
9125
9412
|
return readdirSync(dir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length)).filter((k) => /^\d{4}-\d{2}$/.test(k));
|
|
9126
9413
|
}
|
|
@@ -9182,7 +9469,7 @@ __export(fs_exports2, {
|
|
|
9182
9469
|
writeMonthDigest: () => writeMonthDigest,
|
|
9183
9470
|
writeWeekDigest: () => writeWeekDigest
|
|
9184
9471
|
});
|
|
9185
|
-
import { readFileSync as
|
|
9472
|
+
import { readFileSync as readFileSync14, readdirSync as readdirSync2, writeFileSync as writeFileSync8, mkdirSync as mkdirSync7, renameSync as renameSync3, existsSync as existsSync11 } from "node:fs";
|
|
9186
9473
|
import { randomBytes } from "node:crypto";
|
|
9187
9474
|
import { join as join9 } from "node:path";
|
|
9188
9475
|
function entriesDir() {
|
|
@@ -9192,9 +9479,9 @@ function entriesDir() {
|
|
|
9192
9479
|
entriesDirCached = envOverride ?? cclensPath("entries");
|
|
9193
9480
|
return entriesDirCached;
|
|
9194
9481
|
}
|
|
9195
|
-
function __setEntriesDirForTest(
|
|
9196
|
-
entriesDirCached =
|
|
9197
|
-
mkdirSync7(
|
|
9482
|
+
function __setEntriesDirForTest(path10) {
|
|
9483
|
+
entriesDirCached = path10;
|
|
9484
|
+
mkdirSync7(path10, { recursive: true });
|
|
9198
9485
|
}
|
|
9199
9486
|
function pathFor(sessionId, localDay2) {
|
|
9200
9487
|
return join9(entriesDir(), `${entryKey(sessionId, localDay2)}.json`);
|
|
@@ -9208,7 +9495,7 @@ function writeEntry(entry) {
|
|
|
9208
9495
|
const final = pathFor(entry.session_id, entry.local_day);
|
|
9209
9496
|
const tmp = tmpPathFor(final);
|
|
9210
9497
|
const json = JSON.stringify(entry, null, 2);
|
|
9211
|
-
|
|
9498
|
+
writeFileSync8(tmp, json, { encoding: "utf8" });
|
|
9212
9499
|
renameSync3(tmp, final);
|
|
9213
9500
|
}
|
|
9214
9501
|
function enrichmentInputHash(e) {
|
|
@@ -9236,22 +9523,22 @@ function writeEntryPreservingEnrichment(fresh) {
|
|
|
9236
9523
|
toWrite = { ...fresh, enrichment: existing.enrichment };
|
|
9237
9524
|
}
|
|
9238
9525
|
const tmp = tmpPathFor(final);
|
|
9239
|
-
|
|
9526
|
+
writeFileSync8(tmp, JSON.stringify(toWrite, null, 2), { encoding: "utf8" });
|
|
9240
9527
|
renameSync3(tmp, final);
|
|
9241
9528
|
}
|
|
9242
9529
|
function readEntry(sessionId, localDay2) {
|
|
9243
9530
|
const p = pathFor(sessionId, localDay2);
|
|
9244
|
-
if (!
|
|
9531
|
+
if (!existsSync11(p))
|
|
9245
9532
|
return null;
|
|
9246
|
-
const raw =
|
|
9533
|
+
const raw = readFileSync14(p, "utf8");
|
|
9247
9534
|
return JSON.parse(raw);
|
|
9248
9535
|
}
|
|
9249
9536
|
function entryExists(sessionId, localDay2) {
|
|
9250
|
-
return
|
|
9537
|
+
return existsSync11(pathFor(sessionId, localDay2));
|
|
9251
9538
|
}
|
|
9252
9539
|
function listEntryKeys() {
|
|
9253
9540
|
const dir = entriesDir();
|
|
9254
|
-
if (!
|
|
9541
|
+
if (!existsSync11(dir))
|
|
9255
9542
|
return [];
|
|
9256
9543
|
return readdirSync2(dir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
9257
9544
|
}
|
|
@@ -9733,8 +10020,8 @@ var init_parseUtil = __esm({
|
|
|
9733
10020
|
init_errors();
|
|
9734
10021
|
init_en();
|
|
9735
10022
|
makeIssue = (params) => {
|
|
9736
|
-
const { data, path:
|
|
9737
|
-
const fullPath = [...
|
|
10023
|
+
const { data, path: path10, errorMaps, issueData } = params;
|
|
10024
|
+
const fullPath = [...path10, ...issueData.path || []];
|
|
9738
10025
|
const fullIssue = {
|
|
9739
10026
|
...issueData,
|
|
9740
10027
|
path: fullPath
|
|
@@ -10042,11 +10329,11 @@ var init_types3 = __esm({
|
|
|
10042
10329
|
init_parseUtil();
|
|
10043
10330
|
init_util();
|
|
10044
10331
|
ParseInputLazyPath = class {
|
|
10045
|
-
constructor(parent, value,
|
|
10332
|
+
constructor(parent, value, path10, key) {
|
|
10046
10333
|
this._cachedPath = [];
|
|
10047
10334
|
this.parent = parent;
|
|
10048
10335
|
this.data = value;
|
|
10049
|
-
this._path =
|
|
10336
|
+
this._path = path10;
|
|
10050
10337
|
this._key = key;
|
|
10051
10338
|
}
|
|
10052
10339
|
get path() {
|
|
@@ -13530,7 +13817,7 @@ RESPOND WITH ONLY VALID JSON (no prose, no code fence):
|
|
|
13530
13817
|
});
|
|
13531
13818
|
|
|
13532
13819
|
// ../entries/dist/tmux-runner.js
|
|
13533
|
-
import { mkdirSync as mkdirSync8, writeFileSync as
|
|
13820
|
+
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync9, existsSync as existsSync12, readdirSync as readdirSync3, realpathSync as realpathSync5, readFileSync as readFileSync15, unlinkSync as unlinkSync3, renameSync as renameSync4 } from "node:fs";
|
|
13534
13821
|
import { join as join10 } from "node:path";
|
|
13535
13822
|
import { homedir as homedir5 } from "node:os";
|
|
13536
13823
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
@@ -13549,7 +13836,7 @@ function tmuxRunnerAvailable() {
|
|
|
13549
13836
|
}
|
|
13550
13837
|
function runtimeCwd() {
|
|
13551
13838
|
const dir = join10(homedir5(), ".cclens", "runtime");
|
|
13552
|
-
if (!
|
|
13839
|
+
if (!existsSync12(dir))
|
|
13553
13840
|
mkdirSync8(dir, { recursive: true });
|
|
13554
13841
|
return realpathSync5(dir);
|
|
13555
13842
|
}
|
|
@@ -13557,7 +13844,7 @@ function ensureRuntimeCwdTrusted(cwd) {
|
|
|
13557
13844
|
const cfgPath = join10(homedir5(), ".claude.json");
|
|
13558
13845
|
let cfg;
|
|
13559
13846
|
try {
|
|
13560
|
-
cfg = JSON.parse(
|
|
13847
|
+
cfg = JSON.parse(readFileSync15(cfgPath, "utf8"));
|
|
13561
13848
|
} catch {
|
|
13562
13849
|
return;
|
|
13563
13850
|
}
|
|
@@ -13572,7 +13859,7 @@ function ensureRuntimeCwdTrusted(cwd) {
|
|
|
13572
13859
|
cfg.projects = projects;
|
|
13573
13860
|
const tmp = `${cfgPath}.cclens-tmp-${process.pid}`;
|
|
13574
13861
|
try {
|
|
13575
|
-
|
|
13862
|
+
writeFileSync9(tmp, JSON.stringify(cfg, null, 2));
|
|
13576
13863
|
renameSync4(tmp, cfgPath);
|
|
13577
13864
|
} catch {
|
|
13578
13865
|
try {
|
|
@@ -13602,13 +13889,13 @@ async function runClaudeUnderTmuxImpl(args2) {
|
|
|
13602
13889
|
const systemFile = join10(cwd, `system-${runId}.txt`);
|
|
13603
13890
|
const userFile = join10(cwd, `user-${runId}.txt`);
|
|
13604
13891
|
const wrapper = join10(cwd, `run-${runId}.sh`);
|
|
13605
|
-
|
|
13606
|
-
|
|
13892
|
+
writeFileSync9(systemFile, args2.systemPrompt);
|
|
13893
|
+
writeFileSync9(userFile, args2.reminder ? `${args2.userPrompt}
|
|
13607
13894
|
|
|
13608
13895
|
---
|
|
13609
13896
|
|
|
13610
13897
|
${args2.reminder}` : args2.userPrompt);
|
|
13611
|
-
|
|
13898
|
+
writeFileSync9(wrapper, `#!/bin/bash
|
|
13612
13899
|
SYS="$(cat ${shellEscape(systemFile)})"
|
|
13613
13900
|
USR="$(cat ${shellEscape(userFile)})"
|
|
13614
13901
|
exec ${shellEscape(claudeBin)} \\
|
|
@@ -13704,10 +13991,10 @@ function snapshotAllTranscripts() {
|
|
|
13704
13991
|
}
|
|
13705
13992
|
return out;
|
|
13706
13993
|
}
|
|
13707
|
-
function readJsonlCwd(
|
|
13994
|
+
function readJsonlCwd(path10, maxLines = 8) {
|
|
13708
13995
|
let raw;
|
|
13709
13996
|
try {
|
|
13710
|
-
raw =
|
|
13997
|
+
raw = readFileSync15(path10, "utf8");
|
|
13711
13998
|
} catch {
|
|
13712
13999
|
return void 0;
|
|
13713
14000
|
}
|
|
@@ -13761,10 +14048,10 @@ async function discoverTranscript(targetCwd, existingBefore, startMs, timeoutMs,
|
|
|
13761
14048
|
}
|
|
13762
14049
|
throw new TmuxRunError(`timeout waiting for claude to create the session transcript (cwd: ${targetCwd})`);
|
|
13763
14050
|
}
|
|
13764
|
-
function parseTranscript2(
|
|
14051
|
+
function parseTranscript2(path10, defaultModel) {
|
|
13765
14052
|
let raw;
|
|
13766
14053
|
try {
|
|
13767
|
-
raw =
|
|
14054
|
+
raw = readFileSync15(path10, "utf8");
|
|
13768
14055
|
} catch {
|
|
13769
14056
|
return { assembled: "", inputTokens: 0, outputTokens: 0, modelUsed: defaultModel, done: false };
|
|
13770
14057
|
}
|
|
@@ -13858,11 +14145,11 @@ var init_tmux_runner = __esm({
|
|
|
13858
14145
|
|
|
13859
14146
|
// ../entries/dist/llm-runner.js
|
|
13860
14147
|
import { spawn as spawn3 } from "node:child_process";
|
|
13861
|
-
import { mkdirSync as mkdirSync9, appendFileSync as appendFileSync3, writeFileSync as
|
|
14148
|
+
import { mkdirSync as mkdirSync9, appendFileSync as appendFileSync3, writeFileSync as writeFileSync10, existsSync as existsSync13 } from "node:fs";
|
|
13862
14149
|
import { join as join11 } from "node:path";
|
|
13863
14150
|
import { randomUUID } from "node:crypto";
|
|
13864
14151
|
function ensureRunsDir() {
|
|
13865
|
-
if (!
|
|
14152
|
+
if (!existsSync13(RUNS_DIR)) {
|
|
13866
14153
|
try {
|
|
13867
14154
|
mkdirSync9(RUNS_DIR, { recursive: true });
|
|
13868
14155
|
} catch {
|
|
@@ -13893,15 +14180,15 @@ function newRunId(kind) {
|
|
|
13893
14180
|
function tracePath(runId) {
|
|
13894
14181
|
return join11(RUNS_DIR, `${runId}.jsonl`);
|
|
13895
14182
|
}
|
|
13896
|
-
function safeAppend(
|
|
14183
|
+
function safeAppend(path10, line) {
|
|
13897
14184
|
try {
|
|
13898
|
-
appendFileSync3(
|
|
14185
|
+
appendFileSync3(path10, line);
|
|
13899
14186
|
} catch {
|
|
13900
14187
|
}
|
|
13901
14188
|
}
|
|
13902
|
-
function safeWrite(
|
|
14189
|
+
function safeWrite(path10, line) {
|
|
13903
14190
|
try {
|
|
13904
|
-
|
|
14191
|
+
writeFileSync10(path10, line);
|
|
13905
14192
|
} catch {
|
|
13906
14193
|
}
|
|
13907
14194
|
}
|
|
@@ -14307,7 +14594,7 @@ var init_enrich2 = __esm({
|
|
|
14307
14594
|
});
|
|
14308
14595
|
|
|
14309
14596
|
// ../entries/dist/budget.js
|
|
14310
|
-
import { appendFileSync as appendFileSync4, readFileSync as
|
|
14597
|
+
import { appendFileSync as appendFileSync4, readFileSync as readFileSync16, existsSync as existsSync14, mkdirSync as mkdirSync10 } from "node:fs";
|
|
14311
14598
|
import { dirname as dirname9 } from "node:path";
|
|
14312
14599
|
function spendPath() {
|
|
14313
14600
|
if (spendPathCached)
|
|
@@ -14315,8 +14602,8 @@ function spendPath() {
|
|
|
14315
14602
|
spendPathCached = cclensPath("llm-spend.jsonl");
|
|
14316
14603
|
return spendPathCached;
|
|
14317
14604
|
}
|
|
14318
|
-
function __setSpendPathForTest(
|
|
14319
|
-
spendPathCached =
|
|
14605
|
+
function __setSpendPathForTest(path10) {
|
|
14606
|
+
spendPathCached = path10;
|
|
14320
14607
|
}
|
|
14321
14608
|
function appendSpend(record) {
|
|
14322
14609
|
const p = spendPath();
|
|
@@ -14325,12 +14612,12 @@ function appendSpend(record) {
|
|
|
14325
14612
|
}
|
|
14326
14613
|
function monthToDateSpend(now = /* @__PURE__ */ new Date()) {
|
|
14327
14614
|
const p = spendPath();
|
|
14328
|
-
if (!
|
|
14615
|
+
if (!existsSync14(p))
|
|
14329
14616
|
return 0;
|
|
14330
14617
|
const year = now.getUTCFullYear();
|
|
14331
14618
|
const month2 = now.getUTCMonth();
|
|
14332
14619
|
let total = 0;
|
|
14333
|
-
const raw =
|
|
14620
|
+
const raw = readFileSync16(p, "utf8");
|
|
14334
14621
|
for (const line of raw.split("\n")) {
|
|
14335
14622
|
if (!line)
|
|
14336
14623
|
continue;
|
|
@@ -14359,18 +14646,18 @@ var init_budget = __esm({
|
|
|
14359
14646
|
});
|
|
14360
14647
|
|
|
14361
14648
|
// ../entries/dist/pipeline-lock.js
|
|
14362
|
-
import { writeFileSync as
|
|
14649
|
+
import { writeFileSync as writeFileSync11, unlinkSync as unlinkSync4, existsSync as existsSync15, readFileSync as readFileSync17, statSync as statSync3 } from "node:fs";
|
|
14363
14650
|
function lockPath() {
|
|
14364
14651
|
if (lockPathCached)
|
|
14365
14652
|
return lockPathCached;
|
|
14366
14653
|
lockPathCached = cclensPath("llm-interactive.lock");
|
|
14367
14654
|
return lockPathCached;
|
|
14368
14655
|
}
|
|
14369
|
-
function __setInteractiveLockPathForTest(
|
|
14370
|
-
lockPathCached =
|
|
14656
|
+
function __setInteractiveLockPathForTest(path10) {
|
|
14657
|
+
lockPathCached = path10;
|
|
14371
14658
|
}
|
|
14372
14659
|
function touchLock() {
|
|
14373
|
-
|
|
14660
|
+
writeFileSync11(lockPath(), String(process.pid), "utf8");
|
|
14374
14661
|
}
|
|
14375
14662
|
function writeInteractiveLock() {
|
|
14376
14663
|
touchLock();
|
|
@@ -14404,13 +14691,13 @@ function pidAlive(pid) {
|
|
|
14404
14691
|
}
|
|
14405
14692
|
function interactiveLockFresh(nowMs) {
|
|
14406
14693
|
const p = lockPath();
|
|
14407
|
-
if (!
|
|
14694
|
+
if (!existsSync15(p))
|
|
14408
14695
|
return false;
|
|
14409
14696
|
try {
|
|
14410
14697
|
const mtime = statSync3(p).mtimeMs;
|
|
14411
14698
|
if (nowMs - mtime > STALE_MS)
|
|
14412
14699
|
return false;
|
|
14413
|
-
const pid = Number(
|
|
14700
|
+
const pid = Number(readFileSync17(p, "utf8").trim());
|
|
14414
14701
|
if (!Number.isFinite(pid) || pid <= 0)
|
|
14415
14702
|
return false;
|
|
14416
14703
|
if (!pidAlive(pid))
|
|
@@ -14516,7 +14803,7 @@ var init_queue = __esm({
|
|
|
14516
14803
|
});
|
|
14517
14804
|
|
|
14518
14805
|
// ../entries/dist/settings.js
|
|
14519
|
-
import { readFileSync as
|
|
14806
|
+
import { readFileSync as readFileSync18, writeFileSync as writeFileSync12, renameSync as renameSync5, chmodSync as chmodSync2, mkdirSync as mkdirSync11, existsSync as existsSync16 } from "node:fs";
|
|
14520
14807
|
import { dirname as dirname10 } from "node:path";
|
|
14521
14808
|
function settingsPath() {
|
|
14522
14809
|
if (settingsPathCached)
|
|
@@ -14524,8 +14811,8 @@ function settingsPath() {
|
|
|
14524
14811
|
settingsPathCached = cclensPath("settings.json");
|
|
14525
14812
|
return settingsPathCached;
|
|
14526
14813
|
}
|
|
14527
|
-
function __setSettingsPathForTest(
|
|
14528
|
-
settingsPathCached =
|
|
14814
|
+
function __setSettingsPathForTest(path10) {
|
|
14815
|
+
settingsPathCached = path10;
|
|
14529
14816
|
}
|
|
14530
14817
|
function toDisk(s) {
|
|
14531
14818
|
return {
|
|
@@ -14552,10 +14839,10 @@ function fromDisk(d) {
|
|
|
14552
14839
|
}
|
|
14553
14840
|
function readSettings() {
|
|
14554
14841
|
const p = settingsPath();
|
|
14555
|
-
if (!
|
|
14842
|
+
if (!existsSync16(p))
|
|
14556
14843
|
return DEFAULT_SETTINGS;
|
|
14557
14844
|
try {
|
|
14558
|
-
const raw =
|
|
14845
|
+
const raw = readFileSync18(p, "utf8");
|
|
14559
14846
|
return fromDisk(JSON.parse(raw));
|
|
14560
14847
|
} catch {
|
|
14561
14848
|
return DEFAULT_SETTINGS;
|
|
@@ -14565,7 +14852,7 @@ function writeSettings(s) {
|
|
|
14565
14852
|
const p = settingsPath();
|
|
14566
14853
|
mkdirSync11(dirname10(p), { recursive: true });
|
|
14567
14854
|
const tmp = `${p}.tmp`;
|
|
14568
|
-
|
|
14855
|
+
writeFileSync12(tmp, JSON.stringify(toDisk(s), null, 2), { encoding: "utf8" });
|
|
14569
14856
|
if (process.platform !== "win32") {
|
|
14570
14857
|
chmodSync2(tmp, 384);
|
|
14571
14858
|
}
|
|
@@ -17745,7 +18032,7 @@ var init_digest_month_pipeline = __esm({
|
|
|
17745
18032
|
});
|
|
17746
18033
|
|
|
17747
18034
|
// ../entries/dist/credentials.js
|
|
17748
|
-
import { writeFileSync as
|
|
18035
|
+
import { writeFileSync as writeFileSync13, readFileSync as readFileSync19, renameSync as renameSync6, chmodSync as chmodSync3, mkdirSync as mkdirSync12, existsSync as existsSync17, unlinkSync as unlinkSync5 } from "node:fs";
|
|
17749
18036
|
import { dirname as dirname11 } from "node:path";
|
|
17750
18037
|
async function fetchZaiUsage(candidate) {
|
|
17751
18038
|
const key = candidate.trim();
|
|
@@ -17816,10 +18103,10 @@ function credentialsPath() {
|
|
|
17816
18103
|
}
|
|
17817
18104
|
function readCredentials() {
|
|
17818
18105
|
const p = credentialsPath();
|
|
17819
|
-
if (!
|
|
18106
|
+
if (!existsSync17(p))
|
|
17820
18107
|
return {};
|
|
17821
18108
|
try {
|
|
17822
|
-
const raw =
|
|
18109
|
+
const raw = readFileSync19(p, "utf8");
|
|
17823
18110
|
return JSON.parse(raw);
|
|
17824
18111
|
} catch {
|
|
17825
18112
|
return {};
|
|
@@ -17844,7 +18131,7 @@ function writeZaiKey(apiKey) {
|
|
|
17844
18131
|
const p = credentialsPath();
|
|
17845
18132
|
mkdirSync12(dirname11(p), { recursive: true });
|
|
17846
18133
|
const tmp = `${p}.tmp`;
|
|
17847
|
-
|
|
18134
|
+
writeFileSync13(tmp, JSON.stringify(store, null, 2), { encoding: "utf8" });
|
|
17848
18135
|
if (process.platform !== "win32") {
|
|
17849
18136
|
chmodSync3(tmp, 384);
|
|
17850
18137
|
}
|
|
@@ -17862,7 +18149,7 @@ function deleteZaiKey() {
|
|
|
17862
18149
|
return;
|
|
17863
18150
|
}
|
|
17864
18151
|
const tmp = `${p}.tmp`;
|
|
17865
|
-
|
|
18152
|
+
writeFileSync13(tmp, JSON.stringify(store, null, 2), { encoding: "utf8" });
|
|
17866
18153
|
if (process.platform !== "win32") {
|
|
17867
18154
|
chmodSync3(tmp, 384);
|
|
17868
18155
|
}
|
|
@@ -18449,7 +18736,7 @@ var menubar_exports = {};
|
|
|
18449
18736
|
__export(menubar_exports, {
|
|
18450
18737
|
menubar: () => menubar
|
|
18451
18738
|
});
|
|
18452
|
-
import { existsSync as
|
|
18739
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync13, cpSync, rmSync as rmSync2, readdirSync as readdirSync4, writeFileSync as writeFileSync14, realpathSync as realpathSync6 } from "node:fs";
|
|
18453
18740
|
import { homedir as homedir6 } from "node:os";
|
|
18454
18741
|
import { join as join12, dirname as dirname12 } from "node:path";
|
|
18455
18742
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
@@ -18472,7 +18759,7 @@ function resolveScriptPath2() {
|
|
|
18472
18759
|
}
|
|
18473
18760
|
function writeCliLaunchFile() {
|
|
18474
18761
|
try {
|
|
18475
|
-
|
|
18762
|
+
writeFileSync14(
|
|
18476
18763
|
cclensPath("cli-launch.json"),
|
|
18477
18764
|
JSON.stringify({ node: process.execPath, script: resolveScriptPath2() }),
|
|
18478
18765
|
"utf8"
|
|
@@ -18491,8 +18778,8 @@ async function isRunning() {
|
|
|
18491
18778
|
return false;
|
|
18492
18779
|
}
|
|
18493
18780
|
}
|
|
18494
|
-
async function launchApp(
|
|
18495
|
-
await execFileAsync2("open", ["-a",
|
|
18781
|
+
async function launchApp(path10) {
|
|
18782
|
+
await execFileAsync2("open", ["-a", path10]);
|
|
18496
18783
|
}
|
|
18497
18784
|
async function quitApp() {
|
|
18498
18785
|
await execFileAsync2("osascript", ["-e", `tell application "${BUNDLE_EXEC}" to quit`]).catch(
|
|
@@ -18513,7 +18800,7 @@ async function installMenubar(opts) {
|
|
|
18513
18800
|
return;
|
|
18514
18801
|
}
|
|
18515
18802
|
const src = bundledAppPath();
|
|
18516
|
-
if (!
|
|
18803
|
+
if (!existsSync18(src)) {
|
|
18517
18804
|
console.error(
|
|
18518
18805
|
`Bundled widget not found at ${src}.
|
|
18519
18806
|
This install was probably built without the menubar artifact. Run \`node apps/menubar/build-app.sh && cp -R apps/menubar/dist/FleetlensMenubar.app packages/cli/menubar/\` and rebuild.`
|
|
@@ -18555,7 +18842,7 @@ async function uninstallMenubar() {
|
|
|
18555
18842
|
await new Promise((r) => setTimeout(r, 300));
|
|
18556
18843
|
}
|
|
18557
18844
|
const dest = installedAppPath();
|
|
18558
|
-
if (
|
|
18845
|
+
if (existsSync18(dest)) {
|
|
18559
18846
|
rmSync2(dest, { recursive: true, force: true });
|
|
18560
18847
|
console.log(`Removed ${dest}`);
|
|
18561
18848
|
} else {
|
|
@@ -18569,7 +18856,7 @@ async function openMenubar() {
|
|
|
18569
18856
|
return;
|
|
18570
18857
|
}
|
|
18571
18858
|
const dest = installedAppPath();
|
|
18572
|
-
if (!
|
|
18859
|
+
if (!existsSync18(dest)) {
|
|
18573
18860
|
console.log("Widget not installed yet. Run `fleetlens menubar install` first.");
|
|
18574
18861
|
return;
|
|
18575
18862
|
}
|
|
@@ -18586,9 +18873,9 @@ async function statusMenubar() {
|
|
|
18586
18873
|
return;
|
|
18587
18874
|
}
|
|
18588
18875
|
const dest = installedAppPath();
|
|
18589
|
-
const installed =
|
|
18876
|
+
const installed = existsSync18(dest);
|
|
18590
18877
|
const running = await isRunning();
|
|
18591
|
-
const bundled =
|
|
18878
|
+
const bundled = existsSync18(bundledAppPath());
|
|
18592
18879
|
console.log(`Menu bar widget: ${installed ? "installed" : "not installed"}${installed ? ` (${dest})` : ""}`);
|
|
18593
18880
|
console.log(`Running: ${running ? "yes" : "no"}`);
|
|
18594
18881
|
console.log(`Bundled in CLI: ${bundled ? "yes" : "no \u2014 this build ships without the widget"}`);
|
|
@@ -18677,7 +18964,7 @@ var init_config = __esm({
|
|
|
18677
18964
|
});
|
|
18678
18965
|
|
|
18679
18966
|
// src/perception/build-entries.ts
|
|
18680
|
-
import { statSync as statSync4, readFileSync as
|
|
18967
|
+
import { statSync as statSync4, readFileSync as readFileSync20 } from "node:fs";
|
|
18681
18968
|
import { basename as basename2, dirname as dirname13 } from "node:path";
|
|
18682
18969
|
function decodeProjectDirName(projectDir) {
|
|
18683
18970
|
if (projectDir.startsWith("-")) {
|
|
@@ -18687,7 +18974,7 @@ function decodeProjectDirName(projectDir) {
|
|
|
18687
18974
|
}
|
|
18688
18975
|
function buildEntriesForFile(filePath) {
|
|
18689
18976
|
const stat = statSync4(filePath);
|
|
18690
|
-
const raw =
|
|
18977
|
+
const raw = readFileSync20(filePath, "utf8");
|
|
18691
18978
|
const rawLines = raw.split("\n").filter(Boolean).map((l) => {
|
|
18692
18979
|
try {
|
|
18693
18980
|
return JSON.parse(l);
|
|
@@ -18952,7 +19239,7 @@ function buildIngestPayload(inputs) {
|
|
|
18952
19239
|
return {
|
|
18953
19240
|
ingestId: randomUUID2(),
|
|
18954
19241
|
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
18955
|
-
cliVersion: "0.16.
|
|
19242
|
+
cliVersion: "0.16.6",
|
|
18956
19243
|
...richRollup || inputs.enrichedExtras || inputs.artifactSignals ? { schemaVersion: RICH_ROLLUP_SCHEMA_VERSION } : {},
|
|
18957
19244
|
...inputs.rollup ? { dailyRollup: inputs.rollup } : {},
|
|
18958
19245
|
...richRollup ? { richRollup } : {},
|
|
@@ -18993,7 +19280,7 @@ var init_push = __esm({
|
|
|
18993
19280
|
});
|
|
18994
19281
|
|
|
18995
19282
|
// src/team/git-remote.ts
|
|
18996
|
-
import { existsSync as
|
|
19283
|
+
import { existsSync as existsSync19, readFileSync as readFileSync21, statSync as statSync5 } from "node:fs";
|
|
18997
19284
|
import { dirname as dirname14, isAbsolute as isAbsolute2, join as join13, resolve as resolve2 } from "node:path";
|
|
18998
19285
|
function parseGithubRemote(url) {
|
|
18999
19286
|
const m = url.trim().match(GITHUB_URL_RE);
|
|
@@ -19018,12 +19305,12 @@ function gitConfigPathFor(dir) {
|
|
|
19018
19305
|
const st = statSync5(dotGit, { throwIfNoEntry: false });
|
|
19019
19306
|
if (!st) return null;
|
|
19020
19307
|
if (st.isDirectory()) return join13(dotGit, "config");
|
|
19021
|
-
const m =
|
|
19308
|
+
const m = readFileSync21(dotGit, "utf8").match(/^gitdir:\s*(.+)\s*$/m);
|
|
19022
19309
|
if (!m) return null;
|
|
19023
19310
|
const gd = isAbsolute2(m[1]) ? m[1] : resolve2(dir, m[1]);
|
|
19024
19311
|
const commondirFile = join13(gd, "commondir");
|
|
19025
|
-
if (
|
|
19026
|
-
const common =
|
|
19312
|
+
if (existsSync19(commondirFile)) {
|
|
19313
|
+
const common = readFileSync21(commondirFile, "utf8").trim();
|
|
19027
19314
|
return join13(isAbsolute2(common) ? common : resolve2(gd, common), "config");
|
|
19028
19315
|
}
|
|
19029
19316
|
return join13(gd, "config");
|
|
@@ -19038,8 +19325,8 @@ function createRepoResolver() {
|
|
|
19038
19325
|
try {
|
|
19039
19326
|
for (let d = dir; ; d = dirname14(d)) {
|
|
19040
19327
|
const config = gitConfigPathFor(d);
|
|
19041
|
-
if (config &&
|
|
19042
|
-
const url = originUrl2(
|
|
19328
|
+
if (config && existsSync19(config)) {
|
|
19329
|
+
const url = originUrl2(readFileSync21(config, "utf8"));
|
|
19043
19330
|
repo = url ? parseGithubRemote(url) : null;
|
|
19044
19331
|
break;
|
|
19045
19332
|
}
|
|
@@ -19061,7 +19348,7 @@ var init_git_remote = __esm({
|
|
|
19061
19348
|
});
|
|
19062
19349
|
|
|
19063
19350
|
// src/team/queue.ts
|
|
19064
|
-
import { readFileSync as
|
|
19351
|
+
import { readFileSync as readFileSync22, writeFileSync as writeFileSync15, appendFileSync as appendFileSync5, statSync as statSync6, mkdirSync as mkdirSync14 } from "node:fs";
|
|
19065
19352
|
import { dirname as dirname15 } from "node:path";
|
|
19066
19353
|
function enqueuePayload(payload, queuePath = QUEUE_PATH) {
|
|
19067
19354
|
mkdirSync14(dirname15(queuePath), { recursive: true });
|
|
@@ -19078,7 +19365,7 @@ function enqueuePayload(payload, queuePath = QUEUE_PATH) {
|
|
|
19078
19365
|
function dequeuePayloads(queuePath = QUEUE_PATH) {
|
|
19079
19366
|
let lines;
|
|
19080
19367
|
try {
|
|
19081
|
-
lines =
|
|
19368
|
+
lines = readFileSync22(queuePath, "utf8").trim().split("\n").filter(Boolean);
|
|
19082
19369
|
} catch {
|
|
19083
19370
|
return [];
|
|
19084
19371
|
}
|
|
@@ -19093,18 +19380,18 @@ function dequeuePayloads(queuePath = QUEUE_PATH) {
|
|
|
19093
19380
|
} catch {
|
|
19094
19381
|
}
|
|
19095
19382
|
}
|
|
19096
|
-
|
|
19383
|
+
writeFileSync15(queuePath, "", "utf8");
|
|
19097
19384
|
return valid.map((e) => e.payload);
|
|
19098
19385
|
}
|
|
19099
19386
|
function pruneOldest(queuePath) {
|
|
19100
19387
|
let lines;
|
|
19101
19388
|
try {
|
|
19102
|
-
lines =
|
|
19389
|
+
lines = readFileSync22(queuePath, "utf8").trim().split("\n").filter(Boolean);
|
|
19103
19390
|
} catch {
|
|
19104
19391
|
return;
|
|
19105
19392
|
}
|
|
19106
19393
|
const keep = lines.slice(Math.floor(lines.length / 2));
|
|
19107
|
-
|
|
19394
|
+
writeFileSync15(queuePath, keep.join("\n") + "\n", "utf8");
|
|
19108
19395
|
}
|
|
19109
19396
|
var QUEUE_PATH, MAX_SIZE_BYTES, MAX_AGE_MS;
|
|
19110
19397
|
var init_queue2 = __esm({
|
|
@@ -19118,7 +19405,7 @@ var init_queue2 = __esm({
|
|
|
19118
19405
|
});
|
|
19119
19406
|
|
|
19120
19407
|
// src/usage/profile.ts
|
|
19121
|
-
import { existsSync as
|
|
19408
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync15, readFileSync as readFileSync23, writeFileSync as writeFileSync16 } from "node:fs";
|
|
19122
19409
|
import { dirname as dirname16 } from "node:path";
|
|
19123
19410
|
function mapRateLimitTier(rateLimitTier) {
|
|
19124
19411
|
switch (rateLimitTier) {
|
|
@@ -19159,9 +19446,9 @@ async function fetchProfile(nowMs = Date.now()) {
|
|
|
19159
19446
|
};
|
|
19160
19447
|
}
|
|
19161
19448
|
function readCachedProfile(cachePath) {
|
|
19162
|
-
if (!
|
|
19449
|
+
if (!existsSync20(cachePath)) return null;
|
|
19163
19450
|
try {
|
|
19164
|
-
const raw = JSON.parse(
|
|
19451
|
+
const raw = JSON.parse(readFileSync23(cachePath, "utf8"));
|
|
19165
19452
|
if (typeof raw.fetchedAtMs !== "number" || !raw.profile) return null;
|
|
19166
19453
|
return raw;
|
|
19167
19454
|
} catch {
|
|
@@ -19170,7 +19457,7 @@ function readCachedProfile(cachePath) {
|
|
|
19170
19457
|
}
|
|
19171
19458
|
function writeCachedProfile(cachePath, profile, nowMs = Date.now()) {
|
|
19172
19459
|
mkdirSync15(dirname16(cachePath), { recursive: true });
|
|
19173
|
-
|
|
19460
|
+
writeFileSync16(
|
|
19174
19461
|
cachePath,
|
|
19175
19462
|
JSON.stringify({ fetchedAtMs: nowMs, profile }, null, 2),
|
|
19176
19463
|
{ mode: 384 }
|
|
@@ -19350,11 +19637,11 @@ var init_backfill = __esm({
|
|
|
19350
19637
|
});
|
|
19351
19638
|
|
|
19352
19639
|
// src/team/sync-log.ts
|
|
19353
|
-
import { readFileSync as
|
|
19640
|
+
import { readFileSync as readFileSync24 } from "node:fs";
|
|
19354
19641
|
function readPendingSyncLog(watermark) {
|
|
19355
19642
|
let raw;
|
|
19356
19643
|
try {
|
|
19357
|
-
raw =
|
|
19644
|
+
raw = readFileSync24(cclensPath("daemon.log"), "utf8");
|
|
19358
19645
|
} catch {
|
|
19359
19646
|
return { lines: [] };
|
|
19360
19647
|
}
|
|
@@ -19382,12 +19669,12 @@ var init_sync_log = __esm({
|
|
|
19382
19669
|
});
|
|
19383
19670
|
|
|
19384
19671
|
// src/team/last-push.ts
|
|
19385
|
-
import { writeFileSync as
|
|
19672
|
+
import { writeFileSync as writeFileSync17, unlinkSync as unlinkSync6, mkdirSync as mkdirSync16 } from "node:fs";
|
|
19386
19673
|
import { join as join14 } from "node:path";
|
|
19387
19674
|
function write(record, dir) {
|
|
19388
19675
|
const d = dir ?? cclensHome();
|
|
19389
19676
|
mkdirSync16(d, { recursive: true });
|
|
19390
|
-
|
|
19677
|
+
writeFileSync17(join14(d, LAST_PUSH_FILE), JSON.stringify(record, null, 2), { mode: 384 });
|
|
19391
19678
|
}
|
|
19392
19679
|
function writeLastPushSuccess(payload, dir) {
|
|
19393
19680
|
write({ pushedAt: (/* @__PURE__ */ new Date()).toISOString(), ok: true, payload }, dir);
|
|
@@ -19418,7 +19705,7 @@ __export(file_probe_exports, {
|
|
|
19418
19705
|
probeArtifactSignals: () => probeArtifactSignals
|
|
19419
19706
|
});
|
|
19420
19707
|
import { createHash } from "node:crypto";
|
|
19421
|
-
import { existsSync as
|
|
19708
|
+
import { existsSync as existsSync21, readdirSync as readdirSync5, statSync as statSync7 } from "node:fs";
|
|
19422
19709
|
import { homedir as homedir7 } from "node:os";
|
|
19423
19710
|
import { join as join15, relative, resolve as resolve3, sep } from "node:path";
|
|
19424
19711
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
@@ -19428,15 +19715,15 @@ function pathHash(relPath) {
|
|
|
19428
19715
|
function defaultScanRoots(extraRoots = []) {
|
|
19429
19716
|
const roots = [];
|
|
19430
19717
|
const home = join15(homedir7(), ".claude");
|
|
19431
|
-
if (
|
|
19718
|
+
if (existsSync21(home)) roots.push({ root: home, label: "user" });
|
|
19432
19719
|
for (const e of extraRoots) {
|
|
19433
19720
|
const r = resolve3(e, ".claude");
|
|
19434
|
-
if (
|
|
19721
|
+
if (existsSync21(r) && r !== home) roots.push({ root: r, label: "project" });
|
|
19435
19722
|
}
|
|
19436
19723
|
return roots;
|
|
19437
19724
|
}
|
|
19438
19725
|
function listMarkdownFiles(dir) {
|
|
19439
|
-
if (!
|
|
19726
|
+
if (!existsSync21(dir)) return [];
|
|
19440
19727
|
const out = [];
|
|
19441
19728
|
let entries2;
|
|
19442
19729
|
try {
|
|
@@ -19506,7 +19793,7 @@ function scanAuthored(roots, subdir, day2) {
|
|
|
19506
19793
|
const out = [];
|
|
19507
19794
|
for (const r of roots) {
|
|
19508
19795
|
const dir = join15(r.root, subdir);
|
|
19509
|
-
if (!
|
|
19796
|
+
if (!existsSync21(dir)) continue;
|
|
19510
19797
|
for (const f of listMarkdownFiles(dir)) {
|
|
19511
19798
|
const firstSeen = firstSeenDateOf(f);
|
|
19512
19799
|
if (firstSeen !== day2) continue;
|
|
@@ -19520,7 +19807,7 @@ function scanEdited(roots, day2) {
|
|
|
19520
19807
|
const out = [];
|
|
19521
19808
|
for (const r of roots) {
|
|
19522
19809
|
const dir = join15(r.root, "skills");
|
|
19523
|
-
if (!
|
|
19810
|
+
if (!existsSync21(dir)) continue;
|
|
19524
19811
|
for (const f of listMarkdownFiles(dir)) {
|
|
19525
19812
|
const firstSeen = firstSeenDateOf(f);
|
|
19526
19813
|
if (firstSeen === day2) continue;
|
|
@@ -19543,10 +19830,10 @@ function claudemdLineDelta(extraRoots, authorEmail, day2) {
|
|
|
19543
19830
|
const candidates = [];
|
|
19544
19831
|
for (const e of extraRoots) {
|
|
19545
19832
|
const f = resolve3(e, "CLAUDE.md");
|
|
19546
|
-
if (
|
|
19833
|
+
if (existsSync21(f)) candidates.push(f);
|
|
19547
19834
|
}
|
|
19548
19835
|
const homeClaudeMd = join15(homedir7(), "CLAUDE.md");
|
|
19549
|
-
if (
|
|
19836
|
+
if (existsSync21(homeClaudeMd)) candidates.push(homeClaudeMd);
|
|
19550
19837
|
for (const file of candidates) {
|
|
19551
19838
|
try {
|
|
19552
19839
|
const out = execFileSync3(
|
|
@@ -20436,11 +20723,11 @@ var logs_exports = {};
|
|
|
20436
20723
|
__export(logs_exports, {
|
|
20437
20724
|
teamLogs: () => teamLogs
|
|
20438
20725
|
});
|
|
20439
|
-
import { readFileSync as
|
|
20726
|
+
import { readFileSync as readFileSync25 } from "node:fs";
|
|
20440
20727
|
async function teamLogs() {
|
|
20441
20728
|
const logPath = cclensPath("daemon.log");
|
|
20442
20729
|
try {
|
|
20443
|
-
const lines =
|
|
20730
|
+
const lines = readFileSync25(logPath, "utf8").trim().split("\n");
|
|
20444
20731
|
const teamLines = lines.filter((l) => l.includes("[sync] ") || l.includes("team "));
|
|
20445
20732
|
if (teamLines.length === 0) {
|
|
20446
20733
|
console.log("No team-related log entries found.");
|
|
@@ -20568,7 +20855,7 @@ __export(runs_exports, {
|
|
|
20568
20855
|
runs: () => runs
|
|
20569
20856
|
});
|
|
20570
20857
|
import { execSync as execSync2 } from "node:child_process";
|
|
20571
|
-
import { existsSync as
|
|
20858
|
+
import { existsSync as existsSync22, readFileSync as readFileSync26, readdirSync as readdirSync6, statSync as statSync8 } from "node:fs";
|
|
20572
20859
|
import { join as join16 } from "node:path";
|
|
20573
20860
|
async function runs(args2) {
|
|
20574
20861
|
const json = args2.includes("--json");
|
|
@@ -20653,8 +20940,8 @@ function listActiveRuns() {
|
|
|
20653
20940
|
return runs2.sort((a, b) => a.elapsed_s - b.elapsed_s);
|
|
20654
20941
|
}
|
|
20655
20942
|
function readSpend(sinceMs) {
|
|
20656
|
-
if (!
|
|
20657
|
-
const lines =
|
|
20943
|
+
if (!existsSync22(SPEND_PATH)) return [];
|
|
20944
|
+
const lines = readFileSync26(SPEND_PATH, "utf-8").split("\n").filter((l) => l.trim());
|
|
20658
20945
|
const out = [];
|
|
20659
20946
|
for (const line of lines) {
|
|
20660
20947
|
try {
|
|
@@ -20775,23 +21062,23 @@ function ageLabel(ms) {
|
|
|
20775
21062
|
return `${Math.floor(ms / 864e5)}d`;
|
|
20776
21063
|
}
|
|
20777
21064
|
function listTraceFiles() {
|
|
20778
|
-
if (!
|
|
21065
|
+
if (!existsSync22(RUNS_DIR2)) return [];
|
|
20779
21066
|
const entries2 = readdirSync6(RUNS_DIR2).filter((f) => f.endsWith(".jsonl"));
|
|
20780
21067
|
return entries2.map((f) => {
|
|
20781
|
-
const
|
|
20782
|
-
const st = statSync8(
|
|
20783
|
-
return { runId: f.replace(/\.jsonl$/, ""), path:
|
|
21068
|
+
const path10 = join16(RUNS_DIR2, f);
|
|
21069
|
+
const st = statSync8(path10);
|
|
21070
|
+
return { runId: f.replace(/\.jsonl$/, ""), path: path10, mtimeMs: st.mtimeMs };
|
|
20784
21071
|
}).sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
20785
21072
|
}
|
|
20786
21073
|
function resolveRunId(arg) {
|
|
20787
|
-
if (!
|
|
21074
|
+
if (!existsSync22(RUNS_DIR2)) return null;
|
|
20788
21075
|
if (arg === "latest") {
|
|
20789
21076
|
const all2 = listTraceFiles();
|
|
20790
21077
|
if (all2.length === 0) return null;
|
|
20791
21078
|
return { runId: all2[0].runId, path: all2[0].path };
|
|
20792
21079
|
}
|
|
20793
21080
|
const exact = join16(RUNS_DIR2, `${arg}.jsonl`);
|
|
20794
|
-
if (
|
|
21081
|
+
if (existsSync22(exact)) return { runId: arg, path: exact };
|
|
20795
21082
|
const all = listTraceFiles();
|
|
20796
21083
|
const matches = all.filter((r) => r.runId.includes(arg));
|
|
20797
21084
|
if (matches.length === 1) return { runId: matches[0].runId, path: matches[0].path };
|
|
@@ -20802,8 +21089,8 @@ function resolveRunId(arg) {
|
|
|
20802
21089
|
}
|
|
20803
21090
|
return null;
|
|
20804
21091
|
}
|
|
20805
|
-
function readTrace(
|
|
20806
|
-
return
|
|
21092
|
+
function readTrace(path10) {
|
|
21093
|
+
return readFileSync26(path10, "utf-8").split("\n").filter((l) => l.trim()).map((l) => {
|
|
20807
21094
|
try {
|
|
20808
21095
|
return JSON.parse(l);
|
|
20809
21096
|
} catch {
|
|
@@ -20815,7 +21102,7 @@ async function inspect(arg, follow, json) {
|
|
|
20815
21102
|
const r = resolveRunId(arg);
|
|
20816
21103
|
if (!r) {
|
|
20817
21104
|
console.error(`run not found: ${arg}`);
|
|
20818
|
-
if (
|
|
21105
|
+
if (existsSync22(RUNS_DIR2)) {
|
|
20819
21106
|
const all = listTraceFiles().slice(0, 5);
|
|
20820
21107
|
if (all.length > 0) {
|
|
20821
21108
|
console.error(`
|
|
@@ -20995,7 +21282,7 @@ async function main() {
|
|
|
20995
21282
|
case "version":
|
|
20996
21283
|
case "--version":
|
|
20997
21284
|
case "-v":
|
|
20998
|
-
console.log(`fleetlens ${"0.16.
|
|
21285
|
+
console.log(`fleetlens ${"0.16.6"}`);
|
|
20999
21286
|
break;
|
|
21000
21287
|
case "help":
|
|
21001
21288
|
case "--help":
|