Class: Kward::PluginRegistry::DSL
- Inherits:
-
Object
- Object
- Kward::PluginRegistry::DSL
- Defined in:
- lib/kward/plugin_registry.rb
Overview
DSL object yielded by Kward.plugin blocks.
Instance Method Summary collapse
-
#command(name, description: "", argument_hint: "") {|args, ctx| ... } ⇒ Object
Registers a slash command.
-
#footer {|ctx| ... } ⇒ Object
Registers or replaces the custom footer renderer.
-
#initialize(registry, path) ⇒ DSL
constructor
Creates an object for trusted plugin loading and dispatch.
-
#on_transcript_event {|event, ctx| ... } ⇒ Object
Registers a live transcript event observer.
-
#prompt_context {|ctx| ... } ⇒ Object
Registers prompt context text injected into future system prompts.
Constructor Details
#initialize(registry, path) ⇒ DSL
Creates an object for trusted plugin loading and dispatch.
101 102 103 104 |
# File 'lib/kward/plugin_registry.rb', line 101 def initialize(registry, path) @registry = registry @path = path end |
Instance Method Details
#command(name, description: "", argument_hint: "") {|args, ctx| ... } ⇒ Object
Registers a slash command.
113 114 115 |
# File 'lib/kward/plugin_registry.rb', line 113 def command(name, description: "", argument_hint: "", &block) @registry.register_command(name, description: description, argument_hint: argument_hint, path: @path, &block) end |
#footer {|ctx| ... } ⇒ Object
Registers or replaces the custom footer renderer.
120 121 122 |
# File 'lib/kward/plugin_registry.rb', line 120 def (&block) @registry.(path: @path, &block) end |
#on_transcript_event {|event, ctx| ... } ⇒ Object
Registers a live transcript event observer.
128 129 130 |
# File 'lib/kward/plugin_registry.rb', line 128 def on_transcript_event(&block) @registry.register_transcript_event(path: @path, &block) end |
#prompt_context {|ctx| ... } ⇒ Object
Registers prompt context text injected into future system prompts.
135 136 137 |
# File 'lib/kward/plugin_registry.rb', line 135 def prompt_context(&block) @registry.register_prompt_context(path: @path, &block) end |