@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
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
42
|
import { providerInitials } from '@/shared/lib/models/provider/glyph';
|
|
43
|
-
import { hashHue, iconTone } from '@/shared/lib/icons/tint';
|
|
43
|
+
import { hashHue, iconTone, PAPER_BUCKET_SAMPLE } from '@/shared/lib/icons/tint';
|
|
44
|
+
import { PAPER_BUCKETS } from '@/shared/lib/icons/icon-tone';
|
|
44
45
|
import { legiblePair } from '@/shared/lib/theme/legibility';
|
|
45
46
|
|
|
46
47
|
interface PluginMarkProps {
|
|
@@ -73,9 +74,15 @@ export function PluginMark({ name, iconUrl, color, size = 16, tile = false }: Pl
|
|
|
73
74
|
const hueValue = hashHue(name);
|
|
74
75
|
const hue = {
|
|
75
76
|
'--icon-hue': String(hueValue),
|
|
76
|
-
//
|
|
77
|
-
// plugin's hue is runtime-only, so it cannot be a generated CSS row
|
|
78
|
-
|
|
77
|
+
// EVERY solved tone for that hue, from the same tables the glyph rows emit:
|
|
78
|
+
// a plugin's hue is runtime-only, so it cannot be a generated CSS row, and
|
|
79
|
+
// the stylesheet picks the bucket the palette is painting.
|
|
80
|
+
...Object.fromEntries(
|
|
81
|
+
PAPER_BUCKETS.map((bucket) => [
|
|
82
|
+
bucket === 'deepest' ? '--icon-tone' : `--icon-tone-${bucket}`,
|
|
83
|
+
iconTone(hueValue, 'light', PAPER_BUCKET_SAMPLE[bucket]),
|
|
84
|
+
]),
|
|
85
|
+
),
|
|
79
86
|
'--icon-tone-dark': iconTone(hueValue, 'dark'),
|
|
80
87
|
...(declared ? { '--plugin-declared-light': declared.light } : {}),
|
|
81
88
|
...(declared?.dark ? { '--plugin-declared-dark': declared.dark } : {}),
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The settings sidebar's groups.
|
|
8
|
+
*
|
|
9
|
+
* The failure this prevents is silent: the group list used to be written twice
|
|
10
|
+
* — once as the `section` union, once as the `sections` array beside the render
|
|
11
|
+
* loop — so a group added to the union but forgotten in the array rendered
|
|
12
|
+
* NOTHING under it. No error, no empty state: the loop simply never asked for
|
|
13
|
+
* that group, and every category filed under it disappeared from the settings
|
|
14
|
+
* drawer.
|
|
15
|
+
*
|
|
16
|
+
* So the assertions are structural, not cosmetic:
|
|
17
|
+
*
|
|
18
|
+
* - every category's group is one of the groups the sidebar draws;
|
|
19
|
+
* - every group is drawn exactly once, in `SETTINGS_SECTIONS` order;
|
|
20
|
+
* - a category is reachable from the drawer — the count that renders equals the
|
|
21
|
+
* count declared;
|
|
22
|
+
* - `harnesses` is its OWN group. omp's group holds one engine's config; that
|
|
23
|
+
* group holds other agents entirely, with a different transport and a
|
|
24
|
+
* different config file.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { afterAll, afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
28
|
+
import { Window } from 'happy-dom';
|
|
29
|
+
import { h, render } from 'preact';
|
|
30
|
+
import { act } from 'preact/test-utils';
|
|
31
|
+
|
|
32
|
+
import { SETTINGS_CATEGORIES, SettingsSidebar } from '@/client/components/settings/Sidebar';
|
|
33
|
+
import { SETTINGS_SECTIONS } from '@/shared/lib/settings/sections';
|
|
34
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
35
|
+
|
|
36
|
+
let container: HTMLElement;
|
|
37
|
+
|
|
38
|
+
beforeEach(() => {
|
|
39
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
if (container) render(null, container);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterAll(() => {
|
|
47
|
+
restoreDomGlobals();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('settings groups', () => {
|
|
51
|
+
test('every category files under a group the sidebar draws', () => {
|
|
52
|
+
for (const category of SETTINGS_CATEGORIES) {
|
|
53
|
+
expect(SETTINGS_SECTIONS).toContain(category.section);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('Harnesses is its own group, not a member of OMP', () => {
|
|
58
|
+
const harnesses = SETTINGS_CATEGORIES.find((category) => category.id === 'harness-index');
|
|
59
|
+
expect(harnesses?.section).toBe('HARNESSES');
|
|
60
|
+
// And the group sits after OMP, before LIBRARY: the order the sidebar reads.
|
|
61
|
+
expect(SETTINGS_SECTIONS.indexOf('HARNESSES')).toBeGreaterThan(SETTINGS_SECTIONS.indexOf('OMP'));
|
|
62
|
+
expect(SETTINGS_SECTIONS.indexOf('HARNESSES')).toBeLessThan(SETTINGS_SECTIONS.indexOf('LIBRARY'));
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('the drawer renders one heading per non-empty group, in order', () => {
|
|
66
|
+
container = document.createElement('div');
|
|
67
|
+
document.body.append(container);
|
|
68
|
+
act(() =>
|
|
69
|
+
render(
|
|
70
|
+
h(SettingsSidebar, {
|
|
71
|
+
activeCategory: 'appearance',
|
|
72
|
+
onSelectCategory: () => {},
|
|
73
|
+
searchQuery: '',
|
|
74
|
+
onSearchChange: () => {},
|
|
75
|
+
onReloadOmp: () => {},
|
|
76
|
+
isReloading: false,
|
|
77
|
+
onRestartKabmo: () => {},
|
|
78
|
+
isRestarting: false,
|
|
79
|
+
}),
|
|
80
|
+
container,
|
|
81
|
+
),
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
// The headings carry the group name verbatim; nothing else in the drawer is
|
|
85
|
+
// uppercase monospace, which is why they can be selected this way.
|
|
86
|
+
const headings = Array.from(container.querySelectorAll('.font-mono.uppercase'))
|
|
87
|
+
.map((el) => el.textContent?.trim() ?? '');
|
|
88
|
+
const expected = SETTINGS_SECTIONS.filter((section) =>
|
|
89
|
+
SETTINGS_CATEGORIES.some((category) => category.section === section),
|
|
90
|
+
);
|
|
91
|
+
expect(headings).toEqual([...expected]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('every declared category is reachable from the drawer', () => {
|
|
95
|
+
// The count, not a spot check: the silent failure was an entire GROUP
|
|
96
|
+
// missing, and a spot check on one category would have passed.
|
|
97
|
+
container = document.createElement('div');
|
|
98
|
+
document.body.append(container);
|
|
99
|
+
act(() =>
|
|
100
|
+
render(
|
|
101
|
+
h(SettingsSidebar, {
|
|
102
|
+
activeCategory: 'appearance',
|
|
103
|
+
onSelectCategory: () => {},
|
|
104
|
+
searchQuery: '',
|
|
105
|
+
onSearchChange: () => {},
|
|
106
|
+
onReloadOmp: () => {},
|
|
107
|
+
isReloading: false,
|
|
108
|
+
onRestartKabmo: () => {},
|
|
109
|
+
isRestarting: false,
|
|
110
|
+
}),
|
|
111
|
+
container,
|
|
112
|
+
),
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const labels = Array.from(container.querySelectorAll('button'))
|
|
116
|
+
.map((button) => button.textContent?.trim() ?? '');
|
|
117
|
+
for (const category of SETTINGS_CATEGORIES) {
|
|
118
|
+
expect(labels).toContain(category.label);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test('a switched-off harness has no row, and switching it back on restores it', () => {
|
|
123
|
+
// The roster decides the drawer, not the catalog: an agent the user turned
|
|
124
|
+
// off must not leave a settings entry behind that says only "this is off".
|
|
125
|
+
// Drawing it twice is the round trip the toggle actually performs.
|
|
126
|
+
const draw = (disabledHarnesses: string[]) => {
|
|
127
|
+
container = document.createElement('div');
|
|
128
|
+
document.body.append(container);
|
|
129
|
+
act(() =>
|
|
130
|
+
render(
|
|
131
|
+
h(SettingsSidebar, {
|
|
132
|
+
activeCategory: 'appearance',
|
|
133
|
+
onSelectCategory: () => {},
|
|
134
|
+
searchQuery: '',
|
|
135
|
+
onSearchChange: () => {},
|
|
136
|
+
onReloadOmp: () => {},
|
|
137
|
+
isReloading: false,
|
|
138
|
+
onRestartKabmo: () => {},
|
|
139
|
+
isRestarting: false,
|
|
140
|
+
disabledHarnesses,
|
|
141
|
+
}),
|
|
142
|
+
container,
|
|
143
|
+
),
|
|
144
|
+
);
|
|
145
|
+
return Array.from(container.querySelectorAll('button'))
|
|
146
|
+
.map((button) => button.textContent?.trim() ?? '');
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const on = draw([]);
|
|
150
|
+
expect(on).toContain('claude');
|
|
151
|
+
// The overview always stays: it is where a switched-off agent is switched on.
|
|
152
|
+
expect(on).toContain('All Harnesses');
|
|
153
|
+
|
|
154
|
+
const off = draw(['claude']);
|
|
155
|
+
expect(off).not.toContain('claude');
|
|
156
|
+
expect(off).toContain('All Harnesses');
|
|
157
|
+
// Its neighbours are untouched — this is one row, not the whole group.
|
|
158
|
+
expect(off).toContain('codex');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The settings menu's harness icons are the VENDORS' marks, not lucide shapes.
|
|
8
|
+
*
|
|
9
|
+
* The rest of the app already identifies an agent by its own logo — a session
|
|
10
|
+
* row, the composer's tab strip, a model row — so a generic `Waypoints` glyph
|
|
11
|
+
* beside the word "claude" asked the reader to learn a second vocabulary for the
|
|
12
|
+
* same fact. The overview keeps its lucide glyph because it is not an agent, and
|
|
13
|
+
* a brand mark there would claim it were one.
|
|
14
|
+
*
|
|
15
|
+
* The alignment assertion is the subtle half: the marks have DIFFERENT viewBoxes
|
|
16
|
+
* (omp is 64x64, the rest 24x24), so an unstyled inline svg makes every label
|
|
17
|
+
* beside it shift. Measured before the fixed slot: the whole HARNESSES group's
|
|
18
|
+
* labels sat ~2px off the rest of the menu.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
22
|
+
import { Window } from 'happy-dom';
|
|
23
|
+
import { h, render } from 'preact';
|
|
24
|
+
import { act } from 'preact/test-utils';
|
|
25
|
+
|
|
26
|
+
import { SETTINGS_CATEGORIES, SettingsSidebar } from '@/client/components/settings/Sidebar';
|
|
27
|
+
import { harnessMenuEntries } from '@/shared/lib/harness/menu';
|
|
28
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
29
|
+
|
|
30
|
+
let container: HTMLElement;
|
|
31
|
+
|
|
32
|
+
beforeAll(() => {
|
|
33
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
container = document.createElement('div');
|
|
38
|
+
document.body.appendChild(container);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
afterEach(() => {
|
|
42
|
+
render(null, container);
|
|
43
|
+
container.remove();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterAll(() => {
|
|
47
|
+
restoreDomGlobals();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
function mount(active: string): HTMLElement {
|
|
51
|
+
act(() =>
|
|
52
|
+
render(
|
|
53
|
+
h(SettingsSidebar, {
|
|
54
|
+
activeCategory: active as never,
|
|
55
|
+
onSelectCategory: () => {},
|
|
56
|
+
searchQuery: '',
|
|
57
|
+
onSearchChange: () => {},
|
|
58
|
+
onReloadOmp: () => {},
|
|
59
|
+
isReloading: false,
|
|
60
|
+
onRestartKabmo: () => {},
|
|
61
|
+
isRestarting: false,
|
|
62
|
+
}),
|
|
63
|
+
container,
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
return container;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function rowFor(root: HTMLElement, label: string): HTMLButtonElement {
|
|
70
|
+
const found = Array.from(root.querySelectorAll('button')).find(
|
|
71
|
+
(button) => (button.querySelector('span.truncate')?.textContent ?? '') === label,
|
|
72
|
+
);
|
|
73
|
+
if (!found) throw new Error(`no row named ${label}`);
|
|
74
|
+
return found as HTMLButtonElement;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
describe('settings menu harness icons', () => {
|
|
78
|
+
test('every harness page draws its vendor mark', () => {
|
|
79
|
+
const root = mount('harness-index');
|
|
80
|
+
for (const entry of harnessMenuEntries()) {
|
|
81
|
+
if (!entry.harness) continue;
|
|
82
|
+
const mark = rowFor(root, entry.label).querySelector('span[data-harness] svg');
|
|
83
|
+
expect(mark, `${entry.label} has no brand mark`).not.toBeNull();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('the overview is NOT an agent, so it keeps the lucide glyph', () => {
|
|
88
|
+
const root = mount('harness-index');
|
|
89
|
+
const row = rowFor(root, 'All Harnesses');
|
|
90
|
+
expect(row.querySelector('span[data-harness]')).toBeNull();
|
|
91
|
+
expect(row.querySelector('svg.lucide')).not.toBeNull();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('the mark is a branded svg, not a substituted lucide shape', () => {
|
|
95
|
+
const root = mount('harness-index');
|
|
96
|
+
const claude = rowFor(root, 'claude');
|
|
97
|
+
expect(claude.querySelector('span[data-harness] svg')?.getAttribute('data-harness')).toBe('claudecode');
|
|
98
|
+
// The generic glyph must be GONE from this row, not merely accompanied.
|
|
99
|
+
expect(claude.querySelector('svg.lucide')).toBeNull();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('the mark carries the VENDOR key, not the harness id', () => {
|
|
103
|
+
// `opencode`'s harness id and its brand key coincide; `ll`-style pairs do not,
|
|
104
|
+
// so the assertion is on the key the art is filed under.
|
|
105
|
+
const root = mount('harness-index');
|
|
106
|
+
const one = rowFor(root, 'opencode').querySelector('span[data-harness] svg');
|
|
107
|
+
expect(one?.getAttribute('data-harness')).toBe('opencode');
|
|
108
|
+
// The retired `opencode2` row is gone: one binary, one menu entry.
|
|
109
|
+
expect(Array.from(root.querySelectorAll('span.truncate')).some((s) => s.textContent === 'opencode2')).toBe(false);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test('a non-harness row is untouched', () => {
|
|
113
|
+
const root = mount('appearance');
|
|
114
|
+
for (const label of ['Appearance', 'Providers', 'Projects']) {
|
|
115
|
+
const row = rowFor(root, label);
|
|
116
|
+
expect(row.querySelector('span[data-harness]')).toBeNull();
|
|
117
|
+
expect(row.querySelector('svg.lucide')).not.toBeNull();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('the mark sits in a fixed-width slot so labels stay aligned', () => {
|
|
122
|
+
// The marks' viewBoxes differ, so the slot — not the svg — is what holds the
|
|
123
|
+
// column. A row that skipped it would shift its own label only.
|
|
124
|
+
const root = mount('harness-index');
|
|
125
|
+
for (const entry of harnessMenuEntries()) {
|
|
126
|
+
if (!entry.harness) continue;
|
|
127
|
+
const slot = rowFor(root, entry.label).querySelector('span[data-harness]')?.parentElement;
|
|
128
|
+
expect(slot?.className).toContain('w-[14px]');
|
|
129
|
+
}
|
|
130
|
+
// And every harness page in the catalog declares the id the slot wraps.
|
|
131
|
+
const declared = SETTINGS_CATEGORIES.filter((category) => category.section === 'HARNESSES' && category.harness);
|
|
132
|
+
expect(declared).toHaveLength(harnessMenuEntries().filter((entry) => entry.harness).length);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Globe
|
|
2
|
-
import { BrowserToolbar
|
|
1
|
+
import { Globe } from 'lucide-preact';
|
|
2
|
+
import { BrowserToolbar } from '@/client/components/workspace/browser-toolbar/index';
|
|
3
3
|
import type { BrowserViewStatus } from '@/shared/types';
|
|
4
4
|
|
|
5
5
|
interface BrowserAddressBarProps {
|
|
@@ -50,19 +50,9 @@ export function BrowserAddressBar({
|
|
|
50
50
|
onResetZoom={onResetZoom}
|
|
51
51
|
onIncludeInChat={onIncludeInChat}
|
|
52
52
|
onOpenExternal={onOpenExternal}
|
|
53
|
+
onReconnect={onReconnect}
|
|
53
54
|
openExternalLabel="Buka di jendela baru"
|
|
54
55
|
openExternalTitle={url ? 'Open in new window' : 'No URL loaded'}
|
|
55
|
-
trailingControls={
|
|
56
|
-
<button
|
|
57
|
-
type="button"
|
|
58
|
-
onClick={onReconnect}
|
|
59
|
-
aria-label="Sambungkan ulang live view"
|
|
60
|
-
title="Reconnect live view"
|
|
61
|
-
className={ICON_BUTTON}
|
|
62
|
-
>
|
|
63
|
-
<RotateCw size={14} />
|
|
64
|
-
</button>
|
|
65
|
-
}
|
|
66
56
|
>
|
|
67
57
|
<div className="flex-1 min-w-0 flex items-center bg-canvas border border-ink/15 rounded-md px-2 py-0.5">
|
|
68
58
|
<Globe size={12} className="text-ink/40 mr-1.5 flex-shrink-0" />
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Check,
|
|
3
|
+
Copy,
|
|
4
|
+
ExternalLink,
|
|
5
|
+
MessageSquarePlus,
|
|
6
|
+
RotateCcw,
|
|
7
|
+
RotateCw,
|
|
8
|
+
SquarePen,
|
|
9
|
+
ZoomIn,
|
|
10
|
+
ZoomOut,
|
|
11
|
+
} from 'lucide-preact';
|
|
12
|
+
import { BrowserViewportSelector, VIEWPORT_OPTIONS } from '@/client/components/common/ViewportSelector';
|
|
13
|
+
import { ZoomControls } from '@/client/components/workspace/browser-toolbar/ZoomControls';
|
|
14
|
+
import type { ToolbarCluster } from '@/client/components/common/toolbar-row';
|
|
15
|
+
import type { ViewportMode } from '@/shared/types';
|
|
16
|
+
|
|
17
|
+
/** Class the browser toolbars' icon buttons share. */
|
|
18
|
+
export const ICON_BUTTON =
|
|
19
|
+
'p-1.5 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:cursor-not-allowed';
|
|
20
|
+
|
|
21
|
+
/** The user panel's annotation toggle; the agent panel never supplies it. */
|
|
22
|
+
export interface BrowserToolbarAnnotate {
|
|
23
|
+
active: boolean;
|
|
24
|
+
count: number;
|
|
25
|
+
onToggle: () => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface BrowserClusterInput {
|
|
29
|
+
url: string;
|
|
30
|
+
zoomLevel: number;
|
|
31
|
+
/** True for the 2s after the URL was copied — the button and menu row say so. */
|
|
32
|
+
copied: boolean;
|
|
33
|
+
/** True for the 2.5s after the page context was queued into the draft. */
|
|
34
|
+
included: boolean;
|
|
35
|
+
/** Device-testing cluster, user panel only (see `BrowserToolbarProps`). */
|
|
36
|
+
viewportMode?: ViewportMode;
|
|
37
|
+
onChangeViewport?: (mode: ViewportMode) => void;
|
|
38
|
+
/** Annotation toggle, user panel only. */
|
|
39
|
+
annotate?: BrowserToolbarAnnotate;
|
|
40
|
+
/** Agent panel only: re-attach the live view. */
|
|
41
|
+
onReconnect?: () => void;
|
|
42
|
+
onIncludeInChat: () => void;
|
|
43
|
+
onCopy: () => void;
|
|
44
|
+
onOpenExternal: () => void;
|
|
45
|
+
onZoomIn: () => void;
|
|
46
|
+
onZoomOut: () => void;
|
|
47
|
+
onResetZoom: () => void;
|
|
48
|
+
onSetZoom?: (zoom: number) => void;
|
|
49
|
+
openExternalLabel: string;
|
|
50
|
+
openExternalTitle: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The browser toolbars' trailing controls, as clusters that hide as a unit.
|
|
55
|
+
*
|
|
56
|
+
* ROW ORDER IS HIDING ORDER for `ToolbarRow`: the first clusters stay longest,
|
|
57
|
+
* and everything after the last one that fits moves into `⋯` with the same
|
|
58
|
+
* action it would have run on the row. The address bar is NOT a cluster — it is
|
|
59
|
+
* outside the row and always drawn, because an address field behind a menu is
|
|
60
|
+
* the one control this toolbar cannot do without.
|
|
61
|
+
*
|
|
62
|
+
* Nothing here is pinned. The panel can be dragged down to a phone width, and
|
|
63
|
+
* at that point a row that refuses to give up a control is a row that clips it.
|
|
64
|
+
*/
|
|
65
|
+
export function buildBrowserClusters(input: BrowserClusterInput): ToolbarCluster[] {
|
|
66
|
+
const clusters: ToolbarCluster[] = [];
|
|
67
|
+
const { url, zoomLevel, copied, included } = input;
|
|
68
|
+
|
|
69
|
+
if (input.viewportMode && input.onChangeViewport) {
|
|
70
|
+
const { viewportMode, onChangeViewport, onSetZoom } = input;
|
|
71
|
+
clusters.push({
|
|
72
|
+
id: 'viewport',
|
|
73
|
+
actions: VIEWPORT_OPTIONS.map((option) => ({
|
|
74
|
+
label: option.label,
|
|
75
|
+
icon: option.icon,
|
|
76
|
+
onSelect: () => onChangeViewport(option.id),
|
|
77
|
+
active: viewportMode === option.id,
|
|
78
|
+
})),
|
|
79
|
+
children: (
|
|
80
|
+
<BrowserViewportSelector
|
|
81
|
+
viewportMode={viewportMode}
|
|
82
|
+
onChangeViewport={onChangeViewport}
|
|
83
|
+
zoomLevel={zoomLevel}
|
|
84
|
+
onSetZoom={onSetZoom}
|
|
85
|
+
/>
|
|
86
|
+
),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
clusters.push({
|
|
91
|
+
id: 'zoom',
|
|
92
|
+
actions: [
|
|
93
|
+
{ label: 'Zoom in (+10%)', icon: ZoomIn, onSelect: input.onZoomIn, disabled: zoomLevel >= 200 },
|
|
94
|
+
{ label: 'Zoom out (-10%)', icon: ZoomOut, onSelect: input.onZoomOut, disabled: zoomLevel <= 50 },
|
|
95
|
+
{ label: 'Reset zoom (100%)', icon: RotateCcw, onSelect: input.onResetZoom, active: zoomLevel === 100 },
|
|
96
|
+
],
|
|
97
|
+
children: (
|
|
98
|
+
<ZoomControls
|
|
99
|
+
zoomLevel={zoomLevel}
|
|
100
|
+
onZoomIn={input.onZoomIn}
|
|
101
|
+
onZoomOut={input.onZoomOut}
|
|
102
|
+
onResetZoom={input.onResetZoom}
|
|
103
|
+
/>
|
|
104
|
+
),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
clusters.push({
|
|
108
|
+
id: 'include',
|
|
109
|
+
actions: [
|
|
110
|
+
{
|
|
111
|
+
label: included ? 'Page context added to the draft' : 'Include this page in the chat draft',
|
|
112
|
+
icon: MessageSquarePlus,
|
|
113
|
+
onSelect: input.onIncludeInChat,
|
|
114
|
+
disabled: !url,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
children: (
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
onClick={input.onIncludeInChat}
|
|
121
|
+
disabled={!url}
|
|
122
|
+
aria-label="Include this page in the chat draft"
|
|
123
|
+
title={included ? 'Page context added to the draft' : 'Include this page in the chat draft'}
|
|
124
|
+
className={ICON_BUTTON}
|
|
125
|
+
>
|
|
126
|
+
{included ? <Check size={14} className="text-success" /> : <MessageSquarePlus size={14} />}
|
|
127
|
+
</button>
|
|
128
|
+
),
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
if (input.annotate) {
|
|
132
|
+
const annotate = input.annotate;
|
|
133
|
+
clusters.push({
|
|
134
|
+
id: 'annotate',
|
|
135
|
+
actions: [
|
|
136
|
+
{
|
|
137
|
+
label:
|
|
138
|
+
annotate.count > 0
|
|
139
|
+
? `${annotate.active ? 'Tutup mode anotasi' : 'Buka mode anotasi'} (${annotate.count})`
|
|
140
|
+
: 'Mark a part of the page, then send it to the chat',
|
|
141
|
+
icon: SquarePen,
|
|
142
|
+
onSelect: annotate.onToggle,
|
|
143
|
+
active: annotate.active,
|
|
144
|
+
disabled: !url,
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
children: (
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
onClick={annotate.onToggle}
|
|
151
|
+
disabled={!url}
|
|
152
|
+
aria-label="Page annotation mode"
|
|
153
|
+
aria-pressed={annotate.active}
|
|
154
|
+
title={
|
|
155
|
+
annotate.active
|
|
156
|
+
? 'Tutup mode anotasi'
|
|
157
|
+
: annotate.count > 0
|
|
158
|
+
? `Anotasi (${annotate.count}) — buka lagi`
|
|
159
|
+
: 'Mark a part of the page, then send it to the chat'
|
|
160
|
+
}
|
|
161
|
+
className={`${ICON_BUTTON} relative ${annotate.active ? 'bg-ink/10 text-ink' : ''}`}
|
|
162
|
+
>
|
|
163
|
+
<SquarePen size={14} />
|
|
164
|
+
{annotate.count > 0 && (
|
|
165
|
+
<span className="absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-0.5 rounded-full bg-error text-paper text-[10px] leading-[13px] font-mono text-center">
|
|
166
|
+
{annotate.count}
|
|
167
|
+
</span>
|
|
168
|
+
)}
|
|
169
|
+
</button>
|
|
170
|
+
),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
clusters.push({
|
|
175
|
+
id: 'copy',
|
|
176
|
+
actions: [
|
|
177
|
+
{ label: copied ? 'Copied URL!' : 'Copy URL', icon: Copy, onSelect: input.onCopy, disabled: !url },
|
|
178
|
+
],
|
|
179
|
+
children: (
|
|
180
|
+
<button
|
|
181
|
+
type="button"
|
|
182
|
+
onClick={input.onCopy}
|
|
183
|
+
disabled={!url}
|
|
184
|
+
aria-label="Salin URL"
|
|
185
|
+
title={copied ? 'Copied URL!' : 'Copy URL'}
|
|
186
|
+
className={ICON_BUTTON}
|
|
187
|
+
>
|
|
188
|
+
{copied ? <Check size={14} className="text-success" /> : <Copy size={14} />}
|
|
189
|
+
</button>
|
|
190
|
+
),
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
if (input.onReconnect) {
|
|
194
|
+
const onReconnect = input.onReconnect;
|
|
195
|
+
clusters.push({
|
|
196
|
+
id: 'reconnect',
|
|
197
|
+
actions: [{ label: 'Sambungkan ulang live view', icon: RotateCw, onSelect: onReconnect }],
|
|
198
|
+
children: (
|
|
199
|
+
<button
|
|
200
|
+
type="button"
|
|
201
|
+
onClick={onReconnect}
|
|
202
|
+
aria-label="Sambungkan ulang live view"
|
|
203
|
+
title="Reconnect live view"
|
|
204
|
+
className={ICON_BUTTON}
|
|
205
|
+
>
|
|
206
|
+
<RotateCw size={14} />
|
|
207
|
+
</button>
|
|
208
|
+
),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
clusters.push({
|
|
213
|
+
id: 'open-external',
|
|
214
|
+
actions: [
|
|
215
|
+
{
|
|
216
|
+
label: input.openExternalLabel,
|
|
217
|
+
icon: ExternalLink,
|
|
218
|
+
onSelect: input.onOpenExternal,
|
|
219
|
+
disabled: !url,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
children: (
|
|
223
|
+
<button
|
|
224
|
+
type="button"
|
|
225
|
+
onClick={input.onOpenExternal}
|
|
226
|
+
disabled={!url}
|
|
227
|
+
aria-label={input.openExternalLabel}
|
|
228
|
+
title={input.openExternalTitle}
|
|
229
|
+
className={ICON_BUTTON}
|
|
230
|
+
>
|
|
231
|
+
<ExternalLink size={14} />
|
|
232
|
+
</button>
|
|
233
|
+
),
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
return clusters;
|
|
237
|
+
}
|