# `Spectre.Prompt.Operation`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/prompt/operation.ex#L1)

One typed prompt-composition declaration compiled from `inject`.

# `position`

```elixir
@type position() :: :start | :end | :replace
```

# `source`

```elixir
@type source() :: {:prompt, atom() | String.t()} | {:provider, module(), atom()}
```

# `t`

```elixir
@type t() :: %Spectre.Prompt.Operation{
  condition: nil | {module(), atom()} | function(),
  id: term(),
  opts: keyword(),
  position: position(),
  required?: boolean(),
  scope: term(),
  source: source(),
  source_line: non_neg_integer() | nil,
  target: target(),
  trust: :instruction | :data
}
```

# `target`

```elixir
@type target() :: :instructions | :context | :task
```

# `new`

```elixir
@spec new(term(), keyword(), term()) :: t()
```

Builds and validates an injection operation.

# `normalize`

```elixir
@spec normalize(term(), term()) :: [t()]
```

Normalizes handler/runtime `inject:` specifications into operations.

A specification may be an operation, a prompt atom/string, a keyword list,
or a list containing those shapes.

# `put_scope`

```elixir
@spec put_scope(t(), term()) :: t()
```

Assigns a materialized runtime scope to an operation.

---

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