/** * Protocol handler for `ssh://host/path` URLs. * * Resolves a remote text file or directory listing on a pre-configured SSH host — or any * destination OpenSSH can resolve itself (e.g. a `~/.ssh/config` alias) — for * the read, search, and write tools, reusing the shared ControlMaster * connection in `../ssh/connection-manager`. * * A remote path resolves to a UTF-8 text file (≤ 1 MiB) or, when it is a * directory, a one-level listing. Binary/non-UTF-8 or oversized files are * rejected with an explicit error. This handler exposes no `sourcePath`; * structured directory entries let the URL filesystem traverse remote * contents without ever searching the rendered listing text. * * `loadCapability` is imported from `../capability` (not the `../discovery` * barrel) on purpose — pulling the barrel here would route * `path-utils -> internal-urls -> ssh-protocol -> discovery -> path-utils` and * eager-load every provider on any `path-utils` import. Runtime bootstraps the * SSH provider via `import "./discovery"` (sdk.ts) / `initializeWithSettings` * (main.ts) before any tool resolves. */ import { type ShellFsDirEntry } from "@oh-my-pi/pi-natives"; import type { InternalResource, InternalUrl, ProtocolHandler, ResolveContext, SchemeSpec, UrlCompletion, WriteContext } from "./types.js"; export declare class SshProtocolHandler implements ProtocolHandler { #private; readonly scheme = "ssh"; readonly spec: SchemeSpec; /** Advertised only when an `ssh` client is on PATH. */ promptDoc(): string | undefined; resolve(url: InternalUrl, context?: ResolveContext): Promise; /** Immediate remote entries for native traversal; paths and results remain ssh:// URLs. */ readDirectory(url: InternalUrl, context?: ResolveContext): Promise; /** Autocomplete the host segment of `ssh://` with the configured SSH hosts. */ complete(_query?: string, context?: ResolveContext): Promise; write(url: InternalUrl, content: string, context?: WriteContext): Promise; }