The helper contract of an SSH_ASKPASS program (commons headless 0011-credential-promptFR-008): the program that ssh runs to ask for a passphrase or a password, given as data and pure functions. ssh runs the helper with the prompt as its one argument and the environment SSH_ASKPASS_PROMPT (confirm for a yes or no, none for a message that needs no answer, absent for a secret), reads the answer from its standard output, and takes a non-zero status as a refusal. runAskpass is the whole helper over a credential port: it reads the request from the arguments, asks once through a session of the library (so the time limit and the typed refusals are the library's), and gives what to write and the status; launcherOf gives the file a system needs so that ssh can run the helper, which on Windows is a .cmd shim and not a script.
The helper writes the answer to its standard output and nothing else there, writes nothing of the answer to its standard error, and keeps nothing: each run of the helper is one command, so a second attempt of ssh is a second prompt (nothing is cached between processes). The prompt text of ssh is not secret and is the credential's id.
typeAskpassRequest=| { readonlykind:"ask"; readonlyrequest:CredentialRequest }
/** A message that needs no answer (`SSH_ASKPASS_PROMPT=none`): shown, and answered with nothing. */| { readonlykind:"inform"; readonlytext:string };
The helper: reads its request, asks once, and gives the answer for ssh to read (a line on the standard output) with status 0, or nothing and status 1 where there was no answer (the reason, with no value in it, on the standard error), or status 2 where its arguments are not a request. A message that needs no answer is shown on the standard error and answered with nothing.
The file that lets ssh run the helper: on Linux and macOS a script that runs the runtime on the helper's entry and passes the arguments on, on Windows a .cmd file that does (ssh there starts the program it is given and does not run a .ts file). The paths are written between quotes, so one that holds a quote, a line break or (on Windows) a percent sign is refused.
The variables ssh needs to run the helper where it has no display and no terminal of its own: force makes it use the helper even with a terminal, so the one prompt is the library's.