@aixcut/vibevideo 0.1.0-beta.0 → 0.1.0-beta.1

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 (26) hide show
  1. package/README.md +35 -5
  2. package/dist/skills/vibevideo/SKILL.md +75 -0
  3. package/dist/skills/vibevideo/assets/pixi/01-kinetic-title.mjs +76 -0
  4. package/dist/skills/vibevideo/assets/pixi/02-flow-map.mjs +76 -0
  5. package/dist/skills/vibevideo/assets/pixi/03-nested-board.mjs +69 -0
  6. package/dist/skills/vibevideo/assets/pixi/04-compact-callout.mjs +40 -0
  7. package/dist/skills/vibevideo/assets/pixi/README.md +11 -0
  8. package/dist/skills/vibevideo/references/authoring.md +160 -0
  9. package/dist/skills/vibevideo/references/editing-and-reload.md +99 -0
  10. package/dist/skills/vibevideo/references/editor-connection.md +44 -0
  11. package/dist/skills/vibevideo/references/examples.md +230 -0
  12. package/dist/skills/vibevideo/references/graphic-workflow.md +167 -0
  13. package/dist/skills/vibevideo/references/hevc-encoder.md +12 -0
  14. package/dist/skills/vibevideo/references/runtime-api.md +211 -0
  15. package/dist/skills/vibevideo/references/validation.md +109 -0
  16. package/dist/skills/vibevideo-cli/SKILL.md +86 -0
  17. package/dist/skills/vibevideo-cli/references/agent-protocol.md +39 -0
  18. package/dist/skills-manifest.json +14 -0
  19. package/dist/studio/assets/{browserAll-wERvpUP9.js → browserAll-0i6gm1iO.js} +1 -1
  20. package/dist/studio/assets/{index-bnkX1rLy.js → index-DqX5Prpj.js} +3 -3
  21. package/dist/studio/assets/{prores-encoder-mediabunny-hm5PQfLy.js → prores-encoder-mediabunny-DjdaA3bm.js} +2 -2
  22. package/dist/studio/assets/{webworkerAll-Baf-n-Bc.js → webworkerAll-Xo9FRLTy.js} +1 -1
  23. package/dist/studio/index.html +1 -1
  24. package/package.json +1 -1
  25. package/src/cli.mjs +30 -3
  26. package/src/skills.mjs +110 -0
@@ -1,4 +1,4 @@
1
- import{D as w,c as L,u as S,w as U,B as N,f as re,g as O,h as C,S as Le,v as ce,n as he,i as de,G as Ue,M as Se,j as T,b as I,k as M,e as Ce}from"./index-bnkX1rLy.js";const $=Object.create(null),fe=Object.create(null);function W(s,e){let t=fe[s];return t===void 0&&($[e]===void 0&&($[e]=1),fe[s]=t=$[e]++),t}function ae(s){return s.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm,"")}const pe=new RegExp("(?:layout\\s*\\(\\s*location\\s*=\\s*(\\d+)\\s*\\)\\s*)?\\bout\\s+(?:(?:highp|mediump|lowp)\\s+)?\\w+\\s+\\w+\\s*(?:\\[\\s*(\\d+)\\s*\\])?\\s*;","g");function Ne(s){if(!s.includes("#version 300 es"))return s.includes("gl_FragData")?null:1;const e=ae(s);let t=0,r;for(;(r=pe.exec(e))!==null;){const i=r[1]===void 0?0:parseInt(r[1],10),n=r[2]===void 0?1:parseInt(r[2],10);t|=(1<<n)-1<<i}return pe.lastIndex=0,t||(/\bout\b/.test(e)?null:0)}let E;function We(){return(!E||E!=null&&E.isContextLost())&&(E=w.get().createCanvas().getContext("webgl",{})),E}let G;function $e(){if(!G){G="mediump";const s=We();s&&s.getShaderPrecisionFormat&&(G=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision?"highp":"mediump")}return G}function He(s,e,t){return e?s:t?(s=s.replace("out vec4 finalColor;",""),`
1
+ import{D as w,c as L,u as S,w as U,B as N,f as re,g as O,h as C,S as Le,v as ce,n as he,i as de,G as Ue,M as Se,j as T,b as I,k as M,e as Ce}from"./index-DqX5Prpj.js";const $=Object.create(null),fe=Object.create(null);function W(s,e){let t=fe[s];return t===void 0&&($[e]===void 0&&($[e]=1),fe[s]=t=$[e]++),t}function ae(s){return s.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm,"")}const pe=new RegExp("(?:layout\\s*\\(\\s*location\\s*=\\s*(\\d+)\\s*\\)\\s*)?\\bout\\s+(?:(?:highp|mediump|lowp)\\s+)?\\w+\\s+\\w+\\s*(?:\\[\\s*(\\d+)\\s*\\])?\\s*;","g");function Ne(s){if(!s.includes("#version 300 es"))return s.includes("gl_FragData")?null:1;const e=ae(s);let t=0,r;for(;(r=pe.exec(e))!==null;){const i=r[1]===void 0?0:parseInt(r[1],10),n=r[2]===void 0?1:parseInt(r[2],10);t|=(1<<n)-1<<i}return pe.lastIndex=0,t||(/\bout\b/.test(e)?null:0)}let E;function We(){return(!E||E!=null&&E.isContextLost())&&(E=w.get().createCanvas().getContext("webgl",{})),E}let G;function $e(){if(!G){G="mediump";const s=We();s&&s.getShaderPrecisionFormat&&(G=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision?"highp":"mediump")}return G}function He(s,e,t){return e?s:t?(s=s.replace("out vec4 finalColor;",""),`
2
2
 
3
3
  #ifdef GL_ES // This checks if it is WebGL1
4
4
  #define in varying
@@ -1,4 +1,4 @@
1
1
  <!doctype html>
2
- <html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Vibevideo Studio</title> <script type="module" crossorigin src="/assets/index-bnkX1rLy.js"></script>
2
+ <html lang="zh-CN"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Vibevideo Studio</title> <script type="module" crossorigin src="/assets/index-DqX5Prpj.js"></script>
3
3
  <link rel="stylesheet" crossorigin href="/assets/index-NSprgeey.css">
4
4
  </head><body><div id="app"></div></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aixcut/vibevideo",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.0-beta.1",
4
4
  "description": "Local video studio for editable HTML, PixiJS and Three.js graphics",
5
5
  "type": "module",
6
6
  "bin": { "vibevideo": "bin/vibevideo.mjs" },
package/src/cli.mjs CHANGED
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url';
6
6
  import { parseArgs } from 'node:util';
7
7
  import { startServer } from './server.mjs';
8
8
  import { initProject, validateProject } from './project.mjs';
9
+ import { runSkills } from './skills.mjs';
9
10
 
10
11
  const root = fileURLToPath(new URL('../', import.meta.url));
11
12
  const help = `Vibevideo — local video studio
@@ -15,6 +16,7 @@ const help = `Vibevideo — local video studio
15
16
  vibevideo open <directory> Open an existing project (autosaves)
16
17
  vibevideo doctor Check Node and packaged resources
17
18
  vibevideo agent <type> Send a Studio command
19
+ vibevideo skills install|check|update Manage bundled agent Skills
18
20
 
19
21
  Options:
20
22
  --port <number> Local port (default: automatically selected)
@@ -24,6 +26,9 @@ Options:
24
26
  --seconds <number> Time for agent seek
25
27
  --command <file> JSON command for agent scene/object/update
26
28
  --json Machine-readable result
29
+ --agent <name> Skills target: codex, claude, cursor, universal
30
+ --dir <directory> Explicit Skills destination
31
+ --skip-skills Skip missing Skills installation during init
27
32
  --version, --help
28
33
 
29
34
  The server stays in the foreground. Press Ctrl+C to stop.
@@ -66,7 +71,8 @@ async function agent(type, values) {
66
71
  }
67
72
  export async function main(args) {
68
73
  const { values, positionals } = parseArgs({ args, allowPositionals: true, options: {
69
- help: { type: 'boolean' }, version: { type: 'boolean' }, json: { type: 'boolean' }, 'no-open': { type: 'boolean' },
74
+ help: { type: 'boolean' }, version: { type: 'boolean' }, json: { type: 'boolean' }, 'no-open': { type: 'boolean' }, 'skip-skills': { type: 'boolean' },
75
+ agent: { type: 'string' }, dir: { type: 'string' },
70
76
  port: { type: 'string' }, session: { type: 'string' }, file: { type: 'string' }, seconds: { type: 'string' }, command: { type: 'string' },
71
77
  } });
72
78
  const print = value => console.log(JSON.stringify(value, null, values.json ? 0 : 2));
@@ -74,9 +80,22 @@ export async function main(args) {
74
80
  const pkg = JSON.parse(await readFile(path.join(root, 'package.json'), 'utf8'));
75
81
  if (values.version) { console.log(pkg.version); return; }
76
82
  const command = positionals[0] ?? 'studio';
83
+ if (command === 'skills') {
84
+ if (positionals.length > 2) throw new Error('Use skills install, check, or update');
85
+ const result = await runSkills({ root, version: pkg.version, action: positionals[1] ?? 'install', agent: values.agent, dir: values.dir });
86
+ if (values.json) print(result);
87
+ else {
88
+ console.log(`Skills for Vibevideo ${result.version}`);
89
+ for (const skill of result.skills) console.log(`${skill.name}: ${skill.status} (${skill.directory})`);
90
+ if (!result.ok) console.error('Missing/outdated Skills need install/update. Local edits and unmanaged folders are preserved; review them or select another destination with --dir.');
91
+ else if (result.skills.some(s => ['installed', 'updated'].includes(s.status))) console.error('Restart or refresh your coding agent to discover the installed Skills.');
92
+ }
93
+ if (!result.ok) process.exitCode = 1;
94
+ return;
95
+ }
77
96
  if (command === 'agent') { print(await agent(positionals[1], values)); return; }
78
97
  if (command === 'doctor') {
79
- const checks = await Promise.all(['dist/studio/index.html', 'dist/studio/sandbox-runtime.js', 'dist/project-template.json'].map(async file => ({ name: file, ok: await access(path.join(root, file)).then(() => true, () => false) })));
98
+ const checks = await Promise.all(['dist/studio/index.html', 'dist/studio/sandbox-runtime.js', 'dist/project-template.json', 'dist/skills-manifest.json', 'dist/skills/vibevideo/SKILL.md', 'dist/skills/vibevideo-cli/SKILL.md'].map(async file => ({ name: file, ok: await access(path.join(root, file)).then(() => true, () => false) })));
80
99
  checks.unshift({ name: 'Node.js >=22', ok: Number(process.versions.node.split('.')[0]) >= 22 });
81
100
  print({ ok: checks.every(c => c.ok), version: pkg.version, checks, browser: 'Use current Chrome or Edge; codec support is detected during export.' });
82
101
  if (!checks.every(c => c.ok)) process.exitCode = 1;
@@ -89,7 +108,15 @@ export async function main(args) {
89
108
  if (command !== 'studio') {
90
109
  if (!positionals[1]) throw new Error(`${command} requires a project directory`);
91
110
  project = path.resolve(positionals[1]);
92
- if (command === 'init') await initProject(project, JSON.parse(await readFile(path.join(root, 'dist/project-template.json'), 'utf8')));
111
+ if (command === 'init') {
112
+ await initProject(project, JSON.parse(await readFile(path.join(root, 'dist/project-template.json'), 'utf8')));
113
+ if (!values['skip-skills']) {
114
+ try {
115
+ const result = await runSkills({ root, version: pkg.version, action: 'install', agent: values.agent, dir: values.dir });
116
+ console.error(result.ok ? 'Core Skills are installed. Refresh your coding agent if newly installed.' : 'Existing Skills were preserved. Use skills check to review version differences or local edits.');
117
+ } catch (error) { console.error(`Project created; Skills installation was skipped: ${error.message}. Run skills install to retry.`); }
118
+ }
119
+ }
93
120
  await validateProject(project);
94
121
  }
95
122
  const server = await startServer({ studio: path.join(root, 'dist/studio'), project, port });
package/src/skills.mjs ADDED
@@ -0,0 +1,110 @@
1
+ import { createHash, randomUUID } from 'node:crypto';
2
+ import { cp, lstat, mkdir, readFile, readdir, rename, rm, writeFile } from 'node:fs/promises';
3
+ import { existsSync } from 'node:fs';
4
+ import { homedir } from 'node:os';
5
+ import path from 'node:path';
6
+
7
+ const names = ['vibevideo', 'vibevideo-cli'];
8
+ const receiptName = '.vibevideo-install.json';
9
+ const info = file => lstat(file).catch(error => { if (error.code === 'ENOENT') return null; throw error; });
10
+
11
+ async function hashDirectory(directory) {
12
+ const hash = createHash('sha256');
13
+ async function walk(folder, prefix = '') {
14
+ const entries = await readdir(folder, { withFileTypes: true });
15
+ for (const entry of entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
16
+ if (!prefix && entry.name === receiptName) continue;
17
+ const relative = prefix ? `${prefix}/${entry.name}` : entry.name;
18
+ const file = path.join(folder, entry.name);
19
+ if (entry.isSymbolicLink()) throw new Error(`Skill symlinks are not supported: ${relative}`);
20
+ if (entry.isDirectory()) await walk(file, relative);
21
+ else if (entry.isFile()) {
22
+ hash.update(relative); hash.update('\0');
23
+ hash.update(createHash('sha256').update(await readFile(file)).digest());
24
+ } else throw new Error(`Unsupported skill file: ${relative}`);
25
+ }
26
+ }
27
+ await walk(directory);
28
+ return hash.digest('hex');
29
+ }
30
+
31
+ export async function buildSkillsManifest(bundle, version) {
32
+ return { schema: 1, version, skills: await Promise.all(names.map(async name => ({ name, hash: await hashDirectory(path.join(bundle, name)) }))) };
33
+ }
34
+
35
+ export function skillTargets({ agent, dir, home = homedir(), codexHome = process.env.CODEX_HOME } = {}) {
36
+ if (dir && agent) throw new Error('Use either --dir or --agent, not both');
37
+ if (dir) return [path.resolve(dir)];
38
+ const locations = {
39
+ universal: path.join(home, '.agents/skills'),
40
+ codex: path.join(codexHome ? path.resolve(codexHome) : path.join(home, '.codex'), 'skills'),
41
+ claude: path.join(home, '.claude/skills'),
42
+ cursor: path.join(home, '.cursor/skills'),
43
+ };
44
+ if (agent) {
45
+ if (!Object.hasOwn(locations, agent)) throw new Error(`Unknown agent: ${agent}. Choose universal, codex, claude, or cursor.`);
46
+ return [locations[agent]];
47
+ }
48
+ // Use the shared store plus agent configurations already present on this machine.
49
+ return [...new Set([locations.universal, ...Object.entries(locations).filter(([name, value]) => name !== 'universal' && existsSync(path.dirname(value))).map(([, value]) => value)])];
50
+ }
51
+
52
+ async function installedState(directory, expected) {
53
+ const details = await info(directory);
54
+ if (!details) return { status: 'missing' };
55
+ if (!details.isDirectory() || details.isSymbolicLink()) return { status: 'unmanaged' };
56
+ let actual;
57
+ try { actual = await hashDirectory(directory); }
58
+ catch { return { status: 'unmanaged' }; }
59
+ if (actual === expected.hash) return { status: 'current', actual };
60
+ let receipt;
61
+ try { receipt = JSON.parse(await readFile(path.join(directory, receiptName), 'utf8')); }
62
+ catch { return { status: 'unmanaged', actual }; }
63
+ if (receipt.package !== '@aixcut/vibevideo' || receipt.name !== expected.name) return { status: 'unmanaged', actual };
64
+ return { status: actual === receipt.hash ? 'outdated' : 'locally-modified', actual };
65
+ }
66
+
67
+ export async function manageSkills({ action, bundle, manifest, targets }) {
68
+ if (!['install', 'check', 'update'].includes(action)) throw new Error('Use skills install, check, or update');
69
+ if (manifest.schema !== 1 || !manifest.version || manifest.skills?.length !== names.length || !names.every(name => manifest.skills.some(s => s.name === name && /^[a-f0-9]{64}$/.test(s.hash)))) throw new Error('Invalid bundled skills manifest; reinstall the CLI');
70
+ // Validate all shipped resources before making any changes to user configuration.
71
+ for (const entry of manifest.skills) {
72
+ if (await hashDirectory(path.join(bundle, entry.name)) !== entry.hash) throw new Error(`Bundled skill is incomplete or changed: ${entry.name}`);
73
+ }
74
+ const results = [];
75
+ for (const target of targets) {
76
+ const rootInfo = await info(target);
77
+ if (rootInfo && (!rootInfo.isDirectory() || rootInfo.isSymbolicLink())) throw new Error(`Skill destination must be a real directory: ${target}`);
78
+ if (action !== 'check') await mkdir(target, { recursive: true });
79
+ for (const entry of manifest.skills) {
80
+ const destination = path.join(target, entry.name);
81
+ const state = await installedState(destination, entry);
82
+ const result = { name: entry.name, directory: destination, status: state.status };
83
+ const shouldWrite = action !== 'check' && (state.status === 'missing' || (action === 'update' && state.status === 'outdated'));
84
+ if (shouldWrite) {
85
+ const temporary = path.join(target, `.vibevideo-install-${randomUUID()}`);
86
+ const backup = path.join(target, `.vibevideo-backup-${randomUUID()}`);
87
+ let moved = false;
88
+ try {
89
+ await cp(path.join(bundle, entry.name), temporary, { recursive: true, errorOnExist: true, force: false });
90
+ await writeFile(path.join(temporary, receiptName), JSON.stringify({ package: '@aixcut/vibevideo', name: entry.name, version: manifest.version, hash: entry.hash }));
91
+ const latest = await installedState(destination, entry);
92
+ if (latest.status !== state.status || latest.actual !== state.actual) throw new Error(`Skill changed during installation: ${destination}`);
93
+ if (state.status !== 'missing') { await rename(destination, backup); moved = true; }
94
+ try { await rename(temporary, destination); }
95
+ catch (error) { if (moved) { await rename(backup, destination); moved = false; } throw error; }
96
+ if (moved) await rm(backup, { recursive: true });
97
+ result.status = state.status === 'missing' ? 'installed' : 'updated';
98
+ } finally { await rm(temporary, { recursive: true, force: true }); }
99
+ }
100
+ results.push(result);
101
+ }
102
+ }
103
+ return { ok: results.every(s => ['current', 'installed', 'updated'].includes(s.status)), version: manifest.version, skills: results };
104
+ }
105
+
106
+ export async function runSkills({ root, version, action = 'install', agent, dir }) {
107
+ const manifest = JSON.parse(await readFile(path.join(root, 'dist/skills-manifest.json'), 'utf8'));
108
+ if (manifest.version !== version) throw new Error('Skills and CLI versions differ; rebuild or reinstall the CLI');
109
+ return manageSkills({ action, manifest, bundle: path.join(root, 'dist/skills'), targets: skillTargets({ agent, dir }) });
110
+ }