@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,9 +9,14 @@ import { SocialLinks } from '@/client/components/layout/session-sidebar/about-mo
|
|
|
9
9
|
import { UpdateSection } from '@/client/components/layout/session-sidebar/about-modal/UpdateSection';
|
|
10
10
|
import { VersionLine } from '@/client/components/layout/session-sidebar/about-modal/VersionLine';
|
|
11
11
|
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
12
|
+
import { useHarnesses } from '@/client/hooks/models/use-harnesses';
|
|
13
|
+
import { HarnessTable, harnessCategoryFor } from '@/client/components/layout/session-sidebar/about-modal/HarnessTable';
|
|
14
|
+
import { useHarnessVersions } from '@/client/hooks/models/use-harness-versions';
|
|
12
15
|
import { useDialogBehaviour } from '@/client/hooks/ui/dialog-behaviour';
|
|
13
16
|
import { UPDATE_POPUP_OPEN_EVENT } from '@/shared/lib/updates/popup-state';
|
|
14
17
|
import type { UpdateTarget } from '@/shared/types/updates';
|
|
18
|
+
import { MAX_WIDTH as CARD_MAX_WIDTH } from '@/client/components/workspace/model-dropdown/popover-metrics';
|
|
19
|
+
import { safeAreaPadding } from '@/shared/lib/ui/safe-area';
|
|
15
20
|
|
|
16
21
|
export interface AboutModalProps {
|
|
17
22
|
isOpen: boolean;
|
|
@@ -29,6 +34,43 @@ export function AboutModal({ isOpen, onClose, updates, onToast }: AboutModalProp
|
|
|
29
34
|
// `aria-modal`, and Escape did nothing while focus sat inside it.
|
|
30
35
|
const panelRef = useRef<HTMLDivElement | null>(null);
|
|
31
36
|
useDialogBehaviour(panelRef, { open: isOpen, onClose });
|
|
37
|
+
// The SAME shared store the composer's tab strip and Settings read, so a probe
|
|
38
|
+
// made in either appears here without a reload.
|
|
39
|
+
const { harnesses, isLoading: harnessesLoading } = useHarnesses();
|
|
40
|
+
const versions = useHarnessVersions();
|
|
41
|
+
// Which harness is mid-update. ONE row says so, so a second row cannot be
|
|
42
|
+
// started by accident and the reader can still read the rest of the card.
|
|
43
|
+
const [updating, setUpdating] = useState<string | null>(null);
|
|
44
|
+
|
|
45
|
+
/** Run one harness's update and report the refusal, if there is one. */
|
|
46
|
+
const updateHarness = async (id: string): Promise<string | null> => {
|
|
47
|
+
setUpdating(id);
|
|
48
|
+
try {
|
|
49
|
+
const response = await fetch('/api/harness/update', {
|
|
50
|
+
method: 'POST',
|
|
51
|
+
headers: { 'Content-Type': 'application/json' },
|
|
52
|
+
body: JSON.stringify({ harness: id }),
|
|
53
|
+
});
|
|
54
|
+
const payload = (await response.json()) as { message?: string; error?: string; output?: string };
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
return payload.error ?? `Update failed (HTTP ${response.status})`;
|
|
57
|
+
}
|
|
58
|
+
// The version the agent reports only changes after a restart, so the row is
|
|
59
|
+
// refreshed rather than optimistic: it will read the OLD number until the
|
|
60
|
+
// agent is probed again, and saying otherwise would be a claim Kabmo cannot
|
|
61
|
+
// stand behind.
|
|
62
|
+
// `refresh`, not `reload(false)`: the rows must be re-read, but forcing a
|
|
63
|
+
// registry request per npm harness after every update is a cost with no
|
|
64
|
+
// answer — the number this update just installed IS the latest one.
|
|
65
|
+
versions.refresh();
|
|
66
|
+
onToast?.(payload.message ?? 'Update finished', 'success');
|
|
67
|
+
return null;
|
|
68
|
+
} catch (cause) {
|
|
69
|
+
return cause instanceof Error ? cause.message : 'Update failed';
|
|
70
|
+
} finally {
|
|
71
|
+
setUpdating(null);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
32
74
|
|
|
33
75
|
// "What's new" opens the popup, which draws at a higher layer: leaving this
|
|
34
76
|
// dialog mounted would stack two modals over the same subject, and its
|
|
@@ -49,8 +91,20 @@ export function AboutModal({ isOpen, onClose, updates, onToast }: AboutModalProp
|
|
|
49
91
|
// closed, and was invisible.
|
|
50
92
|
return createPortal(
|
|
51
93
|
<>
|
|
94
|
+
{/* ONE centered card at both sizes, sized like the composer's model
|
|
95
|
+
picker: the phone gets its own width cap (the popover's 512px) instead
|
|
96
|
+
of the whole screen, and the card is as TALL as its content up to the
|
|
97
|
+
space the safe area leaves — so nothing hides under the status bar or
|
|
98
|
+
the home indicator, and a short card never asks for a scroll.
|
|
99
|
+
|
|
100
|
+
Full-bleed on a phone was the bug: `h-full w-full` with no gutters put
|
|
101
|
+
the header at the viewport's top edge, which a `viewport-fit: cover`
|
|
102
|
+
surface draws UNDER the phone's status bar. The scrim's padding is
|
|
103
|
+
`safeAreaPadding` — one rule, shared with the `Modal` shell. The
|
|
104
|
+
desktop keeps its FIXED 880px two-column card. */}
|
|
52
105
|
<div
|
|
53
|
-
className="fixed inset-0 modal-scrim
|
|
106
|
+
className="fixed inset-0 modal-scrim z-50 flex items-center justify-center md:backdrop-blur-[2px] animate-in fade-in duration-200"
|
|
107
|
+
style={safeAreaPadding()}
|
|
54
108
|
onClick={onClose}
|
|
55
109
|
>
|
|
56
110
|
<div
|
|
@@ -59,53 +113,100 @@ export function AboutModal({ isOpen, onClose, updates, onToast }: AboutModalProp
|
|
|
59
113
|
aria-modal="true"
|
|
60
114
|
aria-label="About Kabmo"
|
|
61
115
|
tabIndex={-1}
|
|
62
|
-
|
|
116
|
+
// A FIXED desktop width, not `w-auto`: the card is sized by its content
|
|
117
|
+
// when auto, so narrowing any one column shrank the whole dialog
|
|
118
|
+
// (measured when the action column went to an icon). 880px is what the
|
|
119
|
+
// two-column table needs with room for the widest agent name.
|
|
120
|
+
//
|
|
121
|
+
// The phone cap is the MODEL PICKER's own width (`MAX_WIDTH`), so the
|
|
122
|
+
// console's two floating cards are one size class; `min(…, 100%)` keeps
|
|
123
|
+
// a 320px phone from overflowing the backdrop padding.
|
|
124
|
+
className="glass-overlay relative flex max-h-full w-full max-w-[var(--about-card-max)] flex-col overflow-hidden rounded-2xl border border-ink/15 bg-paper text-ink shadow-2xl select-none md:w-[880px] md:max-w-[calc(100vw-3rem)] md:max-h-[92vh]"
|
|
125
|
+
style={{ '--about-card-max': `min(${CARD_MAX_WIDTH}px, 100%)` }}
|
|
63
126
|
onClick={(e) => e.stopPropagation()}
|
|
64
127
|
>
|
|
65
128
|
{/* Close Button */}
|
|
66
129
|
<button
|
|
67
130
|
onClick={onClose}
|
|
68
|
-
className="absolute top-
|
|
131
|
+
className="absolute right-3 top-3 z-10 rounded-md p-1.5 text-ink/40 transition-colors hover:bg-ink/5 hover:text-ink md:right-4 md:top-4"
|
|
69
132
|
aria-label="Close"
|
|
70
133
|
>
|
|
71
134
|
<X size={18} className="stroke-[2.5]" />
|
|
72
135
|
</button>
|
|
73
136
|
|
|
74
|
-
{/*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
137
|
+
{/* ONE scroller for the WHOLE card, at both sizes: the harness table
|
|
138
|
+
used to cap itself at `46vh` and scroll on a phone while the card
|
|
139
|
+
still had most of the screen empty below it. The body is the only
|
|
140
|
+
place a scroll can happen now, and only when the content genuinely
|
|
141
|
+
outgrows the card. On a desktop the card sizes itself to the content
|
|
142
|
+
instead of asking the reader to scroll a dialog. */}
|
|
143
|
+
<div className="min-h-0 flex-1 scrollbar-overlay-container overflow-y-auto p-5 md:flex-none md:overflow-visible md:p-6">
|
|
144
|
+
<header className="flex items-center gap-3 pr-10">
|
|
145
|
+
<img src="/icon.svg" alt="Kabmo" width={44} height={44} draggable={false} />
|
|
146
|
+
<div className="min-w-0">
|
|
147
|
+
<h2 className="flex items-center text-lg font-bold tracking-tight">
|
|
148
|
+
<BrandWordmark className="text-lg" />
|
|
149
|
+
</h2>
|
|
150
|
+
{/* Version lines: each circle-i opens the release notes for the
|
|
151
|
+
version that is RUNNING; the updates section answers what an
|
|
152
|
+
update would install. */}
|
|
153
|
+
<div className="mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 font-mono text-[11px] text-ink/55">
|
|
154
|
+
<VersionLine
|
|
155
|
+
label={`Kabmo v${packageJson.version}`}
|
|
156
|
+
notesLabel="What's new in Kabmo"
|
|
157
|
+
onNotes={() => setNotesTarget('kabmo')}
|
|
158
|
+
/>
|
|
159
|
+
<VersionLine
|
|
160
|
+
label={`Oh-My-Pi ${updates.info?.omp.current ?? '…'}`}
|
|
161
|
+
notesLabel="What's new in Oh-My-Pi"
|
|
162
|
+
onNotes={() => setNotesTarget('omp')}
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</header>
|
|
78
167
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
168
|
+
{/* The AGENTS own the card's width in a two-column list; the update
|
|
169
|
+
controls and links sit in ONE merged strip under them. A rail
|
|
170
|
+
beside the table was tried and measured: it squeezed each row's
|
|
171
|
+
three cells into 280px while the rail held two short blocks, so
|
|
172
|
+
the content paid for the sidebar. */}
|
|
173
|
+
<div className="mt-5">
|
|
174
|
+
<HarnessTable
|
|
175
|
+
harnesses={harnesses}
|
|
176
|
+
versions={versions.rows}
|
|
177
|
+
loading={harnessesLoading}
|
|
178
|
+
onUpdate={updateHarness}
|
|
179
|
+
updating={updating}
|
|
180
|
+
onOpenHarness={(id) => {
|
|
181
|
+
onClose();
|
|
182
|
+
// The settings modal is the frame that owns harness pages; the
|
|
183
|
+
// dispatcher is its opener, so About does not need a reference
|
|
184
|
+
// to it (and cannot hold a stale one).
|
|
185
|
+
window.dispatchEvent(new CustomEvent('omp:open-settings', {
|
|
186
|
+
detail: { category: harnessCategoryFor(id) },
|
|
187
|
+
}));
|
|
188
|
+
}}
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
83
191
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
notesLabel="What's new in Oh-My-Pi"
|
|
96
|
-
onNotes={() => setNotesTarget('omp')}
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
192
|
+
{/* ONE stacked strip, as it has always been: the Kabmo-side update
|
|
193
|
+
controls, then the project's links directly UNDER them. Side by
|
|
194
|
+
side was tried and is wrong — the two are different subjects, and
|
|
195
|
+
a reader who wants "check for updates" should not have to decide
|
|
196
|
+
which column it lives in. */}
|
|
197
|
+
{/* No `border-t` here: `UpdateSection` already draws `border-y`, and
|
|
198
|
+
two rules 16px apart read as a mistake. */}
|
|
199
|
+
<div className="mt-5">
|
|
200
|
+
<UpdateSection updates={updates} onToast={onToast} />
|
|
201
|
+
<SocialLinks />
|
|
202
|
+
</div>
|
|
99
203
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<Heart size={12} className="fill-current text-error shrink-0" aria-hidden="true" />
|
|
107
|
-
Made with love for the community
|
|
108
|
-
</p>
|
|
204
|
+
{/* Footer */}
|
|
205
|
+
<p className="mt-6 flex items-center justify-center gap-1.5 border-t border-ink/10 pt-3 text-[11px] font-normal text-ink/50">
|
|
206
|
+
<Heart size={12} className="shrink-0 fill-current text-error" aria-hidden="true" />
|
|
207
|
+
Made with love for the community
|
|
208
|
+
</p>
|
|
209
|
+
</div>
|
|
109
210
|
</div>
|
|
110
211
|
</div>
|
|
111
212
|
{/* Sibling of the About backdrop, not a child: an event inside the portal
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The harness mark inside the actual session rows.
|
|
8
|
+
*
|
|
9
|
+
* `harness-glyph.test.ts` pins the mark itself; this pins the WIRING, which is
|
|
10
|
+
* where the bug would be: a prop that is accepted but never passed down to the
|
|
11
|
+
* title line leaves every row blank while the component's own suite stays green.
|
|
12
|
+
* Both desktop styles and the phone drawer are asserted because they are three
|
|
13
|
+
* separate render paths for one fact.
|
|
14
|
+
*
|
|
15
|
+
* It also pins the thing that must NOT change: a row with no harness renders
|
|
16
|
+
* the title exactly as before, so a list of pre-harness sessions keeps its old
|
|
17
|
+
* alignment.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
21
|
+
import { Window } from 'happy-dom';
|
|
22
|
+
import { h, render } from 'preact';
|
|
23
|
+
import { act } from 'preact/test-utils';
|
|
24
|
+
|
|
25
|
+
import { SessionItem } from '@/client/components/layout/session-sidebar/SessionItem';
|
|
26
|
+
import { SessionRow } from '@/client/components/common/session-row';
|
|
27
|
+
import { MobileSessionRow } from '@/client/components/mobile/mobile-session-sidebar/SessionRow';
|
|
28
|
+
import type { SessionItemData } from '@/shared/types';
|
|
29
|
+
|
|
30
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'HTMLInputElement', 'Event', 'MouseEvent', 'KeyboardEvent'] as const;
|
|
31
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
32
|
+
|
|
33
|
+
let container: HTMLElement;
|
|
34
|
+
|
|
35
|
+
beforeAll(() => {
|
|
36
|
+
const win = new Window({ url: 'http://localhost' });
|
|
37
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
38
|
+
for (const key of DOM_GLOBALS) {
|
|
39
|
+
if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
|
|
40
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
afterAll(() => {
|
|
45
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
46
|
+
for (const key of DOM_GLOBALS) {
|
|
47
|
+
if (nativeGlobals[key] === undefined) delete target[key];
|
|
48
|
+
else target[key] = nativeGlobals[key];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
afterEach(() => {
|
|
53
|
+
if (container) render(null, container);
|
|
54
|
+
container?.remove();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const session: SessionItemData = { id: 's1', folder_id: 1, title: 'hello world' };
|
|
58
|
+
|
|
59
|
+
async function mount(node: preact.ComponentChild) {
|
|
60
|
+
container = document.createElement('div');
|
|
61
|
+
document.body.appendChild(container);
|
|
62
|
+
await act(async () => {
|
|
63
|
+
render(node, container);
|
|
64
|
+
});
|
|
65
|
+
return container;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
describe('harness mark in the session rows', () => {
|
|
69
|
+
test('classic desktop row draws it beside the title', async () => {
|
|
70
|
+
const el = await mount(h(SessionItem, { sessionId: 's1', title: 'hello world', harness: 'claude' }));
|
|
71
|
+
expect(el.querySelector('[data-harness]')?.getAttribute('data-harness')).toBe('claude');
|
|
72
|
+
// It lives on the title line, not in the leading status slot: the slot's
|
|
73
|
+
// own child is the run cue / chevron, and a mark there would push titles.
|
|
74
|
+
expect(el.querySelector('[data-testid="session-item"]')?.textContent).toContain('Hello world');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('modern desktop row draws it, at the compact size', async () => {
|
|
78
|
+
const el = await mount(h(SessionRow, { sessionId: 's1', title: 'hello world', harness: 'codex' }));
|
|
79
|
+
expect(el.querySelector('[data-harness]')?.getAttribute('data-harness')).toBe('codex');
|
|
80
|
+
expect(el.querySelector('[data-harness]')?.getAttribute('aria-label')).toBe('codex');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('phone row draws it, at the touch size', async () => {
|
|
84
|
+
const el = await mount(
|
|
85
|
+
h(MobileSessionRow, { session, harness: 'opencode', isActive: false, timeAgo: '2m', onSelect: () => {}, onArchive: () => {} }),
|
|
86
|
+
);
|
|
87
|
+
expect(el.querySelector('[data-harness]')?.getAttribute('data-harness')).toBe('opencode');
|
|
88
|
+
expect(el.querySelector('[data-harness] svg')?.getAttribute('width')).toBe('13');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('a row with no harness draws no mark and keeps its title intact', async () => {
|
|
92
|
+
const el = await mount(h(SessionItem, { sessionId: 's1', title: 'hello world' }));
|
|
93
|
+
expect(el.querySelector('[data-harness]')).toBeNull();
|
|
94
|
+
expect(el.querySelector('[data-testid="session-item"]')?.textContent).toContain('Hello world');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test('a row with no harness renders no spacer either', async () => {
|
|
98
|
+
// The wrapper span owns the 6px gap (`mr-1.5`), so leaving it in place for a
|
|
99
|
+
// null harness shifted every pre-harness and MOCK title right by 6px while
|
|
100
|
+
// the page still looked plausible. The mark is gated at the CALL SITE, not
|
|
101
|
+
// inside `HarnessGlyph` — which returns null and leaves the wrapper behind.
|
|
102
|
+
const el = await mount(h(SessionItem, { sessionId: 's1', title: 'hello world' }));
|
|
103
|
+
const row = el.querySelector('[data-testid="session-item"]');
|
|
104
|
+
const title = Array.from(row?.querySelectorAll('span') ?? []).find(
|
|
105
|
+
(span) => span.textContent?.trim() === 'Hello world',
|
|
106
|
+
);
|
|
107
|
+
const spacer = Array.from(row?.querySelectorAll('span') ?? []).filter(
|
|
108
|
+
(span) => span.className.includes('mr-1.5') && span.className.includes('shrink-0'),
|
|
109
|
+
);
|
|
110
|
+
expect(spacer).toHaveLength(0);
|
|
111
|
+
expect(title).toBeTruthy();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test('the mark does not become the row click target', async () => {
|
|
115
|
+
// A decorative span inside the row must not swallow the click that opens
|
|
116
|
+
// the session, nor add a second interactive element to the tab order.
|
|
117
|
+
// `antigravity`, not the retired `gemini`: a harness the catalog no longer
|
|
118
|
+
// knows renders NO mark, so the assertion below would pass against
|
|
119
|
+
// `undefined` and stop proving anything about the click target.
|
|
120
|
+
const el = await mount(h(SessionItem, { sessionId: 's1', title: 'hello world', harness: 'antigravity' }));
|
|
121
|
+
const mark = el.querySelector('[data-harness]');
|
|
122
|
+
expect(mark).not.toBeNull();
|
|
123
|
+
expect(mark?.closest('button')).toBeNull();
|
|
124
|
+
expect(el.querySelector('[data-harness]')?.getAttribute('role')).toBe('img');
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
import { ArrowUpDown, Calendar, FolderPlus, Plus, RefreshCw } from 'lucide-preact';
|
|
27
27
|
import { SortMenu } from '@/client/components/common/sort-menu';
|
|
28
|
+
import { CONTROL_BOX, CONTROL_CLUSTER_GAP, CONTROL_ROW_GAP } from '@/client/lib/ui/control-plate';
|
|
28
29
|
import type { SessionSortOption } from '@/shared/types';
|
|
29
30
|
|
|
30
31
|
export interface SidebarActionRowProps {
|
|
@@ -67,11 +68,11 @@ export function SidebarActionRow({
|
|
|
67
68
|
onSortChange,
|
|
68
69
|
touch = false,
|
|
69
70
|
}: SidebarActionRowProps) {
|
|
70
|
-
const glyph = `${GLYPH} ${touch ?
|
|
71
|
+
const glyph = `${GLYPH} ${touch ? CONTROL_BOX.mobile : CONTROL_BOX.desktop}`;
|
|
71
72
|
const schedulerLabel = scheduledCount > 0 ? `Scheduled tasks (${scheduledCount} armed)` : 'Scheduled tasks';
|
|
72
73
|
|
|
73
74
|
return (
|
|
74
|
-
<div className=
|
|
75
|
+
<div className={`flex items-center ${CONTROL_CLUSTER_GAP} px-3 pb-2`}>
|
|
75
76
|
<button
|
|
76
77
|
type="button"
|
|
77
78
|
onClick={onNewSession}
|
|
@@ -85,7 +86,7 @@ export function SidebarActionRow({
|
|
|
85
86
|
<span className="truncate">New Session</span>
|
|
86
87
|
</button>
|
|
87
88
|
|
|
88
|
-
<div className=
|
|
89
|
+
<div className={`flex shrink-0 items-center ${CONTROL_ROW_GAP}`}>
|
|
89
90
|
<button
|
|
90
91
|
type="button"
|
|
91
92
|
onClick={onNewWorkspace}
|
|
@@ -17,7 +17,6 @@ import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
|
|
|
17
17
|
import { useMissingFiles } from '@/client/hooks/workspace/missing-files';
|
|
18
18
|
import { startPendingSession } from '@/client/hooks/chat/omp/pending-sessions';
|
|
19
19
|
import { useToasts } from '@/client/hooks/ui/toasts';
|
|
20
|
-
import { ToastStack } from '@/client/components/common/ToastStack';
|
|
21
20
|
import { useEditorDrop, type EditorDropResult } from '@/client/hooks/editor/use-editor-drop';
|
|
22
21
|
import { EditorDropOverlay } from '@/client/components/workspace/editor/EditorDropOverlay';
|
|
23
22
|
import { PluginBootstrap } from '@/client/lib/plugins/bootstrap';
|
|
@@ -68,7 +67,7 @@ export function MobileLayoutWrapper({ onDesktopToggle, appSettings = {} }: Mobil
|
|
|
68
67
|
// a nested-repo file against the workspace root and answered "gone" for a file
|
|
69
68
|
// that had just been read.
|
|
70
69
|
const mobileEditorMissingIds = useMissingFiles(mobileProbeTabs(mobileEditorFile), refreshKey);
|
|
71
|
-
const {
|
|
70
|
+
const { pushToast } = useToasts();
|
|
72
71
|
const handleDropResult = useCallback(
|
|
73
72
|
(result: EditorDropResult) => pushToast(result.message, result.ok ? 'success' : 'error'),
|
|
74
73
|
[pushToast],
|
|
@@ -330,11 +329,6 @@ export function MobileLayoutWrapper({ onDesktopToggle, appSettings = {} }: Mobil
|
|
|
330
329
|
autoOpenAddProvider={autoOpenAddProvider}
|
|
331
330
|
appSettings={appSettings}
|
|
332
331
|
/>
|
|
333
|
-
{/* A drop on the full-screen editor either opens a file or is refused, and
|
|
334
|
-
the refusal names why. The phone's own toast stack lives in the
|
|
335
|
-
drawer, which is closed while the editor is up — so this layout needs
|
|
336
|
-
its own or the answer would go nowhere. */}
|
|
337
|
-
<ToastStack toasts={toasts} onDismiss={dismissToast} />
|
|
338
332
|
</div>
|
|
339
333
|
);
|
|
340
334
|
}
|
|
@@ -110,7 +110,7 @@ export function MobileSessionSidebar({
|
|
|
110
110
|
// An update inside a native shell, an install on an Android browser, nothing
|
|
111
111
|
// elsewhere — see `useShellOffer`.
|
|
112
112
|
const shellDownload = useShellOffer();
|
|
113
|
-
const {
|
|
113
|
+
const { pushToast } = useToasts();
|
|
114
114
|
const cancelWait = useCancelWait(pushToast);
|
|
115
115
|
useWaitingDispatch({ onNotice: pushToast });
|
|
116
116
|
|
|
@@ -312,8 +312,6 @@ export function MobileSessionSidebar({
|
|
|
312
312
|
batchMode={selection.mode}
|
|
313
313
|
onEndBatch={selection.end}
|
|
314
314
|
scopeLabel={scopeFolder?.name}
|
|
315
|
-
toasts={toasts}
|
|
316
|
-
dismissToast={dismissToast}
|
|
317
315
|
/>
|
|
318
316
|
|
|
319
317
|
</div>
|
|
@@ -11,6 +11,7 @@ import { HeaderControls } from '@/client/components/common/header-controls';
|
|
|
11
11
|
import { titlebarPaddingLeft, titlebarPaddingRight } from '@/shared/lib/ui/titlebar';
|
|
12
12
|
import { mobileOverlayStyle } from '@/shared/lib/ui/mobile-overlay';
|
|
13
13
|
import { dragRegionProps, titlebarInsetLeft } from '@/client/lib/desktop/titlebar';
|
|
14
|
+
import { CONTROL_CLUSTER_GAP } from '@/client/lib/ui/control-plate';
|
|
14
15
|
|
|
15
16
|
interface MobileHeaderProps {
|
|
16
17
|
activeSessionTitle: string;
|
|
@@ -91,7 +92,7 @@ export function MobileHeader({
|
|
|
91
92
|
|
|
92
93
|
return (
|
|
93
94
|
<header
|
|
94
|
-
className=
|
|
95
|
+
className={`flex-shrink-0 bg-canvas border-b border-ink/10 flex items-center justify-between ${CONTROL_CLUSTER_GAP} px-3 z-20 titlebar-drag-region select-none`}
|
|
95
96
|
{...dragRegionProps()}
|
|
96
97
|
style={{
|
|
97
98
|
height: 'calc(3.5rem + env(safe-area-inset-top, 0px))',
|
|
@@ -126,7 +127,7 @@ export function MobileHeader({
|
|
|
126
127
|
<button
|
|
127
128
|
type="button"
|
|
128
129
|
onClick={onOpenSessionSidebar}
|
|
129
|
-
className="
|
|
130
|
+
className="w-9 h-9 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 inline-flex items-center justify-center"
|
|
130
131
|
title="Open Sessions"
|
|
131
132
|
aria-label="Open Sessions"
|
|
132
133
|
>
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* expression rather than being buried between modals.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { ToastStack } from '@/client/components/common/ToastStack';
|
|
18
17
|
import { AboutModal, NewWorkspaceModal } from '@/client/components/layout/session-sidebar/Modals';
|
|
19
18
|
import { SchedulerModal } from '@/client/components/layout/session-sidebar/scheduler-modal';
|
|
20
19
|
import { UpdatePopup } from '@/client/components/layout/update-popup';
|
|
@@ -35,12 +34,9 @@ interface MobileDrawerDialogsProps {
|
|
|
35
34
|
updates: UseUpdatesResult;
|
|
36
35
|
pushToast: ToastsHandle['pushToast'];
|
|
37
36
|
batchDelete: BatchDeleteRun;
|
|
38
|
-
/** The batch mode the confirmation names, and the way out of it. */
|
|
39
37
|
batchMode: 'workspace' | 'session' | null;
|
|
40
38
|
onEndBatch: () => void;
|
|
41
39
|
scopeLabel?: string;
|
|
42
|
-
toasts: ToastsHandle['toasts'];
|
|
43
|
-
dismissToast: ToastsHandle['dismissToast'];
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
export function MobileDrawerDialogs({
|
|
@@ -57,8 +53,6 @@ export function MobileDrawerDialogs({
|
|
|
57
53
|
batchMode,
|
|
58
54
|
onEndBatch,
|
|
59
55
|
scopeLabel,
|
|
60
|
-
toasts,
|
|
61
|
-
dismissToast,
|
|
62
56
|
}: MobileDrawerDialogsProps) {
|
|
63
57
|
return (
|
|
64
58
|
<>
|
|
@@ -99,8 +93,6 @@ export function MobileDrawerDialogs({
|
|
|
99
93
|
});
|
|
100
94
|
}}
|
|
101
95
|
/>
|
|
102
|
-
|
|
103
|
-
<ToastStack toasts={toasts} onDismiss={dismissToast} />
|
|
104
96
|
</>
|
|
105
97
|
);
|
|
106
98
|
}
|
|
@@ -241,6 +241,7 @@ export function MobileSessionCategory({
|
|
|
241
241
|
<div key={session.id} className="space-y-0.5">
|
|
242
242
|
<MobileSessionRow
|
|
243
243
|
session={session}
|
|
244
|
+
harness={session.harness}
|
|
244
245
|
isActive={isSessionActive && !isViewingSubagent}
|
|
245
246
|
status={sessionStatus[sessionKey]}
|
|
246
247
|
awaitingInput={Boolean(session.awaitingInput)}
|
|
@@ -4,10 +4,14 @@ import { useInlineRename } from '@/client/hooks/ui/inline-rename';
|
|
|
4
4
|
import { useSessionRenaming } from '@/client/hooks/workspace/renaming-sessions';
|
|
5
5
|
import { SessionActionsMenu, useRowMenu } from '@/client/components/common/session-actions-menu';
|
|
6
6
|
import { SelectionCheckbox } from '@/client/components/common/batch-selection/SelectionCheckbox';
|
|
7
|
+
import { HarnessGlyph, HARNESS_GLYPH_SIZE } from '@/client/components/common/harness-glyph';
|
|
7
8
|
import { WorktreeBadge } from '@/client/components/layout/session-sidebar/WorktreeBadge';
|
|
8
9
|
|
|
9
10
|
export interface MobileSessionRowProps {
|
|
10
11
|
session: SessionItemData;
|
|
12
|
+
/** Harness that ran this session (`omp-rpc`, `claude`, …). Absent draws no
|
|
13
|
+
* glyph, so a pre-harness row keeps its old alignment. */
|
|
14
|
+
harness?: string;
|
|
11
15
|
isActive: boolean;
|
|
12
16
|
status?: 'stream' | 'finish' | 'abort';
|
|
13
17
|
/** The session's agent is blocked on a question until the user answers it. */
|
|
@@ -41,6 +45,7 @@ export interface MobileSessionRowProps {
|
|
|
41
45
|
|
|
42
46
|
export function MobileSessionRow({
|
|
43
47
|
session,
|
|
48
|
+
harness,
|
|
44
49
|
isActive,
|
|
45
50
|
status,
|
|
46
51
|
awaitingInput = false,
|
|
@@ -170,7 +175,18 @@ export function MobileSessionRow({
|
|
|
170
175
|
</span>
|
|
171
176
|
)}
|
|
172
177
|
<span className="flex flex-col min-w-0 ml-2 leading-snug">
|
|
173
|
-
|
|
178
|
+
{/* Same rule as both desktop rows: the mark sits between the
|
|
179
|
+
leading slot and the name, at the touch size. Gated at the call
|
|
180
|
+
site so a row with no harness draws nothing at all — not even
|
|
181
|
+
the gap `HarnessGlyph`'s wrapper would leave behind. */}
|
|
182
|
+
<span className="flex min-w-0 items-center">
|
|
183
|
+
{harness && (
|
|
184
|
+
<span className="mr-1.5 flex shrink-0 items-center">
|
|
185
|
+
<HarnessGlyph harness={harness} size={HARNESS_GLYPH_SIZE.touch} />
|
|
186
|
+
</span>
|
|
187
|
+
)}
|
|
188
|
+
<span className="min-w-0 truncate text-xs">{title}</span>
|
|
189
|
+
</span>
|
|
174
190
|
{waiting && (
|
|
175
191
|
<span className="text-[10px] text-ink/40 truncate">
|
|
176
192
|
waiting for {waitingFor?.title ?? 'another session'}
|