@birdapi/velinstyle 1.2.2 → 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 (109) hide show
  1. package/README.de.md +18 -4
  2. package/README.md +42 -7
  3. package/cli/cli-manifest.json +441 -174
  4. package/cli/docgen/extract-cli.js +2 -1
  5. package/cli/docs-generate.js +9 -0
  6. package/cli/experience.js +173 -0
  7. package/cli/index.js +1294 -417
  8. package/cli/motion.js +738 -0
  9. package/cli/production/extract.js +46 -6
  10. package/cli/production/report.js +104 -14
  11. package/cli/production/run.js +44 -1
  12. package/cli/security.js +190 -0
  13. package/cli/skills.js +53 -10
  14. package/cli/transparency.js +140 -41
  15. package/cli/workflow.js +32 -17
  16. package/components/velin-theme-toggle.js +15 -1
  17. package/core/a11y/component-contracts.json +391 -274
  18. package/core/attributes/registry.js +1 -1
  19. package/core/motion/analyze.js +38 -0
  20. package/core/motion/blueprint.js +51 -0
  21. package/core/motion/composer.js +114 -0
  22. package/core/motion/data/registry.json +352 -0
  23. package/core/motion/effects.js +17 -1
  24. package/core/motion/index.js +112 -9
  25. package/core/motion/optimize.js +44 -0
  26. package/core/motion/policy.js +77 -0
  27. package/core/motion/registry.js +131 -0
  28. package/core/motion/review.js +59 -0
  29. package/core/motion/scan.js +150 -0
  30. package/core/motion/timeline.js +68 -0
  31. package/core/motion/transitions.js +49 -0
  32. package/core/motion/triggers.js +168 -0
  33. package/core/security/checks/fs.js +92 -0
  34. package/core/security/detect.js +35 -0
  35. package/core/security/engine.js +116 -0
  36. package/core/security/index.js +18 -0
  37. package/core/security/registry.js +85 -0
  38. package/core/security/report/report.js +113 -0
  39. package/core/security/rules/ci/index.js +146 -0
  40. package/core/security/rules/consumer/index.js +174 -0
  41. package/core/security/rules/deps/index.js +182 -0
  42. package/core/security/rules/index.js +24 -0
  43. package/core/security/rules/publish/index.js +230 -0
  44. package/core/security/rules/repo/index.js +143 -0
  45. package/core/security/rules/secrets/index.js +133 -0
  46. package/core/security/score/dependency-health.js +53 -0
  47. package/core/security/score/release-health.js +66 -0
  48. package/core/security/score/score.js +102 -0
  49. package/core/security/timeline/timeline.js +76 -0
  50. package/dist/chunks/attributes-HK7VIOLA.js +1080 -0
  51. package/dist/chunks/attributes-VRHHVNDO.js +1080 -0
  52. package/dist/chunks/chunk-MYKUI364.js +116 -0
  53. package/dist/chunks/chunk-NEVBPD5T.js +116 -0
  54. package/dist/chunks/runtime-entry.js +1 -1
  55. package/dist/chunks/velin-theme-toggle-J2NHC7IM.js +304 -0
  56. package/dist/llms.txt +2 -2
  57. package/dist/search-index.json +166 -2
  58. package/dist/velin-agent.json +156 -32
  59. package/dist/velinstyle-components.iife.js +862 -17
  60. package/dist/velinstyle-components.js +862 -17
  61. package/dist/velinstyle-components.min.js +126 -126
  62. package/dist/velinstyle.css +42 -7
  63. package/dist/velinstyle.min.css +1 -1
  64. package/package.json +158 -143
  65. package/packages/velinstyle-cli-core/package.json +11 -0
  66. package/packages/velinstyle-cli-core/src/config.js +84 -0
  67. package/packages/velinstyle-cli-core/src/contract.js +56 -0
  68. package/packages/velinstyle-cli-core/src/event-bus.js +50 -0
  69. package/packages/velinstyle-cli-core/src/index.js +18 -0
  70. package/packages/velinstyle-cli-core/src/lifecycle.js +33 -0
  71. package/packages/velinstyle-cli-core/src/runner.js +129 -0
  72. package/packages/velinstyle-cli-registry/data/commands.json +1216 -0
  73. package/packages/velinstyle-cli-registry/data/layouts.json +33 -0
  74. package/packages/velinstyle-cli-registry/data/widgets.json +35 -0
  75. package/packages/velinstyle-cli-registry/package.json +13 -0
  76. package/packages/velinstyle-cli-registry/src/index.js +88 -0
  77. package/packages/velinstyle-cli-renderer/package.json +8 -0
  78. package/packages/velinstyle-cli-renderer/src/index.js +286 -0
  79. package/packages/velinstyle-cli-theme/package.json +8 -0
  80. package/packages/velinstyle-cli-theme/src/index.js +84 -0
  81. package/packages/velinstyle-cli-ui/package.json +8 -0
  82. package/packages/velinstyle-cli-ui/src/index.js +34 -0
  83. package/packages/velinstyle-motion/README.md +81 -0
  84. package/packages/velinstyle-motion/package.json +37 -0
  85. package/packages/velinstyle-motion/src/ai/mini-prompt.js +119 -0
  86. package/packages/velinstyle-motion/src/ai/provider.js +59 -0
  87. package/packages/velinstyle-motion/src/ai/providers/pixverse-setup.js +402 -0
  88. package/packages/velinstyle-motion/src/ai/providers/pixverse.js +245 -0
  89. package/packages/velinstyle-motion/src/config.js +257 -0
  90. package/packages/velinstyle-motion/src/export/html-clip.js +141 -0
  91. package/packages/velinstyle-motion/src/index.js +304 -0
  92. package/packages/velinstyle-motion/src/jobs/cache.js +30 -0
  93. package/packages/velinstyle-motion/src/jobs/queue.js +69 -0
  94. package/packages/velinstyle-motion/src/jobs/usage.js +53 -0
  95. package/packages/velinstyle-motion/src/local/effects.js +139 -0
  96. package/packages/velinstyle-motion/src/local/engine.js +96 -0
  97. package/packages/velinstyle-motion/src/providers-catalog.js +44 -0
  98. package/packages/velinstyle-motion/src/registry/presets.js +25 -0
  99. package/packages/velinstyle-motion/src/registry/presets.json +85 -0
  100. package/packages/velinstyle-motion/src/ux/cost-gate.js +37 -0
  101. package/packages/velinstyle-motion/src/ux/pixverse-gate.js +153 -0
  102. package/packages/velinstyle-motion/src/ux/wizard.js +171 -0
  103. package/packages/velinstyle-motion/src/validate-image.js +91 -0
  104. package/packages/velinstyle-skills/catalog.json +1 -1
  105. package/packages/velinstyle-skills/registry.json +1 -142
  106. package/packages/velinstyle-skills/skills/velin-motion-reduced-safe/SKILL.md +1 -1
  107. package/packages/velinstyle-skills/skills/velin-motion-reveal-feedback/SKILL.md +1 -1
  108. package/src/tokens/motion.css +7 -0
  109. package/src/utilities/scroll-animation.css +66 -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
+ }