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
A new instance of DSL.
-
#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
Returns a new instance of DSL.
92 93 94 95 |
# File 'lib/kward/plugin_registry.rb', line 92 def initialize(registry, path) @registry = registry @path = path end |
Instance Method Details
#command(name, description: "", argument_hint: "") {|args, ctx| ... } ⇒ Object
Registers a slash command.
104 105 106 |
# File 'lib/kward/plugin_registry.rb', line 104 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.
111 112 113 |
# File 'lib/kward/plugin_registry.rb', line 111 def (&block) @registry.(path: @path, &block) end |
#on_transcript_event {|event, ctx| ... } ⇒ Object
Registers a live transcript event observer.
119 120 121 |
# File 'lib/kward/plugin_registry.rb', line 119 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.
126 127 128 |
# File 'lib/kward/plugin_registry.rb', line 126 def prompt_context(&block) @registry.register_prompt_context(path: @path, &block) end |