@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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The browser toolbar never gives up its address bar.
|
|
8
|
+
*
|
|
9
|
+
* Two panels share this bar and both can be dragged down to a phone width. The
|
|
10
|
+
* defect this pins is the one a fixed row produces: the trailing controls keep
|
|
11
|
+
* their space and the address field — the single control the toolbar cannot do
|
|
12
|
+
* without — is what gets squeezed to nothing. So the cases below assert, at
|
|
13
|
+
* three bar widths, that the address field is still rendered and that whatever
|
|
14
|
+
* left the row is a `⋯` row rather than a clipped button.
|
|
15
|
+
*
|
|
16
|
+
* happy-dom lays nothing out, so `clientWidth` and `getBoundingClientRect` are
|
|
17
|
+
* stubbed at the prototype level — the component decides from exactly those.
|
|
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
|
+
import { BrowserToolbar } from '@/client/components/workspace/browser-toolbar/index';
|
|
25
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
26
|
+
|
|
27
|
+
let container: HTMLElement;
|
|
28
|
+
/** Width the bar reports, and the width stubbed for each trailing cluster. */
|
|
29
|
+
let barWidth = 0;
|
|
30
|
+
let clusterWidths: number[] = [];
|
|
31
|
+
|
|
32
|
+
let originalRect: typeof Element.prototype.getBoundingClientRect;
|
|
33
|
+
let originalClientWidth: PropertyDescriptor | undefined;
|
|
34
|
+
|
|
35
|
+
function rectOf(width: number): DOMRect {
|
|
36
|
+
return { width, height: 0, top: 0, left: 0, right: width, bottom: 0, x: 0, y: 0, toJSON: () => ({}) } as DOMRect;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
beforeAll(() => {
|
|
40
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
41
|
+
originalRect = Element.prototype.getBoundingClientRect;
|
|
42
|
+
originalClientWidth = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'clientWidth');
|
|
43
|
+
Element.prototype.getBoundingClientRect = function (this: Element) {
|
|
44
|
+
const el = this as HTMLElement;
|
|
45
|
+
if (el.hasAttribute?.('data-toolbar-cluster')) {
|
|
46
|
+
const siblings = [...(el.parentElement?.querySelectorAll('[data-toolbar-cluster]') ?? [])];
|
|
47
|
+
return rectOf(clusterWidths[siblings.indexOf(el)] ?? 0);
|
|
48
|
+
}
|
|
49
|
+
return originalRect.call(this);
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(HTMLElement.prototype, 'clientWidth', {
|
|
52
|
+
configurable: true,
|
|
53
|
+
get(this: HTMLElement) {
|
|
54
|
+
if (this.hasAttribute?.('data-browser-toolbar')) return barWidth;
|
|
55
|
+
return originalClientWidth?.get?.call(this) ?? 0;
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
afterEach(() => {
|
|
61
|
+
if (container) {
|
|
62
|
+
render(null, container);
|
|
63
|
+
container.remove();
|
|
64
|
+
}
|
|
65
|
+
barWidth = 0;
|
|
66
|
+
clusterWidths = [];
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
afterAll(() => {
|
|
70
|
+
Element.prototype.getBoundingClientRect = originalRect;
|
|
71
|
+
if (originalClientWidth) Object.defineProperty(HTMLElement.prototype, 'clientWidth', originalClientWidth);
|
|
72
|
+
restoreDomGlobals();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/** The agent panel's bar in miniature: no viewport cluster, no annotation. */
|
|
76
|
+
async function mount(width: number, widths: number[], onSelect: string[] = []): Promise<void> {
|
|
77
|
+
barWidth = width;
|
|
78
|
+
clusterWidths = widths;
|
|
79
|
+
container = document.createElement('div');
|
|
80
|
+
document.body.appendChild(container);
|
|
81
|
+
await act(async () => {
|
|
82
|
+
render(
|
|
83
|
+
h(
|
|
84
|
+
BrowserToolbar,
|
|
85
|
+
{
|
|
86
|
+
url: 'https://example.com',
|
|
87
|
+
statusDotClass: 'bg-success',
|
|
88
|
+
statusLabel: 'Live',
|
|
89
|
+
zoomLevel: 100,
|
|
90
|
+
onZoomIn: () => onSelect.push('zoom-in'),
|
|
91
|
+
onZoomOut: () => {},
|
|
92
|
+
onResetZoom: () => {},
|
|
93
|
+
onIncludeInChat: () => onSelect.push('include'),
|
|
94
|
+
onOpenExternal: () => onSelect.push('external'),
|
|
95
|
+
onReconnect: () => onSelect.push('reconnect'),
|
|
96
|
+
openExternalLabel: 'Buka di jendela baru',
|
|
97
|
+
openExternalTitle: 'Open in new window',
|
|
98
|
+
children: h('input', { 'aria-label': 'Read-only URL', value: 'https://example.com' }),
|
|
99
|
+
},
|
|
100
|
+
),
|
|
101
|
+
container,
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
// The layout effects commit their measurements in a second pass.
|
|
105
|
+
await act(async () => {});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const addressField = () => container.querySelector<HTMLElement>('[aria-label="Read-only URL"]');
|
|
109
|
+
const rowButtons = () =>
|
|
110
|
+
[...(container.firstElementChild as HTMLElement).querySelectorAll<HTMLButtonElement>('button')];
|
|
111
|
+
const trigger = () => rowButtons().find((button) => button.getAttribute('aria-label') === 'More actions');
|
|
112
|
+
|
|
113
|
+
async function openMenu(): Promise<void> {
|
|
114
|
+
const button = trigger();
|
|
115
|
+
if (!button) throw new Error('no overflow trigger rendered');
|
|
116
|
+
await act(async () => {
|
|
117
|
+
button.dispatchEvent(new window.MouseEvent('click', { bubbles: true }) as never);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function menuItems(): HTMLElement[] {
|
|
122
|
+
return [...document.querySelectorAll<HTMLElement>('[role="menuitem"]')];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
describe('BrowserToolbar overflow', () => {
|
|
126
|
+
test('a wide bar draws every control and no `⋯`', async () => {
|
|
127
|
+
await mount(900, [60, 40, 30, 30, 30]);
|
|
128
|
+
expect(addressField()).not.toBeNull();
|
|
129
|
+
expect(trigger()).toBeUndefined();
|
|
130
|
+
expect(rowButtons().length).toBe(7);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('a bar too narrow for any control keeps the address field and offers them in `⋯`', async () => {
|
|
134
|
+
await mount(220, [60, 40, 30, 30, 30]);
|
|
135
|
+
// The point of the whole change: the address field survives at every width.
|
|
136
|
+
expect(addressField()).not.toBeNull();
|
|
137
|
+
expect(trigger()).not.toBeUndefined();
|
|
138
|
+
await openMenu();
|
|
139
|
+
const labels = menuItems().map((item) => item.textContent?.trim());
|
|
140
|
+
expect(labels).toContain('Include this page in the chat draft');
|
|
141
|
+
expect(labels).toContain('Copy URL');
|
|
142
|
+
expect(labels).toContain('Buka di jendela baru');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('a mid-width bar keeps the leading controls and buries only the tail', async () => {
|
|
146
|
+
await mount(420, [60, 40, 30, 30, 30]);
|
|
147
|
+
expect(addressField()).not.toBeNull();
|
|
148
|
+
expect(trigger()).not.toBeUndefined();
|
|
149
|
+
await openMenu();
|
|
150
|
+
const labels = menuItems().map((item) => item.textContent?.trim());
|
|
151
|
+
// Zoom and include still fit; the tail did not.
|
|
152
|
+
expect(labels).not.toContain('Include this page in the chat draft');
|
|
153
|
+
expect(labels).toContain('Buka di jendela baru');
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test('a `⋯` row runs the action the buried button would', async () => {
|
|
157
|
+
const ran: string[] = [];
|
|
158
|
+
await mount(220, [60, 40, 30, 30, 30], ran);
|
|
159
|
+
await openMenu();
|
|
160
|
+
const item = menuItems().find((row) => row.textContent?.trim() === 'Buka di jendela baru');
|
|
161
|
+
if (!item) throw new Error('the open-external row is missing from the menu');
|
|
162
|
+
await act(async () => {
|
|
163
|
+
item.dispatchEvent(new window.MouseEvent('click', { bubbles: true }) as never);
|
|
164
|
+
});
|
|
165
|
+
expect(ran).toEqual(['external']);
|
|
166
|
+
});
|
|
167
|
+
});
|
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import { useState } from 'preact/hooks';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useLayoutEffect, useRef, useState } from 'preact/hooks';
|
|
2
|
+
import { ToolbarRow } from '@/client/components/common/toolbar-row';
|
|
3
|
+
import { buildBrowserClusters } from '@/client/components/workspace/browser-toolbar/clusters';
|
|
4
|
+
import type { BrowserToolbarAnnotate } from '@/client/components/workspace/browser-toolbar/clusters';
|
|
5
5
|
import type { ComponentChildren } from 'preact';
|
|
6
6
|
import type { ViewportMode } from '@/shared/types';
|
|
7
7
|
|
|
8
|
-
export
|
|
9
|
-
'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';
|
|
8
|
+
export type { BrowserToolbarAnnotate };
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
/** Width the status cluster is allowed at most; it shrinks away first. */
|
|
11
|
+
const STATUS_MAX_PX = 108;
|
|
12
|
+
/** Below this bar width the status label is dropped and only its dot stays. */
|
|
13
|
+
const STATUS_LABEL_MIN_BAR_PX = 280;
|
|
14
|
+
/** The status dot plus its gap. */
|
|
15
|
+
const STATUS_DOT_PX = 18;
|
|
16
|
+
/**
|
|
17
|
+
* Width the address slot keeps before the trailing row gives anything up. The
|
|
18
|
+
* user panel's slot also carries its Back/Forward/Reload cluster (~76px), so
|
|
19
|
+
* this is what is left for the field itself once that cluster is drawn.
|
|
20
|
+
*/
|
|
21
|
+
const ADDRESS_MIN_PX = 140;
|
|
22
|
+
/** The bar's own `px-2.5` (20px) plus both `gap-x-2` (2 × 8px). */
|
|
23
|
+
const BAR_CHROME_PX = 36;
|
|
17
24
|
|
|
18
25
|
export interface BrowserToolbarProps {
|
|
19
26
|
url: string;
|
|
@@ -43,8 +50,8 @@ export interface BrowserToolbarProps {
|
|
|
43
50
|
* page by asking the agent instead of drawing on a JPEG.
|
|
44
51
|
*/
|
|
45
52
|
annotate?: BrowserToolbarAnnotate;
|
|
46
|
-
/**
|
|
47
|
-
|
|
53
|
+
/** Agent panel only: re-attach the live view. Drawn inside the trailing row. */
|
|
54
|
+
onReconnect?: () => void;
|
|
48
55
|
/** Open-external button label/title, differing between the two panels. */
|
|
49
56
|
openExternalLabel: string;
|
|
50
57
|
openExternalTitle: string;
|
|
@@ -53,12 +60,21 @@ export interface BrowserToolbarProps {
|
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
/**
|
|
56
|
-
* Shared address bar for both browser panels.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
63
|
+
* Shared address bar for both browser panels.
|
|
64
|
+
*
|
|
65
|
+
* THREE regions, and only the first and third give ground:
|
|
66
|
+
*
|
|
67
|
+
* 1. The status cluster, capped at {@link STATUS_MAX_PX} (and shrinking below
|
|
68
|
+
* that on a very narrow bar) so it can never crowd out the address slot.
|
|
69
|
+
* 2. The middle slot — the address field — `flex-1 min-w-0`. It is drawn at
|
|
70
|
+
* EVERY width and is never a `⋯` candidate: an address bar behind a menu is
|
|
71
|
+
* the one control this toolbar cannot do without. At the narrowest the panel
|
|
72
|
+
* allows, the field's text truncates but the field itself stays.
|
|
73
|
+
* 3. The trailing controls, in a `ToolbarRow`, whose overflow rule moves what
|
|
74
|
+
* does not fit into `⋯` and keeps it one click away. The row is given the
|
|
75
|
+
* bar's remaining width as its budget, so as the panel is dragged narrower
|
|
76
|
+
* the controls surrender space — right-to-left in row order — and the
|
|
77
|
+
* address slot keeps {@link ADDRESS_MIN_PX} until they are all in the menu.
|
|
62
78
|
*/
|
|
63
79
|
export function BrowserToolbar({
|
|
64
80
|
url,
|
|
@@ -74,13 +90,15 @@ export function BrowserToolbar({
|
|
|
74
90
|
annotate,
|
|
75
91
|
onIncludeInChat,
|
|
76
92
|
onOpenExternal,
|
|
77
|
-
|
|
93
|
+
onReconnect,
|
|
78
94
|
openExternalLabel,
|
|
79
95
|
openExternalTitle,
|
|
80
96
|
children,
|
|
81
97
|
}: BrowserToolbarProps) {
|
|
82
98
|
const [copied, setCopied] = useState(false);
|
|
83
99
|
const [included, setIncluded] = useState(false);
|
|
100
|
+
const barRef = useRef<HTMLDivElement>(null);
|
|
101
|
+
const [barWidth, setBarWidth] = useState(0);
|
|
84
102
|
|
|
85
103
|
const handleCopy = () => {
|
|
86
104
|
if (!url) return;
|
|
@@ -99,92 +117,73 @@ export function BrowserToolbar({
|
|
|
99
117
|
setTimeout(() => setIncluded(false), 2500);
|
|
100
118
|
};
|
|
101
119
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
const clusters = buildBrowserClusters({
|
|
121
|
+
url,
|
|
122
|
+
zoomLevel,
|
|
123
|
+
copied,
|
|
124
|
+
included,
|
|
125
|
+
viewportMode,
|
|
126
|
+
onChangeViewport,
|
|
127
|
+
annotate,
|
|
128
|
+
onReconnect,
|
|
129
|
+
onIncludeInChat: handleInclude,
|
|
130
|
+
onCopy: handleCopy,
|
|
131
|
+
onOpenExternal,
|
|
132
|
+
onZoomIn,
|
|
133
|
+
onZoomOut,
|
|
134
|
+
onResetZoom,
|
|
135
|
+
onSetZoom,
|
|
136
|
+
openExternalLabel,
|
|
137
|
+
openExternalTitle,
|
|
138
|
+
});
|
|
108
139
|
|
|
109
|
-
|
|
140
|
+
useLayoutEffect(() => {
|
|
141
|
+
const bar = barRef.current;
|
|
142
|
+
if (!bar) return;
|
|
143
|
+
setBarWidth(bar.clientWidth);
|
|
144
|
+
});
|
|
110
145
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
146
|
+
// The bar's width changes on a window resize, a panel drag and a layout mode
|
|
147
|
+
// switch — none of which are `window` events.
|
|
148
|
+
useLayoutEffect(() => {
|
|
149
|
+
const bar = barRef.current;
|
|
150
|
+
if (!bar || typeof ResizeObserver === 'undefined') return;
|
|
151
|
+
const observer = new ResizeObserver(() => setBarWidth(bar.clientWidth));
|
|
152
|
+
observer.observe(bar);
|
|
153
|
+
return () => observer.disconnect();
|
|
154
|
+
}, []);
|
|
120
155
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
156
|
+
const showStatusLabel = barWidth === 0 || barWidth >= STATUS_LABEL_MIN_BAR_PX;
|
|
157
|
+
const statusMax = showStatusLabel
|
|
158
|
+
? barWidth > 0
|
|
159
|
+
? Math.min(STATUS_MAX_PX, barWidth * 0.25)
|
|
160
|
+
: STATUS_MAX_PX
|
|
161
|
+
: STATUS_DOT_PX;
|
|
162
|
+
const tailBudget =
|
|
163
|
+
barWidth > 0 ? Math.max(0, barWidth - statusMax - ADDRESS_MIN_PX - BAR_CHROME_PX) : undefined;
|
|
127
164
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
onClick={annotate.onToggle}
|
|
143
|
-
disabled={!url}
|
|
144
|
-
aria-label="Page annotation mode"
|
|
145
|
-
aria-pressed={annotate.active}
|
|
146
|
-
title={
|
|
147
|
-
annotate.active
|
|
148
|
-
? 'Tutup mode anotasi'
|
|
149
|
-
: annotate.count > 0
|
|
150
|
-
? `Anotasi (${annotate.count}) — buka lagi`
|
|
151
|
-
: 'Mark a part of the page, then send it to the chat'
|
|
152
|
-
}
|
|
153
|
-
className={`${ICON_BUTTON} relative ${annotate.active ? 'bg-ink/10 text-ink' : ''}`}
|
|
154
|
-
>
|
|
155
|
-
<SquarePen size={14} />
|
|
156
|
-
{annotate.count > 0 && (
|
|
157
|
-
<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">
|
|
158
|
-
{annotate.count}
|
|
159
|
-
</span>
|
|
160
|
-
)}
|
|
161
|
-
</button>
|
|
165
|
+
return (
|
|
166
|
+
<div
|
|
167
|
+
ref={barRef}
|
|
168
|
+
data-browser-toolbar=""
|
|
169
|
+
className="h-10 px-2.5 border-b border-ink/10 bg-paper flex items-center gap-x-2 flex-shrink-0 select-none"
|
|
170
|
+
>
|
|
171
|
+
<div
|
|
172
|
+
className="flex items-center space-x-1.5 flex-shrink-0 min-w-0"
|
|
173
|
+
style={{ maxWidth: `${statusMax}px` }}
|
|
174
|
+
title={statusLabel}
|
|
175
|
+
>
|
|
176
|
+
<span className={`w-1.5 h-1.5 rounded-full flex-shrink-0 ${statusDotClass}`} />
|
|
177
|
+
{showStatusLabel && (
|
|
178
|
+
<span className="text-[10px] font-mono uppercase tracking-wide text-ink/60 truncate">{statusLabel}</span>
|
|
162
179
|
)}
|
|
180
|
+
</div>
|
|
163
181
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
disabled={!url}
|
|
168
|
-
aria-label="Salin URL"
|
|
169
|
-
title={copied ? 'Copied URL!' : 'Copy URL'}
|
|
170
|
-
className={ICON_BUTTON}
|
|
171
|
-
>
|
|
172
|
-
{copied ? <Check size={14} className="text-success" /> : <Copy size={14} />}
|
|
173
|
-
</button>
|
|
174
|
-
|
|
175
|
-
{trailingControls}
|
|
182
|
+
{/* Never a cluster: `flex-1 min-w-0` in the bar means it is drawn at every
|
|
183
|
+
width and takes the space the trailing controls give up. */}
|
|
184
|
+
<div className="flex flex-1 min-w-0 items-center">{children}</div>
|
|
176
185
|
|
|
177
|
-
|
|
178
|
-
type="button"
|
|
179
|
-
onClick={onOpenExternal}
|
|
180
|
-
disabled={!url}
|
|
181
|
-
aria-label={openExternalLabel}
|
|
182
|
-
title={openExternalTitle}
|
|
183
|
-
className={ICON_BUTTON}
|
|
184
|
-
>
|
|
185
|
-
<ExternalLink size={14} />
|
|
186
|
-
</button>
|
|
187
|
-
</div>
|
|
186
|
+
<ToolbarRow clusters={clusters} available={tailBudget} />
|
|
188
187
|
</div>
|
|
189
188
|
);
|
|
190
189
|
}
|
|
@@ -31,6 +31,8 @@ export interface BtwMessagesProps {
|
|
|
31
31
|
modelName?: string;
|
|
32
32
|
/** Thinking level the side child runs at, for the run footer. */
|
|
33
33
|
thinkingLevel?: string;
|
|
34
|
+
/** Harness the side child runs on. `omp-rpc`: BTW is omp's own side child. */
|
|
35
|
+
harness?: string;
|
|
34
36
|
isMobile?: boolean;
|
|
35
37
|
}
|
|
36
38
|
|
|
@@ -86,7 +88,7 @@ function turnRows(topic: BtwTopic, turn: BtwTurn): ChatMessageData[] {
|
|
|
86
88
|
];
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
export function BtwMessages({ topic, liveMessages, error, provider, providerNames, modelName, thinkingLevel, isMobile = false }: BtwMessagesProps) {
|
|
91
|
+
export function BtwMessages({ topic, liveMessages, error, provider, providerNames, modelName, thinkingLevel, harness, isMobile = false }: BtwMessagesProps) {
|
|
90
92
|
const scrollRef = useRef<HTMLDivElement>(null);
|
|
91
93
|
const turns = topic?.turns ?? [];
|
|
92
94
|
|
|
@@ -137,6 +139,7 @@ export function BtwMessages({ topic, liveMessages, error, provider, providerName
|
|
|
137
139
|
providerNames={providerNames}
|
|
138
140
|
modelName={modelName}
|
|
139
141
|
thinkingLevel={thinkingLevel}
|
|
142
|
+
{...(harness ? { harness } : {})}
|
|
140
143
|
isMobile={isMobile}
|
|
141
144
|
userActions={false}
|
|
142
145
|
/>
|
|
@@ -115,6 +115,7 @@ export function BtwForm({
|
|
|
115
115
|
providerNames={providerNames}
|
|
116
116
|
modelName={mode.activeTopic?.model?.name ?? modelName}
|
|
117
117
|
thinkingLevel={mode.activeTopic?.thinkingLevel}
|
|
118
|
+
harness="omp-rpc"
|
|
118
119
|
isMobile={variant === 'mobile'}
|
|
119
120
|
/>
|
|
120
121
|
|
|
@@ -128,6 +129,7 @@ export function BtwForm({
|
|
|
128
129
|
modelName={mode.activeTopic?.model?.name ?? modelName}
|
|
129
130
|
provider={mode.activeTopic?.model?.provider ?? provider}
|
|
130
131
|
providerNames={providerNames}
|
|
132
|
+
harness="omp-rpc"
|
|
131
133
|
/>
|
|
132
134
|
)}
|
|
133
135
|
</div>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState } from 'preact/hooks';
|
|
2
2
|
import type { ReactNode } from 'preact/compat';
|
|
3
|
-
import {
|
|
3
|
+
import { Brain, Clock3, Coins, Hourglass, MessageSquarePlus, MoreHorizontal, RotateCcw, X } from 'lucide-preact';
|
|
4
4
|
import { CopyButton } from '@/client/components/common/CopyButton';
|
|
5
|
+
import { RunMark } from '@/client/components/workspace/chat-timeline/RunMark';
|
|
5
6
|
import { PluginMessageActions } from '@/client/components/workspace/chat-timeline/PluginMessageActions';
|
|
6
7
|
import { formatDuration } from '@/shared/lib/chat/duration';
|
|
7
8
|
import { providerLabel } from '@/shared/lib/models/provider/label';
|
|
@@ -22,6 +23,12 @@ interface AiMessageFooterProps {
|
|
|
22
23
|
};
|
|
23
24
|
/** Session thinking level (last `thinking_level_change`) shown next to the model. */
|
|
24
25
|
thinkingLevel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The harness that produced this answer (`omp-rpc`, `opencode`, `claude`, …).
|
|
28
|
+
* The badge names the agent; without it the footer claimed omp for every
|
|
29
|
+
* harness, which is the wrong answer to "who wrote this".
|
|
30
|
+
*/
|
|
31
|
+
harness?: string;
|
|
25
32
|
content: string;
|
|
26
33
|
msgId: string;
|
|
27
34
|
onRetry?: (msgId: string) => void;
|
|
@@ -46,6 +53,7 @@ export function AiMessageFooter({
|
|
|
46
53
|
content,
|
|
47
54
|
msgId,
|
|
48
55
|
thinkingLevel,
|
|
56
|
+
harness,
|
|
49
57
|
onRetry,
|
|
50
58
|
onNewChat,
|
|
51
59
|
isMobile = false,
|
|
@@ -120,9 +128,7 @@ export function AiMessageFooter({
|
|
|
120
128
|
<>
|
|
121
129
|
<div className="w-full flex items-center gap-2 text-[11px] text-ink/60 px-1 pt-0.5 font-mono min-w-0 animate-in fade-in duration-200">
|
|
122
130
|
<div className="flex items-center gap-1.5 min-w-0 truncate" title={titleLabel}>
|
|
123
|
-
<
|
|
124
|
-
<Bot size={10} />
|
|
125
|
-
</div>
|
|
131
|
+
<RunMark harness={harness} size={16} />
|
|
126
132
|
{providerText && <span className="shrink-0 truncate">{providerText}</span>}
|
|
127
133
|
{providerText && currentModel && <span className="text-ink/35 shrink-0">•</span>}
|
|
128
134
|
{currentModel && <span className="font-semibold text-ink min-w-0 truncate">{currentModel}</span>}
|
|
@@ -238,9 +244,7 @@ export function AiMessageFooter({
|
|
|
238
244
|
className="flex items-center space-x-1.5 border-r border-ink/15 pr-2.5 min-w-0 shrink overflow-hidden"
|
|
239
245
|
title={titleLabel}
|
|
240
246
|
>
|
|
241
|
-
<
|
|
242
|
-
<Bot size={10} />
|
|
243
|
-
</div>
|
|
247
|
+
<RunMark harness={harness} size={16} />
|
|
244
248
|
{metadataItems.map(({ key, content, className, title }, index) => (
|
|
245
249
|
<span key={key} className={`inline-flex items-center text-ink/60 ${key === 'model' ? 'min-w-0 shrink' : 'shrink-0'} whitespace-nowrap ${className ?? ''}`} title={title}>
|
|
246
250
|
{index > 0 && <span className="text-ink/40 mr-1.5">•</span>}
|
|
@@ -34,8 +34,10 @@ export interface ChatOverlaysProps {
|
|
|
34
34
|
|
|
35
35
|
newChatInitialContent: string | null;
|
|
36
36
|
newChatInitialAttachments: Attachment[];
|
|
37
|
+
/** The source chat's harness, carried onto the new chat's spawn. */
|
|
38
|
+
newChatHarness?: string;
|
|
37
39
|
onCloseNewChat: () => void;
|
|
38
|
-
onSendNewChat: (content: string, attachments: Attachment[]) => void;
|
|
40
|
+
onSendNewChat: (content: string, attachments: Attachment[], harness?: string) => void;
|
|
39
41
|
appSettings: Record<string, unknown>;
|
|
40
42
|
accessMode: ApprovalMode;
|
|
41
43
|
onAccessModeChange: (mode: ApprovalMode) => void;
|
|
@@ -56,6 +58,7 @@ export function ChatOverlays({
|
|
|
56
58
|
isOmpSession,
|
|
57
59
|
newChatInitialContent,
|
|
58
60
|
newChatInitialAttachments,
|
|
61
|
+
newChatHarness,
|
|
59
62
|
onCloseNewChat,
|
|
60
63
|
onSendNewChat,
|
|
61
64
|
appSettings,
|
|
@@ -84,7 +87,7 @@ export function ChatOverlays({
|
|
|
84
87
|
initialContent={newChatInitialContent}
|
|
85
88
|
initialAttachments={newChatInitialAttachments}
|
|
86
89
|
onClose={onCloseNewChat}
|
|
87
|
-
onSend={onSendNewChat}
|
|
90
|
+
onSend={(content, attachments) => onSendNewChat(content, attachments, newChatHarness)}
|
|
88
91
|
appSettings={appSettings}
|
|
89
92
|
accessMode={accessMode}
|
|
90
93
|
onAccessModeChange={onAccessModeChange}
|
|
@@ -64,6 +64,12 @@ interface ComposerDockProps {
|
|
|
64
64
|
* only ever changes the card's frame — never which controls exist.
|
|
65
65
|
*/
|
|
66
66
|
hero?: boolean;
|
|
67
|
+
/** Which harness runs this chat. Absent before the first spawn. */
|
|
68
|
+
harness?: string;
|
|
69
|
+
/** False once the chat has a transcript: the harness tab strip explains that
|
|
70
|
+
* switching needs a new chat rather than changing the transport silently. */
|
|
71
|
+
harnessEditable?: boolean;
|
|
72
|
+
onSelectHarness?: (harness: string) => void;
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
/**
|
|
@@ -105,6 +111,9 @@ export function ComposerDock({
|
|
|
105
111
|
variant,
|
|
106
112
|
shrinkWhileReading = false,
|
|
107
113
|
hero = false,
|
|
114
|
+
harness,
|
|
115
|
+
harnessEditable = true,
|
|
116
|
+
onSelectHarness,
|
|
108
117
|
}: ComposerDockProps) {
|
|
109
118
|
// Side questions take over the composer entirely: the chat's own input is
|
|
110
119
|
// hidden while the form is open, so a stray Enter cannot send to the wrong
|
|
@@ -129,6 +138,7 @@ export function ComposerDock({
|
|
|
129
138
|
generatingVerb={generatingVerb}
|
|
130
139
|
provider={provider}
|
|
131
140
|
providerNames={providerNames}
|
|
141
|
+
{...(harness ? { harness } : {})}
|
|
132
142
|
/>
|
|
133
143
|
)}
|
|
134
144
|
<QueueList
|
|
@@ -171,6 +181,9 @@ export function ComposerDock({
|
|
|
171
181
|
deferredComposerPickRef={deferredComposerPickRef}
|
|
172
182
|
sessionModel={sessionModel}
|
|
173
183
|
sessionThinkingLevel={sessionThinkingLevel}
|
|
184
|
+
harness={harness}
|
|
185
|
+
harnessEditable={harnessEditable}
|
|
186
|
+
onSelectHarness={onSelectHarness}
|
|
174
187
|
variant={variant}
|
|
175
188
|
expandable
|
|
176
189
|
hero={hero}
|
|
@@ -82,6 +82,11 @@ interface EmptyWorkspacePromptProps {
|
|
|
82
82
|
* or cancelled, because there is no session to send a second prompt to. */
|
|
83
83
|
heldWait?: { title: string | null } | null;
|
|
84
84
|
onCancelWait?: () => void;
|
|
85
|
+
/** The harness this chat will spawn on, and the pick that writes it. */
|
|
86
|
+
harness?: string;
|
|
87
|
+
/** False once the prompt was dispatched: the harness already rode the spawn. */
|
|
88
|
+
harnessEditable?: boolean;
|
|
89
|
+
onSelectHarness?: (harness: string) => void;
|
|
85
90
|
}
|
|
86
91
|
|
|
87
92
|
export function EmptyWorkspacePrompt({
|
|
@@ -125,6 +130,9 @@ export function EmptyWorkspacePrompt({
|
|
|
125
130
|
onWaitingForChange,
|
|
126
131
|
heldWait = null,
|
|
127
132
|
onCancelWait,
|
|
133
|
+
harness,
|
|
134
|
+
harnessEditable = true,
|
|
135
|
+
onSelectHarness,
|
|
128
136
|
}: EmptyWorkspacePromptProps) {
|
|
129
137
|
const timelineRef = useRef<HTMLDivElement>(null);
|
|
130
138
|
|
|
@@ -235,6 +243,7 @@ export function EmptyWorkspacePrompt({
|
|
|
235
243
|
modelName={modelName}
|
|
236
244
|
modelNames={modelNames}
|
|
237
245
|
thinkingLevel={sessionThinkingLevel ?? undefined}
|
|
246
|
+
{...(harness ? { harness } : {})}
|
|
238
247
|
durationMs={footer.durationMs}
|
|
239
248
|
answerText={footer.answerText}
|
|
240
249
|
retryTargetId={footer.runUserId}
|
|
@@ -258,6 +267,7 @@ export function EmptyWorkspacePrompt({
|
|
|
258
267
|
generatingVerb={generatingVerb}
|
|
259
268
|
provider={provider}
|
|
260
269
|
providerNames={providerNames}
|
|
270
|
+
{...(harness ? { harness } : {})}
|
|
261
271
|
/>
|
|
262
272
|
)}
|
|
263
273
|
{/* A held prompt owns this chat until it is released: there is no
|
|
@@ -301,6 +311,9 @@ export function EmptyWorkspacePrompt({
|
|
|
301
311
|
modes={modes}
|
|
302
312
|
composerModelRef={composerModelRef}
|
|
303
313
|
deferredComposerPickRef={deferredComposerPickRef}
|
|
314
|
+
{...(harness ? { harness } : {})}
|
|
315
|
+
harnessEditable={harnessEditable}
|
|
316
|
+
{...(onSelectHarness ? { onSelectHarness } : {})}
|
|
304
317
|
variant={variant}
|
|
305
318
|
expandable
|
|
306
319
|
// A brand-new chat has no turns: the `stage` composer style draws its
|