@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
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The `bash` card for a result omp's shell minimizer rewrote (18.16.0)
|
|
7
|
+
* The `bash` card for a result omp's shell minimizer rewrote (18.16.0) and for a
|
|
8
|
+
* command that produced nothing at all (18.17.0).
|
|
8
9
|
*
|
|
9
10
|
* The panel used to draw the compressed body with nothing saying so: a
|
|
10
11
|
* `git --no-pager log` that lost 7 KB of commits looked like the command's own
|
|
@@ -48,7 +49,7 @@ afterAll(() => {
|
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
|
|
51
|
-
async function mount(details: Record<string, unknown
|
|
52
|
+
async function mount(details: Record<string, unknown>, output?: string): Promise<HTMLElement> {
|
|
52
53
|
container = document.createElement('div');
|
|
53
54
|
document.body.appendChild(container);
|
|
54
55
|
const tool = {
|
|
@@ -57,7 +58,7 @@ async function mount(details: Record<string, unknown>): Promise<HTMLElement> {
|
|
|
57
58
|
name: 'bash',
|
|
58
59
|
title: 'bash',
|
|
59
60
|
command: 'git --no-pager log',
|
|
60
|
-
output: 'b7b0b41 commit number 60\n6c1bd61 commit number 59',
|
|
61
|
+
output: output ?? 'b7b0b41 commit number 60\n6c1bd61 commit number 59',
|
|
61
62
|
status: 'success',
|
|
62
63
|
details,
|
|
63
64
|
} as ToolCallData;
|
|
@@ -86,3 +87,30 @@ describe('bash panel — minimized output', () => {
|
|
|
86
87
|
expect(el.textContent ?? '').not.toContain('Minimized');
|
|
87
88
|
});
|
|
88
89
|
});
|
|
90
|
+
|
|
91
|
+
describe('bash panel — a command that printed nothing', () => {
|
|
92
|
+
test('reads omp 18.17.0’s “(no output, exit code 0)” as silence, not as output', async () => {
|
|
93
|
+
// The placeholder became the tool's model-facing text in 18.17.0. Matching
|
|
94
|
+
// only the older "(no output)" put it in the console branch, so the card
|
|
95
|
+
// showed omp's own placeholder as if the command had printed it.
|
|
96
|
+
const el = await mount({ wallTimeMs: 8 }, '(no output, exit code 0)');
|
|
97
|
+
const text = el.textContent ?? '';
|
|
98
|
+
expect(text).toContain('Command executed successfully with no output');
|
|
99
|
+
expect(text).not.toContain('Console Output');
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('still reads the older placeholder', async () => {
|
|
103
|
+
const el = await mount({}, '(no output)');
|
|
104
|
+
expect(el.textContent ?? '').toContain('Command executed successfully with no output');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('bash panel — the directory the command ran in', () => {
|
|
109
|
+
test('shows details.cwd, the hoisted directory omp 18.18.0 names', async () => {
|
|
110
|
+
// `cd <dir>; …` is hoisted into the working directory now, and the result
|
|
111
|
+
// names it. The card read `details.cwd` before the field existed; this pins
|
|
112
|
+
// that the new input lands where a reader looks for it.
|
|
113
|
+
const el = await mount({ wallTimeMs: 9, cwd: '/tmp/hoisted' });
|
|
114
|
+
expect(el.textContent ?? '').toContain('/tmp/hoisted');
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -56,7 +56,11 @@ export function Bash({ tool }: { tool: ToolCallData }) {
|
|
|
56
56
|
const durationMs = typeof meta.durationMs === 'number' ? meta.durationMs : tool.durationMs;
|
|
57
57
|
const duration = tool.duration || wallTime || (durationMs ? `${durationMs}ms` : undefined);
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
// omp 18.17.0 spells a clean run with no output out in full — "(no output,
|
|
60
|
+
// exit code 0)" — so matching only the older "(no output)" pushed a command
|
|
61
|
+
// that printed nothing into the console branch, with omp's placeholder as its
|
|
62
|
+
// body.
|
|
63
|
+
const isSilent = !output || /^\(no output(?:, exit code 0)?\)$/.test(output.trim());
|
|
60
64
|
|
|
61
65
|
const jsonResult = useMemo(
|
|
62
66
|
() => (!isSilent && !tool.isError ? tryParseJson(output) : { isValid: false }),
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*
|
|
9
9
|
* What this pins is the answer to one question the generic fallback could not
|
|
10
10
|
* give: how long has this been waiting, and is anything still moving. Before
|
|
11
|
-
* the panel existed a call that can block for
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* the panel existed a call that can block for minutes rendered as a title and an
|
|
12
|
+
* empty Output block, while `details` already carried every job's status, its
|
|
13
|
+
* elapsed `durationMs` and a subagent's `completionPercent`.
|
|
14
14
|
*
|
|
15
15
|
* The progress bar's honesty is the load-bearing part: a `bash` job reports NO
|
|
16
16
|
* completion percentage, so the bar must sweep rather than claim a position,
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
* Rendered with `h()` against happy-dom, following `panels/Proc.test.ts`.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { afterAll, beforeAll, describe, expect,
|
|
23
|
-
import { WAIT_MAX_MS } from '@/shared/lib/omp/session/wait';
|
|
22
|
+
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
|
24
23
|
import { installWaitDom, mountWait as mount, restoreWaitDom, waitBar as bar } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/wait-test-util';
|
|
25
24
|
import type { ToolCallData } from '@/shared/types';
|
|
26
25
|
|
|
@@ -155,52 +154,42 @@ describe('Wait panel — running-task telemetry', () => {
|
|
|
155
154
|
});
|
|
156
155
|
});
|
|
157
156
|
|
|
158
|
-
describe('Wait panel —
|
|
159
|
-
test('
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const el = await mount({
|
|
174
|
-
...BLOCKING,
|
|
175
|
-
startedAt: now - 60_000,
|
|
176
|
-
details: { op: 'wait', jobs: [{ id: 'bg_1', type: 'bash', status: 'running', label: 'bun run e2e.ts', durationMs: 60_000 }] },
|
|
177
|
-
});
|
|
178
|
-
const text = el.textContent ?? '';
|
|
179
|
-
expect(text).toContain('29:00 left of 30:00');
|
|
180
|
-
} finally {
|
|
181
|
-
setSystemTime();
|
|
182
|
-
}
|
|
157
|
+
describe('Wait panel — an idle return', () => {
|
|
158
|
+
test('a blocking wait claims no ceiling, because omp 18.17.0 has none', async () => {
|
|
159
|
+
// The card used to count down to a 30-minute cap. That cap is gone: a wait
|
|
160
|
+
// returns when a window from the 5 s → 5 min ladder elapses, and the ladder
|
|
161
|
+
// climbs across back-to-back idle waits, so any countdown was a budget omp
|
|
162
|
+
// no longer has.
|
|
163
|
+
const el = await mount({
|
|
164
|
+
...BLOCKING,
|
|
165
|
+
startedAt: Date.now() - 60_000,
|
|
166
|
+
details: { op: 'wait', jobs: [{ id: 'bg_1', type: 'bash', status: 'running', label: 'bun run e2e.ts', durationMs: 60_000 }] },
|
|
167
|
+
});
|
|
168
|
+
const text = el.textContent ?? '';
|
|
169
|
+
expect(text).toContain('1:00');
|
|
170
|
+
expect(text).not.toContain('left of');
|
|
171
|
+
expect(text).not.toContain('30:00');
|
|
183
172
|
});
|
|
184
173
|
|
|
185
|
-
test('
|
|
186
|
-
// The
|
|
187
|
-
// returns — so
|
|
188
|
-
// as "no jobs" says the call found
|
|
189
|
-
//
|
|
174
|
+
test('names the window omp gave up after, not “no jobs”', async () => {
|
|
175
|
+
// The idle return answers `{op:'wait', jobs:[]}` — the same shape a service
|
|
176
|
+
// wake returns — so omp's own sentence is the only thing that tells them
|
|
177
|
+
// apart. Reading it as "no jobs" says the call looked and found none rather
|
|
178
|
+
// than that its window elapsed.
|
|
190
179
|
const el = await mount({
|
|
191
180
|
type: 'wait',
|
|
192
181
|
name: 'wait',
|
|
193
182
|
status: 'success',
|
|
194
|
-
durationMs:
|
|
195
|
-
output: '
|
|
183
|
+
durationMs: 5_000,
|
|
184
|
+
output: 'No reply within 5.0s.\n\n<system-notice>Nothing new after 15.0s of back-to-back waits. …</system-notice>',
|
|
196
185
|
details: { op: 'wait', jobs: [] },
|
|
197
186
|
});
|
|
198
187
|
const text = el.textContent ?? '';
|
|
199
|
-
expect(text).toContain('
|
|
200
|
-
expect(text).toContain('
|
|
188
|
+
expect(text).toContain('idle 15s total');
|
|
189
|
+
expect(text).not.toContain('no jobs');
|
|
201
190
|
});
|
|
202
191
|
|
|
203
|
-
test('a service wake is not
|
|
192
|
+
test('a service wake is not an idle return', async () => {
|
|
204
193
|
const el = await mount({
|
|
205
194
|
type: 'wait',
|
|
206
195
|
name: 'wait',
|
|
@@ -209,7 +198,9 @@ describe('Wait panel — the 30-minute cap', () => {
|
|
|
209
198
|
output: 'A service finished. Read proc:// for its status and output.',
|
|
210
199
|
details: { op: 'wait', jobs: [] },
|
|
211
200
|
});
|
|
212
|
-
|
|
201
|
+
const text = el.textContent ?? '';
|
|
202
|
+
expect(text).not.toContain('idle');
|
|
203
|
+
expect(text).not.toContain('no jobs');
|
|
213
204
|
});
|
|
214
205
|
});
|
|
215
206
|
|
|
@@ -245,9 +236,9 @@ describe('Wait panel — a settled call', () => {
|
|
|
245
236
|
expect(el.textContent ?? '').not.toContain('waiting');
|
|
246
237
|
});
|
|
247
238
|
|
|
248
|
-
test('keeps the prose omp wrote, which is the only record of a
|
|
249
|
-
const el = await mount({ ...SETTLED, output: '
|
|
250
|
-
expect(el.textContent ?? '').toContain('
|
|
239
|
+
test('keeps the prose omp wrote, which is the only record of a refusal', async () => {
|
|
240
|
+
const el = await mount({ ...SETTLED, output: 'Nothing to wait for: no background job or service you started is running.' });
|
|
241
|
+
expect(el.textContent ?? '').toContain('Nothing to wait for');
|
|
251
242
|
});
|
|
252
243
|
});
|
|
253
244
|
|
|
@@ -265,6 +256,26 @@ describe('Wait panel — interrupted and messaged', () => {
|
|
|
265
256
|
expect(text).not.toContain('Jobs');
|
|
266
257
|
});
|
|
267
258
|
|
|
259
|
+
test('every message a wake carried is rendered, oldest first', async () => {
|
|
260
|
+
// omp 18.17.0: one wake returns every message queued by then.
|
|
261
|
+
const el = await mount({
|
|
262
|
+
type: 'wait',
|
|
263
|
+
name: 'wait',
|
|
264
|
+
status: 'success',
|
|
265
|
+
details: {
|
|
266
|
+
op: 'wait',
|
|
267
|
+
from: 'main',
|
|
268
|
+
waited: [
|
|
269
|
+
{ from: 'Sleeper', to: 'main', body: 'sleeper reporting in', ts: 1 },
|
|
270
|
+
{ from: 'Scout', to: 'main', body: 'map is ready', ts: 2 },
|
|
271
|
+
],
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
const blocks = [...el.querySelectorAll('.whitespace-pre-wrap')].map((node) => node.textContent ?? '');
|
|
275
|
+
expect(el.textContent ?? '').toContain('2 messages');
|
|
276
|
+
expect(blocks).toEqual(['sleeper reporting in', 'map is ready']);
|
|
277
|
+
});
|
|
278
|
+
|
|
268
279
|
test('a peer message that woke the wait is rendered with its sender', async () => {
|
|
269
280
|
const el = await mount({
|
|
270
281
|
type: 'wait',
|
|
@@ -273,7 +284,7 @@ describe('Wait panel — interrupted and messaged', () => {
|
|
|
273
284
|
details: {
|
|
274
285
|
op: 'wait',
|
|
275
286
|
from: 'main',
|
|
276
|
-
waited: { from: 'Sleeper', to: 'main', body: 'sleeper reporting in', ts: 1_791_000_000_000 },
|
|
287
|
+
waited: [{ from: 'Sleeper', to: 'main', body: 'sleeper reporting in', ts: 1_791_000_000_000 }],
|
|
277
288
|
},
|
|
278
289
|
});
|
|
279
290
|
const text = el.textContent ?? '';
|
|
@@ -8,13 +8,15 @@
|
|
|
8
8
|
* call blocked on.
|
|
9
9
|
*
|
|
10
10
|
* A `wait` is the only tool that can legitimately occupy minutes of a turn
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
11
|
+
* while producing almost no output, so the card has to answer one question the
|
|
12
|
+
* generic fallback could not: how long has this been going, and is anything
|
|
13
|
+
* still moving. (omp 18.17.0 removed its 30-minute ceiling: a window from a
|
|
14
|
+
* 5 s → 5 min ladder now ends the call, and the ladder climbs across back-to-back
|
|
15
|
+
* idle waits.) Before this the call had NO panel (`toolPanelKind` returned
|
|
16
|
+
* null) and rendered as `Wait` + a "Wait" header + an empty Output block, even
|
|
17
|
+
* though omp reports the whole picture in `details` — every job's status, its
|
|
18
|
+
* elapsed `durationMs`, a subagent's `completionPercent`, and whether the wait
|
|
19
|
+
* was interrupted.
|
|
18
20
|
*
|
|
19
21
|
* Three rules make the progress bar honest:
|
|
20
22
|
*
|
|
@@ -33,22 +35,22 @@
|
|
|
33
35
|
* finished call.
|
|
34
36
|
*/
|
|
35
37
|
|
|
36
|
-
import {
|
|
38
|
+
import { useMemo } from 'preact/hooks';
|
|
37
39
|
import { CheckCircle2, CircleSlash, Hourglass, Loader2, MessageSquare, Radio, XCircle } from 'lucide-preact';
|
|
38
40
|
import type { ToolCallData } from '@/shared/types';
|
|
39
41
|
import {
|
|
40
42
|
formatWaitClock,
|
|
41
|
-
WAIT_MAX_MS,
|
|
42
43
|
waitCounts,
|
|
43
|
-
waitHitLimit,
|
|
44
44
|
waitJobSpanMs,
|
|
45
45
|
waitSummaryLine,
|
|
46
46
|
waitViewOf,
|
|
47
47
|
type WaitAgent,
|
|
48
48
|
type WaitJob,
|
|
49
49
|
} from '@/shared/lib/omp/session/wait';
|
|
50
|
+
import { waitIdleLabel, waitIdleOf } from '@/shared/lib/omp/session/wait-idle';
|
|
50
51
|
import { FallbackOutput } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput';
|
|
51
52
|
import { ToolPanelHeader } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolPanelHeader';
|
|
53
|
+
import { ProgressTrack, useStopwatch } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/wait-parts';
|
|
52
54
|
import { jobSubject, jobProgressLine } from '@/shared/lib/omp/session/job-progress';
|
|
53
55
|
|
|
54
56
|
const TONE_CLASSES = {
|
|
@@ -65,68 +67,6 @@ function jobTone(status: string | undefined): keyof typeof TONE_CLASSES {
|
|
|
65
67
|
return 'muted';
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
/**
|
|
69
|
-
* The stopwatch for a wait that is still blocking.
|
|
70
|
-
*
|
|
71
|
-
* Two sources, in order of honesty:
|
|
72
|
-
* - the call's own START clock (`startedAt`) — an absolute time, so the ticker
|
|
73
|
-
* only has to force a re-render and the value can never drift;
|
|
74
|
-
* - a relative base (a finished call's measured span, or a job's age as a last
|
|
75
|
-
* resort), which the ticker advances while the call is still running.
|
|
76
|
-
*
|
|
77
|
-
* A watched job's `durationMs` is deliberately NOT the clock: a job routinely
|
|
78
|
-
* starts before the wait that watches it (measured on a real result — `bg_8`
|
|
79
|
-
* had run 126 s while the `wait` call took 20 s).
|
|
80
|
-
*/
|
|
81
|
-
function useStopwatch(startedAt: number | undefined, baseMs: number | undefined, running: boolean): number | undefined {
|
|
82
|
-
const [now, setNow] = useState(() => Date.now());
|
|
83
|
-
const [anchor, setAnchor] = useState(() => Date.now());
|
|
84
|
-
const live = running && (startedAt !== undefined || baseMs !== undefined);
|
|
85
|
-
|
|
86
|
-
useEffect(() => {
|
|
87
|
-
if (!live) return;
|
|
88
|
-
const timer = setInterval(() => setNow(Date.now()), 1000);
|
|
89
|
-
return () => clearInterval(timer);
|
|
90
|
-
}, [live]);
|
|
91
|
-
|
|
92
|
-
// A new relative base is a new measurement; the ticker counts from it, never
|
|
93
|
-
// from mount, or the same seconds would be counted twice.
|
|
94
|
-
useEffect(() => {
|
|
95
|
-
if (baseMs === undefined) return;
|
|
96
|
-
setAnchor(Date.now());
|
|
97
|
-
setNow(Date.now());
|
|
98
|
-
}, [baseMs]);
|
|
99
|
-
|
|
100
|
-
if (running && startedAt !== undefined) return Math.max(0, now - startedAt);
|
|
101
|
-
if (baseMs === undefined) return undefined;
|
|
102
|
-
return running ? baseMs + Math.max(0, now - anchor) : baseMs;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** A progress track. `percent` null means "no number to show" — the band sweeps
|
|
106
|
-
* instead of pretending to be half done. */
|
|
107
|
-
function ProgressTrack({ percent, active }: { percent: number | null; active: boolean }) {
|
|
108
|
-
const clamped = percent === null ? null : Math.max(0, Math.min(100, percent));
|
|
109
|
-
return (
|
|
110
|
-
<div
|
|
111
|
-
className="relative h-1.5 overflow-hidden rounded-full bg-ink/8"
|
|
112
|
-
role="progressbar"
|
|
113
|
-
aria-valuemin={0}
|
|
114
|
-
aria-valuemax={100}
|
|
115
|
-
aria-valuenow={clamped ?? undefined}
|
|
116
|
-
aria-label={clamped === null ? 'Waiting' : 'Wait progress'}
|
|
117
|
-
>
|
|
118
|
-
{clamped === null ? (
|
|
119
|
-
active && <span className="wait-bar-sweep absolute inset-y-0 w-1/3 rounded-full bg-ink/45" />
|
|
120
|
-
) : (
|
|
121
|
-
<span
|
|
122
|
-
className={`absolute inset-y-0 left-0 rounded-full ${active ? 'bg-ink/60' : 'bg-success/70'}`}
|
|
123
|
-
style={{ width: `${clamped}%` }}
|
|
124
|
-
/>
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
70
|
/** One job row: what it is for, its status, and how long it has run. */
|
|
131
71
|
function JobRow({ job }: { job: WaitJob }) {
|
|
132
72
|
const tone = jobTone(job.status);
|
|
@@ -245,21 +185,18 @@ export function Wait({ tool }: { tool: ToolCallData }) {
|
|
|
245
185
|
? estimates.reduce((sum, value) => sum + value, 0) / estimates.length
|
|
246
186
|
: null;
|
|
247
187
|
const interrupted = view.interrupted;
|
|
248
|
-
|
|
249
|
-
//
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
// identical. When the cap actually fired, the prose says so and this flags it.
|
|
254
|
-
const hitLimit = waitHitLimit(view, output);
|
|
255
|
-
const remainingMs = elapsed !== undefined ? Math.max(0, WAIT_MAX_MS - elapsed) : undefined;
|
|
188
|
+
// omp 18.17.0 removed the 30-minute ceiling, so there is no budget left to
|
|
189
|
+
// count down to. What a settled call CAN report is the window it gave up
|
|
190
|
+
// after, which omp states in its own sentence — without that the card called
|
|
191
|
+
// an idle return "no jobs", i.e. "the call looked and found none".
|
|
192
|
+
const idle = waitIdleOf(output);
|
|
256
193
|
|
|
257
194
|
return (
|
|
258
195
|
<div className="space-y-2.5">
|
|
259
196
|
<ToolPanelHeader
|
|
260
197
|
icon={<Hourglass size={12} />}
|
|
261
198
|
label={view.op === 'wait' ? 'Waiting' : view.op}
|
|
262
|
-
badge={running ? 'running' :
|
|
199
|
+
badge={running ? 'running' : idle ? 'idle' : interrupted ? 'interrupted' : tool.status === 'error' ? 'failed' : 'settled'}
|
|
263
200
|
copyText={output || undefined}
|
|
264
201
|
copyLabel="Copy output"
|
|
265
202
|
/>
|
|
@@ -276,14 +213,12 @@ export function Wait({ tool }: { tool: ToolCallData }) {
|
|
|
276
213
|
interrupted
|
|
277
214
|
</span>
|
|
278
215
|
)}
|
|
279
|
-
{!
|
|
280
|
-
<span
|
|
281
|
-
{
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
<span className={`ml-auto font-mono text-[10px] font-semibold uppercase tracking-wider ${TONE_CLASSES.warn}`}>
|
|
286
|
-
limit reached
|
|
216
|
+
{!running && idle && (
|
|
217
|
+
<span
|
|
218
|
+
className={`ml-auto font-mono text-[10px] font-semibold uppercase tracking-wider ${TONE_CLASSES.warn}`}
|
|
219
|
+
title="omp returns a blocking wait when its window elapses, and the window climbs across back-to-back idle waits"
|
|
220
|
+
>
|
|
221
|
+
{waitIdleLabel(idle)}
|
|
287
222
|
</span>
|
|
288
223
|
)}
|
|
289
224
|
</div>
|
|
@@ -293,15 +228,24 @@ export function Wait({ tool }: { tool: ToolCallData }) {
|
|
|
293
228
|
</div>
|
|
294
229
|
</div>
|
|
295
230
|
|
|
296
|
-
{/*
|
|
297
|
-
|
|
231
|
+
{/* The messages that ended the wait — the reason it returned early. omp
|
|
232
|
+
returns EVERY message queued by the wake (18.17.0), oldest first. */}
|
|
233
|
+
{view.waited.length > 0 && (
|
|
298
234
|
<div className="overflow-hidden rounded-lg border border-ink/8 bg-paper px-3 py-2">
|
|
299
235
|
<div className="flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-[0.14em] text-ink/40">
|
|
300
236
|
<MessageSquare size={10} />
|
|
301
|
-
<span>Message</span>
|
|
302
|
-
|
|
237
|
+
<span>{view.waited.length === 1 ? 'Message' : `${view.waited.length} messages`}</span>
|
|
238
|
+
</div>
|
|
239
|
+
<div className="mt-1 space-y-1.5">
|
|
240
|
+
{view.waited.map((message, index) => (
|
|
241
|
+
<div key={`${message.ts ?? index}-${index}`}>
|
|
242
|
+
{message.from && (
|
|
243
|
+
<div className="font-mono text-[10px] normal-case tracking-normal text-ink/55">from {message.from}</div>
|
|
244
|
+
)}
|
|
245
|
+
<div className="whitespace-pre-wrap break-words text-[11.5px] text-ink/85">{message.body ?? ''}</div>
|
|
246
|
+
</div>
|
|
247
|
+
))}
|
|
303
248
|
</div>
|
|
304
|
-
<div className="mt-1 whitespace-pre-wrap break-words text-[11.5px] text-ink/85">{waited.body ?? ''}</div>
|
|
305
249
|
</div>
|
|
306
250
|
)}
|
|
307
251
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The two pieces of the `wait` card that are not the card: its stopwatch and its
|
|
8
|
+
* progress track.
|
|
9
|
+
*
|
|
10
|
+
* Split out of `Wait.tsx` for the repo's per-file ceiling; the rule each one
|
|
11
|
+
* carries is documented on the piece itself.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { useEffect, useState } from 'preact/hooks';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The stopwatch for a wait that is still blocking.
|
|
18
|
+
*
|
|
19
|
+
* Two sources, in order of honesty:
|
|
20
|
+
* - the call's own START clock (`startedAt`) — an absolute time, so the ticker
|
|
21
|
+
* only has to force a re-render and the value can never drift;
|
|
22
|
+
* - a relative base (a finished call's measured span, or a job's age as a last
|
|
23
|
+
* resort), which the ticker advances while the call is still running.
|
|
24
|
+
*
|
|
25
|
+
* A watched job's `durationMs` is deliberately NOT the clock: a job routinely
|
|
26
|
+
* starts before the wait that watches it (measured on a real result — `bg_8`
|
|
27
|
+
* had run 126 s while the `wait` call took 20 s).
|
|
28
|
+
*/
|
|
29
|
+
export function useStopwatch(startedAt: number | undefined, baseMs: number | undefined, running: boolean): number | undefined {
|
|
30
|
+
const [now, setNow] = useState(() => Date.now());
|
|
31
|
+
const [anchor, setAnchor] = useState(() => Date.now());
|
|
32
|
+
const live = running && (startedAt !== undefined || baseMs !== undefined);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!live) return;
|
|
36
|
+
const timer = setInterval(() => setNow(Date.now()), 1000);
|
|
37
|
+
return () => clearInterval(timer);
|
|
38
|
+
}, [live]);
|
|
39
|
+
|
|
40
|
+
// A new relative base is a new measurement; the ticker counts from it, never
|
|
41
|
+
// from mount, or the same seconds would be counted twice.
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (baseMs === undefined) return;
|
|
44
|
+
setAnchor(Date.now());
|
|
45
|
+
setNow(Date.now());
|
|
46
|
+
}, [baseMs]);
|
|
47
|
+
|
|
48
|
+
if (running && startedAt !== undefined) return Math.max(0, now - startedAt);
|
|
49
|
+
if (baseMs === undefined) return undefined;
|
|
50
|
+
return running ? baseMs + Math.max(0, now - anchor) : baseMs;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A progress track. `percent` null means "no number to show" — the band sweeps
|
|
54
|
+
* instead of pretending to be half done. */
|
|
55
|
+
export function ProgressTrack({ percent, active }: { percent: number | null; active: boolean }) {
|
|
56
|
+
const clamped = percent === null ? null : Math.max(0, Math.min(100, percent));
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
className="relative h-1.5 overflow-hidden rounded-full bg-ink/8"
|
|
60
|
+
role="progressbar"
|
|
61
|
+
aria-valuemin={0}
|
|
62
|
+
aria-valuemax={100}
|
|
63
|
+
aria-valuenow={clamped ?? undefined}
|
|
64
|
+
aria-label={clamped === null ? 'Waiting' : 'Wait progress'}
|
|
65
|
+
>
|
|
66
|
+
{clamped === null ? (
|
|
67
|
+
active && <span className="wait-bar-sweep absolute inset-y-0 w-1/3 rounded-full bg-ink/45" />
|
|
68
|
+
) : (
|
|
69
|
+
<span
|
|
70
|
+
className={`absolute inset-y-0 left-0 rounded-full ${active ? 'bg-ink/60' : 'bg-success/70'}`}
|
|
71
|
+
style={{ width: `${clamped}%` }}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -122,7 +122,8 @@ export function toolCardHeader(tool: ToolCallData, toolKey: string): ToolCardHea
|
|
|
122
122
|
if (toolKey === 'wait') {
|
|
123
123
|
const view = waitViewOf(tool);
|
|
124
124
|
const job = view?.jobs[0];
|
|
125
|
-
const subject =
|
|
125
|
+
const subject =
|
|
126
|
+
(job ? jobSubject(job).primary?.split('\n')[0]?.trim() : undefined) || job?.id || view?.waited[0]?.from;
|
|
126
127
|
return { title: 'Wait', subtitle: subject ? clip(subject) : undefined };
|
|
127
128
|
}
|
|
128
129
|
|
|
@@ -60,6 +60,31 @@ describe('Files panel listing', () => {
|
|
|
60
60
|
expect(panel.container.textContent).toContain('keep.ts');
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
test('reopening the panel re-reads the root and the open folders, so hidden-time edits appear', async () => {
|
|
64
|
+
panel.disk = { '.': { src: null }, src: { 'keep.ts': 'file', 'gone.ts': 'file' } };
|
|
65
|
+
panel.dirReads = [];
|
|
66
|
+
await panel.mount();
|
|
67
|
+
await panel.clickRow('src');
|
|
68
|
+
expect(panel.container.textContent).toContain('gone.ts');
|
|
69
|
+
|
|
70
|
+
// The right column is collapsed, or another view is on screen: the layout
|
|
71
|
+
// keeps this panel MOUNTED and hidden, so nothing here reads while the
|
|
72
|
+
// filesystem moves underneath it.
|
|
73
|
+
await panel.setActive(false);
|
|
74
|
+
delete panel.disk['src']!['gone.ts'];
|
|
75
|
+
panel.disk['.']!['added.ts'] = 'file';
|
|
76
|
+
panel.dirReads = [];
|
|
77
|
+
|
|
78
|
+
await panel.setActive(true);
|
|
79
|
+
|
|
80
|
+
// Reopening IS a read — of the root AND of every folder still expanded —
|
|
81
|
+
// so the deleted row is gone and the new one is drawn.
|
|
82
|
+
expect(panel.dirReads).toContain('.');
|
|
83
|
+
expect(panel.dirReads).toContain('src');
|
|
84
|
+
expect(panel.container.textContent).toContain('added.ts');
|
|
85
|
+
expect(panel.container.textContent).not.toContain('gone.ts');
|
|
86
|
+
});
|
|
87
|
+
|
|
63
88
|
test('an expanded empty folder is read once, and expanding a sibling does not re-read it', async () => {
|
|
64
89
|
panel.disk = { '.': { empty: null, keep: null }, empty: {}, keep: { 'a.ts': 'file' } };
|
|
65
90
|
panel.dirReads = [];
|
|
@@ -17,12 +17,11 @@ import { useRepoList, useRepoScope } from '@/client/hooks/workspace/repo-scope';
|
|
|
17
17
|
import { useRealtimeTopic } from '@/client/hooks/ui/realtime';
|
|
18
18
|
import { useToasts } from '@/client/hooks/ui/toasts';
|
|
19
19
|
import { useTouchDevice } from '@/client/hooks/ui/touch-device';
|
|
20
|
-
import { ToastStack } from '@/client/components/common/ToastStack';
|
|
21
20
|
import { fsTopic } from '@/shared/lib/realtime/protocol';
|
|
22
21
|
import { unfoldChains } from '@/shared/lib/fs/folder-chain';
|
|
23
22
|
import { useRootDropTarget } from '@/client/hooks/workspace/root-drop-target';
|
|
24
23
|
|
|
25
|
-
export function FileExplorer({ className = '', enabled = true, rootPath, onOpenFile, refreshKey = 0, onRefresh }: { className?: string, enabled?: boolean, rootPath?: string, onOpenFile?: (file: any) => void, refreshKey?: number, onRefresh?: () => void }) {
|
|
24
|
+
export function FileExplorer({ className = '', enabled = true, active = true, rootPath, onOpenFile, refreshKey = 0, onRefresh }: { className?: string, enabled?: boolean, active?: boolean, rootPath?: string, onOpenFile?: (file: any) => void, refreshKey?: number, onRefresh?: () => void }) {
|
|
26
25
|
const [searchQuery, setSearchQuery] = useSessionState<string>('files.searchQuery', '');
|
|
27
26
|
const [storedExpandedPaths, setStoredExpandedPaths, expandedPathsReady] = useSessionState<string[]>('files.expandedPaths', []);
|
|
28
27
|
const [expandedPaths, setExpandedPaths] = useState<Set<string>>(() => new Set(storedExpandedPaths));
|
|
@@ -57,12 +56,18 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
|
|
|
57
56
|
});
|
|
58
57
|
|
|
59
58
|
useEffect(() => {
|
|
60
|
-
if (!expandedPathsReady) return;
|
|
59
|
+
if (!expandedPathsReady || !active) return;
|
|
61
60
|
void listing.reload();
|
|
62
61
|
// `listing.reload` reads the current scope and expansion set off refs, so
|
|
63
62
|
// the effect is keyed on what should trigger a read, not on the callback.
|
|
63
|
+
// `active` is one of them: the layout keeps this view MOUNTED while the
|
|
64
|
+
// right column is collapsed (or another view is on screen), so without it a
|
|
65
|
+
// reopened panel would draw the tree it read when it was last looked at —
|
|
66
|
+
// a file added, deleted or renamed outside this panel in between would not
|
|
67
|
+
// be there. While inactive the panel starts no reload of its own; being
|
|
68
|
+
// shown again IS the read.
|
|
64
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
}, [refreshKey, rootPath, enabled, activeRepo, expandedPathsReady]);
|
|
70
|
+
}, [refreshKey, rootPath, enabled, activeRepo, expandedPathsReady, active]);
|
|
66
71
|
|
|
67
72
|
// The ROOT listing rides the `fs:<root>\0<repo>` topic: the server pushes a
|
|
68
73
|
// fresh read when a run's work may have touched the tree. Expanded CHILDREN
|
|
@@ -135,7 +140,7 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
|
|
|
135
140
|
// A row is a drag source; on a finger the native drag is what turned a long
|
|
136
141
|
// press into a text selection of the whole panel (see `useLongPress`).
|
|
137
142
|
const touch = useTouchDevice();
|
|
138
|
-
const {
|
|
143
|
+
const { pushToast } = useToasts();
|
|
139
144
|
const clipboard = useFileClipboard({
|
|
140
145
|
rootPath,
|
|
141
146
|
repo: activeRepo,
|
|
@@ -306,7 +311,6 @@ export function FileExplorer({ className = '', enabled = true, rootPath, onOpenF
|
|
|
306
311
|
/>
|
|
307
312
|
)}
|
|
308
313
|
|
|
309
|
-
<ToastStack toasts={toasts} onDismiss={dismissToast} />
|
|
310
314
|
</div>
|
|
311
315
|
);
|
|
312
316
|
}
|
|
@@ -24,6 +24,8 @@ import { Window } from 'happy-dom';
|
|
|
24
24
|
import { h, render } from 'preact';
|
|
25
25
|
import { act } from 'preact/test-utils';
|
|
26
26
|
import { GitPanel } from '@/client/components/workspace/git-panel';
|
|
27
|
+
import { ToastStack } from '@/client/components/common/ToastStack';
|
|
28
|
+
import { resetToasts } from '@/client/hooks/ui/toasts';
|
|
27
29
|
import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
|
|
28
30
|
import { resetRealtimeClient } from '@/shared/lib/realtime/client';
|
|
29
31
|
import { gitTopic, reposTopic } from '@/shared/lib/realtime/protocol';
|
|
@@ -69,6 +71,7 @@ afterEach(() => {
|
|
|
69
71
|
container.remove();
|
|
70
72
|
}
|
|
71
73
|
resetRealtimeClient();
|
|
74
|
+
resetToasts();
|
|
72
75
|
server?.stop();
|
|
73
76
|
});
|
|
74
77
|
|
|
@@ -110,7 +113,14 @@ async function mount(options: {
|
|
|
110
113
|
render(
|
|
111
114
|
h(SessionStateProvider, {
|
|
112
115
|
sessionId: SESSION,
|
|
113
|
-
children: h(
|
|
116
|
+
children: h(
|
|
117
|
+
'div',
|
|
118
|
+
null,
|
|
119
|
+
// The panel raises into the page's ONE queue; the host is mounted
|
|
120
|
+
// beside it, so the assertion covers the assembled path.
|
|
121
|
+
h(GitPanel, { rootPath: ROOT, enabled: true }),
|
|
122
|
+
h(ToastStack, {}),
|
|
123
|
+
),
|
|
114
124
|
}),
|
|
115
125
|
container,
|
|
116
126
|
);
|
|
@@ -230,8 +240,8 @@ describe('GitPanel sync badge', () => {
|
|
|
230
240
|
* The change list is the answer for a stage or a discard, but a Sync leaves the
|
|
231
241
|
* working tree byte-identical — without a toast the press has no observable
|
|
232
242
|
* effect at all, which is the reported "sync does nothing". The toast is
|
|
233
|
-
*
|
|
234
|
-
* rather than the panel's
|
|
243
|
+
* drawn by the page's single `ToastStack`, which portals to `document.body`, so
|
|
244
|
+
* the assertion is against the document rather than the panel's container.
|
|
235
245
|
*/
|
|
236
246
|
describe('GitPanel action toast', () => {
|
|
237
247
|
/** Click a toolbar control and let the request, the answer and the effect land. */
|