Snodo.Subscription.Event (snodo v0.1.0)

Copy Markdown View Source

A protocol-neutral event emitted by an application subscription source.

Constructors cover the core subscriptions/listen notification families and a generic extension-owned event envelope. The selected protocol dialect or negotiated extension adds wire method names and subscription metadata later, at the transport boundary.

Summary

Functions

Builds an event owned and wire-shaped by a negotiated extension.

Builds a notifications/prompts/list_changed event.

Builds a notifications/resources/updated event for one absolute URI.

Builds a notifications/resources/list_changed event.

Builds a notifications/tools/list_changed event.

Types

kind()

@type kind() ::
  :tools_list_changed
  | :prompts_list_changed
  | :resources_list_changed
  | :resource_updated
  | :extension

t()

@type t() :: %Snodo.Subscription.Event{
  extension_id: String.t() | nil,
  kind: kind(),
  metadata: map(),
  params: map(),
  payload: term(),
  selector: map(),
  uri: String.t() | nil
}

Functions

extension(extension_id, selector, payload, opts \\ [])

@spec extension(String.t(), map(), term(), keyword()) :: t()

Builds an event owned and wire-shaped by a negotiated extension.

prompts_list_changed(opts \\ [])

@spec prompts_list_changed(keyword()) :: t()

Builds a notifications/prompts/list_changed event.

resource_updated(uri, opts \\ [])

@spec resource_updated(String.t(), keyword()) :: t()

Builds a notifications/resources/updated event for one absolute URI.

resources_list_changed(opts \\ [])

@spec resources_list_changed(keyword()) :: t()

Builds a notifications/resources/list_changed event.

tools_list_changed(opts \\ [])

@spec tools_list_changed(keyword()) :: t()

Builds a notifications/tools/list_changed event.