Skip to main content

Module steps

Module steps 

Source
Expand description

The steps of spawn_auth_cli: one login session’s state (Login), the piped-stdio run and the PTY run of the provider CLI, and how each ends the session (success saved, failure, or ended meanwhile).

StructsΒ§

Ended πŸ”’
The session ended (replaced, cancelled, timed out) before its login could be saved.
Login πŸ”’
One login session: where it is recorded, where it saves, and the CLI that runs it and checks it.
Started πŸ”’
The PTY, the child on it, and the ends of the PTY the run reads and writes.

FunctionsΒ§

drain_stderr πŸ”’
Feed stderr into the session: some CLIs print the OAuth URL there.
drain_stdout πŸ”’
Feed stdout into the session; on a login-success line that the auth check confirms, save the account.
forward_stdin πŸ”’
Forward pasted callback URLs to the CLI’s stdin until the sender is dropped.
open_pty πŸ”’
Allocate the PTY. None (the session already failed) when the OS cannot give one.
pty_drain πŸ”’
Read the PTY line by line into the session. Returns the detached confirm-and-save task of a login-success line.
run_piped πŸ”’
run_pty πŸ”’
save_when_confirmed πŸ”’
The detached half of a PTY login-success line: confirm it, save the account, and mark the success transitioned.
settle_piped_exit πŸ”’
End the session by how the CLI exited, when its output did not already: Err when the session ended first.
settle_pty_exit πŸ”’
End the session by how the PTY child exited, when its output did not already: Err when the session ended first.
spawn_auth_cli_pty πŸ”’
PTY-backed variant of spawn_auth_cli. Used for providers whose auth subcommand bails on isatty()==0 (currently OpenClaw). Mirrors the pipes path’s lifecycle: spawn β†’ drain β†’ confirm β†’ finish_success or finish_failure β†’ detach. Stdout+stderr are merged on the PTY side; record_line doesn’t care which stream a line came from.
spawn_piped πŸ”’
The piped-stdio run: the task is attached to the session so cancelling it aborts the CLI.
spawn_piped_child πŸ”’
Spawn the provider CLI with piped stdio. None (the session already failed) when it cannot be started.
start_pty πŸ”’
Allocate the PTY, spawn the provider CLI on it and register its PID. None (the session already failed) when any of that cannot be done.