zidane-ui 9.4.0 → 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 +7 -2
- package/dist/adapters/live.js +5 -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-host.js +27 -3
- package/dist/adapters/server-machines-host.d.ts +5 -0
- package/dist/adapters/server-machines-host.js +13 -6
- 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 +20 -1
- 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/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/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/StatusDot.d.ts +7 -2
- package/dist/chat/StatusDot.js +3 -2
- 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/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 +3 -0
- 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/chip-labels.d.ts +2 -0
- package/dist/chat/headless/chip-labels.js +2 -0
- 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 +2 -0
- 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 +1 -1
- package/dist/chat/headless/index.d.ts +10 -6
- package/dist/chat/headless/index.js +30 -26
- package/dist/chat/headless/labels.d.ts +34 -4
- package/dist/chat/headless/labels.js +28 -6
- package/dist/chat/headless/prompt-origin.d.ts +2 -2
- package/dist/chat/headless/prompt-origin.js +3 -3
- 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 +5 -0
- package/dist/chat/headless/sidebar/directory.js +2 -0
- 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 +5 -3
- package/dist/chat/headless/sidebar/index.js +4 -2
- package/dist/chat/headless/sidebar/labels.d.ts +30 -7
- package/dist/chat/headless/sidebar/labels.js +0 -3
- 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/live-events.d.ts +12 -0
- package/dist/chat/headless/streams/live-events.js +21 -2
- package/dist/chat/headless/streams/store.d.ts +17 -0
- package/dist/chat/headless/streams/store.js +38 -15
- package/dist/chat/headless/streams/types.d.ts +2 -1
- package/dist/chat/headless/transcript/collapse.js +3 -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 +5 -3
- package/dist/chat/index.js +7 -5
- 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 +15 -3
- package/dist/chat/sidebar/SessionSidebar.d.ts +41 -0
- package/dist/chat/sidebar/SessionSidebar.js +63 -13
- 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 +6 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +16 -7
- 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/sidebar-live.d.ts +29 -2
- package/dist/chat/sidebar/sidebar-live.js +36 -2
- package/dist/chat/sidebar/useInboxRows.js +2 -3
- package/dist/chat/sidebar/useInboxTriage.d.ts +5 -2
- package/dist/chat/sidebar/useInboxTriage.js +28 -20
- 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/PromptEcho.js +15 -2
- package/dist/chat/transcript/PromptOriginLabel.d.ts +1 -1
- package/dist/chat/transcript/TranscriptRail.d.ts +3 -1
- 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/fold.js +2 -1
- package/dist/chat/transcript/index.d.ts +2 -2
- package/dist/chat/transcript/index.js +2 -2
- package/dist/chat/transcript/inline-facts.d.ts +9 -0
- package/dist/chat/transcript/inline-facts.js +20 -0
- package/dist/chat/transcript/notices.d.ts +25 -3
- package/dist/chat/transcript/notices.js +136 -17
- package/dist/chat/transcript/prompt.js +8 -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-row.js +3 -2
- package/dist/code/editor/FileView.js +1 -3
- 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/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/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.js +8 -5
- package/dist/components/charts/ScatterChart.js +13 -6
- package/dist/components/floating/FloatingSurface.js +2 -2
- package/dist/components/floating/useAnchoredPosition.d.ts +15 -1
- package/dist/components/floating/useAnchoredPosition.js +41 -7
- package/dist/components/palette/PaletteList.d.ts +5 -5
- package/dist/components/palette/PaletteList.js +2 -3
- 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/core.css +45 -20
- package/dist/dist/index-BmO8bRgK.d.ts +1 -0
- package/dist/dist/{index-BheVJOLc.d.ts → index-Bsp5Ku7r.d.ts} +264 -134
- 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/headless/host.d.ts +6 -2
- package/dist/files/index.d.ts +2 -2
- package/dist/files/index.js +2 -2
- package/dist/git/GitBar.js +8 -2
- package/dist/git/MoveSessionDialog.js +8 -5
- package/dist/git/MoveToDialog.d.ts +3 -1
- package/dist/git/MoveToDialog.js +43 -16
- package/dist/git/TeleportSessionDialog.d.ts +11 -4
- package/dist/git/TeleportSessionDialog.js +263 -107
- package/dist/git/WherePicker.js +4 -1
- package/dist/git/headless/labels.d.ts +8 -0
- package/dist/git/headless/labels.js +24 -16
- package/dist/git/index.d.ts +2 -2
- package/dist/git/index.js +2 -2
- package/dist/git/useEnvironmentChoices.d.ts +19 -0
- package/dist/git/useEnvironmentChoices.js +34 -10
- package/dist/hooks/useLastCount.d.ts +9 -0
- package/dist/hooks/useLastCount.js +29 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +7 -3
- 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 +167 -51
- 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 +91 -52
- 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 +12 -5
- package/dist/machines/OrganizationPanel.js +420 -133
- 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 -10
- package/dist/machines/headless/fixture-host.js +75 -44
- package/dist/machines/headless/fixtures.d.ts +12 -0
- package/dist/machines/headless/fixtures.js +71 -1
- package/dist/machines/headless/host.d.ts +13 -9
- package/dist/machines/headless/index.d.ts +3 -3
- package/dist/machines/headless/index.js +2 -2
- package/dist/machines/headless/labels.d.ts +81 -40
- package/dist/machines/headless/labels.js +103 -60
- 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 +9 -3
- package/dist/machines/headless/organization.js +12 -2
- package/dist/machines/headless/sync.d.ts +2 -0
- package/dist/machines/index.d.ts +3 -2
- package/dist/machines/index.js +3 -2
- package/dist/machines/sync-rows.d.ts +8 -0
- package/dist/machines/sync-rows.js +10 -0
- package/dist/machines/testing/contract.d.ts +1 -25
- package/dist/machines/testing/contract.js +1 -97
- package/dist/machines/testing/index.d.ts +3 -3
- package/dist/machines/testing/index.js +2 -2
- 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 +3 -1
- package/dist/palette/headless/labels.js +2 -2
- package/dist/palette/usePaletteController.js +4 -8
- package/dist/session/ArtifactsPanel.js +11 -23
- 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.js +186 -61
- 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 +496 -249
- 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/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 +3 -2
- package/dist/session/SessionPeopleStack.js +51 -17
- package/dist/session/SessionPlaceMenu.js +2 -2
- package/dist/session/SessionProvider.d.ts +13 -1
- package/dist/session/SessionProvider.js +21 -1
- package/dist/session/ShareSessionDialog.d.ts +4 -4
- package/dist/session/ShareSessionDialog.js +182 -283
- package/dist/session/TypingLine.d.ts +9 -4
- package/dist/session/TypingLine.js +16 -5
- 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 +263 -7
- package/dist/session/headless/index.d.ts +10 -5
- package/dist/session/headless/index.js +8 -3
- package/dist/session/headless/labels.d.ts +381 -6
- package/dist/session/headless/labels.js +72 -24
- package/dist/session/headless/orchestration-labels.d.ts +52 -0
- package/dist/session/headless/orchestration-labels.js +59 -0
- 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 +20 -1
- package/dist/session/headless/typing.js +58 -3
- 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 +17 -4
- package/dist/session/index.js +16 -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/index.d.ts +3 -2
- package/dist/settings/index.js +5 -4
- package/dist/settings/section.d.ts +9 -0
- package/dist/settings/section.js +12 -1
- package/dist/settings/sections/editor/labels.js +1 -1
- 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/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 +127 -34
- package/dist/theme/runtime-icons.js +7 -3
- package/dist/workspace/PanelContentView.js +1 -1
- package/package.json +26 -2
- package/src/styles/app.css +6 -3
- package/src/styles/palette.css +15 -19
- package/src/styles/primitives.css +3 -1
- package/src/styles/transcript.css +22 -0
- package/dist/dist/index-ttmMvjgM.d.ts +0 -1
- package/dist/dist/sandbox-CSUihARm.d.ts +0 -2
- package/dist/machines/PersonalLayerPanel.d.ts +0 -32
- package/dist/machines/PersonalLayerPanel.js +0 -360
- package/dist/machines/headless/layer.d.ts +0 -64
- package/dist/machines/headless/layer.js +0 -56
- /package/dist/dist/{execution-failure-SREfl-EZ.d.ts → execution-failure-_L2r_Qd-.d.ts} +0 -0
|
@@ -11,16 +11,17 @@ import { hostOfSettingsFocus } from "./headless/settings-focus.js";
|
|
|
11
11
|
import { CapabilitiesView, CapabilityTags, useHostCapabilities } from "./HostCapabilities.js";
|
|
12
12
|
import { HostIcon } from "./HostIcon.js";
|
|
13
13
|
import { HostSyncPanel, useHostSync } from "./HostSyncPanel.js";
|
|
14
|
+
import { LinkedAccountsPanel } from "./LinkedAccountsPanel.js";
|
|
14
15
|
import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
15
16
|
import { OrganizationPanel } from "./OrganizationPanel.js";
|
|
16
|
-
import {
|
|
17
|
+
import { ProjectsSpendPanel } from "./ProjectsSpendPanel.js";
|
|
17
18
|
import { ServerAddedCard } from "./ServerAddedCard.js";
|
|
18
19
|
import { ServerCard } from "./ServerCard.js";
|
|
19
20
|
import { ServerMachinesPanel } from "./ServerMachinesPanel.js";
|
|
20
21
|
import { ServerUpdatePanel } from "./ServerUpdatePanel.js";
|
|
21
22
|
import { SyncOutcomeBadge } from "./SyncOutcomeBadge.js";
|
|
22
23
|
import { TokensPanel } from "./TokensPanel.js";
|
|
23
|
-
import { useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
24
|
+
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
24
25
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
26
|
// src/machines/HostsSection.tsx
|
|
26
27
|
const NO_HOSTS = constant({
|
|
@@ -138,40 +139,52 @@ function HostListRow({ host, saved, onOpen, now }) {
|
|
|
138
139
|
children: /* @__PURE__ */ jsxs("button", {
|
|
139
140
|
type: "button",
|
|
140
141
|
onClick: onOpen,
|
|
141
|
-
"aria-label": labels.machinesOpenHost(host.name),
|
|
142
142
|
className: "group w-full flex items-center gap-3 px-4 py-3 bg-transparent border-0 text-left cursor-pointer rounded-zg-md hover:bg-[var(--zg-row-hover)] transition-colors",
|
|
143
143
|
children: [
|
|
144
|
-
/* @__PURE__ */ jsx(HostIcon, {
|
|
144
|
+
/* @__PURE__ */ jsx(HostIcon, {
|
|
145
|
+
icon: local ? "i-ph-laptop" : "i-ph-hard-drives",
|
|
146
|
+
className: "self-start"
|
|
147
|
+
}),
|
|
145
148
|
/* @__PURE__ */ jsxs("span", {
|
|
146
149
|
className: "flex-1 min-w-0 space-y-1",
|
|
147
|
-
children: [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ jsxs("span", {
|
|
152
|
+
className: "flex items-center gap-2 min-w-0",
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ jsx(HostBadge, {
|
|
155
|
+
host,
|
|
156
|
+
className: "min-w-0"
|
|
157
|
+
}),
|
|
158
|
+
" ",
|
|
159
|
+
!local && host.status !== "connected" && /* @__PURE__ */ jsx(MetaChip, {
|
|
160
|
+
tone: hostStatusTone(host),
|
|
161
|
+
children: hostStatusText(host, labels)
|
|
162
|
+
}),
|
|
163
|
+
" ",
|
|
164
|
+
!local && /* @__PURE__ */ jsx(SyncOutcomeBadge, { state: sync })
|
|
165
|
+
]
|
|
166
|
+
}),
|
|
167
|
+
" ",
|
|
168
|
+
/* @__PURE__ */ jsxs("span", {
|
|
169
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ jsx(CapabilityTags, { caps }),
|
|
172
|
+
" ",
|
|
173
|
+
!local && host.error && host.status !== "connected" ? /* @__PURE__ */ jsx(Notice, {
|
|
174
|
+
tone: "error",
|
|
175
|
+
compact: true,
|
|
176
|
+
className: "min-w-0",
|
|
177
|
+
children: host.error
|
|
178
|
+
}) : local ? /* @__PURE__ */ jsx("span", {
|
|
179
|
+
className: "text-xs text-[var(--zg-text-muted)]",
|
|
180
|
+
children: labels.machinesThisApp
|
|
181
|
+
}) : lastConnectedAt && /* @__PURE__ */ jsx("span", {
|
|
182
|
+
className: "text-xs text-[var(--zg-text-muted)]",
|
|
183
|
+
children: labels.machinesFactConnected(agoText(lastConnectedAt, now, labels))
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
})
|
|
187
|
+
]
|
|
175
188
|
}),
|
|
176
189
|
/* @__PURE__ */ jsx("span", {
|
|
177
190
|
"aria-hidden": true,
|
|
@@ -197,8 +210,7 @@ function HostDetail({ host, saved, onChanged, onBack, confirm, now }) {
|
|
|
197
210
|
});
|
|
198
211
|
const capabilitySection = /* @__PURE__ */ jsx(FormSection, {
|
|
199
212
|
title: labels.machinesCapabilitiesTitle,
|
|
200
|
-
|
|
201
|
-
children: /* @__PURE__ */ jsx(FormCard, { children: /* @__PURE__ */ jsx(CapabilitiesView, {
|
|
213
|
+
children: /* @__PURE__ */ jsx(CapabilitiesView, {
|
|
202
214
|
caps: capabilities.caps,
|
|
203
215
|
error: capabilities.error,
|
|
204
216
|
checking: capabilities.checking,
|
|
@@ -207,7 +219,7 @@ function HostDetail({ host, saved, onChanged, onBack, confirm, now }) {
|
|
|
207
219
|
...!local && capabilities.install ? { onInstall: (name) => void capabilities.install(name) } : {},
|
|
208
220
|
installing: capabilities.installing,
|
|
209
221
|
installed: capabilities.installed
|
|
210
|
-
})
|
|
222
|
+
})
|
|
211
223
|
});
|
|
212
224
|
if (local) return /* @__PURE__ */ jsxs("div", {
|
|
213
225
|
className: "space-y-5",
|
|
@@ -216,7 +228,10 @@ function HostDetail({ host, saved, onChanged, onBack, confirm, now }) {
|
|
|
216
228
|
back,
|
|
217
229
|
/* @__PURE__ */ jsx(FormCard, { children: /* @__PURE__ */ jsxs("div", {
|
|
218
230
|
className: "flex items-center gap-3 px-4 py-3.5",
|
|
219
|
-
children: [/* @__PURE__ */ jsx(HostIcon, {
|
|
231
|
+
children: [/* @__PURE__ */ jsx(HostIcon, {
|
|
232
|
+
icon: "i-ph-laptop",
|
|
233
|
+
className: "self-start"
|
|
234
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
220
235
|
className: "flex-1 min-w-0",
|
|
221
236
|
children: [/* @__PURE__ */ jsx("div", {
|
|
222
237
|
className: "text-sm font-medium text-[var(--zg-text)]",
|
|
@@ -242,9 +257,36 @@ function HostDetail({ host, saved, onChanged, onBack, confirm, now }) {
|
|
|
242
257
|
});
|
|
243
258
|
}
|
|
244
259
|
/**
|
|
260
|
+
* The caller's role on a server in organization mode (docs/IDENTITY.md): `user` hides what only an admin can do
|
|
261
|
+
* there (the server's updates, installs). `null` until known, without `organization`, or with the mode off.
|
|
262
|
+
*/
|
|
263
|
+
function useOrganizationRole(hostId, connected) {
|
|
264
|
+
const organization = useMachinesHost().organization;
|
|
265
|
+
const [role, setRole] = useState(null);
|
|
266
|
+
useEffect(() => {
|
|
267
|
+
if (!organization || !connected) return void 0;
|
|
268
|
+
let live = true;
|
|
269
|
+
Promise.resolve().then(() => organization.status(hostId)).then((status) => live && setRole({
|
|
270
|
+
hostId,
|
|
271
|
+
role: status.mode === "on" ? status.role : null
|
|
272
|
+
}), () => live && setRole({
|
|
273
|
+
hostId,
|
|
274
|
+
role: null
|
|
275
|
+
}));
|
|
276
|
+
return () => {
|
|
277
|
+
live = false;
|
|
278
|
+
};
|
|
279
|
+
}, [
|
|
280
|
+
organization,
|
|
281
|
+
hostId,
|
|
282
|
+
connected
|
|
283
|
+
]);
|
|
284
|
+
return role?.hostId === hostId ? role.role : null;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
245
287
|
* A server's page, the same in every app: its card, then one labelled section each for its updates, what it can
|
|
246
|
-
* do, its settings sync, its machines, the browsers paired with it
|
|
247
|
-
* this connection leaves out hides.
|
|
288
|
+
* do, its settings sync, its machines, the browsers paired with it, its access tokens and its people. A section the host or
|
|
289
|
+
* this connection leaves out hides; so does what only an admin can do, for a person who is not one.
|
|
248
290
|
*
|
|
249
291
|
* @param props - The server, its saved entry, `onChanged`, `confirm`, `now`, `className` and `style`.
|
|
250
292
|
*/
|
|
@@ -255,6 +297,7 @@ function ServerDetail({ host, saved, onChanged, confirm, now, className = "", st
|
|
|
255
297
|
const ask = confirm ?? providerConfirm;
|
|
256
298
|
const { state: sync } = useHostSync(host.id);
|
|
257
299
|
const capabilities = useHostCapabilities(host.id, host.status === "connected");
|
|
300
|
+
const admin = useOrganizationRole(host.id, host.status === "connected") !== "user";
|
|
258
301
|
const timed = now !== void 0 ? { now } : {};
|
|
259
302
|
return /* @__PURE__ */ jsxs("div", {
|
|
260
303
|
className: `space-y-5 ${className}`.trimEnd(),
|
|
@@ -269,34 +312,29 @@ function ServerDetail({ host, saved, onChanged, confirm, now, className = "", st
|
|
|
269
312
|
confirm: ask,
|
|
270
313
|
...timed
|
|
271
314
|
}),
|
|
272
|
-
/* @__PURE__ */ jsx(ServerUpdatePanel, {
|
|
315
|
+
admin && /* @__PURE__ */ jsx(ServerUpdatePanel, {
|
|
273
316
|
host,
|
|
274
317
|
confirm: ask
|
|
275
318
|
}),
|
|
276
319
|
/* @__PURE__ */ jsx(FormSection, {
|
|
277
320
|
title: labels.machinesCapabilitiesTitle,
|
|
278
|
-
|
|
279
|
-
children: /* @__PURE__ */ jsx(FormCard, { children: /* @__PURE__ */ jsx(CapabilitiesView, {
|
|
321
|
+
children: /* @__PURE__ */ jsx(CapabilitiesView, {
|
|
280
322
|
caps: capabilities.caps,
|
|
281
323
|
error: capabilities.error,
|
|
282
324
|
checking: capabilities.checking,
|
|
283
325
|
onRecheck: () => void capabilities.recheck(),
|
|
284
326
|
local: false,
|
|
285
|
-
...capabilities.install ? { onInstall: (name) => void capabilities.install(name) } : {},
|
|
327
|
+
...admin && capabilities.install ? { onInstall: (name) => void capabilities.install(name) } : {},
|
|
286
328
|
installing: capabilities.installing,
|
|
287
329
|
installed: capabilities.installed
|
|
288
|
-
})
|
|
330
|
+
})
|
|
289
331
|
}),
|
|
290
332
|
machinesHost.sync?.state && /* @__PURE__ */ jsx(FormSection, {
|
|
291
333
|
title: labels.machinesSyncTitle,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
host,
|
|
297
|
-
confirm: ask
|
|
298
|
-
})
|
|
299
|
-
}) })
|
|
334
|
+
children: /* @__PURE__ */ jsx(HostSyncPanel, {
|
|
335
|
+
host,
|
|
336
|
+
confirm: ask
|
|
337
|
+
})
|
|
300
338
|
}),
|
|
301
339
|
/* @__PURE__ */ jsx(ServerMachinesPanel, {
|
|
302
340
|
host,
|
|
@@ -309,7 +347,8 @@ function ServerDetail({ host, saved, onChanged, confirm, now, className = "", st
|
|
|
309
347
|
...timed
|
|
310
348
|
}),
|
|
311
349
|
machinesHost.organization && /* @__PURE__ */ jsx(OrganizationPanel, { host }),
|
|
312
|
-
machinesHost.
|
|
350
|
+
machinesHost.organization && /* @__PURE__ */ jsx(ProjectsSpendPanel, { host }),
|
|
351
|
+
machinesHost.linkedAccounts && /* @__PURE__ */ jsx(LinkedAccountsPanel, { host })
|
|
313
352
|
]
|
|
314
353
|
});
|
|
315
354
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A server's Linked accounts section (docs/IDENTITY.md, Linked accounts): the Google and Slack accounts the person
|
|
3
|
+
* signs in with there, one row each with its picture (or the provider's glyph), its name, and the provider, the Slack
|
|
4
|
+
* workspace and the email in one quiet line (it wraps rather than hide a long email). Link Google and Link Slack sit on
|
|
5
|
+
* the label line, one per provider the server signs in with: the provider's page opens in the browser, the row shows
|
|
6
|
+
* the wait with Cancel, and the Link buttons stay in place, disabled, until it ends. Unlink asks
|
|
7
|
+
* first, and shows only while another account is left (the server refuses the last one). A failure stays in place,
|
|
8
|
+
* with what the server said.
|
|
9
|
+
*
|
|
10
|
+
* Loading holds the section's place with a quiet row; a read that fails says so with Retry. Needs the host's
|
|
11
|
+
* `linkedAccounts`; nothing while the server is not connected or signs nobody in.
|
|
12
|
+
*/
|
|
13
|
+
import { HostSummary } from "./headless/host.js";
|
|
14
|
+
import { CSSProperties } from "react";
|
|
15
|
+
/** Props for {@link LinkedAccountsPanel}. */
|
|
16
|
+
export interface LinkedAccountsPanelProps {
|
|
17
|
+
/** The server. */
|
|
18
|
+
host: HostSummary;
|
|
19
|
+
/** Extra classes on the root. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Inline styles on the root. */
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders the server's Linked accounts section, or nothing without the host's `linkedAccounts` or a connection.
|
|
26
|
+
*
|
|
27
|
+
* @param props - The {@link LinkedAccountsPanelProps}.
|
|
28
|
+
*/
|
|
29
|
+
export declare function LinkedAccountsPanel(props: LinkedAccountsPanelProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { BTN_SECONDARY } from "../components/button.js";
|
|
2
|
+
import { Facts, FormSection, OpLine, ROW_CLASS, RowText } from "../components/Form.js";
|
|
3
|
+
import { Notice } from "../components/Notice.js";
|
|
4
|
+
import { errorMessage } from "../components/report-error.js";
|
|
5
|
+
import { HostIcon } from "./HostIcon.js";
|
|
6
|
+
import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
7
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
// src/machines/LinkedAccountsPanel.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Renders the server's Linked accounts section, or nothing without the host's `linkedAccounts` or a connection.
|
|
12
|
+
*
|
|
13
|
+
* @param props - The {@link LinkedAccountsPanelProps}.
|
|
14
|
+
*/
|
|
15
|
+
function LinkedAccountsPanel(props) {
|
|
16
|
+
const linkedAccounts = useMachinesHost().linkedAccounts;
|
|
17
|
+
if (!linkedAccounts || props.host.status !== "connected") return null;
|
|
18
|
+
return /* @__PURE__ */ jsx(LinkedBody, {
|
|
19
|
+
...props,
|
|
20
|
+
linkedAccounts
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const GLYPHS = {
|
|
24
|
+
google: "i-ph-google-logo",
|
|
25
|
+
slack: "i-ph-slack-logo"
|
|
26
|
+
};
|
|
27
|
+
const keyOf = (account) => `${account.issuer}\n${account.subject}`;
|
|
28
|
+
function LinkedBody({ host, linkedAccounts, className = "", style }) {
|
|
29
|
+
const labels = useMachinesLabels();
|
|
30
|
+
const ask = useMachinesConfirm();
|
|
31
|
+
/** `undefined`: not read yet; `null`: the server signs nobody in. */
|
|
32
|
+
const [state, setState] = useState(void 0);
|
|
33
|
+
const [readError, setReadError] = useState(null);
|
|
34
|
+
const [error, setError] = useState(null);
|
|
35
|
+
/** The provider a link waits on, and how to end the wait. */
|
|
36
|
+
const [linking, setLinking] = useState(null);
|
|
37
|
+
/** The account an unlink runs for. */
|
|
38
|
+
const [busyKey, setBusyKey] = useState(null);
|
|
39
|
+
const generation = useRef(0);
|
|
40
|
+
const live = useRef(true);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
live.current = true;
|
|
43
|
+
return () => {
|
|
44
|
+
live.current = false;
|
|
45
|
+
generation.current += 1;
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
const read = useCallback(async () => {
|
|
49
|
+
const mine = ++generation.current;
|
|
50
|
+
try {
|
|
51
|
+
const next = await linkedAccounts.list(host.id);
|
|
52
|
+
if (mine !== generation.current) return;
|
|
53
|
+
setState(next);
|
|
54
|
+
setReadError(null);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
if (mine === generation.current) setReadError({
|
|
57
|
+
text: labels.machinesLinkedReadFailed,
|
|
58
|
+
detail: errorMessage(err)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, [
|
|
62
|
+
linkedAccounts,
|
|
63
|
+
host.id,
|
|
64
|
+
labels
|
|
65
|
+
]);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
read();
|
|
68
|
+
return linkedAccounts.onChange?.(host.id, () => void read());
|
|
69
|
+
}, [
|
|
70
|
+
read,
|
|
71
|
+
linkedAccounts,
|
|
72
|
+
host.id
|
|
73
|
+
]);
|
|
74
|
+
useEffect(() => () => linking?.abort.abort(), [linking]);
|
|
75
|
+
const link = async (provider) => {
|
|
76
|
+
if (!linkedAccounts.link) return;
|
|
77
|
+
const abort = new AbortController();
|
|
78
|
+
setLinking({
|
|
79
|
+
provider,
|
|
80
|
+
abort
|
|
81
|
+
});
|
|
82
|
+
setError(null);
|
|
83
|
+
try {
|
|
84
|
+
await linkedAccounts.link(host.id, provider, abort.signal);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
if (!abort.signal.aborted && live.current) setError({
|
|
87
|
+
text: labels.machinesLinkedLinkFailed(labels.machinesProviderName(provider)),
|
|
88
|
+
detail: errorMessage(err)
|
|
89
|
+
});
|
|
90
|
+
} finally {
|
|
91
|
+
if (live.current) {
|
|
92
|
+
setLinking(null);
|
|
93
|
+
read();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const unlink = async (account, title) => {
|
|
98
|
+
if (!await ask({
|
|
99
|
+
title: labels.machinesLinkedUnlinkTitle(title),
|
|
100
|
+
message: labels.machinesLinkedUnlinkMessage,
|
|
101
|
+
confirmLabel: labels.machinesLinkedUnlink,
|
|
102
|
+
destructive: true
|
|
103
|
+
}).catch(() => false)) return;
|
|
104
|
+
setBusyKey(keyOf(account));
|
|
105
|
+
setError(null);
|
|
106
|
+
try {
|
|
107
|
+
await linkedAccounts.unlink(host.id, account);
|
|
108
|
+
} catch (err) {
|
|
109
|
+
setError({
|
|
110
|
+
text: labels.machinesLinkedUnlinkFailed(title),
|
|
111
|
+
detail: errorMessage(err)
|
|
112
|
+
});
|
|
113
|
+
} finally {
|
|
114
|
+
setBusyKey(null);
|
|
115
|
+
read();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
if (state === null) return null;
|
|
119
|
+
const section = {
|
|
120
|
+
"title": labels.machinesLinkedTitle,
|
|
121
|
+
className,
|
|
122
|
+
style,
|
|
123
|
+
"data-testid": `linked-accounts-${host.id}`
|
|
124
|
+
};
|
|
125
|
+
if (state === void 0) return /* @__PURE__ */ jsx(FormSection, {
|
|
126
|
+
...section,
|
|
127
|
+
children: readError ? /* @__PURE__ */ jsx(Notice, {
|
|
128
|
+
tone: "error",
|
|
129
|
+
detail: readError.detail,
|
|
130
|
+
className: "mx-3 my-2",
|
|
131
|
+
action: /* @__PURE__ */ jsx("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
className: BTN_SECONDARY,
|
|
134
|
+
onClick: () => void read(),
|
|
135
|
+
children: labels.machinesRetry
|
|
136
|
+
}),
|
|
137
|
+
children: readError.text
|
|
138
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
139
|
+
className: ROW_CLASS,
|
|
140
|
+
role: "status",
|
|
141
|
+
children: [/* @__PURE__ */ jsx(HostIcon, { icon: "i-ph-identification-card" }), /* @__PURE__ */ jsx("span", {
|
|
142
|
+
className: "text-xs text-[var(--zg-text-muted)]",
|
|
143
|
+
children: labels.machinesLinkedLoading
|
|
144
|
+
})]
|
|
145
|
+
})
|
|
146
|
+
});
|
|
147
|
+
const canLink = Boolean(linkedAccounts.link) && state.providers.length > 0;
|
|
148
|
+
const several = state.accounts.length > 1;
|
|
149
|
+
return /* @__PURE__ */ jsxs(FormSection, {
|
|
150
|
+
...section,
|
|
151
|
+
...canLink ? { trailing: /* @__PURE__ */ jsx("span", {
|
|
152
|
+
className: "inline-flex flex-wrap justify-end gap-1.5",
|
|
153
|
+
children: state.providers.map((provider) => /* @__PURE__ */ jsx("button", {
|
|
154
|
+
type: "button",
|
|
155
|
+
className: BTN_SECONDARY,
|
|
156
|
+
disabled: linking !== null,
|
|
157
|
+
onClick: () => void link(provider),
|
|
158
|
+
children: labels.machinesLinkedLink(labels.machinesProviderName(provider))
|
|
159
|
+
}, provider))
|
|
160
|
+
}) } : {},
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ jsx("div", {
|
|
163
|
+
role: "list",
|
|
164
|
+
"aria-label": labels.machinesLinkedTitle,
|
|
165
|
+
className: "contents",
|
|
166
|
+
children: state.accounts.map((account) => {
|
|
167
|
+
const title = account.name || account.email || labels.machinesProviderName(account.provider);
|
|
168
|
+
return /* @__PURE__ */ jsx(AccountRow, {
|
|
169
|
+
account,
|
|
170
|
+
title,
|
|
171
|
+
busy: busyKey === keyOf(account),
|
|
172
|
+
...several ? { onUnlink: () => void unlink(account, title) } : {}
|
|
173
|
+
}, keyOf(account));
|
|
174
|
+
})
|
|
175
|
+
}),
|
|
176
|
+
state.accounts.length === 0 && /* @__PURE__ */ jsxs("div", {
|
|
177
|
+
className: "flex items-center gap-3 px-3 py-2",
|
|
178
|
+
children: [/* @__PURE__ */ jsx(HostIcon, { icon: "i-ph-identification-card" }), /* @__PURE__ */ jsx("span", {
|
|
179
|
+
className: "text-xs text-[var(--zg-text-muted)]",
|
|
180
|
+
children: labels.machinesLinkedEmpty
|
|
181
|
+
})]
|
|
182
|
+
}),
|
|
183
|
+
state.accounts.length === 1 && /* @__PURE__ */ jsxs("div", {
|
|
184
|
+
className: `flex items-center gap-3 px-3 py-2 items-start`,
|
|
185
|
+
children: [/* @__PURE__ */ jsx(HostIcon, { icon: "i-ph-info" }), /* @__PURE__ */ jsx("span", {
|
|
186
|
+
className: "flex-1 min-w-0 self-center text-xs text-[var(--zg-text-muted)] text-pretty",
|
|
187
|
+
children: labels.machinesLinkedOnly
|
|
188
|
+
})]
|
|
189
|
+
}),
|
|
190
|
+
linking && /* @__PURE__ */ jsxs("div", {
|
|
191
|
+
className: "flex items-center gap-3 px-3 py-2",
|
|
192
|
+
children: [/* @__PURE__ */ jsx(OpLine, {
|
|
193
|
+
kind: "busy",
|
|
194
|
+
className: "!px-0 flex-1 min-w-0",
|
|
195
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
196
|
+
role: "status",
|
|
197
|
+
children: labels.machinesLinkedLinking(labels.machinesProviderName(linking.provider))
|
|
198
|
+
})
|
|
199
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
200
|
+
type: "button",
|
|
201
|
+
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)]",
|
|
202
|
+
onClick: () => linking.abort.abort(),
|
|
203
|
+
children: labels.machinesCancel
|
|
204
|
+
})]
|
|
205
|
+
}),
|
|
206
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
207
|
+
tone: "error",
|
|
208
|
+
detail: error.detail,
|
|
209
|
+
className: "mx-3 my-2",
|
|
210
|
+
children: error.text
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/** One account: its picture or the provider's glyph, its name, and the provider, workspace and email in one quiet line. */
|
|
216
|
+
function AccountRow({ account, title, busy, onUnlink }) {
|
|
217
|
+
const labels = useMachinesLabels();
|
|
218
|
+
const [broken, setBroken] = useState(false);
|
|
219
|
+
const provider = labels.machinesProviderName(account.provider);
|
|
220
|
+
const facts = [
|
|
221
|
+
provider === title ? void 0 : provider,
|
|
222
|
+
account.teamName ? labels.machinesLinkedWorkspace(account.teamName) : void 0,
|
|
223
|
+
account.name ? account.email : void 0
|
|
224
|
+
].filter((fact) => Boolean(fact));
|
|
225
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
226
|
+
role: "listitem",
|
|
227
|
+
className: ROW_CLASS,
|
|
228
|
+
"data-testid": `linked-${account.provider}-${account.subject}`,
|
|
229
|
+
"aria-busy": busy || void 0,
|
|
230
|
+
children: [
|
|
231
|
+
account.avatar && !broken ? /* @__PURE__ */ jsx("img", {
|
|
232
|
+
src: account.avatar,
|
|
233
|
+
alt: "",
|
|
234
|
+
width: 28,
|
|
235
|
+
height: 28,
|
|
236
|
+
decoding: "async",
|
|
237
|
+
referrerPolicy: "no-referrer",
|
|
238
|
+
onError: () => setBroken(true),
|
|
239
|
+
className: "size-7 shrink-0 self-start rounded-full object-cover bg-[var(--zg-track)]"
|
|
240
|
+
}) : /* @__PURE__ */ jsx(HostIcon, {
|
|
241
|
+
icon: GLYPHS[account.provider] ?? "i-ph-identification-card",
|
|
242
|
+
className: "self-start"
|
|
243
|
+
}),
|
|
244
|
+
/* @__PURE__ */ jsx(RowText, {
|
|
245
|
+
label: /* @__PURE__ */ jsx("span", {
|
|
246
|
+
dir: "auto",
|
|
247
|
+
className: "block truncate text-left",
|
|
248
|
+
children: title
|
|
249
|
+
}),
|
|
250
|
+
description: /* @__PURE__ */ jsx(Facts, { facts }),
|
|
251
|
+
truncate: false
|
|
252
|
+
}),
|
|
253
|
+
busy && /* @__PURE__ */ jsx("span", {
|
|
254
|
+
"aria-hidden": true,
|
|
255
|
+
className: "i-ph-circle-notch animate-spin shrink-0 text-[var(--zg-text-muted)]"
|
|
256
|
+
}),
|
|
257
|
+
onUnlink && /* @__PURE__ */ jsx("button", {
|
|
258
|
+
type: "button",
|
|
259
|
+
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)]",
|
|
260
|
+
"aria-label": labels.machinesLinkedUnlinkLabel(title),
|
|
261
|
+
disabled: busy,
|
|
262
|
+
onClick: onUnlink,
|
|
263
|
+
children: labels.machinesLinkedUnlink
|
|
264
|
+
})
|
|
265
|
+
]
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
export { LinkedAccountsPanel };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a server and its machines are, in one small picture: this app, the
|
|
3
|
-
* server, the machines, each with what it does
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* server, the machines, each in its own color with what it does. The machines
|
|
4
|
+
* list shows it while a server has no machines, and behind its How it works
|
|
5
|
+
* button after that.
|
|
6
6
|
*/
|
|
7
7
|
import { CSSProperties } from "react";
|
|
8
8
|
/** Props for {@link MachinesExplainer}. */
|
|
@@ -13,7 +13,7 @@ export interface MachinesExplainerProps {
|
|
|
13
13
|
style?: CSSProperties;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Renders the picture of this app, the server and its machines
|
|
16
|
+
* Renders the picture of this app, the server and its machines.
|
|
17
17
|
*
|
|
18
18
|
* @param props - `className` and `style`.
|
|
19
19
|
*/
|
|
@@ -1,70 +1,80 @@
|
|
|
1
1
|
import { useMachinesLabels } from "./MachinesProvider.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
// src/machines/MachinesExplainer.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Each place's color, from the theme's chart palette (its glyph and a wash of it behind), so the three read apart in
|
|
6
|
+
* every theme: the accent, its mix with the danger tone, and the second accent.
|
|
7
|
+
*/
|
|
8
|
+
const TONES = {
|
|
9
|
+
app: "text-[var(--zg-chart-1)] bg-[color-mix(in_srgb,var(--zg-chart-1)_16%,transparent)]",
|
|
10
|
+
server: "text-[var(--zg-chart-5)] bg-[color-mix(in_srgb,var(--zg-chart-5)_16%,transparent)]",
|
|
11
|
+
machines: "text-[var(--zg-chart-3)] bg-[color-mix(in_srgb,var(--zg-chart-3)_16%,transparent)]"
|
|
12
|
+
};
|
|
4
13
|
/** One place in the picture: its glyph, its name, what it does. */
|
|
5
|
-
function Place({ icon, name, fact }) {
|
|
14
|
+
function Place({ icon, tone, name, fact }) {
|
|
6
15
|
return /* @__PURE__ */ jsxs("li", {
|
|
7
|
-
className: "flex-1 min-w-0 flex flex-col items-center gap-1 text-center",
|
|
16
|
+
className: "flex-1 min-w-0 flex flex-col items-center gap-1.5 text-center",
|
|
8
17
|
children: [
|
|
9
18
|
/* @__PURE__ */ jsx("span", {
|
|
10
19
|
"aria-hidden": true,
|
|
11
|
-
className:
|
|
20
|
+
className: `inline-flex items-center justify-center size-14 rounded-zg-lg text-3xl ${TONES[tone]}`,
|
|
12
21
|
children: /* @__PURE__ */ jsx("span", { className: icon })
|
|
13
22
|
}),
|
|
14
23
|
/* @__PURE__ */ jsx("span", {
|
|
15
|
-
className: "text-
|
|
24
|
+
className: "mt-0.5 text-sm font-medium text-[var(--zg-text)]",
|
|
16
25
|
children: name
|
|
17
26
|
}),
|
|
18
27
|
/* @__PURE__ */ jsx("span", {
|
|
19
|
-
className: "text-
|
|
28
|
+
className: "text-xs text-[var(--zg-text-muted)] zg-balance",
|
|
20
29
|
children: fact
|
|
21
30
|
})
|
|
22
31
|
]
|
|
23
32
|
});
|
|
24
33
|
}
|
|
25
|
-
/** The arrow between two places. */
|
|
34
|
+
/** The arrow between two places: it points both ways, since each pair sends and answers (prompts out, replies back). */
|
|
26
35
|
function Arrow() {
|
|
27
36
|
return /* @__PURE__ */ jsx("li", {
|
|
28
37
|
"aria-hidden": true,
|
|
29
|
-
className: "shrink-0
|
|
30
|
-
|
|
38
|
+
className: "shrink-0 h-14 flex items-center text-[var(--zg-text-subtle)]",
|
|
39
|
+
"data-flow": "both",
|
|
40
|
+
children: /* @__PURE__ */ jsx("span", { className: "i-ph-arrows-left-right text-zg-ui" })
|
|
31
41
|
});
|
|
32
42
|
}
|
|
33
43
|
/**
|
|
34
|
-
* Renders the picture of this app, the server and its machines
|
|
44
|
+
* Renders the picture of this app, the server and its machines.
|
|
35
45
|
*
|
|
36
46
|
* @param props - `className` and `style`.
|
|
37
47
|
*/
|
|
38
48
|
function MachinesExplainer({ className = "", style }) {
|
|
39
49
|
const labels = useMachinesLabels();
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
className
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className,
|
|
42
52
|
style,
|
|
43
|
-
children:
|
|
44
|
-
className: "m-0 p-0 list-none flex items-start gap-
|
|
53
|
+
children: /* @__PURE__ */ jsxs("ol", {
|
|
54
|
+
className: "m-0 p-0 list-none flex items-start gap-2",
|
|
45
55
|
children: [
|
|
46
56
|
/* @__PURE__ */ jsx(Place, {
|
|
47
57
|
icon: "i-ph-laptop",
|
|
58
|
+
tone: "app",
|
|
48
59
|
name: labels.machinesPictureApp,
|
|
49
60
|
fact: labels.machinesPictureAppFact
|
|
50
61
|
}),
|
|
51
62
|
/* @__PURE__ */ jsx(Arrow, {}),
|
|
52
63
|
/* @__PURE__ */ jsx(Place, {
|
|
53
64
|
icon: "i-ph-hard-drives",
|
|
65
|
+
tone: "server",
|
|
54
66
|
name: labels.machinesPictureServer,
|
|
55
67
|
fact: labels.machinesPictureServerFact
|
|
56
68
|
}),
|
|
57
69
|
/* @__PURE__ */ jsx(Arrow, {}),
|
|
58
70
|
/* @__PURE__ */ jsx(Place, {
|
|
59
71
|
icon: "i-ph-desktop-tower",
|
|
72
|
+
tone: "machines",
|
|
60
73
|
name: labels.machinesPictureMachines,
|
|
61
74
|
fact: labels.machinesPictureMachinesFact
|
|
62
75
|
})
|
|
63
76
|
]
|
|
64
|
-
})
|
|
65
|
-
className: "m-0 text-xs text-[var(--zg-text-muted)] text-center zg-balance",
|
|
66
|
-
children: labels.machinesExplain
|
|
67
|
-
})]
|
|
77
|
+
})
|
|
68
78
|
});
|
|
69
79
|
}
|
|
70
80
|
export { MachinesExplainer };
|