@venizia/ignis-docs 0.0.1-1
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/mcp-server/dist/common/config.d.ts +27 -0
- package/mcp-server/dist/common/config.d.ts.map +1 -0
- package/mcp-server/dist/common/config.js +27 -0
- package/mcp-server/dist/common/config.js.map +1 -0
- package/mcp-server/dist/common/index.d.ts +3 -0
- package/mcp-server/dist/common/index.d.ts.map +1 -0
- package/mcp-server/dist/common/index.js +19 -0
- package/mcp-server/dist/common/index.js.map +1 -0
- package/mcp-server/dist/common/paths.d.ts +13 -0
- package/mcp-server/dist/common/paths.d.ts.map +1 -0
- package/mcp-server/dist/common/paths.js +23 -0
- package/mcp-server/dist/common/paths.js.map +1 -0
- package/mcp-server/dist/helpers/docs.helper.d.ts +81 -0
- package/mcp-server/dist/helpers/docs.helper.d.ts.map +1 -0
- package/mcp-server/dist/helpers/docs.helper.js +171 -0
- package/mcp-server/dist/helpers/docs.helper.js.map +1 -0
- package/mcp-server/dist/helpers/index.d.ts +3 -0
- package/mcp-server/dist/helpers/index.d.ts.map +1 -0
- package/mcp-server/dist/helpers/index.js +19 -0
- package/mcp-server/dist/helpers/index.js.map +1 -0
- package/mcp-server/dist/helpers/logger.helper.d.ts +7 -0
- package/mcp-server/dist/helpers/logger.helper.d.ts.map +1 -0
- package/mcp-server/dist/helpers/logger.helper.js +22 -0
- package/mcp-server/dist/helpers/logger.helper.js.map +1 -0
- package/mcp-server/dist/index.d.ts +3 -0
- package/mcp-server/dist/index.d.ts.map +1 -0
- package/mcp-server/dist/index.js +62 -0
- package/mcp-server/dist/index.js.map +1 -0
- package/mcp-server/dist/tools/base.tool.d.ts +98 -0
- package/mcp-server/dist/tools/base.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/base.tool.js +47 -0
- package/mcp-server/dist/tools/base.tool.js.map +1 -0
- package/mcp-server/dist/tools/get-doc-content.tool.d.ts +30 -0
- package/mcp-server/dist/tools/get-doc-content.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/get-doc-content.tool.js +127 -0
- package/mcp-server/dist/tools/get-doc-content.tool.js.map +1 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts +40 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.js +121 -0
- package/mcp-server/dist/tools/get-doc-metadata.tool.js.map +1 -0
- package/mcp-server/dist/tools/index.d.ts +8 -0
- package/mcp-server/dist/tools/index.d.ts.map +1 -0
- package/mcp-server/dist/tools/index.js +18 -0
- package/mcp-server/dist/tools/index.js.map +1 -0
- package/mcp-server/dist/tools/list-categories.tool.d.ts +20 -0
- package/mcp-server/dist/tools/list-categories.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/list-categories.tool.js +105 -0
- package/mcp-server/dist/tools/list-categories.tool.js.map +1 -0
- package/mcp-server/dist/tools/list-docs.tool.d.ts +32 -0
- package/mcp-server/dist/tools/list-docs.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/list-docs.tool.js +121 -0
- package/mcp-server/dist/tools/list-docs.tool.js.map +1 -0
- package/mcp-server/dist/tools/search-docs.tool.d.ts +32 -0
- package/mcp-server/dist/tools/search-docs.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/search-docs.tool.js +120 -0
- package/mcp-server/dist/tools/search-docs.tool.js.map +1 -0
- package/package.json +102 -0
- package/wiki/get-started/5-minute-quickstart.md +266 -0
- package/wiki/get-started/best-practices/api-usage-examples.md +222 -0
- package/wiki/get-started/best-practices/architectural-patterns.md +129 -0
- package/wiki/get-started/best-practices/code-style-standards.md +122 -0
- package/wiki/get-started/best-practices/common-pitfalls.md +136 -0
- package/wiki/get-started/best-practices/contribution-workflow.md +145 -0
- package/wiki/get-started/best-practices/deployment-strategies.md +121 -0
- package/wiki/get-started/best-practices/performance-optimization.md +88 -0
- package/wiki/get-started/best-practices/security-guidelines.md +97 -0
- package/wiki/get-started/best-practices/troubleshooting-tips.md +100 -0
- package/wiki/get-started/building-a-crud-api.md +717 -0
- package/wiki/get-started/core-concepts/application.md +168 -0
- package/wiki/get-started/core-concepts/components.md +96 -0
- package/wiki/get-started/core-concepts/controllers.md +441 -0
- package/wiki/get-started/core-concepts/dependency-injection.md +160 -0
- package/wiki/get-started/core-concepts/persistent.md +591 -0
- package/wiki/get-started/core-concepts/services.md +88 -0
- package/wiki/get-started/index.md +65 -0
- package/wiki/get-started/mcp-docs-server.md +840 -0
- package/wiki/get-started/philosophy.md +123 -0
- package/wiki/get-started/prerequisites.md +113 -0
- package/wiki/get-started/quickstart.md +382 -0
- package/wiki/index.md +48 -0
- package/wiki/references/base/application.md +67 -0
- package/wiki/references/base/components.md +80 -0
- package/wiki/references/base/controllers.md +361 -0
- package/wiki/references/base/datasources.md +105 -0
- package/wiki/references/base/dependency-injection.md +83 -0
- package/wiki/references/base/models.md +104 -0
- package/wiki/references/base/repositories.md +118 -0
- package/wiki/references/base/services.md +97 -0
- package/wiki/references/components/authentication.md +224 -0
- package/wiki/references/components/health-check.md +190 -0
- package/wiki/references/components/index.md +61 -0
- package/wiki/references/components/request-tracker.md +35 -0
- package/wiki/references/components/socket-io.md +127 -0
- package/wiki/references/components/swagger.md +175 -0
- package/wiki/references/helpers/cron.md +94 -0
- package/wiki/references/helpers/crypto.md +117 -0
- package/wiki/references/helpers/env.md +67 -0
- package/wiki/references/helpers/error.md +80 -0
- package/wiki/references/helpers/index.md +21 -0
- package/wiki/references/helpers/inversion.md +141 -0
- package/wiki/references/helpers/logger.md +98 -0
- package/wiki/references/helpers/network.md +143 -0
- package/wiki/references/helpers/queue.md +131 -0
- package/wiki/references/helpers/redis.md +121 -0
- package/wiki/references/helpers/socket-io.md +103 -0
- package/wiki/references/helpers/storage.md +130 -0
- package/wiki/references/helpers/testing.md +115 -0
- package/wiki/references/helpers/worker-thread.md +162 -0
- package/wiki/references/src-details/core.md +249 -0
- package/wiki/references/src-details/dev-configs.md +302 -0
- package/wiki/references/src-details/docs.md +61 -0
- package/wiki/references/src-details/helpers.md +211 -0
- package/wiki/references/src-details/inversion.md +345 -0
- package/wiki/references/src-details/mcp-server.md +726 -0
- package/wiki/references/utilities/crypto.md +39 -0
- package/wiki/references/utilities/date.md +72 -0
- package/wiki/references/utilities/index.md +12 -0
- package/wiki/references/utilities/module.md +40 -0
- package/wiki/references/utilities/parse.md +68 -0
- package/wiki/references/utilities/performance.md +64 -0
- package/wiki/references/utilities/promise.md +83 -0
- package/wiki/references/utilities/request.md +66 -0
- package/wiki/references/utilities/schema.md +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.tool.d.ts","sourceRoot":"","sources":["../../tools/base.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAExD;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,CAAC;AAMtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,8BAAsB,QAAQ,CAC5B,YAAY,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,EAC1C,aAAa,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO;IAE3C;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAEtC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;IAE9C;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAE/E;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,OAAO,IAAI,WAAW;CAChC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseTool = exports.createTool = void 0;
|
|
4
|
+
const tools_1 = require("@mastra/core/tools");
|
|
5
|
+
Object.defineProperty(exports, "createTool", { enumerable: true, get: function () { return tools_1.createTool; } });
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// BASE TOOL CLASS
|
|
8
|
+
// ============================================================================
|
|
9
|
+
/**
|
|
10
|
+
* Abstract base class for all MCP documentation tools.
|
|
11
|
+
*
|
|
12
|
+
* Provides a consistent structure for tool implementation with:
|
|
13
|
+
* - Singleton pattern via getInstance()
|
|
14
|
+
* - Required abstract members for tool definition
|
|
15
|
+
* - Abstract toMastraTool() for type-safe conversion
|
|
16
|
+
*
|
|
17
|
+
* @template TInputSchema - The Zod input schema type
|
|
18
|
+
* @template TOutputSchema - The Zod output schema type
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* class MyTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
23
|
+
* readonly id = 'myTool';
|
|
24
|
+
* readonly description = 'Does something useful';
|
|
25
|
+
* readonly inputSchema = InputSchema;
|
|
26
|
+
* readonly outputSchema = OutputSchema;
|
|
27
|
+
*
|
|
28
|
+
* async execute(input: z.infer<typeof InputSchema>) {
|
|
29
|
+
* return { result: 'done' };
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* toMastraTool() {
|
|
33
|
+
* return createTool({
|
|
34
|
+
* id: this.id,
|
|
35
|
+
* description: this.description,
|
|
36
|
+
* inputSchema: this.inputSchema,
|
|
37
|
+
* outputSchema: this.outputSchema,
|
|
38
|
+
* execute: async ({ context }) => this.execute(context),
|
|
39
|
+
* });
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
class BaseTool {
|
|
45
|
+
}
|
|
46
|
+
exports.BaseTool = BaseTool;
|
|
47
|
+
//# sourceMappingURL=base.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.tool.js","sourceRoot":"","sources":["../../tools/base.tool.ts"],"names":[],"mappings":";;;AAAA,8CAAgD;AAevC,2FAfA,kBAAU,OAeA;AAEnB,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAsB,QAAQ;CA2D7B;AA3DD,4BA2DC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseTool, type TMastraTool } from "./base.tool";
|
|
3
|
+
declare const InputSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const OutputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
error: z.ZodString;
|
|
12
|
+
}, z.core.$strip>]>;
|
|
13
|
+
export declare class GetDocContentTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
14
|
+
readonly id = "getDocContent";
|
|
15
|
+
readonly description = "\nRetrieves the complete markdown content of a specific Ignis Framework documentation file.\n\nPURPOSE:\nUse this tool to fetch the full text of a documentation page when you need detailed information\nbeyond what search snippets provide. This is your primary tool for reading documentation content.\n\nWHEN TO USE:\n- After searchDocs returns relevant results and you need full content\n- When user asks for detailed explanation of a specific topic\n- To read code examples, API references, or configuration guides\n- When you need to quote or reference specific documentation sections\n\nWHEN NOT TO USE:\n- Don't use this for discovery - use searchDocs or listDocs first\n- Don't fetch multiple documents blindly - review search results first\n\nDOCUMENT ID FORMAT:\nThe 'id' parameter is the relative file path from the wiki root:\n- \"get-started/quickstart.md\" - Quickstart guide\n- \"references/components/http-server.md\" - HTTP Server component reference\n- \"get-started/core-concepts/dependency-injection.md\" - DI concepts\n\nHOW TO GET VALID IDs:\n1. Use searchDocs to find documents by keyword\n2. Use listDocs to browse all available documents\n3. Use listCategories + listDocs(category) for structured browsing\n\nOUTPUT:\nReturns full markdown content suitable for:\n- Answering user questions with accurate information\n- Extracting code examples\n- Understanding API usage patterns\n- Providing step-by-step guidance\n";
|
|
16
|
+
readonly inputSchema: z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
readonly outputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
content: z.ZodString;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
error: z.ZodString;
|
|
25
|
+
}, z.core.$strip>]>;
|
|
26
|
+
execute(input: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
27
|
+
getTool(): TMastraTool;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=get-doc-content.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-doc-content.tool.d.ts","sourceRoot":"","sources":["../../tools/get-doc-content.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AA8FrE,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;mBAEuD,CAAC;AAM1E,qBAAa,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACtF,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,WAAW,o6CAAoB;IACxC,QAAQ,CAAC,WAAW;;sBAAe;IACnC,QAAQ,CAAC,YAAY;;;;;;wBAAgB;IAE/B,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IAUxF,OAAO,IAAI,WAAW;CASvB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetDocContentTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const helpers_1 = require("../helpers");
|
|
6
|
+
const base_tool_1 = require("./base.tool");
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
|
+
// DESCRIPTIONS
|
|
9
|
+
// ----------------------------------------------------------------------------
|
|
10
|
+
const TOOL_DESCRIPTION = `
|
|
11
|
+
Retrieves the complete markdown content of a specific Ignis Framework documentation file.
|
|
12
|
+
|
|
13
|
+
PURPOSE:
|
|
14
|
+
Use this tool to fetch the full text of a documentation page when you need detailed information
|
|
15
|
+
beyond what search snippets provide. This is your primary tool for reading documentation content.
|
|
16
|
+
|
|
17
|
+
WHEN TO USE:
|
|
18
|
+
- After searchDocs returns relevant results and you need full content
|
|
19
|
+
- When user asks for detailed explanation of a specific topic
|
|
20
|
+
- To read code examples, API references, or configuration guides
|
|
21
|
+
- When you need to quote or reference specific documentation sections
|
|
22
|
+
|
|
23
|
+
WHEN NOT TO USE:
|
|
24
|
+
- Don't use this for discovery - use searchDocs or listDocs first
|
|
25
|
+
- Don't fetch multiple documents blindly - review search results first
|
|
26
|
+
|
|
27
|
+
DOCUMENT ID FORMAT:
|
|
28
|
+
The 'id' parameter is the relative file path from the wiki root:
|
|
29
|
+
- "get-started/quickstart.md" - Quickstart guide
|
|
30
|
+
- "references/components/http-server.md" - HTTP Server component reference
|
|
31
|
+
- "get-started/core-concepts/dependency-injection.md" - DI concepts
|
|
32
|
+
|
|
33
|
+
HOW TO GET VALID IDs:
|
|
34
|
+
1. Use searchDocs to find documents by keyword
|
|
35
|
+
2. Use listDocs to browse all available documents
|
|
36
|
+
3. Use listCategories + listDocs(category) for structured browsing
|
|
37
|
+
|
|
38
|
+
OUTPUT:
|
|
39
|
+
Returns full markdown content suitable for:
|
|
40
|
+
- Answering user questions with accurate information
|
|
41
|
+
- Extracting code examples
|
|
42
|
+
- Understanding API usage patterns
|
|
43
|
+
- Providing step-by-step guidance
|
|
44
|
+
`;
|
|
45
|
+
const ID_DESCRIPTION = `
|
|
46
|
+
Unique document identifier - the relative file path from the wiki root directory.
|
|
47
|
+
|
|
48
|
+
FORMAT: "<category>/<subcategory>/<filename>.md"
|
|
49
|
+
|
|
50
|
+
EXAMPLES:
|
|
51
|
+
- "get-started/quickstart.md"
|
|
52
|
+
- "get-started/core-concepts/dependency-injection.md"
|
|
53
|
+
- "references/components/http-server.md"
|
|
54
|
+
- "references/helpers/redis.md"
|
|
55
|
+
|
|
56
|
+
HOW TO OBTAIN:
|
|
57
|
+
- From searchDocs results (the 'id' field)
|
|
58
|
+
- From listDocs results (the 'id' field)
|
|
59
|
+
|
|
60
|
+
IMPORTANT:
|
|
61
|
+
- IDs are case-sensitive
|
|
62
|
+
- Must include the .md extension
|
|
63
|
+
- Invalid IDs return an error object instead of content
|
|
64
|
+
`;
|
|
65
|
+
const CONTENT_DESCRIPTION = `
|
|
66
|
+
Full markdown content of the documentation file.
|
|
67
|
+
|
|
68
|
+
CONTENT FORMAT:
|
|
69
|
+
- Raw markdown text without frontmatter (frontmatter is parsed separately)
|
|
70
|
+
- Includes all headings, code blocks, lists, links, and other markdown elements
|
|
71
|
+
- May contain Mermaid diagrams in fenced code blocks
|
|
72
|
+
- Internal links use relative paths
|
|
73
|
+
|
|
74
|
+
TYPICAL STRUCTURE:
|
|
75
|
+
- H1 heading as document title
|
|
76
|
+
- Introduction/overview paragraph
|
|
77
|
+
- Multiple H2/H3 sections with detailed content
|
|
78
|
+
- Code examples in fenced blocks with language hints
|
|
79
|
+
- Cross-references to related documentation
|
|
80
|
+
`;
|
|
81
|
+
// ----------------------------------------------------------------------------
|
|
82
|
+
// SCHEMAS
|
|
83
|
+
// ----------------------------------------------------------------------------
|
|
84
|
+
const SuccessSchema = zod_1.z.object({
|
|
85
|
+
id: zod_1.z.string().describe("The document ID that was requested."),
|
|
86
|
+
content: zod_1.z.string().describe(CONTENT_DESCRIPTION),
|
|
87
|
+
});
|
|
88
|
+
const ErrorSchema = zod_1.z.object({
|
|
89
|
+
id: zod_1.z.string().describe("The document ID that was requested but not found."),
|
|
90
|
+
error: zod_1.z.string().describe("Error message. Verify the ID using listDocs or searchDocs."),
|
|
91
|
+
});
|
|
92
|
+
const InputSchema = zod_1.z.object({
|
|
93
|
+
id: zod_1.z.string().min(1).describe(ID_DESCRIPTION),
|
|
94
|
+
});
|
|
95
|
+
const OutputSchema = zod_1.z
|
|
96
|
+
.union([SuccessSchema, ErrorSchema])
|
|
97
|
+
.describe("Document content on success, or error object if not found.");
|
|
98
|
+
// ----------------------------------------------------------------------------
|
|
99
|
+
// TOOL CLASS
|
|
100
|
+
// ----------------------------------------------------------------------------
|
|
101
|
+
class GetDocContentTool extends base_tool_1.BaseTool {
|
|
102
|
+
constructor() {
|
|
103
|
+
super(...arguments);
|
|
104
|
+
this.id = "getDocContent";
|
|
105
|
+
this.description = TOOL_DESCRIPTION;
|
|
106
|
+
this.inputSchema = InputSchema;
|
|
107
|
+
this.outputSchema = OutputSchema;
|
|
108
|
+
}
|
|
109
|
+
async execute(input) {
|
|
110
|
+
const content = await helpers_1.DocsHelper.getDocContent({ id: input.id });
|
|
111
|
+
if (!content) {
|
|
112
|
+
return { error: "Document not found", id: input.id };
|
|
113
|
+
}
|
|
114
|
+
return { content, id: input.id };
|
|
115
|
+
}
|
|
116
|
+
getTool() {
|
|
117
|
+
return (0, base_tool_1.createTool)({
|
|
118
|
+
id: this.id,
|
|
119
|
+
description: this.description,
|
|
120
|
+
inputSchema: InputSchema,
|
|
121
|
+
outputSchema: OutputSchema,
|
|
122
|
+
execute: async ({ context }) => this.execute(context),
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.GetDocContentTool = GetDocContentTool;
|
|
127
|
+
//# sourceMappingURL=get-doc-content.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-doc-content.tool.js","sourceRoot":"","sources":["../../tools/get-doc-content.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wCAAwC;AACxC,2CAAqE;AAErE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCxB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC;AAEF,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;CAe3B,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC9D,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CAClD,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;IAC5E,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;CACzF,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;CAC/C,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC;KACnB,KAAK,CAAC,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;KACnC,QAAQ,CAAC,4DAA4D,CAAC,CAAC;AAE1E,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,MAAa,iBAAkB,SAAQ,oBAAiD;IAAxF;;QACW,OAAE,GAAG,eAAe,CAAC;QACrB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,WAAW,CAAC;QAC1B,iBAAY,GAAG,YAAY,CAAC;IAqBvC,CAAC;IAnBC,KAAK,CAAC,OAAO,CAAC,KAAkC;QAC9C,MAAM,OAAO,GAAG,MAAM,oBAAU,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAEjE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACvD,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;IACnC,CAAC;IAED,OAAO;QACL,OAAO,IAAA,sBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAzBD,8CAyBC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseTool, type TMastraTool } from "./base.tool";
|
|
3
|
+
declare const InputSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const OutputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
category: z.ZodString;
|
|
10
|
+
wordCount: z.ZodNumber;
|
|
11
|
+
charCount: z.ZodNumber;
|
|
12
|
+
lastModified: z.ZodOptional<z.ZodDate>;
|
|
13
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
error: z.ZodString;
|
|
17
|
+
}, z.core.$strip>]>;
|
|
18
|
+
export declare class GetDocMetadataTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
19
|
+
readonly id = "getDocMetadata";
|
|
20
|
+
readonly description = "\nRetrieves statistical metadata about a specific Ignis Framework documentation file\nwithout fetching its full content.\n\nPURPOSE:\nUse this tool to get information ABOUT a document (size, word count, last modified)\nwithout retrieving the actual content. Useful for assessing documents before reading them fully.\n\nWHEN TO USE:\n- To check document length before fetching full content\n- To estimate reading time or complexity\n- To verify a document exists and get basic info\n- To check when documentation was last updated\n- When you need document stats for comparison or reporting\n\nWHEN NOT TO USE:\n- When you need the actual document content (use getDocContent instead)\n- For searching documents (use searchDocs instead)\n- For listing multiple documents (use listDocs instead)\n\nMETADATA FIELDS EXPLAINED:\n- wordCount: Total words in content body (excludes frontmatter)\n - Quick read: < 500 words\n - Medium: 500-1500 words\n - Long/detailed: > 1500 words\n\n- charCount: Total characters (useful for token estimation)\n - Rough token estimate: charCount / 4 for English text\n\n- lastModified: File modification timestamp\n - Recent = actively maintained documentation\n - Old = may need verification for accuracy\n\n- size: Raw file size in bytes (includes frontmatter YAML)\n\nUSE CASES:\n1. \"Is this document long?\" \u2192 Check wordCount\n2. \"Will this fit in context?\" \u2192 Check charCount, estimate tokens\n3. \"Is this documentation current?\" \u2192 Check lastModified\n4. \"Which document is more detailed?\" \u2192 Compare wordCounts\n";
|
|
21
|
+
readonly inputSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
readonly outputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
category: z.ZodString;
|
|
28
|
+
wordCount: z.ZodNumber;
|
|
29
|
+
charCount: z.ZodNumber;
|
|
30
|
+
lastModified: z.ZodOptional<z.ZodDate>;
|
|
31
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
error: z.ZodString;
|
|
35
|
+
}, z.core.$strip>]>;
|
|
36
|
+
execute(input: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
37
|
+
getTool(): TMastraTool;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=get-doc-metadata.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-doc-metadata.tool.d.ts","sourceRoot":"","sources":["../../tools/get-doc-metadata.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAuFrE,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;mBAEwD,CAAC;AAM3E,qBAAa,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACvF,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,WAAW,6iDAAoB;IACxC,QAAQ,CAAC,WAAW;;sBAAe;IACnC,QAAQ,CAAC,YAAY;;;;;;;;;;;wBAAgB;IAE/B,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IAUxF,OAAO,IAAI,WAAW;CASvB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetDocMetadataTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const helpers_1 = require("../helpers");
|
|
6
|
+
const base_tool_1 = require("./base.tool");
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
|
+
// DESCRIPTIONS
|
|
9
|
+
// ----------------------------------------------------------------------------
|
|
10
|
+
const TOOL_DESCRIPTION = `
|
|
11
|
+
Retrieves statistical metadata about a specific Ignis Framework documentation file
|
|
12
|
+
without fetching its full content.
|
|
13
|
+
|
|
14
|
+
PURPOSE:
|
|
15
|
+
Use this tool to get information ABOUT a document (size, word count, last modified)
|
|
16
|
+
without retrieving the actual content. Useful for assessing documents before reading them fully.
|
|
17
|
+
|
|
18
|
+
WHEN TO USE:
|
|
19
|
+
- To check document length before fetching full content
|
|
20
|
+
- To estimate reading time or complexity
|
|
21
|
+
- To verify a document exists and get basic info
|
|
22
|
+
- To check when documentation was last updated
|
|
23
|
+
- When you need document stats for comparison or reporting
|
|
24
|
+
|
|
25
|
+
WHEN NOT TO USE:
|
|
26
|
+
- When you need the actual document content (use getDocContent instead)
|
|
27
|
+
- For searching documents (use searchDocs instead)
|
|
28
|
+
- For listing multiple documents (use listDocs instead)
|
|
29
|
+
|
|
30
|
+
METADATA FIELDS EXPLAINED:
|
|
31
|
+
- wordCount: Total words in content body (excludes frontmatter)
|
|
32
|
+
- Quick read: < 500 words
|
|
33
|
+
- Medium: 500-1500 words
|
|
34
|
+
- Long/detailed: > 1500 words
|
|
35
|
+
|
|
36
|
+
- charCount: Total characters (useful for token estimation)
|
|
37
|
+
- Rough token estimate: charCount / 4 for English text
|
|
38
|
+
|
|
39
|
+
- lastModified: File modification timestamp
|
|
40
|
+
- Recent = actively maintained documentation
|
|
41
|
+
- Old = may need verification for accuracy
|
|
42
|
+
|
|
43
|
+
- size: Raw file size in bytes (includes frontmatter YAML)
|
|
44
|
+
|
|
45
|
+
USE CASES:
|
|
46
|
+
1. "Is this document long?" → Check wordCount
|
|
47
|
+
2. "Will this fit in context?" → Check charCount, estimate tokens
|
|
48
|
+
3. "Is this documentation current?" → Check lastModified
|
|
49
|
+
4. "Which document is more detailed?" → Compare wordCounts
|
|
50
|
+
`;
|
|
51
|
+
const ID_DESCRIPTION = `
|
|
52
|
+
Unique document identifier - the relative file path from the wiki root directory.
|
|
53
|
+
|
|
54
|
+
FORMAT: "<category>/<subcategory>/<filename>.md"
|
|
55
|
+
|
|
56
|
+
EXAMPLES:
|
|
57
|
+
- "get-started/quickstart.md"
|
|
58
|
+
- "references/components/http-server.md"
|
|
59
|
+
- "get-started/core-concepts/dependency-injection.md"
|
|
60
|
+
|
|
61
|
+
HOW TO OBTAIN:
|
|
62
|
+
- From searchDocs results (the 'id' field)
|
|
63
|
+
- From listDocs results (the 'id' field)
|
|
64
|
+
|
|
65
|
+
IMPORTANT:
|
|
66
|
+
- IDs are case-sensitive
|
|
67
|
+
- Must include the .md extension
|
|
68
|
+
- Invalid IDs return an error object
|
|
69
|
+
`;
|
|
70
|
+
// ----------------------------------------------------------------------------
|
|
71
|
+
// SCHEMAS
|
|
72
|
+
// ----------------------------------------------------------------------------
|
|
73
|
+
const SuccessSchema = zod_1.z.object({
|
|
74
|
+
id: zod_1.z.string().describe("The document ID that was requested."),
|
|
75
|
+
title: zod_1.z.string().describe("Document title from frontmatter or filename."),
|
|
76
|
+
category: zod_1.z.string().describe('Document category (e.g., "Getting Started", "References").'),
|
|
77
|
+
wordCount: zod_1.z.number().int().describe("Total words. Useful for reading time estimation."),
|
|
78
|
+
charCount: zod_1.z.number().int().describe("Total characters. Useful for token estimation."),
|
|
79
|
+
lastModified: zod_1.z.date().optional().describe("Last modified timestamp. May be undefined."),
|
|
80
|
+
size: zod_1.z.number().int().optional().describe("File size in bytes. May be undefined."),
|
|
81
|
+
});
|
|
82
|
+
const ErrorSchema = zod_1.z.object({
|
|
83
|
+
id: zod_1.z.string().describe("The document ID that was requested but not found."),
|
|
84
|
+
error: zod_1.z.string().describe("Error message indicating the document was not found."),
|
|
85
|
+
});
|
|
86
|
+
const InputSchema = zod_1.z.object({
|
|
87
|
+
id: zod_1.z.string().min(1).describe(ID_DESCRIPTION),
|
|
88
|
+
});
|
|
89
|
+
const OutputSchema = zod_1.z
|
|
90
|
+
.union([SuccessSchema, ErrorSchema])
|
|
91
|
+
.describe("Document metadata on success, or error object if not found.");
|
|
92
|
+
// ----------------------------------------------------------------------------
|
|
93
|
+
// TOOL CLASS
|
|
94
|
+
// ----------------------------------------------------------------------------
|
|
95
|
+
class GetDocMetadataTool extends base_tool_1.BaseTool {
|
|
96
|
+
constructor() {
|
|
97
|
+
super(...arguments);
|
|
98
|
+
this.id = "getDocMetadata";
|
|
99
|
+
this.description = TOOL_DESCRIPTION;
|
|
100
|
+
this.inputSchema = InputSchema;
|
|
101
|
+
this.outputSchema = OutputSchema;
|
|
102
|
+
}
|
|
103
|
+
async execute(input) {
|
|
104
|
+
const metadata = await helpers_1.DocsHelper.getDocMetadata({ id: input.id });
|
|
105
|
+
if (!metadata) {
|
|
106
|
+
return { error: "Document not found", id: input.id };
|
|
107
|
+
}
|
|
108
|
+
return metadata;
|
|
109
|
+
}
|
|
110
|
+
getTool() {
|
|
111
|
+
return (0, base_tool_1.createTool)({
|
|
112
|
+
id: this.id,
|
|
113
|
+
description: this.description,
|
|
114
|
+
inputSchema: InputSchema,
|
|
115
|
+
outputSchema: OutputSchema,
|
|
116
|
+
execute: async ({ context }) => this.execute(context),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.GetDocMetadataTool = GetDocMetadataTool;
|
|
121
|
+
//# sourceMappingURL=get-doc-metadata.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-doc-metadata.tool.js","sourceRoot":"","sources":["../../tools/get-doc-metadata.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wCAAwC;AACxC,2CAAqE;AAErE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCxB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;CAkBtB,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC9D,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC1E,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;IAC3F,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IACxF,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACtF,YAAY,EAAE,OAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IACxF,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CACpF,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;IAC5E,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;CACnF,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;CAC/C,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC;KACnB,KAAK,CAAC,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;KACnC,QAAQ,CAAC,6DAA6D,CAAC,CAAC;AAE3E,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,MAAa,kBAAmB,SAAQ,oBAAiD;IAAzF;;QACW,OAAE,GAAG,gBAAgB,CAAC;QACtB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,WAAW,CAAC;QAC1B,iBAAY,GAAG,YAAY,CAAC;IAqBvC,CAAC;IAnBC,KAAK,CAAC,OAAO,CAAC,KAAkC;QAC9C,MAAM,QAAQ,GAAG,MAAM,oBAAU,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAEnE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACvD,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO;QACL,OAAO,IAAA,sBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAzBD,gDAyBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BaseTool } from "./base.tool";
|
|
2
|
+
export type { TMastraTool as MastraTool } from "./base.tool";
|
|
3
|
+
export { SearchDocsTool } from "./search-docs.tool";
|
|
4
|
+
export { GetDocContentTool } from "./get-doc-content.tool";
|
|
5
|
+
export { GetDocMetadataTool } from "./get-doc-metadata.tool";
|
|
6
|
+
export { ListDocsTool } from "./list-docs.tool";
|
|
7
|
+
export { ListCategoriesTool } from "./list-categories.tool";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListCategoriesTool = exports.ListDocsTool = exports.GetDocMetadataTool = exports.GetDocContentTool = exports.SearchDocsTool = exports.BaseTool = void 0;
|
|
4
|
+
// Base class
|
|
5
|
+
var base_tool_1 = require("./base.tool");
|
|
6
|
+
Object.defineProperty(exports, "BaseTool", { enumerable: true, get: function () { return base_tool_1.BaseTool; } });
|
|
7
|
+
// Tool classes
|
|
8
|
+
var search_docs_tool_1 = require("./search-docs.tool");
|
|
9
|
+
Object.defineProperty(exports, "SearchDocsTool", { enumerable: true, get: function () { return search_docs_tool_1.SearchDocsTool; } });
|
|
10
|
+
var get_doc_content_tool_1 = require("./get-doc-content.tool");
|
|
11
|
+
Object.defineProperty(exports, "GetDocContentTool", { enumerable: true, get: function () { return get_doc_content_tool_1.GetDocContentTool; } });
|
|
12
|
+
var get_doc_metadata_tool_1 = require("./get-doc-metadata.tool");
|
|
13
|
+
Object.defineProperty(exports, "GetDocMetadataTool", { enumerable: true, get: function () { return get_doc_metadata_tool_1.GetDocMetadataTool; } });
|
|
14
|
+
var list_docs_tool_1 = require("./list-docs.tool");
|
|
15
|
+
Object.defineProperty(exports, "ListDocsTool", { enumerable: true, get: function () { return list_docs_tool_1.ListDocsTool; } });
|
|
16
|
+
var list_categories_tool_1 = require("./list-categories.tool");
|
|
17
|
+
Object.defineProperty(exports, "ListCategoriesTool", { enumerable: true, get: function () { return list_categories_tool_1.ListCategoriesTool; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACb,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAGjB,eAAe;AACf,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseTool, type TMastraTool } from "./base.tool";
|
|
3
|
+
declare const InputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
4
|
+
declare const OutputSchema: z.ZodObject<{
|
|
5
|
+
count: z.ZodNumber;
|
|
6
|
+
categories: z.ZodArray<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare class ListCategoriesTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
9
|
+
readonly id = "listCategories";
|
|
10
|
+
readonly description = "\nLists all unique documentation categories available in the Ignis Framework documentation.\n\nPURPOSE:\nUse this tool to discover the organizational structure of the documentation.\nCategories group related documents together, making it easier to navigate\nand understand the documentation hierarchy.\n\nWHEN TO USE:\n- Before using listDocs with a category filter\n- To understand how documentation is organized\n- To help users navigate to relevant sections\n- When exploring the documentation structure\n- To verify exact category names (they are case-sensitive)\n\nWHEN NOT TO USE:\n- When you already know the category you need\n- When searching for specific content (use searchDocs)\n- When you need document content (use getDocContent)\n\nWORKFLOW RECOMMENDATIONS:\n1. Discovery workflow:\n listCategories() \u2192 Pick relevant category \u2192 listDocs(category) \u2192 getDocContent(id)\n\n2. Help user navigate:\n listCategories() \u2192 Present options to user \u2192 Based on selection, listDocs(category)\n\n3. Comprehensive overview:\n listCategories() \u2192 For each category, listDocs(category) \u2192 Summarize structure\n\nCATEGORY NAMING:\n- Categories are defined in document frontmatter\n- Names are case-sensitive when filtering\n- Sorted alphabetically in output\n- \"Uncategorized\" may appear for documents without explicit category\n\nOUTPUT:\nReturns count and alphabetically sorted array of unique category names.\n";
|
|
11
|
+
readonly inputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
12
|
+
readonly outputSchema: z.ZodObject<{
|
|
13
|
+
count: z.ZodNumber;
|
|
14
|
+
categories: z.ZodArray<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
execute(_input: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
17
|
+
getTool(): TMastraTool;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=list-categories.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-categories.tool.d.ts","sourceRoot":"","sources":["../../tools/list-categories.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAsErE,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,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IASzF,OAAO,IAAI,WAAW;CASvB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListCategoriesTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const helpers_1 = require("../helpers");
|
|
6
|
+
const base_tool_1 = require("./base.tool");
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
|
+
// DESCRIPTIONS
|
|
9
|
+
// ----------------------------------------------------------------------------
|
|
10
|
+
const TOOL_DESCRIPTION = `
|
|
11
|
+
Lists all unique documentation categories available in the Ignis Framework documentation.
|
|
12
|
+
|
|
13
|
+
PURPOSE:
|
|
14
|
+
Use this tool to discover the organizational structure of the documentation.
|
|
15
|
+
Categories group related documents together, making it easier to navigate
|
|
16
|
+
and understand the documentation hierarchy.
|
|
17
|
+
|
|
18
|
+
WHEN TO USE:
|
|
19
|
+
- Before using listDocs with a category filter
|
|
20
|
+
- To understand how documentation is organized
|
|
21
|
+
- To help users navigate to relevant sections
|
|
22
|
+
- When exploring the documentation structure
|
|
23
|
+
- To verify exact category names (they are case-sensitive)
|
|
24
|
+
|
|
25
|
+
WHEN NOT TO USE:
|
|
26
|
+
- When you already know the category you need
|
|
27
|
+
- When searching for specific content (use searchDocs)
|
|
28
|
+
- When you need document content (use getDocContent)
|
|
29
|
+
|
|
30
|
+
WORKFLOW RECOMMENDATIONS:
|
|
31
|
+
1. Discovery workflow:
|
|
32
|
+
listCategories() → Pick relevant category → listDocs(category) → getDocContent(id)
|
|
33
|
+
|
|
34
|
+
2. Help user navigate:
|
|
35
|
+
listCategories() → Present options to user → Based on selection, listDocs(category)
|
|
36
|
+
|
|
37
|
+
3. Comprehensive overview:
|
|
38
|
+
listCategories() → For each category, listDocs(category) → Summarize structure
|
|
39
|
+
|
|
40
|
+
CATEGORY NAMING:
|
|
41
|
+
- Categories are defined in document frontmatter
|
|
42
|
+
- Names are case-sensitive when filtering
|
|
43
|
+
- Sorted alphabetically in output
|
|
44
|
+
- "Uncategorized" may appear for documents without explicit category
|
|
45
|
+
|
|
46
|
+
OUTPUT:
|
|
47
|
+
Returns count and alphabetically sorted array of unique category names.
|
|
48
|
+
`;
|
|
49
|
+
const CATEGORIES_DESCRIPTION = `
|
|
50
|
+
Array of unique category names sorted alphabetically.
|
|
51
|
+
|
|
52
|
+
CATEGORY SOURCES:
|
|
53
|
+
Categories are extracted from the "category" frontmatter field in each markdown document.
|
|
54
|
+
Documents without a category field are grouped under "Uncategorized".
|
|
55
|
+
|
|
56
|
+
TYPICAL IGNIS CATEGORIES:
|
|
57
|
+
- "Getting Started" - Introductory guides and tutorials
|
|
58
|
+
- "Core Concepts" - Fundamental framework concepts (DI, lifecycle, etc.)
|
|
59
|
+
- "Best Practices" - Recommended patterns and approaches
|
|
60
|
+
- "References" - Detailed API and component documentation
|
|
61
|
+
- "Helpers" - Documentation for helper libraries
|
|
62
|
+
- "Utilities" - Utility function references
|
|
63
|
+
- "Source Details" - Internal implementation documentation
|
|
64
|
+
|
|
65
|
+
USE WITH listDocs:
|
|
66
|
+
Pass any category name to listDocs(category) to filter documents by that category.
|
|
67
|
+
`;
|
|
68
|
+
// ----------------------------------------------------------------------------
|
|
69
|
+
// SCHEMAS
|
|
70
|
+
// ----------------------------------------------------------------------------
|
|
71
|
+
const InputSchema = zod_1.z.object({}).describe("No input parameters required.");
|
|
72
|
+
const OutputSchema = zod_1.z.object({
|
|
73
|
+
count: zod_1.z.number().int().describe("Total number of unique categories."),
|
|
74
|
+
categories: zod_1.z.array(zod_1.z.string()).describe(CATEGORIES_DESCRIPTION),
|
|
75
|
+
});
|
|
76
|
+
// ----------------------------------------------------------------------------
|
|
77
|
+
// TOOL CLASS
|
|
78
|
+
// ----------------------------------------------------------------------------
|
|
79
|
+
class ListCategoriesTool extends base_tool_1.BaseTool {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
this.id = "listCategories";
|
|
83
|
+
this.description = TOOL_DESCRIPTION;
|
|
84
|
+
this.inputSchema = InputSchema;
|
|
85
|
+
this.outputSchema = OutputSchema;
|
|
86
|
+
}
|
|
87
|
+
async execute(_input) {
|
|
88
|
+
const categories = await helpers_1.DocsHelper.listCategories();
|
|
89
|
+
return {
|
|
90
|
+
count: categories.length,
|
|
91
|
+
categories,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
getTool() {
|
|
95
|
+
return (0, base_tool_1.createTool)({
|
|
96
|
+
id: this.id,
|
|
97
|
+
description: this.description,
|
|
98
|
+
inputSchema: InputSchema,
|
|
99
|
+
outputSchema: OutputSchema,
|
|
100
|
+
execute: async ({ context }) => this.execute(context),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.ListCategoriesTool = ListCategoriesTool;
|
|
105
|
+
//# sourceMappingURL=list-categories.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-categories.tool.js","sourceRoot":"","sources":["../../tools/list-categories.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,wCAAwC;AACxC,2CAAqE;AAErE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCxB,CAAC;AAEF,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;CAkB9B,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AAE3E,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACtE,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;CACjE,CAAC,CAAC;AAEH,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,MAAa,kBAAmB,SAAQ,oBAAiD;IAAzF;;QACW,OAAE,GAAG,gBAAgB,CAAC;QACtB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,WAAW,CAAC;QAC1B,iBAAY,GAAG,YAAY,CAAC;IAoBvC,CAAC;IAlBC,KAAK,CAAC,OAAO,CAAC,MAAmC;QAC/C,MAAM,UAAU,GAAG,MAAM,oBAAU,CAAC,cAAc,EAAE,CAAC;QAErD,OAAO;YACL,KAAK,EAAE,UAAU,CAAC,MAAM;YACxB,UAAU;SACX,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,IAAA,sBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,gDAwBC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseTool, type TMastraTool } from "./base.tool";
|
|
3
|
+
declare const InputSchema: z.ZodObject<{
|
|
4
|
+
category: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const OutputSchema: z.ZodObject<{
|
|
7
|
+
count: z.ZodNumber;
|
|
8
|
+
docs: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
category: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare class ListDocsTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
|
|
15
|
+
readonly id = "listDocs";
|
|
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
|
+
readonly inputSchema: z.ZodObject<{
|
|
18
|
+
category: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
readonly outputSchema: z.ZodObject<{
|
|
21
|
+
count: z.ZodNumber;
|
|
22
|
+
docs: z.ZodArray<z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
title: z.ZodString;
|
|
25
|
+
category: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
execute(input: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
|
|
29
|
+
getTool(): TMastraTool;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=list-docs.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-docs.tool.d.ts","sourceRoot":"","sources":["../../tools/list-docs.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAqFrE,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,cAAc;IACzB,QAAQ,CAAC,WAAW,+sDAAoB;IACxC,QAAQ,CAAC,WAAW;;sBAAe;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"}
|