@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
|
@@ -19,6 +19,8 @@ import { isPickerGroupOpen, modelItemValue, pickerGroupId, pickerGroupLabel, bui
|
|
|
19
19
|
import { modelInDefaultView } from '@kortix/sdk';
|
|
20
20
|
import { isClaudeSubscriptionModel, isSubscriptionModel, pickerModelName, shouldShowFreeTag } from './model-tags.js';
|
|
21
21
|
import { useModelConnectionGate } from './use-model-connection-gate.js';
|
|
22
|
+
import { ModelPickerPanel } from './model-picker-panel.js';
|
|
23
|
+
import { effortLabel, reasoningEffortChoices } from '../composer/reasoning-effort-selector.js';
|
|
22
24
|
// Re-export for consumers
|
|
23
25
|
export { Tag };
|
|
24
26
|
export function ConnectProviderDialog({ open, onOpenChange, providers: _providers, }) {
|
|
@@ -53,6 +55,9 @@ import { Tag } from '../../primitives/tag.js';
|
|
|
53
55
|
*/
|
|
54
56
|
function ModelRow({ model, groupProviderID, groupProviderName, isSelected, isAccountDefault, defaultControls, onSelect, scope, showSubscriptionTag = true, connectLabel, }) {
|
|
55
57
|
const t = useTranslations('modelSelector');
|
|
58
|
+
// The star sets the WORKSPACE default (the project default): a workspace
|
|
59
|
+
// is one account and its project (Workspaces, PR 1).
|
|
60
|
+
const tDefault = useTranslations('workspaces.models');
|
|
56
61
|
// Kept in the list so a default stays visible, but not runnable: the row
|
|
57
62
|
// reads "Connect" and selecting it opens the connection (KRTX-3011).
|
|
58
63
|
const unavailable = model.available === false;
|
|
@@ -88,8 +93,8 @@ function ModelRow({ model, groupProviderID, groupProviderName, isSelected, isAcc
|
|
|
88
93
|
chip — `cn` puts these last, so they win over the component's own
|
|
89
94
|
`bg-zinc-*`. */
|
|
90
95
|
className: "size-4 rounded-none bg-transparent" }), _jsxs("span", { className: cn('min-w-0 flex-1 truncate leading-tight', unavailable && 'opacity-60'), children: [_jsx("span", { className: "text-foreground font-medium", children: lead }), trail ? _jsxs("span", { className: "text-muted-foreground font-normal", children: [" ", trail] }) : null] }), unavailable ? (_jsx(Tag, { children: connectLabel })) : isFree ? (_jsx(Tag, { variant: "free", children: t('free') })) : isSubscription && showSubscriptionTag ? (_jsx(Tag, { children: t('included') })) : null, _jsxs("span", { className: "relative flex size-6 shrink-0 items-center justify-center", children: [isSelected && (_jsx(Check, { className: "text-foreground size-4 group-hover:opacity-0 group-data-[selected=true]:opacity-0" })), defaultControls && (_jsx("button", { type: "button", "aria-label": isAccountDefault
|
|
91
|
-
?
|
|
92
|
-
:
|
|
96
|
+
? tDefault('defaultAria', { model: model.modelName })
|
|
97
|
+
: tDefault('setDefaultAria', { model: model.modelName }), title: isAccountDefault ? tDefault('defaultTitle') : tDefault('setDefaultTitle'),
|
|
93
98
|
/* No `aria-pressed`: that promises a toggle, and clicking the
|
|
94
99
|
filled star does nothing. Clearing an account default is a real
|
|
95
100
|
action with a real fallback behind it, and it belongs where the
|
|
@@ -137,8 +142,9 @@ function ModelRow({ model, groupProviderID, groupProviderName, isSelected, isAcc
|
|
|
137
142
|
function GroupHeading({ children }) {
|
|
138
143
|
return _jsx("span", { className: "text-muted-foreground font-medium tracking-wide", children: children });
|
|
139
144
|
}
|
|
140
|
-
export function ModelSelector({ models, selectedModel, onSelect, defaultControls, unsetLabel, disabled = false, modelsLoading = false, triggerLabelClassName, triggerVariant = 'ghost', appearance = 'chip', offerProviderAccounts = false, open: openProp, onOpenChange, }) {
|
|
145
|
+
export function ModelSelector({ models, selectedModel, onSelect, defaultControls, unsetLabel, disabled = false, modelsLoading = false, triggerLabelClassName, triggerVariant = 'ghost', appearance = 'chip', offerProviderAccounts = false, open: openProp, onOpenChange, reasoning, }) {
|
|
141
146
|
const tModel = useTranslations('modelSelector');
|
|
147
|
+
const tDefault = useTranslations('workspaces.models');
|
|
142
148
|
const t = useTranslations('threads');
|
|
143
149
|
// Controlled when `open` is supplied, uncontrolled otherwise — Radix's own
|
|
144
150
|
// rule. `setOpen` below is the single write path every internal caller
|
|
@@ -180,7 +186,16 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
180
186
|
: resolveAvailableSelectedModel(selectedModel, isSelectableModel);
|
|
181
187
|
const current = models.find((m) => m.providerID === availableSelectedModel?.providerID &&
|
|
182
188
|
m.modelID === availableSelectedModel?.modelID);
|
|
183
|
-
|
|
189
|
+
// The pill names the model, never its plan suffix: "GPT-6 Luna", not "GPT-6 Luna (ChatGPT)".
|
|
190
|
+
const displayName = (current && pickerModelName(current)) || unsetLabel || t('noModel');
|
|
191
|
+
const effortChoices = appearance === 'chip'
|
|
192
|
+
? reasoningEffortChoices(reasoning?.variants, !!reasoning?.onVariantChange)
|
|
193
|
+
: [];
|
|
194
|
+
const showEffort = effortChoices.length > 0 && !!reasoning?.onVariantChange;
|
|
195
|
+
// A stale per-model pick reads as Auto, the same rule as the pane.
|
|
196
|
+
const currentEffort = reasoning?.selectedVariant && effortChoices.includes(reasoning.selectedVariant)
|
|
197
|
+
? reasoning.selectedVariant
|
|
198
|
+
: null;
|
|
184
199
|
useEffect(() => {
|
|
185
200
|
if (!open) {
|
|
186
201
|
setSearch('');
|
|
@@ -195,8 +210,8 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
195
210
|
// `enabled` stamping `/model-picker` gives gateway catalogs. See
|
|
196
211
|
// modelInDefaultView.
|
|
197
212
|
const pickerModelStore = useModelStore(models);
|
|
198
|
-
const
|
|
199
|
-
const q =
|
|
213
|
+
const filterModels = useCallback((query) => {
|
|
214
|
+
const q = query.toLowerCase();
|
|
200
215
|
return models
|
|
201
216
|
.filter((m) => m.enabled !== false &&
|
|
202
217
|
// Claude subscription models appear once the member signed in to Claude
|
|
@@ -207,12 +222,17 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
207
222
|
(m.modelID || '').toLowerCase().includes(q) ||
|
|
208
223
|
(m.providerName || '').toLowerCase().includes(q)) &&
|
|
209
224
|
modelInDefaultView(m, {
|
|
210
|
-
search,
|
|
225
|
+
search: query,
|
|
211
226
|
isStoreVisible: pickerModelStore.isVisible,
|
|
212
227
|
selected: selectedModel,
|
|
213
228
|
}))
|
|
214
229
|
.sort((a, b) => a.modelName.localeCompare(b.modelName));
|
|
215
|
-
}, [models,
|
|
230
|
+
}, [models, pickerModelStore.isVisible, selectedModel]);
|
|
231
|
+
const visibleModels = useMemo(() => filterModels(search), [filterModels, search]);
|
|
232
|
+
// The chip popover's rail and tabs read the unsearched list.
|
|
233
|
+
const browseModels = useMemo(() => filterModels(''), [filterModels]);
|
|
234
|
+
// Favorites skip the default-view curation: a starred model stays listed.
|
|
235
|
+
const pickableModels = useMemo(() => models.filter((m) => m.enabled !== false && !(isClaudeSubscriptionModel(m) && m.available === false)), [models]);
|
|
216
236
|
/** Is there anything to pick AT ALL, ignoring the search box? The empty
|
|
217
237
|
* state below branches on this: "no models match your search" and "you have
|
|
218
238
|
* no models" are different problems with different ways out. */
|
|
@@ -299,14 +319,32 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
299
319
|
if (connect === 'claude' || connect === 'provider')
|
|
300
320
|
return handleOpenProviderModal('providers');
|
|
301
321
|
onSelect({ providerID: model.providerID, modelID: model.modelID });
|
|
302
|
-
|
|
303
|
-
|
|
322
|
+
// The chip popover stays open: a model and its thinking level are set
|
|
323
|
+
// in one visit, and Escape or a click outside closes it.
|
|
324
|
+
if (appearance !== 'chip')
|
|
325
|
+
setOpen(false);
|
|
326
|
+
}, [
|
|
327
|
+
onSelect,
|
|
328
|
+
setOpen,
|
|
329
|
+
chatGptAvailable,
|
|
330
|
+
handleOpenChatGpt,
|
|
331
|
+
handleOpenProviderModal,
|
|
332
|
+
appearance,
|
|
333
|
+
]);
|
|
334
|
+
// Stays open too: the check moves, and the model list is still in reach.
|
|
335
|
+
const handleEffortChange = useCallback((variant) => reasoning?.onVariantChange?.(variant), [reasoning]);
|
|
336
|
+
const closePicker = useCallback(() => setOpen(false), [setOpen]);
|
|
304
337
|
const handleUpgrade = useCallback(() => {
|
|
305
338
|
setOpen(false);
|
|
306
339
|
openUpgrade();
|
|
307
340
|
}, [openUpgrade, setOpen]);
|
|
341
|
+
const searchRight = canManageModels && canConnectProvider ? (_jsxs("div", { className: "-mr-0.5 flex shrink-0 items-center gap-0.5", children: [_jsx(Hint, { label: tModel('connectProvider'), side: "top", className: "z-50", children: _jsx("button", { type: "button", "aria-label": tModel('addProvider'), onClick: () => handleOpenProviderModal('providers'), className: "text-muted-foreground hover:text-foreground hover:bg-muted flex size-8 cursor-pointer items-center justify-center rounded-md transition-colors", children: _jsx(Plus, { className: "size-4" }) }) }), _jsx(Hint, { label: tModel('manageModels'), side: "top", className: "z-50", children: _jsx("button", { type: "button", "aria-label": tModel('manageModels'), onClick: () => handleOpenProviderModal('models'), className: "text-muted-foreground hover:text-foreground hover:bg-muted flex size-8 cursor-pointer items-center justify-center rounded-md transition-colors", children: _jsx(SlidersHorizontal, { className: "size-4" }) }) })] })) : undefined;
|
|
342
|
+
const searchEmptyState = (_jsx(ModelSearchEmpty, { search: search, modelCount: models.filter((model) => model.enabled !== false && !(isClaudeSubscriptionModel(model) && model.available === false)).length, onClear: () => setSearch(''), onUpgrade: showUpgradeOption ? handleUpgrade : undefined }));
|
|
343
|
+
const noModelsState = (_jsxs("div", { className: "px-3 py-5 text-center", children: [_jsx("div", { className: "text-foreground text-sm font-medium", children: tModel('empty.title') }), _jsx("p", { className: "text-muted-foreground mx-auto mt-1 max-w-[220px] text-xs leading-5", children: showUpgradeOption
|
|
344
|
+
? tModel('empty.upgradeDescription')
|
|
345
|
+
: tModel('empty.description') }), _jsxs("div", { className: "mt-4 flex items-center justify-center gap-2", children: [showUpgradeOption && (_jsxs(Button, { type: "button", size: "xs", onClick: handleUpgrade, children: [_jsx(CreditCard, { className: "size-3.5" }), tModel('upgrade')] })), canConnectProvider && (_jsxs(Button, { type: "button", size: "xs", variant: showUpgradeOption ? 'outline' : 'default', onClick: () => handleOpenProviderModal('providers'), children: [_jsx(KeyRound, { className: "size-3.5" }), tModel('connectProvider')] }))] })] }));
|
|
308
346
|
const inline = appearance === 'inline';
|
|
309
|
-
const listBody = (_jsxs(_Fragment, { children: [_jsx(CommandInput, { compact: true, placeholder: tModel('search'), value: search, onValueChange: setSearch, rightElement:
|
|
347
|
+
const listBody = (_jsxs(_Fragment, { children: [_jsx(CommandInput, { compact: true, placeholder: tModel('search'), value: search, onValueChange: setSearch, rightElement: searchRight }), grouped.length > 1 && _jsx(CommandSeparator, { className: "bg-border/60" }), _jsx(CommandList, { className: inline ? 'max-h-none min-h-0 flex-1' : 'max-h-[380px]', children: modelsLoading || entitlementsPending ? (_jsx("div", { className: "flex min-h-32 items-center justify-center", role: "status", "aria-label": tModel('loading'), children: _jsx(Loading, { className: "text-muted-foreground size-4 shrink-0" }) })) : grouped.length > 0 ? (_jsxs(_Fragment, { children: [pinnedDefault && (_jsxs(_Fragment, { children: [_jsx(CommandGroup, { heading: _jsx(GroupHeading, { children: tDefault('yourDefault') }), forceMount: true, children: _jsx(ModelRow, { model: pinnedDefault.model, groupProviderID: pinnedDefault.providerID, groupProviderName: pinnedDefault.providerName, isSelected: availableSelectedModel?.providerID === pinnedDefault.model.providerID &&
|
|
310
348
|
availableSelectedModel?.modelID === pinnedDefault.model.modelID, isAccountDefault: true, defaultControls: rowDefaultControls, onSelect: handleSelect, connectLabel: tPooled('connect'), scope: "pinned" }) }), _jsx(CommandSeparator, {})] })), sections.map((section, sectionIndex) => {
|
|
311
349
|
const selectedInSection = section.models.find((m) => availableSelectedModel?.providerID === m.providerID &&
|
|
312
350
|
availableSelectedModel?.modelID === m.modelID);
|
|
@@ -332,9 +370,7 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
332
370
|
filtered by `search`, so the branch below could not tell the
|
|
333
371
|
two apart: typing "zzz" with 40 models connected showed
|
|
334
372
|
"No models available" and a Connect-provider CTA. */
|
|
335
|
-
|
|
336
|
-
? tModel('empty.upgradeDescription')
|
|
337
|
-
: tModel('empty.description') }), _jsxs("div", { className: "mt-4 flex items-center justify-center gap-2", children: [showUpgradeOption && (_jsxs(Button, { type: "button", size: "xs", onClick: handleUpgrade, children: [_jsx(CreditCard, { className: "size-3.5" }), tModel('upgrade')] })), canConnectProvider && (_jsxs(Button, { type: "button", size: "xs", variant: showUpgradeOption ? 'outline' : 'default', onClick: () => handleOpenProviderModal('providers'), children: [_jsx(KeyRound, { className: "size-3.5" }), tModel('connectProvider')] }))] })] })) })] }));
|
|
373
|
+
searchEmptyState) : (noModelsState) })] }));
|
|
338
374
|
const modals = (_jsxs(_Fragment, { children: [connectionModal, projectId && chatGptPossible && ProviderAccountsModal && (_jsx(ProviderAccountsModal, { projectId: projectId, providerId: "codex", open: chatGptOpen, onOpenChange: setChatGptOpen }))] }));
|
|
339
375
|
if (inline) {
|
|
340
376
|
return (_jsxs(_Fragment, { children: [modals, _jsx(Command, { shouldFilter: false, className: cn('min-h-0 flex-1 rounded-none bg-transparent', '[&_[cmdk-group]]:px-1.5 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0',
|
|
@@ -344,5 +380,13 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
344
380
|
return (_jsxs(_Fragment, { children: [modals, _jsxs(CommandPopover, { open: disabled ? false : open, onOpenChange: (next) => !disabled && setOpen(next), children: [_jsx(CommandPopoverTrigger, { children: appearance === 'field' ? (_jsxs("button", { type: "button", disabled: disabled, className: cn(triggerVariants(), 'h-9 w-full'), children: [_jsx("span", { className: "truncate", children: displayName }), disabled ? null : _jsx(ChevronDown, { className: cn(TRIGGER_CARET_CLASS, 'size-4') })] })) : (_jsxs(Button, { type: "button", variant: triggerVariant, size: "sm",
|
|
345
381
|
// `min-w-0 shrink`: in a narrow toolbar (a channel's thread panel) the
|
|
346
382
|
// model name truncates; the controls beside it keep their width.
|
|
347
|
-
className: cn('min-w-0 shrink rounded-lg hit-area-y-3', triggerVariant === 'ghost' && 'text-muted-foreground'), children: [_jsx("span", { className: cn('max-w-30 truncate', triggerLabelClassName), children: displayName }), _jsx(ChevronDown, { className: cn('duration-moderate size-3 transition-transform ease-out', open && 'rotate-180') })] })) }), _jsx(CommandPopoverContent, { side: "top", align: "start", sideOffset: 8, className:
|
|
383
|
+
className: cn('min-w-0 shrink rounded-lg hit-area-y-3', triggerVariant === 'ghost' && 'text-muted-foreground'), children: [_jsx("span", { className: cn('max-w-30 truncate', triggerLabelClassName), children: displayName }), showEffort && (_jsx("span", { className: "shrink-0", children: currentEffort ? effortLabel(currentEffort) : t('auto') })), _jsx(ChevronDown, { className: cn('duration-moderate size-3 transition-transform ease-out', open && 'rotate-180') })] })) }), _jsx(CommandPopoverContent, { side: "top", align: "start", sideOffset: 8, className: showEffort
|
|
384
|
+
? 'w-[min(38rem,calc(100vw-1.5rem))]'
|
|
385
|
+
: 'w-[min(28rem,calc(100vw-1.5rem))]', children: _jsx(ModelPickerPanel, { browseModels: browseModels, pickableModels: pickableModels, searchModels: visibleModels, search: search, onSearchChange: setSearch, searchRight: searchRight, selected: availableSelectedModel ?? null, onPick: handleSelect, isFavorite: pickerModelStore.isFavorite, setFavorite: pickerModelStore.setFavorite, loading: modelsLoading || entitlementsPending, emptyState: noModelsState, searchEmpty: searchEmptyState, onConnectChatGpt: chatGptAvailable ? handleOpenChatGpt : undefined, onForeignDialog: closePicker, connectLabel: tPooled('connect'), effort: showEffort
|
|
386
|
+
? {
|
|
387
|
+
choices: effortChoices,
|
|
388
|
+
selectedVariant: reasoning?.selectedVariant,
|
|
389
|
+
onChange: handleEffortChange,
|
|
390
|
+
}
|
|
391
|
+
: undefined }) })] })] }));
|
|
348
392
|
}
|
|
@@ -19,18 +19,14 @@ export declare function isClaudeSubscriptionModel(model: {
|
|
|
19
19
|
providerID?: string;
|
|
20
20
|
}): boolean;
|
|
21
21
|
/**
|
|
22
|
-
* What the picker prints for a model.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* (`picker-catalog.ts`, `catalog-models.ts`) so surfaces with no grouping —
|
|
26
|
-
* the CLI, `/v1/models` — can still tell `gpt-6-astra` from
|
|
27
|
-
* `codex/gpt-6-astra`. The picker HAS grouping: the rows already sit under a
|
|
28
|
-
* "ChatGPT subscription" heading, so the suffix repeated the heading on every
|
|
29
|
-
* row and pushed the real name off the same column as its managed twin.
|
|
22
|
+
* What the picker prints for a model: its name without the plan suffix. The
|
|
23
|
+
* picker shows the plan another way (the ChatGPT tab, the provider's tab), so
|
|
24
|
+
* the suffix only pushed the real name off the trigger and out of the column.
|
|
30
25
|
*
|
|
31
26
|
* Display only. Search, aria labels and every stored id keep the full name, so
|
|
32
27
|
* typing "chatgpt" still finds these rows.
|
|
33
28
|
*/
|
|
34
29
|
export declare function pickerModelName(model: Pick<FlatModel, 'modelID' | 'modelName'> & {
|
|
35
30
|
provider?: string | null;
|
|
31
|
+
providerID?: string;
|
|
36
32
|
}): string;
|
|
@@ -22,22 +22,29 @@ export function isClaudeSubscriptionModel(model) {
|
|
|
22
22
|
return model.providerID === 'claude-agent' || model.provider === 'claude-agent';
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
* A trailing parenthetical that names how a model is billed, not what it is:
|
|
26
|
+
* "(ChatGPT)", "(Claude subscription)", "(Anthropic plan)". The gateway and
|
|
27
|
+
* the plan catalogs append these so ungrouped surfaces (the CLI, `/v1/models`)
|
|
28
|
+
* can tell a plan model from its metered twin. `[^()]*` keeps the match
|
|
29
|
+
* linear (CodeQL js/polynomial-redos) and inside one pair of parentheses.
|
|
30
|
+
*/
|
|
31
|
+
const PLAN_SUFFIX = /\((?:ChatGPT|Claude|Anthropic)(?: [^()]*)?\)$/i;
|
|
32
|
+
/** A suffix that says it is a plan, on any model. */
|
|
33
|
+
const EXPLICIT_PLAN_SUFFIX = /\([^()]*\b(?:subscription|plan)\)$/i;
|
|
34
|
+
/**
|
|
35
|
+
* What the picker prints for a model: its name without the plan suffix. The
|
|
36
|
+
* picker shows the plan another way (the ChatGPT tab, the provider's tab), so
|
|
37
|
+
* the suffix only pushed the real name off the trigger and out of the column.
|
|
33
38
|
*
|
|
34
39
|
* Display only. Search, aria labels and every stored id keep the full name, so
|
|
35
40
|
* typing "chatgpt" still finds these rows.
|
|
36
41
|
*/
|
|
37
42
|
export function pickerModelName(model) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
const name = model.modelName.trim();
|
|
44
|
+
// A bare "(ChatGPT)" on a model that is NOT on a plan is part of its name.
|
|
45
|
+
const onPlan = isSubscriptionModel(model) || isClaudeSubscriptionModel(model);
|
|
46
|
+
let stripped = name.replace(EXPLICIT_PLAN_SUFFIX, '');
|
|
47
|
+
if (onPlan)
|
|
48
|
+
stripped = stripped.replace(PLAN_SUFFIX, '');
|
|
49
|
+
return stripped.trim() || model.modelName;
|
|
43
50
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one "connect a model" surface: two rows, "Connect ChatGPT · Plus or Pro
|
|
3
|
+
* plan →" and "Connect Claude · Pro or Max plan →". Each opens the provider
|
|
4
|
+
* dialog with that provider already expanded, so the next click is the sign-in.
|
|
5
|
+
*
|
|
6
|
+
* The rows read like starter suggestions: no box, no fill until hover. Inside
|
|
7
|
+
* each row the logo centres under the composer's paperclip (`pl-2.5`) and the
|
|
8
|
+
* arrow under its send button (`pr-3.5`), so the host must place the rows at
|
|
9
|
+
* the composer card's width.
|
|
10
|
+
*
|
|
11
|
+
* `dismissible`: hovering a row swaps its arrow for a ✕ in the same slot. The ✕
|
|
12
|
+
* hides that row for this project in this browser (`localStorage`). Only the
|
|
13
|
+
* optional offer is dismissible; with no model at all there is nothing else to
|
|
14
|
+
* send with, so the rows stay.
|
|
15
|
+
*
|
|
16
|
+
* `projectId` omitted: the gate reads the `[id]` route segment.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ConnectPlanRows({ projectId, dismissible, className, }: {
|
|
19
|
+
projectId?: string;
|
|
20
|
+
dismissible: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* The project home's optional offer: the rows, dismissible, under the hero
|
|
25
|
+
* composer. New projects run on Kortix models, and most people already pay
|
|
26
|
+
* for ChatGPT or Claude.
|
|
27
|
+
*
|
|
28
|
+
* Shown only when a model already runs (with none, the composer's own
|
|
29
|
+
* `ModelConnectionBar` shows the same rows, undismissible), no ChatGPT or
|
|
30
|
+
* Claude plan serves one yet, and the viewer may change the project's models.
|
|
31
|
+
* `px-4` is the composer shell's gutter, so the rows span the card's width.
|
|
32
|
+
*/
|
|
33
|
+
export declare function SubscriptionOffer({ projectId }: {
|
|
34
|
+
projectId: string;
|
|
35
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useWorkspaceModels } from '@kortix/sdk/react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
6
|
+
import { Close } from '../../icons/close.js';
|
|
7
|
+
import { SolidRightArrow } from '../../icons/solid-right-arrow.js';
|
|
8
|
+
import { ClaudeCode } from '../../internal/icons/claude-code.js';
|
|
9
|
+
import { ProviderLogo } from '../../internal/lib/provider-branding.js';
|
|
10
|
+
import { cn } from '../../internal/lib/utils.js';
|
|
11
|
+
import { hasRunnableSubscriptionModel, isRunnableModel } from './model-availability.js';
|
|
12
|
+
import { useModelConnectionGate } from './use-model-connection-gate.js';
|
|
13
|
+
const PLANS = [
|
|
14
|
+
{ providerId: 'openai', name: 'ChatGPT', labelKey: 'connectChatGpt', planKey: 'chatGptPlan' },
|
|
15
|
+
{ providerId: 'anthropic', name: 'Claude', labelKey: 'connectClaude', planKey: 'claudePlan' },
|
|
16
|
+
];
|
|
17
|
+
const dismissedKey = (projectId) => `kortix:subscription-offer-dismissed:${projectId}`;
|
|
18
|
+
/** The rows this browser hid for this project. Empty when storage is blocked. */
|
|
19
|
+
function readDismissed(projectId) {
|
|
20
|
+
if (!projectId || typeof window === 'undefined')
|
|
21
|
+
return [];
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(window.localStorage.getItem(dismissedKey(projectId)) ?? '[]');
|
|
24
|
+
return Array.isArray(parsed)
|
|
25
|
+
? parsed.filter((id) => PLANS.some((plan) => plan.providerId === id))
|
|
26
|
+
: [];
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function writeDismissed(projectId, ids) {
|
|
33
|
+
try {
|
|
34
|
+
window.localStorage.setItem(dismissedKey(projectId), JSON.stringify(ids));
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// Storage blocked (private mode): the row stays hidden until reload.
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The one "connect a model" surface: two rows, "Connect ChatGPT · Plus or Pro
|
|
42
|
+
* plan →" and "Connect Claude · Pro or Max plan →". Each opens the provider
|
|
43
|
+
* dialog with that provider already expanded, so the next click is the sign-in.
|
|
44
|
+
*
|
|
45
|
+
* The rows read like starter suggestions: no box, no fill until hover. Inside
|
|
46
|
+
* each row the logo centres under the composer's paperclip (`pl-2.5`) and the
|
|
47
|
+
* arrow under its send button (`pr-3.5`), so the host must place the rows at
|
|
48
|
+
* the composer card's width.
|
|
49
|
+
*
|
|
50
|
+
* `dismissible`: hovering a row swaps its arrow for a ✕ in the same slot. The ✕
|
|
51
|
+
* hides that row for this project in this browser (`localStorage`). Only the
|
|
52
|
+
* optional offer is dismissible; with no model at all there is nothing else to
|
|
53
|
+
* send with, so the rows stay.
|
|
54
|
+
*
|
|
55
|
+
* `projectId` omitted: the gate reads the `[id]` route segment.
|
|
56
|
+
*/
|
|
57
|
+
export function ConnectPlanRows({ projectId, dismissible, className, }) {
|
|
58
|
+
const t = useTranslations('sessionUi.modelGate');
|
|
59
|
+
const { canConnectProvider, openConnectProvider, modal } = useModelConnectionGate(undefined, projectId === undefined ? undefined : { projectId });
|
|
60
|
+
const [dismissed, setDismissed] = useState(() => dismissible ? readDismissed(projectId) : []);
|
|
61
|
+
const plans = PLANS.filter((plan) => !dismissed.includes(plan.providerId));
|
|
62
|
+
const dismiss = (id) => {
|
|
63
|
+
const next = [...dismissed, id];
|
|
64
|
+
setDismissed(next);
|
|
65
|
+
if (projectId)
|
|
66
|
+
writeDismissed(projectId, next);
|
|
67
|
+
};
|
|
68
|
+
return (_jsxs(_Fragment, { children: [modal, canConnectProvider && plans.length > 0 ? (_jsx("div", { role: "group", "aria-label": t('offerTitle'), className: cn('flex flex-col', className), children: plans.map((plan) => (_jsxs("div", { className: "group relative", children: [_jsxs("button", { type: "button", onClick: () => openConnectProvider('providers', plan.providerId), className: "hover:bg-muted/60 focus-visible:ring-kortix-base flex w-full min-w-0 items-center gap-3 rounded-lg py-2 pr-3.5 pl-2.5 text-left transition-colors outline-none focus-visible:ring-[0.6px]", children: [plan.providerId === 'anthropic' ? (
|
|
69
|
+
// Claude plans run through Claude Code, so the row shows its mark.
|
|
70
|
+
_jsx(ClaudeCode, { className: "size-5 shrink-0" })) : (_jsx(ProviderLogo, { providerID: plan.providerId, size: "xs", className: "size-5 [&_img]:size-5" })), _jsx("span", { className: "text-foreground shrink-0 text-sm", children: t(plan.labelKey) }), _jsx("span", { className: "text-muted-foreground truncate text-sm", children: t(plan.planKey) }), _jsx(SolidRightArrow, { className: cn('text-muted-foreground ml-auto size-4 shrink-0 transition-opacity', dismissible && 'group-focus-within:opacity-0 group-hover:opacity-0') })] }), dismissible ? (
|
|
71
|
+
// A sibling, not a child: a button cannot hold a button. It sits
|
|
72
|
+
// over the arrow's slot — `w-11` is `pr-3.5` + the arrow +
|
|
73
|
+
// `pr-3.5` — so the ✕ centres where the arrow was.
|
|
74
|
+
_jsx("button", { type: "button", "aria-label": t('hidePlan', { name: plan.name }), onClick: () => dismiss(plan.providerId), className: "text-muted-foreground hover:text-foreground focus-visible:ring-kortix-base absolute inset-y-0 right-0 flex w-11 items-center justify-center rounded-lg opacity-0 transition-opacity outline-none group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:ring-[0.6px]", children: _jsx(Close, {}) })) : null] }, plan.providerId))) })) : null] }));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The project home's optional offer: the rows, dismissible, under the hero
|
|
78
|
+
* composer. New projects run on Kortix models, and most people already pay
|
|
79
|
+
* for ChatGPT or Claude.
|
|
80
|
+
*
|
|
81
|
+
* Shown only when a model already runs (with none, the composer's own
|
|
82
|
+
* `ModelConnectionBar` shows the same rows, undismissible), no ChatGPT or
|
|
83
|
+
* Claude plan serves one yet, and the viewer may change the project's models.
|
|
84
|
+
* `px-4` is the composer shell's gutter, so the rows span the card's width.
|
|
85
|
+
*/
|
|
86
|
+
export function SubscriptionOffer({ projectId }) {
|
|
87
|
+
const models = useWorkspaceModels(projectId);
|
|
88
|
+
const { canWriteProviders } = useModelConnectionGate(undefined, { projectId });
|
|
89
|
+
const show = canWriteProviders && models.some(isRunnableModel) && !hasRunnableSubscriptionModel(models);
|
|
90
|
+
return show ? _jsx(ConnectPlanRows, { projectId: projectId, dismissible: true, className: "px-4" }) : null;
|
|
91
|
+
}
|
|
@@ -12,7 +12,7 @@ export declare function projectProviderModalTab(tab: ProviderModalTab): 'provide
|
|
|
12
12
|
* route segment is the fallback.
|
|
13
13
|
*
|
|
14
14
|
* The fallback is what every original caller relies on — they all render under
|
|
15
|
-
* `/
|
|
15
|
+
* `/workspaces/[id]`. The explicit id serves callers outside that route, such as
|
|
16
16
|
* Customize's provider list: there the route may yield `null`, `modal` is
|
|
17
17
|
* then `null`, and `openConnectProvider` renders nothing.
|
|
18
18
|
*
|
|
@@ -38,7 +38,7 @@ export declare function resolveGateProjectId(explicitId: string | null | undefin
|
|
|
38
38
|
* models the project does not offer. See `isModelOffered` for the check.
|
|
39
39
|
*
|
|
40
40
|
* `options.projectId` names the project explicitly, for callers that render
|
|
41
|
-
* outside `/
|
|
41
|
+
* outside `/workspaces/[id]`. Omitting it keeps the original route-inferred
|
|
42
42
|
* behaviour verbatim — see `resolveGateProjectId`.
|
|
43
43
|
*/
|
|
44
44
|
export declare function useModelConnectionGate(models?: FlatModel[], options?: {
|
|
@@ -47,7 +47,7 @@ export declare function useModelConnectionGate(models?: FlatModel[], options?: {
|
|
|
47
47
|
canConnectProvider: boolean;
|
|
48
48
|
/** The viewer holds `project.model.write`: the provider modal can change the project's models. */
|
|
49
49
|
canWriteProviders: boolean;
|
|
50
|
-
openConnectProvider: (tab?: ProviderModalTab) => void;
|
|
50
|
+
openConnectProvider: (tab?: ProviderModalTab, providerId?: string) => void;
|
|
51
51
|
openUpgrade: () => void;
|
|
52
52
|
modal: import("react").JSX.Element | null;
|
|
53
53
|
hasSelectableModels: boolean;
|
|
@@ -27,7 +27,7 @@ export function projectProviderModalTab(tab) {
|
|
|
27
27
|
* route segment is the fallback.
|
|
28
28
|
*
|
|
29
29
|
* The fallback is what every original caller relies on — they all render under
|
|
30
|
-
* `/
|
|
30
|
+
* `/workspaces/[id]`. The explicit id serves callers outside that route, such as
|
|
31
31
|
* Customize's provider list: there the route may yield `null`, `modal` is
|
|
32
32
|
* then `null`, and `openConnectProvider` renders nothing.
|
|
33
33
|
*
|
|
@@ -57,7 +57,7 @@ export function resolveGateProjectId(explicitId, routeId) {
|
|
|
57
57
|
* models the project does not offer. See `isModelOffered` for the check.
|
|
58
58
|
*
|
|
59
59
|
* `options.projectId` names the project explicitly, for callers that render
|
|
60
|
-
* outside `/
|
|
60
|
+
* outside `/workspaces/[id]`. Omitting it keeps the original route-inferred
|
|
61
61
|
* behaviour verbatim — see `resolveGateProjectId`.
|
|
62
62
|
*/
|
|
63
63
|
export function useModelConnectionGate(models = [], options) {
|
|
@@ -80,6 +80,7 @@ export function useModelConnectionGate(models = [], options) {
|
|
|
80
80
|
const canWriteProviders = caps[PROJECT_ACTIONS.PROJECT_MODEL_WRITE]?.allowed === true;
|
|
81
81
|
const [projectModalOpen, setProjectModalOpen] = useState(false);
|
|
82
82
|
const [projectModalTab, setProjectModalTab] = useState('providers');
|
|
83
|
+
const [projectModalProviderId, setProjectModalProviderId] = useState();
|
|
83
84
|
const accountStateQuery = useAccountState();
|
|
84
85
|
// Availability is SERVER-resolved, never re-derived here. `/model-picker`
|
|
85
86
|
// already applies plan entitlement (`freeManagedOnly`) and connected-BYOK
|
|
@@ -124,10 +125,11 @@ export function useModelConnectionGate(models = [], options) {
|
|
|
124
125
|
accountStateQuery,
|
|
125
126
|
]);
|
|
126
127
|
const canConnectProvider = !!(projectId && ProjectProviderModal);
|
|
127
|
-
const openConnectProvider = useCallback((tab = 'providers') => {
|
|
128
|
+
const openConnectProvider = useCallback((tab = 'providers', providerId) => {
|
|
128
129
|
if (!canConnectProvider)
|
|
129
130
|
return;
|
|
130
131
|
setProjectModalTab(projectProviderModalTab(tab));
|
|
132
|
+
setProjectModalProviderId(providerId);
|
|
131
133
|
setProjectModalOpen(true);
|
|
132
134
|
}, [canConnectProvider]);
|
|
133
135
|
const openUpgrade = useCallback(() => {
|
|
@@ -137,17 +139,17 @@ export function useModelConnectionGate(models = [], options) {
|
|
|
137
139
|
});
|
|
138
140
|
}, [openUpgradeDialog, projectRowQuery.data?.account_id]);
|
|
139
141
|
const providerModalOpened = useOpenedOnce(projectModalOpen);
|
|
140
|
-
const modal = projectId && providerModalOpened && ProjectProviderModal ? (_jsx(ProjectProviderModal, { projectId: projectId, open: projectModalOpen, onOpenChange: setProjectModalOpen, defaultTab: projectModalTab, canWrite: canWriteProviders })) : null;
|
|
142
|
+
const modal = projectId && providerModalOpened && ProjectProviderModal ? (_jsx(ProjectProviderModal, { projectId: projectId, open: projectModalOpen, onOpenChange: setProjectModalOpen, defaultTab: projectModalTab, defaultProviderId: projectModalProviderId, canWrite: canWriteProviders })) : null;
|
|
141
143
|
// Billing off (self-host default): there's no Kortix plan to upgrade to and
|
|
142
144
|
// no <GlobalUpgradeModal/> mounted anywhere to respond to openUpgrade()
|
|
143
145
|
// (every host mounts it behind the same flag — `app-providers.tsx`'s
|
|
144
146
|
// `isBillingEnabled() && <GlobalUpgradeModal />`, and the same line on
|
|
145
|
-
// `/new`) — an "Upgrade" button would be a dead click. Callers should hide it
|
|
147
|
+
// `/workspaces/new`) — an "Upgrade" button would be a dead click. Callers should hide it
|
|
146
148
|
// and only offer "bring your own key" when this is false.
|
|
147
149
|
//
|
|
148
150
|
// This flag answers "is billing ON", NOT "is a host MOUNTED". A route that
|
|
149
151
|
// enables billing without mounting one still yields a dead click — which is
|
|
150
|
-
// exactly why `/new` had to mount its own. It is the SDK's flag
|
|
152
|
+
// exactly why `/workspaces/new` had to mount its own. It is the SDK's flag
|
|
151
153
|
// (`configureKortix({ billingEnabled })`), the one every billing gate reads.
|
|
152
154
|
const showUpgradeOption = !!platformConfig().billingEnabled;
|
|
153
155
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { Alert as BannerAlert, AlertTitle as BannerAlertTitle, AlertDescription as BannerAlertDescription, AlertMedia as BannerAlertMedia } from '../../primitives/alert.js';
|
|
4
4
|
import { successToast } from '../../primitives/toast.js';
|
|
5
5
|
import { useTranslations } from '../../i18n/index.js';
|
|
6
6
|
import { CpuIcon as Cpu, FolderIcon, KeyIcon as KeyRound, PlugsConnectedIcon, WarningIcon as TriangleAlert, } from '@phosphor-icons/react';
|
|
@@ -138,7 +138,9 @@ export function SessionOverridesToolbar({ projectId, sessionId, agentName, onCom
|
|
|
138
138
|
const secretRead = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SECRET_READ);
|
|
139
139
|
const secretsDenied = !secretRead.isLoading && !secretRead.allowed;
|
|
140
140
|
// Choosing a session's provider keys is a lifecycle action: the pools route
|
|
141
|
-
// refuses anyone who cannot manage the session (`mayChangeSessionModel`)
|
|
141
|
+
// refuses anyone who cannot manage the session (`mayChangeSessionModel`) and,
|
|
142
|
+
// except the session's own person, anyone without `project.secret.read`. An
|
|
143
|
+
// existing session's pool list says which (`can_edit`).
|
|
142
144
|
// A new session is the caller's own. An existing one shows the row only once
|
|
143
145
|
// its row says the viewer manages it.
|
|
144
146
|
const sessionRow = useProjectSession(projectId, sessionId, { enabled: !!sessionId }).data;
|
|
@@ -289,7 +291,7 @@ export function SessionOverridesToolbar({ projectId, sessionId, agentName, onCom
|
|
|
289
291
|
// card it showed. Credentials are not a session-minting decision: the agent
|
|
290
292
|
// may use every account it is entitled to and names one at call time
|
|
291
293
|
// (`kortix connectors call --account`, `accounts` to see them).
|
|
292
|
-
if (pooledSecretsEnabled && managesSession)
|
|
294
|
+
if (pooledSecretsEnabled && managesSession && (!secretsDenied || (!!sessionId && providerPools.data?.can_edit === true)))
|
|
293
295
|
list.push(providerKeysRow(projectId, sessionId, providerPoolDraft, providerDrafts, providerPools.isError, providerPools.isLoading, saving, onProviderDraftChange, onProviderSecretPoolsChange, tPooled));
|
|
294
296
|
list.push(sandboxRow(sandboxSlot, sandbox, tI18nComplete));
|
|
295
297
|
if (sessionId && drivesEnabled) {
|
|
@@ -320,6 +322,7 @@ export function SessionOverridesToolbar({ projectId, sessionId, agentName, onCom
|
|
|
320
322
|
saving,
|
|
321
323
|
providerPools.isError,
|
|
322
324
|
providerPools.isLoading,
|
|
325
|
+
providerPools.data?.can_edit,
|
|
323
326
|
onProviderSecretPoolsChange,
|
|
324
327
|
projectId,
|
|
325
328
|
sessionId,
|
|
@@ -389,7 +392,7 @@ export function SessionOverridesToolbar({ projectId, sessionId, agentName, onCom
|
|
|
389
392
|
// saved, or a provider-key draft exists.
|
|
390
393
|
const scopeDirty = initialized && scopeDraftSignature(draft) !== scopeDraftSignature(draftState.base);
|
|
391
394
|
const chatInputDirty = scopeDirty || hasProviderChanges;
|
|
392
|
-
const chatInputNotice = retroactive === false ? (
|
|
395
|
+
const chatInputNotice = retroactive === false ? (_jsxs(BannerAlert, { variant: "warning", children: [_jsx(BannerAlertMedia, { children: _jsx(TriangleAlert, {}) }), _jsx(BannerAlertTitle, { children: tI18nComplete.raw('texta6cd531093d4') }), _jsx(BannerAlertDescription, { children: tI18nComplete.raw('text54a4e6b3594a') })] })) : null;
|
|
393
396
|
const chatInputPendingNote = hasProviderChanges ? tPooled('unsavedChanges') : undefined;
|
|
394
397
|
const chatInputSave = useCallback(() => handleSave(), [handleSave]);
|
|
395
398
|
const scopeControlsDisabled = controlsDisabled || saveScope.isPending;
|
|
@@ -459,5 +462,5 @@ export function SessionOverridesToolbar({ projectId, sessionId, agentName, onCom
|
|
|
459
462
|
return (_jsx(SessionOverridesControl, { rows: rows,
|
|
460
463
|
// Only a save locks the whole panel. A row that is still loading
|
|
461
464
|
// disables its own editor (see `controlsDisabled` above).
|
|
462
|
-
disabled: saving, saving: saving, pendingNote: hasProviderChanges ? tPooled('unsavedChanges') : undefined, error: saveError, saveDisabled: saveDisabled, hideSave: !rows.some((row) => row.id === 'secrets' || row.id === 'provider-keys'), notice: retroactive === false ? (
|
|
465
|
+
disabled: saving, saving: saving, pendingNote: hasProviderChanges ? tPooled('unsavedChanges') : undefined, error: saveError, saveDisabled: saveDisabled, hideSave: !rows.some((row) => row.id === 'secrets' || row.id === 'provider-keys'), notice: retroactive === false ? (_jsxs(BannerAlert, { variant: "warning", children: [_jsx(BannerAlertMedia, { children: _jsx(TriangleAlert, {}) }), _jsx(BannerAlertTitle, { children: tI18nComplete.raw('texta6cd531093d4') }), _jsx(BannerAlertDescription, { children: tI18nComplete.raw('text54a4e6b3594a') })] })) : null, onSave: handleSave }));
|
|
463
466
|
}
|
|
@@ -53,7 +53,7 @@ target) {
|
|
|
53
53
|
// session is maintained on every route (tab dashboard AND the standalone
|
|
54
54
|
// session page), unlike kortix-computer-store's `_activeSessionId`, which
|
|
55
55
|
// is tab-gated — relying on the latter silently dropped the terminal open
|
|
56
|
-
// on /
|
|
56
|
+
// on /workspaces/:id/sessions/:id.
|
|
57
57
|
const activePanelSessionId = getActivePanelSessionId();
|
|
58
58
|
// Reminders and Desktop are Easy details with no Advanced tab: they take the request path in both modes.
|
|
59
59
|
if (panelMode === 'advanced' && view !== 'reminders' && view !== 'desktop') {
|
|
@@ -52,5 +52,9 @@ export function SessionDetailPanel() {
|
|
|
52
52
|
if (isMobile) {
|
|
53
53
|
return (_jsxs("div", { className: "relative h-full w-full", children: [_jsx(DetailLayer, { detail: detail, onBack: closeDetail, isMobile: true, children: _jsx("div", { className: "h-full overflow-auto p-3", children: _jsx(EasyPanel, {}) }) }), _jsx(Drawer, { open: terminalOpen, onOpenChange: (next) => !next && closeTerminal(), children: _jsxs(DrawerContent, { className: "flex h-[95dvh] max-h-[95dvh] flex-col overflow-hidden p-0", children: [_jsx(DrawerHeader, { className: "shrink-0 px-4 py-3 text-left", children: _jsxs(DrawerTitle, { className: "flex items-center justify-between gap-2 text-base", children: [_jsxs("span", { className: "flex items-center gap-2.5", children: [_jsx(TerminalIcon, { className: "text-muted-foreground size-4 shrink-0" }), tI18nComplete.raw('texte0926fdac700')] }), _jsx(CloseButton, { onClose: closeTerminal, variant: "ghost" })] }) }), _jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: _jsx(SessionTerminalPanel, { sessionId: sessionId, projectId: projectId, projectSessionId: projectSessionId }) })] }) })] }));
|
|
54
54
|
}
|
|
55
|
-
return (_jsx("div", { className: "relative h-full w-full", children: _jsx(DetailLayer, { detail: detail, onBack: closeDetail, isMobile: false, persistentLayer: terminalLayer, children: booting && !detail && !terminalOpen ? (_jsx(SessionBootStatus, { projectId: projectId, sessionId: projectSessionId })) :
|
|
55
|
+
return (_jsx("div", { className: "relative h-full w-full", children: _jsx(DetailLayer, { detail: detail, onBack: closeDetail, isMobile: false, persistentLayer: terminalLayer, children: booting && !detail && !terminalOpen ? (_jsx(SessionBootStatus, { projectId: projectId, sessionId: projectSessionId })) : // Open with nothing on it — every path that opens the panel gives it
|
|
56
|
+
// a detail or the terminal in the same update, but a click whose
|
|
57
|
+
// content has not landed yet can sit in between. Name the state;
|
|
58
|
+
// never draw a blank panel.
|
|
59
|
+
!detail && !terminalOpen ? (_jsx("div", { className: "text-muted-foreground/70 flex h-full items-center justify-center p-8 text-center text-sm", children: tI18nComplete.raw('text49abaf804ab3') })) : null }) }));
|
|
56
60
|
}
|
|
@@ -84,7 +84,7 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
84
84
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
85
85
|
const tDesktop = useTranslations('sessionDesktop');
|
|
86
86
|
const tReminders = useTranslations('reminders');
|
|
87
|
-
const { steps, outputs, context, apps, files, isRunning, outcome } = usePanelDerivations({
|
|
87
|
+
const { steps, calls, outputs, context, apps, files, isRunning, outcome } = usePanelDerivations({
|
|
88
88
|
sessionId, projectId, projectSessionId, isSessionBusy,
|
|
89
89
|
});
|
|
90
90
|
// The provider owns the detail because the two surfaces that need it are in
|
|
@@ -462,7 +462,7 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
462
462
|
handleOpenOutput(quickBrowserOutput(apps, target), undefined, 'quick');
|
|
463
463
|
}, [apps, handleOpenOutput]);
|
|
464
464
|
const { outputsDefaultOpen, pendingQuickView } = usePanelHandoffs({
|
|
465
|
-
sessionId, projectId, projectSessionId, isRunning, outcome, apps, files, steps,
|
|
465
|
+
sessionId, projectId, projectSessionId, isRunning, outcome, apps, files, steps, calls,
|
|
466
466
|
detail, handleOpenOutput, openDetail, closeDetail, openTerminal, openAudit, openReminders, openDesktop, openBrowser, openFiles,
|
|
467
467
|
});
|
|
468
468
|
// The panel comes back with the session: what it showed is remembered while
|
|
@@ -22,12 +22,12 @@ import { remindersHref } from '../../internal/lib/capability-tab-routes.js';
|
|
|
22
22
|
import { useCapabilityAccess } from '../../internal/layout/project-settings-nav.js';
|
|
23
23
|
import { reminderTitle, scheduleLabel } from '../../internal/reminders/reminder-format.js';
|
|
24
24
|
import { matchesQuery, matchesStatus, matchesTime, REMINDER_STATUS_FILTERS, REMINDER_TIME_FILTERS, } from '../../internal/reminders/reminder-filter.js';
|
|
25
|
-
import { useNow } from '
|
|
25
|
+
import { useNow } from '@kortix/sdk/react';
|
|
26
26
|
import { cn } from '../../internal/lib/utils.js';
|
|
27
27
|
import { useLocale, useTranslations } from '../../i18n/index.js';
|
|
28
28
|
import { AlarmIcon, MagnifyingGlassIcon as SearchIcon } from '@phosphor-icons/react';
|
|
29
29
|
import { useState } from 'react';
|
|
30
|
-
import { CLOCK_TONE, lastRunLabel } from '../../internal/lib/trigger-clock.js';
|
|
30
|
+
import { CLOCK_TONE, lastRunLabel, nextRunIn } from '../../internal/lib/trigger-clock.js';
|
|
31
31
|
import { ReminderActions, ReminderFacts, isFailedReminder, sortReminders, useReminderControls, } from '../header/reminder-parts.js';
|
|
32
32
|
const STATUS_LABEL_KEY = {
|
|
33
33
|
all: 'statusAll',
|
|
@@ -51,19 +51,6 @@ function ReminderTile({ reminder }) {
|
|
|
51
51
|
: CLOCK_TONE.ok;
|
|
52
52
|
return (_jsxs("span", { "aria-hidden": true, className: "relative size-5 shrink-0", children: [_jsx("span", { className: "text-muted-foreground absolute inset-0 flex items-center justify-center [&_svg]:size-5", children: _jsx(AlarmIcon, {}) }), _jsx("span", { className: cn('absolute inset-0 flex items-center justify-center [&_svg]:size-5', tone.reflection), style: { maskImage: REFLECTION_MASK, WebkitMaskImage: REFLECTION_MASK }, children: _jsx(AlarmIcon, {}) }), _jsx("span", { className: "absolute -right-0.75 -bottom-0.75 flex size-3 items-center justify-center rounded-full bg-(--row-surface)", children: _jsx("span", { className: cn('size-1.5 rounded-full', tone.dot) }) })] }));
|
|
53
53
|
}
|
|
54
|
-
/** "in 25m", "in 8h", "in 3d": the next run in the last-run label's narrow style. */
|
|
55
|
-
function nextRunIn(iso, locale, now) {
|
|
56
|
-
const at = iso ? Date.parse(iso) : Number.NaN;
|
|
57
|
-
if (!Number.isFinite(at))
|
|
58
|
-
return '—';
|
|
59
|
-
const rtf = new Intl.RelativeTimeFormat(locale, { style: 'narrow', numeric: 'auto' });
|
|
60
|
-
const min = Math.max(0, Math.round((at - now) / 60_000));
|
|
61
|
-
if (min < 60)
|
|
62
|
-
return rtf.format(min, 'minute');
|
|
63
|
-
if (min < 24 * 60)
|
|
64
|
-
return rtf.format(Math.round(min / 60), 'hour');
|
|
65
|
-
return rtf.format(Math.round(min / (24 * 60)), 'day');
|
|
66
|
-
}
|
|
67
54
|
function ReminderListRow({ reminder, schedule, now, open, onToggle, controls, manageHref, }) {
|
|
68
55
|
const t = useTranslations('reminders');
|
|
69
56
|
const tTriggers = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -76,13 +63,15 @@ function ReminderListRow({ reminder, schedule, now, open, onToggle, controls, ma
|
|
|
76
63
|
// always matches: rest = card, hover = muted at 60% over card, open = muted.
|
|
77
64
|
'bg-(--row-surface) [--row-surface:var(--card)] transition-[background-color] duration-(--duration-fast)', open
|
|
78
65
|
? '[--row-surface:var(--muted)]'
|
|
79
|
-
: 'hover:[--row-surface:color-mix(in_oklab,var(--muted)_60%,var(--card))] has-[button:focus-visible]:[--row-surface:color-mix(in_oklab,var(--muted)_60%,var(--card))]'), children: [_jsxs("button", { type: "button", onClick: onToggle, "aria-expanded": open, "data-testid": "session-reminder-panel-row", className: "flex h-14 w-full items-center gap-3 rounded-md px-3 text-left outline-none", children: [_jsx("span", { className: "flex size-5 shrink-0 items-center justify-center", children: _jsx(ReminderTile, { reminder: reminder }) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "text-foreground truncate text-sm leading-tight font-medium", children: reminderTitle(reminder) }), _jsx("span", { className: "text-muted-foreground truncate text-xs leading-tight", children: schedule })] }), _jsxs("span", { className: "flex shrink-0 flex-col items-end text-xs tabular-nums", children: [_jsx("span", { className: cn('whitespace-nowrap', active ? 'text-foreground' : 'text-muted-foreground'), children: active
|
|
66
|
+
: 'hover:[--row-surface:color-mix(in_oklab,var(--muted)_60%,var(--card))] has-[button:focus-visible]:[--row-surface:color-mix(in_oklab,var(--muted)_60%,var(--card))]'), children: [_jsxs("button", { type: "button", onClick: onToggle, "aria-expanded": open, "data-testid": "session-reminder-panel-row", className: "flex h-14 w-full items-center gap-3 rounded-md px-3 text-left outline-none", children: [_jsx("span", { className: "flex size-5 shrink-0 items-center justify-center", children: _jsx(ReminderTile, { reminder: reminder }) }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "text-foreground truncate text-sm leading-tight font-medium", children: reminderTitle(reminder) }), _jsx("span", { className: "text-muted-foreground truncate text-xs leading-tight", children: schedule })] }), _jsxs("span", { className: "flex shrink-0 flex-col items-end text-xs tabular-nums", children: [_jsx("span", { className: cn('whitespace-nowrap', active ? 'text-foreground' : 'text-muted-foreground'), children: active
|
|
67
|
+
? nextRunIn(reminder.next_fire_at, new Intl.RelativeTimeFormat(locale, { style: 'narrow', numeric: 'auto' }), now)
|
|
68
|
+
: t('pausedLabel') }), _jsx("span", { className: "text-muted-foreground whitespace-nowrap", children: lastRunLabel(asTrigger, tTriggers, locale, now) })] })] }), open ? (
|
|
80
69
|
// Starts under the name: the row's px-3, the 20px clock slot, gap-3.
|
|
81
70
|
_jsxs("div", { className: "space-y-3 pr-3 pb-3 pl-11", children: [reminder.name ? (_jsx("p", { className: "text-muted-foreground text-xs text-pretty whitespace-pre-line", children: reminder.prompt })) : null, _jsx(ReminderFacts, { reminder: reminder, now: now }), _jsx(ReminderActions, { reminder: reminder, controls: controls, manageHref: manageHref, className: "-ml-1.5" })] })) : null] }));
|
|
82
71
|
}
|
|
83
72
|
export function SessionRemindersPanel({ projectId, projectSessionId, }) {
|
|
84
73
|
const t = useTranslations('reminders');
|
|
85
|
-
const now = useNow();
|
|
74
|
+
const now = useNow(30_000);
|
|
86
75
|
const { reminders, controls, confirm } = useReminderControls(projectId ?? null, projectSessionId);
|
|
87
76
|
const hasTab = useCapabilityAccess(projectId).tabs.includes('reminders');
|
|
88
77
|
const manageHref = hasTab && projectId ? `${remindersHref(projectId)}?session=${projectSessionId}` : null;
|