mcp-layer 0.2.2 → 0.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-layer",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Build production-ready CLI, REST, GraphQL, and OpenAPI interfaces on top of any MCP server.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,8 +25,10 @@
25
25
  "author": "Arnout Kazemier",
26
26
  "type": "module",
27
27
  "main": "./src/index.js",
28
+ "types": "./types/index.d.ts",
28
29
  "exports": {
29
30
  ".": {
31
+ "types": "./types/index.d.ts",
30
32
  "import": "./src/index.js",
31
33
  "default": "./src/index.js"
32
34
  },
@@ -34,6 +36,7 @@
34
36
  },
35
37
  "files": [
36
38
  "src",
39
+ "types",
37
40
  "README.md",
38
41
  "LICENSE"
39
42
  ],
@@ -41,21 +44,22 @@
41
44
  "access": "public"
42
45
  },
43
46
  "dependencies": {
44
- "@mcp-layer/attach": "1.1.1",
45
- "@mcp-layer/cli": "1.3.0",
46
- "@mcp-layer/config": "1.0.1",
47
- "@mcp-layer/connect": "1.2.0",
48
- "@mcp-layer/error": "0.2.0",
49
- "@mcp-layer/manager": "0.2.0",
50
- "@mcp-layer/graphql": "0.2.0",
51
- "@mcp-layer/gateway": "0.2.0",
52
- "@mcp-layer/openapi": "1.1.1",
53
- "@mcp-layer/rest": "1.2.1",
54
- "@mcp-layer/schema": "1.0.2",
55
- "@mcp-layer/session": "1.0.0",
56
- "@mcp-layer/test-server": "1.0.3"
47
+ "@mcp-layer/attach": "1.1.2",
48
+ "@mcp-layer/cli": "1.3.2",
49
+ "@mcp-layer/config": "1.0.2",
50
+ "@mcp-layer/connect": "1.2.1",
51
+ "@mcp-layer/error": "0.2.1",
52
+ "@mcp-layer/gateway": "0.2.2",
53
+ "@mcp-layer/graphql": "0.2.2",
54
+ "@mcp-layer/manager": "0.2.1",
55
+ "@mcp-layer/openapi": "1.1.2",
56
+ "@mcp-layer/rest": "1.2.3",
57
+ "@mcp-layer/schema": "1.0.4",
58
+ "@mcp-layer/session": "1.0.1",
59
+ "@mcp-layer/test-server": "1.0.4"
57
60
  },
58
61
  "scripts": {
59
- "test": "node --test ./test/**/*.js"
62
+ "build:types": "node src/generate.js && tsc -p tsconfig.json",
63
+ "test": "node --test \"./test/**/*.js\""
60
64
  }
61
65
  }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Convert a package folder name into a namespace export name.
3
+ * @param {string} name - Package folder name.
4
+ * @returns {string} Namespace export name.
5
+ */
6
+ export function toNamespace(name: string): string;
7
+ /**
8
+ * Collect package folder names from the workspace packages directory.
9
+ * @param {string} rootDir - Repository root directory.
10
+ * @returns {Promise<string[]>} Package folder names.
11
+ */
12
+ export function collectPackages(rootDir: string): Promise<string[]>;
13
+ /**
14
+ * Check whether a package.json exists for the given path.
15
+ * @param {string} pkgPath - Expected package.json path.
16
+ * @returns {Promise<boolean>} Whether the package.json exists.
17
+ */
18
+ export function hasPackageJson(pkgPath: string): Promise<boolean>;
19
+ /**
20
+ * Build the root index.js content from workspace packages.
21
+ * @param {string} rootDir - Repository root directory.
22
+ * @returns {Promise<string>} Generated index.js content.
23
+ */
24
+ export function buildIndex(rootDir: string, selfName?: string): Promise<string>;
25
+ /**
26
+ * Collect package metadata from workspace folders.
27
+ * @param {string} rootDir - Repository root directory.
28
+ * @param {Set<string>} omit - Package names to skip.
29
+ * @returns {Promise<Array<{name: string, dir: string}>>} Package metadata.
30
+ */
31
+ export function collectPackageMeta(rootDir: string, omit?: Set<string>): Promise<Array<{
32
+ name: string;
33
+ dir: string;
34
+ }>>;
35
+ /**
36
+ * Update mcp-layer package dependencies to match workspace packages.
37
+ * @param {string} pkgDir - mcp-layer package directory.
38
+ * @param {string} rootDir - Repository root directory.
39
+ * @param {string} selfName - mcp-layer package name.
40
+ * @returns {Promise<void>} Resolves when dependencies are updated.
41
+ */
42
+ export function syncDependencies(pkgDir: string, rootDir: string, selfName?: string): Promise<void>;
43
+ /**
44
+ * Write the generated index.js file if contents differ.
45
+ * @param {string} rootDir - Repository root directory.
46
+ * @param {string} outFile - Output file path.
47
+ * @returns {Promise<void>} Resolves when the file is written or unchanged.
48
+ */
49
+ export function writeIndex(rootDir: string, outFile: string, selfName?: string): Promise<void>;
50
+ /**
51
+ * Read a file if it exists, otherwise return null.
52
+ * @param {string} filePath - File path to read.
53
+ * @returns {Promise<string | null>} File contents or null.
54
+ */
55
+ export function readMaybe(filePath: string): Promise<string | null>;
56
+ /**
57
+ * Read and parse a JSON file.
58
+ * @param {string} filePath - JSON file path.
59
+ * @returns {Promise<Record<string, any>>} Parsed JSON data.
60
+ */
61
+ export function readJson(filePath: string): Promise<Record<string, any>>;
62
+ /**
63
+ * Write a JSON file with stable formatting.
64
+ * @param {string} filePath - JSON file path.
65
+ * @param {Record<string, any>} data - JSON data to write.
66
+ * @returns {Promise<void>} Resolves when the file is written.
67
+ */
68
+ export function writeJson(filePath: string, data: Record<string, any>): Promise<void>;
69
+ /**
70
+ * Sort an object's keys alphabetically.
71
+ * @param {Record<string, string>} input - Object to sort.
72
+ * @returns {Record<string, string>} Sorted object.
73
+ */
74
+ export function sortObject(input: Record<string, string>): Record<string, string>;
75
+ /**
76
+ * Find the workspace root directory by locating pnpm-workspace.yaml.
77
+ * @param {string} start - Directory to start searching from.
78
+ * @returns {Promise<string>} Workspace root directory.
79
+ */
80
+ export function findWorkspaceRoot(start: string): Promise<string>;
81
+ /**
82
+ * Run the generator when executed as a script.
83
+ * @returns {Promise<void>} Resolves when generation completes.
84
+ */
85
+ export function run(): Promise<void>;
@@ -0,0 +1,13 @@
1
+ export * as attach from "@mcp-layer/attach";
2
+ export * as cli from "@mcp-layer/cli";
3
+ export * as config from "@mcp-layer/config";
4
+ export * as connect from "@mcp-layer/connect";
5
+ export * as error from "@mcp-layer/error";
6
+ export * as gateway from "@mcp-layer/gateway";
7
+ export * as graphql from "@mcp-layer/graphql";
8
+ export * as manager from "@mcp-layer/manager";
9
+ export * as openapi from "@mcp-layer/openapi";
10
+ export * as rest from "@mcp-layer/rest";
11
+ export * as schema from "@mcp-layer/schema";
12
+ export * as session from "@mcp-layer/session";
13
+ export * as testServer from "@mcp-layer/test-server";