@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.
- package/README.de.md +18 -4
- package/README.md +42 -7
- package/cli/cli-manifest.json +441 -174
- package/cli/docgen/extract-cli.js +2 -1
- package/cli/docs-generate.js +9 -0
- package/cli/experience.js +173 -0
- package/cli/index.js +1294 -417
- package/cli/motion.js +738 -0
- package/cli/production/extract.js +46 -6
- package/cli/production/report.js +104 -14
- package/cli/production/run.js +44 -1
- package/cli/security.js +190 -0
- package/cli/skills.js +53 -10
- package/cli/transparency.js +140 -41
- package/cli/workflow.js +32 -17
- package/components/velin-theme-toggle.js +15 -1
- package/core/a11y/component-contracts.json +391 -274
- package/core/attributes/registry.js +1 -1
- package/core/motion/analyze.js +38 -0
- package/core/motion/blueprint.js +51 -0
- package/core/motion/composer.js +114 -0
- package/core/motion/data/registry.json +352 -0
- package/core/motion/effects.js +17 -1
- package/core/motion/index.js +112 -9
- package/core/motion/optimize.js +44 -0
- package/core/motion/policy.js +77 -0
- package/core/motion/registry.js +131 -0
- package/core/motion/review.js +59 -0
- package/core/motion/scan.js +150 -0
- package/core/motion/timeline.js +68 -0
- package/core/motion/transitions.js +49 -0
- package/core/motion/triggers.js +168 -0
- package/core/security/checks/fs.js +92 -0
- package/core/security/detect.js +35 -0
- package/core/security/engine.js +116 -0
- package/core/security/index.js +18 -0
- package/core/security/registry.js +85 -0
- package/core/security/report/report.js +113 -0
- package/core/security/rules/ci/index.js +146 -0
- package/core/security/rules/consumer/index.js +174 -0
- package/core/security/rules/deps/index.js +182 -0
- package/core/security/rules/index.js +24 -0
- package/core/security/rules/publish/index.js +230 -0
- package/core/security/rules/repo/index.js +143 -0
- package/core/security/rules/secrets/index.js +133 -0
- package/core/security/score/dependency-health.js +53 -0
- package/core/security/score/release-health.js +66 -0
- package/core/security/score/score.js +102 -0
- package/core/security/timeline/timeline.js +76 -0
- package/dist/chunks/attributes-HK7VIOLA.js +1080 -0
- package/dist/chunks/attributes-VRHHVNDO.js +1080 -0
- package/dist/chunks/chunk-MYKUI364.js +116 -0
- package/dist/chunks/chunk-NEVBPD5T.js +116 -0
- package/dist/chunks/runtime-entry.js +1 -1
- package/dist/chunks/velin-theme-toggle-J2NHC7IM.js +304 -0
- package/dist/llms.txt +2 -2
- package/dist/search-index.json +166 -2
- package/dist/velin-agent.json +156 -32
- package/dist/velinstyle-components.iife.js +862 -17
- package/dist/velinstyle-components.js +862 -17
- package/dist/velinstyle-components.min.js +126 -126
- package/dist/velinstyle.css +42 -7
- package/dist/velinstyle.min.css +1 -1
- package/package.json +158 -143
- package/packages/velinstyle-cli-core/package.json +11 -0
- package/packages/velinstyle-cli-core/src/config.js +84 -0
- package/packages/velinstyle-cli-core/src/contract.js +56 -0
- package/packages/velinstyle-cli-core/src/event-bus.js +50 -0
- package/packages/velinstyle-cli-core/src/index.js +18 -0
- package/packages/velinstyle-cli-core/src/lifecycle.js +33 -0
- package/packages/velinstyle-cli-core/src/runner.js +129 -0
- package/packages/velinstyle-cli-registry/data/commands.json +1216 -0
- package/packages/velinstyle-cli-registry/data/layouts.json +33 -0
- package/packages/velinstyle-cli-registry/data/widgets.json +35 -0
- package/packages/velinstyle-cli-registry/package.json +13 -0
- package/packages/velinstyle-cli-registry/src/index.js +88 -0
- package/packages/velinstyle-cli-renderer/package.json +8 -0
- package/packages/velinstyle-cli-renderer/src/index.js +286 -0
- package/packages/velinstyle-cli-theme/package.json +8 -0
- package/packages/velinstyle-cli-theme/src/index.js +84 -0
- package/packages/velinstyle-cli-ui/package.json +8 -0
- package/packages/velinstyle-cli-ui/src/index.js +34 -0
- package/packages/velinstyle-motion/README.md +81 -0
- package/packages/velinstyle-motion/package.json +37 -0
- package/packages/velinstyle-motion/src/ai/mini-prompt.js +119 -0
- package/packages/velinstyle-motion/src/ai/provider.js +59 -0
- package/packages/velinstyle-motion/src/ai/providers/pixverse-setup.js +402 -0
- package/packages/velinstyle-motion/src/ai/providers/pixverse.js +245 -0
- package/packages/velinstyle-motion/src/config.js +257 -0
- package/packages/velinstyle-motion/src/export/html-clip.js +141 -0
- package/packages/velinstyle-motion/src/index.js +304 -0
- package/packages/velinstyle-motion/src/jobs/cache.js +30 -0
- package/packages/velinstyle-motion/src/jobs/queue.js +69 -0
- package/packages/velinstyle-motion/src/jobs/usage.js +53 -0
- package/packages/velinstyle-motion/src/local/effects.js +139 -0
- package/packages/velinstyle-motion/src/local/engine.js +96 -0
- package/packages/velinstyle-motion/src/providers-catalog.js +44 -0
- package/packages/velinstyle-motion/src/registry/presets.js +25 -0
- package/packages/velinstyle-motion/src/registry/presets.json +85 -0
- package/packages/velinstyle-motion/src/ux/cost-gate.js +37 -0
- package/packages/velinstyle-motion/src/ux/pixverse-gate.js +153 -0
- package/packages/velinstyle-motion/src/ux/wizard.js +171 -0
- package/packages/velinstyle-motion/src/validate-image.js +91 -0
- package/packages/velinstyle-skills/catalog.json +1 -1
- package/packages/velinstyle-skills/registry.json +1 -142
- package/packages/velinstyle-skills/skills/velin-motion-reduced-safe/SKILL.md +1 -1
- package/packages/velinstyle-skills/skills/velin-motion-reveal-feedback/SKILL.md +1 -1
- package/src/tokens/motion.css +7 -0
- 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, '<')
|
|
98
|
+
.replace(/>/g, '>');
|
|
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
|
+
}
|