# `PtcRunner.Kernel.ProviderRuntimeServices`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/kernel/provider_runtime_services.ex#L1)

Sealed services supplied only when active provider runtime is opened.

Construction is process-free and invokes no resolver or context factory.
Activation may start one private host authority, and OAuth context creation
remains lazy until a selected catalog requires it. The context factory
receives the registry's absolute operation deadline and must pass it through
unchanged rather than creating a fresh budget. It runs in a worker bounded by
that deadline, so it must return a value rather than retain process identity;
activation cannot be bounded the same way because the authority it returns is
owned by whichever process created it.
Provider application mode declares whether selected optional applications
must be host-started or may be started by a command-owned VM.
An opaque keyed binding prevents host services from opening a catalog built
from a different host document without exposing credential declarations.

# `activation`

```elixir
@type activation() :: (-&gt; {:ok, struct() | nil} | {:error, term()})
```

# `credential_resolver`

```elixir
@type credential_resolver() :: ([binary()] -&gt;
                            {:ok, %{required(binary()) =&gt; binary()}}
                            | {:error, term()})
```

# `oauth_mode`

```elixir
@type oauth_mode() ::
  :disabled
  | {:context_factory,
     (PtcRunner.Kernel.Deadline.t() -&gt;
        {:ok, PtcRunner.Kernel.MCPOAuth.Context.t()} | {:error, term()})}
```

# `t`

```elixir
@type t() :: %PtcRunner.Kernel.ProviderRuntimeServices{
  activation: activation(),
  attestation: binary() | nil,
  credential_resolver: credential_resolver(),
  host_payload: struct() | nil,
  oauth_mode: oauth_mode(),
  provider_application_mode: :host_owned | :command_vm,
  runtime_binding: binary() | nil
}
```

# `new`

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

Validates and seals runtime services without invoking them.

# `valid?`

```elixir
@spec valid?(term()) :: boolean()
```

Checks the complete sealed runtime-services value.

---

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