@birdapi/velinstyle 1.2.1 → 1.3.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.
Files changed (156) hide show
  1. package/README.de.md +148 -11
  2. package/README.md +174 -16
  3. package/cli/__fixtures__/atelier-library/showcases/01-login/app.css +1 -0
  4. package/cli/__fixtures__/atelier-library/showcases/01-login/app.js +2 -0
  5. package/cli/__fixtures__/atelier-library/showcases/01-login/index.html +5 -0
  6. package/cli/__fixtures__/atelier-library/showcases/04-pricing/app.css +1 -0
  7. package/cli/__fixtures__/atelier-library/showcases/04-pricing/app.js +2 -0
  8. package/cli/__fixtures__/atelier-library/showcases/04-pricing/index.html +5 -0
  9. package/cli/__fixtures__/atelier-library/showcases/36-calendar/app.css +1 -0
  10. package/cli/__fixtures__/atelier-library/showcases/36-calendar/app.js +2 -0
  11. package/cli/__fixtures__/atelier-library/showcases/36-calendar/index.html +5 -0
  12. package/cli/atelier-catalog.json +1267 -0
  13. package/cli/atelier-formats.js +159 -0
  14. package/cli/atelier.js +382 -0
  15. package/cli/blueprints/empty-state.html +3 -5
  16. package/cli/cli-manifest.json +441 -161
  17. package/cli/docgen/extract-cli.js +2 -1
  18. package/cli/docs-generate.js +9 -0
  19. package/cli/experience.js +173 -0
  20. package/cli/index.js +1384 -361
  21. package/cli/motion.js +738 -0
  22. package/cli/production/component-graph.json +166 -0
  23. package/cli/production/explain.js +52 -0
  24. package/cli/production/extract.js +278 -0
  25. package/cli/production/graph.js +102 -0
  26. package/cli/production/report.js +168 -0
  27. package/cli/production/run.js +355 -0
  28. package/cli/production/trim-css.js +177 -0
  29. package/cli/production/trim-fonts.js +23 -0
  30. package/cli/production/trim-icons.js +38 -0
  31. package/cli/production/trim-js.js +48 -0
  32. package/cli/production/trim-motion.js +22 -0
  33. package/cli/production/trim-themes.js +50 -0
  34. package/cli/production/watch.js +38 -0
  35. package/cli/review.js +48 -1
  36. package/cli/scripts/write-atelier-fixtures.mjs +33 -0
  37. package/cli/security.js +190 -0
  38. package/cli/skills.js +53 -10
  39. package/cli/transparency.js +140 -41
  40. package/cli/workflow.js +32 -17
  41. package/components/index.js +3 -0
  42. package/components/runtime/component-loaders.js +3 -0
  43. package/components/velin-drawer.js +43 -4
  44. package/components/velin-empty-state.js +83 -0
  45. package/components/velin-modal.js +76 -15
  46. package/components/velin-otp-input.js +220 -0
  47. package/components/velin-password-strength.js +147 -0
  48. package/components/velin-sheet.js +49 -4
  49. package/components/velin-theme-toggle.js +15 -1
  50. package/core/a11y/component-contracts.json +391 -255
  51. package/core/attributes/registry.js +1 -1
  52. package/core/meta/knowledge/components.json +75 -3
  53. package/core/motion/analyze.js +38 -0
  54. package/core/motion/blueprint.js +51 -0
  55. package/core/motion/composer.js +114 -0
  56. package/core/motion/data/registry.json +352 -0
  57. package/core/motion/effects.js +17 -1
  58. package/core/motion/index.js +112 -9
  59. package/core/motion/optimize.js +44 -0
  60. package/core/motion/policy.js +77 -0
  61. package/core/motion/registry.js +131 -0
  62. package/core/motion/review.js +59 -0
  63. package/core/motion/scan.js +150 -0
  64. package/core/motion/timeline.js +68 -0
  65. package/core/motion/transitions.js +49 -0
  66. package/core/motion/triggers.js +168 -0
  67. package/core/security/checks/fs.js +92 -0
  68. package/core/security/detect.js +35 -0
  69. package/core/security/engine.js +116 -0
  70. package/core/security/index.js +18 -0
  71. package/core/security/registry.js +85 -0
  72. package/core/security/report/report.js +113 -0
  73. package/core/security/rules/ci/index.js +146 -0
  74. package/core/security/rules/consumer/index.js +174 -0
  75. package/core/security/rules/deps/index.js +182 -0
  76. package/core/security/rules/index.js +24 -0
  77. package/core/security/rules/publish/index.js +230 -0
  78. package/core/security/rules/repo/index.js +143 -0
  79. package/core/security/rules/secrets/index.js +133 -0
  80. package/core/security/score/dependency-health.js +53 -0
  81. package/core/security/score/release-health.js +66 -0
  82. package/core/security/score/score.js +102 -0
  83. package/core/security/timeline/timeline.js +76 -0
  84. package/dist/chunks/attributes-2ORR27KA.js +404 -0
  85. package/dist/chunks/attributes-HK7VIOLA.js +1080 -0
  86. package/dist/chunks/attributes-VRHHVNDO.js +1080 -0
  87. package/dist/chunks/chunk-MYKUI364.js +116 -0
  88. package/dist/chunks/chunk-NEVBPD5T.js +116 -0
  89. package/dist/chunks/chunk-Y6HN7HWX.js +116 -0
  90. package/dist/chunks/runtime-entry.js +1 -1
  91. package/dist/chunks/velin-drawer-A7Q7EBOS.js +162 -0
  92. package/dist/chunks/velin-empty-state-3NTUH2RF.js +81 -0
  93. package/dist/chunks/velin-modal-3MV4FYBK.js +231 -0
  94. package/dist/chunks/velin-otp-input-PSK42MM6.js +207 -0
  95. package/dist/chunks/velin-password-strength-TAXMLSED.js +136 -0
  96. package/dist/chunks/velin-sheet-N2VVYXFP.js +157 -0
  97. package/dist/chunks/velin-theme-toggle-J2NHC7IM.js +304 -0
  98. package/dist/llms.txt +4 -4
  99. package/dist/search-index.json +232 -5
  100. package/dist/velin-agent.json +433 -46
  101. package/dist/velinstyle-components.iife.js +3695 -2272
  102. package/dist/velinstyle-components.js +3698 -2271
  103. package/dist/velinstyle-components.min.js +262 -120
  104. package/dist/velinstyle.css +96 -13
  105. package/dist/velinstyle.d.ts +3 -0
  106. package/dist/velinstyle.min.css +1 -1
  107. package/package.json +19 -4
  108. package/packages/velinstyle-cli-core/package.json +11 -0
  109. package/packages/velinstyle-cli-core/src/config.js +84 -0
  110. package/packages/velinstyle-cli-core/src/contract.js +56 -0
  111. package/packages/velinstyle-cli-core/src/event-bus.js +50 -0
  112. package/packages/velinstyle-cli-core/src/index.js +18 -0
  113. package/packages/velinstyle-cli-core/src/lifecycle.js +33 -0
  114. package/packages/velinstyle-cli-core/src/runner.js +129 -0
  115. package/packages/velinstyle-cli-registry/data/commands.json +1216 -0
  116. package/packages/velinstyle-cli-registry/data/layouts.json +33 -0
  117. package/packages/velinstyle-cli-registry/data/widgets.json +35 -0
  118. package/packages/velinstyle-cli-registry/package.json +13 -0
  119. package/packages/velinstyle-cli-registry/src/index.js +88 -0
  120. package/packages/velinstyle-cli-renderer/package.json +8 -0
  121. package/packages/velinstyle-cli-renderer/src/index.js +286 -0
  122. package/packages/velinstyle-cli-theme/package.json +8 -0
  123. package/packages/velinstyle-cli-theme/src/index.js +84 -0
  124. package/packages/velinstyle-cli-ui/package.json +8 -0
  125. package/packages/velinstyle-cli-ui/src/index.js +34 -0
  126. package/packages/velinstyle-motion/README.md +81 -0
  127. package/packages/velinstyle-motion/package.json +37 -0
  128. package/packages/velinstyle-motion/src/ai/mini-prompt.js +119 -0
  129. package/packages/velinstyle-motion/src/ai/provider.js +59 -0
  130. package/packages/velinstyle-motion/src/ai/providers/pixverse-setup.js +402 -0
  131. package/packages/velinstyle-motion/src/ai/providers/pixverse.js +245 -0
  132. package/packages/velinstyle-motion/src/config.js +257 -0
  133. package/packages/velinstyle-motion/src/export/html-clip.js +141 -0
  134. package/packages/velinstyle-motion/src/index.js +304 -0
  135. package/packages/velinstyle-motion/src/jobs/cache.js +30 -0
  136. package/packages/velinstyle-motion/src/jobs/queue.js +69 -0
  137. package/packages/velinstyle-motion/src/jobs/usage.js +53 -0
  138. package/packages/velinstyle-motion/src/local/effects.js +139 -0
  139. package/packages/velinstyle-motion/src/local/engine.js +96 -0
  140. package/packages/velinstyle-motion/src/providers-catalog.js +44 -0
  141. package/packages/velinstyle-motion/src/registry/presets.js +25 -0
  142. package/packages/velinstyle-motion/src/registry/presets.json +85 -0
  143. package/packages/velinstyle-motion/src/ux/cost-gate.js +37 -0
  144. package/packages/velinstyle-motion/src/ux/pixverse-gate.js +153 -0
  145. package/packages/velinstyle-motion/src/ux/wizard.js +171 -0
  146. package/packages/velinstyle-motion/src/validate-image.js +91 -0
  147. package/packages/velinstyle-skills/catalog.json +1 -1
  148. package/packages/velinstyle-skills/registry.json +1 -142
  149. package/packages/velinstyle-skills/skills/velin-motion-reduced-safe/SKILL.md +1 -1
  150. package/packages/velinstyle-skills/skills/velin-motion-reveal-feedback/SKILL.md +1 -1
  151. package/src/components/data-table.css +19 -0
  152. package/src/components/empty-auth.css +33 -0
  153. package/src/components/table.css +16 -6
  154. package/src/tokens/motion.css +7 -0
  155. package/src/utilities/scroll-animation.css +66 -0
  156. package/src/velinstyle.css +1 -0
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Velin Experience bridge — used by cli/index.js commands.
3
+ */
4
+ import { runExperienceCommand, loadExperienceConfig } from '../packages/velinstyle-cli-core/src/index.js';
5
+ import { createExperienceSession, renderContract } from '../packages/velinstyle-cli-renderer/src/index.js';
6
+ import {
7
+ getCommand,
8
+ getCommandsRegistry,
9
+ listCommandsByCategory,
10
+ registerPluginCommand,
11
+ toCliManifest,
12
+ } from '../packages/velinstyle-cli-registry/src/index.js';
13
+ import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'fs';
14
+ import { dirname, resolve, join } from 'path';
15
+
16
+ export {
17
+ runExperienceCommand,
18
+ loadExperienceConfig,
19
+ createExperienceSession,
20
+ renderContract,
21
+ getCommand,
22
+ getCommandsRegistry,
23
+ listCommandsByCategory,
24
+ registerPluginCommand,
25
+ toCliManifest,
26
+ };
27
+
28
+ export function parseExperienceFlags(args, helpers) {
29
+ const { getArg, hasFlag } = helpers;
30
+ // index.js helpers close over process argv: getArg(flag) / hasFlag(flag)
31
+ // Support both signatures.
32
+ const ga = (flag, alias) => {
33
+ try {
34
+ const v = getArg(args, flag, alias);
35
+ if (v != null) return v;
36
+ } catch { /* ignore */ }
37
+ return getArg(flag, alias);
38
+ };
39
+ const hf = (flag, alias) => {
40
+ try {
41
+ if (hasFlag(args, flag, alias)) return true;
42
+ } catch { /* ignore */ }
43
+ return hasFlag(flag, alias);
44
+ };
45
+ const overrides = {};
46
+ const theme = ga('--theme');
47
+ const output = ga('--output') || ga('--mode');
48
+ if (theme) overrides.theme = theme;
49
+ if (output) overrides.output = output;
50
+ if (hf('--compact')) overrides.output = 'compact';
51
+ if (hf('--dashboard')) overrides.output = 'dashboard';
52
+ if (hf('--verbose')) overrides.output = 'verbose';
53
+ if (hf('--debug')) overrides.output = 'debug';
54
+ if (hf('--json')) overrides.output = 'json';
55
+ if (hf('--sarif')) overrides.output = 'sarif';
56
+ if (hf('--markdown') || hf('--md')) overrides.output = 'markdown';
57
+ if (hf('--no-unicode')) overrides.unicode = false;
58
+ if (hf('--no-icons')) overrides.icons = false;
59
+ if (hf('--analytics')) overrides.analytics = true;
60
+ if (hf('--record')) overrides.record = true;
61
+ return overrides;
62
+ }
63
+
64
+ export function printContract(contract, config) {
65
+ const out = renderContract(contract, config);
66
+ console.log(out);
67
+ return out;
68
+ }
69
+
70
+ export function writeRecording({ contract, events, config, outDir }) {
71
+ const dir = resolve(outDir || join(process.cwd(), '.velin', 'records'));
72
+ mkdirSync(dir, { recursive: true });
73
+ const stamp = new Date().toISOString().replace(/[:.]/g, '-');
74
+ const base = join(dir, `${contract.meta?.commandId || 'run'}-${stamp}`);
75
+ const record = {
76
+ version: 1,
77
+ recordedAt: new Date().toISOString(),
78
+ config,
79
+ contract,
80
+ events,
81
+ };
82
+ writeFileSync(`${base}.json`, JSON.stringify(record, null, 2));
83
+ writeFileSync(`${base}.md`, renderContract(contract, { ...config, output: 'markdown' }));
84
+ writeFileSync(`${base}.html`, toSimpleHtml(contract, config));
85
+ writeFileSync(`${base}.ascii.txt`, renderContract(contract, { ...config, output: 'standard' }));
86
+ return {
87
+ json: `${base}.json`,
88
+ markdown: `${base}.md`,
89
+ html: `${base}.html`,
90
+ ascii: `${base}.ascii.txt`,
91
+ };
92
+ }
93
+
94
+ function toSimpleHtml(contract, config) {
95
+ const md = renderContract(contract, { ...config, output: 'markdown' })
96
+ .replace(/&/g, '&')
97
+ .replace(/</g, '&lt;')
98
+ .replace(/>/g, '&gt;');
99
+ return `<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Velin Experience Record</title>
100
+ <style>body{font-family:ui-monospace,monospace;max-width:52rem;margin:2rem auto;padding:0 1rem;background:#0c0b0a;color:#f4f1ea}
101
+ pre{white-space:pre-wrap}</style></head><body><pre>${md}</pre></body></html>`;
102
+ }
103
+
104
+ export function loadRecord(path) {
105
+ const abs = resolve(path);
106
+ if (!existsSync(abs)) throw new Error(`Record not found: ${abs}`);
107
+ return JSON.parse(readFileSync(abs, 'utf8'));
108
+ }
109
+
110
+ export function buildHelpFromRegistry(version) {
111
+ const cats = listCommandsByCategory();
112
+ const lines = [
113
+ '',
114
+ ` Velin Experience v${version}`,
115
+ ` Entry point: velinstyle`,
116
+ '',
117
+ ' Usage:',
118
+ ];
119
+ const order = ['setup', 'build', 'design', 'health', 'audit', 'ai', 'dev'];
120
+ for (const cat of order) {
121
+ const list = cats.get(cat);
122
+ if (!list?.length) continue;
123
+ lines.push('');
124
+ lines.push(` ${cat}:`);
125
+ for (const cmd of list) {
126
+ const maturity = cmd.maturity && cmd.maturity !== 'stable' ? ` [${cmd.maturity}]` : '';
127
+ lines.push(` ${cmd.id.padEnd(14)} ${cmd.description}${maturity}`);
128
+ }
129
+ }
130
+ lines.push('');
131
+ lines.push(' Experience flags: --theme --output|--mode --compact --dashboard --verbose --debug --json --sarif --markdown --record --analytics --no-unicode');
132
+ lines.push(' Config: velinstyle-cli.json · Docs: docs/guides/velin-experience.md');
133
+ lines.push('');
134
+ return lines.join('\n');
135
+ }
136
+
137
+ /**
138
+ * Run a command through Experience and print/record.
139
+ */
140
+ export async function executeExperience({
141
+ commandId,
142
+ run,
143
+ args,
144
+ helpers,
145
+ version,
146
+ layout,
147
+ cwd = process.cwd(),
148
+ }) {
149
+ const overrides = parseExperienceFlags(args, helpers);
150
+ const cmdMeta = getCommand(commandId);
151
+ const session = await runExperienceCommand({
152
+ commandId,
153
+ configOverrides: overrides,
154
+ cwd,
155
+ layout: layout || cmdMeta?.layout || 'standard',
156
+ meta: { version },
157
+ run,
158
+ });
159
+
160
+ printContract(session.contract, session.config);
161
+
162
+ let recording = null;
163
+ if (session.config.record || overrides.record) {
164
+ recording = writeRecording({
165
+ contract: session.contract,
166
+ events: session.events,
167
+ config: session.config,
168
+ });
169
+ console.log(`\nRecorded → ${recording.json}`);
170
+ }
171
+
172
+ return { ...session, recording };
173
+ }