@contractspec/bundle.library 2.9.1 → 3.1.1
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 +240 -214
- package/AGENTS.md +19 -12
- package/CHANGELOG.md +84 -0
- package/dist/application/context-storage/index.d.ts +18 -0
- package/dist/application/context-storage/index.js +29 -0
- package/dist/application/index.d.ts +1 -0
- package/dist/application/index.js +662 -2
- package/dist/application/mcp/cliMcp.js +12 -2
- package/dist/application/mcp/common.d.ts +11 -1
- package/dist/application/mcp/common.js +12 -2
- package/dist/application/mcp/contractsMcp.d.ts +51 -0
- package/dist/application/mcp/contractsMcp.js +531 -0
- package/dist/application/mcp/contractsMcpResources.d.ts +7 -0
- package/dist/application/mcp/contractsMcpResources.js +124 -0
- package/dist/application/mcp/contractsMcpTools.d.ts +9 -0
- package/dist/application/mcp/contractsMcpTools.js +200 -0
- package/dist/application/mcp/contractsMcpTypes.d.ts +50 -0
- package/dist/application/mcp/contractsMcpTypes.js +1 -0
- package/dist/application/mcp/docsMcp.js +12 -2
- package/dist/application/mcp/index.d.ts +2 -0
- package/dist/application/mcp/index.js +635 -2
- package/dist/application/mcp/internalMcp.js +12 -2
- package/dist/application/mcp/providerRankingMcp.d.ts +46 -0
- package/dist/application/mcp/providerRankingMcp.js +494 -0
- package/dist/components/docs/DocsIndexPage.js +1 -1
- package/dist/components/docs/architecture/ArchitectureControlPlanePage.d.ts +1 -0
- package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +204 -0
- package/dist/components/docs/architecture/ArchitectureOverviewPage.js +17 -1
- package/dist/components/docs/architecture/index.d.ts +1 -0
- package/dist/components/docs/architecture/index.js +507 -289
- package/dist/components/docs/ecosystem/IntegrationsPage.js +6 -3
- package/dist/components/docs/ecosystem/PluginsPage.js +98 -98
- package/dist/components/docs/ecosystem/RegistryPage.js +39 -42
- package/dist/components/docs/ecosystem/TemplatesPage.js +26 -21
- package/dist/components/docs/ecosystem/ecosystem.docblocks.js +10 -10
- package/dist/components/docs/ecosystem/index.js +179 -174
- package/dist/components/docs/index.js +6795 -5376
- package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +2 -2
- package/dist/components/docs/integrations/IntegrationsGithubPage.d.ts +1 -0
- package/dist/components/docs/integrations/IntegrationsGithubPage.js +155 -0
- package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.d.ts +1 -0
- package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +168 -0
- package/dist/components/docs/integrations/IntegrationsMistralPage.d.ts +1 -0
- package/dist/components/docs/integrations/IntegrationsMistralPage.js +203 -0
- package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
- package/dist/components/docs/integrations/IntegrationsOverviewPage.js +136 -9
- package/dist/components/docs/integrations/IntegrationsSlackPage.d.ts +1 -0
- package/dist/components/docs/integrations/IntegrationsSlackPage.js +161 -0
- package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +72 -0
- package/dist/components/docs/integrations/IntegrationsTwilioPage.js +2 -2
- package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.d.ts +1 -0
- package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +157 -0
- package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.d.ts +1 -0
- package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +165 -0
- package/dist/components/docs/integrations/index.d.ts +6 -0
- package/dist/components/docs/integrations/index.js +1688 -492
- package/dist/index.js +8016 -6597
- package/dist/node/application/context-storage/index.js +28 -0
- package/dist/node/application/index.js +662 -2
- package/dist/node/application/mcp/cliMcp.js +12 -2
- package/dist/node/application/mcp/common.js +12 -2
- package/dist/node/application/mcp/contractsMcp.js +530 -0
- package/dist/node/application/mcp/contractsMcpResources.js +123 -0
- package/dist/node/application/mcp/contractsMcpTools.js +199 -0
- package/dist/node/application/mcp/contractsMcpTypes.js +0 -0
- package/dist/node/application/mcp/docsMcp.js +12 -2
- package/dist/node/application/mcp/index.js +635 -2
- package/dist/node/application/mcp/internalMcp.js +12 -2
- package/dist/node/application/mcp/providerRankingMcp.js +493 -0
- package/dist/node/components/docs/DocsIndexPage.js +1 -1
- package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +203 -0
- package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +17 -1
- package/dist/node/components/docs/architecture/index.js +507 -289
- package/dist/node/components/docs/ecosystem/IntegrationsPage.js +6 -3
- package/dist/node/components/docs/ecosystem/PluginsPage.js +98 -98
- package/dist/node/components/docs/ecosystem/RegistryPage.js +39 -42
- package/dist/node/components/docs/ecosystem/TemplatesPage.js +26 -21
- package/dist/node/components/docs/ecosystem/ecosystem.docblocks.js +10 -10
- package/dist/node/components/docs/ecosystem/index.js +179 -174
- package/dist/node/components/docs/index.js +6795 -5376
- package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +2 -2
- package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +154 -0
- package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +167 -0
- package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +202 -0
- package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +2 -2
- package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +136 -9
- package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +160 -0
- package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +72 -0
- package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +2 -2
- package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +156 -0
- package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +164 -0
- package/dist/node/components/docs/integrations/index.js +1688 -492
- package/dist/node/index.js +8016 -6597
- package/package.json +195 -25
- package/src/application/context-storage/index.ts +58 -0
- package/src/application/index.ts +1 -0
- package/src/application/mcp/common.ts +28 -1
- package/src/application/mcp/contractsMcp.ts +34 -0
- package/src/application/mcp/contractsMcpResources.ts +142 -0
- package/src/application/mcp/contractsMcpTools.ts +246 -0
- package/src/application/mcp/contractsMcpTypes.ts +47 -0
- package/src/application/mcp/index.ts +2 -0
- package/src/application/mcp/providerRankingMcp.ts +380 -0
- package/src/components/docs/DocsIndexPage.tsx +2 -1
- package/src/components/docs/architecture/ArchitectureControlPlanePage.tsx +136 -0
- package/src/components/docs/architecture/ArchitectureOverviewPage.tsx +13 -1
- package/src/components/docs/architecture/index.ts +1 -0
- package/src/components/docs/ecosystem/IntegrationsPage.tsx +4 -3
- package/src/components/docs/ecosystem/PluginsPage.tsx +68 -87
- package/src/components/docs/ecosystem/RegistryPage.tsx +35 -43
- package/src/components/docs/ecosystem/TemplatesPage.tsx +28 -21
- package/src/components/docs/ecosystem/ecosystem.docblocks.ts +12 -10
- package/src/components/docs/generated/docs-index._common.json +1119 -1
- package/src/components/docs/generated/docs-index.health.json +98 -0
- package/src/components/docs/generated/docs-index.manifest.json +15 -5
- package/src/components/docs/generated/docs-index.metrics.json +8 -0
- package/src/components/docs/generated/docs-index.platform-integrations.json +89 -1
- package/src/components/docs/generated/docs-index.video-api-showcase.json +26 -0
- package/src/components/docs/integrations/IntegrationsElevenLabsPage.tsx +2 -2
- package/src/components/docs/integrations/IntegrationsGithubPage.tsx +90 -0
- package/src/components/docs/integrations/IntegrationsHealthRoutingPage.tsx +112 -0
- package/src/components/docs/integrations/IntegrationsMistralPage.tsx +133 -0
- package/src/components/docs/integrations/IntegrationsOpenAIPage.tsx +2 -2
- package/src/components/docs/integrations/IntegrationsOverviewPage.tsx +108 -9
- package/src/components/docs/integrations/IntegrationsSlackPage.tsx +98 -0
- package/src/components/docs/integrations/IntegrationsSpecModelPage.tsx +59 -0
- package/src/components/docs/integrations/IntegrationsTwilioPage.tsx +2 -2
- package/src/components/docs/integrations/IntegrationsWhatsappMetaPage.tsx +90 -0
- package/src/components/docs/integrations/IntegrationsWhatsappTwilioPage.tsx +92 -0
- package/src/components/docs/integrations/index.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.library",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -30,6 +30,18 @@
|
|
|
30
30
|
"node": "./dist/node/application/index.js",
|
|
31
31
|
"default": "./dist/application/index.js"
|
|
32
32
|
},
|
|
33
|
+
"./application/context-storage": {
|
|
34
|
+
"types": "./dist/application/context-storage/index.d.ts",
|
|
35
|
+
"bun": "./dist/application/context-storage/index.js",
|
|
36
|
+
"node": "./dist/node/application/context-storage/index.js",
|
|
37
|
+
"default": "./dist/application/context-storage/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./application/context-storage/index": {
|
|
40
|
+
"types": "./dist/application/context-storage/index.d.ts",
|
|
41
|
+
"bun": "./dist/application/context-storage/index.js",
|
|
42
|
+
"node": "./dist/node/application/context-storage/index.js",
|
|
43
|
+
"default": "./dist/application/context-storage/index.js"
|
|
44
|
+
},
|
|
33
45
|
"./application/index": {
|
|
34
46
|
"types": "./dist/application/index.d.ts",
|
|
35
47
|
"bun": "./dist/application/index.js",
|
|
@@ -54,6 +66,30 @@
|
|
|
54
66
|
"node": "./dist/node/application/mcp/common.js",
|
|
55
67
|
"default": "./dist/application/mcp/common.js"
|
|
56
68
|
},
|
|
69
|
+
"./application/mcp/contractsMcp": {
|
|
70
|
+
"types": "./dist/application/mcp/contractsMcp.d.ts",
|
|
71
|
+
"bun": "./dist/application/mcp/contractsMcp.js",
|
|
72
|
+
"node": "./dist/node/application/mcp/contractsMcp.js",
|
|
73
|
+
"default": "./dist/application/mcp/contractsMcp.js"
|
|
74
|
+
},
|
|
75
|
+
"./application/mcp/contractsMcpResources": {
|
|
76
|
+
"types": "./dist/application/mcp/contractsMcpResources.d.ts",
|
|
77
|
+
"bun": "./dist/application/mcp/contractsMcpResources.js",
|
|
78
|
+
"node": "./dist/node/application/mcp/contractsMcpResources.js",
|
|
79
|
+
"default": "./dist/application/mcp/contractsMcpResources.js"
|
|
80
|
+
},
|
|
81
|
+
"./application/mcp/contractsMcpTools": {
|
|
82
|
+
"types": "./dist/application/mcp/contractsMcpTools.d.ts",
|
|
83
|
+
"bun": "./dist/application/mcp/contractsMcpTools.js",
|
|
84
|
+
"node": "./dist/node/application/mcp/contractsMcpTools.js",
|
|
85
|
+
"default": "./dist/application/mcp/contractsMcpTools.js"
|
|
86
|
+
},
|
|
87
|
+
"./application/mcp/contractsMcpTypes": {
|
|
88
|
+
"types": "./dist/application/mcp/contractsMcpTypes.d.ts",
|
|
89
|
+
"bun": "./dist/application/mcp/contractsMcpTypes.js",
|
|
90
|
+
"node": "./dist/node/application/mcp/contractsMcpTypes.js",
|
|
91
|
+
"default": "./dist/application/mcp/contractsMcpTypes.js"
|
|
92
|
+
},
|
|
57
93
|
"./application/mcp/docsMcp": {
|
|
58
94
|
"types": "./dist/application/mcp/docsMcp.d.ts",
|
|
59
95
|
"bun": "./dist/application/mcp/docsMcp.js",
|
|
@@ -72,6 +108,12 @@
|
|
|
72
108
|
"node": "./dist/node/application/mcp/internalMcp.js",
|
|
73
109
|
"default": "./dist/application/mcp/internalMcp.js"
|
|
74
110
|
},
|
|
111
|
+
"./application/mcp/providerRankingMcp": {
|
|
112
|
+
"types": "./dist/application/mcp/providerRankingMcp.d.ts",
|
|
113
|
+
"bun": "./dist/application/mcp/providerRankingMcp.js",
|
|
114
|
+
"node": "./dist/node/application/mcp/providerRankingMcp.js",
|
|
115
|
+
"default": "./dist/application/mcp/providerRankingMcp.js"
|
|
116
|
+
},
|
|
75
117
|
"./components/docs": {
|
|
76
118
|
"types": "./dist/components/docs/index.d.ts",
|
|
77
119
|
"bun": "./dist/components/docs/index.js",
|
|
@@ -138,6 +180,12 @@
|
|
|
138
180
|
"node": "./dist/node/components/docs/architecture/ArchitectureAppConfigPage.js",
|
|
139
181
|
"default": "./dist/components/docs/architecture/ArchitectureAppConfigPage.js"
|
|
140
182
|
},
|
|
183
|
+
"./components/docs/architecture/ArchitectureControlPlanePage": {
|
|
184
|
+
"types": "./dist/components/docs/architecture/ArchitectureControlPlanePage.d.ts",
|
|
185
|
+
"bun": "./dist/components/docs/architecture/ArchitectureControlPlanePage.js",
|
|
186
|
+
"node": "./dist/node/components/docs/architecture/ArchitectureControlPlanePage.js",
|
|
187
|
+
"default": "./dist/components/docs/architecture/ArchitectureControlPlanePage.js"
|
|
188
|
+
},
|
|
141
189
|
"./components/docs/architecture/ArchitectureIntegrationBindingPage": {
|
|
142
190
|
"types": "./dist/components/docs/architecture/ArchitectureIntegrationBindingPage.d.ts",
|
|
143
191
|
"bun": "./dist/components/docs/architecture/ArchitectureIntegrationBindingPage.js",
|
|
@@ -474,6 +522,12 @@
|
|
|
474
522
|
"node": "./dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js",
|
|
475
523
|
"default": "./dist/components/docs/integrations/IntegrationsElevenLabsPage.js"
|
|
476
524
|
},
|
|
525
|
+
"./components/docs/integrations/IntegrationsGithubPage": {
|
|
526
|
+
"types": "./dist/components/docs/integrations/IntegrationsGithubPage.d.ts",
|
|
527
|
+
"bun": "./dist/components/docs/integrations/IntegrationsGithubPage.js",
|
|
528
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsGithubPage.js",
|
|
529
|
+
"default": "./dist/components/docs/integrations/IntegrationsGithubPage.js"
|
|
530
|
+
},
|
|
477
531
|
"./components/docs/integrations/IntegrationsGmailPage": {
|
|
478
532
|
"types": "./dist/components/docs/integrations/IntegrationsGmailPage.d.ts",
|
|
479
533
|
"bun": "./dist/components/docs/integrations/IntegrationsGmailPage.js",
|
|
@@ -486,6 +540,18 @@
|
|
|
486
540
|
"node": "./dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js",
|
|
487
541
|
"default": "./dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js"
|
|
488
542
|
},
|
|
543
|
+
"./components/docs/integrations/IntegrationsHealthRoutingPage": {
|
|
544
|
+
"types": "./dist/components/docs/integrations/IntegrationsHealthRoutingPage.d.ts",
|
|
545
|
+
"bun": "./dist/components/docs/integrations/IntegrationsHealthRoutingPage.js",
|
|
546
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js",
|
|
547
|
+
"default": "./dist/components/docs/integrations/IntegrationsHealthRoutingPage.js"
|
|
548
|
+
},
|
|
549
|
+
"./components/docs/integrations/IntegrationsMistralPage": {
|
|
550
|
+
"types": "./dist/components/docs/integrations/IntegrationsMistralPage.d.ts",
|
|
551
|
+
"bun": "./dist/components/docs/integrations/IntegrationsMistralPage.js",
|
|
552
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsMistralPage.js",
|
|
553
|
+
"default": "./dist/components/docs/integrations/IntegrationsMistralPage.js"
|
|
554
|
+
},
|
|
489
555
|
"./components/docs/integrations/IntegrationsOpenAIPage": {
|
|
490
556
|
"types": "./dist/components/docs/integrations/IntegrationsOpenAIPage.d.ts",
|
|
491
557
|
"bun": "./dist/components/docs/integrations/IntegrationsOpenAIPage.js",
|
|
@@ -528,6 +594,12 @@
|
|
|
528
594
|
"node": "./dist/node/components/docs/integrations/IntegrationsS3Page.js",
|
|
529
595
|
"default": "./dist/components/docs/integrations/IntegrationsS3Page.js"
|
|
530
596
|
},
|
|
597
|
+
"./components/docs/integrations/IntegrationsSlackPage": {
|
|
598
|
+
"types": "./dist/components/docs/integrations/IntegrationsSlackPage.d.ts",
|
|
599
|
+
"bun": "./dist/components/docs/integrations/IntegrationsSlackPage.js",
|
|
600
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsSlackPage.js",
|
|
601
|
+
"default": "./dist/components/docs/integrations/IntegrationsSlackPage.js"
|
|
602
|
+
},
|
|
531
603
|
"./components/docs/integrations/IntegrationsSpecModelPage": {
|
|
532
604
|
"types": "./dist/components/docs/integrations/IntegrationsSpecModelPage.d.ts",
|
|
533
605
|
"bun": "./dist/components/docs/integrations/IntegrationsSpecModelPage.js",
|
|
@@ -546,6 +618,18 @@
|
|
|
546
618
|
"node": "./dist/node/components/docs/integrations/IntegrationsTwilioPage.js",
|
|
547
619
|
"default": "./dist/components/docs/integrations/IntegrationsTwilioPage.js"
|
|
548
620
|
},
|
|
621
|
+
"./components/docs/integrations/IntegrationsWhatsappMetaPage": {
|
|
622
|
+
"types": "./dist/components/docs/integrations/IntegrationsWhatsappMetaPage.d.ts",
|
|
623
|
+
"bun": "./dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js",
|
|
624
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js",
|
|
625
|
+
"default": "./dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js"
|
|
626
|
+
},
|
|
627
|
+
"./components/docs/integrations/IntegrationsWhatsappTwilioPage": {
|
|
628
|
+
"types": "./dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.d.ts",
|
|
629
|
+
"bun": "./dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js",
|
|
630
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js",
|
|
631
|
+
"default": "./dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js"
|
|
632
|
+
},
|
|
549
633
|
"./components/docs/intent": {
|
|
550
634
|
"types": "./dist/components/docs/intent/index.d.ts",
|
|
551
635
|
"bun": "./dist/components/docs/intent/index.js",
|
|
@@ -2053,41 +2137,43 @@
|
|
|
2053
2137
|
},
|
|
2054
2138
|
"dependencies": {
|
|
2055
2139
|
"@apollo/client": "^4.1.6",
|
|
2056
|
-
"@contractspec/lib.contracts-spec": "
|
|
2057
|
-
"@contractspec/lib.contracts-library": "
|
|
2058
|
-
"@contractspec/lib.contracts-runtime-server-mcp": "
|
|
2059
|
-
"@contractspec/lib.design-system": "
|
|
2060
|
-
"@contractspec/lib.example-shared-ui": "
|
|
2061
|
-
"@contractspec/lib.
|
|
2062
|
-
"@contractspec/lib.
|
|
2063
|
-
"@contractspec/lib.
|
|
2064
|
-
"@contractspec/lib.
|
|
2065
|
-
"@contractspec/lib.ui-
|
|
2066
|
-
"@contractspec/
|
|
2140
|
+
"@contractspec/lib.contracts-spec": "3.1.1",
|
|
2141
|
+
"@contractspec/lib.contracts-library": "3.1.1",
|
|
2142
|
+
"@contractspec/lib.contracts-runtime-server-mcp": "3.1.1",
|
|
2143
|
+
"@contractspec/lib.design-system": "3.1.1",
|
|
2144
|
+
"@contractspec/lib.example-shared-ui": "3.1.1",
|
|
2145
|
+
"@contractspec/lib.knowledge": "3.1.1",
|
|
2146
|
+
"@contractspec/lib.logger": "3.1.0",
|
|
2147
|
+
"@contractspec/lib.runtime-sandbox": "2.1.0",
|
|
2148
|
+
"@contractspec/lib.schema": "3.1.0",
|
|
2149
|
+
"@contractspec/lib.ui-kit-web": "3.1.0",
|
|
2150
|
+
"@contractspec/lib.ui-link": "3.1.0",
|
|
2151
|
+
"@contractspec/module.context-storage": "0.1.2",
|
|
2152
|
+
"@contractspec/module.examples": "3.1.1",
|
|
2067
2153
|
"@dnd-kit/core": "^6.1.0",
|
|
2068
2154
|
"@dnd-kit/sortable": "^10.0.0",
|
|
2069
2155
|
"@dnd-kit/utilities": "^3.2.2",
|
|
2070
2156
|
"@electric-sql/pglite": "^0.3.14",
|
|
2071
|
-
"@scaleway/sdk": "^3.
|
|
2072
|
-
"@scaleway/sdk-client": "^2.1
|
|
2157
|
+
"@scaleway/sdk": "^3.3.1",
|
|
2158
|
+
"@scaleway/sdk-client": "^2.2.1",
|
|
2073
2159
|
"drizzle-orm": "^0.45.1",
|
|
2074
|
-
"framer-motion": "^12.
|
|
2075
|
-
"lucide-react": "^0.
|
|
2076
|
-
"posthog-js": "^1.
|
|
2077
|
-
"posthog-node": "^5.
|
|
2078
|
-
"posthog-react-native": "^4.
|
|
2160
|
+
"framer-motion": "^12.35.0",
|
|
2161
|
+
"lucide-react": "^0.577.0",
|
|
2162
|
+
"posthog-js": "^1.359.1",
|
|
2163
|
+
"posthog-node": "^5.28.0",
|
|
2164
|
+
"posthog-react-native": "^4.37.1",
|
|
2079
2165
|
"react-hook-form": "^7.71.2",
|
|
2080
2166
|
"zod": "^4.3.5",
|
|
2081
|
-
"@contractspec/lib.contracts-integrations": "
|
|
2082
|
-
"@contractspec/lib.contracts-runtime-server-rest": "
|
|
2083
|
-
"@contractspec/lib.contracts-runtime-server-graphql": "
|
|
2167
|
+
"@contractspec/lib.contracts-integrations": "3.1.1",
|
|
2168
|
+
"@contractspec/lib.contracts-runtime-server-rest": "3.1.1",
|
|
2169
|
+
"@contractspec/lib.contracts-runtime-server-graphql": "3.1.1"
|
|
2084
2170
|
},
|
|
2085
2171
|
"devDependencies": {
|
|
2086
2172
|
"@types/react": "~19.2.14",
|
|
2087
|
-
"@contractspec/tool.typescript": "
|
|
2173
|
+
"@contractspec/tool.typescript": "3.1.0",
|
|
2088
2174
|
"typescript": "^5.9.3",
|
|
2089
|
-
"@types/bun": "~1.3.
|
|
2090
|
-
"@contractspec/tool.bun": "
|
|
2175
|
+
"@types/bun": "~1.3.10",
|
|
2176
|
+
"@contractspec/tool.bun": "3.1.0"
|
|
2091
2177
|
},
|
|
2092
2178
|
"publishConfig": {
|
|
2093
2179
|
"access": "public",
|
|
@@ -2105,6 +2191,18 @@
|
|
|
2105
2191
|
"node": "./dist/node/application/index.js",
|
|
2106
2192
|
"default": "./dist/application/index.js"
|
|
2107
2193
|
},
|
|
2194
|
+
"./application/context-storage": {
|
|
2195
|
+
"types": "./dist/application/context-storage/index.d.ts",
|
|
2196
|
+
"bun": "./dist/application/context-storage/index.js",
|
|
2197
|
+
"node": "./dist/node/application/context-storage/index.js",
|
|
2198
|
+
"default": "./dist/application/context-storage/index.js"
|
|
2199
|
+
},
|
|
2200
|
+
"./application/context-storage/index": {
|
|
2201
|
+
"types": "./dist/application/context-storage/index.d.ts",
|
|
2202
|
+
"bun": "./dist/application/context-storage/index.js",
|
|
2203
|
+
"node": "./dist/node/application/context-storage/index.js",
|
|
2204
|
+
"default": "./dist/application/context-storage/index.js"
|
|
2205
|
+
},
|
|
2108
2206
|
"./application/index": {
|
|
2109
2207
|
"types": "./dist/application/index.d.ts",
|
|
2110
2208
|
"bun": "./dist/application/index.js",
|
|
@@ -2129,6 +2227,30 @@
|
|
|
2129
2227
|
"node": "./dist/node/application/mcp/common.js",
|
|
2130
2228
|
"default": "./dist/application/mcp/common.js"
|
|
2131
2229
|
},
|
|
2230
|
+
"./application/mcp/contractsMcp": {
|
|
2231
|
+
"types": "./dist/application/mcp/contractsMcp.d.ts",
|
|
2232
|
+
"bun": "./dist/application/mcp/contractsMcp.js",
|
|
2233
|
+
"node": "./dist/node/application/mcp/contractsMcp.js",
|
|
2234
|
+
"default": "./dist/application/mcp/contractsMcp.js"
|
|
2235
|
+
},
|
|
2236
|
+
"./application/mcp/contractsMcpResources": {
|
|
2237
|
+
"types": "./dist/application/mcp/contractsMcpResources.d.ts",
|
|
2238
|
+
"bun": "./dist/application/mcp/contractsMcpResources.js",
|
|
2239
|
+
"node": "./dist/node/application/mcp/contractsMcpResources.js",
|
|
2240
|
+
"default": "./dist/application/mcp/contractsMcpResources.js"
|
|
2241
|
+
},
|
|
2242
|
+
"./application/mcp/contractsMcpTools": {
|
|
2243
|
+
"types": "./dist/application/mcp/contractsMcpTools.d.ts",
|
|
2244
|
+
"bun": "./dist/application/mcp/contractsMcpTools.js",
|
|
2245
|
+
"node": "./dist/node/application/mcp/contractsMcpTools.js",
|
|
2246
|
+
"default": "./dist/application/mcp/contractsMcpTools.js"
|
|
2247
|
+
},
|
|
2248
|
+
"./application/mcp/contractsMcpTypes": {
|
|
2249
|
+
"types": "./dist/application/mcp/contractsMcpTypes.d.ts",
|
|
2250
|
+
"bun": "./dist/application/mcp/contractsMcpTypes.js",
|
|
2251
|
+
"node": "./dist/node/application/mcp/contractsMcpTypes.js",
|
|
2252
|
+
"default": "./dist/application/mcp/contractsMcpTypes.js"
|
|
2253
|
+
},
|
|
2132
2254
|
"./application/mcp/docsMcp": {
|
|
2133
2255
|
"types": "./dist/application/mcp/docsMcp.d.ts",
|
|
2134
2256
|
"bun": "./dist/application/mcp/docsMcp.js",
|
|
@@ -2147,6 +2269,12 @@
|
|
|
2147
2269
|
"node": "./dist/node/application/mcp/internalMcp.js",
|
|
2148
2270
|
"default": "./dist/application/mcp/internalMcp.js"
|
|
2149
2271
|
},
|
|
2272
|
+
"./application/mcp/providerRankingMcp": {
|
|
2273
|
+
"types": "./dist/application/mcp/providerRankingMcp.d.ts",
|
|
2274
|
+
"bun": "./dist/application/mcp/providerRankingMcp.js",
|
|
2275
|
+
"node": "./dist/node/application/mcp/providerRankingMcp.js",
|
|
2276
|
+
"default": "./dist/application/mcp/providerRankingMcp.js"
|
|
2277
|
+
},
|
|
2150
2278
|
"./components/docs": {
|
|
2151
2279
|
"types": "./dist/components/docs/index.d.ts",
|
|
2152
2280
|
"bun": "./dist/components/docs/index.js",
|
|
@@ -2213,6 +2341,12 @@
|
|
|
2213
2341
|
"node": "./dist/node/components/docs/architecture/ArchitectureAppConfigPage.js",
|
|
2214
2342
|
"default": "./dist/components/docs/architecture/ArchitectureAppConfigPage.js"
|
|
2215
2343
|
},
|
|
2344
|
+
"./components/docs/architecture/ArchitectureControlPlanePage": {
|
|
2345
|
+
"types": "./dist/components/docs/architecture/ArchitectureControlPlanePage.d.ts",
|
|
2346
|
+
"bun": "./dist/components/docs/architecture/ArchitectureControlPlanePage.js",
|
|
2347
|
+
"node": "./dist/node/components/docs/architecture/ArchitectureControlPlanePage.js",
|
|
2348
|
+
"default": "./dist/components/docs/architecture/ArchitectureControlPlanePage.js"
|
|
2349
|
+
},
|
|
2216
2350
|
"./components/docs/architecture/ArchitectureIntegrationBindingPage": {
|
|
2217
2351
|
"types": "./dist/components/docs/architecture/ArchitectureIntegrationBindingPage.d.ts",
|
|
2218
2352
|
"bun": "./dist/components/docs/architecture/ArchitectureIntegrationBindingPage.js",
|
|
@@ -2549,6 +2683,12 @@
|
|
|
2549
2683
|
"node": "./dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js",
|
|
2550
2684
|
"default": "./dist/components/docs/integrations/IntegrationsElevenLabsPage.js"
|
|
2551
2685
|
},
|
|
2686
|
+
"./components/docs/integrations/IntegrationsGithubPage": {
|
|
2687
|
+
"types": "./dist/components/docs/integrations/IntegrationsGithubPage.d.ts",
|
|
2688
|
+
"bun": "./dist/components/docs/integrations/IntegrationsGithubPage.js",
|
|
2689
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsGithubPage.js",
|
|
2690
|
+
"default": "./dist/components/docs/integrations/IntegrationsGithubPage.js"
|
|
2691
|
+
},
|
|
2552
2692
|
"./components/docs/integrations/IntegrationsGmailPage": {
|
|
2553
2693
|
"types": "./dist/components/docs/integrations/IntegrationsGmailPage.d.ts",
|
|
2554
2694
|
"bun": "./dist/components/docs/integrations/IntegrationsGmailPage.js",
|
|
@@ -2561,6 +2701,18 @@
|
|
|
2561
2701
|
"node": "./dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js",
|
|
2562
2702
|
"default": "./dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js"
|
|
2563
2703
|
},
|
|
2704
|
+
"./components/docs/integrations/IntegrationsHealthRoutingPage": {
|
|
2705
|
+
"types": "./dist/components/docs/integrations/IntegrationsHealthRoutingPage.d.ts",
|
|
2706
|
+
"bun": "./dist/components/docs/integrations/IntegrationsHealthRoutingPage.js",
|
|
2707
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js",
|
|
2708
|
+
"default": "./dist/components/docs/integrations/IntegrationsHealthRoutingPage.js"
|
|
2709
|
+
},
|
|
2710
|
+
"./components/docs/integrations/IntegrationsMistralPage": {
|
|
2711
|
+
"types": "./dist/components/docs/integrations/IntegrationsMistralPage.d.ts",
|
|
2712
|
+
"bun": "./dist/components/docs/integrations/IntegrationsMistralPage.js",
|
|
2713
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsMistralPage.js",
|
|
2714
|
+
"default": "./dist/components/docs/integrations/IntegrationsMistralPage.js"
|
|
2715
|
+
},
|
|
2564
2716
|
"./components/docs/integrations/IntegrationsOpenAIPage": {
|
|
2565
2717
|
"types": "./dist/components/docs/integrations/IntegrationsOpenAIPage.d.ts",
|
|
2566
2718
|
"bun": "./dist/components/docs/integrations/IntegrationsOpenAIPage.js",
|
|
@@ -2603,6 +2755,12 @@
|
|
|
2603
2755
|
"node": "./dist/node/components/docs/integrations/IntegrationsS3Page.js",
|
|
2604
2756
|
"default": "./dist/components/docs/integrations/IntegrationsS3Page.js"
|
|
2605
2757
|
},
|
|
2758
|
+
"./components/docs/integrations/IntegrationsSlackPage": {
|
|
2759
|
+
"types": "./dist/components/docs/integrations/IntegrationsSlackPage.d.ts",
|
|
2760
|
+
"bun": "./dist/components/docs/integrations/IntegrationsSlackPage.js",
|
|
2761
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsSlackPage.js",
|
|
2762
|
+
"default": "./dist/components/docs/integrations/IntegrationsSlackPage.js"
|
|
2763
|
+
},
|
|
2606
2764
|
"./components/docs/integrations/IntegrationsSpecModelPage": {
|
|
2607
2765
|
"types": "./dist/components/docs/integrations/IntegrationsSpecModelPage.d.ts",
|
|
2608
2766
|
"bun": "./dist/components/docs/integrations/IntegrationsSpecModelPage.js",
|
|
@@ -2621,6 +2779,18 @@
|
|
|
2621
2779
|
"node": "./dist/node/components/docs/integrations/IntegrationsTwilioPage.js",
|
|
2622
2780
|
"default": "./dist/components/docs/integrations/IntegrationsTwilioPage.js"
|
|
2623
2781
|
},
|
|
2782
|
+
"./components/docs/integrations/IntegrationsWhatsappMetaPage": {
|
|
2783
|
+
"types": "./dist/components/docs/integrations/IntegrationsWhatsappMetaPage.d.ts",
|
|
2784
|
+
"bun": "./dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js",
|
|
2785
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js",
|
|
2786
|
+
"default": "./dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js"
|
|
2787
|
+
},
|
|
2788
|
+
"./components/docs/integrations/IntegrationsWhatsappTwilioPage": {
|
|
2789
|
+
"types": "./dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.d.ts",
|
|
2790
|
+
"bun": "./dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js",
|
|
2791
|
+
"node": "./dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js",
|
|
2792
|
+
"default": "./dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js"
|
|
2793
|
+
},
|
|
2624
2794
|
"./components/docs/intent": {
|
|
2625
2795
|
"types": "./dist/components/docs/intent/index.d.ts",
|
|
2626
2796
|
"bun": "./dist/components/docs/intent/index.js",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DatabaseProvider,
|
|
3
|
+
EmbeddingProvider,
|
|
4
|
+
VectorStoreProvider,
|
|
5
|
+
} from '@contractspec/lib.contracts-integrations';
|
|
6
|
+
import {
|
|
7
|
+
DocumentProcessor,
|
|
8
|
+
EmbeddingService,
|
|
9
|
+
VectorIndexer,
|
|
10
|
+
type VectorIndexConfig,
|
|
11
|
+
} from '@contractspec/lib.knowledge/ingestion';
|
|
12
|
+
import {
|
|
13
|
+
ContextSnapshotPipeline,
|
|
14
|
+
PostgresContextStorage,
|
|
15
|
+
} from '@contractspec/module.context-storage';
|
|
16
|
+
|
|
17
|
+
export interface ContextStorageServiceOptions {
|
|
18
|
+
database: DatabaseProvider;
|
|
19
|
+
schema?: string;
|
|
20
|
+
createTablesIfMissing?: boolean;
|
|
21
|
+
documentProcessor?: DocumentProcessor;
|
|
22
|
+
embeddingProvider?: EmbeddingProvider;
|
|
23
|
+
embeddingBatchSize?: number;
|
|
24
|
+
vectorStoreProvider?: VectorStoreProvider;
|
|
25
|
+
vectorIndex?: VectorIndexConfig;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ContextStorageService {
|
|
29
|
+
store: PostgresContextStorage;
|
|
30
|
+
pipeline: ContextSnapshotPipeline;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function createContextStorageService(
|
|
34
|
+
options: ContextStorageServiceOptions
|
|
35
|
+
): ContextStorageService {
|
|
36
|
+
const store = new PostgresContextStorage({
|
|
37
|
+
database: options.database,
|
|
38
|
+
schema: options.schema,
|
|
39
|
+
createTablesIfMissing: options.createTablesIfMissing,
|
|
40
|
+
});
|
|
41
|
+
const embeddingService = options.embeddingProvider
|
|
42
|
+
? new EmbeddingService(
|
|
43
|
+
options.embeddingProvider,
|
|
44
|
+
options.embeddingBatchSize
|
|
45
|
+
)
|
|
46
|
+
: undefined;
|
|
47
|
+
const vectorIndexer =
|
|
48
|
+
options.vectorStoreProvider && options.vectorIndex
|
|
49
|
+
? new VectorIndexer(options.vectorStoreProvider, options.vectorIndex)
|
|
50
|
+
: undefined;
|
|
51
|
+
const pipeline = new ContextSnapshotPipeline({
|
|
52
|
+
store,
|
|
53
|
+
documentProcessor: options.documentProcessor,
|
|
54
|
+
embeddingService,
|
|
55
|
+
vectorIndexer,
|
|
56
|
+
});
|
|
57
|
+
return { store, pipeline };
|
|
58
|
+
}
|
package/src/application/index.ts
CHANGED
|
@@ -11,6 +11,13 @@ import { WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/
|
|
|
11
11
|
import { Elysia } from 'elysia';
|
|
12
12
|
import { Logger } from '@contractspec/lib.logger';
|
|
13
13
|
import { randomUUID } from 'node:crypto';
|
|
14
|
+
import type { IntegrationAuthType } from '@contractspec/lib.contracts-integrations/integrations';
|
|
15
|
+
|
|
16
|
+
export interface McpAuthValidationResult {
|
|
17
|
+
valid: boolean;
|
|
18
|
+
actor?: string;
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
interface McpHttpHandlerConfig {
|
|
16
23
|
path: string;
|
|
@@ -20,6 +27,10 @@ interface McpHttpHandlerConfig {
|
|
|
20
27
|
prompts: PromptRegistry;
|
|
21
28
|
presentations?: PresentationSpec[];
|
|
22
29
|
logger: Logger;
|
|
30
|
+
/** Callback to validate auth credentials from the incoming request. */
|
|
31
|
+
validateAuth?: (request: Request) => Promise<McpAuthValidationResult>;
|
|
32
|
+
/** Auth methods this MCP handler requires callers to present. */
|
|
33
|
+
requiredAuthMethods?: IntegrationAuthType[];
|
|
23
34
|
}
|
|
24
35
|
|
|
25
36
|
const baseCtx = {
|
|
@@ -116,8 +127,12 @@ export function createMcpElysiaHandler({
|
|
|
116
127
|
resources,
|
|
117
128
|
prompts,
|
|
118
129
|
presentations,
|
|
130
|
+
validateAuth,
|
|
131
|
+
requiredAuthMethods,
|
|
119
132
|
}: McpHttpHandlerConfig) {
|
|
120
|
-
logger.info('Setting up MCP handler...'
|
|
133
|
+
logger.info('Setting up MCP handler...', {
|
|
134
|
+
requiredAuthMethods: requiredAuthMethods ?? [],
|
|
135
|
+
});
|
|
121
136
|
|
|
122
137
|
const isStateful = process.env.CONTRACTSPEC_MCP_STATEFUL === '1';
|
|
123
138
|
const sessions = new Map<string, McpSessionState>();
|
|
@@ -200,6 +215,18 @@ export function createMcpElysiaHandler({
|
|
|
200
215
|
path,
|
|
201
216
|
async ({ request }) => {
|
|
202
217
|
try {
|
|
218
|
+
if (validateAuth) {
|
|
219
|
+
const authResult = await validateAuth(request);
|
|
220
|
+
if (!authResult.valid) {
|
|
221
|
+
return createJsonRpcErrorResponse(
|
|
222
|
+
401,
|
|
223
|
+
-32002,
|
|
224
|
+
'Authentication failed',
|
|
225
|
+
authResult.reason
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
203
230
|
if (isStateful) {
|
|
204
231
|
return await handleStateful(request);
|
|
205
232
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contracts MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Exposes contract management operations (list, get, create, update,
|
|
5
|
+
* delete, validate, build) as MCP tools, resources, and prompts.
|
|
6
|
+
*
|
|
7
|
+
* Services are injected at creation time so this bundle stays
|
|
8
|
+
* decoupled from bundle.workspace — the app layer provides real impls.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { createMcpElysiaHandler } from './common';
|
|
12
|
+
import { appLogger } from '../../infrastructure/elysia/logger';
|
|
13
|
+
import { buildContractsOps } from './contractsMcpTools';
|
|
14
|
+
import {
|
|
15
|
+
buildContractsResources,
|
|
16
|
+
buildContractsPrompts,
|
|
17
|
+
} from './contractsMcpResources';
|
|
18
|
+
import type { ContractsMcpServices } from './contractsMcpTypes';
|
|
19
|
+
|
|
20
|
+
export type { ContractsMcpServices, ContractInfo } from './contractsMcpTypes';
|
|
21
|
+
|
|
22
|
+
export function createContractsMcpHandler(
|
|
23
|
+
path = '/api/mcp/contracts',
|
|
24
|
+
services: ContractsMcpServices
|
|
25
|
+
) {
|
|
26
|
+
return createMcpElysiaHandler({
|
|
27
|
+
logger: appLogger,
|
|
28
|
+
path,
|
|
29
|
+
serverName: 'contractspec-contracts-mcp',
|
|
30
|
+
ops: buildContractsOps(services),
|
|
31
|
+
resources: buildContractsResources(services),
|
|
32
|
+
prompts: buildContractsPrompts(),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract management MCP resource and prompt definitions.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
definePrompt,
|
|
7
|
+
defineResourceTemplate,
|
|
8
|
+
PromptRegistry,
|
|
9
|
+
ResourceRegistry,
|
|
10
|
+
} from '@contractspec/lib.contracts-spec';
|
|
11
|
+
import z from 'zod';
|
|
12
|
+
import type { ContractsMcpServices } from './contractsMcpTypes';
|
|
13
|
+
|
|
14
|
+
const OWNERS = ['@contractspec'];
|
|
15
|
+
const TAGS = ['contracts', 'mcp'];
|
|
16
|
+
|
|
17
|
+
export function buildContractsResources(services: ContractsMcpServices) {
|
|
18
|
+
const resources = new ResourceRegistry();
|
|
19
|
+
|
|
20
|
+
resources.register(
|
|
21
|
+
defineResourceTemplate({
|
|
22
|
+
meta: {
|
|
23
|
+
uriTemplate: 'contracts://list',
|
|
24
|
+
title: 'Contract specs list',
|
|
25
|
+
description: 'JSON list of all contract specs in the workspace.',
|
|
26
|
+
mimeType: 'application/json',
|
|
27
|
+
tags: TAGS,
|
|
28
|
+
},
|
|
29
|
+
input: z.object({}),
|
|
30
|
+
resolve: async () => {
|
|
31
|
+
const specs = await services.listSpecs();
|
|
32
|
+
return {
|
|
33
|
+
uri: 'contracts://list',
|
|
34
|
+
mimeType: 'application/json',
|
|
35
|
+
data: JSON.stringify(specs, null, 2),
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
resources.register(
|
|
42
|
+
defineResourceTemplate({
|
|
43
|
+
meta: {
|
|
44
|
+
uriTemplate: 'contracts://spec/{path}',
|
|
45
|
+
title: 'Contract spec content',
|
|
46
|
+
description: 'Read a single contract spec file by path.',
|
|
47
|
+
mimeType: 'text/plain',
|
|
48
|
+
tags: TAGS,
|
|
49
|
+
},
|
|
50
|
+
input: z.object({ path: z.string() }),
|
|
51
|
+
resolve: async ({ path }) => {
|
|
52
|
+
const result = await services.getSpec(path);
|
|
53
|
+
if (!result) {
|
|
54
|
+
return {
|
|
55
|
+
uri: `contracts://spec/${encodeURIComponent(path)}`,
|
|
56
|
+
mimeType: 'text/plain',
|
|
57
|
+
data: `Spec not found: ${path}`,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
uri: `contracts://spec/${encodeURIComponent(path)}`,
|
|
62
|
+
mimeType: 'text/plain',
|
|
63
|
+
data: result.content,
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
resources.register(
|
|
70
|
+
defineResourceTemplate({
|
|
71
|
+
meta: {
|
|
72
|
+
uriTemplate: 'contracts://registry/manifest',
|
|
73
|
+
title: 'Remote registry manifest',
|
|
74
|
+
description: 'Contract registry manifest from the remote server.',
|
|
75
|
+
mimeType: 'application/json',
|
|
76
|
+
tags: TAGS,
|
|
77
|
+
},
|
|
78
|
+
input: z.object({}),
|
|
79
|
+
resolve: async () => {
|
|
80
|
+
const manifest = await services.fetchRegistryManifest();
|
|
81
|
+
return {
|
|
82
|
+
uri: 'contracts://registry/manifest',
|
|
83
|
+
mimeType: 'application/json',
|
|
84
|
+
data: JSON.stringify(manifest, null, 2),
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
return resources;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function buildContractsPrompts() {
|
|
94
|
+
const prompts = new PromptRegistry();
|
|
95
|
+
|
|
96
|
+
prompts.register(
|
|
97
|
+
definePrompt({
|
|
98
|
+
meta: {
|
|
99
|
+
key: 'contracts.editor',
|
|
100
|
+
version: '1.0.0',
|
|
101
|
+
title: 'Contract editing guide',
|
|
102
|
+
description:
|
|
103
|
+
'Guide AI agents through reading, editing, and validating contracts.',
|
|
104
|
+
tags: TAGS,
|
|
105
|
+
stability: 'beta',
|
|
106
|
+
owners: OWNERS,
|
|
107
|
+
},
|
|
108
|
+
args: [
|
|
109
|
+
{
|
|
110
|
+
name: 'goal',
|
|
111
|
+
description: 'What the agent wants to achieve with the contract.',
|
|
112
|
+
required: false,
|
|
113
|
+
schema: z.string().optional(),
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
input: z.object({ goal: z.string().optional() }),
|
|
117
|
+
render: async ({ goal }) => [
|
|
118
|
+
{
|
|
119
|
+
type: 'text' as const,
|
|
120
|
+
text: [
|
|
121
|
+
'Contract editing workflow:',
|
|
122
|
+
'1. Use contracts.list to discover specs',
|
|
123
|
+
'2. Use contracts.get to read a spec',
|
|
124
|
+
'3. Edit content and call contracts.update',
|
|
125
|
+
'4. Run contracts.validate to verify changes',
|
|
126
|
+
'5. Run contracts.build to regenerate artifacts',
|
|
127
|
+
goal ? `Agent goal: ${goal}` : '',
|
|
128
|
+
]
|
|
129
|
+
.filter(Boolean)
|
|
130
|
+
.join('\n'),
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: 'resource' as const,
|
|
134
|
+
uri: 'contracts://list',
|
|
135
|
+
title: 'Available contracts',
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
return prompts;
|
|
142
|
+
}
|