sdd-mcp-server 1.0.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.
Files changed (165) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +256 -0
  3. package/dist/__tests__/setup.d.ts +44 -0
  4. package/dist/__tests__/setup.js +178 -0
  5. package/dist/__tests__/setup.js.map +1 -0
  6. package/dist/__tests__/test-helpers/mock-factories.d.ts +26 -0
  7. package/dist/__tests__/test-helpers/mock-factories.js +466 -0
  8. package/dist/__tests__/test-helpers/mock-factories.js.map +1 -0
  9. package/dist/adapters/cli/SDDToolAdapter.d.ts +26 -0
  10. package/dist/adapters/cli/SDDToolAdapter.js +273 -0
  11. package/dist/adapters/cli/SDDToolAdapter.js.map +1 -0
  12. package/dist/application/services/CodebaseAnalysisService.d.ts +38 -0
  13. package/dist/application/services/CodebaseAnalysisService.js +737 -0
  14. package/dist/application/services/CodebaseAnalysisService.js.map +1 -0
  15. package/dist/application/services/LocalizationService.d.ts +184 -0
  16. package/dist/application/services/LocalizationService.js +536 -0
  17. package/dist/application/services/LocalizationService.js.map +1 -0
  18. package/dist/application/services/ProjectContextService.d.ts +61 -0
  19. package/dist/application/services/ProjectContextService.js +550 -0
  20. package/dist/application/services/ProjectContextService.js.map +1 -0
  21. package/dist/application/services/ProjectInitializationService.d.ts +57 -0
  22. package/dist/application/services/ProjectInitializationService.js +485 -0
  23. package/dist/application/services/ProjectInitializationService.js.map +1 -0
  24. package/dist/application/services/ProjectService.d.ts +19 -0
  25. package/dist/application/services/ProjectService.js +159 -0
  26. package/dist/application/services/ProjectService.js.map +1 -0
  27. package/dist/application/services/QualityGateService.d.ts +62 -0
  28. package/dist/application/services/QualityGateService.js +428 -0
  29. package/dist/application/services/QualityGateService.js.map +1 -0
  30. package/dist/application/services/QualityService.d.ts +43 -0
  31. package/dist/application/services/QualityService.js +245 -0
  32. package/dist/application/services/QualityService.js.map +1 -0
  33. package/dist/application/services/SteeringDocumentService.d.ts +62 -0
  34. package/dist/application/services/SteeringDocumentService.js +694 -0
  35. package/dist/application/services/SteeringDocumentService.js.map +1 -0
  36. package/dist/application/services/TemplateService.d.ts +47 -0
  37. package/dist/application/services/TemplateService.js +438 -0
  38. package/dist/application/services/TemplateService.js.map +1 -0
  39. package/dist/application/services/WorkflowEngineService.d.ts +56 -0
  40. package/dist/application/services/WorkflowEngineService.js +348 -0
  41. package/dist/application/services/WorkflowEngineService.js.map +1 -0
  42. package/dist/application/services/WorkflowService.d.ts +22 -0
  43. package/dist/application/services/WorkflowService.js +147 -0
  44. package/dist/application/services/WorkflowService.js.map +1 -0
  45. package/dist/application/services/WorkflowValidationService.d.ts +51 -0
  46. package/dist/application/services/WorkflowValidationService.js +665 -0
  47. package/dist/application/services/WorkflowValidationService.js.map +1 -0
  48. package/dist/domain/context/ProjectContext.d.ts +350 -0
  49. package/dist/domain/context/ProjectContext.js +138 -0
  50. package/dist/domain/context/ProjectContext.js.map +1 -0
  51. package/dist/domain/i18n/index.d.ts +286 -0
  52. package/dist/domain/i18n/index.js +97 -0
  53. package/dist/domain/i18n/index.js.map +1 -0
  54. package/dist/domain/plugins/index.d.ts +498 -0
  55. package/dist/domain/plugins/index.js +157 -0
  56. package/dist/domain/plugins/index.js.map +1 -0
  57. package/dist/domain/ports.d.ts +54 -0
  58. package/dist/domain/ports.js +3 -0
  59. package/dist/domain/ports.js.map +1 -0
  60. package/dist/domain/quality/index.d.ts +361 -0
  61. package/dist/domain/quality/index.js +113 -0
  62. package/dist/domain/quality/index.js.map +1 -0
  63. package/dist/domain/services/DomainService.d.ts +18 -0
  64. package/dist/domain/services/DomainService.js +71 -0
  65. package/dist/domain/services/DomainService.js.map +1 -0
  66. package/dist/domain/templates/index.d.ts +158 -0
  67. package/dist/domain/templates/index.js +22 -0
  68. package/dist/domain/templates/index.js.map +1 -0
  69. package/dist/domain/types.d.ts +115 -0
  70. package/dist/domain/types.js +37 -0
  71. package/dist/domain/types.js.map +1 -0
  72. package/dist/domain/workflow/WorkflowStateMachine.d.ts +62 -0
  73. package/dist/domain/workflow/WorkflowStateMachine.js +286 -0
  74. package/dist/domain/workflow/WorkflowStateMachine.js.map +1 -0
  75. package/dist/index.d.ts +19 -0
  76. package/dist/index.js +97 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/infrastructure/adapters/AjvValidationAdapter.d.ts +7 -0
  79. package/dist/infrastructure/adapters/AjvValidationAdapter.js +37 -0
  80. package/dist/infrastructure/adapters/AjvValidationAdapter.js.map +1 -0
  81. package/dist/infrastructure/adapters/ConsoleLoggerAdapter.d.ts +8 -0
  82. package/dist/infrastructure/adapters/ConsoleLoggerAdapter.js +41 -0
  83. package/dist/infrastructure/adapters/ConsoleLoggerAdapter.js.map +1 -0
  84. package/dist/infrastructure/adapters/FileBasedTaskTracker.d.ts +9 -0
  85. package/dist/infrastructure/adapters/FileBasedTaskTracker.js +41 -0
  86. package/dist/infrastructure/adapters/FileBasedTaskTracker.js.map +1 -0
  87. package/dist/infrastructure/adapters/HandlebarsTemplateEngine.d.ts +8 -0
  88. package/dist/infrastructure/adapters/HandlebarsTemplateEngine.js +38 -0
  89. package/dist/infrastructure/adapters/HandlebarsTemplateEngine.js.map +1 -0
  90. package/dist/infrastructure/adapters/JsonConfigurationAdapter.d.ts +7 -0
  91. package/dist/infrastructure/adapters/JsonConfigurationAdapter.js +24 -0
  92. package/dist/infrastructure/adapters/JsonConfigurationAdapter.js.map +1 -0
  93. package/dist/infrastructure/adapters/LinusQualityAnalyzer.d.ts +9 -0
  94. package/dist/infrastructure/adapters/LinusQualityAnalyzer.js +75 -0
  95. package/dist/infrastructure/adapters/LinusQualityAnalyzer.js.map +1 -0
  96. package/dist/infrastructure/adapters/NodeFileSystemAdapter.d.ts +12 -0
  97. package/dist/infrastructure/adapters/NodeFileSystemAdapter.js +39 -0
  98. package/dist/infrastructure/adapters/NodeFileSystemAdapter.js.map +1 -0
  99. package/dist/infrastructure/di/container.d.ts +3 -0
  100. package/dist/infrastructure/di/container.js +98 -0
  101. package/dist/infrastructure/di/container.js.map +1 -0
  102. package/dist/infrastructure/di/types.d.ts +39 -0
  103. package/dist/infrastructure/di/types.js +45 -0
  104. package/dist/infrastructure/di/types.js.map +1 -0
  105. package/dist/infrastructure/i18n/I18nextService.d.ts +27 -0
  106. package/dist/infrastructure/i18n/I18nextService.js +357 -0
  107. package/dist/infrastructure/i18n/I18nextService.js.map +1 -0
  108. package/dist/infrastructure/mcp/CapabilityNegotiator.d.ts +21 -0
  109. package/dist/infrastructure/mcp/CapabilityNegotiator.js +75 -0
  110. package/dist/infrastructure/mcp/CapabilityNegotiator.js.map +1 -0
  111. package/dist/infrastructure/mcp/ErrorHandler.d.ts +29 -0
  112. package/dist/infrastructure/mcp/ErrorHandler.js +101 -0
  113. package/dist/infrastructure/mcp/ErrorHandler.js.map +1 -0
  114. package/dist/infrastructure/mcp/MCPServer.d.ts +25 -0
  115. package/dist/infrastructure/mcp/MCPServer.js +246 -0
  116. package/dist/infrastructure/mcp/MCPServer.js.map +1 -0
  117. package/dist/infrastructure/mcp/PromptManager.d.ts +18 -0
  118. package/dist/infrastructure/mcp/PromptManager.js +373 -0
  119. package/dist/infrastructure/mcp/PromptManager.js.map +1 -0
  120. package/dist/infrastructure/mcp/ResourceManager.d.ts +15 -0
  121. package/dist/infrastructure/mcp/ResourceManager.js +229 -0
  122. package/dist/infrastructure/mcp/ResourceManager.js.map +1 -0
  123. package/dist/infrastructure/mcp/SessionManager.d.ts +64 -0
  124. package/dist/infrastructure/mcp/SessionManager.js +221 -0
  125. package/dist/infrastructure/mcp/SessionManager.js.map +1 -0
  126. package/dist/infrastructure/mcp/ToolRegistry.d.ts +48 -0
  127. package/dist/infrastructure/mcp/ToolRegistry.js +235 -0
  128. package/dist/infrastructure/mcp/ToolRegistry.js.map +1 -0
  129. package/dist/infrastructure/platform/PlatformAdapter.d.ts +46 -0
  130. package/dist/infrastructure/platform/PlatformAdapter.js +355 -0
  131. package/dist/infrastructure/platform/PlatformAdapter.js.map +1 -0
  132. package/dist/infrastructure/plugins/HookSystem.d.ts +40 -0
  133. package/dist/infrastructure/plugins/HookSystem.js +415 -0
  134. package/dist/infrastructure/plugins/HookSystem.js.map +1 -0
  135. package/dist/infrastructure/plugins/PluginManager.d.ts +51 -0
  136. package/dist/infrastructure/plugins/PluginManager.js +650 -0
  137. package/dist/infrastructure/plugins/PluginManager.js.map +1 -0
  138. package/dist/infrastructure/plugins/PluginSteeringRegistry.d.ts +63 -0
  139. package/dist/infrastructure/plugins/PluginSteeringRegistry.js +439 -0
  140. package/dist/infrastructure/plugins/PluginSteeringRegistry.js.map +1 -0
  141. package/dist/infrastructure/plugins/PluginToolRegistry.d.ts +54 -0
  142. package/dist/infrastructure/plugins/PluginToolRegistry.js +490 -0
  143. package/dist/infrastructure/plugins/PluginToolRegistry.js.map +1 -0
  144. package/dist/infrastructure/quality/ASTAnalyzer.d.ts +65 -0
  145. package/dist/infrastructure/quality/ASTAnalyzer.js +439 -0
  146. package/dist/infrastructure/quality/ASTAnalyzer.js.map +1 -0
  147. package/dist/infrastructure/quality/LinusCodeReviewer.d.ts +52 -0
  148. package/dist/infrastructure/quality/LinusCodeReviewer.js +551 -0
  149. package/dist/infrastructure/quality/LinusCodeReviewer.js.map +1 -0
  150. package/dist/infrastructure/repositories/InMemoryProjectRepository.d.ts +10 -0
  151. package/dist/infrastructure/repositories/InMemoryProjectRepository.js +35 -0
  152. package/dist/infrastructure/repositories/InMemoryProjectRepository.js.map +1 -0
  153. package/dist/infrastructure/schemas/project.schema.d.ts +192 -0
  154. package/dist/infrastructure/schemas/project.schema.js +114 -0
  155. package/dist/infrastructure/schemas/project.schema.js.map +1 -0
  156. package/dist/infrastructure/templates/FileGenerator.d.ts +15 -0
  157. package/dist/infrastructure/templates/FileGenerator.js +385 -0
  158. package/dist/infrastructure/templates/FileGenerator.js.map +1 -0
  159. package/dist/infrastructure/templates/HandlebarsRenderer.d.ts +16 -0
  160. package/dist/infrastructure/templates/HandlebarsRenderer.js +252 -0
  161. package/dist/infrastructure/templates/HandlebarsRenderer.js.map +1 -0
  162. package/dist/infrastructure/templates/TemplateManager.d.ts +36 -0
  163. package/dist/infrastructure/templates/TemplateManager.js +777 -0
  164. package/dist/infrastructure/templates/TemplateManager.js.map +1 -0
  165. package/package.json +89 -0
@@ -0,0 +1,192 @@
1
+ export declare const projectSchema: {
2
+ readonly type: "object";
3
+ readonly properties: {
4
+ readonly id: {
5
+ readonly type: "string";
6
+ readonly minLength: 1;
7
+ };
8
+ readonly name: {
9
+ readonly type: "string";
10
+ readonly minLength: 1;
11
+ };
12
+ readonly path: {
13
+ readonly type: "string";
14
+ readonly minLength: 1;
15
+ };
16
+ readonly phase: {
17
+ readonly type: "string";
18
+ readonly enum: readonly ["init", "requirements-generated", "design-generated", "tasks-generated", "implementation-ready"];
19
+ };
20
+ readonly metadata: {
21
+ readonly type: "object";
22
+ readonly properties: {
23
+ readonly createdAt: {
24
+ readonly type: "string";
25
+ readonly format: "date-time";
26
+ };
27
+ readonly updatedAt: {
28
+ readonly type: "string";
29
+ readonly format: "date-time";
30
+ };
31
+ readonly language: {
32
+ readonly type: "string";
33
+ readonly enum: readonly ["en", "ja", "zh-TW"];
34
+ };
35
+ readonly approvals: {
36
+ readonly type: "object";
37
+ readonly properties: {
38
+ readonly requirements: {
39
+ readonly type: "object";
40
+ readonly properties: {
41
+ readonly generated: {
42
+ readonly type: "boolean";
43
+ };
44
+ readonly approved: {
45
+ readonly type: "boolean";
46
+ };
47
+ };
48
+ readonly required: readonly ["generated", "approved"];
49
+ };
50
+ readonly design: {
51
+ readonly type: "object";
52
+ readonly properties: {
53
+ readonly generated: {
54
+ readonly type: "boolean";
55
+ };
56
+ readonly approved: {
57
+ readonly type: "boolean";
58
+ };
59
+ };
60
+ readonly required: readonly ["generated", "approved"];
61
+ };
62
+ readonly tasks: {
63
+ readonly type: "object";
64
+ readonly properties: {
65
+ readonly generated: {
66
+ readonly type: "boolean";
67
+ };
68
+ readonly approved: {
69
+ readonly type: "boolean";
70
+ };
71
+ };
72
+ readonly required: readonly ["generated", "approved"];
73
+ };
74
+ };
75
+ readonly required: readonly ["requirements", "design", "tasks"];
76
+ };
77
+ };
78
+ readonly required: readonly ["createdAt", "updatedAt", "language", "approvals"];
79
+ };
80
+ };
81
+ readonly required: readonly ["id", "name", "path", "phase", "metadata"];
82
+ };
83
+ export declare const requirementSchema: {
84
+ readonly type: "object";
85
+ readonly properties: {
86
+ readonly id: {
87
+ readonly type: "string";
88
+ readonly minLength: 1;
89
+ };
90
+ readonly title: {
91
+ readonly type: "string";
92
+ readonly minLength: 1;
93
+ };
94
+ readonly objective: {
95
+ readonly type: "string";
96
+ readonly minLength: 1;
97
+ };
98
+ readonly acceptanceCriteria: {
99
+ readonly type: "array";
100
+ readonly items: {
101
+ readonly type: "string";
102
+ readonly minLength: 1;
103
+ };
104
+ readonly minItems: 1;
105
+ };
106
+ };
107
+ readonly required: readonly ["id", "title", "objective", "acceptanceCriteria"];
108
+ };
109
+ export declare const taskSchema: {
110
+ readonly type: "object";
111
+ readonly properties: {
112
+ readonly id: {
113
+ readonly type: "string";
114
+ readonly minLength: 1;
115
+ };
116
+ readonly title: {
117
+ readonly type: "string";
118
+ readonly minLength: 1;
119
+ };
120
+ readonly description: {
121
+ readonly type: "string";
122
+ readonly minLength: 1;
123
+ };
124
+ readonly requirements: {
125
+ readonly type: "array";
126
+ readonly items: {
127
+ readonly type: "string";
128
+ readonly minLength: 1;
129
+ };
130
+ };
131
+ readonly completed: {
132
+ readonly type: "boolean";
133
+ };
134
+ };
135
+ readonly required: readonly ["id", "title", "description", "requirements", "completed"];
136
+ };
137
+ export declare const qualityReportSchema: {
138
+ readonly type: "object";
139
+ readonly properties: {
140
+ readonly score: {
141
+ readonly type: "string";
142
+ readonly enum: readonly ["good", "passable", "garbage"];
143
+ };
144
+ readonly issues: {
145
+ readonly type: "array";
146
+ readonly items: {
147
+ readonly type: "object";
148
+ readonly properties: {
149
+ readonly type: {
150
+ readonly type: "string";
151
+ readonly enum: readonly ["complexity", "special-case", "data-structure", "breaking-change", "practicality"];
152
+ };
153
+ readonly message: {
154
+ readonly type: "string";
155
+ readonly minLength: 1;
156
+ };
157
+ readonly severity: {
158
+ readonly type: "string";
159
+ readonly enum: readonly ["error", "warning", "info"];
160
+ };
161
+ readonly location: {
162
+ readonly type: "object";
163
+ readonly properties: {
164
+ readonly file: {
165
+ readonly type: "string";
166
+ readonly minLength: 1;
167
+ };
168
+ readonly line: {
169
+ readonly type: "number";
170
+ readonly minimum: 1;
171
+ };
172
+ readonly column: {
173
+ readonly type: "number";
174
+ readonly minimum: 1;
175
+ };
176
+ };
177
+ readonly required: readonly ["file", "line", "column"];
178
+ };
179
+ };
180
+ readonly required: readonly ["type", "message", "severity"];
181
+ };
182
+ };
183
+ readonly recommendations: {
184
+ readonly type: "array";
185
+ readonly items: {
186
+ readonly type: "string";
187
+ readonly minLength: 1;
188
+ };
189
+ };
190
+ };
191
+ readonly required: readonly ["score", "issues", "recommendations"];
192
+ };
@@ -0,0 +1,114 @@
1
+ // JSON schemas for project data validation
2
+ export const projectSchema = {
3
+ type: 'object',
4
+ properties: {
5
+ id: { type: 'string', minLength: 1 },
6
+ name: { type: 'string', minLength: 1 },
7
+ path: { type: 'string', minLength: 1 },
8
+ phase: {
9
+ type: 'string',
10
+ enum: ['init', 'requirements-generated', 'design-generated', 'tasks-generated', 'implementation-ready']
11
+ },
12
+ metadata: {
13
+ type: 'object',
14
+ properties: {
15
+ createdAt: { type: 'string', format: 'date-time' },
16
+ updatedAt: { type: 'string', format: 'date-time' },
17
+ language: { type: 'string', enum: ['en', 'ja', 'zh-TW'] },
18
+ approvals: {
19
+ type: 'object',
20
+ properties: {
21
+ requirements: {
22
+ type: 'object',
23
+ properties: {
24
+ generated: { type: 'boolean' },
25
+ approved: { type: 'boolean' }
26
+ },
27
+ required: ['generated', 'approved']
28
+ },
29
+ design: {
30
+ type: 'object',
31
+ properties: {
32
+ generated: { type: 'boolean' },
33
+ approved: { type: 'boolean' }
34
+ },
35
+ required: ['generated', 'approved']
36
+ },
37
+ tasks: {
38
+ type: 'object',
39
+ properties: {
40
+ generated: { type: 'boolean' },
41
+ approved: { type: 'boolean' }
42
+ },
43
+ required: ['generated', 'approved']
44
+ }
45
+ },
46
+ required: ['requirements', 'design', 'tasks']
47
+ }
48
+ },
49
+ required: ['createdAt', 'updatedAt', 'language', 'approvals']
50
+ }
51
+ },
52
+ required: ['id', 'name', 'path', 'phase', 'metadata']
53
+ };
54
+ export const requirementSchema = {
55
+ type: 'object',
56
+ properties: {
57
+ id: { type: 'string', minLength: 1 },
58
+ title: { type: 'string', minLength: 1 },
59
+ objective: { type: 'string', minLength: 1 },
60
+ acceptanceCriteria: {
61
+ type: 'array',
62
+ items: { type: 'string', minLength: 1 },
63
+ minItems: 1
64
+ }
65
+ },
66
+ required: ['id', 'title', 'objective', 'acceptanceCriteria']
67
+ };
68
+ export const taskSchema = {
69
+ type: 'object',
70
+ properties: {
71
+ id: { type: 'string', minLength: 1 },
72
+ title: { type: 'string', minLength: 1 },
73
+ description: { type: 'string', minLength: 1 },
74
+ requirements: {
75
+ type: 'array',
76
+ items: { type: 'string', minLength: 1 }
77
+ },
78
+ completed: { type: 'boolean' }
79
+ },
80
+ required: ['id', 'title', 'description', 'requirements', 'completed']
81
+ };
82
+ export const qualityReportSchema = {
83
+ type: 'object',
84
+ properties: {
85
+ score: { type: 'string', enum: ['good', 'passable', 'garbage'] },
86
+ issues: {
87
+ type: 'array',
88
+ items: {
89
+ type: 'object',
90
+ properties: {
91
+ type: { type: 'string', enum: ['complexity', 'special-case', 'data-structure', 'breaking-change', 'practicality'] },
92
+ message: { type: 'string', minLength: 1 },
93
+ severity: { type: 'string', enum: ['error', 'warning', 'info'] },
94
+ location: {
95
+ type: 'object',
96
+ properties: {
97
+ file: { type: 'string', minLength: 1 },
98
+ line: { type: 'number', minimum: 1 },
99
+ column: { type: 'number', minimum: 1 }
100
+ },
101
+ required: ['file', 'line', 'column']
102
+ }
103
+ },
104
+ required: ['type', 'message', 'severity']
105
+ }
106
+ },
107
+ recommendations: {
108
+ type: 'array',
109
+ items: { type: 'string', minLength: 1 }
110
+ }
111
+ },
112
+ required: ['score', 'issues', 'recommendations']
113
+ };
114
+ //# sourceMappingURL=project.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.schema.js","sourceRoot":"","sources":["../../../src/infrastructure/schemas/project.schema.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACpC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACtC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACtC,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,CAAC;SACxG;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;gBAClD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;gBAClD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;gBACzD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,YAAY,EAAE;4BACZ,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACV,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE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AAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE;oBAChE,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;4BACtC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;4BACpC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;yBACvC;wBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;qBACrC;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;aAC1C;SACF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;SACxC;KACF;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC;CACxC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { FileGeneratorPort, FileGenerationOptions, FileGenerationResult, DirectoryStructure, DirectoryGenerationResult, PathValidationResult, TemplateData, TemplateContext, TemplateRendererPort } from '../../domain/templates/index.js';
2
+ import type { LoggerPort } from '../../domain/ports.js';
3
+ export declare class FileGenerator implements FileGeneratorPort {
4
+ private readonly logger;
5
+ private readonly renderer;
6
+ private readonly backupDirectory;
7
+ constructor(logger: LoggerPort, renderer: TemplateRendererPort, backupDirectory?: string);
8
+ generateFile(filePath: string, template: string, data: TemplateData, context: TemplateContext, options?: FileGenerationOptions): Promise<FileGenerationResult>;
9
+ generateDirectory(dirPath: string, structure: DirectoryStructure, context: TemplateContext, options?: FileGenerationOptions): Promise<DirectoryGenerationResult>;
10
+ validatePath(targetPath: string): Promise<PathValidationResult>;
11
+ backupFile(filePath: string): Promise<string>;
12
+ restoreBackup(backupPath: string, originalPath: string): Promise<void>;
13
+ cleanupBackups(olderThan: Date): Promise<string[]>;
14
+ private writeFile;
15
+ }