ExternalRuntimeTransport.ExecutionSurface.Capabilities (ExternalRuntimeTransport v0.1.0)

Copy Markdown View Source

Typed transport-family and per-session execution-surface capabilities.

Summary

Types

interrupt_kind()

@type interrupt_kind() :: :signal | :stdin | :rpc | :none

key()

@type key() ::
  :remote?
  | :startup_kind
  | :path_semantics
  | :supports_run?
  | :supports_streaming_stdio?
  | :supports_pty?
  | :supports_user?
  | :supports_env?
  | :supports_cwd?
  | :interrupt_kind

path_semantics()

@type path_semantics() :: :local | :remote | :guest

startup_kind()

@type startup_kind() :: :spawn | :attach | :bridge

t()

@type t() :: %ExternalRuntimeTransport.ExecutionSurface.Capabilities{
  interrupt_kind: interrupt_kind(),
  path_semantics: path_semantics(),
  remote?: boolean(),
  startup_kind: startup_kind(),
  supports_cwd?: boolean(),
  supports_env?: boolean(),
  supports_pty?: boolean(),
  supports_run?: boolean(),
  supports_streaming_stdio?: boolean(),
  supports_user?: boolean()
}

validation_error()

@type validation_error() ::
  {:invalid_capabilities, term()}
  | {:invalid_remote, term()}
  | {:invalid_startup_kind, term()}
  | {:invalid_path_semantics, term()}
  | {:invalid_supports_run, term()}
  | {:invalid_supports_streaming_stdio, term()}
  | {:invalid_supports_pty, term()}
  | {:invalid_supports_user, term()}
  | {:invalid_supports_env, term()}
  | {:invalid_supports_cwd, term()}
  | {:invalid_interrupt_kind, term()}

Functions

keys()

@spec keys() :: [key(), ...]

new(capabilities)

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

new!(attrs)

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

satisfies_requirements?(effective, required)

@spec satisfies_requirements?(t(), map() | keyword() | t()) :: boolean()

subset?(effective, maximum)

@spec subset?(t(), t()) :: boolean()

to_map(capabilities)

@spec to_map(t()) :: map()