@kabmo-labs/kabmo 0.22.0 → 0.24.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/client/index.html +1 -1
- package/dist/client/index.js +873 -524
- package/dist/client/static/js/{index-297dck9a.js → index-jcr5twtp.js} +799 -795
- package/dist/client/static/js/index-z3w7n85q.css +1 -0
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/groups.test.ts +14 -0
- package/marketplace/plugins/stats/src/groups.ts +20 -0
- package/marketplace/plugins/stats/src/labels.test.ts +9 -0
- package/marketplace/plugins/stats/src/labels.ts +7 -0
- package/marketplace/plugins/stats/src/server.ts +1 -1
- package/package.json +1 -1
- package/src/client/App.tsx +20 -19
- package/src/client/components/common/ComposerTextarea.tsx +10 -1
- package/src/client/components/common/Modal.tsx +2 -6
- package/src/client/components/common/PWAInstallButton.tsx +3 -2
- package/src/client/components/common/Toast.test.tsx +298 -0
- package/src/client/components/common/Toast.tsx +103 -37
- package/src/client/components/common/ToastStack.tsx +33 -12
- package/src/client/components/common/ViewportSelector.tsx +122 -114
- package/src/client/components/common/context-usage-button/Ring.tsx +38 -1
- package/src/client/components/common/context-usage-button/index.test.tsx +19 -3
- package/src/client/components/common/context-usage-button/index.tsx +5 -2
- package/src/client/components/common/harness-glyph/brands.ts +65 -0
- package/src/client/components/common/harness-glyph/harness-glyph.test.ts +185 -0
- package/src/client/components/common/harness-glyph/index.tsx +131 -0
- package/src/client/components/common/header-controls/MoreMenu.tsx +2 -1
- package/src/client/components/common/header-controls/index.tsx +16 -8
- package/src/client/components/common/header-panel-buttons/index.tsx +4 -3
- package/src/client/components/common/panel-mark/index.test.tsx +2 -2
- package/src/client/components/common/panel-mark/index.tsx +11 -2
- package/src/client/components/common/search-select/index.tsx +305 -0
- package/src/client/components/common/search-select/search-select.test.tsx +217 -0
- package/src/client/components/common/server-control/index.tsx +3 -2
- package/src/client/components/common/session-row/index.tsx +18 -1
- package/src/client/components/common/toolbar-row/index.tsx +57 -20
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +1 -3
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +3 -2
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +7 -1
- package/src/client/components/layout/desktop-layout/index.tsx +1 -3
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +1 -0
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +18 -1
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +1 -3
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.test.tsx +332 -0
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.tsx +310 -0
- package/src/client/components/layout/session-sidebar/about-modal/SocialLinks.tsx +63 -51
- package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +4 -2
- package/src/client/components/layout/session-sidebar/about-modal/index.test.tsx +122 -0
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +136 -35
- package/src/client/components/layout/session-sidebar/harness-mark.test.tsx +126 -0
- package/src/client/components/layout/session-sidebar/modern/ActionRow.tsx +4 -3
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +1 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +1 -7
- package/src/client/components/mobile/SessionSidebar.tsx +1 -3
- package/src/client/components/mobile/mobile-main-view/Header.tsx +3 -2
- package/src/client/components/mobile/mobile-session-sidebar/Dialogs.tsx +0 -8
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +1 -0
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +17 -1
- package/src/client/components/settings/Modal.tsx +26 -22
- package/src/client/components/settings/Sidebar.tsx +45 -5
- package/src/client/components/settings/categories/HarnessSettings.tsx +207 -0
- package/src/client/components/settings/categories/ProjectSettings.tsx +1 -3
- package/src/client/components/settings/categories/ProviderSettings.tsx +0 -4
- package/src/client/components/settings/categories/SkillCatalogSettings.tsx +13 -23
- package/src/client/components/settings/categories/agent-settings/ModelPicker.tsx +23 -30
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +20 -11
- package/src/client/components/settings/categories/chat-settings/GoalSection.tsx +16 -16
- package/src/client/components/settings/categories/harness-settings/AddProviderForm.tsx +219 -0
- package/src/client/components/settings/categories/harness-settings/ConfigForm.tsx +268 -0
- package/src/client/components/settings/categories/harness-settings/EnvProviderForm.tsx +146 -0
- package/src/client/components/settings/categories/harness-settings/HarnessCard.tsx +278 -0
- package/src/client/components/settings/categories/harness-settings/ImportSection.tsx +195 -0
- package/src/client/components/settings/categories/harness-settings/ProviderPanel.tsx +152 -0
- package/src/client/components/settings/categories/harness-settings/ToggleList.tsx +147 -0
- package/src/client/components/settings/categories/harness-settings/parts.test.tsx +97 -0
- package/src/client/components/settings/categories/harness-settings/parts.tsx +84 -0
- package/src/client/components/settings/categories/harness-settings/provider-panel.test.tsx +313 -0
- package/src/client/components/settings/categories/omp-settings/RoleEditor.test.ts +60 -39
- package/src/client/components/settings/categories/omp-settings/RoleRow.tsx +32 -41
- package/src/client/components/settings/categories/omp-settings/role-picker.test-util.ts +45 -0
- package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +11 -4
- package/src/client/components/settings/groups.test.tsx +160 -0
- package/src/client/components/settings/harness-icons.test.tsx +134 -0
- package/src/client/components/workspace/browser-panel/AddressBar.tsx +3 -13
- package/src/client/components/workspace/browser-toolbar/clusters.tsx +237 -0
- package/src/client/components/workspace/browser-toolbar/index.test.tsx +167 -0
- package/src/client/components/workspace/browser-toolbar/index.tsx +99 -100
- package/src/client/components/workspace/btw-panel/Messages.tsx +4 -1
- package/src/client/components/workspace/btw-panel/index.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +11 -7
- package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +5 -2
- package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +13 -0
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +13 -0
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.test.ts +41 -0
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +19 -14
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +14 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +6 -0
- package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +14 -0
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +4 -0
- package/src/client/components/workspace/chat-timeline/RunMark.tsx +58 -0
- package/src/client/components/workspace/chat-timeline/SubagentView.tsx +4 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +4 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +11 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +13 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +8 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +27 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +48 -23
- package/src/client/components/workspace/chat-timeline/chat-input/composer-portal.test.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +21 -1
- package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +7 -0
- package/src/client/components/workspace/chat-timeline/chat-input/props.ts +13 -0
- package/src/client/components/workspace/chat-timeline/chat-input/selection.ts +11 -2
- package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +17 -15
- package/src/client/components/workspace/chat-timeline/pending-harness.test.tsx +157 -0
- package/src/client/components/workspace/chat-timeline/run-mark.test.ts +104 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FrameControl.tsx +11 -20
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts.ts +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.test.ts +31 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +5 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.test.ts +56 -45
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +38 -94
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/wait-parts.tsx +76 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +2 -1
- package/src/client/components/workspace/file-explorer/index.test.ts +25 -0
- package/src/client/components/workspace/file-explorer/index.tsx +10 -6
- package/src/client/components/workspace/git-panel/index.test.ts +13 -3
- package/src/client/components/workspace/git-panel/index.tsx +1 -3
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +92 -0
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +290 -0
- package/src/client/components/workspace/model-dropdown/Item.tsx +11 -0
- package/src/client/components/workspace/model-dropdown/Panel.tsx +119 -8
- package/src/client/components/workspace/model-dropdown/Section.tsx +4 -0
- package/src/client/components/workspace/model-dropdown/fullscreen-picker.ts +51 -0
- package/src/client/components/workspace/model-dropdown/harness-models.test.ts +177 -0
- package/src/client/components/workspace/model-dropdown/harness-models.ts +148 -0
- package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +336 -0
- package/src/client/components/workspace/model-dropdown/index.tsx +114 -85
- package/src/client/components/workspace/model-dropdown/placement.test.tsx +127 -0
- package/src/client/components/workspace/model-dropdown/popover-metrics.test.ts +107 -0
- package/src/client/components/workspace/model-dropdown/popover-metrics.ts +118 -0
- package/src/client/components/workspace/model-dropdown/row-mutations.ts +106 -0
- package/src/client/components/workspace/model-dropdown/trigger.test.ts +22 -2
- package/src/client/components/workspace/model-dropdown/use-popover-size.ts +89 -0
- package/src/client/data/settings/omp-schema.json +224 -17
- package/src/client/hooks/chat/composer/index.ts +11 -2
- package/src/client/hooks/chat/composer/items.test.ts +11 -0
- package/src/client/hooks/chat/composer/items.ts +4 -2
- package/src/client/hooks/chat/composer/model-selection.test.ts +110 -0
- package/src/client/hooks/chat/composer/model-selection.ts +45 -4
- package/src/client/hooks/chat/omp/prompt-send.ts +4 -2
- package/src/client/hooks/chat/timeline/actions.ts +10 -5
- package/src/client/hooks/chat/timeline/ask-frames.ts +5 -4
- package/src/client/hooks/chat/timeline/composer-local-actions.test.ts +19 -81
- package/src/client/hooks/chat/timeline/composer-modes.ts +11 -2
- package/src/client/hooks/chat/timeline/composer-refs.ts +16 -1
- package/src/client/hooks/chat/timeline/index.ts +27 -35
- package/src/client/hooks/chat/timeline/mode-availability.test.ts +51 -0
- package/src/client/hooks/chat/timeline/modes-contract.ts +6 -0
- package/src/client/hooks/chat/timeline/modes.ts +41 -2
- package/src/client/hooks/chat/timeline/new-chat-open.test.ts +86 -0
- package/src/client/hooks/chat/timeline/new-chat-open.ts +23 -5
- package/src/client/hooks/chat/timeline/new-chat.test.ts +32 -4
- package/src/client/hooks/chat/timeline/new-chat.ts +18 -6
- package/src/client/hooks/chat/timeline/prompt-text.test.ts +7 -0
- package/src/client/hooks/chat/timeline/prompt-text.ts +15 -6
- package/src/client/hooks/chat/timeline/rewind-actions.test.ts +51 -1
- package/src/client/hooks/chat/timeline/rewind-actions.ts +23 -1
- package/src/client/hooks/chat/timeline/run-identity.test.ts +52 -0
- package/src/client/hooks/chat/timeline/run-identity.ts +23 -11
- package/src/client/hooks/chat/timeline/send-execute.test.ts +55 -0
- package/src/client/hooks/chat/timeline/send-props.ts +11 -3
- package/src/client/hooks/chat/timeline/send-steer.test.ts +2 -3
- package/src/client/hooks/chat/timeline/send.test-util.ts +3 -2
- package/src/client/hooks/chat/timeline/send.test.ts +2 -3
- package/src/client/hooks/chat/timeline/send.ts +34 -8
- package/src/client/hooks/chat/timeline/session-harness.test.ts +163 -0
- package/src/client/hooks/chat/timeline/session-harness.ts +164 -0
- package/src/client/hooks/chat/timeline/session-load.test-util.ts +6 -2
- package/src/client/hooks/chat/timeline/session-load.test.ts +31 -0
- package/src/client/hooks/chat/timeline/session-load.ts +6 -14
- package/src/client/hooks/chat/timeline/session-shapes.ts +32 -0
- package/src/client/hooks/chat/timeline/spawn-harness.ts +41 -0
- package/src/client/hooks/chat/timeline/timeline-running.ts +55 -0
- package/src/client/hooks/chat/timeline/tui-only-guard.ts +9 -0
- package/src/client/hooks/chat/timeline/undo-confirmation.test.ts +131 -0
- package/src/client/hooks/models/harness-catalog.ts +114 -0
- package/src/client/hooks/models/provider-writes.test.ts +81 -0
- package/src/client/hooks/models/provider-writes.ts +144 -0
- package/src/client/hooks/models/use-harness-versions.test.ts +152 -0
- package/src/client/hooks/models/use-harness-versions.ts +136 -0
- package/src/client/hooks/models/use-harnesses-controller.ts +57 -0
- package/src/client/hooks/models/use-harnesses-signal.test.ts +128 -0
- package/src/client/hooks/models/use-harnesses.test.ts +187 -0
- package/src/client/hooks/models/use-harnesses.ts +215 -0
- package/src/client/hooks/settings/providers/index.ts +1 -3
- package/src/client/hooks/ui/editor-error-toast.ts +10 -3
- package/src/client/hooks/ui/icon-style.ts +28 -0
- package/src/client/hooks/ui/on-click-outside.test.ts +104 -0
- package/src/client/hooks/ui/on-click-outside.ts +14 -2
- package/src/client/hooks/ui/theme.ts +6 -0
- package/src/client/hooks/ui/toast-queue.test.ts +126 -0
- package/src/client/hooks/ui/toasts.ts +132 -27
- package/src/client/hooks/ui/ui-feedback.test.ts +4 -91
- package/src/client/lib/ui/control-plate.test.ts +76 -0
- package/src/client/lib/ui/control-plate.ts +65 -0
- package/src/client/tailwind.css +47 -1
- package/src/server/lib/assets/shell-attributes.server.ts +9 -2
- package/src/server/lib/assets/shell-attributes.test.ts +22 -6
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/harness/acp/acp-audit.server.ts +107 -0
- package/src/server/lib/harness/acp/acp-goal-driver.server.ts +153 -0
- package/src/server/lib/harness/acp/acp-goal-state.server.ts +136 -0
- package/src/server/lib/harness/acp/acp-goal.server.ts +273 -0
- package/src/server/lib/harness/acp/acp-goal.test.ts +229 -0
- package/src/server/lib/harness/acp/acp-telemetry.server.ts +133 -0
- package/src/server/lib/harness/acp/acp-telemetry.test.ts +85 -0
- package/src/server/lib/harness/acp/acp-todos.server.ts +45 -0
- package/src/server/lib/harness/acp/acp-todos.test.ts +43 -0
- package/src/server/lib/harness/acp/activation.test.ts +81 -0
- package/src/server/lib/harness/acp/activation.ts +72 -0
- package/src/server/lib/harness/acp/calls.ts +97 -0
- package/src/server/lib/harness/acp/client.test.ts +73 -0
- package/src/server/lib/harness/acp/client.ts +339 -0
- package/src/server/lib/harness/acp/commands.test.ts +92 -0
- package/src/server/lib/harness/acp/commands.ts +165 -0
- package/src/server/lib/harness/acp/frames.test.ts +315 -0
- package/src/server/lib/harness/acp/frames.ts +349 -0
- package/src/server/lib/harness/acp/mapper.ts +204 -0
- package/src/server/lib/harness/acp/permissions.test.ts +66 -0
- package/src/server/lib/harness/acp/permissions.ts +155 -0
- package/src/server/lib/harness/acp/prompt.test.ts +130 -0
- package/src/server/lib/harness/acp/prompt.ts +134 -0
- package/src/server/lib/harness/acp/protocol.ts +162 -0
- package/src/server/lib/harness/acp/session-config.test.ts +73 -0
- package/src/server/lib/harness/acp/session-config.ts +148 -0
- package/src/server/lib/harness/acp/session-facts.ts +71 -0
- package/src/server/lib/harness/acp/session-handshake.ts +89 -0
- package/src/server/lib/harness/acp/session-idle.ts +51 -0
- package/src/server/lib/harness/acp/session-notifications.ts +95 -0
- package/src/server/lib/harness/acp/session-observers.test.ts +193 -0
- package/src/server/lib/harness/acp/session-options.ts +33 -0
- package/src/server/lib/harness/acp/session-permissions.test.ts +105 -0
- package/src/server/lib/harness/acp/session-permissions.ts +74 -0
- package/src/server/lib/harness/acp/session-reaper.test.ts +96 -0
- package/src/server/lib/harness/acp/session-turns.ts +95 -0
- package/src/server/lib/harness/acp/session-usage.ts +60 -0
- package/src/server/lib/harness/acp/session-web-state.ts +61 -0
- package/src/server/lib/harness/acp/session.test-util.ts +160 -0
- package/src/server/lib/harness/acp/session.test.ts +233 -0
- package/src/server/lib/harness/acp/session.ts +350 -0
- package/src/server/lib/harness/acp/turn.ts +199 -0
- package/src/server/lib/harness/acp/verbs.ts +87 -0
- package/src/server/lib/harness/auto-probe.server.test.ts +121 -0
- package/src/server/lib/harness/auto-probe.server.ts +178 -0
- package/src/server/lib/harness/capabilities.ts +67 -0
- package/src/server/lib/harness/config-invalidation.test.ts +91 -0
- package/src/server/lib/harness/config.server.test.ts +105 -0
- package/src/server/lib/harness/config.server.ts +98 -0
- package/src/server/lib/harness/enabled.server.test.ts +87 -0
- package/src/server/lib/harness/enabled.server.ts +61 -0
- package/src/server/lib/harness/launch-table.ts +195 -0
- package/src/server/lib/harness/launch.test.ts +220 -0
- package/src/server/lib/harness/launch.ts +216 -0
- package/src/server/lib/harness/probe-cache.server.test.ts +154 -0
- package/src/server/lib/harness/probe-cache.server.ts +177 -0
- package/src/server/lib/harness/provider-entry.ts +212 -0
- package/src/server/lib/harness/provider-file.server.ts +67 -0
- package/src/server/lib/harness/provider-import.test.ts +191 -0
- package/src/server/lib/harness/provider-probe.server.ts +123 -0
- package/src/server/lib/harness/provider-sources.server.test.ts +45 -0
- package/src/server/lib/harness/provider-sources.server.ts +308 -0
- package/src/server/lib/harness/provider-write-error.ts +19 -0
- package/src/server/lib/harness/provider-write.server.test.ts +308 -0
- package/src/server/lib/harness/provider-write.server.ts +339 -0
- package/src/server/lib/harness/provider-zcode.server.test.ts +270 -0
- package/src/server/lib/harness/provider-zcode.server.ts +324 -0
- package/src/server/lib/harness/register.server.ts +36 -0
- package/src/server/lib/harness/registry.ts +58 -0
- package/src/server/lib/harness/schema.server.ts +129 -0
- package/src/server/lib/harness/session-store.server.test.ts +175 -0
- package/src/server/lib/harness/session-store.server.ts +206 -0
- package/src/server/lib/harness/session-title.server.test.ts +109 -0
- package/src/server/lib/harness/session-title.server.ts +70 -0
- package/src/server/lib/harness/session.ts +74 -0
- package/src/server/lib/harness/spawn.server.ts +133 -0
- package/src/server/lib/harness/update-state.server.ts +185 -0
- package/src/server/lib/lifecycle/after-listen.ts +7 -0
- package/src/server/lib/models/provider-items.server.ts +1 -1
- package/src/server/lib/models/registry-refresh.server.test.ts +87 -0
- package/src/server/lib/models/registry-refresh.server.ts +98 -0
- package/src/server/lib/omp/config/models-config.ts +4 -0
- package/src/server/lib/omp/core/cli.ts +13 -0
- package/src/server/lib/omp/core/host-resolution.test.ts +6 -3
- package/src/server/lib/omp/rpc/child-config.ts +5 -4
- package/src/server/lib/omp/rpc/constants.test.ts +2 -1
- package/src/server/lib/omp/rpc/event-fanout.ts +9 -0
- package/src/server/lib/omp/rpc/forked-resume.test.ts +14 -3
- package/src/server/lib/omp/rpc/rpc-primitives.test.ts +11 -0
- package/src/server/lib/omp/rpc/session-registration.ts +7 -2
- package/src/server/lib/omp/rpc/session-registry.test.ts +2 -1
- package/src/server/lib/omp/rpc/session-registry.ts +74 -5
- package/src/server/lib/omp/session/acp-rows.server.ts +79 -0
- package/src/server/lib/omp/session/delete-flow.server.ts +15 -8
- package/src/server/lib/omp/session/delete.server.ts +12 -0
- package/src/server/lib/omp/session/sidebar-data.harness.test.ts +247 -0
- package/src/server/lib/omp/session/sidebar-data.server.ts +56 -3
- package/src/server/lib/queue/delivery.server.test.ts +4 -2
- package/src/server/lib/queue/payload.test.ts +67 -0
- package/src/server/lib/queue/payload.ts +9 -3
- package/src/server/lib/realtime/signals.server.test.ts +99 -0
- package/src/server/lib/realtime/signals.server.ts +25 -5
- package/src/server/lib/realtime/topics/session-data.server.ts +29 -0
- package/src/server/lib/realtime/topics/session.server.ts +3 -3
- package/src/server/routes/agent/command-resume.test.ts +77 -0
- package/src/server/routes/agent/command.test.ts +243 -2
- package/src/server/routes/agent/command.ts +78 -15
- package/src/server/routes/agent/harness-command.ts +133 -0
- package/src/server/routes/agent/new.ts +63 -1
- package/src/server/routes/chat/rewind.test.ts +147 -0
- package/src/server/routes/chat/rewind.ts +29 -7
- package/src/server/routes/chat/session.test.ts +240 -0
- package/src/server/routes/chat/session.ts +96 -4
- package/src/server/routes/harness/add-provider.test.ts +233 -0
- package/src/server/routes/harness/import-action.ts +272 -0
- package/src/server/routes/harness/import.test.ts +196 -0
- package/src/server/routes/harness/index.ts +13 -0
- package/src/server/routes/harness/root.ts +280 -0
- package/src/server/routes/harness/toggle.test.ts +127 -0
- package/src/server/routes/harness/update.ts +259 -0
- package/src/server/routes/harness/versions.test.ts +148 -0
- package/src/server/routes/harness/versions.ts +105 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/sessions/delete-acp.test.ts +227 -0
- package/src/server/routes/sessions/queue.ts +7 -2
- package/src/server/routes/sessions/routes-queue.test.ts +52 -0
- package/src/server/routes/sessions/routes.test.ts +47 -13
- package/src/server/routes/sessions/session.ts +35 -0
- package/src/server/routes/settings/commands-harness.test.ts +92 -0
- package/src/server/routes/settings/commands.ts +26 -0
- package/src/server/routes/settings/model-override.ts +5 -2
- package/src/server/routes/settings/provider-entry.ts +2 -2
- package/src/server/routes/settings/provider-model.ts +2 -2
- package/src/server/routes/settings/provider-models.ts +2 -2
- package/src/server/routes/settings/provider-refresh.ts +6 -4
- package/src/server/routes/settings/providers.ts +3 -1
- package/src/server/routes/settings/settings-config-routes.test.ts +10 -2
- package/src/server/routes/settings/skills.ts +12 -0
- package/src/shared/lib/chat/ask-form/fields.ts +76 -0
- package/src/shared/lib/chat/ask-form/index.ts +323 -0
- package/src/shared/lib/chat/ask-form/tokens.ts +199 -0
- package/src/shared/lib/chat/ask-form/types.ts +43 -0
- package/src/shared/lib/chat/ask-form.test.ts +137 -0
- package/src/shared/lib/chat/ask-questions.test.ts +65 -1
- package/src/shared/lib/chat/ask-questions.ts +51 -145
- package/src/shared/lib/chat/ask-results.ts +198 -0
- package/src/shared/lib/chat/composer/client.ts +20 -8
- package/src/shared/lib/chat/context/usage.test.ts +8 -4
- package/src/shared/lib/chat/context/usage.ts +17 -3
- package/src/shared/lib/chat/omp/abort.test.ts +61 -0
- package/src/shared/lib/chat/omp/abort.ts +8 -2
- package/src/shared/lib/chat/omp/tool-frames.test.ts +23 -0
- package/src/shared/lib/chat/omp/tool-frames.ts +12 -2
- package/src/shared/lib/chat/timeline/omp-callbacks.ts +13 -1
- package/src/shared/lib/chat/timeline/prompt-error.test.ts +146 -0
- package/src/shared/lib/chat/timeline/prompt-error.ts +88 -0
- package/src/shared/lib/chat/tool/summary-wait.test.ts +18 -8
- package/src/shared/lib/chat/tool/wait-facts.ts +14 -8
- package/src/shared/lib/harness/brand-color.test.ts +66 -0
- package/src/shared/lib/harness/brand-color.ts +96 -0
- package/src/shared/lib/harness/catalog.test.ts +88 -0
- package/src/shared/lib/harness/catalog.ts +169 -0
- package/src/shared/lib/harness/config-fields.test.ts +139 -0
- package/src/shared/lib/harness/config-fields.ts +168 -0
- package/src/shared/lib/harness/config.test.ts +153 -0
- package/src/shared/lib/harness/config.ts +206 -0
- package/src/shared/lib/harness/dialects.test.ts +140 -0
- package/src/shared/lib/harness/dialects.ts +249 -0
- package/src/shared/lib/harness/enabled.test.ts +79 -0
- package/src/shared/lib/harness/enabled.ts +72 -0
- package/src/shared/lib/harness/menu.test.ts +94 -0
- package/src/shared/lib/harness/menu.ts +88 -0
- package/src/shared/lib/harness/provider-facts.test.ts +199 -0
- package/src/shared/lib/harness/provider-facts.ts +349 -0
- package/src/shared/lib/harness/provider-slug.ts +46 -0
- package/src/shared/lib/harness/providers.ts +175 -0
- package/src/shared/lib/harness/rewind.ts +24 -0
- package/src/shared/lib/harness/status.test.ts +158 -0
- package/src/shared/lib/harness/status.ts +112 -0
- package/src/shared/lib/harness/update-plan.test.ts +163 -0
- package/src/shared/lib/harness/update-plan.ts +140 -0
- package/src/shared/lib/harness/updates.test.ts +106 -0
- package/src/shared/lib/harness/updates.ts +177 -0
- package/src/shared/lib/icons/icon-paint-authority.test.ts +16 -4
- package/src/shared/lib/icons/icon-paint-authority.ts +57 -12
- package/src/shared/lib/icons/icon-paint-bucket.test.ts +84 -0
- package/src/shared/lib/icons/icon-paint-css.test.ts +23 -25
- package/src/shared/lib/icons/icon-paint-css.ts +69 -55
- package/src/shared/lib/icons/icon-paint-harness.test.ts +73 -0
- package/src/shared/lib/icons/icon-paint-harness.ts +75 -0
- package/src/shared/lib/icons/icon-paint-ink.ts +108 -0
- package/src/shared/lib/icons/icon-paint-panel.ts +19 -4
- package/src/shared/lib/icons/icon-paint-weight.ts +21 -2
- package/src/shared/lib/icons/icon-tone.ts +118 -21
- package/src/shared/lib/icons/tint-hues.generated.ts +100 -284
- package/src/shared/lib/icons/tint-tones.test.ts +79 -25
- package/src/shared/lib/icons/tint.ts +66 -6
- package/src/shared/lib/models/client.ts +10 -1
- package/src/shared/lib/models/provider/vendors.ts +72 -0
- package/src/shared/lib/omp/config/schema.test.ts +36 -0
- package/src/shared/lib/omp/dialog-methods.ts +4 -3
- package/src/shared/lib/omp/session/messages-map-trace.test.ts +42 -0
- package/src/shared/lib/omp/session/messages-map.ts +6 -1
- package/src/shared/lib/omp/session/parse-message-blocks-toolcall.test.ts +8 -0
- package/src/shared/lib/omp/session/parse-message-blocks.ts +6 -1
- package/src/shared/lib/omp/session/shell-trace.test.ts +69 -0
- package/src/shared/lib/omp/session/shell-trace.ts +63 -0
- package/src/shared/lib/omp/session/sidebar.ts +37 -10
- package/src/shared/lib/omp/session/wait-idle.test.ts +47 -0
- package/src/shared/lib/omp/session/wait-idle.ts +93 -0
- package/src/shared/lib/omp/session/wait.test.ts +34 -33
- package/src/shared/lib/omp/session/wait.ts +25 -39
- package/src/shared/lib/settings/sections.ts +24 -0
- package/src/shared/lib/theme/css.ts +2 -0
- package/src/shared/lib/theme/ink-scale.ts +21 -1
- package/src/shared/lib/theme/theme.test.ts +25 -9
- package/src/shared/lib/ui/safe-area.test.ts +28 -0
- package/src/shared/lib/ui/safe-area.ts +42 -0
- package/src/shared/lib/ui/toast-duration.test.ts +74 -0
- package/src/shared/lib/ui/toast-duration.ts +70 -0
- package/src/shared/types/harness-version.ts +59 -0
- package/src/shared/types/harness.ts +201 -0
- package/src/shared/types/index.ts +2 -0
- package/src/shared/types/omp/agent.ts +13 -0
- package/src/shared/types/settings/state.ts +10 -1
- package/src/shared/types/workspace.ts +10 -0
- package/src/test-support/env.ts +38 -0
- package/src/test-support/file-explorer-render.test-util.ts +37 -0
- package/src/test-support/file-explorer.test-util.ts +20 -18
- package/src/test-support/harness-table.test-util.ts +108 -0
- package/dist/client/static/js/index-7ppta1pb.css +0 -1
|
@@ -9,7 +9,6 @@ import { GitChangesList } from '@/client/components/workspace/git-panel/ChangesL
|
|
|
9
9
|
import { GitPanelModals } from '@/client/components/workspace/git-panel/PanelModals';
|
|
10
10
|
import { GitStashSection } from '@/client/components/workspace/git-panel/StashSection';
|
|
11
11
|
import { GitInitRepository } from '@/client/components/workspace/git-panel/InitRepository';
|
|
12
|
-
import { ToastStack } from '@/client/components/common/ToastStack';
|
|
13
12
|
import { useToasts } from '@/client/hooks/ui/toasts';
|
|
14
13
|
import { useSessionState } from '@/client/hooks/workspace/session-state';
|
|
15
14
|
import { useGitPanelData } from '@/client/hooks/workspace/git-panel-data';
|
|
@@ -69,7 +68,7 @@ export function GitPanel({ className = '', enabled = true, rootPath, refreshKey
|
|
|
69
68
|
const [viewingOutput, setViewingOutput] = useState<CommitHistoryPage | null>(null);
|
|
70
69
|
const [mounted, setMounted] = useState(false);
|
|
71
70
|
|
|
72
|
-
const {
|
|
71
|
+
const { pushToast } = useToasts();
|
|
73
72
|
|
|
74
73
|
useEffect(() => {
|
|
75
74
|
setMounted(true);
|
|
@@ -218,7 +217,6 @@ export function GitPanel({ className = '', enabled = true, rootPath, refreshKey
|
|
|
218
217
|
}}
|
|
219
218
|
/>
|
|
220
219
|
|
|
221
|
-
<ToastStack toasts={toasts} onDismiss={dismissToast} />
|
|
222
220
|
|
|
223
221
|
{/* Repo Switcher Header */}
|
|
224
222
|
<GitRepoHeader
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The model picker at FULL SCREEN, for a phone.
|
|
8
|
+
*
|
|
9
|
+
* Not a bottom sheet. A sheet still gives away the top of the screen and still
|
|
10
|
+
* has to guess a cap (`86dvh` was the first attempt); a phone surface that is
|
|
11
|
+
* choosing the model for the next turn can own the screen instead, which is what
|
|
12
|
+
* the platform's own settings and picker surfaces do. The measured result on a
|
|
13
|
+
* 390x844 phone: a 500px sheet left 344px of dead canvas above it and showed
|
|
14
|
+
* ~7 model rows; the full screen shows 15.
|
|
15
|
+
*
|
|
16
|
+
* PORTALLED to `<body>`, not rendered in place. The composer card can become a
|
|
17
|
+
* containing block for `position: fixed` through `backdrop-filter` (its own
|
|
18
|
+
* `glass` style), a `transform`, or `contain: layout` — and then `inset-0`
|
|
19
|
+
* sizes the overlay to the CARD instead of the screen. Measured in Chromium at
|
|
20
|
+
* 1440x900: re-parenting a dialog's scrim into `[data-composer-style]` took it
|
|
21
|
+
* from 1440x900 at (0,0) to 710x164 at the card's box.
|
|
22
|
+
*
|
|
23
|
+
* `100dvh`, not `100vh`: `vh` is the LARGEST viewport on a phone, so an overlay
|
|
24
|
+
* sized from it runs under the browser chrome. The header carries
|
|
25
|
+
* `env(safe-area-inset-top)` and the footer `…-bottom`, so neither the close
|
|
26
|
+
* control nor the last model row sits under a notch or a home indicator.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { useRef } from 'preact/hooks';
|
|
30
|
+
import type { ComponentChildren } from 'preact';
|
|
31
|
+
import { createPortal } from 'preact/compat';
|
|
32
|
+
import { X } from 'lucide-preact';
|
|
33
|
+
import { useKeyboardInset } from '@/client/hooks/ui/keyboard-inset';
|
|
34
|
+
import { titlebarPaddingLeft, titlebarPaddingRight } from '@/shared/lib/ui/titlebar';
|
|
35
|
+
|
|
36
|
+
interface ModelFullscreenProps {
|
|
37
|
+
open: boolean;
|
|
38
|
+
onClose: () => void;
|
|
39
|
+
/** The picker's own card content — one tree, shared with the popover. */
|
|
40
|
+
children: ComponentChildren;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function ModelFullscreen({ open, onClose, children }: ModelFullscreenProps) {
|
|
44
|
+
// The search field focuses the soft keyboard, which covers the bottom rows.
|
|
45
|
+
// The inset is measured from THIS frame's own bottom edge, so it lifts by
|
|
46
|
+
// exactly the overlap and lifts by nothing when the browser already shrank the
|
|
47
|
+
// viewport — the reason `useKeyboardInset` derives the lift from geometry
|
|
48
|
+
// rather than `innerHeight`. The ref must be created before the early return,
|
|
49
|
+
// because hooks cannot be conditional.
|
|
50
|
+
const frameRef = useRef<HTMLDivElement>(null);
|
|
51
|
+
const keyboardInset = useKeyboardInset(frameRef, open);
|
|
52
|
+
if (!open || typeof document === 'undefined') return null;
|
|
53
|
+
return createPortal(
|
|
54
|
+
<div
|
|
55
|
+
ref={frameRef}
|
|
56
|
+
role="dialog"
|
|
57
|
+
aria-modal="true"
|
|
58
|
+
aria-label="Select model"
|
|
59
|
+
className="fixed inset-0 z-[70] flex h-dvh flex-col bg-paper text-xs"
|
|
60
|
+
>
|
|
61
|
+
<header
|
|
62
|
+
className="flex flex-shrink-0 items-center justify-between border-b border-ink/10 bg-canvas"
|
|
63
|
+
style={{
|
|
64
|
+
paddingTop: 'env(safe-area-inset-top, 0px)',
|
|
65
|
+
paddingLeft: titlebarPaddingLeft('0.75rem', true),
|
|
66
|
+
paddingRight: titlebarPaddingRight('0.75rem', true),
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<span className="py-2.5 text-[11px] font-semibold uppercase tracking-wider text-ink/50">Model</span>
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
onClick={onClose}
|
|
73
|
+
aria-label="Close"
|
|
74
|
+
className="-mr-1 rounded-lg p-1.5 text-ink/60 transition-colors hover:bg-ink/5 hover:text-ink"
|
|
75
|
+
>
|
|
76
|
+
<X size={16} />
|
|
77
|
+
</button>
|
|
78
|
+
</header>
|
|
79
|
+
<div
|
|
80
|
+
className="flex min-h-0 flex-1 flex-col"
|
|
81
|
+
style={{
|
|
82
|
+
paddingBottom: keyboardInset > 0
|
|
83
|
+
? keyboardInset
|
|
84
|
+
: 'env(safe-area-inset-bottom, 0px)',
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
{children}
|
|
88
|
+
</div>
|
|
89
|
+
</div>,
|
|
90
|
+
document.body,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The harness tab strip inside the model dropdown.
|
|
8
|
+
*
|
|
9
|
+
* A TAB, not a second control row: the composer's toolbar is full (model,
|
|
10
|
+
* thinking, access, plan, goal, voice, send) and the harness changes WHAT THE
|
|
11
|
+
* LIST IS, which is what a tab means. `Header.tsx` sits under it because the
|
|
12
|
+
* search field then applies to whichever list the tab selected.
|
|
13
|
+
*
|
|
14
|
+
* Four rules the markup encodes:
|
|
15
|
+
*
|
|
16
|
+
* - a harness that cannot run here is DISABLED, never hidden — hiding is what
|
|
17
|
+
* makes "why is Claude not there" unanswerable;
|
|
18
|
+
* - the reason is the agent's own words, in `title`, so the hover explains
|
|
19
|
+
* `mcode login` or `executable not found (command: pi)`;
|
|
20
|
+
* - the active tab is read-only for a live chat. Harness is a SPAWN property,
|
|
21
|
+
* so switching it must start a new session — the row says so instead of
|
|
22
|
+
* silently changing the frame source under a running transcript;
|
|
23
|
+
* - a tab is the MARK ONLY. Three to five tabs share one strip, and their names
|
|
24
|
+
* (`claude`, `deepseek-harness`, `omp (ACP)`) are longer than the marks they
|
|
25
|
+
* sit beside, so the strip spent its width on words for the same agent the
|
|
26
|
+
* logo already names. With the label gone the mark is the accessible name:
|
|
27
|
+
* `aria-label` carries the harness's own label, and `title` still carries the
|
|
28
|
+
* reason a tab is unavailable.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { HarnessGlyph, HARNESS_GLYPH_SIZE } from '@/client/components/common/harness-glyph';
|
|
32
|
+
import { harnessBadgeLabel } from '@/shared/lib/harness/catalog';
|
|
33
|
+
import type { HarnessSummary } from '@/shared/types/harness';
|
|
34
|
+
|
|
35
|
+
interface HarnessTabsProps {
|
|
36
|
+
harnesses: HarnessSummary[];
|
|
37
|
+
/** The session's harness, or null for a chat that has not spawned yet. */
|
|
38
|
+
active: string | null;
|
|
39
|
+
/** False while a chat has messages: the choice would change the transcript's
|
|
40
|
+
* owner, which no frame source can do retroactively. */
|
|
41
|
+
editable: boolean;
|
|
42
|
+
onSelect: (harness: string) => void;
|
|
43
|
+
/** Opens the settings page for a harness that needs install or login. */
|
|
44
|
+
onFix?: (harness: string) => void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface HarnessBlock {
|
|
48
|
+
/** The agent's own words, or a plain statement that it is missing. */
|
|
49
|
+
reason: string;
|
|
50
|
+
/**
|
|
51
|
+
* The command that would actually fix it, or null.
|
|
52
|
+
*
|
|
53
|
+
* ONLY for a harness that never launched. A PROBE refusal means the binary
|
|
54
|
+
* DID run and answered — measured in the running picker, `codex` was blocked
|
|
55
|
+
* with "Authentication required" and the tab offered
|
|
56
|
+
* `npm i -g @agentclientprotocol/codex-acp`, i.e. told the user to install a
|
|
57
|
+
* program that had just replied. The fix in that case is the agent's own
|
|
58
|
+
* sentence (`Run \`codex login\``), never an install hint.
|
|
59
|
+
*/
|
|
60
|
+
fix: string | null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** What stops a harness running here, and the command that would unblock it. */
|
|
64
|
+
export function harnessBlock(summary: HarnessSummary): HarnessBlock | null {
|
|
65
|
+
// A BUILT-IN transport is never blocked, whatever else the row says. `omp`
|
|
66
|
+
// over RPC is the path this app IS: it has no agent to spawn and no launch
|
|
67
|
+
// command, so a probe of it can only report "no launch command is configured"
|
|
68
|
+
// — and that record used to paint a ⚠ over the DEFAULT tab and DISABLE it, so
|
|
69
|
+
// the harness every session actually runs on could not be selected (measured).
|
|
70
|
+
if (summary.builtIn) return null;
|
|
71
|
+
if (!summary.canLaunch) {
|
|
72
|
+
return { reason: summary.unavailable ?? 'Not installed', fix: summary.install ?? null };
|
|
73
|
+
}
|
|
74
|
+
const blocked = summary.probe?.capabilities.blocked;
|
|
75
|
+
return blocked ? { reason: blocked, fix: null } : null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Why a tab cannot be picked, in the agent's own words, or null when it can. */
|
|
79
|
+
export function harnessBlockedReason(summary: HarnessSummary): string | null {
|
|
80
|
+
return harnessBlock(summary)?.reason ?? null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface HarnessTabState {
|
|
84
|
+
/** What stops the harness running here, or null. */
|
|
85
|
+
block: HarnessBlock | null;
|
|
86
|
+
/** False once the chat owns a transcript: the harness is a SPAWN property. */
|
|
87
|
+
editable: boolean;
|
|
88
|
+
/** The harness the open chat is (or will be) running on. */
|
|
89
|
+
active: string | null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The one sentence a tab says when the pointer rests on it.
|
|
94
|
+
*
|
|
95
|
+
* A reason, not a restatement of the name: the mark IS the name now, so a
|
|
96
|
+
* tooltip that only echoed the label would spend the one available sentence
|
|
97
|
+
* answering a question the icon already answered. Four cases, in this order —
|
|
98
|
+
* and the order is the contract, because a tab can be both unusable and the
|
|
99
|
+
* agent already running the chat, and the FIRST fact is the one that stops the
|
|
100
|
+
* press:
|
|
101
|
+
*
|
|
102
|
+
* 1. **cannot run here** → the agent's own words (`Authentication required:
|
|
103
|
+
* Run \`codex login\``), plus an install command ONLY when the binary never
|
|
104
|
+
* launched (see `HarnessBlock.fix`);
|
|
105
|
+
* 2. **the chat is already owned by an agent** → name the agent it started on.
|
|
106
|
+
* "Start a new chat to use claude" was measured to be answerable but not
|
|
107
|
+
* informative: it never said WHICH agent the open chat had already picked,
|
|
108
|
+
* so the user could not tell whether they were looking at a lock or at a
|
|
109
|
+
* mistake of their own;
|
|
110
|
+
* 3. the tab IS that agent → say so, instead of offering it as an alternative
|
|
111
|
+
* to itself;
|
|
112
|
+
* 4. otherwise the probe's identity (`claude · 2.0.1`), which is the question a
|
|
113
|
+
* pointer rests on an available tab to ask.
|
|
114
|
+
*/
|
|
115
|
+
export function harnessTabTitle(summary: HarnessSummary, state: HarnessTabState): string {
|
|
116
|
+
if (state.block) {
|
|
117
|
+
return `${summary.label}: ${state.block.reason}${state.block.fix ? ` — install: ${state.block.fix}` : ''}`;
|
|
118
|
+
}
|
|
119
|
+
if (!state.editable) {
|
|
120
|
+
const owner = state.active ? harnessBadgeLabel(state.active) : null;
|
|
121
|
+
if (summary.id === state.active) {
|
|
122
|
+
return `${summary.label} is the agent this chat already started on. Start a new chat to use another one.`;
|
|
123
|
+
}
|
|
124
|
+
if (owner) {
|
|
125
|
+
return `Cannot switch to ${summary.label}: this chat already started on ${owner}. Start a new chat to use ${summary.label}.`;
|
|
126
|
+
}
|
|
127
|
+
return `Start a new chat to use ${summary.label}`;
|
|
128
|
+
}
|
|
129
|
+
if (summary.probe) {
|
|
130
|
+
const build = `${summary.probe.capabilities.agentName ?? ''} ${summary.probe.capabilities.agentVersion ?? ''}`.trim();
|
|
131
|
+
if (build) return `${summary.label} · ${build}`;
|
|
132
|
+
}
|
|
133
|
+
return summary.label;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Whether `harnessTabTitle` said something BEYOND the tab's own name.
|
|
138
|
+
*
|
|
139
|
+
* Only an extra sentence belongs in `aria-description`/`title`: a tab whose title
|
|
140
|
+
* is just its label (an unprobed but usable harness) already carries that word as
|
|
141
|
+
* its accessible name, and repeating it makes a screen reader say "claude,
|
|
142
|
+
* claude, tab".
|
|
143
|
+
*/
|
|
144
|
+
export function harnessTabReason(summary: HarnessSummary, state: HarnessTabState, title: string): string | null {
|
|
145
|
+
if (state.block || !state.editable) return title;
|
|
146
|
+
return title === summary.label ? null : title;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The tone a tab paints: which one is current, and what a press would do.
|
|
151
|
+
*
|
|
152
|
+
* Three cursor states, each earned:
|
|
153
|
+
*
|
|
154
|
+
* - **blocked → `pointer`** — pressing opens THAT agent's settings page, which
|
|
155
|
+
* is where a login or an install is fixed.
|
|
156
|
+
* - **locked → `not-allowed`** — the chat already runs on another agent, so a
|
|
157
|
+
* press cannot switch anything. This is the state a user meets most often
|
|
158
|
+
* (every tab but one, once a chat has a transcript), and the prohibition sign
|
|
159
|
+
* is the only affordance that says "not here" before the click.
|
|
160
|
+
* - **selectable → `pointer`** — it really does select.
|
|
161
|
+
*
|
|
162
|
+
* The ACTIVE tab of a locked chat keeps `default`: it is the current selection,
|
|
163
|
+
* not a refused one. `cursor-help` (an earlier value) is drawn on macOS as a
|
|
164
|
+
* question mark, which read as a stray icon over an icon-only tab.
|
|
165
|
+
*/
|
|
166
|
+
function tabTone(isActive: boolean, blocked: boolean, editable: boolean): string {
|
|
167
|
+
const cursor = blocked
|
|
168
|
+
? 'cursor-pointer'
|
|
169
|
+
: !editable
|
|
170
|
+
? isActive ? 'cursor-default' : 'cursor-not-allowed'
|
|
171
|
+
: 'cursor-pointer';
|
|
172
|
+
if (isActive) return `bg-paper text-ink shadow-[inset_0_-2px_0_0_currentColor] ${cursor}`;
|
|
173
|
+
if (blocked || !editable) return `text-ink/35 ${cursor}`;
|
|
174
|
+
return `text-ink/65 hover:bg-ink/5 hover:text-ink ${cursor}`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function HarnessTabs({ harnesses, active, editable, onSelect, onFix }: HarnessTabsProps) {
|
|
178
|
+
if (harnesses.length === 0) return null;
|
|
179
|
+
return (
|
|
180
|
+
<div
|
|
181
|
+
// `flex-none` is load-bearing: the panel is a flex COLUMN with a measured
|
|
182
|
+
// max height, so without it this strip was the first child to shrink and
|
|
183
|
+
// collapsed to 5px — the tabs were in the DOM and painted 1px tall
|
|
184
|
+
// (measured: `elementFromPoint` on the first tab answered the row BELOW
|
|
185
|
+
// it). The list scrolls inside itself; the strip must not.
|
|
186
|
+
className="flex-none flex items-stretch gap-0.5 overflow-x-auto border-b border-ink/10 bg-canvas/40 px-1 pt-1 scrollbar-overlay-container"
|
|
187
|
+
role="tablist"
|
|
188
|
+
aria-label="Harness"
|
|
189
|
+
// The one surface where a harness HUE is not decoration: with no label in
|
|
190
|
+
// the tab, colour is the only thing separating `omp` (RPC) from `omp`
|
|
191
|
+
// (ACP), so `icon-paint-css.ts` keeps these two marks painted even in
|
|
192
|
+
// monochrome mode. The attribute is that rule's scope.
|
|
193
|
+
data-harness-tabs=""
|
|
194
|
+
>
|
|
195
|
+
{harnesses.map((summary) => {
|
|
196
|
+
const state: HarnessTabState = {
|
|
197
|
+
block: harnessBlock(summary),
|
|
198
|
+
editable,
|
|
199
|
+
active,
|
|
200
|
+
};
|
|
201
|
+
const { block } = state;
|
|
202
|
+
const isActive = summary.id === active;
|
|
203
|
+
// NOT the native `disabled`. Measured in Chromium: a `<button disabled>`
|
|
204
|
+
// never shows its `title` (so the reason was unreachable — the one thing
|
|
205
|
+
// a blocked tab exists to explain), and a press on it never reaches
|
|
206
|
+
// `onClick` (so `onFix` — "open the settings that fix this" — could not
|
|
207
|
+
// fire either; measured, `elementFromPoint` on the tab answered the tab
|
|
208
|
+
// itself and the handler ran 0 times).
|
|
209
|
+
//
|
|
210
|
+
// `aria-disabled` states the same thing to assistive tech without
|
|
211
|
+
// removing the element from the pointer. Every unusable tab therefore
|
|
212
|
+
// stays pressable and pressing it either explains itself (a transcript
|
|
213
|
+
// already owns this chat) or opens the fix.
|
|
214
|
+
const unusable = Boolean(block) || !editable;
|
|
215
|
+
// One sentence, used by BOTH the pointer and assistive tech — so the two
|
|
216
|
+
// can never say different things about the same tab.
|
|
217
|
+
const title = harnessTabTitle(summary, state);
|
|
218
|
+
const reason = harnessTabReason(summary, state, title);
|
|
219
|
+
return (
|
|
220
|
+
<button
|
|
221
|
+
key={summary.id}
|
|
222
|
+
type="button"
|
|
223
|
+
role="tab"
|
|
224
|
+
// The NAME, because the mark is now the whole control: a `<button>`
|
|
225
|
+
// whose only child is a decorative svg would be announced with no
|
|
226
|
+
// name at all.
|
|
227
|
+
aria-label={summary.label}
|
|
228
|
+
aria-selected={isActive}
|
|
229
|
+
aria-disabled={unusable}
|
|
230
|
+
// The same sentence for the keyboard/assistive path. `title` is a
|
|
231
|
+
// POINTER affordance (and, on a `disabled` element, none at all —
|
|
232
|
+
// the measured reason this tab stopped using it); an `aria-disabled`
|
|
233
|
+
// tab is still focusable, so a screen reader would otherwise hear
|
|
234
|
+
// "claude, tab, dimmed" with no reason attached. The NAME stays the
|
|
235
|
+
// label: a reason in the name would make the tab unaddressable by
|
|
236
|
+
// the word the user is thinking of.
|
|
237
|
+
aria-description={reason ?? undefined}
|
|
238
|
+
title={title}
|
|
239
|
+
onClick={() => {
|
|
240
|
+
if (block) {
|
|
241
|
+
onFix?.(summary.id);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (!editable) return;
|
|
245
|
+
onSelect(summary.id);
|
|
246
|
+
}}
|
|
247
|
+
// `relative` for the ⚠ badge, `p-1.5` so the strip stays compact at
|
|
248
|
+
// the larger mark: the label that used to supply the tab's width and
|
|
249
|
+
// its lead-in is gone, so the padding is the whole frame. `tap-chip`
|
|
250
|
+
// still raises it to 44px on a coarse pointer, which is what keeps an
|
|
251
|
+
// icon-only tab pressable on a phone.
|
|
252
|
+
className={`tap-chip relative flex shrink-0 items-center justify-center rounded-t p-1.5 transition-colors ${tabTone(isActive, Boolean(block), editable)}`}
|
|
253
|
+
>
|
|
254
|
+
{/* `inherit`, because the button's colour is now the only thing that
|
|
255
|
+
says active / muted: the mark used to be one of two children and
|
|
256
|
+
its own `text-ink/55` was the default it shared with every row.
|
|
257
|
+
A BLOCKED harness is additionally dimmed by OPACITY rather than
|
|
258
|
+
by a colour, so the signal survives the colour mode — there the
|
|
259
|
+
paint rule sets a brand hue that no `text-ink/35` can outrank,
|
|
260
|
+
and an unavailable agent would have looked exactly as ready as
|
|
261
|
+
the one beside it. Non-editable-but-runnable tabs stay at full
|
|
262
|
+
strength: the agent is available, this chat is not the place,
|
|
263
|
+
and `title` is what says so.
|
|
264
|
+
|
|
265
|
+
`decorative` is load-bearing: the component's own
|
|
266
|
+
`title="Session runs on claude"` sits INSIDE this button, and a
|
|
267
|
+
nested `title` is the one the browser shows — measured, hovering
|
|
268
|
+
a locked tab announced the generic sentence and never the
|
|
269
|
+
explanation one level up. */}
|
|
270
|
+
<HarnessGlyph
|
|
271
|
+
harness={summary.id}
|
|
272
|
+
size={HARNESS_GLYPH_SIZE.tab}
|
|
273
|
+
inherit
|
|
274
|
+
decorative
|
|
275
|
+
className={block ? 'opacity-40' : ''}
|
|
276
|
+
/>
|
|
277
|
+
{block && (
|
|
278
|
+
<span
|
|
279
|
+
aria-hidden="true"
|
|
280
|
+
className="absolute -right-0.5 -top-0.5 text-[9px] leading-none text-ink/40"
|
|
281
|
+
>
|
|
282
|
+
⚠
|
|
283
|
+
</span>
|
|
284
|
+
)}
|
|
285
|
+
</button>
|
|
286
|
+
);
|
|
287
|
+
})}
|
|
288
|
+
</div>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
@@ -3,6 +3,7 @@ import { Brain, Command, GripVertical, Star } from 'lucide-preact';
|
|
|
3
3
|
import type { AIModelOption } from '@/shared/types';
|
|
4
4
|
import { formatContextWindow } from '@/shared/lib/code/format';
|
|
5
5
|
import { ProviderIconPlate } from '@/client/components/common/provider-icon/Plate';
|
|
6
|
+
import { HarnessGlyph, HARNESS_GLYPH_SIZE } from '@/client/components/common/harness-glyph';
|
|
6
7
|
|
|
7
8
|
interface ModelDropdownItemProps {
|
|
8
9
|
model: AIModelOption;
|
|
@@ -21,6 +22,14 @@ interface ModelDropdownItemProps {
|
|
|
21
22
|
onToggleFavorite: (model: AIModelOption, e: TargetedMouseEvent<HTMLElement>) => void;
|
|
22
23
|
onCycleThinking?: (model: AIModelOption, e: TargetedMouseEvent<HTMLElement>) => void;
|
|
23
24
|
onMouseEnter: () => void;
|
|
25
|
+
/** Harness that serves this row, drawn BEFORE the provider plate.
|
|
26
|
+
*
|
|
27
|
+
* Two marks, in a fixed order: which agent runs it, then which provider /
|
|
28
|
+
* model it is. The harness comes first because it is the outer choice — the
|
|
29
|
+
* tab above already narrowed the list to it, and a provider plate with no
|
|
30
|
+
* agent mark would read as "this model, from this provider, on nothing". On
|
|
31
|
+
* omp's own tab the mark is omp's, so every row in the picker is labelled. */
|
|
32
|
+
harness?: string;
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
/**
|
|
@@ -44,6 +53,7 @@ export function ModelDropdownItem({
|
|
|
44
53
|
onToggleFavorite,
|
|
45
54
|
onCycleThinking,
|
|
46
55
|
onMouseEnter,
|
|
56
|
+
harness,
|
|
47
57
|
}: ModelDropdownItemProps) {
|
|
48
58
|
return (
|
|
49
59
|
<div
|
|
@@ -78,6 +88,7 @@ export function ModelDropdownItem({
|
|
|
78
88
|
/>
|
|
79
89
|
</span>
|
|
80
90
|
|
|
91
|
+
<HarnessGlyph harness={harness} size={HARNESS_GLYPH_SIZE.compact} />
|
|
81
92
|
{model.isCmdAgent ? (
|
|
82
93
|
<span
|
|
83
94
|
className="inline-flex items-center justify-center w-[18px] h-[18px] rounded-[5px] border border-ink/20 bg-ink/5 text-ink/80 flex-shrink-0"
|
|
@@ -7,6 +7,10 @@ import { ModelDropdownFooter } from '@/client/components/workspace/model-dropdow
|
|
|
7
7
|
import { ModelDropdownSkeleton } from '@/client/components/workspace/model-dropdown/Skeleton';
|
|
8
8
|
import { ModelSpecsTooltip } from '@/client/components/workspace/model-dropdown/SpecsTooltip';
|
|
9
9
|
import type { PickerRow } from '@/client/components/workspace/model-dropdown/groups';
|
|
10
|
+
import { HarnessTabs } from '@/client/components/workspace/model-dropdown/HarnessTabs';
|
|
11
|
+
import { usePopoverSize } from '@/client/components/workspace/model-dropdown/use-popover-size';
|
|
12
|
+
import { ModelFullscreen } from '@/client/components/workspace/model-dropdown/Fullscreen';
|
|
13
|
+
import type { HarnessSummary } from '@/shared/types/harness';
|
|
10
14
|
|
|
11
15
|
interface ModelDropdownPanelProps {
|
|
12
16
|
search: string;
|
|
@@ -34,6 +38,27 @@ interface ModelDropdownPanelProps {
|
|
|
34
38
|
/** Row index in the flat list; the panel resolves it to the row it renders. */
|
|
35
39
|
onHoverItem: (index: number) => void;
|
|
36
40
|
onMouseLeave: () => void;
|
|
41
|
+
/** The harness tab strip's data. Omitted by a picker that cannot spawn
|
|
42
|
+
* (the New Chat modal's preview), which then draws no tabs. */
|
|
43
|
+
harnesses?: HarnessSummary[];
|
|
44
|
+
activeHarness?: string | null;
|
|
45
|
+
/** False while the open chat already has a transcript: switching the harness
|
|
46
|
+
* is a spawn-time choice, so the tab says so rather than changing the frame
|
|
47
|
+
* source under a running conversation. */
|
|
48
|
+
harnessEditable?: boolean;
|
|
49
|
+
onSelectHarness?: (harness: string) => void;
|
|
50
|
+
onFixHarness?: (harness: string) => void;
|
|
51
|
+
/** The active tab's harness has never been probed, so its model list is
|
|
52
|
+
* genuinely unknown rather than empty. */
|
|
53
|
+
unprobedHarness?: boolean;
|
|
54
|
+
/** Why the active tab cannot run (auth, missing binary), in the agent's words. */
|
|
55
|
+
harnessBlocked?: string;
|
|
56
|
+
/** Dismiss the full-screen picker. Required on a phone, where it owns the screen. */
|
|
57
|
+
onClose?: () => void;
|
|
58
|
+
/** Take the whole screen instead of hanging beside the trigger. Decided ONCE
|
|
59
|
+
* by the picker (`useFullscreenPicker`) and passed in, so the panel never
|
|
60
|
+
* holds a second answer to the same question. */
|
|
61
|
+
fullscreen?: boolean;
|
|
37
62
|
}
|
|
38
63
|
|
|
39
64
|
export function ModelDropdownPanel({
|
|
@@ -57,6 +82,15 @@ export function ModelDropdownPanel({
|
|
|
57
82
|
onCycleThinking,
|
|
58
83
|
onHoverItem,
|
|
59
84
|
onMouseLeave,
|
|
85
|
+
harnesses = [],
|
|
86
|
+
activeHarness = null,
|
|
87
|
+
harnessEditable = true,
|
|
88
|
+
onSelectHarness,
|
|
89
|
+
onFixHarness,
|
|
90
|
+
unprobedHarness = false,
|
|
91
|
+
harnessBlocked,
|
|
92
|
+
onClose,
|
|
93
|
+
fullscreen = false,
|
|
60
94
|
}: ModelDropdownPanelProps) {
|
|
61
95
|
const panelRef = useRef<HTMLDivElement>(null);
|
|
62
96
|
const cardRef = useRef<HTMLDivElement>(null);
|
|
@@ -84,9 +118,49 @@ export function ModelDropdownPanel({
|
|
|
84
118
|
|
|
85
119
|
useLayoutEffect(alignCardToRow, [alignCardToRow, collapsedSections]);
|
|
86
120
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
121
|
+
const size = usePopoverSize(panelRef);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The card's CONTENT, shared by both placements.
|
|
125
|
+
*
|
|
126
|
+
* One tree, two frames: a sheet that re-implemented the list would be a second
|
|
127
|
+
* picker that drifts (a new section, a new empty state, a new harness tab
|
|
128
|
+
* landing in only one of them). Only the outer box and its constraints differ.
|
|
129
|
+
*/
|
|
130
|
+
const card = (
|
|
131
|
+
<>
|
|
132
|
+
<div
|
|
133
|
+
ref={panelRef}
|
|
134
|
+
// The measured box belongs to the POPOVER placement only. The
|
|
135
|
+
// full-screen frame owns both dimensions, so applying the popover's
|
|
136
|
+
// width here left a 292px card floating inside a 390px screen and
|
|
137
|
+
// truncated every model name to "A." (measured on a 390x844 phone).
|
|
138
|
+
style={fullscreen ? undefined : { maxHeight: `${size.height}px`, width: `${size.width}px` }}
|
|
139
|
+
// No `w-84 sm:w-96` here: width comes from `availableWidth` above, so
|
|
140
|
+
// the panel tracks the composer it belongs to instead of the viewport
|
|
141
|
+
// breakpoint.
|
|
142
|
+
className={
|
|
143
|
+
fullscreen
|
|
144
|
+
// Full screen: no chrome of its own. A rounded, bordered card
|
|
145
|
+
// floating inside an opaque full-screen frame draws a border that
|
|
146
|
+
// belongs to nothing, so it drops both and lets the frame own the
|
|
147
|
+
// edge.
|
|
148
|
+
? 'flex flex-1 min-h-0 flex-col overflow-hidden text-xs'
|
|
149
|
+
: 'glass-popover bg-paper border border-ink/20 rounded-xl shadow-2xl flex flex-col overflow-hidden text-xs animate-in fade-in zoom-in-95 duration-100'
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
{/* The harness tab strip sits ABOVE the search field: the tab changes
|
|
153
|
+
what the list IS, so the search that follows applies to the list the
|
|
154
|
+
tab selected. */}
|
|
155
|
+
{harnesses.length > 0 && (
|
|
156
|
+
<HarnessTabs
|
|
157
|
+
harnesses={harnesses}
|
|
158
|
+
active={activeHarness}
|
|
159
|
+
editable={harnessEditable}
|
|
160
|
+
onSelect={onSelectHarness ?? (() => {})}
|
|
161
|
+
onFix={onFixHarness}
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
90
164
|
<ModelDropdownHeader
|
|
91
165
|
search={search}
|
|
92
166
|
onSearchChange={onSearchChange}
|
|
@@ -100,7 +174,7 @@ export function ModelDropdownPanel({
|
|
|
100
174
|
`p-1.5` list pinned its heading 6px down and `elementFromPoint` at
|
|
101
175
|
2px returned a row). The first heading sits flush instead. */}
|
|
102
176
|
<div
|
|
103
|
-
className="flex-1 scrollbar-overlay-container px-1.5 pb-1.5 space-y-2
|
|
177
|
+
className="flex-1 min-h-0 scrollbar-overlay-container px-1.5 pb-1.5 space-y-2"
|
|
104
178
|
onMouseLeave={onMouseLeave}
|
|
105
179
|
// The row under a resting pointer moves when the list scrolls; the
|
|
106
180
|
// card follows it instead of staying where the hover started.
|
|
@@ -109,11 +183,24 @@ export function ModelDropdownPanel({
|
|
|
109
183
|
{isLoading ? (
|
|
110
184
|
<ModelDropdownSkeleton />
|
|
111
185
|
) : filteredModels.length === 0 ? (
|
|
112
|
-
|
|
186
|
+
// Four empty states, and they mean different things. "No models"
|
|
187
|
+
// for an agent that never answered would be a lie about its
|
|
188
|
+
// catalog: an unprobed tab says so and offers the check, a blocked
|
|
189
|
+
// tab quotes the agent, and only omp's own tab talks about providers.
|
|
190
|
+
<div className="px-3 py-6 text-center text-ink/40">
|
|
113
191
|
{search ? (
|
|
114
|
-
|
|
192
|
+
<span className="italic">No models found matching "{search}"</span>
|
|
193
|
+
) : harnessBlocked ? (
|
|
194
|
+
<span className="not-italic">{harnessBlocked}</span>
|
|
195
|
+
) : unprobedHarness ? (
|
|
196
|
+
<span className="not-italic">
|
|
197
|
+
This harness has not reported its models yet.
|
|
198
|
+
<span className="mt-1 block text-[10px] text-ink/35">
|
|
199
|
+
Check its status in Settings → Harnesses.
|
|
200
|
+
</span>
|
|
201
|
+
</span>
|
|
115
202
|
) : (
|
|
116
|
-
|
|
203
|
+
<span className="italic">No models available for this harness.</span>
|
|
117
204
|
)}
|
|
118
205
|
</div>
|
|
119
206
|
) : (
|
|
@@ -133,6 +220,7 @@ export function ModelDropdownPanel({
|
|
|
133
220
|
onToggleFavorite={onToggleFavorite}
|
|
134
221
|
onCycleThinking={onCycleThinking}
|
|
135
222
|
onHoverItem={onHoverItem}
|
|
223
|
+
harnessOfModel={activeHarness ?? undefined}
|
|
136
224
|
/>
|
|
137
225
|
|
|
138
226
|
<ModelDropdownSection
|
|
@@ -150,6 +238,7 @@ export function ModelDropdownPanel({
|
|
|
150
238
|
onToggleFavorite={onToggleFavorite}
|
|
151
239
|
onCycleThinking={onCycleThinking}
|
|
152
240
|
onHoverItem={onHoverItem}
|
|
241
|
+
harnessOfModel={activeHarness ?? undefined}
|
|
153
242
|
/>
|
|
154
243
|
|
|
155
244
|
{Object.entries(providerGroups).map(([provider, pModels]) => (
|
|
@@ -169,13 +258,18 @@ export function ModelDropdownPanel({
|
|
|
169
258
|
onToggleFavorite={onToggleFavorite}
|
|
170
259
|
onCycleThinking={onCycleThinking}
|
|
171
260
|
onHoverItem={onHoverItem}
|
|
261
|
+
harnessOfModel={activeHarness ?? undefined}
|
|
172
262
|
/>
|
|
173
263
|
))}
|
|
174
264
|
</>
|
|
175
265
|
)}
|
|
176
266
|
</div>
|
|
177
267
|
|
|
178
|
-
|
|
268
|
+
{/* The footer is keyboard HINTS (`↑ ↓ navigate`, `Tab switch agent`,
|
|
269
|
+
`← → thinking`). A phone has no keyboard, so in the full-screen
|
|
270
|
+
placement it is three instructions the reader cannot follow, pinned
|
|
271
|
+
over the rows. The popover keeps it: its reader is at a keyboard. */}
|
|
272
|
+
{!fullscreen && <ModelDropdownFooter />}
|
|
179
273
|
</div>
|
|
180
274
|
|
|
181
275
|
{/* Floating Specs Card: only visible when hovering or keyboard navigating.
|
|
@@ -190,6 +284,23 @@ export function ModelDropdownPanel({
|
|
|
190
284
|
<ModelSpecsTooltip model={hoveredRow.model} />
|
|
191
285
|
</div>
|
|
192
286
|
)}
|
|
287
|
+
</>
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
// On a phone the picker owns the whole screen; a desktop keeps the popover.
|
|
291
|
+
// `Fullscreen.tsx` states why each placement wins where it does, and why the
|
|
292
|
+
// overlay must portal out of the composer's containing block.
|
|
293
|
+
if (fullscreen) {
|
|
294
|
+
return <ModelFullscreen open onClose={onClose ?? (() => {})}>{card}</ModelFullscreen>;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return (
|
|
298
|
+
<div
|
|
299
|
+
// Anchored to the trigger's LEFT edge, which is what the composer row
|
|
300
|
+
// expects; the width cap above keeps it inside the panel.
|
|
301
|
+
className="absolute bottom-full left-0 mb-2.5 z-50 flex items-start"
|
|
302
|
+
>
|
|
303
|
+
{card}
|
|
193
304
|
</div>
|
|
194
305
|
);
|
|
195
306
|
}
|
|
@@ -25,6 +25,8 @@ interface ModelDropdownSectionProps {
|
|
|
25
25
|
onCycleThinking: (model: AIModelOption, e: TargetedMouseEvent<HTMLElement>) => void;
|
|
26
26
|
/** Row index in the flat list; the panel resolves it to the row it renders. */
|
|
27
27
|
onHoverItem: (index: number) => void;
|
|
28
|
+
/** Harness serving this section's rows — drawn before each provider plate. */
|
|
29
|
+
harnessOfModel?: string;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
export function ModelDropdownSection({
|
|
@@ -42,6 +44,7 @@ export function ModelDropdownSection({
|
|
|
42
44
|
onToggleFavorite,
|
|
43
45
|
onCycleThinking,
|
|
44
46
|
onHoverItem,
|
|
47
|
+
harnessOfModel,
|
|
45
48
|
}: ModelDropdownSectionProps) {
|
|
46
49
|
if (models.length === 0) return null;
|
|
47
50
|
|
|
@@ -116,6 +119,7 @@ export function ModelDropdownSection({
|
|
|
116
119
|
// two providers would render twice identically. A provider
|
|
117
120
|
// section already says the provider in its header.
|
|
118
121
|
showProvider={iconType !== 'provider' && ambiguousNames.has(normalizedModelName(m))}
|
|
122
|
+
{...(harnessOfModel ? { harness: harnessOfModel } : {})}
|
|
119
123
|
isSelected={selectedModelKey === modelKey(m)}
|
|
120
124
|
isFocused={focusedIndex === index}
|
|
121
125
|
onSelect={onSelect}
|