{"modulePath":"github.com/pencode-labs/pencode","version":"v0.1.0-rc.15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package remote\n\nPackage remote connects to headless servers through SSH or WebSocket. SSH authentication, config, agent and known\\_hosts belong to OpenSSH.\n\n## Constants\n\n```go\nconst OutputChannelName = \"Remote Development\"\n```\n\n## Functions\n\n```go\nfunc ConnectWebSocket(ctx context.Context, target WebSocketTarget, progress func(string)) (io.ReadWriteCloser, error)\n```\n\n```go\nfunc RunAskpass() (bool, error)\n```\nRunAskpass handles OpenSSH's helper invocation before the GUI starts. Only this short-lived helper writes the answer to stdout, which SSH owns.\n\n```go\nfunc ValidateToken(token string) error\n```\nValidateToken restricts tokens to visible ASCII so they travel unchanged in the Authorization header. Tokens are never included in URLs or diagnostics.\n\n```go\nfunc WithPrompt(ctx context.Context, prompt Prompt) context.Context\n```\n\n## Types\n\n```go\ntype AuthenticationPrompt struct {\n\tText    string\n\tConfirm bool\n}\n```\nAuthenticationPrompt distinguishes secrets from explicit yes/no decisions.\n\n```go\ntype Connector struct {\n\tOutput          io.Writer\n\tHTTP            *http.Client // Nil uses http.DefaultClient with the connection context.\n\tExecutable      string       // Empty selects ssh from PATH.\n\tVersion         string       // Empty selects the current build version.\n\tReleaseURL      string       // Empty selects GitHub release downloads.\n\tServerDirectory string       // resources/servers/\u003cos\u003e-\u003carch\u003e/pencode-server.\n\tLocalServer     string       // Adjacent native standalone binary.\n}\n```\n\n```go\nfunc (c Connector) Connect(ctx context.Context, target Target, progress func(string)) (conn io.ReadWriteCloser, err error)\n```\nConnect authenticates once and returns the same encrypted stdio stream after bootstrap. Passwords are requested through askpass and never retained here.\n\n```go\ntype Platform struct{ OS, Arch string }\n```\n\n```go\nfunc (p Platform) String() string\n```\n\n```go\ntype Prompt func(ctx context.Context, prompt AuthenticationPrompt) (string, error)\n```\nPrompt runs outside the UI thread and must return when ctx is canceled.\n\n```go\ntype Target struct {\n\tHost         string `json:\"host\"`\n\tIdentityFile string `json:\"identityFile,omitempty\"`\n\tConfigFile   string `json:\"configFile,omitempty\"`\n\tServerBinary string `json:\"serverBinary,omitempty\"` // Explicit local transfer source.\n\tServerRoot   string `json:\"serverRoot,omitempty\"`   // Absolute POSIX path on the remote host.\n\tPort         uint16 `json:\"port,omitempty\"`\n}\n```\n\n```go\nfunc (t Target) Validate() error\n```\n\n```go\ntype WebSocketTarget struct {\n\tAddress string `json:\"address\"`\n\tToken   string `json:\"token\"`\n}\n```\n\n```go\nfunc (t WebSocketTarget) Validate() error\n```\n\n","path":"github.com/pencode-labs/pencode/remote","name":"remote","synopsis":"Package remote connects to headless servers through SSH or WebSocket.","isRedistributable":true}
