@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
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
iconTone,
|
|
27
27
|
} from '@/shared/lib/icons/tint';
|
|
28
28
|
import { ICON_HUES, ICON_TONES, ICON_TONES_DARK } from '@/shared/lib/icons/tint-hues.generated';
|
|
29
|
-
import { oklchOf } from '@/shared/lib/icons/icon-tone';
|
|
29
|
+
import { oklchOf, PAPER_BUCKETS, paperBucketOf } from '@/shared/lib/icons/icon-tone';
|
|
30
30
|
import { THEMES } from '@/shared/lib/theme/catalog';
|
|
31
31
|
import { BRAND_CONTRAST_FLOOR, contrastRatio } from '@/shared/lib/theme/legibility';
|
|
32
32
|
|
|
@@ -90,15 +90,22 @@ describe('the generated hues', () => {
|
|
|
90
90
|
expect(check.exitCode, check.stderr.toString()).toBe(0);
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
test('every light tone clears the
|
|
94
|
-
// The
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
93
|
+
test('every light tone clears the floor on every paper of ITS OWN bucket', () => {
|
|
94
|
+
// The light table is split by paper bucket, and that split is only legal
|
|
95
|
+
// because each bucket is solved against its own darkest paper. Clearing the
|
|
96
|
+
// floor on the catalog's darkest paper instead would make the buckets
|
|
97
|
+
// pointless; clearing it only against the bucket's paper is what makes a
|
|
98
|
+
// brighter palette paint a brighter icon.
|
|
99
|
+
for (const bucket of PAPER_BUCKETS) {
|
|
100
|
+
const papers = THEMES.filter((theme) => theme.variant === 'light' && paperBucketOf(theme.paper) === bucket).map(
|
|
101
|
+
(theme) => theme.paper,
|
|
102
|
+
);
|
|
103
|
+
expect(papers.length, `${bucket} has palettes`).toBeGreaterThan(0);
|
|
104
|
+
for (const [hue, tone] of Object.entries(ICON_TONES[bucket])) {
|
|
105
|
+
expect(tone, `${bucket} ${hue}`).toMatch(/^#[0-9a-f]{6}$/);
|
|
106
|
+
const worst = Math.min(...papers.map((paper) => contrastRatio(tone, paper)));
|
|
107
|
+
expect(worst, `${bucket} hue ${hue} (${tone})`).toBeGreaterThanOrEqual(BRAND_CONTRAST_FLOOR);
|
|
108
|
+
}
|
|
102
109
|
}
|
|
103
110
|
});
|
|
104
111
|
|
|
@@ -122,10 +129,11 @@ describe('the generated hues', () => {
|
|
|
122
129
|
// the wheel uneven — a blue icon visibly heavier than the yellow beside it.
|
|
123
130
|
// Measured after the solve, light spreads 0.04 and dark 0.08, and the
|
|
124
131
|
// muddiest dark row goes from chroma 0.082 to 0.133.
|
|
125
|
-
|
|
126
|
-
[
|
|
127
|
-
['dark', ICON_TONES_DARK, 0.1, 0.12],
|
|
128
|
-
]
|
|
132
|
+
const tables: ReadonlyArray<readonly [string, Readonly<Record<number, string>>, number, number]> = [
|
|
133
|
+
...PAPER_BUCKETS.map((bucket) => [`light/${bucket}`, ICON_TONES[bucket], 0.06, 0.09] as const),
|
|
134
|
+
['dark', ICON_TONES_DARK, 0.1, 0.12] as const,
|
|
135
|
+
];
|
|
136
|
+
for (const [label, table, maxSpread, minChroma] of tables) {
|
|
129
137
|
const tones = Object.values(table).map((tone) => oklchOf(tone));
|
|
130
138
|
const lightnesses = tones.map((tone) => tone.lightness);
|
|
131
139
|
const spread = Math.max(...lightnesses) - Math.min(...lightnesses);
|
|
@@ -137,8 +145,8 @@ describe('the generated hues', () => {
|
|
|
137
145
|
test('a hue keeps its identity across variants', () => {
|
|
138
146
|
// A glyph must be "the same colour" on both themes, or switching the palette
|
|
139
147
|
// silently recolours every icon in the app.
|
|
140
|
-
for (const hue of Object.keys(ICON_TONES)) {
|
|
141
|
-
const light = oklchOf(ICON_TONES[Number(hue)]!).hue;
|
|
148
|
+
for (const hue of Object.keys(ICON_TONES.bright)) {
|
|
149
|
+
const light = oklchOf(ICON_TONES.bright[Number(hue)]!).hue;
|
|
142
150
|
const dark = oklchOf(ICON_TONES_DARK[Number(hue)]!).hue;
|
|
143
151
|
const drift = Math.min(Math.abs(light - dark), 360 - Math.abs(light - dark));
|
|
144
152
|
expect(drift, `hue ${hue}`).toBeLessThan(12);
|
|
@@ -152,15 +160,15 @@ describe('the generated hues', () => {
|
|
|
152
160
|
// every hue on the wheel. Solving per hue is what buys the colour back, and
|
|
153
161
|
// this is the assertion that would fail if a future edit quietly put a
|
|
154
162
|
// uniform pair back.
|
|
155
|
-
const hues = Object.keys(ICON_TONES).map(Number);
|
|
163
|
+
const hues = Object.keys(ICON_TONES.deepest).map(Number);
|
|
156
164
|
const mean = (values: number[]) => values.reduce((a, b) => a + b, 0) / values.length;
|
|
157
165
|
const before = hues.map((hue) => oklchOf(hslHex(hue, ICON_HUE_PAINT.light.saturation, ICON_HUE_PAINT.light.lightness)).chroma);
|
|
158
|
-
const after = hues.map((hue) => oklchOf(ICON_TONES[hue]!).chroma);
|
|
166
|
+
const after = hues.map((hue) => oklchOf(ICON_TONES.deepest[hue]!).chroma);
|
|
159
167
|
expect(mean(after)).toBeGreaterThan(mean(before) * 1.3);
|
|
160
168
|
// Every single hue must improve — a table that traded one muddy row for
|
|
161
169
|
// another would still pass the mean.
|
|
162
170
|
for (const hue of hues) {
|
|
163
|
-
expect(oklchOf(ICON_TONES[hue]!).chroma, `hue ${hue}`).toBeGreaterThan(
|
|
171
|
+
expect(oklchOf(ICON_TONES.deepest[hue]!).chroma, `hue ${hue}`).toBeGreaterThan(
|
|
164
172
|
oklchOf(hslHex(hue, ICON_HUE_PAINT.light.saturation, ICON_HUE_PAINT.light.lightness)).chroma,
|
|
165
173
|
);
|
|
166
174
|
}
|
|
@@ -170,7 +178,7 @@ describe('the generated hues', () => {
|
|
|
170
178
|
// Solved in OKLCH, but the hue is the OKLCH angle of the OLD paint: a tone
|
|
171
179
|
// that drifted would recolour every icon in the app, which is not what
|
|
172
180
|
// "more colour" means.
|
|
173
|
-
for (const [hue, tone] of Object.entries(ICON_TONES)) {
|
|
181
|
+
for (const [hue, tone] of Object.entries(ICON_TONES.deepest)) {
|
|
174
182
|
const before = oklchOf(hslHex(Number(hue), ICON_HUE_PAINT.light.saturation, ICON_HUE_PAINT.light.lightness)).hue;
|
|
175
183
|
const after = oklchOf(tone).hue;
|
|
176
184
|
const circular = Math.min(Math.abs(before - after), 360 - Math.abs(before - after));
|
|
@@ -179,12 +187,14 @@ describe('the generated hues', () => {
|
|
|
179
187
|
});
|
|
180
188
|
|
|
181
189
|
test('the light tone is a table lookup, not a solve, and it snaps to the wheel', () => {
|
|
182
|
-
|
|
190
|
+
// No paper means the deepest bucket: the conservative answer, not the
|
|
191
|
+
// flattering one — a caller with no palette context still gets a legal colour.
|
|
192
|
+
expect(iconTone(120)).toBe(ICON_TONES.deepest[120]!);
|
|
183
193
|
// `hashHue` only produces wheel steps, but a stored or plugin name could
|
|
184
194
|
// still reach here with something else; the nearest step keeps it a colour.
|
|
185
|
-
expect(iconTone(124)).toBe(ICON_TONES[120]!);
|
|
186
|
-
expect(iconTone(356)).toBe(ICON_TONES[0]!);
|
|
187
|
-
expect(iconTone(-10)).toBe(ICON_TONES[350]!);
|
|
195
|
+
expect(iconTone(124)).toBe(ICON_TONES.deepest[120]!);
|
|
196
|
+
expect(iconTone(356)).toBe(ICON_TONES.deepest[0]!);
|
|
197
|
+
expect(iconTone(-10)).toBe(ICON_TONES.deepest[350]!);
|
|
188
198
|
});
|
|
189
199
|
|
|
190
200
|
test('the paint rule and the concrete colour share one formula', () => {
|
|
@@ -198,7 +208,7 @@ describe('the generated hues', () => {
|
|
|
198
208
|
expect(iconHuePaint('dark')).toBe(
|
|
199
209
|
`var(--icon-tone-dark, hsl(var(--icon-hue, ${DEFAULT_ICON_HUE}) ${ICON_HUE_PAINT.dark.saturation}% ${ICON_HUE_PAINT.dark.lightness}%))`,
|
|
200
210
|
);
|
|
201
|
-
expect(iconTone(120, 'light')).toBe(ICON_TONES[120]!);
|
|
211
|
+
expect(iconTone(120, 'light')).toBe(ICON_TONES.deepest[120]!);
|
|
202
212
|
expect(iconTone(120, 'dark')).toBe(ICON_TONES_DARK[120]!);
|
|
203
213
|
});
|
|
204
214
|
|
|
@@ -255,3 +265,47 @@ describe('the generated hues', () => {
|
|
|
255
265
|
expect(classes.every((className) => className.startsWith('lucide-'))).toBe(true);
|
|
256
266
|
});
|
|
257
267
|
});
|
|
268
|
+
|
|
269
|
+
describe('the paper buckets', () => {
|
|
270
|
+
test('a brighter paper paints a brighter icon, monotonically', () => {
|
|
271
|
+
// The whole reason the table is split. Measured over the shipped palettes:
|
|
272
|
+
// deep 0.589, mid 0.624, bright 0.641, against dark's 0.782 and the old
|
|
273
|
+
// single table's 0.589 on every light palette.
|
|
274
|
+
const meanLightness = (bucket: (typeof PAPER_BUCKETS)[number]) => {
|
|
275
|
+
const tones = Object.values(ICON_TONES[bucket]);
|
|
276
|
+
return tones.reduce((sum, tone) => sum + oklchOf(tone).lightness, 0) / tones.length;
|
|
277
|
+
};
|
|
278
|
+
const values = PAPER_BUCKETS.map(meanLightness);
|
|
279
|
+
// STRICTLY increasing: each bucket is solved against its own darkest paper, so
|
|
280
|
+
// a brighter paper can never paint a darker icon. Measured across the six:
|
|
281
|
+
// 0.590, 0.619, 0.629, 0.636, 0.644, 0.657.
|
|
282
|
+
for (let i = 1; i < values.length; i += 1) {
|
|
283
|
+
expect(values[i]!, `${PAPER_BUCKETS[i]}`).toBeGreaterThan(values[i - 1]!);
|
|
284
|
+
}
|
|
285
|
+
expect(values[0]!).toBeLessThan(0.6);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
test('every bucket groups the palettes it claims to', () => {
|
|
289
|
+
// The buckets are ranges of RELATIVE LUMINANCE, which is the quantity
|
|
290
|
+
// contrast is computed from. A paper on a boundary must land in exactly one
|
|
291
|
+
// bucket, and every light palette must be reachable by one.
|
|
292
|
+
for (const theme of THEMES.filter((entry) => entry.variant === 'light')) {
|
|
293
|
+
const bucket = paperBucketOf(theme.paper);
|
|
294
|
+
expect(PAPER_BUCKETS, `${theme.id}`).toContain(bucket);
|
|
295
|
+
}
|
|
296
|
+
// The catalog's darkest and lightest light papers land in different buckets,
|
|
297
|
+
// which is what makes the split worth having.
|
|
298
|
+
expect(paperBucketOf('#dee0ee')).toBe('deepest');
|
|
299
|
+
expect(paperBucketOf('#ffffff')).toBe('bright');
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
test('a caller with no palette gets the deepest bucket', () => {
|
|
303
|
+
// The conservative answer: a colour that every light palette clears, rather
|
|
304
|
+
// than the flattering one that only a bright paper allows.
|
|
305
|
+
expect(iconTone(120)).toBe(ICON_TONES.deepest[120]!);
|
|
306
|
+
expect(iconTone(120, 'light', '#ffffff')).toBe(ICON_TONES.bright[120]!);
|
|
307
|
+
expect(iconTone(120, 'light', '#faf8f3')).toBe(ICON_TONES.mid[120]!);
|
|
308
|
+
// Dark has one band, so a paper cannot change it.
|
|
309
|
+
expect(iconTone(120, 'dark', '#ffffff')).toBe(iconTone(120, 'dark', '#dee0ee'));
|
|
310
|
+
});
|
|
311
|
+
});
|
|
@@ -31,7 +31,12 @@
|
|
|
31
31
|
* is the single translation to `lucide-trash-2`.
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
ICON_HUES,
|
|
36
|
+
ICON_TONES,
|
|
37
|
+
ICON_TONES_DARK,
|
|
38
|
+
} from '@/shared/lib/icons/tint-hues.generated';
|
|
39
|
+
import { paperBucketOf, type PaperBucket } from '@/shared/lib/icons/icon-tone';
|
|
35
40
|
|
|
36
41
|
export type IconTintRole = 'error' | 'success' | 'warning' | 'info';
|
|
37
42
|
|
|
@@ -70,20 +75,75 @@ function wheelStep(hue: number): number {
|
|
|
70
75
|
*
|
|
71
76
|
* Measured, this is the difference the report named — on the light side the
|
|
72
77
|
* muddiest row (hue 190) goes from OKLCH chroma 0.075 to 0.102, hue 200 from
|
|
73
|
-
* 0.078 to 0.121, and the mean from 0.121 to 0.162 (×1.34)
|
|
74
|
-
*
|
|
75
|
-
* solve collapses a lightness spread of 0.25 into 0.08 while RAISING mean
|
|
78
|
+
* 0.078 to 0.121, and the mean from 0.121 to 0.162 (×1.34). On the dark side the
|
|
79
|
+
* same solve collapses a lightness spread of 0.25 into 0.08 while RAISING mean
|
|
76
80
|
* chroma 0.126 → 0.170. `icon-tone.ts` states both measurements.
|
|
77
81
|
*
|
|
82
|
+
* **The light table is keyed by PAPER BUCKET, and that is the fix for "light mode
|
|
83
|
+
* kusam".** One table has to clear the floor on the darkest light paper in the
|
|
84
|
+
* catalog, so every palette with a brighter paper painted an icon at lightness
|
|
85
|
+
* it did not need: measured on the default `paper`, mean L 0.582 where the paper
|
|
86
|
+
* allows 0.640, against dark's 0.782. Passing the palette's own paper picks one
|
|
87
|
+
* of three solved tables — `deep` 0.589, `mid` 0.624, `bright` 0.641 — and every
|
|
88
|
+
* row still clears 3.15:1 on every paper of its own bucket.
|
|
89
|
+
*
|
|
90
|
+
* `paper` is optional so a caller with no palette context (a test, a preview)
|
|
91
|
+
* still gets a legal colour; it defaults to the deepest bucket, which is the
|
|
92
|
+
* conservative answer rather than the flattering one.
|
|
93
|
+
*
|
|
78
94
|
* A hue off the wheel snaps to the nearest step: every producer here is a
|
|
79
95
|
* `hashHue` result (36 steps of 10°) or a table row, so the nearest step IS that
|
|
80
96
|
* hue; snapping is what keeps this a table lookup rather than a solve on load.
|
|
81
97
|
*/
|
|
82
|
-
export function iconTone(hue: number, variant: 'light' | 'dark' = 'light'): string {
|
|
83
|
-
const table
|
|
98
|
+
export function iconTone(hue: number, variant: 'light' | 'dark' = 'light', paper?: string): string {
|
|
99
|
+
const table: Readonly<Record<number, string>> =
|
|
100
|
+
variant === 'dark' ? ICON_TONES_DARK : ICON_TONES[paper ? paperBucketOf(paper) : 'deepest'];
|
|
84
101
|
return table[wheelStep(hue)] ?? table[0]!;
|
|
85
102
|
}
|
|
86
103
|
|
|
104
|
+
/**
|
|
105
|
+
* The custom property each bucket reads, and the attribute that selects it.
|
|
106
|
+
*
|
|
107
|
+
* `data-icon-paper` is written on `<html>` by `applyIconStyle`, from the palette
|
|
108
|
+
* the document is actually painting — the same single-writer contract as
|
|
109
|
+
* `data-icon-style`. It is an ATTRIBUTE rather than a resolved colour because the
|
|
110
|
+
* palette can change at runtime (`applyDocumentTheme`), and re-stamping every
|
|
111
|
+
* mark on screen is not something a theme switch should have to do.
|
|
112
|
+
*/
|
|
113
|
+
export const ICON_TONE_VARIABLE: Readonly<Record<PaperBucket | 'dark', string>> = {
|
|
114
|
+
deepest: '--icon-tone',
|
|
115
|
+
deeper: '--icon-tone-deeper',
|
|
116
|
+
deep: '--icon-tone-deep',
|
|
117
|
+
mid: '--icon-tone-mid',
|
|
118
|
+
light: '--icon-tone-light',
|
|
119
|
+
bright: '--icon-tone-bright',
|
|
120
|
+
dark: '--icon-tone-dark',
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* One representative paper per bucket, for a producer that must STAMP every
|
|
125
|
+
* bucket's tone (`PanelMark`, `PluginMark`).
|
|
126
|
+
*
|
|
127
|
+
* `iconTone` selects its table by the paper's bucket, so passing a sample paper
|
|
128
|
+
* from each bucket yields exactly the three solved values without exposing the
|
|
129
|
+
* table shape to a component.
|
|
130
|
+
*/
|
|
131
|
+
export const PAPER_BUCKET_SAMPLE: Readonly<Record<PaperBucket, string>> = {
|
|
132
|
+
deepest: '#dee0ee',
|
|
133
|
+
deeper: '#f1ebfb',
|
|
134
|
+
deep: '#f1f1f0',
|
|
135
|
+
mid: '#f0f5fa',
|
|
136
|
+
light: '#faf8f3',
|
|
137
|
+
bright: '#ffffff',
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/** Document attribute carrying the paper bucket. Read by CSS only. */
|
|
141
|
+
export const ICON_PAPER_ATTRIBUTE = 'data-icon-paper';
|
|
142
|
+
|
|
143
|
+
/** The tone of a hue in every bucket, for the stylesheet's per-bucket variables. */
|
|
144
|
+
export const ICON_TONE_BUCKETS: ReadonlyArray<readonly [PaperBucket, Readonly<Record<number, string>>]> =
|
|
145
|
+
Object.entries(ICON_TONES) as ReadonlyArray<readonly [PaperBucket, Readonly<Record<number, string>>]>;
|
|
146
|
+
|
|
87
147
|
/**
|
|
88
148
|
* The paint rule's value: the hue left to the custom property the class sets.
|
|
89
149
|
*
|
|
@@ -56,7 +56,16 @@ export function notifyModelsUpdated(): void {
|
|
|
56
56
|
/**
|
|
57
57
|
* Observe the `models` topic. The callback fires when the catalog changed, so
|
|
58
58
|
* the caller can re-project its own view from `fetchModelsData`.
|
|
59
|
+
*
|
|
60
|
+
* The local cache is dropped BEFORE the handler runs: the event exists because
|
|
61
|
+
* the server's answer changed, and a 60s answer cached before it would otherwise
|
|
62
|
+
* be handed straight back to a handler that is trying to re-read the catalog
|
|
63
|
+
* (measured: adding a provider left the composer's picker on the old list until
|
|
64
|
+
* the page was reloaded, even though the topic had fired).
|
|
59
65
|
*/
|
|
60
66
|
export function subscribeModelsUpdated(handler: () => void): () => void {
|
|
61
|
-
return realtimeClient.subscribe(TOPIC_MODELS,
|
|
67
|
+
return realtimeClient.subscribe(TOPIC_MODELS, () => {
|
|
68
|
+
invalidateModelsCache();
|
|
69
|
+
handler();
|
|
70
|
+
});
|
|
62
71
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The provider ids the VENDOR ships, as opposed to the ones a user registered.
|
|
8
|
+
*
|
|
9
|
+
* This is the one fact the provider-import surfaces turn on: copying `anthropic`
|
|
10
|
+
* out of omp into codex would write an override of the target's own built-in
|
|
11
|
+
* provider instead of adding a gateway, and offering it as an import row
|
|
12
|
+
* promises an action that either collides or does nothing. `customProvidersOnly`
|
|
13
|
+
* filters with this list.
|
|
14
|
+
*
|
|
15
|
+
* The census is omp 18.3.0's `KnownProvider` set plus the ids the other agents
|
|
16
|
+
* vendor themselves — measured, and pinned by `glyph.test.ts`, which walks every
|
|
17
|
+
* id here and fails if a provider would draw neither a mark nor initials. A
|
|
18
|
+
* provider added upstream is one row here, not a new branch at a call site.
|
|
19
|
+
*
|
|
20
|
+
* Deliberately NOT here: user-registered slugs (`kenari`, `agentrouter`,
|
|
21
|
+
* `custom`), which are the rows an import is FOR.
|
|
22
|
+
*/
|
|
23
|
+
export const VENDOR_PROVIDER_IDS: readonly string[] = [
|
|
24
|
+
'abliteration', 'aiand', 'aimlapi', 'alibaba-coding-plan', 'alibaba-token-plan', 'amazon-bedrock',
|
|
25
|
+
'anthropic', 'apple', 'azure', 'baseten', 'bedrock-mantle', 'cerebras', 'charm-hyper', 'cline-pass',
|
|
26
|
+
'cloudflare-ai-gateway', 'commandcode', 'coreweave', 'cursor', 'deepinfra', 'deepseek', 'devin',
|
|
27
|
+
'firepass', 'fireworks', 'github-copilot', 'gitlab-duo', 'gitlab-duo-agent', 'gmi-cloud', 'google',
|
|
28
|
+
'google-antigravity', 'google-gemini-cli', 'google-vertex', 'groq', 'huggingface', 'kilo',
|
|
29
|
+
'kimi-code', 'litellm', 'llama.cpp', 'lm-studio', 'local', 'meta', 'minimax', 'minimax-code',
|
|
30
|
+
'minimax-code-cn', 'mistral', 'moonshot', 'muse-code', 'nanogpt', 'novita', 'nvidia', 'ollama',
|
|
31
|
+
'ollama-cloud', 'openai', 'openai-codex', 'openai-codex-device', 'opencode-go', 'opencode-zen',
|
|
32
|
+
'openrouter', 'qianfan', 'qwen-portal', 'sakana', 'siliconflow', 'siliconflow-cn',
|
|
33
|
+
'singularityapi-dev', 'singularityapi-tech', 'stepfun', 'synthetic', 'together', 'typesafe',
|
|
34
|
+
'umans', 'venice', 'vercel-ai-gateway', 'vllm', 'wafer-serverless', 'xai', 'xai-oauth', 'xiaomi',
|
|
35
|
+
'xiaomi-token-plan-ams', 'xiaomi-token-plan-cn', 'xiaomi-token-plan-sgp', 'yolo-auto', 'zai',
|
|
36
|
+
'zhipu-coding-plan', 'zhipu', 'zenmux', 'qwen-oauth', 'ollama-chat',
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const VENDOR_SET: ReadonlySet<string> = new Set(VENDOR_PROVIDER_IDS.map(fold));
|
|
40
|
+
|
|
41
|
+
/** Fold a provider id to the shape the census compares (`Llama.CPP` = `llamacpp`). */
|
|
42
|
+
function fold(id: string): string {
|
|
43
|
+
return id.trim().toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* True when the id names a provider the vendor ships, or one this registry
|
|
48
|
+
* declares as its own (`extra`).
|
|
49
|
+
*
|
|
50
|
+
* A registry's own list wins where it is authoritative (codex reserves
|
|
51
|
+
* `openai`/`ollama`/`lmstudio`, qwen cannot override `qwen-oauth`), because a
|
|
52
|
+
* registry may ship a provider the shared census has never heard of.
|
|
53
|
+
*/
|
|
54
|
+
export function isVendorProviderId(id: string, extra?: readonly string[]): boolean {
|
|
55
|
+
const key = fold(id);
|
|
56
|
+
if (!key) return true;
|
|
57
|
+
if (extra?.some((entry) => fold(entry) === key)) return true;
|
|
58
|
+
return VENDOR_SET.has(key);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The CUSTOM rows of a provider list — the only ones an import may offer.
|
|
63
|
+
*
|
|
64
|
+
* Kept as a predicate over ids so a reader can apply it to a map's keys before
|
|
65
|
+
* it has built entries, and a test can assert the rule without a registry file.
|
|
66
|
+
*/
|
|
67
|
+
export function customProviderIds(
|
|
68
|
+
ids: readonly string[],
|
|
69
|
+
extra?: readonly string[],
|
|
70
|
+
): string[] {
|
|
71
|
+
return ids.filter((id) => !isVendorProviderId(id, extra));
|
|
72
|
+
}
|
|
@@ -125,6 +125,42 @@ describe('OMP_SCHEMA', () => {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
|
+
|
|
129
|
+
test('the rows omp 18.17.0 adds are offered', () => {
|
|
130
|
+
// Measured against `omp config list --json` on 18.17.0: all twelve exist and
|
|
131
|
+
// every one is accepted by `omp config set`. Most are TUI-only surfaces
|
|
132
|
+
// Kabmo does not draw, but the panel is the only place a user CAN reach an
|
|
133
|
+
// omp setting, so a regenerated schema that drops them removes the row.
|
|
134
|
+
const expected: Record<string, { type: SchemaEntry['type']; tab: string; group: string }> = {
|
|
135
|
+
'display.shellVisualization': { type: 'boolean', tab: 'appearance', group: 'Display' },
|
|
136
|
+
'tui.colorfulMarkdown': { type: 'boolean', tab: 'appearance', group: 'Display' },
|
|
137
|
+
'tui.motion': { type: 'enum', tab: 'appearance', group: 'Display' },
|
|
138
|
+
'tui.maxFps': { type: 'number', tab: 'appearance', group: 'Display' },
|
|
139
|
+
'tui.spinnerInterval': { type: 'number', tab: 'appearance', group: 'Display' },
|
|
140
|
+
'extensionRenderers.transcriptPresenters': { type: 'boolean', tab: 'tools', group: 'Extensions' },
|
|
141
|
+
'spotlight.experiment.enabled': { type: 'boolean', tab: 'tools', group: 'Developer' },
|
|
142
|
+
'magicKeywords.chillax': { type: 'boolean', tab: 'interaction', group: 'Magic Keywords' },
|
|
143
|
+
'update.auto': { type: 'boolean', tab: 'interaction', group: 'Startup & Updates' },
|
|
144
|
+
'ovnfs.path': { type: 'string', tab: 'tasks', group: 'Isolation' },
|
|
145
|
+
'task.workerThreads': { type: 'number', tab: 'tasks', group: 'Subagents' },
|
|
146
|
+
'providers.openaiResponsesWebsockets': { type: 'boolean', tab: 'providers', group: 'Protocol' },
|
|
147
|
+
};
|
|
148
|
+
for (const [key, want] of Object.entries(expected)) {
|
|
149
|
+
const entry = OMP_SCHEMA.entries[key];
|
|
150
|
+
expect({ key, entry: entry && { type: entry.type, tab: entry.ui.tab, group: entry.ui.group } }).toEqual({
|
|
151
|
+
key,
|
|
152
|
+
entry: want,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test('a default that moved upstream moves here too', () => {
|
|
158
|
+
// 18.17.0 changed `textVerbosity`'s default from `medium` to `low` — the
|
|
159
|
+
// panel shows the schema's default, so a stale row would offer the old one.
|
|
160
|
+
expect(OMP_SCHEMA.entries.textVerbosity?.default).toBe('low');
|
|
161
|
+
// …and `edit.mode` gained `none`, which removes the `edit` tool.
|
|
162
|
+
expect(OMP_SCHEMA.entries['edit.mode']?.values).toContain('none');
|
|
163
|
+
});
|
|
128
164
|
});
|
|
129
165
|
|
|
130
166
|
describe('ALL_SCHEMA_ENTRIES', () => {
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
* fire-and-forget and must never be listed here: remembering one would offer a
|
|
22
22
|
* later client a modal nothing is waiting on.
|
|
23
23
|
*
|
|
24
|
-
* `'ask'` belongs here because
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* `'ask'` belongs here because a grouped ask dialog parks the agent until an
|
|
25
|
+
* answer arrives: omp's own `ask` tool took that path before 18.18.3, and
|
|
26
|
+
* extensions and the ratchet still open it. The tool's current form-driven walk
|
|
27
|
+
* parks on an ordinary `select`/`input`/`editor`, which is listed too.
|
|
27
28
|
*/
|
|
28
29
|
|
|
29
30
|
import type { ExtensionUiDialogMethod, ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What a transcript read drops before it reaches a card.
|
|
8
|
+
*
|
|
9
|
+
* omp 18.17.0 writes its embedded shell's trace into the JSONL beside the `bash`
|
|
10
|
+
* result (measured: a 201 KB trace for `seq 1 30000`, its `history` a second
|
|
11
|
+
* copy of the output). A reload is the one path that reads those bytes back, so
|
|
12
|
+
* it is the one place the field has to go — see
|
|
13
|
+
* `shared/lib/omp/session/shell-trace.ts`.
|
|
14
|
+
*
|
|
15
|
+
* Split from `messages-map.test.ts`, which sits at the repo's per-file ceiling;
|
|
16
|
+
* the sibling `messages-map-pending.test.ts` follows the same split.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { describe, expect, test } from 'bun:test';
|
|
20
|
+
import { collectToolOutputs } from '@/shared/lib/omp/session/messages-map';
|
|
21
|
+
|
|
22
|
+
const result = (callId: string, text: string, details: Record<string, unknown>) => ({
|
|
23
|
+
type: 'message',
|
|
24
|
+
message: { role: 'toolResult', toolCallId: callId, content: [{ type: 'text', text }], details },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('collectToolOutputs — the shell trace', () => {
|
|
28
|
+
test('drops `details.trace` and keeps every other field', () => {
|
|
29
|
+
const outputs = collectToolOutputs([
|
|
30
|
+
result('c', 'out', {
|
|
31
|
+
exitCode: 0,
|
|
32
|
+
trace: { v: 1, seq: 9, units: [], history: [{ kind: 'RunStart' }] },
|
|
33
|
+
}),
|
|
34
|
+
]);
|
|
35
|
+
expect(outputs.get('c')?.details).toEqual({ exitCode: 0 });
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('leaves a result with no trace alone', () => {
|
|
39
|
+
const outputs = collectToolOutputs([result('c', 'out', { exitCode: 0, wallTimeMs: 12 })]);
|
|
40
|
+
expect(outputs.get('c')?.details).toEqual({ exitCode: 0, wallTimeMs: 12 });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -7,6 +7,7 @@ import type { ChatMessageData } from '@/shared/types/chat';
|
|
|
7
7
|
import { extractInlinedTextAttachments, extractText, extractUserImageAttachments, parseAssistantContent, resultOutput, roleFor, stripInlinedTextAttachments, type OmpMessageEntry } from '@/shared/lib/omp/session/messages-parse';
|
|
8
8
|
import { extractToolImages, type ToolImageRef } from '@/shared/lib/omp/session/tool-images';
|
|
9
9
|
import { isRecord } from '@/shared/lib/util/guards';
|
|
10
|
+
import { withoutShellTrace } from '@/shared/lib/omp/session/shell-trace';
|
|
10
11
|
import { normalizeNoticeText } from '@/shared/lib/chat/notice-text';
|
|
11
12
|
import { developerTurnNotice, reminderPartIndex } from '@/shared/lib/chat/notice-row';
|
|
12
13
|
import { deriveTurnError } from '@/shared/lib/omp/session/turn-error';
|
|
@@ -228,7 +229,11 @@ export function collectToolOutputs(records: Record<string, unknown>[]): Map<stri
|
|
|
228
229
|
output = `${existing.output}\n${text}`;
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
|
-
|
|
232
|
+
// omp writes its embedded-shell trace into the JSONL too (18.17.0), so a
|
|
233
|
+
// reloaded `bash` result is as heavy as a live one until it is dropped here.
|
|
234
|
+
const details =
|
|
235
|
+
withoutShellTrace(isRecord(msg.details) ? (msg.details as Record<string, unknown>) : undefined) ||
|
|
236
|
+
existing?.details;
|
|
232
237
|
const isError = msg.isError === true || existing?.isError;
|
|
233
238
|
const images = extractToolImages(msg.content);
|
|
234
239
|
// The result's own timestamp closes the span the start entry opened.
|
|
@@ -55,6 +55,14 @@ describe('toToolCallData', () => {
|
|
|
55
55
|
expect(toToolCallData(parsed, { streaming: false, isError: true }).status).toBe('error');
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
test('a transport-supplied type outranks name inference', () => {
|
|
59
|
+
// ACP `kind:"execute"` with a vendor name (`VendorWidget`) must still draw
|
|
60
|
+
// the bash panel; inference from that name alone would fall back to custom.
|
|
61
|
+
const acp: ParsedToolCall = { ...parsed, name: 'VendorWidget', title: 'VendorWidget — ls', toolType: 'bash' };
|
|
62
|
+
expect(toToolCallData(acp, { streaming: false }).type).toBe('bash');
|
|
63
|
+
expect(toToolCallData({ ...parsed, name: 'VendorWidget' }, { streaming: false }).type).toBe('custom');
|
|
64
|
+
});
|
|
65
|
+
|
|
58
66
|
test('maps identity, type and the parsed detail fields through', () => {
|
|
59
67
|
const data = toToolCallData(parsed, { streaming: false });
|
|
60
68
|
expect(data.id).toBe('c1');
|
|
@@ -37,6 +37,9 @@ export interface ParsedToolCall {
|
|
|
37
37
|
id: string;
|
|
38
38
|
name: string;
|
|
39
39
|
title: string;
|
|
40
|
+
/** The transport's own renderer key, when it knows one (ACP `kind`). The
|
|
41
|
+
* shared inference below is a fallback for providers that only send a name. */
|
|
42
|
+
toolType?: ToolType;
|
|
40
43
|
intent?: string;
|
|
41
44
|
target?: string;
|
|
42
45
|
command?: string;
|
|
@@ -113,6 +116,7 @@ export function parseMessageBlocks(content: unknown): ParsedMessageBlocks {
|
|
|
113
116
|
toolCallId?: unknown;
|
|
114
117
|
arguments?: unknown;
|
|
115
118
|
input?: unknown;
|
|
119
|
+
toolType?: unknown;
|
|
116
120
|
};
|
|
117
121
|
if (block.type === 'thinking') {
|
|
118
122
|
const body = typeof block.thinking === 'string'
|
|
@@ -150,6 +154,7 @@ export function parseMessageBlocks(content: unknown): ParsedMessageBlocks {
|
|
|
150
154
|
id,
|
|
151
155
|
name,
|
|
152
156
|
title: detail ? `${name} — ${detail}` : name,
|
|
157
|
+
...(typeof block.toolType === 'string' ? { toolType: block.toolType as ToolType } : {}),
|
|
153
158
|
intent,
|
|
154
159
|
target: target || undefined,
|
|
155
160
|
command: command || undefined,
|
|
@@ -194,7 +199,7 @@ export function toToolCallData(
|
|
|
194
199
|
: options.streaming ? 'running' : 'success';
|
|
195
200
|
return {
|
|
196
201
|
id: parsed.id,
|
|
197
|
-
type: inferToolType(parsed.name),
|
|
202
|
+
type: parsed.toolType ?? inferToolType(parsed.name),
|
|
198
203
|
name: parsed.name,
|
|
199
204
|
title: parsed.title,
|
|
200
205
|
intent: parsed.intent,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shell trace omp 18.17.0 attaches to every `bash` frame, and the two
|
|
8
|
+
* places Kabmo drops it: the live frame boundary and the transcript reload.
|
|
9
|
+
*
|
|
10
|
+
* Measured on 18.17.0: a 40-line command carried 192 KB of frames (19 KB on
|
|
11
|
+
* 18.16.0), a 40 000-line one 1.15 MB, and `seq 1 30000` left a 201 KB trace in
|
|
12
|
+
* the session JSONL — a second copy of the output, under `history`.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { describe, expect, test } from 'bun:test';
|
|
16
|
+
import { stripShellTrace, withoutShellTrace } from '@/shared/lib/omp/session/shell-trace';
|
|
17
|
+
|
|
18
|
+
const TRACE = { v: 1, seq: 29, status: 0, script: 'seq 1 3', units: [], history: [{ kind: 'RunStart' }] };
|
|
19
|
+
|
|
20
|
+
describe('withoutShellTrace', () => {
|
|
21
|
+
test('drops the trace and keeps every other field', () => {
|
|
22
|
+
const details: { wallTimeMs: number; meta: Record<string, unknown>; trace?: unknown } = {
|
|
23
|
+
wallTimeMs: 12,
|
|
24
|
+
meta: { truncation: { direction: 'middle' } },
|
|
25
|
+
trace: TRACE,
|
|
26
|
+
};
|
|
27
|
+
const lean = withoutShellTrace(details);
|
|
28
|
+
expect(lean).toEqual({ wallTimeMs: 12, meta: { truncation: { direction: 'middle' } } });
|
|
29
|
+
expect('trace' in lean).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('returns the SAME reference when there is nothing to drop', () => {
|
|
33
|
+
// Every tool but a live `bash` takes this path, so it must not allocate.
|
|
34
|
+
const details = { wallTimeMs: 12 };
|
|
35
|
+
expect(withoutShellTrace(details)).toBe(details);
|
|
36
|
+
expect(withoutShellTrace(undefined)).toBeUndefined();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('leaves a non-object details bag alone', () => {
|
|
40
|
+
expect(withoutShellTrace('text')).toBe('text');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('stripShellTrace', () => {
|
|
45
|
+
test('drops the trace from a progress frame', () => {
|
|
46
|
+
const frame = { type: 'tool_execution_update', partialResult: { content: [], details: { trace: TRACE } as Record<string, unknown> } };
|
|
47
|
+
stripShellTrace(frame);
|
|
48
|
+
expect(frame.partialResult.details).toEqual({});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('drops it from the end result and from the message that mirrors it', () => {
|
|
52
|
+
const frame = {
|
|
53
|
+
type: 'tool_execution_end',
|
|
54
|
+
result: { content: [], details: { exitCode: 0, trace: TRACE } as Record<string, unknown> },
|
|
55
|
+
message: { role: 'toolResult', details: { exitCode: 0, trace: TRACE } as Record<string, unknown> },
|
|
56
|
+
};
|
|
57
|
+
stripShellTrace(frame);
|
|
58
|
+
expect(frame.result.details).toEqual({ exitCode: 0 });
|
|
59
|
+
expect(frame.message.details).toEqual({ exitCode: 0 });
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('is a no-op for a frame with no trace or no details', () => {
|
|
63
|
+
const frame = { type: 'agent_start' };
|
|
64
|
+
expect(() => stripShellTrace(frame)).not.toThrow();
|
|
65
|
+
const other = { type: 'tool_execution_end', result: { content: [] } };
|
|
66
|
+
expect(() => stripShellTrace(other)).not.toThrow();
|
|
67
|
+
expect(other).toEqual({ type: 'tool_execution_end', result: { content: [] } });
|
|
68
|
+
});
|
|
69
|
+
});
|