@esquadrao/cli 1.7.0 → 1.8.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.md +18 -7
- package/assets/broll-catalog.json +11905 -0
- package/bin/cli.js +5 -0
- package/package.json +5 -4
- package/scripts/cutout.py +83 -15
- package/scripts/dag_validator.js +38 -3
- package/scripts/lint.js +47 -7
- package/scripts/merkle_verify.js +6 -1
- package/skill-media-producer/SKILL.md +2 -0
- package/skill-media-producer/references/composicoes-especiais.md +4 -4
- package/skill-media-producer/references/configuracao-inicial.md +26 -12
- package/skill-media-producer/references/llm-agent-guide.md +4 -8
- package/src/binaries.js +74 -0
- package/src/captionTemplates.js +2 -1
- package/src/commands/onboard.js +7 -16
- package/src/commands/setup.js +22 -20
package/src/commands/setup.js
CHANGED
|
@@ -3,6 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { execSync } from 'node:child_process';
|
|
6
|
+
import { ensureBundledPath, binaryReport } from '../binaries.js';
|
|
6
7
|
|
|
7
8
|
function checkBinary(name) {
|
|
8
9
|
try {
|
|
@@ -14,20 +15,11 @@ function checkBinary(name) {
|
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
// Zero config: o ffmpeg vem como optionalDependency do pacote. Nada de brew,
|
|
19
|
+
// winget ou sudo; apenas expomos os binários no PATH do processo.
|
|
17
20
|
export function tryAutoInstallFfmpeg() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (process.platform === 'darwin') {
|
|
21
|
-
execSync('brew install ffmpeg', { stdio: 'ignore', timeout: 60000 });
|
|
22
|
-
} else if (process.platform === 'win32') {
|
|
23
|
-
execSync('winget install Gyan.FFmpeg --accept-package-agreements --accept-source-agreements', { stdio: 'ignore', timeout: 60000 });
|
|
24
|
-
} else {
|
|
25
|
-
execSync('which apt-get && (apt-get update -qq && apt-get install -y -qq ffmpeg) || sudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg', { stdio: 'ignore', timeout: 60000 });
|
|
26
|
-
}
|
|
27
|
-
return checkBinary('ffmpeg') && checkBinary('ffprobe');
|
|
28
|
-
} catch {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
21
|
+
ensureBundledPath();
|
|
22
|
+
return checkBinary('ffmpeg') && checkBinary('ffprobe');
|
|
31
23
|
}
|
|
32
24
|
|
|
33
25
|
const SKILLS = [
|
|
@@ -64,6 +56,14 @@ export async function run({ positionals = [], flags = {} } = {}) {
|
|
|
64
56
|
const destDir = destArg || path.join(cwd, '.agents', 'skills');
|
|
65
57
|
|
|
66
58
|
fs.mkdirSync(destDir, { recursive: true });
|
|
59
|
+
// RAG local: o catálogo semântico vai para o workspace, separado das skills.
|
|
60
|
+
const workspaceDir = destArg ? path.resolve(destArg) : cwd;
|
|
61
|
+
const catalogSrc = path.join(rootDir, 'assets', 'broll-catalog.json');
|
|
62
|
+
const catalogDest = path.join(workspaceDir, '.esquadrao', 'broll-catalog.json');
|
|
63
|
+
if (fs.existsSync(catalogSrc)) {
|
|
64
|
+
fs.mkdirSync(path.dirname(catalogDest), { recursive: true });
|
|
65
|
+
fs.copyFileSync(catalogSrc, catalogDest);
|
|
66
|
+
}
|
|
67
67
|
const installed = [];
|
|
68
68
|
for (const item of [...SKILLS, 'scripts']) {
|
|
69
69
|
const src = path.join(rootDir, item);
|
|
@@ -143,17 +143,14 @@ export async function run({ positionals = [], flags = {} } = {}) {
|
|
|
143
143
|
const nodeOk = nodeMajor >= 18;
|
|
144
144
|
|
|
145
145
|
let hasFfmpeg = checkBinary('ffmpeg') && checkBinary('ffprobe');
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
autoInstalledFfmpeg = tryAutoInstallFfmpeg();
|
|
149
|
-
hasFfmpeg = checkBinary('ffmpeg') && checkBinary('ffprobe');
|
|
150
|
-
}
|
|
146
|
+
if (!hasFfmpeg) hasFfmpeg = tryAutoInstallFfmpeg();
|
|
147
|
+
const binaries = binaryReport();
|
|
151
148
|
|
|
152
149
|
const report = {
|
|
153
150
|
status: nodeOk ? 'ok' : 'degraded',
|
|
154
151
|
prerequisites: {
|
|
155
152
|
node: { version: process.version, valid: nodeOk },
|
|
156
|
-
ffmpeg: { valid: hasFfmpeg,
|
|
153
|
+
ffmpeg: { valid: hasFfmpeg, source: binaries.ffmpeg.source }
|
|
157
154
|
},
|
|
158
155
|
installation: { destination: destDir, installed },
|
|
159
156
|
harnesses,
|
|
@@ -164,7 +161,12 @@ export async function run({ positionals = [], flags = {} } = {}) {
|
|
|
164
161
|
} else {
|
|
165
162
|
console.log(`Esquadrão Setup: ${report.status.toUpperCase()}`);
|
|
166
163
|
console.log(`- Node.js: ${process.version} (${nodeOk ? 'OK' : 'Requires >= 18'})`);
|
|
167
|
-
|
|
164
|
+
const ffmpegLabel = !hasFfmpeg
|
|
165
|
+
? 'indisponível (rode "npm install" novamente para restaurar o binário embutido)'
|
|
166
|
+
: binaries.ffmpeg.source === 'bundled'
|
|
167
|
+
? 'embutido no pacote (nada a instalar)'
|
|
168
|
+
: 'OK (binário do sistema)';
|
|
169
|
+
console.log(`- FFmpeg & ffprobe: ${ffmpegLabel}`);
|
|
168
170
|
console.log(`- Installed ${installed.length} items to ${destDir}`);
|
|
169
171
|
if (harnesses.length) console.log(`- Harnesses detected: ${harnesses.join(', ')}`);
|
|
170
172
|
}
|