@kortix/ui 0.15.10 → 0.16.0
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 +769 -76
- package/dist/_vendor/shared/app-config.d.ts +6 -30
- package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
- package/dist/_vendor/shared/channel-header.d.ts +2 -1
- package/dist/_vendor/shared/connector-sections.d.ts +0 -25
- package/dist/_vendor/shared/file-tags.d.ts +2 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- package/dist/_vendor/shared/pasted-content.d.ts +0 -4
- package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
- package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
- package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
- package/dist/access/access/copy-row.d.ts +7 -1
- package/dist/access/access/copy-row.js +2 -2
- package/dist/animated-copy-icon.js +2 -1
- package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
- package/dist/browser/sandbox-browser-chrome.js +1 -1
- package/dist/customize/agents/agent-cover-card.d.ts +1 -1
- package/dist/customize/agents/agent-cover-card.js +10 -2
- package/dist/customize/agents/agent-filter.js +3 -1
- package/dist/customize/agents/agent-model-view.d.ts +11 -1
- package/dist/customize/agents/agent-model-view.js +12 -1
- package/dist/customize/agents/agent-overview.d.ts +10 -0
- package/dist/customize/agents/agent-overview.js +5 -4
- package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
- package/dist/customize/agents/agent-page-chrome.js +16 -13
- package/dist/customize/agents/agent-page.js +25 -34
- package/dist/customize/agents/agent-tabs.d.ts +3 -0
- package/dist/customize/agents/agent-tabs.js +3 -0
- package/dist/customize/agents/agents-page.js +3 -3
- package/dist/customize/agents/create-agent-modal.d.ts +9 -0
- package/dist/customize/agents/create-agent-modal.js +21 -3
- package/dist/customize/agents/use-default-agent.js +2 -2
- package/dist/customize/connectors/connector-identity.d.ts +11 -2
- package/dist/customize/connectors/connector-identity.js +16 -4
- package/dist/customize/connectors/connectors-page.js +10 -6
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/detail/connector-triggers.js +1 -1
- package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
- package/dist/customize/connectors/install/install-dialog.js +6 -1
- package/dist/customize/connectors/use-agent-access.d.ts +2 -0
- package/dist/customize/evals/eval-compare-view.d.ts +10 -0
- package/dist/customize/evals/eval-compare-view.js +68 -0
- package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
- package/dist/customize/evals/eval-dataset-view.js +81 -0
- package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
- package/dist/customize/evals/eval-datasets-page.js +91 -0
- package/dist/customize/evals/eval-job-view.d.ts +12 -0
- package/dist/customize/evals/eval-job-view.js +360 -0
- package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
- package/dist/customize/evals/eval-jobs-page.js +69 -0
- package/dist/customize/evals/eval-meta.d.ts +97 -0
- package/dist/customize/evals/eval-meta.js +228 -0
- package/dist/customize/evals/eval-task-view.d.ts +13 -0
- package/dist/customize/evals/eval-task-view.js +123 -0
- package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
- package/dist/customize/evals/eval-tasks-page.js +56 -0
- package/dist/customize/evals/eval-ui.d.ts +97 -0
- package/dist/customize/evals/eval-ui.js +153 -0
- package/dist/customize/evals/evals-page.d.ts +10 -0
- package/dist/customize/evals/evals-page.js +56 -0
- package/dist/customize/evals/run-eval-modal.d.ts +28 -0
- package/dist/customize/evals/run-eval-modal.js +167 -0
- package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
- package/dist/customize/project-settings/project-admin-sections.js +6 -1
- package/dist/customize/providers/provider-connect.d.ts +13 -0
- package/dist/customize/providers/provider-connect.js +29 -5
- package/dist/customize/providers/provider-sheet.js +5 -4
- package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
- package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
- package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
- package/dist/customize/sections/view/git-view.d.ts +19 -1
- package/dist/customize/sections/view/git-view.js +7 -3
- package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
- package/dist/customize/sections/view/manifest-issue-list.js +41 -0
- package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
- package/dist/customize/sections/view/manifest-issues-row.js +39 -0
- package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
- package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
- package/dist/customize/sections/view/secrets-view.d.ts +13 -0
- package/dist/customize/sections/view/secrets-view.js +10 -6
- package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
- package/dist/customize/sections/view/subscription-usage.js +4 -8
- package/dist/customize/settings/settings-tab-header.js +12 -3
- package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
- package/dist/customize/settings/tabs/experimental-tab.js +36 -11
- package/dist/customize/settings/tabs/general-tab.js +1 -1
- package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
- package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
- package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
- package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
- package/dist/customize/settings/tabs/workspace-keys.js +6 -3
- package/dist/customize/shared/capability-page-shell.js +9 -1
- package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
- package/dist/customize/shared/catalog/catalog-card.js +15 -5
- package/dist/customize/shared/customize-tab-bar.js +1 -1
- package/dist/customize/shared/new-entity-menu.d.ts +1 -1
- package/dist/customize/shared/new-entity-menu.js +38 -1
- package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
- package/dist/customize/triggers/runtime-triggers.js +33 -3
- package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
- package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
- package/dist/customize/triggers/schedule/then-fields.js +23 -3
- package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
- package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
- package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
- package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
- package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
- package/dist/customize/triggers/schedule/when-event.js +1 -1
- package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
- package/dist/customize/triggers/schedule/when-schedule.js +16 -1
- package/dist/customize/triggers/schedule-view.js +6 -3
- package/dist/files/project/components/drive-explorer.js +33 -70
- package/dist/files/project/components/drive-grid-view.d.ts +2 -31
- package/dist/files/project/components/drive-grid-view.js +12 -22
- package/dist/files/project/components/drive-list-view.d.ts +3 -30
- package/dist/files/project/components/drive-list-view.js +8 -18
- package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
- package/dist/files/project/components/drive-selection-bar.js +13 -20
- package/dist/files/project/components/explorer-listing.d.ts +48 -0
- package/dist/files/project/components/explorer-listing.js +64 -0
- package/dist/files/project/components/file-explorer-page.js +7 -204
- package/dist/files/project/components/file-thumbnail.js +3 -1
- package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
- package/dist/files/project/components/manifest-issue-mark.js +26 -0
- package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
- package/dist/files/project/hooks/use-change-requests.js +17 -0
- package/dist/files/project/manifest-annotations.d.ts +16 -0
- package/dist/files/project/manifest-annotations.js +19 -0
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/project/upload-batch.d.ts +20 -0
- package/dist/files/project/upload-batch.js +20 -0
- package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
- package/dist/files/runtime/hooks/use-file-content.js +3 -2
- package/dist/files/runtime/hooks/use-file-list.js +1 -2
- package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
- package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
- package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
- package/dist/files/tree/components/file-tree-item.js +1 -4
- package/dist/files/viewer/file-annotations.d.ts +18 -0
- package/dist/files/viewer/file-annotations.js +21 -0
- package/dist/files/viewer/file-content-renderer.js +1 -1
- package/dist/files/viewer/file-viewer.js +2 -1
- package/dist/files/viewer/index.d.ts +1 -0
- package/dist/files/viewer/index.js +1 -0
- package/dist/files/viewer/use-file-content-state.js +8 -1
- package/dist/i18n/en.d.ts +544 -46
- package/dist/i18n/en.js +593 -95
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
- package/dist/icons/caret-right-solid.d.ts +11 -0
- package/dist/icons/caret-right-solid.js +15 -0
- package/dist/internal/auth/auth-art.d.ts +12 -0
- package/dist/internal/auth/auth-art.js +118 -0
- package/dist/internal/auth/auth-card-shell.d.ts +14 -10
- package/dist/internal/auth/auth-card-shell.js +20 -31
- package/dist/internal/auth/auth-consent.d.ts +3 -1
- package/dist/internal/auth/auth-consent.js +2 -2
- package/dist/internal/auth/auth-primitives.d.ts +26 -1
- package/dist/internal/auth/auth-primitives.js +37 -8
- package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
- package/dist/internal/connector-logo/connector-logo.js +11 -2
- package/dist/internal/files/file-read-retry.d.ts +18 -2
- package/dist/internal/files/file-read-retry.js +42 -4
- package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
- package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
- package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
- package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
- package/dist/internal/hooks/use-reduced-motion.js +12 -0
- package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
- package/dist/internal/hooks/use-save-shortcut.js +28 -0
- package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
- package/dist/internal/layout/connect-mcp-modal.js +9 -4
- package/dist/internal/layout/panel-chrome.d.ts +28 -0
- package/dist/internal/layout/panel-chrome.js +27 -0
- package/dist/internal/layout/project-page-header.js +5 -1
- package/dist/internal/layout/project-settings-nav.d.ts +17 -0
- package/dist/internal/layout/project-settings-nav.js +24 -0
- package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
- package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
- package/dist/internal/lib/capability-tab-routes.js +11 -0
- package/dist/internal/lib/manifest-health.d.ts +25 -1
- package/dist/internal/lib/manifest-health.js +56 -0
- package/dist/internal/lib/project-preamble.js +1 -1
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +3 -0
- package/dist/internal/notifications/notification-inbox.js +2 -1
- package/dist/internal/notifications/notification-rows.d.ts +1 -1
- package/dist/internal/notifications/notification-rows.js +15 -1
- package/dist/internal/selection/selection-bar.d.ts +2 -8
- package/dist/internal/selection/selection-bar.js +15 -38
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
- package/dist/internal/stores/composer-prefill-store.js +1 -0
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +9 -1
- package/dist/internal/stores/user-preferences-store.js +2 -0
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.js +28 -1
- package/dist/lib/dotmatrix-hooks.d.ts +1 -0
- package/dist/lib/dotmatrix-hooks.js +3 -13
- package/dist/lib/reduced-motion.d.ts +10 -0
- package/dist/lib/reduced-motion.js +104 -0
- package/dist/lib/routes.d.ts +9 -0
- package/dist/lib/routes.js +7 -4
- package/dist/markdown/artifact-link.d.ts +11 -0
- package/dist/markdown/artifact-link.js +62 -0
- package/dist/markdown/code/index.d.ts +1 -1
- package/dist/markdown/code/index.js +1 -1
- package/dist/markdown/code/inline-code.d.ts +1 -1
- package/dist/markdown/code/inline-code.js +1 -1
- package/dist/markdown/genui/components/map-canvas.js +2 -1
- package/dist/markdown/index.d.ts +3 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
- package/dist/markdown/inline-code-text.d.ts +34 -0
- package/dist/markdown/inline-code-text.js +68 -0
- package/dist/markdown/setup-links/approval-decision.js +3 -3
- package/dist/markdown/soft-breaks.d.ts +21 -0
- package/dist/markdown/soft-breaks.js +33 -0
- package/dist/markdown/unified-markdown.d.ts +9 -1
- package/dist/markdown/unified-markdown.js +31 -9
- package/dist/primitives/action-bar.d.ts +50 -0
- package/dist/primitives/action-bar.js +87 -0
- package/dist/primitives/calendar.js +4 -2
- package/dist/primitives/inline-meta.js +2 -2
- package/dist/primitives/kortix-loader.js +2 -1
- package/dist/primitives/modal.d.ts +1 -1
- package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
- package/dist/primitives/paper-wallpaper-shaders.js +6 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/primitives/resize-seam.d.ts +3 -2
- package/dist/primitives/resize-seam.js +4 -3
- package/dist/primitives/settings-section-header.d.ts +30 -1
- package/dist/primitives/settings-section-header.js +37 -0
- package/dist/primitives/sliding-tab-indicator.js +2 -1
- package/dist/primitives/switch.js +15 -8
- package/dist/primitives/text-shimmer.js +6 -0
- package/dist/primitives/toast-clearance.d.ts +52 -0
- package/dist/primitives/toast-clearance.js +116 -0
- package/dist/primitives/toast.d.ts +3 -1
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/typed-title.js +1 -1
- package/dist/primitives/wallpaper-shaders.js +1 -1
- package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
- package/dist/session/actions/project-session-list-helpers.js +18 -0
- package/dist/session/actions/session-label.js +2 -2
- package/dist/session/agents/agent-model.d.ts +1 -0
- package/dist/session/agents/agent-model.js +2 -1
- package/dist/session/agents/agent-strip.d.ts +10 -5
- package/dist/session/agents/agent-strip.js +49 -15
- package/dist/session/agents/held-messages.d.ts +6 -2
- package/dist/session/agents/held-messages.js +6 -3
- package/dist/session/agents/workflow-run-controls.d.ts +27 -4
- package/dist/session/agents/workflow-run-controls.js +63 -10
- package/dist/session/composer/ComposerCard.js +7 -1
- package/dist/session/composer/agent-selector.d.ts +2 -0
- package/dist/session/composer/agent-selector.js +11 -4
- package/dist/session/composer/animated-placeholder.js +2 -1
- package/dist/session/composer/attachment-tile.d.ts +2 -2
- package/dist/session/composer/attachment-tile.js +25 -3
- package/dist/session/composer/composer-agent-access.d.ts +10 -1
- package/dist/session/composer/composer-agent-access.js +18 -4
- package/dist/session/composer/composer-chat-input.d.ts +1 -0
- package/dist/session/composer/composer-chat-input.js +7 -2
- package/dist/session/composer/composer-logic.d.ts +7 -0
- package/dist/session/composer/composer-logic.js +18 -0
- package/dist/session/composer/composer-reset.d.ts +8 -14
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer.d.ts +9 -2
- package/dist/session/composer/composer.js +24 -9
- package/dist/session/composer/editor/composer-editor.js +6 -4
- package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
- package/dist/session/composer/hooks/use-file-search.js +71 -7
- package/dist/session/composer/menus/menu-items.js +6 -2
- package/dist/session/composer/menus/menu-shell.d.ts +3 -1
- package/dist/session/composer/menus/menu-shell.js +2 -2
- package/dist/session/composer/menus/slash-menu.d.ts +7 -0
- package/dist/session/composer/menus/slash-menu.js +48 -1
- package/dist/session/composer/use-instant-session-send.js +7 -1
- package/dist/session/header/session-reminders-indicator.js +3 -2
- package/dist/session/header/session-site-header.d.ts +3 -1
- package/dist/session/header/session-site-header.js +27 -8
- package/dist/session/media/sandbox-url-detector.js +1 -1
- package/dist/session/models/connect-model-step.d.ts +29 -0
- package/dist/session/models/connect-model-step.js +50 -0
- package/dist/session/models/model-connection-gate.js +2 -1
- package/dist/session/models/model-selector.js +1 -1
- package/dist/session/models/subscription-switcher.d.ts +7 -0
- package/dist/session/models/subscription-switcher.js +52 -10
- package/dist/session/models/subscription-windows.d.ts +2 -0
- package/dist/session/models/subscription-windows.js +2 -0
- package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
- package/dist/session/models/use-workspace-model-gate.js +62 -0
- package/dist/session/models/workspace-model-gate.d.ts +46 -0
- package/dist/session/models/workspace-model-gate.js +66 -0
- package/dist/session/outcomes/session-outcomes-provider.js +14 -7
- package/dist/session/panel/action-panel.js +8 -19
- package/dist/session/panel/easy/app-preview.d.ts +4 -1
- package/dist/session/panel/easy/app-preview.js +95 -33
- package/dist/session/panel/easy/apps-card.js +6 -11
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.d.ts +14 -0
- package/dist/session/panel/easy/changes-card.js +60 -0
- package/dist/session/panel/easy/context-card.d.ts +5 -1
- package/dist/session/panel/easy/context-card.js +13 -28
- package/dist/session/panel/easy/context-meter.d.ts +18 -0
- package/dist/session/panel/easy/context-meter.js +73 -0
- package/dist/session/panel/easy/detail-view.d.ts +1 -1
- package/dist/session/panel/easy/detail-view.js +24 -21
- package/dist/session/panel/easy/easy-panel.js +7 -5
- package/dist/session/panel/easy/file-preview.js +3 -1
- package/dist/session/panel/easy/frame-history.d.ts +91 -0
- package/dist/session/panel/easy/frame-history.js +198 -0
- package/dist/session/panel/easy/outputs-card.d.ts +10 -0
- package/dist/session/panel/easy/outputs-card.js +28 -31
- package/dist/session/panel/easy/panel-card.d.ts +1 -3
- package/dist/session/panel/easy/panel-card.js +24 -8
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/easy/step-icon.d.ts +4 -1
- package/dist/session/panel/easy/step-icon.js +2 -2
- package/dist/session/panel/session-action-panel-column.d.ts +5 -0
- package/dist/session/panel/session-action-panel-column.js +198 -101
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-diff-viewer.d.ts +3 -1
- package/dist/session/panel/session-diff-viewer.js +7 -4
- package/dist/session/panel/session-panel-provider.js +29 -5
- package/dist/session/panel/shared/derive-panels.js +64 -4
- package/dist/session/prompts/session-connect-card.d.ts +63 -0
- package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
- package/dist/session/status/session-busy-indicator.js +2 -1
- package/dist/session/status/session-error-banner.js +1 -1
- package/dist/session/thread/chat-minimap.js +2 -1
- package/dist/session/thread/session-body.js +4 -1
- package/dist/session/thread/session-chat.js +311 -300
- package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
- package/dist/session/thread/session-turn-meta-rows.js +33 -5
- package/dist/session/thread/transcript.d.ts +3 -3
- package/dist/session/thread/transcript.js +33 -27
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- package/dist/session/tool/tool-part-renderer.js +7 -2
- package/dist/session/tool/tools/kortix-action-tool.js +10 -2
- package/dist/session/tool/tools/session-spawn-tool.js +3 -3
- package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
- package/dist/session/tool/tools/workflow-run-card.js +31 -7
- package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
- package/dist/session/tool/tools/workflow-run-cost.js +75 -0
- package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
- package/dist/session/tool/tools/workflow-tool.js +40 -15
- package/dist/session/turn/peer-message-row.js +1 -1
- package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
- package/dist/session/turn/queued-prompt-bubbles.js +1 -1
- package/dist/session/turn/throttled-markdown.js +1 -1
- package/dist/session/turn/turn-viewport.d.ts +66 -10
- package/dist/session/turn/turn-viewport.js +92 -12
- package/dist/session/turn/user-message.js +7 -5
- package/dist/styles/theme.css +68 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/pty-terminal.js +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/test-utils/intl.d.ts +544 -46
- package/dist/workspace/admin/project-admin-dashboard.js +23 -11
- package/dist/workspace/admin/settings-search-landing.js +2 -1
- package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
- package/dist/workspace/calendar/calendar-dates.js +64 -0
- package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
- package/dist/workspace/calendar/calendar-new-item.js +47 -0
- package/dist/workspace/calendar/calendar-page.d.ts +3 -0
- package/dist/workspace/calendar/calendar-page.js +177 -0
- package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
- package/dist/workspace/calendar/calendar-panel.js +103 -0
- package/dist/workspace/calendar/calendar-people.d.ts +52 -0
- package/dist/workspace/calendar/calendar-people.js +117 -0
- package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
- package/dist/workspace/calendar/calendar-scheduled.js +118 -0
- package/dist/workspace/calendar/calendar-views.d.ts +32 -0
- package/dist/workspace/calendar/calendar-views.js +124 -0
- package/dist/workspace/calendar/calendar-when.d.ts +14 -0
- package/dist/workspace/calendar/calendar-when.js +81 -0
- package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
- package/dist/workspace/calendar/mention-textarea.js +84 -0
- package/dist/workspace/home/access-requests-bell.js +2 -1
- package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
- package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
- package/dist/workspace/home/no-agent-home.d.ts +3 -1
- package/dist/workspace/home/no-agent-home.js +2 -2
- package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
- package/dist/workspace/inbox/workspace-inbox.js +1 -1
- package/dist/workspace/layout/project-files-view.js +2 -1
- package/dist/workspace/layout/project-home.js +16 -9
- package/dist/workspace/memory/memory-page-list.js +1 -1
- package/dist/workspace/new/workspace-handoff.js +2 -1
- package/dist/workspace/projects/modal/project-icon-field.js +2 -1
- package/dist/workspace/session-workspace.js +13 -12
- package/dist/workspace/setup/setup-steps.d.ts +43 -0
- package/dist/workspace/setup/setup-steps.js +38 -0
- package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
- package/dist/workspace/setup/workspace-setup-page.js +124 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
- package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
- package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
- package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
- package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
- package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
- package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
- package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
- package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
- package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
- package/dist/workspace/sidebar/footer/promo-card.js +47 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +12 -4
- package/dist/workspace/sidebar/project-session-list.js +58 -26
- package/dist/workspace/sidebar/project-sidebar.js +2 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
- package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
- package/dist/workspace/sidebar/session-group-sections.js +121 -41
- package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
- package/dist/workspace/sidebar/session-grouping.js +1 -1
- package/dist/workspace/sidebar/sidebar-drill.js +6 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
- package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
- package/dist/workspace/sidebar/use-workspace-list.js +11 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
- package/dist/workspace/space/space-tab-panels.js +1 -1
- package/dist/workspace/spaces/space-details-panel.js +2 -2
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/dist/workspace/spaces/space-triggers.js +2 -2
- package/dist/workspace/spaces/space-view.js +11 -5
- package/package.json +79 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
- package/dist/session/thread/turn-share.d.ts +0 -16
- package/dist/session/thread/turn-share.js +0 -161
- package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
- package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
- /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
|
@@ -33,6 +33,7 @@ import { useSessionIds } from '../../providers/session-ids.js';
|
|
|
33
33
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
34
34
|
import { openSessionQuickView } from '../panel/open-session-quick-view.js';
|
|
35
35
|
import { CountdownRing, isFailedReminder, REMINDER_ROW_GRID, ReminderActions, ReminderFacts, ReminderRowCells, sortReminders, useReminderControls, useReminderView, } from './reminder-parts.js';
|
|
36
|
+
import { prefersReducedMotion } from '../../internal/hooks/use-reduced-motion.js';
|
|
36
37
|
/** More live reminders than this open in the side panel, not the popover. */
|
|
37
38
|
export const REMINDERS_POPOVER_MAX = 30;
|
|
38
39
|
/**
|
|
@@ -45,7 +46,7 @@ export function ReminderMark({ count, failed: anyFailed, surface = 'bg-backgroun
|
|
|
45
46
|
const tone = anyFailed
|
|
46
47
|
? { reflection: 'text-kortix-red', disc: 'bg-kortix-red' }
|
|
47
48
|
: { reflection: 'text-kortix-purple', disc: 'bg-kortix-purple' };
|
|
48
|
-
return (_jsxs("span", { className: "relative size-4 shrink-0", children: [_jsx(AlarmIcon, { className:
|
|
49
|
+
return (_jsxs("span", { className: "relative size-4 shrink-0", children: [_jsx(AlarmIcon, { className: "size-4" }), count > 0 ? (_jsxs(_Fragment, { children: [_jsx(AlarmIcon, { "aria-hidden": true, className: cn('absolute inset-0 size-4', tone.reflection), style: { maskImage: BELL_REFLECTION_MASK, WebkitMaskImage: BELL_REFLECTION_MASK } }), _jsx("span", { "aria-hidden": true, className: cn('absolute -right-1.5 -bottom-1.5 flex rounded-full p-px', surface), children: _jsx("span", { "data-slot": "reminder-count", className: cn('text-background flex h-3 min-w-3 items-center justify-center rounded-full px-0.5 text-[9px] leading-none font-semibold tabular-nums', // audit:allow a numeral in an 11px disc on a 16px glyph; no type rung fits
|
|
49
50
|
tone.disc), children: badgeCount(count) }) })] })) : null] }));
|
|
50
51
|
}
|
|
51
52
|
const CARD_OPEN_DELAY_MS = 200;
|
|
@@ -87,7 +88,7 @@ function useGlidingCard() {
|
|
|
87
88
|
return;
|
|
88
89
|
clearTimers();
|
|
89
90
|
const panelRect = panel.getBoundingClientRect();
|
|
90
|
-
const reduce =
|
|
91
|
+
const reduce = prefersReducedMotion();
|
|
91
92
|
const place = (glide) => setActive({
|
|
92
93
|
id,
|
|
93
94
|
top: row.getBoundingClientRect().top - panelRect.top,
|
|
@@ -7,6 +7,8 @@ interface SessionSiteHeaderProps {
|
|
|
7
7
|
parent?: {
|
|
8
8
|
onOpen: () => void;
|
|
9
9
|
};
|
|
10
|
+
/** The session works now: its child list polls every 5 s instead of every 30 s. */
|
|
11
|
+
live?: boolean;
|
|
10
12
|
}
|
|
11
|
-
export declare function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadingAction, parent, }: SessionSiteHeaderProps): import("react").JSX.Element;
|
|
13
|
+
export declare function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadingAction, parent, live, }: SessionSiteHeaderProps): import("react").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -40,12 +40,15 @@ import { getSessionDisplayTitle } from '../actions/project-session-list-helpers.
|
|
|
40
40
|
import { useReloadSessionConfig } from '../../internal/hooks/projects/use-session-config-freshness.js';
|
|
41
41
|
import { cn } from '../../lib/utils.js';
|
|
42
42
|
import { useSessionHistoryViewStore } from '../../internal/stores/session-history-view-store.js';
|
|
43
|
-
import { useIsActionPanelOpen, useReadyChip, useToggleActionPanel, } from '../../internal/stores/kortix-computer-store.js';
|
|
43
|
+
import { useIsActionPanelOpen, useIsSidePanelOpen, useReadyChip, useToggleActionPanel, useToggleRightPanel, } from '../../internal/stores/kortix-computer-store.js';
|
|
44
|
+
import { SESSION_BAR_CLASS } from '../../internal/layout/panel-chrome.js';
|
|
45
|
+
import { Kbd, KbdGroup } from '../../primitives/kbd.js';
|
|
44
46
|
import { createProjectSession, directSubsessions, restartProjectSession, stopProjectSession } from '@kortix/sdk';
|
|
45
47
|
import { qk, useHasSessionDesktop, useProjectSession, useRuntimeSupports, useSessionChildren, useSessionParticipants, useSessionWatch, } from '@kortix/sdk/react';
|
|
46
|
-
import { ArchiveIcon, ArrowsClockwiseIcon, BellIcon, BellSlashIcon,
|
|
48
|
+
import { ArchiveIcon, ArrowsClockwiseIcon, BellIcon, BellSlashIcon, GitForkIcon, LinkSimpleIcon, ListBulletsIcon, CaretDownIcon, CodeSimpleIcon as Code2, FileArrowDownIcon as FileDown, FolderSimpleIcon, GlobeSimpleIcon, MonitorIcon, StackIcon as Layers, PencilSimpleIcon, PushPinIcon, PushPinSlashIcon, ArrowCounterClockwiseIcon as RotateCcw, ShareIcon as Share, SquareIcon as Square, TerminalIcon, TrashIcon, } from '@phosphor-icons/react';
|
|
47
49
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
48
50
|
import { useMemo, useRef, useState } from 'react';
|
|
51
|
+
const modKey = typeof navigator !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? '⌘' : 'Ctrl';
|
|
49
52
|
/** Sandbox surfaces reachable from the header. One list drives both the
|
|
50
53
|
* desktop segment and the mobile sheet, so growing to 4-5 is a one-line add.
|
|
51
54
|
* Every entry fires the same `openSessionQuickView(view, 'header')` call. */
|
|
@@ -56,7 +59,7 @@ const DEV_TOOLS = [
|
|
|
56
59
|
{ view: 'desktop', label: 'Desktop', Icon: MonitorIcon },
|
|
57
60
|
{ view: 'files', label: 'Files', Icon: FolderSimpleIcon },
|
|
58
61
|
];
|
|
59
|
-
export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadingAction, parent, }) {
|
|
62
|
+
export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadingAction, parent, live = false, }) {
|
|
60
63
|
const tI18nHardcoded = useTranslations('hardcodedUi');
|
|
61
64
|
const tHardcodedUi = useTranslations('hardcodedUi');
|
|
62
65
|
const tPalette = useTranslations('commandPalette');
|
|
@@ -185,7 +188,8 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
185
188
|
const subsessions = projectSession && !parent ? directSubsessions(projectSession) : [];
|
|
186
189
|
const childSessions = useSessionChildren(projectId ?? '', projectSessionId ?? '', {
|
|
187
190
|
enabled: isProjectSession && !parent,
|
|
188
|
-
|
|
191
|
+
// An idle session starts no child: poll every 30 s, every 5 s while it works.
|
|
192
|
+
refetchInterval: live ? 5_000 : 30_000,
|
|
189
193
|
});
|
|
190
194
|
const startRename = () => {
|
|
191
195
|
if (canRename)
|
|
@@ -228,7 +232,15 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
228
232
|
// Mobile-only action-panel toggle — see its render site below.
|
|
229
233
|
const isActionPanelOpen = useIsActionPanelOpen();
|
|
230
234
|
const toggleActionPanel = useToggleActionPanel();
|
|
235
|
+
const toggleRightPanel = useToggleRightPanel();
|
|
236
|
+
const isDetailPanelOpen = useIsSidePanelOpen();
|
|
231
237
|
const readyChip = useReadyChip();
|
|
238
|
+
// Something is docked on the right: the sections column or a detail panel.
|
|
239
|
+
// On a phone only the sections drawer answers to this control.
|
|
240
|
+
const rightPaneOpen = isMobileViewport
|
|
241
|
+
? isActionPanelOpen
|
|
242
|
+
: isActionPanelOpen || isDetailPanelOpen;
|
|
243
|
+
const rightPaneLabel = tI18nHardcoded.raw(rightPaneOpen ? 'i18nComplete.text40cd6293d193' : 'i18nComplete.text2534086de9fe');
|
|
232
244
|
// P5.6: show or hide the messages outside the agent's context (a failed attempt), per
|
|
233
245
|
// session. Listed only while the transcript on screen holds one: otherwise it changes nothing.
|
|
234
246
|
const historyKey = projectSessionId || sessionId;
|
|
@@ -269,14 +281,21 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
269
281
|
: tI18nHardcoded.raw('i18nComplete.text32ad3abe4479'));
|
|
270
282
|
},
|
|
271
283
|
}), children: [forkSession.isPending ? _jsx(Loading, {}) : _jsx(GitForkIcon, {}), tI18nHardcoded.raw('i18nComplete.text0e5f7f6732e0')] }))] })), outOfContextPresent && (_jsx(DropdownMenuCheckboxItem, { className: "cursor-pointer", checked: !outOfContextHidden, onCheckedChange: (checked) => setOutOfContextHidden(historyKey, !checked), children: tHistory('showOutOfContext') })), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => setExportOpen(true), children: [_jsx(FileDown, {}), tI18nHardcoded.raw('i18nComplete.text5d974f9e80c3')] }), canCompact && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => setCompactOpen(true), children: [_jsx(Layers, {}), contextRecord ? tReset('dialogAction') : tI18nHardcoded.raw('i18nComplete.textca838377bb5a')] })), isProjectSession && canManageLifecycle && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => setDeleteOpen(true), children: [_jsx(TrashIcon, {}), tI18nHardcoded.raw('i18nComplete.texte2d0a54968ea')] })] }))] }));
|
|
272
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative z-50 w-full", children: [_jsxs("div", { className: cn(
|
|
284
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative z-50 w-full", children: [_jsxs("div", { className: cn(
|
|
285
|
+
// The shared bar: same height and bottom rule as the detail
|
|
286
|
+
// panel's bar, so the two rules meet as one line (`panel-chrome.ts`).
|
|
287
|
+
SESSION_BAR_CLASS, 'justify-between px-3.5 pr-4',
|
|
288
|
+
// A phone's notch inset adds to the bar instead of squeezing the
|
|
289
|
+
// 28px controls against its rule. Phones have no pane beside the
|
|
290
|
+
// chat, so a taller bar there breaks no line.
|
|
291
|
+
'max-md:h-auto max-md:min-h-[calc(var(--spacing)*11+env(safe-area-inset-top))] max-md:pt-[env(safe-area-inset-top)]', // audit:allow device safe-area inset, not a spacing step
|
|
273
292
|
// Unconditional on the shell. The LEFT indent depends on the
|
|
274
293
|
// sidebar (expanded, it covers the macOS lights itself) and is
|
|
275
294
|
// gated by the data attribute — but the RIGHT one does not: this
|
|
276
295
|
// column's right edge is the window's right edge whatever the
|
|
277
296
|
// sidebar does, so on Win/Linux the trailing dev-tools cluster
|
|
278
297
|
// sits under min/max/close either way.
|
|
279
|
-
desktopShell !== null && 'kx-titlebar-row'
|
|
298
|
+
desktopShell !== null && 'kx-titlebar-row'), "data-sidebar-collapsed": sidebarHidden || undefined, children: [_jsxs("div", { className: cn('pointer-events-auto flex min-w-0 items-center gap-0.5', sidebarHidden && 'h-[var(--kx-titlebar-control-size)]'), children: [_jsx(SidebarToggle, {}), parent && (_jsxs(_Fragment, { children: [_jsxs(Button, { type: "button", variant: "ghost", onClick: parent.onOpen, className: "text-foreground h-7 shrink-0 gap-1.5 rounded-md px-2 py-1 transition-[color,background-color] duration-(--duration-normal) ease-out", children: [_jsx(Home, { className: "size-3.5 shrink-0" }), tI18nHardcoded.raw('i18nComplete.text3a78695388b3')] }), _jsx("span", { "aria-hidden": true, className: "text-muted-foreground shrink-0 text-sm select-none", children: "/" })] })), _jsxs("div", { className: "flex min-w-0 items-center gap-0.5", children: [isRenaming && projectSession ? (
|
|
280
299
|
// Starts from the name on screen, not `sessionDisplayLabel`:
|
|
281
300
|
// that one falls back to a uuid slice for an untitled session.
|
|
282
301
|
_jsx(SessionTitleInput, { initialValue: headerTitle, ariaLabel: tI18nHardcoded.raw('autoFeaturesCoWorkerProjectSidebarModalRenameSessionModalJsx265e123d'), onCommit: (name) => {
|
|
@@ -292,12 +311,12 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
292
311
|
_jsx(SubagentHoverCard, { projectId: projectId, projectSessionId: projectSessionId, subsessions: subsessions, spawnedSessions: childSessions.sessions, onLoadMore: childSessions.hasNextPage ? () => { void childSessions.fetchNextPage(); } : undefined, loadingMore: childSessions.isFetchingNextPage, children: titleButton })) : canRename ? (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: tI18nHardcoded.raw('autoFeaturesCoWorkerProjectSidebarModalRenameSessionModalJsx265e123d'), children: titleButton })) : (
|
|
293
312
|
// Share viewer and instant shell: no project session row, so
|
|
294
313
|
// nothing to rename. The name is plain text.
|
|
295
|
-
_jsx("span", { className: "text-foreground min-w-0 truncate px-2.5 text-sm font-medium", children: headerTitle })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": tI18nHardcoded.raw('componentsProjectsProjectSessionList.line312JsxAttrAriaLabelSessionActions'), className: "text-
|
|
314
|
+
_jsx("span", { className: "text-foreground min-w-0 truncate px-2.5 text-sm font-medium", children: headerTitle })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": tI18nHardcoded.raw('componentsProjectsProjectSessionList.line312JsxAttrAriaLabelSessionActions'), className: "text-foreground data-[state=open]:bg-card shrink-0 rounded-md transition-[color,background-color,transform] duration-(--duration-normal) ease-out active:scale-[0.96]", children: _jsx(CaretDownIcon, { className: "size-3.5" }) }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-56", onCloseAutoFocus: (e) => {
|
|
296
315
|
if (!renameFromMenu.current)
|
|
297
316
|
return;
|
|
298
317
|
renameFromMenu.current = false;
|
|
299
318
|
e.preventDefault();
|
|
300
|
-
}, children: sessionActionItems })] })] }), leadingAction] }), _jsxs("div", { className: cn('pointer-events-auto flex items-center gap-1.5', sidebarHidden && 'h-[var(--kx-titlebar-control-size)]'), children: [_jsx(SessionChangesIndicator, { sessionId: sessionId }), _jsx(SessionPendingApprovalsIndicator, { sessionId: sessionId }), isProjectSession ? _jsx(SessionGoalIndicator, {}) : null, isProjectSession ? _jsx(SessionRemindersIndicator, { runtimeSessionId: sessionId }) : null, isProjectSession && (_jsx(SessionConfigIndicator, { projectId: projectId, sessionId: projectSessionId, chatSessionId: sessionId, baseRef: projectSession?.base_ref, reload: reloadConfig.reload, isPending: reloadConfig.isPending, phase: reloadConfig.phase, canReload: canManageLifecycle })), _jsx("div", { className: "hidden items-center gap-1.5 lg:flex", children: devTools.map(({ view, label, Icon }) => (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: label, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": label, onClick: () => openSessionQuickView(view, 'header'), className: "text-
|
|
319
|
+
}, children: sessionActionItems })] })] }), leadingAction] }), _jsxs("div", { className: cn('pointer-events-auto flex items-center gap-1.5', sidebarHidden && 'h-[var(--kx-titlebar-control-size)]'), children: [_jsx(SessionChangesIndicator, { sessionId: sessionId }), _jsx(SessionPendingApprovalsIndicator, { sessionId: sessionId }), isProjectSession ? _jsx(SessionGoalIndicator, {}) : null, isProjectSession ? _jsx(SessionRemindersIndicator, { runtimeSessionId: sessionId }) : null, isProjectSession && (_jsx(SessionConfigIndicator, { projectId: projectId, sessionId: projectSessionId, chatSessionId: sessionId, baseRef: projectSession?.base_ref, reload: reloadConfig.reload, isPending: reloadConfig.isPending, phase: reloadConfig.phase, canReload: canManageLifecycle })), _jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: _jsxs("span", { className: "flex items-center gap-1.5", children: [rightPaneLabel, !isMobileViewport && (_jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modKey }), _jsx(Kbd, { className: "font-mono", children: "I" })] }))] }), children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": rightPaneLabel, "aria-expanded": rightPaneOpen, "aria-keyshortcuts": isMobileViewport ? undefined : 'Meta+I Control+I', onClick: !isMobileViewport && isDetailPanelOpen ? toggleRightPanel : toggleActionPanel, "data-state": rightPaneOpen ? 'open' : 'closed', className: "text-foreground data-[state=open]:bg-card cursor-pointer transition-colors active:scale-[0.96]", children: _jsxs("span", { className: "relative inline-flex", children: [_jsx(ListBulletsIcon, { className: "size-4" }), readyChip?.sessionId === sessionId && !rightPaneOpen && (_jsx("span", { className: "bg-kortix-green ring-background absolute -top-1 -right-1 size-2 rounded-full ring-2", "aria-hidden": true }))] }) }) }), _jsx("div", { className: "hidden items-center gap-1.5 lg:flex", children: devTools.map(({ view, label, Icon }) => (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: label, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": label, onClick: () => openSessionQuickView(view, 'header'), className: "text-foreground cursor-pointer transition-colors active:scale-[0.96]", children: _jsx(Icon, { className: "h-4 w-4" }) }) }, view))) }), _jsxs(DropdownMenu, { children: [_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: tI18nHardcoded.raw('i18nComplete.text96f0c06bbcb7'), children: _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": tI18nHardcoded.raw('i18nComplete.text96f0c06bbcb7'), className: "text-foreground cursor-pointer transition-colors active:scale-[0.96] lg:hidden", children: _jsx(Code2, { className: "h-4 w-4" }) }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-44", children: devTools.map(({ view, label, Icon }) => (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => openSessionQuickView(view, 'header'), children: [_jsx(Icon, {}), label] }, view))) })] }), isProjectSession && projectSession && (_jsx(SessionParticipantStack, { participants: sessionParticipants })), isProjectSession && projectSession && ShareSessionModal && (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: shareLabel, open: isMobileViewport ? undefined : false, children: _jsxs(Button, { variant: "ghost", size: "xs", "aria-label": shareLabel, onClick: () => setShareOpen(true), className: "cursor-pointer rounded-md active:scale-[0.96] max-md:w-7 max-md:has-[>svg]:px-0", children: [_jsx(Share, {}), _jsx("span", { className: "hidden md:inline", children: tI18nHardcoded.raw('i18nComplete.text29887a5ff984') })] }) }))] })] }), isProjectSession && _jsx(PreviousRepositoryNotice, {})] }), _jsx(ExportTranscriptModal, { sessionId: sessionId, kortixSessionScope: isProjectSession ? `${projectId}/${projectSessionId}` : undefined, open: exportOpen, onOpenChange: setExportOpen }), _jsx(CompactModal, { sessionId: sessionId, open: compactOpen, onOpenChange: setCompactOpen }), isProjectSession && (_jsxs(_Fragment, { children: [_jsx(SessionConfigReloadConfirm, { busyReason: reloadConfig.busyReason, isPending: reloadConfig.isPending, onConfirm: () => reloadConfig.reload({ force: true }), onDismiss: reloadConfig.clearBusy }), ShareSessionModal && (_jsx(ShareSessionModal, { projectId: projectId, session: projectSession, open: shareOpen, onOpenChange: setShareOpen, onSaved: () => queryClient.invalidateQueries({
|
|
301
320
|
queryKey: qk.project.sessionsScope(projectId ?? ''),
|
|
302
321
|
}) })), _jsx(SessionDeleteModal, { projectId: projectId, sessionId: projectSessionId, sessionLabel: projectTitle, open: deleteOpen, onOpenChange: setDeleteOpen, onDeleted: () => router.push(uiRoutes().project(projectId)) })] }))] }));
|
|
303
322
|
}
|
|
@@ -169,5 +169,5 @@ export const SandboxUrlDetector = ({ content, isStreaming = false, genui = false
|
|
|
169
169
|
// that should not appear in the UI.
|
|
170
170
|
const rawContent = typeof content === 'string' ? content : content ? String(content) : '';
|
|
171
171
|
const safeContent = stripKortixSystemTags(rawContent);
|
|
172
|
-
return _jsx(UnifiedMarkdown, { content: safeContent, trust: "agent", isStreaming: isStreaming, genui: genui });
|
|
172
|
+
return _jsx(UnifiedMarkdown, { content: safeContent, trust: "agent", isStreaming: isStreaming, genui: genui, lineBreaks: "chat" });
|
|
173
173
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Where "Back to workspaces" goes: the chooser, never the door that reopens this workspace. */
|
|
2
|
+
export declare const CONNECT_MODEL_STEP_BACK_HREF = "/workspaces";
|
|
3
|
+
/**
|
|
4
|
+
* The "Connect a model" step: what every workspace page shows while the viewer
|
|
5
|
+
* can run no model (`useWorkspaceModelGate`). New workspaces land here right
|
|
6
|
+
* after setup, and the workspace opens on its own once a model works: the
|
|
7
|
+
* provider dialog's save refreshes the model list the gate reads.
|
|
8
|
+
*
|
|
9
|
+
* - The two plan tiles first (ChatGPT, Claude): most people already pay for
|
|
10
|
+
* one, and each opens the provider dialog with that provider expanded.
|
|
11
|
+
* - "Add provider key" opens the same dialog on its provider list.
|
|
12
|
+
* - "Upgrade plan" only for a viewer who may change the project's models,
|
|
13
|
+
* when the workspace's plan has no Kortix models
|
|
14
|
+
* (`model_access.requires_provider_key`) and billing is on.
|
|
15
|
+
* - Every member gets the tiles and the key: the gate is per viewer, and a
|
|
16
|
+
* member may connect a login or a key for themselves (the server refuses
|
|
17
|
+
* only a connection shared with everyone, 403). A member who cannot change
|
|
18
|
+
* the project's models also reads who can connect one for everyone.
|
|
19
|
+
*
|
|
20
|
+
* There is no skip: with no model, nothing in the workspace can run. "Back to
|
|
21
|
+
* workspaces" is the way out, to another workspace or to Log out.
|
|
22
|
+
*
|
|
23
|
+
* The host mounts the upgrade dialog (`GlobalUpgradeModal` in `apps/web`):
|
|
24
|
+
* "Upgrade plan" opens it through the upgrade store.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ConnectModelStep({ projectId, workspaceName, }: {
|
|
27
|
+
projectId: string;
|
|
28
|
+
workspaceName: string | null | undefined;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CreditCardIcon, KeyIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
5
|
+
import { AuthFrame } from '../../internal/auth/auth-card-shell.js';
|
|
6
|
+
import { Rise, StepHeader } from '../../internal/auth/auth-primitives.js';
|
|
7
|
+
import { useAccountState } from '../../internal/billing/use-account-state.js';
|
|
8
|
+
import { Button } from '../../primitives/button.js';
|
|
9
|
+
import { UiLink } from '../../providers/ui-provider.js';
|
|
10
|
+
import { ModelConnectionLayoutContext } from './model-connection-layout.js';
|
|
11
|
+
import { ConnectPlanRows } from './subscription-offer.js';
|
|
12
|
+
import { useModelConnectionGate } from './use-model-connection-gate.js';
|
|
13
|
+
/** Where "Back to workspaces" goes: the chooser, never the door that reopens this workspace. */
|
|
14
|
+
export const CONNECT_MODEL_STEP_BACK_HREF = '/workspaces';
|
|
15
|
+
/**
|
|
16
|
+
* The "Connect a model" step: what every workspace page shows while the viewer
|
|
17
|
+
* can run no model (`useWorkspaceModelGate`). New workspaces land here right
|
|
18
|
+
* after setup, and the workspace opens on its own once a model works: the
|
|
19
|
+
* provider dialog's save refreshes the model list the gate reads.
|
|
20
|
+
*
|
|
21
|
+
* - The two plan tiles first (ChatGPT, Claude): most people already pay for
|
|
22
|
+
* one, and each opens the provider dialog with that provider expanded.
|
|
23
|
+
* - "Add provider key" opens the same dialog on its provider list.
|
|
24
|
+
* - "Upgrade plan" only for a viewer who may change the project's models,
|
|
25
|
+
* when the workspace's plan has no Kortix models
|
|
26
|
+
* (`model_access.requires_provider_key`) and billing is on.
|
|
27
|
+
* - Every member gets the tiles and the key: the gate is per viewer, and a
|
|
28
|
+
* member may connect a login or a key for themselves (the server refuses
|
|
29
|
+
* only a connection shared with everyone, 403). A member who cannot change
|
|
30
|
+
* the project's models also reads who can connect one for everyone.
|
|
31
|
+
*
|
|
32
|
+
* There is no skip: with no model, nothing in the workspace can run. "Back to
|
|
33
|
+
* workspaces" is the way out, to another workspace or to Log out.
|
|
34
|
+
*
|
|
35
|
+
* The host mounts the upgrade dialog (`GlobalUpgradeModal` in `apps/web`):
|
|
36
|
+
* "Upgrade plan" opens it through the upgrade store.
|
|
37
|
+
*/
|
|
38
|
+
export function ConnectModelStep({ projectId, workspaceName, }) {
|
|
39
|
+
const t = useTranslations('sessionUi.modelGate');
|
|
40
|
+
const { canWriteProviders, openConnectProvider, openUpgrade, showUpgradeOption, modal } = useModelConnectionGate(undefined, { projectId });
|
|
41
|
+
const accountState = useAccountState();
|
|
42
|
+
const offerUpgrade = canWriteProviders &&
|
|
43
|
+
showUpgradeOption &&
|
|
44
|
+
accountState.data?.model_access?.requires_provider_key === true;
|
|
45
|
+
const name = workspaceName?.trim() || t('stepThisWorkspace');
|
|
46
|
+
const description = canWriteProviders
|
|
47
|
+
? t(offerUpgrade ? 'stepBodyUpgrade' : 'stepBody', { workspace: name })
|
|
48
|
+
: t('stepBodyMember', { workspace: name });
|
|
49
|
+
return (_jsxs(AuthFrame, { footerVariant: "none", backHref: CONNECT_MODEL_STEP_BACK_HREF, children: [modal, _jsx(Rise, { children: _jsx(StepHeader, { title: t('stepTitle'), description: description }) }, "connect-model-header"), _jsx(Rise, { delay: 0.06, children: _jsxs("div", { className: "flex flex-col gap-5", "data-testid": "connect-model-step", children: [_jsx(ModelConnectionLayoutContext.Provider, { value: "above", children: _jsx(ConnectPlanRows, { projectId: projectId, dismissible: false, className: "sm:grid-cols-1" }) }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs(Button, { type: "button", variant: "outline", size: "lg", className: "w-full gap-1.5", onClick: () => openConnectProvider('providers'), children: [_jsx(KeyIcon, { className: "size-4 shrink-0" }), t('noModelAddProviderKey')] }), offerUpgrade ? (_jsxs(Button, { type: "button", variant: "outline", size: "lg", className: "w-full gap-1.5", onClick: openUpgrade, children: [_jsx(CreditCardIcon, { className: "size-4 shrink-0" }), t('noModelUpgradePlan')] })) : null, _jsx(Button, { asChild: true, variant: "ghost", size: "lg", className: "w-full", children: _jsx(UiLink, { href: CONNECT_MODEL_STEP_BACK_HREF, children: t('stepBack') }) })] })] }) }, "connect-model-body")] }));
|
|
50
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { CreditCardIcon, ImageBrokenIcon, KeyIcon } from '@phosphor-icons/react';
|
|
4
|
-
import { AnimatePresence, m
|
|
4
|
+
import { AnimatePresence, m } from 'motion/react';
|
|
5
|
+
import { useReducedMotion } from '../../internal/hooks/use-reduced-motion.js';
|
|
5
6
|
import { useContext, useState } from 'react';
|
|
6
7
|
import { useTranslations } from '../../i18n/index.js';
|
|
7
8
|
import { Button } from '../../primitives/button.js';
|
|
@@ -391,7 +391,7 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
391
391
|
// model name truncates; the controls beside it keep their width.
|
|
392
392
|
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: triggerLabel }), 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
|
|
393
393
|
? 'w-[min(38rem,calc(100vw-1.5rem))]'
|
|
394
|
-
: 'w-[min(28rem,calc(100vw-1.5rem))]', children: _jsxs("div", { className: "flex min-w-0 flex-col", 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
|
|
394
|
+
: 'w-[min(28rem,calc(100vw-1.5rem))]', children: _jsxs("div", { className: "bg-surface flex min-w-0 flex-col", 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
|
|
395
395
|
? {
|
|
396
396
|
choices: effortChoices,
|
|
397
397
|
selectedVariant: reasoning?.selectedVariant,
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import type { SubscriptionUsage, SubscriptionUsageWindow } from '@kortix/sdk';
|
|
24
24
|
import { type FlatModel } from '@kortix/sdk/react';
|
|
25
|
+
import { type UsageTone } from './subscription-windows.js';
|
|
25
26
|
/** The provider whose pooled logins pay for a subscription model. Null for every other model. */
|
|
26
27
|
export declare function subscriptionProviderOf(model: Pick<FlatModel, 'providerID' | 'modelID'> & {
|
|
27
28
|
provider?: string | null;
|
|
@@ -35,3 +36,9 @@ export declare function peakBlockingWindow(usage: SubscriptionUsage | null | und
|
|
|
35
36
|
export declare function SubscriptionSwitcher({ providerId }: {
|
|
36
37
|
providerId: 'codex' | 'claude-agent';
|
|
37
38
|
}): import("react").JSX.Element | null;
|
|
39
|
+
/** A login's usage at a glance: a short bar in the tone's hue, then its label. */
|
|
40
|
+
export declare function SubscriptionRowMeter({ text, percent, tone }: {
|
|
41
|
+
text: string;
|
|
42
|
+
percent: number;
|
|
43
|
+
tone: UsageTone;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
@@ -7,7 +7,8 @@ import { SolidCheckIcon } from '../../internal/icons/solid-check-icon.js';
|
|
|
7
7
|
import { cn } from '../../lib/utils.js';
|
|
8
8
|
import { useSessionIds } from '../../providers/session-ids.js';
|
|
9
9
|
import { isClaudeSubscriptionModel, isSubscriptionModel } from './model-tags.js';
|
|
10
|
-
import
|
|
10
|
+
import Loading from '../../primitives/loading.js';
|
|
11
|
+
import { accountLine, isBlockingWindow, loginLimit, USAGE_TONE_BAR, usageTone, windowLabel, } from './subscription-windows.js';
|
|
11
12
|
import { useProviderKeyChoices } from '../overrides/provider-secret-pool-editor.js';
|
|
12
13
|
/** The provider whose pooled logins pay for a subscription model. Null for every other model. */
|
|
13
14
|
export function subscriptionProviderOf(model) {
|
|
@@ -58,6 +59,8 @@ export function SubscriptionSwitcher({ providerId }) {
|
|
|
58
59
|
const pick = (secretId) => {
|
|
59
60
|
void pools.setPool.mutateAsync({ providerId, secretIds: secretId ? [secretId] : null });
|
|
60
61
|
};
|
|
62
|
+
// The row a save is applying: it shows the pending glyph in its check slot.
|
|
63
|
+
const pendingId = pending ? (pools.setPool.variables?.secretIds?.[0] ?? null) : undefined;
|
|
61
64
|
const rows = [
|
|
62
65
|
{ secretId: null, label: t('projectDefaultShort'), line: t('subscriptionSwitcherDefault'), window: null, limited: false, broken: false },
|
|
63
66
|
...logins.map((secret) => {
|
|
@@ -81,17 +84,56 @@ export function SubscriptionSwitcher({ providerId }) {
|
|
|
81
84
|
if (event.metaKey || event.ctrlKey || event.altKey)
|
|
82
85
|
return;
|
|
83
86
|
event.stopPropagation();
|
|
84
|
-
if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp')
|
|
85
|
-
return;
|
|
86
|
-
event.preventDefault();
|
|
87
87
|
const radios = Array.from(event.currentTarget.querySelectorAll('[role="radio"]'));
|
|
88
88
|
const index = radios.indexOf(document.activeElement);
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const next = event.key === 'ArrowDown' ? (index + 1) % radios.length
|
|
90
|
+
: event.key === 'ArrowUp' ? (index - 1 + radios.length) % radios.length
|
|
91
|
+
: event.key === 'Home' ? 0
|
|
92
|
+
: event.key === 'End' ? radios.length - 1
|
|
93
|
+
: null;
|
|
94
|
+
if (next === null)
|
|
95
|
+
return;
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
radios[next]?.focus();
|
|
91
98
|
};
|
|
92
|
-
return (
|
|
99
|
+
return (
|
|
100
|
+
// `border-t`: the pane spans the picker's full width under the rail, the
|
|
101
|
+
// list and the effort pane, so one rule closes all three above it.
|
|
102
|
+
_jsxs("div", { className: "border-t", children: [_jsx("div", { className: "text-muted-foreground flex h-9 shrink-0 items-center border-b px-3 text-sm", children: t('subscriptionSwitcher') }), _jsx("div", { role: "radiogroup", "aria-label": t('subscriptionSwitcher'), onKeyDown: onKeyDown, className: "flex flex-col gap-px p-1.5", children: rows.map((row) => {
|
|
93
103
|
const checked = row.secretId === pinnedId || (row.secretId === null && pinnedId === null);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
// A limit outranks the window: a provider can refuse a login while
|
|
105
|
+
// no window it reports is still in force.
|
|
106
|
+
const meter = row.limited
|
|
107
|
+
? { percent: 100, tone: 'limited', text: tUsage('limitReached') }
|
|
108
|
+
: row.window
|
|
109
|
+
? {
|
|
110
|
+
percent: Math.round(row.window.used_percent),
|
|
111
|
+
tone: usageTone(row.window, false),
|
|
112
|
+
text: `${windowLabel(row.window.id, tUsage)} · ${tUsage('percent', { percent: Math.round(row.window.used_percent) })}`,
|
|
113
|
+
}
|
|
114
|
+
: null;
|
|
115
|
+
// One status per row, in one right-hand slot: a broken login cannot
|
|
116
|
+
// run a turn, so that outranks its last usage.
|
|
117
|
+
const status = row.broken ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('needsReconnection') })) : meter ? (_jsx(SubscriptionRowMeter, { ...meter })) : row.secretId ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: tUsage('notReported') })) : null;
|
|
118
|
+
return (_jsxs("button", { type: "button", role: "radio", "aria-checked": checked, "aria-label": row.secretId ? t('subscriptionSwitcherUse', { label: row.label }) : undefined, "aria-busy": pendingId === row.secretId || undefined, tabIndex: checked ? 0 : -1,
|
|
119
|
+
// A save in flight blocks a second pick with `aria-disabled`, not
|
|
120
|
+
// `disabled`: a disabled button drops the keyboard focus it holds.
|
|
121
|
+
disabled: !canEdit, "aria-disabled": pending || undefined, onClick: () => {
|
|
122
|
+
if (!pending)
|
|
123
|
+
pick(row.secretId);
|
|
124
|
+
}, className: cn(
|
|
125
|
+
// One line per row, the model rows' shape: the name in ink, its
|
|
126
|
+
// account line muted after it, the status and the check in
|
|
127
|
+
// fixed slots so every meter lines up. `h-12` (44px) is the touch row.
|
|
128
|
+
'flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-left text-sm outline-none sm:h-9', 'hover:bg-hover focus-visible:bg-hover focus-visible:ring-kortix-base transition-colors duration-fast focus-visible:ring-2',
|
|
129
|
+
// Read-only rows dim; a save in flight keeps full ink, and
|
|
130
|
+
// the spinner says which row it applies.
|
|
131
|
+
'disabled:pointer-events-none disabled:opacity-50', checked && 'bg-active hover:bg-active'), children: [_jsxs("span", { className: "min-w-0 flex-1 truncate", title: row.line ?? undefined, children: [_jsx("span", { className: "text-foreground font-medium", children: row.label }), row.line ? _jsxs("span", { className: "text-muted-foreground", children: [" ", row.line] }) : null] }), status, _jsx("span", { className: "flex size-4 shrink-0 items-center justify-center", children: pendingId === row.secretId ? (
|
|
132
|
+
// `!`: Loading paints itself `text-background` inside a button (a filled one); this row is transparent.
|
|
133
|
+
_jsx(Loading, { className: "text-muted-foreground! size-3.5" })) : checked ? (_jsx(SolidCheckIcon, { className: "text-ring size-4" })) : null })] }, row.secretId ?? 'default'));
|
|
134
|
+
}) }), canEdit ? null : _jsx("p", { className: "text-muted-foreground px-3 pb-2 text-xs", children: t('readOnlyPool') })] }));
|
|
135
|
+
}
|
|
136
|
+
/** A login's usage at a glance: a short bar in the tone's hue, then its label. */
|
|
137
|
+
export function SubscriptionRowMeter({ text, percent, tone }) {
|
|
138
|
+
return (_jsxs("span", { className: "text-muted-foreground flex shrink-0 items-center gap-2 text-xs tabular-nums", "data-subscription-usage-row": "", children: [_jsx("span", { className: "bg-muted block h-1 w-10 overflow-hidden rounded-full", "aria-hidden": true, children: _jsx("span", { className: cn('block h-full', USAGE_TONE_BAR[tone]), style: { width: `${Math.min(100, percent)}%` } }) }), _jsx("span", { className: "max-w-72 truncate", children: text })] }));
|
|
97
139
|
}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import type { SubscriptionAccount, SubscriptionUsage, SubscriptionUsageWindow } from '@kortix/sdk';
|
|
8
8
|
import type { useTranslations } from '../../i18n/index.js';
|
|
9
9
|
export type UsageTone = 'ok' | 'near' | 'critical' | 'limited';
|
|
10
|
+
/** The bar fill of each tone: the provider sheet's meters and the picker's subscription rows. */
|
|
11
|
+
export declare const USAGE_TONE_BAR: Record<UsageTone, string>;
|
|
10
12
|
/** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
|
|
11
13
|
export declare function usageTone(window: SubscriptionUsageWindow, limited: boolean): UsageTone;
|
|
12
14
|
/**
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** The bar fill of each tone: the provider sheet's meters and the picker's subscription rows. */
|
|
2
|
+
export const USAGE_TONE_BAR = { ok: 'bg-primary', near: 'bg-kortix-orange', critical: 'bg-kortix-red', limited: 'bg-kortix-red' };
|
|
1
3
|
/** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
|
|
2
4
|
export function usageTone(window, limited) {
|
|
3
5
|
if (window.used_percent >= 100 || (limited && window.used_percent >= 90))
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type WorkspaceModelGateView } from './workspace-model-gate.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether `projectId` may open for the signed-in viewer: `'open'`,
|
|
4
|
+
* `'pending'` (no answer yet, and this browser never saw it ready) or
|
|
5
|
+
* `'blocked'` (no model can run). See `workspace-model-gate.ts` for the rules.
|
|
6
|
+
*
|
|
7
|
+
* Reads `/model-picker` through its shared cache entry
|
|
8
|
+
* (`qk.project.modelPicker`), the one the composer, the model picker and the
|
|
9
|
+
* shell prefetch read, so it adds no request to a workspace load.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useWorkspaceModelGate(projectId: string): WorkspaceModelGateView;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { useEffect, useMemo } from 'react';
|
|
4
|
+
import { getWorkspaceModelPicker } from '@kortix/sdk';
|
|
5
|
+
import { contract, flattenModels, projectLlmCatalogToProviderList, qk, useFeatureFlag, } from '@kortix/sdk/react';
|
|
6
|
+
import { useUiViewerId } from '../../providers/ui-provider.js';
|
|
7
|
+
import { isRunnableModel } from './model-availability.js';
|
|
8
|
+
import { readModelReady, resolveWorkspaceModelGate, writeModelReady, } from './workspace-model-gate.js';
|
|
9
|
+
/**
|
|
10
|
+
* While the workspace is blocked, re-read the model list on this cadence, so a
|
|
11
|
+
* connection made elsewhere (another tab, another device, a person who manages
|
|
12
|
+
* the workspace) opens it without a reload. The same cadence as the access
|
|
13
|
+
* gate's approval poll. A connection made on this screen does not wait for
|
|
14
|
+
* it: the provider dialog's save invalidates the same query at once
|
|
15
|
+
* (`refreshWorkspaceProviderState`).
|
|
16
|
+
*/
|
|
17
|
+
const BLOCKED_RECHECK_MS = 15_000;
|
|
18
|
+
/**
|
|
19
|
+
* Whether `projectId` may open for the signed-in viewer: `'open'`,
|
|
20
|
+
* `'pending'` (no answer yet, and this browser never saw it ready) or
|
|
21
|
+
* `'blocked'` (no model can run). See `workspace-model-gate.ts` for the rules.
|
|
22
|
+
*
|
|
23
|
+
* Reads `/model-picker` through its shared cache entry
|
|
24
|
+
* (`qk.project.modelPicker`), the one the composer, the model picker and the
|
|
25
|
+
* shell prefetch read, so it adds no request to a workspace load.
|
|
26
|
+
*/
|
|
27
|
+
export function useWorkspaceModelGate(projectId) {
|
|
28
|
+
const viewerId = useUiViewerId();
|
|
29
|
+
// A program agent runs code instead of a model (flag `program_agents`), so a
|
|
30
|
+
// project that turned them on may work with no model at all.
|
|
31
|
+
const programAgents = useFeatureFlag(projectId, 'program_agents').enabled;
|
|
32
|
+
const enabled = !!projectId && !programAgents;
|
|
33
|
+
const query = useQuery({
|
|
34
|
+
queryKey: qk.project.modelPicker(projectId),
|
|
35
|
+
queryFn: () => getWorkspaceModelPicker(projectId),
|
|
36
|
+
enabled,
|
|
37
|
+
...contract('config'),
|
|
38
|
+
retry: false,
|
|
39
|
+
refetchInterval: (current) => current.state.data && !flattenCatalog(current.state.data).some(isRunnableModel)
|
|
40
|
+
? BLOCKED_RECHECK_MS
|
|
41
|
+
: false,
|
|
42
|
+
});
|
|
43
|
+
const models = useMemo(() => (query.data ? flattenCatalog(query.data) : undefined), [query.data]);
|
|
44
|
+
// Read once per viewer and workspace: the write below must not flip a
|
|
45
|
+
// decision that is already on screen.
|
|
46
|
+
const rememberedReady = useMemo(() => readModelReady(viewerId, projectId), [viewerId, projectId]);
|
|
47
|
+
const view = resolveWorkspaceModelGate({
|
|
48
|
+
enabled,
|
|
49
|
+
models,
|
|
50
|
+
failed: query.isError,
|
|
51
|
+
rememberedReady,
|
|
52
|
+
});
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
// Only a server answer is recorded; a remembered or failed-open verdict is not.
|
|
55
|
+
if (enabled && models)
|
|
56
|
+
writeModelReady(viewerId, projectId, view === 'open');
|
|
57
|
+
}, [enabled, models, projectId, view, viewerId]);
|
|
58
|
+
return view;
|
|
59
|
+
}
|
|
60
|
+
function flattenCatalog(catalog) {
|
|
61
|
+
return flattenModels(projectLlmCatalogToProviderList(catalog));
|
|
62
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace model gate: a workspace opens only when the viewer can run at
|
|
3
|
+
* least one model. Without one, every workspace page shows the "Connect a
|
|
4
|
+
* model" step instead (`apps/web` `ConnectModelScreen`).
|
|
5
|
+
*
|
|
6
|
+
* "Can run a model" is the composer's own test (`isRunnableModel`) over the
|
|
7
|
+
* server-resolved `/model-picker` list. That list already applies the plan
|
|
8
|
+
* (a Free account sees no Kortix model), the viewer's own Claude login, the
|
|
9
|
+
* project's ChatGPT login and keys, and the model switches. So a Credits or
|
|
10
|
+
* Enterprise workspace opens on Kortix models, and a Free workspace opens once
|
|
11
|
+
* a ChatGPT plan, a Claude plan or an API key is connected.
|
|
12
|
+
*
|
|
13
|
+
* Pure and framework-free: the hook (`use-workspace-model-gate.ts`) feeds it.
|
|
14
|
+
*/
|
|
15
|
+
export type WorkspaceModelGateView = 'open' | 'pending' | 'blocked';
|
|
16
|
+
export interface WorkspaceModelGateInput {
|
|
17
|
+
/** False turns the gate off: no project yet, or the project runs program agents. */
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
/** The flattened `/model-picker` list, or `undefined` while no answer is in. */
|
|
20
|
+
models: ReadonlyArray<{
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
available?: boolean;
|
|
23
|
+
}> | undefined;
|
|
24
|
+
/** The `/model-picker` read failed and holds no answer. */
|
|
25
|
+
failed: boolean;
|
|
26
|
+
/** This browser saw a runnable model in this workspace for this viewer before. */
|
|
27
|
+
rememberedReady: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* - A settled answer decides: one runnable model opens the workspace, none
|
|
31
|
+
* blocks it.
|
|
32
|
+
* - A failed read opens the workspace. The server still refuses a session with
|
|
33
|
+
* no model (`no_model_available`), so an outage of `/model-picker` must not
|
|
34
|
+
* lock every workspace.
|
|
35
|
+
* - No answer yet: a workspace this browser saw ready opens at once (no wait
|
|
36
|
+
* on every load); any other waits, so a blocked workspace never flashes.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveWorkspaceModelGate(input: WorkspaceModelGateInput): WorkspaceModelGateView;
|
|
39
|
+
/**
|
|
40
|
+
* Whether this browser saw a runnable model for this viewer in this workspace.
|
|
41
|
+
* A per-viewer hint that only skips the wait; the server answer always wins.
|
|
42
|
+
* False when storage is blocked (private mode, a preview frame).
|
|
43
|
+
*/
|
|
44
|
+
export declare function readModelReady(viewerId: string | null | undefined, projectId: string): boolean;
|
|
45
|
+
/** Record the server's answer, so the next load of this workspace waits only when it was blocked. */
|
|
46
|
+
export declare function writeModelReady(viewerId: string | null | undefined, projectId: string, ready: boolean): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace model gate: a workspace opens only when the viewer can run at
|
|
3
|
+
* least one model. Without one, every workspace page shows the "Connect a
|
|
4
|
+
* model" step instead (`apps/web` `ConnectModelScreen`).
|
|
5
|
+
*
|
|
6
|
+
* "Can run a model" is the composer's own test (`isRunnableModel`) over the
|
|
7
|
+
* server-resolved `/model-picker` list. That list already applies the plan
|
|
8
|
+
* (a Free account sees no Kortix model), the viewer's own Claude login, the
|
|
9
|
+
* project's ChatGPT login and keys, and the model switches. So a Credits or
|
|
10
|
+
* Enterprise workspace opens on Kortix models, and a Free workspace opens once
|
|
11
|
+
* a ChatGPT plan, a Claude plan or an API key is connected.
|
|
12
|
+
*
|
|
13
|
+
* Pure and framework-free: the hook (`use-workspace-model-gate.ts`) feeds it.
|
|
14
|
+
*/
|
|
15
|
+
import { isRunnableModel } from './model-availability.js';
|
|
16
|
+
/**
|
|
17
|
+
* - A settled answer decides: one runnable model opens the workspace, none
|
|
18
|
+
* blocks it.
|
|
19
|
+
* - A failed read opens the workspace. The server still refuses a session with
|
|
20
|
+
* no model (`no_model_available`), so an outage of `/model-picker` must not
|
|
21
|
+
* lock every workspace.
|
|
22
|
+
* - No answer yet: a workspace this browser saw ready opens at once (no wait
|
|
23
|
+
* on every load); any other waits, so a blocked workspace never flashes.
|
|
24
|
+
*/
|
|
25
|
+
export function resolveWorkspaceModelGate(input) {
|
|
26
|
+
if (!input.enabled)
|
|
27
|
+
return 'open';
|
|
28
|
+
if (input.models)
|
|
29
|
+
return input.models.some(isRunnableModel) ? 'open' : 'blocked';
|
|
30
|
+
if (input.failed)
|
|
31
|
+
return 'open';
|
|
32
|
+
return input.rememberedReady ? 'open' : 'pending';
|
|
33
|
+
}
|
|
34
|
+
const READY_KEY_PREFIX = 'kortix:model-ready:';
|
|
35
|
+
function readyKey(viewerId, projectId) {
|
|
36
|
+
return `${READY_KEY_PREFIX}${viewerId}:${projectId}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether this browser saw a runnable model for this viewer in this workspace.
|
|
40
|
+
* A per-viewer hint that only skips the wait; the server answer always wins.
|
|
41
|
+
* False when storage is blocked (private mode, a preview frame).
|
|
42
|
+
*/
|
|
43
|
+
export function readModelReady(viewerId, projectId) {
|
|
44
|
+
if (!viewerId || !projectId || typeof window === 'undefined')
|
|
45
|
+
return false;
|
|
46
|
+
try {
|
|
47
|
+
return window.localStorage.getItem(readyKey(viewerId, projectId)) === '1';
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Record the server's answer, so the next load of this workspace waits only when it was blocked. */
|
|
54
|
+
export function writeModelReady(viewerId, projectId, ready) {
|
|
55
|
+
if (!viewerId || !projectId || typeof window === 'undefined')
|
|
56
|
+
return;
|
|
57
|
+
try {
|
|
58
|
+
if (ready)
|
|
59
|
+
window.localStorage.setItem(readyKey(viewerId, projectId), '1');
|
|
60
|
+
else
|
|
61
|
+
window.localStorage.removeItem(readyKey(viewerId, projectId));
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Storage blocked: every load waits for the answer, which is still correct.
|
|
65
|
+
}
|
|
66
|
+
}
|