@venizia/ignis-docs 0.0.1-4 → 0.0.1-6

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.
Files changed (107) hide show
  1. package/mcp-server/dist/common/config.d.ts +58 -21
  2. package/mcp-server/dist/common/config.d.ts.map +1 -1
  3. package/mcp-server/dist/common/config.js +67 -12
  4. package/mcp-server/dist/common/config.js.map +1 -1
  5. package/mcp-server/dist/helpers/docs.helper.d.ts +5 -5
  6. package/mcp-server/dist/helpers/docs.helper.d.ts.map +1 -1
  7. package/mcp-server/dist/helpers/docs.helper.js +31 -27
  8. package/mcp-server/dist/helpers/docs.helper.js.map +1 -1
  9. package/mcp-server/dist/helpers/github.helper.d.ts +37 -0
  10. package/mcp-server/dist/helpers/github.helper.d.ts.map +1 -0
  11. package/mcp-server/dist/helpers/github.helper.js +100 -0
  12. package/mcp-server/dist/helpers/github.helper.js.map +1 -0
  13. package/mcp-server/dist/helpers/index.d.ts +1 -0
  14. package/mcp-server/dist/helpers/index.d.ts.map +1 -1
  15. package/mcp-server/dist/helpers/index.js +1 -0
  16. package/mcp-server/dist/helpers/index.js.map +1 -1
  17. package/mcp-server/dist/index.js +60 -32
  18. package/mcp-server/dist/index.js.map +1 -1
  19. package/mcp-server/dist/tools/base.tool.d.ts +6 -10
  20. package/mcp-server/dist/tools/base.tool.d.ts.map +1 -1
  21. package/mcp-server/dist/tools/base.tool.js +3 -5
  22. package/mcp-server/dist/tools/base.tool.js.map +1 -1
  23. package/mcp-server/dist/tools/{get-doc-content.tool.d.ts → docs/get-document-content.tool.d.ts} +4 -4
  24. package/mcp-server/dist/tools/docs/get-document-content.tool.d.ts.map +1 -0
  25. package/mcp-server/dist/tools/{get-doc-content.tool.js → docs/get-document-content.tool.js} +12 -11
  26. package/mcp-server/dist/tools/docs/get-document-content.tool.js.map +1 -0
  27. package/mcp-server/dist/tools/{get-doc-metadata.tool.d.ts → docs/get-document-metadata.tool.d.ts} +4 -4
  28. package/mcp-server/dist/tools/docs/get-document-metadata.tool.d.ts.map +1 -0
  29. package/mcp-server/dist/tools/{get-doc-metadata.tool.js → docs/get-document-metadata.tool.js} +11 -10
  30. package/mcp-server/dist/tools/docs/get-document-metadata.tool.js.map +1 -0
  31. package/mcp-server/dist/tools/docs/get-package-overview.tool.d.ts +50 -0
  32. package/mcp-server/dist/tools/docs/get-package-overview.tool.d.ts.map +1 -0
  33. package/mcp-server/dist/tools/docs/get-package-overview.tool.js +221 -0
  34. package/mcp-server/dist/tools/docs/get-package-overview.tool.js.map +1 -0
  35. package/mcp-server/dist/tools/docs/index.d.ts +7 -0
  36. package/mcp-server/dist/tools/docs/index.d.ts.map +1 -0
  37. package/mcp-server/dist/tools/docs/index.js +23 -0
  38. package/mcp-server/dist/tools/docs/index.js.map +1 -0
  39. package/mcp-server/dist/tools/{list-categories.tool.d.ts → docs/list-categories.tool.d.ts} +2 -2
  40. package/mcp-server/dist/tools/docs/list-categories.tool.d.ts.map +1 -0
  41. package/mcp-server/dist/tools/{list-categories.tool.js → docs/list-categories.tool.js} +7 -6
  42. package/mcp-server/dist/tools/docs/list-categories.tool.js.map +1 -0
  43. package/mcp-server/dist/tools/{list-docs.tool.d.ts → docs/list-documents.tool.d.ts} +4 -4
  44. package/mcp-server/dist/tools/docs/list-documents.tool.d.ts.map +1 -0
  45. package/mcp-server/dist/tools/{list-docs.tool.js → docs/list-documents.tool.js} +10 -9
  46. package/mcp-server/dist/tools/docs/list-documents.tool.js.map +1 -0
  47. package/mcp-server/dist/tools/{search-docs.tool.d.ts → docs/search-documents.tool.d.ts} +4 -4
  48. package/mcp-server/dist/tools/docs/search-documents.tool.d.ts.map +1 -0
  49. package/mcp-server/dist/tools/{search-docs.tool.js → docs/search-documents.tool.js} +19 -18
  50. package/mcp-server/dist/tools/docs/search-documents.tool.js.map +1 -0
  51. package/mcp-server/dist/tools/github/index.d.ts +5 -0
  52. package/mcp-server/dist/tools/github/index.d.ts.map +1 -0
  53. package/mcp-server/dist/tools/github/index.js +21 -0
  54. package/mcp-server/dist/tools/github/index.js.map +1 -0
  55. package/mcp-server/dist/tools/github/list-project-files.tool.d.ts +28 -0
  56. package/mcp-server/dist/tools/github/list-project-files.tool.d.ts.map +1 -0
  57. package/mcp-server/dist/tools/github/list-project-files.tool.js +98 -0
  58. package/mcp-server/dist/tools/github/list-project-files.tool.js.map +1 -0
  59. package/mcp-server/dist/tools/github/search-code.tool.d.ts +42 -0
  60. package/mcp-server/dist/tools/github/search-code.tool.d.ts.map +1 -0
  61. package/mcp-server/dist/tools/github/search-code.tool.js +194 -0
  62. package/mcp-server/dist/tools/github/search-code.tool.js.map +1 -0
  63. package/mcp-server/dist/tools/github/verify-dependencies.tool.d.ts +55 -0
  64. package/mcp-server/dist/tools/github/verify-dependencies.tool.d.ts.map +1 -0
  65. package/mcp-server/dist/tools/github/verify-dependencies.tool.js +167 -0
  66. package/mcp-server/dist/tools/github/verify-dependencies.tool.js.map +1 -0
  67. package/mcp-server/dist/tools/github/view-source-file.tool.d.ts +26 -0
  68. package/mcp-server/dist/tools/github/view-source-file.tool.d.ts.map +1 -0
  69. package/mcp-server/dist/tools/github/view-source-file.tool.js +91 -0
  70. package/mcp-server/dist/tools/github/view-source-file.tool.js.map +1 -0
  71. package/mcp-server/dist/tools/index.d.ts +3 -7
  72. package/mcp-server/dist/tools/index.d.ts.map +1 -1
  73. package/mcp-server/dist/tools/index.js +17 -13
  74. package/mcp-server/dist/tools/index.js.map +1 -1
  75. package/package.json +25 -6
  76. package/wiki/get-started/best-practices/api-usage-examples.md +42 -0
  77. package/wiki/get-started/best-practices/architectural-patterns.md +42 -1
  78. package/wiki/get-started/best-practices/code-style-standards.md +41 -0
  79. package/wiki/get-started/best-practices/contribution-workflow.md +40 -6
  80. package/wiki/get-started/best-practices/data-modeling.md +126 -0
  81. package/wiki/get-started/core-concepts/dependency-injection.md +13 -1
  82. package/wiki/get-started/mcp-docs-server.md +130 -32
  83. package/wiki/get-started/philosophy.md +198 -25
  84. package/wiki/public/logo.svg +1 -0
  85. package/wiki/references/base/application.md +5 -5
  86. package/wiki/references/base/controllers.md +3 -1
  87. package/wiki/references/base/dependency-injection.md +6 -5
  88. package/wiki/references/base/models.md +319 -1
  89. package/wiki/references/components/index.md +3 -1
  90. package/wiki/references/components/static-asset.md +1289 -0
  91. package/wiki/references/helpers/inversion.md +21 -11
  92. package/wiki/references/helpers/storage.md +538 -11
  93. package/wiki/references/src-details/core.md +15 -1
  94. package/wiki/references/src-details/docs.md +19 -9
  95. package/wiki/references/src-details/mcp-server.md +185 -234
  96. package/wiki/references/utilities/index.md +1 -1
  97. package/wiki/references/utilities/request.md +150 -0
  98. package/mcp-server/dist/tools/get-doc-content.tool.d.ts.map +0 -1
  99. package/mcp-server/dist/tools/get-doc-content.tool.js.map +0 -1
  100. package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts.map +0 -1
  101. package/mcp-server/dist/tools/get-doc-metadata.tool.js.map +0 -1
  102. package/mcp-server/dist/tools/list-categories.tool.d.ts.map +0 -1
  103. package/mcp-server/dist/tools/list-categories.tool.js.map +0 -1
  104. package/mcp-server/dist/tools/list-docs.tool.d.ts.map +0 -1
  105. package/mcp-server/dist/tools/list-docs.tool.js.map +0 -1
  106. package/mcp-server/dist/tools/search-docs.tool.d.ts.map +0 -1
  107. package/mcp-server/dist/tools/search-docs.tool.js.map +0 -1
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListProjectFilesTool = void 0;
4
+ const tools_1 = require("@mastra/core/tools");
5
+ const zod_1 = require("zod");
6
+ const base_tool_1 = require("../base.tool");
7
+ const helpers_1 = require("@/mcp-server/helpers");
8
+ // ----------------------------------------------------------------------------
9
+ // DESCRIPTIONS
10
+ // ----------------------------------------------------------------------------
11
+ const TOOL_DESCRIPTION = `
12
+ Lists files and directories within the Ignis GitHub repository.
13
+
14
+ PURPOSE:
15
+ Explore the project structure, discover source code files, and navigate the monorepo.
16
+ Primary tool for understanding codebase layout before reading specific files.
17
+
18
+ WHEN TO USE:
19
+ - To understand overall project structure
20
+ - To find location of specific modules (e.g., "where are the controllers?")
21
+ - To get list of files in a directory before using viewSourceFile
22
+ - To find configuration files, examples, or documentation
23
+
24
+ WHEN NOT TO USE:
25
+ - When searching for specific code patterns or keywords (use searchCode instead)
26
+ - When you need to read a file's content (use viewSourceFile instead)
27
+ - For documentation content (use searchDocs, listDocs, getDocContent instead)
28
+
29
+ WORKFLOW:
30
+ 1. Start at root: listProjectFiles()
31
+ 2. Explore a package: listProjectFiles({ directoryPath: "packages/core/src" })
32
+ 3. Identify a file of interest
33
+ 4. Read the file: viewSourceFile({ filePath: "packages/core/src/application.ts" })
34
+ `;
35
+ const DIRECTORY_PATH_DESCRIPTION = `
36
+ The path to the directory you want to list, relative to the project root.
37
+ If omitted, it defaults to the root of the repository.
38
+
39
+ EXAMPLES:
40
+ - "." (or omitted) -> lists the root directory
41
+ - "packages" -> lists the contents of the 'packages' directory
42
+ - "packages/core/src" -> lists the source files of the core package
43
+ `;
44
+ // ----------------------------------------------------------------------------
45
+ // SCHEMAS
46
+ // ----------------------------------------------------------------------------
47
+ const InputSchema = zod_1.z.object({
48
+ directoryPath: zod_1.z.string().default('.').describe(DIRECTORY_PATH_DESCRIPTION),
49
+ });
50
+ const OutputSchema = zod_1.z.object({
51
+ directoryPath: zod_1.z.string(),
52
+ files: zod_1.z.array(zod_1.z.string()).describe('A list of file names within the specified directory.'),
53
+ directories: zod_1.z
54
+ .array(zod_1.z.string())
55
+ .describe('A list of subdirectory names within the specified directory.'),
56
+ error: zod_1.z.string().optional().describe('An error message if the directory could not be listed.'),
57
+ });
58
+ // ----------------------------------------------------------------------------
59
+ // TOOL CLASS
60
+ // ----------------------------------------------------------------------------
61
+ class ListProjectFilesTool extends base_tool_1.BaseTool {
62
+ constructor() {
63
+ super(...arguments);
64
+ this.id = 'listProjectFiles';
65
+ this.description = TOOL_DESCRIPTION;
66
+ this.inputSchema = InputSchema;
67
+ this.outputSchema = OutputSchema;
68
+ }
69
+ async execute(opts) {
70
+ const contents = await helpers_1.GithubHelper.getDirectoryContents({ path: opts.directoryPath });
71
+ if ('error' in contents) {
72
+ return {
73
+ directoryPath: opts.directoryPath,
74
+ files: [],
75
+ directories: [],
76
+ error: contents.error,
77
+ };
78
+ }
79
+ const files = contents.filter(item => item.type === 'file').map(item => item.name);
80
+ const directories = contents.filter(item => item.type === 'dir').map(item => item.name);
81
+ return {
82
+ directoryPath: opts.directoryPath,
83
+ files,
84
+ directories,
85
+ };
86
+ }
87
+ getTool() {
88
+ return (0, tools_1.createTool)({
89
+ id: this.id,
90
+ description: this.description,
91
+ inputSchema: this.inputSchema,
92
+ outputSchema: this.outputSchema,
93
+ execute: async ({ context }) => this.execute(context),
94
+ });
95
+ }
96
+ }
97
+ exports.ListProjectFilesTool = ListProjectFilesTool;
98
+ //# sourceMappingURL=list-project-files.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-project-files.tool.js","sourceRoot":"","sources":["../../../tools/github/list-project-files.tool.ts"],"names":[],"mappings":";;;AAAA,8CAAgD;AAChD,6BAAwB;AACxB,4CAAqD;AACrD,kDAAoD;AAEpD,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBxB,CAAC;AAEF,MAAM,0BAA0B,GAAG;;;;;;;;CAQlC,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;CAC5E,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,KAAK,EAAE,OAAC,C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,IAAI,CAAC,CAAC;QAExF,OAAO;YACL,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,KAAK;YACL,WAAW;SACZ,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,IAAA,kBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,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;AAtCD,oDAsCC"}
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ import { BaseTool, TMastraTool } from '../base.tool';
3
+ declare const InputSchema: z.ZodObject<{
4
+ query: z.ZodString;
5
+ limit: z.ZodDefault<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ declare const OutputSchema: z.ZodObject<{
8
+ query: z.ZodString;
9
+ totalCount: z.ZodNumber;
10
+ results: z.ZodArray<z.ZodObject<{
11
+ filePath: z.ZodString;
12
+ fileName: z.ZodString;
13
+ matchSnippet: z.ZodOptional<z.ZodString>;
14
+ url: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>>;
16
+ error: z.ZodOptional<z.ZodString>;
17
+ rateLimitWarning: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export declare class SearchCodeTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
20
+ readonly id = "searchCode";
21
+ readonly description = "\nSearches for code patterns, function names, class definitions, and keywords across the Ignis source code.\n\nPURPOSE:\nFind specific code implementations, locate where functions/classes are defined, and discover\ncode patterns throughout the repository. Essential for understanding how features are implemented.\n\nWHEN TO USE:\n- To find where a specific function or class is defined\n- To locate usages of a particular API or pattern\n- To find configuration files or specific code constructs\n- When you know WHAT you're looking for but not WHERE it is\n- To answer questions like \"where is X implemented?\" or \"how is Y used?\"\n\nWHEN NOT TO USE:\n- For general project structure exploration (use listProjectFiles instead)\n- For documentation content (use searchDocs instead)\n- When you already know the file path (use viewSourceFile instead)\n\nSEARCH TIPS:\n- Use specific terms: \"createApplication\" instead of \"create\"\n- Include file extension for targeted results: \"extension:ts HttpServer\"\n- Search for class/function names: \"class DependencyContainer\"\n- Combine terms: \"inject decorator\"\n\nOUTPUT:\nReturns matching files with code snippets showing the match context.\nUse viewSourceFile to read the complete file content.\n";
22
+ readonly inputSchema: z.ZodObject<{
23
+ query: z.ZodString;
24
+ limit: z.ZodDefault<z.ZodNumber>;
25
+ }, z.core.$strip>;
26
+ readonly outputSchema: z.ZodObject<{
27
+ query: z.ZodString;
28
+ totalCount: z.ZodNumber;
29
+ results: z.ZodArray<z.ZodObject<{
30
+ filePath: z.ZodString;
31
+ fileName: z.ZodString;
32
+ matchSnippet: z.ZodOptional<z.ZodString>;
33
+ url: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strip>>;
35
+ error: z.ZodOptional<z.ZodString>;
36
+ rateLimitWarning: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>;
38
+ execute(opts: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
39
+ getTool(): TMastraTool;
40
+ }
41
+ export {};
42
+ //# sourceMappingURL=search-code.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-code.tool.d.ts","sourceRoot":"","sources":["../../../tools/github/search-code.tool.ts"],"names":[],"mappings":"AAEA,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;;;;;;;;;;;iBAShB,CAAC;AA6BH,qBAAa,cAAe,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACnF,QAAQ,CAAC,EAAE,gBAAgB;IAC3B,QAAQ,CAAC,WAAW,6uCAAoB;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;IAiFvF,OAAO,IAAI,WAAW;CASvB"}
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchCodeTool = void 0;
4
+ const common_1 = require("@/mcp-server/common");
5
+ const tools_1 = require("@mastra/core/tools");
6
+ const zod_1 = require("zod");
7
+ const base_tool_1 = require("../base.tool");
8
+ const helpers_1 = require("@/mcp-server/helpers");
9
+ // ----------------------------------------------------------------------------
10
+ // DESCRIPTIONS
11
+ // ----------------------------------------------------------------------------
12
+ const TOOL_DESCRIPTION = `
13
+ Searches for code patterns, function names, class definitions, and keywords across the Ignis source code.
14
+
15
+ PURPOSE:
16
+ Find specific code implementations, locate where functions/classes are defined, and discover
17
+ code patterns throughout the repository. Essential for understanding how features are implemented.
18
+
19
+ WHEN TO USE:
20
+ - To find where a specific function or class is defined
21
+ - To locate usages of a particular API or pattern
22
+ - To find configuration files or specific code constructs
23
+ - When you know WHAT you're looking for but not WHERE it is
24
+ - To answer questions like "where is X implemented?" or "how is Y used?"
25
+
26
+ WHEN NOT TO USE:
27
+ - For general project structure exploration (use listProjectFiles instead)
28
+ - For documentation content (use searchDocs instead)
29
+ - When you already know the file path (use viewSourceFile instead)
30
+
31
+ SEARCH TIPS:
32
+ - Use specific terms: "createApplication" instead of "create"
33
+ - Include file extension for targeted results: "extension:ts HttpServer"
34
+ - Search for class/function names: "class DependencyContainer"
35
+ - Combine terms: "inject decorator"
36
+
37
+ OUTPUT:
38
+ Returns matching files with code snippets showing the match context.
39
+ Use viewSourceFile to read the complete file content.
40
+ `;
41
+ const QUERY_DESCRIPTION = `
42
+ Search query to find in the codebase.
43
+
44
+ QUERY SYNTAX:
45
+ - Simple keyword: "HttpServer" - finds files containing HttpServer
46
+ - Multiple terms: "inject service" - files containing both terms
47
+ - Exact phrase: "\\"dependency injection\\"" - exact phrase match
48
+ - File extension: "extension:ts middleware" - only TypeScript files
49
+ - Path filter: "path:packages/core createTool" - search in specific path
50
+
51
+ EXAMPLES:
52
+ - "class Application" - find Application class definition
53
+ - "export function create" - find exported create functions
54
+ - "extension:ts @Injectable" - find Injectable decorators in TS files
55
+ - "path:packages/helpers redis" - find redis usage in helpers package
56
+ - "BaseController extends" - find classes extending BaseController
57
+
58
+ TIPS:
59
+ - Be specific to reduce noise
60
+ - Use class/function names when known
61
+ - Combine with path: or extension: for targeted results
62
+ `;
63
+ const LIMIT_DESCRIPTION = `
64
+ Maximum number of results to return (1-${common_1.MCPConfigs.codeSearch.maxLimit}, default: ${common_1.MCPConfigs.codeSearch.defaultLimit}).
65
+
66
+ RECOMMENDATIONS:
67
+ - Use 5-10 for specific searches (function names, class definitions)
68
+ - Use 15-20 for broader pattern searches
69
+ - Use ${common_1.MCPConfigs.codeSearch.maxLimit} when exploring all usages of a common term
70
+ `;
71
+ // ----------------------------------------------------------------------------
72
+ // SCHEMAS
73
+ // ----------------------------------------------------------------------------
74
+ const SearchResultSchema = zod_1.z.object({
75
+ filePath: zod_1.z.string().describe('Full file path from repository root. Use with viewSourceFile.'),
76
+ fileName: zod_1.z.string().describe('File name for quick reference.'),
77
+ matchSnippet: zod_1.z
78
+ .string()
79
+ .optional()
80
+ .describe('Code snippet showing the match context (if available).'),
81
+ url: zod_1.z.string().optional().describe('GitHub URL to view the file online.'),
82
+ });
83
+ const InputSchema = zod_1.z.object({
84
+ query: zod_1.z.string().min(common_1.MCPConfigs.codeSearch.minQueryLength).describe(QUERY_DESCRIPTION),
85
+ limit: zod_1.z
86
+ .number()
87
+ .int()
88
+ .min(1)
89
+ .max(common_1.MCPConfigs.codeSearch.maxLimit)
90
+ .default(common_1.MCPConfigs.codeSearch.defaultLimit)
91
+ .describe(LIMIT_DESCRIPTION),
92
+ });
93
+ const OutputSchema = zod_1.z.object({
94
+ query: zod_1.z.string().describe('The search query that was executed.'),
95
+ totalCount: zod_1.z.number().int().describe('Total number of matches found.'),
96
+ results: zod_1.z.array(SearchResultSchema).describe('Search results with file paths and snippets.'),
97
+ error: zod_1.z.string().optional().describe('Error message if search failed.'),
98
+ rateLimitWarning: zod_1.z
99
+ .string()
100
+ .optional()
101
+ .describe('Warning if approaching GitHub API rate limits.'),
102
+ });
103
+ /* eslint-enable @typescript-eslint/naming-convention */
104
+ // ----------------------------------------------------------------------------
105
+ // TOOL CLASS
106
+ // ----------------------------------------------------------------------------
107
+ class SearchCodeTool extends base_tool_1.BaseTool {
108
+ constructor() {
109
+ super(...arguments);
110
+ this.id = 'searchCode';
111
+ this.description = TOOL_DESCRIPTION;
112
+ this.inputSchema = InputSchema;
113
+ this.outputSchema = OutputSchema;
114
+ }
115
+ async execute(opts) {
116
+ const { query, limit } = opts;
117
+ const { apiBase, repoOwner, repoName, userAgent } = common_1.MCPConfigs.github;
118
+ // Build GitHub code search query
119
+ const searchQuery = `${query} repo:${repoOwner}/${repoName}`;
120
+ const url = `${apiBase}/search/code?q=${encodeURIComponent(searchQuery)}&per_page=${limit}`;
121
+ helpers_1.Logger.debug(`Searching code on GitHub: ${url}`);
122
+ try {
123
+ const response = await fetch(url, {
124
+ headers: {
125
+ 'User-Agent': userAgent,
126
+ Accept: 'application/vnd.github.text-match+json', // Include text match fragments
127
+ },
128
+ });
129
+ // Check rate limit headers
130
+ const rateLimitRemaining = response.headers.get('X-RateLimit-Remaining');
131
+ const rateLimitWarning = rateLimitRemaining &&
132
+ parseInt(rateLimitRemaining) < common_1.MCPConfigs.codeSearch.rateLimitWarningThreshold
133
+ ? `GitHub API rate limit low: ${rateLimitRemaining} requests remaining. Consider waiting before more searches.`
134
+ : undefined;
135
+ if (!response.ok) {
136
+ const errorData = (await response.json().catch(() => ({})));
137
+ helpers_1.Logger.error(`GitHub code search failed: ${response.statusText}`);
138
+ if (response.status === 403) {
139
+ return {
140
+ query,
141
+ totalCount: 0,
142
+ results: [],
143
+ error: 'GitHub API rate limit exceeded. Please wait a moment before searching again. Unauthenticated requests are limited to 10 per minute.',
144
+ rateLimitWarning,
145
+ };
146
+ }
147
+ return {
148
+ query,
149
+ totalCount: 0,
150
+ results: [],
151
+ error: errorData.message || `GitHub API error: ${response.statusText}`,
152
+ rateLimitWarning,
153
+ };
154
+ }
155
+ const data = (await response.json());
156
+ const results = data.items.map(item => {
157
+ // Extract the best text match snippet
158
+ const matchSnippet = item.text_matches?.[0]?.fragment;
159
+ return {
160
+ filePath: item.path,
161
+ fileName: item.name,
162
+ matchSnippet,
163
+ url: item.html_url,
164
+ };
165
+ });
166
+ return {
167
+ query,
168
+ totalCount: data.total_count,
169
+ results,
170
+ rateLimitWarning,
171
+ };
172
+ }
173
+ catch (error) {
174
+ helpers_1.Logger.error('Failed to search code on GitHub:', error);
175
+ return {
176
+ query,
177
+ totalCount: 0,
178
+ results: [],
179
+ error: `Search failed: ${error instanceof Error ? error.message : 'Unknown error'}`,
180
+ };
181
+ }
182
+ }
183
+ getTool() {
184
+ return (0, tools_1.createTool)({
185
+ id: this.id,
186
+ description: this.description,
187
+ inputSchema: this.inputSchema,
188
+ outputSchema: this.outputSchema,
189
+ execute: async ({ context }) => this.execute(context),
190
+ });
191
+ }
192
+ }
193
+ exports.SearchCodeTool = SearchCodeTool;
194
+ //# sourceMappingURL=search-code.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-code.tool.js","sourceRoot":"","sources":["../../../tools/github/search-code.tool.ts"],"names":[],"mappings":";;;AAAA,gDAAiD;AACjD,8CAAgD;AAChD,6BAAwB;AACxB,4CAAqD;AACrD,kDAA8C;AAE9C,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MA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,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;gBAEtD,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI;oBACnB,QAAQ,EAAE,IAAI,CAAC,IAAI;oBACnB,YAAY;oBACZ,GAAG,EAAE,IAAI,CAAC,QAAQ;iBACnB,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,OAAO;gBACL,KAAK;gBACL,UAAU,EAAE,IAAI,CAAC,WAAW;gBAC5B,OAAO;gBACP,gBAAgB;aACjB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,gBAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO;gBACL,KAAK;gBACL,UAAU,EAAE,CAAC;gBACb,OAAO,EAAE,EAAE;gBACX,KAAK,EAAE,kBAAkB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;aACpF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,IAAA,kBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,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;AAhGD,wCAgGC"}
@@ -0,0 +1,55 @@
1
+ import { z } from 'zod';
2
+ import { BaseTool, TMastraTool } from '../base.tool';
3
+ declare const InputSchema: z.ZodObject<{
4
+ packagePath: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const OutputSchema: z.ZodObject<{
7
+ packageName: z.ZodOptional<z.ZodString>;
8
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
9
+ name: z.ZodString;
10
+ currentVersion: z.ZodString;
11
+ latestVersion: z.ZodString;
12
+ isOutdated: z.ZodBoolean;
13
+ }, z.core.$strip>>>;
14
+ devDependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ name: z.ZodString;
16
+ currentVersion: z.ZodString;
17
+ latestVersion: z.ZodString;
18
+ isOutdated: z.ZodBoolean;
19
+ }, z.core.$strip>>>;
20
+ error: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ export declare class VerifyDependenciesTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
23
+ readonly id = "verifyDependencies";
24
+ readonly description = "\nVerifies dependencies of a package within the Ignis monorepo against NPM registry.\n\nPURPOSE:\nCheck for outdated dependencies. Reads package.json from a specific package,\nfetches latest version for each dependency from NPM registry, and reports\nwhich packages may need updating.\n\nWHEN TO USE:\n- To assess maintenance status of a package\n- To identify potential security risks from outdated dependencies\n- Before starting development, to see what needs updating\n- To answer user questions about package dependencies\n\nWHEN NOT TO USE:\n- This tool can be slow as it makes multiple network requests to NPM\n- For workspace dependencies (e.g., \"workspace:*\") - these are internal references\n\nNOTE: Version comparison is simplified (string comparison). Complex version ranges\nor intentionally pinned versions may show as \"outdated\" even when correct.\n";
25
+ readonly inputSchema: z.ZodObject<{
26
+ packagePath: z.ZodString;
27
+ }, z.core.$strip>;
28
+ readonly outputSchema: z.ZodObject<{
29
+ packageName: z.ZodOptional<z.ZodString>;
30
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
31
+ name: z.ZodString;
32
+ currentVersion: z.ZodString;
33
+ latestVersion: z.ZodString;
34
+ isOutdated: z.ZodBoolean;
35
+ }, z.core.$strip>>>;
36
+ devDependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
37
+ name: z.ZodString;
38
+ currentVersion: z.ZodString;
39
+ latestVersion: z.ZodString;
40
+ isOutdated: z.ZodBoolean;
41
+ }, z.core.$strip>>>;
42
+ error: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>;
44
+ private getLatestVersion;
45
+ /**
46
+ * Extracts a clean semver version from various version specifiers.
47
+ * Returns null for non-standard versions that can't be compared.
48
+ */
49
+ private parseVersion;
50
+ private processDependencies;
51
+ execute(opts: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
52
+ getTool(): TMastraTool;
53
+ }
54
+ export {};
55
+ //# sourceMappingURL=verify-dependencies.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-dependencies.tool.d.ts","sourceRoot":"","sources":["../../../tools/github/verify-dependencies.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAkDrD,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;iBAKhB,CAAC;AAWH,qBAAa,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IAC3F,QAAQ,CAAC,EAAE,wBAAwB;IACnC,QAAQ,CAAC,WAAW,02BAAoB;IACxC,QAAQ,CAAC,WAAW;;sBAAe;IACnC,QAAQ,CAAC,YAAY;;;;;;;;;;;;;;;sBAAgB;YAEvB,gBAAgB;IAe9B;;;OAGG;IACH,OAAO,CAAC,YAAY;YAsBN,mBAAmB;IA+B3B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IA0BvF,OAAO,IAAI,WAAW;CASvB"}
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VerifyDependenciesTool = void 0;
4
+ const tools_1 = require("@mastra/core/tools");
5
+ const zod_1 = require("zod");
6
+ const base_tool_1 = require("../base.tool");
7
+ const helpers_1 = require("@/mcp-server/helpers");
8
+ // ----------------------------------------------------------------------------
9
+ // DESCRIPTIONS
10
+ // ----------------------------------------------------------------------------
11
+ const TOOL_DESCRIPTION = `
12
+ Verifies dependencies of a package within the Ignis monorepo against NPM registry.
13
+
14
+ PURPOSE:
15
+ Check for outdated dependencies. Reads package.json from a specific package,
16
+ fetches latest version for each dependency from NPM registry, and reports
17
+ which packages may need updating.
18
+
19
+ WHEN TO USE:
20
+ - To assess maintenance status of a package
21
+ - To identify potential security risks from outdated dependencies
22
+ - Before starting development, to see what needs updating
23
+ - To answer user questions about package dependencies
24
+
25
+ WHEN NOT TO USE:
26
+ - This tool can be slow as it makes multiple network requests to NPM
27
+ - For workspace dependencies (e.g., "workspace:*") - these are internal references
28
+
29
+ NOTE: Version comparison is simplified (string comparison). Complex version ranges
30
+ or intentionally pinned versions may show as "outdated" even when correct.
31
+ `;
32
+ const PACKAGE_PATH_DESCRIPTION = `
33
+ The path to the package directory from the repository root.
34
+ This directory must contain a 'package.json' file.
35
+
36
+ EXAMPLES:
37
+ - "packages/core"
38
+ - "packages/helpers"
39
+ - "examples/5-mins-qs"
40
+ `;
41
+ // ----------------------------------------------------------------------------
42
+ // SCHEMAS
43
+ // ----------------------------------------------------------------------------
44
+ const DependencyInfoSchema = zod_1.z.object({
45
+ name: zod_1.z.string(),
46
+ currentVersion: zod_1.z.string(),
47
+ latestVersion: zod_1.z.string(),
48
+ isOutdated: zod_1.z.boolean(),
49
+ });
50
+ const InputSchema = zod_1.z.object({
51
+ packagePath: zod_1.z.string().describe(PACKAGE_PATH_DESCRIPTION),
52
+ });
53
+ const OutputSchema = zod_1.z.object({
54
+ packageName: zod_1.z.string().optional(),
55
+ dependencies: zod_1.z.array(DependencyInfoSchema).optional(),
56
+ devDependencies: zod_1.z.array(DependencyInfoSchema).optional(),
57
+ error: zod_1.z.string().optional(),
58
+ });
59
+ // ----------------------------------------------------------------------------
60
+ // TOOL CLASS
61
+ // ----------------------------------------------------------------------------
62
+ class VerifyDependenciesTool extends base_tool_1.BaseTool {
63
+ constructor() {
64
+ super(...arguments);
65
+ this.id = 'verifyDependencies';
66
+ this.description = TOOL_DESCRIPTION;
67
+ this.inputSchema = InputSchema;
68
+ this.outputSchema = OutputSchema;
69
+ }
70
+ async getLatestVersion(opts) {
71
+ try {
72
+ const url = `https://registry.npmjs.org/${opts.packageName}/latest`;
73
+ const response = await fetch(url);
74
+ if (!response.ok) {
75
+ return 'unknown';
76
+ }
77
+ const data = (await response.json());
78
+ return data.version || 'unknown';
79
+ }
80
+ catch (error) {
81
+ helpers_1.Logger.warn(`Could not fetch latest version for ${opts.packageName}:`, error);
82
+ return 'unknown';
83
+ }
84
+ }
85
+ /**
86
+ * Extracts a clean semver version from various version specifiers.
87
+ * Returns null for non-standard versions that can't be compared.
88
+ */
89
+ parseVersion(opts) {
90
+ // Skip workspace, file, git, and URL references
91
+ if (opts.version.startsWith('workspace:') ||
92
+ opts.version.startsWith('file:') ||
93
+ opts.version.startsWith('git') ||
94
+ opts.version.startsWith('http') ||
95
+ opts.version === '*' ||
96
+ opts.version === 'latest') {
97
+ return null;
98
+ }
99
+ // Remove common prefixes: ^, ~, >=, >, <=, <, =
100
+ const cleaned = opts.version.replace(/^[\^~>=<]+/, '').trim();
101
+ // Handle version ranges (e.g., "1.0.0 || 2.0.0", ">=1.0.0 <2.0.0")
102
+ // Just take the first version-like string
103
+ const semverMatch = cleaned.match(/(\d+\.\d+\.\d+(?:-[\w.]+)?)/);
104
+ return semverMatch ? semverMatch[1] : null;
105
+ }
106
+ async processDependencies(opts) {
107
+ if (!opts.deps) {
108
+ return [];
109
+ }
110
+ const results = [];
111
+ for (const [name, version] of Object.entries(opts.deps)) {
112
+ const parsedVersion = this.parseVersion({ version });
113
+ // Skip non-standard versions
114
+ if (!parsedVersion) {
115
+ results.push({
116
+ name,
117
+ currentVersion: version,
118
+ latestVersion: 'N/A',
119
+ isOutdated: false,
120
+ });
121
+ continue;
122
+ }
123
+ const latestVersion = await this.getLatestVersion({ packageName: name });
124
+ results.push({
125
+ name,
126
+ currentVersion: parsedVersion,
127
+ latestVersion,
128
+ isOutdated: latestVersion !== 'unknown' && parsedVersion !== latestVersion,
129
+ });
130
+ }
131
+ return results;
132
+ }
133
+ async execute(opts) {
134
+ const packageJsonPath = `${opts.packagePath}/package.json`;
135
+ const result = await helpers_1.GithubHelper.getFileContent({ filePath: packageJsonPath });
136
+ if ('error' in result) {
137
+ return { error: `Could not read package.json at ${packageJsonPath}. Error: ${result.error}` };
138
+ }
139
+ try {
140
+ const packageJson = JSON.parse(result.content);
141
+ const [dependencies, devDependencies] = await Promise.all([
142
+ this.processDependencies({ deps: packageJson.dependencies }),
143
+ this.processDependencies({ deps: packageJson.devDependencies }),
144
+ ]);
145
+ return {
146
+ packageName: packageJson.name,
147
+ dependencies,
148
+ devDependencies,
149
+ };
150
+ }
151
+ catch (error) {
152
+ helpers_1.Logger.error('[execute] Failed to execute | Error: ', error);
153
+ return { error: `Failed to parse package.json at ${packageJsonPath}.` };
154
+ }
155
+ }
156
+ getTool() {
157
+ return (0, tools_1.createTool)({
158
+ id: this.id,
159
+ description: this.description,
160
+ inputSchema: this.inputSchema,
161
+ outputSchema: this.outputSchema,
162
+ execute: async ({ context }) => this.execute(context),
163
+ });
164
+ }
165
+ }
166
+ exports.VerifyDependenciesTool = VerifyDependenciesTool;
167
+ //# sourceMappingURL=verify-dependencies.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-dependencies.tool.js","sourceRoot":"","sources":["../../../tools/github/verify-dependencies.tool.ts"],"names":[],"mappings":";;;AAAA,8CAAgD;AAChD,6BAAwB;AACxB,4CAAqD;AACrD,kDAA4D;AAE5D,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAC;AAEF,MAAM,wBAAwB,GAAG;;;;;;;;CAQhC,CAAC;AA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,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC;gBAC5D,IAAI,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,eAAe,EAAE,CAAC;aAChE,CAAC,CAAC;YAEH,OAAO;gBACL,WAAW,EAAE,WAAW,CAAC,IAAI;gBAC7B,YAAY;gBACZ,eAAe;aAChB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,gBAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;YAC7D,OAAO,EAAE,KAAK,EAAE,mCAAmC,eAAe,GAAG,EAAE,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,IAAA,kBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,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;AAjHD,wDAiHC"}
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { BaseTool, TMastraTool } from '../base.tool';
3
+ declare const InputSchema: z.ZodObject<{
4
+ filePath: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const OutputSchema: z.ZodObject<{
7
+ filePath: z.ZodString;
8
+ content: z.ZodOptional<z.ZodString>;
9
+ error: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ export declare class ViewSourceFileTool extends BaseTool<typeof InputSchema, typeof OutputSchema> {
12
+ readonly id = "viewSourceFile";
13
+ readonly description = "\nRetrieves the full source code content of a specific file from the Ignis GitHub repository.\n\nPURPOSE:\nRead contents of a source file. Primary method for inspecting implementation details,\nunderstanding logic, and viewing exact code.\n\nWHEN TO USE:\n- After finding a relevant file with listProjectFiles or searchCode\n- When you need to see implementation of a specific class, function, or component\n- To verify details not present in documentation\n- To extract specific code examples or snippets\n\nWHEN NOT TO USE:\n- For discovering files (use listProjectFiles to browse, or searchCode to find by keyword)\n- Do not use on non-text files (images, binaries) or very large files unless necessary\n- For documentation content (use getDocContent instead)\n";
14
+ readonly inputSchema: z.ZodObject<{
15
+ filePath: z.ZodString;
16
+ }, z.core.$strip>;
17
+ readonly outputSchema: z.ZodObject<{
18
+ filePath: z.ZodString;
19
+ content: z.ZodOptional<z.ZodString>;
20
+ error: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ execute(opts: z.infer<typeof InputSchema>): Promise<z.infer<typeof OutputSchema>>;
23
+ getTool(): TMastraTool;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=view-source-file.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-source-file.tool.d.ts","sourceRoot":"","sources":["../../../tools/github/view-source-file.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA2CrD,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;iBAOhB,CAAC;AAMH,qBAAa,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,CAAC;IACvF,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,WAAW,kwBAAoB;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;IAgBvF,OAAO,IAAI,WAAW;CASvB"}