ryco-cli 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcpNativeLogging-CwXNgeCl.mjs → AcpNativeLogging-Ba9Nn9Re.mjs} +1 -1
- package/dist/{AcpNativeLogging-BBLrglnY.cjs → AcpNativeLogging-Be1KGJfF.cjs} +1 -1
- package/dist/{AzureDevOpsSourceControlProvider-lRTMr9X9.mjs → AzureDevOpsSourceControlProvider-CGlK6M0b.mjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-BMQxxk2n.cjs → AzureDevOpsSourceControlProvider-CVj-F-pW.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-F1J_75c0.mjs → BitbucketSourceControlProvider-BV6iRDi7.mjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-BXDk4GzL.cjs → BitbucketSourceControlProvider-CEZEd4PX.cjs} +2 -2
- package/dist/{ClaudeDriver-B_pvBuh5.cjs → ClaudeDriver-lBU7EyUX.cjs} +2 -2
- package/dist/{ClaudeDriver-BpYiEftb.mjs → ClaudeDriver-rooMNrJz.mjs} +2 -2
- package/dist/{CodexDriver-Bcju44ZM.cjs → CodexDriver-CZCIJSLV.cjs} +4 -4
- package/dist/{CodexDriver-6IRQy37T.mjs → CodexDriver-DBz2rPXb.mjs} +4 -4
- package/dist/{CodexTextGeneration-CCvcMT6Y.mjs → CodexTextGeneration-BeG7ymPC.mjs} +1 -1
- package/dist/{CodexTextGeneration-yaU53Kmz.cjs → CodexTextGeneration-BvIcyD1P.cjs} +1 -1
- package/dist/{CopilotDriver-CTxl0KmP.cjs → CopilotDriver-CX5zhEdZ.cjs} +3 -3
- package/dist/{CopilotDriver-BCe5V1Ll.mjs → CopilotDriver-D36vbGbn.mjs} +3 -3
- package/dist/{CursorDriver-D1Agqrbj.cjs → CursorDriver-CPBVeesr.cjs} +3 -3
- package/dist/{CursorDriver-C4V25d1y.mjs → CursorDriver-DWuuOSkJ.mjs} +3 -3
- package/dist/{ForgejoSourceControlProvider-C-NI9vaC.mjs → ForgejoSourceControlProvider-CeN7Snfr.mjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-CV1lljGK.cjs → ForgejoSourceControlProvider-CzmmcAZO.cjs} +2 -2
- package/dist/{GitHubSourceControlProvider-B_7J1jOl.cjs → GitHubSourceControlProvider-DfFR9O2o.cjs} +2 -2
- package/dist/{GitHubSourceControlProvider-BeCMPF92.mjs → GitHubSourceControlProvider-Dmz1LJct.mjs} +2 -2
- package/dist/{GitLabSourceControlProvider-0BeWchVS.mjs → GitLabSourceControlProvider-C21lwphV.mjs} +2 -2
- package/dist/{GitLabSourceControlProvider-U0xcv577.cjs → GitLabSourceControlProvider-DGoelNmL.cjs} +2 -2
- package/dist/{GrokDriver-mkLP3IZl.cjs → GrokDriver-CIXj_4ry.cjs} +3 -3
- package/dist/{GrokDriver-DFw7DOdK.mjs → GrokDriver-qKX1a63G.mjs} +3 -3
- package/dist/{OpenCodeDriver-ChWHrFi7.mjs → OpenCodeDriver-CbdswhqU.mjs} +2 -2
- package/dist/{OpenCodeDriver-C_KFYA-P.cjs → OpenCodeDriver-DDEuwtXl.cjs} +2 -2
- package/dist/{SourceControlProviderDiscoveryCatalog-BTJDoEx1.mjs → SourceControlProviderDiscoveryCatalog-4_4yahsa.mjs} +1 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-Bwu_JBJN.cjs → SourceControlProviderDiscoveryCatalog-DJWDCoup.cjs} +1 -1
- package/dist/bin.cjs +46 -20
- package/dist/bin.mjs +46 -20
- package/dist/client/assets/AccountSettings-CxbiGHT-.js +1 -0
- package/dist/client/assets/{AiFocusSettings-DGHWPxgZ.js → AiFocusSettings-Cx2vpGdu.js} +1 -1
- package/dist/client/assets/{AnimatedHeight-BwF3D1vB.js → AnimatedHeight-D5lUTPRn.js} +1 -1
- package/dist/client/assets/AppearanceSettings-eWri4YVm.js +1 -0
- package/dist/client/assets/{BranchToolbar.logic-CvclFpSW.js → BranchToolbar.logic-C1Dh4xQW.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-CL4qBTZb.js → ChatRightPanel-DAVHrLN_.js} +9 -9
- package/dist/client/assets/{ChatThreadRouteView-BuOmyy7a.js → ChatThreadRouteView-D11uiGPL.js} +1 -1
- package/dist/client/assets/{CommandPaletteDialog-lCv8qmpm.js → CommandPaletteDialog-DDXuLFyX.js} +1 -1
- package/dist/client/assets/{CompositeItem-e0rusLTG.js → CompositeItem-D-K93PI3.js} +1 -1
- package/dist/client/assets/{CompositeRoot-vnNIb6NL.js → CompositeRoot-Cee5L4T9.js} +1 -1
- package/dist/client/assets/ConnectionsSettings-Cf1RRkcn.js +7 -0
- package/dist/client/assets/{DiagnosticsSettings-CxT6modq.js → DiagnosticsSettings-R00QjM1b.js} +2 -2
- package/dist/client/assets/{DialogHandle-DZVZpjWD.js → DialogHandle-pL0RAsXa.js} +1 -1
- package/dist/client/assets/{DialogPopup-BIJxt62s.js → DialogPopup-DqvvwMxX.js} +1 -1
- package/dist/client/assets/DialogRoot-BZCu6XdB.js +1 -0
- package/dist/client/assets/{DialogTitle-CtpwXIBL.js → DialogTitle-BamZsRNz.js} +1 -1
- package/dist/client/assets/{DialogTrigger-CdeFWE8i.js → DialogTrigger-DR3vtVpa.js} +1 -1
- package/dist/client/assets/{DialogViewport-C2oKvkDR.js → DialogViewport-CuRGvCfw.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-FriWZLgB.js → DraftChatThreadRouteView-CGMtPPGt.js} +1 -1
- package/dist/client/assets/{ExternalIdentityWeb.logic-DsqwSlwL.js → ExternalIdentityWeb.logic-D64j70NH.js} +1 -1
- package/dist/client/assets/{GlassSurface-EZnNd1mF.js → GlassSurface-DTmaROoR.js} +1 -1
- package/dist/client/assets/HostedConnectionControls-CXiER4OL.js +1 -0
- package/dist/client/assets/HostedHubRoot-MbaWk1RQ.js +1 -0
- package/dist/client/assets/{HostedNativeAuthorizationRoute-B-F2I7S_.js → HostedNativeAuthorizationRoute-DQ71L_yc.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-CB0O5OAN.js → HostedRelayTrustNotice-Cv7T3mW5.js} +1 -1
- package/dist/client/assets/{Icons-Cme5LL0k.js → Icons-DjUJVKIP.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-CS9vrmPw.js → IntegrationsSettingsPanel-BUDT_BAr.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-CQi3dbgG.js → KeybindingsSettings-DpU1kPiV.js} +1 -1
- package/dist/client/assets/{McpServersSettings-BMV56xhW.js → McpServersSettings-DQqM_vIq.js} +1 -1
- package/dist/client/assets/{MobileSheet-C8OrQzw0.js → MobileSheet-PksVmYO6.js} +1 -1
- package/dist/client/assets/{NewWorktreeDialog-DnxmXlh2.js → NewWorktreeDialog-CAe3UUk5.js} +1 -1
- package/dist/client/assets/{NoActiveThreadState-BWs9JspL.js → NoActiveThreadState-B020r2KX.js} +1 -1
- package/dist/client/assets/NodeSecuritySettings-DlVOOlej.js +1 -0
- package/dist/client/assets/{OpinionatedPluginsSettings-BcGJ1f7b.js → OpinionatedPluginsSettings-DMshW6cD.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-BJGf9FwA.js → PhoneGetAppInterstitial-BCO-RNVk.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-KgY3ydJF.js → PhoneGetAppInterstitialBackdrop-CkHNzjRm.js} +1 -1
- package/dist/client/assets/{PhoneHome-kBrFqF5K.js → PhoneHome-DY2ItxYl.js} +1 -1
- package/dist/client/assets/{PhoneSettingsSurface-CBI6Gl8b.js → PhoneSettingsSurface-DTP9FXLL.js} +1 -1
- package/dist/client/assets/{ProjectFavicon-D0HVbYDF.js → ProjectFavicon-Dopa4Rxy.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-DZTCKskK.js → ProviderModelPicker-ChoxerzY.js} +1 -1
- package/dist/client/assets/ProviderUpdateLaunchNotification.logic-BkoRegCn.js +1 -0
- package/dist/client/assets/ProvidersSettingsPanel-Ubea3yAA.js +1 -0
- package/dist/client/assets/{RedactedSensitiveText-CRGSSHz3.js → RedactedSensitiveText-CdVeknPX.js} +1 -1
- package/dist/client/assets/RootAppShell-BkUPk443.js +6 -0
- package/dist/client/assets/{RycoLetterMark-E82lj57c.js → RycoLetterMark-GW-n9UxM.js} +1 -1
- package/dist/client/assets/SettingsDialog-DMPrhOeR.js +1 -0
- package/dist/client/assets/SettingsPanels-ChP1z6Bu.js +3 -0
- package/dist/client/assets/{SettingsPanels.editor-DTAK4nlM.js → SettingsPanels.editor-CiyAxlms.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-CpnAAcyj.js → SourceControlSettings-8w3XlkuZ.js} +1 -1
- package/dist/client/assets/{StatisticsPage-DwU3oJRO.js → StatisticsPage-D4lU63rD.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-8OSQWA79.js → StatisticsPanel-C2yBieuM.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-Bb86VtRL.js → StatisticsSettingsLink-DZwvRI-Y.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-wgiSGtn6.js → ThreadStatusIndicators-B43wkv-s.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-Dju6roQA.js → ThreadTerminalDrawer-BYQ6EMgr.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-hfIocZRN.js → ThreadWorkspacePanel-DuaQ9DMj.js} +1 -1
- package/dist/client/assets/{ToolbarRootContext-CgV898DN.js → ToolbarRootContext-Cp1bgmpz.js} +1 -1
- package/dist/client/assets/{WorkItemsTab-DYgsIthY.js → WorkItemsTab-BDfun24H.js} +6 -6
- package/dist/client/assets/{alert-DFo8_l6D.js → alert-DdU9OGtC.js} +1 -1
- package/dist/client/assets/{alert-dialog-Cmodiuqg.js → alert-dialog-zAmnOpaF.js} +1 -1
- package/dist/client/assets/{authorization-CFcCWeGd.js → authorization-mIJKV2yp.js} +1 -1
- package/dist/client/assets/{badge-BbJiUmhG.js → badge-CNPL77i3.js} +1 -1
- package/dist/client/assets/{branding-CG1VEma6.js → branding-yW_ACj9l.js} +1 -1
- package/dist/client/assets/{button-BT6cGe5S.js → button-CXfaxtRp.js} +1 -1
- package/dist/client/assets/{capabilities-CK9Wa-Au.js → capabilities-j43xmCXg.js} +1 -1
- package/dist/client/assets/{chatThreadActions-Ooky34bb.js → chatThreadActions-DQ8aOQ1g.js} +1 -1
- package/dist/client/assets/{collapsible-BIEfHdzc.js → collapsible-oJfDmFRs.js} +1 -1
- package/dist/client/assets/{command-BjXuIvYa.js → command-DK1D8p4-.js} +1 -1
- package/dist/client/assets/{composerDraftStore-_Xy-iY4b.js → composerDraftStore-BaAeiPHc.js} +1 -1
- package/dist/client/assets/copy-UQjKGt7t.js +1 -0
- package/dist/client/assets/{data-list-iVYHRfWS.js → data-list-BpzwKa1z.js} +1 -1
- package/dist/client/assets/{desktopUpdateAtoms-C9VOpM6h.js → desktopUpdateAtoms-Cy06xm8M.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-BOWgdyPs.js → desktopWorkspace-Cw4Fu0Dd.js} +1 -1
- package/dist/client/assets/{device-CLd1blIe.js → device-hx7RX9fI.js} +1 -1
- package/dist/client/assets/{dialog-BUIS3TXH.js → dialog-JVv-MNDj.js} +1 -1
- package/dist/client/assets/{draft-input-CUkU2EAu.js → draft-input-CxoGkZxM.js} +1 -1
- package/dist/client/assets/{editorPreferences-C79SevBP.js → editorPreferences-C3i2Nkh2.js} +1 -1
- package/dist/client/assets/{empty-BNn5X77p.js → empty-DhkXzm1N.js} +1 -1
- package/dist/client/assets/{env-CBdFekj3.js → env-B4arEvJg.js} +1 -1
- package/dist/client/assets/{getPseudoElementBounds-CWoLtsYr.js → getPseudoElementBounds-NLvUMZyQ.js} +1 -1
- package/dist/client/assets/{group-a6GUMeTh.js → group-CafmSbGU.js} +1 -1
- package/dist/client/assets/{index-Bbc24tew.js → index-COc-h_V9.js} +2 -2
- package/dist/client/assets/{input-zjUwoDs3.js → input-Bz9pd_f3.js} +1 -1
- package/dist/client/assets/{kbd-BGOWI5KX.js → kbd-qh5s29Yp.js} +1 -1
- package/dist/client/assets/{keybindings-n2U57Td0.js → keybindings-BCns_TPr.js} +1 -1
- package/dist/client/assets/{label-DWGvDLsD.js → label-Ct6uH6qL.js} +1 -1
- package/dist/client/assets/{lib-DoLGGVrW.js → lib-BBbQoz14.js} +1 -1
- package/dist/client/assets/{logging-FtLrPmK_.js → logging-M8H3z7rQ.js} +1 -1
- package/dist/client/assets/{main-C2i8ecSj.js → main-9Wu8G64Y.js} +2 -2
- package/dist/client/assets/main-DaYHZt-J.css +2 -0
- package/dist/client/assets/{menu-CwPZHq2g.js → menu-DL-18Hfn.js} +1 -1
- package/dist/client/assets/{popover-j6ZF-s94.js → popover-C9y_0-ZN.js} +1 -1
- package/dist/client/assets/{primary-0ymoUGkq.js → primary-OskAInOO.js} +1 -1
- package/dist/client/assets/{projectPaths-CHDYD_Gc.js → projectPaths-DSRhOXwD.js} +1 -1
- package/dist/client/assets/{providerDriverMeta-lsEf84Mz.js → providerDriverMeta-DcAmgw5o.js} +1 -1
- package/dist/client/assets/{providerIconUtils-_WuNo2Ek.js → providerIconUtils-DSXSWHwg.js} +1 -1
- package/dist/client/assets/providerInstances-D5NRn-MS.js +1 -0
- package/dist/client/assets/providerModels-D5NRn-MS.js +1 -0
- package/dist/client/assets/{qr-code-DbscZ6Qz.js → qr-code-DsN9sWfN.js} +1 -1
- package/dist/client/assets/{radio-group-BTtFIcDI.js → radio-group-DGUZYMAN.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-CxOsaNI8.js → resolveAriaLabelledBy-l3Wj7Mso.js} +1 -1
- package/dist/client/assets/{rightPanelRouteSearch-DkhE1otz.js → rightPanelRouteSearch-DE_7uWlN.js} +1 -1
- package/dist/client/assets/runtime-CqhG6EOG.js +1 -0
- package/dist/client/assets/{scroll-area-B-bu3v0j.js → scroll-area-gtur6NxN.js} +1 -1
- package/dist/client/assets/{scrollEdges-CDEU4fOg.js → scrollEdges-Ccq9Jqpk.js} +1 -1
- package/dist/client/assets/{select-rPdFVPfm.js → select-BB7zCkpA.js} +1 -1
- package/dist/client/assets/{separator-CaVw81t6.js → separator-DOGIr29S.js} +1 -1
- package/dist/client/assets/{session-logic-B0shVXpN.js → session-logic-DOQPF0oN.js} +1 -1
- package/dist/client/assets/{settingsDialogStore-CPtQPrek.js → settingsDialogStore-DM98Sea0.js} +1 -1
- package/dist/client/assets/settingsLayout-CS7P71tz.js +1 -0
- package/dist/client/assets/settingsSections.logic-F8RXVmAq.js +1 -0
- package/dist/client/assets/{sheet-DQBndeJT.js → sheet-DVALF6mw.js} +1 -1
- package/dist/client/assets/{sidebar-H-CSxQVD.js → sidebar-Dft4bIEi.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-CsZlmaJg.js → sidebarProjectFolders-BOfJCYjK.js} +1 -1
- package/dist/client/assets/{sidebarStatusText-DjLAEM1H.js → sidebarStatusText-DaNVnBiR.js} +1 -1
- package/dist/client/assets/{skeleton-CCuGgPK1.js → skeleton-CBHDWLDX.js} +1 -1
- package/dist/client/assets/{spinner-CgrOdIjl.js → spinner-JhkVC8d7.js} +1 -1
- package/dist/client/assets/src-Vf4LVnMX.js +14 -0
- package/dist/client/assets/storeSelectors-CP3vrsGY.js +1 -0
- package/dist/client/assets/{switch-cMx5Wv_R.js → switch-vkC1QGDn.js} +1 -1
- package/dist/client/assets/{terminal-links-DERnXf-G.js → terminal-links-BaX-ICJT.js} +1 -1
- package/dist/client/assets/{textarea-DIqqrD8A.js → textarea-Cz_x76EQ.js} +1 -1
- package/dist/client/assets/{threadPriorityRefreshRuntime-D2XRdn_X.js → threadPriorityRefreshRuntime-DqqfcbZE.js} +1 -1
- package/dist/client/assets/toast-Bnfw8LOb.js +1 -0
- package/dist/client/assets/{toggle-BIs83JSj.js → toggle-DNtHlm45.js} +1 -1
- package/dist/client/assets/{toggle-group-0LgplGMc.js → toggle-group-BNtjyirT.js} +1 -1
- package/dist/client/assets/{tooltip-BaJgdXlL.js → tooltip-lYatfjuN.js} +1 -1
- package/dist/client/assets/types-CP3vrsGY.js +1 -0
- package/dist/client/assets/{uiStateStore-hgy2ilHo.js → uiStateStore-VVodpTkG.js} +1 -1
- package/dist/client/assets/{useAtlassian-1BSXt3BO.js → useAtlassian-DzQhYzCz.js} +0 -0
- package/dist/client/assets/{useButton-_xmxdcVX.js → useButton-CQaIys_r.js} +1 -1
- package/dist/client/assets/{useCompositeListItem-dLIU4XjY.js → useCompositeListItem-D_u_nlWz.js} +1 -1
- package/dist/client/assets/useCopyToClipboard-BTpWxumf.js +1 -0
- package/dist/client/assets/{useDebouncedValue-DU7gLY9w.js → useDebouncedValue-Dl2JtWSe.js} +1 -1
- package/dist/client/assets/{useFloatingRootContext-CSPbIu1q.js → useFloatingRootContext-DKAeq7FI.js} +1 -1
- package/dist/client/assets/useHandleNewThread-CzfIpG9Y.js +1 -0
- package/dist/client/assets/{useLabelableId-COmfNFnd.js → useLabelableId-C7EOshps.js} +1 -1
- package/dist/client/assets/{useLocation-DsqdpYA5.js → useLocation-CvhfNIUj.js} +1 -1
- package/dist/client/assets/{useOpenInteractionType-JaQBnIly.js → useOpenInteractionType-D9ngong8.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions-RjcSVspy.js → usePhoneThreadActions-CiFBnOHD.js} +1 -1
- package/dist/client/assets/{usePopupViewport-wXfO6SZE.js → usePopupViewport-CQTeg5Y-.js} +1 -1
- package/dist/client/assets/{useScrollLock-Dr_P7FLZ.js → useScrollLock-TdF-Iq8H.js} +1 -1
- package/dist/client/assets/{useStatistics-B2NNfOqV.js → useStatistics-CP8uxvx6.js} +1 -1
- package/dist/client/assets/{useSwipeDismiss-B8Fo31QE.js → useSwipeDismiss-DESLmDpT.js} +1 -1
- package/dist/client/assets/{useThreadActions-B9kmG6FU.js → useThreadActions-fOb3ApmL.js} +1 -1
- package/dist/client/assets/{useTriggerFocusGuards-O2ZE3JtI.js → useTriggerFocusGuards-DkAmJBLw.js} +1 -1
- package/dist/client/assets/{useValueChanged-Dj0YXujm.js → useValueChanged-CSGMZCwN.js} +1 -1
- package/dist/client/assets/{utils-c6dglOTK.js → utils-BPUctpTG.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-Dn-L1KcR.cjs → collectUint8StreamText-Bb52hlpd.cjs} +36 -6
- package/dist/{collectUint8StreamText-DNY4x71l.mjs → collectUint8StreamText-EDg4F0TU.mjs} +31 -7
- package/dist/{makeManagedServerProvider-D3T5X-B4.mjs → makeManagedServerProvider-Cf8bNWwc.mjs} +1 -1
- package/dist/{makeManagedServerProvider-DNnEIuhW.cjs → makeManagedServerProvider-itynW7xv.cjs} +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AccountSettings-ckhtafp7.js +0 -1
- package/dist/client/assets/AppearanceSettings-CDvljGDS.js +0 -1
- package/dist/client/assets/ConnectionsSettings-BJJrdASq.js +0 -7
- package/dist/client/assets/DialogRoot-8xRqqTn8.js +0 -1
- package/dist/client/assets/HostedConnectionControls-BYS30u9D.js +0 -1
- package/dist/client/assets/HostedHubRoot-Bi0LEQCK.js +0 -1
- package/dist/client/assets/NodeSecuritySettings-iTvQFged.js +0 -1
- package/dist/client/assets/ProviderUpdateLaunchNotification.logic-CtfZzmYI.js +0 -1
- package/dist/client/assets/ProvidersSettingsPanel-DAz8hMXw.js +0 -1
- package/dist/client/assets/RootAppShell-BWtqIOLh.js +0 -6
- package/dist/client/assets/SettingsDialog-RrFirXQp.js +0 -1
- package/dist/client/assets/SettingsPanels-bLK5JAV2.js +0 -3
- package/dist/client/assets/main-an0sD0U2.css +0 -2
- package/dist/client/assets/providerInstances-DEQekDE8.js +0 -1
- package/dist/client/assets/providerModels-DEQekDE8.js +0 -1
- package/dist/client/assets/runtime-BkRtSwRY.js +0 -1
- package/dist/client/assets/settingsLayout-B8os-EWr.js +0 -1
- package/dist/client/assets/settingsSections.logic-Be8uaymC.js +0 -1
- package/dist/client/assets/src-b7-hpIff.js +0 -14
- package/dist/client/assets/storeSelectors-BLHJVLCP.js +0 -1
- package/dist/client/assets/toast-DonYDy-6.js +0 -1
- package/dist/client/assets/types-BLHJVLCP.js +0 -1
- package/dist/client/assets/useCopyToClipboard-qG2nhvjQ.js +0 -1
- package/dist/client/assets/useHandleNewThread-COAg-4eT.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-b7-hpIff.js";import{l as i,v as a}from"./runtime-BkRtSwRY.js";import{n as o}from"./primary-0ymoUGkq.js";import{f as s,t as c}from"./utils-c6dglOTK.js";import{f as l}from"./useRenderElement-DchFnsR8.js";import{t as u}from"./activity-1CkdQG5u.js";import{A as d,C as f,D as p,E as m,F as h,I as g,L as _,M as v,O as y,P as b,R as x,S,T as C,_ as w,c as T,d as E,f as D,g as O,h as ee,j as k,m as A,o as j,p as M,r as N,s as P,t as F,v as I,w as L,x as R}from"./useStatistics-B2NNfOqV.js";import{t as z}from"./chart-column-Dw6ACmXM.js";import{t as B}from"./circle-alert-BWvs6IOn.js";import{t as V}from"./clock-3-r12DkpRj.js";import{n as H,t as te}from"./layers-BYi0v17h.js";import{t as ne}from"./git-pull-request-DIYyPsg5.js";import{t as re}from"./messages-square-DiMgWzoq.js";import{t as U}from"./refresh-cw-DopCMrtR.js";import{t as ie}from"./shield-alert-DY9uVP5G.js";import{t as ae}from"./sparkles-CAf3oJ5S.js";import{t as oe}from"./triangle-alert-RL_T3KLo.js";import{t as se}from"./wrench-D0IetWa1.js";import{t as ce}from"./scroll-area-B-bu3v0j.js";import{t as W}from"./button-BT6cGe5S.js";import{t as le}from"./capabilities-CK9Wa-Au.js";import{o as ue}from"./sidebar-H-CSxQVD.js";import{a as de,i as fe,o as pe,s as me,t as he}from"./select-rPdFVPfm.js";import{t as ge}from"./badge-BbJiUmhG.js";var _e=l(`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`}]]),ve=l(`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`}]]),ye=l(`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`}]]),G=n(),K=s();function be(e){let t=(0,G.c)(56),{search:n,onSearchChange:r}=e,{snapshot:i,loading:a,error:s,refresh:c,refreshing:l}=F(),d=n.projectId??null,p=n.model??null,m=n.modelProvider??null,h;t[0]!==n.range||t[1]!==d||t[2]!==p||t[3]!==m?(h={range:n.range,projectId:d,model:p,provider:m},t[0]=n.range,t[1]=d,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=T(i,g),s=E(o);e=o,n=s,r=P(i,o,g.range),a=N(o,j(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 v=_;if(a&&!i){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(ee,{}),t[16]=e):e=t[16],e}if(s&&!i){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(U,{}),t[17]=e):e=t[17];let n;t[18]===c?n=t[19]:(n=(0,K.jsxs)(W,{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,K.jsx)(O,{icon:oe,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||!v)return null;let{totals:b,days:x,projects:S}=v,C=o()?.label??`Current environment`,k;if(t[23]!==x||t[24]!==g||t[25]!==r||t[26]!==S||t[27]!==c||t[28]!==l||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=Se(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,K.jsx)(D,{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=l?`animate-spin`:void 0,d;t[45]===s?d=t[46]:(d=(0,K.jsx)(U,{className:s}),t[45]=s,t[46]=d);let p=l?`Refreshing`:`Refresh`,m;t[47]!==c||t[48]!==l||t[49]!==d||t[50]!==p?(m=(0,K.jsxs)(W,{size:`sm`,variant:`outline`,onClick:c,disabled:l,children:[d,p]}),t[47]=c,t[48]=l,t[49]=d,t[50]=p,t[51]=m):m=t[51];let h;t[52]!==m||t[53]!==o?(h=(0,K.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,K.jsxs)(`p`,{className:`max-w-4xl text-sm leading-relaxed text-muted-foreground`,children:[`Activity includes work observed by Ryco on`,` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:C}),`. Usage from other CLI sessions appears in the Usage tab and is not assigned to projects.`]}),t[55]=_):_=t[55],k=(0,K.jsxs)(`div`,{className:`space-y-8`,children:[h,_,i.dailyBuckets.length===0?(0,K.jsx)(O,{icon:u,title:`No Ryco activity yet`,description:`Project and agent activity will appear here after your first completed turns.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-5`,children:[(0,K.jsx)(A,{label:`Active time`,icon:V,value:f(b.activeMs),sub:`${y(b.totalTokens)} observed tokens`}),(0,K.jsx)(A,{label:`Turns`,icon:u,value:L(b.turns),sub:`Completed agent turns`}),(0,K.jsx)(A,{label:`Chats`,icon:re,value:L(b.threadsCreated),sub:`Conversations started`}),(0,K.jsx)(A,{label:`Tool uses`,icon:se,value:L(b.toolUses),sub:`Observed invocations`}),(0,K.jsx)(A,{label:`Files changed`,icon:H,value:L(b.filesChanged),sub:`+${L(b.additions)} / −${L(b.deletions)} lines`})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1.2fr_0.8fr]`,children:[(0,K.jsxs)(M,{title:`Activity rhythm`,icon:u,bodyClassName:`p-5`,action:(0,K.jsx)(Ce,{search:n,onSearchChange:r}),children:[(0,K.jsx)(R,{points:x,metric:n.activityMetric}),(0,K.jsxs)(`div`,{className:`mt-5 grid grid-cols-3 gap-3 border-t border-border/60 pt-4`,children:[(0,K.jsx)(J,{label:`Active days`,value:L(e.activeDays)}),(0,K.jsx)(J,{label:`Current streak`,value:`${L(e.currentStreak)}d`}),(0,K.jsx)(J,{label:`Busiest UTC day`,value:e.busiestLabel})]})]}),(0,K.jsx)(M,{title:`Projects`,icon:u,bodyClassName:`p-4`,children:(0,K.jsx)(I,{data:S,metric:n.activityMetric})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,K.jsxs)(M,{title:`Code changes`,icon:H,bodyClassName:`p-4`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex gap-6 text-sm`,children:[(0,K.jsx)(J,{label:`Files`,value:L(b.filesChanged)}),(0,K.jsx)(J,{label:`Added`,value:`+${L(b.additions)}`,tone:`positive`}),(0,K.jsx)(J,{label:`Removed`,value:`−${L(b.deletions)}`,tone:`negative`})]}),(0,K.jsx)(w,{data:x})]}),(0,K.jsxs)(M,{title:`Source control · all time`,icon:ne,bodyClassName:`overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 border-b border-border/60 px-4 py-4`,children:[(0,K.jsx)(J,{label:`Active`,value:L(i.worktrees.active)}),(0,K.jsx)(J,{label:`Created`,value:L(i.worktrees.created)}),(0,K.jsx)(J,{label:`Archived`,value:L(i.worktrees.archived)}),(0,K.jsx)(J,{label:`Open PRs`,value:L(i.worktrees.openPrs)})]}),i.recentPullRequests.length===0?(0,K.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,K.jsx)(`div`,{className:`divide-y divide-border/60`,children:i.recentPullRequests.slice(0,6).map(xe)})]})]})]})]}),t[23]=x,t[24]=g,t[25]=r,t[26]=S,t[27]=c,t[28]=l,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]=k}else k=t[36];return k}function xe(e){return(0,K.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,K.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,K.jsx)(ne,{className:`size-4`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.prTitle||e.worktreeTitle||e.branch}),(0,K.jsxs)(`p`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:[e.projectTitle,` · #`,e.prNumber,` ·`,` `,p(e.updatedAt)]})]}),(0,K.jsx)(ge,{variant:e.prState===`merged`?`success`:e.active?`info`:`secondary`,children:e.prIsDraft?`Draft`:e.prState??(e.active?`Open`:`Archived`)})]},e.worktreeId)}function q(e,t){return t===`turns`?e.turns:t===`activeMs`?e.activeMs:e.filesChanged}function Se(e,t){let n=0,r=0,i=null;for(let r of e){let e=q(r,t);e>0&&(n+=1),(i===null||e>q(i,t))&&(i=r)}for(let n=e.length-1;n>=0;--n){let i=e[n];if(i===void 0||q(i,t)<=0)break;r+=1}if(i===null||q(i,t)<=0)return{activeDays:n,currentStreak:r,busiestLabel:`—`};let a=q(i,t),o=t===`activeMs`?f(a):L(a);return{activeDays:n,currentStreak:r,busiestLabel:`${i.date.slice(5)} · ${o}`}}function Ce(e){let t=(0,G.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,K.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,activityMetric:e}),className:c(`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 J(e){let t=(0,G.c)(10),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.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=c(`mt-1 font-semibold tabular-nums`,o),t[2]=o,t[3]=s);let l;t[4]!==s||t[5]!==r?(l=(0,K.jsx)(`p`,{className:s,children:r}),t[4]=s,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==a||t[8]!==l?(u=(0,K.jsxs)(`div`,{children:[a,l]}),t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function we(e){switch(e){case`complete`:return 4;case`partial`:return 3;case`not-found`:return 2;case`failed`:return 1}}function Te(e,t){return we(t.source.status)-we(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 Ee(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 De(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 Oe(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(Te),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=Ee(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:De(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 ke=class{#e=0;next(){return this.#e+=1,this.#e}isCurrent(e){return e===this.#e}},Y=e(t(),1),Ae={"7d":7,"30d":30,"90d":90,all:null};function je(e,t){return new Intl.DateTimeFormat(`en-CA`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(new Date(e))}function Me(e,t,n=Date.now()){let r=je(n,t),i=Ae[e];return i===null?{endDate:r,timeZone:t,contractVersion:1}:{startDate:je(Date.parse(`${r}T12:00:00.000Z`)-(i-1)*864e5,`UTC`),endDate:r,timeZone:t,contractVersion:1}}function Ne(){let e=(0,G.c)(3),[t,n]=(0,Y.useState)(0),r,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>a(()=>n(Pe)),o=[],e[0]=r,e[1]=o):(r=e[0],o=e[1]),(0,Y.useEffect)(r,o);let s;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=i(),e[2]=s):s=e[2],s}function Pe(e){return e+1}function Fe(e){let t=Ne(),n=(0,Y.useMemo)(()=>t.map(e=>({environmentId:e.environmentId,label:e.knownEnvironment.label})).toSorted((e,t)=>e.label.localeCompare(t.label)),[t]),r=(0,Y.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,Y.useState)(0),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)([]),[d,f]=(0,Y.useState)(!0),p=(0,Y.useRef)(new ke),m=r.map(e=>e.environmentId).toSorted().join(`\0`);(0,Y.useEffect)(()=>{let t=p.current.next(),n=Me(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(Oe(e)),f(!1))})},[e.range,a,r,m,i]);let h=(0,Y.useCallback)(()=>o(e=>e+1),[]);return{merged:s,environments:l,availableEnvironments:n,loading:d,refreshing:d&&s!==null,refresh:h}}function Ie(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 Le(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 Re(e,t){return new Date(Date.parse(`${e}T12:00:00.000Z`)+t*864e5).toISOString().slice(0,10)}function ze(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=Re(t,1))i.push(n.get(t)??{date:t,claudeCost:0,codexCost:0,claudeTokens:0,codexTokens:0});return i}function Be(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 Ve=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),X={claude:`#d97757`,codex:`var(--foreground)`};function Z(e){return e===null?`Unavailable`:Ve.format(e)}function He(e){let t=(0,G.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=Fe(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=Ie(o,n.providers);e=s,r=Le(o,s),i=ze(o,s),a=Be(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,K.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=O,n=o.length>0?B:ye,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,K.jsx)(U,{}),t[21]=o):o=t[21];let s;t[22]===a.refresh?s=t[23]:(s=(0,K.jsxs)(W,{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,K.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,p=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,v;t[32]!==r||t[33]!==n?(v=(0,K.jsx)(qe,{search:n,onSearchChange:r}),t[32]=r,t[33]=n,t[34]=v):v=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 x;t[38]!==a.availableEnvironments||t[39]!==h?(x=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]=x):x=t[40];let w;t[41]===x?w=t[42]:(w=(0,K.jsx)(pe,{size:`sm`,className:`w-48`,"aria-label":`Usage environment`,children:(0,K.jsx)(me,{children:x})}),t[41]=x,t[42]=w);let T;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(fe,{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 D;t[46]===E?D=t[47]:(D=(0,K.jsxs)(de,{alignItemWithTrigger:!1,children:[T,E]}),t[46]=E,t[47]=D);let k;t[48]!==h||t[49]!==D||t[50]!==b||t[51]!==w?(k=(0,K.jsxs)(he,{value:h,onValueChange:b,children:[w,D]}),t[48]=h,t[49]=D,t[50]=b,t[51]=w,t[52]=k):k=t[52];let A;t[53]!==r||t[54]!==n?(A=(0,K.jsx)(Je,{search:n,onSearchChange:r}),t[53]=r,t[54]=n,t[55]=A):A=t[55];let j;t[56]!==k||t[57]!==A||t[58]!==v?(j=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[v,k,A]}),t[56]=k,t[57]=A,t[58]=v,t[59]=j):j=t[59];let N=a.refreshing?`animate-spin`:void 0,P;t[60]===N?P=t[61]:(P=(0,K.jsx)(U,{className:N}),t[60]=N,t[61]=P);let F=a.refreshing?`Refreshing`:`Refresh`,I;t[62]!==a.refresh||t[63]!==a.refreshing||t[64]!==P||t[65]!==F?(I=(0,K.jsxs)(W,{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]=I):I=t[66];let R;t[67]!==j||t[68]!==I?(R=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[j,I]}),t[67]=j,t[68]=I,t[69]=R):R=t[69];let z;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,K.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]=z):z=t[70];let V;t[71]!==d||t[72]!==p||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,K.jsx)(O,{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,K.jsxs)(K.Fragment,{children:[(0,K.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,K.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,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:[(0,K.jsx)(ve,{className:`size-3.5`}),` Raw API-equivalent cost`]}),(0,K.jsx)(`div`,{className:`mt-5 text-4xl font-semibold tracking-[-0.045em] tabular-nums sm:text-5xl`,children:Z(l.estimatedCostUsd)}),(0,K.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,K.jsxs)(`div`,{className:`space-y-4 border-t border-border/65 pt-5`,children:[(0,K.jsx)(et,{label:`Priced coverage`,value:`${Math.round(f*100)}% of tokens`}),(0,K.jsx)(et,{label:`Estimated cache savings`,value:Z(l.estimatedCacheSavingsUsd)}),(0,K.jsx)(et,{label:`Provider-recorded tokens`,value:L(l.totalTokens)})]})]}),(0,K.jsxs)(`div`,{className:`min-w-0 p-4 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3 px-1`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Usage over time`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Daily values in `,o.timeZone]})]}),(0,K.jsx)(Ye,{search:n,onSearchChange:r})]}),(0,K.jsx)(Ze,{data:u,metric:n.usageMetric}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-4 px-2 text-[11px] text-muted-foreground`,children:[(0,K.jsx)(tt,{color:X.claude,label:`Claude`}),(0,K.jsx)(tt,{color:X.codex,label:`Codex`})]})]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 border-y border-border/65 md:grid-cols-5`,children:[(0,K.jsx)(Q,{label:`Total tokens`,value:y(l.totalTokens)}),(0,K.jsx)(Q,{label:`Sessions`,value:L(l.distinctSessionCount)}),(0,K.jsx)(Q,{label:`Responses`,value:L(l.responseCount)}),(0,K.jsx)(Q,{label:`Cache read`,value:`${Math.round(p*100)}%`}),(0,K.jsx)(Q,{label:`Reasoning`,value:y(l.reasoningTokens),detail:`included in output`})]}),(0,K.jsx)(M,{title:`Breakdown`,icon:te,action:(0,K.jsx)(Xe,{search:n,onSearchChange:r}),bodyClassName:`overflow-hidden`,children:(0,K.jsx)(`div`,{className:`divide-y divide-border/60`,children:d.slice(0,20).map(e=>(0,K.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,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:n.usageBreakdown===`model`?C(e.label):S(e.label)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e.provider?m(e.provider):`${e.responses} responses`})]}),(0,K.jsxs)(`div`,{className:`text-right`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:y(e.tokens)}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`tokens`})]}),(0,K.jsxs)(`div`,{className:`w-24 text-right`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:Z(e.costUsd)}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.unpricedTokens>0?`${y(e.unpricedTokens)} unpriced`:`estimated`})]})]},e.key))})}),(0,K.jsx)(nt,{summary:o})]}),t[71]=d,t[72]=p,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,K.jsxs)(`div`,{className:`space-y-8`,children:[R,z,V]}),t[87]=R,t[88]=V,t[89]=H):H=t[89],H}function Ue(e){return(0,K.jsx)(fe,{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,G.c)(3),{search:n,onSearchChange:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,K.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,range:e}),className:c(`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,G.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,K.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`claude`,`codex`].map(t=>(0,K.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:c(`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,K.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block size-1.5 rounded-full`,style:{backgroundColor:X[t]}}),t]},t))}),t[0]=r,t[1]=n,t[2]=i}else i=t[2];return i}function Ye(e){let t=(0,G.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,K.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageMetric:e}),className:c(`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,G.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,K.jsx)(`div`,{className:`inline-flex items-center gap-1 text-[11px]`,children:i.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageBreakdown:e}),className:c(`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,G.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,K.jsxs)(`linearGradient`,{id:`usageClaude`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,K.jsx)(`stop`,{offset:`5%`,stopColor:X.claude,stopOpacity:.3}),(0,K.jsx)(`stop`,{offset:`95%`,stopColor:X.claude,stopOpacity:.02})]}),t[3]=s):s=t[3];let c,l,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsxs)(`defs`,{children:[s,(0,K.jsxs)(`linearGradient`,{id:`usageCodex`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,K.jsx)(`stop`,{offset:`5%`,stopColor:X.codex,stopOpacity:.18}),(0,K.jsx)(`stop`,{offset:`95%`,stopColor:X.codex,stopOpacity:.01})]})]}),l=(0,K.jsx)(x,{vertical:!1,strokeDasharray:`3 5`}),u=(0,K.jsx)(g,{dataKey:`date`,tickLine:!1,axisLine:!1,minTickGap:30,tickFormatter:$e}),t[4]=c,t[5]=l,t[6]=u):(c=t[4],l=t[5],u=t[6]);let f;t[7]===r?f=t[8]:(f=(0,K.jsx)(h,{tickLine:!1,axisLine:!1,width:44,tickFormatter:e=>r===`cost`?`$${Number(e).toFixed(+(Number(e)<10))}`:y(Number(e))}),t[7]=r,t[8]=f);let p;t[9]===r?p=t[10]:(p=(0,K.jsx)(k,{content:(0,K.jsx)(v,{labelFormatter:Qe,formatter:e=>r===`cost`?Ve.format(Number(e)||0):L(Number(e)||0)})}),t[9]=r,t[10]=p);let m=`claude${i}`,S;t[11]===m?S=t[12]:(S=(0,K.jsx)(_,{dataKey:m,name:`Claude`,type:`monotone`,stroke:X.claude,fill:`url(#usageClaude)`,strokeWidth:1.75}),t[11]=m,t[12]=S);let C=`codex${i}`,w;t[13]===C?w=t[14]:(w=(0,K.jsx)(_,{dataKey:C,name:`Codex`,type:`monotone`,stroke:X.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,K.jsx)(d,{className:`h-[300px]`,children:(0,K.jsxs)(b,{data:a,margin:o,children:[c,l,u,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 S(String(e))}function $e(e){return S(String(e))}function et(e){let t=(0,G.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,K.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,K.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,G.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.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,K.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,K.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,K.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,G.c)(5),{color:n,label:r}=e,i;t[0]===n?i=t[1]:(i=(0,K.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,K.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,G.c)(43),{summary:n}=e,r,i,a,o,s,c,l,u,d,f,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=M,_=`Coverage & estimates`,o=_e,s=`p-5`,c=y.length>0?(0,K.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,K.jsx)(B,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,K.jsxs)(`span`,{children:[`No usage was included from`,` `,y.map(at).join(`, `),`.`]})]}):null,f=`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,K.jsx)($,{icon:ye,label:`Transcript sources`,value:w,detail:T}),t[18]=w,t[19]=T,t[20]=m):m=t[20],h=(0,K.jsx)($,{icon:ae,label:`Last scan`,value:C?p(C):`Not scanned`,detail:`${e.reduce(it,0)} cached files reused`});let E=S?`Rates fetched ${p(S)}`:`Token totals remain available without rates`;t[21]!==x||t[22]!==E?(g=(0,K.jsx)($,{icon:ve,label:`Pricing`,value:x,detail:E}),t[21]=x,t[22]=E,t[23]=g):g=t[23],r=$,a=B,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]=f,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],f=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,K.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]!==f||t[32]!==m||t[33]!==h||t[34]!==g?(y=(0,K.jsxs)(`div`,{className:f,children:[m,h,g,v]}),t[30]=v,t[31]=f,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,K.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,G.c)(15),{icon:n,label:r,value:i,detail:a}=e,o;t[0]===n?o=t[1]:(o=(0,K.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,K.jsx)(n,{className:`size-4`})}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,K.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,K.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,K.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,K.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,K.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,G.c)(25),{search:n,onSearchChange:i}=e,a=n.view===`usage`?r.serverGetUsageSummary:r.serverGetStatistics,o=le(a),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h1`,{className:`truncate text-sm font-semibold tracking-tight`,children:`Statistics`}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Usage and work signals`})]}),t[0]=s):s=t[0];let l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=[`usage`,`activity`],t[1]=l):l=t[1];let d;t[2]!==i||t[3]!==n?(d=(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-5`,children:[s,(0,K.jsx)(`div`,{className:`inline-flex rounded-lg bg-muted/75 p-0.5`,children:l.map(e=>{let t=e===`usage`?z:u;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i({...n,view:e}),className:c(`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,K.jsx)(t,{className:`size-3.5`}),` `,e]},e)})})]}),t[2]=i,t[3]=n,t[4]=d):d=t[4];let f;t[5]===n.range?f=t[6]:(f=n.range===`all`?`All available history`:`Last ${n.range.slice(0,-1)} days`,t[5]=n.range,t[6]=f);let p;t[7]===f?p=t[8]:(p=(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:f}),t[7]=f,t[8]=p);let m=n.view===`usage`?`Local calendar window`:`UTC activity window`,h;t[9]===m?h=t[10]:(h=(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:m}),t[9]=m,t[10]=h);let g;t[11]!==p||t[12]!==h?(g=(0,K.jsxs)(`div`,{className:`hidden text-right sm:block`,children:[p,h]}),t[11]=p,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==d||t[15]!==g?(_=(0,K.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:[d,g]}),t[14]=d,t[15]=g,t[16]=_):_=t[16];let v;t[17]!==o.allowed||t[18]!==o.reason||t[19]!==i||t[20]!==n?(v=(0,K.jsx)(ce,{className:`min-h-0 flex-1`,children:(0,K.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,K.jsx)(He,{search:n,onSearchChange:i}):(0,K.jsx)(be,{search:n,onSearchChange:i}):(0,K.jsx)(O,{icon:ie,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]=v):v=t[21];let y;return t[22]!==v||t[23]!==_?(y=(0,K.jsx)(ue,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[_,v]})}),t[22]=v,t[23]=_,t[24]=y):y=t[24],y}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-Vf4LVnMX.js";import{l as i,v as a}from"./runtime-CqhG6EOG.js";import{n as o}from"./primary-OskAInOO.js";import{f as s,t as c}from"./utils-BPUctpTG.js";import{f as l}from"./useRenderElement-DchFnsR8.js";import{t as u}from"./activity-1CkdQG5u.js";import{A as d,C as f,D as p,E as m,F as h,I as g,L as _,M as v,O as y,P as b,R as x,S,T as C,_ as w,c as T,d as E,f as D,g as O,h as ee,j as k,m as A,o as j,p as M,r as N,s as P,t as F,v as I,w as L,x as R}from"./useStatistics-CP8uxvx6.js";import{t as z}from"./chart-column-Dw6ACmXM.js";import{t as B}from"./circle-alert-BWvs6IOn.js";import{t as V}from"./clock-3-r12DkpRj.js";import{n as H,t as te}from"./layers-BYi0v17h.js";import{t as ne}from"./git-pull-request-DIYyPsg5.js";import{t as re}from"./messages-square-DiMgWzoq.js";import{t as U}from"./refresh-cw-DopCMrtR.js";import{t as ie}from"./shield-alert-DY9uVP5G.js";import{t as ae}from"./sparkles-CAf3oJ5S.js";import{t as oe}from"./triangle-alert-RL_T3KLo.js";import{t as se}from"./wrench-D0IetWa1.js";import{t as ce}from"./scroll-area-gtur6NxN.js";import{t as W}from"./button-CXfaxtRp.js";import{t as le}from"./capabilities-j43xmCXg.js";import{o as ue}from"./sidebar-Dft4bIEi.js";import{a as de,i as fe,o as pe,s as me,t as he}from"./select-BB7zCkpA.js";import{t as ge}from"./badge-CNPL77i3.js";var _e=l(`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`}]]),ve=l(`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`}]]),ye=l(`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`}]]),G=n(),K=s();function be(e){let t=(0,G.c)(56),{search:n,onSearchChange:r}=e,{snapshot:i,loading:a,error:s,refresh:c,refreshing:l}=F(),d=n.projectId??null,p=n.model??null,m=n.modelProvider??null,h;t[0]!==n.range||t[1]!==d||t[2]!==p||t[3]!==m?(h={range:n.range,projectId:d,model:p,provider:m},t[0]=n.range,t[1]=d,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=T(i,g),s=E(o);e=o,n=s,r=P(i,o,g.range),a=N(o,j(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 v=_;if(a&&!i){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(ee,{}),t[16]=e):e=t[16],e}if(s&&!i){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(U,{}),t[17]=e):e=t[17];let n;t[18]===c?n=t[19]:(n=(0,K.jsxs)(W,{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,K.jsx)(O,{icon:oe,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||!v)return null;let{totals:b,days:x,projects:S}=v,C=o()?.label??`Current environment`,k;if(t[23]!==x||t[24]!==g||t[25]!==r||t[26]!==S||t[27]!==c||t[28]!==l||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=Se(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,K.jsx)(D,{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=l?`animate-spin`:void 0,d;t[45]===s?d=t[46]:(d=(0,K.jsx)(U,{className:s}),t[45]=s,t[46]=d);let p=l?`Refreshing`:`Refresh`,m;t[47]!==c||t[48]!==l||t[49]!==d||t[50]!==p?(m=(0,K.jsxs)(W,{size:`sm`,variant:`outline`,onClick:c,disabled:l,children:[d,p]}),t[47]=c,t[48]=l,t[49]=d,t[50]=p,t[51]=m):m=t[51];let h;t[52]!==m||t[53]!==o?(h=(0,K.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,K.jsxs)(`p`,{className:`max-w-4xl text-sm leading-relaxed text-muted-foreground`,children:[`Activity includes work observed by Ryco on`,` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:C}),`. Usage from other CLI sessions appears in the Usage tab and is not assigned to projects.`]}),t[55]=_):_=t[55],k=(0,K.jsxs)(`div`,{className:`space-y-8`,children:[h,_,i.dailyBuckets.length===0?(0,K.jsx)(O,{icon:u,title:`No Ryco activity yet`,description:`Project and agent activity will appear here after your first completed turns.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-5`,children:[(0,K.jsx)(A,{label:`Active time`,icon:V,value:f(b.activeMs),sub:`${y(b.totalTokens)} observed tokens`}),(0,K.jsx)(A,{label:`Turns`,icon:u,value:L(b.turns),sub:`Completed agent turns`}),(0,K.jsx)(A,{label:`Chats`,icon:re,value:L(b.threadsCreated),sub:`Conversations started`}),(0,K.jsx)(A,{label:`Tool uses`,icon:se,value:L(b.toolUses),sub:`Observed invocations`}),(0,K.jsx)(A,{label:`Files changed`,icon:H,value:L(b.filesChanged),sub:`+${L(b.additions)} / −${L(b.deletions)} lines`})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1.2fr_0.8fr]`,children:[(0,K.jsxs)(M,{title:`Activity rhythm`,icon:u,bodyClassName:`p-5`,action:(0,K.jsx)(Ce,{search:n,onSearchChange:r}),children:[(0,K.jsx)(R,{points:x,metric:n.activityMetric}),(0,K.jsxs)(`div`,{className:`mt-5 grid grid-cols-3 gap-3 border-t border-border/60 pt-4`,children:[(0,K.jsx)(J,{label:`Active days`,value:L(e.activeDays)}),(0,K.jsx)(J,{label:`Current streak`,value:`${L(e.currentStreak)}d`}),(0,K.jsx)(J,{label:`Busiest UTC day`,value:e.busiestLabel})]})]}),(0,K.jsx)(M,{title:`Projects`,icon:u,bodyClassName:`p-4`,children:(0,K.jsx)(I,{data:S,metric:n.activityMetric})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,K.jsxs)(M,{title:`Code changes`,icon:H,bodyClassName:`p-4`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex gap-6 text-sm`,children:[(0,K.jsx)(J,{label:`Files`,value:L(b.filesChanged)}),(0,K.jsx)(J,{label:`Added`,value:`+${L(b.additions)}`,tone:`positive`}),(0,K.jsx)(J,{label:`Removed`,value:`−${L(b.deletions)}`,tone:`negative`})]}),(0,K.jsx)(w,{data:x})]}),(0,K.jsxs)(M,{title:`Source control · all time`,icon:ne,bodyClassName:`overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 border-b border-border/60 px-4 py-4`,children:[(0,K.jsx)(J,{label:`Active`,value:L(i.worktrees.active)}),(0,K.jsx)(J,{label:`Created`,value:L(i.worktrees.created)}),(0,K.jsx)(J,{label:`Archived`,value:L(i.worktrees.archived)}),(0,K.jsx)(J,{label:`Open PRs`,value:L(i.worktrees.openPrs)})]}),i.recentPullRequests.length===0?(0,K.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,K.jsx)(`div`,{className:`divide-y divide-border/60`,children:i.recentPullRequests.slice(0,6).map(xe)})]})]})]})]}),t[23]=x,t[24]=g,t[25]=r,t[26]=S,t[27]=c,t[28]=l,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]=k}else k=t[36];return k}function xe(e){return(0,K.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,K.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,K.jsx)(ne,{className:`size-4`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.prTitle||e.worktreeTitle||e.branch}),(0,K.jsxs)(`p`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:[e.projectTitle,` · #`,e.prNumber,` ·`,` `,p(e.updatedAt)]})]}),(0,K.jsx)(ge,{variant:e.prState===`merged`?`success`:e.active?`info`:`secondary`,children:e.prIsDraft?`Draft`:e.prState??(e.active?`Open`:`Archived`)})]},e.worktreeId)}function q(e,t){return t===`turns`?e.turns:t===`activeMs`?e.activeMs:e.filesChanged}function Se(e,t){let n=0,r=0,i=null;for(let r of e){let e=q(r,t);e>0&&(n+=1),(i===null||e>q(i,t))&&(i=r)}for(let n=e.length-1;n>=0;--n){let i=e[n];if(i===void 0||q(i,t)<=0)break;r+=1}if(i===null||q(i,t)<=0)return{activeDays:n,currentStreak:r,busiestLabel:`—`};let a=q(i,t),o=t===`activeMs`?f(a):L(a);return{activeDays:n,currentStreak:r,busiestLabel:`${i.date.slice(5)} · ${o}`}}function Ce(e){let t=(0,G.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,K.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,activityMetric:e}),className:c(`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 J(e){let t=(0,G.c)(10),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.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=c(`mt-1 font-semibold tabular-nums`,o),t[2]=o,t[3]=s);let l;t[4]!==s||t[5]!==r?(l=(0,K.jsx)(`p`,{className:s,children:r}),t[4]=s,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==a||t[8]!==l?(u=(0,K.jsxs)(`div`,{children:[a,l]}),t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function we(e){switch(e){case`complete`:return 4;case`partial`:return 3;case`not-found`:return 2;case`failed`:return 1}}function Te(e,t){return we(t.source.status)-we(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 Ee(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 De(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 Oe(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(Te),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=Ee(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:De(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 ke=class{#e=0;next(){return this.#e+=1,this.#e}isCurrent(e){return e===this.#e}},Y=e(t(),1),Ae={"7d":7,"30d":30,"90d":90,all:null};function je(e,t){return new Intl.DateTimeFormat(`en-CA`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(new Date(e))}function Me(e,t,n=Date.now()){let r=je(n,t),i=Ae[e];return i===null?{endDate:r,timeZone:t,contractVersion:1}:{startDate:je(Date.parse(`${r}T12:00:00.000Z`)-(i-1)*864e5,`UTC`),endDate:r,timeZone:t,contractVersion:1}}function Ne(){let e=(0,G.c)(3),[t,n]=(0,Y.useState)(0),r,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>a(()=>n(Pe)),o=[],e[0]=r,e[1]=o):(r=e[0],o=e[1]),(0,Y.useEffect)(r,o);let s;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=i(),e[2]=s):s=e[2],s}function Pe(e){return e+1}function Fe(e){let t=Ne(),n=(0,Y.useMemo)(()=>t.map(e=>({environmentId:e.environmentId,label:e.knownEnvironment.label})).toSorted((e,t)=>e.label.localeCompare(t.label)),[t]),r=(0,Y.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,Y.useState)(0),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)([]),[d,f]=(0,Y.useState)(!0),p=(0,Y.useRef)(new ke),m=r.map(e=>e.environmentId).toSorted().join(`\0`);(0,Y.useEffect)(()=>{let t=p.current.next(),n=Me(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(Oe(e)),f(!1))})},[e.range,a,r,m,i]);let h=(0,Y.useCallback)(()=>o(e=>e+1),[]);return{merged:s,environments:l,availableEnvironments:n,loading:d,refreshing:d&&s!==null,refresh:h}}function Ie(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 Le(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 Re(e,t){return new Date(Date.parse(`${e}T12:00:00.000Z`)+t*864e5).toISOString().slice(0,10)}function ze(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=Re(t,1))i.push(n.get(t)??{date:t,claudeCost:0,codexCost:0,claudeTokens:0,codexTokens:0});return i}function Be(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 Ve=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),X={claude:`#d97757`,codex:`var(--foreground)`};function Z(e){return e===null?`Unavailable`:Ve.format(e)}function He(e){let t=(0,G.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=Fe(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=Ie(o,n.providers);e=s,r=Le(o,s),i=ze(o,s),a=Be(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,K.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=O,n=o.length>0?B:ye,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,K.jsx)(U,{}),t[21]=o):o=t[21];let s;t[22]===a.refresh?s=t[23]:(s=(0,K.jsxs)(W,{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,K.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,p=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,v;t[32]!==r||t[33]!==n?(v=(0,K.jsx)(qe,{search:n,onSearchChange:r}),t[32]=r,t[33]=n,t[34]=v):v=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 x;t[38]!==a.availableEnvironments||t[39]!==h?(x=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]=x):x=t[40];let w;t[41]===x?w=t[42]:(w=(0,K.jsx)(pe,{size:`sm`,className:`w-48`,"aria-label":`Usage environment`,children:(0,K.jsx)(me,{children:x})}),t[41]=x,t[42]=w);let T;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(fe,{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 D;t[46]===E?D=t[47]:(D=(0,K.jsxs)(de,{alignItemWithTrigger:!1,children:[T,E]}),t[46]=E,t[47]=D);let k;t[48]!==h||t[49]!==D||t[50]!==b||t[51]!==w?(k=(0,K.jsxs)(he,{value:h,onValueChange:b,children:[w,D]}),t[48]=h,t[49]=D,t[50]=b,t[51]=w,t[52]=k):k=t[52];let A;t[53]!==r||t[54]!==n?(A=(0,K.jsx)(Je,{search:n,onSearchChange:r}),t[53]=r,t[54]=n,t[55]=A):A=t[55];let j;t[56]!==k||t[57]!==A||t[58]!==v?(j=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[v,k,A]}),t[56]=k,t[57]=A,t[58]=v,t[59]=j):j=t[59];let N=a.refreshing?`animate-spin`:void 0,P;t[60]===N?P=t[61]:(P=(0,K.jsx)(U,{className:N}),t[60]=N,t[61]=P);let F=a.refreshing?`Refreshing`:`Refresh`,I;t[62]!==a.refresh||t[63]!==a.refreshing||t[64]!==P||t[65]!==F?(I=(0,K.jsxs)(W,{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]=I):I=t[66];let R;t[67]!==j||t[68]!==I?(R=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[j,I]}),t[67]=j,t[68]=I,t[69]=R):R=t[69];let z;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,K.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]=z):z=t[70];let V;t[71]!==d||t[72]!==p||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,K.jsx)(O,{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,K.jsxs)(K.Fragment,{children:[(0,K.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,K.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,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:[(0,K.jsx)(ve,{className:`size-3.5`}),` Raw API-equivalent cost`]}),(0,K.jsx)(`div`,{className:`mt-5 text-4xl font-semibold tracking-[-0.045em] tabular-nums sm:text-5xl`,children:Z(l.estimatedCostUsd)}),(0,K.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,K.jsxs)(`div`,{className:`space-y-4 border-t border-border/65 pt-5`,children:[(0,K.jsx)(et,{label:`Priced coverage`,value:`${Math.round(f*100)}% of tokens`}),(0,K.jsx)(et,{label:`Estimated cache savings`,value:Z(l.estimatedCacheSavingsUsd)}),(0,K.jsx)(et,{label:`Provider-recorded tokens`,value:L(l.totalTokens)})]})]}),(0,K.jsxs)(`div`,{className:`min-w-0 p-4 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3 px-1`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Usage over time`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Daily values in `,o.timeZone]})]}),(0,K.jsx)(Ye,{search:n,onSearchChange:r})]}),(0,K.jsx)(Ze,{data:u,metric:n.usageMetric}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-4 px-2 text-[11px] text-muted-foreground`,children:[(0,K.jsx)(tt,{color:X.claude,label:`Claude`}),(0,K.jsx)(tt,{color:X.codex,label:`Codex`})]})]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 border-y border-border/65 md:grid-cols-5`,children:[(0,K.jsx)(Q,{label:`Total tokens`,value:y(l.totalTokens)}),(0,K.jsx)(Q,{label:`Sessions`,value:L(l.distinctSessionCount)}),(0,K.jsx)(Q,{label:`Responses`,value:L(l.responseCount)}),(0,K.jsx)(Q,{label:`Cache read`,value:`${Math.round(p*100)}%`}),(0,K.jsx)(Q,{label:`Reasoning`,value:y(l.reasoningTokens),detail:`included in output`})]}),(0,K.jsx)(M,{title:`Breakdown`,icon:te,action:(0,K.jsx)(Xe,{search:n,onSearchChange:r}),bodyClassName:`overflow-hidden`,children:(0,K.jsx)(`div`,{className:`divide-y divide-border/60`,children:d.slice(0,20).map(e=>(0,K.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,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:n.usageBreakdown===`model`?C(e.label):S(e.label)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e.provider?m(e.provider):`${e.responses} responses`})]}),(0,K.jsxs)(`div`,{className:`text-right`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:y(e.tokens)}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`tokens`})]}),(0,K.jsxs)(`div`,{className:`w-24 text-right`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:Z(e.costUsd)}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.unpricedTokens>0?`${y(e.unpricedTokens)} unpriced`:`estimated`})]})]},e.key))})}),(0,K.jsx)(nt,{summary:o})]}),t[71]=d,t[72]=p,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,K.jsxs)(`div`,{className:`space-y-8`,children:[R,z,V]}),t[87]=R,t[88]=V,t[89]=H):H=t[89],H}function Ue(e){return(0,K.jsx)(fe,{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,G.c)(3),{search:n,onSearchChange:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,K.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,range:e}),className:c(`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,G.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,K.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`claude`,`codex`].map(t=>(0,K.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:c(`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,K.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block size-1.5 rounded-full`,style:{backgroundColor:X[t]}}),t]},t))}),t[0]=r,t[1]=n,t[2]=i}else i=t[2];return i}function Ye(e){let t=(0,G.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,K.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageMetric:e}),className:c(`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,G.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,K.jsx)(`div`,{className:`inline-flex items-center gap-1 text-[11px]`,children:i.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageBreakdown:e}),className:c(`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,G.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,K.jsxs)(`linearGradient`,{id:`usageClaude`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,K.jsx)(`stop`,{offset:`5%`,stopColor:X.claude,stopOpacity:.3}),(0,K.jsx)(`stop`,{offset:`95%`,stopColor:X.claude,stopOpacity:.02})]}),t[3]=s):s=t[3];let c,l,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsxs)(`defs`,{children:[s,(0,K.jsxs)(`linearGradient`,{id:`usageCodex`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,K.jsx)(`stop`,{offset:`5%`,stopColor:X.codex,stopOpacity:.18}),(0,K.jsx)(`stop`,{offset:`95%`,stopColor:X.codex,stopOpacity:.01})]})]}),l=(0,K.jsx)(x,{vertical:!1,strokeDasharray:`3 5`}),u=(0,K.jsx)(g,{dataKey:`date`,tickLine:!1,axisLine:!1,minTickGap:30,tickFormatter:$e}),t[4]=c,t[5]=l,t[6]=u):(c=t[4],l=t[5],u=t[6]);let f;t[7]===r?f=t[8]:(f=(0,K.jsx)(h,{tickLine:!1,axisLine:!1,width:44,tickFormatter:e=>r===`cost`?`$${Number(e).toFixed(+(Number(e)<10))}`:y(Number(e))}),t[7]=r,t[8]=f);let p;t[9]===r?p=t[10]:(p=(0,K.jsx)(k,{content:(0,K.jsx)(v,{labelFormatter:Qe,formatter:e=>r===`cost`?Ve.format(Number(e)||0):L(Number(e)||0)})}),t[9]=r,t[10]=p);let m=`claude${i}`,S;t[11]===m?S=t[12]:(S=(0,K.jsx)(_,{dataKey:m,name:`Claude`,type:`monotone`,stroke:X.claude,fill:`url(#usageClaude)`,strokeWidth:1.75}),t[11]=m,t[12]=S);let C=`codex${i}`,w;t[13]===C?w=t[14]:(w=(0,K.jsx)(_,{dataKey:C,name:`Codex`,type:`monotone`,stroke:X.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,K.jsx)(d,{className:`h-[300px]`,children:(0,K.jsxs)(b,{data:a,margin:o,children:[c,l,u,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 S(String(e))}function $e(e){return S(String(e))}function et(e){let t=(0,G.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,K.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,K.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,G.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.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,K.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,K.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,K.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,G.c)(5),{color:n,label:r}=e,i;t[0]===n?i=t[1]:(i=(0,K.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,K.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,G.c)(43),{summary:n}=e,r,i,a,o,s,c,l,u,d,f,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=M,_=`Coverage & estimates`,o=_e,s=`p-5`,c=y.length>0?(0,K.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,K.jsx)(B,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,K.jsxs)(`span`,{children:[`No usage was included from`,` `,y.map(at).join(`, `),`.`]})]}):null,f=`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,K.jsx)($,{icon:ye,label:`Transcript sources`,value:w,detail:T}),t[18]=w,t[19]=T,t[20]=m):m=t[20],h=(0,K.jsx)($,{icon:ae,label:`Last scan`,value:C?p(C):`Not scanned`,detail:`${e.reduce(it,0)} cached files reused`});let E=S?`Rates fetched ${p(S)}`:`Token totals remain available without rates`;t[21]!==x||t[22]!==E?(g=(0,K.jsx)($,{icon:ve,label:`Pricing`,value:x,detail:E}),t[21]=x,t[22]=E,t[23]=g):g=t[23],r=$,a=B,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]=f,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],f=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,K.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]!==f||t[32]!==m||t[33]!==h||t[34]!==g?(y=(0,K.jsxs)(`div`,{className:f,children:[m,h,g,v]}),t[30]=v,t[31]=f,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,K.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,G.c)(15),{icon:n,label:r,value:i,detail:a}=e,o;t[0]===n?o=t[1]:(o=(0,K.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,K.jsx)(n,{className:`size-4`})}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,K.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,K.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,K.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,K.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,K.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,G.c)(25),{search:n,onSearchChange:i}=e,a=n.view===`usage`?r.serverGetUsageSummary:r.serverGetStatistics,o=le(a),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h1`,{className:`truncate text-sm font-semibold tracking-tight`,children:`Statistics`}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Usage and work signals`})]}),t[0]=s):s=t[0];let l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=[`usage`,`activity`],t[1]=l):l=t[1];let d;t[2]!==i||t[3]!==n?(d=(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-5`,children:[s,(0,K.jsx)(`div`,{className:`inline-flex rounded-lg bg-muted/75 p-0.5`,children:l.map(e=>{let t=e===`usage`?z:u;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i({...n,view:e}),className:c(`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,K.jsx)(t,{className:`size-3.5`}),` `,e]},e)})})]}),t[2]=i,t[3]=n,t[4]=d):d=t[4];let f;t[5]===n.range?f=t[6]:(f=n.range===`all`?`All available history`:`Last ${n.range.slice(0,-1)} days`,t[5]=n.range,t[6]=f);let p;t[7]===f?p=t[8]:(p=(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:f}),t[7]=f,t[8]=p);let m=n.view===`usage`?`Local calendar window`:`UTC activity window`,h;t[9]===m?h=t[10]:(h=(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:m}),t[9]=m,t[10]=h);let g;t[11]!==p||t[12]!==h?(g=(0,K.jsxs)(`div`,{className:`hidden text-right sm:block`,children:[p,h]}),t[11]=p,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==d||t[15]!==g?(_=(0,K.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:[d,g]}),t[14]=d,t[15]=g,t[16]=_):_=t[16];let v;t[17]!==o.allowed||t[18]!==o.reason||t[19]!==i||t[20]!==n?(v=(0,K.jsx)(ce,{className:`min-h-0 flex-1`,children:(0,K.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,K.jsx)(He,{search:n,onSearchChange:i}):(0,K.jsx)(be,{search:n,onSearchChange:i}):(0,K.jsx)(O,{icon:ie,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]=v):v=t[21];let y;return t[22]!==v||t[23]!==_?(y=(0,K.jsx)(ue,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[_,v]})}),t[22]=v,t[23]=_,t[24]=y):y=t[24],y}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{f as r}from"./utils-c6dglOTK.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-B2NNfOqV.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-BT6cGe5S.js";import{n as _}from"./settingsLayout-B8os-EWr.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{f as r}from"./utils-BPUctpTG.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-CP8uxvx6.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-CXfaxtRp.js";import{n as _}from"./settingsLayout-CS7P71tz.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};
|
package/dist/client/assets/{StatisticsSettingsLink-Bb86VtRL.js → StatisticsSettingsLink-DZwvRI-Y.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{f as t}from"./utils-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{f as t}from"./utils-BPUctpTG.js";import{t as n}from"./useNavigate-2tVq4iZ2.js";import{t as r}from"./settingsDialogStore-DM98Sea0.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-CXfaxtRp.js";import{n as s}from"./settingsLayout-CS7P71tz.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};
|
package/dist/client/assets/{ThreadStatusIndicators-wgiSGtn6.js → ThreadStatusIndicators-B43wkv-s.js}
RENAMED
|
Binary file
|
package/dist/client/assets/{ThreadTerminalDrawer-Dju6roQA.js → ThreadTerminalDrawer-BYQ6EMgr.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./react-SIfiwpqq.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import{Ct as i,Sn as a,St as o,hn as s}from"./runtime-BkRtSwRY.js";import{gt as c}from"./composerDraftStore-_Xy-iY4b.js";import{f as l}from"./utils-c6dglOTK.js";import{i as u,n as d,o as f,r as p}from"./perfInstrumentation-BT27w4tn.js";import{f as m}from"./useRenderElement-DchFnsR8.js";import{t as h}from"./plus-B2h-VEqh.js";import{a as ee,c as g,i as te,n as ne,r as re,s as ie,t as ae}from"./terminal-links-DERnXf-G.js";import{t as oe}from"./trash-2-CM1zXPGb.js";import{t as se}from"./x-C1Cemsov.js";import{b as _,c as ce,d as v,f as le,i as ue,l as de,u as fe,x as pe}from"./keybindings-n2U57Td0.js";import{t as y}from"./usePresentationTier-B_SCFvN7.js";import"./types-BLHJVLCP.js";import{n as b,r as me,t as he}from"./popover-j6ZF-s94.js";import{n as ge}from"./editorPreferences-C79SevBP.js";import{t as _e}from"./appearancePreferences-COvj0WMT.js";import{t as x}from"./useLongPress-OGlhYKlH.js";var ve=m(`square-split-horizontal`,[[`path`,{d:`M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3`,key:`lubmu8`}],[`path`,{d:`M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3`,key:`1ag34g`}],[`line`,{x1:`12`,x2:`12`,y1:`4`,y2:`20`,key:`1tx1rr`}]]),ye=r(),be=2,xe=1,Se=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(be,Math.floor(u/e.css.cell.width)),rows:Math.max(xe,Math.floor(l/e.css.cell.height))}}},Ce=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Te=(e,t)=>{for(var n in t)Ce(e,n,{get:t[n],enumerable:!0})},S=(e,t,n,r)=>{for(var i=r>1?void 0:r?we(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Ce(t,n,i),i},C=(e,t)=>(n,r)=>t(n,r,e),w=`Terminal input`,Ee={get:()=>w,set:e=>w=e},De=`Too much output to announce, navigate to rows manually to read`,T={get:()=>De,set:e=>De=e};function Oe(e){return e.replace(/\r?\n/g,`\r`)}function E(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function ke(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function D(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ae(e.clipboardData.getData(`text/plain`),t,n,r)}function Ae(e,t,n,r){e=Oe(e),e=E(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function je(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Me(e,t,n,r,i){je(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Ne(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Pe(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Fe=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},Ie=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Le=``,Re=` `,ze=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Be}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Be=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ve=class e extends ze{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Be,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ne(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},He=`di$target`,Ue=`di$dependencies`,We=new Map;function Ge(e){return e[Ue]||[]}function O(e){if(We.has(e))return We.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Ke(t,e,r)};return t._id=e,We.set(e,t),t}function Ke(e,t,n){t[He]===t?t[Ue].push({id:e,index:n}):(t[Ue]=[{id:e,index:n}],t[He]=t)}var k=O(`BufferService`),qe=O(`CoreMouseService`),Je=O(`CoreService`),Ye=O(`CharsetService`),Xe=O(`InstantiationService`),Ze=O(`LogService`),A=O(`OptionsService`),Qe=O(`OscLinkService`),$e=O(`UnicodeService`),et=O(`DecorationService`),tt=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new Ve,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):nt(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};tt=S([C(0,k),C(1,A),C(2,Qe)],tt);function nt(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1
|
+
import{i as e,r as t,t as n}from"./react-SIfiwpqq.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import{Ct as i,Sn as a,St as o,hn as s}from"./runtime-CqhG6EOG.js";import{gt as c}from"./composerDraftStore-BaAeiPHc.js";import{f as l}from"./utils-BPUctpTG.js";import{i as u,n as d,o as f,r as p}from"./perfInstrumentation-BT27w4tn.js";import{f as m}from"./useRenderElement-DchFnsR8.js";import{t as h}from"./plus-B2h-VEqh.js";import{a as ee,c as g,i as te,n as ne,r as re,s as ie,t as ae}from"./terminal-links-BaX-ICJT.js";import{t as oe}from"./trash-2-CM1zXPGb.js";import{t as se}from"./x-C1Cemsov.js";import{b as _,c as ce,d as v,f as le,i as ue,l as de,u as fe,x as pe}from"./keybindings-BCns_TPr.js";import{t as y}from"./usePresentationTier-B_SCFvN7.js";import"./types-CP3vrsGY.js";import{n as b,r as me,t as he}from"./popover-C9y_0-ZN.js";import{n as ge}from"./editorPreferences-C3i2Nkh2.js";import{t as _e}from"./appearancePreferences-COvj0WMT.js";import{t as x}from"./useLongPress-OGlhYKlH.js";var ve=m(`square-split-horizontal`,[[`path`,{d:`M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3`,key:`lubmu8`}],[`path`,{d:`M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3`,key:`1ag34g`}],[`line`,{x1:`12`,x2:`12`,y1:`4`,y2:`20`,key:`1tx1rr`}]]),ye=r(),be=2,xe=1,Se=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(be,Math.floor(u/e.css.cell.width)),rows:Math.max(xe,Math.floor(l/e.css.cell.height))}}},Ce=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Te=(e,t)=>{for(var n in t)Ce(e,n,{get:t[n],enumerable:!0})},S=(e,t,n,r)=>{for(var i=r>1?void 0:r?we(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Ce(t,n,i),i},C=(e,t)=>(n,r)=>t(n,r,e),w=`Terminal input`,Ee={get:()=>w,set:e=>w=e},De=`Too much output to announce, navigate to rows manually to read`,T={get:()=>De,set:e=>De=e};function Oe(e){return e.replace(/\r?\n/g,`\r`)}function E(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function ke(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function D(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ae(e.clipboardData.getData(`text/plain`),t,n,r)}function Ae(e,t,n,r){e=Oe(e),e=E(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function je(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Me(e,t,n,r,i){je(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Ne(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Pe(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Fe=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},Ie=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Le=``,Re=` `,ze=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Be}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Be=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ve=class e extends ze{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Be,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ne(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},He=`di$target`,Ue=`di$dependencies`,We=new Map;function Ge(e){return e[Ue]||[]}function O(e){if(We.has(e))return We.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Ke(t,e,r)};return t._id=e,We.set(e,t),t}function Ke(e,t,n){t[He]===t?t[Ue].push({id:e,index:n}):(t[Ue]=[{id:e,index:n}],t[He]=t)}var k=O(`BufferService`),qe=O(`CoreMouseService`),Je=O(`CoreService`),Ye=O(`CharsetService`),Xe=O(`InstantiationService`),Ze=O(`LogService`),A=O(`OptionsService`),Qe=O(`OscLinkService`),$e=O(`UnicodeService`),et=O(`DecorationService`),tt=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new Ve,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):nt(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};tt=S([C(0,k),C(1,A),C(2,Qe)],tt);function nt(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var rt=O(`CharSizeService`),it=O(`CoreBrowserService`),at=O(`MouseService`),ot=O(`RenderService`),st=O(`SelectionService`),ct=O(`CharacterJoinerService`),lt=O(`ThemeService`),ut=O(`LinkProviderService`),dt=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?_t.isErrorNoTelemetry(e)?new _t(e.message+`
|
|
4
4
|
|
package/dist/client/assets/{ThreadWorkspacePanel-hfIocZRN.js → ThreadWorkspacePanel-DuaQ9DMj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,t as a,y as o}from"./env-CBdFekj3.js";import{ii as s}from"./src-b7-hpIff.js";import{$t as c,Et as l,In as u,Jn as d,Jt as f,Ot as p,Pt as m,Qt as h,Rn as g,Sn as _,St as v,Un as y,Zt as b,en as x,f as S,hn as C,mn as w,nn as T,tn as E,wt as D}from"./runtime-BkRtSwRY.js";import{Tt as O,_t as k,ht as A}from"./primary-0ymoUGkq.js";import{t as j}from"./useDebouncedValue-DU7gLY9w.js";import{P as ee,_t as M,i as te,vt as N}from"./composerDraftStore-_Xy-iY4b.js";import{f as P,l as ne,t as F}from"./utils-c6dglOTK.js";import{c as re,d as ie,l as ae}from"./useSwipeDismiss-B8Fo31QE.js";import{t as oe}from"./useRouter-CcIDS3PN.js";import{_ as se,a as I,c as ce,d as le,f as ue,g as de,i as fe,l as pe,m as L,o as R,p as me,r as z,s as he,t as ge,u as _e}from"./rightPanelRouteSearch-DkhE1otz.js";import{t as ve}from"./useNavigate-2tVq4iZ2.js";import{f as B}from"./useRenderElement-DchFnsR8.js";import{t as ye}from"./arrow-left-Dtj9PfsA.js";import{t as be}from"./bot-DJp0cuhK.js";import{n as xe,t as V}from"./loader-circle-CrtHFAvM.js";import{t as Se}from"./chevron-down-B7C6FKzM.js";import{c as Ce,o as we}from"./tabSwitchInstrumentation-CLDM7g1_.js";import{t as Te}from"./chevron-right-BWYGybX9.js";import{n as Ee}from"./useFloatingRootContext-CSPbIu1q.js";import{t as De}from"./circle-alert-BWvs6IOn.js";import{i as H}from"./toast-DonYDy-6.js";import{t as U}from"./clock-3-r12DkpRj.js";import{C as Oe}from"./lib-DoLGGVrW.js";import{t as ke}from"./folder-closed-CsvKfC6X.js";import{t as W}from"./folder-open-GqwNTbSV.js";import{t as G}from"./folder-DtsQoI9_.js";import{$ as Ae,$t as je,A as Me,At as Ne,B as Pe,Bt as Fe,Ct as Ie,Dt as Le,Et as Re,F as ze,Ft as K,G as Be,Gt as Ve,H as He,Ht as Ue,I as We,It as Ge,J as Ke,Jt as qe,K as Je,Kt as Ye,L as Xe,Lt as Ze,M as Qe,Mt as $e,N as et,Nt as tt,Ot as nt,P as rt,Pt as it,Q as at,Qt as ot,R as st,Rt as ct,St as lt,Tt as ut,U as dt,Ut as ft,V as pt,Vt as mt,W as ht,Wt as gt,X as _t,Xt as vt,Y as yt,Yt as bt,Z as xt,Zt as St,_t as Ct,at as wt,bt as Tt,c as Et,ct as Dt,d as Ot,dt as kt,en as At,et as jt,ft as Mt,g as Nt,gt as Pt,h as Ft,ht as It,in as Lt,it as Rt,j as zt,jt as Bt,k as Vt,kt as Ht,l as Ut,lt as Wt,m as Gt,mt as Kt,n as qt,nn as Jt,nt as Yt,ot as Xt,p as Zt,pt as Qt,q as $t,qt as en,r as tn,rn as nn,rt as rn,s as an,st as on,t as sn,tn as cn,tt as ln,u as un,ut as dn,vt as fn,wt as pn,xt as q,yt as mn,z as hn,zt as gn}from"./device-CLd1blIe.js";import{t as _n}from"./minimize-2-C33mL7LT.js";import{t as vn}from"./plus-B2h-VEqh.js";import{t as yn}from"./refresh-cw-DopCMrtR.js";import{t as bn}from"./save-Bh36JIv6.js";import{t as xn}from"./search-BGQsenCM.js";import{t as Sn}from"./smartphone-gNe1ynB8.js";import{t as Cn}from"./ThreadTerminalDrawer-Dju6roQA.js";import{i as wn}from"./terminal-links-DERnXf-G.js";import{t as Tn}from"./terminal-C_CyIsDD.js";import{t as En}from"./triangle-alert-RL_T3KLo.js";import{t as Dn}from"./unplug-Cw8iawyX.js";import{t as On}from"./x-C1Cemsov.js";import{_ as kn,a as An,g as jn,m as Mn,n as Nn,t as Pn,v as Fn,y as In}from"./session-logic-B0shVXpN.js";import"./storeSelectors-BLHJVLCP.js";import{o as Ln}from"./timestampFormat-8uPXS812.js";import{_ as Rn}from"./keybindings-n2U57Td0.js";import{i as zn,n as Bn,t as Vn}from"./tooltip-BaJgdXlL.js";import{t as Hn}from"./scroll-area-B-bu3v0j.js";import{t as Un}from"./button-BT6cGe5S.js";import{n as Wn}from"./composerHandleContext-BrQ6d8r9.js";import{i as Gn,r as Kn,t as qn}from"./alert-DFo8_l6D.js";import{n as Jn,t as Yn}from"./sidebarStatusText-DjLAEM1H.js";import{a as Xn,i as Zn,o as Qn,r as $n,s as er,t as tr}from"./alert-dialog-Cmodiuqg.js";import{n as nr}from"./editorPreferences-C79SevBP.js";import{t as rr}from"./badge-BbJiUmhG.js";import{t as ir}from"./useTheme-DiC-5xCb.js";import{n as ar,t as or}from"./toggle-group-0LgplGMc.js";import{t as sr}from"./toggle-BIs83JSj.js";var J=e(t(),1);function cr(e,t){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if(`shouldBlockFn`in e)return e;if(typeof e==`function`){let n=!!(t??!0);return{shouldBlockFn:async()=>n?await e():!1,enableBeforeUnload:n,withResolver:!1}}let n=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function lr(e,t){let{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:a=!1}=cr(e,t),o=oe(),{history:s}=o,[c,l]=J.useState({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return J.useEffect(()=>i?void 0:s.block({blockerFn:async e=>{function t(e){let t=o.parseLocation(e),[,n,r]=o.getMatchedRoutes(t.pathname);return r===void 0?{routeId:`__notFound__`,fullPath:t.pathname,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}:{routeId:r.id,fullPath:r.fullPath,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}}let r=t(e.currentLocation),i=t(e.nextLocation);if(r.routeId===`__notFound__`&&i.routeId!==`__notFound__`)return!1;let s=await n({action:e.action,current:r,next:i});if(!a)return s;if(!s)return!1;let c=await new Promise(t=>{l({status:`blocked`,current:r,next:i,action:e.action,proceed:()=>t(!1),reset:()=>t(!0)})});return l({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),c},enableBeforeUnload:r}),[n,r,i,a,s,o]),c}var ur=B(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),dr=B(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),fr=B(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),pr=B(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),mr=B(`disc-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]),hr=B(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),gr=B(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),_r=B(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),vr=B(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),yr=B(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),br=B(`monitor-off`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826`,key:`cv7jms`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042`,key:`z8ni2w`}]]),xr=B(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Sr=B(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Cr=B(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),wr=B(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Tr=B(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Er=B(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),Dr=B(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),Or=B(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Y=n(),X=P(),kr={pending:{dotClass:`bg-info`,label:`Working`},running:{dotClass:`bg-info`,label:`Working`},waiting:{dotClass:`bg-info`,label:`Working`},idle:{dotClass:`bg-muted-foreground/50`,label:`Idle · resumable`},completed:{dotClass:`bg-success`,label:`Completed`},failed:{dotClass:`bg-destructive`,label:`Failed`},cancelled:{dotClass:`bg-muted-foreground/60`,label:`Stopped`},interrupted:{dotClass:`bg-muted-foreground/60`,label:`Stopped`}},Ar=(0,J.createContext)({identities:new Map,onOpenAgent:null});function jr(e){let t=(0,Y.c)(4),{status:n}=e,r=kr[n],i;t[0]===r.dotClass?i=t[1]:(i=F(`size-1.5 shrink-0 rounded-full`,r.dotClass),t[0]=r.dotClass,t[1]=i);let a;return t[2]===i?a=t[3]:(a=(0,X.jsx)(`span`,{"aria-hidden":!0,className:i}),t[2]=i,t[3]=a),a}function Mr(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/60);if(n===0)return`${t}s`;let r=Math.floor(n/60);return r===0?`${n}m ${String(t%60).padStart(2,`0`)}s`:`${r}h ${String(n%60).padStart(2,`0`)}m`}function Nr(e,t){let n=Date.parse(e),r=t?Date.parse(t):Date.now();return Number.isNaN(n)||Number.isNaN(r)?``:Mr((r-n)/1e3)}function Pr(e){return e.usage?.durationMs===void 0?e.startedAt&&e.completedAt?Nr(e.startedAt,e.completedAt):null:Mr(e.usage.durationMs/1e3)}function Fr(e){let t=(0,Y.c)(12),{agent:n}=e,r=(0,J.useRef)(null),i=n.status===`running`||n.status===`waiting`,a=n.startedAt,o,s;if(t[0]!==i||t[1]!==a?(o=()=>{if(!i||!a)return;let e=()=>{r.current&&(r.current.textContent=Nr(a,null))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},s=[i,a],t[0]=i,t[1]=a,t[2]=o,t[3]=s):(o=t[2],s=t[3]),(0,J.useEffect)(o,s),!i){let e;t[4]===n?e=t[5]:(e=Pr(n),t[4]=n,t[5]=e);let r=e,i;return t[6]===r?i=t[7]:(i=r?(0,X.jsx)(`span`,{className:`tabular-nums`,children:r}):null,t[6]=r,t[7]=i),i}if(!a)return null;let c;t[8]===a?c=t[9]:(c=Nr(a,null),t[8]=a,t[9]=c);let l;return t[10]===c?l=t[11]:(l=(0,X.jsx)(`span`,{ref:r,className:`tabular-nums`,children:c}),t[10]=c,t[11]=l),l}function Ir(e,t){return/^structured[\s_-]?output$/i.test(e)?t?`Delivering result`:`Delivered result`:t?`Using ${e}`:e}function Lr(e){return e.status===`running`||e.status===`pending`||e.status===`waiting`?e.progress??(e.lastToolName?Ir(e.lastToolName,!0):null)??e.result??e.error:e.error??e.result??e.progress??(e.lastToolName?Ir(e.lastToolName,!1):null)}function Rr(e){let t=(0,Y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`divide-y divide-border/30`,children:n}),t[0]=n,t[1]=r),r}function zr(e){let t=(0,Y.c)(11),{title:n}=e,r=`${n} pending`,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex size-7 items-center justify-center rounded-lg border border-dashed border-border/60 bg-background/30 text-muted-foreground/55`,children:(0,X.jsx)(U,{className:`size-3.5`})}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,X.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground/75`,children:n}),t[1]=n,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground/65`,children:`Waiting for this stage to start`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,X.jsxs)(`span`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-[.68rem] text-muted-foreground/65`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-muted-foreground/40`}),`Pending`]}),t[6]=c):c=t[6];let l;return t[7]!==r||t[8]!==s||t[9]!==n?(l=(0,X.jsxs)(`div`,{"data-workflow-pending-step":!0,"data-phase-title":n,"aria-label":r,className:`grid h-14 grid-cols-[1.75rem_minmax(0,1fr)_auto] items-center gap-x-2 rounded-md px-1.5 py-1 text-left`,children:[i,s,c]}),t[7]=r,t[8]=s,t[9]=n,t[10]=l):l=t[10],l}function Br(e){let t=(0,Y.c)(69),{agent:n}=e,{identities:r,onOpenAgent:i}=(0,J.use)(Ar),a=kr[n.status],o;t[0]===n?o=t[1]:(o=Lr(n),t[0]=n,t[1]=o);let s=o,c;t[2]!==n.effort||t[3]!==n.model?(c=jn(n.model,n.effort),t[2]=n.effort,t[3]=n.model,t[4]=c):c=t[4];let l=c,u,d,f;t[5]!==n.id||t[6]!==n.title||t[7]!==r?(d=r.get(n.id),u=d?.codename??n.title,f=d?.role&&!In(d.role,u)&&!In(d.role,n.title)?d.role:null,t[5]=n.id,t[6]=n.title,t[7]=r,t[8]=u,t[9]=d,t[10]=f):(u=t[8],d=t[9],f=t[10]);let p=f,m=d?.taskLabel??n.title,h;t[11]===n.usage?h=t[12]:(h=n.usage?`${kn(n.usage.totalTokens)} tok`:`— tok`,t[11]=n.usage,t[12]=h);let g=n.usage?.toolUses===void 0?null:`${n.usage.toolUses} tools`,_=n.activationCount>1?`run ${n.activationCount}`:null,v;t[13]!==l||t[14]!==h||t[15]!==g||t[16]!==_?(v=[l,h,g,_].filter(Vr),t[13]=l,t[14]=h,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y=v,b=d?.avatarKey??n.id,x;t[18]===b?x=t[19]:(x=(0,X.jsx)(At,{name:b,className:`size-5`}),t[18]=b,t[19]=x);let S;t[20]===n.status?S=t[21]:(S=(0,X.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 grid size-2.5 place-items-center rounded-full bg-background ring-1 ring-background`,children:(0,X.jsx)(jr,{status:n.status})}),t[20]=n.status,t[21]=S);let C;t[22]!==S||t[23]!==x?(C=(0,X.jsxs)(`span`,{"aria-hidden":!0,className:`relative col-start-1 row-span-3 row-start-1 mt-0.5 flex size-7 items-center justify-center rounded-lg border border-border/45 bg-background/45`,children:[x,S]}),t[22]=S,t[23]=x,t[24]=C):C=t[24];let w;t[25]===u?w=t[26]:(w=(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold tracking-[-0.01em]`,children:u}),t[25]=u,t[26]=w);let T;t[27]===p?T=t[28]:(T=p?(0,X.jsx)(`span`,{className:`max-w-32 shrink-0 truncate rounded-sm border border-border/60 bg-background/40 px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:p}):null,t[27]=p,t[28]=T);let E;t[29]!==w||t[30]!==T?(E=(0,X.jsxs)(`span`,{className:`col-start-2 row-start-1 flex min-w-0 items-center gap-1.5`,children:[w,T]}),t[29]=w,t[30]=T,t[31]=E):E=t[31];let D;t[32]===n?D=t[33]:(D=(0,X.jsx)(Fr,{agent:n}),t[32]=n,t[33]=D);let O;t[34]===n.status?O=t[35]:(O=n.status===`completed`?(0,X.jsx)(xe,{"aria-hidden":!0,className:`size-3 text-success`}):null,t[34]=n.status,t[35]=O);let k;t[36]!==D||t[37]!==O?(k=(0,X.jsx)(`span`,{className:`col-start-3 row-start-1 min-w-14 text-right font-mono text-[.7rem] text-muted-foreground/80`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[D,O]})}),t[36]=D,t[37]=O,t[38]=k):k=t[38];let A;t[39]===m?A=t[40]:(A=(0,X.jsx)(`span`,{className:`col-start-2 col-end-4 row-start-2 block truncate text-[11px] text-foreground/65`,title:m,children:m}),t[39]=m,t[40]=A);let j=n.status===`failed`?`text-destructive-foreground`:`text-muted-foreground`,ee;t[41]===j?ee=t[42]:(ee=F(`col-start-2 row-start-3 block min-w-0 truncate text-xs`,j),t[41]=j,t[42]=ee);let M=s??a.label,te=s??a.label,N;t[43]!==ee||t[44]!==M||t[45]!==te?(N=(0,X.jsx)(`span`,{className:ee,title:M,children:te}),t[43]=ee,t[44]=M,t[45]=te,t[46]=N):N=t[46];let P=y.join(` · `),ne;t[47]===P?ne=t[48]:(ne=(0,X.jsx)(`span`,{className:`col-start-3 row-start-3 max-w-40 truncate text-right font-mono text-[.68rem] tabular-nums text-muted-foreground/65`,children:P}),t[47]=P,t[48]=ne);let re;t[49]===a.label?re=t[50]:(re=(0,X.jsx)(`span`,{className:`sr-only`,children:a.label}),t[49]=a.label,t[50]=re);let ie;t[51]!==C||t[52]!==E||t[53]!==k||t[54]!==A||t[55]!==N||t[56]!==ne||t[57]!==re?(ie=(0,X.jsxs)(X.Fragment,{children:[C,E,k,A,N,ne,re]}),t[51]=C,t[52]=E,t[53]=k,t[54]=A,t[55]=N,t[56]=ne,t[57]=re,t[58]=ie):ie=t[58];let ae=ie,oe=i&&`hover:bg-accent/35 focus-visible:ring-2 focus-visible:ring-ring/50`,se;t[59]===oe?se=t[60]:(se=F(`grid h-[4.5rem] w-full grid-cols-[1.75rem_minmax(0,1fr)_auto] grid-rows-[1.375rem_1.125rem_1rem] items-center gap-x-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors`,oe),t[59]=oe,t[60]=se);let I=se,ce;return t[61]!==n.id||t[62]!==I||t[63]!==u||t[64]!==ae||t[65]!==i||t[66]!==p||t[67]!==a.label?(ce=i?(0,X.jsx)(`button`,{type:`button`,className:I,"data-agent-row":!0,"data-agent-id":n.id,onClick:()=>i(n.id),"aria-label":`Open ${u}${p?`, ${p}`:``} transcript. ${a.label}.`,children:ae}):(0,X.jsx)(`div`,{className:I,"data-agent-row":!0,"data-agent-id":n.id,children:ae}),t[61]=n.id,t[62]=I,t[63]=u,t[64]=ae,t[65]=i,t[66]=p,t[67]=a.label,t[68]=ce):ce=t[68],ce}function Vr(e){return e!==null}function Hr(e){let t=e.workflow.status;return t!==`completed`&&t!==`failed`&&t!==`cancelled`&&t!==`interrupted`}function Ur(e){return[...e.phases.flatMap(e=>e.members),...e.unphasedMembers]}function Wr(e){let t=(0,Y.c)(4),{group:n}=e;if(n.phases.length===0)return null;let r;t[0]===n.phases?r=t[1]:(r=n.phases.map(Gr),t[0]=n.phases,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-1.5 pb-1 pt-1.5`,children:r}),t[2]=r,t[3]=i),i}function Gr(e,t){return(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0?(0,X.jsx)(Te,{"aria-hidden":!0,className:`size-3 text-muted-foreground/40`}):null,(0,X.jsxs)(`div`,{className:F(`flex items-center gap-1 rounded-sm border px-1.5 py-0.5`,e.state===`running`?`border-info/40`:e.state===`done`?`border-success/30`:`border-border/50`),children:[(0,X.jsxs)(`span`,{className:F(`font-mono text-[.65rem]`,e.state===`running`?`text-info-foreground`:e.state===`done`?`text-success-foreground`:`text-muted-foreground/70`),children:[e.state===`done`?`✓ `:``,e.title]}),(0,X.jsx)(`span`,{className:`flex items-center gap-0.5`,children:e.members.length===0?(0,X.jsx)(`span`,{className:`font-mono text-[.6rem] text-muted-foreground/50`,children:`–`}):e.members.map(Kr)})]})]},e.index)}function Kr(e){return(0,X.jsx)(jr,{status:e.status},e.id)}var qr=15e3;function Jr(e){let t=(0,Y.c)(28),{environmentId:n,threadId:r,scriptPath:i,onClose:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={state:`loading`},t[0]=o):o=t[0];let[s,c]=(0,J.useState)(o),[l,u]=(0,J.useState)(0),d;t[1]!==n||t[2]!==i||t[3]!==r?(d=()=>{let e=!1,t;c({state:`loading`});let a=C(n)?.orchestration.getWorkflowScript;if(!a){c({state:`failed`});return}let o=new Promise((e,n)=>{t=setTimeout(()=>n(Error(`workflow script fetch timed out`)),qr)});return Promise.race([a({threadId:r,scriptPath:i}),o]).then(t=>{e||c({state:`loaded`,contents:t.contents,truncated:t.truncated})}).catch(()=>{e||c({state:`failed`})}).finally(()=>{t!==void 0&&clearTimeout(t)}),()=>{e=!0,t!==void 0&&clearTimeout(t)}},t[1]=n,t[2]=i,t[3]=r,t[4]=d):d=t[4];let f;t[5]!==l||t[6]!==n||t[7]!==i||t[8]!==r?(f=[n,r,i,l],t[5]=l,t[6]=n,t[7]=i,t[8]=r,t[9]=f):f=t[9],(0,J.useEffect)(d,f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(ur,{"aria-hidden":!0,className:`size-3 text-muted-foreground`}),t[10]=p):p=t[10];let m;t[11]===i?m=t[12]:(m=i.split(`/`).at(-1),t[11]=i,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,X.jsx)(`span`,{className:`truncate font-mono text-[.65rem] text-muted-foreground`,children:m}),t[13]=m,t[14]=h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(On,{"aria-hidden":!0,className:`size-3`}),t[15]=g):g=t[15];let _;t[16]===a?_=t[17]:(_=(0,X.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Close script`,className:`ml-auto text-muted-foreground hover:text-foreground`,children:g}),t[16]=a,t[17]=_);let v;t[18]!==h||t[19]!==_?(v=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/50 px-2 py-1`,children:[p,h,_]}),t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==s.contents||t[22]!==s.state||t[23]!==s.truncated?(y=(0,X.jsx)(`div`,{className:`max-h-72 overflow-auto p-2`,children:s.state===`loaded`?(0,X.jsxs)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[.7rem] leading-relaxed text-foreground/90`,children:[s.contents,s.truncated?`
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,t as a,y as o}from"./env-B4arEvJg.js";import{ii as s}from"./src-Vf4LVnMX.js";import{$t as c,Et as l,In as u,Jn as d,Jt as f,Ot as p,Pt as m,Qt as h,Rn as g,Sn as _,St as v,Un as y,Zt as b,en as x,f as S,hn as C,mn as w,nn as T,tn as E,wt as D}from"./runtime-CqhG6EOG.js";import{Tt as O,_t as k,ht as A}from"./primary-OskAInOO.js";import{t as j}from"./useDebouncedValue-Dl2JtWSe.js";import{P as ee,_t as M,i as te,vt as N}from"./composerDraftStore-BaAeiPHc.js";import{f as P,l as ne,t as F}from"./utils-BPUctpTG.js";import{c as re,d as ie,l as ae}from"./useSwipeDismiss-DESLmDpT.js";import{t as oe}from"./useRouter-CcIDS3PN.js";import{_ as se,a as I,c as ce,d as le,f as ue,g as de,i as fe,l as pe,m as L,o as R,p as me,r as z,s as he,t as ge,u as _e}from"./rightPanelRouteSearch-DE_7uWlN.js";import{t as ve}from"./useNavigate-2tVq4iZ2.js";import{f as B}from"./useRenderElement-DchFnsR8.js";import{t as ye}from"./arrow-left-Dtj9PfsA.js";import{t as be}from"./bot-DJp0cuhK.js";import{n as xe,t as V}from"./loader-circle-CrtHFAvM.js";import{t as Se}from"./chevron-down-B7C6FKzM.js";import{c as Ce,o as we}from"./tabSwitchInstrumentation-CLDM7g1_.js";import{t as Te}from"./chevron-right-BWYGybX9.js";import{n as Ee}from"./useFloatingRootContext-DKAeq7FI.js";import{t as De}from"./circle-alert-BWvs6IOn.js";import{i as H}from"./toast-Bnfw8LOb.js";import{t as U}from"./clock-3-r12DkpRj.js";import{C as Oe}from"./lib-BBbQoz14.js";import{t as ke}from"./folder-closed-CsvKfC6X.js";import{t as W}from"./folder-open-GqwNTbSV.js";import{t as G}from"./folder-DtsQoI9_.js";import{$ as Ae,$t as je,A as Me,At as Ne,B as Pe,Bt as Fe,Ct as Ie,Dt as Le,Et as Re,F as ze,Ft as K,G as Be,Gt as Ve,H as He,Ht as Ue,I as We,It as Ge,J as Ke,Jt as qe,K as Je,Kt as Ye,L as Xe,Lt as Ze,M as Qe,Mt as $e,N as et,Nt as tt,Ot as nt,P as rt,Pt as it,Q as at,Qt as ot,R as st,Rt as ct,St as lt,Tt as ut,U as dt,Ut as ft,V as pt,Vt as mt,W as ht,Wt as gt,X as _t,Xt as vt,Y as yt,Yt as bt,Z as xt,Zt as St,_t as Ct,at as wt,bt as Tt,c as Et,ct as Dt,d as Ot,dt as kt,en as At,et as jt,ft as Mt,g as Nt,gt as Pt,h as Ft,ht as It,in as Lt,it as Rt,j as zt,jt as Bt,k as Vt,kt as Ht,l as Ut,lt as Wt,m as Gt,mt as Kt,n as qt,nn as Jt,nt as Yt,ot as Xt,p as Zt,pt as Qt,q as $t,qt as en,r as tn,rn as nn,rt as rn,s as an,st as on,t as sn,tn as cn,tt as ln,u as un,ut as dn,vt as fn,wt as pn,xt as q,yt as mn,z as hn,zt as gn}from"./device-hx7RX9fI.js";import{t as _n}from"./minimize-2-C33mL7LT.js";import{t as vn}from"./plus-B2h-VEqh.js";import{t as yn}from"./refresh-cw-DopCMrtR.js";import{t as bn}from"./save-Bh36JIv6.js";import{t as xn}from"./search-BGQsenCM.js";import{t as Sn}from"./smartphone-gNe1ynB8.js";import{t as Cn}from"./ThreadTerminalDrawer-BYQ6EMgr.js";import{i as wn}from"./terminal-links-BaX-ICJT.js";import{t as Tn}from"./terminal-C_CyIsDD.js";import{t as En}from"./triangle-alert-RL_T3KLo.js";import{t as Dn}from"./unplug-Cw8iawyX.js";import{t as On}from"./x-C1Cemsov.js";import{_ as kn,a as An,g as jn,m as Mn,n as Nn,t as Pn,v as Fn,y as In}from"./session-logic-DOQPF0oN.js";import"./storeSelectors-CP3vrsGY.js";import{o as Ln}from"./timestampFormat-8uPXS812.js";import{_ as Rn}from"./keybindings-BCns_TPr.js";import{i as zn,n as Bn,t as Vn}from"./tooltip-lYatfjuN.js";import{t as Hn}from"./scroll-area-gtur6NxN.js";import{t as Un}from"./button-CXfaxtRp.js";import{n as Wn}from"./composerHandleContext-BrQ6d8r9.js";import{i as Gn,r as Kn,t as qn}from"./alert-DdU9OGtC.js";import{n as Jn,t as Yn}from"./sidebarStatusText-DaNVnBiR.js";import{a as Xn,i as Zn,o as Qn,r as $n,s as er,t as tr}from"./alert-dialog-zAmnOpaF.js";import{n as nr}from"./editorPreferences-C3i2Nkh2.js";import{t as rr}from"./badge-CNPL77i3.js";import{t as ir}from"./useTheme-DiC-5xCb.js";import{n as ar,t as or}from"./toggle-group-BNtjyirT.js";import{t as sr}from"./toggle-DNtHlm45.js";var J=e(t(),1);function cr(e,t){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if(`shouldBlockFn`in e)return e;if(typeof e==`function`){let n=!!(t??!0);return{shouldBlockFn:async()=>n?await e():!1,enableBeforeUnload:n,withResolver:!1}}let n=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function lr(e,t){let{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:a=!1}=cr(e,t),o=oe(),{history:s}=o,[c,l]=J.useState({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return J.useEffect(()=>i?void 0:s.block({blockerFn:async e=>{function t(e){let t=o.parseLocation(e),[,n,r]=o.getMatchedRoutes(t.pathname);return r===void 0?{routeId:`__notFound__`,fullPath:t.pathname,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}:{routeId:r.id,fullPath:r.fullPath,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}}let r=t(e.currentLocation),i=t(e.nextLocation);if(r.routeId===`__notFound__`&&i.routeId!==`__notFound__`)return!1;let s=await n({action:e.action,current:r,next:i});if(!a)return s;if(!s)return!1;let c=await new Promise(t=>{l({status:`blocked`,current:r,next:i,action:e.action,proceed:()=>t(!1),reset:()=>t(!0)})});return l({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),c},enableBeforeUnload:r}),[n,r,i,a,s,o]),c}var ur=B(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),dr=B(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),fr=B(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),pr=B(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),mr=B(`disc-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]),hr=B(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),gr=B(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),_r=B(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),vr=B(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),yr=B(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),br=B(`monitor-off`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826`,key:`cv7jms`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042`,key:`z8ni2w`}]]),xr=B(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Sr=B(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Cr=B(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),wr=B(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Tr=B(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Er=B(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),Dr=B(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),Or=B(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Y=n(),X=P(),kr={pending:{dotClass:`bg-info`,label:`Working`},running:{dotClass:`bg-info`,label:`Working`},waiting:{dotClass:`bg-info`,label:`Working`},idle:{dotClass:`bg-muted-foreground/50`,label:`Idle · resumable`},completed:{dotClass:`bg-success`,label:`Completed`},failed:{dotClass:`bg-destructive`,label:`Failed`},cancelled:{dotClass:`bg-muted-foreground/60`,label:`Stopped`},interrupted:{dotClass:`bg-muted-foreground/60`,label:`Stopped`}},Ar=(0,J.createContext)({identities:new Map,onOpenAgent:null});function jr(e){let t=(0,Y.c)(4),{status:n}=e,r=kr[n],i;t[0]===r.dotClass?i=t[1]:(i=F(`size-1.5 shrink-0 rounded-full`,r.dotClass),t[0]=r.dotClass,t[1]=i);let a;return t[2]===i?a=t[3]:(a=(0,X.jsx)(`span`,{"aria-hidden":!0,className:i}),t[2]=i,t[3]=a),a}function Mr(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/60);if(n===0)return`${t}s`;let r=Math.floor(n/60);return r===0?`${n}m ${String(t%60).padStart(2,`0`)}s`:`${r}h ${String(n%60).padStart(2,`0`)}m`}function Nr(e,t){let n=Date.parse(e),r=t?Date.parse(t):Date.now();return Number.isNaN(n)||Number.isNaN(r)?``:Mr((r-n)/1e3)}function Pr(e){return e.usage?.durationMs===void 0?e.startedAt&&e.completedAt?Nr(e.startedAt,e.completedAt):null:Mr(e.usage.durationMs/1e3)}function Fr(e){let t=(0,Y.c)(12),{agent:n}=e,r=(0,J.useRef)(null),i=n.status===`running`||n.status===`waiting`,a=n.startedAt,o,s;if(t[0]!==i||t[1]!==a?(o=()=>{if(!i||!a)return;let e=()=>{r.current&&(r.current.textContent=Nr(a,null))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},s=[i,a],t[0]=i,t[1]=a,t[2]=o,t[3]=s):(o=t[2],s=t[3]),(0,J.useEffect)(o,s),!i){let e;t[4]===n?e=t[5]:(e=Pr(n),t[4]=n,t[5]=e);let r=e,i;return t[6]===r?i=t[7]:(i=r?(0,X.jsx)(`span`,{className:`tabular-nums`,children:r}):null,t[6]=r,t[7]=i),i}if(!a)return null;let c;t[8]===a?c=t[9]:(c=Nr(a,null),t[8]=a,t[9]=c);let l;return t[10]===c?l=t[11]:(l=(0,X.jsx)(`span`,{ref:r,className:`tabular-nums`,children:c}),t[10]=c,t[11]=l),l}function Ir(e,t){return/^structured[\s_-]?output$/i.test(e)?t?`Delivering result`:`Delivered result`:t?`Using ${e}`:e}function Lr(e){return e.status===`running`||e.status===`pending`||e.status===`waiting`?e.progress??(e.lastToolName?Ir(e.lastToolName,!0):null)??e.result??e.error:e.error??e.result??e.progress??(e.lastToolName?Ir(e.lastToolName,!1):null)}function Rr(e){let t=(0,Y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`divide-y divide-border/30`,children:n}),t[0]=n,t[1]=r),r}function zr(e){let t=(0,Y.c)(11),{title:n}=e,r=`${n} pending`,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex size-7 items-center justify-center rounded-lg border border-dashed border-border/60 bg-background/30 text-muted-foreground/55`,children:(0,X.jsx)(U,{className:`size-3.5`})}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,X.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground/75`,children:n}),t[1]=n,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground/65`,children:`Waiting for this stage to start`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,X.jsxs)(`span`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-[.68rem] text-muted-foreground/65`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-muted-foreground/40`}),`Pending`]}),t[6]=c):c=t[6];let l;return t[7]!==r||t[8]!==s||t[9]!==n?(l=(0,X.jsxs)(`div`,{"data-workflow-pending-step":!0,"data-phase-title":n,"aria-label":r,className:`grid h-14 grid-cols-[1.75rem_minmax(0,1fr)_auto] items-center gap-x-2 rounded-md px-1.5 py-1 text-left`,children:[i,s,c]}),t[7]=r,t[8]=s,t[9]=n,t[10]=l):l=t[10],l}function Br(e){let t=(0,Y.c)(69),{agent:n}=e,{identities:r,onOpenAgent:i}=(0,J.use)(Ar),a=kr[n.status],o;t[0]===n?o=t[1]:(o=Lr(n),t[0]=n,t[1]=o);let s=o,c;t[2]!==n.effort||t[3]!==n.model?(c=jn(n.model,n.effort),t[2]=n.effort,t[3]=n.model,t[4]=c):c=t[4];let l=c,u,d,f;t[5]!==n.id||t[6]!==n.title||t[7]!==r?(d=r.get(n.id),u=d?.codename??n.title,f=d?.role&&!In(d.role,u)&&!In(d.role,n.title)?d.role:null,t[5]=n.id,t[6]=n.title,t[7]=r,t[8]=u,t[9]=d,t[10]=f):(u=t[8],d=t[9],f=t[10]);let p=f,m=d?.taskLabel??n.title,h;t[11]===n.usage?h=t[12]:(h=n.usage?`${kn(n.usage.totalTokens)} tok`:`— tok`,t[11]=n.usage,t[12]=h);let g=n.usage?.toolUses===void 0?null:`${n.usage.toolUses} tools`,_=n.activationCount>1?`run ${n.activationCount}`:null,v;t[13]!==l||t[14]!==h||t[15]!==g||t[16]!==_?(v=[l,h,g,_].filter(Vr),t[13]=l,t[14]=h,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y=v,b=d?.avatarKey??n.id,x;t[18]===b?x=t[19]:(x=(0,X.jsx)(At,{name:b,className:`size-5`}),t[18]=b,t[19]=x);let S;t[20]===n.status?S=t[21]:(S=(0,X.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 grid size-2.5 place-items-center rounded-full bg-background ring-1 ring-background`,children:(0,X.jsx)(jr,{status:n.status})}),t[20]=n.status,t[21]=S);let C;t[22]!==S||t[23]!==x?(C=(0,X.jsxs)(`span`,{"aria-hidden":!0,className:`relative col-start-1 row-span-3 row-start-1 mt-0.5 flex size-7 items-center justify-center rounded-lg border border-border/45 bg-background/45`,children:[x,S]}),t[22]=S,t[23]=x,t[24]=C):C=t[24];let w;t[25]===u?w=t[26]:(w=(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold tracking-[-0.01em]`,children:u}),t[25]=u,t[26]=w);let T;t[27]===p?T=t[28]:(T=p?(0,X.jsx)(`span`,{className:`max-w-32 shrink-0 truncate rounded-sm border border-border/60 bg-background/40 px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:p}):null,t[27]=p,t[28]=T);let E;t[29]!==w||t[30]!==T?(E=(0,X.jsxs)(`span`,{className:`col-start-2 row-start-1 flex min-w-0 items-center gap-1.5`,children:[w,T]}),t[29]=w,t[30]=T,t[31]=E):E=t[31];let D;t[32]===n?D=t[33]:(D=(0,X.jsx)(Fr,{agent:n}),t[32]=n,t[33]=D);let O;t[34]===n.status?O=t[35]:(O=n.status===`completed`?(0,X.jsx)(xe,{"aria-hidden":!0,className:`size-3 text-success`}):null,t[34]=n.status,t[35]=O);let k;t[36]!==D||t[37]!==O?(k=(0,X.jsx)(`span`,{className:`col-start-3 row-start-1 min-w-14 text-right font-mono text-[.7rem] text-muted-foreground/80`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[D,O]})}),t[36]=D,t[37]=O,t[38]=k):k=t[38];let A;t[39]===m?A=t[40]:(A=(0,X.jsx)(`span`,{className:`col-start-2 col-end-4 row-start-2 block truncate text-[11px] text-foreground/65`,title:m,children:m}),t[39]=m,t[40]=A);let j=n.status===`failed`?`text-destructive-foreground`:`text-muted-foreground`,ee;t[41]===j?ee=t[42]:(ee=F(`col-start-2 row-start-3 block min-w-0 truncate text-xs`,j),t[41]=j,t[42]=ee);let M=s??a.label,te=s??a.label,N;t[43]!==ee||t[44]!==M||t[45]!==te?(N=(0,X.jsx)(`span`,{className:ee,title:M,children:te}),t[43]=ee,t[44]=M,t[45]=te,t[46]=N):N=t[46];let P=y.join(` · `),ne;t[47]===P?ne=t[48]:(ne=(0,X.jsx)(`span`,{className:`col-start-3 row-start-3 max-w-40 truncate text-right font-mono text-[.68rem] tabular-nums text-muted-foreground/65`,children:P}),t[47]=P,t[48]=ne);let re;t[49]===a.label?re=t[50]:(re=(0,X.jsx)(`span`,{className:`sr-only`,children:a.label}),t[49]=a.label,t[50]=re);let ie;t[51]!==C||t[52]!==E||t[53]!==k||t[54]!==A||t[55]!==N||t[56]!==ne||t[57]!==re?(ie=(0,X.jsxs)(X.Fragment,{children:[C,E,k,A,N,ne,re]}),t[51]=C,t[52]=E,t[53]=k,t[54]=A,t[55]=N,t[56]=ne,t[57]=re,t[58]=ie):ie=t[58];let ae=ie,oe=i&&`hover:bg-accent/35 focus-visible:ring-2 focus-visible:ring-ring/50`,se;t[59]===oe?se=t[60]:(se=F(`grid h-[4.5rem] w-full grid-cols-[1.75rem_minmax(0,1fr)_auto] grid-rows-[1.375rem_1.125rem_1rem] items-center gap-x-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors`,oe),t[59]=oe,t[60]=se);let I=se,ce;return t[61]!==n.id||t[62]!==I||t[63]!==u||t[64]!==ae||t[65]!==i||t[66]!==p||t[67]!==a.label?(ce=i?(0,X.jsx)(`button`,{type:`button`,className:I,"data-agent-row":!0,"data-agent-id":n.id,onClick:()=>i(n.id),"aria-label":`Open ${u}${p?`, ${p}`:``} transcript. ${a.label}.`,children:ae}):(0,X.jsx)(`div`,{className:I,"data-agent-row":!0,"data-agent-id":n.id,children:ae}),t[61]=n.id,t[62]=I,t[63]=u,t[64]=ae,t[65]=i,t[66]=p,t[67]=a.label,t[68]=ce):ce=t[68],ce}function Vr(e){return e!==null}function Hr(e){let t=e.workflow.status;return t!==`completed`&&t!==`failed`&&t!==`cancelled`&&t!==`interrupted`}function Ur(e){return[...e.phases.flatMap(e=>e.members),...e.unphasedMembers]}function Wr(e){let t=(0,Y.c)(4),{group:n}=e;if(n.phases.length===0)return null;let r;t[0]===n.phases?r=t[1]:(r=n.phases.map(Gr),t[0]=n.phases,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-1.5 pb-1 pt-1.5`,children:r}),t[2]=r,t[3]=i),i}function Gr(e,t){return(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0?(0,X.jsx)(Te,{"aria-hidden":!0,className:`size-3 text-muted-foreground/40`}):null,(0,X.jsxs)(`div`,{className:F(`flex items-center gap-1 rounded-sm border px-1.5 py-0.5`,e.state===`running`?`border-info/40`:e.state===`done`?`border-success/30`:`border-border/50`),children:[(0,X.jsxs)(`span`,{className:F(`font-mono text-[.65rem]`,e.state===`running`?`text-info-foreground`:e.state===`done`?`text-success-foreground`:`text-muted-foreground/70`),children:[e.state===`done`?`✓ `:``,e.title]}),(0,X.jsx)(`span`,{className:`flex items-center gap-0.5`,children:e.members.length===0?(0,X.jsx)(`span`,{className:`font-mono text-[.6rem] text-muted-foreground/50`,children:`–`}):e.members.map(Kr)})]})]},e.index)}function Kr(e){return(0,X.jsx)(jr,{status:e.status},e.id)}var qr=15e3;function Jr(e){let t=(0,Y.c)(28),{environmentId:n,threadId:r,scriptPath:i,onClose:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={state:`loading`},t[0]=o):o=t[0];let[s,c]=(0,J.useState)(o),[l,u]=(0,J.useState)(0),d;t[1]!==n||t[2]!==i||t[3]!==r?(d=()=>{let e=!1,t;c({state:`loading`});let a=C(n)?.orchestration.getWorkflowScript;if(!a){c({state:`failed`});return}let o=new Promise((e,n)=>{t=setTimeout(()=>n(Error(`workflow script fetch timed out`)),qr)});return Promise.race([a({threadId:r,scriptPath:i}),o]).then(t=>{e||c({state:`loaded`,contents:t.contents,truncated:t.truncated})}).catch(()=>{e||c({state:`failed`})}).finally(()=>{t!==void 0&&clearTimeout(t)}),()=>{e=!0,t!==void 0&&clearTimeout(t)}},t[1]=n,t[2]=i,t[3]=r,t[4]=d):d=t[4];let f;t[5]!==l||t[6]!==n||t[7]!==i||t[8]!==r?(f=[n,r,i,l],t[5]=l,t[6]=n,t[7]=i,t[8]=r,t[9]=f):f=t[9],(0,J.useEffect)(d,f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(ur,{"aria-hidden":!0,className:`size-3 text-muted-foreground`}),t[10]=p):p=t[10];let m;t[11]===i?m=t[12]:(m=i.split(`/`).at(-1),t[11]=i,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,X.jsx)(`span`,{className:`truncate font-mono text-[.65rem] text-muted-foreground`,children:m}),t[13]=m,t[14]=h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(On,{"aria-hidden":!0,className:`size-3`}),t[15]=g):g=t[15];let _;t[16]===a?_=t[17]:(_=(0,X.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Close script`,className:`ml-auto text-muted-foreground hover:text-foreground`,children:g}),t[16]=a,t[17]=_);let v;t[18]!==h||t[19]!==_?(v=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/50 px-2 py-1`,children:[p,h,_]}),t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==s.contents||t[22]!==s.state||t[23]!==s.truncated?(y=(0,X.jsx)(`div`,{className:`max-h-72 overflow-auto p-2`,children:s.state===`loaded`?(0,X.jsxs)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[.7rem] leading-relaxed text-foreground/90`,children:[s.contents,s.truncated?`
|
|
2
2
|
… (truncated)`:``]}):s.state===`failed`?(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:`Could not load the script.`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(Yr),className:`text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground`,children:`Retry`})]}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading…`})}),t[21]=s.contents,t[22]=s.state,t[23]=s.truncated,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==v?(b=(0,X.jsxs)(`div`,{className:`mx-1.5 mb-1 rounded-md border border-border/60 bg-background/60`,children:[v,y]}),t[25]=y,t[26]=v,t[27]=b):b=t[27],b}function Yr(e){return e+1}function Xr(e){let t=(0,Y.c)(33),{phase:n,defaultOpen:r}=e,[i,a]=(0,J.useState)(r!==void 0&&r||n.state===`running`),o=(0,J.useRef)(n.state),s,c;t[0]===n.state?(s=t[1],c=t[2]):(s=()=>{o.current!==`running`&&n.state===`running`&&a(!0),o.current=n.state},c=[n.state],t[0]=n.state,t[1]=s,t[2]=c),(0,J.useEffect)(s,c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>a($r),t[3]=l):l=t[3];let u=n.state===`done`?`text-success-foreground`:n.state===`running`?`text-info-foreground`:`text-muted-foreground/70`,d;t[4]===u?d=t[5]:(d=F(`mt-2 flex w-full items-center gap-1.5 rounded-sm px-1.5 text-left text-[.65rem] font-medium uppercase tracking-wider hover:bg-accent/40`,u),t[4]=u,t[5]=d);let f;t[6]===i?f=t[7]:(f=i?(0,X.jsx)(Se,{"aria-hidden":!0,className:`size-3 shrink-0`}):(0,X.jsx)(Te,{"aria-hidden":!0,className:`size-3 shrink-0`}),t[6]=i,t[7]=f);let p;t[8]===n.state?p=t[9]:(p=n.state===`done`?(0,X.jsx)(xe,{"aria-hidden":!0,className:`size-3`}):null,t[8]=n.state,t[9]=p);let m;t[10]===n.title?m=t[11]:(m=(0,X.jsx)(`span`,{children:n.title}),t[10]=n.title,t[11]=m);let h=n.state===`pending`&&n.members.length===0?`pending`:n.state===`done`?`${n.settledCount} done`:`${n.activeCount} active · ${n.settledCount} done`,g;t[12]===h?g=t[13]:(g=(0,X.jsx)(`span`,{className:`font-normal normal-case text-muted-foreground/70`,children:h}),t[12]=h,t[13]=g);let _;t[14]!==i||t[15]!==n.members?(_=!i&&n.members.length>0?(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-0.5`,children:n.members.map(Qr)}):null,t[14]=i,t[15]=n.members,t[16]=_):_=t[16];let v;t[17]!==i||t[18]!==g||t[19]!==_||t[20]!==d||t[21]!==f||t[22]!==p||t[23]!==m?(v=(0,X.jsxs)(`button`,{type:`button`,onClick:l,"aria-expanded":i,className:d,children:[f,p,m,g,_]}),t[17]=i,t[18]=g,t[19]=_,t[20]=d,t[21]=f,t[22]=p,t[23]=m,t[24]=v):v=t[24];let y;t[25]!==i||t[26]!==n.members||t[27]!==n.state||t[28]!==n.title?(y=i?(0,X.jsx)(Rr,{children:n.members.length===0&&n.state===`pending`?(0,X.jsx)(zr,{title:n.title}):n.members.map(Zr)}):null,t[25]=i,t[26]=n.members,t[27]=n.state,t[28]=n.title,t[29]=y):y=t[29];let b;return t[30]!==v||t[31]!==y?(b=(0,X.jsxs)(`div`,{children:[v,y]}),t[30]=v,t[31]=y,t[32]=b):b=t[32],b}function Zr(e){return(0,X.jsx)(Br,{agent:e},e.id)}function Qr(e){return(0,X.jsx)(jr,{status:e.status},e.id)}function $r(e){return!e}function ei(e){let t=(0,Y.c)(47),{group:n,environmentId:r,threadId:i,onCollapse:a}=e,[o,s]=(0,J.useState)(!1),c,l;t[0]===n?(c=t[1],l=t[2]):(c=Ur(n),l=c.filter(ii),t[0]=n,t[1]=c,t[2]=l);let u=l.length,d=n.workflow.runHandles?.scriptPath,f=d!==void 0&&r!==null&&i!==null,p;t[3]===n.workflow.status?p=t[4]:(p=(0,X.jsx)(jr,{status:n.workflow.status}),t[3]=n.workflow.status,t[4]=p);let m=n.workflow.workflowName??n.workflow.title,h;t[5]===m?h=t[6]:(h=(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:m}),t[5]=m,t[6]=h);let g;t[7]!==f||t[8]!==o?(g=f?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(ri),className:F(`rounded-sm border border-border/60 px-1 font-mono normal-case hover:text-foreground`,o&&`text-foreground`),"aria-expanded":o,children:[`{}`,` script`]}):null,t[7]=f,t[8]=o,t[9]=g):g=t[9];let _;t[10]!==c.length||t[11]!==u?(_=(0,X.jsxs)(`span`,{className:`ml-auto font-mono normal-case text-muted-foreground/80`,children:[u,`/`,c.length,` settled`]}),t[10]=c.length,t[11]=u,t[12]=_):_=t[12];let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(Se,{"aria-hidden":!0,className:`size-3`}),t[13]=v):v=t[13];let y;t[14]===a?y=t[15]:(y=(0,X.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Collapse workflow`,className:`rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:v}),t[14]=a,t[15]=y);let b;t[16]!==p||t[17]!==h||t[18]!==g||t[19]!==_||t[20]!==y?(b=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-1.5 pt-0.5 text-[.65rem] font-medium uppercase tracking-wider text-muted-foreground`,children:[p,h,g,_,y]}),t[16]=p,t[17]=h,t[18]=g,t[19]=_,t[20]=y,t[21]=b):b=t[21];let x;t[22]===n?x=t[23]:(x=(0,X.jsx)(Wr,{group:n}),t[22]=n,t[23]=x);let S;t[24]!==f||t[25]!==r||t[26]!==o||t[27]!==d||t[28]!==i?(S=o&&f?(0,X.jsx)(Jr,{environmentId:r,threadId:i,scriptPath:d,onClose:()=>s(!1)}):null,t[24]=f,t[25]=r,t[26]=o,t[27]=d,t[28]=i,t[29]=S):S=t[29];let C;t[30]===n.phases?C=t[31]:(C=n.phases.map(ni),t[30]=n.phases,t[31]=C);let w;t[32]===n.unphasedMembers?w=t[33]:(w=n.unphasedMembers.map(ti),t[32]=n.unphasedMembers,t[33]=w);let T;t[34]===w?T=t[35]:(T=(0,X.jsx)(Rr,{children:w}),t[34]=w,t[35]=T);let E;t[36]!==n.phases.length||t[37]!==n.unphasedMembers.length||t[38]!==n.workflow?(E=n.phases.length===0&&n.unphasedMembers.length===0?(0,X.jsx)(Br,{agent:n.workflow}):null,t[36]=n.phases.length,t[37]=n.unphasedMembers.length,t[38]=n.workflow,t[39]=E):E=t[39];let D;return t[40]!==x||t[41]!==S||t[42]!==C||t[43]!==T||t[44]!==E||t[45]!==b?(D=(0,X.jsxs)(`section`,{className:`rounded-lg border border-border/50 bg-card/30 p-1.5`,children:[b,x,S,C,T,E]}),t[40]=x,t[41]=S,t[42]=C,t[43]=T,t[44]=E,t[45]=b,t[46]=D):D=t[46],D}function ti(e){return(0,X.jsx)(Br,{agent:e},e.id)}function ni(e){return(0,X.jsx)(Xr,{phase:e,defaultOpen:!0},e.index)}function ri(e){return!e}function ii(e){return e.status===`completed`||e.status===`failed`||e.status===`cancelled`||e.status===`interrupted`}function ai(e){let t=(0,Y.c)(45),{group:n,onExpand:r}=e,i,a,o,s,c,l,u,d,f,p,m,h,g;if(t[0]!==n||t[1]!==r){let e=Ur(n),_=e.filter(si).length,v=e.reduce(oi,e.length===0?n.workflow.usage?.totalTokens??0:0),y;t[15]!==n.workflow.completedAt||t[16]!==n.workflow.startedAt?(y=n.workflow.startedAt&&n.workflow.completedAt?Nr(n.workflow.startedAt,n.workflow.completedAt):null,t[15]=n.workflow.completedAt,t[16]=n.workflow.startedAt,t[17]=y):y=t[17],i=y,m=`button`,h=r,g=`flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left outline-none hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring/50`,o=!1;let b=_>0?`failed`:n.workflow.status;t[18]===b?s=t[19]:(s=(0,X.jsx)(jr,{status:b}),t[18]=b,t[19]=s);let x=n.workflow.workflowName??n.workflow.title;t[20]===x?c=t[21]:(c=(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:x}),t[20]=x,t[21]=c),d=`flex shrink-0 items-center gap-1.5 font-mono text-[.7rem] text-muted-foreground/80`,t[22]===_?f=t[23]:(f=_>0?(0,X.jsxs)(`span`,{className:`text-destructive-foreground`,children:[_,` failed`]}):null,t[22]=_,t[23]=f),p=(0,X.jsxs)(`span`,{children:[e.length,` agents`]}),a=`tabular-nums`,l=`· `,u=kn(v),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];let _;t[24]!==a||t[25]!==l||t[26]!==u?(_=(0,X.jsxs)(`span`,{className:a,children:[l,u,` tok`]}),t[24]=a,t[25]=l,t[26]=u,t[27]=_):_=t[27];let v;t[28]===i?v=t[29]:(v=i?(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[`· `,i]}):null,t[28]=i,t[29]=v);let y;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(Te,{"aria-hidden":!0,className:`size-3`}),t[30]=y):y=t[30];let b;t[31]!==_||t[32]!==v||t[33]!==d||t[34]!==f||t[35]!==p?(b=(0,X.jsxs)(`span`,{className:d,children:[f,p,_,v,y]}),t[31]=_,t[32]=v,t[33]=d,t[34]=f,t[35]=p,t[36]=b):b=t[36];let x;return t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==b||t[41]!==m||t[42]!==h||t[43]!==g?(x=(0,X.jsx)(`section`,{children:(0,X.jsxs)(`button`,{type:m,onClick:h,className:g,"aria-expanded":o,children:[s,c,b]})}),t[37]=o,t[38]=s,t[39]=c,t[40]=b,t[41]=m,t[42]=h,t[43]=g,t[44]=x):x=t[44],x}function oi(e,t){return e+(t.usage?.totalTokens??0)}function si(e){return e.status===`failed`}function ci(e){let t=(0,Y.c)(7),{group:n,environmentId:r,threadId:i}=e,a;t[0]===n?a=t[1]:(a=()=>Hr(n),t[0]=n,t[1]=a);let[o,s]=(0,J.useState)(a),c;return t[2]!==r||t[3]!==n||t[4]!==o||t[5]!==i?(c=o?(0,X.jsx)(ei,{group:n,environmentId:r,threadId:i,onCollapse:()=>s(!1)}):(0,X.jsx)(ai,{group:n,onExpand:()=>s(!0)}),t[2]=r,t[3]=n,t[4]=o,t[5]=i,t[6]=c):c=t[6],c}function li(e){let t=(0,Y.c)(43),{model:n,environmentId:r,threadId:i,onOpenAgent:a}=e,o=r===void 0?null:r,s=i===void 0?null:i,c=a===void 0?null:a,l;if(t[0]!==n.directAgents||t[1]!==n.workflows){let e=new Map;for(let t of n.workflows){e.set(t.workflow.id,t.workflow);for(let n of Ur(t))e.set(n.id,n)}for(let t of n.directAgents)e.set(t.id,t);l=Fn([...e.values()].map(di)),t[0]=n.directAgents,t[1]=n.workflows,t[2]=l}else l=t[2];let u;t[3]!==c||t[4]!==l?(u={identities:l,onOpenAgent:c},t[3]=c,t[4]=l,t[5]=u):u=t[5];let d=u;if(!n.hasAgents){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 p-6 text-center`,children:[(0,X.jsx)(be,{"aria-hidden":!0,className:`size-6 text-muted-foreground/60`}),(0,X.jsx)(`p`,{className:`text-sm font-medium`,children:`No agents yet`}),(0,X.jsx)(`p`,{className:`max-w-56 text-xs text-muted-foreground`,children:`When this thread spawns subagents or runs a workflow, they show up here with live status, activity, and token usage.`})]}),t[6]=e):e=t[6],e}let f;if(t[7]!==o||t[8]!==n.workflows||t[9]!==s){let e;t[11]!==o||t[12]!==s?(e=e=>(0,X.jsx)(ci,{group:e,environmentId:o,threadId:s},e.workflow.id),t[11]=o,t[12]=s,t[13]=e):e=t[13],f=n.workflows.map(e),t[7]=o,t[8]=n.workflows,t[9]=s,t[10]=f}else f=t[10];let p;t[14]===n.directAgents?p=t[15]:(p=n.directAgents.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`div`,{className:`px-1.5 pt-1 text-[.65rem] font-medium uppercase tracking-wider text-muted-foreground`,children:`Direct spawns`}),(0,X.jsx)(Rr,{children:n.directAgents.map(ui)})]}):null,t[14]=n.directAgents,t[15]=p);let m;t[16]!==f||t[17]!==p?(m=(0,X.jsx)(Hn,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 p-2`,children:[f,p]})}),t[16]=f,t[17]=p,t[18]=m):m=t[18];let h;t[19]!==n.runningCount||t[20]!==n.waitingCount?(h=n.runningCount+n.waitingCount>0?(0,X.jsxs)(`span`,{className:`text-info-foreground`,children:[`● `,n.runningCount+n.waitingCount,` working`]}):null,t[19]=n.runningCount,t[20]=n.waitingCount,t[21]=h):h=t[21];let g;t[22]===n.idleCount?g=t[23]:(g=n.idleCount>0?(0,X.jsxs)(`span`,{children:[n.idleCount,` idle`]}):null,t[22]=n.idleCount,t[23]=g);let _;t[24]===n.settledCount?_=t[25]:(_=n.settledCount>0?(0,X.jsxs)(`span`,{children:[n.settledCount,` settled`]}):null,t[24]=n.settledCount,t[25]=_);let v;t[26]!==g||t[27]!==_||t[28]!==h?(v=(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[h,g,_]}),t[26]=g,t[27]=_,t[28]=h,t[29]=v):v=t[29];let y;t[30]===n.totalTokens?y=t[31]:(y=kn(n.totalTokens),t[30]=n.totalTokens,t[31]=y);let b;t[32]===y?b=t[33]:(b=(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[`Σ `,y,` tok`]}),t[32]=y,t[33]=b);let x;t[34]!==v||t[35]!==b?(x=(0,X.jsxs)(`footer`,{className:`flex items-center justify-between border-t border-border/60 px-3 py-1.5 font-mono text-[.7rem] text-muted-foreground`,children:[v,b]}),t[34]=v,t[35]=b,t[36]=x):x=t[36];let S;t[37]!==x||t[38]!==m?(S=(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[m,x]}),t[37]=x,t[38]=m,t[39]=S):S=t[39];let C;return t[40]!==d||t[41]!==S?(C=(0,X.jsx)(Ar.Provider,{value:d,children:S}),t[40]=d,t[41]=S,t[42]=C):C=t[42],C}function ui(e){return(0,X.jsx)(Br,{agent:e},e.id)}function di(e){return{key:e.id,role:e.role,taskLabel:e.title}}function fi(e){let t=[],n=new Set(e.openedPanelModes);n.has(`files`)&&t.push({key:`files`,label:`Files`,mode:`files`}),n.has(`review`)&&t.push({key:`review`,label:`Review`,mode:`review`}),n.has(`terminal`)&&t.push({key:`terminal`,label:`Terminal`,mode:`terminal`}),n.has(`simulator`)&&t.push({key:`simulator`,label:`Simulator`,mode:`simulator`}),n.has(`agents`)&&t.push({key:`agents`,label:`Agents`,mode:`agents`});let r=[...new Set([...e.openedAgentKeys,...e.activeAgentKey?[e.activeAgentKey]:[]])];for(let n of r){let r=Nn(e.subagents,n)??{key:n,name:`Subagent`,status:`idle`,origin:null,capability:null,tool:null,detail:null,providerThreadIds:[],providerSessionIds:[],startedAt:``,updatedAt:``,entries:[],messages:[]};t.push({key:r.key,label:r.name,mode:`agent`,agentKey:r.key,status:r.status,avatarKey:r.avatarKey??r.key})}return t}var pi=new Set,mi=null;function hi(e){pi.add(e),mi??=requestAnimationFrame(_i)}function gi(e){pi.delete(e)&&pi.size===0&&mi!=null&&(cancelAnimationFrame(mi),mi=null)}function _i(e){let t=new Set(pi);pi.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}mi=pi.size>0?requestAnimationFrame(_i):null}function vi(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function yi(e,t){let n=e?.theme??K,r=t?.theme??K,i=bi(e),a=bi(t);return Ht(n,r)&&vi(e,t,[`theme`,`parseDiffOptions`])&&vi(i,a)}function bi(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function xi(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Si({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}var Ci=new TextEncoder,wi=new TextDecoder(`utf-8`,{ignoreBOM:!0}),Ti=/[\uD800-\uDFFF]/,Ei=1024,Di=new Uint8Array(Ei);function Oi(){Di.length!==Ei&&(Di=new Uint8Array(Ei))}function ki(e){if(e.length===0)return e;if(Ti.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Di.length<t&&(Di=new Uint8Array(t));let{written:n}=Ci.encodeInto(e,Di);return wi.decode(Di.subarray(0,n))}var Ai=4096,ji=.5;function Mi(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=Pi(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}Ni(t,e)}}function Ni(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function Pi(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>Ai)return null;let c=[];for(let t=0;t<n;t++)c.push(Ii(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(Ii(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=Li(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*ji:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var Fi=/\s+/g;function Ii(e){return e.replace(Fi,``)}function Li(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function Ri(e,t,n){try{return zi(e,t,n)}finally{Oi()}}function zi(e,t,n=!1){let r=ra(e),i=r?Ki(e):qi(e),a,o=[];for(let e of i){if(r&&!gt.test(e)){if(a==null)a=ki(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}if(!r&&!Ji(e)){if(a==null)a=ki(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=Vi(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function Bi(e,t){try{return Vi(e,t)}finally{Oi()}}function Vi(e,{cacheKey:t,isGitDiff:n=gt.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=ia(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=Gi(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=ea(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?Wi(i.contents):[],deletionLines:!l&&r!=null&&i!=null?Wi(r.contents):[],cacheKey:oa(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Ne),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=ki(r.trim()),n!==r&&(c.prevName=ki(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?ft:Ue):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=ki(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=ki(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=ki(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=ki(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=ki(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=ki(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(qe)??[];t!=null&&(c.prevObjectId=ki(t)),n!=null&&(c.newObjectId=ki(n)),r!=null&&(c.mode=ki(r))}e.startsWith(`rename from `)&&(c.prevName=ki(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=ki(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
3
3
|
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
4
4
|
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:oa(p.hunkContext),hunkSpecs:ki(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&Qi(t)&&!$i(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=sa(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=ca(t);(g==null||g.type!==`change`)&&(g=la(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=ca(t);(g==null||g.type!==`change`)&&(g=la(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=ca(t);(g==null||g.type!==`context`)&&(g=la(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=nt(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=nt(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(Le(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=Re(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=Re(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),Mi(c),c}}function Hi(e,t,n=!1){let r=[],i=Ui(e)?e.split(Bt):[e];for(let e of i)try{r.push(Ri(e,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function Ui(e){return e.startsWith(`From `)||e.includes(`
|
package/dist/client/assets/{ToolbarRootContext-CgV898DN.js → ToolbarRootContext-Cp1bgmpz.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,jn as r}from"./usePopupViewport-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,jn as r}from"./usePopupViewport-CQTeg5Y-.js";import{d as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./useScrollLock-TdF-Iq8H.js";var o=e(t(),1),s=20;function c(e,t,i,c){let[l,u]=o.useState(!1);n(()=>{if(!e||!t||i==null){u(!1);return}let n=r(i).documentElement.clientWidth,a=i.offsetWidth;u(n>0&&a>0&&a>=n-s)},[e,t,i]),a(e&&(!t||l),c)}var l=o.createContext(void 0);function u(e){let t=o.useContext(l);if(t===void 0&&!e)throw Error(i(69));return t}export{c as n,u as t};
|