@kortix/ui 0.14.7 → 0.14.9
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/README.md +2 -2
- package/dist/_vendor/kortix-shared.js +64 -4
- package/dist/_vendor/shared/app-config.d.ts +175 -0
- package/dist/_vendor/shared/channel-message.d.ts +34 -5
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/runtime-versions.d.ts +4 -0
- package/dist/_vendor/shared/space-slug.d.ts +37 -0
- package/dist/access/access/access-detail-shell.js +1 -1
- package/dist/access/access/access-dialog-share.js +4 -7
- package/dist/access/access/access-dialog.js +2 -1
- package/dist/access/access/principal-picker.d.ts +11 -0
- package/dist/access/access/principal-picker.js +9 -7
- package/dist/apps/app-preview-pool.d.ts +7 -2
- package/dist/apps/app-preview-pool.js +11 -5
- package/dist/apps/app-shared.d.ts +22 -15
- package/dist/apps/app-shared.js +37 -19
- package/dist/apps/index.d.ts +2 -2
- package/dist/apps/index.js +2 -2
- package/dist/artifacts/artifact-frame.d.ts +16 -0
- package/dist/artifacts/artifact-frame.js +51 -0
- package/dist/artifacts/artifact-session.d.ts +18 -0
- package/dist/artifacts/artifact-session.js +101 -0
- package/dist/artifacts/frame-policy.d.ts +30 -0
- package/dist/artifacts/frame-policy.js +61 -0
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +5 -0
- package/dist/browser/sandbox-browser-chrome.d.ts +4 -1
- package/dist/browser/sandbox-browser-chrome.js +2 -2
- package/dist/customize/agents/agent-cover-card.d.ts +17 -0
- package/dist/customize/agents/agent-cover-card.js +13 -0
- package/dist/customize/agents/agent-grant-pages.d.ts +5 -1
- package/dist/customize/agents/agent-grant-pages.js +30 -4
- package/dist/customize/agents/agent-page.js +8 -33
- package/dist/customize/agents/agent-policy-sets.d.ts +43 -0
- package/dist/customize/agents/agent-policy-sets.js +72 -0
- package/dist/customize/agents/agent-triggers-section.js +2 -1
- package/dist/customize/agents/agents-page.js +43 -49
- package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.d.ts +6 -1
- package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.js +10 -4
- package/dist/customize/connectors/agent-access.d.ts +35 -0
- package/dist/customize/connectors/agent-access.js +77 -0
- package/dist/customize/connectors/catalog/browse-sections.d.ts +2 -29
- package/dist/customize/connectors/catalog/browse-sections.js +7 -74
- package/dist/customize/connectors/catalog/catalog-entry.d.ts +18 -37
- package/dist/customize/connectors/catalog/catalog-entry.js +28 -40
- package/dist/customize/connectors/catalog/connector-browse.d.ts +3 -32
- package/dist/customize/connectors/catalog/connector-browse.js +19 -50
- package/dist/customize/connectors/catalog/use-catalog.d.ts +20 -59
- package/dist/customize/connectors/catalog/use-catalog.js +48 -175
- package/dist/customize/connectors/connector-identity.d.ts +9 -11
- package/dist/customize/connectors/connector-identity.js +13 -42
- package/dist/customize/connectors/connector-moves-banner.d.ts +2 -1
- package/dist/customize/connectors/connector-moves-banner.js +4 -6
- package/dist/customize/connectors/connector-routes.d.ts +21 -9
- package/dist/customize/connectors/connector-routes.js +29 -20
- package/dist/customize/connectors/connectors-page.js +53 -82
- package/dist/customize/connectors/detail/app-page.js +226 -98
- package/dist/customize/connectors/detail/computer-app-page.d.ts +16 -0
- package/dist/customize/connectors/detail/computer-app-page.js +39 -0
- package/dist/customize/connectors/detail/connector-accounts.js +3 -1
- package/dist/customize/connectors/detail/connector-advanced-tools.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-advanced-tools.js +2 -2
- package/dist/customize/connectors/detail/connector-agents.d.ts +14 -0
- package/dist/customize/connectors/detail/connector-agents.js +69 -0
- package/dist/customize/connectors/detail/connector-detail-tabs.js +2 -1
- package/dist/customize/connectors/detail/connector-move-row.d.ts +8 -5
- package/dist/customize/connectors/detail/connector-move-row.js +23 -14
- package/dist/customize/connectors/detail/connector-page.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-page.js +14 -10
- package/dist/customize/connectors/detail/connector-policy-sets.d.ts +28 -0
- package/dist/customize/connectors/detail/connector-policy-sets.js +203 -0
- package/dist/customize/connectors/detail/connector-settings.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-settings.js +7 -3
- package/dist/customize/connectors/detail/connector-status.d.ts +19 -6
- package/dist/customize/connectors/detail/connector-status.js +34 -10
- package/dist/customize/connectors/detail/connector-tabs.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-tabs.js +8 -2
- package/dist/customize/connectors/detail/connector-tools.d.ts +3 -3
- package/dist/customize/connectors/detail/connector-tools.js +105 -48
- package/dist/customize/connectors/detail/email-inboxes.d.ts +43 -0
- package/dist/customize/connectors/detail/email-inboxes.js +184 -0
- package/dist/customize/connectors/detail/provider-info.d.ts +1 -1
- package/dist/customize/connectors/detail/provider-info.js +2 -2
- package/dist/customize/connectors/detail/status-badge.d.ts +1 -1
- package/dist/customize/connectors/detail/status-badge.js +4 -5
- package/dist/customize/connectors/detail/use-connector-detail.d.ts +6 -0
- package/dist/customize/connectors/detail/use-connector-detail.js +14 -4
- package/dist/customize/connectors/install/install-dialog.d.ts +23 -0
- package/dist/customize/connectors/install/install-dialog.js +40 -0
- package/dist/customize/connectors/install/install.d.ts +13 -2
- package/dist/customize/connectors/install/install.js +9 -4
- package/dist/customize/connectors/install/use-install.d.ts +19 -2
- package/dist/customize/connectors/install/use-install.js +65 -37
- package/dist/customize/connectors/install/way-kind.d.ts +5 -0
- package/dist/customize/connectors/install/way-kind.js +16 -0
- package/dist/customize/connectors/provider-label.d.ts +2 -1
- package/dist/customize/connectors/provider-label.js +13 -3
- package/dist/customize/connectors/tools/pattern-rule-draft.d.ts +4 -0
- package/dist/customize/connectors/tools/pattern-rule-draft.js +12 -3
- package/dist/customize/connectors/tools/policy-sets.d.ts +27 -0
- package/dist/customize/connectors/tools/policy-sets.js +41 -0
- package/dist/customize/connectors/tools/tool-groups.d.ts +32 -9
- package/dist/customize/connectors/tools/tool-groups.js +78 -16
- package/dist/customize/connectors/tools/tool-policy-control.d.ts +11 -10
- package/dist/customize/connectors/tools/tool-policy-control.js +15 -16
- package/dist/customize/connectors/tools/tool-policy-labels.d.ts +6 -5
- package/dist/customize/connectors/tools/tool-policy-labels.js +17 -16
- package/dist/customize/connectors/tools/tool-policy.d.ts +50 -4
- package/dist/customize/connectors/tools/tool-policy.js +74 -8
- package/dist/customize/connectors/use-agent-access.d.ts +85 -0
- package/dist/customize/connectors/use-agent-access.js +72 -0
- package/dist/customize/migrate-to-v2/index.d.ts +1 -2
- package/dist/customize/migrate-to-v2/index.js +1 -2
- package/dist/customize/migrate-to-v2/migration-prompt.d.ts +12 -24
- package/dist/customize/migrate-to-v2/migration-prompt.js +34 -235
- package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +1 -1
- package/dist/customize/migrate-to-v2/upgrade-defs.js +7 -6
- package/dist/customize/migrate-to-v2/upgrade-view.js +7 -7
- package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +3 -3
- package/dist/customize/providers/provider-accordion.js +17 -2
- package/dist/customize/sections/component/channel-access-panel.d.ts +16 -0
- package/dist/customize/sections/component/channel-access-panel.js +146 -0
- package/dist/customize/sections/component/channel-connect-hero.d.ts +3 -2
- package/dist/customize/sections/component/channel-connect-hero.js +3 -2
- package/dist/customize/sections/component/channel-hero-frame.d.ts +31 -0
- package/dist/customize/sections/component/channel-hero-frame.js +40 -0
- package/dist/customize/sections/component/channel-mocks.d.ts +6 -0
- package/dist/customize/sections/component/channel-mocks.js +46 -0
- package/dist/customize/sections/component/channel-row.d.ts +13 -3
- package/dist/customize/sections/component/channel-row.js +10 -4
- package/dist/customize/sections/component/email-connect-form.d.ts +27 -0
- package/dist/customize/sections/component/email-connect-form.js +183 -0
- package/dist/customize/sections/component/slack-connect-card.d.ts +7 -0
- package/dist/customize/sections/component/slack-connect-card.js +2 -3
- package/dist/customize/sections/component/teams-connect-card.d.ts +7 -0
- package/dist/customize/sections/component/teams-connect-card.js +2 -3
- package/dist/customize/sections/component/telegram-channel-row.js +16 -25
- package/dist/customize/sections/connectors-view.d.ts +1 -15
- package/dist/customize/sections/connectors-view.js +81 -314
- package/dist/customize/sections/view/agent-editor-catalog.js +5 -0
- package/dist/customize/sections/view/channels-view.d.ts +5 -1
- package/dist/customize/sections/view/channels-view.js +63 -81
- package/dist/customize/sections/view/gateway/gateway-overview.js +10 -2
- package/dist/customize/settings/tabs/experimental-tab.js +35 -16
- package/dist/customize/shared/catalog/catalog-empty-state.d.ts +1 -12
- package/dist/customize/shared/catalog/catalog-empty-state.js +3 -3
- package/dist/customize/shared/channels-switch-dialog.d.ts +18 -0
- package/dist/customize/shared/channels-switch-dialog.js +30 -0
- package/dist/customize/shared/feature-gate-screen.js +27 -9
- package/dist/customize/shared/new-entity-menu.js +4 -1
- package/dist/customize/shared/use-customize-prefetch.d.ts +2 -3
- package/dist/customize/shared/use-customize-prefetch.js +9 -27
- package/dist/customize/skills/skills-page.js +4 -5
- package/dist/customize/triggers/schedule/post-to-field.d.ts +18 -0
- package/dist/customize/triggers/schedule/post-to-field.js +49 -0
- package/dist/customize/triggers/schedule/schedule-copy.d.ts +10 -6
- package/dist/customize/triggers/schedule/schedule-copy.js +42 -11
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +2 -1
- package/dist/customize/triggers/schedule/then-fields.js +1 -5
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +22 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +25 -0
- package/dist/customize/triggers/schedule/trigger-composer.d.ts +5 -0
- package/dist/customize/triggers/schedule/trigger-composer.js +23 -14
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +3 -0
- package/dist/customize/triggers/schedule/trigger-filter.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +2 -2
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -0
- package/dist/customize/triggers/schedule/trigger-toast.js +2 -1
- package/dist/customize/triggers/schedule-view.js +9 -4
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.js +1 -0
- package/dist/files/project/change-request-recovery.d.ts +1 -26
- package/dist/files/project/change-request-recovery.js +1 -59
- package/dist/files/project/components/change-request-detail-dialog.js +13 -3
- package/dist/files/project/components/drive-explorer.js +15 -15
- package/dist/files/project/components/drive-toolbar.d.ts +16 -2
- package/dist/files/project/components/drive-toolbar.js +14 -5
- package/dist/files/project/hooks/use-change-request-recovery.js +3 -19
- package/dist/files/project/hooks/use-change-requests.d.ts +1 -0
- package/dist/files/project/hooks/use-change-requests.js +11 -2
- package/dist/files/renderers/image-frame.d.ts +46 -0
- package/dist/files/renderers/image-frame.js +59 -0
- package/dist/files/renderers/image-renderer.d.ts +11 -1
- package/dist/files/renderers/image-renderer.js +13 -3
- package/dist/files/renderers/pdf/pdf-clipboard.d.ts +2 -0
- package/dist/files/renderers/pdf/pdf-clipboard.js +21 -0
- package/dist/files/renderers/pdf/pdf-viewer.js +4 -2
- package/dist/files/renderers/show-content-renderer.d.ts +9 -1
- package/dist/files/renderers/show-content-renderer.js +56 -14
- package/dist/files/runtime/file-source.js +2 -0
- package/dist/files/runtime/hooks/use-binary-blob.d.ts +10 -1
- package/dist/files/runtime/hooks/use-binary-blob.js +10 -4
- package/dist/files/runtime/hooks/use-shared-image.d.ts +41 -0
- package/dist/files/runtime/hooks/use-shared-image.js +177 -0
- package/dist/files/viewer/file-content-renderer.d.ts +22 -1
- package/dist/files/viewer/file-content-renderer.js +50 -7
- package/dist/files/viewer/file-header.d.ts +7 -3
- package/dist/files/viewer/file-header.js +20 -11
- package/dist/files/viewer/file-preview-modal.d.ts +1 -1
- package/dist/files/viewer/file-preview-modal.js +10 -22
- package/dist/files/viewer/file-source.d.ts +13 -0
- package/dist/files/viewer/use-file-content-state.d.ts +2 -0
- package/dist/files/viewer/use-file-content-state.js +28 -10
- package/dist/files/viewer/viewer-actions.d.ts +3 -1
- package/dist/files/viewer/viewer-actions.js +2 -2
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-mobile.d.ts +5 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/i18n/en.d.ts +906 -70
- package/dist/i18n/en.js +924 -88
- package/dist/i18n/ui-catalog/localize-ui-catalog.js +4 -0
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +15 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/internal/account-hub/account-settings-sidebar.js +1 -1
- package/dist/internal/account-hub/hub-sheet.d.ts +9 -1
- package/dist/internal/account-hub/hub-sheet.js +21 -5
- package/dist/internal/account-hub/sections.d.ts +1 -1
- package/dist/internal/account-hub/sections.js +2 -1
- package/dist/internal/auth/auth-card-shell.js +3 -3
- package/dist/internal/components/agent-mark.d.ts +38 -0
- package/dist/internal/components/agent-mark.js +41 -0
- package/dist/internal/connector-logo/connector-logo-source.d.ts +63 -0
- package/dist/internal/connector-logo/connector-logo-source.js +48 -0
- package/dist/internal/connector-logo/connector-logo.d.ts +39 -0
- package/dist/internal/connector-logo/connector-logo.js +56 -0
- package/dist/internal/connector-logo/connector-mark-files.d.ts +11 -0
- package/dist/internal/connector-logo/connector-mark-files.js +35 -0
- package/dist/internal/files/file-read-retry.d.ts +13 -0
- package/dist/internal/files/file-read-retry.js +23 -3
- package/dist/internal/files/session-drive-files.d.ts +5 -1
- package/dist/internal/files/session-drive-files.js +7 -2
- package/dist/internal/hooks/channels/use-channels-installations.d.ts +32 -5
- package/dist/internal/hooks/channels/use-channels-installations.js +55 -7
- package/dist/internal/hooks/channels/use-email-inboxes.d.ts +19 -0
- package/dist/internal/hooks/channels/use-email-inboxes.js +48 -0
- package/dist/internal/hooks/connectors/use-add-account.js +1 -1
- package/dist/internal/hooks/index.d.ts +1 -1
- package/dist/internal/hooks/index.js +1 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +9 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +28 -12
- package/dist/internal/hooks/use-auto-scroll.d.ts +8 -1
- package/dist/internal/hooks/use-auto-scroll.js +4 -4
- package/dist/internal/icons/telegram.d.ts +5 -0
- package/dist/internal/icons/telegram.js +6 -1
- package/dist/internal/layout/nav-hover-card.d.ts +35 -0
- package/dist/internal/layout/nav-hover-card.js +84 -0
- package/dist/internal/layout/project-nav-row.d.ts +3 -1
- package/dist/internal/layout/project-nav-row.js +3 -2
- package/dist/internal/layout/project-page-header.d.ts +4 -2
- package/dist/internal/layout/project-page-header.js +4 -3
- package/dist/internal/layout/project-settings-nav.js +59 -2
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +7 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +15 -0
- package/dist/internal/lib/manifest-version.d.ts +1 -1
- package/dist/internal/lib/manifest-version.js +2 -2
- package/dist/internal/lib/memory-href.d.ts +16 -0
- package/dist/internal/lib/memory-href.js +46 -0
- package/dist/internal/lib/pixel-mark.d.ts +33 -0
- package/dist/internal/lib/pixel-mark.js +152 -0
- package/dist/internal/lib/use-project-feature-flags.js +11 -11
- package/dist/internal/lib/utils/heic-convert.d.ts +1 -1
- package/dist/internal/lib/utils/heic-convert.js +3 -4
- package/dist/internal/lib/web-notifications.d.ts +20 -0
- package/dist/internal/lib/web-notifications.js +48 -4
- package/dist/internal/notifications/notification-bell.d.ts +4 -1
- package/dist/internal/notifications/notification-bell.js +2 -2
- package/dist/internal/selection/selection-bar.d.ts +2 -1
- package/dist/internal/selection/selection-bar.js +1 -1
- package/dist/internal/stores/file-preview-store.d.ts +29 -2
- package/dist/internal/stores/file-preview-store.js +19 -1
- package/dist/internal/stores/kortix-computer-store.js +3 -0
- package/dist/internal/stores/sidebar-nav-store.d.ts +1 -1
- package/dist/internal/stores/sidebar-nav-store.js +3 -1
- package/dist/lib/routes.d.ts +13 -1
- package/dist/lib/routes.js +13 -0
- package/dist/markdown/genui/components/inline.d.ts +1 -1
- package/dist/markdown/index.d.ts +2 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/setup-links/approval-decision.d.ts +1 -0
- package/dist/markdown/setup-links/approval-decision.js +6 -2
- package/dist/markdown/setup-links/connector-handshake.d.ts +3 -1
- package/dist/markdown/setup-links/connector-handshake.js +12 -10
- package/dist/markdown/setup-links/show-connect-hero.d.ts +28 -0
- package/dist/markdown/setup-links/show-connect-hero.js +91 -0
- package/dist/markdown/unified-markdown.js +5 -5
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.js +2 -0
- package/dist/primitives/disclosure.js +14 -2
- package/dist/primitives/empty-art.d.ts +12 -0
- package/dist/primitives/empty-art.js +11 -0
- package/dist/primitives/entity-avatar.d.ts +4 -1
- package/dist/primitives/entity-avatar.js +4 -2
- package/dist/primitives/mermaid-renderer.d.ts +2 -0
- package/dist/primitives/mermaid-renderer.js +21 -15
- package/dist/primitives/resizable.js +6 -1
- package/dist/primitives/resize-seam.d.ts +11 -0
- package/dist/primitives/resize-seam.js +12 -0
- package/dist/primitives/sidebar-panel.js +4 -7
- package/dist/primitives/tabs.d.ts +14 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/user-avatar.d.ts +3 -1
- package/dist/primitives/user-avatar.js +4 -2
- package/dist/providers/ui-provider.d.ts +10 -1
- package/dist/session/composer/ComposerAboveCard.d.ts +1 -1
- package/dist/session/composer/ComposerAboveCard.js +2 -2
- package/dist/session/composer/ComposerCard.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +3 -3
- package/dist/session/composer/agent-selector.d.ts +19 -1
- package/dist/session/composer/agent-selector.js +42 -12
- package/dist/session/composer/composer-agent-access.d.ts +15 -0
- package/dist/session/composer/composer-agent-access.js +27 -0
- package/dist/session/composer/composer-chat-input.d.ts +8 -2
- package/dist/session/composer/composer-chat-input.js +8 -6
- package/dist/session/composer/composer-logic.d.ts +16 -0
- package/dist/session/composer/composer-logic.js +12 -0
- package/dist/session/composer/composer-underbar.d.ts +3 -1
- package/dist/session/composer/composer-underbar.js +4 -3
- package/dist/session/composer/composer.d.ts +15 -1
- package/dist/session/composer/composer.js +19 -1
- package/dist/session/composer/context-usage.d.ts +5 -0
- package/dist/session/composer/context-usage.js +6 -1
- package/dist/session/composer/draft/composer-draft.d.ts +6 -2
- package/dist/session/composer/draft/composer-draft.js +5 -1
- package/dist/session/composer/reasoning-effort-selector.js +1 -1
- package/dist/session/composer/token-progress.js +4 -4
- package/dist/session/header/export-transcript-modal.d.ts +3 -2
- package/dist/session/header/export-transcript-modal.js +6 -3
- package/dist/session/models/chatgpt-connection-button.d.ts +11 -0
- package/dist/session/models/chatgpt-connection-button.js +54 -0
- package/dist/session/models/model-selector.d.ts +3 -1
- package/dist/session/models/model-selector.js +7 -3
- package/dist/session/models/use-model-connection-gate.d.ts +5 -5
- package/dist/session/models/use-model-connection-gate.js +5 -5
- package/dist/session/outcomes/jump-to-outcome.d.ts +10 -0
- package/dist/session/outcomes/jump-to-outcome.js +11 -0
- package/dist/session/outcomes/session-outcomes-bridge.d.ts +14 -0
- package/dist/session/outcomes/session-outcomes-bridge.js +12 -0
- package/dist/session/outcomes/session-outcomes-provider.d.ts +3 -1
- package/dist/session/outcomes/session-outcomes-provider.js +33 -3
- package/dist/session/panel/easy/app-preview.d.ts +10 -0
- package/dist/session/panel/easy/app-preview.js +31 -12
- package/dist/session/panel/easy/change-requests-card.d.ts +7 -0
- package/dist/session/panel/easy/change-requests-card.js +17 -0
- package/dist/session/panel/easy/easy-panel-logic.js +7 -1
- package/dist/session/panel/easy/easy-panel.js +5 -2
- package/dist/session/panel/easy/file-preview.js +1 -1
- package/dist/session/panel/easy/outputs-card.d.ts +2 -1
- package/dist/session/panel/easy/outputs-card.js +3 -2
- package/dist/session/panel/easy/plan-card.d.ts +2 -0
- package/dist/session/panel/easy/plan-card.js +2 -0
- package/dist/session/panel/mobile-tool-drawer.js +7 -1
- package/dist/session/panel/session-audit-panel.js +9 -2
- package/dist/session/panel/session-detail-panel.js +9 -3
- package/dist/session/panel/session-files-explorer.d.ts +9 -0
- package/dist/session/panel/session-files-explorer.js +12 -3
- package/dist/session/panel/session-panel-provider.d.ts +15 -1
- package/dist/session/panel/session-panel-provider.js +32 -7
- package/dist/session/panel/shared/derive-panels.d.ts +8 -1
- package/dist/session/panel/shared/derive-panels.js +12 -2
- package/dist/session/panel/shared/output-priority.js +2 -0
- package/dist/session/participants/session-participants.d.ts +5 -1
- package/dist/session/participants/session-participants.js +9 -2
- package/dist/session/prompts/approval-request.d.ts +5 -0
- package/dist/session/prompts/approval-request.js +7 -1
- package/dist/session/prompts/session-approval-review.d.ts +9 -0
- package/dist/session/prompts/session-approval-review.js +18 -0
- package/dist/session/status/session-error-banner.js +2 -49
- package/dist/session/status/session-starting-loader.d.ts +14 -2
- package/dist/session/status/session-starting-loader.js +16 -4
- package/dist/session/thread/after-first-prompt.d.ts +7 -0
- package/dist/session/thread/after-first-prompt.js +8 -0
- package/dist/session/thread/detect-command.d.ts +12 -0
- package/dist/session/thread/detect-command.js +20 -0
- package/dist/session/thread/plan-surface.d.ts +1 -0
- package/dist/session/thread/plan-surface.js +1 -0
- package/dist/session/thread/session-chat.d.ts +3 -1
- package/dist/session/thread/session-chat.js +377 -252
- package/dist/session/thread/session-context-metrics.d.ts +15 -0
- package/dist/session/thread/session-context-metrics.js +10 -1
- package/dist/session/thread/session-context-modal.d.ts +4 -2
- package/dist/session/thread/session-context-modal.js +16 -9
- package/dist/session/thread/session-thread.d.ts +3 -1
- package/dist/session/thread/session-thread.js +9 -2
- package/dist/session/thread/thread-boot-rows.d.ts +36 -0
- package/dist/session/thread/thread-boot-rows.js +89 -0
- package/dist/session/thread/transcript-rows.d.ts +31 -0
- package/dist/session/thread/transcript-rows.js +3 -0
- package/dist/session/thread/transcript.d.ts +4 -9
- package/dist/session/thread/transcript.js +119 -21
- package/dist/session/thread/turn-share.d.ts +16 -0
- package/dist/session/thread/turn-share.js +162 -0
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +28 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +31 -3
- package/dist/session/tool/tool-part-renderer.d.ts +5 -4
- package/dist/session/tool/tool-part-renderer.js +8 -3
- package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -0
- package/dist/session/tool/tools/apply-patch-tool.js +1 -0
- package/dist/session/tool/tools/bash-tool.js +7 -6
- package/dist/session/tool/tools/channel-send-card.d.ts +1 -2
- package/dist/session/tool/tools/channel-send.d.ts +2 -1
- package/dist/session/tool/tools/codemode-tool.js +1 -1
- package/dist/session/tool/tools/connector-tools.js +1 -1
- package/dist/session/tool/tools/image-gen-tool.d.ts +1 -1
- package/dist/session/tool/tools/image-gen-tool.js +240 -53
- package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-kill-tool.js +1 -0
- package/dist/session/tool/tools/pty-read-tool.d.ts +2 -0
- package/dist/session/tool/tools/pty-read-tool.js +2 -0
- package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -0
- package/dist/session/tool/tools/pty-write-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-write-tool.js +1 -0
- package/dist/session/tool/tools/show-tool.js +19 -8
- package/dist/session/tool/tools/todo-write-tool.d.ts +1 -0
- package/dist/session/tool/tools/todo-write-tool.js +1 -0
- package/dist/session/turn/channel-brand.d.ts +8 -3
- package/dist/session/turn/channel-brand.js +20 -4
- package/dist/session/turn/message-author-label.js +6 -2
- package/dist/session/turn/message-author.d.ts +8 -0
- package/dist/session/turn/message-author.js +24 -0
- package/dist/session/turn/message-row.d.ts +52 -0
- package/dist/session/turn/message-row.js +44 -0
- package/dist/session/turn/plan-anchor.d.ts +4 -1
- package/dist/session/turn/plan-anchor.js +4 -1
- package/dist/session/turn/plan-card.d.ts +7 -0
- package/dist/session/turn/plan-card.js +7 -0
- package/dist/session/turn/user-message.d.ts +7 -1
- package/dist/session/turn/user-message.js +21 -7
- package/dist/styles.css +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/workspace/home/access-requests-bell.d.ts +9 -2
- package/dist/workspace/home/access-requests-bell.js +20 -6
- package/dist/workspace/home/first-chat.d.ts +8 -21
- package/dist/workspace/home/first-chat.js +22 -72
- package/dist/workspace/index.d.ts +6 -0
- package/dist/workspace/index.js +6 -0
- package/dist/workspace/layout/project-home.d.ts +14 -2
- package/dist/workspace/layout/project-home.js +60 -21
- package/dist/workspace/layout/use-project-home-send.d.ts +9 -1
- package/dist/workspace/layout/use-project-home-send.js +82 -3
- package/dist/workspace/memory/body-doc.d.ts +17 -0
- package/dist/workspace/memory/body-doc.js +208 -0
- package/dist/workspace/memory/body-extensions.d.ts +38 -0
- package/dist/workspace/memory/body-extensions.js +103 -0
- package/dist/workspace/memory/company-memory-page.d.ts +8 -0
- package/dist/workspace/memory/company-memory-page.js +16 -0
- package/dist/workspace/memory/memory-all.d.ts +20 -0
- package/dist/workspace/memory/memory-all.js +27 -0
- package/dist/workspace/memory/memory-body.d.ts +19 -0
- package/dist/workspace/memory/memory-body.js +139 -0
- package/dist/workspace/memory/memory-empty.d.ts +13 -0
- package/dist/workspace/memory/memory-empty.js +28 -0
- package/dist/workspace/memory/memory-history.d.ts +27 -0
- package/dist/workspace/memory/memory-history.js +108 -0
- package/dist/workspace/memory/memory-labels.d.ts +16 -0
- package/dist/workspace/memory/memory-labels.js +47 -0
- package/dist/workspace/memory/memory-page-list.d.ts +34 -0
- package/dist/workspace/memory/memory-page-list.js +156 -0
- package/dist/workspace/memory/memory-reader.d.ts +58 -0
- package/dist/workspace/memory/memory-reader.js +123 -0
- package/dist/workspace/memory/memory-view.d.ts +21 -0
- package/dist/workspace/memory/memory-view.js +124 -0
- package/dist/workspace/memory/remember-popover.d.ts +19 -0
- package/dist/workspace/memory/remember-popover.js +61 -0
- package/dist/workspace/memory/remember-this.d.ts +12 -0
- package/dist/workspace/memory/remember-this.js +89 -0
- package/dist/workspace/memory/source-mark.d.ts +18 -0
- package/dist/workspace/memory/source-mark.js +79 -0
- package/dist/workspace/memory/used-memory-chip.d.ts +14 -0
- package/dist/workspace/memory/used-memory-chip.js +61 -0
- package/dist/workspace/new/advanced-fields.d.ts +2 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/source-param.d.ts +1 -1
- package/dist/workspace/new/source-param.js +3 -1
- package/dist/workspace/new/use-create-workspace.d.ts +8 -10
- package/dist/workspace/new/use-create-workspace.js +3 -3
- package/dist/workspace/projects/onboarding/app-logo.d.ts +7 -2
- package/dist/workspace/projects/onboarding/app-logo.js +6 -13
- package/dist/workspace/projects/policies-panel.js +5 -3
- package/dist/workspace/review/review-actions.d.ts +4 -2
- package/dist/workspace/review/review-actions.js +8 -2
- package/dist/workspace/review/review-center.js +11 -7
- package/dist/workspace/review/review-detail.d.ts +10 -0
- package/dist/workspace/review/review-detail.js +101 -13
- package/dist/workspace/saved-session-skeleton.d.ts +2 -2
- package/dist/workspace/saved-session-skeleton.js +3 -3
- package/dist/workspace/session-workspace.js +15 -13
- package/dist/workspace/sessions/project-sessions-view.js +3 -2
- package/dist/workspace/sessions/sessions-toolbar.d.ts +3 -1
- package/dist/workspace/sessions/sessions-toolbar.js +2 -2
- package/dist/workspace/sidebar/footer/project-apps-nav.d.ts +5 -0
- package/dist/workspace/sidebar/footer/project-apps-nav.js +41 -2
- package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +22 -0
- package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +13 -13
- package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +7 -0
- package/dist/workspace/sidebar/footer/project-memory-nav.js +19 -0
- package/dist/workspace/sidebar/nav-row-meta.js +14 -2
- package/dist/workspace/sidebar/project-nav-items.js +3 -0
- package/dist/workspace/sidebar/project-session-list.js +68 -56
- package/dist/workspace/sidebar/project-sidebar.js +9 -2
- package/dist/workspace/sidebar/project-spaces-nav.d.ts +8 -0
- package/dist/workspace/sidebar/project-spaces-nav.js +69 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +28 -1
- package/dist/workspace/sidebar/session-group-order.d.ts +9 -0
- package/dist/workspace/sidebar/session-group-order.js +25 -0
- package/dist/workspace/sidebar/session-group-sections.d.ts +62 -0
- package/dist/workspace/sidebar/session-group-sections.js +267 -0
- package/dist/workspace/sidebar/session-list-chrome.d.ts +28 -0
- package/dist/workspace/sidebar/session-list-chrome.js +50 -0
- package/dist/workspace/spaces/channel-glyph.d.ts +5 -0
- package/dist/workspace/spaces/channel-glyph.js +6 -0
- package/dist/workspace/spaces/channel-setup.d.ts +16 -0
- package/dist/workspace/spaces/channel-setup.js +105 -0
- package/dist/workspace/spaces/channels-onboarding.d.ts +13 -0
- package/dist/workspace/spaces/channels-onboarding.js +37 -0
- package/dist/workspace/spaces/create-channel-dialog.d.ts +16 -0
- package/dist/workspace/spaces/create-channel-dialog.js +158 -0
- package/dist/workspace/spaces/private-channels-not-in.d.ts +9 -0
- package/dist/workspace/spaces/private-channels-not-in.js +69 -0
- package/dist/workspace/spaces/space-agents.d.ts +10 -0
- package/dist/workspace/spaces/space-agents.js +10 -0
- package/dist/workspace/spaces/space-details-dialog.d.ts +20 -0
- package/dist/workspace/spaces/space-details-dialog.js +176 -0
- package/dist/workspace/spaces/space-link-label.d.ts +49 -0
- package/dist/workspace/spaces/space-link-label.js +73 -0
- package/dist/workspace/spaces/space-links.d.ts +19 -0
- package/dist/workspace/spaces/space-links.js +230 -0
- package/dist/workspace/spaces/space-members.d.ts +46 -0
- package/dist/workspace/spaces/space-members.js +182 -0
- package/dist/workspace/spaces/space-roster.d.ts +15 -0
- package/dist/workspace/spaces/space-roster.js +44 -0
- package/dist/workspace/spaces/space-threads-tab.d.ts +56 -0
- package/dist/workspace/spaces/space-threads-tab.js +156 -0
- package/dist/workspace/spaces/space-timeline-view.d.ts +254 -0
- package/dist/workspace/spaces/space-timeline-view.js +235 -0
- package/dist/workspace/spaces/space-timeline.d.ts +106 -0
- package/dist/workspace/spaces/space-timeline.js +183 -0
- package/dist/workspace/spaces/space-triggers.d.ts +13 -0
- package/dist/workspace/spaces/space-triggers.js +78 -0
- package/dist/workspace/spaces/space-view.d.ts +37 -0
- package/dist/workspace/spaces/space-view.js +436 -0
- package/package.json +31 -32
- package/skills/kortix-ui/SKILL.md +3 -3
- package/skills/kortix-ui/references/custom-dashboard.md +3 -3
- package/skills/kortix-ui/references/modules.md +28 -4
- package/skills/kortix-ui/references/theming.md +1 -1
- package/dist/customize/agents/agent-nav.prototype.d.ts +0 -35
- package/dist/customize/agents/agent-nav.prototype.js +0 -95
- package/dist/customize/connectors/catalog/merge-search.d.ts +0 -10
- package/dist/customize/connectors/catalog/merge-search.js +0 -26
- package/dist/customize/connectors/detail/find-easy-connect-app.d.ts +0 -29
- package/dist/customize/connectors/detail/find-easy-connect-app.js +0 -22
- package/dist/customize/migrate-to-v2/use-migrate-to-v2.d.ts +0 -9
- package/dist/customize/migrate-to-v2/use-migrate-to-v2.js +0 -24
- package/dist/customize/sections/connector-connection-header.d.ts +0 -36
- package/dist/customize/sections/connector-connection-header.js +0 -33
- package/dist/customize/sections/connector-connection-modal.d.ts +0 -34
- package/dist/customize/sections/connector-connection-modal.js +0 -72
- package/dist/customize/sections/discover-catalogue-card.d.ts +0 -19
- package/dist/customize/sections/discover-catalogue-card.js +0 -26
- package/dist/customize/sections/discover-catalogue-detail.d.ts +0 -15
- package/dist/customize/sections/discover-catalogue-detail.js +0 -24
- package/dist/customize/sections/discover-catalogue.d.ts +0 -17
- package/dist/customize/sections/discover-catalogue.js +0 -132
- package/dist/customize/sections/llm-provider/provider-access-menu.d.ts +0 -10
- package/dist/customize/sections/llm-provider/provider-access-menu.js +0 -23
- package/dist/files/project/components/drive-empty-art.d.ts +0 -2
- package/dist/files/project/components/drive-empty-art.js +0 -5
- package/dist/internal/hooks/use-media-query.d.ts +0 -2
- package/dist/internal/share/public-share-link-button.d.ts +0 -14
- package/dist/internal/share/public-share-link-button.js +0 -17
- /package/dist/{internal/hooks → hooks}/use-media-query.js +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { listConnectorPolicySets, listConnectors } from '@kortix/sdk';
|
|
4
|
+
import { contract, qk } from '@kortix/sdk/react';
|
|
5
|
+
import { RobotIcon } from '@phosphor-icons/react';
|
|
6
|
+
import { useQuery } from '@tanstack/react-query';
|
|
7
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
8
|
+
import { Button } from '../../../primitives/button.js';
|
|
9
|
+
import { EmptyState } from '../../../primitives/empty-state.js';
|
|
10
|
+
import { ErrorState } from '../../../primitives/error-state.js';
|
|
11
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../primitives/select.js';
|
|
12
|
+
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
13
|
+
import { Switch } from '../../../primitives/switch.js';
|
|
14
|
+
import { agentHref } from '../../../internal/lib/capability-tab-routes.js';
|
|
15
|
+
import { UiLink as Link } from '../../../providers/ui-provider.js';
|
|
16
|
+
import { agentConnectorAccess } from '../agent-access.js';
|
|
17
|
+
import { humanizeToolName as policySetLabel } from '../tools/tool-groups.js';
|
|
18
|
+
import { connectorPolicySetsKey, supportsPolicySets } from '../tools/policy-sets.js';
|
|
19
|
+
import { useAgentAccess } from '../use-agent-access.js';
|
|
20
|
+
const BASE_VALUE = '__base';
|
|
21
|
+
/**
|
|
22
|
+
* Agents — which agents can use this connector, and with which rule set. One
|
|
23
|
+
* row per agent: a switch gives or takes the connector, and a picker chooses
|
|
24
|
+
* the rule set (Base rules or one of the connector's sets). Each change
|
|
25
|
+
* commits kortix.yaml (`PUT …/agents/{name}/scope`).
|
|
26
|
+
*
|
|
27
|
+
* Read-only for a caller without both `project.agent.write` and
|
|
28
|
+
* `project.connector.write`: the rows still say who has access.
|
|
29
|
+
*/
|
|
30
|
+
export function ConnectorAgents({ projectId, connector }) {
|
|
31
|
+
const t = useTranslations('connectorPages');
|
|
32
|
+
const tSets = useTranslations('connectorPolicySets');
|
|
33
|
+
const access = useAgentAccess(projectId);
|
|
34
|
+
const slug = connector.slug;
|
|
35
|
+
const showSets = supportsPolicySets(connector.provider);
|
|
36
|
+
const setsQuery = useQuery({
|
|
37
|
+
queryKey: connectorPolicySetsKey(projectId, slug),
|
|
38
|
+
queryFn: () => listConnectorPolicySets(projectId, slug),
|
|
39
|
+
enabled: showSets && access.canEdit,
|
|
40
|
+
});
|
|
41
|
+
const connectorsQuery = useQuery({
|
|
42
|
+
queryKey: qk.project.connectors(projectId),
|
|
43
|
+
queryFn: () => listConnectors(projectId, { includeSchemas: false }),
|
|
44
|
+
...contract('config'),
|
|
45
|
+
});
|
|
46
|
+
const allSlugs = (connectorsQuery.data?.connectors ?? []).map((item) => item.slug);
|
|
47
|
+
const sets = setsQuery.data?.sets ?? [];
|
|
48
|
+
if (access.isPending) {
|
|
49
|
+
return (_jsx("div", { className: "space-y-2", children: [0, 1].map((row) => (_jsx(Skeleton, { className: "h-13 rounded-md" }, row))) }));
|
|
50
|
+
}
|
|
51
|
+
if (access.isError) {
|
|
52
|
+
return (_jsx(ErrorState, { size: "sm", title: t('agentsLoadFailed'), description: access.error instanceof Error ? access.error.message : undefined, action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void access.refetch(), children: tSets('retry') }) }));
|
|
53
|
+
}
|
|
54
|
+
if (!access.supported) {
|
|
55
|
+
return _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('agentsNeedsV2') });
|
|
56
|
+
}
|
|
57
|
+
if (access.agents.length === 0) {
|
|
58
|
+
return _jsx(EmptyState, { icon: RobotIcon, size: "sm", title: t('agentsEmpty') });
|
|
59
|
+
}
|
|
60
|
+
return (_jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: access.canEdit ? t('agentsIntro') : t('agentsReadOnly') }), _jsx("ul", { className: "bg-popover divide-y overflow-hidden rounded-md border", children: access.agents.map((agent) => {
|
|
61
|
+
const row = agentConnectorAccess(access.grantsOf(agent), slug);
|
|
62
|
+
const busy = access.pending === agent;
|
|
63
|
+
// Also covers a reader, who cannot list the sets: the value still shows.
|
|
64
|
+
const missing = row.policySet !== null && !sets.some((set) => set.name === row.policySet);
|
|
65
|
+
return (_jsxs("li", { className: "flex min-h-13 flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2", children: [_jsx(Link, { href: `${agentHref(projectId, agent)}?section=connectors`, className: "text-foreground min-w-0 flex-1 truncate text-sm font-medium underline-offset-4 hover:underline", children: agent }), showSets && row.granted ? (_jsxs(Select, { value: row.policySet ?? BASE_VALUE, disabled: !access.canEdit || busy, onValueChange: (next) => void access
|
|
66
|
+
.setPolicySet(agent, slug, next === BASE_VALUE ? null : next, allSlugs)
|
|
67
|
+
.catch(() => undefined), children: [_jsx(SelectTrigger, { size: "sm", className: "w-40 shrink-0", "aria-label": tSets('agentSelectLabel', { name: agent }), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { align: "end", children: [_jsx(SelectItem, { value: BASE_VALUE, children: tSets('baseRules') }), sets.map((set) => (_jsx(SelectItem, { value: set.name, description: set.description ?? undefined, children: policySetLabel(set.name) }, set.name))), missing && row.policySet ? (_jsx(SelectItem, { value: row.policySet, children: policySetLabel(row.policySet) })) : null] })] })) : null, _jsx(Switch, { label: t('agentsCanUse'), "aria-label": t('agentsCanUseNamed', { name: agent }), checked: row.granted, disabled: !access.canEdit || busy, onCheckedChange: (on) => void access.setGrant(agent, slug, on, allSlugs).catch(() => undefined), className: "shrink-0 px-0 py-0" })] }, agent));
|
|
68
|
+
}) })] }));
|
|
69
|
+
}
|
|
@@ -5,6 +5,7 @@ import { TabsContent } from '../../../primitives/tabs.js';
|
|
|
5
5
|
import { ErrorState } from '../../../primitives/error-state.js';
|
|
6
6
|
import { useTranslations } from '../../../i18n/index.js';
|
|
7
7
|
import { ConnectorAccounts } from './connector-accounts.js';
|
|
8
|
+
import { ConnectorAgents } from './connector-agents.js';
|
|
8
9
|
import { ConnectorSettings } from './connector-settings.js';
|
|
9
10
|
import { ConnectorTools } from './connector-tools.js';
|
|
10
11
|
import { ConnectorTriggers } from './connector-triggers.js';
|
|
@@ -14,5 +15,5 @@ export function ConnectorDetailTabs({ accounts, settings, connectionsQuery, }) {
|
|
|
14
15
|
const { projectId, connector, displayName, canWrite, onChanged } = accounts;
|
|
15
16
|
return (_jsxs(_Fragment, { children: [_jsx(TabsContent, { value: "accounts", children: connectionsQuery.isError ? (_jsx(ErrorState, { size: "sm", title: tI18nComplete.raw('textbda9de7688c0'), description: connectionsQuery.error instanceof Error
|
|
16
17
|
? connectionsQuery.error.message
|
|
17
|
-
: tI18nComplete.raw('textd8eda34a089a'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void connectionsQuery.refetch(), children: tI18nComplete.raw('text942087cc2d41') }) })) : (_jsx(ConnectorAccounts, { ...accounts })) }), _jsx(TabsContent, { value: "tools", children: _jsx(ConnectorTools, { projectId: projectId, connector: connector, displayName: displayName, canWrite: canWrite, onChanged: onChanged }) }), _jsx(TabsContent, { value: "triggers", children: _jsx(ConnectorTriggers, { projectId: projectId, connector: connector, displayName: displayName }) }), _jsx(TabsContent, { value: "settings", children: _jsx(ConnectorSettings, { ...settings }) })] }));
|
|
18
|
+
: tI18nComplete.raw('textd8eda34a089a'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void connectionsQuery.refetch(), children: tI18nComplete.raw('text942087cc2d41') }) })) : (_jsx(ConnectorAccounts, { ...accounts })) }), _jsx(TabsContent, { value: "tools", children: _jsx(ConnectorTools, { projectId: projectId, connector: connector, displayName: displayName, canWrite: canWrite, onChanged: onChanged }) }), _jsx(TabsContent, { value: "agents", children: _jsx(ConnectorAgents, { projectId: projectId, connector: connector }) }), _jsx(TabsContent, { value: "triggers", children: _jsx(ConnectorTriggers, { projectId: projectId, connector: connector, displayName: displayName }) }), _jsx(TabsContent, { value: "settings", children: _jsx(ConnectorSettings, { ...settings }) })] }));
|
|
18
19
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type AdminConnector } from '@kortix/sdk';
|
|
2
2
|
export declare const connectorMovesQueryKey: (projectId: string) => readonly ["connector-moves", string];
|
|
3
|
-
/** The move of a Pipedream or Composio connector
|
|
3
|
+
/** The move of a Pipedream or Composio connector, or undefined. */
|
|
4
4
|
export declare function useConnectorMove(projectId: string, connector: AdminConnector): import("@kortix/sdk").ConnectorMove | undefined;
|
|
5
5
|
/**
|
|
6
|
-
* A Pipedream
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* A Pipedream connector: Kortix retires Pipedream.
|
|
7
|
+
* With a Kortix app for it, the row moves the connector there: the person signs
|
|
8
|
+
* in once, and the connector switches when the sign-in completes (it keeps its
|
|
9
|
+
* slug). Without one, it says the connector stays on Pipedream.
|
|
10
|
+
*
|
|
11
|
+
* A Composio connector is a supported way to connect. Its row appears only when
|
|
12
|
+
* the app also has its own MCP server, and offers the switch as an option.
|
|
10
13
|
*/
|
|
11
14
|
export declare function ConnectorMoveRow({ projectId, connector, displayName, canWrite, onMoved, }: {
|
|
12
15
|
projectId: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { listConnectorMoves, moveConnector } from '@kortix/sdk';
|
|
4
|
-
import { useFeatureFlag } from '@kortix/sdk/react';
|
|
5
4
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
6
5
|
import { useState } from 'react';
|
|
7
6
|
import { Button } from '../../../primitives/button.js';
|
|
@@ -12,10 +11,9 @@ import { startDiscoveredSignIn } from '../../sections/connector-oauth2-start.js'
|
|
|
12
11
|
import { useTranslations } from '../../../i18n/index.js';
|
|
13
12
|
import { ConnectorNoticeRow } from './connector-notice-view.js';
|
|
14
13
|
export const connectorMovesQueryKey = (projectId) => ['connector-moves', projectId];
|
|
15
|
-
/** The move of a Pipedream or Composio connector
|
|
14
|
+
/** The move of a Pipedream or Composio connector, or undefined. */
|
|
16
15
|
export function useConnectorMove(projectId, connector) {
|
|
17
|
-
const enabled =
|
|
18
|
-
(connector.provider === 'pipedream' || connector.provider === 'composio');
|
|
16
|
+
const enabled = connector.provider === 'pipedream' || connector.provider === 'composio';
|
|
19
17
|
const moves = useQuery({
|
|
20
18
|
queryKey: connectorMovesQueryKey(projectId),
|
|
21
19
|
queryFn: () => listConnectorMoves(projectId),
|
|
@@ -24,10 +22,13 @@ export function useConnectorMove(projectId, connector) {
|
|
|
24
22
|
return enabled ? moves.data?.find((candidate) => candidate.slug === connector.slug) : undefined;
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
|
-
* A Pipedream
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
25
|
+
* A Pipedream connector: Kortix retires Pipedream.
|
|
26
|
+
* With a Kortix app for it, the row moves the connector there: the person signs
|
|
27
|
+
* in once, and the connector switches when the sign-in completes (it keeps its
|
|
28
|
+
* slug). Without one, it says the connector stays on Pipedream.
|
|
29
|
+
*
|
|
30
|
+
* A Composio connector is a supported way to connect. Its row appears only when
|
|
31
|
+
* the app also has its own MCP server, and offers the switch as an option.
|
|
31
32
|
*/
|
|
32
33
|
export function ConnectorMoveRow({ projectId, connector, displayName, canWrite, onMoved, }) {
|
|
33
34
|
const t = useTranslations('connectorPages');
|
|
@@ -58,15 +59,23 @@ export function ConnectorMoveRow({ projectId, connector, displayName, canWrite,
|
|
|
58
59
|
});
|
|
59
60
|
if (!move)
|
|
60
61
|
return null;
|
|
61
|
-
const
|
|
62
|
+
const composio = move.provider === 'composio';
|
|
63
|
+
// A Composio connector with no MCP server of its own: nothing to offer.
|
|
64
|
+
if (composio && !move.to)
|
|
65
|
+
return null;
|
|
66
|
+
const provider = composio ? 'Composio' : 'Pipedream';
|
|
62
67
|
// The other accounts hold logins of the old provider, which no Kortix app accepts.
|
|
63
68
|
const others = Math.max(0, move.accounts - 1);
|
|
64
69
|
const start = () => (others > 0 ? setConfirming(true) : run.mutate());
|
|
65
|
-
return (_jsxs(_Fragment, { children: [_jsx(ConnectorNoticeRow, { title: move.to
|
|
66
|
-
? t('
|
|
67
|
-
:
|
|
68
|
-
? t('
|
|
69
|
-
: t('
|
|
70
|
+
return (_jsxs(_Fragment, { children: [_jsx(ConnectorNoticeRow, { title: composio && move.to
|
|
71
|
+
? t('moveComposioTitle', { app: move.to.name })
|
|
72
|
+
: move.to
|
|
73
|
+
? t('moveTitle', { app: move.to.name, provider })
|
|
74
|
+
: t('moveNoneTitle', { name: displayName, provider }), detail: _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: composio && move.to
|
|
75
|
+
? t('moveComposioBody', { app: move.to.name, slug: connector.slug })
|
|
76
|
+
: move.to
|
|
77
|
+
? t('moveBody', { app: move.to.name, slug: connector.slug, provider })
|
|
78
|
+
: t('moveNoneBody', { name: displayName, provider }) }), children: move.to && canWrite ? (_jsxs(Button, { size: "sm", variant: composio ? 'secondary' : 'default', className: "gap-1.5", onClick: start, disabled: run.isPending, children: [run.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, move.signed_in ? t('moveFinishAction') : composio ? t('moveComposioAction') : t('moveAction')] })) : null }), _jsx(ConfirmDialog, { open: confirming, onOpenChange: setConfirming, title: t('moveConfirmTitle', { app: move.to?.name ?? displayName }), description: t('moveConfirmBody', { count: others, provider }), confirmLabel: t('moveAction'), isPending: run.isPending, onConfirm: () => {
|
|
70
79
|
setConfirming(false);
|
|
71
80
|
run.mutate();
|
|
72
81
|
} })] }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AdminConnector } from '@kortix/sdk';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
+
import { type AppRef } from '../connector-routes.js';
|
|
3
4
|
/** The column `CapabilityPageShell` gives the list page beside this one. */
|
|
4
5
|
/**
|
|
5
6
|
* `/projects/<id>/customize/connectors/<app>/<connector>` — one connector, as
|
|
@@ -30,6 +31,8 @@ export interface ConnectorDetailViewProps {
|
|
|
30
31
|
/** The view's own connector is gone: leave it (the page routes back, the
|
|
31
32
|
* modal closes). */
|
|
32
33
|
onLeave: () => void;
|
|
34
|
+
/** The catalogue app the URL names, when it names one: Settings links to its page. */
|
|
35
|
+
app?: AppRef | null;
|
|
33
36
|
/** The tab and the install hand-offs live in the URL on the page. The modal
|
|
34
37
|
* keeps its tab in state, so it never rewrites its host page's URL. */
|
|
35
38
|
urlState?: boolean;
|
|
@@ -41,7 +44,7 @@ export interface ConnectorDetailViewProps {
|
|
|
41
44
|
* tabs. The page (`/connectors/<app>/<connector>`) and the agent editor's
|
|
42
45
|
* connector modal render this same view, so the two cannot drift.
|
|
43
46
|
*/
|
|
44
|
-
export declare function ConnectorDetailView({ projectId, connector, canWrite, onChanged, onRemoved, back, headerEnd, wrapTitle, onLeave, urlState, columnClassName, }: ConnectorDetailViewProps): import("react").JSX.Element;
|
|
47
|
+
export declare function ConnectorDetailView({ projectId, connector, canWrite, onChanged, onRemoved, back, headerEnd, wrapTitle, onLeave, urlState, columnClassName, app, }: ConnectorDetailViewProps): import("react").JSX.Element;
|
|
45
48
|
/**
|
|
46
49
|
* The strip's bottom row when something is wrong: a one-line title, the raw
|
|
47
50
|
* failure as a quiet log line, and the buttons that fix it. No icon tile; the
|
|
@@ -21,8 +21,9 @@ import { errorToast } from '../../../primitives/toast.js';
|
|
|
21
21
|
import { EmptyState } from '../../../primitives/empty-state.js';
|
|
22
22
|
import { ErrorState } from '../../../primitives/error-state.js';
|
|
23
23
|
import { ComputerConnectModal } from '../../../internal/tunnel/computer-connect.js';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { ConnectorLogo } from '../../../internal/connector-logo/connector-logo.js';
|
|
25
|
+
import { installedConnectorLogoSource } from '../../../internal/connector-logo/connector-logo-source.js';
|
|
26
|
+
import { appRefFromLocation, connectorsHref } from '../connector-routes.js';
|
|
26
27
|
import { startDiscoveredSignIn } from '../../sections/connector-oauth2-start.js';
|
|
27
28
|
import { SetCredentialModal } from '../../sections/connectors-view.js';
|
|
28
29
|
import { useOauth2Return } from '../../../internal/hooks/connectors/use-oauth2-return.js';
|
|
@@ -78,8 +79,9 @@ export function ConnectorPage({ projectId, appSegment, connectorSlug, }) {
|
|
|
78
79
|
}
|
|
79
80
|
}, [connectorSlug, projectId, queryClient]);
|
|
80
81
|
useOauth2Return(invalidate);
|
|
82
|
+
// Back goes to the list: an installed app's page only redirects here.
|
|
81
83
|
const app = appRefFromLocation(appSegment, search);
|
|
82
|
-
const backHref =
|
|
84
|
+
const backHref = connectorsHref(projectId);
|
|
83
85
|
const state = connectorPageState({
|
|
84
86
|
found: connector !== null,
|
|
85
87
|
isPending: connectorsQuery.isPending,
|
|
@@ -95,21 +97,21 @@ export function ConnectorPage({ projectId, appSegment, connectorSlug, }) {
|
|
|
95
97
|
: tI18nComplete.raw('textd8eda34a089a'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void connectorsQuery.refetch(), children: tI18nComplete.raw('text942087cc2d41') }) }) }));
|
|
96
98
|
}
|
|
97
99
|
if (!connector) {
|
|
98
|
-
return (_jsx(DetailPageShell, { children: _jsx(EmptyState, { icon: PlugIcon, size: "sm", title: t('notFoundTitle'), description: t('notFoundDescription'), action: _jsx(Button, { asChild: true, size: "sm", variant: "secondary", children: _jsx(Link, { href: connectorsHref(projectId
|
|
100
|
+
return (_jsx(DetailPageShell, { children: _jsx(EmptyState, { icon: PlugIcon, size: "sm", title: t('notFoundTitle'), description: t('notFoundDescription'), action: _jsx(Button, { asChild: true, size: "sm", variant: "secondary", children: _jsx(Link, { href: connectorsHref(projectId), children: t('backToConnectors') }) }) }) }));
|
|
99
101
|
}
|
|
100
|
-
return (_jsx(ConnectorPageBody, { projectId: projectId, connector: connector, canWrite: canWrite, backHref: backHref, onChanged: invalidate, onRemoved: invalidateAfterRemove }, connector.slug));
|
|
102
|
+
return (_jsx(ConnectorPageBody, { projectId: projectId, connector: connector, canWrite: canWrite, backHref: backHref, app: app, onChanged: invalidate, onRemoved: invalidateAfterRemove }, connector.slug));
|
|
101
103
|
}
|
|
102
104
|
function ConnectorPageBody({ backHref, ...props }) {
|
|
103
105
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
104
106
|
const router = useUiRouter();
|
|
105
|
-
return (_jsx(ConnectorDetailView, { ...props, back: _jsx(Button, { asChild: true, variant: "text", size: "sm", className: "-ml-1 w-fit px-0 has-[>svg]:px-0", children: _jsxs(Link, { href: backHref, children: [_jsx(CaretLeftIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('textc3d2e79ebdd0')] }) }), onLeave: () => router.push(connectorsHref(props.projectId
|
|
107
|
+
return (_jsx(ConnectorDetailView, { ...props, back: _jsx(Button, { asChild: true, variant: "text", size: "sm", className: "-ml-1 w-fit px-0 has-[>svg]:px-0", children: _jsxs(Link, { href: backHref, children: [_jsx(CaretLeftIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('textc3d2e79ebdd0')] }) }), onLeave: () => router.push(connectorsHref(props.projectId)) }));
|
|
106
108
|
}
|
|
107
109
|
/**
|
|
108
110
|
* One connector — the strip, its notice, and the Accounts / Tools / Settings
|
|
109
111
|
* tabs. The page (`/connectors/<app>/<connector>`) and the agent editor's
|
|
110
112
|
* connector modal render this same view, so the two cannot drift.
|
|
111
113
|
*/
|
|
112
|
-
export function ConnectorDetailView({ projectId, connector, canWrite, onChanged, onRemoved, back, headerEnd, wrapTitle = (title) => title, onLeave, urlState = true, columnClassName = PAGE_COLUMN, }) {
|
|
114
|
+
export function ConnectorDetailView({ projectId, connector, canWrite, onChanged, onRemoved, back, headerEnd, wrapTitle = (title) => title, onLeave, urlState = true, columnClassName = PAGE_COLUMN, app = null, }) {
|
|
113
115
|
const t = useTranslations('connectorPages');
|
|
114
116
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
115
117
|
const tSharing = useTranslations('accessSharing');
|
|
@@ -156,7 +158,8 @@ export function ConnectorDetailView({ projectId, connector, canWrite, onChanged,
|
|
|
156
158
|
settled: !connectionsQuery.isFetching && !manageProbeLoading,
|
|
157
159
|
refetched: refetchedFor === connectId,
|
|
158
160
|
canManageConnections,
|
|
159
|
-
|
|
161
|
+
// An inbox account has no credential to open: it is made by Add inbox.
|
|
162
|
+
direct: !isManagedProvider && !isComputer && connector.provider !== 'channel',
|
|
160
163
|
});
|
|
161
164
|
const handoffAction = handoff.action;
|
|
162
165
|
const handoffConnectionId = handoff.action === 'open' ? handoff.connectionId : null;
|
|
@@ -280,7 +283,7 @@ export function ConnectorDetailView({ projectId, connector, canWrite, onChanged,
|
|
|
280
283
|
// account reconnects through its provider window.
|
|
281
284
|
const needsSignIn = isManagedProvider || Boolean(connector.authSecret);
|
|
282
285
|
const connectAccount = (account) => isManagedProvider ? reconnectAccount(account) : signIn.mutate(account);
|
|
283
|
-
const tone = connectorStatusTone(connector);
|
|
286
|
+
const tone = connectorStatusTone(connector, connectionsQuery.isSuccess ? accounts.length : undefined);
|
|
284
287
|
const providerManagedBy = isManagedConnectorProvider(connector.provider)
|
|
285
288
|
? connectorRunsOver(connector.provider)
|
|
286
289
|
: null;
|
|
@@ -314,7 +317,7 @@ export function ConnectorDetailView({ projectId, connector, canWrite, onChanged,
|
|
|
314
317
|
setCredentialTarget(null);
|
|
315
318
|
};
|
|
316
319
|
const addAccountControl = isComputer ? (_jsxs(Button, { size: "sm", className: "gap-1.5", onClick: () => setComputerOpen(true), children: [_jsx(PlusIcon, { className: "size-4 shrink-0" }), tI18nComplete.raw('text1a2303ede074')] })) : (_jsxs(Button, { size: "sm", className: "gap-1.5", onClick: requestAdd, disabled: connectPending, children: [_jsx(PlusIcon, { className: "size-4 shrink-0" }), tSharing('addAccount')] }));
|
|
317
|
-
return (_jsxs(SplitSheet, { open: sheetOpen, onOpenChange: closeCredential, size: "lg", className: "flex-1", children: [_jsx(SplitSheetMain, { children: _jsxs("div", { className: columnClassName, children: [back, _jsxs("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx(
|
|
320
|
+
return (_jsxs(SplitSheet, { open: sheetOpen, onOpenChange: closeCredential, size: "lg", className: "flex-1", children: [_jsx(SplitSheetMain, { children: _jsxs("div", { className: columnClassName, children: [back, _jsxs("header", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx(ConnectorLogo, { source: installedConnectorLogoSource(connector), size: "lg" }), wrapTitle(_jsx("h1", { ref: headingRef, tabIndex: -1, className: "text-foreground min-w-0 text-xl font-medium text-balance wrap-break-word", children: displayName }))] }), _jsxs("div", { className: "flex shrink-0 flex-wrap items-center gap-2", children: [isComputer && headerCta === 'connect' ? addAccountControl : null, connected ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => startPrivateSession(), children: t('newSession') })) : null, headerEnd] })] }), _jsxs("div", { className: "bg-popover divide-border divide-y overflow-hidden rounded-md border", children: [_jsx("dl", { className: "divide-border flex divide-x", children: stripCells.map((cell) => (_jsxs("div", { className: "min-w-0 flex-1 space-y-0.5 px-4 py-2.5", children: [_jsxs("dt", { className: "text-muted-foreground flex h-4 items-center justify-between gap-2 text-xs", children: [_jsx("span", { className: "truncate", children: cell.label }), cell.labelAddon] }), _jsx("dd", { className: "text-foreground flex min-w-0 items-center gap-1.5 truncate text-sm font-medium", children: cell.value })] }, cell.key))) }), notice.kind !== 'none' && !(notice.kind === 'no_account' && tab === 'accounts') ? (_jsxs(ConnectorNoticeRow, { title: t(NOTICE_TITLE[notice.kind], { name: displayName }), detail: notice.kind === 'error' && notice.reason ? (_jsx(NoticeLogLine, { reason: notice.reason })) : (_jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: t(notice.kind === 'needs_credential' && isManagedProvider
|
|
318
321
|
? 'noticeReconnectBody'
|
|
319
322
|
: NOTICE_BODY[notice.kind], { name: displayName }) })), children: [notice.kind === 'error' && canWrite ? (_jsxs(Button, { size: "sm", variant: "ghost", className: "gap-1.5", onClick: () => retry.mutate(), disabled: retry.isPending, children: [retry.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, tI18nComplete.raw('text942087cc2d41')] })) : null, fix?.kind === 'add_account' ? (addAccountControl) : fix?.kind === 'sign_in' ? (_jsxs(Button, { size: "sm", className: "gap-1.5", onClick: runFix, disabled: signIn.isPending, children: [signIn.isPending ? _jsx(SessionDotMatrix, { size: 14, className: "shrink-0" }) : null, t('noticeSignInAction')] })) : fix ? (
|
|
320
323
|
// Fix it here: credential entry for a direct account, the
|
|
@@ -342,6 +345,7 @@ export function ConnectorDetailView({ projectId, connector, canWrite, onChanged,
|
|
|
342
345
|
projectId: projectId,
|
|
343
346
|
connector: connector,
|
|
344
347
|
displayName: displayName,
|
|
348
|
+
app,
|
|
345
349
|
onChanged: onChanged,
|
|
346
350
|
onRemoved: () => {
|
|
347
351
|
onLeave();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** `read_only` reads "Read only" on screen; the name itself is in the tooltip and in kortix.yaml. */
|
|
2
|
+
export declare function policySetLabel(name: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* The rule-list strip above the Tools tab: "Base rules", each policy set,
|
|
5
|
+
* then "New rule set". A set gives the agents it is assigned to different
|
|
6
|
+
* rules on this connector, with the same accounts. Each tab counts the rules
|
|
7
|
+
* its list holds. Past about six sets the strip scrolls sideways.
|
|
8
|
+
*
|
|
9
|
+
* Under the strip, one line says who the selected list applies to: every
|
|
10
|
+
* agent without a set, or the agents that use this set (each a link to that
|
|
11
|
+
* agent's Connectors page).
|
|
12
|
+
*
|
|
13
|
+
* The bar owns create, edit (rename + description) and delete. The rules of
|
|
14
|
+
* the selected set are edited by the Tools list below, through the one rule
|
|
15
|
+
* writer (`PUT .../policies?policy_set=<name>`).
|
|
16
|
+
*
|
|
17
|
+
* Delete is refused while an agent uses the set: the button is disabled with
|
|
18
|
+
* that reason, and a 409 from a concurrent assignment surfaces the server's
|
|
19
|
+
* message naming the agents.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ConnectorPolicySetBar({ projectId, slug, canWrite, value, onChange, }: {
|
|
22
|
+
projectId: string;
|
|
23
|
+
slug: string;
|
|
24
|
+
canWrite: boolean;
|
|
25
|
+
/** The selected set, or null for the base rules. */
|
|
26
|
+
value: string | null;
|
|
27
|
+
onChange: (next: string | null) => void;
|
|
28
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
4
|
+
import { deleteConnectorPolicySet, getConnectorPolicies, listConnectorPolicySets, listConnectors, renameConnectorPolicySet, upsertConnectorPolicySet, } from '@kortix/sdk';
|
|
5
|
+
import { contract, qk } from '@kortix/sdk/react';
|
|
6
|
+
import { CaretDownIcon, PlusIcon } from '@phosphor-icons/react';
|
|
7
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
8
|
+
import { Fragment, useEffect, useId, useState } from 'react';
|
|
9
|
+
import { Button } from '../../../primitives/button.js';
|
|
10
|
+
import { ConfirmDialog } from '../../../primitives/confirm-dialog.js';
|
|
11
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from '../../../primitives/dropdown-menu.js';
|
|
12
|
+
import { RadioGroup, RadioGroupItem } from '../../../primitives/radio-group.js';
|
|
13
|
+
import { ErrorState } from '../../../primitives/error-state.js';
|
|
14
|
+
import { Field, FieldDescription, FieldGroup, FieldLabel } from '../../../primitives/field.js';
|
|
15
|
+
import Hint from '../../../primitives/hint.js';
|
|
16
|
+
import { Input } from '../../../primitives/input.js';
|
|
17
|
+
import Loading from '../../../primitives/loading.js';
|
|
18
|
+
import { Modal, ModalBody, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle, } from '../../../primitives/modal.js';
|
|
19
|
+
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
20
|
+
import { Tabs, TabsListCompact, TabsTriggerCompact } from '../../../primitives/tabs.js';
|
|
21
|
+
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
22
|
+
import { agentHref, capabilityTabHref } from '../../../internal/lib/capability-tab-routes.js';
|
|
23
|
+
import { UiLink as Link } from '../../../providers/ui-provider.js';
|
|
24
|
+
import { connectorPoliciesKey, connectorPolicySetsKey, POLICY_SET_TEMPLATES, policySetNameProblem, TEMPLATE_NAME, } from '../tools/policy-sets.js';
|
|
25
|
+
import { humanizeToolName } from '../tools/tool-groups.js';
|
|
26
|
+
import { agentConnectorAccess } from '../agent-access.js';
|
|
27
|
+
import { useAgentAccess } from '../use-agent-access.js';
|
|
28
|
+
/** `read_only` reads "Read only" on screen; the name itself is in the tooltip and in kortix.yaml. */
|
|
29
|
+
export function policySetLabel(name) {
|
|
30
|
+
return humanizeToolName(name);
|
|
31
|
+
}
|
|
32
|
+
/** The tab value of the base rules. A set name starts with [a-z0-9]. */
|
|
33
|
+
const BASE_VALUE = '__base';
|
|
34
|
+
/**
|
|
35
|
+
* The rule-list strip above the Tools tab: "Base rules", each policy set,
|
|
36
|
+
* then "New rule set". A set gives the agents it is assigned to different
|
|
37
|
+
* rules on this connector, with the same accounts. Each tab counts the rules
|
|
38
|
+
* its list holds. Past about six sets the strip scrolls sideways.
|
|
39
|
+
*
|
|
40
|
+
* Under the strip, one line says who the selected list applies to: every
|
|
41
|
+
* agent without a set, or the agents that use this set (each a link to that
|
|
42
|
+
* agent's Connectors page).
|
|
43
|
+
*
|
|
44
|
+
* The bar owns create, edit (rename + description) and delete. The rules of
|
|
45
|
+
* the selected set are edited by the Tools list below, through the one rule
|
|
46
|
+
* writer (`PUT .../policies?policy_set=<name>`).
|
|
47
|
+
*
|
|
48
|
+
* Delete is refused while an agent uses the set: the button is disabled with
|
|
49
|
+
* that reason, and a 409 from a concurrent assignment surfaces the server's
|
|
50
|
+
* message naming the agents.
|
|
51
|
+
*/
|
|
52
|
+
export function ConnectorPolicySetBar({ projectId, slug, canWrite, value, onChange, }) {
|
|
53
|
+
const t = useTranslations('connectorPolicySets');
|
|
54
|
+
const access = useAgentAccess(projectId);
|
|
55
|
+
const connectorsQuery = useQuery({
|
|
56
|
+
queryKey: qk.project.connectors(projectId),
|
|
57
|
+
queryFn: () => listConnectors(projectId, { includeSchemas: false }),
|
|
58
|
+
...contract('config'),
|
|
59
|
+
});
|
|
60
|
+
const allSlugs = (connectorsQuery.data?.connectors ?? []).map((item) => item.slug);
|
|
61
|
+
const queryClient = useQueryClient();
|
|
62
|
+
const queryKey = connectorPolicySetsKey(projectId, slug);
|
|
63
|
+
const setsQuery = useQuery({
|
|
64
|
+
queryKey,
|
|
65
|
+
queryFn: () => listConnectorPolicySets(projectId, slug),
|
|
66
|
+
enabled: canWrite,
|
|
67
|
+
});
|
|
68
|
+
// The same key and fetch as the Tools list's base query, so this is the
|
|
69
|
+
// one cached request, not a second one.
|
|
70
|
+
const baseQuery = useQuery({
|
|
71
|
+
queryKey: connectorPoliciesKey(projectId, slug, null),
|
|
72
|
+
queryFn: () => getConnectorPolicies(projectId, slug, { policySet: undefined }),
|
|
73
|
+
staleTime: 5_000,
|
|
74
|
+
enabled: canWrite,
|
|
75
|
+
});
|
|
76
|
+
const sets = setsQuery.data?.sets ?? [];
|
|
77
|
+
const selected = value ? sets.find((set) => set.name === value) : undefined;
|
|
78
|
+
// A set deleted or renamed elsewhere: fall back to the base rules instead of
|
|
79
|
+
// editing a list that no longer exists.
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
// Not while the list refetches: a set created or renamed a moment ago is
|
|
82
|
+
// not in the stale list yet.
|
|
83
|
+
if (value && setsQuery.isSuccess && !setsQuery.isFetching && !selected)
|
|
84
|
+
onChange(null);
|
|
85
|
+
}, [value, setsQuery.isSuccess, setsQuery.isFetching, selected, onChange]);
|
|
86
|
+
const [editor, setEditor] = useState(null);
|
|
87
|
+
const [confirmDelete, setConfirmDelete] = useState(false);
|
|
88
|
+
const invalidate = () => {
|
|
89
|
+
void queryClient.invalidateQueries({ queryKey });
|
|
90
|
+
void queryClient.invalidateQueries({ queryKey: ['connector-policies', projectId, slug] });
|
|
91
|
+
// Rename and delete rewrite agent references in kortix.yaml.
|
|
92
|
+
void queryClient.invalidateQueries({ queryKey: qk.project.detail(projectId) });
|
|
93
|
+
};
|
|
94
|
+
const remove = useMutation({
|
|
95
|
+
mutationFn: (name) => deleteConnectorPolicySet(projectId, slug, name),
|
|
96
|
+
onSuccess: (_result, name) => {
|
|
97
|
+
successToast(t('deleted', { name }));
|
|
98
|
+
onChange(null);
|
|
99
|
+
setConfirmDelete(false);
|
|
100
|
+
invalidate();
|
|
101
|
+
},
|
|
102
|
+
// 409 `policy_set_in_use`: the server's message names the agents.
|
|
103
|
+
onError: (error) => {
|
|
104
|
+
setConfirmDelete(false);
|
|
105
|
+
errorToast(error.message);
|
|
106
|
+
invalidate();
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
if (!canWrite)
|
|
110
|
+
return null;
|
|
111
|
+
if (setsQuery.isPending)
|
|
112
|
+
return _jsx(Skeleton, { className: "h-7 w-56 rounded-md" });
|
|
113
|
+
if (setsQuery.isError) {
|
|
114
|
+
return (_jsx(ErrorState, { size: "sm", title: t('loadFailed'), description: setsQuery.error instanceof Error ? setsQuery.error.message : undefined, action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void setsQuery.refetch(), children: t('retry') }) }));
|
|
115
|
+
}
|
|
116
|
+
const agents = selected?.agents ?? [];
|
|
117
|
+
const agentList = agents.join(', ');
|
|
118
|
+
const ruleTotal = selected ? selected.policies.length : (baseQuery.data?.policies.length ?? 0);
|
|
119
|
+
// Agents that can take this set: every agent not on it yet.
|
|
120
|
+
const giveTo = selected ? access.agents.filter((agent) => !agents.includes(agent)) : [];
|
|
121
|
+
return (_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("div", { className: "min-w-0 overflow-x-auto", children: _jsx(Tabs, { value: value ?? BASE_VALUE, onValueChange: (next) => onChange(next === BASE_VALUE ? null : next), children: _jsxs(TabsListCompact, { "aria-label": t('rulesFor'), children: [_jsx(TabsTriggerCompact, { value: BASE_VALUE, children: t('baseRules') }), sets.map((set) => (_jsxs(TabsTriggerCompact, { value: set.name, title: set.name, children: [policySetLabel(set.name), _jsxs("span", { className: "text-muted-foreground", children: [' · ', t('agentCount', { count: set.agents.length })] })] }, set.name)))] }) }) }), _jsxs(Button, { variant: "ghost", size: "sm", className: "shrink-0", onClick: () => setEditor({ mode: 'create' }), children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), t('createTitle')] })] }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-1", children: [_jsxs("p", { className: "text-muted-foreground min-w-0 text-xs text-pretty", children: [selected ? (_jsxs(_Fragment, { children: [selected.description ? `${selected.description} · ` : null, agents.length > 0 ? (_jsxs(_Fragment, { children: [t('usedByLead'), ' ', agents.map((agent, index) => (_jsxs(Fragment, { children: [index > 0 ? ', ' : null, _jsx(Link, { href: `${agentHref(projectId, agent)}?section=connectors`, className: "text-foreground underline-offset-4 hover:underline", children: agent })] }, agent)))] })) : (_jsxs(_Fragment, { children: [t('unusedLead'), ' ', _jsx(Link, { href: capabilityTabHref(projectId, 'agent'), className: "text-foreground underline-offset-4 hover:underline", children: t('unusedLink') })] }))] })) : (t('baseContext')), ' · ', t('ruleCount', { count: ruleTotal })] }), selected ? (_jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [access.supported && access.canEdit && giveTo.length > 0 ? (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "xs", disabled: access.pending !== null, children: [t('giveToAgent'), _jsx(CaretDownIcon, { className: "size-3 shrink-0" })] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "min-w-48", children: [_jsx(DropdownMenuLabel, { children: t('giveToAgentLabel', { name: policySetLabel(selected.name) }) }), giveTo.map((agent) => {
|
|
122
|
+
const current = agentConnectorAccess(access.grantsOf(agent), slug);
|
|
123
|
+
return (_jsxs(DropdownMenuItem, { onSelect: () => void access
|
|
124
|
+
.setPolicySet(agent, slug, selected.name, allSlugs)
|
|
125
|
+
.then(() => successToast(t('givenToAgent', { agent, name: policySetLabel(selected.name) })))
|
|
126
|
+
.catch(() => undefined), children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: agent }), !current.granted || current.policySet ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: !current.granted
|
|
127
|
+
? t('giveToAgentGrants')
|
|
128
|
+
: t('giveToAgentReplaces', { name: policySetLabel(current.policySet) }) })) : null] }, agent));
|
|
129
|
+
})] })] })) : null, _jsx(Button, { variant: "ghost", size: "xs", "aria-label": t('edit'), onClick: () => setEditor({ mode: 'edit', set: selected }), children: t('editShort') }), _jsx(Hint, { label: agents.length > 0 ? t('deleteInUse', { agents: agentList }) : t('delete'), side: "bottom", children: _jsx("span", { className: "inline-flex", children: _jsx(Button, { variant: "ghost", size: "xs", "aria-label": t('delete'), disabled: agents.length > 0 || remove.isPending, "aria-busy": remove.isPending || undefined, onClick: () => setConfirmDelete(true), children: t('deleteConfirm') }) }) })] })) : null] }), _jsx(PolicySetEditor, { projectId: projectId, slug: slug, state: editor, existing: sets.map((set) => set.name), onOpenChange: (open) => !open && setEditor(null), onSaved: (name, rules = []) => {
|
|
130
|
+
// Put the saved set in the cached list before selecting it, so the
|
|
131
|
+
// stale-selection fallback above never sees it missing.
|
|
132
|
+
const previous = editor?.mode === 'edit' ? editor.set : null;
|
|
133
|
+
queryClient.setQueryData(queryKey, (current) => {
|
|
134
|
+
const list = (current?.sets ?? []).filter((set) => set.name !== name && set.name !== previous?.name);
|
|
135
|
+
const saved = previous
|
|
136
|
+
? { ...previous, name }
|
|
137
|
+
: { name, description: null, policies: rules, agents: [] };
|
|
138
|
+
return { sets: [...list, saved] };
|
|
139
|
+
});
|
|
140
|
+
setEditor(null);
|
|
141
|
+
onChange(name);
|
|
142
|
+
invalidate();
|
|
143
|
+
} }, editor ? (editor.mode === 'edit' ? `edit:${editor.set.name}` : 'create') : 'closed'), _jsx(ConfirmDialog, { open: confirmDelete, onOpenChange: setConfirmDelete, title: selected ? t('deleteTitle', { name: selected.name }) : '', description: t('deleteBody'), confirmLabel: t('deleteConfirm'), confirmVariant: "destructive", isPending: remove.isPending, onConfirm: () => selected && remove.mutate(selected.name) })] }));
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Create a set, or rename it and change its description. A rename rewrites
|
|
147
|
+
* every agent reference in the same kortix.yaml commit (server side), so an
|
|
148
|
+
* agent never points at a missing set in between.
|
|
149
|
+
*/
|
|
150
|
+
function PolicySetEditor({ projectId, slug, state, existing, onOpenChange, onSaved, }) {
|
|
151
|
+
const t = useTranslations('connectorPolicySets');
|
|
152
|
+
const id = useId();
|
|
153
|
+
const current = state?.mode === 'edit' ? state.set : null;
|
|
154
|
+
const [template, setTemplate] = useState('read_only');
|
|
155
|
+
const [name, setName] = useState(current?.name ?? (existing.includes('read_only') ? '' : 'read_only'));
|
|
156
|
+
// The name follows the template until the user types one.
|
|
157
|
+
const [nameEdited, setNameEdited] = useState(false);
|
|
158
|
+
const pickTemplate = (next) => {
|
|
159
|
+
setTemplate(next);
|
|
160
|
+
if (!nameEdited)
|
|
161
|
+
setName(existing.includes(TEMPLATE_NAME[next]) ? '' : TEMPLATE_NAME[next]);
|
|
162
|
+
};
|
|
163
|
+
const [description, setDescription] = useState(current?.description ?? '');
|
|
164
|
+
const trimmed = name.trim();
|
|
165
|
+
const problem = trimmed ? policySetNameProblem(trimmed, existing, current?.name ?? null) : null;
|
|
166
|
+
const save = useMutation({
|
|
167
|
+
mutationFn: async () => {
|
|
168
|
+
const nextDescription = description.trim() || null;
|
|
169
|
+
if (!current) {
|
|
170
|
+
// A template's set and its rules land in one kortix.yaml commit.
|
|
171
|
+
const description = nextDescription ?? (template === 'empty' ? null : t(`template_${template}_description`));
|
|
172
|
+
await upsertConnectorPolicySet(projectId, slug, trimmed, {
|
|
173
|
+
description,
|
|
174
|
+
...(template === 'empty' ? {} : { template }),
|
|
175
|
+
});
|
|
176
|
+
// The answer counts the rules written; the set's list refetches them.
|
|
177
|
+
return { name: trimmed, created: true, rules: [] };
|
|
178
|
+
}
|
|
179
|
+
if (trimmed !== current.name) {
|
|
180
|
+
await renameConnectorPolicySet(projectId, slug, current.name, trimmed);
|
|
181
|
+
}
|
|
182
|
+
if (nextDescription !== (current.description ?? null)) {
|
|
183
|
+
await upsertConnectorPolicySet(projectId, slug, trimmed, { description: nextDescription });
|
|
184
|
+
}
|
|
185
|
+
return { name: trimmed, created: false, rules: undefined };
|
|
186
|
+
},
|
|
187
|
+
onSuccess: (result) => {
|
|
188
|
+
successToast(result.created ? t('created', { name: policySetLabel(result.name) }) : t('saved'));
|
|
189
|
+
onSaved(result.name, result.rules);
|
|
190
|
+
},
|
|
191
|
+
onError: (error) => errorToast(error.message),
|
|
192
|
+
});
|
|
193
|
+
const pending = save.isPending;
|
|
194
|
+
const valid = trimmed !== '' && problem === null;
|
|
195
|
+
return (_jsx(Modal, { open: state !== null, onOpenChange: (next) => !pending && onOpenChange(next), children: _jsxs(ModalContent, { className: "lg:max-w-md", children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: current ? t('editTitle') : t('createTitle') }), _jsx(ModalDescription, { children: current ? t('editBody') : t('createBody') })] }), _jsxs("form", { onSubmit: (event) => {
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
if (valid && !pending)
|
|
198
|
+
save.mutate();
|
|
199
|
+
}, children: [_jsx(ModalBody, { children: _jsxs(FieldGroup, { children: [current ? null : (_jsxs(Field, { children: [_jsx(FieldLabel, { children: t('templateLabel') }), _jsx(RadioGroup, { value: template, onValueChange: (next) => pickTemplate(next), disabled: pending, className: "gap-2", children: POLICY_SET_TEMPLATES.map((option) => (_jsx(RadioGroupItem, { value: option, variant: "outline", size: "lg", label: t(`template_${option}`), description: t(`template_${option}_description`) }, option))) })] })), _jsxs(Field, { "data-invalid": problem ? true : undefined, children: [_jsx(FieldLabel, { htmlFor: `${id}-name`, children: t('nameLabel') }), _jsx(Input, { id: `${id}-name`, value: name, onChange: (event) => {
|
|
200
|
+
setNameEdited(true);
|
|
201
|
+
setName(event.target.value);
|
|
202
|
+
}, placeholder: "read_only", autoComplete: "off", spellCheck: false, className: "font-mono", "aria-invalid": problem ? true : undefined, disabled: pending, autoFocus: current !== null }), _jsx(FieldDescription, { className: problem ? 'text-destructive' : undefined, children: problem === 'taken' ? t('nameTaken') : t('nameHelp') })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-description`, children: t('descriptionLabel') }), _jsx(Input, { id: `${id}-description`, value: description, onChange: (event) => setDescription(event.target.value), placeholder: t('descriptionPlaceholder'), autoComplete: "off", disabled: pending })] })] }) }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { type: "button", variant: "outline-ghost", onClick: () => onOpenChange(false), disabled: pending, children: t('cancel') }), _jsxs(Button, { type: "submit", disabled: !valid || pending, children: [pending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, current ? t('save') : t('create')] })] })] })] }) }));
|
|
203
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type AdminConnector } from '@kortix/sdk';
|
|
2
|
+
import { type AppRef } from '../connector-routes.js';
|
|
2
3
|
interface ConnectorSettingsProps {
|
|
3
4
|
projectId: string;
|
|
4
5
|
connector: AdminConnector;
|
|
5
6
|
displayName: string;
|
|
6
7
|
onChanged: () => void;
|
|
7
8
|
onRemoved: () => void;
|
|
9
|
+
/** The catalogue app, when the URL names it: "Install as another profile" opens its page. */
|
|
10
|
+
app?: AppRef | null;
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
10
13
|
* Settings — the connector's name, the transport config for a direct
|
|
@@ -32,5 +35,5 @@ interface ConnectorSettingsProps {
|
|
|
32
35
|
* The name is edited here, in a field with a Save button. It used to be a
|
|
33
36
|
* pencil beside the title, which made the heading itself an input.
|
|
34
37
|
*/
|
|
35
|
-
export declare function ConnectorSettings({ projectId, connector, displayName, onChanged, onRemoved, }: ConnectorSettingsProps): import("react").JSX.Element;
|
|
38
|
+
export declare function ConnectorSettings({ projectId, connector, displayName, onChanged, onRemoved, app, }: ConnectorSettingsProps): import("react").JSX.Element;
|
|
36
39
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useTranslations } from '../../../i18n/index.js';
|
|
4
4
|
import { deleteConnector, setConnectorName } from '@kortix/sdk';
|
|
5
|
-
import { TrashIcon } from '@phosphor-icons/react';
|
|
5
|
+
import { ArrowRightIcon, TrashIcon } from '@phosphor-icons/react';
|
|
6
6
|
import { useMutation } from '@tanstack/react-query';
|
|
7
7
|
import { useId, useState } from 'react';
|
|
8
8
|
import { Badge } from '../../../primitives/badge.js';
|
|
@@ -14,6 +14,8 @@ import Loading from '../../../primitives/loading.js';
|
|
|
14
14
|
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
15
15
|
import { ConnectionSection } from '../../sections/connectors-view.js';
|
|
16
16
|
import { isManagedConnectorProvider } from '../provider-label.js';
|
|
17
|
+
import { appHref, browseForAnotherProfileHref } from '../connector-routes.js';
|
|
18
|
+
import { UiLink as Link } from '../../../providers/ui-provider.js';
|
|
17
19
|
import { connectorRunsOver } from './connector-status.js';
|
|
18
20
|
/**
|
|
19
21
|
* Settings — the connector's name, the transport config for a direct
|
|
@@ -41,7 +43,7 @@ import { connectorRunsOver } from './connector-status.js';
|
|
|
41
43
|
* The name is edited here, in a field with a Save button. It used to be a
|
|
42
44
|
* pencil beside the title, which made the heading itself an input.
|
|
43
45
|
*/
|
|
44
|
-
export function ConnectorSettings({ projectId, connector, displayName, onChanged, onRemoved, }) {
|
|
46
|
+
export function ConnectorSettings({ projectId, connector, displayName, onChanged, onRemoved, app = null, }) {
|
|
45
47
|
const t = useTranslations('connectorPages');
|
|
46
48
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
47
49
|
const isChannel = connector.provider === 'channel';
|
|
@@ -77,5 +79,7 @@ export function ConnectorSettings({ projectId, connector, displayName, onChanged
|
|
|
77
79
|
rename.mutate();
|
|
78
80
|
}, children: [_jsx(Input, { id: nameId, value: name, onChange: (event) => setNameDraft(event.target.value), variant: "popover", maxLength: 255, className: "min-w-0 flex-1", disabled: rename.isPending }), _jsxs(Button, { type: "submit", size: "sm", variant: "secondary", className: "shrink-0 gap-1.5", disabled: !nameChanged || rename.isPending, children: [rename.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, tI18nComplete.raw('text1509f561f241')] })] })] }), _jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: managed ? t('signInLabel') : t('infoRunsOver') }), _jsx("p", { className: "text-muted-foreground mt-0.5 text-xs text-pretty", children: managed
|
|
79
81
|
? t('signInManagedHelp', { provider: connectorRunsOver(connector.provider) })
|
|
80
|
-
: t('runsOverDirectHelp', { name: displayName }) })] }), _jsx(Badge, { variant: "outline", size: "sm", className: "shrink-0", children: connectorRunsOver(connector.provider) })] })] }), isDirectProvider ? (_jsx(ConnectionSection, { projectId: projectId, connector: connector, onChanged: onChanged, canWrite: true })) : null, !isChannel && !isComputer ? (_jsx("div", { className: "bg-popover rounded-md border px-4 py-3", children: _jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: t('
|
|
82
|
+
: t('runsOverDirectHelp', { name: displayName }) })] }), _jsx(Badge, { variant: "outline", size: "sm", className: "shrink-0", children: connectorRunsOver(connector.provider) })] })] }), isDirectProvider ? (_jsx(ConnectionSection, { projectId: projectId, connector: connector, onChanged: onChanged, canWrite: true })) : null, !isChannel && !isComputer ? (_jsx("div", { className: "bg-popover rounded-md border px-4 py-3", children: _jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: t('anotherProfileTitle') }), _jsx("p", { className: "text-muted-foreground mt-0.5 text-xs text-pretty", children: t('anotherProfileHelp', { name: displayName }) })] }), _jsx(Button, { asChild: true, size: "sm", variant: "outline", className: "shrink-0 gap-1.5", children: _jsxs(Link, { href: app
|
|
83
|
+
? appHref(projectId, app, { ways: true })
|
|
84
|
+
: browseForAnotherProfileHref(projectId, displayName), children: [t('anotherProfileAction'), _jsx(ArrowRightIcon, { className: "size-3.5 shrink-0" })] }) })] }) })) : null, !isChannel && !isComputer ? (_jsx("div", { className: "bg-popover rounded-md border px-4 py-3", children: _jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: t('removeTitle', { name: displayName }) }), _jsx("p", { className: "text-muted-foreground mt-0.5 text-xs text-pretty", children: t('removeHelp') })] }), _jsxs(Button, { size: "sm", variant: "outline", className: "shrink-0 gap-1.5 active:scale-[0.96]", onClick: () => setConfirmDelete(true), children: [_jsx(TrashIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('textc3812fc4acb8')] })] }) })) : null, _jsx(ConfirmDialog, { open: confirmDelete, onOpenChange: setConfirmDelete, title: tI18nComplete('textbc43ab815937', { value0: displayName }), description: _jsxs(_Fragment, { children: [tI18nComplete.raw('text0c044575853f'), ' ', _jsx("code", { className: "font-mono", children: connector.slug }), tI18nComplete.raw('text9627c3d54219')] }), confirmLabel: tI18nComplete.raw('textbf30cc3b0697'), confirmVariant: "destructive", confirmIcon: _jsx(TrashIcon, { className: "size-4 shrink-0" }), isPending: remove.isPending, onConfirm: () => remove.mutate() })] }));
|
|
81
85
|
}
|