@agiflowai/scaffold-mcp 1.0.9 → 1.0.11
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.
- package/dist/{ListScaffoldingMethodsTool-BLTCwsd1.mjs → ListScaffoldingMethodsTool-B49G_iLj.mjs} +1 -1
- package/dist/{ListScaffoldingMethodsTool-9bLDuvy1.cjs → ListScaffoldingMethodsTool-DuYGFDwJ.cjs} +1 -1
- package/dist/{ScaffoldService-S6ggnyvn.cjs → ScaffoldService-DSQBnAHm.cjs} +3 -1
- package/dist/{ScaffoldService-CgYunbKN.mjs → ScaffoldService-DcsGLMuD.mjs} +3 -1
- package/dist/ScaffoldService-DfXjmrNT.cjs +3 -0
- package/dist/ScaffoldService-dL74anIv.mjs +3 -0
- package/dist/cli.cjs +127 -33
- package/dist/cli.mjs +127 -33
- package/dist/index.cjs +4 -139
- package/dist/index.d.cts +1 -39
- package/dist/index.d.mts +1 -39
- package/dist/index.mjs +4 -132
- package/dist/{stdio-DovjJsGY.mjs → stdio-AbTm52SJ.mjs} +2 -2
- package/dist/{stdio-BjCeL-i_.cjs → stdio-baUp7xGL.cjs} +2 -2
- package/dist/{useScaffoldMethod-CsBTssSw.mjs → useScaffoldMethod-BMWhFebp.mjs} +14 -4
- package/dist/{useScaffoldMethod-CHJAsgA2.mjs → useScaffoldMethod-CPgJIBHx.mjs} +14 -4
- package/dist/{useScaffoldMethod-DfG9reER.cjs → useScaffoldMethod-CcrpFEPv.cjs} +14 -4
- package/dist/{useScaffoldMethod-FvOmyD91.cjs → useScaffoldMethod-DOvwnNOJ.cjs} +14 -4
- package/package.json +7 -7
- package/dist/ScaffoldService-BCjJE9yK.mjs +0 -3
- package/dist/ScaffoldService-ybJPks4R.cjs +0 -3
package/dist/index.d.mts
CHANGED
|
@@ -795,42 +795,4 @@ interface Tool {
|
|
|
795
795
|
execute: (args: unknown) => Promise<string>;
|
|
796
796
|
}
|
|
797
797
|
//#endregion
|
|
798
|
-
|
|
799
|
-
/**
|
|
800
|
-
* Find the workspace root by searching upwards for .git folder
|
|
801
|
-
* Returns null if no .git folder is found (indicating a new project setup is needed)
|
|
802
|
-
*/
|
|
803
|
-
declare function findWorkspaceRoot(startPath?: string): Promise<string | null>;
|
|
804
|
-
/**
|
|
805
|
-
* Parse GitHub URL to detect if it's a subdirectory
|
|
806
|
-
* Supports formats:
|
|
807
|
-
* - https://github.com/user/repo
|
|
808
|
-
* - https://github.com/user/repo/tree/branch/path/to/dir
|
|
809
|
-
* - https://github.com/user/repo/tree/main/path/to/dir
|
|
810
|
-
*/
|
|
811
|
-
declare function parseGitHubUrl(url: string): {
|
|
812
|
-
owner?: string;
|
|
813
|
-
repo?: string;
|
|
814
|
-
repoUrl: string;
|
|
815
|
-
branch?: string;
|
|
816
|
-
subdirectory?: string;
|
|
817
|
-
isSubdirectory: boolean;
|
|
818
|
-
};
|
|
819
|
-
/**
|
|
820
|
-
* Clone a subdirectory from a git repository using sparse checkout
|
|
821
|
-
*/
|
|
822
|
-
declare function cloneSubdirectory(repoUrl: string, branch: string, subdirectory: string, targetFolder: string): Promise<void>;
|
|
823
|
-
/**
|
|
824
|
-
* Clone entire repository
|
|
825
|
-
*/
|
|
826
|
-
declare function cloneRepository(repoUrl: string, targetFolder: string): Promise<void>;
|
|
827
|
-
/**
|
|
828
|
-
* Fetch directory listing from GitHub API
|
|
829
|
-
*/
|
|
830
|
-
declare function fetchGitHubDirectoryContents(owner: string, repo: string, path: string, branch?: string): Promise<Array<{
|
|
831
|
-
name: string;
|
|
832
|
-
type: string;
|
|
833
|
-
path: string;
|
|
834
|
-
}>>;
|
|
835
|
-
//#endregion
|
|
836
|
-
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 };
|
|
798
|
+
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, scaffoldArgsSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,136 +1,8 @@
|
|
|
1
|
-
import { a as UseScaffoldMethodTool, c as GenerateFeatureScaffoldTool, d as ScaffoldGeneratorService, f as BoilerplateService, i as WriteToFileTool, l as GenerateBoilerplateTool, n as SseTransportHandler, o as UseBoilerplateTool, p as BoilerplateGeneratorService, r as HttpTransportHandler, s as ListBoilerplatesTool, t as StdioTransportHandler, u as GenerateBoilerplateFileTool } from "./stdio-
|
|
2
|
-
import { n as ScaffoldingMethodsService, r as FileSystemService, t as ListScaffoldingMethodsTool } from "./ListScaffoldingMethodsTool-
|
|
1
|
+
import { a as UseScaffoldMethodTool, c as GenerateFeatureScaffoldTool, d as ScaffoldGeneratorService, f as BoilerplateService, i as WriteToFileTool, l as GenerateBoilerplateTool, n as SseTransportHandler, o as UseBoilerplateTool, p as BoilerplateGeneratorService, r as HttpTransportHandler, s as ListBoilerplatesTool, t as StdioTransportHandler, u as GenerateBoilerplateFileTool } from "./stdio-AbTm52SJ.mjs";
|
|
2
|
+
import { n as ScaffoldingMethodsService, r as FileSystemService, t as ListScaffoldingMethodsTool } from "./ListScaffoldingMethodsTool-B49G_iLj.mjs";
|
|
3
3
|
import { t as ScaffoldConfigLoader } from "./ScaffoldConfigLoader-8YI7v2GJ.mjs";
|
|
4
|
-
import { n as ScaffoldProcessingService, t as ScaffoldService } from "./ScaffoldService-
|
|
4
|
+
import { n as ScaffoldProcessingService, t as ScaffoldService } from "./ScaffoldService-DcsGLMuD.mjs";
|
|
5
5
|
import { t as TemplateService } from "./TemplateService-CVDL2uqt.mjs";
|
|
6
6
|
import { t as VariableReplacementService } from "./VariableReplacementService-B9RA8D0a.mjs";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
import { move, pathExists, remove, writeFile } from "@agiflowai/aicode-utils";
|
|
9
|
-
import { execa } from "execa";
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Execute a git command safely using execa to prevent command injection
|
|
14
|
-
*/
|
|
15
|
-
async function execGit(args, cwd) {
|
|
16
|
-
try {
|
|
17
|
-
await execa("git", args, { cwd });
|
|
18
|
-
} catch (error) {
|
|
19
|
-
const execaError = error;
|
|
20
|
-
throw new Error(`Git command failed: ${execaError.stderr || execaError.message}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Find the workspace root by searching upwards for .git folder
|
|
25
|
-
* Returns null if no .git folder is found (indicating a new project setup is needed)
|
|
26
|
-
*/
|
|
27
|
-
async function findWorkspaceRoot(startPath = process.cwd()) {
|
|
28
|
-
let currentPath = path.resolve(startPath);
|
|
29
|
-
const rootPath = path.parse(currentPath).root;
|
|
30
|
-
while (true) {
|
|
31
|
-
if (await pathExists(path.join(currentPath, ".git"))) return currentPath;
|
|
32
|
-
if (currentPath === rootPath) return null;
|
|
33
|
-
currentPath = path.dirname(currentPath);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Parse GitHub URL to detect if it's a subdirectory
|
|
38
|
-
* Supports formats:
|
|
39
|
-
* - https://github.com/user/repo
|
|
40
|
-
* - https://github.com/user/repo/tree/branch/path/to/dir
|
|
41
|
-
* - https://github.com/user/repo/tree/main/path/to/dir
|
|
42
|
-
*/
|
|
43
|
-
function parseGitHubUrl(url) {
|
|
44
|
-
const treeMatch = url.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)\/(.+)$/);
|
|
45
|
-
const blobMatch = url.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/blob\/([^/]+)\/(.+)$/);
|
|
46
|
-
const rootMatch = url.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
47
|
-
if (treeMatch || blobMatch) {
|
|
48
|
-
const match = treeMatch || blobMatch;
|
|
49
|
-
return {
|
|
50
|
-
owner: match?.[1],
|
|
51
|
-
repo: match?.[2],
|
|
52
|
-
repoUrl: `https://github.com/${match?.[1]}/${match?.[2]}.git`,
|
|
53
|
-
branch: match?.[3],
|
|
54
|
-
subdirectory: match?.[4],
|
|
55
|
-
isSubdirectory: true
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
if (rootMatch) return {
|
|
59
|
-
owner: rootMatch[1],
|
|
60
|
-
repo: rootMatch[2],
|
|
61
|
-
repoUrl: `https://github.com/${rootMatch[1]}/${rootMatch[2]}.git`,
|
|
62
|
-
isSubdirectory: false
|
|
63
|
-
};
|
|
64
|
-
return {
|
|
65
|
-
repoUrl: url,
|
|
66
|
-
isSubdirectory: false
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Clone a subdirectory from a git repository using sparse checkout
|
|
71
|
-
*/
|
|
72
|
-
async function cloneSubdirectory(repoUrl, branch, subdirectory, targetFolder) {
|
|
73
|
-
const tempFolder = `${targetFolder}.tmp`;
|
|
74
|
-
try {
|
|
75
|
-
await execGit(["init", tempFolder]);
|
|
76
|
-
await execGit([
|
|
77
|
-
"remote",
|
|
78
|
-
"add",
|
|
79
|
-
"origin",
|
|
80
|
-
repoUrl
|
|
81
|
-
], tempFolder);
|
|
82
|
-
await execGit([
|
|
83
|
-
"config",
|
|
84
|
-
"core.sparseCheckout",
|
|
85
|
-
"true"
|
|
86
|
-
], tempFolder);
|
|
87
|
-
await writeFile(path.join(tempFolder, ".git", "info", "sparse-checkout"), `${subdirectory}\n`);
|
|
88
|
-
await execGit([
|
|
89
|
-
"pull",
|
|
90
|
-
"--depth=1",
|
|
91
|
-
"origin",
|
|
92
|
-
branch
|
|
93
|
-
], tempFolder);
|
|
94
|
-
const sourceDir = path.join(tempFolder, subdirectory);
|
|
95
|
-
if (!await pathExists(sourceDir)) throw new Error(`Subdirectory '${subdirectory}' not found in repository at branch '${branch}'`);
|
|
96
|
-
if (await pathExists(targetFolder)) throw new Error(`Target folder already exists: ${targetFolder}`);
|
|
97
|
-
await move(sourceDir, targetFolder);
|
|
98
|
-
await remove(tempFolder);
|
|
99
|
-
} catch (error) {
|
|
100
|
-
if (await pathExists(tempFolder)) await remove(tempFolder);
|
|
101
|
-
throw error;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Clone entire repository
|
|
106
|
-
*/
|
|
107
|
-
async function cloneRepository(repoUrl, targetFolder) {
|
|
108
|
-
await execGit([
|
|
109
|
-
"clone",
|
|
110
|
-
repoUrl,
|
|
111
|
-
targetFolder
|
|
112
|
-
]);
|
|
113
|
-
const gitFolder = path.join(targetFolder, ".git");
|
|
114
|
-
if (await pathExists(gitFolder)) await remove(gitFolder);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Fetch directory listing from GitHub API
|
|
118
|
-
*/
|
|
119
|
-
async function fetchGitHubDirectoryContents(owner, repo, path$1, branch = "main") {
|
|
120
|
-
const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path$1}?ref=${branch}`;
|
|
121
|
-
const response = await fetch(url, { headers: {
|
|
122
|
-
Accept: "application/vnd.github.v3+json",
|
|
123
|
-
"User-Agent": "scaffold-mcp"
|
|
124
|
-
} });
|
|
125
|
-
if (!response.ok) throw new Error(`Failed to fetch directory contents: ${response.statusText}`);
|
|
126
|
-
const data = await response.json();
|
|
127
|
-
if (!Array.isArray(data)) throw new Error("Expected directory but got file");
|
|
128
|
-
return data.map((item) => ({
|
|
129
|
-
name: item.name,
|
|
130
|
-
type: item.type,
|
|
131
|
-
path: item.path
|
|
132
|
-
}));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
//#endregion
|
|
136
|
-
export { BoilerplateGeneratorService, BoilerplateService, FileSystemService, GenerateBoilerplateFileTool, GenerateBoilerplateTool, GenerateFeatureScaffoldTool, HttpTransportHandler, ListBoilerplatesTool, ListScaffoldingMethodsTool, ScaffoldConfigLoader, ScaffoldGeneratorService, ScaffoldProcessingService, ScaffoldService, ScaffoldingMethodsService, SseTransportHandler, StdioTransportHandler, TemplateService, UseBoilerplateTool, UseScaffoldMethodTool, VariableReplacementService, WriteToFileTool, cloneRepository, cloneSubdirectory, fetchGitHubDirectoryContents, findWorkspaceRoot, parseGitHubUrl };
|
|
8
|
+
export { BoilerplateGeneratorService, BoilerplateService, FileSystemService, GenerateBoilerplateFileTool, GenerateBoilerplateTool, GenerateFeatureScaffoldTool, HttpTransportHandler, ListBoilerplatesTool, ListScaffoldingMethodsTool, ScaffoldConfigLoader, ScaffoldGeneratorService, ScaffoldProcessingService, ScaffoldService, ScaffoldingMethodsService, SseTransportHandler, StdioTransportHandler, TemplateService, UseBoilerplateTool, UseScaffoldMethodTool, VariableReplacementService, WriteToFileTool };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaginationHelper, n as ScaffoldingMethodsService, r as FileSystemService } from "./ListScaffoldingMethodsTool-
|
|
1
|
+
import { i as PaginationHelper, n as ScaffoldingMethodsService, r as FileSystemService } from "./ListScaffoldingMethodsTool-B49G_iLj.mjs";
|
|
2
2
|
import { t as ScaffoldConfigLoader } from "./ScaffoldConfigLoader-8YI7v2GJ.mjs";
|
|
3
|
-
import { t as ScaffoldService } from "./ScaffoldService-
|
|
3
|
+
import { t as ScaffoldService } from "./ScaffoldService-DcsGLMuD.mjs";
|
|
4
4
|
import { t as TemplateService } from "./TemplateService-CVDL2uqt.mjs";
|
|
5
5
|
import { t as VariableReplacementService } from "./VariableReplacementService-B9RA8D0a.mjs";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
-
const require_ListScaffoldingMethodsTool = require('./ListScaffoldingMethodsTool-
|
|
2
|
+
const require_ListScaffoldingMethodsTool = require('./ListScaffoldingMethodsTool-DuYGFDwJ.cjs');
|
|
3
3
|
const require_ScaffoldConfigLoader = require('./ScaffoldConfigLoader-BWpNpMx-.cjs');
|
|
4
|
-
const require_ScaffoldService = require('./ScaffoldService-
|
|
4
|
+
const require_ScaffoldService = require('./ScaffoldService-DSQBnAHm.cjs');
|
|
5
5
|
const require_TemplateService = require('./TemplateService-7QcWREot.cjs');
|
|
6
6
|
const require_VariableReplacementService = require('./VariableReplacementService-DNYx0Dym.cjs');
|
|
7
7
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ListScaffoldingMethodsTool } from "./ListScaffoldingMethodsTool-
|
|
1
|
+
import { t as ListScaffoldingMethodsTool } from "./ListScaffoldingMethodsTool-B49G_iLj.mjs";
|
|
2
2
|
import "./TemplateService-CVDL2uqt.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { ProjectFinderService, TemplatesManagerService } from "@agiflowai/aicode-utils";
|
|
@@ -37,16 +37,26 @@ var UseScaffoldMethodHook = class {
|
|
|
37
37
|
decision: DECISION_SKIP,
|
|
38
38
|
message: "Scaffolding methods already provided for this file"
|
|
39
39
|
};
|
|
40
|
-
const
|
|
40
|
+
const templatesPath = await TemplatesManagerService.findTemplatesPath();
|
|
41
|
+
if (!templatesPath) return {
|
|
42
|
+
decision: DECISION_SKIP,
|
|
43
|
+
message: "Templates folder not found - skipping scaffold method check"
|
|
44
|
+
};
|
|
45
|
+
const tool = new ListScaffoldingMethodsTool(templatesPath, false);
|
|
41
46
|
const projectFinder = new ProjectFinderService(await TemplatesManagerService.getWorkspaceRoot(context.cwd));
|
|
42
47
|
const absoluteFilePath = path.isAbsolute(filePath) ? filePath : path.join(context.cwd, filePath);
|
|
43
48
|
const projectPath = (await projectFinder.findProjectForFile(absoluteFilePath))?.root || context.cwd;
|
|
44
49
|
const result = await tool.execute({ projectPath });
|
|
50
|
+
const firstContent = result.content[0];
|
|
51
|
+
if (firstContent?.type !== "text") return {
|
|
52
|
+
decision: DECISION_SKIP,
|
|
53
|
+
message: "⚠️ Unexpected response type from scaffolding methods tool"
|
|
54
|
+
};
|
|
45
55
|
if (result.isError) return {
|
|
46
56
|
decision: DECISION_SKIP,
|
|
47
|
-
message: `⚠️ Could not load scaffolding methods: ${
|
|
57
|
+
message: `⚠️ Could not load scaffolding methods: ${firstContent.text}`
|
|
48
58
|
};
|
|
49
|
-
const resultText =
|
|
59
|
+
const resultText = firstContent.text;
|
|
50
60
|
if (typeof resultText !== "string") return {
|
|
51
61
|
decision: DECISION_SKIP,
|
|
52
62
|
message: "⚠️ Invalid response format from scaffolding methods tool"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ListScaffoldingMethodsTool } from "./ListScaffoldingMethodsTool-
|
|
1
|
+
import { t as ListScaffoldingMethodsTool } from "./ListScaffoldingMethodsTool-B49G_iLj.mjs";
|
|
2
2
|
import "./TemplateService-CVDL2uqt.mjs";
|
|
3
3
|
import { TemplatesManagerService } from "@agiflowai/aicode-utils";
|
|
4
4
|
import { DECISION_ALLOW, DECISION_DENY, DECISION_SKIP, ExecutionLogService } from "@agiflowai/hooks-adapter";
|
|
@@ -37,7 +37,17 @@ var UseScaffoldMethodHook = class {
|
|
|
37
37
|
message: "Scaffolding methods already provided in this session"
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const templatesPath = await TemplatesManagerService.findTemplatesPath();
|
|
41
|
+
if (!templatesPath) return {
|
|
42
|
+
decision: DECISION_SKIP,
|
|
43
|
+
message: "Templates folder not found - skipping scaffold method check"
|
|
44
|
+
};
|
|
45
|
+
const result = await new ListScaffoldingMethodsTool(templatesPath, false).execute(context.tool_input || {});
|
|
46
|
+
const firstContent = result.content[0];
|
|
47
|
+
if (firstContent?.type !== "text") return {
|
|
48
|
+
decision: DECISION_SKIP,
|
|
49
|
+
message: "⚠️ Unexpected response type from scaffolding methods tool"
|
|
50
|
+
};
|
|
41
51
|
if (result.isError) {
|
|
42
52
|
await executionLog.logExecution({
|
|
43
53
|
filePath: sessionKey,
|
|
@@ -46,10 +56,10 @@ var UseScaffoldMethodHook = class {
|
|
|
46
56
|
});
|
|
47
57
|
return {
|
|
48
58
|
decision: DECISION_SKIP,
|
|
49
|
-
message: `⚠️ Could not load scaffolding methods: ${
|
|
59
|
+
message: `⚠️ Could not load scaffolding methods: ${firstContent.text}`
|
|
50
60
|
};
|
|
51
61
|
}
|
|
52
|
-
const resultText =
|
|
62
|
+
const resultText = firstContent.text;
|
|
53
63
|
if (typeof resultText !== "string") return {
|
|
54
64
|
decision: DECISION_SKIP,
|
|
55
65
|
message: "⚠️ Invalid response format from scaffolding methods tool"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
-
const require_ListScaffoldingMethodsTool = require('./ListScaffoldingMethodsTool-
|
|
2
|
+
const require_ListScaffoldingMethodsTool = require('./ListScaffoldingMethodsTool-DuYGFDwJ.cjs');
|
|
3
3
|
require('./TemplateService-7QcWREot.cjs');
|
|
4
4
|
let __agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
|
|
5
5
|
let __agiflowai_hooks_adapter = require("@agiflowai/hooks-adapter");
|
|
@@ -38,7 +38,17 @@ var UseScaffoldMethodHook = class {
|
|
|
38
38
|
message: "Scaffolding methods already provided in this session"
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const templatesPath = await __agiflowai_aicode_utils.TemplatesManagerService.findTemplatesPath();
|
|
42
|
+
if (!templatesPath) return {
|
|
43
|
+
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
44
|
+
message: "Templates folder not found - skipping scaffold method check"
|
|
45
|
+
};
|
|
46
|
+
const result = await new require_ListScaffoldingMethodsTool.ListScaffoldingMethodsTool(templatesPath, false).execute(context.tool_input || {});
|
|
47
|
+
const firstContent = result.content[0];
|
|
48
|
+
if (firstContent?.type !== "text") return {
|
|
49
|
+
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
50
|
+
message: "⚠️ Unexpected response type from scaffolding methods tool"
|
|
51
|
+
};
|
|
42
52
|
if (result.isError) {
|
|
43
53
|
await executionLog.logExecution({
|
|
44
54
|
filePath: sessionKey,
|
|
@@ -47,10 +57,10 @@ var UseScaffoldMethodHook = class {
|
|
|
47
57
|
});
|
|
48
58
|
return {
|
|
49
59
|
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
50
|
-
message: `⚠️ Could not load scaffolding methods: ${
|
|
60
|
+
message: `⚠️ Could not load scaffolding methods: ${firstContent.text}`
|
|
51
61
|
};
|
|
52
62
|
}
|
|
53
|
-
const resultText =
|
|
63
|
+
const resultText = firstContent.text;
|
|
54
64
|
if (typeof resultText !== "string") return {
|
|
55
65
|
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
56
66
|
message: "⚠️ Invalid response format from scaffolding methods tool"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
-
const require_ListScaffoldingMethodsTool = require('./ListScaffoldingMethodsTool-
|
|
2
|
+
const require_ListScaffoldingMethodsTool = require('./ListScaffoldingMethodsTool-DuYGFDwJ.cjs');
|
|
3
3
|
require('./TemplateService-7QcWREot.cjs');
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -41,16 +41,26 @@ var UseScaffoldMethodHook = class {
|
|
|
41
41
|
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
42
42
|
message: "Scaffolding methods already provided for this file"
|
|
43
43
|
};
|
|
44
|
-
const
|
|
44
|
+
const templatesPath = await __agiflowai_aicode_utils.TemplatesManagerService.findTemplatesPath();
|
|
45
|
+
if (!templatesPath) return {
|
|
46
|
+
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
47
|
+
message: "Templates folder not found - skipping scaffold method check"
|
|
48
|
+
};
|
|
49
|
+
const tool = new require_ListScaffoldingMethodsTool.ListScaffoldingMethodsTool(templatesPath, false);
|
|
45
50
|
const projectFinder = new __agiflowai_aicode_utils.ProjectFinderService(await __agiflowai_aicode_utils.TemplatesManagerService.getWorkspaceRoot(context.cwd));
|
|
46
51
|
const absoluteFilePath = node_path.default.isAbsolute(filePath) ? filePath : node_path.default.join(context.cwd, filePath);
|
|
47
52
|
const projectPath = (await projectFinder.findProjectForFile(absoluteFilePath))?.root || context.cwd;
|
|
48
53
|
const result = await tool.execute({ projectPath });
|
|
54
|
+
const firstContent = result.content[0];
|
|
55
|
+
if (firstContent?.type !== "text") return {
|
|
56
|
+
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
57
|
+
message: "⚠️ Unexpected response type from scaffolding methods tool"
|
|
58
|
+
};
|
|
49
59
|
if (result.isError) return {
|
|
50
60
|
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
51
|
-
message: `⚠️ Could not load scaffolding methods: ${
|
|
61
|
+
message: `⚠️ Could not load scaffolding methods: ${firstContent.text}`
|
|
52
62
|
};
|
|
53
|
-
const resultText =
|
|
63
|
+
const resultText = firstContent.text;
|
|
54
64
|
if (typeof resultText !== "string") return {
|
|
55
65
|
decision: __agiflowai_hooks_adapter.DECISION_SKIP,
|
|
56
66
|
message: "⚠️ Invalid response format from scaffolding methods tool"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agiflowai/scaffold-mcp",
|
|
3
3
|
"description": "MCP server for scaffolding applications with boilerplate templates",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.11",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "AgiflowIO",
|
|
7
7
|
"repository": {
|
|
@@ -37,21 +37,21 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@composio/json-schema-to-zod": "0.1.15",
|
|
39
39
|
"@inquirer/prompts": "^7.8.6",
|
|
40
|
-
"@modelcontextprotocol/sdk": "1.
|
|
40
|
+
"@modelcontextprotocol/sdk": "1.24.0",
|
|
41
41
|
"chalk": "5.6.2",
|
|
42
42
|
"commander": "14.0.1",
|
|
43
43
|
"execa": "^9.5.2",
|
|
44
44
|
"express": "^4.21.2",
|
|
45
|
-
"js-yaml": "4.1.
|
|
45
|
+
"js-yaml": "4.1.1",
|
|
46
46
|
"liquidjs": "10.21.1",
|
|
47
47
|
"minimatch": "^10.0.1",
|
|
48
48
|
"pino": "^10.0.0",
|
|
49
49
|
"pino-pretty": "^13.1.1",
|
|
50
50
|
"zod": "3.25.76",
|
|
51
|
-
"@agiflowai/
|
|
52
|
-
"@agiflowai/
|
|
53
|
-
"@agiflowai/coding-agent-bridge": "1.0.
|
|
54
|
-
"@agiflowai/hooks-adapter": "0.0.
|
|
51
|
+
"@agiflowai/aicode-utils": "1.0.9",
|
|
52
|
+
"@agiflowai/architect-mcp": "1.0.11",
|
|
53
|
+
"@agiflowai/coding-agent-bridge": "1.0.10",
|
|
54
|
+
"@agiflowai/hooks-adapter": "0.0.6"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/express": "^5.0.0",
|