@codexa/cli 8.5.0 → 8.6.0
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 +760 -896
- package/commands/check.ts +131 -131
- package/commands/clear.ts +170 -174
- package/commands/decide.ts +249 -249
- package/commands/discover.ts +82 -10
- package/commands/knowledge.ts +361 -361
- package/commands/patterns.ts +621 -621
- package/commands/plan.ts +376 -376
- package/commands/product.ts +626 -628
- package/commands/research.ts +754 -754
- package/commands/review.ts +463 -463
- package/commands/standards.ts +200 -223
- package/commands/task.ts +2 -2
- package/commands/utils.ts +1021 -1021
- package/db/connection.ts +32 -32
- package/db/schema.ts +719 -788
- package/detectors/loader.ts +0 -12
- package/gates/standards-validator.ts +204 -204
- package/gates/validator.ts +441 -441
- package/package.json +43 -43
- package/protocol/process-return.ts +450 -450
- package/protocol/subagent-protocol.ts +401 -411
- package/workflow.ts +0 -18
package/db/connection.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { Database } from "bun:sqlite";
|
|
2
|
-
import { join, dirname } from "path";
|
|
3
|
-
import { mkdirSync, existsSync } from "fs";
|
|
4
|
-
|
|
5
|
-
const DB_PATH = join(process.cwd(), ".codexa", "db", "workflow.db");
|
|
6
|
-
|
|
7
|
-
let db: Database | null = null;
|
|
8
|
-
|
|
9
|
-
export function getDb(): Database {
|
|
10
|
-
if (!db) {
|
|
11
|
-
// Garantir que o diretorio existe
|
|
12
|
-
const dbDir = dirname(DB_PATH);
|
|
13
|
-
if (!existsSync(dbDir)) {
|
|
14
|
-
mkdirSync(dbDir, { recursive: true });
|
|
15
|
-
}
|
|
16
|
-
db = new Database(DB_PATH, { create: true });
|
|
17
|
-
db.exec("PRAGMA journal_mode = WAL");
|
|
18
|
-
db.exec("PRAGMA foreign_keys = ON");
|
|
19
|
-
}
|
|
20
|
-
return db;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function closeDb(): void {
|
|
24
|
-
if (db) {
|
|
25
|
-
db.close();
|
|
26
|
-
db = null;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function getDbPath(): string {
|
|
31
|
-
return DB_PATH;
|
|
32
|
-
}
|
|
1
|
+
import { Database } from "bun:sqlite";
|
|
2
|
+
import { join, dirname } from "path";
|
|
3
|
+
import { mkdirSync, existsSync } from "fs";
|
|
4
|
+
|
|
5
|
+
const DB_PATH = join(process.cwd(), ".codexa", "db", "workflow.db");
|
|
6
|
+
|
|
7
|
+
let db: Database | null = null;
|
|
8
|
+
|
|
9
|
+
export function getDb(): Database {
|
|
10
|
+
if (!db) {
|
|
11
|
+
// Garantir que o diretorio existe
|
|
12
|
+
const dbDir = dirname(DB_PATH);
|
|
13
|
+
if (!existsSync(dbDir)) {
|
|
14
|
+
mkdirSync(dbDir, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
db = new Database(DB_PATH, { create: true });
|
|
17
|
+
db.exec("PRAGMA journal_mode = WAL");
|
|
18
|
+
db.exec("PRAGMA foreign_keys = ON");
|
|
19
|
+
}
|
|
20
|
+
return db;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function closeDb(): void {
|
|
24
|
+
if (db) {
|
|
25
|
+
db.close();
|
|
26
|
+
db = null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function getDbPath(): string {
|
|
31
|
+
return DB_PATH;
|
|
32
|
+
}
|