Module: Legion::Extensions::Agentic::Attention::Spotlight::Runners::AttentionSpotlight
- Includes:
- Helpers::Lex
- Included in:
- Client
- Defined in:
- lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb
Instance Method Summary collapse
- #broaden_spotlight ⇒ Object
- #check_capture ⇒ Object
- #check_peripheral ⇒ Object
- #focus_spotlight(target_id:) ⇒ Object
- #most_salient(limit: 5) ⇒ Object
- #narrow_spotlight ⇒ Object
- #register_target(label:, domain:, salience: 0.5, relevance: 0.5) ⇒ Object
- #release_focus ⇒ Object
- #scan_targets ⇒ Object
- #spotlight_report ⇒ Object
- #spotlight_state ⇒ Object
Instance Method Details
#broaden_spotlight ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 32 def broaden_spotlight(**) log.debug('[attention_spotlight] broadening spotlight') result = engine.broaden { success: true, **result } rescue StandardError => e log.error("[attention_spotlight] broaden_spotlight error: #{e.}") { success: false, error: e. } end |
#check_capture ⇒ Object
68 69 70 71 72 73 74 75 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 68 def check_capture(**) log.debug('[attention_spotlight] checking for attention capture') result = engine.check_capture { success: true, **result } rescue StandardError => e log.error("[attention_spotlight] check_capture error: #{e.}") { success: false, error: e. } end |
#check_peripheral ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 59 def check_peripheral(**) log.debug('[attention_spotlight] checking periphery') result = engine.check_peripheral { success: true, **result } rescue StandardError => e log.error("[attention_spotlight] check_peripheral error: #{e.}") { success: false, error: e. } end |
#focus_spotlight(target_id:) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 23 def focus_spotlight(target_id:, **) log.debug("[attention_spotlight] focus target_id=#{target_id[0..7]}") result = engine.focus(target_id: target_id) { success: result[:focused], **result } rescue StandardError => e log.error("[attention_spotlight] focus_spotlight error: #{e.}") { success: false, error: e. } end |
#most_salient(limit: 5) ⇒ Object
95 96 97 98 99 100 101 102 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 95 def most_salient(limit: 5, **) log.debug("[attention_spotlight] most_salient limit=#{limit}") targets = engine.most_salient(limit: limit) { success: true, targets: targets.map(&:to_h), count: targets.size } rescue StandardError => e log.error("[attention_spotlight] most_salient error: #{e.}") { success: false, error: e. } end |
#narrow_spotlight ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 41 def narrow_spotlight(**) log.debug('[attention_spotlight] narrowing spotlight') result = engine.narrow { success: true, **result } rescue StandardError => e log.error("[attention_spotlight] narrow_spotlight error: #{e.}") { success: false, error: e. } end |
#register_target(label:, domain:, salience: 0.5, relevance: 0.5) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 13 def register_target(label:, domain:, salience: 0.5, relevance: 0.5, **) log.debug("[attention_spotlight] register target label=#{label} domain=#{domain}") result = engine.register_target(label: label, domain: domain, salience: salience, relevance: relevance) { success: result[:registered], **result } rescue StandardError => e log.error("[attention_spotlight] register_target error: #{e.}") { success: false, error: e. } end |
#release_focus ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 77 def release_focus(**) log.debug('[attention_spotlight] releasing focus') result = engine.release_focus { success: true, **result } rescue StandardError => e log.error("[attention_spotlight] release_focus error: #{e.}") { success: false, error: e. } end |
#scan_targets ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 50 def scan_targets(**) log.debug('[attention_spotlight] initiating scan') result = engine.scan { success: true, **result } rescue StandardError => e log.error("[attention_spotlight] scan_targets error: #{e.}") { success: false, error: e. } end |
#spotlight_report ⇒ Object
86 87 88 89 90 91 92 93 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 86 def spotlight_report(**) log.debug('[attention_spotlight] generating report') report = engine.spotlight_report { success: true, **report } rescue StandardError => e log.error("[attention_spotlight] spotlight_report error: #{e.}") { success: false, error: e. } end |
#spotlight_state ⇒ Object
104 105 106 107 108 109 |
# File 'lib/legion/extensions/agentic/attention/spotlight/runners/attention_spotlight.rb', line 104 def spotlight_state(**) { success: true, **engine.to_h } rescue StandardError => e log.error("[attention_spotlight] spotlight_state error: #{e.}") { success: false, error: e. } end |