@kortix/ui 0.15.2 → 0.15.4
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 +243 -30
- package/dist/_vendor/shared/channel-descriptors.d.ts +1 -1
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/markdown-math.d.ts +6 -0
- 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-session.js +1 -1
- package/dist/customize/agents/agent-drives-section.d.ts +1 -3
- package/dist/customize/agents/agent-drives-section.js +5 -6
- package/dist/customize/agents/agent-page-chrome.js +1 -1
- package/dist/customize/agents/agent-page.js +6 -7
- package/dist/customize/agents/agent-tabs.d.ts +1 -1
- package/dist/customize/agents/agent-tabs.js +1 -2
- 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 +10 -2
- package/dist/customize/connectors/connectors-page.js +38 -5
- 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-access-fields.js +1 -3
- package/dist/customize/sections/view/agent-editor-catalog.d.ts +5 -6
- package/dist/customize/sections/view/agent-editor-catalog.js +33 -14
- 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.js +2 -2
- 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-explorer.js +64 -43
- 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/components/drive-upload-tray.d.ts +2 -1
- package/dist/files/project/components/drive-upload-tray.js +9 -4
- package/dist/files/project/context.d.ts +1 -1
- package/dist/files/project/context.js +1 -1
- package/dist/files/project/drop-tree.d.ts +16 -0
- package/dist/files/project/drop-tree.js +39 -0
- package/dist/files/project/upload-batch.d.ts +15 -0
- package/dist/files/project/upload-batch.js +12 -0
- 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 +317 -31
- package/dist/i18n/en.js +882 -596
- 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/billing/use-cost-explorer.d.ts +19 -1
- package/dist/internal/billing/use-cost-explorer.js +27 -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 +10 -0
- package/dist/internal/lib/billing/billing-gate-state.js +20 -3
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/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.d.ts +5 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +141 -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/mermaid-utils.js +2 -24
- 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/use-project-can.d.ts +1 -3
- package/dist/internal/lib/use-project-can.js +0 -5
- package/dist/internal/lib/web-notifications.js +5 -5
- package/dist/internal/notifications/notification-inbox.d.ts +8 -2
- package/dist/internal/notifications/notification-inbox.js +8 -5
- package/dist/internal/notifications/use-inbox-summary.d.ts +8 -4
- package/dist/internal/notifications/use-inbox-summary.js +12 -6
- 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/workspace-settings-rail-store.d.ts +67 -0
- package/dist/internal/stores/workspace-settings-rail-store.js +11 -0
- package/dist/lib/routes.js +19 -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/setup-links/setup-link-button.js +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/mermaid-render.js +3 -20
- 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.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +2 -2
- 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-chat-input.d.ts +14 -1
- package/dist/session/composer/composer-chat-input.js +4 -2
- package/dist/session/composer/composer-toolbar.d.ts +22 -17
- package/dist/session/composer/composer-toolbar.js +12 -3
- package/dist/session/composer/composer.d.ts +8 -0
- 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/composer/send-stop-control.d.ts +15 -1
- package/dist/session/composer/send-stop-control.js +30 -5
- package/dist/session/header/session-embed-menu-item.d.ts +12 -0
- package/dist/session/header/session-embed-menu-item.js +30 -0
- package/dist/{workspace/sidebar/modal/session-embed-section.d.ts → session/header/session-embed-snippet.d.ts} +2 -11
- package/dist/session/header/session-embed-snippet.js +21 -0
- 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 +10 -3
- package/dist/session/index.d.ts +1 -1
- package/dist/session/models/ask-owner-for-credits-button.d.ts +7 -1
- package/dist/session/models/ask-owner-for-credits-button.js +3 -2
- 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 +2 -2
- 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 +51 -19
- 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/task-tool.js +9 -2
- 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/session/voice/composer-call.d.ts +31 -0
- package/dist/session/voice/composer-call.js +46 -0
- package/dist/session/voice/voice-call-card.js +2 -0
- package/dist/session/voice/voice-call-store.d.ts +8 -0
- package/dist/session/voice/voice-call-store.js +5 -0
- package/dist/session/voice/voice-call.d.ts +2 -2
- package/dist/session/voice/voice-call.js +6 -6
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +10103 -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/existing-repo-setup-prompt.d.ts +22 -0
- package/dist/workspace/home/existing-repo-setup-prompt.js +57 -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/instant-session-shell.js +11 -1
- package/dist/workspace/layout/project-files-view.js +1 -1
- package/dist/workspace/layout/project-home.js +84 -11
- package/dist/workspace/layout/use-project-home-call.d.ts +24 -0
- package/dist/workspace/layout/use-project-home-call.js +56 -0
- 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 +14 -1
- package/dist/workspace/new/workspace-name.js +21 -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-balance-warning.js +9 -6
- 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/footer/sidebar-alert.d.ts +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/share-session-access.js +1 -1
- package/dist/workspace/sidebar/modal/share-session-modal.js +4 -5
- package/dist/workspace/sidebar/project-nav-items.js +14 -25
- package/dist/workspace/sidebar/project-sidebar.js +17 -2
- 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 +55 -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/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/lib/use-project-feature-flags.d.ts +0 -28
- package/dist/internal/lib/use-project-feature-flags.js +0 -76
- 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
- package/dist/workspace/sidebar/modal/session-embed-section.js +0 -71
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Embed" in the session menu: the snippet for framing the actual session
|
|
3
|
+
* page, with its caveat. The entry point left the Session access dialog
|
|
4
|
+
* (KRTX-4639) — a developer affordance does not belong in a permissions
|
|
5
|
+
* dialog — and this submenu is its one home. The caller gates the mount on
|
|
6
|
+
* the same verdicts the dialog's section used: the viewer may manage sharing
|
|
7
|
+
* (`can_manage_sharing`) and the host serves public shares.
|
|
8
|
+
*/
|
|
9
|
+
export declare function SessionEmbedMenuItem({ projectId, sessionId }: {
|
|
10
|
+
projectId: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownMenuItem, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, } from '../../primitives/dropdown-menu.js';
|
|
4
|
+
import { errorToast, successToast } from '../../primitives/toast.js';
|
|
5
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
6
|
+
import { CodeIcon } from '@phosphor-icons/react';
|
|
7
|
+
import { copyToClipboard } from '../../internal/lib/utils/clipboard.js';
|
|
8
|
+
import { sessionEmbedSnippet } from './session-embed-snippet.js';
|
|
9
|
+
/**
|
|
10
|
+
* "Embed" in the session menu: the snippet for framing the actual session
|
|
11
|
+
* page, with its caveat. The entry point left the Session access dialog
|
|
12
|
+
* (KRTX-4639) — a developer affordance does not belong in a permissions
|
|
13
|
+
* dialog — and this submenu is its one home. The caller gates the mount on
|
|
14
|
+
* the same verdicts the dialog's section used: the viewer may manage sharing
|
|
15
|
+
* (`can_manage_sharing`) and the host serves public shares.
|
|
16
|
+
*/
|
|
17
|
+
export function SessionEmbedMenuItem({ projectId, sessionId }) {
|
|
18
|
+
const t = useTranslations('hardcodedUi.sessionEmbed');
|
|
19
|
+
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
20
|
+
const copy = async () => {
|
|
21
|
+
const snippet = sessionEmbedSnippet(projectId, sessionId, window.location.origin);
|
|
22
|
+
if (!snippet)
|
|
23
|
+
return;
|
|
24
|
+
if (await copyToClipboard(snippet))
|
|
25
|
+
successToast(t.raw('copied'));
|
|
26
|
+
else
|
|
27
|
+
errorToast(tI18nComplete.raw('text167c96824acb'));
|
|
28
|
+
};
|
|
29
|
+
return (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { className: "cursor-pointer", children: [_jsx(CodeIcon, {}), t.raw('sectionTitle')] }), _jsxs(DropdownMenuSubContent, { className: "w-64", children: [_jsx("p", { className: "text-muted-foreground px-2 py-1.5 text-xs", children: t.raw('sectionDescription') }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => void copy(), children: [_jsx(CodeIcon, {}), t.raw('copy')] })] })] }));
|
|
30
|
+
}
|
|
@@ -7,19 +7,10 @@
|
|
|
7
7
|
* the `title` attribute is a fixed string. Never interpolate a session title
|
|
8
8
|
* into the attribute — an unescaped quote would break out of it on the HOST
|
|
9
9
|
* page, which does not share this app's CSP.
|
|
10
|
-
|
|
11
|
-
export declare function sessionEmbedSnippet(projectId: string, sessionId: string, origin: string): string | null;
|
|
12
|
-
/**
|
|
13
|
-
* "Embed" in the Share dialog: one copy button for the iframe snippet above.
|
|
10
|
+
*
|
|
14
11
|
* Framing the session page is allowed by the CSP `frame-ancestors` rule on
|
|
15
12
|
* that route (next.config.ts); the viewer inside the frame is the app's own
|
|
16
13
|
* auth. Same-site embeds require an existing signed-in session; cross-site
|
|
17
14
|
* embeds cannot sign in inside the frame (SameSite=Lax and /auth's CSP).
|
|
18
|
-
*
|
|
19
|
-
* Mounted inside `ModalContent`, so `window` is read at render time of an open
|
|
20
|
-
* dialog, never during SSR.
|
|
21
15
|
*/
|
|
22
|
-
export declare function
|
|
23
|
-
projectId: string;
|
|
24
|
-
sessionId: string;
|
|
25
|
-
}): import("react").JSX.Element;
|
|
16
|
+
export declare function sessionEmbedSnippet(projectId: string, sessionId: string, origin: string): string | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iframe snippet a host page pastes: the ACTUAL session page
|
|
3
|
+
* (`/projects/:projectId/sessions/:sessionId`), not a separate widget or
|
|
4
|
+
* viewer. Pure, so the test can pin the exact HTML without a browser.
|
|
5
|
+
*
|
|
6
|
+
* The snippet is static HTML by construction: the URL is built from ids, and
|
|
7
|
+
* the `title` attribute is a fixed string. Never interpolate a session title
|
|
8
|
+
* into the attribute — an unescaped quote would break out of it on the HOST
|
|
9
|
+
* page, which does not share this app's CSP.
|
|
10
|
+
*
|
|
11
|
+
* Framing the session page is allowed by the CSP `frame-ancestors` rule on
|
|
12
|
+
* that route (next.config.ts); the viewer inside the frame is the app's own
|
|
13
|
+
* auth. Same-site embeds require an existing signed-in session; cross-site
|
|
14
|
+
* embeds cannot sign in inside the frame (SameSite=Lax and /auth's CSP).
|
|
15
|
+
*/
|
|
16
|
+
export function sessionEmbedSnippet(projectId, sessionId, origin) {
|
|
17
|
+
if (!projectId || !sessionId || !origin)
|
|
18
|
+
return null;
|
|
19
|
+
const src = `${origin}/workspaces/${encodeURIComponent(projectId)}/sessions/${encodeURIComponent(sessionId)}`;
|
|
20
|
+
return `<iframe src="${src}" style="height:640px;width:100%;border:0;border-radius:12px" title="Kortix session" loading="lazy"></iframe>`;
|
|
21
|
+
}
|
|
@@ -9,12 +9,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
9
9
|
* needs attention, so a broken goal is visible from its own session.
|
|
10
10
|
*/
|
|
11
11
|
import { HoverPrefetchLink } from '../../internal/components/hover-prefetch-link.js';
|
|
12
|
-
import { useNow } from '../../internal/reminders/use-refetch-after-fire.js';
|
|
13
12
|
import { Button } from '../../primitives/button.js';
|
|
14
13
|
import { Popover, PopoverContent, PopoverTrigger } from '../../primitives/popover.js';
|
|
15
14
|
import { StatusDot } from '../../primitives/status.js';
|
|
16
15
|
import { useLocale, useTranslations } from '../../i18n/index.js';
|
|
17
|
-
import { useFeatureFlag, useSessionGoal } from '@kortix/sdk/react';
|
|
16
|
+
import { useFeatureFlag, useNow, useSessionGoal } from '@kortix/sdk/react';
|
|
18
17
|
import { TargetIcon } from '@phosphor-icons/react';
|
|
19
18
|
import { useState } from 'react';
|
|
20
19
|
import { useSessionIds } from '../../providers/session-ids.js';
|
|
@@ -22,7 +21,7 @@ import { formatGoalTime, GoalHealthDot, goalHref, goalLastWake, goalNextWake, go
|
|
|
22
21
|
export function SessionGoalIndicator() {
|
|
23
22
|
const t = useTranslations('goals');
|
|
24
23
|
const locale = useLocale();
|
|
25
|
-
const now = useNow();
|
|
24
|
+
const now = useNow(30_000);
|
|
26
25
|
const { projectId, sessionId } = useSessionIds();
|
|
27
26
|
const gate = useFeatureFlag(projectId, 'goals');
|
|
28
27
|
const { goal, role } = useSessionGoal(gate.enabled ? projectId : null, sessionId);
|
|
@@ -23,10 +23,10 @@ import { useCapabilityAccess } from '../../internal/layout/project-settings-nav.
|
|
|
23
23
|
import { BELL_REFLECTION_MASK } from '../../internal/notifications/notification-bell.js';
|
|
24
24
|
import { badgeCount } from '../../internal/notifications/notification-rows.js';
|
|
25
25
|
import { reminderTitle } from '../../internal/reminders/reminder-format.js';
|
|
26
|
-
import {
|
|
26
|
+
import { useRefetchAfterFire } from '../../internal/reminders/use-refetch-after-fire.js';
|
|
27
27
|
import { cn } from '../../internal/lib/utils.js';
|
|
28
28
|
import { useTranslations } from '../../i18n/index.js';
|
|
29
|
-
import { qk, useFeatureFlag, useSessionWorking } from '@kortix/sdk/react';
|
|
29
|
+
import { qk, useFeatureFlag, useNow, useSessionWorking } from '@kortix/sdk/react';
|
|
30
30
|
import { AlarmIcon, PauseIcon, PlayIcon, TrashIcon } from '@phosphor-icons/react';
|
|
31
31
|
import { useQueryClient } from '@tanstack/react-query';
|
|
32
32
|
import { useSessionIds } from '../../providers/session-ids.js';
|
|
@@ -119,7 +119,7 @@ export function SessionRemindersIndicator({ runtimeSessionId }) {
|
|
|
119
119
|
const gate = useFeatureFlag(projectId, 'reminders');
|
|
120
120
|
const { reminders, controls, confirm } = useReminderControls(gate.enabled ? projectId : null, sessionId);
|
|
121
121
|
useRefetchAfterFire(reminders.data?.reminders, reminders.refetch);
|
|
122
|
-
const now = useNow();
|
|
122
|
+
const now = useNow(30_000);
|
|
123
123
|
const hasTab = useCapabilityAccess(projectId).tabs.includes('reminders');
|
|
124
124
|
// Null when the host serves no customize pages: no "Open in Reminders" link.
|
|
125
125
|
const manageHref = hasTab ? `${remindersHref(projectId)}?session=${sessionId}` : null;
|
|
@@ -25,6 +25,7 @@ import { SessionPendingApprovalsIndicator } from './session-pending-approvals-in
|
|
|
25
25
|
import { SessionGoalIndicator } from './session-goal-indicator.js';
|
|
26
26
|
import { SessionRemindersIndicator } from './session-reminders-indicator.js';
|
|
27
27
|
import { SessionTitleInput } from './session-title-input.js';
|
|
28
|
+
import { SessionEmbedMenuItem } from './session-embed-menu-item.js';
|
|
28
29
|
import { subagentTitle } from '../agents/agent-model.js';
|
|
29
30
|
import { SubagentHoverCard } from './subagent-hover-card.js';
|
|
30
31
|
import { Copy } from '../../icons/copy.js';
|
|
@@ -63,7 +64,7 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
63
64
|
const tPinArchive = useTranslations('sidebar.pinArchive');
|
|
64
65
|
const localizedDevTools = useLocalizedUiCatalog(DEV_TOOLS);
|
|
65
66
|
// A host that cannot reach the pty WebSocket turns the terminal off (`config.terminalEnabled`).
|
|
66
|
-
const { terminalEnabled } = useUiHostConfig();
|
|
67
|
+
const { terminalEnabled, publicSharesEnabled } = useUiHostConfig();
|
|
67
68
|
// A template on a base other than Ubuntu 24.04, or an old image, has no desktop.
|
|
68
69
|
const hasDesktop = useHasSessionDesktop() === true;
|
|
69
70
|
const devTools = useMemo(() => localizedDevTools.filter((tool) => (tool.view !== 'terminal' || terminalEnabled) && (tool.view !== 'desktop' || hasDesktop)), [localizedDevTools, terminalEnabled, hasDesktop]);
|
|
@@ -104,7 +105,7 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
104
105
|
// The ids come from the session view (`SessionIdsProvider`); a host whose
|
|
105
106
|
// URL has another shape still gets them. apps/web's route is the fallback.
|
|
106
107
|
const sessionIds = useSessionIds();
|
|
107
|
-
const projectRoute = pathname?.match(/^\/projects\/([^/]+)\/sessions\/([^/]+)/);
|
|
108
|
+
const projectRoute = pathname?.match(/^\/(?:workspaces|projects)\/([^/]+)\/sessions\/([^/]+)/);
|
|
108
109
|
const projectId = sessionIds.projectId ?? projectRoute?.[1];
|
|
109
110
|
const projectSessionId = sessionIds.sessionId ?? projectRoute?.[2];
|
|
110
111
|
const isProjectSession = !!projectId && !!projectSessionId;
|
|
@@ -243,10 +244,16 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
243
244
|
else
|
|
244
245
|
errorToast(tPalette('copyFailed'));
|
|
245
246
|
};
|
|
247
|
+
// The embed snippet left the Session access dialog (KRTX-4639): a developer
|
|
248
|
+
// affordance does not belong in a permissions dialog. Its one entry point is
|
|
249
|
+
// the Embed submenu in the session menu below, gated like the dialog's
|
|
250
|
+
// section was: the same `can_manage_sharing` server verdict, and the host
|
|
251
|
+
// serves public shares at all.
|
|
252
|
+
const canEmbed = isProjectSession && canManageSharing && publicSharesEnabled;
|
|
246
253
|
const sessionActionItems = (_jsxs(_Fragment, { children: [isProjectSession && (_jsxs(_Fragment, { children: [canRename && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => {
|
|
247
254
|
renameFromMenu.current = true;
|
|
248
255
|
startRename();
|
|
249
|
-
}, children: [_jsx(PencilSimpleIcon, {}), tI18nHardcoded.raw('autoFeaturesSessionHeaderSessionSiteHeaderJsxTextRename41731a53')] }), _jsx(DropdownMenuSeparator, {})] })), canManageLifecycle && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: restartMutation.isPending, onClick: () => restartMutation.mutate(), children: [restartMutation.isPending ? _jsx(Loading, {}) : _jsx(RotateCcw, {}), tI18nHardcoded.raw('i18nComplete.text6b983a81e5e8')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: reloadConfig.isPending, onClick: () => reloadConfig.reload(), children: [reloadConfig.isPending ? _jsx(Loading, {}) : _jsx(ArrowsClockwiseIcon, {}), tI18nHardcoded.raw('i18nComplete.textb4b21a20cc58')] }), canStop && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: stopMutation.isPending, onClick: () => stopMutation.mutate(), children: [stopMutation.isPending ? _jsx(Loading, {}) : _jsx(Square, {}), tI18nHardcoded.raw('i18nComplete.textcae7d57bc067')] })), _jsx(DropdownMenuSeparator, {})] }))] })), isProjectSession && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => copyValue(tPalette('copySessionId'), projectSessionId), children: [_jsx(Copy, {}), tPalette('copyAction', { label: tPalette('copySessionId') })] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => copyValue(tPalette('copySessionLink'), window.location.href), children: [_jsx(LinkSimpleIcon, {}), tPalette('copyAction', { label: tPalette('copySessionLink') })] }), watching !== undefined && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: toggleWatch, children: [watching ? _jsx(BellSlashIcon, {}) : _jsx(BellIcon, {}), watching ? tNotifications('session.mute') : tNotifications('session.unmute')] })), listState && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => void listActions.setPinned(projectSessionId, !listState.pinned), children: [listState.pinned ? _jsx(PushPinSlashIcon, {}) : _jsx(PushPinIcon, {}), tPinArchive(listState.pinned ? 'unpin' : 'pin')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => void listActions.setArchived(projectSessionId, !listState.archived), children: [_jsx(ArchiveIcon, {}), tPinArchive(listState.archived ? 'unarchive' : 'archive')] })] })), canFork && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: forkSession.isPending, onClick: () => forkSession.mutate({ sessionId: projectSessionId }, {
|
|
256
|
+
}, children: [_jsx(PencilSimpleIcon, {}), tI18nHardcoded.raw('autoFeaturesSessionHeaderSessionSiteHeaderJsxTextRename41731a53')] }), _jsx(DropdownMenuSeparator, {})] })), canManageLifecycle && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: restartMutation.isPending, onClick: () => restartMutation.mutate(), children: [restartMutation.isPending ? _jsx(Loading, {}) : _jsx(RotateCcw, {}), tI18nHardcoded.raw('i18nComplete.text6b983a81e5e8')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: reloadConfig.isPending, onClick: () => reloadConfig.reload(), children: [reloadConfig.isPending ? _jsx(Loading, {}) : _jsx(ArrowsClockwiseIcon, {}), tI18nHardcoded.raw('i18nComplete.textb4b21a20cc58')] }), canStop && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: stopMutation.isPending, onClick: () => stopMutation.mutate(), children: [stopMutation.isPending ? _jsx(Loading, {}) : _jsx(Square, {}), tI18nHardcoded.raw('i18nComplete.textcae7d57bc067')] })), _jsx(DropdownMenuSeparator, {})] }))] })), isProjectSession && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => copyValue(tPalette('copySessionId'), projectSessionId), children: [_jsx(Copy, {}), tPalette('copyAction', { label: tPalette('copySessionId') })] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => copyValue(tPalette('copySessionLink'), window.location.href), children: [_jsx(LinkSimpleIcon, {}), tPalette('copyAction', { label: tPalette('copySessionLink') })] }), canEmbed && projectId && projectSessionId && (_jsx(SessionEmbedMenuItem, { projectId: projectId, sessionId: projectSessionId })), watching !== undefined && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: toggleWatch, children: [watching ? _jsx(BellSlashIcon, {}) : _jsx(BellIcon, {}), watching ? tNotifications('session.mute') : tNotifications('session.unmute')] })), listState && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => void listActions.setPinned(projectSessionId, !listState.pinned), children: [listState.pinned ? _jsx(PushPinSlashIcon, {}) : _jsx(PushPinIcon, {}), tPinArchive(listState.pinned ? 'unpin' : 'pin')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => void listActions.setArchived(projectSessionId, !listState.archived), children: [_jsx(ArchiveIcon, {}), tPinArchive(listState.archived ? 'unarchive' : 'archive')] })] })), canFork && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: forkSession.isPending, onClick: () => forkSession.mutate({ sessionId: projectSessionId }, {
|
|
250
257
|
onSuccess: (fork) => {
|
|
251
258
|
successToast(tI18nHardcoded.raw('i18nComplete.text95de71e25038'));
|
|
252
259
|
if (projectId && projectSessionId) {
|
package/dist/session/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { BasicTool } from './tool/shared/infrastructure-rows.js';
|
|
|
29
29
|
export { GenericTool } from './tool/generic-tool.js';
|
|
30
30
|
export { SessionChatInput, type SessionChatInputProps } from './composer/session-chat-input.js';
|
|
31
31
|
export { AgentSelector } from './composer/agent-selector.js';
|
|
32
|
-
export { ModelSelector, type ModelSelectorProps } from './models/model-selector.js';
|
|
32
|
+
export { ModelSelector, type ModelSelectorProps, type ModelReasoningControls } from './models/model-selector.js';
|
|
33
33
|
export { SessionPermissionPrompt } from './prompts/session-permission-prompt.js';
|
|
34
34
|
export { QuestionPrompt, type QuestionPromptHandle } from './prompts/question-prompt.js';
|
|
35
35
|
export { TurnErrorDisplay } from './status/session-error-banner.js';
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { Button } from '../../primitives/button.js';
|
|
1
3
|
/**
|
|
2
4
|
* KRTX-1718: the member's way to tell an owner, from where they are blocked.
|
|
3
5
|
* Emails every owner; the API takes one request per member a day (429 after).
|
|
4
6
|
*/
|
|
5
|
-
export declare function AskOwnerForCreditsButton({ accountId }: {
|
|
7
|
+
export declare function AskOwnerForCreditsButton({ accountId, variant, size, className, }: {
|
|
6
8
|
accountId: string;
|
|
9
|
+
/** Defaults to the banner's outline `sm`; the out-of-credits modal makes it its primary action. */
|
|
10
|
+
variant?: ComponentProps<typeof Button>['variant'];
|
|
11
|
+
size?: ComponentProps<typeof Button>['size'];
|
|
12
|
+
className?: string;
|
|
7
13
|
}): import("react").JSX.Element;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { Button } from '../../primitives/button.js';
|
|
5
|
+
import { cn } from '../../lib/utils.js';
|
|
5
6
|
import Loading from '../../primitives/loading.js';
|
|
6
7
|
import { useTranslations } from '../../i18n/index.js';
|
|
7
8
|
import { requestTopUp } from '@kortix/sdk';
|
|
@@ -9,7 +10,7 @@ import { requestTopUp } from '@kortix/sdk';
|
|
|
9
10
|
* KRTX-1718: the member's way to tell an owner, from where they are blocked.
|
|
10
11
|
* Emails every owner; the API takes one request per member a day (429 after).
|
|
11
12
|
*/
|
|
12
|
-
export function AskOwnerForCreditsButton({ accountId }) {
|
|
13
|
+
export function AskOwnerForCreditsButton({ accountId, variant = 'outline', size = 'sm', className, }) {
|
|
13
14
|
const tHardcodedUi = useTranslations('hardcodedUi');
|
|
14
15
|
const [state, setState] = useState('idle');
|
|
15
16
|
const label = state === 'asked'
|
|
@@ -29,5 +30,5 @@ export function AskOwnerForCreditsButton({ accountId }) {
|
|
|
29
30
|
setState(err?.status === 429 ? 'already' : 'failed');
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
|
-
return (_jsxs(Button, { variant:
|
|
33
|
+
return (_jsxs(Button, { variant: variant, size: size, className: cn('active:scale-[0.96]', className), disabled: state === 'asking' || state === 'asked' || state === 'already', onClick: () => void ask(), children: [state === 'asking' ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tHardcodedUi.raw(`componentsSessionSessionErrorBanner.${label}`)] }));
|
|
33
34
|
}
|
|
@@ -26,6 +26,17 @@ export declare function unavailableModelConnection(model: {
|
|
|
26
26
|
}, options: {
|
|
27
27
|
chatGptAvailable: boolean;
|
|
28
28
|
}): 'chatgpt' | 'claude' | 'provider' | null;
|
|
29
|
+
/**
|
|
30
|
+
* True when a ChatGPT or Claude plan already serves a runnable model. The
|
|
31
|
+
* composer's connect prompt reads it: once a plan is connected it has nothing
|
|
32
|
+
* left to offer a project that already has Kortix models.
|
|
33
|
+
*/
|
|
34
|
+
export declare function hasRunnableSubscriptionModel(models: ReadonlyArray<{
|
|
35
|
+
enabled?: boolean;
|
|
36
|
+
available?: boolean;
|
|
37
|
+
providerID?: string;
|
|
38
|
+
provider?: string | null;
|
|
39
|
+
}>): boolean;
|
|
29
40
|
export declare function resolveAvailableSelectedModel(selectedModel: ModelKey | null | undefined, isSelectableModel: (model: ModelKey) => boolean): ModelKey | null;
|
|
30
41
|
/**
|
|
31
42
|
* The name of the selected model when it cannot read an attached image, else null.
|
|
@@ -23,6 +23,18 @@ export function unavailableModelConnection(model, options) {
|
|
|
23
23
|
return 'claude';
|
|
24
24
|
return model.availability === 'login' && options.chatGptAvailable ? 'chatgpt' : 'provider';
|
|
25
25
|
}
|
|
26
|
+
/** Providers that run on a member's own ChatGPT or Claude plan. */
|
|
27
|
+
const SUBSCRIPTION_PROVIDER_IDS = new Set(['codex', 'claude-agent']);
|
|
28
|
+
/**
|
|
29
|
+
* True when a ChatGPT or Claude plan already serves a runnable model. The
|
|
30
|
+
* composer's connect prompt reads it: once a plan is connected it has nothing
|
|
31
|
+
* left to offer a project that already has Kortix models.
|
|
32
|
+
*/
|
|
33
|
+
export function hasRunnableSubscriptionModel(models) {
|
|
34
|
+
return models.some((model) => (SUBSCRIPTION_PROVIDER_IDS.has(model.providerID ?? '') ||
|
|
35
|
+
SUBSCRIPTION_PROVIDER_IDS.has(model.provider ?? '')) &&
|
|
36
|
+
isRunnableModel(model));
|
|
37
|
+
}
|
|
26
38
|
export function resolveAvailableSelectedModel(selectedModel, isSelectableModel) {
|
|
27
39
|
if (!selectedModel)
|
|
28
40
|
return null;
|
|
@@ -1,37 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* offers the same two ways out as the full gate.
|
|
2
|
+
* No model can run: the composer shows the same "Connect ChatGPT" and "Connect
|
|
3
|
+
* Claude" rows the project home offers (`ConnectPlanRows`), a gap below the
|
|
4
|
+
* composer, not dismissible. Sending is already disabled by `modelUnavailable`.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* It used to be a heading ("Connect a model to start"), two bordered tiles,
|
|
7
|
+
* "Use an API key" and "Upgrade". On the project home it stacked on top of the
|
|
8
|
+
* optional offer and read as a block. Other providers and API keys stay one
|
|
9
|
+
* click away in the model picker and the provider dialog.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
* (`-mt-4` on the clipper, cancelled by `pt-4` on the strip), so the card —
|
|
11
|
-
* `isolate z-10`, opaque `bg-sidebar` — paints over the overlap. What is left
|
|
12
|
-
* is one surface: the composer, with a deeper strip hanging off its bottom
|
|
13
|
-
* edge and showing through the card's own rounded bottom corners.
|
|
14
|
-
*
|
|
15
|
-
* The overlap is why the card needs NO conditional radius. A flush seam would
|
|
16
|
-
* have meant `rounded-b-none` on the card while this is mounted, and the card
|
|
17
|
-
* would snap its corners back the instant `show` flipped — 350ms of square
|
|
18
|
-
* corner sitting above a strip that is still animating out. Here the card is
|
|
19
|
-
* untouched and only the tray moves.
|
|
20
|
-
*
|
|
21
|
-
* `-mt-4` lives on the clipper, never on the strip inside it: the clipper is
|
|
22
|
-
* `overflow-hidden` for the height animation, so a negative margin on its
|
|
23
|
-
* child would be clipped away instead of overlapping anything.
|
|
24
|
-
*
|
|
25
|
-
* `show` must only flip on settled data (see `entitlementsPending`) — the
|
|
26
|
-
* animation assumes it renders once with the final answer, not per-query.
|
|
11
|
+
* `show` must only flip on settled data (see `entitlementsPending`).
|
|
27
12
|
*/
|
|
28
13
|
export declare function ModelConnectionBar({ show }: {
|
|
29
14
|
show: boolean;
|
|
30
|
-
}): import("react").JSX.Element;
|
|
15
|
+
}): import("react").JSX.Element | null;
|
|
31
16
|
/**
|
|
32
17
|
* One line under the card when the selected model cannot read an attached image
|
|
33
|
-
* (`modelRejectingAttachedImages`). Send is refused with the same words. The
|
|
34
|
-
*
|
|
18
|
+
* (`modelRejectingAttachedImages`). Send is refused with the same words. The
|
|
19
|
+
* composer never shows it beside `ModelConnectionBar`.
|
|
35
20
|
*/
|
|
36
21
|
export declare function ImagesUnsupportedBar({ modelName }: {
|
|
37
22
|
modelName: string | null;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ImageBrokenIcon } from '@phosphor-icons/react';
|
|
4
4
|
import { AnimatePresence, m, useReducedMotion } from 'motion/react';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { useTranslations } from '../../i18n/index.js';
|
|
7
|
-
import {
|
|
8
|
-
import { useModelConnectionGate } from './use-model-connection-gate.js';
|
|
9
|
-
/** Stable empty list so the hook's `models = []` default isn't re-allocated per render. */
|
|
10
|
-
const EMPTY_MODELS = [];
|
|
7
|
+
import { ConnectPlanRows } from './subscription-offer.js';
|
|
11
8
|
// Enter waits a beat (delay) so the composer paints first, then the bar slides
|
|
12
9
|
// out from under it — height opens the space while the strip translates down,
|
|
13
10
|
// same spring on both so they move as one surface. Exit runs faster than enter
|
|
@@ -15,41 +12,24 @@ const EMPTY_MODELS = [];
|
|
|
15
12
|
const BAR_ENTER = { type: 'spring', duration: 0.5, bounce: 0, delay: 0.15 };
|
|
16
13
|
const BAR_EXIT = { type: 'spring', duration: 0.35, bounce: 0 };
|
|
17
14
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* offers the same two ways out as the full gate.
|
|
15
|
+
* No model can run: the composer shows the same "Connect ChatGPT" and "Connect
|
|
16
|
+
* Claude" rows the project home offers (`ConnectPlanRows`), a gap below the
|
|
17
|
+
* composer, not dismissible. Sending is already disabled by `modelUnavailable`.
|
|
22
18
|
*
|
|
23
|
-
*
|
|
19
|
+
* It used to be a heading ("Connect a model to start"), two bordered tiles,
|
|
20
|
+
* "Use an API key" and "Upgrade". On the project home it stacked on top of the
|
|
21
|
+
* optional offer and read as a block. Other providers and API keys stay one
|
|
22
|
+
* click away in the model picker and the provider dialog.
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
* (`-mt-4` on the clipper, cancelled by `pt-4` on the strip), so the card —
|
|
27
|
-
* `isolate z-10`, opaque `bg-sidebar` — paints over the overlap. What is left
|
|
28
|
-
* is one surface: the composer, with a deeper strip hanging off its bottom
|
|
29
|
-
* edge and showing through the card's own rounded bottom corners.
|
|
30
|
-
*
|
|
31
|
-
* The overlap is why the card needs NO conditional radius. A flush seam would
|
|
32
|
-
* have meant `rounded-b-none` on the card while this is mounted, and the card
|
|
33
|
-
* would snap its corners back the instant `show` flipped — 350ms of square
|
|
34
|
-
* corner sitting above a strip that is still animating out. Here the card is
|
|
35
|
-
* untouched and only the tray moves.
|
|
36
|
-
*
|
|
37
|
-
* `-mt-4` lives on the clipper, never on the strip inside it: the clipper is
|
|
38
|
-
* `overflow-hidden` for the height animation, so a negative margin on its
|
|
39
|
-
* child would be clipped away instead of overlapping anything.
|
|
40
|
-
*
|
|
41
|
-
* `show` must only flip on settled data (see `entitlementsPending`) — the
|
|
42
|
-
* animation assumes it renders once with the final answer, not per-query.
|
|
24
|
+
* `show` must only flip on settled data (see `entitlementsPending`).
|
|
43
25
|
*/
|
|
44
26
|
export function ModelConnectionBar({ show }) {
|
|
45
|
-
|
|
46
|
-
const { canConnectProvider, openConnectProvider, openUpgrade, modal, showUpgradeOption } = useModelConnectionGate(EMPTY_MODELS);
|
|
47
|
-
return (_jsxs(_Fragment, { children: [modal, _jsxs(ComposerTray, { show: show, trayKey: "model-connection-bar", children: [_jsxs("div", { className: "text-muted-foreground flex min-w-0 items-center gap-2 text-xs", children: [_jsx(KeyIcon, { className: "size-3.5 shrink-0" }), _jsxs("span", { className: "truncate", children: [t('barTitle'), _jsxs("span", { className: "hidden sm:inline", children: [" \u2014 ", t('barDescription')] })] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [showUpgradeOption && (_jsxs(Button, { type: "button", variant: "ghost", size: "xs", onClick: openUpgrade, children: [_jsx(CreditCardIcon, { className: "size-3.5 shrink-0" }), t('upgrade')] })), canConnectProvider && (_jsx(Button, { type: "button", size: "xs", onClick: () => openConnectProvider('providers'), children: t('connectModel') }))] })] })] }));
|
|
27
|
+
return show ? _jsx(ConnectPlanRows, { dismissible: false, className: "mt-4" }) : null;
|
|
48
28
|
}
|
|
49
29
|
/**
|
|
50
30
|
* One line under the card when the selected model cannot read an attached image
|
|
51
|
-
* (`modelRejectingAttachedImages`). Send is refused with the same words. The
|
|
52
|
-
*
|
|
31
|
+
* (`modelRejectingAttachedImages`). Send is refused with the same words. The
|
|
32
|
+
* composer never shows it beside `ModelConnectionBar`.
|
|
53
33
|
*/
|
|
54
34
|
export function ImagesUnsupportedBar({ modelName }) {
|
|
55
35
|
const t = useTranslations('sessionUi.modelGate');
|
|
@@ -59,7 +39,14 @@ export function ImagesUnsupportedBar({ modelName }) {
|
|
|
59
39
|
setShownName(modelName);
|
|
60
40
|
return (_jsx(ComposerTray, { show: modelName !== null, trayKey: "images-unsupported-bar", children: _jsxs("div", { className: "text-muted-foreground flex min-w-0 items-center gap-2 text-xs", children: [_jsx(ImageBrokenIcon, { className: "size-3.5 shrink-0" }), _jsxs("span", { className: "truncate", children: [t('imagesUnsupported', { model: shownName ?? '' }), _jsxs("span", { className: "hidden sm:inline", children: [" \u2014 ", t('imagesUnsupportedHint')] })] })] }) }));
|
|
61
41
|
}
|
|
62
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* A strip that hangs behind the card's bottom edge: rendered as the card's next
|
|
44
|
+
* sibling, pulled up under it (`-mt-4` on the clipper, cancelled by `pt-4` on
|
|
45
|
+
* the strip), so the card — `isolate z-10`, opaque — paints over the overlap.
|
|
46
|
+
* `-mt-4` lives on the clipper, never on the strip: the clipper is
|
|
47
|
+
* `overflow-hidden` for the height animation and would clip a negative margin
|
|
48
|
+
* on its child.
|
|
49
|
+
*/
|
|
63
50
|
function ComposerTray({ show, trayKey, children, }) {
|
|
64
51
|
const reduceMotion = useReducedMotion();
|
|
65
52
|
return (_jsx(AnimatePresence, { initial: false, children: show && (_jsx(m.div, { initial: reduceMotion ? { opacity: 0 } : { height: 0 }, animate: reduceMotion
|
|
@@ -83,3 +83,33 @@ export declare function buildPickerSections(groups: readonly {
|
|
|
83
83
|
providerName: string;
|
|
84
84
|
models: FlatModel[];
|
|
85
85
|
}[]): PickerSection[];
|
|
86
|
+
/**
|
|
87
|
+
* The picker's left rail: Favorites, then where a model comes from. `kortix`
|
|
88
|
+
* holds the managed set, `chatgpt` the models billed to a connected ChatGPT
|
|
89
|
+
* plan, and every provider the workspace connected itself gets its own tab,
|
|
90
|
+
* keyed by its real provider id (`pickerGroupId`: `anthropic`, `deepseek`, …).
|
|
91
|
+
*/
|
|
92
|
+
export type PickerTabId = 'favorites' | 'kortix' | 'chatgpt' | (string & {});
|
|
93
|
+
export declare function pickerTabOf(model: Pick<FlatModel, 'providerID' | 'modelID' | 'provider'>): string;
|
|
94
|
+
/**
|
|
95
|
+
* The rail's tabs, in order: Favorites (always: it is where a star lands, and
|
|
96
|
+
* its empty state says how to fill it), Kortix, ChatGPT, then each provider in
|
|
97
|
+
* `providerOrder` (the picker's provider order), then the rest by id. A source
|
|
98
|
+
* tab shows only when it holds a model, except ChatGPT, which also shows when
|
|
99
|
+
* the member can connect a ChatGPT plan from it.
|
|
100
|
+
*/
|
|
101
|
+
export declare function pickerTabs(models: readonly Pick<FlatModel, 'providerID' | 'modelID' | 'provider'>[], opts?: {
|
|
102
|
+
canConnectChatGpt?: boolean;
|
|
103
|
+
providerOrder?: readonly string[];
|
|
104
|
+
}): PickerTabId[];
|
|
105
|
+
/**
|
|
106
|
+
* The tab the picker opens on: Favorites when the current model is starred,
|
|
107
|
+
* else the tab that holds the current model, else Favorites when anything is
|
|
108
|
+
* starred, else the first source tab.
|
|
109
|
+
*/
|
|
110
|
+
export declare function initialPickerTab(input: {
|
|
111
|
+
tabs: readonly PickerTabId[];
|
|
112
|
+
selected: Pick<FlatModel, 'providerID' | 'modelID' | 'provider'> | null | undefined;
|
|
113
|
+
selectedIsFavorite: boolean;
|
|
114
|
+
hasFavorites: boolean;
|
|
115
|
+
}): PickerTabId;
|
|
@@ -120,3 +120,49 @@ export function buildPickerSections(groups) {
|
|
|
120
120
|
models: group.models,
|
|
121
121
|
}));
|
|
122
122
|
}
|
|
123
|
+
export function pickerTabOf(model) {
|
|
124
|
+
if (model.provider === 'codex' || model.modelID.startsWith('codex/'))
|
|
125
|
+
return 'chatgpt';
|
|
126
|
+
return pickerGroupId(model);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The rail's tabs, in order: Favorites (always: it is where a star lands, and
|
|
130
|
+
* its empty state says how to fill it), Kortix, ChatGPT, then each provider in
|
|
131
|
+
* `providerOrder` (the picker's provider order), then the rest by id. A source
|
|
132
|
+
* tab shows only when it holds a model, except ChatGPT, which also shows when
|
|
133
|
+
* the member can connect a ChatGPT plan from it.
|
|
134
|
+
*/
|
|
135
|
+
export function pickerTabs(models, opts = {}) {
|
|
136
|
+
const present = new Set(models.map(pickerTabOf));
|
|
137
|
+
const tabs = ['favorites'];
|
|
138
|
+
if (present.has('kortix'))
|
|
139
|
+
tabs.push('kortix');
|
|
140
|
+
if (present.has('chatgpt') || opts.canConnectChatGpt)
|
|
141
|
+
tabs.push('chatgpt');
|
|
142
|
+
const order = opts.providerOrder ?? [];
|
|
143
|
+
const rank = (id) => {
|
|
144
|
+
const i = order.indexOf(id);
|
|
145
|
+
return i === -1 ? order.length : i;
|
|
146
|
+
};
|
|
147
|
+
const providers = [...present]
|
|
148
|
+
.filter((id) => id !== 'kortix' && id !== 'chatgpt')
|
|
149
|
+
.sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));
|
|
150
|
+
return [...tabs, ...providers];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* The tab the picker opens on: Favorites when the current model is starred,
|
|
154
|
+
* else the tab that holds the current model, else Favorites when anything is
|
|
155
|
+
* starred, else the first source tab.
|
|
156
|
+
*/
|
|
157
|
+
export function initialPickerTab(input) {
|
|
158
|
+
if (input.selected && input.selectedIsFavorite)
|
|
159
|
+
return 'favorites';
|
|
160
|
+
if (input.selected) {
|
|
161
|
+
const tab = pickerTabOf(input.selected);
|
|
162
|
+
if (input.tabs.includes(tab))
|
|
163
|
+
return tab;
|
|
164
|
+
}
|
|
165
|
+
if (input.hasFavorites)
|
|
166
|
+
return 'favorites';
|
|
167
|
+
return input.tabs.find((t) => t !== 'favorites') ?? 'favorites';
|
|
168
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { FlatModel } from '@kortix/sdk/react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
type ModelRef = {
|
|
4
|
+
providerID: string;
|
|
5
|
+
modelID: string;
|
|
6
|
+
};
|
|
7
|
+
export interface ModelPickerPanelProps {
|
|
8
|
+
/** Every pickable model with no search applied: the rail and the tabs read these. */
|
|
9
|
+
browseModels: FlatModel[];
|
|
10
|
+
/**
|
|
11
|
+
* Every model the member may pick, before the default-view curation. Favorites
|
|
12
|
+
* read these: a model starred from a search stays in Favorites after the
|
|
13
|
+
* search is cleared, though the default view would hide it.
|
|
14
|
+
*/
|
|
15
|
+
pickableModels: FlatModel[];
|
|
16
|
+
/** The models that match the search box. Used only while a search is typed. */
|
|
17
|
+
searchModels: FlatModel[];
|
|
18
|
+
search: string;
|
|
19
|
+
onSearchChange: (value: string) => void;
|
|
20
|
+
/** Controls at the right end of the search field (connect, manage). */
|
|
21
|
+
searchRight?: ReactNode;
|
|
22
|
+
selected: ModelRef | null;
|
|
23
|
+
onPick: (model: FlatModel) => void;
|
|
24
|
+
isFavorite: (model: ModelRef) => boolean;
|
|
25
|
+
setFavorite: (model: ModelRef, on: boolean) => void;
|
|
26
|
+
/** Models or entitlements still load. */
|
|
27
|
+
loading: boolean;
|
|
28
|
+
/** Nothing is pickable at all: the connect / upgrade empty state. */
|
|
29
|
+
emptyState: ReactNode;
|
|
30
|
+
/** The search matched nothing. */
|
|
31
|
+
searchEmpty: ReactNode;
|
|
32
|
+
/** Present when the member can connect a ChatGPT plan from here. */
|
|
33
|
+
onConnectChatGpt?: () => void;
|
|
34
|
+
/** Tag for a model whose provider is not connected. */
|
|
35
|
+
connectLabel: string;
|
|
36
|
+
/**
|
|
37
|
+
* Another dialog opened (the command palette, a modal). The popover sits
|
|
38
|
+
* above every top-level dialog, so it must close rather than float over it.
|
|
39
|
+
*/
|
|
40
|
+
onForeignDialog?: () => void;
|
|
41
|
+
/** Thinking effort for the selected model. Absent = no right pane. */
|
|
42
|
+
effort?: {
|
|
43
|
+
choices: readonly string[];
|
|
44
|
+
selectedVariant: string | null | undefined;
|
|
45
|
+
onChange: (variant: string | null) => void;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The composer's model popover: a rail on the left (Favorites, Kortix,
|
|
50
|
+
* ChatGPT, then one tab per connected provider), the tab's models in the
|
|
51
|
+
* middle, and the selected model's thinking effort on the right. Picking a
|
|
52
|
+
* model or a level keeps it open; Escape or a click outside closes it.
|
|
53
|
+
*
|
|
54
|
+
* The star on a row is a FAVORITE (per browser, `useModelStore`), not the
|
|
55
|
+
* workspace default: favorites collect in the first tab, the way a member
|
|
56
|
+
* keeps the three models they switch between in one place. The workspace
|
|
57
|
+
* default is set in Customize -> Models.
|
|
58
|
+
*
|
|
59
|
+
* Mod + 1..9 picks the visible row with that number while the popover is open.
|
|
60
|
+
*/
|
|
61
|
+
export declare function ModelPickerPanel({ browseModels, pickableModels, searchModels, search, onSearchChange, searchRight, selected, onPick, isFavorite, setFavorite, loading, emptyState, searchEmpty, onConnectChatGpt, connectLabel, effort, onForeignDialog, }: ModelPickerPanelProps): import("react").JSX.Element;
|
|
62
|
+
export {};
|