Resolves default plugin lists for agents.
Default plugins are framework-provided singleton plugins that are automatically included in agents. They can be customized at three levels:
- Package level — Jido ships sensible defaults
- Jido instance level —
use Jido, default_plugins: [...]or app config Agent level —
default_plugins: %{state_key: false | Module | {Module, config}}
Framework Defaults
The framework provides these default plugins:
[Jido.Thread.Plugin, Jido.Agent.Identity.Plugin, Jido.Memory.Plugin]Instance-Level Override
# In use Jido macro
use Jido, otp_app: :my_app, default_plugins: [MyApp.CustomThreadPlugin]
# Or via app config
config :my_app, MyApp.Jido, default_plugins: [MyApp.CustomThreadPlugin]Agent-Level Override
Agents use a map keyed by the default plugin's state_key atom:
use Jido.Agent,
name: "my_agent",
default_plugins: %{__thread__: false}To replace a default with a custom implementation:
use Jido.Agent,
name: "my_agent",
default_plugins: %{__thread__: MyApp.CustomThreadPlugin}Or with configuration:
use Jido.Agent,
name: "my_agent",
default_plugins: %{__thread__: {MyApp.CustomThreadPlugin, %{max_entries: 100}}}Or disable all defaults:
use Jido.Agent, name: "bare", default_plugins: false
Summary
Functions
Applies agent-level overrides to a list of default plugins.
Returns the framework's default plugin list.
Resolves default plugins for a Jido instance.
Functions
@spec apply_agent_overrides([module() | {module(), map()}], nil | false | map()) :: [ module() | {module(), map() | keyword()} ]
Applies agent-level overrides to a list of default plugins.
Parameters
defaults- The resolved default plugin list (from instance or framework)overrides- Agent-level override specification
Override Shapes
nil— no overrides, use all defaults as-isfalse— disable all defaults%{state_key => false}— exclude the default plugin with that state_key%{state_key => Module}— replace with a different module%{state_key => {Module, config}}— replace with module and config
@spec package_defaults() :: [module()]
Returns the framework's default plugin list.
Resolves default plugins for a Jido instance.
This is a macro because Application.compile_env/3 must be called in the
module body of the caller, not inside a function.
Priority (highest wins):
- Explicit
default_pluginsoption passed touse Jido - App config:
config :otp_app, JidoModule, default_plugins: [...] - Framework defaults