plan-assistant 1.2.0-alpha.1 → 1.2.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/bin/cli.js +1 -1
- package/build/client/_app/immutable/assets/0.DdHQkxqS.css +1 -0
- package/build/client/_app/immutable/chunks/{CZNWRS0m.js → 6b0HSL6Z.js} +1 -1
- package/build/client/_app/immutable/chunks/{CvO8nBlL.js → BBxk7dOU.js} +21 -21
- package/build/client/_app/immutable/chunks/{BpqBgpBa.js → BJwHAATM.js} +1 -1
- package/build/client/_app/immutable/chunks/{D5F4sUdI.js → BRTrrN0X.js} +1 -1
- package/build/client/_app/immutable/chunks/{DNOkPIWg.js → BRkVe5gO.js} +1 -1
- package/build/client/_app/immutable/chunks/{BjATSb8_.js → BfL8uxRT.js} +1 -1
- package/build/client/_app/immutable/chunks/{NRNX68Gj.js → Bl7iZqEb.js} +1 -1
- package/build/client/_app/immutable/chunks/{B_xA7PP5.js → BmGLb1qu.js} +1 -1
- package/build/client/_app/immutable/chunks/{DfFYYrPj.js → BurTWprE.js} +1 -1
- package/build/client/_app/immutable/chunks/{DAyh-h6m.js → BvRgs-2L.js} +1 -1
- package/build/client/_app/immutable/chunks/{I-_WMags.js → By7NnKnP.js} +1 -1
- package/build/client/_app/immutable/chunks/{DZhPRUzf.js → C0InBf-O.js} +1 -1
- package/build/client/_app/immutable/chunks/C2-rKeYx.js +1 -0
- package/build/client/_app/immutable/chunks/{gMqfNzJx.js → C3BJCczD.js} +1 -1
- package/build/client/_app/immutable/chunks/{D6NaaQrB.js → C3DTNv0i.js} +1 -1
- package/build/client/_app/immutable/chunks/{DbGUARRV.js → CDR3Z56Y.js} +1 -1
- package/build/client/_app/immutable/chunks/{BPhQvds6.js → CH1NEzX7.js} +1 -1
- package/build/client/_app/immutable/chunks/{CP0aDsyG.js → CSL7tjoH.js} +1 -1
- package/build/client/_app/immutable/chunks/{CeaTXww4.js → CUfXrgXj.js} +1 -1
- package/build/client/_app/immutable/chunks/{BPppWbbJ.js → CWVRzsQP.js} +1 -1
- package/build/client/_app/immutable/chunks/CXKO628o.js +1 -0
- package/build/client/_app/immutable/chunks/{Btyih4x6.js → CZGqo-pw.js} +1 -1
- package/build/client/_app/immutable/chunks/{CGso7XHG.js → CZeFIBGi.js} +1 -1
- package/build/client/_app/immutable/chunks/{CqjkV5WO.js → CZuHz6os.js} +1 -1
- package/build/client/_app/immutable/chunks/{UbPRb0uw.js → ChU2oOcg.js} +1 -1
- package/build/client/_app/immutable/chunks/{QpXIpq9i.js → CiHc4XuG.js} +1 -1
- package/build/client/_app/immutable/chunks/{BWcPpl2e.js → Ckj5JRjL.js} +1 -1
- package/build/client/_app/immutable/chunks/{BV6c3cqC.js → Cm6RxuVQ.js} +1 -1
- package/build/client/_app/immutable/chunks/{xnd05L4v.js → Cnn0E3YZ.js} +1 -1
- package/build/client/_app/immutable/chunks/Crb4tJFd.js +2 -0
- package/build/client/_app/immutable/chunks/{CbaJUgGX.js → CtHD3qrr.js} +1 -1
- package/build/client/_app/immutable/chunks/{CDds1qcN.js → CvhcLZiP.js} +1 -1
- package/build/client/_app/immutable/chunks/{B0djNxws.js → DJQzf1x2.js} +1 -1
- package/build/client/_app/immutable/chunks/{lNsd6pXd.js → DNr4wguO.js} +1 -1
- package/build/client/_app/immutable/chunks/{CwBXQiCG.js → DPzlQiZI.js} +4 -4
- package/build/client/_app/immutable/chunks/{Clthe39N.js → DR7ejmzS.js} +1 -1
- package/build/client/_app/immutable/chunks/{Cj6WFtJn.js → DRKSCzuI.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bll9kvZL.js → DatA5hJq.js} +1 -1
- package/build/client/_app/immutable/chunks/{C-d8OvVh.js → DgjsH1_4.js} +1 -1
- package/build/client/_app/immutable/chunks/{By4f9l9U.js → DhVzpyVX.js} +1 -1
- package/build/client/_app/immutable/chunks/{B2mvlX2Z.js → DolVEyKl.js} +1 -1
- package/build/client/_app/immutable/chunks/{BwrUzP2k.js → Dt4UxPZ4.js} +1 -1
- package/build/client/_app/immutable/chunks/{BksD1AjG.js → DwEmC87d.js} +1 -1
- package/build/client/_app/immutable/chunks/DwHVGAim.js +2 -0
- package/build/client/_app/immutable/chunks/{B8lwq62G.js → InDR_gmx.js} +1 -1
- package/build/client/_app/immutable/chunks/{DrW4TnoX.js → L9EQWNkl.js} +1 -1
- package/build/client/_app/immutable/chunks/{BHx0uQ96.js → OE8RTdkZ.js} +1 -1
- package/build/client/_app/immutable/chunks/{HgJ9TTyx.js → b5WVI7KI.js} +1 -1
- package/build/client/_app/immutable/chunks/cUUj7sxC.js +3 -0
- package/build/client/_app/immutable/chunks/{B7zIennA.js → httJDHb6.js} +1 -1
- package/build/client/_app/immutable/chunks/{NdE8J0bM.js → nJJiC0ez.js} +1 -1
- package/build/client/_app/immutable/chunks/{C8qVV8cm.js → s2OkNNj0.js} +1 -1
- package/build/client/_app/immutable/chunks/{QfkVGNn3.js → swCs98qy.js} +1 -1
- package/build/client/_app/immutable/chunks/{DFrc9T26.js → t6MaPXGX.js} +1 -1
- package/build/client/_app/immutable/chunks/{CrIbO0B6.js → zskmS_aP.js} +1 -1
- package/build/client/_app/immutable/entry/{app.CBS_Z404.js → app.B2C74vct.js} +2 -2
- package/build/client/_app/immutable/entry/start.D2e-hus4.js +1 -0
- package/build/client/_app/immutable/nodes/0.DZgBb5Pb.js +1 -0
- package/build/client/_app/immutable/nodes/{1.BPT1G7oI.js → 1.Dkd5hfRh.js} +1 -1
- package/build/client/_app/immutable/nodes/2.C9ThxHzK.js +1 -0
- package/build/client/_app/immutable/nodes/3.CuHRbCUZ.js +1 -0
- package/build/client/_app/version.json +1 -1
- package/build/server/chunks/0-FIjyGrw5.js +9 -0
- package/build/server/chunks/{0-DPYv3B-j.js.map → 0-FIjyGrw5.js.map} +1 -1
- package/build/server/chunks/1-Bkky1G1I.js +9 -0
- package/build/server/chunks/{1-BO4kNsrv.js.map → 1-Bkky1G1I.js.map} +1 -1
- package/build/server/chunks/{2-DFI8IOoy.js → 2-B3cRP7wL.js} +4 -4
- package/build/server/chunks/{2-DFI8IOoy.js.map → 2-B3cRP7wL.js.map} +1 -1
- package/build/server/chunks/{3-Bc3QUYvr.js → 3-CHdqnsU5.js} +4 -4
- package/build/server/chunks/{3-Bc3QUYvr.js.map → 3-CHdqnsU5.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-jWqZZdpj.js → _page.svelte-CBlXk81L.js} +8 -41
- package/build/server/chunks/_page.svelte-CBlXk81L.js.map +1 -0
- package/build/server/chunks/{_page.svelte-Up0EdgYM.js → _page.svelte-DPEQWNmX.js} +3 -14
- package/build/server/chunks/_page.svelte-DPEQWNmX.js.map +1 -0
- package/build/server/chunks/{_server.ts-DO9LltlC.js → _server.ts-CY7NfbtD.js} +2 -2
- package/build/server/chunks/{_server.ts-DO9LltlC.js.map → _server.ts-CY7NfbtD.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BHdd9cj4.js → _server.ts-CpPXj3O_.js} +2 -2
- package/build/server/chunks/{_server.ts-BHdd9cj4.js.map → _server.ts-CpPXj3O_.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CK88gmKp.js → _server.ts-CtgVvBfR.js} +2 -2
- package/build/server/chunks/{_server.ts-CK88gmKp.js.map → _server.ts-CtgVvBfR.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DpdXzg2s.js → _server.ts-DI8tBJml.js} +5 -11
- package/build/server/chunks/_server.ts-DI8tBJml.js.map +1 -0
- package/build/server/chunks/{_server.ts-Cu69G-Uv.js → _server.ts-DJbYluhf.js} +2 -2
- package/build/server/chunks/{_server.ts-Cu69G-Uv.js.map → _server.ts-DJbYluhf.js.map} +1 -1
- package/build/server/chunks/{_server.ts-B-w81Hz0.js → _server.ts-K9S2g_-L.js} +2 -2
- package/build/server/chunks/{_server.ts-B-w81Hz0.js.map → _server.ts-K9S2g_-L.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Cfbl_bId.js → _server.ts-p_sHg72N.js} +8 -8
- package/build/server/chunks/_server.ts-p_sHg72N.js.map +1 -0
- package/build/server/chunks/hooks.server-BHuIRhU1.js +44 -0
- package/build/server/chunks/hooks.server-BHuIRhU1.js.map +1 -0
- package/build/server/chunks/{session-manager-uzbpiZOt.js → session-manager-CBzriHWC.js} +15 -2
- package/build/server/chunks/session-manager-CBzriHWC.js.map +1 -0
- package/build/server/chunks/{sse-manager-CJXA3H0i.js → sse-manager-DpUiK2jt.js} +14 -9
- package/build/server/chunks/sse-manager-DpUiK2jt.js.map +1 -0
- package/build/server/chunks/status-BrtsDZqP.js +24 -0
- package/build/server/chunks/status-BrtsDZqP.js.map +1 -0
- package/build/server/index.js +2 -2
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +12 -12
- package/build/server/manifest.js.map +1 -1
- package/dist/{commands → cli/commands}/clean.js +5 -15
- package/dist/{commands → cli/commands}/list.js +4 -3
- package/dist/{commands → cli/commands}/review.js +11 -9
- package/dist/{commands → cli/commands}/status.js +2 -15
- package/dist/{export-html.js → cli/export-html.js} +11 -3
- package/dist/{markdown-to-plan.js → cli/markdown-parser.js} +18 -187
- package/dist/cli/markdown-to-plan.js +171 -0
- package/dist/cli/utils.js +21 -0
- package/dist/lib/types/index.js +1 -0
- package/dist/lib/types/plan.js +1 -0
- package/dist/lib/types/session.js +1 -0
- package/package.json +1 -1
- package/build/client/_app/immutable/assets/0.BEz2JfDV.css +0 -1
- package/build/client/_app/immutable/chunks/0Env-fyO.js +0 -2
- package/build/client/_app/immutable/chunks/CDEb7Qa1.js +0 -1
- package/build/client/_app/immutable/chunks/ChrxZS8F.js +0 -2
- package/build/client/_app/immutable/chunks/DBYl454j.js +0 -3
- package/build/client/_app/immutable/chunks/xPbrE9hZ.js +0 -1
- package/build/client/_app/immutable/entry/start.CkJBU-bw.js +0 -1
- package/build/client/_app/immutable/nodes/0.xmBc70d0.js +0 -1
- package/build/client/_app/immutable/nodes/2.CJsGm-zx.js +0 -1
- package/build/client/_app/immutable/nodes/3.DCDQ9T20.js +0 -1
- package/build/server/chunks/0-DPYv3B-j.js +0 -9
- package/build/server/chunks/1-BO4kNsrv.js +0 -9
- package/build/server/chunks/_page.svelte-Up0EdgYM.js.map +0 -1
- package/build/server/chunks/_page.svelte-jWqZZdpj.js.map +0 -1
- package/build/server/chunks/_server.ts-Cfbl_bId.js.map +0 -1
- package/build/server/chunks/_server.ts-DpdXzg2s.js.map +0 -1
- package/build/server/chunks/hooks.server-DGwCGEDl.js +0 -43
- package/build/server/chunks/hooks.server-DGwCGEDl.js.map +0 -1
- package/build/server/chunks/session-manager-uzbpiZOt.js.map +0 -1
- package/build/server/chunks/sse-manager-CJXA3H0i.js.map +0 -1
- /package/dist/{commands → cli/commands}/export.js +0 -0
- /package/dist/{commands → cli/commands}/feedback.js +0 -0
- /package/dist/{commands → cli/commands}/init.js +0 -0
- /package/dist/{index.js → cli/index.js} +0 -0
- /package/dist/{mermaid-gen.js → cli/mermaid-gen.js} +0 -0
- /package/dist/{output.js → cli/output.js} +0 -0
- /package/dist/{session-reader.js → cli/session-reader.js} +0 -0
- /package/dist/{session-resolver.js → cli/session-resolver.js} +0 -0
- /package/dist/{types.js → lib/types/feedback.js} +0 -0
package/build/server/manifest.js
CHANGED
|
@@ -10,12 +10,12 @@ return {
|
|
|
10
10
|
assets: new Set(["favicon.png"]),
|
|
11
11
|
mimeTypes: {".png":"image/png"},
|
|
12
12
|
_: {
|
|
13
|
-
client: {start:"_app/immutable/entry/start.
|
|
13
|
+
client: {start:"_app/immutable/entry/start.D2e-hus4.js",app:"_app/immutable/entry/app.B2C74vct.js",imports:["_app/immutable/entry/start.D2e-hus4.js","_app/immutable/chunks/cUUj7sxC.js","_app/immutable/chunks/CiHc4XuG.js","_app/immutable/chunks/DgjsH1_4.js","_app/immutable/entry/app.B2C74vct.js","_app/immutable/chunks/BfL8uxRT.js","_app/immutable/chunks/CiHc4XuG.js","_app/immutable/chunks/Crb4tJFd.js","_app/immutable/chunks/DolVEyKl.js","_app/immutable/chunks/DgjsH1_4.js","_app/immutable/chunks/CUfXrgXj.js","_app/immutable/chunks/C3DTNv0i.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
14
14
|
nodes: [
|
|
15
|
-
__memo(() => import('./chunks/0-
|
|
16
|
-
__memo(() => import('./chunks/1-
|
|
17
|
-
__memo(() => import('./chunks/2-
|
|
18
|
-
__memo(() => import('./chunks/3-
|
|
15
|
+
__memo(() => import('./chunks/0-FIjyGrw5.js')),
|
|
16
|
+
__memo(() => import('./chunks/1-Bkky1G1I.js')),
|
|
17
|
+
__memo(() => import('./chunks/2-B3cRP7wL.js')),
|
|
18
|
+
__memo(() => import('./chunks/3-CHdqnsU5.js'))
|
|
19
19
|
],
|
|
20
20
|
remotes: {
|
|
21
21
|
|
|
@@ -40,49 +40,49 @@ return {
|
|
|
40
40
|
pattern: /^\/api\/sessions\/?$/,
|
|
41
41
|
params: [],
|
|
42
42
|
page: null,
|
|
43
|
-
endpoint: __memo(() => import('./chunks/_server.ts-
|
|
43
|
+
endpoint: __memo(() => import('./chunks/_server.ts-CtgVvBfR.js'))
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
id: "/api/sessions/[sessionId]",
|
|
47
47
|
pattern: /^\/api\/sessions\/([^/]+?)\/?$/,
|
|
48
48
|
params: [{"name":"sessionId","optional":false,"rest":false,"chained":false}],
|
|
49
49
|
page: null,
|
|
50
|
-
endpoint: __memo(() => import('./chunks/_server.ts-
|
|
50
|
+
endpoint: __memo(() => import('./chunks/_server.ts-DJbYluhf.js'))
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
id: "/api/sessions/[sessionId]/approve",
|
|
54
54
|
pattern: /^\/api\/sessions\/([^/]+?)\/approve\/?$/,
|
|
55
55
|
params: [{"name":"sessionId","optional":false,"rest":false,"chained":false}],
|
|
56
56
|
page: null,
|
|
57
|
-
endpoint: __memo(() => import('./chunks/_server.ts-
|
|
57
|
+
endpoint: __memo(() => import('./chunks/_server.ts-DI8tBJml.js'))
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
id: "/api/sessions/[sessionId]/feedback",
|
|
61
61
|
pattern: /^\/api\/sessions\/([^/]+?)\/feedback\/?$/,
|
|
62
62
|
params: [{"name":"sessionId","optional":false,"rest":false,"chained":false}],
|
|
63
63
|
page: null,
|
|
64
|
-
endpoint: __memo(() => import('./chunks/_server.ts-
|
|
64
|
+
endpoint: __memo(() => import('./chunks/_server.ts-CY7NfbtD.js'))
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
id: "/api/sessions/[sessionId]/versions",
|
|
68
68
|
pattern: /^\/api\/sessions\/([^/]+?)\/versions\/?$/,
|
|
69
69
|
params: [{"name":"sessionId","optional":false,"rest":false,"chained":false}],
|
|
70
70
|
page: null,
|
|
71
|
-
endpoint: __memo(() => import('./chunks/_server.ts-
|
|
71
|
+
endpoint: __memo(() => import('./chunks/_server.ts-CpPXj3O_.js'))
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
id: "/api/sessions/[sessionId]/versions/[version]",
|
|
75
75
|
pattern: /^\/api\/sessions\/([^/]+?)\/versions\/([^/]+?)\/?$/,
|
|
76
76
|
params: [{"name":"sessionId","optional":false,"rest":false,"chained":false},{"name":"version","optional":false,"rest":false,"chained":false}],
|
|
77
77
|
page: null,
|
|
78
|
-
endpoint: __memo(() => import('./chunks/_server.ts-
|
|
78
|
+
endpoint: __memo(() => import('./chunks/_server.ts-K9S2g_-L.js'))
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
id: "/api/sse/[sessionId]",
|
|
82
82
|
pattern: /^\/api\/sse\/([^/]+?)\/?$/,
|
|
83
83
|
params: [{"name":"sessionId","optional":false,"rest":false,"chained":false}],
|
|
84
84
|
page: null,
|
|
85
|
-
endpoint: __memo(() => import('./chunks/_server.ts-
|
|
85
|
+
endpoint: __memo(() => import('./chunks/_server.ts-p_sHg72N.js'))
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
id: "/plan/[sessionId]",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"favicon.png\"]),\n\tmimeTypes: {\".png\":\"image/png\"},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.
|
|
1
|
+
{"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"favicon.png\"]),\n\tmimeTypes: {\".png\":\"image/png\"},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.D2e-hus4.js\",app:\"_app/immutable/entry/app.B2C74vct.js\",imports:[\"_app/immutable/entry/start.D2e-hus4.js\",\"_app/immutable/chunks/cUUj7sxC.js\",\"_app/immutable/chunks/CiHc4XuG.js\",\"_app/immutable/chunks/DgjsH1_4.js\",\"_app/immutable/entry/app.B2C74vct.js\",\"_app/immutable/chunks/BfL8uxRT.js\",\"_app/immutable/chunks/CiHc4XuG.js\",\"_app/immutable/chunks/Crb4tJFd.js\",\"_app/immutable/chunks/DolVEyKl.js\",\"_app/immutable/chunks/DgjsH1_4.js\",\"_app/immutable/chunks/CUfXrgXj.js\",\"_app/immutable/chunks/C3DTNv0i.js\"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js')),\n\t\t\t__memo(() => import('./nodes/2.js')),\n\t\t\t__memo(() => import('./nodes/3.js'))\n\t\t],\n\t\tremotes: {\n\t\t\t\n\t\t},\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/\",\n\t\t\t\tpattern: /^\\/$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 2 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/health\",\n\t\t\t\tpattern: /^\\/api\\/health\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/health/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/sessions\",\n\t\t\t\tpattern: /^\\/api\\/sessions\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/sessions/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/sessions/[sessionId]\",\n\t\t\t\tpattern: /^\\/api\\/sessions\\/([^/]+?)\\/?$/,\n\t\t\t\tparams: [{\"name\":\"sessionId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/sessions/_sessionId_/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/sessions/[sessionId]/approve\",\n\t\t\t\tpattern: /^\\/api\\/sessions\\/([^/]+?)\\/approve\\/?$/,\n\t\t\t\tparams: [{\"name\":\"sessionId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/sessions/_sessionId_/approve/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/sessions/[sessionId]/feedback\",\n\t\t\t\tpattern: /^\\/api\\/sessions\\/([^/]+?)\\/feedback\\/?$/,\n\t\t\t\tparams: [{\"name\":\"sessionId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/sessions/_sessionId_/feedback/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/sessions/[sessionId]/versions\",\n\t\t\t\tpattern: /^\\/api\\/sessions\\/([^/]+?)\\/versions\\/?$/,\n\t\t\t\tparams: [{\"name\":\"sessionId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/sessions/_sessionId_/versions/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/sessions/[sessionId]/versions/[version]\",\n\t\t\t\tpattern: /^\\/api\\/sessions\\/([^/]+?)\\/versions\\/([^/]+?)\\/?$/,\n\t\t\t\tparams: [{\"name\":\"sessionId\",\"optional\":false,\"rest\":false,\"chained\":false},{\"name\":\"version\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/sessions/_sessionId_/versions/_version_/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/sse/[sessionId]\",\n\t\t\t\tpattern: /^\\/api\\/sse\\/([^/]+?)\\/?$/,\n\t\t\t\tparams: [{\"name\":\"sessionId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/sse/_sessionId_/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/plan/[sessionId]\",\n\t\t\t\tpattern: /^\\/plan\\/([^/]+?)\\/?$/,\n\t\t\t\tparams: [{\"name\":\"sessionId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 3 },\n\t\t\t\tendpoint: null\n\t\t\t}\n\t\t],\n\t\tprerendered_routes: new Set([]),\n\t\tmatchers: async () => {\n\t\t\t\n\t\t\treturn { };\n\t\t},\n\t\t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AC,SAAS,CAAC,KAAK,CAAC,CAAC;AAChF,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,QAAQ,EAAE,MAAM,CAAC,MAAM,OAAO,iCAAuD,CAAC;AAC1F,IAAI;AACJ,GAAG;AACH,IAAI,EAAE,EAAE,mBAAmB;AAC3B,IAAI,OAAO,EAAE,uBAAuB;AACpC,IAAI,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAChF,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd;AACA,GAAG;AACH,EAAE,kBAAkB,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;AACjC,EAAE,QAAQ,EAAE,YAAY;AACxB;AACA,GAAG,OAAO,IAAI;AACd,EAAE,CAAC;AACH,EAAE,aAAa,EAAE;AACjB;AACA;AACA,CAAC;;AAEW,MAAC,WAAW,GAAG,IAAI,GAAG,CAAC,EAAE;;AAEzB,MAAC,IAAI,GAAG;;;;"}
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import { existsSync, rmSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { findSessionDirs } from "../session-reader.js";
|
|
4
|
-
import { readMeta } from "../session-reader.js";
|
|
5
4
|
import { outputJson, outputError } from "../output.js";
|
|
5
|
+
import { parseDuration } from "../utils.js";
|
|
6
6
|
import * as readline from "node:readline";
|
|
7
|
-
function parseDuration(s) {
|
|
8
|
-
const match = s.match(/^(\d+)(h|d|w)$/);
|
|
9
|
-
if (!match)
|
|
10
|
-
return null;
|
|
11
|
-
const n = parseInt(match[1], 10);
|
|
12
|
-
switch (match[2]) {
|
|
13
|
-
case "h": return n * 3600 * 1000;
|
|
14
|
-
case "d": return n * 86400 * 1000;
|
|
15
|
-
case "w": return n * 7 * 86400 * 1000;
|
|
16
|
-
default: return null;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
7
|
async function confirm(message) {
|
|
20
8
|
const rl = readline.createInterface({
|
|
21
9
|
input: process.stdin,
|
|
@@ -29,7 +17,9 @@ async function confirm(message) {
|
|
|
29
17
|
});
|
|
30
18
|
}
|
|
31
19
|
export async function clean(args) {
|
|
32
|
-
const dir = typeof args.flags.dir === "string"
|
|
20
|
+
const dir = typeof args.flags.dir === "string"
|
|
21
|
+
? resolve(args.flags.dir)
|
|
22
|
+
: process.cwd();
|
|
33
23
|
const all = args.flags.all === true;
|
|
34
24
|
const dryRun = args.flags["dry-run"] === true;
|
|
35
25
|
const force = args.flags.force === true;
|
|
@@ -48,7 +38,7 @@ export async function clean(args) {
|
|
|
48
38
|
const now = Date.now();
|
|
49
39
|
const toRemove = [];
|
|
50
40
|
for (const entry of sessions) {
|
|
51
|
-
const meta =
|
|
41
|
+
const meta = entry.meta;
|
|
52
42
|
if (!meta)
|
|
53
43
|
continue;
|
|
54
44
|
// Orphan detection: markdown file no longer exists
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
|
-
import { findSessionDirs } from "../session-reader.js";
|
|
3
|
-
import { readFeedback } from "../session-reader.js";
|
|
2
|
+
import { findSessionDirs, readFeedback } from "../session-reader.js";
|
|
4
3
|
import { outputJson } from "../output.js";
|
|
5
4
|
export async function list(args) {
|
|
6
|
-
const dir = typeof args.flags.dir === "string"
|
|
5
|
+
const dir = typeof args.flags.dir === "string"
|
|
6
|
+
? resolve(args.flags.dir)
|
|
7
|
+
: process.cwd();
|
|
7
8
|
const sessions = findSessionDirs(dir);
|
|
8
9
|
const result = sessions.map((entry) => {
|
|
9
10
|
const feedback = readFeedback(entry.sessionDir);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync,
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
2
2
|
import { resolve, dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { spawn, execSync } from "node:child_process";
|
|
@@ -6,17 +6,13 @@ import { createServer } from "node:net";
|
|
|
6
6
|
import { watch } from "chokidar";
|
|
7
7
|
import { parseMarkdownToPlan, sessionIdFromPath } from "../markdown-to-plan.js";
|
|
8
8
|
import { outputJson } from "../output.js";
|
|
9
|
+
import { ensureDir } from "../utils.js";
|
|
9
10
|
const DEFAULT_BASE_PORT = 5181;
|
|
10
11
|
const MAX_PORT = 5199;
|
|
11
12
|
function getPackageDir() {
|
|
12
13
|
const thisFile = fileURLToPath(import.meta.url);
|
|
13
|
-
// dist/commands/review.js -> package root
|
|
14
|
-
return resolve(dirname(thisFile), "
|
|
15
|
-
}
|
|
16
|
-
function ensureDir(dir) {
|
|
17
|
-
if (!existsSync(dir)) {
|
|
18
|
-
mkdirSync(dir, { recursive: true });
|
|
19
|
-
}
|
|
14
|
+
// dist/cli/commands/review.js -> package root
|
|
15
|
+
return resolve(dirname(thisFile), "../../..");
|
|
20
16
|
}
|
|
21
17
|
async function checkHealth(port) {
|
|
22
18
|
try {
|
|
@@ -105,7 +101,12 @@ function startServer(sessionDir, port) {
|
|
|
105
101
|
}
|
|
106
102
|
function openBrowser(url) {
|
|
107
103
|
try {
|
|
108
|
-
|
|
104
|
+
const cmd = process.platform === "darwin"
|
|
105
|
+
? "open"
|
|
106
|
+
: process.platform === "win32"
|
|
107
|
+
? "start"
|
|
108
|
+
: "xdg-open";
|
|
109
|
+
execSync(`${cmd} "${url}"`, { stdio: "ignore" });
|
|
109
110
|
}
|
|
110
111
|
catch {
|
|
111
112
|
console.log(`Open in browser: ${url}`);
|
|
@@ -243,6 +244,7 @@ export async function review(args) {
|
|
|
243
244
|
console.error(`Warning: ${warning}`);
|
|
244
245
|
}
|
|
245
246
|
writeFileSync(join(sessionPath, "plan.json"), JSON.stringify(newPlan, null, 2));
|
|
247
|
+
writeFileSync(join(sessionPath, "versions", `v${newVersion}.json`), JSON.stringify(newPlan, null, 2));
|
|
246
248
|
console.error(`[${new Date().toLocaleTimeString()}] Plan updated (v${newVersion})`);
|
|
247
249
|
}
|
|
248
250
|
catch (err) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveSession } from "../session-resolver.js";
|
|
2
2
|
import { readMeta, readFeedback } from "../session-reader.js";
|
|
3
3
|
import { outputJson, outputError } from "../output.js";
|
|
4
|
+
import { parseDuration } from "../utils.js";
|
|
4
5
|
import { watch } from "chokidar";
|
|
5
6
|
import { join } from "node:path";
|
|
6
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -61,7 +62,7 @@ export async function status(args) {
|
|
|
61
62
|
if (shouldWait) {
|
|
62
63
|
const timeoutStr = args.flags["wait-timeout"];
|
|
63
64
|
const timeoutMs = typeof timeoutStr === "string"
|
|
64
|
-
? parseDuration(timeoutStr)
|
|
65
|
+
? (parseDuration(timeoutStr) ?? 30 * 60 * 1000)
|
|
65
66
|
: 30 * 60 * 1000; // 30 min default
|
|
66
67
|
await waitForFeedback(resolved.sessionDir, resolved.sessionId, meta, timeoutMs);
|
|
67
68
|
return;
|
|
@@ -79,20 +80,6 @@ export async function status(args) {
|
|
|
79
80
|
}, args.flags.pretty === true);
|
|
80
81
|
process.exit(exitCode);
|
|
81
82
|
}
|
|
82
|
-
function parseDuration(s) {
|
|
83
|
-
const match = s.match(/^(\d+)(ms|s|m|h|d)$/);
|
|
84
|
-
if (!match)
|
|
85
|
-
return 30 * 60 * 1000;
|
|
86
|
-
const n = parseInt(match[1], 10);
|
|
87
|
-
switch (match[2]) {
|
|
88
|
-
case "ms": return n;
|
|
89
|
-
case "s": return n * 1000;
|
|
90
|
-
case "m": return n * 60 * 1000;
|
|
91
|
-
case "h": return n * 3600 * 1000;
|
|
92
|
-
case "d": return n * 86400 * 1000;
|
|
93
|
-
default: return 30 * 60 * 1000;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
83
|
async function waitForFeedback(sessionDir, sessionId, meta, timeoutMs) {
|
|
97
84
|
// Check current state first
|
|
98
85
|
const current = readFeedback(sessionDir);
|
|
@@ -39,11 +39,19 @@ function renderComments(comments, phaseId) {
|
|
|
39
39
|
.join("\n");
|
|
40
40
|
return `<div style="margin:12px 0">${items}</div>`;
|
|
41
41
|
}
|
|
42
|
+
import { createRequire } from "node:module";
|
|
43
|
+
let hljs = null;
|
|
44
|
+
try {
|
|
45
|
+
const require = createRequire(import.meta.url);
|
|
46
|
+
hljs = require("highlight.js");
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// highlight.js not available
|
|
50
|
+
}
|
|
42
51
|
function highlightCode(code, lang) {
|
|
52
|
+
if (!hljs)
|
|
53
|
+
return escapeHtml(code);
|
|
43
54
|
try {
|
|
44
|
-
// Dynamic import of highlight.js for server-side highlighting
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
46
|
-
const hljs = require("highlight.js");
|
|
47
55
|
if (lang && hljs.getLanguage(lang)) {
|
|
48
56
|
return hljs.highlight(code, { language: lang }).value;
|
|
49
57
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { Lexer } from "marked";
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
1
|
import { basename } from "node:path";
|
|
4
|
-
|
|
5
|
-
function createParseContext() {
|
|
2
|
+
export function createParseContext() {
|
|
6
3
|
const warnings = [];
|
|
7
4
|
return {
|
|
8
5
|
warnings,
|
|
@@ -11,7 +8,7 @@ function createParseContext() {
|
|
|
11
8
|
},
|
|
12
9
|
};
|
|
13
10
|
}
|
|
14
|
-
function splitIntoSections(tokens) {
|
|
11
|
+
export function splitIntoSections(tokens) {
|
|
15
12
|
const sections = [];
|
|
16
13
|
let current = null;
|
|
17
14
|
for (const token of tokens) {
|
|
@@ -26,16 +23,16 @@ function splitIntoSections(tokens) {
|
|
|
26
23
|
}
|
|
27
24
|
return sections;
|
|
28
25
|
}
|
|
29
|
-
function tokensToMarkdown(tokens) {
|
|
26
|
+
export function tokensToMarkdown(tokens) {
|
|
30
27
|
return tokens
|
|
31
28
|
.map((t) => t.raw)
|
|
32
29
|
.join("")
|
|
33
30
|
.trim();
|
|
34
31
|
}
|
|
35
|
-
function findSection(sections, pattern, level) {
|
|
32
|
+
export function findSection(sections, pattern, level) {
|
|
36
33
|
return sections.find((s) => pattern.test(s.heading) && (level === undefined || s.level === level));
|
|
37
34
|
}
|
|
38
|
-
function collectSectionsUntilLevel(sections, startIdx, level) {
|
|
35
|
+
export function collectSectionsUntilLevel(sections, startIdx, level) {
|
|
39
36
|
const result = [];
|
|
40
37
|
for (let i = startIdx + 1; i < sections.length; i++) {
|
|
41
38
|
if (sections[i].level <= level)
|
|
@@ -44,7 +41,7 @@ function collectSectionsUntilLevel(sections, startIdx, level) {
|
|
|
44
41
|
}
|
|
45
42
|
return result;
|
|
46
43
|
}
|
|
47
|
-
function parseKeyDiscoveries(tokens) {
|
|
44
|
+
export function parseKeyDiscoveries(tokens) {
|
|
48
45
|
const results = [];
|
|
49
46
|
for (const token of tokens) {
|
|
50
47
|
if (token.type === "list") {
|
|
@@ -61,7 +58,7 @@ function parseKeyDiscoveries(tokens) {
|
|
|
61
58
|
}
|
|
62
59
|
return results;
|
|
63
60
|
}
|
|
64
|
-
function parseScopeExclusions(tokens) {
|
|
61
|
+
export function parseScopeExclusions(tokens) {
|
|
65
62
|
const results = [];
|
|
66
63
|
for (const token of tokens) {
|
|
67
64
|
if (token.type === "list") {
|
|
@@ -88,7 +85,7 @@ function parseScopeExclusions(tokens) {
|
|
|
88
85
|
* Extract file path from a paragraph token using multiple patterns.
|
|
89
86
|
* Accepts: **File**: `path`, **Path**: `path`, File: `path`, bare `path/to/file.ext`
|
|
90
87
|
*/
|
|
91
|
-
function extractFilePath(raw) {
|
|
88
|
+
export function extractFilePath(raw) {
|
|
92
89
|
// Pattern 1: **File**: `path` or **Path**: `path`
|
|
93
90
|
const boldPattern = raw.match(/\*\*(?:File|Path)\*\*:\s*`([^`]+)`\s*(\(new\))?\s*/i);
|
|
94
91
|
if (boldPattern) {
|
|
@@ -111,7 +108,7 @@ function extractFilePath(raw) {
|
|
|
111
108
|
* Parse changes from heading-based sections (#### N. Name).
|
|
112
109
|
* Accepts both level 4 and level 3 sections.
|
|
113
110
|
*/
|
|
114
|
-
function parseChangesFromHeadings(sections, ctx) {
|
|
111
|
+
export function parseChangesFromHeadings(sections, ctx) {
|
|
115
112
|
const changes = [];
|
|
116
113
|
for (const section of sections) {
|
|
117
114
|
// Accept level 3 or 4
|
|
@@ -174,7 +171,7 @@ function parseChangesFromHeadings(sections, ctx) {
|
|
|
174
171
|
* Parse changes from bullet list items with file paths.
|
|
175
172
|
* Accepts: - **path/to/file**: description
|
|
176
173
|
*/
|
|
177
|
-
function parseChangesFromList(tokens, ctx) {
|
|
174
|
+
export function parseChangesFromList(tokens, ctx) {
|
|
178
175
|
const changes = [];
|
|
179
176
|
for (const token of tokens) {
|
|
180
177
|
if (token.type !== "list")
|
|
@@ -214,7 +211,7 @@ function parseChangesFromList(tokens, ctx) {
|
|
|
214
211
|
}
|
|
215
212
|
return changes;
|
|
216
213
|
}
|
|
217
|
-
function parseCriteria(tokens, type) {
|
|
214
|
+
export function parseCriteria(tokens, type) {
|
|
218
215
|
const criteria = [];
|
|
219
216
|
for (const token of tokens) {
|
|
220
217
|
if (token.type === "list") {
|
|
@@ -239,7 +236,7 @@ function parseCriteria(tokens, type) {
|
|
|
239
236
|
* Try to match a section heading as a phase heading.
|
|
240
237
|
* Cascade: strict first, then relaxed patterns.
|
|
241
238
|
*/
|
|
242
|
-
function tryMatchPhaseHeading(heading, autoNumber) {
|
|
239
|
+
export function tryMatchPhaseHeading(heading, autoNumber) {
|
|
243
240
|
// Canonical: "Phase 1: Setup"
|
|
244
241
|
let m = heading.match(/^Phase\s+(\d+):\s*(.+)/i);
|
|
245
242
|
if (m)
|
|
@@ -263,7 +260,7 @@ function tryMatchPhaseHeading(heading, autoNumber) {
|
|
|
263
260
|
return null;
|
|
264
261
|
}
|
|
265
262
|
/** Known top-level section patterns that should NOT be treated as phases */
|
|
266
|
-
const KNOWN_SECTION_PATTERNS = [
|
|
263
|
+
export const KNOWN_SECTION_PATTERNS = [
|
|
267
264
|
/^Overview$/i,
|
|
268
265
|
/^Current\s+State/i,
|
|
269
266
|
/What\s+We.*NOT\s+Doing/i,
|
|
@@ -275,9 +272,9 @@ const KNOWN_SECTION_PATTERNS = [
|
|
|
275
272
|
/^Version$/i,
|
|
276
273
|
/^Summary$/i,
|
|
277
274
|
];
|
|
278
|
-
const CHANGES_HEADING_PATTERN = /^(?:Changes\s+Required|Changes|File\s+Changes|Modifications):?$/i;
|
|
279
|
-
const SUCCESS_CRITERIA_HEADING_PATTERN = /^(?:Success\s+Criteria|Criteria|Verification):?$/i;
|
|
280
|
-
function parsePhases(allSections, ctx) {
|
|
275
|
+
export const CHANGES_HEADING_PATTERN = /^(?:Changes\s+Required|Changes|File\s+Changes|Modifications):?$/i;
|
|
276
|
+
export const SUCCESS_CRITERIA_HEADING_PATTERN = /^(?:Success\s+Criteria|Criteria|Verification):?$/i;
|
|
277
|
+
export function parsePhases(allSections, ctx) {
|
|
281
278
|
const phases = [];
|
|
282
279
|
let autoNumber = 1;
|
|
283
280
|
for (let i = 0; i < allSections.length; i++) {
|
|
@@ -431,7 +428,7 @@ function parsePhases(allSections, ctx) {
|
|
|
431
428
|
}
|
|
432
429
|
return phases;
|
|
433
430
|
}
|
|
434
|
-
function parseTestingStrategy(section, subSections) {
|
|
431
|
+
export function parseTestingStrategy(section, subSections) {
|
|
435
432
|
const result = {
|
|
436
433
|
unit: [],
|
|
437
434
|
integration: [],
|
|
@@ -459,7 +456,7 @@ function parseTestingStrategy(section, subSections) {
|
|
|
459
456
|
result.manual = extractList(manualSection);
|
|
460
457
|
return result;
|
|
461
458
|
}
|
|
462
|
-
function parseReferences(tokens) {
|
|
459
|
+
export function parseReferences(tokens) {
|
|
463
460
|
const refs = [];
|
|
464
461
|
for (const token of tokens) {
|
|
465
462
|
if (token.type === "list") {
|
|
@@ -478,169 +475,3 @@ function parseReferences(tokens) {
|
|
|
478
475
|
}
|
|
479
476
|
return refs;
|
|
480
477
|
}
|
|
481
|
-
export function sessionIdFromPath(absolutePath) {
|
|
482
|
-
return createHash("sha256").update(absolutePath).digest("hex").slice(0, 8);
|
|
483
|
-
}
|
|
484
|
-
export function parseMarkdownToPlan(markdown, markdownPath, projectDir, version = 1) {
|
|
485
|
-
const ctx = createParseContext();
|
|
486
|
-
const tokens = Lexer.lex(markdown);
|
|
487
|
-
const sections = splitIntoSections(tokens);
|
|
488
|
-
// Title from first H1
|
|
489
|
-
const titleSection = sections.find((s) => s.level === 1);
|
|
490
|
-
const title = titleSection?.heading ?? basename(markdownPath, ".md");
|
|
491
|
-
// Date from filename or today
|
|
492
|
-
const dateMatch = basename(markdownPath).match(/^(\d{4}-\d{2}-\d{2})/);
|
|
493
|
-
const date = dateMatch ? dateMatch[1] : new Date().toISOString().slice(0, 10);
|
|
494
|
-
// Ticket ref from filename
|
|
495
|
-
const ticketMatch = basename(markdownPath).match(/(?:ENG|TASK)-(\d+)/i);
|
|
496
|
-
const ticketRef = ticketMatch ? ticketMatch[0].toUpperCase() : undefined;
|
|
497
|
-
// Overview
|
|
498
|
-
const overviewSection = findSection(sections, /^Overview$/i, 2);
|
|
499
|
-
const overview = overviewSection
|
|
500
|
-
? tokensToMarkdown(overviewSection.tokens)
|
|
501
|
-
: "";
|
|
502
|
-
// Current State
|
|
503
|
-
const currentStateSection = findSection(sections, /^Current\s+State/i, 2);
|
|
504
|
-
const currentStateIdx = currentStateSection
|
|
505
|
-
? sections.indexOf(currentStateSection)
|
|
506
|
-
: -1;
|
|
507
|
-
let currentState = "";
|
|
508
|
-
let keyDiscoveries = [];
|
|
509
|
-
if (currentStateSection) {
|
|
510
|
-
const subSections = collectSectionsUntilLevel(sections, currentStateIdx, 2);
|
|
511
|
-
const kdSection = subSections.find((s) => /Key\s+Discover/i.test(s.heading));
|
|
512
|
-
if (kdSection) {
|
|
513
|
-
keyDiscoveries = parseKeyDiscoveries(kdSection.tokens);
|
|
514
|
-
const kdIdx = sections.indexOf(kdSection);
|
|
515
|
-
const beforeKd = [];
|
|
516
|
-
for (let i = currentStateIdx + 1; i < kdIdx; i++) {
|
|
517
|
-
beforeKd.push(...sections[i].tokens);
|
|
518
|
-
}
|
|
519
|
-
currentState = tokensToMarkdown([
|
|
520
|
-
...currentStateSection.tokens,
|
|
521
|
-
...beforeKd,
|
|
522
|
-
]);
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
currentState = tokensToMarkdown(currentStateSection.tokens);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
// Scope exclusions
|
|
529
|
-
const scopeSection = findSection(sections, /What\s+We.*NOT\s+Doing/i, 2);
|
|
530
|
-
const scopeExclusions = scopeSection
|
|
531
|
-
? parseScopeExclusions(scopeSection.tokens)
|
|
532
|
-
: [];
|
|
533
|
-
// Implementation approach
|
|
534
|
-
const approachSection = findSection(sections, /Implementation\s+Approach/i, 2);
|
|
535
|
-
const implementationApproach = approachSection
|
|
536
|
-
? tokensToMarkdown(approachSection.tokens)
|
|
537
|
-
: "";
|
|
538
|
-
// Phases
|
|
539
|
-
const phases = parsePhases(sections, ctx);
|
|
540
|
-
// Diagrams
|
|
541
|
-
const diagrams = [];
|
|
542
|
-
if (phases.length > 0) {
|
|
543
|
-
diagrams.push(generatePhaseFlowDiagram(phases));
|
|
544
|
-
}
|
|
545
|
-
// Testing strategy
|
|
546
|
-
const testingSection = findSection(sections, /Testing\s+Strategy/i, 2);
|
|
547
|
-
const testingIdx = testingSection ? sections.indexOf(testingSection) : -1;
|
|
548
|
-
const testingSubs = testingIdx >= 0 ? collectSectionsUntilLevel(sections, testingIdx, 2) : [];
|
|
549
|
-
const testingStrategy = testingSection
|
|
550
|
-
? parseTestingStrategy(testingSection, testingSubs)
|
|
551
|
-
: { unit: [], integration: [], manual: [] };
|
|
552
|
-
// References
|
|
553
|
-
const refsSection = findSection(sections, /^References$/i, 2);
|
|
554
|
-
const references = refsSection ? parseReferences(refsSection.tokens) : [];
|
|
555
|
-
// Collect additional (unrecognized) H2 sections
|
|
556
|
-
const knownH2Indices = new Set();
|
|
557
|
-
const knownPatterns = [
|
|
558
|
-
/^Overview$/i,
|
|
559
|
-
/^Current\s+State/i,
|
|
560
|
-
/What\s+We.*NOT\s+Doing/i,
|
|
561
|
-
/Implementation\s+Approach/i,
|
|
562
|
-
/Testing\s+Strategy/i,
|
|
563
|
-
/^References$/i,
|
|
564
|
-
];
|
|
565
|
-
for (let i = 0; i < sections.length; i++) {
|
|
566
|
-
if (sections[i].level === 1) {
|
|
567
|
-
knownH2Indices.add(i);
|
|
568
|
-
continue;
|
|
569
|
-
}
|
|
570
|
-
if (sections[i].level !== 2)
|
|
571
|
-
continue;
|
|
572
|
-
// Check if it's a known section
|
|
573
|
-
if (knownPatterns.some((p) => p.test(sections[i].heading))) {
|
|
574
|
-
knownH2Indices.add(i);
|
|
575
|
-
continue;
|
|
576
|
-
}
|
|
577
|
-
// Check if it was parsed as a phase
|
|
578
|
-
if (phases.some((p) => p.name === sections[i].heading ||
|
|
579
|
-
tryMatchPhaseHeading(sections[i].heading, 0))) {
|
|
580
|
-
knownH2Indices.add(i);
|
|
581
|
-
continue;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
const additionalSections = [];
|
|
585
|
-
for (let i = 0; i < sections.length; i++) {
|
|
586
|
-
if (sections[i].level !== 2 || knownH2Indices.has(i))
|
|
587
|
-
continue;
|
|
588
|
-
// Double-check it's not a parsed phase
|
|
589
|
-
const isPhase = phases.some((p) => p.name === sections[i].heading ||
|
|
590
|
-
sections[i].heading.match(new RegExp(`Phase\\s+${p.number}`, "i")));
|
|
591
|
-
if (isPhase)
|
|
592
|
-
continue;
|
|
593
|
-
const subs = collectSectionsUntilLevel(sections, i, 2);
|
|
594
|
-
let content = tokensToMarkdown(sections[i].tokens);
|
|
595
|
-
for (const sub of subs) {
|
|
596
|
-
content += `\n\n${"#".repeat(sub.level)} ${sub.heading}\n\n${tokensToMarkdown(sub.tokens)}`;
|
|
597
|
-
}
|
|
598
|
-
additionalSections.push({
|
|
599
|
-
heading: sections[i].heading,
|
|
600
|
-
content: content.trim(),
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
const now = new Date().toISOString();
|
|
604
|
-
const plan = {
|
|
605
|
-
schemaVersion: 1,
|
|
606
|
-
meta: {
|
|
607
|
-
title,
|
|
608
|
-
date,
|
|
609
|
-
ticketRef,
|
|
610
|
-
markdownPath,
|
|
611
|
-
projectDir,
|
|
612
|
-
version,
|
|
613
|
-
createdAt: now,
|
|
614
|
-
updatedAt: now,
|
|
615
|
-
},
|
|
616
|
-
overview,
|
|
617
|
-
currentState,
|
|
618
|
-
keyDiscoveries,
|
|
619
|
-
scopeExclusions,
|
|
620
|
-
implementationApproach,
|
|
621
|
-
phases,
|
|
622
|
-
diagrams,
|
|
623
|
-
testingStrategy,
|
|
624
|
-
references,
|
|
625
|
-
...(additionalSections.length > 0 ? { additionalSections } : {}),
|
|
626
|
-
};
|
|
627
|
-
return { plan, warnings: ctx.warnings };
|
|
628
|
-
}
|
|
629
|
-
// Export internals for testing
|
|
630
|
-
export const _internal = {
|
|
631
|
-
splitIntoSections,
|
|
632
|
-
tokensToMarkdown,
|
|
633
|
-
findSection,
|
|
634
|
-
collectSectionsUntilLevel,
|
|
635
|
-
parseKeyDiscoveries,
|
|
636
|
-
parseScopeExclusions,
|
|
637
|
-
parseChangesFromHeadings,
|
|
638
|
-
parseChangesFromList,
|
|
639
|
-
parseCriteria,
|
|
640
|
-
parsePhases,
|
|
641
|
-
parseTestingStrategy,
|
|
642
|
-
parseReferences,
|
|
643
|
-
tryMatchPhaseHeading,
|
|
644
|
-
extractFilePath,
|
|
645
|
-
createParseContext,
|
|
646
|
-
};
|