repoburg 1.0.55 → 1.0.57
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/backend/.env +1 -0
- package/backend/coverage/clover.xml +2409 -2355
- package/backend/coverage/coverage-final.json +99 -96
- package/backend/coverage/lcov-report/index.html +356 -341
- package/backend/coverage/lcov-report/src/action-execution/action-execution.module.ts.html +12 -12
- package/backend/coverage/lcov-report/src/action-execution/action-execution.service.ts.html +140 -62
- package/backend/coverage/lcov-report/src/action-execution/index.html +28 -28
- package/backend/coverage/lcov-report/src/ai-actions/ai-action-batch.service.ts.html +188 -188
- package/backend/coverage/lcov-report/src/ai-actions/ai-action-creation.service.ts.html +284 -236
- package/backend/coverage/lcov-report/src/ai-actions/ai-actions.controller.ts.html +109 -109
- package/backend/coverage/lcov-report/src/ai-actions/ai-actions.module.ts.html +28 -28
- package/backend/coverage/lcov-report/src/ai-actions/ai-actions.service.ts.html +193 -193
- package/backend/coverage/lcov-report/src/ai-actions/index.html +61 -61
- package/backend/coverage/lcov-report/src/app.controller.ts.html +24 -24
- package/backend/coverage/lcov-report/src/app.module.ts.html +68 -65
- package/backend/coverage/lcov-report/src/app.service.ts.html +46 -13
- package/backend/coverage/lcov-report/src/application-state/application-state.controller.ts.html +87 -33
- package/backend/coverage/lcov-report/src/application-state/application-state.module.ts.html +18 -18
- package/backend/coverage/lcov-report/src/application-state/application-state.service.ts.html +113 -68
- package/backend/coverage/lcov-report/src/application-state/dto/index.html +42 -27
- package/backend/coverage/lcov-report/src/application-state/dto/set-auto-context-fetch-enabled.dto.ts.html +12 -12
- package/backend/coverage/lcov-report/src/application-state/dto/set-orchestration-timeout.dto.ts.html +103 -0
- package/backend/coverage/lcov-report/src/application-state/dto/set-theme.dto.ts.html +12 -12
- package/backend/coverage/lcov-report/src/application-state/dto/set-websocket-enabled.dto.ts.html +12 -12
- package/backend/coverage/lcov-report/src/application-state/index.html +37 -37
- package/backend/coverage/lcov-report/src/context-generation/context-generation.module.ts.html +16 -16
- package/backend/coverage/lcov-report/src/context-generation/context-generation.service.ts.html +222 -222
- package/backend/coverage/lcov-report/src/context-generation/index.html +28 -28
- package/backend/coverage/lcov-report/src/context-snippets/context-snippets.controller.ts.html +31 -31
- package/backend/coverage/lcov-report/src/context-snippets/context-snippets.module.ts.html +20 -20
- package/backend/coverage/lcov-report/src/context-snippets/context-snippets.service.ts.html +26 -26
- package/backend/coverage/lcov-report/src/context-snippets/dto/context-snippet.dto.ts.html +28 -28
- package/backend/coverage/lcov-report/src/context-snippets/dto/index.html +13 -13
- package/backend/coverage/lcov-report/src/context-snippets/index.html +31 -31
- package/backend/coverage/lcov-report/src/context-templates/context-templates.controller.ts.html +45 -45
- package/backend/coverage/lcov-report/src/context-templates/context-templates.module.ts.html +20 -20
- package/backend/coverage/lcov-report/src/context-templates/context-templates.service.ts.html +87 -84
- package/backend/coverage/lcov-report/src/context-templates/dto/context-template.dto.ts.html +48 -48
- package/backend/coverage/lcov-report/src/context-templates/dto/index.html +13 -13
- package/backend/coverage/lcov-report/src/context-templates/index.html +36 -36
- package/backend/coverage/lcov-report/src/core-entities/ai-action.entity.ts.html +48 -48
- package/backend/coverage/lcov-report/src/core-entities/application-state.entity.ts.html +14 -14
- package/backend/coverage/lcov-report/src/core-entities/base.entity.ts.html +22 -22
- package/backend/coverage/lcov-report/src/core-entities/context-snippet.entity.ts.html +18 -18
- package/backend/coverage/lcov-report/src/core-entities/context-template.entity.ts.html +52 -52
- package/backend/coverage/lcov-report/src/core-entities/custom-snippet.entity.ts.html +20 -20
- package/backend/coverage/lcov-report/src/core-entities/execution-log.entity.ts.html +26 -26
- package/backend/coverage/lcov-report/src/core-entities/index.html +112 -112
- package/backend/coverage/lcov-report/src/core-entities/index.ts.html +28 -28
- package/backend/coverage/lcov-report/src/core-entities/project.entity.ts.html +24 -24
- package/backend/coverage/lcov-report/src/core-entities/session-input.entity.ts.html +59 -50
- package/backend/coverage/lcov-report/src/core-entities/session.entity.ts.html +56 -56
- package/backend/coverage/lcov-report/src/core-entities/system-prompt.entity.ts.html +28 -28
- package/backend/coverage/lcov-report/src/custom-snippets/custom-snippets.controller.ts.html +30 -30
- package/backend/coverage/lcov-report/src/custom-snippets/custom-snippets.module.ts.html +18 -18
- package/backend/coverage/lcov-report/src/custom-snippets/custom-snippets.service.ts.html +20 -20
- package/backend/coverage/lcov-report/src/custom-snippets/dto/custom-snippet.dto.ts.html +28 -28
- package/backend/coverage/lcov-report/src/custom-snippets/dto/index.html +13 -13
- package/backend/coverage/lcov-report/src/custom-snippets/index.html +32 -32
- package/backend/coverage/lcov-report/src/events/events.gateway.ts.html +46 -46
- package/backend/coverage/lcov-report/src/events/events.module.ts.html +12 -12
- package/backend/coverage/lcov-report/src/events/index.html +28 -28
- package/backend/coverage/lcov-report/src/execution-logs/dto/execution-log.dto.ts.html +1 -1
- package/backend/coverage/lcov-report/src/execution-logs/dto/index.html +1 -1
- package/backend/coverage/lcov-report/src/execution-logs/execution-logs.controller.ts.html +18 -18
- package/backend/coverage/lcov-report/src/execution-logs/execution-logs.module.ts.html +18 -18
- package/backend/coverage/lcov-report/src/execution-logs/execution-logs.service.ts.html +32 -32
- package/backend/coverage/lcov-report/src/execution-logs/index.html +33 -33
- package/backend/coverage/lcov-report/src/http-exception.filter.ts.html +55 -55
- package/backend/coverage/lcov-report/src/index.html +44 -44
- package/backend/coverage/lcov-report/src/llm-response-parser/dto/ai-action.dto.ts.html +67 -67
- package/backend/coverage/lcov-report/src/llm-response-parser/dto/index.html +21 -21
- package/backend/coverage/lcov-report/src/llm-response-parser/errors/index.html +17 -17
- package/backend/coverage/lcov-report/src/llm-response-parser/errors/parsing.error.ts.html +19 -19
- package/backend/coverage/lcov-report/src/llm-response-parser/index.html +35 -35
- package/backend/coverage/lcov-report/src/llm-response-parser/llm-response-parser.module.ts.html +12 -12
- package/backend/coverage/lcov-report/src/llm-response-parser/llm-response-parser.service.ts.html +208 -208
- package/backend/coverage/lcov-report/src/llm-response-parser/parsing.constants.ts.html +38 -38
- package/backend/coverage/lcov-report/src/llm-responses/dto/index.html +21 -21
- package/backend/coverage/lcov-report/src/llm-responses/dto/submit-llm-response.dto.ts.html +28 -28
- package/backend/coverage/lcov-report/src/llm-responses/index.html +38 -38
- package/backend/coverage/lcov-report/src/llm-responses/llm-responses.controller.ts.html +24 -24
- package/backend/coverage/lcov-report/src/llm-responses/llm-responses.module.ts.html +38 -35
- package/backend/coverage/lcov-report/src/llm-responses/llm-responses.service.ts.html +107 -86
- package/backend/coverage/lcov-report/src/main.ts.html +1 -1
- package/backend/coverage/lcov-report/src/orchestration/dto/index.html +13 -13
- package/backend/coverage/lcov-report/src/orchestration/dto/orchestration.dto.ts.html +30 -45
- package/backend/coverage/lcov-report/src/orchestration/index.html +74 -74
- package/backend/coverage/lcov-report/src/orchestration/orchestration-fs.service.ts.html +245 -128
- package/backend/coverage/lcov-report/src/orchestration/orchestration-parser.service.ts.html +32 -200
- package/backend/coverage/lcov-report/src/orchestration/orchestration.controller.ts.html +72 -102
- package/backend/coverage/lcov-report/src/orchestration/orchestration.module.ts.html +35 -38
- package/backend/coverage/lcov-report/src/orchestration/orchestration.service.ts.html +317 -425
- package/backend/coverage/lcov-report/src/orchestration/orchestration.types.ts.html +41 -35
- package/backend/coverage/lcov-report/src/projects/dto/index.html +13 -13
- package/backend/coverage/lcov-report/src/projects/dto/project.dto.ts.html +20 -20
- package/backend/coverage/lcov-report/src/projects/index.html +32 -32
- package/backend/coverage/lcov-report/src/projects/projects.controller.ts.html +28 -28
- package/backend/coverage/lcov-report/src/projects/projects.module.ts.html +18 -18
- package/backend/coverage/lcov-report/src/projects/projects.service.ts.html +20 -20
- package/backend/coverage/lcov-report/src/seeding/context-template-seeding.service.ts.html +22 -22
- package/backend/coverage/lcov-report/src/seeding/custom-snippet-seeding.service.ts.html +21 -21
- package/backend/coverage/lcov-report/src/seeding/data/context-templates/default-followup_ad-hoc-focused-context.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/context-templates/default-initial_condensed-project-context.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/context-templates/default-initial_full-project-context.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/context-templates/index.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/context-templates/pm-context.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/context-templates/pr-description.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/context-templates/sample_focused-tree.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/default_rglob.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/git-diff.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/index.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/rg-exclude.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/rg-search-glob.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/rg-search.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/run-command.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/tree.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/usr-adhoc-incl.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/custom-snippets/usr-input-incl.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/system-prompts/codebase-explorer.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/system-prompts/default_multi-file-action-generator-with-requester.ts.html +8 -2
- package/backend/coverage/lcov-report/src/seeding/data/system-prompts/index.html +3 -3
- package/backend/coverage/lcov-report/src/seeding/data/system-prompts/packup.ts.html +1 -1
- package/backend/coverage/lcov-report/src/seeding/data/system-prompts/refactor-split.ts.html +244 -0
- package/backend/coverage/lcov-report/src/seeding/index.html +47 -47
- package/backend/coverage/lcov-report/src/seeding/seeding.module.ts.html +24 -24
- package/backend/coverage/lcov-report/src/seeding/seeding.service.ts.html +27 -27
- package/backend/coverage/lcov-report/src/seeding/system-prompt-seeding.service.ts.html +21 -21
- package/backend/coverage/lcov-report/src/session-followup/index.html +28 -28
- package/backend/coverage/lcov-report/src/session-followup/session-followup.module.ts.html +22 -22
- package/backend/coverage/lcov-report/src/session-followup/session-followup.service.ts.html +44 -41
- package/backend/coverage/lcov-report/src/session-inputs/dto/index.html +13 -13
- package/backend/coverage/lcov-report/src/session-inputs/dto/session-input.dto.ts.html +40 -28
- package/backend/coverage/lcov-report/src/session-inputs/index.html +50 -50
- package/backend/coverage/lcov-report/src/session-inputs/session-input-context.service.ts.html +168 -156
- package/backend/coverage/lcov-report/src/session-inputs/session-inputs.controller.ts.html +36 -36
- package/backend/coverage/lcov-report/src/session-inputs/session-inputs.module.ts.html +40 -37
- package/backend/coverage/lcov-report/src/session-inputs/session-inputs.service.ts.html +242 -236
- package/backend/coverage/lcov-report/src/session-transfer/index.html +22 -22
- package/backend/coverage/lcov-report/src/session-transfer/session-transfer.module.ts.html +16 -16
- package/backend/coverage/lcov-report/src/session-transfer/session-transfer.service.ts.html +30 -30
- package/backend/coverage/lcov-report/src/sessions/dto/index.html +21 -21
- package/backend/coverage/lcov-report/src/sessions/dto/session.dto.ts.html +54 -54
- package/backend/coverage/lcov-report/src/sessions/index.html +39 -39
- package/backend/coverage/lcov-report/src/sessions/sessions.controller.ts.html +55 -55
- package/backend/coverage/lcov-report/src/sessions/sessions.module.ts.html +30 -30
- package/backend/coverage/lcov-report/src/sessions/sessions.service.ts.html +120 -120
- package/backend/coverage/lcov-report/src/system-prompts/dto/index.html +19 -19
- package/backend/coverage/lcov-report/src/system-prompts/dto/system-prompt.dto.ts.html +38 -29
- package/backend/coverage/lcov-report/src/system-prompts/index.html +37 -37
- package/backend/coverage/lcov-report/src/system-prompts/system-prompts.controller.ts.html +34 -34
- package/backend/coverage/lcov-report/src/system-prompts/system-prompts.module.ts.html +20 -20
- package/backend/coverage/lcov-report/src/system-prompts/system-prompts.service.ts.html +62 -62
- package/backend/coverage/lcov-report/src/timeout.interceptor.ts.html +1 -1
- package/backend/coverage/lcov-report/src/utils/fuzzy-search.ts.html +310 -0
- package/backend/coverage/lcov-report/src/utils/index.html +131 -0
- package/backend/coverage/lcov-report/src/utils/index.ts.html +88 -0
- package/backend/coverage/lcov-report/src/workspace/dto/index.html +13 -13
- package/backend/coverage/lcov-report/src/workspace/dto/search-workspace.dto.ts.html +24 -24
- package/backend/coverage/lcov-report/src/workspace/index.html +37 -37
- package/backend/coverage/lcov-report/src/workspace/workspace.controller.ts.html +26 -26
- package/backend/coverage/lcov-report/src/workspace/workspace.module.ts.html +16 -16
- package/backend/coverage/lcov-report/src/workspace/workspace.service.ts.html +259 -214
- package/backend/coverage/lcov.info +3284 -3186
- package/backend/dist/action-execution/action-execution.service.d.ts +2 -0
- package/backend/dist/action-execution/action-execution.service.js +31 -13
- package/backend/dist/action-execution/action-execution.service.js.map +1 -1
- package/backend/dist/context-generation/context-generation.service.d.ts +2 -2
- package/backend/dist/context-generation/context-generation.service.js.map +1 -1
- package/backend/dist/orchestration/orchestration.service.js +1 -0
- package/backend/dist/orchestration/orchestration.service.js.map +1 -1
- package/backend/dist/session-inputs/dto/session-input.dto.d.ts +1 -0
- package/backend/dist/session-inputs/dto/session-input.dto.js +5 -0
- package/backend/dist/session-inputs/dto/session-input.dto.js.map +1 -1
- package/backend/dist/session-inputs/session-input-context.service.js +4 -5
- package/backend/dist/session-inputs/session-input-context.service.js.map +1 -1
- package/backend/dist/session-inputs/session-inputs.service.js +2 -1
- package/backend/dist/session-inputs/session-inputs.service.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/backend/dist/utils/fuzzy-search.js +13 -4
- package/backend/dist/utils/fuzzy-search.js.map +1 -1
- package/backend/dist/workspace/workspace.service.d.ts +1 -0
- package/backend/dist/workspace/workspace.service.js +14 -3
- package/backend/dist/workspace/workspace.service.js.map +1 -1
- package/package.json +1 -1
- package/orchestration-test.txt +0 -3
package/backend/coverage/lcov-report/src/context-generation/context-generation.service.ts.html
CHANGED
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">61.58% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>101/164</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">44.44% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>20/45</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">73.68% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>14/19</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">61.87% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>99/160</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -484,41 +484,41 @@
|
|
|
484
484
|
<a name='L419'></a><a href='#L419'>419</a>
|
|
485
485
|
<a name='L420'></a><a href='#L420'>420</a>
|
|
486
486
|
<a name='L421'></a><a href='#L421'>421</a>
|
|
487
|
-
<a name='L422'></a><a href='#L422'>422</a></td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
487
|
+
<a name='L422'></a><a href='#L422'>422</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">11x</span>
|
|
488
488
|
<span class="cline-any cline-neutral"> </span>
|
|
489
489
|
<span class="cline-any cline-neutral"> </span>
|
|
490
490
|
<span class="cline-any cline-neutral"> </span>
|
|
491
491
|
<span class="cline-any cline-neutral"> </span>
|
|
492
492
|
<span class="cline-any cline-neutral"> </span>
|
|
493
|
-
<span class="cline-any cline-
|
|
494
|
-
<span class="cline-any cline-
|
|
495
|
-
<span class="cline-any cline-
|
|
496
|
-
<span class="cline-any cline-
|
|
497
|
-
<span class="cline-any cline-
|
|
498
|
-
<span class="cline-any cline-
|
|
499
|
-
<span class="cline-any cline-
|
|
500
|
-
<span class="cline-any cline-
|
|
501
|
-
<span class="cline-any cline-
|
|
493
|
+
<span class="cline-any cline-yes">11x</span>
|
|
494
|
+
<span class="cline-any cline-yes">11x</span>
|
|
495
|
+
<span class="cline-any cline-yes">11x</span>
|
|
496
|
+
<span class="cline-any cline-yes">11x</span>
|
|
497
|
+
<span class="cline-any cline-yes">11x</span>
|
|
498
|
+
<span class="cline-any cline-yes">11x</span>
|
|
499
|
+
<span class="cline-any cline-yes">11x</span>
|
|
500
|
+
<span class="cline-any cline-yes">11x</span>
|
|
501
|
+
<span class="cline-any cline-yes">11x</span>
|
|
502
502
|
<span class="cline-any cline-neutral"> </span>
|
|
503
503
|
<span class="cline-any cline-neutral"> </span>
|
|
504
|
-
<span class="cline-any cline-
|
|
505
|
-
<span class="cline-any cline-
|
|
504
|
+
<span class="cline-any cline-yes">11x</span>
|
|
505
|
+
<span class="cline-any cline-yes">22x</span>
|
|
506
506
|
<span class="cline-any cline-neutral"> </span>
|
|
507
|
-
<span class="cline-any cline-
|
|
507
|
+
<span class="cline-any cline-yes">22x</span>
|
|
508
508
|
<span class="cline-any cline-neutral"> </span>
|
|
509
509
|
<span class="cline-any cline-neutral"> </span>
|
|
510
|
-
<span class="cline-any cline-
|
|
510
|
+
<span class="cline-any cline-yes">22x</span>
|
|
511
511
|
<span class="cline-any cline-neutral"> </span>
|
|
512
512
|
<span class="cline-any cline-neutral"> </span>
|
|
513
513
|
<span class="cline-any cline-neutral"> </span>
|
|
514
|
-
<span class="cline-any cline-
|
|
514
|
+
<span class="cline-any cline-yes">22x</span>
|
|
515
515
|
<span class="cline-any cline-neutral"> </span>
|
|
516
|
-
<span class="cline-any cline-
|
|
516
|
+
<span class="cline-any cline-yes">22x</span>
|
|
517
517
|
<span class="cline-any cline-neutral"> </span>
|
|
518
518
|
<span class="cline-any cline-neutral"> </span>
|
|
519
519
|
<span class="cline-any cline-neutral"> </span>
|
|
520
520
|
<span class="cline-any cline-neutral"> </span>
|
|
521
|
-
<span class="cline-any cline-
|
|
521
|
+
<span class="cline-any cline-yes">22x</span>
|
|
522
522
|
<span class="cline-any cline-neutral"> </span>
|
|
523
523
|
<span class="cline-any cline-neutral"> </span>
|
|
524
524
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -535,17 +535,17 @@
|
|
|
535
535
|
<span class="cline-any cline-neutral"> </span>
|
|
536
536
|
<span class="cline-any cline-neutral"> </span>
|
|
537
537
|
<span class="cline-any cline-neutral"> </span>
|
|
538
|
-
<span class="cline-any cline-
|
|
539
|
-
<span class="cline-any cline-
|
|
540
|
-
<span class="cline-any cline-
|
|
538
|
+
<span class="cline-any cline-yes">6x</span>
|
|
539
|
+
<span class="cline-any cline-yes">6x</span>
|
|
540
|
+
<span class="cline-any cline-yes">6x</span>
|
|
541
541
|
<span class="cline-any cline-neutral"> </span>
|
|
542
542
|
<span class="cline-any cline-neutral"> </span>
|
|
543
|
-
<span class="cline-any cline-
|
|
544
|
-
<span class="cline-any cline-
|
|
545
|
-
<span class="cline-any cline-
|
|
546
|
-
<span class="cline-any cline-
|
|
543
|
+
<span class="cline-any cline-yes">3x</span>
|
|
544
|
+
<span class="cline-any cline-yes">3x</span>
|
|
545
|
+
<span class="cline-any cline-yes">3x</span>
|
|
546
|
+
<span class="cline-any cline-yes">3x</span>
|
|
547
547
|
<span class="cline-any cline-neutral"> </span>
|
|
548
|
-
<span class="cline-any cline-
|
|
548
|
+
<span class="cline-any cline-yes">3x</span>
|
|
549
549
|
<span class="cline-any cline-neutral"> </span>
|
|
550
550
|
<span class="cline-any cline-neutral"> </span>
|
|
551
551
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -557,28 +557,28 @@
|
|
|
557
557
|
<span class="cline-any cline-neutral"> </span>
|
|
558
558
|
<span class="cline-any cline-neutral"> </span>
|
|
559
559
|
<span class="cline-any cline-neutral"> </span>
|
|
560
|
-
<span class="cline-any cline-
|
|
560
|
+
<span class="cline-any cline-yes">5x</span>
|
|
561
561
|
<span class="cline-any cline-neutral"> </span>
|
|
562
562
|
<span class="cline-any cline-neutral"> </span>
|
|
563
563
|
<span class="cline-any cline-neutral"> </span>
|
|
564
|
-
<span class="cline-any cline-
|
|
564
|
+
<span class="cline-any cline-yes">5x</span>
|
|
565
565
|
<span class="cline-any cline-neutral"> </span>
|
|
566
566
|
<span class="cline-any cline-neutral"> </span>
|
|
567
567
|
<span class="cline-any cline-neutral"> </span>
|
|
568
|
-
<span class="cline-any cline-
|
|
568
|
+
<span class="cline-any cline-yes">5x</span>
|
|
569
569
|
<span class="cline-any cline-neutral"> </span>
|
|
570
|
-
<span class="cline-any cline-
|
|
571
|
-
<span class="cline-any cline-
|
|
570
|
+
<span class="cline-any cline-yes">5x</span>
|
|
571
|
+
<span class="cline-any cline-yes">5x</span>
|
|
572
572
|
<span class="cline-any cline-no"> </span>
|
|
573
573
|
<span class="cline-any cline-neutral"> </span>
|
|
574
574
|
<span class="cline-any cline-neutral"> </span>
|
|
575
575
|
<span class="cline-any cline-neutral"> </span>
|
|
576
576
|
<span class="cline-any cline-no"> </span>
|
|
577
577
|
<span class="cline-any cline-neutral"> </span>
|
|
578
|
-
<span class="cline-any cline-
|
|
578
|
+
<span class="cline-any cline-yes">5x</span>
|
|
579
579
|
<span class="cline-any cline-neutral"> </span>
|
|
580
580
|
<span class="cline-any cline-neutral"> </span>
|
|
581
|
-
<span class="cline-any cline-
|
|
581
|
+
<span class="cline-any cline-yes">5x</span>
|
|
582
582
|
<span class="cline-any cline-neutral"> </span>
|
|
583
583
|
<span class="cline-any cline-neutral"> </span>
|
|
584
584
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -589,33 +589,33 @@
|
|
|
589
589
|
<span class="cline-any cline-neutral"> </span>
|
|
590
590
|
<span class="cline-any cline-neutral"> </span>
|
|
591
591
|
<span class="cline-any cline-neutral"> </span>
|
|
592
|
-
<span class="cline-any cline-
|
|
593
|
-
<span class="cline-any cline-
|
|
592
|
+
<span class="cline-any cline-yes">4x</span>
|
|
593
|
+
<span class="cline-any cline-yes">4x</span>
|
|
594
594
|
<span class="cline-any cline-no"> </span>
|
|
595
595
|
<span class="cline-any cline-neutral"> </span>
|
|
596
596
|
<span class="cline-any cline-neutral"> </span>
|
|
597
597
|
<span class="cline-any cline-neutral"> </span>
|
|
598
|
-
<span class="cline-any cline-
|
|
598
|
+
<span class="cline-any cline-yes">4x</span>
|
|
599
599
|
<span class="cline-any cline-neutral"> </span>
|
|
600
|
-
<span class="cline-any cline-
|
|
601
|
-
<span class="cline-any cline-
|
|
602
|
-
<span class="cline-any cline-
|
|
600
|
+
<span class="cline-any cline-yes">4x</span>
|
|
601
|
+
<span class="cline-any cline-yes">1x</span>
|
|
602
|
+
<span class="cline-any cline-yes">1x</span>
|
|
603
603
|
<span class="cline-any cline-neutral"> </span>
|
|
604
604
|
<span class="cline-any cline-neutral"> </span>
|
|
605
605
|
<span class="cline-any cline-neutral"> </span>
|
|
606
|
-
<span class="cline-any cline-
|
|
606
|
+
<span class="cline-any cline-yes">3x</span>
|
|
607
607
|
<span class="cline-any cline-neutral"> </span>
|
|
608
608
|
<span class="cline-any cline-neutral"> </span>
|
|
609
609
|
<span class="cline-any cline-neutral"> </span>
|
|
610
|
-
<span class="cline-any cline-
|
|
611
|
-
<span class="cline-any cline-
|
|
612
|
-
<span class="cline-any cline-
|
|
613
|
-
<span class="cline-any cline-
|
|
610
|
+
<span class="cline-any cline-yes">4x</span>
|
|
611
|
+
<span class="cline-any cline-yes">3x</span>
|
|
612
|
+
<span class="cline-any cline-yes">3x</span>
|
|
613
|
+
<span class="cline-any cline-yes">2x</span>
|
|
614
614
|
<span class="cline-any cline-neutral"> </span>
|
|
615
|
-
<span class="cline-any cline-
|
|
616
|
-
<span class="cline-any cline-
|
|
615
|
+
<span class="cline-any cline-yes">1x</span>
|
|
616
|
+
<span class="cline-any cline-yes">1x</span>
|
|
617
617
|
<span class="cline-any cline-neutral"> </span>
|
|
618
|
-
<span class="cline-any cline-
|
|
618
|
+
<span class="cline-any cline-yes">1x</span>
|
|
619
619
|
<span class="cline-any cline-neutral"> </span>
|
|
620
620
|
<span class="cline-any cline-no"> </span>
|
|
621
621
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -661,19 +661,19 @@
|
|
|
661
661
|
<span class="cline-any cline-neutral"> </span>
|
|
662
662
|
<span class="cline-any cline-neutral"> </span>
|
|
663
663
|
<span class="cline-any cline-neutral"> </span>
|
|
664
|
-
<span class="cline-any cline-
|
|
665
|
-
<span class="cline-any cline-
|
|
664
|
+
<span class="cline-any cline-yes">2x</span>
|
|
665
|
+
<span class="cline-any cline-yes">1x</span>
|
|
666
666
|
<span class="cline-any cline-neutral"> </span>
|
|
667
667
|
<span class="cline-any cline-neutral"> </span>
|
|
668
668
|
<span class="cline-any cline-neutral"> </span>
|
|
669
669
|
<span class="cline-any cline-neutral"> </span>
|
|
670
|
-
<span class="cline-any cline-
|
|
671
|
-
<span class="cline-any cline-
|
|
670
|
+
<span class="cline-any cline-yes">1x</span>
|
|
671
|
+
<span class="cline-any cline-yes">1x</span>
|
|
672
672
|
<span class="cline-any cline-neutral"> </span>
|
|
673
673
|
<span class="cline-any cline-neutral"> </span>
|
|
674
674
|
<span class="cline-any cline-neutral"> </span>
|
|
675
675
|
<span class="cline-any cline-neutral"> </span>
|
|
676
|
-
<span class="cline-any cline-
|
|
676
|
+
<span class="cline-any cline-yes">1x</span>
|
|
677
677
|
<span class="cline-any cline-neutral"> </span>
|
|
678
678
|
<span class="cline-any cline-no"> </span>
|
|
679
679
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -683,26 +683,26 @@
|
|
|
683
683
|
<span class="cline-any cline-neutral"> </span>
|
|
684
684
|
<span class="cline-any cline-neutral"> </span>
|
|
685
685
|
<span class="cline-any cline-neutral"> </span>
|
|
686
|
-
<span class="cline-any cline-
|
|
687
|
-
<span class="cline-any cline-
|
|
688
|
-
<span class="cline-any cline-
|
|
689
|
-
<span class="cline-any cline-
|
|
690
|
-
<span class="cline-any cline-
|
|
686
|
+
<span class="cline-any cline-yes">3x</span>
|
|
687
|
+
<span class="cline-any cline-yes">3x</span>
|
|
688
|
+
<span class="cline-any cline-yes">3x</span>
|
|
689
|
+
<span class="cline-any cline-yes">3x</span>
|
|
690
|
+
<span class="cline-any cline-yes">3x</span>
|
|
691
691
|
<span class="cline-any cline-neutral"> </span>
|
|
692
692
|
<span class="cline-any cline-neutral"> </span>
|
|
693
693
|
<span class="cline-any cline-neutral"> </span>
|
|
694
694
|
<span class="cline-any cline-neutral"> </span>
|
|
695
|
-
<span class="cline-any cline-
|
|
695
|
+
<span class="cline-any cline-yes">1x</span>
|
|
696
696
|
<span class="cline-any cline-neutral"> </span>
|
|
697
|
-
<span class="cline-any cline-
|
|
698
|
-
<span class="cline-any cline-
|
|
699
|
-
<span class="cline-any cline-
|
|
697
|
+
<span class="cline-any cline-yes">2x</span>
|
|
698
|
+
<span class="cline-any cline-yes">1x</span>
|
|
699
|
+
<span class="cline-any cline-yes">1x</span>
|
|
700
700
|
<span class="cline-any cline-neutral"> </span>
|
|
701
|
-
<span class="cline-any cline-
|
|
702
|
-
<span class="cline-any cline-
|
|
701
|
+
<span class="cline-any cline-yes">1x</span>
|
|
702
|
+
<span class="cline-any cline-yes">1x</span>
|
|
703
703
|
<span class="cline-any cline-neutral"> </span>
|
|
704
704
|
<span class="cline-any cline-neutral"> </span>
|
|
705
|
-
<span class="cline-any cline-
|
|
705
|
+
<span class="cline-any cline-yes">1x</span>
|
|
706
706
|
<span class="cline-any cline-neutral"> </span>
|
|
707
707
|
<span class="cline-any cline-no"> </span>
|
|
708
708
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -713,24 +713,24 @@
|
|
|
713
713
|
<span class="cline-any cline-neutral"> </span>
|
|
714
714
|
<span class="cline-any cline-neutral"> </span>
|
|
715
715
|
<span class="cline-any cline-neutral"> </span>
|
|
716
|
-
<span class="cline-any cline-
|
|
717
|
-
<span class="cline-any cline-
|
|
718
|
-
<span class="cline-any cline-
|
|
719
|
-
<span class="cline-any cline-
|
|
720
|
-
<span class="cline-any cline-
|
|
716
|
+
<span class="cline-any cline-yes">2x</span>
|
|
717
|
+
<span class="cline-any cline-yes">2x</span>
|
|
718
|
+
<span class="cline-any cline-yes">2x</span>
|
|
719
|
+
<span class="cline-any cline-yes">2x</span>
|
|
720
|
+
<span class="cline-any cline-yes">2x</span>
|
|
721
721
|
<span class="cline-any cline-neutral"> </span>
|
|
722
722
|
<span class="cline-any cline-neutral"> </span>
|
|
723
723
|
<span class="cline-any cline-neutral"> </span>
|
|
724
724
|
<span class="cline-any cline-neutral"> </span>
|
|
725
|
-
<span class="cline-any cline-
|
|
725
|
+
<span class="cline-any cline-yes">1x</span>
|
|
726
726
|
<span class="cline-any cline-neutral"> </span>
|
|
727
|
-
<span class="cline-any cline-
|
|
727
|
+
<span class="cline-any cline-yes">1x</span>
|
|
728
728
|
<span class="cline-any cline-no"> </span>
|
|
729
729
|
<span class="cline-any cline-no"> </span>
|
|
730
730
|
<span class="cline-any cline-neutral"> </span>
|
|
731
|
-
<span class="cline-any cline-
|
|
731
|
+
<span class="cline-any cline-yes">1x</span>
|
|
732
732
|
<span class="cline-any cline-neutral"> </span>
|
|
733
|
-
<span class="cline-any cline-
|
|
733
|
+
<span class="cline-any cline-yes">1x</span>
|
|
734
734
|
<span class="cline-any cline-neutral"> </span>
|
|
735
735
|
<span class="cline-any cline-no"> </span>
|
|
736
736
|
<span class="cline-any cline-no"> </span>
|
|
@@ -749,21 +749,21 @@
|
|
|
749
749
|
<span class="cline-any cline-neutral"> </span>
|
|
750
750
|
<span class="cline-any cline-neutral"> </span>
|
|
751
751
|
<span class="cline-any cline-neutral"> </span>
|
|
752
|
-
<span class="cline-any cline-
|
|
752
|
+
<span class="cline-any cline-yes">1x</span>
|
|
753
753
|
<span class="cline-any cline-no"> </span>
|
|
754
754
|
<span class="cline-any cline-neutral"> </span>
|
|
755
755
|
<span class="cline-any cline-neutral"> </span>
|
|
756
756
|
<span class="cline-any cline-no"> </span>
|
|
757
757
|
<span class="cline-any cline-neutral"> </span>
|
|
758
|
-
<span class="cline-any cline-
|
|
759
|
-
<span class="cline-any cline-
|
|
760
|
-
<span class="cline-any cline-
|
|
761
|
-
<span class="cline-any cline-
|
|
758
|
+
<span class="cline-any cline-yes">1x</span>
|
|
759
|
+
<span class="cline-any cline-yes">1x</span>
|
|
760
|
+
<span class="cline-any cline-yes">1x</span>
|
|
761
|
+
<span class="cline-any cline-yes">1x</span>
|
|
762
762
|
<span class="cline-any cline-neutral"> </span>
|
|
763
763
|
<span class="cline-any cline-neutral"> </span>
|
|
764
764
|
<span class="cline-any cline-neutral"> </span>
|
|
765
765
|
<span class="cline-any cline-neutral"> </span>
|
|
766
|
-
<span class="cline-any cline-
|
|
766
|
+
<span class="cline-any cline-yes">1x</span>
|
|
767
767
|
<span class="cline-any cline-neutral"> </span>
|
|
768
768
|
<span class="cline-any cline-no"> </span>
|
|
769
769
|
<span class="cline-any cline-no"> </span>
|
|
@@ -823,29 +823,29 @@
|
|
|
823
823
|
<span class="cline-any cline-neutral"> </span>
|
|
824
824
|
<span class="cline-any cline-neutral"> </span>
|
|
825
825
|
<span class="cline-any cline-neutral"> </span>
|
|
826
|
-
<span class="cline-any cline-
|
|
827
|
-
<span class="cline-any cline-
|
|
826
|
+
<span class="cline-any cline-yes">3x</span>
|
|
827
|
+
<span class="cline-any cline-yes">1x</span>
|
|
828
828
|
<span class="cline-any cline-neutral"> </span>
|
|
829
829
|
<span class="cline-any cline-neutral"> </span>
|
|
830
|
-
<span class="cline-any cline-
|
|
830
|
+
<span class="cline-any cline-yes">1x</span>
|
|
831
831
|
<span class="cline-any cline-neutral"> </span>
|
|
832
832
|
<span class="cline-any cline-neutral"> </span>
|
|
833
|
-
<span class="cline-any cline-
|
|
833
|
+
<span class="cline-any cline-yes">2x</span>
|
|
834
834
|
<span class="cline-any cline-neutral"> </span>
|
|
835
|
-
<span class="cline-any cline-
|
|
836
|
-
<span class="cline-any cline-
|
|
835
|
+
<span class="cline-any cline-yes">2x</span>
|
|
836
|
+
<span class="cline-any cline-yes">2x</span>
|
|
837
837
|
<span class="cline-any cline-neutral"> </span>
|
|
838
838
|
<span class="cline-any cline-neutral"> </span>
|
|
839
|
-
<span class="cline-any cline-
|
|
839
|
+
<span class="cline-any cline-yes">2x</span>
|
|
840
840
|
<span class="cline-any cline-neutral"> </span>
|
|
841
841
|
<span class="cline-any cline-neutral"> </span>
|
|
842
842
|
<span class="cline-any cline-neutral"> </span>
|
|
843
|
-
<span class="cline-any cline-
|
|
843
|
+
<span class="cline-any cline-yes">2x</span>
|
|
844
844
|
<span class="cline-any cline-neutral"> </span>
|
|
845
845
|
<span class="cline-any cline-no"> </span>
|
|
846
846
|
<span class="cline-any cline-neutral"> </span>
|
|
847
847
|
<span class="cline-any cline-neutral"> </span>
|
|
848
|
-
<span class="cline-any cline-
|
|
848
|
+
<span class="cline-any cline-yes">2x</span>
|
|
849
849
|
<span class="cline-any cline-no"> </span>
|
|
850
850
|
<span class="cline-any cline-neutral"> </span>
|
|
851
851
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -853,18 +853,18 @@
|
|
|
853
853
|
<span class="cline-any cline-neutral"> </span>
|
|
854
854
|
<span class="cline-any cline-neutral"> </span>
|
|
855
855
|
<span class="cline-any cline-neutral"> </span>
|
|
856
|
-
<span class="cline-any cline-
|
|
856
|
+
<span class="cline-any cline-yes">2x</span>
|
|
857
857
|
<span class="cline-any cline-neutral"> </span>
|
|
858
858
|
<span class="cline-any cline-neutral"> </span>
|
|
859
|
-
<span class="cline-any cline-
|
|
859
|
+
<span class="cline-any cline-yes">2x</span>
|
|
860
860
|
<span class="cline-any cline-neutral"> </span>
|
|
861
861
|
<span class="cline-any cline-neutral"> </span>
|
|
862
862
|
<span class="cline-any cline-neutral"> </span>
|
|
863
863
|
<span class="cline-any cline-neutral"> </span>
|
|
864
864
|
<span class="cline-any cline-neutral"> </span>
|
|
865
|
-
<span class="cline-any cline-
|
|
865
|
+
<span class="cline-any cline-yes">2x</span>
|
|
866
866
|
<span class="cline-any cline-neutral"> </span>
|
|
867
|
-
<span class="cline-any cline-
|
|
867
|
+
<span class="cline-any cline-yes">2x</span>
|
|
868
868
|
<span class="cline-any cline-neutral"> </span>
|
|
869
869
|
<span class="cline-any cline-neutral"> </span>
|
|
870
870
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -877,8 +877,8 @@
|
|
|
877
877
|
<span class="cline-any cline-neutral"> </span>
|
|
878
878
|
<span class="cline-any cline-neutral"> </span>
|
|
879
879
|
<span class="cline-any cline-neutral"> </span>
|
|
880
|
-
<span class="cline-any cline-
|
|
881
|
-
<span class="cline-any cline-
|
|
880
|
+
<span class="cline-any cline-yes">18x</span>
|
|
881
|
+
<span class="cline-any cline-yes">18x</span>
|
|
882
882
|
<span class="cline-any cline-neutral"> </span>
|
|
883
883
|
<span class="cline-any cline-neutral"> </span>
|
|
884
884
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -888,58 +888,58 @@
|
|
|
888
888
|
<span class="cline-any cline-neutral"> </span>
|
|
889
889
|
<span class="cline-any cline-neutral"> </span>
|
|
890
890
|
<span class="cline-any cline-neutral"> </span>
|
|
891
|
-
<span class="cline-any cline-
|
|
892
|
-
<span class="cline-any cline-
|
|
891
|
+
<span class="cline-any cline-yes">18x</span>
|
|
892
|
+
<span class="cline-any cline-yes">3x</span>
|
|
893
893
|
<span class="cline-any cline-neutral"> </span>
|
|
894
|
-
<span class="cline-any cline-
|
|
894
|
+
<span class="cline-any cline-yes">18x</span>
|
|
895
895
|
<span class="cline-any cline-neutral"> </span>
|
|
896
896
|
<span class="cline-any cline-neutral"> </span>
|
|
897
897
|
<span class="cline-any cline-neutral"> </span>
|
|
898
|
-
<span class="cline-any cline-
|
|
898
|
+
<span class="cline-any cline-yes">17x</span>
|
|
899
899
|
<span class="cline-any cline-neutral"> </span>
|
|
900
|
-
<span class="cline-any cline-
|
|
900
|
+
<span class="cline-any cline-yes">1x</span>
|
|
901
901
|
<span class="cline-any cline-neutral"> </span>
|
|
902
902
|
<span class="cline-any cline-neutral"> </span>
|
|
903
903
|
<span class="cline-any cline-neutral"> </span>
|
|
904
|
-
<span class="cline-any cline-
|
|
904
|
+
<span class="cline-any cline-yes">1x</span>
|
|
905
905
|
<span class="cline-any cline-neutral"> </span>
|
|
906
906
|
<span class="cline-any cline-neutral"> </span>
|
|
907
907
|
<span class="cline-any cline-neutral"> </span>
|
|
908
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"
|
|
908
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
|
909
909
|
Injectable,
|
|
910
910
|
Logger,
|
|
911
911
|
BadRequestException,
|
|
912
912
|
NotFoundException,
|
|
913
913
|
} from '@nestjs/common';
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
914
|
+
import { Eta } from 'eta';
|
|
915
|
+
import * as fs from 'fs/promises';
|
|
916
|
+
import { glob } from 'glob';
|
|
917
|
+
import * as path from 'path';
|
|
918
|
+
import { exec, ExecOptions } from 'child_process';
|
|
919
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
920
|
+
import { ContextTemplate } from '../core-entities';
|
|
921
|
+
import { Repository } from 'typeorm';
|
|
922
|
+
import { TemplateType } from '../core-entities/context-template.entity';
|
|
923
923
|
|
|
924
924
|
@Injectable()
|
|
925
|
-
export class
|
|
926
|
-
private readonly
|
|
925
|
+
export class ContextGenerationService {
|
|
926
|
+
private readonly logger = new Logger(ContextGenerationService.name);
|
|
927
927
|
private eta: Eta;
|
|
928
|
-
private
|
|
928
|
+
private projectRoot: string =
|
|
929
929
|
process.env.REPOBURG_PROJECT_PATH || process.cwd();
|
|
930
930
|
private templateHelpers: { [key: string]: (...args: any[]) => Promise<any> };
|
|
931
|
-
private
|
|
931
|
+
private partialCache = new Map<string, ContextTemplate | null>();
|
|
932
932
|
|
|
933
|
-
|
|
933
|
+
constructor(
|
|
934
934
|
@InjectRepository(ContextTemplate)
|
|
935
|
-
private
|
|
935
|
+
private contextTemplatesRepository: Repository<ContextTemplate>,
|
|
936
936
|
) {
|
|
937
|
-
|
|
937
|
+
this.eta = new Eta({
|
|
938
938
|
views: this.projectRoot, // Using 'views' path as a security measure for includes/layouts
|
|
939
939
|
useWith: true, // Allows using properties of data object as local variables
|
|
940
940
|
});
|
|
941
941
|
|
|
942
|
-
|
|
942
|
+
this.templateHelpers = {
|
|
943
943
|
readFile: this.secureReadFile.bind(this),
|
|
944
944
|
readDir: this.secureReadDir.bind(this),
|
|
945
945
|
glob: this.secureGlob.bind(this),
|
|
@@ -952,21 +952,21 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
952
952
|
};
|
|
953
953
|
}
|
|
954
954
|
|
|
955
|
-
private
|
|
955
|
+
private execPromise(
|
|
956
956
|
command: string,
|
|
957
957
|
options: ExecOptions,
|
|
958
958
|
): Promise<{ stdout: string; stderr: string }> {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
959
|
+
return new Promise((resolve, reject) => {
|
|
960
|
+
exec(command, options, (error, stdout, stderr) => {
|
|
961
|
+
if (error) {
|
|
962
962
|
// Attach stdout and stderr to the error object for more context in catch block.
|
|
963
963
|
// This mirrors the behavior of the promisified exec.
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
964
|
+
error['stdout'] = stdout;
|
|
965
|
+
error['stderr'] = stderr;
|
|
966
|
+
reject(error);
|
|
967
|
+
return;
|
|
968
968
|
}
|
|
969
|
-
|
|
969
|
+
resolve({ stdout, stderr });
|
|
970
970
|
});
|
|
971
971
|
});
|
|
972
972
|
}
|
|
@@ -976,30 +976,30 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
976
976
|
* Tries to find the executable in the local `bin` directory first.
|
|
977
977
|
* The path is resolved relative to this file's location, which works for both `src` and `dist`.
|
|
978
978
|
*/
|
|
979
|
-
|
|
979
|
+
public async getCommandPath(commandName: string): Promise<string> {
|
|
980
980
|
// Check if running from the compiled 'dist' directory
|
|
981
|
-
const inDist =
|
|
981
|
+
const inDist = __dirname.includes(path.join('backend', 'dist'));
|
|
982
982
|
|
|
983
983
|
// In 'dist', bin is a sibling: `dist/context-generation` -> `dist/bin`
|
|
984
984
|
// In 'src', bin is in the parent: `src/context-generation` -> `../bin`
|
|
985
|
-
const relativePath =
|
|
986
|
-
? path.join(__dirname, '..', 'bin', commandName)
|
|
985
|
+
const relativePath = inDist
|
|
986
|
+
? <span class="branch-0 cbranch-no" title="branch not covered" >path.join(__dirname, '..', 'bin', commandName)</span>
|
|
987
987
|
: path.join(__dirname, '..', '..', 'src', 'bin', commandName);
|
|
988
988
|
|
|
989
|
-
const bundledPath =
|
|
989
|
+
const bundledPath = path.resolve(relativePath);
|
|
990
990
|
|
|
991
|
-
|
|
992
|
-
|
|
991
|
+
try {
|
|
992
|
+
await fs.access(bundledPath, fs.constants.X_OK);
|
|
993
993
|
<span class="cstat-no" title="statement not covered" > this.logger.log(</span>
|
|
994
994
|
`Using bundled executable for '${commandName}' at: ${bundledPath}`,
|
|
995
995
|
);
|
|
996
996
|
// Return the absolute, quoted path to be safe.
|
|
997
997
|
<span class="cstat-no" title="statement not covered" > return `'${bundledPath}'`;</span>
|
|
998
998
|
} catch (error) {
|
|
999
|
-
|
|
999
|
+
this.logger.warn(
|
|
1000
1000
|
`Bundled executable for '${commandName}' not found or not executable at '${bundledPath}'. Falling back to system PATH.`,
|
|
1001
1001
|
);
|
|
1002
|
-
|
|
1002
|
+
return commandName; // Fallback to system command
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
@@ -1009,34 +1009,34 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1009
1009
|
* @returns A validated, absolute path.
|
|
1010
1010
|
* @throws BadRequestException if path traversal is detected.
|
|
1011
1011
|
*/
|
|
1012
|
-
private
|
|
1013
|
-
const normalizedPath =
|
|
1014
|
-
|
|
1012
|
+
private resolveAndValidatePath(unsafePath: string): string {
|
|
1013
|
+
const normalizedPath = path.normalize(unsafePath);
|
|
1014
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (path.isAbsolute(normalizedPath)) {
|
|
1015
1015
|
<span class="cstat-no" title="statement not covered" > throw new BadRequestException(</span>
|
|
1016
1016
|
`Absolute paths are not allowed: ${unsafePath}`,
|
|
1017
1017
|
);
|
|
1018
1018
|
}
|
|
1019
|
-
const resolvedPath =
|
|
1019
|
+
const resolvedPath = path.resolve(this.projectRoot, normalizedPath);
|
|
1020
1020
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1021
|
+
if (!resolvedPath.startsWith(this.projectRoot)) {
|
|
1022
|
+
this.logger.warn(`Path traversal attempt detected: ${unsafePath}`);
|
|
1023
|
+
throw new BadRequestException(
|
|
1024
1024
|
`Path traversal is not allowed. Access denied for path: ${unsafePath}`,
|
|
1025
1025
|
);
|
|
1026
1026
|
}
|
|
1027
|
-
|
|
1027
|
+
return resolvedPath;
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
-
public
|
|
1031
|
-
const safePath =
|
|
1032
|
-
|
|
1033
|
-
const content =
|
|
1034
|
-
|
|
1030
|
+
public async secureReadFile(filePath: string): Promise<string> {
|
|
1031
|
+
const safePath = this.resolveAndValidatePath(filePath);
|
|
1032
|
+
try {
|
|
1033
|
+
const content = await fs.readFile(safePath, 'utf8');
|
|
1034
|
+
return `// File: ${filePath}\n\`\`\`\n${content}\n\`\`\``;
|
|
1035
1035
|
} catch (error) {
|
|
1036
|
-
|
|
1037
|
-
|
|
1036
|
+
if (error.code === 'ENOENT') {
|
|
1037
|
+
this.logger.warn(`File not found in template render: ${safePath}`);
|
|
1038
1038
|
// Return a user-friendly error message within the template
|
|
1039
|
-
|
|
1039
|
+
return `Error: File not found at '${filePath}'`;
|
|
1040
1040
|
}
|
|
1041
1041
|
<span class="cstat-no" title="statement not covered" > this.logger.error(`Error reading file ${safePath}: ${error.message}`);</span>
|
|
1042
1042
|
// Re-throwing will cause template rendering to fail, which is appropriate here.
|
|
@@ -1081,20 +1081,20 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
|
-
public
|
|
1085
|
-
|
|
1086
|
-
|
|
1084
|
+
public async secureGlob(pattern: string): Promise<string[]> {
|
|
1085
|
+
if (path.isAbsolute(pattern)) {
|
|
1086
|
+
throw new BadRequestException(
|
|
1087
1087
|
`Absolute paths are not allowed in glob patterns: ${pattern}`,
|
|
1088
1088
|
);
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
|
-
|
|
1092
|
-
const files: string[] =
|
|
1091
|
+
try {
|
|
1092
|
+
const files: string[] = await glob(pattern, {
|
|
1093
1093
|
cwd: this.projectRoot,
|
|
1094
1094
|
nodir: true, // we only want files
|
|
1095
1095
|
absolute: false, // return paths relative to cwd
|
|
1096
1096
|
});
|
|
1097
|
-
|
|
1097
|
+
return files;
|
|
1098
1098
|
} catch (error) {
|
|
1099
1099
|
<span class="cstat-no" title="statement not covered" > this.logger.error(</span>
|
|
1100
1100
|
`Error resolving glob pattern "${pattern}": ${error.message}`,
|
|
@@ -1103,27 +1103,27 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
1105
|
|
|
1106
|
-
public
|
|
1107
|
-
const treeCommand =
|
|
1108
|
-
const command =
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
const { stdout } =
|
|
1106
|
+
public async secureTree(args?: string): Promise<string> {
|
|
1107
|
+
const treeCommand = await this.getCommandPath('tree');
|
|
1108
|
+
const command = `${treeCommand} ${args || ''}`;
|
|
1109
|
+
try {
|
|
1110
|
+
this.logger.log(`Executing command: ${command}`);
|
|
1111
|
+
const { stdout } = await this.execPromise(command, {
|
|
1112
1112
|
cwd: this.projectRoot,
|
|
1113
1113
|
maxBuffer: 32 * 1024 * 1024,
|
|
1114
1114
|
timeout: 3000,
|
|
1115
1115
|
});
|
|
1116
|
-
|
|
1116
|
+
return stdout;
|
|
1117
1117
|
} catch (error) {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1118
|
+
if (error.signal === 'SIGTERM') {
|
|
1119
|
+
this.logger.warn(`'tree' command timed out after 3 seconds.`);
|
|
1120
|
+
return `'tree' command timed out after 3 seconds.`;
|
|
1121
1121
|
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1122
|
+
if (error.message.includes('command not found')) {
|
|
1123
|
+
this.logger.warn(
|
|
1124
1124
|
`'tree' command not found. Please ensure it is installed and in your PATH or bundled in 'backend/bin'.`,
|
|
1125
1125
|
);
|
|
1126
|
-
|
|
1126
|
+
return `'tree' command not found. Please ensure it is installed and in your PATH or bundled in 'backend/bin'.`;
|
|
1127
1127
|
}
|
|
1128
1128
|
<span class="cstat-no" title="statement not covered" > this.logger.error(</span>
|
|
1129
1129
|
`Error executing tree command: ${error.message}`,
|
|
@@ -1133,25 +1133,25 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
1135
|
|
|
1136
|
-
|
|
1137
|
-
const rgCommand =
|
|
1138
|
-
const command = <span class="
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
const { stdout } =
|
|
1136
|
+
public async secureRipGrep(args?: string): Promise<string> {
|
|
1137
|
+
const rgCommand = await this.getCommandPath('rg');
|
|
1138
|
+
const command = `${rgCommand} ${args || <span class="branch-1 cbranch-no" title="branch not covered" >''}</span>`;
|
|
1139
|
+
try {
|
|
1140
|
+
this.logger.log(`Executing command: ${command}`);
|
|
1141
|
+
const { stdout } = await this.execPromise(command, {
|
|
1142
1142
|
cwd: this.projectRoot,
|
|
1143
1143
|
maxBuffer: 256 * 1024 * 1024,
|
|
1144
1144
|
timeout: 3000,
|
|
1145
1145
|
});
|
|
1146
|
-
|
|
1146
|
+
return stdout;
|
|
1147
1147
|
} catch (error) {
|
|
1148
|
-
|
|
1148
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (error.signal === 'SIGTERM') {
|
|
1149
1149
|
<span class="cstat-no" title="statement not covered" > this.logger.warn(`'rg' command timed out after 3 seconds.`);</span>
|
|
1150
1150
|
<span class="cstat-no" title="statement not covered" > return `'rg' command timed out after 3 seconds.`;</span>
|
|
1151
1151
|
}
|
|
1152
|
-
|
|
1152
|
+
if (error.code === 1) {
|
|
1153
1153
|
// Exit code 1 means no matches were found, which is not a failure.
|
|
1154
|
-
|
|
1154
|
+
return error.stdout; // Return stdout, which is likely empty.
|
|
1155
1155
|
}
|
|
1156
1156
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (error.message.includes('command not found')) {</span>
|
|
1157
1157
|
<span class="cstat-no" title="statement not covered" > this.logger.warn(</span>
|
|
@@ -1169,22 +1169,22 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
-
|
|
1173
|
-
|
|
1172
|
+
public async secureGitDiff(args?: string): Promise<string> {
|
|
1173
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (args && /[`$&|;()<>*]/.test(args)) {
|
|
1174
1174
|
<span class="cstat-no" title="statement not covered" > this.logger.warn(</span>
|
|
1175
1175
|
`Potential command injection attempt in gitDiff args: ${args}`,
|
|
1176
1176
|
);
|
|
1177
1177
|
<span class="cstat-no" title="statement not covered" > return `Error: Invalid characters in gitDiff arguments.`;</span>
|
|
1178
1178
|
}
|
|
1179
|
-
const command = <span class="
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
const { stdout } =
|
|
1179
|
+
const command = `git --no-pager diff ${args || <span class="branch-1 cbranch-no" title="branch not covered" >''}</span>`;
|
|
1180
|
+
try {
|
|
1181
|
+
this.logger.log(`Executing command: ${command}`);
|
|
1182
|
+
const { stdout } = await this.execPromise(command, {
|
|
1183
1183
|
cwd: this.projectRoot,
|
|
1184
1184
|
maxBuffer: 32 * 1024 * 1024,
|
|
1185
1185
|
timeout: 3000,
|
|
1186
1186
|
});
|
|
1187
|
-
|
|
1187
|
+
return stdout;
|
|
1188
1188
|
} catch (error) {
|
|
1189
1189
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (error.signal === 'SIGTERM') {</span>
|
|
1190
1190
|
<span class="cstat-no" title="statement not covered" > this.logger.warn(`'git diff' command timed out after 3 seconds.`);</span>
|
|
@@ -1242,31 +1242,31 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
1245
|
-
private
|
|
1245
|
+
private async include(templateName: string, data: any): Promise<string> {
|
|
1246
1246
|
// Recursion check
|
|
1247
|
-
|
|
1248
|
-
|
|
1247
|
+
if (data.__included_partials.has(templateName)) {
|
|
1248
|
+
this.logger.error(
|
|
1249
1249
|
`Recursive inclusion of partial "${templateName}" detected.`,
|
|
1250
1250
|
);
|
|
1251
|
-
|
|
1251
|
+
return `[Error: Recursive inclusion of partial "${templateName}" detected]`;
|
|
1252
1252
|
}
|
|
1253
1253
|
|
|
1254
|
-
let partial =
|
|
1254
|
+
let partial = this.partialCache.get(templateName);
|
|
1255
1255
|
|
|
1256
|
-
|
|
1257
|
-
|
|
1256
|
+
if (partial === undefined) {
|
|
1257
|
+
this.logger.log(
|
|
1258
1258
|
`Cache miss for partial: "${templateName}". Fetching from DB.`,
|
|
1259
1259
|
);
|
|
1260
|
-
|
|
1260
|
+
partial = await this.contextTemplatesRepository.findOneBy({
|
|
1261
1261
|
template_name: templateName,
|
|
1262
1262
|
template_type: TemplateType.PARTIAL,
|
|
1263
1263
|
});
|
|
1264
|
-
<span class="
|
|
1265
|
-
} else {
|
|
1264
|
+
this.partialCache.set(templateName, partial || <span class="branch-1 cbranch-no" title="branch not covered" >null)</span>;
|
|
1265
|
+
} else <span class="missing-if-branch" title="else path not taken" >E</span>{
|
|
1266
1266
|
<span class="cstat-no" title="statement not covered" > this.logger.log(`Cache hit for partial: "${templateName}".`);</span>
|
|
1267
1267
|
}
|
|
1268
1268
|
|
|
1269
|
-
|
|
1269
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!partial) {
|
|
1270
1270
|
<span class="cstat-no" title="statement not covered" > this.logger.warn(</span>
|
|
1271
1271
|
`Partial template "${templateName}" not found or is not of type 'partial'.`,
|
|
1272
1272
|
);
|
|
@@ -1274,18 +1274,18 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1274
1274
|
}
|
|
1275
1275
|
|
|
1276
1276
|
// Add to the set for the duration of this sub-render
|
|
1277
|
-
|
|
1277
|
+
data.__included_partials.add(templateName);
|
|
1278
1278
|
|
|
1279
1279
|
// Render the partial with the same data context
|
|
1280
|
-
const result =
|
|
1280
|
+
const result = await this.eta.renderStringAsync(
|
|
1281
1281
|
partial.template_content,
|
|
1282
1282
|
data,
|
|
1283
1283
|
);
|
|
1284
1284
|
|
|
1285
1285
|
// Backtrack: remove from the set after rendering is complete
|
|
1286
|
-
|
|
1286
|
+
data.__included_partials.delete(templateName);
|
|
1287
1287
|
|
|
1288
|
-
|
|
1288
|
+
return result;
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
1291
|
/**
|
|
@@ -1294,12 +1294,12 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1294
1294
|
* @param data An object containing data to be injected into the template.
|
|
1295
1295
|
* @returns The rendered string.
|
|
1296
1296
|
*/
|
|
1297
|
-
public
|
|
1297
|
+
public async render(
|
|
1298
1298
|
templateContent: string,
|
|
1299
|
-
data: object =
|
|
1299
|
+
data: object = {},
|
|
1300
1300
|
): Promise<string> {
|
|
1301
|
-
|
|
1302
|
-
const renderData =
|
|
1301
|
+
try {
|
|
1302
|
+
const renderData = {
|
|
1303
1303
|
...data,
|
|
1304
1304
|
...this.templateHelpers,
|
|
1305
1305
|
// Add a property to the data object to track included partials and prevent recursion
|
|
@@ -1309,20 +1309,20 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1309
1309
|
// The `include` helper expects the data object as its second argument.
|
|
1310
1310
|
// The template author must call it like: <%~ await it.include('my-partial', it) %>
|
|
1311
1311
|
// We are binding `this` to the `include` function, so it has access to the repository and cache.
|
|
1312
|
-
|
|
1313
|
-
|
|
1312
|
+
renderData['include'] = (templateName: string) =>
|
|
1313
|
+
this.include(templateName, renderData);
|
|
1314
1314
|
|
|
1315
|
-
const result =
|
|
1315
|
+
const result = await this.eta.renderStringAsync(
|
|
1316
1316
|
templateContent,
|
|
1317
1317
|
renderData,
|
|
1318
1318
|
);
|
|
1319
|
-
|
|
1319
|
+
return result;
|
|
1320
1320
|
} catch (error) {
|
|
1321
|
-
|
|
1321
|
+
this.logger.error(
|
|
1322
1322
|
`Error rendering Eta template: ${error.message}`,
|
|
1323
1323
|
error.stack,
|
|
1324
1324
|
);
|
|
1325
|
-
|
|
1325
|
+
throw new Error(`Template rendering failed: ${error.message}`);
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
@@ -1333,7 +1333,7 @@ export class <span class="cstat-no" title="statement not covered" ><span class="
|
|
|
1333
1333
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1334
1334
|
Code coverage generated by
|
|
1335
1335
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1336
|
-
at 2025-
|
|
1336
|
+
at 2025-09-12T19:21:55.945Z
|
|
1337
1337
|
</div>
|
|
1338
1338
|
<script src="../../prettify.js"></script>
|
|
1339
1339
|
<script>
|