@venizia/ignis-docs 0.0.1-1 → 0.0.1-10
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/LICENSE.md +102 -0
- package/README.md +459 -0
- package/dist/mcp-server/common/config.d.ts +64 -0
- package/dist/mcp-server/common/config.d.ts.map +1 -0
- package/dist/mcp-server/common/config.js +82 -0
- package/dist/mcp-server/common/config.js.map +1 -0
- package/dist/mcp-server/common/index.d.ts +3 -0
- package/dist/mcp-server/common/index.d.ts.map +1 -0
- package/dist/mcp-server/common/index.js.map +1 -0
- package/dist/mcp-server/common/paths.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/common/paths.js +13 -11
- package/dist/mcp-server/common/paths.js.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/helpers/docs.helper.d.ts +5 -5
- package/dist/mcp-server/helpers/docs.helper.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/helpers/docs.helper.js +38 -34
- package/dist/mcp-server/helpers/docs.helper.js.map +1 -0
- package/dist/mcp-server/helpers/github.helper.d.ts +37 -0
- package/dist/mcp-server/helpers/github.helper.d.ts.map +1 -0
- package/dist/mcp-server/helpers/github.helper.js +100 -0
- package/dist/mcp-server/helpers/github.helper.js.map +1 -0
- package/dist/mcp-server/helpers/index.d.ts +4 -0
- package/dist/mcp-server/helpers/index.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/helpers/index.js +1 -0
- package/dist/mcp-server/helpers/index.js.map +1 -0
- package/dist/mcp-server/helpers/logger.helper.d.ts.map +1 -0
- package/dist/mcp-server/helpers/logger.helper.js.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/index.d.ts.map +1 -1
- package/dist/mcp-server/index.js +90 -0
- package/dist/mcp-server/index.js.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/tools/base.tool.d.ts +8 -12
- package/dist/mcp-server/tools/base.tool.d.ts.map +1 -0
- package/{mcp-server/dist → dist/mcp-server}/tools/base.tool.js +3 -5
- package/dist/mcp-server/tools/base.tool.js.map +1 -0
- package/{mcp-server/dist/tools/get-doc-content.tool.d.ts → dist/mcp-server/tools/docs/get-document-content.tool.d.ts} +13 -17
- package/dist/mcp-server/tools/docs/get-document-content.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/get-doc-content.tool.js → dist/mcp-server/tools/docs/get-document-content.tool.js} +20 -22
- package/dist/mcp-server/tools/docs/get-document-content.tool.js.map +1 -0
- package/{mcp-server/dist/tools/get-doc-metadata.tool.d.ts → dist/mcp-server/tools/docs/get-document-metadata.tool.d.ts} +21 -25
- package/dist/mcp-server/tools/docs/get-document-metadata.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/get-doc-metadata.tool.js → dist/mcp-server/tools/docs/get-document-metadata.tool.js} +35 -27
- package/dist/mcp-server/tools/docs/get-document-metadata.tool.js.map +1 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts +50 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.js +221 -0
- package/dist/mcp-server/tools/docs/get-package-overview.tool.js.map +1 -0
- package/dist/mcp-server/tools/docs/index.d.ts +7 -0
- package/dist/mcp-server/tools/docs/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/docs/index.js +23 -0
- package/dist/mcp-server/tools/docs/index.js.map +1 -0
- package/{mcp-server/dist/tools → dist/mcp-server/tools/docs}/list-categories.tool.d.ts +3 -3
- package/dist/mcp-server/tools/docs/list-categories.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools → dist/mcp-server/tools/docs}/list-categories.tool.js +10 -9
- package/dist/mcp-server/tools/docs/list-categories.tool.js.map +1 -0
- package/{mcp-server/dist/tools/list-docs.tool.d.ts → dist/mcp-server/tools/docs/list-documents.tool.d.ts} +5 -5
- package/dist/mcp-server/tools/docs/list-documents.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/list-docs.tool.js → dist/mcp-server/tools/docs/list-documents.tool.js} +15 -14
- package/dist/mcp-server/tools/docs/list-documents.tool.js.map +1 -0
- package/{mcp-server/dist/tools/search-docs.tool.d.ts → dist/mcp-server/tools/docs/search-documents.tool.d.ts} +23 -19
- package/dist/mcp-server/tools/docs/search-documents.tool.d.ts.map +1 -0
- package/{mcp-server/dist/tools/search-docs.tool.js → dist/mcp-server/tools/docs/search-documents.tool.js} +29 -25
- package/dist/mcp-server/tools/docs/search-documents.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/index.d.ts +5 -0
- package/dist/mcp-server/tools/github/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/index.js +21 -0
- package/dist/mcp-server/tools/github/index.js.map +1 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.d.ts +28 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.js +98 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/search-code.tool.d.ts +42 -0
- package/dist/mcp-server/tools/github/search-code.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/search-code.tool.js +194 -0
- package/dist/mcp-server/tools/github/search-code.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.d.ts +55 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.js +167 -0
- package/dist/mcp-server/tools/github/verify-dependencies.tool.js.map +1 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.d.ts +26 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.js +91 -0
- package/dist/mcp-server/tools/github/view-source-file.tool.js.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +4 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/index.js +22 -0
- package/dist/mcp-server/tools/index.js.map +1 -0
- package/package.json +46 -23
- package/wiki/changelogs/2025-12-16-initial-architecture.md +145 -0
- package/wiki/changelogs/2025-12-16-model-repo-datasource-refactor.md +300 -0
- package/wiki/changelogs/2025-12-17-refactor.md +90 -0
- package/wiki/changelogs/2025-12-18-performance-optimizations.md +130 -0
- package/wiki/changelogs/2025-12-18-repository-validation-security.md +249 -0
- package/wiki/changelogs/index.md +33 -0
- package/wiki/changelogs/planned-transaction-support.md +216 -0
- package/wiki/changelogs/template.md +123 -0
- package/wiki/get-started/5-minute-quickstart.md +1 -1
- package/wiki/get-started/best-practices/api-usage-examples.md +54 -8
- package/wiki/get-started/best-practices/architectural-patterns.md +43 -2
- package/wiki/get-started/best-practices/code-style-standards.md +41 -0
- package/wiki/get-started/best-practices/common-pitfalls.md +5 -3
- package/wiki/get-started/best-practices/contribution-workflow.md +40 -6
- package/wiki/get-started/best-practices/data-modeling.md +177 -0
- package/wiki/get-started/best-practices/security-guidelines.md +3 -1
- package/wiki/get-started/building-a-crud-api.md +63 -78
- package/wiki/get-started/core-concepts/components.md +4 -2
- package/wiki/get-started/core-concepts/controllers.md +14 -14
- package/wiki/get-started/core-concepts/dependency-injection.md +13 -1
- package/wiki/get-started/core-concepts/persistent.md +383 -431
- package/wiki/get-started/core-concepts/services.md +21 -27
- package/wiki/get-started/mcp-docs-server.md +130 -32
- package/wiki/get-started/philosophy.md +198 -25
- package/wiki/get-started/quickstart.md +1 -1
- package/wiki/public/logo.svg +1 -0
- package/wiki/references/base/application.md +5 -5
- package/wiki/references/base/components.md +1 -1
- package/wiki/references/base/controllers.md +43 -17
- package/wiki/references/base/datasources.md +195 -33
- package/wiki/references/base/dependency-injection.md +8 -7
- package/wiki/references/base/models.md +713 -25
- package/wiki/references/base/repositories.md +475 -22
- package/wiki/references/base/services.md +2 -2
- package/wiki/references/components/authentication.md +228 -10
- package/wiki/references/components/health-check.md +1 -1
- package/wiki/references/components/index.md +4 -2
- package/wiki/references/components/static-asset.md +1289 -0
- package/wiki/references/components/swagger.md +1 -1
- package/wiki/references/helpers/error.md +2 -2
- package/wiki/references/helpers/inversion.md +29 -14
- package/wiki/references/helpers/storage.md +538 -11
- package/wiki/references/src-details/core.md +21 -6
- package/wiki/references/src-details/docs.md +19 -9
- package/wiki/references/src-details/inversion.md +4 -4
- package/wiki/references/src-details/mcp-server.md +185 -234
- package/wiki/references/utilities/index.md +1 -1
- package/wiki/references/utilities/request.md +162 -3
- package/mcp-server/dist/common/config.d.ts +0 -27
- package/mcp-server/dist/common/config.d.ts.map +0 -1
- package/mcp-server/dist/common/config.js +0 -27
- package/mcp-server/dist/common/config.js.map +0 -1
- package/mcp-server/dist/common/index.d.ts +0 -3
- package/mcp-server/dist/common/index.d.ts.map +0 -1
- package/mcp-server/dist/common/index.js.map +0 -1
- package/mcp-server/dist/common/paths.d.ts.map +0 -1
- package/mcp-server/dist/common/paths.js.map +0 -1
- package/mcp-server/dist/helpers/docs.helper.d.ts.map +0 -1
- package/mcp-server/dist/helpers/docs.helper.js.map +0 -1
- package/mcp-server/dist/helpers/index.d.ts +0 -3
- package/mcp-server/dist/helpers/index.d.ts.map +0 -1
- package/mcp-server/dist/helpers/index.js.map +0 -1
- package/mcp-server/dist/helpers/logger.helper.d.ts.map +0 -1
- package/mcp-server/dist/helpers/logger.helper.js.map +0 -1
- package/mcp-server/dist/index.js +0 -62
- package/mcp-server/dist/index.js.map +0 -1
- package/mcp-server/dist/tools/base.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/base.tool.js.map +0 -1
- package/mcp-server/dist/tools/get-doc-content.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/get-doc-content.tool.js.map +0 -1
- package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/get-doc-metadata.tool.js.map +0 -1
- package/mcp-server/dist/tools/index.d.ts +0 -8
- package/mcp-server/dist/tools/index.d.ts.map +0 -1
- package/mcp-server/dist/tools/index.js +0 -18
- package/mcp-server/dist/tools/index.js.map +0 -1
- package/mcp-server/dist/tools/list-categories.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/list-categories.tool.js.map +0 -1
- package/mcp-server/dist/tools/list-docs.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/list-docs.tool.js.map +0 -1
- package/mcp-server/dist/tools/search-docs.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/search-docs.tool.js.map +0 -1
- /package/{mcp-server/dist → dist/mcp-server}/common/index.js +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/common/paths.d.ts +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/helpers/logger.helper.d.ts +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/helpers/logger.helper.js +0 -0
- /package/{mcp-server/dist → dist/mcp-server}/index.d.ts +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GetPackageOverviewTool = void 0;
|
|
7
|
+
const common_1 = require("../../../mcp-server/common");
|
|
8
|
+
const helpers_1 = require("../../../mcp-server/helpers");
|
|
9
|
+
const tools_1 = require("@mastra/core/tools");
|
|
10
|
+
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
11
|
+
const gray_matter_1 = __importDefault(require("gray-matter"));
|
|
12
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
13
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
+
const zod_1 = require("zod");
|
|
15
|
+
const base_tool_1 = require("../base.tool");
|
|
16
|
+
// ----------------------------------------------------------------------------
|
|
17
|
+
// DESCRIPTIONS
|
|
18
|
+
// ----------------------------------------------------------------------------
|
|
19
|
+
const TOOL_DESCRIPTION = `
|
|
20
|
+
Returns an overview of Ignis packages from the source details documentation.
|
|
21
|
+
|
|
22
|
+
PURPOSE:
|
|
23
|
+
Provides AI agents with comprehensive understanding of the Ignis monorepo structure,
|
|
24
|
+
package purposes, main exports, and directory layouts. This is essential for helping
|
|
25
|
+
users understand which package to use for specific features.
|
|
26
|
+
|
|
27
|
+
WHEN TO USE:
|
|
28
|
+
- When user asks "what packages does Ignis have?"
|
|
29
|
+
- When user needs to understand project structure
|
|
30
|
+
- When user asks which package provides a specific feature
|
|
31
|
+
- Before helping user implement a feature (to know where code should go)
|
|
32
|
+
- When user asks about imports or package dependencies
|
|
33
|
+
|
|
34
|
+
WHEN NOT TO USE:
|
|
35
|
+
- For specific API documentation (use getDocContent with references/ docs)
|
|
36
|
+
- For code examples (use searchCode or getDocContent)
|
|
37
|
+
- For troubleshooting (use searchDocs)
|
|
38
|
+
|
|
39
|
+
OUTPUT:
|
|
40
|
+
Returns package name, description, main directories, and key components.
|
|
41
|
+
The content comes from wiki/references/src-details/ documentation.
|
|
42
|
+
`;
|
|
43
|
+
const PACKAGE_NAME_DESCRIPTION = `
|
|
44
|
+
Optional: Name of specific package to get details for.
|
|
45
|
+
|
|
46
|
+
VALID VALUES:
|
|
47
|
+
- "core" - @venizia/ignis main framework
|
|
48
|
+
- "helpers" - @venizia/ignis-helpers utility helpers
|
|
49
|
+
- "inversion" - @venizia/ignis-inversion DI container
|
|
50
|
+
- "dev-configs" - @venizia/dev-configs ESLint, Prettier, TSConfig
|
|
51
|
+
- "docs" - Documentation package
|
|
52
|
+
- "mcp-server" - MCP documentation server
|
|
53
|
+
|
|
54
|
+
If not provided, returns overview of ALL packages.
|
|
55
|
+
`;
|
|
56
|
+
// ----------------------------------------------------------------------------
|
|
57
|
+
// SCHEMAS
|
|
58
|
+
// ----------------------------------------------------------------------------
|
|
59
|
+
const PackageInfoSchema = zod_1.z.object({
|
|
60
|
+
name: zod_1.z.string().describe('Package name (e.g., "core", "helpers")'),
|
|
61
|
+
npmName: zod_1.z.string().describe('NPM package name (e.g., "@venizia/ignis")'),
|
|
62
|
+
description: zod_1.z.string().describe('Brief description of package purpose'),
|
|
63
|
+
directories: zod_1.z
|
|
64
|
+
.array(zod_1.z.object({
|
|
65
|
+
name: zod_1.z.string(),
|
|
66
|
+
purpose: zod_1.z.string(),
|
|
67
|
+
}))
|
|
68
|
+
.describe('Main directories and their purposes'),
|
|
69
|
+
content: zod_1.z.string().optional().describe('Full markdown content if single package requested'),
|
|
70
|
+
});
|
|
71
|
+
const InputSchema = zod_1.z.object({
|
|
72
|
+
packageName: zod_1.z.string().optional().describe(PACKAGE_NAME_DESCRIPTION),
|
|
73
|
+
});
|
|
74
|
+
const OutputSchema = zod_1.z.object({
|
|
75
|
+
packages: zod_1.z.array(PackageInfoSchema).describe('List of package overviews'),
|
|
76
|
+
error: zod_1.z.string().optional().describe('Error message if operation failed'),
|
|
77
|
+
});
|
|
78
|
+
// ----------------------------------------------------------------------------
|
|
79
|
+
// PACKAGE MAPPING
|
|
80
|
+
// ----------------------------------------------------------------------------
|
|
81
|
+
const PACKAGE_NPM_NAMES = {
|
|
82
|
+
core: '@venizia/ignis',
|
|
83
|
+
helpers: '@venizia/ignis-helpers',
|
|
84
|
+
inversion: '@venizia/ignis-inversion',
|
|
85
|
+
'dev-configs': '@venizia/dev-configs',
|
|
86
|
+
docs: '@venizia/ignis-docs',
|
|
87
|
+
'mcp-server': '@venizia/ignis-docs (MCP Server)',
|
|
88
|
+
};
|
|
89
|
+
// ----------------------------------------------------------------------------
|
|
90
|
+
// TOOL CLASS
|
|
91
|
+
// ----------------------------------------------------------------------------
|
|
92
|
+
class GetPackageOverviewTool extends base_tool_1.BaseTool {
|
|
93
|
+
constructor() {
|
|
94
|
+
super(...arguments);
|
|
95
|
+
this.id = 'getPackageOverview';
|
|
96
|
+
this.description = TOOL_DESCRIPTION;
|
|
97
|
+
this.inputSchema = InputSchema;
|
|
98
|
+
this.outputSchema = OutputSchema;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Extracts package description from first paragraph after title
|
|
102
|
+
*/
|
|
103
|
+
extractDescription(opts) {
|
|
104
|
+
const lines = opts.content.split('\n');
|
|
105
|
+
let bFoundTitle = false;
|
|
106
|
+
const descLines = [];
|
|
107
|
+
for (const line of lines) {
|
|
108
|
+
if (line.startsWith('# ')) {
|
|
109
|
+
bFoundTitle = true;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (bFoundTitle && line.trim() === '') {
|
|
113
|
+
if (descLines.length > 0) {
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (bFoundTitle && !line.startsWith('#') && !line.startsWith('|') && !line.startsWith('-')) {
|
|
119
|
+
descLines.push(line.trim());
|
|
120
|
+
if (descLines.length >= 2) {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return descLines.join(' ').slice(0, 300) || 'No description available';
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Extracts directory table from markdown content
|
|
129
|
+
*/
|
|
130
|
+
extractDirectories(opts) {
|
|
131
|
+
const directories = [];
|
|
132
|
+
const lines = opts.content.split('\n');
|
|
133
|
+
let isInTable = false;
|
|
134
|
+
let isHeaderPassed = false;
|
|
135
|
+
for (const line of lines) {
|
|
136
|
+
// Look for tables with Directory/Folder column
|
|
137
|
+
if (line.includes('| Directory') || line.includes('| Folder') || line.includes('| **`')) {
|
|
138
|
+
isInTable = true;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (isInTable && line.startsWith('|---')) {
|
|
142
|
+
isHeaderPassed = true;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (isInTable && isHeaderPassed && line.startsWith('|')) {
|
|
146
|
+
const cells = line
|
|
147
|
+
.split('|')
|
|
148
|
+
.map(c => c.trim())
|
|
149
|
+
.filter(Boolean);
|
|
150
|
+
if (cells.length >= 2) {
|
|
151
|
+
const dirName = cells[0].replace(/\*\*/g, '').replace(/`/g, '').trim();
|
|
152
|
+
const purpose = cells[1].replace(/\*\*/g, '').slice(0, 150);
|
|
153
|
+
if (dirName && !dirName.includes('---')) {
|
|
154
|
+
directories.push({ name: dirName, purpose });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Stop at next section
|
|
159
|
+
if (isInTable && isHeaderPassed && (line.startsWith('##') || line.startsWith('---'))) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return directories.slice(0, 10); // Limit to top 10 directories
|
|
164
|
+
}
|
|
165
|
+
async execute(opts) {
|
|
166
|
+
const srcDetailsPath = common_1.Paths.SOURCE_DETAILS;
|
|
167
|
+
try {
|
|
168
|
+
// Get specific package or all packages
|
|
169
|
+
const pattern = opts.packageName ? `${opts.packageName}.md` : '*.md';
|
|
170
|
+
const files = await (0, fast_glob_1.default)(pattern, {
|
|
171
|
+
cwd: srcDetailsPath,
|
|
172
|
+
absolute: true,
|
|
173
|
+
});
|
|
174
|
+
if (files.length === 0) {
|
|
175
|
+
return {
|
|
176
|
+
packages: [],
|
|
177
|
+
error: opts.packageName
|
|
178
|
+
? `Package "${opts.packageName}" not found. Valid: core, helpers, inversion, dev-configs, docs, mcp-server`
|
|
179
|
+
: 'No package documentation found',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const packages = await Promise.all(files.map(async (file) => {
|
|
183
|
+
const rawContent = await promises_1.default.readFile(file, 'utf-8');
|
|
184
|
+
const { content } = (0, gray_matter_1.default)(rawContent);
|
|
185
|
+
const baseName = node_path_1.default.basename(file, '.md');
|
|
186
|
+
const packageInfo = {
|
|
187
|
+
name: baseName,
|
|
188
|
+
npmName: PACKAGE_NPM_NAMES[baseName] || `@venizia/ignis-${baseName}`,
|
|
189
|
+
description: this.extractDescription({ content }),
|
|
190
|
+
directories: this.extractDirectories({ content }),
|
|
191
|
+
};
|
|
192
|
+
// Include full content only if single package requested
|
|
193
|
+
if (opts.packageName) {
|
|
194
|
+
packageInfo.content = content;
|
|
195
|
+
}
|
|
196
|
+
return packageInfo;
|
|
197
|
+
}));
|
|
198
|
+
// Sort by package name
|
|
199
|
+
packages.sort((a, b) => a.name.localeCompare(b.name));
|
|
200
|
+
return { packages };
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
helpers_1.Logger.error('Failed to get package overview:', error);
|
|
204
|
+
return {
|
|
205
|
+
packages: [],
|
|
206
|
+
error: `Failed to load package overview: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
getTool() {
|
|
211
|
+
return (0, tools_1.createTool)({
|
|
212
|
+
id: this.id,
|
|
213
|
+
description: this.description,
|
|
214
|
+
inputSchema: this.inputSchema,
|
|
215
|
+
outputSchema: this.outputSchema,
|
|
216
|
+
execute: async ({ context }) => this.execute(context),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
exports.GetPackageOverviewTool = GetPackageOverviewTool;
|
|
221
|
+
//# sourceMappingURL=get-package-overview.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-package-overview.tool.js","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/get-package-overview.tool.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA4C;AAC5C,kDAA8C;AAC9C,8CAAgD;AAChD,0DAA2B;AAC3B,8DAAiC;AACjC,gEAAkC;AAClC,0DAA6B;AAC7B,6BAAwB;AACxB,4CAAqD;AAErD,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBxB,CAAC;AAEF,MAAM,wBAAwB,GAAG;;;;;;;;;;;;CAYhC,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;I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AAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AApJD,wDAoJC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './get-document-content.tool';
|
|
2
|
+
export * from './get-document-metadata.tool';
|
|
3
|
+
export * from './get-package-overview.tool';
|
|
4
|
+
export * from './list-categories.tool';
|
|
5
|
+
export * from './list-documents.tool';
|
|
6
|
+
export * from './search-documents.tool';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-document-content.tool"), exports);
|
|
18
|
+
__exportStar(require("./get-document-metadata.tool"), exports);
|
|
19
|
+
__exportStar(require("./get-package-overview.tool"), exports);
|
|
20
|
+
__exportStar(require("./list-categories.tool"), exports);
|
|
21
|
+
__exportStar(require("./list-documents.tool"), exports);
|
|
22
|
+
__exportStar(require("./search-documents.tool"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,+DAA6C;AAC7C,8DAA4C;AAC5C,yDAAuC;AACvC,wDAAsC;AACtC,0DAAwC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { BaseTool,
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, TMastraTool } from '../base.tool';
|
|
3
3
|
declare const InputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
4
4
|
declare const OutputSchema: z.ZodObject<{
|
|
5
5
|
count: z.ZodNumber;
|
|
@@ -13,7 +13,7 @@ export declare class ListCategoriesTool extends BaseTool<typeof InputSchema, typ
|
|
|
13
13
|
count: z.ZodNumber;
|
|
14
14
|
categories: z.ZodArray<z.ZodString>;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
|
-
execute(
|
|
16
|
+
execute(_opts: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
17
17
|
getTool(): TMastraTool;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-categories.tool.d.ts","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/list-categories.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAuErD,QAAA,MAAM,WAAW,gCAAyD,CAAC;AAE3E,QAAA,MAAM,YAAY;;;iBAGhB,CAAC;AAMH,qBAAa,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACvF,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,WAAW,i7CAAoB;IACxC,QAAQ,CAAC,WAAW,iCAAe;IACnC,QAAQ,CAAC,YAAY;;;sBAAgB;IAE/B,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IASxF,OAAO,IAAI,WAAW;CASvB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ListCategoriesTool = void 0;
|
|
4
|
+
const tools_1 = require("@mastra/core/tools");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const base_tool_1 = require("../base.tool");
|
|
7
|
+
const helpers_1 = require("../../../mcp-server/helpers");
|
|
7
8
|
// ----------------------------------------------------------------------------
|
|
8
9
|
// DESCRIPTIONS
|
|
9
10
|
// ----------------------------------------------------------------------------
|
|
@@ -68,9 +69,9 @@ Pass any category name to listDocs(category) to filter documents by that categor
|
|
|
68
69
|
// ----------------------------------------------------------------------------
|
|
69
70
|
// SCHEMAS
|
|
70
71
|
// ----------------------------------------------------------------------------
|
|
71
|
-
const InputSchema = zod_1.z.object({}).describe(
|
|
72
|
+
const InputSchema = zod_1.z.object({}).describe('No input parameters required.');
|
|
72
73
|
const OutputSchema = zod_1.z.object({
|
|
73
|
-
count: zod_1.z.number().int().describe(
|
|
74
|
+
count: zod_1.z.number().int().describe('Total number of unique categories.'),
|
|
74
75
|
categories: zod_1.z.array(zod_1.z.string()).describe(CATEGORIES_DESCRIPTION),
|
|
75
76
|
});
|
|
76
77
|
// ----------------------------------------------------------------------------
|
|
@@ -79,12 +80,12 @@ const OutputSchema = zod_1.z.object({
|
|
|
79
80
|
class ListCategoriesTool extends base_tool_1.BaseTool {
|
|
80
81
|
constructor() {
|
|
81
82
|
super(...arguments);
|
|
82
|
-
this.id =
|
|
83
|
+
this.id = 'listCategories';
|
|
83
84
|
this.description = TOOL_DESCRIPTION;
|
|
84
85
|
this.inputSchema = InputSchema;
|
|
85
86
|
this.outputSchema = OutputSchema;
|
|
86
87
|
}
|
|
87
|
-
async execute(
|
|
88
|
+
async execute(_opts) {
|
|
88
89
|
const categories = await helpers_1.DocsHelper.listCategories();
|
|
89
90
|
return {
|
|
90
91
|
count: categories.length,
|
|
@@ -92,11 +93,11 @@ class ListCategoriesTool extends base_tool_1.BaseTool {
|
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
95
|
getTool() {
|
|
95
|
-
return (0,
|
|
96
|
+
return (0, tools_1.createTool)({
|
|
96
97
|
id: this.id,
|
|
97
98
|
description: this.description,
|
|
98
|
-
inputSchema:
|
|
99
|
-
outputSchema:
|
|
99
|
+
inputSchema: this.inputSchema,
|
|
100
|
+
outputSchema: this.outputSchema,
|
|
100
101
|
execute: async ({ context }) => this.execute(context),
|
|
101
102
|
});
|
|
102
103
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-categories.tool.js","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/list-categories.tool.ts"],"names":[],"mappings":";;;AAAA,8CAAgD;AAChD,6BAAwB;AACxB,4CAAqD;AACrD,kDAAkD;AAElD,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG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AC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,gDAwBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { BaseTool,
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, TMastraTool } from '../base.tool';
|
|
3
3
|
declare const InputSchema: z.ZodObject<{
|
|
4
4
|
category: z.ZodOptional<z.ZodString>;
|
|
5
5
|
}, z.core.$strip>;
|
|
@@ -12,7 +12,7 @@ declare const OutputSchema: z.ZodObject<{
|
|
|
12
12
|
}, z.core.$strip>>;
|
|
13
13
|
}, z.core.$strip>;
|
|
14
14
|
export declare class ListDocsTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
15
|
-
readonly id = "
|
|
15
|
+
readonly id = "listDocuments";
|
|
16
16
|
readonly description = "\nLists all available Ignis Framework documentation files with their identifiers, titles, and categories.\n\nPURPOSE:\nUse this tool to discover what documentation is available. It provides a complete catalog\nof all documents, optionally filtered by category. Essential for understanding the documentation\nstructure and finding specific pages.\n\nWHEN TO USE:\n- To explore what documentation exists\n- To find document IDs for use with getDocContent\n- To browse documents within a specific category\n- When searchDocs doesn't find what you're looking for\n- To understand the overall documentation structure\n- To provide users with a list of available resources\n\nWHEN NOT TO USE:\n- When you know what you're looking for (use searchDocs instead)\n- When you need document content (use getDocContent after getting IDs)\n\nCATEGORY FILTERING:\n- Omit 'category' parameter to get ALL documents\n- Provide exact category name to filter (case-sensitive)\n- Use listCategories first to see available category names\n\nCOMMON CATEGORIES IN IGNIS DOCS:\n- \"Getting Started\" - Introductory guides, quickstart, philosophy\n- \"Core Concepts\" - DI, lifecycle, configuration fundamentals\n- \"Best Practices\" - Recommended patterns and approaches\n- \"References\" - API documentation, component details\n- \"Helpers\" - Utility libraries documentation\n- \"Utilities\" - Utility function references\n\nWORKFLOW EXAMPLES:\n1. Browse all docs:\n listDocs() \u2192 Review titles \u2192 getDocContent(id)\n\n2. Explore a category:\n listCategories() \u2192 Pick category \u2192 listDocs(category) \u2192 getDocContent(id)\n\n3. Find specific documentation:\n searchDocs(query) \u2192 If not found \u2192 listDocs() to browse manually\n";
|
|
17
17
|
readonly inputSchema: z.ZodObject<{
|
|
18
18
|
category: z.ZodOptional<z.ZodString>;
|
|
@@ -25,8 +25,8 @@ export declare class ListDocsTool extends BaseTool<typeof InputSchema, typeof Ou
|
|
|
25
25
|
category: z.ZodString;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
|
-
execute(
|
|
28
|
+
execute(opts: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
29
29
|
getTool(): TMastraTool;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
32
|
-
//# sourceMappingURL=list-
|
|
32
|
+
//# sourceMappingURL=list-documents.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-documents.tool.d.ts","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/list-documents.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAsFrD,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;iBAGhB,CAAC;AAMH,qBAAa,YAAa,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACjF,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,WAAW,+sDAAoB;IACxC,QAAQ,CAAC,WAAW;;sBAAe;IACnC,QAAQ,CAAC,YAAY;;;;;;;sBAAgB;IAE/B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IASvF,OAAO,IAAI,WAAW;CASvB"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ListDocsTool = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const base_tool_1 = require("
|
|
5
|
+
const tools_1 = require("@mastra/core/tools");
|
|
6
|
+
const base_tool_1 = require("../base.tool");
|
|
7
|
+
const helpers_1 = require("../../../mcp-server/helpers");
|
|
7
8
|
// ----------------------------------------------------------------------------
|
|
8
9
|
// DESCRIPTIONS
|
|
9
10
|
// ----------------------------------------------------------------------------
|
|
@@ -78,16 +79,16 @@ TIP: If unsure of exact category name, call listCategories first or omit this pa
|
|
|
78
79
|
const DocEntrySchema = zod_1.z.object({
|
|
79
80
|
id: zod_1.z
|
|
80
81
|
.string()
|
|
81
|
-
.describe(
|
|
82
|
-
title: zod_1.z.string().describe(
|
|
83
|
-
category: zod_1.z.string().describe(
|
|
82
|
+
.describe('Document ID (relative file path). Use with getDocContent or getDocMetadata.'),
|
|
83
|
+
title: zod_1.z.string().describe('Document title from frontmatter or filename.'),
|
|
84
|
+
category: zod_1.z.string().describe('Document category for organizational grouping.'),
|
|
84
85
|
});
|
|
85
86
|
const InputSchema = zod_1.z.object({
|
|
86
87
|
category: zod_1.z.string().optional().describe(CATEGORY_DESCRIPTION),
|
|
87
88
|
});
|
|
88
89
|
const OutputSchema = zod_1.z.object({
|
|
89
|
-
count: zod_1.z.number().int().describe(
|
|
90
|
-
docs: zod_1.z.array(DocEntrySchema).describe(
|
|
90
|
+
count: zod_1.z.number().int().describe('Total documents returned. Reflects filter if applied.'),
|
|
91
|
+
docs: zod_1.z.array(DocEntrySchema).describe('Document entries with id, title, and category.'),
|
|
91
92
|
});
|
|
92
93
|
// ----------------------------------------------------------------------------
|
|
93
94
|
// TOOL CLASS
|
|
@@ -95,27 +96,27 @@ const OutputSchema = zod_1.z.object({
|
|
|
95
96
|
class ListDocsTool extends base_tool_1.BaseTool {
|
|
96
97
|
constructor() {
|
|
97
98
|
super(...arguments);
|
|
98
|
-
this.id =
|
|
99
|
+
this.id = 'listDocuments';
|
|
99
100
|
this.description = TOOL_DESCRIPTION;
|
|
100
101
|
this.inputSchema = InputSchema;
|
|
101
102
|
this.outputSchema = OutputSchema;
|
|
102
103
|
}
|
|
103
|
-
async execute(
|
|
104
|
-
const docs = await helpers_1.DocsHelper.
|
|
104
|
+
async execute(opts) {
|
|
105
|
+
const docs = await helpers_1.DocsHelper.listDocumentFiles({ category: opts.category });
|
|
105
106
|
return {
|
|
106
107
|
count: docs.length,
|
|
107
108
|
docs,
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
111
|
getTool() {
|
|
111
|
-
return (0,
|
|
112
|
+
return (0, tools_1.createTool)({
|
|
112
113
|
id: this.id,
|
|
113
114
|
description: this.description,
|
|
114
|
-
inputSchema:
|
|
115
|
-
outputSchema:
|
|
115
|
+
inputSchema: this.inputSchema,
|
|
116
|
+
outputSchema: this.outputSchema,
|
|
116
117
|
execute: async ({ context }) => this.execute(context),
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
exports.ListDocsTool = ListDocsTool;
|
|
121
|
-
//# sourceMappingURL=list-
|
|
122
|
+
//# sourceMappingURL=list-documents.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-documents.tool.js","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/list-documents.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,8CAAgD;AAChD,4CAAqD;AACrD,kDAAkD;AAElD,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CxB,CAAC;AAEF,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB5B,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,M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AAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,oCAwBC"}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { BaseTool,
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, TMastraTool } from '../base.tool';
|
|
3
3
|
declare const InputSchema: z.ZodObject<{
|
|
4
4
|
query: z.ZodString;
|
|
5
5
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
|
-
declare const OutputSchema: z.
|
|
8
|
-
|
|
9
|
-
title: z.ZodString;
|
|
10
|
-
category: z.ZodString;
|
|
11
|
-
snippet: z.ZodString;
|
|
12
|
-
score: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
}, z.core.$strip>>;
|
|
14
|
-
export declare class SearchDocsTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
15
|
-
readonly id = "searchDocs";
|
|
16
|
-
readonly description = "\nPerforms intelligent fuzzy search across the entire Ignis Framework documentation corpus.\n\nPURPOSE:\nUse this tool to find documentation pages relevant to a user's question or topic.\nIt searches both document titles (weighted higher) and content body using the Fuse.js fuzzy matching algorithm.\n\nWHEN TO USE:\n- User asks \"how do I...\" or \"what is...\" questions about Ignis\n- You need to find documentation about a specific feature, concept, or API\n- You want to discover related documentation before diving into specifics\n- User mentions keywords that might appear in documentation\n\nSEARCH BEHAVIOR:\n- Fuzzy matching tolerates typos and partial matches\n- Title matches are weighted 70%, content matches 30%\n- Results sorted by relevance score (lower = better match)\n- Returns snippet previews for quick assessment\n\nWORKFLOW RECOMMENDATION:\n1. Start with searchDocs to find relevant pages\n2. Review returned snippets to identify best matches\n3. Use getDocContent with specific IDs to retrieve full content\n4. Use getDocMetadata if you need document statistics\n\nOUTPUT STRUCTURE:\nReturns array of {id, title, category, snippet, score} objects.\nUse the 'id' field with getDocContent to fetch full document content.\n";
|
|
17
|
-
readonly inputSchema: z.ZodObject<{
|
|
18
|
-
query: z.ZodString;
|
|
19
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
readonly outputSchema: z.ZodArray<z.ZodObject<{
|
|
7
|
+
declare const OutputSchema: z.ZodObject<{
|
|
8
|
+
results: z.ZodArray<z.ZodObject<{
|
|
22
9
|
id: z.ZodString;
|
|
23
10
|
title: z.ZodString;
|
|
24
11
|
category: z.ZodString;
|
|
25
12
|
snippet: z.ZodString;
|
|
26
13
|
score: z.ZodOptional<z.ZodNumber>;
|
|
27
14
|
}, z.core.$strip>>;
|
|
28
|
-
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare class SearchDocsTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
17
|
+
readonly id = "searchDocuments";
|
|
18
|
+
readonly description = "\nPerforms intelligent fuzzy search across the entire Ignis Framework documentation corpus.\n\nPURPOSE:\nUse this tool to find documentation pages relevant to a user's question or topic.\nIt searches both document titles (weighted higher) and content body using the Fuse.js fuzzy matching algorithm.\n\nWHEN TO USE:\n- User asks \"how do I...\" or \"what is...\" questions about Ignis\n- You need to find documentation about a specific feature, concept, or API\n- You want to discover related documentation before diving into specifics\n- User mentions keywords that might appear in documentation\n\nSEARCH BEHAVIOR:\n- Fuzzy matching tolerates typos and partial matches\n- Title matches are weighted 70%, content matches 30%\n- Results sorted by relevance score (lower = better match)\n- Returns snippet previews for quick assessment\n\nWORKFLOW RECOMMENDATION:\n1. Start with searchDocs to find relevant pages\n2. Review returned snippets to identify best matches\n3. Use getDocContent with specific IDs to retrieve full content\n4. Use getDocMetadata if you need document statistics\n\nOUTPUT STRUCTURE:\nReturns array of {id, title, category, snippet, score} objects.\nUse the 'id' field with getDocContent to fetch full document content.\n";
|
|
19
|
+
readonly inputSchema: z.ZodObject<{
|
|
20
|
+
query: z.ZodString;
|
|
21
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
readonly outputSchema: z.ZodObject<{
|
|
24
|
+
results: z.ZodArray<z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
category: z.ZodString;
|
|
28
|
+
snippet: z.ZodString;
|
|
29
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
execute(opts: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
29
33
|
getTool(): TMastraTool;
|
|
30
34
|
}
|
|
31
35
|
export {};
|
|
32
|
-
//# sourceMappingURL=search-
|
|
36
|
+
//# sourceMappingURL=search-documents.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-documents.tool.d.ts","sourceRoot":"","sources":["../../../../mcp-server/tools/docs/search-documents.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAmFrD,QAAA,MAAM,WAAW;;;iBASf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;iBAIhB,CAAC;AAMH,qBAAa,cAAe,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACnF,QAAQ,CAAC,EAAE,qBAAqB;IAChC,QAAQ,CAAC,WAAW,kuCAAoB;IACxC,QAAQ,CAAC,WAAW;;;sBAAe;IACnC,QAAQ,CAAC,YAAY;;;;;;;;sBAAgB;IAE/B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IAQvF,OAAO,IAAI,WAAW;CASvB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SearchDocsTool = void 0;
|
|
4
|
+
const tools_1 = require("@mastra/core/tools");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const base_tool_1 = require("../base.tool");
|
|
7
|
+
const common_1 = require("../../../mcp-server/common");
|
|
8
|
+
const helpers_1 = require("../../../mcp-server/helpers");
|
|
8
9
|
// ----------------------------------------------------------------------------
|
|
9
10
|
// DESCRIPTIONS
|
|
10
11
|
// ----------------------------------------------------------------------------
|
|
@@ -41,7 +42,7 @@ const QUERY_DESCRIPTION = `
|
|
|
41
42
|
Search query string to match against documentation titles and content.
|
|
42
43
|
|
|
43
44
|
REQUIREMENTS:
|
|
44
|
-
- Minimum ${common_1.
|
|
45
|
+
- Minimum ${common_1.MCPConfigs.search.minQueryLength} characters required
|
|
45
46
|
- Supports natural language queries (e.g., "dependency injection setup")
|
|
46
47
|
- Supports technical terms (e.g., "HttpServer middleware")
|
|
47
48
|
- Case-insensitive matching
|
|
@@ -56,8 +57,8 @@ Maximum number of results to return.
|
|
|
56
57
|
|
|
57
58
|
CONSTRAINTS:
|
|
58
59
|
- Minimum: 1
|
|
59
|
-
- Maximum: ${common_1.
|
|
60
|
-
- Default: ${common_1.
|
|
60
|
+
- Maximum: ${common_1.MCPConfigs.search.maxLimit}
|
|
61
|
+
- Default: ${common_1.MCPConfigs.search.defaultLimit}
|
|
61
62
|
|
|
62
63
|
RECOMMENDATIONS:
|
|
63
64
|
- Use default (10) for general queries
|
|
@@ -70,51 +71,54 @@ RECOMMENDATIONS:
|
|
|
70
71
|
const SearchResultSchema = zod_1.z.object({
|
|
71
72
|
id: zod_1.z
|
|
72
73
|
.string()
|
|
73
|
-
.describe(
|
|
74
|
-
title: zod_1.z.string().describe(
|
|
74
|
+
.describe('Unique document identifier (relative file path). Use with getDocContent to retrieve full document.'),
|
|
75
|
+
title: zod_1.z.string().describe('Human-readable document title from frontmatter or filename.'),
|
|
75
76
|
category: zod_1.z.string().describe('Document category (e.g., "Getting Started", "References").'),
|
|
76
|
-
snippet: zod_1.z.string().describe(
|
|
77
|
-
score: zod_1.z.number().optional().describe(
|
|
77
|
+
snippet: zod_1.z.string().describe('Content preview (max 300 chars) for quick assessment.'),
|
|
78
|
+
score: zod_1.z.number().optional().describe('Relevance score 0-1 (lower = better match).'),
|
|
78
79
|
});
|
|
79
80
|
const InputSchema = zod_1.z.object({
|
|
80
|
-
query: zod_1.z.string().min(common_1.
|
|
81
|
+
query: zod_1.z.string().min(common_1.MCPConfigs.search.minQueryLength).describe(QUERY_DESCRIPTION),
|
|
81
82
|
limit: zod_1.z
|
|
82
83
|
.number()
|
|
83
84
|
.int()
|
|
84
85
|
.min(1)
|
|
85
|
-
.max(common_1.
|
|
86
|
-
.default(common_1.
|
|
86
|
+
.max(common_1.MCPConfigs.search.maxLimit)
|
|
87
|
+
.default(common_1.MCPConfigs.search.defaultLimit)
|
|
87
88
|
.describe(LIMIT_DESCRIPTION),
|
|
88
89
|
});
|
|
89
|
-
const OutputSchema = zod_1.z
|
|
90
|
-
.
|
|
91
|
-
|
|
90
|
+
const OutputSchema = zod_1.z.object({
|
|
91
|
+
results: zod_1.z
|
|
92
|
+
.array(SearchResultSchema)
|
|
93
|
+
.describe('Search results sorted by relevance. Empty array if no matches.'),
|
|
94
|
+
});
|
|
92
95
|
// ----------------------------------------------------------------------------
|
|
93
96
|
// TOOL CLASS
|
|
94
97
|
// ----------------------------------------------------------------------------
|
|
95
98
|
class SearchDocsTool extends base_tool_1.BaseTool {
|
|
96
99
|
constructor() {
|
|
97
100
|
super(...arguments);
|
|
98
|
-
this.id =
|
|
101
|
+
this.id = 'searchDocuments';
|
|
99
102
|
this.description = TOOL_DESCRIPTION;
|
|
100
103
|
this.inputSchema = InputSchema;
|
|
101
104
|
this.outputSchema = OutputSchema;
|
|
102
105
|
}
|
|
103
|
-
async execute(
|
|
104
|
-
|
|
105
|
-
query:
|
|
106
|
-
limit:
|
|
106
|
+
async execute(opts) {
|
|
107
|
+
const results = await helpers_1.DocsHelper.searchDocuments({
|
|
108
|
+
query: opts.query,
|
|
109
|
+
limit: opts.limit,
|
|
107
110
|
});
|
|
111
|
+
return { results };
|
|
108
112
|
}
|
|
109
113
|
getTool() {
|
|
110
|
-
return (0,
|
|
114
|
+
return (0, tools_1.createTool)({
|
|
111
115
|
id: this.id,
|
|
112
116
|
description: this.description,
|
|
113
|
-
inputSchema:
|
|
114
|
-
outputSchema:
|
|
117
|
+
inputSchema: this.inputSchema,
|
|
118
|
+
outputSchema: this.outputSchema,
|
|
115
119
|
execute: async ({ context }) => this.execute(context),
|
|
116
120
|
});
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
exports.SearchDocsTool = SearchDocsTool;
|
|
120
|
-
//# sourceMappingURL=search-
|
|
124
|
+
//# sourceMappingURL=search-documents.tool.js.map
|