@thxgg/steward 0.1.16 → 0.1.18
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{CxHOXVf6.js → -z_Gr0GN.js} +1 -1
- package/.output/public/_nuxt/5LlyHjkF.js +60 -0
- package/.output/public/_nuxt/BA0u_CRT.js +1 -0
- package/.output/public/_nuxt/{Bibm_IDv.js → BA4e9-N5.js} +2 -2
- package/.output/public/_nuxt/{BSA0RJ-H.js → BO8EM227.js} +1 -1
- package/.output/public/_nuxt/C0XT5P3Q.js +1 -0
- package/.output/public/_nuxt/{BWVTacYj.js → CGzrvVc6.js} +1 -1
- package/.output/public/_nuxt/{Dum5qplW.js → CJlXUkTg.js} +1 -1
- package/.output/public/_nuxt/CZsXZugv.js +1 -0
- package/.output/public/_nuxt/{ynmyrfyT.js → C_HVaH3B.js} +1 -1
- package/.output/public/_nuxt/{wbjFvimm.js → DAnnHVQP.js} +1 -1
- package/.output/public/_nuxt/DEr8q68O.js +141 -0
- package/.output/public/_nuxt/Detail.DSyVQNdr.css +1 -0
- package/.output/public/_nuxt/DrXxYwWw.js +30 -0
- package/.output/public/_nuxt/QAzsKGuP.js +1 -0
- package/.output/public/_nuxt/TSsR_oCL.js +1 -0
- package/.output/public/_nuxt/WUF6Thhn.js +13 -0
- package/.output/public/_nuxt/_prd_.BkpxMFSV.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/19e0e040-a531-4c25-b46d-a6ca54a1ae3e.json +1 -0
- package/.output/public/_nuxt/i9wn3hS7.js +1 -0
- package/.output/server/chunks/_/git-api.mjs +101 -8
- package/.output/server/chunks/_/git-api.mjs.map +1 -1
- package/.output/server/chunks/_/git.mjs +3 -10
- package/.output/server/chunks/_/git.mjs.map +1 -1
- package/.output/server/chunks/_/prd-service.mjs +366 -0
- package/.output/server/chunks/_/prd-service.mjs.map +1 -0
- package/.output/server/chunks/_/repos.mjs +448 -0
- package/.output/server/chunks/_/repos.mjs.map +1 -0
- package/.output/server/chunks/_/task-graph.mjs +13 -14
- package/.output/server/chunks/_/task-graph.mjs.map +1 -1
- package/.output/server/chunks/_/watcher.mjs +54 -68
- package/.output/server/chunks/_/watcher.mjs.map +1 -1
- package/.output/server/chunks/build/{Detail-CUfU85GY.mjs → Detail-BQSkP9Zm.mjs} +170 -74
- package/.output/server/chunks/build/Detail-BQSkP9Zm.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-BFsE2PCW.mjs +4 -0
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-BFsE2PCW.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles.D2bqX3nK.mjs +8 -0
- package/.output/server/chunks/build/DiffViewer-styles.D2bqX3nK.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles.FoV36wuV.mjs +10 -0
- package/.output/server/chunks/build/DiffViewer-styles.FoV36wuV.mjs.map +1 -0
- package/.output/server/chunks/build/Viewer-styles.D6wYWFb1.mjs +8 -0
- package/.output/server/chunks/build/Viewer-styles.D6wYWFb1.mjs.map +1 -0
- package/.output/server/chunks/build/{_prd_-CeVnQzOV.mjs → _prd_-CBR_wm9i.mjs} +73 -33
- package/.output/server/chunks/build/_prd_-CBR_wm9i.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{default-DWCOHHTE.mjs → default-Cao5eO80.mjs} +2 -3
- package/.output/server/chunks/build/default-Cao5eO80.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-Bf6kdO80.mjs +0 -1
- package/.output/server/chunks/build/error-500-D_bcARXN.mjs +0 -1
- package/.output/server/chunks/build/{index-CckL_NBD.mjs → index-ByZO4Bvq.mjs} +2 -2
- package/.output/server/chunks/build/index-ByZO4Bvq.mjs.map +1 -0
- package/.output/server/chunks/build/{index-QVeSHT3L.mjs → index-ljj9uTXI.mjs} +6 -5
- package/.output/server/chunks/build/index-ljj9uTXI.mjs.map +1 -0
- package/.output/server/chunks/build/nuxt-link-SvT1nf8Z.mjs +1 -1
- package/.output/server/chunks/build/{repo-graph-CHNl58mY.mjs → repo-graph-CVnkmn8i.mjs} +23 -10
- package/.output/server/chunks/build/repo-graph-CVnkmn8i.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +5 -6
- package/.output/server/chunks/build/styles.mjs +4 -4
- package/.output/server/chunks/build/{usePrd-SqcxGyFU.mjs → usePrd-f7ylhIqs.mjs} +10 -34
- package/.output/server/chunks/build/usePrd-f7ylhIqs.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +614 -1211
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/browse.get.mjs +34 -10
- package/.output/server/chunks/routes/api/browse.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +3 -2
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +22 -7
- package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs +29 -23
- package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs +12 -7
- package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs +32 -13
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs +14 -14
- package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs +7 -2
- package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs +16 -2
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs +21 -9
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs +21 -85
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs +21 -9
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs +31 -50
- package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs +20 -49
- package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId/refresh-git-repos.post.mjs +6 -13
- package/.output/server/chunks/routes/api/repos/_repoId/refresh-git-repos.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/repos/_repoId_.delete.mjs +3 -2
- package/.output/server/chunks/routes/api/repos/_repoId_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/runtime.get.mjs +1 -2
- package/.output/server/chunks/routes/api/runtime.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/watch.get.mjs +5 -4
- package/.output/server/chunks/routes/api/watch.get.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/index.mjs +1 -2
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/zod/index.js +4 -0
- package/.output/server/node_modules/zod/package.json +118 -0
- package/.output/server/node_modules/zod/v3/ZodError.js +133 -0
- package/.output/server/node_modules/zod/v3/errors.js +9 -0
- package/.output/server/node_modules/zod/v3/external.js +6 -0
- package/.output/server/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/.output/server/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/.output/server/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/.output/server/node_modules/zod/v3/helpers/util.js +133 -0
- package/.output/server/node_modules/zod/v3/locales/en.js +109 -0
- package/.output/server/node_modules/zod/v3/types.js +3693 -0
- package/.output/server/package.json +2 -1
- package/README.md +2 -2
- package/dist/host/src/api/prds.js +6 -172
- package/dist/host/src/api/repos.js +3 -18
- package/dist/host/src/api/state.js +8 -9
- package/dist/host/src/executor-runner.js +368 -0
- package/dist/host/src/executor.js +138 -260
- package/dist/host/src/mcp.js +27 -1
- package/dist/host/src/ui.js +14 -4
- package/dist/server/utils/change-events.js +33 -0
- package/dist/server/utils/git.js +11 -16
- package/dist/server/utils/prd-service.js +231 -0
- package/dist/server/utils/prd-state.js +54 -162
- package/dist/server/utils/repos.js +72 -17
- package/dist/server/utils/state-schema.js +61 -0
- package/dist/server/utils/task-graph.js +13 -13
- package/package.json +2 -1
- package/.output/public/_nuxt/CVJh28bx.js +0 -1
- package/.output/public/_nuxt/CyZuidLG.js +0 -60
- package/.output/public/_nuxt/D0op9E2g.js +0 -1
- package/.output/public/_nuxt/DX8awZaa.js +0 -1
- package/.output/public/_nuxt/Detail.z33AHKev.css +0 -1
- package/.output/public/_nuxt/DiTJUZOC.js +0 -1
- package/.output/public/_nuxt/T_3JE9C-.js +0 -1
- package/.output/public/_nuxt/WOI2tLsR.js +0 -42
- package/.output/public/_nuxt/_prd_.KTotLoF_.css +0 -1
- package/.output/public/_nuxt/builds/meta/029070b0-b8e2-4988-84f4-d0c9ff55c998.json +0 -1
- package/.output/public/_nuxt/odRGDGwj.js +0 -1
- package/.output/server/chunks/build/Detail-CUfU85GY.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs +0 -4
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs +0 -10
- package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs +0 -8
- package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs.map +0 -1
- package/.output/server/chunks/build/Viewer-styles.CshnetGw.mjs +0 -8
- package/.output/server/chunks/build/Viewer-styles.CshnetGw.mjs.map +0 -1
- package/.output/server/chunks/build/_prd_-CeVnQzOV.mjs.map +0 -1
- package/.output/server/chunks/build/default-DWCOHHTE.mjs.map +0 -1
- package/.output/server/chunks/build/index-CckL_NBD.mjs.map +0 -1
- package/.output/server/chunks/build/index-QVeSHT3L.mjs.map +0 -1
- package/.output/server/chunks/build/repo-graph-CHNl58mY.mjs.map +0 -1
- package/.output/server/chunks/build/usePrd-SqcxGyFU.mjs.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { d as defineEventHandler, a as getRouterParam, c as createError
|
|
1
|
+
import { d as defineEventHandler, a as getRouterParam, c as createError } from '../../../../../../nitro/nitro.mjs';
|
|
2
|
+
import { d as readPrdProgress } from '../../../../../../_/prd-service.mjs';
|
|
3
|
+
import { a as getRepoById } from '../../../../../../_/repos.mjs';
|
|
2
4
|
import 'node:http';
|
|
3
5
|
import 'node:https';
|
|
4
6
|
import 'node:events';
|
|
@@ -6,11 +8,16 @@ import 'node:buffer';
|
|
|
6
8
|
import 'node:fs';
|
|
7
9
|
import 'node:path';
|
|
8
10
|
import 'node:crypto';
|
|
9
|
-
import 'node:os';
|
|
10
11
|
import 'node:url';
|
|
12
|
+
import '../../../../../../_/git.mjs';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import 'node:os';
|
|
11
16
|
|
|
17
|
+
function normalizeErrorMessage(message) {
|
|
18
|
+
return message.replace(/\s+/g, " ").trim();
|
|
19
|
+
}
|
|
12
20
|
const progress_get = defineEventHandler(async (event) => {
|
|
13
|
-
var _a;
|
|
14
21
|
const repoId = getRouterParam(event, "repoId");
|
|
15
22
|
const prdSlug = getRouterParam(event, "prdSlug");
|
|
16
23
|
if (!repoId || !prdSlug) {
|
|
@@ -19,23 +26,28 @@ const progress_get = defineEventHandler(async (event) => {
|
|
|
19
26
|
statusMessage: "Repository ID and PRD slug are required"
|
|
20
27
|
});
|
|
21
28
|
}
|
|
22
|
-
const
|
|
23
|
-
const repo = repos.find((r) => r.id === repoId);
|
|
29
|
+
const repo = await getRepoById(repoId);
|
|
24
30
|
if (!repo) {
|
|
25
31
|
throw createError({
|
|
26
32
|
statusCode: 404,
|
|
27
33
|
statusMessage: "Repository not found"
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
|
-
await migrateLegacyStateForRepo(repo);
|
|
31
36
|
try {
|
|
32
|
-
|
|
33
|
-
return (_a = state == null ? void 0 : state.progress) != null ? _a : null;
|
|
37
|
+
return await readPrdProgress(repo, prdSlug);
|
|
34
38
|
} catch (error) {
|
|
39
|
+
const message = normalizeErrorMessage(error.message);
|
|
40
|
+
if (message.includes("Invalid PRD slug")) {
|
|
41
|
+
throw createError({
|
|
42
|
+
statusCode: 400,
|
|
43
|
+
statusMessage: "Invalid PRD slug",
|
|
44
|
+
message
|
|
45
|
+
});
|
|
46
|
+
}
|
|
35
47
|
throw createError({
|
|
36
48
|
statusCode: 500,
|
|
37
49
|
statusMessage: "Failed to read progress state",
|
|
38
|
-
message
|
|
50
|
+
message
|
|
39
51
|
});
|
|
40
52
|
}
|
|
41
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.get.mjs","sources":["../../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug]/progress.get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"progress.get.mjs","sources":["../../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug]/progress.get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAA,sBAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,OAAA,CAAA,MAAA,EAAA,GAAA,EAAA,IAAA,EAAA;AACA;AAEA,qBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,cAAA,CAAA,KAAA,EAAA,SAAA,CAAA;AAEA,EAAA,IAAA,CAAA,MAAA,IAAA,CAAA,OAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,MAAA,IAAA,GAAA,MAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,IAAA;AACA,IAAA,OAAA,MAAA,eAAA,CAAA,IAAA,EAAA,OAAA,CAAA;AAAA,EACA,SAAA,KAAA,EAAA;AACA,IAAA,MAAA,OAAA,GAAA,qBAAA,CAAA,KAAA,CAAA,OAAA,CAAA;AAEA,IAAA,IAAA,OAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,EAAA;AACA,MAAA,MAAA,WAAA,CAAA;AAAA,QACA,UAAA,EAAA,GAAA;AAAA,QACA,aAAA,EAAA,kBAAA;AAAA,QACA;AAAA,OACA,CAAA;AAAA,IACA;AAEA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA,+BAAA;AAAA,MACA;AAAA,KACA,CAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
|
package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { d as defineEventHandler, a as getRouterParam, c as createError
|
|
2
|
-
import {
|
|
1
|
+
import { d as defineEventHandler, a as getRouterParam, c as createError } from '../../../../../../../../nitro/nitro.mjs';
|
|
2
|
+
import { f as resolveTaskCommits } from '../../../../../../../../_/prd-service.mjs';
|
|
3
|
+
import { a as getRepoById } from '../../../../../../../../_/repos.mjs';
|
|
3
4
|
import 'node:http';
|
|
4
5
|
import 'node:https';
|
|
5
6
|
import 'node:events';
|
|
@@ -7,12 +8,16 @@ import 'node:buffer';
|
|
|
7
8
|
import 'node:fs';
|
|
8
9
|
import 'node:path';
|
|
9
10
|
import 'node:crypto';
|
|
10
|
-
import 'node:os';
|
|
11
11
|
import 'node:url';
|
|
12
|
+
import '../../../../../../../../_/git.mjs';
|
|
12
13
|
import 'node:child_process';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import 'node:os';
|
|
13
16
|
|
|
17
|
+
function normalizeErrorMessage(message) {
|
|
18
|
+
return message.replace(/\s+/g, " ").trim();
|
|
19
|
+
}
|
|
14
20
|
const commits_get = defineEventHandler(async (event) => {
|
|
15
|
-
var _a;
|
|
16
21
|
const repoId = getRouterParam(event, "repoId");
|
|
17
22
|
const prdSlug = getRouterParam(event, "prdSlug");
|
|
18
23
|
const taskId = getRouterParam(event, "taskId");
|
|
@@ -22,99 +27,30 @@ const commits_get = defineEventHandler(async (event) => {
|
|
|
22
27
|
statusMessage: "Repository ID, PRD slug, and task ID are required"
|
|
23
28
|
});
|
|
24
29
|
}
|
|
25
|
-
const
|
|
26
|
-
const repo = repos.find((r) => r.id === repoId);
|
|
30
|
+
const repo = await getRepoById(repoId);
|
|
27
31
|
if (!repo) {
|
|
28
32
|
throw createError({
|
|
29
33
|
statusCode: 404,
|
|
30
34
|
statusMessage: "Repository not found"
|
|
31
35
|
});
|
|
32
36
|
}
|
|
33
|
-
await migrateLegacyStateForRepo(repo);
|
|
34
|
-
let progress = null;
|
|
35
37
|
try {
|
|
36
|
-
|
|
37
|
-
progress = (_a = state == null ? void 0 : state.progress) != null ? _a : null;
|
|
38
|
+
return await resolveTaskCommits(repo, prdSlug, taskId);
|
|
38
39
|
} catch (error) {
|
|
40
|
+
const message = normalizeErrorMessage(error.message);
|
|
41
|
+
if (message.includes("Invalid PRD slug")) {
|
|
42
|
+
throw createError({
|
|
43
|
+
statusCode: 400,
|
|
44
|
+
statusMessage: "Invalid PRD slug",
|
|
45
|
+
message
|
|
46
|
+
});
|
|
47
|
+
}
|
|
39
48
|
throw createError({
|
|
40
49
|
statusCode: 500,
|
|
41
|
-
statusMessage: "Failed to
|
|
42
|
-
message
|
|
50
|
+
statusMessage: "Failed to resolve task commits",
|
|
51
|
+
message
|
|
43
52
|
});
|
|
44
53
|
}
|
|
45
|
-
if (!progress) {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
const taskLogs = Array.isArray(progress.taskLogs) ? progress.taskLogs : [];
|
|
49
|
-
const taskLog = taskLogs.find((log) => log.taskId === taskId);
|
|
50
|
-
if (!taskLog) {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
if (!taskLog.commits || taskLog.commits.length === 0) {
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
const resolvedCommits = [];
|
|
57
|
-
const failedEntries = [];
|
|
58
|
-
for (const commitEntry of taskLog.commits) {
|
|
59
|
-
try {
|
|
60
|
-
const resolved = await resolveCommitRepo(repo, commitEntry);
|
|
61
|
-
resolvedCommits.push({
|
|
62
|
-
sha: resolved.sha,
|
|
63
|
-
repo: resolved.repoPath
|
|
64
|
-
});
|
|
65
|
-
} catch {
|
|
66
|
-
failedEntries.push(commitEntry);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (failedEntries.length > 0) {
|
|
70
|
-
const newGitRepos = await discoverGitRepos(repo.path);
|
|
71
|
-
const existingPaths = new Set((repo.gitRepos || []).map((gr) => gr.relativePath));
|
|
72
|
-
const hasNewRepos = newGitRepos.some((gr) => !existingPaths.has(gr.relativePath));
|
|
73
|
-
if (hasNewRepos) {
|
|
74
|
-
const repos2 = await getRepos();
|
|
75
|
-
const repoIndex = repos2.findIndex((r) => r.id === repoId);
|
|
76
|
-
if (repoIndex !== -1) {
|
|
77
|
-
const updatedRepo = {
|
|
78
|
-
...repos2[repoIndex],
|
|
79
|
-
gitRepos: newGitRepos.length > 0 ? newGitRepos : void 0
|
|
80
|
-
};
|
|
81
|
-
repos2[repoIndex] = updatedRepo;
|
|
82
|
-
await saveRepos(repos2);
|
|
83
|
-
for (const commitEntry of failedEntries) {
|
|
84
|
-
try {
|
|
85
|
-
const resolved = await resolveCommitRepo(updatedRepo, commitEntry);
|
|
86
|
-
resolvedCommits.push({
|
|
87
|
-
sha: resolved.sha,
|
|
88
|
-
repo: resolved.repoPath
|
|
89
|
-
});
|
|
90
|
-
} catch {
|
|
91
|
-
const sha = typeof commitEntry === "string" ? commitEntry : commitEntry.sha;
|
|
92
|
-
resolvedCommits.push({
|
|
93
|
-
sha,
|
|
94
|
-
repo: ""
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
for (const commitEntry of failedEntries) {
|
|
100
|
-
const sha = typeof commitEntry === "string" ? commitEntry : commitEntry.sha;
|
|
101
|
-
resolvedCommits.push({
|
|
102
|
-
sha,
|
|
103
|
-
repo: ""
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
for (const commitEntry of failedEntries) {
|
|
109
|
-
const sha = typeof commitEntry === "string" ? commitEntry : commitEntry.sha;
|
|
110
|
-
resolvedCommits.push({
|
|
111
|
-
sha,
|
|
112
|
-
repo: ""
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return resolvedCommits;
|
|
118
54
|
});
|
|
119
55
|
|
|
120
56
|
export { commits_get as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commits.get.mjs","sources":["../../../../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug]/tasks/[taskId]/commits.get.ts"],"names":[
|
|
1
|
+
{"version":3,"file":"commits.get.mjs","sources":["../../../../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug]/tasks/[taskId]/commits.get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAA,sBAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,OAAA,CAAA,MAAA,EAAA,GAAA,EAAA,IAAA,EAAA;AACA;AAEA,oBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,cAAA,CAAA,KAAA,EAAA,SAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AAEA,EAAA,IAAA,CAAA,MAAA,IAAA,CAAA,OAAA,IAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,MAAA,IAAA,GAAA,MAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,IAAA;AACA,IAAA,OAAA,MAAA,kBAAA,CAAA,IAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAAA,EACA,SAAA,KAAA,EAAA;AACA,IAAA,MAAA,OAAA,GAAA,qBAAA,CAAA,KAAA,CAAA,OAAA,CAAA;AAEA,IAAA,IAAA,OAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,EAAA;AACA,MAAA,MAAA,WAAA,CAAA;AAAA,QACA,UAAA,EAAA,GAAA;AAAA,QACA,aAAA,EAAA,kBAAA;AAAA,QACA;AAAA,OACA,CAAA;AAAA,IACA;AAEA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA,gCAAA;AAAA,MACA;AAAA,KACA,CAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { d as defineEventHandler, a as getRouterParam, c as createError
|
|
1
|
+
import { d as defineEventHandler, a as getRouterParam, c as createError } from '../../../../../../nitro/nitro.mjs';
|
|
2
|
+
import { e as readPrdTasks } from '../../../../../../_/prd-service.mjs';
|
|
3
|
+
import { a as getRepoById } from '../../../../../../_/repos.mjs';
|
|
2
4
|
import 'node:http';
|
|
3
5
|
import 'node:https';
|
|
4
6
|
import 'node:events';
|
|
@@ -6,11 +8,16 @@ import 'node:buffer';
|
|
|
6
8
|
import 'node:fs';
|
|
7
9
|
import 'node:path';
|
|
8
10
|
import 'node:crypto';
|
|
9
|
-
import 'node:os';
|
|
10
11
|
import 'node:url';
|
|
12
|
+
import '../../../../../../_/git.mjs';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import 'node:os';
|
|
11
16
|
|
|
17
|
+
function normalizeErrorMessage(message) {
|
|
18
|
+
return message.replace(/\s+/g, " ").trim();
|
|
19
|
+
}
|
|
12
20
|
const tasks_get = defineEventHandler(async (event) => {
|
|
13
|
-
var _a;
|
|
14
21
|
const repoId = getRouterParam(event, "repoId");
|
|
15
22
|
const prdSlug = getRouterParam(event, "prdSlug");
|
|
16
23
|
if (!repoId || !prdSlug) {
|
|
@@ -19,23 +26,28 @@ const tasks_get = defineEventHandler(async (event) => {
|
|
|
19
26
|
statusMessage: "Repository ID and PRD slug are required"
|
|
20
27
|
});
|
|
21
28
|
}
|
|
22
|
-
const
|
|
23
|
-
const repo = repos.find((r) => r.id === repoId);
|
|
29
|
+
const repo = await getRepoById(repoId);
|
|
24
30
|
if (!repo) {
|
|
25
31
|
throw createError({
|
|
26
32
|
statusCode: 404,
|
|
27
33
|
statusMessage: "Repository not found"
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
|
-
await migrateLegacyStateForRepo(repo);
|
|
31
36
|
try {
|
|
32
|
-
|
|
33
|
-
return (_a = state == null ? void 0 : state.tasks) != null ? _a : null;
|
|
37
|
+
return await readPrdTasks(repo, prdSlug);
|
|
34
38
|
} catch (error) {
|
|
39
|
+
const message = normalizeErrorMessage(error.message);
|
|
40
|
+
if (message.includes("Invalid PRD slug")) {
|
|
41
|
+
throw createError({
|
|
42
|
+
statusCode: 400,
|
|
43
|
+
statusMessage: "Invalid PRD slug",
|
|
44
|
+
message
|
|
45
|
+
});
|
|
46
|
+
}
|
|
35
47
|
throw createError({
|
|
36
48
|
statusCode: 500,
|
|
37
49
|
statusMessage: "Failed to read task state",
|
|
38
|
-
message
|
|
50
|
+
message
|
|
39
51
|
});
|
|
40
52
|
}
|
|
41
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.get.mjs","sources":["../../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug]/tasks.get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tasks.get.mjs","sources":["../../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug]/tasks.get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAA,sBAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,OAAA,CAAA,MAAA,EAAA,GAAA,EAAA,IAAA,EAAA;AACA;AAEA,kBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,cAAA,CAAA,KAAA,EAAA,SAAA,CAAA;AAEA,EAAA,IAAA,CAAA,MAAA,IAAA,CAAA,OAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,MAAA,IAAA,GAAA,MAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,IAAA;AACA,IAAA,OAAA,MAAA,YAAA,CAAA,IAAA,EAAA,OAAA,CAAA;AAAA,EACA,SAAA,KAAA,EAAA;AACA,IAAA,MAAA,OAAA,GAAA,qBAAA,CAAA,KAAA,CAAA,OAAA,CAAA;AAEA,IAAA,IAAA,OAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,EAAA;AACA,MAAA,MAAA,WAAA,CAAA;AAAA,QACA,UAAA,EAAA,GAAA;AAAA,QACA,aAAA,EAAA,kBAAA;AAAA,QACA;AAAA,OACA,CAAA;AAAA,IACA;AAEA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA,2BAAA;AAAA,MACA;AAAA,KACA,CAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
|
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
import { d as defineEventHandler, a as getRouterParam, c as createError
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { d as defineEventHandler, a as getRouterParam, c as createError } from '../../../../../nitro/nitro.mjs';
|
|
2
|
+
import { r as readPrdDocument } from '../../../../../_/prd-service.mjs';
|
|
3
|
+
import { a as getRepoById } from '../../../../../_/repos.mjs';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import 'node:https';
|
|
6
6
|
import 'node:events';
|
|
7
7
|
import 'node:buffer';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'node:path';
|
|
8
10
|
import 'node:crypto';
|
|
9
|
-
import 'node:os';
|
|
10
11
|
import 'node:url';
|
|
12
|
+
import '../../../../../_/git.mjs';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import 'node:os';
|
|
11
16
|
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
const authorMatch = content.match(/\*{0,2}Author\*{0,2}:\*{0,2}\s*(.+?)(?:\n|$)/i);
|
|
15
|
-
if (authorMatch && authorMatch[1]) {
|
|
16
|
-
metadata.author = authorMatch[1].trim();
|
|
17
|
-
}
|
|
18
|
-
const dateMatch = content.match(/\*{0,2}Date\*{0,2}:\*{0,2}\s*(.+?)(?:\n|$)/i);
|
|
19
|
-
if (dateMatch && dateMatch[1]) {
|
|
20
|
-
metadata.date = dateMatch[1].trim();
|
|
21
|
-
}
|
|
22
|
-
const statusMatch = content.match(/\*{0,2}Status\*{0,2}:\*{0,2}\s*(.+?)(?:\n|$)/i);
|
|
23
|
-
if (statusMatch && statusMatch[1]) {
|
|
24
|
-
metadata.status = statusMatch[1].trim();
|
|
25
|
-
}
|
|
26
|
-
const shortcutLinkMatch = content.match(/\[([Ss][Cc]-\d+)\]\(([^)]+)\)/);
|
|
27
|
-
if (shortcutLinkMatch && shortcutLinkMatch[1] && shortcutLinkMatch[2]) {
|
|
28
|
-
metadata.shortcutStory = shortcutLinkMatch[1];
|
|
29
|
-
metadata.shortcutUrl = shortcutLinkMatch[2];
|
|
30
|
-
} else {
|
|
31
|
-
const shortcutIdMatch = content.match(/\*{0,2}Shortcut(?:\s+Story)?\*{0,2}:\*{0,2}\s*([Ss][Cc]-\d+)/i);
|
|
32
|
-
if (shortcutIdMatch && shortcutIdMatch[1]) {
|
|
33
|
-
metadata.shortcutStory = shortcutIdMatch[1];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return metadata;
|
|
17
|
+
function normalizeErrorMessage(message) {
|
|
18
|
+
return message.replace(/\s+/g, " ").trim();
|
|
37
19
|
}
|
|
38
20
|
const _prdSlug__get = defineEventHandler(async (event) => {
|
|
39
21
|
const repoId = getRouterParam(event, "repoId");
|
|
@@ -44,37 +26,36 @@ const _prdSlug__get = defineEventHandler(async (event) => {
|
|
|
44
26
|
statusMessage: "Repository ID and PRD slug are required"
|
|
45
27
|
});
|
|
46
28
|
}
|
|
47
|
-
const
|
|
48
|
-
const repo = repos.find((r) => r.id === repoId);
|
|
29
|
+
const repo = await getRepoById(repoId);
|
|
49
30
|
if (!repo) {
|
|
50
31
|
throw createError({
|
|
51
32
|
statusCode: 404,
|
|
52
33
|
statusMessage: "Repository not found"
|
|
53
34
|
});
|
|
54
35
|
}
|
|
55
|
-
const prdPath = join(repo.path, "docs", "prd", `${prdSlug}.md`);
|
|
56
|
-
let content;
|
|
57
36
|
try {
|
|
58
|
-
|
|
59
|
-
} catch {
|
|
37
|
+
return await readPrdDocument(repo, prdSlug);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
const message = normalizeErrorMessage(error.message);
|
|
40
|
+
if (message.includes("Invalid PRD slug")) {
|
|
41
|
+
throw createError({
|
|
42
|
+
statusCode: 400,
|
|
43
|
+
statusMessage: "Invalid PRD slug",
|
|
44
|
+
message
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (message.includes("PRD not found")) {
|
|
48
|
+
throw createError({
|
|
49
|
+
statusCode: 404,
|
|
50
|
+
statusMessage: "PRD not found"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
60
53
|
throw createError({
|
|
61
|
-
statusCode:
|
|
62
|
-
statusMessage: "PRD
|
|
54
|
+
statusCode: 500,
|
|
55
|
+
statusMessage: "Failed to load PRD document",
|
|
56
|
+
message
|
|
63
57
|
});
|
|
64
58
|
}
|
|
65
|
-
let name = prdSlug;
|
|
66
|
-
const h1Match = content.match(/^#\s+(.+)$/m);
|
|
67
|
-
if (h1Match && h1Match[1]) {
|
|
68
|
-
name = h1Match[1].trim();
|
|
69
|
-
}
|
|
70
|
-
const metadata = parseMetadata(content);
|
|
71
|
-
const document = {
|
|
72
|
-
slug: prdSlug,
|
|
73
|
-
name,
|
|
74
|
-
content,
|
|
75
|
-
metadata
|
|
76
|
-
};
|
|
77
|
-
return document;
|
|
78
59
|
});
|
|
79
60
|
|
|
80
61
|
export { _prdSlug__get as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_prdSlug_.get.mjs","sources":["../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug].get.ts"],"names":[
|
|
1
|
+
{"version":3,"file":"_prdSlug_.get.mjs","sources":["../../../../../../../../server/api/repos/[repoId]/prd/[prdSlug].get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAA,sBAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,OAAA,CAAA,MAAA,EAAA,GAAA,EAAA,IAAA,EAAA;AACA;AAEA,sBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,cAAA,CAAA,KAAA,EAAA,SAAA,CAAA;AAEA,EAAA,IAAA,CAAA,MAAA,IAAA,CAAA,OAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,MAAA,IAAA,GAAA,MAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,IAAA;AACA,IAAA,OAAA,MAAA,eAAA,CAAA,IAAA,EAAA,OAAA,CAAA;AAAA,EACA,SAAA,KAAA,EAAA;AACA,IAAA,MAAA,OAAA,GAAA,qBAAA,CAAA,KAAA,CAAA,OAAA,CAAA;AAEA,IAAA,IAAA,OAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,EAAA;AACA,MAAA,MAAA,WAAA,CAAA;AAAA,QACA,UAAA,EAAA,GAAA;AAAA,QACA,aAAA,EAAA,kBAAA;AAAA,QACA;AAAA,OACA,CAAA;AAAA,IACA;AAEA,IAAA,IAAA,OAAA,CAAA,QAAA,CAAA,eAAA,CAAA,EAAA;AACA,MAAA,MAAA,WAAA,CAAA;AAAA,QACA,UAAA,EAAA,GAAA;AAAA,QACA,aAAA,EAAA;AAAA,OACA,CAAA;AAAA,IACA;AAEA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA,6BAAA;AAAA,MACA;AAAA,KACA,CAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { d as defineEventHandler, a as getRouterParam, c as createError
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { d as defineEventHandler, a as getRouterParam, c as createError } from '../../../../nitro/nitro.mjs';
|
|
2
|
+
import { l as listPrdDocuments } from '../../../../_/prd-service.mjs';
|
|
3
|
+
import { a as getRepoById } from '../../../../_/repos.mjs';
|
|
4
4
|
import 'node:http';
|
|
5
5
|
import 'node:https';
|
|
6
6
|
import 'node:events';
|
|
7
7
|
import 'node:buffer';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'node:path';
|
|
8
10
|
import 'node:crypto';
|
|
9
|
-
import 'node:os';
|
|
10
11
|
import 'node:url';
|
|
12
|
+
import '../../../../_/git.mjs';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import 'node:os';
|
|
11
16
|
|
|
17
|
+
function normalizeErrorMessage(message) {
|
|
18
|
+
return message.replace(/\s+/g, " ").trim();
|
|
19
|
+
}
|
|
12
20
|
const prds_get = defineEventHandler(async (event) => {
|
|
13
21
|
const repoId = getRouterParam(event, "repoId");
|
|
14
22
|
if (!repoId) {
|
|
@@ -17,59 +25,22 @@ const prds_get = defineEventHandler(async (event) => {
|
|
|
17
25
|
statusMessage: "Repository ID is required"
|
|
18
26
|
});
|
|
19
27
|
}
|
|
20
|
-
const
|
|
21
|
-
const repo = repos.find((r) => r.id === repoId);
|
|
28
|
+
const repo = await getRepoById(repoId);
|
|
22
29
|
if (!repo) {
|
|
23
30
|
throw createError({
|
|
24
31
|
statusCode: 404,
|
|
25
32
|
statusMessage: "Repository not found"
|
|
26
33
|
});
|
|
27
34
|
}
|
|
28
|
-
await migrateLegacyStateForRepo(repo);
|
|
29
|
-
const prdDir = join(repo.path, "docs", "prd");
|
|
30
|
-
let prdFiles = [];
|
|
31
35
|
try {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
return await listPrdDocuments(repo);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw createError({
|
|
39
|
+
statusCode: 500,
|
|
40
|
+
statusMessage: "Failed to load PRD list",
|
|
41
|
+
message: normalizeErrorMessage(error.message)
|
|
42
|
+
});
|
|
36
43
|
}
|
|
37
|
-
const stateSummaries = await getPrdStateSummaries(repo.id);
|
|
38
|
-
const prds = await Promise.all(
|
|
39
|
-
prdFiles.map(async (filename) => {
|
|
40
|
-
const slug = basename(filename, ".md");
|
|
41
|
-
const filePath = join(prdDir, filename);
|
|
42
|
-
let name = slug;
|
|
43
|
-
let modifiedAt = 0;
|
|
44
|
-
try {
|
|
45
|
-
const [content, stat] = await Promise.all([
|
|
46
|
-
promises.readFile(filePath, "utf-8"),
|
|
47
|
-
promises.stat(filePath)
|
|
48
|
-
]);
|
|
49
|
-
modifiedAt = stat.mtime.getTime();
|
|
50
|
-
const h1Match = content.match(/^#\s+(.+)$/m);
|
|
51
|
-
if (h1Match && h1Match[1]) {
|
|
52
|
-
name = h1Match[1].trim();
|
|
53
|
-
}
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
const stateSummary = stateSummaries.get(slug);
|
|
57
|
-
const hasState = !!(stateSummary == null ? void 0 : stateSummary.hasState);
|
|
58
|
-
const taskCount = stateSummary == null ? void 0 : stateSummary.taskCount;
|
|
59
|
-
const completedCount = stateSummary == null ? void 0 : stateSummary.completedCount;
|
|
60
|
-
return {
|
|
61
|
-
slug,
|
|
62
|
-
name,
|
|
63
|
-
source: `docs/prd/${filename}`,
|
|
64
|
-
hasState,
|
|
65
|
-
modifiedAt,
|
|
66
|
-
...taskCount !== void 0 && { taskCount },
|
|
67
|
-
...completedCount !== void 0 && { completedCount }
|
|
68
|
-
};
|
|
69
|
-
})
|
|
70
|
-
);
|
|
71
|
-
prds.sort((a, b) => b.modifiedAt - a.modifiedAt);
|
|
72
|
-
return prds;
|
|
73
44
|
});
|
|
74
45
|
|
|
75
46
|
export { prds_get as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prds.get.mjs","sources":["../../../../../../../server/api/repos/[repoId]/prds.get.ts"],"names":[
|
|
1
|
+
{"version":3,"file":"prds.get.mjs","sources":["../../../../../../../server/api/repos/[repoId]/prds.get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAA,sBAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,OAAA,CAAA,MAAA,EAAA,GAAA,EAAA,IAAA,EAAA;AACA;AAEA,iBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AAEA,EAAA,IAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,MAAA,IAAA,GAAA,MAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,IAAA;AACA,IAAA,OAAA,MAAA,iBAAA,IAAA,CAAA;AAAA,EACA,SAAA,KAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA,yBAAA;AAAA,MACA,OAAA,EAAA,qBAAA,CAAA,KAAA,CAAA,OAAA;AAAA,KACA,CAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { d as defineEventHandler, a as getRouterParam, c as createError
|
|
1
|
+
import { d as defineEventHandler, a as getRouterParam, c as createError } from '../../../../nitro/nitro.mjs';
|
|
2
|
+
import { a as getRepoById, d as discoverGitRepos, u as updateRepoGitRepos } from '../../../../_/repos.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,8 +7,8 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:os';
|
|
10
10
|
import 'node:url';
|
|
11
|
+
import 'node:os';
|
|
11
12
|
|
|
12
13
|
const refreshGitRepos_post = defineEventHandler(async (event) => {
|
|
13
14
|
const repoId = getRouterParam(event, "repoId");
|
|
@@ -17,23 +18,15 @@ const refreshGitRepos_post = defineEventHandler(async (event) => {
|
|
|
17
18
|
statusMessage: "Repository ID is required"
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
if (repoIndex === -1) {
|
|
21
|
+
const repo = await getRepoById(repoId);
|
|
22
|
+
if (!repo) {
|
|
23
23
|
throw createError({
|
|
24
24
|
statusCode: 404,
|
|
25
25
|
statusMessage: "Repository not found"
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
const repo = repos[repoIndex];
|
|
29
28
|
const gitRepos = await discoverGitRepos(repo.path);
|
|
30
|
-
|
|
31
|
-
repo.gitRepos = gitRepos;
|
|
32
|
-
} else {
|
|
33
|
-
delete repo.gitRepos;
|
|
34
|
-
}
|
|
35
|
-
repos[repoIndex] = repo;
|
|
36
|
-
await saveRepos(repos);
|
|
29
|
+
await updateRepoGitRepos(repo.id, gitRepos.length > 0 ? gitRepos : void 0);
|
|
37
30
|
return {
|
|
38
31
|
discovered: gitRepos.length,
|
|
39
32
|
gitRepos
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-git-repos.post.mjs","sources":["../../../../../../../server/api/repos/[repoId]/refresh-git-repos.post.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"refresh-git-repos.post.mjs","sources":["../../../../../../../server/api/repos/[repoId]/refresh-git-repos.post.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6BAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AAEA,EAAA,IAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,MAAA,IAAA,GAAA,MAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAGA,EAAA,MAAA,QAAA,GAAA,MAAA,gBAAA,CAAA,IAAA,CAAA,IAAA,CAAA;AAEA,EAAA,MAAA,mBAAA,IAAA,CAAA,EAAA,EAAA,SAAA,MAAA,GAAA,CAAA,GAAA,WAAA,MAAA,CAAA;AAEA,EAAA,OAAA;AAAA,IACA,YAAA,QAAA,CAAA,MAAA;AAAA,IACA;AAAA,GACA;AACA,CAAA,CAAA;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { d as defineEventHandler, a as getRouterParam, c as createError
|
|
1
|
+
import { d as defineEventHandler, a as getRouterParam, c as createError } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { r as removeRepo } from '../../../_/repos.mjs';
|
|
2
3
|
import { r as refreshWatcher } from '../../../_/watcher.mjs';
|
|
3
4
|
import 'node:http';
|
|
4
5
|
import 'node:https';
|
|
@@ -7,8 +8,8 @@ import 'node:buffer';
|
|
|
7
8
|
import 'node:fs';
|
|
8
9
|
import 'node:path';
|
|
9
10
|
import 'node:crypto';
|
|
10
|
-
import 'node:os';
|
|
11
11
|
import 'node:url';
|
|
12
|
+
import 'node:os';
|
|
12
13
|
import 'chokidar';
|
|
13
14
|
|
|
14
15
|
const _repoId__delete = defineEventHandler(async (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_repoId_.delete.mjs","sources":["../../../../../../server/api/repos/[repoId].delete.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_repoId_.delete.mjs","sources":["../../../../../../server/api/repos/[repoId].delete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,wBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,EAAA,GAAA,cAAA,CAAA,KAAA,EAAA,QAAA,CAAA;AAEA,EAAA,IAAA,CAAA,EAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAEA,EAAA,MAAA,OAAA,GAAA,MAAA,UAAA,CAAA,EAAA,CAAA;AAEA,EAAA,IAAA,CAAA,OAAA,EAAA;AACA,IAAA,MAAA,WAAA,CAAA;AAAA,MACA,UAAA,EAAA,GAAA;AAAA,MACA,aAAA,EAAA;AAAA,KACA,CAAA;AAAA,EACA;AAGA,EAAA,MAAA,cAAA,EAAA;AAEA,EAAA,OAAA,EAAA,SAAA,IAAA,EAAA;AACA,CAAA,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as defineEventHandler, u as useRuntimeConfig,
|
|
1
|
+
import { d as defineEventHandler, u as useRuntimeConfig, s as setHeader } from '../../nitro/nitro.mjs';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import 'node:https';
|
|
@@ -6,7 +6,6 @@ import 'node:events';
|
|
|
6
6
|
import 'node:buffer';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:path';
|
|
9
|
-
import 'node:os';
|
|
10
9
|
import 'node:url';
|
|
11
10
|
|
|
12
11
|
const SERVER_INSTANCE_ID = randomUUID();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.get.mjs","sources":["../../../../../server/api/runtime.get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.get.mjs","sources":["../../../../../server/api/runtime.get.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAA,qBAAA,UAAA,EAAA;AACA,MAAA,iBAAA,GAAA,iBAAA,IAAA,IAAA,EAAA,EAAA,WAAA,EAAA;AAEA,oBAAA,kBAAA,CAAA,CAAA,KAAA,KAAA;AACA,EAAA,MAAA,aAAA,GAAA,iBAAA,KAAA,CAAA;AAEA,EAAA,SAAA,CAAA,KAAA,EAAA,iBAAA,qCAAA,CAAA;AAEA,EAAA,OAAA;AAAA,IACA,OAAA,EAAA,cAAA,GAAA,CAAA,OAAA;AAAA,IACA,UAAA,EAAA,kBAAA;AAAA,IACA,SAAA,EAAA;AAAA,GACA;AACA,CAAA,CAAA;;;;"}
|