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