@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
|
@@ -2,97 +2,36 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useTranslations } from '../../../../i18n/index.js';
|
|
4
4
|
/**
|
|
5
|
-
* Routing — where a request goes when
|
|
5
|
+
* Routing — where a request goes when its model can't take it.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* down the controls, and it can only be scanned that way if the controls
|
|
13
|
-
* share one x-position and one rhythm, not just a similar-looking layout.
|
|
14
|
-
*
|
|
15
|
-
* **What this replaced.** Four `bg-popover` panels of equal visual weight,
|
|
16
|
-
* one of them a `Disclosure` hiding a stack of per-model rule blocks, each of
|
|
17
|
-
* which held ANOTHER bordered panel (`ChainEditor`) whose fallback steps were
|
|
18
|
-
* themselves bordered `<li>` cards. Five levels of box for "try B if A
|
|
19
|
-
* fails", with the mode select at one x-position, the condition select at
|
|
20
|
-
* another, the model pickers at a third — and the feature the product owner
|
|
21
|
-
* called out as "the core thing want here" (per-model overrides) was the LAST
|
|
22
|
-
* of the four panels, behind a click that gave no hint of what was under it.
|
|
23
|
-
*
|
|
24
|
-
* **Two tiers, not four equal boxes.** The product feedback on the old
|
|
25
|
-
* layout was specific: it "looks horrendous", overrides are the core feature
|
|
26
|
-
* and should not read as a footnote, and it needs to be as simple as
|
|
27
|
-
* possible. So the four sections split into two tiers instead of one flat
|
|
28
|
-
* stack:
|
|
29
|
-
*
|
|
30
|
-
* 1. **Primary — always visible.** *Fallback* (what handles this project's
|
|
31
|
-
* requests) and *Per-model overrides* (the exceptions to it) sit at the
|
|
32
|
-
* top, in that order, right after each other. Overrides also gets a
|
|
33
|
-
* full-strength `text-foreground` heading (the other three stay
|
|
34
|
-
* `Label`'s default muted weight) and its "Add override" button lives in
|
|
35
|
-
* the section header rather than at the bottom of a list — together that
|
|
36
|
-
* is the visual weight the product owner asked for, without a box.
|
|
37
|
-
* 2. **Advanced — collapsed by default.** *Vision model* (a narrow,
|
|
38
|
-
* image-input-only override) and *Generation defaults* (four raw
|
|
39
|
-
* parameter knobs: reasoning effort, temperature, top-p, max tokens) are
|
|
40
|
-
* fine-tuning, not the decision someone opens this tab to make. Both
|
|
41
|
-
* move under one "Advanced" `Disclosure` below the primary content. It
|
|
42
|
-
* opens by default (`hasAdvancedRoutingConfig`) whenever the project
|
|
43
|
-
* already sets a vision override or a generation parameter, so an
|
|
44
|
-
* existing non-default config is never hidden from the person who set it.
|
|
45
|
-
*
|
|
46
|
-
* Nothing was cut. Every capability the panels held is still here:
|
|
47
|
-
*
|
|
48
|
-
* | Capability | Where it is now |
|
|
49
|
-
* | --- | --- |
|
|
50
|
-
* | Inherit / custom / no fallback | "When a model fails" row (primary) |
|
|
51
|
-
* | Ordered default chain, reorder + remove, max 8 | Chain row — one line per step (primary) |
|
|
52
|
-
* | Fallback condition (transient / any error) | "Retry on" line, inside the chain it belongs to |
|
|
53
|
-
* | Per-model override rules, max 20 | "Per-model overrides" — one row per rule, promoted second (primary) |
|
|
54
|
-
* | Vision (image-input) override | "Vision model" row, inside Advanced |
|
|
55
|
-
* | Per-model generation defaults | "Generation defaults" section, inside Advanced |
|
|
56
|
-
* | Provider-availability preview | `AvailabilityBadge`, on every chain step and override |
|
|
57
|
-
* | Reset / dirty / validation / save | Header action + sticky footer, unchanged |
|
|
7
|
+
* This file owns the state: the editable draft of the project routing policy,
|
|
8
|
+
* the fallback mode, the debounced provider-availability preview, save, and
|
|
9
|
+
* reset. `routing-sentence-layout.tsx` renders the draft as plain sentences
|
|
10
|
+
* (All requests, Images, Exceptions, Model defaults); `routing-parts.tsx`
|
|
11
|
+
* holds the controls it is built from, including the floating save bar.
|
|
58
12
|
*
|
|
59
13
|
* The data contract is untouched: same props in, same `routing.set` /
|
|
60
14
|
* `routing.reset` / `routing.preview` calls out, same exported helpers (which
|
|
61
15
|
* `gateway-routing.test.ts` pins).
|
|
62
16
|
*/
|
|
63
|
-
import {
|
|
17
|
+
import { ArrowCounterClockwiseIcon as RotateCcw } from '@phosphor-icons/react';
|
|
64
18
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
65
19
|
import { Badge } from '../../../../primitives/badge.js';
|
|
66
20
|
import { Button } from '../../../../primitives/button.js';
|
|
67
21
|
import { ConfirmDialog } from '../../../../primitives/confirm-dialog.js';
|
|
68
|
-
import { Disclosure, DisclosureContent, DisclosureTrigger } from '../../../../primitives/disclosure.js';
|
|
69
|
-
import Hint from '../../../../primitives/hint.js';
|
|
70
|
-
import { Label } from '../../../../primitives/label.js';
|
|
71
|
-
import Loading from '../../../../primitives/loading.js';
|
|
72
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../../../primitives/select.js';
|
|
73
22
|
import { Skeleton } from '../../../../primitives/skeleton.js';
|
|
74
23
|
import { errorToast, successToast } from '../../../../primitives/toast.js';
|
|
75
|
-
import {
|
|
76
|
-
import { cn } from '../../../../internal/lib/utils.js';
|
|
77
|
-
import { modelKeyToWire, qk, useGatewayRoutingPolicy, useModelDefaults, useProjectModelPickerCatalog, useProjectModels, wireToModelKey, } from '@kortix/sdk/react';
|
|
24
|
+
import { modelKeyToWire, qk, useGatewayRoutingPolicy, useModelDefaults, useProjectModelPickerCatalog, useProjectModels, } from '@kortix/sdk/react';
|
|
78
25
|
import { useQueryClient } from '@tanstack/react-query';
|
|
79
26
|
import { GenerationControlsPanel } from './generation-controls.js';
|
|
80
|
-
|
|
81
|
-
|
|
27
|
+
import { isSelectableModel, MAX_FALLBACKS, MAX_RULES, RoutingSaveBar, } from './routing-parts.js';
|
|
28
|
+
import { RoutingSentenceLayout } from './routing-sentence-layout.js';
|
|
29
|
+
export { moveFallback } from './routing-parts.js';
|
|
82
30
|
export function fallbackModeForPolicy(fallback) {
|
|
83
31
|
if (fallback === null)
|
|
84
32
|
return 'inherit';
|
|
85
33
|
return fallback.models.length === 0 ? 'disabled' : 'custom';
|
|
86
34
|
}
|
|
87
|
-
export function moveFallback(models, index, delta) {
|
|
88
|
-
const target = index + delta;
|
|
89
|
-
if (index < 0 || index >= models.length || target < 0 || target >= models.length) {
|
|
90
|
-
return models;
|
|
91
|
-
}
|
|
92
|
-
const next = [...models];
|
|
93
|
-
[next[index], next[target]] = [next[target], next[index]];
|
|
94
|
-
return next;
|
|
95
|
-
}
|
|
96
35
|
export function validateRoutingDraft(draft, fallbackMode = fallbackModeForPolicy(draft.defaultFallback)) {
|
|
97
36
|
const validateChain = (primary, models) => {
|
|
98
37
|
if (models.length > MAX_FALLBACKS)
|
|
@@ -187,77 +126,6 @@ export function hasAdvancedRoutingConfig(policy) {
|
|
|
187
126
|
return false;
|
|
188
127
|
return Object.values(config).some((entry) => entry && Object.keys(entry).length > 0);
|
|
189
128
|
}
|
|
190
|
-
/**
|
|
191
|
-
* One decision, one line: what it is on the left, the control on the right.
|
|
192
|
-
*
|
|
193
|
-
* The whole screen is a stack of these, so every control — mode select, model
|
|
194
|
-
* picker, condition select, chain — starts at the same x. That is the entire
|
|
195
|
-
* layout system here; there is no card, no panel and no nesting to hold, which
|
|
196
|
-
* is what the four `bg-popover` boxes were doing.
|
|
197
|
-
*
|
|
198
|
-
* Column width, row padding, and gaps match `ProviderRow` in
|
|
199
|
-
* `packages/ui/src/customize/providers/provider-connect.tsx` exactly (`13rem` label column,
|
|
200
|
-
* `py-1.5` row, `gap-4` between columns) — same list-row rhythm the rest of
|
|
201
|
-
* Customize already uses, not a lookalike with its own spacing.
|
|
202
|
-
*/
|
|
203
|
-
function RoutingRow({ label, hint, children, align = 'center', }) {
|
|
204
|
-
return (_jsxs("div", { className: cn('grid gap-1.5 py-1.5 sm:grid-cols-[minmax(0,13rem)_minmax(0,1fr)] sm:gap-4', align === 'start' ? 'sm:items-start' : 'sm:items-center'), children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-foreground text-sm", children: label }), hint ? _jsx("p", { className: "text-muted-foreground mt-0.5 text-xs text-pretty", children: hint }) : null] }), _jsx("div", { className: "min-w-0", children: children })] }));
|
|
205
|
-
}
|
|
206
|
-
function RoutingModelSelector({ value, models, onChange, disabled, unsetLabel = 'Choose model', exclude = [], }) {
|
|
207
|
-
const excluded = new Set(exclude);
|
|
208
|
-
const options = models.filter((model) => {
|
|
209
|
-
const wire = modelKeyToWire(model);
|
|
210
|
-
return !excluded.has(wire) || wire === value;
|
|
211
|
-
});
|
|
212
|
-
if (value && !options.some((model) => modelKeyToWire(model) === value)) {
|
|
213
|
-
options.push({
|
|
214
|
-
providerID: 'kortix',
|
|
215
|
-
providerName: 'Kortix',
|
|
216
|
-
modelID: value,
|
|
217
|
-
modelName: value,
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
return (_jsx(ModelSelector, { models: options, selectedModel: value ? wireToModelKey(value) : null, unsetLabel: unsetLabel, disabled: disabled, onSelect: (model) => onChange(model ? modelKeyToWire(model) : null) }));
|
|
221
|
-
}
|
|
222
|
-
/** Warns inline when the routing-policy preview reports a model's provider isn't connected. */
|
|
223
|
-
function AvailabilityBadge({ available }) {
|
|
224
|
-
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
225
|
-
if (available !== false)
|
|
226
|
-
return null;
|
|
227
|
-
return (_jsx(Hint, { label: tI18nComplete.raw('text7031306d3dd8'), children: _jsxs(Badge, { variant: "warning", size: "xs", className: "shrink-0 gap-1", children: [_jsx(AlertTriangle, { className: "size-3" }), tI18nComplete.raw('text0303e1824670')] }) }));
|
|
228
|
-
}
|
|
229
|
-
function ConditionSelect({ value, onChange, disabled, }) {
|
|
230
|
-
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
231
|
-
return (_jsxs(Select, { value: value, onValueChange: (next) => onChange(next), disabled: disabled, children: [_jsx(SelectTrigger, { className: "w-40", size: "sm", "aria-label": tI18nComplete.raw('text5970362b52d5'), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "transient", description: tI18nComplete.raw('text4b8a51b32252'), children: tI18nComplete.raw('text91721aa63069') }), _jsx(SelectItem, { value: "any-error", description: tI18nComplete.raw('textc1e4a1169ac8'), children: tI18nComplete.raw('text6e2097e246af') })] })] }));
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* One fallback chain as plain lines — a numbered step per model, an add line,
|
|
235
|
-
* and the condition the chain triggers on.
|
|
236
|
-
*
|
|
237
|
-
* Every step used to be a bordered `<li>` inside a bordered panel inside
|
|
238
|
-
* (for a rule) another bordered block. A step carries one model and three
|
|
239
|
-
* controls; it does not need a box of its own to say so, and forty pixels of
|
|
240
|
-
* border per step is what made eight of them unreadable.
|
|
241
|
-
*/
|
|
242
|
-
function ChainRows({ primary, chain, models, onChange, disabled, availability, }) {
|
|
243
|
-
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
244
|
-
const taken = [primary ?? '', ...chain.models];
|
|
245
|
-
const takenSet = new Set(taken);
|
|
246
|
-
const canAdd = models.some((model) => !takenSet.has(modelKeyToWire(model)));
|
|
247
|
-
return (_jsxs("div", { className: "flex flex-col gap-0.5", children: [chain.models.map((model, index) => (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsx("span", { className: "text-muted-foreground/60 w-4 shrink-0 text-xs tabular-nums", children: index + 1 }), _jsx("div", { className: "min-w-0 flex-1", children: _jsx(RoutingModelSelector, { value: model, models: models, exclude: [
|
|
248
|
-
primary ?? '',
|
|
249
|
-
...chain.models.filter((_, itemIndex) => itemIndex !== index),
|
|
250
|
-
], onChange: (next) => {
|
|
251
|
-
if (!next)
|
|
252
|
-
return;
|
|
253
|
-
const updated = [...chain.models];
|
|
254
|
-
updated[index] = next;
|
|
255
|
-
onChange({ ...chain, models: updated });
|
|
256
|
-
}, disabled: disabled }) }), _jsx(AvailabilityBadge, { available: availability?.[model] }), _jsx(Hint, { label: tI18nComplete.raw('textc66feb5eb8f2'), children: _jsx(Button, { type: "button", size: "icon-sm", variant: "ghost", "aria-label": tI18nComplete.raw('textdfea74d6d58d'), disabled: disabled || index === 0, onClick: () => onChange({ ...chain, models: moveFallback(chain.models, index, -1) }), children: _jsx(ArrowUp, { className: "size-3.5" }) }) }), _jsx(Hint, { label: tI18nComplete.raw('text40bb50da160c'), children: _jsx(Button, { type: "button", size: "icon-sm", variant: "ghost", "aria-label": tI18nComplete.raw('text54e22a5335af'), disabled: disabled || index === chain.models.length - 1, onClick: () => onChange({ ...chain, models: moveFallback(chain.models, index, 1) }), children: _jsx(ArrowDown, { className: "size-3.5" }) }) }), _jsx(Hint, { label: tI18nComplete.raw('textc3812fc4acb8'), children: _jsx(Button, { type: "button", size: "icon-sm", variant: "ghost", "aria-label": tI18nComplete.raw('textb4e437b00de3'), disabled: disabled, onClick: () => onChange({
|
|
257
|
-
...chain,
|
|
258
|
-
models: chain.models.filter((_, itemIndex) => itemIndex !== index),
|
|
259
|
-
}), children: _jsx(Trash2, { className: "size-3.5" }) }) })] }, model))), !disabled ? (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsx(Plus, { className: "text-muted-foreground/60 ml-0.5 size-3 shrink-0" }), _jsx(RoutingModelSelector, { value: null, models: models, exclude: taken, unsetLabel: canAdd ? tI18nComplete.raw('text5b660045c015') : tI18nComplete.raw('text82e4b64f1673'), disabled: !canAdd || chain.models.length >= MAX_FALLBACKS, onChange: (next) => next && onChange({ ...chain, models: [...chain.models, next] }) })] })) : null, chain.models.length === 0 && disabled ? (_jsx("p", { className: "text-muted-foreground text-xs", children: tI18nComplete.raw('text545403adb9e5') })) : null, _jsxs("div", { className: "mt-1.5 flex items-center gap-2", children: [_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: tI18nComplete.raw('textbb68ff20e011') }), _jsx(ConditionSelect, { value: chain.fallbackOn, onChange: (fallbackOn) => onChange({ ...chain, fallbackOn }), disabled: disabled })] })] }));
|
|
260
|
-
}
|
|
261
129
|
/**
|
|
262
130
|
* Routing's heading band — a SECTION heading, in the page's own column.
|
|
263
131
|
*
|
|
@@ -277,6 +145,7 @@ function RoutingSection({ action, children }) {
|
|
|
277
145
|
}
|
|
278
146
|
export function GatewayRouting({ projectId, canWrite, projectDefaultPending, }) {
|
|
279
147
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
148
|
+
const t = useTranslations('gatewayRouting');
|
|
280
149
|
const queryClient = useQueryClient();
|
|
281
150
|
const routing = useGatewayRoutingPolicy(projectId);
|
|
282
151
|
const modelDefaults = useModelDefaults(projectId);
|
|
@@ -284,7 +153,6 @@ export function GatewayRouting({ projectId, canWrite, projectDefaultPending, })
|
|
|
284
153
|
const pickerCatalog = useProjectModelPickerCatalog(projectId);
|
|
285
154
|
const [draft, setDraft] = useState(null);
|
|
286
155
|
const [fallbackMode, setFallbackMode] = useState('inherit');
|
|
287
|
-
const [advancedOpen, setAdvancedOpen] = useState(false);
|
|
288
156
|
const [resetOpen, setResetOpen] = useState(false);
|
|
289
157
|
const [availability, setAvailability] = useState({});
|
|
290
158
|
const [hydratedPolicySignature, setHydratedPolicySignature] = useState(null);
|
|
@@ -298,7 +166,6 @@ export function GatewayRouting({ projectId, canWrite, projectDefaultPending, })
|
|
|
298
166
|
setHydratedPolicySignature(persistedSignature);
|
|
299
167
|
setDraft(clonePolicy(persistedProject));
|
|
300
168
|
setFallbackMode(fallbackModeForPolicy(persistedProject.defaultFallback));
|
|
301
|
-
setAdvancedOpen((current) => current || hasAdvancedRoutingConfig(persistedProject));
|
|
302
169
|
}
|
|
303
170
|
const previewRoute = routing.preview.mutateAsync;
|
|
304
171
|
// Debounced availability preview: whenever the draft's referenced models
|
|
@@ -387,7 +254,10 @@ export function GatewayRouting({ projectId, canWrite, projectDefaultPending, })
|
|
|
387
254
|
rules: policy.rules,
|
|
388
255
|
modelGenerationConfig: policy.modelGenerationConfig ?? {},
|
|
389
256
|
});
|
|
390
|
-
|
|
257
|
+
// The mode counts too: "try backups" with an empty chain serializes like
|
|
258
|
+
// "show the error", but it is an unsaved (and invalid) choice.
|
|
259
|
+
const dirty = fallbackMode !== fallbackModeForPolicy(routing.data.project.defaultFallback) ||
|
|
260
|
+
JSON.stringify(editableState(draft)) !== JSON.stringify(editableState(routing.data.project));
|
|
391
261
|
const projectDefaultWire = modelDefaults.projectDefault
|
|
392
262
|
? modelKeyToWire(modelDefaults.projectDefault)
|
|
393
263
|
: null;
|
|
@@ -395,11 +265,12 @@ export function GatewayRouting({ projectId, canWrite, projectDefaultPending, })
|
|
|
395
265
|
const validation = validateRoutingDraft({ ...draft, defaultModel: primaryModel }, fallbackMode);
|
|
396
266
|
const usedRuleModels = draft.rules.map((rule) => rule.model);
|
|
397
267
|
const usedRuleModelSet = new Set(usedRuleModels);
|
|
398
|
-
const
|
|
268
|
+
const selectableModels = models.filter(isSelectableModel);
|
|
269
|
+
const newRuleModel = selectableModels.find((model) => modelKeyToWire(model) !== primaryModel && !usedRuleModelSet.has(modelKeyToWire(model)));
|
|
399
270
|
const inheritedRoute = [
|
|
400
271
|
routing.data.effective.defaultModel,
|
|
401
272
|
...routing.data.effective.defaultFallback.models,
|
|
402
|
-
]
|
|
273
|
+
];
|
|
403
274
|
const setRule = (index, rule) => {
|
|
404
275
|
setDraft((current) => {
|
|
405
276
|
if (!current)
|
|
@@ -421,10 +292,11 @@ export function GatewayRouting({ projectId, canWrite, projectDefaultPending, })
|
|
|
421
292
|
}
|
|
422
293
|
if (current.defaultFallback?.models.length)
|
|
423
294
|
return current;
|
|
424
|
-
const
|
|
295
|
+
const runnable = new Set(selectableModels.map((model) => modelKeyToWire(model)));
|
|
296
|
+
const inherited = routing.data.effective.defaultFallback.models.filter((model) => model !== primaryModel && runnable.has(model));
|
|
425
297
|
// No model id is hardcoded: the platform fallback already follows the
|
|
426
298
|
// served lineup (`inherited`); otherwise take the first other model.
|
|
427
|
-
const preferred =
|
|
299
|
+
const preferred = selectableModels.find((model) => modelKeyToWire(model) !== primaryModel);
|
|
428
300
|
return {
|
|
429
301
|
...current,
|
|
430
302
|
defaultFallback: {
|
|
@@ -438,56 +310,65 @@ export function GatewayRouting({ projectId, canWrite, projectDefaultPending, })
|
|
|
438
310
|
};
|
|
439
311
|
});
|
|
440
312
|
};
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
313
|
+
const removeRule = (index) => setDraft({ ...draft, rules: draft.rules.filter((_, itemIndex) => itemIndex !== index) });
|
|
314
|
+
const addRule = newRuleModel && draft.rules.length < MAX_RULES
|
|
315
|
+
? () => {
|
|
316
|
+
const model = modelKeyToWire(newRuleModel);
|
|
317
|
+
setDraft({
|
|
318
|
+
...draft,
|
|
319
|
+
rules: [...draft.rules, { model, fallbackModels: [], fallbackOn: 'transient' }],
|
|
320
|
+
});
|
|
321
|
+
return model;
|
|
322
|
+
}
|
|
323
|
+
: null;
|
|
324
|
+
const generationControls = (_jsx(GenerationControlsPanel, { model: primaryModel, catalogModel: pickerCatalog?.models?.[primaryModel], value: draft.modelGenerationConfig?.[primaryModel], disabled: controlsDisabled, onChange: (next) => setDraft({
|
|
325
|
+
...draft,
|
|
326
|
+
modelGenerationConfig: {
|
|
327
|
+
...draft.modelGenerationConfig,
|
|
328
|
+
[primaryModel]: next,
|
|
329
|
+
},
|
|
330
|
+
}) }));
|
|
331
|
+
const layoutProps = {
|
|
332
|
+
draft,
|
|
333
|
+
setDraft,
|
|
334
|
+
setRule,
|
|
335
|
+
removeRule,
|
|
336
|
+
addRule,
|
|
337
|
+
fallbackMode,
|
|
338
|
+
changeFallbackMode,
|
|
339
|
+
models,
|
|
340
|
+
selectableModels,
|
|
341
|
+
availability,
|
|
342
|
+
primaryModel,
|
|
343
|
+
inheritedRoute,
|
|
344
|
+
inheritedFallbackOn: routing.data.effective.defaultFallback.fallbackOn,
|
|
345
|
+
// What "Auto" resolves to: the inherited model, not this project's own
|
|
346
|
+
// override (choosing Auto clears that override).
|
|
347
|
+
effectiveVisionModel: (routing.data.project.visionModel
|
|
348
|
+
? routing.data.platform.visionModel
|
|
349
|
+
: routing.data.effective.visionModel) ?? null,
|
|
350
|
+
generationControls,
|
|
351
|
+
controlsDisabled,
|
|
352
|
+
writable: Boolean(writable),
|
|
353
|
+
};
|
|
354
|
+
return (_jsxs(RoutingSection, { action: writable ? (_jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: controlsDisabled, onClick: () => setResetOpen(true), children: [_jsx(RotateCcw, { className: "size-3.5" }), " ", tI18nComplete.raw('textdaee7606b339')] })) : (_jsx(Badge, { variant: "muted", size: "sm", children: tI18nComplete.raw('text8ac767353080') })), children: [_jsx(RoutingSentenceLayout, { ...layoutProps }), writable && (dirty || routing.set.isPending) ? (_jsx(RoutingSaveBar, { message: validation ?? t('unsaved'), saving: routing.set.isPending, canSave: dirty && !validation && !controlsDisabled, onDiscard: () => {
|
|
355
|
+
setDraft(clonePolicy(routing.data.project));
|
|
356
|
+
setFallbackMode(fallbackModeForPolicy(routing.data.project.defaultFallback));
|
|
357
|
+
}, onSave: () => {
|
|
358
|
+
const defaultModel = modelDefaults.data ? projectDefaultWire : draft.defaultModel;
|
|
359
|
+
routing.set.mutate({ ...draft, defaultModel }, {
|
|
360
|
+
onSuccess: async () => {
|
|
361
|
+
await Promise.all([
|
|
362
|
+
queryClient.invalidateQueries({ queryKey: ['model-defaults', projectId] }),
|
|
363
|
+
queryClient.invalidateQueries({
|
|
364
|
+
queryKey: qk.project.modelPicker(projectId),
|
|
365
|
+
}),
|
|
366
|
+
]);
|
|
367
|
+
successToast(tI18nComplete.raw('text538f96979be7'));
|
|
368
|
+
},
|
|
369
|
+
onError: (error) => errorToast(error instanceof Error ? error.message : tI18nComplete.raw('text4501be681694')),
|
|
370
|
+
});
|
|
371
|
+
} })) : null, _jsx(ConfirmDialog, { open: resetOpen, onOpenChange: setResetOpen, title: tI18nComplete.raw('text7918f9e61a56'), description: tI18nComplete.raw('textaf87e03f3626'), confirmLabel: tI18nComplete.raw('textf665e07f2a78'), confirmVariant: "destructive", isPending: routing.reset.isPending, onConfirm: () => routing.reset.mutate(undefined, {
|
|
491
372
|
onSuccess: () => {
|
|
492
373
|
setResetOpen(false);
|
|
493
374
|
void queryClient.invalidateQueries({ queryKey: ['model-defaults', projectId] });
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import { Button } from '../../../../primitives/button.js';
|
|
3
|
+
import type { GatewayFallbackChain, GatewayProjectRoutingPolicy, GatewayRoutingRule } from '@kortix/sdk';
|
|
4
|
+
import { useProjectModels } from '@kortix/sdk/react';
|
|
5
|
+
export declare const MAX_FALLBACKS = 8;
|
|
6
|
+
export declare const MAX_RULES = 20;
|
|
7
|
+
export type FallbackMode = 'inherit' | 'custom' | 'disabled';
|
|
8
|
+
export type RoutingModel = ReturnType<typeof useProjectModels>[number];
|
|
9
|
+
/**
|
|
10
|
+
* Everything the Routing layout reads and writes. The state lives in
|
|
11
|
+
* `GatewayRouting`; the layout is a pure view over it.
|
|
12
|
+
*/
|
|
13
|
+
export interface RoutingLayoutProps {
|
|
14
|
+
draft: GatewayProjectRoutingPolicy;
|
|
15
|
+
setDraft: (draft: GatewayProjectRoutingPolicy) => void;
|
|
16
|
+
setRule: (index: number, rule: GatewayRoutingRule) => void;
|
|
17
|
+
removeRule: (index: number) => void;
|
|
18
|
+
/** Adds a rule for the first runnable model without one. `null` when none is left or the cap is hit. */
|
|
19
|
+
addRule: (() => string) | null;
|
|
20
|
+
fallbackMode: FallbackMode;
|
|
21
|
+
changeFallbackMode: (mode: FallbackMode) => void;
|
|
22
|
+
/** Every model the draft can name, including ones that are no longer runnable. */
|
|
23
|
+
models: RoutingModel[];
|
|
24
|
+
/** The models a person may pick: offered by the project and runnable for the caller. */
|
|
25
|
+
selectableModels: RoutingModel[];
|
|
26
|
+
availability: Record<string, boolean>;
|
|
27
|
+
primaryModel: string;
|
|
28
|
+
/** The platform route this project inherits: primary first. */
|
|
29
|
+
inheritedRoute: string[];
|
|
30
|
+
/** The condition the inherited route switches on. */
|
|
31
|
+
inheritedFallbackOn: GatewayFallbackChain['fallbackOn'];
|
|
32
|
+
effectiveVisionModel: string | null;
|
|
33
|
+
/** Generation controls for the primary model, rendered by the host. */
|
|
34
|
+
generationControls: ReactNode;
|
|
35
|
+
controlsDisabled: boolean;
|
|
36
|
+
writable: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A model the project can choose: the project offers it (`enabled`) and its
|
|
40
|
+
* provider is connected for the caller (`available`). Undefined means the
|
|
41
|
+
* catalog does not say, which counts as yes.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isSelectableModel(model: RoutingModel): boolean;
|
|
44
|
+
export declare function findModel(models: RoutingModel[], wire: string | null): RoutingModel | undefined;
|
|
45
|
+
/** A model's display name for a wire id, falling back to the id. */
|
|
46
|
+
export declare function modelLabel(models: RoutingModel[], wire: string | null): string;
|
|
47
|
+
export declare function moveFallback(models: string[], index: number, delta: -1 | 1): string[];
|
|
48
|
+
/**
|
|
49
|
+
* A model in a sentence: provider logo and name, read-only or removable.
|
|
50
|
+
* The same pill shape the pickers use, so a chain reads as one row of things.
|
|
51
|
+
*/
|
|
52
|
+
export declare function ModelChip({ wire, models, unavailable, onRemove, }: {
|
|
53
|
+
wire: string;
|
|
54
|
+
models: RoutingModel[];
|
|
55
|
+
unavailable?: boolean;
|
|
56
|
+
onRemove?: () => void;
|
|
57
|
+
}): import("react").JSX.Element;
|
|
58
|
+
/**
|
|
59
|
+
* Searchable model list in a popover. `multiple` keeps the popover open and
|
|
60
|
+
* numbers the picked models in pick order, so a whole backup chain is built
|
|
61
|
+
* in one visit; single mode closes on pick. `leading` is an extra first row
|
|
62
|
+
* (for example "Auto").
|
|
63
|
+
*/
|
|
64
|
+
export declare function ModelPicker({ models, selected, onToggle, multiple, exclude, trigger, leading, disabled, }: {
|
|
65
|
+
models: RoutingModel[];
|
|
66
|
+
/** Picked wire ids, in order. */
|
|
67
|
+
selected: string[];
|
|
68
|
+
onToggle: (wire: string) => void;
|
|
69
|
+
multiple?: boolean;
|
|
70
|
+
exclude?: string[];
|
|
71
|
+
trigger: ReactNode;
|
|
72
|
+
leading?: {
|
|
73
|
+
label: string;
|
|
74
|
+
active: boolean;
|
|
75
|
+
onSelect: () => void;
|
|
76
|
+
};
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
}): import("react").JSX.Element;
|
|
79
|
+
/** A picker trigger that shows the chosen model as a chip with a caret. */
|
|
80
|
+
export declare function ModelPickerButton({ wire, models, placeholder, unavailable, className, ...props }: {
|
|
81
|
+
wire: string | null;
|
|
82
|
+
models: RoutingModel[];
|
|
83
|
+
placeholder: string;
|
|
84
|
+
unavailable?: boolean;
|
|
85
|
+
} & ComponentProps<typeof Button>): import("react").JSX.Element;
|
|
86
|
+
/** The dashed "+" that opens the multi-select backup picker. */
|
|
87
|
+
export declare function AddModelButton({ label, className, ...props }: {
|
|
88
|
+
label: string;
|
|
89
|
+
} & ComponentProps<typeof Button>): import("react").JSX.Element;
|
|
90
|
+
export declare function ConditionSelect({ value, onChange, disabled, }: {
|
|
91
|
+
value: GatewayFallbackChain['fallbackOn'];
|
|
92
|
+
onChange: (value: GatewayFallbackChain['fallbackOn']) => void;
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
}): import("react").JSX.Element;
|
|
95
|
+
export declare function RoutingSaveBar({ message, saving, canSave, onDiscard, onSave, }: {
|
|
96
|
+
message: string;
|
|
97
|
+
saving: boolean;
|
|
98
|
+
canSave: boolean;
|
|
99
|
+
onDiscard: () => void;
|
|
100
|
+
onSave: () => void;
|
|
101
|
+
}): import("react").JSX.Element;
|