feat(web): suggest ssh hosts in a dropdown under the host field (#9171)

Co-authored-by: shivam <[email protected]>
This commit is contained in:
oliverandshivam authored and GitHub committed 2026-09-03 06:07:50 +00:00
1 parent 9f9359bd81
commit b5f4e8137b
9 files changed
+365 -185

No files matched your search

@@ -5,6 +5,7 @@ import type {
} from "@t3tools/contracts";
import * as NetService from "@t3tools/shared/Net";
import * as SshAuth from "@t3tools/ssh/auth";
import { resolveSshTarget } from "@t3tools/ssh/command";
import { discoverSshHosts } from "@t3tools/ssh/config";
import {
SshCommandError,
@@ -54,6 +55,9 @@ export class DesktopSshEnvironment extends Context.Service<
readonly discoverHosts: (input?: {
readonly homeDir?: string;
}) => Effect.Effect<readonly DesktopDiscoveredSshHost[], DesktopSshEnvironmentDiscoverError>;
readonly resolveHost: (
alias: string,
) => Effect.Effect<DesktopSshEnvironmentTarget, SshCommandError | SshInvalidTargetError>;
readonly ensureEnvironment: (
target: DesktopSshEnvironmentTarget,
options?: { readonly issuePairingToken?: boolean },
@@ -136,6 +140,11 @@ export const make = Effect.gen(function* () {
Effect.provide(runtimeContext),
Effect.withSpan("desktop.ssh.discoverHosts"),
),
resolveHost: (alias) =>
resolveSshTarget(alias.trim()).pipe(
Effect.provide(runtimeContext),
Effect.withSpan("desktop.ssh.resolveHost"),
),
ensureEnvironment: (target, ensureOptions) =>
manager
.ensureEnvironment(target, ensureOptions)