@contractspec/bundle.library 3.7.6 → 3.7.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.
Files changed (889) hide show
  1. package/.turbo/turbo-build.log +144 -142
  2. package/AGENTS.md +42 -24
  3. package/README.md +59 -37
  4. package/dist/application/index.d.ts +1 -1
  5. package/dist/application/index.js +842 -840
  6. package/dist/application/mcp/cliMcp.js +30 -30
  7. package/dist/application/mcp/common.d.ts +2 -2
  8. package/dist/application/mcp/common.js +2 -2
  9. package/dist/application/mcp/contractsMcp.d.ts +1 -1
  10. package/dist/application/mcp/contractsMcp.js +163 -163
  11. package/dist/application/mcp/docsMcp.js +31 -31
  12. package/dist/application/mcp/index.d.ts +2 -2
  13. package/dist/application/mcp/index.js +842 -840
  14. package/dist/application/mcp/internalMcp.js +30 -30
  15. package/dist/application/mcp/providerRankingMcp.js +35 -33
  16. package/dist/components/docs/DocsIndexPage.js +859 -212
  17. package/dist/components/docs/advanced/AdvancedMCPPage.js +15 -15
  18. package/dist/components/docs/advanced/AdvancedOverlayEditorPage.js +4 -4
  19. package/dist/components/docs/advanced/AdvancedRenderersPage.js +7 -7
  20. package/dist/components/docs/advanced/AdvancedSpecExperimentsPage.js +9 -9
  21. package/dist/components/docs/advanced/AdvancedTelemetryPage.js +16 -16
  22. package/dist/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +6 -6
  23. package/dist/components/docs/advanced/index.d.ts +2 -2
  24. package/dist/components/docs/advanced/index.js +57 -57
  25. package/dist/components/docs/architecture/ArchitectureAppConfigPage.js +10 -10
  26. package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +8 -8
  27. package/dist/components/docs/architecture/ArchitectureIntegrationBindingPage.js +14 -14
  28. package/dist/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +16 -16
  29. package/dist/components/docs/architecture/ArchitectureMultiTenancyPage.js +7 -7
  30. package/dist/components/docs/architecture/ArchitectureOverviewPage.js +90 -411
  31. package/dist/components/docs/architecture/index.d.ts +3 -3
  32. package/dist/components/docs/architecture/index.js +145 -466
  33. package/dist/components/docs/comparison/ComparisonAutomationPlatformsPage.js +6 -6
  34. package/dist/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +7 -7
  35. package/dist/components/docs/comparison/ComparisonInternalToolBuildersPage.js +6 -6
  36. package/dist/components/docs/comparison/ComparisonOverviewPage.js +4 -4
  37. package/dist/components/docs/comparison/ComparisonWindmillPage.js +6 -6
  38. package/dist/components/docs/comparison/ComparisonWorkflowEnginesPage.js +6 -6
  39. package/dist/components/docs/comparison/index.d.ts +2 -2
  40. package/dist/components/docs/comparison/index.js +35 -35
  41. package/dist/components/docs/docsManifest.d.ts +42 -0
  42. package/dist/components/docs/docsManifest.js +612 -0
  43. package/dist/components/docs/ecosystem/IntegrationsPage.js +5 -5
  44. package/dist/components/docs/ecosystem/PluginsPage.js +7 -7
  45. package/dist/components/docs/ecosystem/RegistryPage.js +4 -4
  46. package/dist/components/docs/ecosystem/TemplatesPage.js +11 -11
  47. package/dist/components/docs/ecosystem/index.d.ts +2 -2
  48. package/dist/components/docs/ecosystem/index.js +27 -27
  49. package/dist/components/docs/examples/DocsExamplesPage.js +4 -4
  50. package/dist/components/docs/examples/index.js +4 -4
  51. package/dist/components/docs/getting-started/CLIPage.js +9 -9
  52. package/dist/components/docs/getting-started/CompatibilityPage.js +12 -12
  53. package/dist/components/docs/getting-started/DataViewTutorialPage.js +7 -7
  54. package/dist/components/docs/getting-started/DeveloperToolsPage.js +10 -10
  55. package/dist/components/docs/getting-started/HelloWorldPage.js +8 -8
  56. package/dist/components/docs/getting-started/InstallationPage.js +10 -10
  57. package/dist/components/docs/getting-started/StartHerePage.js +8 -8
  58. package/dist/components/docs/getting-started/TroubleshootingPage.js +12 -12
  59. package/dist/components/docs/getting-started/VSCodeExtensionPage.js +13 -13
  60. package/dist/components/docs/getting-started/index.d.ts +5 -5
  61. package/dist/components/docs/getting-started/index.js +89 -89
  62. package/dist/components/docs/guides/GuideCIDiffGatingPage.js +13 -13
  63. package/dist/components/docs/guides/GuideContractTypesPage.js +33 -33
  64. package/dist/components/docs/guides/GuideDocsPipelinePage.js +13 -13
  65. package/dist/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +13 -13
  66. package/dist/components/docs/guides/GuideImportExistingCodebasesPage.js +35 -35
  67. package/dist/components/docs/guides/GuideNextjsOneEndpointPage.js +15 -15
  68. package/dist/components/docs/guides/GuideSpecValidationTypingPage.js +13 -13
  69. package/dist/components/docs/guides/GuidesIndexPage.js +69 -46
  70. package/dist/components/docs/guides/index.d.ts +4 -4
  71. package/dist/components/docs/guides/index.js +174 -151
  72. package/dist/components/docs/index.d.ts +13 -12
  73. package/dist/components/docs/index.js +14060 -15332
  74. package/dist/components/docs/integrations/IntegrationsCircuitBreakersPage.js +4 -4
  75. package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +7 -7
  76. package/dist/components/docs/integrations/IntegrationsGithubPage.js +11 -11
  77. package/dist/components/docs/integrations/IntegrationsGmailPage.js +7 -7
  78. package/dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js +5 -5
  79. package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +12 -12
  80. package/dist/components/docs/integrations/IntegrationsMistralPage.js +12 -12
  81. package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +11 -11
  82. package/dist/components/docs/integrations/IntegrationsOverviewPage.js +119 -736
  83. package/dist/components/docs/integrations/IntegrationsPostmarkPage.js +12 -12
  84. package/dist/components/docs/integrations/IntegrationsPowensPage.js +24 -24
  85. package/dist/components/docs/integrations/IntegrationsQdrantPage.js +9 -9
  86. package/dist/components/docs/integrations/IntegrationsResendPage.js +7 -7
  87. package/dist/components/docs/integrations/IntegrationsS3Page.js +9 -9
  88. package/dist/components/docs/integrations/IntegrationsSlackPage.js +11 -11
  89. package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +19 -19
  90. package/dist/components/docs/integrations/IntegrationsStripePage.js +25 -25
  91. package/dist/components/docs/integrations/IntegrationsTwilioPage.js +9 -9
  92. package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +12 -12
  93. package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +13 -13
  94. package/dist/components/docs/integrations/index.d.ts +1 -1
  95. package/dist/components/docs/integrations/index.js +614 -1231
  96. package/dist/components/docs/intent/ContractFirstApiPage.js +8 -8
  97. package/dist/components/docs/intent/DeterministicCodegenPage.js +9 -9
  98. package/dist/components/docs/intent/GenerateClientFromSchemaPage.js +13 -13
  99. package/dist/components/docs/intent/OpenapiAlternativePage.js +13 -13
  100. package/dist/components/docs/intent/SchemaValidationTypescriptPage.js +9 -9
  101. package/dist/components/docs/intent/SpecDrivenDevelopmentPage.js +8 -8
  102. package/dist/components/docs/intent/index.d.ts +3 -3
  103. package/dist/components/docs/intent/index.js +766 -766
  104. package/dist/components/docs/knowledge/KnowledgeCategoriesPage.js +38 -38
  105. package/dist/components/docs/knowledge/KnowledgeExamplesPage.js +9 -9
  106. package/dist/components/docs/knowledge/KnowledgeOverviewPage.js +91 -439
  107. package/dist/components/docs/knowledge/KnowledgeSourcesPage.js +28 -28
  108. package/dist/components/docs/knowledge/KnowledgeSpacesPage.js +21 -21
  109. package/dist/components/docs/knowledge/index.d.ts +1 -1
  110. package/dist/components/docs/knowledge/index.js +437 -785
  111. package/dist/components/docs/libraries/LibrariesAccessibilityPage.js +16 -16
  112. package/dist/components/docs/libraries/LibrariesAiAgentPage.js +8 -8
  113. package/dist/components/docs/libraries/LibrariesAnalyticsPage.js +6 -6
  114. package/dist/components/docs/libraries/LibrariesContentGenPage.js +6 -6
  115. package/dist/components/docs/libraries/LibrariesContractsPage.js +16 -16
  116. package/dist/components/docs/libraries/LibrariesCostTrackingPage.js +6 -6
  117. package/dist/components/docs/libraries/LibrariesDataBackendPage.js +14 -14
  118. package/dist/components/docs/libraries/LibrariesDataViewsPage.js +7 -7
  119. package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +13 -13
  120. package/dist/components/docs/libraries/LibrariesEvolutionPage.js +7 -7
  121. package/dist/components/docs/libraries/LibrariesGraphQLPage.js +13 -13
  122. package/dist/components/docs/libraries/LibrariesGrowthPage.js +5 -5
  123. package/dist/components/docs/libraries/LibrariesMultiTenancyPage.js +5 -5
  124. package/dist/components/docs/libraries/LibrariesObservabilityPage.js +7 -7
  125. package/dist/components/docs/libraries/LibrariesOverlayEnginePage.js +6 -6
  126. package/dist/components/docs/libraries/LibrariesOverviewPage.js +117 -430
  127. package/dist/components/docs/libraries/LibrariesPersonalizationPage.js +6 -6
  128. package/dist/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +6 -6
  129. package/dist/components/docs/libraries/LibrariesResiliencePage.js +6 -6
  130. package/dist/components/docs/libraries/LibrariesRuntimePage.js +13 -13
  131. package/dist/components/docs/libraries/LibrariesSLOPage.js +6 -6
  132. package/dist/components/docs/libraries/LibrariesSchemaPage.js +16 -16
  133. package/dist/components/docs/libraries/LibrariesSupportBotPage.js +7 -7
  134. package/dist/components/docs/libraries/LibrariesTestingPage.js +7 -7
  135. package/dist/components/docs/libraries/LibrariesUIKitPage.js +10 -10
  136. package/dist/components/docs/libraries/LibrariesWorkflowComposerPage.js +5 -5
  137. package/dist/components/docs/libraries/LibrariesWorkflowsPage.js +8 -8
  138. package/dist/components/docs/libraries/index.d.ts +4 -4
  139. package/dist/components/docs/libraries/index.js +1308 -1621
  140. package/dist/components/docs/manifesto/ManifestoPage.js +33 -138
  141. package/dist/components/docs/ops/AutoEvolutionOpsPage.js +9 -9
  142. package/dist/components/docs/ops/DistributedTracingOpsPage.js +5 -5
  143. package/dist/components/docs/ops/index.js +14 -14
  144. package/dist/components/docs/reference/DocsMarkdownContent.js +1 -1
  145. package/dist/components/docs/reference/DocsReferenceContent.js +2 -2
  146. package/dist/components/docs/reference/DocsReferenceIndexClient.js +8 -8
  147. package/dist/components/docs/reference/DocsReferenceIndexPage.js +8 -8
  148. package/dist/components/docs/reference/DocsReferencePage.js +2 -2
  149. package/dist/components/docs/reference/index.js +10 -10
  150. package/dist/components/docs/safety/SafetyAuditingPage.js +16 -16
  151. package/dist/components/docs/safety/SafetyMigrationsPage.js +15 -15
  152. package/dist/components/docs/safety/SafetyOverviewPage.js +69 -206
  153. package/dist/components/docs/safety/SafetyPDPPage.js +12 -12
  154. package/dist/components/docs/safety/SafetySecurityTrustPage.js +11 -11
  155. package/dist/components/docs/safety/SafetySigningPage.js +7 -7
  156. package/dist/components/docs/safety/SafetyTenantIsolationPage.js +6 -6
  157. package/dist/components/docs/safety/index.d.ts +3 -3
  158. package/dist/components/docs/safety/index.js +616 -753
  159. package/dist/components/docs/shared/StudioPrompt.js +5 -5
  160. package/dist/components/docs/specs/SpecsCapabilitiesPage.js +12 -12
  161. package/dist/components/docs/specs/SpecsDataViewsPage.js +14 -14
  162. package/dist/components/docs/specs/SpecsOverlaysPage.js +14 -14
  163. package/dist/components/docs/specs/SpecsOverviewPage.js +135 -297
  164. package/dist/components/docs/specs/SpecsPolicyPage.js +29 -29
  165. package/dist/components/docs/specs/SpecsWorkflowsPage.js +18 -18
  166. package/dist/components/docs/specs/index.d.ts +3 -3
  167. package/dist/components/docs/specs/index.js +814 -976
  168. package/dist/components/docs/studio/StudioBYOKPage.js +1 -1
  169. package/dist/components/docs/studio/StudioDeploymentsPage.js +1 -1
  170. package/dist/components/docs/studio/StudioGettingStartedPage.js +1 -1
  171. package/dist/components/docs/studio/StudioIntegrationsPage.js +1 -1
  172. package/dist/components/docs/studio/StudioOverviewPage.js +109 -56
  173. package/dist/components/docs/studio/StudioVisualBuilderPage.js +1 -1
  174. package/dist/components/docs/studio/index.d.ts +4 -4
  175. package/dist/components/docs/studio/index.js +170 -117
  176. package/dist/components/integrations/index.js +25 -25
  177. package/dist/components/integrations/molecules/IntegrationCard.js +5 -5
  178. package/dist/components/integrations/organisms/IntegrationMarketplace.js +12 -12
  179. package/dist/components/integrations/organisms/IntegrationSettings.js +7 -7
  180. package/dist/components/integrations/organisms/KnowledgeSourceList.js +6 -6
  181. package/dist/components/legal/PrivacyTemplate.js +67 -67
  182. package/dist/components/legal/TermsTemplate.js +54 -54
  183. package/dist/components/legal/index.js +121 -121
  184. package/dist/components/shared/FeatureGateNotice.js +4 -4
  185. package/dist/components/shared/index.js +4 -4
  186. package/dist/components/shell/WorkspaceHeader.js +4 -4
  187. package/dist/components/shell/WorkspaceProjectShellLayout.d.ts +3 -3
  188. package/dist/components/shell/WorkspaceProjectShellLayout.js +10 -10
  189. package/dist/components/shell/WorkspaceShellRenderer.d.ts +4 -4
  190. package/dist/components/shell/WorkspaceShellRenderer.js +8 -8
  191. package/dist/components/shell/WorkspaceSidebar.js +2 -2
  192. package/dist/components/shell/index.d.ts +1 -1
  193. package/dist/components/shell/index.js +12 -12
  194. package/dist/components/templates/engine/index.d.ts +1 -1
  195. package/dist/components/templates/index.d.ts +1 -1
  196. package/dist/components/templates/index.js +835 -835
  197. package/dist/components/templates/messaging/ConversationList.js +11 -11
  198. package/dist/components/templates/messaging/MessageComposer.js +11 -11
  199. package/dist/components/templates/messaging/MessageThread.js +6 -6
  200. package/dist/components/templates/messaging/MessagingWorkspace.js +23 -23
  201. package/dist/components/templates/messaging/index.d.ts +1 -1
  202. package/dist/components/templates/messaging/index.js +23 -23
  203. package/dist/components/templates/recipes/LanguageSwitcher.js +1 -1
  204. package/dist/components/templates/recipes/RecipeCard.js +5 -5
  205. package/dist/components/templates/recipes/RecipeDetail.js +8 -8
  206. package/dist/components/templates/recipes/RecipeList.js +17 -17
  207. package/dist/components/templates/recipes/index.d.ts +2 -2
  208. package/dist/components/templates/recipes/index.js +17 -17
  209. package/dist/components/templates/todos/FilterBar.d.ts +1 -1
  210. package/dist/components/templates/todos/FilterBar.js +9 -9
  211. package/dist/components/templates/todos/TaskForm.js +14 -14
  212. package/dist/components/templates/todos/TaskItem.js +4 -4
  213. package/dist/components/templates/todos/TaskList.js +30 -30
  214. package/dist/components/templates/todos/index.d.ts +2 -2
  215. package/dist/components/templates/todos/index.js +30 -30
  216. package/dist/config/index.d.ts +2 -2
  217. package/dist/features/contracts-registry.d.ts +3 -3
  218. package/dist/features/contracts-registry.js +15 -15
  219. package/dist/features/docs/docs.contracts.d.ts +1 -1
  220. package/dist/features/docs/docs.contracts.js +2 -2
  221. package/dist/features/docs/index.d.ts +1 -1
  222. package/dist/features/docs/index.js +2 -2
  223. package/dist/features/index.d.ts +4 -4
  224. package/dist/features/index.js +18 -18
  225. package/dist/features/registry.js +1 -1
  226. package/dist/index.d.ts +2 -2
  227. package/dist/index.js +14982 -16254
  228. package/dist/libs/email/client.js +1 -1
  229. package/dist/libs/email/contact.js +1 -1
  230. package/dist/libs/email/newsletter.js +1 -1
  231. package/dist/libs/email/waitlist-application.js +1 -1
  232. package/dist/libs/email/waitlist.js +1 -1
  233. package/dist/libs/email.d.ts +1 -1
  234. package/dist/libs/email.js +1 -1
  235. package/dist/node/application/index.js +842 -840
  236. package/dist/node/application/mcp/cliMcp.js +30 -30
  237. package/dist/node/application/mcp/common.js +2 -2
  238. package/dist/node/application/mcp/contractsMcp.js +163 -163
  239. package/dist/node/application/mcp/docsMcp.js +31 -31
  240. package/dist/node/application/mcp/index.js +842 -840
  241. package/dist/node/application/mcp/internalMcp.js +30 -30
  242. package/dist/node/application/mcp/providerRankingMcp.js +35 -33
  243. package/dist/node/components/docs/DocsIndexPage.js +859 -212
  244. package/dist/node/components/docs/advanced/AdvancedMCPPage.js +15 -15
  245. package/dist/node/components/docs/advanced/AdvancedOverlayEditorPage.js +4 -4
  246. package/dist/node/components/docs/advanced/AdvancedRenderersPage.js +7 -7
  247. package/dist/node/components/docs/advanced/AdvancedSpecExperimentsPage.js +9 -9
  248. package/dist/node/components/docs/advanced/AdvancedTelemetryPage.js +16 -16
  249. package/dist/node/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +6 -6
  250. package/dist/node/components/docs/advanced/index.js +57 -57
  251. package/dist/node/components/docs/architecture/ArchitectureAppConfigPage.js +10 -10
  252. package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +8 -8
  253. package/dist/node/components/docs/architecture/ArchitectureIntegrationBindingPage.js +14 -14
  254. package/dist/node/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +16 -16
  255. package/dist/node/components/docs/architecture/ArchitectureMultiTenancyPage.js +7 -7
  256. package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +90 -411
  257. package/dist/node/components/docs/architecture/index.js +145 -466
  258. package/dist/node/components/docs/comparison/ComparisonAutomationPlatformsPage.js +6 -6
  259. package/dist/node/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +7 -7
  260. package/dist/node/components/docs/comparison/ComparisonInternalToolBuildersPage.js +6 -6
  261. package/dist/node/components/docs/comparison/ComparisonOverviewPage.js +4 -4
  262. package/dist/node/components/docs/comparison/ComparisonWindmillPage.js +6 -6
  263. package/dist/node/components/docs/comparison/ComparisonWorkflowEnginesPage.js +6 -6
  264. package/dist/node/components/docs/comparison/index.js +35 -35
  265. package/dist/node/components/docs/docsManifest.js +611 -0
  266. package/dist/node/components/docs/ecosystem/IntegrationsPage.js +5 -5
  267. package/dist/node/components/docs/ecosystem/PluginsPage.js +7 -7
  268. package/dist/node/components/docs/ecosystem/RegistryPage.js +4 -4
  269. package/dist/node/components/docs/ecosystem/TemplatesPage.js +11 -11
  270. package/dist/node/components/docs/ecosystem/index.js +27 -27
  271. package/dist/node/components/docs/examples/DocsExamplesPage.js +4 -4
  272. package/dist/node/components/docs/examples/index.js +4 -4
  273. package/dist/node/components/docs/getting-started/CLIPage.js +9 -9
  274. package/dist/node/components/docs/getting-started/CompatibilityPage.js +12 -12
  275. package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +7 -7
  276. package/dist/node/components/docs/getting-started/DeveloperToolsPage.js +10 -10
  277. package/dist/node/components/docs/getting-started/HelloWorldPage.js +8 -8
  278. package/dist/node/components/docs/getting-started/InstallationPage.js +10 -10
  279. package/dist/node/components/docs/getting-started/StartHerePage.js +8 -8
  280. package/dist/node/components/docs/getting-started/TroubleshootingPage.js +12 -12
  281. package/dist/node/components/docs/getting-started/VSCodeExtensionPage.js +13 -13
  282. package/dist/node/components/docs/getting-started/index.js +89 -89
  283. package/dist/node/components/docs/guides/GuideCIDiffGatingPage.js +13 -13
  284. package/dist/node/components/docs/guides/GuideContractTypesPage.js +33 -33
  285. package/dist/node/components/docs/guides/GuideDocsPipelinePage.js +13 -13
  286. package/dist/node/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +13 -13
  287. package/dist/node/components/docs/guides/GuideImportExistingCodebasesPage.js +35 -35
  288. package/dist/node/components/docs/guides/GuideNextjsOneEndpointPage.js +15 -15
  289. package/dist/node/components/docs/guides/GuideSpecValidationTypingPage.js +13 -13
  290. package/dist/node/components/docs/guides/GuidesIndexPage.js +69 -46
  291. package/dist/node/components/docs/guides/index.js +174 -151
  292. package/dist/node/components/docs/index.js +14060 -15332
  293. package/dist/node/components/docs/integrations/IntegrationsCircuitBreakersPage.js +4 -4
  294. package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +7 -7
  295. package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +11 -11
  296. package/dist/node/components/docs/integrations/IntegrationsGmailPage.js +7 -7
  297. package/dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js +5 -5
  298. package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +12 -12
  299. package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +12 -12
  300. package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +11 -11
  301. package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +119 -736
  302. package/dist/node/components/docs/integrations/IntegrationsPostmarkPage.js +12 -12
  303. package/dist/node/components/docs/integrations/IntegrationsPowensPage.js +24 -24
  304. package/dist/node/components/docs/integrations/IntegrationsQdrantPage.js +9 -9
  305. package/dist/node/components/docs/integrations/IntegrationsResendPage.js +7 -7
  306. package/dist/node/components/docs/integrations/IntegrationsS3Page.js +9 -9
  307. package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +11 -11
  308. package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +19 -19
  309. package/dist/node/components/docs/integrations/IntegrationsStripePage.js +25 -25
  310. package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +9 -9
  311. package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +12 -12
  312. package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +13 -13
  313. package/dist/node/components/docs/integrations/index.js +614 -1231
  314. package/dist/node/components/docs/intent/ContractFirstApiPage.js +8 -8
  315. package/dist/node/components/docs/intent/DeterministicCodegenPage.js +9 -9
  316. package/dist/node/components/docs/intent/GenerateClientFromSchemaPage.js +13 -13
  317. package/dist/node/components/docs/intent/OpenapiAlternativePage.js +13 -13
  318. package/dist/node/components/docs/intent/SchemaValidationTypescriptPage.js +9 -9
  319. package/dist/node/components/docs/intent/SpecDrivenDevelopmentPage.js +8 -8
  320. package/dist/node/components/docs/intent/index.js +766 -766
  321. package/dist/node/components/docs/knowledge/KnowledgeCategoriesPage.js +38 -38
  322. package/dist/node/components/docs/knowledge/KnowledgeExamplesPage.js +9 -9
  323. package/dist/node/components/docs/knowledge/KnowledgeOverviewPage.js +91 -439
  324. package/dist/node/components/docs/knowledge/KnowledgeSourcesPage.js +28 -28
  325. package/dist/node/components/docs/knowledge/KnowledgeSpacesPage.js +21 -21
  326. package/dist/node/components/docs/knowledge/index.js +437 -785
  327. package/dist/node/components/docs/libraries/LibrariesAccessibilityPage.js +16 -16
  328. package/dist/node/components/docs/libraries/LibrariesAiAgentPage.js +8 -8
  329. package/dist/node/components/docs/libraries/LibrariesAnalyticsPage.js +6 -6
  330. package/dist/node/components/docs/libraries/LibrariesContentGenPage.js +6 -6
  331. package/dist/node/components/docs/libraries/LibrariesContractsPage.js +16 -16
  332. package/dist/node/components/docs/libraries/LibrariesCostTrackingPage.js +6 -6
  333. package/dist/node/components/docs/libraries/LibrariesDataBackendPage.js +14 -14
  334. package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +7 -7
  335. package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +13 -13
  336. package/dist/node/components/docs/libraries/LibrariesEvolutionPage.js +7 -7
  337. package/dist/node/components/docs/libraries/LibrariesGraphQLPage.js +13 -13
  338. package/dist/node/components/docs/libraries/LibrariesGrowthPage.js +5 -5
  339. package/dist/node/components/docs/libraries/LibrariesMultiTenancyPage.js +5 -5
  340. package/dist/node/components/docs/libraries/LibrariesObservabilityPage.js +7 -7
  341. package/dist/node/components/docs/libraries/LibrariesOverlayEnginePage.js +6 -6
  342. package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +117 -430
  343. package/dist/node/components/docs/libraries/LibrariesPersonalizationPage.js +6 -6
  344. package/dist/node/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +6 -6
  345. package/dist/node/components/docs/libraries/LibrariesResiliencePage.js +6 -6
  346. package/dist/node/components/docs/libraries/LibrariesRuntimePage.js +13 -13
  347. package/dist/node/components/docs/libraries/LibrariesSLOPage.js +6 -6
  348. package/dist/node/components/docs/libraries/LibrariesSchemaPage.js +16 -16
  349. package/dist/node/components/docs/libraries/LibrariesSupportBotPage.js +7 -7
  350. package/dist/node/components/docs/libraries/LibrariesTestingPage.js +7 -7
  351. package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +10 -10
  352. package/dist/node/components/docs/libraries/LibrariesWorkflowComposerPage.js +5 -5
  353. package/dist/node/components/docs/libraries/LibrariesWorkflowsPage.js +8 -8
  354. package/dist/node/components/docs/libraries/index.js +1308 -1621
  355. package/dist/node/components/docs/manifesto/ManifestoPage.js +33 -138
  356. package/dist/node/components/docs/ops/AutoEvolutionOpsPage.js +9 -9
  357. package/dist/node/components/docs/ops/DistributedTracingOpsPage.js +5 -5
  358. package/dist/node/components/docs/ops/index.js +14 -14
  359. package/dist/node/components/docs/reference/DocsMarkdownContent.js +1 -1
  360. package/dist/node/components/docs/reference/DocsReferenceContent.js +2 -2
  361. package/dist/node/components/docs/reference/DocsReferenceIndexClient.js +8 -8
  362. package/dist/node/components/docs/reference/DocsReferenceIndexPage.js +8 -8
  363. package/dist/node/components/docs/reference/DocsReferencePage.js +2 -2
  364. package/dist/node/components/docs/reference/index.js +10 -10
  365. package/dist/node/components/docs/safety/SafetyAuditingPage.js +16 -16
  366. package/dist/node/components/docs/safety/SafetyMigrationsPage.js +15 -15
  367. package/dist/node/components/docs/safety/SafetyOverviewPage.js +69 -206
  368. package/dist/node/components/docs/safety/SafetyPDPPage.js +12 -12
  369. package/dist/node/components/docs/safety/SafetySecurityTrustPage.js +11 -11
  370. package/dist/node/components/docs/safety/SafetySigningPage.js +7 -7
  371. package/dist/node/components/docs/safety/SafetyTenantIsolationPage.js +6 -6
  372. package/dist/node/components/docs/safety/index.js +616 -753
  373. package/dist/node/components/docs/shared/StudioPrompt.js +5 -5
  374. package/dist/node/components/docs/specs/SpecsCapabilitiesPage.js +12 -12
  375. package/dist/node/components/docs/specs/SpecsDataViewsPage.js +14 -14
  376. package/dist/node/components/docs/specs/SpecsOverlaysPage.js +14 -14
  377. package/dist/node/components/docs/specs/SpecsOverviewPage.js +135 -297
  378. package/dist/node/components/docs/specs/SpecsPolicyPage.js +29 -29
  379. package/dist/node/components/docs/specs/SpecsWorkflowsPage.js +18 -18
  380. package/dist/node/components/docs/specs/index.js +814 -976
  381. package/dist/node/components/docs/studio/StudioBYOKPage.js +1 -1
  382. package/dist/node/components/docs/studio/StudioDeploymentsPage.js +1 -1
  383. package/dist/node/components/docs/studio/StudioGettingStartedPage.js +1 -1
  384. package/dist/node/components/docs/studio/StudioIntegrationsPage.js +1 -1
  385. package/dist/node/components/docs/studio/StudioOverviewPage.js +109 -56
  386. package/dist/node/components/docs/studio/StudioVisualBuilderPage.js +1 -1
  387. package/dist/node/components/docs/studio/index.js +170 -117
  388. package/dist/node/components/integrations/index.js +25 -25
  389. package/dist/node/components/integrations/molecules/IntegrationCard.js +5 -5
  390. package/dist/node/components/integrations/organisms/IntegrationMarketplace.js +12 -12
  391. package/dist/node/components/integrations/organisms/IntegrationSettings.js +7 -7
  392. package/dist/node/components/integrations/organisms/KnowledgeSourceList.js +6 -6
  393. package/dist/node/components/legal/PrivacyTemplate.js +67 -67
  394. package/dist/node/components/legal/TermsTemplate.js +54 -54
  395. package/dist/node/components/legal/index.js +121 -121
  396. package/dist/node/components/shared/FeatureGateNotice.js +4 -4
  397. package/dist/node/components/shared/index.js +4 -4
  398. package/dist/node/components/shell/WorkspaceHeader.js +4 -4
  399. package/dist/node/components/shell/WorkspaceProjectShellLayout.js +10 -10
  400. package/dist/node/components/shell/WorkspaceShellRenderer.js +8 -8
  401. package/dist/node/components/shell/WorkspaceSidebar.js +2 -2
  402. package/dist/node/components/shell/index.js +12 -12
  403. package/dist/node/components/templates/index.js +835 -835
  404. package/dist/node/components/templates/messaging/ConversationList.js +11 -11
  405. package/dist/node/components/templates/messaging/MessageComposer.js +11 -11
  406. package/dist/node/components/templates/messaging/MessageThread.js +6 -6
  407. package/dist/node/components/templates/messaging/MessagingWorkspace.js +23 -23
  408. package/dist/node/components/templates/messaging/index.js +23 -23
  409. package/dist/node/components/templates/recipes/LanguageSwitcher.js +1 -1
  410. package/dist/node/components/templates/recipes/RecipeCard.js +5 -5
  411. package/dist/node/components/templates/recipes/RecipeDetail.js +8 -8
  412. package/dist/node/components/templates/recipes/RecipeList.js +17 -17
  413. package/dist/node/components/templates/recipes/index.js +17 -17
  414. package/dist/node/components/templates/todos/FilterBar.js +9 -9
  415. package/dist/node/components/templates/todos/TaskForm.js +14 -14
  416. package/dist/node/components/templates/todos/TaskItem.js +4 -4
  417. package/dist/node/components/templates/todos/TaskList.js +30 -30
  418. package/dist/node/components/templates/todos/index.js +30 -30
  419. package/dist/node/features/contracts-registry.js +15 -15
  420. package/dist/node/features/docs/docs.contracts.js +2 -2
  421. package/dist/node/features/docs/index.js +2 -2
  422. package/dist/node/features/index.js +18 -18
  423. package/dist/node/features/registry.js +1 -1
  424. package/dist/node/index.js +14982 -16254
  425. package/dist/node/libs/email/client.js +1 -1
  426. package/dist/node/libs/email/contact.js +1 -1
  427. package/dist/node/libs/email/newsletter.js +1 -1
  428. package/dist/node/libs/email/waitlist-application.js +1 -1
  429. package/dist/node/libs/email/waitlist.js +1 -1
  430. package/dist/node/libs/email.js +1 -1
  431. package/dist/node/presentation/features/atoms/FeatureIcon/FeatureIcon.js +7 -7
  432. package/dist/node/presentation/features/atoms/FeatureIcon/index.js +7 -7
  433. package/dist/node/presentation/features/atoms/index.js +7 -7
  434. package/dist/node/presentation/features/hooks/index.js +56 -56
  435. package/dist/node/presentation/features/hooks/useContractsRegistry.js +18 -18
  436. package/dist/node/presentation/features/hooks/useFeatureFilters.js +1 -1
  437. package/dist/node/presentation/features/hooks/useFeatureRegistry.js +1 -1
  438. package/dist/node/presentation/features/hooks/useRelatedDocs.js +1 -1
  439. package/dist/node/presentation/features/index.js +1364 -1364
  440. package/dist/node/presentation/features/molecules/FeatureCard/FeatureCard.js +15 -15
  441. package/dist/node/presentation/features/molecules/FeatureCard/index.js +15 -15
  442. package/dist/node/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +7 -7
  443. package/dist/node/presentation/features/molecules/FeatureCategoryHeader/index.js +7 -7
  444. package/dist/node/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -1
  445. package/dist/node/presentation/features/molecules/FeatureFilters/index.js +1 -1
  446. package/dist/node/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +5 -5
  447. package/dist/node/presentation/features/molecules/FeatureHoverPreview/index.js +5 -5
  448. package/dist/node/presentation/features/molecules/index.js +77 -77
  449. package/dist/node/presentation/features/organisms/FeatureDataViewsList.js +18 -18
  450. package/dist/node/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +121 -121
  451. package/dist/node/presentation/features/organisms/FeatureDiscovery/index.js +121 -121
  452. package/dist/node/presentation/features/organisms/FeatureEventsList.js +18 -18
  453. package/dist/node/presentation/features/organisms/FeatureFormsList.js +18 -18
  454. package/dist/node/presentation/features/organisms/FeatureOperationsList.js +15 -15
  455. package/dist/node/presentation/features/organisms/FeaturePresentationsList.js +18 -18
  456. package/dist/node/presentation/features/organisms/index.js +401 -401
  457. package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +13 -13
  458. package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +13 -13
  459. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +20 -20
  460. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/index.js +20 -20
  461. package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +12 -12
  462. package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/index.js +12 -12
  463. package/dist/node/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +18 -18
  464. package/dist/node/presentation/features/templates/FeatureEventsTemplate/index.js +18 -18
  465. package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +13 -13
  466. package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/index.js +13 -13
  467. package/dist/node/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +20 -20
  468. package/dist/node/presentation/features/templates/FeatureFormsTemplate/index.js +20 -20
  469. package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +8 -8
  470. package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/index.js +8 -8
  471. package/dist/node/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +15 -15
  472. package/dist/node/presentation/features/templates/FeatureOperationsTemplate/index.js +15 -15
  473. package/dist/node/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +2 -2
  474. package/dist/node/presentation/features/templates/FeatureOverviewTemplate/index.js +2 -2
  475. package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +12 -12
  476. package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +12 -12
  477. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +18 -18
  478. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/index.js +18 -18
  479. package/dist/presentation/features/atoms/FeatureIcon/FeatureIcon.js +7 -7
  480. package/dist/presentation/features/atoms/FeatureIcon/index.d.ts +1 -1
  481. package/dist/presentation/features/atoms/FeatureIcon/index.js +7 -7
  482. package/dist/presentation/features/atoms/index.js +7 -7
  483. package/dist/presentation/features/hooks/index.d.ts +3 -3
  484. package/dist/presentation/features/hooks/index.js +56 -56
  485. package/dist/presentation/features/hooks/useContractsRegistry.js +18 -18
  486. package/dist/presentation/features/hooks/useFeatureFilters.js +1 -1
  487. package/dist/presentation/features/hooks/useFeatureRegistry.js +1 -1
  488. package/dist/presentation/features/hooks/useRelatedDocs.js +1 -1
  489. package/dist/presentation/features/index.d.ts +14 -14
  490. package/dist/presentation/features/index.js +1364 -1364
  491. package/dist/presentation/features/molecules/FeatureCard/FeatureCard.js +15 -15
  492. package/dist/presentation/features/molecules/FeatureCard/index.js +15 -15
  493. package/dist/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +7 -7
  494. package/dist/presentation/features/molecules/FeatureCategoryHeader/index.js +7 -7
  495. package/dist/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -1
  496. package/dist/presentation/features/molecules/FeatureFilters/index.js +1 -1
  497. package/dist/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +5 -5
  498. package/dist/presentation/features/molecules/FeatureHoverPreview/index.js +5 -5
  499. package/dist/presentation/features/molecules/index.d.ts +1 -1
  500. package/dist/presentation/features/molecules/index.js +77 -77
  501. package/dist/presentation/features/organisms/FeatureDataViewsList.js +18 -18
  502. package/dist/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +121 -121
  503. package/dist/presentation/features/organisms/FeatureDiscovery/index.d.ts +1 -1
  504. package/dist/presentation/features/organisms/FeatureDiscovery/index.js +121 -121
  505. package/dist/presentation/features/organisms/FeatureEventsList.js +18 -18
  506. package/dist/presentation/features/organisms/FeatureFormsList.js +18 -18
  507. package/dist/presentation/features/organisms/FeatureOperationsList.js +15 -15
  508. package/dist/presentation/features/organisms/FeaturePresentationsList.js +18 -18
  509. package/dist/presentation/features/organisms/index.d.ts +4 -4
  510. package/dist/presentation/features/organisms/index.js +401 -401
  511. package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +13 -13
  512. package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +13 -13
  513. package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/types.d.ts +1 -1
  514. package/dist/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +20 -20
  515. package/dist/presentation/features/templates/FeatureDataViewsTemplate/index.js +20 -20
  516. package/dist/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +12 -12
  517. package/dist/presentation/features/templates/FeatureEventDetailTemplate/index.js +12 -12
  518. package/dist/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +18 -18
  519. package/dist/presentation/features/templates/FeatureEventsTemplate/index.js +18 -18
  520. package/dist/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +13 -13
  521. package/dist/presentation/features/templates/FeatureFormDetailTemplate/index.js +13 -13
  522. package/dist/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +20 -20
  523. package/dist/presentation/features/templates/FeatureFormsTemplate/index.js +20 -20
  524. package/dist/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +8 -8
  525. package/dist/presentation/features/templates/FeatureOperationDetailTemplate/index.js +8 -8
  526. package/dist/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +15 -15
  527. package/dist/presentation/features/templates/FeatureOperationsTemplate/index.js +15 -15
  528. package/dist/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +2 -2
  529. package/dist/presentation/features/templates/FeatureOverviewTemplate/index.js +2 -2
  530. package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +12 -12
  531. package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +12 -12
  532. package/dist/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +18 -18
  533. package/dist/presentation/features/templates/FeaturePresentationsTemplate/index.js +18 -18
  534. package/package.json +38 -24
  535. package/src/__tests__/env-setup.ts +1 -1
  536. package/src/__tests__/mocks/prisma.ts +78 -78
  537. package/src/__tests__/setup.ts +2 -2
  538. package/src/application/context-storage/index.ts +42 -42
  539. package/src/application/index.ts +1 -1
  540. package/src/application/mcp/cliMcp.ts +221 -221
  541. package/src/application/mcp/common.ts +210 -210
  542. package/src/application/mcp/contractsMcp.ts +15 -15
  543. package/src/application/mcp/contractsMcpResources.ts +119 -119
  544. package/src/application/mcp/contractsMcpTools.ts +218 -218
  545. package/src/application/mcp/contractsMcpTypes.ts +35 -35
  546. package/src/application/mcp/docsMcp.ts +173 -173
  547. package/src/application/mcp/index.ts +2 -2
  548. package/src/application/mcp/internalMcp.ts +204 -204
  549. package/src/application/mcp/providerRankingMcp.ts +346 -344
  550. package/src/bundles/LibraryBundle.ts +136 -136
  551. package/src/components/docs/DocsIndexPage.tsx +189 -241
  552. package/src/components/docs/advanced/AdvancedMCPPage.tsx +168 -168
  553. package/src/components/docs/advanced/AdvancedOverlayEditorPage.tsx +52 -52
  554. package/src/components/docs/advanced/AdvancedRenderersPage.tsx +53 -53
  555. package/src/components/docs/advanced/AdvancedSpecExperimentsPage.tsx +48 -48
  556. package/src/components/docs/advanced/AdvancedTelemetryPage.tsx +205 -205
  557. package/src/components/docs/advanced/AdvancedWorkflowMonitoringPage.tsx +42 -42
  558. package/src/components/docs/advanced/index.ts +2 -2
  559. package/src/components/docs/architecture/ArchitectureAppConfigPage.tsx +127 -127
  560. package/src/components/docs/architecture/ArchitectureControlPlanePage.tsx +79 -79
  561. package/src/components/docs/architecture/ArchitectureIntegrationBindingPage.tsx +147 -147
  562. package/src/components/docs/architecture/ArchitectureKnowledgeBindingPage.tsx +193 -193
  563. package/src/components/docs/architecture/ArchitectureMultiTenancyPage.tsx +73 -73
  564. package/src/components/docs/architecture/ArchitectureOverviewPage.tsx +98 -273
  565. package/src/components/docs/architecture/index.ts +3 -3
  566. package/src/components/docs/comparison/ComparisonAutomationPlatformsPage.tsx +137 -137
  567. package/src/components/docs/comparison/ComparisonEnterprisePlatformsPage.tsx +138 -138
  568. package/src/components/docs/comparison/ComparisonInternalToolBuildersPage.tsx +147 -147
  569. package/src/components/docs/comparison/ComparisonOverviewPage.tsx +106 -106
  570. package/src/components/docs/comparison/ComparisonWindmillPage.tsx +143 -143
  571. package/src/components/docs/comparison/ComparisonWorkflowEnginesPage.tsx +168 -168
  572. package/src/components/docs/comparison/index.ts +2 -2
  573. package/src/components/docs/docsManifest.ts +720 -0
  574. package/src/components/docs/ecosystem/IntegrationsPage.tsx +45 -45
  575. package/src/components/docs/ecosystem/PluginsPage.tsx +77 -77
  576. package/src/components/docs/ecosystem/RegistryPage.tsx +48 -48
  577. package/src/components/docs/ecosystem/TemplatesPage.tsx +52 -52
  578. package/src/components/docs/ecosystem/ecosystem.docblocks.ts +42 -42
  579. package/src/components/docs/ecosystem/index.ts +2 -2
  580. package/src/components/docs/examples/DocsExamplesPage.tsx +67 -66
  581. package/src/components/docs/generated/docs-index._common.json +1757 -1757
  582. package/src/components/docs/generated/docs-index.agent-console.json +376 -376
  583. package/src/components/docs/generated/docs-index.ai-chat-assistant.json +8 -8
  584. package/src/components/docs/generated/docs-index.ai-chat.json +104 -104
  585. package/src/components/docs/generated/docs-index.ai-support-bot.json +8 -8
  586. package/src/components/docs/generated/docs-index.analytics-dashboard.json +168 -168
  587. package/src/components/docs/generated/docs-index.app-config.json +136 -136
  588. package/src/components/docs/generated/docs-index.audit-trail.json +48 -48
  589. package/src/components/docs/generated/docs-index.calendar-google.json +8 -8
  590. package/src/components/docs/generated/docs-index.content-generation.json +8 -8
  591. package/src/components/docs/generated/docs-index.crm-pipeline.json +160 -160
  592. package/src/components/docs/generated/docs-index.email-gmail.json +8 -8
  593. package/src/components/docs/generated/docs-index.feature-flags.json +216 -216
  594. package/src/components/docs/generated/docs-index.files.json +176 -176
  595. package/src/components/docs/generated/docs-index.generated.ts +19 -19
  596. package/src/components/docs/generated/docs-index.health.json +96 -96
  597. package/src/components/docs/generated/docs-index.identity-rbac.json +312 -312
  598. package/src/components/docs/generated/docs-index.in-app-docs.json +8 -8
  599. package/src/components/docs/generated/docs-index.integration-hub.json +264 -264
  600. package/src/components/docs/generated/docs-index.integration-posthog.json +8 -8
  601. package/src/components/docs/generated/docs-index.integration-stripe.json +8 -8
  602. package/src/components/docs/generated/docs-index.integration-supabase.json +8 -8
  603. package/src/components/docs/generated/docs-index.jobs.json +136 -136
  604. package/src/components/docs/generated/docs-index.kb-update-pipeline.json +128 -128
  605. package/src/components/docs/generated/docs-index.knowledge-canon.json +8 -8
  606. package/src/components/docs/generated/docs-index.learning-journey-ambient-coach.json +8 -8
  607. package/src/components/docs/generated/docs-index.learning-journey-crm-onboarding.json +48 -48
  608. package/src/components/docs/generated/docs-index.learning-journey-duo-drills.json +8 -8
  609. package/src/components/docs/generated/docs-index.learning-journey-platform-tour.json +48 -48
  610. package/src/components/docs/generated/docs-index.learning-journey-quest-challenges.json +8 -8
  611. package/src/components/docs/generated/docs-index.learning-journey-registry.json +32 -32
  612. package/src/components/docs/generated/docs-index.learning-journey-studio-onboarding.json +48 -48
  613. package/src/components/docs/generated/docs-index.learning-journey-ui-coaching.json +8 -8
  614. package/src/components/docs/generated/docs-index.learning-journey-ui-gamified.json +8 -8
  615. package/src/components/docs/generated/docs-index.learning-journey-ui-onboarding.json +8 -8
  616. package/src/components/docs/generated/docs-index.learning-journey-ui-shared.json +8 -8
  617. package/src/components/docs/generated/docs-index.learning-journey.json +216 -216
  618. package/src/components/docs/generated/docs-index.learning-patterns.json +8 -8
  619. package/src/components/docs/generated/docs-index.lifecycle-cli.json +8 -8
  620. package/src/components/docs/generated/docs-index.lifecycle-dashboard.json +8 -8
  621. package/src/components/docs/generated/docs-index.locale-jurisdiction-gate.json +48 -48
  622. package/src/components/docs/generated/docs-index.manifest.json +376 -376
  623. package/src/components/docs/generated/docs-index.marketplace.json +336 -336
  624. package/src/components/docs/generated/docs-index.meeting-recorder-providers.json +8 -8
  625. package/src/components/docs/generated/docs-index.meeting-recorder.json +48 -48
  626. package/src/components/docs/generated/docs-index.metrics.json +200 -200
  627. package/src/components/docs/generated/docs-index.minimal.json +16 -16
  628. package/src/components/docs/generated/docs-index.notifications.json +64 -64
  629. package/src/components/docs/generated/docs-index.openbanking-powens.json +8 -8
  630. package/src/components/docs/generated/docs-index.openbanking.json +64 -64
  631. package/src/components/docs/generated/docs-index.opencode-cli.json +16 -16
  632. package/src/components/docs/generated/docs-index.personalization.json +8 -8
  633. package/src/components/docs/generated/docs-index.platform-acp.json +72 -72
  634. package/src/components/docs/generated/docs-index.platform-agent.json +96 -96
  635. package/src/components/docs/generated/docs-index.platform-context.json +56 -56
  636. package/src/components/docs/generated/docs-index.platform-database.json +48 -48
  637. package/src/components/docs/generated/docs-index.platform-docs.json +88 -88
  638. package/src/components/docs/generated/docs-index.platform-integrations.json +320 -320
  639. package/src/components/docs/generated/docs-index.platform-knowledge.json +56 -56
  640. package/src/components/docs/generated/docs-index.platform-provider-ranking.json +96 -96
  641. package/src/components/docs/generated/docs-index.pocket-family-office.json +120 -120
  642. package/src/components/docs/generated/docs-index.policy-safe-knowledge-assistant.json +8 -8
  643. package/src/components/docs/generated/docs-index.product-intent.json +8 -8
  644. package/src/components/docs/generated/docs-index.project-management-sync.json +8 -8
  645. package/src/components/docs/generated/docs-index.saas-boilerplate.json +208 -208
  646. package/src/components/docs/generated/docs-index.service-business-os.json +192 -192
  647. package/src/components/docs/generated/docs-index.team-hub.json +184 -184
  648. package/src/components/docs/generated/docs-index.unknown.json +512 -512
  649. package/src/components/docs/generated/docs-index.versioned-knowledge-base.json +80 -80
  650. package/src/components/docs/generated/docs-index.video-api-showcase.json +32 -32
  651. package/src/components/docs/generated/docs-index.video-docs-terminal.json +8 -8
  652. package/src/components/docs/generated/docs-index.video-marketing-clip.json +8 -8
  653. package/src/components/docs/generated/docs-index.voice-providers.json +8 -8
  654. package/src/components/docs/generated/docs-index.wealth-snapshot.json +152 -152
  655. package/src/components/docs/generated/docs-index.workflow-system.json +432 -432
  656. package/src/components/docs/generated/docs-index.workspace-cli.json +8 -8
  657. package/src/components/docs/generated/index.ts +6 -6
  658. package/src/components/docs/generated/loader.ts +49 -49
  659. package/src/components/docs/getting-started/CLIPage.tsx +157 -157
  660. package/src/components/docs/getting-started/CompatibilityPage.tsx +69 -69
  661. package/src/components/docs/getting-started/DataViewTutorialPage.tsx +63 -63
  662. package/src/components/docs/getting-started/DeveloperToolsPage.tsx +141 -140
  663. package/src/components/docs/getting-started/HelloWorldPage.tsx +88 -88
  664. package/src/components/docs/getting-started/InstallationPage.tsx +78 -78
  665. package/src/components/docs/getting-started/StartHerePage.tsx +64 -64
  666. package/src/components/docs/getting-started/TroubleshootingPage.tsx +68 -68
  667. package/src/components/docs/getting-started/VSCodeExtensionPage.tsx +233 -233
  668. package/src/components/docs/getting-started/getting-started.docblocks.ts +30 -30
  669. package/src/components/docs/getting-started/index.ts +6 -5
  670. package/src/components/docs/guides/GuideCIDiffGatingPage.tsx +88 -88
  671. package/src/components/docs/guides/GuideContractTypesPage.tsx +266 -266
  672. package/src/components/docs/guides/GuideDocsPipelinePage.tsx +78 -78
  673. package/src/components/docs/guides/GuideGenerateDocsClientsSchemasPage.tsx +89 -89
  674. package/src/components/docs/guides/GuideImportExistingCodebasesPage.tsx +360 -360
  675. package/src/components/docs/guides/GuideNextjsOneEndpointPage.tsx +117 -117
  676. package/src/components/docs/guides/GuideSpecValidationTypingPage.tsx +82 -82
  677. package/src/components/docs/guides/GuidesIndexPage.tsx +109 -99
  678. package/src/components/docs/guides/guides.docblocks.ts +60 -60
  679. package/src/components/docs/guides/index.ts +4 -4
  680. package/src/components/docs/index.ts +26 -40
  681. package/src/components/docs/integrations/IntegrationsCircuitBreakersPage.tsx +22 -22
  682. package/src/components/docs/integrations/IntegrationsElevenLabsPage.tsx +41 -41
  683. package/src/components/docs/integrations/IntegrationsGithubPage.tsx +66 -66
  684. package/src/components/docs/integrations/IntegrationsGmailPage.tsx +44 -44
  685. package/src/components/docs/integrations/IntegrationsGoogleCalendarPage.tsx +31 -31
  686. package/src/components/docs/integrations/IntegrationsHealthRoutingPage.tsx +80 -80
  687. package/src/components/docs/integrations/IntegrationsMistralPage.tsx +65 -65
  688. package/src/components/docs/integrations/IntegrationsOpenAIPage.tsx +54 -54
  689. package/src/components/docs/integrations/IntegrationsOverviewPage.tsx +124 -529
  690. package/src/components/docs/integrations/IntegrationsPostmarkPage.tsx +97 -97
  691. package/src/components/docs/integrations/IntegrationsPowensPage.tsx +165 -165
  692. package/src/components/docs/integrations/IntegrationsQdrantPage.tsx +44 -44
  693. package/src/components/docs/integrations/IntegrationsResendPage.tsx +40 -40
  694. package/src/components/docs/integrations/IntegrationsS3Page.tsx +48 -48
  695. package/src/components/docs/integrations/IntegrationsSlackPage.tsx +70 -70
  696. package/src/components/docs/integrations/IntegrationsSpecModelPage.tsx +139 -139
  697. package/src/components/docs/integrations/IntegrationsStripePage.tsx +153 -153
  698. package/src/components/docs/integrations/IntegrationsTwilioPage.tsx +50 -50
  699. package/src/components/docs/integrations/IntegrationsWhatsappMetaPage.tsx +69 -69
  700. package/src/components/docs/integrations/IntegrationsWhatsappTwilioPage.tsx +73 -73
  701. package/src/components/docs/integrations/index.ts +1 -1
  702. package/src/components/docs/intent/ContractFirstApiPage.tsx +61 -61
  703. package/src/components/docs/intent/DeterministicCodegenPage.tsx +81 -80
  704. package/src/components/docs/intent/GenerateClientFromSchemaPage.tsx +108 -108
  705. package/src/components/docs/intent/OpenapiAlternativePage.tsx +98 -98
  706. package/src/components/docs/intent/SchemaValidationTypescriptPage.tsx +79 -79
  707. package/src/components/docs/intent/SpecDrivenDevelopmentPage.tsx +67 -67
  708. package/src/components/docs/intent/index.ts +3 -3
  709. package/src/components/docs/intent/intent-pages.docblocks.ts +186 -186
  710. package/src/components/docs/knowledge/KnowledgeCategoriesPage.tsx +304 -304
  711. package/src/components/docs/knowledge/KnowledgeExamplesPage.tsx +84 -84
  712. package/src/components/docs/knowledge/KnowledgeOverviewPage.tsx +76 -285
  713. package/src/components/docs/knowledge/KnowledgeSourcesPage.tsx +171 -171
  714. package/src/components/docs/knowledge/KnowledgeSpacesPage.tsx +132 -132
  715. package/src/components/docs/knowledge/index.ts +1 -1
  716. package/src/components/docs/libraries/LibrariesAccessibilityPage.tsx +95 -95
  717. package/src/components/docs/libraries/LibrariesAiAgentPage.tsx +58 -58
  718. package/src/components/docs/libraries/LibrariesAnalyticsPage.tsx +39 -39
  719. package/src/components/docs/libraries/LibrariesContentGenPage.tsx +41 -41
  720. package/src/components/docs/libraries/LibrariesContractsPage.tsx +132 -132
  721. package/src/components/docs/libraries/LibrariesCostTrackingPage.tsx +47 -47
  722. package/src/components/docs/libraries/LibrariesDataBackendPage.tsx +73 -73
  723. package/src/components/docs/libraries/LibrariesDataViewsPage.tsx +76 -76
  724. package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +115 -115
  725. package/src/components/docs/libraries/LibrariesEvolutionPage.tsx +64 -64
  726. package/src/components/docs/libraries/LibrariesGraphQLPage.tsx +92 -92
  727. package/src/components/docs/libraries/LibrariesGrowthPage.tsx +37 -37
  728. package/src/components/docs/libraries/LibrariesMultiTenancyPage.tsx +47 -47
  729. package/src/components/docs/libraries/LibrariesObservabilityPage.tsx +58 -58
  730. package/src/components/docs/libraries/LibrariesOverlayEnginePage.tsx +51 -51
  731. package/src/components/docs/libraries/LibrariesOverviewPage.tsx +137 -301
  732. package/src/components/docs/libraries/LibrariesPersonalizationPage.tsx +57 -57
  733. package/src/components/docs/libraries/LibrariesProgressiveDeliveryPage.tsx +51 -51
  734. package/src/components/docs/libraries/LibrariesResiliencePage.tsx +54 -54
  735. package/src/components/docs/libraries/LibrariesRuntimePage.tsx +96 -96
  736. package/src/components/docs/libraries/LibrariesSLOPage.tsx +52 -52
  737. package/src/components/docs/libraries/LibrariesSchemaPage.tsx +131 -131
  738. package/src/components/docs/libraries/LibrariesSupportBotPage.tsx +59 -59
  739. package/src/components/docs/libraries/LibrariesTestingPage.tsx +64 -64
  740. package/src/components/docs/libraries/LibrariesUIKitPage.tsx +85 -85
  741. package/src/components/docs/libraries/LibrariesWorkflowComposerPage.tsx +38 -38
  742. package/src/components/docs/libraries/LibrariesWorkflowsPage.tsx +79 -79
  743. package/src/components/docs/libraries/index.ts +4 -4
  744. package/src/components/docs/manifesto/ManifestoPage.tsx +61 -132
  745. package/src/components/docs/ops/AutoEvolutionOpsPage.tsx +81 -81
  746. package/src/components/docs/ops/DistributedTracingOpsPage.tsx +28 -28
  747. package/src/components/docs/ops/ops-lifecycle.docblocks.ts +32 -32
  748. package/src/components/docs/ops/ops-runbooks-a.docblocks.ts +60 -60
  749. package/src/components/docs/ops/ops-runbooks-b.docblocks.ts +60 -60
  750. package/src/components/docs/ops/ops-slo-tenant.docblocks.ts +61 -61
  751. package/src/components/docs/ops/ops-top.docs.ts +10 -10
  752. package/src/components/docs/ops/ops.docs.ts +6 -6
  753. package/src/components/docs/product/product.docblocks.ts +60 -60
  754. package/src/components/docs/reference/DocsMarkdownContent.tsx +74 -74
  755. package/src/components/docs/reference/DocsReferenceContent.tsx +51 -51
  756. package/src/components/docs/reference/DocsReferenceIndexClient.tsx +106 -105
  757. package/src/components/docs/reference/DocsReferenceIndexPage.tsx +2 -2
  758. package/src/components/docs/reference/DocsReferencePage.tsx +3 -3
  759. package/src/components/docs/reference/docsMarkdownParser.ts +90 -90
  760. package/src/components/docs/safety/SafetyAuditingPage.tsx +189 -189
  761. package/src/components/docs/safety/SafetyMigrationsPage.tsx +189 -189
  762. package/src/components/docs/safety/SafetyOverviewPage.tsx +70 -157
  763. package/src/components/docs/safety/SafetyPDPPage.tsx +163 -163
  764. package/src/components/docs/safety/SafetySecurityTrustPage.tsx +89 -89
  765. package/src/components/docs/safety/SafetySigningPage.tsx +38 -38
  766. package/src/components/docs/safety/SafetyTenantIsolationPage.tsx +39 -39
  767. package/src/components/docs/safety/index.ts +3 -3
  768. package/src/components/docs/shared/StudioPrompt.tsx +17 -17
  769. package/src/components/docs/specs/SpecsCapabilitiesPage.tsx +79 -79
  770. package/src/components/docs/specs/SpecsDataViewsPage.tsx +142 -142
  771. package/src/components/docs/specs/SpecsOverlaysPage.tsx +202 -202
  772. package/src/components/docs/specs/SpecsOverviewPage.tsx +118 -193
  773. package/src/components/docs/specs/SpecsPolicyPage.tsx +233 -233
  774. package/src/components/docs/specs/SpecsWorkflowsPage.tsx +156 -156
  775. package/src/components/docs/specs/index.ts +3 -3
  776. package/src/components/docs/studio/StudioBYOKPage.tsx +11 -11
  777. package/src/components/docs/studio/StudioDeploymentsPage.tsx +11 -11
  778. package/src/components/docs/studio/StudioGettingStartedPage.tsx +11 -11
  779. package/src/components/docs/studio/StudioIntegrationsPage.tsx +11 -11
  780. package/src/components/docs/studio/StudioOverviewPage.tsx +94 -73
  781. package/src/components/docs/studio/StudioVisualBuilderPage.tsx +11 -11
  782. package/src/components/docs/studio/index.ts +4 -4
  783. package/src/components/docs/tech/contracts/tech-docs.docblocks.ts +10 -10
  784. package/src/components/integrations/molecules/IntegrationCard.tsx +71 -72
  785. package/src/components/integrations/organisms/IntegrationMarketplace.tsx +116 -116
  786. package/src/components/integrations/organisms/IntegrationSettings.tsx +201 -201
  787. package/src/components/integrations/organisms/KnowledgeSourceList.tsx +93 -94
  788. package/src/components/legal/PrivacyTemplate.tsx +611 -611
  789. package/src/components/legal/TermsTemplate.tsx +675 -675
  790. package/src/components/shared/FeatureGateNotice.tsx +26 -27
  791. package/src/components/shell/WorkspaceHeader.tsx +80 -80
  792. package/src/components/shell/WorkspaceProjectShellLayout.tsx +59 -58
  793. package/src/components/shell/WorkspaceShellRenderer.tsx +69 -68
  794. package/src/components/shell/WorkspaceSidebar.tsx +58 -58
  795. package/src/components/shell/index.ts +1 -1
  796. package/src/components/templates/engine/index.ts +29 -28
  797. package/src/components/templates/index.ts +1 -1
  798. package/src/components/templates/messaging/ConversationList.tsx +68 -69
  799. package/src/components/templates/messaging/MessageComposer.tsx +59 -59
  800. package/src/components/templates/messaging/MessageThread.tsx +73 -74
  801. package/src/components/templates/messaging/MessagingWorkspace.tsx +18 -19
  802. package/src/components/templates/messaging/index.ts +1 -1
  803. package/src/components/templates/messaging/types.ts +17 -17
  804. package/src/components/templates/recipes/LanguageSwitcher.tsx +20 -20
  805. package/src/components/templates/recipes/RecipeCard.tsx +56 -56
  806. package/src/components/templates/recipes/RecipeDetail.tsx +43 -43
  807. package/src/components/templates/recipes/RecipeList.tsx +62 -63
  808. package/src/components/templates/recipes/index.ts +2 -2
  809. package/src/components/templates/recipes/types.ts +24 -24
  810. package/src/components/templates/todos/FilterBar.tsx +84 -84
  811. package/src/components/templates/todos/TaskForm.tsx +118 -119
  812. package/src/components/templates/todos/TaskItem.tsx +78 -78
  813. package/src/components/templates/todos/TaskList.tsx +106 -107
  814. package/src/components/templates/todos/index.ts +2 -2
  815. package/src/components/templates/todos/types.ts +11 -11
  816. package/src/config/contractspec-blueprint.ts +55 -55
  817. package/src/config/contractspec-branding.ts +37 -37
  818. package/src/config/contractspec-routes.ts +22 -22
  819. package/src/config/index.ts +14 -15
  820. package/src/features/contracts-registry.ts +118 -118
  821. package/src/features/docs/docs.contracts.ts +6 -6
  822. package/src/features/docs/index.ts +6 -6
  823. package/src/features/docs.feature.ts +27 -27
  824. package/src/features/index.ts +59 -63
  825. package/src/features/mcp.feature.ts +24 -24
  826. package/src/features/presentations.feature.ts +27 -27
  827. package/src/features/registry.ts +14 -14
  828. package/src/index.ts +2 -2
  829. package/src/infrastructure/elysia/logger.ts +21 -21
  830. package/src/libs/email/client.test.ts +81 -81
  831. package/src/libs/email/client.ts +111 -111
  832. package/src/libs/email/contact.ts +35 -35
  833. package/src/libs/email/newsletter.ts +46 -46
  834. package/src/libs/email/types.ts +29 -29
  835. package/src/libs/email/utils.ts +5 -5
  836. package/src/libs/email/waitlist-application.ts +69 -69
  837. package/src/libs/email/waitlist.ts +46 -46
  838. package/src/libs/email.ts +7 -7
  839. package/src/libs/posthog/client.ts +44 -44
  840. package/src/libs/posthog/native.ts +23 -22
  841. package/src/libs/posthog/server.ts +7 -7
  842. package/src/libs/pricing-examples.ts +12 -12
  843. package/src/presentation/features/atoms/FeatureIcon/FeatureIcon.tsx +90 -90
  844. package/src/presentation/features/atoms/FeatureIcon/index.ts +3 -3
  845. package/src/presentation/features/hooks/index.ts +9 -9
  846. package/src/presentation/features/hooks/useContractsRegistry.ts +23 -23
  847. package/src/presentation/features/hooks/useFeatureFilters.ts +117 -117
  848. package/src/presentation/features/hooks/useFeatureRegistry.ts +40 -40
  849. package/src/presentation/features/hooks/useRelatedDocs.ts +28 -28
  850. package/src/presentation/features/index.ts +50 -52
  851. package/src/presentation/features/molecules/FeatureCard/FeatureCard.tsx +80 -80
  852. package/src/presentation/features/molecules/FeatureCard/types.ts +6 -6
  853. package/src/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.tsx +54 -54
  854. package/src/presentation/features/molecules/FeatureCategoryHeader/index.ts +2 -2
  855. package/src/presentation/features/molecules/FeatureFilters/FeatureFilters.tsx +67 -67
  856. package/src/presentation/features/molecules/FeatureFilters/types.ts +20 -20
  857. package/src/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.tsx +120 -121
  858. package/src/presentation/features/molecules/FeatureHoverPreview/index.ts +2 -2
  859. package/src/presentation/features/molecules/index.ts +8 -8
  860. package/src/presentation/features/organisms/FeatureDataViewsList.tsx +21 -21
  861. package/src/presentation/features/organisms/FeatureDetail/FeatureDetail.tsx +86 -86
  862. package/src/presentation/features/organisms/FeatureDetail/types.ts +4 -4
  863. package/src/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.tsx +210 -210
  864. package/src/presentation/features/organisms/FeatureDiscovery/index.ts +3 -3
  865. package/src/presentation/features/organisms/FeatureDiscovery/types.ts +10 -10
  866. package/src/presentation/features/organisms/FeatureEventsList.tsx +19 -19
  867. package/src/presentation/features/organisms/FeatureFormsList.tsx +19 -19
  868. package/src/presentation/features/organisms/FeatureOperationsList.tsx +21 -21
  869. package/src/presentation/features/organisms/FeaturePresentationsList.tsx +21 -21
  870. package/src/presentation/features/organisms/index.ts +6 -6
  871. package/src/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.tsx +219 -219
  872. package/src/presentation/features/templates/FeatureDataViewDetailTemplate/types.ts +7 -7
  873. package/src/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.tsx +26 -26
  874. package/src/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.tsx +195 -195
  875. package/src/presentation/features/templates/FeatureEventDetailTemplate/types.ts +7 -7
  876. package/src/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.tsx +26 -26
  877. package/src/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.tsx +216 -216
  878. package/src/presentation/features/templates/FeatureFormDetailTemplate/types.ts +7 -7
  879. package/src/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.tsx +26 -26
  880. package/src/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.tsx +228 -228
  881. package/src/presentation/features/templates/FeatureOperationDetailTemplate/types.ts +7 -7
  882. package/src/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.tsx +26 -26
  883. package/src/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.tsx +24 -24
  884. package/src/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.tsx +201 -201
  885. package/src/presentation/features/templates/FeaturePresentationDetailTemplate/types.ts +8 -8
  886. package/src/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.tsx +26 -26
  887. package/src/presentation/features/templates/types.ts +2 -2
  888. package/tsconfig.json +12 -12
  889. package/tsdown.config.js +5 -5
@@ -1,10 +1,37 @@
1
+ // src/infrastructure/elysia/logger.ts
2
+ import { Logger, LogLevel } from "@contractspec/lib.logger";
3
+ var createAppLogger = () => new Logger({
4
+ level: LogLevel.INFO,
5
+ environment: "production",
6
+ enableTracing: true,
7
+ enableTiming: true,
8
+ enableContext: true,
9
+ enableColors: false
10
+ });
11
+ var appLogger = createAppLogger();
12
+ var dbLogger = new Logger({
13
+ level: LogLevel.WARN,
14
+ environment: "production",
15
+ enableTracing: true,
16
+ enableTiming: true,
17
+ enableContext: true,
18
+ enableColors: false
19
+ });
20
+ var authLogger = new Logger({
21
+ level: LogLevel.INFO,
22
+ environment: "production",
23
+ enableTracing: true,
24
+ enableTiming: true,
25
+ enableContext: true,
26
+ enableColors: false
27
+ });
1
28
  // src/application/mcp/common.ts
2
- import { PresentationRegistry } from "@contractspec/lib.contracts-spec/presentations";
29
+ import { randomUUID } from "node:crypto";
3
30
  import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
31
+ import { PresentationRegistry } from "@contractspec/lib.contracts-spec/presentations";
4
32
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
33
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
6
34
  import { Elysia } from "elysia";
7
- import { randomUUID } from "node:crypto";
8
35
  var baseCtx = {
9
36
  actor: "anonymous",
10
37
  decide: async () => ({ effect: "allow" })
@@ -170,44 +197,10 @@ function createMcpElysiaHandler({
170
197
  });
171
198
  }
172
199
 
173
- // src/infrastructure/elysia/logger.ts
174
- import { Logger, LogLevel } from "@contractspec/lib.logger";
175
- var createAppLogger = () => new Logger({
176
- level: LogLevel.INFO,
177
- environment: "production",
178
- enableTracing: true,
179
- enableTiming: true,
180
- enableContext: true,
181
- enableColors: false
182
- });
183
- var appLogger = createAppLogger();
184
- var dbLogger = new Logger({
185
- level: LogLevel.WARN,
186
- environment: "production",
187
- enableTracing: true,
188
- enableTiming: true,
189
- enableContext: true,
190
- enableColors: false
191
- });
192
- var authLogger = new Logger({
193
- level: LogLevel.INFO,
194
- environment: "production",
195
- enableTracing: true,
196
- enableTiming: true,
197
- enableContext: true,
198
- enableColors: false
199
- });
200
- // src/features/docs/docs.contracts.ts
201
- import {
202
- DocSummaryModel,
203
- DocsIndexInput,
204
- DocsIndexOutput,
205
- DocsIndexQuery,
206
- DocsIndexQuery as DocsIndexQuery2,
207
- ContractReferenceQuery
208
- } from "@contractspec/lib.contracts-spec/docs";
209
- // src/application/mcp/docsMcp.ts
200
+ // src/application/mcp/cliMcp.ts
201
+ import fs from "node:fs/promises";
210
202
  import {
203
+ defineCommand,
211
204
  definePrompt,
212
205
  defineResourceTemplate,
213
206
  installOp,
@@ -215,165 +208,9 @@ import {
215
208
  PromptRegistry,
216
209
  ResourceRegistry
217
210
  } from "@contractspec/lib.contracts-spec";
218
- import { defaultDocRegistry } from "@contractspec/lib.contracts-spec/docs";
219
- import z from "zod";
220
- var DOC_OWNERS = ["@contractspec"];
221
- var DOC_TAGS = ["docs", "mcp"];
222
- function buildDocResources(routes) {
223
- const resources = new ResourceRegistry;
224
- resources.register(defineResourceTemplate({
225
- meta: {
226
- uriTemplate: "docs://list",
227
- title: "DocBlocks index",
228
- description: "All registered DocBlocks with route, visibility, tags, and summary.",
229
- mimeType: "application/json",
230
- tags: DOC_TAGS
231
- },
232
- input: z.object({}),
233
- resolve: async () => {
234
- const docs = routes.map(({ block, route }) => ({
235
- id: block.id,
236
- title: block.title,
237
- summary: block.summary ?? "",
238
- tags: block.tags ?? [],
239
- visibility: block.visibility ?? "public",
240
- route
241
- }));
242
- return {
243
- uri: "docs://list",
244
- mimeType: "application/json",
245
- data: JSON.stringify(docs, null, 2)
246
- };
247
- }
248
- }));
249
- resources.register(defineResourceTemplate({
250
- meta: {
251
- uriTemplate: "docs://doc/{id}",
252
- title: "DocBlock markdown",
253
- description: "Fetch DocBlock body by id as markdown.",
254
- mimeType: "text/markdown",
255
- tags: DOC_TAGS
256
- },
257
- input: z.object({ id: z.string() }),
258
- resolve: async ({ id }) => {
259
- const found = defaultDocRegistry.get(id);
260
- if (!found) {
261
- return {
262
- uri: `docs://doc/${encodeURIComponent(id)}`,
263
- mimeType: "text/plain",
264
- data: `DocBlock not found: ${id}`
265
- };
266
- }
267
- return {
268
- uri: `docs://doc/${encodeURIComponent(id)}`,
269
- mimeType: "text/markdown",
270
- data: String(found.block.body ?? "")
271
- };
272
- }
273
- }));
274
- return resources;
275
- }
276
- function buildDocPrompts() {
277
- const prompts = new PromptRegistry;
278
- prompts.register(definePrompt({
279
- meta: {
280
- key: "docs.navigator",
281
- version: "1.0.0",
282
- title: "Find relevant ContractSpec docs",
283
- description: "Guide agents to pick the right DocBlock by topic or tag.",
284
- tags: DOC_TAGS,
285
- stability: "beta",
286
- owners: DOC_OWNERS
287
- },
288
- args: [
289
- {
290
- name: "topic",
291
- description: "Goal or subject to search for.",
292
- required: false,
293
- schema: z.string().optional()
294
- },
295
- {
296
- name: "tag",
297
- description: "Optional tag filter.",
298
- required: false,
299
- schema: z.string().optional()
300
- }
301
- ],
302
- input: z.object({
303
- topic: z.string().optional(),
304
- tag: z.string().optional()
305
- }),
306
- render: async ({ topic, tag }) => {
307
- const parts = [
308
- {
309
- type: "text",
310
- text: `Use the docs index to choose DocBlocks. If a specific topic is provided, prefer docs whose id/title/summary match it.${topic ? ` Topic: ${topic}.` : ""}${tag ? ` Tag: ${tag}.` : ""}`
311
- },
312
- {
313
- type: "resource",
314
- uri: "docs://list",
315
- title: "DocBlocks index"
316
- }
317
- ];
318
- return parts;
319
- }
320
- }));
321
- return prompts;
322
- }
323
- function buildDocOps(routes) {
324
- const registry = new OperationSpecRegistry;
325
- installOp(registry, DocsIndexQuery, async (args) => {
326
- const query = args.query?.toLowerCase().trim();
327
- const tagsFilter = args.tag?.map((t) => t.toLowerCase().trim()) ?? [];
328
- const visibility = args.visibility?.toLowerCase().trim();
329
- const docs = routes.map(({ block, route }) => ({
330
- id: block.id,
331
- title: block.title,
332
- summary: block.summary ?? "",
333
- tags: block.tags ?? [],
334
- visibility: (block.visibility ?? "public").toLowerCase(),
335
- route
336
- })).filter((doc) => {
337
- const matchesQuery = query ? doc.id.toLowerCase().includes(query) || doc.title.toLowerCase().includes(query) || doc.summary.toLowerCase().includes(query) : true;
338
- const matchesTags = tagsFilter.length ? tagsFilter.every((t) => doc.tags.some((tag) => tag.toLowerCase().includes(t))) : true;
339
- const matchesVisibility = visibility ? doc.visibility === visibility : true;
340
- return matchesQuery && matchesTags && matchesVisibility;
341
- });
342
- return {
343
- docs,
344
- items: docs,
345
- total: docs.length
346
- };
347
- });
348
- return registry;
349
- }
350
- function createDocsMcpHandler(path = "/api/mcp/docs") {
351
- const routes = defaultDocRegistry.list();
352
- return createMcpElysiaHandler({
353
- logger: appLogger,
354
- path,
355
- serverName: "contractspec-docs-mcp",
356
- ops: buildDocOps(routes),
357
- resources: buildDocResources(routes),
358
- prompts: buildDocPrompts(),
359
- presentations: routes.map(({ descriptor }) => descriptor)
360
- });
361
- }
362
-
363
- // src/application/mcp/cliMcp.ts
364
- import fs from "node:fs/promises";
365
- import path from "path";
366
- import {
367
- defineCommand,
368
- definePrompt as definePrompt2,
369
- defineResourceTemplate as defineResourceTemplate2,
370
- installOp as installOp2,
371
- OperationSpecRegistry as OperationSpecRegistry2,
372
- PromptRegistry as PromptRegistry2,
373
- ResourceRegistry as ResourceRegistry2
374
- } from "@contractspec/lib.contracts-spec";
375
211
  import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
376
- import z2 from "zod";
212
+ import path from "path";
213
+ import z from "zod";
377
214
  var __dirname = "/home/runner/work/contractspec/contractspec/packages/bundles/library/src/application/mcp";
378
215
  var CLI_DOC_PATHS = {
379
216
  quickstart: "packages/apps/cli-contractspec/QUICK_START.md",
@@ -426,8 +263,8 @@ async function loadCliDoc(key) {
426
263
  return fallback;
427
264
  }
428
265
  function buildCliResources() {
429
- const resources = new ResourceRegistry2;
430
- resources.register(defineResourceTemplate2({
266
+ const resources = new ResourceRegistry;
267
+ resources.register(defineResourceTemplate({
431
268
  meta: {
432
269
  uriTemplate: "cli://doc/{slug}",
433
270
  title: "CLI documentation",
@@ -435,8 +272,8 @@ function buildCliResources() {
435
272
  mimeType: "text/markdown",
436
273
  tags: CLI_DOC_TAGS
437
274
  },
438
- input: z2.object({
439
- slug: z2.enum(["quickstart", "reference", "readme"])
275
+ input: z.object({
276
+ slug: z.enum(["quickstart", "reference", "readme"])
440
277
  }),
441
278
  resolve: async ({ slug }) => {
442
279
  const data = await loadCliDoc(slug);
@@ -447,7 +284,7 @@ function buildCliResources() {
447
284
  };
448
285
  }
449
286
  }));
450
- resources.register(defineResourceTemplate2({
287
+ resources.register(defineResourceTemplate({
451
288
  meta: {
452
289
  uriTemplate: "cli://commands",
453
290
  title: "CLI commands summary",
@@ -455,7 +292,7 @@ function buildCliResources() {
455
292
  mimeType: "application/json",
456
293
  tags: CLI_DOC_TAGS
457
294
  },
458
- input: z2.object({}),
295
+ input: z.object({}),
459
296
  resolve: async () => {
460
297
  const commands = [
461
298
  {
@@ -484,8 +321,8 @@ function buildCliResources() {
484
321
  return resources;
485
322
  }
486
323
  function buildCliPrompts() {
487
- const prompts = new PromptRegistry2;
488
- prompts.register(definePrompt2({
324
+ const prompts = new PromptRegistry;
325
+ prompts.register(definePrompt({
489
326
  meta: {
490
327
  key: "cli.usage",
491
328
  version: "1.0.0",
@@ -500,10 +337,10 @@ function buildCliPrompts() {
500
337
  name: "goal",
501
338
  description: "Task the user wants to achieve.",
502
339
  required: false,
503
- schema: z2.string().optional()
340
+ schema: z.string().optional()
504
341
  }
505
342
  ],
506
- input: z2.object({ goal: z2.string().optional() }),
343
+ input: z.object({ goal: z.string().optional() }),
507
344
  render: async ({ goal }) => [
508
345
  {
509
346
  type: "text",
@@ -520,7 +357,7 @@ function buildCliPrompts() {
520
357
  return prompts;
521
358
  }
522
359
  function buildCliOps() {
523
- const registry = new OperationSpecRegistry2;
360
+ const registry = new OperationSpecRegistry;
524
361
  const CliSuggestInput = defineSchemaModel({
525
362
  name: "CliSuggestInput",
526
363
  fields: {
@@ -555,7 +392,7 @@ function buildCliOps() {
555
392
  auth: "anonymous"
556
393
  }
557
394
  });
558
- installOp2(registry, suggestSpec, async ({ goal, prefersAi }) => {
395
+ installOp(registry, suggestSpec, async ({ goal, prefersAi }) => {
559
396
  const lower = goal.toLowerCase();
560
397
  if (lower.includes("create") || lower.includes("new")) {
561
398
  return {
@@ -597,831 +434,996 @@ function createCliMcpHandler(path2 = "/api/mcp/cli") {
597
434
  });
598
435
  }
599
436
 
600
- // src/application/mcp/internalMcp.ts
437
+ // src/application/mcp/contractsMcpResources.ts
601
438
  import {
602
- defineCommand as defineCommand2,
603
- definePrompt as definePrompt3,
604
- defineResourceTemplate as defineResourceTemplate3,
605
- installOp as installOp3,
606
- OperationSpecRegistry as OperationSpecRegistry3,
607
- PromptRegistry as PromptRegistry3,
608
- ResourceRegistry as ResourceRegistry3
439
+ definePrompt as definePrompt2,
440
+ defineResourceTemplate as defineResourceTemplate2,
441
+ PromptRegistry as PromptRegistry2,
442
+ ResourceRegistry as ResourceRegistry2
609
443
  } from "@contractspec/lib.contracts-spec";
610
- import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
611
- import z3 from "zod";
612
- import {
613
- getExample,
614
- listExamples,
615
- searchExamples
616
- } from "@contractspec/module.examples";
617
- var INTERNAL_TAGS = ["internal", "mcp"];
618
- var INTERNAL_OWNERS = ["@contractspec"];
619
- var ENDPOINTS = {
620
- docs: "/api/mcp/docs",
621
- cli: "/api/mcp/cli",
622
- internal: "/api/mcp/internal",
623
- graphql: "/graphql",
624
- health: "/health"
625
- };
626
- function buildInternalResources() {
627
- const resources = new ResourceRegistry3;
628
- resources.register(defineResourceTemplate3({
444
+ import z2 from "zod";
445
+ var OWNERS = ["@contractspec"];
446
+ var TAGS = ["contracts", "mcp"];
447
+ function buildContractsResources(services) {
448
+ const resources = new ResourceRegistry2;
449
+ resources.register(defineResourceTemplate2({
629
450
  meta: {
630
- uriTemplate: "examples://list{?q}",
631
- title: "ContractSpec examples registry",
632
- description: "List available examples (templates, integrations, knowledge, scripts). Optional query `q` filters results.",
451
+ uriTemplate: "contracts://list",
452
+ title: "Contract specs list",
453
+ description: "JSON list of all contract specs in the workspace.",
633
454
  mimeType: "application/json",
634
- tags: ["examples", ...INTERNAL_TAGS]
455
+ tags: TAGS
635
456
  },
636
- input: z3.object({ q: z3.string().optional() }),
637
- resolve: async ({ q }) => {
638
- const items = q ? searchExamples(q) : [...listExamples()];
457
+ input: z2.object({}),
458
+ resolve: async () => {
459
+ const specs = await services.listSpecs();
639
460
  return {
640
- uri: q ? `examples://list?q=${encodeURIComponent(q)}` : "examples://list",
461
+ uri: "contracts://list",
641
462
  mimeType: "application/json",
642
- data: JSON.stringify(items, null, 2)
463
+ data: JSON.stringify(specs, null, 2)
643
464
  };
644
465
  }
645
466
  }));
646
- resources.register(defineResourceTemplate3({
467
+ resources.register(defineResourceTemplate2({
647
468
  meta: {
648
- uriTemplate: "examples://example/{id}",
649
- title: "ContractSpec example (by id)",
650
- description: "Fetch a single example manifest by id.",
651
- mimeType: "application/json",
652
- tags: ["examples", ...INTERNAL_TAGS]
469
+ uriTemplate: "contracts://spec/{path}",
470
+ title: "Contract spec content",
471
+ description: "Read a single contract spec file by path.",
472
+ mimeType: "text/plain",
473
+ tags: TAGS
653
474
  },
654
- input: z3.object({ id: z3.string().min(1) }),
655
- resolve: async ({ id }) => {
656
- const example = getExample(id);
657
- if (!example) {
475
+ input: z2.object({ path: z2.string() }),
476
+ resolve: async ({ path: path2 }) => {
477
+ const result = await services.getSpec(path2);
478
+ if (!result) {
658
479
  return {
659
- uri: `examples://example/${encodeURIComponent(id)}`,
660
- mimeType: "application/json",
661
- data: JSON.stringify({ error: "not_found", id, message: `Unknown example id: ${id}` }, null, 2)
480
+ uri: `contracts://spec/${encodeURIComponent(path2)}`,
481
+ mimeType: "text/plain",
482
+ data: `Spec not found: ${path2}`
662
483
  };
663
484
  }
664
485
  return {
665
- uri: `examples://example/${encodeURIComponent(id)}`,
666
- mimeType: "application/json",
667
- data: JSON.stringify(example, null, 2)
486
+ uri: `contracts://spec/${encodeURIComponent(path2)}`,
487
+ mimeType: "text/plain",
488
+ data: result.content
668
489
  };
669
490
  }
670
491
  }));
671
- resources.register(defineResourceTemplate3({
492
+ resources.register(defineResourceTemplate2({
672
493
  meta: {
673
- uriTemplate: "internal://endpoints",
674
- title: "ContractSpec MCP endpoints",
675
- description: "Endpoints for docs, CLI, internal MCP servers.",
676
- mimeType: "application/json",
677
- tags: INTERNAL_TAGS
678
- },
679
- input: z3.object({}),
680
- resolve: async () => ({
681
- uri: "internal://endpoints",
494
+ uriTemplate: "contracts://registry/manifest",
495
+ title: "Remote registry manifest",
496
+ description: "Contract registry manifest from the remote server.",
682
497
  mimeType: "application/json",
683
- data: JSON.stringify(ENDPOINTS, null, 2)
684
- })
685
- }));
686
- resources.register(defineResourceTemplate3({
687
- meta: {
688
- uriTemplate: "internal://playbook",
689
- title: "Internal MCP usage playbook",
690
- description: "How internal agents should discover docs, CLI usage, and endpoints.",
691
- mimeType: "text/markdown",
692
- tags: INTERNAL_TAGS
498
+ tags: TAGS
693
499
  },
694
- input: z3.object({}),
695
- resolve: async () => ({
696
- uri: "internal://playbook",
697
- mimeType: "text/markdown",
698
- data: [
699
- "# Internal MCP playbook",
700
- "- Connect to docs MCP first for canonical specs.",
701
- "- Use CLI MCP to surface quickstart/reference before running commands.",
702
- "- Keep calls read-only unless explicitly approved.",
703
- `- Endpoints: ${ENDPOINTS.docs}, ${ENDPOINTS.cli}, ${ENDPOINTS.internal}.`,
704
- "- For API work, GraphQL at /graphql; health at /health."
705
- ].join(`
706
- `)
707
- })
500
+ input: z2.object({}),
501
+ resolve: async () => {
502
+ const manifest = await services.fetchRegistryManifest();
503
+ return {
504
+ uri: "contracts://registry/manifest",
505
+ mimeType: "application/json",
506
+ data: JSON.stringify(manifest, null, 2)
507
+ };
508
+ }
708
509
  }));
709
510
  return resources;
710
511
  }
711
- function buildInternalPrompts() {
712
- const prompts = new PromptRegistry3;
713
- prompts.register(definePrompt3({
512
+ function buildContractsPrompts() {
513
+ const prompts = new PromptRegistry2;
514
+ prompts.register(definePrompt2({
714
515
  meta: {
715
- key: "internal_bootstrap",
516
+ key: "contracts.editor",
716
517
  version: "1.0.0",
717
- title: "Bootstrap internal ContractSpec agent",
718
- description: "Points agents to the correct MCP endpoints and guardrails.",
719
- tags: INTERNAL_TAGS,
720
- owners: INTERNAL_OWNERS,
721
- stability: "beta"
518
+ title: "Contract editing guide",
519
+ description: "Guide AI agents through reading, editing, and validating contracts.",
520
+ tags: TAGS,
521
+ stability: "beta",
522
+ owners: OWNERS
722
523
  },
723
- args: [],
724
- input: z3.object({}),
725
- render: async () => [
524
+ args: [
525
+ {
526
+ name: "goal",
527
+ description: "What the agent wants to achieve with the contract.",
528
+ required: false,
529
+ schema: z2.string().optional()
530
+ }
531
+ ],
532
+ input: z2.object({ goal: z2.string().optional() }),
533
+ render: async ({ goal }) => [
726
534
  {
727
535
  type: "text",
728
- text: "Start with internal://endpoints to pick the right MCP. Use docs MCP for specifications and CLI MCP for commands. Keep actions read-only unless explicitly approved."
536
+ text: [
537
+ "Contract editing workflow:",
538
+ "1. Use contracts.list to discover specs",
539
+ "2. Use contracts.get to read a spec",
540
+ "3. Edit content and call contracts.update",
541
+ "4. Run contracts.validate to verify changes",
542
+ "5. Run contracts.build to regenerate artifacts",
543
+ goal ? `Agent goal: ${goal}` : ""
544
+ ].filter(Boolean).join(`
545
+ `)
729
546
  },
730
547
  {
731
548
  type: "resource",
732
- uri: "internal://endpoints",
733
- title: "Endpoints"
549
+ uri: "contracts://list",
550
+ title: "Available contracts"
734
551
  }
735
552
  ]
736
553
  }));
737
554
  return prompts;
738
555
  }
739
- function buildInternalOps() {
740
- const registry = new OperationSpecRegistry3;
741
- const InternalDescribeOutput = defineSchemaModel2({
742
- name: "InternalDescribeOutput",
556
+
557
+ // src/application/mcp/contractsMcpTools.ts
558
+ import {
559
+ defineCommand as defineCommand2,
560
+ installOp as installOp2,
561
+ OperationSpecRegistry as OperationSpecRegistry2
562
+ } from "@contractspec/lib.contracts-spec";
563
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
564
+ var OWNERS2 = ["@contractspec"];
565
+ var TAGS2 = ["contracts", "mcp"];
566
+ function buildContractsOps(services) {
567
+ const registry = new OperationSpecRegistry2;
568
+ const ListInput = defineSchemaModel2({
569
+ name: "ContractsListInput",
743
570
  fields: {
744
- endpoints: {
745
- type: ScalarTypeEnum2.JSONObject(),
746
- isOptional: false
747
- },
748
- notes: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
571
+ pattern: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
572
+ type: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
573
+ }
574
+ });
575
+ const ListOutput = defineSchemaModel2({
576
+ name: "ContractsListOutput",
577
+ fields: {
578
+ specs: { type: ScalarTypeEnum2.JSON(), isOptional: false },
579
+ total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
749
580
  }
750
581
  });
751
- const describeSpec = defineCommand2({
582
+ installOp2(registry, defineCommand2({
752
583
  meta: {
753
- key: "internal_describe",
584
+ key: "contracts.list",
754
585
  version: "1.0.0",
755
- stability: "stable",
756
- owners: INTERNAL_OWNERS,
757
- tags: INTERNAL_TAGS,
758
- description: "Return MCP endpoints and guidance for internal ContractSpec agents.",
759
- goal: "Speed up internal development with the correct MCP entrypoints.",
760
- context: "Used by internal MCP surface; read-only."
586
+ stability: "beta",
587
+ owners: OWNERS2,
588
+ tags: TAGS2,
589
+ description: "List contract specs in the workspace.",
590
+ goal: "Discover available contracts by type, pattern, or owner.",
591
+ context: "Contracts MCP server."
761
592
  },
762
- io: {
763
- input: defineSchemaModel2({
764
- name: "InternalDescribeInput",
765
- fields: {}
766
- }),
767
- output: InternalDescribeOutput
593
+ io: { input: ListInput, output: ListOutput },
594
+ policy: { auth: "anonymous" }
595
+ }), async ({ pattern, type }) => {
596
+ const specs = await services.listSpecs({ pattern, type });
597
+ return { specs, total: specs.length };
598
+ });
599
+ const GetInput = defineSchemaModel2({
600
+ name: "ContractsGetInput",
601
+ fields: {
602
+ path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
603
+ }
604
+ });
605
+ const GetOutput = defineSchemaModel2({
606
+ name: "ContractsGetOutput",
607
+ fields: {
608
+ content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
609
+ info: { type: ScalarTypeEnum2.JSON(), isOptional: false }
610
+ }
611
+ });
612
+ installOp2(registry, defineCommand2({
613
+ meta: {
614
+ key: "contracts.get",
615
+ version: "1.0.0",
616
+ stability: "beta",
617
+ owners: OWNERS2,
618
+ tags: TAGS2,
619
+ description: "Read a single contract spec file.",
620
+ goal: "Fetch spec content and parsed metadata.",
621
+ context: "Contracts MCP server."
768
622
  },
769
- policy: {
770
- auth: "anonymous"
623
+ io: { input: GetInput, output: GetOutput },
624
+ policy: { auth: "anonymous" }
625
+ }), async ({ path: path2 }) => {
626
+ const result = await services.getSpec(path2);
627
+ if (!result)
628
+ throw new Error(`Spec not found: ${path2}`);
629
+ return result;
630
+ });
631
+ const ValidateInput = defineSchemaModel2({
632
+ name: "ContractsValidateInput",
633
+ fields: {
634
+ path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
771
635
  }
772
636
  });
773
- installOp3(registry, describeSpec, async () => ({
774
- endpoints: ENDPOINTS,
775
- notes: "Use docs MCP for canonical specs, CLI MCP for contractspec commands, and keep side-effecting actions gated behind human review."
776
- }));
777
- return registry;
778
- }
779
- function createInternalMcpHandler(path2 = "/api/mcp/internal") {
780
- return createMcpElysiaHandler({
781
- logger: appLogger,
782
- path: path2,
783
- serverName: "contractspec-internal-mcp",
784
- ops: buildInternalOps(),
785
- resources: buildInternalResources(),
786
- prompts: buildInternalPrompts()
637
+ const ValidateOutput = defineSchemaModel2({
638
+ name: "ContractsValidateOutput",
639
+ fields: {
640
+ valid: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
641
+ errors: { type: ScalarTypeEnum2.JSON(), isOptional: false },
642
+ warnings: { type: ScalarTypeEnum2.JSON(), isOptional: false }
643
+ }
787
644
  });
788
- }
789
-
790
- // src/application/mcp/providerRankingMcp.ts
791
- import {
792
- definePrompt as definePrompt4,
793
- defineResourceTemplate as defineResourceTemplate4,
794
- installOp as installOp4,
795
- OperationSpecRegistry as OperationSpecRegistry4,
796
- PromptRegistry as PromptRegistry4,
797
- ResourceRegistry as ResourceRegistry4
798
- } from "@contractspec/lib.contracts-spec";
799
- import {
800
- BenchmarkIngestCommand,
801
- BenchmarkRunCustomCommand,
802
- RankingRefreshCommand
803
- } from "@contractspec/lib.contracts-spec/provider-ranking";
804
- import z4 from "zod";
805
- import { getModelInfo } from "@contractspec/lib.ai-providers/models";
806
- import { InMemoryProviderRankingStore } from "@contractspec/lib.provider-ranking/in-memory-store";
807
- import { createDefaultIngesterRegistry } from "@contractspec/lib.provider-ranking/ingesters";
808
- import { computeModelRankings } from "@contractspec/lib.provider-ranking/scoring";
809
- import { normalizeBenchmarkResults } from "@contractspec/lib.provider-ranking/scoring";
810
- var TransportFilterSchema = z4.enum(["rest", "mcp", "webhook", "sdk"]).optional();
811
- var AuthFilterSchema = z4.enum([
812
- "api-key",
813
- "oauth2",
814
- "bearer",
815
- "header",
816
- "basic",
817
- "webhook-signing",
818
- "service-account"
819
- ]).optional();
820
- var RANKING_TAGS = ["ranking", "mcp", "ai"];
821
- var RANKING_OWNERS = ["platform.ai"];
822
- var sharedStore = null;
823
- function getStore() {
824
- if (!sharedStore) {
825
- sharedStore = new InMemoryProviderRankingStore;
826
- }
827
- return sharedStore;
828
- }
829
- function buildRankingResources() {
830
- const resources = new ResourceRegistry4;
831
- resources.register(defineResourceTemplate4({
645
+ installOp2(registry, defineCommand2({
832
646
  meta: {
833
- uriTemplate: "ranking://leaderboard",
834
- title: "AI Model Leaderboard",
835
- description: "Current ranked list of AI models by composite score. Supports optional transport and authMethod query filters.",
836
- mimeType: "application/json",
837
- tags: RANKING_TAGS
647
+ key: "contracts.validate",
648
+ version: "1.0.0",
649
+ stability: "beta",
650
+ owners: OWNERS2,
651
+ tags: TAGS2,
652
+ description: "Validate a contract spec structure.",
653
+ goal: "Check spec for structural or policy issues.",
654
+ context: "Contracts MCP server."
838
655
  },
839
- input: z4.object({
840
- transport: TransportFilterSchema,
841
- authMethod: AuthFilterSchema
842
- }),
843
- resolve: async ({ transport, authMethod }) => {
844
- const store = getStore();
845
- const result = await store.listModelRankings({
846
- limit: 100,
847
- requiredTransport: transport,
848
- requiredAuthMethod: authMethod
849
- });
850
- return {
851
- uri: "ranking://leaderboard",
852
- mimeType: "application/json",
853
- data: JSON.stringify(result, null, 2)
854
- };
656
+ io: { input: ValidateInput, output: ValidateOutput },
657
+ policy: { auth: "anonymous" }
658
+ }), async ({ path: path2 }) => services.validateSpec(path2));
659
+ const BuildInput = defineSchemaModel2({
660
+ name: "ContractsBuildInput",
661
+ fields: {
662
+ path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
663
+ dryRun: { type: ScalarTypeEnum2.Boolean(), isOptional: true }
855
664
  }
856
- }));
857
- resources.register(defineResourceTemplate4({
665
+ });
666
+ const BuildOutput = defineSchemaModel2({
667
+ name: "ContractsBuildOutput",
668
+ fields: {
669
+ results: { type: ScalarTypeEnum2.JSON(), isOptional: false }
670
+ }
671
+ });
672
+ installOp2(registry, defineCommand2({
858
673
  meta: {
859
- uriTemplate: "ranking://leaderboard/{dimension}",
860
- title: "AI Model Leaderboard by Dimension",
861
- description: "Ranked list of AI models filtered by a specific dimension. Supports optional transport and authMethod query filters.",
862
- mimeType: "application/json",
863
- tags: RANKING_TAGS
674
+ key: "contracts.build",
675
+ version: "1.0.0",
676
+ stability: "beta",
677
+ owners: OWNERS2,
678
+ tags: TAGS2,
679
+ description: "Generate implementation code from a contract spec.",
680
+ goal: "Produce handler, component, or test skeletons.",
681
+ context: "Contracts MCP server."
864
682
  },
865
- input: z4.object({
866
- dimension: z4.string(),
867
- transport: TransportFilterSchema,
868
- authMethod: AuthFilterSchema
869
- }),
870
- resolve: async ({ dimension, transport, authMethod }) => {
871
- const store = getStore();
872
- const result = await store.listModelRankings({
873
- dimension,
874
- limit: 100,
875
- requiredTransport: transport,
876
- requiredAuthMethod: authMethod
877
- });
878
- return {
879
- uri: `ranking://leaderboard/${encodeURIComponent(dimension)}`,
880
- mimeType: "application/json",
881
- data: JSON.stringify(result, null, 2)
882
- };
683
+ io: { input: BuildInput, output: BuildOutput },
684
+ policy: { auth: "user" }
685
+ }), async ({ path: path2, dryRun }) => services.buildSpec(path2, { dryRun }));
686
+ registerMutationTools(registry, services);
687
+ return registry;
688
+ }
689
+ function registerMutationTools(registry, services) {
690
+ const UpdateInput = defineSchemaModel2({
691
+ name: "ContractsUpdateInput",
692
+ fields: {
693
+ path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
694
+ content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
695
+ fields: { type: ScalarTypeEnum2.JSON(), isOptional: true }
696
+ }
697
+ });
698
+ const UpdateOutput = defineSchemaModel2({
699
+ name: "ContractsUpdateOutput",
700
+ fields: {
701
+ updated: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
702
+ errors: { type: ScalarTypeEnum2.JSON(), isOptional: false },
703
+ warnings: { type: ScalarTypeEnum2.JSON(), isOptional: false }
883
704
  }
705
+ });
706
+ installOp2(registry, defineCommand2({
707
+ meta: {
708
+ key: "contracts.update",
709
+ version: "1.0.0",
710
+ stability: "beta",
711
+ owners: OWNERS2,
712
+ tags: TAGS2,
713
+ description: "Update an existing contract spec.",
714
+ goal: "Modify spec content or individual fields with validation.",
715
+ context: "Contracts MCP server."
716
+ },
717
+ io: { input: UpdateInput, output: UpdateOutput },
718
+ policy: { auth: "user" }
719
+ }), async ({ path: path2, content, fields }) => services.updateSpec(path2, {
720
+ content,
721
+ fields: Array.isArray(fields) ? fields : undefined
884
722
  }));
885
- resources.register(defineResourceTemplate4({
723
+ const DeleteInput = defineSchemaModel2({
724
+ name: "ContractsDeleteInput",
725
+ fields: {
726
+ path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
727
+ clean: { type: ScalarTypeEnum2.Boolean(), isOptional: true }
728
+ }
729
+ });
730
+ const DeleteOutput = defineSchemaModel2({
731
+ name: "ContractsDeleteOutput",
732
+ fields: {
733
+ deleted: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
734
+ cleanedFiles: { type: ScalarTypeEnum2.JSON(), isOptional: false },
735
+ errors: { type: ScalarTypeEnum2.JSON(), isOptional: false }
736
+ }
737
+ });
738
+ installOp2(registry, defineCommand2({
886
739
  meta: {
887
- uriTemplate: "ranking://model/{modelId}",
888
- title: "AI Model Profile",
889
- description: "Detailed profile for a specific AI model including scores and benchmarks.",
740
+ key: "contracts.delete",
741
+ version: "1.0.0",
742
+ stability: "beta",
743
+ owners: OWNERS2,
744
+ tags: TAGS2,
745
+ description: "Delete a contract spec and optionally its artifacts.",
746
+ goal: "Remove a spec file and clean generated handlers/tests.",
747
+ context: "Contracts MCP server."
748
+ },
749
+ io: { input: DeleteInput, output: DeleteOutput },
750
+ policy: { auth: "user" }
751
+ }), async ({ path: path2, clean }) => services.deleteSpec(path2, { clean }));
752
+ }
753
+
754
+ // src/application/mcp/contractsMcp.ts
755
+ function createContractsMcpHandler(path2 = "/api/mcp/contracts", services) {
756
+ return createMcpElysiaHandler({
757
+ logger: appLogger,
758
+ path: path2,
759
+ serverName: "contractspec-contracts-mcp",
760
+ ops: buildContractsOps(services),
761
+ resources: buildContractsResources(services),
762
+ prompts: buildContractsPrompts()
763
+ });
764
+ }
765
+
766
+ // src/features/docs/docs.contracts.ts
767
+ import {
768
+ ContractReferenceQuery,
769
+ DocSummaryModel,
770
+ DocsIndexInput,
771
+ DocsIndexOutput,
772
+ DocsIndexQuery,
773
+ DocsIndexQuery as DocsIndexQuery2
774
+ } from "@contractspec/lib.contracts-spec/docs";
775
+ // src/application/mcp/docsMcp.ts
776
+ import {
777
+ definePrompt as definePrompt3,
778
+ defineResourceTemplate as defineResourceTemplate3,
779
+ installOp as installOp3,
780
+ OperationSpecRegistry as OperationSpecRegistry3,
781
+ PromptRegistry as PromptRegistry3,
782
+ ResourceRegistry as ResourceRegistry3
783
+ } from "@contractspec/lib.contracts-spec";
784
+ import { defaultDocRegistry } from "@contractspec/lib.contracts-spec/docs";
785
+ import z3 from "zod";
786
+ var DOC_OWNERS = ["@contractspec"];
787
+ var DOC_TAGS = ["docs", "mcp"];
788
+ function buildDocResources(routes) {
789
+ const resources = new ResourceRegistry3;
790
+ resources.register(defineResourceTemplate3({
791
+ meta: {
792
+ uriTemplate: "docs://list",
793
+ title: "DocBlocks index",
794
+ description: "All registered DocBlocks with route, visibility, tags, and summary.",
890
795
  mimeType: "application/json",
891
- tags: RANKING_TAGS
796
+ tags: DOC_TAGS
892
797
  },
893
- input: z4.object({ modelId: z4.string() }),
894
- resolve: async ({ modelId }) => {
895
- const store = getStore();
896
- const profile = await store.getModelProfile(modelId);
897
- if (!profile) {
898
- return {
899
- uri: `ranking://model/${encodeURIComponent(modelId)}`,
900
- mimeType: "application/json",
901
- data: JSON.stringify({ error: "not_found", modelId })
902
- };
903
- }
904
- const enriched = profile.costPerMillion == null ? (() => {
905
- const info = getModelInfo(profile.modelId);
906
- return info?.costPerMillion ? {
907
- ...profile,
908
- costPerMillion: info.costPerMillion,
909
- displayName: info.name,
910
- contextWindow: info.contextWindow,
911
- capabilities: [
912
- ...info.capabilities.vision ? ["vision"] : [],
913
- ...info.capabilities.tools ? ["tools"] : [],
914
- ...info.capabilities.reasoning ? ["reasoning"] : [],
915
- ...info.capabilities.streaming ? ["streaming"] : []
916
- ]
917
- } : profile;
918
- })() : profile;
798
+ input: z3.object({}),
799
+ resolve: async () => {
800
+ const docs = routes.map(({ block, route }) => ({
801
+ id: block.id,
802
+ title: block.title,
803
+ summary: block.summary ?? "",
804
+ tags: block.tags ?? [],
805
+ visibility: block.visibility ?? "public",
806
+ route
807
+ }));
919
808
  return {
920
- uri: `ranking://model/${encodeURIComponent(modelId)}`,
809
+ uri: "docs://list",
921
810
  mimeType: "application/json",
922
- data: JSON.stringify(enriched, null, 2)
811
+ data: JSON.stringify(docs, null, 2)
923
812
  };
924
813
  }
925
814
  }));
926
- resources.register(defineResourceTemplate4({
815
+ resources.register(defineResourceTemplate3({
927
816
  meta: {
928
- uriTemplate: "ranking://results",
929
- title: "Benchmark Results",
930
- description: "List of raw benchmark results from all ingested sources.",
931
- mimeType: "application/json",
932
- tags: RANKING_TAGS
817
+ uriTemplate: "docs://doc/{id}",
818
+ title: "DocBlock markdown",
819
+ description: "Fetch DocBlock body by id as markdown.",
820
+ mimeType: "text/markdown",
821
+ tags: DOC_TAGS
933
822
  },
934
- input: z4.object({}),
935
- resolve: async () => {
936
- const store = getStore();
937
- const result = await store.listBenchmarkResults({ limit: 200 });
823
+ input: z3.object({ id: z3.string() }),
824
+ resolve: async ({ id }) => {
825
+ const found = defaultDocRegistry.get(id);
826
+ if (!found) {
827
+ return {
828
+ uri: `docs://doc/${encodeURIComponent(id)}`,
829
+ mimeType: "text/plain",
830
+ data: `DocBlock not found: ${id}`
831
+ };
832
+ }
938
833
  return {
939
- uri: "ranking://results",
940
- mimeType: "application/json",
941
- data: JSON.stringify(result, null, 2)
834
+ uri: `docs://doc/${encodeURIComponent(id)}`,
835
+ mimeType: "text/markdown",
836
+ data: String(found.block.body ?? "")
942
837
  };
943
838
  }
944
839
  }));
945
840
  return resources;
946
841
  }
947
- function buildRankingPrompts() {
948
- const prompts = new PromptRegistry4;
949
- prompts.register(definePrompt4({
842
+ function buildDocPrompts() {
843
+ const prompts = new PromptRegistry3;
844
+ prompts.register(definePrompt3({
950
845
  meta: {
951
- key: "ranking.advisor",
846
+ key: "docs.navigator",
952
847
  version: "1.0.0",
953
- title: "AI Model Advisor",
954
- description: "Which AI model is best for a given task? Uses the leaderboard to recommend.",
955
- tags: RANKING_TAGS,
848
+ title: "Find relevant ContractSpec docs",
849
+ description: "Guide agents to pick the right DocBlock by topic or tag.",
850
+ tags: DOC_TAGS,
956
851
  stability: "beta",
957
- owners: RANKING_OWNERS
852
+ owners: DOC_OWNERS
958
853
  },
959
854
  args: [
960
855
  {
961
- name: "task",
962
- description: "The task or use case to recommend a model for.",
963
- required: true,
964
- schema: z4.string()
965
- },
966
- {
967
- name: "priority",
968
- description: "Priority dimension (coding, reasoning, cost, latency, etc.).",
969
- required: false,
970
- schema: z4.string().optional()
971
- },
972
- {
973
- name: "transport",
974
- description: "Required transport type (rest, mcp, webhook, sdk).",
856
+ name: "topic",
857
+ description: "Goal or subject to search for.",
975
858
  required: false,
976
- schema: TransportFilterSchema
859
+ schema: z3.string().optional()
977
860
  },
978
861
  {
979
- name: "authMethod",
980
- description: "Required auth method (api-key, oauth2, bearer, etc.).",
862
+ name: "tag",
863
+ description: "Optional tag filter.",
981
864
  required: false,
982
- schema: AuthFilterSchema
865
+ schema: z3.string().optional()
983
866
  }
984
867
  ],
985
- input: z4.object({
986
- task: z4.string(),
987
- priority: z4.string().optional(),
988
- transport: TransportFilterSchema,
989
- authMethod: AuthFilterSchema
868
+ input: z3.object({
869
+ topic: z3.string().optional(),
870
+ tag: z3.string().optional()
990
871
  }),
991
- render: async ({ task, priority, transport, authMethod }) => {
992
- const constraints = [];
993
- if (priority)
994
- constraints.push(`Prioritize: ${priority}.`);
995
- if (transport)
996
- constraints.push(`Required transport: ${transport}.`);
997
- if (authMethod)
998
- constraints.push(`Required auth: ${authMethod}.`);
999
- return [
872
+ render: async ({ topic, tag }) => {
873
+ const parts = [
1000
874
  {
1001
875
  type: "text",
1002
- text: `Recommend the best AI model for: "${task}".${constraints.length ? ` ${constraints.join(" ")}` : ""} Use the leaderboard data to justify your recommendation.`
876
+ text: `Use the docs index to choose DocBlocks. If a specific topic is provided, prefer docs whose id/title/summary match it.${topic ? ` Topic: ${topic}.` : ""}${tag ? ` Tag: ${tag}.` : ""}`
1003
877
  },
1004
878
  {
1005
879
  type: "resource",
1006
- uri: priority ? `ranking://leaderboard/${priority}` : "ranking://leaderboard",
1007
- title: "Leaderboard"
880
+ uri: "docs://list",
881
+ title: "DocBlocks index"
1008
882
  }
1009
883
  ];
884
+ return parts;
1010
885
  }
1011
886
  }));
1012
887
  return prompts;
1013
888
  }
1014
- function buildRankingOps() {
1015
- const registry = new OperationSpecRegistry4;
1016
- const ingesterRegistry = createDefaultIngesterRegistry();
1017
- installOp4(registry, BenchmarkIngestCommand, async (args) => {
1018
- const store = getStore();
1019
- const source = args.source;
1020
- const ingester = ingesterRegistry.get(source);
1021
- if (!ingester) {
1022
- throw new Error(`No ingester registered for source: ${source}`);
1023
- }
1024
- const rawResults = await ingester.ingest({
1025
- sourceUrl: args.sourceUrl,
1026
- dimensions: args.dimensions
889
+ function buildDocOps(routes) {
890
+ const registry = new OperationSpecRegistry3;
891
+ installOp3(registry, DocsIndexQuery, async (args) => {
892
+ const query = args.query?.toLowerCase().trim();
893
+ const tagsFilter = args.tag?.map((t) => t.toLowerCase().trim()) ?? [];
894
+ const visibility = args.visibility?.toLowerCase().trim();
895
+ const docs = routes.map(({ block, route }) => ({
896
+ id: block.id,
897
+ title: block.title,
898
+ summary: block.summary ?? "",
899
+ tags: block.tags ?? [],
900
+ visibility: (block.visibility ?? "public").toLowerCase(),
901
+ route
902
+ })).filter((doc) => {
903
+ const matchesQuery = query ? doc.id.toLowerCase().includes(query) || doc.title.toLowerCase().includes(query) || doc.summary.toLowerCase().includes(query) : true;
904
+ const matchesTags = tagsFilter.length ? tagsFilter.every((t) => doc.tags.some((tag) => tag.toLowerCase().includes(t))) : true;
905
+ const matchesVisibility = visibility ? doc.visibility === visibility : true;
906
+ return matchesQuery && matchesTags && matchesVisibility;
1027
907
  });
1028
- const normalized = normalizeBenchmarkResults(rawResults);
1029
- for (const result of normalized) {
1030
- await store.upsertBenchmarkResult(result);
1031
- }
1032
- return {
1033
- ingestionId: `ingest-${source}-${Date.now()}`,
1034
- source,
1035
- resultsCount: normalized.length,
1036
- status: "completed",
1037
- ingestedAt: new Date
1038
- };
1039
- });
1040
- installOp4(registry, BenchmarkRunCustomCommand, async (args) => {
1041
908
  return {
1042
- runId: `custom-${Date.now()}`,
1043
- evalSuiteKey: args.evalSuiteKey,
1044
- modelId: args.modelId,
1045
- status: "started",
1046
- startedAt: new Date
1047
- };
1048
- });
1049
- installOp4(registry, RankingRefreshCommand, async (args) => {
1050
- const store = getStore();
1051
- const allResults = [];
1052
- let offset = 0;
1053
- const pageSize = 500;
1054
- while (true) {
1055
- const page = await store.listBenchmarkResults({
1056
- limit: pageSize,
1057
- offset
1058
- });
1059
- allResults.push(...page.results);
1060
- if (allResults.length >= page.total || page.results.length < pageSize)
1061
- break;
1062
- offset += pageSize;
1063
- }
1064
- const existingRankings = new Map((await store.listModelRankings({ limit: 1e4 })).rankings.map((r) => [
1065
- r.modelId,
1066
- r
1067
- ]));
1068
- const weightOverrides = args.weightOverrides ? Array.isArray(args.weightOverrides) ? args.weightOverrides : [args.weightOverrides] : undefined;
1069
- const newRankings = computeModelRankings(allResults, weightOverrides ? {
1070
- weightOverrides
1071
- } : undefined, existingRankings);
1072
- for (const ranking of newRankings) {
1073
- await store.upsertModelRanking(ranking);
1074
- }
1075
- return {
1076
- modelsRanked: newRankings.length,
1077
- updatedAt: new Date,
1078
- status: "completed"
909
+ docs,
910
+ items: docs,
911
+ total: docs.length
1079
912
  };
1080
913
  });
1081
914
  return registry;
1082
915
  }
1083
- function createProviderRankingMcpHandler(path2 = "/api/mcp/ranking") {
916
+ function createDocsMcpHandler(path2 = "/api/mcp/docs") {
917
+ const routes = defaultDocRegistry.list();
1084
918
  return createMcpElysiaHandler({
1085
919
  logger: appLogger,
1086
920
  path: path2,
1087
- serverName: "contractspec-ranking-mcp",
1088
- ops: buildRankingOps(),
1089
- resources: buildRankingResources(),
1090
- prompts: buildRankingPrompts()
921
+ serverName: "contractspec-docs-mcp",
922
+ ops: buildDocOps(routes),
923
+ resources: buildDocResources(routes),
924
+ prompts: buildDocPrompts(),
925
+ presentations: routes.map(({ descriptor }) => descriptor)
1091
926
  });
1092
927
  }
1093
- function setProviderRankingStore(store) {
1094
- sharedStore = store;
1095
- }
1096
928
 
1097
- // src/application/mcp/contractsMcpTools.ts
929
+ // src/application/mcp/internalMcp.ts
1098
930
  import {
1099
931
  defineCommand as defineCommand3,
1100
- installOp as installOp5,
1101
- OperationSpecRegistry as OperationSpecRegistry5
932
+ definePrompt as definePrompt4,
933
+ defineResourceTemplate as defineResourceTemplate4,
934
+ installOp as installOp4,
935
+ OperationSpecRegistry as OperationSpecRegistry4,
936
+ PromptRegistry as PromptRegistry4,
937
+ ResourceRegistry as ResourceRegistry4
1102
938
  } from "@contractspec/lib.contracts-spec";
1103
939
  import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
1104
- var OWNERS = ["@contractspec"];
1105
- var TAGS = ["contracts", "mcp"];
1106
- function buildContractsOps(services) {
1107
- const registry = new OperationSpecRegistry5;
1108
- const ListInput = defineSchemaModel3({
1109
- name: "ContractsListInput",
1110
- fields: {
1111
- pattern: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
1112
- type: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true }
1113
- }
1114
- });
1115
- const ListOutput = defineSchemaModel3({
1116
- name: "ContractsListOutput",
1117
- fields: {
1118
- specs: { type: ScalarTypeEnum3.JSON(), isOptional: false },
1119
- total: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: false }
1120
- }
1121
- });
1122
- installOp5(registry, defineCommand3({
1123
- meta: {
1124
- key: "contracts.list",
1125
- version: "1.0.0",
1126
- stability: "beta",
1127
- owners: OWNERS,
1128
- tags: TAGS,
1129
- description: "List contract specs in the workspace.",
1130
- goal: "Discover available contracts by type, pattern, or owner.",
1131
- context: "Contracts MCP server."
1132
- },
1133
- io: { input: ListInput, output: ListOutput },
1134
- policy: { auth: "anonymous" }
1135
- }), async ({ pattern, type }) => {
1136
- const specs = await services.listSpecs({ pattern, type });
1137
- return { specs, total: specs.length };
1138
- });
1139
- const GetInput = defineSchemaModel3({
1140
- name: "ContractsGetInput",
1141
- fields: {
1142
- path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
1143
- }
1144
- });
1145
- const GetOutput = defineSchemaModel3({
1146
- name: "ContractsGetOutput",
1147
- fields: {
1148
- content: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
1149
- info: { type: ScalarTypeEnum3.JSON(), isOptional: false }
1150
- }
1151
- });
1152
- installOp5(registry, defineCommand3({
940
+ import {
941
+ getExample,
942
+ listExamples,
943
+ searchExamples
944
+ } from "@contractspec/module.examples";
945
+ import z4 from "zod";
946
+ var INTERNAL_TAGS = ["internal", "mcp"];
947
+ var INTERNAL_OWNERS = ["@contractspec"];
948
+ var ENDPOINTS = {
949
+ docs: "/api/mcp/docs",
950
+ cli: "/api/mcp/cli",
951
+ internal: "/api/mcp/internal",
952
+ graphql: "/graphql",
953
+ health: "/health"
954
+ };
955
+ function buildInternalResources() {
956
+ const resources = new ResourceRegistry4;
957
+ resources.register(defineResourceTemplate4({
1153
958
  meta: {
1154
- key: "contracts.get",
1155
- version: "1.0.0",
1156
- stability: "beta",
1157
- owners: OWNERS,
1158
- tags: TAGS,
1159
- description: "Read a single contract spec file.",
1160
- goal: "Fetch spec content and parsed metadata.",
1161
- context: "Contracts MCP server."
959
+ uriTemplate: "examples://list{?q}",
960
+ title: "ContractSpec examples registry",
961
+ description: "List available examples (templates, integrations, knowledge, scripts). Optional query `q` filters results.",
962
+ mimeType: "application/json",
963
+ tags: ["examples", ...INTERNAL_TAGS]
1162
964
  },
1163
- io: { input: GetInput, output: GetOutput },
1164
- policy: { auth: "anonymous" }
1165
- }), async ({ path: path2 }) => {
1166
- const result = await services.getSpec(path2);
1167
- if (!result)
1168
- throw new Error(`Spec not found: ${path2}`);
1169
- return result;
1170
- });
1171
- const ValidateInput = defineSchemaModel3({
1172
- name: "ContractsValidateInput",
1173
- fields: {
1174
- path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
1175
- }
1176
- });
1177
- const ValidateOutput = defineSchemaModel3({
1178
- name: "ContractsValidateOutput",
1179
- fields: {
1180
- valid: { type: ScalarTypeEnum3.Boolean(), isOptional: false },
1181
- errors: { type: ScalarTypeEnum3.JSON(), isOptional: false },
1182
- warnings: { type: ScalarTypeEnum3.JSON(), isOptional: false }
965
+ input: z4.object({ q: z4.string().optional() }),
966
+ resolve: async ({ q }) => {
967
+ const items = q ? searchExamples(q) : [...listExamples()];
968
+ return {
969
+ uri: q ? `examples://list?q=${encodeURIComponent(q)}` : "examples://list",
970
+ mimeType: "application/json",
971
+ data: JSON.stringify(items, null, 2)
972
+ };
1183
973
  }
1184
- });
1185
- installOp5(registry, defineCommand3({
974
+ }));
975
+ resources.register(defineResourceTemplate4({
1186
976
  meta: {
1187
- key: "contracts.validate",
1188
- version: "1.0.0",
1189
- stability: "beta",
1190
- owners: OWNERS,
1191
- tags: TAGS,
1192
- description: "Validate a contract spec structure.",
1193
- goal: "Check spec for structural or policy issues.",
1194
- context: "Contracts MCP server."
977
+ uriTemplate: "examples://example/{id}",
978
+ title: "ContractSpec example (by id)",
979
+ description: "Fetch a single example manifest by id.",
980
+ mimeType: "application/json",
981
+ tags: ["examples", ...INTERNAL_TAGS]
1195
982
  },
1196
- io: { input: ValidateInput, output: ValidateOutput },
1197
- policy: { auth: "anonymous" }
1198
- }), async ({ path: path2 }) => services.validateSpec(path2));
1199
- const BuildInput = defineSchemaModel3({
1200
- name: "ContractsBuildInput",
1201
- fields: {
1202
- path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
1203
- dryRun: { type: ScalarTypeEnum3.Boolean(), isOptional: true }
1204
- }
1205
- });
1206
- const BuildOutput = defineSchemaModel3({
1207
- name: "ContractsBuildOutput",
1208
- fields: {
1209
- results: { type: ScalarTypeEnum3.JSON(), isOptional: false }
983
+ input: z4.object({ id: z4.string().min(1) }),
984
+ resolve: async ({ id }) => {
985
+ const example = getExample(id);
986
+ if (!example) {
987
+ return {
988
+ uri: `examples://example/${encodeURIComponent(id)}`,
989
+ mimeType: "application/json",
990
+ data: JSON.stringify({ error: "not_found", id, message: `Unknown example id: ${id}` }, null, 2)
991
+ };
992
+ }
993
+ return {
994
+ uri: `examples://example/${encodeURIComponent(id)}`,
995
+ mimeType: "application/json",
996
+ data: JSON.stringify(example, null, 2)
997
+ };
1210
998
  }
1211
- });
1212
- installOp5(registry, defineCommand3({
999
+ }));
1000
+ resources.register(defineResourceTemplate4({
1213
1001
  meta: {
1214
- key: "contracts.build",
1215
- version: "1.0.0",
1216
- stability: "beta",
1217
- owners: OWNERS,
1218
- tags: TAGS,
1219
- description: "Generate implementation code from a contract spec.",
1220
- goal: "Produce handler, component, or test skeletons.",
1221
- context: "Contracts MCP server."
1002
+ uriTemplate: "internal://endpoints",
1003
+ title: "ContractSpec MCP endpoints",
1004
+ description: "Endpoints for docs, CLI, internal MCP servers.",
1005
+ mimeType: "application/json",
1006
+ tags: INTERNAL_TAGS
1222
1007
  },
1223
- io: { input: BuildInput, output: BuildOutput },
1224
- policy: { auth: "user" }
1225
- }), async ({ path: path2, dryRun }) => services.buildSpec(path2, { dryRun }));
1226
- registerMutationTools(registry, services);
1227
- return registry;
1008
+ input: z4.object({}),
1009
+ resolve: async () => ({
1010
+ uri: "internal://endpoints",
1011
+ mimeType: "application/json",
1012
+ data: JSON.stringify(ENDPOINTS, null, 2)
1013
+ })
1014
+ }));
1015
+ resources.register(defineResourceTemplate4({
1016
+ meta: {
1017
+ uriTemplate: "internal://playbook",
1018
+ title: "Internal MCP usage playbook",
1019
+ description: "How internal agents should discover docs, CLI usage, and endpoints.",
1020
+ mimeType: "text/markdown",
1021
+ tags: INTERNAL_TAGS
1022
+ },
1023
+ input: z4.object({}),
1024
+ resolve: async () => ({
1025
+ uri: "internal://playbook",
1026
+ mimeType: "text/markdown",
1027
+ data: [
1028
+ "# Internal MCP playbook",
1029
+ "- Connect to docs MCP first for canonical specs.",
1030
+ "- Use CLI MCP to surface quickstart/reference before running commands.",
1031
+ "- Keep calls read-only unless explicitly approved.",
1032
+ `- Endpoints: ${ENDPOINTS.docs}, ${ENDPOINTS.cli}, ${ENDPOINTS.internal}.`,
1033
+ "- For API work, GraphQL at /graphql; health at /health."
1034
+ ].join(`
1035
+ `)
1036
+ })
1037
+ }));
1038
+ return resources;
1228
1039
  }
1229
- function registerMutationTools(registry, services) {
1230
- const UpdateInput = defineSchemaModel3({
1231
- name: "ContractsUpdateInput",
1232
- fields: {
1233
- path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
1234
- content: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
1235
- fields: { type: ScalarTypeEnum3.JSON(), isOptional: true }
1236
- }
1237
- });
1238
- const UpdateOutput = defineSchemaModel3({
1239
- name: "ContractsUpdateOutput",
1240
- fields: {
1241
- updated: { type: ScalarTypeEnum3.Boolean(), isOptional: false },
1242
- errors: { type: ScalarTypeEnum3.JSON(), isOptional: false },
1243
- warnings: { type: ScalarTypeEnum3.JSON(), isOptional: false }
1244
- }
1245
- });
1246
- installOp5(registry, defineCommand3({
1040
+ function buildInternalPrompts() {
1041
+ const prompts = new PromptRegistry4;
1042
+ prompts.register(definePrompt4({
1247
1043
  meta: {
1248
- key: "contracts.update",
1044
+ key: "internal_bootstrap",
1249
1045
  version: "1.0.0",
1250
- stability: "beta",
1251
- owners: OWNERS,
1252
- tags: TAGS,
1253
- description: "Update an existing contract spec.",
1254
- goal: "Modify spec content or individual fields with validation.",
1255
- context: "Contracts MCP server."
1046
+ title: "Bootstrap internal ContractSpec agent",
1047
+ description: "Points agents to the correct MCP endpoints and guardrails.",
1048
+ tags: INTERNAL_TAGS,
1049
+ owners: INTERNAL_OWNERS,
1050
+ stability: "beta"
1256
1051
  },
1257
- io: { input: UpdateInput, output: UpdateOutput },
1258
- policy: { auth: "user" }
1259
- }), async ({ path: path2, content, fields }) => services.updateSpec(path2, {
1260
- content,
1261
- fields: Array.isArray(fields) ? fields : undefined
1052
+ args: [],
1053
+ input: z4.object({}),
1054
+ render: async () => [
1055
+ {
1056
+ type: "text",
1057
+ text: "Start with internal://endpoints to pick the right MCP. Use docs MCP for specifications and CLI MCP for commands. Keep actions read-only unless explicitly approved."
1058
+ },
1059
+ {
1060
+ type: "resource",
1061
+ uri: "internal://endpoints",
1062
+ title: "Endpoints"
1063
+ }
1064
+ ]
1262
1065
  }));
1263
- const DeleteInput = defineSchemaModel3({
1264
- name: "ContractsDeleteInput",
1265
- fields: {
1266
- path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
1267
- clean: { type: ScalarTypeEnum3.Boolean(), isOptional: true }
1268
- }
1269
- });
1270
- const DeleteOutput = defineSchemaModel3({
1271
- name: "ContractsDeleteOutput",
1066
+ return prompts;
1067
+ }
1068
+ function buildInternalOps() {
1069
+ const registry = new OperationSpecRegistry4;
1070
+ const InternalDescribeOutput = defineSchemaModel3({
1071
+ name: "InternalDescribeOutput",
1272
1072
  fields: {
1273
- deleted: { type: ScalarTypeEnum3.Boolean(), isOptional: false },
1274
- cleanedFiles: { type: ScalarTypeEnum3.JSON(), isOptional: false },
1275
- errors: { type: ScalarTypeEnum3.JSON(), isOptional: false }
1073
+ endpoints: {
1074
+ type: ScalarTypeEnum3.JSONObject(),
1075
+ isOptional: false
1076
+ },
1077
+ notes: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
1276
1078
  }
1277
1079
  });
1278
- installOp5(registry, defineCommand3({
1080
+ const describeSpec = defineCommand3({
1279
1081
  meta: {
1280
- key: "contracts.delete",
1082
+ key: "internal_describe",
1281
1083
  version: "1.0.0",
1282
- stability: "beta",
1283
- owners: OWNERS,
1284
- tags: TAGS,
1285
- description: "Delete a contract spec and optionally its artifacts.",
1286
- goal: "Remove a spec file and clean generated handlers/tests.",
1287
- context: "Contracts MCP server."
1084
+ stability: "stable",
1085
+ owners: INTERNAL_OWNERS,
1086
+ tags: INTERNAL_TAGS,
1087
+ description: "Return MCP endpoints and guidance for internal ContractSpec agents.",
1088
+ goal: "Speed up internal development with the correct MCP entrypoints.",
1089
+ context: "Used by internal MCP surface; read-only."
1288
1090
  },
1289
- io: { input: DeleteInput, output: DeleteOutput },
1290
- policy: { auth: "user" }
1291
- }), async ({ path: path2, clean }) => services.deleteSpec(path2, { clean }));
1091
+ io: {
1092
+ input: defineSchemaModel3({
1093
+ name: "InternalDescribeInput",
1094
+ fields: {}
1095
+ }),
1096
+ output: InternalDescribeOutput
1097
+ },
1098
+ policy: {
1099
+ auth: "anonymous"
1100
+ }
1101
+ });
1102
+ installOp4(registry, describeSpec, async () => ({
1103
+ endpoints: ENDPOINTS,
1104
+ notes: "Use docs MCP for canonical specs, CLI MCP for contractspec commands, and keep side-effecting actions gated behind human review."
1105
+ }));
1106
+ return registry;
1107
+ }
1108
+ function createInternalMcpHandler(path2 = "/api/mcp/internal") {
1109
+ return createMcpElysiaHandler({
1110
+ logger: appLogger,
1111
+ path: path2,
1112
+ serverName: "contractspec-internal-mcp",
1113
+ ops: buildInternalOps(),
1114
+ resources: buildInternalResources(),
1115
+ prompts: buildInternalPrompts()
1116
+ });
1292
1117
  }
1293
1118
 
1294
- // src/application/mcp/contractsMcpResources.ts
1119
+ // src/application/mcp/providerRankingMcp.ts
1120
+ import { getModelInfo } from "@contractspec/lib.ai-providers/models";
1295
1121
  import {
1296
1122
  definePrompt as definePrompt5,
1297
1123
  defineResourceTemplate as defineResourceTemplate5,
1124
+ installOp as installOp5,
1125
+ OperationSpecRegistry as OperationSpecRegistry5,
1298
1126
  PromptRegistry as PromptRegistry5,
1299
1127
  ResourceRegistry as ResourceRegistry5
1300
1128
  } from "@contractspec/lib.contracts-spec";
1129
+ import {
1130
+ BenchmarkIngestCommand,
1131
+ BenchmarkRunCustomCommand,
1132
+ RankingRefreshCommand
1133
+ } from "@contractspec/lib.contracts-spec/provider-ranking";
1134
+ import { InMemoryProviderRankingStore } from "@contractspec/lib.provider-ranking/in-memory-store";
1135
+ import { createDefaultIngesterRegistry } from "@contractspec/lib.provider-ranking/ingesters";
1136
+ import {
1137
+ computeModelRankings,
1138
+ normalizeBenchmarkResults
1139
+ } from "@contractspec/lib.provider-ranking/scoring";
1301
1140
  import z5 from "zod";
1302
- var OWNERS2 = ["@contractspec"];
1303
- var TAGS2 = ["contracts", "mcp"];
1304
- function buildContractsResources(services) {
1141
+ var TransportFilterSchema = z5.enum(["rest", "mcp", "webhook", "sdk"]).optional();
1142
+ var AuthFilterSchema = z5.enum([
1143
+ "api-key",
1144
+ "oauth2",
1145
+ "bearer",
1146
+ "header",
1147
+ "basic",
1148
+ "webhook-signing",
1149
+ "service-account"
1150
+ ]).optional();
1151
+ var RANKING_TAGS = ["ranking", "mcp", "ai"];
1152
+ var RANKING_OWNERS = ["platform.ai"];
1153
+ var sharedStore = null;
1154
+ function getStore() {
1155
+ if (!sharedStore) {
1156
+ sharedStore = new InMemoryProviderRankingStore;
1157
+ }
1158
+ return sharedStore;
1159
+ }
1160
+ function buildRankingResources() {
1305
1161
  const resources = new ResourceRegistry5;
1306
1162
  resources.register(defineResourceTemplate5({
1307
1163
  meta: {
1308
- uriTemplate: "contracts://list",
1309
- title: "Contract specs list",
1310
- description: "JSON list of all contract specs in the workspace.",
1164
+ uriTemplate: "ranking://leaderboard",
1165
+ title: "AI Model Leaderboard",
1166
+ description: "Current ranked list of AI models by composite score. Supports optional transport and authMethod query filters.",
1167
+ mimeType: "application/json",
1168
+ tags: RANKING_TAGS
1169
+ },
1170
+ input: z5.object({
1171
+ transport: TransportFilterSchema,
1172
+ authMethod: AuthFilterSchema
1173
+ }),
1174
+ resolve: async ({ transport, authMethod }) => {
1175
+ const store = getStore();
1176
+ const result = await store.listModelRankings({
1177
+ limit: 100,
1178
+ requiredTransport: transport,
1179
+ requiredAuthMethod: authMethod
1180
+ });
1181
+ return {
1182
+ uri: "ranking://leaderboard",
1183
+ mimeType: "application/json",
1184
+ data: JSON.stringify(result, null, 2)
1185
+ };
1186
+ }
1187
+ }));
1188
+ resources.register(defineResourceTemplate5({
1189
+ meta: {
1190
+ uriTemplate: "ranking://leaderboard/{dimension}",
1191
+ title: "AI Model Leaderboard by Dimension",
1192
+ description: "Ranked list of AI models filtered by a specific dimension. Supports optional transport and authMethod query filters.",
1311
1193
  mimeType: "application/json",
1312
- tags: TAGS2
1194
+ tags: RANKING_TAGS
1313
1195
  },
1314
- input: z5.object({}),
1315
- resolve: async () => {
1316
- const specs = await services.listSpecs();
1196
+ input: z5.object({
1197
+ dimension: z5.string(),
1198
+ transport: TransportFilterSchema,
1199
+ authMethod: AuthFilterSchema
1200
+ }),
1201
+ resolve: async ({ dimension, transport, authMethod }) => {
1202
+ const store = getStore();
1203
+ const result = await store.listModelRankings({
1204
+ dimension,
1205
+ limit: 100,
1206
+ requiredTransport: transport,
1207
+ requiredAuthMethod: authMethod
1208
+ });
1317
1209
  return {
1318
- uri: "contracts://list",
1210
+ uri: `ranking://leaderboard/${encodeURIComponent(dimension)}`,
1319
1211
  mimeType: "application/json",
1320
- data: JSON.stringify(specs, null, 2)
1212
+ data: JSON.stringify(result, null, 2)
1321
1213
  };
1322
1214
  }
1323
1215
  }));
1324
1216
  resources.register(defineResourceTemplate5({
1325
1217
  meta: {
1326
- uriTemplate: "contracts://spec/{path}",
1327
- title: "Contract spec content",
1328
- description: "Read a single contract spec file by path.",
1329
- mimeType: "text/plain",
1330
- tags: TAGS2
1218
+ uriTemplate: "ranking://model/{modelId}",
1219
+ title: "AI Model Profile",
1220
+ description: "Detailed profile for a specific AI model including scores and benchmarks.",
1221
+ mimeType: "application/json",
1222
+ tags: RANKING_TAGS
1331
1223
  },
1332
- input: z5.object({ path: z5.string() }),
1333
- resolve: async ({ path: path2 }) => {
1334
- const result = await services.getSpec(path2);
1335
- if (!result) {
1224
+ input: z5.object({ modelId: z5.string() }),
1225
+ resolve: async ({ modelId }) => {
1226
+ const store = getStore();
1227
+ const profile = await store.getModelProfile(modelId);
1228
+ if (!profile) {
1336
1229
  return {
1337
- uri: `contracts://spec/${encodeURIComponent(path2)}`,
1338
- mimeType: "text/plain",
1339
- data: `Spec not found: ${path2}`
1230
+ uri: `ranking://model/${encodeURIComponent(modelId)}`,
1231
+ mimeType: "application/json",
1232
+ data: JSON.stringify({ error: "not_found", modelId })
1340
1233
  };
1341
1234
  }
1235
+ const enriched = profile.costPerMillion == null ? (() => {
1236
+ const info = getModelInfo(profile.modelId);
1237
+ return info?.costPerMillion ? {
1238
+ ...profile,
1239
+ costPerMillion: info.costPerMillion,
1240
+ displayName: info.name,
1241
+ contextWindow: info.contextWindow,
1242
+ capabilities: [
1243
+ ...info.capabilities.vision ? ["vision"] : [],
1244
+ ...info.capabilities.tools ? ["tools"] : [],
1245
+ ...info.capabilities.reasoning ? ["reasoning"] : [],
1246
+ ...info.capabilities.streaming ? ["streaming"] : []
1247
+ ]
1248
+ } : profile;
1249
+ })() : profile;
1342
1250
  return {
1343
- uri: `contracts://spec/${encodeURIComponent(path2)}`,
1344
- mimeType: "text/plain",
1345
- data: result.content
1251
+ uri: `ranking://model/${encodeURIComponent(modelId)}`,
1252
+ mimeType: "application/json",
1253
+ data: JSON.stringify(enriched, null, 2)
1346
1254
  };
1347
1255
  }
1348
1256
  }));
1349
1257
  resources.register(defineResourceTemplate5({
1350
1258
  meta: {
1351
- uriTemplate: "contracts://registry/manifest",
1352
- title: "Remote registry manifest",
1353
- description: "Contract registry manifest from the remote server.",
1259
+ uriTemplate: "ranking://results",
1260
+ title: "Benchmark Results",
1261
+ description: "List of raw benchmark results from all ingested sources.",
1354
1262
  mimeType: "application/json",
1355
- tags: TAGS2
1263
+ tags: RANKING_TAGS
1356
1264
  },
1357
1265
  input: z5.object({}),
1358
1266
  resolve: async () => {
1359
- const manifest = await services.fetchRegistryManifest();
1267
+ const store = getStore();
1268
+ const result = await store.listBenchmarkResults({ limit: 200 });
1360
1269
  return {
1361
- uri: "contracts://registry/manifest",
1270
+ uri: "ranking://results",
1362
1271
  mimeType: "application/json",
1363
- data: JSON.stringify(manifest, null, 2)
1272
+ data: JSON.stringify(result, null, 2)
1364
1273
  };
1365
1274
  }
1366
1275
  }));
1367
1276
  return resources;
1368
1277
  }
1369
- function buildContractsPrompts() {
1278
+ function buildRankingPrompts() {
1370
1279
  const prompts = new PromptRegistry5;
1371
1280
  prompts.register(definePrompt5({
1372
1281
  meta: {
1373
- key: "contracts.editor",
1282
+ key: "ranking.advisor",
1374
1283
  version: "1.0.0",
1375
- title: "Contract editing guide",
1376
- description: "Guide AI agents through reading, editing, and validating contracts.",
1377
- tags: TAGS2,
1284
+ title: "AI Model Advisor",
1285
+ description: "Which AI model is best for a given task? Uses the leaderboard to recommend.",
1286
+ tags: RANKING_TAGS,
1378
1287
  stability: "beta",
1379
- owners: OWNERS2
1288
+ owners: RANKING_OWNERS
1380
1289
  },
1381
1290
  args: [
1382
1291
  {
1383
- name: "goal",
1384
- description: "What the agent wants to achieve with the contract.",
1292
+ name: "task",
1293
+ description: "The task or use case to recommend a model for.",
1294
+ required: true,
1295
+ schema: z5.string()
1296
+ },
1297
+ {
1298
+ name: "priority",
1299
+ description: "Priority dimension (coding, reasoning, cost, latency, etc.).",
1385
1300
  required: false,
1386
1301
  schema: z5.string().optional()
1387
- }
1388
- ],
1389
- input: z5.object({ goal: z5.string().optional() }),
1390
- render: async ({ goal }) => [
1302
+ },
1391
1303
  {
1392
- type: "text",
1393
- text: [
1394
- "Contract editing workflow:",
1395
- "1. Use contracts.list to discover specs",
1396
- "2. Use contracts.get to read a spec",
1397
- "3. Edit content and call contracts.update",
1398
- "4. Run contracts.validate to verify changes",
1399
- "5. Run contracts.build to regenerate artifacts",
1400
- goal ? `Agent goal: ${goal}` : ""
1401
- ].filter(Boolean).join(`
1402
- `)
1304
+ name: "transport",
1305
+ description: "Required transport type (rest, mcp, webhook, sdk).",
1306
+ required: false,
1307
+ schema: TransportFilterSchema
1403
1308
  },
1404
1309
  {
1405
- type: "resource",
1406
- uri: "contracts://list",
1407
- title: "Available contracts"
1310
+ name: "authMethod",
1311
+ description: "Required auth method (api-key, oauth2, bearer, etc.).",
1312
+ required: false,
1313
+ schema: AuthFilterSchema
1408
1314
  }
1409
- ]
1315
+ ],
1316
+ input: z5.object({
1317
+ task: z5.string(),
1318
+ priority: z5.string().optional(),
1319
+ transport: TransportFilterSchema,
1320
+ authMethod: AuthFilterSchema
1321
+ }),
1322
+ render: async ({ task, priority, transport, authMethod }) => {
1323
+ const constraints = [];
1324
+ if (priority)
1325
+ constraints.push(`Prioritize: ${priority}.`);
1326
+ if (transport)
1327
+ constraints.push(`Required transport: ${transport}.`);
1328
+ if (authMethod)
1329
+ constraints.push(`Required auth: ${authMethod}.`);
1330
+ return [
1331
+ {
1332
+ type: "text",
1333
+ text: `Recommend the best AI model for: "${task}".${constraints.length ? ` ${constraints.join(" ")}` : ""} Use the leaderboard data to justify your recommendation.`
1334
+ },
1335
+ {
1336
+ type: "resource",
1337
+ uri: priority ? `ranking://leaderboard/${priority}` : "ranking://leaderboard",
1338
+ title: "Leaderboard"
1339
+ }
1340
+ ];
1341
+ }
1410
1342
  }));
1411
1343
  return prompts;
1412
1344
  }
1413
-
1414
- // src/application/mcp/contractsMcp.ts
1415
- function createContractsMcpHandler(path2 = "/api/mcp/contracts", services) {
1345
+ function buildRankingOps() {
1346
+ const registry = new OperationSpecRegistry5;
1347
+ const ingesterRegistry = createDefaultIngesterRegistry();
1348
+ installOp5(registry, BenchmarkIngestCommand, async (args) => {
1349
+ const store = getStore();
1350
+ const source = args.source;
1351
+ const ingester = ingesterRegistry.get(source);
1352
+ if (!ingester) {
1353
+ throw new Error(`No ingester registered for source: ${source}`);
1354
+ }
1355
+ const rawResults = await ingester.ingest({
1356
+ sourceUrl: args.sourceUrl,
1357
+ dimensions: args.dimensions
1358
+ });
1359
+ const normalized = normalizeBenchmarkResults(rawResults);
1360
+ for (const result of normalized) {
1361
+ await store.upsertBenchmarkResult(result);
1362
+ }
1363
+ return {
1364
+ ingestionId: `ingest-${source}-${Date.now()}`,
1365
+ source,
1366
+ resultsCount: normalized.length,
1367
+ status: "completed",
1368
+ ingestedAt: new Date
1369
+ };
1370
+ });
1371
+ installOp5(registry, BenchmarkRunCustomCommand, async (args) => {
1372
+ return {
1373
+ runId: `custom-${Date.now()}`,
1374
+ evalSuiteKey: args.evalSuiteKey,
1375
+ modelId: args.modelId,
1376
+ status: "started",
1377
+ startedAt: new Date
1378
+ };
1379
+ });
1380
+ installOp5(registry, RankingRefreshCommand, async (args) => {
1381
+ const store = getStore();
1382
+ const allResults = [];
1383
+ let offset = 0;
1384
+ const pageSize = 500;
1385
+ while (true) {
1386
+ const page = await store.listBenchmarkResults({
1387
+ limit: pageSize,
1388
+ offset
1389
+ });
1390
+ allResults.push(...page.results);
1391
+ if (allResults.length >= page.total || page.results.length < pageSize)
1392
+ break;
1393
+ offset += pageSize;
1394
+ }
1395
+ const existingRankings = new Map((await store.listModelRankings({ limit: 1e4 })).rankings.map((r) => [
1396
+ r.modelId,
1397
+ r
1398
+ ]));
1399
+ const weightOverrides = args.weightOverrides ? Array.isArray(args.weightOverrides) ? args.weightOverrides : [args.weightOverrides] : undefined;
1400
+ const newRankings = computeModelRankings(allResults, weightOverrides ? {
1401
+ weightOverrides
1402
+ } : undefined, existingRankings);
1403
+ for (const ranking of newRankings) {
1404
+ await store.upsertModelRanking(ranking);
1405
+ }
1406
+ return {
1407
+ modelsRanked: newRankings.length,
1408
+ updatedAt: new Date,
1409
+ status: "completed"
1410
+ };
1411
+ });
1412
+ return registry;
1413
+ }
1414
+ function createProviderRankingMcpHandler(path2 = "/api/mcp/ranking") {
1416
1415
  return createMcpElysiaHandler({
1417
1416
  logger: appLogger,
1418
1417
  path: path2,
1419
- serverName: "contractspec-contracts-mcp",
1420
- ops: buildContractsOps(services),
1421
- resources: buildContractsResources(services),
1422
- prompts: buildContractsPrompts()
1418
+ serverName: "contractspec-ranking-mcp",
1419
+ ops: buildRankingOps(),
1420
+ resources: buildRankingResources(),
1421
+ prompts: buildRankingPrompts()
1423
1422
  });
1424
1423
  }
1424
+ function setProviderRankingStore(store) {
1425
+ sharedStore = store;
1426
+ }
1425
1427
  export {
1426
1428
  setProviderRankingStore,
1427
1429
  createProviderRankingMcpHandler,