zidane-ui 9.3.1 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/index.js +2 -1
- package/dist/adapters/live.d.ts +9 -2
- package/dist/adapters/live.js +8 -2
- package/dist/adapters/server-approvals-host.js +3 -1
- package/dist/adapters/server-channels-host.d.ts +32 -0
- package/dist/adapters/server-channels-host.js +49 -0
- package/dist/adapters/server-composer-host.js +13 -0
- package/dist/adapters/server-files-host.js +12 -31
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +44 -14
- package/dist/adapters/server-machines-host.d.ts +5 -0
- package/dist/adapters/server-machines-host.js +15 -1
- package/dist/adapters/server-oauth-flow.d.ts +2 -1
- package/dist/adapters/server-projects.d.ts +15 -0
- package/dist/adapters/server-projects.js +225 -0
- package/dist/adapters/server-session-host.d.ts +2 -0
- package/dist/adapters/server-session-host.js +69 -1
- package/dist/adapters/server-settings-sections.js +4 -1
- package/dist/adapters/sse-host.js +3 -0
- package/dist/adapters/sse-protocol.d.ts +10 -0
- package/dist/app/AppHostProvider.d.ts +1 -1
- package/dist/app/AppHostProvider.js +7 -2
- package/dist/app/ModalProvider.d.ts +6 -2
- package/dist/app/ModalProvider.js +38 -10
- package/dist/app/headless/app-host.d.ts +3 -0
- package/dist/appearance/ZoomIndicator.js +5 -8
- package/dist/approvals/ApprovalsProvider.d.ts +2 -1
- package/dist/approvals/ApprovalsProvider.js +12 -4
- package/dist/approvals/headless/host.d.ts +13 -2
- package/dist/approvals/headless/index.d.ts +3 -3
- package/dist/approvals/headless/index.js +2 -2
- package/dist/approvals/headless/labels.d.ts +12 -2
- package/dist/approvals/headless/labels.js +19 -1
- package/dist/channels/BindingEditorDialog.d.ts +18 -0
- package/dist/channels/BindingEditorDialog.js +637 -0
- package/dist/channels/ChannelAlertsList.d.ts +25 -0
- package/dist/channels/ChannelAlertsList.js +107 -0
- package/dist/channels/ChannelDefaultsSection.d.ts +20 -0
- package/dist/channels/ChannelDefaultsSection.js +133 -0
- package/dist/channels/ChannelsProvider.d.ts +31 -0
- package/dist/channels/ChannelsProvider.js +29 -0
- package/dist/channels/ChannelsSettingsSection.d.ts +40 -0
- package/dist/channels/ChannelsSettingsSection.js +456 -0
- package/dist/channels/ConnectionSetupDialog.d.ts +16 -0
- package/dist/channels/ConnectionSetupDialog.js +470 -0
- package/dist/channels/HeldRepliesList.d.ts +27 -0
- package/dist/channels/HeldRepliesList.js +173 -0
- package/dist/channels/ProjectChannelsSection.d.ts +55 -0
- package/dist/channels/ProjectChannelsSection.js +433 -0
- package/dist/channels/ReadinessChecklist.d.ts +102 -0
- package/dist/channels/ReadinessChecklist.js +273 -0
- package/dist/channels/TestSessionBanner.d.ts +24 -0
- package/dist/channels/TestSessionBanner.js +44 -0
- package/dist/channels/channels-parts.d.ts +104 -0
- package/dist/channels/channels-parts.js +203 -0
- package/dist/channels/context.d.ts +9 -0
- package/dist/channels/context.js +14 -0
- package/dist/channels/headless/access.d.ts +127 -0
- package/dist/channels/headless/access.js +187 -0
- package/dist/channels/headless/fixture-host.d.ts +83 -0
- package/dist/channels/headless/fixture-host.js +557 -0
- package/dist/channels/headless/host.d.ts +245 -0
- package/dist/channels/headless/host.js +39 -0
- package/dist/channels/headless/index.d.ts +10 -0
- package/dist/channels/headless/index.js +5 -0
- package/dist/channels/headless/labels.d.ts +217 -0
- package/dist/channels/headless/labels.js +260 -0
- package/dist/channels/headless/state.d.ts +22 -0
- package/dist/channels/headless/state.js +303 -0
- package/dist/channels/index.d.ts +21 -0
- package/dist/channels/index.js +13 -0
- package/dist/channels/testing/contract.d.ts +31 -0
- package/dist/channels/testing/contract.js +378 -0
- package/dist/channels/testing/index.d.ts +7 -0
- package/dist/channels/testing/index.js +1 -0
- package/dist/chat/HostBadge.js +1 -0
- package/dist/chat/HostTranscript.js +15 -1
- package/dist/chat/OrchestratorBadge.d.ts +23 -0
- package/dist/chat/OrchestratorBadge.js +22 -0
- package/dist/chat/SessionGroupHeader.d.ts +11 -1
- package/dist/chat/SessionGroupHeader.js +25 -14
- package/dist/chat/SessionRow.d.ts +141 -0
- package/dist/chat/SessionRow.js +215 -0
- package/dist/chat/SessionStreamsProvider.d.ts +1 -1
- package/dist/chat/StatusDot.d.ts +7 -2
- package/dist/chat/StatusDot.js +3 -2
- package/dist/chat/Transcript.d.ts +3 -2
- package/dist/chat/Transcript.js +26 -7
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ContextBreakdown.d.ts +27 -2
- package/dist/chat/composer/ContextBreakdown.js +123 -2
- package/dist/chat/composer/DraftPickers.js +2 -0
- package/dist/chat/composer/HostContextOrb.d.ts +2 -0
- package/dist/chat/composer/HostContextOrb.js +17 -2
- package/dist/chat/composer/ModelOptionsPicker.js +6 -2
- package/dist/chat/composer/ModelPicker.d.ts +1 -1
- package/dist/chat/composer/PlacePicker.d.ts +3 -1
- package/dist/chat/composer/PlacePicker.js +5 -1
- package/dist/chat/composer/ProjectMenu.d.ts +16 -3
- package/dist/chat/composer/ProjectMenu.js +102 -20
- package/dist/chat/composer/ScopeToggle.d.ts +3 -1
- package/dist/chat/composer/ScopeToggle.js +2 -1
- package/dist/chat/composer/ServerScopeToggle.d.ts +3 -1
- package/dist/chat/composer/ServerScopeToggle.js +2 -1
- package/dist/chat/composer/index.d.ts +2 -2
- package/dist/chat/composer/index.js +2 -2
- package/dist/chat/composer/use-draft-target.d.ts +5 -0
- package/dist/chat/composer/use-draft-target.js +18 -3
- package/dist/chat/composer/use-send-prompt.d.ts +2 -0
- package/dist/chat/composer/use-send-prompt.js +4 -1
- package/dist/chat/headless/answered-first.d.ts +28 -0
- package/dist/chat/headless/answered-first.js +14 -0
- package/dist/chat/headless/block-runs.js +26 -1
- package/dist/chat/headless/chip-labels.d.ts +2 -0
- package/dist/chat/headless/chip-labels.js +2 -0
- package/dist/chat/headless/chip-views.js +1 -1
- package/dist/chat/headless/composer/composer-sources.d.ts +5 -2
- package/dist/chat/headless/composer/composer-sources.js +6 -0
- package/dist/chat/headless/composer/host.d.ts +13 -0
- package/dist/chat/headless/composer/index.d.ts +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +3 -0
- package/dist/chat/headless/composer/labels-chrome.js +4 -1
- package/dist/chat/headless/composer/labels-editor.d.ts +2 -0
- package/dist/chat/headless/composer/labels-editor.js +2 -0
- package/dist/chat/headless/draft-target.d.ts +30 -1
- package/dist/chat/headless/draft-target.js +22 -1
- package/dist/chat/headless/folder-groups.d.ts +41 -0
- package/dist/chat/headless/folder-groups.js +76 -0
- package/dist/chat/headless/host.d.ts +16 -1
- package/dist/chat/headless/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +31 -27
- package/dist/chat/headless/index.js +33 -29
- package/dist/chat/headless/labels.d.ts +34 -4
- package/dist/chat/headless/labels.js +28 -6
- package/dist/chat/headless/markdown-scan.d.ts +0 -2
- package/dist/chat/headless/markdown-scan.js +3 -8
- package/dist/chat/headless/markdown-stream.js +3 -3
- package/dist/chat/headless/prompt-origin.d.ts +4 -2
- package/dist/chat/headless/prompt-origin.js +9 -5
- package/dist/chat/headless/send-flow.d.ts +2 -0
- package/dist/chat/headless/session-list.d.ts +28 -2
- package/dist/chat/headless/sidebar/directory.d.ts +15 -1
- package/dist/chat/headless/sidebar/directory.js +11 -1
- package/dist/chat/headless/sidebar/environment.d.ts +15 -4
- package/dist/chat/headless/sidebar/environment.js +27 -9
- package/dist/chat/headless/sidebar/inbox.d.ts +13 -3
- package/dist/chat/headless/sidebar/inbox.js +40 -19
- package/dist/chat/headless/sidebar/index.d.ts +6 -4
- package/dist/chat/headless/sidebar/index.js +5 -3
- package/dist/chat/headless/sidebar/labels.d.ts +38 -8
- package/dist/chat/headless/sidebar/labels.js +8 -4
- package/dist/chat/headless/sidebar/project-main.d.ts +43 -0
- package/dist/chat/headless/sidebar/project-main.js +46 -0
- package/dist/chat/headless/sidebar/row-changes.d.ts +43 -0
- package/dist/chat/headless/sidebar/row-changes.js +43 -0
- package/dist/chat/headless/sidebar/rows.d.ts +2 -1
- package/dist/chat/headless/sidebar/rows.js +7 -3
- package/dist/chat/headless/sidebar/types.d.ts +12 -0
- package/dist/chat/headless/streams/actions.d.ts +2 -2
- package/dist/chat/headless/streams/actions.js +1 -1
- package/dist/chat/headless/streams/event-bytes.d.ts +12 -1
- package/dist/chat/headless/streams/event-bytes.js +13 -1
- package/dist/chat/headless/streams/live-events.d.ts +12 -0
- package/dist/chat/headless/streams/live-events.js +21 -2
- package/dist/chat/headless/streams/store.d.ts +38 -5
- package/dist/chat/headless/streams/store.js +74 -22
- package/dist/chat/headless/streams/transcript-map.js +2 -5
- package/dist/chat/headless/streams/types.d.ts +4 -2
- package/dist/chat/headless/transcript/collapse.js +6 -1
- package/dist/chat/headless/transcript/rail.d.ts +8 -1
- package/dist/chat/headless/transcript/rail.js +9 -2
- package/dist/chat/headless/transcript/rows.d.ts +5 -1
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/index.d.ts +6 -4
- package/dist/chat/index.js +8 -6
- package/dist/chat/interactions/HostInteractions.js +4 -2
- package/dist/chat/interactions/InboxPanel.js +6 -4
- package/dist/chat/interactions/use-answer-interaction.d.ts +11 -0
- package/dist/chat/interactions/use-answer-interaction.js +19 -0
- package/dist/chat/rich-composer/artifact-mentions.d.ts +29 -0
- package/dist/chat/rich-composer/artifact-mentions.js +40 -0
- package/dist/chat/rich-composer/composer-extensions.d.ts +3 -2
- package/dist/chat/rich-composer/composer-extensions.js +12 -9
- package/dist/chat/rich-composer/use-composer-sources.js +1 -0
- package/dist/chat/sidebar/InboxList.d.ts +13 -2
- package/dist/chat/sidebar/InboxList.js +44 -48
- package/dist/chat/sidebar/MainSessionRow.d.ts +2 -1
- package/dist/chat/sidebar/MainSessionRow.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +8 -4
- package/dist/chat/sidebar/ProjectIcon.js +16 -4
- package/dist/chat/sidebar/RowChips.js +2 -2
- package/dist/chat/sidebar/SessionSidebar.d.ts +47 -0
- package/dist/chat/sidebar/SessionSidebar.js +85 -28
- package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
- package/dist/chat/sidebar/SidebarFold.js +17 -16
- package/dist/chat/sidebar/SidebarFooter.d.ts +2 -23
- package/dist/chat/sidebar/SidebarFooter.js +2 -43
- package/dist/chat/sidebar/SidebarGroupHeader.d.ts +7 -3
- package/dist/chat/sidebar/SidebarGroupHeader.js +15 -10
- package/dist/chat/sidebar/SidebarLiveProvider.d.ts +22 -0
- package/dist/chat/sidebar/SidebarLiveProvider.js +20 -0
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +12 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +25 -13
- package/dist/chat/sidebar/inbox-triage.d.ts +18 -2
- package/dist/chat/sidebar/inbox-triage.js +39 -12
- package/dist/chat/sidebar/index.d.ts +5 -4
- package/dist/chat/sidebar/index.js +3 -2
- package/dist/chat/sidebar/session-menu.d.ts +4 -0
- package/dist/chat/sidebar/session-menu.js +14 -2
- package/dist/chat/sidebar/sidebar-live.d.ts +29 -2
- package/dist/chat/sidebar/sidebar-live.js +64 -6
- package/dist/chat/sidebar/useInboxRows.js +8 -9
- package/dist/chat/sidebar/useInboxTriage.d.ts +5 -2
- package/dist/chat/sidebar/useInboxTriage.js +78 -67
- package/dist/chat/sidebar/useSessionSearch.js +19 -18
- package/dist/chat/testing/fixture-composer-host.d.ts +3 -1
- package/dist/chat/testing/fixture-composer-host.js +1 -0
- package/dist/chat/transcript/FileChip.js +28 -0
- package/dist/chat/transcript/LazyRow.d.ts +1 -1
- package/dist/chat/transcript/LazyRow.js +3 -4
- package/dist/chat/transcript/PromptEcho.js +18 -13
- package/dist/chat/transcript/PromptOriginLabel.d.ts +1 -1
- package/dist/chat/transcript/SessionChip.d.ts +11 -0
- package/dist/chat/transcript/SessionChip.js +34 -0
- package/dist/chat/transcript/TranscriptRail.d.ts +4 -2
- package/dist/chat/transcript/TranscriptRail.js +12 -2
- package/dist/chat/transcript/TranscriptRow.js +1 -0
- package/dist/chat/transcript/badges.d.ts +1 -0
- package/dist/chat/transcript/badges.js +1 -0
- package/dist/chat/transcript/chip-details.d.ts +11 -0
- package/dist/chat/transcript/chip-details.js +17 -1
- package/dist/chat/transcript/fold-worker.js +2 -1
- package/dist/chat/transcript/fold.js +13 -4
- package/dist/chat/transcript/index.d.ts +3 -3
- package/dist/chat/transcript/index.js +3 -3
- package/dist/chat/transcript/inline-facts.d.ts +9 -0
- package/dist/chat/transcript/inline-facts.js +20 -0
- package/dist/chat/transcript/markdown-cache.d.ts +10 -1
- package/dist/chat/transcript/markdown-cache.js +37 -4
- package/dist/chat/transcript/markdown.js +27 -34
- package/dist/chat/transcript/media-gallery.js +13 -16
- package/dist/chat/transcript/messages.js +5 -4
- package/dist/chat/transcript/notices.d.ts +25 -3
- package/dist/chat/transcript/notices.js +136 -17
- package/dist/chat/transcript/prompt.d.ts +1 -1
- package/dist/chat/transcript/prompt.js +8 -1
- package/dist/chat/transcript/row-mount.d.ts +27 -8
- package/dist/chat/transcript/row-mount.js +114 -80
- package/dist/chat/transcript/row-parking.d.ts +27 -0
- package/dist/chat/transcript/row-parking.js +37 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/tasks.d.ts +1 -1
- package/dist/chat/transcript/tasks.js +1 -1
- package/dist/chat/transcript/tool-parts.js +0 -1
- package/dist/chat/transcript/tool-row.js +3 -2
- package/dist/chat/transcript/use-transcript-rows.d.ts +1 -1
- package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
- package/dist/chat/transcript/useHistoryBackfill.js +170 -0
- package/dist/chat/transcript/useTranscriptFind.js +2 -4
- package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
- package/dist/chat/transcript/useTranscriptScroll.js +12 -1
- package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
- package/dist/chat/transcript/useTranscriptSearch.js +6 -6
- package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
- package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
- package/dist/code/editor/FileTree.d.ts +2 -0
- package/dist/code/editor/FileTree.js +1 -1
- package/dist/code/editor/FileView.js +16 -27
- package/dist/code/editor/find/useFind.js +17 -17
- package/dist/code/editor/useCodeDocument.js +22 -19
- package/dist/code/editor/useDetachCleanup.js +4 -3
- package/dist/code/use-highlighted-html.js +12 -13
- package/dist/components/Form.d.ts +28 -1
- package/dist/components/Form.js +43 -7
- package/dist/components/HelpTip.d.ts +22 -0
- package/dist/components/HelpTip.js +26 -0
- package/dist/components/IconButton.d.ts +3 -1
- package/dist/components/IconButton.js +7 -2
- package/dist/components/IconButtonTip.d.ts +3 -1
- package/dist/components/IconButtonTip.js +2 -1
- package/dist/components/Menu.js +1 -1
- package/dist/components/Notice.d.ts +6 -4
- package/dist/components/Notice.js +73 -27
- package/dist/components/Progress.js +10 -4
- package/dist/components/RowActionsMenu.js +7 -14
- package/dist/components/SearchField.d.ts +46 -0
- package/dist/components/SearchField.js +50 -0
- package/dist/components/ShowMore.d.ts +48 -0
- package/dist/components/ShowMore.js +57 -0
- package/dist/components/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip.js +16 -11
- package/dist/components/assign-ref.d.ts +8 -0
- package/dist/components/assign-ref.js +12 -0
- package/dist/components/charts/ScatterChart.js +13 -6
- package/dist/components/floating/FloatingSurface.js +4 -4
- package/dist/components/floating/HoverCard.js +32 -14
- package/dist/components/floating/Popover.js +4 -7
- package/dist/components/floating/useAnchoredPosition.d.ts +20 -4
- package/dist/components/floating/useAnchoredPosition.js +44 -10
- package/dist/components/object-key.d.ts +7 -0
- package/dist/components/object-key.js +18 -0
- package/dist/components/palette/PaletteList.d.ts +5 -5
- package/dist/components/palette/PaletteList.js +1 -7
- package/dist/components/palette/PalettePanel.js +18 -12
- package/dist/components/palette/palette-layout.d.ts +5 -1
- package/dist/components/palette/palette-layout.js +13 -10
- package/dist/components/tooltip-arming.d.ts +3 -0
- package/dist/components/tooltip-arming.js +8 -1
- package/dist/core.css +45 -20
- package/dist/dist/index-BmO8bRgK.d.ts +1 -0
- package/dist/dist/{index-C6-t1SS9.d.ts → index-Bsp5Ku7r.d.ts} +264 -133
- package/dist/dist/index.d.ts +5 -5
- package/dist/dist/sandbox-Bzg_jJK2.d.ts +2 -0
- package/dist/dist/{timeout-CmTx6V9y.d.ts → timeout-NoG7ppkm.d.ts} +1 -1
- package/dist/files/FilesProvider.d.ts +2 -0
- package/dist/files/FilesProvider.js +5 -1
- package/dist/files/FilesTab.js +0 -1
- package/dist/files/TreeColumn.d.ts +2 -4
- package/dist/files/TreeColumn.js +0 -5
- package/dist/files/headless/host.d.ts +9 -9
- package/dist/files/headless/labels.d.ts +0 -1
- package/dist/files/headless/labels.js +0 -1
- package/dist/files/headless/workspace-diff.js +1 -1
- package/dist/files/index.d.ts +2 -2
- package/dist/files/index.js +2 -2
- package/dist/files/useCodeReview.js +1 -3
- package/dist/files/useFilesDiagnostics.d.ts +1 -1
- package/dist/files/useFilesDiagnostics.js +4 -11
- package/dist/files/useOpenFiles.js +9 -12
- package/dist/files/useWorkspace.d.ts +5 -7
- package/dist/files/useWorkspace.js +4 -15
- package/dist/git/GitBar.js +13 -5
- package/dist/git/MoveSessionDialog.d.ts +18 -8
- package/dist/git/MoveSessionDialog.js +39 -57
- package/dist/git/MoveToDialog.d.ts +63 -0
- package/dist/git/MoveToDialog.js +267 -0
- package/dist/git/SandboxManager.js +9 -4
- package/dist/git/SyncChip.js +11 -4
- package/dist/git/TeleportSessionDialog.d.ts +76 -0
- package/dist/git/TeleportSessionDialog.js +596 -0
- package/dist/git/WherePicker.js +4 -1
- package/dist/git/headless/host.d.ts +14 -0
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +52 -1
- package/dist/git/headless/labels.js +58 -0
- package/dist/git/headless/sandboxes.d.ts +1 -1
- package/dist/git/headless/sandboxes.js +4 -3
- package/dist/git/headless/teleport.d.ts +76 -0
- package/dist/git/headless/teleport.js +19 -0
- package/dist/git/index.d.ts +5 -3
- package/dist/git/index.js +5 -3
- package/dist/git/useEnvironmentChoices.d.ts +24 -2
- package/dist/git/useEnvironmentChoices.js +43 -11
- package/dist/hooks/useLastCount.d.ts +9 -0
- package/dist/hooks/useLastCount.js +29 -0
- package/dist/hooks/useLatest.d.ts +8 -0
- package/dist/hooks/useLatest.js +17 -0
- package/dist/hooks/useMinuteTick.d.ts +6 -2
- package/dist/hooks/useMinuteTick.js +12 -6
- package/dist/hooks/useNearViewport.js +11 -8
- package/dist/index.d.ts +8 -3
- package/dist/index.js +8 -3
- package/dist/keybindings/KeybindingsProvider.js +3 -4
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +18 -0
- package/dist/keybindings/headless/overrides.d.ts +1 -1
- package/dist/keybindings/headless/overrides.js +14 -3
- package/dist/labels.d.ts +7 -0
- package/dist/labels.js +10 -3
- package/dist/machines/AddMachineDialog.js +1 -1
- package/dist/machines/AddServerForm.d.ts +14 -2
- package/dist/machines/AddServerForm.js +198 -30
- package/dist/machines/Banners.d.ts +2 -2
- package/dist/machines/Banners.js +3 -3
- package/dist/machines/DaemonMenu.js +1 -3
- package/dist/machines/HostCapabilities.js +8 -4
- package/dist/machines/HostSignIn.d.ts +2 -1
- package/dist/machines/HostSignIn.js +1 -0
- package/dist/machines/HostSyncPanel.d.ts +4 -1
- package/dist/machines/HostSyncPanel.js +248 -132
- package/dist/machines/HostsSection.d.ts +2 -2
- package/dist/machines/HostsSection.js +94 -51
- package/dist/machines/LinkedAccountsPanel.d.ts +29 -0
- package/dist/machines/LinkedAccountsPanel.js +268 -0
- package/dist/machines/MachinesExplainer.d.ts +4 -4
- package/dist/machines/MachinesExplainer.js +27 -17
- package/dist/machines/OrganizationPanel.d.ts +32 -0
- package/dist/machines/OrganizationPanel.js +553 -0
- package/dist/machines/ProjectsSpendPanel.d.ts +22 -0
- package/dist/machines/ProjectsSpendPanel.js +160 -0
- package/dist/machines/ServerMachinesPanel.js +19 -4
- package/dist/machines/ServerUpdatePanel.js +3 -3
- package/dist/machines/SyncAccounts.d.ts +14 -7
- package/dist/machines/SyncAccounts.js +67 -81
- package/dist/machines/TokensPanel.js +54 -30
- package/dist/machines/headless/fixture-host.d.ts +15 -0
- package/dist/machines/headless/fixture-host.js +75 -0
- package/dist/machines/headless/fixtures.d.ts +12 -0
- package/dist/machines/headless/fixtures.js +71 -1
- package/dist/machines/headless/host.d.ts +25 -1
- package/dist/machines/headless/index.d.ts +3 -1
- package/dist/machines/headless/index.js +3 -1
- package/dist/machines/headless/labels.d.ts +104 -8
- package/dist/machines/headless/labels.js +121 -21
- package/dist/machines/headless/linked-accounts.d.ts +42 -0
- package/dist/machines/headless/linked-accounts.js +31 -0
- package/dist/machines/headless/organization.d.ts +44 -0
- package/dist/machines/headless/organization.js +54 -0
- package/dist/machines/headless/sync.d.ts +2 -0
- package/dist/machines/index.d.ts +4 -1
- package/dist/machines/index.js +4 -1
- package/dist/machines/sync-rows.d.ts +8 -0
- package/dist/machines/sync-rows.js +10 -0
- package/dist/machines/testing/index.d.ts +3 -3
- package/dist/machines/testing/index.js +2 -2
- package/dist/motion/grow.js +12 -13
- package/dist/motion/swap.js +2 -5
- package/dist/motion/use-flip-list.d.ts +14 -0
- package/dist/motion/use-flip-list.js +17 -12
- package/dist/onboarding/demos/extensions.d.ts +4 -0
- package/dist/onboarding/demos/extensions.js +27 -1
- package/dist/onboarding/demos/sidebar-layout.d.ts +4 -2
- package/dist/onboarding/demos/sidebar-layout.js +5 -2
- package/dist/onboarding/headless/labels.d.ts +9 -0
- package/dist/onboarding/headless/labels.js +2 -0
- package/dist/onboarding/steps/SidebarStep.js +4 -2
- package/dist/onboarding/steps/setting-cards.d.ts +4 -2
- package/dist/onboarding/steps/setting-cards.js +3 -2
- package/dist/palette/PaletteDialog.js +4 -4
- package/dist/palette/PaletteRows.js +34 -16
- package/dist/palette/headless/app-sources.js +40 -1
- package/dist/palette/headless/labels.js +5 -2
- package/dist/palette/usePaletteController.js +4 -8
- package/dist/server/sse-handler.js +25 -2
- package/dist/session/ArtifactsPanel.js +11 -23
- package/dist/session/DiffFileTree.js +1 -4
- package/dist/session/NewProjectDialog.d.ts +33 -0
- package/dist/session/NewProjectDialog.js +216 -0
- package/dist/session/OpenProjectsDialog.d.ts +56 -0
- package/dist/session/OpenProjectsDialog.js +324 -0
- package/dist/session/OpenSessionsDialog.d.ts +46 -0
- package/dist/session/OpenSessionsDialog.js +295 -0
- package/dist/session/PlanTracker.js +1 -2
- package/dist/session/ProjectArtifactsHome.d.ts +42 -0
- package/dist/session/ProjectArtifactsHome.js +98 -0
- package/dist/session/ProjectArtifactsSection.d.ts +13 -0
- package/dist/session/ProjectArtifactsSection.js +367 -0
- package/dist/session/ProjectBudgetsSection.d.ts +7 -0
- package/dist/session/ProjectBudgetsSection.js +377 -0
- package/dist/session/ProjectContextSection.d.ts +20 -0
- package/dist/session/ProjectContextSection.js +139 -0
- package/dist/session/ProjectHome.d.ts +32 -5
- package/dist/session/ProjectHome.js +502 -254
- package/dist/session/ProjectInstructionsSection.d.ts +7 -0
- package/dist/session/ProjectInstructionsSection.js +179 -0
- package/dist/session/ProjectMainButton.d.ts +35 -0
- package/dist/session/ProjectMainButton.js +73 -0
- package/dist/session/ProjectName.d.ts +76 -0
- package/dist/session/ProjectName.js +140 -0
- package/dist/session/ProjectOrchestratorSection.d.ts +14 -0
- package/dist/session/ProjectOrchestratorSection.js +117 -0
- package/dist/session/ProjectPublishDialog.d.ts +30 -0
- package/dist/session/ProjectPublishDialog.js +420 -0
- package/dist/session/ProjectSessionAccessSection.d.ts +13 -0
- package/dist/session/ProjectSessionAccessSection.js +109 -0
- package/dist/session/ProjectSessionsList.d.ts +53 -0
- package/dist/session/ProjectSessionsList.js +316 -0
- package/dist/session/ProjectSettingsDialog.d.ts +30 -0
- package/dist/session/ProjectSettingsDialog.js +693 -0
- package/dist/session/ProjectShareDialog.d.ts +36 -0
- package/dist/session/ProjectShareDialog.js +190 -0
- package/dist/session/ProjectSkillsSection.d.ts +7 -0
- package/dist/session/ProjectSkillsSection.js +197 -0
- package/dist/session/ProjectToolsSection.d.ts +16 -0
- package/dist/session/ProjectToolsSection.js +347 -0
- package/dist/session/ProjectUsage.d.ts +61 -0
- package/dist/session/ProjectUsage.js +344 -0
- package/dist/session/ProviderUsageProvider.d.ts +2 -3
- package/dist/session/QueueTab.js +11 -1
- package/dist/session/RemindersPanel.js +10 -12
- package/dist/session/SecretsPanel.js +2 -1
- package/dist/session/SessionAccessNotice.d.ts +31 -0
- package/dist/session/SessionAccessNotice.js +69 -0
- package/dist/session/SessionDetailsDialog.d.ts +3 -1
- package/dist/session/SessionDetailsDialog.js +16 -1
- package/dist/session/SessionHeader.d.ts +10 -3
- package/dist/session/SessionHeader.js +19 -7
- package/dist/session/SessionPeopleStack.d.ts +24 -0
- package/dist/session/SessionPeopleStack.js +99 -0
- package/dist/session/SessionPlaceMenu.js +7 -6
- package/dist/session/SessionProvider.d.ts +13 -1
- package/dist/session/SessionProvider.js +21 -1
- package/dist/session/ShareSessionDialog.d.ts +32 -0
- package/dist/session/ShareSessionDialog.js +241 -0
- package/dist/session/TypingLine.d.ts +27 -0
- package/dist/session/TypingLine.js +42 -0
- package/dist/session/{UsagePanel.d.ts → UsageSection.d.ts} +9 -13
- package/dist/session/{UsagePanel.js → UsageSection.js} +40 -41
- package/dist/session/artifact-row-parts.d.ts +32 -0
- package/dist/session/artifact-row-parts.js +51 -0
- package/dist/session/headless/access.d.ts +33 -0
- package/dist/session/headless/access.js +48 -0
- package/dist/session/headless/fixture-host.d.ts +48 -9
- package/dist/session/headless/fixture-host.js +139 -1
- package/dist/session/headless/fixture-project-artifacts.d.ts +77 -0
- package/dist/session/headless/fixture-project-artifacts.js +168 -0
- package/dist/session/headless/fixture-project-content.d.ts +67 -0
- package/dist/session/headless/fixture-project-content.js +176 -0
- package/dist/session/headless/fixture-projects.d.ts +175 -0
- package/dist/session/headless/fixture-projects.js +498 -0
- package/dist/session/headless/home-layout.d.ts +18 -2
- package/dist/session/headless/home-layout.js +20 -7
- package/dist/session/headless/host.d.ts +302 -7
- package/dist/session/headless/index.d.ts +11 -4
- package/dist/session/headless/index.js +9 -2
- package/dist/session/headless/labels.d.ts +428 -4
- package/dist/session/headless/labels.js +109 -5
- package/dist/session/headless/orchestration-labels.d.ts +52 -0
- package/dist/session/headless/orchestration-labels.js +59 -0
- package/dist/session/headless/people.d.ts +29 -0
- package/dist/session/headless/people.js +53 -0
- package/dist/session/headless/place.d.ts +5 -0
- package/dist/session/headless/place.js +5 -1
- package/dist/session/headless/project-artifact-labels.d.ts +67 -0
- package/dist/session/headless/project-artifact-labels.js +96 -0
- package/dist/session/headless/project-artifacts.d.ts +124 -0
- package/dist/session/headless/project-artifacts.js +271 -0
- package/dist/session/headless/project-content-labels.d.ts +88 -0
- package/dist/session/headless/project-content-labels.js +152 -0
- package/dist/session/headless/project-labels.d.ts +123 -0
- package/dist/session/headless/project-labels.js +128 -0
- package/dist/session/headless/project-sessions.d.ts +37 -0
- package/dist/session/headless/project-sessions.js +57 -0
- package/dist/session/headless/project-usage-labels.d.ts +74 -0
- package/dist/session/headless/project-usage-labels.js +81 -0
- package/dist/session/headless/project-usage.d.ts +65 -0
- package/dist/session/headless/project-usage.js +92 -0
- package/dist/session/headless/projects.d.ts +158 -0
- package/dist/session/headless/projects.js +301 -0
- package/dist/session/headless/pushed-once.d.ts +22 -0
- package/dist/session/headless/pushed-once.js +28 -0
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/typing.d.ts +56 -0
- package/dist/session/headless/typing.js +115 -0
- package/dist/session/home-block-parts.d.ts +40 -0
- package/dist/session/home-block-parts.js +46 -0
- package/dist/session/index.d.ts +21 -4
- package/dist/session/index.js +20 -3
- package/dist/session/modal-shell.d.ts +1 -1
- package/dist/session/modal-shell.js +1 -1
- package/dist/session/project-artifact-parts.d.ts +59 -0
- package/dist/session/project-artifact-parts.js +222 -0
- package/dist/session/project-content-parts.d.ts +176 -0
- package/dist/session/project-content-parts.js +546 -0
- package/dist/session/project-files.d.ts +48 -0
- package/dist/session/project-files.js +54 -0
- package/dist/session/project-folder-actions.d.ts +11 -0
- package/dist/session/project-folder-actions.js +39 -0
- package/dist/session/project-mcp-add.d.ts +23 -0
- package/dist/session/project-mcp-add.js +107 -0
- package/dist/session/project-record-document.d.ts +48 -0
- package/dist/session/project-record-document.js +225 -0
- package/dist/session/project-settings-parts.d.ts +69 -0
- package/dist/session/project-settings-parts.js +90 -0
- package/dist/session/share-people.d.ts +222 -0
- package/dist/session/share-people.js +457 -0
- package/dist/session/testing/contract.d.ts +67 -8
- package/dist/session/testing/contract.js +343 -6
- package/dist/session/testing/index.d.ts +5 -2
- package/dist/session/testing/index.js +4 -1
- package/dist/session/testing/project-artifacts.contract.js +159 -0
- package/dist/session/testing/project-content.contract.d.ts +19 -0
- package/dist/session/testing/project-content.contract.js +221 -0
- package/dist/session/testing/project-sessions.contract.js +134 -0
- package/dist/session/use-folder-missing.d.ts +6 -0
- package/dist/session/use-folder-missing.js +31 -0
- package/dist/session/use-folder-project.d.ts +14 -0
- package/dist/session/use-folder-project.js +37 -0
- package/dist/session/use-home-projects.d.ts +48 -0
- package/dist/session/use-home-projects.js +118 -0
- package/dist/session/use-project-home-layout.d.ts +33 -0
- package/dist/session/use-project-home-layout.js +134 -0
- package/dist/session/use-project-home-on.d.ts +2 -0
- package/dist/session/use-project-home-on.js +14 -0
- package/dist/settings/SettingCard.d.ts +3 -1
- package/dist/settings/SettingCard.js +2 -1
- package/dist/settings/SettingDemo.d.ts +3 -1
- package/dist/settings/SettingDemo.js +4 -3
- package/dist/settings/SettingsShell.d.ts +2 -1
- package/dist/settings/SettingsShell.js +55 -43
- package/dist/settings/headless/index.d.ts +2 -1
- package/dist/settings/headless/index.js +2 -1
- package/dist/settings/headless/mcp-requirement.d.ts +93 -0
- package/dist/settings/headless/mcp-requirement.js +116 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/headless/sections-host.d.ts +7 -2
- package/dist/settings/index.d.ts +3 -2
- package/dist/settings/index.js +5 -4
- package/dist/settings/section.d.ts +24 -3
- package/dist/settings/section.js +27 -4
- package/dist/settings/sections/editor/labels.js +1 -1
- package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +6 -2
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +10 -1
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +1 -0
- package/dist/settings/sections/extensions/ExtensionsSection.d.ts +6 -3
- package/dist/settings/sections/extensions/ExtensionsSection.js +24 -3
- package/dist/settings/sections/extensions/McpRequirementRow.d.ts +45 -0
- package/dist/settings/sections/extensions/McpRequirementRow.js +298 -0
- package/dist/settings/sections/extensions/labels.d.ts +4 -0
- package/dist/settings/sections/extensions/labels.js +4 -0
- package/dist/settings/sections/extensions/options-labels.d.ts +39 -0
- package/dist/settings/sections/extensions/options-labels.js +48 -1
- package/dist/settings/sections/extensions/use-mcp-setup.d.ts +6 -0
- package/dist/settings/sections/extensions/use-mcp-setup.js +41 -0
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +3 -0
- package/dist/settings/sections/index.d.ts +4 -3
- package/dist/settings/sections/index.js +4 -3
- package/dist/settings/sections/instructions/InstructionsSection.d.ts +69 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +181 -109
- package/dist/settings/sections/keybindings/labels.d.ts +3 -0
- package/dist/settings/sections/keybindings/labels.js +3 -0
- package/dist/settings/sections/keybindings/rows.js +12 -0
- package/dist/settings/sections/logs/LogsSection.js +5 -8
- package/dist/settings/sections/mcp/McpAddForm.d.ts +9 -2
- package/dist/settings/sections/mcp/McpAddForm.js +15 -7
- package/dist/settings/sections/mcp/McpServerRow.js +7 -47
- package/dist/settings/sections/mcp/McpSignIn.d.ts +38 -0
- package/dist/settings/sections/mcp/McpSignIn.js +72 -0
- package/dist/settings/sections/mcp/labels.js +1 -1
- package/dist/settings/sections/models/AgentDefaults.d.ts +12 -4
- package/dist/settings/sections/models/AgentDefaults.js +102 -70
- package/dist/settings/sections/models/ModelPickField.d.ts +10 -1
- package/dist/settings/sections/models/ModelPickField.js +87 -39
- package/dist/settings/sections/models/labels.d.ts +8 -0
- package/dist/settings/sections/models/labels.js +8 -0
- package/dist/settings/sections/performance/labels.js +2 -2
- package/dist/settings/sections/providers/ServerSignIn.d.ts +6 -1
- package/dist/settings/sections/providers/ServerSignIn.js +66 -61
- package/dist/settings/sections/skills/SkillList.d.ts +45 -0
- package/dist/settings/sections/skills/SkillList.js +58 -40
- package/dist/settings/server-app.d.ts +2 -0
- package/dist/settings/server-app.js +16 -4
- package/dist/styles.css +154 -36
- package/dist/terminal/HostTerminalSurface.js +28 -30
- package/dist/terminal/TerminalPanel.js +4 -12
- package/dist/terminal/TerminalProvider.d.ts +10 -2
- package/dist/terminal/TerminalProvider.js +10 -2
- package/dist/terminal/headless/labels.d.ts +0 -1
- package/dist/terminal/headless/labels.js +1 -2
- package/dist/terminal/headless/store.js +5 -1
- package/dist/theme/runtime-icons.js +7 -3
- package/dist/workspace/LayoutBudget.js +1 -7
- package/dist/workspace/PanelContentView.js +1 -1
- package/package.json +26 -2
- package/src/styles/app.css +6 -3
- package/src/styles/chat.css +3 -1
- package/src/styles/palette.css +15 -19
- package/src/styles/primitives.css +3 -1
- package/src/styles/transcript.css +39 -3
- package/dist/dist/index-De9AbmxS.d.ts +0 -1
- package/dist/dist/sandbox-CSUihARm.d.ts +0 -2
- /package/dist/dist/{execution-failure-SREfl-EZ.d.ts → execution-failure-_L2r_Qd-.d.ts} +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { buttonClass } from "../components/button.js";
|
|
2
|
+
import { Facts, FormSection, MetaChip, RowText } from "../components/Form.js";
|
|
3
|
+
import { Notice } from "../components/Notice.js";
|
|
4
|
+
import { numberFormats } from "../components/numbers.js";
|
|
5
|
+
import { errorMessage } from "../components/report-error.js";
|
|
6
|
+
import { Segmented } from "../components/Segmented.js";
|
|
7
|
+
import { ShowMoreButton, useShowMore } from "../components/ShowMore.js";
|
|
8
|
+
import { Skeleton } from "../components/Skeleton.js";
|
|
9
|
+
import { formatUsd } from "../session/headless/project-usage.js";
|
|
10
|
+
import { useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
11
|
+
import { useEffect, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
// src/machines/ProjectsSpendPanel.tsx
|
|
14
|
+
/**
|
|
15
|
+
* Renders the server's spend by project for an admin.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The {@link ProjectsSpendPanelProps}.
|
|
18
|
+
*/
|
|
19
|
+
function ProjectsSpendPanel(props) {
|
|
20
|
+
const organization = useMachinesHost().organization;
|
|
21
|
+
if (!organization?.projectsSpend || props.host.status !== "connected") return null;
|
|
22
|
+
return /* @__PURE__ */ jsx(SpendBody, {
|
|
23
|
+
...props,
|
|
24
|
+
organization,
|
|
25
|
+
read: organization.projectsSpend
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const NO_ROWS = [];
|
|
29
|
+
function SpendBody({ host, organization, read, className, style }) {
|
|
30
|
+
const labels = useMachinesLabels();
|
|
31
|
+
const [range, setRange] = useState("month");
|
|
32
|
+
const [rows, setRows] = useState(null);
|
|
33
|
+
const [admin, setAdmin] = useState(false);
|
|
34
|
+
const [reads, setReads] = useState(0);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
let live = true;
|
|
37
|
+
organization.status(host.id).then(async (status) => {
|
|
38
|
+
const can = status.mode === "on" && status.role === "admin" && status.spend === true;
|
|
39
|
+
if (!live) return;
|
|
40
|
+
setAdmin(can);
|
|
41
|
+
if (can) {
|
|
42
|
+
const found = await read(host.id, range);
|
|
43
|
+
if (live) setRows(found);
|
|
44
|
+
}
|
|
45
|
+
}).catch((err) => live && setRows({ detail: errorMessage(err) }));
|
|
46
|
+
return () => {
|
|
47
|
+
live = false;
|
|
48
|
+
};
|
|
49
|
+
}, [
|
|
50
|
+
organization,
|
|
51
|
+
read,
|
|
52
|
+
host.id,
|
|
53
|
+
range,
|
|
54
|
+
reads
|
|
55
|
+
]);
|
|
56
|
+
const list = rows !== null && !("detail" in rows) ? rows : NO_ROWS;
|
|
57
|
+
const { shown, hidden, more } = useShowMore(list);
|
|
58
|
+
if (!admin && !(rows !== null && "detail" in rows)) return null;
|
|
59
|
+
const nf = numberFormats();
|
|
60
|
+
const failed = rows !== null && "detail" in rows;
|
|
61
|
+
const total = list.reduce((sum, row) => sum + row.totals.costUsd, 0);
|
|
62
|
+
return /* @__PURE__ */ jsxs(FormSection, {
|
|
63
|
+
title: labels.machinesSpendTitle,
|
|
64
|
+
trailing: /* @__PURE__ */ jsx(Segmented, {
|
|
65
|
+
size: "sm",
|
|
66
|
+
ariaLabel: labels.machinesSpendRange,
|
|
67
|
+
value: range,
|
|
68
|
+
onChange: setRange,
|
|
69
|
+
options: [{
|
|
70
|
+
value: "today",
|
|
71
|
+
label: labels.machinesSpendToday
|
|
72
|
+
}, {
|
|
73
|
+
value: "month",
|
|
74
|
+
label: labels.machinesSpendMonth
|
|
75
|
+
}]
|
|
76
|
+
}),
|
|
77
|
+
...className ? { className } : {},
|
|
78
|
+
...style ? { style } : {},
|
|
79
|
+
children: [
|
|
80
|
+
rows === null && /* @__PURE__ */ jsx("span", {
|
|
81
|
+
role: "status",
|
|
82
|
+
"aria-busy": "true",
|
|
83
|
+
"aria-label": labels.machinesSpendTitle,
|
|
84
|
+
className: "flex items-center gap-3 px-3 py-2",
|
|
85
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
86
|
+
width: 200,
|
|
87
|
+
height: 12
|
|
88
|
+
})
|
|
89
|
+
}),
|
|
90
|
+
rows && "detail" in rows && /* @__PURE__ */ jsx(Notice, {
|
|
91
|
+
tone: "error",
|
|
92
|
+
detail: rows.detail,
|
|
93
|
+
className: "mx-3 my-2",
|
|
94
|
+
action: /* @__PURE__ */ jsx("button", {
|
|
95
|
+
type: "button",
|
|
96
|
+
className: buttonClass({
|
|
97
|
+
variant: "secondary",
|
|
98
|
+
size: "sm"
|
|
99
|
+
}),
|
|
100
|
+
onClick: () => {
|
|
101
|
+
setRows(null);
|
|
102
|
+
setReads((n) => n + 1);
|
|
103
|
+
},
|
|
104
|
+
children: labels.machinesRetry
|
|
105
|
+
}),
|
|
106
|
+
children: labels.machinesSpendLoadFailed
|
|
107
|
+
}),
|
|
108
|
+
rows !== null && !failed && list.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
109
|
+
className: "flex items-center gap-3 px-3 py-2",
|
|
110
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
111
|
+
className: "text-[var(--zg-text-muted)]",
|
|
112
|
+
children: labels.machinesSpendEmpty
|
|
113
|
+
})
|
|
114
|
+
}),
|
|
115
|
+
list.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
116
|
+
role: "list",
|
|
117
|
+
"aria-label": labels.machinesSpendTitle,
|
|
118
|
+
className: "contents",
|
|
119
|
+
children: [
|
|
120
|
+
shown.map((row) => {
|
|
121
|
+
const budget = row.budgets.find((state) => state.scope.kind === "project" && state.scope.period === (range === "today" ? "day" : "month"));
|
|
122
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
123
|
+
role: "listitem",
|
|
124
|
+
className: "flex items-center gap-3 px-3 py-2",
|
|
125
|
+
"data-budget-level": budget?.level,
|
|
126
|
+
children: [/* @__PURE__ */ jsx(RowText, {
|
|
127
|
+
label: row.name ?? labels.machinesSpendUnnamed,
|
|
128
|
+
description: /* @__PURE__ */ jsx(Facts, {
|
|
129
|
+
className: "zg-meta",
|
|
130
|
+
facts: [labels.machinesSpendTokens(nf.compact(row.totals.input + row.totals.output + row.totals.cacheRead + row.totals.cacheCreation)), labels.machinesSpendToolCalls(row.totals.toolCalls)]
|
|
131
|
+
})
|
|
132
|
+
}), /* @__PURE__ */ jsx(MetaChip, {
|
|
133
|
+
tone: budget?.level === "reached" ? "danger" : budget?.level === "warn" ? "warn" : "text",
|
|
134
|
+
className: "shrink-0",
|
|
135
|
+
children: budget ? labels.machinesSpendOfBudget(formatUsd(row.totals.costUsd), formatUsd(budget.limitUsd)) : formatUsd(row.totals.costUsd)
|
|
136
|
+
})]
|
|
137
|
+
}, row.projectId);
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ jsx(ShowMoreButton, {
|
|
140
|
+
hidden,
|
|
141
|
+
onMore: more,
|
|
142
|
+
className: "px-3"
|
|
143
|
+
}),
|
|
144
|
+
/* @__PURE__ */ jsxs("div", {
|
|
145
|
+
className: "flex items-center gap-3 px-3 py-2",
|
|
146
|
+
"data-testid": "projects-spend-total",
|
|
147
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
148
|
+
className: "flex-1 min-w-0 text-sm text-[var(--zg-text-muted)]",
|
|
149
|
+
children: labels.machinesSpendTotal
|
|
150
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
151
|
+
className: "zg-meta shrink-0 px-1.5 !text-[var(--zg-text)]",
|
|
152
|
+
children: formatUsd(total)
|
|
153
|
+
})]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
export { ProjectsSpendPanel };
|
|
@@ -4,6 +4,8 @@ import { Popover } from "../components/floating/Popover.js";
|
|
|
4
4
|
import { FormSection, MetaChip, OpLine, ROW_CLASS } from "../components/Form.js";
|
|
5
5
|
import { IconButton } from "../components/IconButton.js";
|
|
6
6
|
import { RowMenuButton } from "../components/RowMenuButton.js";
|
|
7
|
+
import { ShowMoreButton, useShowMore } from "../components/ShowMore.js";
|
|
8
|
+
import { useTooltip } from "../components/Tooltip.js";
|
|
7
9
|
import { AddMachineDialog, useAddMachine } from "./AddMachineDialog.js";
|
|
8
10
|
import { machinesError } from "./headless/host.js";
|
|
9
11
|
import { linkStateText } from "./headless/messages.js";
|
|
@@ -57,6 +59,7 @@ function MachineRow({ machine, serverVersion, now, onNewChat, onForget }) {
|
|
|
57
59
|
const online = machine.status === "online";
|
|
58
60
|
const skew = machineVersionDiffers(machine.version, serverVersion);
|
|
59
61
|
const gpus = machine.capabilities?.gpu ?? [];
|
|
62
|
+
const foldersTip = useTooltip(machine.roots.map((root) => root.path).join("\n"), { maxWidth: 420 });
|
|
60
63
|
const [first, ...more] = machine.roots.map((root) => root.path);
|
|
61
64
|
const items = [...onNewChat ? [{
|
|
62
65
|
id: "chat",
|
|
@@ -113,10 +116,11 @@ function MachineRow({ machine, serverVersion, now, onNewChat, onForget }) {
|
|
|
113
116
|
children: [labels.machinesFolders, " "]
|
|
114
117
|
}),
|
|
115
118
|
/* @__PURE__ */ jsx("span", {
|
|
119
|
+
...foldersTip.anchorProps,
|
|
116
120
|
className: "truncate zg-meta",
|
|
117
|
-
title: machine.roots.map((root) => root.path).join("\n"),
|
|
118
121
|
children: first
|
|
119
122
|
}),
|
|
123
|
+
foldersTip.tip,
|
|
120
124
|
more.length > 0 && /* @__PURE__ */ jsx(MetaChip, {
|
|
121
125
|
tone: "muted",
|
|
122
126
|
children: labels.machinesFoldersMore(more.length)
|
|
@@ -136,14 +140,20 @@ function HowItWorks() {
|
|
|
136
140
|
ariaLabel: labels.machinesHowItWorks,
|
|
137
141
|
side: "bottom",
|
|
138
142
|
align: "end",
|
|
139
|
-
width:
|
|
143
|
+
width: 480,
|
|
140
144
|
trigger: (triggerProps) => /* @__PURE__ */ jsx(IconButton, {
|
|
141
145
|
...triggerProps,
|
|
142
146
|
icon: "i-ph-question",
|
|
143
147
|
label: labels.machinesHowItWorks,
|
|
144
148
|
size: "sm"
|
|
145
149
|
}),
|
|
146
|
-
children: () => /* @__PURE__ */
|
|
150
|
+
children: () => /* @__PURE__ */ jsxs("div", {
|
|
151
|
+
className: "p-5 space-y-4",
|
|
152
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
153
|
+
className: "m-0 text-sm font-medium text-[var(--zg-text)]",
|
|
154
|
+
children: labels.machinesHowItWorks
|
|
155
|
+
}), /* @__PURE__ */ jsx(MachinesExplainer, {})]
|
|
156
|
+
})
|
|
147
157
|
});
|
|
148
158
|
}
|
|
149
159
|
/**
|
|
@@ -167,6 +177,7 @@ function ServerMachinesPanel({ host, confirm, now, className = "", style }) {
|
|
|
167
177
|
const list = machines && canList ? machines.list(host.id) : null;
|
|
168
178
|
const linkState = useReadable(links ? links.state : NO_LINKS);
|
|
169
179
|
const listState = useReadable(list ? list.state : NO_LIST);
|
|
180
|
+
const machinesShown = useShowMore(listState.machines);
|
|
170
181
|
const share = linkState.shares.find((entry) => entry.hostId === host.id);
|
|
171
182
|
const use = linkState.uses.find((entry) => entry.hostId === host.id);
|
|
172
183
|
const [busy, setBusy] = useState(null);
|
|
@@ -304,13 +315,17 @@ function ServerMachinesPanel({ host, confirm, now, className = "", style }) {
|
|
|
304
315
|
items: serverItems
|
|
305
316
|
})
|
|
306
317
|
}),
|
|
307
|
-
|
|
318
|
+
machinesShown.shown.map((machine) => /* @__PURE__ */ jsx(MachineRow, {
|
|
308
319
|
machine,
|
|
309
320
|
serverVersion: host.serverVersion,
|
|
310
321
|
now,
|
|
311
322
|
...newChat ? { onNewChat: () => newChat(host.id, machine.name) } : {},
|
|
312
323
|
...machines?.forget && canForget ? { onForget: () => void forget(machine) } : {}
|
|
313
324
|
}, machine.id)),
|
|
325
|
+
/* @__PURE__ */ jsx(ShowMoreButton, {
|
|
326
|
+
hidden: machinesShown.hidden,
|
|
327
|
+
onMore: machinesShown.more
|
|
328
|
+
}),
|
|
314
329
|
empty && /* @__PURE__ */ jsxs("div", {
|
|
315
330
|
className: "zg-well rounded-zg-lg p-4 m-1 space-y-3",
|
|
316
331
|
"data-testid": `machines-empty-${host.id}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BTN_SECONDARY } from "../components/button.js";
|
|
2
|
-
import { FormSection, ROW_CLASS, RowText, SwitchRow } from "../components/Form.js";
|
|
2
|
+
import { Facts, FormSection, ROW_CLASS, RowText, SwitchRow } from "../components/Form.js";
|
|
3
3
|
import { Notice } from "../components/Notice.js";
|
|
4
4
|
import { UPDATE_BUSY_STATES, agoText, updateStateLine } from "./headless/messages.js";
|
|
5
5
|
import { useMachinesConfirm, useMachinesHost, useMachinesLabels, usePermitted } from "./MachinesProvider.js";
|
|
@@ -91,11 +91,11 @@ function UpdateBody({ host, updates, store, confirm, className = "", style }) {
|
|
|
91
91
|
"data-testid": `update-status-${host.id}`,
|
|
92
92
|
children: [/* @__PURE__ */ jsx(RowText, {
|
|
93
93
|
label: labels.machinesFactVersion(labels.machinesUpdateVersion(status.current)),
|
|
94
|
-
description: [
|
|
94
|
+
description: /* @__PURE__ */ jsx(Facts, { facts: [
|
|
95
95
|
plainLine ? line.text : null,
|
|
96
96
|
status.updatedFrom ? labels.machinesUpdateFrom(status.updatedFrom) : null,
|
|
97
97
|
checked
|
|
98
|
-
]
|
|
98
|
+
] }),
|
|
99
99
|
truncate: false
|
|
100
100
|
}), ready && manage && install && /* @__PURE__ */ jsx("button", {
|
|
101
101
|
type: "button",
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A server's Sync with
|
|
3
|
-
* has an API key or a sign-in for, one row each, with the server
|
|
4
|
-
*
|
|
2
|
+
* A server's Sync with Model accounts ticked: every provider this computer
|
|
3
|
+
* has an API key or a sign-in for, one row each, with what the server runs it
|
|
4
|
+
* on, in words (`sync.providers`).
|
|
5
5
|
*
|
|
6
6
|
* - An API key is copied when ticked (the Sync section asks first: it is a
|
|
7
7
|
* secret).
|
|
8
8
|
* - A sign-in (OAuth) is never copied: both sides refreshing one grant signs
|
|
9
9
|
* one of them out. "Sign in there" runs the sign-in for the server instead
|
|
10
|
-
* (`HostSignIn`: the browser here, the tokens there)
|
|
10
|
+
* (`HostSignIn`: the browser here, the tokens there), while the server is
|
|
11
|
+
* connected. On an organization server the sign-in is the person's own.
|
|
11
12
|
*/
|
|
12
13
|
import { HostSummary } from "./headless/host.js";
|
|
13
14
|
import { HostSyncAccount } from "./headless/sync.js";
|
|
@@ -25,14 +26,20 @@ export interface SyncAccountsProps {
|
|
|
25
26
|
key: string;
|
|
26
27
|
label: string;
|
|
27
28
|
}) => void;
|
|
29
|
+
/**
|
|
30
|
+
* The server is connected: Sign in there needs it.
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
connected?: boolean;
|
|
28
34
|
/** Extra classes on the root. */
|
|
29
35
|
className?: string;
|
|
30
36
|
/** Inline styles on the root. */
|
|
31
37
|
style?: CSSProperties;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
|
-
* Renders this computer's accounts against the server
|
|
40
|
+
* Renders this computer's model accounts against the server: one row per provider, its name over one plain line
|
|
41
|
+
* that says what the server runs it on, and at most two controls (Copy API key, Sign in there).
|
|
35
42
|
*
|
|
36
|
-
* @param props - The server, the accounts, the copied keys, `onToggleKey`, `className` and `style`.
|
|
43
|
+
* @param props - The server, the accounts, the copied keys, `onToggleKey`, `connected`, `className` and `style`.
|
|
37
44
|
*/
|
|
38
|
-
export declare function SyncAccounts({ host, accounts, keys, onToggleKey, className, style }: SyncAccountsProps): import("react").JSX.Element;
|
|
45
|
+
export declare function SyncAccounts({ host, accounts, keys, onToggleKey, connected, className, style }: SyncAccountsProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BrandMark } from "../components/BrandMark.js";
|
|
2
|
-
import
|
|
2
|
+
import "../components/button.js";
|
|
3
3
|
import { Checkbox } from "../components/Form.js";
|
|
4
4
|
import { HostSignIn } from "./HostSignIn.js";
|
|
5
5
|
import { useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
6
|
-
import {
|
|
6
|
+
import { SYNC_ROW_CLASS } from "./sync-rows.js";
|
|
7
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { providerBrand } from "zidane/chat/pure";
|
|
9
10
|
// src/machines/SyncAccounts.tsx
|
|
@@ -11,9 +12,13 @@ import { providerBrand } from "zidane/chat/pure";
|
|
|
11
12
|
function useServerProviders(hostId) {
|
|
12
13
|
const providers = useMachinesHost().sync?.providers;
|
|
13
14
|
const [list, setList] = useState(null);
|
|
15
|
+
const generation = useRef(0);
|
|
16
|
+
useEffect(() => () => void (generation.current += 1), []);
|
|
14
17
|
const reload = useCallback(async () => {
|
|
15
18
|
if (!providers) return;
|
|
16
|
-
|
|
19
|
+
const mine = ++generation.current;
|
|
20
|
+
const next = await providers(hostId).catch(() => null);
|
|
21
|
+
if (mine === generation.current) setList(next);
|
|
17
22
|
}, [providers, hostId]);
|
|
18
23
|
useEffect(() => {
|
|
19
24
|
reload();
|
|
@@ -24,104 +29,85 @@ function useServerProviders(hostId) {
|
|
|
24
29
|
};
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
|
-
* Renders this computer's accounts against the server
|
|
32
|
+
* Renders this computer's model accounts against the server: one row per provider, its name over one plain line
|
|
33
|
+
* that says what the server runs it on, and at most two controls (Copy API key, Sign in there).
|
|
28
34
|
*
|
|
29
|
-
* @param props - The server, the accounts, the copied keys, `onToggleKey`, `className` and `style`.
|
|
35
|
+
* @param props - The server, the accounts, the copied keys, `onToggleKey`, `connected`, `className` and `style`.
|
|
30
36
|
*/
|
|
31
|
-
function SyncAccounts({ host, accounts, keys, onToggleKey, className = "", style }) {
|
|
37
|
+
function SyncAccounts({ host, accounts, keys, onToggleKey, connected = true, className = "", style }) {
|
|
32
38
|
const labels = useMachinesLabels();
|
|
33
39
|
const canSignIn = Boolean(useMachinesHost().signIn);
|
|
34
40
|
const { providers, reload } = useServerProviders(host.id);
|
|
35
41
|
const [signingIn, setSigningIn] = useState(null);
|
|
36
42
|
if (accounts.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
37
|
-
className: `m-0
|
|
43
|
+
className: `m-0 text-xs text-[var(--zg-text-muted)] ${className}`.trimEnd(),
|
|
38
44
|
style,
|
|
39
45
|
children: labels.machinesSyncNoAccounts
|
|
40
46
|
});
|
|
41
47
|
return /* @__PURE__ */ jsx("ul", {
|
|
42
|
-
className: `m-0 p-0 list-none
|
|
48
|
+
className: `m-0 p-0 list-none flex flex-col gap-2 ${className}`.trimEnd(),
|
|
43
49
|
style,
|
|
44
50
|
"aria-label": labels.machinesSyncAccounts,
|
|
45
51
|
children: accounts.map((account) => {
|
|
46
52
|
const there = providers?.find((p) => p.key === account.key);
|
|
47
53
|
const signedInThere = there?.methods.some((m) => m.source === "oauth") ?? false;
|
|
48
54
|
const copying = keys.includes(account.key);
|
|
55
|
+
const offerSignIn = account.signIns.length > 0 && !signedInThere && there?.oauth === true && canSignIn && connected;
|
|
56
|
+
const status = signedInThere ? labels.machinesSyncSignedInOn(host.name) : copying ? labels.machinesSyncKeyGoesTo(host.name) : there?.configured ? labels.machinesSyncHasItsOwn(host.name) : labels.machinesSyncNotOn(host.name);
|
|
49
57
|
return /* @__PURE__ */ jsxs("li", {
|
|
50
|
-
className: "px-3 py-2",
|
|
51
58
|
"data-testid": `sync-account-${account.key}`,
|
|
52
|
-
children: [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: SYNC_ROW_CLASS,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(BrandMark, {
|
|
63
|
+
brand: providerBrand(account.key),
|
|
64
|
+
label: account.label,
|
|
65
|
+
size: "sm",
|
|
66
|
+
className: "shrink-0"
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ jsxs("span", {
|
|
69
|
+
className: "flex-1 min-w-0 basis-40",
|
|
70
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: "block truncate text-xs font-medium text-[var(--zg-text)]",
|
|
64
72
|
children: account.label
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
children: labels.machinesSyncSignedInThere
|
|
104
|
-
}) : there?.oauth && canSignIn ? /* @__PURE__ */ jsx("button", {
|
|
105
|
-
type: "button",
|
|
106
|
-
className: `${BTN_SECONDARY} !h-6 !px-2 !text-zg-meta`,
|
|
107
|
-
onClick: () => setSigningIn(account.key),
|
|
108
|
-
children: labels.machinesSyncSignInThere
|
|
109
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
110
|
-
className: "text-zg-meta text-[var(--zg-text-subtle)]",
|
|
111
|
-
children: labels.machinesSyncStaysHere
|
|
112
|
-
})
|
|
113
|
-
]
|
|
114
|
-
}, label))]
|
|
115
|
-
}),
|
|
116
|
-
signingIn === account.key && /* @__PURE__ */ jsx(HostSignIn, {
|
|
117
|
-
hostId: host.id,
|
|
118
|
-
hostName: host.name,
|
|
119
|
-
target: { provider: account.key },
|
|
120
|
-
label: account.label,
|
|
121
|
-
onDone: () => void reload(),
|
|
122
|
-
onClose: () => setSigningIn(null)
|
|
123
|
-
})
|
|
124
|
-
]
|
|
73
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: `block truncate text-zg-meta ${signedInThere || !copying && there?.configured ? "text-zg-success" : "text-[var(--zg-text-muted)]"}`,
|
|
75
|
+
"data-testid": "sync-account-status",
|
|
76
|
+
children: status
|
|
77
|
+
})]
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ jsxs("span", {
|
|
80
|
+
className: "flex items-center gap-3 shrink-0 max-sm:basis-full max-sm:pl-7",
|
|
81
|
+
children: [account.apiKey && /* @__PURE__ */ jsxs("button", {
|
|
82
|
+
type: "button",
|
|
83
|
+
role: "checkbox",
|
|
84
|
+
"aria-checked": copying,
|
|
85
|
+
"aria-label": labels.machinesSyncCopyKey(account.label),
|
|
86
|
+
className: "zg-focus-ring inline-flex items-center gap-1.5 h-7 rounded-zg-sm bg-transparent border-0 p-0 text-xs text-[var(--zg-text-muted)] hover:text-[var(--zg-text)] cursor-pointer transition-colors",
|
|
87
|
+
onClick: () => onToggleKey(account),
|
|
88
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
89
|
+
checked: copying,
|
|
90
|
+
className: "!mt-0"
|
|
91
|
+
}), labels.machinesSyncCopyApiKey]
|
|
92
|
+
}), offerSignIn && /* @__PURE__ */ jsx("button", {
|
|
93
|
+
type: "button",
|
|
94
|
+
className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-7 px-2.5 text-zg-label zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
|
|
95
|
+
"aria-label": labels.machinesSyncSignInThereFor(account.label),
|
|
96
|
+
disabled: signingIn === account.key,
|
|
97
|
+
onClick: () => setSigningIn(account.key),
|
|
98
|
+
children: labels.machinesSyncSignInThere
|
|
99
|
+
})]
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
}), signingIn === account.key && /* @__PURE__ */ jsx(HostSignIn, {
|
|
103
|
+
hostId: host.id,
|
|
104
|
+
hostName: host.name,
|
|
105
|
+
target: { provider: account.key },
|
|
106
|
+
label: account.label,
|
|
107
|
+
onDone: () => void reload(),
|
|
108
|
+
onClose: () => setSigningIn(null),
|
|
109
|
+
className: "pl-7 pt-1.5"
|
|
110
|
+
})]
|
|
125
111
|
}, account.key);
|
|
126
112
|
})
|
|
127
113
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BTN_PRIMARY, BTN_SECONDARY, buttonClass } from "../components/button.js";
|
|
2
2
|
import { CopyButton } from "../components/CopyButton.js";
|
|
3
|
-
import { ErrorNote, FormSection, INPUT_CLASS, MetaChip, ROW_CLASS, RowText } from "../components/Form.js";
|
|
3
|
+
import { ErrorNote, Facts, FormSection, INPUT_CLASS, MetaChip, ROW_CLASS, RowText } from "../components/Form.js";
|
|
4
4
|
import { Notice } from "../components/Notice.js";
|
|
5
5
|
import { RowMenuButton } from "../components/RowMenuButton.js";
|
|
6
|
+
import { ShowMoreButton, useShowMore } from "../components/ShowMore.js";
|
|
6
7
|
import { machinesError } from "./headless/host.js";
|
|
7
8
|
import { agoText } from "./headless/messages.js";
|
|
8
9
|
import { HostIcon } from "./HostIcon.js";
|
|
@@ -58,7 +59,7 @@ function TokensBody({ host, tokens, confirm, now, webAppUrl, className = "", sty
|
|
|
58
59
|
setList(await tokens.list(host.id));
|
|
59
60
|
setReadError(null);
|
|
60
61
|
} catch (err) {
|
|
61
|
-
setReadError(labels.machinesError(machinesError("
|
|
62
|
+
setReadError(labels.machinesError(machinesError("read", err)));
|
|
62
63
|
}
|
|
63
64
|
}, [
|
|
64
65
|
tokens,
|
|
@@ -130,11 +131,14 @@ function TokensBody({ host, tokens, confirm, now, webAppUrl, className = "", sty
|
|
|
130
131
|
const browsers = (list ?? []).filter((token) => live(token) && browserName(token) !== null);
|
|
131
132
|
const others = (list ?? []).filter((token) => live(token) && browserName(token) === null);
|
|
132
133
|
const inactive = (list ?? []).filter((token) => !live(token));
|
|
133
|
-
const
|
|
134
|
+
const browsersShown = useShowMore(browsers);
|
|
135
|
+
const othersShown = useShowMore(others);
|
|
136
|
+
const inactiveShown = useShowMore(inactive);
|
|
137
|
+
const facts = (token) => /* @__PURE__ */ jsx(Facts, { facts: [
|
|
134
138
|
token.lastUsedAt ? labels.machinesTokensUsed(agoText(token.lastUsedAt, now, labels)) : labels.machinesTokensNeverUsed,
|
|
135
139
|
labels.machinesTokensCreatedAt(agoText(token.createdAt, now, labels)),
|
|
136
140
|
live(token) && token.expiresAt !== void 0 ? labels.machinesTokensExpires(new Date(token.expiresAt).toLocaleDateString()) : null
|
|
137
|
-
]
|
|
141
|
+
] });
|
|
138
142
|
const tokenRow = (token, browser) => {
|
|
139
143
|
const items = revoke && manage && live(token) ? [{
|
|
140
144
|
id: "revoke",
|
|
@@ -149,7 +153,10 @@ function TokensBody({ host, tokens, confirm, now, webAppUrl, className = "", sty
|
|
|
149
153
|
className: ROW_CLASS,
|
|
150
154
|
"data-testid": `token-${token.id}`,
|
|
151
155
|
children: [
|
|
152
|
-
/* @__PURE__ */ jsx(HostIcon, {
|
|
156
|
+
/* @__PURE__ */ jsx(HostIcon, {
|
|
157
|
+
icon: browser ? "i-ph-browser" : token.scope === "machine" ? "i-ph-desktop-tower" : "i-ph-key",
|
|
158
|
+
className: "self-start"
|
|
159
|
+
}),
|
|
153
160
|
/* @__PURE__ */ jsx(RowText, {
|
|
154
161
|
label: /* @__PURE__ */ jsxs("span", {
|
|
155
162
|
className: `flex items-center gap-1.5 min-w-0 ${live(token) ? "" : "text-[var(--zg-text-muted)]"}`,
|
|
@@ -169,7 +176,8 @@ function TokensBody({ host, tokens, confirm, now, webAppUrl, className = "", sty
|
|
|
169
176
|
})
|
|
170
177
|
]
|
|
171
178
|
}),
|
|
172
|
-
description: facts(token)
|
|
179
|
+
description: facts(token),
|
|
180
|
+
truncate: false
|
|
173
181
|
}),
|
|
174
182
|
/* @__PURE__ */ jsx(RowMenuButton, {
|
|
175
183
|
label: labels.machinesRowActions(browser ?? token.name),
|
|
@@ -238,14 +246,18 @@ function TokensBody({ host, tokens, confirm, now, webAppUrl, className = "", sty
|
|
|
238
246
|
})]
|
|
239
247
|
})]
|
|
240
248
|
}),
|
|
241
|
-
list && browsers.length === 0 && !pairing && /* @__PURE__ */
|
|
249
|
+
list && browsers.length === 0 && !pairing && /* @__PURE__ */ jsxs("div", {
|
|
242
250
|
className: "flex items-center gap-3 px-3 py-2",
|
|
243
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
251
|
+
children: [/* @__PURE__ */ jsx(HostIcon, { icon: "i-ph-browser" }), /* @__PURE__ */ jsx("span", {
|
|
244
252
|
className: "text-xs text-[var(--zg-text-muted)]",
|
|
245
253
|
children: labels.machinesBrowsersEmpty
|
|
246
|
-
})
|
|
254
|
+
})]
|
|
247
255
|
}),
|
|
248
|
-
|
|
256
|
+
browsersShown.shown.map((token) => tokenRow(token, browserName(token))),
|
|
257
|
+
/* @__PURE__ */ jsx(ShowMoreButton, {
|
|
258
|
+
hidden: browsersShown.hidden,
|
|
259
|
+
onMore: browsersShown.more
|
|
260
|
+
})
|
|
249
261
|
]
|
|
250
262
|
}), /* @__PURE__ */ jsxs(FormSection, {
|
|
251
263
|
title: labels.machinesAccessTokensTitle,
|
|
@@ -278,37 +290,49 @@ function TokensBody({ host, tokens, confirm, now, webAppUrl, className = "", sty
|
|
|
278
290
|
children: created.token
|
|
279
291
|
})]
|
|
280
292
|
}),
|
|
281
|
-
list && others.length === 0 && !creating && /* @__PURE__ */
|
|
293
|
+
list && others.length === 0 && !creating && /* @__PURE__ */ jsxs("div", {
|
|
282
294
|
className: "flex items-center gap-3 px-3 py-2",
|
|
283
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
295
|
+
children: [/* @__PURE__ */ jsx(HostIcon, { icon: "i-ph-key" }), /* @__PURE__ */ jsx("span", {
|
|
284
296
|
className: "text-xs text-[var(--zg-text-muted)]",
|
|
285
297
|
children: labels.machinesTokensEmpty
|
|
286
|
-
})
|
|
298
|
+
})]
|
|
287
299
|
}),
|
|
288
300
|
others.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
289
301
|
role: "list",
|
|
290
302
|
"aria-label": labels.machinesTokensList,
|
|
291
303
|
className: "contents",
|
|
292
|
-
children:
|
|
304
|
+
children: othersShown.shown.map((token) => tokenRow(token, null))
|
|
293
305
|
}),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
"
|
|
301
|
-
className:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
/* @__PURE__ */ jsx(ShowMoreButton, {
|
|
307
|
+
hidden: othersShown.hidden,
|
|
308
|
+
onMore: othersShown.more
|
|
309
|
+
}),
|
|
310
|
+
inactive.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
311
|
+
/* @__PURE__ */ jsxs("button", {
|
|
312
|
+
type: "button",
|
|
313
|
+
className: `flex items-center gap-3 px-3 py-2 w-full bg-transparent border-0 text-left cursor-pointer text-xs text-[var(--zg-text-muted)] hover:text-[var(--zg-text)] rounded-zg-md`,
|
|
314
|
+
"aria-expanded": showInactive,
|
|
315
|
+
onClick: () => setShowInactive((open) => !open),
|
|
316
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
317
|
+
"aria-hidden": true,
|
|
318
|
+
className: showInactive ? "i-ph-caret-down" : "i-ph-caret-right"
|
|
319
|
+
}), labels.machinesTokensInactive(inactive.length)]
|
|
320
|
+
}),
|
|
321
|
+
showInactive && /* @__PURE__ */ jsx("div", {
|
|
322
|
+
role: "list",
|
|
323
|
+
"aria-label": labels.machinesTokensInactive(inactive.length),
|
|
324
|
+
className: "contents",
|
|
325
|
+
children: inactiveShown.shown.map((token) => tokenRow(token, browserName(token)))
|
|
326
|
+
}),
|
|
327
|
+
showInactive && /* @__PURE__ */ jsx(ShowMoreButton, {
|
|
328
|
+
hidden: inactiveShown.hidden,
|
|
329
|
+
onMore: inactiveShown.more
|
|
330
|
+
})
|
|
331
|
+
] }),
|
|
309
332
|
problem && /* @__PURE__ */ jsx(ErrorNote, {
|
|
310
333
|
className: "mx-3 my-2",
|
|
311
|
-
|
|
334
|
+
detail: problem,
|
|
335
|
+
children: error ? labels.machinesFailed("tokens") : labels.machinesTokensReadFailed
|
|
312
336
|
})
|
|
313
337
|
]
|
|
314
338
|
})]
|