MingaEditor.Agent.SemanticUI.Registry (Minga v0.1.0)

Copy Markdown View Source

Source-owned registry for semantic agent UI contributions.

Extensions and bundles register cached Minga.RenderModel.UI.* values here. Render builders and input handlers read the ETS table directly, so frame and keystroke hot paths never invoke extension render callbacks.

Summary

Types

Existing render-model payload stored by an entry.

Registration attributes.

Source that owns semantic UI entries.

Semantic surface name.

Registry table name.

Functions

Returns all entries ordered by priority and id.

Returns the default production registry table.

Dispatches a semantic action through the editor command pipeline.

Returns all entries for a semantic surface ordered by priority and id.

Returns an entry by id.

Returns cached extension-panel panels contributed to agent UI.

Publishes a new cached render-model payload for an existing entry.

Registers or replaces a source-owned semantic UI entry.

Registers a source-owned batch, replacing all prior entries owned by the same source.

Starts the semantic UI registry.

Returns the semantic UI registry table for a state-like value.

Returns cached transcript enrichment bodies.

Unregisters an entry when it is owned by the caller's source.

Removes every semantic UI entry owned by a source.

Types

payload()

Existing render-model payload stored by an entry.

register_attrs()

@type register_attrs() :: %{
  :id => String.t(),
  :surface => surface(),
  :payload => payload(),
  optional(:target) => term(),
  optional(:priority) => integer(),
  optional(:actions) => [Minga.RenderModel.UI.Action.t() | map() | keyword()]
}

Registration attributes.

source()

Source that owns semantic UI entries.

state()

@type state() :: table()

surface()

Semantic surface name.

table()

@type table() :: atom()

Registry table name.

Functions

all()

Returns all entries ordered by priority and id.

all(table)

default_table()

@spec default_table() :: table()

Returns the default production registry table.

dispatch_action(state, entry_id, action_id, context \\ %{})

@spec dispatch_action(MingaEditor.State.t(), String.t(), String.t(), map()) ::
  MingaEditor.State.t()

Dispatches a semantic action through the editor command pipeline.

dispatch_action(table, state, entry_id, action_id, context)

@spec dispatch_action(table(), MingaEditor.State.t(), String.t(), String.t(), map()) ::
  MingaEditor.State.t()

entries(surface)

Returns all entries for a semantic surface ordered by priority and id.

entries(table, surface)

get(id)

Returns an entry by id.

get(table, id)

panels()

Returns cached extension-panel panels contributed to agent UI.

panels(table)

publish(source, id, payload, actions \\ nil)

@spec publish(
  source(),
  String.t(),
  payload(),
  [Minga.RenderModel.UI.Action.t() | map() | keyword()] | nil
) :: :ok | {:error, term()}

Publishes a new cached render-model payload for an existing entry.

publish(table, source, id, payload, actions)

@spec publish(
  table(),
  source(),
  String.t(),
  payload(),
  [Minga.RenderModel.UI.Action.t() | map() | keyword()] | nil
) :: :ok | {:error, term()}

register(source, attrs)

@spec register(
  source(),
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
) ::
  :ok | {:error, term()}

Registers or replaces a source-owned semantic UI entry.

register(table, source, attrs)

@spec register(
  table(),
  source(),
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
) ::
  :ok | {:error, term()}

register_many(source, entries)

@spec register_many(source(), [
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
]) ::
  :ok | {:error, term()}

Registers a source-owned batch, replacing all prior entries owned by the same source.

register_many(table, source, entries)

@spec register_many(table(), source(), [
  register_attrs() | MingaEditor.Agent.SemanticUI.Entry.t() | keyword()
]) :: :ok | {:error, term()}

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts the semantic UI registry.

table_for(arg1)

@spec table_for(map() | nil) :: table()

Returns the semantic UI registry table for a state-like value.

transcript_enrichments()

@spec transcript_enrichments() :: [
  {pos_integer(), Minga.RenderModel.UI.AgentChat.message_body()}
]

Returns cached transcript enrichment bodies.

transcript_enrichments(table)

@spec transcript_enrichments(table()) :: [
  {pos_integer(), Minga.RenderModel.UI.AgentChat.message_body()}
]

unregister(source, id)

@spec unregister(source(), String.t()) :: :ok | {:error, term()}

Unregisters an entry when it is owned by the caller's source.

unregister(table, source, id)

@spec unregister(table(), source(), String.t()) :: :ok | {:error, term()}

unregister_source(source)

@spec unregister_source(source()) :: :ok

Removes every semantic UI entry owned by a source.

unregister_source(table, source)

@spec unregister_source(table(), source()) :: :ok