@kabmo-labs/kabmo 0.23.0 → 0.25.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/dist/client/index.html +1 -1
- package/dist/client/index.js +805 -736
- package/dist/client/static/js/index-bc9aa4mx.css +1 -0
- package/dist/client/static/js/{index-ph0q59rs.js → index-ga8cbpt4.js} +1071 -1171
- package/package.json +2 -4
- package/src/cli/lib/args.js +24 -1
- package/src/cli/lib/args.test.js +16 -0
- package/src/cli/lib/commands/session.js +233 -0
- package/src/cli/lib/commands/session.test.js +103 -0
- package/src/cli/main.js +1 -1
- package/src/client/components/common/ComposerPicker.tsx +3 -0
- package/src/client/components/common/Modal.tsx +2 -6
- package/src/client/components/common/code-surface/shiki.test.ts +82 -0
- package/src/client/components/common/code-surface/shiki.ts +28 -7
- package/src/client/components/common/session-actions-menu/NewChildSessionDialog.tsx +113 -0
- package/src/client/components/common/session-actions-menu/index.tsx +33 -2
- package/src/client/components/common/session-row/StatusSlot.tsx +4 -4
- package/src/client/components/common/session-row/index.tsx +27 -1
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +7 -1
- package/src/client/components/layout/desktop-layout/resizer/separator-drag.ts +3 -3
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +25 -12
- package/src/client/components/layout/session-sidebar/ChildSessionList.tsx +66 -0
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +28 -3
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.test.tsx +20 -0
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.tsx +59 -12
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTableLog.test.tsx +94 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.test.tsx +130 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.tsx +120 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogLine.tsx +47 -0
- 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 +55 -46
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +18 -5
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +21 -4
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +27 -5
- package/src/client/components/settings/categories/harness-settings/EnvProviderForm.tsx +31 -0
- package/src/client/components/settings/categories/harness-settings/provider-panel.test.tsx +49 -0
- package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +5 -2
- package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +64 -70
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +35 -0
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +135 -118
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +22 -1
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +14 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +4 -0
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +4 -3
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +155 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +5 -2
- package/src/client/components/workspace/chat-timeline/pending-harness.test.tsx +1 -1
- 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/file-explorer/index.test.ts +25 -0
- package/src/client/components/workspace/file-explorer/index.tsx +9 -3
- package/src/client/components/workspace/model-dropdown/harness-models.test.ts +17 -0
- package/src/client/components/workspace/model-dropdown/harness-models.ts +33 -18
- package/src/client/components/workspace/model-dropdown/index.tsx +3 -3
- package/src/client/components/workspace/model-dropdown/popover-metrics.ts +4 -1
- package/src/client/components/workspace/terminal-panel/KeyBar.tsx +10 -8
- package/src/client/components/workspace/terminal-panel/{RealtimeXtermView.tsx → RealtimeTerminalView.tsx} +51 -58
- package/src/client/components/workspace/terminal-panel/fit.test.ts +37 -0
- package/src/client/components/workspace/terminal-panel/fit.ts +64 -0
- package/src/client/components/workspace/terminal-panel/fonts.test.ts +161 -0
- package/src/client/components/workspace/terminal-panel/fonts.ts +164 -0
- package/src/client/components/workspace/terminal-panel/grid.test.ts +52 -0
- package/src/client/components/workspace/terminal-panel/grid.ts +118 -0
- package/src/client/components/workspace/terminal-panel/index.tsx +25 -21
- package/src/client/components/workspace/terminal-panel/mount.ts +247 -223
- package/src/client/components/workspace/terminal-panel/navigation.test.ts +54 -0
- package/src/client/components/workspace/terminal-panel/navigation.ts +47 -0
- package/src/client/data/settings/omp-schema.json +5 -5
- package/src/client/data/theme/terminal.test.ts +25 -0
- package/src/client/data/theme/terminal.ts +96 -79
- package/src/client/hooks/chat/composer/items.test.ts +12 -26
- package/src/client/hooks/chat/composer/pick-mapping.test.ts +42 -0
- package/src/client/hooks/chat/omp/prompt-send.test.ts +7 -7
- package/src/client/hooks/chat/omp/prompt-send.ts +26 -14
- package/src/client/hooks/chat/timeline/actions.ts +2 -2
- package/src/client/hooks/chat/timeline/ask-frames.ts +5 -4
- 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 +34 -1
- package/src/client/hooks/chat/timeline/prompt-text.ts +47 -20
- package/src/client/hooks/chat/timeline/rewind-actions.test.ts +24 -1
- package/src/client/hooks/chat/timeline/rewind-actions.ts +15 -11
- 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 +56 -0
- package/src/client/hooks/chat/timeline/send-helpers.ts +30 -1
- package/src/client/hooks/chat/timeline/send-props.ts +5 -3
- package/src/client/hooks/chat/timeline/send-steer.test.ts +4 -4
- package/src/client/hooks/chat/timeline/send.test-util.ts +8 -2
- package/src/client/hooks/chat/timeline/send.test.ts +4 -4
- package/src/client/hooks/chat/timeline/send.ts +59 -53
- 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/use-fork-session.ts +49 -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 +10 -3
- package/src/client/hooks/models/use-harness-update.test.ts +193 -0
- package/src/client/hooks/models/use-harness-update.ts +202 -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 +2 -1
- package/src/client/hooks/models/use-harnesses.ts +48 -114
- package/src/client/hooks/workspace/child-expansion.ts +33 -0
- package/src/client/hooks/workspace/terminal/index.ts +17 -3
- package/src/client/hooks/workspace/terminal/socket.ts +9 -4
- package/src/client/lib/session-tree.test.ts +50 -0
- package/src/client/lib/session-tree.ts +59 -0
- package/src/client/tailwind.css +26 -12
- package/src/server/index.ts +2 -0
- package/src/server/lib/auth/guard.ts +10 -0
- package/src/server/lib/btw/session-copy.server.ts +6 -44
- package/src/server/lib/btw/session-copy.test.ts +2 -1
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/db/seed-terminal.test.ts +1 -1
- package/src/server/lib/db/seed.test.ts +1 -1
- 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/background-work.test.ts +262 -0
- package/src/server/lib/harness/acp/background-work.ts +320 -0
- package/src/server/lib/harness/acp/client.ts +2 -2
- package/src/server/lib/harness/acp/frames.test.ts +50 -1
- package/src/server/lib/harness/acp/frames.ts +17 -5
- package/src/server/lib/harness/acp/gateway-env.test.ts +64 -0
- package/src/server/lib/harness/acp/gateway-env.ts +70 -0
- package/src/server/lib/harness/acp/mapper.ts +6 -4
- package/src/server/lib/harness/acp/prompt.test.ts +20 -0
- package/src/server/lib/harness/acp/prompt.ts +19 -3
- package/src/server/lib/harness/acp/session-background.test.ts +129 -0
- package/src/server/lib/harness/acp/session-config.test.ts +73 -0
- package/src/server/lib/harness/acp/session-config.ts +87 -6
- package/src/server/lib/harness/acp/session-exit.ts +31 -0
- package/src/server/lib/harness/acp/session-handshake.test.ts +108 -0
- package/src/server/lib/harness/acp/session-handshake.ts +36 -3
- package/src/server/lib/harness/acp/session-idle.ts +51 -0
- package/src/server/lib/harness/acp/session-listeners.ts +31 -0
- package/src/server/lib/harness/acp/session-notifications.ts +19 -3
- package/src/server/lib/harness/acp/session-observers.test.ts +9 -0
- package/src/server/lib/harness/acp/session-options.ts +33 -0
- package/src/server/lib/harness/acp/session-reaper.test.ts +96 -0
- package/src/server/lib/harness/acp/session-requests.ts +47 -0
- package/src/server/lib/harness/acp/session-turns.ts +20 -5
- package/src/server/lib/harness/acp/session.test-util.ts +54 -3
- package/src/server/lib/harness/acp/session.test.ts +65 -3
- package/src/server/lib/harness/acp/session.ts +79 -79
- package/src/server/lib/harness/acp/turn.test.ts +81 -0
- package/src/server/lib/harness/acp/turn.ts +54 -13
- package/src/server/lib/harness/acp/verbs.ts +12 -2
- 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/config.server.test.ts +1 -1
- package/src/server/lib/harness/config.server.ts +1 -1
- package/src/server/lib/harness/launch-table.ts +195 -0
- package/src/server/lib/harness/launch.test.ts +37 -0
- package/src/server/lib/harness/launch.ts +16 -116
- package/src/server/lib/harness/provider-entry.ts +32 -0
- package/src/server/lib/harness/provider-file.server.ts +3 -0
- package/src/server/lib/harness/provider-sources.server.test.ts +45 -0
- package/src/server/lib/harness/provider-sources.server.ts +26 -2
- package/src/server/lib/harness/provider-write.server.ts +21 -32
- 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/spawn.server.ts +15 -2
- package/src/server/lib/harness/update-job-store.test.ts +126 -0
- package/src/server/lib/harness/update-job-store.ts +109 -0
- package/src/server/lib/harness/update-job.server.ts +203 -0
- package/src/server/lib/harness/update-state.server.ts +15 -20
- package/src/server/lib/harness/update-worker.test.ts +153 -0
- package/src/server/lib/harness/update-worker.ts +197 -0
- package/src/server/lib/lifecycle/after-listen.ts +7 -0
- package/src/server/lib/lifecycle/paths.ts +23 -0
- 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/rpc/child-config.ts +5 -4
- package/src/server/lib/omp/rpc/constants.test.ts +2 -1
- package/src/server/lib/omp/rpc/forked-resume.test.ts +14 -3
- package/src/server/lib/omp/rpc/manager.ts +5 -5
- package/src/server/lib/omp/rpc/prewarm-pool.ts +12 -3
- package/src/server/lib/omp/rpc/session-registry.ts +14 -2
- package/src/server/lib/omp/rpc/terminal-settle.ts +53 -5
- package/src/server/lib/omp/session/delete-flow.server.ts +62 -8
- package/src/server/lib/omp/session/delete.server.ts +17 -0
- package/src/server/lib/omp/session/rewind-file.ts +39 -21
- package/src/server/lib/omp/session/sidebar-data.server.ts +6 -6
- package/src/server/lib/omp/session/transcript-copy.ts +123 -0
- package/src/server/lib/sessions/agent-token.server.test.ts +64 -0
- package/src/server/lib/sessions/agent-token.server.ts +134 -0
- package/src/server/lib/sessions/answers.server.test.ts +33 -0
- package/src/server/lib/sessions/answers.server.ts +37 -0
- package/src/server/lib/sessions/dispatch.server.test.ts +143 -0
- package/src/server/lib/sessions/dispatch.server.ts +128 -0
- package/src/server/lib/sessions/fork.server.test.ts +209 -0
- package/src/server/lib/sessions/fork.server.ts +304 -0
- package/src/server/lib/sessions/lifecycle.server.test.ts +75 -0
- package/src/server/lib/sessions/lifecycle.server.ts +71 -0
- package/src/server/lib/sessions/notify.server.test.ts +112 -0
- package/src/server/lib/sessions/notify.server.ts +212 -0
- package/src/server/lib/sessions/relation-types.ts +76 -0
- package/src/server/lib/sessions/relations.server.test.ts +207 -0
- package/src/server/lib/sessions/relations.server.ts +337 -0
- package/src/server/lib/sessions/resolve.server.ts +106 -0
- package/src/server/lib/sessions/schema.server.ts +82 -0
- package/src/server/lib/sessions/sidebar-relations.server.test.ts +61 -0
- package/src/server/lib/sessions/sidebar-relations.server.ts +47 -0
- package/src/server/lib/sessions/spawn.server.test.ts +196 -0
- package/src/server/lib/sessions/spawn.server.ts +310 -0
- package/src/server/lib/terminal/attach-replay.test.ts +2 -2
- package/src/server/lib/terminal/output.test.ts +2 -2
- package/src/server/lib/terminal/output.ts +1 -1
- package/src/server/lib/terminal/resize.test.ts +99 -0
- package/src/server/lib/terminal/runtime.server.ts +26 -6
- package/src/server/lib/terminal/send-result.test.ts +18 -1
- package/src/server/lib/terminal/send-result.ts +26 -2
- package/src/server/lib/terminal/session.server.ts +6 -6
- package/src/server/lib/usage/new-api.test.ts +92 -0
- package/src/server/lib/usage/new-api.ts +131 -0
- package/src/server/lib/usage/provider-endpoint.test.ts +106 -0
- package/src/server/lib/usage/provider-key.ts +33 -0
- package/src/server/lib/usage/providers.server.ts +10 -3
- package/src/server/lib/usage/vendor-balance.server.ts +4 -53
- package/src/server/lib/usage/vendor-http.ts +41 -0
- package/src/server/lib/usage/window.ts +55 -0
- package/src/server/routes/agent/command.ts +14 -1
- package/src/server/routes/agent/harness-command.ts +6 -0
- package/src/server/routes/agent/new.ts +15 -0
- 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 +165 -10
- package/src/server/routes/chat/session.ts +60 -7
- package/src/server/routes/harness/add-provider.test.ts +9 -1
- package/src/server/routes/harness/import-action.ts +22 -4
- package/src/server/routes/harness/import.test.ts +1 -1
- package/src/server/routes/harness/index.ts +5 -1
- package/src/server/routes/harness/root.ts +8 -49
- package/src/server/routes/harness/toggle.test.ts +20 -0
- package/src/server/routes/harness/update-status.ts +26 -0
- package/src/server/routes/harness/update.test.ts +119 -0
- package/src/server/routes/harness/update.ts +67 -113
- package/src/server/routes/harness/versions.ts +5 -1
- package/src/server/routes/sessions/answer.ts +24 -0
- package/src/server/routes/sessions/batch-delete.ts +11 -5
- package/src/server/routes/sessions/delete-acp.test.ts +227 -0
- package/src/server/routes/sessions/delete.ts +4 -2
- package/src/server/routes/sessions/fork.ts +74 -0
- package/src/server/routes/sessions/index.ts +14 -0
- package/src/server/routes/sessions/relations.ts +85 -0
- package/src/server/routes/sessions/session.ts +4 -0
- package/src/server/routes/sessions/spawn.ts +134 -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/terminal/ws.ts +3 -3
- 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 +31 -2
- package/src/shared/lib/chat/composer/delegation.test.ts +93 -0
- package/src/shared/lib/chat/composer/delegation.ts +206 -0
- package/src/shared/lib/chat/notice-text.ts +1 -1
- 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 +11 -0
- package/src/shared/lib/code/ansi.ts +1 -1
- package/src/shared/lib/fonts/nerd-symbols.css +4 -3
- package/src/shared/lib/fonts/nerd-symbols.test.ts +9 -9
- package/src/shared/lib/harness/catalog.test.ts +1 -1
- package/src/shared/lib/harness/config-fields.test.ts +4 -0
- package/src/shared/lib/harness/config-fields.ts +19 -4
- package/src/shared/lib/harness/dialects.test.ts +8 -0
- package/src/shared/lib/harness/dialects.ts +12 -0
- package/src/shared/lib/harness/provider-facts.test.ts +59 -8
- package/src/shared/lib/harness/provider-facts.ts +46 -11
- package/src/shared/lib/harness/providers.ts +44 -1
- package/src/shared/lib/harness/rewind.ts +24 -0
- package/src/shared/lib/harness/update-job.ts +33 -0
- package/src/shared/lib/harness/update-plan.test.ts +69 -4
- package/src/shared/lib/harness/update-plan.ts +57 -9
- package/src/shared/lib/harness/updates.test.ts +22 -0
- package/src/shared/lib/harness/updates.ts +24 -1
- package/src/shared/lib/models/client.ts +10 -1
- package/src/shared/lib/omp/dialog-methods.ts +4 -3
- package/src/shared/lib/omp/session/wait-idle.test.ts +11 -0
- package/src/shared/lib/omp/session/wait-idle.ts +12 -2
- package/src/shared/lib/theme/catalog.test.ts +13 -9
- package/src/shared/lib/theme/color.test.ts +2 -2
- package/src/shared/lib/theme/color.ts +4 -4
- 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 +26 -10
- 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/workspace/terminal/input.test.ts +27 -0
- package/src/shared/lib/workspace/terminal/input.ts +33 -0
- package/src/shared/lib/workspace/terminal/keys.test.ts +1 -1
- package/src/shared/lib/workspace/terminal/keys.ts +7 -7
- package/src/shared/types/chat.ts +1 -1
- package/src/shared/types/harness-update.ts +65 -0
- package/src/shared/types/harness.ts +30 -4
- package/src/shared/types/omp/agent.ts +19 -2
- package/src/shared/types/workspace.ts +4 -0
- package/src/test-support/fake-omp-fork.ts +16 -2
- 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 +21 -4
- package/dist/client/static/js/index-jhmg4w91.css +0 -1
- package/src/client/components/workspace/terminal-panel/webgl.test.ts +0 -75
- package/src/client/components/workspace/terminal-panel/webgl.ts +0 -108
|
@@ -15,11 +15,37 @@
|
|
|
15
15
|
import type { HarnessCapabilities } from '@/server/lib/harness/capabilities';
|
|
16
16
|
import type { HarnessConfig } from '@/shared/lib/harness/config';
|
|
17
17
|
import type { CanonicalProtocol } from '@/shared/lib/harness/dialects';
|
|
18
|
+
import type { EnvProviderContract } from '@/shared/lib/harness/provider-facts';
|
|
18
19
|
|
|
19
20
|
export type { HarnessConfig };
|
|
20
21
|
|
|
21
22
|
export type { HarnessCapabilities };
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* One selector value an ACP agent publishes (`configOptions[].options[]`), in
|
|
26
|
+
* the agent's own order and its own words.
|
|
27
|
+
*
|
|
28
|
+
* The SAME shape is what a probe records and what a live session reports, so a
|
|
29
|
+
* picker can list either without knowing which one it got.
|
|
30
|
+
*/
|
|
31
|
+
export interface HarnessSelectorValue {
|
|
32
|
+
value: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The model and thinking selectors a harness's LIVE chat published.
|
|
38
|
+
*
|
|
39
|
+
* A probe is one throwaway spawn: it can be refused (codex demands
|
|
40
|
+
* authentication in the probe while the chat already running lists its models)
|
|
41
|
+
* and its answer ages. When a session of that harness is open, these are the
|
|
42
|
+
* selectors it published, and they are what the picker must show.
|
|
43
|
+
*/
|
|
44
|
+
export interface LiveHarnessModels {
|
|
45
|
+
models: HarnessSelectorValue[];
|
|
46
|
+
thinking?: HarnessSelectorValue[];
|
|
47
|
+
}
|
|
48
|
+
|
|
23
49
|
/** One row of `GET /api/harness`. */
|
|
24
50
|
export interface HarnessSummary {
|
|
25
51
|
id: string;
|
|
@@ -41,9 +67,9 @@ export interface HarnessSummary {
|
|
|
41
67
|
probe: {
|
|
42
68
|
harness: string;
|
|
43
69
|
capabilities: HarnessCapabilities;
|
|
44
|
-
models:
|
|
45
|
-
thinking:
|
|
46
|
-
modes:
|
|
70
|
+
models: HarnessSelectorValue[];
|
|
71
|
+
thinking: HarnessSelectorValue[];
|
|
72
|
+
modes: HarnessSelectorValue[];
|
|
47
73
|
probedAt: number;
|
|
48
74
|
/** True when the record is older than `PROBE_TTL_MS`. The answer is still
|
|
49
75
|
* shown — with its age — rather than being reported as "never probed". */
|
|
@@ -86,7 +112,7 @@ export interface HarnessProviderSupport {
|
|
|
86
112
|
* agent's own (Claude Code, Antigravity). */
|
|
87
113
|
createsChoice: boolean;
|
|
88
114
|
/** The env names this harness reads, for the `environment` form's labels. */
|
|
89
|
-
env?:
|
|
115
|
+
env?: EnvProviderContract;
|
|
90
116
|
/** The dot-path the providers live under in that file (`providers`,
|
|
91
117
|
* `model_providers`, `modelProviders`), so the card can name what it edits. */
|
|
92
118
|
pointer?: string;
|
|
@@ -153,6 +153,23 @@ export interface SpawnedSession {
|
|
|
153
153
|
harness?: string | null;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Outcome of a brand-new session spawn.
|
|
158
|
+
*
|
|
159
|
+
* A refusal travels with the server's own reason. The caller must report it —
|
|
160
|
+
* falling through to the simulated stream told the operator an agent had
|
|
161
|
+
* answered when nothing had started at all.
|
|
162
|
+
*/
|
|
163
|
+
export type SpawnPromptResult =
|
|
164
|
+
| { ok: true; session: SpawnedSession }
|
|
165
|
+
/**
|
|
166
|
+
* `code` is the server's own discriminator when there is one. `mock_mode`
|
|
167
|
+
* means there is no agent process to start ON PURPOSE — the caller must take
|
|
168
|
+
* the simulated path instead of reporting a failure the operator cannot act
|
|
169
|
+
* on. Every other failure is reported.
|
|
170
|
+
*/
|
|
171
|
+
| { ok: false; error: string; code?: string };
|
|
172
|
+
|
|
156
173
|
/** Command surface returned by useOmpAgent — the live omp session handle the
|
|
157
174
|
* chat timeline drives. */
|
|
158
175
|
export interface OmpAgentHandle extends OmpAgentState {
|
|
@@ -162,7 +179,7 @@ export interface OmpAgentHandle extends OmpAgentState {
|
|
|
162
179
|
* time and the server reconciles an idle session by respawning it. */
|
|
163
180
|
sendPrompt: (message: string, images?: AgentImage[], options?: { accessMode?: ApprovalMode }) => Promise<PromptDispatchResult>;
|
|
164
181
|
/** Spawn a brand-new omp session and send its first prompt; resolves with the
|
|
165
|
-
* adopted session
|
|
182
|
+
* adopted session or the server's refusal reason. */
|
|
166
183
|
sendNewPrompt: (
|
|
167
184
|
message: string,
|
|
168
185
|
cwd: string,
|
|
@@ -172,7 +189,7 @@ export interface OmpAgentHandle extends OmpAgentState {
|
|
|
172
189
|
* armed goal is started, so the prompt IS its first turn. Resolves true
|
|
173
190
|
* when it consumed the prompt (an interview renders its own). */
|
|
174
191
|
beforePrompt?: (sessionId: string) => Promise<boolean>,
|
|
175
|
-
) => Promise<
|
|
192
|
+
) => Promise<SpawnPromptResult>;
|
|
176
193
|
/** Steer the running agent: deliver the message INTO the turn in flight
|
|
177
194
|
* (omp's `steer` RPC). The run continues; the model sees the message inside
|
|
178
195
|
* the same turn and answers it there.
|
|
@@ -20,6 +20,10 @@ export interface SessionItemData {
|
|
|
20
20
|
hasArrow?: boolean;
|
|
21
21
|
hasSubagents?: boolean;
|
|
22
22
|
subagentCount?: number;
|
|
23
|
+
/** The session's parent in the sidebar tree. A fork has no parent. */
|
|
24
|
+
parentSessionId?: string;
|
|
25
|
+
/** Direct children; the client uses it to decide whether to draw a chevron. */
|
|
26
|
+
childSessionCount?: number;
|
|
23
27
|
/** Server-tracked stream state: `stream` while a run is in flight, then a
|
|
24
28
|
* one-shot `finish`/`abort` badge cleared when the session opens. */
|
|
25
29
|
streamStatus?: 'stream' | 'finish' | 'abort';
|
|
@@ -41,12 +41,16 @@ const forkOnResume = process.env.FAKE_OMP_FORK_ON_RESUME === '1';
|
|
|
41
41
|
* fake is asked to fork, which is what omp 18.10.0 does for a moved session. */
|
|
42
42
|
const requestedId = resume ? (resume.split('/').pop() ?? '').replace(/\.jsonl$/, '') : '';
|
|
43
43
|
const sessionId = forkOnResume && resume ? crypto.randomUUID() : requestedId || crypto.randomUUID();
|
|
44
|
+
const sessionSubdir = process.env.FAKE_OMP_SESSION_SUBDIR ?? '';
|
|
44
45
|
const sessionFile = forkOnResume && resume
|
|
45
46
|
? join(agentDir, 'sessions', `--forked--`, `${sessionId}.jsonl`)
|
|
46
|
-
: resume ?? join(agentDir, 'sessions', `${sessionId}.jsonl`);
|
|
47
|
+
: resume ?? join(agentDir, 'sessions', sessionSubdir, `${sessionId}.jsonl`);
|
|
47
48
|
|
|
48
49
|
mkdirSync(dirname(sessionFile), { recursive: true });
|
|
49
|
-
writeFileSync(
|
|
50
|
+
writeFileSync(
|
|
51
|
+
sessionFile,
|
|
52
|
+
`${JSON.stringify({ type: 'session', id: sessionId, cwd: process.cwd(), timestamp: new Date().toISOString() })}\n`,
|
|
53
|
+
);
|
|
50
54
|
|
|
51
55
|
const forkLog = process.env.FAKE_OMP_FORK_LOG;
|
|
52
56
|
if (forkLog) {
|
|
@@ -134,6 +138,16 @@ for (;;) {
|
|
|
134
138
|
respond(id, String(frame.type), {});
|
|
135
139
|
break;
|
|
136
140
|
case 'prompt':
|
|
141
|
+
if (process.env.FAKE_OMP_PROMPT_LOG) {
|
|
142
|
+
try {
|
|
143
|
+
appendFileSync(
|
|
144
|
+
process.env.FAKE_OMP_PROMPT_LOG,
|
|
145
|
+
`${JSON.stringify({ sessionId, message: String(frame.message ?? '') })}\n`,
|
|
146
|
+
);
|
|
147
|
+
} catch {
|
|
148
|
+
// Recording is a test convenience; never let it break the child.
|
|
149
|
+
}
|
|
150
|
+
}
|
|
137
151
|
respond(id, 'prompt', { agentInvoked: true });
|
|
138
152
|
write({ type: 'agent_start' });
|
|
139
153
|
write({ type: 'agent_end', isTerminal: true });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Draw the Files panel into a container, with an explicit `active` flag.
|
|
8
|
+
*
|
|
9
|
+
* Split from the harness so a spec can change the panel's visibility WITHOUT a
|
|
10
|
+
* remount: the desktop layout keeps a hidden view mounted and hides it with
|
|
11
|
+
* CSS, and only a re-render with another `active` reproduces that. Kept in its
|
|
12
|
+
* own module so the harness stays under the repository's line ceiling.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { h, render } from 'preact';
|
|
16
|
+
import { act } from 'preact/test-utils';
|
|
17
|
+
import { FileExplorer } from '@/client/components/workspace/file-explorer/index';
|
|
18
|
+
import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
|
|
19
|
+
|
|
20
|
+
export async function renderFileExplorer(
|
|
21
|
+
container: HTMLElement,
|
|
22
|
+
sessionId: string,
|
|
23
|
+
rootPath: string,
|
|
24
|
+
active: boolean,
|
|
25
|
+
onOpenFile: (file: { path: string; name: string }) => void,
|
|
26
|
+
): Promise<void> {
|
|
27
|
+
await act(async () => {
|
|
28
|
+
render(
|
|
29
|
+
h(SessionStateProvider, {
|
|
30
|
+
sessionId,
|
|
31
|
+
children: h(FileExplorer, { rootPath, enabled: true, active, onOpenFile }),
|
|
32
|
+
}),
|
|
33
|
+
container,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
for (let i = 0; i < 10; i += 1) await act(async () => {});
|
|
37
|
+
}
|
|
@@ -15,10 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { Window } from 'happy-dom';
|
|
18
|
-
import {
|
|
18
|
+
import { render } from 'preact';
|
|
19
19
|
import { act } from 'preact/test-utils';
|
|
20
|
-
import { FileExplorer } from '@/client/components/workspace/file-explorer/index';
|
|
21
|
-
import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
|
|
22
20
|
import { resetRealtimeClient } from '@/shared/lib/realtime/client';
|
|
23
21
|
import { forgetSession } from '@/shared/lib/workspace/session-state/store';
|
|
24
22
|
import { fsTopic, reposTopic } from '@/shared/lib/realtime/protocol';
|
|
@@ -28,6 +26,7 @@ import type { TopicResolver } from '@/server/lib/realtime/hub.server';
|
|
|
28
26
|
import type { GitStatusPayload } from '@/server/lib/fs/git-status-read';
|
|
29
27
|
import { diskHas, entriesOf, moveOnDisk, writeToDisk, type Disk } from '@/test-support/file-explorer-disk.test-util';
|
|
30
28
|
import { fireDrag, rowElementFor, settleDrag, transferOf } from '@/test-support/file-explorer-drag.test-util';
|
|
29
|
+
import { renderFileExplorer } from '@/test-support/file-explorer-render.test-util';
|
|
31
30
|
|
|
32
31
|
export type { Disk } from '@/test-support/file-explorer-disk.test-util';
|
|
33
32
|
|
|
@@ -53,6 +52,14 @@ export interface FileExplorerHarness {
|
|
|
53
52
|
server: RealtimeTestServer | null;
|
|
54
53
|
/** Reset the disk state, mount the panel, and settle its first reads. */
|
|
55
54
|
mount: () => Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Re-render the mounted panel with a different `active` flag.
|
|
57
|
+
*
|
|
58
|
+
* The desktop layout keeps a view mounted and hides it with CSS when the
|
|
59
|
+
* right column is collapsed or another view is on screen, so this is how a
|
|
60
|
+
* spec reaches "the user opened the panel again" without a remount.
|
|
61
|
+
*/
|
|
62
|
+
setActive: (active: boolean) => Promise<void>;
|
|
56
63
|
/** Tear the panel down and stop the listener. */
|
|
57
64
|
unmount: () => void;
|
|
58
65
|
clickRow: (name: string) => Promise<void>;
|
|
@@ -203,21 +210,10 @@ export function createFileExplorerHarness(): FileExplorerHarness {
|
|
|
203
210
|
|
|
204
211
|
harness.container = document.createElement('div');
|
|
205
212
|
document.body.appendChild(harness.container);
|
|
206
|
-
await
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
children: h(FileExplorer, {
|
|
211
|
-
rootPath: ROOT,
|
|
212
|
-
enabled: true,
|
|
213
|
-
onOpenFile: (file: { path: string; name: string }) =>
|
|
214
|
-
harness.openedFiles.push({ path: file.path, name: file.name }),
|
|
215
|
-
}),
|
|
216
|
-
}),
|
|
217
|
-
harness.container,
|
|
218
|
-
);
|
|
219
|
-
});
|
|
220
|
-
for (let i = 0; i < 10; i += 1) await act(async () => {});
|
|
213
|
+
await renderPanel(true);
|
|
214
|
+
},
|
|
215
|
+
async setActive(active) {
|
|
216
|
+
await renderPanel(active);
|
|
221
217
|
},
|
|
222
218
|
async clickRow(name) {
|
|
223
219
|
// The deepest element whose own text is exactly `name`: `TreeItem` wraps
|
|
@@ -344,5 +340,11 @@ export function createFileExplorerHarness(): FileExplorerHarness {
|
|
|
344
340
|
return rowElementFor(harness.container, name);
|
|
345
341
|
},
|
|
346
342
|
};
|
|
343
|
+
/** Draw (or re-draw) the panel with the given visibility, then settle its reads. */
|
|
344
|
+
async function renderPanel(active: boolean) {
|
|
345
|
+
await renderFileExplorer(harness.container, SESSION, ROOT, active, (file) =>
|
|
346
|
+
harness.openedFiles.push({ path: file.path, name: file.name }),
|
|
347
|
+
);
|
|
348
|
+
}
|
|
347
349
|
return harness;
|
|
348
350
|
}
|
|
@@ -82,6 +82,17 @@ export function mountHarnessTable(
|
|
|
82
82
|
versions: HarnessVersionRow[],
|
|
83
83
|
onOpen?: (id: string) => void,
|
|
84
84
|
onUpdate?: (id: string) => Promise<string | null>,
|
|
85
|
+
/**
|
|
86
|
+
* The in-flight update state and its record. Kept apart from the positional
|
|
87
|
+
* arguments because only the log cases need it, and the earlier callers are
|
|
88
|
+
* about the row's layout.
|
|
89
|
+
*/
|
|
90
|
+
state?: {
|
|
91
|
+
updating?: string | null;
|
|
92
|
+
progress?: string | null;
|
|
93
|
+
log?: { harness: string; message: string | null } | null;
|
|
94
|
+
onOpenLog?: () => void;
|
|
95
|
+
},
|
|
85
96
|
): HTMLElement {
|
|
86
97
|
act(() =>
|
|
87
98
|
render(
|
|
@@ -90,7 +101,10 @@ export function mountHarnessTable(
|
|
|
90
101
|
versions,
|
|
91
102
|
onOpenHarness: onOpen ?? (() => {}),
|
|
92
103
|
onUpdate: onUpdate ?? (async () => null),
|
|
93
|
-
updating: null,
|
|
104
|
+
updating: state?.updating ?? null,
|
|
105
|
+
progress: state?.progress ?? null,
|
|
106
|
+
log: state?.log ?? null,
|
|
107
|
+
onOpenLog: state?.onOpenLog,
|
|
94
108
|
}),
|
|
95
109
|
container,
|
|
96
110
|
),
|
|
@@ -98,8 +112,11 @@ export function mountHarnessTable(
|
|
|
98
112
|
return container;
|
|
99
113
|
}
|
|
100
114
|
|
|
101
|
-
/** The rows, which are the direct children of the
|
|
115
|
+
/** The rows, which are the direct children of the grid that draws them. */
|
|
102
116
|
export function harnessRows(el: HTMLElement): HTMLElement[] {
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
// `data-harness-rows`, not the grid's scrollbar class: the list stopped being
|
|
118
|
+
// the scroller (the About card's body is), and a selector tied to a scrolling
|
|
119
|
+
// affordance silently returned no rows once it did.
|
|
120
|
+
const grid = el.querySelector('[data-harness-rows]');
|
|
121
|
+
return grid ? Array.from(grid.children) as HTMLElement[] : [];
|
|
105
122
|
}
|