PtcRunner.Kernel.ProviderRuntimeServices (PtcRunner v0.14.0)

Copy Markdown View Source

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.

Summary

Functions

Validates and seals runtime services without invoking them.

Checks the complete sealed runtime-services value.

Types

activation()

@type activation() :: (-> {:ok, struct() | nil} | {:error, term()})

credential_resolver()

@type credential_resolver() :: ([binary()] ->
                            {:ok, %{required(binary()) => binary()}}
                            | {:error, term()})

oauth_mode()

@type oauth_mode() ::
  :disabled
  | {:context_factory,
     (PtcRunner.Kernel.Deadline.t() ->
        {:ok, PtcRunner.Kernel.MCPOAuth.Context.t()} | {:error, term()})}

t()

@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
}

Functions

new(opts \\ [])

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

Validates and seals runtime services without invoking them.

valid?(services)

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

Checks the complete sealed runtime-services value.