@contractspec/bundle.library 3.7.6 → 3.8.2

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