@contractspec/bundle.library 3.8.4 → 3.8.5
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 +6 -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 +85 -1
- 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
|
@@ -26,6 +26,25 @@ var authLogger = new Logger({
|
|
|
26
26
|
enableContext: true,
|
|
27
27
|
enableColors: false
|
|
28
28
|
});
|
|
29
|
+
// src/application/mcp/normalizeMcpRequest.ts
|
|
30
|
+
var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
|
|
31
|
+
function canNormalizeAcceptHeader(acceptHeader) {
|
|
32
|
+
return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
|
|
33
|
+
}
|
|
34
|
+
function normalizeMcpRequest(request) {
|
|
35
|
+
if (request.method !== "POST")
|
|
36
|
+
return request;
|
|
37
|
+
const acceptHeader = request.headers.get("accept");
|
|
38
|
+
if (!canNormalizeAcceptHeader(acceptHeader))
|
|
39
|
+
return request;
|
|
40
|
+
const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
|
|
41
|
+
if (missingTypes.length === 0)
|
|
42
|
+
return request;
|
|
43
|
+
const headers = new Headers(request.headers);
|
|
44
|
+
headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
|
|
45
|
+
return new Request(request, { headers });
|
|
46
|
+
}
|
|
47
|
+
|
|
29
48
|
// src/application/mcp/common.ts
|
|
30
49
|
import { randomUUID } from "crypto";
|
|
31
50
|
import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
|
|
@@ -121,7 +140,7 @@ function createMcpElysiaHandler({
|
|
|
121
140
|
stateful: false
|
|
122
141
|
});
|
|
123
142
|
try {
|
|
124
|
-
return await state.transport.handleRequest(request);
|
|
143
|
+
return await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
125
144
|
} finally {
|
|
126
145
|
await closeSessionState(state);
|
|
127
146
|
}
|
|
@@ -157,7 +176,7 @@ function createMcpElysiaHandler({
|
|
|
157
176
|
createdState = true;
|
|
158
177
|
}
|
|
159
178
|
try {
|
|
160
|
-
const response = await state.transport.handleRequest(request);
|
|
179
|
+
const response = await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
161
180
|
const activeSessionId = state.transport.sessionId;
|
|
162
181
|
if (activeSessionId && !sessions.has(activeSessionId)) {
|
|
163
182
|
sessions.set(activeSessionId, state);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeMcpRequest(request: Request): Request;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/application/mcp/normalizeMcpRequest.ts
|
|
3
|
+
var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
|
|
4
|
+
function canNormalizeAcceptHeader(acceptHeader) {
|
|
5
|
+
return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
|
|
6
|
+
}
|
|
7
|
+
function normalizeMcpRequest(request) {
|
|
8
|
+
if (request.method !== "POST")
|
|
9
|
+
return request;
|
|
10
|
+
const acceptHeader = request.headers.get("accept");
|
|
11
|
+
if (!canNormalizeAcceptHeader(acceptHeader))
|
|
12
|
+
return request;
|
|
13
|
+
const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
|
|
14
|
+
if (missingTypes.length === 0)
|
|
15
|
+
return request;
|
|
16
|
+
const headers = new Headers(request.headers);
|
|
17
|
+
headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
|
|
18
|
+
return new Request(request, { headers });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
normalizeMcpRequest
|
|
22
|
+
};
|
|
@@ -26,6 +26,25 @@ var authLogger = new Logger({
|
|
|
26
26
|
enableContext: true,
|
|
27
27
|
enableColors: false
|
|
28
28
|
});
|
|
29
|
+
// src/application/mcp/normalizeMcpRequest.ts
|
|
30
|
+
var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
|
|
31
|
+
function canNormalizeAcceptHeader(acceptHeader) {
|
|
32
|
+
return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
|
|
33
|
+
}
|
|
34
|
+
function normalizeMcpRequest(request) {
|
|
35
|
+
if (request.method !== "POST")
|
|
36
|
+
return request;
|
|
37
|
+
const acceptHeader = request.headers.get("accept");
|
|
38
|
+
if (!canNormalizeAcceptHeader(acceptHeader))
|
|
39
|
+
return request;
|
|
40
|
+
const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
|
|
41
|
+
if (missingTypes.length === 0)
|
|
42
|
+
return request;
|
|
43
|
+
const headers = new Headers(request.headers);
|
|
44
|
+
headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
|
|
45
|
+
return new Request(request, { headers });
|
|
46
|
+
}
|
|
47
|
+
|
|
29
48
|
// src/application/mcp/common.ts
|
|
30
49
|
import { randomUUID } from "crypto";
|
|
31
50
|
import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
|
|
@@ -121,7 +140,7 @@ function createMcpElysiaHandler({
|
|
|
121
140
|
stateful: false
|
|
122
141
|
});
|
|
123
142
|
try {
|
|
124
|
-
return await state.transport.handleRequest(request);
|
|
143
|
+
return await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
125
144
|
} finally {
|
|
126
145
|
await closeSessionState(state);
|
|
127
146
|
}
|
|
@@ -157,7 +176,7 @@ function createMcpElysiaHandler({
|
|
|
157
176
|
createdState = true;
|
|
158
177
|
}
|
|
159
178
|
try {
|
|
160
|
-
const response = await state.transport.handleRequest(request);
|
|
179
|
+
const response = await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
161
180
|
const activeSessionId = state.transport.sessionId;
|
|
162
181
|
if (activeSessionId && !sessions.has(activeSessionId)) {
|
|
163
182
|
sessions.set(activeSessionId, state);
|
package/dist/features/index.js
CHANGED
|
@@ -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: {
|
|
@@ -297,7 +297,7 @@ export {
|
|
|
297
297
|
getContractSpecFeatureRegistry,
|
|
298
298
|
getContractSpecEventRegistry,
|
|
299
299
|
getContractSpecDataViewRegistry,
|
|
300
|
-
|
|
300
|
+
DocsIndexQuery2 as docsSearchSpec,
|
|
301
301
|
createContractSpecPresentationRegistry,
|
|
302
302
|
createContractSpecOperationRegistry,
|
|
303
303
|
createContractSpecFormRegistry,
|
|
@@ -307,10 +307,10 @@ export {
|
|
|
307
307
|
PresentationsFeature,
|
|
308
308
|
MCPFeature,
|
|
309
309
|
FeatureRegistry2 as FeatureRegistry,
|
|
310
|
-
|
|
310
|
+
DocsIndexQuery3 as DocsIndexQuery,
|
|
311
311
|
DocsFeature,
|
|
312
312
|
DocSummaryModel,
|
|
313
313
|
DocsIndexOutput as DocSearchOutput,
|
|
314
314
|
DocsIndexInput as DocSearchInput,
|
|
315
|
-
ContractReferenceQuery
|
|
315
|
+
ContractReferenceQuery2 as ContractReferenceQuery
|
|
316
316
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,155 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/features/
|
|
2
|
+
// src/features/contracts-registry.ts
|
|
3
|
+
import {
|
|
4
|
+
EventRegistry,
|
|
5
|
+
OperationSpecRegistry
|
|
6
|
+
} from "@contractspec/lib.contracts-spec";
|
|
3
7
|
import {
|
|
8
|
+
DataViewRegistry
|
|
9
|
+
} from "@contractspec/lib.contracts-spec/data-views";
|
|
10
|
+
import {
|
|
11
|
+
ContractReferenceDataView,
|
|
4
12
|
ContractReferenceQuery,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
DocsGenerateCommand,
|
|
14
|
+
DocsGeneratedEvent,
|
|
15
|
+
DocsIndexDataView,
|
|
8
16
|
DocsIndexQuery,
|
|
9
|
-
|
|
17
|
+
DocsLayoutPresentation,
|
|
18
|
+
DocsPublishCommand,
|
|
19
|
+
DocsPublishedEvent,
|
|
20
|
+
DocsReferencePagePresentation,
|
|
21
|
+
DocsSearchForm,
|
|
22
|
+
ExampleCatalogDataView
|
|
10
23
|
} from "@contractspec/lib.contracts-spec/docs";
|
|
24
|
+
import { FormRegistry } from "@contractspec/lib.contracts-spec/forms";
|
|
25
|
+
import {
|
|
26
|
+
PresentationRegistry
|
|
27
|
+
} from "@contractspec/lib.contracts-spec/presentations";
|
|
28
|
+
import {
|
|
29
|
+
serializeDataViewSpec,
|
|
30
|
+
serializeEventSpec,
|
|
31
|
+
serializeFormSpec,
|
|
32
|
+
serializeOperationSpec,
|
|
33
|
+
serializePresentationSpec
|
|
34
|
+
} from "@contractspec/lib.contracts-spec/serialization";
|
|
35
|
+
var operationRegistry = null;
|
|
36
|
+
function createContractSpecOperationRegistry() {
|
|
37
|
+
const registry = new OperationSpecRegistry;
|
|
38
|
+
registry.register(DocsIndexQuery).register(ContractReferenceQuery).register(DocsGenerateCommand).register(DocsPublishCommand);
|
|
39
|
+
return registry;
|
|
40
|
+
}
|
|
41
|
+
function getContractSpecOperationRegistry() {
|
|
42
|
+
if (!operationRegistry) {
|
|
43
|
+
operationRegistry = createContractSpecOperationRegistry();
|
|
44
|
+
}
|
|
45
|
+
return operationRegistry;
|
|
46
|
+
}
|
|
47
|
+
function resolveOperationSpec(key, version) {
|
|
48
|
+
return getContractSpecOperationRegistry().get(key, version);
|
|
49
|
+
}
|
|
50
|
+
var eventRegistry = null;
|
|
51
|
+
function createContractSpecEventRegistry() {
|
|
52
|
+
const registry = new EventRegistry;
|
|
53
|
+
registry.register(DocsGeneratedEvent).register(DocsPublishedEvent);
|
|
54
|
+
return registry;
|
|
55
|
+
}
|
|
56
|
+
function getContractSpecEventRegistry() {
|
|
57
|
+
if (!eventRegistry) {
|
|
58
|
+
eventRegistry = createContractSpecEventRegistry();
|
|
59
|
+
}
|
|
60
|
+
return eventRegistry;
|
|
61
|
+
}
|
|
62
|
+
function resolveEventSpec(key, version) {
|
|
63
|
+
return getContractSpecEventRegistry().get(key, version);
|
|
64
|
+
}
|
|
65
|
+
var presentationRegistry = null;
|
|
66
|
+
function createContractSpecPresentationRegistry() {
|
|
67
|
+
const registry = new PresentationRegistry;
|
|
68
|
+
registry.register(DocsLayoutPresentation).register(DocsReferencePagePresentation);
|
|
69
|
+
return registry;
|
|
70
|
+
}
|
|
71
|
+
function getContractSpecPresentationRegistry() {
|
|
72
|
+
if (!presentationRegistry) {
|
|
73
|
+
presentationRegistry = createContractSpecPresentationRegistry();
|
|
74
|
+
}
|
|
75
|
+
return presentationRegistry;
|
|
76
|
+
}
|
|
77
|
+
function resolvePresentationSpec(key, version) {
|
|
78
|
+
return getContractSpecPresentationRegistry().get(key, version);
|
|
79
|
+
}
|
|
80
|
+
var dataViewRegistry = null;
|
|
81
|
+
function createContractSpecDataViewRegistry() {
|
|
82
|
+
const registry = new DataViewRegistry;
|
|
83
|
+
registry.register(DocsIndexDataView).register(ContractReferenceDataView).register(ExampleCatalogDataView);
|
|
84
|
+
return registry;
|
|
85
|
+
}
|
|
86
|
+
function getContractSpecDataViewRegistry() {
|
|
87
|
+
if (!dataViewRegistry) {
|
|
88
|
+
dataViewRegistry = createContractSpecDataViewRegistry();
|
|
89
|
+
}
|
|
90
|
+
return dataViewRegistry;
|
|
91
|
+
}
|
|
92
|
+
function resolveDataViewSpec(key, version) {
|
|
93
|
+
return getContractSpecDataViewRegistry().get(key, version);
|
|
94
|
+
}
|
|
95
|
+
var formRegistry = null;
|
|
96
|
+
function createContractSpecFormRegistry() {
|
|
97
|
+
const registry = new FormRegistry;
|
|
98
|
+
registry.register(DocsSearchForm);
|
|
99
|
+
return registry;
|
|
100
|
+
}
|
|
101
|
+
function getContractSpecFormRegistry() {
|
|
102
|
+
if (!formRegistry) {
|
|
103
|
+
formRegistry = createContractSpecFormRegistry();
|
|
104
|
+
}
|
|
105
|
+
return formRegistry;
|
|
106
|
+
}
|
|
107
|
+
function resolveFormSpec(key, _version) {
|
|
108
|
+
return getContractSpecFormRegistry().get(key);
|
|
109
|
+
}
|
|
110
|
+
function resolveSerializedOperationSpec(key, version) {
|
|
111
|
+
const spec = resolveOperationSpec(key, version);
|
|
112
|
+
return serializeOperationSpec(spec) ?? undefined;
|
|
113
|
+
}
|
|
114
|
+
function resolveSerializedEventSpec(key, version) {
|
|
115
|
+
const spec = resolveEventSpec(key, version);
|
|
116
|
+
return serializeEventSpec(spec) ?? undefined;
|
|
117
|
+
}
|
|
118
|
+
function resolveSerializedPresentationSpec(key, version) {
|
|
119
|
+
const spec = resolvePresentationSpec(key, version);
|
|
120
|
+
return serializePresentationSpec(spec) ?? undefined;
|
|
121
|
+
}
|
|
122
|
+
function resolveSerializedDataViewSpec(key, version) {
|
|
123
|
+
const spec = resolveDataViewSpec(key, version);
|
|
124
|
+
return serializeDataViewSpec(spec) ?? undefined;
|
|
125
|
+
}
|
|
126
|
+
function resolveSerializedFormSpec(key, version) {
|
|
127
|
+
const spec = resolveFormSpec(key, version);
|
|
128
|
+
return serializeFormSpec(spec) ?? undefined;
|
|
129
|
+
}
|
|
130
|
+
function resetContractSpecOperationRegistry() {
|
|
131
|
+
operationRegistry = null;
|
|
132
|
+
}
|
|
133
|
+
function resetContractSpecEventRegistry() {
|
|
134
|
+
eventRegistry = null;
|
|
135
|
+
}
|
|
136
|
+
function resetContractSpecPresentationRegistry() {
|
|
137
|
+
presentationRegistry = null;
|
|
138
|
+
}
|
|
139
|
+
function resetContractSpecDataViewRegistry() {
|
|
140
|
+
dataViewRegistry = null;
|
|
141
|
+
}
|
|
142
|
+
function resetContractSpecFormRegistry() {
|
|
143
|
+
formRegistry = null;
|
|
144
|
+
}
|
|
145
|
+
function resetAllContractSpecRegistries() {
|
|
146
|
+
resetContractSpecOperationRegistry();
|
|
147
|
+
resetContractSpecEventRegistry();
|
|
148
|
+
resetContractSpecPresentationRegistry();
|
|
149
|
+
resetContractSpecDataViewRegistry();
|
|
150
|
+
resetContractSpecFormRegistry();
|
|
151
|
+
}
|
|
152
|
+
|
|
11
153
|
// src/components/docs/docsManifest.ts
|
|
12
154
|
var DOCS_PRIMARY_SECTIONS = [
|
|
13
155
|
{
|
|
@@ -6103,7 +6245,7 @@ function getExampleShowcaseData(key) {
|
|
|
6103
6245
|
}
|
|
6104
6246
|
|
|
6105
6247
|
// src/components/docs/examples/DocsExamplesPage.tsx
|
|
6106
|
-
import { ExampleCatalogDataView } from "@contractspec/lib.contracts-spec/docs";
|
|
6248
|
+
import { ExampleCatalogDataView as ExampleCatalogDataView2 } from "@contractspec/lib.contracts-spec/docs";
|
|
6107
6249
|
import {
|
|
6108
6250
|
ButtonLink,
|
|
6109
6251
|
DataViewList,
|
|
@@ -6133,9 +6275,9 @@ function DocsExamplesPage() {
|
|
|
6133
6275
|
};
|
|
6134
6276
|
}).sort((a, b) => a.title.localeCompare(b.title));
|
|
6135
6277
|
const listSpec = {
|
|
6136
|
-
...
|
|
6278
|
+
...ExampleCatalogDataView2,
|
|
6137
6279
|
view: {
|
|
6138
|
-
...
|
|
6280
|
+
...ExampleCatalogDataView2.view,
|
|
6139
6281
|
kind: "list"
|
|
6140
6282
|
}
|
|
6141
6283
|
};
|
|
@@ -24020,8 +24162,8 @@ OTEL_TRACES_SAMPLER_ARG=0.1`
|
|
|
24020
24162
|
}
|
|
24021
24163
|
// src/components/docs/reference/DocsReferenceIndexClient.tsx
|
|
24022
24164
|
import {
|
|
24023
|
-
DocsIndexDataView,
|
|
24024
|
-
DocsSearchForm
|
|
24165
|
+
DocsIndexDataView as DocsIndexDataView2,
|
|
24166
|
+
DocsSearchForm as DocsSearchForm2
|
|
24025
24167
|
} from "@contractspec/lib.contracts-spec/docs";
|
|
24026
24168
|
import {
|
|
24027
24169
|
DataViewList as DataViewList2,
|
|
@@ -24072,7 +24214,7 @@ function DocsReferenceIndexClient({
|
|
|
24072
24214
|
return matchesQuery(entry, query);
|
|
24073
24215
|
});
|
|
24074
24216
|
}, [filters, normalizedEntries]);
|
|
24075
|
-
const searchForm = formRenderer.render(
|
|
24217
|
+
const searchForm = formRenderer.render(DocsSearchForm2, {
|
|
24076
24218
|
defaultValues: {
|
|
24077
24219
|
query: filters.query ?? "",
|
|
24078
24220
|
visibility: filters.visibility ?? "",
|
|
@@ -24109,7 +24251,7 @@ function DocsReferenceIndexClient({
|
|
|
24109
24251
|
children: searchForm
|
|
24110
24252
|
}),
|
|
24111
24253
|
/* @__PURE__ */ jsx105(DataViewList2, {
|
|
24112
|
-
spec:
|
|
24254
|
+
spec: DocsIndexDataView2,
|
|
24113
24255
|
items: filteredEntries,
|
|
24114
24256
|
emptyState: /* @__PURE__ */ jsx105(Muted2, {
|
|
24115
24257
|
children: "No reference docs match your filters."
|
|
@@ -24348,7 +24490,7 @@ function DocsMarkdownContent({ content }) {
|
|
|
24348
24490
|
}
|
|
24349
24491
|
|
|
24350
24492
|
// src/components/docs/reference/DocsReferenceContent.tsx
|
|
24351
|
-
import { ContractReferenceDataView } from "@contractspec/lib.contracts-spec/docs";
|
|
24493
|
+
import { ContractReferenceDataView as ContractReferenceDataView2 } from "@contractspec/lib.contracts-spec/docs";
|
|
24352
24494
|
import { DataViewRenderer } from "@contractspec/lib.design-system";
|
|
24353
24495
|
import { VStack as VStack4 } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
24354
24496
|
import { jsx as jsx108, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
@@ -24387,11 +24529,11 @@ function DocsReferenceContent({
|
|
|
24387
24529
|
}
|
|
24388
24530
|
};
|
|
24389
24531
|
const detailSpec = {
|
|
24390
|
-
...
|
|
24532
|
+
...ContractReferenceDataView2,
|
|
24391
24533
|
meta: {
|
|
24392
|
-
...
|
|
24393
|
-
title: entry.title ??
|
|
24394
|
-
description: summary ??
|
|
24534
|
+
...ContractReferenceDataView2.meta,
|
|
24535
|
+
title: entry.title ?? ContractReferenceDataView2.meta.title,
|
|
24536
|
+
description: summary ?? ContractReferenceDataView2.meta.description
|
|
24395
24537
|
}
|
|
24396
24538
|
};
|
|
24397
24539
|
return /* @__PURE__ */ jsxs107(VStack4, {
|
|
@@ -32193,157 +32335,6 @@ var contractspecBlueprint = {
|
|
|
32193
32335
|
routes: contractspecRoutes,
|
|
32194
32336
|
notes: "ContractSpec platform blueprint - defines the app's capabilities, features, and configuration."
|
|
32195
32337
|
};
|
|
32196
|
-
// src/features/contracts-registry.ts
|
|
32197
|
-
import {
|
|
32198
|
-
EventRegistry,
|
|
32199
|
-
OperationSpecRegistry
|
|
32200
|
-
} from "@contractspec/lib.contracts-spec";
|
|
32201
|
-
import {
|
|
32202
|
-
DataViewRegistry
|
|
32203
|
-
} from "@contractspec/lib.contracts-spec/data-views";
|
|
32204
|
-
import {
|
|
32205
|
-
ContractReferenceDataView as ContractReferenceDataView2,
|
|
32206
|
-
ContractReferenceQuery as ContractReferenceQuery2,
|
|
32207
|
-
DocsGenerateCommand,
|
|
32208
|
-
DocsGeneratedEvent,
|
|
32209
|
-
DocsIndexDataView as DocsIndexDataView2,
|
|
32210
|
-
DocsIndexQuery as DocsIndexQuery3,
|
|
32211
|
-
DocsLayoutPresentation,
|
|
32212
|
-
DocsPublishCommand,
|
|
32213
|
-
DocsPublishedEvent,
|
|
32214
|
-
DocsReferencePagePresentation,
|
|
32215
|
-
DocsSearchForm as DocsSearchForm2,
|
|
32216
|
-
ExampleCatalogDataView as ExampleCatalogDataView2
|
|
32217
|
-
} from "@contractspec/lib.contracts-spec/docs";
|
|
32218
|
-
import { FormRegistry } from "@contractspec/lib.contracts-spec/forms";
|
|
32219
|
-
import {
|
|
32220
|
-
PresentationRegistry
|
|
32221
|
-
} from "@contractspec/lib.contracts-spec/presentations";
|
|
32222
|
-
import {
|
|
32223
|
-
serializeDataViewSpec,
|
|
32224
|
-
serializeEventSpec,
|
|
32225
|
-
serializeFormSpec,
|
|
32226
|
-
serializeOperationSpec,
|
|
32227
|
-
serializePresentationSpec
|
|
32228
|
-
} from "@contractspec/lib.contracts-spec/serialization";
|
|
32229
|
-
var operationRegistry = null;
|
|
32230
|
-
function createContractSpecOperationRegistry() {
|
|
32231
|
-
const registry = new OperationSpecRegistry;
|
|
32232
|
-
registry.register(DocsIndexQuery3).register(ContractReferenceQuery2).register(DocsGenerateCommand).register(DocsPublishCommand);
|
|
32233
|
-
return registry;
|
|
32234
|
-
}
|
|
32235
|
-
function getContractSpecOperationRegistry() {
|
|
32236
|
-
if (!operationRegistry) {
|
|
32237
|
-
operationRegistry = createContractSpecOperationRegistry();
|
|
32238
|
-
}
|
|
32239
|
-
return operationRegistry;
|
|
32240
|
-
}
|
|
32241
|
-
function resolveOperationSpec(key, version) {
|
|
32242
|
-
return getContractSpecOperationRegistry().get(key, version);
|
|
32243
|
-
}
|
|
32244
|
-
var eventRegistry = null;
|
|
32245
|
-
function createContractSpecEventRegistry() {
|
|
32246
|
-
const registry = new EventRegistry;
|
|
32247
|
-
registry.register(DocsGeneratedEvent).register(DocsPublishedEvent);
|
|
32248
|
-
return registry;
|
|
32249
|
-
}
|
|
32250
|
-
function getContractSpecEventRegistry() {
|
|
32251
|
-
if (!eventRegistry) {
|
|
32252
|
-
eventRegistry = createContractSpecEventRegistry();
|
|
32253
|
-
}
|
|
32254
|
-
return eventRegistry;
|
|
32255
|
-
}
|
|
32256
|
-
function resolveEventSpec(key, version) {
|
|
32257
|
-
return getContractSpecEventRegistry().get(key, version);
|
|
32258
|
-
}
|
|
32259
|
-
var presentationRegistry = null;
|
|
32260
|
-
function createContractSpecPresentationRegistry() {
|
|
32261
|
-
const registry = new PresentationRegistry;
|
|
32262
|
-
registry.register(DocsLayoutPresentation).register(DocsReferencePagePresentation);
|
|
32263
|
-
return registry;
|
|
32264
|
-
}
|
|
32265
|
-
function getContractSpecPresentationRegistry() {
|
|
32266
|
-
if (!presentationRegistry) {
|
|
32267
|
-
presentationRegistry = createContractSpecPresentationRegistry();
|
|
32268
|
-
}
|
|
32269
|
-
return presentationRegistry;
|
|
32270
|
-
}
|
|
32271
|
-
function resolvePresentationSpec(key, version) {
|
|
32272
|
-
return getContractSpecPresentationRegistry().get(key, version);
|
|
32273
|
-
}
|
|
32274
|
-
var dataViewRegistry = null;
|
|
32275
|
-
function createContractSpecDataViewRegistry() {
|
|
32276
|
-
const registry = new DataViewRegistry;
|
|
32277
|
-
registry.register(DocsIndexDataView2).register(ContractReferenceDataView2).register(ExampleCatalogDataView2);
|
|
32278
|
-
return registry;
|
|
32279
|
-
}
|
|
32280
|
-
function getContractSpecDataViewRegistry() {
|
|
32281
|
-
if (!dataViewRegistry) {
|
|
32282
|
-
dataViewRegistry = createContractSpecDataViewRegistry();
|
|
32283
|
-
}
|
|
32284
|
-
return dataViewRegistry;
|
|
32285
|
-
}
|
|
32286
|
-
function resolveDataViewSpec(key, version) {
|
|
32287
|
-
return getContractSpecDataViewRegistry().get(key, version);
|
|
32288
|
-
}
|
|
32289
|
-
var formRegistry = null;
|
|
32290
|
-
function createContractSpecFormRegistry() {
|
|
32291
|
-
const registry = new FormRegistry;
|
|
32292
|
-
registry.register(DocsSearchForm2);
|
|
32293
|
-
return registry;
|
|
32294
|
-
}
|
|
32295
|
-
function getContractSpecFormRegistry() {
|
|
32296
|
-
if (!formRegistry) {
|
|
32297
|
-
formRegistry = createContractSpecFormRegistry();
|
|
32298
|
-
}
|
|
32299
|
-
return formRegistry;
|
|
32300
|
-
}
|
|
32301
|
-
function resolveFormSpec(key, _version) {
|
|
32302
|
-
return getContractSpecFormRegistry().get(key);
|
|
32303
|
-
}
|
|
32304
|
-
function resolveSerializedOperationSpec(key, version) {
|
|
32305
|
-
const spec = resolveOperationSpec(key, version);
|
|
32306
|
-
return serializeOperationSpec(spec) ?? undefined;
|
|
32307
|
-
}
|
|
32308
|
-
function resolveSerializedEventSpec(key, version) {
|
|
32309
|
-
const spec = resolveEventSpec(key, version);
|
|
32310
|
-
return serializeEventSpec(spec) ?? undefined;
|
|
32311
|
-
}
|
|
32312
|
-
function resolveSerializedPresentationSpec(key, version) {
|
|
32313
|
-
const spec = resolvePresentationSpec(key, version);
|
|
32314
|
-
return serializePresentationSpec(spec) ?? undefined;
|
|
32315
|
-
}
|
|
32316
|
-
function resolveSerializedDataViewSpec(key, version) {
|
|
32317
|
-
const spec = resolveDataViewSpec(key, version);
|
|
32318
|
-
return serializeDataViewSpec(spec) ?? undefined;
|
|
32319
|
-
}
|
|
32320
|
-
function resolveSerializedFormSpec(key, version) {
|
|
32321
|
-
const spec = resolveFormSpec(key, version);
|
|
32322
|
-
return serializeFormSpec(spec) ?? undefined;
|
|
32323
|
-
}
|
|
32324
|
-
function resetContractSpecOperationRegistry() {
|
|
32325
|
-
operationRegistry = null;
|
|
32326
|
-
}
|
|
32327
|
-
function resetContractSpecEventRegistry() {
|
|
32328
|
-
eventRegistry = null;
|
|
32329
|
-
}
|
|
32330
|
-
function resetContractSpecPresentationRegistry() {
|
|
32331
|
-
presentationRegistry = null;
|
|
32332
|
-
}
|
|
32333
|
-
function resetContractSpecDataViewRegistry() {
|
|
32334
|
-
dataViewRegistry = null;
|
|
32335
|
-
}
|
|
32336
|
-
function resetContractSpecFormRegistry() {
|
|
32337
|
-
formRegistry = null;
|
|
32338
|
-
}
|
|
32339
|
-
function resetAllContractSpecRegistries() {
|
|
32340
|
-
resetContractSpecOperationRegistry();
|
|
32341
|
-
resetContractSpecEventRegistry();
|
|
32342
|
-
resetContractSpecPresentationRegistry();
|
|
32343
|
-
resetContractSpecDataViewRegistry();
|
|
32344
|
-
resetContractSpecFormRegistry();
|
|
32345
|
-
}
|
|
32346
|
-
|
|
32347
32338
|
// src/features/docs.feature.ts
|
|
32348
32339
|
var DocsFeature = {
|
|
32349
32340
|
meta: {
|
|
@@ -32375,6 +32366,15 @@ var DocsFeature = {
|
|
|
32375
32366
|
}
|
|
32376
32367
|
};
|
|
32377
32368
|
|
|
32369
|
+
// src/features/docs/docs.contracts.ts
|
|
32370
|
+
import {
|
|
32371
|
+
ContractReferenceQuery as ContractReferenceQuery2,
|
|
32372
|
+
DocSummaryModel,
|
|
32373
|
+
DocsIndexInput,
|
|
32374
|
+
DocsIndexOutput,
|
|
32375
|
+
DocsIndexQuery as DocsIndexQuery2,
|
|
32376
|
+
DocsIndexQuery as DocsIndexQuery3
|
|
32377
|
+
} from "@contractspec/lib.contracts-spec/docs";
|
|
32378
32378
|
// src/features/mcp.feature.ts
|
|
32379
32379
|
var MCPFeature = {
|
|
32380
32380
|
meta: {
|
|
@@ -32491,7 +32491,7 @@ export {
|
|
|
32491
32491
|
getContractSpecFeatureRegistry,
|
|
32492
32492
|
getContractSpecEventRegistry,
|
|
32493
32493
|
getContractSpecDataViewRegistry,
|
|
32494
|
-
|
|
32494
|
+
DocsIndexQuery2 as docsSearchSpec,
|
|
32495
32495
|
createContractSpecPresentationRegistry,
|
|
32496
32496
|
createContractSpecOperationRegistry,
|
|
32497
32497
|
createContractSpecFormRegistry,
|
|
@@ -32626,7 +32626,7 @@ export {
|
|
|
32626
32626
|
EcosystemIntegrationsPage,
|
|
32627
32627
|
DocsReferencePage,
|
|
32628
32628
|
DocsReferenceIndexPage,
|
|
32629
|
-
|
|
32629
|
+
DocsIndexQuery3 as DocsIndexQuery,
|
|
32630
32630
|
DocsIndexPage,
|
|
32631
32631
|
DocsFeature,
|
|
32632
32632
|
DocsExamplesPage,
|
|
@@ -32639,7 +32639,7 @@ export {
|
|
|
32639
32639
|
DOCS_PRIMARY_SECTIONS,
|
|
32640
32640
|
DOCS_PAGES,
|
|
32641
32641
|
ConversationList,
|
|
32642
|
-
ContractReferenceQuery,
|
|
32642
|
+
ContractReferenceQuery2 as ContractReferenceQuery,
|
|
32643
32643
|
ContractFirstApiPage,
|
|
32644
32644
|
CompatibilityPage,
|
|
32645
32645
|
ComparisonWorkflowEnginesPage,
|