@codexa/cli 8.5.0 → 8.6.9
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/commands/architect.ts +1 -137
- package/commands/clear.ts +1 -5
- package/commands/discover.ts +1071 -999
- package/commands/product.ts +0 -2
- package/commands/research.ts +1 -1
- package/commands/standards.ts +0 -23
- package/commands/task.ts +623 -623
- package/db/schema.ts +0 -69
- package/detectors/README.md +109 -109
- package/detectors/dotnet.ts +357 -357
- package/detectors/flutter.ts +350 -350
- package/detectors/go.ts +324 -324
- package/detectors/index.ts +387 -387
- package/detectors/jvm.ts +433 -433
- package/detectors/loader.ts +128 -140
- package/detectors/node.ts +493 -493
- package/detectors/python.ts +423 -423
- package/detectors/rust.ts +348 -348
- package/package.json +5 -4
- package/protocol/subagent-protocol.ts +0 -10
- package/workflow.ts +783 -800
package/commands/architect.ts
CHANGED
|
@@ -274,24 +274,12 @@ export function parseAnalysisMd(content: string): {
|
|
|
274
274
|
return { context, currentArchitecture, approach, diagrams, babySteps, risks, alternatives, decisions };
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
// ═══════════════════════════════════════════════════════════════
|
|
278
|
-
// SCHEMA EXTENSION
|
|
279
|
-
// ═══════════════════════════════════════════════════════════════
|
|
280
|
-
|
|
281
|
-
// v8.3: Tabela agora criada em initSchema() (schema.ts). Mantido para compatibilidade.
|
|
282
|
-
export function initArchitectSchema(): void {
|
|
283
|
-
// No-op: tabela architectural_analyses agora e criada por initSchema() em schema.ts
|
|
284
|
-
// Chamadas existentes nao quebram
|
|
285
|
-
}
|
|
286
|
-
|
|
287
277
|
// ═══════════════════════════════════════════════════════════════
|
|
288
278
|
// COMMANDS
|
|
289
279
|
// ═══════════════════════════════════════════════════════════════
|
|
290
280
|
|
|
291
281
|
export function architectStart(description: string, options: { json?: boolean } = {}): void {
|
|
292
282
|
initSchema();
|
|
293
|
-
initArchitectSchema();
|
|
294
|
-
|
|
295
283
|
const db = getDb();
|
|
296
284
|
const now = new Date().toISOString();
|
|
297
285
|
const id = generateId();
|
|
@@ -366,8 +354,6 @@ export function architectStart(description: string, options: { json?: boolean }
|
|
|
366
354
|
|
|
367
355
|
export function architectShow(options: { id?: string; json?: boolean } = {}): void {
|
|
368
356
|
initSchema();
|
|
369
|
-
initArchitectSchema();
|
|
370
|
-
|
|
371
357
|
const db = getDb();
|
|
372
358
|
|
|
373
359
|
let analysis: any;
|
|
@@ -465,8 +451,6 @@ export function architectShow(options: { id?: string; json?: boolean } = {}): vo
|
|
|
465
451
|
|
|
466
452
|
export function architectList(options: { json?: boolean; status?: string } = {}): void {
|
|
467
453
|
initSchema();
|
|
468
|
-
initArchitectSchema();
|
|
469
|
-
|
|
470
454
|
const db = getDb();
|
|
471
455
|
|
|
472
456
|
let query = "SELECT id, name, status, created_at, file_path FROM architectural_analyses";
|
|
@@ -509,122 +493,8 @@ export function architectList(options: { json?: boolean; status?: string } = {})
|
|
|
509
493
|
}
|
|
510
494
|
}
|
|
511
495
|
|
|
512
|
-
// v8.4: Deprecado - prefira editar o .md diretamente e usar 'architect save --file <path>'
|
|
513
|
-
export function architectUpdate(options: {
|
|
514
|
-
context?: string;
|
|
515
|
-
currentArchitecture?: string;
|
|
516
|
-
approach?: string;
|
|
517
|
-
chosenAlternative?: string;
|
|
518
|
-
diagrams?: string;
|
|
519
|
-
babySteps?: string;
|
|
520
|
-
risks?: string;
|
|
521
|
-
alternatives?: string;
|
|
522
|
-
decisions?: string;
|
|
523
|
-
json?: boolean;
|
|
524
|
-
}): void {
|
|
525
|
-
initSchema();
|
|
526
|
-
initArchitectSchema();
|
|
527
|
-
|
|
528
|
-
if (!options.json) {
|
|
529
|
-
console.log("\n[AVISO] 'architect update' esta deprecado. Prefira editar o .md e usar 'architect save --file <path>'.\n");
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
const db = getDb();
|
|
533
|
-
const now = new Date().toISOString();
|
|
534
|
-
|
|
535
|
-
// Pegar analise pendente
|
|
536
|
-
const analysis = db.query(
|
|
537
|
-
"SELECT * FROM architectural_analyses WHERE status = 'pending' ORDER BY created_at DESC LIMIT 1"
|
|
538
|
-
).get() as any;
|
|
539
|
-
|
|
540
|
-
if (!analysis) {
|
|
541
|
-
if (options.json) {
|
|
542
|
-
console.log(JSON.stringify({ error: "NO_PENDING", message: "Nenhuma analise pendente" }));
|
|
543
|
-
} else {
|
|
544
|
-
console.log("\n[ERRO] Nenhuma analise pendente encontrada.");
|
|
545
|
-
console.log("Use 'architect start <descricao>' para iniciar.\n");
|
|
546
|
-
}
|
|
547
|
-
process.exit(1);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
// Construir update dinamicamente
|
|
551
|
-
const updates: string[] = [];
|
|
552
|
-
const values: any[] = [];
|
|
553
|
-
|
|
554
|
-
if (options.context) {
|
|
555
|
-
updates.push("context = ?");
|
|
556
|
-
values.push(options.context);
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
if (options.currentArchitecture) {
|
|
560
|
-
updates.push("current_architecture = ?");
|
|
561
|
-
values.push(options.currentArchitecture);
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
if (options.approach) {
|
|
565
|
-
updates.push("approach = ?");
|
|
566
|
-
values.push(options.approach);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
if (options.chosenAlternative) {
|
|
570
|
-
updates.push("chosen_alternative = ?");
|
|
571
|
-
values.push(options.chosenAlternative);
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
if (options.diagrams) {
|
|
575
|
-
updates.push("diagrams = ?");
|
|
576
|
-
values.push(options.diagrams);
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
if (options.babySteps) {
|
|
580
|
-
updates.push("baby_steps = ?");
|
|
581
|
-
values.push(options.babySteps);
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
if (options.risks) {
|
|
585
|
-
updates.push("risks = ?");
|
|
586
|
-
values.push(options.risks);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
if (options.alternatives) {
|
|
590
|
-
updates.push("alternatives = ?");
|
|
591
|
-
values.push(options.alternatives);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
if (options.decisions) {
|
|
595
|
-
updates.push("decisions = ?");
|
|
596
|
-
values.push(options.decisions);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
if (updates.length === 0) {
|
|
600
|
-
if (options.json) {
|
|
601
|
-
console.log(JSON.stringify({ error: "NO_UPDATES", message: "Nenhum campo para atualizar" }));
|
|
602
|
-
} else {
|
|
603
|
-
console.log("\n[ERRO] Nenhum campo especificado para atualizar.\n");
|
|
604
|
-
}
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
updates.push("updated_at = ?");
|
|
609
|
-
values.push(now);
|
|
610
|
-
values.push(analysis.id);
|
|
611
|
-
|
|
612
|
-
db.run(
|
|
613
|
-
`UPDATE architectural_analyses SET ${updates.join(", ")} WHERE id = ?`,
|
|
614
|
-
values
|
|
615
|
-
);
|
|
616
|
-
|
|
617
|
-
if (options.json) {
|
|
618
|
-
console.log(JSON.stringify({ success: true, id: analysis.id, updated: Object.keys(options).filter(k => k !== "json") }));
|
|
619
|
-
} else {
|
|
620
|
-
console.log(`\n[OK] Analise ${analysis.id} atualizada.\n`);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
496
|
export function architectSave(options: { file?: string; json?: boolean }): void {
|
|
625
497
|
initSchema();
|
|
626
|
-
initArchitectSchema();
|
|
627
|
-
|
|
628
498
|
const db = getDb();
|
|
629
499
|
const now = new Date().toISOString();
|
|
630
500
|
|
|
@@ -751,8 +621,6 @@ export function architectSave(options: { file?: string; json?: boolean }): void
|
|
|
751
621
|
|
|
752
622
|
export function architectApprove(options: { id?: string; json?: boolean }): void {
|
|
753
623
|
initSchema();
|
|
754
|
-
initArchitectSchema();
|
|
755
|
-
|
|
756
624
|
const db = getDb();
|
|
757
625
|
const now = new Date().toISOString();
|
|
758
626
|
|
|
@@ -806,8 +674,6 @@ export function architectApprove(options: { id?: string; json?: boolean }): void
|
|
|
806
674
|
// v8.4: Simplificado - agora o feature importa baby steps automaticamente via --from-analysis
|
|
807
675
|
export function architectExport(options: { id?: string; json?: boolean }): void {
|
|
808
676
|
initSchema();
|
|
809
|
-
initArchitectSchema();
|
|
810
|
-
|
|
811
677
|
const db = getDb();
|
|
812
678
|
|
|
813
679
|
let analysis: any;
|
|
@@ -831,7 +697,7 @@ export function architectExport(options: { id?: string; json?: boolean }): void
|
|
|
831
697
|
}
|
|
832
698
|
|
|
833
699
|
const babySteps: BabyStep[] = analysis.baby_steps ? JSON.parse(analysis.baby_steps) : [];
|
|
834
|
-
const planCmd = `
|
|
700
|
+
const planCmd = `codexa plan start "${analysis.name}" --from-analysis ${analysis.id}`;
|
|
835
701
|
|
|
836
702
|
if (options.json) {
|
|
837
703
|
console.log(JSON.stringify({
|
|
@@ -859,8 +725,6 @@ export function architectExport(options: { id?: string; json?: boolean }): void
|
|
|
859
725
|
|
|
860
726
|
export function architectCancel(options: { id?: string; json?: boolean }): void {
|
|
861
727
|
initSchema();
|
|
862
|
-
initArchitectSchema();
|
|
863
|
-
|
|
864
728
|
const db = getDb();
|
|
865
729
|
const now = new Date().toISOString();
|
|
866
730
|
|
package/commands/clear.ts
CHANGED
|
@@ -59,7 +59,7 @@ export function clearTasks(options: ClearOptions = {}): void {
|
|
|
59
59
|
|
|
60
60
|
console.log("\n" + "─".repeat(60));
|
|
61
61
|
console.log("\nPara confirmar a limpeza, execute:");
|
|
62
|
-
console.log("
|
|
62
|
+
console.log(" codexa clear --force\n");
|
|
63
63
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -168,7 +168,3 @@ export function clearShow(): void {
|
|
|
168
168
|
console.log("\n" + "─".repeat(60));
|
|
169
169
|
console.log("Para limpar tasks (mantendo configs): clear --force\n");
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
// Exportar aliases para compatibilidade
|
|
173
|
-
export { clearTasks as clearWorkflow };
|
|
174
|
-
export { clearTasks as clearTasksOnly };
|