@perplexity-ai/mcp-server 0.13.0 → 1.0.0
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/.claude-plugin/marketplace.json +49 -0
- package/LICENSE +21 -201
- package/README.md +105 -157
- package/dist/http.js +190 -0
- package/dist/index.js +23 -0
- package/dist/logger.js +82 -0
- package/dist/server.js +604 -0
- package/dist/types.js +1 -0
- package/dist/validation.js +62 -0
- package/package.json +56 -155
- package/compat.d.mts +0 -58
- package/compat.d.mts.map +0 -1
- package/compat.d.ts +0 -58
- package/compat.d.ts.map +0 -1
- package/compat.js +0 -387
- package/compat.js.map +0 -1
- package/compat.mjs +0 -378
- package/compat.mjs.map +0 -1
- package/dynamic-tools.d.mts +0 -12
- package/dynamic-tools.d.mts.map +0 -1
- package/dynamic-tools.d.ts +0 -12
- package/dynamic-tools.d.ts.map +0 -1
- package/dynamic-tools.js +0 -135
- package/dynamic-tools.js.map +0 -1
- package/dynamic-tools.mjs +0 -132
- package/dynamic-tools.mjs.map +0 -1
- package/filtering.d.mts +0 -2
- package/filtering.d.mts.map +0 -1
- package/filtering.d.ts +0 -2
- package/filtering.d.ts.map +0 -1
- package/filtering.js +0 -20
- package/filtering.js.map +0 -1
- package/filtering.mjs +0 -13
- package/filtering.mjs.map +0 -1
- package/headers.d.mts +0 -4
- package/headers.d.mts.map +0 -1
- package/headers.d.ts +0 -4
- package/headers.d.ts.map +0 -1
- package/headers.js +0 -22
- package/headers.js.map +0 -1
- package/headers.mjs +0 -18
- package/headers.mjs.map +0 -1
- package/http.d.mts +0 -9
- package/http.d.mts.map +0 -1
- package/http.d.ts +0 -9
- package/http.d.ts.map +0 -1
- package/http.js +0 -108
- package/http.js.map +0 -1
- package/http.mjs +0 -100
- package/http.mjs.map +0 -1
- package/index.d.mts +0 -3
- package/index.d.mts.map +0 -1
- package/index.d.ts +0 -3
- package/index.d.ts.map +0 -1
- package/index.js +0 -91
- package/index.js.map +0 -1
- package/index.mjs +0 -89
- package/index.mjs.map +0 -1
- package/options.d.mts +0 -18
- package/options.d.mts.map +0 -1
- package/options.d.ts +0 -18
- package/options.d.ts.map +0 -1
- package/options.js +0 -415
- package/options.js.map +0 -1
- package/options.mjs +0 -408
- package/options.mjs.map +0 -1
- package/server.d.mts +0 -35
- package/server.d.mts.map +0 -1
- package/server.d.ts +0 -35
- package/server.d.ts.map +0 -1
- package/server.js +0 -166
- package/server.js.map +0 -1
- package/server.mjs +0 -152
- package/server.mjs.map +0 -1
- package/src/compat.ts +0 -483
- package/src/dynamic-tools.ts +0 -159
- package/src/filtering.ts +0 -14
- package/src/headers.ts +0 -23
- package/src/http.ts +0 -127
- package/src/index.ts +0 -108
- package/src/options.ts +0 -453
- package/src/server.ts +0 -201
- package/src/stdio.ts +0 -13
- package/src/tools/chat/completions/create-chat-completions.ts +0 -1360
- package/src/tools/index.ts +0 -73
- package/src/tools/search/create-search.ts +0 -89
- package/src/tools/types.ts +0 -103
- package/src/tools.ts +0 -1
- package/src/tsconfig.json +0 -11
- package/stdio.d.mts +0 -3
- package/stdio.d.mts.map +0 -1
- package/stdio.d.ts +0 -3
- package/stdio.d.ts.map +0 -1
- package/stdio.js +0 -14
- package/stdio.js.map +0 -1
- package/stdio.mjs +0 -10
- package/stdio.mjs.map +0 -1
- package/tools/chat/completions/create-chat-completions.d.mts +0 -45
- package/tools/chat/completions/create-chat-completions.d.mts.map +0 -1
- package/tools/chat/completions/create-chat-completions.d.ts +0 -45
- package/tools/chat/completions/create-chat-completions.d.ts.map +0 -1
- package/tools/chat/completions/create-chat-completions.js +0 -1357
- package/tools/chat/completions/create-chat-completions.js.map +0 -1
- package/tools/chat/completions/create-chat-completions.mjs +0 -1353
- package/tools/chat/completions/create-chat-completions.mjs.map +0 -1
- package/tools/index.d.mts +0 -10
- package/tools/index.d.mts.map +0 -1
- package/tools/index.d.ts +0 -10
- package/tools/index.d.ts.map +0 -1
- package/tools/index.js +0 -57
- package/tools/index.js.map +0 -1
- package/tools/index.mjs +0 -50
- package/tools/index.mjs.map +0 -1
- package/tools/search/create-search.d.mts +0 -45
- package/tools/search/create-search.d.mts.map +0 -1
- package/tools/search/create-search.d.ts +0 -45
- package/tools/search/create-search.d.ts.map +0 -1
- package/tools/search/create-search.js +0 -86
- package/tools/search/create-search.js.map +0 -1
- package/tools/search/create-search.mjs +0 -82
- package/tools/search/create-search.mjs.map +0 -1
- package/tools/types.d.mts +0 -51
- package/tools/types.d.mts.map +0 -1
- package/tools/types.d.ts +0 -51
- package/tools/types.d.ts.map +0 -1
- package/tools/types.js +0 -46
- package/tools/types.js.map +0 -1
- package/tools/types.mjs +0 -42
- package/tools/types.mjs.map +0 -1
- package/tools.d.mts +0 -2
- package/tools.d.mts.map +0 -1
- package/tools.d.ts +0 -2
- package/tools.d.ts.map +0 -1
- package/tools.js +0 -18
- package/tools.js.map +0 -1
- package/tools.mjs +0 -2
- package/tools.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,170 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perplexity-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"mcpName": "ai.perplexity/mcp-server",
|
|
5
|
+
"description": "Real-time web search, reasoning, and research through Perplexity's API",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"ai",
|
|
8
|
+
"perplexity",
|
|
9
|
+
"mcp",
|
|
10
|
+
"modelcontextprotocol"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://docs.perplexity.ai/guides/mcp-server",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/perplexityai/modelcontextprotocol/issues"
|
|
15
|
+
},
|
|
9
16
|
"repository": {
|
|
10
17
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/perplexityai/
|
|
12
|
-
"directory": "packages/mcp-server"
|
|
18
|
+
"url": "git+https://github.com/perplexityai/modelcontextprotocol.git"
|
|
13
19
|
},
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"packageManager": "yarn@1.22.22",
|
|
17
|
-
"private": false,
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "Perplexity <>",
|
|
18
22
|
"publishConfig": {
|
|
19
23
|
"access": "public"
|
|
20
24
|
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"bin": {
|
|
28
|
+
"perplexity-mcp": "dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/*.js",
|
|
32
|
+
"!dist/*.test.js",
|
|
33
|
+
"!dist/vitest.config.js",
|
|
34
|
+
"README.md",
|
|
35
|
+
".claude-plugin"
|
|
36
|
+
],
|
|
21
37
|
"scripts": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
38
|
+
"build": "tsc && shx chmod +x dist/*.js",
|
|
39
|
+
"prepare": "npm run build",
|
|
40
|
+
"watch": "tsc --watch",
|
|
41
|
+
"start": "node dist/index.js",
|
|
42
|
+
"start:http": "node dist/http.js",
|
|
43
|
+
"start:http:UNSAFE-public": "BIND_ADDRESS=0.0.0.0 ALLOWED_ORIGINS=* node dist/http.js",
|
|
44
|
+
"dev": "tsx src/index.ts",
|
|
45
|
+
"dev:http": "tsx src/http.ts",
|
|
46
|
+
"dev:http:UNSAFE-public": "BIND_ADDRESS=0.0.0.0 ALLOWED_ORIGINS=* tsx src/http.ts",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"test:coverage": "vitest run --coverage"
|
|
28
50
|
},
|
|
29
51
|
"dependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@cloudflare/cabidela": "^0.2.4",
|
|
32
|
-
"@modelcontextprotocol/sdk": "^1.11.5",
|
|
33
|
-
"@valtown/deno-http-worker": "^0.0.21",
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
34
53
|
"cors": "^2.8.5",
|
|
35
|
-
"express": "^
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"yargs": "^17.7.2",
|
|
39
|
-
"zod": "^3.25.20",
|
|
40
|
-
"zod-to-json-schema": "^3.24.5",
|
|
41
|
-
"zod-validation-error": "^4.0.1"
|
|
42
|
-
},
|
|
43
|
-
"bin": {
|
|
44
|
-
"mcp-server": "./index.js"
|
|
54
|
+
"express": "^4.21.2",
|
|
55
|
+
"undici": "^6.20.0",
|
|
56
|
+
"zod": "^3.25.46"
|
|
45
57
|
},
|
|
46
|
-
"
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/cors": "^2.8.17",
|
|
60
|
+
"@types/express": "^5.0.0",
|
|
61
|
+
"@types/node": "^20",
|
|
62
|
+
"@vitest/coverage-v8": "^4.0.5",
|
|
63
|
+
"shx": "^0.4.0",
|
|
64
|
+
"tsx": "^4.19.4",
|
|
65
|
+
"typescript": "^5.9.3",
|
|
66
|
+
"vitest": "^4.0.5"
|
|
49
67
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"require": {
|
|
53
|
-
"types": "./index.d.ts",
|
|
54
|
-
"default": "./index.js"
|
|
55
|
-
},
|
|
56
|
-
"types": "./index.d.mts",
|
|
57
|
-
"default": "./index.mjs"
|
|
58
|
-
},
|
|
59
|
-
"./compat": {
|
|
60
|
-
"import": "./compat.mjs",
|
|
61
|
-
"require": "./compat.js"
|
|
62
|
-
},
|
|
63
|
-
"./compat.js": {
|
|
64
|
-
"default": "./compat.js"
|
|
65
|
-
},
|
|
66
|
-
"./compat.mjs": {
|
|
67
|
-
"default": "./compat.mjs"
|
|
68
|
-
},
|
|
69
|
-
"./dynamic-tools": {
|
|
70
|
-
"import": "./dynamic-tools.mjs",
|
|
71
|
-
"require": "./dynamic-tools.js"
|
|
72
|
-
},
|
|
73
|
-
"./dynamic-tools.js": {
|
|
74
|
-
"default": "./dynamic-tools.js"
|
|
75
|
-
},
|
|
76
|
-
"./dynamic-tools.mjs": {
|
|
77
|
-
"default": "./dynamic-tools.mjs"
|
|
78
|
-
},
|
|
79
|
-
"./filtering": {
|
|
80
|
-
"import": "./filtering.mjs",
|
|
81
|
-
"require": "./filtering.js"
|
|
82
|
-
},
|
|
83
|
-
"./filtering.js": {
|
|
84
|
-
"default": "./filtering.js"
|
|
85
|
-
},
|
|
86
|
-
"./filtering.mjs": {
|
|
87
|
-
"default": "./filtering.mjs"
|
|
88
|
-
},
|
|
89
|
-
"./headers": {
|
|
90
|
-
"import": "./headers.mjs",
|
|
91
|
-
"require": "./headers.js"
|
|
92
|
-
},
|
|
93
|
-
"./headers.js": {
|
|
94
|
-
"default": "./headers.js"
|
|
95
|
-
},
|
|
96
|
-
"./headers.mjs": {
|
|
97
|
-
"default": "./headers.mjs"
|
|
98
|
-
},
|
|
99
|
-
"./http": {
|
|
100
|
-
"import": "./http.mjs",
|
|
101
|
-
"require": "./http.js"
|
|
102
|
-
},
|
|
103
|
-
"./http.js": {
|
|
104
|
-
"default": "./http.js"
|
|
105
|
-
},
|
|
106
|
-
"./http.mjs": {
|
|
107
|
-
"default": "./http.mjs"
|
|
108
|
-
},
|
|
109
|
-
"./index": {
|
|
110
|
-
"import": "./index.mjs",
|
|
111
|
-
"require": "./index.js"
|
|
112
|
-
},
|
|
113
|
-
"./index.js": {
|
|
114
|
-
"default": "./index.js"
|
|
115
|
-
},
|
|
116
|
-
"./index.mjs": {
|
|
117
|
-
"default": "./index.mjs"
|
|
118
|
-
},
|
|
119
|
-
"./options": {
|
|
120
|
-
"import": "./options.mjs",
|
|
121
|
-
"require": "./options.js"
|
|
122
|
-
},
|
|
123
|
-
"./options.js": {
|
|
124
|
-
"default": "./options.js"
|
|
125
|
-
},
|
|
126
|
-
"./options.mjs": {
|
|
127
|
-
"default": "./options.mjs"
|
|
128
|
-
},
|
|
129
|
-
"./server": {
|
|
130
|
-
"import": "./server.mjs",
|
|
131
|
-
"require": "./server.js"
|
|
132
|
-
},
|
|
133
|
-
"./server.js": {
|
|
134
|
-
"default": "./server.js"
|
|
135
|
-
},
|
|
136
|
-
"./server.mjs": {
|
|
137
|
-
"default": "./server.mjs"
|
|
138
|
-
},
|
|
139
|
-
"./stdio": {
|
|
140
|
-
"import": "./stdio.mjs",
|
|
141
|
-
"require": "./stdio.js"
|
|
142
|
-
},
|
|
143
|
-
"./stdio.js": {
|
|
144
|
-
"default": "./stdio.js"
|
|
145
|
-
},
|
|
146
|
-
"./stdio.mjs": {
|
|
147
|
-
"default": "./stdio.mjs"
|
|
148
|
-
},
|
|
149
|
-
"./tools/*.mjs": {
|
|
150
|
-
"default": "./tools/*.mjs"
|
|
151
|
-
},
|
|
152
|
-
"./tools/*.js": {
|
|
153
|
-
"default": "./tools/*.js"
|
|
154
|
-
},
|
|
155
|
-
"./tools/*": {
|
|
156
|
-
"import": "./tools/*.mjs",
|
|
157
|
-
"require": "./tools/*.js"
|
|
158
|
-
},
|
|
159
|
-
"./tools": {
|
|
160
|
-
"import": "./tools.mjs",
|
|
161
|
-
"require": "./tools.js"
|
|
162
|
-
},
|
|
163
|
-
"./tools.js": {
|
|
164
|
-
"default": "./tools.js"
|
|
165
|
-
},
|
|
166
|
-
"./tools.mjs": {
|
|
167
|
-
"default": "./tools.mjs"
|
|
168
|
-
}
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=18"
|
|
169
70
|
}
|
|
170
|
-
}
|
|
71
|
+
}
|
package/compat.d.mts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { Endpoint } from "./tools.mjs";
|
|
4
|
-
export interface ClientCapabilities {
|
|
5
|
-
topLevelUnions: boolean;
|
|
6
|
-
validJson: boolean;
|
|
7
|
-
refs: boolean;
|
|
8
|
-
unions: boolean;
|
|
9
|
-
formats: boolean;
|
|
10
|
-
toolNameLength: number | undefined;
|
|
11
|
-
}
|
|
12
|
-
export declare const defaultClientCapabilities: ClientCapabilities;
|
|
13
|
-
export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor", "infer"]>;
|
|
14
|
-
export type ClientType = z.infer<typeof ClientType>;
|
|
15
|
-
export declare const knownClients: Record<Exclude<ClientType, 'infer'>, ClientCapabilities>;
|
|
16
|
-
/**
|
|
17
|
-
* Attempts to parse strings into JSON objects
|
|
18
|
-
*/
|
|
19
|
-
export declare function parseEmbeddedJSON(args: Record<string, unknown>, schema: Record<string, unknown>): Record<string, unknown>;
|
|
20
|
-
export type JSONSchema = {
|
|
21
|
-
type?: string;
|
|
22
|
-
properties?: Record<string, JSONSchema>;
|
|
23
|
-
required?: string[];
|
|
24
|
-
anyOf?: JSONSchema[];
|
|
25
|
-
$ref?: string;
|
|
26
|
-
$defs?: Record<string, JSONSchema>;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Truncates tool names to the specified length while ensuring uniqueness.
|
|
31
|
-
* If truncation would cause duplicate names, appends a number to make them unique.
|
|
32
|
-
*/
|
|
33
|
-
export declare function truncateToolNames(names: string[], maxLength: number): Map<string, string>;
|
|
34
|
-
/**
|
|
35
|
-
* Removes top-level unions from a tool by splitting it into multiple tools,
|
|
36
|
-
* one for each variant in the union.
|
|
37
|
-
*/
|
|
38
|
-
export declare function removeTopLevelUnions(tool: Tool): Tool[];
|
|
39
|
-
declare function findUsedDefs(schema: JSONSchema, defs: Record<string, JSONSchema>, visited?: Set<string>): Record<string, JSONSchema>;
|
|
40
|
-
export { findUsedDefs };
|
|
41
|
-
/**
|
|
42
|
-
* Inlines all $refs in a schema, eliminating $defs.
|
|
43
|
-
* If a circular reference is detected, the circular property is removed.
|
|
44
|
-
*/
|
|
45
|
-
export declare function inlineRefs(schema: JSONSchema): JSONSchema;
|
|
46
|
-
/**
|
|
47
|
-
* Removes anyOf fields from a schema, using only the first variant.
|
|
48
|
-
*/
|
|
49
|
-
export declare function removeAnyOf(schema: JSONSchema): JSONSchema;
|
|
50
|
-
/**
|
|
51
|
-
* Removes format fields from a schema and appends them to the description.
|
|
52
|
-
*/
|
|
53
|
-
export declare function removeFormats(schema: JSONSchema, formatsCapability: boolean): JSONSchema;
|
|
54
|
-
/**
|
|
55
|
-
* Applies all compatibility transformations to the endpoints based on the provided capabilities.
|
|
56
|
-
*/
|
|
57
|
-
export declare function applyCompatibilityTransformations(endpoints: Endpoint[], capabilities: ClientCapabilities): Endpoint[];
|
|
58
|
-
//# sourceMappingURL=compat.d.mts.map
|
package/compat.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compat.d.mts","sourceRoot":"","sources":["src/compat.ts"],"names":[],"mappings":"OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,EAAE,CAAC,EAAE,MAAM,KAAK;OAChB,EAAE,QAAQ,EAAE;AAEnB,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,yBAAyB,EAAE,kBAOvC,CAAC;AAEF,eAAO,MAAM,UAAU,0EAAwE,CAAC;AAChG,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAKpD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAiCjF,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM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,EACrB,YAAY,EAAE,kBAAkB,GAC/B,QAAQ,EAAE,CAiEZ"}
|
package/compat.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { Endpoint } from "./tools.js";
|
|
4
|
-
export interface ClientCapabilities {
|
|
5
|
-
topLevelUnions: boolean;
|
|
6
|
-
validJson: boolean;
|
|
7
|
-
refs: boolean;
|
|
8
|
-
unions: boolean;
|
|
9
|
-
formats: boolean;
|
|
10
|
-
toolNameLength: number | undefined;
|
|
11
|
-
}
|
|
12
|
-
export declare const defaultClientCapabilities: ClientCapabilities;
|
|
13
|
-
export declare const ClientType: z.ZodEnum<["openai-agents", "claude", "claude-code", "cursor", "infer"]>;
|
|
14
|
-
export type ClientType = z.infer<typeof ClientType>;
|
|
15
|
-
export declare const knownClients: Record<Exclude<ClientType, 'infer'>, ClientCapabilities>;
|
|
16
|
-
/**
|
|
17
|
-
* Attempts to parse strings into JSON objects
|
|
18
|
-
*/
|
|
19
|
-
export declare function parseEmbeddedJSON(args: Record<string, unknown>, schema: Record<string, unknown>): Record<string, unknown>;
|
|
20
|
-
export type JSONSchema = {
|
|
21
|
-
type?: string;
|
|
22
|
-
properties?: Record<string, JSONSchema>;
|
|
23
|
-
required?: string[];
|
|
24
|
-
anyOf?: JSONSchema[];
|
|
25
|
-
$ref?: string;
|
|
26
|
-
$defs?: Record<string, JSONSchema>;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Truncates tool names to the specified length while ensuring uniqueness.
|
|
31
|
-
* If truncation would cause duplicate names, appends a number to make them unique.
|
|
32
|
-
*/
|
|
33
|
-
export declare function truncateToolNames(names: string[], maxLength: number): Map<string, string>;
|
|
34
|
-
/**
|
|
35
|
-
* Removes top-level unions from a tool by splitting it into multiple tools,
|
|
36
|
-
* one for each variant in the union.
|
|
37
|
-
*/
|
|
38
|
-
export declare function removeTopLevelUnions(tool: Tool): Tool[];
|
|
39
|
-
declare function findUsedDefs(schema: JSONSchema, defs: Record<string, JSONSchema>, visited?: Set<string>): Record<string, JSONSchema>;
|
|
40
|
-
export { findUsedDefs };
|
|
41
|
-
/**
|
|
42
|
-
* Inlines all $refs in a schema, eliminating $defs.
|
|
43
|
-
* If a circular reference is detected, the circular property is removed.
|
|
44
|
-
*/
|
|
45
|
-
export declare function inlineRefs(schema: JSONSchema): JSONSchema;
|
|
46
|
-
/**
|
|
47
|
-
* Removes anyOf fields from a schema, using only the first variant.
|
|
48
|
-
*/
|
|
49
|
-
export declare function removeAnyOf(schema: JSONSchema): JSONSchema;
|
|
50
|
-
/**
|
|
51
|
-
* Removes format fields from a schema and appends them to the description.
|
|
52
|
-
*/
|
|
53
|
-
export declare function removeFormats(schema: JSONSchema, formatsCapability: boolean): JSONSchema;
|
|
54
|
-
/**
|
|
55
|
-
* Applies all compatibility transformations to the endpoints based on the provided capabilities.
|
|
56
|
-
*/
|
|
57
|
-
export declare function applyCompatibilityTransformations(endpoints: Endpoint[], capabilities: ClientCapabilities): Endpoint[];
|
|
58
|
-
//# sourceMappingURL=compat.d.ts.map
|
package/compat.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["src/compat.ts"],"names":[],"mappings":"OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,EAAE,CAAC,EAAE,MAAM,KAAK;OAChB,EAAE,QAAQ,EAAE;AAEnB,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,yBAAyB,EAAE,kBAOvC,CAAC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