# `Spectre.Result`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/types/result.ex#L1)

Output of a handled turn.

Results carry everything the host boundary needs after a turn: user-visible
reply text, updated state, effects, awaitables, route metadata, and events
for logging.

    {:ok, %Spectre.Result{reply_text: text, state: state}} =
      Spectre.ask(MyAgent, "hello")

# `t`

```elixir
@type t() :: %Spectre.Result{
  awaitables: [Spectre.Awaitable.t()],
  effects: [Spectre.Effect.t()],
  events: [term()],
  input: Spectre.Input.t() | nil,
  metadata: map(),
  reply_text: String.t(),
  route: Spectre.Route.t() | nil,
  state: Spectre.State.t() | nil
}
```

# `action_outcome`

```elixir
@spec action_outcome(t()) :: Spectre.Effect.outcome()
```

Normalizes the latest terminal action effect into a host-facing outcome.

# `completions`

```elixir
@spec completions(t()) :: [Spectre.Effect.t() | Spectre.Awaitable.t()]
```

Returns every terminal lifecycle transition emitted by this result.

# `latest_completion`

```elixir
@spec latest_completion(t()) :: Spectre.Effect.t() | Spectre.Awaitable.t() | nil
```

Returns the completion with the same precedence used by turn decisions:
effect transitions first, then awaitables.

# `lifecycle`

```elixir
@spec lifecycle(t()) :: map()
```

Returns a compact, normalized lifecycle view for host turn dispatch.

# `open_awaitable`

```elixir
@spec open_awaitable(t()) :: Spectre.Awaitable.t() | nil
```

Returns the active awaitable from authoritative state, falling back to the
transition-local awaitables carried by the result.

# `pending_effect`

```elixir
@spec pending_effect(t()) :: Spectre.Effect.t() | nil
```

Returns the current pending effect from authoritative state, or from a
state-less result assembled by a host.

# `visible_reply?`

```elixir
@spec visible_reply?(t()) :: boolean()
```

Returns whether the result contains non-blank user-visible reply text.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
