zidane-ui 9.4.0 → 9.5.2
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/SessionList.d.ts +1 -1
- package/dist/chat/SessionList.js +1 -1
- 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/Transcript.js +6 -2
- 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.d.ts +8 -2
- package/dist/chat/composer/DraftPickers.js +7 -3
- 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 +7 -2
- package/dist/chat/composer/ScopeToggle.js +4 -2
- package/dist/chat/composer/ServerScopeToggle.d.ts +7 -2
- package/dist/chat/composer/ServerScopeToggle.js +3 -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 +12 -1
- package/dist/chat/composer/use-draft-target.js +22 -10
- 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/fixtures/demo-transcript-all-kinds.d.ts +6 -0
- package/dist/chat/headless/fixtures/demo-transcript-all-kinds.js +90 -2
- 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 +15 -10
- package/dist/chat/headless/index.js +35 -30
- package/dist/chat/headless/labels.d.ts +43 -4
- package/dist/chat/headless/labels.js +40 -9
- 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 +36 -2
- package/dist/chat/headless/session-list.js +7 -0
- 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 +33 -7
- package/dist/chat/headless/sidebar/inbox.js +65 -26
- 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 +36 -7
- package/dist/chat/headless/sidebar/labels.js +1 -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 +64 -6
- package/dist/chat/headless/sidebar/rows.js +98 -18
- 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/derive.d.ts +1 -0
- package/dist/chat/headless/transcript/derive.js +3 -1
- package/dist/chat/headless/transcript/fold.js +1 -0
- package/dist/chat/headless/transcript/index.d.ts +3 -2
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +8 -1
- package/dist/chat/headless/transcript/rail.js +10 -2
- package/dist/chat/headless/transcript/rows.d.ts +31 -3
- package/dist/chat/headless/transcript/select-stops.js +1 -0
- package/dist/chat/headless/transcript/session-groups.d.ts +36 -0
- package/dist/chat/headless/transcript/session-groups.js +94 -0
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/index.d.ts +8 -5
- package/dist/chat/index.js +9 -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 +26 -2
- package/dist/chat/sidebar/InboxList.js +65 -49
- 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 +51 -2
- package/dist/chat/sidebar/SessionSidebar.js +87 -17
- package/dist/chat/sidebar/SidebarFooter.d.ts +2 -23
- package/dist/chat/sidebar/SidebarFooter.js +2 -43
- package/dist/chat/sidebar/SidebarGroupHeader.d.ts +12 -3
- package/dist/chat/sidebar/SidebarGroupHeader.js +36 -15
- 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.d.ts +4 -1
- package/dist/chat/sidebar/useInboxRows.js +8 -6
- package/dist/chat/sidebar/useInboxTriage.d.ts +8 -2
- package/dist/chat/sidebar/useInboxTriage.js +29 -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/testing/index.d.ts +2 -2
- package/dist/chat/testing/index.js +2 -2
- package/dist/chat/transcript/BadgeMenu.d.ts +9 -2
- package/dist/chat/transcript/BadgeMenu.js +20 -2
- package/dist/chat/transcript/PromptEcho.js +15 -2
- package/dist/chat/transcript/PromptOriginLabel.d.ts +1 -1
- package/dist/chat/transcript/SubagentBlock.js +24 -7
- package/dist/chat/transcript/TranscriptRail.d.ts +3 -1
- package/dist/chat/transcript/TranscriptRail.js +15 -5
- package/dist/chat/transcript/TranscriptRow.js +9 -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/frame.d.ts +7 -0
- package/dist/chat/transcript/frame.js +51 -5
- package/dist/chat/transcript/index.d.ts +5 -4
- package/dist/chat/transcript/index.js +4 -3
- 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 +34 -12
- package/dist/chat/transcript/notices.js +213 -97
- package/dist/chat/transcript/prompt.js +8 -1
- package/dist/chat/transcript/receipt-parts.d.ts +29 -2
- package/dist/chat/transcript/receipt-parts.js +40 -7
- package/dist/chat/transcript/row-estimate.js +4 -1
- package/dist/chat/transcript/run-rows.js +2 -5
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/session-groups.d.ts +21 -0
- package/dist/chat/transcript/session-groups.js +154 -0
- package/dist/chat/transcript/session-line.d.ts +63 -0
- package/dist/chat/transcript/session-line.js +114 -0
- 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-DPbpsCtl.d.ts} +248 -118
- 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 +20 -8
- 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 +55 -0
- package/dist/session/use-home-projects.js +154 -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 +117 -0
- package/dist/settings/headless/mcp.d.ts +2 -0
- package/dist/settings/headless/mcp.js +3 -2
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +3 -2
- package/dist/settings/index.js +13 -12
- 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/McpSection.js +3 -5
- 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 +170 -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 +61 -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
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { writable } from "../../chat/headless/store.js";
|
|
2
|
+
import { createFixtureProjectArtifacts } from "./fixture-project-artifacts.js";
|
|
3
|
+
import { createFixtureProjectContent } from "./fixture-project-content.js";
|
|
4
|
+
import { createProjectArtifacts } from "./project-artifacts.js";
|
|
5
|
+
import { createProjectSessionsState } from "./project-sessions.js";
|
|
6
|
+
import { ProjectRefusedError, createProjectsState, managesProject, projectContentHost } from "./projects.js";
|
|
7
|
+
import { PROJECT_NAME_MAX, projectSettingError, resolveSettings } from "zidane/chat/pure";
|
|
8
|
+
// src/session/headless/fixture-projects.ts
|
|
9
|
+
/** The page a fixture project's MCP sign-in opens. */
|
|
10
|
+
const FIXTURE_MCP_SIGN_IN_URL = "https://auth.example.com/authorize?client_id=zidane";
|
|
11
|
+
const trimmed = (path) => path.replace(/\/+$/, "") || "/";
|
|
12
|
+
const holds = (home, folder) => folder === home || folder.startsWith(home === "/" ? "/" : `${home}/`);
|
|
13
|
+
/**
|
|
14
|
+
* Creates a {@link FixtureProjectBackend}.
|
|
15
|
+
*
|
|
16
|
+
* @param options - The starting projects, layers, servers and clock.
|
|
17
|
+
*/
|
|
18
|
+
function createFixtureProjectBackend(options = {}) {
|
|
19
|
+
const now = options.now ?? Date.now;
|
|
20
|
+
let list = [...options.projects ?? []];
|
|
21
|
+
const userInProject = new Map(Object.entries(options.userInProject ?? {}));
|
|
22
|
+
const missing = new Set(options.missing ?? []);
|
|
23
|
+
let filed = { ...options.sessions };
|
|
24
|
+
let rows = [...options.sessionRows ?? []];
|
|
25
|
+
const signOuts = [];
|
|
26
|
+
const signIns = new Map(Object.entries(options.mcpSignIns ?? {}).map(([id, names]) => [id, new Set(names)]));
|
|
27
|
+
const waiting = /* @__PURE__ */ new Set();
|
|
28
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
29
|
+
let seq = 0;
|
|
30
|
+
const changed = (projectId) => {
|
|
31
|
+
for (const l of [...listeners]) l(projectId);
|
|
32
|
+
};
|
|
33
|
+
const find = (id) => {
|
|
34
|
+
const found = list.find((p) => p.id === id);
|
|
35
|
+
if (!found) throw new Error(`No project ${id}.`);
|
|
36
|
+
return found;
|
|
37
|
+
};
|
|
38
|
+
const checkHome = (home, self) => {
|
|
39
|
+
if (!home.startsWith("/")) throw new Error("home must be an absolute folder.");
|
|
40
|
+
if (list.some((p) => p.id !== self && p.home === trimmed(home))) throw new Error(`${home} is the home of another project.`);
|
|
41
|
+
return trimmed(home);
|
|
42
|
+
};
|
|
43
|
+
const checkName = (name) => {
|
|
44
|
+
const kept = name.trim();
|
|
45
|
+
if (!kept || kept.length > PROJECT_NAME_MAX) throw new Error(`name must be 1 to ${PROJECT_NAME_MAX} characters.`);
|
|
46
|
+
return kept;
|
|
47
|
+
};
|
|
48
|
+
const write = (project) => {
|
|
49
|
+
list = list.some((p) => p.id === project.id) ? list.map((p) => p.id === project.id ? project : p) : [...list, project];
|
|
50
|
+
changed(project.id);
|
|
51
|
+
return project;
|
|
52
|
+
};
|
|
53
|
+
const view = (project) => {
|
|
54
|
+
const layers = {
|
|
55
|
+
project: project.settings ?? {},
|
|
56
|
+
userInProject: userInProject.get(project.id) ?? {}
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
layers,
|
|
60
|
+
resolved: resolveSettings({
|
|
61
|
+
user: options.user ?? {},
|
|
62
|
+
...layers
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const sharing = options.organization ? fixtureSharing(options.organization, find, changed) : void 0;
|
|
67
|
+
const allow = (id, need) => {
|
|
68
|
+
const place = sharing ? sharing.get(id).you : "owner";
|
|
69
|
+
if (need === "read" ? place === null : need === "own" ? place !== "owner" : !managesProject(place)) throw new ProjectRefusedError(need === "read" ? "Only the project's members read that." : need === "own" ? "Only the project's owner does that." : "Only the project's owner or a maintainer changes that.");
|
|
70
|
+
};
|
|
71
|
+
const content = createFixtureProjectContent({
|
|
72
|
+
project: find,
|
|
73
|
+
inherit: (id) => view(find(id)).resolved.values.inherit,
|
|
74
|
+
allow,
|
|
75
|
+
changed,
|
|
76
|
+
now
|
|
77
|
+
}, options.content);
|
|
78
|
+
const artifacts = createFixtureProjectArtifacts({
|
|
79
|
+
project: find,
|
|
80
|
+
allow,
|
|
81
|
+
now
|
|
82
|
+
}, options.artifacts);
|
|
83
|
+
return {
|
|
84
|
+
...sharing ? { sharing } : {},
|
|
85
|
+
content,
|
|
86
|
+
artifacts,
|
|
87
|
+
markPublished(id, hostId, projectId) {
|
|
88
|
+
allow(id, "own");
|
|
89
|
+
const found = find(id);
|
|
90
|
+
const at = now();
|
|
91
|
+
return write({
|
|
92
|
+
...found,
|
|
93
|
+
updatedAt: at,
|
|
94
|
+
published: [...(found.published ?? []).filter((p) => p.hostId !== hostId), {
|
|
95
|
+
hostId,
|
|
96
|
+
projectId,
|
|
97
|
+
at
|
|
98
|
+
}]
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
list: (filter) => list.filter((p) => filter?.archived === true || p.archivedAt === void 0),
|
|
102
|
+
get: (id) => list.find((p) => p.id === id) ?? null,
|
|
103
|
+
create(input) {
|
|
104
|
+
const home = input.home === void 0 ? void 0 : checkHome(input.home);
|
|
105
|
+
if (home === void 0 && !input.name?.trim()) throw new Error("name is required for a project with no folder.");
|
|
106
|
+
const at = now();
|
|
107
|
+
return write({
|
|
108
|
+
id: `fixture-project-${++seq}`,
|
|
109
|
+
name: checkName(input.name?.trim() || home.split("/").pop() || home),
|
|
110
|
+
...home !== void 0 ? { home } : {},
|
|
111
|
+
references: (input.references ?? []).map(trimmed),
|
|
112
|
+
createdAt: at,
|
|
113
|
+
updatedAt: at
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
update(id, patch) {
|
|
117
|
+
const found = find(id);
|
|
118
|
+
allow(id, patch.home !== void 0 || patch.references !== void 0 ? "own" : "manage");
|
|
119
|
+
const next = {
|
|
120
|
+
...found,
|
|
121
|
+
updatedAt: now()
|
|
122
|
+
};
|
|
123
|
+
if (patch.name !== void 0) next.name = checkName(patch.name);
|
|
124
|
+
if (patch.home === null) delete next.home;
|
|
125
|
+
else if (patch.home !== void 0) next.home = checkHome(patch.home, id);
|
|
126
|
+
if (patch.references !== void 0) next.references = patch.references.map(trimmed);
|
|
127
|
+
if (patch.archived === true) next.archivedAt = next.updatedAt;
|
|
128
|
+
else if (patch.archived === false) delete next.archivedAt;
|
|
129
|
+
if (patch.defaults === null) delete next.defaults;
|
|
130
|
+
else if (patch.defaults !== void 0) next.defaults = patch.defaults;
|
|
131
|
+
return write(next);
|
|
132
|
+
},
|
|
133
|
+
delete(id) {
|
|
134
|
+
const found = find(id);
|
|
135
|
+
allow(id, "own");
|
|
136
|
+
list = list.filter((p) => p.id !== id);
|
|
137
|
+
userInProject.delete(id);
|
|
138
|
+
filed = Object.fromEntries(Object.entries(filed).filter(([, projectId]) => projectId !== id));
|
|
139
|
+
changed(id);
|
|
140
|
+
return found;
|
|
141
|
+
},
|
|
142
|
+
sessions: () => ({ ...filed }),
|
|
143
|
+
sessionRows: () => [...rows],
|
|
144
|
+
main(id) {
|
|
145
|
+
const found = find(id);
|
|
146
|
+
allow(id, "read");
|
|
147
|
+
if (found.settings?.orchestrator !== true) return null;
|
|
148
|
+
const mainId = `fixture-main-${id}`;
|
|
149
|
+
if (!rows.some((row) => row.id === mainId)) {
|
|
150
|
+
const at = now();
|
|
151
|
+
rows = [...rows, {
|
|
152
|
+
id: mainId,
|
|
153
|
+
title: "Main",
|
|
154
|
+
projectRoot: found.home ?? null,
|
|
155
|
+
cwd: found.home ?? "",
|
|
156
|
+
status: "idle",
|
|
157
|
+
createdAt: at,
|
|
158
|
+
updatedAt: at,
|
|
159
|
+
turnCount: 0,
|
|
160
|
+
userMessageCount: 0,
|
|
161
|
+
runCount: 0,
|
|
162
|
+
archived: false,
|
|
163
|
+
origin: {
|
|
164
|
+
kind: "main",
|
|
165
|
+
projectId: id
|
|
166
|
+
}
|
|
167
|
+
}];
|
|
168
|
+
filed = {
|
|
169
|
+
...filed,
|
|
170
|
+
[mainId]: id
|
|
171
|
+
};
|
|
172
|
+
changed(id);
|
|
173
|
+
}
|
|
174
|
+
return mainId;
|
|
175
|
+
},
|
|
176
|
+
resolve(folder) {
|
|
177
|
+
const real = trimmed(folder);
|
|
178
|
+
let best = null;
|
|
179
|
+
for (const p of list) if (p.home !== void 0 && holds(p.home, real) && (!best || p.home.length > best.home.length)) best = p;
|
|
180
|
+
return best;
|
|
181
|
+
},
|
|
182
|
+
settings: (id) => view(find(id)),
|
|
183
|
+
setSettings(id, layer, patch, ifAbsent = []) {
|
|
184
|
+
const found = find(id);
|
|
185
|
+
if (layer === "project") allow(id, "manage");
|
|
186
|
+
const current = { ...layer === "project" ? found.settings : userInProject.get(id) };
|
|
187
|
+
if (ifAbsent.some((key) => key in current)) return view(found);
|
|
188
|
+
const next = { ...current };
|
|
189
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
190
|
+
if (value === null) {
|
|
191
|
+
delete next[key];
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const error = projectSettingError(key, value, layer);
|
|
195
|
+
if (error) throw new Error(error);
|
|
196
|
+
next[key] = value;
|
|
197
|
+
}
|
|
198
|
+
if (layer === "project") return view(write({
|
|
199
|
+
...found,
|
|
200
|
+
settings: next,
|
|
201
|
+
updatedAt: now()
|
|
202
|
+
}));
|
|
203
|
+
userInProject.set(id, next);
|
|
204
|
+
changed(id);
|
|
205
|
+
return view(found);
|
|
206
|
+
},
|
|
207
|
+
mcpSignOut(id, name) {
|
|
208
|
+
find(id);
|
|
209
|
+
allow(id, "manage");
|
|
210
|
+
signIns.get(id)?.delete(name);
|
|
211
|
+
signOuts.push(`${id}/${name}`);
|
|
212
|
+
},
|
|
213
|
+
mcpSignIns: (id) => [...signIns.get(find(id).id) ?? []].sort().map((name) => ({ name })),
|
|
214
|
+
beginMcpSignIn(id, name, done) {
|
|
215
|
+
find(id);
|
|
216
|
+
allow(id, "manage");
|
|
217
|
+
if (!(options.mcpServers ?? []).includes(name)) throw new Error(`No MCP server "${name}" in that folder's catalog.`);
|
|
218
|
+
const flow = {
|
|
219
|
+
id,
|
|
220
|
+
name,
|
|
221
|
+
done
|
|
222
|
+
};
|
|
223
|
+
waiting.add(flow);
|
|
224
|
+
return () => void waiting.delete(flow);
|
|
225
|
+
},
|
|
226
|
+
finishSignIns() {
|
|
227
|
+
for (const flow of [...waiting]) {
|
|
228
|
+
waiting.delete(flow);
|
|
229
|
+
signIns.set(flow.id, /* @__PURE__ */ new Set([...signIns.get(flow.id) ?? [], flow.name]));
|
|
230
|
+
flow.done();
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
mcpServers: () => [...options.mcpServers ?? []],
|
|
234
|
+
folderExists: (path) => !missing.has(path),
|
|
235
|
+
signedOut: () => [...signOuts],
|
|
236
|
+
subscribe(onChange) {
|
|
237
|
+
listeners.add(onChange);
|
|
238
|
+
return () => {
|
|
239
|
+
listeners.delete(onChange);
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function fixtureSharing(org, find, changed) {
|
|
245
|
+
const shares = new Map(Object.entries(org.projects ?? {}).map(([id, share]) => [id, {
|
|
246
|
+
owner: share.owner,
|
|
247
|
+
members: { ...share.members },
|
|
248
|
+
open: share.open === true
|
|
249
|
+
}]));
|
|
250
|
+
const person = (user) => {
|
|
251
|
+
const found = org.people.find((p) => p.userId === user || p.email === user);
|
|
252
|
+
if (!found) throw new Error(`${user} is not in the organization.`);
|
|
253
|
+
return found;
|
|
254
|
+
};
|
|
255
|
+
const shareOf = (id) => {
|
|
256
|
+
find(id);
|
|
257
|
+
let share = shares.get(id);
|
|
258
|
+
if (!share) {
|
|
259
|
+
share = {
|
|
260
|
+
owner: org.me,
|
|
261
|
+
members: {},
|
|
262
|
+
open: false
|
|
263
|
+
};
|
|
264
|
+
shares.set(id, share);
|
|
265
|
+
}
|
|
266
|
+
return share;
|
|
267
|
+
};
|
|
268
|
+
const view = (id) => {
|
|
269
|
+
const share = shareOf(id);
|
|
270
|
+
const owner = org.people.find((p) => p.userId === share.owner);
|
|
271
|
+
return {
|
|
272
|
+
projectId: id,
|
|
273
|
+
...owner ? { owner } : {},
|
|
274
|
+
members: Object.entries(share.members).map(([userId, grant]) => ({
|
|
275
|
+
...person(userId),
|
|
276
|
+
grant
|
|
277
|
+
})),
|
|
278
|
+
open: share.open,
|
|
279
|
+
you: share.owner === org.me ? "owner" : share.members[org.me] ?? null,
|
|
280
|
+
sessionVisibility: share.access?.sessionVisibility ?? "agent",
|
|
281
|
+
memberGrant: share.access?.memberGrant ?? "prompt"
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
const managed = (id) => {
|
|
285
|
+
const you = view(id).you;
|
|
286
|
+
if (you !== "owner" && you !== "maintainer") throw new Error("Only the project's owner or a maintainer changes its members.");
|
|
287
|
+
return shareOf(id);
|
|
288
|
+
};
|
|
289
|
+
const owned = (id) => {
|
|
290
|
+
if (view(id).you !== "owner") throw new Error("Only the project's owner does that.");
|
|
291
|
+
return shareOf(id);
|
|
292
|
+
};
|
|
293
|
+
const done = (id) => {
|
|
294
|
+
changed(id);
|
|
295
|
+
return view(id);
|
|
296
|
+
};
|
|
297
|
+
return {
|
|
298
|
+
get: view,
|
|
299
|
+
users: () => [...org.people],
|
|
300
|
+
set(id, user, grant = "member") {
|
|
301
|
+
managed(id).members[person(user).userId] = grant;
|
|
302
|
+
return done(id);
|
|
303
|
+
},
|
|
304
|
+
remove(id, userId) {
|
|
305
|
+
delete managed(id).members[userId];
|
|
306
|
+
return done(id);
|
|
307
|
+
},
|
|
308
|
+
leave(id) {
|
|
309
|
+
delete shareOf(id).members[org.me];
|
|
310
|
+
changed(id);
|
|
311
|
+
},
|
|
312
|
+
setOpen(id, open) {
|
|
313
|
+
owned(id).open = open;
|
|
314
|
+
return done(id);
|
|
315
|
+
},
|
|
316
|
+
transfer(id, userId) {
|
|
317
|
+
const share = owned(id);
|
|
318
|
+
const heir = person(userId).userId;
|
|
319
|
+
delete share.members[heir];
|
|
320
|
+
share.members[share.owner] = "maintainer";
|
|
321
|
+
share.owner = heir;
|
|
322
|
+
return done(id);
|
|
323
|
+
},
|
|
324
|
+
directory: () => [...shares].filter(([, share]) => share.open).map(([id, share]) => {
|
|
325
|
+
const owner = org.people.find((p) => p.userId === share.owner);
|
|
326
|
+
return {
|
|
327
|
+
projectId: id,
|
|
328
|
+
name: find(id).name,
|
|
329
|
+
...owner ? { owner } : {},
|
|
330
|
+
members: Object.keys(share.members).length,
|
|
331
|
+
joined: share.owner === org.me || org.me in share.members
|
|
332
|
+
};
|
|
333
|
+
}),
|
|
334
|
+
join(id) {
|
|
335
|
+
const share = shareOf(id);
|
|
336
|
+
if (!share.open) throw new Error("This project is not open.");
|
|
337
|
+
if (share.owner !== org.me) share.members[org.me] ??= "member";
|
|
338
|
+
return done(id);
|
|
339
|
+
},
|
|
340
|
+
setSessionAccess(id, access) {
|
|
341
|
+
const share = managed(id);
|
|
342
|
+
share.access = {
|
|
343
|
+
...share.access,
|
|
344
|
+
...access
|
|
345
|
+
};
|
|
346
|
+
return done(id);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* A sign-in that opens {@link FIXTURE_MCP_SIGN_IN_URL} and is done once the backend hears the browser; a refused start
|
|
352
|
+
* ends it with the backend's words.
|
|
353
|
+
*
|
|
354
|
+
* @param begin - Starts it on the backend with what runs once it is done. Returns its cancel.
|
|
355
|
+
*/
|
|
356
|
+
function fixtureSignIn(begin) {
|
|
357
|
+
const state = writable({ kind: "starting" });
|
|
358
|
+
let cancel = () => {};
|
|
359
|
+
try {
|
|
360
|
+
cancel = begin(() => state.set({ kind: "done" }));
|
|
361
|
+
state.set({
|
|
362
|
+
kind: "url",
|
|
363
|
+
url: FIXTURE_MCP_SIGN_IN_URL
|
|
364
|
+
});
|
|
365
|
+
} catch (err) {
|
|
366
|
+
state.set({
|
|
367
|
+
kind: "error",
|
|
368
|
+
message: err instanceof Error ? err.message : String(err)
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
return {
|
|
372
|
+
state,
|
|
373
|
+
cancel: () => cancel()
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* The `SessionHost.projects` of a fixture backend: every member, the backend's changes heard as `projects:changed`.
|
|
378
|
+
*
|
|
379
|
+
* @param backend - The backend.
|
|
380
|
+
* @param options - `organization`: offer the shared MCP sign-ins of a server in organization mode.
|
|
381
|
+
* @param options.organization - Offer `mcpSignIns`, `mcpSignIn` and `mcpSignOut`.
|
|
382
|
+
* @param options.pickFolder - What a folder pick answers. Absent: no `pickFolder`.
|
|
383
|
+
* @param options.publishTargets - The servers a project publishes to: each publish makes the project there under an id
|
|
384
|
+
* of the server's, and records it on the project. Absent: no `publish`.
|
|
385
|
+
*/
|
|
386
|
+
function createFixtureSessionProjects(backend, options = {}) {
|
|
387
|
+
const sharing = backend.sharing;
|
|
388
|
+
const state = createProjectsState({
|
|
389
|
+
list: async () => backend.list(),
|
|
390
|
+
settings: async (id) => backend.settings(id),
|
|
391
|
+
...sharing ? { place: async (id) => sharing.get(id).you } : {},
|
|
392
|
+
content: async (id) => backend.content.list(id)
|
|
393
|
+
});
|
|
394
|
+
const sessions = createProjectSessionsState({
|
|
395
|
+
rows: async () => backend.sessionRows(),
|
|
396
|
+
sessionProjects: async () => backend.sessions()
|
|
397
|
+
});
|
|
398
|
+
backend.subscribe((projectId) => {
|
|
399
|
+
state.wake(projectId);
|
|
400
|
+
sessions.wake();
|
|
401
|
+
});
|
|
402
|
+
const { wake: wakeArtifacts, ...artifacts } = createProjectArtifacts({
|
|
403
|
+
list: async (id) => backend.artifacts.list(id),
|
|
404
|
+
add: async (id, input) => backend.artifacts.add(id, input),
|
|
405
|
+
pin: async (id, artifactId, change) => backend.artifacts.pin(id, artifactId, change),
|
|
406
|
+
unpin: async (id, artifactId) => backend.artifacts.unpin(id, artifactId),
|
|
407
|
+
remove: async (id, artifactId) => backend.artifacts.remove(id, artifactId)
|
|
408
|
+
});
|
|
409
|
+
backend.artifacts.subscribe(wakeArtifacts);
|
|
410
|
+
const { pickFolder, publishTargets } = options;
|
|
411
|
+
return {
|
|
412
|
+
list: state.list,
|
|
413
|
+
refresh: state.refresh,
|
|
414
|
+
ensure: state.ensure,
|
|
415
|
+
settings: state.settings,
|
|
416
|
+
refreshSettings: state.refreshSettings,
|
|
417
|
+
ensureSettings: state.ensureSettings,
|
|
418
|
+
resolve: async (folder) => backend.resolve(folder),
|
|
419
|
+
sessionProjects: async () => backend.sessions(),
|
|
420
|
+
create: async (input) => {
|
|
421
|
+
const created = backend.create(input);
|
|
422
|
+
state.apply(created);
|
|
423
|
+
return created;
|
|
424
|
+
},
|
|
425
|
+
update: async (id, patch) => {
|
|
426
|
+
const updated = backend.update(id, patch);
|
|
427
|
+
state.apply(updated);
|
|
428
|
+
return updated;
|
|
429
|
+
},
|
|
430
|
+
setSettings: async (id, layer, patch, ifAbsent) => {
|
|
431
|
+
const view = backend.setSettings(id, layer, patch, ifAbsent);
|
|
432
|
+
state.applySettings(id, view);
|
|
433
|
+
return view;
|
|
434
|
+
},
|
|
435
|
+
delete: async (id) => {
|
|
436
|
+
backend.delete(id);
|
|
437
|
+
state.drop(id);
|
|
438
|
+
},
|
|
439
|
+
folderExists: async (path) => backend.folderExists(path),
|
|
440
|
+
sessions: {
|
|
441
|
+
list: sessions.list,
|
|
442
|
+
refresh: sessions.refresh,
|
|
443
|
+
ensure: sessions.ensure
|
|
444
|
+
},
|
|
445
|
+
main: async (id) => backend.main(id),
|
|
446
|
+
...pickFolder ? { pickFolder: async () => pickFolder() } : {},
|
|
447
|
+
mcpServers: async () => backend.mcpServers(),
|
|
448
|
+
content: projectContentHost(state, {
|
|
449
|
+
history: async (id, itemId) => backend.content.history(id, itemId),
|
|
450
|
+
put: async (id, input) => backend.content.put(id, input),
|
|
451
|
+
remove: async (id, itemId) => backend.content.remove(id, itemId),
|
|
452
|
+
restore: async (id, itemId, version) => backend.content.restore(id, itemId, version),
|
|
453
|
+
saveToRepo: async (id, itemId) => backend.content.saveToRepo(id, itemId)
|
|
454
|
+
}),
|
|
455
|
+
artifacts,
|
|
456
|
+
...options.organization ? {
|
|
457
|
+
mcpSignOut: async (id, name) => backend.mcpSignOut(id, name),
|
|
458
|
+
mcpSignIns: async (id) => backend.mcpSignIns(id).map((signIn) => signIn.name),
|
|
459
|
+
mcpSignIn: (id, name) => fixtureSignIn((done) => backend.beginMcpSignIn(id, name, done))
|
|
460
|
+
} : {},
|
|
461
|
+
...sharing ? { sharing: {
|
|
462
|
+
places: state.places,
|
|
463
|
+
ensurePlace: state.ensurePlace,
|
|
464
|
+
get: async (id) => sharing.get(id),
|
|
465
|
+
users: async () => sharing.users(),
|
|
466
|
+
set: async (id, user, grant) => sharing.set(id, user, grant),
|
|
467
|
+
remove: async (id, userId) => sharing.remove(id, userId),
|
|
468
|
+
leave: async (id) => sharing.leave(id),
|
|
469
|
+
setOpen: async (id, open) => sharing.setOpen(id, open),
|
|
470
|
+
transfer: async (id, userId) => sharing.transfer(id, userId),
|
|
471
|
+
directory: async () => sharing.directory(),
|
|
472
|
+
join: async (id) => sharing.join(id),
|
|
473
|
+
setSessionAccess: async (id, access) => sharing.setSessionAccess(id, access)
|
|
474
|
+
} } : {},
|
|
475
|
+
...publishTargets ? { publish: {
|
|
476
|
+
targets: async () => publishTargets.map(({ hostId, name }) => ({
|
|
477
|
+
hostId,
|
|
478
|
+
name
|
|
479
|
+
})),
|
|
480
|
+
folders: async (hostId) => [...publishTargets.find((t) => t.hostId === hostId)?.folders ?? []],
|
|
481
|
+
publish: async (id, to) => {
|
|
482
|
+
if (!publishTargets.some((t) => t.hostId === to.hostId)) throw new Error(`No server ${to.hostId}.`);
|
|
483
|
+
const found = backend.get(id);
|
|
484
|
+
if (!found) throw new Error(`No project ${id}.`);
|
|
485
|
+
const { published: _published, home: _home, id: _id, ...rest } = found;
|
|
486
|
+
const there = {
|
|
487
|
+
...rest,
|
|
488
|
+
id: `${to.hostId}:${id}`,
|
|
489
|
+
...to.home ? { home: to.home } : {},
|
|
490
|
+
references: [...to.references ?? []]
|
|
491
|
+
};
|
|
492
|
+
state.apply(backend.markPublished(id, to.hostId, there.id));
|
|
493
|
+
return there;
|
|
494
|
+
}
|
|
495
|
+
} } : {}
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
export { FIXTURE_MCP_SIGN_IN_URL, createFixtureProjectBackend, createFixtureSessionProjects };
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
* a block of its own (id `<panel>#<n>`) over the same panel, with its own
|
|
17
17
|
* place, width, view, name and icon; removing it forgets it, where removing
|
|
18
18
|
* the panel's own block hides it. Any block may be renamed and given an icon.
|
|
19
|
+
*
|
|
20
|
+
* Built-in blocks: the home's own Sessions and Artifacts ({@link HOME_SESSIONS_BLOCK},
|
|
21
|
+
* {@link HOME_ARTIFACTS_BLOCK}) are blocks like the panels' (a source the styled
|
|
22
|
+
* home adds to the catalog), placed, sized, hidden and named the same way, but
|
|
23
|
+
* never copied: they show the project's one list. Prefs stored before them
|
|
24
|
+
* never placed them, so they come after the placed blocks.
|
|
19
25
|
*/
|
|
20
26
|
import { ProjectIcon } from "../../chat/headless/sidebar/project-icons.js";
|
|
21
27
|
import { PanelHomeLayout, PanelIcon, PanelSurface, PanelView, PanelViewItem } from "zidane/chat/pure";
|
|
@@ -96,6 +102,16 @@ export type HomeRow = {
|
|
|
96
102
|
kind: 'pair';
|
|
97
103
|
blocks: readonly [HomeBlock, HomeBlock];
|
|
98
104
|
};
|
|
105
|
+
/** The home's own Sessions list as a block (`ProjectSessionsList`). */
|
|
106
|
+
export declare const HOME_SESSIONS_BLOCK = "zidane/sessions";
|
|
107
|
+
/** The home's own Artifacts list as a block (`ProjectArtifactsHome`). */
|
|
108
|
+
export declare const HOME_ARTIFACTS_BLOCK = "zidane/artifacts";
|
|
109
|
+
/**
|
|
110
|
+
* Whether a panel id is one of the home's built-in blocks (drawn by the kit, never copied).
|
|
111
|
+
*
|
|
112
|
+
* @param panel - The block's panel id.
|
|
113
|
+
*/
|
|
114
|
+
export declare function isBuiltinHomeBlock(panel: string): boolean;
|
|
99
115
|
/**
|
|
100
116
|
* The panels that are blocks, in default order (`home.order`, then catalog order).
|
|
101
117
|
*
|
|
@@ -165,7 +181,7 @@ export declare function hideHomeBlock(prefs: HomePrefs, id: string): HomePrefs;
|
|
|
165
181
|
export declare function showHomeBlock(prefs: HomePrefs, blocks: readonly HomeBlock[], id: string, defaults?: readonly string[]): HomePrefs;
|
|
166
182
|
/**
|
|
167
183
|
* `prefs` with a new copy of block `id`'s panel: right after it, at its width and with its view.
|
|
168
|
-
* Unchanged when block `id` is not shown.
|
|
184
|
+
* Unchanged when block `id` is not shown, or is a built-in block.
|
|
169
185
|
*
|
|
170
186
|
* @param prefs - The arrangement.
|
|
171
187
|
* @param blocks - The blocks in default order ({@link homeBlocksOf}).
|
|
@@ -175,7 +191,7 @@ export declare function showHomeBlock(prefs: HomePrefs, blocks: readonly HomeBlo
|
|
|
175
191
|
export declare function duplicateHomeBlock(prefs: HomePrefs, blocks: readonly HomeBlock[], id: string, defaults?: readonly string[]): HomePrefs;
|
|
176
192
|
/**
|
|
177
193
|
* `prefs` with a new copy of `panel` after every shown block, at the panel's width and with no view
|
|
178
|
-
* (Add block on a panel already shown). Unchanged when the panel is not among `blocks
|
|
194
|
+
* (Add block on a panel already shown). Unchanged when the panel is not among `blocks`, or is a built-in block.
|
|
179
195
|
*
|
|
180
196
|
* @param prefs - The arrangement.
|
|
181
197
|
* @param blocks - The blocks in default order ({@link homeBlocksOf}).
|
|
@@ -14,6 +14,19 @@ const EMPTY_HOME_PREFS = {
|
|
|
14
14
|
/** The longest name kept for a block. */
|
|
15
15
|
const HOME_BLOCK_NAME_MAX = 80;
|
|
16
16
|
const DEFAULT_ORDER = 100;
|
|
17
|
+
/** The home's own Sessions list as a block (`ProjectSessionsList`). */
|
|
18
|
+
const HOME_SESSIONS_BLOCK = "zidane/sessions";
|
|
19
|
+
/** The home's own Artifacts list as a block (`ProjectArtifactsHome`). */
|
|
20
|
+
const HOME_ARTIFACTS_BLOCK = "zidane/artifacts";
|
|
21
|
+
const BUILTIN_BLOCKS = [HOME_SESSIONS_BLOCK, HOME_ARTIFACTS_BLOCK];
|
|
22
|
+
/**
|
|
23
|
+
* Whether a panel id is one of the home's built-in blocks (drawn by the kit, never copied).
|
|
24
|
+
*
|
|
25
|
+
* @param panel - The block's panel id.
|
|
26
|
+
*/
|
|
27
|
+
function isBuiltinHomeBlock(panel) {
|
|
28
|
+
return BUILTIN_BLOCKS.includes(panel);
|
|
29
|
+
}
|
|
17
30
|
/**
|
|
18
31
|
* The panels that are blocks, in default order (`home.order`, then catalog order).
|
|
19
32
|
*
|
|
@@ -182,11 +195,11 @@ function showHomeBlock(prefs, blocks, id, defaults) {
|
|
|
182
195
|
]
|
|
183
196
|
};
|
|
184
197
|
}
|
|
185
|
-
/** The copies of `prefs` whose panel is still among `blocks
|
|
198
|
+
/** The copies of `prefs` whose panel is still among `blocks` (a built-in block has none). */
|
|
186
199
|
function copiesOf(blocks, prefs) {
|
|
187
200
|
const out = [];
|
|
188
201
|
for (const [id, panel] of Object.entries(prefs.copies)) {
|
|
189
|
-
const source = blocks.find((b) => b.id === panel);
|
|
202
|
+
const source = isBuiltinHomeBlock(panel) ? void 0 : blocks.find((b) => b.id === panel);
|
|
190
203
|
if (source) out.push({
|
|
191
204
|
...source,
|
|
192
205
|
id,
|
|
@@ -203,7 +216,7 @@ function nextCopyId(prefs, panel) {
|
|
|
203
216
|
}
|
|
204
217
|
/**
|
|
205
218
|
* `prefs` with a new copy of block `id`'s panel: right after it, at its width and with its view.
|
|
206
|
-
* Unchanged when block `id` is not shown.
|
|
219
|
+
* Unchanged when block `id` is not shown, or is a built-in block.
|
|
207
220
|
*
|
|
208
221
|
* @param prefs - The arrangement.
|
|
209
222
|
* @param blocks - The blocks in default order ({@link homeBlocksOf}).
|
|
@@ -213,7 +226,7 @@ function nextCopyId(prefs, panel) {
|
|
|
213
226
|
function duplicateHomeBlock(prefs, blocks, id, defaults) {
|
|
214
227
|
const { shown } = arrangeHomeBlocks(blocks, prefs, defaults);
|
|
215
228
|
const source = shown.find((b) => b.id === id);
|
|
216
|
-
if (!source) return prefs;
|
|
229
|
+
if (!source || isBuiltinHomeBlock(source.panel)) return prefs;
|
|
217
230
|
const copy = nextCopyId(prefs, source.panel);
|
|
218
231
|
const ids = shown.map((b) => b.id);
|
|
219
232
|
ids.splice(ids.indexOf(id) + 1, 0, copy);
|
|
@@ -237,7 +250,7 @@ function duplicateHomeBlock(prefs, blocks, id, defaults) {
|
|
|
237
250
|
}
|
|
238
251
|
/**
|
|
239
252
|
* `prefs` with a new copy of `panel` after every shown block, at the panel's width and with no view
|
|
240
|
-
* (Add block on a panel already shown). Unchanged when the panel is not among `blocks
|
|
253
|
+
* (Add block on a panel already shown). Unchanged when the panel is not among `blocks`, or is a built-in block.
|
|
241
254
|
*
|
|
242
255
|
* @param prefs - The arrangement.
|
|
243
256
|
* @param blocks - The blocks in default order ({@link homeBlocksOf}).
|
|
@@ -245,7 +258,7 @@ function duplicateHomeBlock(prefs, blocks, id, defaults) {
|
|
|
245
258
|
* @param defaults - The blocks shown before the user adds any ({@link arrangeHomeBlocks}).
|
|
246
259
|
*/
|
|
247
260
|
function addHomeBlockCopy(prefs, blocks, panel, defaults) {
|
|
248
|
-
if (!blocks.some((b) => b.id === panel)) return prefs;
|
|
261
|
+
if (!blocks.some((b) => b.id === panel) || isBuiltinHomeBlock(panel)) return prefs;
|
|
249
262
|
const { shown } = arrangeHomeBlocks(blocks, prefs, defaults);
|
|
250
263
|
const ids = shown.map((b) => b.id);
|
|
251
264
|
const copy = nextCopyId(prefs, panel);
|
|
@@ -412,4 +425,4 @@ function parseHomePrefs(raw) {
|
|
|
412
425
|
}
|
|
413
426
|
return out;
|
|
414
427
|
}
|
|
415
|
-
export { EMPTY_HOME_PREFS, HOME_BLOCK_NAME_MAX, addHomeBlockCopy, arrangeHomeBlocks, duplicateHomeBlock, hideHomeBlock, homeBlocksOf, homeRows, moveHomeBlock, parseHomePrefs, placeHomeBlock, removeHomeBlock, renameHomeBlock, setHomeBlockIcon, setHomeBlockView, setHomeBlockWidth, showHomeBlock };
|
|
428
|
+
export { EMPTY_HOME_PREFS, HOME_ARTIFACTS_BLOCK, HOME_BLOCK_NAME_MAX, HOME_SESSIONS_BLOCK, addHomeBlockCopy, arrangeHomeBlocks, duplicateHomeBlock, hideHomeBlock, homeBlocksOf, homeRows, isBuiltinHomeBlock, moveHomeBlock, parseHomePrefs, placeHomeBlock, removeHomeBlock, renameHomeBlock, setHomeBlockIcon, setHomeBlockView, setHomeBlockWidth, showHomeBlock };
|