@jonit-dev/night-watch-cli 1.7.17 → 1.7.19
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/bin/night-watch.mjs +1 -1
- package/dist/src/cli.js +13 -4
- package/dist/src/cli.js.map +1 -1
- package/dist/src/server/index.d.ts.map +1 -1
- package/dist/src/server/index.js +12 -1
- package/dist/src/server/index.js.map +1 -1
- package/package.json +1 -1
- package/web/dist/assets/index-DOzZY27d.js +473 -0
- package/web/dist/assets/index-w6Q6gxCS.css +1 -0
- package/web/dist/index.html +2 -2
- package/dist/board/factory.d.ts +0 -3
- package/dist/board/factory.d.ts.map +0 -1
- package/dist/board/factory.js +0 -10
- package/dist/board/factory.js.map +0 -1
- package/dist/board/providers/github-graphql.d.ts +0 -16
- package/dist/board/providers/github-graphql.d.ts.map +0 -1
- package/dist/board/providers/github-graphql.js +0 -43
- package/dist/board/providers/github-graphql.js.map +0 -1
- package/dist/board/providers/github-projects.d.ts +0 -51
- package/dist/board/providers/github-projects.d.ts.map +0 -1
- package/dist/board/providers/github-projects.js +0 -672
- package/dist/board/providers/github-projects.js.map +0 -1
- package/dist/board/types.d.ts +0 -60
- package/dist/board/types.d.ts.map +0 -1
- package/dist/board/types.js +0 -4
- package/dist/board/types.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -80
- package/dist/cli.js.map +0 -1
- package/dist/commands/board.d.ts +0 -9
- package/dist/commands/board.d.ts.map +0 -1
- package/dist/commands/board.js +0 -294
- package/dist/commands/board.js.map +0 -1
- package/dist/commands/cancel.d.ts +0 -46
- package/dist/commands/cancel.d.ts.map +0 -1
- package/dist/commands/cancel.js +0 -241
- package/dist/commands/cancel.js.map +0 -1
- package/dist/commands/dashboard/tab-actions.d.ts +0 -10
- package/dist/commands/dashboard/tab-actions.d.ts.map +0 -1
- package/dist/commands/dashboard/tab-actions.js +0 -245
- package/dist/commands/dashboard/tab-actions.js.map +0 -1
- package/dist/commands/dashboard/tab-config.d.ts +0 -21
- package/dist/commands/dashboard/tab-config.d.ts.map +0 -1
- package/dist/commands/dashboard/tab-config.js +0 -829
- package/dist/commands/dashboard/tab-config.js.map +0 -1
- package/dist/commands/dashboard/tab-logs.d.ts +0 -10
- package/dist/commands/dashboard/tab-logs.d.ts.map +0 -1
- package/dist/commands/dashboard/tab-logs.js +0 -178
- package/dist/commands/dashboard/tab-logs.js.map +0 -1
- package/dist/commands/dashboard/tab-schedules.d.ts +0 -21
- package/dist/commands/dashboard/tab-schedules.d.ts.map +0 -1
- package/dist/commands/dashboard/tab-schedules.js +0 -304
- package/dist/commands/dashboard/tab-schedules.js.map +0 -1
- package/dist/commands/dashboard/tab-status.d.ts +0 -32
- package/dist/commands/dashboard/tab-status.d.ts.map +0 -1
- package/dist/commands/dashboard/tab-status.js +0 -421
- package/dist/commands/dashboard/tab-status.js.map +0 -1
- package/dist/commands/dashboard/types.d.ts +0 -43
- package/dist/commands/dashboard/types.d.ts.map +0 -1
- package/dist/commands/dashboard/types.js +0 -5
- package/dist/commands/dashboard/types.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -11
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -239
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -16
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -202
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/history.d.ts +0 -7
- package/dist/commands/history.d.ts.map +0 -1
- package/dist/commands/history.js +0 -56
- package/dist/commands/history.js.map +0 -1
- package/dist/commands/init.d.ts +0 -25
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -534
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/install.d.ts +0 -48
- package/dist/commands/install.d.ts.map +0 -1
- package/dist/commands/install.js +0 -303
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -15
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -104
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/prd-state.d.ts +0 -12
- package/dist/commands/prd-state.d.ts.map +0 -1
- package/dist/commands/prd-state.js +0 -47
- package/dist/commands/prd-state.js.map +0 -1
- package/dist/commands/prd.d.ts +0 -24
- package/dist/commands/prd.d.ts.map +0 -1
- package/dist/commands/prd.js +0 -283
- package/dist/commands/prd.js.map +0 -1
- package/dist/commands/prds.d.ts +0 -13
- package/dist/commands/prds.d.ts.map +0 -1
- package/dist/commands/prds.js +0 -196
- package/dist/commands/prds.js.map +0 -1
- package/dist/commands/prs.d.ts +0 -14
- package/dist/commands/prs.d.ts.map +0 -1
- package/dist/commands/prs.js +0 -106
- package/dist/commands/prs.js.map +0 -1
- package/dist/commands/qa.d.ts +0 -30
- package/dist/commands/qa.d.ts.map +0 -1
- package/dist/commands/qa.js +0 -159
- package/dist/commands/qa.js.map +0 -1
- package/dist/commands/retry.d.ts +0 -9
- package/dist/commands/retry.d.ts.map +0 -1
- package/dist/commands/retry.js +0 -72
- package/dist/commands/retry.js.map +0 -1
- package/dist/commands/review.d.ts +0 -35
- package/dist/commands/review.d.ts.map +0 -1
- package/dist/commands/review.js +0 -252
- package/dist/commands/review.js.map +0 -1
- package/dist/commands/run.d.ts +0 -61
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -364
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/serve.d.ts +0 -7
- package/dist/commands/serve.d.ts.map +0 -1
- package/dist/commands/serve.js +0 -27
- package/dist/commands/serve.js.map +0 -1
- package/dist/commands/slice.d.ts +0 -26
- package/dist/commands/slice.d.ts.map +0 -1
- package/dist/commands/slice.js +0 -175
- package/dist/commands/slice.js.map +0 -1
- package/dist/commands/state.d.ts +0 -8
- package/dist/commands/state.d.ts.map +0 -1
- package/dist/commands/state.js +0 -56
- package/dist/commands/state.js.map +0 -1
- package/dist/commands/status.d.ts +0 -14
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -147
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/uninstall.d.ts +0 -25
- package/dist/commands/uninstall.d.ts.map +0 -1
- package/dist/commands/uninstall.js +0 -141
- package/dist/commands/uninstall.js.map +0 -1
- package/dist/commands/update.d.ts +0 -21
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -87
- package/dist/commands/update.js.map +0 -1
- package/dist/config.d.ts +0 -23
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -601
- package/dist/config.js.map +0 -1
- package/dist/constants.d.ts +0 -59
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -110
- package/dist/constants.js.map +0 -1
- package/dist/server/index.d.ts +0 -23
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -1074
- package/dist/server/index.js.map +0 -1
- package/dist/storage/json-state-migrator.d.ts +0 -24
- package/dist/storage/json-state-migrator.d.ts.map +0 -1
- package/dist/storage/json-state-migrator.js +0 -197
- package/dist/storage/json-state-migrator.js.map +0 -1
- package/dist/storage/repositories/index.d.ts +0 -23
- package/dist/storage/repositories/index.d.ts.map +0 -1
- package/dist/storage/repositories/index.js +0 -37
- package/dist/storage/repositories/index.js.map +0 -1
- package/dist/storage/repositories/interfaces.d.ts +0 -37
- package/dist/storage/repositories/interfaces.d.ts.map +0 -1
- package/dist/storage/repositories/interfaces.js +0 -6
- package/dist/storage/repositories/interfaces.js.map +0 -1
- package/dist/storage/repositories/sqlite/execution-history-repository.d.ts +0 -21
- package/dist/storage/repositories/sqlite/execution-history-repository.d.ts.map +0 -1
- package/dist/storage/repositories/sqlite/execution-history-repository.js +0 -94
- package/dist/storage/repositories/sqlite/execution-history-repository.js.map +0 -1
- package/dist/storage/repositories/sqlite/prd-state-repository.d.ts +0 -17
- package/dist/storage/repositories/sqlite/prd-state-repository.d.ts.map +0 -1
- package/dist/storage/repositories/sqlite/prd-state-repository.js +0 -74
- package/dist/storage/repositories/sqlite/prd-state-repository.js.map +0 -1
- package/dist/storage/repositories/sqlite/project-registry-repository.d.ts +0 -16
- package/dist/storage/repositories/sqlite/project-registry-repository.d.ts.map +0 -1
- package/dist/storage/repositories/sqlite/project-registry-repository.js +0 -34
- package/dist/storage/repositories/sqlite/project-registry-repository.js.map +0 -1
- package/dist/storage/repositories/sqlite/roadmap-state-repository.d.ts +0 -14
- package/dist/storage/repositories/sqlite/roadmap-state-repository.d.ts.map +0 -1
- package/dist/storage/repositories/sqlite/roadmap-state-repository.js +0 -47
- package/dist/storage/repositories/sqlite/roadmap-state-repository.js.map +0 -1
- package/dist/storage/sqlite/client.d.ts +0 -23
- package/dist/storage/sqlite/client.d.ts.map +0 -1
- package/dist/storage/sqlite/client.js +0 -47
- package/dist/storage/sqlite/client.js.map +0 -1
- package/dist/storage/sqlite/migrations.d.ts +0 -11
- package/dist/storage/sqlite/migrations.d.ts.map +0 -1
- package/dist/storage/sqlite/migrations.js +0 -57
- package/dist/storage/sqlite/migrations.js.map +0 -1
- package/dist/templates/prd-template.d.ts +0 -11
- package/dist/templates/prd-template.d.ts.map +0 -1
- package/dist/templates/prd-template.js +0 -166
- package/dist/templates/prd-template.js.map +0 -1
- package/dist/templates/slicer-prompt.d.ts +0 -54
- package/dist/templates/slicer-prompt.d.ts.map +0 -1
- package/dist/templates/slicer-prompt.js +0 -163
- package/dist/templates/slicer-prompt.js.map +0 -1
- package/dist/types.d.ts +0 -123
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -5
- package/dist/types.js.map +0 -1
- package/dist/utils/checks.d.ts +0 -55
- package/dist/utils/checks.d.ts.map +0 -1
- package/dist/utils/checks.js +0 -246
- package/dist/utils/checks.js.map +0 -1
- package/dist/utils/config-writer.d.ts +0 -16
- package/dist/utils/config-writer.d.ts.map +0 -1
- package/dist/utils/config-writer.js +0 -45
- package/dist/utils/config-writer.js.map +0 -1
- package/dist/utils/crontab.d.ts +0 -62
- package/dist/utils/crontab.d.ts.map +0 -1
- package/dist/utils/crontab.js +0 -168
- package/dist/utils/crontab.js.map +0 -1
- package/dist/utils/execution-history.d.ts +0 -54
- package/dist/utils/execution-history.d.ts.map +0 -1
- package/dist/utils/execution-history.js +0 -80
- package/dist/utils/execution-history.js.map +0 -1
- package/dist/utils/github.d.ts +0 -40
- package/dist/utils/github.d.ts.map +0 -1
- package/dist/utils/github.js +0 -126
- package/dist/utils/github.js.map +0 -1
- package/dist/utils/notify.d.ts +0 -63
- package/dist/utils/notify.d.ts.map +0 -1
- package/dist/utils/notify.js +0 -264
- package/dist/utils/notify.js.map +0 -1
- package/dist/utils/prd-states.d.ts +0 -16
- package/dist/utils/prd-states.d.ts.map +0 -1
- package/dist/utils/prd-states.js +0 -28
- package/dist/utils/prd-states.js.map +0 -1
- package/dist/utils/registry.d.ts +0 -44
- package/dist/utils/registry.d.ts.map +0 -1
- package/dist/utils/registry.js +0 -86
- package/dist/utils/registry.js.map +0 -1
- package/dist/utils/roadmap-parser.d.ts +0 -45
- package/dist/utils/roadmap-parser.d.ts.map +0 -1
- package/dist/utils/roadmap-parser.js +0 -136
- package/dist/utils/roadmap-parser.js.map +0 -1
- package/dist/utils/roadmap-scanner.d.ts +0 -92
- package/dist/utils/roadmap-scanner.d.ts.map +0 -1
- package/dist/utils/roadmap-scanner.js +0 -349
- package/dist/utils/roadmap-scanner.js.map +0 -1
- package/dist/utils/roadmap-state.d.ts +0 -90
- package/dist/utils/roadmap-state.d.ts.map +0 -1
- package/dist/utils/roadmap-state.js +0 -154
- package/dist/utils/roadmap-state.js.map +0 -1
- package/dist/utils/script-result.d.ts +0 -12
- package/dist/utils/script-result.d.ts.map +0 -1
- package/dist/utils/script-result.js +0 -46
- package/dist/utils/script-result.js.map +0 -1
- package/dist/utils/shell.d.ts +0 -27
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/shell.js +0 -64
- package/dist/utils/shell.js.map +0 -1
- package/dist/utils/status-data.d.ts +0 -148
- package/dist/utils/status-data.d.ts.map +0 -1
- package/dist/utils/status-data.js +0 -593
- package/dist/utils/status-data.js.map +0 -1
- package/dist/utils/ui.d.ts +0 -55
- package/dist/utils/ui.d.ts.map +0 -1
- package/dist/utils/ui.js +0 -121
- package/dist/utils/ui.js.map +0 -1
- package/web/dist/assets/index-BtxQU4oX.css +0 -1
- package/web/dist/assets/index-CzAWcldp.js +0 -473
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite implementation of IPrdStateRepository.
|
|
3
|
-
* Persists PRD state entries in the `prd_states` table.
|
|
4
|
-
*/
|
|
5
|
-
export class SqlitePrdStateRepository {
|
|
6
|
-
_db;
|
|
7
|
-
constructor(db) {
|
|
8
|
-
this._db = db;
|
|
9
|
-
}
|
|
10
|
-
get(projectPath, prdName) {
|
|
11
|
-
const row = this._db
|
|
12
|
-
.prepare(`SELECT status, branch, timestamp
|
|
13
|
-
FROM prd_states
|
|
14
|
-
WHERE project_path = ? AND prd_name = ?`)
|
|
15
|
-
.get(projectPath, prdName);
|
|
16
|
-
if (!row) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
status: row.status,
|
|
21
|
-
branch: row.branch,
|
|
22
|
-
timestamp: row.timestamp,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
getAll(projectPath) {
|
|
26
|
-
const rows = this._db
|
|
27
|
-
.prepare(`SELECT prd_name, status, branch, timestamp
|
|
28
|
-
FROM prd_states
|
|
29
|
-
WHERE project_path = ?`)
|
|
30
|
-
.all(projectPath);
|
|
31
|
-
const result = {};
|
|
32
|
-
for (const row of rows) {
|
|
33
|
-
result[row.prd_name] = {
|
|
34
|
-
status: row.status,
|
|
35
|
-
branch: row.branch,
|
|
36
|
-
timestamp: row.timestamp,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
readAll() {
|
|
42
|
-
const rows = this._db
|
|
43
|
-
.prepare("SELECT project_path, prd_name, status, branch, timestamp FROM prd_states")
|
|
44
|
-
.all();
|
|
45
|
-
const result = {};
|
|
46
|
-
for (const row of rows) {
|
|
47
|
-
if (!result[row.project_path]) {
|
|
48
|
-
result[row.project_path] = {};
|
|
49
|
-
}
|
|
50
|
-
result[row.project_path][row.prd_name] = {
|
|
51
|
-
status: row.status,
|
|
52
|
-
branch: row.branch,
|
|
53
|
-
timestamp: row.timestamp,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
set(projectPath, prdName, entry) {
|
|
59
|
-
this._db
|
|
60
|
-
.prepare(`INSERT INTO prd_states (project_path, prd_name, status, branch, timestamp)
|
|
61
|
-
VALUES (?, ?, ?, ?, ?)
|
|
62
|
-
ON CONFLICT(project_path, prd_name)
|
|
63
|
-
DO UPDATE SET status = excluded.status,
|
|
64
|
-
branch = excluded.branch,
|
|
65
|
-
timestamp = excluded.timestamp`)
|
|
66
|
-
.run(projectPath, prdName, entry.status, entry.branch, entry.timestamp);
|
|
67
|
-
}
|
|
68
|
-
delete(projectPath, prdName) {
|
|
69
|
-
this._db
|
|
70
|
-
.prepare(`DELETE FROM prd_states WHERE project_path = ? AND prd_name = ?`)
|
|
71
|
-
.run(projectPath, prdName);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=prd-state-repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prd-state-repository.js","sourceRoot":"","sources":["../../../../src/storage/repositories/sqlite/prd-state-repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,MAAM,OAAO,wBAAwB;IAClB,GAAG,CAAoB;IAExC,YAAY,EAAqB;QAC/B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAChB,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,OAAe;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG;aACjB,OAAO,CACN;;iDAEyC,CAC1C;aACA,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE7B,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO;YACL,MAAM,EAAE,GAAG,CAAC,MAAkC;YAC9C,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,SAAS,EAAE,GAAG,CAAC,SAAS;SACzB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,WAAmB;QACxB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG;aAClB,OAAO,CACN;;gCAEwB,CACzB;aACA,GAAG,CAAC,WAAW,CAAC,CAAC;QAEpB,MAAM,MAAM,GAAmC,EAAE,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG;gBACrB,MAAM,EAAE,GAAG,CAAC,MAAkC;gBAC9C,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,SAAS,EAAE,GAAG,CAAC,SAAS;aACzB,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO;QACL,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG;aAClB,OAAO,CACN,0EAA0E,CAC3E;aACA,GAAG,EAAE,CAAC;QAET,MAAM,MAAM,GAAmD,EAAE,CAAC;QAClE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC9B,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YAChC,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG;gBACvC,MAAM,EAAE,GAAG,CAAC,MAAkC;gBAC9C,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,SAAS,EAAE,GAAG,CAAC,SAAS;aACzB,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,OAAe,EAAE,KAAqB;QAC7D,IAAI,CAAC,GAAG;aACL,OAAO,CACN;;;;;sDAK8C,CAC/C;aACA,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,CAAC,WAAmB,EAAE,OAAe;QACzC,IAAI,CAAC,GAAG;aACL,OAAO,CACN,gEAAgE,CACjE;aACA,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite implementation of IProjectRegistryRepository.
|
|
3
|
-
* Persists project registry entries in the `projects` table.
|
|
4
|
-
*/
|
|
5
|
-
import Database from "better-sqlite3";
|
|
6
|
-
import { IRegistryEntry } from "../../../utils/registry.js";
|
|
7
|
-
import { IProjectRegistryRepository } from "../interfaces.js";
|
|
8
|
-
export declare class SqliteProjectRegistryRepository implements IProjectRegistryRepository {
|
|
9
|
-
private readonly _db;
|
|
10
|
-
constructor(db: Database.Database);
|
|
11
|
-
getAll(): IRegistryEntry[];
|
|
12
|
-
upsert(entry: IRegistryEntry): void;
|
|
13
|
-
remove(projectPath: string): boolean;
|
|
14
|
-
clear(): void;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=project-registry-repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-registry-repository.d.ts","sourceRoot":"","sources":["../../../../src/storage/repositories/sqlite/project-registry-repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAQ9D,qBAAa,+BACX,YAAW,0BAA0B;IAErC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAoB;gBAE5B,EAAE,EAAE,QAAQ,CAAC,QAAQ;IAIjC,MAAM,IAAI,cAAc,EAAE;IAQ1B,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAYnC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAQpC,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite implementation of IProjectRegistryRepository.
|
|
3
|
-
* Persists project registry entries in the `projects` table.
|
|
4
|
-
*/
|
|
5
|
-
export class SqliteProjectRegistryRepository {
|
|
6
|
-
_db;
|
|
7
|
-
constructor(db) {
|
|
8
|
-
this._db = db;
|
|
9
|
-
}
|
|
10
|
-
getAll() {
|
|
11
|
-
const rows = this._db
|
|
12
|
-
.prepare("SELECT name, path FROM projects ORDER BY name")
|
|
13
|
-
.all();
|
|
14
|
-
return rows.map((row) => ({ name: row.name, path: row.path }));
|
|
15
|
-
}
|
|
16
|
-
upsert(entry) {
|
|
17
|
-
const createdAt = Math.floor(Date.now() / 1000);
|
|
18
|
-
this._db
|
|
19
|
-
.prepare(`INSERT INTO projects (name, path, created_at)
|
|
20
|
-
VALUES (?, ?, ?)
|
|
21
|
-
ON CONFLICT(path) DO UPDATE SET name = excluded.name`)
|
|
22
|
-
.run(entry.name, entry.path, createdAt);
|
|
23
|
-
}
|
|
24
|
-
remove(projectPath) {
|
|
25
|
-
const result = this._db
|
|
26
|
-
.prepare("DELETE FROM projects WHERE path = ?")
|
|
27
|
-
.run(projectPath);
|
|
28
|
-
return result.changes > 0;
|
|
29
|
-
}
|
|
30
|
-
clear() {
|
|
31
|
-
this._db.prepare("DELETE FROM projects").run();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=project-registry-repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-registry-repository.js","sourceRoot":"","sources":["../../../../src/storage/repositories/sqlite/project-registry-repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,MAAM,OAAO,+BAA+B;IAGzB,GAAG,CAAoB;IAExC,YAAY,EAAqB;QAC/B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG;aAClB,OAAO,CAAkB,+CAA+C,CAAC;aACzE,GAAG,EAAE,CAAC;QAET,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,KAAqB;QAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAEhD,IAAI,CAAC,GAAG;aACL,OAAO,CACN;;8DAEsD,CACvD;aACA,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,WAAmB;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG;aACpB,OAAO,CAAW,qCAAqC,CAAC;aACxD,GAAG,CAAC,WAAW,CAAC,CAAC;QAEpB,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,GAAG,EAAE,CAAC;IACjD,CAAC;CACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite implementation of IRoadmapStateRepository.
|
|
3
|
-
* Persists roadmap state in the `roadmap_states` table, keyed by prd_dir.
|
|
4
|
-
*/
|
|
5
|
-
import Database from "better-sqlite3";
|
|
6
|
-
import { IRoadmapState } from "../../../utils/roadmap-state.js";
|
|
7
|
-
import { IRoadmapStateRepository } from "../interfaces.js";
|
|
8
|
-
export declare class SqliteRoadmapStateRepository implements IRoadmapStateRepository {
|
|
9
|
-
private readonly _db;
|
|
10
|
-
constructor(db: Database.Database);
|
|
11
|
-
load(prdDir: string): IRoadmapState | null;
|
|
12
|
-
save(prdDir: string, state: IRoadmapState): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=roadmap-state-repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roadmap-state-repository.d.ts","sourceRoot":"","sources":["../../../../src/storage/repositories/sqlite/roadmap-state-repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAS3D,qBAAa,4BAA6B,YAAW,uBAAuB;IAC1E,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAoB;gBAE5B,EAAE,EAAE,QAAQ,CAAC,QAAQ;IAIjC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IA8B1C,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI;CAcjD"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite implementation of IRoadmapStateRepository.
|
|
3
|
-
* Persists roadmap state in the `roadmap_states` table, keyed by prd_dir.
|
|
4
|
-
*/
|
|
5
|
-
export class SqliteRoadmapStateRepository {
|
|
6
|
-
_db;
|
|
7
|
-
constructor(db) {
|
|
8
|
-
this._db = db;
|
|
9
|
-
}
|
|
10
|
-
load(prdDir) {
|
|
11
|
-
const row = this._db
|
|
12
|
-
.prepare(`SELECT version, last_scan, items_json
|
|
13
|
-
FROM roadmap_states
|
|
14
|
-
WHERE prd_dir = ?`)
|
|
15
|
-
.get(prdDir);
|
|
16
|
-
if (!row) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
let items = {};
|
|
20
|
-
try {
|
|
21
|
-
const parsed = JSON.parse(row.items_json);
|
|
22
|
-
if (typeof parsed === "object" && parsed !== null) {
|
|
23
|
-
items = parsed;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
items = {};
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
version: row.version,
|
|
31
|
-
lastScan: row.last_scan,
|
|
32
|
-
items,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
save(prdDir, state) {
|
|
36
|
-
const itemsJson = JSON.stringify(state.items);
|
|
37
|
-
this._db
|
|
38
|
-
.prepare(`INSERT INTO roadmap_states (prd_dir, version, last_scan, items_json)
|
|
39
|
-
VALUES (?, ?, ?, ?)
|
|
40
|
-
ON CONFLICT(prd_dir)
|
|
41
|
-
DO UPDATE SET version = excluded.version,
|
|
42
|
-
last_scan = excluded.last_scan,
|
|
43
|
-
items_json = excluded.items_json`)
|
|
44
|
-
.run(prdDir, state.version, state.lastScan, itemsJson);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=roadmap-state-repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roadmap-state-repository.js","sourceRoot":"","sources":["../../../../src/storage/repositories/sqlite/roadmap-state-repository.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,MAAM,OAAO,4BAA4B;IACtB,GAAG,CAAoB;IAExC,YAAY,EAAqB;QAC/B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG;aACjB,OAAO,CACN;;2BAEmB,CACpB;aACA,GAAG,CAAC,MAAM,CAAC,CAAC;QAEf,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,KAAK,GAA2B,EAAE,CAAC;QACvC,IAAI,CAAC;YACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACnD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClD,KAAK,GAAG,MAAgC,CAAC;YAC3C,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,GAAG,EAAE,CAAC;QACb,CAAC;QAED,OAAO;YACL,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,QAAQ,EAAE,GAAG,CAAC,SAAS;YACvB,KAAK;SACN,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAc,EAAE,KAAoB;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE9C,IAAI,CAAC,GAAG;aACL,OAAO,CACN;;;;;wDAKgD,CACjD;aACA,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite database client for Night Watch CLI
|
|
3
|
-
* Opens (or creates) the database at ${NIGHT_WATCH_HOME}/state.db
|
|
4
|
-
* Applies WAL journal mode and busy_timeout pragmas on open.
|
|
5
|
-
*/
|
|
6
|
-
import Database from "better-sqlite3";
|
|
7
|
-
/**
|
|
8
|
-
* Get the path to the SQLite database file.
|
|
9
|
-
* Mirrors the same pattern used by getRegistryPath() and getHistoryPath().
|
|
10
|
-
*/
|
|
11
|
-
export declare function getDbPath(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Return the singleton Database instance, creating it on first call.
|
|
14
|
-
* The database directory is created if it does not exist.
|
|
15
|
-
* Pragmas applied: journal_mode = WAL, busy_timeout = 5000.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getDb(): Database.Database;
|
|
18
|
-
/**
|
|
19
|
-
* Close the current singleton database connection and reset it.
|
|
20
|
-
* Primarily useful in tests to allow re-opening against a different path.
|
|
21
|
-
*/
|
|
22
|
-
export declare function closeDb(): void;
|
|
23
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/storage/sqlite/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAMtC;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAIlC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,QAAQ,CAAC,QAAQ,CAezC;AAED;;;GAGG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAK9B"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite database client for Night Watch CLI
|
|
3
|
-
* Opens (or creates) the database at ${NIGHT_WATCH_HOME}/state.db
|
|
4
|
-
* Applies WAL journal mode and busy_timeout pragmas on open.
|
|
5
|
-
*/
|
|
6
|
-
import * as fs from "fs";
|
|
7
|
-
import * as os from "os";
|
|
8
|
-
import * as path from "path";
|
|
9
|
-
import Database from "better-sqlite3";
|
|
10
|
-
import { GLOBAL_CONFIG_DIR, STATE_DB_FILE_NAME } from "../../constants.js";
|
|
11
|
-
let _db = null;
|
|
12
|
-
/**
|
|
13
|
-
* Get the path to the SQLite database file.
|
|
14
|
-
* Mirrors the same pattern used by getRegistryPath() and getHistoryPath().
|
|
15
|
-
*/
|
|
16
|
-
export function getDbPath() {
|
|
17
|
-
const base = process.env.NIGHT_WATCH_HOME || path.join(os.homedir(), GLOBAL_CONFIG_DIR);
|
|
18
|
-
return path.join(base, STATE_DB_FILE_NAME);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Return the singleton Database instance, creating it on first call.
|
|
22
|
-
* The database directory is created if it does not exist.
|
|
23
|
-
* Pragmas applied: journal_mode = WAL, busy_timeout = 5000.
|
|
24
|
-
*/
|
|
25
|
-
export function getDb() {
|
|
26
|
-
if (_db) {
|
|
27
|
-
return _db;
|
|
28
|
-
}
|
|
29
|
-
const dbPath = getDbPath();
|
|
30
|
-
fs.mkdirSync(path.dirname(dbPath), { recursive: true });
|
|
31
|
-
const db = new Database(dbPath);
|
|
32
|
-
db.pragma("journal_mode = WAL");
|
|
33
|
-
db.pragma("busy_timeout = 5000");
|
|
34
|
-
_db = db;
|
|
35
|
-
return _db;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Close the current singleton database connection and reset it.
|
|
39
|
-
* Primarily useful in tests to allow re-opening against a different path.
|
|
40
|
-
*/
|
|
41
|
-
export function closeDb() {
|
|
42
|
-
if (_db) {
|
|
43
|
-
_db.close();
|
|
44
|
-
_db = null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/storage/sqlite/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,IAAI,GAAG,GAA6B,IAAI,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,IAAI,GACR,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK;IACnB,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAExD,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEhC,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAChC,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAEjC,GAAG,GAAG,EAAE,CAAC;IACT,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO;IACrB,IAAI,GAAG,EAAE,CAAC;QACR,GAAG,CAAC,KAAK,EAAE,CAAC;QACZ,GAAG,GAAG,IAAI,CAAC;IACb,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite schema migrations for Night Watch CLI.
|
|
3
|
-
* Creates all required tables if they do not already exist (idempotent).
|
|
4
|
-
*/
|
|
5
|
-
import Database from "better-sqlite3";
|
|
6
|
-
/**
|
|
7
|
-
* Run all migrations against the provided database instance.
|
|
8
|
-
* Safe to call multiple times — all DDL statements use IF NOT EXISTS.
|
|
9
|
-
*/
|
|
10
|
-
export declare function runMigrations(db: Database.Database): void;
|
|
11
|
-
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/storage/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAKtC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAgDzD"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQLite schema migrations for Night Watch CLI.
|
|
3
|
-
* Creates all required tables if they do not already exist (idempotent).
|
|
4
|
-
*/
|
|
5
|
-
/** Current schema version */
|
|
6
|
-
const SCHEMA_VERSION = "1";
|
|
7
|
-
/**
|
|
8
|
-
* Run all migrations against the provided database instance.
|
|
9
|
-
* Safe to call multiple times — all DDL statements use IF NOT EXISTS.
|
|
10
|
-
*/
|
|
11
|
-
export function runMigrations(db) {
|
|
12
|
-
db.exec(`
|
|
13
|
-
CREATE TABLE IF NOT EXISTS projects (
|
|
14
|
-
id INTEGER PRIMARY KEY,
|
|
15
|
-
name TEXT NOT NULL,
|
|
16
|
-
path TEXT NOT NULL UNIQUE,
|
|
17
|
-
created_at INTEGER NOT NULL
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
CREATE TABLE IF NOT EXISTS execution_history (
|
|
21
|
-
id INTEGER PRIMARY KEY,
|
|
22
|
-
project_path TEXT NOT NULL,
|
|
23
|
-
prd_file TEXT NOT NULL,
|
|
24
|
-
timestamp INTEGER NOT NULL,
|
|
25
|
-
outcome TEXT NOT NULL,
|
|
26
|
-
exit_code INTEGER NOT NULL,
|
|
27
|
-
attempt INTEGER NOT NULL
|
|
28
|
-
);
|
|
29
|
-
CREATE INDEX IF NOT EXISTS idx_history_lookup
|
|
30
|
-
ON execution_history(project_path, prd_file, timestamp DESC);
|
|
31
|
-
|
|
32
|
-
CREATE TABLE IF NOT EXISTS prd_states (
|
|
33
|
-
project_path TEXT NOT NULL,
|
|
34
|
-
prd_name TEXT NOT NULL,
|
|
35
|
-
status TEXT NOT NULL,
|
|
36
|
-
branch TEXT NOT NULL,
|
|
37
|
-
timestamp INTEGER NOT NULL,
|
|
38
|
-
PRIMARY KEY(project_path, prd_name)
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
CREATE TABLE IF NOT EXISTS roadmap_states (
|
|
42
|
-
prd_dir TEXT PRIMARY KEY,
|
|
43
|
-
version INTEGER NOT NULL,
|
|
44
|
-
last_scan TEXT NOT NULL,
|
|
45
|
-
items_json TEXT NOT NULL
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
CREATE TABLE IF NOT EXISTS schema_meta (
|
|
49
|
-
key TEXT PRIMARY KEY,
|
|
50
|
-
value TEXT NOT NULL
|
|
51
|
-
);
|
|
52
|
-
`);
|
|
53
|
-
// Upsert the current schema version into schema_meta
|
|
54
|
-
db.prepare(`INSERT INTO schema_meta (key, value) VALUES ('schema_version', ?)
|
|
55
|
-
ON CONFLICT(key) DO UPDATE SET value = excluded.value`).run(SCHEMA_VERSION);
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=migrations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../src/storage/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,6BAA6B;AAC7B,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAAqB;IACjD,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCP,CAAC,CAAC;IAEH,qDAAqD;IACrD,EAAE,CAAC,OAAO,CACR;2DACuD,CACxD,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const PRD_TEMPLATE = "# PRD: {{TITLE}}\n\n{{DEPENDS_ON}}\n\n**Complexity: {{COMPLEXITY_SCORE}} \u2192 {{COMPLEXITY_LEVEL}} mode**\n{{COMPLEXITY_BREAKDOWN}}\n\n```\nCOMPLEXITY SCORE (sum all that apply):\n+1 Touches 1-5 files\n+2 Touches 6-10 files\n+3 Touches 10+ files\n+2 New system/module from scratch\n+2 Complex state logic / concurrency\n+2 Multi-package changes\n+1 Database schema changes\n+1 External API integration\n\n| Score | Level | Template Mode |\n| ----- | ------ | ----------------------------------------------- |\n| 1-3 | LOW | Minimal (skip sections marked with MEDIUM/HIGH) |\n| 4-6 | MEDIUM | Standard (all sections) |\n| 7+ | HIGH | Full + mandatory checkpoints every phase |\n```\n\n---\n\n## 1. Context\n\n**Problem:** <!-- 1-2 sentences describing the issue being solved -->\n\n**Files Analyzed:**\n<!-- List all files you've inspected before planning -->\n\n**Current Behavior:**\n<!-- 3-5 bullets describing current state -->\n\n### Integration Points Checklist\n\n**How will this feature be reached?**\n- [ ] Entry point identified: <!-- e.g., route, event, cron, CLI command -->\n- [ ] Caller file identified: <!-- file that will invoke this new code -->\n- [ ] Registration/wiring needed: <!-- e.g., add route to router, register handler, add menu item -->\n\n**Is this user-facing?**\n- [ ] YES \u2192 UI components required (list them)\n- [ ] NO \u2192 Internal/background feature (explain how it's triggered)\n\n**Full user flow:**\n1. User does: <!-- action -->\n2. Triggers: <!-- what code path -->\n3. Reaches new feature via: <!-- specific connection point -->\n4. Result displayed in: <!-- where user sees outcome -->\n\n---\n\n## 2. Solution\n\n**Approach:**\n<!-- 3-5 bullets explaining the chosen solution -->\n\n**Architecture Diagram** <!-- (MEDIUM/HIGH complexity) -->:\n\n```mermaid\nflowchart LR\n A[Component A] --> B[Component B] --> C[Component C]\n```\n\n**Key Decisions:**\n<!-- Library/framework choices, error-handling strategy, reused utilities -->\n\n**Data Changes:** <!-- New schemas/migrations, or \"None\" -->\n\n---\n\n## 3. Sequence Flow <!-- (MEDIUM/HIGH complexity) -->\n\n```mermaid\nsequenceDiagram\n participant A as Component A\n participant B as Component B\n A->>B: methodName(args)\n alt Error case\n B-->>A: ErrorType\n else Success\n B-->>A: Response\n end\n```\n\n---\n\n## 4. Execution Phases\n\n**CRITICAL RULES:**\n1. Each phase = ONE user-testable vertical slice\n2. Max 5 files per phase (split if larger)\n3. Each phase MUST include concrete tests\n4. Checkpoint after each phase (automated ALWAYS required)\n\n{{PHASES}}\n\n---\n\n## 5. Acceptance Criteria\n\n- [ ] All phases complete\n- [ ] All specified tests pass\n- [ ] Verification commands pass\n- [ ] All automated checkpoint reviews passed\n- [ ] Feature is reachable (entry point connected, not orphaned code)\n- [ ] <!-- additional criterion -->\n- [ ] <!-- additional criterion -->\n";
|
|
2
|
-
export interface IPrdTemplateVars {
|
|
3
|
-
title: string;
|
|
4
|
-
dependsOn: string[];
|
|
5
|
-
complexityScore: number;
|
|
6
|
-
complexityLevel: "LOW" | "MEDIUM" | "HIGH";
|
|
7
|
-
complexityBreakdown: string[];
|
|
8
|
-
phaseCount: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function renderPrdTemplate(vars: IPrdTemplateVars, customTemplate?: string): string;
|
|
11
|
-
//# sourceMappingURL=prd-template.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prd-template.d.ts","sourceRoot":"","sources":["../../src/templates/prd-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,u9FAgHxB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AA8CD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CAkBR"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
export const PRD_TEMPLATE = `# PRD: {{TITLE}}
|
|
2
|
-
|
|
3
|
-
{{DEPENDS_ON}}
|
|
4
|
-
|
|
5
|
-
**Complexity: {{COMPLEXITY_SCORE}} → {{COMPLEXITY_LEVEL}} mode**
|
|
6
|
-
{{COMPLEXITY_BREAKDOWN}}
|
|
7
|
-
|
|
8
|
-
\`\`\`
|
|
9
|
-
COMPLEXITY SCORE (sum all that apply):
|
|
10
|
-
+1 Touches 1-5 files
|
|
11
|
-
+2 Touches 6-10 files
|
|
12
|
-
+3 Touches 10+ files
|
|
13
|
-
+2 New system/module from scratch
|
|
14
|
-
+2 Complex state logic / concurrency
|
|
15
|
-
+2 Multi-package changes
|
|
16
|
-
+1 Database schema changes
|
|
17
|
-
+1 External API integration
|
|
18
|
-
|
|
19
|
-
| Score | Level | Template Mode |
|
|
20
|
-
| ----- | ------ | ----------------------------------------------- |
|
|
21
|
-
| 1-3 | LOW | Minimal (skip sections marked with MEDIUM/HIGH) |
|
|
22
|
-
| 4-6 | MEDIUM | Standard (all sections) |
|
|
23
|
-
| 7+ | HIGH | Full + mandatory checkpoints every phase |
|
|
24
|
-
\`\`\`
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 1. Context
|
|
29
|
-
|
|
30
|
-
**Problem:** <!-- 1-2 sentences describing the issue being solved -->
|
|
31
|
-
|
|
32
|
-
**Files Analyzed:**
|
|
33
|
-
<!-- List all files you've inspected before planning -->
|
|
34
|
-
|
|
35
|
-
**Current Behavior:**
|
|
36
|
-
<!-- 3-5 bullets describing current state -->
|
|
37
|
-
|
|
38
|
-
### Integration Points Checklist
|
|
39
|
-
|
|
40
|
-
**How will this feature be reached?**
|
|
41
|
-
- [ ] Entry point identified: <!-- e.g., route, event, cron, CLI command -->
|
|
42
|
-
- [ ] Caller file identified: <!-- file that will invoke this new code -->
|
|
43
|
-
- [ ] Registration/wiring needed: <!-- e.g., add route to router, register handler, add menu item -->
|
|
44
|
-
|
|
45
|
-
**Is this user-facing?**
|
|
46
|
-
- [ ] YES → UI components required (list them)
|
|
47
|
-
- [ ] NO → Internal/background feature (explain how it's triggered)
|
|
48
|
-
|
|
49
|
-
**Full user flow:**
|
|
50
|
-
1. User does: <!-- action -->
|
|
51
|
-
2. Triggers: <!-- what code path -->
|
|
52
|
-
3. Reaches new feature via: <!-- specific connection point -->
|
|
53
|
-
4. Result displayed in: <!-- where user sees outcome -->
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## 2. Solution
|
|
58
|
-
|
|
59
|
-
**Approach:**
|
|
60
|
-
<!-- 3-5 bullets explaining the chosen solution -->
|
|
61
|
-
|
|
62
|
-
**Architecture Diagram** <!-- (MEDIUM/HIGH complexity) -->:
|
|
63
|
-
|
|
64
|
-
\`\`\`mermaid
|
|
65
|
-
flowchart LR
|
|
66
|
-
A[Component A] --> B[Component B] --> C[Component C]
|
|
67
|
-
\`\`\`
|
|
68
|
-
|
|
69
|
-
**Key Decisions:**
|
|
70
|
-
<!-- Library/framework choices, error-handling strategy, reused utilities -->
|
|
71
|
-
|
|
72
|
-
**Data Changes:** <!-- New schemas/migrations, or "None" -->
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## 3. Sequence Flow <!-- (MEDIUM/HIGH complexity) -->
|
|
77
|
-
|
|
78
|
-
\`\`\`mermaid
|
|
79
|
-
sequenceDiagram
|
|
80
|
-
participant A as Component A
|
|
81
|
-
participant B as Component B
|
|
82
|
-
A->>B: methodName(args)
|
|
83
|
-
alt Error case
|
|
84
|
-
B-->>A: ErrorType
|
|
85
|
-
else Success
|
|
86
|
-
B-->>A: Response
|
|
87
|
-
end
|
|
88
|
-
\`\`\`
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## 4. Execution Phases
|
|
93
|
-
|
|
94
|
-
**CRITICAL RULES:**
|
|
95
|
-
1. Each phase = ONE user-testable vertical slice
|
|
96
|
-
2. Max 5 files per phase (split if larger)
|
|
97
|
-
3. Each phase MUST include concrete tests
|
|
98
|
-
4. Checkpoint after each phase (automated ALWAYS required)
|
|
99
|
-
|
|
100
|
-
{{PHASES}}
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## 5. Acceptance Criteria
|
|
105
|
-
|
|
106
|
-
- [ ] All phases complete
|
|
107
|
-
- [ ] All specified tests pass
|
|
108
|
-
- [ ] Verification commands pass
|
|
109
|
-
- [ ] All automated checkpoint reviews passed
|
|
110
|
-
- [ ] Feature is reachable (entry point connected, not orphaned code)
|
|
111
|
-
- [ ] <!-- additional criterion -->
|
|
112
|
-
- [ ] <!-- additional criterion -->
|
|
113
|
-
`;
|
|
114
|
-
function renderDependsOn(deps) {
|
|
115
|
-
if (deps.length === 0) {
|
|
116
|
-
return "";
|
|
117
|
-
}
|
|
118
|
-
const formatted = deps.map((d) => `\`${d}\``).join(", ");
|
|
119
|
-
return `**Depends on:** ${formatted}`;
|
|
120
|
-
}
|
|
121
|
-
function renderComplexityBreakdown(items) {
|
|
122
|
-
if (items.length === 0) {
|
|
123
|
-
return "";
|
|
124
|
-
}
|
|
125
|
-
return items.map((item) => `- ${item}`).join("\n");
|
|
126
|
-
}
|
|
127
|
-
function renderPhases(count) {
|
|
128
|
-
const phases = [];
|
|
129
|
-
for (let i = 1; i <= count; i++) {
|
|
130
|
-
phases.push(`### Phase ${i}: [Name] — [User-visible outcome in 1 sentence]
|
|
131
|
-
|
|
132
|
-
**Files (max 5):**
|
|
133
|
-
- \`src/path/file.ts\` — what changes
|
|
134
|
-
|
|
135
|
-
**Implementation:**
|
|
136
|
-
- [ ] Step 1
|
|
137
|
-
- [ ] Step 2
|
|
138
|
-
|
|
139
|
-
**Tests Required:**
|
|
140
|
-
| Test File | Test Name | Assertion |
|
|
141
|
-
|-----------|-----------|-----------|
|
|
142
|
-
| \`src/__tests__/feature.test.ts\` | \`should do X when Y\` | \`expect(result).toBe(Z)\` |
|
|
143
|
-
|
|
144
|
-
**Verification Plan:**
|
|
145
|
-
1. **Unit Tests:** File and test names
|
|
146
|
-
2. **Integration Test:** (if applicable)
|
|
147
|
-
3. **User Verification:**
|
|
148
|
-
- Action: [what to do]
|
|
149
|
-
- Expected: [what should happen]
|
|
150
|
-
|
|
151
|
-
**Checkpoint:** Run automated review after this phase completes.`);
|
|
152
|
-
}
|
|
153
|
-
return phases.join("\n\n---\n\n");
|
|
154
|
-
}
|
|
155
|
-
export function renderPrdTemplate(vars, customTemplate) {
|
|
156
|
-
const template = customTemplate ?? PRD_TEMPLATE;
|
|
157
|
-
let result = template;
|
|
158
|
-
result = result.replace("{{TITLE}}", vars.title);
|
|
159
|
-
result = result.replace("{{DEPENDS_ON}}", renderDependsOn(vars.dependsOn));
|
|
160
|
-
result = result.replace("{{COMPLEXITY_SCORE}}", String(vars.complexityScore));
|
|
161
|
-
result = result.replace("{{COMPLEXITY_LEVEL}}", vars.complexityLevel);
|
|
162
|
-
result = result.replace("{{COMPLEXITY_BREAKDOWN}}", renderComplexityBreakdown(vars.complexityBreakdown));
|
|
163
|
-
result = result.replace("{{PHASES}}", renderPhases(vars.phaseCount));
|
|
164
|
-
return result;
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=prd-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prd-template.js","sourceRoot":"","sources":["../../src/templates/prd-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgH3B,CAAC;AAWF,SAAS,eAAe,CAAC,IAAc;IACrC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,OAAO,mBAAmB,SAAS,EAAE,CAAC;AACxC,CAAC;AAED,SAAS,yBAAyB,CAAC,KAAe;IAChD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;iEAqBmC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,IAAsB,EACtB,cAAuB;IAEvB,MAAM,QAAQ,GAAG,cAAc,IAAI,YAAY,CAAC;IAEhD,IAAI,MAAM,GAAG,QAAQ,CAAC;IACtB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3E,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,sBAAsB,EACtB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAC7B,CAAC;IACF,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,0BAA0B,EAC1B,yBAAyB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CACpD,CAAC;IACF,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAErE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slicer Prompt Template
|
|
3
|
-
*
|
|
4
|
-
* Provides functionality to render the AI prompt for generating PRDs from roadmap items.
|
|
5
|
-
* The template is loaded from templates/night-watch-slicer.md and interpolated with
|
|
6
|
-
* runtime values from the roadmap item being processed.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Variables needed to render the slicer prompt
|
|
10
|
-
*/
|
|
11
|
-
export interface ISlicerPromptVars {
|
|
12
|
-
/** The title of the roadmap item */
|
|
13
|
-
title: string;
|
|
14
|
-
/** The section/category of the roadmap item */
|
|
15
|
-
section: string;
|
|
16
|
-
/** The description of the roadmap item */
|
|
17
|
-
description: string;
|
|
18
|
-
/** The full path where the PRD should be written */
|
|
19
|
-
outputFilePath: string;
|
|
20
|
-
/** The directory containing PRDs */
|
|
21
|
-
prdDir: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Load the slicer prompt template from the templates directory.
|
|
25
|
-
* Falls back to the default template if the file cannot be read.
|
|
26
|
-
*
|
|
27
|
-
* @param templateDir - Optional custom template directory
|
|
28
|
-
* @returns The template string
|
|
29
|
-
*/
|
|
30
|
-
export declare function loadSlicerTemplate(templateDir?: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Clear the cached template (useful for testing)
|
|
33
|
-
*/
|
|
34
|
-
export declare function clearTemplateCache(): void;
|
|
35
|
-
/**
|
|
36
|
-
* Render the slicer prompt by interpolating the template with the provided variables.
|
|
37
|
-
*
|
|
38
|
-
* @param vars - The variables to interpolate into the template
|
|
39
|
-
* @param customTemplate - Optional custom template to use instead of the default
|
|
40
|
-
* @returns The rendered prompt string
|
|
41
|
-
*/
|
|
42
|
-
export declare function renderSlicerPrompt(vars: ISlicerPromptVars, customTemplate?: string): string;
|
|
43
|
-
/**
|
|
44
|
-
* Create slicer prompt variables from a roadmap item.
|
|
45
|
-
*
|
|
46
|
-
* @param item - The roadmap item title
|
|
47
|
-
* @param section - The roadmap item section
|
|
48
|
-
* @param description - The roadmap item description
|
|
49
|
-
* @param prdDir - The PRD directory path
|
|
50
|
-
* @param prdFilename - The filename for the new PRD
|
|
51
|
-
* @returns The slicer prompt variables
|
|
52
|
-
*/
|
|
53
|
-
export declare function createSlicerPromptVars(title: string, section: string, description: string, prdDir: string, prdFilename: string): ISlicerPromptVars;
|
|
54
|
-
//# sourceMappingURL=slicer-prompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slicer-prompt.d.ts","sourceRoot":"","sources":["../../src/templates/slicer-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAyFD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAoB/D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CAaR;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,iBAAiB,CAQnB"}
|