@nuxtjs/mcp-toolkit 0.0.1 → 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/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjs/mcp-toolkit",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "configKey": "mcp",
5
5
  "docs": "https://mcp-toolkit.nuxt.dev/getting-started/installation",
6
6
  "mcp": "https://mcp-toolkit.nuxt.dev/mcp",
package/dist/module.mjs CHANGED
@@ -6,7 +6,7 @@ import { ROUTES } from '../dist/runtime/server/mcp/constants.js';
6
6
  import { addDevToolsCustomTabs } from '../dist/runtime/server/mcp/devtools/index.js';
7
7
 
8
8
  const name = "@nuxtjs/mcp-toolkit";
9
- const version = "0.0.1";
9
+ const version = "0.1.1";
10
10
 
11
11
  const log = logger.withTag("@nuxtjs/mcp-toolkit");
12
12
  const { resolve } = createResolver(import.meta.url);
@@ -4,6 +4,10 @@ export interface LoadResult {
4
4
  overriddenCount: number;
5
5
  }
6
6
  export declare function createFilePatterns(paths: string[], extensions?: string[]): string[];
7
+ /**
8
+ * Create file patterns for a specific layer
9
+ */
10
+ export declare function createLayerFilePatterns(layerServer: string, paths: string[], extensions?: string[]): string[];
7
11
  export declare function createExcludePatterns(paths: string[], subdirs: string[]): string[];
8
12
  export declare function toIdentifier(filename: string): string;
9
13
  export declare function createTemplateContent(type: string, entries: Array<[string, string]>): string;
@@ -69,6 +69,11 @@ export function createFilePatterns(paths, extensions = ["ts", "js", "mts", "mjs"
69
69
  )
70
70
  );
71
71
  }
72
+ export function createLayerFilePatterns(layerServer, paths, extensions = ["ts", "js", "mts", "mjs"]) {
73
+ return paths.flatMap(
74
+ (pathPattern) => extensions.map((ext) => resolvePath(layerServer, `${pathPattern}/*.${ext}`))
75
+ );
76
+ }
72
77
  export function createExcludePatterns(paths, subdirs) {
73
78
  const layerDirectories = getLayerDirectories();
74
79
  return layerDirectories.flatMap(
@@ -113,22 +118,26 @@ export async function loadDefinitionFiles(paths, options = {}) {
113
118
  if (paths.length === 0) {
114
119
  return { count: 0, files: [], overriddenCount: 0 };
115
120
  }
116
- const patterns = createFilePatterns(paths);
117
- const files = await glob(patterns, {
118
- absolute: true,
119
- onlyFiles: true,
120
- ignore: options.excludePatterns
121
- });
121
+ const layerDirectories = getLayerDirectories();
122
+ const reversedLayers = [...layerDirectories].reverse();
122
123
  const definitionsMap = /* @__PURE__ */ new Map();
123
- const filteredFiles = options.filter ? files.filter(options.filter) : files;
124
124
  let overriddenCount = 0;
125
- for (const filePath of filteredFiles) {
126
- const filename = filePath.split("/").pop();
127
- const identifier = toIdentifier(filename);
128
- if (definitionsMap.has(identifier)) {
129
- overriddenCount++;
125
+ for (const layer of reversedLayers) {
126
+ const layerPatterns = createLayerFilePatterns(layer.server, paths);
127
+ const layerFiles = await glob(layerPatterns, {
128
+ absolute: true,
129
+ onlyFiles: true,
130
+ ignore: options.excludePatterns
131
+ });
132
+ const filteredFiles = options.filter ? layerFiles.filter(options.filter) : layerFiles;
133
+ for (const filePath of filteredFiles) {
134
+ const filename = filePath.split("/").pop();
135
+ const identifier = toIdentifier(filename);
136
+ if (definitionsMap.has(identifier)) {
137
+ overriddenCount++;
138
+ }
139
+ definitionsMap.set(identifier, filePath);
130
140
  }
131
- definitionsMap.set(identifier, filePath);
132
141
  }
133
142
  const total = definitionsMap.size;
134
143
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjs/mcp-toolkit",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "Create MCP servers directly in your Nuxt application. Define tools, resources, and prompts with a simple and intuitive API.",
5
5
  "repository": {
6
6
  "type": "git",