playlist-data-engine 1.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.
- package/LICENSE +21 -0
- package/README.md +352 -0
- package/dist/__vite-browser-external-DYxpcVy9.js +4 -0
- package/dist/constants/DefaultClasses.d.ts +46 -0
- package/dist/constants/DefaultClasses.d.ts.map +1 -0
- package/dist/constants/DefaultEnchantments.d.ts +337 -0
- package/dist/constants/DefaultEnchantments.d.ts.map +1 -0
- package/dist/constants/DefaultEnemies.d.ts +83 -0
- package/dist/constants/DefaultEnemies.d.ts.map +1 -0
- package/dist/constants/DefaultEquipment.d.ts +23 -0
- package/dist/constants/DefaultEquipment.d.ts.map +1 -0
- package/dist/constants/DefaultFeatures.d.ts +22 -0
- package/dist/constants/DefaultFeatures.d.ts.map +1 -0
- package/dist/constants/DefaultRaces.d.ts +102 -0
- package/dist/constants/DefaultRaces.d.ts.map +1 -0
- package/dist/constants/DefaultSkills.d.ts +26 -0
- package/dist/constants/DefaultSkills.d.ts.map +1 -0
- package/dist/constants/DefaultSpells.d.ts +41 -0
- package/dist/constants/DefaultSpells.d.ts.map +1 -0
- package/dist/constants/EncounterBalance.d.ts +208 -0
- package/dist/constants/EncounterBalance.d.ts.map +1 -0
- package/dist/constants/EnemyEquipment.d.ts +71 -0
- package/dist/constants/EnemyEquipment.d.ts.map +1 -0
- package/dist/constants/EnemyRarity.d.ts +79 -0
- package/dist/constants/EnemyRarity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts +68 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts +64 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts +62 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts +61 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts.map +1 -0
- package/dist/constants/ItemTemplates.d.ts +40 -0
- package/dist/constants/ItemTemplates.d.ts.map +1 -0
- package/dist/constants/MagicItems.d.ts +30 -0
- package/dist/constants/MagicItems.d.ts.map +1 -0
- package/dist/constants/SpellSlots.d.ts +30 -0
- package/dist/constants/SpellSlots.d.ts.map +1 -0
- package/dist/constants/StatScaling.d.ts +113 -0
- package/dist/constants/StatScaling.d.ts.map +1 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts +599 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/ColorExtractor.d.ts +64 -0
- package/dist/core/analysis/ColorExtractor.d.ts.map +1 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts +282 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/LevelSerializer.d.ts +265 -0
- package/dist/core/analysis/LevelSerializer.d.ts.map +1 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts +283 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts +214 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MusicClassifier.d.ts +524 -0
- package/dist/core/analysis/MusicClassifier.d.ts.map +1 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts +266 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/PitchDetector.d.ts +251 -0
- package/dist/core/analysis/PitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/SpectrumScanner.d.ts +52 -0
- package/dist/core/analysis/SpectrumScanner.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts +477 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts +170 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatStream.d.ts +316 -0
- package/dist/core/analysis/beat/BeatStream.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts +205 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts +137 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts.map +1 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts +180 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts +246 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts +1082 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts +192 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts +133 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts.map +1 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts +230 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts +399 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts +262 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts.map +1 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts +275 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts +256 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts +220 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts +303 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts +180 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts.map +1 -0
- package/dist/core/analysis/beat/index.d.ts +41 -0
- package/dist/core/analysis/beat/index.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts +204 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts +404 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts +61 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts +33 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/index.d.ts +18 -0
- package/dist/core/analysis/index.d.ts.map +1 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts +108 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatAI.d.ts +179 -0
- package/dist/core/combat/AI/CombatAI.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts +30 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts.map +1 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts +170 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts +231 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts +203 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts +201 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts.map +1 -0
- package/dist/core/combat/AttackResolver.d.ts +220 -0
- package/dist/core/combat/AttackResolver.d.ts.map +1 -0
- package/dist/core/combat/CombatEngine.d.ts +388 -0
- package/dist/core/combat/CombatEngine.d.ts.map +1 -0
- package/dist/core/combat/DiceRoller.d.ts +115 -0
- package/dist/core/combat/DiceRoller.d.ts.map +1 -0
- package/dist/core/combat/InitiativeRoller.d.ts +62 -0
- package/dist/core/combat/InitiativeRoller.d.ts.map +1 -0
- package/dist/core/combat/PartyAnalyzer.d.ts +215 -0
- package/dist/core/combat/PartyAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/SeededDiceRoller.d.ts +120 -0
- package/dist/core/combat/SeededDiceRoller.d.ts.map +1 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts +366 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts.map +1 -0
- package/dist/core/combat/SpellCaster.d.ts +113 -0
- package/dist/core/combat/SpellCaster.d.ts.map +1 -0
- package/dist/core/config/index.d.ts +24 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/progressionConfig.d.ts +73 -0
- package/dist/core/config/progressionConfig.d.ts.map +1 -0
- package/dist/core/config/sensorConfig.d.ts +134 -0
- package/dist/core/config/sensorConfig.d.ts.map +1 -0
- package/dist/core/equipment/BoxOpener.d.ts +175 -0
- package/dist/core/equipment/BoxOpener.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts +189 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentModifier.d.ts +327 -0
- package/dist/core/equipment/EquipmentModifier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts +246 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentValidator.d.ts +173 -0
- package/dist/core/equipment/EquipmentValidator.d.ts.map +1 -0
- package/dist/core/extensions/ExtensionManager.d.ts +517 -0
- package/dist/core/extensions/ExtensionManager.d.ts.map +1 -0
- package/dist/core/extensions/WeightedSelector.d.ts +156 -0
- package/dist/core/extensions/WeightedSelector.d.ts.map +1 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/initializeDefaults.d.ts +170 -0
- package/dist/core/extensions/initializeDefaults.d.ts.map +1 -0
- package/dist/core/features/FeatureEffectApplier.d.ts +102 -0
- package/dist/core/features/FeatureEffectApplier.d.ts.map +1 -0
- package/dist/core/features/FeatureQuery.d.ts +368 -0
- package/dist/core/features/FeatureQuery.d.ts.map +1 -0
- package/dist/core/features/FeatureTypes.d.ts +199 -0
- package/dist/core/features/FeatureTypes.d.ts.map +1 -0
- package/dist/core/features/FeatureValidator.d.ts +149 -0
- package/dist/core/features/FeatureValidator.d.ts.map +1 -0
- package/dist/core/features/index.d.ts +12 -0
- package/dist/core/features/index.d.ts.map +1 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts +83 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts.map +1 -0
- package/dist/core/generation/AppearanceGenerator.d.ts +32 -0
- package/dist/core/generation/AppearanceGenerator.d.ts.map +1 -0
- package/dist/core/generation/BeatConverter.d.ts +127 -0
- package/dist/core/generation/BeatConverter.d.ts.map +1 -0
- package/dist/core/generation/ButtonMapper.d.ts +346 -0
- package/dist/core/generation/ButtonMapper.d.ts.map +1 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts +92 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts.map +1 -0
- package/dist/core/generation/CRLevelConverter.d.ts +242 -0
- package/dist/core/generation/CRLevelConverter.d.ts.map +1 -0
- package/dist/core/generation/CharacterGenerator.d.ts +194 -0
- package/dist/core/generation/CharacterGenerator.d.ts.map +1 -0
- package/dist/core/generation/ClassSuggester.d.ts +184 -0
- package/dist/core/generation/ClassSuggester.d.ts.map +1 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts +151 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/EnemyGenerator.d.ts +595 -0
- package/dist/core/generation/EnemyGenerator.d.ts.map +1 -0
- package/dist/core/generation/EquipmentGenerator.d.ts +204 -0
- package/dist/core/generation/EquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/LegendaryGenerator.d.ts +213 -0
- package/dist/core/generation/LegendaryGenerator.d.ts.map +1 -0
- package/dist/core/generation/LevelGenerator.d.ts +390 -0
- package/dist/core/generation/LevelGenerator.d.ts.map +1 -0
- package/dist/core/generation/NamingEngine.d.ts +136 -0
- package/dist/core/generation/NamingEngine.d.ts.map +1 -0
- package/dist/core/generation/PitchBeatLinker.d.ts +150 -0
- package/dist/core/generation/PitchBeatLinker.d.ts.map +1 -0
- package/dist/core/generation/RaceSelector.d.ts +58 -0
- package/dist/core/generation/RaceSelector.d.ts.map +1 -0
- package/dist/core/generation/RhythmGenerator.d.ts +597 -0
- package/dist/core/generation/RhythmGenerator.d.ts.map +1 -0
- package/dist/core/generation/SkillAssigner.d.ts +78 -0
- package/dist/core/generation/SkillAssigner.d.ts.map +1 -0
- package/dist/core/generation/SpellManager.d.ts +132 -0
- package/dist/core/generation/SpellManager.d.ts.map +1 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts +255 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts.map +1 -0
- package/dist/core/generation/index.d.ts +41 -0
- package/dist/core/generation/index.d.ts.map +1 -0
- package/dist/core/parser/MetadataExtractor.d.ts +66 -0
- package/dist/core/parser/MetadataExtractor.d.ts.map +1 -0
- package/dist/core/parser/PlaylistParser.d.ts +45 -0
- package/dist/core/parser/PlaylistParser.d.ts.map +1 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts +333 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts.map +1 -0
- package/dist/core/playback/index.d.ts +5 -0
- package/dist/core/playback/index.d.ts.map +1 -0
- package/dist/core/progression/CharacterUpdater.d.ts +203 -0
- package/dist/core/progression/CharacterUpdater.d.ts.map +1 -0
- package/dist/core/progression/LevelUpProcessor.d.ts +234 -0
- package/dist/core/progression/LevelUpProcessor.d.ts.map +1 -0
- package/dist/core/progression/PrestigeSystem.d.ts +217 -0
- package/dist/core/progression/PrestigeSystem.d.ts.map +1 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts +182 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts.map +1 -0
- package/dist/core/progression/SessionTracker.d.ts +169 -0
- package/dist/core/progression/SessionTracker.d.ts.map +1 -0
- package/dist/core/progression/XPCalculator.d.ts +128 -0
- package/dist/core/progression/XPCalculator.d.ts.map +1 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts +97 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts.map +1 -0
- package/dist/core/progression/stat/StatManager.d.ts +179 -0
- package/dist/core/progression/stat/StatManager.d.ts.map +1 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts +301 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts.map +1 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts +162 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts.map +1 -0
- package/dist/core/sensors/GeolocationProvider.d.ts +156 -0
- package/dist/core/sensors/GeolocationProvider.d.ts.map +1 -0
- package/dist/core/sensors/MotionDetector.d.ts +58 -0
- package/dist/core/sensors/MotionDetector.d.ts.map +1 -0
- package/dist/core/sensors/SteamAPIClient.d.ts +108 -0
- package/dist/core/sensors/SteamAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts +360 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts +144 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts.map +1 -0
- package/dist/core/skills/SkillQuery.d.ts +159 -0
- package/dist/core/skills/SkillQuery.d.ts.map +1 -0
- package/dist/core/skills/SkillTypes.d.ts +233 -0
- package/dist/core/skills/SkillTypes.d.ts.map +1 -0
- package/dist/core/skills/SkillValidator.d.ts +146 -0
- package/dist/core/skills/SkillValidator.d.ts.map +1 -0
- package/dist/core/skills/index.d.ts +11 -0
- package/dist/core/skills/index.d.ts.map +1 -0
- package/dist/core/spells/SpellQuery.d.ts +194 -0
- package/dist/core/spells/SpellQuery.d.ts.map +1 -0
- package/dist/core/spells/SpellTypes.d.ts +71 -0
- package/dist/core/spells/SpellTypes.d.ts.map +1 -0
- package/dist/core/spells/SpellValidator.d.ts +129 -0
- package/dist/core/spells/SpellValidator.d.ts.map +1 -0
- package/dist/core/spells/index.d.ts +11 -0
- package/dist/core/spells/index.d.ts.map +1 -0
- package/dist/core/types/AudioProfile.d.ts +143 -0
- package/dist/core/types/AudioProfile.d.ts.map +1 -0
- package/dist/core/types/BeatMap.d.ts +1825 -0
- package/dist/core/types/BeatMap.d.ts.map +1 -0
- package/dist/core/types/ButtonMapping.d.ts +345 -0
- package/dist/core/types/ButtonMapping.d.ts.map +1 -0
- package/dist/core/types/Character.d.ts +397 -0
- package/dist/core/types/Character.d.ts.map +1 -0
- package/dist/core/types/ChartedBeatMap.d.ts +169 -0
- package/dist/core/types/ChartedBeatMap.d.ts.map +1 -0
- package/dist/core/types/Combat.d.ts +268 -0
- package/dist/core/types/Combat.d.ts.map +1 -0
- package/dist/core/types/CombatAI.d.ts +143 -0
- package/dist/core/types/CombatAI.d.ts.map +1 -0
- package/dist/core/types/Enemy.d.ts +447 -0
- package/dist/core/types/Enemy.d.ts.map +1 -0
- package/dist/core/types/Environmental.d.ts +213 -0
- package/dist/core/types/Environmental.d.ts.map +1 -0
- package/dist/core/types/Equipment.d.ts +309 -0
- package/dist/core/types/Equipment.d.ts.map +1 -0
- package/dist/core/types/ISessionTracker.d.ts +48 -0
- package/dist/core/types/ISessionTracker.d.ts.map +1 -0
- package/dist/core/types/LevelExport.d.ts +366 -0
- package/dist/core/types/LevelExport.d.ts.map +1 -0
- package/dist/core/types/Playlist.d.ts +70 -0
- package/dist/core/types/Playlist.d.ts.map +1 -0
- package/dist/core/types/Prestige.d.ts +94 -0
- package/dist/core/types/Prestige.d.ts.map +1 -0
- package/dist/core/types/Progression.d.ts +214 -0
- package/dist/core/types/Progression.d.ts.map +1 -0
- package/dist/core/types/RhythmXP.d.ts +398 -0
- package/dist/core/types/RhythmXP.d.ts.map +1 -0
- package/dist/core/utils/AbilityConstants.d.ts +31 -0
- package/dist/core/utils/AbilityConstants.d.ts.map +1 -0
- package/dist/core/utils/EffectApplierUtils.d.ts +56 -0
- package/dist/core/utils/EffectApplierUtils.d.ts.map +1 -0
- package/dist/core/utils/ImageValidator.d.ts +66 -0
- package/dist/core/utils/ImageValidator.d.ts.map +1 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts +88 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts.map +1 -0
- package/dist/essentia-wasm.es-BUEnKUts.js +2990 -0
- package/dist/essentia.js-model.es-CGA0xotH.js +306 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/playlist-data-engine.js +124 -0
- package/dist/playlist-data-engine.mjs +49251 -0
- package/dist/utils/EnchantmentLibrary.d.ts +378 -0
- package/dist/utils/EnchantmentLibrary.d.ts.map +1 -0
- package/dist/utils/arweaveGatewayManager.d.ts +485 -0
- package/dist/utils/arweaveGatewayManager.d.ts.map +1 -0
- package/dist/utils/arweaveUtils.d.ts +118 -0
- package/dist/utils/arweaveUtils.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +439 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/equipmentConstants.d.ts +60 -0
- package/dist/utils/equipmentConstants.d.ts.map +1 -0
- package/dist/utils/hash.d.ts +33 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +192 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/magicItemExamples.d.ts +46 -0
- package/dist/utils/magicItemExamples.d.ts.map +1 -0
- package/dist/utils/playlistUtils.d.ts +149 -0
- package/dist/utils/playlistUtils.d.ts.map +1 -0
- package/dist/utils/random.d.ts +34 -0
- package/dist/utils/random.d.ts.map +1 -0
- package/dist/utils/sensorDashboard.d.ts +60 -0
- package/dist/utils/sensorDashboard.d.ts.map +1 -0
- package/dist/utils/validators.d.ts +189 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Validator
|
|
3
|
+
*
|
|
4
|
+
* Validates class features and racial traits against strict schemas.
|
|
5
|
+
* Provides comprehensive validation for all feature properties including:
|
|
6
|
+
* - Required fields (id, name, description, etc.)
|
|
7
|
+
* - Valid enum values (class, race, type, source)
|
|
8
|
+
* - Value ranges (level 1-20)
|
|
9
|
+
* - Effects and prerequisites
|
|
10
|
+
* Uses shared AbilityConstants for code deduplication.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Validation result interface
|
|
14
|
+
*
|
|
15
|
+
* Provides detailed feedback about validation failures.
|
|
16
|
+
*/
|
|
17
|
+
export interface ValidationResult {
|
|
18
|
+
/** Whether the item is valid */
|
|
19
|
+
valid: boolean;
|
|
20
|
+
/** Array of error messages (empty if valid) */
|
|
21
|
+
errors: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Validation options for features and traits
|
|
25
|
+
*
|
|
26
|
+
* Provides additional context for validation, such as custom races/classes
|
|
27
|
+
* registered via ExtensionManager.
|
|
28
|
+
*/
|
|
29
|
+
export interface ValidationOptions {
|
|
30
|
+
/** Custom races registered via ExtensionManager */
|
|
31
|
+
customRaces?: string[];
|
|
32
|
+
/** Custom classes registered via ExtensionManager */
|
|
33
|
+
customClasses?: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* FeatureValidator - Validates class features and racial traits
|
|
37
|
+
*
|
|
38
|
+
* Provides strict validation to ensure custom features and traits
|
|
39
|
+
* meet all requirements before being registered with FeatureQuery.
|
|
40
|
+
*/
|
|
41
|
+
export declare class FeatureValidator {
|
|
42
|
+
/**
|
|
43
|
+
* Validate a class feature
|
|
44
|
+
*
|
|
45
|
+
* Checks all required fields, enum values, and data constraints.
|
|
46
|
+
*
|
|
47
|
+
* @param feature - The class feature to validate
|
|
48
|
+
* @param options - Optional validation context (e.g., custom races/classes)
|
|
49
|
+
* @returns Validation result with errors if any
|
|
50
|
+
*/
|
|
51
|
+
static validateClassFeature(feature: unknown, options?: ValidationOptions): ValidationResult;
|
|
52
|
+
/**
|
|
53
|
+
* Validate a racial trait
|
|
54
|
+
*
|
|
55
|
+
* Checks all required fields, enum values, and data constraints.
|
|
56
|
+
*
|
|
57
|
+
* @param trait - The racial trait to validate
|
|
58
|
+
* @param options - Optional validation context (e.g., custom races)
|
|
59
|
+
* @returns Validation result with errors if any
|
|
60
|
+
*/
|
|
61
|
+
static validateRacialTrait(trait: unknown, options?: ValidationOptions): ValidationResult;
|
|
62
|
+
/**
|
|
63
|
+
* Validate a feature effect
|
|
64
|
+
*
|
|
65
|
+
* @param effect - The effect to validate
|
|
66
|
+
* @returns Validation result with errors if any
|
|
67
|
+
*/
|
|
68
|
+
static validateEffect(effect: unknown): ValidationResult;
|
|
69
|
+
/**
|
|
70
|
+
* Validate feature prerequisites
|
|
71
|
+
*
|
|
72
|
+
* @param prerequisites - The prerequisites to validate
|
|
73
|
+
* @param options - Optional validation context (e.g., custom races/classes)
|
|
74
|
+
* @returns Validation result with errors if any
|
|
75
|
+
*/
|
|
76
|
+
static validatePrerequisites(prerequisites: unknown, options?: ValidationOptions): ValidationResult;
|
|
77
|
+
/**
|
|
78
|
+
* Validate an array of class features
|
|
79
|
+
*
|
|
80
|
+
* @param features - Array of class features to validate
|
|
81
|
+
* @returns Validation result with combined errors
|
|
82
|
+
*/
|
|
83
|
+
static validateClassFeatures(features: unknown[]): ValidationResult;
|
|
84
|
+
/**
|
|
85
|
+
* Validate an array of racial traits
|
|
86
|
+
*
|
|
87
|
+
* @param traits - Array of racial traits to validate
|
|
88
|
+
* @returns Validation result with combined errors
|
|
89
|
+
*/
|
|
90
|
+
static validateRacialTraits(traits: unknown[]): ValidationResult;
|
|
91
|
+
/**
|
|
92
|
+
* Check if a string is a valid ability score
|
|
93
|
+
*
|
|
94
|
+
* Re-exports the shared isValidAbility function for convenience.
|
|
95
|
+
*
|
|
96
|
+
* @param ability - The ability string to check
|
|
97
|
+
* @returns True if it's a valid ability
|
|
98
|
+
*/
|
|
99
|
+
private static isAbility;
|
|
100
|
+
/**
|
|
101
|
+
* Check if a feature ID follows the correct naming convention
|
|
102
|
+
*
|
|
103
|
+
* Feature IDs should use lowercase_with_underscores format.
|
|
104
|
+
* Examples: 'barbarian_rage', 'elf_darkvision', 'fighter_action_surge'
|
|
105
|
+
*
|
|
106
|
+
* @param id - The feature ID to check
|
|
107
|
+
* @returns True if the ID format is valid
|
|
108
|
+
*/
|
|
109
|
+
private static isValidFeatureId;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Helper function to validate a single class feature
|
|
113
|
+
*
|
|
114
|
+
* Convenience function for quick validation.
|
|
115
|
+
*
|
|
116
|
+
* @param feature - The class feature to validate
|
|
117
|
+
* @param options - Optional validation context (e.g., custom races/classes)
|
|
118
|
+
* @returns Validation result with errors if any
|
|
119
|
+
*/
|
|
120
|
+
export declare function validateClassFeature(feature: unknown, options?: ValidationOptions): ValidationResult;
|
|
121
|
+
/**
|
|
122
|
+
* Helper function to validate a single racial trait
|
|
123
|
+
*
|
|
124
|
+
* Convenience function for quick validation.
|
|
125
|
+
*
|
|
126
|
+
* @param trait - The racial trait to validate
|
|
127
|
+
* @param options - Optional validation context (e.g., custom races)
|
|
128
|
+
* @returns Validation result with errors if any
|
|
129
|
+
*/
|
|
130
|
+
export declare function validateRacialTrait(trait: unknown, options?: ValidationOptions): ValidationResult;
|
|
131
|
+
/**
|
|
132
|
+
* Helper function to validate an array of class features
|
|
133
|
+
*
|
|
134
|
+
* Convenience function for batch validation.
|
|
135
|
+
*
|
|
136
|
+
* @param features - Array of class features to validate
|
|
137
|
+
* @returns Validation result with combined errors
|
|
138
|
+
*/
|
|
139
|
+
export declare function validateClassFeatures(features: unknown[]): ValidationResult;
|
|
140
|
+
/**
|
|
141
|
+
* Helper function to validate an array of racial traits
|
|
142
|
+
*
|
|
143
|
+
* Convenience function for batch validation.
|
|
144
|
+
*
|
|
145
|
+
* @param traits - Array of racial traits to validate
|
|
146
|
+
* @returns Validation result with combined errors
|
|
147
|
+
*/
|
|
148
|
+
export declare function validateRacialTraits(traits: unknown[]): ValidationResult;
|
|
149
|
+
//# sourceMappingURL=FeatureValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureValidator.d.ts","sourceRoot":"","sources":["../../../src/core/features/FeatureValidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AA2ED;;;;;GAKG;AACH,qBAAa,gBAAgB;IACzB;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB;IAyG5F;;;;;;;;OAQG;IACH,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB;IAsGzF;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB;IA2DxD;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB;IAuInG;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,gBAAgB;IAuBnE;;;;;OAKG;IACH,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,gBAAgB;IAuBhE;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAMlC;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAEpG;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAEjG;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAE3E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAExE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Features module - Class features and racial traits system
|
|
3
|
+
*
|
|
4
|
+
* Provides extensible feature and trait management with validation.
|
|
5
|
+
*/
|
|
6
|
+
export type { FeatureEffectType, FeatureEffect, FeaturePrerequisite, FeatureType, FeatureSource, ClassFeature, RacialTrait, CharacterFeature, CharacterTrait, ValidationResult } from './FeatureTypes.js';
|
|
7
|
+
export { FeatureQuery, getFeatureQuery } from './FeatureQuery.js';
|
|
8
|
+
export { DEFAULT_CLASS_FEATURES, DEFAULT_RACIAL_TRAITS } from '../../constants/DefaultFeatures.js';
|
|
9
|
+
export { FeatureEffectApplier } from './FeatureEffectApplier.js';
|
|
10
|
+
export type { EffectApplicationResult } from '../types/Equipment.js';
|
|
11
|
+
export { FeatureValidator, validateClassFeature, validateRacialTrait, validateClassFeatures, validateRacialTraits, type ValidationResult as FeatureValidationResult } from './FeatureValidator.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/features/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACR,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGlE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAGnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EACH,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,gBAAgB,IAAI,uBAAuB,EACnD,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ability Score Calculator - Maps audio profile to ability scores
|
|
3
|
+
* Based on specs/001-core-engine/SPEC.md
|
|
4
|
+
*/
|
|
5
|
+
import type { AbilityScores } from '../types/Character.js';
|
|
6
|
+
import type { AudioProfile } from '../types/AudioProfile.js';
|
|
7
|
+
import type { SeededRNG } from '../../utils/random.js';
|
|
8
|
+
/**
|
|
9
|
+
* Calculate D&D 5e ability scores and modifiers from audio characteristics
|
|
10
|
+
*
|
|
11
|
+
* NEW SYSTEM (v2):
|
|
12
|
+
* - Each frequency band (bass/mid/treble) is randomly assigned to 2 abilities
|
|
13
|
+
* - 50% random + 50% audio-influenced for each ability
|
|
14
|
+
* - One of each pair gets "spice" (combined with additional audio metrics)
|
|
15
|
+
* - One of each pair uses pure dominance value
|
|
16
|
+
*
|
|
17
|
+
* This ensures every song generates different stat distributions.
|
|
18
|
+
*/
|
|
19
|
+
export declare class AbilityScoreCalculator {
|
|
20
|
+
/**
|
|
21
|
+
* Get a spiced audio value for a frequency band
|
|
22
|
+
* Combines the dominance value with an additional metric for variety
|
|
23
|
+
*/
|
|
24
|
+
private static getSpicedValue;
|
|
25
|
+
/**
|
|
26
|
+
* Create frequency-to-ability mappings using seeded RNG
|
|
27
|
+
* Each frequency (bass/mid/treble) gets assigned 2 unique abilities
|
|
28
|
+
*/
|
|
29
|
+
private static createFrequencyMappings;
|
|
30
|
+
/**
|
|
31
|
+
* Calculate base ability scores (8-15) from audio profile frequencies
|
|
32
|
+
*
|
|
33
|
+
* NEW SYSTEM:
|
|
34
|
+
* - Randomly assigns bass/mid/treble to ability pairs (deterministic per seed)
|
|
35
|
+
* - 50% random + 50% audio for each score
|
|
36
|
+
* - One ability per pair gets "spiced" audio value
|
|
37
|
+
* - Result: 8-15 range (D&D 5e standard array range)
|
|
38
|
+
*
|
|
39
|
+
* @param {AudioProfile} audioProfile - Frequency analysis results
|
|
40
|
+
* @param {SeededRNG} rng - Seeded random number generator for reproducibility
|
|
41
|
+
* @returns {AbilityScores} Base scores (before racial bonuses), range 8-15
|
|
42
|
+
*/
|
|
43
|
+
static calculateBaseScores(audioProfile: AudioProfile, rng: SeededRNG): AbilityScores;
|
|
44
|
+
/**
|
|
45
|
+
* Apply racial ability bonuses to base scores
|
|
46
|
+
*
|
|
47
|
+
* Each D&D 5e race provides +2 bonuses to specific abilities. This function
|
|
48
|
+
* applies those racial bonuses and ensures no ability exceeds the D&D maximum of 20.
|
|
49
|
+
*
|
|
50
|
+
* Supports both default D&D 5e races and custom races registered via ExtensionManager.
|
|
51
|
+
*
|
|
52
|
+
* @param {AbilityScores} baseScores - Base scores before racial bonuses
|
|
53
|
+
* @param {string} race - Selected character race (e.g., 'Human', 'Elf', 'Dwarf', or custom race)
|
|
54
|
+
* @returns {AbilityScores} Final scores with racial bonuses applied (capped at 20)
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* // Default race
|
|
58
|
+
* const bonusedScores = AbilityScoreCalculator.applyRacialBonuses(baseScores, 'Elf');
|
|
59
|
+
* // For Elf: DEX +2, assuming baseScores.DEX was 14 → becomes 16
|
|
60
|
+
*
|
|
61
|
+
* // Custom race (if registered via ExtensionManager)
|
|
62
|
+
* const customScores = AbilityScoreCalculator.applyRacialBonuses(baseScores, 'Dragonkin');
|
|
63
|
+
*/
|
|
64
|
+
static applyRacialBonuses(baseScores: AbilityScores, race: string): AbilityScores;
|
|
65
|
+
/**
|
|
66
|
+
* Calculate ability modifiers from ability scores
|
|
67
|
+
*
|
|
68
|
+
* D&D 5e modifiers are derived from ability scores using the formula:
|
|
69
|
+
* modifier = floor((score - 10) / 2)
|
|
70
|
+
*
|
|
71
|
+
* Example: Score 15 → modifier +2, Score 8 → modifier -1, Score 10 → modifier 0
|
|
72
|
+
*
|
|
73
|
+
* @param {AbilityScores} scores - Ability scores (3-20 range)
|
|
74
|
+
* @returns {AbilityScores} Modifiers used for d20 rolls and damage calculations
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* const scores = { STR: 15, DEX: 14, CON: 13, INT: 12, WIS: 11, CHA: 10 };
|
|
78
|
+
* const modifiers = AbilityScoreCalculator.calculateModifiers(scores);
|
|
79
|
+
* console.log(`STR modifier: +${modifiers.STR}`); // +2
|
|
80
|
+
*/
|
|
81
|
+
static calculateModifiers(scores: AbilityScores): AbilityScores;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=AbilityScoreCalculator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilityScoreCalculator.d.ts","sourceRoot":"","sources":["../../../src/core/generation/AbilityScoreCalculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAcvD;;;;;;;;;;GAUG;AACH,qBAAa,sBAAsB;IAC/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAuC7B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IA2BtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,GAAG,aAAa;IA2DrF;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa;IAqBjF;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;CAUlE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Class } from '../types/Character.js';
|
|
2
|
+
import type { AudioProfile } from '../types/AudioProfile.js';
|
|
3
|
+
export interface CharacterAppearance {
|
|
4
|
+
body_type: 'slender' | 'athletic' | 'muscular' | 'stocky';
|
|
5
|
+
skin_tone: string;
|
|
6
|
+
hair_style: string;
|
|
7
|
+
hair_color: string;
|
|
8
|
+
eye_color: string;
|
|
9
|
+
facial_features: string[];
|
|
10
|
+
primary_color?: string;
|
|
11
|
+
secondary_color?: string;
|
|
12
|
+
accent_color?: string;
|
|
13
|
+
aura_color?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class AppearanceGenerator {
|
|
16
|
+
/**
|
|
17
|
+
* Generate character appearance from seed and audio profile
|
|
18
|
+
*
|
|
19
|
+
* Uses the ExtensionManager to get appearance options (defaults + custom)
|
|
20
|
+
* and WeightedSelector for spawn rate control.
|
|
21
|
+
*/
|
|
22
|
+
static generate(seed: string, characterClass: Class, audioProfile: AudioProfile): CharacterAppearance;
|
|
23
|
+
/**
|
|
24
|
+
* Generate aura color for magical classes
|
|
25
|
+
*/
|
|
26
|
+
private static generateAuraColor;
|
|
27
|
+
/**
|
|
28
|
+
* Adjust color brightness by a factor
|
|
29
|
+
*/
|
|
30
|
+
private static adjustColorBrightness;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=AppearanceGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppearanceGenerator.d.ts","sourceRoot":"","sources":["../../../src/core/generation/AppearanceGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAM7D,MAAM,WAAW,mBAAmB;IAEhC,SAAS,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,EAAE,CAAC;IAG1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAaD,qBAAa,mBAAmB;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CACX,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,KAAK,EACrB,YAAY,EAAE,YAAY,GAC3B,mBAAmB;IA4EtB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAuBhC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAkBvC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beat Converter - Converts procedural generation output to ChartedBeatMap
|
|
3
|
+
*
|
|
4
|
+
* This class converts DifficultyVariant output (GeneratedBeat[]) to ChartedBeatMap
|
|
5
|
+
* format for compatibility with BeatStream and the existing beat map infrastructure.
|
|
6
|
+
*
|
|
7
|
+
* Part of the Pitch Detection & Button Mapping pipeline - Phase 2.7
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const converter = new BeatConverter();
|
|
12
|
+
*
|
|
13
|
+
* const chartedBeatMap = converter.convertToChartedBeatMap(
|
|
14
|
+
* variant,
|
|
15
|
+
* unifiedBeatMap,
|
|
16
|
+
* keyAssignments,
|
|
17
|
+
* metadata
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import type { UnifiedBeatMap } from '../types/BeatMap.js';
|
|
22
|
+
import type { ChartedBeatMap, ChartConversionOptions, ChartMetadata } from '../types/ChartedBeatMap.js';
|
|
23
|
+
import type { DifficultyVariant } from '../analysis/beat/DifficultyVariantGenerator.js';
|
|
24
|
+
import type { ButtonMappingMetadata } from './ButtonMapper.js';
|
|
25
|
+
import type { RhythmMetadata } from './RhythmGenerator.js';
|
|
26
|
+
/**
|
|
27
|
+
* Converts procedural generation output (GeneratedBeat[]) to ChartedBeatMap
|
|
28
|
+
* for compatibility with BeatStream and the existing beat map infrastructure.
|
|
29
|
+
*/
|
|
30
|
+
export declare class BeatConverter {
|
|
31
|
+
/**
|
|
32
|
+
* Convert a DifficultyVariant to a ChartedBeatMap
|
|
33
|
+
*
|
|
34
|
+
* @param variant - The difficulty variant with VariantBeat[]
|
|
35
|
+
* @param unifiedBeatMap - The source UnifiedBeatMap for measure/beat info
|
|
36
|
+
* @param keyAssignments - Map of beat index to required key
|
|
37
|
+
* @param partialMetadata - Partial chart metadata
|
|
38
|
+
* @param mappingSources - Optional per-beat mapping source (beat index → 'pitch' | 'pattern')
|
|
39
|
+
* @param mappingPatternIds - Optional per-beat pattern IDs (beat index → pattern ID)
|
|
40
|
+
* @returns A ChartedBeatMap ready for BeatStream
|
|
41
|
+
*/
|
|
42
|
+
convertToChartedBeatMap(variant: DifficultyVariant, unifiedBeatMap: UnifiedBeatMap, keyAssignments: Map<number, string>, partialMetadata: Partial<ChartMetadata>, mappingSources?: Map<number, 'pitch' | 'pattern'>, mappingPatternIds?: Map<number, string | undefined>): ChartedBeatMap;
|
|
43
|
+
/**
|
|
44
|
+
* Convert with full options object
|
|
45
|
+
*
|
|
46
|
+
* @param options - Conversion options
|
|
47
|
+
* @returns A ChartedBeatMap ready for BeatStream
|
|
48
|
+
*/
|
|
49
|
+
convertWithOptions(variant: DifficultyVariant, options: ChartConversionOptions): ChartedBeatMap;
|
|
50
|
+
/**
|
|
51
|
+
* Convert a single VariantBeat to ChartedBeat
|
|
52
|
+
*
|
|
53
|
+
* @param beat - The VariantBeat to convert
|
|
54
|
+
* @param unifiedBeatMap - Source for measure/beat info
|
|
55
|
+
* @param key - The required key (if assigned)
|
|
56
|
+
* @param beatIndex - Index of this beat in the variant
|
|
57
|
+
* @param mappingSource - Whether this beat's key came from pitch or pattern
|
|
58
|
+
* @param patternId - ID of the pattern used (if mappingSource is 'pattern')
|
|
59
|
+
* @returns A ChartedBeat
|
|
60
|
+
*/
|
|
61
|
+
private convertBeat;
|
|
62
|
+
/**
|
|
63
|
+
* Get the parent quarter note beat from UnifiedBeatMap
|
|
64
|
+
*/
|
|
65
|
+
private getParentBeat;
|
|
66
|
+
/**
|
|
67
|
+
* Calculate beatInMeasure for a variant beat
|
|
68
|
+
*
|
|
69
|
+
* @param parentBeat - The parent quarter note beat
|
|
70
|
+
* @param gridPosition - Position within that quarter (0-3 for 16th, 0-2 for triplet)
|
|
71
|
+
* @param gridType - The grid type
|
|
72
|
+
* @returns Decimal beatInMeasure value
|
|
73
|
+
*/
|
|
74
|
+
private calculateBeatInMeasure;
|
|
75
|
+
/**
|
|
76
|
+
* Determine if a beat was originally detected (vs generated)
|
|
77
|
+
*
|
|
78
|
+
* A beat is considered detected if:
|
|
79
|
+
* - It has no quantization error (wasn't moved), OR
|
|
80
|
+
* - It has a very small quantization error (< 10ms)
|
|
81
|
+
*/
|
|
82
|
+
private isBeatDetected;
|
|
83
|
+
/**
|
|
84
|
+
* Map grid type to subdivision type
|
|
85
|
+
*/
|
|
86
|
+
private mapGridToSubdivision;
|
|
87
|
+
/**
|
|
88
|
+
* Calculate confidence for a beat
|
|
89
|
+
*
|
|
90
|
+
* @param beat - The beat
|
|
91
|
+
* @param isDetected - Whether the beat was detected
|
|
92
|
+
* @returns Confidence value (0-1)
|
|
93
|
+
*/
|
|
94
|
+
private calculateConfidence;
|
|
95
|
+
/**
|
|
96
|
+
* Build complete chart metadata
|
|
97
|
+
*/
|
|
98
|
+
private buildChartMetadata;
|
|
99
|
+
/**
|
|
100
|
+
* Get unique keys used in the chart
|
|
101
|
+
*/
|
|
102
|
+
private getUniqueKeys;
|
|
103
|
+
/**
|
|
104
|
+
* Get subdivision types used in the chart
|
|
105
|
+
*/
|
|
106
|
+
private getSubdivisionTypesUsed;
|
|
107
|
+
/**
|
|
108
|
+
* Create default rhythm metadata summary
|
|
109
|
+
*/
|
|
110
|
+
private createDefaultRhythmMetadata;
|
|
111
|
+
/**
|
|
112
|
+
* Create a ChartedBeatMap from mapped level result
|
|
113
|
+
*
|
|
114
|
+
* Convenience method that combines variant, beat map, and button mapping
|
|
115
|
+
*
|
|
116
|
+
* @param variant - The difficulty variant
|
|
117
|
+
* @param unifiedBeatMap - The unified beat map
|
|
118
|
+
* @param buttonMetadata - Button mapping metadata
|
|
119
|
+
* @param rhythmMetadata - Rhythm generation metadata
|
|
120
|
+
* @param keyAssignments - Per-beat key assignments (beat index → key)
|
|
121
|
+
* @param mappingSources - Per-beat mapping source (beat index → 'pitch' | 'pattern')
|
|
122
|
+
* @param mappingPatternIds - Per-beat pattern IDs (beat index → pattern ID)
|
|
123
|
+
* @returns A ChartedBeatMap ready for BeatStream
|
|
124
|
+
*/
|
|
125
|
+
static fromMappedResult(variant: DifficultyVariant, unifiedBeatMap: UnifiedBeatMap, buttonMetadata: ButtonMappingMetadata, rhythmMetadata: RhythmMetadata, keyAssignments?: Map<number, string>, mappingSources?: Map<number, 'pitch' | 'pattern'>, mappingPatternIds?: Map<number, string | undefined>): ChartedBeatMap;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=BeatConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeatConverter.d.ts","sourceRoot":"","sources":["../../../src/core/generation/BeatConverter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAER,cAAc,EACd,sBAAsB,EACtB,aAAa,EAEhB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,KAAK,EACR,iBAAiB,EAGpB,MAAM,gDAAgD,CAAC;AAExD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM3D;;;GAGG;AACH,qBAAa,aAAa;IAKtB;;;;;;;;;;OAUG;IACH,uBAAuB,CACnB,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,eAAe,EAAE,OAAO,CAAC,aAAa,CAAC,EACvC,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,EACjD,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACpD,cAAc;IA4CjB;;;;;OAKG;IACH,kBAAkB,CACd,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,sBAAsB,GAChC,cAAc;IA+CjB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW;IAkDnB;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;IAS9B;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAc3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2B1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAUrB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAQ/B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAcnC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,gBAAgB,CACnB,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,qBAAqB,EACrC,cAAc,EAAE,cAAc,EAC9B,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,EACjD,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACpD,cAAc;CA8CpB"}
|