@contractspec/bundle.library 3.7.5 → 3.7.7

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