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

Behaviour and compiler for operation sources.

Operation sources normalize external executable surfaces into
`Jidoka.Agent.Spec.Operation` data plus one runtime capability. The turn loop
still sees a single operation model.

# `compiled`

```elixir
@type compiled() :: %{
  operations: [Jidoka.Agent.Spec.Operation.t()],
  capability: Jidoka.Operation.Capability.t(),
  metadata: [map()]
}
```

# `source`

```elixir
@type source() :: struct()
```

# `capability`

```elixir
@callback capability(
  source(),
  keyword()
) :: {:ok, Jidoka.Operation.Capability.t()} | {:error, term()}
```

Returns the runtime capability that executes operations from a source.

# `metadata`
*optional* 

```elixir
@callback metadata(
  source(),
  keyword()
) :: {:ok, [map()]} | {:error, term()}
```

Returns portable source metadata when the source supports it.

# `operations`

```elixir
@callback operations(
  source(),
  keyword()
) :: {:ok, [Jidoka.Agent.Spec.Operation.t()]} | {:error, term()}
```

Returns the model-visible operations exposed by a source.

# `capability`

```elixir
@spec capability(
  source(),
  keyword()
) :: {:ok, Jidoka.Operation.Capability.t()} | {:error, term()}
```

Loads the runtime capability from one operation source.

# `compile`

```elixir
@spec compile(
  [source()] | source(),
  keyword()
) :: {:ok, compiled()} | {:error, term()}
```

Compiles one or more sources into operation data and one routed capability.

# `metadata`

```elixir
@spec metadata(
  source(),
  keyword()
) :: {:ok, [map()]} | {:error, term()}
```

Loads portable metadata from one operation source.

# `operations`

```elixir
@spec operations(
  source(),
  keyword()
) :: {:ok, [Jidoka.Agent.Spec.Operation.t()]} | {:error, term()}
```

Loads model-visible operations from one operation source.

---

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