@mcp-layer/schema 1.0.2 → 1.0.3

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 (2) hide show
  1. package/package.json +11 -7
  2. package/types/index.d.ts +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-layer/schema",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Extract and normalize MCP schemas into a unified Zod-based format.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,8 +16,10 @@
16
16
  "prompts"
17
17
  ],
18
18
  "main": "src/index.js",
19
+ "types": "./types/index.d.ts",
19
20
  "exports": {
20
21
  ".": {
22
+ "types": "./types/index.d.ts",
21
23
  "import": "./src/index.js",
22
24
  "default": "./src/index.js"
23
25
  },
@@ -25,6 +27,7 @@
25
27
  },
26
28
  "files": [
27
29
  "src",
30
+ "types",
28
31
  "LICENSE"
29
32
  ],
30
33
  "publishConfig": {
@@ -33,15 +36,16 @@
33
36
  "dependencies": {
34
37
  "ajv": "^8.17.1",
35
38
  "zod": "^3.25.76",
36
- "@mcp-layer/error": "0.2.0"
39
+ "@mcp-layer/error": "0.2.1"
37
40
  },
38
41
  "devDependencies": {
39
- "@mcp-layer/attach": "1.1.1",
40
- "@mcp-layer/config": "1.0.1",
41
- "@mcp-layer/connect": "1.0.1",
42
- "@mcp-layer/test-server": "1.0.1"
42
+ "@mcp-layer/attach": "1.1.2",
43
+ "@mcp-layer/config": "1.0.2",
44
+ "@mcp-layer/connect": "1.2.1",
45
+ "@mcp-layer/test-server": "1.0.4"
43
46
  },
44
47
  "scripts": {
45
- "test": "node --test --experimental-test-coverage ./test/**/*.js"
48
+ "build:types": "tsc -p tsconfig.json",
49
+ "test": "node --test --experimental-test-coverage \"./test/**/*.js\""
46
50
  }
47
51
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Extract MCP tool/resource/prompt schemas into a unified Zod-backed format.
3
+ * @param {import('@mcp-layer/session').Session} link - Active session with a connected MCP server.
4
+ * @returns {Promise<{ server: { info: Record<string, unknown> | undefined, capabilities: Record<string, unknown> | undefined, instructions: string | undefined }, items: Array<Record<string, unknown>> }>}
5
+ */
6
+ export function extract(link: any): Promise<{
7
+ server: {
8
+ info: Record<string, unknown> | undefined;
9
+ capabilities: Record<string, unknown> | undefined;
10
+ instructions: string | undefined;
11
+ };
12
+ items: Array<Record<string, unknown>>;
13
+ }>;