@kortix/ui 0.15.10 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +769 -76
- package/dist/_vendor/shared/app-config.d.ts +6 -30
- package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
- package/dist/_vendor/shared/channel-header.d.ts +2 -1
- package/dist/_vendor/shared/connector-sections.d.ts +0 -25
- package/dist/_vendor/shared/file-tags.d.ts +2 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- package/dist/_vendor/shared/pasted-content.d.ts +0 -4
- package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
- package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
- package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
- package/dist/access/access/copy-row.d.ts +7 -1
- package/dist/access/access/copy-row.js +2 -2
- package/dist/animated-copy-icon.js +2 -1
- package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
- package/dist/browser/sandbox-browser-chrome.js +1 -1
- package/dist/customize/agents/agent-cover-card.d.ts +1 -1
- package/dist/customize/agents/agent-cover-card.js +10 -2
- package/dist/customize/agents/agent-filter.js +3 -1
- package/dist/customize/agents/agent-model-view.d.ts +11 -1
- package/dist/customize/agents/agent-model-view.js +12 -1
- package/dist/customize/agents/agent-overview.d.ts +10 -0
- package/dist/customize/agents/agent-overview.js +5 -4
- package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
- package/dist/customize/agents/agent-page-chrome.js +16 -13
- package/dist/customize/agents/agent-page.js +25 -34
- package/dist/customize/agents/agent-tabs.d.ts +3 -0
- package/dist/customize/agents/agent-tabs.js +3 -0
- package/dist/customize/agents/agents-page.js +3 -3
- package/dist/customize/agents/create-agent-modal.d.ts +9 -0
- package/dist/customize/agents/create-agent-modal.js +21 -3
- package/dist/customize/agents/use-default-agent.js +2 -2
- package/dist/customize/connectors/connector-identity.d.ts +11 -2
- package/dist/customize/connectors/connector-identity.js +16 -4
- package/dist/customize/connectors/connectors-page.js +10 -6
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/detail/connector-triggers.js +1 -1
- package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
- package/dist/customize/connectors/install/install-dialog.js +6 -1
- package/dist/customize/connectors/use-agent-access.d.ts +2 -0
- package/dist/customize/evals/eval-compare-view.d.ts +10 -0
- package/dist/customize/evals/eval-compare-view.js +68 -0
- package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
- package/dist/customize/evals/eval-dataset-view.js +81 -0
- package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
- package/dist/customize/evals/eval-datasets-page.js +91 -0
- package/dist/customize/evals/eval-job-view.d.ts +12 -0
- package/dist/customize/evals/eval-job-view.js +360 -0
- package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
- package/dist/customize/evals/eval-jobs-page.js +69 -0
- package/dist/customize/evals/eval-meta.d.ts +97 -0
- package/dist/customize/evals/eval-meta.js +228 -0
- package/dist/customize/evals/eval-task-view.d.ts +13 -0
- package/dist/customize/evals/eval-task-view.js +123 -0
- package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
- package/dist/customize/evals/eval-tasks-page.js +56 -0
- package/dist/customize/evals/eval-ui.d.ts +97 -0
- package/dist/customize/evals/eval-ui.js +153 -0
- package/dist/customize/evals/evals-page.d.ts +10 -0
- package/dist/customize/evals/evals-page.js +56 -0
- package/dist/customize/evals/run-eval-modal.d.ts +28 -0
- package/dist/customize/evals/run-eval-modal.js +167 -0
- package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
- package/dist/customize/project-settings/project-admin-sections.js +6 -1
- package/dist/customize/providers/provider-connect.d.ts +13 -0
- package/dist/customize/providers/provider-connect.js +29 -5
- package/dist/customize/providers/provider-sheet.js +5 -4
- package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
- package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
- package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
- package/dist/customize/sections/view/git-view.d.ts +19 -1
- package/dist/customize/sections/view/git-view.js +7 -3
- package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
- package/dist/customize/sections/view/manifest-issue-list.js +41 -0
- package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
- package/dist/customize/sections/view/manifest-issues-row.js +39 -0
- package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
- package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
- package/dist/customize/sections/view/secrets-view.d.ts +13 -0
- package/dist/customize/sections/view/secrets-view.js +10 -6
- package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
- package/dist/customize/sections/view/subscription-usage.js +4 -8
- package/dist/customize/settings/settings-tab-header.js +12 -3
- package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
- package/dist/customize/settings/tabs/experimental-tab.js +36 -11
- package/dist/customize/settings/tabs/general-tab.js +1 -1
- package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
- package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
- package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
- package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
- package/dist/customize/settings/tabs/workspace-keys.js +6 -3
- package/dist/customize/shared/capability-page-shell.js +9 -1
- package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
- package/dist/customize/shared/catalog/catalog-card.js +15 -5
- package/dist/customize/shared/customize-tab-bar.js +1 -1
- package/dist/customize/shared/new-entity-menu.d.ts +1 -1
- package/dist/customize/shared/new-entity-menu.js +38 -1
- package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
- package/dist/customize/triggers/runtime-triggers.js +33 -3
- package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
- package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
- package/dist/customize/triggers/schedule/then-fields.js +23 -3
- package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
- package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
- package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
- package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
- package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
- package/dist/customize/triggers/schedule/when-event.js +1 -1
- package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
- package/dist/customize/triggers/schedule/when-schedule.js +16 -1
- package/dist/customize/triggers/schedule-view.js +6 -3
- package/dist/files/project/components/drive-explorer.js +33 -70
- package/dist/files/project/components/drive-grid-view.d.ts +2 -31
- package/dist/files/project/components/drive-grid-view.js +12 -22
- package/dist/files/project/components/drive-list-view.d.ts +3 -30
- package/dist/files/project/components/drive-list-view.js +8 -18
- package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
- package/dist/files/project/components/drive-selection-bar.js +13 -20
- package/dist/files/project/components/explorer-listing.d.ts +48 -0
- package/dist/files/project/components/explorer-listing.js +64 -0
- package/dist/files/project/components/file-explorer-page.js +7 -204
- package/dist/files/project/components/file-thumbnail.js +3 -1
- package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
- package/dist/files/project/components/manifest-issue-mark.js +26 -0
- package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
- package/dist/files/project/hooks/use-change-requests.js +17 -0
- package/dist/files/project/manifest-annotations.d.ts +16 -0
- package/dist/files/project/manifest-annotations.js +19 -0
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/project/upload-batch.d.ts +20 -0
- package/dist/files/project/upload-batch.js +20 -0
- package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
- package/dist/files/runtime/hooks/use-file-content.js +3 -2
- package/dist/files/runtime/hooks/use-file-list.js +1 -2
- package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
- package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
- package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
- package/dist/files/tree/components/file-tree-item.js +1 -4
- package/dist/files/viewer/file-annotations.d.ts +18 -0
- package/dist/files/viewer/file-annotations.js +21 -0
- package/dist/files/viewer/file-content-renderer.js +1 -1
- package/dist/files/viewer/file-viewer.js +2 -1
- package/dist/files/viewer/index.d.ts +1 -0
- package/dist/files/viewer/index.js +1 -0
- package/dist/files/viewer/use-file-content-state.js +8 -1
- package/dist/i18n/en.d.ts +544 -46
- package/dist/i18n/en.js +593 -95
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
- package/dist/icons/caret-right-solid.d.ts +11 -0
- package/dist/icons/caret-right-solid.js +15 -0
- package/dist/internal/auth/auth-art.d.ts +12 -0
- package/dist/internal/auth/auth-art.js +118 -0
- package/dist/internal/auth/auth-card-shell.d.ts +14 -10
- package/dist/internal/auth/auth-card-shell.js +20 -31
- package/dist/internal/auth/auth-consent.d.ts +3 -1
- package/dist/internal/auth/auth-consent.js +2 -2
- package/dist/internal/auth/auth-primitives.d.ts +26 -1
- package/dist/internal/auth/auth-primitives.js +37 -8
- package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
- package/dist/internal/connector-logo/connector-logo.js +11 -2
- package/dist/internal/files/file-read-retry.d.ts +18 -2
- package/dist/internal/files/file-read-retry.js +42 -4
- package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
- package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
- package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
- package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
- package/dist/internal/hooks/use-reduced-motion.js +12 -0
- package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
- package/dist/internal/hooks/use-save-shortcut.js +28 -0
- package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
- package/dist/internal/layout/connect-mcp-modal.js +9 -4
- package/dist/internal/layout/panel-chrome.d.ts +28 -0
- package/dist/internal/layout/panel-chrome.js +27 -0
- package/dist/internal/layout/project-page-header.js +5 -1
- package/dist/internal/layout/project-settings-nav.d.ts +17 -0
- package/dist/internal/layout/project-settings-nav.js +24 -0
- package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
- package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
- package/dist/internal/lib/capability-tab-routes.js +11 -0
- package/dist/internal/lib/manifest-health.d.ts +25 -1
- package/dist/internal/lib/manifest-health.js +56 -0
- package/dist/internal/lib/project-preamble.js +1 -1
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +3 -0
- package/dist/internal/notifications/notification-inbox.js +2 -1
- package/dist/internal/notifications/notification-rows.d.ts +1 -1
- package/dist/internal/notifications/notification-rows.js +15 -1
- package/dist/internal/selection/selection-bar.d.ts +2 -8
- package/dist/internal/selection/selection-bar.js +15 -38
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
- package/dist/internal/stores/composer-prefill-store.js +1 -0
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +9 -1
- package/dist/internal/stores/user-preferences-store.js +2 -0
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.js +28 -1
- package/dist/lib/dotmatrix-hooks.d.ts +1 -0
- package/dist/lib/dotmatrix-hooks.js +3 -13
- package/dist/lib/reduced-motion.d.ts +10 -0
- package/dist/lib/reduced-motion.js +104 -0
- package/dist/lib/routes.d.ts +9 -0
- package/dist/lib/routes.js +7 -4
- package/dist/markdown/artifact-link.d.ts +11 -0
- package/dist/markdown/artifact-link.js +62 -0
- package/dist/markdown/code/index.d.ts +1 -1
- package/dist/markdown/code/index.js +1 -1
- package/dist/markdown/code/inline-code.d.ts +1 -1
- package/dist/markdown/code/inline-code.js +1 -1
- package/dist/markdown/genui/components/map-canvas.js +2 -1
- package/dist/markdown/index.d.ts +3 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
- package/dist/markdown/inline-code-text.d.ts +34 -0
- package/dist/markdown/inline-code-text.js +68 -0
- package/dist/markdown/setup-links/approval-decision.js +3 -3
- package/dist/markdown/soft-breaks.d.ts +21 -0
- package/dist/markdown/soft-breaks.js +33 -0
- package/dist/markdown/unified-markdown.d.ts +9 -1
- package/dist/markdown/unified-markdown.js +31 -9
- package/dist/primitives/action-bar.d.ts +50 -0
- package/dist/primitives/action-bar.js +87 -0
- package/dist/primitives/calendar.js +4 -2
- package/dist/primitives/inline-meta.js +2 -2
- package/dist/primitives/kortix-loader.js +2 -1
- package/dist/primitives/modal.d.ts +1 -1
- package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
- package/dist/primitives/paper-wallpaper-shaders.js +6 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/primitives/resize-seam.d.ts +3 -2
- package/dist/primitives/resize-seam.js +4 -3
- package/dist/primitives/settings-section-header.d.ts +30 -1
- package/dist/primitives/settings-section-header.js +37 -0
- package/dist/primitives/sliding-tab-indicator.js +2 -1
- package/dist/primitives/switch.js +15 -8
- package/dist/primitives/text-shimmer.js +6 -0
- package/dist/primitives/toast-clearance.d.ts +52 -0
- package/dist/primitives/toast-clearance.js +116 -0
- package/dist/primitives/toast.d.ts +3 -1
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/typed-title.js +1 -1
- package/dist/primitives/wallpaper-shaders.js +1 -1
- package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
- package/dist/session/actions/project-session-list-helpers.js +18 -0
- package/dist/session/actions/session-label.js +2 -2
- package/dist/session/agents/agent-model.d.ts +1 -0
- package/dist/session/agents/agent-model.js +2 -1
- package/dist/session/agents/agent-strip.d.ts +10 -5
- package/dist/session/agents/agent-strip.js +49 -15
- package/dist/session/agents/held-messages.d.ts +6 -2
- package/dist/session/agents/held-messages.js +6 -3
- package/dist/session/agents/workflow-run-controls.d.ts +27 -4
- package/dist/session/agents/workflow-run-controls.js +63 -10
- package/dist/session/composer/ComposerCard.js +7 -1
- package/dist/session/composer/agent-selector.d.ts +2 -0
- package/dist/session/composer/agent-selector.js +11 -4
- package/dist/session/composer/animated-placeholder.js +2 -1
- package/dist/session/composer/attachment-tile.d.ts +2 -2
- package/dist/session/composer/attachment-tile.js +25 -3
- package/dist/session/composer/composer-agent-access.d.ts +10 -1
- package/dist/session/composer/composer-agent-access.js +18 -4
- package/dist/session/composer/composer-chat-input.d.ts +1 -0
- package/dist/session/composer/composer-chat-input.js +7 -2
- package/dist/session/composer/composer-logic.d.ts +7 -0
- package/dist/session/composer/composer-logic.js +18 -0
- package/dist/session/composer/composer-reset.d.ts +8 -14
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer.d.ts +9 -2
- package/dist/session/composer/composer.js +24 -9
- package/dist/session/composer/editor/composer-editor.js +6 -4
- package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
- package/dist/session/composer/hooks/use-file-search.js +71 -7
- package/dist/session/composer/menus/menu-items.js +6 -2
- package/dist/session/composer/menus/menu-shell.d.ts +3 -1
- package/dist/session/composer/menus/menu-shell.js +2 -2
- package/dist/session/composer/menus/slash-menu.d.ts +7 -0
- package/dist/session/composer/menus/slash-menu.js +48 -1
- package/dist/session/composer/use-instant-session-send.js +7 -1
- package/dist/session/header/session-reminders-indicator.js +3 -2
- package/dist/session/header/session-site-header.d.ts +3 -1
- package/dist/session/header/session-site-header.js +27 -8
- package/dist/session/media/sandbox-url-detector.js +1 -1
- package/dist/session/models/connect-model-step.d.ts +29 -0
- package/dist/session/models/connect-model-step.js +50 -0
- package/dist/session/models/model-connection-gate.js +2 -1
- package/dist/session/models/model-selector.js +1 -1
- package/dist/session/models/subscription-switcher.d.ts +7 -0
- package/dist/session/models/subscription-switcher.js +52 -10
- package/dist/session/models/subscription-windows.d.ts +2 -0
- package/dist/session/models/subscription-windows.js +2 -0
- package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
- package/dist/session/models/use-workspace-model-gate.js +62 -0
- package/dist/session/models/workspace-model-gate.d.ts +46 -0
- package/dist/session/models/workspace-model-gate.js +66 -0
- package/dist/session/outcomes/session-outcomes-provider.js +14 -7
- package/dist/session/panel/action-panel.js +8 -19
- package/dist/session/panel/easy/app-preview.d.ts +4 -1
- package/dist/session/panel/easy/app-preview.js +95 -33
- package/dist/session/panel/easy/apps-card.js +6 -11
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.d.ts +14 -0
- package/dist/session/panel/easy/changes-card.js +60 -0
- package/dist/session/panel/easy/context-card.d.ts +5 -1
- package/dist/session/panel/easy/context-card.js +13 -28
- package/dist/session/panel/easy/context-meter.d.ts +18 -0
- package/dist/session/panel/easy/context-meter.js +73 -0
- package/dist/session/panel/easy/detail-view.d.ts +1 -1
- package/dist/session/panel/easy/detail-view.js +24 -21
- package/dist/session/panel/easy/easy-panel.js +7 -5
- package/dist/session/panel/easy/file-preview.js +3 -1
- package/dist/session/panel/easy/frame-history.d.ts +91 -0
- package/dist/session/panel/easy/frame-history.js +198 -0
- package/dist/session/panel/easy/outputs-card.d.ts +10 -0
- package/dist/session/panel/easy/outputs-card.js +28 -31
- package/dist/session/panel/easy/panel-card.d.ts +1 -3
- package/dist/session/panel/easy/panel-card.js +24 -8
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/easy/step-icon.d.ts +4 -1
- package/dist/session/panel/easy/step-icon.js +2 -2
- package/dist/session/panel/session-action-panel-column.d.ts +5 -0
- package/dist/session/panel/session-action-panel-column.js +198 -101
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-diff-viewer.d.ts +3 -1
- package/dist/session/panel/session-diff-viewer.js +7 -4
- package/dist/session/panel/session-panel-provider.js +29 -5
- package/dist/session/panel/shared/derive-panels.js +64 -4
- package/dist/session/prompts/session-connect-card.d.ts +63 -0
- package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
- package/dist/session/status/session-busy-indicator.js +2 -1
- package/dist/session/status/session-error-banner.js +1 -1
- package/dist/session/thread/chat-minimap.js +2 -1
- package/dist/session/thread/session-body.js +4 -1
- package/dist/session/thread/session-chat.js +311 -300
- package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
- package/dist/session/thread/session-turn-meta-rows.js +33 -5
- package/dist/session/thread/transcript.d.ts +3 -3
- package/dist/session/thread/transcript.js +33 -27
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- package/dist/session/tool/tool-part-renderer.js +7 -2
- package/dist/session/tool/tools/kortix-action-tool.js +10 -2
- package/dist/session/tool/tools/session-spawn-tool.js +3 -3
- package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
- package/dist/session/tool/tools/workflow-run-card.js +31 -7
- package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
- package/dist/session/tool/tools/workflow-run-cost.js +75 -0
- package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
- package/dist/session/tool/tools/workflow-tool.js +40 -15
- package/dist/session/turn/peer-message-row.js +1 -1
- package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
- package/dist/session/turn/queued-prompt-bubbles.js +1 -1
- package/dist/session/turn/throttled-markdown.js +1 -1
- package/dist/session/turn/turn-viewport.d.ts +66 -10
- package/dist/session/turn/turn-viewport.js +92 -12
- package/dist/session/turn/user-message.js +7 -5
- package/dist/styles/theme.css +68 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/pty-terminal.js +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/test-utils/intl.d.ts +544 -46
- package/dist/workspace/admin/project-admin-dashboard.js +23 -11
- package/dist/workspace/admin/settings-search-landing.js +2 -1
- package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
- package/dist/workspace/calendar/calendar-dates.js +64 -0
- package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
- package/dist/workspace/calendar/calendar-new-item.js +47 -0
- package/dist/workspace/calendar/calendar-page.d.ts +3 -0
- package/dist/workspace/calendar/calendar-page.js +177 -0
- package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
- package/dist/workspace/calendar/calendar-panel.js +103 -0
- package/dist/workspace/calendar/calendar-people.d.ts +52 -0
- package/dist/workspace/calendar/calendar-people.js +117 -0
- package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
- package/dist/workspace/calendar/calendar-scheduled.js +118 -0
- package/dist/workspace/calendar/calendar-views.d.ts +32 -0
- package/dist/workspace/calendar/calendar-views.js +124 -0
- package/dist/workspace/calendar/calendar-when.d.ts +14 -0
- package/dist/workspace/calendar/calendar-when.js +81 -0
- package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
- package/dist/workspace/calendar/mention-textarea.js +84 -0
- package/dist/workspace/home/access-requests-bell.js +2 -1
- package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
- package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
- package/dist/workspace/home/no-agent-home.d.ts +3 -1
- package/dist/workspace/home/no-agent-home.js +2 -2
- package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
- package/dist/workspace/inbox/workspace-inbox.js +1 -1
- package/dist/workspace/layout/project-files-view.js +2 -1
- package/dist/workspace/layout/project-home.js +16 -9
- package/dist/workspace/memory/memory-page-list.js +1 -1
- package/dist/workspace/new/workspace-handoff.js +2 -1
- package/dist/workspace/projects/modal/project-icon-field.js +2 -1
- package/dist/workspace/session-workspace.js +13 -12
- package/dist/workspace/setup/setup-steps.d.ts +43 -0
- package/dist/workspace/setup/setup-steps.js +38 -0
- package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
- package/dist/workspace/setup/workspace-setup-page.js +124 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
- package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
- package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
- package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
- package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
- package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
- package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
- package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
- package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
- package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
- package/dist/workspace/sidebar/footer/promo-card.js +47 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +12 -4
- package/dist/workspace/sidebar/project-session-list.js +58 -26
- package/dist/workspace/sidebar/project-sidebar.js +2 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
- package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
- package/dist/workspace/sidebar/session-group-sections.js +121 -41
- package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
- package/dist/workspace/sidebar/session-grouping.js +1 -1
- package/dist/workspace/sidebar/sidebar-drill.js +6 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
- package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
- package/dist/workspace/sidebar/use-workspace-list.js +11 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
- package/dist/workspace/space/space-tab-panels.js +1 -1
- package/dist/workspace/spaces/space-details-panel.js +2 -2
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/dist/workspace/spaces/space-triggers.js +2 -2
- package/dist/workspace/spaces/space-view.js +11 -5
- package/package.json +79 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
- package/dist/session/thread/turn-share.d.ts +0 -16
- package/dist/session/thread/turn-share.js +0 -161
- package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
- package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
- /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
|
@@ -6,7 +6,7 @@ import { SessionOverridesComposer } from '../overrides/session-overrides-compose
|
|
|
6
6
|
import { SessionChatInput, } from './session-chat-input.js';
|
|
7
7
|
import { useProjectConfig, useRuntimeAgents, useRuntimeCommands, useRuntimeConfig, useRuntimeProviders, useSessionModelSelection } from '@kortix/sdk/react';
|
|
8
8
|
import { appendMentionRefs } from '../../internal/lib/project-preamble.js';
|
|
9
|
-
import { resolveComposerAgent, withChannelAgents } from './composer-agent-access.js';
|
|
9
|
+
import { chatStartAgent, resolveComposerAgent, withChannelAgents } from './composer-agent-access.js';
|
|
10
10
|
import { inheritedModelFor } from './chat-input/chat-input-summary.js';
|
|
11
11
|
/**
|
|
12
12
|
* The canonical "compose a first message" input: {@link SessionChatInput}
|
|
@@ -24,7 +24,9 @@ export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isB
|
|
|
24
24
|
const { data: providers, isLoading: providersLoading } = useRuntimeProviders();
|
|
25
25
|
const { data: config } = useRuntimeConfig();
|
|
26
26
|
const projectConfig = useProjectConfig(projectId);
|
|
27
|
-
|
|
27
|
+
// A new chat starts on the place's agent (a channel's), else My Kortix when
|
|
28
|
+
// the workspace runs it, else kortix.yaml `default_agent` (`chatStartAgent`).
|
|
29
|
+
const startAgent = defaultAgentName || chatStartAgent(projectConfig);
|
|
28
30
|
const local = useSessionModelSelection({
|
|
29
31
|
agents,
|
|
30
32
|
providers,
|
|
@@ -32,6 +34,9 @@ export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isB
|
|
|
32
34
|
sessionId,
|
|
33
35
|
boundAgentName,
|
|
34
36
|
defaultAgentName: startAgent,
|
|
37
|
+
// A new workspace chat remembers the person's pick and starts the next one
|
|
38
|
+
// on it. A place with its own default agent (a channel) keeps that default.
|
|
39
|
+
rememberAgent: !sessionId && !boundAgentName && !defaultAgentName,
|
|
35
40
|
projectSession,
|
|
36
41
|
});
|
|
37
42
|
const setAgent = local.agent.set;
|
|
@@ -194,6 +194,13 @@ export declare function planPrefillMerge(input: {
|
|
|
194
194
|
/** `editorRef.current.isEmpty()`. */
|
|
195
195
|
currentIsEmpty: boolean;
|
|
196
196
|
}): JSONContent | null;
|
|
197
|
+
/**
|
|
198
|
+
* `doc` with `text` added to the end of its last paragraph (or in a new
|
|
199
|
+
* paragraph when the last block is not one). Keys typed before the editor
|
|
200
|
+
* existed continue the restored draft this way (`prefill.restoreDraft`).
|
|
201
|
+
* `text` must be non-empty: ProseMirror text nodes cannot be empty.
|
|
202
|
+
*/
|
|
203
|
+
export declare function appendTextToDocument(doc: JSONContent, text: string): JSONContent;
|
|
197
204
|
export interface ShouldApplyPrefillInput {
|
|
198
205
|
/** `prefill?.id` — `undefined` means "no prefill at all". */
|
|
199
206
|
prefillId: number | undefined;
|
|
@@ -194,6 +194,24 @@ export function planPrefillMerge(input) {
|
|
|
194
194
|
const merged = mergeFailedSubmissionDocument(input.currentDoc, input.currentIsEmpty, input.prefillDoc, input.prefillIsEmpty);
|
|
195
195
|
return merged === input.currentDoc ? null : merged;
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* `doc` with `text` added to the end of its last paragraph (or in a new
|
|
199
|
+
* paragraph when the last block is not one). Keys typed before the editor
|
|
200
|
+
* existed continue the restored draft this way (`prefill.restoreDraft`).
|
|
201
|
+
* `text` must be non-empty: ProseMirror text nodes cannot be empty.
|
|
202
|
+
*/
|
|
203
|
+
export function appendTextToDocument(doc, text) {
|
|
204
|
+
const content = [...(doc.content ?? [])];
|
|
205
|
+
const last = content[content.length - 1];
|
|
206
|
+
const node = { type: 'text', text };
|
|
207
|
+
if (last?.type === 'paragraph') {
|
|
208
|
+
content[content.length - 1] = { ...last, content: [...(last.content ?? []), node] };
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
content.push({ type: 'paragraph', content: [node] });
|
|
212
|
+
}
|
|
213
|
+
return { ...doc, type: 'doc', content };
|
|
214
|
+
}
|
|
197
215
|
/**
|
|
198
216
|
* Whether a `prefill` prop should be applied right now.
|
|
199
217
|
*
|
|
@@ -4,21 +4,15 @@ import type { AttachedFile } from './session-chat-input.js';
|
|
|
4
4
|
*
|
|
5
5
|
* - `true` — every in-thread composer. It stays mounted, so it resets in
|
|
6
6
|
* place and revokes the local object URLs nobody references any more.
|
|
7
|
-
* - `'text-only'` —
|
|
8
|
-
* message visibly LEAVES the box, but it revokes
|
|
9
|
-
* URLs are what the
|
|
10
|
-
*
|
|
7
|
+
* - `'text-only'` — a space composer (`space-view.tsx`). It clears like any
|
|
8
|
+
* other composer, so the message visibly LEAVES the box, but it revokes
|
|
9
|
+
* nothing: the same local URLs are what the new thread draws its
|
|
10
|
+
* attachment previews from a moment later.
|
|
11
11
|
* - `false` — a composer that must keep the submitted draft on screen
|
|
12
|
-
* untouched. Nothing clears and nothing is revoked.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* for one reason (the URLs), and the text half was the visible cost: Enter left
|
|
17
|
-
* the sentence sitting in a locked box under a spinner for the whole create
|
|
18
|
-
* round trip (measured 1165ms end to end on localhost, `POST .../sessions`
|
|
19
|
-
* alone 908ms; longer over a real network), which reads as a send that did not
|
|
20
|
-
* happen. Splitting them lets the box empty at the keypress, like everywhere
|
|
21
|
-
* else in the app, with the previews still intact when the shell takes over.
|
|
12
|
+
* untouched. Nothing clears and nothing is revoked. Project home is one:
|
|
13
|
+
* the sent message stays in the locked box under the spinner until the
|
|
14
|
+
* session page opens, so the user sees what is being sent and a refused
|
|
15
|
+
* send leaves the text in place.
|
|
22
16
|
*/
|
|
23
17
|
export type ComposerSendReset = boolean | 'text-only';
|
|
24
18
|
/**
|
|
@@ -94,6 +94,8 @@ export interface ComposerToolbarProps {
|
|
|
94
94
|
leading?: React.ReactNode;
|
|
95
95
|
/** The `chat_input` control holds model and effort: this toolbar draws neither. */
|
|
96
96
|
pickersInChatInput?: boolean;
|
|
97
|
+
/** The agent runs a program (`run`), not a model: this toolbar draws neither model nor effort. */
|
|
98
|
+
noModel?: boolean;
|
|
97
99
|
isSending: boolean;
|
|
98
100
|
isBusy: boolean;
|
|
99
101
|
onStop?: () => void;
|
|
@@ -121,4 +123,4 @@ export interface ComposerToolbarProps {
|
|
|
121
123
|
call?: ComposerCall;
|
|
122
124
|
onSubmit: () => void;
|
|
123
125
|
}
|
|
124
|
-
export declare function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable, attachmentFailed, attachmentUnsupported, call, onSubmit, }: ComposerToolbarProps): import("react").JSX.Element;
|
|
126
|
+
export declare function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput, noModel, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable, attachmentFailed, attachmentUnsupported, call, onSubmit, }: ComposerToolbarProps): import("react").JSX.Element;
|
|
@@ -9,10 +9,10 @@ import Loading from '../../primitives/loading.js';
|
|
|
9
9
|
import { ModelSelector } from '../models/model-selector.js';
|
|
10
10
|
import { ReasoningEffortSelector } from './reasoning-effort-selector.js';
|
|
11
11
|
import { SendStopControl } from './send-stop-control.js';
|
|
12
|
-
export function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput = false, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable = false, attachmentFailed = false, attachmentUnsupported = null, call, onSubmit, }) {
|
|
12
|
+
export function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, pickersInChatInput = false, noModel = false, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable = false, attachmentFailed = false, attachmentUnsupported = null, call, onSubmit, }) {
|
|
13
13
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
14
14
|
const { modelPickerEnabled } = useUiHostConfig();
|
|
15
|
-
const showModel = !pickersInChatInput && modelPickerEnabled && (models.length > 0 || modelRequired) && !!onModelChange;
|
|
15
|
+
const showModel = !noModel && !pickersInChatInput && modelPickerEnabled && (models.length > 0 || modelRequired) && !!onModelChange;
|
|
16
16
|
// Either `/` palette row opens the one merged popover.
|
|
17
17
|
const pickerOpen = modelMenuOpen === undefined && reasoningMenuOpen === undefined
|
|
18
18
|
? undefined
|
|
@@ -22,7 +22,7 @@ export function ComposerToolbar({ models, modelsLoading, selectedModel, onModelC
|
|
|
22
22
|
if (!next)
|
|
23
23
|
onReasoningMenuOpenChange?.(false);
|
|
24
24
|
};
|
|
25
|
-
return (_jsxs("div", { className: "kortix-composer-toolbar flex items-center justify-between gap-1 overflow-visible", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1 overflow-visible", children: [leading, showModel && (_jsx(ModelSelector, { models: models, modelsLoading: modelsLoading, selectedModel: selectedModel, onSelect: onModelChange, providers: providers, defaultControls: modelDefaultControls, triggerLabelClassName: "max-w-[7rem]", projectId: projectId, offerProviderAccounts: true, open: pickerOpen, onOpenChange: onPickerOpenChange, reasoning: { variants, selectedVariant, onVariantChange } })), !showModel && modelPickerEnabled && !pickersInChatInput && _jsx(ReasoningEffortSelector, { variants: variants, selectedVariant: selectedVariant, onVariantChange: onVariantChange, open: reasoningMenuOpen, onOpenChange: onReasoningMenuOpenChange })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [rewind && (_jsxs(HoverCard, { openDelay: 0, closeDelay: 0, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx("span", { className: "inline-flex", children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", disabled: rewind.pending || rewind.disabled, onClick: rewind.onRestore, className: "text-muted-foreground hover:text-foreground gap-1.5", children: [rewind.pending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(ArrowCounterClockwiseIcon, { className: "size-3.5 shrink-0" })), tI18nComplete.raw('texta76e13b98392')] }) }) }), _jsx(HoverCardContent, { className: "px-3 py-2 text-sm text-balance", children: rewind.disabled && !rewind.pending
|
|
25
|
+
return (_jsxs("div", { className: "kortix-composer-toolbar flex items-center justify-between gap-1 overflow-visible", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1 overflow-visible", children: [leading, showModel && (_jsx(ModelSelector, { models: models, modelsLoading: modelsLoading, selectedModel: selectedModel, onSelect: onModelChange, providers: providers, defaultControls: modelDefaultControls, triggerLabelClassName: "max-w-[7rem]", projectId: projectId, offerProviderAccounts: true, open: pickerOpen, onOpenChange: onPickerOpenChange, reasoning: { variants, selectedVariant, onVariantChange } })), !showModel && !noModel && modelPickerEnabled && !pickersInChatInput && _jsx(ReasoningEffortSelector, { variants: variants, selectedVariant: selectedVariant, onVariantChange: onVariantChange, open: reasoningMenuOpen, onOpenChange: onReasoningMenuOpenChange })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [rewind && (_jsxs(HoverCard, { openDelay: 0, closeDelay: 0, children: [_jsx(HoverCardTrigger, { asChild: true, children: _jsx("span", { className: "inline-flex", children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", disabled: rewind.pending || rewind.disabled, onClick: rewind.onRestore, className: "text-muted-foreground hover:text-foreground gap-1.5", children: [rewind.pending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(ArrowCounterClockwiseIcon, { className: "size-3.5 shrink-0" })), tI18nComplete.raw('texta76e13b98392')] }) }) }), _jsx(HoverCardContent, { className: "px-3 py-2 text-sm text-balance", children: rewind.disabled && !rewind.pending
|
|
26
26
|
? tI18nComplete.raw('text98433e61649a')
|
|
27
27
|
: tI18nComplete.raw('text4c25090df9ea') })] })), toolbarSlot, _jsx(SendStopControl, { isSending: isSending, isBusy: isBusy, onStop: onStop, stopDisabled: stopDisabled, canStop: canStop, escCount: escCount, lockForQuestion: lockForQuestion, questionButtonLabel: questionButtonLabel, submitLabel: submitLabel, questionCanAct: questionCanAct, hasText: hasText, canSubmit: canSubmit, submitDisabled: submitDisabled, disabled: disabled, modelUnavailable: modelUnavailable, agentUnavailable: agentUnavailable, attachmentFailed: attachmentFailed, attachmentUnsupported: attachmentUnsupported, call: call, onSubmit: onSubmit })] })] }));
|
|
28
28
|
}
|
|
@@ -205,6 +205,13 @@ export interface SessionChatInputProps {
|
|
|
205
205
|
id: number;
|
|
206
206
|
files?: AttachedFile[];
|
|
207
207
|
mode?: 'replace' | 'merge';
|
|
208
|
+
/**
|
|
209
|
+
* Restore the saved draft first, then merge this text after it. Only the
|
|
210
|
+
* home typing buffer sets it (`use-home-typing-buffer.ts`): keys typed
|
|
211
|
+
* while the page loaded continue the draft. Any other prefill still wins
|
|
212
|
+
* over the draft.
|
|
213
|
+
*/
|
|
214
|
+
restoreDraft?: boolean;
|
|
208
215
|
/**
|
|
209
216
|
* Submit the prefill once it has landed, exactly as if the person pressed
|
|
210
217
|
* Enter. For one-click starters (the first chat's "Update memory"): the
|
|
@@ -363,8 +370,8 @@ export interface SessionChatInputProps {
|
|
|
363
370
|
*
|
|
364
371
|
* The gutter is equal on both sides. It used to carry `md:pr-1`, a right-side
|
|
365
372
|
* trim against the collapsed action-panel chevron rail, which then took ~37px
|
|
366
|
-
* of the row's width.
|
|
367
|
-
* `session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
|
|
373
|
+
* of the row's width. Collapsed, the column now takes no width at all
|
|
374
|
+
* (`session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
|
|
368
375
|
* right of center. A breakpoint may never ZERO this gutter — zero is what let
|
|
369
376
|
* the card touch the panel divider, and `composer-underbar.test.tsx` guards
|
|
370
377
|
* exactly that line.
|
|
@@ -7,7 +7,7 @@ import { cn } from '../../lib/utils.js';
|
|
|
7
7
|
import { isImageFile } from '../../internal/lib/utils/file-utils.js';
|
|
8
8
|
import { useProjectConfig, usePromptAttachments, useRuntimeSessions } from '@kortix/sdk/react';
|
|
9
9
|
import { useActiveSpace } from '../../internal/stores/active-space-store.js';
|
|
10
|
-
import { newPastedContentId, splitPastedContent, trimPastedText } from '../../_vendor/kortix-shared.js';
|
|
10
|
+
import { agentDisplayName, newPastedContentId, splitPastedContent, trimPastedText } from '../../_vendor/kortix-shared.js';
|
|
11
11
|
import { memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
12
12
|
import { extractClipboardFiles } from './clipboard-files.js';
|
|
13
13
|
import { mergeFailedSubmissionFiles } from './composer-draft-recovery.js';
|
|
@@ -25,7 +25,7 @@ import { ComposerCard } from './ComposerCard.js';
|
|
|
25
25
|
import { handleBillingError } from '../../internal/lib/error-handler.js';
|
|
26
26
|
import { attachedFileUploadId, attachmentsBlockSend, captureAttachmentSubmission, dispatchLatched, planAttachmentReplacement, refusedFilesToast, runComposerSend, heldTraySizes, splitComposerFiles, stageComposerFiles, takeNewBillingRefusals, } from './attachment-submission.js';
|
|
27
27
|
import { draftWillRunCommand, planCommandAttachments, planUnresolvedCommandChip, readCommandChipLabel, } from './command-attachments.js';
|
|
28
|
-
import { appendComposerQuote, classifyPaste, isUndoKey, popPasteUndo, extractReplyQuotes, nextPastedTextFileName, planDraftSubmission, planFailedSendRecovery, planPrefillMerge, planQuoteRequests, removeComposerQuote, resolveEditorPlaceholder, restoreComposerQuotes, shouldApplyPrefill, shouldSubmitPrefill, shouldSubmitWhenReady, textToDocument, } from './composer-logic.js';
|
|
28
|
+
import { appendComposerQuote, classifyPaste, isUndoKey, popPasteUndo, extractReplyQuotes, nextPastedTextFileName, planDraftSubmission, planFailedSendRecovery, planPrefillMerge, appendTextToDocument, planQuoteRequests, removeComposerQuote, resolveEditorPlaceholder, restoreComposerQuotes, shouldApplyPrefill, shouldSubmitPrefill, shouldSubmitWhenReady, textToDocument, } from './composer-logic.js';
|
|
29
29
|
import { getContextUsage } from './context-ring.js';
|
|
30
30
|
import { useComposerFocus } from './hooks/use-composer-focus.js';
|
|
31
31
|
import { useMenuRevalidation } from './hooks/use-file-search.js';
|
|
@@ -64,8 +64,8 @@ import { createSubmitLatch } from './submit-latch.js';
|
|
|
64
64
|
*
|
|
65
65
|
* The gutter is equal on both sides. It used to carry `md:pr-1`, a right-side
|
|
66
66
|
* trim against the collapsed action-panel chevron rail, which then took ~37px
|
|
67
|
-
* of the row's width.
|
|
68
|
-
* `session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
|
|
67
|
+
* of the row's width. Collapsed, the column now takes no width at all
|
|
68
|
+
* (`session-action-panel-column.tsx`), so the trim only shifted the card 5.5px
|
|
69
69
|
* right of center. A breakpoint may never ZERO this gutter — zero is what let
|
|
70
70
|
* the card touch the panel divider, and `composer-underbar.test.tsx` guards
|
|
71
71
|
* exactly that line.
|
|
@@ -199,7 +199,7 @@ function ComposerImpl(props) {
|
|
|
199
199
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
200
200
|
useMenuRevalidation(menuOpen, projectId);
|
|
201
201
|
const fileInputRef = useRef(null);
|
|
202
|
-
const { takeFiles, modelPickerEnabled, contextMeterEnabled, runtimeSlashEnabled, useSlashActions } = useUiHostConfig();
|
|
202
|
+
const { takeFiles, modelPickerEnabled, contextMeterEnabled, runtimeSlashEnabled, useSlashActions, agentLabels } = useUiHostConfig();
|
|
203
203
|
// The host's own `/` rows. The config is fixed for the app's life, so the hook is the same one every render.
|
|
204
204
|
const hostSlashRows = (useSlashActions ?? useNoSlashActions)();
|
|
205
205
|
// A host that hides the harness lists none of its commands, and a typed "/init" stays text.
|
|
@@ -310,7 +310,7 @@ function ComposerImpl(props) {
|
|
|
310
310
|
quotes: quoteTexts,
|
|
311
311
|
pastes,
|
|
312
312
|
uploads: draftUploads,
|
|
313
|
-
hasPrefill: !!prefill,
|
|
313
|
+
hasPrefill: !!prefill && !prefill.restoreDraft,
|
|
314
314
|
onRestore: handleDraftRestore,
|
|
315
315
|
});
|
|
316
316
|
/**
|
|
@@ -743,11 +743,14 @@ function ComposerImpl(props) {
|
|
|
743
743
|
const prefillText = prefill?.text ?? '';
|
|
744
744
|
const prefillFiles = prefill?.files;
|
|
745
745
|
const prefillMode = prefill?.mode;
|
|
746
|
+
const prefillRestoreDraft = prefill?.restoreDraft === true;
|
|
746
747
|
const prefillSubmit = prefill?.submit === true;
|
|
747
748
|
// `handleSubmit` is declared further down; the prefill effect reaches it
|
|
748
749
|
// through this ref, bound in an effect right after that declaration.
|
|
749
750
|
const handleSubmitRef = useRef(() => undefined);
|
|
750
751
|
const submittedPrefillIdRef = useRef(null);
|
|
752
|
+
// An append is not idempotent: each `restoreDraft` prefill lands once.
|
|
753
|
+
const appendedPrefillIdRef = useRef(null);
|
|
751
754
|
// The prefill id that landed in the editor: `'when-ready'` submits only after it.
|
|
752
755
|
const [landedPrefillId, setLandedPrefillId] = useState(null);
|
|
753
756
|
const onPrefillAppliedRef = useRef(onPrefillApplied);
|
|
@@ -774,7 +777,17 @@ function ComposerImpl(props) {
|
|
|
774
777
|
const quoted = extractReplyQuotes(prefillText);
|
|
775
778
|
const pasted = splitPastedContent(quoted.text);
|
|
776
779
|
const incoming = { quotes: quoted.quotes, text: pasted.text };
|
|
777
|
-
if (
|
|
780
|
+
if (prefillRestoreDraft) {
|
|
781
|
+
// Keys typed while the page loaded continue the restored draft, at its
|
|
782
|
+
// end, where the caret lands (`setDocument` focuses the end). The draft
|
|
783
|
+
// is already in the editor: `useComposerDraft`'s restore effect is
|
|
784
|
+
// declared above this one, so it runs first in the same commit.
|
|
785
|
+
if (incoming.text && appendedPrefillIdRef.current !== prefillId) {
|
|
786
|
+
appendedPrefillIdRef.current = prefillId;
|
|
787
|
+
editorRef.current?.setDocument(appendTextToDocument(editorRef.current?.getDocument() ?? EMPTY_DOCUMENT, incoming.text));
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
else if (prefillMode === 'merge') {
|
|
778
791
|
const merged = planPrefillMerge({
|
|
779
792
|
prefillDoc: textToDocument(incoming.text),
|
|
780
793
|
prefillIsEmpty: incoming.text.length === 0,
|
|
@@ -850,6 +863,7 @@ function ComposerImpl(props) {
|
|
|
850
863
|
prefillText,
|
|
851
864
|
prefillFiles,
|
|
852
865
|
prefillMode,
|
|
866
|
+
prefillRestoreDraft,
|
|
853
867
|
prefillSubmit,
|
|
854
868
|
editorElement,
|
|
855
869
|
addPromptAttachments,
|
|
@@ -966,7 +980,8 @@ function ComposerImpl(props) {
|
|
|
966
980
|
});
|
|
967
981
|
return available.map((action) => {
|
|
968
982
|
if (action.id === 'switch-agent' && selectedAgent) {
|
|
969
|
-
|
|
983
|
+
// The name the agent chip shows, not the slug.
|
|
984
|
+
return { ...action, value: agentLabels?.[selectedAgent] ?? agentDisplayName(selectedAgent, agents.find((a) => a.name === selectedAgent)?.title) };
|
|
970
985
|
}
|
|
971
986
|
// The ring icon (via `context`) plus the reading as the row's
|
|
972
987
|
// "current setting" text — same grammar as the agent row's value.
|
|
@@ -976,7 +991,7 @@ function ComposerImpl(props) {
|
|
|
976
991
|
return action;
|
|
977
992
|
}).concat(hostSlashActions(hostSlashRows));
|
|
978
993
|
}, [
|
|
979
|
-
selectedAgent, canSwitchAgent, onCompactClick, onContextClick, contextUsage, tI18nComplete,
|
|
994
|
+
selectedAgent, agents, agentLabels, canSwitchAgent, onCompactClick, onContextClick, contextUsage, tI18nComplete,
|
|
980
995
|
modelPickerEnabled, contextMeterEnabled, runtimeSlashEnabled, hostSlashRows,
|
|
981
996
|
]);
|
|
982
997
|
const handleSelectAction = useCallback((action) => {
|
|
@@ -354,6 +354,9 @@ export const ComposerEditor = forwardRef(function ComposerEditor({ placeholder,
|
|
|
354
354
|
role: 'textbox',
|
|
355
355
|
'aria-multiline': 'true',
|
|
356
356
|
'aria-label': t('messageInput'),
|
|
357
|
+
// A locale-free hook for code outside the composer that must know
|
|
358
|
+
// the editor exists (`use-home-typing-buffer.ts` in apps/web).
|
|
359
|
+
'data-composer-editor': '',
|
|
357
360
|
/**
|
|
358
361
|
* `min-h-[3.5em]` — taller than one line by design. History: was
|
|
359
362
|
* `1.5em` (exactly one line) on the reasoning that a taller floor
|
|
@@ -400,10 +403,9 @@ export const ComposerEditor = forwardRef(function ComposerEditor({ placeholder,
|
|
|
400
403
|
* dev.kortix.com: clear at T, phantom write at T+406ms, and the next
|
|
401
404
|
* visit to project home restored "Hi" into the composer.
|
|
402
405
|
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
* debounce away from the same bug.
|
|
406
|
+
* Project home keeps the sent text in the locked box again, so this
|
|
407
|
+
* guard is what keeps the message out of the saved draft. Every composer
|
|
408
|
+
* that flips `disabled` mid-send is one debounce away from the same bug.
|
|
407
409
|
*
|
|
408
410
|
* The view still refreshes — `setOptions` calls `view.updateState`
|
|
409
411
|
* whether or not the event is emitted.
|
|
@@ -13,7 +13,17 @@ import type { QueryKey } from '@tanstack/react-query';
|
|
|
13
13
|
* across a session switch must stop reusing its pre-switch entry the moment
|
|
14
14
|
* the active sandbox changes — `server` is what makes both true.
|
|
15
15
|
*/
|
|
16
|
-
export declare const composerFileSearchKey: (server: string, query: string) => readonly ["web", "composer", "file-search", string, string];
|
|
16
|
+
export declare const composerFileSearchKey: (server: string, query: string, workspaceId?: string | null) => readonly ["web", "composer", "file-search", string, string, string | null];
|
|
17
|
+
/**
|
|
18
|
+
* The `@` menu's file rows: the session computer's files first, then the
|
|
19
|
+
* workspace repo's files that the computer does not hold, each path once.
|
|
20
|
+
*
|
|
21
|
+
* The computer's `/workspace` holds no repo unless an agent declares
|
|
22
|
+
* `workspace.repos`, and workspace home has no computer at all. Without the
|
|
23
|
+
* repo rows the menu offered no file there although the placeholder says
|
|
24
|
+
* "Type @ to mention files and agents".
|
|
25
|
+
*/
|
|
26
|
+
export declare function mergeFileResults(runtime: readonly string[], repo: readonly string[]): string[];
|
|
17
27
|
/**
|
|
18
28
|
* Whether a previous query's results may still be shown as placeholder data.
|
|
19
29
|
*
|
|
@@ -28,7 +38,7 @@ export declare const composerFileSearchKey: (server: string, query: string) => r
|
|
|
28
38
|
* never-flash-empty behaviour while a query is merely being retyped, and drops
|
|
29
39
|
* it exactly when the workspace underneath changed.
|
|
30
40
|
*/
|
|
31
|
-
export declare function canKeepPlaceholderFiles(server: string, previousQueryKey: readonly unknown[] | undefined): boolean;
|
|
41
|
+
export declare function canKeepPlaceholderFiles(server: string, previousQueryKey: readonly unknown[] | undefined, workspaceId?: string | null): boolean;
|
|
32
42
|
/**
|
|
33
43
|
* File results for the `@` menu.
|
|
34
44
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { searchWorkspaceFiles } from '../../../files/runtime/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { searchWorkspaceFiles as searchWorkspaceRepoFiles } from '@kortix/sdk';
|
|
5
|
+
import { qk, runtimeKeys, useActiveSandboxProxyContext, useKortixRouteWorkspaceId } from '@kortix/sdk/react';
|
|
5
6
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
6
7
|
import { useDebouncedValue } from './use-debounced-value.js';
|
|
7
8
|
/** Stands in for `serverUrl` before a runtime binds, or on self-hosted local
|
|
@@ -24,11 +25,56 @@ const UNBOUND_SERVER = 'unbound';
|
|
|
24
25
|
* across a session switch must stop reusing its pre-switch entry the moment
|
|
25
26
|
* the active sandbox changes — `server` is what makes both true.
|
|
26
27
|
*/
|
|
27
|
-
export const composerFileSearchKey = (server, query) => ['web', 'composer', 'file-search', server, query];
|
|
28
|
+
export const composerFileSearchKey = (server, query, workspaceId = null) => ['web', 'composer', 'file-search', server, query, workspaceId];
|
|
29
|
+
/** The `server` slot of the repo query's key: the repo is not on a computer. */
|
|
30
|
+
const REPO_SOURCE = 'workspace-repo';
|
|
31
|
+
/** Repo rows the `@` menu asks for. The menu shows 20 file rows at most. */
|
|
32
|
+
const REPO_SEARCH_LIMIT = 20;
|
|
33
|
+
/**
|
|
34
|
+
* The `@` menu's file rows: the session computer's files first, then the
|
|
35
|
+
* workspace repo's files that the computer does not hold, each path once.
|
|
36
|
+
*
|
|
37
|
+
* The computer's `/workspace` holds no repo unless an agent declares
|
|
38
|
+
* `workspace.repos`, and workspace home has no computer at all. Without the
|
|
39
|
+
* repo rows the menu offered no file there although the placeholder says
|
|
40
|
+
* "Type @ to mention files and agents".
|
|
41
|
+
*/
|
|
42
|
+
export function mergeFileResults(runtime, repo) {
|
|
43
|
+
const seen = new Set();
|
|
44
|
+
const merged = [];
|
|
45
|
+
for (const path of [...runtime, ...repo]) {
|
|
46
|
+
const key = path.replace(/^\/workspace\//, '').replace(/^\.\//, '');
|
|
47
|
+
if (!key || seen.has(key))
|
|
48
|
+
continue;
|
|
49
|
+
seen.add(key);
|
|
50
|
+
merged.push(path);
|
|
51
|
+
}
|
|
52
|
+
return merged;
|
|
53
|
+
}
|
|
54
|
+
// replica-local: workspaces whose repo search answered 403 in this tab. A
|
|
55
|
+
// member without file read stops asking on every keystroke.
|
|
56
|
+
const repoSearchDenied = new Set();
|
|
57
|
+
async function searchRepoFiles(workspaceId, query) {
|
|
58
|
+
const q = query.trim();
|
|
59
|
+
if (!workspaceId || !q || repoSearchDenied.has(workspaceId))
|
|
60
|
+
return [];
|
|
61
|
+
// Silent: a member without file read gets a 403 here, and the runtime rows still list.
|
|
62
|
+
try {
|
|
63
|
+
const { results } = await searchWorkspaceRepoFiles(workspaceId, q, { limit: REPO_SEARCH_LIMIT, showErrors: false });
|
|
64
|
+
return results.map((match) => match.path);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (error?.status === 403)
|
|
68
|
+
repoSearchDenied.add(workspaceId);
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
28
72
|
/** Index of `server` inside `composerFileSearchKey`'s tuple. Named rather than
|
|
29
73
|
* inlined so the coupling between the key shape and the placeholder guard
|
|
30
74
|
* below is a single, testable fact instead of a magic `3`. */
|
|
31
75
|
const SERVER_KEY_INDEX = 3;
|
|
76
|
+
/** Index of the workspace id inside `composerFileSearchKey`'s tuple. */
|
|
77
|
+
const WORKSPACE_KEY_INDEX = 5;
|
|
32
78
|
/**
|
|
33
79
|
* Whether a previous query's results may still be shown as placeholder data.
|
|
34
80
|
*
|
|
@@ -43,8 +89,10 @@ const SERVER_KEY_INDEX = 3;
|
|
|
43
89
|
* never-flash-empty behaviour while a query is merely being retyped, and drops
|
|
44
90
|
* it exactly when the workspace underneath changed.
|
|
45
91
|
*/
|
|
46
|
-
export function canKeepPlaceholderFiles(server, previousQueryKey) {
|
|
47
|
-
|
|
92
|
+
export function canKeepPlaceholderFiles(server, previousQueryKey, workspaceId = null) {
|
|
93
|
+
// The repo rows belong to one workspace: a switch to another workspace on
|
|
94
|
+
// the same server (or on no server, `unbound`) drops them too.
|
|
95
|
+
return previousQueryKey?.[SERVER_KEY_INDEX] === server && (previousQueryKey?.[WORKSPACE_KEY_INDEX] ?? null) === workspaceId;
|
|
48
96
|
}
|
|
49
97
|
/**
|
|
50
98
|
* File results for the `@` menu.
|
|
@@ -71,7 +119,11 @@ export function useFileSearch(query, enabled) {
|
|
|
71
119
|
// actually calls never drift apart.
|
|
72
120
|
const { serverUrl } = useActiveSandboxProxyContext();
|
|
73
121
|
const server = serverUrl || UNBOUND_SERVER;
|
|
74
|
-
|
|
122
|
+
// The workspace on screen: its repo is the second source of file rows.
|
|
123
|
+
const workspaceId = useKortixRouteWorkspaceId();
|
|
124
|
+
// Two queries, merged at render: the computer's rows show as soon as they
|
|
125
|
+
// arrive and never wait on the git-backed repo search.
|
|
126
|
+
const runtime = useQuery({
|
|
75
127
|
queryKey: composerFileSearchKey(server, debounced),
|
|
76
128
|
queryFn: () => searchWorkspaceFiles(debounced),
|
|
77
129
|
enabled,
|
|
@@ -91,7 +143,19 @@ export function useFileSearch(query, enabled) {
|
|
|
91
143
|
placeholderData: (previous, previousQuery) => canKeepPlaceholderFiles(server, previousQuery?.queryKey) ? previous : undefined,
|
|
92
144
|
retry: false,
|
|
93
145
|
});
|
|
94
|
-
|
|
146
|
+
const repo = useQuery({
|
|
147
|
+
queryKey: composerFileSearchKey(REPO_SOURCE, debounced, workspaceId),
|
|
148
|
+
queryFn: () => searchRepoFiles(workspaceId, debounced),
|
|
149
|
+
enabled: enabled && Boolean(workspaceId) && debounced.trim().length > 0,
|
|
150
|
+
staleTime: 30_000,
|
|
151
|
+
gcTime: 5 * 60_000,
|
|
152
|
+
// The same guard, scoped to the workspace: its repo rows never outlive a switch.
|
|
153
|
+
placeholderData: (previous, previousQuery) => canKeepPlaceholderFiles(REPO_SOURCE, previousQuery?.queryKey, workspaceId) ? previous : undefined,
|
|
154
|
+
retry: false,
|
|
155
|
+
});
|
|
156
|
+
const files = useMemo(() => mergeFileResults(runtime.data ?? [], repo.data ?? []), [runtime.data, repo.data]);
|
|
157
|
+
const isLoading = (runtime.isFetching && !runtime.data) || (repo.isFetching && !repo.data);
|
|
158
|
+
return { files, isLoading };
|
|
95
159
|
}
|
|
96
160
|
/**
|
|
97
161
|
* The pure decision at the heart of `useMenuRevalidation`, below: given the
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { agentDisplayName } from '../../../_vendor/kortix-shared.js';
|
|
1
2
|
import { translateUiCatalogText } from '../../../i18n/ui-catalog/localize-ui-catalog.js';
|
|
2
3
|
import { REMAINING_UI_TRANSLATION_KEYS } from '../../../i18n/ui-catalog/remaining-ui-translation-keys.generated.js';
|
|
3
4
|
export function formatRelativeTime(timestamp, now) {
|
|
@@ -53,9 +54,12 @@ export function buildMentionSections({ agents, sessions, files, query, currentSe
|
|
|
53
54
|
// something to fold into this refactor — see the pinning test below.
|
|
54
55
|
const agentRows = [];
|
|
55
56
|
for (const a of agents) {
|
|
56
|
-
|
|
57
|
+
const name = a.name || '';
|
|
58
|
+
// The row reads the name every other surface shows; the slug stays the value.
|
|
59
|
+
const label = name ? agentDisplayName(name, a.title) : '';
|
|
60
|
+
if (!name.toLowerCase().includes(q) && !label.toLowerCase().includes(q))
|
|
57
61
|
continue;
|
|
58
|
-
agentRows.push({ index: index++, kind: 'agent', label
|
|
62
|
+
agentRows.push({ index: index++, kind: 'agent', label, value: name });
|
|
59
63
|
}
|
|
60
64
|
if (agentRows.length)
|
|
61
65
|
sections.push({ kind: 'agent', heading: heading('Agents'), items: agentRows });
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
* look like it was doing something while changing nothing. The z-index belongs
|
|
14
14
|
* on the mounted element itself and is set in `mount.ts`.
|
|
15
15
|
*/
|
|
16
|
-
export declare function MenuCard({ className, children, }: {
|
|
16
|
+
export declare function MenuCard({ className, children, cardRef, style, }: {
|
|
17
17
|
className?: string;
|
|
18
18
|
children: React.ReactNode;
|
|
19
|
+
cardRef?: React.Ref<HTMLDivElement>;
|
|
20
|
+
style?: React.CSSProperties;
|
|
19
21
|
}): import("react").JSX.Element;
|
|
20
22
|
/** Section label above a group of rows ("Skills", "Agents", "Connectors"). */
|
|
21
23
|
export declare function MenuSectionHeading({ children }: {
|
|
@@ -17,8 +17,8 @@ import { useEffect, useRef } from 'react';
|
|
|
17
17
|
* look like it was doing something while changing nothing. The z-index belongs
|
|
18
18
|
* on the mounted element itself and is set in `mount.ts`.
|
|
19
19
|
*/
|
|
20
|
-
export function MenuCard({ className, children, }) {
|
|
21
|
-
return (_jsx("div", { className: cn('bg-popover text-popover-foreground overflow-hidden rounded-md border shadow-md', className), children: children }));
|
|
20
|
+
export function MenuCard({ className, children, cardRef, style, }) {
|
|
21
|
+
return (_jsx("div", { ref: cardRef, style: style, className: cn('bg-popover text-popover-foreground overflow-hidden rounded-md border shadow-md', className), children: children }));
|
|
22
22
|
}
|
|
23
23
|
/** Section label above a group of rows ("Skills", "Agents", "Connectors"). */
|
|
24
24
|
export function MenuSectionHeading({ children }) {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { SlashRow, SlashSection } from './slash-items.js';
|
|
2
|
+
/**
|
|
3
|
+
* The height left between the card's top edge and the viewport bottom, so a
|
|
4
|
+
* menu docked BELOW the composer (workspace home) never runs past the window.
|
|
5
|
+
* At 1440×900 the home menu ended at y 906. A menu docked above the composer
|
|
6
|
+
* always has the composer below it, so the cap never bites there.
|
|
7
|
+
*/
|
|
8
|
+
export declare function fitHeightBelow(top: number, viewportHeight: number): number;
|
|
2
9
|
/**
|
|
3
10
|
* The `/` palette.
|
|
4
11
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useLayoutEffect, useRef, useState } from 'react';
|
|
3
4
|
import { Kbd } from '../../../primitives/kbd.js';
|
|
4
5
|
import { getFileIcon } from '../../../files/project/components/file-icon.js';
|
|
5
6
|
import { cn } from '../../../lib/utils.js';
|
|
@@ -67,6 +68,50 @@ function SlashRowIcon({ row, heading, className, }) {
|
|
|
67
68
|
return _jsx(PlugsConnectedIcon, { className: className });
|
|
68
69
|
return _jsx(TerminalWindowIcon, { className: className });
|
|
69
70
|
}
|
|
71
|
+
/** Space kept between the menu's bottom edge and the viewport's bottom edge. */
|
|
72
|
+
const VIEWPORT_GAP_PX = 8;
|
|
73
|
+
/** The menu never shrinks below this: a few rows stay usable on a short window. */
|
|
74
|
+
const MIN_FIT_PX = 120;
|
|
75
|
+
/**
|
|
76
|
+
* The height left between the card's top edge and the viewport bottom, so a
|
|
77
|
+
* menu docked BELOW the composer (workspace home) never runs past the window.
|
|
78
|
+
* At 1440×900 the home menu ended at y 906. A menu docked above the composer
|
|
79
|
+
* always has the composer below it, so the cap never bites there.
|
|
80
|
+
*/
|
|
81
|
+
export function fitHeightBelow(top, viewportHeight) {
|
|
82
|
+
return Math.max(MIN_FIT_PX, Math.floor(viewportHeight - top - VIEWPORT_GAP_PX));
|
|
83
|
+
}
|
|
84
|
+
function useViewportFitHeight(mounted) {
|
|
85
|
+
const cardRef = useRef(null);
|
|
86
|
+
const [maxHeight, setMaxHeight] = useState(null);
|
|
87
|
+
useLayoutEffect(() => {
|
|
88
|
+
const measure = () => {
|
|
89
|
+
const el = cardRef.current;
|
|
90
|
+
if (!el || !el.isConnected)
|
|
91
|
+
return;
|
|
92
|
+
const next = fitHeightBelow(el.getBoundingClientRect().top, window.innerHeight);
|
|
93
|
+
setMaxHeight((prev) => (prev === next ? prev : next));
|
|
94
|
+
};
|
|
95
|
+
measure();
|
|
96
|
+
// The suggestion plugin renders this card BEFORE it appends it to the dock
|
|
97
|
+
// (`mountDockedMenu`), so the first measure sees a detached node at top 0.
|
|
98
|
+
// The observer fires once the card has layout in the dock; the frame is
|
|
99
|
+
// the fallback where ResizeObserver does not exist.
|
|
100
|
+
const frame = window.requestAnimationFrame(measure);
|
|
101
|
+
const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure);
|
|
102
|
+
if (cardRef.current)
|
|
103
|
+
observer?.observe(cardRef.current);
|
|
104
|
+
window.addEventListener('resize', measure);
|
|
105
|
+
window.addEventListener('scroll', measure, { capture: true, passive: true });
|
|
106
|
+
return () => {
|
|
107
|
+
window.cancelAnimationFrame(frame);
|
|
108
|
+
observer?.disconnect();
|
|
109
|
+
window.removeEventListener('resize', measure);
|
|
110
|
+
window.removeEventListener('scroll', measure, { capture: true });
|
|
111
|
+
};
|
|
112
|
+
}, [mounted]);
|
|
113
|
+
return { cardRef, maxHeight };
|
|
114
|
+
}
|
|
70
115
|
/**
|
|
71
116
|
* The `/` palette.
|
|
72
117
|
*
|
|
@@ -106,6 +151,8 @@ function SlashRowIcon({ row, heading, className, }) {
|
|
|
106
151
|
*/
|
|
107
152
|
export function SlashMenu({ sections, selectedIndex, onSelect, onHover, }) {
|
|
108
153
|
const t = useTranslations('sessionUi.composerMenus');
|
|
154
|
+
// The list card mounts only when a section exists: measure again when it does.
|
|
155
|
+
const { cardRef, maxHeight } = useViewportFitHeight(sections.length > 0);
|
|
109
156
|
// A query that matches nothing keeps the card, with one dead row saying so.
|
|
110
157
|
// Returning `null` made the palette DISAPPEAR mid-word — the user could not
|
|
111
158
|
// tell "no match" from "the menu closed", and one backspace brought it back
|
|
@@ -123,7 +170,7 @@ export function SlashMenu({ sections, selectedIndex, onSelect, onHover, }) {
|
|
|
123
170
|
const activeUsage = active && active.row.type === 'action' && active.row.action?.id === 'show-context'
|
|
124
171
|
? active.row.action.context
|
|
125
172
|
: undefined;
|
|
126
|
-
return (_jsxs(MenuCard, { className: cn('mb-2.5 flex max-h-96 w-full overflow-hidden rounded-lg shadow-xs'), children: [_jsx("div", { role: "listbox", "aria-label": t('commandsAndActions'), "aria-activedescendant": `slash-row-${selectedIndex}`,
|
|
173
|
+
return (_jsxs(MenuCard, { cardRef: cardRef, style: maxHeight === null ? undefined : { maxHeight: `min(calc(var(--spacing) * 96), ${maxHeight}px)` }, className: cn('mb-2.5 flex max-h-96 w-full overflow-hidden rounded-lg shadow-xs'), children: [_jsx("div", { role: "listbox", "aria-label": t('commandsAndActions'), "aria-activedescendant": `slash-row-${selectedIndex}`,
|
|
127
174
|
// `-1`, matching `mention-menu.tsx`: focusable for AT, but never a tab
|
|
128
175
|
// stop. Keyboard interaction stays in the composer editor, which
|
|
129
176
|
// proxies arrow/Enter to this listbox — a real tab stop here trapped
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { onlineManager } from '@tanstack/react-query';
|
|
4
|
+
import { errorToast, infoToast } from '../../primitives/toast.js';
|
|
4
5
|
import { isFirstPromptRow } from './queue-projection.js';
|
|
5
6
|
import { promptFileParts, sentAttachmentsOf } from './uploaded-file-refs.js';
|
|
6
7
|
import { firstPromptAttachments, } from './sent-attachment-previews.js';
|
|
@@ -321,6 +322,7 @@ export function useInstantSessionSend(props) {
|
|
|
321
322
|
const { projectId, sessionId, hydrated, onSubmit, promptInbox } = props;
|
|
322
323
|
const tI18nHardcoded = useTranslations('hardcodedUi');
|
|
323
324
|
const tComposerAttachments = useTranslations('hardcodedUi.composerAttachments');
|
|
325
|
+
const tThreads = useTranslations('threads');
|
|
324
326
|
const { submission, setSubmission, extraSends, setExtraSends, firstSendInFlight, mountedRef } = useSendMemory();
|
|
325
327
|
const { submitted, effectiveSubmission } = useFirstPromptSources({
|
|
326
328
|
sessionId,
|
|
@@ -351,6 +353,9 @@ export function useInstantSessionSend(props) {
|
|
|
351
353
|
firstSendInFlight,
|
|
352
354
|
mountedRef,
|
|
353
355
|
};
|
|
356
|
+
// A new session's first prompt has no row on screen to say it waits: say it once.
|
|
357
|
+
if (send.first && !onlineManager.isOnline())
|
|
358
|
+
infoToast(tThreads('notSentYet'));
|
|
354
359
|
paintSend(send, env);
|
|
355
360
|
const post = buildPost(send, env);
|
|
356
361
|
const { detached } = send;
|
|
@@ -369,6 +374,7 @@ export function useInstantSessionSend(props) {
|
|
|
369
374
|
projectId,
|
|
370
375
|
tI18nHardcoded,
|
|
371
376
|
tComposerAttachments,
|
|
377
|
+
tThreads,
|
|
372
378
|
onSubmit,
|
|
373
379
|
promptInbox.enqueue,
|
|
374
380
|
setSubmission,
|