@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
|
@@ -51,17 +51,12 @@ export function AppsCard({ apps, onOpenApp, }) {
|
|
|
51
51
|
return (_jsx(PanelCard, { title: tI18nComplete.raw('text324b134f57c7'), count: apps.length, isEmpty: apps.length === 0,
|
|
52
52
|
// The payoff: if the agent got something running, that is the single most
|
|
53
53
|
// interesting fact in the panel. It should not take a click to learn it.
|
|
54
|
-
defaultExpanded: apps.length > 0,
|
|
54
|
+
defaultExpanded: apps.length > 0, emptyText: tI18nComplete.raw('texte0687cb3046c'), contentClassName: "pb-2", children: _jsx("ul", { className: "flex flex-col gap-0", children: apps.map((app) => {
|
|
55
55
|
const port = portOf(app.url);
|
|
56
|
-
return (_jsx("li", { children: _jsxs("button", { type: "button", onClick: () => onOpenApp(app), className: cn('hover:bg-accent
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
'transition-[background-color,transform] active:scale-[0.98]'), children: [_jsx("span", { className: "flex size-7 shrink-0 items-center justify-center", "aria-hidden": true, children: _jsxs("span", { className: "relative flex size-2", children: [sandboxAlive && (_jsx("span", { className: "bg-kortix-green absolute inline-flex size-2 animate-ping rounded-full opacity-60 motion-reduce:animate-none" })), _jsx("span", { className: cn('relative inline-flex size-2 rounded-full', sandboxAlive ? 'bg-kortix-green' : 'bg-muted-foreground/40') })] }) }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: app.name }), !sandboxAlive && (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: tI18nComplete.raw('text8322e87d2458') })), sandboxAlive && port > 0 && (_jsxs("span", { className: "text-muted-foreground shrink-0 text-xs tabular-nums", children: [":", port] }))] }) }, app.url));
|
|
56
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", onClick: () => onOpenApp(app), className: cn('hover:bg-accent flex w-full items-center gap-2.5 px-4 py-2 text-left',
|
|
57
|
+
// Full-width row: the brand's full-width press value (0.998),
|
|
58
|
+
// shared with the Outputs and Context rows. The background
|
|
59
|
+
// change carries the press; the scale only confirms it.
|
|
60
|
+
'transition-[background-color,transform] active:scale-[0.998]'), children: [_jsx("span", { className: "flex size-7 shrink-0 items-center justify-center", "aria-hidden": true, children: _jsxs("span", { className: "relative flex size-2", children: [sandboxAlive && (_jsx("span", { className: "bg-kortix-green absolute inline-flex size-2 animate-ping rounded-full opacity-60 motion-reduce:animate-none" })), _jsx("span", { className: cn('relative inline-flex size-2 rounded-full', sandboxAlive ? 'bg-kortix-green' : 'bg-muted-foreground/40') })] }) }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: app.name }), !sandboxAlive && (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: tI18nComplete.raw('text8322e87d2458') })), sandboxAlive && port > 0 && (_jsxs("span", { className: "text-muted-foreground shrink-0 text-xs tabular-nums", children: [":", port] }))] }) }, app.url));
|
|
62
61
|
}) }) }));
|
|
63
62
|
}
|
|
64
|
-
/** Soft placeholder art — a browser window, matching the other cards' empty states. */
|
|
65
|
-
function AppsArt() {
|
|
66
|
-
return (_jsxs("div", { "aria-hidden": true, className: "border-border/60 bg-muted/30 flex h-16 w-20 flex-col gap-1.5 rounded-md border p-2", children: [_jsxs("div", { className: "flex gap-1", children: [_jsx("span", { className: "bg-muted-foreground/30 size-1 rounded-full" }), _jsx("span", { className: "bg-muted-foreground/30 size-1 rounded-full" }), _jsx("span", { className: "bg-muted-foreground/30 size-1 rounded-full" })] }), _jsx("span", { className: "bg-muted-foreground/20 h-full w-full rounded-sm" })] }));
|
|
67
|
-
}
|
|
@@ -13,5 +13,5 @@ export function ChangeRequestsCard({ requests, onOpen, onJump, jumping = false }
|
|
|
13
13
|
const locale = useLocale();
|
|
14
14
|
if (requests.length === 0)
|
|
15
15
|
return null;
|
|
16
|
-
return (_jsx(PanelCard, { title: t('title'), count: requests.length, isEmpty: false, defaultExpanded: true, fill: true, contentClassName: "min-h-0 overflow-y-auto
|
|
16
|
+
return (_jsx(PanelCard, { title: t('title'), count: requests.length, isEmpty: false, defaultExpanded: true, fill: true, contentClassName: "min-h-0 overflow-y-auto pb-2", children: _jsx("ul", { children: [...requests].sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at)).map((cr) => (_jsxs("li", { className: "hover:bg-accent flex items-center gap-1 pr-2", children: [_jsxs("button", { type: "button", "data-cr-id": cr.cr_id, onClick: () => onOpen(cr.cr_id), className: "flex min-w-0 flex-1 flex-col gap-1 py-2 pl-4 text-left", children: [_jsxs("span", { className: "flex w-full min-w-0 items-baseline gap-2", children: [_jsxs("span", { className: "text-muted-foreground shrink-0 text-xs tabular-nums", children: ["#", cr.number] }), _jsx("span", { className: "text-foreground truncate text-sm", children: cr.title })] }), _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [cr.status === 'open' ? _jsx(Badge, { variant: "secondary", size: "sm", children: t('open') }) : _jsx(ChangeRequestStatusBadge, { cr: cr }), _jsx("time", { dateTime: cr.created_at, className: "text-muted-foreground text-xs", children: relativeTime(cr.created_at, locale) })] })] }), _jsx(Hint, { label: t('jump', { number: cr.number }), children: _jsx(Button, { variant: "ghost", size: "icon", disabled: jumping, "aria-label": t('jump', { number: cr.number }), onClick: () => onJump(cr.cr_id), children: _jsx(ArrowBendUpLeftIcon, { className: "size-3.5 shrink-0" }) }) })] }, cr.cr_id))) }) }));
|
|
17
17
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { VcsFileDiff } from '@kortix/sdk/react';
|
|
2
|
+
import type { Detail } from './detail-view.js';
|
|
3
|
+
type ChangesCardProps = {
|
|
4
|
+
/** Opens one file's diff in the detail panel. */
|
|
5
|
+
onOpenDetail: (detail: Detail) => void;
|
|
6
|
+
/** Opens the full comparison (Files → Changes). */
|
|
7
|
+
onOpenAll: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function ChangesCard(props: ChangesCardProps): import("react").JSX.Element | null;
|
|
10
|
+
/** The section itself, from a known non-empty file list. Pure: tests render it directly. */
|
|
11
|
+
export declare function ChangesSection({ files, onOpenDetail, onOpenAll, }: ChangesCardProps & {
|
|
12
|
+
files: VcsFileDiff[];
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* `ChangesCard` — the files this session changed against its base, one row per
|
|
5
|
+
* file. A row opens THAT file's diff in the detail panel; the last row
|
|
6
|
+
* ("Review changes") opens the full comparison. Same row rhythm as Outputs, so the two sections read as
|
|
7
|
+
* one list.
|
|
8
|
+
*
|
|
9
|
+
* Renders nothing until the answer is known and non-empty: a booting runtime,
|
|
10
|
+
* a project without git, or a session with no edits adds no section, which
|
|
11
|
+
* keeps an empty or chat-only session to the sections it actually has.
|
|
12
|
+
*/
|
|
13
|
+
import { ArrowRightIcon, FileTextIcon } from '@phosphor-icons/react';
|
|
14
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
15
|
+
import { SessionDiffViewer } from '../session-diff-viewer.js';
|
|
16
|
+
import { CHANGE_STATUS_META, useSessionChanges } from '../session-changes-shared.js';
|
|
17
|
+
import { CountBadge } from '../../../primitives/count-badge.js';
|
|
18
|
+
import { STATUS_DOT } from '../../../primitives/status.js';
|
|
19
|
+
import { useLocalizedUiCatalog } from '../../../i18n/ui-catalog/use-localized-ui-catalog.js';
|
|
20
|
+
import { cn } from '../../../lib/utils.js';
|
|
21
|
+
import { ChalkTile, chalkLabel } from './outputs-card.js';
|
|
22
|
+
import { PanelCard } from './panel-card.js';
|
|
23
|
+
import { getFileIcon } from '../../../files/project/components/file-icon.js';
|
|
24
|
+
/** Rows shown before the fold; the fold opens the full comparison. */
|
|
25
|
+
const VISIBLE_ROWS = 5;
|
|
26
|
+
function splitPath(file) {
|
|
27
|
+
const cut = file.lastIndexOf('/');
|
|
28
|
+
return cut < 0 ? { name: file, dir: '' } : { name: file.slice(cut + 1), dir: file.slice(0, cut) };
|
|
29
|
+
}
|
|
30
|
+
export function ChangesCard(props) {
|
|
31
|
+
const { files, isPending, isTracked } = useSessionChanges();
|
|
32
|
+
if (isPending || !isTracked || files.length === 0)
|
|
33
|
+
return null;
|
|
34
|
+
return _jsx(ChangesSection, { files: files, ...props });
|
|
35
|
+
}
|
|
36
|
+
/** The section itself, from a known non-empty file list. Pure: tests render it directly. */
|
|
37
|
+
export function ChangesSection({ files, onOpenDetail, onOpenAll, }) {
|
|
38
|
+
const t = useTranslations('hardcodedUi.i18nComplete');
|
|
39
|
+
const statusMeta = useLocalizedUiCatalog(CHANGE_STATUS_META);
|
|
40
|
+
const count = files.length;
|
|
41
|
+
const visible = files.slice(0, VISIBLE_ROWS);
|
|
42
|
+
const hidden = count - visible.length;
|
|
43
|
+
const openFile = (file) => {
|
|
44
|
+
const { name } = splitPath(file);
|
|
45
|
+
onOpenDetail({
|
|
46
|
+
key: `diff:${file}`,
|
|
47
|
+
title: name,
|
|
48
|
+
icon: _jsx(FileTextIcon, { className: "text-foreground size-4 shrink-0" }),
|
|
49
|
+
padded: false,
|
|
50
|
+
body: _jsx(SessionDiffViewer, { filePath: file }),
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
return (_jsxs(PanelCard, { title: t.raw('textbbd4b6a86bc6'), count: count, isEmpty: false, defaultExpanded: true, contentClassName: "pb-2", children: [_jsx("ul", { children: visible.map((f) => {
|
|
54
|
+
const { name, dir } = splitPath(f.file);
|
|
55
|
+
// Added / Edited / Removed, as the full comparison shows it: a line
|
|
56
|
+
// count alone cannot tell a deleted file from an edit that removed lines.
|
|
57
|
+
const status = f.status ? statusMeta[f.status] : undefined;
|
|
58
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", title: status ? `${status.label}: ${f.file}` : f.file, onClick: () => openFile(f.file), className: "hover:bg-accent flex w-full items-center gap-2.5 px-4 py-1.5 text-left transition-[background-color,transform] active:scale-[0.998]", children: [_jsx(ChalkTile, { label: chalkLabel({ kind: 'file', name }), children: getFileIcon(name, { className: 'size-3.5', variant: 'monochrome' }) }), status && (_jsx("span", { "data-status": f.status, className: cn('size-1.5 shrink-0 rounded-full', STATUS_DOT[status.tone]), "aria-label": status.label, role: "img" })), _jsxs("span", { className: "min-w-0 flex-1 truncate text-sm", children: [_jsx("span", { className: "text-foreground", children: name }), dir && _jsx("span", { className: "text-muted-foreground ml-1.5 text-xs", children: dir })] }), (f.additions > 0 || f.deletions > 0) && (_jsxs("span", { className: "flex shrink-0 gap-1.5 text-xs tabular-nums", children: [f.additions > 0 && _jsxs("span", { className: "text-kortix-green", children: ["+", f.additions] }), f.deletions > 0 && _jsxs("span", { className: "text-kortix-red", children: ["\u2212", f.deletions] })] }))] }) }, f.file));
|
|
59
|
+
}) }), hidden > 0 && (_jsxs("button", { type: "button", onClick: onOpenAll, className: "text-muted-foreground hover:text-foreground hover:bg-accent mt-0.5 flex w-full items-center gap-2.5 px-4 py-1.5 text-left text-sm transition-[background-color,color,transform] active:scale-[0.998]", children: [_jsx("span", { className: "flex size-6 shrink-0 items-center justify-center", children: _jsx(ArrowRightIcon, { className: "size-3.5" }) }), _jsx("span", { className: "flex-1 truncate", children: t.raw('text6a47708f4e14') }), _jsx(CountBadge, { count: hidden })] }))] }));
|
|
60
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { ContextUsage } from '../../composer/context-usage.js';
|
|
1
2
|
import type { ContextItem } from '../shared/derive-panels.js';
|
|
2
3
|
import type { Detail } from './detail-view.js';
|
|
3
|
-
export declare function ContextCard({ files, web, tools, sessionId, onOpenDetail, onOpenFile, onAddContext, }: {
|
|
4
|
+
export declare function ContextCard({ files, web, tools, sessionId, onOpenDetail, onOpenFile, onAddContext, usage, }: {
|
|
5
|
+
/** How full the model's context window is (`useSessionContextUsage`). Drawn
|
|
6
|
+
* as the meter on top; null before the first reply. */
|
|
7
|
+
usage?: ContextUsage | null;
|
|
4
8
|
files: ContextItem[];
|
|
5
9
|
web: ContextItem[];
|
|
6
10
|
tools: ContextItem[];
|
|
@@ -30,18 +30,19 @@ import { useTranslations } from '../../../i18n/index.js';
|
|
|
30
30
|
* `EasyPanel`, and the `projectId` prop this card no longer needs. This was
|
|
31
31
|
* the whole surface — nothing else in the panel referenced it.
|
|
32
32
|
*/
|
|
33
|
-
import { Badge } from '../../../primitives/badge.js';
|
|
34
33
|
import { Button } from '../../../primitives/button.js';
|
|
35
34
|
import { FaviconAvatar } from '../../../primitives/favicon-avatar.js';
|
|
36
35
|
import { getFileIcon } from '../../../files/project/components/file-icon.js';
|
|
36
|
+
import { ContextMeter } from './context-meter.js';
|
|
37
37
|
import { cn } from '../../../lib/utils.js';
|
|
38
|
-
import {
|
|
38
|
+
import { FileTextIcon as FileText, GlobeIcon as Globe, PlusIcon as Plus, } from '@phosphor-icons/react';
|
|
39
39
|
import { familyForTool, narrateFailedStep, narrateStep } from '@kortix/sdk';
|
|
40
40
|
import { safeHttpUrl } from '../../../_vendor/kortix-shared.js';
|
|
41
41
|
import { ToolParts } from './detail-view.js';
|
|
42
42
|
import { PanelCard } from './panel-card.js';
|
|
43
43
|
import { StepIcon } from './step-icon.js';
|
|
44
|
-
|
|
44
|
+
import { CaretRightSolidIcon } from '../../../icons/caret-right-solid.js';
|
|
45
|
+
export function ContextCard({ files, web, tools, sessionId, onOpenDetail, onOpenFile, onAddContext, usage, }) {
|
|
45
46
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
46
47
|
const groups = [];
|
|
47
48
|
if (web.length) {
|
|
@@ -49,7 +50,7 @@ export function ContextCard({ files, web, tools, sessionId, onOpenDetail, onOpen
|
|
|
49
50
|
id: 'web',
|
|
50
51
|
label: tI18nComplete.raw('text033c214ae9a3'),
|
|
51
52
|
count: web.length,
|
|
52
|
-
icon: _jsx(Globe, { className: "text-
|
|
53
|
+
icon: _jsx(Globe, { className: "text-foreground size-4 shrink-0" }),
|
|
53
54
|
body: _jsx(WebSourceList, { items: web }),
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -58,7 +59,7 @@ export function ContextCard({ files, web, tools, sessionId, onOpenDetail, onOpen
|
|
|
58
59
|
id: 'files',
|
|
59
60
|
label: tI18nComplete.raw('text83480f565627'),
|
|
60
61
|
count: files.length,
|
|
61
|
-
icon: _jsx(FileText, { className: "text-
|
|
62
|
+
icon: _jsx(FileText, { className: "text-foreground size-4 shrink-0" }),
|
|
62
63
|
body: _jsx(FileList, { items: files, onOpenFile: onOpenFile }),
|
|
63
64
|
});
|
|
64
65
|
}
|
|
@@ -86,15 +87,15 @@ export function ContextCard({ files, web, tools, sessionId, onOpenDetail, onOpen
|
|
|
86
87
|
id: tool.callID,
|
|
87
88
|
label: tool.label,
|
|
88
89
|
count: tool.calls?.length ?? 1,
|
|
89
|
-
icon: _jsx(StepIcon, { family: family, status: failed ? 'error' : 'done' }),
|
|
90
|
+
icon: _jsx(StepIcon, { family: family, status: failed ? 'error' : 'done', tone: "foreground" }),
|
|
90
91
|
body: _jsx(ToolParts, { calls: tool.calls ?? [], sessionId: sessionId, summary: summary }),
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
|
-
return (
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
contentClassName: "
|
|
94
|
+
return (_jsxs(PanelCard, { title: tI18nComplete.raw('texta6e600a10fed'), isEmpty: groups.length === 0 && !usage, emptyText: tI18nComplete.raw('textc63adab9bd56'), emptyActions: _jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: onAddContext, children: [_jsx(Plus, { className: "size-3.5" }), tI18nComplete.raw('text0f01d14cacf0')] }),
|
|
95
|
+
// No header count on purpose: the meter states how full the window is,
|
|
96
|
+
// and each row carries its own number (web sources, files read, calls
|
|
97
|
+
// per tool). Rows carry their own `px-4` and fill the width on hover.
|
|
98
|
+
contentClassName: "pb-2", defaultExpanded: files.length + web.length + tools.length > 0 || !!usage, children: [usage && _jsx(ContextMeter, { usage: usage }), _jsx("ul", { className: cn('flex flex-col gap-0', usage && groups.length > 0 && 'mt-2'), children: groups.map((g) => (_jsx("li", { className: "flex items-center", children: _jsxs("button", { type: "button", onClick: () => onOpenDetail({ key: g.id, title: g.label, icon: g.icon, body: g.body }), className: "hover:bg-accent flex h-8 w-full cursor-pointer items-center gap-2.5 px-4 text-left transition-[background-color,transform] active:scale-[0.998]", children: [_jsx("span", { className: "flex size-4 shrink-0 items-center justify-center", children: g.icon }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: g.label }), _jsx("span", { className: "text-muted-foreground text-sm tabular-nums", children: g.count }), _jsx(CaretRightSolidIcon, { className: "text-muted-foreground size-3.5 shrink-0" })] }) }, g.id))) })] }));
|
|
98
99
|
}
|
|
99
100
|
const ROW = cn('flex min-h-12 w-full items-center gap-3 rounded-md px-2.5 py-2 text-left', 'bg-muted/40 transition-colors');
|
|
100
101
|
/**
|
|
@@ -119,7 +120,7 @@ function WebSourceList({ items }) {
|
|
|
119
120
|
*/
|
|
120
121
|
function FileList({ items, onOpenFile, }) {
|
|
121
122
|
const allPaths = items.flatMap((it) => (it.path ? [it.path] : []));
|
|
122
|
-
return (_jsx("ul", { className: "flex min-w-0 flex-col gap-1.5", children: items.map((it) => it.path ? (_jsx("li", { children: _jsxs("button", { type: "button", onClick: () => onOpenFile(it.path, allPaths), className: cn(ROW, 'hover:bg-muted cursor-pointer transition-[background-color,transform] active:scale-[0.
|
|
123
|
+
return (_jsx("ul", { className: "flex min-w-0 flex-col gap-1.5", children: items.map((it) => it.path ? (_jsx("li", { children: _jsxs("button", { type: "button", onClick: () => onOpenFile(it.path, allPaths), className: cn(ROW, 'hover:bg-muted cursor-pointer transition-[background-color,transform] active:scale-[0.998]'), children: [_jsx("span", { className: "bg-muted/70 flex size-7 shrink-0 items-center justify-center rounded-sm", children: getFileIcon(basename(it.label), { className: 'size-4', variant: 'monochrome' }) }), _jsx("span", { className: "text-foreground truncate text-sm", children: it.label })] }) }, it.callID)) : (_jsxs("li", { className: ROW, children: [_jsx("span", { className: "bg-muted/70 flex size-7 shrink-0 items-center justify-center rounded-sm", children: _jsx(FileText, { className: "text-muted-foreground size-3.5" }) }), _jsx("span", { className: "text-foreground truncate text-sm", children: it.label })] }, it.callID))) }));
|
|
123
124
|
}
|
|
124
125
|
/** Last path segment — `getFileIcon` keys off the extension, and `it.label`
|
|
125
126
|
* can occasionally BE a full path (`deriveContext`'s `label: ... || path`
|
|
@@ -132,19 +133,3 @@ function basename(path) {
|
|
|
132
133
|
function prettyUrl(url) {
|
|
133
134
|
return url.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
134
135
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Soft placeholder art — overlapping note cards, matching the reference.
|
|
137
|
-
*
|
|
138
|
-
* The hairlines are `border-border` at full alpha, not `border-border/60`.
|
|
139
|
-
* Dark's `--border` (oklch 0.2686) already sits only 0.077 L above the card it
|
|
140
|
-
* draws on (`--card`, oklch 0.1913) — that IS the theme's hairline contrast —
|
|
141
|
-
* so taking 60% of it left the whole illustration effectively unrendered on
|
|
142
|
-
* dark. The fills are the same story: `bg-muted/30` over dark's card resolves
|
|
143
|
-
* to ~0.201 L against a 0.1913 ground, a 0.01 difference. `/50` and `/70` keep
|
|
144
|
-
* the two-card depth order while landing where the eye can find them. Light is
|
|
145
|
-
* unaffected in kind — `--border` is that theme's hairline too — and the fills
|
|
146
|
-
* stay soft there because `--muted` is only 0.024 L off `--card`.
|
|
147
|
-
*/
|
|
148
|
-
function ContextArt() {
|
|
149
|
-
return (_jsxs("div", { "aria-hidden": true, className: "relative h-16 w-24", children: [_jsx("span", { className: "border-border bg-muted/50 absolute top-3 left-0 h-10 w-8 rounded-sm border" }), _jsx("span", { className: "border-border bg-muted/70 absolute top-1.5 left-6 h-12 w-9 rounded-sm border" }), _jsx("span", { className: "border-border absolute top-3 left-14 h-10 w-8 rounded-sm border border-dashed bg-transparent" })] }));
|
|
150
|
-
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ContextUsage } from '../../composer/context-usage.js';
|
|
2
|
+
/**
|
|
3
|
+
* The catalog entry a recorded model key names. The session row carries the
|
|
4
|
+
* provider prefix ("kortix/codex/gpt-6.1-sol"); the gateway's served model
|
|
5
|
+
* does not ("codex/gpt-6.1-sol"). Both resolve to the same entry.
|
|
6
|
+
*/
|
|
7
|
+
export declare function findModelKey(models: {
|
|
8
|
+
providerID: string;
|
|
9
|
+
modelID: string;
|
|
10
|
+
}[], key: string | null | undefined): {
|
|
11
|
+
providerID: string;
|
|
12
|
+
modelID: string;
|
|
13
|
+
} | null;
|
|
14
|
+
/** The live session's context usage, or null outside a session panel / before the first reply. */
|
|
15
|
+
export declare function useSessionContextUsage(): ContextUsage | null;
|
|
16
|
+
export declare function ContextMeter({ usage }: {
|
|
17
|
+
usage: ContextUsage;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The Context section's usage meter: how full the model's context window is,
|
|
5
|
+
* and what fills it.
|
|
6
|
+
*
|
|
7
|
+
* One stacked bar over the whole window, then one legend row per part with its
|
|
8
|
+
* tokens and its share of the window. The parts are the ones the transcript
|
|
9
|
+
* actually measures for the last reply (`getLastAssistantTokenBreakdown`):
|
|
10
|
+
* cached input reused from earlier turns, new input, and the reply. Nothing is
|
|
11
|
+
* estimated or invented. Without a known window (a model the catalog does not
|
|
12
|
+
* list) the meter shows the tokens and drops the percentages and free space.
|
|
13
|
+
*
|
|
14
|
+
* Nearly full shows as the composer context ring's tone (a yellow dot from
|
|
15
|
+
* 70%, red from 85%, `contextTone`), so the two never disagree.
|
|
16
|
+
*/
|
|
17
|
+
import { flattenModels } from '@kortix/sdk';
|
|
18
|
+
import { useProjectSession, useRuntimeProviders, useSessionLogThread, useSessionModelUsage, } from '@kortix/sdk/react';
|
|
19
|
+
import { useMemo } from 'react';
|
|
20
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
21
|
+
import { cn } from '../../../lib/utils.js';
|
|
22
|
+
import { STATUS_DOT } from '../../../primitives/status.js';
|
|
23
|
+
import { formatContextCount, getContextUsage } from '../../composer/context-usage.js';
|
|
24
|
+
import { useOptionalSessionPanel } from '../session-panel-provider.js';
|
|
25
|
+
/**
|
|
26
|
+
* The catalog entry a recorded model key names. The session row carries the
|
|
27
|
+
* provider prefix ("kortix/codex/gpt-6.1-sol"); the gateway's served model
|
|
28
|
+
* does not ("codex/gpt-6.1-sol"). Both resolve to the same entry.
|
|
29
|
+
*/
|
|
30
|
+
export function findModelKey(models, key) {
|
|
31
|
+
if (!key)
|
|
32
|
+
return null;
|
|
33
|
+
const hit = models.find((m) => `${m.providerID}/${m.modelID}` === key || m.modelID === key);
|
|
34
|
+
return hit ? { providerID: hit.providerID, modelID: hit.modelID } : null;
|
|
35
|
+
}
|
|
36
|
+
/** The live session's context usage, or null outside a session panel / before the first reply. */
|
|
37
|
+
export function useSessionContextUsage() {
|
|
38
|
+
const panel = useOptionalSessionPanel();
|
|
39
|
+
const projectId = panel?.projectId;
|
|
40
|
+
const sessionId = panel?.projectSessionId;
|
|
41
|
+
const session = useProjectSession(projectId, sessionId).data;
|
|
42
|
+
const served = useSessionModelUsage(projectId, sessionId).data?.latest?.served_model;
|
|
43
|
+
const { data: providers } = useRuntimeProviders();
|
|
44
|
+
// Throttled: the meter restates a total, it does not need every streamed token.
|
|
45
|
+
const thread = useSessionLogThread({ projectId: projectId ?? '', sessionId: sessionId ?? '', runtimeSessionId: panel?.sessionId ?? '' }, null, { throttleMs: 1000 });
|
|
46
|
+
const models = useMemo(() => flattenModels(providers), [providers]);
|
|
47
|
+
const messages = thread?.messages;
|
|
48
|
+
const modelKey = served ?? session?.model ?? null;
|
|
49
|
+
return useMemo(() => {
|
|
50
|
+
if (!panel)
|
|
51
|
+
return null;
|
|
52
|
+
const usage = getContextUsage(messages, models, findModelKey(models, modelKey));
|
|
53
|
+
return usage.breakdown.total > 0 ? usage : null;
|
|
54
|
+
}, [panel, messages, models, modelKey]);
|
|
55
|
+
}
|
|
56
|
+
export function ContextMeter({ usage }) {
|
|
57
|
+
const t = useTranslations('hardcodedUi.i18nComplete');
|
|
58
|
+
const { breakdown, limit } = usage;
|
|
59
|
+
// The bar's scale: the window when known, else the tokens themselves.
|
|
60
|
+
const scale = limit ?? breakdown.total;
|
|
61
|
+
const share = (n) => (scale > 0 ? n / scale : 0);
|
|
62
|
+
const pct = (n) => {
|
|
63
|
+
const p = share(n) * 100;
|
|
64
|
+
return p > 0 && p < 0.1 ? '<0.1%' : `${p.toFixed(1)}%`;
|
|
65
|
+
};
|
|
66
|
+
const free = limit ? Math.max(0, limit - breakdown.total) : null;
|
|
67
|
+
const parts = [
|
|
68
|
+
{ key: 'cache', label: t.raw('texta251c18205f1'), value: breakdown.cache, swatch: 'bg-kortix-blue' },
|
|
69
|
+
{ key: 'input', label: t.raw('text36ecb4f86691'), value: breakdown.input, swatch: 'bg-kortix-purple' },
|
|
70
|
+
{ key: 'output', label: t.raw('textb2439bcb8dee'), value: breakdown.output, swatch: 'bg-kortix-green' },
|
|
71
|
+
].filter((p) => p.value > 0);
|
|
72
|
+
return (_jsxs("div", { className: "px-4 pb-1", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [_jsxs("span", { className: "text-foreground flex items-center gap-1.5 text-sm tabular-nums", children: [limit && usage.tone !== 'info' && (_jsx("span", { className: cn('size-1.5 rounded-full', STATUS_DOT[usage.tone]), "aria-hidden": true })), limit ? `${usage.percent}% ${t.raw('textf83916135509')}` : formatContextCount(breakdown.total)] }), limit && (_jsxs("span", { className: "text-muted-foreground text-xs tabular-nums", children: [formatContextCount(breakdown.total), " / ", formatContextCount(limit)] }))] }), _jsx("div", { className: "bg-muted mt-2 flex h-1.5 w-full gap-px overflow-hidden rounded-full", "aria-hidden": true, children: parts.map((p) => (_jsx("span", { className: p.swatch, style: { width: `${share(p.value) * 100}%` } }, p.key))) }), _jsxs("dl", { className: "mt-2.5 flex flex-col", children: [parts.map((p) => (_jsxs("div", { className: "flex h-7 items-center gap-2.5 text-sm", children: [_jsx("span", { className: cn('size-2 shrink-0 rounded-full', p.swatch), "aria-hidden": true }), _jsx("dt", { className: "text-muted-foreground min-w-0 flex-1 truncate", children: p.label }), _jsx("dd", { className: "text-foreground tabular-nums", children: formatContextCount(p.value) }), limit && _jsx("dd", { className: "text-muted-foreground w-12 text-right tabular-nums", children: pct(p.value) })] }, p.key))), free != null && (_jsxs("div", { className: "flex h-7 items-center gap-2.5 text-sm", children: [_jsx("span", { className: "bg-muted size-2 shrink-0 rounded-full ring-1 ring-border ring-inset", "aria-hidden": true }), _jsx("dt", { className: "text-muted-foreground min-w-0 flex-1 truncate", children: t.raw('text64cd989efc14') }), _jsx("dd", { className: "text-foreground tabular-nums", children: formatContextCount(free) }), _jsx("dd", { className: "text-muted-foreground w-12 text-right tabular-nums", children: pct(free) })] }))] })] }));
|
|
73
|
+
}
|
|
@@ -4,7 +4,7 @@ import { type ReactNode } from 'react';
|
|
|
4
4
|
import { CloseButton, DetailSidebarToggle } from '../../../files/viewer/viewer-chrome.js';
|
|
5
5
|
export { CloseButton, DetailSidebarToggle };
|
|
6
6
|
/**
|
|
7
|
-
* A layer that lives inside the detail
|
|
7
|
+
* A layer that lives inside the docked detail frame but must NEVER unmount.
|
|
8
8
|
*
|
|
9
9
|
* The terminal is the only one: `SessionTerminalPanel` owns a long-lived PTY
|
|
10
10
|
* WebSocket, and the keyed `AnimatePresence` below tears a `Detail`'s body down
|
|
@@ -24,24 +24,18 @@ import { isPlanWriteTool } from '../../turn/plan-anchor.js';
|
|
|
24
24
|
import { cn } from '../../../lib/utils.js';
|
|
25
25
|
import { hasOpenFloatingLayer } from '../../../lib/z-stack.js';
|
|
26
26
|
import { focusWithoutScroll } from '../../../internal/lib/utils/focus-without-scroll.js';
|
|
27
|
+
import { useKortixComputerStore } from '../../../internal/stores/kortix-computer-store.js';
|
|
27
28
|
import { CaretLeftIcon as ChevronLeft, CaretRightIcon as ChevronRight, } from '@phosphor-icons/react';
|
|
28
|
-
import { AnimatePresence, m
|
|
29
|
+
import { AnimatePresence, m } from 'motion/react';
|
|
30
|
+
import { useReducedMotion } from '../../../internal/hooks/use-reduced-motion.js';
|
|
29
31
|
import { useEffect, useRef, useState, } from 'react';
|
|
30
32
|
import { ToolPartRenderer, ToolSurfaceContext } from '../../tool/tool-renderers.js';
|
|
31
33
|
import { PanelWidthButton } from '../../../files/viewer/viewer-actions.js';
|
|
34
|
+
import { DOCKED_LAYER_CLASS, SESSION_BAR_CLASS } from '../../../internal/layout/panel-chrome.js';
|
|
32
35
|
import { CloseButton, DetailSidebarToggle } from '../../../files/viewer/viewer-chrome.js';
|
|
33
36
|
export { CloseButton, DetailSidebarToggle };
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
* ONE constant, because they are two states of one shell: inset from the top,
|
|
37
|
-
* left and bottom so the card reads as sitting IN the panel rather than nailed
|
|
38
|
-
* over it, flush to the right edge so an arrival slides in from off-panel.
|
|
39
|
-
*
|
|
40
|
-
* This used to be copy-pasted into `easy-panel.tsx`'s standalone terminal
|
|
41
|
-
* `m.div`, which is exactly how the terminal drifted into looking like its
|
|
42
|
-
* own sidebar instead of a view inside this shell. Shared, the two cannot drift.
|
|
43
|
-
*/
|
|
44
|
-
const CARD_FRAME = 'bg-popover border-border absolute inset-y-3 right-3 left-3 flex min-w-0 flex-col overflow-hidden rounded-md border shadow-md';
|
|
37
|
+
/** The layer's header bar — the same bar as the chat's session header. */
|
|
38
|
+
const LAYER_BAR_CLASS = cn(SESSION_BAR_CLASS, 'justify-between gap-2 px-3');
|
|
45
39
|
/**
|
|
46
40
|
* The prev/next row, shared by the desktop card and the mobile drawer so the
|
|
47
41
|
* two never drift. Both pin it as a slim bar under the scrollable body —
|
|
@@ -127,6 +121,13 @@ function useDetailKeyboard(detail, isMobile, onBack, detailRef) {
|
|
|
127
121
|
// (`session-chat.tsx`) skips a `defaultPrevented` Escape. Without it,
|
|
128
122
|
// closing three full-screen images in a row stopped a running turn.
|
|
129
123
|
event.preventDefault();
|
|
124
|
+
// Full screen is one level above the docked detail: the first Escape
|
|
125
|
+
// leaves it and keeps the same view docked; the next one closes (D-07).
|
|
126
|
+
const store = useKortixComputerStore.getState();
|
|
127
|
+
if (store.isExpanded) {
|
|
128
|
+
store.toggleExpanded();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
130
131
|
onBack();
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
@@ -326,25 +327,27 @@ export function DetailLayer({ detail, onBack, isMobile, persistentLayer, childre
|
|
|
326
327
|
// `terminalOpen` for the exit, since the exiting card's last
|
|
327
328
|
// rendered props predate the state flip that removed it.
|
|
328
329
|
custom: !!detail.swapIn, variants: cardVariants, initial: "hidden", animate: "visible", exit: "hidden",
|
|
329
|
-
// `
|
|
330
|
+
// `DOCKED_LAYER_CLASS` is shared with the persistent layer below
|
|
331
|
+
// (`panel-chrome.ts`): docked edge to edge, and an arrival still
|
|
332
|
+
// slides in from the right edge, which the panel clips. Shared, so the
|
|
330
333
|
// two states of this shell can never drift apart visually.
|
|
331
334
|
// `outline-none`: this container is programmatically focused on
|
|
332
335
|
// open (the a11y focus management above). A keyboard-initiated
|
|
333
336
|
// open — the ⌘K "Open Browser"/"Open Terminal" commands — makes
|
|
334
337
|
// that focus :focus-visible, which drew a focus ring around the
|
|
335
338
|
// whole card. The container is a focus TARGET (tabIndex -1), not
|
|
336
|
-
// a control;
|
|
337
|
-
className: cn(
|
|
338
|
-
//
|
|
339
|
-
//
|
|
340
|
-
//
|
|
341
|
-
//
|
|
342
|
-
_jsxs("div", { className:
|
|
339
|
+
// a control; the panel's `border-l` frames it, never an outline.
|
|
340
|
+
className: cn(DOCKED_LAYER_CLASS, 'outline-none'), children: _jsx(AnimatePresence, { mode: "popLayout", initial: false, children: _jsxs(m.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: crossfadeTransition, className: "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: [!detail.hideHeader && (
|
|
341
|
+
// The rule under the header lines up with the chat header's
|
|
342
|
+
// rule (`SESSION_BAR_CLASS`). Close sits far right, where a
|
|
343
|
+
// close always is — a back chevron implies a stack the user
|
|
344
|
+
// isn't in.
|
|
345
|
+
_jsxs("div", { className: LAYER_BAR_CLASS, children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx(DetailSidebarToggle, { className: "size-7" }), detail.icon, _jsx("span", { className: "text-foreground truncate text-sm font-semibold", children: detail.title }), detail.meta && _jsx("span", { className: "shrink-0", children: detail.meta })] }), _jsxs(ButtonGroup, { className: "shrink-0", children: [detail.actions, _jsx(CloseButton, { onClose: onBack })] })] })), _jsx("div", { className: cn('min-h-0 min-w-0 flex-1 overflow-auto', detail.padded !== false && 'p-4'), children: detail.body }), detail.nav && _jsx(DetailNav, { nav: detail.nav })] }, detail.key) }) }, "detail-card"
|
|
343
346
|
// No aria-modal: the detail replaces only the panel's cards — the
|
|
344
347
|
// chat beside it stays live, so claiming page modality would lie
|
|
345
348
|
// to assistive tech. Containment is panel-scoped instead (inert
|
|
346
349
|
// home + the Tab wrap scoped to focus inside this dialog).
|
|
347
|
-
)) }), persistentActivated && persistentLayer && (_jsxs(m.div, { initial: { x: '100%', opacity: 0 }, animate: persistentMotion.target, transition: persistentMotion.transition, "aria-hidden": !persistentOpen, inert: !persistentOpen || undefined, className: cn(
|
|
350
|
+
)) }), persistentActivated && persistentLayer && (_jsxs(m.div, { initial: { x: '100%', opacity: 0 }, animate: persistentMotion.target, transition: persistentMotion.transition, "aria-hidden": !persistentOpen, inert: !persistentOpen || undefined, className: cn(DOCKED_LAYER_CLASS, !persistentOpen && 'pointer-events-none'), children: [_jsxs("div", { className: LAYER_BAR_CLASS, children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx(DetailSidebarToggle, { className: "size-7" }), persistentLayer.icon, _jsx("span", { className: "text-foreground truncate text-sm font-semibold", children: persistentLayer.title })] }), _jsxs(ButtonGroup, { className: "shrink-0", children: [_jsx(PanelWidthButton, { isMobile: isMobile }), _jsx(CloseButton, { onClose: persistentLayer.onClose })] })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: persistentLayer.body })] }))] }));
|
|
348
351
|
}
|
|
349
352
|
/** Tools that re-send their ENTIRE state on every call rather than a delta. */
|
|
350
353
|
function isSnapshotTool(tool) {
|
|
@@ -5,10 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* (Outputs / Context / Preview / Plan) over the same tool-call data the
|
|
6
6
|
* Advanced stepper renders one-at-a-time.
|
|
7
7
|
*
|
|
8
|
-
* It is the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* container around them would only box a box.
|
|
8
|
+
* It is the docked cards column's whole content: flat sections, one hairline
|
|
9
|
+
* under each, no header, no tab strip, no wrapper. The column draws the
|
|
10
|
+
* vertical rule beside the chat (`session-action-panel-column.tsx`).
|
|
12
11
|
*
|
|
13
12
|
* It owns no state — everything it reads (the derived outputs, the context
|
|
14
13
|
* groups, the running apps, the callback that opens any of them) comes from
|
|
@@ -32,7 +31,9 @@ import { useOptionalSessionPanel } from '../session-panel-provider.js';
|
|
|
32
31
|
import { useSessionChangeRequestsPanel } from '../../outcomes/session-outcomes-bridge.js';
|
|
33
32
|
import { ChangeRequestsCard } from './change-requests-card.js';
|
|
34
33
|
import { AppsCard } from './apps-card.js';
|
|
34
|
+
import { ChangesCard } from './changes-card.js';
|
|
35
35
|
import { ContextCard } from './context-card.js';
|
|
36
|
+
import { useSessionContextUsage } from './context-meter.js';
|
|
36
37
|
import { pathOutput } from './easy-panel-logic.js';
|
|
37
38
|
import { OutputsCard } from './outputs-card.js';
|
|
38
39
|
import { PlanPanelCard } from './plan-card.js';
|
|
@@ -46,6 +47,7 @@ export function EasyPanel() {
|
|
|
46
47
|
// (see `planBelongsToChat`). `usePlanInChat` is that one decision, shared
|
|
47
48
|
// with `session-chat.tsx` so the two cannot disagree.
|
|
48
49
|
const planInChat = usePlanInChat();
|
|
50
|
+
const contextUsage = useSessionContextUsage();
|
|
49
51
|
// Null outside a `SessionPanelProvider` — `SessionChat` also renders
|
|
50
52
|
// read-only inside `legacy-subagent-chat.tsx`, which has no panel at all.
|
|
51
53
|
if (!panel)
|
|
@@ -65,5 +67,5 @@ export function EasyPanel() {
|
|
|
65
67
|
// Preview keep `shrink-0` and stay on screen at their full height, always.
|
|
66
68
|
// `min-h-0` is what lets this shrink at all — a flex container defaults to
|
|
67
69
|
// its content's minimum height and would otherwise refuse.
|
|
68
|
-
_jsxs("div", { className: "flex h-full min-h-0 flex-col
|
|
70
|
+
_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [_jsx(OutputsCard, { fill: !changeRequests?.requests.length, outputs: files, defaultExpanded: outputsDefaultOpen || files.length > 0, onOpenOutput: (o) => handleOpenOutput(o, files) }), _jsx(ChangesCard, { onOpenDetail: openDetail, onOpenAll: () => panel.openFiles(true) }), _jsx(ContextCard, { usage: contextUsage, files: context.files, web: context.web, tools: context.tools, sessionId: sessionId, onOpenDetail: openDetail, onOpenFile: (path, allPaths) => handleOpenOutput(pathOutput(path), allPaths.map(pathOutput)), onAddContext: () => useSessionComposerPrefillStore.getState().requestAttach(sessionId) }), apps.length > 0 && _jsx(AppsCard, { apps: apps, onOpenApp: (a) => handleOpenOutput(a, apps) }), !planInChat && _jsx(PlanPanelCard, { sessionId: sessionId }), changeRequests && _jsx(ChangeRequestsCard, { ...changeRequests })] }));
|
|
69
71
|
}
|
|
@@ -34,6 +34,8 @@ import { useCallback, useEffect, useSyncExternalStore } from 'react';
|
|
|
34
34
|
import { CloseButton, DetailSidebarToggle } from './detail-view.js';
|
|
35
35
|
import { FileViewer, isSvg } from '../../../files/viewer/file-viewer.js';
|
|
36
36
|
import { PanelWidthButton, RefreshButton, ViewerActions, ViewerDownloadAction, ViewerPathPill, fileShareInput, } from '../../../files/viewer/viewer-actions.js';
|
|
37
|
+
import { SESSION_BAR_CLASS } from '../../../internal/layout/panel-chrome.js';
|
|
38
|
+
import { cn } from '../../../lib/utils.js';
|
|
37
39
|
const getSandboxAliveSnapshot = () => {
|
|
38
40
|
const s = useRuntimeConnectionStore.getState();
|
|
39
41
|
return s.status === 'connected' && s.healthy === true;
|
|
@@ -49,7 +51,7 @@ const getSandboxAliveSnapshot = () => {
|
|
|
49
51
|
function PreviewShell({ name, fileName = name, path, shareContext, onClose, onPresent, copy, refresh, children, }) {
|
|
50
52
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
51
53
|
const isMobile = useIsMobile();
|
|
52
|
-
return (_jsxs("div", { className: "flex h-full min-h-0 min-w-0 flex-col", children: [_jsxs("div", { className:
|
|
54
|
+
return (_jsxs("div", { className: "flex h-full min-h-0 min-w-0 flex-col", children: [_jsxs("div", { className: cn(SESSION_BAR_CLASS, 'gap-1 px-2.5'), children: [_jsx(DetailSidebarToggle, { className: "size-7" }), _jsxs(ViewerPathPill, { icon: getFileIcon(fileName, { className: 'size-4', variant: 'monochrome' }), path: path, fileName: name, children: [_jsx(RefreshButton, { onRefresh: refresh.onRefresh, refreshing: refresh.refreshing }), _jsx(ViewerActions, { copy: copy, shareContext: shareContext, shareInput: fileShareInput(path, fileName) })] }), _jsxs(ButtonGroup, { className: "shrink-0 *:size-8", children: [onPresent && (_jsx(Hint, { label: tI18nComplete.raw('text43f9b89c0b9d'), side: "bottom", children: _jsx(Button, { variant: "secondary", size: "icon", "aria-label": tI18nComplete.raw('text43f9b89c0b9d'), onClick: onPresent, className: "active:scale-[0.96]", children: _jsx(Presentation, { className: "size-3.5" }) }) })), _jsx(ViewerDownloadAction, { download: { path, fileName } }), _jsx(PanelWidthButton, { isMobile: isMobile }), _jsx(CloseButton, { onClose: onClose })] })] }), _jsx("div", { className: "min-h-0 min-w-0 flex-1 overflow-auto", children: children })] }));
|
|
53
55
|
}
|
|
54
56
|
/**
|
|
55
57
|
* Put the picture itself on the clipboard — a sibling to Download, not a
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Same string as `PREVIEW_LOCATION_MESSAGE` in the API's preview-bridge.ts. */
|
|
2
|
+
export declare const PREVIEW_LOCATION_MESSAGE = "kortix:preview-location";
|
|
3
|
+
/** Internal (localhost) URLs, oldest first; `index` is the page on screen. */
|
|
4
|
+
export interface FrameHistory {
|
|
5
|
+
entries: string[];
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function currentEntry(history: FrameHistory): string;
|
|
9
|
+
/** A new page opened by the panel itself: drops the forward entries. */
|
|
10
|
+
export declare function pushEntry(history: FrameHistory, url: string): FrameHistory;
|
|
11
|
+
/**
|
|
12
|
+
* The internal URL a bridge message reports, on the port of the page the frame
|
|
13
|
+
* loaded, or null when the message is not a location report.
|
|
14
|
+
*/
|
|
15
|
+
export declare function reportedFrameUrl(data: unknown, frameUrl: string): string | null;
|
|
16
|
+
/** What one bridge report says, beyond the URL. */
|
|
17
|
+
export interface FrameReport {
|
|
18
|
+
url: string;
|
|
19
|
+
/** The first report after the panel loaded the frame. */
|
|
20
|
+
settling: boolean;
|
|
21
|
+
/** The frame's `navigation.currentEntry.index`; null without the Navigation API. */
|
|
22
|
+
index: number | null;
|
|
23
|
+
/** The frame's `history.length`; null when the frame sent none. */
|
|
24
|
+
length: number | null;
|
|
25
|
+
/** The frame's `navigation.currentEntry.key`: one id per history slot. */
|
|
26
|
+
key: string | null;
|
|
27
|
+
}
|
|
28
|
+
export declare function frameReportOf(data: unknown, url: string, settling: boolean): FrameReport;
|
|
29
|
+
/**
|
|
30
|
+
* What the panel remembers between reports of one frame: which panel entry
|
|
31
|
+
* the frame's own history position `frame` mapped to at the load (`panel`),
|
|
32
|
+
* and the last `history.length` (the fallback signal).
|
|
33
|
+
*/
|
|
34
|
+
export interface FrameTracker {
|
|
35
|
+
base: {
|
|
36
|
+
panel: number;
|
|
37
|
+
frame: number;
|
|
38
|
+
} | null;
|
|
39
|
+
length: number | null;
|
|
40
|
+
/** Panel entry index -> the frame's entry key seen there. */
|
|
41
|
+
keys: Record<number, string>;
|
|
42
|
+
}
|
|
43
|
+
export declare const NEW_FRAME_TRACKER: FrameTracker;
|
|
44
|
+
/**
|
|
45
|
+
* Apply one report, the way a browser moves through its own history.
|
|
46
|
+
*
|
|
47
|
+
* - The first report after a load replaces the entry the panel opened (a
|
|
48
|
+
* server redirect lands here) and maps the frame's position to it.
|
|
49
|
+
* - With the Navigation API the frame says WHERE in its own history it is,
|
|
50
|
+
* and which slot (`key`): the same position is a `replaceState` (an auth
|
|
51
|
+
* redirect `/login` -> `/dashboard`); a position whose slot key the panel
|
|
52
|
+
* saw there is a traversal (`history.back()`, the tab's Back); anything else
|
|
53
|
+
* is a push, which drops the entries after it, as a browser does. A push to
|
|
54
|
+
* a URL equal to the old forward entry is still a push: the key differs.
|
|
55
|
+
* A frame without keys falls back to URL equality.
|
|
56
|
+
* - Without it, `history.length` is the signal: growth is a push; no growth is
|
|
57
|
+
* a step to a neighbor entry with this URL, else a replace. A push that
|
|
58
|
+
* drops forward entries keeps the length, so this fallback can misread it.
|
|
59
|
+
* - A report with neither (no Navigation API and no `length`) pushes.
|
|
60
|
+
*/
|
|
61
|
+
export declare function reduceFrameReport(history: FrameHistory, tracker: FrameTracker, report: FrameReport): {
|
|
62
|
+
history: FrameHistory;
|
|
63
|
+
tracker: FrameTracker;
|
|
64
|
+
};
|
|
65
|
+
export declare function rememberFrameHistory(key: string, history: FrameHistory): void;
|
|
66
|
+
export declare function recallFrameHistory(key: string): FrameHistory | undefined;
|
|
67
|
+
export declare function forgetFrameHistory(key: string): void;
|
|
68
|
+
/** Records the session's app list when its Browser opens, by any route (the
|
|
69
|
+
* header, a chat link, an app card, an Outputs row). */
|
|
70
|
+
export declare function noteBrowserApps(key: string, apps: readonly string[]): void;
|
|
71
|
+
/**
|
|
72
|
+
* The history an untargeted Browser open (the header, the palette) resumes,
|
|
73
|
+
* or undefined to open the first app as before. It resumes only a real page,
|
|
74
|
+
* never the empty landing, and only while no app appeared since the Browser
|
|
75
|
+
* last opened (`noteBrowserApps`): a new app the agent started is what the
|
|
76
|
+
* user wants to see. `apps` is the session's app URLs in panel order.
|
|
77
|
+
*/
|
|
78
|
+
export declare function resumableFrameHistory(key: string, apps: readonly string[]): FrameHistory | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* The history an `AppPreview` opened on `url` starts from: the session's
|
|
81
|
+
* remembered history when its current page IS `url` (the panel is resuming),
|
|
82
|
+
* else a fresh one-entry history.
|
|
83
|
+
*/
|
|
84
|
+
export declare function initialFrameHistory(key: string | undefined, url: string): FrameHistory;
|
|
85
|
+
/**
|
|
86
|
+
* The authenticated preview URL for the page on screen. `previewUrl` was
|
|
87
|
+
* minted for `frameUrl`, the page the frame loaded; after a navigation inside
|
|
88
|
+
* the frame, `currentUrl` differs. Swap the app path and query, keep the
|
|
89
|
+
* proxy prefix and the access parameters the URL carries.
|
|
90
|
+
*/
|
|
91
|
+
export declare function retargetPreviewUrl(previewUrl: string, frameUrl: string, currentUrl: string): string;
|