@spec-wave/cli 1.9.0 → 1.9.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.
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ import { loadArtifact } from '../lib/doc-source.mjs';
|
|
|
35
35
|
import { buildBugContext } from '../lib/bug-context.mjs';
|
|
36
36
|
import { slugify } from '../lib/slugify.mjs';
|
|
37
37
|
import { parseDependencies, orderStories, formatDependencyLine } from '../lib/dependencies.mjs';
|
|
38
|
-
import { emitProgress } from '../lib/progress-events.mjs';
|
|
38
|
+
import { emitProgress, cliInvocation } from '../lib/progress-events.mjs';
|
|
39
39
|
import { STREAM_DIR_ENV, runStreamed, specKitEnv, streamFileFor, withStreamJson } from '../lib/implement-stream.mjs';
|
|
40
40
|
import { loadProjectConfig } from '../lib/board.mjs';
|
|
41
41
|
import { planBoardMoves, applyBoardMoves } from '../lib/implement-board.mjs';
|
|
@@ -254,6 +254,8 @@ export function itemNumbers(itens = []) {
|
|
|
254
254
|
export function buildContext({
|
|
255
255
|
type, issue, tasks, feature, siblingStories = [], spec, plan, specPath, planPath,
|
|
256
256
|
comments = [], codeDigest = null, blockedByWarnings = [], mode = 'pr-stack', hub = null,
|
|
257
|
+
// Como o agente interno chama a CLI (lib/progress-events.mjs cliInvocation).
|
|
258
|
+
cli = cliInvocation(),
|
|
257
259
|
}) {
|
|
258
260
|
const lines = [];
|
|
259
261
|
lines.push(`# Contexto de implementação — ${type} #${itemNumber(issue)}`);
|
|
@@ -302,8 +304,10 @@ export function buildContext({
|
|
|
302
304
|
lines.push('');
|
|
303
305
|
lines.push(
|
|
304
306
|
' > **Obrigatório sob o dev-agent:** ao concluir **cada** Task, rode ' +
|
|
305
|
-
|
|
306
|
-
'
|
|
307
|
+
`\`${cli} task done <número da Task>\` **na hora, antes** de começar a próxima — ` +
|
|
308
|
+
'um comando por Task, **nunca** todos juntos no fim da Story. Use exatamente esse ' +
|
|
309
|
+
'comando (não troque por `npx spec-wave`: no clone ele pode resolver outra versão da CLI). ' +
|
|
310
|
+
'É ele que reporta o progresso da Feature (uma Task por vez) para quem ' +
|
|
307
311
|
'acompanha a execução. Se ele falhar, siga em frente — não tente de novo nem pare por isso.'
|
|
308
312
|
);
|
|
309
313
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { appendFileSync, mkdirSync } from 'node:fs';
|
|
18
18
|
import path from 'node:path';
|
|
19
|
+
import { fileURLToPath } from 'node:url';
|
|
19
20
|
import { STREAM_DIR_ENV } from './implement-stream.mjs';
|
|
20
21
|
|
|
21
22
|
export const PROGRESS_FILE = 'progress.jsonl';
|
|
@@ -44,3 +45,26 @@ export function emitProgress(event, env = process.env) {
|
|
|
44
45
|
return false;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
48
|
+
|
|
49
|
+
// Como o agente interno deve chamar ESTA CLI.
|
|
50
|
+
//
|
|
51
|
+
// `npx spec-wave` resolve primeiro o `node_modules/.bin` do diretório
|
|
52
|
+
// corrente, e o agente interno roda dentro do clone do produto. Num produto
|
|
53
|
+
// que tem a CLI como dependência (o spec-wave-ui fixava a 1.0.6), o
|
|
54
|
+
// `task done` instruído no contexto caía numa cópia antiga, que move o board
|
|
55
|
+
// mas não grava evento nenhum — a barra de progresso ficava parada.
|
|
56
|
+
//
|
|
57
|
+
// O spec-wave-agent diz qual CLI conduz a execução em SPEC_WAVE_CLI; sem ele,
|
|
58
|
+
// vale o caminho deste próprio arquivo em execução.
|
|
59
|
+
export const CLI_ENV = 'SPEC_WAVE_CLI';
|
|
60
|
+
|
|
61
|
+
const OWN_BIN = fileURLToPath(new URL('../../bin/spec-wave.mjs', import.meta.url));
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {Record<string, string|undefined>} [env]
|
|
65
|
+
* @returns {string} prefixo de comando, ex.: `/usr/local/bin/spec-wave`
|
|
66
|
+
*/
|
|
67
|
+
export function cliInvocation(env = process.env) {
|
|
68
|
+
const fromAgent = (env[CLI_ENV] || '').trim();
|
|
69
|
+
return fromAgent || `node ${JSON.stringify(OWN_BIN)}`;
|
|
70
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-wave",
|
|
3
3
|
"displayName": "Spec Wave",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.1",
|
|
5
5
|
"description": "Fluxo spec-driven no GitHub (RFC-001): Projects v2, labels de gatilho, spec/plan gerados por Action, decomposição em duas etapas e implementação orientada a Stories/Tasks.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Astratech",
|