Merge origin/main into brennanb2025/perf-ratchets

This commit is contained in:
Brennan Benson
2026-11-08 12:39:09 -08:00
1011 changed files with 12416 additions and 16974 deletions
+17 -7
View File
@@ -10,16 +10,19 @@ on:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
paths:
# The managed deploy runs on these remote install and runtime primitives.
- 'src/main/ssh/remote-*'
- 'src/main/ssh/*runtime*'
- 'src/main/ssh/orcad-*'
- 'src/main/ssh/runtime-access/**'
- 'src/main/managed-server/**'
- 'src/main/ssh/migration-source/**'
- 'src/main/persistence/migrating-orcad-catalog/**'
- 'src/main/orcad/orcad-artifact-materializer.ts'
- 'src/main/orcad/orcad-host-unavailable.ts'
- 'src/main/node-runtime/**'
- 'src/main/ssh/ssh-remote-*'
- 'src/main/ssh/remote-exec/**'
- 'src/main/ssh/remote-host/**'
- 'src/main/ssh/filesystem/**'
- 'src/main/ssh/hostile-host-test-support/**'
- 'src/main/ssh/sftp-*'
- 'src/main/ssh/file-transfer/sftp/**'
- 'src/shared/node-runtime-pin.ts'
- 'src/shared/orcad-artifacts.ts'
- 'config/scripts/build-orcad-*.mjs'
@@ -31,8 +34,15 @@ on:
- 'config/patches/node-pty*'
# The deploy runs over this SSH transport.
- 'src/main/ssh/connection/**'
- 'src/main/ssh/ssh-reconnect-error-classification.ts'
- 'src/main/ssh/ssh-posix-command-wrapper.ts'
- 'src/main/ssh/file-transfer/ssh-connection-file-transfers.ts'
- 'src/main/ssh/targets/ssh-connection-store.ts'
- 'src/main/ssh/targets/testing/ssh-connection-store-test-fixture.ts'
- 'src/main/ssh/targets/ssh-target-runtime-ownership.ts'
- 'src/main/ssh/authentication/ssh2-credential-fallback.ts'
- 'src/main/ssh/authentication/ssh2-handshake.ts'
- 'src/main/ssh/host-keys/ssh2-host-key-verification.ts'
- 'src/main/ssh/connection/reconnect/ssh-reconnect-error-classification.ts'
- 'src/main/ssh/remote-exec/ssh-posix-command-wrapper.ts'
- 'src/shared/shell/launch/shell-argument-quoting.ts'
- '!src/**/*.test.ts'
- 'src/main/ssh/hostile-host-test-support/ssh-hostile-hosts.docker.test.ts'
+17 -8
View File
@@ -8,16 +8,18 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
paths:
- 'src/main/ssh/remote-*'
- 'src/main/ssh/*runtime*'
- 'src/main/ssh/orcad-*'
- 'src/main/ssh/runtime-access/**'
- 'src/main/managed-server/**'
- 'src/main/ssh/migration-source/**'
- 'src/main/persistence/migrating-orcad-catalog/**'
- 'src/main/orcad/orcad-artifact-materializer.ts'
- 'src/main/orcad/orcad-host-unavailable.ts'
- 'src/main/node-runtime/**'
- 'src/main/ssh/ssh-remote-*'
- 'src/main/ssh/remote-exec/**'
- 'src/main/ssh/remote-host/**'
- 'src/main/ssh/filesystem/**'
- 'src/main/ssh/hostile-host-test-support/**'
- 'src/main/ssh/ssh-windows-host-*'
- 'src/main/ssh/hostile-host-test-support/ssh-windows-host-*'
- 'src/wsl-guest/**'
- 'src/packages/process-host/**'
- 'pnpm-workspace.yaml'
@@ -48,8 +50,15 @@ on:
- 'src/main/ipc/ssh/ssh-host-server-*.ts'
# The deploy runs over this SSH transport.
- 'src/main/ssh/connection/**'
- 'src/main/ssh/ssh-reconnect-error-classification.ts'
- 'src/main/ssh/ssh-posix-command-wrapper.ts'
- 'src/main/ssh/file-transfer/ssh-connection-file-transfers.ts'
- 'src/main/ssh/targets/ssh-connection-store.ts'
- 'src/main/ssh/targets/testing/ssh-connection-store-test-fixture.ts'
- 'src/main/ssh/targets/ssh-target-runtime-ownership.ts'
- 'src/main/ssh/authentication/ssh2-credential-fallback.ts'
- 'src/main/ssh/authentication/ssh2-handshake.ts'
- 'src/main/ssh/host-keys/ssh2-host-key-verification.ts'
- 'src/main/ssh/connection/reconnect/ssh-reconnect-error-classification.ts'
- 'src/main/ssh/remote-exec/ssh-posix-command-wrapper.ts'
- 'src/shared/shell/launch/shell-argument-quoting.ts'
- '!src/**/*.test.ts'
- 'src/main/managed-server/host-state/orcad-windows-host-lane.test.ts'
@@ -69,7 +78,7 @@ on:
workflow_dispatch:
inputs:
cells:
description: Comma-separated cell ids from src/main/ssh/ssh-windows-host-cells.ts; empty runs the default set (orcad-cli-* cells run only when named).
description: Comma-separated cell ids from src/main/ssh/hostile-host-test-support/ssh-windows-host-cells.ts; empty runs the default set (orcad-cli-* cells run only when named).
required: false
default: ''
preparation_mode:
+2 -1
View File
@@ -27,7 +27,8 @@ on:
- 'config/scripts/*orcad*'
- 'package.json'
- 'pnpm-lock.yaml'
- 'src/main/ssh/orcad-*'
- 'src/main/ssh/migration-source/**'
- 'src/main/persistence/migrating-orcad-catalog/**'
- 'src/main/managed-server/**'
- 'src/packages/process-host/**'
# Unit tests never run in this lane; only the real distro test below does.
+11 -24
View File
@@ -23,7 +23,7 @@
1 test-no-in-test-import-actual:src/main/speech/openai-api-key-store.test.ts
5 test-no-in-test-import-actual:src/main/ssh/config/ssh-config-loader-regression.test.ts
2 test-no-in-test-import-actual:src/main/ssh/connection/ssh-connection-auth-fallback.test.ts
1 test-no-in-test-import-actual:src/main/ssh/orcad-snapshot-room.test.ts
1 test-no-in-test-import-actual:src/main/managed-server/host-state/orcad-snapshot-room.test.ts
1 test-no-in-test-import-actual:src/main/window/dropped-path-preparation.test.ts
2 test-no-in-test-import-actual:src/main/workspace-hooks/hooks-runner.test.ts
1 test-no-in-test-import-actual:src/main/workspaces/removal/local-worktree-removal-recovery.test.ts
@@ -31,10 +31,7 @@
3 test-no-in-test-import-actual:src/renderer/src/components/terminal-pane/snapshots/remote-snapshot-alt-screen-host-chain.test.ts
1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-agent-status-pane-teardown.test.ts
1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-hydration.test.ts
2 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.ts
3 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts
1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts
1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.ts
1 test-no-in-test-import-actual:src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-routing.test.ts
1 test-no-polling-loop:src/main/browser/cookies/browser-cookie-import-concurrency.test.ts
1 test-no-polling-loop:src/main/claude/claude-stop-ack-race.test.ts
@@ -70,7 +67,7 @@
3 test-no-polling-loop:src/main/skills/install/skill-bundle-process-termination.integration.test.ts
2 test-no-polling-loop:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts
1 test-no-polling-loop:src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts
1 test-no-polling-loop:src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts
1 test-no-polling-loop:src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts
2 test-no-polling-loop:src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts
1 test-no-polling-loop:src/main/startup/run-electron-vite-dev.test.ts
2 test-no-polling-loop:src/main/windows/windows-host-job.win32.test.ts
@@ -150,7 +147,6 @@
1 test-no-polling-loop:tests/e2e/terminal-tui-wheel-reports.spec.ts
1 test-no-polling-loop:tests/e2e/workspace-sleep-in-main.spec.ts
2 test-no-polling-loop:tests/e2e/worktree-card-downward-drag.spec.ts
1 test-no-real-time-wait:mobile/src/tasks/worktree-create-retry.test.ts
1 test-no-real-time-wait:mobile/src/terminal/terminal-webview-tap-routing.test.ts
1 test-no-real-time-wait:src/main/agent-hooks/posix-hook-json-stdin-reader.test.ts
3 test-no-real-time-wait:src/main/agent-hooks/server-copilot-normalization.test.ts
@@ -258,11 +254,7 @@
1 test-no-real-time-wait:src/main/skills/cloud/skill-cloud-direct-upload.test.ts
2 test-no-real-time-wait:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts
4 test-no-real-time-wait:src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts
1 test-no-real-time-wait:src/main/ssh/legacy-relay/legacy-relay-cli-server.test.ts
1 test-no-real-time-wait:src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts
2 test-no-real-time-wait:src/main/ssh/sftp-upload.test.ts
1 test-no-real-time-wait:src/main/ssh/ssh-credential-prompt-login-grace-wire.test.ts
2 test-no-real-time-wait:src/main/ssh/ssh-quit-abort-upload.test.ts
1 test-no-real-time-wait:src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts
2 test-no-real-time-wait:src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts
3 test-no-real-time-wait:src/main/startup/run-electron-vite-dev.test.ts
2 test-no-real-time-wait:src/main/startup/windows-install-dir-acl-recovery.test.ts
@@ -630,12 +622,11 @@
2 test-no-wall-clock:src/main/skills/transaction-state/skill-transaction-startup-recovery.test.ts
4 test-no-wall-clock:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts
4 test-no-wall-clock:src/main/sqlite/sync-database.test.ts
1 test-no-wall-clock:src/main/ssh/legacy-relay/legacy-relay-bridge-runtime-exit.test.ts
4 test-no-wall-clock:src/main/ssh/orcad-exited-own-fence-mutation-race.test.ts
8 test-no-wall-clock:src/main/ssh/orcad-exited-own-fence.test.ts
6 test-no-wall-clock:src/main/ssh/orcad-exited-own-install-lock.test.ts
2 test-no-wall-clock:src/main/ssh/orcad-exited-own-lock-windows.test.ts
4 test-no-wall-clock:src/main/ssh/ssh-remote-commands.test.ts
4 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-fence-mutation-race.test.ts
8 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-fence.test.ts
4 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-install-lock.test.ts
2 test-no-wall-clock:src/main/managed-server/activation/orcad-exited-own-lock-windows.test.ts
4 test-no-wall-clock:src/main/ssh/remote-exec/ssh-remote-commands.test.ts
2 test-no-wall-clock:src/main/star-nag/service-direct-star.test.ts
3 test-no-wall-clock:src/main/star-nag/service-threshold-prompt.test.ts
1 test-no-wall-clock:src/main/startup/gpu-lifecycle-install-dir-acl-guard.test.ts
@@ -676,9 +667,6 @@
4 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.test.tsx
2 test-no-wall-clock:src/renderer/src/hooks/ipc-events/agent-status-terminal-title-tab-write.test.ts
1 test-no-wall-clock:src/renderer/src/hooks/useIpcEvents-agent-status-hook-titles.test.ts
2 test-no-wall-clock:src/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.ts
3 test-no-wall-clock:src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts
1 test-no-wall-clock:src/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.ts
1 test-no-wall-clock:src/renderer/src/lib/paired-runtime-closed-tab-resume.test.ts
2 test-no-wall-clock:src/renderer/src/lib/use-tab-agent-observed-signal-dispatch.test.tsx
2 test-no-wall-clock:src/renderer/src/lib/wake-sleeping-agents-live-unmounted-pane.test.ts
@@ -798,10 +786,9 @@
1 test-timeout-needs-reason:src/main/skills/install/skill-bundle-process-termination.integration.test.ts
1 test-timeout-needs-reason:src/main/sqlite/sync-database-concurrent-backup.test.ts
2 test-timeout-needs-reason:src/main/ssh/connection/ssh-connection-sftp-wire.test.ts
1 test-timeout-needs-reason:src/main/ssh/orcad-exited-own-fence.test.ts
1 test-timeout-needs-reason:src/main/ssh/ssh-credential-prompt-login-grace-wire.test.ts
1 test-timeout-needs-reason:src/main/ssh/ssh-exec-stdin-file-transfer.test.ts
2 test-timeout-needs-reason:src/main/ssh/system-transport/system-ssh-forward-process-real-openssh.test.ts
1 test-timeout-needs-reason:src/main/managed-server/activation/orcad-exited-own-fence.test.ts
1 test-timeout-needs-reason:src/main/ssh/file-transfer/ssh-exec-stdin-file-transfer.test.ts
2 test-timeout-needs-reason:src/main/ssh/system-transport/forwarding/system-ssh-forward-process-real-openssh.test.ts
2 test-timeout-needs-reason:src/main/startup/single-instance-lock-exit.electron.test.ts
1 test-timeout-needs-reason:src/main/window/renderer-publication-throttle.electron.test.ts
1 test-timeout-needs-reason:src/main/windows/windows-administrator-restart.win32.test.ts
+7 -8
View File
@@ -10,14 +10,13 @@ src/main/ipc/ssh/ssh-session-teardown.ts
src/main/ipc/ssh/ssh.ts
src/main/runtime/orchestration/terminal-authority/verify-orchestration-compatibility-caller.ts
src/main/runtime/orchestration/terminal-authority/orchestration-compatibility-authority.ts
src/main/ssh/orcad-migration-delta-move.test.ts
src/main/ssh/orcad-migration-delta-move.ts
src/main/ssh/orcad-migration-repository-link.test.ts
src/main/ssh/orcad-migration-terminal-gate-host-wide.test.ts
src/main/ssh/orcad-migration-terminal-gate.test.ts
src/main/ssh/orcad-migration-terminal-gate.ts
src/main/ssh/ssh-host-server-on-connect.test.ts
src/main/ssh/ssh-host-server-on-connect.ts
src/main/managed-server/migration/cutover/orcad-migration-delta-move.test.ts
src/main/managed-server/migration/cutover/orcad-migration-delta-move.ts
src/main/managed-server/migration/linking/orcad-migration-repository-link.test.ts
src/main/ssh/migration-source/orcad-migration-terminal-gate.test.ts
src/main/ssh/migration-source/orcad-migration-terminal-gate.ts
src/main/ssh/host-server/ssh-host-server-on-connect.test.ts
src/main/ssh/host-server/ssh-host-server-on-connect.ts
src/main/ssh/targets/ssh-target-orcad-preflight.ts
src/preload/api-types.ts
src/preload/api/legacy-relay-bridge-api.ts
+3 -1
View File
@@ -9,7 +9,9 @@ src/main/ipc/ssh/ssh-connect-flow.ts
src/main/ipc/ssh/ssh-host-server-on-connect-wiring.ts
src/main/ipc/ssh/ssh-session-teardown.ts
src/main/ipc/ssh/ssh.ts
src/main/ssh/orcad-migration-terminal-gate-host-wide.test.ts
src/main/managed-server/lifecycle/orcad-runtime-conversion-wiring.ts
tests/e2e/cross-version-wire/legacy-relay-bridge.unit.test.ts
tests/e2e/helpers/legacy-relay-docker-host.ts
src/main/managed-server/install/remote-install-model.ts
src/main/ssh/system-transport/ssh-system-transport.integration.test.ts
src/main/ssh/migration-source/orcad-migration-bridged-panes.test.ts
+1 -1
View File
@@ -72,5 +72,5 @@
3 src/main/runtime/terminal/surface/mobile-session-layout-projection.ts
1 src/main/runtime/workspaces/session-hosts/get-runtime-id.ts
1 src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller.ts
1 src/main/ssh/orcad-migration-source-retention.ts
1 src/main/persistence/migrating-orcad-catalog/orcad-migration-source-retention.ts
1 src/main/ssh/targets/ssh-target-id-migration.ts
+1 -1
View File
@@ -3,6 +3,6 @@
# split the oversized file instead.
# Regenerate/prune: pnpm check:max-lines-ratchet --prune (removes stale entries only)
inline src/main/ipc/worktree-remote.ts
inline src/main/ssh/ssh-channel-multiplexer.ts
inline src/main/ssh/protocol/ssh-channel-multiplexer.ts
inline src/main/ssh/connection/ssh-connection.ts
inline src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport.ts
@@ -90,10 +90,10 @@ src/main/rate-limits/gemini-cli-oauth-extractor.ts
src/main/runtime/rpc/server/pairing/network/windows-default-route-interfaces.ts
src/main/runtime/rpc/server/pairing/network/windows-mobile-firewall.ts
src/main/ssh/connection/ssh-connection.ts
src/main/ssh/ssh-proxy-command.ts
src/main/ssh/system-transport/ssh-proxy-command.ts
src/main/ssh/system-transport/system-ssh-command.ts
src/main/ssh/system-transport/system-ssh-dynamic-forward-process.ts
src/main/ssh/system-transport/system-ssh-file-transfer.ts
src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.ts
src/main/ssh/system-transport/file-transfer/system-ssh-file-transfer.ts
src/main/ssh/system-transport/system-ssh-operation-lifecycle.ts
src/main/startup/ensure-virtual-display.ts
src/main/pty/process-retirement/windows-process-tree-kill.ts
File diff suppressed because one or more lines are too long
+119 -136
View File
@@ -4140,8 +4140,8 @@
"src/main/sqlite/sync-database-concurrent-backup.test.ts": 1141,
"src/main/sqlite/sync-database-portability.test.ts": 147,
"src/main/sqlite/sync-database.test.ts": 860,
"src/main/ssh/connection/ssh-expired-lease-pane-readoption.test.ts": 2799,
"src/main/ssh/connection/ssh-reattach-pane-cardinality.test.ts": 1778,
"src/main/ipc/pty/pane/ssh-expired-lease-pane-readoption.test.ts": 2799,
"src/main/persistence/loading-store/ssh-reattach-pane-cardinality.test.ts": 1778,
"src/main/ssh/config/ssh-config-alias-claim.test.ts": 58,
"src/main/ssh/config/ssh-config-host-picker.test.ts": 221,
"src/main/ssh/config/ssh-config-loader-regression.test.ts": 102,
@@ -4149,19 +4149,18 @@
"src/main/ssh/config/ssh-config-parser-host-patterns.test.ts": 50,
"src/main/ssh/config/ssh-config-parser.test.ts": 315,
"src/main/ssh/config/ssh-g-config-resolution.test.ts": 125,
"src/main/ssh/config/ssh-known-hosts-source.test.ts": 124,
"src/main/ssh/config/ssh-known-hosts.test.ts": 105,
"src/main/ssh/config/zed-ssh-url.test.ts": 55,
"src/main/ssh/host-keys/ssh-known-hosts-source.test.ts": 124,
"src/main/ssh/host-keys/ssh-known-hosts.test.ts": 105,
"src/main/ssh/external-editors/zed-ssh-url.test.ts": 55,
"src/main/ssh/connection/ssh-connect-config.test.ts": 182,
"src/main/ssh/connection/ssh-connection-attribution.test.ts": 44,
"src/main/ssh/connection/ssh-connection-auth-fallback.test.ts": 512,
"src/main/ssh/connection/ssh-connection-channel-error.test.ts": 461,
"src/main/ssh/connection/ssh-connection-channel-lifetime.test.ts": 61,
"src/main/ssh/connection/ssh-connection-channel-open.test.ts": 1230,
"src/main/ssh/connection/ssh-connection-direct-startup.test.ts": 350,
"src/main/ssh/connection/ssh-connection-file-transfer-session-lost.test.ts": 5247,
"src/main/ssh/file-transfer/ssh-connection-file-transfer-session-lost.test.ts": 5247,
"src/main/ssh/connection/ssh-connection-file-transfer.test.ts": 335,
"src/main/ssh/connection/ssh-connection-generation.test.ts": 53,
"src/main/ssh/connection/authority/ssh-connection-generation.test.ts": 53,
"src/main/ssh/connection/ssh-connection-gssapi-fallback.test.ts": 420,
"src/main/ssh/connection/ssh-connection-host-key-pin-race.test.ts": 462,
"src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts": 776,
@@ -4174,143 +4173,130 @@
"src/main/ssh/connection/ssh-connection-reconnect-ladder.test.ts": 570,
"src/main/ssh/connection/ssh-connection-sftp-namespace.test.ts": 1290,
"src/main/ssh/connection/ssh-connection-sftp-wire.test.ts": 481,
"src/main/ssh/connection/ssh-connection-store-orcad-ownership.test.ts": 324,
"src/main/ssh/connection/ssh-connection-store-route-dedupe.test.ts": 350,
"src/main/ssh/connection/ssh-connection-store.test.ts": 377,
"src/main/ssh/targets/ssh-connection-store-orcad-ownership.test.ts": 324,
"src/main/ssh/targets/ssh-connection-store-route-dedupe.test.ts": 350,
"src/main/ssh/targets/ssh-connection-store.test.ts": 377,
"src/main/ssh/connection/ssh-connection-system-transport.test.ts": 458,
"src/main/ssh/connection/ssh-connection-wake-retry.test.ts": 478,
"src/main/ssh/connection/ssh-connection.test.ts": 1570,
"src/main/ssh/hostile-host-test-support/ssh-hostile-hosts.docker.test.ts": 602,
"src/main/ssh/legacy-relay/legacy-relay-bridge-relay-restart.test.ts": 98,
"src/main/ssh/legacy-relay/legacy-relay-bridge-restart-stop.test.ts": 3114,
"src/main/ssh/legacy-relay/legacy-relay-bridge-runtime-exit.test.ts": 3411,
"src/main/ssh/legacy-relay/legacy-relay-bridge-timers.test.ts": 41,
"src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.test.ts": 7977,
"src/main/ssh/legacy-relay/legacy-relay-cli-legacy-records.test.ts": 6234,
"src/main/ssh/legacy-relay/legacy-relay-cli-output.test.ts": 150,
"src/main/ssh/legacy-relay/legacy-relay-cli-server.test.ts": 9385,
"src/main/ssh/legacy-relay/legacy-relay-client.test.ts": 109,
"src/main/ssh/legacy-relay/legacy-relay-hidden-output.test.ts": 179,
"src/main/ssh/legacy-relay/legacy-relay-target-bridge.test.ts": 167,
"src/main/ssh/legacy-relay/orcad-migration-bridged-panes.test.ts": 322,
"src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.test.ts": 53,
"src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts": 232,
"src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.test.ts": 178,
"src/main/ssh/legacy-relay/ssh-host-relay-windows-pipe-access.test.ts": 211,
"src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts": 1546,
"src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.test.ts": 49,
"src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts": 5357,
"src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts": 74,
"src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts": 392,
"src/main/ssh/managed-server-fence-recheck.test.ts": 436,
"src/main/ssh/managed-server-update-check.test.ts": 316,
"src/main/ssh/managed-server-update-deps.test.ts": 319,
"src/main/ssh/orcad-bash-stdio-bridge.test.ts": 4062,
"src/main/ssh/orcad-exited-own-fence-mutation-race.test.ts": 839,
"src/main/ssh/orcad-exited-own-fence.test.ts": 6057,
"src/main/ssh/orcad-exited-own-install-lock.test.ts": 382,
"src/main/ssh/orcad-exited-own-lock-windows.test.ts": 320,
"src/main/ssh/orcad-fence-lost-classification.test.ts": 227,
"src/main/ssh/orcad-fenced-stop.test.ts": 99,
"src/main/ssh/orcad-launch-ssh-session.test.ts": 689,
"src/main/ssh/orcad-migration-blob-coordinator.test.ts": 1464,
"src/main/ssh/orcad-migration-catalog-client-frame-budget.test.ts": 405,
"src/main/ssh/orcad-migration-catalog-client-source-kind.test.ts": 400,
"src/main/ssh/orcad-migration-catalog-client.test.ts": 400,
"src/main/ssh/orcad-migration-cutover-coordinator.test.ts": 2408,
"src/main/ssh/orcad-migration-cutover-journal.test.ts": 369,
"src/main/ssh/orcad-migration-delta-move.test.ts": 3812,
"src/main/ssh/orcad-migration-delta-snapshot.test.ts": 2611,
"src/main/ssh/orcad-migration-manifest-export.test.ts": 613,
"src/main/ssh/orcad-migration-repository-link.test.ts": 4281,
"src/main/ssh/orcad-migration-snapshot-coordinator.test.ts": 309,
"src/main/ssh/orcad-migration-snapshot-resume.test.ts": 1878,
"src/main/ssh/orcad-migration-source-fence.test.ts": 2000,
"src/main/ssh/orcad-migration-source-retention.test.ts": 2297,
"src/main/ssh/orcad-migration-ssh-relay-source.test.ts": 1903,
"src/main/ssh/orcad-migration-stuck-host-profiles.test.ts": 2402,
"src/main/ssh/orcad-migration-terminal-gate-host-wide.test.ts": 261,
"src/main/ssh/orcad-migration-terminal-gate.test.ts": 63,
"src/main/ssh/orcad-remote-deploy.test.ts": 537,
"src/main/ssh/orcad-retained-fence-takeover.test.ts": 210,
"src/main/ssh/orcad-retained-source-changes.test.ts": 2185,
"src/main/ssh/orcad-runtime-maintenance.test.ts": 916,
"src/main/ssh/orcad-snapshot-room.test.ts": 402,
"src/main/ssh/orcad-stdio-bridge.test.ts": 627,
"src/main/ssh/orcad-terminal-census-client.test.ts": 217,
"src/main/ssh/orcad-tunneled-pairing.test.ts": 94,
"src/main/ssh/orcad-unreachable-setup-release.test.ts": 2336,
"src/main/ssh/pinned-runtime-host-target.test.ts": 45,
"src/main/ssh/legacy-relay/bridge/legacy-relay-bridge-relay-restart.test.ts": 98,
"src/main/ssh/legacy-relay/bridge/legacy-relay-bridge-restart-stop.test.ts": 3114,
"src/main/ssh/legacy-relay/bridge/legacy-relay-bridge-runtime-exit.test.ts": 3411,
"src/main/ssh/legacy-relay/cli/legacy-relay-cli-call-limits.test.ts": 7977,
"src/main/ssh/legacy-relay/cli/legacy-relay-cli-legacy-records.test.ts": 6234,
"src/main/ssh/legacy-relay/cli/legacy-relay-cli-server.test.ts": 9385,
"src/main/ssh/legacy-relay/bridge/legacy-relay-client.test.ts": 109,
"src/main/ssh/legacy-relay/bridge/legacy-relay-hidden-output.test.ts": 179,
"src/main/ssh/legacy-relay/bridge/legacy-relay-target-bridge.test.ts": 167,
"src/main/ssh/migration-source/orcad-migration-bridged-panes.test.ts": 322,
"src/main/ssh/legacy-relay/endpoints/ssh-host-relay-census-for-target.test.ts": 53,
"src/main/ssh/legacy-relay/endpoints/ssh-host-relay-windows-census.test.ts": 232,
"src/main/ssh/legacy-relay/endpoints/ssh-host-relay-windows-inventory.test.ts": 178,
"src/main/ssh/legacy-relay/endpoints/ssh-host-relay-windows-pipe-access.test.ts": 211,
"src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts": 1546,
"src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-runtime.test.ts": 49,
"src/main/ssh/legacy-relay/endpoints/ssh-relay-incumbent-process.test.ts": 5357,
"src/main/ssh/legacy-relay/handshake/ssh-relay-sentinel-copy-budget.test.ts": 74,
"src/main/ssh/legacy-relay/handshake/ssh-relay-sentinel.test.ts": 392,
"src/main/managed-server/lifecycle/orcad-bash-stdio-bridge.test.ts": 4062,
"src/main/managed-server/activation/orcad-exited-own-fence-mutation-race.test.ts": 839,
"src/main/managed-server/activation/orcad-exited-own-fence.test.ts": 6057,
"src/main/managed-server/activation/orcad-exited-own-install-lock.test.ts": 382,
"src/main/managed-server/activation/orcad-exited-own-lock-windows.test.ts": 320,
"src/main/managed-server/host-state/orcad-fence-lost-classification.test.ts": 227,
"src/main/managed-server/activation/orcad-fenced-stop.test.ts": 99,
"src/main/managed-server/install/orcad-launch-ssh-session.test.ts": 689,
"src/main/managed-server/migration/transfers/orcad-migration-blob-coordinator.test.ts": 1464,
"src/main/managed-server/migration/catalog/orcad-migration-catalog-client-frame-budget.test.ts": 405,
"src/main/managed-server/migration/catalog/orcad-migration-catalog-client-source-kind.test.ts": 400,
"src/main/managed-server/migration/catalog/orcad-migration-catalog-client.test.ts": 400,
"src/main/managed-server/migration/cutover/orcad-migration-cutover-coordinator.test.ts": 2408,
"src/main/persistence/migrating-orcad-catalog/orcad-migration-cutover-journal.test.ts": 369,
"src/main/managed-server/migration/cutover/orcad-migration-delta-move.test.ts": 3812,
"src/main/managed-server/migration/cutover/orcad-migration-delta-snapshot.test.ts": 2611,
"src/main/managed-server/migration/linking/orcad-migration-repository-link.test.ts": 4281,
"src/main/managed-server/migration/transfers/orcad-migration-snapshot-coordinator.test.ts": 309,
"src/main/ssh/migration-source/orcad-migration-source-fence.test.ts": 2000,
"src/main/persistence/migrating-orcad-catalog/orcad-migration-source-retention.test.ts": 2297,
"src/main/ssh/migration-source/orcad-migration-ssh-relay-source.test.ts": 1903,
"src/main/managed-server/migration/cutover/orcad-migration-stuck-host-profiles.test.ts": 2402,
"src/main/ssh/migration-source/orcad-migration-terminal-gate.test.ts": 63,
"src/main/managed-server/install/orcad-remote-deploy.test.ts": 537,
"src/main/managed-server/activation/orcad-retained-fence-takeover.test.ts": 210,
"src/main/persistence/migrating-orcad-catalog/orcad-retained-source-changes.test.ts": 2185,
"src/main/managed-server/lifecycle/orcad-runtime-maintenance.test.ts": 916,
"src/main/managed-server/host-state/orcad-snapshot-room.test.ts": 402,
"src/main/managed-server/lifecycle/orcad-stdio-bridge.test.ts": 627,
"src/main/managed-server/lifecycle/orcad-terminal-census-client.test.ts": 217,
"src/main/managed-server/lifecycle/orcad-tunneled-pairing.test.ts": 94,
"src/main/managed-server/migration/cutover/orcad-unreachable-setup-release.test.ts": 2336,
"src/main/managed-server/install/pinned-runtime-host-target.test.ts": 45,
"src/main/ssh/plain-ssh-terminal/plain-ssh-terminal-args.test.ts": 49,
"src/main/ssh/plain-ssh-terminal/plain-ssh-terminal-sessions.test.ts": 272,
"src/main/ssh/port-forwarding/ssh-port-forward.test.ts": 235,
"src/main/ssh/port-forwarding/ssh2-port-forward-listen.test.ts": 44,
"src/main/ssh/remote-exec/remote-exec-command.test.ts": 84,
"src/main/ssh/remote-exec/remote-exec-input.test.ts": 71,
"src/main/ssh/remote-exec/remote-frame-protocol.test.ts": 126,
"src/main/ssh/remote-exec/remote-host-failure-producers.test.ts": 356,
"src/main/ssh/runtime-ssh-access.test.ts": 739,
"src/main/ssh/sftp-stream-late-error.test.ts": 209,
"src/main/ssh/sftp-upload-pipeline.test.ts": 480,
"src/main/ssh/sftp-upload.test.ts": 533,
"src/main/ssh/ssh-agent-identity-filter.test.ts": 54,
"src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts": 102,
"src/main/ssh/ssh-channel-multiplexer-saturation-wedge.test.ts": 60,
"src/main/ssh/ssh-channel-multiplexer-settlement.test.ts": 56,
"src/main/ssh/ssh-channel-multiplexer.test.ts": 120,
"src/main/ssh/ssh-connect-attempt-cancellation.test.ts": 45,
"src/main/ssh/ssh-control-socket.test.ts": 55,
"src/main/ssh/ssh-credential-decline.test.ts": 115,
"src/main/ssh/ssh-credential-prompt-login-grace-wire.test.ts": 6570,
"src/main/ssh/ssh-exec-command-decoder-fallback.test.ts": 290,
"src/main/ssh/ssh-exec-rc-stdout-noise.test.ts": 262,
"src/main/ssh/ssh-exec-stdin-file-transfer.test.ts": 324,
"src/main/ssh/ssh-file-transfer-abort.test.ts": 51,
"src/main/ssh/ssh-host-key-store.test.ts": 238,
"src/main/ssh/ssh-host-key-verifier.test.ts": 97,
"src/main/ssh/ssh-host-platform-memo.test.ts": 38,
"src/main/ssh/ssh-host-proxy-environment.test.ts": 170,
"src/main/ssh/ssh-host-server-on-connect-held-move.test.ts": 510,
"src/main/ssh/ssh-host-server-on-connect-node-download.test.ts": 455,
"src/main/ssh/ssh-host-server-on-connect-stopped-elsewhere.test.ts": 55,
"src/main/ssh/ssh-host-server-on-connect-telemetry.test.ts": 440,
"src/main/ssh/ssh-host-server-on-connect.test.ts": 536,
"src/main/ssh/ssh-host-server-telemetry.test.ts": 194,
"src/main/ssh/ssh-identity-file-read.test.ts": 111,
"src/main/ssh/ssh-keyboard-interactive-wire.test.ts": 471,
"src/main/ssh/ssh-keyboard-interactive.test.ts": 54,
"src/main/ssh/ssh-multi-factor-authentication.test.ts": 269,
"src/main/ssh/ssh-multi-key-authentication.test.ts": 160,
"src/main/ssh/ssh-multiplexer-transport-writer.test.ts": 66,
"src/main/ssh/ssh-multiplexer-writer-retention.test.ts": 561,
"src/main/ssh/ssh-posix-command-wrapper.test.ts": 238,
"src/main/ssh/ssh-proxy-command.test.ts": 83,
"src/main/ssh/ssh-quit-abort-upload.test.ts": 268,
"src/main/ssh/ssh-remote-commands.test.ts": 9359,
"src/main/ssh/ssh-remote-directory-browse.test.ts": 175,
"src/main/ssh/ssh-remote-node-resolution.test.ts": 283,
"src/main/ssh/ssh-remote-platform-detection.test.ts": 177,
"src/main/ssh/ssh-remote-platform.test.ts": 51,
"src/main/ssh/ssh-remote-windows-command-line-limit.test.ts": 164,
"src/main/ssh/ssh-security-key-identity.test.ts": 142,
"src/main/ssh/ssh-system-transport.integration.test.ts": 401,
"src/main/ssh/ssh-tcp-forwarding-probe.test.ts": 971,
"src/main/ssh/ssh2-module-load.test.ts": 271,
"src/main/ssh/protocol/remote-frame-protocol.test.ts": 126,
"src/main/ssh/system-transport/remote-host-failure-producers.test.ts": 356,
"src/main/ssh/runtime-access/runtime-ssh-access.test.ts": 739,
"src/main/ssh/file-transfer/sftp/sftp-stream-late-error.test.ts": 209,
"src/main/ssh/file-transfer/sftp/sftp-upload-pipeline.test.ts": 480,
"src/main/ssh/file-transfer/sftp/sftp-upload.test.ts": 533,
"src/main/ssh/authentication/ssh-agent-identity-filter.test.ts": 54,
"src/main/ssh/protocol/ssh-channel-multiplexer-backpressure.test.ts": 102,
"src/main/ssh/protocol/ssh-channel-multiplexer-saturation-wedge.test.ts": 60,
"src/main/ssh/protocol/ssh-channel-multiplexer-settlement.test.ts": 56,
"src/main/ssh/protocol/ssh-channel-multiplexer.test.ts": 120,
"src/main/ssh/connection/reconnect/ssh-connect-attempt-cancellation.test.ts": 45,
"src/main/ssh/system-transport/ssh-control-socket.test.ts": 55,
"src/main/ssh/remote-exec/ssh-exec-command-decoder-fallback.test.ts": 290,
"src/main/ssh/remote-exec/ssh-exec-rc-stdout-noise.test.ts": 262,
"src/main/ssh/file-transfer/ssh-exec-stdin-file-transfer.test.ts": 324,
"src/main/ssh/file-transfer/ssh-file-transfer-abort.test.ts": 51,
"src/main/ssh/host-keys/ssh-host-key-store.test.ts": 238,
"src/main/ssh/host-keys/ssh-host-key-verifier.test.ts": 97,
"src/main/ssh/remote-host/ssh-host-proxy-environment.test.ts": 170,
"src/main/ssh/host-server/ssh-host-server-on-connect-held-move.test.ts": 510,
"src/main/ssh/host-server/ssh-host-server-on-connect-node-download.test.ts": 455,
"src/main/managed-server/lifecycle/ssh-host-server-on-connect-stopped-elsewhere.test.ts": 55,
"src/main/ssh/host-server/ssh-host-server-on-connect-telemetry.test.ts": 440,
"src/main/ssh/host-server/ssh-host-server-on-connect.test.ts": 536,
"src/main/ssh/host-server/ssh-host-server-telemetry.test.ts": 194,
"src/main/ssh/authentication/ssh-identity-file-read.test.ts": 111,
"src/main/ssh/authentication/ssh-keyboard-interactive.test.ts": 54,
"src/main/ssh/authentication/ssh-multi-factor-authentication.test.ts": 269,
"src/main/ssh/authentication/ssh-multi-key-authentication.test.ts": 160,
"src/main/ssh/protocol/ssh-multiplexer-transport-writer.test.ts": 66,
"src/main/ssh/protocol/ssh-multiplexer-writer-retention.test.ts": 561,
"src/main/ssh/remote-exec/ssh-posix-command-wrapper.test.ts": 238,
"src/main/ssh/system-transport/ssh-proxy-command.test.ts": 83,
"src/main/ssh/remote-exec/ssh-remote-commands.test.ts": 9359,
"src/main/ssh/filesystem/ssh-remote-directory-browse.test.ts": 175,
"src/main/ssh/remote-host/node-toolchain/ssh-remote-node-resolution.test.ts": 283,
"src/main/ssh/remote-host/ssh-remote-platform-detection.test.ts": 177,
"src/main/ssh/remote-host/ssh-remote-platform.test.ts": 51,
"src/main/ssh/remote-exec/ssh-remote-windows-command-line-limit.test.ts": 164,
"src/main/ssh/authentication/ssh-security-key-identity.test.ts": 142,
"src/main/ssh/system-transport/ssh-system-transport.integration.test.ts": 401,
"src/main/ssh/port-forwarding/ssh-tcp-forwarding-probe.test.ts": 971,
"src/main/ssh/system-transport/system-ssh-binary.test.ts": 53,
"src/main/ssh/system-transport/system-ssh-dynamic-forward-process.test.ts": 120,
"src/main/ssh/system-transport/system-ssh-forward-port-reservation.test.ts": 51,
"src/main/ssh/system-transport/system-ssh-forward-process-real-openssh.test.ts": 106,
"src/main/ssh/system-transport/system-ssh-forward-process.test.ts": 147,
"src/main/ssh/system-transport/system-ssh-loopback-route-admission.test.ts": 225,
"src/main/ssh/system-transport/system-ssh-loopback-route.test.ts": 622,
"src/main/ssh/system-transport/system-ssh-muxed-forward-cancel.test.ts": 61,
"src/main/ssh/system-transport/forwarding/system-ssh-dynamic-forward-process.test.ts": 120,
"src/main/ssh/system-transport/forwarding/system-ssh-forward-port-reservation.test.ts": 51,
"src/main/ssh/system-transport/forwarding/system-ssh-forward-process-real-openssh.test.ts": 106,
"src/main/ssh/system-transport/forwarding/system-ssh-forward-process.test.ts": 147,
"src/main/ssh/system-transport/forwarding/system-ssh-loopback-route-admission.test.ts": 225,
"src/main/ssh/system-transport/forwarding/system-ssh-loopback-route.test.ts": 622,
"src/main/ssh/system-transport/forwarding/system-ssh-muxed-forward-cancel.test.ts": 61,
"src/main/ssh/system-transport/system-ssh-operations.test.ts": 197,
"src/main/ssh/system-transport/system-ssh-orphaned-forward.test.ts": 114,
"src/main/ssh/system-transport/system-ssh-sftp-args.test.ts": 52,
"src/main/ssh/system-transport/system-ssh-sftp-path.test.ts": 52,
"src/main/ssh/system-transport/system-ssh-upload-plan-budget.test.ts": 348,
"src/main/ssh/system-transport/system-ssh-windows-upload.test.ts": 288,
"src/main/ssh/system-transport/system-ssh-windows-write-capabilities.test.ts": 43,
"src/main/ssh/system-transport/forwarding/system-ssh-orphaned-forward.test.ts": 114,
"src/main/ssh/system-transport/file-transfer/system-ssh-sftp-args.test.ts": 52,
"src/main/ssh/system-transport/file-transfer/system-ssh-sftp-path.test.ts": 52,
"src/main/ssh/system-transport/file-transfer/system-ssh-upload-plan-budget.test.ts": 348,
"src/main/ssh/system-transport/file-transfer/system-ssh-windows-upload.test.ts": 288,
"src/main/ssh/targets/ssh-target-id-migration.test.ts": 50,
"src/main/ssh/targets/ssh-target-identity.test.ts": 43,
"src/main/ssh/targets/ssh-target-orcad-claims.test.ts": 265,
@@ -6355,10 +6341,8 @@
"src/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.ts": 3310,
"src/renderer/src/hooks/useIpcEvents-browser-certificate-failure.test.ts": 2981,
"src/renderer/src/hooks/useIpcEvents-browser-navigation.test.ts": 1511,
"src/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.ts": 2096,
"src/renderer/src/hooks/useIpcEvents-client-hosted-browser-rows.test.ts": 1894,
"src/renderer/src/hooks/useIpcEvents-close-routing-active-browser-tab.test.ts": 4572,
"src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts": 2554,
"src/renderer/src/hooks/useIpcEvents-close-routing-session-tabs.test.ts": 5812,
"src/renderer/src/hooks/useIpcEvents-cmd-j-digit-chord.test.ts": 2703,
"src/renderer/src/hooks/useIpcEvents-lifecycle.test.ts": 2326,
@@ -6366,7 +6350,6 @@
"src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts": 1597,
"src/renderer/src/hooks/useIpcEvents-runtime-environment-selectors.test.ts": 530,
"src/renderer/src/hooks/useIpcEvents-session-tab-close-request.test.ts": 2252,
"src/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.ts": 1581,
"src/renderer/src/hooks/useIssueMetadata.test.tsx": 344,
"src/renderer/src/hooks/useMacTccAttributionSeveredNotice.test.tsx": 2358,
"src/renderer/src/hooks/useMetadataListRequest.test.tsx": 266,
@@ -1,11 +1,11 @@
import { spawnSync } from 'node:child_process'
const defaultFiles = [
'src/main/ssh/sftp-upload.test.ts',
'src/main/ssh/ssh-file-transfer-abort.test.ts',
'src/main/ssh/file-transfer/sftp/sftp-upload.test.ts',
'src/main/ssh/file-transfer/ssh-file-transfer-abort.test.ts',
'src/main/ssh/ssh-relay-install-namespace.test.ts',
'src/main/ssh/connection/ssh-connection-sftp-wire.test.ts',
'src/main/ssh/ssh-remote-commands.test.ts'
'src/main/ssh/remote-exec/ssh-remote-commands.test.ts'
]
const cliArguments = process.argv.slice(2)
@@ -7,8 +7,8 @@ const NODE_RUNTIME_INCLUDE = [
'tests/e2e/linear-cli-recovery.unit.test.ts',
'src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts',
'config/scripts/ci/workflow-contracts/cloud-security-history-workflow.test.mjs',
'src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts',
'src/main/ssh/ssh-remote-commands.test.ts',
'src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts',
'src/main/ssh/remote-exec/ssh-remote-commands.test.ts',
'src/packages/process-host/src/run-process.test.ts',
'tests/e2e/cursor-quota-transport.unit.test.ts',
'tests/e2e/helpers/electron-process-shutdown.unit.test.ts',
+1 -1
View File
@@ -10,4 +10,4 @@
1 src/main/ipc/pty/provider/ownership-state.ts # deletePtyOwnership, test-only caller
1 src/main/ipc/pty/provider/state-cleanup.ts # clearPtyOwnershipForConnection, test-only caller
3 src/main/ipc/pty/runtime/kill.ts # 2x SSH provider unregistered (R4-4); unconfirmed follow-up stop of a rejected spawn
1 src/main/ssh/legacy-relay/legacy-relay-pane-stops.ts # COMPAT(legacy-relay-bridge): deleted with the folder
1 src/main/ssh/legacy-relay/bridge/legacy-relay-pane-stops.ts # COMPAT(legacy-relay-bridge): deleted with the folder
+1
View File
@@ -32,6 +32,7 @@ const BUNDLED_MAIN_DEPENDENCIES = new Set([
'unified',
'remark-parse',
'remark-gfm',
'hast-util-from-html-isomorphic',
// Windows NSIS copies app.asar before external resources; bootstrap must not race resources/node_modules.
'zod'
])
@@ -252,6 +252,38 @@
}
}
},
"3088889ce80e": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"4533fb49ac71": {
"branchCompareState": {
"kind": "error",
@@ -342,38 +374,6 @@
"ordinal": 11,
"json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}"
},
"63bc0796d81c": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"6a0cb0684d8b": {
"name": "git.branchCompare#1",
"ordinal": 10,
@@ -592,32 +592,6 @@
}
}
},
"891438a18444": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"8fda864c66d6": {
"branchCompareState": {
"kind": "loading"
@@ -823,6 +797,32 @@
}
}
},
"b823fdc0d205": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"bd638c43a536": {
"name": "git.branchCompare#1",
"ordinal": 10,
@@ -933,11 +933,6 @@
}
}
},
"e539e80d06e9": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
@@ -946,6 +941,11 @@
"$rpc": "undefined"
}
},
"eef1ee3c2773": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"fa79ca4a1a0d": {
"name": "git.branchCompare#1",
"ordinal": 10,
@@ -1052,8 +1052,8 @@
{
"id": "sc-changes-loaded.prelude:status-pending",
"observation": {
"sender": ["891438a18444", "2ab4c978da8d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "2ab4c978da8d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1064,9 +1064,9 @@
{
"id": "sc-changes-loaded.prelude:compare-pending",
"observation": {
"sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1083,14 +1083,14 @@
"id": "sc-changes-loaded.prelude:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"b7127d77e6aa"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1108,14 +1108,14 @@
"id": "sc-changes-loaded.normal:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1133,14 +1133,14 @@
"id": "sc-changes-loaded.normal:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1158,14 +1158,14 @@
"id": "sc-changes-loaded.result-absent:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"fa79ca4a1a0d"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1183,14 +1183,14 @@
"id": "sc-changes-loaded.result-absent:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"fa79ca4a1a0d"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1208,14 +1208,14 @@
"id": "sc-changes-loaded.result-null:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"86eb3bc4e90c"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1233,14 +1233,14 @@
"id": "sc-changes-loaded.result-null:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"86eb3bc4e90c"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1258,14 +1258,14 @@
"id": "sc-changes-loaded.inner-ok-missing:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"dc48d55bec67"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1283,14 +1283,14 @@
"id": "sc-changes-loaded.inner-ok-missing:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"dc48d55bec67"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1308,14 +1308,14 @@
"id": "sc-changes-loaded.inner-false-string-error:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"bd638c43a536"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1333,14 +1333,14 @@
"id": "sc-changes-loaded.inner-false-string-error:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"bd638c43a536"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1358,14 +1358,14 @@
"id": "sc-changes-loaded.inner-false-object-error:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"047f0b230543"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1383,14 +1383,14 @@
"id": "sc-changes-loaded.inner-false-object-error:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"047f0b230543"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1408,14 +1408,14 @@
"id": "sc-changes-loaded.outer-refused:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"97a020d83f3c"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1433,14 +1433,14 @@
"id": "sc-changes-loaded.outer-refused:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"97a020d83f3c"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1458,14 +1458,14 @@
"id": "sc-changes-loaded.outer-refused-no-message:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"6a0cb0684d8b"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1483,14 +1483,14 @@
"id": "sc-changes-loaded.outer-refused-no-message:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"6a0cb0684d8b"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1508,14 +1508,14 @@
"id": "sc-changes-loaded.method-not-found:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"7506958819b1"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1533,14 +1533,14 @@
"id": "sc-changes-loaded.method-not-found:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"7506958819b1"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1558,14 +1558,14 @@
"id": "sc-changes-loaded.transport-rejection:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"fdcce09eef21"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1583,14 +1583,14 @@
"id": "sc-changes-loaded.transport-rejection:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"fdcce09eef21"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1608,14 +1608,14 @@
"id": "sc-changes-loaded.transport-rejection-no-message:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"2cca3e7f3f9b"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1633,14 +1633,14 @@
"id": "sc-changes-loaded.transport-rejection-no-message:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"2cca3e7f3f9b"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -379,6 +379,38 @@
}
}
},
"3088889ce80e": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"393d2f9f3485": {
"name": "git.status#1",
"ordinal": 3,
@@ -484,38 +516,6 @@
"ordinal": 11,
"json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}"
},
"63bc0796d81c": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"6d2d788a9e84": {
"name": "git.status#1",
"ordinal": 3,
@@ -629,32 +629,6 @@
}
]
},
"891438a18444": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"8fda864c66d6": {
"branchCompareState": {
"kind": "loading"
@@ -866,6 +840,32 @@
}
]
},
"b823fdc0d205": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"cb462f8b50a3": {
"name": "worktree.show#1",
"ordinal": 8,
@@ -882,11 +882,6 @@
}
]
},
"e539e80d06e9": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
@@ -895,6 +890,11 @@
"$rpc": "undefined"
}
},
"eef1ee3c2773": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"f0896523e780": {
"name": "git.status#2",
"ordinal": 6,
@@ -959,8 +959,8 @@
{
"id": "sc-changes-loaded.prelude:status-pending",
"observation": {
"sender": ["891438a18444", "2ab4c978da8d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "2ab4c978da8d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -971,8 +971,8 @@
{
"id": "sc-changes-loaded.prelude:cleanup",
"observation": {
"sender": ["63bc0796d81c", "1dbb1f085bde"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "1dbb1f085bde"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -983,9 +983,9 @@
{
"id": "sc-changes-loaded.normal:compare-pending",
"observation": {
"sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1002,14 +1002,14 @@
"id": "sc-changes-loaded.normal:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1027,14 +1027,14 @@
"id": "sc-changes-loaded.normal:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1051,8 +1051,8 @@
{
"id": "sc-changes-loaded.result-absent:compare-pending",
"observation": {
"sender": ["891438a18444", "f186683ccf2d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "f186683ccf2d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1063,8 +1063,8 @@
{
"id": "sc-changes-loaded.result-absent:settled",
"observation": {
"sender": ["891438a18444", "f186683ccf2d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "f186683ccf2d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1075,8 +1075,8 @@
{
"id": "sc-changes-loaded.result-absent:cleanup",
"observation": {
"sender": ["63bc0796d81c", "f186683ccf2d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "f186683ccf2d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1087,8 +1087,8 @@
{
"id": "sc-changes-loaded.result-null:compare-pending",
"observation": {
"sender": ["891438a18444", "9ae4367a6ff8"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "9ae4367a6ff8"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1099,8 +1099,8 @@
{
"id": "sc-changes-loaded.result-null:settled",
"observation": {
"sender": ["891438a18444", "9ae4367a6ff8"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "9ae4367a6ff8"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1111,8 +1111,8 @@
{
"id": "sc-changes-loaded.result-null:cleanup",
"observation": {
"sender": ["63bc0796d81c", "9ae4367a6ff8"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "9ae4367a6ff8"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1123,8 +1123,8 @@
{
"id": "sc-changes-loaded.inner-ok-missing:compare-pending",
"observation": {
"sender": ["891438a18444", "19fff093880d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "19fff093880d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1135,8 +1135,8 @@
{
"id": "sc-changes-loaded.inner-ok-missing:settled",
"observation": {
"sender": ["891438a18444", "19fff093880d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "19fff093880d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1147,8 +1147,8 @@
{
"id": "sc-changes-loaded.inner-ok-missing:cleanup",
"observation": {
"sender": ["63bc0796d81c", "19fff093880d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "19fff093880d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1159,8 +1159,8 @@
{
"id": "sc-changes-loaded.inner-false-string-error:compare-pending",
"observation": {
"sender": ["891438a18444", "393d2f9f3485"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "393d2f9f3485"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1171,8 +1171,8 @@
{
"id": "sc-changes-loaded.inner-false-string-error:settled",
"observation": {
"sender": ["891438a18444", "393d2f9f3485"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "393d2f9f3485"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1183,8 +1183,8 @@
{
"id": "sc-changes-loaded.inner-false-string-error:cleanup",
"observation": {
"sender": ["63bc0796d81c", "393d2f9f3485"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "393d2f9f3485"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1195,8 +1195,8 @@
{
"id": "sc-changes-loaded.inner-false-object-error:compare-pending",
"observation": {
"sender": ["891438a18444", "1940948b426c"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "1940948b426c"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1207,8 +1207,8 @@
{
"id": "sc-changes-loaded.inner-false-object-error:settled",
"observation": {
"sender": ["891438a18444", "1940948b426c"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "1940948b426c"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1219,8 +1219,8 @@
{
"id": "sc-changes-loaded.inner-false-object-error:cleanup",
"observation": {
"sender": ["63bc0796d81c", "1940948b426c"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "1940948b426c"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1231,8 +1231,8 @@
{
"id": "sc-changes-loaded.outer-refused:compare-pending",
"observation": {
"sender": ["891438a18444", "085b756c7623"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "085b756c7623"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1243,8 +1243,8 @@
{
"id": "sc-changes-loaded.outer-refused:settled",
"observation": {
"sender": ["891438a18444", "085b756c7623"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "085b756c7623"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1255,8 +1255,8 @@
{
"id": "sc-changes-loaded.outer-refused:cleanup",
"observation": {
"sender": ["63bc0796d81c", "085b756c7623"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "085b756c7623"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1267,8 +1267,8 @@
{
"id": "sc-changes-loaded.outer-refused-no-message:compare-pending",
"observation": {
"sender": ["891438a18444", "207e0351be0d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "207e0351be0d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1279,8 +1279,8 @@
{
"id": "sc-changes-loaded.outer-refused-no-message:settled",
"observation": {
"sender": ["891438a18444", "207e0351be0d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "207e0351be0d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1291,8 +1291,8 @@
{
"id": "sc-changes-loaded.outer-refused-no-message:cleanup",
"observation": {
"sender": ["63bc0796d81c", "207e0351be0d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "207e0351be0d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1303,8 +1303,8 @@
{
"id": "sc-changes-loaded.method-not-found:compare-pending",
"observation": {
"sender": ["891438a18444", "6d2d788a9e84"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "6d2d788a9e84"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1315,8 +1315,8 @@
{
"id": "sc-changes-loaded.method-not-found:settled",
"observation": {
"sender": ["891438a18444", "6d2d788a9e84"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "6d2d788a9e84"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1327,8 +1327,8 @@
{
"id": "sc-changes-loaded.method-not-found:cleanup",
"observation": {
"sender": ["63bc0796d81c", "6d2d788a9e84"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["3088889ce80e", "6d2d788a9e84"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1339,8 +1339,8 @@
{
"id": "sc-changes-loaded.transport-rejection:compare-pending",
"observation": {
"sender": ["891438a18444", "9778e6b1ca17", "f0896523e780"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"sender": ["b823fdc0d205", "9778e6b1ca17", "f0896523e780"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1351,8 +1351,8 @@
{
"id": "sc-changes-loaded.transport-rejection:settled",
"observation": {
"sender": ["891438a18444", "9778e6b1ca17", "f0896523e780"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"sender": ["b823fdc0d205", "9778e6b1ca17", "f0896523e780"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1363,8 +1363,8 @@
{
"id": "sc-changes-loaded.transport-rejection:cleanup",
"observation": {
"sender": ["63bc0796d81c", "9778e6b1ca17", "270fa28bd742"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"sender": ["3088889ce80e", "9778e6b1ca17", "270fa28bd742"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1375,8 +1375,8 @@
{
"id": "sc-changes-loaded.transport-rejection-no-message:compare-pending",
"observation": {
"sender": ["891438a18444", "953d7e425499", "f0896523e780"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"sender": ["b823fdc0d205", "953d7e425499", "f0896523e780"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1387,8 +1387,8 @@
{
"id": "sc-changes-loaded.transport-rejection-no-message:settled",
"observation": {
"sender": ["891438a18444", "953d7e425499", "f0896523e780"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"sender": ["b823fdc0d205", "953d7e425499", "f0896523e780"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -1399,8 +1399,8 @@
{
"id": "sc-changes-loaded.transport-rejection-no-message:cleanup",
"observation": {
"sender": ["63bc0796d81c", "953d7e425499", "270fa28bd742"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"sender": ["3088889ce80e", "953d7e425499", "270fa28bd742"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc", "5ab051d969ce"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -147,6 +147,38 @@
}
}
},
"3088889ce80e": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"3dcba72c2342": {
"name": "streams-registered-at-teardown",
"ordinal": 10,
@@ -245,38 +277,6 @@
"ordinal": 11,
"json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}"
},
"63bc0796d81c": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"687fc7be7b14": {
"name": "repo.list#1",
"ordinal": 7,
@@ -530,32 +530,6 @@
}
}
},
"891438a18444": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"8fda864c66d6": {
"branchCompareState": {
"kind": "loading"
@@ -691,6 +665,32 @@
}
}
},
"b823fdc0d205": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"c2c26da9df33": {
"name": "repo.list#1",
"ordinal": 7,
@@ -763,11 +763,6 @@
}
}
},
"e539e80d06e9": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"e610fd221300": {
"name": "repo.list#1",
"ordinal": 7,
@@ -808,6 +803,11 @@
"$rpc": "undefined"
}
},
"eef1ee3c2773": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"f19d3d43b828": {
"name": "repo.list#1",
"ordinal": 7,
@@ -882,8 +882,8 @@
{
"id": "sc-changes-loaded.prelude:status-pending",
"observation": {
"sender": ["891438a18444", "2ab4c978da8d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "2ab4c978da8d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -894,9 +894,9 @@
{
"id": "sc-changes-loaded.prelude:compare-pending",
"observation": {
"sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -913,14 +913,14 @@
"id": "sc-changes-loaded.prelude:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"f802165696e4",
"b60e016a0f1e"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -937,14 +937,14 @@
"id": "sc-changes-loaded.normal:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -962,14 +962,14 @@
"id": "sc-changes-loaded.normal:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -987,14 +987,14 @@
"id": "sc-changes-loaded.result-absent:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"4b1217ea83ab",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1012,14 +1012,14 @@
"id": "sc-changes-loaded.result-absent:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"4b1217ea83ab",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1037,14 +1037,14 @@
"id": "sc-changes-loaded.result-null:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"772f9a3bbdd8",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1062,14 +1062,14 @@
"id": "sc-changes-loaded.result-null:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"772f9a3bbdd8",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1087,14 +1087,14 @@
"id": "sc-changes-loaded.inner-ok-missing:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"7eb62de26957",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1112,14 +1112,14 @@
"id": "sc-changes-loaded.inner-ok-missing:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"7eb62de26957",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1137,14 +1137,14 @@
"id": "sc-changes-loaded.inner-false-string-error:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"d7b92d364b7b",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1162,14 +1162,14 @@
"id": "sc-changes-loaded.inner-false-string-error:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"d7b92d364b7b",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1187,14 +1187,14 @@
"id": "sc-changes-loaded.inner-false-object-error:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"6fe24defc416",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1212,14 +1212,14 @@
"id": "sc-changes-loaded.inner-false-object-error:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"6fe24defc416",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1237,14 +1237,14 @@
"id": "sc-changes-loaded.outer-refused:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"f19d3d43b828",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1262,14 +1262,14 @@
"id": "sc-changes-loaded.outer-refused:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"f19d3d43b828",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1287,14 +1287,14 @@
"id": "sc-changes-loaded.outer-refused-no-message:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"687fc7be7b14",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1312,14 +1312,14 @@
"id": "sc-changes-loaded.outer-refused-no-message:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"687fc7be7b14",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1337,14 +1337,14 @@
"id": "sc-changes-loaded.method-not-found:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"75e5bfff5576",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1362,14 +1362,14 @@
"id": "sc-changes-loaded.method-not-found:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"75e5bfff5576",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1387,14 +1387,14 @@
"id": "sc-changes-loaded.transport-rejection:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"e610fd221300",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1412,14 +1412,14 @@
"id": "sc-changes-loaded.transport-rejection:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"e610fd221300",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1437,14 +1437,14 @@
"id": "sc-changes-loaded.transport-rejection-no-message:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"c2c26da9df33",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1462,14 +1462,14 @@
"id": "sc-changes-loaded.transport-rejection-no-message:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"c2c26da9df33",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -248,6 +248,38 @@
}
}
},
"3088889ce80e": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"3403b59cf439": {
"name": "worktree.show#1",
"ordinal": 6,
@@ -450,38 +482,6 @@
"ordinal": 11,
"json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}"
},
"63bc0796d81c": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"6f4a5d6a5a86": {
"name": "worktree.show#1",
"ordinal": 6,
@@ -560,32 +560,6 @@
}
]
},
"891438a18444": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"8989d6980fc9": {
"name": "repo.baseRefDefault#1",
"ordinal": 10,
@@ -782,6 +756,32 @@
}
}
},
"b823fdc0d205": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"cb462f8b50a3": {
"name": "worktree.show#1",
"ordinal": 8,
@@ -924,11 +924,6 @@
}
}
},
"e539e80d06e9": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
@@ -937,6 +932,11 @@
"$rpc": "undefined"
}
},
"eef1ee3c2773": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"f802165696e4": {
"name": "repo.list#1",
"ordinal": 7,
@@ -976,8 +976,8 @@
{
"id": "sc-changes-loaded.prelude:status-pending",
"observation": {
"sender": ["891438a18444", "2ab4c978da8d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "2ab4c978da8d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -988,9 +988,9 @@
{
"id": "sc-changes-loaded.prelude:compare-pending",
"observation": {
"sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1007,14 +1007,14 @@
"id": "sc-changes-loaded.prelude:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"da80647539b5",
"f802165696e4",
"99df70fb15d8"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1031,14 +1031,14 @@
"id": "sc-changes-loaded.normal:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1056,14 +1056,14 @@
"id": "sc-changes-loaded.normal:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1081,14 +1081,14 @@
"id": "sc-changes-loaded.result-absent:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"b1f1cf609f1a",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1106,14 +1106,14 @@
"id": "sc-changes-loaded.result-absent:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"b1f1cf609f1a",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1131,14 +1131,14 @@
"id": "sc-changes-loaded.result-null:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"3fa278bfc300",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1156,14 +1156,14 @@
"id": "sc-changes-loaded.result-null:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"3fa278bfc300",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1181,14 +1181,14 @@
"id": "sc-changes-loaded.inner-ok-missing:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"12cda398ef1c",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1206,14 +1206,14 @@
"id": "sc-changes-loaded.inner-ok-missing:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"12cda398ef1c",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1231,14 +1231,14 @@
"id": "sc-changes-loaded.inner-false-string-error:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"cbba4d974cd2",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1256,14 +1256,14 @@
"id": "sc-changes-loaded.inner-false-string-error:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"cbba4d974cd2",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1281,14 +1281,14 @@
"id": "sc-changes-loaded.inner-false-object-error:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"3403b59cf439",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1306,14 +1306,14 @@
"id": "sc-changes-loaded.inner-false-object-error:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"3403b59cf439",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1331,14 +1331,14 @@
"id": "sc-changes-loaded.outer-refused:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"db7a4d8e637e",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1356,14 +1356,14 @@
"id": "sc-changes-loaded.outer-refused:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"db7a4d8e637e",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1381,14 +1381,14 @@
"id": "sc-changes-loaded.outer-refused-no-message:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"1266df2a91af",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1406,14 +1406,14 @@
"id": "sc-changes-loaded.outer-refused-no-message:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"1266df2a91af",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1431,14 +1431,14 @@
"id": "sc-changes-loaded.method-not-found:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"d67ff8e687bf",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1456,14 +1456,14 @@
"id": "sc-changes-loaded.method-not-found:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"d67ff8e687bf",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1481,14 +1481,14 @@
"id": "sc-changes-loaded.transport-rejection:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"5782be802edd",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1506,14 +1506,14 @@
"id": "sc-changes-loaded.transport-rejection:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"5782be802edd",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1531,14 +1531,14 @@
"id": "sc-changes-loaded.transport-rejection-no-message:settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"1ff055d43072",
"2ca33da4d135",
"8989d6980fc9"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -1556,14 +1556,14 @@
"id": "sc-changes-loaded.transport-rejection-no-message:cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"1ff055d43072",
"2ca33da4d135",
"3718b7e83a50"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -43,41 +43,6 @@
}
}
},
"0d02c4637af4": {
"name": "info",
"ordinal": 3,
"value": {
"host-1": {
"activeCount": 2,
"attention": [
{
"branch": {
"$rpc": "undefined"
},
"displayName": "One",
"dotStatus": "working",
"lastOutputAt": {
"$rpc": "undefined"
},
"repo": "Repo",
"workingMode": {
"$rpc": "undefined"
},
"worktreeId": "w-1"
}
],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"repo": "Repo",
"status": "working",
"worktreeId": "w-1"
},
"totalWorktrees": 2
}
}
},
"11008b947f78": {
"name": "worktree.ps#1",
"ordinal": 1,
@@ -158,6 +123,21 @@
}
}
},
"19a302575563": {
"host-1": {
"activeCount": 2,
"agents": [],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"repo": "Repo",
"status": "working",
"worktreeId": "w-1"
},
"totalWorktrees": 2
}
},
"298c6fbd5d42": {
"name": "worktree.ps#1",
"ordinal": 1,
@@ -313,6 +293,25 @@
}
}
},
"7858e4e82b0f": {
"name": "info",
"ordinal": 3,
"value": {
"host-1": {
"activeCount": 2,
"agents": [],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"repo": "Repo",
"status": "working",
"worktreeId": "w-1"
},
"totalWorktrees": 2
}
}
},
"817623c64ce1": {
"name": "worktree.ps#1",
"ordinal": 1,
@@ -348,37 +347,6 @@
}
}
},
"87aae336d391": {
"host-1": {
"activeCount": 2,
"attention": [
{
"branch": {
"$rpc": "undefined"
},
"displayName": "One",
"dotStatus": "working",
"lastOutputAt": {
"$rpc": "undefined"
},
"repo": "Repo",
"workingMode": {
"$rpc": "undefined"
},
"worktreeId": "w-1"
}
],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"repo": "Repo",
"status": "working",
"worktreeId": "w-1"
},
"totalWorktrees": 2
}
},
"922cb68379ac": {
"name": "worktree.ps#1",
"ordinal": 2,
@@ -599,8 +567,8 @@
"settlements": {
"load": "eb79a9b3682a"
},
"state": "87aae336d391",
"effects": ["0d02c4637af4"]
"state": "19a302575563",
"effects": ["7858e4e82b0f"]
}
},
{
@@ -147,6 +147,38 @@
}
}
},
"3088889ce80e": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"5d30d477f0d5": {
"name": "git.branchCompare#1",
"ordinal": 10,
@@ -203,38 +235,6 @@
"ordinal": 11,
"json": "{\"id\":\"frame-6\",\"deviceToken\":\"recording-device\",\"method\":\"git.branchCompare\",\"params\":{\"worktree\":\"id:repo42::/p\",\"baseRef\":\"origin/dev\"}}"
},
"63bc0796d81c": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 0,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"6f4a5d6a5a86": {
"name": "worktree.show#1",
"ordinal": 6,
@@ -313,32 +313,6 @@
}
]
},
"891438a18444": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"8fda864c66d6": {
"branchCompareState": {
"kind": "loading"
@@ -441,16 +415,37 @@
"kind": "loading"
}
},
"b823fdc0d205": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"cb462f8b50a3": {
"name": "worktree.show#1",
"ordinal": 8,
"json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo42::/p\"}}"
},
"e539e80d06e9": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
@@ -458,6 +453,11 @@
"value": {
"$rpc": "undefined"
}
},
"eef1ee3c2773": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
}
},
"recording": {
@@ -466,8 +466,8 @@
{
"id": "status-pending",
"observation": {
"sender": ["891438a18444", "2ab4c978da8d"],
"payloads": ["e539e80d06e9", "1c2564f1daca", "92a577a15fcc"],
"sender": ["b823fdc0d205", "2ab4c978da8d"],
"payloads": ["eef1ee3c2773", "1c2564f1daca", "92a577a15fcc"],
"settlements": {
"mount": "eb79a9b3682a"
},
@@ -478,9 +478,9 @@
{
"id": "compare-pending",
"observation": {
"sender": ["891438a18444", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"sender": ["b823fdc0d205", "962f91336a50", "6f4a5d6a5a86", "1934c215114a"],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -497,14 +497,14 @@
"id": "settled",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -522,14 +522,14 @@
"id": "cleanup",
"observation": {
"sender": [
"63bc0796d81c",
"3088889ce80e",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -127,6 +127,38 @@
"$rpc": "undefined"
}
},
"22bf66c852bb": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 3001,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"2ca33da4d135": {
"name": "repo.list#1",
"ordinal": 7,
@@ -411,32 +443,6 @@
"ordinal": 17,
"json": "{\"id\":\"frame-9\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo42::/p\"}}"
},
"891438a18444": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"92a577a15fcc": {
"name": "git.status#1",
"ordinal": 5,
@@ -540,9 +546,9 @@
}
]
},
"ade0dae5eee8": {
"b823fdc0d205": {
"name": "settings.get#1",
"ordinal": 1,
"ordinal": 2,
"args": [
{
"name": "method",
@@ -562,14 +568,8 @@
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 3001,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
"status": "pending",
"startedAt": 0
}
},
"cb462f8b50a3": {
@@ -646,11 +646,6 @@
}
}
},
"e539e80d06e9": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
@@ -658,6 +653,11 @@
"value": {
"$rpc": "undefined"
}
},
"eef1ee3c2773": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
}
},
"recording": {
@@ -667,14 +667,14 @@
"id": "loaded",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
"5d30d477f0d5"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -692,7 +692,7 @@
"id": "rows-while-revalidating",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
@@ -700,7 +700,7 @@
"7d368b32d250"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -722,7 +722,7 @@
"id": "revalidated",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
@@ -732,7 +732,7 @@
"a6d51875b1b0"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -756,7 +756,7 @@
"id": "cleanup",
"observation": {
"sender": [
"ade0dae5eee8",
"22bf66c852bb",
"962f91336a50",
"74d102469d68",
"2ca33da4d135",
@@ -767,7 +767,7 @@
"d29ae612a0e8"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -203,6 +203,38 @@
}
}
},
"22bf66c852bb": {
"name": "settings.get#1",
"ordinal": 2,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 3001,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
}
},
"334b41f87c41": {
"name": "worktree.show#1",
"ordinal": 6,
@@ -380,32 +412,6 @@
"ordinal": 17,
"json": "{\"id\":\"frame-9\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:repo42::/p\"}}"
},
"891438a18444": {
"name": "settings.get#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "settings.get"
},
{
"name": "params",
"value": {
"$rpc": "undefined"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"92a577a15fcc": {
"name": "git.status#1",
"ordinal": 5,
@@ -562,9 +568,14 @@
"startedAt": 3001
}
},
"ade0dae5eee8": {
"b06ca46466ca": {
"name": "git.status#3",
"ordinal": 14,
"json": "{\"id\":\"frame-8\",\"deviceToken\":\"recording-device\",\"method\":\"git.status\",\"params\":{\"worktree\":\"id:repo42::/p\"}}"
},
"b823fdc0d205": {
"name": "settings.get#1",
"ordinal": 1,
"ordinal": 2,
"args": [
{
"name": "method",
@@ -584,21 +595,10 @@
}
],
"settlement": {
"status": "rejected",
"startedAt": 0,
"settledAt": 3001,
"error": {
"category": "Error",
"message": "Connection closed",
"isRpcDeliveryUnknown": true
}
"status": "pending",
"startedAt": 0
}
},
"b06ca46466ca": {
"name": "git.status#3",
"ordinal": 14,
"json": "{\"id\":\"frame-8\",\"deviceToken\":\"recording-device\",\"method\":\"git.status\",\"params\":{\"worktree\":\"id:repo42::/p\"}}"
},
"bf019629baab": {
"name": "repo.list#1",
"ordinal": 7,
@@ -673,11 +673,6 @@
}
}
},
"e539e80d06e9": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
@@ -686,6 +681,11 @@
"$rpc": "undefined"
}
},
"eef1ee3c2773": {
"name": "runtime.clientEvents.subscribe#1",
"ordinal": 1,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"runtime.clientEvents.subscribe\",\"params\":null}"
},
"f0a6f14b92e4": {
"name": "source-control.status-load-success",
"ordinal": 20,
@@ -699,7 +699,7 @@
"id": "post-write-status",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"6f4a5d6a5a86",
"1934c215114a",
@@ -709,7 +709,7 @@
"a6d51875b1b0"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -734,7 +734,7 @@
"id": "superseded-revalidation-ignored",
"observation": {
"sender": [
"891438a18444",
"b823fdc0d205",
"962f91336a50",
"6f4a5d6a5a86",
"1934c215114a",
@@ -744,7 +744,7 @@
"a6d51875b1b0"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -769,7 +769,7 @@
"id": "cleanup",
"observation": {
"sender": [
"ade0dae5eee8",
"22bf66c852bb",
"962f91336a50",
"334b41f87c41",
"bf019629baab",
@@ -781,7 +781,7 @@
"1a6e003b2d53"
],
"payloads": [
"e539e80d06e9",
"eef1ee3c2773",
"1c2564f1daca",
"92a577a15fcc",
"cb462f8b50a3",
@@ -4,39 +4,19 @@
"family": "worktree.home-catalog",
"namedDeltas": [],
"values": {
"0d02c4637af4": {
"name": "info",
"ordinal": 3,
"value": {
"host-1": {
"activeCount": 2,
"attention": [
{
"branch": {
"$rpc": "undefined"
},
"displayName": "One",
"dotStatus": "working",
"lastOutputAt": {
"$rpc": "undefined"
},
"repo": "Repo",
"workingMode": {
"$rpc": "undefined"
},
"worktreeId": "w-1"
}
],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"repo": "Repo",
"status": "working",
"worktreeId": "w-1"
},
"totalWorktrees": 2
}
"19a302575563": {
"host-1": {
"activeCount": 2,
"agents": [],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"repo": "Repo",
"status": "working",
"worktreeId": "w-1"
},
"totalWorktrees": 2
}
},
"34fb08d01b03": {
@@ -70,35 +50,23 @@
}
},
"44136fa355b3": {},
"87aae336d391": {
"host-1": {
"activeCount": 2,
"attention": [
{
"branch": {
"$rpc": "undefined"
},
"7858e4e82b0f": {
"name": "info",
"ordinal": 3,
"value": {
"host-1": {
"activeCount": 2,
"agents": [],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"dotStatus": "working",
"lastOutputAt": {
"$rpc": "undefined"
},
"repo": "Repo",
"workingMode": {
"$rpc": "undefined"
},
"status": "working",
"worktreeId": "w-1"
}
],
"countsProvenAt": 1767225600000,
"hostId": "host-1",
"lastActiveWorktree": {
"displayName": "One",
"repo": "Repo",
"status": "working",
"worktreeId": "w-1"
},
"totalWorktrees": 2
},
"totalWorktrees": 2
}
}
},
"922cb68379ac": {
@@ -193,8 +161,8 @@
"settlements": {
"load": "eb79a9b3682a"
},
"state": "87aae336d391",
"effects": ["0d02c4637af4"]
"state": "19a302575563",
"effects": ["7858e4e82b0f"]
}
}
]
+346
View File
@@ -0,0 +1,346 @@
import { Bell, ChevronDown, ChevronRight, Eye, EyeOff, X } from 'lucide-react-native'
import { Fragment, memo, useCallback, useState } from 'react'
import { Alert, Pressable, Text, View } from 'react-native'
import { formatAgentTypeLabel } from '../../../src/shared/agent-status/presentation/agent-type-label'
import type { WorktreeStatus } from '../../../src/shared/worktree-status-rollup'
import { AgentSpinner, agentStatusColors } from '../components/AgentSpinner'
import { MobileAgentIcon } from '../components/MobileAgentIcon'
import { SwipeRowActions } from '../components/SwipeRowActions'
import { HOME_ROW_TEXT_INSET, homeListStyles } from '../home/home-list-styles'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import { triggerMediumImpact } from '../platform/haptics'
import { colors, spacing } from '../theme/mobile-theme'
import { themedStyleSheet } from '../theme/themed-styles'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import type { HostProfile } from '../transport/hosts/host-profile'
import { useHostDisplay } from '../transport/hosts/use-host-display'
import { agentStateLabel, formatTimeAgo, type AgentDotState } from '../worktree/agent-row-display'
import { isDisclosureOpen, toggleDisclosure } from '../worktree/agent-child-disclosure'
import { areStructurallyEqual } from '../worktree/structural-equality'
import type { AgentListSection } from './agent-list-model'
import { agentStatusGroup, type AgentListRow } from './agent-list-rows'
import { agentListPreview } from './agent-list-row-text'
// The Home rollup glyph is the list's size; this maps a per-agent state onto its palette.
const GLYPH_STATUS: Record<AgentDotState, WorktreeStatus> = {
working: 'working',
monitoring: 'monitoring',
blocked: 'permission',
waiting: 'permission',
permission: 'permission',
failed: 'failed',
done: 'done',
interrupted: 'interrupted',
unconfirmed: 'unconfirmed',
idle: 'inactive',
unverifiable: 'inactive'
}
const WORKER_INDENT = 22
const TOGGLE_HIT_SLOP = { top: 10, bottom: 10, left: 12, right: 12 } as const
const workersKey = (row: AgentListRow) => `agents:workers:${row.key}`
type ShownRow = { row: AgentListRow; key: string; workersOpen?: boolean }
export type AgentListRowHandlers = Readonly<{
onOpen: (row: AgentListRow) => void
onLongPress: (row: AgentListRow) => void
onSetRead: (rows: readonly AgentListRow[], read: boolean) => void
onClear: (rows: readonly AgentListRow[]) => void
}>
/** One inset group of agent rows, with each coordinator's workers and an optional idle fold. */
export function MobileAgentListRows(props: {
handlers: AgentListRowHandlers
rows: readonly AgentListRow[]
idleRows?: readonly AgentListRow[]
footer: AgentListSection['footer']
nameDesktop: boolean
hosts: readonly HostProfile[]
now: number
/** Remembers the idle fold per list. */
idleKey?: string
}) {
const t = useMobileTranslation()
useMobileColorScheme()
// Disclosures live in a module cache so they survive remounts; this only redraws after a toggle.
const [, setRevision] = useState(0)
const toggle = useCallback((key: string) => {
toggleDisclosure(key)
setRevision((revision) => revision + 1)
}, [])
const idleKey = `agents:idle:${props.idleKey ?? ''}`
const idleOpen = isDisclosureOpen(idleKey)
const idleRows = props.idleRows ?? []
const hostById = new Map(props.hosts.map((host) => [host.id, host]))
const withWorkers = (rows: readonly AgentListRow[], prefix: string) =>
rows.flatMap((row): ShownRow[] => {
const key = `${prefix}${row.key}`
const workersOpen = row.workers.length > 0 ? isDisclosureOpen(workersKey(row)) : undefined
const workers = workersOpen
? row.workers.map((worker) => ({ row: worker, key: `${key}>${worker.key}` }))
: []
return [{ row, key, workersOpen }, ...workers]
})
const renderRows = (items: readonly ShownRow[], separateFirst: boolean) =>
items.map((item, index) => (
<Fragment key={item.key}>
{index > 0 || separateFirst ? (
<View
style={[
homeListStyles.separator,
{ marginLeft: HOME_ROW_TEXT_INSET + item.row.depth * WORKER_INDENT }
]}
/>
) : null}
<MobileAgentListRow
row={item.row}
host={hostById.get(item.row.hostId) ?? null}
footer={props.footer}
nameDesktop={props.nameDesktop}
now={props.now}
workersOpen={item.workersOpen}
onToggleWorkers={toggle}
handlers={props.handlers}
/>
</Fragment>
))
return (
<View style={homeListStyles.group}>
{renderRows(withWorkers(props.rows, ''), false)}
{idleRows.length > 0 ? (
<>
{props.rows.length > 0 ? <View style={homeListStyles.separator} /> : null}
<Pressable
accessibilityRole="button"
accessibilityState={{ expanded: idleOpen }}
style={({ pressed }) => [styles.foldRow, pressed && homeListStyles.rowPressed]}
onPress={() => toggle(idleKey)}
>
{idleOpen ? (
<ChevronDown size={15} color={colors.textMuted} />
) : (
<ChevronRight size={15} color={colors.textMuted} />
)}
<Text style={styles.foldLabel}>
{t('agents.list.idleCount', '{{count}} idle', { count: idleRows.length })}
</Text>
</Pressable>
{idleOpen ? renderRows(withWorkers(idleRows, 'idle>'), true) : null}
</>
) : null}
</View>
)
}
// Each refresh rebuilds every row; compare by value so only changed rows redraw.
const MobileAgentListRow = memo(function MobileAgentListRow(props: {
handlers: AgentListRowHandlers
row: AgentListRow
host: HostProfile | null
footer: AgentListSection['footer']
nameDesktop: boolean
now: number
/** Undefined when the row has no workers to show. */
workersOpen?: boolean
onToggleWorkers: (key: string) => void
}) {
const t = useMobileTranslation()
useMobileColorScheme()
const { row } = props
const { agent } = row.entry
const desktop = useHostDisplay(props.host).title
const { title } = row
const group = row.stale ? null : agentStatusGroup(row.dotState)
const preview = agentListPreview(agent, group, title)
const needsYou = group === 'needs-you'
const stateWord = needsYou ? agentStateLabel(row.dotState) : ''
const place = [
props.footer === 'agent' ? formatAgentTypeLabel(agent.agentType) : row.entry.workspaceName,
props.nameDesktop ? desktop : null
]
.filter(Boolean)
.join(' · ')
const time = row.timeAt > 0 ? formatTimeAgo(row.timeAt, props.now) : ''
const workerCount = row.workers.length
const workersLabel =
workerCount === 1
? t('agents.list.workers_one', '{{count}} worker', { count: workerCount })
: t('agents.list.workers_other', '{{count}} workers', { count: workerCount })
// The row is one accessibility element, so screen readers reach the workers toggle through it.
const workersAction =
props.workersOpen === undefined
? null
: {
name: 'toggleWorkers',
label: props.workersOpen
? t('agents.list.hideWorkers', 'Hide {{workers}}', { workers: workersLabel })
: t('agents.list.showWorkers', 'Show {{workers}}', { workers: workersLabel })
}
const longPress = () => {
triggerMediumImpact()
props.handlers.onLongPress(row)
}
const open = () => {
if (row.offline) {
Alert.alert(
t('agents.list.offlineTitle', '{{desktop}} is offline', { desktop }),
t('agents.list.offlineMessage', 'Reconnect it to open this agent.')
)
return
}
props.handlers.onOpen(row)
}
const actionsLabel = t('agents.list.actions', 'Actions for {{title}}', { title })
const unread = row.unread === true
return (
<SwipeRowActions
leading={
row.unread === undefined || row.offline
? undefined
: {
label: unread ? t('agents.swipe.read', 'Read') : t('agents.swipe.unread', 'Unread'),
accessibilityLabel: unread
? t('agents.actions.markRead', 'Mark as read')
: t('agents.actions.markUnread', 'Mark as unread'),
icon: unread ? Eye : EyeOff,
background: colors.accentBlue,
foreground: colors.onAccent,
onPress: () => props.handlers.onSetRead([row], unread)
}
}
trailing={
row.clearable && !row.offline
? {
label: t('agents.swipe.clear', 'Clear'),
accessibilityLabel: t('agents.actions.clear', 'Clear from list'),
icon: X,
background: colors.textMuted,
foreground: colors.onAccent,
onPress: () => props.handlers.onClear([row])
}
: undefined
}
>
{(guardPress) => (
<Pressable
accessibilityRole="button"
accessibilityLabel={[
title,
unread ? t('agents.list.unread', 'Unread') : null,
stateWord || null,
preview || null,
place,
time,
workersAction ? workersLabel : null
]
.filter(Boolean)
.join(', ')}
accessibilityState={
props.workersOpen === undefined ? undefined : { expanded: props.workersOpen }
}
accessibilityActions={[
{ name: 'longpress', label: actionsLabel },
...(workersAction ? [workersAction] : [])
]}
onAccessibilityAction={(event) => {
if (event.nativeEvent.actionName === 'longpress') {
longPress()
} else if (event.nativeEvent.actionName === 'toggleWorkers') {
props.onToggleWorkers(workersKey(row))
}
}}
style={({ pressed }) => [
homeListStyles.row,
styles.row,
row.depth > 0 && { paddingLeft: spacing.lg + row.depth * WORKER_INDENT },
pressed && homeListStyles.rowPressed
]}
onPress={guardPress(open)}
onLongPress={longPress}
delayLongPress={400}
>
<View style={[homeListStyles.status, row.stale && homeListStyles.rowDisabled]}>
<AgentSpinner status={GLYPH_STATUS[row.dotState]} />
</View>
<View style={[styles.text, row.stale && homeListStyles.rowDisabled]}>
<View style={styles.titleLine}>
<Text style={[styles.title, unread && styles.titleUnread]} numberOfLines={1}>
{title}
</Text>
{time ? <Text style={styles.time}>{time}</Text> : null}
</View>
{stateWord || preview ? (
<Text style={styles.preview} numberOfLines={2}>
{stateWord ? (
<Text style={[styles.stateWord, { color: agentStatusColors().permission }]}>
{stateWord}
</Text>
) : null}
{stateWord && preview ? ' · ' : ''}
{preview}
</Text>
) : null}
<View style={styles.footer}>
{agent.agentType ? <MobileAgentIcon agentId={agent.agentType} size={13} /> : null}
<Text style={styles.place} numberOfLines={1}>
{place}
</Text>
<View style={styles.trailing}>
{unread ? (
<Bell size={12} color={colors.statusAmber} fill={colors.statusAmber} />
) : null}
{props.workersOpen !== undefined ? (
<Pressable
accessibilityRole="button"
accessibilityState={{ expanded: props.workersOpen }}
hitSlop={TOGGLE_HIT_SLOP}
style={styles.workers}
onPress={(event) => {
event.stopPropagation()
guardPress(() => props.onToggleWorkers(workersKey(row)))()
}}
>
{props.workersOpen ? (
<ChevronDown size={13} color={colors.textSecondary} />
) : (
<ChevronRight size={13} color={colors.textSecondary} />
)}
<Text style={styles.workersLabel}>{workersLabel}</Text>
</Pressable>
) : null}
</View>
</View>
</View>
</Pressable>
)}
</SwipeRowActions>
)
}, areStructurallyEqual)
const styles = themedStyleSheet(() => ({
text: { flex: 1, minWidth: 0, paddingTop: 9, paddingBottom: 10, paddingRight: 14, gap: 3 },
titleLine: { flexDirection: 'row', alignItems: 'baseline', gap: spacing.sm },
// Opaque so a swipe's actions stay hidden until the row slides off them.
row: { backgroundColor: colors.bgPanel },
title: { flex: 1, minWidth: 0, fontSize: 15, lineHeight: 20, color: colors.textPrimary },
titleUnread: { fontWeight: '600' },
time: { fontSize: 12, color: colors.textMuted, fontVariant: ['tabular-nums'] },
preview: { fontSize: 14, lineHeight: 19, color: colors.textSecondary },
stateWord: { fontWeight: '600' },
footer: { flexDirection: 'row', alignItems: 'center', gap: 6, minWidth: 0 },
place: { flexShrink: 1, fontSize: 12, color: colors.textMuted },
trailing: { flexDirection: 'row', alignItems: 'center', gap: 8, marginLeft: 'auto' },
workers: { flexDirection: 'row', alignItems: 'center', gap: 4 },
workersLabel: { fontSize: 12, fontWeight: '500', color: colors.textSecondary },
foldRow: {
flexDirection: 'row',
alignItems: 'center',
gap: spacing.sm,
minHeight: 44,
paddingLeft: HOME_ROW_TEXT_INSET - 4,
paddingRight: spacing.lg
},
foldLabel: { fontSize: 14, color: colors.textSecondary }
}))
+287
View File
@@ -0,0 +1,287 @@
import { describe, expect, it } from 'vitest'
import type { RuntimeWorktreeAgentRow } from '../../../src/shared/runtime-types'
import type { ConnectionState } from '../transport/connection/connection-state'
import type { HostWorktreeInfo } from '../worktree/home-worktree-info'
import { buildAgentList, type AgentListSection } from './agent-list-model'
import {
selectAgentsNeedingYou,
type AgentListInput,
type AgentListRow,
type ListedAgentVerdict
} from './agent-list-rows'
const NOW = 1_800_000_000_000
const MINUTE = 60_000
function agent(
paneKey: string,
state: RuntimeWorktreeAgentRow['state'],
overrides: Partial<RuntimeWorktreeAgentRow> = {}
): RuntimeWorktreeAgentRow {
return {
paneKey,
parentPaneKey: null,
state,
agentType: 'claude',
prompt: '',
taskTitle: null,
displayName: null,
lastAssistantMessage: null,
toolName: null,
toolInput: null,
interrupted: false,
stateStartedAt: NOW - MINUTE,
updatedAt: NOW - MINUTE,
...overrides
}
}
function entries(agents: RuntimeWorktreeAgentRow[]) {
return agents.map((row) => ({
worktreeId: 'wt-1',
workspaceName: 'mobile-tabs',
repo: 'orca',
branch: 'main',
agent: row
}))
}
function input(
hosts: Record<string, { state: ConnectionState; info: Partial<HostWorktreeInfo> }>
): AgentListInput {
return {
hosts: Object.keys(hosts).map((id) => ({ id })),
hostStates: Object.fromEntries(Object.entries(hosts).map(([id, host]) => [id, host.state])),
worktreeInfo: Object.fromEntries(
Object.entries(hosts).map(([id, host]) => [
id,
{ hostId: id, totalWorktrees: 1, activeCount: 0, lastActiveWorktree: null, ...host.info }
])
),
now: NOW
}
}
const panes = (rows: readonly AgentListRow[] | undefined) =>
rows?.map((row) => row.entry.agent.paneKey)
const shape = (sections: AgentListSection[]) =>
sections.map((section) => ({
kind: section.kind,
rows: panes(section.rows),
workers: section.rows.map((row) => panes(row.workers)),
idle: panes(section.idleRows)
}))
const statusView = (showWorkers: boolean, unreadOnly = false) => ({
view: { groupBy: 'status' as const, showWorkers, unreadOnly },
hostFilter: null,
query: ''
})
describe('buildAgentList by status', () => {
it('buckets agents by what they ask of the user, newest first, and folds idle ones', () => {
const list = buildAgentList(
input({
mac: {
state: 'connected',
info: {
agents: entries([
agent('asking', 'waiting'),
agent('older-run', 'working', { stateStartedAt: NOW - 5 * MINUTE }),
agent('newer-run', 'working', { stateStartedAt: NOW - 2 * MINUTE }),
agent('finished', 'done'),
// Silent past the 30-minute freshness window.
agent('quiet', 'working', { updatedAt: NOW - 31 * MINUTE })
])
}
}
}),
statusView(true)
)
expect(shape(list.sections)).toEqual([
{ kind: 'needs-you', rows: ['asking'], workers: [[]], idle: undefined },
{
kind: 'working',
rows: ['newer-run', 'older-run'],
workers: [[], []],
idle: undefined
},
{ kind: 'done', rows: ['finished'], workers: [[]], idle: ['quiet'] }
])
})
it('nests workers under their coordinator and still lists the one that needs the user', () => {
const host = input({
mac: {
state: 'connected',
info: {
agents: entries([
agent('coordinator', 'working'),
agent('worker-busy', 'working', { parentPaneKey: 'coordinator' }),
agent('worker-asking', 'blocked', { parentPaneKey: 'coordinator' })
])
}
}
})
expect(shape(buildAgentList(host, statusView(true)).sections)).toEqual([
{ kind: 'needs-you', rows: ['worker-asking'], workers: [[]], idle: undefined },
{
kind: 'working',
rows: ['coordinator'],
workers: [['worker-busy', 'worker-asking']],
idle: undefined
}
])
expect(shape(buildAgentList(host, statusView(false)).sections)).toEqual([
{ kind: 'needs-you', rows: ['worker-asking'], workers: [[]], idle: undefined },
{ kind: 'working', rows: ['coordinator'], workers: [[]], idle: undefined }
])
expect(panes(selectAgentsNeedingYou(host))).toEqual(['worker-asking'])
})
it('keeps a lost desktop’s agents as last seen, outside the status groups and the counts', () => {
const lastSeen = entries([agent('was-asking', 'waiting')])
const disconnected = input({
mac: { state: 'connected', info: { agents: entries([agent('asking', 'waiting')]) } },
studio: { state: 'disconnected', info: { lastSeenAgents: lastSeen, countsProvenAt: NOW } }
})
const list = buildAgentList(disconnected, statusView(true))
expect(shape(list.sections)).toEqual([
{ kind: 'needs-you', rows: ['asking'], workers: [[]], idle: undefined },
{ kind: 'desktop', rows: ['was-asking'], workers: [[]], idle: undefined }
])
expect(list.sections[1]).toMatchObject({
hostId: 'studio',
lastSeen: { offline: true, at: NOW }
})
expect(list.sections[1].rows[0]).toMatchObject({ stale: true, offline: true, dotState: 'idle' })
expect(panes(selectAgentsNeedingYou(disconnected))).toEqual(['asking'])
// Reconnected, but until its own read lands the old rows still claim nothing.
const reconnected = input({
studio: { state: 'connected', info: { lastSeenAgents: lastSeen, countsProvenAt: NOW } }
})
expect(selectAgentsNeedingYou(reconnected)).toEqual([])
expect(buildAgentList(reconnected, statusView(true)).sections[0].rows[0]).toMatchObject({
stale: true,
offline: false
})
})
it('lists, orders and marks agents by the desktop Agents list’s verdicts', () => {
// Every raw state says working: only the verdicts decide.
const listed = (paneKey: string, verdict: Partial<ListedAgentVerdict>) =>
agent(paneKey, 'working', {
activity: {
listed: true,
status: 'done',
unread: false,
clearable: false,
sortAt: NOW - MINUTE,
title: `Task ${paneKey}`,
...verdict
}
})
const host = (pendingActivity?: AgentListInput['pendingActivity']) => ({
...input({
mac: {
state: 'connected',
info: {
agents: entries([
agent('session-start', 'working', { activity: { listed: false } }),
listed('failed', { status: 'failed', clearable: true, sortAt: NOW - MINUTE }),
listed('asking', { status: 'permission', unread: true, sortAt: NOW - 5 * MINUTE }),
listed('unconfirmed', { status: 'unconfirmed', clearable: true }),
listed('finished', { status: 'done', unread: true, clearable: true }),
listed('quiet', { status: 'unverifiable' }),
listed('stopped', { status: 'interrupted', clearable: true })
])
}
}
}),
pendingActivity
})
const rows = (list: ReturnType<typeof buildAgentList>) =>
list.sections.map((section) => [
section.kind,
section.rows.map((row) => [row.entry.agent.paneKey, row.unread, row.clearable])
])
expect(rows(buildAgentList(host(), statusView(true)))).toEqual([
[
'needs-you',
[
['asking', true, false],
['failed', false, true],
['unconfirmed', false, true]
]
],
[
'done',
[
['stopped', false, true],
['quiet', false, false],
['finished', true, true]
]
]
])
expect(buildAgentList(host(), statusView(true)).sections[0].rows[0]).toMatchObject({
title: 'Task asking',
dotState: 'permission'
})
expect(panes(selectAgentsNeedingYou(host()))).toEqual(['asking', 'failed', 'unconfirmed'])
// Unread only is the desktop's unread alone, needs-you rows included.
expect(rows(buildAgentList(host(), statusView(true, true)))).toEqual([
['needs-you', [['asking', true, false]]],
['done', [['finished', true, true]]]
])
// A write in flight shows until the desktop's next list read carries it.
const pending = host({ 'mac:failed': { unread: true }, 'mac:finished': { cleared: true } })
expect(rows(buildAgentList(pending, statusView(true, true)))).toEqual([
[
'needs-you',
[
['asking', true, false],
['failed', true, true]
]
]
])
})
it('nests workers where the desktop does and hides the ones it folds', () => {
const verdict = (status: ListedAgentVerdict['status'], extra: Partial<ListedAgentVerdict>) => ({
listed: true as const,
status,
unread: false,
clearable: false,
sortAt: NOW - MINUTE,
title: 'Task',
...extra
})
const host = input({
mac: {
state: 'connected',
info: {
agents: entries([
agent('coordinator', 'working', { activity: verdict('working', {}) }),
agent('worker-done', 'done', {
activity: verdict('done', { childOf: 'coordinator', foldedChild: true })
}),
agent('worker-busy', 'working', {
activity: verdict('working', { childOf: 'coordinator', sortAt: NOW })
})
])
}
}
})
expect(shape(buildAgentList(host, statusView(true)).sections)).toEqual([
{
kind: 'working',
rows: ['coordinator'],
workers: [['worker-done', 'worker-busy']],
idle: undefined
}
])
expect(shape(buildAgentList(host, statusView(false)).sections)).toEqual([
{ kind: 'working', rows: ['worker-busy', 'coordinator'], workers: [[], []], idle: undefined }
])
})
})
+250
View File
@@ -0,0 +1,250 @@
import { formatAgentTypeLabel } from '../../../src/shared/agent-status/presentation/agent-type-label'
import { agentListEntryMatches } from './agent-list-row-text'
import {
agentStatusGroup,
asTopLevel,
byStatusThenRecent,
everyRow,
hostAgents,
listedAgentVerdict,
newestFirst,
rowNeedsYou,
type AgentListInput,
type AgentListRow,
type AgentStatusGroup,
type HostAgents
} from './agent-list-rows'
export const AGENT_LIST_GROUP_BY_CHOICES = [
'status',
'workspace',
'project',
'agent',
'desktop'
] as const
export type AgentListGroupBy = (typeof AGENT_LIST_GROUP_BY_CHOICES)[number]
export type AgentListView = Readonly<{
groupBy: AgentListGroupBy
showWorkers: boolean
unreadOnly: boolean
}>
export const DEFAULT_AGENT_LIST_VIEW: AgentListView = {
groupBy: 'status',
showWorkers: true,
unreadOnly: false
}
export type AgentListSectionKind = AgentStatusGroup | 'workspace' | 'project' | 'agent' | 'desktop'
export type AgentListSection = Readonly<{
key: string
kind: AgentListSectionKind
/** The workspace, project or agent a data-named section is for. */
title?: string
hostId?: string
rows: readonly AgentListRow[]
/** Status grouping folds idle agents into one row at the end of the list. */
idleRows?: readonly AgentListRow[]
/** A desktop whose rows are last seen, and when they were read. */
lastSeen?: Readonly<{ offline: boolean; at?: number }>
/** What each row's footer names; the section header names the rest. */
footer: 'workspace' | 'agent'
nameDesktop: boolean
}>
type GroupDraft = { key: string; title?: string; hostId?: string; rows: AgentListRow[] }
function groupRows(
rows: readonly AgentListRow[],
keyOf: (row: AgentListRow) => Omit<GroupDraft, 'rows'>
): GroupDraft[] {
const groups = new Map<string, GroupDraft>()
for (const row of rows) {
const draft = keyOf(row)
const group = groups.get(draft.key)
if (group) {
group.rows.push(row)
} else {
groups.set(draft.key, { ...draft, rows: [row] })
}
}
return [...groups.values()]
}
// Groups with something that needs the user lead, then the most recently active.
function byUrgencyThenRecent(a: GroupDraft, b: GroupDraft): number {
const urgent = (group: GroupDraft) => (group.rows.some(rowNeedsYou) ? 0 : 1)
const latest = (group: GroupDraft) => Math.max(...group.rows.map((row) => row.timeAt))
return urgent(a) - urgent(b) || latest(b) - latest(a)
}
const STATUS_SECTIONS: readonly Exclude<AgentStatusGroup, 'idle'>[] = [
'needs-you',
'working',
'done'
]
export function buildAgentList(
input: AgentListInput,
options: Readonly<{ view: AgentListView; hostFilter: string | null; query: string }>
): { sections: AgentListSection[]; anyLive: boolean } {
const { view } = options
const hosts = input.hosts
.filter((host) => options.hostFilter === null || host.id === options.hostFilter)
.map((host) => hostAgents(input, host.id))
// With no desktop read this session, an empty list says nothing about running agents.
const anyLive = hosts.some((host) => host.live)
const nameDesktop = input.hosts.length > 1 && options.hostFilter === null
const query = options.query.trim().toLowerCase()
// Unread is the desktop's verdict alone. Rows it gave none stay: hiding them would claim they
// were read. A coordinator stays for its unread worker.
const shown = (row: AgentListRow) =>
!view.unreadOnly ||
row.unread === true ||
(row.unread === undefined && !listedAgentVerdict(row.entry.agent)) ||
row.workers.some((worker) => worker.unread)
const topLevel = (host: HostAgents): AgentListRow[] => {
if (query) {
// A match is shown on its own; its coordinator may not match.
return everyRow(host.roots)
.filter((row) => agentListEntryMatches(row.entry, query))
.map(asTopLevel)
.filter(shown)
}
if (!view.showWorkers) {
// Desktop hides a finished worker and lists a live one on its own; without its verdict, only
// a worker that needs the user shows.
return everyRow(host.roots)
.filter((row) => {
const verdict = listedAgentVerdict(row.entry.agent)
return verdict ? !verdict.foldedChild : row.depth === 0 || rowNeedsYou(row)
})
.map(asTopLevel)
.filter(shown)
}
// A worker that needs the user can't hide inside a folded coordinator.
const surfaced = host.roots.flatMap((root) => root.workers.filter(rowNeedsYou).map(asTopLevel))
return [...host.roots, ...surfaced].filter(shown)
}
const section = (
draft: GroupDraft,
kind: AgentListSectionKind,
footer: AgentListSection['footer'],
names: boolean,
order = newestFirst
): AgentListSection => ({
...draft,
kind,
rows: [...draft.rows].sort(order),
footer,
nameDesktop: names
})
if (view.groupBy === 'desktop') {
const sections = hosts.flatMap((host): AgentListSection[] => {
const rows = topLevel(host)
// An offline desktop keeps its header, so its absence reads as offline rather than idle.
if (rows.length === 0 && (host.live || query)) {
return []
}
return [
{
...section(
{ key: host.hostId, hostId: host.hostId, rows },
'desktop',
'workspace',
false
),
...(host.live ? {} : { lastSeen: { offline: host.offline, at: host.seenAt } })
}
]
})
return { sections, anyLive }
}
if (view.groupBy === 'status') {
const live = hosts.filter((host) => host.live).flatMap(topLevel)
const sections: AgentListSection[] = STATUS_SECTIONS.map((kind) =>
section(
{ key: kind, rows: live.filter((row) => agentStatusGroup(row.dotState) === kind) },
kind,
'workspace',
nameDesktop,
byStatusThenRecent
)
).filter((entry) => entry.rows.length > 0)
const idleRows = live.filter((row) => agentStatusGroup(row.dotState) === 'idle')
if (idleRows.length > 0) {
const folded = [...idleRows].sort(newestFirst)
const last = sections.at(-1)
if (last) {
sections[sections.length - 1] = { ...last, idleRows: folded }
} else {
sections.push({
...section({ key: 'idle', rows: [] }, 'idle', 'workspace', nameDesktop),
idleRows: folded
})
}
}
// Last-seen rows claim no status, so they stay under their desktop.
for (const host of hosts) {
const rows = host.live ? [] : topLevel(host)
if (rows.length > 0) {
sections.push({
...section(
{ key: host.hostId, hostId: host.hostId, rows },
'desktop',
'workspace',
false
),
lastSeen: { offline: host.offline, at: host.seenAt }
})
}
}
return { sections, anyLive }
}
const rows = hosts.flatMap(topLevel)
const drafts =
view.groupBy === 'workspace'
? groupRows(rows, (row) => ({
key: `${row.hostId}:${row.entry.worktreeId}`,
title: row.entry.workspaceName,
hostId: row.hostId
}))
: view.groupBy === 'project'
? groupRows(rows, (row) => ({
key: `${row.hostId}:${row.entry.repo}`,
title: row.entry.repo,
hostId: row.hostId
}))
: groupRows(rows, (row) => {
const label = formatAgentTypeLabel(row.entry.agent.agentType)
return { key: label, title: label }
})
const kind = view.groupBy
const sections = drafts
.sort(byUrgencyThenRecent)
.map((draft) =>
kind === 'agent'
? section(draft, kind, 'workspace', nameDesktop)
: section(draft, kind, kind === 'workspace' ? 'agent' : 'workspace', false)
)
return { sections, anyLive }
}
/** Every row the list holds, folded ones included, once each: what "Mark all read" and "Clear finished" act on. */
export function agentListRowsIn(sections: readonly AgentListSection[]): AgentListRow[] {
const rows = new Map<string, AgentListRow>()
for (const section of sections) {
for (const row of everyRow([...section.rows, ...(section.idleRows ?? [])])) {
rows.set(row.key, row)
}
}
return [...rows.values()]
}
@@ -0,0 +1,35 @@
import AsyncStorage from '@react-native-async-storage/async-storage'
import {
AGENT_LIST_GROUP_BY_CHOICES,
DEFAULT_AGENT_LIST_VIEW,
type AgentListView
} from './agent-list-model'
const AGENT_LIST_VIEW_KEY = 'orca:agentListView'
export async function loadAgentListView(): Promise<AgentListView> {
try {
const raw = await AsyncStorage.getItem(AGENT_LIST_VIEW_KEY)
const parsed: unknown = raw ? JSON.parse(raw) : null
if (!parsed || typeof parsed !== 'object') {
return DEFAULT_AGENT_LIST_VIEW
}
const groupBy = 'groupBy' in parsed ? parsed.groupBy : undefined
const showWorkers = 'showWorkers' in parsed ? parsed.showWorkers : undefined
const unreadOnly = 'unreadOnly' in parsed ? parsed.unreadOnly : undefined
return {
groupBy:
AGENT_LIST_GROUP_BY_CHOICES.find((choice) => choice === groupBy) ??
DEFAULT_AGENT_LIST_VIEW.groupBy,
showWorkers:
typeof showWorkers === 'boolean' ? showWorkers : DEFAULT_AGENT_LIST_VIEW.showWorkers,
unreadOnly: typeof unreadOnly === 'boolean' ? unreadOnly : DEFAULT_AGENT_LIST_VIEW.unreadOnly
}
} catch {
return DEFAULT_AGENT_LIST_VIEW
}
}
export async function saveAgentListView(view: AgentListView): Promise<void> {
await AsyncStorage.setItem(AGENT_LIST_VIEW_KEY, JSON.stringify(view))
}
+63
View File
@@ -0,0 +1,63 @@
import { getAgentRowPrimaryText } from '../../../src/shared/agent-status/presentation/agent-row-primary-text'
import { formatAgentToolPreviewLine } from '../../../src/shared/agent-status/presentation/agent-tool-preview'
import { formatAgentTypeLabel } from '../../../src/shared/agent-status/presentation/agent-type-label'
import { withoutNativeChatVisualDirectiveLines } from '../../../src/shared/native-chat/native-chat-visual-directive'
import type { RuntimeWorktreeAgentRow } from '../../../src/shared/runtime-types'
import type { HomeAgentEntry } from '../worktree/home-worktree-info'
import type { AgentStatusGroup } from './agent-list-rows'
/** The row's name: what the conversation is called, else its task, else what it was asked. */
export function agentListTitle(agent: RuntimeWorktreeAgentRow): string {
return (
agent.conversationName?.trim() ||
agent.displayName?.trim() ||
agent.taskTitle?.trim() ||
getAgentRowPrimaryText({ prompt: agent.prompt }) ||
formatAgentTypeLabel(agent.agentType)
)
}
function oneLine(text: string | null | undefined): string {
return text?.replace(/\s+/g, ' ').trim() ?? ''
}
function lastMessage(agent: RuntimeWorktreeAgentRow): string {
const message = agent.lastAssistantMessage
return message ? oneLine(withoutNativeChatVisualDirectiveLines(message)) : ''
}
/**
* The row's second line: what it waits on or is doing, else what it last said. A last-seen row
* (`group` null) shows no tool, since the tool call is long over.
*/
export function agentListPreview(
agent: RuntimeWorktreeAgentRow,
group: AgentStatusGroup | null,
title: string
): string {
const tool = group === null ? '' : oneLine(formatAgentToolPreviewLine(agent, false))
const preview =
group === 'needs-you' || group === 'working'
? tool || lastMessage(agent)
: lastMessage(agent) || tool
if (preview) {
return preview
}
const prompt = oneLine(getAgentRowPrimaryText({ prompt: agent.prompt }))
return prompt === title ? '' : prompt
}
/** Search covers what the row shows plus the prompt; `query` is already lower-cased. */
export function agentListEntryMatches(entry: HomeAgentEntry, query: string): boolean {
const { agent } = entry
return [
agentListTitle(agent),
agent.activity?.listed === true ? agent.activity.title : null,
entry.workspaceName,
entry.branch,
entry.repo,
formatAgentTypeLabel(agent.agentType),
agent.prompt,
agent.lastAssistantMessage
].some((field) => field?.toLowerCase().includes(query))
}
+190
View File
@@ -0,0 +1,190 @@
import {
AGENT_LIST_STATUS_RANK,
type AgentListVerdict
} from '../../../src/shared/agent-status/presentation/agent-list-status'
import type { RuntimeWorktreeAgentRow } from '../../../src/shared/runtime-types'
import type { ConnectionState } from '../transport/connection/connection-state'
import { agentDotState, agentRowTimeAt, type AgentDotState } from '../worktree/agent-row-display'
import { flattenAgentRowLineage, type AgentRowNode } from '../worktree/agent-row-lineage'
import type { HomeAgentEntry, HostWorktreeInfo } from '../worktree/home-worktree-info'
import { agentListTitle } from './agent-list-row-text'
export type AgentStatusGroup = 'needs-you' | 'working' | 'done' | 'idle'
/** Desktop's status ranks cut into sections: everything ranked above live work needs the user. */
export function agentStatusGroup(state: AgentDotState): AgentStatusGroup {
const rank = AGENT_LIST_STATUS_RANK[state]
if (rank < AGENT_LIST_STATUS_RANK.working) {
return 'needs-you'
}
if (rank <= AGENT_LIST_STATUS_RANK.monitoring) {
return 'working'
}
return state === 'idle' ? 'idle' : 'done'
}
export type ListedAgentVerdict = Extract<AgentListVerdict, { listed: true }>
/** The desktop Agents list's row for this agent; undefined when the host sent no verdict. */
export function listedAgentVerdict(agent: RuntimeWorktreeAgentRow): ListedAgentVerdict | undefined {
return agent.activity?.listed === true ? agent.activity : undefined
}
export type AgentListRow = Readonly<{
key: string
hostId: string
entry: HomeAgentEntry
title: string
dotState: AgentDotState
timeAt: number
/** A copy from a read the desktop no longer backs: it claims no state. */
stale: boolean
/** Its desktop isn't connected, so the row can't open. */
offline: boolean
/** The desktop's read verdict; undefined when it gave none, so the phone claims nothing. */
unread?: boolean
/** A finished turn the desktop can clear from its Agents list. */
clearable: boolean
depth: number
/** Nested workers in tree order; empty when workers are hidden. */
workers: readonly AgentListRow[]
}>
export type AgentListInput = Readonly<{
/** Paired desktops in Home's order. */
hosts: readonly { id: string }[]
hostStates: Readonly<Record<string, ConnectionState>>
worktreeInfo: Readonly<Record<string, HostWorktreeInfo>>
now: number
/** Writes sent but not yet read back, by row key. */
pendingActivity?: Readonly<Record<string, AgentActivityChange>>
}>
/** A read or clear the phone asked its desktop for. */
export type AgentActivityChange = Readonly<{ unread: boolean } | { cleared: true }>
export function agentListRowKey(hostId: string, paneKey: string): string {
return `${hostId}:${paneKey}`
}
export type HostAgents = {
hostId: string
roots: AgentListRow[]
live: boolean
offline: boolean
seenAt?: number
}
export function hostAgents(input: AgentListInput, hostId: string): HostAgents {
const info = input.worktreeInfo[hostId]
const connected = input.hostStates[hostId] === 'connected'
// Only this connection's own read may show states; anything else is what the agents last were.
const liveAgents = connected && !info?.catalogUnavailable ? info?.agents : undefined
const live = liveAgents !== undefined
const pending = (paneKey: string) => input.pendingActivity?.[agentListRowKey(hostId, paneKey)]
// Only what the desktop lists, less what the phone just cleared; a cleared agent's workers stay, as roots.
const entries = (liveAgents ?? info?.lastSeenAgents ?? info?.agents ?? []).filter((entry) => {
const change = pending(entry.agent.paneKey)
return entry.agent.activity?.listed !== false && !(change && 'cleared' in change)
})
const entryByPaneKey = new Map(entries.map((entry) => [entry.agent.paneKey, entry]))
const toRow = (node: AgentRowNode, depth: number): AgentListRow | null => {
const entry = entryByPaneKey.get(node.row.paneKey)
if (!entry) {
return null
}
const { agent } = entry
const verdict = listedAgentVerdict(agent)
const liveVerdict = live ? verdict : undefined
const change = pending(agent.paneKey)
return {
key: agentListRowKey(hostId, agent.paneKey),
hostId,
entry,
title: verdict?.title.trim() || agentListTitle(agent),
dotState: !live ? 'idle' : verdict ? verdict.status : agentDotState(agent, input.now),
timeAt: verdict?.sortAt ?? agentRowTimeAt(agent),
stale: !live,
offline: !connected,
// Read state is the desktop's call; a host that sends none gets no bell and no actions.
unread: liveVerdict
? change && 'unread' in change
? change.unread
: liveVerdict.unread
: undefined,
clearable: liveVerdict?.clearable === true,
depth,
workers: node.children.flatMap((child) => descendants(child, depth + 1))
}
}
const descendants = (node: AgentRowNode, depth: number): AgentListRow[] => {
const row = toRow(node, depth)
return row ? [{ ...row, workers: [] }, ...row.workers] : []
}
// Lineage spans the desktop: a coordinator's workers often run in other workspaces. Desktop's
// own nesting wins where it gave a verdict.
const lineage = entries.map(({ agent }) => {
const verdict = listedAgentVerdict(agent)
return verdict ? { ...agent, parentPaneKey: verdict.childOf ?? null } : agent
})
const roots = flattenAgentRowLineage(lineage)
.filter((node) => node.depth === 0)
.map((node) => toRow(node, 0))
.filter((row): row is AgentListRow => row !== null)
return { hostId, roots, live, offline: !connected, seenAt: info?.countsProvenAt }
}
export function everyRow(roots: readonly AgentListRow[]): AgentListRow[] {
return roots.flatMap((row) => [row, ...row.workers])
}
export const asTopLevel = (row: AgentListRow): AgentListRow => ({ ...row, depth: 0, workers: [] })
export const newestFirst = (a: AgentListRow, b: AgentListRow): number => b.timeAt - a.timeAt
/** Desktop's status order, newest first within a status. */
export const byStatusThenRecent = (a: AgentListRow, b: AgentListRow): number =>
AGENT_LIST_STATUS_RANK[a.dotState] - AGENT_LIST_STATUS_RANK[b.dotState] || newestFirst(a, b)
export function rowNeedsYou(row: AgentListRow): boolean {
return !row.stale && agentStatusGroup(row.dotState) === 'needs-you'
}
/** Live agents that need the user, workers included: Feed's rows and both badge counts. */
export function selectAgentsNeedingYou(input: AgentListInput): AgentListRow[] {
return input.hosts
.flatMap((host) => everyRow(hostAgents(input, host.id).roots))
.filter(rowNeedsYou)
.map(asTopLevel)
.sort(byStatusThenRecent)
}
export function countAgentsNeedingYouByHost(
rows: readonly AgentListRow[]
): Readonly<Record<string, number>> {
const counts: Record<string, number> = {}
for (const row of rows) {
counts[row.hostId] = (counts[row.hostId] ?? 0) + 1
}
return counts
}
export type AgentListHostSummary = Readonly<{
hostId: string
agents: number
needsYou: number
offline: boolean
}>
export function summarizeAgentListHosts(input: AgentListInput): AgentListHostSummary[] {
return input.hosts.map((host) => {
const agents = hostAgents(input, host.id)
const rows = everyRow(agents.roots)
return {
hostId: host.id,
agents: rows.length,
needsYou: rows.filter(rowNeedsYou).length,
offline: agents.offline
}
})
}
@@ -0,0 +1,133 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { z } from 'zod'
import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation'
import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import type { AgentActivityChange, AgentListRow } from './agent-list-rows'
// The host's bound on one request's pane keys.
const PANE_KEYS_PER_REQUEST = 500
const applied = rpcResultVariant('applied', z.object({ applied: z.literal(true) }))
const agentActivitySetReadWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'agentActivity.mobile-set-read',
method: 'agentActivity.setRead',
acceptance: 'require-result-or-throw',
barrier: 'after-caller-barrier',
read: applied
})
)
const agentActivityClearWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'agentActivity.mobile-clear',
method: 'agentActivity.clear',
acceptance: 'require-result-or-throw',
barrier: 'after-caller-barrier',
read: applied
})
)
export type AgentActivityFailure = Readonly<{ hostId: string; needsDesktopWindow: boolean }>
async function sendAgentActivity(
client: RpcClient,
paneKeys: string[],
change: AgentActivityChange
): Promise<void> {
for (let start = 0; start < paneKeys.length; start += PANE_KEYS_PER_REQUEST) {
const chunk = paneKeys.slice(start, start + PANE_KEYS_PER_REQUEST)
if ('cleared' in change) {
agentActivityClearWrite.interpret(
await agentActivityClearWrite.request(client, { paneKeys: chunk })
)
} else {
agentActivitySetReadWrite.interpret(
await agentActivitySetReadWrite.request(client, { paneKeys: chunk, read: !change.unread })
)
}
}
}
/**
* Sends read and clear changes to each row's desktop, showing them until that desktop's next
* list read carries them; a refused write rolls back to the desktop's list and reports which
* desktop refused.
*/
export function useAgentActivityWrites(
clients: readonly { hostId: string; client: RpcClient }[],
refetchHost: (hostId: string) => Promise<void>
) {
const [pending, setPending] = useState<
Readonly<Record<string, { change: AgentActivityChange; token: number }>>
>({})
const tokenRef = useRef(0)
const clientsRef = useRef(clients)
useEffect(() => {
clientsRef.current = clients
}, [clients])
const apply = useCallback(
async (
rows: readonly AgentListRow[],
change: AgentActivityChange
): Promise<AgentActivityFailure[]> => {
tokenRef.current += 1
const token = tokenRef.current
const paneKeysByHost = new Map<string, string[]>()
for (const row of rows) {
paneKeysByHost.set(row.hostId, [
...(paneKeysByHost.get(row.hostId) ?? []),
row.entry.agent.paneKey
])
}
setPending((previous) => ({
...previous,
...Object.fromEntries(rows.map((row) => [row.key, { change, token }]))
}))
const settle = (hostId: string) =>
setPending((previous) =>
Object.fromEntries(
Object.entries(previous).filter(
([key, entry]) => entry.token !== token || !key.startsWith(`${hostId}:`)
)
)
)
const outcomes = await Promise.all(
[...paneKeysByHost].map(
async ([hostId, paneKeys]): Promise<AgentActivityFailure | null> => {
try {
const client = clientsRef.current.find((entry) => entry.hostId === hostId)?.client
if (!client) {
throw new Error('desktop not connected')
}
await sendAgentActivity(client, paneKeys, change)
// The host's next list already carries the change; hold the guess until it lands.
await refetchHost(hostId)
return null
} catch (error) {
// A timeout or a partial batch may still have applied; roll back to what the desktop has.
await refetchHost(hostId)
return {
hostId,
needsDesktopWindow:
error instanceof Error &&
error.message.includes('agent_activity_needs_desktop_window')
}
} finally {
settle(hostId)
}
}
)
)
return outcomes.filter((outcome): outcome is AgentActivityFailure => outcome !== null)
},
[refetchHost]
)
const pendingActivity = useMemo(
() => Object.fromEntries(Object.entries(pending).map(([key, entry]) => [key, entry.change])),
[pending]
)
return { pendingActivity, apply }
}
@@ -0,0 +1,160 @@
import { ArrowUpRight, Copy, Eye, EyeOff, Folder, X } from 'lucide-react-native'
import { useCallback, useMemo, useState } from 'react'
import { Alert } from 'react-native'
import { ActionSheetModal, type ActionSheetAction } from '../components/ActionSheetModal'
import { TransientToast, useTransientToast } from '../components/TransientToast'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import { useClipboardWriter } from '../platform/clipboard'
import { useOpenMobileSession } from '../session/use-open-mobile-session'
import type { HostProfile } from '../transport/hosts/host-profile'
import type { AgentActivityChange, AgentListRow } from './agent-list-rows'
import type { AgentListRowHandlers } from './MobileAgentListRows'
import type { AgentActivityFailure } from './use-agent-activity-writes'
/**
* Tap opens the agent's tab and marks it read; long-press offers it, its workspace, its title and
* the desktop's read and clear. Shared by Feed and Agents.
*/
export function useAgentListRowActions(
toastBottomInset: number,
hosts: readonly HostProfile[],
applyActivity: (
rows: readonly AgentListRow[],
change: AgentActivityChange
) => Promise<AgentActivityFailure[]>
) {
const t = useMobileTranslation()
const openMobileSession = useOpenMobileSession()
const clipboard = useClipboardWriter()
const { message, showToast } = useTransientToast()
const [target, setTarget] = useState<AgentListRow | null>(null)
const open = useCallback(
(row: AgentListRow, withPane: boolean) =>
openMobileSession({
hostId: row.hostId,
worktreeId: row.entry.worktreeId,
name: row.entry.workspaceName,
...(withPane ? { paneKey: row.entry.agent.paneKey } : {})
}),
[openMobileSession]
)
const change = useCallback(
(rows: readonly AgentListRow[], next: AgentActivityChange) => {
if (rows.length === 0) {
return
}
void applyActivity(rows, next).then((failures) => {
const failure = failures[0]
if (!failure) {
return
}
const desktop = hosts.find((host) => host.id === failure.hostId)?.name
showToast(
failure.needsDesktopWindow && desktop
? t('agents.activity.needsWindow', 'Couldn’t update. Open Orca on {{desktop}}.', {
desktop
})
: t('agents.activity.failed', 'Couldn’t update the agent list.')
)
})
},
[applyActivity, hosts, showToast, t]
)
const handlers = useMemo<AgentListRowHandlers>(
() => ({
onOpen: (row) => {
// Like desktop opening a pane; a refusal here isn't worth interrupting the open.
if (row.unread) {
void applyActivity([row], { unread: false })
}
open(row, true)
},
onLongPress: setTarget,
// Only rows the desktop gave a verdict for; the phone never invents read state.
onSetRead: (rows, read) =>
change(
rows.filter((row) => row.unread !== undefined),
{ unread: !read }
),
onClear: (rows) =>
change(
rows.filter((row) => row.clearable),
{ cleared: true }
)
}),
[applyActivity, change, open]
)
const title = target?.title
const offlineHint = target?.offline
? t('agents.actions.offlineHint', 'Its desktop is offline.')
: undefined
const actions = (row: AgentListRow): ActionSheetAction[] => [
{
id: 'open',
label: t('agents.actions.open', 'Open'),
icon: ArrowUpRight,
disabled: row.offline,
hint: offlineHint,
closeBeforePress: true,
onPress: () => handlers.onOpen(row)
},
{
id: 'workspace',
label: t('agents.actions.goToWorkspace', 'Go to workspace'),
icon: Folder,
disabled: row.offline,
hint: offlineHint,
closeBeforePress: true,
onPress: () => open(row, false)
},
...(row.unread === undefined
? []
: [
{
id: 'read',
label: row.unread
? t('agents.actions.markRead', 'Mark as read')
: t('agents.actions.markUnread', 'Mark as unread'),
icon: row.unread ? Eye : EyeOff,
onPress: () => handlers.onSetRead([row], row.unread === true)
}
]),
{
id: 'copy-title',
label: t('agents.actions.copyTitle', 'Copy title'),
icon: Copy,
closeBeforePress: true,
onPress: () => {
void clipboard.writeText(title ?? '').then(
() => showToast(t('agents.actions.copied', 'Copied')),
() => Alert.alert(t('agents.actions.copyFailed', 'Couldn’t copy the title'))
)
}
},
...(row.clearable
? [
{
id: 'clear',
label: t('agents.actions.clear', 'Clear from list'),
icon: X,
onPress: () => handlers.onClear([row])
}
]
: [])
]
const sheet = (
<>
<ActionSheetModal
visible={target !== null}
title={title}
message={target?.entry.workspaceName}
actions={target ? actions(target) : []}
onClose={() => setTarget(null)}
/>
<TransientToast message={message} bottomInset={toastBottomInset} />
</>
)
return { handlers, sheet }
}
+4 -57
View File
@@ -1,68 +1,15 @@
import { describe, expect, it } from 'vitest'
import { setCachedWorktrees, getCachedWorktrees, getProvenCachedWorktrees } from './worktree-cache'
import { setCachedWorktrees, getCachedWorktrees } from './worktree-cache'
// Pin reconnect write-through to cache seeded by host detail (#8498), preventing stale reconnect snapshots.
describe('worktree-cache write-through', () => {
it('returns the most-recently written snapshot, not a stale one', () => {
const hostId = 'host-write-through'
const stale = [{ worktreeId: 'a', name: 'stale' }]
const fresh = [
{ worktreeId: 'a', name: 'fresh' },
{ worktreeId: 'b', name: 'added' }
]
setCachedWorktrees(hostId, stale)
expect(getCachedWorktrees(hostId)).toEqual(stale)
// Reconnect write-through must fully replace poisoned cache.
setCachedWorktrees(hostId, fresh)
expect(getCachedWorktrees(hostId)).toEqual(fresh)
expect(getCachedWorktrees(hostId)).not.toEqual(stale)
})
})
// Only live worktree.ps can prove absence for Resume redirects; persisted cold-start seeds must never be authoritative (F7).
// A persisted cold-start seed must not truncate the rows a live worktree.ps listed.
describe('worktree-cache provenance', () => {
it('withholds unmarked writes from the proven reader', () => {
const hostId = 'host-seeded'
const seeded = [{ worktreeId: 'a' }]
setCachedWorktrees(hostId, seeded)
expect(getCachedWorktrees(hostId)).toEqual(seeded)
expect(getProvenCachedWorktrees(hostId)).toBeNull()
})
it('exposes a host-listed catalog to the proven reader', () => {
const hostId = 'host-proven'
const listed = [{ worktreeId: 'a' }, { worktreeId: 'b' }]
setCachedWorktrees(hostId, listed, { proven: true })
expect(getProvenCachedWorktrees(hostId)).toEqual(listed)
})
it('keeps a fresh proven catalog when an unproven seed lands after it', () => {
it('keeps a fresh host-listed catalog when a cold-start seed lands after it', () => {
const hostId = 'host-kept'
const listed = [{ worktreeId: 'a' }, { worktreeId: 'b' }]
setCachedWorktrees(hostId, listed, { proven: true })
// A cold-start snapshot seed must neither truncate nor de-prove the host-listed rows.
setCachedWorktrees(hostId, [{ worktreeId: 'a' }])
expect(getProvenCachedWorktrees(hostId)).toEqual(listed)
})
it('lets an unproven seed replace another unproven entry', () => {
const hostId = 'host-reseeded'
setCachedWorktrees(hostId, [{ worktreeId: 'a' }])
setCachedWorktrees(hostId, [{ worktreeId: 'b' }])
expect(getCachedWorktrees(hostId)).toEqual([{ worktreeId: 'b' }])
expect(getProvenCachedWorktrees(hostId)).toBeNull()
})
it('reports nothing proven for a host it has never cached', () => {
expect(getProvenCachedWorktrees('host-never-seen')).toBeNull()
expect(getCachedWorktrees(hostId)).toEqual(listed)
})
})
+2 -9
View File
@@ -3,7 +3,7 @@
type CachedWorktrees = {
worktrees: unknown[]
at: number
// Only live host-listed rows can prove absence; persisted cold-start seeds cannot.
// Live host-listed rows; a persisted cold-start seed must not replace them.
proven: boolean
}
@@ -17,13 +17,12 @@ export function setCachedWorktrees(
worktrees: unknown[],
options?: { proven?: boolean }
): void {
// Late cold-start seed must neither erase proof nor truncate live host-listed rows used by Resume.
// A late cold-start seed must not truncate live host-listed rows.
if (options?.proven !== true && readFreshEntry(hostId)?.proven) {
return
}
// Delete before Map.set to move key to newest position for LRU eviction.
cache.delete(hostId)
// Default unproven: unknown row origin cannot justify redirecting user from workspace.
cache.set(hostId, { worktrees, at: Date.now(), proven: options?.proven === true })
if (cache.size > MAX_ENTRIES) {
const oldest = cache.keys().next().value
@@ -37,12 +36,6 @@ export function getCachedWorktrees(hostId: string): unknown[] | null {
return readFreshEntry(hostId)?.worktrees ?? null
}
// Return live host-listed rows only; expired/unproven entries cannot establish absence.
export function getProvenCachedWorktrees(hostId: string): unknown[] | null {
const entry = readFreshEntry(hostId)
return entry?.proven ? entry.worktrees : null
}
function readFreshEntry(hostId: string): CachedWorktrees | null {
const entry = cache.get(hostId)
if (!entry) {
@@ -1,62 +0,0 @@
import { createElement, type ReactNode } from 'react'
import { act, create, type ReactTestRenderer } from 'react-test-renderer'
import { afterEach, describe, expect, it, vi } from 'vitest'
vi.mock('react-native', async () => {
const React = await import('react')
return {
Pressable: ({ children, ...props }: { children?: ReactNode }) =>
React.createElement('Pressable', props, children),
Text: ({ children, ...props }: { children?: ReactNode }) =>
React.createElement('Text', props, children),
View: ({ children, ...props }: { children?: ReactNode }) =>
React.createElement('View', props, children),
StyleSheet: { create: (styles: unknown) => styles }
}
})
vi.mock('../platform/clipboard', () => ({
useClipboardWriter: () => ({ writeText: async () => {} })
}))
import { AgentLaunchNotice } from './AgentLaunchNotice'
import type { MobileAgentLaunchAvailability } from '../session/agent-launch/mobile-agent-launch-availability'
const ERROR_STYLE = { color: 'red' }
describe('AgentLaunchNotice', () => {
let renderer: ReactTestRenderer | null = null
afterEach(() => {
act(() => renderer?.unmount())
renderer = null
})
function lines(props: {
availability?: MobileAgentLaunchAvailability
success?: string | null
error?: string | null
warning?: string | null
}): { text: string; isError: boolean }[] {
act(() => {
renderer = create(
createElement(AgentLaunchNotice, {
availability: props.availability ?? 'available',
success: props.success ?? null,
error: props.error ?? null,
warning: props.warning ?? null,
undeliveredPrompt: null,
errorStyle: ERROR_STYLE
})
)
})
return (renderer?.root.findAll((node) => String(node.type) === 'Text') ?? []).map((node) => ({
text: String(node.props.children),
isError: node.props.style === ERROR_STYLE
}))
}
it('renders nothing with nothing to say', () => {
expect(lines({})).toEqual([])
})
})
+1
View File
@@ -17,6 +17,7 @@ const dotColors = (): Record<
done: '#10b981',
blocked: '#ef4444',
waiting: '#ef4444',
permission: '#ef4444',
interrupted: colors.textMuted,
failed: '#ef4444',
unconfirmed: colors.statusAmber,
+151
View File
@@ -0,0 +1,151 @@
import type { LucideIcon } from 'lucide-react-native'
import type { ReactNode } from 'react'
import { Pressable, Text, View } from 'react-native'
import { Gesture, GestureDetector } from 'react-native-gesture-handler'
import Animated, {
Easing,
ReduceMotion,
useAnimatedStyle,
useSharedValue,
withTiming
} from 'react-native-reanimated'
import { feedback, typography } from '../theme/mobile-theme'
import { themedStyleSheet } from '../theme/themed-styles'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import { useDrawerReducedMotion } from './bottom-drawer/bottom-drawer-constants'
import { SHEET_CURVE } from './sheet-motion-values'
// The width an action uncovers; a swipe past half of it settles open.
const ACTION_WIDTH = 84
const SWIPE_SETTLE_MS = 250
const DRAG_CLICK_WINDOW_MS = 400
export type SwipeRowAction = {
label: string
accessibilityLabel: string
icon: LucideIcon
background: string
foreground: string
onPress: () => void
}
/**
* A row that slides to uncover an action: `leading` behind a right swipe, `trailing` behind a left
* one. Tapping the uncovered action runs it. Rows without either action render as they are;
* gaining or losing both remounts the row.
*/
export function SwipeRowActions({
leading,
trailing,
enabled = true,
children
}: {
leading?: SwipeRowAction
trailing?: SwipeRowAction
enabled?: boolean
/** Gets a wrapper for the row's press: a tap on a swiped row closes it instead. */
children: (guardPress: (onPress: () => void) => () => void) => ReactNode
}) {
useMobileColorScheme()
const reducedMotion = useDrawerReducedMotion()
const offset = useSharedValue(0)
const start = useSharedValue(0)
// When the last drag ended: on the web, releasing a mouse drag also clicks the row.
const dragEndedAt = useSharedValue(0)
const maxRight = leading ? ACTION_WIDTH : 0
const maxLeft = trailing ? -ACTION_WIDTH : 0
// Built per render: a module-level easing would run before a test's Reanimated mock can serve it.
const settle = (to: number) => {
'worklet'
return withTiming(
to,
reducedMotion
? { duration: 0, reduceMotion: ReduceMotion.Never }
: { duration: SWIPE_SETTLE_MS, easing: Easing.bezier(...SHEET_CURVE) }
)
}
// Horizontal only, so the list keeps scrolling under a vertical drag.
const pan = Gesture.Pan()
.enabled(enabled)
.activeOffsetX([-12, 12])
.failOffsetY([-10, 10])
.onBegin(() => {
start.value = offset.value
})
.onUpdate((event) => {
offset.value = Math.min(maxRight, Math.max(maxLeft, start.value + event.translationX))
})
.onEnd(() => {
// oxlint-disable-next-line react/purity -- runs when the drag ends, never during render.
dragEndedAt.value = Date.now()
offset.value = settle(
offset.value > ACTION_WIDTH / 2 ? maxRight : offset.value < -ACTION_WIDTH / 2 ? maxLeft : 0
)
})
// Web has no worklet plugin; mapper hooks need this explicit dependency list.
const rowStyle = useAnimatedStyle(() => ({ transform: [{ translateX: offset.value }] }), [offset])
// A tap on an open row closes it rather than pressing the row.
const guardPress = (onPress: () => void) => () => {
// The click a drag release produces belongs to the drag, not to the row.
if (Date.now() - dragEndedAt.value < DRAG_CLICK_WINDOW_MS) {
return
}
if (offset.value !== 0) {
offset.value = settle(0)
return
}
onPress()
}
if (!leading && !trailing) {
return children((onPress) => onPress)
}
const renderAction = (action: SwipeRowAction, side: 'leading' | 'trailing') => {
const Icon = action.icon
return (
<Pressable
style={({ pressed }) => [
styles.action,
side === 'leading' ? styles.leading : styles.trailing,
{ backgroundColor: action.background },
pressed && styles.actionPressed
]}
disabled={!enabled}
onPress={() => {
offset.value = settle(0)
action.onPress()
}}
accessibilityRole="button"
accessibilityLabel={action.accessibilityLabel}
>
<Icon size={17} color={action.foreground} strokeWidth={2.2} />
<Text style={[styles.actionText, { color: action.foreground }]}>{action.label}</Text>
</Pressable>
)
}
return (
<View>
{leading ? renderAction(leading, 'leading') : null}
{trailing ? renderAction(trailing, 'trailing') : null}
{/* pan-y keeps the page scrolling vertically over the row on the web. */}
<GestureDetector gesture={pan} touchAction="pan-y">
<Animated.View style={rowStyle}>{children(guardPress)}</Animated.View>
</GestureDetector>
</View>
)
}
const styles = themedStyleSheet(() => ({
action: {
position: 'absolute',
top: 0,
bottom: 0,
width: ACTION_WIDTH,
alignItems: 'center',
justifyContent: 'center',
gap: 2
},
leading: { left: 0 },
trailing: { right: 0 },
actionPressed: { opacity: feedback.pressedOpacity },
actionText: { fontSize: typography.metaSize, fontWeight: '600' }
}))
@@ -69,20 +69,6 @@ describe('native-chat visual lines in mobile markdown', () => {
expect(directives).toEqual([{ file: 'after.html', title: null }])
})
it('leaves malformed or path-like directives as literal text', () => {
for (const line of [
'::orca-visual{file="../secret.html"}',
'::orca-visual{file="a.html" file="b.html"}',
'::orca-visual{file="a.htm"}',
'::orca-visual{file="a.html"',
'::orca-visual{file="a.html"} trailing words'
]) {
const { directives, blocks } = blocksOf(line)
expect(directives, line).toEqual([])
expect(blocks, line).toEqual([{ type: 'paragraph', text: line }])
}
})
it('renders directives past the per-message cap as text', () => {
const lines = Array.from(
{ length: NATIVE_CHAT_VISUAL_MAX_PER_MESSAGE + 1 },
@@ -21,14 +21,6 @@ describe('presentPrMerge', () => {
mergeable: 'MERGEABLE' as const
}
it('disables Merge with desktop copy when GitHub reports conflicts', () => {
expect(presentPrMerge(pr, 'squash')).toMatchObject({
enabled: false,
label: 'Conflicts',
hint: 'GitHub reports merge conflicts'
})
})
it('lets a complete stack merge through, and names a blocking downstack PR', () => {
const stack = {
number: 51,
@@ -50,41 +50,6 @@ describe('useConnectedHostPicker', () => {
act(() => handle.current!.pickHost(action, hosts))
}
it('runs the action on the only offered host without a picker', () => {
render([desk, laptop])
const action = vi.fn()
pickHost(action, [laptop])
expect(action).toHaveBeenCalledWith('laptop')
expect(picker().visible).toBe(false)
})
it('offers only the hosts passed in', () => {
render([desk, laptop, server])
const action = vi.fn()
pickHost(action, [desk, server])
expect(picker().visible).toBe(true)
expect(picker().options.map((option) => option.value)).toEqual(['desk', 'server'])
act(() => picker().onSelect('server'))
act(() => picker().onAfterClose())
expect(action).toHaveBeenCalledWith('server')
})
it('runs nothing when the picker is dismissed', () => {
render([desk, laptop])
const action = vi.fn()
pickHost(action)
act(() => picker().onClose())
act(() => picker().onAfterClose())
expect(picker().visible).toBe(false)
expect(action).not.toHaveBeenCalled()
})
it('disambiguates path-routed hosts without exposing endpoint paths', () => {
render([
host('desk-a', 'Desk', 'wss://gateway.example.com/v1/connect/bearer-secret-a'),
@@ -1,86 +0,0 @@
import { describe, expect, it } from 'vitest'
import { getReportableConnectionIncidentId } from './connection-diagnostics-analysis'
import type { ConnectionLogEntry } from './connection/connection-log-types'
// Reproduce a 0.0.50 phone / 1.4.203 host export (2026-09-18): relay dials failed 4404, LAN timed out, and a resume before export erased the reported cause.
const ENDPOINT = 'ws://192.168.1.2:55927'
let sequence = 0
function entry(fields: Omit<ConnectionLogEntry, 'id' | 'ts'>): ConnectionLogEntry {
sequence += 1
return { id: `export-${sequence}`, ts: Date.parse('2026-09-18T22:44:00Z') + sequence, ...fields }
}
const appResumed = () =>
entry({
level: 'info',
code: 'app-resumed',
message: 'App returned to foreground',
detail: 'Connection recovery notified'
})
const lanOpening = () =>
entry({ level: 'info', path: 'lan', message: 'Opening WebSocket', detail: '192.168.1.2:55927' })
const relayDialFailed = (closeCode: number) =>
entry({
level: 'error',
code: 'relay-dial-failed',
path: 'relay',
message: 'Relay: relay dial failed',
detail: `Error: relay_outer_${closeCode}`,
relayCloseCode: closeCode
})
const lanConnectTimeout = () =>
entry({
level: 'error',
code: 'connect-timeout',
path: 'lan',
message: 'WebSocket connect timeout',
detail: 'No TCP/WS handshake within 12s — endpoint unreachable?'
})
const retryScheduled = () =>
entry({
level: 'info',
code: 'retry-scheduled',
path: 'lan',
message: 'Reconnect scheduled in 500ms',
detail: 'Attempt 1'
})
function resumeWindow(closeCode: number): ConnectionLogEntry[] {
return [
appResumed(),
lanOpening(),
relayDialFailed(closeCode),
lanConnectTimeout(),
retryScheduled()
]
}
describe('diagnoseConnection on the relay-4404 export', () => {
// The export ends before a new outcome, so the latest evidence predates resume.
const CUT_MID_WINDOW = [...resumeWindow(4404), ...resumeWindow(4404), appResumed(), lanOpening()]
// The later LAN timeout only means the phone is off LAN; it must not outrank the relay verdict.
it('is never a sendable relay incident', () => {
expect(
getReportableConnectionIncidentId({
endpoint: ENDPOINT,
state: 'connecting',
entries: CUT_MID_WINDOW
})
).toBeNull()
expect(
getReportableConnectionIncidentId({
endpoint: ENDPOINT,
state: 'connecting',
entries: resumeWindow(4404)
})
).toBeNull()
})
})
@@ -1,8 +1,5 @@
import { describe, expect, it } from 'vitest'
import {
resolveDiagnosticsHostId,
selectDiagnosticsHostId
} from './connection-diagnostics-screen-data'
import { resolveDiagnosticsHostId } from './connection-diagnostics-screen-data'
import type { HostProfile } from '../transport/hosts/host-profile'
@@ -16,11 +13,6 @@ const host = (id: string): HostProfile => ({
})
describe('connection diagnostics screen data', () => {
it('prefers a valid route host when navigation changes', () => {
expect(selectDiagnosticsHostId([host('a'), host('b')], 'b', 'a')).toBe('b')
expect(selectDiagnosticsHostId([host('a')], 'missing', 'missing')).toBe('a')
})
it('applies route changes synchronously without discarding a chip choice for the same route', () => {
const hosts = [host('a'), host('b')]
expect(resolveDiagnosticsHostId(hosts, undefined, null)).toBe('a')
@@ -7,24 +7,6 @@ function entry(id: number): ConnectionLogEntry {
}
describe('connection log buffer', () => {
it('keeps entries per host without cross-talk', () => {
const store = createConnectionLogStore()
store.append('host-a', entry(1))
store.append('host-b', entry(2))
expect(store.get('host-a').map((e) => e.id)).toEqual(['log-1'])
expect(store.get('host-b').map((e) => e.id)).toEqual(['log-2'])
})
it('drops the oldest entries past the cap', () => {
const store = createConnectionLogStore(3)
for (let i = 1; i <= 5; i++) {
store.append('host-a', entry(i))
}
expect(store.get('host-a').map((e) => e.id)).toEqual(['log-3', 'log-4', 'log-5'])
})
it('redacts credentials before retaining or persisting an event', async () => {
const save = vi.fn(async () => {})
const store = createConnectionLogStore(3, {
@@ -1,55 +0,0 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createConnectionLogStore } from './connection-log-buffer'
import type { ConnectionLogEntry } from './connection-log-types'
const entry = (id: number): ConnectionLogEntry => ({
id: `${id}`,
ts: id,
level: 'info',
message: `event ${id}`
})
const drain = () => vi.advanceTimersByTimeAsync(0)
beforeEach(() => {
vi.useFakeTimers()
})
afterEach(() => {
vi.clearAllTimers()
vi.useRealTimers()
})
describe('connection log persistence revisions', () => {
it('replaces obsolete queued revisions while a save is delayed', async () => {
const saved: string[][] = []
let release!: () => void
let delay = false
const store = createConnectionLogStore(2, {
load: async () => [],
save: async (_host, entries) => {
saved.push(entries.map((item) => item.id))
if (delay) {
delay = false
await new Promise<void>((resolve) => {
release = resolve
})
}
}
})
await store.hydrate('a')
await drain()
saved.length = 0
delay = true
store.append('a', entry(1))
await drain()
store.append('a', entry(2))
await drain()
store.append('a', entry(3))
await drain()
expect(saved).toEqual([['1']])
release()
await drain()
expect(saved).toEqual([['1'], ['2', '3']])
})
})
@@ -1,18 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { createRelayRecoveryLog } from './mobile-relay-recovery-log'
import type { ConnectionLogEntry } from './connection-log-types'
afterEach(() => vi.restoreAllMocks())
describe('createRelayRecoveryLog', () => {
it('uses distinct ids across logger instances', () => {
vi.spyOn(Date, 'now').mockReturnValue(1)
const entries: ConnectionLogEntry[] = []
const sink = vi.fn((entry: ConnectionLogEntry) => entries.push(entry))
createRelayRecoveryLog(() => 1, sink)('first')
createRelayRecoveryLog(() => 1, sink)('second')
expect(entries).toHaveLength(2)
expect(entries[0]?.id).not.toBe(entries[1]?.id)
})
})
@@ -79,13 +79,4 @@ describe('native connection diagnostic reports', () => {
expect(report).toContain('Host Orca version: unknown')
expect(report).not.toContain('1.4.197')
})
it('keeps disconnected reports explicit even with a captured version', async () => {
const context = createContext()
context.setConnection('disconnected', 1_000)
const device = createNativeDiagnosticsOperations(host, context, '1.4.197')
const { report } = await device.report()
expect(report).toContain('Host Orca version: unknown (not currently connected)')
expect(report).not.toContain('1.4.197')
})
})
@@ -1,12 +1,9 @@
import { describe, expect, it, vi } from 'vitest'
import {
buildMobileImagePastePayload,
buildMobileTerminalImagePastePayload,
normalizeMobileClipboardImageBase64,
saveMobileClipboardImageAsTempFile
} from './mobile-clipboard-image'
import { computeMobileClipboardImageDownscale } from './mobile-clipboard-image-downscale'
import type { RpcClient } from '../../transport/rpc/rpc-client-contract'
import '../../transport/connection/stable-logical-rpc-client'
@@ -39,16 +36,6 @@ function clientWithResponses(responses: RpcResponse[]): Pick<RpcClient, 'sendReq
}
describe('mobile clipboard image paste helpers', () => {
it('strips data URL image prefixes', () => {
expect(normalizeMobileClipboardImageBase64('data:image/png;base64,aGVsbG8=')).toBe('aGVsbG8=')
})
it('rejects non-base64 image data', () => {
expect(() => normalizeMobileClipboardImageBase64('not base64!')).toThrow(
'Clipboard image content must be base64'
)
})
it('falls back to the legacy single-frame image save method when needed', async () => {
const client = clientWithResponses([
fail('start', 'method_not_found', 'missing'),
@@ -87,32 +74,6 @@ describe('mobile clipboard image paste helpers', () => {
})
})
it('brackets generated image paths before sending to the terminal', () => {
expect(buildMobileImagePastePayload('/tmp/orca.png', 'claude')).toBe(
'\x1b[200~/tmp/orca.png\x1b[201~'
)
expect(buildMobileImagePastePayload('/tmp/\x1b.png', 'claude')).toBe(
'\x1b[200~/tmp/\u241b.png\x1b[201~'
)
})
it('escapes spaced paths for Codex and unidentified terminals', () => {
const escaped = '\x1b[200~/tmp/or\\ ca.png\x1b[201~'
expect(buildMobileTerminalImagePastePayload('/tmp/or ca.png', 'codex')).toBe(escaped)
expect(buildMobileTerminalImagePastePayload('/tmp/or ca.png', null)).toBe(escaped)
expect(buildMobileTerminalImagePastePayload('/tmp/or ca.png', undefined)).toBe(escaped)
expect(buildMobileTerminalImagePastePayload('/tmp/or ca.png', 'unknown')).toBe(escaped)
expect(buildMobileTerminalImagePastePayload('/tmp/\x1b.png', null)).toBe(
'\x1b[200~/tmp/\u241b.png\x1b[201~'
)
})
it('keeps file mentions for agents that need them', () => {
const mention = '\x1b[200~@"/tmp/or ca.png"\x1b[201~'
expect(buildMobileTerminalImagePastePayload('/tmp/or ca.png', 'opencode')).toBe(mention)
expect(buildMobileImagePastePayload('/tmp/or ca.png', null)).toBe(mention)
})
it.each([null, 'unknown', 'codex', 'omp'])(
'contains embedded paste markers inside the image paste for %s',
(agent) => {
@@ -126,25 +87,4 @@ describe('mobile clipboard image paste helpers', () => {
expect(payload).toContain('image\u241b[201~\ncommand\u241b[200~.png')
}
)
it('quotes Windows paths with spaces using the host path dialect', () => {
expect(
buildMobileTerminalImagePastePayload('C:\\Users\\Jane Doe\\Temp\\orca-paste.png', null)
).toBe('\x1b[200~"C:\\Users\\Jane Doe\\Temp\\orca-paste.png"\x1b[201~')
})
})
describe('mobile clipboard image downscaling', () => {
it('does not downscale images already within the byte budget', () => {
expect(computeMobileClipboardImageDownscale(50, 100, 100, 100)).toBeNull()
})
it('shrinks both edges by ~sqrt(budget/actual) when over the budget', () => {
expect(computeMobileClipboardImageDownscale(400, 40, 20, 100)).toEqual({ width: 17, height: 8 })
})
it('refuses to downscale when source dimensions are unusable', () => {
expect(computeMobileClipboardImageDownscale(400, 0, 20, 100)).toBeNull()
expect(computeMobileClipboardImageDownscale(400, 40, -1, 100)).toBeNull()
})
})
@@ -1,33 +0,0 @@
import { describe, expect, it, vi } from 'vitest'
vi.mock('expo-image-picker', () => ({}))
vi.mock('expo-document-picker', () => ({ getDocumentAsync: vi.fn() }))
vi.mock('expo-file-system', () => ({ File: vi.fn() }))
import '../../platform/media-picker-contract'
import type { PickedMobileFile } from '../../platform/media-picker-contract'
import { pickMobileFiles } from './mobile-file-source-picker'
type Asset = { uri: string; name: string; size?: number; mimeType?: string }
function launcher(assets: Asset[] | null) {
return vi.fn(async () =>
assets === null
? { canceled: true as const, assets: null }
: { canceled: false as const, assets: assets.map((asset) => ({ lastModified: 0, ...asset })) }
)
}
async function collect(files: AsyncIterable<PickedMobileFile>): Promise<PickedMobileFile[]> {
const taken: PickedMobileFile[] = []
for await (const file of files) {
taken.push(file)
}
return taken
}
describe('pickMobileFiles', () => {
it('yields nothing for a cancelled picker', async () => {
expect(await collect(pickMobileFiles({ launch: launcher(null) }))).toEqual([])
})
})
@@ -56,15 +56,6 @@ describe('useMobileAttachmentInputLeaseGate', () => {
}
}
it('passes immediately when the lease is ready and the target is active', async () => {
const refs = baseRefs()
const showToast = vi.fn()
const { gate } = renderGate({ ...refs, showToast })
await expect(gate()('terminal-1')).resolves.toBe(true)
expect(showToast).not.toHaveBeenCalled()
})
it('waits out a lease-not-ready window and then sends', async () => {
const refs = baseRefs()
refs.leaseReady.current = false
@@ -1,109 +0,0 @@
import { describe, expect, it } from 'vitest'
import type { RpcResponse } from '../transport/rpc/rpc-wire-types'
import { resolveMobileFileTabDoc } from './mobile-file-tab-doc'
function ok(result: unknown): RpcResponse {
return { id: 'x', ok: true, result, _meta: { runtimeId: 'r' } }
}
function fail(code: string, message: string): RpcResponse {
return { id: 'x', ok: false, error: { code, message }, _meta: { runtimeId: 'r' } }
}
function clientOf(byMethod: Record<string, RpcResponse>): {
sendRequest: (method: string, params?: unknown) => Promise<RpcResponse>
calls: string[]
requests: { method: string; params: unknown }[]
} {
const calls: string[] = []
const requests: { method: string; params: unknown }[] = []
return {
calls,
requests,
sendRequest: (method: string, params?: unknown) => {
calls.push(method)
requests.push({ method, params })
const response = byMethod[method]
if (!response) {
throw new Error(`unexpected method ${method}`)
}
return Promise.resolve(response)
}
}
}
const WT = { worktreeId: 'wt1' }
describe('resolveMobileFileTabDoc', () => {
it('renders a staged text diff', async () => {
const client = clientOf({
'git.diff': ok({ kind: 'text', originalContent: 'a\n', modifiedContent: 'a\nb\n' })
})
const doc = await resolveMobileFileTabDoc(client, {
...WT,
relativePath: 'a.ts',
diffSource: 'staged'
})
expect(doc).toEqual({
status: 'ready',
kind: 'diff',
lines: [
{ kind: 'context', text: 'a', oldLineNumber: 1, newLineNumber: 1 },
{ kind: 'add', text: 'b', newLineNumber: 2 }
],
truncated: false
})
expect(client.requests).toEqual([
{ method: 'git.diff', params: { worktree: 'id:wt1', filePath: 'a.ts', staged: true } }
])
})
it('throws binary_file for an image modify whose bytes are empty (no stale fallback)', async () => {
const client = clientOf({
'git.diff': ok({
kind: 'binary',
originalContent: 'b2xk',
modifiedContent: '',
modifiedIsBinary: true,
isImage: true,
mimeType: 'image/png'
})
})
await expect(
resolveMobileFileTabDoc(client, { ...WT, relativePath: 'm1.png', diffSource: 'unstaged' })
).rejects.toThrow('binary_file')
})
it('throws binary_file for a non-image binary diff', async () => {
const client = clientOf({ 'git.diff': ok({ kind: 'binary', modifiedContent: 'AAAA' }) })
await expect(
resolveMobileFileTabDoc(client, { ...WT, relativePath: 'a.bin', diffSource: 'unstaged' })
).rejects.toThrow('binary_file')
})
it('throws binary_file when readPreview returns no image bytes', async () => {
const client = clientOf({
'files.readPreview': ok({ content: '', isImage: true, mimeType: 'image/png' })
})
await expect(
resolveMobileFileTabDoc(client, { ...WT, relativePath: 'logo.png' })
).rejects.toThrow('binary_file')
})
// An older client must still surface the host’s oversized-diff error message rather than render an empty diff.
it('propagates a host diff_too_large failure instead of rendering an empty diff', async () => {
const client = clientOf({
'git.diff': fail('diff_too_large', 'This diff is too large to open over a remote connection.')
})
await expect(
resolveMobileFileTabDoc(client, { ...WT, relativePath: 'a.ts', diffSource: 'staged' })
).rejects.toThrow('This diff is too large to open over a remote connection.')
})
it('propagates the RPC error message when a read fails', async () => {
const client = clientOf({ 'files.read': fail('EIO', 'file_too_large') })
await expect(
resolveMobileFileTabDoc(client, { ...WT, relativePath: 'notes.txt' })
).rejects.toThrow('file_too_large')
})
})
@@ -1,52 +0,0 @@
import { describe, expect, it } from 'vitest'
import {
resolveMarkdownFloatingActionsBottom,
shouldShowMarkdownFloatingActions
} from './markdown-floating-actions-layout'
describe('resolveMarkdownFloatingActionsBottom', () => {
it('keeps markdown actions at their resting bottom when the keyboard is closed', () => {
expect(
resolveMarkdownFloatingActionsBottom({
keyboardLift: 0,
restingBottom: 16,
liftedClearance: 12
})
).toBe(16)
})
it('raises markdown actions above the keyboard with clearance', () => {
expect(
resolveMarkdownFloatingActionsBottom({
keyboardLift: 291,
restingBottom: 16,
liftedClearance: 12
})
).toBe(303)
})
})
describe('shouldShowMarkdownFloatingActions', () => {
const idle = {
keyboardLift: 0,
hasStatus: false,
showRefresh: false,
showCopy: false,
showSave: false
}
it('shows the floating row for keyboard dismissal without document actions', () => {
expect(shouldShowMarkdownFloatingActions({ ...idle, keyboardLift: 291 })).toBe(true)
})
it('hides the floating row on a clean document with the keyboard closed', () => {
expect(shouldShowMarkdownFloatingActions(idle)).toBe(false)
})
it.each(['hasStatus', 'showRefresh', 'showCopy', 'showSave'] as const)(
'shows the floating row for %s alone',
(field) => {
expect(shouldShowMarkdownFloatingActions({ ...idle, [field]: true })).toBe(true)
}
)
})
+3 -7
View File
@@ -12,7 +12,6 @@ import type { ConnectionState } from '../transport/connection/connection-state'
import type { HostCatalogEntry, HostProfile } from '../transport/hosts/host-profile'
import { colors } from '../theme/mobile-theme'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import { homeAgentNeedsYou } from '../worktree/home-jump-back-in'
import { homeHostWorktreeSummary, type HostWorktreeInfo } from '../worktree/home-worktree-info'
import { homeListStyles as styles } from './home-list-styles'
@@ -52,6 +51,8 @@ export function MobileHomeDesktopRow(props: {
path: MobileConnectionPath
// The row owns fresh/stale/unavailable wording so callers cannot hide retained counts again (STA-3123).
worktreeInfo?: HostWorktreeInfo
/** Agents on this desktop waiting on the user. */
needsYou: number
onPress: () => void
onLongPress: () => void
}) {
@@ -95,12 +96,7 @@ export function MobileHomeDesktopRow(props: {
Boolean(line)
)
const statusLine = connected && worktreeSummary.visual ? worktreeSummary.visual : statusLabel
const attention = props.worktreeInfo?.catalogUnavailable
? undefined
: props.worktreeInfo?.attention
const needsYou = connected
? (attention?.filter((worktree) => homeAgentNeedsYou(worktree.dotStatus)).length ?? 0)
: 0
const needsYou = connected ? props.needsYou : 0
const needsYouLabel =
needsYou > 0
? needsYou === 1
+5 -1
View File
@@ -22,6 +22,8 @@ type MobileHomeHostListProps = {
hostConnections: HomeHostConnections
hosts: HostCatalogEntry[]
hostStates: Record<string, ConnectionState>
/** Agents waiting on the user, per desktop. */
needsYouByHost: Readonly<Record<string, number>>
worktreeInfo: Record<string, HostWorktreeInfo>
onOpen: (host: HostCatalogEntry) => void
onOpenActions: (host: HostCatalogEntry) => void
@@ -48,6 +50,7 @@ export function MobileHomeHostList(props: MobileHomeHostListProps) {
hostLastConnected={props.hostLastConnected}
hostConnections={props.hostConnections}
hostStates={props.hostStates}
needsYou={props.needsYouByHost[host.id] ?? 0}
worktreeInfo={props.worktreeInfo}
onOpen={props.onOpen}
onOpenActions={props.onOpenActions}
@@ -86,7 +89,7 @@ type MobileHomeHostRowProps = Pick<
| 'worktreeInfo'
| 'onOpen'
| 'onOpenActions'
> & { item: HostCatalogEntry }
> & { item: HostCatalogEntry; needsYou: number }
const MobileHomeHostRow = memo(function MobileHomeHostRow(props: MobileHomeHostRowProps) {
const { item, onOpen, onOpenActions } = props
@@ -117,6 +120,7 @@ const MobileHomeHostRow = memo(function MobileHomeHostRow(props: MobileHomeHostR
verdict={verdict}
path={connection?.path ?? 'lan'}
worktreeInfo={props.worktreeInfo[item.id]}
needsYou={props.needsYou}
onPress={open}
onLongPress={openActions}
/>
-171
View File
@@ -1,171 +0,0 @@
import { ChevronRight } from 'lucide-react-native'
import { memo, useMemo, useState } from 'react'
import { Pressable, Text, View } from 'react-native'
import Animated, { FadeIn, FadeOut, LinearTransition } from 'react-native-reanimated'
import type { WorktreeStatus } from '../../../src/shared/worktree-status-rollup'
import { AgentSpinner, agentStatusColors } from '../components/AgentSpinner'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import { useReducedMotionEnabled } from '../platform/use-reduced-motion'
import { colors } from '../theme/mobile-theme'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import { useHostDisplay } from '../transport/hosts/use-host-display'
import { areStructurallyEqual } from '../worktree/structural-equality'
import type { HostCatalogEntry } from '../transport/hosts/host-profile'
import type { HomeJumpBackInRow } from '../worktree/home-jump-back-in'
import { agentStateLabel, type AgentDotState } from '../worktree/agent-row-display'
import { homeListStyles as styles } from './home-list-styles'
import { MobileHomeSectionHeading } from './MobileHomeSectionHeading'
import { HOME_EASE_OUT } from './tabs/home-tabs'
const LABEL_STATE: Partial<Record<WorktreeStatus, AgentDotState>> = {
permission: 'waiting',
failed: 'failed',
done: 'done',
working: 'working',
monitoring: 'monitoring'
}
// Only states that ask something of the user take the dot's colour; running work stays quiet.
const TINTED_STATUSES: ReadonlySet<WorktreeStatus> = new Set(['permission', 'failed', 'done'])
// Enough to see what needs you without the list pushing Desktops off the first screen.
const AGENT_ROWS_COLLAPSED = 5
// Usage, stats and connection ticks re-render Home; the section redraws only when its rows change.
export const MobileHomeJumpBackIn = memo(function MobileHomeJumpBackIn(props: {
rows: readonly HomeJumpBackInRow[]
hosts: readonly HostCatalogEntry[]
first: boolean
onOpen: (row: HomeJumpBackInRow) => void
}) {
const t = useMobileTranslation()
useMobileColorScheme()
const reducedMotion = useReducedMotionEnabled() === true
const [expanded, setExpanded] = useState(false)
// Rows glide to their new place when an agent's state reorders the list.
const layout = useMemo(
() => (reducedMotion ? undefined : LinearTransition.duration(220).easing(HOME_EASE_OUT)),
[reducedMotion]
)
if (props.rows.length === 0) {
return null
}
// One desktop needs no naming.
const nameDesktops = props.hosts.length > 1
const collapsible = props.rows.length > AGENT_ROWS_COLLAPSED
const shown = expanded || !collapsible ? props.rows : props.rows.slice(0, AGENT_ROWS_COLLAPSED)
const activeCount = props.rows.filter((row) => !row.lastOpened).length
const entering = reducedMotion ? undefined : FadeIn.duration(180)
return (
<>
<MobileHomeSectionHeading
title={t('home.agents.heading', 'Agents')}
aside={
activeCount > 0
? t('home.agents.activeCount', '{{count}} active', { count: activeCount })
: undefined
}
first={props.first}
/>
<Animated.View style={styles.group} layout={layout}>
{shown.map((row, index) => (
<Animated.View
key={`${row.hostId}:${row.worktree.worktreeId}`}
layout={layout}
entering={entering}
exiting={reducedMotion ? undefined : FadeOut.duration(120)}
>
{index > 0 ? <View style={styles.separator} /> : null}
<JumpBackInRow
row={row}
host={props.hosts.find((host) => host.id === row.hostId) ?? null}
nameDesktop={nameDesktops}
onOpen={props.onOpen}
/>
</Animated.View>
))}
{collapsible ? (
<Animated.View layout={layout}>
<View style={[styles.separator, styles.fullSeparator]} />
<Pressable
accessibilityRole="button"
accessibilityState={{ expanded }}
style={({ pressed }) => [styles.actionRow, pressed && styles.rowPressed]}
onPress={() => setExpanded((value) => !value)}
>
<Text style={[styles.actionLabel, { color: colors.textSecondary }]}>
{expanded
? t('home.agents.showFewer', 'Show fewer')
: t('home.agents.showAll', 'Show all {{count}}', { count: props.rows.length })}
</Text>
</Pressable>
</Animated.View>
) : null}
</Animated.View>
</>
)
})
// Each refresh rebuilds every row object; compare by value so only changed rows redraw.
const JumpBackInRow = memo(function JumpBackInRow(props: {
row: HomeJumpBackInRow
host: HostCatalogEntry | null
nameDesktop: boolean
onOpen: (row: HomeJumpBackInRow) => void
}) {
const t = useMobileTranslation()
useMobileColorScheme()
const { row } = props
const desktopName = useHostDisplay(props.host).title
const workspace = row.worktree.displayName || row.worktree.repo
const conversation = row.worktree.conversationName
const title = conversation ?? workspace
const labelState = LABEL_STATE[row.worktree.dotStatus]
const status = row.lastOpened
? row.actionable
? t('home.jumpBackIn.lastOpened', 'Last opened')
: t('home.jumpBackIn.connectToOpen', 'Connect {{desktop}} to open', { desktop: desktopName })
: labelState
? agentStateLabel(labelState)
: ''
// Branch names repeat across projects, so the repo is always named (#37642); "Connect X" already names the desktop.
// A named conversation takes the title and moves the workspace to the subtitle (#38007).
const where = [
conversation ? workspace : null,
row.worktree.repo && row.worktree.repo !== workspace ? row.worktree.repo : null,
props.nameDesktop && (row.actionable || !row.lastOpened) ? desktopName : null
]
.filter(Boolean)
.join(' · ')
const statusColor =
!row.lastOpened && TINTED_STATUSES.has(row.worktree.dotStatus)
? agentStatusColors()[row.worktree.dotStatus]
: colors.textSecondary
return (
<Pressable
accessibilityRole="button"
accessibilityLabel={[title, status, where].filter(Boolean).join(', ')}
accessibilityState={{ disabled: !row.actionable }}
disabled={!row.actionable}
style={({ pressed }) => [styles.row, pressed && styles.rowPressed]}
onPress={() => props.onOpen(row)}
>
<View style={[styles.status, !row.actionable && styles.rowDisabled]}>
<AgentSpinner status={row.worktree.dotStatus} workingMode={row.worktree.workingMode} />
</View>
<View style={[styles.text, !row.actionable && styles.rowDisabled]}>
<Text style={styles.title} numberOfLines={1}>
{title}
</Text>
<Text style={styles.subtitle} numberOfLines={1}>
<Text style={{ color: statusColor }}>{status}</Text>
{where ? `${status ? ' · ' : ''}${where}` : ''}
</Text>
</View>
<View style={styles.trailing}>
<ChevronRight size={16} color={colors.textMuted} />
</View>
</Pressable>
)
}, areStructurallyEqual)
+43
View File
@@ -0,0 +1,43 @@
import { memo } from 'react'
import type { AgentListRow } from '../agents/agent-list-rows'
import { MobileAgentListRows, type AgentListRowHandlers } from '../agents/MobileAgentListRows'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import type { HostProfile } from '../transport/hosts/host-profile'
import { areStructurallyEqual } from '../worktree/structural-equality'
import { MobileHomeSectionHeading } from './MobileHomeSectionHeading'
// Enough to act on without pushing Desktops off the first screen; the Agents tab has the rest.
const NEEDS_YOU_ROWS_SHOWN = 3
/** Feed's short list of agents waiting on the user; hidden when none are. */
export const MobileHomeNeedsYou = memo(function MobileHomeNeedsYou(props: {
handlers: AgentListRowHandlers
rows: readonly AgentListRow[]
hosts: readonly HostProfile[]
now: number
onSeeAll: () => void
}) {
const t = useMobileTranslation()
if (props.rows.length === 0) {
return null
}
return (
<>
<MobileHomeSectionHeading
title={t('home.needsYou.heading', 'Needs you')}
count={props.rows.length}
aside={t('home.needsYou.seeAll', 'See all agents')}
onAsidePress={props.onSeeAll}
first
/>
<MobileAgentListRows
rows={props.rows.slice(0, NEEDS_YOU_ROWS_SHOWN)}
footer="workspace"
nameDesktop={props.hosts.length > 1}
hosts={props.hosts}
now={props.now}
handlers={props.handlers}
/>
</>
)
}, areStructurallyEqual)
+126 -130
View File
@@ -1,16 +1,15 @@
import { useFocusEffect } from 'expo-router'
import { useCallback, useState } from 'react'
import { Alert, BackHandler, View } from 'react-native'
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'
import { useMobileTranslation } from '../i18n/use-mobile-translation'
import { useOpenMobileAccounts } from '../accounts/use-open-mobile-accounts'
import { getProvenCachedWorktrees } from '../cache/worktree-cache'
import { ActionSheetModal } from '../components/ActionSheetModal'
import { ConfirmModal } from '../components/ConfirmModal'
import { getHostListActionSheetActions } from '../host-list-action-sheet-actions'
import { hostRouteWithNotice } from '../host-route-notice'
import { triggerMediumImpact } from '../platform/haptics'
import { useOpenMobileSession } from '../session/use-open-mobile-session'
import { useAgentListRowActions } from '../agents/use-agent-list-row-actions'
import { useOpenMobileTasks } from '../tasks/use-open-mobile-tasks'
import { useOpenMobileAutomations } from '../automations/use-open-mobile-automations'
import { colors, spacing } from '../theme/mobile-theme'
@@ -28,11 +27,10 @@ import { loadHostCatalog } from '../transport/hosts/host-store'
import type { HostCatalogEntry, HostProfile } from '../transport/hosts/host-profile'
import { useOpenMobileHostEdit } from '../host-screen/use-open-mobile-host-edit'
import { mobileConnectionPathLabel } from '../transport/connection/mobile-connection-path-label'
import { homeAgentNeedsYou, type HomeJumpBackInRow } from '../worktree/home-jump-back-in'
import { isResumeTargetConfirmedMissing } from '../worktree/home-resume-card'
import { newWorkspaceOverlayHref } from '../new-workspace/new-workspace-overlay-route'
import { useMobileHomeData } from './use-mobile-home-data'
import { HOME_TABS, type HomeTabId } from './tabs/home-tabs'
import { MobileHomeAgentsTab } from './tabs/MobileHomeAgentsTab'
import { MobileHomeAutomationsTab } from './tabs/MobileHomeAutomationsTab'
import { MobileHomeFab } from './tabs/MobileHomeFab'
import { MobileHomeFeedTab } from './tabs/MobileHomeFeedTab'
@@ -51,7 +49,6 @@ export function MobileHomeScreen() {
const openMobileHostEdit = useOpenMobileHostEdit()
const openMobileTasks = useOpenMobileTasks()
const openMobileAutomations = useOpenMobileAutomations()
const openMobileSession = useOpenMobileSession()
const openMobileAccounts = useOpenMobileAccounts()
const disconnectHostClient = useDisconnectHostClient()
const forgetHostClient = useForgetHostClient()
@@ -63,6 +60,11 @@ export function MobileHomeScreen() {
const [visitedTabs, setVisitedTabs] = useState<ReadonlySet<HomeTabId>>(() => new Set(['feed']))
const [automationsHostId, setAutomationsHostId] = useState<string | null>(null)
const [tabBarHeight, setTabBarHeight] = useState(0)
const agentActions = useAgentListRowActions(
tabBarHeight,
data.sortedHosts,
data.applyAgentActivity
)
const selectTab = useCallback((next: HomeTabId) => {
setTab(next)
@@ -85,21 +87,7 @@ export function MobileHomeScreen() {
// Stable handlers keep the memoized Feed sections and desktop rows from redrawing on every Home update.
const { router, setHostCatalog } = data
const openWorktree = useCallback(
(row: HomeJumpBackInRow) => {
if (isResumeTargetConfirmedMissing(row, getProvenCachedWorktrees(row.hostId))) {
router.push(hostRouteWithNotice(row.hostId, 'worktree-missing'))
return
}
openMobileSession({
hostId: row.hostId,
worktreeId: row.worktree.worktreeId,
name: row.worktree.displayName || row.worktree.repo,
paneKey: row.worktree.paneKey
})
},
[router, openMobileSession]
)
const seeAllAgents = useCallback(() => selectTab('agents'), [selectTab])
const openHost = useCallback(
(host: HostCatalogEntry) => {
@@ -156,9 +144,6 @@ export function MobileHomeScreen() {
actionTarget != null && data.hostStates[actionTarget.id] === 'connected'
const paired = data.hostCatalogLoaded && data.hostCatalog.length > 0
const feedBadge = data.jumpBackInRows.filter(
(row) => !row.lastOpened && homeAgentNeedsYou(row.worktree.dotStatus)
).length
const automationsHostConnected =
automationsHostId != null && data.hostStates[automationsHostId] === 'connected'
const fab =
@@ -185,113 +170,124 @@ export function MobileHomeScreen() {
const contentBottom = spacing.xl + (fab ? FAB_CLEARANCE : 0)
return (
<SafeAreaView style={styles.container} edges={['top']}>
<View style={styles.fill}>
{HOME_TABS.map((id) =>
visitedTabs.has(id) ? (
<View key={id} style={id === tab ? styles.fill : styles.hidden}>
{id === 'feed' ? (
<MobileHomeFeedTab
data={data}
bottomInset={contentBottom}
onOpenWorktree={openWorktree}
onOpenHost={openHost}
onOpenHostActions={openHostActions}
onPairDesktop={pairDesktop}
onOpenTasks={openTasks}
/>
) : id === 'usage' ? (
<MobileHomeUsageTab
hosts={data.sortedHosts}
connectedHosts={data.connectedHosts}
hostStates={data.hostStates}
accountsByHost={data.accountsByHost}
stats={data.stats}
bottomInset={contentBottom}
onOpenAccounts={openMobileAccounts}
/>
) : id === 'automations' ? (
<MobileHomeAutomationsTab
hosts={data.sortedHosts}
connectedHosts={data.connectedHosts}
hostStates={data.hostStates}
bottomInset={contentBottom}
onOpenAutomations={(hostId) => openMobileAutomations(hostId)}
onHostChange={setAutomationsHostId}
/>
) : (
<MobileHomeSettingsTab bottomInset={contentBottom} />
)}
</View>
) : null
)}
</View>
<MobileHomeFab
visible={fab != null}
disabled={fab?.disabled ?? false}
accessibilityLabel={fab?.label ?? ''}
disabledHint={fab?.hint}
bottom={tabBarHeight + spacing.lg}
onPress={() => fab?.onPress()}
/>
<View onLayout={(event) => setTabBarHeight(event.nativeEvent.layout.height)}>
<MobileHomeTabBar
tabs={HOME_TABS}
active={tab}
bottomInset={insets.bottom}
feedBadge={feedBadge}
onSelect={selectTab}
// Agent rows swipe; no gesture root sits above Home.
<GestureHandlerRootView style={styles.fill}>
<SafeAreaView style={styles.container} edges={['top']}>
<View style={styles.fill}>
{HOME_TABS.map((id) =>
visitedTabs.has(id) ? (
<View key={id} style={id === tab ? styles.fill : styles.hidden}>
{id === 'feed' ? (
<MobileHomeFeedTab
data={data}
bottomInset={contentBottom}
agentHandlers={agentActions.handlers}
onSeeAllAgents={seeAllAgents}
onOpenHost={openHost}
onOpenHostActions={openHostActions}
onPairDesktop={pairDesktop}
onOpenTasks={openTasks}
/>
) : id === 'agents' ? (
<MobileHomeAgentsTab
data={data}
bottomInset={contentBottom}
handlers={agentActions.handlers}
/>
) : id === 'usage' ? (
<MobileHomeUsageTab
hosts={data.sortedHosts}
connectedHosts={data.connectedHosts}
hostStates={data.hostStates}
accountsByHost={data.accountsByHost}
stats={data.stats}
bottomInset={contentBottom}
onOpenAccounts={openMobileAccounts}
/>
) : id === 'automations' ? (
<MobileHomeAutomationsTab
hosts={data.sortedHosts}
connectedHosts={data.connectedHosts}
hostStates={data.hostStates}
bottomInset={contentBottom}
onOpenAutomations={(hostId) => openMobileAutomations(hostId)}
onHostChange={setAutomationsHostId}
/>
) : (
<MobileHomeSettingsTab bottomInset={contentBottom} />
)}
</View>
) : null
)}
</View>
<MobileHomeFab
visible={fab != null}
disabled={fab?.disabled ?? false}
accessibilityLabel={fab?.label ?? ''}
disabledHint={fab?.hint}
bottom={tabBarHeight + spacing.lg}
onPress={() => fab?.onPress()}
/>
</View>
<ActionSheetModal
visible={actionTarget != null}
title={actionTarget?.name}
message={
actionTarget
? [
actionTargetConnected && actionTargetPath
? mobileConnectionPathLabel(actionTargetPath)
: null,
hostEndpointLabel(actionTarget.endpoint)
]
.filter(Boolean)
.join(' · ')
: undefined
}
actions={getHostListActionSheetActions({
host: actionTarget,
state: actionTarget
? resolveHomeHostConnectionState(
actionTarget.id,
data.hostStates[actionTarget.id],
data.autoConnectHostIds
)
: 'disconnected',
hasEverConnected: actionTarget
? (data.hostLastConnected[actionTarget.id] ?? null) != null
: false,
onDismiss: () => setActionTarget(null),
onReconnect: (hostId) => void forceReconnectHost?.(hostId),
onDisconnect: disconnectHostClient,
onDiagnostics: (hostId) =>
data.router.push({ pathname: '/connection-log', params: { hostId } }),
onEdit: openMobileHostEdit,
onRemove: (host) => setConfirmRemove(host)
})}
onClose={() => setActionTarget(null)}
/>
<ConfirmModal
visible={confirmRemove != null}
title={t('home.screen.removeHostTitle', 'Remove Host')}
message={t('home.screen.removeHostMessage', 'Remove "{{name}}"? You can re-pair later.', {
name: confirmRemove?.name
})}
confirmLabel={t('common.remove', 'Remove')}
destructive
onConfirm={() => void handleRemove()}
onCancel={() => setConfirmRemove(null)}
/>
</SafeAreaView>
<View onLayout={(event) => setTabBarHeight(event.nativeEvent.layout.height)}>
<MobileHomeTabBar
tabs={HOME_TABS}
active={tab}
bottomInset={insets.bottom}
agentsBadge={data.agentsNeedingYou.length}
onSelect={selectTab}
/>
</View>
{agentActions.sheet}
<ActionSheetModal
visible={actionTarget != null}
title={actionTarget?.name}
message={
actionTarget
? [
actionTargetConnected && actionTargetPath
? mobileConnectionPathLabel(actionTargetPath)
: null,
hostEndpointLabel(actionTarget.endpoint)
]
.filter(Boolean)
.join(' · ')
: undefined
}
actions={getHostListActionSheetActions({
host: actionTarget,
state: actionTarget
? resolveHomeHostConnectionState(
actionTarget.id,
data.hostStates[actionTarget.id],
data.autoConnectHostIds
)
: 'disconnected',
hasEverConnected: actionTarget
? (data.hostLastConnected[actionTarget.id] ?? null) != null
: false,
onDismiss: () => setActionTarget(null),
onReconnect: (hostId) => void forceReconnectHost?.(hostId),
onDisconnect: disconnectHostClient,
onDiagnostics: (hostId) =>
data.router.push({ pathname: '/connection-log', params: { hostId } }),
onEdit: openMobileHostEdit,
onRemove: (host) => setConfirmRemove(host)
})}
onClose={() => setActionTarget(null)}
/>
<ConfirmModal
visible={confirmRemove != null}
title={t('home.screen.removeHostTitle', 'Remove Host')}
message={t('home.screen.removeHostMessage', 'Remove "{{name}}"? You can re-pair later.', {
name: confirmRemove?.name
})}
confirmLabel={t('common.remove', 'Remove')}
destructive
onConfirm={() => void handleRemove()}
onCancel={() => setConfirmRemove(null)}
/>
</SafeAreaView>
</GestureHandlerRootView>
)
}
+36 -4
View File
@@ -1,16 +1,48 @@
import { Text, View } from 'react-native'
import type { LucideIcon } from 'lucide-react-native'
import { Pressable, Text, View } from 'react-native'
import { colors } from '../theme/mobile-theme'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import { homeListStyles as styles } from './home-list-styles'
const ASIDE_HIT_SLOP = { top: 10, bottom: 10, left: 12, right: 12 } as const
/** A Home section's title, with an optional muted note on the right; the first section sits closer to the bar. */
export function MobileHomeSectionHeading(props: { title: string; first: boolean; aside?: string }) {
export function MobileHomeSectionHeading(props: {
title: string
first: boolean
/** Shown muted after the title. */
count?: number
aside?: string
asideIcon?: LucideIcon
/** Turns the aside into a link. */
onAsidePress?: () => void
}) {
useMobileColorScheme()
const AsideIcon = props.asideIcon
return (
<View style={[styles.sectionHeadingRow, props.first && styles.firstSectionHeading]}>
<Text style={styles.sectionHeading} accessibilityRole="header">
<Text style={styles.sectionHeading} accessibilityRole="header" numberOfLines={1}>
{props.title}
{props.count !== undefined ? (
<Text style={styles.sectionCount}>{` ${props.count}`}</Text>
) : null}
</Text>
{props.aside ? <Text style={styles.sectionAside}>{props.aside}</Text> : null}
{props.aside && props.onAsidePress ? (
<Pressable accessibilityRole="link" hitSlop={ASIDE_HIT_SLOP} onPress={props.onAsidePress}>
{({ pressed }) => (
<Text style={[styles.sectionAside, styles.sectionLink, pressed && styles.linkPressed]}>
{props.aside}
</Text>
)}
</Pressable>
) : props.aside ? (
<View style={styles.sectionAsideRow}>
{AsideIcon ? <AsideIcon size={13} color={colors.textMuted} /> : null}
<Text style={styles.sectionAside} numberOfLines={1}>
{props.aside}
</Text>
</View>
) : null}
</View>
)
}
+8 -2
View File
@@ -5,6 +5,8 @@ import { themedStyleSheet } from '../theme/themed-styles'
// Text starts after the status column, so separators inset to it.
const STATUS_COLUMN_WIDTH = 24
const ROW_LEADING_PADDING = spacing.lg
/** Where a row's text starts: separators and nested rows line up with it. */
export const HOME_ROW_TEXT_INSET = ROW_LEADING_PADDING + STATUS_COLUMN_WIDTH
const TILE_SIZE = 30
const TILE_GAP = 11
const TILE_DOT_SIZE = 10
@@ -21,8 +23,12 @@ export const homeListStyles = themedStyleSheet(() => ({
marginTop: 20,
marginBottom: 7
},
sectionHeading: { fontSize: 15, fontWeight: '600', color: colors.textPrimary },
sectionHeading: { flexShrink: 1, fontSize: 15, fontWeight: '600', color: colors.textPrimary },
sectionCount: { fontWeight: '500', color: colors.textMuted, fontVariant: ['tabular-nums'] },
sectionAside: { fontSize: 14, color: colors.textMuted, fontVariant: ['tabular-nums'] },
sectionAsideRow: { flexShrink: 1, flexDirection: 'row', alignItems: 'center', gap: 6 },
sectionLink: { color: colors.accentBlue, fontWeight: '500' },
linkPressed: { opacity: 0.5 },
firstSectionHeading: { marginTop: spacing.xs },
// Matches a heading's top gap for a group that has none.
headinglessGroup: { marginTop: 20 },
@@ -33,7 +39,7 @@ export const homeListStyles = themedStyleSheet(() => ({
separator: {
height: StyleSheet.hairlineWidth,
backgroundColor: colors.borderSubtle,
marginLeft: ROW_LEADING_PADDING + STATUS_COLUMN_WIDTH
marginLeft: HOME_ROW_TEXT_INSET
},
fullSeparator: { marginLeft: ROW_LEADING_PADDING },
tileSeparator: { marginLeft: ROW_LEADING_PADDING + TILE_SIZE + TILE_GAP },
@@ -0,0 +1,107 @@
import { Monitor, WifiOff } from 'lucide-react-native'
import { useState } from 'react'
import type { AgentListHostSummary } from '../../agents/agent-list-rows'
import { PickerModal, type PickerOption } from '../../components/PickerModal'
import { hostPickerOptions } from '../../components/use-connected-host-picker'
import type { Translate } from '../../i18n/mobile-i18n'
import { useMobileTranslation } from '../../i18n/use-mobile-translation'
import { colors } from '../../theme/mobile-theme'
import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme'
import type { HostProfile } from '../../transport/hosts/host-profile'
import { useHostDisplay } from '../../transport/hosts/use-host-display'
import { MobileHomePill } from './MobileHomeHostPill'
const ALL_DESKTOPS = '__all__'
/** The Agents tab's desktop filter: "All desktops" or one, each with its agent counts. */
export function AgentsDesktopFilter(props: {
hosts: readonly HostProfile[]
selected: string | null
summaries: readonly AgentListHostSummary[]
onSelect: (hostId: string | null) => void
}) {
const t = useMobileTranslation()
const [open, setOpen] = useState(false)
return (
<>
<DesktopPill hosts={props.hosts} selected={props.selected} onOpen={() => setOpen(true)} />
<PickerModal
visible={open}
title={t('agents.desktops.pickerTitle', 'Show agents on')}
options={desktopFilterOptions(props.hosts, props.summaries, t)}
selected={props.selected ?? ALL_DESKTOPS}
onSelect={(value) => props.onSelect(value === ALL_DESKTOPS ? null : value)}
onClose={() => setOpen(false)}
/>
</>
)
}
function desktopFilterOptions(
hosts: readonly HostProfile[],
summaries: readonly AgentListHostSummary[],
t: Translate
): PickerOption[] {
const agentCount = (count: number) =>
count === 1
? t('agents.desktops.agents_one', '{{count}} agent', { count })
: t('agents.desktops.agents_other', '{{count}} agents', { count })
const total = summaries.reduce((sum, summary) => sum + summary.agents, 0)
const icon = (offline: boolean) => () =>
offline ? (
<WifiOff size={17} color={colors.textMuted} />
) : (
<Monitor size={17} color={colors.textPrimary} />
)
return [
{
value: ALL_DESKTOPS,
label: t('agents.desktops.all', 'All desktops'),
subtitle: agentCount(total),
renderIcon: icon(false)
},
...hostPickerOptions([...hosts]).map((option) => {
const summary = summaries.find((entry) => entry.hostId === option.value)
const needsYou = summary?.needsYou ?? 0
return {
value: option.value,
label: option.label,
subtitle: summary?.offline
? t('agents.desktops.offline', 'Offline')
: [
agentCount(summary?.agents ?? 0),
needsYou > 0
? needsYou === 1
? t('agents.desktops.needsYou_one', '{{count}} needs you', { count: needsYou })
: t('agents.desktops.needsYou_other', '{{count}} need you', { count: needsYou })
: null
]
.filter(Boolean)
.join(' · '),
renderIcon: icon(summary?.offline ?? false)
}
})
]
}
function DesktopPill(props: {
hosts: readonly HostProfile[]
selected: string | null
onOpen: () => void
}) {
const t = useMobileTranslation()
useMobileColorScheme()
const selected = props.hosts.find((host) => host.id === props.selected) ?? null
const title = useHostDisplay(selected).title
const label = selected ? title : t('agents.desktops.all', 'All desktops')
return (
<MobileHomePill
label={label}
leading={<Monitor size={14} color={colors.textPrimary} />}
accessibilityLabel={t('home.tabs.chooseDesktop', '{{desktop}}, choose another desktop', {
desktop: label
})}
onPress={props.onOpen}
/>
)
}
@@ -0,0 +1,375 @@
import {
Bot,
CheckCheck,
ChevronRight,
Search,
SlidersHorizontal,
Trash2,
WifiOff
} from 'lucide-react-native'
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { ActivityIndicator, ScrollView, Text, View } from 'react-native'
import {
AGENT_LIST_GROUP_BY_CHOICES,
agentListRowsIn,
buildAgentList,
DEFAULT_AGENT_LIST_VIEW,
type AgentListGroupBy,
type AgentListSection
} from '../../agents/agent-list-model'
import { summarizeAgentListHosts } from '../../agents/agent-list-rows'
import { loadAgentListView, saveAgentListView } from '../../agents/agent-list-preferences'
import { MobileAgentListRows, type AgentListRowHandlers } from '../../agents/MobileAgentListRows'
import type { ActionSheetAction } from '../../components/ActionSheetModal'
import { MobileSearchField } from '../../components/MobileSearchField'
import { PullDownMenu } from '../../components/nav-bar/PullDownMenu'
import { useMobileTranslation } from '../../i18n/use-mobile-translation'
import { useResponsiveLayout } from '../../layout/responsive-layout'
import { useSerializedStoredState } from '../../storage/use-serialized-stored-state'
import { colors, spacing } from '../../theme/mobile-theme'
import { themedStyleSheet } from '../../theme/themed-styles'
import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme'
import type { HostProfile } from '../../transport/hosts/host-profile'
import { useHostDisplay } from '../../transport/hosts/use-host-display'
import { formatTimeAgo } from '../../worktree/agent-row-display'
import { homeListStyles } from '../home-list-styles'
import { MobileHomeSectionHeading } from '../MobileHomeSectionHeading'
import type { MobileHomeData } from '../use-mobile-home-data'
import { AgentsDesktopFilter } from './MobileHomeAgentsDesktopFilter'
import { MobileHomeTabHeader, MobileHomeTabHeaderButton } from './MobileHomeTabHeader'
/** Every agent on every paired desktop, grouped the way the user picked. */
export function MobileHomeAgentsTab(props: {
data: MobileHomeData
bottomInset: number
handlers: AgentListRowHandlers
}) {
const t = useMobileTranslation()
useMobileColorScheme()
const { isWideLayout, contentMaxWidth } = useResponsiveLayout()
const { data } = props
const hosts = data.sortedHosts
const stored = useSerializedStoredState(
DEFAULT_AGENT_LIST_VIEW,
loadAgentListView,
saveAgentListView
)
const { refresh } = stored
useEffect(() => refresh(), [refresh])
const view = stored.value
const [searchOpen, setSearchOpen] = useState(false)
const [query, setQuery] = useState('')
const [pickedHost, setPickedHost] = useState<string | null>(null)
const [menu, setMenu] = useState<'closed' | 'options' | 'group-by'>('closed')
const optionsRef = useRef<View>(null)
// An unpaired desktop's filter falls back to every desktop.
const hostFilter = hosts.some((host) => host.id === pickedHost) ? pickedHost : null
const { now } = data.agentList
const list = useMemo(
() => buildAgentList(data.agentList, { view, hostFilter, query }),
[data.agentList, view, hostFilter, query]
)
const nameDesktops = hosts.length > 1 && hostFilter === null
const listed = useMemo(() => agentListRowsIn(list.sections), [list.sections])
const unreadRows = listed.filter((row) => row.unread === true)
const clearableRows = listed.filter((row) => row.clearable)
const clearFinished = () => props.handlers.onClear(clearableRows)
// The Done heading's Clear acts on Done alone; a failed agent under Needs you stays.
const clearSection = (section: AgentListSection) => {
const rows = agentListRowsIn([section]).filter((row) => row.clearable)
return rows.length > 0 ? () => props.handlers.onClear(rows) : undefined
}
const hostSummaries = useMemo(() => summarizeAgentListHosts(data.agentList), [data.agentList])
const setView = (next: typeof view) => {
stored.setValue(next)
stored.persist(next)
}
const groupByLabels: Record<AgentListGroupBy, string> = {
status: t('agents.groupBy.status', 'Status'),
workspace: t('agents.groupBy.workspace', 'Workspace'),
project: t('agents.groupBy.project', 'Project'),
agent: t('agents.groupBy.agent', 'Agent'),
desktop: t('agents.groupBy.desktop', 'Desktop')
}
const menuGroups: ActionSheetAction[][] =
menu === 'group-by'
? [
AGENT_LIST_GROUP_BY_CHOICES.map((groupBy) => ({
id: groupBy,
label: groupByLabels[groupBy],
checked: view.groupBy === groupBy,
onPress: () => setView({ ...view, groupBy })
}))
]
: [
[
{
id: 'group-by',
label: t('agents.options.groupBy', 'Group by'),
skipAutoClose: true,
renderIcon: () => (
<View style={styles.menuValue}>
<Text style={styles.menuValueText}>{groupByLabels[view.groupBy]}</Text>
<ChevronRight size={16} color={colors.textMuted} />
</View>
),
onPress: () => setMenu('group-by')
},
{
id: 'unread-only',
label: t('agents.options.unreadOnly', 'Unread only'),
checked: view.unreadOnly,
onPress: () => setView({ ...view, unreadOnly: !view.unreadOnly })
},
{
id: 'show-workers',
label: t('agents.options.showWorkers', 'Show worker agents'),
checked: view.showWorkers,
onPress: () => setView({ ...view, showWorkers: !view.showWorkers })
}
],
[
{
id: 'mark-all-read',
label: t('agents.options.markAllRead', 'Mark all read'),
icon: CheckCheck,
disabled: unreadRows.length === 0,
onPress: () => props.handlers.onSetRead(unreadRows, true)
},
{
id: 'clear-finished',
label: t('agents.options.clearFinished', 'Clear finished'),
icon: Trash2,
disabled: clearableRows.length === 0,
onPress: clearFinished
}
]
]
const filteredHosts = hosts.filter((host) => hostFilter === null || host.id === hostFilter)
// A desktop still connecting, or connected with its first list read pending, may yet have agents.
const awaitingDesktop = filteredHosts.some((host) => {
const state = data.hostStates[host.id]
return state === 'connected'
? !data.worktreeInfo[host.id]?.catalogUnavailable
: state === undefined || state === 'connecting' || state === 'handshaking'
})
const emptyState = (): ReactNode => {
const trimmed = query.trim()
if (trimmed) {
return (
<AgentsEmpty
title={t('agents.list.noMatches', 'No agents match “{{query}}”', { query: trimmed })}
/>
)
}
if (hosts.length === 0) {
return (
<AgentsEmpty
title={t('agents.list.emptyTitle', 'No agents running')}
message={t('agents.list.pairDesktop', 'Pair a desktop to see its agents here.')}
/>
)
}
// "No agents running" is only true of a desktop that answered.
if (!list.anyLive) {
return awaitingDesktop ? (
<View style={styles.connecting}>
<ActivityIndicator size="small" color={colors.textSecondary} />
</View>
) : (
<AgentsEmpty
title={t('agents.list.noDesktopTitle', 'No desktop connected')}
message={t('agents.list.noDesktopBody', 'Agents show up here once a desktop connects.')}
/>
)
}
return (
<AgentsEmpty
title={t('agents.list.emptyTitle', 'No agents running')}
message={t(
'agents.list.emptyBody',
'Start an agent in any workspace and it shows up here.'
)}
/>
)
}
const body = !data.hostCatalogLoaded
? null
: list.sections.length === 0
? emptyState()
: list.sections.map((section, index) => (
<View key={section.key}>
<AgentListSectionHeading
section={section}
host={hosts.find((host) => host.id === section.hostId) ?? null}
nameDesktop={nameDesktops}
first={index === 0}
now={now}
onClear={section.kind === 'done' ? clearSection(section) : undefined}
/>
<MobileAgentListRows
rows={section.rows}
idleRows={section.idleRows}
idleKey={view.groupBy}
footer={section.footer}
nameDesktop={section.nameDesktop}
hosts={hosts}
now={now}
handlers={props.handlers}
/>
</View>
))
return (
<>
<MobileHomeTabHeader
title={t('home.tabs.agents', 'Agents')}
trailing={
<>
<MobileHomeTabHeaderButton
icon={Search}
accessibilityLabel={t('agents.search.toggle', 'Search agents')}
active={searchOpen}
onPress={() => {
setSearchOpen((open) => !open)
setQuery('')
}}
/>
<MobileHomeTabHeaderButton
ref={optionsRef}
icon={SlidersHorizontal}
accessibilityLabel={t('agents.options.open', 'Agent list options')}
active={menu !== 'closed'}
onPress={() => setMenu('options')}
/>
</>
}
/>
{searchOpen ? (
<MobileSearchField
value={query}
onChangeText={setQuery}
placeholder={t('agents.search.placeholder', 'Search agents')}
onClear={() => setQuery('')}
autoFocus
style={styles.search}
/>
) : null}
{hosts.length > 1 ? (
<View style={styles.filters}>
<AgentsDesktopFilter
hosts={hosts}
selected={hostFilter}
summaries={hostSummaries}
onSelect={setPickedHost}
/>
</View>
) : null}
<ScrollView
contentContainerStyle={[
styles.content,
{ paddingBottom: props.bottomInset },
isWideLayout && { maxWidth: contentMaxWidth, width: '100%', alignSelf: 'center' }
]}
keyboardShouldPersistTaps="handled"
keyboardDismissMode="on-drag"
>
{body}
</ScrollView>
<PullDownMenu
visible={menu !== 'closed'}
anchorRef={optionsRef}
groups={menuGroups}
onClose={() => setMenu('closed')}
/>
</>
)
}
function AgentListSectionHeading(props: {
section: AgentListSection
host: HostProfile | null
nameDesktop: boolean
first: boolean
now: number
/** The Done heading's "Clear": the same as Clear finished. */
onClear?: () => void
}) {
const t = useMobileTranslation()
const { section } = props
const desktop = useHostDisplay(props.host).title
if (section.kind === 'idle') {
return <View style={homeListStyles.headinglessGroup} />
}
const titles: Partial<Record<AgentListSection['kind'], string>> = {
'needs-you': t('agents.sections.needsYou', 'Needs you'),
working: t('agents.sections.working', 'Working'),
done: t('agents.sections.done', 'Done'),
desktop
}
const counted = section.kind !== 'workspace' && section.kind !== 'project'
const seen = section.lastSeen
const seenAgo =
seen?.at === undefined
? null
: props.now - seen.at < 60_000
? null
: formatTimeAgo(seen.at, props.now)
const aside = seen
? seen.offline
? seen.at === undefined
? t('agents.sections.offline', 'Offline')
: seenAgo
? t('agents.sections.offlineSeenAgo', 'Offline · seen {{ago}} ago', { ago: seenAgo })
: t('agents.sections.offlineSeenJustNow', 'Offline · seen just now')
: seenAgo
? t('agents.sections.seenAgo', 'Seen {{ago}} ago', { ago: seenAgo })
: t('agents.sections.seenJustNow', 'Seen just now')
: props.nameDesktop && (section.kind === 'workspace' || section.kind === 'project')
? desktop
: undefined
return (
<MobileHomeSectionHeading
title={titles[section.kind] ?? section.title ?? ''}
count={counted ? section.rows.length : undefined}
aside={props.onClear ? t('agents.sections.clear', 'Clear') : aside}
asideIcon={seen?.offline ? WifiOff : undefined}
onAsidePress={props.onClear}
first={props.first}
/>
)
}
function AgentsEmpty(props: { title: string; message?: string }) {
useMobileColorScheme()
return (
<View style={styles.empty}>
<Bot size={30} strokeWidth={1.6} color={colors.textMuted} />
<Text style={styles.emptyTitle} accessibilityRole="header">
{props.title}
</Text>
{props.message ? <Text style={styles.emptyBody}>{props.message}</Text> : null}
</View>
)
}
const styles = themedStyleSheet(() => ({
content: { paddingHorizontal: spacing.lg },
search: { marginHorizontal: spacing.lg, marginBottom: spacing.sm },
filters: { paddingHorizontal: spacing.lg },
menuValue: { flexDirection: 'row', alignItems: 'center', gap: 2 },
connecting: { alignItems: 'center', paddingVertical: spacing.xl, marginTop: 32 },
menuValueText: { fontSize: 15, color: colors.textMuted },
empty: {
alignItems: 'center',
paddingHorizontal: spacing.xl,
paddingVertical: 28,
marginTop: 32,
gap: spacing.sm
},
emptyTitle: { fontSize: 16, fontWeight: '600', color: colors.textPrimary },
emptyBody: { fontSize: 14, lineHeight: 20, color: colors.textSecondary, textAlign: 'center' }
}))
+14 -11
View File
@@ -3,21 +3,22 @@ import { useMobileTranslation } from '../../i18n/use-mobile-translation'
import { useResponsiveLayout } from '../../layout/responsive-layout'
import { spacing } from '../../theme/mobile-theme'
import { themedStyleSheet } from '../../theme/themed-styles'
import type { AgentListRowHandlers } from '../../agents/MobileAgentListRows'
import type { HostCatalogEntry } from '../../transport/hosts/host-profile'
import type { HomeJumpBackInRow } from '../../worktree/home-jump-back-in'
import { MobileHomeAppUpdateCard } from '../MobileHomeAppUpdateCard'
import { MobileHomeEmptyState } from '../MobileHomeEmptyState'
import { MobileHomeHostList } from '../MobileHomeHostList'
import { MobileHomeJumpBackIn } from '../MobileHomeJumpBackIn'
import { MobileHomeNeedsYou } from '../MobileHomeNeedsYou'
import { MobileHomeTasksSection } from '../MobileHomeTasksSection'
import type { MobileHomeData } from '../use-mobile-home-data'
import { MobileHomeTabHeader } from './MobileHomeTabHeader'
/** Home's first tab: agents to get back to, the desktops, and Tasks. */
/** Home's first tab: agents that need you, the desktops, and Tasks. */
export function MobileHomeFeedTab(props: {
data: MobileHomeData
bottomInset: number
onOpenWorktree: (row: HomeJumpBackInRow) => void
agentHandlers: AgentListRowHandlers
onSeeAllAgents: () => void
onOpenHost: (host: HostCatalogEntry) => void
onOpenHostActions: (host: HostCatalogEntry) => void
onPairDesktop: () => void
@@ -41,7 +42,7 @@ export function MobileHomeFeedTab(props: {
/>
)
}
const hasAgents = data.jumpBackInRows.length > 0
const needsYou = data.agentsNeedingYou.length > 0
return (
<>
{title}
@@ -52,20 +53,22 @@ export function MobileHomeFeedTab(props: {
isWideLayout && { maxWidth: contentMaxWidth, width: '100%', alignSelf: 'center' }
]}
>
<MobileHomeJumpBackIn
rows={data.jumpBackInRows}
hosts={data.sortedHostCatalog}
first
onOpen={props.onOpenWorktree}
<MobileHomeNeedsYou
rows={data.agentsNeedingYou}
hosts={data.sortedHosts}
now={data.agentList.now}
handlers={props.agentHandlers}
onSeeAll={props.onSeeAllAgents}
/>
<MobileHomeHostList
autoConnectHostIds={data.autoConnectHostIds}
first={!hasAgents}
first={!needsYou}
hostAttempts={data.hostAttempts}
hostLastConnected={data.hostLastConnected}
hostConnections={data.hostConnections}
hosts={data.sortedHostCatalog}
hostStates={data.hostStates}
needsYouByHost={data.needsYouByHost}
worktreeInfo={data.worktreeInfo}
onOpen={props.onOpenHost}
onOpenActions={props.onOpenHostActions}
+47 -28
View File
@@ -1,5 +1,5 @@
import { ChevronDown } from 'lucide-react-native'
import { useState } from 'react'
import { useState, type ReactNode } from 'react'
import { Pressable, Text, View } from 'react-native'
import Animated from 'react-native-reanimated'
import { PickerModal } from '../../components/PickerModal'
@@ -35,14 +35,14 @@ export function MobileHomeHostPill(props: {
const t = useMobileTranslation()
useMobileColorScheme()
const [open, setOpen] = useState(false)
const [pressed, setPressed] = useState(false)
const title = useHostDisplay(props.host).title
const choosable = props.hosts.length > 1
const dot = statusDotColor(props.state ?? 'disconnected')
return (
<>
<Pressable
accessibilityRole={choosable ? 'button' : 'text'}
<MobileHomePill
label={title}
leading={<View style={[styles.dot, { backgroundColor: dot }]} />}
accessibilityLabel={
choosable
? t('home.tabs.chooseDesktop', '{{desktop}}, choose another desktop', {
@@ -50,30 +50,8 @@ export function MobileHomeHostPill(props: {
})
: title
}
disabled={!choosable}
onPressIn={() => setPressed(true)}
onPressOut={() => setPressed(false)}
onPress={() => setOpen(true)}
style={styles.pillHit}
>
<Animated.View
style={[
styles.pill,
pressed && styles.pillPressed,
{
transform: [{ scale: pressed ? 0.97 : 1 }],
transitionProperty: ['transform', 'backgroundColor'],
transitionDuration: 120
}
]}
>
<View style={[styles.dot, { backgroundColor: dot }]} />
<Text style={styles.label} numberOfLines={1}>
{title}
</Text>
{choosable ? <ChevronDown size={14} color={colors.textSecondary} /> : null}
</Animated.View>
</Pressable>
onPress={choosable ? () => setOpen(true) : undefined}
/>
{choosable ? (
<PickerModal
visible={open}
@@ -88,6 +66,47 @@ export function MobileHomeHostPill(props: {
)
}
/** A Home tab's filter pill; without `onPress` it is a plain label. */
export function MobileHomePill(props: {
label: string
leading: ReactNode
accessibilityLabel: string
onPress?: () => void
}) {
useMobileColorScheme()
const [pressed, setPressed] = useState(false)
const choosable = props.onPress !== undefined
return (
<Pressable
accessibilityRole={choosable ? 'button' : 'text'}
accessibilityLabel={props.accessibilityLabel}
disabled={!choosable}
onPressIn={() => setPressed(true)}
onPressOut={() => setPressed(false)}
onPress={props.onPress}
style={styles.pillHit}
>
<Animated.View
style={[
styles.pill,
pressed && styles.pillPressed,
{
transform: [{ scale: pressed ? 0.97 : 1 }],
transitionProperty: ['transform', 'backgroundColor'],
transitionDuration: 120
}
]}
>
{props.leading}
<Text style={styles.label} numberOfLines={1}>
{props.label}
</Text>
{choosable ? <ChevronDown size={14} color={colors.textSecondary} /> : null}
</Animated.View>
</Pressable>
)
}
const styles = themedStyleSheet(() => ({
pillHit: { alignSelf: 'flex-start', maxWidth: '100%' },
pill: {
+13 -4
View File
@@ -1,4 +1,11 @@
import { CalendarClock, Gauge, LayoutList, Settings, type LucideIcon } from 'lucide-react-native'
import {
Bot,
CalendarClock,
Gauge,
LayoutList,
Settings,
type LucideIcon
} from 'lucide-react-native'
import { useEffect, useState } from 'react'
import { Platform, Pressable, StyleSheet, Text, View } from 'react-native'
import Animated, {
@@ -16,6 +23,7 @@ import { HOME_EASE_OUT, type HomeTabId } from './home-tabs'
const TAB_ICONS: Record<HomeTabId, LucideIcon> = {
feed: LayoutList,
agents: Bot,
usage: Gauge,
automations: CalendarClock,
settings: Settings
@@ -27,14 +35,15 @@ export function MobileHomeTabBar(props: {
tabs: readonly HomeTabId[]
active: HomeTabId
bottomInset: number
/** Agents that need you; shown on Feed. */
feedBadge: number
/** Agents that need you; shown on Agents. */
agentsBadge: number
onSelect: (tab: HomeTabId) => void
}) {
const t = useMobileTranslation()
useMobileColorScheme()
const labels: Record<HomeTabId, string> = {
feed: t('home.tabs.feed', 'Feed'),
agents: t('home.tabs.agents', 'Agents'),
usage: t('home.tabs.usage', 'Usage'),
automations: t('home.tabs.automations', 'Automations'),
settings: t('common.settings', 'Settings')
@@ -51,7 +60,7 @@ export function MobileHomeTabBar(props: {
icon={TAB_ICONS[tab]}
label={labels[tab]}
selected={tab === props.active}
badge={tab === 'feed' ? props.feedBadge : 0}
badge={tab === 'agents' ? props.agentsBadge : 0}
onPress={() => props.onSelect(tab)}
/>
))}
+16 -3
View File
@@ -1,5 +1,5 @@
import type { LucideIcon } from 'lucide-react-native'
import { useState, type ReactNode } from 'react'
import { useState, type ReactNode, type Ref } from 'react'
import { Pressable, Text, View } from 'react-native'
import Animated from 'react-native-reanimated'
import { colors, radii, spacing } from '../../theme/mobile-theme'
@@ -20,11 +20,15 @@ export function MobileHomeTabHeader(props: { title: string; trailing?: ReactNode
}
export function MobileHomeTabHeaderButton(props: {
/** The anchor a pull-down menu drops from. */
ref?: Ref<View>
icon: LucideIcon
accessibilityLabel: string
disabled?: boolean
/** Spins the glyph while a refresh it started is in flight. */
spinning?: boolean
/** What the button opens is showing. */
active?: boolean
onPress: () => void
}) {
useMobileColorScheme()
@@ -32,14 +36,23 @@ export function MobileHomeTabHeaderButton(props: {
const Icon = props.icon
return (
<Pressable
ref={props.ref}
accessibilityRole="button"
accessibilityLabel={props.accessibilityLabel}
accessibilityState={{ disabled: Boolean(props.disabled), busy: Boolean(props.spinning) }}
accessibilityState={{
disabled: Boolean(props.disabled),
busy: Boolean(props.spinning),
expanded: props.active
}}
disabled={props.disabled}
onPressIn={() => setPressed(true)}
onPressOut={() => setPressed(false)}
onPress={props.onPress}
style={[styles.button, pressed && styles.buttonPressed, props.disabled && styles.disabled]}
style={[
styles.button,
(pressed || props.active) && styles.buttonPressed,
props.disabled && styles.disabled
]}
>
<Animated.View
style={
+8 -2
View File
@@ -1,8 +1,14 @@
import { Easing } from 'react-native-reanimated'
export type HomeTabId = 'feed' | 'usage' | 'automations' | 'settings'
export type HomeTabId = 'feed' | 'agents' | 'usage' | 'automations' | 'settings'
export const HOME_TABS: readonly HomeTabId[] = ['feed', 'usage', 'automations', 'settings']
export const HOME_TABS: readonly HomeTabId[] = [
'feed',
'agents',
'usage',
'automations',
'settings'
]
/** Strong ease-out for things entering or reacting to a touch. */
export const HOME_EASE_OUT = Easing.bezier(0.23, 1, 0.32, 1)
+44 -42
View File
@@ -1,10 +1,16 @@
import AsyncStorage from '@react-native-async-storage/async-storage'
import { useRouter, useFocusEffect } from 'expo-router'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { warmUpWebShell } from '../../modules/orca-mobile-web-shell/src'
import {
countAgentsNeedingYouByHost,
selectAgentsNeedingYou,
type AgentListInput
} from '../agents/agent-list-rows'
import { useAgentActivityWrites } from '../agents/use-agent-activity-writes'
import { loadHomeSnapshot, saveHomeSnapshot } from '../cache/home-snapshot-cache'
import type { AccountsSnapshot } from '../components/AccountUsage'
import { getCachedWorktrees, setCachedWorktrees } from '../cache/worktree-cache'
import { setCachedWorktrees } from '../cache/worktree-cache'
import { useNow } from '../hooks/use-now'
import {
loadMobileOnboardingSteps,
mobileOnboardingDestination
@@ -16,17 +22,7 @@ import {
import { loadHostCatalog } from '../transport/hosts/host-store'
import type { HostCatalogEntry } from '../transport/hosts/host-profile'
import { fetchHomeHostWorktreeInfo } from '../worktree/home-host-worktree-fetch'
import {
withoutHomeAgentStates,
type HomeWorktreeSummary,
type HostWorktreeInfo
} from '../worktree/home-worktree-info'
import {
LAST_VISITED_WORKTREE_STORAGE_KEY,
readLastVisitedWorktreeRecord
} from '../worktree/last-visited-worktree-repo'
import { selectHomeJumpBackInRows } from '../worktree/home-jump-back-in'
import { selectHomeResumeCard } from '../worktree/home-resume-card'
import { withoutHomeAgentStates, type HostWorktreeInfo } from '../worktree/home-worktree-info'
import { fetchHomeHostStats } from '../stats/home-stats-summary-read'
import { totalHomeStats, type HomeStatsRow } from '../stats/home-stats-total'
import { projectHomeHostConnections } from './home-host-connection-projection'
@@ -46,13 +42,12 @@ export function useMobileHomeData() {
() => ({ setWorktreeInfo, setStats: setStatsByHost, setAccounts: setAccountsByHost }),
[]
)
const [lastVisited, setLastVisited] = useState<{ hostId: string; worktreeId: string } | null>(
null
)
const onboardingCheckedRef = useRef(false)
const hydratedRef = useRef(false)
const focusedRef = useRef(false)
const isHomeFocused = useCallback(() => focusedRef.current, [])
// Drives the agent clock; Home stays mounted under other screens.
const [homeFocused, setHomeFocused] = useState(false)
const hosts = useMemo(() => selectConnectableHostProfiles(hostCatalog), [hostCatalog])
const connections = useMobileHomeHostConnections(hosts, hostCatalog, hostSetters, isHomeFocused)
const allClientsRef = useRef(connections.allClients)
@@ -90,7 +85,10 @@ export function useMobileHomeData() {
useEffect(() => {
if (Object.keys(worktreeInfo).length > 0) {
saveHomeSnapshot({ worktreeInfo, savedAt: Date.now() })
const saved = Object.fromEntries(
Object.entries(worktreeInfo).map(([hostId, info]) => [hostId, withoutHomeAgentStates(info)])
)
saveHomeSnapshot({ worktreeInfo: saved, savedAt: Date.now() })
}
}, [worktreeInfo])
@@ -109,6 +107,7 @@ export function useMobileHomeData() {
useCallback(() => {
let stale = false
focusedRef.current = true
setHomeFocused(true)
void loadHostCatalog()
// A failed read proves nothing about the desktops; keep the ones already shown.
.catch((): HostCatalogEntry[] | null => null)
@@ -130,11 +129,6 @@ export function useMobileHomeData() {
router.replace(mobileOnboardingDestination(steps))
}
})
void AsyncStorage.getItem(LAST_VISITED_WORKTREE_STORAGE_KEY).then((raw) => {
if (!stale) {
setLastVisited(readLastVisitedWorktreeRecord(raw))
}
})
for (const entry of allClientsRef.current) {
if (entry.client.getState() === 'connected') {
void fetchHomeHostWorktreeInfo(entry.client, entry.hostId, setWorktreeInfo, () => stale)
@@ -144,32 +138,37 @@ export function useMobileHomeData() {
return () => {
stale = true
focusedRef.current = false
setHomeFocused(false)
}
}, [router])
)
const sortedHosts = useMemo(() => sortHostsByLastConnected(hosts), [hosts])
const sortedHostCatalog = useMemo(() => sortHostsByLastConnected(hostCatalog), [hostCatalog])
const resumeCard = useMemo(
() =>
selectHomeResumeCard({
hosts: sortedHosts,
hostStates: connections.hostStates,
worktreeInfo,
lastVisited,
cachedWorktrees: (hostId) => getCachedWorktrees(hostId) as HomeWorktreeSummary[] | null
}),
[sortedHosts, connections.hostStates, worktreeInfo, lastVisited]
// One clock for every agent count, so Feed, the Agents badge and each desktop agree.
const now = useNow(30_000, homeFocused)
const refetchHostAgents = useCallback((hostId: string) => {
const entry = allClientsRef.current.find((candidate) => candidate.hostId === hostId)
return entry?.client.getState() === 'connected'
? fetchHomeHostWorktreeInfo(entry.client, hostId, setWorktreeInfo, () => false)
: Promise.resolve()
}, [])
const agentActivity = useAgentActivityWrites(connections.allClients, refetchHostAgents)
const { pendingActivity } = agentActivity
const agentList = useMemo<AgentListInput>(
() => ({
hosts: sortedHosts,
hostStates: connections.hostStates,
worktreeInfo,
now,
pendingActivity
}),
[sortedHosts, connections.hostStates, worktreeInfo, now, pendingActivity]
)
const jumpBackInRows = useMemo(
() =>
selectHomeJumpBackInRows({
hosts: sortedHosts,
hostStates: connections.hostStates,
worktreeInfo,
resumeCard
}),
[sortedHosts, connections.hostStates, worktreeInfo, resumeCard]
const agentsNeedingYou = useMemo(() => selectAgentsNeedingYou(agentList), [agentList])
const needsYouByHost = useMemo(
() => countAgentsNeedingYouByHost(agentsNeedingYou),
[agentsNeedingYou]
)
const connectedHosts = useMemo(
() => sortedHosts.filter((host) => connections.hostStates[host.id] === 'connected'),
@@ -190,12 +189,15 @@ export function useMobileHomeData() {
return {
...connections,
accountsByHost,
applyAgentActivity: agentActivity.apply,
agentList,
agentsNeedingYou,
connectedHosts,
hostCatalog,
hostCatalogLoaded,
hostConnections,
hostsConnecting,
jumpBackInRows,
needsYouByHost,
router,
setHostCatalog,
sortedHostCatalog,
@@ -14,7 +14,7 @@ import {
fetchHomeHostWorktreeInfo,
type HostWorktreeInfoSetter
} from '../worktree/home-host-worktree-fetch'
import { withoutHomeAgentStates } from '../worktree/home-worktree-info'
import { withLastSeenHomeAgents } from '../worktree/home-worktree-info'
import { fetchHomeHostStats, type HomeStatsSetter } from '../stats/home-stats-summary-read'
import {
readMobileHomeLastConnected,
@@ -27,7 +27,9 @@ const HOME_WORKTREE_REFRESH_MIN_INTERVAL_MS = 3000
const WORKTREE_CHANGE_EVENTS: ReadonlySet<string> = new Set([
'sidebarInputsChanged',
'worktreesChanged',
'reposChanged'
'reposChanged',
// The desktop Agents list changed; worktree.ps carries its verdicts.
'agentListChanged'
])
export type HomeAccountsSetter = (
@@ -107,7 +109,7 @@ function wireMobileHomeHostSubscriptions(
// Agents keep moving while we're away; only the reconnect read may show their states again.
setWorktreeInfo((previous) => {
const current = previous[entry.hostId]
const next = current && withoutHomeAgentStates(current)
const next = current && withLastSeenHomeAgents(current)
return next === current ? previous : { ...previous, [entry.hostId]: next }
})
}
@@ -1,56 +0,0 @@
import { describe, expect, it, vi } from 'vitest'
import {
navigateToMobileHostEdit,
type MobileHostEditNavigationState
} from './host-edit-navigation'
function navigationHarness(initialState: MobileHostEditNavigationState) {
let stateListener = () => {}
let state = initialState
const unsubscribeState = vi.fn()
const navigation = {
addListener: vi.fn((_event: 'state', listener: () => void) => {
stateListener = listener
return unsubscribeState
}),
dispatch: vi.fn(),
getState: () => state
}
return {
navigation,
setState(nextState: MobileHostEditNavigationState) {
state = nextState
stateListener()
},
unsubscribeState
}
}
// Replacement targets the nested host stack, so committed fixtures must include it.
function committedHostState(hostIdParam: string): MobileHostEditNavigationState {
return {
index: 1,
routes: [
{ name: 'index' },
{
name: 'h',
state: {
key: '/h',
index: 0,
routes: [{ key: 'host-index', name: '[hostId]/index', params: { hostId: hostIdParam } }]
}
}
]
}
}
describe('mobile host edit navigation', () => {
it('does not replace an unrelated host route', () => {
const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] })
navigateToMobileHostEdit(harness.navigation, { push: vi.fn(), replace: vi.fn() }, 'host-1')
harness.setState(committedHostState('host-2'))
expect(harness.navigation.dispatch).not.toHaveBeenCalled()
})
})
@@ -8,11 +8,9 @@ vi.mock('../../../src/shared/sidebar-inputs-switch', () => ({ ORCA_SIDEBAR_INPUT
import '../../../src/shared/rpc-contract/workspace-view-collapse-params'
import { FakeSession } from '../transport/connection/mobile-endpoint-supervisor-test-fakes'
import type { RpcResponse } from '../transport/rpc/rpc-wire-types'
import { INITIAL_MOBILE_VIEW } from '../worktree/workspace-view-settings'
import {
addPendingViewChange,
reconcilePendingViewChanges,
withPendingViewChanges,
type PendingViewChange
} from './host-view-pending-changes'
import {
@@ -150,16 +148,6 @@ describe('pending changes over the desktop’s values', () => {
collapsed
})
it('lay the desired values over the view, oldest first', () => {
const view = withPendingViewChanges(INITIAL_MOBILE_VIEW, [
{ opId: 1, sentAt: 0, kind: 'view', patch: { groupBy: 'none' }, payload: {} },
collapse(2, true),
{ opId: 3, sentAt: 0, kind: 'view', patch: { groupBy: 'pr-status' }, payload: {} }
])
expect(view.groupBy).toBe('pr-status')
expect(view.collapsedGroups).toEqual(['k'])
})
it('keep only the latest intent for a section toggled twice', () => {
const pending = addPendingViewChange([collapse(1, true)], collapse(2, false))
expect(pending.map((change) => change.opId)).toEqual([2])
+12
View File
@@ -9,6 +9,18 @@
"messages_other": "{{count}} messages"
}
},
"agents": {
"desktops": {
"agents_one": "{{count}} agent",
"agents_other": "{{count}} agents",
"needsYou_one": "{{count}} needs you",
"needsYou_other": "{{count}} need you"
},
"list": {
"workers_one": "{{count}} worker",
"workers_other": "{{count}} workers"
}
},
"app": {
"terminalSettings": {
"restoreAfterMinutes_one": "After {{count}} minute",
-6
View File
@@ -1411,12 +1411,6 @@
}
},
"home": {
"agents": {
"activeCount": "{{count}} aktiv",
"heading": "Agenten",
"showAll": "Alle {{count}} anzeigen",
"showFewer": "Weniger anzeigen"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Update-Hinweis für Orca {{version}} ausblenden",
"title": "Orca {{version}} ist verfügbar",
+86 -12
View File
@@ -557,10 +557,6 @@
"desktops": {
"pairDesktop": "Pair a desktop"
},
"jumpBackIn": {
"lastOpened": "Last opened",
"connectToOpen": "Connect {{desktop}} to open"
},
"sections": {
"tasks": "Tasks",
"tasksSubtitle": "Browse your issues and reviews"
@@ -574,12 +570,6 @@
"hours": "{{hours}}h",
"minutes": "{{minutes}}m"
},
"agents": {
"heading": "Agents",
"activeCount": "{{count}} active",
"showFewer": "Show fewer",
"showAll": "Show all {{count}}"
},
"automationsTab": {
"newAutomation": "New automation",
"lastStatus": "Last: {{status}}",
@@ -598,7 +588,8 @@
"automations": "Automations",
"feed": "Feed",
"chooseDesktop": "{{desktop}}, choose another desktop",
"usage": "Usage"
"usage": "Usage",
"agents": "Agents"
},
"usage": {
"refresh": "Refresh usage",
@@ -611,6 +602,10 @@
"active": "Active",
"openAccountsHint": "Opens this desktop’s accounts",
"emptyTitle": "No usage yet"
},
"needsYou": {
"heading": "Needs you",
"seeAll": "See all agents"
}
},
"hooks": {
@@ -900,7 +895,8 @@
"hours_other": "{{count}}h",
"days_one": "{{count}}d",
"days_other": "{{count}}d",
"done": "Done"
"done": "Done",
"permission": "Needs attention"
},
"hostWorkspaceListStates": {
"checkHost": "Check that your computer is awake and Orca is running",
@@ -4755,5 +4751,83 @@
"renameUnconfirmed": "Not confirmed yet. Orca checks the name when {{host}} is back.",
"saving": "Saving",
"serverUnreachable": "Its server can't be reached."
},
"agents": {
"list": {
"idleCount": "{{count}} idle",
"offlineTitle": "{{desktop}} is offline",
"offlineMessage": "Reconnect it to open this agent.",
"actions": "Actions for {{title}}",
"workers_one": "{{count}} worker",
"workers_other": "{{count}} workers",
"noMatches": "No agents match “{{query}}”",
"emptyTitle": "No agents running",
"pairDesktop": "Pair a desktop to see its agents here.",
"emptyBody": "Start an agent in any workspace and it shows up here.",
"unread": "Unread",
"noDesktopTitle": "No desktop connected",
"noDesktopBody": "Agents show up here once a desktop connects.",
"hideWorkers": "Hide {{workers}}",
"showWorkers": "Show {{workers}}"
},
"actions": {
"offlineHint": "Its desktop is offline.",
"open": "Open",
"goToWorkspace": "Go to workspace",
"copyTitle": "Copy title",
"copied": "Copied",
"copyFailed": "Couldn’t copy the title",
"markRead": "Mark as read",
"markUnread": "Mark as unread",
"clear": "Clear from list"
},
"groupBy": {
"status": "Status",
"workspace": "Workspace",
"project": "Project",
"agent": "Agent",
"desktop": "Desktop"
},
"options": {
"groupBy": "Group by",
"showWorkers": "Show worker agents",
"open": "Agent list options",
"unreadOnly": "Unread only",
"markAllRead": "Mark all read",
"clearFinished": "Clear finished"
},
"search": {
"toggle": "Search agents",
"placeholder": "Search agents"
},
"desktops": {
"pickerTitle": "Show agents on",
"agents_one": "{{count}} agent",
"agents_other": "{{count}} agents",
"all": "All desktops",
"offline": "Offline",
"needsYou_one": "{{count}} needs you",
"needsYou_other": "{{count}} need you"
},
"sections": {
"needsYou": "Needs you",
"working": "Working",
"done": "Done",
"offline": "Offline",
"offlineSeenAgo": "Offline · seen {{ago}} ago",
"offlineSeenJustNow": "Offline · seen just now",
"seenAgo": "Seen {{ago}} ago",
"seenJustNow": "Seen just now",
"clear": "Clear"
},
"swipe": {
"read": "Read",
"unread": "Unread",
"clear": "Clear"
},
"activity": {
"needsWindow": "Couldn’t update. Open Orca on {{desktop}}.",
"failed": "Couldn’t update the agent list."
}
}
}
-6
View File
@@ -1450,12 +1450,6 @@
}
},
"home": {
"agents": {
"activeCount": "Activos: {{count}}",
"heading": "Agentes",
"showAll": "Mostrar todos ({{count}})",
"showFewer": "Mostrar menos"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Descartar la actualización de Orca {{version}}",
"title": "Orca {{version}} está disponible",
-6
View File
@@ -1450,12 +1450,6 @@
}
},
"home": {
"agents": {
"activeCount": "{{count}} en activité",
"heading": "Agents",
"showAll": "Tout afficher ({{count}})",
"showFewer": "Afficher moins"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Ignorer la mise à jour Orca {{version}}",
"title": "Orca {{version}} est disponible",
-6
View File
@@ -1407,12 +1407,6 @@
}
},
"home": {
"agents": {
"activeCount": "{{count}} 件がアクティブ",
"heading": "Agent",
"showAll": "{{count}} 件をすべて表示",
"showFewer": "折りたたむ"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Orca {{version}} の更新通知を閉じる",
"title": "Orca {{version}} が利用可能です",
-6
View File
@@ -1407,12 +1407,6 @@
}
},
"home": {
"agents": {
"activeCount": "활성 {{count}}개",
"heading": "에이전트",
"showAll": "{{count}}개 모두 보기",
"showFewer": "접기"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Orca {{version}} 업데이트 알림 닫기",
"title": "Orca {{version}} 업데이트 가능",
-6
View File
@@ -1450,12 +1450,6 @@
}
},
"home": {
"agents": {
"activeCount": "{{count}} em atividade",
"heading": "Agentes",
"showAll": "Mostrar todos ({{count}})",
"showFewer": "Mostrar menos"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Descartar atualização do Orca {{version}}",
"title": "Orca {{version}} está disponível",
-6
View File
@@ -1489,12 +1489,6 @@
}
},
"home": {
"agents": {
"activeCount": "Активных: {{count}}",
"heading": "Агенты",
"showAll": "Показать все ({{count}})",
"showFewer": "Свернуть"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Скрыть уведомление об обновлении Orca {{version}}",
"title": "Доступна Orca {{version}}",
-6
View File
@@ -1411,12 +1411,6 @@
}
},
"home": {
"agents": {
"activeCount": "{{count}} etkin",
"heading": "Ajanlar",
"showAll": "Tümünü göster ({{count}})",
"showFewer": "Daha az göster"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "Orca {{version}} güncellemesini gizle",
"title": "Orca {{version}} sürümü mevcut",
-6
View File
@@ -1407,12 +1407,6 @@
}
},
"home": {
"agents": {
"activeCount": "{{count}} 個使用中",
"heading": "代理程式",
"showAll": "顯示全部 {{count}} 個",
"showFewer": "收合"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "關閉 Orca {{version}} 更新提示",
"title": "Orca {{version}} 已推出",
-6
View File
@@ -1407,12 +1407,6 @@
}
},
"home": {
"agents": {
"activeCount": "{{count}} 个活跃",
"heading": "智能体",
"showAll": "显示全部 {{count}} 个",
"showFewer": "收起"
},
"appUpdateCard": {
"dismissAccessibilityLabel": "关闭 Orca {{version}} 更新提示",
"title": "Orca {{version}} 已可用",
@@ -135,30 +135,3 @@ describe('the cases the rulings name', () => {
expect(bridge.frames().some((frame) => frame.type === 'end')).toBe(false)
})
})
// Test the enforced half of the desktop snapshot budget: a serialized payload at budget crosses, and one over frame cap is refused.
describe('a snapshot payload at the budget the page asks for', () => {
function scrollbackPayload(payloadBytes: number): unknown {
const skeleton = JSON.stringify({ type: 'scrollback', streamId: 1, serialized: '' }).length
return { type: 'scrollback', streamId: 1, serialized: 'x'.repeat(payloadBytes - skeleton) }
}
function post(payloadBytes: number): ReturnType<typeof harness> {
const bridge = harness({ ready: true, terminalTimers: manualTimers() })
bridge.host.receive(
clientFrame({ type: 'subscribe', id: ID, method: 'terminal.subscribe', params: {} })
)
const payload = scrollbackPayload(payloadBytes)
expect(JSON.stringify(payload)).toHaveLength(payloadBytes)
bridge.client.streams[0].emit(payload)
return bridge
}
it('ends the stream on a payload the cap cannot hold, which is why the host trims', () => {
// A host-budgeted snapshot must never reach this refusal; the page cannot detect a silently omitted event (C0.3).
const bridge = post(BRIDGE_MAX_MESSAGE_BYTES)
expect(bridge.frames().filter((frame) => frame.type === 'end')).toEqual([
{ v: 1, type: 'end', id: ID, reason: 'overflow' }
])
})
})
@@ -27,20 +27,6 @@ afterEach(() => {
})
describe('bridge client refusals and send failures', () => {
it('reports a frame its own reader will not take, and changes nothing', () => {
const page = createPageClient()
page.start()
page.deliverRaw('{ not json')
page.deliverRaw(JSON.stringify({ v: 99, type: 'state' }))
page.deliverRaw(`"${'z'.repeat(BRIDGE_MAX_MESSAGE_BYTES)}"`)
expect(page.diagnostics).toEqual([
{ kind: 'refused', refusal: 'malformed-json' },
{ kind: 'refused', refusal: 'unrecognised-message' },
{ kind: 'refused', refusal: 'oversized' }
])
expect(page.client.getState()).toBe('connected')
})
it('settles the request a reply it could not read was answering, on the same turn', async () => {
const page = createPageClient()
page.start()
@@ -1,7 +1,5 @@
import { describe, expect, it } from 'vitest'
import { BRIDGE_MAX_MESSAGE_BYTES } from './bridge-caps'
import {
BRIDGE_PROTOCOL_VERSION,
readBridgeClientMessage,
@@ -29,12 +27,6 @@ function client(fields: Record<string, unknown>): Record<string, unknown> {
return { v: BRIDGE_PROTOCOL_VERSION, ...fields }
}
describe('client messages', () => {
it('carries the frame refusal through rather than relabelling it', () => {
expect(readBridgeClientMessage('{')).toEqual({ ok: false, refusal: 'malformed-json' })
})
})
describe('the readers bound their two directions differently', () => {
const records = Array.from({ length: 5_000 }, (_, index) => ({
id: index,
@@ -63,20 +55,6 @@ describe('the readers bound their two directions differently', () => {
readClient(client({ type: 'request', id: ID, method: 'worktree.list', params: { records } }))
).toEqual({ ok: false, refusal: 'too-many-nodes' })
})
it('still refuses a host frame one byte over the frame cap', () => {
const envelope = (result: string) =>
JSON.stringify({
v: BRIDGE_PROTOCOL_VERSION,
type: 'reply',
id: ID,
payload: { ...SUCCESS_PAYLOAD, result }
})
const overhead = new TextEncoder().encode(envelope('')).byteLength
const raw = envelope('x'.repeat(BRIDGE_MAX_MESSAGE_BYTES + 1 - overhead))
expect(new TextEncoder().encode(raw).byteLength).toBe(BRIDGE_MAX_MESSAGE_BYTES + 1)
expect(readBridgeHostMessage(raw)).toEqual({ ok: false, refusal: 'oversized' })
})
})
// Pathnames and returned navigation hrefs share one segment rule; disagreement would expose a path through notify.
@@ -42,26 +42,6 @@ afterEach(() => {
// The typed member must reject desktop methods too; widened callers could otherwise bypass the raw-port inventory’s call shapes.
// Preserve one typed refusal with a stable code; callers must not distinguish recovery actions by message text.
describe('a verb the shell refuses', () => {
it('names the grant when this side refused before sending', async () => {
const page = createPageClient()
page.deliver({ ...INIT, grants: { ...GRANTS, native: ['navigate'] } })
act(() => {
create(
<RpcClientProvider client={page.client}>
<Screen />
</RpcClientProvider>
)
})
const verbs = held.verbs
if (verbs === null) {
throw new Error('nothing mounted')
}
await expect(verbs.readClipboardText()).rejects.toMatchObject({ reason: 'ungranted' })
})
})
describe('a code this page has never heard of', () => {
it('floors to unreported rather than crossing verbatim', async () => {
// Inject a newer-shell code directly; this host normalizes unknown codes before sending, so the pair cannot produce it itself.
@@ -1,98 +0,0 @@
import { createElement } from 'react'
import { act, create } from 'react-test-renderer'
import { beforeEach, describe, expect, it, vi } from 'vitest'
type RouteDependencies = {
routes: { pathname: string; params?: Record<string, string> }[]
refusals: string[]
lifecycle: string[]
params: Record<string, string | string[] | undefined>
}
const dependencies = vi.hoisted((): RouteDependencies => ({
routes: [],
refusals: [],
lifecycle: [],
params: {}
}))
vi.mock('@react-native-async-storage/async-storage', () => ({
default: { getItem: async () => null, setItem: async () => {} }
}))
vi.mock('react-native', () => ({
StyleSheet: { create: (styles: unknown) => styles },
View: 'View'
}))
vi.mock('../transport/connection/host-client-hooks', () => ({
useHostClient: () => ({ client: null, state: 'disconnected' })
}))
vi.mock('../worktree/workspace-server', () => ({
useWorkspaceServer: () => ({ routeHost: undefined, server: null })
}))
vi.mock('expo-router', () => ({ useLocalSearchParams: () => dependencies.params }))
vi.mock('./PageRouteUnavailableScreen', () => ({
PageRouteUnavailableScreen: (props: { hostId: string }) => {
dependencies.refusals.push(props.hostId)
return null
}
}))
vi.mock('./MobileWebShellScreen', async () => {
const React = await import('react')
return {
MobileWebShellScreen: (props: {
hostId: string
route: { pathname: string; params?: Record<string, string> }
}) => {
dependencies.routes.push(props.route)
// Keep deps empty: pathname-driven effects would also run on prop updates and falsely look like remounts.
const mountedAs = React.useRef(props.route.pathname)
React.useEffect(() => {
const pathname = mountedAs.current
dependencies.lifecycle.push(`mount:${pathname}`)
return () => {
dependencies.lifecycle.push(`unmount:${pathname}`)
}
}, [])
return null
}
}
})
import MobileAgentSessionHistoryScreen from '../../app/h/[hostId]/agent-history/[worktreeId]'
async function renderRoute(): Promise<void> {
await act(async () => {
create(createElement(MobileAgentSessionHistoryScreen))
})
}
describe('the agent-history route that hands off to the shell', () => {
beforeEach(() => {
dependencies.routes.length = 0
dependencies.refusals.length = 0
dependencies.lifecycle.length = 0
dependencies.params = { hostId: 'host-1', worktreeId: 'wt-1', name: 'my worktree' }
})
// encodeURIComponent leaves dot segments intact; refuse them before constructing a route the bridge rejects.
it('refuses a dot-segment worktree id too, which is the other segment', async () => {
dependencies.params = { hostId: 'host-1', worktreeId: '..', name: 'n' }
await renderRoute()
expect(dependencies.routes).toEqual([])
expect(dependencies.refusals.at(-1)).toBe('host-1')
})
it('refuses when the route names no worktree, which the shell could not open', async () => {
dependencies.params = { hostId: 'host-1' }
await renderRoute()
expect(dependencies.routes).toEqual([])
expect(dependencies.refusals.at(-1)).toBe('host-1')
})
// Remount on route change to dispose the bridge that captured the previous route’s grants.
})
@@ -1,74 +0,0 @@
import { createElement } from 'react'
import { act, create, type ReactTestRenderer } from 'react-test-renderer'
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest'
import {
createPageBackConsumers,
type PageBackConsumers
} from '../mobile-web-shell/bridge/page-back-consumers'
type PageBackProbe = {
claims: boolean[]
unclaimed: Mock
consumers: PageBackConsumers | null
}
// Build the real stack after imports, not inside vi.hoisted, so no fake duplicates the behavior under test.
const page = vi.hoisted((): PageBackProbe => ({ claims: [], unclaimed: vi.fn(), consumers: null }))
vi.mock('../transport/connection/client-context.web', () => ({
usePageBridgeClientIfPresent: () =>
page.consumers === null ? null : { claimBack: (claim: () => boolean) => stack().claim(claim) }
}))
import { useBackClaim } from './use-back-claim.web'
function stack(): PageBackConsumers {
if (page.consumers === null) {
throw new Error('the page back stack was not built for this case')
}
return page.consumers
}
function Screen({ claim }: { claim: (() => boolean) | null }): null {
useBackClaim(claim)
return null
}
const trees: ReactTestRenderer[] = []
function render(claim: (() => boolean) | null): ReactTestRenderer {
let tree!: ReactTestRenderer
act(() => {
tree = create(createElement(Screen, { claim }))
})
trees.push(tree)
return tree
}
beforeEach(() => {
page.claims.length = 0
page.unclaimed.mockClear()
page.consumers = createPageBackConsumers({
publishClaim: (claimed) => page.claims.push(claimed),
onUnclaimed: page.unclaimed
})
})
afterEach(() => {
act(() => {
for (const tree of trees.splice(0)) {
tree.unmount()
}
})
page.consumers = null
})
// RN Web BackHandler is inert, so sheets must claim the shell’s key through the bridge.
describe('a page screen claiming the device Back key from the shell', () => {
// Shared drawers can mount without a page provider; no available shell means no claim, never a thrown render.
it('claims nothing, and does not throw, outside the page bridge', () => {
page.consumers = null
expect(() => render(() => true)).not.toThrow()
expect(page.claims).toEqual([])
})
})
@@ -1,50 +0,0 @@
import { createElement } from 'react'
import { act, create, type ReactTestRenderer } from 'react-test-renderer'
import { afterEach, describe, expect, it, vi } from 'vitest'
const handoff = vi.hoisted(() => ({ back: vi.fn(), replace: vi.fn() }))
vi.mock('expo-router', () => ({ useLocalSearchParams: () => ({ hostId: 'laptop' }) }))
vi.mock('../navigation/route-handoff', () => ({ useRouteHandoff: () => handoff }))
vi.mock('../transport/connection/host-client-hooks', () => ({
useHostClient: () => ({ client: null, state: 'connected' })
}))
vi.mock('../components/host-protocol-gates-context', () => ({
useHostProtocolGates: () => ({ hostCapabilities: ['cap'] })
}))
vi.mock('./use-host-worktree-rows', () => ({
useHostWorktreeRows: () => [{ path: '/repo/marlin', repoId: 'r1', branch: 'marlin' }]
}))
vi.mock('../platform/external-link', () => ({ openExternalLink: vi.fn() }))
vi.mock('../components/NewWorktreeModalController', () => ({
NewWorktreeModalController: 'NewWorktreeModalController'
}))
import { NewWorkspacePageScreen } from './NewWorkspacePageScreen'
describe('the Create Workspace page', () => {
let renderer: ReactTestRenderer | null = null
afterEach(() => {
act(() => renderer?.unmount())
renderer = null
vi.clearAllMocks()
})
async function render() {
await act(async () => {
renderer = create(createElement(NewWorkspacePageScreen))
})
return renderer!.root.find((node) => String(node.type) === 'NewWorktreeModalController')
}
it("opens the new workspace's session in the overlay's place", async () => {
const drawer = await render()
act(() => drawer.props.onCreated('wt-1', 'Hammerhead', 'No startup terminal', 'ssh:box'))
expect(handoff.replace).toHaveBeenCalledWith(
'/h/laptop/session/wt-1?name=Hammerhead&created=1&warning=No+startup+terminal&executionHost=ssh%3Abox'
)
})
})
@@ -1,64 +0,0 @@
import { createElement } from 'react'
import { act, create, type ReactTestRenderer } from 'react-test-renderer'
import { afterEach, describe, expect, it, vi } from 'vitest'
import type { HostCatalogEntry, HostProfile } from '../transport/hosts/host-profile'
const router = vi.hoisted(() => ({ back: vi.fn(), push: vi.fn(), replace: vi.fn() }))
const params = vi.hoisted((): { current: Record<string, string> } => ({ current: {} }))
const catalog = vi.hoisted((): { current: HostCatalogEntry[] } => ({ current: [] }))
vi.mock('expo-router', () => ({
useLocalSearchParams: () => params.current,
useRouter: () => router
}))
vi.mock('../transport/hosts/host-store', () => ({
loadHostCatalog: async () => catalog.current
}))
vi.mock('../components/PickerModal', () => ({ PickerModal: 'PickerModal' }))
vi.mock('./NewWorkspaceOverlay', () => ({ NewWorkspaceOverlay: 'NewWorkspaceOverlay' }))
import NewWorkspaceOverlayRoute from '../../app/new-workspace'
import { newWorkspaceOverlayHref } from './new-workspace-overlay-route'
function entry(id: string, name: string): HostCatalogEntry {
const profile: HostProfile = {
id,
name,
endpoint: `ws://${id}.local:6768`,
deviceToken: `token-${id}`,
publicKeyB64: `key-${id}`,
lastConnected: 1
}
const { deviceToken: _deviceToken, ...listed } = profile
return { ...listed, credentialStatus: 'ready', profile }
}
describe("Home's New Workspace overlay", () => {
let renderer: ReactTestRenderer | null = null
afterEach(() => {
act(() => renderer?.unmount())
renderer = null
vi.clearAllMocks()
})
async function open(hostIds: string[]) {
params.current = newWorkspaceOverlayHref(hostIds).params
await act(async () => {
renderer = create(createElement(NewWorkspaceOverlayRoute))
})
const root = renderer!.root
return {
overlayFor: () =>
root.findAll((node) => String(node.type) === 'NewWorkspaceOverlay')[0]?.props.hostId,
picker: () => root.find((node) => String(node.type) === 'PickerModal')
}
}
it("opens the only offered desktop's drawer without asking", async () => {
catalog.current = [entry('desk', 'Desk')]
const overlay = await open(['desk'])
expect(overlay.overlayFor()).toBe('desk')
})
})
@@ -1,44 +0,0 @@
import { beforeEach, expect, it, vi } from 'vitest'
import * as Notifications from 'expo-notifications'
import { loadHostCatalog } from '../transport/hosts/host-store'
import { deriveHostFingerprint } from './push-host-fingerprint'
import { requestNotificationCatchup } from './push-dismissal-reconciliation'
vi.mock('../transport/hosts/host-store', () => ({ loadHostCatalog: vi.fn() }))
vi.mock('expo-notifications', () => ({
getPresentedNotificationsAsync: vi.fn(),
dismissNotificationAsync: vi.fn()
}))
vi.mock('@react-native-async-storage/async-storage', () => ({
default: { getItem: async () => null, setItem: async () => {} }
}))
const publicKeyB64 = Buffer.alloc(32, 1).toString('base64')
const hostFingerprint = deriveHostFingerprint(publicKeyB64)
const id = {
notificationId: 'old-alert',
notificationEpoch: 'previous-host-process',
notificationSeq: 12
}
function presented(identifier: string, overrides = {}) {
return { request: { identifier, content: { data: { hostFingerprint, ...id, ...overrides } } } }
}
beforeEach(() => {
vi.clearAllMocks()
vi.mocked(loadHostCatalog).mockResolvedValue([{ id: 'host-a', publicKeyB64 }] as never)
vi.mocked(Notifications.getPresentedNotificationsAsync).mockResolvedValue([
presented('old'),
presented('new', { notificationSeq: 14 }),
presented('other', { hostFingerprint: 'other-host' })
] as never)
vi.mocked(Notifications.dismissNotificationAsync).mockResolvedValue(undefined)
})
it('keeps alerts when an old host omits reconciliation or the request fails', async () => {
for (const response of [{ ok: true, result: { notifications: [] } }, { ok: false }]) {
await requestNotificationCatchup(
{ sendRequest: async () => response } as never,
'host-a',
() => false
)
}
expect(Notifications.dismissNotificationAsync).not.toHaveBeenCalled()
})
@@ -1,37 +0,0 @@
import { expect, it, vi } from 'vitest'
import * as Notifications from 'expo-notifications'
import { loadHostCatalog } from '../transport/hosts/host-store'
import { deriveHostFingerprint } from './push-host-fingerprint'
import { dismissHostPushNotification } from './push-socket-dismissal'
vi.mock('../transport/hosts/host-store', () => ({ loadHostCatalog: vi.fn() }))
vi.mock('expo-notifications', () => ({
getPresentedNotificationsAsync: vi.fn(),
dismissNotificationAsync: vi.fn()
}))
vi.mock('@react-native-async-storage/async-storage', () => ({
default: { getItem: async () => null, setItem: async () => undefined }
}))
it('a socket dismissal cannot clear another desktop or a newer notification', async () => {
const publicKeyB64 = Buffer.alloc(32, 1).toString('base64')
vi.mocked(loadHostCatalog).mockResolvedValue([{ id: 'host-a', publicKeyB64 }] as never)
const hostFingerprint = deriveHostFingerprint(publicKeyB64)
const event = {
type: 'dismiss' as const,
notificationId: 'same',
notificationEpoch: 'epoch',
notificationSeq: 2
}
const presented = (identifier: string, overrides: Record<string, unknown>) => ({
request: { identifier, content: { data: { hostFingerprint, ...event, ...overrides } } }
})
vi.mocked(Notifications.getPresentedNotificationsAsync).mockResolvedValue([
presented('older', { notificationSeq: 1 }),
presented('newer', { notificationSeq: 3 }),
presented('other', { hostFingerprint: 'other-host' }),
presented('restarted', { notificationEpoch: 'new-epoch' })
] as never)
vi.mocked(Notifications.dismissNotificationAsync).mockResolvedValue(undefined)
await dismissHostPushNotification(event, 'host-a')
expect(vi.mocked(Notifications.dismissNotificationAsync).mock.calls).toEqual([['older']])
})
@@ -104,21 +104,6 @@ describe('mobile relay physical pairing client', () => {
await expect(status).rejects.toEqual(new RelayOuterError(4409))
})
it('classifies an opaque close after transport error as 1006', async () => {
const socket = new FakeSocket()
const client = connectMobileRelayForPairing({
relay,
deviceToken: 'device-token',
desktopPublicKeyB64: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
createSocket: () => pairingWebSocket(socket)
})
const status = client.sendRequest('status.get')
socket.onerror?.()
socket.onclose?.({ code: 0 })
await expect(status).rejects.toEqual(new RelayOuterError(1006))
})
it('settles after an error when the platform never emits close', async () => {
vi.useFakeTimers()
try {
+118 -32
View File
@@ -1,4 +1,4 @@
import { useEffect } from 'react'
import { useCallback, useEffect, useSyncExternalStore } from 'react'
import { focusManager, useQueryClient, type Query, type QueryClient } from '@tanstack/react-query'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import {
@@ -18,23 +18,48 @@ function targetOf(query: Query): HostQueryKey[3] {
return (query.queryKey as HostQueryKey)[3]
}
const trailingReads = new WeakMap<QueryClient, Set<string>>()
// What to do once a read already out settles: read again, or only mark the answer stale.
type AfterRead = 'refetch' | 'stale'
function trailingReadsOf(queryClient: QueryClient): Set<string> {
const existing = trailingReads.get(queryClient)
const afterReads = new WeakMap<QueryClient, Map<string, AfterRead>>()
function afterReadsOf(queryClient: QueryClient): Map<string, AfterRead> {
const existing = afterReads.get(queryClient)
if (existing) {
return existing
}
const hashes = new Set<string>()
trailingReads.set(queryClient, hashes)
const pending = new Map<string, AfterRead>()
afterReads.set(queryClient, pending)
// One cache listener per world, for as long as the world's client lives.
queryClient.getQueryCache().subscribe(({ type, query }) => {
if (type === 'updated' && hashes.has(query.queryHash) && query.state.fetchStatus === 'idle') {
hashes.delete(query.queryHash)
refetchHostQueryAfterInFlight(queryClient, query)
const after = pending.get(query.queryHash)
if (type === 'updated' && after && query.state.fetchStatus === 'idle') {
pending.delete(query.queryHash)
if (after === 'refetch') {
refetchHostQueryAfterInFlight(queryClient, query)
} else {
void markStale(queryClient, query)
}
}
})
return hashes
return pending
}
function markStale(queryClient: QueryClient, query: Query): Promise<void> {
return queryClient.invalidateQueries({
queryKey: query.queryKey,
exact: true,
refetchType: 'none'
})
}
// A read already out may predate the change, and its answer would clear the mark; mark again once it lands.
function markStaleAfterInFlight(queryClient: QueryClient, query: Query): void {
void markStale(queryClient, query)
const pending = afterReadsOf(queryClient)
if (query.state.fetchStatus === 'fetching' && !pending.has(query.queryHash)) {
pending.set(query.queryHash, 'stale')
}
}
/**
@@ -43,7 +68,7 @@ function trailingReadsOf(queryClient: QueryClient): Set<string> {
*/
export function refetchHostQueryAfterInFlight(queryClient: QueryClient, query: Query): void {
if (query.state.fetchStatus === 'fetching') {
trailingReadsOf(queryClient).add(query.queryHash)
afterReadsOf(queryClient).set(query.queryHash, 'refetch')
return
}
void queryClient.refetchQueries(
@@ -52,12 +77,28 @@ export function refetchHostQueryAfterInFlight(queryClient: QueryClient, query: Q
)
}
type RouterHandle = {
stop: () => void
isReady: () => boolean
onReadyChange: (listener: () => void) => () => void
}
function startHostEventRouter(
queryClient: QueryClient,
hostId: string,
client: RpcClient
): () => void {
// When the stream last said it was live; a replayed ready may have missed events since.
): RouterHandle {
const startedAt = Date.now()
// Whether the stream is live now, i.e. a change on the host would reach this router.
let ready = false
const readyListeners = new Set<() => void>()
const setReady = (next: boolean): void => {
if (next !== ready) {
ready = next
readyListeners.forEach((listener) => listener())
}
}
// When the stream last said it was live (0: never); a replayed ready may have missed events since.
let readyAt = 0
const floorTimers = new Map<string, ReturnType<typeof setTimeout>>()
const signalledQueries = (matches: (signal: HostQuerySignal, query: Query) => boolean): Query[] =>
@@ -68,13 +109,11 @@ function startHostEventRouter(
return signal !== undefined && matches(signal, query)
}
})
const markStale = (query: Query): Promise<void> =>
queryClient.invalidateQueries({ queryKey: query.queryKey, exact: true, refetchType: 'none' })
// Unobserved or hidden: stale only, so the next mount or foreground reads it.
const readsNow = (query: Query): boolean => query.isActive() && focusManager.isFocused()
const onChange = (query: Query): void => {
void markStale(query)
markStaleAfterInFlight(queryClient, query)
if (!readsNow(query) || floorTimers.has(query.queryHash)) {
return
}
@@ -97,10 +136,8 @@ function startHostEventRouter(
)
}
const onReplayedReady = (missedSince: number): void => {
// After a reconnect, the connected edge already re-read every observed query; a replay with no reconnect (a path switch) did not.
const connectedAt = client.getLastConnectedAt() ?? 0
const readSince = connectedAt > missedSince ? connectedAt : Infinity
// Reads again (or marks stale, when no one watches) every answer older than `readSince`.
const catchUp = (readSince: number): void => {
for (const query of signalledQueries(() => true)) {
if (query.state.fetchStatus === 'fetching' || query.state.dataUpdatedAt >= readSince) {
continue
@@ -108,22 +145,33 @@ function startHostEventRouter(
if (readsNow(query)) {
void queryClient.invalidateQueries({ queryKey: query.queryKey, exact: true })
} else {
void markStale(query)
void markStale(queryClient, query)
}
}
}
const onReplayedReady = (missedSince: number): void => {
// After a reconnect, the connected edge already re-read every observed query; a replay with no reconnect (a path switch) did not.
const connectedAt = client.getLastConnectedAt() ?? 0
catchUp(connectedAt > missedSince ? connectedAt : Infinity)
}
const onEvent = (event: SharedClientEvent): void => {
if (event.type === 'ready') {
// Events are not queued while disconnected or between a stream's end and its reopen.
if ('replayed' in event) {
onReplayedReady(readyAt)
} else if (readyAt === 0) {
// Answers cached before this router started were read while nothing heard the host.
catchUp(startedAt)
}
readyAt = Date.now()
setReady(true)
return
}
if (event.type === 'end' || event.type === 'error') {
// The shared stream opens again by itself; its next ready re-reads what was missed.
setReady(false)
return
}
const signalled: HostSignalEvent = event
@@ -136,16 +184,24 @@ function startHostEventRouter(
}
const stopStream = subscribeSharedClientEvents(client, onEvent)
return () => {
stopStream()
for (const timer of floorTimers.values()) {
clearTimeout(timer)
return {
stop: () => {
stopStream()
for (const timer of floorTimers.values()) {
clearTimeout(timer)
}
floorTimers.clear()
readyListeners.clear()
},
isReady: () => ready,
onReadyChange: (listener) => {
readyListeners.add(listener)
return () => readyListeners.delete(listener)
}
floorTimers.clear()
}
}
type Router = { holders: number; stop: () => void }
type Router = { holders: number; handle: RouterHandle }
const routers = new WeakMap<QueryClient, Map<RpcClient, Router>>()
@@ -154,7 +210,7 @@ function retainHostEventRouter(
queryClient: QueryClient,
hostId: string,
client: RpcClient
): () => void {
): { handle: RouterHandle; release: () => void } {
let byClient = routers.get(queryClient)
if (!byClient) {
byClient = new Map()
@@ -163,25 +219,55 @@ function retainHostEventRouter(
const clients = byClient
let router = clients.get(client)
if (!router) {
router = { holders: 0, stop: startHostEventRouter(queryClient, hostId, client) }
router = { holders: 0, handle: startHostEventRouter(queryClient, hostId, client) }
clients.set(client, router)
}
const held = router
held.holders += 1
return () => {
const release = (): void => {
held.holders -= 1
if (held.holders === 0) {
held.stop()
held.handle.stop()
clients.delete(client)
}
}
return { handle: held.handle, release }
}
/** Keeps the host's event-signalled families (see HostQuery `signal`) fresh while a screen reads them. */
export function useHostEventRouter(hostId: string | undefined, client: RpcClient | null): void {
const queryClient = useQueryClient()
useEffect(
() => (client && hostId ? retainHostEventRouter(queryClient, hostId, client) : undefined),
() =>
client && hostId ? retainHostEventRouter(queryClient, hostId, client).release : undefined,
[queryClient, hostId, client]
)
}
/**
* Keeps the host's event router running, like useHostEventRouter, and says whether its event stream
* is live. Only while it is can a family hold its answer until an event marks it stale.
*/
export function useHostEventStreamReady(
hostId: string | undefined,
client: RpcClient | null
): boolean {
const queryClient = useQueryClient()
const subscribe = useCallback(
(onChange: () => void) => {
if (!client || !hostId) {
return () => {}
}
const { handle, release } = retainHostEventRouter(queryClient, hostId, client)
const stopListening = handle.onReadyChange(onChange)
return () => {
stopListening()
release()
}
},
[queryClient, hostId, client]
)
return useSyncExternalStore(subscribe, () =>
client && hostId ? (routers.get(queryClient)?.get(client)?.handle.isReady() ?? false) : false
)
}
+9 -2
View File
@@ -34,7 +34,7 @@ export type HostQuery<TInput extends HostQueryParams, TData> = {
fetch?: HostQueryFetch<TInput, TData>
staleTime?: StaleTimeFunction<TData, Error, TData, HostQueryKey>
gcTime?: number
// Only for families the desktop sends no change signal for.
// Reads a stale answer on foreground: one with no change signal, or one an event marked while hidden.
refetchOnWindowFocus?: boolean
// For a screen that offers its own Retry, so a lost read is reported instead of sent again.
retry?: false
@@ -177,7 +177,13 @@ export function useHostQuery<TInput extends HostQueryParams, TData>(
host: { hostId: string; client: RpcClient | null },
target: HostQueryTarget,
input: TInput,
options?: { enabled?: boolean; subscribed?: boolean; refetchInterval?: number | false }
options?: {
enabled?: boolean
subscribed?: boolean
refetchInterval?: number | false
// Replaces the family's own, e.g. once the host is known to signal every change.
staleTime?: number
}
): UseQueryResult<TData> {
const { hostId, client } = host
const enabled = client !== null && options?.enabled !== false
@@ -194,6 +200,7 @@ export function useHostQuery<TInput extends HostQueryParams, TData>(
}, [query, client, hostId, keyHash, enabled])
return useQuery({
...queryOptions,
...(options?.staleTime === undefined ? {} : { staleTime: options.staleTime }),
subscribed: options?.subscribed,
refetchInterval: options?.refetchInterval
})
@@ -0,0 +1,35 @@
import { SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY } from '../../../src/shared/protocol-version'
import { useOptionalHostProtocolGates } from '../components/host-protocol-gates-context'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import { useRouteRelaysCapability } from '../worktree/workspace-server-context'
import { useHostEventStreamReady } from './host-event-router'
import type { HostQuerySignal } from './host-query'
/**
* Whether a settings family can hold its answer until a settingsChanged event marks it stale: the
* route's host publishes the event and this page's event stream from it is live. Otherwise (older
* hosts, a stream that ended, screens outside a host route) the family keeps its own rereads.
*/
export function useHostSettingsChangeSignal(hostId: string, client: RpcClient | null): boolean {
const hostCapabilities = useOptionalHostProtocolGates()?.hostCapabilities
const relayed = useRouteRelaysCapability(SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY)
const published =
hostCapabilities?.includes(SETTINGS_CHANGED_EVENT_RUNTIME_CAPABILITY) === true && relayed
const streamReady = useHostEventStreamReady(
published ? hostId : undefined,
published ? client : null
)
return published && streamReady
}
/** The signal of a family that reads only `keys` of the host's settings. */
export function settingsSignal(keys: readonly string[]): HostQuerySignal {
return {
events: ['settingsChanged'],
// An event without a key list (malformed) could name anything.
matches: (event) =>
event.type !== 'settingsChanged' ||
!Array.isArray(event.keys) ||
event.keys.some((key) => keys.includes(key))
}
}
@@ -9,6 +9,7 @@ import {
type HostQueryTarget
} from '../../query/host-query-key'
import { hostReadClient } from '../../query/host-read-client'
import { useHostSettingsChangeSignal } from '../../query/settings-change-signal'
import type { RpcClient } from '../../transport/rpc/rpc-client-contract'
import { newTabSettingsRead } from './mobile-new-tab-settings-operations'
import {
@@ -75,16 +76,18 @@ export async function refreshDetectedAgents(
const NO_INPUT = {}
// The launch reads the whole settings object, so any settingsChanged makes it stale.
const newTabSettingsQuery = defineHostQuery({
family: 'settings.newTab',
staleTime: 60_000,
gcTime: 30 * 60_000,
signal: { events: ['settingsChanged'] },
fetch: async (client, _target, _input: typeof NO_INPUT) => ({
settings: newTabSettingsRead.interpret(await newTabSettingsRead.request(client))()
})
})
// Settings are read again on every sheet open; the cached ones paint meanwhile.
// A host without settingsChanged gets a reread on every sheet open; the cached ones paint meanwhile.
export function reloadNewTabSettings(
queryClient: QueryClient,
hostId: string,
@@ -101,6 +104,8 @@ type MobileAgentLaunchQueries = {
settings: UseQueryResult<{ settings: unknown }>
target: HostQueryTarget
input: DetectionInput
// The host tells this page when settings change, so a sheet open need not read them again.
settingsSignalled: boolean
}
// One agent list per workspace and document, shared by the "+" sheet and the "Fix with" labels.
@@ -130,11 +135,13 @@ export function useMobileAgentLaunchQueries(args: {
enabled,
subscribed: observed(detectedAgentsQuery.family, target, input)
})
const settingsSignalled = useHostSettingsChangeSignal(hostId, client)
const settings = useHostQuery(newTabSettingsQuery, { hostId, client }, settingsTarget, NO_INPUT, {
enabled,
subscribed: observed(newTabSettingsQuery.family, settingsTarget, NO_INPUT)
subscribed: observed(newTabSettingsQuery.family, settingsTarget, NO_INPUT),
staleTime: settingsSignalled ? Infinity : undefined
})
return { detection, settings, target, input }
return { detection, settings, target, input, settingsSignalled }
}
export function agentLaunchContextOf({
@@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest'
import {
buildMobileNewTabAgentOptions,
orderMobileNewTabAgents
} from './mobile-new-tab-agent-options'
import { orderMobileNewTabAgents } from './mobile-new-tab-agent-options'
describe('mobile new-tab agent options', () => {
it('orders the enabled detected default first', () => {
@@ -12,8 +9,4 @@ describe('mobile new-tab agent options', () => {
'claude'
])
})
it('does not show stale presets while detection is pending', () => {
expect(buildMobileNewTabAgentOptions({ defaultTuiAgent: 'codex' }, null)).toEqual([])
})
})
@@ -43,7 +43,7 @@ export function useMobileNewTabAgentOptions(args: {
const { client, connState, hostId, open } = args
const queryClient = useQueryClient()
const connected = client !== null && connState === 'connected'
const { detection, settings, target, input } = useMobileAgentLaunchQueries({
const { detection, settings, target, input, settingsSignalled } = useMobileAgentLaunchQueries({
hostId,
client,
worktreeId: args.worktreeId,
@@ -58,7 +58,9 @@ export function useMobileNewTabAgentOptions(args: {
if (!open || !client || connState !== 'connected') {
return
}
reloadNewTabSettings(queryClient, hostId, target.exec)
if (!settingsSignalled) {
reloadNewTabSettings(queryClient, hostId, target.exec)
}
const queryKey = hostQueryKey(hostId, detectedAgentsQuery.family, target, input)
const cached = queryClient.getQueryState<MobileDetectedAgents>(queryKey)
const refreshed = refreshedThisConnection(client)
@@ -92,7 +94,7 @@ export function useMobileNewTabAgentOptions(args: {
refreshed.delete(targetKey)
}
})
}, [client, connState, hostId, input, mountedAt, open, queryClient, target])
}, [client, connState, hostId, input, mountedAt, open, queryClient, settingsSignalled, target])
const detected = detection.data
const loadState: MobileNewTabAgentLoadState = !connected
@@ -1,92 +0,0 @@
import { describe, expect, it } from 'vitest'
import { agentSessionFailureFact } from '../../../src/shared/agent-session/failures/agent-session-failure'
import { agentSessionFailureWords } from '../../../src/shared/agent-session/failures/agent-session-failure-words'
import {
QUEUED_MESSAGE_PAUSED_SEND_FAILED,
type AgentSessionQueuedMessage
} from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire'
import { queuedMessagesQueuePause } from '../../../src/shared/agent-session/view/structured-agent-session-queued-cards'
import type { AgentJournalSubmission } from '../../../src/shared/agent-session/journal/agent-session-journal-types'
import { mobileQueuedMessageCards } from './mobile-structured-queued-message-cards'
function returnedAs(fact: Parameters<typeof agentSessionFailureWords>[0]) {
const { reason, rejection } = agentSessionFailureWords(fact, { surface: 'rejection' })
return { state: 'returned' as const, returnedReason: reason, returnedRejection: rejection }
}
function draft(overrides: Partial<AgentSessionQueuedMessage> & { messageId: string }) {
return {
position: 1,
body: {
kind: 'message' as const,
role: 'user' as const,
blocks: [{ type: 'text' as const, text: `body of ${overrides.messageId}` }]
},
state: 'waiting' as const,
...overrides
}
}
describe('mobileQueuedMessageCards', () => {
it('finds waiting input for Resume past returned or failed cards', () => {
const resumable = (drafts: AgentSessionQueuedMessage[]) =>
queuedMessagesQueuePause(mobileQueuedMessageCards(drafts, []), { reason: 'stopped' }) !== null
const returned = draft({
messageId: 'r',
...returnedAs(agentSessionFailureFact('hostRestarted'))
})
const failed = draft({
messageId: 'f',
paused: true,
pausedReason: QUEUED_MESSAGE_PAUSED_SEND_FAILED
})
const waiting = draft({ messageId: 'w', position: 2 })
expect(resumable([returned])).toBe(false)
expect(resumable([returned, waiting])).toBe(true)
expect(resumable([failed])).toBe(false)
expect(resumable([failed, waiting])).toBe(true)
expect(resumable([waiting, { ...returned, position: 3 }])).toBe(true)
})
it('hides a waiting card once its hand-off arrived, never a returned one', () => {
const cards = mobileQueuedMessageCards(
[
draft({ messageId: 'returned', ...returnedAs(agentSessionFailureFact('hostRestarted')) }),
draft({ messageId: 'drained', position: 2 }),
draft({ messageId: 'waiting', position: 3 })
],
[handOff('returned', 'rejected'), handOff('drained', 'pending')]
)
expect(cards.map((card) => card.messageId)).toEqual(['returned', 'waiting'])
})
it('shows a draft a Stop requeued beside its rejected hand-off', () => {
// Rejected hand-offs stay hidden in history; the requeued card is the only reachable copy of their text.
const cards = mobileQueuedMessageCards(
[
draft({ messageId: 'requeued' }),
draft({ messageId: 'sending', position: 2 }),
draft({ messageId: 'sent', position: 3 })
],
[handOff('requeued', 'rejected'), handOff('sending', 'pending'), handOff('sent', 'accepted')]
)
expect(cards.map((card) => card.messageId)).toEqual(['requeued'])
})
})
function handOff(
queuedMessageId: string,
dispatchState: AgentJournalSubmission['dispatchState']
): AgentJournalSubmission {
return {
clientMessageId: `${queuedMessageId}-handoff`,
queuedMessageId,
dispatchState,
fence: 1,
payloadFingerprint: 'fingerprint',
providerItemId: null,
reason: null,
submittedAt: 1,
resolvedAt: null
}
}
@@ -80,20 +80,6 @@ describe('MobileNativeChatView: send and read failure banners', () => {
expect(banners()).toHaveLength(1)
})
it('retires the previous route banner when a new send starts', async () => {
const onClearSendError = vi.fn()
await render({
onSend: vi.fn().mockResolvedValue(false),
sendErrorMessage: 'Stop failed',
onClearSendError
})
await pressSend()
expect(onClearSendError).toHaveBeenCalledOnce()
expect(banners()).toHaveLength(1)
expect(bannerText()).toBe('Stop failed')
})
it('retires the previous banner before sending and preserves the new delivery notice', async () => {
const onClearSendError = vi.fn()
await render({

Some files were not shown because too many files have changed in this diff Show More