ryco-cli 0.1.14 → 0.1.16

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 (199) hide show
  1. package/dist/{AcpNativeLogging-vLtnq5f1.cjs → AcpNativeLogging-OhEq3XNp.cjs} +1 -1
  2. package/dist/{AcpNativeLogging-D3fe64a6.mjs → AcpNativeLogging-qZgtIa5K.mjs} +2 -2
  3. package/dist/{AzureDevOpsSourceControlProvider-WNUDtsur.mjs → AzureDevOpsSourceControlProvider-B0YsaJyI.mjs} +3 -3
  4. package/dist/{AzureDevOpsSourceControlProvider-BtezW57t.cjs → AzureDevOpsSourceControlProvider-Dyu8KQ_S.cjs} +2 -2
  5. package/dist/{BitbucketSourceControlProvider-BWzNM0jW.cjs → BitbucketSourceControlProvider-3VHGKSl1.cjs} +2 -2
  6. package/dist/{BitbucketSourceControlProvider-tbbUFKz3.mjs → BitbucketSourceControlProvider-B8IPx2Ad.mjs} +3 -3
  7. package/dist/{ClaudeDriver-BTvdJvam.cjs → ClaudeDriver-CBCy0_WX.cjs} +8 -6
  8. package/dist/{ClaudeDriver-CG5ngU5z.mjs → ClaudeDriver-DsW8yDj9.mjs} +9 -7
  9. package/dist/{CodexDriver-CFxwJNXx.cjs → CodexDriver-3TZPgrGk.cjs} +3 -3
  10. package/dist/{CodexDriver-49o7TA-C.mjs → CodexDriver-DLwPz5sk.mjs} +4 -4
  11. package/dist/{CodexTextGeneration-C0t4xcPO.mjs → CodexTextGeneration-D1vV8grr.mjs} +2 -2
  12. package/dist/{CodexTextGeneration-CedcXf9a.cjs → CodexTextGeneration-DLHSW4Mz.cjs} +1 -1
  13. package/dist/{CopilotDriver-B8J_ovCX.cjs → CopilotDriver-C7a8IhyK.cjs} +3 -3
  14. package/dist/{CopilotDriver-Cu1B1skB.mjs → CopilotDriver-DXvGBv-s.mjs} +4 -4
  15. package/dist/{CursorDriver-P_A8uQki.mjs → CursorDriver-CeB_vMKJ.mjs} +4 -4
  16. package/dist/{CursorDriver-zlKHPy1_.cjs → CursorDriver-uNsDetA3.cjs} +3 -3
  17. package/dist/{ForgejoSourceControlProvider-szJ-dvsD.cjs → ForgejoSourceControlProvider-CJLksvL_.cjs} +2 -2
  18. package/dist/{ForgejoSourceControlProvider-DLhJZtq9.mjs → ForgejoSourceControlProvider-Ds0rU_PN.mjs} +3 -3
  19. package/dist/{GitHubSourceControlProvider-D5MQQPCJ.mjs → GitHubSourceControlProvider-C7CJAslU.mjs} +3 -3
  20. package/dist/{GitHubSourceControlProvider-3ofb6HsF.cjs → GitHubSourceControlProvider-CrYNFu8S.cjs} +2 -2
  21. package/dist/{GitLabSourceControlProvider-DkupZH5G.cjs → GitLabSourceControlProvider-jbX5M34A.cjs} +2 -2
  22. package/dist/{GitLabSourceControlProvider-DLkxeob5.mjs → GitLabSourceControlProvider-u-Y-e8PV.mjs} +3 -3
  23. package/dist/{GrokDriver-CTUNclwp.cjs → GrokDriver-BJ00ZiYg.cjs} +3 -3
  24. package/dist/{GrokDriver-D8KoMY76.mjs → GrokDriver-CFgjwnvE.mjs} +4 -4
  25. package/dist/{OpenCodeDriver-pXM8bSct.cjs → OpenCodeDriver-BTxd2Q3Q.cjs} +424 -209
  26. package/dist/{OpenCodeDriver-B7htxutj.mjs → OpenCodeDriver-DNApoGdu.mjs} +424 -209
  27. package/dist/{SourceControlProviderDiscoveryCatalog-Bj_sZfmB.cjs → SourceControlProviderDiscoveryCatalog-CPO3a9_U.cjs} +1 -1
  28. package/dist/{SourceControlProviderDiscoveryCatalog-C6Fn7rZE.mjs → SourceControlProviderDiscoveryCatalog-hXWNwRMn.mjs} +1 -1
  29. package/dist/bin.cjs +227 -44
  30. package/dist/bin.mjs +226 -45
  31. package/dist/client/assets/{AccountSettings-CinnQaX-.js → AccountSettings-CkFq28pN.js} +1 -1
  32. package/dist/client/assets/AiFocusSettings-BI9AgQUi.js +1 -0
  33. package/dist/client/assets/{AnimatedHeight-DCad8EQ2.js → AnimatedHeight-BC-qaTJY.js} +1 -1
  34. package/dist/client/assets/{AppearanceSettings-CTh8Z8nz.js → AppearanceSettings-B6UaU-_a.js} +1 -1
  35. package/dist/client/assets/BranchToolbar.logic-6LRTxcuo.js +1 -0
  36. package/dist/client/assets/ChatRightPanel-BSNsAFtv.js +27 -0
  37. package/dist/client/assets/{ChatThreadRouteView-C43W0PEz.js → ChatThreadRouteView-Daox0F74.js} +1 -1
  38. package/dist/client/assets/CommandPaletteDialog-CIZnwgK9.js +1 -0
  39. package/dist/client/assets/{CompositeItem-ClLCuzeJ.js → CompositeItem-97y1QiiT.js} +1 -1
  40. package/dist/client/assets/{CompositeRoot-Bdsr9eHn.js → CompositeRoot-C7Mz4Y_2.js} +1 -1
  41. package/dist/client/assets/{ConnectionsSettings-tmBjGOPj.js → ConnectionsSettings-DFBNmvfL.js} +2 -2
  42. package/dist/client/assets/DiagnosticsSettings-DhuLK993.js +2 -0
  43. package/dist/client/assets/{DialogHandle-CitVLvYq.js → DialogHandle-Cl9dQBJp.js} +1 -1
  44. package/dist/client/assets/{DialogPopup-CfaEr9jv.js → DialogPopup-a1M74u16.js} +1 -1
  45. package/dist/client/assets/DialogRoot-C_DO1gtO.js +1 -0
  46. package/dist/client/assets/{DialogTitle-BUkU0qXf.js → DialogTitle-Bk-w3xLJ.js} +1 -1
  47. package/dist/client/assets/{DialogTrigger-CEjWue7M.js → DialogTrigger-D9nkMFu2.js} +1 -1
  48. package/dist/client/assets/{DialogViewport-Cyc_ye5w.js → DialogViewport-tgJz2Lwn.js} +1 -1
  49. package/dist/client/assets/{DraftChatThreadRouteView-BSA67nKa.js → DraftChatThreadRouteView-BmVyawpM.js} +1 -1
  50. package/dist/client/assets/{ExternalIdentityWeb.logic-BqdBjAua.js → ExternalIdentityWeb.logic-Bn1HigS9.js} +1 -1
  51. package/dist/client/assets/{GlassSurface-B3cq28tB.js → GlassSurface-CDok2tTN.js} +1 -1
  52. package/dist/client/assets/{HostedConnectionControls-S2Wr9fiZ.js → HostedConnectionControls-BvHq5iCa.js} +1 -1
  53. package/dist/client/assets/{HostedHubRoot-DK9zP4tJ.js → HostedHubRoot-CB5TRXg5.js} +1 -1
  54. package/dist/client/assets/{HostedNativeAuthorizationRoute-CKnLbCOH.js → HostedNativeAuthorizationRoute-Cb5WJuEG.js} +1 -1
  55. package/dist/client/assets/{HostedRelayTrustNotice-CbF_SOpf.js → HostedRelayTrustNotice-DFcgMZlL.js} +1 -1
  56. package/dist/client/assets/{Icons-DZpTOLIb.js → Icons-BEtED8P8.js} +1 -1
  57. package/dist/client/assets/{IntegrationsSettingsPanel-BdBEGIyL.js → IntegrationsSettingsPanel-BIy-rKDv.js} +1 -1
  58. package/dist/client/assets/{KeybindingsSettings-Bye1H9Sx.js → KeybindingsSettings-u3yB7Cob.js} +1 -1
  59. package/dist/client/assets/{McpServersSettings-D0U0g2q7.js → McpServersSettings-V32mLD4v.js} +2 -2
  60. package/dist/client/assets/{MobileSheet-BPvuTPR6.js → MobileSheet-BDvnUC5W.js} +1 -1
  61. package/dist/client/assets/{NewWorktreeDialog-C_xJCZWF.js → NewWorktreeDialog-B64WGjQj.js} +2 -2
  62. package/dist/client/assets/{NoActiveThreadState-Cfn_Wwnf.js → NoActiveThreadState-C0MwHtMx.js} +1 -1
  63. package/dist/client/assets/{NodeSecuritySettings-DUQNZJqJ.js → NodeSecuritySettings-CWlThhfV.js} +1 -1
  64. package/dist/client/assets/OpinionatedPluginsSettings-CVzfv5nP.js +1 -0
  65. package/dist/client/assets/{PhoneGetAppInterstitial-CzduFI4-.js → PhoneGetAppInterstitial-CylfsDBD.js} +1 -1
  66. package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-CJ44QRCp.js → PhoneGetAppInterstitialBackdrop-BA4R225F.js} +1 -1
  67. package/dist/client/assets/{PhoneHome-BLEJm5TG.js → PhoneHome-DBwwEeaI.js} +1 -1
  68. package/dist/client/assets/{PhoneSettingsSurface-CqetLTIm.js → PhoneSettingsSurface-sDCNEVkR.js} +1 -1
  69. package/dist/client/assets/{ProjectFavicon-DrBXI2cH.js → ProjectFavicon-BjXJxNbQ.js} +1 -1
  70. package/dist/client/assets/{ProviderModelPicker-CyID3P1C.js → ProviderModelPicker-BTFj53Qv.js} +1 -1
  71. package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-C6VoLD-w.js → ProviderUpdateLaunchNotification.logic-CywRitn3.js} +1 -1
  72. package/dist/client/assets/{ProvidersSettingsPanel-BHmpXUIM.js → ProvidersSettingsPanel-IhzMeM1F.js} +1 -1
  73. package/dist/client/assets/{RedactedSensitiveText-CZwFEoNn.js → RedactedSensitiveText-BuWSWty8.js} +1 -1
  74. package/dist/client/assets/RootAppShell-CG06ruyc.js +6 -0
  75. package/dist/client/assets/{RycoLetterMark-C-fvI9UB.js → RycoLetterMark-CZYntY8t.js} +1 -1
  76. package/dist/client/assets/{SettingsDialog-CnETTu23.js → SettingsDialog-ByR9PwEc.js} +1 -1
  77. package/dist/client/assets/{SettingsPanels-C3HDrmQq.js → SettingsPanels-CwsCgdds.js} +3 -3
  78. package/dist/client/assets/{SettingsPanels.editor-DI8Z5rsl.js → SettingsPanels.editor-lbLEbllb.js} +1 -1
  79. package/dist/client/assets/{SourceControlSettings-BG4tsvql.js → SourceControlSettings-5w4N9XII.js} +1 -1
  80. package/dist/client/assets/{StatisticsPage-dy_aYqvS.js → StatisticsPage-jRyjIh52.js} +1 -1
  81. package/dist/client/assets/{StatisticsPanel-CeRJBu65.js → StatisticsPanel-CV5eFeO_.js} +1 -1
  82. package/dist/client/assets/{StatisticsSettingsLink-ChlwCDG0.js → StatisticsSettingsLink-B7SZerf3.js} +1 -1
  83. package/dist/client/assets/{ThreadStatusIndicators-D-ioX09X.js → ThreadStatusIndicators-C40TYVEC.js} +0 -0
  84. package/dist/client/assets/{ThreadTerminalDrawer-BvGaRxBP.js → ThreadTerminalDrawer-flv5ZDel.js} +3 -3
  85. package/dist/client/assets/{ThreadWorkspacePanel-BAWm7mGl.js → ThreadWorkspacePanel-B-cBAWFz.js} +6 -6
  86. package/dist/client/assets/{ToolbarRootContext-k-_m5nCN.js → ToolbarRootContext-B1g8IP6k.js} +1 -1
  87. package/dist/client/assets/{WorkItemsTab-Q2V2EuvK.js → WorkItemsTab-0DE4S4n0.js} +5 -5
  88. package/dist/client/assets/{alert-BymbRVPf.js → alert-DomE7dAt.js} +1 -1
  89. package/dist/client/assets/{alert-dialog-Gym8_p4Q.js → alert-dialog-9Jyh0e8u.js} +1 -1
  90. package/dist/client/assets/{authorization-BwQZHweJ.js → authorization-D8lJzXTE.js} +1 -1
  91. package/dist/client/assets/{badge-BQI7J3Sg.js → badge-w43sx8eF.js} +1 -1
  92. package/dist/client/assets/{branding-DqHDcyzW.js → branding-Ck4g7yv3.js} +1 -1
  93. package/dist/client/assets/{button-Wf_1nfeu.js → button-DG8WqjNn.js} +1 -1
  94. package/dist/client/assets/{capabilities-BrllgEYz.js → capabilities-xa5Ll0KT.js} +1 -1
  95. package/dist/client/assets/{chatThreadActions-BGkJmj6T.js → chatThreadActions-BZvyhfKr.js} +1 -1
  96. package/dist/client/assets/{collapsible-GOpRckDq.js → collapsible-EhAEe5S9.js} +1 -1
  97. package/dist/client/assets/{command-Dx5YM54H.js → command-Cyn6yIEa.js} +1 -1
  98. package/dist/client/assets/{composerDraftStore-DC2r8dcu.js → composerDraftStore-TYv9j3vY.js} +2 -2
  99. package/dist/client/assets/{data-list-BSiCZBKn.js → data-list-DTdqWMGN.js} +1 -1
  100. package/dist/client/assets/{desktopUpdateAtoms-DkmoIGr0.js → desktopUpdateAtoms-hP0oc_If.js} +1 -1
  101. package/dist/client/assets/desktopWorkspace-hOxsGVFz.js +1 -0
  102. package/dist/client/assets/device-DIfzlguu.js +168 -0
  103. package/dist/client/assets/{dialog-CUxw5AxI.js → dialog-BNmFD6Nh.js} +1 -1
  104. package/dist/client/assets/{draft-input-CpfrGQ1h.js → draft-input-dP7F8odz.js} +1 -1
  105. package/dist/client/assets/{editorPreferences-SOMXdQpi.js → editorPreferences-B54y5_sx.js} +1 -1
  106. package/dist/client/assets/{empty-D420OZA9.js → empty-Ccxhyvdf.js} +1 -1
  107. package/dist/client/assets/{env-Bf33qXdb.js → env-Bcq9YR3B.js} +1 -1
  108. package/dist/client/assets/{getPseudoElementBounds-nDGTWECG.js → getPseudoElementBounds-CO5HJT7x.js} +1 -1
  109. package/dist/client/assets/{group-Cq4Llttm.js → group-CzdKmc45.js} +1 -1
  110. package/dist/client/assets/{index-BL8_ra0g.js → index-Dp3JRlOK.js} +2 -2
  111. package/dist/client/assets/{input-Dl4N9ZfE.js → input-BZz4eLRl.js} +1 -1
  112. package/dist/client/assets/{kbd-CqoZVQfv.js → kbd-DbvN3zTb.js} +1 -1
  113. package/dist/client/assets/{keybindings-DQzcPjMv.js → keybindings-BPE3eEAM.js} +1 -1
  114. package/dist/client/assets/{label-x5DgpBI_.js → label-DZf4lbNF.js} +1 -1
  115. package/dist/client/assets/{lib-BXIqHSZx.js → lib-DgOYoged.js} +1 -1
  116. package/dist/client/assets/{logging-CZlHfeu2.js → logging-81iP6Hps.js} +1 -1
  117. package/dist/client/assets/main-B6n7O_N3.js +9 -0
  118. package/dist/client/assets/main-DlGNPwsH.css +2 -0
  119. package/dist/client/assets/{menu-BuDpxm_Q.js → menu-B6UEFcn0.js} +1 -1
  120. package/dist/client/assets/{popover-DuprDUaB.js → popover-BuYzXGwl.js} +1 -1
  121. package/dist/client/assets/{primary-CJx2nSkc.js → primary-CiDY2oUi.js} +1 -1
  122. package/dist/client/assets/{projectPaths-DrelgodZ.js → projectPaths-D8b4yLOe.js} +1 -1
  123. package/dist/client/assets/{providerDriverMeta-D27Koh7Q.js → providerDriverMeta-sBwZhQoN.js} +1 -1
  124. package/dist/client/assets/{providerIconUtils-CtOHwjWL.js → providerIconUtils-Cq0fezxt.js} +1 -1
  125. package/dist/client/assets/providerInstances-vd2eZtHx.js +1 -0
  126. package/dist/client/assets/providerModels-vd2eZtHx.js +1 -0
  127. package/dist/client/assets/{qr-code-BVfzPOP3.js → qr-code-Ie92aZvE.js} +1 -1
  128. package/dist/client/assets/{radio-group-rgmJqPI7.js → radio-group-BuuTEtdC.js} +1 -1
  129. package/dist/client/assets/{resolveAriaLabelledBy-l4SuqStl.js → resolveAriaLabelledBy-0FA0k4xp.js} +1 -1
  130. package/dist/client/assets/{rightPanelRouteSearch-DmpObL1z.js → rightPanelRouteSearch-BS8CkNS6.js} +1 -1
  131. package/dist/client/assets/{runtime-DYzjhL5M.js → runtime-QZPKtH2P.js} +1 -1
  132. package/dist/client/assets/{scroll-area-DMs8l4bb.js → scroll-area-C0yF015F.js} +1 -1
  133. package/dist/client/assets/{scrollEdges-DWTOweRb.js → scrollEdges-DI5Y3mtR.js} +1 -1
  134. package/dist/client/assets/{select-Djwp8HDm.js → select-CZukJlTn.js} +1 -1
  135. package/dist/client/assets/{separator-rjtf5Q3V.js → separator-D4ckGtPe.js} +1 -1
  136. package/dist/client/assets/session-logic-BuGYhZKZ.js +4 -0
  137. package/dist/client/assets/{settingsDialogStore-Dbykwvfs.js → settingsDialogStore-LxRFC5hh.js} +1 -1
  138. package/dist/client/assets/{settingsLayout-C7bl9Xi4.js → settingsLayout-CHJT5wtl.js} +1 -1
  139. package/dist/client/assets/{sheet-CQIQYfOM.js → sheet-BNfImQ-7.js} +1 -1
  140. package/dist/client/assets/{sidebar-BdDOvXe8.js → sidebar-CFGg5Tkr.js} +1 -1
  141. package/dist/client/assets/{sidebarProjectFolders-D_Me0oJ8.js → sidebarProjectFolders-Dlo6McCj.js} +2 -2
  142. package/dist/client/assets/{sidebarStatusText-BF6odB03.js → sidebarStatusText-C8QBhZhZ.js} +1 -1
  143. package/dist/client/assets/{skeleton-Mgh4Gx9x.js → skeleton-DOgQaVXv.js} +1 -1
  144. package/dist/client/assets/{spinner-CzzUdFeE.js → spinner-ClQu8SdC.js} +1 -1
  145. package/dist/client/assets/{src-Ca7Gag3m.js → src-DmPIm3ie.js} +1 -1
  146. package/dist/client/assets/storeSelectors-_h41wnN2.js +1 -0
  147. package/dist/client/assets/{switch-CntUxI1A.js → switch-BZjA7VT9.js} +1 -1
  148. package/dist/client/assets/{terminal-links-CUFISn8U.js → terminal-links-CzJomeox.js} +1 -1
  149. package/dist/client/assets/{textarea-C8QxddDb.js → textarea-DHdmRD1r.js} +1 -1
  150. package/dist/client/assets/{threadPinning-BIV4KXZU.js → threadPinning-D2e9MEDr.js} +1 -1
  151. package/dist/client/assets/{threadPriorityRefreshRuntime-B-pVYK_y.js → threadPriorityRefreshRuntime-DbEFchoL.js} +1 -1
  152. package/dist/client/assets/{toast-Cw7bXJzg.js → toast-C-0Ft2jD.js} +1 -1
  153. package/dist/client/assets/{toggle-Bi9uP4Hb.js → toggle-DsnOFDbJ.js} +1 -1
  154. package/dist/client/assets/{toggle-group-LcgyMgj5.js → toggle-group-Chxh9G6t.js} +1 -1
  155. package/dist/client/assets/{tooltip-t3Nrleyq.js → tooltip-C_-9XEfA.js} +1 -1
  156. package/dist/client/assets/types-_h41wnN2.js +1 -0
  157. package/dist/client/assets/{uiStateStore-BW2WnK4k.js → uiStateStore-DzUrk2GS.js} +1 -1
  158. package/dist/client/assets/{useAtlassian-a-MaAd0k.js → useAtlassian-Zb2Kkt0_.js} +0 -0
  159. package/dist/client/assets/{useButton-DUuWgIMw.js → useButton-BmvYhoMC.js} +1 -1
  160. package/dist/client/assets/{useCompositeListItem-CL5mJqCb.js → useCompositeListItem-D0PvH4nv.js} +1 -1
  161. package/dist/client/assets/{useDebouncedValue-jDDWNjgt.js → useDebouncedValue-s0BC8Yyp.js} +1 -1
  162. package/dist/client/assets/{useFloatingRootContext-C4I8IxtL.js → useFloatingRootContext-CLCaQEJk.js} +1 -1
  163. package/dist/client/assets/useHandleNewThread-ByVfL71G.js +1 -0
  164. package/dist/client/assets/{useLabelableId-KX33mhBC.js → useLabelableId-CB_9OReR.js} +1 -1
  165. package/dist/client/assets/{useLocation-B4QlXdMt.js → useLocation-DGJMt6gP.js} +1 -1
  166. package/dist/client/assets/{useOpenInteractionType-DjM9MBY7.js → useOpenInteractionType-BSSI2GzS.js} +1 -1
  167. package/dist/client/assets/{usePhoneThreadActions-DxxWMYgC.js → usePhoneThreadActions-BhTVcLtf.js} +1 -1
  168. package/dist/client/assets/{usePopupViewport-CAMlnyaP.js → usePopupViewport-8F-J1h5f.js} +1 -1
  169. package/dist/client/assets/{useScrollLock-CAPfesBT.js → useScrollLock-CBz-5_MX.js} +1 -1
  170. package/dist/client/assets/{useStatistics-CWasDzsV.js → useStatistics-Dbp94K5j.js} +1 -1
  171. package/dist/client/assets/{useSwipeDismiss-BZsYSBgq.js → useSwipeDismiss-D22_vuiH.js} +1 -1
  172. package/dist/client/assets/{useThreadActions-MOjDrEnS.js → useThreadActions-CPL4dO-X.js} +1 -1
  173. package/dist/client/assets/{useTriggerFocusGuards-D5z439rn.js → useTriggerFocusGuards-f7afwACm.js} +1 -1
  174. package/dist/client/assets/{useValueChanged-D0CHQQwP.js → useValueChanged-EkWF0C3k.js} +1 -1
  175. package/dist/client/assets/{utils-B76_2Yk7.js → utils-CV2fJJxC.js} +1 -1
  176. package/dist/client/index.html +1 -1
  177. package/dist/{collectUint8StreamText-B9B7bGv9.cjs → collectUint8StreamText-Dsbmrw73.cjs} +2 -0
  178. package/dist/{collectUint8StreamText-RzKEq2NY.mjs → collectUint8StreamText-oFvWyN3_.mjs} +2 -0
  179. package/dist/{makeManagedServerProvider-BF1eBatf.cjs → makeManagedServerProvider-CANTNAsz.cjs} +9 -2
  180. package/dist/{makeManagedServerProvider-BuG2fLP8.mjs → makeManagedServerProvider-PLtJj7EV.mjs} +10 -3
  181. package/package.json +1 -1
  182. package/dist/client/assets/AiFocusSettings-UbXOywZg.js +0 -1
  183. package/dist/client/assets/BranchToolbar.logic-37EnknDD.js +0 -1
  184. package/dist/client/assets/ChatRightPanel-DUwLYKbp.js +0 -27
  185. package/dist/client/assets/CommandPaletteDialog-IHOe0hOG.js +0 -1
  186. package/dist/client/assets/DiagnosticsSettings-CbCEgaau.js +0 -2
  187. package/dist/client/assets/DialogRoot-CyEOjgGH.js +0 -1
  188. package/dist/client/assets/OpinionatedPluginsSettings-D44efcv7.js +0 -1
  189. package/dist/client/assets/RootAppShell-BVXRShhe.js +0 -6
  190. package/dist/client/assets/desktopWorkspace-Ddm531g5.js +0 -1
  191. package/dist/client/assets/device-B0aqBYM1.js +0 -168
  192. package/dist/client/assets/main-B7T7on1T.css +0 -2
  193. package/dist/client/assets/main-J4YlUJad.js +0 -9
  194. package/dist/client/assets/providerInstances-BPwEwwpF.js +0 -1
  195. package/dist/client/assets/providerModels-BPwEwwpF.js +0 -1
  196. package/dist/client/assets/session-logic-DLEAZb3K.js +0 -4
  197. package/dist/client/assets/storeSelectors-D7HbqO4E.js +0 -1
  198. package/dist/client/assets/types-D7HbqO4E.js +0 -1
  199. package/dist/client/assets/useHandleNewThread-820pBJCC.js +0 -1
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{t as r}from"./src-Ca7Gag3m.js";import{l as i,v as a}from"./runtime-DYzjhL5M.js";import{n as o}from"./primary-CJx2nSkc.js";import{It as s}from"./composerDraftStore-DC2r8dcu.js";import{f as c}from"./useRenderElement-DchFnsR8.js";import{t as l}from"./activity-1CkdQG5u.js";import{A as u,C as d,D as f,E as p,F as m,I as h,L as g,M as _,O as v,P as y,R as b,S as x,T as S,_ as C,c as w,d as T,f as E,g as D,h as ee,j as O,m as k,o as A,p as j,r as M,s as N,t as P,v as F,w as I,x as L}from"./useStatistics-CWasDzsV.js";import{t as R}from"./chart-column-Dw6ACmXM.js";import{t as z}from"./circle-alert-BWvs6IOn.js";import{t as B}from"./clock-3-r12DkpRj.js";import{n as V,t as te}from"./layers-BYi0v17h.js";import{t as H}from"./git-pull-request-DIYyPsg5.js";import{t as ne}from"./messages-square-DiMgWzoq.js";import{t as U}from"./refresh-cw-DopCMrtR.js";import{t as re}from"./shield-alert-DY9uVP5G.js";import{t as ie}from"./sparkles-CAf3oJ5S.js";import{t as ae}from"./triangle-alert-RL_T3KLo.js";import{t as oe}from"./wrench-D0IetWa1.js";import{t as W}from"./utils-B76_2Yk7.js";import{t as se}from"./scroll-area-DMs8l4bb.js";import{t as G}from"./button-Wf_1nfeu.js";import{t as ce}from"./capabilities-BrllgEYz.js";import{o as le}from"./sidebar-BdDOvXe8.js";import{a as ue,i as de,o as fe,s as pe,t as me}from"./select-Djwp8HDm.js";import{t as he}from"./badge-BQI7J3Sg.js";var ge=c(`brain-circuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),_e=c(`circle-dollar-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),ve=c(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),K=n(),q=s();function ye(e){let t=(0,K.c)(56),{search:n,onSearchChange:r}=e,{snapshot:i,loading:a,error:s,refresh:c,refreshing:u}=P(),f=n.projectId??null,p=n.model??null,m=n.modelProvider??null,h;t[0]!==n.range||t[1]!==f||t[2]!==p||t[3]!==m?(h={range:n.range,projectId:f,model:p,provider:m},t[0]=n.range,t[1]=f,t[2]=p,t[3]=m,t[4]=h):h=t[4];let g=h,_;bb0:{if(!i){_=null;break bb0}let e,n,r,a;if(t[5]!==g||t[6]!==i){let o=w(i,g),s=T(o);e=o,n=s,r=N(i,o,g.range),a=M(o,A(i)),t[5]=g,t[6]=i,t[7]=e,t[8]=n,t[9]=r,t[10]=a}else e=t[7],n=t[8],r=t[9],a=t[10];let o;t[11]!==e||t[12]!==n||t[13]!==r||t[14]!==a?(o={buckets:e,totals:n,days:r,projects:a},t[11]=e,t[12]=n,t[13]=r,t[14]=a,t[15]=o):o=t[15],_=o}let y=_;if(a&&!i){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(ee,{}),t[16]=e):e=t[16],e}if(s&&!i){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(U,{}),t[17]=e):e=t[17];let n;t[18]===c?n=t[19]:(n=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:c,children:[e,` Try again`]}),t[18]=c,t[19]=n);let r;return t[20]!==s||t[21]!==n?(r=(0,q.jsx)(D,{icon:ae,title:`Couldn’t load Ryco activity`,description:s,action:n}),t[20]=s,t[21]=n,t[22]=r):r=t[22],r}if(!i||!y)return null;let{totals:b,days:x,projects:S}=y,O=o()?.label??`Current environment`,R;if(t[23]!==x||t[24]!==g||t[25]!==r||t[26]!==S||t[27]!==c||t[28]!==u||t[29]!==n||t[30]!==i.dailyBuckets.length||t[31]!==i.models||t[32]!==i.projects||t[33]!==i.recentPullRequests||t[34]!==i.worktrees||t[35]!==b){let e=xe(x,n.activityMetric),a;t[37]!==r||t[38]!==n?(a=e=>r({...n,range:e.range,projectId:e.projectId??void 0,model:e.model??void 0,modelProvider:e.provider??void 0}),t[37]=r,t[38]=n,t[39]=a):a=t[39];let o;t[40]!==g||t[41]!==i.models||t[42]!==i.projects||t[43]!==a?(o=(0,q.jsx)(E,{filter:g,projects:i.projects,models:i.models,onChange:a}),t[40]=g,t[41]=i.models,t[42]=i.projects,t[43]=a,t[44]=o):o=t[44];let s=u?`animate-spin`:void 0,f;t[45]===s?f=t[46]:(f=(0,q.jsx)(U,{className:s}),t[45]=s,t[46]=f);let p=u?`Refreshing`:`Refresh`,m;t[47]!==c||t[48]!==u||t[49]!==f||t[50]!==p?(m=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:c,disabled:u,children:[f,p]}),t[47]=c,t[48]=u,t[49]=f,t[50]=p,t[51]=m):m=t[51];let h;t[52]!==m||t[53]!==o?(h=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[o,m]}),t[52]=m,t[53]=o,t[54]=h):h=t[54];let _;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,q.jsxs)(`p`,{className:`max-w-4xl text-sm leading-relaxed text-muted-foreground`,children:[`Activity includes work observed by Ryco on`,` `,(0,q.jsx)(`span`,{className:`font-medium text-foreground`,children:O}),`. Usage from other CLI sessions appears in the Usage tab and is not assigned to projects.`]}),t[55]=_):_=t[55],R=(0,q.jsxs)(`div`,{className:`space-y-8`,children:[h,_,i.dailyBuckets.length===0?(0,q.jsx)(D,{icon:l,title:`No Ryco activity yet`,description:`Project and agent activity will appear here after your first completed turns.`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-5`,children:[(0,q.jsx)(k,{label:`Active time`,icon:B,value:d(b.activeMs),sub:`${v(b.totalTokens)} observed tokens`}),(0,q.jsx)(k,{label:`Turns`,icon:l,value:I(b.turns),sub:`Completed agent turns`}),(0,q.jsx)(k,{label:`Chats`,icon:ne,value:I(b.threadsCreated),sub:`Conversations started`}),(0,q.jsx)(k,{label:`Tool uses`,icon:oe,value:I(b.toolUses),sub:`Observed invocations`}),(0,q.jsx)(k,{label:`Files changed`,icon:V,value:I(b.filesChanged),sub:`+${I(b.additions)} / −${I(b.deletions)} lines`})]}),(0,q.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1.2fr_0.8fr]`,children:[(0,q.jsxs)(j,{title:`Activity rhythm`,icon:l,bodyClassName:`p-5`,action:(0,q.jsx)(Se,{search:n,onSearchChange:r}),children:[(0,q.jsx)(L,{points:x,metric:n.activityMetric}),(0,q.jsxs)(`div`,{className:`mt-5 grid grid-cols-3 gap-3 border-t border-border/60 pt-4`,children:[(0,q.jsx)(Y,{label:`Active days`,value:I(e.activeDays)}),(0,q.jsx)(Y,{label:`Current streak`,value:`${I(e.currentStreak)}d`}),(0,q.jsx)(Y,{label:`Busiest UTC day`,value:e.busiestLabel})]})]}),(0,q.jsx)(j,{title:`Projects`,icon:l,bodyClassName:`p-4`,children:(0,q.jsx)(F,{data:S,metric:n.activityMetric})})]}),(0,q.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,q.jsxs)(j,{title:`Code changes`,icon:V,bodyClassName:`p-4`,children:[(0,q.jsxs)(`div`,{className:`mb-4 flex gap-6 text-sm`,children:[(0,q.jsx)(Y,{label:`Files`,value:I(b.filesChanged)}),(0,q.jsx)(Y,{label:`Added`,value:`+${I(b.additions)}`,tone:`positive`}),(0,q.jsx)(Y,{label:`Removed`,value:`−${I(b.deletions)}`,tone:`negative`})]}),(0,q.jsx)(C,{data:x})]}),(0,q.jsxs)(j,{title:`Source control · all time`,icon:H,bodyClassName:`overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 border-b border-border/60 px-4 py-4`,children:[(0,q.jsx)(Y,{label:`Active`,value:I(i.worktrees.active)}),(0,q.jsx)(Y,{label:`Created`,value:I(i.worktrees.created)}),(0,q.jsx)(Y,{label:`Archived`,value:I(i.worktrees.archived)}),(0,q.jsx)(Y,{label:`Open PRs`,value:I(i.worktrees.openPrs)})]}),i.recentPullRequests.length===0?(0,q.jsx)(`div`,{className:`flex h-[260px] items-center justify-center px-6 text-center text-xs text-muted-foreground`,children:`No projected pull requests yet.`}):(0,q.jsx)(`div`,{className:`divide-y divide-border/60`,children:i.recentPullRequests.slice(0,6).map(be)})]})]})]})]}),t[23]=x,t[24]=g,t[25]=r,t[26]=S,t[27]=c,t[28]=u,t[29]=n,t[30]=i.dailyBuckets.length,t[31]=i.models,t[32]=i.projects,t[33]=i.recentPullRequests,t[34]=i.worktrees,t[35]=b,t[36]=R}else R=t[36];return R}function be(e){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,q.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,q.jsx)(H,{className:`size-4`})}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.prTitle||e.worktreeTitle||e.branch}),(0,q.jsxs)(`p`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:[e.projectTitle,` · #`,e.prNumber,` ·`,` `,f(e.updatedAt)]})]}),(0,q.jsx)(he,{variant:e.prState===`merged`?`success`:e.active?`info`:`secondary`,children:e.prIsDraft?`Draft`:e.prState??(e.active?`Open`:`Archived`)})]},e.worktreeId)}function J(e,t){return t===`turns`?e.turns:t===`activeMs`?e.activeMs:e.filesChanged}function xe(e,t){let n=0,r=0,i=null;for(let r of e){let e=J(r,t);e>0&&(n+=1),(i===null||e>J(i,t))&&(i=r)}for(let n=e.length-1;n>=0;--n){let i=e[n];if(i===void 0||J(i,t)<=0)break;r+=1}if(i===null||J(i,t)<=0)return{activeDays:n,currentStreak:r,busiestLabel:`—`};let a=J(i,t),o=t===`activeMs`?d(a):I(a);return{activeDays:n,currentStreak:r,busiestLabel:`${i.date.slice(5)} · ${o}`}}function Se(e){let t=(0,K.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`turns`,`activeMs`,`files`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,activityMetric:e}),className:W(`h-6 rounded-sm px-2 text-[11px]`,n.activityMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e===`activeMs`?`Time`:e===`files`?`Files`:`Turns`},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Y(e){let t=(0,K.c)(10),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,q.jsx)(`p`,{className:`text-[10px] tracking-[0.08em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o=i===`positive`?`text-success-foreground`:i===`negative`?`text-destructive`:`text-foreground`,s;t[2]===o?s=t[3]:(s=W(`mt-1 font-semibold tabular-nums`,o),t[2]=o,t[3]=s);let c;t[4]!==s||t[5]!==r?(c=(0,q.jsx)(`p`,{className:s,children:r}),t[4]=s,t[5]=r,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,q.jsxs)(`div`,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function Ce(e){switch(e){case`complete`:return 4;case`partial`:return 3;case`not-found`:return 2;case`failed`:return 1}}function we(e,t){return Ce(t.source.status)-Ce(e.source.status)||t.source.scanFinishedAt.localeCompare(e.source.scanFinishedAt)||t.environment.summary.generatedAt.localeCompare(e.environment.summary.generatedAt)||e.environment.environmentId.localeCompare(t.environment.environmentId)}function Te(e,t){return{uncachedInputTokens:e.uncachedInputTokens+t.uncachedInputTokens,cachedInputTokens:e.cachedInputTokens+t.cachedInputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens+t.cacheCreationInputTokens,outputTokens:e.outputTokens+t.outputTokens,reasoningTokens:e.reasoningTokens+t.reasoningTokens,totalTokens:e.totalTokens+t.totalTokens}}function Ee(e,t){if(e.size===0||e.size===1&&e.has(`unpriced`))return`unpriced`;let n=new Set([...e].filter(e=>e!==`unpriced`));return t>0||n.size!==1||e.has(`mixed`)?`mixed`:n.values().next().value??`unpriced`}function De(e){let t=e.filter(e=>e.summary!==void 0&&e.summary.contractVersion===1&&(e.status===`complete`||e.status===`partial`));if(t.length===0)return null;let n=t.flatMap(e=>e.summary.sources.map(t=>({environment:e,source:t}))).toSorted(we),r=new Set,i=new Set,a=[],o=0,s=!1;for(let e of n){let t=`${e.environment.environmentId}\0${e.source.sourceId}`,n=e.source.deduplicationKind===`physical`,c=n&&r.has(e.source.sourceId);n&&!c&&r.add(e.source.sourceId),n||(s=!0),c?o+=1:i.add(t),a.push({...e.source,environmentId:e.environment.environmentId,environmentLabel:e.environment.label,included:!c,...c?{exclusionReason:`duplicate`}:{}})}let c=new Map;for(let e of t)for(let t of e.summary.buckets){let n=`${e.environmentId}\0${t.sourceId}`;if(!i.has(n))continue;let r=`${t.date}\0${t.provider}\0${t.model}`,a=c.get(r);a===void 0&&(a={date:t.date,provider:t.provider,model:t.model,...t.rawModel===void 0?{}:{rawModel:t.rawModel},tokens:{uncachedInputTokens:0,cachedInputTokens:0,cacheCreationInputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0},responseCount:0,sessionCount:0,estimatedCostUsd:0,estimatedCacheSavingsUsd:0,hasCost:!1,hasCacheSavings:!1,pricedTokenCount:0,unpricedTokenCount:0,costSources:new Set,sourceIds:new Set},c.set(r,a)),a.tokens=Te(a.tokens,t.tokens),a.responseCount+=t.responseCount,a.sessionCount+=t.sessionCount,t.estimatedCostUsd!==void 0&&(a.estimatedCostUsd+=t.estimatedCostUsd,a.hasCost=!0),t.estimatedCacheSavingsUsd!==void 0&&(a.estimatedCacheSavingsUsd+=t.estimatedCacheSavingsUsd,a.hasCacheSavings=!0),a.pricedTokenCount+=t.pricedTokenCount,a.unpricedTokenCount+=t.unpricedTokenCount,a.costSources.add(t.costSource),a.sourceIds.add(t.sourceId)}let l=[...c.values()].map(e=>Object.assign({date:e.date,provider:e.provider,model:e.model,tokens:e.tokens,responseCount:e.responseCount,sessionCount:e.sessionCount,pricedTokenCount:e.pricedTokenCount,unpricedTokenCount:e.unpricedTokenCount,costSource:Ee(e.costSources,e.unpricedTokenCount),sourceIds:[...e.sourceIds].toSorted()},e.rawModel===void 0?{}:{rawModel:e.rawModel},e.hasCost?{estimatedCostUsd:e.estimatedCostUsd}:{},e.hasCacheSavings?{estimatedCacheSavingsUsd:e.estimatedCacheSavingsUsd}:{})).toSorted((e,t)=>e.date.localeCompare(t.date)||e.provider.localeCompare(t.provider)||e.model.localeCompare(t.model)),u=t[0]?.summary;return u?{...u.startDate===void 0?{}:{startDate:u.startDate},endDate:u.endDate,timeZone:u.timeZone,buckets:l,sources:a.toSorted((e,t)=>Number(t.included)-Number(e.included)||e.provider.localeCompare(t.provider)||e.environmentLabel.localeCompare(t.environmentLabel)),environments:e,duplicateSourceCount:o,environmentOnlyDeduplicationWarning:s}:null}var Oe=class{#e=0;next(){return this.#e+=1,this.#e}isCurrent(e){return e===this.#e}},X=e(t(),1),ke={"7d":7,"30d":30,"90d":90,all:null};function Ae(e,t){return new Intl.DateTimeFormat(`en-CA`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(new Date(e))}function je(e,t,n=Date.now()){let r=Ae(n,t),i=ke[e];return i===null?{endDate:r,timeZone:t,contractVersion:1}:{startDate:Ae(Date.parse(`${r}T12:00:00.000Z`)-(i-1)*864e5,`UTC`),endDate:r,timeZone:t,contractVersion:1}}function Me(){let e=(0,K.c)(3),[t,n]=(0,X.useState)(0),r,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>a(()=>n(Ne)),o=[],e[0]=r,e[1]=o):(r=e[0],o=e[1]),(0,X.useEffect)(r,o);let s;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=i(),e[2]=s):s=e[2],s}function Ne(e){return e+1}function Pe(e){let t=Me(),n=(0,X.useMemo)(()=>t.map(e=>({environmentId:e.environmentId,label:e.knownEnvironment.label})).toSorted((e,t)=>e.label.localeCompare(t.label)),[t]),r=(0,X.useMemo)(()=>{if(e.environmentIds===void 0||e.environmentIds.length===0)return t;let n=new Set(e.environmentIds);return t.filter(e=>n.has(e.environmentId))},[t,e.environmentIds]),i=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,[a,o]=(0,X.useState)(0),[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)([]),[d,f]=(0,X.useState)(!0),p=(0,X.useRef)(new Oe),m=r.map(e=>e.environmentId).toSorted().join(`\0`);(0,X.useEffect)(()=>{let t=p.current.next(),n=je(e.range,i);f(!0),Promise.all(r.map(async e=>{try{let t=await e.client.server.getUsageSummary(n);if(t.contractVersion!==1)return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:`stale-contract`,message:`This environment uses an incompatible usage contract.`};let r=t.sources.some(e=>e.status===`partial`||e.status===`failed`);return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:r?`partial`:`complete`,summary:t}}catch(t){return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:`failed`,message:t instanceof Error?t.message:String(t)}}})).then(e=>{p.current.isCurrent(t)&&(u(e),c(De(e)),f(!1))})},[e.range,a,r,m,i]);let h=(0,X.useCallback)(()=>o(e=>e+1),[]);return{merged:s,environments:l,availableEnvironments:n,loading:d,refreshing:d&&s!==null,refresh:h}}function Fe(e,t){if(t===void 0||t.length===0)return e.buckets;let n=new Set(t);return e.buckets.filter(e=>n.has(e.provider))}function Ie(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=!1,f=!1,p=0,m=0;for(let e of t)n+=e.tokens.totalTokens,r+=e.tokens.uncachedInputTokens,i+=e.tokens.cachedInputTokens,a+=e.tokens.cacheCreationInputTokens,o+=e.tokens.outputTokens,s+=e.tokens.reasoningTokens,c+=e.responseCount,p+=e.pricedTokenCount,m+=e.unpricedTokenCount,e.estimatedCostUsd!==void 0&&(l+=e.estimatedCostUsd,d=!0),e.estimatedCacheSavingsUsd!==void 0&&(u+=e.estimatedCacheSavingsUsd,f=!0);let h=new Set(t.map(e=>e.provider)),g=e.sources.filter(e=>e.included&&h.has(e.provider)&&e.status!==`not-found`&&e.status!==`failed`).reduce((e,t)=>e+t.distinctSessionCount,0);return{totalTokens:n,uncachedInputTokens:r,cachedInputTokens:i,cacheCreationInputTokens:a,outputTokens:o,reasoningTokens:s,responseCount:c,distinctSessionCount:g,estimatedCostUsd:d?l:null,estimatedCacheSavingsUsd:f?u:null,pricedTokenCount:p,unpricedTokenCount:m}}function Le(e,t){return new Date(Date.parse(`${e}T12:00:00.000Z`)+t*864e5).toISOString().slice(0,10)}function Re(e,t){let n=new Map;for(let e of t){let t=n.get(e.date)??{date:e.date,claudeCost:0,codexCost:0,claudeTokens:0,codexTokens:0};n.set(e.date,{...t,...e.provider===`claude`?{claudeCost:t.claudeCost+(e.estimatedCostUsd??0),claudeTokens:t.claudeTokens+e.tokens.totalTokens}:{codexCost:t.codexCost+(e.estimatedCostUsd??0),codexTokens:t.codexTokens+e.tokens.totalTokens}})}let r=e.startDate??[...n.keys()].toSorted((e,t)=>e.localeCompare(t))[0];if(r===void 0)return[];let i=[];for(let t=r;t<=e.endDate;t=Le(t,1))i.push(n.get(t)??{date:t,claudeCost:0,codexCost:0,claudeTokens:0,codexTokens:0});return i}function ze(e,t){let n=new Map;for(let r of e){let e=t===`model`?`${r.provider}\0${r.model}`:r.date,i=n.get(e)??{key:e,label:t===`model`?r.model:r.date,...t===`model`?{provider:r.provider}:{},tokens:0,costUsd:null,unpricedTokens:0,responses:0};n.set(e,{...i,tokens:i.tokens+r.tokens.totalTokens,costUsd:r.estimatedCostUsd===void 0?i.costUsd:(i.costUsd??0)+r.estimatedCostUsd,unpricedTokens:i.unpricedTokens+r.unpricedTokenCount,responses:i.responses+r.responseCount})}let r=[...n.values()].some(e=>e.costUsd!==null);return[...n.values()].toSorted((e,t)=>r&&(t.costUsd??-1)-(e.costUsd??-1)||t.tokens-e.tokens)}var Be=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),Z={claude:`#d97757`,codex:`var(--foreground)`};function Ve(e){return e===null?`Unavailable`:Be.format(e)}function He(e){let t=(0,K.c)(90),{search:n,onSearchChange:r}=e,i;t[0]!==n.environmentIds||t[1]!==n.range?(i={range:n.range,environmentIds:n.environmentIds},t[0]=n.environmentIds,t[1]=n.range,t[2]=i):i=t[2];let a=Pe(i),{merged:o}=a,s;bb0:{if(!o){s=null;break bb0}let e,r,i,a;if(t[3]!==o||t[4]!==n.providers||t[5]!==n.usageBreakdown){let s=Fe(o,n.providers);e=s,r=Ie(o,s),i=Re(o,s),a=ze(s,n.usageBreakdown),t[3]=o,t[4]=n.providers,t[5]=n.usageBreakdown,t[6]=e,t[7]=r,t[8]=i,t[9]=a}else e=t[6],r=t[7],i=t[8],a=t[9];let c;t[10]!==e||t[11]!==r||t[12]!==i||t[13]!==a?(c={buckets:e,totals:r,days:i,breakdown:a},t[10]=e,t[11]=r,t[12]=i,t[13]=a,t[14]=c):c=t[14],s=c}let c=s;if(a.loading&&!o){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(ee,{}),t[15]=e):e=t[15],e}if(!o||!c){let e,n,r,i;if(t[16]!==a.environments){let o=a.environments.filter(Ke);e=D,n=o.length>0?z:ve,r=o.length>0?`Couldn’t load usage`:`No usage environments are connected`,i=o.length>0?`Usage failed for ${o.map(Ge).join(`, `)}. ${o[0]?.message??`Retry after checking the environment connection.`}`:`Connect an environment with Claude Code or Codex transcripts, then refresh this view.`,t[16]=a.environments,t[17]=e,t[18]=n,t[19]=r,t[20]=i}else e=t[17],n=t[18],r=t[19],i=t[20];let o;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(U,{}),t[21]=o):o=t[21];let s;t[22]===a.refresh?s=t[23]:(s=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:a.refresh,children:[o,` Refresh`]}),t[22]=a.refresh,t[23]=s);let c;return t[24]!==e||t[25]!==n||t[26]!==r||t[27]!==i||t[28]!==s?(c=(0,q.jsx)(e,{icon:n,title:r,description:i,action:s}),t[24]=e,t[25]=n,t[26]=r,t[27]=i,t[28]=s,t[29]=c):c=t[29],c}let{totals:l,days:u,breakdown:d}=c,f=l.pricedTokenCount+l.unpricedTokenCount>0?l.pricedTokenCount/(l.pricedTokenCount+l.unpricedTokenCount):0,m=l.uncachedInputTokens+l.cachedInputTokens+l.cacheCreationInputTokens>0?l.cachedInputTokens/(l.uncachedInputTokens+l.cachedInputTokens+l.cacheCreationInputTokens):0,h=n.environmentIds===void 0||n.environmentIds?.length!==1?`all`:n.environmentIds[0],g;t[30]===o.sources?g=t[31]:(g=o.sources.some(We),t[30]=o.sources,t[31]=g);let _=g,y;t[32]!==r||t[33]!==n?(y=(0,q.jsx)(qe,{search:n,onSearchChange:r}),t[32]=r,t[33]=n,t[34]=y):y=t[34];let b;t[35]!==r||t[36]!==n?(b=e=>r({...n,...e===null||e===`all`?{environmentIds:void 0}:{environmentIds:[e]}}),t[35]=r,t[36]=n,t[37]=b):b=t[37];let C;t[38]!==a.availableEnvironments||t[39]!==h?(C=h===`all`?`All environments (${a.availableEnvironments.length})`:a.availableEnvironments.find(e=>e.environmentId===h)?.label??`Environment`,t[38]=a.availableEnvironments,t[39]=h,t[40]=C):C=t[40];let w;t[41]===C?w=t[42]:(w=(0,q.jsx)(fe,{size:`sm`,className:`w-48`,"aria-label":`Usage environment`,children:(0,q.jsx)(pe,{children:C})}),t[41]=C,t[42]=w);let T;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,q.jsx)(de,{value:`all`,children:`All environments`}),t[43]=T):T=t[43];let E;t[44]===a.availableEnvironments?E=t[45]:(E=a.availableEnvironments.map(Ue),t[44]=a.availableEnvironments,t[45]=E);let O;t[46]===E?O=t[47]:(O=(0,q.jsxs)(ue,{alignItemWithTrigger:!1,children:[T,E]}),t[46]=E,t[47]=O);let k;t[48]!==h||t[49]!==O||t[50]!==b||t[51]!==w?(k=(0,q.jsxs)(me,{value:h,onValueChange:b,children:[w,O]}),t[48]=h,t[49]=O,t[50]=b,t[51]=w,t[52]=k):k=t[52];let A;t[53]!==r||t[54]!==n?(A=(0,q.jsx)(Je,{search:n,onSearchChange:r}),t[53]=r,t[54]=n,t[55]=A):A=t[55];let M;t[56]!==k||t[57]!==A||t[58]!==y?(M=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[y,k,A]}),t[56]=k,t[57]=A,t[58]=y,t[59]=M):M=t[59];let N=a.refreshing?`animate-spin`:void 0,P;t[60]===N?P=t[61]:(P=(0,q.jsx)(U,{className:N}),t[60]=N,t[61]=P);let F=a.refreshing?`Refreshing`:`Refresh`,L;t[62]!==a.refresh||t[63]!==a.refreshing||t[64]!==P||t[65]!==F?(L=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:a.refresh,disabled:a.refreshing,children:[P,F]}),t[62]=a.refresh,t[63]=a.refreshing,t[64]=P,t[65]=F,t[66]=L):L=t[66];let R;t[67]!==M||t[68]!==L?(R=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[M,L]}),t[67]=M,t[68]=L,t[69]=R):R=t[69];let B;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,q.jsx)(`p`,{className:`max-w-3xl text-sm leading-relaxed text-muted-foreground`,children:`Provider-recorded usage from Claude Code and Codex transcripts on the selected machines. This includes sessions run outside Ryco and is intentionally not attributed to projects.`}),t[70]=B):B=t[70];let V;t[71]!==d||t[72]!==m||t[73]!==u||t[74]!==c.buckets.length||t[75]!==_||t[76]!==o||t[77]!==r||t[78]!==f||t[79]!==n||t[80]!==l.distinctSessionCount||t[81]!==l.estimatedCacheSavingsUsd||t[82]!==l.estimatedCostUsd||t[83]!==l.reasoningTokens||t[84]!==l.responseCount||t[85]!==l.totalTokens?(V=c.buckets.length===0?(0,q.jsx)(D,{icon:te,title:_?`No usage in this range`:`No transcript sources found`,description:_?`The transcript sources were found, but no provider-recorded usage matched these filters.`:`Claude Code and Codex transcript directories were not found on the selected environments.`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`section`,{className:`grid overflow-hidden rounded-2xl border border-border/75 bg-card shadow-sm/5 lg:grid-cols-[minmax(18rem,0.72fr)_minmax(0,1.55fr)]`,children:[(0,q.jsxs)(`div`,{className:`flex min-h-80 flex-col justify-between border-b border-border/70 p-6 lg:border-r lg:border-b-0 lg:p-8`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:[(0,q.jsx)(_e,{className:`size-3.5`}),` Raw API-equivalent cost`]}),(0,q.jsx)(`div`,{className:`mt-5 text-4xl font-semibold tracking-[-0.045em] tabular-nums sm:text-5xl`,children:Ve(l.estimatedCostUsd)}),(0,q.jsx)(`p`,{className:`mt-3 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:`Estimate based on base API rates. Subscription, credits, batch, negotiated, and provider billing may differ.`})]}),(0,q.jsxs)(`div`,{className:`space-y-4 border-t border-border/65 pt-5`,children:[(0,q.jsx)(et,{label:`Priced coverage`,value:`${Math.round(f*100)}% of tokens`}),(0,q.jsx)(et,{label:`Estimated cache savings`,value:Ve(l.estimatedCacheSavingsUsd)}),(0,q.jsx)(et,{label:`Provider-recorded tokens`,value:I(l.totalTokens)})]})]}),(0,q.jsxs)(`div`,{className:`min-w-0 p-4 sm:p-6`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3 px-1`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Usage over time`}),(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Daily values in `,o.timeZone]})]}),(0,q.jsx)(Ye,{search:n,onSearchChange:r})]}),(0,q.jsx)(Ze,{data:u,metric:n.usageMetric}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-4 px-2 text-[11px] text-muted-foreground`,children:[(0,q.jsx)(tt,{color:Z.claude,label:`Claude`}),(0,q.jsx)(tt,{color:Z.codex,label:`Codex`})]})]})]}),(0,q.jsxs)(`div`,{className:`grid grid-cols-2 border-y border-border/65 md:grid-cols-5`,children:[(0,q.jsx)(Q,{label:`Total tokens`,value:v(l.totalTokens)}),(0,q.jsx)(Q,{label:`Sessions`,value:I(l.distinctSessionCount)}),(0,q.jsx)(Q,{label:`Responses`,value:I(l.responseCount)}),(0,q.jsx)(Q,{label:`Cache read`,value:`${Math.round(m*100)}%`}),(0,q.jsx)(Q,{label:`Reasoning`,value:v(l.reasoningTokens),detail:`included in output`})]}),(0,q.jsx)(j,{title:`Breakdown`,icon:te,action:(0,q.jsx)(Xe,{search:n,onSearchChange:r}),bodyClassName:`overflow-hidden`,children:(0,q.jsx)(`div`,{className:`divide-y divide-border/60`,children:d.slice(0,20).map(e=>(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-5 px-4 py-3.5 sm:px-5`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:n.usageBreakdown===`model`?S(e.label):x(e.label)}),(0,q.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e.provider?p(e.provider):`${e.responses} responses`})]}),(0,q.jsxs)(`div`,{className:`text-right`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:v(e.tokens)}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`tokens`})]}),(0,q.jsxs)(`div`,{className:`w-24 text-right`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:Ve(e.costUsd)}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.unpricedTokens>0?`${v(e.unpricedTokens)} unpriced`:`estimated`})]})]},e.key))})}),(0,q.jsx)(nt,{summary:o})]}),t[71]=d,t[72]=m,t[73]=u,t[74]=c.buckets.length,t[75]=_,t[76]=o,t[77]=r,t[78]=f,t[79]=n,t[80]=l.distinctSessionCount,t[81]=l.estimatedCacheSavingsUsd,t[82]=l.estimatedCostUsd,t[83]=l.reasoningTokens,t[84]=l.responseCount,t[85]=l.totalTokens,t[86]=V):V=t[86];let H;return t[87]!==R||t[88]!==V?(H=(0,q.jsxs)(`div`,{className:`space-y-8`,children:[R,B,V]}),t[87]=R,t[88]=V,t[89]=H):H=t[89],H}function Ue(e){return(0,q.jsx)(de,{value:e.environmentId,children:e.label},e.environmentId)}function We(e){return e.included&&e.status!==`not-found`}function Ge(e){return e.label}function Ke(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function qe(e){let t=(0,K.c)(3),{search:n,onSearchChange:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,q.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,range:e}),className:W(`h-7 rounded-md px-2.5 text-xs font-medium transition-colors`,n.range===e?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:e===`all`?`All`:e.toUpperCase()},e))}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Je(e){let t=(0,K.c)(3),{search:n,onSearchChange:r}=e,i;if(t[0]!==r||t[1]!==n){let e=new Set(n.providers??[`claude`,`codex`]);i=(0,q.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`claude`,`codex`].map(t=>(0,q.jsxs)(`button`,{type:`button`,"aria-pressed":e.has(t),onClick:()=>{let i=new Set(e);i.has(t)&&i.size>1?i.delete(t):i.add(t);let a=[...i].toSorted();r({...n,...a.length===2?{providers:void 0}:{providers:a}})},className:W(`inline-flex h-7 items-center rounded-md px-2.5 text-xs font-medium capitalize transition-colors`,e.has(t)?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block size-1.5 rounded-full`,style:{backgroundColor:Z[t]}}),t]},t))}),t[0]=r,t[1]=n,t[2]=i}else i=t[2];return i}function Ye(e){let t=(0,K.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`cost`,`tokens`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageMetric:e}),className:W(`h-6 rounded-sm px-2 text-[11px] font-medium capitalize`,n.usageMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Xe(e){let t=(0,K.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`model`,`day`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(`div`,{className:`inline-flex items-center gap-1 text-[11px]`,children:i.map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageBreakdown:e}),className:W(`rounded-md px-2 py-1 capitalize`,n.usageBreakdown===e?`bg-accent text-foreground`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Ze(e){let t=(0,K.c)(21),{data:n,metric:r}=e,i=r===`cost`?`Cost`:`Tokens`,a;t[0]===n?a=t[1]:(a=[...n],t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={left:4,right:10,top:18,bottom:0},t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsxs)(`linearGradient`,{id:`usageClaude`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`5%`,stopColor:Z.claude,stopOpacity:.3}),(0,q.jsx)(`stop`,{offset:`95%`,stopColor:Z.claude,stopOpacity:.02})]}),t[3]=s):s=t[3];let c,l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,q.jsxs)(`defs`,{children:[s,(0,q.jsxs)(`linearGradient`,{id:`usageCodex`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`5%`,stopColor:Z.codex,stopOpacity:.18}),(0,q.jsx)(`stop`,{offset:`95%`,stopColor:Z.codex,stopOpacity:.01})]})]}),l=(0,q.jsx)(b,{vertical:!1,strokeDasharray:`3 5`}),d=(0,q.jsx)(h,{dataKey:`date`,tickLine:!1,axisLine:!1,minTickGap:30,tickFormatter:$e}),t[4]=c,t[5]=l,t[6]=d):(c=t[4],l=t[5],d=t[6]);let f;t[7]===r?f=t[8]:(f=(0,q.jsx)(m,{tickLine:!1,axisLine:!1,width:44,tickFormatter:e=>r===`cost`?`$${Number(e).toFixed(+(Number(e)<10))}`:v(Number(e))}),t[7]=r,t[8]=f);let p;t[9]===r?p=t[10]:(p=(0,q.jsx)(O,{content:(0,q.jsx)(_,{labelFormatter:Qe,formatter:e=>r===`cost`?Be.format(Number(e)||0):I(Number(e)||0)})}),t[9]=r,t[10]=p);let x=`claude${i}`,S;t[11]===x?S=t[12]:(S=(0,q.jsx)(g,{dataKey:x,name:`Claude`,type:`monotone`,stroke:Z.claude,fill:`url(#usageClaude)`,strokeWidth:1.75}),t[11]=x,t[12]=S);let C=`codex${i}`,w;t[13]===C?w=t[14]:(w=(0,q.jsx)(g,{dataKey:C,name:`Codex`,type:`monotone`,stroke:Z.codex,fill:`url(#usageCodex)`,strokeWidth:1.75}),t[13]=C,t[14]=w);let T;return t[15]!==a||t[16]!==S||t[17]!==w||t[18]!==f||t[19]!==p?(T=(0,q.jsx)(u,{className:`h-[300px]`,children:(0,q.jsxs)(y,{data:a,margin:o,children:[c,l,d,f,p,S,w]})}),t[15]=a,t[16]=S,t[17]=w,t[18]=f,t[19]=p,t[20]=T):T=t[20],T}function Qe(e){return x(String(e))}function $e(e){return x(String(e))}function et(e){let t=(0,K.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,q.jsx)(`span`,{className:`font-medium tabular-nums`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-xs`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Q(e){let t=(0,K.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,q.jsx)(`p`,{className:`text-[10px] font-semibold tracking-[0.1em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,q.jsx)(`p`,{className:`mt-2 text-xl font-semibold tracking-tight tabular-nums`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,q.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,q.jsxs)(`div`,{className:`border-r border-border/60 px-4 py-5 last:border-r-0`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function tt(e){let t=(0,K.c)(5),{color:n,label:r}=e,i;t[0]===n?i=t[1]:(i=(0,q.jsx)(`span`,{className:`size-2 rounded-sm`,style:{backgroundColor:n}}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function nt(e){let t=(0,K.c)(43),{summary:n}=e,r,i,a,o,s,c,l,u,d,p,m,h,g,_;if(t[0]!==n.duplicateSourceCount||t[1]!==n.environmentOnlyDeduplicationWarning||t[2]!==n.environments||t[3]!==n.sources){let e=n.sources.filter(mt),v=e.filter(pt),y=n.environments.filter(ft),b=n.environments.flatMap(dt),x=b.length===0?`Unavailable`:b.every(ut)?`Live`:b.every(lt)?`Cached`:b.every(ct)?`Unavailable`:`Mixed`,S=n.environments.flatMap(st).toSorted().at(-1),C=e.map(ot).toSorted().at(-1);i=j,_=`Coverage & estimates`,o=ge,s=`p-5`,c=y.length>0?(0,q.jsxs)(`div`,{className:`mb-5 flex gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,q.jsx)(z,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,q.jsxs)(`span`,{children:[`No usage was included from`,` `,y.map(at).join(`, `),`.`]})]}):null,p=`grid gap-5 md:grid-cols-2 xl:grid-cols-4`;let w=`${e.length} included`,T=n.duplicateSourceCount>0?`${n.duplicateSourceCount} duplicate source excluded`:`No physical duplicates detected`;t[18]!==w||t[19]!==T?(m=(0,q.jsx)($,{icon:ve,label:`Transcript sources`,value:w,detail:T}),t[18]=w,t[19]=T,t[20]=m):m=t[20],h=(0,q.jsx)($,{icon:ie,label:`Last scan`,value:C?f(C):`Not scanned`,detail:`${e.reduce(it,0)} cached files reused`});let E=S?`Rates fetched ${f(S)}`:`Token totals remain available without rates`;t[21]!==x||t[22]!==E?(g=(0,q.jsx)($,{icon:_e,label:`Pricing`,value:x,detail:E}),t[21]=x,t[22]=E,t[23]=g):g=t[23],r=$,a=z,l=`Coverage state`,u=v.length===0?`Complete`:`${v.length} source notice${v.length===1?``:`s`}`,d=n.environmentOnlyDeduplicationWarning?`Some sources could only be scoped per environment`:`${e.reduce(rt,0)} malformed lines skipped`,t[0]=n.duplicateSourceCount,t[1]=n.environmentOnlyDeduplicationWarning,t[2]=n.environments,t[3]=n.sources,t[4]=r,t[5]=i,t[6]=a,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=p,t[14]=m,t[15]=h,t[16]=g,t[17]=_}else r=t[4],i=t[5],a=t[6],o=t[7],s=t[8],c=t[9],l=t[10],u=t[11],d=t[12],p=t[13],m=t[14],h=t[15],g=t[16],_=t[17];let v;t[24]!==r||t[25]!==a||t[26]!==l||t[27]!==u||t[28]!==d?(v=(0,q.jsx)(r,{icon:a,label:l,value:u,detail:d}),t[24]=r,t[25]=a,t[26]=l,t[27]=u,t[28]=d,t[29]=v):v=t[29];let y;t[30]!==v||t[31]!==p||t[32]!==m||t[33]!==h||t[34]!==g?(y=(0,q.jsxs)(`div`,{className:p,children:[m,h,g,v]}),t[30]=v,t[31]=p,t[32]=m,t[33]=h,t[34]=g,t[35]=y):y=t[35];let b;return t[36]!==i||t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==y||t[41]!==_?(b=(0,q.jsxs)(i,{title:_,icon:o,bodyClassName:s,children:[c,y]}),t[36]=i,t[37]=o,t[38]=s,t[39]=c,t[40]=y,t[41]=_,t[42]=b):b=t[42],b}function rt(e,t){return e+t.malformedLineCount}function it(e,t){return e+t.reusedCacheFileCount}function at(e){return e.label}function ot(e){return e.scanFinishedAt}function st(e){let t=e.summary?.pricing.fetchedAt;return t===void 0?[]:[t]}function ct(e){return e===`unavailable`}function lt(e){return e===`cached`}function ut(e){return e===`live`}function dt(e){return e.summary===void 0?[]:[e.summary.pricing.state]}function ft(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function pt(e){return e.status!==`complete`}function mt(e){return e.included}function $(e){let t=(0,K.c)(15),{icon:n,label:r,value:i,detail:a}=e,o;t[0]===n?o=t[1]:(o=(0,q.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,q.jsx)(n,{className:`size-4`})}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,q.jsx)(`p`,{className:`mt-1 text-sm font-medium`,children:i}),t[4]=i,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,q.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:a}),t[6]=a,t[7]=l);let u;t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,q.jsxs)(`div`,{children:[s,c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==o||t[13]!==u?(d=(0,q.jsxs)(`div`,{className:`flex gap-3`,children:[o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14],d}function ht(e){let t=(0,K.c)(25),{search:n,onSearchChange:i}=e,a=n.view===`usage`?r.serverGetUsageSummary:r.serverGetStatistics,o=ce(a),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`h1`,{className:`truncate text-sm font-semibold tracking-tight`,children:`Statistics`}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Usage and work signals`})]}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`usage`,`activity`],t[1]=c):c=t[1];let u;t[2]!==i||t[3]!==n?(u=(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-5`,children:[s,(0,q.jsx)(`div`,{className:`inline-flex rounded-lg bg-muted/75 p-0.5`,children:c.map(e=>{let t=e===`usage`?R:l;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>i({...n,view:e}),className:W(`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors`,n.view===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,q.jsx)(t,{className:`size-3.5`}),` `,e]},e)})})]}),t[2]=i,t[3]=n,t[4]=u):u=t[4];let d;t[5]===n.range?d=t[6]:(d=n.range===`all`?`All available history`:`Last ${n.range.slice(0,-1)} days`,t[5]=n.range,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,q.jsx)(`p`,{className:`text-xs font-medium`,children:d}),t[7]=d,t[8]=f);let p=n.view===`usage`?`Local calendar window`:`UTC activity window`,m;t[9]===p?m=t[10]:(m=(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:p}),t[9]=p,t[10]=m);let h;t[11]!==f||t[12]!==m?(h=(0,q.jsxs)(`div`,{className:`hidden text-right sm:block`,children:[f,m]}),t[11]=f,t[12]=m,t[13]=h):h=t[13];let g;t[14]!==u||t[15]!==h?(g=(0,q.jsxs)(`header`,{className:`flex min-h-14 shrink-0 items-center border-b border-border/75 bg-background/90 px-5 backdrop-blur-sm sm:px-7`,children:[u,h]}),t[14]=u,t[15]=h,t[16]=g):g=t[16];let _;t[17]!==o.allowed||t[18]!==o.reason||t[19]!==i||t[20]!==n?(_=(0,q.jsx)(se,{className:`min-h-0 flex-1`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-[1480px] px-5 py-7 sm:px-8 sm:py-9 lg:px-10`,children:o.allowed?n.view===`usage`?(0,q.jsx)(He,{search:n,onSearchChange:i}):(0,q.jsx)(ye,{search:n,onSearchChange:i}):(0,q.jsx)(D,{icon:re,title:`Statistics aren’t available for this session`,description:o.reason??`Owner access is required.`})})}),t[17]=o.allowed,t[18]=o.reason,t[19]=i,t[20]=n,t[21]=_):_=t[21];let v;return t[22]!==_||t[23]!==g?(v=(0,q.jsx)(le,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[g,_]})}),t[22]=_,t[23]=g,t[24]=v):v=t[24],v}export{ht as StatisticsPage};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{t as r}from"./src-DmPIm3ie.js";import{u as i,y as a}from"./runtime-QZPKtH2P.js";import{n as o}from"./primary-CiDY2oUi.js";import{It as s}from"./composerDraftStore-TYv9j3vY.js";import{f as c}from"./useRenderElement-DchFnsR8.js";import{t as l}from"./activity-1CkdQG5u.js";import{A as u,C as d,D as f,E as p,F as m,I as h,L as g,M as _,O as v,P as y,R as b,S as x,T as S,_ as C,c as w,d as T,f as E,g as D,h as ee,j as O,m as k,o as A,p as j,r as M,s as N,t as P,v as F,w as I,x as L}from"./useStatistics-Dbp94K5j.js";import{t as R}from"./chart-column-Dw6ACmXM.js";import{t as z}from"./circle-alert-BWvs6IOn.js";import{t as B}from"./clock-3-r12DkpRj.js";import{n as V,t as te}from"./layers-BYi0v17h.js";import{t as H}from"./git-pull-request-DIYyPsg5.js";import{t as ne}from"./messages-square-DiMgWzoq.js";import{t as U}from"./refresh-cw-DopCMrtR.js";import{t as re}from"./shield-alert-DY9uVP5G.js";import{t as ie}from"./sparkles-CAf3oJ5S.js";import{t as ae}from"./triangle-alert-RL_T3KLo.js";import{t as oe}from"./wrench-D0IetWa1.js";import{t as W}from"./utils-CV2fJJxC.js";import{t as se}from"./scroll-area-C0yF015F.js";import{t as G}from"./button-DG8WqjNn.js";import{t as ce}from"./capabilities-xa5Ll0KT.js";import{o as le}from"./sidebar-CFGg5Tkr.js";import{a as ue,i as de,o as fe,s as pe,t as me}from"./select-CZukJlTn.js";import{t as he}from"./badge-w43sx8eF.js";var ge=c(`brain-circuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),_e=c(`circle-dollar-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),ve=c(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),K=n(),q=s();function ye(e){let t=(0,K.c)(56),{search:n,onSearchChange:r}=e,{snapshot:i,loading:a,error:s,refresh:c,refreshing:u}=P(),f=n.projectId??null,p=n.model??null,m=n.modelProvider??null,h;t[0]!==n.range||t[1]!==f||t[2]!==p||t[3]!==m?(h={range:n.range,projectId:f,model:p,provider:m},t[0]=n.range,t[1]=f,t[2]=p,t[3]=m,t[4]=h):h=t[4];let g=h,_;bb0:{if(!i){_=null;break bb0}let e,n,r,a;if(t[5]!==g||t[6]!==i){let o=w(i,g),s=T(o);e=o,n=s,r=N(i,o,g.range),a=M(o,A(i)),t[5]=g,t[6]=i,t[7]=e,t[8]=n,t[9]=r,t[10]=a}else e=t[7],n=t[8],r=t[9],a=t[10];let o;t[11]!==e||t[12]!==n||t[13]!==r||t[14]!==a?(o={buckets:e,totals:n,days:r,projects:a},t[11]=e,t[12]=n,t[13]=r,t[14]=a,t[15]=o):o=t[15],_=o}let y=_;if(a&&!i){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(ee,{}),t[16]=e):e=t[16],e}if(s&&!i){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(U,{}),t[17]=e):e=t[17];let n;t[18]===c?n=t[19]:(n=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:c,children:[e,` Try again`]}),t[18]=c,t[19]=n);let r;return t[20]!==s||t[21]!==n?(r=(0,q.jsx)(D,{icon:ae,title:`Couldn’t load Ryco activity`,description:s,action:n}),t[20]=s,t[21]=n,t[22]=r):r=t[22],r}if(!i||!y)return null;let{totals:b,days:x,projects:S}=y,O=o()?.label??`Current environment`,R;if(t[23]!==x||t[24]!==g||t[25]!==r||t[26]!==S||t[27]!==c||t[28]!==u||t[29]!==n||t[30]!==i.dailyBuckets.length||t[31]!==i.models||t[32]!==i.projects||t[33]!==i.recentPullRequests||t[34]!==i.worktrees||t[35]!==b){let e=xe(x,n.activityMetric),a;t[37]!==r||t[38]!==n?(a=e=>r({...n,range:e.range,projectId:e.projectId??void 0,model:e.model??void 0,modelProvider:e.provider??void 0}),t[37]=r,t[38]=n,t[39]=a):a=t[39];let o;t[40]!==g||t[41]!==i.models||t[42]!==i.projects||t[43]!==a?(o=(0,q.jsx)(E,{filter:g,projects:i.projects,models:i.models,onChange:a}),t[40]=g,t[41]=i.models,t[42]=i.projects,t[43]=a,t[44]=o):o=t[44];let s=u?`animate-spin`:void 0,f;t[45]===s?f=t[46]:(f=(0,q.jsx)(U,{className:s}),t[45]=s,t[46]=f);let p=u?`Refreshing`:`Refresh`,m;t[47]!==c||t[48]!==u||t[49]!==f||t[50]!==p?(m=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:c,disabled:u,children:[f,p]}),t[47]=c,t[48]=u,t[49]=f,t[50]=p,t[51]=m):m=t[51];let h;t[52]!==m||t[53]!==o?(h=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[o,m]}),t[52]=m,t[53]=o,t[54]=h):h=t[54];let _;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,q.jsxs)(`p`,{className:`max-w-4xl text-sm leading-relaxed text-muted-foreground`,children:[`Activity includes work observed by Ryco on`,` `,(0,q.jsx)(`span`,{className:`font-medium text-foreground`,children:O}),`. Usage from other CLI sessions appears in the Usage tab and is not assigned to projects.`]}),t[55]=_):_=t[55],R=(0,q.jsxs)(`div`,{className:`space-y-8`,children:[h,_,i.dailyBuckets.length===0?(0,q.jsx)(D,{icon:l,title:`No Ryco activity yet`,description:`Project and agent activity will appear here after your first completed turns.`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-5`,children:[(0,q.jsx)(k,{label:`Active time`,icon:B,value:d(b.activeMs),sub:`${v(b.totalTokens)} observed tokens`}),(0,q.jsx)(k,{label:`Turns`,icon:l,value:I(b.turns),sub:`Completed agent turns`}),(0,q.jsx)(k,{label:`Chats`,icon:ne,value:I(b.threadsCreated),sub:`Conversations started`}),(0,q.jsx)(k,{label:`Tool uses`,icon:oe,value:I(b.toolUses),sub:`Observed invocations`}),(0,q.jsx)(k,{label:`Files changed`,icon:V,value:I(b.filesChanged),sub:`+${I(b.additions)} / −${I(b.deletions)} lines`})]}),(0,q.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1.2fr_0.8fr]`,children:[(0,q.jsxs)(j,{title:`Activity rhythm`,icon:l,bodyClassName:`p-5`,action:(0,q.jsx)(Se,{search:n,onSearchChange:r}),children:[(0,q.jsx)(L,{points:x,metric:n.activityMetric}),(0,q.jsxs)(`div`,{className:`mt-5 grid grid-cols-3 gap-3 border-t border-border/60 pt-4`,children:[(0,q.jsx)(Y,{label:`Active days`,value:I(e.activeDays)}),(0,q.jsx)(Y,{label:`Current streak`,value:`${I(e.currentStreak)}d`}),(0,q.jsx)(Y,{label:`Busiest UTC day`,value:e.busiestLabel})]})]}),(0,q.jsx)(j,{title:`Projects`,icon:l,bodyClassName:`p-4`,children:(0,q.jsx)(F,{data:S,metric:n.activityMetric})})]}),(0,q.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,q.jsxs)(j,{title:`Code changes`,icon:V,bodyClassName:`p-4`,children:[(0,q.jsxs)(`div`,{className:`mb-4 flex gap-6 text-sm`,children:[(0,q.jsx)(Y,{label:`Files`,value:I(b.filesChanged)}),(0,q.jsx)(Y,{label:`Added`,value:`+${I(b.additions)}`,tone:`positive`}),(0,q.jsx)(Y,{label:`Removed`,value:`−${I(b.deletions)}`,tone:`negative`})]}),(0,q.jsx)(C,{data:x})]}),(0,q.jsxs)(j,{title:`Source control · all time`,icon:H,bodyClassName:`overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 border-b border-border/60 px-4 py-4`,children:[(0,q.jsx)(Y,{label:`Active`,value:I(i.worktrees.active)}),(0,q.jsx)(Y,{label:`Created`,value:I(i.worktrees.created)}),(0,q.jsx)(Y,{label:`Archived`,value:I(i.worktrees.archived)}),(0,q.jsx)(Y,{label:`Open PRs`,value:I(i.worktrees.openPrs)})]}),i.recentPullRequests.length===0?(0,q.jsx)(`div`,{className:`flex h-[260px] items-center justify-center px-6 text-center text-xs text-muted-foreground`,children:`No projected pull requests yet.`}):(0,q.jsx)(`div`,{className:`divide-y divide-border/60`,children:i.recentPullRequests.slice(0,6).map(be)})]})]})]})]}),t[23]=x,t[24]=g,t[25]=r,t[26]=S,t[27]=c,t[28]=u,t[29]=n,t[30]=i.dailyBuckets.length,t[31]=i.models,t[32]=i.projects,t[33]=i.recentPullRequests,t[34]=i.worktrees,t[35]=b,t[36]=R}else R=t[36];return R}function be(e){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,q.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,q.jsx)(H,{className:`size-4`})}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.prTitle||e.worktreeTitle||e.branch}),(0,q.jsxs)(`p`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:[e.projectTitle,` · #`,e.prNumber,` ·`,` `,f(e.updatedAt)]})]}),(0,q.jsx)(he,{variant:e.prState===`merged`?`success`:e.active?`info`:`secondary`,children:e.prIsDraft?`Draft`:e.prState??(e.active?`Open`:`Archived`)})]},e.worktreeId)}function J(e,t){return t===`turns`?e.turns:t===`activeMs`?e.activeMs:e.filesChanged}function xe(e,t){let n=0,r=0,i=null;for(let r of e){let e=J(r,t);e>0&&(n+=1),(i===null||e>J(i,t))&&(i=r)}for(let n=e.length-1;n>=0;--n){let i=e[n];if(i===void 0||J(i,t)<=0)break;r+=1}if(i===null||J(i,t)<=0)return{activeDays:n,currentStreak:r,busiestLabel:`—`};let a=J(i,t),o=t===`activeMs`?d(a):I(a);return{activeDays:n,currentStreak:r,busiestLabel:`${i.date.slice(5)} · ${o}`}}function Se(e){let t=(0,K.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`turns`,`activeMs`,`files`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,activityMetric:e}),className:W(`h-6 rounded-sm px-2 text-[11px]`,n.activityMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e===`activeMs`?`Time`:e===`files`?`Files`:`Turns`},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Y(e){let t=(0,K.c)(10),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,q.jsx)(`p`,{className:`text-[10px] tracking-[0.08em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o=i===`positive`?`text-success-foreground`:i===`negative`?`text-destructive`:`text-foreground`,s;t[2]===o?s=t[3]:(s=W(`mt-1 font-semibold tabular-nums`,o),t[2]=o,t[3]=s);let c;t[4]!==s||t[5]!==r?(c=(0,q.jsx)(`p`,{className:s,children:r}),t[4]=s,t[5]=r,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,q.jsxs)(`div`,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function Ce(e){switch(e){case`complete`:return 4;case`partial`:return 3;case`not-found`:return 2;case`failed`:return 1}}function we(e,t){return Ce(t.source.status)-Ce(e.source.status)||t.source.scanFinishedAt.localeCompare(e.source.scanFinishedAt)||t.environment.summary.generatedAt.localeCompare(e.environment.summary.generatedAt)||e.environment.environmentId.localeCompare(t.environment.environmentId)}function Te(e,t){return{uncachedInputTokens:e.uncachedInputTokens+t.uncachedInputTokens,cachedInputTokens:e.cachedInputTokens+t.cachedInputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens+t.cacheCreationInputTokens,outputTokens:e.outputTokens+t.outputTokens,reasoningTokens:e.reasoningTokens+t.reasoningTokens,totalTokens:e.totalTokens+t.totalTokens}}function Ee(e,t){if(e.size===0||e.size===1&&e.has(`unpriced`))return`unpriced`;let n=new Set([...e].filter(e=>e!==`unpriced`));return t>0||n.size!==1||e.has(`mixed`)?`mixed`:n.values().next().value??`unpriced`}function De(e){let t=e.filter(e=>e.summary!==void 0&&e.summary.contractVersion===1&&(e.status===`complete`||e.status===`partial`));if(t.length===0)return null;let n=t.flatMap(e=>e.summary.sources.map(t=>({environment:e,source:t}))).toSorted(we),r=new Set,i=new Set,a=[],o=0,s=!1;for(let e of n){let t=`${e.environment.environmentId}\0${e.source.sourceId}`,n=e.source.deduplicationKind===`physical`,c=n&&r.has(e.source.sourceId);n&&!c&&r.add(e.source.sourceId),n||(s=!0),c?o+=1:i.add(t),a.push({...e.source,environmentId:e.environment.environmentId,environmentLabel:e.environment.label,included:!c,...c?{exclusionReason:`duplicate`}:{}})}let c=new Map;for(let e of t)for(let t of e.summary.buckets){let n=`${e.environmentId}\0${t.sourceId}`;if(!i.has(n))continue;let r=`${t.date}\0${t.provider}\0${t.model}`,a=c.get(r);a===void 0&&(a={date:t.date,provider:t.provider,model:t.model,...t.rawModel===void 0?{}:{rawModel:t.rawModel},tokens:{uncachedInputTokens:0,cachedInputTokens:0,cacheCreationInputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0},responseCount:0,sessionCount:0,estimatedCostUsd:0,estimatedCacheSavingsUsd:0,hasCost:!1,hasCacheSavings:!1,pricedTokenCount:0,unpricedTokenCount:0,costSources:new Set,sourceIds:new Set},c.set(r,a)),a.tokens=Te(a.tokens,t.tokens),a.responseCount+=t.responseCount,a.sessionCount+=t.sessionCount,t.estimatedCostUsd!==void 0&&(a.estimatedCostUsd+=t.estimatedCostUsd,a.hasCost=!0),t.estimatedCacheSavingsUsd!==void 0&&(a.estimatedCacheSavingsUsd+=t.estimatedCacheSavingsUsd,a.hasCacheSavings=!0),a.pricedTokenCount+=t.pricedTokenCount,a.unpricedTokenCount+=t.unpricedTokenCount,a.costSources.add(t.costSource),a.sourceIds.add(t.sourceId)}let l=[...c.values()].map(e=>Object.assign({date:e.date,provider:e.provider,model:e.model,tokens:e.tokens,responseCount:e.responseCount,sessionCount:e.sessionCount,pricedTokenCount:e.pricedTokenCount,unpricedTokenCount:e.unpricedTokenCount,costSource:Ee(e.costSources,e.unpricedTokenCount),sourceIds:[...e.sourceIds].toSorted()},e.rawModel===void 0?{}:{rawModel:e.rawModel},e.hasCost?{estimatedCostUsd:e.estimatedCostUsd}:{},e.hasCacheSavings?{estimatedCacheSavingsUsd:e.estimatedCacheSavingsUsd}:{})).toSorted((e,t)=>e.date.localeCompare(t.date)||e.provider.localeCompare(t.provider)||e.model.localeCompare(t.model)),u=t[0]?.summary;return u?{...u.startDate===void 0?{}:{startDate:u.startDate},endDate:u.endDate,timeZone:u.timeZone,buckets:l,sources:a.toSorted((e,t)=>Number(t.included)-Number(e.included)||e.provider.localeCompare(t.provider)||e.environmentLabel.localeCompare(t.environmentLabel)),environments:e,duplicateSourceCount:o,environmentOnlyDeduplicationWarning:s}:null}var Oe=class{#e=0;next(){return this.#e+=1,this.#e}isCurrent(e){return e===this.#e}},X=e(t(),1),ke={"7d":7,"30d":30,"90d":90,all:null};function Ae(e,t){return new Intl.DateTimeFormat(`en-CA`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(new Date(e))}function je(e,t,n=Date.now()){let r=Ae(n,t),i=ke[e];return i===null?{endDate:r,timeZone:t,contractVersion:1}:{startDate:Ae(Date.parse(`${r}T12:00:00.000Z`)-(i-1)*864e5,`UTC`),endDate:r,timeZone:t,contractVersion:1}}function Me(){let e=(0,K.c)(3),[t,n]=(0,X.useState)(0),r,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>a(()=>n(Ne)),o=[],e[0]=r,e[1]=o):(r=e[0],o=e[1]),(0,X.useEffect)(r,o);let s;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=i(),e[2]=s):s=e[2],s}function Ne(e){return e+1}function Pe(e){let t=Me(),n=(0,X.useMemo)(()=>t.map(e=>({environmentId:e.environmentId,label:e.knownEnvironment.label})).toSorted((e,t)=>e.label.localeCompare(t.label)),[t]),r=(0,X.useMemo)(()=>{if(e.environmentIds===void 0||e.environmentIds.length===0)return t;let n=new Set(e.environmentIds);return t.filter(e=>n.has(e.environmentId))},[t,e.environmentIds]),i=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,[a,o]=(0,X.useState)(0),[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)([]),[d,f]=(0,X.useState)(!0),p=(0,X.useRef)(new Oe),m=r.map(e=>e.environmentId).toSorted().join(`\0`);(0,X.useEffect)(()=>{let t=p.current.next(),n=je(e.range,i);f(!0),Promise.all(r.map(async e=>{try{let t=await e.client.server.getUsageSummary(n);if(t.contractVersion!==1)return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:`stale-contract`,message:`This environment uses an incompatible usage contract.`};let r=t.sources.some(e=>e.status===`partial`||e.status===`failed`);return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:r?`partial`:`complete`,summary:t}}catch(t){return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:`failed`,message:t instanceof Error?t.message:String(t)}}})).then(e=>{p.current.isCurrent(t)&&(u(e),c(De(e)),f(!1))})},[e.range,a,r,m,i]);let h=(0,X.useCallback)(()=>o(e=>e+1),[]);return{merged:s,environments:l,availableEnvironments:n,loading:d,refreshing:d&&s!==null,refresh:h}}function Fe(e,t){if(t===void 0||t.length===0)return e.buckets;let n=new Set(t);return e.buckets.filter(e=>n.has(e.provider))}function Ie(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=!1,f=!1,p=0,m=0;for(let e of t)n+=e.tokens.totalTokens,r+=e.tokens.uncachedInputTokens,i+=e.tokens.cachedInputTokens,a+=e.tokens.cacheCreationInputTokens,o+=e.tokens.outputTokens,s+=e.tokens.reasoningTokens,c+=e.responseCount,p+=e.pricedTokenCount,m+=e.unpricedTokenCount,e.estimatedCostUsd!==void 0&&(l+=e.estimatedCostUsd,d=!0),e.estimatedCacheSavingsUsd!==void 0&&(u+=e.estimatedCacheSavingsUsd,f=!0);let h=new Set(t.map(e=>e.provider)),g=e.sources.filter(e=>e.included&&h.has(e.provider)&&e.status!==`not-found`&&e.status!==`failed`).reduce((e,t)=>e+t.distinctSessionCount,0);return{totalTokens:n,uncachedInputTokens:r,cachedInputTokens:i,cacheCreationInputTokens:a,outputTokens:o,reasoningTokens:s,responseCount:c,distinctSessionCount:g,estimatedCostUsd:d?l:null,estimatedCacheSavingsUsd:f?u:null,pricedTokenCount:p,unpricedTokenCount:m}}function Le(e,t){return new Date(Date.parse(`${e}T12:00:00.000Z`)+t*864e5).toISOString().slice(0,10)}function Re(e,t){let n=new Map;for(let e of t){let t=n.get(e.date)??{date:e.date,claudeCost:0,codexCost:0,claudeTokens:0,codexTokens:0};n.set(e.date,{...t,...e.provider===`claude`?{claudeCost:t.claudeCost+(e.estimatedCostUsd??0),claudeTokens:t.claudeTokens+e.tokens.totalTokens}:{codexCost:t.codexCost+(e.estimatedCostUsd??0),codexTokens:t.codexTokens+e.tokens.totalTokens}})}let r=e.startDate??[...n.keys()].toSorted((e,t)=>e.localeCompare(t))[0];if(r===void 0)return[];let i=[];for(let t=r;t<=e.endDate;t=Le(t,1))i.push(n.get(t)??{date:t,claudeCost:0,codexCost:0,claudeTokens:0,codexTokens:0});return i}function ze(e,t){let n=new Map;for(let r of e){let e=t===`model`?`${r.provider}\0${r.model}`:r.date,i=n.get(e)??{key:e,label:t===`model`?r.model:r.date,...t===`model`?{provider:r.provider}:{},tokens:0,costUsd:null,unpricedTokens:0,responses:0};n.set(e,{...i,tokens:i.tokens+r.tokens.totalTokens,costUsd:r.estimatedCostUsd===void 0?i.costUsd:(i.costUsd??0)+r.estimatedCostUsd,unpricedTokens:i.unpricedTokens+r.unpricedTokenCount,responses:i.responses+r.responseCount})}let r=[...n.values()].some(e=>e.costUsd!==null);return[...n.values()].toSorted((e,t)=>r&&(t.costUsd??-1)-(e.costUsd??-1)||t.tokens-e.tokens)}var Be=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),Z={claude:`#d97757`,codex:`var(--foreground)`};function Ve(e){return e===null?`Unavailable`:Be.format(e)}function He(e){let t=(0,K.c)(90),{search:n,onSearchChange:r}=e,i;t[0]!==n.environmentIds||t[1]!==n.range?(i={range:n.range,environmentIds:n.environmentIds},t[0]=n.environmentIds,t[1]=n.range,t[2]=i):i=t[2];let a=Pe(i),{merged:o}=a,s;bb0:{if(!o){s=null;break bb0}let e,r,i,a;if(t[3]!==o||t[4]!==n.providers||t[5]!==n.usageBreakdown){let s=Fe(o,n.providers);e=s,r=Ie(o,s),i=Re(o,s),a=ze(s,n.usageBreakdown),t[3]=o,t[4]=n.providers,t[5]=n.usageBreakdown,t[6]=e,t[7]=r,t[8]=i,t[9]=a}else e=t[6],r=t[7],i=t[8],a=t[9];let c;t[10]!==e||t[11]!==r||t[12]!==i||t[13]!==a?(c={buckets:e,totals:r,days:i,breakdown:a},t[10]=e,t[11]=r,t[12]=i,t[13]=a,t[14]=c):c=t[14],s=c}let c=s;if(a.loading&&!o){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(ee,{}),t[15]=e):e=t[15],e}if(!o||!c){let e,n,r,i;if(t[16]!==a.environments){let o=a.environments.filter(Ke);e=D,n=o.length>0?z:ve,r=o.length>0?`Couldn’t load usage`:`No usage environments are connected`,i=o.length>0?`Usage failed for ${o.map(Ge).join(`, `)}. ${o[0]?.message??`Retry after checking the environment connection.`}`:`Connect an environment with Claude Code or Codex transcripts, then refresh this view.`,t[16]=a.environments,t[17]=e,t[18]=n,t[19]=r,t[20]=i}else e=t[17],n=t[18],r=t[19],i=t[20];let o;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(U,{}),t[21]=o):o=t[21];let s;t[22]===a.refresh?s=t[23]:(s=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:a.refresh,children:[o,` Refresh`]}),t[22]=a.refresh,t[23]=s);let c;return t[24]!==e||t[25]!==n||t[26]!==r||t[27]!==i||t[28]!==s?(c=(0,q.jsx)(e,{icon:n,title:r,description:i,action:s}),t[24]=e,t[25]=n,t[26]=r,t[27]=i,t[28]=s,t[29]=c):c=t[29],c}let{totals:l,days:u,breakdown:d}=c,f=l.pricedTokenCount+l.unpricedTokenCount>0?l.pricedTokenCount/(l.pricedTokenCount+l.unpricedTokenCount):0,m=l.uncachedInputTokens+l.cachedInputTokens+l.cacheCreationInputTokens>0?l.cachedInputTokens/(l.uncachedInputTokens+l.cachedInputTokens+l.cacheCreationInputTokens):0,h=n.environmentIds===void 0||n.environmentIds?.length!==1?`all`:n.environmentIds[0],g;t[30]===o.sources?g=t[31]:(g=o.sources.some(We),t[30]=o.sources,t[31]=g);let _=g,y;t[32]!==r||t[33]!==n?(y=(0,q.jsx)(qe,{search:n,onSearchChange:r}),t[32]=r,t[33]=n,t[34]=y):y=t[34];let b;t[35]!==r||t[36]!==n?(b=e=>r({...n,...e===null||e===`all`?{environmentIds:void 0}:{environmentIds:[e]}}),t[35]=r,t[36]=n,t[37]=b):b=t[37];let C;t[38]!==a.availableEnvironments||t[39]!==h?(C=h===`all`?`All environments (${a.availableEnvironments.length})`:a.availableEnvironments.find(e=>e.environmentId===h)?.label??`Environment`,t[38]=a.availableEnvironments,t[39]=h,t[40]=C):C=t[40];let w;t[41]===C?w=t[42]:(w=(0,q.jsx)(fe,{size:`sm`,className:`w-48`,"aria-label":`Usage environment`,children:(0,q.jsx)(pe,{children:C})}),t[41]=C,t[42]=w);let T;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,q.jsx)(de,{value:`all`,children:`All environments`}),t[43]=T):T=t[43];let E;t[44]===a.availableEnvironments?E=t[45]:(E=a.availableEnvironments.map(Ue),t[44]=a.availableEnvironments,t[45]=E);let O;t[46]===E?O=t[47]:(O=(0,q.jsxs)(ue,{alignItemWithTrigger:!1,children:[T,E]}),t[46]=E,t[47]=O);let k;t[48]!==h||t[49]!==O||t[50]!==b||t[51]!==w?(k=(0,q.jsxs)(me,{value:h,onValueChange:b,children:[w,O]}),t[48]=h,t[49]=O,t[50]=b,t[51]=w,t[52]=k):k=t[52];let A;t[53]!==r||t[54]!==n?(A=(0,q.jsx)(Je,{search:n,onSearchChange:r}),t[53]=r,t[54]=n,t[55]=A):A=t[55];let M;t[56]!==k||t[57]!==A||t[58]!==y?(M=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[y,k,A]}),t[56]=k,t[57]=A,t[58]=y,t[59]=M):M=t[59];let N=a.refreshing?`animate-spin`:void 0,P;t[60]===N?P=t[61]:(P=(0,q.jsx)(U,{className:N}),t[60]=N,t[61]=P);let F=a.refreshing?`Refreshing`:`Refresh`,L;t[62]!==a.refresh||t[63]!==a.refreshing||t[64]!==P||t[65]!==F?(L=(0,q.jsxs)(G,{size:`sm`,variant:`outline`,onClick:a.refresh,disabled:a.refreshing,children:[P,F]}),t[62]=a.refresh,t[63]=a.refreshing,t[64]=P,t[65]=F,t[66]=L):L=t[66];let R;t[67]!==M||t[68]!==L?(R=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[M,L]}),t[67]=M,t[68]=L,t[69]=R):R=t[69];let B;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,q.jsx)(`p`,{className:`max-w-3xl text-sm leading-relaxed text-muted-foreground`,children:`Provider-recorded usage from Claude Code and Codex transcripts on the selected machines. This includes sessions run outside Ryco and is intentionally not attributed to projects.`}),t[70]=B):B=t[70];let V;t[71]!==d||t[72]!==m||t[73]!==u||t[74]!==c.buckets.length||t[75]!==_||t[76]!==o||t[77]!==r||t[78]!==f||t[79]!==n||t[80]!==l.distinctSessionCount||t[81]!==l.estimatedCacheSavingsUsd||t[82]!==l.estimatedCostUsd||t[83]!==l.reasoningTokens||t[84]!==l.responseCount||t[85]!==l.totalTokens?(V=c.buckets.length===0?(0,q.jsx)(D,{icon:te,title:_?`No usage in this range`:`No transcript sources found`,description:_?`The transcript sources were found, but no provider-recorded usage matched these filters.`:`Claude Code and Codex transcript directories were not found on the selected environments.`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`section`,{className:`grid overflow-hidden rounded-2xl border border-border/75 bg-card shadow-sm/5 lg:grid-cols-[minmax(18rem,0.72fr)_minmax(0,1.55fr)]`,children:[(0,q.jsxs)(`div`,{className:`flex min-h-80 flex-col justify-between border-b border-border/70 p-6 lg:border-r lg:border-b-0 lg:p-8`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:[(0,q.jsx)(_e,{className:`size-3.5`}),` Raw API-equivalent cost`]}),(0,q.jsx)(`div`,{className:`mt-5 text-4xl font-semibold tracking-[-0.045em] tabular-nums sm:text-5xl`,children:Ve(l.estimatedCostUsd)}),(0,q.jsx)(`p`,{className:`mt-3 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:`Estimate based on base API rates. Subscription, credits, batch, negotiated, and provider billing may differ.`})]}),(0,q.jsxs)(`div`,{className:`space-y-4 border-t border-border/65 pt-5`,children:[(0,q.jsx)(et,{label:`Priced coverage`,value:`${Math.round(f*100)}% of tokens`}),(0,q.jsx)(et,{label:`Estimated cache savings`,value:Ve(l.estimatedCacheSavingsUsd)}),(0,q.jsx)(et,{label:`Provider-recorded tokens`,value:I(l.totalTokens)})]})]}),(0,q.jsxs)(`div`,{className:`min-w-0 p-4 sm:p-6`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3 px-1`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Usage over time`}),(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Daily values in `,o.timeZone]})]}),(0,q.jsx)(Ye,{search:n,onSearchChange:r})]}),(0,q.jsx)(Ze,{data:u,metric:n.usageMetric}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-4 px-2 text-[11px] text-muted-foreground`,children:[(0,q.jsx)(tt,{color:Z.claude,label:`Claude`}),(0,q.jsx)(tt,{color:Z.codex,label:`Codex`})]})]})]}),(0,q.jsxs)(`div`,{className:`grid grid-cols-2 border-y border-border/65 md:grid-cols-5`,children:[(0,q.jsx)(Q,{label:`Total tokens`,value:v(l.totalTokens)}),(0,q.jsx)(Q,{label:`Sessions`,value:I(l.distinctSessionCount)}),(0,q.jsx)(Q,{label:`Responses`,value:I(l.responseCount)}),(0,q.jsx)(Q,{label:`Cache read`,value:`${Math.round(m*100)}%`}),(0,q.jsx)(Q,{label:`Reasoning`,value:v(l.reasoningTokens),detail:`included in output`})]}),(0,q.jsx)(j,{title:`Breakdown`,icon:te,action:(0,q.jsx)(Xe,{search:n,onSearchChange:r}),bodyClassName:`overflow-hidden`,children:(0,q.jsx)(`div`,{className:`divide-y divide-border/60`,children:d.slice(0,20).map(e=>(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-5 px-4 py-3.5 sm:px-5`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:n.usageBreakdown===`model`?S(e.label):x(e.label)}),(0,q.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e.provider?p(e.provider):`${e.responses} responses`})]}),(0,q.jsxs)(`div`,{className:`text-right`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:v(e.tokens)}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`tokens`})]}),(0,q.jsxs)(`div`,{className:`w-24 text-right`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:Ve(e.costUsd)}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.unpricedTokens>0?`${v(e.unpricedTokens)} unpriced`:`estimated`})]})]},e.key))})}),(0,q.jsx)(nt,{summary:o})]}),t[71]=d,t[72]=m,t[73]=u,t[74]=c.buckets.length,t[75]=_,t[76]=o,t[77]=r,t[78]=f,t[79]=n,t[80]=l.distinctSessionCount,t[81]=l.estimatedCacheSavingsUsd,t[82]=l.estimatedCostUsd,t[83]=l.reasoningTokens,t[84]=l.responseCount,t[85]=l.totalTokens,t[86]=V):V=t[86];let H;return t[87]!==R||t[88]!==V?(H=(0,q.jsxs)(`div`,{className:`space-y-8`,children:[R,B,V]}),t[87]=R,t[88]=V,t[89]=H):H=t[89],H}function Ue(e){return(0,q.jsx)(de,{value:e.environmentId,children:e.label},e.environmentId)}function We(e){return e.included&&e.status!==`not-found`}function Ge(e){return e.label}function Ke(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function qe(e){let t=(0,K.c)(3),{search:n,onSearchChange:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,q.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,range:e}),className:W(`h-7 rounded-md px-2.5 text-xs font-medium transition-colors`,n.range===e?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:e===`all`?`All`:e.toUpperCase()},e))}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Je(e){let t=(0,K.c)(3),{search:n,onSearchChange:r}=e,i;if(t[0]!==r||t[1]!==n){let e=new Set(n.providers??[`claude`,`codex`]);i=(0,q.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`claude`,`codex`].map(t=>(0,q.jsxs)(`button`,{type:`button`,"aria-pressed":e.has(t),onClick:()=>{let i=new Set(e);i.has(t)&&i.size>1?i.delete(t):i.add(t);let a=[...i].toSorted();r({...n,...a.length===2?{providers:void 0}:{providers:a}})},className:W(`inline-flex h-7 items-center rounded-md px-2.5 text-xs font-medium capitalize transition-colors`,e.has(t)?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block size-1.5 rounded-full`,style:{backgroundColor:Z[t]}}),t]},t))}),t[0]=r,t[1]=n,t[2]=i}else i=t[2];return i}function Ye(e){let t=(0,K.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`cost`,`tokens`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageMetric:e}),className:W(`h-6 rounded-sm px-2 text-[11px] font-medium capitalize`,n.usageMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Xe(e){let t=(0,K.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`model`,`day`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(`div`,{className:`inline-flex items-center gap-1 text-[11px]`,children:i.map(e=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageBreakdown:e}),className:W(`rounded-md px-2 py-1 capitalize`,n.usageBreakdown===e?`bg-accent text-foreground`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Ze(e){let t=(0,K.c)(21),{data:n,metric:r}=e,i=r===`cost`?`Cost`:`Tokens`,a;t[0]===n?a=t[1]:(a=[...n],t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={left:4,right:10,top:18,bottom:0},t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsxs)(`linearGradient`,{id:`usageClaude`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`5%`,stopColor:Z.claude,stopOpacity:.3}),(0,q.jsx)(`stop`,{offset:`95%`,stopColor:Z.claude,stopOpacity:.02})]}),t[3]=s):s=t[3];let c,l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,q.jsxs)(`defs`,{children:[s,(0,q.jsxs)(`linearGradient`,{id:`usageCodex`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`5%`,stopColor:Z.codex,stopOpacity:.18}),(0,q.jsx)(`stop`,{offset:`95%`,stopColor:Z.codex,stopOpacity:.01})]})]}),l=(0,q.jsx)(b,{vertical:!1,strokeDasharray:`3 5`}),d=(0,q.jsx)(h,{dataKey:`date`,tickLine:!1,axisLine:!1,minTickGap:30,tickFormatter:$e}),t[4]=c,t[5]=l,t[6]=d):(c=t[4],l=t[5],d=t[6]);let f;t[7]===r?f=t[8]:(f=(0,q.jsx)(m,{tickLine:!1,axisLine:!1,width:44,tickFormatter:e=>r===`cost`?`$${Number(e).toFixed(+(Number(e)<10))}`:v(Number(e))}),t[7]=r,t[8]=f);let p;t[9]===r?p=t[10]:(p=(0,q.jsx)(O,{content:(0,q.jsx)(_,{labelFormatter:Qe,formatter:e=>r===`cost`?Be.format(Number(e)||0):I(Number(e)||0)})}),t[9]=r,t[10]=p);let x=`claude${i}`,S;t[11]===x?S=t[12]:(S=(0,q.jsx)(g,{dataKey:x,name:`Claude`,type:`monotone`,stroke:Z.claude,fill:`url(#usageClaude)`,strokeWidth:1.75}),t[11]=x,t[12]=S);let C=`codex${i}`,w;t[13]===C?w=t[14]:(w=(0,q.jsx)(g,{dataKey:C,name:`Codex`,type:`monotone`,stroke:Z.codex,fill:`url(#usageCodex)`,strokeWidth:1.75}),t[13]=C,t[14]=w);let T;return t[15]!==a||t[16]!==S||t[17]!==w||t[18]!==f||t[19]!==p?(T=(0,q.jsx)(u,{className:`h-[300px]`,children:(0,q.jsxs)(y,{data:a,margin:o,children:[c,l,d,f,p,S,w]})}),t[15]=a,t[16]=S,t[17]=w,t[18]=f,t[19]=p,t[20]=T):T=t[20],T}function Qe(e){return x(String(e))}function $e(e){return x(String(e))}function et(e){let t=(0,K.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,q.jsx)(`span`,{className:`font-medium tabular-nums`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-xs`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Q(e){let t=(0,K.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,q.jsx)(`p`,{className:`text-[10px] font-semibold tracking-[0.1em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,q.jsx)(`p`,{className:`mt-2 text-xl font-semibold tracking-tight tabular-nums`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,q.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,q.jsxs)(`div`,{className:`border-r border-border/60 px-4 py-5 last:border-r-0`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function tt(e){let t=(0,K.c)(5),{color:n,label:r}=e,i;t[0]===n?i=t[1]:(i=(0,q.jsx)(`span`,{className:`size-2 rounded-sm`,style:{backgroundColor:n}}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function nt(e){let t=(0,K.c)(43),{summary:n}=e,r,i,a,o,s,c,l,u,d,p,m,h,g,_;if(t[0]!==n.duplicateSourceCount||t[1]!==n.environmentOnlyDeduplicationWarning||t[2]!==n.environments||t[3]!==n.sources){let e=n.sources.filter(mt),v=e.filter(pt),y=n.environments.filter(ft),b=n.environments.flatMap(dt),x=b.length===0?`Unavailable`:b.every(ut)?`Live`:b.every(lt)?`Cached`:b.every(ct)?`Unavailable`:`Mixed`,S=n.environments.flatMap(st).toSorted().at(-1),C=e.map(ot).toSorted().at(-1);i=j,_=`Coverage & estimates`,o=ge,s=`p-5`,c=y.length>0?(0,q.jsxs)(`div`,{className:`mb-5 flex gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,q.jsx)(z,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,q.jsxs)(`span`,{children:[`No usage was included from`,` `,y.map(at).join(`, `),`.`]})]}):null,p=`grid gap-5 md:grid-cols-2 xl:grid-cols-4`;let w=`${e.length} included`,T=n.duplicateSourceCount>0?`${n.duplicateSourceCount} duplicate source excluded`:`No physical duplicates detected`;t[18]!==w||t[19]!==T?(m=(0,q.jsx)($,{icon:ve,label:`Transcript sources`,value:w,detail:T}),t[18]=w,t[19]=T,t[20]=m):m=t[20],h=(0,q.jsx)($,{icon:ie,label:`Last scan`,value:C?f(C):`Not scanned`,detail:`${e.reduce(it,0)} cached files reused`});let E=S?`Rates fetched ${f(S)}`:`Token totals remain available without rates`;t[21]!==x||t[22]!==E?(g=(0,q.jsx)($,{icon:_e,label:`Pricing`,value:x,detail:E}),t[21]=x,t[22]=E,t[23]=g):g=t[23],r=$,a=z,l=`Coverage state`,u=v.length===0?`Complete`:`${v.length} source notice${v.length===1?``:`s`}`,d=n.environmentOnlyDeduplicationWarning?`Some sources could only be scoped per environment`:`${e.reduce(rt,0)} malformed lines skipped`,t[0]=n.duplicateSourceCount,t[1]=n.environmentOnlyDeduplicationWarning,t[2]=n.environments,t[3]=n.sources,t[4]=r,t[5]=i,t[6]=a,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=p,t[14]=m,t[15]=h,t[16]=g,t[17]=_}else r=t[4],i=t[5],a=t[6],o=t[7],s=t[8],c=t[9],l=t[10],u=t[11],d=t[12],p=t[13],m=t[14],h=t[15],g=t[16],_=t[17];let v;t[24]!==r||t[25]!==a||t[26]!==l||t[27]!==u||t[28]!==d?(v=(0,q.jsx)(r,{icon:a,label:l,value:u,detail:d}),t[24]=r,t[25]=a,t[26]=l,t[27]=u,t[28]=d,t[29]=v):v=t[29];let y;t[30]!==v||t[31]!==p||t[32]!==m||t[33]!==h||t[34]!==g?(y=(0,q.jsxs)(`div`,{className:p,children:[m,h,g,v]}),t[30]=v,t[31]=p,t[32]=m,t[33]=h,t[34]=g,t[35]=y):y=t[35];let b;return t[36]!==i||t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==y||t[41]!==_?(b=(0,q.jsxs)(i,{title:_,icon:o,bodyClassName:s,children:[c,y]}),t[36]=i,t[37]=o,t[38]=s,t[39]=c,t[40]=y,t[41]=_,t[42]=b):b=t[42],b}function rt(e,t){return e+t.malformedLineCount}function it(e,t){return e+t.reusedCacheFileCount}function at(e){return e.label}function ot(e){return e.scanFinishedAt}function st(e){let t=e.summary?.pricing.fetchedAt;return t===void 0?[]:[t]}function ct(e){return e===`unavailable`}function lt(e){return e===`cached`}function ut(e){return e===`live`}function dt(e){return e.summary===void 0?[]:[e.summary.pricing.state]}function ft(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function pt(e){return e.status!==`complete`}function mt(e){return e.included}function $(e){let t=(0,K.c)(15),{icon:n,label:r,value:i,detail:a}=e,o;t[0]===n?o=t[1]:(o=(0,q.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,q.jsx)(n,{className:`size-4`})}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,q.jsx)(`p`,{className:`mt-1 text-sm font-medium`,children:i}),t[4]=i,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,q.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:a}),t[6]=a,t[7]=l);let u;t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,q.jsxs)(`div`,{children:[s,c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==o||t[13]!==u?(d=(0,q.jsxs)(`div`,{className:`flex gap-3`,children:[o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14],d}function ht(e){let t=(0,K.c)(25),{search:n,onSearchChange:i}=e,a=n.view===`usage`?r.serverGetUsageSummary:r.serverGetStatistics,o=ce(a),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`h1`,{className:`truncate text-sm font-semibold tracking-tight`,children:`Statistics`}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Usage and work signals`})]}),t[0]=s):s=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`usage`,`activity`],t[1]=c):c=t[1];let u;t[2]!==i||t[3]!==n?(u=(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-5`,children:[s,(0,q.jsx)(`div`,{className:`inline-flex rounded-lg bg-muted/75 p-0.5`,children:c.map(e=>{let t=e===`usage`?R:l;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>i({...n,view:e}),className:W(`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors`,n.view===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,q.jsx)(t,{className:`size-3.5`}),` `,e]},e)})})]}),t[2]=i,t[3]=n,t[4]=u):u=t[4];let d;t[5]===n.range?d=t[6]:(d=n.range===`all`?`All available history`:`Last ${n.range.slice(0,-1)} days`,t[5]=n.range,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,q.jsx)(`p`,{className:`text-xs font-medium`,children:d}),t[7]=d,t[8]=f);let p=n.view===`usage`?`Local calendar window`:`UTC activity window`,m;t[9]===p?m=t[10]:(m=(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:p}),t[9]=p,t[10]=m);let h;t[11]!==f||t[12]!==m?(h=(0,q.jsxs)(`div`,{className:`hidden text-right sm:block`,children:[f,m]}),t[11]=f,t[12]=m,t[13]=h):h=t[13];let g;t[14]!==u||t[15]!==h?(g=(0,q.jsxs)(`header`,{className:`flex min-h-14 shrink-0 items-center border-b border-border/75 bg-background/90 px-5 backdrop-blur-sm sm:px-7`,children:[u,h]}),t[14]=u,t[15]=h,t[16]=g):g=t[16];let _;t[17]!==o.allowed||t[18]!==o.reason||t[19]!==i||t[20]!==n?(_=(0,q.jsx)(se,{className:`min-h-0 flex-1`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-[1480px] px-5 py-7 sm:px-8 sm:py-9 lg:px-10`,children:o.allowed?n.view===`usage`?(0,q.jsx)(He,{search:n,onSearchChange:i}):(0,q.jsx)(ye,{search:n,onSearchChange:i}):(0,q.jsx)(D,{icon:re,title:`Statistics aren’t available for this session`,description:o.reason??`Owner access is required.`})})}),t[17]=o.allowed,t[18]=o.reason,t[19]=i,t[20]=n,t[21]=_):_=t[21];let v;return t[22]!==_||t[23]!==g?(v=(0,q.jsx)(le,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[g,_]})}),t[22]=_,t[23]=g,t[24]=v):v=t[24],v}export{ht as StatisticsPage};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-DC2r8dcu.js";import{f as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./activity-1CkdQG5u.js";import{C as o,D as s,E as c,N as l,O as u,T as d,_ as f,a as ee,b as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,k as ce,l as p,m,n as le,o as ue,p as h,r as de,s as fe,t as pe,u as me,v as he,w as g,x as ge,y as _e}from"./useStatistics-CWasDzsV.js";import{t as ve}from"./chart-column-Dw6ACmXM.js";import{t as ye}from"./clock-nNA05brA.js";import{n as be,t as xe}from"./layers-BYi0v17h.js";import{t as Se}from"./git-branch-BKr-Ij4u.js";import{t as Ce}from"./messages-square-DiMgWzoq.js";import{t as we}from"./refresh-cw-DopCMrtR.js";import{t as Te}from"./triangle-alert-RL_T3KLo.js";import{t as Ee}from"./button-Wf_1nfeu.js";import{n as _}from"./settingsLayout-C7bl9Xi4.js";var De=i(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),Oe=i(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ke=i(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),Ae=e(t(),1),v=n(),y=r();function je(e){let t=(0,v.c)(10),{models:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-xs`,children:`No model usage yet.`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.reduce(b,0)||1,t[1]=n,t[2]=r);let i=r,a;if(t[3]!==i||t[4]!==n){let e;t[6]===i?e=t[7]:(e=(e,t)=>{let n=l(t),r=Math.max(2,e.totalTokens/i*100);return(0,y.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,y.jsx)(`span`,{className:`w-4 text-center font-medium text-[11px] text-muted-foreground tabular-nums`,children:t+1}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate font-medium text-[13px] text-foreground`,children:d(e.model)}),(0,y.jsx)(`span`,{className:`shrink-0 font-medium text-foreground text-xs tabular-nums`,children:u(e.totalTokens)})]}),(0,y.jsx)(`div`,{className:`mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${r}%`,backgroundColor:n}})}),(0,y.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:c(e.provider)}),(0,y.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:e.costUsd===null?`—`:`~${ce(e.costUsd)}`})]})]})]},`${e.provider??`unknown`}:${e.model}`)},t[6]=i,t[7]=e),a=n.map(e),t[3]=i,t[4]=n,t[5]=a}else a=t[5];let o;return t[8]===a?o=t[9]:(o=(0,y.jsx)(`ol`,{className:`divide-y divide-border/50`,children:a}),t[8]=a,t[9]=o),o}function b(e,t){return Math.max(e,t.totalTokens)}function x(){let e=(0,v.c)(92),{snapshot:t,loading:n,error:r,refresh:i,refreshing:l}=pe(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={range:`30d`,projectId:null,model:null,provider:null},e[0]=b):b=e[0];let[x,Ie]=(0,Ae.useState)(b),w;bb0:{if(!t){w=null;break bb0}let n,r,i,a,o,s,c,l;if(e[1]!==x||e[2]!==t){let u=ne(t,x),d=ue(t),f=le(u),te=f.reduce(Fe,0);n=re(u),r=me(t,x),i=f,a=te,o=se(u),s=de(u,d),c=fe(t,u,x.range),l=ee(f),e[1]=x,e[2]=t,e[3]=n,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=s,e[9]=c,e[10]=l}else n=e[3],r=e[4],i=e[5],a=e[6],o=e[7],s=e[8],c=e[9],l=e[10];let u;e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==l?(u={totals:n,previous:r,models:i,totalsAllModels:a,providers:o,projects:s,series:c,cost:l},e[11]=n,e[12]=r,e[13]=i,e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=l,e[19]=u):u=e[19],w=u}let Le=w;if(n&&!t){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(_,{children:(0,y.jsx)(oe,{})}),e[20]=t):t=e[20],t}if(r&&!t){let t;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(we,{}),e[21]=t):t=e[21];let n;e[22]===i?n=e[23]:(n=(0,y.jsxs)(Ee,{size:`sm`,variant:`outline`,onClick:i,children:[t,` Try again`]}),e[22]=i,e[23]=n);let a;return e[24]!==r||e[25]!==n?(a=(0,y.jsx)(_,{children:(0,y.jsx)(ae,{icon:Te,title:`Couldn’t load statistics`,description:r,action:n})}),e[24]=r,e[25]=n,e[26]=a):a=e[26],a}if(!t||!Le)return null;let T=t.dailyBuckets.length>0,{totals:E,previous:D,models:O,totalsAllModels:k,providers:A,projects:j,series:M,cost:N}=Le,P=O[0],F;e[27]!==P||e[28]!==k?(F=P&&k>0?Math.round(P.totalTokens/k*100):0,e[27]=P,e[28]=k,e[29]=F):F=e[29];let I=F,L;e[30]===M?L=e[31]:(L=M.map(Pe),e[30]=M,e[31]=L);let R=L,z;e[32]===M?z=e[33]:(z=M.map(Ne),e[32]=M,e[33]=z);let Re=z,B=Math.max(0,E.totalTokens-E.inputTokens-E.outputTokens),V;e[34]!==E.inputTokens||e[35]!==E.outputTokens||e[36]!==B?(V=B>0?`${u(E.inputTokens)} in · ${u(E.outputTokens)} out · ${u(B)} other`:`${u(E.inputTokens)} in · ${u(E.outputTokens)} out`,e[34]=E.inputTokens,e[35]=E.outputTokens,e[36]=B,e[37]=V):V=e[37];let ze=V,H;e[38]===M?H=e[39]:(H=M.some(Me),e[38]=M,e[39]=H);let Be=H,Ve=t.tokenAttribution===`thread-cumulative`?`Token figures use cumulative thread snapshots when providers or older sessions do not expose per-turn deltas.`:t.tokenAttribution===`mixed`?`Token figures combine exact per-turn deltas where available with cumulative snapshots for older or provider-limited sessions.`:`Token figures use exact per-turn deltas where providers report them.`,U;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,y.jsx)(`h1`,{className:`font-semibold text-foreground text-lg`,children:`Statistics`}),e[40]=U):U=e[40];let W;e[41]===t.generatedAt?W=e[42]:(W=s(t.generatedAt),e[41]=t.generatedAt,e[42]=W);let G;e[43]===W?G=e[44]:(G=(0,y.jsxs)(`div`,{className:`space-y-0.5`,children:[U,(0,y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Usage across your projects · as of `,W]})]}),e[43]=W,e[44]=G);let K=l?`animate-spin`:void 0,q;e[45]===K?q=e[46]:(q=(0,y.jsx)(we,{className:K}),e[45]=K,e[46]=q);let J;e[47]!==i||e[48]!==l||e[49]!==q?(J=(0,y.jsxs)(Ee,{size:`xs`,variant:`outline`,onClick:i,disabled:l,"aria-label":`Refresh statistics`,children:[q,`Refresh`]}),e[47]=i,e[48]=l,e[49]=q,e[50]=J):J=e[50];let Y;e[51]!==J||e[52]!==G?(Y=(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[G,J]}),e[51]=J,e[52]=G,e[53]=Y):Y=e[53];let X;e[54]!==x||e[55]!==t.models||e[56]!==t.projects?(X=(0,y.jsx)(ie,{filter:x,onChange:Ie,projects:t.projects,models:t.models}),e[54]=x,e[55]=t.models,e[56]=t.projects,e[57]=X):X=e[57];let Z;e[58]!==Y||e[59]!==X?(Z=(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Y,X]}),e[58]=Y,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==Re||e[62]!==Ve||e[63]!==N||e[64]!==T||e[65]!==Be||e[66]!==O||e[67]!==D?.activeMs||e[68]!==D?.threadsCreated||e[69]!==D?.totalTokens||e[70]!==j||e[71]!==A||e[72]!==M||e[73]!==t.worktrees||e[74]!==R||e[75]!==ze||e[76]!==P||e[77]!==I||e[78]!==E.activeMs||e[79]!==E.additions||e[80]!==E.commits||e[81]!==E.deletions||e[82]!==E.filesChanged||e[83]!==E.pushes||e[84]!==E.threadsCreated||e[85]!==E.toolUses||e[86]!==E.totalTokens||e[87]!==E.turns?(Q=T?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-5`,children:[(0,y.jsx)(m,{label:`Total tokens`,icon:Oe,value:u(E.totalTokens),sub:ze,delta:p(E.totalTokens,D?.totalTokens),sparkline:R}),(0,y.jsx)(m,{label:`Est. cost`,icon:ke,value:`~${ce(N.usd)}`,sub:N.hasUnpriced?`excludes unpriced models`:`estimated spend`}),(0,y.jsx)(m,{label:`Most used model`,icon:xe,value:(0,y.jsx)(`span`,{className:`block max-w-full truncate text-lg`,title:P?d(P.model):void 0,children:P?d(P.model):`—`}),sub:P?`${c(P.provider)} · ${I}% of tokens`:`no usage in range`}),(0,y.jsx)(m,{label:`Chats`,icon:Ce,value:g(E.threadsCreated),sub:`threads started`,delta:p(E.threadsCreated,D?.threadsCreated)}),(0,y.jsx)(m,{label:`Active time`,icon:ye,value:o(E.activeMs),sub:`${g(E.turns)} turns`,delta:p(E.activeMs,D?.activeMs),sparkline:Re})]}),(0,y.jsxs)(h,{title:`Token usage over time`,icon:ve,bodyClassName:`p-4`,children:[(0,y.jsx)(te,{data:M}),(0,y.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 px-1 text-[11px] text-muted-foreground`,children:[(0,y.jsx)(S,{colorIndex:0,label:`Input`}),(0,y.jsx)(S,{colorIndex:1,label:`Output`}),Be?(0,y.jsx)(S,{colorIndex:2,label:`Other`}):null]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Models`,icon:xe,bodyClassName:`overflow-hidden`,action:(0,y.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[O.length,` total`]}),children:(0,y.jsx)(je,{models:O})}),(0,y.jsx)(h,{title:`Tokens by provider`,icon:De,bodyClassName:`p-4`,children:(0,y.jsx)(_e,{data:A})})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Tokens by project`,icon:ve,bodyClassName:`p-4`,children:(0,y.jsx)(he,{data:j})}),(0,y.jsxs)(h,{title:`Activity`,icon:a,bodyClassName:`p-4`,children:[(0,y.jsx)(ge,{points:M,metric:`turns`}),(0,y.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:`Turns per day`})]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsxs)(h,{title:`Code changes`,icon:be,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-4 text-sm`,children:[(0,y.jsx)(C,{label:`Files`,value:g(E.filesChanged)}),(0,y.jsx)(C,{label:`Added`,value:`+${g(E.additions)}`,tone:`success`}),(0,y.jsx)(C,{label:`Removed`,value:`−${g(E.deletions)}`,tone:`destructive`})]}),(0,y.jsx)(f,{data:M})]}),(0,y.jsxs)(h,{title:`Source control`,icon:Se,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,y.jsx)(C,{label:`Worktrees`,value:g(t.worktrees.created)}),(0,y.jsx)(C,{label:`Active`,value:g(t.worktrees.active)}),(0,y.jsx)(C,{label:`Open PRs`,value:g(t.worktrees.openPrs)}),(0,y.jsx)(C,{label:`Tool uses`,value:g(E.toolUses)})]}),E.commits+E.pushes>0?(0,y.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 border-border/60 border-t pt-3`,children:[(0,y.jsx)(C,{label:`Commits`,value:g(E.commits)}),(0,y.jsx)(C,{label:`Pushes`,value:g(E.pushes)})]}):(0,y.jsx)(`p`,{className:`mt-3 border-border/60 border-t pt-3 text-[11px] text-muted-foreground`,children:`Commit & push counts aren’t recorded yet.`})]})]}),(0,y.jsxs)(`p`,{className:`px-1 text-[11px] text-muted-foreground/80`,children:[Ve,` Costs are rough estimates from a built-in price table and exclude subscription-billed or breakdown-less usage.`]})]}):(0,y.jsx)(ae,{icon:ve,title:`No activity yet`,description:`Once you start chatting with agents, your token usage, models, and code changes will show up here.`}),e[61]=Re,e[62]=Ve,e[63]=N,e[64]=T,e[65]=Be,e[66]=O,e[67]=D?.activeMs,e[68]=D?.threadsCreated,e[69]=D?.totalTokens,e[70]=j,e[71]=A,e[72]=M,e[73]=t.worktrees,e[74]=R,e[75]=ze,e[76]=P,e[77]=I,e[78]=E.activeMs,e[79]=E.additions,e[80]=E.commits,e[81]=E.deletions,e[82]=E.filesChanged,e[83]=E.pushes,e[84]=E.threadsCreated,e[85]=E.toolUses,e[86]=E.totalTokens,e[87]=E.turns,e[88]=Q):Q=e[88];let $;return e[89]!==Z||e[90]!==Q?($=(0,y.jsxs)(_,{children:[Z,Q]}),e[89]=Z,e[90]=Q,e[91]=$):$=e[91],$}function Me(e){return e.uncategorizedTokens>0}function Ne(e){return e.activeMs}function Pe(e){return e.totalTokens}function Fe(e,t){return e+t.totalTokens}function S(e){let t=(0,v.c)(7),{colorIndex:n,label:r}=e,i;t[0]===n?i=t[1]:(i=l(n),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a=(0,y.jsx)(`span`,{className:`size-2.5 rounded-[3px]`,style:{backgroundColor:i}}),t[2]=i,t[3]=a);let o;return t[4]!==r||t[5]!==a?(o=(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[a,r]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function C(e){let t=(0,v.c)(8),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,y.jsx)(`span`,{className:`text-[11px] text-muted-foreground uppercase tracking-[0.06em]`,children:n}),t[0]=n,t[1]=a);let o=i===`success`?`font-semibold text-base text-success-foreground tabular-nums`:i===`destructive`?`font-semibold text-base text-destructive tabular-nums`:`font-semibold text-base text-foreground tabular-nums`,s;t[2]!==o||t[3]!==r?(s=(0,y.jsx)(`span`,{className:o,children:r}),t[2]=o,t[3]=r,t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==s?(c=(0,y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}export{x as StatisticsPanel};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-TYv9j3vY.js";import{f as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./activity-1CkdQG5u.js";import{C as o,D as s,E as c,N as l,O as u,T as d,_ as f,a as ee,b as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,k as ce,l as p,m,n as le,o as ue,p as h,r as de,s as fe,t as pe,u as me,v as he,w as g,x as ge,y as _e}from"./useStatistics-Dbp94K5j.js";import{t as ve}from"./chart-column-Dw6ACmXM.js";import{t as ye}from"./clock-nNA05brA.js";import{n as be,t as xe}from"./layers-BYi0v17h.js";import{t as Se}from"./git-branch-BKr-Ij4u.js";import{t as Ce}from"./messages-square-DiMgWzoq.js";import{t as we}from"./refresh-cw-DopCMrtR.js";import{t as Te}from"./triangle-alert-RL_T3KLo.js";import{t as Ee}from"./button-DG8WqjNn.js";import{n as _}from"./settingsLayout-CHJT5wtl.js";var De=i(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),Oe=i(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ke=i(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),Ae=e(t(),1),v=n(),y=r();function je(e){let t=(0,v.c)(10),{models:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-xs`,children:`No model usage yet.`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.reduce(b,0)||1,t[1]=n,t[2]=r);let i=r,a;if(t[3]!==i||t[4]!==n){let e;t[6]===i?e=t[7]:(e=(e,t)=>{let n=l(t),r=Math.max(2,e.totalTokens/i*100);return(0,y.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,y.jsx)(`span`,{className:`w-4 text-center font-medium text-[11px] text-muted-foreground tabular-nums`,children:t+1}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate font-medium text-[13px] text-foreground`,children:d(e.model)}),(0,y.jsx)(`span`,{className:`shrink-0 font-medium text-foreground text-xs tabular-nums`,children:u(e.totalTokens)})]}),(0,y.jsx)(`div`,{className:`mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${r}%`,backgroundColor:n}})}),(0,y.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:c(e.provider)}),(0,y.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:e.costUsd===null?`—`:`~${ce(e.costUsd)}`})]})]})]},`${e.provider??`unknown`}:${e.model}`)},t[6]=i,t[7]=e),a=n.map(e),t[3]=i,t[4]=n,t[5]=a}else a=t[5];let o;return t[8]===a?o=t[9]:(o=(0,y.jsx)(`ol`,{className:`divide-y divide-border/50`,children:a}),t[8]=a,t[9]=o),o}function b(e,t){return Math.max(e,t.totalTokens)}function x(){let e=(0,v.c)(92),{snapshot:t,loading:n,error:r,refresh:i,refreshing:l}=pe(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={range:`30d`,projectId:null,model:null,provider:null},e[0]=b):b=e[0];let[x,Ie]=(0,Ae.useState)(b),w;bb0:{if(!t){w=null;break bb0}let n,r,i,a,o,s,c,l;if(e[1]!==x||e[2]!==t){let u=ne(t,x),d=ue(t),f=le(u),te=f.reduce(Fe,0);n=re(u),r=me(t,x),i=f,a=te,o=se(u),s=de(u,d),c=fe(t,u,x.range),l=ee(f),e[1]=x,e[2]=t,e[3]=n,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=s,e[9]=c,e[10]=l}else n=e[3],r=e[4],i=e[5],a=e[6],o=e[7],s=e[8],c=e[9],l=e[10];let u;e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==l?(u={totals:n,previous:r,models:i,totalsAllModels:a,providers:o,projects:s,series:c,cost:l},e[11]=n,e[12]=r,e[13]=i,e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=l,e[19]=u):u=e[19],w=u}let Le=w;if(n&&!t){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(_,{children:(0,y.jsx)(oe,{})}),e[20]=t):t=e[20],t}if(r&&!t){let t;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(we,{}),e[21]=t):t=e[21];let n;e[22]===i?n=e[23]:(n=(0,y.jsxs)(Ee,{size:`sm`,variant:`outline`,onClick:i,children:[t,` Try again`]}),e[22]=i,e[23]=n);let a;return e[24]!==r||e[25]!==n?(a=(0,y.jsx)(_,{children:(0,y.jsx)(ae,{icon:Te,title:`Couldn’t load statistics`,description:r,action:n})}),e[24]=r,e[25]=n,e[26]=a):a=e[26],a}if(!t||!Le)return null;let T=t.dailyBuckets.length>0,{totals:E,previous:D,models:O,totalsAllModels:k,providers:A,projects:j,series:M,cost:N}=Le,P=O[0],F;e[27]!==P||e[28]!==k?(F=P&&k>0?Math.round(P.totalTokens/k*100):0,e[27]=P,e[28]=k,e[29]=F):F=e[29];let I=F,L;e[30]===M?L=e[31]:(L=M.map(Pe),e[30]=M,e[31]=L);let R=L,z;e[32]===M?z=e[33]:(z=M.map(Ne),e[32]=M,e[33]=z);let Re=z,B=Math.max(0,E.totalTokens-E.inputTokens-E.outputTokens),V;e[34]!==E.inputTokens||e[35]!==E.outputTokens||e[36]!==B?(V=B>0?`${u(E.inputTokens)} in · ${u(E.outputTokens)} out · ${u(B)} other`:`${u(E.inputTokens)} in · ${u(E.outputTokens)} out`,e[34]=E.inputTokens,e[35]=E.outputTokens,e[36]=B,e[37]=V):V=e[37];let ze=V,H;e[38]===M?H=e[39]:(H=M.some(Me),e[38]=M,e[39]=H);let Be=H,Ve=t.tokenAttribution===`thread-cumulative`?`Token figures use cumulative thread snapshots when providers or older sessions do not expose per-turn deltas.`:t.tokenAttribution===`mixed`?`Token figures combine exact per-turn deltas where available with cumulative snapshots for older or provider-limited sessions.`:`Token figures use exact per-turn deltas where providers report them.`,U;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,y.jsx)(`h1`,{className:`font-semibold text-foreground text-lg`,children:`Statistics`}),e[40]=U):U=e[40];let W;e[41]===t.generatedAt?W=e[42]:(W=s(t.generatedAt),e[41]=t.generatedAt,e[42]=W);let G;e[43]===W?G=e[44]:(G=(0,y.jsxs)(`div`,{className:`space-y-0.5`,children:[U,(0,y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Usage across your projects · as of `,W]})]}),e[43]=W,e[44]=G);let K=l?`animate-spin`:void 0,q;e[45]===K?q=e[46]:(q=(0,y.jsx)(we,{className:K}),e[45]=K,e[46]=q);let J;e[47]!==i||e[48]!==l||e[49]!==q?(J=(0,y.jsxs)(Ee,{size:`xs`,variant:`outline`,onClick:i,disabled:l,"aria-label":`Refresh statistics`,children:[q,`Refresh`]}),e[47]=i,e[48]=l,e[49]=q,e[50]=J):J=e[50];let Y;e[51]!==J||e[52]!==G?(Y=(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[G,J]}),e[51]=J,e[52]=G,e[53]=Y):Y=e[53];let X;e[54]!==x||e[55]!==t.models||e[56]!==t.projects?(X=(0,y.jsx)(ie,{filter:x,onChange:Ie,projects:t.projects,models:t.models}),e[54]=x,e[55]=t.models,e[56]=t.projects,e[57]=X):X=e[57];let Z;e[58]!==Y||e[59]!==X?(Z=(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Y,X]}),e[58]=Y,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==Re||e[62]!==Ve||e[63]!==N||e[64]!==T||e[65]!==Be||e[66]!==O||e[67]!==D?.activeMs||e[68]!==D?.threadsCreated||e[69]!==D?.totalTokens||e[70]!==j||e[71]!==A||e[72]!==M||e[73]!==t.worktrees||e[74]!==R||e[75]!==ze||e[76]!==P||e[77]!==I||e[78]!==E.activeMs||e[79]!==E.additions||e[80]!==E.commits||e[81]!==E.deletions||e[82]!==E.filesChanged||e[83]!==E.pushes||e[84]!==E.threadsCreated||e[85]!==E.toolUses||e[86]!==E.totalTokens||e[87]!==E.turns?(Q=T?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-5`,children:[(0,y.jsx)(m,{label:`Total tokens`,icon:Oe,value:u(E.totalTokens),sub:ze,delta:p(E.totalTokens,D?.totalTokens),sparkline:R}),(0,y.jsx)(m,{label:`Est. cost`,icon:ke,value:`~${ce(N.usd)}`,sub:N.hasUnpriced?`excludes unpriced models`:`estimated spend`}),(0,y.jsx)(m,{label:`Most used model`,icon:xe,value:(0,y.jsx)(`span`,{className:`block max-w-full truncate text-lg`,title:P?d(P.model):void 0,children:P?d(P.model):`—`}),sub:P?`${c(P.provider)} · ${I}% of tokens`:`no usage in range`}),(0,y.jsx)(m,{label:`Chats`,icon:Ce,value:g(E.threadsCreated),sub:`threads started`,delta:p(E.threadsCreated,D?.threadsCreated)}),(0,y.jsx)(m,{label:`Active time`,icon:ye,value:o(E.activeMs),sub:`${g(E.turns)} turns`,delta:p(E.activeMs,D?.activeMs),sparkline:Re})]}),(0,y.jsxs)(h,{title:`Token usage over time`,icon:ve,bodyClassName:`p-4`,children:[(0,y.jsx)(te,{data:M}),(0,y.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 px-1 text-[11px] text-muted-foreground`,children:[(0,y.jsx)(S,{colorIndex:0,label:`Input`}),(0,y.jsx)(S,{colorIndex:1,label:`Output`}),Be?(0,y.jsx)(S,{colorIndex:2,label:`Other`}):null]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Models`,icon:xe,bodyClassName:`overflow-hidden`,action:(0,y.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[O.length,` total`]}),children:(0,y.jsx)(je,{models:O})}),(0,y.jsx)(h,{title:`Tokens by provider`,icon:De,bodyClassName:`p-4`,children:(0,y.jsx)(_e,{data:A})})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Tokens by project`,icon:ve,bodyClassName:`p-4`,children:(0,y.jsx)(he,{data:j})}),(0,y.jsxs)(h,{title:`Activity`,icon:a,bodyClassName:`p-4`,children:[(0,y.jsx)(ge,{points:M,metric:`turns`}),(0,y.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:`Turns per day`})]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsxs)(h,{title:`Code changes`,icon:be,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-4 text-sm`,children:[(0,y.jsx)(C,{label:`Files`,value:g(E.filesChanged)}),(0,y.jsx)(C,{label:`Added`,value:`+${g(E.additions)}`,tone:`success`}),(0,y.jsx)(C,{label:`Removed`,value:`−${g(E.deletions)}`,tone:`destructive`})]}),(0,y.jsx)(f,{data:M})]}),(0,y.jsxs)(h,{title:`Source control`,icon:Se,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,y.jsx)(C,{label:`Worktrees`,value:g(t.worktrees.created)}),(0,y.jsx)(C,{label:`Active`,value:g(t.worktrees.active)}),(0,y.jsx)(C,{label:`Open PRs`,value:g(t.worktrees.openPrs)}),(0,y.jsx)(C,{label:`Tool uses`,value:g(E.toolUses)})]}),E.commits+E.pushes>0?(0,y.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 border-border/60 border-t pt-3`,children:[(0,y.jsx)(C,{label:`Commits`,value:g(E.commits)}),(0,y.jsx)(C,{label:`Pushes`,value:g(E.pushes)})]}):(0,y.jsx)(`p`,{className:`mt-3 border-border/60 border-t pt-3 text-[11px] text-muted-foreground`,children:`Commit & push counts aren’t recorded yet.`})]})]}),(0,y.jsxs)(`p`,{className:`px-1 text-[11px] text-muted-foreground/80`,children:[Ve,` Costs are rough estimates from a built-in price table and exclude subscription-billed or breakdown-less usage.`]})]}):(0,y.jsx)(ae,{icon:ve,title:`No activity yet`,description:`Once you start chatting with agents, your token usage, models, and code changes will show up here.`}),e[61]=Re,e[62]=Ve,e[63]=N,e[64]=T,e[65]=Be,e[66]=O,e[67]=D?.activeMs,e[68]=D?.threadsCreated,e[69]=D?.totalTokens,e[70]=j,e[71]=A,e[72]=M,e[73]=t.worktrees,e[74]=R,e[75]=ze,e[76]=P,e[77]=I,e[78]=E.activeMs,e[79]=E.additions,e[80]=E.commits,e[81]=E.deletions,e[82]=E.filesChanged,e[83]=E.pushes,e[84]=E.threadsCreated,e[85]=E.toolUses,e[86]=E.totalTokens,e[87]=E.turns,e[88]=Q):Q=e[88];let $;return e[89]!==Z||e[90]!==Q?($=(0,y.jsxs)(_,{children:[Z,Q]}),e[89]=Z,e[90]=Q,e[91]=$):$=e[91],$}function Me(e){return e.uncategorizedTokens>0}function Ne(e){return e.activeMs}function Pe(e){return e.totalTokens}function Fe(e,t){return e+t.totalTokens}function S(e){let t=(0,v.c)(7),{colorIndex:n,label:r}=e,i;t[0]===n?i=t[1]:(i=l(n),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a=(0,y.jsx)(`span`,{className:`size-2.5 rounded-[3px]`,style:{backgroundColor:i}}),t[2]=i,t[3]=a);let o;return t[4]!==r||t[5]!==a?(o=(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[a,r]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function C(e){let t=(0,v.c)(8),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,y.jsx)(`span`,{className:`text-[11px] text-muted-foreground uppercase tracking-[0.06em]`,children:n}),t[0]=n,t[1]=a);let o=i===`success`?`font-semibold text-base text-success-foreground tabular-nums`:i===`destructive`?`font-semibold text-base text-destructive tabular-nums`:`font-semibold text-base text-foreground tabular-nums`,s;t[2]!==o||t[3]!==r?(s=(0,y.jsx)(`span`,{className:o,children:r}),t[2]=o,t[3]=r,t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==s?(c=(0,y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}export{x as StatisticsPanel};
@@ -1 +1 @@
1
- import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-DC2r8dcu.js";import{t as n}from"./useNavigate-2tVq4iZ2.js";import{t as r}from"./settingsDialogStore-Dbykwvfs.js";import{t as i}from"./arrow-up-right-DGeet8e6.js";import{t as a}from"./chart-column-Dw6ACmXM.js";import{t as o}from"./button-Wf_1nfeu.js";import{n as s}from"./settingsLayout-C7bl9Xi4.js";var c=e(),l=t();function u(){let e=(0,c.c)(9),t=n(),u=r(d),f,p,m;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,l.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,l.jsx)(a,{className:`size-5`})}),p=(0,l.jsx)(`h1`,{className:`mt-4 text-lg font-semibold tracking-tight`,children:`Statistics has more room now`}),m=(0,l.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`Explore provider-recorded Usage and Ryco-observed Activity in the standalone dashboard.`}),e[0]=f,e[1]=p,e[2]=m):(f=e[0],p=e[1],m=e[2]);let h;e[3]!==u||e[4]!==t?(h=()=>{u(),t({to:`/statistics`})},e[3]=u,e[4]=t,e[5]=h):h=e[5];let g;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,l.jsx)(i,{}),e[6]=g):g=e[6];let _;return e[7]===h?_=e[8]:(_=(0,l.jsx)(s,{children:(0,l.jsx)(`div`,{className:`flex min-h-72 items-center justify-center`,children:(0,l.jsxs)(`div`,{className:`max-w-lg rounded-2xl border border-border/75 bg-card p-7 text-center shadow-sm/5`,children:[f,p,m,(0,l.jsxs)(o,{className:`mt-5`,onClick:h,children:[`Open Statistics `,g]})]})})}),e[7]=h,e[8]=_),_}function d(e){return e.closeSettings}export{u as StatisticsSettingsLink};
1
+ import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-TYv9j3vY.js";import{t as n}from"./useNavigate-2tVq4iZ2.js";import{t as r}from"./settingsDialogStore-LxRFC5hh.js";import{t as i}from"./arrow-up-right-DGeet8e6.js";import{t as a}from"./chart-column-Dw6ACmXM.js";import{t as o}from"./button-DG8WqjNn.js";import{n as s}from"./settingsLayout-CHJT5wtl.js";var c=e(),l=t();function u(){let e=(0,c.c)(9),t=n(),u=r(d),f,p,m;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,l.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,l.jsx)(a,{className:`size-5`})}),p=(0,l.jsx)(`h1`,{className:`mt-4 text-lg font-semibold tracking-tight`,children:`Statistics has more room now`}),m=(0,l.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`Explore provider-recorded Usage and Ryco-observed Activity in the standalone dashboard.`}),e[0]=f,e[1]=p,e[2]=m):(f=e[0],p=e[1],m=e[2]);let h;e[3]!==u||e[4]!==t?(h=()=>{u(),t({to:`/statistics`})},e[3]=u,e[4]=t,e[5]=h):h=e[5];let g;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,l.jsx)(i,{}),e[6]=g):g=e[6];let _;return e[7]===h?_=e[8]:(_=(0,l.jsx)(s,{children:(0,l.jsx)(`div`,{className:`flex min-h-72 items-center justify-center`,children:(0,l.jsxs)(`div`,{className:`max-w-lg rounded-2xl border border-border/75 bg-card p-7 text-center shadow-sm/5`,children:[f,p,m,(0,l.jsxs)(o,{className:`mt-5`,onClick:h,children:[`Open Statistics `,g]})]})})}),e[7]=h,e[8]=_),_}function d(e){return e.closeSettings}export{u as StatisticsSettingsLink};