@agiflowai/scaffold-mcp 1.0.11 → 1.0.12

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 (32) hide show
  1. package/dist/ListScaffoldingMethodsTool-D3ecmSLf.mjs +994 -0
  2. package/dist/ListScaffoldingMethodsTool-D7S3xpJE.cjs +1082 -0
  3. package/dist/cli.cjs +11 -16
  4. package/dist/cli.mjs +5 -9
  5. package/dist/index.cjs +7 -11
  6. package/dist/index.mjs +2 -6
  7. package/dist/{stdio-AbTm52SJ.mjs → stdio-DqZJsqKM.mjs} +15 -18
  8. package/dist/{stdio-baUp7xGL.cjs → stdio-ohQyWnxq.cjs} +24 -28
  9. package/dist/{useScaffoldMethod-CPgJIBHx.mjs → useScaffoldMethod-B-q_yBnX.mjs} +1 -2
  10. package/dist/{useScaffoldMethod-BMWhFebp.mjs → useScaffoldMethod-CC8ARsl9.mjs} +7 -5
  11. package/dist/{useScaffoldMethod-CcrpFEPv.cjs → useScaffoldMethod-DqF6pT1A.cjs} +1 -3
  12. package/dist/{useScaffoldMethod-DOvwnNOJ.cjs → useScaffoldMethod-fzsnprJs.cjs} +10 -9
  13. package/package.json +5 -5
  14. package/dist/ListScaffoldingMethodsTool-B49G_iLj.mjs +0 -350
  15. package/dist/ListScaffoldingMethodsTool-DuYGFDwJ.cjs +0 -376
  16. package/dist/ScaffoldConfigLoader-8YI7v2GJ.mjs +0 -142
  17. package/dist/ScaffoldConfigLoader-BWpNpMx-.cjs +0 -150
  18. package/dist/ScaffoldConfigLoader-DKJtnrWT.mjs +0 -3
  19. package/dist/ScaffoldConfigLoader-HutEtfaH.cjs +0 -3
  20. package/dist/ScaffoldService-DSQBnAHm.cjs +0 -308
  21. package/dist/ScaffoldService-DcsGLMuD.mjs +0 -295
  22. package/dist/ScaffoldService-DfXjmrNT.cjs +0 -3
  23. package/dist/ScaffoldService-dL74anIv.mjs +0 -3
  24. package/dist/TemplateService-7QcWREot.cjs +0 -85
  25. package/dist/TemplateService-B1bd6iHw.mjs +0 -3
  26. package/dist/TemplateService-CVDL2uqt.mjs +0 -79
  27. package/dist/TemplateService-DUbdBOFs.cjs +0 -3
  28. package/dist/VariableReplacementService-B9RA8D0a.mjs +0 -66
  29. package/dist/VariableReplacementService-BO-UYgcf.mjs +0 -3
  30. package/dist/VariableReplacementService-DNYx0Dym.cjs +0 -73
  31. package/dist/VariableReplacementService-wuYKgeui.cjs +0 -3
  32. package/dist/chunk-CbDLau6x.cjs +0 -34
@@ -1,85 +0,0 @@
1
- const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- let __agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
3
- let liquidjs = require("liquidjs");
4
-
5
- //#region src/services/TemplateService.ts
6
- var TemplateService = class {
7
- liquid;
8
- constructor() {
9
- this.liquid = new liquidjs.Liquid({
10
- strictFilters: false,
11
- strictVariables: false
12
- });
13
- this.setupCustomFilters();
14
- __agiflowai_aicode_utils.log.info("TemplateService initialized");
15
- }
16
- toPascalCase(str) {
17
- const camelCase = str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "");
18
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
19
- }
20
- setupCustomFilters() {
21
- this.liquid.registerFilter("camelCase", (str) => {
22
- return str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "");
23
- });
24
- this.liquid.registerFilter("pascalCase", (str) => {
25
- return this.toPascalCase(str);
26
- });
27
- this.liquid.registerFilter("titleCase", (str) => {
28
- return this.toPascalCase(str);
29
- });
30
- this.liquid.registerFilter("kebabCase", (str) => {
31
- return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
32
- });
33
- this.liquid.registerFilter("snakeCase", (str) => {
34
- return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase();
35
- });
36
- this.liquid.registerFilter("upperCase", (str) => {
37
- return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toUpperCase();
38
- });
39
- this.liquid.registerFilter("lower", (str) => str.toLowerCase());
40
- this.liquid.registerFilter("upper", (str) => str.toUpperCase());
41
- this.liquid.registerFilter("pluralize", (str) => {
42
- if (str.endsWith("y")) return `${str.slice(0, -1)}ies`;
43
- else if (str.endsWith("s") || str.endsWith("sh") || str.endsWith("ch") || str.endsWith("x") || str.endsWith("z")) return `${str}es`;
44
- else return `${str}s`;
45
- });
46
- this.liquid.registerFilter("singularize", (str) => {
47
- if (str.endsWith("ies")) return `${str.slice(0, -3)}y`;
48
- else if (str.endsWith("es")) return str.slice(0, -2);
49
- else if (str.endsWith("s") && !str.endsWith("ss")) return str.slice(0, -1);
50
- else return str;
51
- });
52
- this.liquid.registerFilter("strip", (str) => {
53
- return str.trim();
54
- });
55
- }
56
- renderString(template, variables) {
57
- try {
58
- __agiflowai_aicode_utils.log.debug("Rendering template", {
59
- variables,
60
- templatePreview: template.substring(0, 100)
61
- });
62
- const result = this.liquid.parseAndRenderSync(template, variables);
63
- __agiflowai_aicode_utils.log.debug("Rendered template", { resultPreview: result.substring(0, 100) });
64
- return result;
65
- } catch (error) {
66
- __agiflowai_aicode_utils.log.error("LiquidJS rendering error", {
67
- error: error instanceof Error ? error.message : String(error),
68
- templatePreview: template.substring(0, 200),
69
- variables
70
- });
71
- return template;
72
- }
73
- }
74
- containsTemplateVariables(content) {
75
- return [/\{\{.*?\}\}/, /\{%.*?%\}/].some((pattern) => pattern.test(content));
76
- }
77
- };
78
-
79
- //#endregion
80
- Object.defineProperty(exports, 'TemplateService', {
81
- enumerable: true,
82
- get: function () {
83
- return TemplateService;
84
- }
85
- });
@@ -1,3 +0,0 @@
1
- import { t as TemplateService } from "./TemplateService-CVDL2uqt.mjs";
2
-
3
- export { TemplateService };
@@ -1,79 +0,0 @@
1
- import { log } from "@agiflowai/aicode-utils";
2
- import { Liquid } from "liquidjs";
3
-
4
- //#region src/services/TemplateService.ts
5
- var TemplateService = class {
6
- liquid;
7
- constructor() {
8
- this.liquid = new Liquid({
9
- strictFilters: false,
10
- strictVariables: false
11
- });
12
- this.setupCustomFilters();
13
- log.info("TemplateService initialized");
14
- }
15
- toPascalCase(str) {
16
- const camelCase = str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "");
17
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
18
- }
19
- setupCustomFilters() {
20
- this.liquid.registerFilter("camelCase", (str) => {
21
- return str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "");
22
- });
23
- this.liquid.registerFilter("pascalCase", (str) => {
24
- return this.toPascalCase(str);
25
- });
26
- this.liquid.registerFilter("titleCase", (str) => {
27
- return this.toPascalCase(str);
28
- });
29
- this.liquid.registerFilter("kebabCase", (str) => {
30
- return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
31
- });
32
- this.liquid.registerFilter("snakeCase", (str) => {
33
- return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase();
34
- });
35
- this.liquid.registerFilter("upperCase", (str) => {
36
- return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toUpperCase();
37
- });
38
- this.liquid.registerFilter("lower", (str) => str.toLowerCase());
39
- this.liquid.registerFilter("upper", (str) => str.toUpperCase());
40
- this.liquid.registerFilter("pluralize", (str) => {
41
- if (str.endsWith("y")) return `${str.slice(0, -1)}ies`;
42
- else if (str.endsWith("s") || str.endsWith("sh") || str.endsWith("ch") || str.endsWith("x") || str.endsWith("z")) return `${str}es`;
43
- else return `${str}s`;
44
- });
45
- this.liquid.registerFilter("singularize", (str) => {
46
- if (str.endsWith("ies")) return `${str.slice(0, -3)}y`;
47
- else if (str.endsWith("es")) return str.slice(0, -2);
48
- else if (str.endsWith("s") && !str.endsWith("ss")) return str.slice(0, -1);
49
- else return str;
50
- });
51
- this.liquid.registerFilter("strip", (str) => {
52
- return str.trim();
53
- });
54
- }
55
- renderString(template, variables) {
56
- try {
57
- log.debug("Rendering template", {
58
- variables,
59
- templatePreview: template.substring(0, 100)
60
- });
61
- const result = this.liquid.parseAndRenderSync(template, variables);
62
- log.debug("Rendered template", { resultPreview: result.substring(0, 100) });
63
- return result;
64
- } catch (error) {
65
- log.error("LiquidJS rendering error", {
66
- error: error instanceof Error ? error.message : String(error),
67
- templatePreview: template.substring(0, 200),
68
- variables
69
- });
70
- return template;
71
- }
72
- }
73
- containsTemplateVariables(content) {
74
- return [/\{\{.*?\}\}/, /\{%.*?%\}/].some((pattern) => pattern.test(content));
75
- }
76
- };
77
-
78
- //#endregion
79
- export { TemplateService as t };
@@ -1,3 +0,0 @@
1
- const require_TemplateService = require('./TemplateService-7QcWREot.cjs');
2
-
3
- exports.TemplateService = require_TemplateService.TemplateService;
@@ -1,66 +0,0 @@
1
- import path from "node:path";
2
- import { log } from "@agiflowai/aicode-utils";
3
-
4
- //#region src/services/VariableReplacementService.ts
5
- var VariableReplacementService = class {
6
- binaryExtensions = [
7
- ".png",
8
- ".jpg",
9
- ".jpeg",
10
- ".gif",
11
- ".ico",
12
- ".woff",
13
- ".woff2",
14
- ".ttf",
15
- ".eot",
16
- ".pdf",
17
- ".zip",
18
- ".tar",
19
- ".gz",
20
- ".exe",
21
- ".dll",
22
- ".so",
23
- ".dylib"
24
- ];
25
- constructor(fileSystem, templateService) {
26
- this.fileSystem = fileSystem;
27
- this.templateService = templateService;
28
- }
29
- async processFilesForVariableReplacement(dirPath, variables) {
30
- let items = [];
31
- try {
32
- items = await this.fileSystem.readdir(dirPath);
33
- } catch (error) {
34
- log.warn(`Skipping directory ${dirPath}: ${error}`);
35
- return;
36
- }
37
- for (const item of items) {
38
- if (!item) continue;
39
- const itemPath = path.join(dirPath, item);
40
- try {
41
- const stat$1 = await this.fileSystem.stat(itemPath);
42
- if (stat$1.isDirectory()) await this.processFilesForVariableReplacement(itemPath, variables);
43
- else if (stat$1.isFile()) await this.replaceVariablesInFile(itemPath, variables);
44
- } catch (error) {
45
- log.warn(`Skipping item ${itemPath}: ${error}`);
46
- }
47
- }
48
- }
49
- async replaceVariablesInFile(filePath, variables) {
50
- try {
51
- if (this.isBinaryFile(filePath)) return;
52
- const content = await this.fileSystem.readFile(filePath, "utf8");
53
- const renderedContent = this.templateService.renderString(content, variables);
54
- await this.fileSystem.writeFile(filePath, renderedContent, "utf8");
55
- } catch (error) {
56
- log.warn(`Skipping file ${filePath}: ${error}`);
57
- }
58
- }
59
- isBinaryFile(filePath) {
60
- const ext = path.extname(filePath).toLowerCase();
61
- return this.binaryExtensions.includes(ext);
62
- }
63
- };
64
-
65
- //#endregion
66
- export { VariableReplacementService as t };
@@ -1,3 +0,0 @@
1
- import { t as VariableReplacementService } from "./VariableReplacementService-B9RA8D0a.mjs";
2
-
3
- export { VariableReplacementService };
@@ -1,73 +0,0 @@
1
- const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- let node_path = require("node:path");
3
- node_path = require_chunk.__toESM(node_path);
4
- let __agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
5
-
6
- //#region src/services/VariableReplacementService.ts
7
- var VariableReplacementService = class {
8
- binaryExtensions = [
9
- ".png",
10
- ".jpg",
11
- ".jpeg",
12
- ".gif",
13
- ".ico",
14
- ".woff",
15
- ".woff2",
16
- ".ttf",
17
- ".eot",
18
- ".pdf",
19
- ".zip",
20
- ".tar",
21
- ".gz",
22
- ".exe",
23
- ".dll",
24
- ".so",
25
- ".dylib"
26
- ];
27
- constructor(fileSystem, templateService) {
28
- this.fileSystem = fileSystem;
29
- this.templateService = templateService;
30
- }
31
- async processFilesForVariableReplacement(dirPath, variables) {
32
- let items = [];
33
- try {
34
- items = await this.fileSystem.readdir(dirPath);
35
- } catch (error) {
36
- __agiflowai_aicode_utils.log.warn(`Skipping directory ${dirPath}: ${error}`);
37
- return;
38
- }
39
- for (const item of items) {
40
- if (!item) continue;
41
- const itemPath = node_path.default.join(dirPath, item);
42
- try {
43
- const stat = await this.fileSystem.stat(itemPath);
44
- if (stat.isDirectory()) await this.processFilesForVariableReplacement(itemPath, variables);
45
- else if (stat.isFile()) await this.replaceVariablesInFile(itemPath, variables);
46
- } catch (error) {
47
- __agiflowai_aicode_utils.log.warn(`Skipping item ${itemPath}: ${error}`);
48
- }
49
- }
50
- }
51
- async replaceVariablesInFile(filePath, variables) {
52
- try {
53
- if (this.isBinaryFile(filePath)) return;
54
- const content = await this.fileSystem.readFile(filePath, "utf8");
55
- const renderedContent = this.templateService.renderString(content, variables);
56
- await this.fileSystem.writeFile(filePath, renderedContent, "utf8");
57
- } catch (error) {
58
- __agiflowai_aicode_utils.log.warn(`Skipping file ${filePath}: ${error}`);
59
- }
60
- }
61
- isBinaryFile(filePath) {
62
- const ext = node_path.default.extname(filePath).toLowerCase();
63
- return this.binaryExtensions.includes(ext);
64
- }
65
- };
66
-
67
- //#endregion
68
- Object.defineProperty(exports, 'VariableReplacementService', {
69
- enumerable: true,
70
- get: function () {
71
- return VariableReplacementService;
72
- }
73
- });
@@ -1,3 +0,0 @@
1
- const require_VariableReplacementService = require('./VariableReplacementService-DNYx0Dym.cjs');
2
-
3
- exports.VariableReplacementService = require_VariableReplacementService.VariableReplacementService;
@@ -1,34 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
-
29
- Object.defineProperty(exports, '__toESM', {
30
- enumerable: true,
31
- get: function () {
32
- return __toESM;
33
- }
34
- });