@kortix/ui 0.15.11 → 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 +478 -179
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- 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-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 +6 -28
- package/dist/customize/agents/agent-tabs.d.ts +1 -0
- package/dist/customize/agents/agent-tabs.js +1 -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/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 +1 -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/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 +21 -2
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule-view.js +2 -1
- 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 +495 -46
- package/dist/i18n/en.js +536 -87
- 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/lib/browser-noise/rules/webview.js +16 -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/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/agents/agent-model.d.ts +1 -0
- package/dist/session/agents/agent-model.js +2 -1
- package/dist/session/agents/agent-strip.js +10 -4
- 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 +3 -0
- package/dist/session/composer/agent-selector.js +6 -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.js +7 -2
- package/dist/session/composer/composer.d.ts +2 -2
- package/dist/session/composer/composer.js +7 -6
- 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.js +24 -6
- package/dist/session/media/sandbox-url-detector.js +1 -1
- 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/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/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 +18 -3
- 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 +1 -2
- package/dist/session/thread/transcript.js +26 -24
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- 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/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 +495 -46
- package/dist/workspace/admin/project-admin-dashboard.js +21 -7
- 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/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/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/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-timeline.js +2 -2
- package/package.json +67 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- 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
|
@@ -6,15 +6,15 @@ import { useLocale, useTranslations } from '../../../i18n/index.js';
|
|
|
6
6
|
import { cn } from '../../../lib/utils.js';
|
|
7
7
|
import { Badge } from '../../../primitives/badge.js';
|
|
8
8
|
import { Progress } from '../../../primitives/progress.js';
|
|
9
|
-
import { accountLine, currentWindows as current, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel, } from '../../../session/models/subscription-windows.js';
|
|
10
|
-
|
|
9
|
+
import { accountLine, currentWindows as current, isBlockingWindow, loginLimit, modelName, USAGE_TONE_BAR, usageTone, weeklyModel, windowLabel, } from '../../../session/models/subscription-windows.js';
|
|
10
|
+
import { SubscriptionRowMeter } from '../../../session/models/subscription-switcher.js';
|
|
11
|
+
export { accountLine, isBlockingWindow, loginLimit, modelName, SubscriptionRowMeter, usageTone, weeklyModel, windowLabel };
|
|
11
12
|
/** Providers whose stored value is a subscription login with plan windows. */
|
|
12
13
|
const SUBSCRIPTION_PROVIDERS = new Set(['codex', 'claude-agent']);
|
|
13
14
|
/** The provider-list row that carries each subscription login's usage. */
|
|
14
15
|
export const SUBSCRIPTION_ROW = { codex: 'openai', 'claude-agent': 'anthropic' };
|
|
15
16
|
/** A snapshot older than this says when it was observed. */
|
|
16
17
|
const STALE_MS = 10 * 60 * 1000;
|
|
17
|
-
const TONE_BAR = { ok: 'bg-primary', near: 'bg-kortix-orange', critical: 'bg-kortix-red', limited: 'bg-kortix-red' };
|
|
18
18
|
/**
|
|
19
19
|
* A reset time a person reads at a glance: the clock time today, the weekday
|
|
20
20
|
* and time within a week, else the date.
|
|
@@ -118,10 +118,6 @@ export function useSubscriptionRowSummary() {
|
|
|
118
118
|
};
|
|
119
119
|
}, [t, locale]);
|
|
120
120
|
}
|
|
121
|
-
/** The provider list's mini meter beside its summary line. */
|
|
122
|
-
export function SubscriptionRowMeter({ text, percent, tone }) {
|
|
123
|
-
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', TONE_BAR[tone]), style: { width: `${Math.min(100, percent)}%` } }) }), _jsx("span", { className: "max-w-72 truncate", children: text })] }));
|
|
124
|
-
}
|
|
125
121
|
function UsageWindowMeter({ window, limited, now, modelWeekly }) {
|
|
126
122
|
const t = useTranslations('subscriptionUsage');
|
|
127
123
|
const locale = useLocale();
|
|
@@ -136,7 +132,7 @@ function UsageWindowMeter({ window, limited, now, modelWeekly }) {
|
|
|
136
132
|
const detail = passed ? t('resetPassed')
|
|
137
133
|
: tone === 'limited' && reset ? t('percentBack', { percent, time: reset })
|
|
138
134
|
: reset ? t('percentResets', { percent, time: reset }) : t('percent', { percent });
|
|
139
|
-
return (_jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", "data-usage-window": window.id, children: [_jsxs("div", { className: "flex items-baseline justify-between gap-3 text-xs", children: [_jsx("span", { className: "text-foreground min-w-0 truncate", children: label }), _jsx("span", { className: cn('shrink-0 tabular-nums', tone === 'limited' && !passed ? 'text-foreground' : 'text-muted-foreground'), children: detail })] }), _jsx(Progress, { value: passed ? 0 : percent, "aria-label": t('meterLabel', { label, percent }), className: "bg-muted h-1", indicatorClassName: passed ? 'bg-muted-foreground' :
|
|
135
|
+
return (_jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", "data-usage-window": window.id, children: [_jsxs("div", { className: "flex items-baseline justify-between gap-3 text-xs", children: [_jsx("span", { className: "text-foreground min-w-0 truncate", children: label }), _jsx("span", { className: cn('shrink-0 tabular-nums', tone === 'limited' && !passed ? 'text-foreground' : 'text-muted-foreground'), children: detail })] }), _jsx(Progress, { value: passed ? 0 : percent, "aria-label": t('meterLabel', { label, percent }), className: "bg-muted h-1", indicatorClassName: passed ? 'bg-muted-foreground' : USAGE_TONE_BAR[tone] })] }));
|
|
140
136
|
}
|
|
141
137
|
/** Claude reports no 5-hour window until a message opens one: say so instead of hiding the limit. */
|
|
142
138
|
function NotStartedWindow({ id }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../../primitives/button.js';
|
|
3
|
-
import { SettingsSectionHeader } from '../../primitives/settings-section-header.js';
|
|
3
|
+
import { SettingsPageHeader, SettingsSectionHeader, useSettingsPageTitle, } from '../../primitives/settings-section-header.js';
|
|
4
4
|
import { useTranslations } from '../../i18n/index.js';
|
|
5
5
|
import { BookOpenIcon } from '@phosphor-icons/react';
|
|
6
6
|
import { UiLink as Link } from '../../providers/ui-provider.js';
|
|
@@ -35,8 +35,17 @@ export function SettingsTabHeader({ tab, action, hideDescription = false, }) {
|
|
|
35
35
|
const tSettingsRail = useTranslations('settings.rail');
|
|
36
36
|
const item = contextItem ?? railItemForTab(tab, (key) => tSettingsRail(key));
|
|
37
37
|
const chrome = useSettingsRailChromeCopy();
|
|
38
|
+
// Inside Workspace settings the pane is a page: its rail row names it, and
|
|
39
|
+
// a pane with no rail entry of its own (Danger zone) still gets its title.
|
|
40
|
+
const pageTitle = useSettingsPageTitle();
|
|
41
|
+
if (!item && !pageTitle)
|
|
42
|
+
return null;
|
|
43
|
+
const docs = item?.docsHref ? (_jsx(Button, { asChild: true, variant: "secondary", size: "sm", className: "gap-1.5", children: _jsxs(Link, { href: item.docsHref, target: "_blank", rel: "noreferrer", children: [_jsx(BookOpenIcon, { className: "size-3.5 shrink-0" }), chrome.docs] }) })) : null;
|
|
44
|
+
const actions = docs || action ? (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [docs, action] })) : undefined;
|
|
45
|
+
if (pageTitle) {
|
|
46
|
+
return (_jsx(SettingsPageHeader, { title: pageTitle, description: hideDescription ? undefined : item?.description, action: actions }));
|
|
47
|
+
}
|
|
38
48
|
if (!item)
|
|
39
49
|
return null;
|
|
40
|
-
|
|
41
|
-
return (_jsx(SettingsSectionHeader, { title: item.label, description: hideDescription ? undefined : item.description, action: docs || action ? (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [docs, action] })) : undefined, className: "pb-1" }));
|
|
50
|
+
return (_jsx(SettingsSectionHeader, { title: item.label, description: hideDescription ? undefined : item.description, action: actions, className: "pb-1" }));
|
|
42
51
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { type FeatureFlagView } from '@kortix/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* The origin line under a flag: inherited platform default, or this project's
|
|
4
|
-
* own choice. Ported from `main`'s `feature-flags-view.tsx`.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* own choice. Ported from `main`'s `feature-flags-view.tsx`. An overridden flag
|
|
5
|
+
* also names the default it replaced (`default_enabled`), so the row says what
|
|
6
|
+
* Reset to default returns it to; a server older than that field sends none,
|
|
7
|
+
* and the row says only that it is overridden rather than guess.
|
|
8
8
|
*/
|
|
9
9
|
export interface ExperimentalCopy {
|
|
10
10
|
overridden: string;
|
|
11
|
+
/** The control that removes this workspace's choice. */
|
|
12
|
+
reset: string;
|
|
11
13
|
/** Origin line of an `operator_only` flag: only Kortix changes it. */
|
|
12
14
|
managedByKortix: string;
|
|
13
15
|
defaultOn: string;
|
|
@@ -24,6 +26,13 @@ export interface ExperimentalCopy {
|
|
|
24
26
|
wipNote: string;
|
|
25
27
|
}
|
|
26
28
|
export declare const DEFAULT_EXPERIMENTAL_COPY: ExperimentalCopy;
|
|
29
|
+
/**
|
|
30
|
+
* The workspace's choice changes what the flag does. An override that equals
|
|
31
|
+
* the platform default (a flag switched off and on again) changes nothing, so
|
|
32
|
+
* the row reads as the default and offers no reset. A server that sends no
|
|
33
|
+
* `default_enabled` leaves this unknown: the row trusts `overridden`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function overridesDefault(feature: FeatureFlagView): boolean;
|
|
27
36
|
/** The translator surface {@link localizeFeatureFlag} reads. */
|
|
28
37
|
export interface FeatureFlagTranslator {
|
|
29
38
|
(key: string): string;
|
|
@@ -74,7 +83,9 @@ export interface ExperimentalTabViewProps {
|
|
|
74
83
|
/** The reader is a platform operator: may change an `operator_only` flag
|
|
75
84
|
* (the route's own rule, project-settings.ts patchFeatureFlagHandler). */
|
|
76
85
|
canManageOperatorOnly?: boolean;
|
|
77
|
-
|
|
86
|
+
/** `next: null` removes the workspace's choice: the flag follows the
|
|
87
|
+
* platform default again (Reset to default, `kortix workspaces features reset`). */
|
|
88
|
+
onToggle?: (key: string, next: boolean | null) => void;
|
|
78
89
|
/**
|
|
79
90
|
* Search text, CONTROLLED — the container owns it and hands down an already
|
|
80
91
|
* filtered `features`.
|
|
@@ -55,6 +55,7 @@ import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
|
|
|
55
55
|
*/
|
|
56
56
|
import { useRef, useState } from 'react';
|
|
57
57
|
import { Button } from '../../../primitives/button.js';
|
|
58
|
+
import { InlineCodeText } from '../../../markdown/inline-code-text.js';
|
|
58
59
|
import { InputGroupSearch, InputGroupSearchClear, InputGroupSearchIcon, InputGroupSearchInput, } from '../../../primitives/input-group.js';
|
|
59
60
|
import Loading from '../../../primitives/loading.js';
|
|
60
61
|
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
@@ -75,6 +76,7 @@ import { ChannelsSwitchDialog } from '../../shared/channels-switch-dialog.js';
|
|
|
75
76
|
import { SettingsTabHeader } from '../settings-tab-header.js';
|
|
76
77
|
export const DEFAULT_EXPERIMENTAL_COPY = {
|
|
77
78
|
overridden: 'Overridden for this workspace',
|
|
79
|
+
reset: 'Reset to default',
|
|
78
80
|
managedByKortix: 'Managed by Kortix',
|
|
79
81
|
defaultOn: 'Default on',
|
|
80
82
|
defaultOff: 'Default off',
|
|
@@ -88,14 +90,27 @@ export const DEFAULT_EXPERIMENTAL_COPY = {
|
|
|
88
90
|
wip: 'Work in progress',
|
|
89
91
|
wipNote: 'Not recommended yet: it can change or break.',
|
|
90
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* The workspace's choice changes what the flag does. An override that equals
|
|
95
|
+
* the platform default (a flag switched off and on again) changes nothing, so
|
|
96
|
+
* the row reads as the default and offers no reset. A server that sends no
|
|
97
|
+
* `default_enabled` leaves this unknown: the row trusts `overridden`.
|
|
98
|
+
*/
|
|
99
|
+
export function overridesDefault(feature) {
|
|
100
|
+
if (!feature.overridden)
|
|
101
|
+
return false;
|
|
102
|
+
return feature.default_enabled === undefined || feature.enabled !== feature.default_enabled;
|
|
103
|
+
}
|
|
91
104
|
function originLabel(feature, copy) {
|
|
92
105
|
// An internal-only flag (`apps`) is listed only while on, and
|
|
93
106
|
// `PATCH /features` refuses it to anyone but a Kortix operator.
|
|
94
107
|
if (feature.operator_only)
|
|
95
108
|
return copy.managedByKortix;
|
|
96
|
-
if (feature
|
|
109
|
+
if (!overridesDefault(feature))
|
|
110
|
+
return feature.enabled ? copy.defaultOn : copy.defaultOff;
|
|
111
|
+
if (feature.default_enabled === undefined)
|
|
97
112
|
return copy.overridden;
|
|
98
|
-
return feature.
|
|
113
|
+
return `${copy.overridden} · ${feature.default_enabled ? copy.defaultOn : copy.defaultOff}`;
|
|
99
114
|
}
|
|
100
115
|
/**
|
|
101
116
|
* A catalog row with its display copy in the reader's language.
|
|
@@ -154,7 +169,7 @@ function ExperimentalFeatureRow({ feature, pending, canManage, onToggle, copy, }
|
|
|
154
169
|
// needed and the row stays hook-free, which is what lets the view render
|
|
155
170
|
// under `renderToStaticMarkup`.
|
|
156
171
|
const nameId = `feature-flag-${feature.key}`;
|
|
157
|
-
return (_jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("p", { id: nameId, className: "text-foreground text-sm font-medium", children: feature.name }), feature.wip ? (_jsx(Badge, { variant: "warning", size: "xs", children: copy.wip })) : null, _jsx("span", { className: "text-muted-foreground text-xs", children: originLabel(feature, copy) })] }), _jsxs("p", { className: "text-muted-foreground mt-0.5 text-xs text-pretty", children: [feature.wip ? `${copy.wipNote} ` : null, feature.description] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [pending ? _jsx(Loading, { className: "text-muted-foreground size-3.5" }) : null, _jsx(Switch, { "aria-labelledby": nameId, checked: feature.enabled, disabled: !canManage || pending, onCheckedChange: (v) => onToggle(feature.key, v) })] })] }));
|
|
172
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("p", { id: nameId, className: "text-foreground text-sm font-medium", children: feature.name }), feature.wip ? (_jsx(Badge, { variant: "warning", size: "xs", children: copy.wip })) : null, _jsx("span", { className: "text-muted-foreground text-xs", children: originLabel(feature, copy) })] }), _jsxs("p", { className: "text-muted-foreground mt-0.5 text-xs text-pretty", children: [feature.wip ? `${copy.wipNote} ` : null, _jsx(InlineCodeText, { text: feature.description })] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [pending ? _jsx(Loading, { className: "text-muted-foreground size-3.5" }) : null, overridesDefault(feature) && !feature.operator_only ? (_jsx(Button, { variant: "ghost", size: "xs", disabled: !canManage || pending, onClick: () => onToggle(feature.key, null), children: copy.reset })) : null, _jsx(Switch, { "aria-labelledby": nameId, checked: feature.enabled, disabled: !canManage || pending, onCheckedChange: (v) => onToggle(feature.key, v) })] })] }));
|
|
158
173
|
}
|
|
159
174
|
/** Presentational only — no hooks, no data fetching, no store or Supabase
|
|
160
175
|
* read. Kept separate from `ExperimentalTab` so this renders under
|
|
@@ -170,7 +185,7 @@ export function ExperimentalTabView({ isLoading = false, isError = false, errorM
|
|
|
170
185
|
const pendingKeySet = new Set(pendingKeys);
|
|
171
186
|
const searchRef = useRef(null);
|
|
172
187
|
useSlashFocus(searchRef, !isLoading && !isError && showSearch);
|
|
173
|
-
return (_jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [_jsx(SettingsTabHeader, { tab: "feature-flags" }), _jsxs("div", { className: "space-y-4", children: [!isLoading && !isError && showSearch ? (_jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { ref: searchRef, placeholder: copy.search, value: query, onChange: (e) => onQueryChange(e.target.value), variant: "popover" }), _jsx(InputGroupSearchClear, { onClick: () => onQueryChange('') })] })) : null, isLoading ? (_jsx(Skeleton, { className: "h-40 rounded-md" })) : isError ? (_jsx(ErrorState, { size: "sm", title: copy.loadFailed, description: errorMessage, action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: copy.retry }) })) : features.length === 0 ? (
|
|
188
|
+
return (_jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [_jsx(SettingsTabHeader, { tab: "feature-flags" }), _jsxs("div", { className: "space-y-4", children: [!isLoading && !isError && showSearch ? (_jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { ref: searchRef, placeholder: copy.search, value: query, onChange: (e) => onQueryChange(e.target.value), variant: "popover" }), query ? _jsx(InputGroupSearchClear, { onClick: () => onQueryChange('') }) : null] })) : null, isLoading ? (_jsx(Skeleton, { className: "h-40 rounded-md" })) : isError ? (_jsx(ErrorState, { size: "sm", title: copy.loadFailed, description: errorMessage, action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: copy.retry }) })) : features.length === 0 ? (
|
|
174
189
|
// Two different nothings. A search that matches nothing is a dead end
|
|
175
190
|
// you can back out of by clearing the field; a deployment with no flags
|
|
176
191
|
// at all is a fact about the deployment. Showing the second in place of
|
|
@@ -264,24 +279,34 @@ export function ExperimentalTab({ projectId }) {
|
|
|
264
279
|
// viewer who may flip it sees it (hidden while that answer loads).
|
|
265
280
|
const visible = canEdit ? withPending : withPending.filter((f) => f.key !== 'chat');
|
|
266
281
|
const features = filterFeatures(visible, query);
|
|
282
|
+
// The position a change lands on: a reset (`next: null`) lands on the
|
|
283
|
+
// platform default, or stays put when an older server sends none.
|
|
284
|
+
const landsOn = (key, next) => {
|
|
285
|
+
const feature = rawFeatures.find((f) => f.key === key);
|
|
286
|
+
return next ?? feature?.default_enabled ?? feature?.enabled ?? false;
|
|
287
|
+
};
|
|
267
288
|
const apply = (key, next) => {
|
|
268
|
-
setPendingValues((prev) => ({ ...prev, [key]: next }));
|
|
289
|
+
setPendingValues((prev) => ({ ...prev, [key]: landsOn(key, next) }));
|
|
269
290
|
toggleMutation.mutate({ key: key, next });
|
|
270
291
|
};
|
|
271
|
-
// Channels asks first: the dialog says what changes for everyone.
|
|
292
|
+
// Channels asks first: the dialog says what changes for everyone. A reset
|
|
293
|
+
// that leaves Channels where it is changes nothing anyone sees, so it does
|
|
294
|
+
// not ask.
|
|
272
295
|
const [channelsTarget, setChannelsTarget] = useState(null);
|
|
273
296
|
const handleToggle = (key, next) => {
|
|
274
|
-
|
|
275
|
-
|
|
297
|
+
const enabled = rawFeatures.find((f) => f.key === key)?.enabled;
|
|
298
|
+
if (key === 'chat' && landsOn(key, next) !== enabled)
|
|
299
|
+
setChannelsTarget({ next });
|
|
276
300
|
else
|
|
277
301
|
apply(key, next);
|
|
278
302
|
};
|
|
279
|
-
return (_jsxs(_Fragment, { children: [_jsx(ChannelsSwitchDialog, { open: channelsTarget !== null, onOpenChange: (open) => !open && setChannelsTarget(null), turningOn: channelsTarget
|
|
280
|
-
|
|
303
|
+
return (_jsxs(_Fragment, { children: [_jsx(ChannelsSwitchDialog, { open: channelsTarget !== null, onOpenChange: (open) => !open && setChannelsTarget(null), turningOn: channelsTarget !== null && landsOn('chat', channelsTarget.next), projectName: project?.name ?? '', onConfirm: () => {
|
|
304
|
+
if (channelsTarget)
|
|
305
|
+
apply('chat', channelsTarget.next);
|
|
281
306
|
setChannelsTarget(null);
|
|
282
|
-
apply('chat', target);
|
|
283
307
|
} }), _jsx(ExperimentalTabView, { isLoading: projectQuery.isLoading, isError: projectQuery.isError, errorMessage: projectQuery.error?.message ?? '', onRetry: () => projectQuery.refetch(), features: features, pendingKeys: Object.keys(pendingValues), canManage: canEdit, canManageOperatorOnly: isOperator, onToggle: handleToggle, showPermissionNotice: !canEdit && !writeCap.isLoading, query: query, onQueryChange: setQuery, copy: {
|
|
284
308
|
overridden: t('origin.overridden'),
|
|
309
|
+
reset: t('reset'),
|
|
285
310
|
managedByKortix: tI18nComplete.raw('texte9ec6c0ad396'),
|
|
286
311
|
defaultOn: t('origin.defaultOn'),
|
|
287
312
|
defaultOff: t('origin.defaultOff'),
|
|
@@ -88,7 +88,7 @@ const DEFAULT_GENERAL_COPY = {
|
|
|
88
88
|
export function GeneralTabView({ copy = DEFAULT_GENERAL_COPY, isLoading = false, isError = false, errorMessage = '', onRetry = () => { }, generalFieldsSlot, workspaceId, canLeave = false, onOpenLeaveDialog = () => { }, leaveDialog, canDelete = true, workspaceName = '', archiveOpen = false, onOpenArchiveDialog = () => { }, onCloseArchiveDialog = () => { }, onConfirmArchive = () => { }, isArchivePending = false, part = 'all', }) {
|
|
89
89
|
const showSettings = part !== 'danger';
|
|
90
90
|
const showDanger = part !== 'settings';
|
|
91
|
-
return (_jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [
|
|
91
|
+
return (_jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: [_jsx(SettingsTabHeader, { tab: showSettings ? 'general' : 'danger-zone' }), isLoading ? (_jsxs("div", { className: "space-y-5", children: [_jsx(Skeleton, { className: "h-40 rounded-md" }), _jsx(Skeleton, { className: "h-20 rounded-md" })] })) : isError ? (_jsx(ErrorState, { size: "sm", title: copy.loadFailed, description: errorMessage, action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: copy.retry }) })) : (_jsxs(_Fragment, { children: [showSettings ? generalFieldsSlot : null, showSettings && workspaceId ? (_jsx(SettingsRowGroup, { children: _jsx(SettingsRow, { label: copy.workspaceId, description: copy.workspaceIdDescription, children: _jsx(CopyRow, { value: workspaceId, wrap: true, className: "w-full" }) }) })) : null, showDanger && (canDelete || canLeave) ? (_jsxs("section", { className: "space-y-3", children: [showSettings ? _jsx(SettingsSubsectionHeader, { title: copy.dangerZone }) : null, _jsxs(SettingsRowGroup, { children: [canLeave ? (_jsx(SettingsRow, { label: copy.leaveWorkspace, description: copy.leaveDescription, children: _jsx(Button, { variant: "outline", size: "sm", onClick: onOpenLeaveDialog, children: copy.leaveWorkspace }) })) : null, canDelete ? (_jsx(SettingsRow, { label: copy.deleteWorkspace, description: copy.deleteDescription, children: _jsx(Button, { variant: "ghost", size: "sm", className: "text-destructive hover:bg-destructive/10 hover:text-destructive", onClick: onOpenArchiveDialog, children: copy.deleteWorkspace }) })) : null] })] })) : null] })), leaveDialog, _jsx(TypeToConfirmDialog, { open: archiveOpen, onOpenChange: (open) => {
|
|
92
92
|
if (!open)
|
|
93
93
|
onCloseArchiveDialog();
|
|
94
94
|
}, title: copy.deleteTitle, description: copy.deleteDialog(workspaceName), consequencesTitle: copy.consequencesTitle, consequences: copy.consequences, reassurance: copy.reassurance,
|
|
@@ -34,6 +34,16 @@ export declare function describeBase(template: SandboxTemplate, labels?: {
|
|
|
34
34
|
icon: PhosphorIcon;
|
|
35
35
|
mono: boolean;
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* What the card header names. The slug shows only when it says something the
|
|
39
|
+
* display name does not ("Default" over `default` read "Default default
|
|
40
|
+
* Default"), and the `Default` badge only when there is another template to
|
|
41
|
+
* tell it apart from.
|
|
42
|
+
*/
|
|
43
|
+
export declare function templateHeaderLabels(template: Pick<SandboxTemplate, 'name' | 'slug' | 'is_default'>, templateCount: number): {
|
|
44
|
+
showSlug: boolean;
|
|
45
|
+
showDefaultBadge: boolean;
|
|
46
|
+
};
|
|
37
47
|
/** Locale-aware age for the runtime footer's "Checked …" stamp. */
|
|
38
48
|
export declare function TemplateStateLine({ tone, label }: {
|
|
39
49
|
tone: TemplateTone;
|
|
@@ -104,6 +104,28 @@ export function describeBase(template, labels = {}) {
|
|
|
104
104
|
mono: false,
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* What the card header names. The slug shows only when it says something the
|
|
109
|
+
* display name does not ("Default" over `default` read "Default default
|
|
110
|
+
* Default"), and the `Default` badge only when there is another template to
|
|
111
|
+
* tell it apart from.
|
|
112
|
+
*/
|
|
113
|
+
export function templateHeaderLabels(template, templateCount) {
|
|
114
|
+
const dashed = template.name
|
|
115
|
+
.trim()
|
|
116
|
+
.toLowerCase()
|
|
117
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
118
|
+
.replace(/^-+/, '');
|
|
119
|
+
// Trailing dashes with a loop: `/-+$/` backtracks quadratically on a long run of dashes.
|
|
120
|
+
let end = dashed.length;
|
|
121
|
+
while (end > 0 && dashed[end - 1] === '-')
|
|
122
|
+
end -= 1;
|
|
123
|
+
const nameAsSlug = dashed.slice(0, end);
|
|
124
|
+
return {
|
|
125
|
+
showSlug: nameAsSlug !== template.slug.toLowerCase(),
|
|
126
|
+
showDefaultBadge: Boolean(template.is_default) && templateCount > 1,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
107
129
|
/** Locale-aware age for the runtime footer's "Checked …" stamp. */
|
|
108
130
|
export function TemplateStateLine({ tone, label }) {
|
|
109
131
|
const toneClass = TEMPLATE_TONE_TEXT[tone];
|
|
@@ -114,9 +136,9 @@ export function TemplateRuntimeFooter({ coverage, formatObservedAt, runtimeLabel
|
|
|
114
136
|
if (available.length === 0)
|
|
115
137
|
return null;
|
|
116
138
|
const observedAt = latestObservedAt(coverage);
|
|
117
|
-
return (_jsxs("div", { className: "border-border/60 bg-muted/25 flex flex-wrap items-center gap-x-3 gap-y-1.5 border-t px-4 py-2.5", children: [_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: runtimeLabel }), _jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: available.map((item) => (_jsx(SandboxProviderBadge, { item: item, copy: badgeCopy }, item.provider))) }), observedAt ? (_jsx("span", { className: "text-muted-foreground ml-auto shrink-0 text-xs tabular-nums", children: checkedLabel(formatObservedAt(observedAt)) })) : null] }));
|
|
139
|
+
return (_jsxs("div", { className: "border-border/60 bg-muted/25 flex flex-wrap items-center gap-x-3 gap-y-1.5 border-t px-4 py-2.5", children: [_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: runtimeLabel }), _jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: available.map((item) => (_jsx(SandboxProviderBadge, { item: item, copy: badgeCopy, showProvider: available.length > 1 }, item.provider))) }), observedAt ? (_jsx("span", { className: "text-muted-foreground ml-auto shrink-0 text-xs tabular-nums", children: checkedLabel(formatObservedAt(observedAt)) })) : null] }));
|
|
118
140
|
}
|
|
119
|
-
function TemplateCard({ projectId, template, canManage, onEdit, }) {
|
|
141
|
+
function TemplateCard({ projectId, template, canManage, onEdit, templateCount, }) {
|
|
120
142
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
121
143
|
const t = useTranslations('settings.sandbox');
|
|
122
144
|
const locale = useLocale();
|
|
@@ -166,7 +188,8 @@ function TemplateCard({ projectId, template, canManage, onEdit, }) {
|
|
|
166
188
|
builtFrom: t('facts.builtFrom'),
|
|
167
189
|
kortixDefault: t('facts.kortixDefault'),
|
|
168
190
|
});
|
|
169
|
-
|
|
191
|
+
const header = templateHeaderLabels(template, templateCount);
|
|
192
|
+
return (_jsxs(_Fragment, { children: [_jsxs("li", { className: "bg-popover overflow-hidden rounded-md border", children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3 px-4 pt-4 pb-3.5", children: [_jsxs("div", { className: "min-w-0 space-y-1.5", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: template.name }), header.showSlug ? (_jsx(Badge, { variant: "secondary", size: "sm", children: template.slug })) : null, header.showDefaultBadge ? (_jsx(Badge, { variant: "muted", size: "sm", children: t('defaultBadge') })) : null] }), _jsx(TemplateStateLine, { tone: stateInfo.tone, label: stateInfo.label })] }), canManage && (_jsxs("div", { className: "flex items-center gap-1", children: [templateId && !template.is_default && (_jsxs(_Fragment, { children: [_jsx(Hint, { label: t('actions.edit'), side: "top", children: _jsx(Button, { size: "icon-base", variant: "ghost", className: "transition-transform active:scale-[0.96]", onClick: () => onEdit(template), "aria-label": t('actions.edit'), children: _jsx(PencilSimpleIcon, { className: "size-3.5 shrink-0" }) }) }), _jsx(Hint, { label: t('actions.delete'), side: "top", children: _jsx(Button, { size: "icon-base", variant: "ghost", className: "text-destructive hover:text-destructive transition-transform active:scale-[0.96]", disabled: deleteMut.isPending, onClick: () => setConfirmDelete(true), "aria-label": t('actions.delete'), children: deleteMut.isPending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(TrashIcon, { className: "size-3.5 shrink-0" })) }) })] })), templateId && (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5 transition-transform active:scale-[0.96]", disabled: buildMut.isPending, onClick: () => buildMut.mutate(), children: [buildMut.isPending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(ArrowClockwiseIcon, { className: "size-3.5 shrink-0" })), t('actions.rebuild')] }))] }))] }), _jsxs("dl", { className: "border-border/60 grid grid-cols-2 gap-x-4 gap-y-4 border-t px-4 py-4 tabular-nums sm:grid-cols-3", children: [_jsx(FactCell, { icon: CpuIcon, label: t('facts.processor'), value: `${template.cpu} vCPU` }), _jsx(FactCell, { icon: MemoryIcon, label: t('facts.memory'), value: `${template.memory_gb} GiB` }), _jsx(FactCell, { icon: HardDrivesIcon, label: t('facts.storage'), value: `${template.disk_gb} GiB` }), _jsx(FactCell, { icon: base.icon, label: base.label, value: base.value, mono: base.mono }), _jsx(FactCell, { icon: source.icon, label: t('facts.definedIn'), value: source.label, mono: source.mono })] }), _jsx(TemplateRuntimeFooter, { coverage: template.provider_coverage, runtimeLabel: t('runtime'), checkedLabel: (value) => t('checked', { value }), formatObservedAt: (observedAt) => relativeTime(observedAt, locale, Date.now(), LONG_AGO), badgeCopy: {
|
|
170
193
|
states: {
|
|
171
194
|
ready: t('coverage.ready'),
|
|
172
195
|
building: t('coverage.building'),
|
|
@@ -235,5 +258,5 @@ export function SandboxTab({ projectId }) {
|
|
|
235
258
|
setFormOpen(true);
|
|
236
259
|
};
|
|
237
260
|
const newTemplateAction = canManage ? (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5 transition-transform active:scale-[0.96]", onClick: openNewForm, children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), t('actions.new')] })) : undefined;
|
|
238
|
-
return (_jsxs(_Fragment, { children: [_jsx(SandboxTabView, { isLoading: snapshotsQuery.isLoading, isError: snapshotsQuery.isError, errorMessage: snapshotsQuery.error?.message ?? '', onRetry: () => snapshotsQuery.refetch(), headerAction: canManage ? (_jsxs(Button, { size: "sm", variant: "secondary", className: "gap-1.5 transition-transform active:scale-[0.96]", onClick: openNewForm, children: [_jsx(PlusIcon, { className: "size-4 shrink-0" }), t('actions.new')] })) : undefined, manifestPath: manifestPath, templatesError: data?.templates_error ?? null, isEmpty: templates.length === 0, emptyAction: newTemplateAction, templatesSlot: templates.length === 0 ? undefined : (_jsx("ul", { className: "space-y-2", children: templates.map((t) => (_jsx(TemplateCard, { projectId: projectId, template: t, canManage: canManage, onEdit: openEditForm }, t.template_id ?? `tpl-${t.slug}`))) })) }), _jsx(SandboxTemplateForm, { projectId: projectId, open: formOpen, onOpenChange: setFormOpen, template: editingTemplate })] }));
|
|
261
|
+
return (_jsxs(_Fragment, { children: [_jsx(SandboxTabView, { isLoading: snapshotsQuery.isLoading, isError: snapshotsQuery.isError, errorMessage: snapshotsQuery.error?.message ?? '', onRetry: () => snapshotsQuery.refetch(), headerAction: canManage ? (_jsxs(Button, { size: "sm", variant: "secondary", className: "gap-1.5 transition-transform active:scale-[0.96]", onClick: openNewForm, children: [_jsx(PlusIcon, { className: "size-4 shrink-0" }), t('actions.new')] })) : undefined, manifestPath: manifestPath, templatesError: data?.templates_error ?? null, isEmpty: templates.length === 0, emptyAction: newTemplateAction, templatesSlot: templates.length === 0 ? undefined : (_jsx("ul", { className: "space-y-2", children: templates.map((t) => (_jsx(TemplateCard, { projectId: projectId, template: t, canManage: canManage, onEdit: openEditForm, templateCount: templates.length }, t.template_id ?? `tpl-${t.slug}`))) })) }), _jsx(SandboxTemplateForm, { projectId: projectId, open: formOpen, onOpenChange: setFormOpen, template: editingTemplate })] }));
|
|
239
262
|
}
|
|
@@ -30,6 +30,36 @@ export declare function BuildRow({ build, providerMode, relevance, copy: copyOve
|
|
|
30
30
|
relevance?: FailedBuildRelevance | null;
|
|
31
31
|
copy?: SnapshotMessages;
|
|
32
32
|
}): import("react").JSX.Element;
|
|
33
|
+
/** One line of the build log: a build, or a run of builds a newer setup replaced. */
|
|
34
|
+
export type BuildLogEntry = {
|
|
35
|
+
kind: 'build';
|
|
36
|
+
build: ProjectSnapshotBuild;
|
|
37
|
+
relevance: FailedBuildRelevance | null;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'superseded';
|
|
40
|
+
builds: ProjectSnapshotBuild[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Folds every run of 2+ consecutive superseded failures into one entry.
|
|
44
|
+
*
|
|
45
|
+
* A template rebuilt nine times left nine identical "failed" rows under its
|
|
46
|
+
* one ready build, so the log read as nine failures. A superseded build did
|
|
47
|
+
* not fail anything a session boots today: it is history, and one muted line
|
|
48
|
+
* says so. A failure that still blocks, recovered or is being retried keeps
|
|
49
|
+
* its own row, and so does a lone superseded build.
|
|
50
|
+
*/
|
|
51
|
+
export declare function groupBuildLog(builds: readonly ProjectSnapshotBuild[], status: SandboxRuntimeStatus | null | undefined, limit?: number): BuildLogEntry[];
|
|
52
|
+
/** "Oct 12", or "Oct 10 – Oct 12" when the run spans days. */
|
|
53
|
+
export declare function formatBuildDateSpan(builds: readonly Pick<ProjectSnapshotBuild, 'started_at' | 'finished_at'>[], locale?: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* A run of superseded builds as one muted row: "9 older builds replaced ·
|
|
56
|
+
* Oct 12". It opens like every other row, onto the builds it folds.
|
|
57
|
+
*/
|
|
58
|
+
export declare function SupersededBuildsRow({ builds, providerMode, copy: copyOverride, }: {
|
|
59
|
+
builds: ProjectSnapshotBuild[];
|
|
60
|
+
providerMode: SandboxProviderMode;
|
|
61
|
+
copy?: SnapshotMessages;
|
|
62
|
+
}): import("react").JSX.Element;
|
|
33
63
|
export interface SnapshotsTabViewProps {
|
|
34
64
|
isLoading?: boolean;
|
|
35
65
|
isError?: boolean;
|
|
@@ -75,6 +105,7 @@ declare function useSnapshotMessages(): {
|
|
|
75
105
|
building: string;
|
|
76
106
|
failed: string;
|
|
77
107
|
};
|
|
108
|
+
supersededGroup: (count: number) => string;
|
|
78
109
|
stale: {
|
|
79
110
|
superseded: string;
|
|
80
111
|
recovered: string;
|
|
@@ -10,6 +10,7 @@ import { InlineMeta } from '../../../primitives/inline-meta.js';
|
|
|
10
10
|
import Loading from '../../../primitives/loading.js';
|
|
11
11
|
import { SettingsSubsectionHeader } from '../../../primitives/settings-subsection-header.js';
|
|
12
12
|
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
13
|
+
import { StatusBadge } from '../../../primitives/status.js';
|
|
13
14
|
import { ErrorState } from '../../../primitives/error-state.js';
|
|
14
15
|
import { describeFailedBuild, formatSandboxProvider, formatSandboxProviders, isLegacySandboxProvider, } from '../../../workspace/sidebar/footer/sandbox-alert-state.js';
|
|
15
16
|
import { useSandboxRecovery } from '../../../workspace/sidebar/footer/sandbox-health.js';
|
|
@@ -31,21 +32,21 @@ const XCircleFilled = ({ className }) => (_jsx(XCircleSolid, { className: classN
|
|
|
31
32
|
const BUILD_STATUS_TILE = {
|
|
32
33
|
ready: {
|
|
33
34
|
label: 'ready',
|
|
34
|
-
|
|
35
|
+
tone: 'success',
|
|
35
36
|
tileBg: 'bg-kortix-green/15',
|
|
36
37
|
iconColor: 'text-kortix-green',
|
|
37
38
|
Icon: CheckCircleFilled,
|
|
38
39
|
},
|
|
39
40
|
building: {
|
|
40
41
|
label: 'building',
|
|
41
|
-
|
|
42
|
+
tone: 'warning',
|
|
42
43
|
tileBg: 'bg-kortix-yellow/15',
|
|
43
44
|
iconColor: 'text-kortix-yellow',
|
|
44
45
|
Icon: Loading,
|
|
45
46
|
},
|
|
46
47
|
failed: {
|
|
47
48
|
label: 'failed',
|
|
48
|
-
|
|
49
|
+
tone: 'destructive',
|
|
49
50
|
tileBg: 'bg-kortix-red/15',
|
|
50
51
|
iconColor: 'text-kortix-red',
|
|
51
52
|
Icon: XCircleFilled,
|
|
@@ -154,7 +155,61 @@ export function BuildRow({ build, providerMode, relevance, copy: copyOverride, }
|
|
|
154
155
|
const outcome = describeBuildOutcome(build, relevance, copy);
|
|
155
156
|
const stale = outcome.stale;
|
|
156
157
|
const timestamp = relativeTime(build.finished_at ?? build.started_at, copy.locale, Date.now(), LONG_AGO);
|
|
157
|
-
return (_jsx("li", { children: _jsxs(Disclosure, { className: "group/build bg-popover overflow-hidden", variant: "outline", transition: { duration: 0.18, ease: [0.23, 1, 0.32, 1] }, children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: "focus-visible:ring-kortix-base hover:bg-foreground/[0.03] flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 transition-colors outline-none focus-visible:ring-[0.6px]", children: [_jsx("span", { className: cn('flex size-9 shrink-0 items-center justify-center rounded-sm', stale ? 'border-border text-muted-foreground border' : status.tileBg), children: _jsx(Icon, { className: cn('size-5 shrink-0', stale ? undefined : status.iconColor) }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: cn('truncate text-sm font-medium', stale ? 'text-muted-foreground' : 'text-foreground'), children: outcome.title }), _jsx(
|
|
158
|
+
return (_jsx("li", { children: _jsxs(Disclosure, { className: "group/build bg-popover overflow-hidden", variant: "outline", transition: { duration: 0.18, ease: [0.23, 1, 0.32, 1] }, children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: "focus-visible:ring-kortix-base hover:bg-foreground/[0.03] flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 transition-colors outline-none focus-visible:ring-[0.6px]", children: [_jsx("span", { className: cn('flex size-9 shrink-0 items-center justify-center rounded-sm', stale ? 'border-border text-muted-foreground border' : status.tileBg), children: _jsx(Icon, { className: cn('size-5 shrink-0', stale ? undefined : status.iconColor) }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: cn('truncate text-sm font-medium', stale ? 'text-muted-foreground' : 'text-foreground'), children: outcome.title }), _jsx(StatusBadge, { tone: stale ? 'neutral' : status.tone, children: copy.statusLabels[build.status] }), providerMode === 'pinned' ? _jsx(ProviderBadge, { provider: build.provider }) : null] }), _jsxs("div", { className: "text-muted-foreground mt-0.5 flex items-center gap-1.5 text-xs", children: [_jsx("span", { className: "truncate", children: outcome.summary }), _jsx("span", { "aria-hidden": true, children: tI18nComplete.raw('text3b9453dad42b') }), _jsx("span", { className: "shrink-0 tabular-nums", children: timestamp })] })] }), _jsx(ChevronDown, { className: "text-muted-foreground duration-normal size-4 shrink-0 transition-transform ease-out group-data-[state=open]/build:rotate-180 motion-reduce:transition-none" })] }) }), _jsx(DisclosureContent, { className: "overflow-hidden", contentClassName: "border-border border-t", children: _jsx(DisclosureBody, { className: "px-4 py-4", children: _jsx(BuildDetails, { build: build, providerMode: providerMode, copy: copy }) }) })] }) }));
|
|
159
|
+
}
|
|
160
|
+
/** Rows the build log shows. A grouped run counts as one row. */
|
|
161
|
+
const BUILD_LOG_ROWS = 10;
|
|
162
|
+
/**
|
|
163
|
+
* Folds every run of 2+ consecutive superseded failures into one entry.
|
|
164
|
+
*
|
|
165
|
+
* A template rebuilt nine times left nine identical "failed" rows under its
|
|
166
|
+
* one ready build, so the log read as nine failures. A superseded build did
|
|
167
|
+
* not fail anything a session boots today: it is history, and one muted line
|
|
168
|
+
* says so. A failure that still blocks, recovered or is being retried keeps
|
|
169
|
+
* its own row, and so does a lone superseded build.
|
|
170
|
+
*/
|
|
171
|
+
export function groupBuildLog(builds, status, limit = BUILD_LOG_ROWS) {
|
|
172
|
+
const entries = [];
|
|
173
|
+
for (const build of builds) {
|
|
174
|
+
const relevance = describeFailedBuild(build, status);
|
|
175
|
+
const last = entries.at(-1);
|
|
176
|
+
if (relevance === 'superseded') {
|
|
177
|
+
if (last?.kind === 'superseded')
|
|
178
|
+
last.builds.push(build);
|
|
179
|
+
else
|
|
180
|
+
entries.push({ kind: 'superseded', builds: [build] });
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
entries.push({ kind: 'build', build, relevance });
|
|
184
|
+
}
|
|
185
|
+
return entries
|
|
186
|
+
.map((entry) => entry.kind === 'superseded' && entry.builds.length === 1
|
|
187
|
+
? { kind: 'build', build: entry.builds[0], relevance: 'superseded' }
|
|
188
|
+
: entry)
|
|
189
|
+
.slice(0, limit);
|
|
190
|
+
}
|
|
191
|
+
/** "Oct 12", or "Oct 10 – Oct 12" when the run spans days. */
|
|
192
|
+
export function formatBuildDateSpan(builds, locale = 'en') {
|
|
193
|
+
const times = builds
|
|
194
|
+
.map((b) => new Date(b.finished_at ?? b.started_at).getTime())
|
|
195
|
+
.filter(Number.isFinite)
|
|
196
|
+
.sort((a, b) => a - b);
|
|
197
|
+
if (times.length === 0)
|
|
198
|
+
return '—';
|
|
199
|
+
const fmt = new Intl.DateTimeFormat(locale, { month: 'short', day: 'numeric' });
|
|
200
|
+
const first = fmt.format(times[0]);
|
|
201
|
+
const last = fmt.format(times[times.length - 1]);
|
|
202
|
+
return first === last ? first : `${first} – ${last}`;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* A run of superseded builds as one muted row: "9 older builds replaced ·
|
|
206
|
+
* Oct 12". It opens like every other row, onto the builds it folds.
|
|
207
|
+
*/
|
|
208
|
+
export function SupersededBuildsRow({ builds, providerMode, copy: copyOverride, }) {
|
|
209
|
+
const translatedCopy = useSnapshotMessages();
|
|
210
|
+
const copy = copyOverride ?? translatedCopy;
|
|
211
|
+
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
212
|
+
return (_jsx("li", { children: _jsxs(Disclosure, { className: "group/superseded bg-popover overflow-hidden", variant: "outline", transition: { duration: 0.18, ease: [0.23, 1, 0.32, 1] }, children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: "focus-visible:ring-kortix-base hover:bg-foreground/[0.03] flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 transition-colors outline-none focus-visible:ring-[0.6px]", children: [_jsx("span", { className: "border-border text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-sm border", children: _jsx(StackIcon, { className: "size-5 shrink-0" }) }), _jsxs("div", { className: "text-muted-foreground flex min-w-0 flex-1 items-center gap-1.5 text-sm", children: [_jsx("span", { className: "truncate", children: copy.supersededGroup(builds.length) }), _jsx("span", { "aria-hidden": true, children: tI18nComplete.raw('text3b9453dad42b') }), _jsx("span", { className: "shrink-0 text-xs tabular-nums", children: formatBuildDateSpan(builds, copy.locale) })] }), _jsx(ChevronDown, { className: "text-muted-foreground duration-normal size-4 shrink-0 transition-transform ease-out group-data-[state=open]/superseded:rotate-180 motion-reduce:transition-none" })] }) }), _jsx(DisclosureContent, { className: "overflow-hidden", contentClassName: "border-border border-t", children: _jsx(DisclosureBody, { className: "p-2", children: _jsx("ul", { className: "space-y-2", children: builds.map((b) => (_jsx(BuildRow, { build: b, providerMode: providerMode, relevance: "superseded", copy: copy }, b.build_id))) }) }) })] }) }));
|
|
158
213
|
}
|
|
159
214
|
function InlinePanelEmpty({ message }) {
|
|
160
215
|
return (_jsx("div", { className: "flex flex-col items-center gap-3 px-4 py-8 text-center", children: _jsx("p", { className: "text-muted-foreground text-sm text-balance", children: message }) }));
|
|
@@ -230,7 +285,7 @@ export function SnapshotsTabView({ isLoading = false, isError = false, errorMess
|
|
|
230
285
|
// since brought up — belongs in the log below, not in a banner. Same
|
|
231
286
|
// condition as `sandbox-view.tsx`'s own `showStatusBanner`.
|
|
232
287
|
const showStatusBanner = status?.state === 'blocked' || status?.state === 'degraded';
|
|
233
|
-
return (_jsx("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: _jsx("div", { className: "space-y-8", children: isLoading ? (_jsx("div", { className: "space-y-2", children: ['snapshot-skeleton-1', 'snapshot-skeleton-2', 'snapshot-skeleton-3'].map((row) => (_jsx(Skeleton, { className: "h-16 rounded-md" }, row))) })) : isError ? (_jsx(ErrorState, { size: "sm", title: copy.view.loadFailed, description: errorMessage, action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: copy.view.retry }) })) : (_jsxs(_Fragment, { children: [showStatusBanner && status ? (_jsx(SandboxStatusBanner, { status: status, canManage: canManage, isFixPending: isFixPending, isRetryPending: isRetryPending, onFix: onFix, onRetry: onRetryBuild })) : status ? (_jsx(EnvironmentSummary, { status: status, copy: copy })) : null, _jsxs("section", { className: "space-y-4", children: [_jsx(SettingsSubsectionHeader, { title: copy.view.logTitle, description: copy.view.logDescription }), templateBuilds.length === 0 ? (_jsx("div", { className: "border-border rounded-md border", children: _jsx(InlinePanelEmpty, { message: copy.view.empty }) })) : (_jsx("ul", { className: "space-y-2", children: templateBuilds
|
|
288
|
+
return (_jsx("div", { className: "mx-auto w-full max-w-2xl space-y-8", children: _jsx("div", { className: "space-y-8", children: isLoading ? (_jsx("div", { className: "space-y-2", children: ['snapshot-skeleton-1', 'snapshot-skeleton-2', 'snapshot-skeleton-3'].map((row) => (_jsx(Skeleton, { className: "h-16 rounded-md" }, row))) })) : isError ? (_jsx(ErrorState, { size: "sm", title: copy.view.loadFailed, description: errorMessage, action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: copy.view.retry }) })) : (_jsxs(_Fragment, { children: [showStatusBanner && status ? (_jsx(SandboxStatusBanner, { status: status, canManage: canManage, isFixPending: isFixPending, isRetryPending: isRetryPending, onFix: onFix, onRetry: onRetryBuild })) : status ? (_jsx(EnvironmentSummary, { status: status, copy: copy })) : null, _jsxs("section", { className: "space-y-4", children: [_jsx(SettingsSubsectionHeader, { title: copy.view.logTitle, description: copy.view.logDescription }), templateBuilds.length === 0 ? (_jsx("div", { className: "border-border rounded-md border", children: _jsx(InlinePanelEmpty, { message: copy.view.empty }) })) : (_jsx("ul", { className: "space-y-2", children: groupBuildLog(templateBuilds, status).map((entry) => entry.kind === 'superseded' ? (_jsx(SupersededBuildsRow, { builds: entry.builds, providerMode: providerMode, copy: copy }, `superseded-${entry.builds[0].build_id}`)) : (_jsx(BuildRow, { build: entry.build, providerMode: providerMode, relevance: entry.relevance, copy: copy }, entry.build.build_id))) }))] }), _jsx(HowItWorks, { copy: copy })] })) }) }));
|
|
234
289
|
}
|
|
235
290
|
/** Container: owns every hook (project + snapshots queries, sandbox
|
|
236
291
|
* recovery mutations) and renders `SnapshotsTabView` with real data. Only
|
|
@@ -302,6 +357,7 @@ function useSnapshotMessages() {
|
|
|
302
357
|
building: t('statuses.building'),
|
|
303
358
|
failed: t('statuses.failed'),
|
|
304
359
|
},
|
|
360
|
+
supersededGroup: (count) => t('supersededGroup', { count }),
|
|
305
361
|
stale: {
|
|
306
362
|
superseded: t('stale.superseded'),
|
|
307
363
|
recovered: t('stale.recovered'),
|
|
@@ -154,7 +154,10 @@ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenCh
|
|
|
154
154
|
const actsAsLabel = useActsAsLabel();
|
|
155
155
|
const [name, setName] = useState('');
|
|
156
156
|
const [draft, setDraft] = useState({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
|
|
157
|
-
|
|
157
|
+
// Least privilege by default: a key made on a workspace's page works in
|
|
158
|
+
// that workspace and lists on that page. "All my workspaces" (a personal
|
|
159
|
+
// key, listed under Preferences → Personal keys) is an explicit choice.
|
|
160
|
+
const [worksIn, setWorksIn] = useState('workspace');
|
|
158
161
|
const [access, setAccess] = useState('full');
|
|
159
162
|
const [picked, setPicked] = useState(() => new Set());
|
|
160
163
|
const [expiry, setExpiry] = useState('');
|
|
@@ -238,7 +241,7 @@ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenCh
|
|
|
238
241
|
setTimeout(() => {
|
|
239
242
|
setName('');
|
|
240
243
|
setDraft({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
|
|
241
|
-
setWorksIn('
|
|
244
|
+
setWorksIn('workspace');
|
|
242
245
|
setAccess('full');
|
|
243
246
|
setPicked(new Set());
|
|
244
247
|
setExpiry('');
|
|
@@ -271,7 +274,7 @@ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenCh
|
|
|
271
274
|
setAccess('full');
|
|
272
275
|
setPicked(new Set());
|
|
273
276
|
}
|
|
274
|
-
}, disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-works-in", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "
|
|
277
|
+
}, disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-works-in", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "workspace", children: t('worksInWorkspace') }), _jsx(SelectItem, { value: "all", children: t('worksInAll') })] })] }), personal ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('worksInAllHint') })) : null] })) : null, personal ? null : (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-access", children: tWorkspaces('keyAccess') }), _jsxs(Select, { value: access, onValueChange: (value) => setAccess(value), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-access", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "full", children: tWorkspaces('keyAccessFull') }), _jsx(SelectItem, { value: "read", children: tWorkspaces('keyAccessRead') }), _jsx(SelectItem, { value: "custom", children: tWorkspaces('keyAccessCustom') })] })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: access === 'read' ? tWorkspaces('keyAccessReadHint') : access === 'custom' ? t('accessCustomHint') : t('accessFullHint') }), access === 'custom' ? (_jsx(PermissionPicker, { query: permissionsQuery, picked: picked, onToggle: (action, on) => setPicked((prev) => {
|
|
275
278
|
const next = new Set(prev);
|
|
276
279
|
if (on)
|
|
277
280
|
next.add(action);
|
|
@@ -4,7 +4,7 @@ import { SidebarToggle } from '../../internal/layout/sidebar-toggle.js';
|
|
|
4
4
|
import { useInCustomizeFrame } from './customize-tab-bar.js';
|
|
5
5
|
import { cn } from '../../internal/lib/utils.js';
|
|
6
6
|
import { createContext, useContext } from 'react';
|
|
7
|
-
import { SettingsSectionHeader } from '../../primitives/settings-section-header.js';
|
|
7
|
+
import { SETTINGS_PAGE_COLUMN_CLASS, SettingsPageHeader, SettingsSectionHeader, useSettingsPageTitle, } from '../../primitives/settings-section-header.js';
|
|
8
8
|
import { CapabilityScrollRootProvider, useCapabilityScrollRootRef } from './capability-scroll-root.js';
|
|
9
9
|
const CapabilityShellEmbedContext = createContext(null);
|
|
10
10
|
export const CapabilityShellEmbedProvider = CapabilityShellEmbedContext.Provider;
|
|
@@ -31,6 +31,7 @@ export function CapabilityPageShell({ title, description, titleAddon, action, se
|
|
|
31
31
|
const scrollRef = useCapabilityScrollRootRef();
|
|
32
32
|
const embed = useCapabilityShellEmbed();
|
|
33
33
|
const framed = useInCustomizeFrame();
|
|
34
|
+
const settingsTitle = useSettingsPageTitle();
|
|
34
35
|
if (embed?.titled) {
|
|
35
36
|
// Beside the agent page's rail: the view's title left (no sentence under
|
|
36
37
|
// it, the Settings dialect), its grant control (`filters`) right; search
|
|
@@ -40,6 +41,13 @@ export function CapabilityPageShell({ title, description, titleAddon, action, se
|
|
|
40
41
|
if (embed) {
|
|
41
42
|
return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", "data-capability-embed": "", children: _jsxs("div", { className: cn('w-full space-y-5 px-4 pt-5 pb-24 md:px-8', embed.className), children: [embed.lead, _jsxs("header", { className: cn('flex flex-col gap-3', !stacked && 'md:flex-row md:items-center md:justify-between'), children: [_jsx("h2", { className: "sr-only", children: title }), _jsx("p", { className: "text-muted-foreground min-w-0 text-sm text-pretty md:max-w-xl", children: description }), search || action ? (_jsxs("div", { className: cn('flex w-full shrink-0 items-center gap-2', !stacked && 'md:w-auto'), children: [search ? _jsx("div", { className: cn('min-w-0 flex-1', !stacked && 'md:w-64 md:flex-none'), children: search }) : null, action] })) : null] }), filters ? _jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters }) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }));
|
|
42
43
|
}
|
|
44
|
+
if (settingsTitle !== null) {
|
|
45
|
+
// A Workspace settings section: the settings page header and column, so
|
|
46
|
+
// the title has the rung, the left edge and the name of every other
|
|
47
|
+
// section. The frame's title bar holds the sidebar opener.
|
|
48
|
+
const controls = search || action ? (_jsxs("div", { className: cn('flex w-full items-center gap-2', !stacked && 'sm:w-auto'), children: [search ? _jsx("div", { className: cn('min-w-0 flex-1', !stacked && 'sm:w-64 sm:flex-none'), children: search }) : null, action] })) : null;
|
|
49
|
+
return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", children: _jsx("div", { className: SETTINGS_PAGE_COLUMN_CLASS, children: _jsxs("div", { className: cn('w-full space-y-5', wide ? 'max-w-7xl' : 'max-w-5xl'), children: [_jsx(SettingsPageHeader, { title: title, titleAccessory: titleAddon, description: description, action: stacked ? undefined : controls }), stacked ? controls : null, filters ? _jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters }) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }) }));
|
|
50
|
+
}
|
|
43
51
|
return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: wide
|
|
44
52
|
? 'mx-auto w-full max-w-7xl space-y-5 px-4 py-10 pb-20 md:px-8 lg:py-14'
|
|
45
53
|
: 'mx-auto w-full max-w-5xl space-y-5 px-4 py-10 pb-20 lg:py-14', children: [_jsxs("header", { className: cn('flex flex-col gap-3', !stacked && 'sm:flex-row sm:items-start sm:justify-between'), children: [_jsxs("div", { className: "space-y-1 sm:max-w-md", children: [_jsxs("div", { className: "flex items-center gap-1", children: [framed ? null : _jsx(SidebarToggle, { className: "-ml-2" }), _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: title }), titleAddon] }), _jsx("p", { className: "text-muted-foreground text-sm text-balance", children: description })] }), search || action ? (_jsxs("div", { className: cn('flex w-full shrink-0 items-center gap-2', !stacked && 'sm:w-auto'), children: [search ? (_jsx("div", { className: cn('min-w-0 flex-1', !stacked && 'sm:w-64 sm:flex-none'), children: search })) : null, action] })) : null] }), filters ? (_jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters })) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }));
|