@decaf-ts/decorator-validation 1.10.2 → 1.10.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/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/package.json +6 -21
- package/lib/esm/mcp/ModelContextProtocol.d.ts +0 -123
- package/lib/esm/mcp/ModelContextProtocol.js +0 -179
- package/lib/esm/mcp/ModelContextProtocol.js.map +0 -1
- package/lib/esm/mcp/mcp1.d.ts +0 -0
- package/lib/esm/mcp/mcp1.js +0 -405
- package/lib/esm/mcp/mcp1.js.map +0 -1
- package/lib/esm/mcp/tools/createModel.tool.d.ts +0 -0
- package/lib/esm/mcp/tools/createModel.tool.js +0 -67
- package/lib/esm/mcp/tools/createModel.tool.js.map +0 -1
- package/lib/esm/mcp/tools/validateModel.tool.d.ts +0 -0
- package/lib/esm/mcp/tools/validateModel.tool.js +0 -2
- package/lib/esm/mcp/tools/validateModel.tool.js.map +0 -1
- package/lib/esm/mcp/types.d.ts +0 -3
- package/lib/esm/mcp/types.js +0 -2
- package/lib/esm/mcp/types.js.map +0 -1
- package/lib/mcp/ModelContextProtocol.cjs +0 -183
- package/lib/mcp/ModelContextProtocol.d.ts +0 -123
- package/lib/mcp/ModelContextProtocol.js.map +0 -1
- package/lib/mcp/mcp1.cjs +0 -405
- package/lib/mcp/mcp1.d.ts +0 -0
- package/lib/mcp/mcp1.js.map +0 -1
- package/lib/mcp/tools/createModel.tool.cjs +0 -67
- package/lib/mcp/tools/createModel.tool.d.ts +0 -0
- package/lib/mcp/tools/createModel.tool.js.map +0 -1
- package/lib/mcp/tools/validateModel.tool.cjs +0 -2
- package/lib/mcp/tools/validateModel.tool.d.ts +0 -0
- package/lib/mcp/tools/validateModel.tool.js.map +0 -1
- package/lib/mcp/types.cjs +0 -3
- package/lib/mcp/types.d.ts +0 -3
- package/lib/mcp/types.js.map +0 -1
package/lib/esm/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from "./model";
|
|
|
9
9
|
* @const VERSION
|
|
10
10
|
* @memberOf module:decorator-validation
|
|
11
11
|
*/
|
|
12
|
-
export declare const VERSION = "1.10.
|
|
12
|
+
export declare const VERSION = "1.10.3";
|
|
13
13
|
/**
|
|
14
14
|
* @description Current version of the reflection package
|
|
15
15
|
* @summary Stores the semantic version number of the package
|
package/lib/esm/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export * from "./model/index.js";
|
|
|
17
17
|
* @const VERSION
|
|
18
18
|
* @memberOf module:decorator-validation
|
|
19
19
|
*/
|
|
20
|
-
export const VERSION = "1.10.
|
|
20
|
+
export const VERSION = "1.10.3";
|
|
21
21
|
/**
|
|
22
22
|
* @description Current version of the reflection package
|
|
23
23
|
* @summary Stores the semantic version number of the package
|
package/lib/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __exportStar(require("./model/index.cjs"), exports);
|
|
|
34
34
|
* @const VERSION
|
|
35
35
|
* @memberOf module:decorator-validation
|
|
36
36
|
*/
|
|
37
|
-
exports.VERSION = "1.10.
|
|
37
|
+
exports.VERSION = "1.10.3";
|
|
38
38
|
/**
|
|
39
39
|
* @description Current version of the reflection package
|
|
40
40
|
* @summary Stores the semantic version number of the package
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from "./model";
|
|
|
9
9
|
* @const VERSION
|
|
10
10
|
* @memberOf module:decorator-validation
|
|
11
11
|
*/
|
|
12
|
-
export declare const VERSION = "1.10.
|
|
12
|
+
export declare const VERSION = "1.10.3";
|
|
13
13
|
/**
|
|
14
14
|
* @description Current version of the reflection package
|
|
15
15
|
* @summary Stores the semantic version number of the package
|
package/package.json
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decaf-ts/decorator-validation",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
4
4
|
"description": "simple decorator based validation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"require": "./lib/index.cjs",
|
|
10
|
-
"import": "./lib/esm/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./mcp": {
|
|
13
|
-
"require": "./lib/esm/mcp/index.cjs",
|
|
14
|
-
"import": "./lib/esm/mcp/index.js",
|
|
15
|
-
"types": "./lib/esm/index.d.ts"
|
|
16
|
-
}
|
|
7
|
+
"require": "./lib/index.cjs",
|
|
8
|
+
"import": "./lib/esm/index.js"
|
|
17
9
|
},
|
|
18
10
|
"types": "lib/index.d.ts",
|
|
19
11
|
"scripts": {
|
|
@@ -83,17 +75,10 @@
|
|
|
83
75
|
},
|
|
84
76
|
"homepage": "https://github.com/decaf-ts/decorator-validation#readme",
|
|
85
77
|
"devDependencies": {
|
|
86
|
-
"@decaf-ts/utils": "latest"
|
|
87
|
-
"@rollup/plugin-typescript": "^12.1.2",
|
|
88
|
-
"fast-check": "^4.2.0",
|
|
89
|
-
"fastmcp": "^3.8.4",
|
|
90
|
-
"rollup": "^4.40.0",
|
|
91
|
-
"typescript-eslint": "8.34.1"
|
|
78
|
+
"@decaf-ts/utils": "latest"
|
|
92
79
|
},
|
|
93
|
-
"
|
|
80
|
+
"dependencies": {
|
|
94
81
|
"@decaf-ts/decoration": "latest",
|
|
95
|
-
"@decaf-ts/reflection": "latest"
|
|
96
|
-
"reflect-metadata": "^0.2.1",
|
|
97
|
-
"typed-object-accumulator": "latest"
|
|
82
|
+
"@decaf-ts/reflection": "latest"
|
|
98
83
|
}
|
|
99
84
|
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { FastMCP, Tool } from "fastmcp";
|
|
2
|
-
import { Logger } from "@decaf-ts/logging";
|
|
3
|
-
import { FastMCPSessionAuth } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* @description Fluent builder for creating a configured ModelContextProtocol instance.
|
|
6
|
-
* @summary Collects MCP configuration including a semantic version, a name, and a registry of tools, offering chainable methods and a final build step to produce a ready-to-use ModelContextProtocol.
|
|
7
|
-
* @param {string} [name] The name of the MCP instance to build.
|
|
8
|
-
* @param {string} [version] The semantic version of the MCP instance.
|
|
9
|
-
* @param {Record<string, Tool<any, any>>} [tools] A map of tool configurations indexed by tool name.
|
|
10
|
-
* @class
|
|
11
|
-
* @example
|
|
12
|
-
* // Build a new MCP with a single tool
|
|
13
|
-
* const mcp = ModelContextProtocol.builder
|
|
14
|
-
* .setName("Example")
|
|
15
|
-
* .setVersion("1.0.0")
|
|
16
|
-
* .addTool({ name: "do", description: "", parameters: z.any(), execute: async () => "ok" })
|
|
17
|
-
* .build();
|
|
18
|
-
* @mermaid
|
|
19
|
-
* sequenceDiagram
|
|
20
|
-
* participant Dev as Developer
|
|
21
|
-
* participant B as Builder
|
|
22
|
-
* participant MCP as ModelContextProtocol
|
|
23
|
-
* Dev->>B: setName("Example")
|
|
24
|
-
* B-->>Dev: Builder
|
|
25
|
-
* Dev->>B: setVersion("1.0.0")
|
|
26
|
-
* B-->>Dev: Builder
|
|
27
|
-
* Dev->>B: addTool(tool)
|
|
28
|
-
* B-->>Dev: Builder
|
|
29
|
-
* Dev->>B: build()
|
|
30
|
-
* B->>MCP: new ModelContextProtocol(FastMCP)
|
|
31
|
-
* B-->>Dev: ModelContextProtocol
|
|
32
|
-
*/
|
|
33
|
-
declare class Builder {
|
|
34
|
-
name: string;
|
|
35
|
-
version: `${number}.${number}.${number}`;
|
|
36
|
-
tools: Record<string, Tool<any, any>>;
|
|
37
|
-
log: Logger;
|
|
38
|
-
constructor();
|
|
39
|
-
/**
|
|
40
|
-
* @description Sets the MCP instance name.
|
|
41
|
-
* @summary Assigns a human-readable identifier to the builder configuration and enables method chaining.
|
|
42
|
-
* @param {string} value The name to assign to the MCP instance.
|
|
43
|
-
* @return {this} The current builder instance for chaining.
|
|
44
|
-
*/
|
|
45
|
-
setName(value: string): this;
|
|
46
|
-
/**
|
|
47
|
-
* @description Sets and validates the semantic version for the MCP instance.
|
|
48
|
-
* @summary Parses the provided value against semantic versioning and stores the normalized version; enables method chaining.
|
|
49
|
-
* @param {string} value The semantic version string (e.g., "1.2.3").
|
|
50
|
-
* @return {this} The current builder instance for chaining.
|
|
51
|
-
*/
|
|
52
|
-
setVersion(value: string): this;
|
|
53
|
-
/**
|
|
54
|
-
* @description Registers a new tool in the builder.
|
|
55
|
-
* @summary Adds a tool configuration by its unique name to the internal registry, throwing if a tool with the same name already exists.
|
|
56
|
-
* @template Auth extends FastMCPSessionAuth
|
|
57
|
-
* @param {Tool<Auth, any>} config The tool configuration object, including a unique name and an execute handler.
|
|
58
|
-
* @return {this} The current builder instance for chaining.
|
|
59
|
-
*/
|
|
60
|
-
addTool<Auth extends FastMCPSessionAuth = undefined>(config: Tool<Auth, any>): this;
|
|
61
|
-
/**
|
|
62
|
-
* @description Finalizes the configuration and produces a ModelContextProtocol instance.
|
|
63
|
-
* @summary Validates required fields (name and version), constructs a FastMCP instance, registers all configured tools, and returns a ModelContextProtocol wrapping the MCP.
|
|
64
|
-
* @template Auth extends FastMCPSessionAuth
|
|
65
|
-
* @return {ModelContextProtocol<Auth>} A fully initialized ModelContextProtocol instance.
|
|
66
|
-
*/
|
|
67
|
-
build<Auth extends FastMCPSessionAuth = undefined>(): ModelContextProtocol<Auth>;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @description A thin wrapper around FastMCP providing a typed interface for model-centric protocols.
|
|
71
|
-
* @summary Encapsulates a configured FastMCP instance and exposes factory utilities via a static Builder for constructing MCPs with tools, versioning, and naming semantics.
|
|
72
|
-
* @template Auth extends FastMCPSessionAuth Authentication payload type stored in the MCP session, or undefined for no auth.
|
|
73
|
-
* @param {FastMCP<Auth>} mcp The underlying FastMCP instance used to register and run tools.
|
|
74
|
-
* @class
|
|
75
|
-
* @example
|
|
76
|
-
* // Using the builder
|
|
77
|
-
* const protocol = ModelContextProtocol.builder
|
|
78
|
-
* .setName("Validator")
|
|
79
|
-
* .setVersion("1.2.3")
|
|
80
|
-
* .addTool({ name: "ping", description: "", parameters: z.any(), execute: async () => "pong" })
|
|
81
|
-
* .build();
|
|
82
|
-
* @mermaid
|
|
83
|
-
* sequenceDiagram
|
|
84
|
-
* participant Dev as Developer
|
|
85
|
-
* participant B as ModelContextProtocol.Builder
|
|
86
|
-
* participant MCP as FastMCP
|
|
87
|
-
* participant Proto as ModelContextProtocol
|
|
88
|
-
* Dev->>B: setName()/setVersion()/addTool()
|
|
89
|
-
* Dev->>B: build()
|
|
90
|
-
* B->>MCP: new FastMCP({ name, version })
|
|
91
|
-
* B->>MCP: addTool(tool...)
|
|
92
|
-
* B->>Proto: new ModelContextProtocol(MCP)
|
|
93
|
-
* B-->>Dev: ModelContextProtocol
|
|
94
|
-
*/
|
|
95
|
-
export declare class ModelContextProtocol<Auth extends FastMCPSessionAuth = undefined> {
|
|
96
|
-
protected readonly mcp: FastMCP<Auth>;
|
|
97
|
-
/**
|
|
98
|
-
* @description Lazily obtains a logger instance for this protocol wrapper.
|
|
99
|
-
* @summary Uses the Logging facility to create a context-aware Logger bound to this instance.
|
|
100
|
-
* @return {Logger} A logger instance for this class.
|
|
101
|
-
*/
|
|
102
|
-
protected get log(): Logger;
|
|
103
|
-
constructor(mcp: FastMCP<Auth>);
|
|
104
|
-
/**
|
|
105
|
-
* @description Alias to the inner Builder class for external access.
|
|
106
|
-
* @summary Exposes the builder type to consumers to enable typed construction of ModelContextProtocol instances.
|
|
107
|
-
*/
|
|
108
|
-
static readonly Builder: typeof Builder;
|
|
109
|
-
/**
|
|
110
|
-
* @description Factory accessor for a new Builder instance.
|
|
111
|
-
* @summary Creates a new builder to fluently configure and construct a ModelContextProtocol.
|
|
112
|
-
* @return {Builder} A new builder instance.
|
|
113
|
-
*/
|
|
114
|
-
static get builder(): Builder;
|
|
115
|
-
/**
|
|
116
|
-
* @description Validates a semantic version string.
|
|
117
|
-
* @summary Utility wrapper around the module-level validateVersion to keep a typed validator close to the class API.
|
|
118
|
-
* @param {string} version The version string to validate.
|
|
119
|
-
* @return {string} The normalized semantic version string.
|
|
120
|
-
*/
|
|
121
|
-
private static validateVersion;
|
|
122
|
-
}
|
|
123
|
-
export {};
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { FastMCP } from "fastmcp";
|
|
2
|
-
import { Logging } from "@decaf-ts/logging";
|
|
3
|
-
/**
|
|
4
|
-
* @description Validates and normalizes a semantic version string.
|
|
5
|
-
* @summary Ensures the provided version follows semantic versioning (major.minor.patch) and returns a tuple-like template string typed as `${number}.${number}.${number}`.
|
|
6
|
-
* @template
|
|
7
|
-
* @param {string} version The version string to validate, expected in the form MAJOR.MINOR.PATCH.
|
|
8
|
-
* @return {string} The normalized version string if valid.
|
|
9
|
-
* @function validateVersion
|
|
10
|
-
* @memberOf module:decorator-validation
|
|
11
|
-
*/
|
|
12
|
-
function validateVersion(version) {
|
|
13
|
-
const regexp = /(\d+)\.(\d+)\.(\d+)/g;
|
|
14
|
-
const match = regexp.exec(version);
|
|
15
|
-
if (!match)
|
|
16
|
-
throw new Error(`Invalid version string. should obey semantic versioning: ${version}`);
|
|
17
|
-
return `${match[1]}.${match[2]}.${match[3]}`;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @description Fluent builder for creating a configured ModelContextProtocol instance.
|
|
21
|
-
* @summary Collects MCP configuration including a semantic version, a name, and a registry of tools, offering chainable methods and a final build step to produce a ready-to-use ModelContextProtocol.
|
|
22
|
-
* @param {string} [name] The name of the MCP instance to build.
|
|
23
|
-
* @param {string} [version] The semantic version of the MCP instance.
|
|
24
|
-
* @param {Record<string, Tool<any, any>>} [tools] A map of tool configurations indexed by tool name.
|
|
25
|
-
* @class
|
|
26
|
-
* @example
|
|
27
|
-
* // Build a new MCP with a single tool
|
|
28
|
-
* const mcp = ModelContextProtocol.builder
|
|
29
|
-
* .setName("Example")
|
|
30
|
-
* .setVersion("1.0.0")
|
|
31
|
-
* .addTool({ name: "do", description: "", parameters: z.any(), execute: async () => "ok" })
|
|
32
|
-
* .build();
|
|
33
|
-
* @mermaid
|
|
34
|
-
* sequenceDiagram
|
|
35
|
-
* participant Dev as Developer
|
|
36
|
-
* participant B as Builder
|
|
37
|
-
* participant MCP as ModelContextProtocol
|
|
38
|
-
* Dev->>B: setName("Example")
|
|
39
|
-
* B-->>Dev: Builder
|
|
40
|
-
* Dev->>B: setVersion("1.0.0")
|
|
41
|
-
* B-->>Dev: Builder
|
|
42
|
-
* Dev->>B: addTool(tool)
|
|
43
|
-
* B-->>Dev: Builder
|
|
44
|
-
* Dev->>B: build()
|
|
45
|
-
* B->>MCP: new ModelContextProtocol(FastMCP)
|
|
46
|
-
* B-->>Dev: ModelContextProtocol
|
|
47
|
-
*/
|
|
48
|
-
class Builder {
|
|
49
|
-
constructor() {
|
|
50
|
-
this.tools = {};
|
|
51
|
-
this.log = Logging.for("MCP Builder");
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @description Sets the MCP instance name.
|
|
55
|
-
* @summary Assigns a human-readable identifier to the builder configuration and enables method chaining.
|
|
56
|
-
* @param {string} value The name to assign to the MCP instance.
|
|
57
|
-
* @return {this} The current builder instance for chaining.
|
|
58
|
-
*/
|
|
59
|
-
setName(value) {
|
|
60
|
-
this.name = value;
|
|
61
|
-
this.log.debug(`name set to ${value}`);
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @description Sets and validates the semantic version for the MCP instance.
|
|
66
|
-
* @summary Parses the provided value against semantic versioning and stores the normalized version; enables method chaining.
|
|
67
|
-
* @param {string} value The semantic version string (e.g., "1.2.3").
|
|
68
|
-
* @return {this} The current builder instance for chaining.
|
|
69
|
-
*/
|
|
70
|
-
setVersion(value) {
|
|
71
|
-
this.version = validateVersion(value);
|
|
72
|
-
this.log.debug(`version set to ${value}`);
|
|
73
|
-
return this;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* @description Registers a new tool in the builder.
|
|
77
|
-
* @summary Adds a tool configuration by its unique name to the internal registry, throwing if a tool with the same name already exists.
|
|
78
|
-
* @template Auth extends FastMCPSessionAuth
|
|
79
|
-
* @param {Tool<Auth, any>} config The tool configuration object, including a unique name and an execute handler.
|
|
80
|
-
* @return {this} The current builder instance for chaining.
|
|
81
|
-
*/
|
|
82
|
-
addTool(config) {
|
|
83
|
-
const { name } = config;
|
|
84
|
-
if (name in this.tools)
|
|
85
|
-
throw new Error(`tool ${name} already registered`);
|
|
86
|
-
this.tools[name] = config;
|
|
87
|
-
this.log.debug(`tool ${name} added`);
|
|
88
|
-
return this;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* @description Finalizes the configuration and produces a ModelContextProtocol instance.
|
|
92
|
-
* @summary Validates required fields (name and version), constructs a FastMCP instance, registers all configured tools, and returns a ModelContextProtocol wrapping the MCP.
|
|
93
|
-
* @template Auth extends FastMCPSessionAuth
|
|
94
|
-
* @return {ModelContextProtocol<Auth>} A fully initialized ModelContextProtocol instance.
|
|
95
|
-
*/
|
|
96
|
-
build() {
|
|
97
|
-
if (!this.name)
|
|
98
|
-
throw new Error("name is required");
|
|
99
|
-
if (!this.version)
|
|
100
|
-
throw new Error("version is required");
|
|
101
|
-
const mcp = new FastMCP({
|
|
102
|
-
name: this.name,
|
|
103
|
-
version: this.version,
|
|
104
|
-
});
|
|
105
|
-
Object.values(this.tools).forEach((tool) => {
|
|
106
|
-
try {
|
|
107
|
-
mcp.addTool(tool);
|
|
108
|
-
}
|
|
109
|
-
catch (e) {
|
|
110
|
-
throw new Error(`Failed to add tool ${tool.name}: ${e}`);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
this.log.info(`${this.name} MCP built`);
|
|
114
|
-
this.log.debug(`${this.name} MCP - available tools: ${Object.keys(this.tools).join(", ")}`);
|
|
115
|
-
return new ModelContextProtocol(mcp);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* @description A thin wrapper around FastMCP providing a typed interface for model-centric protocols.
|
|
120
|
-
* @summary Encapsulates a configured FastMCP instance and exposes factory utilities via a static Builder for constructing MCPs with tools, versioning, and naming semantics.
|
|
121
|
-
* @template Auth extends FastMCPSessionAuth Authentication payload type stored in the MCP session, or undefined for no auth.
|
|
122
|
-
* @param {FastMCP<Auth>} mcp The underlying FastMCP instance used to register and run tools.
|
|
123
|
-
* @class
|
|
124
|
-
* @example
|
|
125
|
-
* // Using the builder
|
|
126
|
-
* const protocol = ModelContextProtocol.builder
|
|
127
|
-
* .setName("Validator")
|
|
128
|
-
* .setVersion("1.2.3")
|
|
129
|
-
* .addTool({ name: "ping", description: "", parameters: z.any(), execute: async () => "pong" })
|
|
130
|
-
* .build();
|
|
131
|
-
* @mermaid
|
|
132
|
-
* sequenceDiagram
|
|
133
|
-
* participant Dev as Developer
|
|
134
|
-
* participant B as ModelContextProtocol.Builder
|
|
135
|
-
* participant MCP as FastMCP
|
|
136
|
-
* participant Proto as ModelContextProtocol
|
|
137
|
-
* Dev->>B: setName()/setVersion()/addTool()
|
|
138
|
-
* Dev->>B: build()
|
|
139
|
-
* B->>MCP: new FastMCP({ name, version })
|
|
140
|
-
* B->>MCP: addTool(tool...)
|
|
141
|
-
* B->>Proto: new ModelContextProtocol(MCP)
|
|
142
|
-
* B-->>Dev: ModelContextProtocol
|
|
143
|
-
*/
|
|
144
|
-
export class ModelContextProtocol {
|
|
145
|
-
/**
|
|
146
|
-
* @description Lazily obtains a logger instance for this protocol wrapper.
|
|
147
|
-
* @summary Uses the Logging facility to create a context-aware Logger bound to this instance.
|
|
148
|
-
* @return {Logger} A logger instance for this class.
|
|
149
|
-
*/
|
|
150
|
-
get log() {
|
|
151
|
-
return Logging.for(this);
|
|
152
|
-
}
|
|
153
|
-
constructor(mcp) {
|
|
154
|
-
this.mcp = mcp;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* @description Alias to the inner Builder class for external access.
|
|
158
|
-
* @summary Exposes the builder type to consumers to enable typed construction of ModelContextProtocol instances.
|
|
159
|
-
*/
|
|
160
|
-
static { this.Builder = Builder; }
|
|
161
|
-
/**
|
|
162
|
-
* @description Factory accessor for a new Builder instance.
|
|
163
|
-
* @summary Creates a new builder to fluently configure and construct a ModelContextProtocol.
|
|
164
|
-
* @return {Builder} A new builder instance.
|
|
165
|
-
*/
|
|
166
|
-
static get builder() {
|
|
167
|
-
return new ModelContextProtocol.Builder();
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* @description Validates a semantic version string.
|
|
171
|
-
* @summary Utility wrapper around the module-level validateVersion to keep a typed validator close to the class API.
|
|
172
|
-
* @param {string} version The version string to validate.
|
|
173
|
-
* @return {string} The normalized semantic version string.
|
|
174
|
-
*/
|
|
175
|
-
static validateVersion(version) {
|
|
176
|
-
return validateVersion(version);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
//# sourceMappingURL=ModelContextProtocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModelContextProtocol.js","sourceRoot":"","sources":["../../../src/mcp/ModelContextProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,SAAS,CAAC;AACxC,OAAO,EAAU,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;;;;;;GAQG;AACH,SAAS,eAAe,CAAC,OAAe;IACtC,MAAM,MAAM,GAAG,sBAAsB,CAAC;IACtC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,KAAK;QACR,MAAM,IAAI,KAAK,CACb,4DAA4D,OAAO,EAAE,CACtE,CAAC;IACJ,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAqC,CAAC;AAClF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO;IAO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