@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/db/schema.ts
CHANGED
|
@@ -385,52 +385,6 @@ export function initSchema(): void {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
export function resetDb(): void {
|
|
389
|
-
const db = getDb();
|
|
390
|
-
db.exec(`
|
|
391
|
-
DROP TABLE IF EXISTS session_summaries;
|
|
392
|
-
DROP TABLE IF EXISTS reasoning_log;
|
|
393
|
-
DROP TABLE IF EXISTS knowledge_graph;
|
|
394
|
-
DROP TABLE IF EXISTS implementation_patterns;
|
|
395
|
-
DROP TABLE IF EXISTS agent_lib_mappings;
|
|
396
|
-
DROP TABLE IF EXISTS lib_contexts;
|
|
397
|
-
DROP TABLE IF EXISTS product_features;
|
|
398
|
-
DROP TABLE IF EXISTS product_goals;
|
|
399
|
-
DROP TABLE IF EXISTS product_context;
|
|
400
|
-
DROP TABLE IF EXISTS gate_bypasses;
|
|
401
|
-
DROP TABLE IF EXISTS knowledge;
|
|
402
|
-
DROP TABLE IF EXISTS standards;
|
|
403
|
-
DROP TABLE IF EXISTS project;
|
|
404
|
-
DROP TABLE IF EXISTS snapshots;
|
|
405
|
-
DROP TABLE IF EXISTS review;
|
|
406
|
-
DROP TABLE IF EXISTS artifacts;
|
|
407
|
-
DROP TABLE IF EXISTS decisions;
|
|
408
|
-
DROP TABLE IF EXISTS tasks;
|
|
409
|
-
DROP TABLE IF EXISTS context;
|
|
410
|
-
DROP TABLE IF EXISTS specs;
|
|
411
|
-
`);
|
|
412
|
-
initSchema();
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
export function hasDiscoveredProject(): boolean {
|
|
416
|
-
const db = getDb();
|
|
417
|
-
const project = db.query("SELECT * FROM project WHERE id = 'default'").get() as any;
|
|
418
|
-
const standardsCount = db.query("SELECT COUNT(*) as c FROM standards").get() as any;
|
|
419
|
-
return project !== null && standardsCount.c > 0;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
export function hasProductContext(): boolean {
|
|
423
|
-
const db = getDb();
|
|
424
|
-
const product = db.query("SELECT * FROM product_context WHERE id = 'default'").get() as any;
|
|
425
|
-
return product !== null;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
export function hasImplementationPatterns(): boolean {
|
|
429
|
-
const db = getDb();
|
|
430
|
-
const count = db.query("SELECT COUNT(*) as c FROM implementation_patterns").get() as any;
|
|
431
|
-
return count.c > 0;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
388
|
export function getPatternsByScope(scope: string): any[] {
|
|
435
389
|
const db = getDb();
|
|
436
390
|
return db.query(
|
|
@@ -438,11 +392,6 @@ export function getPatternsByScope(scope: string): any[] {
|
|
|
438
392
|
).all(scope) as any[];
|
|
439
393
|
}
|
|
440
394
|
|
|
441
|
-
export function getPatternByName(name: string): any {
|
|
442
|
-
const db = getDb();
|
|
443
|
-
return db.query("SELECT * FROM implementation_patterns WHERE name = ?").get(name) as any;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
395
|
export function getPatternsForFiles(files: string[]): any[] {
|
|
447
396
|
const db = getDb();
|
|
448
397
|
const patterns = db.query("SELECT * FROM implementation_patterns").all() as any[];
|
|
@@ -572,24 +521,6 @@ export function addReasoning(specId: string, taskId: number | null, entry: Reaso
|
|
|
572
521
|
);
|
|
573
522
|
}
|
|
574
523
|
|
|
575
|
-
export function getReasoningForTask(specId: string, taskId: number, limit: number = 10): any[] {
|
|
576
|
-
const db = getDb();
|
|
577
|
-
|
|
578
|
-
return db.query(`
|
|
579
|
-
SELECT * FROM reasoning_log
|
|
580
|
-
WHERE spec_id = ? AND (task_id = ? OR task_id IS NULL)
|
|
581
|
-
ORDER BY
|
|
582
|
-
CASE importance
|
|
583
|
-
WHEN 'critical' THEN 1
|
|
584
|
-
WHEN 'high' THEN 2
|
|
585
|
-
WHEN 'normal' THEN 3
|
|
586
|
-
WHEN 'low' THEN 4
|
|
587
|
-
END,
|
|
588
|
-
created_at DESC
|
|
589
|
-
LIMIT ?
|
|
590
|
-
`).all(specId, taskId, limit) as any[];
|
|
591
|
-
}
|
|
592
|
-
|
|
593
524
|
export function getRecentReasoning(specId: string, limit: number = 20): any[] {
|
|
594
525
|
const db = getDb();
|
|
595
526
|
|
package/detectors/README.md
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
# Universal Stack Detection System
|
|
2
|
-
|
|
3
|
-
Sistema de detecção de stack agnóstico e modular para o Codexa Workflow.
|
|
4
|
-
|
|
5
|
-
## Ecossistemas Suportados
|
|
6
|
-
|
|
7
|
-
| Ecossistema | Marcadores Principais | Tecnologias Detectadas |
|
|
8
|
-
|-------------|----------------------|------------------------|
|
|
9
|
-
| **.NET** | `*.csproj`, `*.sln`, `*.fsproj` | ASP.NET Core, Blazor, EF Core, xUnit, NUnit |
|
|
10
|
-
| **Node.js** | `package.json`, `*.lock` | Next.js, React, Vue, Express, Prisma, Drizzle |
|
|
11
|
-
| **Python** | `pyproject.toml`, `requirements.txt` | Django, FastAPI, Flask, SQLAlchemy, pytest |
|
|
12
|
-
| **Go** | `go.mod`, `go.sum` | Gin, Echo, Fiber, GORM, Ent |
|
|
13
|
-
| **Rust** | `Cargo.toml`, `Cargo.lock` | Actix, Axum, Diesel, SeaORM, Tokio |
|
|
14
|
-
| **JVM** | `pom.xml`, `build.gradle` | Spring Boot, Quarkus, Hibernate, JUnit |
|
|
15
|
-
| **Flutter** | `pubspec.yaml` | Flutter, Riverpod, Bloc, Hive |
|
|
16
|
-
|
|
17
|
-
## Arquitetura
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
detectors/
|
|
21
|
-
├── index.ts # Core: tipos, registro, utilities
|
|
22
|
-
├── loader.ts # Carrega todos os detectores
|
|
23
|
-
├── dotnet.ts # .NET/C#/F#
|
|
24
|
-
├── node.ts # Node.js/Bun/Deno
|
|
25
|
-
├── python.ts # Python
|
|
26
|
-
├── go.ts # Go
|
|
27
|
-
├── rust.ts # Rust
|
|
28
|
-
├── jvm.ts # Java/Kotlin/Scala
|
|
29
|
-
└── flutter.ts # Flutter/Dart
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Uso
|
|
33
|
-
|
|
34
|
-
### Detecção Completa
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
import { detectUniversal } from "./detectors/loader";
|
|
38
|
-
|
|
39
|
-
const result = await detectUniversal();
|
|
40
|
-
|
|
41
|
-
console.log(result.primary); // { language, runtime, framework }
|
|
42
|
-
console.log(result.ecosystems); // ["dotnet", "node", ...]
|
|
43
|
-
console.log(result.stack); // { frontend, backend, database, ... }
|
|
44
|
-
console.log(result.allTechnologies); // Full details with confidence
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Compatibilidade Legacy
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
import { detectStackLegacy } from "./detectors/loader";
|
|
51
|
-
|
|
52
|
-
const { stack, structure } = await detectStackLegacy();
|
|
53
|
-
// Returns same format as old detectStack()/detectStructure()
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Adicionando Novo Detector
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
// detectors/myecosystem.ts
|
|
60
|
-
import { registerDetector, Detector } from "./index";
|
|
61
|
-
|
|
62
|
-
const myDetector: Detector = {
|
|
63
|
-
name: "myecosystem",
|
|
64
|
-
ecosystem: "myecosystem",
|
|
65
|
-
priority: 50,
|
|
66
|
-
markers: [
|
|
67
|
-
{ type: "file", pattern: "myconfig.json", weight: 1.0 },
|
|
68
|
-
],
|
|
69
|
-
|
|
70
|
-
async detect(cwd: string) {
|
|
71
|
-
// Detection logic
|
|
72
|
-
return {
|
|
73
|
-
ecosystem: "myecosystem",
|
|
74
|
-
technologies: [...],
|
|
75
|
-
structure: {...},
|
|
76
|
-
configFiles: [...],
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
registerDetector(myDetector);
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Depois adicione o import em `loader.ts`:
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
import "./myecosystem";
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Categorias de Tecnologia
|
|
91
|
-
|
|
92
|
-
- `runtime` - Linguagem/runtime (Node.js, .NET, Python)
|
|
93
|
-
- `frontend` - Frameworks frontend (Next.js, React, Flutter)
|
|
94
|
-
- `backend` - Frameworks backend (Express, ASP.NET, Django)
|
|
95
|
-
- `database` - Bancos de dados (PostgreSQL, MongoDB, Redis)
|
|
96
|
-
- `orm` - ORMs (Prisma, EF Core, SQLAlchemy)
|
|
97
|
-
- `styling` - CSS/Styling (Tailwind, Styled Components)
|
|
98
|
-
- `auth` - Autenticação (NextAuth, Firebase Auth)
|
|
99
|
-
- `testing` - Testes (Jest, pytest, xUnit)
|
|
100
|
-
- `build` - Build tools (Webpack, Gradle, Poetry)
|
|
101
|
-
- `devops` - DevOps (Docker, Prometheus)
|
|
102
|
-
|
|
103
|
-
## Confiança (Confidence)
|
|
104
|
-
|
|
105
|
-
Cada tecnologia detectada tem um score de confiança (0-1):
|
|
106
|
-
|
|
107
|
-
- **1.0**: Arquivo/configuração específica encontrada
|
|
108
|
-
- **0.9**: Dependência explícita no manifest
|
|
109
|
-
- **0.7-0.8**: Arquivos de código encontrados
|
|
1
|
+
# Universal Stack Detection System
|
|
2
|
+
|
|
3
|
+
Sistema de detecção de stack agnóstico e modular para o Codexa Workflow.
|
|
4
|
+
|
|
5
|
+
## Ecossistemas Suportados
|
|
6
|
+
|
|
7
|
+
| Ecossistema | Marcadores Principais | Tecnologias Detectadas |
|
|
8
|
+
|-------------|----------------------|------------------------|
|
|
9
|
+
| **.NET** | `*.csproj`, `*.sln`, `*.fsproj` | ASP.NET Core, Blazor, EF Core, xUnit, NUnit |
|
|
10
|
+
| **Node.js** | `package.json`, `*.lock` | Next.js, React, Vue, Express, Prisma, Drizzle |
|
|
11
|
+
| **Python** | `pyproject.toml`, `requirements.txt` | Django, FastAPI, Flask, SQLAlchemy, pytest |
|
|
12
|
+
| **Go** | `go.mod`, `go.sum` | Gin, Echo, Fiber, GORM, Ent |
|
|
13
|
+
| **Rust** | `Cargo.toml`, `Cargo.lock` | Actix, Axum, Diesel, SeaORM, Tokio |
|
|
14
|
+
| **JVM** | `pom.xml`, `build.gradle` | Spring Boot, Quarkus, Hibernate, JUnit |
|
|
15
|
+
| **Flutter** | `pubspec.yaml` | Flutter, Riverpod, Bloc, Hive |
|
|
16
|
+
|
|
17
|
+
## Arquitetura
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
detectors/
|
|
21
|
+
├── index.ts # Core: tipos, registro, utilities
|
|
22
|
+
├── loader.ts # Carrega todos os detectores
|
|
23
|
+
├── dotnet.ts # .NET/C#/F#
|
|
24
|
+
├── node.ts # Node.js/Bun/Deno
|
|
25
|
+
├── python.ts # Python
|
|
26
|
+
├── go.ts # Go
|
|
27
|
+
├── rust.ts # Rust
|
|
28
|
+
├── jvm.ts # Java/Kotlin/Scala
|
|
29
|
+
└── flutter.ts # Flutter/Dart
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Uso
|
|
33
|
+
|
|
34
|
+
### Detecção Completa
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { detectUniversal } from "./detectors/loader";
|
|
38
|
+
|
|
39
|
+
const result = await detectUniversal();
|
|
40
|
+
|
|
41
|
+
console.log(result.primary); // { language, runtime, framework }
|
|
42
|
+
console.log(result.ecosystems); // ["dotnet", "node", ...]
|
|
43
|
+
console.log(result.stack); // { frontend, backend, database, ... }
|
|
44
|
+
console.log(result.allTechnologies); // Full details with confidence
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Compatibilidade Legacy
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { detectStackLegacy } from "./detectors/loader";
|
|
51
|
+
|
|
52
|
+
const { stack, structure } = await detectStackLegacy();
|
|
53
|
+
// Returns same format as old detectStack()/detectStructure()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Adicionando Novo Detector
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
// detectors/myecosystem.ts
|
|
60
|
+
import { registerDetector, Detector } from "./index";
|
|
61
|
+
|
|
62
|
+
const myDetector: Detector = {
|
|
63
|
+
name: "myecosystem",
|
|
64
|
+
ecosystem: "myecosystem",
|
|
65
|
+
priority: 50,
|
|
66
|
+
markers: [
|
|
67
|
+
{ type: "file", pattern: "myconfig.json", weight: 1.0 },
|
|
68
|
+
],
|
|
69
|
+
|
|
70
|
+
async detect(cwd: string) {
|
|
71
|
+
// Detection logic
|
|
72
|
+
return {
|
|
73
|
+
ecosystem: "myecosystem",
|
|
74
|
+
technologies: [...],
|
|
75
|
+
structure: {...},
|
|
76
|
+
configFiles: [...],
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
registerDetector(myDetector);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Depois adicione o import em `loader.ts`:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import "./myecosystem";
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Categorias de Tecnologia
|
|
91
|
+
|
|
92
|
+
- `runtime` - Linguagem/runtime (Node.js, .NET, Python)
|
|
93
|
+
- `frontend` - Frameworks frontend (Next.js, React, Flutter)
|
|
94
|
+
- `backend` - Frameworks backend (Express, ASP.NET, Django)
|
|
95
|
+
- `database` - Bancos de dados (PostgreSQL, MongoDB, Redis)
|
|
96
|
+
- `orm` - ORMs (Prisma, EF Core, SQLAlchemy)
|
|
97
|
+
- `styling` - CSS/Styling (Tailwind, Styled Components)
|
|
98
|
+
- `auth` - Autenticação (NextAuth, Firebase Auth)
|
|
99
|
+
- `testing` - Testes (Jest, pytest, xUnit)
|
|
100
|
+
- `build` - Build tools (Webpack, Gradle, Poetry)
|
|
101
|
+
- `devops` - DevOps (Docker, Prometheus)
|
|
102
|
+
|
|
103
|
+
## Confiança (Confidence)
|
|
104
|
+
|
|
105
|
+
Cada tecnologia detectada tem um score de confiança (0-1):
|
|
106
|
+
|
|
107
|
+
- **1.0**: Arquivo/configuração específica encontrada
|
|
108
|
+
- **0.9**: Dependência explícita no manifest
|
|
109
|
+
- **0.7-0.8**: Arquivos de código encontrados
|
|
110
110
|
- **0.5-0.6**: Diretórios/estrutura inferida
|