@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,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The padding a fixed overlay keeps clear of a phone's own chrome.
|
|
8
|
+
*
|
|
9
|
+
* A `fixed inset-0` frame reaches the viewport's physical edges, and on a
|
|
10
|
+
* `viewport-fit: cover` surface those edges run UNDER the status bar and the
|
|
11
|
+
* home indicator. Every dialog in this console states the same four declarations
|
|
12
|
+
* inline (the shared `Modal` shell, the About card, …); stated twice, one of them
|
|
13
|
+
* eventually forgets, and the symptom is a header nobody can tap.
|
|
14
|
+
*
|
|
15
|
+
* `env()` is 0 on a desktop, so a single rule serves both surfaces — no
|
|
16
|
+
* media query, and no second copy for the desktop.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** The gutter a dialog keeps from every edge when no safe area applies. */
|
|
20
|
+
export const DIALOG_GUTTER_REM = 0.75;
|
|
21
|
+
|
|
22
|
+
export type SafeAreaPadding = {
|
|
23
|
+
paddingTop: string;
|
|
24
|
+
paddingBottom: string;
|
|
25
|
+
paddingLeft: string;
|
|
26
|
+
paddingRight: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param gutterRem the edge gutter used when `env()` reports no inset.
|
|
31
|
+
* `max()`, not a sum: on a notched device the safe area is the LARGER of the
|
|
32
|
+
* two, and adding them would inset a dialog twice as far as the device needs.
|
|
33
|
+
*/
|
|
34
|
+
export function safeAreaPadding(gutterRem: number = DIALOG_GUTTER_REM): SafeAreaPadding {
|
|
35
|
+
const gutter = `${gutterRem}rem`;
|
|
36
|
+
return {
|
|
37
|
+
paddingTop: `max(${gutter}, env(safe-area-inset-top, 0px))`,
|
|
38
|
+
paddingBottom: `max(${gutter}, env(safe-area-inset-bottom, 0px))`,
|
|
39
|
+
paddingLeft: `max(${gutter}, env(safe-area-inset-left, 0px))`,
|
|
40
|
+
paddingRight: `max(${gutter}, env(safe-area-inset-right, 0px))`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The auto-dismiss budget.
|
|
8
|
+
*
|
|
9
|
+
* The bug this pins: one flat 4000 ms made a two-word confirmation linger and a
|
|
10
|
+
* refused action vanish before it could be read. The cases below are the
|
|
11
|
+
* contract — a floor so nothing flickers, a rate so a longer sentence gets more
|
|
12
|
+
* time, a ceiling so a paragraph does not sit there, and a caller's own number
|
|
13
|
+
* winning over all of it.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { describe, expect, test } from 'bun:test';
|
|
17
|
+
import { TOAST_EXIT_MS, toastDurationMs } from '@/shared/lib/ui/toast-duration';
|
|
18
|
+
|
|
19
|
+
describe('toastDurationMs', () => {
|
|
20
|
+
test('a short confirmation gets the success floor, not a flicker', () => {
|
|
21
|
+
expect(toastDurationMs({ tone: 'success', message: 'Saved' })).toBe(3000);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('a short error still gets the error floor: a failure is read twice', () => {
|
|
25
|
+
expect(toastDurationMs({ tone: 'error', message: 'Failed' })).toBe(5000);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('a longer sentence buys reading time, measured from its own length', () => {
|
|
29
|
+
const short = toastDurationMs({ tone: 'success', message: 'Saved' })!;
|
|
30
|
+
const long = toastDurationMs({
|
|
31
|
+
tone: 'success',
|
|
32
|
+
message: 'Provider list refreshed — 97 providers, all readable.',
|
|
33
|
+
})!;
|
|
34
|
+
expect(long).toBeGreaterThan(short);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('an error outlasts a success of the same length', () => {
|
|
38
|
+
const message = 'Could not read the provider list — omp may still be starting.';
|
|
39
|
+
expect(toastDurationMs({ tone: 'error', message })).toBeGreaterThan(
|
|
40
|
+
toastDurationMs({ tone: 'success', message })!,
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('a paragraph is clamped instead of sitting for a minute', () => {
|
|
45
|
+
const message = 'x'.repeat(4000);
|
|
46
|
+
expect(toastDurationMs({ tone: 'success', message })).toBe(8000);
|
|
47
|
+
expect(toastDurationMs({ tone: 'error', message })).toBe(12000);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('an explicit duration is honoured verbatim, zero included', () => {
|
|
51
|
+
expect(toastDurationMs({ tone: 'error', message: 'boom', explicit: 7000 })).toBe(7000);
|
|
52
|
+
expect(toastDurationMs({ tone: 'error', message: 'boom', explicit: 0 })).toBe(0);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('an explicit null waits for a dismissal', () => {
|
|
56
|
+
expect(toastDurationMs({ tone: 'success', message: 'Saved', explicit: null })).toBeNull();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('a toast with an action is sticky unless the caller says otherwise', () => {
|
|
60
|
+
expect(toastDurationMs({ tone: 'error', message: 'Stopped.', sticky: true })).toBeNull();
|
|
61
|
+
expect(toastDurationMs({ tone: 'error', message: 'Stopped.', sticky: true, explicit: 8000 })).toBe(8000);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('surrounding whitespace does not buy time', () => {
|
|
65
|
+
expect(toastDurationMs({ tone: 'success', message: ' Saved ' })).toBe(
|
|
66
|
+
toastDurationMs({ tone: 'success', message: 'Saved' })!,
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('the exit animation is a real duration, short enough to read as a fade', () => {
|
|
71
|
+
expect(TOAST_EXIT_MS).toBeGreaterThan(0);
|
|
72
|
+
expect(TOAST_EXIT_MS).toBeLessThan(400);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* How long a toast stays on screen, as arithmetic.
|
|
8
|
+
*
|
|
9
|
+
* One flat 4000 ms was wrong in both directions, and the two complaints were the
|
|
10
|
+
* same number. A one-word confirmation ("Setting was saved") hung around, while
|
|
11
|
+
* a refusal carrying the server's own sentence vanished before it could be read:
|
|
12
|
+
* the messages this app actually pushes run 24–89 characters, median 54.
|
|
13
|
+
*
|
|
14
|
+
* The budget is therefore per TONE and per LENGTH. Reading is not free: at a
|
|
15
|
+
* comfortable ~20 characters a second a 54-character line needs 2.7 s of eyes
|
|
16
|
+
* before the reader has even noticed the card. So each tone pays a fixed base
|
|
17
|
+
* for "notice me", then a per-character rate, and the sum is clamped — an error
|
|
18
|
+
* is re-read, a confirmation is skimmed, so the error starts higher, grows
|
|
19
|
+
* faster and is allowed to stay longer.
|
|
20
|
+
*
|
|
21
|
+
* This is a POLICY module, not a component concern: the queue resolves a
|
|
22
|
+
* toast's delay once, at push time, so every host renders the same number and a
|
|
23
|
+
* caller overriding it does so in one place.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export type ToastTone = 'success' | 'error';
|
|
27
|
+
|
|
28
|
+
/** How long the fade-out runs. The timer and the class that animates agree here. */
|
|
29
|
+
export const TOAST_EXIT_MS = 180;
|
|
30
|
+
|
|
31
|
+
/** Notice-me base, per tone. */
|
|
32
|
+
const BASE_MS: Record<ToastTone, number> = { success: 2500, error: 4000 };
|
|
33
|
+
|
|
34
|
+
/** Reading rate per tone: an error is re-read, a confirmation is skimmed. */
|
|
35
|
+
const PER_CHAR_MS: Record<ToastTone, number> = { success: 45, error: 55 };
|
|
36
|
+
|
|
37
|
+
/** Floor and ceiling per tone: nothing flickers, nothing sits for a minute. */
|
|
38
|
+
const BOUNDS_MS: Record<ToastTone, { min: number; max: number }> = {
|
|
39
|
+
success: { min: 3000, max: 8000 },
|
|
40
|
+
error: { min: 5000, max: 12000 },
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export interface ToastDurationInput {
|
|
44
|
+
tone: ToastTone;
|
|
45
|
+
message: string;
|
|
46
|
+
/**
|
|
47
|
+
* The caller's own delay, in ms. `null` means "wait for a dismissal".
|
|
48
|
+
* Honoured verbatim: a site that names a number knows its own content.
|
|
49
|
+
*/
|
|
50
|
+
explicit?: number | null;
|
|
51
|
+
/** A toast carrying a button waits for that decision instead of timing out. */
|
|
52
|
+
sticky?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The auto-dismiss delay in ms, or `null` for a toast that stays until it is
|
|
57
|
+
* dismissed.
|
|
58
|
+
*
|
|
59
|
+
* A toast with an action is sticky by default — a "Send now" that disappears
|
|
60
|
+
* mid-reach is the same defect as a message that cannot be read — while an
|
|
61
|
+
* explicit duration still wins, because that caller knows whether the action is
|
|
62
|
+
* optional.
|
|
63
|
+
*/
|
|
64
|
+
export function toastDurationMs({ tone, message, explicit, sticky }: ToastDurationInput): number | null {
|
|
65
|
+
if (explicit !== undefined) return explicit;
|
|
66
|
+
if (sticky) return null;
|
|
67
|
+
const { min, max } = BOUNDS_MS[tone];
|
|
68
|
+
const byLength = BASE_MS[tone] + PER_CHAR_MS[tone] * message.trim().length;
|
|
69
|
+
return Math.round(Math.min(max, Math.max(min, byLength)));
|
|
70
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One row of `GET /api/harness/versions` — the wire shape the About card reads.
|
|
8
|
+
*
|
|
9
|
+
* Stated ONCE, here, because the route that answers it and the hook that stores it
|
|
10
|
+
* were declaring the same eight fields twice: a second copy is how a client starts
|
|
11
|
+
* reading a field the server stopped sending, silently, and shows a dash forever.
|
|
12
|
+
*
|
|
13
|
+
* **A harness can be TWO installs.** `claude` is an npm ACP adapter over the
|
|
14
|
+
* `claude` CLI: two real versions, moving independently through two different
|
|
15
|
+
* mechanisms. So the row carries a `agent` part and an optional `cli` part, each
|
|
16
|
+
* with its own latest version and its own `updateAvailable` — never one flattened
|
|
17
|
+
* pair, which is what made "the adapter is current" read as "everything is".
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import type { HarnessUpdateKind } from '@/shared/lib/harness/updates';
|
|
21
|
+
|
|
22
|
+
/** One part's installed and latest version, and whether it can move. */
|
|
23
|
+
export interface HarnessPartRow {
|
|
24
|
+
/** What is on disk, or null when it has never answered. */
|
|
25
|
+
version: string | null;
|
|
26
|
+
/** What its install source offers, or null when Kabmo reads no source for it. */
|
|
27
|
+
latest: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* A newer version exists for THIS part.
|
|
30
|
+
*
|
|
31
|
+
* False when either number is missing: a comparison needs both, and claiming
|
|
32
|
+
* "up to date" about a part Kabmo never read would be a fabricated fact.
|
|
33
|
+
*/
|
|
34
|
+
updateAvailable: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface HarnessVersionRow {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
/** `npm` — published on npm; the number IS the install target.
|
|
41
|
+
* `self` — the CLI updates itself, so Kabmo reports and does not install.
|
|
42
|
+
* `own` — a vendor installer owns it; the route refuses. */
|
|
43
|
+
kind: HarnessUpdateKind | null;
|
|
44
|
+
/** False when the agent is not on this machine: no version, no action. */
|
|
45
|
+
installed: boolean;
|
|
46
|
+
/** The ADAPTER: the version the probe reported, and its own package's latest.
|
|
47
|
+
* For a harness that is not an adapter this part IS the agent. */
|
|
48
|
+
agent: HarnessPartRow;
|
|
49
|
+
/** The CLI underneath an adapter: its name, its version and its own package's
|
|
50
|
+
* latest. Null when the harness is not an adapter. The binary PATH is a server
|
|
51
|
+
* fact (`forgetCliVersion` invalidates it), so it is not on the wire. */
|
|
52
|
+
cli: (HarnessPartRow & { name: string }) | null;
|
|
53
|
+
/** True when ANY part is behind: one press moves every part that is. */
|
|
54
|
+
updateAvailable: boolean;
|
|
55
|
+
/** Why a field is empty, in words — never a bare dash. */
|
|
56
|
+
note: string | null;
|
|
57
|
+
/** The command that updates it, for `self`, `own` and an adapter's CLI. */
|
|
58
|
+
command: string | null;
|
|
59
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The harness catalog as the CLIENT sees it: identities from the shared
|
|
8
|
+
* catalog, capabilities from `/api/harness`.
|
|
9
|
+
*
|
|
10
|
+
* Split from `@/shared/lib/harness/catalog` because it is the wire shape, not
|
|
11
|
+
* the identity: a panel reads `capabilities.hasUsage` to decide whether to draw
|
|
12
|
+
* a number or say "not reported", and nothing in the client may invent one.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { HarnessCapabilities } from '@/server/lib/harness/capabilities';
|
|
16
|
+
import type { HarnessConfig } from '@/shared/lib/harness/config';
|
|
17
|
+
import type { CanonicalProtocol } from '@/shared/lib/harness/dialects';
|
|
18
|
+
import type { EnvProviderContract } from '@/shared/lib/harness/provider-facts';
|
|
19
|
+
|
|
20
|
+
export type { HarnessConfig };
|
|
21
|
+
|
|
22
|
+
export type { HarnessCapabilities };
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* One selector value an ACP agent publishes (`configOptions[].options[]`), in
|
|
26
|
+
* the agent's own order and its own words.
|
|
27
|
+
*
|
|
28
|
+
* The SAME shape is what a probe records and what a live session reports, so a
|
|
29
|
+
* picker can list either without knowing which one it got.
|
|
30
|
+
*/
|
|
31
|
+
export interface HarnessSelectorValue {
|
|
32
|
+
value: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The model and thinking selectors a harness's LIVE chat published.
|
|
38
|
+
*
|
|
39
|
+
* A probe is one throwaway spawn: it can be refused (codex demands
|
|
40
|
+
* authentication in the probe while the chat already running lists its models)
|
|
41
|
+
* and its answer ages. When a session of that harness is open, these are the
|
|
42
|
+
* selectors it published, and they are what the picker must show.
|
|
43
|
+
*/
|
|
44
|
+
export interface LiveHarnessModels {
|
|
45
|
+
models: HarnessSelectorValue[];
|
|
46
|
+
thinking?: HarnessSelectorValue[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** One row of `GET /api/harness`. */
|
|
50
|
+
export interface HarnessSummary {
|
|
51
|
+
id: string;
|
|
52
|
+
label: string;
|
|
53
|
+
transport: 'rpc' | 'acp';
|
|
54
|
+
canLaunch: boolean;
|
|
55
|
+
/** True for the transport Kabmo itself provides (`omp-rpc`): there is nothing
|
|
56
|
+
* to install, probe or configure, so the settings page leaves it out and the
|
|
57
|
+
* picker never draws it as blocked. */
|
|
58
|
+
builtIn?: true;
|
|
59
|
+
install?: string;
|
|
60
|
+
note?: string;
|
|
61
|
+
/** False when the user switched this harness off: it then leaves the settings
|
|
62
|
+
* menu and the composer's picker, so a roster of twelve becomes the agents
|
|
63
|
+
* someone actually runs. Always true for the built-in transport, which has no
|
|
64
|
+
* switch. */
|
|
65
|
+
enabled: boolean;
|
|
66
|
+
/** The live probe, or null when this harness has never been probed. */
|
|
67
|
+
probe: {
|
|
68
|
+
harness: string;
|
|
69
|
+
capabilities: HarnessCapabilities;
|
|
70
|
+
models: HarnessSelectorValue[];
|
|
71
|
+
thinking: HarnessSelectorValue[];
|
|
72
|
+
modes: HarnessSelectorValue[];
|
|
73
|
+
probedAt: number;
|
|
74
|
+
/** True when the record is older than `PROBE_TTL_MS`. The answer is still
|
|
75
|
+
* shown — with its age — rather than being reported as "never probed". */
|
|
76
|
+
stale?: true;
|
|
77
|
+
} | null;
|
|
78
|
+
unavailable?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** One provider as a registry holds it, minus its credential. */
|
|
82
|
+
export interface HarnessProviderRow {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
baseUrl?: string;
|
|
86
|
+
/** The SOURCE's own dialect value, verbatim, for the row's footnote. */
|
|
87
|
+
dialect?: string;
|
|
88
|
+
/** That dialect on the shared vocabulary. Absent when Kabmo cannot name it. */
|
|
89
|
+
protocol?: CanonicalProtocol;
|
|
90
|
+
models: string[];
|
|
91
|
+
/** Context window per model id, when the source declared one. */
|
|
92
|
+
contextWindow?: Record<string, number>;
|
|
93
|
+
/** The harness the entry came from — two sources can share an id. */
|
|
94
|
+
source: string;
|
|
95
|
+
hasKey: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* What one harness can do about OTHER providers, as `/api/harness` reports it.
|
|
100
|
+
*
|
|
101
|
+
* The level decides which SHAPE the settings card draws — a registry editor, an
|
|
102
|
+
* env-var form, or a plain statement of the surface — and `importable` is the
|
|
103
|
+
* credential-free list of entries a copy could take from elsewhere (a boolean
|
|
104
|
+
* `hasKey`, never the key).
|
|
105
|
+
*/
|
|
106
|
+
export interface HarnessProviderSupport {
|
|
107
|
+
level: 'full' | 'environment' | 'configurable' | 'none';
|
|
108
|
+
file: string;
|
|
109
|
+
fileLabel: string;
|
|
110
|
+
summary: string;
|
|
111
|
+
/** True when adding a provider ADDS a choice; false when it replaces the
|
|
112
|
+
* agent's own (Claude Code, Antigravity). */
|
|
113
|
+
createsChoice: boolean;
|
|
114
|
+
/** The env names this harness reads, for the `environment` form's labels. */
|
|
115
|
+
env?: EnvProviderContract;
|
|
116
|
+
/** The dot-path the providers live under in that file (`providers`,
|
|
117
|
+
* `model_providers`, `modelProviders`), so the card can name what it edits. */
|
|
118
|
+
pointer?: string;
|
|
119
|
+
/** The credential field's name in this format. `env_key`/`envKey` means a
|
|
120
|
+
* VARIABLE NAME, which the form says out loud. */
|
|
121
|
+
credentialLabel?: string;
|
|
122
|
+
/** The single protocol an `environment` harness's SDK speaks. */
|
|
123
|
+
envProtocol?: CanonicalProtocol;
|
|
124
|
+
/**
|
|
125
|
+
* Every protocol this harness can carry, in the order an import prefers.
|
|
126
|
+
*
|
|
127
|
+
* Deliberately the TARGET's list, not a per-row verdict: whether a given
|
|
128
|
+
* endpoint can land here is not knowable without asking it, and the import
|
|
129
|
+
* does exactly that (`provider-probe.server.ts`). A row that declares a
|
|
130
|
+
* different protocol is therefore still offered — the probe decides, and a
|
|
131
|
+
* refusal names what the endpoint answered.
|
|
132
|
+
*/
|
|
133
|
+
protocols: readonly CanonicalProtocol[];
|
|
134
|
+
/** The CUSTOM providers this harness's own registry already holds. */
|
|
135
|
+
configured: HarnessProviderRow[];
|
|
136
|
+
importable: Array<{
|
|
137
|
+
id: string;
|
|
138
|
+
name: string;
|
|
139
|
+
baseUrl?: string;
|
|
140
|
+
/** The SOURCE's own dialect value, verbatim, for the row's footnote. */
|
|
141
|
+
dialect?: string;
|
|
142
|
+
/** That dialect on the shared vocabulary. Absent when Kabmo cannot name it. */
|
|
143
|
+
protocol?: CanonicalProtocol;
|
|
144
|
+
models: string[];
|
|
145
|
+
/** Context window per model id, when the source declared one. */
|
|
146
|
+
contextWindow?: Record<string, number>;
|
|
147
|
+
/** The harness the entry came from — two sources can share an id. */
|
|
148
|
+
source: string;
|
|
149
|
+
hasKey: boolean;
|
|
150
|
+
}>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* What an import did, as the card repeats it.
|
|
155
|
+
*
|
|
156
|
+
* `problem` is the refusal (already a sentence a reader can act on); `detail`
|
|
157
|
+
* is the evidence for a SUCCESS — the protocol that landed, where it was written,
|
|
158
|
+
* and the env lines a variable-name format needed. Two fields because "copied"
|
|
159
|
+
* alone was a claim: measured imports differ in the protocol they chose, and a
|
|
160
|
+
* reader has to be able to check that.
|
|
161
|
+
*/
|
|
162
|
+
export interface HarnessImportOutcome {
|
|
163
|
+
problem: string | null;
|
|
164
|
+
detail: string | null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface HarnessesPayload {
|
|
168
|
+
harnesses: HarnessSummary[];
|
|
169
|
+
/** Per-harness config, keyed by id. Absent from an answer written before this
|
|
170
|
+
* field existed, so every reader treats it as optional. */
|
|
171
|
+
configs?: Record<string, HarnessConfig>;
|
|
172
|
+
/** Per-harness provider support, keyed by id. */
|
|
173
|
+
providerSupport?: Record<string, HarnessProviderSupport>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Capabilities for a harness the client has no row for: nothing is claimed, so
|
|
177
|
+
* every panel falls back to its "not reported" state rather than guessing. */
|
|
178
|
+
export const UNKNOWN_CAPABILITIES: HarnessCapabilities = {
|
|
179
|
+
configModel: 0,
|
|
180
|
+
configThinking: 0,
|
|
181
|
+
configMode: 0,
|
|
182
|
+
modeValues: [],
|
|
183
|
+
loadSession: false,
|
|
184
|
+
listSessions: false,
|
|
185
|
+
forkSession: false,
|
|
186
|
+
deleteSession: false,
|
|
187
|
+
resumeSession: false,
|
|
188
|
+
closeSession: false,
|
|
189
|
+
hasUsage: false,
|
|
190
|
+
hasPlan: false,
|
|
191
|
+
steerMode: null,
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/** The capabilities of a harness from a payload, or the empty set. */
|
|
195
|
+
export function capabilitiesOf(
|
|
196
|
+
harnesses: readonly HarnessSummary[],
|
|
197
|
+
id: string | null | undefined,
|
|
198
|
+
): HarnessCapabilities {
|
|
199
|
+
if (!id) return UNKNOWN_CAPABILITIES;
|
|
200
|
+
return harnesses.find((entry) => entry.id === id)?.probe?.capabilities ?? UNKNOWN_CAPABILITIES;
|
|
201
|
+
}
|
|
@@ -27,6 +27,8 @@ export * from '@/shared/types/omp/subagent';
|
|
|
27
27
|
export * from '@/shared/types/browser';
|
|
28
28
|
export * from '@/shared/types/updates';
|
|
29
29
|
export * from '@/shared/types/todo';
|
|
30
|
+
export * from '@/shared/types/harness';
|
|
31
|
+
export * from '@/shared/types/harness-version';
|
|
30
32
|
export * from '@/shared/types/plan';
|
|
31
33
|
export * from '@/shared/types/wiki';
|
|
32
34
|
export * from '@/shared/types/panels';
|
|
@@ -131,6 +131,12 @@ export interface SpawnOptions {
|
|
|
131
131
|
/** Plan/goal picks made on a pending view. A brand-new session has no
|
|
132
132
|
* transcript to restore them from, so they ride the spawn environment. */
|
|
133
133
|
modes?: { plan: boolean; goal: boolean } | null;
|
|
134
|
+
/**
|
|
135
|
+
* Which harness runs the chat. A SPAWN property — it decides the transport,
|
|
136
|
+
* the model list and every capability the panels can show — so it can only be
|
|
137
|
+
* chosen on a chat with no transcript. Absent means omp's RPC mode.
|
|
138
|
+
*/
|
|
139
|
+
harness?: string | null;
|
|
134
140
|
}
|
|
135
141
|
|
|
136
142
|
/** What a spawn answers: omp's own session id, and the model the child
|
|
@@ -138,6 +144,13 @@ export interface SpawnOptions {
|
|
|
138
144
|
export interface SpawnedSession {
|
|
139
145
|
sessionId: string;
|
|
140
146
|
model: { provider: string; modelId: string } | null;
|
|
147
|
+
/**
|
|
148
|
+
* The harness the SERVER actually spawned on. The ACP branch answers its own
|
|
149
|
+
* id; the omp branch omits the field, which means the RPC default. Read rather
|
|
150
|
+
* than assumed from the request, so a harness the server refused cannot be
|
|
151
|
+
* reported as the one running.
|
|
152
|
+
*/
|
|
153
|
+
harness?: string | null;
|
|
141
154
|
}
|
|
142
155
|
|
|
143
156
|
/** Command surface returned by useOmpAgent — the live omp session handle the
|
|
@@ -5,6 +5,7 @@ import type { SidebarStyle } from '@/shared/lib/workspace/sidebar-style';
|
|
|
5
5
|
import type { ComposerStyle } from '@/shared/lib/chat/composer/style';
|
|
6
6
|
import type { SurfaceStyle } from '@/shared/lib/theme/surface-style';
|
|
7
7
|
import type { IconStyle } from '@/shared/lib/theme/icon-style';
|
|
8
|
+
import type { SettingsSection } from '@/shared/lib/settings/sections';
|
|
8
9
|
|
|
9
10
|
/** Wire protocol for the live agent event stream (chat timeline). */
|
|
10
11
|
export type SettingsCategoryId =
|
|
@@ -27,6 +28,14 @@ export type SettingsCategoryId =
|
|
|
27
28
|
| 'behavior'
|
|
28
29
|
| 'commands'
|
|
29
30
|
| 'mcp'
|
|
31
|
+
// HARNESSES — the agents Kabmo can drive, one PAGE each. Their own group in
|
|
32
|
+
// the sidebar: a different transport and a different config file from omp.
|
|
33
|
+
// The single-harness pages carry a dynamic id (`harness:claude`, from
|
|
34
|
+
// `harness/menu.ts`) rather than a union member per adapter: the catalog is
|
|
35
|
+
// what decides which agents exist, and a build-time union entry per harness
|
|
36
|
+
// would have to be edited for every adapter added at runtime.
|
|
37
|
+
| 'harness-index'
|
|
38
|
+
| `harness:${string}`
|
|
30
39
|
// LIBRARY
|
|
31
40
|
| 'plugins'
|
|
32
41
|
| 'skills'
|
|
@@ -37,7 +46,7 @@ export interface SettingsCategoryItem {
|
|
|
37
46
|
label: string;
|
|
38
47
|
iconName: string;
|
|
39
48
|
badge?: string;
|
|
40
|
-
section:
|
|
49
|
+
section: SettingsSection;
|
|
41
50
|
description?: string;
|
|
42
51
|
}
|
|
43
52
|
|
|
@@ -46,6 +46,16 @@ export interface SessionItemData {
|
|
|
46
46
|
* have to honour and the sidebar badge names.
|
|
47
47
|
*/
|
|
48
48
|
cwd?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Which harness ran (and would resume) this session: `omp-rpc`, `claude`,
|
|
51
|
+
* `codex`, … Absent for a session created before harnesses were tracked and
|
|
52
|
+
* for a MOCK row, which no real agent owns — the row then draws no badge
|
|
53
|
+
* rather than a fabricated one.
|
|
54
|
+
*
|
|
55
|
+
* A spawn-time fact, not a display preference: the value decides the
|
|
56
|
+
* transport, the capabilities each panel can show, and the launch command.
|
|
57
|
+
*/
|
|
58
|
+
harness?: string;
|
|
49
59
|
/**
|
|
50
60
|
* The worktree this session runs in, when its cwd is a linked checkout.
|
|
51
61
|
* Absent for an ordinary session (the common case) and for a session whose cwd
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Saving and restoring an environment variable across a suite.
|
|
8
|
+
*
|
|
9
|
+
* `Bun.env.X = saved` looks like a faithful restore and is not: when `saved` is
|
|
10
|
+
* `undefined` — a variable the runner never had — Bun stores the STRING
|
|
11
|
+
* `"undefined"`. Measured on Bun 1.4.4:
|
|
12
|
+
*
|
|
13
|
+
* ```
|
|
14
|
+
* const saved = Bun.env.__PROBE; // undefined
|
|
15
|
+
* Bun.env.__PROBE = saved;
|
|
16
|
+
* Bun.env.__PROBE; // "undefined" (typeof "string")
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* On a Windows runner `HOME` is not set (the variable there is `USERPROFILE`),
|
|
20
|
+
* so every suite that redirected `$HOME` and restored it this way left `HOME`
|
|
21
|
+
* holding `"undefined"` for the rest of the process. `homeDir()` prefers
|
|
22
|
+
* `Bun.env.HOME`, so the roots it builds became RELATIVE — measured on the
|
|
23
|
+
* Windows gate as `undefined\.claude\commands` and `undefined\.agents\skills`
|
|
24
|
+
* in `discovery-roots.test.ts`, in a file that does nothing with `HOME` itself.
|
|
25
|
+
*
|
|
26
|
+
* `delete` is the only faithful restore for an absent variable.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** The value to hand back to `restoreEnv`, captured before a test changes it. */
|
|
30
|
+
export function saveEnv(name: string): string | undefined {
|
|
31
|
+
return Bun.env[name];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Put `name` back to `value`; an absent variable is DELETED, never assigned. */
|
|
35
|
+
export function restoreEnv(name: string, value: string | undefined): void {
|
|
36
|
+
if (value === undefined) delete Bun.env[name];
|
|
37
|
+
else Bun.env[name] = value;
|
|
38
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Draw the Files panel into a container, with an explicit `active` flag.
|
|
8
|
+
*
|
|
9
|
+
* Split from the harness so a spec can change the panel's visibility WITHOUT a
|
|
10
|
+
* remount: the desktop layout keeps a hidden view mounted and hides it with
|
|
11
|
+
* CSS, and only a re-render with another `active` reproduces that. Kept in its
|
|
12
|
+
* own module so the harness stays under the repository's line ceiling.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { h, render } from 'preact';
|
|
16
|
+
import { act } from 'preact/test-utils';
|
|
17
|
+
import { FileExplorer } from '@/client/components/workspace/file-explorer/index';
|
|
18
|
+
import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
|
|
19
|
+
|
|
20
|
+
export async function renderFileExplorer(
|
|
21
|
+
container: HTMLElement,
|
|
22
|
+
sessionId: string,
|
|
23
|
+
rootPath: string,
|
|
24
|
+
active: boolean,
|
|
25
|
+
onOpenFile: (file: { path: string; name: string }) => void,
|
|
26
|
+
): Promise<void> {
|
|
27
|
+
await act(async () => {
|
|
28
|
+
render(
|
|
29
|
+
h(SessionStateProvider, {
|
|
30
|
+
sessionId,
|
|
31
|
+
children: h(FileExplorer, { rootPath, enabled: true, active, onOpenFile }),
|
|
32
|
+
}),
|
|
33
|
+
container,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
for (let i = 0; i < 10; i += 1) await act(async () => {});
|
|
37
|
+
}
|