Urchin.Capabilities (Urchin v0.1.0)

Copy Markdown View Source

Builds the ServerCapabilities object returned in the initialize result and parses the ClientCapabilities received from the client.

A capability group is only advertised when the corresponding feature is enabled, matching the schema's "present if supported" semantics.

Summary

Functions

Builds the wire-shape server capabilities map from resolved feature flags.

Types

feature_flags()

@type feature_flags() :: %{
  optional(:tools) => %{optional(:list_changed) => boolean()},
  optional(:resources) => %{
    optional(:subscribe) => boolean(),
    optional(:list_changed) => boolean()
  },
  optional(:prompts) => %{optional(:list_changed) => boolean()},
  optional(:logging) => boolean(),
  optional(:completions) => boolean(),
  optional(:experimental) => map()
}

Functions

server(flags)

@spec server(feature_flags() | keyword()) :: map()

Builds the wire-shape server capabilities map from resolved feature flags.

Only enabled groups are included. Sub-flags such as listChanged/subscribe default to false when omitted.