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