@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
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One descriptor per chat channel: the facts the API, the manifest schema and
|
|
3
|
+
* the web read instead of repeating them. To add a channel, add its id and its
|
|
4
|
+
* descriptor here; `tsc` then names every record that needs a value for it.
|
|
5
|
+
*
|
|
6
|
+
* No imports, so the dependency-free manifest constants can read it. Not in the
|
|
7
|
+
* package root: `channel-message.ts` already exports `CHANNEL_PLATFORMS` there.
|
|
8
|
+
*/
|
|
9
|
+
/** The `platform` of a `channel` connector. The order is the manifest schema's enum order. */
|
|
10
|
+
export declare const CHANNEL_PLATFORM_IDS: readonly ["slack", "teams", "email", "telegram"];
|
|
11
|
+
export type ChannelPlatformId = (typeof CHANNEL_PLATFORM_IDS)[number];
|
|
12
|
+
export interface ChannelDescriptor {
|
|
13
|
+
/** The display name. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** The platform word of a prompt header, `[<envelope> · …]`. Transcripts store it: never rename one. */
|
|
16
|
+
envelope: string;
|
|
17
|
+
/** The `native:<id>` catalog card. Its icon is `/connector-icons/<id>.svg`. */
|
|
18
|
+
catalog: {
|
|
19
|
+
domain: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
/** The most characters one message holds. */
|
|
23
|
+
messageChars?: number;
|
|
24
|
+
/** One tap per option up to `max` options. `dataBytes`: the platform's cap on a button's data. */
|
|
25
|
+
buttons?: {
|
|
26
|
+
max: number;
|
|
27
|
+
dataBytes?: number;
|
|
28
|
+
};
|
|
29
|
+
/** The token a person pastes to connect. */
|
|
30
|
+
connect?: {
|
|
31
|
+
tokenPattern: RegExp;
|
|
32
|
+
tokenPlaceholder: string;
|
|
33
|
+
};
|
|
34
|
+
/** Senders pass an allow-list of these user ids. */
|
|
35
|
+
access?: {
|
|
36
|
+
userId: RegExp;
|
|
37
|
+
idPlaceholder: string;
|
|
38
|
+
idsPlaceholder: string;
|
|
39
|
+
idInputMode: 'numeric' | 'text';
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export declare const CHANNELS: {
|
|
43
|
+
readonly slack: {
|
|
44
|
+
readonly label: "Slack";
|
|
45
|
+
readonly envelope: "Slack";
|
|
46
|
+
readonly catalog: {
|
|
47
|
+
readonly domain: "slack.com";
|
|
48
|
+
readonly description: "Message the agent in Slack: mentions, DMs and channels, through the Kortix Slack app.";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly teams: {
|
|
52
|
+
readonly label: "Microsoft Teams";
|
|
53
|
+
readonly envelope: "Teams";
|
|
54
|
+
readonly catalog: {
|
|
55
|
+
readonly domain: "teams.microsoft.com";
|
|
56
|
+
readonly description: "Message the agent in Microsoft Teams chats and channels, through the Kortix Teams app.";
|
|
57
|
+
};
|
|
58
|
+
readonly buttons: {
|
|
59
|
+
readonly max: 6;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
readonly email: {
|
|
63
|
+
readonly label: "Email";
|
|
64
|
+
readonly envelope: "Email";
|
|
65
|
+
readonly catalog: {
|
|
66
|
+
readonly domain: "email.kortix";
|
|
67
|
+
readonly description: "Give the project an inbox: people email the agent and it replies.";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
readonly telegram: {
|
|
71
|
+
readonly label: "Telegram";
|
|
72
|
+
readonly envelope: "Telegram";
|
|
73
|
+
readonly catalog: {
|
|
74
|
+
readonly domain: "telegram.org";
|
|
75
|
+
readonly description: "Message the agent from Telegram through a bot you own.";
|
|
76
|
+
};
|
|
77
|
+
readonly messageChars: 4096;
|
|
78
|
+
readonly buttons: {
|
|
79
|
+
readonly max: 6;
|
|
80
|
+
readonly dataBytes: 64;
|
|
81
|
+
};
|
|
82
|
+
readonly connect: {
|
|
83
|
+
readonly tokenPattern: RegExp;
|
|
84
|
+
readonly tokenPlaceholder: "123456789:…";
|
|
85
|
+
};
|
|
86
|
+
readonly access: {
|
|
87
|
+
readonly userId: RegExp;
|
|
88
|
+
readonly idPlaceholder: "123456789";
|
|
89
|
+
readonly idsPlaceholder: "123456789, 987654321";
|
|
90
|
+
readonly idInputMode: "numeric";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/** The reserved slug a channel's built-in connector uses, so a user connector cannot take it. */
|
|
95
|
+
export declare const channelConnectorSlug: <P extends ChannelPlatformId>(platform: P) => `kortix_${P}`;
|
|
96
|
+
export declare const isChannelPlatform: (platform: string) => platform is ChannelPlatformId;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Recognise a channel-originated user message (Slack, Microsoft Teams,
|
|
3
|
-
* Telegram) inside the raw prompt text the API scaffolds for the agent, and
|
|
3
|
+
* Telegram, email) inside the raw prompt text the API scaffolds for the agent, and
|
|
4
4
|
* pull out what a person wants to see: who wrote it, where, and the words they
|
|
5
5
|
* typed — not the tenant ids and the `How to work:` instructions.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* `channelPromptText` below writes the current shape, so its writer and reader
|
|
8
|
+
* are one module. Every other shape is produced by exactly one API renderer:
|
|
8
9
|
*
|
|
9
10
|
* | Shape | Producer |
|
|
10
11
|
* | --- | --- |
|
|
12
|
+
* | `[<Platform> · <where> · message from <sender>]`, the text, then `── <Platform> instructions` after a blank line | `channelPromptText` (this module) |
|
|
11
13
|
* | `You're answering a message on Slack as a teammate.` | `channels/slack/session.ts` renderAgentPrompt |
|
|
12
14
|
* | `New message from <user> in Slack channel <channel>, thread <ts>:` | `channels/slack/session.ts` renderFollowUpPrompt |
|
|
13
15
|
* | `New message from <user> in the same Slack thread:` | the same renderer before 2026-09, kept for old transcripts |
|
|
14
16
|
* | `You're answering a message on Microsoft Teams as a teammate.` | `channels/teams/session.ts` renderAgentPrompt |
|
|
15
17
|
* | `New message from <user> in the same Teams conversation:` | `channels/teams/session.ts` renderFollowUpPrompt |
|
|
16
|
-
* | `You received a message on Telegram.` |
|
|
17
|
-
* | `
|
|
18
|
+
* | `You received a message on Telegram.` + `Chat:`/`From:`/`Message id:`, the text, `How to answer:` | the Telegram renderer from 2026-10-24 until `channelPromptText`, kept so old transcripts still render |
|
|
19
|
+
* | `New Telegram message from <user> in the same chat:` + the same block | the same renderer, kept so old transcripts still render |
|
|
20
|
+
* | `You received a message on Telegram.` + a `Message:` line | the retired one-session-per-message Telegram webhook (removed 2026-10-24), kept so old transcripts still render |
|
|
21
|
+
* | `[<Platform> · <context> · message from <user>]` with no such delimiter | the pre-2026 header, kept so old transcripts still render |
|
|
18
22
|
*
|
|
19
23
|
* The parser is pure and framework-free so `channel-message.test.ts` can pin
|
|
20
24
|
* each shape against the real prompt text. The web and mobile session views
|
|
@@ -25,7 +29,9 @@
|
|
|
25
29
|
* attempt. The pre-2026 header regex and the `<at>` strip did: 240k characters
|
|
26
30
|
* took 22 s and 7 s.
|
|
27
31
|
*/
|
|
28
|
-
|
|
32
|
+
/** The platform words a header names: each channel descriptor's `envelope`. Any other word reads as Slack, as every deployed build reads it. */
|
|
33
|
+
export declare const CHANNEL_PLATFORMS: ("Slack" | "Teams" | "Email" | "Telegram")[];
|
|
34
|
+
export type ChannelPlatform = (typeof CHANNEL_PLATFORMS)[number];
|
|
29
35
|
export interface ChannelMessageInfo {
|
|
30
36
|
platform: ChannelPlatform;
|
|
31
37
|
/** Channel / conversation / chat id; empty for a follow-up, which carries none. */
|
|
@@ -36,3 +42,37 @@ export interface ChannelMessageInfo {
|
|
|
36
42
|
followUp: boolean;
|
|
37
43
|
}
|
|
38
44
|
export declare function parseChannelMessage(rawText: string | null | undefined): ChannelMessageInfo | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The lines Kortix wrote in a `channelPromptText` prompt: from its last `── <Platform> instructions`
|
|
47
|
+
* line on, where the channel core also puts each file's `<file>` tag. Empty for an older shape. A
|
|
48
|
+
* `<file>` tag before that line is in the sender's text, so it is text, not a file.
|
|
49
|
+
*/
|
|
50
|
+
export declare function channelPromptTail(text: string, platform: ChannelPlatform): string;
|
|
51
|
+
/**
|
|
52
|
+
* True when the sender's text is only the label an adapter writes for a file sent with no caption
|
|
53
|
+
* (`(photo)`, `(file q3.pdf)`, `(voice message, 7 s)`). A view that draws the file hides it.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isChannelFileLabel(text: string): boolean;
|
|
56
|
+
/** What a channel adapter knows about one incoming message; `channelPromptText` writes it. */
|
|
57
|
+
export interface ChannelEnvelope {
|
|
58
|
+
platform: ChannelPlatform;
|
|
59
|
+
/** What a person reads: `@sam`, `Sam Rivera`, `a@b.c`. */
|
|
60
|
+
sender: string;
|
|
61
|
+
/** The chat title, `direct message`, or an email subject. */
|
|
62
|
+
where: string;
|
|
63
|
+
/** The person's words, or a question answer. */
|
|
64
|
+
text: string;
|
|
65
|
+
/** One shell command that answers THIS message. */
|
|
66
|
+
reply: string;
|
|
67
|
+
/** Ids, limits and platform rules: for the agent only, one line each. */
|
|
68
|
+
notes: string[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The prompt for one channel message. The header line is the one every client
|
|
72
|
+
* build reads (`readLegacyChannelHeader`), the text follows unchanged, and the
|
|
73
|
+
* agent-only lines start at the last `── <Platform> instructions` line, where
|
|
74
|
+
* `parseChannelMessage` cuts.
|
|
75
|
+
*/
|
|
76
|
+
export declare function channelPromptText(e: ChannelEnvelope, opts?: {
|
|
77
|
+
revived?: boolean;
|
|
78
|
+
}): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A channel's slug from its name: lowercase, whitespace runs → `-`, other
|
|
3
|
+
* characters dropped, `-` runs collapsed and trimmed, at most 40 characters.
|
|
4
|
+
* Empty when the name has no `a-z0-9`. The API derives the stored slug with
|
|
5
|
+
* this function, and the create dialog previews it, so the two never differ.
|
|
6
|
+
*/
|
|
7
|
+
export declare function spaceSlug(name: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Where every private channel's folder lives: outside `/Company`, so the
|
|
10
|
+
* project grant on `/Company` and project admins never reach it. Only the
|
|
11
|
+
* channel's members (one grant each) and the channel's own threads do. The
|
|
12
|
+
* folder is named by the channel's id, never its name: a rename moves
|
|
13
|
+
* nothing, and a later channel that takes the name never inherits the folder.
|
|
14
|
+
* Only `/Channels/<space_id>` of a private channel of the project is reserved;
|
|
15
|
+
* any other path under `/Channels` is an ordinary folder (the API's
|
|
16
|
+
* `privateChannelFolderOf`).
|
|
17
|
+
*/
|
|
18
|
+
export declare const PRIVATE_CHANNELS_DIR = "/Channels";
|
|
19
|
+
/**
|
|
20
|
+
* A space's two folders in the project's Files (drive paths). A public
|
|
21
|
+
* channel's are shared with the project: `/Company/Channels/<slug>` and its
|
|
22
|
+
* `Memory`. A private channel's are `/Channels/<space_id>` and its `Memory`
|
|
23
|
+
* (pass its id as `privateSpaceId`). A DM's
|
|
24
|
+
* are in the member's own folder: `<personal>/Agents/<agent>` and its
|
|
25
|
+
* memory `<personal>/Memory/<agent>` (the agent folder of the DM's Memory
|
|
26
|
+
* tab, which also lists the rest of `<personal>/Memory`). Null for a DM without a personal folder,
|
|
27
|
+
* and for a name that is not one plain path segment (an agent name is not
|
|
28
|
+
* validated as one when the DM is opened).
|
|
29
|
+
* The API (folder create, rename, the session's /drives/README.md) and the web
|
|
30
|
+
* tabs read this, so both name the same folders.
|
|
31
|
+
*/
|
|
32
|
+
export declare function spaceDriveFolders(kind: 'channel' | 'dm', name: string, personalFolder: string | null,
|
|
33
|
+
/** A private channel's id; null for a public channel or a DM. */
|
|
34
|
+
privateSpaceId?: string | null): {
|
|
35
|
+
files: string;
|
|
36
|
+
memory: string;
|
|
37
|
+
} | null;
|
|
@@ -18,5 +18,5 @@ import { UiLink as Link } from '../../providers/ui-provider.js';
|
|
|
18
18
|
export function AccessDetailShell({ back, avatar, title, badges, meta, actions, tabs, activeTab, onTabChange, loading = false, children, className, }) {
|
|
19
19
|
const backContent = back ? (_jsxs(_Fragment, { children: [_jsx(CaretLeftIcon, { className: "size-4" }), back.label] })) : null;
|
|
20
20
|
const backClass = 'text-muted-foreground hover:text-foreground flex w-fit items-center gap-1 text-sm transition-colors';
|
|
21
|
-
return (_jsxs("div", { className: cn('mx-auto w-full max-w-6xl space-y-5 pb-10', className), children: [_jsxs("div", { className: "space-y-5", children: [!back ? null : back.href ? (_jsx(Link, { href: back.href, className: backClass, children: backContent })) : (_jsx("button", { type: "button", onClick: back.onClick, className: backClass, children: backContent })), _jsxs("div", { className: "flex min-w-0 items-
|
|
21
|
+
return (_jsxs("div", { className: cn('mx-auto w-full max-w-6xl space-y-5 pb-10', className), children: [_jsxs("div", { className: "space-y-5", children: [!back ? null : back.href ? (_jsx(Link, { href: back.href, className: backClass, children: backContent })) : (_jsx("button", { type: "button", onClick: back.onClick, className: backClass, children: backContent })), _jsxs("div", { className: "flex min-w-0 items-center gap-3.5", children: [loading ? _jsx(Skeleton, { className: "size-10 rounded-md" }) : avatar, _jsxs("div", { className: "min-w-0 flex-1 space-y-0.5", children: [loading ? (_jsx(Skeleton, { className: "h-6 w-44" })) : (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("h2", { className: "text-foreground truncate text-base leading-6 font-medium", children: title }), badges] })), meta ? _jsx("div", { className: "text-muted-foreground truncate text-sm", children: meta }) : null] }), actions ? _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions }) : null] })] }), tabs && tabs.length > 0 ? (_jsxs(Tabs, { value: activeTab, onValueChange: onTabChange, className: "space-y-6", children: [_jsx(TabsList, { type: "underline", className: "flex w-full items-center justify-start", children: tabs.map((tab) => (_jsxs(TabsTrigger, { value: tab.value, className: "w-fit flex-none", children: [tab.label, tab.badge] }, tab.value))) }), children] })) : (_jsx("div", { className: "space-y-6", children: children }))] }));
|
|
22
22
|
}
|
|
@@ -88,3 +88,14 @@ export interface PrincipalPickerProps {
|
|
|
88
88
|
className?: string;
|
|
89
89
|
}
|
|
90
90
|
export declare function PrincipalPicker({ scope, selection, kinds, allowInvite, everyone, excludeUserIds, value, onChange, emptyLabel, allExcludedLabel, autoFocus, disabled, searchPlaceholder, className, }: PrincipalPickerProps): import("react").JSX.Element;
|
|
91
|
+
/** One picker row. Exported for the channel "Add members" picker, which moves `highlighted` with the arrow keys. */
|
|
92
|
+
export declare function PickerRow({ selected, selection, highlighted, disabled, onSelect, leading, label, suffix, }: {
|
|
93
|
+
selected: boolean;
|
|
94
|
+
selection: 'single' | 'multi';
|
|
95
|
+
highlighted?: boolean;
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
onSelect: () => void;
|
|
98
|
+
leading: React.ReactNode;
|
|
99
|
+
label: string;
|
|
100
|
+
suffix?: string;
|
|
101
|
+
}): import("react").JSX.Element;
|
|
@@ -267,6 +267,7 @@ export function PrincipalPicker({ scope, selection = 'multi', kinds = ['member',
|
|
|
267
267
|
function PickerSectionLabel({ children }) {
|
|
268
268
|
return (_jsx("p", { className: "text-muted-foreground px-2 pt-2 pb-1 text-xs font-medium first:pt-1.5", children: children }));
|
|
269
269
|
}
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
/** One picker row. Exported for the channel "Add members" picker, which moves `highlighted` with the arrow keys. */
|
|
271
|
+
export function PickerRow({ selected, selection, highlighted = false, disabled, onSelect, leading, label, suffix, }) {
|
|
272
|
+
return (_jsxs("button", { type: "button", role: selection === 'single' ? 'radio' : undefined, "aria-checked": selection === 'single' ? selected : undefined, "aria-pressed": selection === 'multi' ? selected : undefined, disabled: disabled, onClick: onSelect, className: cn('flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors', 'disabled:cursor-not-allowed disabled:opacity-50', selected ? 'bg-primary/[0.06]' : highlighted ? 'bg-muted/50' : 'hover:bg-muted/50'), children: [leading, _jsxs("span", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: [label, suffix ? _jsx("span", { className: "text-muted-foreground ml-1 text-xs", children: suffix }) : null] }), selected ? (_jsx("span", { className: "shrink-0 px-1", children: _jsx(CheckCircleIcon, { weight: "fill", className: "size-[1.1rem]" }) })) : null] }));
|
|
272
273
|
}
|
|
@@ -12,6 +12,8 @@ export declare function ensureFrame(key: string, url: string, attributes: {
|
|
|
12
12
|
title: string;
|
|
13
13
|
sandbox: string;
|
|
14
14
|
allow: string;
|
|
15
|
+
testid?: string;
|
|
16
|
+
referrerPolicy?: ReferrerPolicy;
|
|
15
17
|
}): void;
|
|
16
18
|
/** Show the frame in `slot`. Returns the release: the frame goes back to the previous claim. */
|
|
17
19
|
export declare function claimFrame(key: string, slot: HTMLElement, placement: FramePlacement): () => void;
|
|
@@ -19,8 +21,11 @@ export declare function claimFrame(key: string, slot: HTMLElement, placement: Fr
|
|
|
19
21
|
export declare function restyleFrame(key: string, slot: HTMLElement, placement: FramePlacement): void;
|
|
20
22
|
/** Load the App again from `url` (a fresh access session). */
|
|
21
23
|
export declare function reloadFrame(key: string, url: string): void;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Drop every frame whose key is not in `keep` (a new release, a deleted App,
|
|
26
|
+
* another project). `owns` limits the sweep to one kind of frame.
|
|
27
|
+
*/
|
|
28
|
+
export declare function pruneFrames(keep: Set<string>, owns?: (key: string) => boolean): void;
|
|
24
29
|
/** The frame's load status, or null before it exists. */
|
|
25
30
|
export declare function frameStatus(key: string): FrameStatus | null;
|
|
26
31
|
export declare function useFrameStatus(key: string): FrameStatus | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
/**
|
|
3
|
-
* One live frame per App preview, kept for as long as
|
|
3
|
+
* One live frame per App preview (and per artifact page), kept for as long as
|
|
4
|
+
* the project is open.
|
|
4
5
|
*
|
|
5
6
|
* A card thumbnail and the big view used to each own an `<iframe>`, so every
|
|
6
7
|
* page switch and every open loaded the App again. Here a frame is created
|
|
@@ -8,7 +9,10 @@
|
|
|
8
9
|
* parked off screen. A card or the big view CLAIMS it: the frame moves into
|
|
9
10
|
* that slot with `Element.moveBefore`, which keeps the document alive. The
|
|
10
11
|
* newest claim wins; releasing hands it back to the previous claim, else to
|
|
11
|
-
* the parking lot.
|
|
12
|
+
* the parking lot. A release lands at the end of the task: a release and a
|
|
13
|
+
* claim in one React commit (a Strict Mode remount, a page handing the frame
|
|
14
|
+
* to the next) leave the frame where it is or move it once, never through the
|
|
15
|
+
* parking lot, whose different size makes the page lay out (and flash) twice. Without `moveBefore` (older browsers) the move reloads the
|
|
12
16
|
* frame — the old behavior — and nothing is preloaded.
|
|
13
17
|
*
|
|
14
18
|
* The frame's `src` is set once. A refetched access session mints a new URL
|
|
@@ -76,7 +80,9 @@ export function ensureFrame(key, url, attributes) {
|
|
|
76
80
|
frame.title = attributes.title;
|
|
77
81
|
frame.setAttribute('sandbox', attributes.sandbox);
|
|
78
82
|
frame.allow = attributes.allow;
|
|
79
|
-
frame.dataset.testid = 'app-live-preview';
|
|
83
|
+
frame.dataset.testid = attributes.testid ?? 'app-live-preview';
|
|
84
|
+
if (attributes.referrerPolicy)
|
|
85
|
+
frame.referrerPolicy = attributes.referrerPolicy;
|
|
80
86
|
frame.dataset.frameKey = key;
|
|
81
87
|
const entry = { frame, status: 'loading', claims: [] };
|
|
82
88
|
frame.addEventListener('load', () => {
|
|
@@ -105,9 +111,23 @@ export function claimFrame(key, slot, placement) {
|
|
|
105
111
|
return () => {
|
|
106
112
|
entry.claims = entry.claims.filter((item) => item !== claim);
|
|
107
113
|
if (entries.get(key) === entry)
|
|
108
|
-
|
|
114
|
+
placeAfterTask(entry);
|
|
109
115
|
};
|
|
110
116
|
}
|
|
117
|
+
// Entries whose claims changed by a release, placed once the current task ends.
|
|
118
|
+
const releasing = new Set();
|
|
119
|
+
function placeAfterTask(entry) {
|
|
120
|
+
if (releasing.size === 0) {
|
|
121
|
+
queueMicrotask(() => {
|
|
122
|
+
const due = [...releasing];
|
|
123
|
+
releasing.clear();
|
|
124
|
+
for (const item of due)
|
|
125
|
+
if (entries.get(item.frame.dataset.frameKey ?? '') === item)
|
|
126
|
+
place(item);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
releasing.add(entry);
|
|
130
|
+
}
|
|
111
131
|
/** Restyle the current claim of `slot` (a card's scale changes as it is measured). */
|
|
112
132
|
export function restyleFrame(key, slot, placement) {
|
|
113
133
|
const entry = entries.get(key);
|
|
@@ -127,11 +147,14 @@ export function reloadFrame(key, url) {
|
|
|
127
147
|
entry.frame.src = url;
|
|
128
148
|
notify();
|
|
129
149
|
}
|
|
130
|
-
/**
|
|
131
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Drop every frame whose key is not in `keep` (a new release, a deleted App,
|
|
152
|
+
* another project). `owns` limits the sweep to one kind of frame.
|
|
153
|
+
*/
|
|
154
|
+
export function pruneFrames(keep, owns = () => true) {
|
|
132
155
|
let changed = false;
|
|
133
156
|
for (const [key, entry] of entries) {
|
|
134
|
-
if (keep.has(key) || entry.claims.length > 0)
|
|
157
|
+
if (!owns(key) || keep.has(key) || entry.claims.length > 0)
|
|
135
158
|
continue;
|
|
136
159
|
entry.frame.remove();
|
|
137
160
|
entries.delete(key);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UiTranslator } from '../i18n/index.js';
|
|
2
|
-
import { type App, type AppAccessMode, type AppCapability, type AppDeployment, type AppViewerTokenScope } from '@kortix/sdk';
|
|
2
|
+
import { type App, type AppAccessMode, type AppCapability, type AppDeployment, type AppViewerTokenScope, type ProjectTrigger } from '@kortix/sdk';
|
|
3
3
|
type DeploymentTone = 'success' | 'destructive' | 'warning' | 'muted';
|
|
4
4
|
/**
|
|
5
5
|
* Every deployment status, in words a person who did not build this can read.
|
|
@@ -65,31 +65,39 @@ export declare function appStatus(app: App, tI18nComplete: UiTranslator): {
|
|
|
65
65
|
label: string;
|
|
66
66
|
dot: string;
|
|
67
67
|
};
|
|
68
|
+
export { appAdminsOnly, gridApps } from '../_vendor/shared/app-config.js';
|
|
69
|
+
/** The Apps of the project that are neither a card nor a tab: the ones the page counts as hidden. */
|
|
70
|
+
export declare function hiddenApps(apps: App[], canAdmin?: boolean): App[];
|
|
68
71
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* control shows only for the Apps that support it.
|
|
72
|
+
* How an App is wired into the project's triggers: the ones that call it
|
|
73
|
+
* (`run: { app }`) and the ones its own events start (`on: { event, app }`).
|
|
72
74
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
export declare function appTriggers(app: App, triggers: ProjectTrigger[]): {
|
|
76
|
+
calledBy: ProjectTrigger[];
|
|
77
|
+
startsOn: ProjectTrigger[];
|
|
78
|
+
};
|
|
79
|
+
/** The one-line state of the Background list: how many Apps are up, asleep, not deployed, external. */
|
|
80
|
+
export declare function backgroundSummary(apps: App[]): {
|
|
81
|
+
running: number;
|
|
82
|
+
asleep: number;
|
|
83
|
+
undeployed: number;
|
|
84
|
+
external: number;
|
|
85
|
+
};
|
|
78
86
|
/** The Apps `app`'s detail shows as tabs (their `display.parent` is its slug). */
|
|
79
87
|
export declare function childApps(apps: App[], app: App, canAdmin?: boolean): App[];
|
|
80
|
-
/**
|
|
81
|
-
* Its primary service is `access: admins` (a backend's admin dashboard): only
|
|
82
|
-
* project admins can open it, so nobody else is shown a card or tab for it.
|
|
83
|
-
*/
|
|
84
88
|
/**
|
|
85
89
|
* The App whose live preview a card shows: the App itself, or, when it hides
|
|
86
90
|
* its own (`display.preview: none`), its first tab the viewer may open (a
|
|
87
91
|
* backend's dashboard). Null: the card shows an icon.
|
|
88
92
|
*/
|
|
89
93
|
export declare function cardPreviewApp(apps: App[], app: App, canAdmin?: boolean): App | null;
|
|
90
|
-
export declare function appAdminsOnly(app: App): boolean;
|
|
91
94
|
/** A tab's label: the App's name without its parent's slug ("crm-data-dashboard" → "Dashboard"). */
|
|
92
95
|
export declare function appTabLabel(child: App, parent: App): string;
|
|
96
|
+
/**
|
|
97
|
+
* Does this App offer `capability`? The ONE way the Apps UI branches between
|
|
98
|
+
* Apps: the server lists what each App supports (`app.capabilities`), and a
|
|
99
|
+
* control shows only for the Apps that support it.
|
|
100
|
+
*/
|
|
93
101
|
export declare function appCan(app: App, capability: AppCapability): boolean;
|
|
94
102
|
/** "2 vCPU · 4 GB · 20 GB": the machine size of an App. */
|
|
95
103
|
export declare function appSizeLabel(app: App, t: UiTranslator): string;
|
|
@@ -151,4 +159,3 @@ export declare function localizedAppCopy(tI18nComplete: UiTranslator): {
|
|
|
151
159
|
desc: string;
|
|
152
160
|
}>;
|
|
153
161
|
};
|
|
154
|
-
export {};
|
package/dist/apps/app-shared.js
CHANGED
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { CopyButton } from '../markdown/copy-button.js';
|
|
4
4
|
import { localizeUiCatalog, translateUiCatalogText } from '../i18n/ui-catalog/localize-ui-catalog.js';
|
|
5
5
|
import { PRODUCT_CATALOG_TRANSLATION_KEYS } from '../i18n/ui-catalog/product-catalog-translation-keys.generated.js';
|
|
6
|
+
import { appAdminsOnly } from '../_vendor/kortix-shared.js';
|
|
6
7
|
import { cn } from '../lib/utils.js';
|
|
7
8
|
import { stripTrailingSlashes } from '@kortix/sdk';
|
|
8
9
|
/**
|
|
@@ -50,7 +51,7 @@ export function deployNotice(latest, tI18nComplete) {
|
|
|
50
51
|
return { label: tI18nComplete.raw('text0b5260e1b405'), tone: 'warning' };
|
|
51
52
|
}
|
|
52
53
|
export function appCommand(app) {
|
|
53
|
-
return `kortix apps deploy . --app ${app.
|
|
54
|
+
return `kortix apps deploy . --app ${app.slug}`;
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
56
57
|
* The hostname a person reads an App by.
|
|
@@ -93,29 +94,44 @@ export function appStatus(app, tI18nComplete) {
|
|
|
93
94
|
dot: live ? 'bg-kortix-green' : deployed ? 'bg-muted-foreground/50' : 'bg-muted-foreground/25',
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*/
|
|
101
|
-
/**
|
|
102
|
-
* The Apps the grid shows as cards (`display`): not `listed: false`, and not a
|
|
103
|
-
* tab of a parent that exists. A tab whose parent is gone stays reachable as a card.
|
|
104
|
-
*/
|
|
105
|
-
export function gridApps(apps, canAdmin = true) {
|
|
97
|
+
// The grid rule is shared with the API's channel Apps count (`@kortix/shared/app-config`).
|
|
98
|
+
export { appAdminsOnly, gridApps } from '../_vendor/kortix-shared.js';
|
|
99
|
+
/** The Apps of the project that are neither a card nor a tab: the ones the page counts as hidden. */
|
|
100
|
+
export function hiddenApps(apps, canAdmin = true) {
|
|
106
101
|
const slugs = new Set(apps.map((app) => app.slug));
|
|
107
|
-
return apps.filter((app) => app.display?.listed !==
|
|
102
|
+
return apps.filter((app) => app.display?.listed !== true
|
|
108
103
|
&& !(app.display?.parent && slugs.has(app.display.parent))
|
|
109
104
|
&& (canAdmin || !appAdminsOnly(app)));
|
|
110
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* How an App is wired into the project's triggers: the ones that call it
|
|
108
|
+
* (`run: { app }`) and the ones its own events start (`on: { event, app }`).
|
|
109
|
+
*/
|
|
110
|
+
export function appTriggers(app, triggers) {
|
|
111
|
+
return {
|
|
112
|
+
calledBy: triggers.filter((row) => row.target?.app === app.slug),
|
|
113
|
+
startsOn: triggers.filter((row) => row.type === 'app' && row.app === app.slug),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/** The one-line state of the Background list: how many Apps are up, asleep, not deployed, external. */
|
|
117
|
+
export function backgroundSummary(apps) {
|
|
118
|
+
const out = { running: 0, asleep: 0, undeployed: 0, external: 0 };
|
|
119
|
+
for (const row of apps) {
|
|
120
|
+
if (row.external_url)
|
|
121
|
+
out.external += 1;
|
|
122
|
+
else if (!row.active_deployment_id)
|
|
123
|
+
out.undeployed += 1;
|
|
124
|
+
else if (row.desired_state === 'running' || row.hosting_type === 'static')
|
|
125
|
+
out.running += 1;
|
|
126
|
+
else
|
|
127
|
+
out.asleep += 1;
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
111
131
|
/** The Apps `app`'s detail shows as tabs (their `display.parent` is its slug). */
|
|
112
132
|
export function childApps(apps, app, canAdmin = true) {
|
|
113
133
|
return apps.filter((row) => row.display?.parent === app.slug && (canAdmin || !appAdminsOnly(row)));
|
|
114
134
|
}
|
|
115
|
-
/**
|
|
116
|
-
* Its primary service is `access: admins` (a backend's admin dashboard): only
|
|
117
|
-
* project admins can open it, so nobody else is shown a card or tab for it.
|
|
118
|
-
*/
|
|
119
135
|
/**
|
|
120
136
|
* The App whose live preview a card shows: the App itself, or, when it hides
|
|
121
137
|
* its own (`display.preview: none`), its first tab the viewer may open (a
|
|
@@ -127,14 +143,16 @@ export function cardPreviewApp(apps, app, canAdmin = true) {
|
|
|
127
143
|
const first = childApps(apps, app, canAdmin)[0];
|
|
128
144
|
return first && appCan(first, 'preview') && first.viewer_can_access !== false ? first : null;
|
|
129
145
|
}
|
|
130
|
-
export function appAdminsOnly(app) {
|
|
131
|
-
return app.services?.find((service) => service.name === 'http')?.access === 'admins';
|
|
132
|
-
}
|
|
133
146
|
/** A tab's label: the App's name without its parent's slug ("crm-data-dashboard" → "Dashboard"). */
|
|
134
147
|
export function appTabLabel(child, parent) {
|
|
135
148
|
const name = child.name.startsWith(`${parent.slug}-`) ? child.name.slice(parent.slug.length + 1) : child.name;
|
|
136
149
|
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
137
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Does this App offer `capability`? The ONE way the Apps UI branches between
|
|
153
|
+
* Apps: the server lists what each App supports (`app.capabilities`), and a
|
|
154
|
+
* control shows only for the Apps that support it.
|
|
155
|
+
*/
|
|
138
156
|
export function appCan(app, capability) {
|
|
139
157
|
return app.capabilities?.includes(capability) ?? false;
|
|
140
158
|
}
|
package/dist/apps/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* @kortix/ui/apps — Live App frames, the frame pool and the App view model.
|
|
3
3
|
*/
|
|
4
4
|
export { AppPreview, AppPreviewOverlay, PREVIEW_SPINNER_DELAY_MS, PREVIEW_TILE_ASPECT, PREVIEW_VIEWPORT_HEIGHT, PREVIEW_VIEWPORT_WIDTH, framePlacement, previewScale, scheduleSlowPreview, } from './app-preview.js';
|
|
5
|
-
export { ensureFrame, frameKey, framesKeepAlive, pruneFrames, reloadFrame, } from './app-preview-pool.js';
|
|
6
|
-
export { ANONYMOUS_MODES, DEPLOYMENT_COPY, appCan, appCommand, appHost, appStatus, appTabLabel, cardPreviewApp, childApps, deployNotice, gridApps, localizedAppCopy, } from './app-shared.js';
|
|
5
|
+
export { claimFrame, ensureFrame, frameKey, framesKeepAlive, pruneFrames, reloadFrame, restyleFrame, useFrameStatus, type FramePlacement, } from './app-preview-pool.js';
|
|
6
|
+
export { ANONYMOUS_MODES, DEPLOYMENT_COPY, appCan, appCommand, appHost, appSizeLabel, DeployCommand, appStatus, appTabLabel, cardPreviewApp, childApps, deployNotice, gridApps, hiddenApps, appTriggers, backgroundSummary, localizedAppCopy, } from './app-shared.js';
|
|
7
7
|
export { isKortixAppUrl } from './kortix-app-url.js';
|
package/dist/apps/index.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* @kortix/ui/apps — Live App frames, the frame pool and the App view model.
|
|
3
3
|
*/
|
|
4
4
|
export { AppPreview, AppPreviewOverlay, PREVIEW_SPINNER_DELAY_MS, PREVIEW_TILE_ASPECT, PREVIEW_VIEWPORT_HEIGHT, PREVIEW_VIEWPORT_WIDTH, framePlacement, previewScale, scheduleSlowPreview, } from './app-preview.js';
|
|
5
|
-
export { ensureFrame, frameKey, framesKeepAlive, pruneFrames, reloadFrame, } from './app-preview-pool.js';
|
|
6
|
-
export { ANONYMOUS_MODES, DEPLOYMENT_COPY, appCan, appCommand, appHost, appStatus, appTabLabel, cardPreviewApp, childApps, deployNotice, gridApps, localizedAppCopy, } from './app-shared.js';
|
|
5
|
+
export { claimFrame, ensureFrame, frameKey, framesKeepAlive, pruneFrames, reloadFrame, restyleFrame, useFrameStatus, } from './app-preview-pool.js';
|
|
6
|
+
export { ANONYMOUS_MODES, DEPLOYMENT_COPY, appCan, appCommand, appHost, appSizeLabel, DeployCommand, appStatus, appTabLabel, cardPreviewApp, childApps, deployNotice, gridApps, hiddenApps, appTriggers, backgroundSummary, localizedAppCopy, } from './app-shared.js';
|
|
7
7
|
export { isKortixAppUrl } from './kortix-app-url.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An artifact page. The frame lives in the project's frame pool
|
|
3
|
+
* (`@kortix/ui/apps`, shared with App previews): it loads once, in the
|
|
4
|
+
* background or on first show, and moves between the gallery card and the
|
|
5
|
+
* viewer without reloading. `frameKey` changes after a save, so an edit loads
|
|
6
|
+
* the new page. The ref is the slot (the viewer's full screen target).
|
|
7
|
+
*/
|
|
8
|
+
export declare const ArtifactFrame: import("react").ForwardRefExoticComponent<{
|
|
9
|
+
frameKey: string;
|
|
10
|
+
src: string;
|
|
11
|
+
title: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
preview?: boolean;
|
|
14
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
/** Create (and park) the pooled frame for an artifact page; a no-op when it exists. */
|
|
16
|
+
export declare function ensureArtifactFrame(key: string, src: string, title: string): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useLayoutEffect, useState } from 'react';
|
|
4
|
+
import { claimFrame, ensureFrame } from '../apps/app-preview-pool.js';
|
|
5
|
+
import { ARTIFACT_FRAME_ALLOW, ARTIFACT_IFRAME_SANDBOX } from './frame-policy.js';
|
|
6
|
+
/**
|
|
7
|
+
* The frame's canvas: what shows where the page has not painted yet. Open, a
|
|
8
|
+
* third-party page with no background of its own reads as a white page, as it
|
|
9
|
+
* would in a browser tab, in both themes. As a card preview it is the app's
|
|
10
|
+
* background: a preview that is still painting (on load, on a tab switch)
|
|
11
|
+
* must not flash white in the dark theme.
|
|
12
|
+
*/
|
|
13
|
+
const ARTIFACT_CANVAS = 'bg-white';
|
|
14
|
+
const PREVIEW_CANVAS = 'bg-background';
|
|
15
|
+
/**
|
|
16
|
+
* An artifact page. The frame lives in the project's frame pool
|
|
17
|
+
* (`@kortix/ui/apps`, shared with App previews): it loads once, in the
|
|
18
|
+
* background or on first show, and moves between the gallery card and the
|
|
19
|
+
* viewer without reloading. `frameKey` changes after a save, so an edit loads
|
|
20
|
+
* the new page. The ref is the slot (the viewer's full screen target).
|
|
21
|
+
*/
|
|
22
|
+
export const ArtifactFrame = forwardRef(function ArtifactFrame({ frameKey, src, title, className, preview }, ref) {
|
|
23
|
+
const [slot, setSlot] = useState(null);
|
|
24
|
+
const interactive = !preview;
|
|
25
|
+
const frameClass = `${className ?? ''} ${preview ? PREVIEW_CANVAS : ARTIFACT_CANVAS}`;
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
if (!slot)
|
|
28
|
+
return;
|
|
29
|
+
ensureArtifactFrame(frameKey, src, title);
|
|
30
|
+
const release = claimFrame(frameKey, slot, { className: frameClass, style: {}, interactive });
|
|
31
|
+
// The viewer hands the keyboard to the page, so a deck's arrow keys work at once.
|
|
32
|
+
if (interactive)
|
|
33
|
+
slot.querySelector('iframe')?.focus({ preventScroll: true });
|
|
34
|
+
return release;
|
|
35
|
+
// The URL is read once per key: a refetch must not reload the page.
|
|
36
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
+
}, [frameKey, slot, interactive, frameClass]);
|
|
38
|
+
return (_jsx("div", { ref: (node) => {
|
|
39
|
+
setSlot(node);
|
|
40
|
+
if (typeof ref === 'function')
|
|
41
|
+
ref(node);
|
|
42
|
+
else if (ref)
|
|
43
|
+
ref.current = node;
|
|
44
|
+
}, className: "absolute inset-0" }));
|
|
45
|
+
});
|
|
46
|
+
/** Create (and park) the pooled frame for an artifact page; a no-op when it exists. */
|
|
47
|
+
export function ensureArtifactFrame(key, src, title) {
|
|
48
|
+
ensureFrame(key, src, {
|
|
49
|
+
title,
|
|
50
|
+
sandbox: ARTIFACT_IFRAME_SANDBOX,
|
|
51
|
+
allow: ARTIFACT_FRAME_ALLOW,
|
|
52
|
+
testid: 'artifact-frame',
|
|
53
|
+
referrerPolicy: 'no-referrer',
|
|
54
|
+
});
|
|
55
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An artifact in a chat: what the agent `show`ed when it handed one over. A
|
|
3
|
+
* live preview, its title and type. It is a link: on a session page the web
|
|
4
|
+
* app's link interceptor opens it in the session panel, like a Kortix App. A link
|
|
5
|
+
* the viewer cannot open (no access, flag off) renders `fallback` instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ShowArtifactCard({ url, fallback }: {
|
|
8
|
+
url: string;
|
|
9
|
+
fallback: React.ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* An artifact in the session panel: the page itself (a doc read as its page),
|
|
13
|
+
* with its title, a way to the full viewer (where a doc is edited) and close.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ArtifactPanelPreview({ url, onClose }: {
|
|
16
|
+
url: string;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
}): import("react").JSX.Element;
|