@vfarcic/dot-ai 1.4.0 → 1.5.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/core/user-prompts-loader.d.ts.map +1 -1
- package/dist/core/user-prompts-loader.js +95 -8
- package/dist/interfaces/mcp.js +1 -1
- package/dist/interfaces/schemas/index.d.ts +1 -1
- package/dist/interfaces/schemas/index.d.ts.map +1 -1
- package/dist/interfaces/schemas/index.js +3 -2
- package/dist/interfaces/schemas/prompts.d.ts +16 -0
- package/dist/interfaces/schemas/prompts.d.ts.map +1 -1
- package/dist/interfaces/schemas/prompts.js +9 -1
- package/dist/tools/prompts.d.ts +8 -1
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/prompts.js +15 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-prompts-loader.d.ts","sourceRoot":"","sources":["../../src/core/user-prompts-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"user-prompts-loader.d.ts","sourceRoot":"","sources":["../../src/core/user-prompts-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAA8B,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,UAAU,UAAU;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAsB/D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAqB1C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASnE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUzD;AAwOD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,YAAY,GAAE,OAAe,GAC5B,OAAO,CAAC,MAAM,EAAE,CAAC,CA4FnB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,UAAU,GAAG,IAAI,CAE5D"}
|
|
@@ -252,6 +252,60 @@ async function ensureRepository(config, logger, forceRefresh = false) {
|
|
|
252
252
|
// Return path to prompts directory (with optional subPath)
|
|
253
253
|
return config.subPath ? path.join(localPath, config.subPath) : localPath;
|
|
254
254
|
}
|
|
255
|
+
const SKILL_FILE_MAX_BYTES = 5 * 1024 * 1024; // 5 MB per file (before base64 encoding)
|
|
256
|
+
const SKILL_FILENAME = 'SKILL.md';
|
|
257
|
+
/**
|
|
258
|
+
* Recursively collect all files in a skill folder (excluding SKILL.md at root),
|
|
259
|
+
* returning them as base64-encoded PromptFile objects.
|
|
260
|
+
*/
|
|
261
|
+
function collectSkillFiles(dirPath, basePath, logger) {
|
|
262
|
+
const files = [];
|
|
263
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
264
|
+
for (const entry of entries) {
|
|
265
|
+
if (entry.name.startsWith('.'))
|
|
266
|
+
continue;
|
|
267
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
268
|
+
const relativePath = path.relative(basePath, fullPath);
|
|
269
|
+
if (entry.isDirectory()) {
|
|
270
|
+
files.push(...collectSkillFiles(fullPath, basePath, logger));
|
|
271
|
+
}
|
|
272
|
+
else if (entry.isFile()) {
|
|
273
|
+
if (entry.name === SKILL_FILENAME && dirPath === basePath)
|
|
274
|
+
continue;
|
|
275
|
+
const stat = fs.statSync(fullPath);
|
|
276
|
+
if (stat.size > SKILL_FILE_MAX_BYTES) {
|
|
277
|
+
logger.warn('Skill file exceeds size limit, skipping', {
|
|
278
|
+
file: relativePath,
|
|
279
|
+
size: stat.size,
|
|
280
|
+
limit: SKILL_FILE_MAX_BYTES,
|
|
281
|
+
});
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
const content = fs.readFileSync(fullPath);
|
|
285
|
+
files.push({
|
|
286
|
+
path: relativePath,
|
|
287
|
+
content: content.toString('base64'),
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return files;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Load a skill folder (directory containing SKILL.md) as a Prompt with supporting files.
|
|
295
|
+
* Returns null if the directory does not contain SKILL.md.
|
|
296
|
+
*/
|
|
297
|
+
function loadSkillFolder(dirPath, dirName, logger) {
|
|
298
|
+
const skillMdPath = path.join(dirPath, SKILL_FILENAME);
|
|
299
|
+
if (!fs.existsSync(skillMdPath)) {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
const prompt = (0, prompts_1.loadPromptFile)(skillMdPath, 'user', dirName);
|
|
303
|
+
const supportingFiles = collectSkillFiles(dirPath, dirPath, logger);
|
|
304
|
+
if (supportingFiles.length > 0) {
|
|
305
|
+
prompt.files = supportingFiles;
|
|
306
|
+
}
|
|
307
|
+
return prompt;
|
|
308
|
+
}
|
|
255
309
|
/**
|
|
256
310
|
* Load user prompts from the configured git repository
|
|
257
311
|
* Returns empty array if not configured or on error
|
|
@@ -271,24 +325,57 @@ async function loadUserPrompts(logger, forceRefresh = false) {
|
|
|
271
325
|
});
|
|
272
326
|
return [];
|
|
273
327
|
}
|
|
274
|
-
// Load
|
|
275
|
-
const
|
|
276
|
-
const promptFiles = files.filter(file => file.endsWith('.md'));
|
|
328
|
+
// Load flat .md files and skill folders from the prompts directory
|
|
329
|
+
const entries = fs.readdirSync(promptsDir, { withFileTypes: true });
|
|
277
330
|
const prompts = [];
|
|
278
|
-
|
|
331
|
+
const loadedNames = new Set();
|
|
332
|
+
// 1. Load flat .md files (existing behavior)
|
|
333
|
+
const mdFiles = entries.filter(e => e.isFile() && e.name.endsWith('.md'));
|
|
334
|
+
for (const entry of mdFiles) {
|
|
279
335
|
try {
|
|
280
|
-
const filePath = path.join(promptsDir,
|
|
336
|
+
const filePath = path.join(promptsDir, entry.name);
|
|
281
337
|
const prompt = (0, prompts_1.loadPromptFile)(filePath, 'user');
|
|
282
338
|
prompts.push(prompt);
|
|
283
|
-
|
|
339
|
+
loadedNames.add(prompt.name);
|
|
340
|
+
logger.debug('Loaded user prompt', { name: prompt.name, file: entry.name });
|
|
284
341
|
}
|
|
285
342
|
catch (error) {
|
|
286
343
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
287
344
|
logger.warn('Failed to load user prompt file, skipping', {
|
|
288
|
-
file,
|
|
345
|
+
file: entry.name,
|
|
346
|
+
error: errorMessage,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// 2. Load skill folders (directories containing SKILL.md)
|
|
351
|
+
const directories = entries.filter(e => e.isDirectory() && !e.name.startsWith('.'));
|
|
352
|
+
for (const dir of directories) {
|
|
353
|
+
try {
|
|
354
|
+
const dirPath = path.join(promptsDir, dir.name);
|
|
355
|
+
const prompt = loadSkillFolder(dirPath, dir.name, logger);
|
|
356
|
+
if (prompt) {
|
|
357
|
+
if (loadedNames.has(prompt.name)) {
|
|
358
|
+
logger.warn('Skill folder name collision with existing prompt, skipping', {
|
|
359
|
+
name: prompt.name,
|
|
360
|
+
dir: dir.name,
|
|
361
|
+
});
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
prompts.push(prompt);
|
|
365
|
+
loadedNames.add(prompt.name);
|
|
366
|
+
logger.debug('Loaded user skill folder', {
|
|
367
|
+
name: prompt.name,
|
|
368
|
+
dir: dir.name,
|
|
369
|
+
filesCount: prompt.files?.length ?? 0,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
375
|
+
logger.warn('Failed to load skill folder, skipping', {
|
|
376
|
+
dir: dir.name,
|
|
289
377
|
error: errorMessage,
|
|
290
378
|
});
|
|
291
|
-
// Continue with other prompts
|
|
292
379
|
}
|
|
293
380
|
}
|
|
294
381
|
logger.info('Loaded user prompts from repository', {
|
package/dist/interfaces/mcp.js
CHANGED
|
@@ -225,7 +225,7 @@ class MCPServer {
|
|
|
225
225
|
this.server.server.setRequestHandler(types_js_1.ListPromptsRequestSchema, async (request) => {
|
|
226
226
|
const requestId = this.generateRequestId();
|
|
227
227
|
this.logger.info('Processing prompts/list request', { requestId });
|
|
228
|
-
return await (0, prompts_1.handlePromptsListRequest)(request.params
|
|
228
|
+
return await (0, prompts_1.handlePromptsListRequest)({ ...request.params, excludeFileSkills: true }, this.logger, requestId);
|
|
229
229
|
});
|
|
230
230
|
// Register prompts/get handler
|
|
231
231
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- MCP SDK type compatibility
|
|
@@ -16,7 +16,7 @@ export { ResourceKindSchema, ResourceKindsDataSchema, ResourceKindsResponseSchem
|
|
|
16
16
|
export { EventInvolvedObjectSchema, KubernetesEventSchema, EventsDataSchema, EventsResponseSchema, EventsBadRequestErrorSchema, EventsPluginUnavailableErrorSchema, EventsErrorSchema, type EventInvolvedObject, type KubernetesEvent, type EventsData, type EventsResponse, } from './events';
|
|
17
17
|
export { LogsDataSchema, LogsResponseSchema, LogsBadRequestErrorSchema, LogsPluginUnavailableErrorSchema, LogsErrorSchema, type LogsData, type LogsResponse, } from './logs';
|
|
18
18
|
export { SessionMetadataSchema, SessionDataSchema, SessionResponseDataSchema, SessionResponseSchema, SessionNotFoundErrorSchema, SessionRetrievalErrorSchema, type SessionMetadata, type SessionData, type SessionResponseData, type SessionResponse, } from './sessions';
|
|
19
|
-
export { PromptArgumentSchema, PromptInfoSchema, PromptsListDataSchema, PromptsListResponseSchema, PromptMessageSchema, PromptGetDataSchema, PromptGetResponseSchema, PromptGetRequestSchema, PromptNotFoundErrorSchema, PromptValidationErrorSchema, PromptsListErrorSchema, PromptGetErrorSchema, PromptsCacheRefreshDataSchema, PromptsCacheRefreshResponseSchema, PromptsCacheRefreshErrorSchema, type PromptArgument, type PromptInfo, type PromptsListData, type PromptsListResponse, type PromptMessage, type PromptGetData, type PromptGetResponse, type PromptGetRequest, type PromptsCacheRefreshData, type PromptsCacheRefreshResponse, } from './prompts';
|
|
19
|
+
export { PromptArgumentSchema, PromptInfoSchema, PromptsListDataSchema, PromptsListResponseSchema, PromptMessageSchema, PromptFileSchema, PromptGetDataSchema, PromptGetResponseSchema, PromptGetRequestSchema, PromptNotFoundErrorSchema, PromptValidationErrorSchema, PromptsListErrorSchema, PromptGetErrorSchema, PromptsCacheRefreshDataSchema, PromptsCacheRefreshResponseSchema, PromptsCacheRefreshErrorSchema, type PromptArgument, type PromptInfo, type PromptsListData, type PromptsListResponse, type PromptMessage, type PromptFileData, type PromptGetData, type PromptGetResponse, type PromptGetRequest, type PromptsCacheRefreshData, type PromptsCacheRefreshResponse, } from './prompts';
|
|
20
20
|
export { DeleteBySourceDataSchema, DeleteBySourceResponseSchema, DeleteBySourceBadRequestErrorSchema, DeleteBySourcePluginUnavailableErrorSchema, DeleteBySourceErrorSchema, KnowledgeAskRequestSchema, KnowledgeAskSourceSchema, KnowledgeAskChunkSchema, KnowledgeAskDataSchema, KnowledgeAskResponseSchema, KnowledgeAskBadRequestErrorSchema, KnowledgeAskAIUnavailableErrorSchema, KnowledgeAskPluginUnavailableErrorSchema, KnowledgeAskErrorSchema, type DeleteBySourceData, type DeleteBySourceResponse, type KnowledgeAskRequest, type KnowledgeAskSource, type KnowledgeAskChunk, type KnowledgeAskData, type KnowledgeAskResponse, } from './knowledge';
|
|
21
21
|
export { EmbeddingMigrationRequestSchema, CollectionMigrationResultSchema, EmbeddingMigrationDataSchema, EmbeddingMigrationResponseSchema, EmbeddingMigrationBadRequestErrorSchema, EmbeddingMigrationServiceUnavailableErrorSchema, EmbeddingMigrationErrorSchema, type EmbeddingMigrationRequest, type CollectionMigrationResult, type EmbeddingMigrationData, type EmbeddingMigrationResponse, } from './embeddings';
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,+BAA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AC5B,gCAAgC,EAChC,uCAAuC,EACvC,+CAA+C,EAC/C,6BAA6B,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,+BAA+B,EAC/B,2BAA2B,EAC3B,gCAAgC,EAChC,0CAA0C,EAC1C,gCAAgC,EAChC,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,E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12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.ResourceSyncResponseSchema = exports.ResourceSyncDataSchema = exports.ResourceSyncRequestSchema = exports.NamespacesResponseSchema = exports.NamespacesDataSchema = exports.SingleResourceResponseSchema = exports.SingleResourceDataSchema = exports.ResourceListResponseSchema = exports.ResourceListDataSchema = exports.ResourceSearchResponseSchema = exports.ResourceSearchDataSchema = exports.ResourceSummarySchema = exports.ResourceKindsResponseSchema = exports.ResourceKindsDataSchema = exports.ResourceKindSchema = exports.VisualizationInternalErrorSchema = exports.VisualizationServiceUnavailableErrorSchema = exports.VisualizationNotFoundErrorSchema = exports.VisualizationResponseSchema = exports.VisualizationResponseDataSchema = exports.VisualizationSchema = exports.VisualizationContentSchema = exports.BarChartContentSchema = exports.BarChartDataItemSchema = exports.DiffContentSchema = exports.CardsContentSchema = exports.CardItemSchema = exports.TableContentSchema = exports.CodeContentSchema = exports.VisualizationTypeSchema = exports.ToolDiscoveryErrorSchema = exports.ToolExecutionErrorSchema = exports.InvalidToolRequestErrorSchema = exports.ToolNotFoundErrorSchema = exports.ToolExecutionResponseSchema = exports.ToolExecutionDataSchema = exports.ToolDiscoveryResponseSchema = exports.ToolDiscoveryDataSchema = exports.ToolInfoSchema = exports.ToolParameterSchema = exports.createSuccessResponseSchema = exports.InternalServerErrorSchema = exports.ServiceUnavailableErrorSchema = exports.MethodNotAllowedErrorSchema = exports.BadRequestErrorSchema = exports.NotFoundErrorSchema = exports.ErrorResponseSchema = exports.RestApiResponseSchema = exports.ErrorDetailsSchema = exports.MetaSchema = void 0;
|
|
15
|
-
exports.
|
|
16
|
-
exports.EmbeddingMigrationErrorSchema = exports.EmbeddingMigrationServiceUnavailableErrorSchema = exports.EmbeddingMigrationBadRequestErrorSchema = exports.EmbeddingMigrationResponseSchema = exports.EmbeddingMigrationDataSchema = exports.CollectionMigrationResultSchema = exports.EmbeddingMigrationRequestSchema = exports.KnowledgeAskErrorSchema = exports.KnowledgeAskPluginUnavailableErrorSchema = exports.KnowledgeAskAIUnavailableErrorSchema = exports.KnowledgeAskBadRequestErrorSchema = exports.KnowledgeAskResponseSchema = exports.KnowledgeAskDataSchema = void 0;
|
|
15
|
+
exports.KnowledgeAskSourceSchema = exports.KnowledgeAskRequestSchema = exports.DeleteBySourceErrorSchema = exports.DeleteBySourcePluginUnavailableErrorSchema = exports.DeleteBySourceBadRequestErrorSchema = exports.DeleteBySourceResponseSchema = exports.DeleteBySourceDataSchema = exports.PromptsCacheRefreshErrorSchema = exports.PromptsCacheRefreshResponseSchema = exports.PromptsCacheRefreshDataSchema = exports.PromptGetErrorSchema = exports.PromptsListErrorSchema = exports.PromptValidationErrorSchema = exports.PromptNotFoundErrorSchema = exports.PromptGetRequestSchema = exports.PromptGetResponseSchema = exports.PromptGetDataSchema = exports.PromptFileSchema = exports.PromptMessageSchema = exports.PromptsListResponseSchema = exports.PromptsListDataSchema = exports.PromptInfoSchema = exports.PromptArgumentSchema = exports.SessionRetrievalErrorSchema = exports.SessionNotFoundErrorSchema = exports.SessionResponseSchema = exports.SessionResponseDataSchema = exports.SessionDataSchema = exports.SessionMetadataSchema = exports.LogsErrorSchema = exports.LogsPluginUnavailableErrorSchema = exports.LogsBadRequestErrorSchema = exports.LogsResponseSchema = exports.LogsDataSchema = exports.EventsErrorSchema = exports.EventsPluginUnavailableErrorSchema = exports.EventsBadRequestErrorSchema = exports.EventsResponseSchema = exports.EventsDataSchema = exports.KubernetesEventSchema = exports.EventInvolvedObjectSchema = exports.ResourceSyncErrorSchema = exports.NamespacesErrorSchema = exports.SingleResourceErrorSchema = exports.ResourceListErrorSchema = exports.ResourceSearchErrorSchema = exports.ResourceKindsErrorSchema = exports.ResourcePluginUnavailableErrorSchema = exports.ResourceBadRequestErrorSchema = exports.ResourceNotFoundErrorSchema = void 0;
|
|
16
|
+
exports.EmbeddingMigrationErrorSchema = exports.EmbeddingMigrationServiceUnavailableErrorSchema = exports.EmbeddingMigrationBadRequestErrorSchema = exports.EmbeddingMigrationResponseSchema = exports.EmbeddingMigrationDataSchema = exports.CollectionMigrationResultSchema = exports.EmbeddingMigrationRequestSchema = exports.KnowledgeAskErrorSchema = exports.KnowledgeAskPluginUnavailableErrorSchema = exports.KnowledgeAskAIUnavailableErrorSchema = exports.KnowledgeAskBadRequestErrorSchema = exports.KnowledgeAskResponseSchema = exports.KnowledgeAskDataSchema = exports.KnowledgeAskChunkSchema = void 0;
|
|
17
17
|
// Common schemas
|
|
18
18
|
var common_1 = require("./common");
|
|
19
19
|
Object.defineProperty(exports, "MetaSchema", { enumerable: true, get: function () { return common_1.MetaSchema; } });
|
|
@@ -112,6 +112,7 @@ Object.defineProperty(exports, "PromptInfoSchema", { enumerable: true, get: func
|
|
|
112
112
|
Object.defineProperty(exports, "PromptsListDataSchema", { enumerable: true, get: function () { return prompts_1.PromptsListDataSchema; } });
|
|
113
113
|
Object.defineProperty(exports, "PromptsListResponseSchema", { enumerable: true, get: function () { return prompts_1.PromptsListResponseSchema; } });
|
|
114
114
|
Object.defineProperty(exports, "PromptMessageSchema", { enumerable: true, get: function () { return prompts_1.PromptMessageSchema; } });
|
|
115
|
+
Object.defineProperty(exports, "PromptFileSchema", { enumerable: true, get: function () { return prompts_1.PromptFileSchema; } });
|
|
115
116
|
Object.defineProperty(exports, "PromptGetDataSchema", { enumerable: true, get: function () { return prompts_1.PromptGetDataSchema; } });
|
|
116
117
|
Object.defineProperty(exports, "PromptGetResponseSchema", { enumerable: true, get: function () { return prompts_1.PromptGetResponseSchema; } });
|
|
117
118
|
Object.defineProperty(exports, "PromptGetRequestSchema", { enumerable: true, get: function () { return prompts_1.PromptGetRequestSchema; } });
|
|
@@ -78,6 +78,14 @@ export declare const PromptMessageSchema: z.ZodObject<{
|
|
|
78
78
|
}, z.core.$strip>;
|
|
79
79
|
}, z.core.$strip>;
|
|
80
80
|
export type PromptMessage = z.infer<typeof PromptMessageSchema>;
|
|
81
|
+
/**
|
|
82
|
+
* Supporting file for folder-based skills (base64-encoded)
|
|
83
|
+
*/
|
|
84
|
+
export declare const PromptFileSchema: z.ZodObject<{
|
|
85
|
+
path: z.ZodString;
|
|
86
|
+
content: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type PromptFileData = z.infer<typeof PromptFileSchema>;
|
|
81
89
|
/**
|
|
82
90
|
* Prompt get response data
|
|
83
91
|
* POST /api/v1/prompts/:promptName
|
|
@@ -95,6 +103,10 @@ export declare const PromptGetDataSchema: z.ZodObject<{
|
|
|
95
103
|
text: z.ZodString;
|
|
96
104
|
}, z.core.$strip>;
|
|
97
105
|
}, z.core.$strip>>;
|
|
106
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
107
|
+
path: z.ZodString;
|
|
108
|
+
content: z.ZodString;
|
|
109
|
+
}, z.core.$strip>>>;
|
|
98
110
|
}, z.core.$strip>;
|
|
99
111
|
export type PromptGetData = z.infer<typeof PromptGetDataSchema>;
|
|
100
112
|
export declare const PromptGetResponseSchema: z.ZodObject<{
|
|
@@ -112,6 +124,10 @@ export declare const PromptGetResponseSchema: z.ZodObject<{
|
|
|
112
124
|
text: z.ZodString;
|
|
113
125
|
}, z.core.$strip>;
|
|
114
126
|
}, z.core.$strip>>;
|
|
127
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
128
|
+
path: z.ZodString;
|
|
129
|
+
content: z.ZodString;
|
|
130
|
+
}, z.core.$strip>>>;
|
|
115
131
|
}, z.core.$strip>;
|
|
116
132
|
meta: z.ZodOptional<z.ZodObject<{
|
|
117
133
|
timestamp: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/interfaces/schemas/prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH,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AuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;iBAA6D,CAAC;AAE5G,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;iBAMzC,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PromptsCacheRefreshErrorSchema = exports.PromptsCacheRefreshResponseSchema = exports.PromptsCacheRefreshDataSchema = exports.PromptGetErrorSchema = exports.PromptsListErrorSchema = exports.PromptValidationErrorSchema = exports.PromptNotFoundErrorSchema = exports.PromptGetRequestSchema = exports.PromptGetResponseSchema = exports.PromptGetDataSchema = exports.PromptMessageSchema = exports.PromptsListResponseSchema = exports.PromptsListDataSchema = exports.PromptInfoSchema = exports.PromptArgumentSchema = void 0;
|
|
9
|
+
exports.PromptsCacheRefreshErrorSchema = exports.PromptsCacheRefreshResponseSchema = exports.PromptsCacheRefreshDataSchema = exports.PromptGetErrorSchema = exports.PromptsListErrorSchema = exports.PromptValidationErrorSchema = exports.PromptNotFoundErrorSchema = exports.PromptGetRequestSchema = exports.PromptGetResponseSchema = exports.PromptGetDataSchema = exports.PromptFileSchema = exports.PromptMessageSchema = exports.PromptsListResponseSchema = exports.PromptsListDataSchema = exports.PromptInfoSchema = exports.PromptArgumentSchema = void 0;
|
|
10
10
|
const zod_1 = require("zod");
|
|
11
11
|
const common_1 = require("./common");
|
|
12
12
|
/**
|
|
@@ -43,6 +43,13 @@ exports.PromptMessageSchema = zod_1.z.object({
|
|
|
43
43
|
text: zod_1.z.string().describe('Message text content'),
|
|
44
44
|
}).describe('Message content'),
|
|
45
45
|
});
|
|
46
|
+
/**
|
|
47
|
+
* Supporting file for folder-based skills (base64-encoded)
|
|
48
|
+
*/
|
|
49
|
+
exports.PromptFileSchema = zod_1.z.object({
|
|
50
|
+
path: zod_1.z.string().describe('Relative path within skill folder'),
|
|
51
|
+
content: zod_1.z.string().describe('Base64-encoded file content'),
|
|
52
|
+
});
|
|
46
53
|
/**
|
|
47
54
|
* Prompt get response data
|
|
48
55
|
* POST /api/v1/prompts/:promptName
|
|
@@ -50,6 +57,7 @@ exports.PromptMessageSchema = zod_1.z.object({
|
|
|
50
57
|
exports.PromptGetDataSchema = zod_1.z.object({
|
|
51
58
|
description: zod_1.z.string().optional().describe('Prompt description'),
|
|
52
59
|
messages: zod_1.z.array(exports.PromptMessageSchema).describe('Prompt messages'),
|
|
60
|
+
files: zod_1.z.array(exports.PromptFileSchema).optional().describe('Supporting files for folder-based skills (base64-encoded)'),
|
|
53
61
|
});
|
|
54
62
|
exports.PromptGetResponseSchema = (0, common_1.createSuccessResponseSchema)(exports.PromptGetDataSchema);
|
|
55
63
|
/**
|
package/dist/tools/prompts.d.ts
CHANGED
|
@@ -13,17 +13,22 @@ export interface PromptMetadata {
|
|
|
13
13
|
category?: string;
|
|
14
14
|
arguments?: PromptArgument[];
|
|
15
15
|
}
|
|
16
|
+
export interface PromptFile {
|
|
17
|
+
path: string;
|
|
18
|
+
content: string;
|
|
19
|
+
}
|
|
16
20
|
export interface Prompt {
|
|
17
21
|
name: string;
|
|
18
22
|
description: string;
|
|
19
23
|
content: string;
|
|
20
24
|
arguments?: PromptArgument[];
|
|
21
25
|
source: 'built-in' | 'user';
|
|
26
|
+
files?: PromptFile[];
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
29
|
* Loads and parses a prompt file with YAML frontmatter
|
|
25
30
|
*/
|
|
26
|
-
export declare function loadPromptFile(filePath: string, source?: 'built-in' | 'user'): Prompt;
|
|
31
|
+
export declare function loadPromptFile(filePath: string, source?: 'built-in' | 'user', defaultName?: string): Prompt;
|
|
27
32
|
/**
|
|
28
33
|
* Loads built-in prompts from the shared-prompts directory
|
|
29
34
|
*/
|
|
@@ -40,6 +45,7 @@ export declare function mergePrompts(builtInPrompts: Prompt[], userPrompts: Prom
|
|
|
40
45
|
export declare function loadAllPrompts(logger: Logger, baseDir?: string, forceRefresh?: boolean): Promise<Prompt[]>;
|
|
41
46
|
export interface PromptsListArgs {
|
|
42
47
|
baseDir?: string;
|
|
48
|
+
excludeFileSkills?: boolean;
|
|
43
49
|
}
|
|
44
50
|
interface PromptsListResponse {
|
|
45
51
|
prompts: Array<{
|
|
@@ -66,6 +72,7 @@ interface PromptsGetResponse {
|
|
|
66
72
|
text: string;
|
|
67
73
|
};
|
|
68
74
|
}>;
|
|
75
|
+
files?: PromptFile[];
|
|
69
76
|
}
|
|
70
77
|
/**
|
|
71
78
|
* Handle prompts/get MCP request
|
|
@@ -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;AAQhD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","source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M,EAChB,YAAY,GAAE,OAAe,GAC5B,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BnB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,mBAAmB;IAC3B,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;KAC9B,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAqD9B;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,kBAAkB;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,CAAC;IAC3E,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA6G7B"}
|
package/dist/tools/prompts.js
CHANGED
|
@@ -121,7 +121,7 @@ function parseYamlFrontmatter(yaml) {
|
|
|
121
121
|
/**
|
|
122
122
|
* Loads and parses a prompt file with YAML frontmatter
|
|
123
123
|
*/
|
|
124
|
-
function loadPromptFile(filePath, source = 'built-in') {
|
|
124
|
+
function loadPromptFile(filePath, source = 'built-in', defaultName) {
|
|
125
125
|
try {
|
|
126
126
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
127
127
|
// Parse YAML frontmatter
|
|
@@ -132,6 +132,10 @@ function loadPromptFile(filePath, source = 'built-in') {
|
|
|
132
132
|
const [, frontmatterYaml, promptContent] = frontmatterMatch;
|
|
133
133
|
// Parse YAML with support for arguments array
|
|
134
134
|
const metadata = parseYamlFrontmatter(frontmatterYaml);
|
|
135
|
+
// Use defaultName as fallback if frontmatter lacks name (for skill folders)
|
|
136
|
+
if (!metadata.name && defaultName) {
|
|
137
|
+
metadata.name = defaultName;
|
|
138
|
+
}
|
|
135
139
|
if (!metadata.name || !metadata.description) {
|
|
136
140
|
throw new Error(`Missing required metadata in ${filePath}: name, description`);
|
|
137
141
|
}
|
|
@@ -235,7 +239,11 @@ async function loadAllPrompts(logger, baseDir, forceRefresh = false) {
|
|
|
235
239
|
async function handlePromptsListRequest(args, logger, requestId) {
|
|
236
240
|
try {
|
|
237
241
|
logger.info('Processing prompts/list request', { requestId });
|
|
238
|
-
const
|
|
242
|
+
const allPrompts = await loadAllPrompts(logger, process.env.NODE_ENV === 'test' ? args?.baseDir : undefined);
|
|
243
|
+
// Filter out file-dependent skills when requested (MCP clients can't deliver files)
|
|
244
|
+
const prompts = args?.excludeFileSkills
|
|
245
|
+
? allPrompts.filter(p => !p.files || p.files.length === 0)
|
|
246
|
+
: allPrompts;
|
|
239
247
|
// Convert to MCP prompts/list response format (include arguments if present)
|
|
240
248
|
const promptList = prompts.map(prompt => {
|
|
241
249
|
const item = {
|
|
@@ -315,7 +323,7 @@ async function handlePromptsGetRequest(args, logger, requestId) {
|
|
|
315
323
|
argumentsProvided: Object.keys(providedArgs).length,
|
|
316
324
|
});
|
|
317
325
|
// Convert to MCP prompts/get response format
|
|
318
|
-
|
|
326
|
+
const response = {
|
|
319
327
|
description: prompt.description,
|
|
320
328
|
messages: [
|
|
321
329
|
{
|
|
@@ -327,6 +335,10 @@ async function handlePromptsGetRequest(args, logger, requestId) {
|
|
|
327
335
|
},
|
|
328
336
|
],
|
|
329
337
|
};
|
|
338
|
+
if (prompt.files && prompt.files.length > 0) {
|
|
339
|
+
response.files = prompt.files;
|
|
340
|
+
}
|
|
341
|
+
return response;
|
|
330
342
|
}
|
|
331
343
|
catch (error) {
|
|
332
344
|
logger.error('Prompts get request failed', error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
|
|
5
5
|
"mcpName": "io.github.vfarcic/dot-ai",
|
|
6
6
|
"main": "dist/index.js",
|