@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,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which agents this build advertises, and their launch lines.
|
|
8
|
+
*
|
|
9
|
+
* Two decisions are pinned here because both are easy to undo by accident:
|
|
10
|
+
*
|
|
11
|
+
* - **`gemini` is GONE, `antigravity` replaced it.** Google deprecated Gemini
|
|
12
|
+
* CLI in favour of Antigravity CLI, and the two are one product line's
|
|
13
|
+
* ancestor and successor — listing both would offer a dead agent beside its
|
|
14
|
+
* replacement and split the same Google account across two tabs.
|
|
15
|
+
* - **`command-code` launches `cmd acp`.** `cmd` is the bin npm installs (the
|
|
16
|
+
* package also ships `cmdc` for Windows and the long `command-code` /
|
|
17
|
+
* `commandcode` aliases), and the docs' own editor setup names
|
|
18
|
+
* `{"command":"cmd","args":["acp"]}`.
|
|
19
|
+
*
|
|
20
|
+
* Every harness must also resolve BRAND ART: a catalog entry whose glyph key has
|
|
21
|
+
* no mark draws an empty box in the sidebar and the tab strip, which is the
|
|
22
|
+
* failure `harness-glyph.test.ts` guards from the other side.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { describe, expect, test } from 'bun:test';
|
|
26
|
+
import { HARNESS_CATALOG, HARNESS_IDS, harnessDescriptor } from '@/shared/lib/harness/catalog';
|
|
27
|
+
import { HARNESS_LAUNCH } from '@/server/lib/harness/launch-table';
|
|
28
|
+
|
|
29
|
+
describe('harness catalog after the Gemini retirement', () => {
|
|
30
|
+
test('gemini is not a harness this build offers', () => {
|
|
31
|
+
expect(HARNESS_IDS as readonly string[]).not.toContain('gemini');
|
|
32
|
+
expect(harnessDescriptor('gemini')).toBeUndefined();
|
|
33
|
+
// Indexed, not dotted: `gemini` is not a `HarnessId` any more, which is the
|
|
34
|
+
// point of this case — a dotted read would not even compile.
|
|
35
|
+
expect((HARNESS_LAUNCH as Record<string, unknown>).gemini).toBeUndefined();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('antigravity replaced it, over its own ACP server', () => {
|
|
39
|
+
const descriptor = harnessDescriptor('antigravity');
|
|
40
|
+
expect(descriptor?.transport).toBe('acp');
|
|
41
|
+
expect(descriptor?.glyph).toBe('antigravity');
|
|
42
|
+
// The vendor's documented line, verbatim.
|
|
43
|
+
expect(HARNESS_LAUNCH.antigravity?.command).toEqual(['agy', 'acp']);
|
|
44
|
+
// Replacing one with the other means the slot count did not grow a Google
|
|
45
|
+
// agent: exactly one Google adapter is listed.
|
|
46
|
+
const google = HARNESS_IDS.filter((id) => /gemini|antigravity/.test(id));
|
|
47
|
+
expect(google).toEqual(['antigravity']);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('command-code is listed and launches `cmd acp`', () => {
|
|
51
|
+
const descriptor = harnessDescriptor('command-code');
|
|
52
|
+
expect(descriptor?.transport).toBe('acp');
|
|
53
|
+
expect(descriptor?.glyph).toBe('commandcode');
|
|
54
|
+
expect(HARNESS_LAUNCH['command-code']?.command).toEqual(['cmd', 'acp']);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('zcode is listed and launches the ACP bridge, not a `zcode acp` verb', () => {
|
|
58
|
+
// The vendor CLI has no ACP subcommand: the ACP surface is the bridge that
|
|
59
|
+
// spawns `zcode app-server --stdio`. A launch line written as
|
|
60
|
+
// `['zcode', 'acp']` would look symmetrical and fail at spawn.
|
|
61
|
+
const descriptor = harnessDescriptor('zcode');
|
|
62
|
+
expect(descriptor?.transport).toBe('acp');
|
|
63
|
+
expect(descriptor?.glyph).toBe('zcode');
|
|
64
|
+
const command = HARNESS_LAUNCH.zcode?.command ?? [];
|
|
65
|
+
expect(command[0]).toBe('npx');
|
|
66
|
+
expect(command).toContain('zcode-acp-server@0.82.3');
|
|
67
|
+
expect(command).not.toEqual(['zcode', 'acp']);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('every catalog entry has a launch line or is the built-in transport', () => {
|
|
71
|
+
// The built-in transport has no agent to launch by definition; everything
|
|
72
|
+
// else without a line would probe to "no launch command is configured",
|
|
73
|
+
// which is what a missing table row looks like at runtime.
|
|
74
|
+
for (const id of HARNESS_IDS) {
|
|
75
|
+
if (HARNESS_CATALOG[id].builtIn) {
|
|
76
|
+
expect(HARNESS_LAUNCH[id]).toBeUndefined();
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
expect(HARNESS_LAUNCH[id], `no launch line for ${id}`).toBeDefined();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('no launch line survives for a harness the catalog dropped', () => {
|
|
84
|
+
for (const id of Object.keys(HARNESS_LAUNCH)) {
|
|
85
|
+
expect(HARNESS_IDS as readonly string[]).toContain(id);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which coding-agent harness runs a session.
|
|
8
|
+
*
|
|
9
|
+
* This is a SPAWN-time property, not a per-row cosmetic: it decides which
|
|
10
|
+
* transport carries the frames, which capabilities exist (todos, usage,
|
|
11
|
+
* subagents), and which launch command is spawned. That is why it is an ID in
|
|
12
|
+
* the shared graph rather than a display string — the sidebar badge, the
|
|
13
|
+
* capability gate and the server driver all read the same value.
|
|
14
|
+
*
|
|
15
|
+
* `omp-rpc` and `omp-acp` are two entries for the SAME product: omp over its
|
|
16
|
+
* native RPC mode (the existing path, only one with todos/subagents/host tools)
|
|
17
|
+
* and omp over Agent Client Protocol (the adapter every other harness uses).
|
|
18
|
+
* A user picking between them is picking a surface, not a different agent, so
|
|
19
|
+
* they share a glyph and are told apart by name.
|
|
20
|
+
*
|
|
21
|
+
* There is ONE `opencode` entry. The `opencode2` preview used to be a separate
|
|
22
|
+
* binary with its own beta line; it is now a 47-byte shim that `exec`s
|
|
23
|
+
* `opencode` — measured on this machine: both report `v2.2.5`, and the shim's
|
|
24
|
+
* own body is `exec "$(dirname "$0")/opencode" "$@"`. A second catalog entry for
|
|
25
|
+
* the same binary would offer two tabs that run one program.
|
|
26
|
+
*/
|
|
27
|
+
export type HarnessId =
|
|
28
|
+
| 'omp-rpc'
|
|
29
|
+
| 'omp-acp'
|
|
30
|
+
| 'claude'
|
|
31
|
+
| 'codex'
|
|
32
|
+
| 'opencode'
|
|
33
|
+
/** Command Code's own agent (`cmd acp`). */
|
|
34
|
+
| 'command-code'
|
|
35
|
+
| 'dsh'
|
|
36
|
+
/** Google's agent over its own ACP server (`agy acp`). Replaced `gemini`:
|
|
37
|
+
* Gemini CLI is deprecated in favour of Antigravity CLI, and the two are the
|
|
38
|
+
* same product line's successor/ancestor, not two agents worth listing. */
|
|
39
|
+
| 'antigravity'
|
|
40
|
+
| 'minimax'
|
|
41
|
+
| 'pi'
|
|
42
|
+
| 'qwen'
|
|
43
|
+
| 'kimi'
|
|
44
|
+
| 'cursor'
|
|
45
|
+
/** Z.ai's own agent, over the community ACP bridge that drives its headless
|
|
46
|
+
* `zcode app-server`. The CLI ships no native ACP server (measured against
|
|
47
|
+
* the 3.17.x source: no `acp` subcommand), so the launch line names that
|
|
48
|
+
* bridge and the bridge finds the CLI by itself. */
|
|
49
|
+
| 'zcode';
|
|
50
|
+
|
|
51
|
+
/** Every harness this build knows how to launch or display. */
|
|
52
|
+
export const HARNESS_IDS: readonly HarnessId[] = [
|
|
53
|
+
'omp-rpc',
|
|
54
|
+
'omp-acp',
|
|
55
|
+
'claude',
|
|
56
|
+
'codex',
|
|
57
|
+
'opencode',
|
|
58
|
+
'command-code',
|
|
59
|
+
'dsh',
|
|
60
|
+
'antigravity',
|
|
61
|
+
'minimax',
|
|
62
|
+
'pi',
|
|
63
|
+
'qwen',
|
|
64
|
+
'kimi',
|
|
65
|
+
'cursor',
|
|
66
|
+
'zcode',
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
export interface HarnessDescriptor {
|
|
70
|
+
id: HarnessId;
|
|
71
|
+
/** Name a human reads (`omp`, `deepseek-harness`). */
|
|
72
|
+
label: string;
|
|
73
|
+
/** One letter, for a row that has no room for a glyph (the sidebar's badge
|
|
74
|
+
* fallback and the tab strip). Never a substitute for the icon. */
|
|
75
|
+
initial: string;
|
|
76
|
+
transport: 'rpc' | 'acp';
|
|
77
|
+
/**
|
|
78
|
+
* Icon key in the client's harness-glyph table. Data rather than an imported
|
|
79
|
+
* component because this module is imported by the server too (it builds the
|
|
80
|
+
* sidebar payload), and `lucide-preact` belongs to the browser bundle.
|
|
81
|
+
*/
|
|
82
|
+
glyph: HarnessGlyph;
|
|
83
|
+
/**
|
|
84
|
+
* True for a transport Kabmo itself provides, which is therefore not a
|
|
85
|
+
* choice. `omp` over RPC is the default every discovered session already
|
|
86
|
+
* runs on: it cannot be installed, cannot be probed (there is no agent to
|
|
87
|
+
* spawn), and listing it under Settings → Harnesses offered a card whose
|
|
88
|
+
* "Check status" could only answer "no launch command is configured".
|
|
89
|
+
*
|
|
90
|
+
* It stays in the CATALOG because a session row must still say which
|
|
91
|
+
* transport ran it, and it stays in the composer's tab strip because that
|
|
92
|
+
* strip names the list on screen — the default included.
|
|
93
|
+
*/
|
|
94
|
+
builtIn?: true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The brand mark a harness draws, as a key into the client's glyph table.
|
|
99
|
+
*
|
|
100
|
+
* The harness's OWN logo, not a generic icon: a session row, a tab and a model
|
|
101
|
+
* row all identify which agent produced the work, and a lucide shape for
|
|
102
|
+
* "claude" is a guess where the vendor publishes a mark. Kept as a string union
|
|
103
|
+
* so a typo is a build error instead of a silently blank icon.
|
|
104
|
+
*/
|
|
105
|
+
export type HarnessGlyph =
|
|
106
|
+
| 'omp'
|
|
107
|
+
| 'claudecode'
|
|
108
|
+
| 'codex'
|
|
109
|
+
| 'commandcode'
|
|
110
|
+
| 'opencode'
|
|
111
|
+
| 'deepseek'
|
|
112
|
+
| 'pi'
|
|
113
|
+
| 'kimi'
|
|
114
|
+
| 'minimax'
|
|
115
|
+
| 'qwen'
|
|
116
|
+
| 'cursor'
|
|
117
|
+
| 'antigravity'
|
|
118
|
+
| 'zcode';
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The catalog. Order is the tab/legend order: omp's two surfaces first because
|
|
122
|
+
* they are the default, then the adapters in the order the research measured.
|
|
123
|
+
*/
|
|
124
|
+
export const HARNESS_CATALOG: Readonly<Record<HarnessId, HarnessDescriptor>> = {
|
|
125
|
+
'omp-rpc': { id: 'omp-rpc', label: 'omp', initial: 'o', transport: 'rpc', glyph: 'omp', builtIn: true },
|
|
126
|
+
'omp-acp': { id: 'omp-acp', label: 'omp (ACP)', initial: 'o', transport: 'acp', glyph: 'omp' },
|
|
127
|
+
claude: { id: 'claude', label: 'claude', initial: 'A', transport: 'acp', glyph: 'claudecode' },
|
|
128
|
+
codex: { id: 'codex', label: 'codex', initial: 'C', transport: 'acp', glyph: 'codex' },
|
|
129
|
+
opencode: { id: 'opencode', label: 'opencode', initial: 'O', transport: 'acp', glyph: 'opencode' },
|
|
130
|
+
// Command Code's own agent. `cmd` is the bin name npm installs (plus `cmdc`
|
|
131
|
+
// on Windows and the long `command-code` / `commandcode` aliases).
|
|
132
|
+
'command-code': { id: 'command-code', label: 'command-code', initial: 'C', transport: 'acp', glyph: 'commandcode' },
|
|
133
|
+
dsh: { id: 'dsh', label: 'deepseek-harness', initial: 'D', transport: 'acp', glyph: 'deepseek' },
|
|
134
|
+
antigravity: { id: 'antigravity', label: 'antigravity', initial: 'A', transport: 'acp', glyph: 'antigravity' },
|
|
135
|
+
minimax: { id: 'minimax', label: 'minimax', initial: 'M', transport: 'acp', glyph: 'minimax' },
|
|
136
|
+
pi: { id: 'pi', label: 'pi', initial: 'p', transport: 'acp', glyph: 'pi' },
|
|
137
|
+
qwen: { id: 'qwen', label: 'qwen', initial: 'Q', transport: 'acp', glyph: 'qwen' },
|
|
138
|
+
kimi: { id: 'kimi', label: 'kimi', initial: 'K', transport: 'acp', glyph: 'kimi' },
|
|
139
|
+
cursor: { id: 'cursor', label: 'cursor', initial: '⌖', transport: 'acp', glyph: 'cursor' },
|
|
140
|
+
zcode: { id: 'zcode', label: 'zcode', initial: 'Z', transport: 'acp', glyph: 'zcode' },
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The harness every omp-session-file row runs on.
|
|
145
|
+
*
|
|
146
|
+
* Kabmo's sidebar discovers sessions by scanning omp's own JSONL store, so a
|
|
147
|
+
* discovered row is by definition an omp session — and the path that resumes it
|
|
148
|
+
* is RPC. Named rather than inlined so the day a second scanner exists, the
|
|
149
|
+
* default is changed in one place.
|
|
150
|
+
*/
|
|
151
|
+
export const DEFAULT_HARNESS_ID: HarnessId = 'omp-rpc';
|
|
152
|
+
|
|
153
|
+
/** The descriptor for an id, or undefined for a value this build does not know
|
|
154
|
+
* (a newer adapter's id arriving over the wire). */
|
|
155
|
+
export function harnessDescriptor(id: string | null | undefined): HarnessDescriptor | undefined {
|
|
156
|
+
if (!id) return undefined;
|
|
157
|
+
return (HARNESS_CATALOG as Record<string, HarnessDescriptor | undefined>)[id];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The row's badge text: the label, with omp's two surfaces told apart.
|
|
162
|
+
*
|
|
163
|
+
* `omp` alone would make `omp-rpc` and `omp-acp` indistinguishable in a row
|
|
164
|
+
* that shows only one glyph — they share the glyph by design, so the word is
|
|
165
|
+
* what carries the difference.
|
|
166
|
+
*/
|
|
167
|
+
export function harnessBadgeLabel(id: string | null | undefined): string {
|
|
168
|
+
return harnessDescriptor(id)?.label ?? 'unknown harness';
|
|
169
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Configuration section, per harness.
|
|
8
|
+
*
|
|
9
|
+
* The card drew the same six fields for every agent and two of them were lies.
|
|
10
|
+
* Measured on this machine, from the probe the card itself reads:
|
|
11
|
+
*
|
|
12
|
+
* | Harness | `probe.models` | Providers |
|
|
13
|
+
* |---|---|---|
|
|
14
|
+
* | `omp-acp` | `kenari/agnes-2-5-flash:free`, … (221) | `kenari`, `kenari-jatis`, `aihub-brisnets-jatis` |
|
|
15
|
+
* | `claude` | `default`, `opus`, `sonnet`, `haiku`, `claude-fable-5[1m]` (5) | **none** |
|
|
16
|
+
* | `codex` (unauthenticated) | none | none |
|
|
17
|
+
*
|
|
18
|
+
* So `claude` rendered a Provider picker that could never populate, a model list
|
|
19
|
+
* that never narrowed, and an Environment box hinting `GEMINI_API_KEY`. Its real
|
|
20
|
+
* provider switch is `ANTHROPIC_BASE_URL`, and the form now says so.
|
|
21
|
+
*
|
|
22
|
+
* Pinned here: which fields a harness GETS, that a stored provider stays
|
|
23
|
+
* editable when the probe has not run, and that the env example is the agent's
|
|
24
|
+
* own variable names.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { describe, expect, test } from 'bun:test';
|
|
28
|
+
|
|
29
|
+
import { configFieldPlan, providerOptions } from '@/shared/lib/harness/config-fields';
|
|
30
|
+
import { HARNESS_IDS } from '@/shared/lib/harness/catalog';
|
|
31
|
+
|
|
32
|
+
/** The measured `omp-acp` probe, trimmed to what the plan reads. */
|
|
33
|
+
const OMP_PROBE = {
|
|
34
|
+
models: [
|
|
35
|
+
{ value: 'kenari/claude-sonnet-5' },
|
|
36
|
+
{ value: 'kenari-jatis/claude-sonnet-5' },
|
|
37
|
+
{ value: 'aihub-brisnets-jatis/deepseek-v4-flash' },
|
|
38
|
+
],
|
|
39
|
+
thinking: [{ value: 'off' }, { value: 'auto' }, { value: 'low' }, { value: 'high' }, { value: 'max' }],
|
|
40
|
+
modes: [{ value: 'default' }, { value: 'plan' }],
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** The measured `claude` probe: bare model names, four built-ins and one alias. */
|
|
44
|
+
const CLAUDE_PROBE = {
|
|
45
|
+
models: [
|
|
46
|
+
{ value: 'default' },
|
|
47
|
+
{ value: 'opus' },
|
|
48
|
+
{ value: 'claude-fable-5[1m]' },
|
|
49
|
+
{ value: 'sonnet' },
|
|
50
|
+
{ value: 'haiku' },
|
|
51
|
+
],
|
|
52
|
+
thinking: [
|
|
53
|
+
{ value: 'default' }, { value: 'low' }, { value: 'medium' },
|
|
54
|
+
{ value: 'high' }, { value: 'xhigh' }, { value: 'max' },
|
|
55
|
+
],
|
|
56
|
+
modes: [
|
|
57
|
+
{ value: 'default' }, { value: 'acceptEdits' }, { value: 'plan' },
|
|
58
|
+
{ value: 'auto' }, { value: 'bypassPermissions' },
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
describe('which fields a harness gets', () => {
|
|
63
|
+
test('omp publishes selectors, so it has a Provider dimension', () => {
|
|
64
|
+
const plan = configFieldPlan('omp-acp', OMP_PROBE);
|
|
65
|
+
expect(plan.showProvider).toBe(true);
|
|
66
|
+
expect(plan.modelsAreSelectors).toBe(true);
|
|
67
|
+
expect(providerOptions(OMP_PROBE)).toEqual(['kenari', 'kenari-jatis', 'aihub-brisnets-jatis']);
|
|
68
|
+
expect(plan.showThinking).toBe(true);
|
|
69
|
+
expect(plan.showMode).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('claude publishes BARE model names, so its Provider field is gone', () => {
|
|
73
|
+
// The measured shape: no `/` anywhere in the five values.
|
|
74
|
+
const plan = configFieldPlan('claude', CLAUDE_PROBE);
|
|
75
|
+
expect(providerOptions(CLAUDE_PROBE)).toEqual([]);
|
|
76
|
+
expect(plan.showProvider).toBe(false);
|
|
77
|
+
expect(plan.modelsAreSelectors).toBe(false);
|
|
78
|
+
// It DOES publish ladders, so those stay.
|
|
79
|
+
expect(plan.showThinking).toBe(true);
|
|
80
|
+
expect(plan.showMode).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('an unprobed harness offers neither dimension', () => {
|
|
84
|
+
const plan = configFieldPlan('codex', undefined);
|
|
85
|
+
expect(plan.showProvider).toBe(false);
|
|
86
|
+
expect(plan.showThinking).toBe(false);
|
|
87
|
+
expect(plan.showMode).toBe(false);
|
|
88
|
+
// The model box stays: the agent's own default is a real answer, and a
|
|
89
|
+
// hand-typed id is the only way to pin one before the first probe.
|
|
90
|
+
expect(plan.showModel).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('a stored provider stays editable even when no probe has run', () => {
|
|
94
|
+
// Hiding a value the config holds is how a form silently rewrites it.
|
|
95
|
+
const plan = configFieldPlan('claude', undefined, { provider: 'anthropic-proxy' });
|
|
96
|
+
expect(plan.showProvider).toBe(true);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('the env box speaks the agent’s own vocabulary', () => {
|
|
101
|
+
test('claude gets ANTHROPIC_*, not a Gemini example', () => {
|
|
102
|
+
const plan = configFieldPlan('claude', CLAUDE_PROBE);
|
|
103
|
+
expect(plan.envHint).toContain('ANTHROPIC_BASE_URL');
|
|
104
|
+
expect(plan.envHint).toContain('ANTHROPIC_AUTH_TOKEN');
|
|
105
|
+
expect(plan.envPlaceholder).toContain('ANTHROPIC_BASE_URL');
|
|
106
|
+
expect(plan.envPlaceholder).not.toContain('GEMINI');
|
|
107
|
+
// The picker's aliases need their own variables, or a gateway answers the
|
|
108
|
+
// vendor's ids with 400.
|
|
109
|
+
expect(plan.envHint).toContain('ANTHROPIC_DEFAULT_SONNET_MODEL');
|
|
110
|
+
expect(plan.envPlaceholder).toContain('ANTHROPIC_DEFAULT_OPUS_MODEL');
|
|
111
|
+
// And it says what a provider here even IS.
|
|
112
|
+
expect(plan.notes.join(' ')).toContain('no provider registry');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('antigravity gets its own two variables', () => {
|
|
116
|
+
const plan = configFieldPlan('antigravity', undefined);
|
|
117
|
+
expect(plan.envHint).toContain('GOOGLE_GEMINI_BASE_URL');
|
|
118
|
+
expect(plan.envHint).toContain('GEMINI_API_KEY');
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('a registry harness points at its file instead of claiming an env switch', () => {
|
|
122
|
+
const plan = configFieldPlan('codex', undefined);
|
|
123
|
+
expect(plan.envHint).toContain('.codex/config.toml');
|
|
124
|
+
expect(plan.notes.join(' ')).toContain('.codex/config.toml');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('an agent with no registry says the launch line is the whole surface', () => {
|
|
128
|
+
const plan = configFieldPlan('cursor', undefined);
|
|
129
|
+
expect(plan.notes.join(' ')).toContain('launch line');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('every harness in the catalog gets a plan without throwing', () => {
|
|
133
|
+
for (const id of HARNESS_IDS) {
|
|
134
|
+
const plan = configFieldPlan(id, undefined);
|
|
135
|
+
expect(plan.envHint.length, id).toBeGreaterThan(0);
|
|
136
|
+
expect(typeof plan.showProvider).toBe('boolean');
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which CONFIGURATION fields a given harness can actually use.
|
|
8
|
+
*
|
|
9
|
+
* The card drew the same six fields for every agent, and two of them were lies on
|
|
10
|
+
* most of them. Measured on this machine:
|
|
11
|
+
*
|
|
12
|
+
* | Harness | `probe.models` values | Providers |
|
|
13
|
+
* |---|---|---|
|
|
14
|
+
* | `omp-acp` | `kenari/claude-sonnet-5`, … (221) | `kenari`, `kenari-jatis`, `aihub-brisnets-jatis` |
|
|
15
|
+
* | `claude` | `default`, `opus`, `sonnet`, `haiku`, `claude-fable-5[1m]` | **none** |
|
|
16
|
+
* | `codex` (unauthenticated) | none published | none |
|
|
17
|
+
*
|
|
18
|
+
* So `claude` got a "Provider" field that could never fill and a model list that
|
|
19
|
+
* never narrowed by it — while its real provider switch is `ANTHROPIC_BASE_URL` in
|
|
20
|
+
* the Environment box, which was hinted with `GEMINI_API_KEY` examples.
|
|
21
|
+
*
|
|
22
|
+
* This module answers, per harness and per probe:
|
|
23
|
+
*
|
|
24
|
+
* - is there a PROVIDER dimension at all (only for `provider/model` selectors)?
|
|
25
|
+
* - does the agent publish a model list, a thinking ladder, a mode selector?
|
|
26
|
+
* - what does its Environment box actually carry?
|
|
27
|
+
*
|
|
28
|
+
* Pure and probe-injected: the form renders exactly this, and a test pins it
|
|
29
|
+
* without spawning an agent.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import type { HarnessId } from '@/shared/lib/harness/catalog';
|
|
33
|
+
import { providerFacts } from '@/shared/lib/harness/provider-facts';
|
|
34
|
+
|
|
35
|
+
/** The probe fields this plan reads. Absent means "never probed". */
|
|
36
|
+
export interface ConfigProbeFacts {
|
|
37
|
+
models?: readonly { value: string }[];
|
|
38
|
+
thinking?: readonly { value: string }[];
|
|
39
|
+
modes?: readonly { value: string }[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ConfigFieldPlan {
|
|
43
|
+
/** True only when the agent publishes `provider/model` selectors. */
|
|
44
|
+
showProvider: boolean;
|
|
45
|
+
showModel: boolean;
|
|
46
|
+
showThinking: boolean;
|
|
47
|
+
showMode: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* True when the model values already name a provider, so choosing one is the
|
|
50
|
+
* whole decision and a separate Provider field would only filter it.
|
|
51
|
+
*/
|
|
52
|
+
modelsAreSelectors: boolean;
|
|
53
|
+
/** The variable names this agent's Environment box actually carries. */
|
|
54
|
+
envHint: string;
|
|
55
|
+
envPlaceholder: string;
|
|
56
|
+
/** What to type in the launch box when empty, from the build's own table. */
|
|
57
|
+
launchPlaceholder: string;
|
|
58
|
+
/** Per-harness guidance the generic form cannot know. */
|
|
59
|
+
notes: string[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Providers the probe's model list names, in its own order. */
|
|
63
|
+
function providersOf(models: readonly { value: string }[]): string[] {
|
|
64
|
+
const seen = new Set<string>();
|
|
65
|
+
const out: string[] = [];
|
|
66
|
+
for (const option of models) {
|
|
67
|
+
const slash = option.value.indexOf('/');
|
|
68
|
+
if (slash <= 0) continue;
|
|
69
|
+
const provider = option.value.slice(0, slash);
|
|
70
|
+
if (seen.has(provider)) continue;
|
|
71
|
+
seen.add(provider);
|
|
72
|
+
out.push(provider);
|
|
73
|
+
}
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The Environment box, described by the agent's OWN contract.
|
|
79
|
+
*
|
|
80
|
+
* `providerFacts(id).env` exists only where the vendor documents environment
|
|
81
|
+
* variables as the provider switch (Claude Code, Antigravity). Every other agent
|
|
82
|
+
* reads a registry file instead, and its env box carries the credential the file
|
|
83
|
+
* NAMES (`OPENAI_API_KEY` for codex, `GEMINI_API_KEY` for Antigravity).
|
|
84
|
+
*/
|
|
85
|
+
function environmentFacts(id: HarnessId): { hint: string; placeholder: string; notes: string[] } {
|
|
86
|
+
const facts = providerFacts(id);
|
|
87
|
+
if (facts.env) {
|
|
88
|
+
const { env } = facts;
|
|
89
|
+
const names = [env.baseUrl, env.apiKey, env.model].filter(Boolean).join(', ');
|
|
90
|
+
const aliases = env.modelAliases ?? [];
|
|
91
|
+
const aliasNames = aliases.map((alias) => alias.env).join(', ');
|
|
92
|
+
return {
|
|
93
|
+
hint: aliases.length > 0
|
|
94
|
+
? `The variables that point this agent at one endpoint: ${names}. A picker alias still resolves to the vendor's model id unless ${aliasNames} pins it to an id this endpoint serves; unpinned aliases answer 400. Setting them REPLACES its own provider.`
|
|
95
|
+
: `The variables that point this agent at one endpoint: ${names}. Setting them REPLACES its own provider.`,
|
|
96
|
+
placeholder: [
|
|
97
|
+
`${env.baseUrl}=https://…`,
|
|
98
|
+
`${env.apiKey}=…`,
|
|
99
|
+
...(env.model ? [`${env.model}=…`] : []),
|
|
100
|
+
...(aliases[0] ? [`${aliases[0].env}=…`] : []),
|
|
101
|
+
].join('\n'),
|
|
102
|
+
notes: [
|
|
103
|
+
'This agent has no provider registry — a provider here is an endpoint and a key, nothing else.',
|
|
104
|
+
...(aliases.length > 0
|
|
105
|
+
? ['A picker alias with no default-model variable keeps the vendor’s model id; a custom endpoint answers that id with 400.']
|
|
106
|
+
: []),
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (facts.registry.kind === 'none') {
|
|
111
|
+
return {
|
|
112
|
+
hint: 'One KEY=VALUE per line. Nothing else configures a provider for this agent.',
|
|
113
|
+
placeholder: 'KEY=VALUE',
|
|
114
|
+
notes: ['No provider registry and no provider variables: the launch line and this box are the whole surface.'],
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (facts.registry.kind === 'agent-managed') {
|
|
118
|
+
return {
|
|
119
|
+
hint: 'One KEY=VALUE per line. Providers themselves are managed by the agent’s own command.',
|
|
120
|
+
placeholder: 'KEY=VALUE',
|
|
121
|
+
notes: ['The provider registry belongs to the agent — add providers with its own command.'],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
hint: `Credentials this agent reads from the environment. Its providers live in ${facts.registry.file ?? 'its own config'}.`,
|
|
126
|
+
placeholder: 'KEY=VALUE',
|
|
127
|
+
notes: [`Providers are edited in ${facts.registry.file ?? 'the agent’s own config'}, not here.`],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The plan for one harness.
|
|
133
|
+
*
|
|
134
|
+
* `provider` is the CURRENT config value: a provider already stored stays
|
|
135
|
+
* editable even when the probe has not run, because hiding a stored value is how
|
|
136
|
+
* a form silently rewrites what it cannot show.
|
|
137
|
+
*/
|
|
138
|
+
export function configFieldPlan(
|
|
139
|
+
id: HarnessId,
|
|
140
|
+
probe: ConfigProbeFacts | undefined,
|
|
141
|
+
options: { provider?: string; launchCommand?: string } = {},
|
|
142
|
+
): ConfigFieldPlan {
|
|
143
|
+
const models = probe?.models ?? [];
|
|
144
|
+
const providers = providersOf(models);
|
|
145
|
+
const env = environmentFacts(id);
|
|
146
|
+
// `provider/model` selectors are the ONE shape that gives "Provider" a meaning.
|
|
147
|
+
// Every other agent publishes bare names, and filtering those by a provider
|
|
148
|
+
// that does not exist left the field permanently empty.
|
|
149
|
+
const modelsAreSelectors = providers.length > 0;
|
|
150
|
+
const storedProvider = Boolean(options.provider?.trim());
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
showProvider: modelsAreSelectors || storedProvider,
|
|
154
|
+
showModel: true,
|
|
155
|
+
showThinking: Boolean(probe?.thinking?.length),
|
|
156
|
+
showMode: Boolean(probe?.modes?.length),
|
|
157
|
+
modelsAreSelectors,
|
|
158
|
+
envHint: env.hint,
|
|
159
|
+
envPlaceholder: env.placeholder,
|
|
160
|
+
launchPlaceholder: options.launchCommand ?? 'the agent’s own command',
|
|
161
|
+
notes: env.notes,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** True when the agent published anything the provider field could list. */
|
|
166
|
+
export function providerOptions(probe: ConfigProbeFacts | undefined): string[] {
|
|
167
|
+
return providersOf(probe?.models ?? []);
|
|
168
|
+
}
|