diff --git a/src/docker-hosts.ts b/src/docker-hosts.ts index f2ce722d..45b8d17b 100644 --- a/src/docker-hosts.ts +++ b/src/docker-hosts.ts @@ -1014,7 +1014,7 @@ export function resolveDockerCredentialArtifacts( * string; argv arrays must NOT carry literal quotes (mirror of docker-export's * dockerArgv). */ -function dockerEngineArgv(docker: Pick): string[] { +export function dockerEngineArgv(docker: Pick): string[] { const argv: string[] = [docker.engine === 'podman' ? 'podman' : 'docker']; if (docker.context) argv.push('--context', docker.context); if (docker.daemonHost) argv.push('-H', docker.daemonHost); diff --git a/src/foreign-tmux-discovery.ts b/src/foreign-tmux-discovery.ts index 6c5e46a2..4921c610 100644 --- a/src/foreign-tmux-discovery.ts +++ b/src/foreign-tmux-discovery.ts @@ -34,16 +34,16 @@ import { promisify } from 'node:util'; import { buildForeignProbeScript, classifyForeignPaneMode, + foreignRemoteShellCommand, foreignSessionId, isAdoptableSessionName, isAdoptableSocketPath, isCodemanOwnedPane, parseForeignProbeOutput, } from './foreign-tmux.js'; -import { buildDockerBaseArgs, shellescape } from './docker-hosts.js'; -import { buildSshConnectionArgs, remoteSshTarget } from './remote-hosts.js'; -import { readDockerCases, readDockerHosts } from './docker-hosts.js'; -import { readRemoteHosts } from './remote-hosts.js'; +import { dockerEngineArgv, readDockerCases, readDockerHosts } from './docker-hosts.js'; +import { buildSshConnectionArgs, readRemoteHosts, remoteSshTarget, shellescape } from './remote-hosts.js'; +import { runWithRemoteSshLimit } from './remote-ssh-limiter.js'; import { resolveTmuxSocketName, getDataDir } from './config/instance.js'; import { FOREIGN_CACHE_TTL_MS, FOREIGN_PROBE_MAX_BYTES, FOREIGN_PROBE_TIMEOUT_MS } from './config/foreign-tmux.js'; import type { ForeignDiscoveryResult, ForeignTmuxSession } from './types/foreign-tmux.js'; @@ -63,13 +63,18 @@ const PROBE_OPTS = { /** * Turn one probe's stdout into candidates. Shared by all three transports, so a * container's sessions and the host's are classified by identical rules. + * + * `where` opens every note this scan writes (`local`, `docker `, `remote + *