Vibe.Plugin.Manager (vibe v0.2.0)

Copy Markdown View Source

Supervised plugin lifecycle, discovery, and dispatch.

Summary

Types

plugin_entry()

@type plugin_entry() :: %{state: term(), children: [pid()]}

Functions

apis()

@spec apis() :: [Vibe.Plugin.API.t()]

before_command(command, context \\ %{})

@spec before_command(String.t(), map()) ::
  :ok | {:warn, String.t()} | {:block, String.t()}

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

commands()

@spec commands() :: [module()]

context(messages, context \\ %{})

@spec context(list(), map()) :: {:ok, list()} | list()

dispatch(type, payload \\ %{}, context \\ %{})

@spec dispatch(atom(), map(), map()) ::
  {:ok, [term()]} | {:halt, term()} | {:error, term()}

load(module, opts \\ [])

@spec load(
  module(),
  keyword()
) :: :ok | {:error, term()}

plugins()

@spec plugins() :: [module()]

start_link(opts \\ [])

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

system_prompt_blocks(context \\ %{})

@spec system_prompt_blocks(map()) :: [String.t()]

tool_call(call, context \\ %{})

@spec tool_call(map(), map()) :: :ok | {:ok, map()} | {:block, String.t()}

tool_result(result, context \\ %{})

@spec tool_result(map(), map()) :: :ok | {:ok, map()}

ui_document(module)

@spec ui_document(module()) :: Vibe.UI.Document.t()

unload(module)

@spec unload(module()) :: :ok