@kortix/ui 0.15.1 → 0.15.3
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/dist/_vendor/kortix-shared.js +157 -2
- package/dist/_vendor/shared/channel-descriptors.d.ts +1 -1
- package/dist/_vendor/shared/index.d.ts +1 -2
- package/dist/_vendor/shared/workspace-actions.d.ts +155 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +62 -0
- package/dist/access/access/access-dialog-share.js +6 -6
- package/dist/access/access/access-dialog.d.ts +44 -1
- package/dist/access/access/access-dialog.js +8 -8
- package/dist/access/access/agent-principals.d.ts +3 -3
- package/dist/access/access/agent-principals.js +5 -4
- package/dist/access/access/invite-people-dialog.d.ts +37 -0
- package/dist/access/access/invite-people-dialog.js +140 -0
- package/dist/access/access/principal-picker.js +3 -2
- package/dist/access/access/project-select.js +2 -2
- package/dist/access/access/role-select.d.ts +9 -8
- package/dist/access/access/role-select.js +22 -25
- package/dist/access/access/workspace-role-dialog.d.ts +27 -0
- package/dist/access/access/workspace-role-dialog.js +48 -0
- package/dist/access/iam/add-github-account-dialog.d.ts +1 -1
- package/dist/access/iam/add-github-account-dialog.js +1 -1
- package/dist/access/iam/api-key-expiry.d.ts +18 -0
- package/dist/access/iam/api-key-expiry.js +47 -0
- package/dist/access/iam/api-key-rows.d.ts +6 -0
- package/dist/access/iam/api-key-rows.js +3 -0
- package/dist/access/iam/workspace-key-acts-as.d.ts +41 -0
- package/dist/access/iam/workspace-key-acts-as.js +48 -0
- package/dist/access/sharing-intent.js +1 -1
- package/dist/access/sharing-picker.js +1 -1
- package/dist/animated-copy-icon.d.ts +2 -2
- package/dist/animated-copy-icon.js +7 -4
- package/dist/apps/app-shared.js +2 -2
- package/dist/artifacts/artifact-frame.d.ts +0 -1
- package/dist/artifacts/artifact-frame.js +4 -10
- package/dist/artifacts/artifact-session.js +3 -7
- package/dist/artifacts/frame-policy.d.ts +1 -1
- package/dist/artifacts/frame-policy.js +2 -2
- package/dist/customize/agents/agent-drives-section.js +2 -2
- package/dist/customize/agents/agent-page-chrome.js +1 -1
- package/dist/customize/agents/agent-page.js +4 -5
- package/dist/customize/agents/agents-page.js +2 -3
- package/dist/customize/connectors/connector-identity.d.ts +1 -1
- package/dist/customize/connectors/connector-identity.js +1 -1
- package/dist/customize/connectors/connector-moves-banner.js +2 -2
- package/dist/customize/connectors/connectors-page.d.ts +2 -2
- package/dist/customize/connectors/connectors-page.js +4 -4
- package/dist/customize/connectors/detail/app-page.js +1 -1
- package/dist/customize/connectors/detail/connector-page.d.ts +1 -1
- package/dist/customize/connectors/detail/connector-page.js +1 -1
- package/dist/customize/connectors/detail/connector-policy-sets.js +2 -2
- package/dist/customize/connectors/detail/connector-tools.js +7 -7
- package/dist/customize/connectors/detail/connector-triggers.js +2 -3
- package/dist/customize/connectors/detail/email-inboxes.js +2 -2
- package/dist/customize/models/models-page.d.ts +1 -1
- package/dist/customize/models/models-page.js +1 -1
- package/dist/customize/project-settings/project-admin-sections.d.ts +53 -17
- package/dist/customize/project-settings/project-admin-sections.js +80 -31
- package/dist/customize/project-settings/project-settings-page.d.ts +2 -2
- package/dist/customize/project-settings/project-settings-page.js +6 -4
- package/dist/customize/project-settings/project-settings-sections.d.ts +2 -3
- package/dist/customize/project-settings/project-settings-sections.js +9 -4
- package/dist/customize/providers/provider-accordion.d.ts +3 -1
- package/dist/customize/providers/provider-accordion.js +2 -2
- package/dist/customize/secrets/secrets-page.d.ts +1 -1
- package/dist/customize/secrets/secrets-page.js +1 -1
- package/dist/customize/sections/component/email-connect-form.js +2 -2
- package/dist/customize/sections/component/slack-byo-wizard.js +3 -3
- package/dist/customize/sections/connectors-view.js +17 -17
- package/dist/customize/sections/gateway-view.d.ts +7 -5
- package/dist/customize/sections/gateway-view.js +28 -17
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +2 -2
- package/dist/customize/sections/llm-provider/custom-provider-form.js +2 -2
- package/dist/customize/sections/llm-provider/llm-provider-modal.d.ts +1 -1
- package/dist/customize/sections/llm-provider/llm-provider-modal.js +4 -4
- package/dist/customize/sections/llm-provider/models-tab-row.js +5 -3
- package/dist/customize/sections/llm-provider/types.d.ts +2 -0
- package/dist/customize/sections/view/agent-editor-catalog.d.ts +5 -6
- package/dist/customize/sections/view/agent-editor-catalog.js +33 -19
- package/dist/customize/sections/view/agent-editor.js +1 -1
- package/dist/customize/sections/view/channels-view.js +13 -13
- package/dist/customize/sections/view/gateway/gateway-budgets.js +12 -10
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
- package/dist/customize/sections/view/gateway/gateway-logs.js +3 -3
- package/dist/customize/sections/view/gateway/gateway-overview.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-routing.js +1 -1
- package/dist/customize/sections/view/git-view.js +3 -3
- package/dist/customize/sections/view/grant-mode-field.js +2 -2
- package/dist/customize/sections/view/review-center-connected.js +1 -1
- package/dist/customize/sections/view/review-view.d.ts +0 -15
- package/dist/customize/sections/view/review-view.js +1 -23
- package/dist/customize/sections/view/secret-delivery.js +2 -2
- package/dist/customize/sections/view/secrets-view.js +16 -16
- package/dist/customize/sections/view/subscription-usage-tab.d.ts +12 -1
- package/dist/customize/sections/view/subscription-usage-tab.js +71 -72
- package/dist/customize/settings/rail-copy-context.js +1 -1
- package/dist/customize/settings/rail.d.ts +1 -1
- package/dist/customize/settings/rail.js +11 -18
- package/dist/customize/settings/settings-tab-header.d.ts +1 -1
- package/dist/customize/settings/settings-tab-header.js +1 -1
- package/dist/customize/settings/settings-tabs.d.ts +5 -12
- package/dist/customize/settings/settings-tabs.js +31 -44
- package/dist/customize/settings/tabs/experimental-tab.js +4 -4
- package/dist/customize/settings/tabs/general-tab.d.ts +29 -11
- package/dist/customize/settings/tabs/general-tab.js +55 -25
- package/dist/customize/settings/tabs/project-edit-patch.d.ts +0 -13
- package/dist/customize/settings/tabs/project-edit-patch.js +0 -28
- package/dist/customize/settings/tabs/sandbox-tab.js +2 -2
- package/dist/customize/settings/tabs/tokens-tab.d.ts +32 -2
- package/dist/customize/settings/tabs/tokens-tab.js +157 -32
- package/dist/customize/settings/tabs/workspace-keys.d.ts +6 -0
- package/dist/customize/settings/tabs/workspace-keys.js +240 -0
- package/dist/customize/shared/capability-library.js +3 -1
- package/dist/customize/shared/catalog/catalog-space-tabs.js +2 -2
- package/dist/customize/shared/customize-tab-bar.d.ts +6 -2
- package/dist/customize/shared/customize-tab-bar.js +36 -35
- package/dist/customize/shared/standalone-settings-nav.js +2 -2
- package/dist/customize/triggers/schedule/schedule-copy.d.ts +1 -1
- package/dist/customize/triggers/schedule/trigger-composer.js +5 -6
- package/dist/customize/triggers/schedule/trigger-list.d.ts +2 -2
- package/dist/customize/triggers/schedule/trigger-list.js +12 -18
- package/dist/customize/triggers/schedule/trigger-session-access-copy.d.ts +6 -6
- package/dist/customize/triggers/schedule/trigger-session-access-copy.js +3 -3
- package/dist/customize/triggers/schedule/when-event.js +4 -4
- package/dist/customize/triggers/schedule/when-webhook-address.js +2 -2
- package/dist/customize/triggers/schedule/when-webhook.js +2 -2
- package/dist/customize/triggers/schedule-view.js +4 -5
- package/dist/customize/triggers/triggers-page.d.ts +1 -1
- package/dist/customize/triggers/triggers-page.js +1 -1
- package/dist/files/drives/drive-storage.d.ts +2 -2
- package/dist/files/drives/drive-storage.js +13 -6
- package/dist/files/project/components/change-request-detail-dialog.js +6 -6
- package/dist/files/project/components/change-requests-panel.js +2 -2
- package/dist/files/project/components/diff-preview-banner.d.ts +1 -1
- package/dist/files/project/components/diff-preview-banner.js +1 -1
- package/dist/files/project/components/drive-grid-view.js +1 -1
- package/dist/files/project/components/drive-list-view.js +1 -1
- package/dist/files/project/context.d.ts +1 -1
- package/dist/files/project/context.js +1 -1
- package/dist/files/renderers/image-renderer.js +1 -1
- package/dist/files/runtime/hooks/use-binary-blob.js +12 -2
- package/dist/files/runtime/hooks/use-file-content.js +18 -2
- package/dist/files/viewer/file-content-renderer.js +2 -2
- package/dist/files/viewer/preview-fit.d.ts +1 -1
- package/dist/files/viewer/preview-fit.js +1 -1
- package/dist/i18n/en.d.ts +312 -210
- package/dist/i18n/en.js +880 -778
- package/dist/i18n/ui-catalog/account-hub-translation-keys.generated.js +9 -9
- package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +12 -6
- package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.js +5 -5
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +67 -60
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/icons/solid-right-arrow.d.ts +8 -0
- package/dist/icons/solid-right-arrow.js +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/account-hub-entry.js +9 -8
- package/dist/internal/account-hub/account-hub-location.d.ts +20 -3
- package/dist/internal/account-hub/account-hub-location.js +16 -7
- package/dist/internal/account-hub/hub-sheet.d.ts +1 -1
- package/dist/internal/account-hub/hub-sheet.js +1 -1
- package/dist/internal/account-hub/sections.d.ts +2 -2
- package/dist/internal/account-hub/sections.js +10 -10
- package/dist/internal/account-hub/use-account-hub-access.d.ts +2 -0
- package/dist/internal/account-hub/use-account-hub-access.js +13 -5
- package/dist/internal/account-hub/workspace-settings-route.d.ts +27 -0
- package/dist/internal/account-hub/workspace-settings-route.js +51 -0
- package/dist/internal/components/agent-mark.js +6 -0
- package/dist/internal/components/clickable-path.d.ts +3 -0
- package/dist/internal/components/clickable-path.js +4 -1
- package/dist/internal/components/nav-rail.d.ts +3 -1
- package/dist/internal/components/nav-rail.js +2 -0
- package/dist/internal/components/repository-disconnected.js +2 -2
- package/dist/internal/desktop/desktop-back-button.d.ts +1 -1
- package/dist/internal/files/file-read-retry.d.ts +13 -0
- package/dist/internal/files/file-read-retry.js +53 -1
- package/dist/internal/goals/goal-meta.d.ts +2 -1
- package/dist/internal/goals/goal-meta.js +4 -2
- package/dist/internal/hooks/account/use-accounts-list.d.ts +2 -12
- package/dist/internal/hooks/account/use-accounts-list.js +1 -14
- package/dist/internal/hooks/account/use-my-invites.d.ts +1 -1
- package/dist/internal/hooks/account/use-my-invites.js +1 -1
- package/dist/internal/hooks/use-review-session-summary.d.ts +7 -0
- package/dist/internal/hooks/use-review-session-summary.js +12 -1
- package/dist/internal/layout/project-capability-nav.d.ts +6 -17
- package/dist/internal/layout/project-capability-nav.js +7 -79
- package/dist/internal/layout/project-settings-nav.d.ts +2 -2
- package/dist/internal/layout/project-settings-nav.js +3 -3
- package/dist/internal/lib/billing/billing-gate-state.d.ts +11 -0
- package/dist/internal/lib/billing/billing-gate-state.js +18 -0
- package/dist/internal/lib/browser-noise/rules/expected-states.js +2 -3
- package/dist/internal/lib/browser-noise/rules/extensions.js +18 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +66 -5
- package/dist/internal/lib/capability-tab-routes.d.ts +16 -40
- package/dist/internal/lib/capability-tab-routes.js +25 -54
- package/dist/internal/lib/desktop.d.ts +1 -1
- package/dist/internal/lib/desktop.js +1 -1
- package/dist/internal/lib/github-installations.d.ts +1 -1
- package/dist/internal/lib/github-installations.js +1 -1
- package/dist/internal/lib/model-pricing.js +1 -1
- package/dist/internal/lib/navigation/session-href.d.ts +1 -1
- package/dist/internal/lib/navigation/session-href.js +1 -1
- package/dist/internal/lib/onboarding/landing-destination.d.ts +12 -4
- package/dist/internal/lib/onboarding/landing-destination.js +17 -5
- package/dist/internal/lib/onboarding/last-project-cookie.d.ts +1 -1
- package/dist/internal/lib/onboarding/last-project-cookie.js +1 -1
- package/dist/internal/lib/project-actions.d.ts +1 -4
- package/dist/internal/lib/project-actions.js +2 -5
- package/dist/internal/lib/provider-branding.js +11 -3
- package/dist/internal/lib/trigger-clock.d.ts +5 -0
- package/dist/internal/lib/trigger-clock.js +15 -0
- package/dist/internal/lib/turn-broadcast.d.ts +0 -3
- package/dist/internal/lib/use-project-can.d.ts +1 -3
- package/dist/internal/lib/use-project-can.js +0 -5
- package/dist/internal/lib/web-notifications.d.ts +1 -8
- package/dist/internal/lib/web-notifications.js +17 -58
- package/dist/internal/notifications/notification-bell.d.ts +13 -33
- package/dist/internal/notifications/notification-bell.js +14 -117
- package/dist/internal/notifications/notification-inbox.d.ts +51 -0
- package/dist/internal/notifications/notification-inbox.js +122 -0
- package/dist/internal/notifications/notification-rows.d.ts +3 -4
- package/dist/internal/notifications/notification-rows.js +1 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +17 -0
- package/dist/internal/notifications/use-inbox-summary.js +28 -0
- package/dist/internal/notifications/web-push.d.ts +9 -10
- package/dist/internal/notifications/web-push.js +9 -10
- package/dist/internal/reminders/use-refetch-after-fire.d.ts +0 -2
- package/dist/internal/reminders/use-refetch-after-fire.js +1 -10
- package/dist/internal/stores/account-panel-store.d.ts +17 -1
- package/dist/internal/stores/account-panel-store.js +19 -2
- package/dist/internal/stores/project-switch-store.d.ts +2 -2
- package/dist/internal/stores/project-switch-store.js +4 -4
- package/dist/internal/stores/settings-panel-store.d.ts +6 -0
- package/dist/internal/stores/settings-panel-store.js +4 -1
- package/dist/internal/stores/web-notification-store.d.ts +6 -9
- package/dist/internal/stores/web-notification-store.js +0 -4
- package/dist/internal/stores/workspace-settings-rail-store.d.ts +67 -0
- package/dist/internal/stores/workspace-settings-rail-store.js +11 -0
- package/dist/lib/routes.d.ts +8 -0
- package/dist/lib/routes.js +22 -18
- package/dist/lib/z-stack.d.ts +7 -0
- package/dist/lib/z-stack.js +13 -0
- package/dist/markdown/copy-button.d.ts +2 -2
- package/dist/markdown/copy-button.js +22 -20
- package/dist/markdown/doc-editor/doc-menus.d.ts +1 -10
- package/dist/markdown/doc-editor/doc-menus.js +6 -69
- package/dist/markdown/file-links.js +21 -0
- package/dist/markdown/setup-links/setup-link-button.js +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/emoji-tint.d.ts +1 -1
- package/dist/primitives/emoji-tint.js +1 -1
- package/dist/primitives/error-state.js +8 -1
- package/dist/primitives/inline-meta.d.ts +12 -1
- package/dist/primitives/inline-meta.js +38 -5
- package/dist/primitives/page-search-bar.js +6 -6
- package/dist/primitives/section.d.ts +3 -3
- package/dist/primitives/section.js +9 -9
- package/dist/primitives/status.d.ts +5 -5
- package/dist/primitives/status.js +33 -33
- package/dist/primitives/tabs.d.ts +14 -26
- package/dist/primitives/tabs.js +103 -105
- package/dist/primitives/tag.d.ts +1 -1
- package/dist/primitives/toast.d.ts +6 -6
- package/dist/primitives/toast.js +55 -48
- package/dist/providers/session-ids.d.ts +1 -1
- package/dist/providers/ui-provider.d.ts +2 -0
- package/dist/session/agents/agent-strip.js +6 -6
- package/dist/session/agents/subagent-dialog-content.js +3 -4
- package/dist/session/agents/workflow-run-controls.d.ts +0 -2
- package/dist/session/agents/workflow-run-controls.js +1 -12
- package/dist/session/composer/ComposerCard.js +1 -1
- package/dist/session/composer/animated-placeholder.js +1 -1
- package/dist/session/composer/chat-input/chat-input-control.js +1 -8
- package/dist/session/composer/composer-toolbar.d.ts +18 -16
- package/dist/session/composer/composer-toolbar.js +10 -1
- package/dist/session/composer/composer.js +5 -13
- package/dist/session/composer/reasoning-effort-selector.d.ts +21 -0
- package/dist/session/composer/reasoning-effort-selector.js +46 -1
- package/dist/session/header/reminder-parts.d.ts +1 -1
- package/dist/session/header/session-goal-indicator.js +2 -3
- package/dist/session/header/session-reminders-indicator.js +3 -3
- package/dist/session/header/session-site-header.js +3 -7
- package/dist/session/index.d.ts +1 -1
- package/dist/session/models/model-availability.d.ts +11 -0
- package/dist/session/models/model-availability.js +12 -0
- package/dist/session/models/model-connection-gate.d.ts +11 -26
- package/dist/session/models/model-connection-gate.js +22 -35
- package/dist/session/models/model-grouping.d.ts +30 -0
- package/dist/session/models/model-grouping.js +46 -0
- package/dist/session/models/model-picker-panel.d.ts +62 -0
- package/dist/session/models/model-picker-panel.js +181 -0
- package/dist/session/models/model-selector.d.ts +28 -4
- package/dist/session/models/model-selector.js +59 -15
- package/dist/session/models/model-tags.d.ts +4 -8
- package/dist/session/models/model-tags.js +20 -13
- package/dist/session/models/subscription-offer.d.ts +35 -0
- package/dist/session/models/subscription-offer.js +91 -0
- package/dist/session/models/use-model-connection-gate.d.ts +3 -3
- package/dist/session/models/use-model-connection-gate.js +8 -6
- package/dist/session/overrides/session-overrides-toolbar.js +8 -5
- package/dist/session/panel/open-session-quick-view.js +1 -1
- package/dist/session/panel/session-detail-panel.js +5 -1
- package/dist/session/panel/session-panel-provider.js +2 -2
- package/dist/session/panel/session-reminders-panel.js +6 -17
- package/dist/session/panel/shared/use-panel-derivations.d.ts +1 -0
- package/dist/session/panel/shared/use-panel-derivations.js +1 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +22 -3
- package/dist/session/panel/use-session-panel-state.js +1 -1
- package/dist/session/prompts/ask-deck.d.ts +5 -3
- package/dist/session/prompts/ask-deck.js +30 -10
- package/dist/session/prompts/session-access-prompt.d.ts +61 -0
- package/dist/session/prompts/session-access-prompt.js +88 -0
- package/dist/session/prompts/session-permission-prompt.js +1 -1
- package/dist/session/scope/session-scope-control.js +2 -2
- package/dist/session/status/session-notice-banner.js +3 -3
- package/dist/session/status/session-route-prefetch.d.ts +2 -2
- package/dist/session/thread/optimistic-turn.js +1 -1
- package/dist/session/thread/session-chat.js +40 -18
- package/dist/session/thread/session-context-message-explorer.js +2 -2
- package/dist/session/thread/session-history.js +3 -3
- package/dist/session/tool/render-static.d.ts +11 -0
- package/dist/session/tool/render-static.js +16 -0
- package/dist/session/tool/shared/session-helpers.js +2 -2
- package/dist/session/tool/tool-part-renderer.d.ts +6 -1
- package/dist/session/tool/tool-part-renderer.js +9 -5
- package/dist/session/tool/tools/kortix-action-tool.js +4 -25
- package/dist/session/tool/tools/session-spawn-tool.js +7 -4
- package/dist/session/tool/tools/task-tool.js +27 -6
- package/dist/session/tool/tools/workflow-run-card.js +5 -1
- package/dist/session/tool/tools/workflow-tool.js +3 -14
- package/dist/session/turn/user-message.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +10096 -0
- package/dist/test-utils/intl.js +27 -0
- package/dist/test-utils/strip-tags.d.ts +24 -0
- package/dist/test-utils/strip-tags.js +32 -0
- package/dist/workspace/admin/project-admin-dashboard.d.ts +51 -33
- package/dist/workspace/admin/project-admin-dashboard.js +269 -81
- package/dist/workspace/admin/settings-search-landing.d.ts +11 -0
- package/dist/workspace/admin/settings-search-landing.js +103 -0
- package/dist/workspace/admin/settings-search.d.ts +69 -0
- package/dist/workspace/admin/settings-search.js +393 -0
- package/dist/workspace/home/access-requests-bell.d.ts +6 -9
- package/dist/workspace/home/access-requests-bell.js +8 -10
- package/dist/workspace/home/existing-repo-setup-prompt.d.ts +22 -0
- package/dist/workspace/home/existing-repo-setup-prompt.js +58 -0
- package/dist/workspace/home/no-agent-home.d.ts +25 -0
- package/dist/workspace/home/no-agent-home.js +44 -0
- package/dist/workspace/home/welcome-body.js +2 -1
- package/dist/workspace/inbox/workspace-inbox.d.ts +21 -0
- package/dist/workspace/inbox/workspace-inbox.js +52 -0
- package/dist/workspace/layout/project-files-view.js +1 -1
- package/dist/workspace/layout/project-home.js +60 -10
- package/dist/workspace/memory/memory-body.js +2 -2
- package/dist/workspace/new/account-param.d.ts +1 -1
- package/dist/workspace/new/account-param.js +4 -4
- package/dist/workspace/new/advanced-fields.js +3 -3
- package/dist/workspace/new/clone-param.d.ts +1 -1
- package/dist/workspace/new/clone-param.js +1 -1
- package/dist/workspace/new/create-workspace-key.js +1 -1
- package/dist/workspace/new/github-source.d.ts +6 -6
- package/dist/workspace/new/github-source.js +6 -6
- package/dist/workspace/new/new-workspace-form.d.ts +11 -141
- package/dist/workspace/new/new-workspace-form.js +9 -195
- package/dist/workspace/new/provision-new-workspace.d.ts +14 -0
- package/dist/workspace/new/provision-new-workspace.js +14 -0
- package/dist/workspace/new/repository-options.d.ts +2 -2
- package/dist/workspace/new/repository-options.js +2 -2
- package/dist/workspace/new/source-param.d.ts +2 -2
- package/dist/workspace/new/source-param.js +2 -2
- package/dist/workspace/new/use-create-workspace.d.ts +43 -102
- package/dist/workspace/new/use-create-workspace.js +77 -136
- package/dist/workspace/new/use-project-quota.d.ts +1 -1
- package/dist/workspace/new/use-project-quota.js +1 -1
- package/dist/workspace/new/workspace-handoff.d.ts +2 -2
- package/dist/workspace/new/workspace-handoff.js +2 -2
- package/dist/workspace/new/workspace-name.d.ts +1 -1
- package/dist/workspace/new/workspace-name.js +1 -1
- package/dist/workspace/project-selector/project-selector-model.d.ts +115 -57
- package/dist/workspace/project-selector/project-selector-model.js +157 -111
- package/dist/workspace/projects/modal/project-icon-field.d.ts +5 -5
- package/dist/workspace/projects/modal/project-icon-field.js +4 -4
- package/dist/workspace/projects/policies-panel.js +3 -3
- package/dist/workspace/sessions/board-grouping.js +1 -1
- package/dist/workspace/sessions/project-sessions-view.js +2 -2
- package/dist/workspace/sessions/session-detail.js +2 -2
- package/dist/workspace/sessions/sessions-board.d.ts +1 -1
- package/dist/workspace/sessions/sessions-board.js +1 -1
- package/dist/workspace/settings/split-notice-banner.d.ts +13 -0
- package/dist/workspace/settings/split-notice-banner.js +59 -0
- package/dist/workspace/settings/use-leave-workspace.d.ts +16 -0
- package/dist/workspace/settings/use-leave-workspace.js +60 -0
- package/dist/workspace/sidebar/footer/project-files-nav.js +2 -2
- package/dist/workspace/sidebar/footer/sandbox-health.js +1 -1
- package/dist/workspace/sidebar/invitations-menu-group.d.ts +2 -2
- package/dist/workspace/sidebar/invitations-menu-group.js +4 -4
- package/dist/workspace/sidebar/modal/session-embed-section.js +1 -1
- package/dist/workspace/sidebar/modal/share-session-access.js +1 -1
- package/dist/workspace/sidebar/modal/share-session-modal.js +3 -3
- package/dist/workspace/sidebar/project-nav-items.js +14 -25
- package/dist/workspace/sidebar/project-sidebar.js +18 -7
- package/dist/workspace/sidebar/project-spaces-nav.js +6 -15
- package/dist/workspace/sidebar/sidebar-drill.d.ts +37 -0
- package/dist/workspace/sidebar/sidebar-drill.js +110 -0
- package/dist/workspace/sidebar/use-workspace-directory.d.ts +24 -0
- package/dist/workspace/sidebar/use-workspace-directory.js +24 -0
- package/dist/workspace/sidebar/use-workspace-list.d.ts +37 -0
- package/dist/workspace/sidebar/use-workspace-list.js +71 -0
- package/dist/workspace/sidebar/workspace-grouping.d.ts +6 -67
- package/dist/workspace/sidebar/workspace-grouping.js +4 -107
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +30 -12
- package/dist/workspace/sidebar/workspace-menu-model.js +13 -107
- package/dist/workspace/sidebar/workspace-menu-section.d.ts +7 -1
- package/dist/workspace/sidebar/workspace-menu-section.js +65 -100
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +34 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +282 -0
- package/dist/workspace/space/space-filter-tabs.js +2 -2
- package/dist/workspace/space/space-page.d.ts +1 -1
- package/dist/workspace/space/space-page.js +1 -1
- package/package.json +59 -51
- package/skills/kortix-ui/SKILL.md +66 -66
- package/skills/kortix-ui/references/custom-dashboard.md +15 -15
- package/skills/kortix-ui/references/modules.md +15 -15
- package/dist/_vendor/shared/artifact-annotations.d.ts +0 -311
- package/dist/_vendor/shared/artifact-comments.d.ts +0 -155
- package/dist/customize/agents/agent-pin-button.d.ts +0 -10
- package/dist/customize/agents/agent-pin-button.js +0 -20
- package/dist/customize/settings/tabs/transfer-workspace-dialog.d.ts +0 -4
- package/dist/customize/settings/tabs/transfer-workspace-dialog.js +0 -82
- package/dist/internal/account-hub/account-settings-shell.d.ts +0 -7
- package/dist/internal/account-hub/account-settings-shell.js +0 -87
- package/dist/internal/account-hub/account-settings-sidebar.d.ts +0 -2
- package/dist/internal/account-hub/account-settings-sidebar.js +0 -169
- package/dist/internal/hooks/use-notification-center.d.ts +0 -50
- package/dist/internal/hooks/use-notification-center.js +0 -151
- package/dist/internal/lib/use-project-feature-flags.d.ts +0 -26
- package/dist/internal/lib/use-project-feature-flags.js +0 -78
- package/dist/internal/stores/pinned-agents-store.d.ts +0 -26
- package/dist/internal/stores/pinned-agents-store.js +0 -20
- package/dist/primitives/info-banner.d.ts +0 -14
- package/dist/primitives/info-banner.js +0 -72
- package/dist/workspace/new/account-picker.d.ts +0 -71
- package/dist/workspace/new/account-picker.js +0 -92
- package/dist/workspace/new/use-creatable-accounts.d.ts +0 -8
- package/dist/workspace/new/use-creatable-accounts.js +0 -33
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Workspace settings › API keys: ONE list of every key of the workspace, and
|
|
5
|
+
* ONE create that asks who the key acts as (design.md §3.2 C4b).
|
|
6
|
+
*
|
|
7
|
+
* - You: your role in this workspace; revoked when you leave.
|
|
8
|
+
* - An agent: a kortix.yaml agent's own identity, exactly its grant inside
|
|
9
|
+
* its role; audited as the agent; it survives its creator leaving.
|
|
10
|
+
* - A bot: a machine identity for CI or an integration, with its own roles.
|
|
11
|
+
*
|
|
12
|
+
* Every member sees and manages their own keys. Agent and bot keys need
|
|
13
|
+
* `token.create` (`can_manage_principals` on the list). This replaced the two
|
|
14
|
+
* lists "Your keys for this workspace" and "Service account tokens".
|
|
15
|
+
*/
|
|
16
|
+
import { useRef, useState } from 'react';
|
|
17
|
+
import { createWorkspaceKey, getPatPolicy, listPermissions, listWorkspaceKeys, revokeWorkspaceKey, } from '@kortix/sdk';
|
|
18
|
+
import { KeyIcon, PlusIcon, ProhibitIcon, RobotIcon, TerminalWindowIcon, TrashIcon, UserIcon } from '@phosphor-icons/react';
|
|
19
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
20
|
+
import { defaultKeyExpiryOption, keyExpiresAt, keyExpiryOptions } from '../../../access/iam/api-key-expiry.js';
|
|
21
|
+
import { NEW_BOT, actsAsInput, actsAsOptions, keyRowAction, keyStatus, sortKeys, } from '../../../access/iam/workspace-key-acts-as.js';
|
|
22
|
+
import { CopyRow } from '../../../access/access/index.js';
|
|
23
|
+
import { RowKebab } from '../../../access/access/access-row.js';
|
|
24
|
+
import { useLocale, useTranslations } from '../../../i18n/index.js';
|
|
25
|
+
import { MFA_REQUIRED_EVENT } from '../../../internal/auth/mfa-pending-action.js';
|
|
26
|
+
import { Badge } from '../../../primitives/badge.js';
|
|
27
|
+
import { Button } from '../../../primitives/button.js';
|
|
28
|
+
import { ConfirmDialog } from '../../../primitives/confirm-dialog.js';
|
|
29
|
+
import { EmptyState } from '../../../primitives/empty-state.js';
|
|
30
|
+
import { ErrorState } from '../../../primitives/error-state.js';
|
|
31
|
+
import { Alert as BannerAlert, AlertTitle as BannerAlertTitle, AlertDescription as BannerAlertDescription, AlertActions as BannerAlertActions } from '../../../primitives/alert.js';
|
|
32
|
+
import { Input } from '../../../primitives/input.js';
|
|
33
|
+
import { Label } from '../../../primitives/label.js';
|
|
34
|
+
import Loading from '../../../primitives/loading.js';
|
|
35
|
+
import { Modal, ModalBody, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from '../../../primitives/modal.js';
|
|
36
|
+
import { Select, SelectContent, SelectItem, SelectSeparator, SelectTrigger, SelectValue } from '../../../primitives/select.js';
|
|
37
|
+
import { SettingsSubsectionHeader } from '../../../primitives/settings-subsection-header.js';
|
|
38
|
+
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
39
|
+
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
40
|
+
import { PermissionPicker, formatShortDate, localizedRelativeTime } from './tokens-tab.js';
|
|
41
|
+
const KEYS_QUERY = (workspaceId) => ['workspace-keys', workspaceId];
|
|
42
|
+
const STATUS_BADGE = { active: 'success', expired: 'update', revoked: 'muted' };
|
|
43
|
+
const ACTS_AS_ICON = { me: UserIcon, agent: RobotIcon, bot: TerminalWindowIcon };
|
|
44
|
+
function isMfaRequired(error) {
|
|
45
|
+
return error?.code === 'account_mfa_required';
|
|
46
|
+
}
|
|
47
|
+
/** "You", "Agent · reporter" or "Bot · ci". */
|
|
48
|
+
function useActsAsLabel() {
|
|
49
|
+
const t = useTranslations('workspaces.settings.keys');
|
|
50
|
+
return (actsAs) => actsAs.type === 'me'
|
|
51
|
+
? t('rowYou')
|
|
52
|
+
: actsAs.type === 'agent'
|
|
53
|
+
? t('rowAgent', { name: actsAs.name ?? '' })
|
|
54
|
+
: t('rowBot', { name: actsAs.name ?? '' });
|
|
55
|
+
}
|
|
56
|
+
export function WorkspaceKeysSection({ workspaceId, accountId, heading = true, }) {
|
|
57
|
+
const t = useTranslations('workspaces.settings.keys');
|
|
58
|
+
const tTokens = useTranslations('settings.tokens');
|
|
59
|
+
const tWorkspaces = useTranslations('workspaces.settings');
|
|
60
|
+
const locale = useLocale();
|
|
61
|
+
const queryClient = useQueryClient();
|
|
62
|
+
const actsAsLabel = useActsAsLabel();
|
|
63
|
+
const [createOpen, setCreateOpen] = useState(false);
|
|
64
|
+
const [pending, setPending] = useState(null);
|
|
65
|
+
const [mountAt] = useState(() => Date.now());
|
|
66
|
+
const keysQuery = useQuery({
|
|
67
|
+
queryKey: KEYS_QUERY(workspaceId),
|
|
68
|
+
queryFn: () => listWorkspaceKeys(workspaceId),
|
|
69
|
+
staleTime: 30_000,
|
|
70
|
+
});
|
|
71
|
+
const now = keysQuery.dataUpdatedAt || mountAt;
|
|
72
|
+
const refresh = () => queryClient.invalidateQueries({ queryKey: KEYS_QUERY(workspaceId) });
|
|
73
|
+
const revoke = useMutation({
|
|
74
|
+
mutationFn: ({ key, action }) => revokeWorkspaceKey(workspaceId, key.key_id, { deleteRevoked: action === 'delete' }),
|
|
75
|
+
onSuccess: (_result, { action }) => {
|
|
76
|
+
successToast(action === 'delete' ? tTokens('keyDeleted') : tTokens('keyRevoked'));
|
|
77
|
+
refresh();
|
|
78
|
+
setPending(null);
|
|
79
|
+
},
|
|
80
|
+
onError: (err, { action }) => errorToast(err.message || (action === 'delete' ? tTokens('deleteFailed') : tTokens('revokeFailed'))),
|
|
81
|
+
});
|
|
82
|
+
const list = keysQuery.data;
|
|
83
|
+
const keys = sortKeys(list?.keys ?? [], now);
|
|
84
|
+
const accessLabel = (key) => key.scope === 'read'
|
|
85
|
+
? tWorkspaces('keyAccessRead')
|
|
86
|
+
: key.scope === 'custom'
|
|
87
|
+
? tWorkspaces('keyAccessCustomCount', { count: key.workspace_permissions?.length ?? 0 })
|
|
88
|
+
: tWorkspaces('keyAccessFull');
|
|
89
|
+
const relative = (iso) => localizedRelativeTime(iso, locale, now);
|
|
90
|
+
const newKeyButton = (variant) => (_jsxs(Button, { size: "sm", variant: variant, className: "gap-1.5", onClick: () => setCreateOpen(true), children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), t('newKey')] }));
|
|
91
|
+
let body;
|
|
92
|
+
if (keysQuery.isLoading) {
|
|
93
|
+
body = (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-14 rounded-md" }), _jsx(Skeleton, { className: "h-14 rounded-md" })] }));
|
|
94
|
+
}
|
|
95
|
+
else if (keysQuery.isError) {
|
|
96
|
+
body = isMfaRequired(keysQuery.error) ? (_jsxs(BannerAlert, { variant: "warning", children: [_jsx(BannerAlertTitle, { children: tTokens('confirmIdentity') }), _jsx(BannerAlertDescription, { children: tTokens('mfaDescription') }), _jsx(BannerAlertActions, { children: _jsx(Button, { variant: "outline", size: "sm", onClick: () => window.dispatchEvent(new CustomEvent(MFA_REQUIRED_EVENT)), children: tTokens('verify') }) })] })) : (_jsx(ErrorState, { size: "sm", title: tTokens('loadFailed'), description: keysQuery.error instanceof Error ? keysQuery.error.message : undefined, action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => keysQuery.refetch(), children: tTokens('retry') }) }));
|
|
97
|
+
}
|
|
98
|
+
else if (keys.length === 0) {
|
|
99
|
+
body = _jsx(EmptyState, { icon: KeyIcon, size: "sm", title: t('emptyTitle'), description: t('emptyDescription'), action: newKeyButton('outline') });
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
body = (
|
|
103
|
+
// One card of flat rows, the key list's established layout.
|
|
104
|
+
_jsxs("div", { className: "bg-surface overflow-hidden rounded-lg border", children: [_jsxs("div", { className: "flex h-12 items-center justify-between gap-3 border-b pr-2 pl-4", children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: t('count', { count: keys.length }) }), heading ? null : newKeyButton('ghost')] }), _jsx("ul", { className: "divide-y", "aria-label": t('title'), children: keys.map((key) => {
|
|
105
|
+
const status = keyStatus(key, now);
|
|
106
|
+
const action = keyRowAction(key, list?.can_manage_principals === true, now);
|
|
107
|
+
const Icon = ACTS_AS_ICON[key.acts_as.type];
|
|
108
|
+
const kebab = action
|
|
109
|
+
? [
|
|
110
|
+
{
|
|
111
|
+
label: action === 'revoke' ? tTokens('revokeKey') : tTokens('deleteKey'),
|
|
112
|
+
icon: action === 'revoke' ? _jsx(ProhibitIcon, { className: "size-3.5 shrink-0" }) : _jsx(TrashIcon, { className: "size-3.5 shrink-0" }),
|
|
113
|
+
variant: 'destructive',
|
|
114
|
+
onSelect: () => setPending({ key, action }),
|
|
115
|
+
},
|
|
116
|
+
]
|
|
117
|
+
: [];
|
|
118
|
+
const meta = [
|
|
119
|
+
accessLabel(key),
|
|
120
|
+
key.last_used_at ? tTokens('lastUsed', { time: relative(key.last_used_at) }) : tTokens('neverUsed'),
|
|
121
|
+
status === 'revoked'
|
|
122
|
+
? tTokens('status.revoked')
|
|
123
|
+
: key.expires_at
|
|
124
|
+
? status === 'expired'
|
|
125
|
+
? tTokens('expiredAt', { time: relative(key.expires_at) })
|
|
126
|
+
: tTokens('expiresAt', { time: relative(key.expires_at) })
|
|
127
|
+
: tTokens('neverExpires'),
|
|
128
|
+
key.acts_as.type !== 'me' && key.created_by_email
|
|
129
|
+
? t('createdBy', { email: key.created_by_email })
|
|
130
|
+
: tTokens('createdOn', { date: formatShortDate(key.created_at, locale) }),
|
|
131
|
+
];
|
|
132
|
+
return (_jsxs("li", { className: "flex items-center gap-3 px-4 py-3", "data-acts-as": key.acts_as.type, children: [_jsx("span", { className: "bg-muted text-muted-foreground flex size-8 shrink-0 items-center justify-center rounded-md", children: _jsx(Icon, { className: "size-4" }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: key.name }), _jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: actsAsLabel(key.acts_as) }), status !== 'active' ? (_jsx(Badge, { variant: STATUS_BADGE[status], size: "sm", children: tTokens(`status.${status}`) })) : null] }), _jsxs("span", { className: "text-muted-foreground block truncate text-xs", children: [_jsx("span", { className: "font-mono", children: key.public_key }), " \u00B7 ", meta.join(' · ')] })] }), kebab.length > 0 ? _jsx(RowKebab, { items: kebab, label: tTokens('actionsFor', { name: key.name }) }) : null] }, key.key_id));
|
|
133
|
+
}) })] }));
|
|
134
|
+
}
|
|
135
|
+
return (_jsxs("section", { className: "mx-auto w-full max-w-2xl space-y-4", children: [heading ? _jsx(SettingsSubsectionHeader, { title: t('title'), description: t('description'), action: newKeyButton('secondary') }) : null, body, _jsx(CreateWorkspaceKeyDialog, { workspaceId: workspaceId, accountId: accountId, list: list ?? null, open: createOpen, onOpenChange: setCreateOpen, onCreated: refresh }), _jsx(ConfirmDialog, { open: !!pending, onOpenChange: (open) => {
|
|
136
|
+
if (!open)
|
|
137
|
+
setPending(null);
|
|
138
|
+
}, title: pending?.action === 'delete' ? tTokens('deleteTitle') : tTokens('revokeTitle'), description: pending
|
|
139
|
+
? pending.action === 'delete'
|
|
140
|
+
? tTokens('deleteDescription', { name: pending.key.name })
|
|
141
|
+
: tTokens('revokeDescription', { name: pending.key.name })
|
|
142
|
+
: '', confirmLabel: pending?.action === 'delete' ? tTokens('deleteKey') : tTokens('revoke'), confirmVariant: "destructive", isPending: revoke.isPending, onConfirm: () => {
|
|
143
|
+
if (pending)
|
|
144
|
+
revoke.mutate(pending);
|
|
145
|
+
} })] }));
|
|
146
|
+
}
|
|
147
|
+
/** Create, then show the secret once, in one modal (a one-time secret is never lost to a reopen). */
|
|
148
|
+
function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenChange, onCreated, }) {
|
|
149
|
+
const t = useTranslations('workspaces.settings.keys');
|
|
150
|
+
const tTokens = useTranslations('settings.tokens');
|
|
151
|
+
const tWorkspaces = useTranslations('workspaces.settings');
|
|
152
|
+
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
153
|
+
const common = useTranslations('common');
|
|
154
|
+
const actsAsLabel = useActsAsLabel();
|
|
155
|
+
const [name, setName] = useState('');
|
|
156
|
+
const [draft, setDraft] = useState({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
|
|
157
|
+
const [access, setAccess] = useState('full');
|
|
158
|
+
const [picked, setPicked] = useState(() => new Set());
|
|
159
|
+
const [expiry, setExpiry] = useState('');
|
|
160
|
+
const [created, setCreated] = useState(null);
|
|
161
|
+
const submitInFlight = useRef(false);
|
|
162
|
+
const options = actsAsOptions(list);
|
|
163
|
+
const blockLabel = (block) => block === 'needs_permission' ? t('needsPermission') : block === 'no_agents' ? t('noAgents') : null;
|
|
164
|
+
const permissionsQuery = useQuery({
|
|
165
|
+
queryKey: ['iam-permissions', workspaceId],
|
|
166
|
+
queryFn: () => listPermissions(workspaceId),
|
|
167
|
+
enabled: open && access === 'custom',
|
|
168
|
+
staleTime: 5 * 60_000,
|
|
169
|
+
retry: false,
|
|
170
|
+
});
|
|
171
|
+
const policyQuery = useQuery({
|
|
172
|
+
queryKey: ['iam-pat-policy', accountId],
|
|
173
|
+
queryFn: () => getPatPolicy(accountId),
|
|
174
|
+
staleTime: 30_000,
|
|
175
|
+
enabled: open,
|
|
176
|
+
retry: false,
|
|
177
|
+
});
|
|
178
|
+
const policy = policyQuery.data ?? null;
|
|
179
|
+
const expiryChoices = keyExpiryOptions(policy, tI18nComplete).map((choice) => ({
|
|
180
|
+
...choice,
|
|
181
|
+
label: Number.isNaN(Number(choice.value))
|
|
182
|
+
? tTokens('expiryNever')
|
|
183
|
+
: Number(choice.value) === 365
|
|
184
|
+
? tTokens('expiryOneYear')
|
|
185
|
+
: tTokens('expiryDays', { count: Number(choice.value) }),
|
|
186
|
+
}));
|
|
187
|
+
const selectedExpiry = expiryChoices.some((o) => o.value === expiry) ? expiry : defaultKeyExpiryOption(policy, tI18nComplete);
|
|
188
|
+
const principal = actsAsInput(draft);
|
|
189
|
+
const ready = !!name.trim() && !!principal && !(access === 'custom' && picked.size === 0);
|
|
190
|
+
const pickedBot = draft.actsAs === 'bot' && draft.bot && draft.bot !== NEW_BOT ? list?.bots.find((b) => b.bot_id === draft.bot) : undefined;
|
|
191
|
+
const mutation = useMutation({
|
|
192
|
+
mutationFn: () => createWorkspaceKey(workspaceId, {
|
|
193
|
+
name: name.trim(),
|
|
194
|
+
actsAs: principal,
|
|
195
|
+
scopes: access === 'custom' ? [...picked] : access,
|
|
196
|
+
expiresAt: keyExpiresAt(selectedExpiry),
|
|
197
|
+
}),
|
|
198
|
+
onSuccess: (key) => {
|
|
199
|
+
onCreated();
|
|
200
|
+
setCreated(key);
|
|
201
|
+
},
|
|
202
|
+
onError: (err) => errorToast(err.message || tTokens('createFailed')),
|
|
203
|
+
onSettled: () => {
|
|
204
|
+
submitInFlight.current = false;
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
function close() {
|
|
208
|
+
onOpenChange(false);
|
|
209
|
+
setTimeout(() => {
|
|
210
|
+
setName('');
|
|
211
|
+
setDraft({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
|
|
212
|
+
setAccess('full');
|
|
213
|
+
setPicked(new Set());
|
|
214
|
+
setExpiry('');
|
|
215
|
+
setCreated(null);
|
|
216
|
+
}, 200);
|
|
217
|
+
}
|
|
218
|
+
const hint = draft.actsAs === 'me' ? t('actsAsMeHint') : draft.actsAs === 'agent' ? t('actsAsAgentHint') : t('actsAsBotHint');
|
|
219
|
+
return (_jsx(Modal, { open: open, onOpenChange: (next) => {
|
|
220
|
+
if (mutation.isPending)
|
|
221
|
+
return;
|
|
222
|
+
if (!next)
|
|
223
|
+
close();
|
|
224
|
+
else
|
|
225
|
+
onOpenChange(true);
|
|
226
|
+
}, children: _jsx(ModalContent, { className: "lg:max-w-lg", closeLabel: common('close'), children: created ? (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: tTokens('copyNow') }), _jsx(ModalDescription, { children: t('createdDescription', { name: created.name, actsAs: actsAsLabel(created.acts_as) }) })] }), _jsx(ModalBody, { children: _jsx(CopyRow, { value: created.secret_key, successMessage: tTokens('keyCopied') }) }), _jsx(ModalFooter, { children: _jsx(Button, { type: "button", size: "sm", onClick: close, children: tTokens('done') }) })] })) : (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: t('newKey') }), _jsx(ModalDescription, { children: t('description') })] }), _jsxs("form", { onSubmit: (event) => {
|
|
227
|
+
event.preventDefault();
|
|
228
|
+
if (!ready || mutation.isPending || submitInFlight.current)
|
|
229
|
+
return;
|
|
230
|
+
submitInFlight.current = true;
|
|
231
|
+
mutation.mutate();
|
|
232
|
+
}, children: [_jsxs(ModalBody, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-name", children: tTokens('name') }), _jsx(Input, { id: "workspace-key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: tTokens('namePlaceholder'), disabled: mutation.isPending, maxLength: 128, autoFocus: true, variant: "popover" })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-acts-as", children: t('actsAs') }), _jsxs(Select, { value: draft.actsAs, onValueChange: (value) => setDraft((d) => ({ ...d, actsAs: value })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-acts-as", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: options.map((option) => (_jsx(SelectItem, { value: option.value, disabled: option.block !== null, description: blockLabel(option.block) ?? undefined, children: option.value === 'me' ? t('actsAsMe') : option.value === 'agent' ? t('actsAsAgent') : t('actsAsBot') }, option.value))) })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: hint })] }), draft.actsAs === 'agent' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-agent", children: t('agent') }), _jsxs(Select, { value: draft.agent, onValueChange: (agent) => setDraft((d) => ({ ...d, agent })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-agent", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('agentPlaceholder') }) }), _jsx(SelectContent, { children: (list?.agents ?? []).map((agent) => (_jsx(SelectItem, { value: agent.name, children: agent.name }, agent.name))) })] })] })) : null, draft.actsAs === 'bot' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-bot", children: t('bot') }), _jsxs(Select, { value: draft.bot, onValueChange: (bot) => setDraft((d) => ({ ...d, bot })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-bot", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('botPlaceholder') }) }), _jsxs(SelectContent, { children: [(list?.bots ?? []).map((bot) => (_jsx(SelectItem, { value: bot.bot_id, children: bot.name }, bot.bot_id))), (list?.bots.length ?? 0) > 0 ? _jsx(SelectSeparator, {}) : null, _jsx(SelectItem, { value: NEW_BOT, children: t('newBot') })] })] }), draft.bot === NEW_BOT ? (_jsxs(_Fragment, { children: [_jsx(Input, { "aria-label": t('newBotName'), value: draft.newBotName, onChange: (event) => setDraft((d) => ({ ...d, newBotName: event.target.value })), placeholder: t('newBotNamePlaceholder'), maxLength: 128, disabled: mutation.isPending, variant: "popover" }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('newBotHint') })] })) : pickedBot && !pickedBot.has_role ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('botNoRole') })) : null] })) : null, _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-access", children: tWorkspaces('keyAccess') }), _jsxs(Select, { value: access, onValueChange: (value) => setAccess(value), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-access", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "full", children: tWorkspaces('keyAccessFull') }), _jsx(SelectItem, { value: "read", children: tWorkspaces('keyAccessRead') }), _jsx(SelectItem, { value: "custom", children: tWorkspaces('keyAccessCustom') })] })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: access === 'read' ? tWorkspaces('keyAccessReadHint') : access === 'custom' ? t('accessCustomHint') : t('accessFullHint') }), access === 'custom' ? (_jsx(PermissionPicker, { query: permissionsQuery, picked: picked, onToggle: (action, on) => setPicked((prev) => {
|
|
233
|
+
const next = new Set(prev);
|
|
234
|
+
if (on)
|
|
235
|
+
next.add(action);
|
|
236
|
+
else
|
|
237
|
+
next.delete(action);
|
|
238
|
+
return next;
|
|
239
|
+
}), disabled: mutation.isPending })) : null] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-expiry", children: tTokens('expires') }), _jsxs(Select, { value: selectedExpiry, onValueChange: setExpiry, disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-expiry", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: expiryChoices.map((choice) => (_jsx(SelectItem, { value: choice.value, children: choice.label }, choice.value))) })] }), policy?.require_expiry ? _jsx("p", { className: "text-muted-foreground text-xs", children: tTokens('expiryRequired') }) : null] })] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: close, disabled: mutation.isPending, children: tTokens('cancel') }), _jsxs(Button, { type: "submit", size: "sm", disabled: !ready || mutation.isPending, className: "gap-1.5", children: [mutation.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tTokens('createKey')] })] })] })] })) }) }));
|
|
240
|
+
}
|
|
@@ -225,7 +225,9 @@ export function CapabilityLibrary({ projectId, view, agent, footer, }) {
|
|
|
225
225
|
const shownProject = project;
|
|
226
226
|
const shownBuiltin = builtinGroups.filter((g) => g.items.length > 0);
|
|
227
227
|
const projectSections = (_jsxs(_Fragment, { children: [shownProject.length > 0 ? cardGrid('project', t('groups.project'), shownProject, false) : null, shownBuiltin.map((g) => cardGrid(g.group, t(`groups.${g.group}`), g.items, true)), shownProject.length === 0 && shownBuiltin.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: search ? t('noMatch') : empty })) : null] }));
|
|
228
|
-
const body = catalog && railCard ? (_jsx("div", { "data-testid": `capability-library-${view}`, "data-grant": JSON.stringify(agent?.editor.draft[view] ?? null), children: cardRows.length > 0 ? (_jsx(AccessList, { items: cardRows })) : (_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: search ? t('noMatch') : empty })) })) : catalog ? (_jsx("div", { className: "space-y-6", "data-testid": `capability-library-${view}`, "data-grant": agent ? JSON.stringify(agent.editor.draft[view] ?? null) : undefined, children: agent ? agentSections : projectSections })) : query.isError ? (_jsx(ErrorState, { size: "sm",
|
|
228
|
+
const body = catalog && railCard ? (_jsx("div", { "data-testid": `capability-library-${view}`, "data-grant": JSON.stringify(agent?.editor.draft[view] ?? null), children: cardRows.length > 0 ? (_jsx(AccessList, { items: cardRows })) : (_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: search ? t('noMatch') : empty })) })) : catalog ? (_jsx("div", { className: "space-y-6", "data-testid": `capability-library-${view}`, "data-grant": agent ? JSON.stringify(agent.editor.draft[view] ?? null) : undefined, children: agent ? agentSections : projectSections })) : query.isError ? (_jsx(ErrorState, { size: "sm",
|
|
229
|
+
// Workspace Skills names its own list; an agent's page loads all three at once.
|
|
230
|
+
title: !agent && view === 'skills' ? t('skillsLoadError') : t('loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => void query.refetch(), children: t('retry') }) })) : !agent ? (
|
|
229
231
|
// Project admin loads into the same card grid it renders.
|
|
230
232
|
_jsx(CatalogGridSkeleton, { count: 6 })) : (_jsx(EditorList, { children: [0, 1, 2, 3].map((i) => (_jsx("li", { className: "flex min-h-12 items-center gap-3 px-4 py-2", children: _jsx(Skeleton, { className: "h-4 w-40 rounded-sm" }) }, i))) }));
|
|
231
233
|
return (_jsxs(CapabilityPageShell, { title: t(VIEW_COPY[view].titleKey), description: agent ? t(`${view}Description`) : t(`${view}ProjectDescription`), action: skills.createButton, search: _jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(MagnifyingGlassIcon, {}) }), _jsx(InputGroupSearchInput, { placeholder: t(`${view}Search`), value: search, onChange: (event) => setSearch(event.target.value), size: "sm" }), search ? _jsx(InputGroupSearchClear, { onClick: () => setSearch('') }) : null] }), filters: agent ? (grant ? _jsx(GrantModeTabs, { grant: grant, label: t(VIEW_COPY[view].access), agentName: agent.name }) : undefined) : undefined, children: [body, footer, skills.modals, view === 'skills' && !agent ? (_jsx(BuiltinSkillModal, { projectId: projectId, name: builtinSkill, description: (() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslations } from '../../../i18n/index.js';
|
|
3
3
|
import { CountBadge } from '../../../primitives/count-badge.js';
|
|
4
|
-
import { Tabs,
|
|
4
|
+
import { Tabs, TabsList, TabsTrigger } from '../../../primitives/tabs.js';
|
|
5
5
|
/** The sentinel filter value that shows every space (grouped). */
|
|
6
6
|
export const ALL_SPACES = 'all';
|
|
7
7
|
/**
|
|
@@ -16,5 +16,5 @@ export function CatalogSpaceTabs({ groups, value, onValueChange, }) {
|
|
|
16
16
|
const hasRealSplit = groups.some((g) => !g.isDefault);
|
|
17
17
|
if (!hasRealSplit)
|
|
18
18
|
return null;
|
|
19
|
-
return (_jsx(Tabs, { value: value, onValueChange: onValueChange, children: _jsxs(
|
|
19
|
+
return (_jsx(Tabs, { value: value, onValueChange: onValueChange, children: _jsxs(TabsList, { size: "xs", "aria-label": t('filter'), children: [_jsx(TabsTrigger, { value: ALL_SPACES, children: t('all') }), groups.map((group) => (_jsxs(TabsTrigger, { value: group.name, children: [group.label, _jsx(CountBadge, { count: group.items.length, tone: "neutral" })] }, group.name)))] }) }));
|
|
20
20
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
/** True under `CustomizeFrame`: the bar above holds the title-bar row and the sidebar opener. */
|
|
3
3
|
export declare function useInCustomizeFrame(): boolean;
|
|
4
|
-
/** The bar, then the page. Every Customize
|
|
5
|
-
*
|
|
4
|
+
/** The bar, then the page. Every Customize route renders through it, the
|
|
5
|
+
* Agents list and each agent's page included. */
|
|
6
6
|
export declare function CustomizeFrame({ projectId, children }: {
|
|
7
7
|
projectId: string;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}): import("react").JSX.Element;
|
|
10
|
+
/** Workspace settings' frame: the title-bar row with the sidebar opener and the panel's name, then the panel. */
|
|
11
|
+
export declare function SettingsFrame({ children }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
10
14
|
export declare function CustomizeTabBar({ projectId }: {
|
|
11
15
|
projectId: string;
|
|
12
16
|
}): import("react").JSX.Element;
|
|
@@ -1,56 +1,59 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* Customize's top bar, over every Customize
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* no second column beside the sidebar. A library tab opens its Project admin
|
|
10
|
-
* page full width; Settings opens Project admin's settings sections, which
|
|
11
|
-
* keep a short sub-nav of their own.
|
|
4
|
+
* Customize's top bar, over every Customize page, the agent pages included:
|
|
5
|
+
* Agents, a separator, the workspace's libraries (each a link into its section
|
|
6
|
+
* of Workspace settings), Review, then one "Workspace settings" link on the
|
|
7
|
+
* right. Prod's layout (Jay, 2026-10-29): one row of tabs, no second column
|
|
8
|
+
* beside the sidebar.
|
|
12
9
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* title-bar row
|
|
10
|
+
* Workspace settings (`/workspaces/<id>/admin/<section>`) draws no tab bar:
|
|
11
|
+
* its one rail is the navigation (design.md §3.2 C7). `SettingsFrame` gives it
|
|
12
|
+
* the same title-bar row (the sidebar opener and the window's drag region)
|
|
13
|
+
* with the panel's name only.
|
|
14
|
+
*
|
|
15
|
+
* Both frames tell the page headers below (`useInCustomizeFrame`) that the
|
|
16
|
+
* bar is the window's title-bar row and holds the sidebar opener, so they do
|
|
17
|
+
* not draw a second.
|
|
16
18
|
*
|
|
17
19
|
* The tabs a caller sees follow the same rules as the pages: Review and
|
|
18
20
|
* Settings by `capabilityAccess`, each library by its row's capability
|
|
19
21
|
* and the `drives` flag (`PROJECT_ADMIN_RESOURCES`).
|
|
20
22
|
*/
|
|
21
|
-
import {
|
|
22
|
-
import { contract, qk, useFeatureFlag } from '@kortix/sdk/react';
|
|
23
|
-
import { ArrowUpRightIcon } from '@phosphor-icons/react';
|
|
24
|
-
import { useQuery } from '@tanstack/react-query';
|
|
23
|
+
import { useFeatureFlag } from '@kortix/sdk/react';
|
|
25
24
|
import { createContext, useContext } from 'react';
|
|
26
25
|
import { useTranslations } from '../../i18n/index.js';
|
|
27
|
-
import { HubLink } from '../../internal/account-hub/account-hub-location.js';
|
|
28
26
|
import { useCapabilityAccess } from '../../internal/layout/project-settings-nav.js';
|
|
29
27
|
import { SidebarToggle } from '../../internal/layout/sidebar-toggle.js';
|
|
30
28
|
import { capabilityTabHref } from '../../internal/lib/capability-tab-routes.js';
|
|
31
29
|
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
32
30
|
import { useProjectPageCans } from '../../internal/lib/use-project-can.js';
|
|
33
31
|
import { cn } from '../../internal/lib/utils.js';
|
|
34
|
-
import { hubTarget } from '../../internal/stores/account-panel-store.js';
|
|
35
32
|
import { adminPath } from '../../lib/routes.js';
|
|
36
33
|
import { FadedScrollArea } from '../../primitives/faded-scroll-area.js';
|
|
37
34
|
import { useOptionalSidebar } from '../../primitives/sidebar.js';
|
|
38
35
|
import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
|
|
39
36
|
import { UiLink as Link, useUiPathname } from '../../providers/ui-provider.js';
|
|
40
|
-
import { PROJECT_ADMIN_RESOURCES,
|
|
37
|
+
import { PROJECT_ADMIN_RESOURCES, isProjectAdminResource, parseProjectAdminSection, projectAdminHref, sectionLabelKey, } from '../project-settings/project-admin-sections.js';
|
|
41
38
|
import { receivedDenial } from './capability-access-gate.js';
|
|
42
39
|
const InCustomizeFrame = createContext(false);
|
|
43
40
|
/** True under `CustomizeFrame`: the bar above holds the title-bar row and the sidebar opener. */
|
|
44
41
|
export function useInCustomizeFrame() {
|
|
45
42
|
return useContext(InCustomizeFrame);
|
|
46
43
|
}
|
|
47
|
-
/** The bar, then the page. Every Customize
|
|
48
|
-
*
|
|
44
|
+
/** The bar, then the page. Every Customize route renders through it, the
|
|
45
|
+
* Agents list and each agent's page included. */
|
|
49
46
|
export function CustomizeFrame({ projectId, children }) {
|
|
50
47
|
return (_jsxs(InCustomizeFrame.Provider, { value: true, children: [_jsx(CustomizeTabBar, { projectId: projectId }), children] }));
|
|
51
48
|
}
|
|
49
|
+
/** Workspace settings' frame: the title-bar row with the sidebar opener and the panel's name, then the panel. */
|
|
50
|
+
export function SettingsFrame({ children }) {
|
|
51
|
+
const tSettings = useTranslations('workspaces.settings');
|
|
52
|
+
const sidebar = useOptionalSidebar();
|
|
53
|
+
return (_jsxs(InCustomizeFrame.Provider, { value: true, children: [_jsxs("div", { className: "kx-titlebar-row kx-capability-titlebar relative flex h-11 shrink-0 items-center gap-1 border-b px-2", "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsx("h1", { className: "text-foreground truncate px-2 text-sm font-medium", children: tSettings('title') })] }), children] }));
|
|
54
|
+
}
|
|
52
55
|
const TAB_CLASS = 'w-fit flex-none px-1 py-3';
|
|
53
|
-
const
|
|
56
|
+
const SETTINGS_LINK_CLASS = 'text-muted-foreground hover:text-foreground flex w-fit flex-none items-center gap-1 px-1 py-3 text-sm font-medium whitespace-nowrap transition-colors';
|
|
54
57
|
/** The active tab: `/admin/<library>` that library, Review, or any settings section Settings. */
|
|
55
58
|
function activeTab(pathname) {
|
|
56
59
|
if (/\/customize\/agents(\/|$)/.test(pathname))
|
|
@@ -63,23 +66,22 @@ function activeTab(pathname) {
|
|
|
63
66
|
return '';
|
|
64
67
|
return isProjectAdminResource(key) ? key : 'settings';
|
|
65
68
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
/**
|
|
70
|
+
* The one way from Customize into Workspace settings. A caller who may not
|
|
71
|
+
* open General (a member who reads Members only) lands on the first section
|
|
72
|
+
* they may open: `/admin` picks it.
|
|
73
|
+
*/
|
|
74
|
+
function WorkspaceSettingsLink({ projectId, config }) {
|
|
75
|
+
const tSettings = useTranslations('workspaces.settings');
|
|
73
76
|
const canReadMembers = useProjectPageCans(projectId)[PROJECT_ACTIONS.PROJECT_MEMBERS_READ];
|
|
74
|
-
|
|
75
|
-
if (receivedDenial(canReadMembers) || !accountId)
|
|
77
|
+
if (!config && receivedDenial(canReadMembers))
|
|
76
78
|
return null;
|
|
77
|
-
return (
|
|
79
|
+
return (_jsx(Link, { href: adminPath(projectId), prefetch: true, className: SETTINGS_LINK_CLASS, children: tSettings('title') }));
|
|
78
80
|
}
|
|
79
81
|
export function CustomizeTabBar({ projectId }) {
|
|
80
82
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
81
83
|
const tTabs = useTranslations('agentEditor.tabs');
|
|
82
|
-
const
|
|
84
|
+
const tSettings = useTranslations('workspaces.settings');
|
|
83
85
|
const pathname = useUiPathname() ?? '';
|
|
84
86
|
const sidebar = useOptionalSidebar();
|
|
85
87
|
const access = useCapabilityAccess(projectId);
|
|
@@ -88,7 +90,6 @@ export function CustomizeTabBar({ projectId }) {
|
|
|
88
90
|
const libraries = PROJECT_ADMIN_RESOURCES.filter((r) => !r.host && (!r.capability || allowed.has(r.capability)) && (r.flag !== 'drives' || drives.enabled));
|
|
89
91
|
const tab = (value, href, label) => (_jsx(TabsTrigger, { value: value, asChild: true, className: TAB_CLASS, children: _jsx(Link, { href: href, prefetch: true, children: label }) }, value));
|
|
90
92
|
return (_jsxs("div", { className: "kx-titlebar-row kx-capability-titlebar relative flex shrink-0 items-center gap-1 border-b px-2", "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [_jsx(SidebarToggle, {}), _jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", rootClassName: "min-w-0 flex-1", children: _jsx(Tabs, { value: activeTab(pathname), className: "w-max min-w-full", children: _jsxs(TabsList, { type: "underline", underlineSize: "md", size: "lg", className: cn('h-auto w-full justify-start gap-5 border-b-0 px-2', !access.settled && 'invisible'), "aria-busy": !access.settled || undefined, children: [allowed.has('agent') ? (_jsxs(_Fragment, { children: [tab('agents', capabilityTabHref(projectId, 'agent'), tI18nComplete.raw('text279b44d2ab4b')), _jsx("span", { "aria-hidden": true, className: "bg-border h-4 w-px shrink-0 self-center" })] })) : null, libraries.map((r) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}), allowed.has('review') ? tab('review', capabilityTabHref(projectId, 'review'), tTabs('review')) : null, _jsxs("span", { className: "ml-auto flex items-center gap-5", children: [_jsx(MembersLink, { projectId: projectId }), allowed.has('config') ? tab('settings', adminPath(projectId, 'general'), tTabs('settings')) : null] })] }) }) })] }));
|
|
93
|
+
return tab(r.key, projectAdminHref(projectId, r.key), tSettings(`sections.${sectionLabelKey(r.key)}`));
|
|
94
|
+
}), allowed.has('review') ? tab('review', capabilityTabHref(projectId, 'review'), tTabs('review')) : null, _jsx("span", { className: "ml-auto flex items-center gap-5", children: _jsx(WorkspaceSettingsLink, { projectId: projectId, config: allowed.has('config') }) })] }) }) })] }));
|
|
94
95
|
}
|
|
@@ -48,7 +48,7 @@ export function projectCapabilityNavTarget(tab) {
|
|
|
48
48
|
// `'members'` — not a `CapabilityTab['key']`: Members graduated off the
|
|
49
49
|
// project entirely, onto the account hub's Access tab. Still named here
|
|
50
50
|
// (rather than left to the `isAccountGraduatedSection` fallback) so the
|
|
51
|
-
// result routes through `/
|
|
51
|
+
// result routes through `/workspaces/<id>/members` — the redirect route that
|
|
52
52
|
// already knows how to resolve `account_id` and append the `&project=`
|
|
53
53
|
// scoping — instead of duplicating that resolution here.
|
|
54
54
|
if (tab === 'members')
|
|
@@ -105,7 +105,7 @@ export function buildStandaloneCapabilityNav(state) {
|
|
|
105
105
|
// this branch, `tab` matched none of the checks above or below and the
|
|
106
106
|
// click did nothing at all. Deliberately NOT `legacySectionRedirect` —
|
|
107
107
|
// that helper's own fallback also resolves overlay-still ids
|
|
108
|
-
// (`preferences` -> `/
|
|
108
|
+
// (`preferences` -> `/workspaces/<id>/settings/preferences`, a route),
|
|
109
109
|
// which would bypass the store-based `openSettings()` call below and
|
|
110
110
|
// break this adapter's "opens the overlay, not a route" contract.
|
|
111
111
|
if (state.accountId && isAccountGraduatedSection(tab)) {
|
|
@@ -101,7 +101,7 @@ export declare function describeConditions(filter: Record<string, string> | null
|
|
|
101
101
|
* these were two tabs of the Settings overlay — every pane in that overlay
|
|
102
102
|
* takes its title and description from its rail entry, and being the one
|
|
103
103
|
* exception is what let the copy drift before. They are capability PAGES now
|
|
104
|
-
* (`/
|
|
104
|
+
* (`/workspaces/<id>/schedules`, `/workspaces/<id>/webhooks`), not panes, so they
|
|
105
105
|
* have no rail entry to read: a rail lookup that finds nothing renders no
|
|
106
106
|
* heading and throws nothing, which is exactly the silent failure to avoid.
|
|
107
107
|
* The copy is the wording those rail entries carried, moved verbatim.
|
|
@@ -16,7 +16,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
16
16
|
* are off (the beta flag `event_triggers`, Project admin › Feature flags).
|
|
17
17
|
*/
|
|
18
18
|
import { Button } from '../../../primitives/button.js';
|
|
19
|
-
import {
|
|
19
|
+
import { Alert as BannerAlert, AlertDescription as BannerAlertDescription, AlertActions as BannerAlertActions } from '../../../primitives/alert.js';
|
|
20
20
|
import { Input } from '../../../primitives/input.js';
|
|
21
21
|
import { Label } from '../../../primitives/label.js';
|
|
22
22
|
import Loading from '../../../primitives/loading.js';
|
|
@@ -26,12 +26,11 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../primitives/ta
|
|
|
26
26
|
import { successToast } from '../../../primitives/toast.js';
|
|
27
27
|
import { agentDisplayLabel } from '../../../session/composer/session-chat-input.js';
|
|
28
28
|
import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
|
|
29
|
-
import { useProjectFeatureFlags } from '../../../internal/lib/use-project-feature-flags.js';
|
|
30
29
|
import { UiLink as Link, useUiViewerId } from '../../../providers/ui-provider.js';
|
|
31
30
|
import { uiRoutes } from '../../../lib/routes.js';
|
|
32
31
|
import { projectSettingsSectionHref } from '../../project-settings/project-settings-sections.js';
|
|
33
32
|
import { createProjectTrigger, upsertProjectSecret } from '@kortix/sdk';
|
|
34
|
-
import { modelKeyToWire, useProjectApps, useProjectTriggerEventApps, useVisibleAgents, } from '@kortix/sdk/react';
|
|
33
|
+
import { modelKeyToWire, useProjectApps, useProjectTriggerEventApps, useVisibleAgents, useFeatureFlags, } from '@kortix/sdk/react';
|
|
35
34
|
import { AppWindowIcon, GitMergeIcon, LightningIcon, TimerIcon, WebhooksLogoIcon } from '@phosphor-icons/react';
|
|
36
35
|
import { useMutation } from '@tanstack/react-query';
|
|
37
36
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -84,7 +83,7 @@ const KIND_LABEL_KEY = {
|
|
|
84
83
|
};
|
|
85
84
|
/** A source this project cannot use yet: one sentence on why, and the link that fixes it. */
|
|
86
85
|
function Unavailable({ children, action }) {
|
|
87
|
-
return (
|
|
86
|
+
return (_jsxs(BannerAlert, { variant: "default", className: "text-xs", children: [_jsx(BannerAlertDescription, { children: children }), _jsx(BannerAlertActions, { children: action })] }));
|
|
88
87
|
}
|
|
89
88
|
function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null, initialKind = null, initialApp = null, initialConnector = null, initialSpace = null, onBusyChange, }) {
|
|
90
89
|
const viewerId = useUiViewerId();
|
|
@@ -92,7 +91,7 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
92
91
|
const tComposer = useI18nTranslations('triggerComposer');
|
|
93
92
|
// Connector events are a beta feature behind the project flag `event_triggers`. Off: the tab
|
|
94
93
|
// stays and its panel says how to turn it on; no catalog request is sent.
|
|
95
|
-
const eventsOn =
|
|
94
|
+
const eventsOn = useFeatureFlags(projectId).flags.event_triggers === true;
|
|
96
95
|
const [draft, setDraft] = useState(() => ({
|
|
97
96
|
...initialDraft({
|
|
98
97
|
kind: initialKind ?? (initialApp || initialConnector ? 'event' : null),
|
|
@@ -318,5 +317,5 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
318
317
|
const pickKind = (kind) => setDraft((d) => withKind(d, kind));
|
|
319
318
|
return (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { className: "pr-12 pb-3", children: [_jsx(ModalTitle, { children: tI18nComplete.raw('texta38f4ea67a30') }), _jsx(ModalDescription, { className: "text-pretty", "aria-live": "polite", children: summarize(draft, app, agentDisplayLabel(agents, draft.agent), tI18nComplete) })] }), _jsx(ModalBody, { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4 lg:max-h-[min(calc(100dvh-13rem),44rem)] lg:flex-none", children: _jsxs("div", { ref: bodyRef, className: "space-y-8", children: [_jsxs("section", { "data-block": "when", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('textcf9c7aa24a26') }), _jsxs(Tabs, { value: draft.kind, onValueChange: pickKind, children: [_jsxs(Select, { value: draft.kind, onValueChange: pickKind, children: [_jsx(SelectTrigger, { className: "w-full cursor-pointer text-sm lg:hidden", "aria-label": tI18nComplete.raw('textcf9c7aa24a26'), children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: COMPOSER_KINDS.map((kind) => (_jsx(SelectItem, { value: kind, className: "cursor-pointer", children: _jsxs("span", { className: "flex items-center gap-1.5", children: [tabIcon(kind), kindLabel(kind)] }) }, kind))) })] }), _jsx(TabsList, { className: "hidden w-full lg:flex", children: COMPOSER_KINDS.map((kind) => (_jsxs(TabsTrigger, { value: kind, className: "flex-1 gap-1.5", children: [tabIcon(kind), kindLabel(kind)] }, kind))) }), _jsx(TabsContent, { value: "cron", className: "pt-3", children: _jsx(WhenSchedule, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "app", className: "pt-3", children: kortixApps.length > 0 || draft.kortixApp || projectApps.isLoading ? (_jsx(WhenApp, { apps: kortixApps, draft: draft, patch: patch, error: blockError('when') })) : (_jsx(Unavailable, { action: appsHref ? (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: appsHref, children: tComposer('openApps') }) })) : null, children: tComposer.rich('noApps', {
|
|
320
319
|
code: (chunks) => (_jsx("code", { className: "bg-muted text-foreground rounded-sm px-1 py-0.5 font-mono text-xs", children: chunks })),
|
|
321
|
-
}) })) }), _jsx(TabsContent, { value: "event", className: "pt-3", children: eventsOn ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(Unavailable, { action: _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: projectSettingsSectionHref(projectId, 'feature-flags'), children: tI18nComplete.raw('text20a2e59ba129') }) }), children: tComposer('eventsOff') })) }), _jsx(TabsContent, { value: "webhook", className: "pt-3", children: _jsx(WhenWebhook, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "change_request", className: "pt-3", children: _jsx(WhenChangeRequest, { draft: draft, patch: patch }) })] })] }), _jsxs("section", { "data-block": "then", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { className: "space-y-3", children: [_jsx(SectionTitle, { children: tComposer('details') }), _jsxs("div", { "data-block": "name", className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-name", className: "text-xs", children: tI18nComplete.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: tI18nComplete.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') || nameError ? true : undefined }), _jsx(InlineError, { message: blockError('name') ?? nameError })] }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: initialDraft({}).sessionAccess }), _jsx("div", { "data-block": "options", children: _jsx(TriggerOptions, { projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] }), error ? (_jsx("div", { ref: errorRef, children: _jsx(
|
|
320
|
+
}) })) }), _jsx(TabsContent, { value: "event", className: "pt-3", children: eventsOn ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(Unavailable, { action: _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: projectSettingsSectionHref(projectId, 'feature-flags'), children: tI18nComplete.raw('text20a2e59ba129') }) }), children: tComposer('eventsOff') })) }), _jsx(TabsContent, { value: "webhook", className: "pt-3", children: _jsx(WhenWebhook, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "change_request", className: "pt-3", children: _jsx(WhenChangeRequest, { draft: draft, patch: patch }) })] })] }), _jsxs("section", { "data-block": "then", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { className: "space-y-3", children: [_jsx(SectionTitle, { children: tComposer('details') }), _jsxs("div", { "data-block": "name", className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-name", className: "text-xs", children: tI18nComplete.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: tI18nComplete.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') || nameError ? true : undefined }), _jsx(InlineError, { message: blockError('name') ?? nameError })] }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: initialDraft({}).sessionAccess }), _jsx("div", { "data-block": "options", children: _jsx(TriggerOptions, { projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] }), error ? (_jsx("div", { ref: errorRef, children: _jsx(BannerAlert, { variant: "destructive", className: "text-xs", children: _jsx(BannerAlertDescription, { children: error }) }) })) : null] }) }), _jsxs(ModalFooter, { className: "mt-0 shrink-0 flex-row gap-2 border-t px-5 py-3 sm:space-x-0", children: [_jsx(Button, { variant: "ghost", size: "sm", disabled: create.isPending, onClick: () => onOpenChange(false), children: tI18nComplete.raw('text19766ed6ccb2') }), _jsxs(Button, { size: "sm", className: "gap-1.5", onClick: submit, disabled: create.isPending || unavailable, children: [create.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('texte18bbdd15a81')] })] })] }));
|
|
322
321
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { UiTranslator } from '../../../i18n/index.js';
|
|
2
2
|
import type { ProjectTrigger } from '@kortix/sdk';
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
|
-
/** "next
|
|
5
|
-
export declare function nextRunLabel(trigger: Pick<ProjectTrigger, 'type' | 'enabled' | 'next_fire_at' | 'next_cron_at' | 'auto_paused_at'>, t: UiTranslator, locale: string, now
|
|
4
|
+
/** "next in 5 minutes", "next in 3 hours", "next in 2 days"; "On event" for webhooks and app events; "Paused" while paused. */
|
|
5
|
+
export declare function nextRunLabel(trigger: Pick<ProjectTrigger, 'type' | 'enabled' | 'next_fire_at' | 'next_cron_at' | 'auto_paused_at'>, t: UiTranslator, locale: string, now: number): string;
|
|
6
6
|
export declare function TriggerList({ triggers, groups, eventNames, selectedSlug, runningSlug, onOpen, selection, projectPaused, }: {
|
|
7
7
|
triggers: ProjectTrigger[];
|
|
8
8
|
/** The trigger whose Run now is in flight: its row shows the session busy mark. */
|