@kortix/ui 0.14.19 → 0.15.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/README.md +1 -1
- package/dist/_vendor/kortix-shared.js +956 -73
- package/dist/_vendor/shared/artifact-annotations.d.ts +85 -607
- package/dist/_vendor/shared/artifact-comments.d.ts +53 -489
- package/dist/_vendor/shared/index.d.ts +0 -1
- package/dist/_vendor/shared/peer-message-prompt.d.ts +7 -1
- package/dist/_vendor/shared/project-glyphs.d.ts +103 -20
- package/dist/_vendor/shared/webhook-signing.d.ts +3 -1
- package/dist/access/access/access-dialog-share.d.ts +3 -28
- package/dist/access/access/access-dialog-share.js +3 -75
- package/dist/artifacts/artifact-frame.js +26 -2
- package/dist/artifacts/artifact-session.js +6 -2
- package/dist/artifacts/frame-policy.d.ts +2 -9
- package/dist/artifacts/frame-policy.js +2 -25
- package/dist/customize/agents/agents-page.js +1 -1
- package/dist/customize/agents/create-agent-modal.js +1 -1
- package/dist/customize/connectors/connector-filter.d.ts +2 -1
- package/dist/customize/connectors/connector-filter.js +2 -3
- package/dist/customize/connectors/connectors-page.js +15 -24
- package/dist/customize/connectors/detail/connector-status.d.ts +3 -24
- package/dist/customize/connectors/detail/connector-status.js +2 -42
- package/dist/customize/connectors/detail/use-connector-detail.d.ts +2 -6
- package/dist/customize/connectors/detail/use-connector-detail.js +3 -13
- package/dist/customize/connectors/install/install.d.ts +2 -6
- package/dist/customize/connectors/install/install.js +2 -16
- package/dist/customize/connectors/provider-label.d.ts +4 -17
- package/dist/customize/connectors/provider-label.js +4 -37
- package/dist/customize/providers/provider-connect.d.ts +6 -15
- package/dist/customize/providers/provider-connect.js +5 -36
- package/dist/customize/sections/connector-connection-form.d.ts +3 -7
- package/dist/customize/sections/connector-connection-form.js +2 -33
- package/dist/customize/sections/connector-oauth2-auto.d.ts +3 -33
- package/dist/customize/sections/connector-oauth2-auto.js +2 -64
- package/dist/customize/sections/gateway-view.d.ts +6 -5
- package/dist/customize/sections/gateway-view.js +31 -13
- package/dist/customize/sections/llm-provider/constants.d.ts +1 -2
- package/dist/customize/sections/llm-provider/constants.js +1 -2
- package/dist/customize/sections/llm-provider/utils.d.ts +1 -41
- package/dist/customize/sections/llm-provider/utils.js +1 -52
- package/dist/customize/sections/view/account-secret-resources-panel.js +4 -1
- package/dist/customize/sections/view/agent-editor-catalog.js +0 -5
- package/dist/customize/sections/view/channel-settings-patch.js +1 -1
- package/dist/customize/sections/view/channels-view.js +8 -8
- package/dist/customize/sections/view/connector-connections.d.ts +5 -85
- package/dist/customize/sections/view/connector-connections.js +5 -99
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +42 -3
- package/dist/customize/sections/view/gateway/gateway-logs.js +212 -15
- package/dist/customize/sections/view/gateway/gateway-overview.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-routing.d.ts +3 -3
- package/dist/customize/sections/view/gateway/gateway-routing.js +81 -200
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +101 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +154 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.d.ts +2 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.js +82 -0
- package/dist/customize/sections/view/review-center-connected.js +17 -15
- package/dist/customize/sections/view/review-view.d.ts +7 -0
- package/dist/customize/sections/view/review-view.js +11 -0
- package/dist/customize/sections/view/secret-delivery.js +1 -1
- package/dist/customize/sections/view/secrets-view.js +1 -1
- package/dist/customize/sections/view/subscription-usage-tab.d.ts +14 -0
- package/dist/customize/sections/view/subscription-usage-tab.js +122 -0
- package/dist/customize/sections/view/subscription-usage.d.ts +34 -0
- package/dist/customize/sections/view/subscription-usage.js +98 -0
- package/dist/customize/settings/tabs/experimental-tab.js +3 -3
- package/dist/customize/settings/tabs/general-tab.js +65 -10
- package/dist/customize/shared/catalog/catalog-card.d.ts +9 -4
- package/dist/customize/shared/catalog/catalog-card.js +3 -3
- package/dist/customize/shared/channels-switch-dialog.d.ts +1 -1
- package/dist/customize/shared/channels-switch-dialog.js +1 -1
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.d.ts +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +1 -1
- package/dist/files/drives/conflict-marks.d.ts +28 -0
- package/dist/files/drives/conflict-marks.js +39 -0
- package/dist/files/drives/session-drives-chip.js +15 -10
- package/dist/files/viewer/index.d.ts +1 -1
- package/dist/files/viewer/index.js +1 -1
- package/dist/i18n/en.d.ts +451 -203
- package/dist/i18n/en.js +543 -295
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/sections.d.ts +1 -1
- package/dist/internal/capture/use-capture-area.d.ts +5 -1
- package/dist/internal/capture/use-capture-area.js +16 -9
- package/dist/internal/goals/goal-meta.d.ts +50 -3
- package/dist/internal/goals/goal-meta.js +144 -9
- package/dist/internal/hooks/connectors/use-add-account.d.ts +3 -9
- package/dist/internal/hooks/connectors/use-add-account.js +3 -18
- package/dist/internal/hooks/connectors/use-connect-link.d.ts +3 -2
- package/dist/internal/hooks/connectors/use-connect-link.js +15 -24
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.d.ts +3 -56
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +3 -87
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +3 -2
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -3
- package/dist/internal/hooks/projects/use-project-can-run.d.ts +7 -0
- package/dist/internal/hooks/projects/use-project-can-run.js +12 -5
- package/dist/internal/hooks/projects/use-restart-project-session.d.ts +0 -1
- package/dist/internal/hooks/projects/use-restart-project-session.js +0 -1
- package/dist/internal/layout/project-capability-nav.js +6 -2
- package/dist/internal/layout/project-page-header.d.ts +3 -1
- package/dist/internal/layout/project-page-header.js +2 -2
- package/dist/internal/lib/account-secret-access.d.ts +1 -41
- package/dist/internal/lib/account-secret-access.js +3 -46
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/expected-states.d.ts +2 -15
- package/dist/internal/lib/browser-noise/rules/expected-states.js +5 -55
- package/dist/internal/lib/capability-tab-routes.d.ts +3 -3
- package/dist/internal/lib/capability-tab-routes.js +11 -3
- package/dist/internal/lib/llm-providers.d.ts +4 -110
- package/dist/internal/lib/llm-providers.js +5 -102
- package/dist/internal/lib/navigation/message-link.d.ts +32 -0
- package/dist/internal/lib/navigation/message-link.js +51 -0
- package/dist/internal/lib/navigation/session-href.d.ts +11 -0
- package/dist/internal/lib/navigation/session-href.js +20 -0
- package/dist/internal/lib/navigation/session-spawn-urls.d.ts +17 -0
- package/dist/internal/lib/navigation/session-spawn-urls.js +26 -0
- package/dist/internal/lib/space-scope.d.ts +3 -3
- package/dist/internal/lib/space-scope.js +3 -3
- package/dist/internal/lib/use-project-feature-flags.js +7 -7
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +0 -3
- package/dist/internal/notifications/notification-bell.js +1 -3
- package/dist/internal/notifications/notification-rows.d.ts +2 -2
- package/dist/internal/notifications/notification-rows.js +2 -3
- package/dist/internal/session-types/index.d.ts +5 -7
- package/dist/internal/session-types/index.js +5 -7
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/active-space-store.js +1 -1
- package/dist/internal/stores/kortix-computer-store.d.ts +15 -0
- package/dist/internal/stores/kortix-computer-store.js +12 -0
- package/dist/lib/routes.d.ts +17 -7
- package/dist/lib/routes.js +18 -2
- package/dist/markdown/app-link-icons.d.ts +7 -0
- package/dist/markdown/app-link-icons.js +20 -0
- package/dist/markdown/app-links.d.ts +9 -0
- package/dist/markdown/app-links.js +112 -0
- package/dist/markdown/doc-editor/doc-attrs.d.ts +28 -0
- package/dist/markdown/doc-editor/doc-attrs.js +156 -0
- package/dist/markdown/doc-editor/doc-embed.d.ts +6 -0
- package/dist/markdown/doc-editor/doc-embed.js +26 -8
- package/dist/markdown/doc-editor/doc-extensions.d.ts +10 -0
- package/dist/markdown/doc-editor/doc-extensions.js +55 -8
- package/dist/markdown/doc-editor/doc-fidelity.d.ts +72 -0
- package/dist/markdown/doc-editor/doc-fidelity.js +135 -0
- package/dist/markdown/doc-editor/doc-node-view.d.ts +9 -0
- package/dist/markdown/doc-editor/doc-node-view.js +29 -0
- package/dist/markdown/doc-editor/markdown.d.ts +20 -0
- package/dist/markdown/doc-editor/markdown.js +455 -18
- package/dist/markdown/unified-markdown.d.ts +1 -1
- package/dist/markdown/unified-markdown.js +129 -10
- package/dist/primitives/emoji-picker.js +16 -100
- package/dist/primitives/emoji-tint.js +12 -12
- package/dist/primitives/entity-avatar.js +14 -9
- package/dist/primitives/glyph-face.d.ts +19 -12
- package/dist/primitives/glyph-face.js +59 -20
- package/dist/primitives/glyph-paths-source.d.ts +7 -0
- package/dist/primitives/glyph-paths-source.js +14 -6
- package/dist/primitives/glyph-paths.generated.d.ts +1 -1
- package/dist/primitives/glyph-paths.generated.js +947 -204
- package/dist/primitives/glyph-picker.d.ts +6 -10
- package/dist/primitives/glyph-picker.js +147 -98
- package/dist/primitives/glyph-registry.js +1604 -1
- package/dist/primitives/glyph-tint.d.ts +28 -3
- package/dist/primitives/glyph-tint.js +41 -83
- package/dist/primitives/kortix-glyphs.d.ts +32 -0
- package/dist/primitives/kortix-glyphs.js +157 -0
- package/dist/primitives/project-icon-picker.d.ts +8 -1
- package/dist/primitives/project-icon-picker.js +13 -5
- package/dist/primitives/user-avatar.d.ts +8 -1
- package/dist/primitives/user-avatar.js +2 -2
- package/dist/providers/ui-provider.d.ts +1 -8
- package/dist/session/actions/project-session-list-helpers.js +1 -1
- package/dist/session/agents/agent-model.js +4 -0
- package/dist/session/agents/agent-state-mark.d.ts +12 -7
- package/dist/session/agents/agent-state-mark.js +37 -15
- package/dist/session/agents/agent-strip.js +8 -2
- package/dist/session/agents/agent-surface.d.ts +81 -0
- package/dist/session/agents/agent-surface.js +97 -0
- package/dist/session/agents/held-messages.js +7 -4
- package/dist/session/agents/legacy-subagent-chat.js +1 -1
- package/dist/session/agents/session-peek.js +24 -12
- package/dist/session/agents/steer-session.d.ts +2 -0
- package/dist/session/agents/steer-session.js +3 -2
- package/dist/session/agents/subagent-dialog-content.d.ts +30 -1
- package/dist/session/agents/subagent-dialog-content.js +147 -33
- package/dist/session/agents/subagent-view.d.ts +15 -5
- package/dist/session/agents/subagent-view.js +28 -6
- package/dist/session/agents/tasks-panel.js +2 -12
- package/dist/session/agents/workflow-run-controls.d.ts +3 -1
- package/dist/session/agents/workflow-run-controls.js +12 -7
- package/dist/session/composer/ComposerCard.d.ts +7 -1
- package/dist/session/composer/ComposerCard.js +74 -9
- package/dist/session/composer/agent-selector.d.ts +16 -0
- package/dist/session/composer/agent-selector.js +19 -11
- package/dist/session/composer/chat-input/chat-input-control.d.ts +64 -0
- package/dist/session/composer/chat-input/chat-input-control.js +578 -0
- package/dist/session/composer/chat-input/chat-input-overrides.d.ts +76 -0
- package/dist/session/composer/chat-input/chat-input-overrides.js +40 -0
- package/dist/session/composer/chat-input/chat-input-panes.d.ts +56 -0
- package/dist/session/composer/chat-input/chat-input-panes.js +148 -0
- package/dist/session/composer/chat-input/chat-input-summary.d.ts +67 -0
- package/dist/session/composer/chat-input/chat-input-summary.js +67 -0
- package/dist/session/composer/chat-queue-lines.d.ts +20 -0
- package/dist/session/composer/chat-queue-lines.js +20 -0
- package/dist/session/composer/composer-chat-input.d.ts +8 -1
- package/dist/session/composer/composer-chat-input.js +12 -4
- package/dist/session/composer/composer-focus-context.d.ts +7 -0
- package/dist/session/composer/composer-focus-context.js +9 -0
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer-underbar.d.ts +10 -1
- package/dist/session/composer/composer-underbar.js +10 -2
- package/dist/session/composer/composer.d.ts +12 -0
- package/dist/session/composer/composer.js +55 -1
- package/dist/session/composer/editor/composer-editor.d.ts +10 -2
- package/dist/session/composer/editor/composer-editor.js +22 -6
- package/dist/session/composer/editor/first-visual-line.d.ts +2 -0
- package/dist/session/composer/editor/first-visual-line.js +9 -0
- package/dist/session/composer/editor/mention-node.js +2 -0
- package/dist/session/composer/editor/serialize.js +9 -1
- package/dist/session/composer/hooks/use-file-search.d.ts +1 -1
- package/dist/session/composer/hooks/use-file-search.js +1 -1
- package/dist/session/composer/menus/mention-controller.d.ts +3 -11
- package/dist/session/composer/menus/mention-controller.js +56 -16
- package/dist/session/composer/menus/mention-menu.d.ts +7 -2
- package/dist/session/composer/menus/mention-menu.js +17 -9
- package/dist/session/composer/menus/menu-items.d.ts +9 -0
- package/dist/session/composer/menus/space-mentions.d.ts +48 -0
- package/dist/session/composer/menus/space-mentions.js +83 -0
- package/dist/session/composer/prompt-history.d.ts +9 -0
- package/dist/session/composer/prompt-history.js +45 -0
- package/dist/session/composer/queue-projection.d.ts +2 -0
- package/dist/session/composer/queue-projection.js +1 -0
- package/dist/session/composer/queued-prompt-list.js +53 -4
- package/dist/session/composer/reasoning-effort-selector.d.ts +20 -0
- package/dist/session/composer/reasoning-effort-selector.js +3 -3
- package/dist/session/composer/types.d.ts +2 -1
- package/dist/session/header/session-site-header.js +7 -3
- package/dist/session/header/subagent-hover-card.d.ts +7 -4
- package/dist/session/header/subagent-hover-card.js +62 -11
- package/dist/session/list/session-status-mark.d.ts +42 -0
- package/dist/{workspace/sidebar → session/list}/session-status-mark.js +37 -2
- package/dist/session/models/model-selector.d.ts +7 -2
- package/dist/session/models/model-selector.js +39 -31
- package/dist/session/overrides/provider-secret-pool-editor.d.ts +11 -0
- package/dist/session/overrides/provider-secret-pool-editor.js +17 -0
- package/dist/session/overrides/session-overrides-control.d.ts +5 -0
- package/dist/session/overrides/session-overrides-toolbar.js +147 -7
- package/dist/session/panel/model-switch-event.d.ts +8 -0
- package/dist/session/panel/model-switch-event.js +19 -0
- package/dist/session/panel/session-audit-panel.js +3 -2
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-panel-provider.js +1 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +21 -2
- package/dist/session/prompts/ask-deck.d.ts +21 -0
- package/dist/session/prompts/ask-deck.js +253 -0
- package/dist/session/prompts/session-permission-prompt.d.ts +7 -1
- package/dist/session/prompts/session-permission-prompt.js +3 -3
- package/dist/session/status/session-load-state.d.ts +0 -1
- package/dist/session/status/session-load-state.js +2 -4
- package/dist/session/thread/message-parsing.d.ts +0 -1
- package/dist/session/thread/message-parsing.js +0 -1
- package/dist/session/thread/session-chat.d.ts +3 -1
- package/dist/session/thread/session-chat.js +459 -310
- package/dist/session/thread/session-context-metrics.d.ts +0 -1
- package/dist/session/thread/session-context-metrics.js +1 -1
- package/dist/session/thread/session-context-sub-sessions.js +3 -1
- package/dist/session/thread/show-work.d.ts +38 -0
- package/dist/session/thread/show-work.js +115 -0
- package/dist/session/thread/thread-boot-rows.d.ts +2 -1
- package/dist/session/thread/thread-boot-rows.js +7 -3
- package/dist/session/thread/transcript-rows.d.ts +36 -0
- package/dist/session/thread/transcript.d.ts +46 -2
- package/dist/session/thread/transcript.js +226 -34
- package/dist/session/thread/typing-indicator.d.ts +21 -0
- package/dist/session/thread/typing-indicator.js +46 -0
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +12 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +6 -0
- package/dist/session/tool/tool-part-renderer.d.ts +2 -0
- package/dist/session/tool/tool-part-renderer.js +16 -2
- package/dist/session/tool/tools/kortix-action-tool.js +8 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +19 -0
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +34 -13
- package/dist/session/tool/tools/session-spawn-urls.d.ts +1 -16
- package/dist/session/tool/tools/session-spawn-urls.js +4 -26
- package/dist/session/tool/tools/task-tool.d.ts +5 -18
- package/dist/session/tool/tools/task-tool.js +47 -86
- package/dist/session/tool/tools/workflow-progress.d.ts +14 -18
- package/dist/session/tool/tools/workflow-progress.js +24 -179
- package/dist/session/tool/tools/workflow-result-text.d.ts +15 -0
- package/dist/session/tool/tools/workflow-result-text.js +34 -0
- package/dist/session/tool/tools/workflow-run-card.d.ts +35 -0
- package/dist/session/tool/tools/workflow-run-card.js +157 -0
- package/dist/session/tool/tools/workflow-tool.js +45 -58
- package/dist/session/turn/activity-burst.d.ts +2 -2
- package/dist/session/turn/activity-burst.js +11 -5
- package/dist/session/turn/answered-question-step.d.ts +29 -0
- package/dist/session/turn/answered-question-step.js +48 -3
- package/dist/session/turn/notice-batch-group.d.ts +4 -4
- package/dist/session/turn/notice-batch-group.js +5 -8
- package/dist/session/turn/peer-message-row.d.ts +15 -0
- package/dist/session/turn/peer-message-row.js +38 -47
- package/dist/session/turn/subagent-notice-row.d.ts +16 -1
- package/dist/session/turn/subagent-notice-row.js +47 -35
- package/dist/session/turn/throttled-markdown.js +4 -1
- package/dist/session/turn/turn-work-accordion.d.ts +10 -3
- package/dist/session/turn/turn-work-accordion.js +18 -11
- package/dist/session/turn/user-message.js +16 -42
- package/dist/session/turn/voice-turn.d.ts +22 -0
- package/dist/session/turn/voice-turn.js +32 -0
- package/dist/session/voice/call-ring.d.ts +10 -0
- package/dist/session/voice/call-ring.js +52 -0
- package/dist/session/voice/use-voice-call.d.ts +4 -4
- package/dist/session/voice/use-voice-call.js +6 -9
- package/dist/session/voice/voice-call-card.d.ts +6 -0
- package/dist/session/voice/voice-call-card.js +113 -0
- package/dist/session/voice/voice-call-state.d.ts +3 -0
- package/dist/session/voice/voice-call-state.js +2 -1
- package/dist/session/voice/voice-call-store.d.ts +16 -6
- package/dist/session/voice/voice-call-store.js +5 -5
- package/dist/session/voice/voice-call.d.ts +4 -8
- package/dist/session/voice/voice-call.js +33 -36
- package/dist/styles/components.css +33 -0
- package/dist/styles/theme.css +26 -0
- package/dist/styles.css +1 -1
- package/dist/workspace/admin/project-admin-dashboard.d.ts +1 -1
- package/dist/workspace/admin/project-admin-dashboard.js +12 -9
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +2 -1
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +5 -3
- package/dist/workspace/memory/company-memory-page.d.ts +1 -1
- package/dist/workspace/memory/company-memory-page.js +1 -1
- package/dist/workspace/new/use-creatable-accounts.js +13 -4
- package/dist/workspace/projects/modal/project-icon-field.js +49 -34
- package/dist/workspace/review/review-center.d.ts +4 -1
- package/dist/workspace/review/review-center.js +6 -3
- package/dist/workspace/sessions/project-sessions-helpers.js +1 -1
- package/dist/workspace/sessions/project-sessions-view.js +1 -1
- package/dist/workspace/sessions/session-row.js +6 -4
- package/dist/workspace/sessions/sessions-toolbar.d.ts +1 -1
- package/dist/workspace/sessions/sessions-toolbar.js +4 -4
- package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +1 -1
- package/dist/workspace/sidebar/footer/project-memory-nav.js +1 -1
- package/dist/workspace/sidebar/project-nav-items.js +2 -5
- package/dist/workspace/sidebar/project-session-list.d.ts +7 -1
- package/dist/workspace/sidebar/project-session-list.js +63 -24
- package/dist/workspace/sidebar/project-sidebar.js +10 -7
- package/dist/workspace/sidebar/project-spaces-nav.d.ts +7 -3
- package/dist/workspace/sidebar/project-spaces-nav.js +77 -46
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +4 -2
- package/dist/workspace/sidebar/session-brief-hover-card.js +47 -28
- package/dist/workspace/sidebar/session-group-sections.js +12 -4
- package/dist/workspace/sidebar/sidebar-more-group.d.ts +13 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +27 -0
- package/dist/workspace/space/space-blocks.d.ts +3 -1
- package/dist/workspace/space/space-blocks.js +4 -7
- package/dist/workspace/space/space-page.d.ts +4 -6
- package/dist/workspace/space/space-page.js +10 -24
- package/dist/workspace/space/space-tab-panels.d.ts +14 -1
- package/dist/workspace/space/space-tab-panels.js +12 -21
- package/dist/workspace/space/space-templates.d.ts +4 -5
- package/dist/workspace/space/space-templates.js +2 -7
- package/dist/workspace/space/use-space-filter.d.ts +1 -1
- package/dist/workspace/space/use-space-filter.js +1 -1
- package/dist/workspace/spaces/channels-onboarding.d.ts +2 -2
- package/dist/workspace/spaces/channels-onboarding.js +4 -3
- package/dist/workspace/spaces/create-channel-dialog.js +4 -2
- package/dist/workspace/spaces/principal-card.d.ts +71 -0
- package/dist/workspace/spaces/principal-card.js +246 -0
- package/dist/workspace/spaces/space-auto-open.d.ts +8 -0
- package/dist/workspace/spaces/space-auto-open.js +18 -0
- package/dist/workspace/spaces/space-avatar.d.ts +44 -0
- package/dist/workspace/spaces/space-avatar.js +41 -0
- package/dist/workspace/spaces/space-details-panel.d.ts +26 -0
- package/dist/workspace/spaces/space-details-panel.js +119 -0
- package/dist/workspace/spaces/space-identity.d.ts +49 -0
- package/dist/workspace/spaces/space-identity.js +104 -0
- package/dist/workspace/spaces/space-members.js +1 -1
- package/dist/workspace/spaces/space-mention-source.d.ts +12 -0
- package/dist/workspace/spaces/space-mention-source.js +78 -0
- package/dist/workspace/spaces/space-people.d.ts +29 -0
- package/dist/workspace/spaces/space-people.js +87 -0
- package/dist/workspace/spaces/space-roster.d.ts +3 -2
- package/dist/workspace/spaces/space-roster.js +7 -4
- package/dist/workspace/spaces/space-tab-list.d.ts +37 -0
- package/dist/workspace/spaces/space-tab-list.js +82 -0
- package/dist/workspace/spaces/space-tabs.d.ts +74 -0
- package/dist/workspace/spaces/space-tabs.js +199 -0
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/dist/workspace/spaces/space-timeline-view.js +126 -17
- package/dist/workspace/spaces/space-timeline.d.ts +44 -9
- package/dist/workspace/spaces/space-timeline.js +120 -12
- package/dist/workspace/spaces/space-view.d.ts +19 -12
- package/dist/workspace/spaces/space-view.js +201 -67
- package/dist/workspace/spaces/use-personal-space-name.d.ts +2 -0
- package/dist/workspace/spaces/use-personal-space-name.js +10 -0
- package/package.json +11 -7
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +2 -3
- package/skills/kortix-ui/references/modules.md +4 -4
- package/dist/_vendor/shared/room-prompt.d.ts +0 -66
- package/dist/session/voice/voice-call-bar.d.ts +0 -4
- package/dist/session/voice/voice-call-bar.js +0 -39
- package/dist/workspace/sidebar/footer/project-rooms-nav.d.ts +0 -9
- package/dist/workspace/sidebar/footer/project-rooms-nav.js +0 -32
- package/dist/workspace/sidebar/session-status-mark.d.ts +0 -19
- package/dist/workspace/space/space-room.d.ts +0 -20
- package/dist/workspace/space/space-room.js +0 -27
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.d.ts +0 -0
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.js +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useState, useSyncExternalStore } from 'react';
|
|
4
|
+
function createChatInputOverridesStore() {
|
|
5
|
+
let value = null;
|
|
6
|
+
const listeners = new Set();
|
|
7
|
+
return {
|
|
8
|
+
get: () => value,
|
|
9
|
+
set: (next) => {
|
|
10
|
+
value = next;
|
|
11
|
+
for (const listener of listeners)
|
|
12
|
+
listener();
|
|
13
|
+
},
|
|
14
|
+
subscribe: (listener) => {
|
|
15
|
+
listeners.add(listener);
|
|
16
|
+
return () => listeners.delete(listener);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const ChatInputOverridesContext = createContext(null);
|
|
21
|
+
/**
|
|
22
|
+
* Mounted by every composer card; it hands out the store only while
|
|
23
|
+
* `chat_input` is on. Always mounted, so the flag resolving after the first
|
|
24
|
+
* render swaps a context value instead of remounting the card and its editor.
|
|
25
|
+
*/
|
|
26
|
+
export function ChatInputOverridesProvider({ enabled, children }) {
|
|
27
|
+
const [store] = useState(createChatInputOverridesStore);
|
|
28
|
+
return (_jsx(ChatInputOverridesContext.Provider, { value: enabled ? store : null, children: children }));
|
|
29
|
+
}
|
|
30
|
+
/** `null` outside a `chat_input` composer: the caller draws its own gear. */
|
|
31
|
+
export function useChatInputOverridesStore() {
|
|
32
|
+
return useContext(ChatInputOverridesContext);
|
|
33
|
+
}
|
|
34
|
+
const noSubscribe = () => () => { };
|
|
35
|
+
const noValue = () => null;
|
|
36
|
+
/** The published rows, or `null` while nothing publishes (no project, host overrides off). */
|
|
37
|
+
export function useChatInputOverrides() {
|
|
38
|
+
const store = useContext(ChatInputOverridesContext);
|
|
39
|
+
return useSyncExternalStore(store?.subscribe ?? noSubscribe, store?.get ?? noValue, noValue);
|
|
40
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChatInputOverrides } from './chat-input-overrides.js';
|
|
3
|
+
/** A choice in the right pane: the arrow keys walk them (see `ChatInputControl`). */
|
|
4
|
+
export declare const OPTION_ATTR = "data-chat-input-option";
|
|
5
|
+
/**
|
|
6
|
+
* One row in the right pane: an agent, an effort, a secret, a key, an
|
|
7
|
+
* account. A radio row is one choice of several; a checkbox row is one of a
|
|
8
|
+
* set. Either way the mark sits right and the row tints when chosen.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ChoiceRow({ kind, checked, disabled, onSelect, icon, label, description, trailing, }: {
|
|
11
|
+
kind?: 'radio' | 'checkbox';
|
|
12
|
+
checked: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onSelect: () => void;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
/** Beside the mark: a "Default" tag. */
|
|
19
|
+
trailing?: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
type Scope = NonNullable<ChatInputOverrides['scope']>;
|
|
22
|
+
/** How many secrets reach the session: the agent's whole grant, or the chosen set. */
|
|
23
|
+
export declare function secretsInEffect(scope: Scope): number | null;
|
|
24
|
+
/**
|
|
25
|
+
* Secrets: "Agent default" (every secret the agent's grant allows, which is
|
|
26
|
+
* what an untouched session gets), then each secret with its mark. Under
|
|
27
|
+
* the default every secret is marked, because every one is sent; unmarking
|
|
28
|
+
* one turns the axis into an explicit list.
|
|
29
|
+
*/
|
|
30
|
+
export declare function SecretsPane({ scope }: {
|
|
31
|
+
scope: Scope;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
/** How many apps run on an account other than their default. `null`: all defaults. */
|
|
34
|
+
export declare function connectorsChanged(scope: Scope): number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Connectors: which account each app runs as in this session. "Agent
|
|
37
|
+
* default" is every app on its default account (server-resolved, so a
|
|
38
|
+
* disconnected account drops out on its own); picking another account for
|
|
39
|
+
* one app pins the whole set.
|
|
40
|
+
*/
|
|
41
|
+
export declare function ConnectorsPane({ scope }: {
|
|
42
|
+
scope: Scope;
|
|
43
|
+
}): import("react").JSX.Element;
|
|
44
|
+
type ProviderKeys = NonNullable<ChatInputOverrides['providerKeys']>;
|
|
45
|
+
/** How many keys are pinned across providers. 0: the agent default. */
|
|
46
|
+
export declare function providerKeysInEffect(providerKeys: ProviderKeys): number;
|
|
47
|
+
/**
|
|
48
|
+
* Provider keys: "Agent default", then the keys this session may use,
|
|
49
|
+
* grouped by provider. Marking keys pins the gateway to them for that
|
|
50
|
+
* provider (it rotates through them on a rate limit); unmarking the last one
|
|
51
|
+
* hands that provider back to the default.
|
|
52
|
+
*/
|
|
53
|
+
export declare function ProviderKeysPane({ providerKeys }: {
|
|
54
|
+
providerKeys: ProviderKeys;
|
|
55
|
+
}): import("react").JSX.Element;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
5
|
+
import { needsReconnection } from '../../../internal/lib/account-secret-access.js';
|
|
6
|
+
import { LLM_PROVIDER_BY_ID } from '../../../internal/lib/llm-providers.js';
|
|
7
|
+
import { uiRoutes } from '../../../lib/routes.js';
|
|
8
|
+
import { cn } from '../../../lib/utils.js';
|
|
9
|
+
import { Button } from '../../../primitives/button.js';
|
|
10
|
+
import Loading from '../../../primitives/loading.js';
|
|
11
|
+
import { useUiLink } from '../../../providers/ui-provider.js';
|
|
12
|
+
import { useProviderKeyChoices } from '../../overrides/provider-secret-pool-editor.js';
|
|
13
|
+
import { setAllSessionSecrets, setSessionConnectorConnection, toggleSessionSecret, } from '../../scope/session-scope-control.js';
|
|
14
|
+
import { resetSessionConnectorBindings } from '../../scope/session-scope-model.js';
|
|
15
|
+
/** A choice in the right pane: the arrow keys walk them (see `ChatInputControl`). */
|
|
16
|
+
export const OPTION_ATTR = 'data-chat-input-option';
|
|
17
|
+
/** Keys per provider the gateway rotates through at most (the pools route refuses more). */
|
|
18
|
+
const MAX_KEYS_PER_PROVIDER = 10;
|
|
19
|
+
/**
|
|
20
|
+
* One row in the right pane: an agent, an effort, a secret, a key, an
|
|
21
|
+
* account. A radio row is one choice of several; a checkbox row is one of a
|
|
22
|
+
* set. Either way the mark sits right and the row tints when chosen.
|
|
23
|
+
*/
|
|
24
|
+
export function ChoiceRow({ kind = 'radio', checked, disabled = false, onSelect, icon, label, description, trailing, }) {
|
|
25
|
+
return (_jsxs("button", { type: "button", role: kind, "aria-checked": checked, disabled: disabled, tabIndex: kind === 'checkbox' || checked ? 0 : -1, [OPTION_ATTR]: '', onClick: onSelect, className: cn('focus-visible:ring-ring flex w-full min-w-0 shrink-0 items-center gap-2.5 rounded-md px-2 text-left outline-none focus-visible:ring-2 disabled:pointer-events-none', description ? 'py-1.5' : 'min-h-8 py-1', checked ? 'bg-active' : 'hover:bg-hover'), children: [icon, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm font-medium", children: label }), description ? (_jsx("span", { className: "text-muted-foreground block truncate text-xs", children: description })) : null] }), trailing, _jsx("span", { "aria-hidden": true, className: cn('flex size-4 shrink-0 items-center justify-center',
|
|
26
|
+
// A square box (4px corners) so a set reads apart from a one-of-many radio.
|
|
27
|
+
kind === 'checkbox' && 'border-border rounded-[calc(var(--radius)-6px)] border', kind === 'checkbox' && checked && 'bg-foreground text-background border-foreground'), children: checked ? (_jsx(CheckIcon, { className: cn('size-3', kind === 'radio' && 'text-foreground size-3.5') })) : null })] }));
|
|
28
|
+
}
|
|
29
|
+
/** A group's name inside a pane: an app, a provider. */
|
|
30
|
+
function GroupLabel({ children }) {
|
|
31
|
+
return _jsx("p", { className: "text-foreground px-2 pt-2.5 pb-1 text-xs font-medium", children: children });
|
|
32
|
+
}
|
|
33
|
+
function PaneNote({ children, loading = false }) {
|
|
34
|
+
return (_jsxs("p", { role: "status", className: "text-muted-foreground flex items-center gap-2 px-2 py-2 text-xs text-pretty", children: [loading ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, children] }));
|
|
35
|
+
}
|
|
36
|
+
/** How many secrets reach the session: the agent's whole grant, or the chosen set. */
|
|
37
|
+
export function secretsInEffect(scope) {
|
|
38
|
+
if (scope.catalog.secrets.status !== 'ready')
|
|
39
|
+
return null;
|
|
40
|
+
if (scope.draft.secrets === null || scope.draft.secrets === undefined) {
|
|
41
|
+
return scope.catalog.secrets.items.length;
|
|
42
|
+
}
|
|
43
|
+
return scope.draft.secrets.length;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Secrets: "Agent default" (every secret the agent's grant allows, which is
|
|
47
|
+
* what an untouched session gets), then each secret with its mark. Under
|
|
48
|
+
* the default every secret is marked, because every one is sent; unmarking
|
|
49
|
+
* one turns the axis into an explicit list.
|
|
50
|
+
*/
|
|
51
|
+
export function SecretsPane({ scope }) {
|
|
52
|
+
const t = useTranslations('threads');
|
|
53
|
+
const { draft, catalog, loading, disabled, onChange } = scope;
|
|
54
|
+
if (loading)
|
|
55
|
+
return _jsx(PaneNote, { loading: true, children: t('chatInputLoading') });
|
|
56
|
+
if (catalog.secrets.status !== 'ready')
|
|
57
|
+
return _jsx(PaneNote, { children: t('chatInputSecretsUnavailable') });
|
|
58
|
+
const items = catalog.secrets.items;
|
|
59
|
+
const inherited = draft.secrets === null || draft.secrets === undefined;
|
|
60
|
+
const chosen = new Set(draft.secrets ?? []);
|
|
61
|
+
return (_jsxs("div", { className: "flex flex-col gap-px", children: [_jsx("div", { role: "radiogroup", "aria-label": t('chatInputSecrets'), children: _jsx(ChoiceRow, { checked: inherited, disabled: disabled, onSelect: () => onChange(setAllSessionSecrets(draft, true)), label: t('chatInputAgentDefault'), description: t('chatInputSecretsAll', { count: items.length }) }) }), items.length === 0 ? (_jsx(PaneNote, { children: t('chatInputSecretsEmpty') })) : (_jsx("div", { role: "group", "aria-label": t('chatInputSecrets'), className: "mt-1.5 flex flex-col gap-px", children: items.map((secret) => {
|
|
62
|
+
const checked = inherited || chosen.has(secret.identifier);
|
|
63
|
+
return (_jsx(ChoiceRow, { kind: "checkbox", checked: checked, disabled: disabled, onSelect: () => onChange(toggleSessionSecret(draft, catalog, secret.identifier, !checked)), label: secret.name, description: secret.name !== secret.identifier ? (_jsx("code", { className: "font-mono", children: secret.identifier })) : undefined }, secret.identifier));
|
|
64
|
+
}) }))] }));
|
|
65
|
+
}
|
|
66
|
+
/** How many apps run on an account other than their default. `null`: all defaults. */
|
|
67
|
+
export function connectorsChanged(scope) {
|
|
68
|
+
if (scope.draft.connector_bindings_inherited === true)
|
|
69
|
+
return null;
|
|
70
|
+
if (scope.catalog.connector_connections.status !== 'ready')
|
|
71
|
+
return null;
|
|
72
|
+
const bindings = scope.draft.connector_bindings ?? {};
|
|
73
|
+
return scope.catalog.connector_connections.items.filter((connector) => {
|
|
74
|
+
const fallback = connector.connections.find((connection) => connection.is_default) ?? connector.connections[0];
|
|
75
|
+
return bindings[connector.slug]?.connection_id !== fallback?.connection_id;
|
|
76
|
+
}).length;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Connectors: which account each app runs as in this session. "Agent
|
|
80
|
+
* default" is every app on its default account (server-resolved, so a
|
|
81
|
+
* disconnected account drops out on its own); picking another account for
|
|
82
|
+
* one app pins the whole set.
|
|
83
|
+
*/
|
|
84
|
+
export function ConnectorsPane({ scope }) {
|
|
85
|
+
const t = useTranslations('threads');
|
|
86
|
+
const { draft, catalog, loading, disabled, onChange } = scope;
|
|
87
|
+
if (loading)
|
|
88
|
+
return _jsx(PaneNote, { loading: true, children: t('chatInputLoading') });
|
|
89
|
+
if (catalog.connector_connections.status !== 'ready') {
|
|
90
|
+
return _jsx(PaneNote, { children: t('chatInputConnectorsUnavailable') });
|
|
91
|
+
}
|
|
92
|
+
const connectors = catalog.connector_connections.items.filter((connector) => connector.connections.length > 0);
|
|
93
|
+
const inherited = draft.connector_bindings_inherited === true;
|
|
94
|
+
return (_jsxs("div", { className: "flex flex-col gap-px", children: [_jsx("div", { role: "radiogroup", "aria-label": t('chatInputConnectors'), children: _jsx(ChoiceRow, { checked: inherited, disabled: disabled, onSelect: () => onChange(resetSessionConnectorBindings(draft, catalog)), label: t('chatInputAgentDefault'), description: t('chatInputConnectorsAll') }) }), connectors.map((connector) => {
|
|
95
|
+
const bound = draft.connector_bindings?.[connector.slug]?.connection_id;
|
|
96
|
+
return (_jsxs("div", { role: "radiogroup", "aria-label": connector.name, className: "flex flex-col gap-px", children: [_jsx(GroupLabel, { children: connector.name }), connector.connections.map((connection) => (_jsx(ChoiceRow, { checked: bound === connection.connection_id, disabled: disabled, onSelect: () => onChange(setSessionConnectorConnection(draft, connector.slug, connection.connection_id)), label: connection.label, trailing: connection.is_default ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('chatInputDefaultAccount') })) : null }, connection.connection_id)))] }, connector.slug));
|
|
97
|
+
})] }));
|
|
98
|
+
}
|
|
99
|
+
/** How many keys are pinned across providers. 0: the agent default. */
|
|
100
|
+
export function providerKeysInEffect(providerKeys) {
|
|
101
|
+
return Object.values(providerKeys.selection).reduce((count, ids) => count + ids.length, 0);
|
|
102
|
+
}
|
|
103
|
+
function providerLabel(providerId) {
|
|
104
|
+
return providerId === 'codex'
|
|
105
|
+
? 'ChatGPT'
|
|
106
|
+
: (LLM_PROVIDER_BY_ID.get(providerId)?.label ?? providerId);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Provider keys: "Agent default", then the keys this session may use,
|
|
110
|
+
* grouped by provider. Marking keys pins the gateway to them for that
|
|
111
|
+
* provider (it rotates through them on a rate limit); unmarking the last one
|
|
112
|
+
* hands that provider back to the default.
|
|
113
|
+
*/
|
|
114
|
+
export function ProviderKeysPane({ providerKeys }) {
|
|
115
|
+
const t = useTranslations('threads');
|
|
116
|
+
const tPooled = useTranslations('pooledSecrets');
|
|
117
|
+
const Link = useUiLink();
|
|
118
|
+
const { keys, loading, error } = useProviderKeyChoices(providerKeys.projectId, providerKeys.sessionId);
|
|
119
|
+
const { selection, canEdit, onChange } = providerKeys;
|
|
120
|
+
if (loading || providerKeys.loading)
|
|
121
|
+
return _jsx(PaneNote, { loading: true, children: t('chatInputLoading') });
|
|
122
|
+
if (error)
|
|
123
|
+
return _jsx(PaneNote, { children: tPooled('keysLoadError') });
|
|
124
|
+
const providers = [
|
|
125
|
+
...new Set([...keys.map((key) => key.provider_id), ...Object.keys(selection)]),
|
|
126
|
+
].sort();
|
|
127
|
+
const inherited = providerKeysInEffect(providerKeys) === 0;
|
|
128
|
+
const manageHref = uiRoutes().customize(providerKeys.projectId, 'models');
|
|
129
|
+
return (_jsxs("div", { className: "flex flex-col gap-px", children: [_jsx("div", { role: "radiogroup", "aria-label": tPooled('providerKeys'), children: _jsx(ChoiceRow, { checked: inherited, disabled: !canEdit, onSelect: () => {
|
|
130
|
+
for (const providerId of Object.keys(selection))
|
|
131
|
+
onChange(providerId, null);
|
|
132
|
+
}, label: t('chatInputAgentDefault'), description: t('chatInputProviderKeysAll') }) }), providers.length === 0 ? (_jsx(PaneNote, { children: t('chatInputProviderKeysEmpty') })) : (providers.map((providerId) => {
|
|
133
|
+
const chosen = selection[providerId] ?? [];
|
|
134
|
+
const providerKeyList = keys.filter((key) => key.provider_id === providerId);
|
|
135
|
+
return (_jsxs("div", { role: "group", "aria-label": providerLabel(providerId), className: "flex flex-col gap-px", children: [_jsx(GroupLabel, { children: providerLabel(providerId) }), providerKeyList.map((key) => {
|
|
136
|
+
const checked = chosen.includes(key.secret_id);
|
|
137
|
+
const atLimit = !checked && chosen.length >= MAX_KEYS_PER_PROVIDER;
|
|
138
|
+
return (_jsx(ChoiceRow, { kind: "checkbox", checked: checked, disabled: !canEdit || atLimit, onSelect: () => {
|
|
139
|
+
const next = checked
|
|
140
|
+
? chosen.filter((id) => id !== key.secret_id)
|
|
141
|
+
: [...chosen, key.secret_id];
|
|
142
|
+
onChange(providerId, next.length > 0 ? next : null);
|
|
143
|
+
}, label: key.label, description: providerId === 'codex' && needsReconnection(key)
|
|
144
|
+
? tPooled('needsReconnection')
|
|
145
|
+
: undefined }, key.secret_id));
|
|
146
|
+
})] }, providerId));
|
|
147
|
+
})), manageHref ? (_jsx(Button, { size: "xs", variant: "ghost", asChild: true, className: "text-muted-foreground hover:text-foreground mt-1.5 self-start", children: _jsx(Link, { href: manageHref, children: tPooled('manageKeys') }) })) : null] }));
|
|
148
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the `chat_input` control says at rest, as pure functions so the rule
|
|
3
|
+
* is testable without React.
|
|
4
|
+
*
|
|
5
|
+
* The control names the agent and the model it runs on, then only what is
|
|
6
|
+
* overridden beyond that:
|
|
7
|
+
*
|
|
8
|
+
* nothing overridden → "My Kortix · GLM 5.3 Flash"
|
|
9
|
+
* effort overridden → "My Kortix · GLM 5.3 Flash · High"
|
|
10
|
+
* secrets / keys / sandbox set → "My Kortix · GLM 5.3 Flash · 2"
|
|
11
|
+
*
|
|
12
|
+
* The model is always named: it is what a person checks at a glance. Effort
|
|
13
|
+
* is named only when it is not the model's own. The settings behind "More
|
|
14
|
+
* settings" (secrets, provider keys, sandbox, files) have no one-word value,
|
|
15
|
+
* so they are counted.
|
|
16
|
+
*/
|
|
17
|
+
export type ChatInputModelKey = {
|
|
18
|
+
providerID: string;
|
|
19
|
+
modelID: string;
|
|
20
|
+
};
|
|
21
|
+
/** The parts after the agent on the closed trigger, in order. */
|
|
22
|
+
export declare function chatInputTriggerParts(input: {
|
|
23
|
+
/** The model's name; null when the composer shows no model. */
|
|
24
|
+
model: string | null;
|
|
25
|
+
/** The effort's label when it is overridden; null on Auto. */
|
|
26
|
+
effort: string | null;
|
|
27
|
+
/** How many "More settings" rows are overridden. */
|
|
28
|
+
extras: number;
|
|
29
|
+
}): string[];
|
|
30
|
+
export declare function sameModel(a: ChatInputModelKey | null | undefined, b: ChatInputModelKey | null | undefined): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The model row is overridden when the composer's model is not the one the
|
|
33
|
+
* agent resolves to on its own. An unknown inherited model (defaults still
|
|
34
|
+
* loading) never counts as an override: the row would flash "overridden"
|
|
35
|
+
* on every mount.
|
|
36
|
+
*/
|
|
37
|
+
export declare function modelIsOverridden(selected: ChatInputModelKey | null | undefined, inherited: ChatInputModelKey | null | undefined): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The model the selected agent runs on when nothing overrides it.
|
|
40
|
+
*
|
|
41
|
+
* With no explicit pick (`onDefault`) the composer is already on it. With a
|
|
42
|
+
* pick, it is the server's default chain for that agent (agent → project →
|
|
43
|
+
* account → platform), the same `resolveDefaultFor` the composer resolves
|
|
44
|
+
* through. Read from the host's `useSessionModelSelection`, so the control
|
|
45
|
+
* adds no second model state.
|
|
46
|
+
*/
|
|
47
|
+
export declare function inheritedModelFor(model: {
|
|
48
|
+
onDefault: boolean;
|
|
49
|
+
currentKey: ChatInputModelKey | undefined;
|
|
50
|
+
/** Absent on a bare `useRuntimeLocal` selection (no project defaults). */
|
|
51
|
+
defaults?: {
|
|
52
|
+
resolveDefaultFor: (agentName: string | undefined) => ChatInputModelKey | undefined;
|
|
53
|
+
};
|
|
54
|
+
}, agentName: string | null | undefined): ChatInputModelKey | null;
|
|
55
|
+
/**
|
|
56
|
+
* Which agent the control names, and which agents it offers.
|
|
57
|
+
*
|
|
58
|
+
* `fixed`: the composer is bound to one agent it may not leave (a DM: the
|
|
59
|
+
* space's agent; the host passes no `onAgentChange`). The control names that
|
|
60
|
+
* agent, whatever the person picked elsewhere last, and offers no list. Else
|
|
61
|
+
* it names the selection (or the first agent) and offers every agent, My
|
|
62
|
+
* Kortix first, the same order the agent picker uses.
|
|
63
|
+
*/
|
|
64
|
+
export declare function chatInputAgents(agentNames: readonly string[], selected: string | null, fixed: boolean, isMyKortix: (name: string) => boolean): {
|
|
65
|
+
name: string | null;
|
|
66
|
+
offered: string[];
|
|
67
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the `chat_input` control says at rest, as pure functions so the rule
|
|
3
|
+
* is testable without React.
|
|
4
|
+
*
|
|
5
|
+
* The control names the agent and the model it runs on, then only what is
|
|
6
|
+
* overridden beyond that:
|
|
7
|
+
*
|
|
8
|
+
* nothing overridden → "My Kortix · GLM 5.3 Flash"
|
|
9
|
+
* effort overridden → "My Kortix · GLM 5.3 Flash · High"
|
|
10
|
+
* secrets / keys / sandbox set → "My Kortix · GLM 5.3 Flash · 2"
|
|
11
|
+
*
|
|
12
|
+
* The model is always named: it is what a person checks at a glance. Effort
|
|
13
|
+
* is named only when it is not the model's own. The settings behind "More
|
|
14
|
+
* settings" (secrets, provider keys, sandbox, files) have no one-word value,
|
|
15
|
+
* so they are counted.
|
|
16
|
+
*/
|
|
17
|
+
/** The parts after the agent on the closed trigger, in order. */
|
|
18
|
+
export function chatInputTriggerParts(input) {
|
|
19
|
+
return [
|
|
20
|
+
...(input.model ? [input.model] : []),
|
|
21
|
+
...(input.effort ? [input.effort] : []),
|
|
22
|
+
...(input.extras > 0 ? [String(input.extras)] : []),
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
export function sameModel(a, b) {
|
|
26
|
+
return !!a && !!b && a.providerID === b.providerID && a.modelID === b.modelID;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The model row is overridden when the composer's model is not the one the
|
|
30
|
+
* agent resolves to on its own. An unknown inherited model (defaults still
|
|
31
|
+
* loading) never counts as an override: the row would flash "overridden"
|
|
32
|
+
* on every mount.
|
|
33
|
+
*/
|
|
34
|
+
export function modelIsOverridden(selected, inherited) {
|
|
35
|
+
if (!selected || !inherited)
|
|
36
|
+
return false;
|
|
37
|
+
return !sameModel(selected, inherited);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The model the selected agent runs on when nothing overrides it.
|
|
41
|
+
*
|
|
42
|
+
* With no explicit pick (`onDefault`) the composer is already on it. With a
|
|
43
|
+
* pick, it is the server's default chain for that agent (agent → project →
|
|
44
|
+
* account → platform), the same `resolveDefaultFor` the composer resolves
|
|
45
|
+
* through. Read from the host's `useSessionModelSelection`, so the control
|
|
46
|
+
* adds no second model state.
|
|
47
|
+
*/
|
|
48
|
+
export function inheritedModelFor(model, agentName) {
|
|
49
|
+
if (model.onDefault)
|
|
50
|
+
return model.currentKey ?? null;
|
|
51
|
+
return model.defaults?.resolveDefaultFor(agentName ?? undefined) ?? null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Which agent the control names, and which agents it offers.
|
|
55
|
+
*
|
|
56
|
+
* `fixed`: the composer is bound to one agent it may not leave (a DM: the
|
|
57
|
+
* space's agent; the host passes no `onAgentChange`). The control names that
|
|
58
|
+
* agent, whatever the person picked elsewhere last, and offers no list. Else
|
|
59
|
+
* it names the selection (or the first agent) and offers every agent, My
|
|
60
|
+
* Kortix first, the same order the agent picker uses.
|
|
61
|
+
*/
|
|
62
|
+
export function chatInputAgents(agentNames, selected, fixed, isMyKortix) {
|
|
63
|
+
if (fixed)
|
|
64
|
+
return { name: selected ?? agentNames[0] ?? null, offered: [] };
|
|
65
|
+
const name = (selected && agentNames.includes(selected) ? selected : null) ?? selected ?? agentNames[0] ?? null;
|
|
66
|
+
return { name, offered: [...agentNames.filter(isMyKortix), ...agentNames.filter((agent) => !isMyKortix(agent))] };
|
|
67
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { QueueRow } from './queue-projection.js';
|
|
2
|
+
/**
|
|
3
|
+
* The queue of a messages-only thread (a space's thread, flag `chat`), said
|
|
4
|
+
* in calm lines above the reply box instead of the queue card. The inbox rows
|
|
5
|
+
* stay the source of truth; this is a view on them:
|
|
6
|
+
* - a message of yours whose delivery failed: its words, "Not sent", "Retry";
|
|
7
|
+
* - a Stop holding the queue: "Stopped", "Resume";
|
|
8
|
+
* - every other row (queued, sending): the queue card, via `children`.
|
|
9
|
+
* Platform rows (a worker's report, `synthetic`) are not a person's message:
|
|
10
|
+
* they wait behind Resume and are not listed.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ChatQueueLines({ rows, heldCount, resumePending, onResume, onRetry, children, }: {
|
|
13
|
+
rows: readonly QueueRow[];
|
|
14
|
+
heldCount: number;
|
|
15
|
+
resumePending: boolean;
|
|
16
|
+
onResume: () => void;
|
|
17
|
+
onRetry?: (promptId: string) => void;
|
|
18
|
+
/** The card for the rows these lines do not say. */
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* The queue of a messages-only thread (a space's thread, flag `chat`), said
|
|
6
|
+
* in calm lines above the reply box instead of the queue card. The inbox rows
|
|
7
|
+
* stay the source of truth; this is a view on them:
|
|
8
|
+
* - a message of yours whose delivery failed: its words, "Not sent", "Retry";
|
|
9
|
+
* - a Stop holding the queue: "Stopped", "Resume";
|
|
10
|
+
* - every other row (queued, sending): the queue card, via `children`.
|
|
11
|
+
* Platform rows (a worker's report, `synthetic`) are not a person's message:
|
|
12
|
+
* they wait behind Resume and are not listed.
|
|
13
|
+
*/
|
|
14
|
+
export function ChatQueueLines({ rows, heldCount, resumePending, onResume, onRetry, children, }) {
|
|
15
|
+
const t = useTranslations('sessionUi.turn');
|
|
16
|
+
const failed = rows.filter((row) => row.state === 'failed' && !row.synthetic);
|
|
17
|
+
if (failed.length === 0 && heldCount === 0 && !children)
|
|
18
|
+
return null;
|
|
19
|
+
return (_jsxs("div", { className: "space-y-1.5", children: [failed.map((row) => (_jsxs("div", { role: "status", className: "flex min-w-0 items-center gap-1.5 px-1 text-xs", children: [_jsx("span", { className: "text-foreground min-w-0 truncate", title: row.text, children: row.text }), _jsxs("span", { className: "text-muted-foreground shrink-0", children: ["\u00B7 ", t('notSent')] }), row.retryable && onRetry ? (_jsx("button", { type: "button", onClick: () => onRetry(row.id), className: "text-foreground focus-visible:ring-ring shrink-0 rounded-sm font-medium underline-offset-2 outline-none hover:underline focus-visible:ring-2", children: t('retry') })) : null] }, row.id))), heldCount > 0 ? (_jsxs("div", { role: "status", className: "text-muted-foreground flex items-center gap-1.5 px-1 text-xs", children: [_jsx("span", { children: t('stopped') }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsx("button", { type: "button", onClick: onResume, disabled: resumePending, "aria-busy": resumePending || undefined, className: "text-foreground focus-visible:ring-ring rounded-sm font-medium underline-offset-2 outline-none hover:underline focus-visible:ring-2 disabled:opacity-50", children: t('resume') })] })) : null, children] }));
|
|
20
|
+
}
|
|
@@ -24,7 +24,7 @@ export interface ComposerOptions {
|
|
|
24
24
|
* The current selections are handed to `onSend` / `onCommand` as `options`, so
|
|
25
25
|
* callers never need their own `useRuntimeLocal`.
|
|
26
26
|
*/
|
|
27
|
-
export declare function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isBusy, sessionWorking, runtimeReady, stopDisabled, isSending, disabled, autoFocus, placeholder, hint, prefill, onPrefillApplied, aboveSlot, inputSlot, toolbarSlot, underbarPlacement, slashMenuPlacement, cardClassName, parentClassName, boundAgentName, defaultAgentName, channelAgentNames, projectSession, clearOnSend, onAgentSelectionChange, sandboxSlot, draftScope, draftActive, promptAttachments, submitLabel, onArrowUpAtStart, }: {
|
|
27
|
+
export declare function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isBusy, sessionWorking, runtimeReady, stopDisabled, isSending, disabled, autoFocus, placeholder, hint, prefill, onPrefillApplied, aboveSlot, inputSlot, toolbarSlot, underbarPlacement, slashMenuPlacement, cardClassName, parentClassName, boundAgentName, lockAgent, defaultAgentName, channelAgentNames, projectSession, clearOnSend, onAgentSelectionChange, sandboxSlot, draftScope, draftActive, promptAttachments, submitLabel, onArrowUpAtStart, }: {
|
|
28
28
|
onSend: (text: string, files: AttachedFile[] | undefined, options: ComposerOptions, attachments?: AttachmentSubmission) => void | Promise<void>;
|
|
29
29
|
onCommand?: (command: Command, args: string | undefined, options: ComposerOptions) => void;
|
|
30
30
|
sessionId?: string;
|
|
@@ -71,6 +71,13 @@ export declare function ComposerChatInput({ onSend, onCommand, sessionId, projec
|
|
|
71
71
|
parentClassName?: string;
|
|
72
72
|
/** Immutable project-session agent. When set, sends are locked to this agent. */
|
|
73
73
|
boundAgentName?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* The agent is `boundAgentName` and nothing else (a DM: the space's agent).
|
|
76
|
+
* The picker names it and offers no other agent, a pick made elsewhere
|
|
77
|
+
* never outranks it, and every send runs it. Default false: a pick
|
|
78
|
+
* outranks the bound agent (KRTX-1290).
|
|
79
|
+
*/
|
|
80
|
+
lockAgent?: boolean;
|
|
74
81
|
/** The agent a new thread starts on here (a channel's default). Unset: the project's default. */
|
|
75
82
|
defaultAgentName?: string | null;
|
|
76
83
|
/** A channel's agents: anyone who posts here runs them, granted or not. */
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { ComposerAutoFocusContext } from './composer-focus-context.js';
|
|
4
5
|
import { SessionOverridesComposer } from '../overrides/session-overrides-composer.js';
|
|
5
6
|
import { SessionChatInput, } from './session-chat-input.js';
|
|
6
7
|
import { useProjectConfig, useRuntimeAgents, useRuntimeCommands, useRuntimeConfig, useRuntimeProviders, useSessionModelSelection } from '@kortix/sdk/react';
|
|
7
8
|
import { appendMentionRefs } from '../../internal/lib/project-preamble.js';
|
|
8
9
|
import { resolveComposerAgent, withChannelAgents } from './composer-agent-access.js';
|
|
10
|
+
import { inheritedModelFor } from './chat-input/chat-input-summary.js';
|
|
9
11
|
/**
|
|
10
12
|
* The canonical "compose a first message" input: {@link SessionChatInput}
|
|
11
13
|
* pre-wired with the OpenCode model / agent / variant / command selectors (the
|
|
@@ -15,7 +17,8 @@ import { resolveComposerAgent, withChannelAgents } from './composer-agent-access
|
|
|
15
17
|
* The current selections are handed to `onSend` / `onCommand` as `options`, so
|
|
16
18
|
* callers never need their own `useRuntimeLocal`.
|
|
17
19
|
*/
|
|
18
|
-
export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isBusy, sessionWorking, runtimeReady, stopDisabled, isSending, disabled, autoFocus, placeholder, hint, prefill, onPrefillApplied, aboveSlot, inputSlot, toolbarSlot, underbarPlacement, slashMenuPlacement, cardClassName, parentClassName, boundAgentName, defaultAgentName, channelAgentNames, projectSession, clearOnSend, onAgentSelectionChange, sandboxSlot, draftScope, draftActive, promptAttachments, submitLabel, onArrowUpAtStart, }) {
|
|
20
|
+
export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isBusy, sessionWorking, runtimeReady, stopDisabled, isSending, disabled, autoFocus, placeholder, hint, prefill, onPrefillApplied, aboveSlot, inputSlot, toolbarSlot, underbarPlacement, slashMenuPlacement, cardClassName, parentClassName, boundAgentName, lockAgent = false, defaultAgentName, channelAgentNames, projectSession, clearOnSend, onAgentSelectionChange, sandboxSlot, draftScope, draftActive, promptAttachments, submitLabel, onArrowUpAtStart, }) {
|
|
21
|
+
const contextAutoFocus = useContext(ComposerAutoFocusContext);
|
|
19
22
|
const { data: rosterAgents } = useRuntimeAgents({ projectId });
|
|
20
23
|
const agents = useMemo(() => withChannelAgents(rosterAgents, channelAgentNames), [rosterAgents, channelAgentNames]);
|
|
21
24
|
const { data: providers, isLoading: providersLoading } = useRuntimeProviders();
|
|
@@ -73,8 +76,9 @@ export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isB
|
|
|
73
76
|
agents,
|
|
74
77
|
boundAgent: boundAgentName,
|
|
75
78
|
defaultAgent: startAgent,
|
|
76
|
-
selectedAgent: local.agent.current?.name ?? null,
|
|
79
|
+
selectedAgent: lockAgent && boundAgentName ? null : (local.agent.current?.name ?? null),
|
|
77
80
|
});
|
|
81
|
+
const agentLocked = lockAgent && !!boundAgentName;
|
|
78
82
|
const selectedAgentName = agentResolution.selected;
|
|
79
83
|
// An empty project roster refuses an unbound composer; the resolver answers
|
|
80
84
|
// `disabled` for exactly that case.
|
|
@@ -143,5 +147,9 @@ export function ComposerChatInput({ onSend, onCommand, sessionId, projectId, isB
|
|
|
143
147
|
, {
|
|
144
148
|
// A first message has no session send to write the `@` mention blocks
|
|
145
149
|
// (`session-chat.tsx` `handleSend`), so they go into the text here.
|
|
146
|
-
onSend: (text, files, mentions, attachments, placement) => onSend(appendMentionRefs(text, mentions), files, { ...options(), placement }, attachments), promptAttachments: promptAttachments, onCommand: onCommand ? (cmd, args) => onCommand(cmd, args, options()) : undefined, clearOnSend: clearOnSend, isBusy: isBusy, sessionWorking: sessionWorking, runtimeReady: runtimeReady, stopDisabled: stopDisabled, isSending: isSending, disabled: disabled,
|
|
150
|
+
onSend: (text, files, mentions, attachments, placement) => onSend(appendMentionRefs(text, mentions), files, { ...options(), placement }, attachments), promptAttachments: promptAttachments, onCommand: onCommand ? (cmd, args) => onCommand(cmd, args, options()) : undefined, clearOnSend: clearOnSend, isBusy: isBusy, sessionWorking: sessionWorking, runtimeReady: runtimeReady, stopDisabled: stopDisabled, isSending: isSending, disabled: disabled,
|
|
151
|
+
// A thread a space's chat opened by itself does not take the focus (`ComposerAutoFocusContext`).
|
|
152
|
+
autoFocus: autoFocus ?? (contextAutoFocus ? undefined : false), placeholder: placeholder, hint: hint, prefill: deliveredPrefill, onPrefillApplied: onPrefillApplied, aboveSlot: aboveSlot, inputSlot: inputSlot, toolbarSlot: combinedToolbarSlot, underbarPlacement: underbarPlacement, slashMenuPlacement: slashMenuPlacement, cardClassName: cardClassName, parentClassName: parentClassName, sessionId: sessionId, projectId: projectId, providers: providers, agents: local.agent.list, selectedAgent: selectedAgentName, noAccessibleAgents: noAccessibleAgents, agentLocked: agentLocked,
|
|
153
|
+
// A locked agent has nothing to switch to: no handler is the composer's "fixed agent" signal.
|
|
154
|
+
onAgentChange: agentLocked ? undefined : (name) => local.agent.set(name ?? undefined), models: local.model.list, selectedModel: local.model.currentKey ?? null, onModelChange: (m) => local.model.set(m ?? undefined, { recent: true }), inheritedModel: inheritedModelFor(local.model, selectedAgentName), modelRequired: true, modelsLoading: providersLoading, variants: local.model.variant.list, selectedVariant: local.model.variant.current ?? null, onVariantChange: (v) => local.model.variant.set(v ?? undefined), commands: commands || [], commandsResolved: commands !== undefined, draftScope: draftScope, draftActive: draftActive, submitLabel: submitLabel, onArrowUpAtStart: onArrowUpAtStart }));
|
|
147
155
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* False: the composers under it do not take the focus when they mount. A
|
|
3
|
+
* space's chat opens the thread a message just started beside it (flag
|
|
4
|
+
* `chat`), while the person goes on typing in the chat: the thread's reply
|
|
5
|
+
* box must not take the focus away. An explicit `autoFocus` prop still wins.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ComposerAutoFocusContext: import("react").Context<boolean>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* False: the composers under it do not take the focus when they mount. A
|
|
5
|
+
* space's chat opens the thread a message just started beside it (flag
|
|
6
|
+
* `chat`), while the person goes on typing in the chat: the thread's reply
|
|
7
|
+
* box must not take the focus away. An explicit `autoFocus` prop still wins.
|
|
8
|
+
*/
|
|
9
|
+
export const ComposerAutoFocusContext = createContext(true);
|
|
@@ -89,6 +89,8 @@ export interface ComposerToolbarProps {
|
|
|
89
89
|
};
|
|
90
90
|
/** Rendered FIRST in the left cluster, before the model selector. */
|
|
91
91
|
leading?: React.ReactNode;
|
|
92
|
+
/** The `chat_input` control holds model and effort: this toolbar draws neither. */
|
|
93
|
+
pickersInChatInput?: boolean;
|
|
92
94
|
isSending: boolean;
|
|
93
95
|
isBusy: boolean;
|
|
94
96
|
onStop?: () => void;
|
|
@@ -114,4 +116,4 @@ export interface ComposerToolbarProps {
|
|
|
114
116
|
attachmentUnsupported?: string | null;
|
|
115
117
|
onSubmit: () => void;
|
|
116
118
|
}
|
|
117
|
-
export declare function ComposerToolbar({ models, modelsLoading, selectedModel, onModelChange, modelDefaultControls, providers, modelRequired, modelMenuOpen, onModelMenuOpenChange, reasoningMenuOpen, onReasoningMenuOpenChange, variants, selectedVariant, onVariantChange, projectId, toolbarSlot, rewind, leading, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable, attachmentFailed, attachmentUnsupported, onSubmit, }: ComposerToolbarProps): import("react").JSX.Element;
|
|
119
|
+
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, onSubmit, }: ComposerToolbarProps): import("react").JSX.Element;
|
|
@@ -9,11 +9,11 @@ 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, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable = false, attachmentFailed = false, attachmentUnsupported = null, 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, isSending, isBusy, onStop, stopDisabled, canStop, escCount, lockForQuestion, questionButtonLabel, submitLabel, questionCanAct, hasText, canSubmit, submitDisabled, disabled, modelUnavailable, agentUnavailable = false, attachmentFailed = false, attachmentUnsupported = null, onSubmit, }) {
|
|
13
13
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
14
14
|
const { modelPickerEnabled } = useUiHostConfig();
|
|
15
|
-
const showModel = modelPickerEnabled && (models.length > 0 || modelRequired) && !!onModelChange;
|
|
16
|
-
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: modelMenuOpen, onOpenChange: onModelMenuOpenChange })), modelPickerEnabled && _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
|
|
15
|
+
const showModel = !pickersInChatInput && modelPickerEnabled && (models.length > 0 || modelRequired) && !!onModelChange;
|
|
16
|
+
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: modelMenuOpen, onOpenChange: onModelMenuOpenChange })), 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
|
|
17
17
|
? tI18nComplete.raw('text98433e61649a')
|
|
18
18
|
: 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, onSubmit: onSubmit })] })] }));
|
|
19
19
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SessionLogMessage } from '@kortix/sdk';
|
|
2
2
|
import type { Agent, FlatModel } from '@kortix/sdk/react';
|
|
3
|
+
import { type ChatInputControlProps } from './chat-input/chat-input-control.js';
|
|
3
4
|
/**
|
|
4
5
|
* The row directly BELOW the composer card.
|
|
5
6
|
*
|
|
@@ -31,6 +32,8 @@ export interface ComposerUnderbarProps {
|
|
|
31
32
|
* normal composer right up to the server's 403.
|
|
32
33
|
*/
|
|
33
34
|
noAccessibleAgents?: boolean;
|
|
35
|
+
/** The agent is fixed (a DM): the picker names `selectedAgent` and offers no other. */
|
|
36
|
+
agentLocked?: boolean;
|
|
34
37
|
messages: SessionLogMessage[] | undefined;
|
|
35
38
|
models: FlatModel[];
|
|
36
39
|
selectedModel: {
|
|
@@ -54,5 +57,11 @@ export interface ComposerUnderbarProps {
|
|
|
54
57
|
toolbarSlot?: React.ReactNode;
|
|
55
58
|
/** Right of the agent picker: the session's agents line. Same row, no added height. */
|
|
56
59
|
agentsSlot?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* The `chat_input` flag is on: one control for the agent, model, effort and
|
|
62
|
+
* session overrides takes the agent picker's place. The card then renders
|
|
63
|
+
* no model or effort picker and no overrides gear. Unset: the agent picker.
|
|
64
|
+
*/
|
|
65
|
+
chatInput?: Omit<ChatInputControlProps, 'agents' | 'selectedAgent' | 'onAgentChange' | 'unavailableHint' | 'agentLocked'>;
|
|
57
66
|
}
|
|
58
|
-
export declare function ComposerUnderbar({ onAttachClick, agents, selectedAgent, agentMenuOpen, onAgentMenuOpenChange, onAgentChange, noAccessibleAgents, messages, models, selectedModel, onContextClick, variant, agentPickerCompact, toolbarSlot, agentsSlot, }: ComposerUnderbarProps): import("react").JSX.Element;
|
|
67
|
+
export declare function ComposerUnderbar({ onAttachClick, agents, selectedAgent, agentMenuOpen, onAgentMenuOpenChange, onAgentChange, noAccessibleAgents, agentLocked, messages, models, selectedModel, onContextClick, variant, agentPickerCompact, toolbarSlot, agentsSlot, chatInput, }: ComposerUnderbarProps): import("react").JSX.Element;
|