ClaudeCode.Message.AuthStatusMessage (ClaudeCode v0.29.0)

View Source

Represents an authentication status message from the Claude CLI.

Emitted during authentication flows, such as when the CLI is authenticating with the API or handling OAuth flows.

Fields

  • :is_authenticating - Whether authentication is in progress
  • :output - List of output strings from the auth process
  • :error - Error message if authentication failed (optional)
  • :uuid - Message UUID
  • :session_id - Session identifier

JSON Format

{
  "type": "auth_status",
  "isAuthenticating": true,
  "output": ["Authenticating..."],
  "uuid": "...",
  "session_id": "..."
}

Summary

Functions

Type guard to check if a value is an AuthStatusMessage.

Creates a new AuthStatusMessage from JSON data.

Types

t()

@type t() :: %ClaudeCode.Message.AuthStatusMessage{
  error: String.t() | nil,
  is_authenticating: boolean(),
  output: [String.t()],
  session_id: String.t(),
  type: :auth_status,
  uuid: String.t() | nil
}

Functions

auth_status_message?(arg1)

@spec auth_status_message?(any()) :: boolean()

Type guard to check if a value is an AuthStatusMessage.

new(json)

@spec new(map()) :: {:ok, t()} | {:error, atom()}

Creates a new AuthStatusMessage from JSON data.

Examples

iex> AuthStatusMessage.new(%{
...>   "type" => "auth_status",
...>   "isAuthenticating" => true,
...>   "output" => ["Authenticating..."],
...>   "session_id" => "session-1"
...> })
{:ok, %AuthStatusMessage{type: :auth_status, ...}}

iex> AuthStatusMessage.new(%{"type" => "assistant"})
{:error, :invalid_message_type}