# `Minga.Extension.RootSupervisor`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/extension/root_supervisor.ex#L1)

Dynamic supervisor owning one ordered `Root(name)` per declaration.

# `await_instance`

```elixir
@spec await_instance(pid(), atom(), atom()) ::
  {:ok, GenServer.server()} | {:error, term()}
```

Waits through root initialization/restart and returns its permanent authority.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `ensure_root`

```elixir
@spec ensure_root(
  GenServer.server(),
  atom(),
  Minga.Extension.Entry.t(),
  GenServer.server(),
  keyword()
) :: {:ok, GenServer.server()} | {:error, term()}
```

Ensures one root exists and returns its stable Instance server.

# `existing_authority`

```elixir
@spec existing_authority(GenServer.server(), atom(), keyword()) ::
  {:ok, GenServer.server()} | :absent | {:error, term()}
```

Locates an existing root authority, synchronizing through Instance registration.

# `names`

```elixir
@spec names(
  GenServer.server(),
  keyword()
) :: [atom()]
```

Returns declared root names without inspecting runtime children.

# `start_link`

```elixir
@spec start_link(keyword()) :: Supervisor.on_start()
```

Starts the extension root supervisor.

# `terminate_root`

```elixir
@spec terminate_root(GenServer.server(), atom(), keyword()) :: :ok | {:error, term()}
```

Terminates the root for a declaration which no longer exists.

---

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