@codexa/cli 9.0.37 → 9.0.39

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.
@@ -181,7 +181,7 @@ export async function discoverConfirm(): Promise<void> {
181
181
  // Mover de pending para default
182
182
  await dbRun("DELETE FROM project WHERE id = ?", ["pending"]);
183
183
  await dbRun(
184
- `INSERT INTO project (id, name, stack, discovered_at, updated_at, cli_version, last_discover_at)
184
+ `INSERT OR REPLACE INTO project (id, name, stack, discovered_at, updated_at, cli_version, last_discover_at)
185
185
  VALUES ('default', ?, ?, ?, ?, ?, ?)`,
186
186
  ["Projeto", JSON.stringify(data.stack), now, now, pkg.version, now]
187
187
  );
@@ -298,6 +298,10 @@ export async function discoverShow(json: boolean = false): Promise<void> {
298
298
  const project = await dbGet<any>("SELECT * FROM project WHERE id = ?", ["default"]);
299
299
 
300
300
  if (!project) {
301
+ if (json) {
302
+ console.log(JSON.stringify({ exists: false }));
303
+ return;
304
+ }
301
305
  throw new CodexaError("Projeto nao descoberto.\nExecute: discover start");
302
306
  }
303
307
 
@@ -305,7 +309,7 @@ export async function discoverShow(json: boolean = false): Promise<void> {
305
309
  const stack = JSON.parse(project.stack);
306
310
 
307
311
  if (json) {
308
- console.log(JSON.stringify({ project, stack, standards }, null, 2));
312
+ console.log(JSON.stringify({ exists: true, project, stack, standards }, null, 2));
309
313
  return;
310
314
  }
311
315
 
@@ -853,10 +857,13 @@ export async function discoverPatternsShow(name: string, json: boolean = false):
853
857
  console.log("─".repeat(70));
854
858
 
855
859
  for (const ap of antiPatterns) {
856
- console.log(`\n ❌ ${ap.description}`);
857
- console.log(` Encontrado em: ${ap.found_in?.join(", ") || "N/A"}`);
858
- if (ap.recommendation) {
859
- console.log(` Recomendacao: ${ap.recommendation}`);
860
+ const desc = typeof ap === "string" ? ap : ap.description || JSON.stringify(ap);
861
+ console.log(`\n ❌ ${desc}`);
862
+ if (typeof ap !== "string") {
863
+ console.log(` Encontrado em: ${ap.found_in?.join(", ") || "N/A"}`);
864
+ if (ap.recommendation) {
865
+ console.log(` Recomendacao: ${ap.recommendation}`);
866
+ }
860
867
  }
861
868
  }
862
869
  }
@@ -1085,12 +1092,15 @@ export async function generatePatternsMarkdown(): Promise<void> {
1085
1092
  if (antiPatterns.length > 0) {
1086
1093
  md += `\n**⚠ Anti-patterns:**\n`;
1087
1094
  for (const ap of antiPatterns) {
1088
- md += `- ${ap.description}\n`;
1089
- if (ap.found_in?.length > 0) {
1090
- md += ` - Encontrado em: ${ap.found_in.join(", ")}\n`;
1091
- }
1092
- if (ap.recommendation) {
1093
- md += ` - Recomendacao: ${ap.recommendation}\n`;
1095
+ const desc = typeof ap === "string" ? ap : ap.description || JSON.stringify(ap);
1096
+ md += `- ${desc}\n`;
1097
+ if (typeof ap !== "string") {
1098
+ if (ap.found_in?.length > 0) {
1099
+ md += ` - Encontrado em: ${ap.found_in.join(", ")}\n`;
1100
+ }
1101
+ if (ap.recommendation) {
1102
+ md += ` - Recomendacao: ${ap.recommendation}\n`;
1103
+ }
1094
1104
  }
1095
1105
  }
1096
1106
  }
@@ -287,6 +287,10 @@ export async function productShow(options: { json?: boolean; pending?: boolean }
287
287
  const product = await dbGet<any>(`SELECT * FROM product_context WHERE id = ?`, [id]);
288
288
 
289
289
  if (!product) {
290
+ if (options.json) {
291
+ console.log(JSON.stringify({ exists: false }));
292
+ return;
293
+ }
290
294
  if (options.pending) {
291
295
  throw new CodexaError("Nenhum contexto pendente.");
292
296
  } else {
@@ -299,6 +303,7 @@ export async function productShow(options: { json?: boolean; pending?: boolean }
299
303
 
300
304
  if (options.json) {
301
305
  console.log(JSON.stringify({
306
+ exists: true,
302
307
  product,
303
308
  goals,
304
309
  features,
package/commands/utils.ts CHANGED
@@ -369,7 +369,7 @@ export async function contextDetail(section: string, json: boolean = false, spec
369
369
  }
370
370
  const anti = p.anti_patterns ? JSON.parse(p.anti_patterns) : [];
371
371
  if (anti.length > 0) {
372
- output += `\n Anti-patterns: ${anti.join("; ")}`;
372
+ output += `\n Anti-patterns: ${anti.map((a: any) => typeof a === "string" ? a : a.description || JSON.stringify(a)).join("; ")}`;
373
373
  }
374
374
  }
375
375
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexa/cli",
3
- "version": "9.0.37",
3
+ "version": "9.0.39",
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": {