# `Jidoka.Agent.Spec.Operation`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/agent/spec/operation.ex#L1)

Model-callable operation definition.

# `idempotency`

```elixir
@type idempotency() :: :pure | :idempotent | :dedupe | :reconcile | :unsafe_once
```

# `t`

```elixir
@type t() :: %Jidoka.Agent.Spec.Operation{
  approval: nil | nil | any(),
  description: nil | nil | binary(),
  idempotency: (((:pure | :idempotent) | :dedupe) | :reconcile) | :unsafe_once,
  metadata: map(),
  name: binary()
}
```

# `approval_required?`

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

Returns true when this operation has a built-in approval policy.

# `from_input`

```elixir
@spec from_input(t() | keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Normalizes an existing operation specification, keyword list, or map.

# `kind`

```elixir
@spec kind(t()) :: atom()
```

Returns the operation kind used for control matching and policy checks.

Direct operations default to `:operation`. Adapters can set `:kind`,
`:operation_kind`, `:source_kind`, `:runtime`, or `:source` metadata to
expose a more precise kind while preserving one operation contract.

# `new`

```elixir
@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Builds an operation specification from keyword or map attributes.

# `new!`

```elixir
@spec new!(keyword() | map()) :: t()
```

Builds an operation specification and raises if the attributes are invalid.

# `replay_safe?`

```elixir
@spec replay_safe?(t() | idempotency()) :: boolean()
```

Returns true when a recorded intent may be retried without reconciliation.

# `requires_control?`

```elixir
@spec requires_control?(t() | idempotency()) :: boolean()
```

Returns true when this operation requires an explicit operation control.

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for an agent operation.

# `valid_idempotencies`

```elixir
@spec valid_idempotencies() :: [idempotency()]
```

Returns the supported operation idempotency policies.

---

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