@vibeo/cli 0.1.2 → 0.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/dist/commands/create.d.ts +6 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +18 -107
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/install-skills.d.ts +8 -0
- package/dist/commands/install-skills.d.ts.map +1 -0
- package/dist/commands/install-skills.js +215 -0
- package/dist/commands/install-skills.js.map +1 -0
- package/dist/commands/list.d.ts +9 -5
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +2 -77
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/preview.d.ts +1 -4
- package/dist/commands/preview.d.ts.map +1 -1
- package/dist/commands/preview.js +1 -57
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/render.d.ts +17 -4
- package/dist/commands/render.d.ts.map +1 -1
- package/dist/commands/render.js +22 -154
- package/dist/commands/render.js.map +1 -1
- package/dist/index.js +123 -57
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/commands/create.ts +19 -122
- package/src/commands/install-skills.ts +246 -0
- package/src/commands/list.ts +2 -98
- package/src/commands/preview.ts +1 -66
- package/src/commands/render.ts +26 -149
- package/src/index.ts +127 -56
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const TEMPLATE_NAMES: string[];
|
|
2
|
+
export declare function createProject(name: string, template: string): Promise<{
|
|
3
|
+
project: string;
|
|
4
|
+
template: string;
|
|
5
|
+
files: string[];
|
|
6
|
+
}>;
|
|
2
7
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AA8NA,eAAO,MAAM,cAAc,UAAyB,CAAC;AAErD,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA+DjE"}
|
package/dist/commands/create.js
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve, join } from "node:path";
|
|
|
2
2
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
// ---------------------------------------------------------------------------
|
|
5
|
-
// Embedded templates
|
|
5
|
+
// Embedded templates
|
|
6
6
|
// ---------------------------------------------------------------------------
|
|
7
7
|
const TEMPLATE_BASIC = `import React from "react";
|
|
8
8
|
import {
|
|
@@ -207,95 +207,24 @@ export function Root() {
|
|
|
207
207
|
`;
|
|
208
208
|
// ---------------------------------------------------------------------------
|
|
209
209
|
const TEMPLATES = {
|
|
210
|
-
basic: {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
},
|
|
214
|
-
"audio-reactive": {
|
|
215
|
-
description: "Audio visualization with frequency bars and amplitude-driven effects",
|
|
216
|
-
source: TEMPLATE_AUDIO_REACTIVE,
|
|
217
|
-
},
|
|
218
|
-
transitions: {
|
|
219
|
-
description: "Scene transitions (fade, slide) between multiple scenes",
|
|
220
|
-
source: TEMPLATE_TRANSITIONS,
|
|
221
|
-
},
|
|
222
|
-
subtitles: {
|
|
223
|
-
description: "Video with SRT subtitle overlay",
|
|
224
|
-
source: TEMPLATE_SUBTITLES,
|
|
225
|
-
},
|
|
210
|
+
basic: { description: "Minimal composition with text animation and two scenes", source: TEMPLATE_BASIC },
|
|
211
|
+
"audio-reactive": { description: "Audio visualization with frequency bars", source: TEMPLATE_AUDIO_REACTIVE },
|
|
212
|
+
transitions: { description: "Scene transitions (fade, slide)", source: TEMPLATE_TRANSITIONS },
|
|
213
|
+
subtitles: { description: "Video with SRT subtitle overlay", source: TEMPLATE_SUBTITLES },
|
|
226
214
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
else if (arg.startsWith("--template=")) {
|
|
237
|
-
result.template = arg.slice("--template=".length);
|
|
238
|
-
}
|
|
239
|
-
else if (arg === "--help" || arg === "-h") {
|
|
240
|
-
printHelp();
|
|
241
|
-
process.exit(0);
|
|
242
|
-
}
|
|
243
|
-
else if (!arg.startsWith("-") && !result.name) {
|
|
244
|
-
result.name = arg;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
return result;
|
|
248
|
-
}
|
|
249
|
-
function printHelp() {
|
|
250
|
-
console.log(`
|
|
251
|
-
vibeo create - Create a new Vibeo project
|
|
252
|
-
|
|
253
|
-
Usage:
|
|
254
|
-
vibeo create <project-name> [options]
|
|
255
|
-
|
|
256
|
-
Options:
|
|
257
|
-
--template <name> Template to use (default: basic)
|
|
258
|
-
--help Show this help
|
|
259
|
-
|
|
260
|
-
Templates:`);
|
|
261
|
-
for (const [name, { description }] of Object.entries(TEMPLATES)) {
|
|
262
|
-
console.log(` ${name.padEnd(18)} ${description}`);
|
|
263
|
-
}
|
|
264
|
-
console.log(`
|
|
265
|
-
Examples:
|
|
266
|
-
vibeo create my-video
|
|
267
|
-
vibeo create music-viz --template audio-reactive
|
|
268
|
-
vibeo create intro --template transitions
|
|
269
|
-
`);
|
|
270
|
-
}
|
|
271
|
-
export async function createCommand(args) {
|
|
272
|
-
const parsed = parseArgs(args);
|
|
273
|
-
if (!parsed.name) {
|
|
274
|
-
console.error("Error: project name is required\n");
|
|
275
|
-
printHelp();
|
|
276
|
-
process.exit(1);
|
|
277
|
-
}
|
|
278
|
-
const template = TEMPLATES[parsed.template];
|
|
279
|
-
if (!template) {
|
|
280
|
-
console.error(`Error: unknown template "${parsed.template}"`);
|
|
281
|
-
console.error(`Available: ${Object.keys(TEMPLATES).join(", ")}`);
|
|
282
|
-
process.exit(1);
|
|
283
|
-
}
|
|
284
|
-
const projectDir = resolve(parsed.name);
|
|
285
|
-
if (existsSync(projectDir)) {
|
|
286
|
-
console.error(`Error: directory "${parsed.name}" already exists`);
|
|
287
|
-
process.exit(1);
|
|
288
|
-
}
|
|
289
|
-
console.log(`\nCreating Vibeo project: ${parsed.name}`);
|
|
290
|
-
console.log(`Template: ${parsed.template}\n`);
|
|
291
|
-
// Create project structure
|
|
215
|
+
export const TEMPLATE_NAMES = Object.keys(TEMPLATES);
|
|
216
|
+
export async function createProject(name, template) {
|
|
217
|
+
const tmpl = TEMPLATES[template];
|
|
218
|
+
if (!tmpl)
|
|
219
|
+
throw new Error(`Unknown template: ${template}`);
|
|
220
|
+
const projectDir = resolve(name);
|
|
221
|
+
if (existsSync(projectDir))
|
|
222
|
+
throw new Error(`Directory "${name}" already exists`);
|
|
292
223
|
await mkdir(join(projectDir, "src"), { recursive: true });
|
|
293
224
|
await mkdir(join(projectDir, "public"), { recursive: true });
|
|
294
|
-
|
|
295
|
-
await writeFile(join(projectDir, "src", "index.tsx"), template.source);
|
|
296
|
-
// Write package.json
|
|
225
|
+
await writeFile(join(projectDir, "src", "index.tsx"), tmpl.source);
|
|
297
226
|
const pkg = {
|
|
298
|
-
name
|
|
227
|
+
name,
|
|
299
228
|
version: "0.0.1",
|
|
300
229
|
private: true,
|
|
301
230
|
type: "module",
|
|
@@ -322,7 +251,6 @@ export async function createCommand(args) {
|
|
|
322
251
|
},
|
|
323
252
|
};
|
|
324
253
|
await writeFile(join(projectDir, "package.json"), JSON.stringify(pkg, null, 2) + "\n");
|
|
325
|
-
// Write tsconfig.json
|
|
326
254
|
const tsconfig = {
|
|
327
255
|
compilerOptions: {
|
|
328
256
|
target: "ES2022",
|
|
@@ -340,25 +268,8 @@ export async function createCommand(args) {
|
|
|
340
268
|
include: ["src"],
|
|
341
269
|
};
|
|
342
270
|
await writeFile(join(projectDir, "tsconfig.json"), JSON.stringify(tsconfig, null, 2) + "\n");
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
out/
|
|
347
|
-
*.tmp
|
|
348
|
-
.DS_Store
|
|
349
|
-
`);
|
|
350
|
-
console.log(` Created ${parsed.name}/`);
|
|
351
|
-
console.log(` ├── src/index.tsx`);
|
|
352
|
-
console.log(` ├── public/`);
|
|
353
|
-
console.log(` ├── package.json`);
|
|
354
|
-
console.log(` ├── tsconfig.json`);
|
|
355
|
-
console.log(` └── .gitignore`);
|
|
356
|
-
console.log(`
|
|
357
|
-
Next steps:
|
|
358
|
-
cd ${parsed.name}
|
|
359
|
-
bun install
|
|
360
|
-
bun run dev # preview in browser
|
|
361
|
-
bun run build # render to video
|
|
362
|
-
`);
|
|
271
|
+
await writeFile(join(projectDir, ".gitignore"), "node_modules/\ndist/\nout/\n*.tmp\n.DS_Store\n");
|
|
272
|
+
const files = ["src/index.tsx", "package.json", "tsconfig.json", ".gitignore", "public/"];
|
|
273
|
+
return { project: name, template, files };
|
|
363
274
|
}
|
|
364
275
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,8EAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CA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;YACZ,eAAe,EAAE,IAAI;YACrB,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI;SAChB;QACD,OAAO,EAAE,CAAC,KAAK,CAAC;KACjB,CAAC;IACF,MAAM,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAE7F,MAAM,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,gDAAgD,CAAC,CAAC;IAElG,MAAM,KAAK,GAAG,CAAC,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-skills.d.ts","sourceRoot":"","sources":["../../src/commands/install-skills.ts"],"names":[],"mappings":"AAsNA,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAuBlD;AAED,eAAO,MAAM,iBAAiB;;;GAG3B,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { join, dirname } from "node:path";
|
|
2
|
+
import { mkdir, writeFile, readFile } from "node:fs/promises";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Embedded skill content (so it works from npm without the skills/ dir)
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
async function loadSkills() {
|
|
9
|
+
// Try to load from the repo's skills/ directory first
|
|
10
|
+
const candidates = [
|
|
11
|
+
join(dirname(import.meta.url.replace("file://", "")), "../../../../skills"),
|
|
12
|
+
join(process.cwd(), "skills"),
|
|
13
|
+
];
|
|
14
|
+
for (const dir of candidates) {
|
|
15
|
+
const names = ["vibeo-core", "vibeo-audio", "vibeo-effects", "vibeo-extras", "vibeo-rendering"];
|
|
16
|
+
const skills = {};
|
|
17
|
+
let found = true;
|
|
18
|
+
for (const name of names) {
|
|
19
|
+
const path = join(dir, name, "SKILL.md");
|
|
20
|
+
if (existsSync(path)) {
|
|
21
|
+
skills[name] = await readFile(path, "utf-8");
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
found = false;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (found)
|
|
29
|
+
return skills;
|
|
30
|
+
}
|
|
31
|
+
// Fallback: generate a minimal combined skill from --llms-full output
|
|
32
|
+
return {
|
|
33
|
+
vibeo: getEmbeddedSkill(),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function getEmbeddedSkill() {
|
|
37
|
+
return `# Vibeo — React Video Framework
|
|
38
|
+
|
|
39
|
+
Vibeo is a React-based programmatic video framework. Write video compositions as React components, preview in the browser, and render to video with FFmpeg.
|
|
40
|
+
|
|
41
|
+
## Quick Reference
|
|
42
|
+
|
|
43
|
+
\`\`\`bash
|
|
44
|
+
# Get full CLI docs
|
|
45
|
+
bunx @vibeo/cli --llms-full
|
|
46
|
+
|
|
47
|
+
# Create a project
|
|
48
|
+
bunx @vibeo/cli create my-video --template basic
|
|
49
|
+
|
|
50
|
+
# Preview
|
|
51
|
+
bunx @vibeo/cli preview --entry src/index.tsx
|
|
52
|
+
|
|
53
|
+
# Render
|
|
54
|
+
bunx @vibeo/cli render --entry src/index.tsx --composition MyComp
|
|
55
|
+
|
|
56
|
+
# List compositions
|
|
57
|
+
bunx @vibeo/cli list --entry src/index.tsx
|
|
58
|
+
\`\`\`
|
|
59
|
+
|
|
60
|
+
## Packages
|
|
61
|
+
|
|
62
|
+
- \`@vibeo/core\` — Composition, Sequence, Loop, useCurrentFrame, useVideoConfig, interpolate, easing
|
|
63
|
+
- \`@vibeo/audio\` — Audio/Video components, 48kHz sync, volume curves, audio mixing
|
|
64
|
+
- \`@vibeo/effects\` — useKeyframes, useSpring, Transition (fade/wipe/slide/dissolve), useAudioData
|
|
65
|
+
- \`@vibeo/extras\` — Subtitle (SRT/VTT), AudioWaveform, AudioSpectrogram, SceneGraph, AudioMix
|
|
66
|
+
- \`@vibeo/player\` — Interactive Player component with controls
|
|
67
|
+
- \`@vibeo/renderer\` — Headless rendering via Playwright + FFmpeg
|
|
68
|
+
- \`@vibeo/cli\` — CLI with incur (supports --llms, --mcp, --schema)
|
|
69
|
+
|
|
70
|
+
## Core Pattern
|
|
71
|
+
|
|
72
|
+
\`\`\`tsx
|
|
73
|
+
import { Composition, Sequence, VibeoRoot, useCurrentFrame, useVideoConfig, interpolate } from "@vibeo/core";
|
|
74
|
+
|
|
75
|
+
function MyScene() {
|
|
76
|
+
const frame = useCurrentFrame();
|
|
77
|
+
const { width, height, fps } = useVideoConfig();
|
|
78
|
+
const opacity = interpolate(frame, [0, 30], [0, 1], { extrapolateRight: "clamp" });
|
|
79
|
+
return <div style={{ width, height, opacity }}>Hello</div>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function Root() {
|
|
83
|
+
return (
|
|
84
|
+
<VibeoRoot>
|
|
85
|
+
<Composition id="MyComp" component={MyScene} width={1920} height={1080} fps={30} durationInFrames={150} />
|
|
86
|
+
</VibeoRoot>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
## Key Math
|
|
92
|
+
|
|
93
|
+
- Frame to time: \`time = frame / fps\`
|
|
94
|
+
- Samples per frame (audio): \`(48000 * 2) / fps\`
|
|
95
|
+
- Media time with playback rate: uses interpolation with rate scaling
|
|
96
|
+
- Sequence relative frame: \`absoluteFrame - (cumulatedFrom + relativeFrom)\`
|
|
97
|
+
- Loop iteration: \`floor(currentFrame / durationInFrames)\`
|
|
98
|
+
|
|
99
|
+
For full API details, run \`bunx @vibeo/cli --llms-full\` or \`bunx @vibeo/cli <command> --schema\`.
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
const home = homedir();
|
|
103
|
+
const TARGETS = [
|
|
104
|
+
{
|
|
105
|
+
name: "claude",
|
|
106
|
+
description: "Claude Code (~/.claude/skills/ + project CLAUDE.md)",
|
|
107
|
+
async install(skills, cwd) {
|
|
108
|
+
const files = [];
|
|
109
|
+
// Global skills directory
|
|
110
|
+
const globalDir = join(home, ".claude", "skills");
|
|
111
|
+
await mkdir(globalDir, { recursive: true });
|
|
112
|
+
for (const [name, content] of Object.entries(skills)) {
|
|
113
|
+
const path = join(globalDir, `${name}.md`);
|
|
114
|
+
await writeFile(path, content);
|
|
115
|
+
files.push(path);
|
|
116
|
+
}
|
|
117
|
+
// Project-level .claude/skills/
|
|
118
|
+
const projectDir = join(cwd, ".claude", "skills");
|
|
119
|
+
await mkdir(projectDir, { recursive: true });
|
|
120
|
+
for (const [name, content] of Object.entries(skills)) {
|
|
121
|
+
const path = join(projectDir, `${name}.md`);
|
|
122
|
+
await writeFile(path, content);
|
|
123
|
+
files.push(path);
|
|
124
|
+
}
|
|
125
|
+
return files;
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "codex",
|
|
130
|
+
description: "OpenAI Codex CLI (project AGENTS.md)",
|
|
131
|
+
async install(skills, cwd) {
|
|
132
|
+
const combined = Object.values(skills).join("\n\n---\n\n");
|
|
133
|
+
const path = join(cwd, "AGENTS.md");
|
|
134
|
+
const header = "# Vibeo — Agent Instructions\n\nThis file is auto-generated by `vibeo install-skills`. It helps Codex CLI understand the Vibeo framework.\n\n";
|
|
135
|
+
await writeFile(path, header + combined);
|
|
136
|
+
return [path];
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "cursor",
|
|
141
|
+
description: "Cursor (.cursor/rules/*.mdc)",
|
|
142
|
+
async install(skills, cwd) {
|
|
143
|
+
const dir = join(cwd, ".cursor", "rules");
|
|
144
|
+
await mkdir(dir, { recursive: true });
|
|
145
|
+
const files = [];
|
|
146
|
+
for (const [name, content] of Object.entries(skills)) {
|
|
147
|
+
const mdcContent = `---\ndescription: ${name} skill for Vibeo video framework\nglobs: **/*.{ts,tsx}\nalwaysApply: false\n---\n\n${content}`;
|
|
148
|
+
const path = join(dir, `${name}.mdc`);
|
|
149
|
+
await writeFile(path, mdcContent);
|
|
150
|
+
files.push(path);
|
|
151
|
+
}
|
|
152
|
+
return files;
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "gemini",
|
|
157
|
+
description: "Gemini CLI (GEMINI.md)",
|
|
158
|
+
async install(skills, cwd) {
|
|
159
|
+
const combined = Object.values(skills).join("\n\n---\n\n");
|
|
160
|
+
const path = join(cwd, "GEMINI.md");
|
|
161
|
+
const header = "# Vibeo — Gemini Instructions\n\nThis file is auto-generated by `vibeo install-skills`. It helps Gemini CLI understand the Vibeo framework.\n\n";
|
|
162
|
+
await writeFile(path, header + combined);
|
|
163
|
+
return [path];
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "opencode",
|
|
168
|
+
description: "OpenCode (AGENTS.md)",
|
|
169
|
+
async install(skills, cwd) {
|
|
170
|
+
// OpenCode also reads AGENTS.md — same as codex, but we don't double-write
|
|
171
|
+
const path = join(cwd, "AGENTS.md");
|
|
172
|
+
if (existsSync(path))
|
|
173
|
+
return []; // Already written by codex target
|
|
174
|
+
const combined = Object.values(skills).join("\n\n---\n\n");
|
|
175
|
+
const header = "# Vibeo — Agent Instructions\n\nThis file is auto-generated by `vibeo install-skills`. It helps AI agents understand the Vibeo framework.\n\n";
|
|
176
|
+
await writeFile(path, header + combined);
|
|
177
|
+
return [path];
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "aider",
|
|
182
|
+
description: "Aider (.aider.conf.yml conventions file reference)",
|
|
183
|
+
async install(skills, cwd) {
|
|
184
|
+
const combined = Object.values(skills).join("\n\n---\n\n");
|
|
185
|
+
const path = join(cwd, ".aider.vibeo.md");
|
|
186
|
+
await writeFile(path, combined);
|
|
187
|
+
return [path];
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
];
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
// Public API
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
export async function installSkills(targets, cwd) {
|
|
195
|
+
const skills = await loadSkills();
|
|
196
|
+
const installed = {};
|
|
197
|
+
const selectedTargets = targets.length === 0
|
|
198
|
+
? TARGETS // all
|
|
199
|
+
: TARGETS.filter((t) => targets.includes(t.name));
|
|
200
|
+
if (selectedTargets.length === 0) {
|
|
201
|
+
throw new Error(`No matching targets. Available: ${TARGETS.map((t) => t.name).join(", ")}`);
|
|
202
|
+
}
|
|
203
|
+
for (const target of selectedTargets) {
|
|
204
|
+
const files = await target.install(skills, cwd);
|
|
205
|
+
if (files.length > 0) {
|
|
206
|
+
installed[target.name] = files;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return { installed };
|
|
210
|
+
}
|
|
211
|
+
export const AVAILABLE_TARGETS = TARGETS.map((t) => ({
|
|
212
|
+
name: t.name,
|
|
213
|
+
description: t.description,
|
|
214
|
+
}));
|
|
215
|
+
//# sourceMappingURL=install-skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-skills.js","sourceRoot":"","sources":["../../src/commands/install-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MA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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface CompositionMeta {
|
|
2
|
+
id: string;
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
fps: number;
|
|
6
|
+
durationInFrames: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function listCompositions(entry: string): Promise<CompositionMeta[]>;
|
|
9
|
+
export {};
|
|
6
10
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAGA,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA4BhF"}
|
package/dist/commands/list.js
CHANGED
|
@@ -1,62 +1,13 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
1
|
import { bundle } from "@vibeo/renderer";
|
|
3
2
|
import { launchBrowser, createPage, closeBrowser } from "@vibeo/renderer";
|
|
4
|
-
function
|
|
5
|
-
const result = {
|
|
6
|
-
entry: "",
|
|
7
|
-
};
|
|
8
|
-
for (let i = 0; i < args.length; i++) {
|
|
9
|
-
const arg = args[i];
|
|
10
|
-
const next = args[i + 1];
|
|
11
|
-
if (arg === "--entry" && next) {
|
|
12
|
-
result.entry = next;
|
|
13
|
-
i++;
|
|
14
|
-
}
|
|
15
|
-
else if (arg.startsWith("--entry=")) {
|
|
16
|
-
result.entry = arg.slice("--entry=".length);
|
|
17
|
-
}
|
|
18
|
-
else if (arg === "--help" || arg === "-h") {
|
|
19
|
-
printHelp();
|
|
20
|
-
process.exit(0);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
function printHelp() {
|
|
26
|
-
console.log(`
|
|
27
|
-
vibeo list - List registered compositions
|
|
28
|
-
|
|
29
|
-
Usage:
|
|
30
|
-
vibeo list --entry <path>
|
|
31
|
-
|
|
32
|
-
Required:
|
|
33
|
-
--entry <path> Path to the root file with compositions
|
|
34
|
-
|
|
35
|
-
Options:
|
|
36
|
-
--help Show this help
|
|
37
|
-
`);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Bundle the entry, launch a browser to evaluate it,
|
|
41
|
-
* extract registered compositions, and print a table.
|
|
42
|
-
*/
|
|
43
|
-
export async function listCommand(args) {
|
|
44
|
-
const parsed = parseArgs(args);
|
|
45
|
-
if (!parsed.entry) {
|
|
46
|
-
console.error("Error: --entry is required");
|
|
47
|
-
printHelp();
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
const entry = resolve(parsed.entry);
|
|
3
|
+
export async function listCompositions(entry) {
|
|
51
4
|
console.log(`Bundling ${entry}...`);
|
|
52
5
|
const bundleResult = await bundle(entry);
|
|
53
6
|
try {
|
|
54
7
|
const browser = await launchBrowser();
|
|
55
8
|
const page = await createPage(browser, 1920, 1080);
|
|
56
9
|
await page.goto(bundleResult.url, { waitUntil: "networkidle" });
|
|
57
|
-
// Wait briefly for React to register compositions
|
|
58
10
|
await page.waitForTimeout(2000);
|
|
59
|
-
// Extract composition data from the page
|
|
60
11
|
const compositions = await page.evaluate(() => {
|
|
61
12
|
const win = window;
|
|
62
13
|
if (typeof win.vibeo_getCompositions === "function") {
|
|
@@ -66,36 +17,10 @@ export async function listCommand(args) {
|
|
|
66
17
|
});
|
|
67
18
|
await page.close();
|
|
68
19
|
await closeBrowser();
|
|
69
|
-
|
|
70
|
-
console.log("\nNo compositions found.");
|
|
71
|
-
console.log("Make sure your entry file exports compositions via <Composition /> components.");
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
// Print table
|
|
75
|
-
console.log("\nRegistered compositions:\n");
|
|
76
|
-
console.log(padRight("ID", 25) +
|
|
77
|
-
padRight("Width", 8) +
|
|
78
|
-
padRight("Height", 8) +
|
|
79
|
-
padRight("FPS", 6) +
|
|
80
|
-
padRight("Frames", 8) +
|
|
81
|
-
"Duration");
|
|
82
|
-
console.log("-".repeat(70));
|
|
83
|
-
for (const comp of compositions) {
|
|
84
|
-
const duration = (comp.durationInFrames / comp.fps).toFixed(1) + "s";
|
|
85
|
-
console.log(padRight(comp.id, 25) +
|
|
86
|
-
padRight(String(comp.width), 8) +
|
|
87
|
-
padRight(String(comp.height), 8) +
|
|
88
|
-
padRight(String(comp.fps), 6) +
|
|
89
|
-
padRight(String(comp.durationInFrames), 8) +
|
|
90
|
-
duration);
|
|
91
|
-
}
|
|
92
|
-
console.log();
|
|
20
|
+
return compositions;
|
|
93
21
|
}
|
|
94
22
|
finally {
|
|
95
23
|
await bundleResult.cleanup();
|
|
96
24
|
}
|
|
97
25
|
}
|
|
98
|
-
function padRight(str, len) {
|
|
99
|
-
return str.length >= len ? str : str + " ".repeat(len - str.length);
|
|
100
|
-
}
|
|
101
26
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU1E,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAa;IAClD,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,KAAK,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC;IAEzC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,aAAa,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAEnD,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;QAChE,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAEhC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC5C,MAAM,GAAG,GAAG,MAEX,CAAC;YACF,IAAI,OAAO,GAAG,CAAC,qBAAqB,KAAK,UAAU,EAAE,CAAC;gBACpD,OAAO,GAAG,CAAC,qBAAqB,EAAE,CAAC;YACrC,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,YAAY,EAAE,CAAC;QAErB,OAAO,YAAY,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,MAAM,YAAY,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/commands/preview.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/commands/preview.ts"],"names":[],"mappings":"AAEA,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB9E"}
|
package/dist/commands/preview.js
CHANGED
|
@@ -1,66 +1,10 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
1
|
import { bundle } from "@vibeo/renderer";
|
|
3
|
-
function
|
|
4
|
-
const result = {
|
|
5
|
-
entry: "",
|
|
6
|
-
port: 3000,
|
|
7
|
-
};
|
|
8
|
-
for (let i = 0; i < args.length; i++) {
|
|
9
|
-
const arg = args[i];
|
|
10
|
-
const next = args[i + 1];
|
|
11
|
-
if (arg === "--entry" && next) {
|
|
12
|
-
result.entry = next;
|
|
13
|
-
i++;
|
|
14
|
-
}
|
|
15
|
-
else if (arg.startsWith("--entry=")) {
|
|
16
|
-
result.entry = arg.slice("--entry=".length);
|
|
17
|
-
}
|
|
18
|
-
else if (arg === "--port" && next) {
|
|
19
|
-
result.port = parseInt(next, 10);
|
|
20
|
-
i++;
|
|
21
|
-
}
|
|
22
|
-
else if (arg.startsWith("--port=")) {
|
|
23
|
-
result.port = parseInt(arg.slice("--port=".length), 10);
|
|
24
|
-
}
|
|
25
|
-
else if (arg === "--help" || arg === "-h") {
|
|
26
|
-
printHelp();
|
|
27
|
-
process.exit(0);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
function printHelp() {
|
|
33
|
-
console.log(`
|
|
34
|
-
vibeo preview - Start a dev server with live preview
|
|
35
|
-
|
|
36
|
-
Usage:
|
|
37
|
-
vibeo preview --entry <path> [options]
|
|
38
|
-
|
|
39
|
-
Required:
|
|
40
|
-
--entry <path> Path to the root file with compositions
|
|
41
|
-
|
|
42
|
-
Options:
|
|
43
|
-
--port <number> Port for the dev server (default: 3000)
|
|
44
|
-
--help Show this help
|
|
45
|
-
`);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Start a dev server hosting the Player with hot reload.
|
|
49
|
-
*/
|
|
50
|
-
export async function previewCommand(args) {
|
|
51
|
-
const parsed = parseArgs(args);
|
|
52
|
-
if (!parsed.entry) {
|
|
53
|
-
console.error("Error: --entry is required");
|
|
54
|
-
printHelp();
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
const entry = resolve(parsed.entry);
|
|
2
|
+
export async function startPreview(entry, _port) {
|
|
58
3
|
console.log(`Starting preview server...`);
|
|
59
4
|
console.log(` Entry: ${entry}`);
|
|
60
5
|
const bundleResult = await bundle(entry);
|
|
61
6
|
console.log(`\n Preview running at ${bundleResult.url}`);
|
|
62
7
|
console.log(` Press Ctrl+C to stop\n`);
|
|
63
|
-
// Keep the process alive until interrupted
|
|
64
8
|
const shutdown = async () => {
|
|
65
9
|
console.log("\nShutting down preview server...");
|
|
66
10
|
await bundleResult.cleanup();
|