Module: Legion::Extensions::Agentic::Memory::Paleontology::Runners::CognitivePaleontology
- Extended by:
- CognitivePaleontology
- Includes:
- Helpers::Lex
- Included in:
- Client, CognitivePaleontology
- Defined in:
- lib/legion/extensions/agentic/memory/paleontology/runners/cognitive_paleontology.rb
Instance Method Summary collapse
- #begin_excavation(target_stratum:, engine: nil) ⇒ Object
- #complete_excavation(excavation_id:, engine: nil) ⇒ Object
- #excavate(excavation_id:, engine: nil) ⇒ Object
- #list_fossils(engine: nil, fossil_type: nil, extinction_cause: nil) ⇒ Object
- #paleontology_status(engine: nil) ⇒ Object
- #record_extinction(fossil_type:, domain:, content:, extinction_cause:, stratum_depth: 0, significance: nil, engine: nil) ⇒ Object
Instance Method Details
#begin_excavation(target_stratum:, engine: nil) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/legion/extensions/agentic/memory/paleontology/runners/cognitive_paleontology.rb', line 26 def begin_excavation(target_stratum:, engine: nil, **) eng = resolve_engine(engine) exc = eng.begin_excavation(target_stratum: target_stratum) { success: true, excavation: exc.to_h } rescue ArgumentError => e { success: false, error: e. } end |
#complete_excavation(excavation_id:, engine: nil) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/legion/extensions/agentic/memory/paleontology/runners/cognitive_paleontology.rb', line 46 def complete_excavation(excavation_id:, engine: nil, **) eng = resolve_engine(engine) exc = eng.complete_excavation(excavation_id: excavation_id) { success: true, excavation: exc.to_h } rescue ArgumentError => e { success: false, error: e. } end |
#excavate(excavation_id:, engine: nil) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/legion/extensions/agentic/memory/paleontology/runners/cognitive_paleontology.rb', line 34 def excavate(excavation_id:, engine: nil, **) eng = resolve_engine(engine) fossil = eng.excavate!(excavation_id: excavation_id) if fossil { success: true, fossil: fossil.to_h } else { success: true, fossil: nil, message: 'no fossils at this stratum' } end rescue ArgumentError => e { success: false, error: e. } end |
#list_fossils(engine: nil, fossil_type: nil, extinction_cause: nil) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/legion/extensions/agentic/memory/paleontology/runners/cognitive_paleontology.rb', line 54 def list_fossils(engine: nil, fossil_type: nil, extinction_cause: nil, **) eng = resolve_engine(engine) results = filter_fossils(eng.all_fossils, fossil_type: fossil_type, extinction_cause: extinction_cause) { success: true, fossils: results.map(&:to_h), count: results.size } end |
#paleontology_status(engine: nil) ⇒ Object
64 65 66 67 |
# File 'lib/legion/extensions/agentic/memory/paleontology/runners/cognitive_paleontology.rb', line 64 def paleontology_status(engine: nil, **) eng = resolve_engine(engine) { success: true, report: eng.paleontology_report } end |
#record_extinction(fossil_type:, domain:, content:, extinction_cause:, stratum_depth: 0, significance: nil, engine: nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/legion/extensions/agentic/memory/paleontology/runners/cognitive_paleontology.rb', line 12 def record_extinction(fossil_type:, domain:, content:, extinction_cause:, stratum_depth: 0, significance: nil, engine: nil, **) eng = resolve_engine(engine) fossil = eng.record_extinction( fossil_type: fossil_type, domain: domain, content: content, extinction_cause: extinction_cause, stratum_depth: stratum_depth, significance: significance ) { success: true, fossil: fossil.to_h } rescue ArgumentError => e { success: false, error: e. } end |