@codexa/cli 9.0.1 → 9.0.2
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 +1 -1
- package/protocol/subagent-protocol.ts +6 -0
- package/workflow.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codexa/cli",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "Orchestrated workflow system for Claude Code - manages feature development through parallel subagents with structured phases, gates, and quality enforcement.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -222,6 +222,8 @@ export function parseSubagentReturn(input: string): ParseResult {
|
|
|
222
222
|
errors: [
|
|
223
223
|
`JSON invalido: ${(e as Error).message}`,
|
|
224
224
|
"Verifique se o JSON esta bem formatado.",
|
|
225
|
+
"Dica: Caracteres como ! $ ` em double-quotes causam problemas no shell.",
|
|
226
|
+
"Use aspas simples ou --output-file /tmp/result.json para evitar escaping.",
|
|
225
227
|
],
|
|
226
228
|
rawInput: input,
|
|
227
229
|
};
|
|
@@ -238,6 +240,10 @@ export function parseSubagentReturn(input: string): ParseResult {
|
|
|
238
240
|
const summaryError = validateString(parsed.summary, "summary", 10, 500);
|
|
239
241
|
if (summaryError) errors.push(summaryError);
|
|
240
242
|
|
|
243
|
+
// files_created / files_modified: default para [] se ausentes
|
|
244
|
+
if (parsed.files_created === undefined) parsed.files_created = [];
|
|
245
|
+
if (parsed.files_modified === undefined) parsed.files_modified = [];
|
|
246
|
+
|
|
241
247
|
// files_created
|
|
242
248
|
const filesCreatedError = validateStringArray(parsed.files_created, "files_created");
|
|
243
249
|
if (filesCreatedError) errors.push(filesCreatedError);
|
package/workflow.ts
CHANGED
|
@@ -200,10 +200,33 @@ taskCmd
|
|
|
200
200
|
.description("Completa uma task")
|
|
201
201
|
.option("--checkpoint <text>", "Resumo do que foi feito (extraido automaticamente de --output)")
|
|
202
202
|
.option("--output <json>", "Retorno JSON do subagent (processa automaticamente)")
|
|
203
|
+
.option("--output-file <path>", "Ler retorno JSON de arquivo (evita problemas de shell escaping)")
|
|
203
204
|
.option("--files <files>", "Arquivos criados/modificados (extraido automaticamente de --output)")
|
|
204
205
|
.option("--force", "Ignorar validacao de standards (sera registrado)")
|
|
205
206
|
.option("--force-reason <reason>", "Motivo do bypass de validacao")
|
|
206
207
|
.action((id: string, options) => {
|
|
208
|
+
// Resolver --output-file: ler conteudo do arquivo
|
|
209
|
+
if (options.outputFile && !options.output) {
|
|
210
|
+
try {
|
|
211
|
+
options.output = readFileSync(options.outputFile, "utf-8");
|
|
212
|
+
} catch (e) {
|
|
213
|
+
console.error(`\n[ERRO] Nao foi possivel ler arquivo: ${options.outputFile}`);
|
|
214
|
+
console.error(` ${(e as Error).message}\n`);
|
|
215
|
+
process.exit(1);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Resolver stdin: --output - (le de stdin)
|
|
220
|
+
if (options.output === "-") {
|
|
221
|
+
try {
|
|
222
|
+
options.output = readFileSync("/dev/stdin", "utf-8");
|
|
223
|
+
} catch (e) {
|
|
224
|
+
console.error("\n[ERRO] Nao foi possivel ler de stdin.");
|
|
225
|
+
console.error(` ${(e as Error).message}\n`);
|
|
226
|
+
process.exit(1);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
207
230
|
// Checkpoint obrigatorio se nao houver --output
|
|
208
231
|
if (!options.output && !options.checkpoint) {
|
|
209
232
|
console.error("\n[ERRO] Checkpoint obrigatorio.");
|