@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,101 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { getPublicArtifact } from '@kortix/sdk';
|
|
4
|
+
import { useArtifact } from '@kortix/sdk/react';
|
|
5
|
+
import { ArrowSquareOut, BrowserIcon, FileTextIcon, X } from '@phosphor-icons/react';
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import { useLocalizedUiCatalog } from '../i18n/ui-catalog/use-localized-ui-catalog.js';
|
|
8
|
+
import { Button } from '../primitives/button.js';
|
|
9
|
+
import Hint from '../primitives/hint.js';
|
|
10
|
+
import { useUiComponents, useUiRouter } from '../providers/ui-provider.js';
|
|
11
|
+
import { ArtifactFrame } from './artifact-frame.js';
|
|
12
|
+
import { artifactFrameKey, parseArtifactUrl } from './frame-policy.js';
|
|
13
|
+
const COPY = {
|
|
14
|
+
open: 'Open',
|
|
15
|
+
openArtifact: 'Open in Artifacts',
|
|
16
|
+
close: 'Close',
|
|
17
|
+
doc: 'Doc',
|
|
18
|
+
page: 'Page',
|
|
19
|
+
unavailable: 'This artifact is not available to you.',
|
|
20
|
+
};
|
|
21
|
+
const TYPE_ICON = { doc: FileTextIcon, html: BrowserIcon };
|
|
22
|
+
/** The artifact a URL names, as the caller may see it: a project artifact, or a public one. */
|
|
23
|
+
function useShownArtifact(url) {
|
|
24
|
+
const ref = parseArtifactUrl(url);
|
|
25
|
+
const inProject = useArtifact(ref?.projectId ?? null, ref?.projectId ? ref.artifactId : null);
|
|
26
|
+
const [shared, setShared] = useState({ artifact: null, failed: false });
|
|
27
|
+
const publicId = ref && !ref.projectId ? ref.artifactId : null;
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!publicId)
|
|
30
|
+
return;
|
|
31
|
+
let live = true;
|
|
32
|
+
getPublicArtifact(publicId)
|
|
33
|
+
.then((a) => {
|
|
34
|
+
if (!live)
|
|
35
|
+
return;
|
|
36
|
+
if (!a)
|
|
37
|
+
return setShared({ artifact: null, failed: true });
|
|
38
|
+
setShared({
|
|
39
|
+
artifact: { title: a.title, type: a.type, src: a.content_url, frameKey: `artifact:${a.artifact_id}:${a.updated_at}`, href: null },
|
|
40
|
+
failed: false,
|
|
41
|
+
});
|
|
42
|
+
})
|
|
43
|
+
.catch(() => live && setShared({ artifact: null, failed: true }));
|
|
44
|
+
return () => {
|
|
45
|
+
live = false;
|
|
46
|
+
};
|
|
47
|
+
}, [publicId]);
|
|
48
|
+
if (!ref)
|
|
49
|
+
return { artifact: null, failed: true };
|
|
50
|
+
if (publicId)
|
|
51
|
+
return shared;
|
|
52
|
+
const detail = inProject.data;
|
|
53
|
+
if (!detail)
|
|
54
|
+
return { artifact: null, failed: inProject.isError };
|
|
55
|
+
return {
|
|
56
|
+
artifact: {
|
|
57
|
+
title: detail.title,
|
|
58
|
+
type: detail.type,
|
|
59
|
+
src: detail.version.view_url,
|
|
60
|
+
frameKey: artifactFrameKey(detail),
|
|
61
|
+
href: `/projects/${detail.project_id}/artifacts/${detail.artifact_id}`,
|
|
62
|
+
},
|
|
63
|
+
failed: false,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* An artifact in a chat: what the agent `show`ed when it handed one over. A
|
|
68
|
+
* live preview, its title and type. It is a link: on a session page the web
|
|
69
|
+
* app's link interceptor opens it in the session panel, like a Kortix App. A link
|
|
70
|
+
* the viewer cannot open (no access, flag off) renders `fallback` instead.
|
|
71
|
+
*/
|
|
72
|
+
export function ShowArtifactCard({ url, fallback }) {
|
|
73
|
+
const copy = useLocalizedUiCatalog(COPY);
|
|
74
|
+
const { artifact, failed } = useShownArtifact(url);
|
|
75
|
+
if (failed)
|
|
76
|
+
return _jsx(_Fragment, { children: fallback });
|
|
77
|
+
const Icon = artifact ? TYPE_ICON[artifact.type] : FileTextIcon;
|
|
78
|
+
return (_jsxs("a", { href: url, target: "_blank", rel: "noopener noreferrer", "data-testid": "show-artifact-card", className: "group border-border bg-card hover:border-foreground/20 flex w-full max-w-xl flex-col overflow-hidden rounded-lg border text-left transition-colors", children: [_jsx("span", { className: "bg-muted relative block aspect-[16/9] w-full overflow-hidden border-b", children: artifact ? (_jsx(ArtifactFrame, { preview: true,
|
|
79
|
+
// Its own frame: the chat card keeps its preview while the panel shows the artifact.
|
|
80
|
+
frameKey: `${artifact.frameKey}:chat`, src: artifact.src, title: artifact.title, className: "pointer-events-none absolute top-0 left-0 h-[400%] w-[400%] origin-top-left scale-25 border-0" })) : null }), _jsxs("span", { className: "flex items-center gap-3 p-3", children: [_jsx("span", { className: "bg-muted flex size-8 shrink-0 items-center justify-center rounded-md", children: _jsx(Icon, { className: "text-muted-foreground size-4" }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm font-medium", children: artifact?.title ?? ' ' }), _jsx("span", { className: "text-muted-foreground block text-xs", children: artifact ? (artifact.type === 'doc' ? copy.doc : copy.page) : ' ' })] }), _jsx("span", { className: "text-muted-foreground group-hover:text-foreground shrink-0 text-xs font-medium transition-colors", children: copy.open })] })] }));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* An artifact in the session panel: the page itself (a doc read as its page),
|
|
84
|
+
* with its title, a way to the full viewer (where a doc is edited) and close.
|
|
85
|
+
*/
|
|
86
|
+
export function ArtifactPanelPreview({ url, onClose }) {
|
|
87
|
+
// The host's full viewer (apps/web: the Artifacts viewer) for a project artifact.
|
|
88
|
+
const { ArtifactViewer } = useUiComponents();
|
|
89
|
+
const ref = parseArtifactUrl(url);
|
|
90
|
+
if (ArtifactViewer && ref?.projectId)
|
|
91
|
+
return _jsx(ArtifactViewer, { projectId: ref.projectId, artifactId: ref.artifactId, onClose: onClose });
|
|
92
|
+
return _jsx(ArtifactPagePreview, { url: url, onClose: onClose });
|
|
93
|
+
}
|
|
94
|
+
/** A public artifact, or a host without the viewer: the page itself, read-only. */
|
|
95
|
+
function ArtifactPagePreview({ url, onClose }) {
|
|
96
|
+
const copy = useLocalizedUiCatalog(COPY);
|
|
97
|
+
const router = useUiRouter();
|
|
98
|
+
const { artifact, failed } = useShownArtifact(url);
|
|
99
|
+
const Icon = artifact ? TYPE_ICON[artifact.type] : FileTextIcon;
|
|
100
|
+
return (_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [_jsxs("div", { className: "flex h-10 shrink-0 items-center gap-2 border-b pr-1 pl-3", children: [_jsx(Icon, { className: "text-muted-foreground size-4 shrink-0", "aria-hidden": true }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate text-sm font-medium", children: artifact?.title ?? '' }), artifact?.href ? (_jsx(Hint, { label: copy.openArtifact, side: "bottom", children: _jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": copy.openArtifact, onClick: () => router.push(artifact.href), children: _jsx(ArrowSquareOut, { className: "size-3.5" }) }) })) : null, _jsx(Hint, { label: copy.close, side: "bottom", children: _jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": copy.close, onClick: onClose, children: _jsx(X, { className: "size-3.5" }) }) })] }), _jsx("div", { className: "bg-muted relative min-h-0 flex-1", children: artifact ? (_jsx(ArtifactFrame, { frameKey: artifact.frameKey, src: artifact.src, title: artifact.title, className: "absolute inset-0 size-full border-0" })) : failed ? (_jsx("p", { className: "text-muted-foreground p-6 text-sm", children: copy.unavailable })) : null })] }));
|
|
101
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iframe sandbox. It allows same-origin; the content server's CSP sandbox
|
|
3
|
+
* decides: an opaque origin on the API host, the page's own origin on the
|
|
4
|
+
* dedicated content host (ARTIFACT_CONTENT_URL), where embedded players work.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ARTIFACT_IFRAME_SANDBOX = "allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads";
|
|
7
|
+
/** Features an embedded player in the page may use. */
|
|
8
|
+
export declare const ARTIFACT_FRAME_ALLOW = "fullscreen; clipboard-write; autoplay; encrypted-media; picture-in-picture";
|
|
9
|
+
/** Artifact frames share the Apps frame pool (`@kortix/ui/apps`); their keys start with this. */
|
|
10
|
+
export declare const ARTIFACT_FRAME_PREFIX = "artifact:";
|
|
11
|
+
/** One pooled frame per artifact state: a save (`updated_at`) or an old version gets its own. */
|
|
12
|
+
export declare function artifactFrameKey(artifact: {
|
|
13
|
+
artifact_id: string;
|
|
14
|
+
updated_at: string;
|
|
15
|
+
}, version?: string | null): string;
|
|
16
|
+
/**
|
|
17
|
+
* Print a doc to PDF without leaving the page: its print view (`?print=1`)
|
|
18
|
+
* loads in a hidden frame and opens the print dialog for that frame alone. The
|
|
19
|
+
* page posts `artifact-printed` after the dialog closes; the frame then goes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function printArtifact(viewUrl: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* The artifact an app link names: `/projects/<project>/artifacts/<artifact>`
|
|
24
|
+
* (the app viewer, on any Kortix host) or `/share/artifact/<artifact>` (a
|
|
25
|
+
* public link, no project). Null for any other URL.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseArtifactUrl(url: string): {
|
|
28
|
+
projectId: string | null;
|
|
29
|
+
artifactId: string;
|
|
30
|
+
} | null;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iframe sandbox. It allows same-origin; the content server's CSP sandbox
|
|
3
|
+
* decides: an opaque origin on the API host, the page's own origin on the
|
|
4
|
+
* dedicated content host (ARTIFACT_CONTENT_URL), where embedded players work.
|
|
5
|
+
*/
|
|
6
|
+
export const ARTIFACT_IFRAME_SANDBOX = 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads';
|
|
7
|
+
/** Features an embedded player in the page may use. */
|
|
8
|
+
export const ARTIFACT_FRAME_ALLOW = 'fullscreen; clipboard-write; autoplay; encrypted-media; picture-in-picture';
|
|
9
|
+
/** Artifact frames share the Apps frame pool (`@kortix/ui/apps`); their keys start with this. */
|
|
10
|
+
export const ARTIFACT_FRAME_PREFIX = 'artifact:';
|
|
11
|
+
/** One pooled frame per artifact state: a save (`updated_at`) or an old version gets its own. */
|
|
12
|
+
export function artifactFrameKey(artifact, version) {
|
|
13
|
+
return `${ARTIFACT_FRAME_PREFIX}${artifact.artifact_id}:${version ?? artifact.updated_at}`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Print a doc to PDF without leaving the page: its print view (`?print=1`)
|
|
17
|
+
* loads in a hidden frame and opens the print dialog for that frame alone. The
|
|
18
|
+
* page posts `artifact-printed` after the dialog closes; the frame then goes.
|
|
19
|
+
*/
|
|
20
|
+
export function printArtifact(viewUrl) {
|
|
21
|
+
const frame = document.createElement('iframe');
|
|
22
|
+
frame.setAttribute('sandbox', ARTIFACT_IFRAME_SANDBOX);
|
|
23
|
+
frame.setAttribute('aria-hidden', 'true');
|
|
24
|
+
frame.tabIndex = -1;
|
|
25
|
+
frame.style.cssText = 'position:fixed;right:0;bottom:0;width:1px;height:1px;border:0;opacity:0;pointer-events:none';
|
|
26
|
+
const cleanup = () => {
|
|
27
|
+
window.removeEventListener('message', onMessage);
|
|
28
|
+
frame.remove();
|
|
29
|
+
};
|
|
30
|
+
const onMessage = (event) => {
|
|
31
|
+
if (event.source === frame.contentWindow && event.data?.kortix === 'artifact-printed')
|
|
32
|
+
cleanup();
|
|
33
|
+
};
|
|
34
|
+
window.addEventListener('message', onMessage);
|
|
35
|
+
// A dialog left open past this still prints; the frame is only cleanup.
|
|
36
|
+
window.setTimeout(cleanup, 10 * 60_000);
|
|
37
|
+
frame.src = `${viewUrl}?print=1`;
|
|
38
|
+
document.body.appendChild(frame);
|
|
39
|
+
}
|
|
40
|
+
const UUID = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
|
|
41
|
+
const IN_PROJECT = new RegExp(`/projects/(${UUID})/artifacts/(${UUID})/?$`, 'i');
|
|
42
|
+
const PUBLIC = new RegExp(`/share/artifact/(${UUID})/?$`, 'i');
|
|
43
|
+
/**
|
|
44
|
+
* The artifact an app link names: `/projects/<project>/artifacts/<artifact>`
|
|
45
|
+
* (the app viewer, on any Kortix host) or `/share/artifact/<artifact>` (a
|
|
46
|
+
* public link, no project). Null for any other URL.
|
|
47
|
+
*/
|
|
48
|
+
export function parseArtifactUrl(url) {
|
|
49
|
+
let path;
|
|
50
|
+
try {
|
|
51
|
+
path = new URL(url, 'http://localhost').pathname;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const inProject = IN_PROJECT.exec(path);
|
|
57
|
+
if (inProject)
|
|
58
|
+
return { projectId: inProject[1].toLowerCase(), artifactId: inProject[2].toLowerCase() };
|
|
59
|
+
const shared = PUBLIC.exec(path);
|
|
60
|
+
return shared ? { projectId: null, artifactId: shared[1].toLowerCase() } : null;
|
|
61
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ARTIFACT_FRAME_ALLOW, ARTIFACT_FRAME_PREFIX, ARTIFACT_IFRAME_SANDBOX, artifactFrameKey, parseArtifactUrl, printArtifact, } from './frame-policy.js';
|
|
2
|
+
export { ArtifactFrame, ensureArtifactFrame } from './artifact-frame.js';
|
|
3
|
+
export { ArtifactPanelPreview, ShowArtifactCard } from './artifact-session.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Kortix Artifacts in any host: the frame policy and link parsing (server-safe),
|
|
2
|
+
// the pooled page frame, and the session views (chat card, panel preview).
|
|
3
|
+
export { ARTIFACT_FRAME_ALLOW, ARTIFACT_FRAME_PREFIX, ARTIFACT_IFRAME_SANDBOX, artifactFrameKey, parseArtifactUrl, printArtifact, } from './frame-policy.js';
|
|
4
|
+
export { ArtifactFrame, ensureArtifactFrame } from './artifact-frame.js';
|
|
5
|
+
export { ArtifactPanelPreview, ShowArtifactCard } from './artifact-session.js';
|
|
@@ -27,7 +27,7 @@ export declare function parseAddressInput(value: string): string | null;
|
|
|
27
27
|
* controls around it (`BrowserPanel`'s overflow menu, `AppPreview`'s viewer
|
|
28
28
|
* actions and close) — the component is a fragment, so it slots between them.
|
|
29
29
|
*/
|
|
30
|
-
export declare function SandboxAddressBar({ displayValue, hasPreview, isLoading, canGoBack, canGoForward, onBack, onForward, onReload, onHome, onNavigate, suggestions, placeholder, ariaLabel, inputRef, resetOnEscape, trailing, }: {
|
|
30
|
+
export declare function SandboxAddressBar({ displayValue, hasPreview, isLoading, canGoBack, canGoForward, onBack, onForward, onReload, onHome, onNavigate, suggestions, placeholder, ariaLabel, inputRef, resetOnEscape, trailing, disabled, }: {
|
|
31
31
|
/** The URL the bar shows at rest — the surface's current address. */
|
|
32
32
|
displayValue: string;
|
|
33
33
|
hasPreview: boolean;
|
|
@@ -58,6 +58,9 @@ export declare function SandboxAddressBar({ displayValue, hasPreview, isLoading,
|
|
|
58
58
|
/** Actions on the open page, rendered at the address's trailing edge —
|
|
59
59
|
* `AppPreview` puts `Copy link` here. */
|
|
60
60
|
trailing?: ReactNode;
|
|
61
|
+
/** The address takes no input (the session's computer is booting). Pair it
|
|
62
|
+
* with `hasPreview={false}`, which disables the buttons. */
|
|
63
|
+
disabled?: boolean;
|
|
61
64
|
}): import("react").JSX.Element;
|
|
62
65
|
/**
|
|
63
66
|
* The "still loading" overlay both preview surfaces paint over the iframe.
|
|
@@ -89,7 +89,7 @@ const NO_SUGGESTIONS = [];
|
|
|
89
89
|
* controls around it (`BrowserPanel`'s overflow menu, `AppPreview`'s viewer
|
|
90
90
|
* actions and close) — the component is a fragment, so it slots between them.
|
|
91
91
|
*/
|
|
92
|
-
export function SandboxAddressBar({ displayValue, hasPreview, isLoading, canGoBack, canGoForward, onBack, onForward, onReload, onHome, onNavigate, suggestions = NO_SUGGESTIONS, placeholder, ariaLabel, inputRef, resetOnEscape = true, trailing, }) {
|
|
92
|
+
export function SandboxAddressBar({ displayValue, hasPreview, isLoading, canGoBack, canGoForward, onBack, onForward, onReload, onHome, onNavigate, suggestions = NO_SUGGESTIONS, placeholder, ariaLabel, inputRef, resetOnEscape = true, trailing, disabled, }) {
|
|
93
93
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
94
94
|
const [addressValue, setAddressValue] = useState(displayValue);
|
|
95
95
|
const [isEditing, setIsEditing] = useState(false);
|
|
@@ -121,7 +121,7 @@ export function SandboxAddressBar({ displayValue, hasPreview, isLoading, canGoBa
|
|
|
121
121
|
onNavigate(internal);
|
|
122
122
|
}, [addressValue, onNavigate, suggestions]);
|
|
123
123
|
const suggestionsId = useId();
|
|
124
|
-
return (_jsxs(_Fragment, { children: [_jsxs(ButtonGroup, { className: "shrink-0", children: [_jsx(Hint, { label: tI18nComplete.raw('text76900f1bfd16'), side: "bottom", children: _jsx(Button, { variant: "secondary", size: "icon", onClick: onBack, disabled: !hasPreview || !canGoBack, children: _jsx(ArrowLeft, { className: "size-4" }) }) }), _jsx(Hint, { label: tI18nComplete.raw('textf1c65e14817e'), side: "bottom", children: _jsx(Button, { variant: "secondary", size: "icon", onClick: onForward, disabled: !hasPreview || !canGoForward, children: _jsx(ArrowRight, { className: "size-4" }) }) })] }), _jsx("form", { onSubmit: handleAddressSubmit, className: "flex min-w-0 flex-1 items-center px-1", children: _jsxs(ButtonGroup, { className: "w-full min-w-0", children: [_jsx(Hint, { label: tI18nComplete.raw('text3a78695388b3'), side: "bottom", children: _jsx(Button, { type: "button", variant: "secondary", size: "icon", onClick: onHome, disabled: !hasPreview, "aria-label": tI18nComplete.raw('text3a78695388b3'), children: _jsx(Home, { className: "size-3.5" }) }) }), _jsxs("div", { className: cn('bg-muted flex h-7 min-w-0 flex-1 items-center gap-1 rounded-md border border-transparent px-2 text-xs tracking-tight transition-colors', addressError && 'border-kortix-red/60 focus-within:border-kortix-red/60 animate-shake'), children: [_jsxs("div", { className: "group/address relative flex h-full min-w-0 flex-1 items-center", children: [_jsx(Input, { ref: inputRef, type: "text", size: "xs", value: urlParts ? displayValue : addressValue, "aria-label": ariaLabel, list: suggestions.length ? suggestionsId : undefined, onChange: (e) => {
|
|
124
|
+
return (_jsxs(_Fragment, { children: [_jsxs(ButtonGroup, { className: "shrink-0", children: [_jsx(Hint, { label: tI18nComplete.raw('text76900f1bfd16'), side: "bottom", children: _jsx(Button, { variant: "secondary", size: "icon", onClick: onBack, disabled: !hasPreview || !canGoBack, children: _jsx(ArrowLeft, { className: "size-4" }) }) }), _jsx(Hint, { label: tI18nComplete.raw('textf1c65e14817e'), side: "bottom", children: _jsx(Button, { variant: "secondary", size: "icon", onClick: onForward, disabled: !hasPreview || !canGoForward, children: _jsx(ArrowRight, { className: "size-4" }) }) })] }), _jsx("form", { onSubmit: handleAddressSubmit, className: "flex min-w-0 flex-1 items-center px-1", children: _jsxs(ButtonGroup, { className: "w-full min-w-0", children: [_jsx(Hint, { label: tI18nComplete.raw('text3a78695388b3'), side: "bottom", children: _jsx(Button, { type: "button", variant: "secondary", size: "icon", onClick: onHome, disabled: !hasPreview, "aria-label": tI18nComplete.raw('text3a78695388b3'), children: _jsx(Home, { className: "size-3.5" }) }) }), _jsxs("div", { className: cn('bg-muted flex h-7 min-w-0 flex-1 items-center gap-1 rounded-md border border-transparent px-2 text-xs tracking-tight transition-colors', addressError && 'border-kortix-red/60 focus-within:border-kortix-red/60 animate-shake'), children: [_jsxs("div", { className: "group/address relative flex h-full min-w-0 flex-1 items-center", children: [_jsx(Input, { ref: inputRef, type: "text", size: "xs", disabled: disabled, value: urlParts ? displayValue : addressValue, "aria-label": ariaLabel, list: suggestions.length ? suggestionsId : undefined, onChange: (e) => {
|
|
125
125
|
setAddressValue(e.target.value);
|
|
126
126
|
if (addressError)
|
|
127
127
|
setAddressError(false);
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { AgentDraft } from '../sections/view/agent-editor.js';
|
|
2
2
|
import { type ProjectConfigSummary } from '@kortix/sdk';
|
|
3
|
+
import { type PolicySetOption } from './agent-policy-sets.js';
|
|
3
4
|
export declare function SkillsGrantPage({ projectId, config, editor, }: {
|
|
4
5
|
projectId: string;
|
|
5
6
|
config: ProjectConfigSummary;
|
|
6
7
|
editor: AgentDraft;
|
|
7
8
|
}): import("react").JSX.Element;
|
|
8
|
-
export declare function ConnectorsGrantPage({ projectId, editor, }: {
|
|
9
|
+
export declare function ConnectorsGrantPage({ projectId, editor, policySetOptions, }: {
|
|
9
10
|
projectId: string;
|
|
10
11
|
editor: AgentDraft;
|
|
12
|
+
/** Each connector's policy sets (`connectorPolicySetOptions`), read from the
|
|
13
|
+
* manifest the page already holds. */
|
|
14
|
+
policySetOptions?: Record<string, PolicySetOption[]>;
|
|
11
15
|
}): import("react").JSX.Element;
|
|
12
16
|
export declare function SecretsGrantPage({ projectId, editor }: {
|
|
13
17
|
projectId: string;
|
|
@@ -15,11 +15,15 @@ import { useTranslations as useI18nTranslations } from '../../i18n/index.js';
|
|
|
15
15
|
import { Badge } from '../../primitives/badge.js';
|
|
16
16
|
import { Button } from '../../primitives/button.js';
|
|
17
17
|
import { Checkbox } from '../../primitives/checkbox.js';
|
|
18
|
+
import Hint from '../../primitives/hint.js';
|
|
19
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../primitives/select.js';
|
|
18
20
|
import { Skeleton } from '../../primitives/skeleton.js';
|
|
19
21
|
import { EmptyState } from '../../primitives/empty-state.js';
|
|
20
22
|
import { ErrorState } from '../../primitives/error-state.js';
|
|
21
23
|
import { connectorDisplayName } from '../connectors/connector-filter.js';
|
|
22
|
-
import {
|
|
24
|
+
import { ConnectorStatusBadge } from '../connectors/connector-identity.js';
|
|
25
|
+
import { ConnectorLogo } from '../../internal/connector-logo/connector-logo.js';
|
|
26
|
+
import { installedConnectorLogoSource } from '../../internal/connector-logo/connector-logo-source.js';
|
|
23
27
|
import { ConnectorModal } from '../connectors/detail/connector-modal.js';
|
|
24
28
|
import { providerLabel } from '../connectors/provider-label.js';
|
|
25
29
|
import { detailSelection } from '../shared/detail-selection.js';
|
|
@@ -38,6 +42,7 @@ import { PlusIcon } from '@phosphor-icons/react';
|
|
|
38
42
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
39
43
|
import { useState } from 'react';
|
|
40
44
|
import { appGrantRows } from './agent-apps-grant.js';
|
|
45
|
+
import { policySetRows, withPolicySet, } from './agent-policy-sets.js';
|
|
41
46
|
/**
|
|
42
47
|
* All · Pick · None over the project's catalog, as one bordered list. The
|
|
43
48
|
* checkbox exists only in Pick mode, where it is the control; in All and
|
|
@@ -97,7 +102,28 @@ export function SkillsGrantPage({ projectId, config, editor, }) {
|
|
|
97
102
|
} })] }));
|
|
98
103
|
}
|
|
99
104
|
// ─── Connectors ──────────────────────────────────────────────────────────
|
|
100
|
-
|
|
105
|
+
const BASE_SET_VALUE = '__base';
|
|
106
|
+
/**
|
|
107
|
+
* Which rule set the agent gets on each granted connector that defines sets
|
|
108
|
+
* (`agents.<a>.policy_sets`). One list for Pick and All alike: under All the
|
|
109
|
+
* catalog has no per-row controls, and a second rendering for that mode would
|
|
110
|
+
* be two places to set one value. Choosing a set needs connector write as well
|
|
111
|
+
* as agent write (the API checks both), so a viewer without it sees the
|
|
112
|
+
* values but cannot change them.
|
|
113
|
+
*/
|
|
114
|
+
function AgentPolicySetsSection({ editor, catalog, connectors, canWrite, }) {
|
|
115
|
+
const t = useI18nTranslations('connectorPolicySets');
|
|
116
|
+
const { draft, set } = editor;
|
|
117
|
+
const rows = policySetRows(draft.connectors, catalog, draft.policy_sets, connectors.map((connector) => connector.slug));
|
|
118
|
+
if (rows.length === 0)
|
|
119
|
+
return null;
|
|
120
|
+
return (_jsx(EditorSection, { title: t('agentSection'), bare: true, children: _jsx(EditorList, { children: rows.map((row) => {
|
|
121
|
+
const connector = connectors.find((candidate) => candidate.slug === row.slug);
|
|
122
|
+
const name = connector ? connectorDisplayName(connector) : row.slug;
|
|
123
|
+
return (_jsxs("li", { className: "flex min-h-13 items-center gap-3 px-4 py-2", children: [connector ? (_jsx(ConnectorLogo, { source: installedConnectorLogoSource(connector), size: "sm" })) : null, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm font-medium", children: name }), _jsx("span", { className: "text-muted-foreground block truncate font-mono text-xs", children: row.slug })] }), row.missing && row.value ? (_jsx(Hint, { label: t('agentMissingHint', { name: row.value }), children: _jsx(Badge, { variant: "destructive", size: "xs", children: t('agentMissing') }) })) : null, _jsxs(Select, { value: row.value ?? BASE_SET_VALUE, disabled: !canWrite, onValueChange: (next) => set('policy_sets', withPolicySet(draft.policy_sets, row.slug, next === BASE_SET_VALUE ? null : next)), children: [_jsx(SelectTrigger, { size: "sm", className: "w-40 shrink-0", "aria-label": t('agentSelectLabel', { name }), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { align: "end", children: [_jsx(SelectItem, { value: BASE_SET_VALUE, children: t('baseRules') }), row.options.map((option) => (_jsx(SelectItem, { value: option.name, description: option.description, children: _jsx("span", { className: "font-mono", children: option.name }) }, option.name))), row.missing && row.value ? (_jsx(SelectItem, { value: row.value, children: _jsx("span", { className: "font-mono", children: row.value }) })) : null] })] })] }, row.slug));
|
|
124
|
+
}) }) }));
|
|
125
|
+
}
|
|
126
|
+
export function ConnectorsGrantPage({ projectId, editor, policySetOptions, }) {
|
|
101
127
|
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
102
128
|
const queryClient = useQueryClient();
|
|
103
129
|
const accountId = useProjectAccountId(projectId);
|
|
@@ -131,7 +157,7 @@ export function ConnectorsGrantPage({ projectId, editor, }) {
|
|
|
131
157
|
}
|
|
132
158
|
}, isLoading: connectorsQuery.isLoading, isError: connectorsQuery.isError, onRetry: () => void connectorsQuery.refetch(), items: connectors.map((connector) => ({
|
|
133
159
|
id: connector.slug,
|
|
134
|
-
leading: _jsx(
|
|
160
|
+
leading: _jsx(ConnectorLogo, { source: installedConnectorLogoSource(connector), size: "sm" }),
|
|
135
161
|
title: connectorDisplayName(connector),
|
|
136
162
|
description: `${providerLabel(connector.provider)} · ${connector.actions.length} ${connector.actions.length === 1 ? 'action' : 'actions'}`,
|
|
137
163
|
status: _jsx(ConnectorStatusBadge, { connector: connector }),
|
|
@@ -142,7 +168,7 @@ export function ConnectorsGrantPage({ projectId, editor, }) {
|
|
|
142
168
|
? current.filter((a) => a !== slug)
|
|
143
169
|
: [...current, slug];
|
|
144
170
|
set('connectors_required', next.length ? next : undefined);
|
|
145
|
-
} })), empty: _jsx(EmptyState, { size: "sm", title: tI18nComplete.raw('text51ae0a7e3783'), description: tI18nComplete.raw('text9bf8fe539046') }) }), draft.connectors === 'all' && draft.connectors_required?.length ? (_jsxs("p", { className: "text-muted-foreground text-xs", children: [tI18nComplete.raw('textf39fe0fefce2'), ' ', _jsx("span", { className: "font-mono", children: draft.connectors_required.join(', ') }), tI18nComplete.raw('text954401fb96d1')] })) : null] }) }), _jsx(ConnectorModal, { projectId: projectId, connector: detail.record, canWrite: canWrite, open: detail.open, isResolving: detail.isResolving, onOpenChange: (open) => !open && setDetailSlug(null), onChanged: invalidate, onRemoved: () => {
|
|
171
|
+
} })), empty: _jsx(EmptyState, { size: "sm", title: tI18nComplete.raw('text51ae0a7e3783'), description: tI18nComplete.raw('text9bf8fe539046') }) }), draft.connectors === 'all' && draft.connectors_required?.length ? (_jsxs("p", { className: "text-muted-foreground text-xs", children: [tI18nComplete.raw('textf39fe0fefce2'), ' ', _jsx("span", { className: "font-mono", children: draft.connectors_required.join(', ') }), tI18nComplete.raw('text954401fb96d1')] })) : null] }) }), _jsx(AgentPolicySetsSection, { editor: editor, catalog: policySetOptions ?? {}, connectors: connectors, canWrite: canWrite }), _jsx(ConnectorModal, { projectId: projectId, connector: detail.record, canWrite: canWrite, open: detail.open, isResolving: detail.isResolving, onOpenChange: (open) => !open && setDetailSlug(null), onChanged: invalidate, onRemoved: () => {
|
|
146
172
|
invalidate();
|
|
147
173
|
setDetailSlug(null);
|
|
148
174
|
} })] }));
|
|
@@ -93,6 +93,7 @@ import { AgentDrivesSection } from './agent-drives-section.js';
|
|
|
93
93
|
import { AgentAuthorityCard } from './agent-authority-card.js';
|
|
94
94
|
import { AgentModel, AgentScope } from './agent-detail-aside.js';
|
|
95
95
|
import { AppsGrantPage, ConnectorsGrantPage, SecretsGrantPage, SkillsGrantPage, } from './agent-grant-pages.js';
|
|
96
|
+
import { connectorPolicySetOptions } from './agent-policy-sets.js';
|
|
96
97
|
import { AgentPeopleSection } from './agent-people-section.js';
|
|
97
98
|
import { AgentShareControl } from './agent-share-control.js';
|
|
98
99
|
import { AgentTriggersSection } from './agent-triggers-section.js';
|
|
@@ -290,6 +291,7 @@ function EditableAgentPage({ projectId, agent, config, initial, schemaVersion, }
|
|
|
290
291
|
const drivesOn = useFeatureFlag(projectId, 'drives').enabled;
|
|
291
292
|
const sections = useMemo(() => agentConfigSectionKeys(schemaVersion).filter((k) => drivesOn || k !== 'drives'), [schemaVersion, drivesOn]);
|
|
292
293
|
const registryOptions = useMemo(() => registryGrantOptions({ manifest_raw: config.manifest_raw, agents: toArray(config.agents) }, agent.name), [config.manifest_raw, config.agents, agent.name]);
|
|
294
|
+
const policySetOptions = useMemo(() => connectorPolicySetOptions(config.manifest_raw), [config.manifest_raw]);
|
|
293
295
|
const section = useAgentSection(sections);
|
|
294
296
|
const onSave = useCallback(async () => {
|
|
295
297
|
if (!editor.isDirty || update.isPending)
|
|
@@ -308,7 +310,7 @@ function EditableAgentPage({ projectId, agent, config, initial, schemaVersion, }
|
|
|
308
310
|
// shared across topics and nothing is lost.
|
|
309
311
|
const leaveGuard = useUnsavedChangesGuard(editor.isDirty, pathname);
|
|
310
312
|
useSaveShortcut(onSave);
|
|
311
|
-
return (_jsx(AgentPageFrame, { header: _jsx(AgentHeader, { projectId: projectId, agent: agent, config: config, canWrite: true }), section: section, sections: sections, sectionHref: sectionHrefFor(pathname), pane: _jsx(AgentConfigSections, { section: section, editor: editor, options: options, skillsOptions: skillsOptions, registryOptions: registryOptions, skills: _jsx(SkillsGrantPage, { projectId: projectId, config: config, editor: editor }), connectors: _jsx(ConnectorsGrantPage, { projectId: projectId, editor: editor }), secrets: _jsx(SecretsGrantPage, { projectId: projectId, editor: editor }), apps: _jsx(AppsGrantPage, { projectId: projectId, editor: editor }), drives: _jsx(AgentDrivesSection, { projectId: projectId, agentName: agent.name }), overview: _jsx(OverviewPane, { description: editor.oc.description ?? '', onDescriptionChange: (next) => editor.setOc('description', next), descriptionHelp: editor.oc.mode === 'subagent'
|
|
313
|
+
return (_jsx(AgentPageFrame, { header: _jsx(AgentHeader, { projectId: projectId, agent: agent, config: config, canWrite: true }), section: section, sections: sections, sectionHref: sectionHrefFor(pathname), pane: _jsx(AgentConfigSections, { section: section, editor: editor, options: options, skillsOptions: skillsOptions, registryOptions: registryOptions, skills: _jsx(SkillsGrantPage, { projectId: projectId, config: config, editor: editor }), connectors: _jsx(ConnectorsGrantPage, { projectId: projectId, editor: editor, policySetOptions: policySetOptions }), secrets: _jsx(SecretsGrantPage, { projectId: projectId, editor: editor }), apps: _jsx(AppsGrantPage, { projectId: projectId, editor: editor }), drives: _jsx(AgentDrivesSection, { projectId: projectId, agentName: agent.name }), overview: _jsx(OverviewPane, { description: editor.oc.description ?? '', onDescriptionChange: (next) => editor.setOc('description', next), descriptionHelp: editor.oc.mode === 'subagent'
|
|
312
314
|
? 'Required. This is how other agents decide to call it.'
|
|
313
315
|
: 'One line on what this agent is for. Other agents read it when picking a subagent.', prompt: editor.oc.prompt ?? '', onPromptChange: (next) => editor.setOc('prompt', next) }), triggers: _jsx(AgentTriggersSection, { projectId: projectId, agentName: agent.name, defaultAgent: config.default_agent ?? config.open_code_default_agent }), people: _jsx(AgentPeopleSection, { projectId: projectId, agentName: agent.name }), authority: _jsx(AgentAuthorityCard, { projectId: projectId, agentName: agent.name, grant: editor.draft.kortix_permissions ?? editor.draft.kortix_cli }) }), footer: _jsxs(_Fragment, { children: [_jsx(SaveBar, { dirty: editor.isDirty, pending: update.isPending, onDiscard: () => setConfirmDiscard(true), onSave: onSave }), _jsx(ConfirmDialog, { open: confirmDiscard, onOpenChange: setConfirmDiscard, title: tI18nComplete.raw('text3b13192b9d88'), description: tI18nComplete('text8a36cce34f68', { value0: capitalizeWords(agent.name) }), confirmLabel: tI18nComplete.raw('texteb1a70e39274'), cancelLabel: tI18nComplete.raw('texte76fd2add010'), confirmVariant: "destructive", onConfirm: () => {
|
|
314
316
|
setConfirmDiscard(false);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AgentGrantSetV2 } from '@kortix/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The agent side of connector policy sets: `agents.<a>.policy_sets` maps a
|
|
4
|
+
* connector slug to one of that connector's sets (`connectors[].policy_sets`).
|
|
5
|
+
* An absent key means the base rules.
|
|
6
|
+
*/
|
|
7
|
+
export interface PolicySetOption {
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Every connector's set names, read from the root kortix.yaml. The agent page
|
|
13
|
+
* already holds the raw manifest, so the editor needs no request per connector.
|
|
14
|
+
* ponytail: connectors declared in an `imports:` file are not read; an agent
|
|
15
|
+
* that names a set on one still shows its value, flagged as missing.
|
|
16
|
+
*/
|
|
17
|
+
export declare function connectorPolicySetOptions(manifestRaw: string | null | undefined): Record<string, PolicySetOption[]>;
|
|
18
|
+
/**
|
|
19
|
+
* One connector's set choice; `null` (or `base`) clears it. Clearing the last
|
|
20
|
+
* entry returns `{}`, never `undefined`: the config PUT keeps the declared
|
|
21
|
+
* `policy_sets` when the key is omitted, so `{}` is what removes it.
|
|
22
|
+
*
|
|
23
|
+
* Entries on connectors the agent no longer holds are kept on purpose: they
|
|
24
|
+
* are inert until the connector is granted again, and dropping one is a set
|
|
25
|
+
* change that needs project.connector.write.
|
|
26
|
+
*/
|
|
27
|
+
export declare function withPolicySet(policySets: Record<string, string> | undefined, slug: string, name: string | null): Record<string, string>;
|
|
28
|
+
export interface PolicySetRow {
|
|
29
|
+
slug: string;
|
|
30
|
+
options: PolicySetOption[];
|
|
31
|
+
/** The set the agent names, or null for the base rules. */
|
|
32
|
+
value: string | null;
|
|
33
|
+
/** The agent names a set the connector does not define: calls are blocked. */
|
|
34
|
+
missing: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The rows of the agent's "Rule sets" list: every granted connector that
|
|
38
|
+
* defines at least one set, plus every connector the agent already names a set
|
|
39
|
+
* on (so a stale entry is visible and can be cleared).
|
|
40
|
+
*/
|
|
41
|
+
export declare function policySetRows(grant: AgentGrantSetV2 | undefined, catalog: Record<string, PolicySetOption[]>, policySets: Record<string, string> | undefined,
|
|
42
|
+
/** Slugs of the project's connectors, in display order. */
|
|
43
|
+
connectorSlugs: readonly string[]): PolicySetRow[];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { parseManifestText } from '../../_vendor/kortix-shared.js';
|
|
2
|
+
/**
|
|
3
|
+
* Every connector's set names, read from the root kortix.yaml. The agent page
|
|
4
|
+
* already holds the raw manifest, so the editor needs no request per connector.
|
|
5
|
+
* ponytail: connectors declared in an `imports:` file are not read; an agent
|
|
6
|
+
* that names a set on one still shows its value, flagged as missing.
|
|
7
|
+
*/
|
|
8
|
+
export function connectorPolicySetOptions(manifestRaw) {
|
|
9
|
+
let manifest = {};
|
|
10
|
+
try {
|
|
11
|
+
manifest = manifestRaw ? parseManifestText(manifestRaw, 'yaml') : {};
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
const out = Object.create(null);
|
|
17
|
+
const connectors = Array.isArray(manifest.connectors) ? manifest.connectors : [];
|
|
18
|
+
for (const entry of connectors) {
|
|
19
|
+
if (!entry || typeof entry !== 'object')
|
|
20
|
+
continue;
|
|
21
|
+
const { slug, policy_sets: sets } = entry;
|
|
22
|
+
if (typeof slug !== 'string' || !sets || typeof sets !== 'object' || Array.isArray(sets))
|
|
23
|
+
continue;
|
|
24
|
+
const options = Object.entries(sets).map(([name, set]) => {
|
|
25
|
+
const description = set?.description;
|
|
26
|
+
return typeof description === 'string' && description ? { name, description } : { name };
|
|
27
|
+
});
|
|
28
|
+
if (options.length > 0)
|
|
29
|
+
out[slug] = options;
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One connector's set choice; `null` (or `base`) clears it. Clearing the last
|
|
35
|
+
* entry returns `{}`, never `undefined`: the config PUT keeps the declared
|
|
36
|
+
* `policy_sets` when the key is omitted, so `{}` is what removes it.
|
|
37
|
+
*
|
|
38
|
+
* Entries on connectors the agent no longer holds are kept on purpose: they
|
|
39
|
+
* are inert until the connector is granted again, and dropping one is a set
|
|
40
|
+
* change that needs project.connector.write.
|
|
41
|
+
*/
|
|
42
|
+
export function withPolicySet(policySets, slug, name) {
|
|
43
|
+
const next = Object.fromEntries(Object.entries(policySets ?? {}).filter(([key]) => key !== slug));
|
|
44
|
+
if (name && name !== 'base')
|
|
45
|
+
next[slug] = name;
|
|
46
|
+
return next;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The rows of the agent's "Rule sets" list: every granted connector that
|
|
50
|
+
* defines at least one set, plus every connector the agent already names a set
|
|
51
|
+
* on (so a stale entry is visible and can be cleared).
|
|
52
|
+
*/
|
|
53
|
+
export function policySetRows(grant, catalog, policySets,
|
|
54
|
+
/** Slugs of the project's connectors, in display order. */
|
|
55
|
+
connectorSlugs) {
|
|
56
|
+
const granted = (slug) => grant === 'all' || (Array.isArray(grant) && grant.includes(slug));
|
|
57
|
+
const assigned = policySets ?? {};
|
|
58
|
+
const slugs = [
|
|
59
|
+
...connectorSlugs.filter((slug) => granted(slug) && (catalog[slug]?.length || Object.hasOwn(assigned, slug))),
|
|
60
|
+
...Object.keys(assigned).filter((slug) => !connectorSlugs.includes(slug)),
|
|
61
|
+
];
|
|
62
|
+
return slugs.map((slug) => {
|
|
63
|
+
const options = catalog[slug] ?? [];
|
|
64
|
+
const value = Object.hasOwn(assigned, slug) ? (assigned[slug] ?? null) : null;
|
|
65
|
+
return {
|
|
66
|
+
slug,
|
|
67
|
+
options,
|
|
68
|
+
value,
|
|
69
|
+
missing: value !== null && !options.some((option) => option.name === value),
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
@@ -34,7 +34,7 @@ import { useProjectFeatureFlags } from '../../internal/lib/use-project-feature-f
|
|
|
34
34
|
import { cn } from '../../internal/lib/utils.js';
|
|
35
35
|
import { listProjectTriggers } from '@kortix/sdk';
|
|
36
36
|
import { contract, qk } from '@kortix/sdk/react';
|
|
37
|
-
import { LightningIcon, PlusIcon, PulseIcon, TimerIcon, WebhooksLogoIcon, } from '@phosphor-icons/react';
|
|
37
|
+
import { AppWindowIcon, LightningIcon, PlusIcon, PulseIcon, TimerIcon, WebhooksLogoIcon, } from '@phosphor-icons/react';
|
|
38
38
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
39
39
|
import { useCallback, useMemo, useState } from 'react';
|
|
40
40
|
const KIND_ICON = {
|
|
@@ -42,6 +42,7 @@ const KIND_ICON = {
|
|
|
42
42
|
webhook: WebhooksLogoIcon,
|
|
43
43
|
monitor: PulseIcon,
|
|
44
44
|
event: LightningIcon,
|
|
45
|
+
app: AppWindowIcon,
|
|
45
46
|
};
|
|
46
47
|
/**
|
|
47
48
|
* Whether `trigger` starts `agentName`. A trigger that names no agent is
|
|
@@ -6,11 +6,16 @@ import type { McpServerApp } from '../install/mcp-first.js';
|
|
|
6
6
|
* provider's consent page. It replaced eight steps through the custom
|
|
7
7
|
* connector form, Sign in and Add account.
|
|
8
8
|
*/
|
|
9
|
-
export declare function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs, onAdded, app, }: {
|
|
9
|
+
export declare function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs, onAdded, app, initial, }: {
|
|
10
10
|
projectId: string;
|
|
11
11
|
/** A catalogue app's own MCP server: the URL is filled in and the dialog
|
|
12
12
|
* is titled for the app. Null for a server the user pastes. */
|
|
13
13
|
app?: McpServerApp | null;
|
|
14
|
+
/** A pasted server prefilled from a link (an agent's `setup_url`): a person confirms it here. */
|
|
15
|
+
initial?: {
|
|
16
|
+
url: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
} | null;
|
|
14
19
|
open: boolean;
|
|
15
20
|
onOpenChange: (open: boolean) => void;
|
|
16
21
|
/** Slugs of the project's connectors: a new server never reuses one. */
|
|
@@ -28,7 +28,7 @@ const NO_PICKS = { memberIds: [], groupIds: [], agentIds: [] };
|
|
|
28
28
|
* provider's consent page. It replaced eight steps through the custom
|
|
29
29
|
* connector form, Sign in and Add account.
|
|
30
30
|
*/
|
|
31
|
-
export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs, onAdded, app = null, }) {
|
|
31
|
+
export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs, onAdded, app = null, initial = null, }) {
|
|
32
32
|
const t = useTranslations('connectorPages');
|
|
33
33
|
const tSharing = useTranslations('accessSharing');
|
|
34
34
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -46,7 +46,7 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
|
|
|
46
46
|
const everyoneLabel = projectName
|
|
47
47
|
? tSharing('everyone', { project: projectName })
|
|
48
48
|
: tSharing('visibilityEveryone');
|
|
49
|
-
const [url, setUrl] = useState(app?.url ?? '');
|
|
49
|
+
const [url, setUrl] = useState(app?.url ?? initial?.url ?? '');
|
|
50
50
|
const [audience, setAudience] = useState({ audience: 'private', picked: NO_PICKS });
|
|
51
51
|
// The catalogue app's own server, unchanged: named after the app, and its
|
|
52
52
|
// sign-in is known to be one click (`mcpServerFor`).
|
|
@@ -57,10 +57,14 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
|
|
|
57
57
|
? mcpAppIdentity(app.name, takenSlugs)
|
|
58
58
|
: mcpServerIdentity(url, takenSlugs);
|
|
59
59
|
const urlInvalid = url.trim() !== '' && identity === null;
|
|
60
|
+
// The profile's name: proposed from the app or the URL until the user edits it.
|
|
61
|
+
const [nameEdit, setNameEdit] = useState(initial?.name ?? null);
|
|
62
|
+
const name = (nameEdit ?? identity?.name ?? '').trim();
|
|
60
63
|
const add = useMutation({
|
|
61
64
|
mutationFn: () => addMcpServer(projectId, {
|
|
62
65
|
url,
|
|
63
|
-
...(
|
|
66
|
+
...(name ? { appName: name } : {}),
|
|
67
|
+
...(appServer ? { signIn: true } : {}),
|
|
64
68
|
audience: audience.audience,
|
|
65
69
|
grantees: newAccountGrantees(audience.picked),
|
|
66
70
|
takenSlugs,
|
|
@@ -94,6 +98,7 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
|
|
|
94
98
|
audience.picked.groupIds.length +
|
|
95
99
|
(audience.picked.agentIds?.length ?? 0);
|
|
96
100
|
const canSubmit = identity !== null &&
|
|
101
|
+
/[a-z0-9]/i.test(name) &&
|
|
97
102
|
!add.isPending &&
|
|
98
103
|
(audience.audience === 'private' ||
|
|
99
104
|
(canManageConnections && (audience.audience === 'project' || (Boolean(accountId) && picks > 0))));
|
|
@@ -103,6 +108,7 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
|
|
|
103
108
|
onOpenChange(next);
|
|
104
109
|
if (!next) {
|
|
105
110
|
setUrl(app?.url ?? '');
|
|
111
|
+
setNameEdit(null);
|
|
106
112
|
setAudience({ audience: 'private', picked: NO_PICKS });
|
|
107
113
|
}
|
|
108
114
|
};
|
|
@@ -110,5 +116,5 @@ export function AddMcpServerDialog({ projectId, open, onOpenChange, takenSlugs,
|
|
|
110
116
|
event.preventDefault();
|
|
111
117
|
if (canSubmit)
|
|
112
118
|
add.mutate();
|
|
113
|
-
}, children: [_jsxs(ModalBody, { className: "max-h-[60vh] space-y-4 overflow-y-auto", children: [_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-url`, children: t('addMcpUrlLabel') }), _jsx(Input, { id: `${id}-url`, type: "url", inputMode: "url", autoComplete: "off", spellCheck: false, value: url, onChange: (event) => setUrl(event.target.value), placeholder: "https://mcp.example.com/mcp", "aria-invalid": urlInvalid || undefined, disabled: add.isPending, autoFocus: !app }), urlInvalid ? (_jsx(FieldDescription, { className: "text-destructive", role: "alert", children: t('addMcpUrlInvalid') })) : (_jsx(FieldDescription, { children:
|
|
119
|
+
}, children: [_jsxs(ModalBody, { className: "max-h-[60vh] space-y-4 overflow-y-auto", children: [app ? null : (_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-url`, children: t('addMcpUrlLabel') }), _jsx(Input, { id: `${id}-url`, type: "url", inputMode: "url", autoComplete: "off", spellCheck: false, value: url, onChange: (event) => setUrl(event.target.value), placeholder: "https://mcp.example.com/mcp", "aria-invalid": urlInvalid || undefined, disabled: add.isPending, autoFocus: !app }), urlInvalid ? (_jsx(FieldDescription, { className: "text-destructive", role: "alert", children: t('addMcpUrlInvalid') })) : (_jsx(FieldDescription, { children: t('addMcpUrlHint') }))] })), app && nameEdit === null ? null : (_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: `${id}-name`, children: t('installNameLabel') }), _jsx(Input, { id: `${id}-name`, value: nameEdit ?? identity?.name ?? '', onChange: (event) => setNameEdit(event.target.value), autoComplete: "off", disabled: add.isPending || identity === null }), _jsx(FieldDescription, { children: t('installProfileHint') })] })), _jsx(AudienceFields, { projectId: projectId, value: audience, onChange: setAudience, canShare: canManageConnections, accountId: accountId, everyoneLabel: everyoneLabel, shareRequiresLabel: tSharing('shareRequiresManage'), disabled: add.isPending })] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [app && nameEdit === null ? (_jsx(Button, { type: "button", variant: "text", size: "sm", className: "px-0", onClick: () => setNameEdit(identity?.name ?? app.name), disabled: add.isPending, children: t('installRename') })) : null, _jsx(Button, { type: "button", variant: "outline-ghost", className: app && nameEdit === null ? 'sm:ml-auto' : undefined, onClick: () => close(false), disabled: add.isPending, children: tI18nComplete.raw('text19766ed6ccb2') }), _jsxs(Button, { type: "submit", disabled: !canSubmit, children: [add.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, t('addMcpConnect')] })] })] })] }) }));
|
|
114
120
|
}
|