Raxol.AgentClientProtocol.Schema.ClientTypes.PermissionOptionKind (Raxol Agent Client Protocol v0.1.0)

Copy Markdown View Source

Hint about the nature of a PermissionOption, so clients can choose appropriate icons/UI treatment.

Unlike ToolKind/ToolCallStatus elsewhere in this schema layer, decode here is deliberately not infallible-with-a-default: the ACP schema documents no default for this enum (no x-deserialize-default-on-error), and silently coercing an unrecognized permission-option kind to some arbitrary member (e.g. :reject_once) would misrepresent a safety-relevant value rather than gracefully degrade one. An unrecognized wire value is a decode error instead.

Ported from the MIT f1729/agent_client_protocol (c) 2025 f1729; see NOTICE.md.

Summary

Functions

Total: never raises. An unrecognized wire value is an error, not a silently-coerced default.

Types

t()

@type t() :: :allow_once | :allow_always | :reject_once | :reject_always

Functions

from_json(other)

@spec from_json(term()) ::
  {:ok, t()} | {:error, {:invalid_permission_option_kind, term()}}

Total: never raises. An unrecognized wire value is an error, not a silently-coerced default.

to_json(atom)

@spec to_json(t()) :: String.t()