af-motion 0.0.0-stage → 1.0.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/CHANGELOG.md +33 -0
- package/LICENSE +201 -0
- package/README.md +203 -3
- package/RELEASE_NOTES.md +115 -0
- package/bin/af-motion.js +16 -0
- package/bin/mcp-server.js +21 -0
- package/dist/3d/adapter.d.ts +29 -0
- package/dist/3d/assets/cache.d.ts +71 -0
- package/dist/3d/assets/index.d.ts +10 -0
- package/dist/3d/assets/inspection.d.ts +19 -0
- package/dist/3d/assets/loaders.d.ts +30 -0
- package/dist/3d/assets/manager.d.ts +69 -0
- package/dist/3d/assets/scene-integration.d.ts +23 -0
- package/dist/3d/assets/types.d.ts +80 -0
- package/dist/3d/assets/validation.d.ts +12 -0
- package/dist/3d/camera/index.d.ts +7 -0
- package/dist/3d/camera/presets.d.ts +8 -0
- package/dist/3d/camera/transitions.d.ts +19 -0
- package/dist/3d/camera/types.d.ts +37 -0
- package/dist/3d/camera/validation.d.ts +9 -0
- package/dist/3d/capabilities.d.ts +11 -0
- package/dist/3d/composition/fallback.d.ts +20 -0
- package/dist/3d/composition/generation.d.ts +24 -0
- package/dist/3d/composition/index.d.ts +12 -0
- package/dist/3d/composition/quality.d.ts +35 -0
- package/dist/3d/composition/recipes.d.ts +34 -0
- package/dist/3d/composition/types.d.ts +88 -0
- package/dist/3d/composition/unified.d.ts +18 -0
- package/dist/3d/environment/index.d.ts +6 -0
- package/dist/3d/environment/presets.d.ts +8 -0
- package/dist/3d/environment/types.d.ts +36 -0
- package/dist/3d/environment/validation.d.ts +9 -0
- package/dist/3d/geometry/cache.d.ts +37 -0
- package/dist/3d/geometry/generators.d.ts +24 -0
- package/dist/3d/geometry/hash.d.ts +10 -0
- package/dist/3d/geometry/index.d.ts +9 -0
- package/dist/3d/geometry/three-adapter.d.ts +15 -0
- package/dist/3d/geometry/types.d.ts +120 -0
- package/dist/3d/geometry/validation.d.ts +6 -0
- package/dist/3d/index.d.ts +32 -0
- package/dist/3d/interaction/camera-controls.d.ts +58 -0
- package/dist/3d/interaction/index.d.ts +8 -0
- package/dist/3d/interaction/manager.d.ts +61 -0
- package/dist/3d/interaction/presets.d.ts +9 -0
- package/dist/3d/interaction/raycaster.d.ts +20 -0
- package/dist/3d/interaction/types.d.ts +78 -0
- package/dist/3d/lighting/index.d.ts +6 -0
- package/dist/3d/lighting/presets.d.ts +8 -0
- package/dist/3d/lighting/types.d.ts +31 -0
- package/dist/3d/lighting/validation.d.ts +17 -0
- package/dist/3d/materials/bridge.d.ts +11 -0
- package/dist/3d/materials/index.d.ts +7 -0
- package/dist/3d/materials/presets.d.ts +9 -0
- package/dist/3d/materials/types.d.ts +43 -0
- package/dist/3d/materials/validation.d.ts +9 -0
- package/dist/3d/morphing/animator.d.ts +19 -0
- package/dist/3d/morphing/correspondence.d.ts +32 -0
- package/dist/3d/morphing/geometry.d.ts +28 -0
- package/dist/3d/morphing/index.d.ts +16 -0
- package/dist/3d/morphing/interpolation.d.ts +45 -0
- package/dist/3d/morphing/morph.d.ts +18 -0
- package/dist/3d/morphing/presets.d.ts +31 -0
- package/dist/3d/morphing/react.d.ts +29 -0
- package/dist/3d/morphing/topology.d.ts +34 -0
- package/dist/3d/morphing/types.d.ts +138 -0
- package/dist/3d/morphing/validation.d.ts +19 -0
- package/dist/3d/optimization/analysis.d.ts +14 -0
- package/dist/3d/optimization/colliders.d.ts +16 -0
- package/dist/3d/optimization/geometry.d.ts +22 -0
- package/dist/3d/optimization/hierarchy.d.ts +14 -0
- package/dist/3d/optimization/index.d.ts +33 -0
- package/dist/3d/optimization/lod.d.ts +13 -0
- package/dist/3d/optimization/materials.d.ts +12 -0
- package/dist/3d/optimization/recommendations.d.ts +13 -0
- package/dist/3d/optimization/skeleton.d.ts +20 -0
- package/dist/3d/optimization/types.d.ts +252 -0
- package/dist/3d/physics/benchmark.d.ts +76 -0
- package/dist/3d/physics/body/inertia.d.ts +61 -0
- package/dist/3d/physics/collision/ccd.d.ts +26 -0
- package/dist/3d/physics/collision/narrowphase.d.ts +15 -0
- package/dist/3d/physics/collision/shapes.d.ts +45 -0
- package/dist/3d/physics/constraints/advanced.d.ts +40 -0
- package/dist/3d/physics/constraints/solver.d.ts +34 -0
- package/dist/3d/physics/constraints/types.d.ts +106 -0
- package/dist/3d/physics/events.d.ts +34 -0
- package/dist/3d/physics/index.d.ts +29 -0
- package/dist/3d/physics/material.d.ts +27 -0
- package/dist/3d/physics/math.d.ts +79 -0
- package/dist/3d/physics/soft/cloth.d.ts +12 -0
- package/dist/3d/physics/soft/collision.d.ts +12 -0
- package/dist/3d/physics/soft/gpu.d.ts +19 -0
- package/dist/3d/physics/soft/pbd.d.ts +20 -0
- package/dist/3d/physics/soft/rope.d.ts +16 -0
- package/dist/3d/physics/soft/soft-body.d.ts +12 -0
- package/dist/3d/physics/soft/types.d.ts +212 -0
- package/dist/3d/physics/solver/integrators.d.ts +25 -0
- package/dist/3d/physics/solver/types.d.ts +28 -0
- package/dist/3d/physics/spatial/spatial-hash.d.ts +51 -0
- package/dist/3d/physics/types.d.ts +579 -0
- package/dist/3d/physics/world.d.ts +106 -0
- package/dist/3d/r3f.d.ts +34 -0
- package/dist/3d/scene.d.ts +8 -0
- package/dist/3d/schema.d.ts +739 -0
- package/dist/3d/schemas/ai-integration.d.ts +201 -0
- package/dist/3d/schemas/correction.d.ts +11 -0
- package/dist/3d/schemas/index.d.ts +12 -0
- package/dist/3d/schemas/schemas.d.ts +361 -0
- package/dist/3d/schemas/serialization.d.ts +22 -0
- package/dist/3d/schemas/types.d.ts +199 -0
- package/dist/3d/schemas/validation.d.ts +33 -0
- package/dist/3d/scroll/controller.d.ts +32 -0
- package/dist/3d/scroll/index.d.ts +6 -0
- package/dist/3d/scroll/presets.d.ts +9 -0
- package/dist/3d/scroll/types.d.ts +53 -0
- package/dist/3d/terrain/biomes.d.ts +18 -0
- package/dist/3d/terrain/chunks.d.ts +20 -0
- package/dist/3d/terrain/erosion.d.ts +15 -0
- package/dist/3d/terrain/heightmap.d.ts +27 -0
- package/dist/3d/terrain/index.d.ts +18 -0
- package/dist/3d/terrain/materials.d.ts +20 -0
- package/dist/3d/terrain/noise.d.ts +25 -0
- package/dist/3d/terrain/physics.d.ts +34 -0
- package/dist/3d/terrain/terrain.d.ts +12 -0
- package/dist/3d/terrain/types.d.ts +235 -0
- package/dist/3d/terrain/vegetation.d.ts +14 -0
- package/dist/3d/types.d.ts +176 -0
- package/dist/3d/world/hydrology.d.ts +12 -0
- package/dist/3d/world/index.d.ts +15 -0
- package/dist/3d/world/lighting.d.ts +16 -0
- package/dist/3d/world/pipeline.d.ts +20 -0
- package/dist/3d/world/population.d.ts +12 -0
- package/dist/3d/world/presets.d.ts +11 -0
- package/dist/3d/world/streaming.d.ts +13 -0
- package/dist/3d/world/types.d.ts +272 -0
- package/dist/3d/world/world.d.ts +64 -0
- package/dist/backgrounds/advanced-gradient.d.ts +32 -0
- package/dist/backgrounds/atmospheric-backgrounds.d.ts +79 -0
- package/dist/backgrounds/aurora.d.ts +24 -0
- package/dist/backgrounds/cosmic-background.d.ts +31 -0
- package/dist/backgrounds/energy-effects.d.ts +78 -0
- package/dist/backgrounds/floating-orbs.d.ts +26 -0
- package/dist/backgrounds/fluid-backgrounds.d.ts +72 -0
- package/dist/backgrounds/geometric-backgrounds.d.ts +78 -0
- package/dist/backgrounds/gradient.d.ts +20 -0
- package/dist/backgrounds/grid.d.ts +22 -0
- package/dist/backgrounds/internal/canvas-lifecycle.d.ts +29 -0
- package/dist/backgrounds/noise.d.ts +20 -0
- package/dist/backgrounds/particle-background.d.ts +37 -0
- package/dist/backgrounds/particle-field.d.ts +22 -0
- package/dist/backgrounds/spotlight.d.ts +20 -0
- package/dist/backgrounds/wave.d.ts +22 -0
- package/dist/catalogue.d.ts +227 -0
- package/dist/catalogue.js +4 -0
- package/dist/chunks/catalogue-ZmbeEdRo.js +59850 -0
- package/dist/chunks/core-animation-CeiI_TEe.js +1394 -0
- package/dist/chunks/motion-choreography-DC6LWvDk.js +4089 -0
- package/dist/chunks/pointer-capture-lrnKAl2I.js +158 -0
- package/dist/chunks/safe-json-D5j34GEB.js +62 -0
- package/dist/chunks/scroll-velocity-BNUHaS0-.js +904 -0
- package/dist/cli/commands/doctor.d.ts +9 -0
- package/dist/cli/commands/example.d.ts +9 -0
- package/dist/cli/commands/info.d.ts +8 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/presets.d.ts +10 -0
- package/dist/cli/commands/validate.d.ts +9 -0
- package/dist/cli/index.d.ts +22 -0
- package/dist/cli/types.d.ts +115 -0
- package/dist/cli/utils/safety.d.ts +11 -0
- package/dist/cli/utils/templates.d.ts +16 -0
- package/dist/cli/utils/terminal.d.ts +29 -0
- package/dist/cli.js +825 -0
- package/dist/core/adaptive-motion.d.ts +100 -0
- package/dist/core/adaptive-quality/controller.d.ts +61 -0
- package/dist/core/adaptive-quality/index.d.ts +13 -0
- package/dist/core/adaptive-quality/metrics.d.ts +33 -0
- package/dist/core/adaptive-quality/policies.d.ts +40 -0
- package/dist/core/adaptive-quality/profile.d.ts +58 -0
- package/dist/core/adaptive-quality/react.d.ts +57 -0
- package/dist/core/adaptive-quality/recommendation.d.ts +12 -0
- package/dist/core/adaptive-quality/resolution.d.ts +22 -0
- package/dist/core/adaptive-quality/types.d.ts +362 -0
- package/dist/core/advanced-motion/adapters.d.ts +20 -0
- package/dist/core/advanced-motion/controller.d.ts +52 -0
- package/dist/core/advanced-motion/index.d.ts +12 -0
- package/dist/core/advanced-motion/recipes.d.ts +16 -0
- package/dist/core/advanced-motion/timeline.d.ts +35 -0
- package/dist/core/advanced-motion/types.d.ts +174 -0
- package/dist/core/advanced-motion/validation.d.ts +11 -0
- package/dist/core/agent-workflows/agent-registry.d.ts +21 -0
- package/dist/core/agent-workflows/agents/accessibility-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/composition-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/design-to-motion-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/index.d.ts +13 -0
- package/dist/core/agent-workflows/agents/motion-intelligence-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/performance-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/scene-generation-agent.d.ts +9 -0
- package/dist/core/agent-workflows/collaboration-planner.d.ts +38 -0
- package/dist/core/agent-workflows/collaboration-workflows.d.ts +83 -0
- package/dist/core/agent-workflows/communication.d.ts +29 -0
- package/dist/core/agent-workflows/conflict-resolver.d.ts +25 -0
- package/dist/core/agent-workflows/context.d.ts +36 -0
- package/dist/core/agent-workflows/execution-engine.d.ts +30 -0
- package/dist/core/agent-workflows/index.d.ts +20 -0
- package/dist/core/agent-workflows/orchestration-types.d.ts +144 -0
- package/dist/core/agent-workflows/orchestrator.d.ts +29 -0
- package/dist/core/agent-workflows/react.d.ts +71 -0
- package/dist/core/agent-workflows/shared-context.d.ts +36 -0
- package/dist/core/agent-workflows/task-planner.d.ts +42 -0
- package/dist/core/agent-workflows/templates.d.ts +14 -0
- package/dist/core/agent-workflows/tool-registry.d.ts +24 -0
- package/dist/core/agent-workflows/types.d.ts +167 -0
- package/dist/core/ai-ecosystem/capability-registry.d.ts +23 -0
- package/dist/core/ai-ecosystem/index.d.ts +13 -0
- package/dist/core/ai-ecosystem/pipeline.d.ts +19 -0
- package/dist/core/ai-ecosystem/provider.d.ts +19 -0
- package/dist/core/ai-ecosystem/types.d.ts +69 -0
- package/dist/core/ai-motion-intelligence/engine.d.ts +51 -0
- package/dist/core/ai-motion-intelligence/explanation-engine.d.ts +8 -0
- package/dist/core/ai-motion-intelligence/index.d.ts +15 -0
- package/dist/core/ai-motion-intelligence/intent-classifier.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/knowledge-base.d.ts +12 -0
- package/dist/core/ai-motion-intelligence/provider.d.ts +31 -0
- package/dist/core/ai-motion-intelligence/quality-evaluator.d.ts +9 -0
- package/dist/core/ai-motion-intelligence/react.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/recommendation-engine.d.ts +16 -0
- package/dist/core/ai-motion-intelligence/types.d.ts +134 -0
- package/dist/core/ai-motion-registry.d.ts +201 -0
- package/dist/core/animate.d.ts +57 -0
- package/dist/core/animation-intelligence/engine.d.ts +42 -0
- package/dist/core/animation-intelligence/index.d.ts +11 -0
- package/dist/core/animation-intelligence/intent.d.ts +15 -0
- package/dist/core/animation-intelligence/schema.d.ts +42 -0
- package/dist/core/animation-intelligence/scoring.d.ts +15 -0
- package/dist/core/animation-intelligence/types.d.ts +91 -0
- package/dist/core/animation-parallel.d.ts +37 -0
- package/dist/core/animation-presets.d.ts +56 -0
- package/dist/core/animation-sequence.d.ts +37 -0
- package/dist/core/animation-timeline.d.ts +46 -0
- package/dist/core/animation.d.ts +48 -0
- package/dist/core/built-in-palettes.d.ts +331 -0
- package/dist/core/choreography-intelligence/bridge.d.ts +43 -0
- package/dist/core/choreography-intelligence/generator.d.ts +11 -0
- package/dist/core/choreography-intelligence/index.d.ts +11 -0
- package/dist/core/choreography-intelligence/intent.d.ts +11 -0
- package/dist/core/choreography-intelligence/schema.d.ts +76 -0
- package/dist/core/choreography-intelligence/types.d.ts +87 -0
- package/dist/core/composition.d.ts +170 -0
- package/dist/core/configuration-corrector.d.ts +85 -0
- package/dist/core/design-intelligence.d.ts +199 -0
- package/dist/core/design-system.d.ts +206 -0
- package/dist/core/design-to-motion/design-analyzer.d.ts +13 -0
- package/dist/core/design-to-motion/engine.d.ts +34 -0
- package/dist/core/design-to-motion/generator.d.ts +16 -0
- package/dist/core/design-to-motion/index.d.ts +15 -0
- package/dist/core/design-to-motion/input-parser.d.ts +17 -0
- package/dist/core/design-to-motion/motion-planner.d.ts +11 -0
- package/dist/core/design-to-motion/presets.d.ts +11 -0
- package/dist/core/design-to-motion/react.d.ts +13 -0
- package/dist/core/design-to-motion/types.d.ts +221 -0
- package/dist/core/design-to-motion/validator.d.ts +13 -0
- package/dist/core/device-capabilities/classification.d.ts +25 -0
- package/dist/core/device-capabilities/detection.d.ts +27 -0
- package/dist/core/device-capabilities/graphics.d.ts +22 -0
- package/dist/core/device-capabilities/hardware.d.ts +27 -0
- package/dist/core/device-capabilities/index.d.ts +14 -0
- package/dist/core/device-capabilities/monitor.d.ts +19 -0
- package/dist/core/device-capabilities/react.d.ts +24 -0
- package/dist/core/device-capabilities/runtime.d.ts +11 -0
- package/dist/core/device-capabilities/scoring.d.ts +18 -0
- package/dist/core/device-capabilities/types.d.ts +171 -0
- package/dist/core/effect-composer.d.ts +41 -0
- package/dist/core/generation-pipeline.d.ts +135 -0
- package/dist/core/inertia.d.ts +30 -0
- package/dist/core/interactions/cursor-controller.d.ts +9 -0
- package/dist/core/interactions/custom-gestures.d.ts +28 -0
- package/dist/core/interactions/device-capabilities.d.ts +12 -0
- package/dist/core/interactions/drag-controller.d.ts +60 -0
- package/dist/core/interactions/errors.d.ts +13 -0
- package/dist/core/interactions/gesture-classifier.d.ts +43 -0
- package/dist/core/interactions/gesture-intelligence-controller.d.ts +9 -0
- package/dist/core/interactions/gesture-recognizers.d.ts +160 -0
- package/dist/core/interactions/gesture-sequence.d.ts +9 -0
- package/dist/core/interactions/index.d.ts +27 -0
- package/dist/core/interactions/input-normalizer.d.ts +8 -0
- package/dist/core/interactions/interaction-manager.d.ts +43 -0
- package/dist/core/interactions/keyboard-manager.d.ts +16 -0
- package/dist/core/interactions/magnetic-controller.d.ts +9 -0
- package/dist/core/interactions/magnetic-group.d.ts +11 -0
- package/dist/core/interactions/multitouch-controller.d.ts +62 -0
- package/dist/core/interactions/pointer-controller.d.ts +34 -0
- package/dist/core/interactions/pointer-tracker.d.ts +32 -0
- package/dist/core/interactions/prioritizer.d.ts +17 -0
- package/dist/core/interactions/touch-controller.d.ts +35 -0
- package/dist/core/interactions/types.d.ts +710 -0
- package/dist/core/layout/controller.d.ts +56 -0
- package/dist/core/layout/flip.d.ts +21 -0
- package/dist/core/layout/group.d.ts +46 -0
- package/dist/core/layout/index.d.ts +12 -0
- package/dist/core/layout/measure.d.ts +30 -0
- package/dist/core/layout/presets.d.ts +24 -0
- package/dist/core/layout/types.d.ts +189 -0
- package/dist/core/microinteractions/generator.d.ts +11 -0
- package/dist/core/microinteractions/index.d.ts +11 -0
- package/dist/core/microinteractions/intent.d.ts +11 -0
- package/dist/core/microinteractions/runtime.d.ts +25 -0
- package/dist/core/microinteractions/schema.d.ts +82 -0
- package/dist/core/microinteractions/types.d.ts +79 -0
- package/dist/core/motion-choreography.d.ts +163 -0
- package/dist/core/motion-dna.d.ts +129 -0
- package/dist/core/motion-path/animator.d.ts +13 -0
- package/dist/core/motion-path/engine.d.ts +27 -0
- package/dist/core/motion-path/follower.d.ts +8 -0
- package/dist/core/motion-path/index.d.ts +15 -0
- package/dist/core/motion-path/lut.d.ts +33 -0
- package/dist/core/motion-path/parser.d.ts +26 -0
- package/dist/core/motion-path/segments.d.ts +16 -0
- package/dist/core/motion-path/types.d.ts +178 -0
- package/dist/core/motion-path/vector3.d.ts +49 -0
- package/dist/core/motion-recipe.d.ts +171 -0
- package/dist/core/motion-states.d.ts +43 -0
- package/dist/core/motion-validation/consistency.d.ts +11 -0
- package/dist/core/motion-validation/index.d.ts +11 -0
- package/dist/core/motion-validation/optimizer.d.ts +11 -0
- package/dist/core/motion-validation/schema.d.ts +81 -0
- package/dist/core/motion-validation/types.d.ts +53 -0
- package/dist/core/motion-validation/validator.d.ts +11 -0
- package/dist/core/motion.d.ts +7 -0
- package/dist/core/natural-motion.d.ts +110 -0
- package/dist/core/palette-colors.d.ts +16 -0
- package/dist/core/palette-styles.d.ts +12 -0
- package/dist/core/palettes.d.ts +59 -0
- package/dist/core/performance-intelligence/conflicts.d.ts +21 -0
- package/dist/core/performance-intelligence/context.d.ts +48 -0
- package/dist/core/performance-intelligence/coordinator.d.ts +84 -0
- package/dist/core/performance-intelligence/decisions.d.ts +17 -0
- package/dist/core/performance-intelligence/history.d.ts +44 -0
- package/dist/core/performance-intelligence/index.d.ts +15 -0
- package/dist/core/performance-intelligence/policies.d.ts +59 -0
- package/dist/core/performance-intelligence/react.d.ts +78 -0
- package/dist/core/performance-intelligence/report.d.ts +16 -0
- package/dist/core/performance-intelligence/scoring.d.ts +16 -0
- package/dist/core/performance-intelligence/types.d.ts +203 -0
- package/dist/core/performance-optimizer/bottlenecks.d.ts +9 -0
- package/dist/core/performance-optimizer/index.d.ts +13 -0
- package/dist/core/performance-optimizer/optimizer.d.ts +43 -0
- package/dist/core/performance-optimizer/profiler.d.ts +38 -0
- package/dist/core/performance-optimizer/react.d.ts +55 -0
- package/dist/core/performance-optimizer/strategies.d.ts +22 -0
- package/dist/core/performance-optimizer/types.d.ts +227 -0
- package/dist/core/performance-optimizer/workers.d.ts +27 -0
- package/dist/core/physics/collision-constraints.d.ts +15 -0
- package/dist/core/physics/collision-detection.d.ts +93 -0
- package/dist/core/physics/collision-response.d.ts +24 -0
- package/dist/core/physics/collision-types.d.ts +381 -0
- package/dist/core/physics/collision-world.d.ts +11 -0
- package/dist/core/physics/composition-behaviors.d.ts +97 -0
- package/dist/core/physics/composition-choreography.d.ts +14 -0
- package/dist/core/physics/composition-engine.d.ts +25 -0
- package/dist/core/physics/composition-recipes.d.ts +46 -0
- package/dist/core/physics/composition-types.d.ts +265 -0
- package/dist/core/physics/composition-validation.d.ts +33 -0
- package/dist/core/physics/index.d.ts +37 -0
- package/dist/core/physics/inertia-animation.d.ts +11 -0
- package/dist/core/physics/inertia-math.d.ts +56 -0
- package/dist/core/physics/inertia-presets.d.ts +25 -0
- package/dist/core/physics/inertia-simulation.d.ts +11 -0
- package/dist/core/physics/inertia-types.d.ts +355 -0
- package/dist/core/physics/inertia-validation.d.ts +22 -0
- package/dist/core/physics/math.d.ts +99 -0
- package/dist/core/physics/presets.d.ts +28 -0
- package/dist/core/physics/simulation.d.ts +11 -0
- package/dist/core/physics/spring-animation.d.ts +11 -0
- package/dist/core/physics/spring-math.d.ts +47 -0
- package/dist/core/physics/spring-presets.d.ts +29 -0
- package/dist/core/physics/spring-simulation.d.ts +11 -0
- package/dist/core/physics/spring-types.d.ts +350 -0
- package/dist/core/physics/spring-validation.d.ts +22 -0
- package/dist/core/physics/stepper.d.ts +24 -0
- package/dist/core/physics/types.d.ts +280 -0
- package/dist/core/physics/validation.d.ts +62 -0
- package/dist/core/pointer-capture.d.ts +7 -0
- package/dist/core/reference-analysis/index.d.ts +10 -0
- package/dist/core/reference-analysis/interpreter.d.ts +12 -0
- package/dist/core/reference-analysis/planner.d.ts +15 -0
- package/dist/core/reference-analysis/specification.d.ts +14 -0
- package/dist/core/reference-analysis/types.d.ts +244 -0
- package/dist/core/resource-intelligence/cache.d.ts +43 -0
- package/dist/core/resource-intelligence/gpu.d.ts +19 -0
- package/dist/core/resource-intelligence/index.d.ts +16 -0
- package/dist/core/resource-intelligence/leaks.d.ts +13 -0
- package/dist/core/resource-intelligence/memory.d.ts +27 -0
- package/dist/core/resource-intelligence/pooling.d.ts +32 -0
- package/dist/core/resource-intelligence/pressure.d.ts +32 -0
- package/dist/core/resource-intelligence/react.d.ts +63 -0
- package/dist/core/resource-intelligence/registry.d.ts +33 -0
- package/dist/core/resource-intelligence/reports.d.ts +14 -0
- package/dist/core/resource-intelligence/types.d.ts +232 -0
- package/dist/core/scene-generation/engine.d.ts +31 -0
- package/dist/core/scene-generation/generator.d.ts +14 -0
- package/dist/core/scene-generation/index.d.ts +14 -0
- package/dist/core/scene-generation/input-parser.d.ts +24 -0
- package/dist/core/scene-generation/presets.d.ts +10 -0
- package/dist/core/scene-generation/react.d.ts +13 -0
- package/dist/core/scene-generation/scene-analyzer.d.ts +9 -0
- package/dist/core/scene-generation/scene-planner.d.ts +12 -0
- package/dist/core/scene-generation/types.d.ts +236 -0
- package/dist/core/scene-generation/validator.d.ts +18 -0
- package/dist/core/schema.d.ts +185 -0
- package/dist/core/scroll-intelligence/generator.d.ts +11 -0
- package/dist/core/scroll-intelligence/index.d.ts +11 -0
- package/dist/core/scroll-intelligence/intent.d.ts +11 -0
- package/dist/core/scroll-intelligence/runtime.d.ts +21 -0
- package/dist/core/scroll-intelligence/schema.d.ts +78 -0
- package/dist/core/scroll-intelligence/types.d.ts +85 -0
- package/dist/core/spring.d.ts +38 -0
- package/dist/core/svg-morph/animator.d.ts +10 -0
- package/dist/core/svg-morph/arc-to-cubic.d.ts +11 -0
- package/dist/core/svg-morph/index.d.ts +10 -0
- package/dist/core/svg-morph/interpolate.d.ts +23 -0
- package/dist/core/svg-morph/normalize.d.ts +34 -0
- package/dist/core/svg-morph/parser.d.ts +13 -0
- package/dist/core/svg-morph/shapes.d.ts +32 -0
- package/dist/core/svg-morph/types.d.ts +144 -0
- package/dist/core/transform.d.ts +27 -0
- package/dist/core/transitions/controller.d.ts +45 -0
- package/dist/core/transitions/engine.d.ts +26 -0
- package/dist/core/transitions/group-transition.d.ts +30 -0
- package/dist/core/transitions/index.d.ts +15 -0
- package/dist/core/transitions/presets.d.ts +16 -0
- package/dist/core/transitions/schema.d.ts +71 -0
- package/dist/core/transitions/shared-element-transition.d.ts +88 -0
- package/dist/core/transitions/shared-element.d.ts +84 -0
- package/dist/core/transitions/types.d.ts +185 -0
- package/dist/core/transitions/view-transition.d.ts +25 -0
- package/dist/core/typography/engine.d.ts +19 -0
- package/dist/core/typography/index.d.ts +15 -0
- package/dist/core/typography/path-motion.d.ts +24 -0
- package/dist/core/typography/presets.d.ts +14 -0
- package/dist/core/typography/properties.d.ts +19 -0
- package/dist/core/typography/segmenter.d.ts +32 -0
- package/dist/core/typography/stagger.d.ts +15 -0
- package/dist/core/typography/transitions.d.ts +11 -0
- package/dist/core/typography/types.d.ts +154 -0
- package/dist/core/utils/safe-json.d.ts +50 -0
- package/dist/core/visual-style-registry.d.ts +659 -0
- package/dist/easing/easings.d.ts +44 -0
- package/dist/effects/border-beam.d.ts +28 -0
- package/dist/effects/count-up.d.ts +30 -0
- package/dist/effects/cursor-trail.d.ts +23 -0
- package/dist/effects/drag.d.ts +41 -0
- package/dist/effects/draw-svg.d.ts +19 -0
- package/dist/effects/follow-pointer.d.ts +19 -0
- package/dist/effects/glow.d.ts +25 -0
- package/dist/effects/gradient-text.d.ts +22 -0
- package/dist/effects/hover-motion.d.ts +32 -0
- package/dist/effects/in-view.d.ts +14 -0
- package/dist/effects/magnetic.d.ts +40 -0
- package/dist/effects/morph-svg.d.ts +15 -0
- package/dist/effects/parallax.d.ts +42 -0
- package/dist/effects/pinch.d.ts +27 -0
- package/dist/effects/reveal.d.ts +33 -0
- package/dist/effects/ripple.d.ts +21 -0
- package/dist/effects/scroll-animate.d.ts +23 -0
- package/dist/effects/scroll-direction.d.ts +19 -0
- package/dist/effects/scroll-progress.d.ts +29 -0
- package/dist/effects/scroll-trigger.d.ts +22 -0
- package/dist/effects/scroll-velocity.d.ts +29 -0
- package/dist/effects/shine.d.ts +23 -0
- package/dist/effects/split-text.d.ts +17 -0
- package/dist/effects/spotlight.d.ts +24 -0
- package/dist/effects/stagger.d.ts +46 -0
- package/dist/effects/swipe.d.ts +27 -0
- package/dist/effects/text-highlight.d.ts +25 -0
- package/dist/effects/text-mask.d.ts +25 -0
- package/dist/effects/text-reveal.d.ts +28 -0
- package/dist/effects/text-scramble.d.ts +18 -0
- package/dist/effects/tilt.d.ts +42 -0
- package/dist/effects/typewriter.d.ts +26 -0
- package/dist/graphics/capabilities.d.ts +12 -0
- package/dist/graphics/composition/engine.d.ts +14 -0
- package/dist/graphics/composition/fallback.d.ts +13 -0
- package/dist/graphics/composition/index.d.ts +10 -0
- package/dist/graphics/composition/ordering.d.ts +29 -0
- package/dist/graphics/composition/quality.d.ts +24 -0
- package/dist/graphics/composition/schema.d.ts +156 -0
- package/dist/graphics/composition/types.d.ts +81 -0
- package/dist/graphics/composition/unified.d.ts +23 -0
- package/dist/graphics/effects/advanced/engine.d.ts +9 -0
- package/dist/graphics/effects/advanced/index.d.ts +1 -0
- package/dist/graphics/effects/composer.d.ts +9 -0
- package/dist/graphics/effects/distortion/engine.d.ts +9 -0
- package/dist/graphics/effects/distortion/index.d.ts +1 -0
- package/dist/graphics/effects/fluid/engine.d.ts +9 -0
- package/dist/graphics/effects/fluid/index.d.ts +1 -0
- package/dist/graphics/effects/index.d.ts +10 -0
- package/dist/graphics/effects/particles/engine.d.ts +9 -0
- package/dist/graphics/effects/particles/index.d.ts +2 -0
- package/dist/graphics/effects/particles/pool.d.ts +17 -0
- package/dist/graphics/effects/schema.d.ts +312 -0
- package/dist/graphics/effects/types.d.ts +85 -0
- package/dist/graphics/engine.d.ts +5 -0
- package/dist/graphics/environment/clouds.d.ts +28 -0
- package/dist/graphics/environment/environment.d.ts +50 -0
- package/dist/graphics/environment/fire-smoke.d.ts +32 -0
- package/dist/graphics/environment/fog.d.ts +28 -0
- package/dist/graphics/environment/index.d.ts +18 -0
- package/dist/graphics/environment/lightning.d.ts +33 -0
- package/dist/graphics/environment/rain.d.ts +33 -0
- package/dist/graphics/environment/snow.d.ts +30 -0
- package/dist/graphics/environment/types.d.ts +184 -0
- package/dist/graphics/environment/weather.d.ts +19 -0
- package/dist/graphics/environment/wind.d.ts +23 -0
- package/dist/graphics/fluid/flow-field.d.ts +74 -0
- package/dist/graphics/fluid/grid.d.ts +43 -0
- package/dist/graphics/fluid/index.d.ts +13 -0
- package/dist/graphics/fluid/interactions.d.ts +39 -0
- package/dist/graphics/fluid/rendering.d.ts +32 -0
- package/dist/graphics/fluid/simulation.d.ts +50 -0
- package/dist/graphics/fluid/solver.d.ts +19 -0
- package/dist/graphics/fluid/types.d.ts +186 -0
- package/dist/graphics/gpu-simulation/backends/backend.d.ts +24 -0
- package/dist/graphics/gpu-simulation/backends/cpu.d.ts +21 -0
- package/dist/graphics/gpu-simulation/backends/selection.d.ts +15 -0
- package/dist/graphics/gpu-simulation/backends/webgl2.d.ts +28 -0
- package/dist/graphics/gpu-simulation/backends/webgpu.d.ts +23 -0
- package/dist/graphics/gpu-simulation/capabilities.d.ts +14 -0
- package/dist/graphics/gpu-simulation/device.d.ts +17 -0
- package/dist/graphics/gpu-simulation/engine.d.ts +8 -0
- package/dist/graphics/gpu-simulation/index.d.ts +22 -0
- package/dist/graphics/gpu-simulation/ping-pong.d.ts +23 -0
- package/dist/graphics/gpu-simulation/pipeline.d.ts +18 -0
- package/dist/graphics/gpu-simulation/resource-manager.d.ts +8 -0
- package/dist/graphics/gpu-simulation/shaders.d.ts +50 -0
- package/dist/graphics/gpu-simulation/types.d.ts +288 -0
- package/dist/graphics/index.d.ts +23 -0
- package/dist/graphics/materials/glass.d.ts +22 -0
- package/dist/graphics/materials/index.d.ts +9 -0
- package/dist/graphics/materials/lighting.d.ts +22 -0
- package/dist/graphics/materials/presets.d.ts +28 -0
- package/dist/graphics/materials/schema.d.ts +574 -0
- package/dist/graphics/materials/surface.d.ts +13 -0
- package/dist/graphics/materials/types.d.ts +150 -0
- package/dist/graphics/particle-fields/composition.d.ts +32 -0
- package/dist/graphics/particle-fields/forces.d.ts +103 -0
- package/dist/graphics/particle-fields/index.d.ts +12 -0
- package/dist/graphics/particle-fields/interaction.d.ts +32 -0
- package/dist/graphics/particle-fields/spatial-index.d.ts +20 -0
- package/dist/graphics/particle-fields/system.d.ts +52 -0
- package/dist/graphics/particle-fields/types.d.ts +138 -0
- package/dist/graphics/particles/behaviors.d.ts +11 -0
- package/dist/graphics/particles/controller.d.ts +82 -0
- package/dist/graphics/particles/data-layout.d.ts +51 -0
- package/dist/graphics/particles/emitters.d.ts +24 -0
- package/dist/graphics/particles/index.d.ts +15 -0
- package/dist/graphics/particles/random.d.ts +25 -0
- package/dist/graphics/particles/rendering.d.ts +16 -0
- package/dist/graphics/particles/simulation.d.ts +23 -0
- package/dist/graphics/particles/types.d.ts +282 -0
- package/dist/graphics/renderer.d.ts +66 -0
- package/dist/graphics/resource-manager.d.ts +6 -0
- package/dist/graphics/schema.d.ts +177 -0
- package/dist/graphics/simulation/adapters.d.ts +36 -0
- package/dist/graphics/simulation/coordinator.d.ts +64 -0
- package/dist/graphics/simulation/index.d.ts +11 -0
- package/dist/graphics/simulation/optimizer.d.ts +101 -0
- package/dist/graphics/simulation/resource-manager.d.ts +40 -0
- package/dist/graphics/simulation/types.d.ts +126 -0
- package/dist/graphics/textures/cache.d.ts +29 -0
- package/dist/graphics/textures/canvas-utils.d.ts +31 -0
- package/dist/graphics/textures/engine.d.ts +34 -0
- package/dist/graphics/textures/generators.d.ts +29 -0
- package/dist/graphics/textures/index.d.ts +11 -0
- package/dist/graphics/textures/material-integration.d.ts +20 -0
- package/dist/graphics/textures/prng.d.ts +27 -0
- package/dist/graphics/textures/schema.d.ts +219 -0
- package/dist/graphics/textures/types.d.ts +80 -0
- package/dist/graphics/types.d.ts +152 -0
- package/dist/graphics/viewport.d.ts +32 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +4921 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/prompts.d.ts +9 -0
- package/dist/mcp/resources.d.ts +9 -0
- package/dist/mcp/server.d.ts +29 -0
- package/dist/mcp/tools.d.ts +9 -0
- package/dist/mcp/transport.d.ts +33 -0
- package/dist/mcp/types.d.ts +96 -0
- package/dist/presets.d.ts +176 -0
- package/dist/presets.js +3 -0
- package/dist/react.d.ts +5358 -0
- package/dist/react.js +7557 -0
- package/package.json +112 -6
package/dist/cli.js
ADDED
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
import { C as e, Dt as t, E as n, M as r, w as i } from "./chunks/motion-choreography-DC6LWvDk.js";
|
|
2
|
+
import { c as a, i as o } from "./chunks/safe-json-D5j34GEB.js";
|
|
3
|
+
import * as s from "node:fs";
|
|
4
|
+
import * as c from "node:path";
|
|
5
|
+
import * as l from "node:process";
|
|
6
|
+
// src/cli/utils/templates.ts
|
|
7
|
+
var u = JSON.stringify({
|
|
8
|
+
$schema: "https://af-motion.dev/schemas/config-v1.json",
|
|
9
|
+
version: "1.0.0",
|
|
10
|
+
defaultMotionDNA: "playful",
|
|
11
|
+
defaultPalette: "Cobalt Classic",
|
|
12
|
+
accessibility: {
|
|
13
|
+
respectReducedMotion: !0,
|
|
14
|
+
fallbackDurationMs: 0
|
|
15
|
+
},
|
|
16
|
+
performance: {
|
|
17
|
+
targetFps: 60,
|
|
18
|
+
gpuAcceleration: !0,
|
|
19
|
+
adaptiveQuality: !0
|
|
20
|
+
}
|
|
21
|
+
}, null, 2);
|
|
22
|
+
function d(e) {
|
|
23
|
+
switch (e) {
|
|
24
|
+
case "vanilla-js": return {
|
|
25
|
+
filename: "animation.js",
|
|
26
|
+
content: "// AF Motion — Vanilla JavaScript Starter\nimport { animate } from \"af-motion\";\n\nexport function initializeMotion() {\n const target = document.querySelector(\"#hero-box\");\n if (!target) return null;\n\n return animate(\n target,\n {\n transform: [\"translateY(30px) scale(0.9)\", \"translateY(0px) scale(1)\"],\n opacity: [0, 1],\n },\n {\n duration: 600,\n easing: \"cubic-bezier(0.16, 1, 0.3, 1)\",\n }\n );\n}\n"
|
|
27
|
+
};
|
|
28
|
+
case "vanilla-ts": return {
|
|
29
|
+
filename: "animation.ts",
|
|
30
|
+
content: "// AF Motion — Vanilla TypeScript Starter\nimport { animate, type AnimationControls } from \"af-motion\";\n\nexport interface MotionOptions {\n duration?: number;\n delay?: number;\n}\n\nexport function startEntrance(\n selector: string,\n options: MotionOptions = {}\n): AnimationControls | null {\n const element = document.querySelector<HTMLElement>(selector);\n if (!element) return null;\n\n return animate(\n element,\n {\n transform: [\"translateY(24px) scale(0.95)\", \"translateY(0px) scale(1)\"],\n opacity: [0, 1],\n },\n {\n duration: options.duration ?? 500,\n delay: options.delay ?? 0,\n easing: \"cubic-bezier(0.16, 1, 0.3, 1)\",\n }\n );\n}\n"
|
|
31
|
+
};
|
|
32
|
+
case "react-ts": return {
|
|
33
|
+
filename: "AnimatedCard.tsx",
|
|
34
|
+
content: "\"use client\";\n\nimport React from \"react\";\nimport { useAnimate, useMicrointeraction, Reveal } from \"af-motion/react\";\n\nexport interface AnimatedCardProps {\n title?: string;\n description?: string;\n}\n\nexport function AnimatedCard({\n title = \"AF Motion Card\",\n description = \"Hardware-accelerated React animation primitive.\",\n}: AnimatedCardProps): React.JSX.Element {\n const { ref: badgeRef, animate: animateBadge } = useAnimate<HTMLDivElement>();\n const { ref: buttonRef, handlers, isPressed } = useMicrointeraction<HTMLButtonElement>(\"button\");\n\n const handlePulse = () => {\n animateBadge({ scale: [1, 1.15, 1] }, { duration: 300 });\n };\n\n return (\n <Reveal direction=\"up\" distance={24} duration={500}>\n <div\n style={{\n padding: \"24px\",\n borderRadius: \"16px\",\n background: \"#1e293b\",\n color: \"#ffffff\",\n border: \"1px solid rgba(255, 255, 255, 0.1)\",\n boxShadow: \"0 10px 25px rgba(0, 0, 0, 0.25)\",\n }}\n >\n <div ref={badgeRef} style={{ fontSize: \"1.25rem\", fontWeight: 700, marginBottom: \"8px\" }}>\n {title}\n </div>\n <p style={{ color: \"#94a3b8\", marginBottom: \"16px\" }}>{description}</p>\n <button\n ref={buttonRef}\n {...handlers}\n onClick={handlePulse}\n style={{\n padding: \"10px 20px\",\n borderRadius: \"8px\",\n background: \"#0284c7\",\n color: \"#ffffff\",\n border: \"none\",\n cursor: \"pointer\",\n fontWeight: 600,\n transform: isPressed ? \"scale(0.95)\" : \"scale(1)\",\n transition: \"transform 0.1s ease\",\n }}\n >\n Trigger Micro-Pulse\n </button>\n </div>\n </Reveal>\n );\n}\n"
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function f(e, t) {
|
|
39
|
+
let n = t === "ts" ? "ts" : "js";
|
|
40
|
+
switch (e) {
|
|
41
|
+
case "basic": return {
|
|
42
|
+
filename: `example-basic.${n}`,
|
|
43
|
+
content: "// Basic Hardware-Accelerated WAAPI Animation\nimport { animate } from \"af-motion\";\n\nconst target = document.querySelector(\".card\");\nif (target) {\n const controls = animate(\n target,\n {\n transform: [\"scale(0.9) translateY(20px)\", \"scale(1) translateY(0px)\"],\n opacity: [0, 1],\n },\n {\n duration: 600,\n easing: \"cubic-bezier(0.16, 1, 0.3, 1)\",\n }\n );\n\n await controls.finished;\n console.log(\"Animation complete\");\n}\n"
|
|
44
|
+
};
|
|
45
|
+
case "reveal-stagger": return {
|
|
46
|
+
filename: `example-reveal-stagger.${n}`,
|
|
47
|
+
content: "// Scroll Reveal and List Stagger Choreography\nimport { reveal, stagger } from \"af-motion\";\n\n// 1. Reveal element when entering viewport\nreveal(\".section-header\", {\n properties: {\n opacity: [0, 1],\n transform: [\"translateY(30px)\", \"translateY(0px)\"],\n },\n duration: 600,\n once: true,\n});\n\n// 2. Cascade elements with stagger delay offset\nstagger(\".list-item\", {\n properties: {\n opacity: [0, 1],\n transform: [\"translateY(20px)\", \"translateY(0px)\"],\n },\n stagger: 80,\n duration: 400,\n});\n"
|
|
48
|
+
};
|
|
49
|
+
case "spring": return {
|
|
50
|
+
filename: `example-spring.${n}`,
|
|
51
|
+
content: "// Damped Physical Spring Simulation\nimport { animateSpring } from \"af-motion\";\n\nconst element = document.querySelector(\".spring-ball\");\nif (element) {\n animateSpring({\n from: 0,\n to: 100,\n config: {\n stiffness: 260,\n damping: 18,\n mass: 1,\n },\n onUpdate: ({ position }) => {\n element.style.transform = `translateY(${position}px)`;\n },\n onComplete: () => {\n console.log(\"Spring settled at equilibrium\");\n },\n });\n}\n"
|
|
52
|
+
};
|
|
53
|
+
case "timeline": return {
|
|
54
|
+
filename: `example-timeline.${n}`,
|
|
55
|
+
content: "// Coordinated Timeline Choreography\nimport { createTimeline } from \"af-motion\";\n\nconst timeline = createTimeline();\n\ntimeline\n .add({\n target: \".hero-title\",\n properties: { opacity: [0, 1], transform: [\"translateY(20px)\", \"translateY(0px)\"] },\n duration: 400,\n })\n .add({\n target: \".hero-subtitle\",\n properties: { opacity: [0, 1] },\n duration: 350,\n delay: -100, // Overlap with previous animation\n })\n .add({\n target: \".cta-button\",\n properties: { transform: [\"scale(0.8)\", \"scale(1)\"], opacity: [0, 1] },\n duration: 300,\n });\n\ntimeline.play();\n"
|
|
56
|
+
};
|
|
57
|
+
case "react": return {
|
|
58
|
+
filename: `example-react.${t === "ts" ? "tsx" : "jsx"}`,
|
|
59
|
+
content: "\"use client\";\n\nimport React from \"react\";\nimport { useAnimate, useMicrointeraction, useMotionAccessibility, Reveal } from \"af-motion/react\";\n\nexport function HeroFeature() {\n const { ref: titleRef, animate } = useAnimate<HTMLHeadingElement>();\n const { ref: btnRef, handlers, isPressed } = useMicrointeraction(\"button\");\n const { accessibilityScore } = useMotionAccessibility({ duration: 400 });\n\n const handleHeroClick = () => {\n animate({ scale: [1, 1.1, 1] }, { duration: 300 });\n };\n\n return (\n <Reveal direction=\"down\" duration={500}>\n <div className=\"hero-banner\">\n <h1 ref={titleRef}>Next-Gen Web Motion (Score: {accessibilityScore}/100)</h1>\n <button\n ref={btnRef}\n {...handlers}\n onClick={handleHeroClick}\n style={{ transform: isPressed ? \"scale(0.96)\" : \"scale(1)\" }}\n >\n Interactive Tactile Action\n </button>\n </div>\n </Reveal>\n );\n}\n"
|
|
60
|
+
};
|
|
61
|
+
case "motion-dna": return {
|
|
62
|
+
filename: `example-motion-dna.${n}`,
|
|
63
|
+
content: "// Motion DNA Kinetic Personality Integration\nimport { applyMotionDNA, animate } from \"af-motion\";\n\n// 1. Resolve Motion DNA animation options (snappy, energetic, calm, cinematic, playful)\nconst motionOptions = applyMotionDNA(\"playful\", {\n duration: 450,\n});\n\n// 2. Animate target element with the resolved kinetic DNA\nconst card = document.querySelector(\".product-card\");\nif (card) {\n animate(\n card,\n {\n transform: [\"scale(0.9) translateY(20px)\", \"scale(1) translateY(0px)\"],\n opacity: [0, 1],\n },\n motionOptions\n );\n}\n"
|
|
64
|
+
};
|
|
65
|
+
case "3d": return {
|
|
66
|
+
filename: `example-3d-scene.${n}`,
|
|
67
|
+
content: "// 3D Scene Initialization\nimport { Scene3DEngine } from \"af-motion/catalogue\";\n\nconst container = document.querySelector(\"#canvas-container\");\nif (container) {\n const engine = new Scene3DEngine({\n container,\n antialias: true,\n alpha: true,\n });\n\n engine.addMesh({\n id: \"cube\",\n geometry: { type: \"box\", width: 2, height: 2, depth: 2 },\n material: { type: \"standard\", color: \"#38bdf8\", roughness: 0.2 },\n position: [0, 0, 0],\n });\n\n engine.startRenderLoop();\n}\n"
|
|
68
|
+
};
|
|
69
|
+
case "ai-quality": return {
|
|
70
|
+
filename: `example-ai-quality.${n}`,
|
|
71
|
+
content: "// Deterministic Offline Motion Quality Evaluation\nimport { evaluateMotionQuality, generateMotionRecommendations } from \"af-motion/catalogue\";\n\nconst analysisInput = {\n configuration: {\n duration: 300,\n easing: \"cubic-bezier(0.16, 1, 0.3, 1)\",\n },\n contextHint: \"button-click\",\n};\n\n// 1. Evaluate motion heuristics (timing, smoothness, aesthetics, accessibility)\nconst report = evaluateMotionQuality(analysisInput);\nconsole.log(\"Overall Score:\", report.scores.overall, \"/ 100\");\nconsole.log(\"Grade:\", report.grade);\n\n// 2. Generate evidence-based recommendations\nconst recommendations = generateMotionRecommendations(analysisInput, report.findings);\nconsole.log(\"Actionable Heuristics:\", recommendations.length);\n"
|
|
72
|
+
};
|
|
73
|
+
case "design-to-motion": return {
|
|
74
|
+
filename: `example-design-to-motion.${n}`,
|
|
75
|
+
content: "// Offline Deterministic Design-to-Motion Generation\nimport { designToMotionEngine } from \"af-motion/catalogue\";\n\nconst result = designToMotionEngine.generateSync({\n naturalLanguage: \"Create an elegant modal entrance with smooth fade and scale\",\n tokens: {\n motionDNA: \"elegant\",\n paletteName: \"Cobalt Classic\",\n },\n});\n\nconsole.log(\"Generated Elements:\", result.plan.elementPlans.length);\nconsole.log(\"Quality Score:\", result.validation.qualityScore);\nconsole.log(\"Validation Issues:\", result.validation.issues.length);\n"
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// src/cli/utils/terminal.ts
|
|
80
|
+
var p = class {
|
|
81
|
+
enabled;
|
|
82
|
+
constructor(e) {
|
|
83
|
+
if (e !== void 0) this.enabled = e;
|
|
84
|
+
else {
|
|
85
|
+
let e = typeof process < "u" && !!process.env.NO_COLOR, t = typeof process < "u" && process.env.TERM === "dumb", n = typeof process < "u" && !!process.stdout?.isTTY, r = typeof process < "u" && !!process.env.CI;
|
|
86
|
+
this.enabled = !e && !t && (n || r);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
setColorEnabled(e) {
|
|
90
|
+
this.enabled = e;
|
|
91
|
+
}
|
|
92
|
+
isColorEnabled() {
|
|
93
|
+
return this.enabled;
|
|
94
|
+
}
|
|
95
|
+
wrap(e, t, n) {
|
|
96
|
+
return this.enabled ? `\x1b[${e}m${n}\x1b[${t}m` : n;
|
|
97
|
+
}
|
|
98
|
+
bold(e) {
|
|
99
|
+
return this.wrap(1, 22, e);
|
|
100
|
+
}
|
|
101
|
+
dim(e) {
|
|
102
|
+
return this.wrap(2, 22, e);
|
|
103
|
+
}
|
|
104
|
+
red(e) {
|
|
105
|
+
return this.wrap(31, 39, e);
|
|
106
|
+
}
|
|
107
|
+
green(e) {
|
|
108
|
+
return this.wrap(32, 39, e);
|
|
109
|
+
}
|
|
110
|
+
yellow(e) {
|
|
111
|
+
return this.wrap(33, 39, e);
|
|
112
|
+
}
|
|
113
|
+
blue(e) {
|
|
114
|
+
return this.wrap(34, 39, e);
|
|
115
|
+
}
|
|
116
|
+
magenta(e) {
|
|
117
|
+
return this.wrap(35, 39, e);
|
|
118
|
+
}
|
|
119
|
+
cyan(e) {
|
|
120
|
+
return this.wrap(36, 39, e);
|
|
121
|
+
}
|
|
122
|
+
gray(e) {
|
|
123
|
+
return this.wrap(90, 39, e);
|
|
124
|
+
}
|
|
125
|
+
pass(e = "PASS") {
|
|
126
|
+
return this.green(`✓ ${e}`);
|
|
127
|
+
}
|
|
128
|
+
warn(e = "WARN") {
|
|
129
|
+
return this.yellow(`⚠ ${e}`);
|
|
130
|
+
}
|
|
131
|
+
fail(e = "FAIL") {
|
|
132
|
+
return this.red(`✗ ${e}`);
|
|
133
|
+
}
|
|
134
|
+
info(e = "INFO") {
|
|
135
|
+
return this.cyan(`ℹ ${e}`);
|
|
136
|
+
}
|
|
137
|
+
banner(e, t) {
|
|
138
|
+
let n = [this.bold(this.cyan(`=== ${e} ===`))];
|
|
139
|
+
return t && n.push(this.dim(t)), n.join("\n");
|
|
140
|
+
}
|
|
141
|
+
table(e, t) {
|
|
142
|
+
if (t.length === 0) return "";
|
|
143
|
+
let n = e.map((e, n) => {
|
|
144
|
+
let r = e.length;
|
|
145
|
+
for (let e of t) {
|
|
146
|
+
let t = (e[n] ?? "").replace(/\x1b\[[0-9;]*m/g, "");
|
|
147
|
+
t.length > r && (r = t.length);
|
|
148
|
+
}
|
|
149
|
+
return r + 2;
|
|
150
|
+
}), r = (e) => e.map((e, t) => {
|
|
151
|
+
let r = e.replace(/\x1b\[[0-9;]*m/g, "");
|
|
152
|
+
return `${e}${" ".repeat(Math.max(0, n[t] - r.length))}`;
|
|
153
|
+
}).join("");
|
|
154
|
+
return [
|
|
155
|
+
this.bold(r(e)),
|
|
156
|
+
this.dim("-".repeat(n.reduce((e, t) => e + t, 0))),
|
|
157
|
+
...t.map((e) => r(e))
|
|
158
|
+
].join("\n");
|
|
159
|
+
}
|
|
160
|
+
}, m = new p();
|
|
161
|
+
// src/cli/utils/safety.ts
|
|
162
|
+
function h(e, t, n = "target path") {
|
|
163
|
+
if (typeof t != "string" || t.trim().length === 0) throw TypeError(`Invalid ${n}: path must be a non-empty string.`);
|
|
164
|
+
if (t.includes("\0")) throw Error(`Security error: ${n} contains null byte.`);
|
|
165
|
+
let r = c.resolve(e), i = c.resolve(r, t), a = c.relative(r, i);
|
|
166
|
+
if (a.startsWith("..") || c.isAbsolute(a)) throw Error(`Security error: ${n} '${t}' resolves outside workspace directory '${r}'.`);
|
|
167
|
+
return i;
|
|
168
|
+
}
|
|
169
|
+
// src/cli/commands/init.ts
|
|
170
|
+
var g = /* @__PURE__ */ new Set([
|
|
171
|
+
"vanilla-js",
|
|
172
|
+
"vanilla-ts",
|
|
173
|
+
"react-ts"
|
|
174
|
+
]);
|
|
175
|
+
function _(e) {
|
|
176
|
+
let t = c.join(e, "package.json"), n = c.join(e, "tsconfig.json"), r = !1;
|
|
177
|
+
if (s.existsSync(t)) try {
|
|
178
|
+
let e = o(s.readFileSync(t, "utf8"));
|
|
179
|
+
r = !!(e.dependencies?.react || e.devDependencies?.react || e.peerDependencies?.react);
|
|
180
|
+
} catch {}
|
|
181
|
+
let i = s.existsSync(n);
|
|
182
|
+
return r ? "react-ts" : i ? "vanilla-ts" : "vanilla-js";
|
|
183
|
+
}
|
|
184
|
+
async function v(e = {}) {
|
|
185
|
+
let t = c.resolve(e.cwd ?? process.cwd()), n = e.name ? h(t, e.name, "init target directory") : t;
|
|
186
|
+
if (e.template !== void 0 && !g.has(e.template)) throw TypeError(`Invalid starter template '${String(e.template)}'. Expected one of: vanilla-js, vanilla-ts, react-ts.`);
|
|
187
|
+
s.existsSync(n) || s.mkdirSync(n, { recursive: !0 });
|
|
188
|
+
let r = e.template ?? _(n), i = d(r), a = [], o = [], l = c.join(n, i.filename);
|
|
189
|
+
s.existsSync(l) && !e.force ? o.push(i.filename) : (s.writeFileSync(l, i.content, "utf8"), a.push(i.filename));
|
|
190
|
+
let f = !1;
|
|
191
|
+
if (!e.noConfig) {
|
|
192
|
+
let t = c.join(n, "af-motion.config.json");
|
|
193
|
+
s.existsSync(t) && !e.force ? o.push("af-motion.config.json") : (s.writeFileSync(t, u, "utf8"), a.push("af-motion.config.json"), f = !0);
|
|
194
|
+
}
|
|
195
|
+
let p = a.length > 0, v = p ? `Initialized AF Motion [${r}] template in ${c.relative(t, n) || "."}` : "No files were created because existing files were preserved. Use --force to overwrite.", y = {
|
|
196
|
+
success: p,
|
|
197
|
+
template: r,
|
|
198
|
+
createdFiles: a,
|
|
199
|
+
skippedFiles: o,
|
|
200
|
+
configCreated: f,
|
|
201
|
+
message: v
|
|
202
|
+
};
|
|
203
|
+
if (!e.quiet) {
|
|
204
|
+
if (e.json) console.log(JSON.stringify(y, null, 2));
|
|
205
|
+
else {
|
|
206
|
+
if (console.log(m.banner("AF Motion Project Initialization")), console.log(""), console.log(`Target directory: ${m.bold(n)}`), console.log(`Template: ${m.cyan(r)}`), console.log(""), a.length > 0) {
|
|
207
|
+
console.log(m.bold("Created files:"));
|
|
208
|
+
for (let e of a) console.log(` ${m.green("+")} ${e}`);
|
|
209
|
+
}
|
|
210
|
+
if (o.length > 0) {
|
|
211
|
+
console.log(""), console.log(m.yellow("Existing files preserved (use --force to overwrite):"));
|
|
212
|
+
for (let e of o) console.log(` ${m.yellow("!")} ${e}`);
|
|
213
|
+
}
|
|
214
|
+
console.log(""), p && (console.log(m.bold("Next Steps:")), console.log(` 1. Run diagnostics: ${m.cyan("af-motion doctor")}`), console.log(` 2. Explore presets: ${m.cyan("af-motion presets")}`), console.log(` 3. Generate example: ${m.cyan("af-motion example spring")}`));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return y;
|
|
218
|
+
}
|
|
219
|
+
// src/cli/commands/doctor.ts
|
|
220
|
+
function y(e) {
|
|
221
|
+
let t = [], n = process.versions.node, r = parseInt(n.split(".")[0], 10);
|
|
222
|
+
r >= 20 ? t.push({
|
|
223
|
+
id: "node-version",
|
|
224
|
+
category: "environment",
|
|
225
|
+
name: "Node.js Runtime Version",
|
|
226
|
+
status: "pass",
|
|
227
|
+
message: `Node.js v${n} meets recommended >= v20.0.0.`
|
|
228
|
+
}) : r >= 18 ? t.push({
|
|
229
|
+
id: "node-version",
|
|
230
|
+
category: "environment",
|
|
231
|
+
name: "Node.js Runtime Version",
|
|
232
|
+
status: "warn",
|
|
233
|
+
message: `Node.js v${n} meets minimum v18.0.0, but v20+ is recommended for optimal performance.`,
|
|
234
|
+
remediation: "Upgrade Node.js to v20 or v22 LTS."
|
|
235
|
+
}) : t.push({
|
|
236
|
+
id: "node-version",
|
|
237
|
+
category: "environment",
|
|
238
|
+
name: "Node.js Runtime Version",
|
|
239
|
+
status: "fail",
|
|
240
|
+
message: `Node.js v${n} is unsupported. AF Motion requires Node.js >= v18.0.0.`,
|
|
241
|
+
remediation: "Upgrade Node.js to v18, v20, or v22 LTS."
|
|
242
|
+
});
|
|
243
|
+
let i = c.join(e, "package.json"), a = null;
|
|
244
|
+
if (s.existsSync(i)) try {
|
|
245
|
+
a = o(s.readFileSync(i, "utf8")), t.push({
|
|
246
|
+
id: "package-json",
|
|
247
|
+
category: "dependencies",
|
|
248
|
+
name: "Project Manifest",
|
|
249
|
+
status: "pass",
|
|
250
|
+
message: `Found valid package.json for '${a.name || "unnamed project"}'.`
|
|
251
|
+
});
|
|
252
|
+
} catch {
|
|
253
|
+
t.push({
|
|
254
|
+
id: "package-json",
|
|
255
|
+
category: "dependencies",
|
|
256
|
+
name: "Project Manifest",
|
|
257
|
+
status: "fail",
|
|
258
|
+
message: "Found package.json, but it contains invalid JSON syntax.",
|
|
259
|
+
remediation: "Correct JSON formatting errors in package.json."
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
else t.push({
|
|
263
|
+
id: "package-json",
|
|
264
|
+
category: "dependencies",
|
|
265
|
+
name: "Project Manifest",
|
|
266
|
+
status: "warn",
|
|
267
|
+
message: "No package.json found in the current directory.",
|
|
268
|
+
remediation: "Run 'npm init -y' or 'af-motion init' to set up a project."
|
|
269
|
+
});
|
|
270
|
+
if (a) {
|
|
271
|
+
let e = a.name === "af-motion", n = a.dependencies?.["af-motion"] || a.devDependencies?.["af-motion"] || a.peerDependencies?.["af-motion"];
|
|
272
|
+
e ? t.push({
|
|
273
|
+
id: "af-motion-install",
|
|
274
|
+
category: "dependencies",
|
|
275
|
+
name: "AF Motion Package",
|
|
276
|
+
status: "pass",
|
|
277
|
+
message: `Running inside af-motion repository codebase (v${a.version || "1.0.0"}).`
|
|
278
|
+
}) : n ? t.push({
|
|
279
|
+
id: "af-motion-install",
|
|
280
|
+
category: "dependencies",
|
|
281
|
+
name: "AF Motion Dependency",
|
|
282
|
+
status: "pass",
|
|
283
|
+
message: `af-motion declared as dependency (${n}).`
|
|
284
|
+
}) : t.push({
|
|
285
|
+
id: "af-motion-install",
|
|
286
|
+
category: "dependencies",
|
|
287
|
+
name: "AF Motion Dependency",
|
|
288
|
+
status: "warn",
|
|
289
|
+
message: "af-motion is not declared in package.json dependencies.",
|
|
290
|
+
remediation: "Install via 'npm install af-motion'."
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (a) {
|
|
294
|
+
let n = a.dependencies?.react || a.devDependencies?.react || a.peerDependencies?.react;
|
|
295
|
+
if (n && (n.includes("18") || n.includes("19") || n.includes("*") || n.includes("latest") ? t.push({
|
|
296
|
+
id: "react-peer",
|
|
297
|
+
category: "dependencies",
|
|
298
|
+
name: "React Compatibility",
|
|
299
|
+
status: "pass",
|
|
300
|
+
message: `React version (${n}) is compatible with AF Motion React bindings.`
|
|
301
|
+
}) : t.push({
|
|
302
|
+
id: "react-peer",
|
|
303
|
+
category: "dependencies",
|
|
304
|
+
name: "React Compatibility",
|
|
305
|
+
status: "warn",
|
|
306
|
+
message: `Detected React (${n}). AF Motion officially supports React 18 and React 19.`,
|
|
307
|
+
remediation: "Upgrade React to v18 or v19: 'npm install react@latest react-dom@latest'."
|
|
308
|
+
}), s.existsSync(c.join(e, "tsconfig.json")))) {
|
|
309
|
+
let e = a.devDependencies?.["@types/react"] || a.dependencies?.["@types/react"];
|
|
310
|
+
e ? t.push({
|
|
311
|
+
id: "types-react",
|
|
312
|
+
category: "dependencies",
|
|
313
|
+
name: "React Type Definitions",
|
|
314
|
+
status: "pass",
|
|
315
|
+
message: `Found @types/react (${e}).`
|
|
316
|
+
}) : t.push({
|
|
317
|
+
id: "types-react",
|
|
318
|
+
category: "dependencies",
|
|
319
|
+
name: "React Type Definitions",
|
|
320
|
+
status: "warn",
|
|
321
|
+
message: "TypeScript project with React detected, but @types/react is missing.",
|
|
322
|
+
remediation: "Install type definitions: 'npm install -D @types/react @types/react-dom'."
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
let l = c.join(e, "tsconfig.json");
|
|
327
|
+
if (s.existsSync(l)) try {
|
|
328
|
+
let e = o(s.readFileSync(l, "utf8")).compilerOptions || {}, n = e.moduleResolution?.toLowerCase();
|
|
329
|
+
n === "bundler" || n === "node16" || n === "nodenext" ? t.push({
|
|
330
|
+
id: "ts-resolution",
|
|
331
|
+
category: "configuration",
|
|
332
|
+
name: "TypeScript Module Resolution",
|
|
333
|
+
status: "pass",
|
|
334
|
+
message: `moduleResolution '${e.moduleResolution}' supports modern package subpaths.`
|
|
335
|
+
}) : t.push({
|
|
336
|
+
id: "ts-resolution",
|
|
337
|
+
category: "configuration",
|
|
338
|
+
name: "TypeScript Module Resolution",
|
|
339
|
+
status: "warn",
|
|
340
|
+
message: `moduleResolution is '${e.moduleResolution || "node"}'. Subpath imports (e.g. 'af-motion/react') require 'bundler', 'node16', or 'nodenext'.`,
|
|
341
|
+
remediation: "Set '\"moduleResolution\": \"bundler\"' in tsconfig.json compilerOptions."
|
|
342
|
+
});
|
|
343
|
+
} catch {
|
|
344
|
+
t.push({
|
|
345
|
+
id: "ts-config-valid",
|
|
346
|
+
category: "configuration",
|
|
347
|
+
name: "TypeScript Configuration",
|
|
348
|
+
status: "warn",
|
|
349
|
+
message: "tsconfig.json exists but could not be parsed as valid JSON.",
|
|
350
|
+
remediation: "Verify syntax and remove trailing commas from tsconfig.json."
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
t.push({
|
|
354
|
+
id: "subpath-availability",
|
|
355
|
+
category: "framework",
|
|
356
|
+
name: "Package Subpath Mapping",
|
|
357
|
+
status: "pass",
|
|
358
|
+
message: "All 4 official subpaths verified: af-motion, af-motion/react, af-motion/catalogue, af-motion/presets."
|
|
359
|
+
}), a && (a.dependencies?.["framer-motion"] || a.devDependencies?.["framer-motion"]) && t.push({
|
|
360
|
+
id: "framer-motion-coexistence",
|
|
361
|
+
category: "framework",
|
|
362
|
+
name: "Coexisting Motion Libraries",
|
|
363
|
+
status: "warn",
|
|
364
|
+
message: "Found framer-motion in package dependencies. AF Motion can coexist, but avoid animating the same DOM node with both.",
|
|
365
|
+
remediation: "Consider migrating framer-motion components to AF Motion's lighter WAAPI primitives."
|
|
366
|
+
});
|
|
367
|
+
let u = t.filter((e) => e.status === "pass").length, d = t.filter((e) => e.status === "warn").length, f = t.filter((e) => e.status === "fail").length, p = f > 0 ? "fail" : d > 0 ? "warn" : "pass";
|
|
368
|
+
return {
|
|
369
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
370
|
+
overallStatus: p,
|
|
371
|
+
passedCount: u,
|
|
372
|
+
warnCount: d,
|
|
373
|
+
failCount: f,
|
|
374
|
+
checks: t
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
async function b(e = {}) {
|
|
378
|
+
let t = c.resolve(e.cwd ?? process.cwd()), n = y(t);
|
|
379
|
+
if (!e.quiet) {
|
|
380
|
+
if (e.json) console.log(JSON.stringify(n, null, 2));
|
|
381
|
+
else {
|
|
382
|
+
console.log(m.banner("AF Motion Environment & Project Doctor")), console.log(""), console.log(`Inspecting: ${m.bold(t)}`), console.log("");
|
|
383
|
+
for (let e of n.checks) {
|
|
384
|
+
let t = e.status === "pass" ? m.pass() : e.status === "warn" ? m.warn() : m.fail();
|
|
385
|
+
console.log(`${t} ${m.bold(e.name)}: ${e.message}`), e.remediation && console.log(` ${m.cyan("Remediation:")} ${e.remediation}`);
|
|
386
|
+
}
|
|
387
|
+
console.log("");
|
|
388
|
+
let e = n.overallStatus === "pass" ? m.green : n.overallStatus === "warn" ? m.yellow : m.red;
|
|
389
|
+
console.log(e.call(m, `Diagnostic Result: ${n.overallStatus.toUpperCase()} (${n.passedCount} passed, ${n.warnCount} warnings, ${n.failCount} errors)`));
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return n;
|
|
393
|
+
}
|
|
394
|
+
// src/cli/commands/validate.ts
|
|
395
|
+
var x = /* @__PURE__ */ new Set([
|
|
396
|
+
"precise",
|
|
397
|
+
"playful",
|
|
398
|
+
"elegant",
|
|
399
|
+
"energetic",
|
|
400
|
+
"editorial-flow",
|
|
401
|
+
"snappy",
|
|
402
|
+
"calm",
|
|
403
|
+
"cinematic",
|
|
404
|
+
"minimal"
|
|
405
|
+
]), S = new Set(t.map((e) => e.name.toLowerCase()));
|
|
406
|
+
function C(e) {
|
|
407
|
+
let t = [];
|
|
408
|
+
if (!s.existsSync(e)) return t.push({
|
|
409
|
+
severity: "error",
|
|
410
|
+
path: e,
|
|
411
|
+
message: `File does not exist: ${e}`
|
|
412
|
+
}), {
|
|
413
|
+
file: e,
|
|
414
|
+
valid: !1,
|
|
415
|
+
findings: t,
|
|
416
|
+
summary: {
|
|
417
|
+
errors: 1,
|
|
418
|
+
warnings: 0
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
let n = "";
|
|
422
|
+
try {
|
|
423
|
+
n = s.readFileSync(e, "utf8");
|
|
424
|
+
} catch (n) {
|
|
425
|
+
return t.push({
|
|
426
|
+
severity: "error",
|
|
427
|
+
path: e,
|
|
428
|
+
message: `Failed to read file: ${n.message}`
|
|
429
|
+
}), {
|
|
430
|
+
file: e,
|
|
431
|
+
valid: !1,
|
|
432
|
+
findings: t,
|
|
433
|
+
summary: {
|
|
434
|
+
errors: 1,
|
|
435
|
+
warnings: 0
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
let r = null;
|
|
440
|
+
try {
|
|
441
|
+
r = o(n);
|
|
442
|
+
} catch (n) {
|
|
443
|
+
return t.push({
|
|
444
|
+
severity: "error",
|
|
445
|
+
path: e,
|
|
446
|
+
message: `Invalid JSON syntax: ${n.message}`
|
|
447
|
+
}), {
|
|
448
|
+
file: e,
|
|
449
|
+
valid: !1,
|
|
450
|
+
findings: t,
|
|
451
|
+
summary: {
|
|
452
|
+
errors: 1,
|
|
453
|
+
warnings: 0
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
if (typeof r != "object" || !r || Array.isArray(r)) return t.push({
|
|
458
|
+
severity: "error",
|
|
459
|
+
path: "$",
|
|
460
|
+
message: "Configuration root must be a valid JSON object."
|
|
461
|
+
}), {
|
|
462
|
+
file: e,
|
|
463
|
+
valid: !1,
|
|
464
|
+
findings: t,
|
|
465
|
+
summary: {
|
|
466
|
+
errors: 1,
|
|
467
|
+
warnings: 0
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
r.defaultMotionDNA !== void 0 && (typeof r.defaultMotionDNA == "string" ? x.has(r.defaultMotionDNA.toLowerCase()) || t.push({
|
|
471
|
+
severity: "error",
|
|
472
|
+
path: "$.defaultMotionDNA",
|
|
473
|
+
message: `Unknown Motion DNA profile '${r.defaultMotionDNA}'.`,
|
|
474
|
+
suggestion: `Choose from: ${Array.from(x).join(", ")}.`
|
|
475
|
+
}) : t.push({
|
|
476
|
+
severity: "error",
|
|
477
|
+
path: "$.defaultMotionDNA",
|
|
478
|
+
message: "defaultMotionDNA must be a string."
|
|
479
|
+
})), r.defaultPalette !== void 0 && (typeof r.defaultPalette == "string" ? S.has(r.defaultPalette.toLowerCase()) || t.push({
|
|
480
|
+
severity: "error",
|
|
481
|
+
path: "$.defaultPalette",
|
|
482
|
+
message: `Unknown palette '${r.defaultPalette}'.`,
|
|
483
|
+
suggestion: "Reference one of the 33 built-in palettes (e.g. 'Cobalt Classic', 'Midnight Voltage', 'Neon Abyss')."
|
|
484
|
+
}) : t.push({
|
|
485
|
+
severity: "error",
|
|
486
|
+
path: "$.defaultPalette",
|
|
487
|
+
message: "defaultPalette must be a string."
|
|
488
|
+
})), r.accessibility !== void 0 && (typeof r.accessibility != "object" || r.accessibility === null ? t.push({
|
|
489
|
+
severity: "error",
|
|
490
|
+
path: "$.accessibility",
|
|
491
|
+
message: "accessibility must be an object."
|
|
492
|
+
}) : (r.accessibility.respectReducedMotion !== void 0 && typeof r.accessibility.respectReducedMotion != "boolean" && t.push({
|
|
493
|
+
severity: "error",
|
|
494
|
+
path: "$.accessibility.respectReducedMotion",
|
|
495
|
+
message: "respectReducedMotion must be a boolean."
|
|
496
|
+
}), r.accessibility.fallbackDurationMs !== void 0 && (typeof r.accessibility.fallbackDurationMs != "number" || !Number.isFinite(r.accessibility.fallbackDurationMs) || r.accessibility.fallbackDurationMs < 0) && t.push({
|
|
497
|
+
severity: "error",
|
|
498
|
+
path: "$.accessibility.fallbackDurationMs",
|
|
499
|
+
message: "fallbackDurationMs must be a finite non-negative number."
|
|
500
|
+
}))), r.performance !== void 0 && (typeof r.performance != "object" || r.performance === null ? t.push({
|
|
501
|
+
severity: "error",
|
|
502
|
+
path: "$.performance",
|
|
503
|
+
message: "performance must be an object."
|
|
504
|
+
}) : (r.performance.targetFps !== void 0 && ![
|
|
505
|
+
30,
|
|
506
|
+
60,
|
|
507
|
+
90,
|
|
508
|
+
120
|
|
509
|
+
].includes(r.performance.targetFps) && t.push({
|
|
510
|
+
severity: "warning",
|
|
511
|
+
path: "$.performance.targetFps",
|
|
512
|
+
message: `targetFps (${r.performance.targetFps}) is unusual. Standard target rates are 30, 60, or 120.`
|
|
513
|
+
}), r.performance.gpuAcceleration !== void 0 && typeof r.performance.gpuAcceleration != "boolean" && t.push({
|
|
514
|
+
severity: "error",
|
|
515
|
+
path: "$.performance.gpuAcceleration",
|
|
516
|
+
message: "gpuAcceleration must be a boolean."
|
|
517
|
+
}))), r.tracks === void 0 && r.keyframes === void 0 || r.tracks === void 0 || Array.isArray(r.tracks) || t.push({
|
|
518
|
+
severity: "error",
|
|
519
|
+
path: "$.tracks",
|
|
520
|
+
message: "Composition tracks must be an array."
|
|
521
|
+
});
|
|
522
|
+
let i = t.filter((e) => e.severity === "error").length, a = t.filter((e) => e.severity === "warning").length;
|
|
523
|
+
return {
|
|
524
|
+
file: e,
|
|
525
|
+
valid: i === 0,
|
|
526
|
+
findings: t,
|
|
527
|
+
summary: {
|
|
528
|
+
errors: i,
|
|
529
|
+
warnings: a
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
async function w(e, t = {}) {
|
|
534
|
+
let n = c.resolve(t.cwd ?? process.cwd());
|
|
535
|
+
if (e && e.includes("\0")) throw Error("Security error: target file path contains null byte.");
|
|
536
|
+
let r = e ? c.resolve(n, e) : "";
|
|
537
|
+
if (!r) {
|
|
538
|
+
let e = c.join(n, "af-motion.config.json");
|
|
539
|
+
r = (s.existsSync(e), e);
|
|
540
|
+
}
|
|
541
|
+
let i = C(r);
|
|
542
|
+
if (!t.quiet) {
|
|
543
|
+
if (t.json) console.log(JSON.stringify(i, null, 2));
|
|
544
|
+
else {
|
|
545
|
+
if (console.log(m.banner("AF Motion Configuration Validation")), console.log(""), console.log(`Validating file: ${m.bold(c.relative(n, r) || r)}`), console.log(""), i.findings.length === 0) console.log(m.pass("Configuration adheres to schema and verified AF Motion standards."));
|
|
546
|
+
else for (let e of i.findings) {
|
|
547
|
+
let t = e.severity === "error" ? m.fail() : e.severity === "warning" ? m.warn() : m.info();
|
|
548
|
+
console.log(`${t} ${m.bold(e.path)}: ${e.message}`), e.suggestion && console.log(` ${m.cyan("Suggestion:")} ${e.suggestion}`);
|
|
549
|
+
}
|
|
550
|
+
console.log(""), i.valid ? console.log(m.green(`Validation Status: VALID (${i.summary.warnings} warnings)`)) : console.log(m.red(`Validation Status: INVALID (${i.summary.errors} errors, ${i.summary.warnings} warnings)`));
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
return i;
|
|
554
|
+
}
|
|
555
|
+
// src/cli/commands/presets.ts
|
|
556
|
+
async function T(e = {}) {
|
|
557
|
+
let t = n();
|
|
558
|
+
if (e.category && (t = i(e.category)), e.search && (t = r(e.search)), e.json) {
|
|
559
|
+
console.log(JSON.stringify(t, null, 2));
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
console.log(m.banner("AF Motion Preset Discovery")), console.log(""), console.log(`Found ${m.bold(String(t.length))} presets matching filters:`), console.log("");
|
|
563
|
+
let a = [
|
|
564
|
+
"Name",
|
|
565
|
+
"Category",
|
|
566
|
+
"Duration",
|
|
567
|
+
"Description"
|
|
568
|
+
], o = t.slice(0, 25).map((e) => [
|
|
569
|
+
m.cyan(e.name),
|
|
570
|
+
e.category,
|
|
571
|
+
`${e.animation?.duration ?? 400}ms`,
|
|
572
|
+
e.description.slice(0, 50) + (e.description.length > 50 ? "..." : "")
|
|
573
|
+
]);
|
|
574
|
+
console.log(m.table(a, o)), t.length > 25 && (console.log(""), console.log(m.dim(`... and ${t.length - 25} more presets. Use --search or --category to filter.`))), console.log(""), console.log(`Inspect preset: ${m.cyan("af-motion presets inspect <name>")}`), console.log(`Export preset: ${m.cyan("af-motion presets export <name> --format ts")}`);
|
|
575
|
+
}
|
|
576
|
+
async function E(t, n = {}) {
|
|
577
|
+
let r = e(t);
|
|
578
|
+
if (!r) return n.json ? console.log(JSON.stringify({ error: `Preset '${t}' not found.` }, null, 2)) : (console.error(m.fail(`Preset '${t}' not found.`)), console.error(`Run ${m.cyan("af-motion presets")} to view all registered presets.`)), null;
|
|
579
|
+
let i = {
|
|
580
|
+
id: r.id,
|
|
581
|
+
name: r.name,
|
|
582
|
+
category: r.category,
|
|
583
|
+
description: r.description,
|
|
584
|
+
duration: r.animation?.duration ?? 400,
|
|
585
|
+
easing: typeof r.animation?.easing == "string" ? r.animation.easing : "easeOutCubic",
|
|
586
|
+
tags: r.tags,
|
|
587
|
+
properties: r.animation?.properties,
|
|
588
|
+
characteristics: r.configurableParameters
|
|
589
|
+
};
|
|
590
|
+
return n.json ? console.log(JSON.stringify(i, null, 2)) : (console.log(m.banner(`Preset: ${r.name}`, r.id)), console.log(""), console.log(`Category: ${m.cyan(r.category)}`), console.log(`Duration: ${m.bold(String(r.animation?.duration ?? 400))}ms`), console.log(`Easing: ${String(r.animation?.easing ?? "easeOutCubic")}`), console.log(`Description: ${r.description}`), r.tags && r.tags.length > 0 && console.log(`Tags: ${r.tags.join(", ")}`), r.animation?.properties && (console.log(""), console.log(m.bold("Animation Properties:")), console.log(JSON.stringify(r.animation.properties, null, 2)))), i;
|
|
591
|
+
}
|
|
592
|
+
async function D(t, n = {}) {
|
|
593
|
+
let r = e(t);
|
|
594
|
+
if (!r) return console.error(m.fail(`Cannot export unknown preset '${t}'.`)), !1;
|
|
595
|
+
let i = n.format ?? "json";
|
|
596
|
+
if (i !== "json" && i !== "ts") return console.error(m.fail(`Invalid export format '${String(i)}'. Expected 'json' or 'ts'.`)), !1;
|
|
597
|
+
let o = "";
|
|
598
|
+
if (o = i === "json" ? JSON.stringify({
|
|
599
|
+
id: r.id,
|
|
600
|
+
name: r.name,
|
|
601
|
+
category: r.category,
|
|
602
|
+
duration: r.animation?.duration ?? 400,
|
|
603
|
+
easing: typeof r.animation?.easing == "string" ? r.animation.easing : "easeOutCubic",
|
|
604
|
+
properties: r.animation?.properties
|
|
605
|
+
}, null, 2) : `// Exported from AF Motion Preset: ${a(r.name)}
|
|
606
|
+
import { applyPreset } from "af-motion/presets";
|
|
607
|
+
|
|
608
|
+
// Apply preset directly to target element
|
|
609
|
+
const target = document.querySelector(".target");
|
|
610
|
+
if (target) {
|
|
611
|
+
applyPreset(target, ${JSON.stringify(r.name)});
|
|
612
|
+
}
|
|
613
|
+
`, n.out) {
|
|
614
|
+
let e = h(c.resolve(n.cwd ?? l.cwd()), n.out, "preset export output path");
|
|
615
|
+
if (s.existsSync(e) && !n.force) return console.error(m.fail(`Target file '${n.out}' already exists. Use --force to overwrite.`)), !1;
|
|
616
|
+
let t = c.dirname(e);
|
|
617
|
+
s.existsSync(t) || s.mkdirSync(t, { recursive: !0 }), s.writeFileSync(e, o, "utf8"), console.log(m.pass(`Exported preset '${r.name}' to ${n.out}`));
|
|
618
|
+
} else console.log(o);
|
|
619
|
+
return !0;
|
|
620
|
+
}
|
|
621
|
+
// src/cli/commands/info.ts
|
|
622
|
+
function O() {
|
|
623
|
+
let e = typeof process < "u" && !!process.env.NO_COLOR, r = typeof process < "u" && !!process.stdout?.isTTY, i = typeof process < "u" && !!process.env.CI;
|
|
624
|
+
return {
|
|
625
|
+
version: "1.0.0",
|
|
626
|
+
subpaths: {
|
|
627
|
+
core: "af-motion",
|
|
628
|
+
react: "af-motion/react",
|
|
629
|
+
catalogue: "af-motion/catalogue",
|
|
630
|
+
presets: "af-motion/presets"
|
|
631
|
+
},
|
|
632
|
+
coreFeatures: [
|
|
633
|
+
"Web Animations API (WAAPI) Hardware-accelerated Core",
|
|
634
|
+
"Damped Physical Springs (animateSpring)",
|
|
635
|
+
"Timeline Choreography & Sequencing (createTimeline)",
|
|
636
|
+
"Tactile Microinteractions & Magnetic UI",
|
|
637
|
+
"Directional Reveal & Cascading Stagger",
|
|
638
|
+
"Interactive 3D Tilt & Perspective"
|
|
639
|
+
],
|
|
640
|
+
easingsCount: 56,
|
|
641
|
+
palettesCount: t.length,
|
|
642
|
+
visualStylesCount: 19,
|
|
643
|
+
motionDNAPersonalities: [
|
|
644
|
+
"precise",
|
|
645
|
+
"playful",
|
|
646
|
+
"elegant",
|
|
647
|
+
"energetic",
|
|
648
|
+
"editorial-flow",
|
|
649
|
+
"snappy",
|
|
650
|
+
"calm",
|
|
651
|
+
"cinematic",
|
|
652
|
+
"minimal"
|
|
653
|
+
],
|
|
654
|
+
presetsCount: n().length,
|
|
655
|
+
aiCapabilities: [
|
|
656
|
+
"Deterministic Motion Intent Classification",
|
|
657
|
+
"Multi-dimensional Motion Quality Evaluator",
|
|
658
|
+
"Evidence-based Heuristic Recommendations",
|
|
659
|
+
"Design-to-Motion Generation Pipeline",
|
|
660
|
+
"AI Scene Generation & Composition",
|
|
661
|
+
"Intelligent Agent Workflow System",
|
|
662
|
+
"Multi-agent Choreography & Orchestration"
|
|
663
|
+
],
|
|
664
|
+
environment: {
|
|
665
|
+
nodeVersion: process.version,
|
|
666
|
+
platform: process.platform,
|
|
667
|
+
arch: process.arch,
|
|
668
|
+
isCI: i,
|
|
669
|
+
supportsColor: !e && (r || i)
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
async function k(e = {}) {
|
|
674
|
+
let t = O();
|
|
675
|
+
if (!e.quiet) {
|
|
676
|
+
if (e.json) console.log(JSON.stringify(t, null, 2));
|
|
677
|
+
else {
|
|
678
|
+
console.log(m.banner("AF Motion System & Capability Info", `v${t.version}`)), console.log(""), console.log(`${m.bold("Installed Version:")} v${t.version}`), console.log(`${m.bold("Runtime:")} Node ${t.environment.nodeVersion} (${t.environment.platform} ${t.environment.arch})`), console.log(""), console.log(m.bold("Official Package Subpaths:")), console.log(` ${m.cyan("af-motion")} - Core WAAPI animations, springs, backgrounds & physics`), console.log(` ${m.cyan("af-motion/react")} - React 18/19 hooks (useAnimate, useMicrointeraction, Reveal)`), console.log(` ${m.cyan("af-motion/catalogue")} - Motion intelligence, 3D engines & AI ecosystem`), console.log(` ${m.cyan("af-motion/presets")} - Standardized recipes and animation presets`), console.log(""), console.log(m.bold("Design & Kinetic Registries:")), console.log(` Visual Styles: ${m.bold(String(t.visualStylesCount))} verified visual design styles`), console.log(` Built-in Palettes: ${m.bold(String(t.palettesCount))} immutable color palettes`), console.log(` Mathematical Curves:${m.bold(String(t.easingsCount))} easing curves + cubic-bezier engine`), console.log(` Standard Presets: ${m.bold(String(t.presetsCount))} verified recipes`), console.log(` Motion DNA Curves: ${t.motionDNAPersonalities.slice(0, 5).join(", ")}`), console.log(""), console.log(m.bold("Deterministic AI Capabilities (Zero Cloud APIs):"));
|
|
679
|
+
for (let e of t.aiCapabilities) console.log(` ${m.green("✓")} ${e}`);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
return t;
|
|
683
|
+
}
|
|
684
|
+
// src/cli/commands/example.ts
|
|
685
|
+
var A = [
|
|
686
|
+
"basic",
|
|
687
|
+
"reveal-stagger",
|
|
688
|
+
"spring",
|
|
689
|
+
"timeline",
|
|
690
|
+
"react",
|
|
691
|
+
"motion-dna",
|
|
692
|
+
"3d",
|
|
693
|
+
"ai-quality",
|
|
694
|
+
"design-to-motion"
|
|
695
|
+
];
|
|
696
|
+
async function j(e, t = {}) {
|
|
697
|
+
let n = c.resolve(t.cwd ?? process.cwd());
|
|
698
|
+
if (!e || !A.includes(e)) return console.log(m.banner("AF Motion Example Generator")), console.log(""), e && (console.log(m.fail(`Unknown example type: '${e}'`)), console.log("")), console.log(m.bold("Available Example Types:")), console.log(` ${m.cyan("basic")} - Core WAAPI animation with hardware-accelerated transforms`), console.log(` ${m.cyan("reveal-stagger")} - Scroll reveal and staggered item animations`), console.log(` ${m.cyan("spring")} - Damped physical spring simulation (animateSpring)`), console.log(` ${m.cyan("timeline")} - Coordinated multi-track timeline choreography`), console.log(` ${m.cyan("react")} - React 18/19 components with useAnimate & useMicrointeraction`), console.log(` ${m.cyan("motion-dna")} - Resolving and applying Motion DNA kinetic curves`), console.log(` ${m.cyan("3d")} - 3D SceneEngine with geometry, lighting & materials`), console.log(` ${m.cyan("ai-quality")} - Offline motion quality evaluation and recommendations`), console.log(` ${m.cyan("design-to-motion")} - Deterministic Design-to-Motion specification generation`), console.log(""), console.log(`Usage: ${m.cyan("af-motion example <type> [--lang ts|js] [--out <path>]")}`), !1;
|
|
699
|
+
let r = e, i = t.lang ?? "ts";
|
|
700
|
+
if (i !== "ts" && i !== "js") return console.error(m.fail(`Invalid --lang '${String(i)}'. Expected 'ts' or 'js'.`)), !1;
|
|
701
|
+
let a = f(r, i);
|
|
702
|
+
if (t.print) return console.log(a.content), !0;
|
|
703
|
+
let o = t.out ?? a.filename, l = h(n, o, "example output path");
|
|
704
|
+
if (s.existsSync(l) && !t.force) return console.error(m.fail(`Target file '${o}' already exists. Use --force to overwrite.`)), !1;
|
|
705
|
+
try {
|
|
706
|
+
let e = c.dirname(l);
|
|
707
|
+
return s.existsSync(e) || s.mkdirSync(e, { recursive: !0 }), s.writeFileSync(l, a.content, "utf8"), console.log(m.pass(`Generated [${r}] example: ${m.bold(c.relative(n, l) || o)}`)), console.log(`Language: ${i.toUpperCase()}`), !0;
|
|
708
|
+
} catch (e) {
|
|
709
|
+
return console.error(m.fail(`Failed to write example: ${e.message}`)), !1;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
// src/cli/index.ts
|
|
713
|
+
var M = "1.0.0";
|
|
714
|
+
function N() {
|
|
715
|
+
console.log(m.banner("AF Motion CLI (Auto Flow Motion)", `v${M}`)), console.log(""), console.log(m.bold("Usage:")), console.log(" af-motion <command> [arguments] [options]"), console.log(""), console.log(m.bold("Commands:")), console.log(` ${m.cyan("init")} [name] Initialize a new AF Motion project`), console.log(` ${m.cyan("doctor")} Diagnose environment, peer dependencies, and configuration`), console.log(` ${m.cyan("validate")} [file] Validate an AF Motion configuration or composition file`), console.log(` ${m.cyan("presets")} [action] [name] Discover, inspect, and export animation presets`), console.log(` ${m.cyan("info")} Inspect installed AF Motion capabilities and registries`), console.log(` ${m.cyan("example")} <type> Generate starter example files`), console.log(""), console.log(m.bold("Global Options:")), console.log(" -h, --help Display help information for a command"), console.log(" -v, --version Display installed AF Motion version"), console.log(" --json Format output as structured JSON"), console.log(" --no-color Suppress ANSI color escape codes"), console.log(" --quiet Suppress standard output messages"), console.log(""), console.log(m.bold("Examples:")), console.log(" af-motion init my-app --template react-ts"), console.log(" af-motion doctor"), console.log(" af-motion validate af-motion.config.json"), console.log(" af-motion presets --category entrance"), console.log(" af-motion presets inspect fade-in-up"), console.log(" af-motion example spring --lang ts");
|
|
716
|
+
}
|
|
717
|
+
function P(e) {
|
|
718
|
+
let t = [], n = {}, r = /* @__PURE__ */ new Set([
|
|
719
|
+
"__proto__",
|
|
720
|
+
"constructor",
|
|
721
|
+
"prototype"
|
|
722
|
+
]), i = 0;
|
|
723
|
+
for (; i < e.length;) {
|
|
724
|
+
let a = e[i];
|
|
725
|
+
if (a === "--help" || a === "-h") n.help = !0;
|
|
726
|
+
else if (a === "--version" || a === "-v") n.version = !0;
|
|
727
|
+
else if (a === "--json") n.json = !0;
|
|
728
|
+
else if (a === "--no-color") n.color = !1;
|
|
729
|
+
else if (a === "--quiet") n.quiet = !0;
|
|
730
|
+
else if (a === "--force") n.force = !0;
|
|
731
|
+
else if (a === "--print") n.print = !0;
|
|
732
|
+
else if (a === "--no-config") n.noConfig = !0;
|
|
733
|
+
else if (a.startsWith("--")) {
|
|
734
|
+
let t = a.slice(2);
|
|
735
|
+
if (!t || r.has(t)) throw Error(`Invalid or forbidden CLI flag: '${a}'`);
|
|
736
|
+
let o = e[i + 1];
|
|
737
|
+
o && !o.startsWith("-") ? (n[t] = o, i++) : n[t] = !0;
|
|
738
|
+
} else t.push(a);
|
|
739
|
+
i++;
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
command: t[0]?.toLowerCase(),
|
|
743
|
+
positional: t.slice(1),
|
|
744
|
+
options: n
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
async function F(e = process.argv.slice(2)) {
|
|
748
|
+
let t;
|
|
749
|
+
try {
|
|
750
|
+
t = P(e);
|
|
751
|
+
} catch (e) {
|
|
752
|
+
return console.error(m.fail(`Invalid CLI arguments: ${e.message}`)), 2;
|
|
753
|
+
}
|
|
754
|
+
let { command: n, positional: r, options: i } = t;
|
|
755
|
+
if (i.color === !1 && m.setColorEnabled(!1), i.version) return console.log(i.json ? JSON.stringify({ version: M }) : `af-motion v${M}`), 0;
|
|
756
|
+
if (!n || n === "help" || i.help && !n) return N(), 0;
|
|
757
|
+
try {
|
|
758
|
+
switch (n) {
|
|
759
|
+
case "init": return i.help ? (console.log(m.banner("af-motion init", "Initialize an AF Motion configuration and starter animation")), console.log(""), console.log("Usage: af-motion init [name] [options]"), console.log(""), console.log("Options:"), console.log(" --template <type> Starter template: vanilla-js, vanilla-ts, react-ts (default: auto-detected)"), console.log(" --force Overwrite existing files if they exist"), console.log(" --no-config Do not generate af-motion.config.json"), console.log(" --json Output initialization results as JSON"), 0) : +!(await v({
|
|
760
|
+
name: r[0] || i.name,
|
|
761
|
+
template: i.template,
|
|
762
|
+
force: i.force,
|
|
763
|
+
noConfig: i.noConfig,
|
|
764
|
+
json: i.json,
|
|
765
|
+
quiet: i.quiet,
|
|
766
|
+
cwd: i.cwd
|
|
767
|
+
})).success;
|
|
768
|
+
case "doctor": return i.help ? (console.log(m.banner("af-motion doctor", "Diagnose environment, peer dependencies, and configuration")), console.log(""), console.log("Usage: af-motion doctor [options]"), console.log(""), console.log("Options:"), console.log(" --json Output diagnostic report as structured JSON"), 0) : +((await b({
|
|
769
|
+
json: i.json,
|
|
770
|
+
quiet: i.quiet,
|
|
771
|
+
cwd: i.cwd
|
|
772
|
+
})).overallStatus === "fail");
|
|
773
|
+
case "validate": {
|
|
774
|
+
if (i.help) return console.log(m.banner("af-motion validate", "Validate configuration and composition schemas")), console.log(""), console.log("Usage: af-motion validate [file] [options]"), console.log(""), console.log("Options:"), console.log(" --json Output validation report as structured JSON"), 0;
|
|
775
|
+
let e = r[0];
|
|
776
|
+
return +!(await w(e, {
|
|
777
|
+
json: i.json,
|
|
778
|
+
quiet: i.quiet,
|
|
779
|
+
cwd: i.cwd
|
|
780
|
+
})).valid;
|
|
781
|
+
}
|
|
782
|
+
case "presets": {
|
|
783
|
+
if (i.help) return console.log(m.banner("af-motion presets", "Explore, inspect, and export verified animation presets")), console.log(""), console.log("Usage:"), console.log(" af-motion presets [list] [--category <cat>] [--search <query>]"), console.log(" af-motion presets inspect <name> [--json]"), console.log(" af-motion presets export <name> [--format json|ts] [--out <path>]"), 0;
|
|
784
|
+
let e = r[0];
|
|
785
|
+
if (e === "inspect") {
|
|
786
|
+
let e = r[1];
|
|
787
|
+
return e ? +!await E(e, { json: i.json }) : (console.error(m.fail("Preset name required for inspect: af-motion presets inspect <name>")), 2);
|
|
788
|
+
}
|
|
789
|
+
if (e === "export") {
|
|
790
|
+
let e = r[1];
|
|
791
|
+
return e ? +!await D(e, {
|
|
792
|
+
format: i.format,
|
|
793
|
+
out: i.out,
|
|
794
|
+
force: i.force,
|
|
795
|
+
cwd: i.cwd
|
|
796
|
+
}) : (console.error(m.fail("Preset name required for export: af-motion presets export <name>")), 2);
|
|
797
|
+
}
|
|
798
|
+
return await T({
|
|
799
|
+
category: i.category,
|
|
800
|
+
search: i.search,
|
|
801
|
+
json: i.json
|
|
802
|
+
}), 0;
|
|
803
|
+
}
|
|
804
|
+
case "info": return i.help ? (console.log(m.banner("af-motion info", "Inspect AF Motion system capabilities and registries")), console.log(""), console.log("Usage: af-motion info [options]"), console.log(""), console.log("Options:"), console.log(" --json Output capability matrix as structured JSON"), 0) : (await k({
|
|
805
|
+
json: i.json,
|
|
806
|
+
quiet: i.quiet
|
|
807
|
+
}), 0);
|
|
808
|
+
case "example": {
|
|
809
|
+
if (i.help) return console.log(m.banner("af-motion example", "Generate compilable starter animation examples")), console.log(""), console.log("Usage: af-motion example <type> [options]"), console.log(""), console.log("Types: basic, reveal-stagger, spring, timeline, react, motion-dna, 3d, ai-quality, design-to-motion"), console.log(""), console.log("Options:"), console.log(" --lang <ts|js> Output programming language (default: ts)"), console.log(" --out <path> Custom destination filename"), console.log(" --print Print example to stdout instead of writing to disk"), console.log(" --force Overwrite existing file"), 0;
|
|
810
|
+
let e = r[0];
|
|
811
|
+
return await j(e, {
|
|
812
|
+
lang: i.lang,
|
|
813
|
+
out: i.out,
|
|
814
|
+
force: i.force,
|
|
815
|
+
print: i.print,
|
|
816
|
+
cwd: i.cwd
|
|
817
|
+
}) ? 0 : +!!e;
|
|
818
|
+
}
|
|
819
|
+
default: return console.error(m.fail(`Unknown command: '${n}'`)), console.log(`Run ${m.cyan("af-motion --help")} to see all available commands.`), 2;
|
|
820
|
+
}
|
|
821
|
+
} catch (e) {
|
|
822
|
+
return console.error(m.fail(`CLI execution error: ${e.message}`)), 1;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
export { u as STARTER_CONFIG_JSON, p as Terminal, A as VALID_EXAMPLE_TYPES, _ as detectTemplate, b as executeDoctor, j as executeExample, k as executeInfo, v as executeInit, D as executePresetExport, E as executePresetInspect, T as executePresetsList, w as executeValidate, O as getCapabilityInfo, f as getExampleContent, d as getStarterTemplate, P as parseArgs, N as printHelp, F as runCLI, y as runDoctorChecks, m as term, C as validateConfigFile };
|