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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SkillAssigner - Assigns D&D 5e skill proficiencies based on character class
|
|
3
|
+
*/
|
|
4
|
+
import type { Class, ProficiencyLevel, CharacterSheet } from '../types/Character.js';
|
|
5
|
+
import type { SeededRNG } from '../../utils/random.js';
|
|
6
|
+
export declare class SkillAssigner {
|
|
7
|
+
/**
|
|
8
|
+
* Get skill list definition for a class from ExtensionManager
|
|
9
|
+
*
|
|
10
|
+
* Checks the 'skillLists' category for a matching class entry.
|
|
11
|
+
* Returns undefined if no custom skill list is registered.
|
|
12
|
+
*
|
|
13
|
+
* @param characterClass - The class to get skill list data for
|
|
14
|
+
* @returns SkillListDefinition or undefined
|
|
15
|
+
*/
|
|
16
|
+
private static getSkillListDefinition;
|
|
17
|
+
/**
|
|
18
|
+
* Assign skill proficiencies based on character class
|
|
19
|
+
*
|
|
20
|
+
* Now uses SkillQuery to support custom skills and validates all skill IDs.
|
|
21
|
+
* Supports weighted skill selection via ExtensionManager integration.
|
|
22
|
+
* Filters skills by prerequisites when a character is provided.
|
|
23
|
+
*
|
|
24
|
+
* @param characterClass - The character's class
|
|
25
|
+
* @param rng - Seeded random number generator for deterministic selection
|
|
26
|
+
* @param character - Optional character sheet for prerequisite validation
|
|
27
|
+
* @returns Record of all skills with their proficiency levels (supports custom skills)
|
|
28
|
+
*/
|
|
29
|
+
static assignSkills(characterClass: Class, rng: SeededRNG, character?: CharacterSheet): Record<string, ProficiencyLevel>;
|
|
30
|
+
/**
|
|
31
|
+
* Validate skills against the SkillQuery
|
|
32
|
+
*
|
|
33
|
+
* Filters out any skill IDs that are not registered in the SkillQuery.
|
|
34
|
+
* This prevents invalid skill IDs from being assigned.
|
|
35
|
+
*
|
|
36
|
+
* @param skillIds - Array of skill IDs to validate
|
|
37
|
+
* @param registry - SkillQuery instance
|
|
38
|
+
* @returns Array of valid skill IDs
|
|
39
|
+
*/
|
|
40
|
+
private static validateSkills;
|
|
41
|
+
/**
|
|
42
|
+
* Filter skills by prerequisites
|
|
43
|
+
*
|
|
44
|
+
* Removes skills that have unmet prerequisites for the given character.
|
|
45
|
+
* Skills without prerequisites are always included.
|
|
46
|
+
*
|
|
47
|
+
* @param skillIds - Array of skill IDs to filter
|
|
48
|
+
* @param registry - SkillQuery instance
|
|
49
|
+
* @param character - Character sheet to validate prerequisites against
|
|
50
|
+
* @returns Array of skill IDs whose prerequisites are met
|
|
51
|
+
*/
|
|
52
|
+
private static filterSkillsByPrerequisites;
|
|
53
|
+
/**
|
|
54
|
+
* Deterministically select N random skills from a list
|
|
55
|
+
*
|
|
56
|
+
* Uses Fisher-Yates shuffle with seeded RNG for deterministic selection.
|
|
57
|
+
* Supports weighted selection via selectionWeights parameter.
|
|
58
|
+
*
|
|
59
|
+
* @param availableSkills - Array of skill IDs to choose from
|
|
60
|
+
* @param count - Number of skills to select
|
|
61
|
+
* @param rng - Seeded random number generator
|
|
62
|
+
* @param selectionWeights - Optional weights for skill selection
|
|
63
|
+
* @returns Array of selected skill IDs
|
|
64
|
+
*/
|
|
65
|
+
private static selectSkills;
|
|
66
|
+
/**
|
|
67
|
+
* Select N random skills using equal weights
|
|
68
|
+
*
|
|
69
|
+
* Uses Fisher-Yates shuffle with seeded RNG for deterministic selection.
|
|
70
|
+
*
|
|
71
|
+
* @param availableSkills - Array of skill IDs to choose from
|
|
72
|
+
* @param count - Number of skills to select
|
|
73
|
+
* @param rng - Seeded random number generator
|
|
74
|
+
* @returns Array of selected skill IDs
|
|
75
|
+
*/
|
|
76
|
+
private static selectSkillsEqualWeight;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=SkillAssigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkillAssigner.d.ts","sourceRoot":"","sources":["../../../src/core/generation/SkillAssigner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAqBvD,qBAAa,aAAa;IACtB;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAerC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAY,CACf,cAAc,EAAE,KAAK,EACrB,GAAG,EAAE,SAAS,EACd,SAAS,CAAC,EAAE,cAAc,GAC3B,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC;IA8DnC;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAc7B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IA0B1C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAwE3B;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAiBzC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SpellManager - Manages spell assignment, spell slots, and cantrips for spellcasting classes
|
|
3
|
+
*/
|
|
4
|
+
import type { Class, CharacterSheet } from '../types/Character.js';
|
|
5
|
+
export interface SpellSlots {
|
|
6
|
+
/** Record of spell slots by spell level (0-9) */
|
|
7
|
+
spell_slots: Record<number, {
|
|
8
|
+
total: number;
|
|
9
|
+
used: number;
|
|
10
|
+
}>;
|
|
11
|
+
/** Array of known spell names */
|
|
12
|
+
known_spells: string[];
|
|
13
|
+
/** Array of cantrip names */
|
|
14
|
+
cantrips: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare class SpellManager {
|
|
17
|
+
/**
|
|
18
|
+
* Check if a class is a spellcaster
|
|
19
|
+
*
|
|
20
|
+
* @param characterClass - The character's class
|
|
21
|
+
* @returns true if the class can cast spells
|
|
22
|
+
*/
|
|
23
|
+
static isSpellcaster(characterClass: Class): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get spell slots for a class at a given level
|
|
26
|
+
*
|
|
27
|
+
* Uses the getSpellSlotsForClass() helper to get spell slot progression (default or custom).
|
|
28
|
+
* This supports custom classes registered via the 'classSpellSlots' category in ExtensionManager.
|
|
29
|
+
*
|
|
30
|
+
* @param characterClass - The character's class
|
|
31
|
+
* @param characterLevel - The character's level (1-20)
|
|
32
|
+
* @returns Record of spell slots by spell level with total and used counts
|
|
33
|
+
*/
|
|
34
|
+
static getSpellSlots(characterClass: Class, characterLevel: number): Record<number, {
|
|
35
|
+
total: number;
|
|
36
|
+
used: number;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Get cantrips known by a spellcaster at a given level
|
|
40
|
+
*
|
|
41
|
+
* Uses the getClassSpellList() helper to get spell lists (default or custom).
|
|
42
|
+
* Also checks ExtensionManager for extended spell data via `spells.${ClassName}`.
|
|
43
|
+
*
|
|
44
|
+
* @param characterClass - The character's class
|
|
45
|
+
* @returns Array of cantrip names
|
|
46
|
+
*/
|
|
47
|
+
static getCantrips(characterClass: Class): string[];
|
|
48
|
+
/**
|
|
49
|
+
* Get spells known by a spellcaster at a given level
|
|
50
|
+
*
|
|
51
|
+
* Uses the getClassSpellList() helper to get spell lists (default or custom).
|
|
52
|
+
* Also checks ExtensionManager for extended spell data via `spells.${ClassName}`.
|
|
53
|
+
* Filters spells by prerequisites when a character is provided.
|
|
54
|
+
*
|
|
55
|
+
* @param characterClass - The character's class
|
|
56
|
+
* @param characterLevel - The character's level (1-20)
|
|
57
|
+
* @param character - Optional character sheet for prerequisite validation
|
|
58
|
+
* @returns Array of spell names that the character knows
|
|
59
|
+
*/
|
|
60
|
+
static getKnownSpells(characterClass: Class, characterLevel: number, character?: CharacterSheet): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Filter spells by prerequisites
|
|
63
|
+
*
|
|
64
|
+
* Removes spells that have unmet prerequisites for the given character.
|
|
65
|
+
* Spells without prerequisites are always included.
|
|
66
|
+
*
|
|
67
|
+
* @param spellNames - Array of spell names to filter
|
|
68
|
+
* @param character - Character sheet to validate prerequisites against
|
|
69
|
+
* @returns Array of spell names whose prerequisites are met
|
|
70
|
+
*/
|
|
71
|
+
private static filterSpellsByPrerequisites;
|
|
72
|
+
/**
|
|
73
|
+
* Initialize complete spell configuration for a spellcaster
|
|
74
|
+
*
|
|
75
|
+
* @param characterClass - The character's class
|
|
76
|
+
* @param characterLevel - The character's level (1-20)
|
|
77
|
+
* @param character - Optional character sheet for prerequisite validation
|
|
78
|
+
* @returns SpellSlots object with spell slots, known spells, and cantrips
|
|
79
|
+
*/
|
|
80
|
+
static initializeSpells(characterClass: Class, characterLevel: number, character?: CharacterSheet): SpellSlots;
|
|
81
|
+
/**
|
|
82
|
+
* Get spell count at a given spell level that a character knows
|
|
83
|
+
*
|
|
84
|
+
* @param spellLevel - The spell level (0-9)
|
|
85
|
+
* @param spellSlots - The spell slots record from a character
|
|
86
|
+
* @returns Number of spells known at that level
|
|
87
|
+
*/
|
|
88
|
+
static getSpellCountAtLevel(spellLevel: number, spellSlots: Record<number, {
|
|
89
|
+
total: number;
|
|
90
|
+
used: number;
|
|
91
|
+
}>): number;
|
|
92
|
+
/**
|
|
93
|
+
* Use a spell slot at a given level
|
|
94
|
+
*
|
|
95
|
+
* @param spellSlots - The spell slots record from a character
|
|
96
|
+
* @param spellLevel - The spell level (1-9, not 0 for cantrips)
|
|
97
|
+
* @returns Updated spell slots with one slot used
|
|
98
|
+
*/
|
|
99
|
+
static useSpellSlot(spellSlots: Record<number, {
|
|
100
|
+
total: number;
|
|
101
|
+
used: number;
|
|
102
|
+
}>, spellLevel: number): Record<number, {
|
|
103
|
+
total: number;
|
|
104
|
+
used: number;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Restore all spell slots at a given level
|
|
108
|
+
*
|
|
109
|
+
* @param spellSlots - The spell slots record from a character
|
|
110
|
+
* @param spellLevel - The spell level (1-9) or undefined to restore all
|
|
111
|
+
* @returns Updated spell slots with slots restored
|
|
112
|
+
*/
|
|
113
|
+
static restoreSpellSlots(spellSlots: Record<number, {
|
|
114
|
+
total: number;
|
|
115
|
+
used: number;
|
|
116
|
+
}>, spellLevel?: number): Record<number, {
|
|
117
|
+
total: number;
|
|
118
|
+
used: number;
|
|
119
|
+
}>;
|
|
120
|
+
/**
|
|
121
|
+
* Filter character's spells by prerequisites
|
|
122
|
+
*
|
|
123
|
+
* Updates a character's known_spells array to only include spells whose
|
|
124
|
+
* prerequisites are met by the character. Used during character generation
|
|
125
|
+
* and when validating characters with custom spells.
|
|
126
|
+
*
|
|
127
|
+
* @param character - The character sheet whose spells should be filtered
|
|
128
|
+
* @returns Updated character with filtered spells
|
|
129
|
+
*/
|
|
130
|
+
static filterCharacterSpells(character: CharacterSheet): CharacterSheet;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=SpellManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpellManager.d.ts","sourceRoot":"","sources":["../../../src/core/generation/SpellManager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiBnE,MAAM,WAAW,UAAU;IACzB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,iCAAiC;IACjC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,cAAc,EAAE,KAAK,GAAG,OAAO;IAKpD;;;;;;;;;OASG;IACH,MAAM,CAAC,aAAa,CAClB,cAAc,EAAE,KAAK,EACrB,cAAc,EAAE,MAAM,GACrB,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IA0BlD;;;;;;;;OAQG;IACH,MAAM,CAAC,WAAW,CAChB,cAAc,EAAE,KAAK,GACpB,MAAM,EAAE;IAiCX;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,cAAc,CACnB,cAAc,EAAE,KAAK,EACrB,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,cAAc,GACzB,MAAM,EAAE;IA+EX;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IA6B1C;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,cAAc,EAAE,KAAK,EACrB,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,cAAc,GACzB,UAAU;IAQb;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,GAC1D,MAAM;IAIT;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAC3D,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAelD;;;;;;OAMG;IACH,MAAM,CAAC,iBAAiB,CACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAC3D,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAqBlD;;;;;;;;;OASG;IACH,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc;CAwBxE"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SpellcastingGenerator - Generates spellcasting abilities for enemies
|
|
3
|
+
*
|
|
4
|
+
* Provides innate spellcasting system for enemies that can cast spells.
|
|
5
|
+
* Unlike player spellcasting, enemies use a simplified "innate" system
|
|
6
|
+
* where they have predefined spells they can use.
|
|
7
|
+
*
|
|
8
|
+
* Spell selection is based on:
|
|
9
|
+
* - Enemy archetype (support, archer, brute)
|
|
10
|
+
* - Rarity tier (bosses get more spells than commons)
|
|
11
|
+
* - Challenge Rating (determines spell slot count)
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Generate spell list for an elite shaman
|
|
16
|
+
* const spellcasting = SpellcastingGenerator.generateSpellList({
|
|
17
|
+
* archetype: 'support',
|
|
18
|
+
* rarity: 'elite',
|
|
19
|
+
* cr: 2,
|
|
20
|
+
* seed: 'elite-shaman'
|
|
21
|
+
* });
|
|
22
|
+
* // Returns: { cantrips: [...], spells: [...], slots: { 1: 3, 2: 1 } }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import { SeededRNG } from '../../utils/random.js';
|
|
26
|
+
import type { EnemyArchetype, EnemyRarity } from '../types/Enemy.js';
|
|
27
|
+
import type { Spell } from '../types/Character.js';
|
|
28
|
+
/**
|
|
29
|
+
* Innate Spell - A spell available to an enemy
|
|
30
|
+
*
|
|
31
|
+
* Represents a single spell that an enemy can cast.
|
|
32
|
+
* Simplified compared to player spells - enemies have predefined spell lists.
|
|
33
|
+
*/
|
|
34
|
+
export interface InnateSpell extends Spell {
|
|
35
|
+
/** Unique identifier for this spell */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Spell level (0 = cantrip, 1-9 = spell level) */
|
|
38
|
+
level: number;
|
|
39
|
+
/** Magical school of the spell */
|
|
40
|
+
school: string;
|
|
41
|
+
/** Description of what the spell does */
|
|
42
|
+
effect: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Spell List - All spells available to an archetype
|
|
46
|
+
*
|
|
47
|
+
* Organized by spell level (0 = cantrips, 1-9 = spell levels).
|
|
48
|
+
* Each archetype has access to different spell themes.
|
|
49
|
+
*/
|
|
50
|
+
export interface SpellList {
|
|
51
|
+
/** Archetype this spell list belongs to */
|
|
52
|
+
archetype: EnemyArchetype;
|
|
53
|
+
/** Cantrips (level 0 spells) - always available */
|
|
54
|
+
cantrips: InnateSpell[];
|
|
55
|
+
/** Level 1 spells */
|
|
56
|
+
level1: InnateSpell[];
|
|
57
|
+
/** Level 2 spells */
|
|
58
|
+
level2: InnateSpell[];
|
|
59
|
+
/** Level 3 spells */
|
|
60
|
+
level3: InnateSpell[];
|
|
61
|
+
/** Level 4 spells (rare, mostly for bosses) */
|
|
62
|
+
level4?: InnateSpell[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Spellcasting Config - Result of spell list generation
|
|
66
|
+
*
|
|
67
|
+
* Contains the selected spells and slot counts for an enemy.
|
|
68
|
+
*/
|
|
69
|
+
export interface SpellcastingConfig {
|
|
70
|
+
/** Cantrips the enemy knows (always available) */
|
|
71
|
+
cantrips: InnateSpell[];
|
|
72
|
+
/** Spells the enemy knows (may have limited slots) */
|
|
73
|
+
spells: InnateSpell[];
|
|
74
|
+
/** Spell slots available per level { level: count } */
|
|
75
|
+
slots: Record<number, number>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* SPELL_SLOTS_BY_CR - Spell slot progression by Challenge Rating
|
|
79
|
+
*
|
|
80
|
+
* Maps CR values to the number of spell slots available.
|
|
81
|
+
* Higher CR enemies have more spell slots and higher level spells.
|
|
82
|
+
*
|
|
83
|
+
* Slot format: { level1: slots, level2: slots, ... }
|
|
84
|
+
*
|
|
85
|
+
* CR 0-0.5: No spellcasting (minions)
|
|
86
|
+
* CR 1-2: Level 1 only (basic casters)
|
|
87
|
+
* CR 3-4: Levels 1-2 (moderate casters)
|
|
88
|
+
* CR 5-7: Levels 1-3 (strong casters)
|
|
89
|
+
* CR 8+: Levels 1-4 (boss casters)
|
|
90
|
+
*/
|
|
91
|
+
export declare const SPELL_SLOTS_BY_CR: Record<number, Record<number, number>>;
|
|
92
|
+
/**
|
|
93
|
+
* Spellcasting generation options
|
|
94
|
+
*/
|
|
95
|
+
export interface SpellcastingGenerationOptions {
|
|
96
|
+
/** Enemy archetype for spell selection */
|
|
97
|
+
archetype: EnemyArchetype;
|
|
98
|
+
/** Enemy rarity for spell count and level limits */
|
|
99
|
+
rarity: EnemyRarity;
|
|
100
|
+
/** Challenge Rating for slot determination */
|
|
101
|
+
cr: number;
|
|
102
|
+
/** Seed for deterministic spell selection */
|
|
103
|
+
seed: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Spellcasting generation options with RNG
|
|
107
|
+
*
|
|
108
|
+
* Same as SpellcastingGenerationOptions but accepts SeededRNG directly.
|
|
109
|
+
*/
|
|
110
|
+
export interface SpellcastingGenerationOptionsWithRNG {
|
|
111
|
+
/** Enemy archetype for spell selection */
|
|
112
|
+
archetype: EnemyArchetype;
|
|
113
|
+
/** Enemy rarity for spell count and level limits */
|
|
114
|
+
rarity: EnemyRarity;
|
|
115
|
+
/** Challenge Rating for slot determination */
|
|
116
|
+
cr: number;
|
|
117
|
+
/** RNG instance for deterministic spell selection */
|
|
118
|
+
rng: SeededRNG;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* SpellcastingGenerator - Static class for generating enemy spellcasting
|
|
122
|
+
*
|
|
123
|
+
* Generates spell lists and slot configurations for enemy casters.
|
|
124
|
+
* Uses deterministic seeded selection for reproducibility.
|
|
125
|
+
*/
|
|
126
|
+
export declare class SpellcastingGenerator {
|
|
127
|
+
/**
|
|
128
|
+
* Generate a spell list for an enemy
|
|
129
|
+
*
|
|
130
|
+
* Selects spells based on archetype, rarity, and CR.
|
|
131
|
+
* Higher rarity enemies get more spells and higher level access.
|
|
132
|
+
*
|
|
133
|
+
* @param options - Spell generation options
|
|
134
|
+
* @returns Spell configuration with spells and slots
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* const spellcasting = SpellcastingGenerator.generateSpellList({
|
|
139
|
+
* archetype: 'support',
|
|
140
|
+
* rarity: 'elite',
|
|
141
|
+
* cr: 3,
|
|
142
|
+
* seed: 'shaman-1'
|
|
143
|
+
* });
|
|
144
|
+
* // Returns: { cantrips: [...], spells: [...], slots: { 1: 4, 2: 2 } }
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
static generateSpellList(options: SpellcastingGenerationOptions): SpellcastingConfig;
|
|
148
|
+
/**
|
|
149
|
+
* Generate a spell list for an enemy using provided RNG
|
|
150
|
+
*
|
|
151
|
+
* Same as generateSpellList but accepts SeededRNG directly.
|
|
152
|
+
* Useful when you already have a seeded RNG instance.
|
|
153
|
+
*
|
|
154
|
+
* @param options - Spell generation options with RNG
|
|
155
|
+
* @returns Spell configuration with spells and slots
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const spellcasting = SpellcastingGenerator.generateSpellListWithRNG({
|
|
160
|
+
* archetype: 'support',
|
|
161
|
+
* rarity: 'elite',
|
|
162
|
+
* cr: 3,
|
|
163
|
+
* rng: seededRNG
|
|
164
|
+
* });
|
|
165
|
+
* // Returns: { cantrips: [...], spells: [...], slots: { 1: 4, 2: 2 } }
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
static generateSpellListWithRNG(options: SpellcastingGenerationOptionsWithRNG): SpellcastingConfig;
|
|
169
|
+
/**
|
|
170
|
+
* Get spell slot configuration for a CR
|
|
171
|
+
*
|
|
172
|
+
* Returns the number of spell slots available per level.
|
|
173
|
+
* Handles fractional CR by rounding up to nearest slot tier.
|
|
174
|
+
*
|
|
175
|
+
* @param cr - Challenge rating
|
|
176
|
+
* @returns Spell slots per level { level: count }
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* getSpellSlotsForCR(3); // Returns: { 1: 4, 2: 2 }
|
|
181
|
+
* getSpellSlotsForCR(0.5); // Returns: {}
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
static getSpellSlotsForCR(cr: number): Record<number, number>;
|
|
185
|
+
/**
|
|
186
|
+
* Check if an archetype can cast spells
|
|
187
|
+
*
|
|
188
|
+
* Currently all archetypes have spell lists available.
|
|
189
|
+
* This is a utility method for future expansion.
|
|
190
|
+
*
|
|
191
|
+
* @param archetype - Enemy archetype to check
|
|
192
|
+
* @returns True if archetype has spellcasting capability
|
|
193
|
+
*/
|
|
194
|
+
static archetypeCanCast(archetype: EnemyArchetype): boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Get all spells for an archetype
|
|
197
|
+
*
|
|
198
|
+
* Returns the complete spell list for an archetype.
|
|
199
|
+
*
|
|
200
|
+
* @param archetype - Enemy archetype
|
|
201
|
+
* @returns Complete spell list or undefined
|
|
202
|
+
*/
|
|
203
|
+
static getSpellListForArchetype(archetype: EnemyArchetype): SpellList | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Convert a spell to a Feature object
|
|
206
|
+
*
|
|
207
|
+
* Creates a ClassFeature-compatible object from an InnateSpell.
|
|
208
|
+
* Used to add spells to enemy ability lists.
|
|
209
|
+
*
|
|
210
|
+
* @param spell - The spell to convert
|
|
211
|
+
* @returns Feature object with isSpell property
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```typescript
|
|
215
|
+
* const spellFeature = SpellcastingGenerator.spellToFeature(blessSpell);
|
|
216
|
+
* // Returns: { id: 'support_bless', name: 'Bless', ..., isSpell: true }
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
static spellToFeature(spell: InnateSpell): Record<string, unknown> & {
|
|
220
|
+
isSpell: boolean;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Convert all spellcasting config to feature objects
|
|
224
|
+
*
|
|
225
|
+
* Converts cantrips and spells to an array of Feature objects.
|
|
226
|
+
*
|
|
227
|
+
* @param config - Spell configuration from generateSpellList
|
|
228
|
+
* @returns Array of feature objects with isSpell property
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```typescript
|
|
232
|
+
* const config = generateSpellList(...);
|
|
233
|
+
* const features = SpellcastingGenerator.spellsToFeatures(config);
|
|
234
|
+
* // Returns: [feature1, feature2, ...] all with isSpell: true
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
static spellsToFeatures(config: SpellcastingConfig): Array<Record<string, unknown> & {
|
|
238
|
+
isSpell: boolean;
|
|
239
|
+
}>;
|
|
240
|
+
/**
|
|
241
|
+
* Check if an enemy should have spellcasting
|
|
242
|
+
*
|
|
243
|
+
* Enemies with the "support" archetype or those with specific
|
|
244
|
+
* template flags would have spellcasting.
|
|
245
|
+
*
|
|
246
|
+
* This is a heuristic - the template may also have a
|
|
247
|
+
* "spellcaster" flag in V2 enhancements.
|
|
248
|
+
*
|
|
249
|
+
* @param archetype - Enemy archetype
|
|
250
|
+
* @param rarity - Enemy rarity
|
|
251
|
+
* @returns True if enemy should get spellcasting
|
|
252
|
+
*/
|
|
253
|
+
static shouldHaveSpellcasting(archetype: EnemyArchetype, rarity: EnemyRarity): boolean;
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=SpellcastingGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpellcastingGenerator.d.ts","sourceRoot":"","sources":["../../../src/core/generation/SpellcastingGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IAEX,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IAEd,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IAEf,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACtB,2CAA2C;IAC3C,SAAS,EAAE,cAAc,CAAC;IAE1B,mDAAmD;IACnD,QAAQ,EAAE,WAAW,EAAE,CAAC;IAExB,qBAAqB;IACrB,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,qBAAqB;IACrB,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,qBAAqB;IACrB,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B,kDAAkD;IAClD,QAAQ,EAAE,WAAW,EAAE,CAAC;IAExB,sDAAsD;IACtD,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8BpE,CAAC;AAmhBF;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C,0CAA0C;IAC1C,SAAS,EAAE,cAAc,CAAC;IAE1B,oDAAoD;IACpD,MAAM,EAAE,WAAW,CAAC;IAEpB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IAEX,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACjD,0CAA0C;IAC1C,SAAS,EAAE,cAAc,CAAC;IAE1B,oDAAoD;IACpD,MAAM,EAAE,WAAW,CAAC;IAEpB,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IAEX,qDAAqD;IACrD,GAAG,EAAE,SAAS,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAAa,qBAAqB;IAC9B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,6BAA6B,GAAG,kBAAkB;IAyFpF;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,oCAAoC,GAAG,kBAAkB;IAwFlG;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAiB7D;;;;;;;;OAQG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO;IAI3D;;;;;;;OAOG;IACH,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,GAAG,SAAS;IAIjF;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;IAsBzF;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAgB1G;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,sBAAsB,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO;CAczF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Character Generation Module
|
|
3
|
+
*
|
|
4
|
+
* Exports all character generation utilities including:
|
|
5
|
+
* - CharacterGenerator: Main character generation from playlists
|
|
6
|
+
* - EnemyGenerator: Enemy and encounter generation
|
|
7
|
+
* - NamingEngine: Procedural name generation
|
|
8
|
+
* - ClassSuggester: Class suggestion from audio profiles
|
|
9
|
+
* - RaceSelector: Race selection from audio profiles
|
|
10
|
+
* - AppearanceGenerator: Physical appearance generation
|
|
11
|
+
* - EquipmentGenerator: Equipment generation
|
|
12
|
+
* - SkillAssigner: Skill proficiency assignment
|
|
13
|
+
* - SpellManager: Spell selection and management
|
|
14
|
+
*/
|
|
15
|
+
export { CharacterGenerator } from './CharacterGenerator.js';
|
|
16
|
+
export { EnemyGenerator } from './EnemyGenerator.js';
|
|
17
|
+
export { NamingEngine } from './NamingEngine.js';
|
|
18
|
+
export { ClassSuggester } from './ClassSuggester.js';
|
|
19
|
+
export { RaceSelector } from './RaceSelector.js';
|
|
20
|
+
export { AppearanceGenerator } from './AppearanceGenerator.js';
|
|
21
|
+
export { EquipmentGenerator } from './EquipmentGenerator.js';
|
|
22
|
+
export { SkillAssigner } from './SkillAssigner.js';
|
|
23
|
+
export { SpellManager } from './SpellManager.js';
|
|
24
|
+
export { crToLevel, levelToCR, roundLevel, roundCR, formatLevel, formatCR, createCRTuning, DEFAULT_CR_TUNING } from './CRLevelConverter.js';
|
|
25
|
+
export type { CRTuningConfig } from './CRLevelConverter.js';
|
|
26
|
+
export { SpellcastingGenerator, SPELL_SLOTS_BY_CR } from './SpellcastingGenerator.js';
|
|
27
|
+
export type { InnateSpell, SpellList, SpellcastingConfig, SpellcastingGenerationOptions, SpellcastingGenerationOptionsWithRNG } from './SpellcastingGenerator.js';
|
|
28
|
+
export { LegendaryGenerator, LEGENDARY_ACTIONS, LEGENDARY_RESISTANCES, LEGENDARY_ACTION_COUNT } from './LegendaryGenerator.js';
|
|
29
|
+
export type { LegendaryAction, LegendaryConfig } from './LegendaryGenerator.js';
|
|
30
|
+
export type { EnemyCategory, EnemyRarity, EnemyArchetype, EnemyMixMode, EncounterDifficulty, SignatureAbility, AudioPreference, EnemyTemplate, RarityConfig, EnemyGenerationOptions, EncounterGenerationOptions, EnemyMetadata, EnemyFeature } from '../types/Enemy.js';
|
|
31
|
+
export { isValidEnemyCategory, isValidEnemyRarity, isValidEnemyArchetype, isValidEncounterDifficulty } from '../types/Enemy.js';
|
|
32
|
+
export { RhythmGenerator } from './RhythmGenerator.js';
|
|
33
|
+
export type { RhythmGenerationOptions, GeneratedRhythm, RhythmMetadata, OutputMode, ProgressCallback, } from './RhythmGenerator.js';
|
|
34
|
+
export { PitchBeatLinker } from './PitchBeatLinker.js';
|
|
35
|
+
export type { PitchAtBeat, PitchBandName, IntervalCategory, PitchDirection, PitchBeatLinkerConfig, } from './PitchBeatLinker.js';
|
|
36
|
+
export { DDR_PATTERN_LIBRARY, GUITAR_HERO_PATTERN_LIBRARY, getPatternLibrary, getPatternsByCategory, getPatternsByDifficulty, getPatternsByTags, getPatternsByKeyCount, getRandomPattern, getPatternById, getPatternLibraryStats, } from './ButtonPatternLibrary.js';
|
|
37
|
+
export { ButtonMapper } from './ButtonMapper.js';
|
|
38
|
+
export type { MappedLevelResult, ButtonMappingMetadata, } from './ButtonMapper.js';
|
|
39
|
+
export { LevelGenerator } from './LevelGenerator.js';
|
|
40
|
+
export type { LevelGenerationOptions, LevelMetadata, GeneratedLevel, AllDifficultiesResult, LevelProgressCallback, } from './LevelGenerator.js';
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/generation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EACH,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,cAAc,EACd,iBAAiB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EACH,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACR,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,6BAA6B,EAC7B,oCAAoC,EACvC,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACH,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACzB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACR,eAAe,EACf,eAAe,EAClB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACR,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,EACb,YAAY,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC7B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EACR,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,UAAU,EACV,gBAAgB,GACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EACR,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,GACxB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACH,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,GACzB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACR,iBAAiB,EACjB,qBAAqB,GACxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACR,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,qBAAqB,GACxB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata extraction with priority queue logic
|
|
3
|
+
* Based on specs/001-core-engine/SPEC.md
|
|
4
|
+
*/
|
|
5
|
+
export declare class MetadataExtractor {
|
|
6
|
+
/**
|
|
7
|
+
* Extract primary (compressed) audio URL with priority:
|
|
8
|
+
* 1. mp3_url (Standard web audio - preferred)
|
|
9
|
+
* 2. lossy_audio (Compressed)
|
|
10
|
+
* 3. audio_url (Explicit audio field)
|
|
11
|
+
* 4. lossless_audio (High fidelity - larger files)
|
|
12
|
+
* 5. animation_url (OpenSea standard - often audio, but could be video)
|
|
13
|
+
*/
|
|
14
|
+
static extractAudioUrl(data: Record<string, unknown>): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Extract optional lossless audio URL (uncompressed/high-fidelity source).
|
|
17
|
+
* Returns a lossless URL only if it differs from the primary audio URL.
|
|
18
|
+
* Priority: lossless_audio > animation_url (only if it looks like a lossless format)
|
|
19
|
+
*/
|
|
20
|
+
static extractAudioUrlLossless(data: Record<string, unknown>): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Extract image URL with priority (see specs/001-core-engine/SPEC.md):
|
|
23
|
+
* 1. image_small (Preferred for performance)
|
|
24
|
+
* 2. image (Standard)
|
|
25
|
+
* 3. image_large (Fallback)
|
|
26
|
+
* 4. image_thumb (Last resort)
|
|
27
|
+
*/
|
|
28
|
+
static extractImageUrl(data: Record<string, unknown>): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Extract thumbnail image URL directly from image_thumb fields.
|
|
31
|
+
* Unlike extractImageUrl, this specifically targets thumbnail fields only.
|
|
32
|
+
* Priority: image_thumb_url > image_thumb
|
|
33
|
+
*/
|
|
34
|
+
static extractImageThumbUrl(data: Record<string, unknown>): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Extract name/title with priority (see specs/001-core-engine/SPEC.md):
|
|
37
|
+
* 1. name
|
|
38
|
+
* 2. title
|
|
39
|
+
*/
|
|
40
|
+
static extractTitle(data: Record<string, unknown>): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Extract artist with priority (see specs/001-core-engine/SPEC.md):
|
|
43
|
+
* 1. artist
|
|
44
|
+
* 2. created_by
|
|
45
|
+
* 3. minter
|
|
46
|
+
*/
|
|
47
|
+
static extractArtist(data: Record<string, unknown>): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Parse metadata string to JSON object
|
|
50
|
+
* Handles stringified JSON with error handling
|
|
51
|
+
*/
|
|
52
|
+
static parseMetadata(metadata: unknown): Record<string, unknown> | null;
|
|
53
|
+
/**
|
|
54
|
+
* Extract genre with support for string or array formats
|
|
55
|
+
* - If genre is a string, returns it directly
|
|
56
|
+
* - If genre is an array, returns the first element
|
|
57
|
+
* - Also checks OpenSea attributes array for "Genre" trait_type
|
|
58
|
+
*/
|
|
59
|
+
static extractGenre(data: Record<string, unknown>): string;
|
|
60
|
+
/**
|
|
61
|
+
* Convert OpenSea-style attributes array to key-value object
|
|
62
|
+
* Example: [{ trait_type: "BPM", value: 120 }] => { BPM: 120 }
|
|
63
|
+
*/
|
|
64
|
+
static convertAttributes(attributes: unknown): Record<string, string | number> | null;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=MetadataExtractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetadataExtractor.d.ts","sourceRoot":"","sources":["../../../src/core/parser/MetadataExtractor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qBAAa,iBAAiB;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAYpE;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAY5E;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAYpE;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAczE;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAUjE;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;IAYlE;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IA0BvE;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;IAgC1D;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI;CAcxF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playlist parser - converts raw Arweave JSON to ServerlessPlaylist
|
|
3
|
+
* Based on specs/001-core-engine/SPEC.md
|
|
4
|
+
*/
|
|
5
|
+
import type { ServerlessPlaylist, RawArweavePlaylist } from '../types/Playlist.js';
|
|
6
|
+
export interface PlaylistParserOptions {
|
|
7
|
+
/** Validate audio URLs (check for 404s) */
|
|
8
|
+
validateAudioUrls?: boolean;
|
|
9
|
+
/** Strict mode throws errors on invalid tracks */
|
|
10
|
+
strict?: boolean;
|
|
11
|
+
/** Timeout in milliseconds for audio URL validation (default: 5000ms) */
|
|
12
|
+
audioUrlValidationTimeout?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to resolve image URLs (image_url, image_thumb_url) during parsing.
|
|
15
|
+
* When true, Arweave image URLs will be resolved to working gateways.
|
|
16
|
+
* Default: false (to maintain backward compatibility - consumers can resolve on-demand)
|
|
17
|
+
*/
|
|
18
|
+
resolveImageUrls?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class PlaylistParser {
|
|
21
|
+
private options;
|
|
22
|
+
constructor(options?: PlaylistParserOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Parse raw Arweave playlist data into ServerlessPlaylist
|
|
25
|
+
* Follows the flattening process from specs/001-core-engine/SPEC.md
|
|
26
|
+
*/
|
|
27
|
+
parse(data: RawArweavePlaylist): Promise<ServerlessPlaylist>;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve Arweave URLs in a track (image_url, image_thumb_url)
|
|
30
|
+
* Only resolves if resolveImageUrls option is enabled
|
|
31
|
+
*/
|
|
32
|
+
private resolveTrackUrls;
|
|
33
|
+
/**
|
|
34
|
+
* Parse a single track following the flattening process
|
|
35
|
+
* See specs/001-core-engine/SPEC.md
|
|
36
|
+
*/
|
|
37
|
+
private parseTrack;
|
|
38
|
+
/**
|
|
39
|
+
* Validate that an audio URL is accessible
|
|
40
|
+
* @param url - The audio URL to validate
|
|
41
|
+
* @returns Promise<boolean> - true if URL is accessible, false otherwise
|
|
42
|
+
*/
|
|
43
|
+
private validateAudioUrl;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=PlaylistParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaylistParser.d.ts","sourceRoot":"","sources":["../../../src/core/parser/PlaylistParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAiB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAKlG,MAAM,WAAW,qBAAqB;IAClC,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,yEAAyE;IACzE,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,qBAAa,cAAc;IACvB,OAAO,CAAC,OAAO,CAAwB;gBAE3B,OAAO,GAAE,qBAA0B;IAU/C;;;OAGG;IACG,KAAK,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8ClE;;;OAGG;YACW,gBAAgB;IAoB9B;;;OAGG;YACW,UAAU;IAiHxB;;;;OAIG;YACW,gBAAgB;CAqBjC"}
|