@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,16 @@
|
|
|
1
|
+
const LABELS = {
|
|
2
|
+
mcp: 'MCP',
|
|
3
|
+
composio: 'Composio',
|
|
4
|
+
kortix: 'Kortix',
|
|
5
|
+
pipedream: 'Pipedream',
|
|
6
|
+
openapi: 'REST API',
|
|
7
|
+
graphql: 'GraphQL',
|
|
8
|
+
postman: 'Postman',
|
|
9
|
+
http: 'HTTP API',
|
|
10
|
+
// Kept for the SDK type: the catalogue no longer lists CLIs.
|
|
11
|
+
cli: 'CLI',
|
|
12
|
+
};
|
|
13
|
+
/** The badge a way to connect carries everywhere: cards, the app page, Install. */
|
|
14
|
+
export function wayKindLabel(kind) {
|
|
15
|
+
return LABELS[kind] ?? kind.toUpperCase();
|
|
16
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AdminConnector } from '@kortix/sdk';
|
|
2
2
|
/**
|
|
3
|
-
* Forward-facing provider label
|
|
3
|
+
* Forward-facing provider label. A managed connector names its partner
|
|
4
|
+
* (Composio, Pipedream): it is never just an "App".
|
|
4
5
|
*
|
|
5
6
|
* Lives here, in the connectors feature folder, rather than in
|
|
6
7
|
* `customize/sections/connectors-view.tsx` where it started. That module is
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Forward-facing provider label
|
|
2
|
+
* Forward-facing provider label. A managed connector names its partner
|
|
3
|
+
* (Composio, Pipedream): it is never just an "App".
|
|
3
4
|
*
|
|
4
5
|
* Lives here, in the connectors feature folder, rather than in
|
|
5
6
|
* `customize/sections/connectors-view.tsx` where it started. That module is
|
|
@@ -13,14 +14,23 @@
|
|
|
13
14
|
* deliberate: when `connectors-view.tsx` is retired, this module does not move.
|
|
14
15
|
*/
|
|
15
16
|
export function providerLabel(p) {
|
|
16
|
-
if (
|
|
17
|
-
return '
|
|
17
|
+
if (p === 'composio')
|
|
18
|
+
return 'Composio';
|
|
19
|
+
if (p === 'pipedream')
|
|
20
|
+
return 'Pipedream';
|
|
18
21
|
if (p === 'channel')
|
|
19
22
|
return 'Channel';
|
|
20
23
|
if (p === 'computer')
|
|
21
24
|
return 'Computer';
|
|
22
25
|
if (p === 'postman')
|
|
23
26
|
return 'Postman';
|
|
27
|
+
// The catalogue's words for the same ways in (`install/way-kind.ts`).
|
|
28
|
+
if (p === 'openapi')
|
|
29
|
+
return 'REST API';
|
|
30
|
+
if (p === 'graphql')
|
|
31
|
+
return 'GraphQL';
|
|
32
|
+
if (p === 'http')
|
|
33
|
+
return 'HTTP API';
|
|
24
34
|
return p.toUpperCase();
|
|
25
35
|
}
|
|
26
36
|
/** Providers whose accounts are authorized through the normalized Connect Link gateway. */
|
|
@@ -5,6 +5,10 @@ export interface PatternDraftRow {
|
|
|
5
5
|
id: string;
|
|
6
6
|
match: string;
|
|
7
7
|
action: ConnectorPolicyAction;
|
|
8
|
+
/** Argument conditions authored in kortix.yaml. The editor has no control
|
|
9
|
+
* for them, so they ride along untouched: dropping them on save would turn
|
|
10
|
+
* a conditional rule into an unconditional one. */
|
|
11
|
+
conditions?: ConnectorPolicyRule['conditions'];
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* A content signature for a set of pattern rules, immune to the one reordering
|
|
@@ -26,12 +26,17 @@ import { orderPolicyRules } from './tool-policy.js';
|
|
|
26
26
|
*/
|
|
27
27
|
export function signPatternRules(rules) {
|
|
28
28
|
return orderPolicyRules(rules)
|
|
29
|
-
.map((rule) => `${rule.match}=${rule.action}`)
|
|
29
|
+
.map((rule) => `${rule.match}=${rule.action}${rule.conditions?.length ? JSON.stringify(rule.conditions) : ''}`)
|
|
30
30
|
.join('\n');
|
|
31
31
|
}
|
|
32
32
|
/** The draft rows a rule set seeds, in the order the rules arrived. */
|
|
33
33
|
export function seedPatternDraft(rules, nextId) {
|
|
34
|
-
return rules.map((rule) => ({
|
|
34
|
+
return rules.map((rule) => ({
|
|
35
|
+
id: nextId(),
|
|
36
|
+
match: rule.match,
|
|
37
|
+
action: rule.action,
|
|
38
|
+
...(rule.conditions?.length ? { conditions: rule.conditions } : {}),
|
|
39
|
+
}));
|
|
35
40
|
}
|
|
36
41
|
/** The wire form of a draft: blank rows dropped, every match trimmed, `id`
|
|
37
42
|
* gone. Shared by the dirty check and the save, so the two can never disagree
|
|
@@ -39,5 +44,9 @@ export function seedPatternDraft(rules, nextId) {
|
|
|
39
44
|
export function draftToRules(draft) {
|
|
40
45
|
return draft
|
|
41
46
|
.filter((row) => row.match.trim())
|
|
42
|
-
.map((row) => ({
|
|
47
|
+
.map((row) => ({
|
|
48
|
+
match: row.match.trim(),
|
|
49
|
+
action: row.action,
|
|
50
|
+
...(row.conditions?.length ? { conditions: row.conditions } : {}),
|
|
51
|
+
}));
|
|
43
52
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connector policy sets: named rule lists on one connector that an agent is
|
|
3
|
+
* given with `agents.<a>.policy_sets.<slug>` in kortix.yaml. The connector's
|
|
4
|
+
* own `policies:` are the base rules. The API owns the shape; these helpers
|
|
5
|
+
* are what the Tools tab and the agent editor need on top of it.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Channel and computer connectors have no kortix.yaml entry, so they cannot
|
|
9
|
+
* carry sets (the API answers 400 `policy_sets_unsupported`). The switcher is
|
|
10
|
+
* hidden there.
|
|
11
|
+
*/
|
|
12
|
+
export declare function supportsPolicySets(provider: string | null | undefined): boolean;
|
|
13
|
+
export type PolicySetNameProblem = 'invalid' | 'taken';
|
|
14
|
+
/**
|
|
15
|
+
* Why a name cannot be used for a new or renamed set, or null. `current` is
|
|
16
|
+
* the set being renamed: keeping its own name is not a clash.
|
|
17
|
+
*/
|
|
18
|
+
export declare function policySetNameProblem(name: string, existing: readonly string[], current?: string | null): PolicySetNameProblem | null;
|
|
19
|
+
/** The react-query key of one connector's set list. */
|
|
20
|
+
export declare function connectorPolicySetsKey(projectId: string, slug: string): readonly ["connector-policy-sets", string, string];
|
|
21
|
+
/** The react-query key of one rule list: the base rules (`null`) or one set. */
|
|
22
|
+
export declare function connectorPoliciesKey(projectId: string, slug: string, policySet: string | null): readonly ["connector-policies", string, string, string | null];
|
|
23
|
+
/** A starting point for a new set. `empty` inherits every tool from the base rules. */
|
|
24
|
+
export type PolicySetTemplate = 'empty' | 'read_only' | 'ask_before_writes';
|
|
25
|
+
export declare const POLICY_SET_TEMPLATES: readonly PolicySetTemplate[];
|
|
26
|
+
/** The name a template proposes. */
|
|
27
|
+
export declare const TEMPLATE_NAME: Record<PolicySetTemplate, string>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { POLICY_SETS_UNSUPPORTED_PROVIDERS, policySetNameError, } from '../../../_vendor/kortix-shared.js';
|
|
2
|
+
/**
|
|
3
|
+
* Connector policy sets: named rule lists on one connector that an agent is
|
|
4
|
+
* given with `agents.<a>.policy_sets.<slug>` in kortix.yaml. The connector's
|
|
5
|
+
* own `policies:` are the base rules. The API owns the shape; these helpers
|
|
6
|
+
* are what the Tools tab and the agent editor need on top of it.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Channel and computer connectors have no kortix.yaml entry, so they cannot
|
|
10
|
+
* carry sets (the API answers 400 `policy_sets_unsupported`). The switcher is
|
|
11
|
+
* hidden there.
|
|
12
|
+
*/
|
|
13
|
+
export function supportsPolicySets(provider) {
|
|
14
|
+
return !POLICY_SETS_UNSUPPORTED_PROVIDERS.includes((provider ?? '').trim().toLowerCase());
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Why a name cannot be used for a new or renamed set, or null. `current` is
|
|
18
|
+
* the set being renamed: keeping its own name is not a clash.
|
|
19
|
+
*/
|
|
20
|
+
export function policySetNameProblem(name, existing, current = null) {
|
|
21
|
+
if (policySetNameError(name))
|
|
22
|
+
return 'invalid';
|
|
23
|
+
if (name !== current && existing.includes(name))
|
|
24
|
+
return 'taken';
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
/** The react-query key of one connector's set list. */
|
|
28
|
+
export function connectorPolicySetsKey(projectId, slug) {
|
|
29
|
+
return ['connector-policy-sets', projectId, slug];
|
|
30
|
+
}
|
|
31
|
+
/** The react-query key of one rule list: the base rules (`null`) or one set. */
|
|
32
|
+
export function connectorPoliciesKey(projectId, slug, policySet) {
|
|
33
|
+
return ['connector-policies', projectId, slug, policySet];
|
|
34
|
+
}
|
|
35
|
+
export const POLICY_SET_TEMPLATES = ['read_only', 'ask_before_writes', 'empty'];
|
|
36
|
+
/** The name a template proposes. */
|
|
37
|
+
export const TEMPLATE_NAME = {
|
|
38
|
+
empty: '',
|
|
39
|
+
read_only: 'read_only',
|
|
40
|
+
ask_before_writes: 'ask_before_writes',
|
|
41
|
+
};
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import type { UiTranslator } from '../../../i18n/index.js';
|
|
2
2
|
import type { ConnectorAction } from '@kortix/sdk';
|
|
3
3
|
export interface ToolGroup {
|
|
4
|
-
key: 'read' | 'write';
|
|
4
|
+
key: 'read' | 'write' | 'unclassified';
|
|
5
5
|
label: string;
|
|
6
6
|
actions: ConnectorAction[];
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Which bucket a tool sits in. The server's `likely_risk` wins, then the
|
|
10
|
+
* stored risk. A tool the server could not classify (`unknown`, sent once tool risk is
|
|
11
|
+
* inferred server side) goes by its name, without the app prefix:
|
|
12
|
+
* `LINEAR_GET_ISSUE` reads, `send_email` writes, and the rest are
|
|
13
|
+
* unclassified. It is never shown as a write it may not be.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toolBucket(action: Pick<ConnectorAction, 'path' | 'name'> & {
|
|
16
|
+
risk: string;
|
|
17
|
+
likely_risk?: string;
|
|
18
|
+
}, appNames?: readonly string[]): ToolGroup['key'];
|
|
19
|
+
/**
|
|
20
|
+
* Three buckets: can this look at my data, can it change it, or does nobody
|
|
21
|
+
* know yet. `destructive` folds into writes: a delete is a write with worse
|
|
22
|
+
* consequences. Unclassified is its own bucket, so an unknown tool is never
|
|
23
|
+
* presented as safe or as a write.
|
|
13
24
|
*
|
|
14
25
|
* An empty bucket is omitted rather than rendered as a heading over nothing.
|
|
15
26
|
* Input order is kept inside each bucket: that is the order the connector
|
|
16
27
|
* reports its tools in, which is the order its own docs use.
|
|
17
28
|
*/
|
|
18
|
-
export declare function groupToolsByRisk(actions: readonly ConnectorAction[], tI18nComplete: UiTranslator): ToolGroup[];
|
|
29
|
+
export declare function groupToolsByRisk(actions: readonly ConnectorAction[], tI18nComplete: UiTranslator, appNames?: readonly string[]): ToolGroup[];
|
|
19
30
|
export interface ToolRowText {
|
|
20
|
-
/** The row's heading. */
|
|
31
|
+
/** The row's heading, in words: `LINEAR_ARCHIVE_ISSUE` reads "Archive issue". */
|
|
21
32
|
title: string;
|
|
22
33
|
/** The tool path, or `null` when the title already IS the path. */
|
|
23
34
|
path: string | null;
|
|
@@ -30,9 +41,21 @@ export interface ToolRowText {
|
|
|
30
41
|
* An OpenAPI connector commonly derives both `name` and `description` from the
|
|
31
42
|
* same `summary` — the live `petstore` fixture does for all 19 of its tools —
|
|
32
43
|
* so a naive row renders "Deletes a pet." over "Deletes a pet." The path is
|
|
33
|
-
* dropped the same way when the
|
|
44
|
+
* dropped the same way when the title is the path itself.
|
|
45
|
+
*
|
|
46
|
+
* `appNames` are the connector's slug and names: a title drops the one it
|
|
47
|
+
* starts with, because every row on the page already belongs to that app.
|
|
48
|
+
*/
|
|
49
|
+
export declare function toolRowText(action: ConnectorAction, appNames?: readonly string[]): ToolRowText;
|
|
50
|
+
/**
|
|
51
|
+
* A tool id as a sentence-case title. `LINEAR_ARCHIVE_ISSUE` with app name
|
|
52
|
+
* `linear` reads "Archive issue"; `ask_wiki_question` reads "Ask wiki
|
|
53
|
+
* question"; `getPetById` reads "Get pet by id".
|
|
54
|
+
*
|
|
55
|
+
* Only an identifier is rewritten. A name with a space is the connector's own
|
|
56
|
+
* wording and stays as it is. A prefix is dropped only when words remain.
|
|
34
57
|
*/
|
|
35
|
-
export declare function
|
|
58
|
+
export declare function humanizeToolName(name: string, appNames?: readonly string[]): string;
|
|
36
59
|
/**
|
|
37
60
|
* Narrow a tool list by a free-text query. A connector with 60 tools is
|
|
38
61
|
* unusable without one.
|
|
@@ -1,22 +1,49 @@
|
|
|
1
|
+
const READ_NAME = /^(get|list|read|search|fetch|find|query|describe|lookup|view|show|count|check)(?:\s|$)/i;
|
|
2
|
+
const WRITE_NAME = /^(create|update|delete|send|post|remove|archive|set|add|edit|patch|put|insert|upsert|move|reply|cancel|close|invite|upload|merge|assign)(?:\s|$)/i;
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Which bucket a tool sits in. The server's `likely_risk` wins, then the
|
|
5
|
+
* stored risk. A tool the server could not classify (`unknown`, sent once tool risk is
|
|
6
|
+
* inferred server side) goes by its name, without the app prefix:
|
|
7
|
+
* `LINEAR_GET_ISSUE` reads, `send_email` writes, and the rest are
|
|
8
|
+
* unclassified. It is never shown as a write it may not be.
|
|
9
|
+
*/
|
|
10
|
+
export function toolBucket(action, appNames = []) {
|
|
11
|
+
// `likely_risk` is the server's reading for display; `risk` stays what the
|
|
12
|
+
// gateway enforces (an un-annotated MCP tool is stored as `write`).
|
|
13
|
+
const risk = action.likely_risk ?? action.risk;
|
|
14
|
+
if (risk === 'read')
|
|
15
|
+
return 'read';
|
|
16
|
+
if (risk === 'write' || risk === 'destructive')
|
|
17
|
+
return 'write';
|
|
18
|
+
const words = humanizeToolName(action.name?.trim() || action.path, appNames);
|
|
19
|
+
if (READ_NAME.test(words))
|
|
20
|
+
return 'read';
|
|
21
|
+
if (WRITE_NAME.test(words))
|
|
22
|
+
return 'write';
|
|
23
|
+
return 'unclassified';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Three buckets: can this look at my data, can it change it, or does nobody
|
|
27
|
+
* know yet. `destructive` folds into writes: a delete is a write with worse
|
|
28
|
+
* consequences. Unclassified is its own bucket, so an unknown tool is never
|
|
29
|
+
* presented as safe or as a write.
|
|
6
30
|
*
|
|
7
31
|
* An empty bucket is omitted rather than rendered as a heading over nothing.
|
|
8
32
|
* Input order is kept inside each bucket: that is the order the connector
|
|
9
33
|
* reports its tools in, which is the order its own docs use.
|
|
10
34
|
*/
|
|
11
|
-
export function groupToolsByRisk(actions, tI18nComplete) {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
export function groupToolsByRisk(actions, tI18nComplete, appNames = []) {
|
|
36
|
+
const buckets = { read: [], write: [], unclassified: [] };
|
|
37
|
+
for (const action of actions)
|
|
38
|
+
buckets[toolBucket(action, appNames)].push(action);
|
|
39
|
+
const labels = {
|
|
40
|
+
read: tI18nComplete.raw('textdd28b5cb26fd'),
|
|
41
|
+
write: tI18nComplete.raw('texted26c1af81cf'),
|
|
42
|
+
unclassified: tI18nComplete.raw('text7c0a91e5b3d2'),
|
|
43
|
+
};
|
|
44
|
+
return ['read', 'write', 'unclassified']
|
|
45
|
+
.filter((key) => buckets[key].length > 0)
|
|
46
|
+
.map((key) => ({ key, label: labels[key], actions: buckets[key] }));
|
|
20
47
|
}
|
|
21
48
|
/**
|
|
22
49
|
* What one row prints, with nothing said twice.
|
|
@@ -24,12 +51,15 @@ export function groupToolsByRisk(actions, tI18nComplete) {
|
|
|
24
51
|
* An OpenAPI connector commonly derives both `name` and `description` from the
|
|
25
52
|
* same `summary` — the live `petstore` fixture does for all 19 of its tools —
|
|
26
53
|
* so a naive row renders "Deletes a pet." over "Deletes a pet." The path is
|
|
27
|
-
* dropped the same way when the
|
|
54
|
+
* dropped the same way when the title is the path itself.
|
|
55
|
+
*
|
|
56
|
+
* `appNames` are the connector's slug and names: a title drops the one it
|
|
57
|
+
* starts with, because every row on the page already belongs to that app.
|
|
28
58
|
*/
|
|
29
|
-
export function toolRowText(action) {
|
|
59
|
+
export function toolRowText(action, appNames = []) {
|
|
30
60
|
const name = action.name?.trim();
|
|
31
61
|
const description = action.description?.trim();
|
|
32
|
-
const title = name || action.path;
|
|
62
|
+
const title = humanizeToolName(name || action.path, appNames);
|
|
33
63
|
const same = (value) => Boolean(value) && value.toLowerCase() === title.toLowerCase();
|
|
34
64
|
return {
|
|
35
65
|
title,
|
|
@@ -37,6 +67,38 @@ export function toolRowText(action) {
|
|
|
37
67
|
description: !description || same(description) ? null : description,
|
|
38
68
|
};
|
|
39
69
|
}
|
|
70
|
+
const IDENTIFIER = /^[A-Za-z0-9_.\-/:]+$/;
|
|
71
|
+
const normalize = (value) => value.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
72
|
+
/**
|
|
73
|
+
* A tool id as a sentence-case title. `LINEAR_ARCHIVE_ISSUE` with app name
|
|
74
|
+
* `linear` reads "Archive issue"; `ask_wiki_question` reads "Ask wiki
|
|
75
|
+
* question"; `getPetById` reads "Get pet by id".
|
|
76
|
+
*
|
|
77
|
+
* Only an identifier is rewritten. A name with a space is the connector's own
|
|
78
|
+
* wording and stays as it is. A prefix is dropped only when words remain.
|
|
79
|
+
*/
|
|
80
|
+
export function humanizeToolName(name, appNames = []) {
|
|
81
|
+
const trimmed = name.trim();
|
|
82
|
+
if (!IDENTIFIER.test(trimmed))
|
|
83
|
+
return trimmed;
|
|
84
|
+
const words = trimmed
|
|
85
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
86
|
+
.split(/[\s_.\-/:]+/)
|
|
87
|
+
.filter(Boolean)
|
|
88
|
+
.map((word) => word.toLowerCase());
|
|
89
|
+
if (words.length === 0)
|
|
90
|
+
return trimmed;
|
|
91
|
+
const apps = new Set(appNames.map(normalize).filter(Boolean));
|
|
92
|
+
// Up to three words: `GOOGLE_SHEETS_ADD_ROW` with app `googlesheets`.
|
|
93
|
+
for (let take = Math.min(3, words.length - 1); take > 0; take--) {
|
|
94
|
+
if (apps.has(words.slice(0, take).join(''))) {
|
|
95
|
+
words.splice(0, take);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const sentence = words.join(' ');
|
|
100
|
+
return sentence.charAt(0).toUpperCase() + sentence.slice(1);
|
|
101
|
+
}
|
|
40
102
|
/**
|
|
41
103
|
* Narrow a tool list by a free-text query. A connector with 60 tools is
|
|
42
104
|
* unusable without one.
|
|
@@ -9,22 +9,23 @@ export interface ToolPolicyControlProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
/** Set when a project rule decides this tool: disables the group and says why. */
|
|
11
11
|
lockedReason?: string;
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/** Replaces the Default segment's label with what it resolves to: "Default · runs", "Inherit · asks". */
|
|
13
|
+
defaultLabel?: string;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* The per-tool decision: four segments, four states, every one reachable in
|
|
17
17
|
* both directions.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* It is the segmented track of `Tabs` (`tabs.tsx`): a recessed track and one
|
|
20
|
+
* raised chip, so the choice reads at a glance down a 60-row list. It is not
|
|
21
|
+
* a tablist: each segment is a toggle button with `aria-pressed`.
|
|
22
|
+
*
|
|
23
|
+
* `'default'` carries the label the caller gives it ("Default · runs",
|
|
24
|
+
* "Inherit · asks"), because "Default" alone does not tell a reader whether
|
|
25
|
+
* the tool runs or asks.
|
|
22
26
|
*
|
|
23
27
|
* `transition-[…,scale]`, not `transition-transform`: Tailwind v4's `scale-*`
|
|
24
28
|
* utility sets the standalone `scale` property, which
|
|
25
|
-
* `transition-property: transform` does not cover — the press would snap.
|
|
26
|
-
* explicit list also replaces `Button`'s base `transition-all`
|
|
27
|
-
* (`button.tsx:8`), which the polish rules treat as a defect. Same override,
|
|
28
|
-
* same reason, as `project-icon-field.tsx:217`.
|
|
29
|
+
* `transition-property: transform` does not cover — the press would snap.
|
|
29
30
|
*/
|
|
30
|
-
export declare function ToolPolicyControl({ value, onChange, label, disabled, lockedReason,
|
|
31
|
+
export declare function ToolPolicyControl({ value, onChange, label, disabled, lockedReason, defaultLabel, }: ToolPolicyControlProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from '../../../primitives/button.js';
|
|
4
|
-
import { ButtonGroup } from '../../../primitives/button-group.js';
|
|
5
3
|
import Hint from '../../../primitives/hint.js';
|
|
4
|
+
import { tabsSegmentedChipClasses, tabsSegmentedTrackClasses } from '../../../primitives/tabs.js';
|
|
6
5
|
import { cn } from '../../../internal/lib/utils.js';
|
|
7
6
|
import { useLocalizedUiCatalog } from '../../../i18n/ui-catalog/use-localized-ui-catalog.js';
|
|
8
7
|
import { POLICY_SEGMENTS } from './tool-policy-labels.js';
|
|
@@ -10,29 +9,32 @@ import { POLICY_SEGMENTS } from './tool-policy-labels.js';
|
|
|
10
9
|
* The per-tool decision: four segments, four states, every one reachable in
|
|
11
10
|
* both directions.
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* It is the segmented track of `Tabs` (`tabs.tsx`): a recessed track and one
|
|
13
|
+
* raised chip, so the choice reads at a glance down a 60-row list. It is not
|
|
14
|
+
* a tablist: each segment is a toggle button with `aria-pressed`.
|
|
15
|
+
*
|
|
16
|
+
* `'default'` carries the label the caller gives it ("Default · runs",
|
|
17
|
+
* "Inherit · asks"), because "Default" alone does not tell a reader whether
|
|
18
|
+
* the tool runs or asks.
|
|
16
19
|
*
|
|
17
20
|
* `transition-[…,scale]`, not `transition-transform`: Tailwind v4's `scale-*`
|
|
18
21
|
* utility sets the standalone `scale` property, which
|
|
19
|
-
* `transition-property: transform` does not cover — the press would snap.
|
|
20
|
-
* explicit list also replaces `Button`'s base `transition-all`
|
|
21
|
-
* (`button.tsx:8`), which the polish rules treat as a defect. Same override,
|
|
22
|
-
* same reason, as `project-icon-field.tsx:217`.
|
|
22
|
+
* `transition-property: transform` does not cover — the press would snap.
|
|
23
23
|
*/
|
|
24
|
-
export function ToolPolicyControl({ value, onChange, label, disabled = false, lockedReason,
|
|
24
|
+
export function ToolPolicyControl({ value, onChange, label, disabled = false, lockedReason, defaultLabel, }) {
|
|
25
25
|
const policySegments = useLocalizedUiCatalog(POLICY_SEGMENTS);
|
|
26
26
|
const locked = Boolean(lockedReason);
|
|
27
|
-
const group = (_jsx(
|
|
27
|
+
const group = (_jsx("div", { role: "group", "aria-label": label, className: cn(tabsSegmentedTrackClasses, 'inline-flex h-7 shrink-0 items-stretch gap-0.5'), children: policySegments.map((segment) => {
|
|
28
28
|
const selected = value === segment.choice;
|
|
29
|
-
return (_jsx(
|
|
29
|
+
return (_jsx("button", { type: "button", "aria-pressed": selected, disabled: disabled || locked,
|
|
30
30
|
// Re-pressing the current choice is a no-op, not a redundant PUT
|
|
31
31
|
// that rewrites the rule set to what it already is.
|
|
32
32
|
onClick: () => {
|
|
33
33
|
if (!selected)
|
|
34
34
|
onChange(segment.choice);
|
|
35
|
-
}, className: cn('px-2
|
|
35
|
+
}, className: cn('rounded-sm px-2 text-xs font-medium whitespace-nowrap', 'focus-visible:ring-kortix-blue focus-visible:ring-[0.6px] focus-visible:outline-none', 'disabled:pointer-events-none disabled:opacity-50', 'transition-[color,background-color,box-shadow,scale] duration-normal ease-default active:scale-[0.96] motion-reduce:transition-none', selected
|
|
36
|
+
? cn(tabsSegmentedChipClasses, segment.tint)
|
|
37
|
+
: cn('text-muted-foreground', segment.hoverTint)), children: segment.choice === 'default' && defaultLabel ? defaultLabel : segment.label }, segment.choice));
|
|
36
38
|
}) }));
|
|
37
39
|
// A disabled control with no explanation is a dead end. The segments carry
|
|
38
40
|
// `disabled:pointer-events-none`, so the pointer reaches this wrapper and the
|
|
@@ -40,8 +42,5 @@ export function ToolPolicyControl({ value, onChange, label, disabled = false, lo
|
|
|
40
42
|
if (lockedReason) {
|
|
41
43
|
return (_jsx(Hint, { label: lockedReason, side: "bottom", children: _jsx("div", { className: "shrink-0", children: group }) }));
|
|
42
44
|
}
|
|
43
|
-
if (value === 'default' && defaultHint) {
|
|
44
|
-
return (_jsx(Hint, { label: defaultHint, side: "bottom", children: _jsx("div", { className: "shrink-0", children: group }) }));
|
|
45
|
-
}
|
|
46
45
|
return group;
|
|
47
46
|
}
|
|
@@ -17,14 +17,15 @@ export interface PolicySegment {
|
|
|
17
17
|
hoverTint: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Default ·
|
|
20
|
+
* Default · Allow · Ask · Block.
|
|
21
21
|
*
|
|
22
22
|
* FOUR segments, because there are genuinely four states. Default sits first
|
|
23
|
-
* because it is the state every tool starts in
|
|
24
|
-
*
|
|
23
|
+
* because it is the state every tool starts in; the control labels it with
|
|
24
|
+
* what it resolves to ("Default · runs").
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* Only Block carries a hue, the destructive token. Allow and Ask are plain
|
|
27
|
+
* ink: a 60-tool list in three status colours reads as noise, and the word
|
|
28
|
+
* already says the decision.
|
|
28
29
|
*/
|
|
29
30
|
export declare const POLICY_SEGMENTS: readonly PolicySegment[];
|
|
30
31
|
export declare const POLICY_CHOICE_LABEL: Record<PolicyChoice, string>;
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Default ·
|
|
2
|
+
* Default · Allow · Ask · Block.
|
|
3
3
|
*
|
|
4
4
|
* FOUR segments, because there are genuinely four states. Default sits first
|
|
5
|
-
* because it is the state every tool starts in
|
|
6
|
-
*
|
|
5
|
+
* because it is the state every tool starts in; the control labels it with
|
|
6
|
+
* what it resolves to ("Default · runs").
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Only Block carries a hue, the destructive token. Allow and Ask are plain
|
|
9
|
+
* ink: a 60-tool list in three status colours reads as noise, and the word
|
|
10
|
+
* already says the decision.
|
|
10
11
|
*/
|
|
11
12
|
export const POLICY_SEGMENTS = [
|
|
12
13
|
{
|
|
13
14
|
choice: 'default',
|
|
14
15
|
label: 'Default',
|
|
15
|
-
tint: 'text-
|
|
16
|
+
tint: 'text-foreground',
|
|
16
17
|
hoverTint: 'hover:text-foreground',
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
|
-
choice: '
|
|
20
|
-
label: '
|
|
21
|
-
tint: 'text-
|
|
22
|
-
hoverTint: 'hover:text-
|
|
20
|
+
choice: 'always_run',
|
|
21
|
+
label: 'Allow',
|
|
22
|
+
tint: 'text-foreground',
|
|
23
|
+
hoverTint: 'hover:text-foreground',
|
|
23
24
|
},
|
|
24
25
|
{
|
|
25
26
|
choice: 'require_approval',
|
|
26
27
|
label: 'Ask',
|
|
27
|
-
tint: 'text-
|
|
28
|
-
hoverTint: 'hover:text-
|
|
28
|
+
tint: 'text-foreground',
|
|
29
|
+
hoverTint: 'hover:text-foreground',
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
|
-
choice: '
|
|
32
|
-
label: '
|
|
33
|
-
tint: 'text-
|
|
34
|
-
hoverTint: 'hover:text-
|
|
32
|
+
choice: 'block',
|
|
33
|
+
label: 'Block',
|
|
34
|
+
tint: 'text-destructive',
|
|
35
|
+
hoverTint: 'hover:text-destructive',
|
|
35
36
|
},
|
|
36
37
|
];
|
|
37
38
|
export const POLICY_CHOICE_LABEL = {
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import type { ConnectorEffectivePolicy, ConnectorPolicyAction, ConnectorPolicyRule } from '@kortix/sdk';
|
|
1
|
+
import type { ConnectorAction, ConnectorEffectivePolicy, ConnectorPolicyAction, ConnectorPolicyRule } from '@kortix/sdk';
|
|
2
2
|
export type PolicyChoice = 'default' | ConnectorPolicyAction;
|
|
3
|
+
/**
|
|
4
|
+
* Which rule list the Tools tab edits: the connector's base rules, or one
|
|
5
|
+
* policy set. In a set, `'default'` means "inherit": the tool has no rule in
|
|
6
|
+
* the set, so the base rules decide (`resolveEffectiveAction` checks the set
|
|
7
|
+
* before the base rules, connectors/policy.ts).
|
|
8
|
+
*/
|
|
9
|
+
export type PolicyScope = 'base' | 'set';
|
|
3
10
|
/**
|
|
4
11
|
* What the control should read for a tool. `risk_default` and `allow_all` are
|
|
5
12
|
* the platform deciding, not the user — showing them as an explicit Allow would
|
|
6
13
|
* claim a choice nobody made, and hide that changing the default moves them.
|
|
7
14
|
*/
|
|
8
|
-
export declare function effectiveChoice(path: string, effective: readonly ConnectorEffectivePolicy[]): PolicyChoice;
|
|
15
|
+
export declare function effectiveChoice(path: string, effective: readonly ConnectorEffectivePolicy[], scope?: PolicyScope): PolicyChoice;
|
|
16
|
+
/**
|
|
17
|
+
* What the Default segment (base rules) or the Inherit segment (a set)
|
|
18
|
+
* resolves to for one tool, so the control can say it: "Default · runs",
|
|
19
|
+
* "Inherit · blocked".
|
|
20
|
+
*
|
|
21
|
+
* - In a set, the base rules decide an inherited tool: `baseEffective` is the
|
|
22
|
+
* server's answer for the base list.
|
|
23
|
+
* - While the tool is on Default/Inherit, its own `effective` entry is that
|
|
24
|
+
* answer too (a pattern rule, the risk default, `allow_all`).
|
|
25
|
+
* - Otherwise the connector default (`fallback`) decides.
|
|
26
|
+
*/
|
|
27
|
+
export declare function inheritedAction(path: string, choice: PolicyChoice, effective: readonly ConnectorEffectivePolicy[], baseEffective: readonly ConnectorEffectivePolicy[], scope: PolicyScope, fallback: ConnectorPolicyAction): ConnectorPolicyAction;
|
|
9
28
|
/**
|
|
10
29
|
* Project-scope rules are evaluated first and win
|
|
11
30
|
* (`resolveEffectiveAction`, apps/api/src/connectors/policy.ts:342). Editing the
|
|
@@ -41,6 +60,11 @@ export declare function applyBulkPolicy(rules: readonly ConnectorPolicyRule[], p
|
|
|
41
60
|
* explicit regex when slash-wrapped. Everything else is a literal path.
|
|
42
61
|
*/
|
|
43
62
|
export declare function isPatternRule(match: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* A rule the per-tool control cannot represent: a pattern, or a rule with
|
|
65
|
+
* argument conditions. Both live in the Advanced editor.
|
|
66
|
+
*/
|
|
67
|
+
export declare function isAdvancedRule(rule: ConnectorPolicyRule): boolean;
|
|
44
68
|
/**
|
|
45
69
|
* Order a rule set for the wire.
|
|
46
70
|
*
|
|
@@ -64,7 +88,7 @@ export declare function orderPolicyRules(rules: readonly ConnectorPolicyRule[]):
|
|
|
64
88
|
* entirely. Falling back to the stored exact rule keeps the control live in
|
|
65
89
|
* both cases instead of showing every tool as unset.
|
|
66
90
|
*/
|
|
67
|
-
export declare function toolChoice(path: string, policies: readonly ConnectorPolicyRule[], effective: readonly ConnectorEffectivePolicy[]): PolicyChoice;
|
|
91
|
+
export declare function toolChoice(path: string, policies: readonly ConnectorPolicyRule[], effective: readonly ConnectorEffectivePolicy[], scope?: PolicyScope): PolicyChoice;
|
|
68
92
|
/**
|
|
69
93
|
* What `effective` will look like once the server applies this change — used
|
|
70
94
|
* to keep an optimistic update honest.
|
|
@@ -80,4 +104,26 @@ export declare function toolChoice(path: string, policies: readonly ConnectorPol
|
|
|
80
104
|
* the server never said. `toolChoice` reads `'default'` from the absence, so
|
|
81
105
|
* the control lands on Default immediately and the refetch fills in the truth.
|
|
82
106
|
*/
|
|
83
|
-
export declare function previewEffective(effective: readonly ConnectorEffectivePolicy[], paths: readonly string[], choice: PolicyChoice): ConnectorEffectivePolicy[];
|
|
107
|
+
export declare function previewEffective(effective: readonly ConnectorEffectivePolicy[], paths: readonly string[], choice: PolicyChoice, scope?: PolicyScope): ConnectorEffectivePolicy[];
|
|
108
|
+
export type DefaultMode = 'risk' | 'allow_all';
|
|
109
|
+
/**
|
|
110
|
+
* What a tool does when no rule names it: the server's default
|
|
111
|
+
* (`resolveEffectiveAction`, connectors/policy.ts). A sensitive connector asks
|
|
112
|
+
* for every tool, `allow_all` runs every tool, and otherwise reads run and
|
|
113
|
+
* writes ask.
|
|
114
|
+
*/
|
|
115
|
+
export declare function connectorDefaultAction(sensitive: boolean, defaultMode: DefaultMode | undefined, risk: ConnectorAction['risk']): ConnectorPolicyAction;
|
|
116
|
+
export interface ToolDecisionSummary {
|
|
117
|
+
total: number;
|
|
118
|
+
block: number;
|
|
119
|
+
ask: number;
|
|
120
|
+
run: number;
|
|
121
|
+
/** Tools the list being edited decides itself (not Default/Inherit, not a project rule). */
|
|
122
|
+
changed: number;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The counts above the tool list: what each tool does on its next call, and
|
|
126
|
+
* how many tools this list changes. `effective` is the server's answer and
|
|
127
|
+
* wins; `fallback` names what a tool with no entry does.
|
|
128
|
+
*/
|
|
129
|
+
export declare function summarizeToolDecisions(actions: readonly ConnectorAction[], policies: readonly ConnectorPolicyRule[], effective: readonly ConnectorEffectivePolicy[], scope: PolicyScope, fallback: (action: ConnectorAction) => ConnectorPolicyAction): ToolDecisionSummary;
|