@agiflowai/scaffold-mcp 0.6.0 → 1.0.1

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 (30) hide show
  1. package/README.md +11 -71
  2. package/dist/ScaffoldConfigLoader-CI0T6zdG.js +142 -0
  3. package/dist/{ScaffoldConfigLoader-DzcV5a_c.cjs → ScaffoldConfigLoader-DQMCLVGD.cjs} +1 -1
  4. package/dist/ScaffoldConfigLoader-DhthV6xq.js +3 -0
  5. package/dist/ScaffoldService-B3En_m4t.cjs +3 -0
  6. package/dist/{ScaffoldService-BgFWAOLQ.cjs → ScaffoldService-BwDmXt83.cjs} +17 -8
  7. package/dist/ScaffoldService-CJ3vNmAj.js +3 -0
  8. package/dist/ScaffoldService-DB7-Cyod.js +293 -0
  9. package/dist/TemplateService-BZRt3NI8.cjs +3 -0
  10. package/dist/TemplateService-CiZJA06s.js +79 -0
  11. package/dist/TemplateService-DropYdp8.js +3 -0
  12. package/dist/VariableReplacementService-BAwTGv_R.js +3 -0
  13. package/dist/{VariableReplacementService-YUpL5nAC.cjs → VariableReplacementService-CroHkMha.cjs} +1 -1
  14. package/dist/{VariableReplacementService-ClshNY_C.cjs → VariableReplacementService-D0QnWKUW.cjs} +2 -2
  15. package/dist/VariableReplacementService-DRxd9ILB.js +66 -0
  16. package/dist/cli.cjs +779 -0
  17. package/dist/cli.d.cts +1 -0
  18. package/dist/cli.d.ts +1 -0
  19. package/dist/cli.js +774 -0
  20. package/dist/index.cjs +38 -3208
  21. package/dist/index.d.cts +814 -0
  22. package/dist/index.d.ts +815 -0
  23. package/dist/index.js +137 -0
  24. package/dist/stdio-Bxn4A1IU.js +2073 -0
  25. package/dist/stdio-TGsG8akc.cjs +2178 -0
  26. package/package.json +19 -5
  27. package/dist/ScaffoldService-BvD9WvRi.cjs +0 -3
  28. package/dist/TemplateService-B5EZjPB0.cjs +0 -3
  29. /package/dist/{ScaffoldConfigLoader-1Pcv9cxm.cjs → ScaffoldConfigLoader-BrmvENTo.cjs} +0 -0
  30. /package/dist/{TemplateService-_KpkoLfZ.cjs → TemplateService-DRubcvS9.cjs} +0 -0
@@ -0,0 +1,814 @@
1
+ import { JsonSchema } from "@composio/json-schema-to-zod";
2
+ import { z } from "zod";
3
+ import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
4
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
+
6
+ //#region src/services/BoilerplateGeneratorService.d.ts
7
+ interface GenerateBoilerplateOptions {
8
+ templateName: string;
9
+ boilerplateName: string;
10
+ description: string;
11
+ instruction?: string;
12
+ targetFolder: string;
13
+ variables: Array<{
14
+ name: string;
15
+ description: string;
16
+ type: string;
17
+ required: boolean;
18
+ default?: any;
19
+ }>;
20
+ includes?: string[];
21
+ }
22
+ /**
23
+ * Service for generating boilerplate configurations in scaffold.yaml files
24
+ */
25
+ declare class BoilerplateGeneratorService {
26
+ private templatesPath;
27
+ constructor(templatesPath: string);
28
+ /**
29
+ * Custom YAML dumper that forces literal block style (|) for description and instruction fields
30
+ */
31
+ private dumpYamlWithLiteralBlocks;
32
+ /**
33
+ * Process config to ensure description and instruction use literal block style
34
+ */
35
+ private processConfigForLiteralBlocks;
36
+ /**
37
+ * Ensure string is properly formatted for YAML literal blocks
38
+ */
39
+ private ensureMultilineFormat;
40
+ /**
41
+ * Generate or update a boilerplate configuration in scaffold.yaml
42
+ */
43
+ generateBoilerplate(options: GenerateBoilerplateOptions): Promise<{
44
+ success: boolean;
45
+ message: string;
46
+ templatePath?: string;
47
+ scaffoldYamlPath?: string;
48
+ }>;
49
+ /**
50
+ * List all templates (directories in templates folder)
51
+ */
52
+ listTemplates(): Promise<string[]>;
53
+ /**
54
+ * Check if a template exists
55
+ */
56
+ templateExists(templateName: string): Promise<boolean>;
57
+ /**
58
+ * Create or update a template file for a boilerplate
59
+ */
60
+ createTemplateFile(options: {
61
+ templateName: string;
62
+ filePath: string;
63
+ content?: string;
64
+ sourceFile?: string;
65
+ header?: string;
66
+ }): Promise<{
67
+ success: boolean;
68
+ message: string;
69
+ filePath?: string;
70
+ fullPath?: string;
71
+ }>;
72
+ }
73
+ //#endregion
74
+ //#region src/types/boilerplateTypes.d.ts
75
+ interface BoilerplateConfig {
76
+ name: string;
77
+ description: string;
78
+ instruction: string;
79
+ variables_schema: JsonSchema;
80
+ includes: string[];
81
+ targetFolder: string;
82
+ }
83
+ interface FeatureConfig {
84
+ name: string;
85
+ generator: string;
86
+ instruction: string;
87
+ variables_schema: JsonSchema;
88
+ includes: string[];
89
+ }
90
+ interface ScaffoldYamlConfig {
91
+ boilerplate?: BoilerplateConfig[];
92
+ feature?: FeatureConfig[];
93
+ }
94
+ interface BoilerplateInfo {
95
+ name: string;
96
+ description: string;
97
+ instruction: string;
98
+ variables_schema: JsonSchema;
99
+ template_path: string;
100
+ target_folder: string;
101
+ includes: string[];
102
+ }
103
+ interface UseBoilerplateRequest {
104
+ boilerplateName?: string;
105
+ variables: Record<string, any>;
106
+ monolith?: boolean;
107
+ targetFolderOverride?: string;
108
+ }
109
+ interface ListBoilerplateResponse {
110
+ boilerplates: BoilerplateInfo[];
111
+ }
112
+ //#endregion
113
+ //#region src/types/interfaces.d.ts
114
+ /**
115
+ * Interface for file system operations
116
+ */
117
+ interface IFileSystemService {
118
+ pathExists(path: string): Promise<boolean>;
119
+ readFile(path: string, encoding?: BufferEncoding): Promise<string>;
120
+ readJson(path: string): Promise<any>;
121
+ writeFile(path: string, content: string, encoding?: BufferEncoding): Promise<void>;
122
+ ensureDir(path: string): Promise<void>;
123
+ copy(src: string, dest: string): Promise<void>;
124
+ readdir(path: string): Promise<string[]>;
125
+ stat(path: string): Promise<{
126
+ isDirectory(): boolean;
127
+ isFile(): boolean;
128
+ }>;
129
+ }
130
+ /**
131
+ * Interface for template rendering
132
+ */
133
+ interface ITemplateService {
134
+ renderString(template: string, variables: Record<string, any>): string;
135
+ containsTemplateVariables(content: string): boolean;
136
+ }
137
+ type INunjucksService = ITemplateService;
138
+ /**
139
+ * Interface for scaffold config loading operations
140
+ */
141
+ interface IScaffoldConfigLoader {
142
+ parseArchitectConfig(templatePath: string): Promise<ArchitectConfig | null>;
143
+ parseIncludeEntry(includeEntry: string, variables: Record<string, any>): ParsedInclude;
144
+ replaceVariablesInPath(pathStr: string, variables: Record<string, any>): string;
145
+ shouldIncludeFile(conditions: Record<string, string> | undefined, variables: Record<string, any>): boolean;
146
+ validateTemplate(templatePath: string, scaffoldType: string): Promise<TemplateValidationResult>;
147
+ }
148
+ /**
149
+ * Interface for variable replacement in files
150
+ */
151
+ interface IVariableReplacementService {
152
+ processFilesForVariableReplacement(dirPath: string, variables: Record<string, any>): Promise<void>;
153
+ replaceVariablesInFile(filePath: string, variables: Record<string, any>): Promise<void>;
154
+ isBinaryFile(filePath: string): boolean;
155
+ }
156
+ /**
157
+ * Main scaffold service interface
158
+ */
159
+ interface IScaffoldService {
160
+ useBoilerplate(options: BoilerplateOptions): Promise<ScaffoldResult>;
161
+ useFeature(options: FeatureOptions): Promise<ScaffoldResult>;
162
+ }
163
+ type ITemplateParserService = IScaffoldConfigLoader;
164
+ //#endregion
165
+ //#region src/types/scaffold.d.ts
166
+ interface BoilerplateOptions {
167
+ projectName: string;
168
+ packageName: string;
169
+ targetFolder: string;
170
+ templateFolder: string;
171
+ boilerplateName: string;
172
+ variables?: Record<string, any>;
173
+ }
174
+ interface FeatureOptions {
175
+ projectPath: string;
176
+ templateFolder: string;
177
+ featureName: string;
178
+ variables?: Record<string, any>;
179
+ }
180
+ interface ArchitectConfig {
181
+ [key: string]: {
182
+ name: string;
183
+ description: string;
184
+ variables_schema: {
185
+ type: string;
186
+ properties: Record<string, any>;
187
+ required: string[];
188
+ additionalProperties: boolean;
189
+ };
190
+ includes: string[];
191
+ generator?: string;
192
+ };
193
+ }
194
+ interface ParsedInclude {
195
+ sourcePath: string;
196
+ targetPath: string;
197
+ conditions?: Record<string, string>;
198
+ }
199
+ interface ScaffoldResult {
200
+ success: boolean;
201
+ message: string;
202
+ warnings?: string[];
203
+ createdFiles?: string[];
204
+ existingFiles?: string[];
205
+ }
206
+ interface TemplateValidationResult {
207
+ isValid: boolean;
208
+ errors: string[];
209
+ missingFiles: string[];
210
+ }
211
+ interface GeneratorContext {
212
+ variables: Record<string, any>;
213
+ config: ArchitectConfig[string];
214
+ targetPath: string;
215
+ templatePath: string;
216
+ fileSystem: IFileSystemService;
217
+ scaffoldConfigLoader: IScaffoldConfigLoader;
218
+ variableReplacer: IVariableReplacementService;
219
+ }
220
+ type GeneratorFunction = (context: GeneratorContext) => Promise<ScaffoldResult>;
221
+ //#endregion
222
+ //#region src/services/BoilerplateService.d.ts
223
+ declare class BoilerplateService {
224
+ private templatesPath;
225
+ private templateService;
226
+ private scaffoldService;
227
+ constructor(templatesPath: string);
228
+ /**
229
+ * Scans all scaffold.yaml files and returns available boilerplates
230
+ */
231
+ listBoilerplates(): Promise<ListBoilerplateResponse>;
232
+ /**
233
+ * Dynamically discovers template directories by finding all directories
234
+ * that contain both package.json and scaffold.yaml files
235
+ */
236
+ private discoverTemplateDirectories;
237
+ /**
238
+ * Executes a specific boilerplate with provided variables
239
+ */
240
+ useBoilerplate(request: UseBoilerplateRequest): Promise<ScaffoldResult>;
241
+ /**
242
+ * Gets a specific boilerplate configuration by name with optional variable rendering
243
+ */
244
+ getBoilerplate(name: string, variables?: Record<string, any>): Promise<BoilerplateInfo | null>;
245
+ /**
246
+ * Processes boilerplate instruction with template service
247
+ */
248
+ processBoilerplateInstruction(instruction: string, variables: Record<string, any>): string;
249
+ /**
250
+ * Validates boilerplate variables against schema using Zod
251
+ */
252
+ validateBoilerplateVariables(boilerplate: BoilerplateInfo, variables: Record<string, any>): {
253
+ isValid: boolean;
254
+ errors: string[];
255
+ };
256
+ }
257
+ //#endregion
258
+ //#region src/services/FileSystemService.d.ts
259
+ declare class FileSystemService implements IFileSystemService {
260
+ pathExists(path: string): Promise<boolean>;
261
+ readFile(path: string, encoding?: BufferEncoding): Promise<string>;
262
+ readJson(path: string): Promise<any>;
263
+ writeFile(path: string, content: string, encoding?: BufferEncoding): Promise<void>;
264
+ ensureDir(path: string): Promise<void>;
265
+ copy(src: string, dest: string): Promise<void>;
266
+ readdir(path: string): Promise<string[]>;
267
+ stat(path: string): Promise<{
268
+ isDirectory(): boolean;
269
+ isFile(): boolean;
270
+ }>;
271
+ }
272
+ //#endregion
273
+ //#region src/services/ScaffoldConfigLoader.d.ts
274
+
275
+ declare class ScaffoldConfigLoader implements IScaffoldConfigLoader {
276
+ private fileSystem;
277
+ private templateService;
278
+ constructor(fileSystem: IFileSystemService, templateService: ITemplateService);
279
+ parseArchitectConfig(templatePath: string): Promise<ArchitectConfig | null>;
280
+ parseIncludeEntry(includeEntry: string, variables: Record<string, any>): ParsedInclude;
281
+ replaceVariablesInPath(pathStr: string, variables: Record<string, any>): string;
282
+ shouldIncludeFile(conditions: Record<string, string> | undefined, variables: Record<string, any>): boolean;
283
+ validateTemplate(templatePath: string, scaffoldType: string): Promise<TemplateValidationResult>;
284
+ }
285
+ //#endregion
286
+ //#region src/services/ScaffoldGeneratorService.d.ts
287
+ interface GenerateFeatureScaffoldOptions {
288
+ templateName: string;
289
+ featureName: string;
290
+ description: string;
291
+ instruction?: string;
292
+ variables: Array<{
293
+ name: string;
294
+ description: string;
295
+ type: string;
296
+ required: boolean;
297
+ default?: any;
298
+ }>;
299
+ includes?: string[];
300
+ patterns?: string[];
301
+ }
302
+ /**
303
+ * Service for generating feature scaffold configurations in scaffold.yaml files
304
+ */
305
+ declare class ScaffoldGeneratorService {
306
+ private templatesPath;
307
+ constructor(templatesPath: string);
308
+ /**
309
+ * Custom YAML dumper that forces literal block style (|) for description and instruction fields
310
+ */
311
+ private dumpYamlWithLiteralBlocks;
312
+ /**
313
+ * Process config to ensure description and instruction use literal block style
314
+ */
315
+ private processConfigForLiteralBlocks;
316
+ /**
317
+ * Ensure string is properly formatted for YAML literal blocks
318
+ */
319
+ private ensureMultilineFormat;
320
+ /**
321
+ * Generate or update a feature configuration in scaffold.yaml
322
+ */
323
+ generateFeatureScaffold(options: GenerateFeatureScaffoldOptions): Promise<{
324
+ success: boolean;
325
+ message: string;
326
+ templatePath?: string;
327
+ scaffoldYamlPath?: string;
328
+ }>;
329
+ /**
330
+ * List all templates (directories in templates folder)
331
+ */
332
+ listTemplates(): Promise<string[]>;
333
+ /**
334
+ * Check if a template exists
335
+ */
336
+ templateExists(templateName: string): Promise<boolean>;
337
+ }
338
+ //#endregion
339
+ //#region src/services/ScaffoldingMethodsService.d.ts
340
+ interface ScaffoldMethod {
341
+ name: string;
342
+ description?: string;
343
+ instruction?: string;
344
+ variables_schema: {
345
+ type: string;
346
+ properties: Record<string, any>;
347
+ required: string[];
348
+ additionalProperties: boolean;
349
+ };
350
+ generator?: string;
351
+ }
352
+ interface ListScaffoldingMethodsResult {
353
+ sourceTemplate: string;
354
+ templatePath: string;
355
+ methods: ScaffoldMethod[];
356
+ }
357
+ interface UseScaffoldMethodRequest {
358
+ projectPath: string;
359
+ scaffold_feature_name: string;
360
+ variables: Record<string, any>;
361
+ }
362
+ declare class ScaffoldingMethodsService {
363
+ private fileSystem;
364
+ private templatesRootPath;
365
+ private templateService;
366
+ constructor(fileSystem: IFileSystemService, templatesRootPath: string);
367
+ listScaffoldingMethods(projectPath: string): Promise<ListScaffoldingMethodsResult>;
368
+ listScaffoldingMethodsByTemplate(templateName: string): Promise<ListScaffoldingMethodsResult>;
369
+ /**
370
+ * Gets scaffolding methods with instructions rendered using provided variables
371
+ */
372
+ listScaffoldingMethodsWithVariables(projectPath: string, variables: Record<string, any>): Promise<ListScaffoldingMethodsResult>;
373
+ /**
374
+ * Processes scaffold instruction with template service
375
+ */
376
+ processScaffoldInstruction(instruction: string, variables: Record<string, any>): string;
377
+ private findTemplatePath;
378
+ /**
379
+ * Resolves the project path, handling both monorepo and monolith cases
380
+ * Uses ProjectConfigResolver to find the correct workspace/project root
381
+ */
382
+ private resolveProjectPath;
383
+ /**
384
+ * Dynamically discovers all template directories
385
+ * Supports both flat structure (templates/nextjs-15) and nested structure (templates/apps/nextjs-15)
386
+ **/
387
+ private discoverTemplateDirs;
388
+ useScaffoldMethod(request: UseScaffoldMethodRequest): Promise<ScaffoldResult>;
389
+ }
390
+ //#endregion
391
+ //#region src/services/ScaffoldProcessingService.d.ts
392
+ /**
393
+ * Shared service for common scaffolding operations like processing templates and tracking files
394
+ */
395
+ declare class ScaffoldProcessingService {
396
+ private fileSystem;
397
+ private variableReplacer;
398
+ constructor(fileSystem: IFileSystemService, variableReplacer: IVariableReplacementService);
399
+ /**
400
+ * Process a target path for variable replacement, handling both files and directories
401
+ */
402
+ processTargetForVariableReplacement(targetPath: string, variables: Record<string, any>): Promise<void>;
403
+ /**
404
+ * Track all created files, handling both single files and directories
405
+ */
406
+ trackCreatedFiles(targetPath: string, createdFiles: string[]): Promise<void>;
407
+ /**
408
+ * Track all existing files, handling both single files and directories
409
+ */
410
+ trackExistingFiles(targetPath: string, existingFiles: string[]): Promise<void>;
411
+ /**
412
+ * Copy source to target, then process templates and track files
413
+ * Now supports tracking existing files separately from created files
414
+ * Automatically handles .liquid template files by stripping the extension
415
+ */
416
+ copyAndProcess(sourcePath: string, targetPath: string, variables: Record<string, any>, createdFiles: string[], existingFiles?: string[]): Promise<void>;
417
+ /**
418
+ * Recursively collect all file paths in a directory for created files
419
+ */
420
+ private trackCreatedFilesRecursive;
421
+ /**
422
+ * Recursively collect all file paths in a directory for existing files
423
+ */
424
+ private trackExistingFilesRecursive;
425
+ }
426
+ //#endregion
427
+ //#region src/services/ScaffoldService.d.ts
428
+ declare class ScaffoldService implements IScaffoldService {
429
+ private fileSystem;
430
+ private scaffoldConfigLoader;
431
+ private variableReplacer;
432
+ private readonly templatesRootPath;
433
+ private readonly processingService;
434
+ constructor(fileSystem: IFileSystemService, scaffoldConfigLoader: IScaffoldConfigLoader, variableReplacer: IVariableReplacementService, templatesRootPath?: string);
435
+ /**
436
+ * Scaffold a new project from a boilerplate template
437
+ */
438
+ useBoilerplate(options: BoilerplateOptions): Promise<ScaffoldResult>;
439
+ /**
440
+ * Scaffold a new feature into an existing project
441
+ */
442
+ useFeature(options: FeatureOptions): Promise<ScaffoldResult>;
443
+ /**
444
+ * Common scaffolding processing logic shared by both useBoilerplate and useFeature
445
+ */
446
+ private processScaffold;
447
+ }
448
+ //#endregion
449
+ //#region src/services/TemplateService.d.ts
450
+ interface ITemplateService$1 {
451
+ renderString(template: string, variables: Record<string, any>): string;
452
+ containsTemplateVariables(content: string): boolean;
453
+ }
454
+ declare class TemplateService implements ITemplateService$1 {
455
+ private liquid;
456
+ constructor();
457
+ private toPascalCase;
458
+ private setupCustomFilters;
459
+ renderString(template: string, variables: Record<string, any>): string;
460
+ containsTemplateVariables(content: string): boolean;
461
+ }
462
+ //#endregion
463
+ //#region src/services/VariableReplacementService.d.ts
464
+ declare class VariableReplacementService implements IVariableReplacementService {
465
+ private fileSystem;
466
+ private templateService;
467
+ private readonly binaryExtensions;
468
+ constructor(fileSystem: IFileSystemService, templateService: ITemplateService);
469
+ processFilesForVariableReplacement(dirPath: string, variables: Record<string, any>): Promise<void>;
470
+ replaceVariablesInFile(filePath: string, variables: Record<string, any>): Promise<void>;
471
+ isBinaryFile(filePath: string): boolean;
472
+ }
473
+ //#endregion
474
+ //#region src/tools/types.d.ts
475
+ /**
476
+ * Shared type definitions for MCP tools
477
+ */
478
+ interface ToolDefinition {
479
+ name: string;
480
+ description: string;
481
+ inputSchema: {
482
+ type: string;
483
+ properties: Record<string, any>;
484
+ required?: string[];
485
+ additionalProperties: boolean;
486
+ };
487
+ }
488
+ //#endregion
489
+ //#region src/tools/GenerateBoilerplateFileTool.d.ts
490
+ /**
491
+ * Tool to generate template files for boilerplates and features
492
+ */
493
+ declare class GenerateBoilerplateFileTool {
494
+ static readonly TOOL_NAME = "generate-boilerplate-file";
495
+ private boilerplateGeneratorService;
496
+ private isMonolith;
497
+ constructor(templatesPath: string, isMonolith?: boolean);
498
+ /**
499
+ * Get the tool definition for MCP
500
+ */
501
+ getDefinition(): ToolDefinition;
502
+ /**
503
+ * Execute the tool
504
+ */
505
+ execute(args: {
506
+ templateName?: string;
507
+ filePath: string;
508
+ content?: string;
509
+ sourceFile?: string;
510
+ header?: string;
511
+ }): Promise<CallToolResult>;
512
+ }
513
+ //#endregion
514
+ //#region src/tools/GenerateBoilerplateTool.d.ts
515
+ /**
516
+ * Tool to generate a new boilerplate configuration in scaffold.yaml
517
+ */
518
+ declare class GenerateBoilerplateTool {
519
+ static readonly TOOL_NAME = "generate-boilerplate";
520
+ private boilerplateGeneratorService;
521
+ private isMonolith;
522
+ constructor(templatesPath: string, isMonolith?: boolean);
523
+ /**
524
+ * Get the tool definition for MCP
525
+ */
526
+ getDefinition(): ToolDefinition;
527
+ /**
528
+ * Execute the tool
529
+ */
530
+ execute(args: {
531
+ templateName?: string;
532
+ boilerplateName: string;
533
+ description: string;
534
+ instruction?: string;
535
+ targetFolder?: string;
536
+ variables: Array<{
537
+ name: string;
538
+ description: string;
539
+ type: string;
540
+ required: boolean;
541
+ default?: any;
542
+ }>;
543
+ includes?: string[];
544
+ }): Promise<CallToolResult>;
545
+ }
546
+ //#endregion
547
+ //#region src/tools/GenerateFeatureScaffoldTool.d.ts
548
+ /**
549
+ * Tool to generate a new feature scaffold configuration in scaffold.yaml
550
+ */
551
+ declare class GenerateFeatureScaffoldTool {
552
+ static readonly TOOL_NAME = "generate-feature-scaffold";
553
+ private scaffoldGeneratorService;
554
+ private isMonolith;
555
+ constructor(templatesPath: string, isMonolith?: boolean);
556
+ /**
557
+ * Get the tool definition for MCP
558
+ */
559
+ getDefinition(): ToolDefinition;
560
+ /**
561
+ * Execute the tool
562
+ */
563
+ execute(args: {
564
+ templateName?: string;
565
+ featureName: string;
566
+ description: string;
567
+ instruction?: string;
568
+ variables: Array<{
569
+ name: string;
570
+ description: string;
571
+ type: string;
572
+ required: boolean;
573
+ default?: any;
574
+ }>;
575
+ includes?: string[];
576
+ patterns?: string[];
577
+ }): Promise<CallToolResult>;
578
+ }
579
+ //#endregion
580
+ //#region src/tools/ListBoilerplatesTool.d.ts
581
+ declare class ListBoilerplatesTool {
582
+ static readonly TOOL_NAME = "list-boilerplates";
583
+ private boilerplateService;
584
+ private templateService;
585
+ private isMonolith;
586
+ constructor(templatesPath: string, isMonolith?: boolean);
587
+ /**
588
+ * Get the tool definition for MCP
589
+ */
590
+ getDefinition(): ToolDefinition;
591
+ /**
592
+ * Execute the tool
593
+ */
594
+ execute(_args?: Record<string, any>): Promise<CallToolResult>;
595
+ }
596
+ //#endregion
597
+ //#region src/tools/ListScaffoldingMethodsTool.d.ts
598
+ declare class ListScaffoldingMethodsTool {
599
+ static readonly TOOL_NAME = "list-scaffolding-methods";
600
+ private fileSystemService;
601
+ private scaffoldingMethodsService;
602
+ private templateService;
603
+ private isMonolith;
604
+ constructor(templatesPath: string, isMonolith?: boolean);
605
+ /**
606
+ * Get the tool definition for MCP
607
+ */
608
+ getDefinition(): ToolDefinition;
609
+ /**
610
+ * Execute the tool
611
+ */
612
+ execute(args: Record<string, any>): Promise<CallToolResult>;
613
+ }
614
+ //#endregion
615
+ //#region src/tools/UseBoilerplateTool.d.ts
616
+ declare class UseBoilerplateTool {
617
+ static readonly TOOL_NAME = "use-boilerplate";
618
+ private boilerplateService;
619
+ private templateService;
620
+ private isMonolith;
621
+ constructor(templatesPath: string, isMonolith?: boolean);
622
+ /**
623
+ * Get the tool definition for MCP
624
+ */
625
+ getDefinition(): ToolDefinition;
626
+ /**
627
+ * Execute the tool
628
+ */
629
+ execute(args: Record<string, any>): Promise<CallToolResult>;
630
+ }
631
+ //#endregion
632
+ //#region src/tools/UseScaffoldMethodTool.d.ts
633
+ declare class UseScaffoldMethodTool {
634
+ static readonly TOOL_NAME = "use-scaffold-method";
635
+ private fileSystemService;
636
+ private scaffoldingMethodsService;
637
+ private isMonolith;
638
+ constructor(templatesPath: string, isMonolith?: boolean);
639
+ /**
640
+ * Get the tool definition for MCP
641
+ */
642
+ getDefinition(): ToolDefinition;
643
+ /**
644
+ * Execute the tool
645
+ */
646
+ execute(args: Record<string, any>): Promise<CallToolResult>;
647
+ }
648
+ //#endregion
649
+ //#region src/tools/WriteToFileTool.d.ts
650
+ declare class WriteToFileTool {
651
+ static readonly TOOL_NAME = "write-to-file";
652
+ private fileSystemService;
653
+ constructor();
654
+ /**
655
+ * Get the tool definition for MCP
656
+ */
657
+ getDefinition(): ToolDefinition;
658
+ /**
659
+ * Execute the tool
660
+ */
661
+ execute(args: Record<string, any>): Promise<CallToolResult>;
662
+ }
663
+ //#endregion
664
+ //#region src/transports/types.d.ts
665
+ /**
666
+ * Transport mode types
667
+ */
668
+ declare enum TransportMode {
669
+ STDIO = "stdio",
670
+ HTTP = "http",
671
+ SSE = "sse",
672
+ CLI = "cli",
673
+ }
674
+ /**
675
+ * Transport configuration options
676
+ */
677
+ interface TransportConfig {
678
+ mode: TransportMode;
679
+ port?: number;
680
+ host?: string;
681
+ }
682
+ /**
683
+ * Base interface for all transport handlers
684
+ */
685
+ interface TransportHandler {
686
+ start(): Promise<void>;
687
+ stop(): Promise<void>;
688
+ }
689
+ /**
690
+ * HTTP transport specific types
691
+ */
692
+ interface HttpTransportHandler$1 extends TransportHandler {
693
+ getPort(): number;
694
+ getHost(): string;
695
+ }
696
+ //#endregion
697
+ //#region src/transports/http.d.ts
698
+ /**
699
+ * HTTP transport handler using Streamable HTTP (protocol version 2025-03-26)
700
+ * Provides stateful session management with resumability support
701
+ */
702
+ declare class HttpTransportHandler implements HttpTransportHandler$1 {
703
+ private serverFactory;
704
+ private app;
705
+ private server;
706
+ private sessionManager;
707
+ private config;
708
+ constructor(serverFactory: Server | (() => Server), config: TransportConfig);
709
+ private setupMiddleware;
710
+ private setupRoutes;
711
+ private handlePostRequest;
712
+ private handleGetRequest;
713
+ private handleDeleteRequest;
714
+ start(): Promise<void>;
715
+ stop(): Promise<void>;
716
+ getPort(): number;
717
+ getHost(): string;
718
+ }
719
+ //#endregion
720
+ //#region src/transports/sse.d.ts
721
+ /**
722
+ * SSE (Server-Sent Events) transport handler
723
+ * Legacy transport for backwards compatibility (protocol version 2024-11-05)
724
+ * Uses separate endpoints: /sse for SSE stream (GET) and /messages for client messages (POST)
725
+ */
726
+ declare class SseTransportHandler implements HttpTransportHandler$1 {
727
+ private serverFactory;
728
+ private app;
729
+ private server;
730
+ private sessionManager;
731
+ private config;
732
+ constructor(serverFactory: Server | (() => Server), config: TransportConfig);
733
+ private setupMiddleware;
734
+ private setupRoutes;
735
+ private handleSseConnection;
736
+ private handlePostMessage;
737
+ start(): Promise<void>;
738
+ stop(): Promise<void>;
739
+ getPort(): number;
740
+ getHost(): string;
741
+ }
742
+ //#endregion
743
+ //#region src/transports/stdio.d.ts
744
+ /**
745
+ * Stdio transport handler for MCP server
746
+ * Used for command-line and direct integrations
747
+ */
748
+ declare class StdioTransportHandler implements TransportHandler {
749
+ private server;
750
+ private transport;
751
+ constructor(server: Server);
752
+ start(): Promise<void>;
753
+ stop(): Promise<void>;
754
+ }
755
+ //#endregion
756
+ //#region src/types/tools.d.ts
757
+ declare const scaffoldArgsSchema: z.ZodObject<{
758
+ appName: z.ZodString;
759
+ }, "strip", z.ZodTypeAny, {
760
+ appName: string;
761
+ }, {
762
+ appName: string;
763
+ }>;
764
+ type ScaffoldArgs = z.infer<typeof scaffoldArgsSchema>;
765
+ interface Tool {
766
+ name: string;
767
+ description: string;
768
+ inputSchema: {
769
+ type: 'object';
770
+ properties: Record<string, any>;
771
+ required: string[];
772
+ };
773
+ execute: (args: unknown) => Promise<string>;
774
+ }
775
+ //#endregion
776
+ //#region src/utils/git.d.ts
777
+ /**
778
+ * Find the workspace root by searching upwards for .git folder
779
+ * Returns null if no .git folder is found (indicating a new project setup is needed)
780
+ */
781
+ declare function findWorkspaceRoot(startPath?: string): Promise<string | null>;
782
+ /**
783
+ * Parse GitHub URL to detect if it's a subdirectory
784
+ * Supports formats:
785
+ * - https://github.com/user/repo
786
+ * - https://github.com/user/repo/tree/branch/path/to/dir
787
+ * - https://github.com/user/repo/tree/main/path/to/dir
788
+ */
789
+ declare function parseGitHubUrl(url: string): {
790
+ owner?: string;
791
+ repo?: string;
792
+ repoUrl: string;
793
+ branch?: string;
794
+ subdirectory?: string;
795
+ isSubdirectory: boolean;
796
+ };
797
+ /**
798
+ * Clone a subdirectory from a git repository using sparse checkout
799
+ */
800
+ declare function cloneSubdirectory(repoUrl: string, branch: string, subdirectory: string, targetFolder: string): Promise<void>;
801
+ /**
802
+ * Clone entire repository
803
+ */
804
+ declare function cloneRepository(repoUrl: string, targetFolder: string): Promise<void>;
805
+ /**
806
+ * Fetch directory listing from GitHub API
807
+ */
808
+ declare function fetchGitHubDirectoryContents(owner: string, repo: string, path: string, branch?: string): Promise<Array<{
809
+ name: string;
810
+ type: string;
811
+ path: string;
812
+ }>>;
813
+ //#endregion
814
+ export { ArchitectConfig, BoilerplateConfig, BoilerplateGeneratorService, BoilerplateInfo, BoilerplateOptions, BoilerplateService, FeatureConfig, FeatureOptions, FileSystemService, GenerateBoilerplateFileTool, GenerateBoilerplateTool, GenerateFeatureScaffoldTool, GeneratorContext, GeneratorFunction, HttpTransportHandler, IFileSystemService, INunjucksService, IScaffoldConfigLoader, IScaffoldService, ITemplateParserService, ITemplateService, IVariableReplacementService, ListBoilerplateResponse, ListBoilerplatesTool, ListScaffoldingMethodsTool, ParsedInclude, ScaffoldArgs, ScaffoldConfigLoader, ScaffoldGeneratorService, ScaffoldProcessingService, ScaffoldResult, ScaffoldService, ScaffoldYamlConfig, ScaffoldingMethodsService, SseTransportHandler, StdioTransportHandler, TemplateService, TemplateValidationResult, Tool, UseBoilerplateRequest, UseBoilerplateTool, UseScaffoldMethodTool, VariableReplacementService, WriteToFileTool, cloneRepository, cloneSubdirectory, fetchGitHubDirectoryContents, findWorkspaceRoot, parseGitHubUrl, scaffoldArgsSchema };