@kortix/ui 0.14.8 → 0.14.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/_vendor/kortix-shared.js +116 -3
- package/dist/_vendor/shared/app-config.d.ts +175 -0
- package/dist/_vendor/shared/artifact-comments.d.ts +235 -0
- package/dist/_vendor/shared/channel-descriptors.d.ts +96 -0
- package/dist/_vendor/shared/channel-message.d.ts +45 -5
- package/dist/_vendor/shared/index.d.ts +2 -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/principal-picker.d.ts +11 -0
- package/dist/access/access/principal-picker.js +3 -2
- package/dist/apps/app-preview-pool.d.ts +7 -2
- package/dist/apps/app-preview-pool.js +30 -7
- 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 +55 -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-grant-pages.d.ts +5 -1
- package/dist/customize/agents/agent-grant-pages.js +30 -4
- package/dist/customize/agents/agent-page.js +3 -1
- 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/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 -25
- package/dist/customize/migrate-to-v2/migration-prompt.js +34 -236
- 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 +21 -28
- 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 +10 -0
- package/dist/customize/sections/view/channels-view.d.ts +6 -1
- package/dist/customize/sections/view/channels-view.js +72 -81
- package/dist/customize/sections/view/gateway/gateway-overview.js +10 -2
- package/dist/customize/settings/rail.js +9 -0
- package/dist/customize/settings/settings-tabs.d.ts +1 -1
- package/dist/customize/settings/settings-tabs.js +1 -0
- package/dist/customize/settings/tabs/chrome-connections-tab.d.ts +6 -0
- package/dist/customize/settings/tabs/chrome-connections-tab.js +99 -0
- package/dist/customize/settings/tabs/experimental-tab.js +35 -16
- package/dist/customize/shared/catalog/catalog-empty-state.d.ts +4 -15
- package/dist/customize/shared/catalog/catalog-empty-state.js +9 -7
- 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/use-customize-prefetch.d.ts +2 -3
- package/dist/customize/shared/use-customize-prefetch.js +9 -27
- 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/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 +5 -2
- 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 +48 -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 +1062 -85
- package/dist/i18n/en.js +1078 -101
- 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/apps-and-extensions/apps-modal.d.ts +9 -0
- package/dist/internal/apps-and-extensions/apps-modal.js +107 -0
- package/dist/internal/auth/auth-card-shell.js +3 -3
- package/dist/internal/chrome/browser-icon.d.ts +24 -0
- package/dist/internal/chrome/browser-icon.js +58 -0
- package/dist/internal/chrome/chrome-card-state.d.ts +16 -0
- package/dist/internal/chrome/chrome-card-state.js +9 -0
- package/dist/internal/chrome/chrome-connect.d.ts +69 -0
- package/dist/internal/chrome/chrome-connect.js +178 -0
- package/dist/internal/chrome/chrome-mock.d.ts +4 -0
- package/dist/internal/chrome/chrome-mock.js +15 -0
- package/dist/internal/chrome/chrome-names.d.ts +15 -0
- package/dist/internal/chrome/chrome-names.js +35 -0
- package/dist/internal/chrome/extension.d.ts +47 -0
- package/dist/internal/chrome/extension.js +91 -0
- package/dist/internal/chrome/use-chrome-offered.d.ts +11 -0
- package/dist/internal/chrome/use-chrome-offered.js +22 -0
- package/dist/internal/components/agent-mark.js +5 -2
- package/dist/internal/connector-logo/connector-logo-source.d.ts +64 -0
- package/dist/internal/connector-logo/connector-logo-source.js +49 -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/edge.d.ts +5 -0
- package/dist/internal/icons/edge.js +10 -0
- 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/extensions.js +17 -3
- 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/detect-os.d.ts +43 -0
- package/dist/internal/lib/detect-os.js +70 -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/use-project-feature-flags.js +13 -9
- 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/apps-modal-store.d.ts +8 -0
- package/dist/internal/stores/apps-modal-store.js +6 -0
- package/dist/internal/stores/composer-prefill-store.d.ts +12 -5
- 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/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 +9 -3
- 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/secret-intake-form.d.ts +0 -10
- package/dist/markdown/setup-links/secret-intake-form.js +1 -1
- 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/empty-state.d.ts +2 -2
- package/dist/primitives/empty-state.js +6 -5
- 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/providers/ui-provider.d.ts +9 -0
- 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 +13 -1
- package/dist/session/composer/agent-selector.js +25 -5
- 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/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/models/chatgpt-connection-button.d.ts +11 -0
- package/dist/session/models/chatgpt-connection-button.js +54 -0
- package/dist/session/models/model-selector.js +5 -2
- 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/mobile-tool-drawer.js +7 -1
- package/dist/session/panel/session-audit-panel.js +9 -2
- package/dist/session/panel/session-audit-shared.js +3 -1
- 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 +8 -2
- package/dist/session/participants/session-participants.js +11 -4
- package/dist/session/prompts/approval-request.d.ts +5 -0
- package/dist/session/prompts/approval-request.js +9 -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/session-chat.d.ts +3 -1
- package/dist/session/thread/session-chat.js +377 -252
- package/dist/session/thread/session-thread.d.ts +15 -1
- package/dist/session/thread/session-thread.js +20 -3
- package/dist/session/thread/session-transcript-class.d.ts +5 -1
- package/dist/session/thread/session-transcript-class.js +5 -1
- 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 +0 -9
- package/dist/session/thread/transcript.js +104 -19
- 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/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 +241 -53
- package/dist/session/tool/tools/show-tool.js +19 -8
- 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.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 +1 -1
- package/dist/session/turn/plan-anchor.js +1 -1
- package/dist/session/turn/user-message.d.ts +14 -6
- package/dist/session/turn/user-message.js +35 -15
- package/dist/styles.css +1 -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/session-label-badges.js +2 -1
- 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-chrome-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-chrome-nav.js +56 -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 +13 -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-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 +67 -36
- 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 +29 -5
- package/skills/kortix-ui/references/theming.md +1 -1
- 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/markdown/setup-links/app-credentials-form.d.ts +0 -12
- package/dist/markdown/setup-links/app-credentials-form.js +0 -115
- /package/dist/{internal/hooks → hooks}/use-media-query.js +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MagnifyingGlassIcon } from '@phosphor-icons/react';
|
|
2
3
|
import { useTranslations } from '../../../i18n/index.js';
|
|
4
|
+
import { EmptyState } from '../../../primitives/empty-state.js';
|
|
3
5
|
/**
|
|
4
|
-
* The "nothing here"
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* The "nothing here" state every catalog uses: the shared `EmptyState`, so a
|
|
7
|
+
* catalog's empty slot looks like every other empty view. `CatalogGrid` owns
|
|
8
|
+
* loading/error/empty; this is what callers put IN the empty slot when the
|
|
7
9
|
* cause is the search box rather than an empty project.
|
|
8
10
|
*/
|
|
9
11
|
export function CatalogEmptyNote({ children }) {
|
|
10
|
-
return _jsx(
|
|
12
|
+
return _jsx(EmptyState, { size: "sm", icon: MagnifyingGlassIcon, title: children });
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* "No matches for `<query>`."
|
|
@@ -16,7 +18,7 @@ export function CatalogEmptyNote({ children }) {
|
|
|
16
18
|
* spaces inside a monospace span, which reads as a rendering bug rather than as
|
|
17
19
|
* a report of what was searched for.
|
|
18
20
|
*/
|
|
19
|
-
export function CatalogNoMatch({ query
|
|
21
|
+
export function CatalogNoMatch({ query }) {
|
|
20
22
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
21
|
-
return (_jsxs(CatalogEmptyNote, { children: [tI18nComplete.raw('texta8897de42124'), ' ', _jsx("span", { className: "text-foreground font-mono", children: query.trim() }), "."
|
|
23
|
+
return (_jsxs(CatalogEmptyNote, { children: [tI18nComplete.raw('texta8897de42124'), ' ', _jsx("span", { className: "text-foreground font-mono", children: query.trim() }), "."] }));
|
|
22
24
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The confirm step of the project's Channels switch (`project_channels`):
|
|
3
|
+
* what turning it on or off changes for everyone in the project. Turning it
|
|
4
|
+
* on while Drive is off offers to turn Drive on too (channels get Files).
|
|
5
|
+
* Every surface that flips the flag asks through this dialog.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ChannelsSwitchDialog({ open, onOpenChange, turningOn, projectName, driveOff, pending, onConfirm, }: {
|
|
8
|
+
open: boolean;
|
|
9
|
+
onOpenChange: (open: boolean) => void;
|
|
10
|
+
/** The switch's target: on, or off. */
|
|
11
|
+
turningOn: boolean;
|
|
12
|
+
projectName: string;
|
|
13
|
+
/** Drive is off and the viewer could turn it on: offer it beside Channels. */
|
|
14
|
+
driveOff: boolean;
|
|
15
|
+
pending?: boolean;
|
|
16
|
+
/** `alsoDrive`: turn Drive on too. */
|
|
17
|
+
onConfirm: (alsoDrive: boolean) => void;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useState } from 'react';
|
|
4
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
5
|
+
import { Button } from '../../primitives/button.js';
|
|
6
|
+
import { Checkbox } from '../../primitives/checkbox.js';
|
|
7
|
+
import Loading from '../../primitives/loading.js';
|
|
8
|
+
import { Modal, ModalBody, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from '../../primitives/modal.js';
|
|
9
|
+
/**
|
|
10
|
+
* The confirm step of the project's Channels switch (`project_channels`):
|
|
11
|
+
* what turning it on or off changes for everyone in the project. Turning it
|
|
12
|
+
* on while Drive is off offers to turn Drive on too (channels get Files).
|
|
13
|
+
* Every surface that flips the flag asks through this dialog.
|
|
14
|
+
*/
|
|
15
|
+
export function ChannelsSwitchDialog({ open, onOpenChange, turningOn, projectName, driveOff, pending = false, onConfirm, }) {
|
|
16
|
+
const t = useTranslations('settings.featureFlags.channelsSwitch');
|
|
17
|
+
const id = useId();
|
|
18
|
+
const [alsoDrive, setAlsoDrive] = useState(false);
|
|
19
|
+
const offerDrive = turningOn && driveOff;
|
|
20
|
+
return (_jsx(Modal, { open: open, onOpenChange: (next) => {
|
|
21
|
+
if (pending)
|
|
22
|
+
return;
|
|
23
|
+
if (!next)
|
|
24
|
+
setAlsoDrive(false);
|
|
25
|
+
onOpenChange(next);
|
|
26
|
+
}, children: _jsxs(ModalContent, { className: "lg:max-w-md", children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: turningOn ? t('onTitle', { project: projectName }) : t('offTitle') }), _jsx(ModalDescription, { children: turningOn ? t('onBody') : t('offBody') })] }), offerDrive ? (_jsx(ModalBody, { children: _jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx(Checkbox, { id: `${id}-drive`, checked: alsoDrive, onCheckedChange: (value) => setAlsoDrive(value === true) }), _jsx("label", { htmlFor: `${id}-drive`, className: "text-sm", children: t('drive') })] }) })) : null, _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { type: "button", variant: "outline-ghost", disabled: pending, onClick: () => onOpenChange(false), children: t('cancel') }), _jsxs(Button, { type: "button", disabled: pending, "aria-busy": pending || undefined, onClick: () => {
|
|
27
|
+
onConfirm(offerDrive && alsoDrive);
|
|
28
|
+
setAlsoDrive(false);
|
|
29
|
+
}, children: [pending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, turningOn ? t('turnOn') : t('turnOff')] })] })] }) }));
|
|
30
|
+
}
|
|
@@ -4,12 +4,13 @@ import { useTranslations } from '../../i18n/index.js';
|
|
|
4
4
|
import { UiLink, useUiParams } from '../../providers/ui-provider.js';
|
|
5
5
|
import { Button } from '../../primitives/button.js';
|
|
6
6
|
import { projectSettingsSectionHref } from '../project-settings/project-settings-sections.js';
|
|
7
|
+
import { ChannelsSwitchDialog } from './channels-switch-dialog.js';
|
|
7
8
|
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
8
9
|
import { useProjectCan } from '../../internal/lib/use-project-can.js';
|
|
9
|
-
import { updateFeatureFlag } from '@kortix/sdk';
|
|
10
|
-
import { invalidateProject, qk } from '@kortix/sdk/react';
|
|
10
|
+
import { getProject, updateFeatureFlag } from '@kortix/sdk';
|
|
11
|
+
import { contract, invalidateProject, qk } from '@kortix/sdk/react';
|
|
11
12
|
import { FlagIcon } from '@phosphor-icons/react';
|
|
12
|
-
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
13
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
13
14
|
import { useState } from 'react';
|
|
14
15
|
/** A disabled surface keeps its enable action and settings link in place. */
|
|
15
16
|
export function FeatureGateScreen({ featureKey, featureName, description, internalOnly = false, }) {
|
|
@@ -21,11 +22,12 @@ export function FeatureGateScreen({ featureKey, featureName, description, intern
|
|
|
21
22
|
const permission = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SETTINGS_WRITE);
|
|
22
23
|
const [error, setError] = useState('');
|
|
23
24
|
const enable = useMutation({
|
|
24
|
-
mutationFn: () => {
|
|
25
|
+
mutationFn: async (alsoDrive = false) => {
|
|
25
26
|
if (!projectId || internalOnly || permission.isLoading || permission.allowed !== true) {
|
|
26
27
|
throw new Error('Feature activation is not permitted');
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
const updated = await updateFeatureFlag(projectId, featureKey, true);
|
|
30
|
+
return alsoDrive ? updateFeatureFlag(projectId, 'drives', true) : updated;
|
|
29
31
|
},
|
|
30
32
|
onSuccess: (updated) => {
|
|
31
33
|
if (!projectId)
|
|
@@ -37,8 +39,24 @@ export function FeatureGateScreen({ featureKey, featureName, description, intern
|
|
|
37
39
|
},
|
|
38
40
|
onError: (cause) => setError(cause.message),
|
|
39
41
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const channels = featureKey === 'project_channels';
|
|
43
|
+
const [confirming, setConfirming] = useState(false);
|
|
44
|
+
const project = useQuery({
|
|
45
|
+
queryKey: qk.project.summary(projectId ?? ''),
|
|
46
|
+
queryFn: () => getProject(projectId),
|
|
47
|
+
enabled: channels && !!projectId,
|
|
48
|
+
...contract('config'),
|
|
49
|
+
});
|
|
50
|
+
const drive = project.data?.experimental_features?.find((f) => f.key === 'drives' && f.available);
|
|
51
|
+
return (_jsxs("div", { className: "bg-popover rounded-md border px-4 py-5", children: [channels ? (_jsx(ChannelsSwitchDialog, { open: confirming, onOpenChange: setConfirming, turningOn: true, projectName: project.data?.name ?? '', driveOff: !!drive && !drive.enabled && drive.operator_only !== true, onConfirm: (alsoDrive) => {
|
|
52
|
+
setConfirming(false);
|
|
53
|
+
enable.mutate(alsoDrive);
|
|
54
|
+
} })) : null, _jsxs("div", { className: "flex flex-col gap-5 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-start gap-3", children: [_jsx("span", { className: "bg-muted/50 flex size-9 shrink-0 items-center justify-center rounded-sm", children: _jsx(FlagIcon, { className: "text-muted-foreground size-5" }) }), _jsxs("div", { className: "min-w-0 space-y-1", children: [_jsxs("p", { className: "text-foreground text-sm font-medium", children: [featureName, " ", tI18nComplete.raw('text26965989cce5')] }), _jsx("p", { className: "text-muted-foreground max-w-xl text-xs text-pretty", children: description }), internalOnly ? (_jsx("p", { className: "text-muted-foreground max-w-xl text-xs text-pretty", children: tI18nComplete.raw('text1c41abcc2fff') })) : null] })] }), error ? (_jsx("p", { role: "alert", className: "text-destructive text-xs", children: error })) : null, projectId && !internalOnly ? (_jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(Button, { size: "sm", disabled: permission.isLoading || permission.allowed !== true || enable.isPending, onClick: () => {
|
|
55
|
+
setError('');
|
|
56
|
+
// Channels changes the sidebar for everyone: it asks first.
|
|
57
|
+
if (channels)
|
|
58
|
+
setConfirming(true);
|
|
59
|
+
else
|
|
60
|
+
enable.mutate(false);
|
|
61
|
+
}, children: enable.isPending ? t('enabling') : t('enable', { name: featureName }) }), _jsx(Button, { asChild: true, size: "sm", variant: "secondary", className: "shrink-0", children: _jsx(UiLink, { href: projectSettingsSectionHref(projectId, 'feature-flags'), children: tI18nComplete.raw('text20a2e59ba129') }) })] })) : null] })] }));
|
|
44
62
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* - A longer `gcTime` keeps the entries through a long session on another
|
|
19
19
|
* route; the default five minutes would drop them before Customize opens.
|
|
20
20
|
*/
|
|
21
|
-
import {
|
|
21
|
+
import { getModelDefaults, getProject, getProjectModelPicker, listConnectors, listProjectBranches, listProjectResourceGrants, listProjectSandboxTemplates, listProjectSecrets, listProjectSnapshots, listProjectTriggers, listReviewItems } from '@kortix/sdk';
|
|
22
22
|
import { type QueryClient } from '@tanstack/react-query';
|
|
23
23
|
/** Keep prefetched Customize data for half an hour without an observer. */
|
|
24
24
|
export declare const CUSTOMIZE_PREFETCH_GC_MS: number;
|
|
@@ -35,11 +35,10 @@ export interface CustomizePrefetchGates {
|
|
|
35
35
|
reviewRead: boolean;
|
|
36
36
|
membersManage: boolean;
|
|
37
37
|
}
|
|
38
|
-
type CatalogQueries = Pick<typeof import('../connectors/catalog/use-catalog.js'), 'catalogSectionsQuery'
|
|
38
|
+
type CatalogQueries = Pick<typeof import('../connectors/catalog/use-catalog.js'), 'catalogSectionsQuery'>;
|
|
39
39
|
/** The reads the prefetch issues. Injected in tests; the SDK in production. */
|
|
40
40
|
export interface CustomizePrefetchApi {
|
|
41
41
|
getProject: typeof getProject;
|
|
42
|
-
getConnectStatus: typeof getConnectStatus;
|
|
43
42
|
getModelDefaults: typeof getModelDefaults;
|
|
44
43
|
getProjectModelPicker: typeof getProjectModelPicker;
|
|
45
44
|
listConnectors: typeof listConnectors;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* - A longer `gcTime` keeps the entries through a long session on another
|
|
20
20
|
* route; the default five minutes would drop them before Customize opens.
|
|
21
21
|
*/
|
|
22
|
-
import {
|
|
22
|
+
import { getModelDefaults, getProject, getProjectDetail, getProjectModelPicker, listConnectors, listProjectBranches, listProjectResourceGrants, listProjectSandboxTemplates, listProjectSecrets, listProjectSnapshots, listProjectTriggers, listReviewItems, } from '@kortix/sdk';
|
|
23
23
|
import { contract, FRESHNESS, qk } from '@kortix/sdk/react';
|
|
24
24
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
25
25
|
import { useEffect, useMemo } from 'react';
|
|
@@ -31,7 +31,6 @@ export const CUSTOMIZE_PREFETCH_GC_MS = 30 * 60_000;
|
|
|
31
31
|
const IDLE_TIMEOUT_MS = 1_000;
|
|
32
32
|
const sdkApi = {
|
|
33
33
|
getProject,
|
|
34
|
-
getConnectStatus,
|
|
35
34
|
getModelDefaults,
|
|
36
35
|
getProjectModelPicker,
|
|
37
36
|
listConnectors,
|
|
@@ -137,35 +136,18 @@ export async function prefetchCustomize(queryClient, projectId, gates, api = sdk
|
|
|
137
136
|
}
|
|
138
137
|
await Promise.all(work);
|
|
139
138
|
}
|
|
140
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Connectors → the catalogue's landing sections, as the page opens it: One-click
|
|
141
|
+
* only on, no type filter (`ConnectorsPage`). Same key as `useCatalog`.
|
|
142
|
+
*/
|
|
141
143
|
async function prefetchCatalogLanding(queryClient, projectId, api) {
|
|
142
144
|
const catalog = await api.loadCatalogQueries().catch(() => null);
|
|
143
145
|
if (!catalog)
|
|
144
146
|
return;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const status = await queryClient
|
|
150
|
-
.fetchQuery({
|
|
151
|
-
queryKey: connectStatusQuery.queryKey,
|
|
152
|
-
queryFn: api.getConnectStatus,
|
|
153
|
-
staleTime: 30_000,
|
|
154
|
-
retry: false,
|
|
155
|
-
})
|
|
156
|
-
.catch(() => null);
|
|
157
|
-
if (!status?.configured)
|
|
158
|
-
return;
|
|
159
|
-
const providers = status.providers ?? (status.provider ? [status.provider] : []);
|
|
160
|
-
// Same provider choice as `useConnectProviderStatus`: Composio first.
|
|
161
|
-
const provider = providers.includes('composio')
|
|
162
|
-
? 'composio'
|
|
163
|
-
: providers.includes('pipedream')
|
|
164
|
-
? 'pipedream'
|
|
165
|
-
: null;
|
|
166
|
-
if (!provider)
|
|
167
|
-
return;
|
|
168
|
-
await queryClient.prefetchQuery({ ...catalogSectionsQuery(projectId, provider), ...gc });
|
|
147
|
+
await queryClient.prefetchQuery({
|
|
148
|
+
...catalog.catalogSectionsQuery(projectId, true),
|
|
149
|
+
gcTime: CUSTOMIZE_PREFETCH_GC_MS,
|
|
150
|
+
});
|
|
169
151
|
}
|
|
170
152
|
function whenIdle(run) {
|
|
171
153
|
if (typeof window === 'undefined')
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PatchDraft } from './composer-parts.js';
|
|
2
|
+
import { type ComposerDraft } from './trigger-composer-logic.js';
|
|
3
|
+
/**
|
|
4
|
+
* "Post to": the channel or DM each run starts a thread in. Shown only while
|
|
5
|
+
* the project's `project_channels` flag is on. A private channel shows
|
|
6
|
+
* disabled with its lock and why: the API refuses a trigger into one (a saved
|
|
7
|
+
* trigger already posting there stays selectable). A channel shares later runs
|
|
8
|
+
* with the project unless the person chose other sharing; a DM shares them
|
|
9
|
+
* with the viewer and runs the DM's agent (`postToChange`; the API enforces
|
|
10
|
+
* the DM rules).
|
|
11
|
+
*/
|
|
12
|
+
export declare function PostToField({ projectId, draft, patch, baseAccess, }: {
|
|
13
|
+
projectId: string;
|
|
14
|
+
draft: ComposerDraft;
|
|
15
|
+
patch: PatchDraft;
|
|
16
|
+
/** The sharing before any space was picked: the saved trigger's, or the form's default. */
|
|
17
|
+
baseAccess: ComposerDraft['sessionAccess'];
|
|
18
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useFeatureFlag, useProjectSpaces } from '@kortix/sdk/react';
|
|
4
|
+
import { capitalizeWords, isMetaAgentName, META_AGENT_DISPLAY_NAME } from '../../../_vendor/kortix-shared.js';
|
|
5
|
+
import { HashIcon, LockSimpleIcon } from '@phosphor-icons/react';
|
|
6
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
7
|
+
import { AgentMark } from '../../../internal/components/agent-mark.js';
|
|
8
|
+
import { Label } from '../../../primitives/label.js';
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../primitives/select.js';
|
|
10
|
+
import { useUiViewerId } from '../../../providers/ui-provider.js';
|
|
11
|
+
import { postToChange } from './trigger-composer-logic.js';
|
|
12
|
+
/** Select has no empty value: this one stands for "no channel". */
|
|
13
|
+
const NONE = 'none';
|
|
14
|
+
/**
|
|
15
|
+
* "Post to": the channel or DM each run starts a thread in. Shown only while
|
|
16
|
+
* the project's `project_channels` flag is on. A private channel shows
|
|
17
|
+
* disabled with its lock and why: the API refuses a trigger into one (a saved
|
|
18
|
+
* trigger already posting there stays selectable). A channel shares later runs
|
|
19
|
+
* with the project unless the person chose other sharing; a DM shares them
|
|
20
|
+
* with the viewer and runs the DM's agent (`postToChange`; the API enforces
|
|
21
|
+
* the DM rules).
|
|
22
|
+
*/
|
|
23
|
+
export function PostToField({ projectId, draft, patch, baseAccess, }) {
|
|
24
|
+
const t = useTranslations('triggerComposer');
|
|
25
|
+
const viewerId = useUiViewerId();
|
|
26
|
+
const channelsOn = useFeatureFlag(projectId, 'project_channels').enabled === true;
|
|
27
|
+
const spaces = useProjectSpaces(projectId, { enabled: channelsOn });
|
|
28
|
+
if (!channelsOn)
|
|
29
|
+
return null;
|
|
30
|
+
const list = spaces.data ?? [];
|
|
31
|
+
// A saved trigger's archived channel is not in the list: keep it selectable.
|
|
32
|
+
// Another member's DM never reaches the form (the API lists its trigger with
|
|
33
|
+
// no space), so it shows as no channel.
|
|
34
|
+
const unknown = draft.spaceId && !list.some((space) => space.space_id === draft.spaceId);
|
|
35
|
+
const choose = (value) => {
|
|
36
|
+
if (value === draft.spaceId)
|
|
37
|
+
return;
|
|
38
|
+
const space = list.find((candidate) => candidate.space_id === value);
|
|
39
|
+
const current = list.find((candidate) => candidate.space_id === draft.spaceId) ?? null;
|
|
40
|
+
patch(postToChange(draft, space ? { spaceId: space.space_id, kind: space.kind, dmAgentName: space.dm_agent_name } : null, { base: baseAccess, current, viewerId }));
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-post-to", className: "text-xs", children: t('postTo') }), _jsxs(Select, { value: draft.spaceId ?? NONE, onValueChange: choose, children: [_jsx(SelectTrigger, { id: "trigger-post-to", className: "w-full cursor-pointer text-sm", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: NONE, className: "cursor-pointer", children: t('postToNone') }), unknown ? (_jsx(SelectItem, { value: draft.spaceId, className: "cursor-pointer", children: t('postToUnavailable') })) : null, list.map((space) => {
|
|
43
|
+
const locked = space.visibility === 'private';
|
|
44
|
+
return (_jsx(SelectItem, { value: space.space_id, disabled: locked && space.space_id !== draft.spaceId, className: "cursor-pointer", children: _jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [space.kind !== 'channel' ? (_jsx(AgentMark, { slug: space.dm_agent_name ?? 'kortix', size: 14, tile: 18 })) : locked ? (_jsx(LockSimpleIcon, { "aria-hidden": true, className: "text-muted-foreground size-3.5 shrink-0" })) : (_jsx(HashIcon, { "aria-hidden": true, className: "text-muted-foreground size-3.5 shrink-0" })), space.kind === 'channel' ? space.slug : agentLabel(space.dm_agent_name ?? ''), locked ? _jsx("span", { className: "text-muted-foreground truncate text-xs", children: t('postToPrivate') }) : null] }) }, space.space_id));
|
|
45
|
+
})] })] }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: t('postToHint', { channel: list.find((space) => space.is_default)?.slug ?? 'general' }) })] }));
|
|
46
|
+
}
|
|
47
|
+
function agentLabel(name) {
|
|
48
|
+
return isMetaAgentName(name) ? META_AGENT_DISPLAY_NAME : capitalizeWords(name);
|
|
49
|
+
}
|
|
@@ -15,15 +15,19 @@ import type { UiTranslator } from '../../../i18n/index.js';
|
|
|
15
15
|
* made these screens read as a config file.
|
|
16
16
|
*/
|
|
17
17
|
import type { ProjectTrigger } from '@kortix/sdk';
|
|
18
|
-
export type TriggerKind = 'cron' | 'webhook' | 'event';
|
|
18
|
+
export type TriggerKind = 'cron' | 'webhook' | 'event' | 'app';
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* The trigger kinds this screen lists. `ScheduleView` filters every list
|
|
21
|
+
* through this before it reaches the table, the row actions, or the detail
|
|
22
|
+
* sheet, so `trigger.type` is safe to treat as {@link TriggerKind} anywhere
|
|
23
|
+
* downstream of that filter. `app` (an App's own events) is listed and
|
|
24
|
+
* managed here; it is written in `kortix.yaml`, not in the composer.
|
|
25
25
|
*/
|
|
26
26
|
export declare function isTriggerKind(type: ProjectTrigger['type']): type is TriggerKind;
|
|
27
|
+
/** The kinds the composer can create. */
|
|
28
|
+
export declare const COMPOSER_KINDS: readonly TriggerKind[];
|
|
29
|
+
/** `every_seconds` as a sentence: "Every 5 minutes", "Every 2 hours". */
|
|
30
|
+
export declare function describeEvery(seconds: number): string;
|
|
27
31
|
/**
|
|
28
32
|
* Triggers the customer wrote. The starter ships every new project a
|
|
29
33
|
* `harness-reflector` cron that keeps the project's memory current; it is
|
|
@@ -2,14 +2,24 @@ import { localizeUiCatalog } from '../../../i18n/ui-catalog/localize-ui-catalog.
|
|
|
2
2
|
import { REMAINING_UI_TRANSLATION_KEYS } from '../../../i18n/ui-catalog/remaining-ui-translation-keys.generated.js';
|
|
3
3
|
import { describeEventTitle } from './event-trigger-copy.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* The trigger kinds this screen lists. `ScheduleView` filters every list
|
|
6
|
+
* through this before it reaches the table, the row actions, or the detail
|
|
7
|
+
* sheet, so `trigger.type` is safe to treat as {@link TriggerKind} anywhere
|
|
8
|
+
* downstream of that filter. `app` (an App's own events) is listed and
|
|
9
|
+
* managed here; it is written in `kortix.yaml`, not in the composer.
|
|
10
10
|
*/
|
|
11
11
|
export function isTriggerKind(type) {
|
|
12
|
-
return type === 'cron' || type === 'webhook' || type === 'event';
|
|
12
|
+
return type === 'cron' || type === 'webhook' || type === 'event' || type === 'app';
|
|
13
|
+
}
|
|
14
|
+
/** The kinds the composer can create. */
|
|
15
|
+
export const COMPOSER_KINDS = ['cron', 'webhook', 'event'];
|
|
16
|
+
/** `every_seconds` as a sentence: "Every 5 minutes", "Every 2 hours". */
|
|
17
|
+
export function describeEvery(seconds) {
|
|
18
|
+
if (seconds % 3600 === 0)
|
|
19
|
+
return seconds === 3600 ? 'Every hour' : `Every ${seconds / 3600} hours`;
|
|
20
|
+
if (seconds % 60 === 0)
|
|
21
|
+
return seconds === 60 ? 'Every minute' : `Every ${seconds / 60} minutes`;
|
|
22
|
+
return `Every ${seconds} seconds`;
|
|
13
23
|
}
|
|
14
24
|
/**
|
|
15
25
|
* Triggers the customer wrote. The starter ships every new project a
|
|
@@ -153,8 +163,14 @@ export function describeWhen(trigger, eventNames) {
|
|
|
153
163
|
return 'When a request arrives';
|
|
154
164
|
if (trigger.type === 'event')
|
|
155
165
|
return describeEventTitle(trigger.event, eventNames);
|
|
166
|
+
if (trigger.type === 'app') {
|
|
167
|
+
const name = trigger.filter?.['event.name'];
|
|
168
|
+
return name ? `When ${trigger.app} emits ${name}` : `When ${trigger.app} emits an event`;
|
|
169
|
+
}
|
|
156
170
|
if (trigger.run_at)
|
|
157
171
|
return describeOneOff(trigger.run_at);
|
|
172
|
+
if (trigger.every_seconds)
|
|
173
|
+
return describeEvery(trigger.every_seconds);
|
|
158
174
|
if (trigger.cron)
|
|
159
175
|
return describeCadence(trigger.cron);
|
|
160
176
|
return CUSTOM_TIMING_LABEL;
|
|
@@ -184,6 +200,8 @@ export function triggerName(trigger) {
|
|
|
184
200
|
return describeWhen(trigger);
|
|
185
201
|
if (trigger.type === 'event')
|
|
186
202
|
return describeWhen(trigger);
|
|
203
|
+
if (trigger.type === 'app')
|
|
204
|
+
return describeWhen(trigger);
|
|
187
205
|
return 'Untitled webhook';
|
|
188
206
|
}
|
|
189
207
|
export function triggerStatus(enabled, tI18nComplete) {
|
|
@@ -253,6 +271,9 @@ export const SESSION_MODE_HELP = {
|
|
|
253
271
|
};
|
|
254
272
|
/** One-line summary for read-only views and the list. */
|
|
255
273
|
export function describeRunLocation(trigger) {
|
|
274
|
+
// A trigger that calls an App starts no session.
|
|
275
|
+
if (trigger.target?.app)
|
|
276
|
+
return `Calls ${trigger.target.app}${trigger.target.path ?? '/'}`;
|
|
256
277
|
const base = SESSION_MODE_LABEL[trigger.session_mode];
|
|
257
278
|
if (trigger.session_mode === 'pinned' && trigger.session_id) {
|
|
258
279
|
return `${base} (${trigger.session_id.slice(0, 8)})`;
|
|
@@ -306,15 +327,25 @@ export const KIND_COPY = {
|
|
|
306
327
|
column: 'Security',
|
|
307
328
|
},
|
|
308
329
|
event: {
|
|
309
|
-
title: '
|
|
330
|
+
title: 'Connector events',
|
|
310
331
|
description: 'Have an agent run when something happens in a connected app.',
|
|
311
|
-
noun: '
|
|
312
|
-
createLabel: 'New
|
|
313
|
-
searchPlaceholder: 'Search
|
|
314
|
-
emptyTitle: 'No
|
|
332
|
+
noun: 'connector event',
|
|
333
|
+
createLabel: 'New connector event',
|
|
334
|
+
searchPlaceholder: 'Search connector events',
|
|
335
|
+
emptyTitle: 'No connector events yet',
|
|
315
336
|
emptyBody: 'Create one to have an agent run when a connected app reports something new.',
|
|
316
337
|
column: 'Status',
|
|
317
338
|
},
|
|
339
|
+
app: {
|
|
340
|
+
title: 'App events',
|
|
341
|
+
description: 'Have an agent run when one of your Kortix Apps emits an event.',
|
|
342
|
+
noun: 'App event',
|
|
343
|
+
createLabel: 'New App event',
|
|
344
|
+
searchPlaceholder: 'Search App events',
|
|
345
|
+
emptyTitle: 'No App events yet',
|
|
346
|
+
emptyBody: 'An App starts agents by emitting events. Add a trigger with on: { event, app } in kortix.yaml.',
|
|
347
|
+
column: 'Status',
|
|
348
|
+
},
|
|
318
349
|
};
|
|
319
350
|
/**
|
|
320
351
|
* The unified Triggers screen's own copy — the page that replaced the two
|
|
@@ -47,6 +47,7 @@ import { EventCheckTimes } from './event-check-times.js';
|
|
|
47
47
|
import { TriggerCallouts } from './trigger-callouts.js';
|
|
48
48
|
import { findDraftApp, resolveProfile, validate, } from './trigger-composer-logic.js';
|
|
49
49
|
import { draftFromTrigger, triggerPatch } from './trigger-edit-logic.js';
|
|
50
|
+
import { PostToField } from './post-to-field.js';
|
|
50
51
|
import { TriggerOptions } from './trigger-options.js';
|
|
51
52
|
import { TriggerReadOnly } from './trigger-readonly.js';
|
|
52
53
|
import { TriggerRunsPanel } from './trigger-runs-panel.js';
|
|
@@ -258,7 +259,7 @@ function SheetForm({ projectId, trigger, canWrite, eventsEnabled, appIndex, even
|
|
|
258
259
|
setServerConfig(null);
|
|
259
260
|
};
|
|
260
261
|
const editEvent = () => whenRef.current?.scrollIntoView({ block: 'start', behavior: 'smooth' });
|
|
261
|
-
return (_jsxs("div", { ref: bodyRef, className: "space-y-6", children: [_jsx(TriggerCallouts, { projectId: projectId, trigger: trigger, canEditEvent: canWrite && (app !== null || (!draft.appSlug && !draft.profile)), eventsEnabled: eventsEnabled, apps: appIndex, onEditEvent: editEvent }), _jsx(EventCheckTimes, { trigger: trigger }), canWrite ? (_jsxs(_Fragment, { children: [_jsxs("section", { ref: whenRef, "data-sheet-block": true, "data-block": "when", className: "space-y-3", children: [_jsx(Label, { children: t.raw('textcf9c7aa24a26') }), draft.kind === 'cron' ? (_jsx(WhenSchedule, { draft: draft, patch: patch, error: blockError('when') })) : draft.kind === 'webhook' ? (_jsx(WhenWebhookAddress, { trigger: trigger, draft: draft, patch: patch, canWrite: true })) : app || (!draft.appSlug && !draft.profile) ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(WhenEventSummary, { trigger: trigger, apps: appIndex, eventNames: eventNames, loading: apps.isLoading }))] }), _jsxs("section", { "data-sheet-block": true, "data-block": "then", className: "space-y-3", children: [_jsx(Label, { children: t.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { "data-sheet-block": true, "data-block": "name", className: "space-y-3", children: [_jsx(Label, { htmlFor: "trigger-name", children: t.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: t.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') ? true : undefined }), _jsx(InlineError, { message: blockError('name') })] }), _jsx("section", { "data-sheet-block": true, "data-block": "options", children: _jsx(TriggerOptions, { edit: true, projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] })) : (_jsx(TriggerReadOnly, { trigger: trigger, apps: appIndex, eventNames: eventNames, agentLabel: agentDisplayLabel(agents, trigger.agent) })), _jsx("div", { className: "pb-8", children: _jsx(Details, { trigger: trigger }) }), dirty && canWrite ? (
|
|
262
|
+
return (_jsxs("div", { ref: bodyRef, className: "space-y-6", children: [_jsx(TriggerCallouts, { projectId: projectId, trigger: trigger, canEditEvent: canWrite && (app !== null || (!draft.appSlug && !draft.profile)), eventsEnabled: eventsEnabled, apps: appIndex, onEditEvent: editEvent }), _jsx(EventCheckTimes, { trigger: trigger }), canWrite ? (_jsxs(_Fragment, { children: [_jsxs("section", { ref: whenRef, "data-sheet-block": true, "data-block": "when", className: "space-y-3", children: [_jsx(Label, { children: t.raw('textcf9c7aa24a26') }), draft.kind === 'cron' ? (_jsx(WhenSchedule, { draft: draft, patch: patch, error: blockError('when') })) : draft.kind === 'webhook' ? (_jsx(WhenWebhookAddress, { trigger: trigger, draft: draft, patch: patch, canWrite: true })) : app || (!draft.appSlug && !draft.profile) ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(WhenEventSummary, { trigger: trigger, apps: appIndex, eventNames: eventNames, loading: apps.isLoading }))] }), _jsxs("section", { "data-sheet-block": true, "data-block": "then", className: "space-y-3", children: [_jsx(Label, { children: t.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { "data-sheet-block": true, "data-block": "name", className: "space-y-3", children: [_jsx(Label, { htmlFor: "trigger-name", children: t.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: t.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') ? true : undefined }), _jsx(InlineError, { message: blockError('name') }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: base.sessionAccess })] }), _jsx("section", { "data-sheet-block": true, "data-block": "options", children: _jsx(TriggerOptions, { edit: true, projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] })) : (_jsx(TriggerReadOnly, { trigger: trigger, apps: appIndex, eventNames: eventNames, agentLabel: agentDisplayLabel(agents, trigger.agent) })), _jsx("div", { className: "pb-8", children: _jsx(Details, { trigger: trigger }) }), dirty && canWrite ? (
|
|
262
263
|
/* In the sheet's own scroll container, after the body: it sticks to the
|
|
263
264
|
bottom edge while the form is long, and rests under the form when it is short. */
|
|
264
265
|
_jsx(SaveBar, { surface: surface, pending: save.isPending, onSave: submit, onDiscard: discard })) : null] }));
|
|
@@ -45,12 +45,33 @@ export interface ComposerDraft {
|
|
|
45
45
|
secretName: string;
|
|
46
46
|
startActive: boolean;
|
|
47
47
|
sessionAccess: SharingSelection;
|
|
48
|
+
/** The channel or DM its runs post to (`project_channels`). Null = none: runs land in `#general`. */
|
|
49
|
+
spaceId: string | null;
|
|
48
50
|
/** Run limits (KRTX-1721) as typed. Empty = unset: 60 an hour, no daily cap. */
|
|
49
51
|
maxRunsPerHour: string;
|
|
50
52
|
maxRunsPerDay: string;
|
|
51
53
|
/** Overlap (KRTX-1721), fresh mode only. `default`: skip for a schedule, allow for the others. */
|
|
52
54
|
overlap: 'default' | 'skip' | 'allow';
|
|
53
55
|
}
|
|
56
|
+
/** The sharing a space implies: a channel thread is project-visible; a DM thread is the viewer's. */
|
|
57
|
+
export declare function spaceTriggerAccess(kind: 'channel' | 'dm', viewerId: string | undefined): SharingSelection;
|
|
58
|
+
/**
|
|
59
|
+
* "Post to" picks a space. The sharing follows the space only while the person
|
|
60
|
+
* has not chosen their own (it is still `base` or what the old space implied);
|
|
61
|
+
* a DM always sets its sharing and its agent, as the API requires. "No channel"
|
|
62
|
+
* gives back `base` when the sharing was only the space's.
|
|
63
|
+
*/
|
|
64
|
+
export declare function postToChange(draft: Pick<ComposerDraft, 'sessionAccess'>, next: {
|
|
65
|
+
spaceId: string;
|
|
66
|
+
kind: 'channel' | 'dm';
|
|
67
|
+
dmAgentName: string | null;
|
|
68
|
+
} | null, context: {
|
|
69
|
+
base: SharingSelection;
|
|
70
|
+
current: {
|
|
71
|
+
kind: 'channel' | 'dm';
|
|
72
|
+
} | null;
|
|
73
|
+
viewerId: string | undefined;
|
|
74
|
+
}): Partial<ComposerDraft>;
|
|
54
75
|
/** A run-limit input as the API wants it: empty → null (unset), else the number. */
|
|
55
76
|
export declare function runCapFromInput(raw: string): number | null;
|
|
56
77
|
export declare function initialDraft(init: {
|
|
@@ -59,6 +80,7 @@ export declare function initialDraft(init: {
|
|
|
59
80
|
appSlug?: string | null;
|
|
60
81
|
appSource?: string | null;
|
|
61
82
|
profile?: string | null;
|
|
83
|
+
spaceId?: string | null;
|
|
62
84
|
}): ComposerDraft;
|
|
63
85
|
/**
|
|
64
86
|
* A random signing key, hex-encoded.
|
|
@@ -7,6 +7,30 @@
|
|
|
7
7
|
import { accountToWrite, appConnectors, configProblem, defaultEventName, defaultEventPrompt, selectedAccountLabel, } from './event-trigger-copy.js';
|
|
8
8
|
import { describeCadence, describeOneOff, } from './schedule-copy.js';
|
|
9
9
|
import { conditionNeedsValue } from './schedule-fields.js';
|
|
10
|
+
/** The sharing a space implies: a channel thread is project-visible; a DM thread is the viewer's. */
|
|
11
|
+
export function spaceTriggerAccess(kind, viewerId) {
|
|
12
|
+
return kind === 'dm' && viewerId
|
|
13
|
+
? { mode: 'members', memberIds: [viewerId], groupIds: [] }
|
|
14
|
+
: { mode: 'project', memberIds: [], groupIds: [] };
|
|
15
|
+
}
|
|
16
|
+
const sameAccess = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
17
|
+
/**
|
|
18
|
+
* "Post to" picks a space. The sharing follows the space only while the person
|
|
19
|
+
* has not chosen their own (it is still `base` or what the old space implied);
|
|
20
|
+
* a DM always sets its sharing and its agent, as the API requires. "No channel"
|
|
21
|
+
* gives back `base` when the sharing was only the space's.
|
|
22
|
+
*/
|
|
23
|
+
export function postToChange(draft, next, context) {
|
|
24
|
+
const implied = context.current ? spaceTriggerAccess(context.current.kind, context.viewerId) : null;
|
|
25
|
+
const untouched = sameAccess(draft.sessionAccess, context.base) || (implied !== null && sameAccess(draft.sessionAccess, implied));
|
|
26
|
+
if (!next)
|
|
27
|
+
return { spaceId: null, ...(untouched ? { sessionAccess: context.base } : {}) };
|
|
28
|
+
return {
|
|
29
|
+
spaceId: next.spaceId,
|
|
30
|
+
...(next.kind === 'dm' || untouched ? { sessionAccess: spaceTriggerAccess(next.kind, context.viewerId) } : {}),
|
|
31
|
+
...(next.kind === 'dm' && next.dmAgentName ? { agent: next.dmAgentName } : {}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
10
34
|
/** A run-limit input as the API wants it: empty → null (unset), else the number. */
|
|
11
35
|
export function runCapFromInput(raw) {
|
|
12
36
|
const value = raw.trim();
|
|
@@ -37,6 +61,7 @@ export function initialDraft(init) {
|
|
|
37
61
|
secretName: '',
|
|
38
62
|
startActive: true,
|
|
39
63
|
sessionAccess: { mode: 'private', memberIds: [], groupIds: [] },
|
|
64
|
+
spaceId: init.spaceId ?? null,
|
|
40
65
|
maxRunsPerHour: '',
|
|
41
66
|
maxRunsPerDay: '',
|
|
42
67
|
overlap: 'default',
|
|
@@ -20,5 +20,10 @@ export interface TriggerComposerProps {
|
|
|
20
20
|
slug: string;
|
|
21
21
|
name: string;
|
|
22
22
|
} | null;
|
|
23
|
+
/** Posts to this channel or DM, e.g. from its Triggers tab. Still changeable. */
|
|
24
|
+
initialSpace?: {
|
|
25
|
+
spaceId: string;
|
|
26
|
+
kind: 'channel' | 'dm';
|
|
27
|
+
} | null;
|
|
23
28
|
}
|
|
24
29
|
export declare function TriggerComposer(props: TriggerComposerProps): import("react").JSX.Element;
|