cuetra 0.1.3 → 0.1.4
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/cli/README.md +81 -0
- package/cli/bin/cuetra.js +140 -0
- package/cli/lib/commands.js +215 -0
- package/cli/lib/licence.js +485 -0
- package/cli/lib/pack.js +162 -0
- package/cli/lib/physics.js +191 -0
- package/cli/package.json +13 -0
- package/mcp-server/README.md +78 -0
- package/mcp-server/bin/cuetra-mcp.js +130 -0
- package/mcp-server/lib/licence.js +485 -0
- package/mcp-server/lib/pack.js +132 -0
- package/mcp-server/lib/tools.js +245 -0
- package/mcp-server/pack/activity.svg +1 -0
- package/mcp-server/pack/airplay.svg +1 -0
- package/mcp-server/pack/anchor.svg +1 -0
- package/mcp-server/pack/aperture.svg +1 -0
- package/mcp-server/pack/arrow-right.svg +1 -0
- package/mcp-server/pack/arrow-up.svg +1 -0
- package/mcp-server/pack/award.svg +1 -0
- package/mcp-server/pack/badge-check.svg +1 -0
- package/mcp-server/pack/battery.svg +1 -0
- package/mcp-server/pack/bell-ring.svg +1 -0
- package/mcp-server/pack/bell.svg +1 -0
- package/mcp-server/pack/bike.svg +1 -0
- package/mcp-server/pack/blocks.svg +1 -0
- package/mcp-server/pack/bluetooth.svg +1 -0
- package/mcp-server/pack/book-open.svg +1 -0
- package/mcp-server/pack/book.svg +1 -0
- package/mcp-server/pack/bookmark.svg +1 -0
- package/mcp-server/pack/box.svg +1 -0
- package/mcp-server/pack/brain.svg +1 -0
- package/mcp-server/pack/briefcase.svg +1 -0
- package/mcp-server/pack/bug.svg +1 -0
- package/mcp-server/pack/bus.svg +1 -0
- package/mcp-server/pack/calculator.svg +1 -0
- package/mcp-server/pack/calendar.svg +1 -0
- package/mcp-server/pack/camera.svg +1 -0
- package/mcp-server/pack/car.svg +1 -0
- package/mcp-server/pack/check.svg +1 -0
- package/mcp-server/pack/chevron-down.svg +1 -0
- package/mcp-server/pack/circle-alert.svg +1 -0
- package/mcp-server/pack/circle-check.svg +1 -0
- package/mcp-server/pack/clipboard.svg +1 -0
- package/mcp-server/pack/clock.svg +1 -0
- package/mcp-server/pack/cloud.svg +1 -0
- package/mcp-server/pack/code.svg +1 -0
- package/mcp-server/pack/coffee.svg +1 -0
- package/mcp-server/pack/command.svg +1 -0
- package/mcp-server/pack/compass.svg +1 -0
- package/mcp-server/pack/cookie.svg +1 -0
- package/mcp-server/pack/copy.svg +1 -0
- package/mcp-server/pack/cpu.svg +1 -0
- package/mcp-server/pack/credit-card.svg +1 -0
- package/mcp-server/pack/crown.svg +1 -0
- package/mcp-server/pack/database.svg +1 -0
- package/mcp-server/pack/diamond.svg +1 -0
- package/mcp-server/pack/download.svg +1 -0
- package/mcp-server/pack/external-link.svg +1 -0
- package/mcp-server/pack/eye.svg +1 -0
- package/mcp-server/pack/file.svg +1 -0
- package/mcp-server/pack/flag.svg +1 -0
- package/mcp-server/pack/flame.svg +1 -0
- package/mcp-server/pack/folder.svg +1 -0
- package/mcp-server/pack/free-list.json +113 -0
- package/mcp-server/pack/gift.svg +1 -0
- package/mcp-server/pack/globe.svg +1 -0
- package/mcp-server/pack/headphones.svg +1 -0
- package/mcp-server/pack/heart.svg +1 -0
- package/mcp-server/pack/image.svg +1 -0
- package/mcp-server/pack/key.svg +1 -0
- package/mcp-server/pack/layers.svg +1 -0
- package/mcp-server/pack/link.svg +1 -0
- package/mcp-server/pack/list.svg +1 -0
- package/mcp-server/pack/lock-open.svg +1 -0
- package/mcp-server/pack/lock.svg +1 -0
- package/mcp-server/pack/mail.svg +1 -0
- package/mcp-server/pack/menu.svg +1 -0
- package/mcp-server/pack/message-square.svg +1 -0
- package/mcp-server/pack/mic.svg +1 -0
- package/mcp-server/pack/minus.svg +1 -0
- package/mcp-server/pack/monitor.svg +1 -0
- package/mcp-server/pack/moon.svg +1 -0
- package/mcp-server/pack/motion.json +1 -0
- package/mcp-server/pack/navigation.svg +1 -0
- package/mcp-server/pack/pause.svg +1 -0
- package/mcp-server/pack/pen.svg +1 -0
- package/mcp-server/pack/phone.svg +1 -0
- package/mcp-server/pack/play.svg +1 -0
- package/mcp-server/pack/plus.svg +1 -0
- package/mcp-server/pack/power.svg +1 -0
- package/mcp-server/pack/printer.svg +1 -0
- package/mcp-server/pack/refresh-cw.svg +1 -0
- package/mcp-server/pack/rocket.svg +1 -0
- package/mcp-server/pack/search.svg +1 -0
- package/mcp-server/pack/send.svg +1 -0
- package/mcp-server/pack/settings.svg +1 -0
- package/mcp-server/pack/shield-check.svg +1 -0
- package/mcp-server/pack/shopping-cart.svg +1 -0
- package/mcp-server/pack/smartphone.svg +1 -0
- package/mcp-server/pack/star.svg +1 -0
- package/mcp-server/pack/sun.svg +1 -0
- package/mcp-server/pack/tag.svg +1 -0
- package/mcp-server/pack/terminal.svg +1 -0
- package/mcp-server/pack/thumbs-up.svg +1 -0
- package/mcp-server/pack/trash.svg +1 -0
- package/mcp-server/pack/trending-up.svg +1 -0
- package/mcp-server/pack/umbrella.svg +1 -0
- package/mcp-server/pack/upload.svg +1 -0
- package/mcp-server/pack/user.svg +1 -0
- package/mcp-server/pack/users.svg +1 -0
- package/mcp-server/pack/volume.svg +1 -0
- package/mcp-server/pack/watch.svg +1 -0
- package/mcp-server/pack/x.svg +1 -0
- package/mcp-server/pack/zap.svg +1 -0
- package/mcp-server/package.json +13 -0
- package/pack/activity.svg +1 -0
- package/pack/airplay.svg +1 -0
- package/pack/anchor.svg +1 -0
- package/pack/aperture.svg +1 -0
- package/pack/arrow-right.svg +1 -0
- package/pack/arrow-up.svg +1 -0
- package/pack/award.svg +1 -0
- package/pack/badge-check.svg +1 -0
- package/pack/battery.svg +1 -0
- package/pack/bell-ring.svg +1 -0
- package/pack/bell.svg +1 -0
- package/pack/bike.svg +1 -0
- package/pack/blocks.svg +1 -0
- package/pack/bluetooth.svg +1 -0
- package/pack/book-open.svg +1 -0
- package/pack/book.svg +1 -0
- package/pack/bookmark.svg +1 -0
- package/pack/box.svg +1 -0
- package/pack/brain.svg +1 -0
- package/pack/briefcase.svg +1 -0
- package/pack/bug.svg +1 -0
- package/pack/bus.svg +1 -0
- package/pack/calculator.svg +1 -0
- package/pack/calendar.svg +1 -0
- package/pack/camera.svg +1 -0
- package/pack/car.svg +1 -0
- package/pack/check.svg +1 -0
- package/pack/chevron-down.svg +1 -0
- package/pack/circle-alert.svg +1 -0
- package/pack/circle-check.svg +1 -0
- package/pack/clipboard.svg +1 -0
- package/pack/clock.svg +1 -0
- package/pack/cloud.svg +1 -0
- package/pack/code.svg +1 -0
- package/pack/coffee.svg +1 -0
- package/pack/command.svg +1 -0
- package/pack/compass.svg +1 -0
- package/pack/cookie.svg +1 -0
- package/pack/copy.svg +1 -0
- package/pack/cpu.svg +1 -0
- package/pack/credit-card.svg +1 -0
- package/pack/crown.svg +1 -0
- package/pack/database.svg +1 -0
- package/pack/diamond.svg +1 -0
- package/pack/download.svg +1 -0
- package/pack/duotone/activity.svg +1 -0
- package/pack/duotone/airplay.svg +1 -0
- package/pack/duotone/anchor.svg +1 -0
- package/pack/duotone/aperture.svg +1 -0
- package/pack/duotone/arrow-right.svg +1 -0
- package/pack/duotone/arrow-up.svg +1 -0
- package/pack/duotone/award.svg +1 -0
- package/pack/duotone/badge-check.svg +1 -0
- package/pack/duotone/battery.svg +1 -0
- package/pack/duotone/bell-ring.svg +1 -0
- package/pack/duotone/bell.svg +1 -0
- package/pack/duotone/bike.svg +1 -0
- package/pack/duotone/blocks.svg +1 -0
- package/pack/duotone/bluetooth.svg +1 -0
- package/pack/duotone/book-open.svg +1 -0
- package/pack/duotone/book.svg +1 -0
- package/pack/duotone/bookmark.svg +1 -0
- package/pack/duotone/box.svg +1 -0
- package/pack/duotone/brain.svg +1 -0
- package/pack/duotone/briefcase.svg +1 -0
- package/pack/duotone/bug.svg +1 -0
- package/pack/duotone/bus.svg +1 -0
- package/pack/duotone/calculator.svg +1 -0
- package/pack/duotone/calendar.svg +1 -0
- package/pack/duotone/camera.svg +1 -0
- package/pack/duotone/car.svg +1 -0
- package/pack/duotone/check.svg +1 -0
- package/pack/duotone/chevron-down.svg +1 -0
- package/pack/duotone/circle-alert.svg +1 -0
- package/pack/duotone/circle-check.svg +1 -0
- package/pack/duotone/clipboard.svg +1 -0
- package/pack/duotone/clock.svg +1 -0
- package/pack/duotone/cloud.svg +1 -0
- package/pack/duotone/code.svg +1 -0
- package/pack/duotone/coffee.svg +1 -0
- package/pack/duotone/command.svg +1 -0
- package/pack/duotone/compass.svg +1 -0
- package/pack/duotone/cookie.svg +1 -0
- package/pack/duotone/copy.svg +1 -0
- package/pack/duotone/cpu.svg +1 -0
- package/pack/duotone/credit-card.svg +1 -0
- package/pack/duotone/crown.svg +1 -0
- package/pack/duotone/database.svg +1 -0
- package/pack/duotone/diamond.svg +1 -0
- package/pack/duotone/download.svg +1 -0
- package/pack/duotone/external-link.svg +1 -0
- package/pack/duotone/eye.svg +1 -0
- package/pack/duotone/file.svg +1 -0
- package/pack/duotone/flag.svg +1 -0
- package/pack/duotone/flame.svg +1 -0
- package/pack/duotone/folder.svg +1 -0
- package/pack/duotone/gift.svg +1 -0
- package/pack/duotone/globe.svg +1 -0
- package/pack/duotone/headphones.svg +1 -0
- package/pack/duotone/heart.svg +1 -0
- package/pack/duotone/image.svg +1 -0
- package/pack/duotone/key.svg +1 -0
- package/pack/duotone/layers.svg +1 -0
- package/pack/duotone/link.svg +1 -0
- package/pack/duotone/list.svg +1 -0
- package/pack/duotone/lock-open.svg +1 -0
- package/pack/duotone/lock.svg +1 -0
- package/pack/duotone/mail.svg +1 -0
- package/pack/duotone/menu.svg +1 -0
- package/pack/duotone/message-square.svg +1 -0
- package/pack/duotone/mic.svg +1 -0
- package/pack/duotone/minus.svg +1 -0
- package/pack/duotone/monitor.svg +1 -0
- package/pack/duotone/moon.svg +1 -0
- package/pack/duotone/navigation.svg +1 -0
- package/pack/duotone/pause.svg +1 -0
- package/pack/duotone/pen.svg +1 -0
- package/pack/duotone/phone.svg +1 -0
- package/pack/duotone/play.svg +1 -0
- package/pack/duotone/plus.svg +1 -0
- package/pack/duotone/power.svg +1 -0
- package/pack/duotone/printer.svg +1 -0
- package/pack/duotone/refresh-cw.svg +1 -0
- package/pack/duotone/rocket.svg +1 -0
- package/pack/duotone/search.svg +1 -0
- package/pack/duotone/send.svg +1 -0
- package/pack/duotone/settings.svg +1 -0
- package/pack/duotone/shield-check.svg +1 -0
- package/pack/duotone/shopping-cart.svg +1 -0
- package/pack/duotone/smartphone.svg +1 -0
- package/pack/duotone/star.svg +1 -0
- package/pack/duotone/sun.svg +1 -0
- package/pack/duotone/tag.svg +1 -0
- package/pack/duotone/terminal.svg +1 -0
- package/pack/duotone/thumbs-up.svg +1 -0
- package/pack/duotone/trash.svg +1 -0
- package/pack/duotone/trending-up.svg +1 -0
- package/pack/duotone/umbrella.svg +1 -0
- package/pack/duotone/upload.svg +1 -0
- package/pack/duotone/user.svg +1 -0
- package/pack/duotone/users.svg +1 -0
- package/pack/duotone/volume.svg +1 -0
- package/pack/duotone/watch.svg +1 -0
- package/pack/duotone/x.svg +1 -0
- package/pack/duotone/zap.svg +1 -0
- package/pack/external-link.svg +1 -0
- package/pack/eye.svg +1 -0
- package/pack/file.svg +1 -0
- package/pack/flag.svg +1 -0
- package/pack/flame.svg +1 -0
- package/pack/folder.svg +1 -0
- package/pack/free-list.json +113 -0
- package/pack/gift.svg +1 -0
- package/pack/glass/activity.svg +1 -0
- package/pack/glass/airplay.svg +1 -0
- package/pack/glass/anchor.svg +1 -0
- package/pack/glass/aperture.svg +1 -0
- package/pack/glass/arrow-right.svg +1 -0
- package/pack/glass/arrow-up.svg +1 -0
- package/pack/glass/award.svg +1 -0
- package/pack/glass/badge-check.svg +1 -0
- package/pack/glass/battery.svg +1 -0
- package/pack/glass/bell-ring.svg +1 -0
- package/pack/glass/bell.svg +1 -0
- package/pack/glass/bike.svg +1 -0
- package/pack/glass/blocks.svg +1 -0
- package/pack/glass/bluetooth.svg +1 -0
- package/pack/glass/book-open.svg +1 -0
- package/pack/glass/book.svg +1 -0
- package/pack/glass/bookmark.svg +1 -0
- package/pack/glass/box.svg +1 -0
- package/pack/glass/brain.svg +1 -0
- package/pack/glass/briefcase.svg +1 -0
- package/pack/glass/bug.svg +1 -0
- package/pack/glass/bus.svg +1 -0
- package/pack/glass/calculator.svg +1 -0
- package/pack/glass/calendar.svg +1 -0
- package/pack/glass/camera.svg +1 -0
- package/pack/glass/car.svg +1 -0
- package/pack/glass/check.svg +1 -0
- package/pack/glass/chevron-down.svg +1 -0
- package/pack/glass/circle-alert.svg +1 -0
- package/pack/glass/circle-check.svg +1 -0
- package/pack/glass/clipboard.svg +1 -0
- package/pack/glass/clock.svg +1 -0
- package/pack/glass/cloud.svg +1 -0
- package/pack/glass/code.svg +1 -0
- package/pack/glass/coffee.svg +1 -0
- package/pack/glass/command.svg +1 -0
- package/pack/glass/compass.svg +1 -0
- package/pack/glass/cookie.svg +1 -0
- package/pack/glass/copy.svg +1 -0
- package/pack/glass/cpu.svg +1 -0
- package/pack/glass/credit-card.svg +1 -0
- package/pack/glass/crown.svg +1 -0
- package/pack/glass/database.svg +1 -0
- package/pack/glass/diamond.svg +1 -0
- package/pack/glass/download.svg +1 -0
- package/pack/glass/external-link.svg +1 -0
- package/pack/glass/eye.svg +1 -0
- package/pack/glass/file.svg +1 -0
- package/pack/glass/flag.svg +1 -0
- package/pack/glass/flame.svg +1 -0
- package/pack/glass/folder.svg +1 -0
- package/pack/glass/gift.svg +1 -0
- package/pack/glass/globe.svg +1 -0
- package/pack/glass/headphones.svg +1 -0
- package/pack/glass/heart.svg +1 -0
- package/pack/glass/image.svg +1 -0
- package/pack/glass/key.svg +1 -0
- package/pack/glass/layers.svg +1 -0
- package/pack/glass/link.svg +1 -0
- package/pack/glass/list.svg +1 -0
- package/pack/glass/lock-open.svg +1 -0
- package/pack/glass/lock.svg +1 -0
- package/pack/glass/mail.svg +1 -0
- package/pack/glass/menu.svg +1 -0
- package/pack/glass/message-square.svg +1 -0
- package/pack/glass/mic.svg +1 -0
- package/pack/glass/minus.svg +1 -0
- package/pack/glass/monitor.svg +1 -0
- package/pack/glass/moon.svg +1 -0
- package/pack/glass/navigation.svg +1 -0
- package/pack/glass/pause.svg +1 -0
- package/pack/glass/pen.svg +1 -0
- package/pack/glass/phone.svg +1 -0
- package/pack/glass/play.svg +1 -0
- package/pack/glass/plus.svg +1 -0
- package/pack/glass/power.svg +1 -0
- package/pack/glass/printer.svg +1 -0
- package/pack/glass/refresh-cw.svg +1 -0
- package/pack/glass/rocket.svg +1 -0
- package/pack/glass/search.svg +1 -0
- package/pack/glass/send.svg +1 -0
- package/pack/glass/settings.svg +1 -0
- package/pack/glass/shield-check.svg +1 -0
- package/pack/glass/shopping-cart.svg +1 -0
- package/pack/glass/smartphone.svg +1 -0
- package/pack/glass/star.svg +1 -0
- package/pack/glass/sun.svg +1 -0
- package/pack/glass/tag.svg +1 -0
- package/pack/glass/terminal.svg +1 -0
- package/pack/glass/thumbs-up.svg +1 -0
- package/pack/glass/trash.svg +1 -0
- package/pack/glass/trending-up.svg +1 -0
- package/pack/glass/umbrella.svg +1 -0
- package/pack/glass/upload.svg +1 -0
- package/pack/glass/user.svg +1 -0
- package/pack/glass/users.svg +1 -0
- package/pack/glass/volume.svg +1 -0
- package/pack/glass/watch.svg +1 -0
- package/pack/glass/x.svg +1 -0
- package/pack/glass/zap.svg +1 -0
- package/pack/globe.svg +1 -0
- package/pack/headphones.svg +1 -0
- package/pack/heart.svg +1 -0
- package/pack/image.svg +1 -0
- package/pack/key.svg +1 -0
- package/pack/layers.svg +1 -0
- package/pack/link.svg +1 -0
- package/pack/list.svg +1 -0
- package/pack/lock-open.svg +1 -0
- package/pack/lock.svg +1 -0
- package/pack/mail.svg +1 -0
- package/pack/menu.svg +1 -0
- package/pack/message-square.svg +1 -0
- package/pack/mic.svg +1 -0
- package/pack/minus.svg +1 -0
- package/pack/monitor.svg +1 -0
- package/pack/moon.svg +1 -0
- package/pack/motion.json +1 -0
- package/pack/navigation.svg +1 -0
- package/pack/outline/activity.svg +1 -0
- package/pack/outline/airplay.svg +1 -0
- package/pack/outline/anchor.svg +1 -0
- package/pack/outline/aperture.svg +1 -0
- package/pack/outline/arrow-right.svg +1 -0
- package/pack/outline/arrow-up.svg +1 -0
- package/pack/outline/award.svg +1 -0
- package/pack/outline/badge-check.svg +1 -0
- package/pack/outline/battery.svg +1 -0
- package/pack/outline/bell-ring.svg +1 -0
- package/pack/outline/bell.svg +1 -0
- package/pack/outline/bike.svg +1 -0
- package/pack/outline/blocks.svg +1 -0
- package/pack/outline/bluetooth.svg +1 -0
- package/pack/outline/book-open.svg +1 -0
- package/pack/outline/book.svg +1 -0
- package/pack/outline/bookmark.svg +1 -0
- package/pack/outline/box.svg +1 -0
- package/pack/outline/brain.svg +1 -0
- package/pack/outline/briefcase.svg +1 -0
- package/pack/outline/bug.svg +1 -0
- package/pack/outline/bus.svg +1 -0
- package/pack/outline/calculator.svg +1 -0
- package/pack/outline/calendar.svg +1 -0
- package/pack/outline/camera.svg +1 -0
- package/pack/outline/car.svg +1 -0
- package/pack/outline/check.svg +1 -0
- package/pack/outline/chevron-down.svg +1 -0
- package/pack/outline/circle-alert.svg +1 -0
- package/pack/outline/circle-check.svg +1 -0
- package/pack/outline/clipboard.svg +1 -0
- package/pack/outline/clock.svg +1 -0
- package/pack/outline/cloud.svg +1 -0
- package/pack/outline/code.svg +1 -0
- package/pack/outline/coffee.svg +1 -0
- package/pack/outline/command.svg +1 -0
- package/pack/outline/compass.svg +1 -0
- package/pack/outline/cookie.svg +1 -0
- package/pack/outline/copy.svg +1 -0
- package/pack/outline/cpu.svg +1 -0
- package/pack/outline/credit-card.svg +1 -0
- package/pack/outline/crown.svg +1 -0
- package/pack/outline/database.svg +1 -0
- package/pack/outline/diamond.svg +1 -0
- package/pack/outline/download.svg +1 -0
- package/pack/outline/external-link.svg +1 -0
- package/pack/outline/eye.svg +1 -0
- package/pack/outline/file.svg +1 -0
- package/pack/outline/flag.svg +1 -0
- package/pack/outline/flame.svg +1 -0
- package/pack/outline/folder.svg +1 -0
- package/pack/outline/gift.svg +1 -0
- package/pack/outline/globe.svg +1 -0
- package/pack/outline/headphones.svg +1 -0
- package/pack/outline/heart.svg +1 -0
- package/pack/outline/image.svg +1 -0
- package/pack/outline/key.svg +1 -0
- package/pack/outline/layers.svg +1 -0
- package/pack/outline/link.svg +1 -0
- package/pack/outline/list.svg +1 -0
- package/pack/outline/lock-open.svg +1 -0
- package/pack/outline/lock.svg +1 -0
- package/pack/outline/mail.svg +1 -0
- package/pack/outline/menu.svg +1 -0
- package/pack/outline/message-square.svg +1 -0
- package/pack/outline/mic.svg +1 -0
- package/pack/outline/minus.svg +1 -0
- package/pack/outline/monitor.svg +1 -0
- package/pack/outline/moon.svg +1 -0
- package/pack/outline/navigation.svg +1 -0
- package/pack/outline/pause.svg +1 -0
- package/pack/outline/pen.svg +1 -0
- package/pack/outline/phone.svg +1 -0
- package/pack/outline/play.svg +1 -0
- package/pack/outline/plus.svg +1 -0
- package/pack/outline/power.svg +1 -0
- package/pack/outline/printer.svg +1 -0
- package/pack/outline/refresh-cw.svg +1 -0
- package/pack/outline/rocket.svg +1 -0
- package/pack/outline/search.svg +1 -0
- package/pack/outline/send.svg +1 -0
- package/pack/outline/settings.svg +1 -0
- package/pack/outline/shield-check.svg +1 -0
- package/pack/outline/shopping-cart.svg +1 -0
- package/pack/outline/smartphone.svg +1 -0
- package/pack/outline/star.svg +1 -0
- package/pack/outline/sun.svg +1 -0
- package/pack/outline/tag.svg +1 -0
- package/pack/outline/terminal.svg +1 -0
- package/pack/outline/thumbs-up.svg +1 -0
- package/pack/outline/trash.svg +1 -0
- package/pack/outline/trending-up.svg +1 -0
- package/pack/outline/umbrella.svg +1 -0
- package/pack/outline/upload.svg +1 -0
- package/pack/outline/user.svg +1 -0
- package/pack/outline/users.svg +1 -0
- package/pack/outline/volume.svg +1 -0
- package/pack/outline/watch.svg +1 -0
- package/pack/outline/x.svg +1 -0
- package/pack/outline/zap.svg +1 -0
- package/pack/pause.svg +1 -0
- package/pack/pen.svg +1 -0
- package/pack/phone.svg +1 -0
- package/pack/play.svg +1 -0
- package/pack/plus.svg +1 -0
- package/pack/power.svg +1 -0
- package/pack/printer.svg +1 -0
- package/pack/refresh-cw.svg +1 -0
- package/pack/rocket.svg +1 -0
- package/pack/search.svg +1 -0
- package/pack/send.svg +1 -0
- package/pack/settings.svg +1 -0
- package/pack/shield-check.svg +1 -0
- package/pack/shopping-cart.svg +1 -0
- package/pack/smartphone.svg +1 -0
- package/pack/solid/activity.svg +1 -0
- package/pack/solid/airplay.svg +1 -0
- package/pack/solid/anchor.svg +1 -0
- package/pack/solid/aperture.svg +1 -0
- package/pack/solid/arrow-right.svg +1 -0
- package/pack/solid/arrow-up.svg +1 -0
- package/pack/solid/award.svg +1 -0
- package/pack/solid/badge-check.svg +1 -0
- package/pack/solid/battery.svg +1 -0
- package/pack/solid/bell-ring.svg +1 -0
- package/pack/solid/bell.svg +1 -0
- package/pack/solid/bike.svg +1 -0
- package/pack/solid/blocks.svg +1 -0
- package/pack/solid/bluetooth.svg +1 -0
- package/pack/solid/book-open.svg +1 -0
- package/pack/solid/book.svg +1 -0
- package/pack/solid/bookmark.svg +1 -0
- package/pack/solid/box.svg +1 -0
- package/pack/solid/brain.svg +1 -0
- package/pack/solid/briefcase.svg +1 -0
- package/pack/solid/bug.svg +1 -0
- package/pack/solid/bus.svg +1 -0
- package/pack/solid/calculator.svg +1 -0
- package/pack/solid/calendar.svg +1 -0
- package/pack/solid/camera.svg +1 -0
- package/pack/solid/car.svg +1 -0
- package/pack/solid/check.svg +1 -0
- package/pack/solid/chevron-down.svg +1 -0
- package/pack/solid/circle-alert.svg +1 -0
- package/pack/solid/circle-check.svg +1 -0
- package/pack/solid/clipboard.svg +1 -0
- package/pack/solid/clock.svg +1 -0
- package/pack/solid/cloud.svg +1 -0
- package/pack/solid/code.svg +1 -0
- package/pack/solid/coffee.svg +1 -0
- package/pack/solid/command.svg +1 -0
- package/pack/solid/compass.svg +1 -0
- package/pack/solid/cookie.svg +1 -0
- package/pack/solid/copy.svg +1 -0
- package/pack/solid/cpu.svg +1 -0
- package/pack/solid/credit-card.svg +1 -0
- package/pack/solid/crown.svg +1 -0
- package/pack/solid/database.svg +1 -0
- package/pack/solid/diamond.svg +1 -0
- package/pack/solid/download.svg +1 -0
- package/pack/solid/external-link.svg +1 -0
- package/pack/solid/eye.svg +1 -0
- package/pack/solid/file.svg +1 -0
- package/pack/solid/flag.svg +1 -0
- package/pack/solid/flame.svg +1 -0
- package/pack/solid/folder.svg +1 -0
- package/pack/solid/gift.svg +1 -0
- package/pack/solid/globe.svg +1 -0
- package/pack/solid/headphones.svg +1 -0
- package/pack/solid/heart.svg +1 -0
- package/pack/solid/image.svg +1 -0
- package/pack/solid/key.svg +1 -0
- package/pack/solid/layers.svg +1 -0
- package/pack/solid/link.svg +1 -0
- package/pack/solid/list.svg +1 -0
- package/pack/solid/lock-open.svg +1 -0
- package/pack/solid/lock.svg +1 -0
- package/pack/solid/mail.svg +1 -0
- package/pack/solid/menu.svg +1 -0
- package/pack/solid/message-square.svg +1 -0
- package/pack/solid/mic.svg +1 -0
- package/pack/solid/minus.svg +1 -0
- package/pack/solid/monitor.svg +1 -0
- package/pack/solid/moon.svg +1 -0
- package/pack/solid/navigation.svg +1 -0
- package/pack/solid/pause.svg +1 -0
- package/pack/solid/pen.svg +1 -0
- package/pack/solid/phone.svg +1 -0
- package/pack/solid/play.svg +1 -0
- package/pack/solid/plus.svg +1 -0
- package/pack/solid/power.svg +1 -0
- package/pack/solid/printer.svg +1 -0
- package/pack/solid/refresh-cw.svg +1 -0
- package/pack/solid/rocket.svg +1 -0
- package/pack/solid/search.svg +1 -0
- package/pack/solid/send.svg +1 -0
- package/pack/solid/settings.svg +1 -0
- package/pack/solid/shield-check.svg +1 -0
- package/pack/solid/shopping-cart.svg +1 -0
- package/pack/solid/smartphone.svg +1 -0
- package/pack/solid/star.svg +1 -0
- package/pack/solid/sun.svg +1 -0
- package/pack/solid/tag.svg +1 -0
- package/pack/solid/terminal.svg +1 -0
- package/pack/solid/thumbs-up.svg +1 -0
- package/pack/solid/trash.svg +1 -0
- package/pack/solid/trending-up.svg +1 -0
- package/pack/solid/umbrella.svg +1 -0
- package/pack/solid/upload.svg +1 -0
- package/pack/solid/user.svg +1 -0
- package/pack/solid/users.svg +1 -0
- package/pack/solid/volume.svg +1 -0
- package/pack/solid/watch.svg +1 -0
- package/pack/solid/x.svg +1 -0
- package/pack/solid/zap.svg +1 -0
- package/pack/star.svg +1 -0
- package/pack/sun.svg +1 -0
- package/pack/tag.svg +1 -0
- package/pack/terminal.svg +1 -0
- package/pack/thumbs-up.svg +1 -0
- package/pack/trash.svg +1 -0
- package/pack/trending-up.svg +1 -0
- package/pack/umbrella.svg +1 -0
- package/pack/upload.svg +1 -0
- package/pack/user.svg +1 -0
- package/pack/users.svg +1 -0
- package/pack/volume.svg +1 -0
- package/pack/watch.svg +1 -0
- package/pack/x.svg +1 -0
- package/pack/zap.svg +1 -0
- package/package.json +26 -18
- package/src/licence.js +98 -0
package/cli/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @cuetra/cli
|
|
2
|
+
|
|
3
|
+
Kinetic icon CLI. Zero npm dependencies; runs on plain Node (>= 20).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
node cli/bin/cuetra.js add bell
|
|
7
|
+
node cli/bin/cuetra.js preview bell
|
|
8
|
+
node cli/bin/cuetra.js audit ./icons/bell.svg
|
|
9
|
+
node cli/bin/cuetra.js add bell --treatment glass --out ./icons
|
|
10
|
+
node cli/bin/cuetra.js add bell --pace showcase
|
|
11
|
+
node cli/bin/cuetra.js show bell
|
|
12
|
+
node cli/bin/cuetra.js list
|
|
13
|
+
node cli/bin/cuetra.js help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- `add` writes the icon's kinetic SVG into `--out` (default `./icons`) and prints its
|
|
17
|
+
motion line. Default keeps all four treatment groups (what the runtime expects);
|
|
18
|
+
`--treatment <name>` extracts one group.
|
|
19
|
+
- `preview` prints the icon's motion map from motion.json: archetype, duration,
|
|
20
|
+
amplitude, easing, the full part list, strike timing, coupling and voice.
|
|
21
|
+
- `audit` checks a kinetic SVG file (pack-shipped or customised) against the frozen
|
|
22
|
+
physics bar - 20deg rotation cap incl. followers, visibility floors (rot/skew >= 5deg,
|
|
23
|
+
scale >= 0.10, travel >= 2.0px @24), the 240-420 ms ui band, motion ending exactly at
|
|
24
|
+
rest - and against the motion.json record its `data-icon` claims (treatments, part
|
|
25
|
+
counts, per-part delays intact). PASS prints the checked numbers; FAIL lists each
|
|
26
|
+
violated rule and exits non-zero. Strike-on-beat timing is runtime-verified
|
|
27
|
+
separately - not statically checkable from a record + SVG, so audit never judges it.
|
|
28
|
+
Physics bar source: MOTION-MODEL.md; floor aggregation follows the shipped census
|
|
29
|
+
method (icon peak over all parts, PIPE/out/MOTION-CENSUS.md).
|
|
30
|
+
- `--pace ui|showcase` applies the runtime's pace policy (`src/cuetra-motion.js`) to the
|
|
31
|
+
printed duration/amplitude. Every motion value itself is read from the pack's
|
|
32
|
+
`motion.json` at run time - nothing is duplicated in the CLI.
|
|
33
|
+
- Without a licence key only the free sampler set (`pack/`, 100 icons) is served and the
|
|
34
|
+
CLI says so honestly; a non-free `add` exits non-zero.
|
|
35
|
+
|
|
36
|
+
## Free vs paid
|
|
37
|
+
|
|
38
|
+
| | No key (free) | With a validated key |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| Icons served | free sampler set, 100 icons | the full pack from `--pack` / `CUETRA_PACK_DIR` (6,646 icons) |
|
|
41
|
+
| Network | never - no request is made | one online licence check per run, or none while the 7-day cache is fresh |
|
|
42
|
+
| Needs | nothing | `CUETRA_LICENCE_KEY` + the unpacked full pack directory |
|
|
43
|
+
|
|
44
|
+
A key comes from the purchase flow: buy the founding pack at cuetra.com through
|
|
45
|
+
Polar or Dodo Payments and the receipt (or cuetra.com/redeem) shows the key.
|
|
46
|
+
Polar keys look like `CUETRA-P-7K2M-9QF3-B9ZX`; Dodo Payments keys are
|
|
47
|
+
five-group codes like `2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43` - paste either one,
|
|
48
|
+
the CLI routes it to the processor that issued it. The full pack itself is
|
|
49
|
+
delivered at checkout - point `CUETRA_PACK_DIR` (or `--pack`) at the unpacked
|
|
50
|
+
directory you received.
|
|
51
|
+
A key is read from `--key <key>`, `CUETRA_LICENCE_KEY`, or `cli/licence.json`
|
|
52
|
+
(`{"key": "..."}`).
|
|
53
|
+
|
|
54
|
+
## How licence validation works
|
|
55
|
+
|
|
56
|
+
Serving the full pack requires the key to PASS online validation with the
|
|
57
|
+
licence service that issued it - Polar for `CUETRA-...` keys, Dodo Payments for
|
|
58
|
+
its five-group codes. Both are public, key-as-credential endpoints - the key
|
|
59
|
+
itself is the credential and no secret ships with the CLI. Personal and Team
|
|
60
|
+
keys take one seat on first use (`activate`); Polar Business keys validate
|
|
61
|
+
without consuming a seat, and a Dodo key of any tier activates once per machine
|
|
62
|
+
and re-validates its stored activation afterwards. A Dodo key spells no tier
|
|
63
|
+
out, so the tier is read from the product that issued the key during the live
|
|
64
|
+
check and kept in the cache entry. Every successful live validation is cached
|
|
65
|
+
for 7 days in a key-hash-named JSON file under the OS user cache dir - never
|
|
66
|
+
inside the repo, and written only after a successful live check - so normal use
|
|
67
|
+
keeps working offline inside that window. Set `CUETRA_LICENCE_CACHE_DIR` to
|
|
68
|
+
move the cache (tests, CI, locked-down machines).
|
|
69
|
+
|
|
70
|
+
Every class is honest and fail-closed to the free set, with the reason on stderr:
|
|
71
|
+
|
|
72
|
+
| Class | Meaning | Paid content |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| `valid` | the issuing service accepted the key just now | served |
|
|
75
|
+
| `cache-valid` | a live check from the last 7 days is reused; no licence server is contacted this run | served, with a notice |
|
|
76
|
+
| `shape-invalid` | the key does not match a known Cuetra shape (Polar or Dodo); nothing is sent anywhere | denied |
|
|
77
|
+
| `rejected` | the licence service said no (unknown, revoked, expired, or every seat in use); its reason is shown | denied |
|
|
78
|
+
| `offline-no-cache` | the licence service could not be reached and no fresh validation is cached | denied until one online run |
|
|
79
|
+
|
|
80
|
+
Keys are masked in every message and log (`CUET...(23 chars)`); the full key never
|
|
81
|
+
appears in CLI output.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Cuetra CLI entry point: parses argv, dispatches to a command in lib/commands.js and
|
|
3
|
+
// maps thrown command errors to process exit codes. Zero dependencies beyond Node builtins.
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { FREE_PACK_DIR } from "../lib/pack.js";
|
|
7
|
+
import { addCommand, listCommand, showCommand, previewCommand, auditCommand } from "../lib/commands.js";
|
|
8
|
+
|
|
9
|
+
const cliDir = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
|
+
|
|
11
|
+
const HELP_TEXT = `cuetra - kinetic icon CLI (free sampler: 100 icons, full library: 6,646)
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
cuetra add <icon> [--treatment outline|solid|duotone|glass] [--out <dir>]
|
|
15
|
+
[--pace ui|showcase] [--pack <dir>] [--key <key>]
|
|
16
|
+
cuetra preview <icon> [--pace ui|showcase] [--pack <dir>] [--key <key>]
|
|
17
|
+
cuetra audit <file.svg> [--pack <dir>] [--key <key>]
|
|
18
|
+
cuetra show <icon> [--pack <dir>] [--key <key>]
|
|
19
|
+
cuetra list [--pack <dir>] [--key <key>]
|
|
20
|
+
cuetra help
|
|
21
|
+
|
|
22
|
+
Commands:
|
|
23
|
+
add Write an icon's kinetic SVG into --out (default ./icons) and print its
|
|
24
|
+
motion line: archetype, paced duration, amplitude, easing, parts, treatments.
|
|
25
|
+
Default keeps all four treatments in one file, exactly as the runtime expects.
|
|
26
|
+
--treatment extracts a single treatment group.
|
|
27
|
+
preview Print the icon's motion map from motion.json: archetype, duration,
|
|
28
|
+
amplitude, easing, the full part list, strike timing, coupling and voice.
|
|
29
|
+
audit Audit a kinetic SVG file (pack-shipped or customised) against the frozen
|
|
30
|
+
physics bar - 20deg rotation cap incl. followers, visibility floors
|
|
31
|
+
(rot/skew >= 5deg, scale >= 0.10, travel >= 2.0px @24), the 240-420 ms ui
|
|
32
|
+
band, motion ending exactly at rest - and against the motion.json record
|
|
33
|
+
its data-icon claims (treatments, part counts, delays intact).
|
|
34
|
+
PASS prints the checked numbers; FAIL lists each violated rule. Exits
|
|
35
|
+
non-zero on fail. Strike-on-beat timing is runtime-verified separately -
|
|
36
|
+
not statically checkable from a record + SVG, so audit never judges it.
|
|
37
|
+
show Print the icon's full motion record from motion.json.
|
|
38
|
+
list Print every icon name in the served pack.
|
|
39
|
+
|
|
40
|
+
Licence:
|
|
41
|
+
Without a key only the free sampler set (../pack, 100 icons) is served, and the
|
|
42
|
+
CLI says so. A key is read from --key, the CUETRA_LICENCE_KEY environment
|
|
43
|
+
variable, or cli/licence.json ({"key": "..."}). A full pack (--pack or
|
|
44
|
+
CUETRA_PACK_DIR, the unpacked pack you received) is paid content: serving it
|
|
45
|
+
requires the key to PASS online validation with the processor that issued it -
|
|
46
|
+
Polar (CUETRA-... keys) or Dodo Payments (five-group keys), the same licence
|
|
47
|
+
services the site's redeem flow uses. Personal and Team keys take one seat on
|
|
48
|
+
first use; every successful validation is cached for 7 days, so normal use
|
|
49
|
+
works offline within that window. A malformed key, a rejection, or no
|
|
50
|
+
network and no fresh cache falls back to the free set and says exactly why.
|
|
51
|
+
|
|
52
|
+
Pace:
|
|
53
|
+
--pace ui (default) reports the shipped 240-420 ms band; --pace showcase applies
|
|
54
|
+
the runtime's 1.75x duration / 1.4x amplitude showcase policy to the report.
|
|
55
|
+
Motion values themselves always come from the pack's motion.json.
|
|
56
|
+
|
|
57
|
+
Examples:
|
|
58
|
+
cuetra add bell
|
|
59
|
+
cuetra add bell --treatment glass --out ./icons
|
|
60
|
+
cuetra add bell --pace showcase
|
|
61
|
+
cuetra show bell
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
function parseArgs(argv) {
|
|
65
|
+
const options = {};
|
|
66
|
+
const positional = [];
|
|
67
|
+
for (let index = 0; index < argv.length; index++) {
|
|
68
|
+
const arg = argv[index];
|
|
69
|
+
if (arg === "--treatment") options.treatment = argv[++index];
|
|
70
|
+
else if (arg === "--out") options.out = argv[++index];
|
|
71
|
+
else if (arg === "--pace") options.pace = argv[++index];
|
|
72
|
+
else if (arg === "--pack") options.pack = argv[++index];
|
|
73
|
+
else if (arg === "--key") options.key = argv[++index];
|
|
74
|
+
else if (arg === "--help" || arg === "-h") options.help = true;
|
|
75
|
+
else if (arg.startsWith("--")) {
|
|
76
|
+
const error = new Error(`unknown option "${arg}"`);
|
|
77
|
+
error.exitCode = 2;
|
|
78
|
+
throw error;
|
|
79
|
+
} else positional.push(arg);
|
|
80
|
+
}
|
|
81
|
+
return { options, positional };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Commands await the (possibly online) licence gate in resolvePack; help and
|
|
85
|
+
// usage errors return before it, so they stay instant.
|
|
86
|
+
async function main() {
|
|
87
|
+
const { options, positional } = parseArgs(process.argv.slice(2));
|
|
88
|
+
const [command, ...commandArgs] = positional;
|
|
89
|
+
|
|
90
|
+
if (options.help || !command || command === "help") {
|
|
91
|
+
process.stdout.write(HELP_TEXT);
|
|
92
|
+
// An explicit help request exits 0; a bare `cuetra` with no command is a usage error.
|
|
93
|
+
process.exitCode = (command || options.help) ? 0 : 2;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const context = { cliDir, freePackDir: FREE_PACK_DIR };
|
|
98
|
+
if (command === "add") {
|
|
99
|
+
if (!commandArgs[0]) {
|
|
100
|
+
const error = new Error("add needs an icon name, e.g. cuetra add bell");
|
|
101
|
+
error.exitCode = 2;
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
await addCommand(commandArgs[0], options, context);
|
|
105
|
+
} else if (command === "show") {
|
|
106
|
+
if (!commandArgs[0]) {
|
|
107
|
+
const error = new Error("show needs an icon name, e.g. cuetra show bell");
|
|
108
|
+
error.exitCode = 2;
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
await showCommand(commandArgs[0], options, context);
|
|
112
|
+
} else if (command === "preview") {
|
|
113
|
+
if (!commandArgs[0]) {
|
|
114
|
+
const error = new Error("preview needs an icon name, e.g. cuetra preview bell");
|
|
115
|
+
error.exitCode = 2;
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
await previewCommand(commandArgs[0], options, context);
|
|
119
|
+
} else if (command === "audit") {
|
|
120
|
+
if (!commandArgs[0]) {
|
|
121
|
+
const error = new Error("audit needs an SVG file path, e.g. cuetra audit ./icons/bell.svg");
|
|
122
|
+
error.exitCode = 2;
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
await auditCommand(commandArgs[0], options, context);
|
|
126
|
+
} else if (command === "list") {
|
|
127
|
+
await listCommand(options, context);
|
|
128
|
+
} else {
|
|
129
|
+
const error = new Error(`unknown command "${command}" - try \`cuetra help\``);
|
|
130
|
+
error.exitCode = 2;
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
try {
|
|
136
|
+
await main();
|
|
137
|
+
} catch (error) {
|
|
138
|
+
process.stderr.write(`cuetra: ${error.message}\n`);
|
|
139
|
+
process.exitCode = error.exitCode || 1;
|
|
140
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// Implements the CLI commands: add (write a kinetic icon + report its motion line),
|
|
2
|
+
// show (print one icon's motion record) and list (enumerate the served set).
|
|
3
|
+
// Every motion value printed here is read from the pack's motion.json at run time.
|
|
4
|
+
// resolvePack is async because serving a full pack awaits the online licence
|
|
5
|
+
// validation; free runs return from it without touching the network.
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { PACE, TREATMENTS, extractTreatment, readIconSvg, resolvePack, resolveLicenceKey } from "./pack.js";
|
|
9
|
+
import { checkMotionRecord, checkSvgFile, unitForAxis } from "./physics.js";
|
|
10
|
+
|
|
11
|
+
const FREE_SET_SIZE = 100;
|
|
12
|
+
|
|
13
|
+
// resolvePack builds a note when it wants to tell the user something about the pack
|
|
14
|
+
// (a key accepted but no full pack configured, or a supplied key that failed the
|
|
15
|
+
// shape check). It is guidance rather than command output, so it goes to stderr.
|
|
16
|
+
function printPackNote(note) {
|
|
17
|
+
if (note) process.stderr.write(`${note}\n`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function addCommand(iconName, options, context) {
|
|
21
|
+
const licenceKey = resolveLicenceKey({ flagKey: options.key, cliDir: context.cliDir });
|
|
22
|
+
const { pack, source, note, licensed } = await resolvePack({ packFlag: options.pack, licenceKey });
|
|
23
|
+
|
|
24
|
+
if (!(iconName in pack.map.icons)) {
|
|
25
|
+
const isFreePack = pack.dir === path.resolve(context.freePackDir);
|
|
26
|
+
if (!licensed && isFreePack) {
|
|
27
|
+
// The pack note carries the fail-closed reason (malformed, rejected or
|
|
28
|
+
// offline-unvalidatable key) - it must reach the user even though the
|
|
29
|
+
// command errors below.
|
|
30
|
+
printPackNote(note);
|
|
31
|
+
const message = [
|
|
32
|
+
`"${iconName}" is not in the free sampler set (${FREE_SET_SIZE} icons).`,
|
|
33
|
+
"The other 6,546 icons need a licence: set CUETRA_LICENCE_KEY (or run with --key <key>)",
|
|
34
|
+
"and point CUETRA_PACK_DIR at the unpacked full pack, then run the same command.",
|
|
35
|
+
"Free set: run `cuetra list` to see every free icon name.",
|
|
36
|
+
].join("\n");
|
|
37
|
+
const error = new Error(message);
|
|
38
|
+
error.exitCode = 1;
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
const error = new Error(`icon "${iconName}" not found in pack ${pack.dir}`);
|
|
42
|
+
error.exitCode = 1;
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const record = pack.map.icons[iconName];
|
|
47
|
+
const pace = PACE[options.pace] || PACE.ui;
|
|
48
|
+
const paceName = PACE[options.pace] ? options.pace : "ui";
|
|
49
|
+
const svgText = readIconSvg(pack, iconName);
|
|
50
|
+
|
|
51
|
+
let outText = svgText;
|
|
52
|
+
if (options.treatment) {
|
|
53
|
+
if (!TREATMENTS.includes(options.treatment)) {
|
|
54
|
+
const error = new Error(`unknown treatment "${options.treatment}" - choose one of: ${TREATMENTS.join(", ")}`);
|
|
55
|
+
error.exitCode = 2;
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
if (!(record.treatments || TREATMENTS).includes(options.treatment)) {
|
|
59
|
+
const error = new Error(`"${iconName}" has no ${options.treatment} treatment in its motion record`);
|
|
60
|
+
error.exitCode = 1;
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
const extracted = extractTreatment(svgText, options.treatment);
|
|
64
|
+
if (!extracted) {
|
|
65
|
+
const error = new Error(`no ${options.treatment} group found inside the kinetic SVG for "${iconName}"`);
|
|
66
|
+
error.exitCode = 1;
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
outText = extracted;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const outDir = path.resolve(options.out || "icons");
|
|
73
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
74
|
+
const outPath = path.join(outDir, `${iconName}.svg`);
|
|
75
|
+
// Encoding discipline: the kinetic SVG is UTF-8 text and is written as UTF-8, no BOM.
|
|
76
|
+
fs.writeFileSync(outPath, outText, "utf8");
|
|
77
|
+
|
|
78
|
+
const durationMs = Math.round(record.duration * pace.dur);
|
|
79
|
+
const amplitude = (record.amp ?? record.amplitude) * pace.amp;
|
|
80
|
+
const parts = (record.parts || []).length;
|
|
81
|
+
const treatmentList = (record.treatments || TREATMENTS).join(", ");
|
|
82
|
+
process.stdout.write(`wrote ${outPath} (${outText.length} bytes, ${options.treatment || "all treatments"})\n`);
|
|
83
|
+
process.stdout.write(
|
|
84
|
+
`${iconName} - archetype ${record.archetype}, ${durationMs} ms at ${paceName} pace, ` +
|
|
85
|
+
`amplitude ${amplitude.toFixed(2)}, easing ${record.easing}, ${parts} part(s), ` +
|
|
86
|
+
`treatments: ${treatmentList}\n`
|
|
87
|
+
);
|
|
88
|
+
process.stdout.write(`motion source: ${path.join(pack.dir, "motion.json")}\n`);
|
|
89
|
+
printPackNote(note);
|
|
90
|
+
process.stdout.write(`pack: ${source}\n`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function showCommand(iconName, options, context) {
|
|
94
|
+
const licenceKey = resolveLicenceKey({ flagKey: options.key, cliDir: context.cliDir });
|
|
95
|
+
const { pack, source, note } = await resolvePack({ packFlag: options.pack, licenceKey });
|
|
96
|
+
printPackNote(note);
|
|
97
|
+
if (!(iconName in pack.map.icons)) {
|
|
98
|
+
const error = new Error(`icon "${iconName}" not found in ${source} (${pack.dir})`);
|
|
99
|
+
error.exitCode = 1;
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
const record = pack.map.icons[iconName];
|
|
103
|
+
process.stdout.write(JSON.stringify(record, null, 2) + "\n");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export async function listCommand(options, context) {
|
|
107
|
+
const licenceKey = resolveLicenceKey({ flagKey: options.key, cliDir: context.cliDir });
|
|
108
|
+
const { pack, source, note } = await resolvePack({ packFlag: options.pack, licenceKey });
|
|
109
|
+
printPackNote(note);
|
|
110
|
+
process.stdout.write(`${pack.iconNames.length} icons in ${source} (${pack.dir}):\n`);
|
|
111
|
+
process.stdout.write(pack.iconNames.join("\n") + "\n");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Render one part's line of the preview map: role, delay, pivot, amplitude scale and,
|
|
115
|
+
// for coupled followers, the part they follow.
|
|
116
|
+
function partLine(part, index) {
|
|
117
|
+
const role = String(part.role || "body").padEnd(8);
|
|
118
|
+
const delay = Number(part.delay ?? 0);
|
|
119
|
+
const pivot = part.pivot || "50% 50%";
|
|
120
|
+
const scale = Number(part.amplitudeScale ?? 1);
|
|
121
|
+
const follows = part.follows === undefined ? "" : ` follows ${part.follows}`;
|
|
122
|
+
return ` [${index}] ${role} delay ${delay} ms pivot ${pivot} amplitudeScale ${scale.toFixed(3)}${follows}`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// preview: print the icon's motion map - everything motion.json holds for one icon, in
|
|
126
|
+
// the readable style of add's motion line. No motion value is invented here.
|
|
127
|
+
export async function previewCommand(iconName, options, context) {
|
|
128
|
+
const licenceKey = resolveLicenceKey({ flagKey: options.key, cliDir: context.cliDir });
|
|
129
|
+
const { pack, source, note } = await resolvePack({ packFlag: options.pack, licenceKey });
|
|
130
|
+
printPackNote(note);
|
|
131
|
+
if (!(iconName in pack.map.icons)) {
|
|
132
|
+
const error = new Error(`icon "${iconName}" not found in ${source} (${pack.dir})`);
|
|
133
|
+
error.exitCode = 1;
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
const record = pack.map.icons[iconName];
|
|
137
|
+
const pace = PACE[options.pace] || PACE.ui;
|
|
138
|
+
const paceName = PACE[options.pace] ? options.pace : "ui";
|
|
139
|
+
const amplitude = record.amp ?? record.amplitude;
|
|
140
|
+
const parts = record.parts || [];
|
|
141
|
+
|
|
142
|
+
process.stdout.write(`${iconName} - motion map (${path.join(pack.dir, "motion.json")})\n`);
|
|
143
|
+
process.stdout.write(` archetype ${record.archetype} (cue ${record.cue}, domain ${record.domain}, family ${record.family})\n`);
|
|
144
|
+
process.stdout.write(` duration ${Math.round(record.duration * pace.dur)} ms at ${paceName} pace (${record.duration} ms authored), easing ${record.easing}\n`);
|
|
145
|
+
process.stdout.write(` amplitude ${amplitude} ${unitForAxis(record.axis)} (axis ${record.axis}, dir ${record.dir ?? record.direction})\n`);
|
|
146
|
+
process.stdout.write(` parts: ${parts.length}\n`);
|
|
147
|
+
for (let index = 0; index < parts.length; index++) {
|
|
148
|
+
process.stdout.write(partLine(parts[index], index) + "\n");
|
|
149
|
+
}
|
|
150
|
+
if (record.strikeAt !== undefined) {
|
|
151
|
+
process.stdout.write(` strike at ${Math.round(record.strikeAt * pace.dur)} ms (${record.strikeAt} ms authored)\n`);
|
|
152
|
+
}
|
|
153
|
+
if (record.coupling && Array.isArray(record.coupling.followers) && record.coupling.followers.length) {
|
|
154
|
+
const followerText = record.coupling.followers.map((follower) =>
|
|
155
|
+
`part ${follower.part} preset ${follower.preset} stiffness ${follower.stiffness} damping ${follower.damping} gain ${follower.gain}`
|
|
156
|
+
).join("; ");
|
|
157
|
+
process.stdout.write(` coupling: lead ${record.coupling.lead}, followers: ${followerText}\n`);
|
|
158
|
+
}
|
|
159
|
+
if (record.voice) {
|
|
160
|
+
process.stdout.write(
|
|
161
|
+
` voice: instrument ${record.voice.instrument}, pitch ${record.voice.pitchSemis} semis, ` +
|
|
162
|
+
`attack ${record.voice.attackMs} ms, decay ${record.voice.decayMs} ms\n`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
const counts = record.treatments || TREATMENTS;
|
|
166
|
+
const countText = counts.map((treatment) => `${treatment}(${(record.partCounts || {})[treatment] ?? "?"})`).join(", ");
|
|
167
|
+
process.stdout.write(` treatments: ${countText}\n`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// audit: check a customised kinetic SVG against the frozen physics bar and against the
|
|
171
|
+
// record its data-icon claims. PASS prints the checked numbers; FAIL lists every
|
|
172
|
+
// violated rule and exits non-zero.
|
|
173
|
+
export async function auditCommand(svgFilePath, options, context) {
|
|
174
|
+
const licenceKey = resolveLicenceKey({ flagKey: options.key, cliDir: context.cliDir });
|
|
175
|
+
const { pack, source, note } = await resolvePack({ packFlag: options.pack, licenceKey });
|
|
176
|
+
printPackNote(note);
|
|
177
|
+
|
|
178
|
+
const resolvedFile = path.resolve(svgFilePath);
|
|
179
|
+
if (!fs.existsSync(resolvedFile)) {
|
|
180
|
+
const error = new Error(`file not found: ${resolvedFile}`);
|
|
181
|
+
error.exitCode = 1;
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
184
|
+
const svgText = fs.readFileSync(resolvedFile, "utf8");
|
|
185
|
+
|
|
186
|
+
const iconNameMatch = svgText.match(/data-icon="([^"]*)"/) || svgText.match(/data-name="([^"]*)"/);
|
|
187
|
+
if (!iconNameMatch) {
|
|
188
|
+
const error = new Error(`no data-icon attribute in ${resolvedFile} - audit needs the icon the file belongs to`);
|
|
189
|
+
error.exitCode = 1;
|
|
190
|
+
throw error;
|
|
191
|
+
}
|
|
192
|
+
const iconName = iconNameMatch[1];
|
|
193
|
+
if (!(iconName in pack.map.icons)) {
|
|
194
|
+
const error = new Error(`icon "${iconName}" not found in ${source} (${pack.dir})`);
|
|
195
|
+
error.exitCode = 1;
|
|
196
|
+
throw error;
|
|
197
|
+
}
|
|
198
|
+
const record = pack.map.icons[iconName];
|
|
199
|
+
|
|
200
|
+
const checks = [...checkMotionRecord(record), ...checkSvgFile(svgText, record)];
|
|
201
|
+
process.stdout.write(`audit ${path.basename(resolvedFile)} (icon "${iconName}") against ${path.join(pack.dir, "motion.json")}\n`);
|
|
202
|
+
for (const check of checks) {
|
|
203
|
+
process.stdout.write(` ${check.pass ? "PASS" : "FAIL"} ${check.rule}: ${check.detail}\n`);
|
|
204
|
+
}
|
|
205
|
+
if (record.strikeAt !== undefined) {
|
|
206
|
+
process.stdout.write(" NOTE strike-on-beat: runtime-verified separately - not statically checkable from record + SVG\n");
|
|
207
|
+
}
|
|
208
|
+
const failed = checks.filter((check) => !check.pass);
|
|
209
|
+
if (failed.length) {
|
|
210
|
+
process.stdout.write(`${path.basename(resolvedFile)}: FAIL - ${failed.length} rule(s) violated: ${failed.map((check) => check.rule).join(", ")}\n`);
|
|
211
|
+
process.exitCode = 1;
|
|
212
|
+
} else {
|
|
213
|
+
process.stdout.write(`${path.basename(resolvedFile)}: PASS (${checks.length} rules checked)\n`);
|
|
214
|
+
}
|
|
215
|
+
}
|