lex-agentic-imagination 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +5 -0
- data/LICENSE +21 -0
- data/README.md +13 -0
- data/lex-agentic-imagination.gemspec +34 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/client.rb +15 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/alchemy_engine.rb +140 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/constants.rb +76 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/crucible.rb +80 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/substance.rb +118 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/runners/cognitive_alchemy.rb +88 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/alchemy.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/aurora/client.rb +25 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/aurora_engine.rb +123 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/aurora_event.rb +85 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/constants.rb +91 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/spectral_band.rb +79 -0
- data/lib/legion/extensions/agentic/imagination/aurora/runners/cognitive_aurora.rb +84 -0
- data/lib/legion/extensions/agentic/imagination/aurora/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/aurora.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/constellation/client.rb +15 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/constants.rb +59 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/constellation.rb +90 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/sky_engine.rb +131 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/star.rb +92 -0
- data/lib/legion/extensions/agentic/imagination/constellation/runners/cognitive_constellation.rb +76 -0
- data/lib/legion/extensions/agentic/imagination/constellation/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/constellation.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/creativity/client.rb +27 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/constants.rb +50 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/creative_engine.rb +151 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/idea.rb +106 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/idea_store.rb +103 -0
- data/lib/legion/extensions/agentic/imagination/creativity/runners/creativity.rb +176 -0
- data/lib/legion/extensions/agentic/imagination/creativity/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/creativity.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/dream/actors/dream_cycle.rb +45 -0
- data/lib/legion/extensions/agentic/imagination/dream/client.rb +29 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/agenda.rb +74 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/association_walker.rb +59 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/constants.rb +34 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/contradiction_detector.rb +86 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/dream_journal.rb +231 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/dream_store.rb +91 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/llm_enhancer.rb +273 -0
- data/lib/legion/extensions/agentic/imagination/dream/runners/dream_cycle.rb +328 -0
- data/lib/legion/extensions/agentic/imagination/dream/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/dream.rb +23 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/client.rb +19 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/constants.rb +49 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation.rb +136 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_engine.rb +180 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_step.rb +49 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/runners/embodied_simulation.rb +99 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation.rb +21 -0
- data/lib/legion/extensions/agentic/imagination/garden/client.rb +15 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/constants.rb +49 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/garden_engine.rb +138 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/plant.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/plot.rb +95 -0
- data/lib/legion/extensions/agentic/imagination/garden/runners/cognitive_garden.rb +75 -0
- data/lib/legion/extensions/agentic/imagination/garden/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/garden.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/genesis/client.rb +27 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/concept.rb +86 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/constants.rb +132 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/genesis_engine.rb +251 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/seed.rb +70 -0
- data/lib/legion/extensions/agentic/imagination/genesis/runners/genesis.rb +105 -0
- data/lib/legion/extensions/agentic/imagination/genesis/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/genesis.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/client.rb +24 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/constants.rb +89 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse_engine.rb +121 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/seedling.rb +155 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/runners/cognitive_greenhouse.rb +87 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse.rb +21 -0
- data/lib/legion/extensions/agentic/imagination/imagery/client.rb +21 -0
- data/lib/legion/extensions/agentic/imagination/imagery/helpers/constants.rb +55 -0
- data/lib/legion/extensions/agentic/imagination/imagery/helpers/scenario.rb +123 -0
- data/lib/legion/extensions/agentic/imagination/imagery/helpers/simulation_store.rb +80 -0
- data/lib/legion/extensions/agentic/imagination/imagery/runners/imagination.rb +210 -0
- data/lib/legion/extensions/agentic/imagination/imagery/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/imagery.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/liminal/client.rb +19 -0
- data/lib/legion/extensions/agentic/imagination/liminal/helpers/constants.rb +79 -0
- data/lib/legion/extensions/agentic/imagination/liminal/helpers/liminal_engine.rb +115 -0
- data/lib/legion/extensions/agentic/imagination/liminal/helpers/threshold_crossing.rb +136 -0
- data/lib/legion/extensions/agentic/imagination/liminal/runners/cognitive_liminal.rb +72 -0
- data/lib/legion/extensions/agentic/imagination/liminal/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/liminal.rb +19 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/client.rb +25 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/constants.rb +48 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/dream_state.rb +135 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/journal_entry.rb +68 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/lucidity_engine.rb +181 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/runners/cognitive_lucidity.rb +95 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/lucidity.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/client.rb +23 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/constants.rb +43 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_engine.rb +141 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_step.rb +53 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/runners/mental_simulation.rb +92 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/origami/client.rb +41 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/constants.rb +29 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/crease.rb +53 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/figure.rb +106 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/origami_engine.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/origami/runners/cognitive_origami.rb +71 -0
- data/lib/legion/extensions/agentic/imagination/origami/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/origami.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/prospection/actors/decay.rb +45 -0
- data/lib/legion/extensions/agentic/imagination/prospection/client.rb +26 -0
- data/lib/legion/extensions/agentic/imagination/prospection/helpers/constants.rb +41 -0
- data/lib/legion/extensions/agentic/imagination/prospection/helpers/prospection_engine.rb +129 -0
- data/lib/legion/extensions/agentic/imagination/prospection/helpers/scenario.rb +120 -0
- data/lib/legion/extensions/agentic/imagination/prospection/runners/prospection.rb +127 -0
- data/lib/legion/extensions/agentic/imagination/prospection/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/prospection.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/client.rb +27 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/constants.rb +37 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/mental_journey.rb +149 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/temporal_waypoint.rb +68 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/time_traveler.rb +205 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/runners/mental_time_travel.rb +145 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/time_travel.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/version.rb +11 -0
- data/lib/legion/extensions/agentic/imagination/volcano/client.rb +47 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/chamber.rb +123 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/constants.rb +45 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/magma.rb +72 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/volcano_engine.rb +120 -0
- data/lib/legion/extensions/agentic/imagination/volcano/runners/cognitive_volcano.rb +108 -0
- data/lib/legion/extensions/agentic/imagination/volcano/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/volcano.rb +21 -0
- data/lib/legion/extensions/agentic/imagination.rb +34 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/client_spec.rb +16 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/alchemy_engine_spec.rb +145 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/constants_spec.rb +45 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/crucible_spec.rb +111 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/substance_spec.rb +174 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/runners/cognitive_alchemy_spec.rb +99 -0
- data/spec/legion/extensions/agentic/imagination/aurora/client_spec.rb +164 -0
- data/spec/legion/extensions/agentic/imagination/aurora/helpers/aurora_engine_spec.rb +291 -0
- data/spec/legion/extensions/agentic/imagination/aurora/helpers/aurora_event_spec.rb +217 -0
- data/spec/legion/extensions/agentic/imagination/aurora/helpers/spectral_band_spec.rb +186 -0
- data/spec/legion/extensions/agentic/imagination/constellation/client_spec.rb +16 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/constants_spec.rb +35 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/constellation_spec.rb +116 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/sky_engine_spec.rb +136 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/star_spec.rb +126 -0
- data/spec/legion/extensions/agentic/imagination/constellation/runners/cognitive_constellation_spec.rb +86 -0
- data/spec/legion/extensions/agentic/imagination/creativity/client_spec.rb +68 -0
- data/spec/legion/extensions/agentic/imagination/creativity/helpers/constants_spec.rb +129 -0
- data/spec/legion/extensions/agentic/imagination/creativity/helpers/creative_engine_spec.rb +220 -0
- data/spec/legion/extensions/agentic/imagination/creativity/helpers/idea_store_spec.rb +232 -0
- data/spec/legion/extensions/agentic/imagination/creativity/runners/creativity_spec.rb +237 -0
- data/spec/legion/extensions/agentic/imagination/dream/actors/dream_cycle_spec.rb +51 -0
- data/spec/legion/extensions/agentic/imagination/dream/client_spec.rb +27 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/agenda_spec.rb +148 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/association_walker_spec.rb +123 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/contradiction_detector_spec.rb +183 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/dream_store_spec.rb +141 -0
- data/spec/legion/extensions/agentic/imagination/dream/integration_spec.rb +98 -0
- data/spec/legion/extensions/agentic/imagination/dream/runners/dream_cycle_spec.rb +116 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/client_spec.rb +44 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_engine_spec.rb +201 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_spec.rb +178 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_step_spec.rb +83 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/runners/embodied_simulation_spec.rb +124 -0
- data/spec/legion/extensions/agentic/imagination/garden/client_spec.rb +34 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/constants_spec.rb +41 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/garden_engine_spec.rb +119 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/plant_spec.rb +147 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/plot_spec.rb +92 -0
- data/spec/legion/extensions/agentic/imagination/garden/runners/cognitive_garden_spec.rb +75 -0
- data/spec/legion/extensions/agentic/imagination/genesis/client_spec.rb +110 -0
- data/spec/legion/extensions/agentic/imagination/genesis/cognitive_genesis_spec.rb +31 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/concept_spec.rb +221 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/constants_spec.rb +145 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/genesis_engine_spec.rb +339 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/seed_spec.rb +197 -0
- data/spec/legion/extensions/agentic/imagination/genesis/runners/genesis_spec.rb +177 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/client_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/constants_spec.rb +74 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse_engine_spec.rb +163 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse_spec.rb +193 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/seedling_spec.rb +224 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/runners/cognitive_greenhouse_spec.rb +139 -0
- data/spec/legion/extensions/agentic/imagination/imagery/client_spec.rb +20 -0
- data/spec/legion/extensions/agentic/imagination/imagery/helpers/constants_spec.rb +25 -0
- data/spec/legion/extensions/agentic/imagination/imagery/helpers/scenario_spec.rb +111 -0
- data/spec/legion/extensions/agentic/imagination/imagery/helpers/simulation_store_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/imagery/runners/imagination_spec.rb +99 -0
- data/spec/legion/extensions/agentic/imagination/liminal/client_spec.rb +21 -0
- data/spec/legion/extensions/agentic/imagination/liminal/cognitive_liminal_spec.rb +7 -0
- data/spec/legion/extensions/agentic/imagination/liminal/helpers/liminal_engine_spec.rb +130 -0
- data/spec/legion/extensions/agentic/imagination/liminal/helpers/threshold_crossing_spec.rb +155 -0
- data/spec/legion/extensions/agentic/imagination/liminal/runners_spec.rb +81 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/client_spec.rb +76 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/cognitive_lucidity_spec.rb +19 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/constants_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/dream_state_spec.rb +210 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/journal_entry_spec.rb +103 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/lucidity_engine_spec.rb +259 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/runners/cognitive_lucidity_spec.rb +156 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/constants_spec.rb +107 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_engine_spec.rb +217 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_spec.rb +223 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_step_spec.rb +111 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/runners/mental_simulation_spec.rb +184 -0
- data/spec/legion/extensions/agentic/imagination/origami/client_spec.rb +98 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/constants_spec.rb +70 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/crease_spec.rb +121 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/figure_spec.rb +212 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/origami_engine_spec.rb +239 -0
- data/spec/legion/extensions/agentic/imagination/origami/runners/cognitive_origami_spec.rb +112 -0
- data/spec/legion/extensions/agentic/imagination/prospection/client_spec.rb +107 -0
- data/spec/legion/extensions/agentic/imagination/prospection/helpers/prospection_engine_spec.rb +197 -0
- data/spec/legion/extensions/agentic/imagination/prospection/helpers/scenario_spec.rb +260 -0
- data/spec/legion/extensions/agentic/imagination/prospection/runners/prospection_spec.rb +156 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/client_spec.rb +34 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/constants_spec.rb +83 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/mental_journey_spec.rb +274 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/temporal_waypoint_spec.rb +177 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/time_traveler_spec.rb +334 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/runners/mental_time_travel_spec.rb +323 -0
- data/spec/legion/extensions/agentic/imagination/volcano/client_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/chamber_spec.rb +266 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/constants_spec.rb +83 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/magma_spec.rb +157 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/volcano_engine_spec.rb +191 -0
- data/spec/legion/extensions/agentic/imagination/volcano/integration_spec.rb +148 -0
- data/spec/legion/extensions/agentic/imagination/volcano/runners/cognitive_volcano_spec.rb +167 -0
- data/spec/spec_helper.rb +54 -0
- metadata +386 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0b20e2342a0aa0fda9926d3c23410f918230481cb5add0095a098511e434756a
|
|
4
|
+
data.tar.gz: 0105f7cdf9636df8db506367dde12346db7aeb54699ef6e5c2e022c7d326e6ce
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9ae7d8d4b5acbfcaadadbee2b7620434ab4f0c097fe4c91918b6fecf9f9bd0318a4f7b4989f9f67612d4ec3e5750ace3a0dff232bd1c9a6c5c4af4ff2032bcd3
|
|
7
|
+
data.tar.gz: 8ecba0c2c73bb641c8adb60aec34491ccff21a9b32d02d6c55a80c7ed4ec16a964ad5984c4f0a7930fcf7a0b9f5073bd1cf76f2345ddedccf7c5685c439d3d9d
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2026-03-18
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Initial release as domain consolidation gem
|
|
9
|
+
- Consolidated source extensions into unified domain gem under `Legion::Extensions::Agentic::<Domain>`
|
|
10
|
+
- All sub-modules loaded from single entry point
|
|
11
|
+
- Full spec suite with zero failures
|
|
12
|
+
- RuboCop compliance across all files
|
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matthew Iverson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'lib/legion/extensions/agentic/imagination/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = 'lex-agentic-imagination'
|
|
7
|
+
spec.version = Legion::Extensions::Agentic::Imagination::VERSION
|
|
8
|
+
spec.authors = ['Esity']
|
|
9
|
+
spec.email = ['matthewdiverson@gmail.com']
|
|
10
|
+
|
|
11
|
+
spec.summary = 'LEX Agentic Imagination'
|
|
12
|
+
spec.description = 'LEX agentic imagination domain: mental simulation, creativity, prospection'
|
|
13
|
+
spec.homepage = 'https://github.com/LegionIO/lex-agentic-imagination'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
spec.required_ruby_version = '>= 3.4'
|
|
16
|
+
|
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
18
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
|
19
|
+
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
|
20
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
21
|
+
|
|
22
|
+
spec.files = Dir.chdir(__dir__) do
|
|
23
|
+
Dir.glob('{lib,spec}/**/*.rb') + %w[lex-agentic-imagination.gemspec Gemfile LICENSE README.md CHANGELOG.md]
|
|
24
|
+
end
|
|
25
|
+
spec.require_paths = ['lib']
|
|
26
|
+
|
|
27
|
+
spec.add_development_dependency 'lex-emotion'
|
|
28
|
+
spec.add_development_dependency 'lex-identity'
|
|
29
|
+
spec.add_development_dependency 'lex-memory'
|
|
30
|
+
spec.add_development_dependency 'lex-tick'
|
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.13'
|
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 1.60'
|
|
33
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.26'
|
|
34
|
+
end
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Imagination
|
|
7
|
+
module Alchemy
|
|
8
|
+
module Helpers
|
|
9
|
+
class AlchemyEngine
|
|
10
|
+
def initialize
|
|
11
|
+
@substances = {}
|
|
12
|
+
@reactions = {}
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def create_substance(element_type:, domain:, content:, purity: nil, potency: nil)
|
|
16
|
+
raise ArgumentError, 'athanor full' if @substances.size >= Constants::MAX_SUBSTANCES
|
|
17
|
+
|
|
18
|
+
sub = Substance.new(element_type: element_type, domain: domain,
|
|
19
|
+
content: content, purity: purity, potency: potency)
|
|
20
|
+
@substances[sub.id] = sub
|
|
21
|
+
sub
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def advance_stage(substance_id:)
|
|
25
|
+
fetch_substance(substance_id).advance_stage!
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def catalyze(substance_id:, multiplier: Constants::CATALYST_MULTIPLIER)
|
|
29
|
+
fetch_substance(substance_id).catalyze!(multiplier: multiplier)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def react(reaction_type:, input_ids:, heat: 0.5, pressure: 0.5)
|
|
33
|
+
raise ArgumentError, 'too many reactions' if @reactions.size >= Constants::MAX_REACTIONS
|
|
34
|
+
|
|
35
|
+
inputs = input_ids.map { |id| fetch_substance(id) }
|
|
36
|
+
crucible = Crucible.new(reaction_type: reaction_type, input_ids: input_ids,
|
|
37
|
+
heat: heat, pressure: pressure)
|
|
38
|
+
|
|
39
|
+
output = synthesize(inputs, crucible)
|
|
40
|
+
@substances[output.id] = output
|
|
41
|
+
crucible.complete!(output.id)
|
|
42
|
+
@reactions[crucible.id] = crucible
|
|
43
|
+
|
|
44
|
+
{ crucible: crucible, output: output }
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def decay_all!(rate: Constants::SUBSTANCE_DECAY)
|
|
48
|
+
@substances.each_value { |s| s.decay!(rate: rate) }
|
|
49
|
+
pruned = @substances.select { |_, s| s.inert? }.keys
|
|
50
|
+
pruned.each { |id| @substances.delete(id) }
|
|
51
|
+
{ decayed: @substances.size, pruned: pruned.size }
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def substances_by_stage
|
|
55
|
+
counts = Constants::STAGES.to_h { |s| [s, 0] }
|
|
56
|
+
@substances.each_value { |s| counts[s.stage] += 1 }
|
|
57
|
+
counts
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def substances_by_type
|
|
61
|
+
counts = Constants::ELEMENT_TYPES.to_h { |t| [t, 0] }
|
|
62
|
+
@substances.each_value { |s| counts[s.element_type] += 1 }
|
|
63
|
+
counts
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def gold_count
|
|
67
|
+
@substances.count { |_, s| s.gold? }
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def prima_materia_count
|
|
71
|
+
@substances.count { |_, s| s.prima_materia? }
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def purest(limit: 5)
|
|
75
|
+
@substances.values.sort_by { |s| -s.purity }.first(limit)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def most_potent(limit: 5)
|
|
79
|
+
@substances.values.sort_by { |s| -s.potency }.first(limit)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def alchemy_report
|
|
83
|
+
{
|
|
84
|
+
total_substances: @substances.size,
|
|
85
|
+
total_reactions: @reactions.size,
|
|
86
|
+
by_stage: substances_by_stage,
|
|
87
|
+
by_type: substances_by_type,
|
|
88
|
+
gold_count: gold_count,
|
|
89
|
+
prima_materia: prima_materia_count,
|
|
90
|
+
avg_purity: avg_metric(:purity),
|
|
91
|
+
avg_potency: avg_metric(:potency)
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def all_substances
|
|
96
|
+
@substances.values
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def all_reactions
|
|
100
|
+
@reactions.values
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
private
|
|
104
|
+
|
|
105
|
+
def fetch_substance(id)
|
|
106
|
+
@substances.fetch(id) do
|
|
107
|
+
raise ArgumentError, "substance not found: #{id}"
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def synthesize(inputs, crucible)
|
|
112
|
+
avg_purity = inputs.sum(&:purity) / inputs.size
|
|
113
|
+
avg_potency = inputs.sum(&:potency) / inputs.size
|
|
114
|
+
boost = crucible.intensity * Constants::TRANSMUTATION_RATE
|
|
115
|
+
|
|
116
|
+
create_substance(
|
|
117
|
+
element_type: inputs.first.element_type,
|
|
118
|
+
domain: inputs.first.domain,
|
|
119
|
+
content: "synthesis(#{inputs.map(&:content).join(' + ')})",
|
|
120
|
+
purity: (avg_purity + boost).clamp(0.0, 1.0),
|
|
121
|
+
potency: (avg_potency + (boost * 0.5)).clamp(0.0, 1.0)
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def avg_metric(attr)
|
|
126
|
+
return 0.0 if @substances.empty?
|
|
127
|
+
|
|
128
|
+
(substances_metric_sum(attr) / @substances.size).round(10)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def substances_metric_sum(attr)
|
|
132
|
+
@substances.values.sum(&attr)
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Imagination
|
|
7
|
+
module Alchemy
|
|
8
|
+
module Helpers
|
|
9
|
+
module Constants
|
|
10
|
+
# Alchemical stages (Magnum Opus)
|
|
11
|
+
STAGES = %i[nigredo albedo citrinitas rubedo].freeze
|
|
12
|
+
|
|
13
|
+
# Transmutation element types
|
|
14
|
+
ELEMENT_TYPES = %i[
|
|
15
|
+
concept belief skill memory emotion
|
|
16
|
+
pattern habit intuition hypothesis
|
|
17
|
+
].freeze
|
|
18
|
+
|
|
19
|
+
# Crucible reaction types
|
|
20
|
+
REACTION_TYPES = %i[
|
|
21
|
+
calcination dissolution separation conjunction
|
|
22
|
+
fermentation distillation coagulation
|
|
23
|
+
].freeze
|
|
24
|
+
|
|
25
|
+
# Maximum substances in the athanor
|
|
26
|
+
MAX_SUBSTANCES = 200
|
|
27
|
+
|
|
28
|
+
# Maximum crucible reactions
|
|
29
|
+
MAX_REACTIONS = 100
|
|
30
|
+
|
|
31
|
+
# Base transmutation rate per stage advance
|
|
32
|
+
TRANSMUTATION_RATE = 0.15
|
|
33
|
+
|
|
34
|
+
# Decay rate for unreacted substances
|
|
35
|
+
SUBSTANCE_DECAY = 0.02
|
|
36
|
+
|
|
37
|
+
# Philosopher's stone catalyst multiplier
|
|
38
|
+
CATALYST_MULTIPLIER = 3.0
|
|
39
|
+
|
|
40
|
+
# Stage labels
|
|
41
|
+
STAGE_LABELS = {
|
|
42
|
+
nigredo: 'Blackening — decomposition of raw material',
|
|
43
|
+
albedo: 'Whitening — purification and washing',
|
|
44
|
+
citrinitas: 'Yellowing — solar awakening',
|
|
45
|
+
rubedo: 'Reddening — final integration and gold'
|
|
46
|
+
}.freeze
|
|
47
|
+
|
|
48
|
+
# Purity labels (range-based)
|
|
49
|
+
PURITY_LABELS = [
|
|
50
|
+
[(0.8..), :aurum],
|
|
51
|
+
[(0.6...0.8), :argentum],
|
|
52
|
+
[(0.4...0.6), :cuprum],
|
|
53
|
+
[(0.2...0.4), :ferrum],
|
|
54
|
+
[(..0.2), :plumbum]
|
|
55
|
+
].freeze
|
|
56
|
+
|
|
57
|
+
# Potency labels
|
|
58
|
+
POTENCY_LABELS = [
|
|
59
|
+
[(0.8..), :transcendent],
|
|
60
|
+
[(0.6...0.8), :potent],
|
|
61
|
+
[(0.4...0.6), :moderate],
|
|
62
|
+
[(0.2...0.4), :weak],
|
|
63
|
+
[(..0.2), :inert]
|
|
64
|
+
].freeze
|
|
65
|
+
|
|
66
|
+
def self.label_for(table, value)
|
|
67
|
+
table.each { |range, label| return label if range.cover?(value) }
|
|
68
|
+
table.last.last
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Imagination
|
|
7
|
+
module Alchemy
|
|
8
|
+
module Helpers
|
|
9
|
+
class Crucible
|
|
10
|
+
attr_reader :id, :reaction_type, :input_ids, :output_id,
|
|
11
|
+
:heat, :pressure, :started_at, :completed_at
|
|
12
|
+
|
|
13
|
+
def initialize(reaction_type:, input_ids:,
|
|
14
|
+
heat: 0.5, pressure: 0.5)
|
|
15
|
+
validate_reaction!(reaction_type)
|
|
16
|
+
@id = SecureRandom.uuid
|
|
17
|
+
@reaction_type = reaction_type.to_sym
|
|
18
|
+
@input_ids = Array(input_ids).dup
|
|
19
|
+
@output_id = nil
|
|
20
|
+
@heat = heat.to_f.clamp(0.0, 1.0).round(10)
|
|
21
|
+
@pressure = pressure.to_f.clamp(0.0, 1.0).round(10)
|
|
22
|
+
@started_at = Time.now.utc
|
|
23
|
+
@completed_at = nil
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def complete!(output_id)
|
|
27
|
+
@output_id = output_id
|
|
28
|
+
@completed_at = Time.now.utc
|
|
29
|
+
self
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def completed?
|
|
33
|
+
!@completed_at.nil?
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def intensity
|
|
37
|
+
((@heat + @pressure) / 2.0).round(10)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def volatile?
|
|
41
|
+
@heat > 0.8 && @pressure > 0.8
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def mild?
|
|
45
|
+
intensity < 0.3
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def to_h
|
|
49
|
+
{
|
|
50
|
+
id: @id,
|
|
51
|
+
reaction_type: @reaction_type,
|
|
52
|
+
input_ids: @input_ids,
|
|
53
|
+
output_id: @output_id,
|
|
54
|
+
heat: @heat,
|
|
55
|
+
pressure: @pressure,
|
|
56
|
+
intensity: intensity,
|
|
57
|
+
volatile: volatile?,
|
|
58
|
+
mild: mild?,
|
|
59
|
+
started_at: @started_at,
|
|
60
|
+
completed_at: @completed_at,
|
|
61
|
+
completed: completed?
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
|
|
67
|
+
def validate_reaction!(val)
|
|
68
|
+
return if Constants::REACTION_TYPES.include?(val.to_sym)
|
|
69
|
+
|
|
70
|
+
raise ArgumentError,
|
|
71
|
+
"unknown reaction type: #{val.inspect}; " \
|
|
72
|
+
"must be one of #{Constants::REACTION_TYPES.inspect}"
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Imagination
|
|
7
|
+
module Alchemy
|
|
8
|
+
module Helpers
|
|
9
|
+
class Substance
|
|
10
|
+
attr_reader :id, :element_type, :domain, :content,
|
|
11
|
+
:stage, :discovered_at, :transmutation_count
|
|
12
|
+
attr_accessor :purity, :potency
|
|
13
|
+
|
|
14
|
+
def initialize(element_type:, domain:, content:,
|
|
15
|
+
purity: nil, potency: nil)
|
|
16
|
+
validate_type!(element_type)
|
|
17
|
+
assign_core(element_type, domain, content)
|
|
18
|
+
assign_metadata(purity, potency)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def advance_stage!
|
|
22
|
+
idx = Constants::STAGES.index(@stage)
|
|
23
|
+
return self if idx >= Constants::STAGES.size - 1
|
|
24
|
+
|
|
25
|
+
@stage = Constants::STAGES[idx + 1]
|
|
26
|
+
@purity = (@purity + Constants::TRANSMUTATION_RATE).clamp(0.0, 1.0).round(10)
|
|
27
|
+
@transmutation_count += 1
|
|
28
|
+
self
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def decay!(rate: Constants::SUBSTANCE_DECAY)
|
|
32
|
+
@potency = (@potency - rate.abs).clamp(0.0, 1.0).round(10)
|
|
33
|
+
self
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def catalyze!(multiplier: Constants::CATALYST_MULTIPLIER)
|
|
37
|
+
boost = Constants::TRANSMUTATION_RATE * multiplier
|
|
38
|
+
@purity = (@purity + boost).clamp(0.0, 1.0).round(10)
|
|
39
|
+
@potency = (@potency + (boost * 0.5)).clamp(0.0, 1.0).round(10)
|
|
40
|
+
@transmutation_count += 1
|
|
41
|
+
self
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def prima_materia?
|
|
45
|
+
@stage == :nigredo && @purity < 0.2
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def gold?
|
|
49
|
+
@stage == :rubedo && @purity >= 0.8
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def inert?
|
|
53
|
+
@potency < 0.1
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def purity_label
|
|
57
|
+
Constants.label_for(Constants::PURITY_LABELS, @purity)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def potency_label
|
|
61
|
+
Constants.label_for(Constants::POTENCY_LABELS, @potency)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def stage_label
|
|
65
|
+
Constants::STAGE_LABELS.fetch(@stage, 'unknown')
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def to_h
|
|
69
|
+
{
|
|
70
|
+
id: @id,
|
|
71
|
+
element_type: @element_type,
|
|
72
|
+
domain: @domain,
|
|
73
|
+
content: @content,
|
|
74
|
+
stage: @stage,
|
|
75
|
+
stage_label: stage_label,
|
|
76
|
+
purity: @purity,
|
|
77
|
+
purity_label: purity_label,
|
|
78
|
+
potency: @potency,
|
|
79
|
+
potency_label: potency_label,
|
|
80
|
+
transmutation_count: @transmutation_count,
|
|
81
|
+
discovered_at: @discovered_at,
|
|
82
|
+
prima_materia: prima_materia?,
|
|
83
|
+
gold: gold?,
|
|
84
|
+
inert: inert?
|
|
85
|
+
}
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
private
|
|
89
|
+
|
|
90
|
+
def assign_core(element_type, domain, content)
|
|
91
|
+
@id = SecureRandom.uuid
|
|
92
|
+
@element_type = element_type.to_sym
|
|
93
|
+
@domain = domain.to_sym
|
|
94
|
+
@content = content.to_s
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def assign_metadata(purity, potency)
|
|
98
|
+
@stage = :nigredo
|
|
99
|
+
@purity = (purity || 0.1).to_f.clamp(0.0, 1.0).round(10)
|
|
100
|
+
@potency = (potency || 0.5).to_f.clamp(0.0, 1.0).round(10)
|
|
101
|
+
@transmutation_count = 0
|
|
102
|
+
@discovered_at = Time.now.utc
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def validate_type!(val)
|
|
106
|
+
return if Constants::ELEMENT_TYPES.include?(val.to_sym)
|
|
107
|
+
|
|
108
|
+
raise ArgumentError,
|
|
109
|
+
"unknown element type: #{val.inspect}; " \
|
|
110
|
+
"must be one of #{Constants::ELEMENT_TYPES.inspect}"
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Imagination
|
|
7
|
+
module Alchemy
|
|
8
|
+
module Runners
|
|
9
|
+
module CognitiveAlchemy
|
|
10
|
+
extend self
|
|
11
|
+
|
|
12
|
+
def create_substance(element_type:, domain:, content:,
|
|
13
|
+
purity: nil, potency: nil, engine: nil, **)
|
|
14
|
+
eng = resolve_engine(engine)
|
|
15
|
+
sub = eng.create_substance(element_type: element_type, domain: domain,
|
|
16
|
+
content: content, purity: purity, potency: potency)
|
|
17
|
+
{ success: true, substance: sub.to_h }
|
|
18
|
+
rescue ArgumentError => e
|
|
19
|
+
{ success: false, error: e.message }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def advance_stage(substance_id:, engine: nil, **)
|
|
23
|
+
eng = resolve_engine(engine)
|
|
24
|
+
sub = eng.advance_stage(substance_id: substance_id)
|
|
25
|
+
{ success: true, substance: sub.to_h }
|
|
26
|
+
rescue ArgumentError => e
|
|
27
|
+
{ success: false, error: e.message }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def catalyze(substance_id:, multiplier: nil, engine: nil, **)
|
|
31
|
+
eng = resolve_engine(engine)
|
|
32
|
+
opts = { substance_id: substance_id }
|
|
33
|
+
opts[:multiplier] = multiplier if multiplier
|
|
34
|
+
sub = eng.catalyze(**opts)
|
|
35
|
+
{ success: true, substance: sub.to_h }
|
|
36
|
+
rescue ArgumentError => e
|
|
37
|
+
{ success: false, error: e.message }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def react(reaction_type:, input_ids:, heat: 0.5,
|
|
41
|
+
pressure: 0.5, engine: nil, **)
|
|
42
|
+
eng = resolve_engine(engine)
|
|
43
|
+
result = eng.react(reaction_type: reaction_type, input_ids: input_ids,
|
|
44
|
+
heat: heat, pressure: pressure)
|
|
45
|
+
{ success: true, crucible: result[:crucible].to_h,
|
|
46
|
+
output: result[:output].to_h }
|
|
47
|
+
rescue ArgumentError => e
|
|
48
|
+
{ success: false, error: e.message }
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def list_substances(engine: nil, stage: nil, element_type: nil, **)
|
|
52
|
+
eng = resolve_engine(engine)
|
|
53
|
+
results = filter_substances(eng.all_substances,
|
|
54
|
+
stage: stage, element_type: element_type)
|
|
55
|
+
{ success: true, substances: results.map(&:to_h),
|
|
56
|
+
count: results.size }
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def alchemy_status(engine: nil, **)
|
|
60
|
+
eng = resolve_engine(engine)
|
|
61
|
+
{ success: true, report: eng.alchemy_report }
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
include Legion::Extensions::Helpers::Lex if defined?(Legion::Extensions::Helpers::Lex)
|
|
65
|
+
|
|
66
|
+
private
|
|
67
|
+
|
|
68
|
+
def filter_substances(substances, stage:, element_type:)
|
|
69
|
+
r = substances
|
|
70
|
+
r = r.select { |s| s.stage == stage.to_sym } if stage
|
|
71
|
+
r = r.select { |s| s.element_type == element_type.to_sym } if element_type
|
|
72
|
+
r
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def resolve_engine(engine)
|
|
76
|
+
engine || default_engine
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def default_engine
|
|
80
|
+
@default_engine ||= Helpers::AlchemyEngine.new
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
|
|
5
|
+
require_relative 'alchemy/version'
|
|
6
|
+
require_relative 'alchemy/helpers/constants'
|
|
7
|
+
require_relative 'alchemy/helpers/substance'
|
|
8
|
+
require_relative 'alchemy/helpers/crucible'
|
|
9
|
+
require_relative 'alchemy/helpers/alchemy_engine'
|
|
10
|
+
require_relative 'alchemy/runners/cognitive_alchemy'
|
|
11
|
+
require_relative 'alchemy/client'
|
|
12
|
+
|
|
13
|
+
module Legion
|
|
14
|
+
module Extensions
|
|
15
|
+
module Agentic
|
|
16
|
+
module Imagination
|
|
17
|
+
module Alchemy
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'legion/extensions/agentic/imagination/aurora/helpers/constants'
|
|
4
|
+
require 'legion/extensions/agentic/imagination/aurora/helpers/aurora_event'
|
|
5
|
+
require 'legion/extensions/agentic/imagination/aurora/helpers/spectral_band'
|
|
6
|
+
require 'legion/extensions/agentic/imagination/aurora/helpers/aurora_engine'
|
|
7
|
+
require 'legion/extensions/agentic/imagination/aurora/runners/cognitive_aurora'
|
|
8
|
+
|
|
9
|
+
module Legion
|
|
10
|
+
module Extensions
|
|
11
|
+
module Agentic
|
|
12
|
+
module Imagination
|
|
13
|
+
module Aurora
|
|
14
|
+
class Client
|
|
15
|
+
include Runners::CognitiveAurora
|
|
16
|
+
|
|
17
|
+
def initialize(**)
|
|
18
|
+
@default_engine = Helpers::AuroraEngine.new
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|