@contractspec/bundle.library 3.8.4 → 3.8.7
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/.turbo/turbo-build.log +126 -112
- package/CHANGELOG.md +56 -0
- package/dist/application/index.js +806 -131
- package/dist/application/mcp/cliMcp.js +21 -2
- package/dist/application/mcp/common.js +21 -2
- package/dist/application/mcp/common.test.d.ts +1 -0
- package/dist/application/mcp/contractsMcp.js +21 -2
- package/dist/application/mcp/docsMcp.catalog.d.ts +2 -0
- package/dist/application/mcp/docsMcp.catalog.js +382 -0
- package/dist/application/mcp/docsMcp.d.ts +5 -1
- package/dist/application/mcp/docsMcp.data.d.ts +85 -0
- package/dist/application/mcp/docsMcp.data.js +148 -0
- package/dist/application/mcp/docsMcp.js +776 -101
- package/dist/application/mcp/docsMcp.prompts.d.ts +3 -0
- package/dist/application/mcp/docsMcp.prompts.js +522 -0
- package/dist/application/mcp/docsMcp.reference.d.ts +24 -0
- package/dist/application/mcp/docsMcp.reference.js +236 -0
- package/dist/application/mcp/docsMcp.resources.d.ts +3 -0
- package/dist/application/mcp/docsMcp.resources.js +520 -0
- package/dist/application/mcp/docsMcp.test.d.ts +1 -0
- package/dist/application/mcp/docsMcp.tools.d.ts +3 -0
- package/dist/application/mcp/docsMcp.tools.js +519 -0
- package/dist/application/mcp/index.js +806 -131
- package/dist/application/mcp/internalMcp.js +21 -2
- package/dist/application/mcp/normalizeMcpRequest.d.ts +1 -0
- package/dist/application/mcp/normalizeMcpRequest.js +22 -0
- package/dist/application/mcp/providerRankingMcp.js +21 -2
- package/dist/features/index.js +15 -15
- package/dist/index.js +171 -171
- package/dist/node/application/index.js +806 -131
- package/dist/node/application/mcp/cliMcp.js +21 -2
- package/dist/node/application/mcp/common.js +21 -2
- package/dist/node/application/mcp/contractsMcp.js +21 -2
- package/dist/node/application/mcp/docsMcp.catalog.js +381 -0
- package/dist/node/application/mcp/docsMcp.data.js +147 -0
- package/dist/node/application/mcp/docsMcp.js +776 -101
- package/dist/node/application/mcp/docsMcp.prompts.js +521 -0
- package/dist/node/application/mcp/docsMcp.reference.js +235 -0
- package/dist/node/application/mcp/docsMcp.resources.js +519 -0
- package/dist/node/application/mcp/docsMcp.tools.js +518 -0
- package/dist/node/application/mcp/index.js +806 -131
- package/dist/node/application/mcp/internalMcp.js +21 -2
- package/dist/node/application/mcp/normalizeMcpRequest.js +21 -0
- package/dist/node/application/mcp/providerRankingMcp.js +21 -2
- package/dist/node/features/index.js +15 -15
- package/dist/node/index.js +171 -171
- package/dist/node/presentation/features/hooks/index.js +12 -12
- package/dist/node/presentation/features/hooks/useContractsRegistry.js +12 -12
- package/dist/node/presentation/features/index.js +12 -12
- package/dist/node/presentation/features/organisms/FeatureDataViewsList.js +12 -12
- package/dist/node/presentation/features/organisms/FeatureEventsList.js +12 -12
- package/dist/node/presentation/features/organisms/FeatureFormsList.js +12 -12
- package/dist/node/presentation/features/organisms/FeaturePresentationsList.js +12 -12
- package/dist/node/presentation/features/organisms/index.js +12 -12
- package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +12 -12
- package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/index.js +12 -12
- package/dist/node/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +12 -12
- package/dist/node/presentation/features/templates/FeatureEventsTemplate/index.js +12 -12
- package/dist/node/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +12 -12
- package/dist/node/presentation/features/templates/FeatureFormsTemplate/index.js +12 -12
- package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +12 -12
- package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/index.js +12 -12
- package/dist/presentation/features/hooks/index.js +12 -12
- package/dist/presentation/features/hooks/useContractsRegistry.js +12 -12
- package/dist/presentation/features/index.js +12 -12
- package/dist/presentation/features/organisms/FeatureDataViewsList.js +12 -12
- package/dist/presentation/features/organisms/FeatureEventsList.js +12 -12
- package/dist/presentation/features/organisms/FeatureFormsList.js +12 -12
- package/dist/presentation/features/organisms/FeaturePresentationsList.js +12 -12
- package/dist/presentation/features/organisms/index.js +12 -12
- package/dist/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +12 -12
- package/dist/presentation/features/templates/FeatureDataViewsTemplate/index.js +12 -12
- package/dist/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +12 -12
- package/dist/presentation/features/templates/FeatureEventsTemplate/index.js +12 -12
- package/dist/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +12 -12
- package/dist/presentation/features/templates/FeatureFormsTemplate/index.js +12 -12
- package/dist/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +12 -12
- package/dist/presentation/features/templates/FeaturePresentationsTemplate/index.js +12 -12
- package/package.json +108 -24
- package/src/application/mcp/common.test.ts +64 -0
- package/src/application/mcp/common.ts +5 -2
- package/src/application/mcp/docsMcp.catalog.ts +2 -0
- package/src/application/mcp/docsMcp.data.ts +196 -0
- package/src/application/mcp/docsMcp.prompts.ts +165 -0
- package/src/application/mcp/docsMcp.reference.ts +152 -0
- package/src/application/mcp/docsMcp.resources.ts +194 -0
- package/src/application/mcp/docsMcp.test.ts +148 -0
- package/src/application/mcp/docsMcp.tools.ts +183 -0
- package/src/application/mcp/docsMcp.ts +13 -177
- package/src/application/mcp/normalizeMcpRequest.ts +30 -0
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/features/docs/docs.contracts.ts
|
|
3
|
-
import {
|
|
4
|
-
ContractReferenceQuery,
|
|
5
|
-
DocSummaryModel,
|
|
6
|
-
DocsIndexInput,
|
|
7
|
-
DocsIndexOutput,
|
|
8
|
-
DocsIndexQuery,
|
|
9
|
-
DocsIndexQuery as DocsIndexQuery2
|
|
10
|
-
} from "@contractspec/lib.contracts-spec/docs";
|
|
11
2
|
// src/features/contracts-registry.ts
|
|
12
3
|
import {
|
|
13
4
|
EventRegistry,
|
|
@@ -18,11 +9,11 @@ import {
|
|
|
18
9
|
} from "@contractspec/lib.contracts-spec/data-views";
|
|
19
10
|
import {
|
|
20
11
|
ContractReferenceDataView,
|
|
21
|
-
ContractReferenceQuery
|
|
12
|
+
ContractReferenceQuery,
|
|
22
13
|
DocsGenerateCommand,
|
|
23
14
|
DocsGeneratedEvent,
|
|
24
15
|
DocsIndexDataView,
|
|
25
|
-
DocsIndexQuery
|
|
16
|
+
DocsIndexQuery,
|
|
26
17
|
DocsLayoutPresentation,
|
|
27
18
|
DocsPublishCommand,
|
|
28
19
|
DocsPublishedEvent,
|
|
@@ -44,7 +35,7 @@ import {
|
|
|
44
35
|
var operationRegistry = null;
|
|
45
36
|
function createContractSpecOperationRegistry() {
|
|
46
37
|
const registry = new OperationSpecRegistry;
|
|
47
|
-
registry.register(
|
|
38
|
+
registry.register(DocsIndexQuery).register(ContractReferenceQuery).register(DocsGenerateCommand).register(DocsPublishCommand);
|
|
48
39
|
return registry;
|
|
49
40
|
}
|
|
50
41
|
function getContractSpecOperationRegistry() {
|
|
@@ -190,6 +181,15 @@ var DocsFeature = {
|
|
|
190
181
|
}
|
|
191
182
|
};
|
|
192
183
|
|
|
184
|
+
// src/features/docs/docs.contracts.ts
|
|
185
|
+
import {
|
|
186
|
+
ContractReferenceQuery as ContractReferenceQuery2,
|
|
187
|
+
DocSummaryModel,
|
|
188
|
+
DocsIndexInput,
|
|
189
|
+
DocsIndexOutput,
|
|
190
|
+
DocsIndexQuery as DocsIndexQuery2,
|
|
191
|
+
DocsIndexQuery as DocsIndexQuery3
|
|
192
|
+
} from "@contractspec/lib.contracts-spec/docs";
|
|
193
193
|
// src/features/mcp.feature.ts
|
|
194
194
|
var MCPFeature = {
|
|
195
195
|
meta: {
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/features/docs/docs.contracts.ts
|
|
3
|
-
import {
|
|
4
|
-
ContractReferenceQuery,
|
|
5
|
-
DocSummaryModel,
|
|
6
|
-
DocsIndexInput,
|
|
7
|
-
DocsIndexOutput,
|
|
8
|
-
DocsIndexQuery,
|
|
9
|
-
DocsIndexQuery as DocsIndexQuery2
|
|
10
|
-
} from "@contractspec/lib.contracts-spec/docs";
|
|
11
2
|
// src/features/contracts-registry.ts
|
|
12
3
|
import {
|
|
13
4
|
EventRegistry,
|
|
@@ -18,11 +9,11 @@ import {
|
|
|
18
9
|
} from "@contractspec/lib.contracts-spec/data-views";
|
|
19
10
|
import {
|
|
20
11
|
ContractReferenceDataView,
|
|
21
|
-
ContractReferenceQuery
|
|
12
|
+
ContractReferenceQuery,
|
|
22
13
|
DocsGenerateCommand,
|
|
23
14
|
DocsGeneratedEvent,
|
|
24
15
|
DocsIndexDataView,
|
|
25
|
-
DocsIndexQuery
|
|
16
|
+
DocsIndexQuery,
|
|
26
17
|
DocsLayoutPresentation,
|
|
27
18
|
DocsPublishCommand,
|
|
28
19
|
DocsPublishedEvent,
|
|
@@ -44,7 +35,7 @@ import {
|
|
|
44
35
|
var operationRegistry = null;
|
|
45
36
|
function createContractSpecOperationRegistry() {
|
|
46
37
|
const registry = new OperationSpecRegistry;
|
|
47
|
-
registry.register(
|
|
38
|
+
registry.register(DocsIndexQuery).register(ContractReferenceQuery).register(DocsGenerateCommand).register(DocsPublishCommand);
|
|
48
39
|
return registry;
|
|
49
40
|
}
|
|
50
41
|
function getContractSpecOperationRegistry() {
|
|
@@ -190,6 +181,15 @@ var DocsFeature = {
|
|
|
190
181
|
}
|
|
191
182
|
};
|
|
192
183
|
|
|
184
|
+
// src/features/docs/docs.contracts.ts
|
|
185
|
+
import {
|
|
186
|
+
ContractReferenceQuery as ContractReferenceQuery2,
|
|
187
|
+
DocSummaryModel,
|
|
188
|
+
DocsIndexInput,
|
|
189
|
+
DocsIndexOutput,
|
|
190
|
+
DocsIndexQuery as DocsIndexQuery2,
|
|
191
|
+
DocsIndexQuery as DocsIndexQuery3
|
|
192
|
+
} from "@contractspec/lib.contracts-spec/docs";
|
|
193
193
|
// src/features/mcp.feature.ts
|
|
194
194
|
var MCPFeature = {
|
|
195
195
|
meta: {
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/features/docs/docs.contracts.ts
|
|
3
|
-
import {
|
|
4
|
-
ContractReferenceQuery,
|
|
5
|
-
DocSummaryModel,
|
|
6
|
-
DocsIndexInput,
|
|
7
|
-
DocsIndexOutput,
|
|
8
|
-
DocsIndexQuery,
|
|
9
|
-
DocsIndexQuery as DocsIndexQuery2
|
|
10
|
-
} from "@contractspec/lib.contracts-spec/docs";
|
|
11
2
|
// src/features/contracts-registry.ts
|
|
12
3
|
import {
|
|
13
4
|
EventRegistry,
|
|
@@ -18,11 +9,11 @@ import {
|
|
|
18
9
|
} from "@contractspec/lib.contracts-spec/data-views";
|
|
19
10
|
import {
|
|
20
11
|
ContractReferenceDataView,
|
|
21
|
-
ContractReferenceQuery
|
|
12
|
+
ContractReferenceQuery,
|
|
22
13
|
DocsGenerateCommand,
|
|
23
14
|
DocsGeneratedEvent,
|
|
24
15
|
DocsIndexDataView,
|
|
25
|
-
DocsIndexQuery
|
|
16
|
+
DocsIndexQuery,
|
|
26
17
|
DocsLayoutPresentation,
|
|
27
18
|
DocsPublishCommand,
|
|
28
19
|
DocsPublishedEvent,
|
|
@@ -44,7 +35,7 @@ import {
|
|
|
44
35
|
var operationRegistry = null;
|
|
45
36
|
function createContractSpecOperationRegistry() {
|
|
46
37
|
const registry = new OperationSpecRegistry;
|
|
47
|
-
registry.register(
|
|
38
|
+
registry.register(DocsIndexQuery).register(ContractReferenceQuery).register(DocsGenerateCommand).register(DocsPublishCommand);
|
|
48
39
|
return registry;
|
|
49
40
|
}
|
|
50
41
|
function getContractSpecOperationRegistry() {
|
|
@@ -190,6 +181,15 @@ var DocsFeature = {
|
|
|
190
181
|
}
|
|
191
182
|
};
|
|
192
183
|
|
|
184
|
+
// src/features/docs/docs.contracts.ts
|
|
185
|
+
import {
|
|
186
|
+
ContractReferenceQuery as ContractReferenceQuery2,
|
|
187
|
+
DocSummaryModel,
|
|
188
|
+
DocsIndexInput,
|
|
189
|
+
DocsIndexOutput,
|
|
190
|
+
DocsIndexQuery as DocsIndexQuery2,
|
|
191
|
+
DocsIndexQuery as DocsIndexQuery3
|
|
192
|
+
} from "@contractspec/lib.contracts-spec/docs";
|
|
193
193
|
// src/features/mcp.feature.ts
|
|
194
194
|
var MCPFeature = {
|
|
195
195
|
meta: {
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/features/docs/docs.contracts.ts
|
|
3
|
-
import {
|
|
4
|
-
ContractReferenceQuery,
|
|
5
|
-
DocSummaryModel,
|
|
6
|
-
DocsIndexInput,
|
|
7
|
-
DocsIndexOutput,
|
|
8
|
-
DocsIndexQuery,
|
|
9
|
-
DocsIndexQuery as DocsIndexQuery2
|
|
10
|
-
} from "@contractspec/lib.contracts-spec/docs";
|
|
11
2
|
// src/features/contracts-registry.ts
|
|
12
3
|
import {
|
|
13
4
|
EventRegistry,
|
|
@@ -18,11 +9,11 @@ import {
|
|
|
18
9
|
} from "@contractspec/lib.contracts-spec/data-views";
|
|
19
10
|
import {
|
|
20
11
|
ContractReferenceDataView,
|
|
21
|
-
ContractReferenceQuery
|
|
12
|
+
ContractReferenceQuery,
|
|
22
13
|
DocsGenerateCommand,
|
|
23
14
|
DocsGeneratedEvent,
|
|
24
15
|
DocsIndexDataView,
|
|
25
|
-
DocsIndexQuery
|
|
16
|
+
DocsIndexQuery,
|
|
26
17
|
DocsLayoutPresentation,
|
|
27
18
|
DocsPublishCommand,
|
|
28
19
|
DocsPublishedEvent,
|
|
@@ -44,7 +35,7 @@ import {
|
|
|
44
35
|
var operationRegistry = null;
|
|
45
36
|
function createContractSpecOperationRegistry() {
|
|
46
37
|
const registry = new OperationSpecRegistry;
|
|
47
|
-
registry.register(
|
|
38
|
+
registry.register(DocsIndexQuery).register(ContractReferenceQuery).register(DocsGenerateCommand).register(DocsPublishCommand);
|
|
48
39
|
return registry;
|
|
49
40
|
}
|
|
50
41
|
function getContractSpecOperationRegistry() {
|
|
@@ -190,6 +181,15 @@ var DocsFeature = {
|
|
|
190
181
|
}
|
|
191
182
|
};
|
|
192
183
|
|
|
184
|
+
// src/features/docs/docs.contracts.ts
|
|
185
|
+
import {
|
|
186
|
+
ContractReferenceQuery as ContractReferenceQuery2,
|
|
187
|
+
DocSummaryModel,
|
|
188
|
+
DocsIndexInput,
|
|
189
|
+
DocsIndexOutput,
|
|
190
|
+
DocsIndexQuery as DocsIndexQuery2,
|
|
191
|
+
DocsIndexQuery as DocsIndexQuery3
|
|
192
|
+
} from "@contractspec/lib.contracts-spec/docs";
|
|
193
193
|
// src/features/mcp.feature.ts
|
|
194
194
|
var MCPFeature = {
|
|
195
195
|
meta: {
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/features/docs/docs.contracts.ts
|
|
3
|
-
import {
|
|
4
|
-
ContractReferenceQuery,
|
|
5
|
-
DocSummaryModel,
|
|
6
|
-
DocsIndexInput,
|
|
7
|
-
DocsIndexOutput,
|
|
8
|
-
DocsIndexQuery,
|
|
9
|
-
DocsIndexQuery as DocsIndexQuery2
|
|
10
|
-
} from "@contractspec/lib.contracts-spec/docs";
|
|
11
2
|
// src/features/contracts-registry.ts
|
|
12
3
|
import {
|
|
13
4
|
EventRegistry,
|
|
@@ -18,11 +9,11 @@ import {
|
|
|
18
9
|
} from "@contractspec/lib.contracts-spec/data-views";
|
|
19
10
|
import {
|
|
20
11
|
ContractReferenceDataView,
|
|
21
|
-
ContractReferenceQuery
|
|
12
|
+
ContractReferenceQuery,
|
|
22
13
|
DocsGenerateCommand,
|
|
23
14
|
DocsGeneratedEvent,
|
|
24
15
|
DocsIndexDataView,
|
|
25
|
-
DocsIndexQuery
|
|
16
|
+
DocsIndexQuery,
|
|
26
17
|
DocsLayoutPresentation,
|
|
27
18
|
DocsPublishCommand,
|
|
28
19
|
DocsPublishedEvent,
|
|
@@ -44,7 +35,7 @@ import {
|
|
|
44
35
|
var operationRegistry = null;
|
|
45
36
|
function createContractSpecOperationRegistry() {
|
|
46
37
|
const registry = new OperationSpecRegistry;
|
|
47
|
-
registry.register(
|
|
38
|
+
registry.register(DocsIndexQuery).register(ContractReferenceQuery).register(DocsGenerateCommand).register(DocsPublishCommand);
|
|
48
39
|
return registry;
|
|
49
40
|
}
|
|
50
41
|
function getContractSpecOperationRegistry() {
|
|
@@ -190,6 +181,15 @@ var DocsFeature = {
|
|
|
190
181
|
}
|
|
191
182
|
};
|
|
192
183
|
|
|
184
|
+
// src/features/docs/docs.contracts.ts
|
|
185
|
+
import {
|
|
186
|
+
ContractReferenceQuery as ContractReferenceQuery2,
|
|
187
|
+
DocSummaryModel,
|
|
188
|
+
DocsIndexInput,
|
|
189
|
+
DocsIndexOutput,
|
|
190
|
+
DocsIndexQuery as DocsIndexQuery2,
|
|
191
|
+
DocsIndexQuery as DocsIndexQuery3
|
|
192
|
+
} from "@contractspec/lib.contracts-spec/docs";
|
|
193
193
|
// src/features/mcp.feature.ts
|
|
194
194
|
var MCPFeature = {
|
|
195
195
|
meta: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.library",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -84,12 +84,54 @@
|
|
|
84
84
|
"node": "./dist/node/application/mcp/docsMcp.js",
|
|
85
85
|
"default": "./dist/application/mcp/docsMcp.js"
|
|
86
86
|
},
|
|
87
|
+
"./application/mcp/docsMcp.catalog": {
|
|
88
|
+
"types": "./dist/application/mcp/docsMcp.catalog.d.ts",
|
|
89
|
+
"bun": "./dist/application/mcp/docsMcp.catalog.js",
|
|
90
|
+
"node": "./dist/node/application/mcp/docsMcp.catalog.js",
|
|
91
|
+
"default": "./dist/application/mcp/docsMcp.catalog.js"
|
|
92
|
+
},
|
|
93
|
+
"./application/mcp/docsMcp.data": {
|
|
94
|
+
"types": "./dist/application/mcp/docsMcp.data.d.ts",
|
|
95
|
+
"bun": "./dist/application/mcp/docsMcp.data.js",
|
|
96
|
+
"node": "./dist/node/application/mcp/docsMcp.data.js",
|
|
97
|
+
"default": "./dist/application/mcp/docsMcp.data.js"
|
|
98
|
+
},
|
|
99
|
+
"./application/mcp/docsMcp.prompts": {
|
|
100
|
+
"types": "./dist/application/mcp/docsMcp.prompts.d.ts",
|
|
101
|
+
"bun": "./dist/application/mcp/docsMcp.prompts.js",
|
|
102
|
+
"node": "./dist/node/application/mcp/docsMcp.prompts.js",
|
|
103
|
+
"default": "./dist/application/mcp/docsMcp.prompts.js"
|
|
104
|
+
},
|
|
105
|
+
"./application/mcp/docsMcp.reference": {
|
|
106
|
+
"types": "./dist/application/mcp/docsMcp.reference.d.ts",
|
|
107
|
+
"bun": "./dist/application/mcp/docsMcp.reference.js",
|
|
108
|
+
"node": "./dist/node/application/mcp/docsMcp.reference.js",
|
|
109
|
+
"default": "./dist/application/mcp/docsMcp.reference.js"
|
|
110
|
+
},
|
|
111
|
+
"./application/mcp/docsMcp.resources": {
|
|
112
|
+
"types": "./dist/application/mcp/docsMcp.resources.d.ts",
|
|
113
|
+
"bun": "./dist/application/mcp/docsMcp.resources.js",
|
|
114
|
+
"node": "./dist/node/application/mcp/docsMcp.resources.js",
|
|
115
|
+
"default": "./dist/application/mcp/docsMcp.resources.js"
|
|
116
|
+
},
|
|
117
|
+
"./application/mcp/docsMcp.tools": {
|
|
118
|
+
"types": "./dist/application/mcp/docsMcp.tools.d.ts",
|
|
119
|
+
"bun": "./dist/application/mcp/docsMcp.tools.js",
|
|
120
|
+
"node": "./dist/node/application/mcp/docsMcp.tools.js",
|
|
121
|
+
"default": "./dist/application/mcp/docsMcp.tools.js"
|
|
122
|
+
},
|
|
87
123
|
"./application/mcp/internalMcp": {
|
|
88
124
|
"types": "./dist/application/mcp/internalMcp.d.ts",
|
|
89
125
|
"bun": "./dist/application/mcp/internalMcp.js",
|
|
90
126
|
"node": "./dist/node/application/mcp/internalMcp.js",
|
|
91
127
|
"default": "./dist/application/mcp/internalMcp.js"
|
|
92
128
|
},
|
|
129
|
+
"./application/mcp/normalizeMcpRequest": {
|
|
130
|
+
"types": "./dist/application/mcp/normalizeMcpRequest.d.ts",
|
|
131
|
+
"bun": "./dist/application/mcp/normalizeMcpRequest.js",
|
|
132
|
+
"node": "./dist/node/application/mcp/normalizeMcpRequest.js",
|
|
133
|
+
"default": "./dist/application/mcp/normalizeMcpRequest.js"
|
|
134
|
+
},
|
|
93
135
|
"./application/mcp/providerRankingMcp": {
|
|
94
136
|
"types": "./dist/application/mcp/providerRankingMcp.d.ts",
|
|
95
137
|
"bun": "./dist/application/mcp/providerRankingMcp.js",
|
|
@@ -1826,23 +1868,23 @@
|
|
|
1826
1868
|
"dependencies": {
|
|
1827
1869
|
"@apollo/client": "^4.1.6",
|
|
1828
1870
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
1829
|
-
"@contractspec/lib.ai-providers": "3.7.
|
|
1830
|
-
"@contractspec/lib.contracts-spec": "5.0.
|
|
1831
|
-
"@contractspec/lib.contracts-library": "3.7.
|
|
1832
|
-
"@contractspec/lib.content-gen": "3.7.
|
|
1833
|
-
"@contractspec/lib.contracts-runtime-server-mcp": "3.7.
|
|
1834
|
-
"@contractspec/lib.design-system": "3.8.
|
|
1835
|
-
"@contractspec/lib.surface-runtime": "0.5.
|
|
1836
|
-
"@contractspec/lib.provider-ranking": "0.7.
|
|
1837
|
-
"@contractspec/lib.example-shared-ui": "6.0.
|
|
1838
|
-
"@contractspec/lib.knowledge": "3.7.
|
|
1839
|
-
"@contractspec/lib.logger": "3.7.
|
|
1840
|
-
"@contractspec/lib.runtime-sandbox": "2.7.
|
|
1841
|
-
"@contractspec/lib.schema": "3.7.
|
|
1842
|
-
"@contractspec/lib.ui-kit-web": "3.9.
|
|
1843
|
-
"@contractspec/lib.ui-link": "3.7.
|
|
1844
|
-
"@contractspec/module.context-storage": "0.7.
|
|
1845
|
-
"@contractspec/module.examples": "3.8.
|
|
1871
|
+
"@contractspec/lib.ai-providers": "3.7.10",
|
|
1872
|
+
"@contractspec/lib.contracts-spec": "5.0.2",
|
|
1873
|
+
"@contractspec/lib.contracts-library": "3.7.14",
|
|
1874
|
+
"@contractspec/lib.content-gen": "3.7.14",
|
|
1875
|
+
"@contractspec/lib.contracts-runtime-server-mcp": "3.7.14",
|
|
1876
|
+
"@contractspec/lib.design-system": "3.8.7",
|
|
1877
|
+
"@contractspec/lib.surface-runtime": "0.5.14",
|
|
1878
|
+
"@contractspec/lib.provider-ranking": "0.7.10",
|
|
1879
|
+
"@contractspec/lib.example-shared-ui": "6.0.14",
|
|
1880
|
+
"@contractspec/lib.knowledge": "3.7.14",
|
|
1881
|
+
"@contractspec/lib.logger": "3.7.10",
|
|
1882
|
+
"@contractspec/lib.runtime-sandbox": "2.7.11",
|
|
1883
|
+
"@contractspec/lib.schema": "3.7.11",
|
|
1884
|
+
"@contractspec/lib.ui-kit-web": "3.9.6",
|
|
1885
|
+
"@contractspec/lib.ui-link": "3.7.10",
|
|
1886
|
+
"@contractspec/module.context-storage": "0.7.13",
|
|
1887
|
+
"@contractspec/module.examples": "3.8.6",
|
|
1846
1888
|
"@dnd-kit/core": "^6.1.0",
|
|
1847
1889
|
"@dnd-kit/sortable": "^10.0.0",
|
|
1848
1890
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -1858,17 +1900,17 @@
|
|
|
1858
1900
|
"posthog-react-native": "^4.37.4",
|
|
1859
1901
|
"react-hook-form": "^7.71.2",
|
|
1860
1902
|
"zod": "^4.3.5",
|
|
1861
|
-
"@contractspec/lib.contracts-integrations": "3.8.
|
|
1862
|
-
"@contractspec/lib.contracts-runtime-server-rest": "3.7.
|
|
1863
|
-
"@contractspec/lib.contracts-runtime-server-graphql": "3.7.
|
|
1864
|
-
"@contractspec/lib.contracts-runtime-client-react": "3.8.
|
|
1903
|
+
"@contractspec/lib.contracts-integrations": "3.8.6",
|
|
1904
|
+
"@contractspec/lib.contracts-runtime-server-rest": "3.7.14",
|
|
1905
|
+
"@contractspec/lib.contracts-runtime-server-graphql": "3.7.14",
|
|
1906
|
+
"@contractspec/lib.contracts-runtime-client-react": "3.8.2"
|
|
1865
1907
|
},
|
|
1866
1908
|
"devDependencies": {
|
|
1867
1909
|
"@types/react": "~19.2.14",
|
|
1868
|
-
"@contractspec/tool.typescript": "3.7.
|
|
1910
|
+
"@contractspec/tool.typescript": "3.7.10",
|
|
1869
1911
|
"typescript": "^5.9.3",
|
|
1870
1912
|
"@types/bun": "~1.3.11",
|
|
1871
|
-
"@contractspec/tool.bun": "3.7.
|
|
1913
|
+
"@contractspec/tool.bun": "3.7.10"
|
|
1872
1914
|
},
|
|
1873
1915
|
"repository": {
|
|
1874
1916
|
"type": "git",
|
|
@@ -1945,12 +1987,54 @@
|
|
|
1945
1987
|
"node": "./dist/node/application/mcp/docsMcp.js",
|
|
1946
1988
|
"default": "./dist/application/mcp/docsMcp.js"
|
|
1947
1989
|
},
|
|
1990
|
+
"./application/mcp/docsMcp.catalog": {
|
|
1991
|
+
"types": "./dist/application/mcp/docsMcp.catalog.d.ts",
|
|
1992
|
+
"bun": "./dist/application/mcp/docsMcp.catalog.js",
|
|
1993
|
+
"node": "./dist/node/application/mcp/docsMcp.catalog.js",
|
|
1994
|
+
"default": "./dist/application/mcp/docsMcp.catalog.js"
|
|
1995
|
+
},
|
|
1996
|
+
"./application/mcp/docsMcp.data": {
|
|
1997
|
+
"types": "./dist/application/mcp/docsMcp.data.d.ts",
|
|
1998
|
+
"bun": "./dist/application/mcp/docsMcp.data.js",
|
|
1999
|
+
"node": "./dist/node/application/mcp/docsMcp.data.js",
|
|
2000
|
+
"default": "./dist/application/mcp/docsMcp.data.js"
|
|
2001
|
+
},
|
|
2002
|
+
"./application/mcp/docsMcp.prompts": {
|
|
2003
|
+
"types": "./dist/application/mcp/docsMcp.prompts.d.ts",
|
|
2004
|
+
"bun": "./dist/application/mcp/docsMcp.prompts.js",
|
|
2005
|
+
"node": "./dist/node/application/mcp/docsMcp.prompts.js",
|
|
2006
|
+
"default": "./dist/application/mcp/docsMcp.prompts.js"
|
|
2007
|
+
},
|
|
2008
|
+
"./application/mcp/docsMcp.reference": {
|
|
2009
|
+
"types": "./dist/application/mcp/docsMcp.reference.d.ts",
|
|
2010
|
+
"bun": "./dist/application/mcp/docsMcp.reference.js",
|
|
2011
|
+
"node": "./dist/node/application/mcp/docsMcp.reference.js",
|
|
2012
|
+
"default": "./dist/application/mcp/docsMcp.reference.js"
|
|
2013
|
+
},
|
|
2014
|
+
"./application/mcp/docsMcp.resources": {
|
|
2015
|
+
"types": "./dist/application/mcp/docsMcp.resources.d.ts",
|
|
2016
|
+
"bun": "./dist/application/mcp/docsMcp.resources.js",
|
|
2017
|
+
"node": "./dist/node/application/mcp/docsMcp.resources.js",
|
|
2018
|
+
"default": "./dist/application/mcp/docsMcp.resources.js"
|
|
2019
|
+
},
|
|
2020
|
+
"./application/mcp/docsMcp.tools": {
|
|
2021
|
+
"types": "./dist/application/mcp/docsMcp.tools.d.ts",
|
|
2022
|
+
"bun": "./dist/application/mcp/docsMcp.tools.js",
|
|
2023
|
+
"node": "./dist/node/application/mcp/docsMcp.tools.js",
|
|
2024
|
+
"default": "./dist/application/mcp/docsMcp.tools.js"
|
|
2025
|
+
},
|
|
1948
2026
|
"./application/mcp/internalMcp": {
|
|
1949
2027
|
"types": "./dist/application/mcp/internalMcp.d.ts",
|
|
1950
2028
|
"bun": "./dist/application/mcp/internalMcp.js",
|
|
1951
2029
|
"node": "./dist/node/application/mcp/internalMcp.js",
|
|
1952
2030
|
"default": "./dist/application/mcp/internalMcp.js"
|
|
1953
2031
|
},
|
|
2032
|
+
"./application/mcp/normalizeMcpRequest": {
|
|
2033
|
+
"types": "./dist/application/mcp/normalizeMcpRequest.d.ts",
|
|
2034
|
+
"bun": "./dist/application/mcp/normalizeMcpRequest.js",
|
|
2035
|
+
"node": "./dist/node/application/mcp/normalizeMcpRequest.js",
|
|
2036
|
+
"default": "./dist/application/mcp/normalizeMcpRequest.js"
|
|
2037
|
+
},
|
|
1954
2038
|
"./application/mcp/providerRankingMcp": {
|
|
1955
2039
|
"types": "./dist/application/mcp/providerRankingMcp.d.ts",
|
|
1956
2040
|
"bun": "./dist/application/mcp/providerRankingMcp.js",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import {
|
|
3
|
+
OperationSpecRegistry,
|
|
4
|
+
PromptRegistry,
|
|
5
|
+
ResourceRegistry,
|
|
6
|
+
} from '@contractspec/lib.contracts-spec';
|
|
7
|
+
import { Elysia } from 'elysia';
|
|
8
|
+
import { appLogger } from '../../infrastructure/elysia/logger';
|
|
9
|
+
import { createMcpElysiaHandler } from './common';
|
|
10
|
+
|
|
11
|
+
function createTestApp() {
|
|
12
|
+
return new Elysia().use(
|
|
13
|
+
createMcpElysiaHandler({
|
|
14
|
+
logger: appLogger,
|
|
15
|
+
path: '/mcp/test',
|
|
16
|
+
serverName: 'test-mcp',
|
|
17
|
+
ops: new OperationSpecRegistry(),
|
|
18
|
+
resources: new ResourceRegistry(),
|
|
19
|
+
prompts: new PromptRegistry(),
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function createInitializeRequest(accept: string) {
|
|
25
|
+
return new Request('http://localhost/mcp/test', {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
headers: {
|
|
28
|
+
accept,
|
|
29
|
+
'content-type': 'application/json',
|
|
30
|
+
},
|
|
31
|
+
body: JSON.stringify({
|
|
32
|
+
jsonrpc: '2.0',
|
|
33
|
+
id: 1,
|
|
34
|
+
method: 'initialize',
|
|
35
|
+
params: {
|
|
36
|
+
protocolVersion: '2024-11-05',
|
|
37
|
+
capabilities: {},
|
|
38
|
+
clientInfo: { name: 'test-client', version: '1.0.0' },
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
describe('createMcpElysiaHandler', () => {
|
|
45
|
+
it('accepts JSON-only clients for POST MCP requests', async () => {
|
|
46
|
+
const response = await createTestApp().handle(
|
|
47
|
+
createInitializeRequest('application/json')
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
expect(response.status).toBe(200);
|
|
51
|
+
const body = await response.json();
|
|
52
|
+
expect(body.result.serverInfo.name).toBe('test-mcp');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('keeps rejecting incompatible Accept headers', async () => {
|
|
56
|
+
const response = await createTestApp().handle(
|
|
57
|
+
createInitializeRequest('text/html')
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
expect(response.status).toBe(406);
|
|
61
|
+
const body = await response.json();
|
|
62
|
+
expect(body.error.message).toContain('Not Acceptable');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -12,6 +12,7 @@ import { Logger } from '@contractspec/lib.logger';
|
|
|
12
12
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
13
|
import { WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';
|
|
14
14
|
import { Elysia } from 'elysia';
|
|
15
|
+
import { normalizeMcpRequest } from './normalizeMcpRequest';
|
|
15
16
|
|
|
16
17
|
export interface McpAuthValidationResult {
|
|
17
18
|
valid: boolean;
|
|
@@ -150,7 +151,7 @@ export function createMcpElysiaHandler({
|
|
|
150
151
|
});
|
|
151
152
|
|
|
152
153
|
try {
|
|
153
|
-
return await state.transport.handleRequest(request);
|
|
154
|
+
return await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
154
155
|
} finally {
|
|
155
156
|
await closeSessionState(state);
|
|
156
157
|
}
|
|
@@ -189,7 +190,9 @@ export function createMcpElysiaHandler({
|
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
try {
|
|
192
|
-
const response = await state.transport.handleRequest(
|
|
193
|
+
const response = await state.transport.handleRequest(
|
|
194
|
+
normalizeMcpRequest(request)
|
|
195
|
+
);
|
|
193
196
|
const activeSessionId = state.transport.sessionId;
|
|
194
197
|
|
|
195
198
|
if (activeSessionId && !sessions.has(activeSessionId)) {
|