maestro-bundle 1.2.0 → 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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.mjs +29 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maestro-bundle",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Instala bundles de governança para projetos com AI agents. Um comando, tudo configurado.",
5
5
  "bin": {
6
6
  "maestro-bundle": "./src/cli.mjs"
package/src/cli.mjs CHANGED
@@ -332,30 +332,33 @@ async function main() {
332
332
  const primaryEditor = editorsToInstall[0];
333
333
  const aiFlag = aiFlags[primaryEditor] || "claude";
334
334
 
335
- // 4a. Instalar specify-cli se não tiver
336
- const spinner4 = ora("Verificando GitHub Spec Kit (specify-cli)").start();
335
+ // 4a. Instalar specify-cli
336
+ const SPECKIT_VERSION = "v0.4.3";
337
+ const spinner4 = ora("Instalando GitHub Spec Kit (specify-cli)").start();
337
338
  let specifyInstalled = false;
339
+
340
+ // Verificar se já está instalado (specify não aceita --version, usar --help)
338
341
  try {
339
- execSync("specify --version", { stdio: "ignore" });
342
+ execSync("specify --help", { stdio: "ignore" });
340
343
  specifyInstalled = true;
341
344
  spinner4.succeed("specify-cli já instalado");
342
345
  } catch {
343
- spinner4.info("specify-cli não encontrado");
344
- const spinner4b = ora("Instalando specify-cli...").start();
346
+ // Não instalado — instalar
345
347
  try {
346
- execSync("uv tool install specify-cli --from git+https://github.com/github/spec-kit.git", {
347
- stdio: "ignore", timeout: 120000,
348
+ execSync(`uv tool install specify-cli --from "git+https://github.com/github/spec-kit.git@${SPECKIT_VERSION}"`, {
349
+ stdio: "pipe", timeout: 120000,
348
350
  });
349
351
  specifyInstalled = true;
350
- spinner4b.succeed("specify-cli instalado");
351
- } catch {
352
+ spinner4.succeed(`specify-cli ${SPECKIT_VERSION} instalado`);
353
+ } catch (err) {
354
+ // Pode já estar instalado mas uv retorna erro, checar de novo
352
355
  try {
353
- execSync("pip install specify-cli", { stdio: "ignore", timeout: 60000 });
356
+ execSync("specify --help", { stdio: "ignore" });
354
357
  specifyInstalled = true;
355
- spinner4b.succeed("specify-cli instalado via pip");
358
+ spinner4.succeed("specify-cli instalado");
356
359
  } catch {
357
- spinner4b.warn("Não foi possível instalar. Instale manualmente:");
358
- console.log(chalk.dim(" uv tool install specify-cli --from git+https://github.com/github/spec-kit.git"));
360
+ spinner4.warn("Não foi possível instalar. Rode manualmente:");
361
+ console.log(chalk.dim(` uv tool install specify-cli --from "git+https://github.com/github/spec-kit.git@${SPECKIT_VERSION}"`));
359
362
  }
360
363
  }
361
364
  }
@@ -365,14 +368,22 @@ async function main() {
365
368
  const spinner4c = ora(`Inicializando Spec Kit no projeto (--ai ${aiFlag})`).start();
366
369
  const specifyEnv = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1" };
367
370
  let specInitOk = false;
371
+
372
+ // Precisa de "y" piped pois specify pede confirmação se dir não vazio
373
+ // Usar --script sh para evitar dependência de pwsh no Windows
368
374
  const initCmds = [
369
- `specify init --here --ai ${aiFlag}`,
370
- `specify init . --ai ${aiFlag}`,
371
- `specify init --here --ai ${aiFlag} --no-git`,
375
+ `echo y | specify init . --ai ${aiFlag} --script sh`,
376
+ `echo y | specify init . --ai ${aiFlag}`,
372
377
  ];
373
378
  for (const cmd of initCmds) {
374
379
  try {
375
- execSync(cmd, { stdio: "ignore", timeout: 30000, cwd: targetDir, env: specifyEnv });
380
+ execSync(cmd, {
381
+ stdio: "pipe",
382
+ timeout: 60000,
383
+ cwd: targetDir,
384
+ env: specifyEnv,
385
+ shell: true,
386
+ });
376
387
  specInitOk = true;
377
388
  break;
378
389
  } catch { /* try next */ }
@@ -382,7 +393,7 @@ async function main() {
382
393
  } else {
383
394
  spinner4c.warn("Inicialize manualmente no terminal:");
384
395
  console.log(chalk.dim(` cd ${targetDir}`));
385
- console.log(chalk.dim(` specify init --here --ai ${aiFlag}`));
396
+ console.log(chalk.dim(` specify init . --ai ${aiFlag} --script sh`));
386
397
  }
387
398
 
388
399
  // 4c. Copiar constitution.md do bundle para dentro do .specify/memory/