@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,815 @@
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
+ listScaffoldingMethodsByTemplate(templateName: string): Promise<ListScaffoldingMethodsResult>;
370
+ /**
371
+ * Gets scaffolding methods with instructions rendered using provided variables
372
+ */
373
+ listScaffoldingMethodsWithVariables(projectPath: string, variables: Record<string, any>): Promise<ListScaffoldingMethodsResult>;
374
+ /**
375
+ * Processes scaffold instruction with template service
376
+ */
377
+ processScaffoldInstruction(instruction: string, variables: Record<string, any>): string;
378
+ private findTemplatePath;
379
+ /**
380
+ * Resolves the project path, handling both monorepo and monolith cases
381
+ * Uses ProjectConfigResolver to find the correct workspace/project root
382
+ */
383
+ private resolveProjectPath;
384
+ /**
385
+ * Dynamically discovers all template directories
386
+ * Supports both flat structure (templates/nextjs-15) and nested structure (templates/apps/nextjs-15)
387
+ **/
388
+ private discoverTemplateDirs;
389
+ useScaffoldMethod(request: UseScaffoldMethodRequest): Promise<ScaffoldResult>;
390
+ }
391
+ //#endregion
392
+ //#region src/services/ScaffoldProcessingService.d.ts
393
+ /**
394
+ * Shared service for common scaffolding operations like processing templates and tracking files
395
+ */
396
+ declare class ScaffoldProcessingService {
397
+ private fileSystem;
398
+ private variableReplacer;
399
+ constructor(fileSystem: IFileSystemService, variableReplacer: IVariableReplacementService);
400
+ /**
401
+ * Process a target path for variable replacement, handling both files and directories
402
+ */
403
+ processTargetForVariableReplacement(targetPath: string, variables: Record<string, any>): Promise<void>;
404
+ /**
405
+ * Track all created files, handling both single files and directories
406
+ */
407
+ trackCreatedFiles(targetPath: string, createdFiles: string[]): Promise<void>;
408
+ /**
409
+ * Track all existing files, handling both single files and directories
410
+ */
411
+ trackExistingFiles(targetPath: string, existingFiles: string[]): Promise<void>;
412
+ /**
413
+ * Copy source to target, then process templates and track files
414
+ * Now supports tracking existing files separately from created files
415
+ * Automatically handles .liquid template files by stripping the extension
416
+ */
417
+ copyAndProcess(sourcePath: string, targetPath: string, variables: Record<string, any>, createdFiles: string[], existingFiles?: string[]): Promise<void>;
418
+ /**
419
+ * Recursively collect all file paths in a directory for created files
420
+ */
421
+ private trackCreatedFilesRecursive;
422
+ /**
423
+ * Recursively collect all file paths in a directory for existing files
424
+ */
425
+ private trackExistingFilesRecursive;
426
+ }
427
+ //#endregion
428
+ //#region src/services/ScaffoldService.d.ts
429
+ declare class ScaffoldService implements IScaffoldService {
430
+ private fileSystem;
431
+ private scaffoldConfigLoader;
432
+ private variableReplacer;
433
+ private readonly templatesRootPath;
434
+ private readonly processingService;
435
+ constructor(fileSystem: IFileSystemService, scaffoldConfigLoader: IScaffoldConfigLoader, variableReplacer: IVariableReplacementService, templatesRootPath?: string);
436
+ /**
437
+ * Scaffold a new project from a boilerplate template
438
+ */
439
+ useBoilerplate(options: BoilerplateOptions): Promise<ScaffoldResult>;
440
+ /**
441
+ * Scaffold a new feature into an existing project
442
+ */
443
+ useFeature(options: FeatureOptions): Promise<ScaffoldResult>;
444
+ /**
445
+ * Common scaffolding processing logic shared by both useBoilerplate and useFeature
446
+ */
447
+ private processScaffold;
448
+ }
449
+ //#endregion
450
+ //#region src/services/TemplateService.d.ts
451
+ interface ITemplateService$1 {
452
+ renderString(template: string, variables: Record<string, any>): string;
453
+ containsTemplateVariables(content: string): boolean;
454
+ }
455
+ declare class TemplateService implements ITemplateService$1 {
456
+ private liquid;
457
+ constructor();
458
+ private toPascalCase;
459
+ private setupCustomFilters;
460
+ renderString(template: string, variables: Record<string, any>): string;
461
+ containsTemplateVariables(content: string): boolean;
462
+ }
463
+ //#endregion
464
+ //#region src/services/VariableReplacementService.d.ts
465
+ declare class VariableReplacementService implements IVariableReplacementService {
466
+ private fileSystem;
467
+ private templateService;
468
+ private readonly binaryExtensions;
469
+ constructor(fileSystem: IFileSystemService, templateService: ITemplateService);
470
+ processFilesForVariableReplacement(dirPath: string, variables: Record<string, any>): Promise<void>;
471
+ replaceVariablesInFile(filePath: string, variables: Record<string, any>): Promise<void>;
472
+ isBinaryFile(filePath: string): boolean;
473
+ }
474
+ //#endregion
475
+ //#region src/tools/types.d.ts
476
+ /**
477
+ * Shared type definitions for MCP tools
478
+ */
479
+ interface ToolDefinition {
480
+ name: string;
481
+ description: string;
482
+ inputSchema: {
483
+ type: string;
484
+ properties: Record<string, any>;
485
+ required?: string[];
486
+ additionalProperties: boolean;
487
+ };
488
+ }
489
+ //#endregion
490
+ //#region src/tools/GenerateBoilerplateFileTool.d.ts
491
+ /**
492
+ * Tool to generate template files for boilerplates and features
493
+ */
494
+ declare class GenerateBoilerplateFileTool {
495
+ static readonly TOOL_NAME = "generate-boilerplate-file";
496
+ private boilerplateGeneratorService;
497
+ private isMonolith;
498
+ constructor(templatesPath: string, isMonolith?: boolean);
499
+ /**
500
+ * Get the tool definition for MCP
501
+ */
502
+ getDefinition(): ToolDefinition;
503
+ /**
504
+ * Execute the tool
505
+ */
506
+ execute(args: {
507
+ templateName?: string;
508
+ filePath: string;
509
+ content?: string;
510
+ sourceFile?: string;
511
+ header?: string;
512
+ }): Promise<CallToolResult>;
513
+ }
514
+ //#endregion
515
+ //#region src/tools/GenerateBoilerplateTool.d.ts
516
+ /**
517
+ * Tool to generate a new boilerplate configuration in scaffold.yaml
518
+ */
519
+ declare class GenerateBoilerplateTool {
520
+ static readonly TOOL_NAME = "generate-boilerplate";
521
+ private boilerplateGeneratorService;
522
+ private isMonolith;
523
+ constructor(templatesPath: string, isMonolith?: boolean);
524
+ /**
525
+ * Get the tool definition for MCP
526
+ */
527
+ getDefinition(): ToolDefinition;
528
+ /**
529
+ * Execute the tool
530
+ */
531
+ execute(args: {
532
+ templateName?: string;
533
+ boilerplateName: string;
534
+ description: string;
535
+ instruction?: string;
536
+ targetFolder?: string;
537
+ variables: Array<{
538
+ name: string;
539
+ description: string;
540
+ type: string;
541
+ required: boolean;
542
+ default?: any;
543
+ }>;
544
+ includes?: string[];
545
+ }): Promise<CallToolResult>;
546
+ }
547
+ //#endregion
548
+ //#region src/tools/GenerateFeatureScaffoldTool.d.ts
549
+ /**
550
+ * Tool to generate a new feature scaffold configuration in scaffold.yaml
551
+ */
552
+ declare class GenerateFeatureScaffoldTool {
553
+ static readonly TOOL_NAME = "generate-feature-scaffold";
554
+ private scaffoldGeneratorService;
555
+ private isMonolith;
556
+ constructor(templatesPath: string, isMonolith?: boolean);
557
+ /**
558
+ * Get the tool definition for MCP
559
+ */
560
+ getDefinition(): ToolDefinition;
561
+ /**
562
+ * Execute the tool
563
+ */
564
+ execute(args: {
565
+ templateName?: string;
566
+ featureName: string;
567
+ description: string;
568
+ instruction?: string;
569
+ variables: Array<{
570
+ name: string;
571
+ description: string;
572
+ type: string;
573
+ required: boolean;
574
+ default?: any;
575
+ }>;
576
+ includes?: string[];
577
+ patterns?: string[];
578
+ }): Promise<CallToolResult>;
579
+ }
580
+ //#endregion
581
+ //#region src/tools/ListBoilerplatesTool.d.ts
582
+ declare class ListBoilerplatesTool {
583
+ static readonly TOOL_NAME = "list-boilerplates";
584
+ private boilerplateService;
585
+ private templateService;
586
+ private isMonolith;
587
+ constructor(templatesPath: string, isMonolith?: boolean);
588
+ /**
589
+ * Get the tool definition for MCP
590
+ */
591
+ getDefinition(): ToolDefinition;
592
+ /**
593
+ * Execute the tool
594
+ */
595
+ execute(_args?: Record<string, any>): Promise<CallToolResult>;
596
+ }
597
+ //#endregion
598
+ //#region src/tools/ListScaffoldingMethodsTool.d.ts
599
+ declare class ListScaffoldingMethodsTool {
600
+ static readonly TOOL_NAME = "list-scaffolding-methods";
601
+ private fileSystemService;
602
+ private scaffoldingMethodsService;
603
+ private templateService;
604
+ private isMonolith;
605
+ constructor(templatesPath: string, isMonolith?: boolean);
606
+ /**
607
+ * Get the tool definition for MCP
608
+ */
609
+ getDefinition(): ToolDefinition;
610
+ /**
611
+ * Execute the tool
612
+ */
613
+ execute(args: Record<string, any>): Promise<CallToolResult>;
614
+ }
615
+ //#endregion
616
+ //#region src/tools/UseBoilerplateTool.d.ts
617
+ declare class UseBoilerplateTool {
618
+ static readonly TOOL_NAME = "use-boilerplate";
619
+ private boilerplateService;
620
+ private templateService;
621
+ private isMonolith;
622
+ constructor(templatesPath: string, isMonolith?: boolean);
623
+ /**
624
+ * Get the tool definition for MCP
625
+ */
626
+ getDefinition(): ToolDefinition;
627
+ /**
628
+ * Execute the tool
629
+ */
630
+ execute(args: Record<string, any>): Promise<CallToolResult>;
631
+ }
632
+ //#endregion
633
+ //#region src/tools/UseScaffoldMethodTool.d.ts
634
+ declare class UseScaffoldMethodTool {
635
+ static readonly TOOL_NAME = "use-scaffold-method";
636
+ private fileSystemService;
637
+ private scaffoldingMethodsService;
638
+ private isMonolith;
639
+ constructor(templatesPath: string, isMonolith?: boolean);
640
+ /**
641
+ * Get the tool definition for MCP
642
+ */
643
+ getDefinition(): ToolDefinition;
644
+ /**
645
+ * Execute the tool
646
+ */
647
+ execute(args: Record<string, any>): Promise<CallToolResult>;
648
+ }
649
+ //#endregion
650
+ //#region src/tools/WriteToFileTool.d.ts
651
+ declare class WriteToFileTool {
652
+ static readonly TOOL_NAME = "write-to-file";
653
+ private fileSystemService;
654
+ constructor();
655
+ /**
656
+ * Get the tool definition for MCP
657
+ */
658
+ getDefinition(): ToolDefinition;
659
+ /**
660
+ * Execute the tool
661
+ */
662
+ execute(args: Record<string, any>): Promise<CallToolResult>;
663
+ }
664
+ //#endregion
665
+ //#region src/transports/types.d.ts
666
+ /**
667
+ * Transport mode types
668
+ */
669
+ declare enum TransportMode {
670
+ STDIO = "stdio",
671
+ HTTP = "http",
672
+ SSE = "sse",
673
+ CLI = "cli",
674
+ }
675
+ /**
676
+ * Transport configuration options
677
+ */
678
+ interface TransportConfig {
679
+ mode: TransportMode;
680
+ port?: number;
681
+ host?: string;
682
+ }
683
+ /**
684
+ * Base interface for all transport handlers
685
+ */
686
+ interface TransportHandler {
687
+ start(): Promise<void>;
688
+ stop(): Promise<void>;
689
+ }
690
+ /**
691
+ * HTTP transport specific types
692
+ */
693
+ interface HttpTransportHandler$1 extends TransportHandler {
694
+ getPort(): number;
695
+ getHost(): string;
696
+ }
697
+ //#endregion
698
+ //#region src/transports/http.d.ts
699
+ /**
700
+ * HTTP transport handler using Streamable HTTP (protocol version 2025-03-26)
701
+ * Provides stateful session management with resumability support
702
+ */
703
+ declare class HttpTransportHandler implements HttpTransportHandler$1 {
704
+ private serverFactory;
705
+ private app;
706
+ private server;
707
+ private sessionManager;
708
+ private config;
709
+ constructor(serverFactory: Server | (() => Server), config: TransportConfig);
710
+ private setupMiddleware;
711
+ private setupRoutes;
712
+ private handlePostRequest;
713
+ private handleGetRequest;
714
+ private handleDeleteRequest;
715
+ start(): Promise<void>;
716
+ stop(): Promise<void>;
717
+ getPort(): number;
718
+ getHost(): string;
719
+ }
720
+ //#endregion
721
+ //#region src/transports/sse.d.ts
722
+ /**
723
+ * SSE (Server-Sent Events) transport handler
724
+ * Legacy transport for backwards compatibility (protocol version 2024-11-05)
725
+ * Uses separate endpoints: /sse for SSE stream (GET) and /messages for client messages (POST)
726
+ */
727
+ declare class SseTransportHandler implements HttpTransportHandler$1 {
728
+ private serverFactory;
729
+ private app;
730
+ private server;
731
+ private sessionManager;
732
+ private config;
733
+ constructor(serverFactory: Server | (() => Server), config: TransportConfig);
734
+ private setupMiddleware;
735
+ private setupRoutes;
736
+ private handleSseConnection;
737
+ private handlePostMessage;
738
+ start(): Promise<void>;
739
+ stop(): Promise<void>;
740
+ getPort(): number;
741
+ getHost(): string;
742
+ }
743
+ //#endregion
744
+ //#region src/transports/stdio.d.ts
745
+ /**
746
+ * Stdio transport handler for MCP server
747
+ * Used for command-line and direct integrations
748
+ */
749
+ declare class StdioTransportHandler implements TransportHandler {
750
+ private server;
751
+ private transport;
752
+ constructor(server: Server);
753
+ start(): Promise<void>;
754
+ stop(): Promise<void>;
755
+ }
756
+ //#endregion
757
+ //#region src/types/tools.d.ts
758
+ declare const scaffoldArgsSchema: z.ZodObject<{
759
+ appName: z.ZodString;
760
+ }, "strip", z.ZodTypeAny, {
761
+ appName: string;
762
+ }, {
763
+ appName: string;
764
+ }>;
765
+ type ScaffoldArgs = z.infer<typeof scaffoldArgsSchema>;
766
+ interface Tool {
767
+ name: string;
768
+ description: string;
769
+ inputSchema: {
770
+ type: 'object';
771
+ properties: Record<string, any>;
772
+ required: string[];
773
+ };
774
+ execute: (args: unknown) => Promise<string>;
775
+ }
776
+ //#endregion
777
+ //#region src/utils/git.d.ts
778
+ /**
779
+ * Find the workspace root by searching upwards for .git folder
780
+ * Returns null if no .git folder is found (indicating a new project setup is needed)
781
+ */
782
+ declare function findWorkspaceRoot(startPath?: string): Promise<string | null>;
783
+ /**
784
+ * Parse GitHub URL to detect if it's a subdirectory
785
+ * Supports formats:
786
+ * - https://github.com/user/repo
787
+ * - https://github.com/user/repo/tree/branch/path/to/dir
788
+ * - https://github.com/user/repo/tree/main/path/to/dir
789
+ */
790
+ declare function parseGitHubUrl(url: string): {
791
+ owner?: string;
792
+ repo?: string;
793
+ repoUrl: string;
794
+ branch?: string;
795
+ subdirectory?: string;
796
+ isSubdirectory: boolean;
797
+ };
798
+ /**
799
+ * Clone a subdirectory from a git repository using sparse checkout
800
+ */
801
+ declare function cloneSubdirectory(repoUrl: string, branch: string, subdirectory: string, targetFolder: string): Promise<void>;
802
+ /**
803
+ * Clone entire repository
804
+ */
805
+ declare function cloneRepository(repoUrl: string, targetFolder: string): Promise<void>;
806
+ /**
807
+ * Fetch directory listing from GitHub API
808
+ */
809
+ declare function fetchGitHubDirectoryContents(owner: string, repo: string, path: string, branch?: string): Promise<Array<{
810
+ name: string;
811
+ type: string;
812
+ path: string;
813
+ }>>;
814
+ //#endregion
815
+ 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 };