@vfarcic/dot-ai 0.53.0 → 0.54.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.
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +20 -11
- package/dist/tools/index.d.ts +6 -6
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/prompts.d.ts +1 -1
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/prompts.js +20 -20
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAwDtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAa;gBAEzB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe;IA6BjD;;OAEG;IACH,OAAO,CAAC,aAAa;IAmKrB;;OAEG;IACH,OAAO,CAAC,eAAe;IAqCvB,OAAO,CAAC,iBAAiB;IAInB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,OAAO,IAAI,OAAO;CAGnB"}
|
package/dist/interfaces/mcp.js
CHANGED
|
@@ -32,17 +32,17 @@ class MCPServer {
|
|
|
32
32
|
// Create McpServer instance
|
|
33
33
|
this.server = new mcp_js_1.McpServer({
|
|
34
34
|
name: config.name,
|
|
35
|
-
version: config.version
|
|
35
|
+
version: config.version,
|
|
36
36
|
}, {
|
|
37
37
|
capabilities: {
|
|
38
38
|
tools: {},
|
|
39
|
-
prompts: {}
|
|
40
|
-
}
|
|
39
|
+
prompts: {},
|
|
40
|
+
},
|
|
41
41
|
});
|
|
42
42
|
this.logger.info('Initializing MCP Server', {
|
|
43
43
|
name: config.name,
|
|
44
44
|
version: config.version,
|
|
45
|
-
author: config.author
|
|
45
|
+
author: config.author,
|
|
46
46
|
});
|
|
47
47
|
// Register all tools and prompts directly with McpServer
|
|
48
48
|
this.registerTools();
|
|
@@ -55,7 +55,9 @@ class MCPServer {
|
|
|
55
55
|
// Register recommend tool
|
|
56
56
|
this.server.tool(recommend_1.RECOMMEND_TOOL_NAME, recommend_1.RECOMMEND_TOOL_DESCRIPTION, recommend_1.RECOMMEND_TOOL_INPUT_SCHEMA, async (args) => {
|
|
57
57
|
const requestId = this.generateRequestId();
|
|
58
|
-
this.logger.info(`Processing ${recommend_1.RECOMMEND_TOOL_NAME} tool request`, {
|
|
58
|
+
this.logger.info(`Processing ${recommend_1.RECOMMEND_TOOL_NAME} tool request`, {
|
|
59
|
+
requestId,
|
|
60
|
+
});
|
|
59
61
|
return await (0, recommend_1.handleRecommendTool)(args, this.dotAI, this.logger, requestId);
|
|
60
62
|
});
|
|
61
63
|
// Register chooseSolution tool
|
|
@@ -85,13 +87,17 @@ class MCPServer {
|
|
|
85
87
|
// Register version tool
|
|
86
88
|
this.server.tool(version_1.VERSION_TOOL_NAME, version_1.VERSION_TOOL_DESCRIPTION, version_1.VERSION_TOOL_INPUT_SCHEMA, async (args) => {
|
|
87
89
|
const requestId = this.generateRequestId();
|
|
88
|
-
this.logger.info(`Processing ${version_1.VERSION_TOOL_NAME} tool request`, {
|
|
90
|
+
this.logger.info(`Processing ${version_1.VERSION_TOOL_NAME} tool request`, {
|
|
91
|
+
requestId,
|
|
92
|
+
});
|
|
89
93
|
return await (0, version_1.handleVersionTool)(args, this.logger, requestId);
|
|
90
94
|
});
|
|
91
95
|
// Register testDocs tool
|
|
92
96
|
this.server.tool(test_docs_1.TESTDOCS_TOOL_NAME, test_docs_1.TESTDOCS_TOOL_DESCRIPTION, test_docs_1.TESTDOCS_TOOL_INPUT_SCHEMA, async (args) => {
|
|
93
97
|
const requestId = this.generateRequestId();
|
|
94
|
-
this.logger.info(`Processing ${test_docs_1.TESTDOCS_TOOL_NAME} tool request`, {
|
|
98
|
+
this.logger.info(`Processing ${test_docs_1.TESTDOCS_TOOL_NAME} tool request`, {
|
|
99
|
+
requestId,
|
|
100
|
+
});
|
|
95
101
|
return await (0, test_docs_1.handleTestDocsTool)(args, null, this.logger, requestId);
|
|
96
102
|
});
|
|
97
103
|
// Register organizational-data tool
|
|
@@ -109,9 +115,9 @@ class MCPServer {
|
|
|
109
115
|
deploy_manifests_1.DEPLOYMANIFESTS_TOOL_NAME,
|
|
110
116
|
version_1.VERSION_TOOL_NAME,
|
|
111
117
|
test_docs_1.TESTDOCS_TOOL_NAME,
|
|
112
|
-
organizational_data_1.ORGANIZATIONAL_DATA_TOOL_NAME
|
|
118
|
+
organizational_data_1.ORGANIZATIONAL_DATA_TOOL_NAME,
|
|
113
119
|
],
|
|
114
|
-
totalTools: 8
|
|
120
|
+
totalTools: 8,
|
|
115
121
|
});
|
|
116
122
|
}
|
|
117
123
|
/**
|
|
@@ -127,11 +133,14 @@ class MCPServer {
|
|
|
127
133
|
// Register prompts/get handler
|
|
128
134
|
this.server.server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request) => {
|
|
129
135
|
const requestId = this.generateRequestId();
|
|
130
|
-
this.logger.info('Processing prompts/get request', {
|
|
136
|
+
this.logger.info('Processing prompts/get request', {
|
|
137
|
+
requestId,
|
|
138
|
+
promptName: request.params?.name,
|
|
139
|
+
});
|
|
131
140
|
return await (0, prompts_1.handlePromptsGetRequest)(request.params || {}, this.logger, requestId);
|
|
132
141
|
});
|
|
133
142
|
this.logger.info('Registered prompts capability with McpServer', {
|
|
134
|
-
endpoints: ['prompts/list', 'prompts/get']
|
|
143
|
+
endpoints: ['prompts/list', 'prompts/get'],
|
|
135
144
|
});
|
|
136
145
|
}
|
|
137
146
|
generateRequestId() {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Centralized exports for all available tools (direct handlers)
|
|
5
5
|
*/
|
|
6
|
-
export { RECOMMEND_TOOL_NAME, RECOMMEND_TOOL_DESCRIPTION, RECOMMEND_TOOL_INPUT_SCHEMA, handleRecommendTool } from './recommend';
|
|
7
|
-
export { CHOOSESOLUTION_TOOL_NAME, CHOOSESOLUTION_TOOL_DESCRIPTION, CHOOSESOLUTION_TOOL_INPUT_SCHEMA, handleChooseSolutionTool } from './choose-solution';
|
|
8
|
-
export { ANSWERQUESTION_TOOL_NAME, ANSWERQUESTION_TOOL_DESCRIPTION, ANSWERQUESTION_TOOL_INPUT_SCHEMA, handleAnswerQuestionTool } from './answer-question';
|
|
9
|
-
export { GENERATEMANIFESTS_TOOL_NAME, GENERATEMANIFESTS_TOOL_DESCRIPTION, GENERATEMANIFESTS_TOOL_INPUT_SCHEMA, handleGenerateManifestsTool } from './generate-manifests';
|
|
10
|
-
export { DEPLOYMANIFESTS_TOOL_NAME, DEPLOYMANIFESTS_TOOL_DESCRIPTION, DEPLOYMANIFESTS_TOOL_INPUT_SCHEMA, handleDeployManifestsTool } from './deploy-manifests';
|
|
11
|
-
export { ORGANIZATIONAL_DATA_TOOL_NAME, ORGANIZATIONAL_DATA_TOOL_DESCRIPTION, ORGANIZATIONAL_DATA_TOOL_INPUT_SCHEMA, handleOrganizationalDataTool } from './organizational-data';
|
|
6
|
+
export { RECOMMEND_TOOL_NAME, RECOMMEND_TOOL_DESCRIPTION, RECOMMEND_TOOL_INPUT_SCHEMA, handleRecommendTool, } from './recommend';
|
|
7
|
+
export { CHOOSESOLUTION_TOOL_NAME, CHOOSESOLUTION_TOOL_DESCRIPTION, CHOOSESOLUTION_TOOL_INPUT_SCHEMA, handleChooseSolutionTool, } from './choose-solution';
|
|
8
|
+
export { ANSWERQUESTION_TOOL_NAME, ANSWERQUESTION_TOOL_DESCRIPTION, ANSWERQUESTION_TOOL_INPUT_SCHEMA, handleAnswerQuestionTool, } from './answer-question';
|
|
9
|
+
export { GENERATEMANIFESTS_TOOL_NAME, GENERATEMANIFESTS_TOOL_DESCRIPTION, GENERATEMANIFESTS_TOOL_INPUT_SCHEMA, handleGenerateManifestsTool, } from './generate-manifests';
|
|
10
|
+
export { DEPLOYMANIFESTS_TOOL_NAME, DEPLOYMANIFESTS_TOOL_DESCRIPTION, DEPLOYMANIFESTS_TOOL_INPUT_SCHEMA, handleDeployManifestsTool, } from './deploy-manifests';
|
|
11
|
+
export { ORGANIZATIONAL_DATA_TOOL_NAME, ORGANIZATIONAL_DATA_TOOL_DESCRIPTION, ORGANIZATIONAL_DATA_TOOL_INPUT_SCHEMA, handleOrganizationalDataTool, } from './organizational-data';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC"}
|
package/dist/tools/prompts.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare function loadPromptFile(filePath: string): Prompt;
|
|
|
19
19
|
/**
|
|
20
20
|
* Loads all prompts from the shared-prompts directory
|
|
21
21
|
*/
|
|
22
|
-
export declare function loadAllPrompts(logger: Logger): Prompt[];
|
|
22
|
+
export declare function loadAllPrompts(logger: Logger, baseDir?: string): Prompt[];
|
|
23
23
|
/**
|
|
24
24
|
* Handle prompts/list MCP request
|
|
25
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/tools/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/tools/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAOhD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA4CvD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAoCzE;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAsCd;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAoEd"}
|
package/dist/tools/prompts.js
CHANGED
|
@@ -73,7 +73,7 @@ function loadPromptFile(filePath) {
|
|
|
73
73
|
return {
|
|
74
74
|
name: metadata.name,
|
|
75
75
|
description: metadata.description,
|
|
76
|
-
content: promptContent.trim()
|
|
76
|
+
content: promptContent.trim(),
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
catch (error) {
|
|
@@ -83,9 +83,9 @@ function loadPromptFile(filePath) {
|
|
|
83
83
|
/**
|
|
84
84
|
* Loads all prompts from the shared-prompts directory
|
|
85
85
|
*/
|
|
86
|
-
function loadAllPrompts(logger) {
|
|
86
|
+
function loadAllPrompts(logger, baseDir) {
|
|
87
87
|
try {
|
|
88
|
-
const promptsDir = path.join(
|
|
88
|
+
const promptsDir = baseDir ?? path.join(__dirname, '..', '..', 'shared-prompts');
|
|
89
89
|
if (!fs.existsSync(promptsDir)) {
|
|
90
90
|
logger.warn('Shared prompts directory not found', { path: promptsDir });
|
|
91
91
|
return [];
|
|
@@ -106,7 +106,7 @@ function loadAllPrompts(logger) {
|
|
|
106
106
|
}
|
|
107
107
|
logger.info('Loaded prompts from shared library', {
|
|
108
108
|
total: prompts.length,
|
|
109
|
-
promptsDir
|
|
109
|
+
promptsDir,
|
|
110
110
|
});
|
|
111
111
|
return prompts;
|
|
112
112
|
}
|
|
@@ -121,18 +121,18 @@ function loadAllPrompts(logger) {
|
|
|
121
121
|
async function handlePromptsListRequest(args, logger, requestId) {
|
|
122
122
|
try {
|
|
123
123
|
logger.info('Processing prompts/list request', { requestId });
|
|
124
|
-
const prompts = loadAllPrompts(logger);
|
|
124
|
+
const prompts = loadAllPrompts(logger, process.env.NODE_ENV === 'test' ? args?.baseDir : undefined);
|
|
125
125
|
// Convert to MCP prompts/list response format
|
|
126
126
|
const promptList = prompts.map(prompt => ({
|
|
127
127
|
name: prompt.name,
|
|
128
|
-
description: prompt.description
|
|
128
|
+
description: prompt.description,
|
|
129
129
|
}));
|
|
130
130
|
logger.info('Prompts list generated', {
|
|
131
131
|
requestId,
|
|
132
|
-
promptCount: promptList.length
|
|
132
|
+
promptCount: promptList.length,
|
|
133
133
|
});
|
|
134
134
|
return {
|
|
135
|
-
prompts: promptList
|
|
135
|
+
prompts: promptList,
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
catch (error) {
|
|
@@ -141,7 +141,7 @@ async function handlePromptsListRequest(args, logger, requestId) {
|
|
|
141
141
|
operation: 'prompts_list',
|
|
142
142
|
component: 'PromptsHandler',
|
|
143
143
|
requestId,
|
|
144
|
-
input: args
|
|
144
|
+
input: args,
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -152,36 +152,36 @@ async function handlePromptsGetRequest(args, logger, requestId) {
|
|
|
152
152
|
try {
|
|
153
153
|
logger.info('Processing prompts/get request', {
|
|
154
154
|
requestId,
|
|
155
|
-
promptName: args.name
|
|
155
|
+
promptName: args.name,
|
|
156
156
|
});
|
|
157
157
|
if (!args.name) {
|
|
158
158
|
throw new Error('Missing required parameter: name');
|
|
159
159
|
}
|
|
160
|
-
const prompts = loadAllPrompts(logger);
|
|
160
|
+
const prompts = loadAllPrompts(logger, process.env.NODE_ENV === 'test' ? args?.baseDir : undefined);
|
|
161
161
|
const prompt = prompts.find(p => p.name === args.name);
|
|
162
162
|
if (!prompt) {
|
|
163
163
|
throw error_handling_1.ErrorHandler.createError(error_handling_1.ErrorCategory.VALIDATION, error_handling_1.ErrorSeverity.MEDIUM, `Prompt not found: ${args.name}`, {
|
|
164
164
|
operation: 'prompts_get',
|
|
165
165
|
component: 'PromptsHandler',
|
|
166
|
-
requestId
|
|
166
|
+
requestId,
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
logger.info('Prompt found and returned', {
|
|
170
170
|
requestId,
|
|
171
|
-
promptName: prompt.name
|
|
171
|
+
promptName: prompt.name,
|
|
172
172
|
});
|
|
173
173
|
// Convert to MCP prompts/get response format
|
|
174
174
|
return {
|
|
175
175
|
description: prompt.description,
|
|
176
176
|
messages: [
|
|
177
177
|
{
|
|
178
|
-
role:
|
|
178
|
+
role: 'user',
|
|
179
179
|
content: {
|
|
180
|
-
type:
|
|
181
|
-
text: prompt.content
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
]
|
|
180
|
+
type: 'text',
|
|
181
|
+
text: prompt.content,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
catch (error) {
|
|
@@ -194,7 +194,7 @@ async function handlePromptsGetRequest(args, logger, requestId) {
|
|
|
194
194
|
operation: 'prompts_get',
|
|
195
195
|
component: 'PromptsHandler',
|
|
196
196
|
requestId,
|
|
197
|
-
input: args
|
|
197
|
+
input: args,
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
}
|