@contractspec/bundle.library 3.7.6 → 3.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +144 -142
- package/AGENTS.md +42 -24
- 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 +4 -4
- package/dist/components/docs/examples/index.js +4 -4
- 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 +14060 -15332
- 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 +14982 -16254
- 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 +4 -4
- package/dist/node/components/docs/examples/index.js +4 -4
- 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 +14060 -15332
- 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 +14982 -16254
- 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 +38 -24
- 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 +67 -66
- 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
|
@@ -1,10 +1,37 @@
|
|
|
1
|
+
// src/infrastructure/elysia/logger.ts
|
|
2
|
+
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
3
|
+
var createAppLogger = () => new Logger({
|
|
4
|
+
level: LogLevel.INFO,
|
|
5
|
+
environment: "production",
|
|
6
|
+
enableTracing: true,
|
|
7
|
+
enableTiming: true,
|
|
8
|
+
enableContext: true,
|
|
9
|
+
enableColors: false
|
|
10
|
+
});
|
|
11
|
+
var appLogger = createAppLogger();
|
|
12
|
+
var dbLogger = new Logger({
|
|
13
|
+
level: LogLevel.WARN,
|
|
14
|
+
environment: "production",
|
|
15
|
+
enableTracing: true,
|
|
16
|
+
enableTiming: true,
|
|
17
|
+
enableContext: true,
|
|
18
|
+
enableColors: false
|
|
19
|
+
});
|
|
20
|
+
var authLogger = new Logger({
|
|
21
|
+
level: LogLevel.INFO,
|
|
22
|
+
environment: "production",
|
|
23
|
+
enableTracing: true,
|
|
24
|
+
enableTiming: true,
|
|
25
|
+
enableContext: true,
|
|
26
|
+
enableColors: false
|
|
27
|
+
});
|
|
1
28
|
// src/application/mcp/common.ts
|
|
2
|
-
import {
|
|
29
|
+
import { randomUUID } from "node:crypto";
|
|
3
30
|
import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
|
|
31
|
+
import { PresentationRegistry } from "@contractspec/lib.contracts-spec/presentations";
|
|
4
32
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
33
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
6
34
|
import { Elysia } from "elysia";
|
|
7
|
-
import { randomUUID } from "node:crypto";
|
|
8
35
|
var baseCtx = {
|
|
9
36
|
actor: "anonymous",
|
|
10
37
|
decide: async () => ({ effect: "allow" })
|
|
@@ -170,44 +197,10 @@ function createMcpElysiaHandler({
|
|
|
170
197
|
});
|
|
171
198
|
}
|
|
172
199
|
|
|
173
|
-
// src/
|
|
174
|
-
import
|
|
175
|
-
var createAppLogger = () => new Logger({
|
|
176
|
-
level: LogLevel.INFO,
|
|
177
|
-
environment: "production",
|
|
178
|
-
enableTracing: true,
|
|
179
|
-
enableTiming: true,
|
|
180
|
-
enableContext: true,
|
|
181
|
-
enableColors: false
|
|
182
|
-
});
|
|
183
|
-
var appLogger = createAppLogger();
|
|
184
|
-
var dbLogger = new Logger({
|
|
185
|
-
level: LogLevel.WARN,
|
|
186
|
-
environment: "production",
|
|
187
|
-
enableTracing: true,
|
|
188
|
-
enableTiming: true,
|
|
189
|
-
enableContext: true,
|
|
190
|
-
enableColors: false
|
|
191
|
-
});
|
|
192
|
-
var authLogger = new Logger({
|
|
193
|
-
level: LogLevel.INFO,
|
|
194
|
-
environment: "production",
|
|
195
|
-
enableTracing: true,
|
|
196
|
-
enableTiming: true,
|
|
197
|
-
enableContext: true,
|
|
198
|
-
enableColors: false
|
|
199
|
-
});
|
|
200
|
-
// src/features/docs/docs.contracts.ts
|
|
201
|
-
import {
|
|
202
|
-
DocSummaryModel,
|
|
203
|
-
DocsIndexInput,
|
|
204
|
-
DocsIndexOutput,
|
|
205
|
-
DocsIndexQuery,
|
|
206
|
-
DocsIndexQuery as DocsIndexQuery2,
|
|
207
|
-
ContractReferenceQuery
|
|
208
|
-
} from "@contractspec/lib.contracts-spec/docs";
|
|
209
|
-
// src/application/mcp/docsMcp.ts
|
|
200
|
+
// src/application/mcp/cliMcp.ts
|
|
201
|
+
import fs from "node:fs/promises";
|
|
210
202
|
import {
|
|
203
|
+
defineCommand,
|
|
211
204
|
definePrompt,
|
|
212
205
|
defineResourceTemplate,
|
|
213
206
|
installOp,
|
|
@@ -215,165 +208,9 @@ import {
|
|
|
215
208
|
PromptRegistry,
|
|
216
209
|
ResourceRegistry
|
|
217
210
|
} from "@contractspec/lib.contracts-spec";
|
|
218
|
-
import { defaultDocRegistry } from "@contractspec/lib.contracts-spec/docs";
|
|
219
|
-
import z from "zod";
|
|
220
|
-
var DOC_OWNERS = ["@contractspec"];
|
|
221
|
-
var DOC_TAGS = ["docs", "mcp"];
|
|
222
|
-
function buildDocResources(routes) {
|
|
223
|
-
const resources = new ResourceRegistry;
|
|
224
|
-
resources.register(defineResourceTemplate({
|
|
225
|
-
meta: {
|
|
226
|
-
uriTemplate: "docs://list",
|
|
227
|
-
title: "DocBlocks index",
|
|
228
|
-
description: "All registered DocBlocks with route, visibility, tags, and summary.",
|
|
229
|
-
mimeType: "application/json",
|
|
230
|
-
tags: DOC_TAGS
|
|
231
|
-
},
|
|
232
|
-
input: z.object({}),
|
|
233
|
-
resolve: async () => {
|
|
234
|
-
const docs = routes.map(({ block, route }) => ({
|
|
235
|
-
id: block.id,
|
|
236
|
-
title: block.title,
|
|
237
|
-
summary: block.summary ?? "",
|
|
238
|
-
tags: block.tags ?? [],
|
|
239
|
-
visibility: block.visibility ?? "public",
|
|
240
|
-
route
|
|
241
|
-
}));
|
|
242
|
-
return {
|
|
243
|
-
uri: "docs://list",
|
|
244
|
-
mimeType: "application/json",
|
|
245
|
-
data: JSON.stringify(docs, null, 2)
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
}));
|
|
249
|
-
resources.register(defineResourceTemplate({
|
|
250
|
-
meta: {
|
|
251
|
-
uriTemplate: "docs://doc/{id}",
|
|
252
|
-
title: "DocBlock markdown",
|
|
253
|
-
description: "Fetch DocBlock body by id as markdown.",
|
|
254
|
-
mimeType: "text/markdown",
|
|
255
|
-
tags: DOC_TAGS
|
|
256
|
-
},
|
|
257
|
-
input: z.object({ id: z.string() }),
|
|
258
|
-
resolve: async ({ id }) => {
|
|
259
|
-
const found = defaultDocRegistry.get(id);
|
|
260
|
-
if (!found) {
|
|
261
|
-
return {
|
|
262
|
-
uri: `docs://doc/${encodeURIComponent(id)}`,
|
|
263
|
-
mimeType: "text/plain",
|
|
264
|
-
data: `DocBlock not found: ${id}`
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
return {
|
|
268
|
-
uri: `docs://doc/${encodeURIComponent(id)}`,
|
|
269
|
-
mimeType: "text/markdown",
|
|
270
|
-
data: String(found.block.body ?? "")
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
}));
|
|
274
|
-
return resources;
|
|
275
|
-
}
|
|
276
|
-
function buildDocPrompts() {
|
|
277
|
-
const prompts = new PromptRegistry;
|
|
278
|
-
prompts.register(definePrompt({
|
|
279
|
-
meta: {
|
|
280
|
-
key: "docs.navigator",
|
|
281
|
-
version: "1.0.0",
|
|
282
|
-
title: "Find relevant ContractSpec docs",
|
|
283
|
-
description: "Guide agents to pick the right DocBlock by topic or tag.",
|
|
284
|
-
tags: DOC_TAGS,
|
|
285
|
-
stability: "beta",
|
|
286
|
-
owners: DOC_OWNERS
|
|
287
|
-
},
|
|
288
|
-
args: [
|
|
289
|
-
{
|
|
290
|
-
name: "topic",
|
|
291
|
-
description: "Goal or subject to search for.",
|
|
292
|
-
required: false,
|
|
293
|
-
schema: z.string().optional()
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
name: "tag",
|
|
297
|
-
description: "Optional tag filter.",
|
|
298
|
-
required: false,
|
|
299
|
-
schema: z.string().optional()
|
|
300
|
-
}
|
|
301
|
-
],
|
|
302
|
-
input: z.object({
|
|
303
|
-
topic: z.string().optional(),
|
|
304
|
-
tag: z.string().optional()
|
|
305
|
-
}),
|
|
306
|
-
render: async ({ topic, tag }) => {
|
|
307
|
-
const parts = [
|
|
308
|
-
{
|
|
309
|
-
type: "text",
|
|
310
|
-
text: `Use the docs index to choose DocBlocks. If a specific topic is provided, prefer docs whose id/title/summary match it.${topic ? ` Topic: ${topic}.` : ""}${tag ? ` Tag: ${tag}.` : ""}`
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
type: "resource",
|
|
314
|
-
uri: "docs://list",
|
|
315
|
-
title: "DocBlocks index"
|
|
316
|
-
}
|
|
317
|
-
];
|
|
318
|
-
return parts;
|
|
319
|
-
}
|
|
320
|
-
}));
|
|
321
|
-
return prompts;
|
|
322
|
-
}
|
|
323
|
-
function buildDocOps(routes) {
|
|
324
|
-
const registry = new OperationSpecRegistry;
|
|
325
|
-
installOp(registry, DocsIndexQuery, async (args) => {
|
|
326
|
-
const query = args.query?.toLowerCase().trim();
|
|
327
|
-
const tagsFilter = args.tag?.map((t) => t.toLowerCase().trim()) ?? [];
|
|
328
|
-
const visibility = args.visibility?.toLowerCase().trim();
|
|
329
|
-
const docs = routes.map(({ block, route }) => ({
|
|
330
|
-
id: block.id,
|
|
331
|
-
title: block.title,
|
|
332
|
-
summary: block.summary ?? "",
|
|
333
|
-
tags: block.tags ?? [],
|
|
334
|
-
visibility: (block.visibility ?? "public").toLowerCase(),
|
|
335
|
-
route
|
|
336
|
-
})).filter((doc) => {
|
|
337
|
-
const matchesQuery = query ? doc.id.toLowerCase().includes(query) || doc.title.toLowerCase().includes(query) || doc.summary.toLowerCase().includes(query) : true;
|
|
338
|
-
const matchesTags = tagsFilter.length ? tagsFilter.every((t) => doc.tags.some((tag) => tag.toLowerCase().includes(t))) : true;
|
|
339
|
-
const matchesVisibility = visibility ? doc.visibility === visibility : true;
|
|
340
|
-
return matchesQuery && matchesTags && matchesVisibility;
|
|
341
|
-
});
|
|
342
|
-
return {
|
|
343
|
-
docs,
|
|
344
|
-
items: docs,
|
|
345
|
-
total: docs.length
|
|
346
|
-
};
|
|
347
|
-
});
|
|
348
|
-
return registry;
|
|
349
|
-
}
|
|
350
|
-
function createDocsMcpHandler(path = "/api/mcp/docs") {
|
|
351
|
-
const routes = defaultDocRegistry.list();
|
|
352
|
-
return createMcpElysiaHandler({
|
|
353
|
-
logger: appLogger,
|
|
354
|
-
path,
|
|
355
|
-
serverName: "contractspec-docs-mcp",
|
|
356
|
-
ops: buildDocOps(routes),
|
|
357
|
-
resources: buildDocResources(routes),
|
|
358
|
-
prompts: buildDocPrompts(),
|
|
359
|
-
presentations: routes.map(({ descriptor }) => descriptor)
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// src/application/mcp/cliMcp.ts
|
|
364
|
-
import fs from "node:fs/promises";
|
|
365
|
-
import path from "path";
|
|
366
|
-
import {
|
|
367
|
-
defineCommand,
|
|
368
|
-
definePrompt as definePrompt2,
|
|
369
|
-
defineResourceTemplate as defineResourceTemplate2,
|
|
370
|
-
installOp as installOp2,
|
|
371
|
-
OperationSpecRegistry as OperationSpecRegistry2,
|
|
372
|
-
PromptRegistry as PromptRegistry2,
|
|
373
|
-
ResourceRegistry as ResourceRegistry2
|
|
374
|
-
} from "@contractspec/lib.contracts-spec";
|
|
375
211
|
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
376
|
-
import
|
|
212
|
+
import path from "path";
|
|
213
|
+
import z from "zod";
|
|
377
214
|
var __dirname = "/home/runner/work/contractspec/contractspec/packages/bundles/library/src/application/mcp";
|
|
378
215
|
var CLI_DOC_PATHS = {
|
|
379
216
|
quickstart: "packages/apps/cli-contractspec/QUICK_START.md",
|
|
@@ -426,8 +263,8 @@ async function loadCliDoc(key) {
|
|
|
426
263
|
return fallback;
|
|
427
264
|
}
|
|
428
265
|
function buildCliResources() {
|
|
429
|
-
const resources = new
|
|
430
|
-
resources.register(
|
|
266
|
+
const resources = new ResourceRegistry;
|
|
267
|
+
resources.register(defineResourceTemplate({
|
|
431
268
|
meta: {
|
|
432
269
|
uriTemplate: "cli://doc/{slug}",
|
|
433
270
|
title: "CLI documentation",
|
|
@@ -435,8 +272,8 @@ function buildCliResources() {
|
|
|
435
272
|
mimeType: "text/markdown",
|
|
436
273
|
tags: CLI_DOC_TAGS
|
|
437
274
|
},
|
|
438
|
-
input:
|
|
439
|
-
slug:
|
|
275
|
+
input: z.object({
|
|
276
|
+
slug: z.enum(["quickstart", "reference", "readme"])
|
|
440
277
|
}),
|
|
441
278
|
resolve: async ({ slug }) => {
|
|
442
279
|
const data = await loadCliDoc(slug);
|
|
@@ -447,7 +284,7 @@ function buildCliResources() {
|
|
|
447
284
|
};
|
|
448
285
|
}
|
|
449
286
|
}));
|
|
450
|
-
resources.register(
|
|
287
|
+
resources.register(defineResourceTemplate({
|
|
451
288
|
meta: {
|
|
452
289
|
uriTemplate: "cli://commands",
|
|
453
290
|
title: "CLI commands summary",
|
|
@@ -455,7 +292,7 @@ function buildCliResources() {
|
|
|
455
292
|
mimeType: "application/json",
|
|
456
293
|
tags: CLI_DOC_TAGS
|
|
457
294
|
},
|
|
458
|
-
input:
|
|
295
|
+
input: z.object({}),
|
|
459
296
|
resolve: async () => {
|
|
460
297
|
const commands = [
|
|
461
298
|
{
|
|
@@ -484,8 +321,8 @@ function buildCliResources() {
|
|
|
484
321
|
return resources;
|
|
485
322
|
}
|
|
486
323
|
function buildCliPrompts() {
|
|
487
|
-
const prompts = new
|
|
488
|
-
prompts.register(
|
|
324
|
+
const prompts = new PromptRegistry;
|
|
325
|
+
prompts.register(definePrompt({
|
|
489
326
|
meta: {
|
|
490
327
|
key: "cli.usage",
|
|
491
328
|
version: "1.0.0",
|
|
@@ -500,10 +337,10 @@ function buildCliPrompts() {
|
|
|
500
337
|
name: "goal",
|
|
501
338
|
description: "Task the user wants to achieve.",
|
|
502
339
|
required: false,
|
|
503
|
-
schema:
|
|
340
|
+
schema: z.string().optional()
|
|
504
341
|
}
|
|
505
342
|
],
|
|
506
|
-
input:
|
|
343
|
+
input: z.object({ goal: z.string().optional() }),
|
|
507
344
|
render: async ({ goal }) => [
|
|
508
345
|
{
|
|
509
346
|
type: "text",
|
|
@@ -520,7 +357,7 @@ function buildCliPrompts() {
|
|
|
520
357
|
return prompts;
|
|
521
358
|
}
|
|
522
359
|
function buildCliOps() {
|
|
523
|
-
const registry = new
|
|
360
|
+
const registry = new OperationSpecRegistry;
|
|
524
361
|
const CliSuggestInput = defineSchemaModel({
|
|
525
362
|
name: "CliSuggestInput",
|
|
526
363
|
fields: {
|
|
@@ -555,7 +392,7 @@ function buildCliOps() {
|
|
|
555
392
|
auth: "anonymous"
|
|
556
393
|
}
|
|
557
394
|
});
|
|
558
|
-
|
|
395
|
+
installOp(registry, suggestSpec, async ({ goal, prefersAi }) => {
|
|
559
396
|
const lower = goal.toLowerCase();
|
|
560
397
|
if (lower.includes("create") || lower.includes("new")) {
|
|
561
398
|
return {
|
|
@@ -597,831 +434,996 @@ function createCliMcpHandler(path2 = "/api/mcp/cli") {
|
|
|
597
434
|
});
|
|
598
435
|
}
|
|
599
436
|
|
|
600
|
-
// src/application/mcp/
|
|
437
|
+
// src/application/mcp/contractsMcpResources.ts
|
|
601
438
|
import {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
OperationSpecRegistry as OperationSpecRegistry3,
|
|
607
|
-
PromptRegistry as PromptRegistry3,
|
|
608
|
-
ResourceRegistry as ResourceRegistry3
|
|
439
|
+
definePrompt as definePrompt2,
|
|
440
|
+
defineResourceTemplate as defineResourceTemplate2,
|
|
441
|
+
PromptRegistry as PromptRegistry2,
|
|
442
|
+
ResourceRegistry as ResourceRegistry2
|
|
609
443
|
} from "@contractspec/lib.contracts-spec";
|
|
610
|
-
import
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
} from "@contractspec/module.examples";
|
|
617
|
-
var INTERNAL_TAGS = ["internal", "mcp"];
|
|
618
|
-
var INTERNAL_OWNERS = ["@contractspec"];
|
|
619
|
-
var ENDPOINTS = {
|
|
620
|
-
docs: "/api/mcp/docs",
|
|
621
|
-
cli: "/api/mcp/cli",
|
|
622
|
-
internal: "/api/mcp/internal",
|
|
623
|
-
graphql: "/graphql",
|
|
624
|
-
health: "/health"
|
|
625
|
-
};
|
|
626
|
-
function buildInternalResources() {
|
|
627
|
-
const resources = new ResourceRegistry3;
|
|
628
|
-
resources.register(defineResourceTemplate3({
|
|
444
|
+
import z2 from "zod";
|
|
445
|
+
var OWNERS = ["@contractspec"];
|
|
446
|
+
var TAGS = ["contracts", "mcp"];
|
|
447
|
+
function buildContractsResources(services) {
|
|
448
|
+
const resources = new ResourceRegistry2;
|
|
449
|
+
resources.register(defineResourceTemplate2({
|
|
629
450
|
meta: {
|
|
630
|
-
uriTemplate: "
|
|
631
|
-
title: "
|
|
632
|
-
description: "
|
|
451
|
+
uriTemplate: "contracts://list",
|
|
452
|
+
title: "Contract specs list",
|
|
453
|
+
description: "JSON list of all contract specs in the workspace.",
|
|
633
454
|
mimeType: "application/json",
|
|
634
|
-
tags:
|
|
455
|
+
tags: TAGS
|
|
635
456
|
},
|
|
636
|
-
input:
|
|
637
|
-
resolve: async (
|
|
638
|
-
const
|
|
457
|
+
input: z2.object({}),
|
|
458
|
+
resolve: async () => {
|
|
459
|
+
const specs = await services.listSpecs();
|
|
639
460
|
return {
|
|
640
|
-
uri:
|
|
461
|
+
uri: "contracts://list",
|
|
641
462
|
mimeType: "application/json",
|
|
642
|
-
data: JSON.stringify(
|
|
463
|
+
data: JSON.stringify(specs, null, 2)
|
|
643
464
|
};
|
|
644
465
|
}
|
|
645
466
|
}));
|
|
646
|
-
resources.register(
|
|
467
|
+
resources.register(defineResourceTemplate2({
|
|
647
468
|
meta: {
|
|
648
|
-
uriTemplate: "
|
|
649
|
-
title: "
|
|
650
|
-
description: "
|
|
651
|
-
mimeType: "
|
|
652
|
-
tags:
|
|
469
|
+
uriTemplate: "contracts://spec/{path}",
|
|
470
|
+
title: "Contract spec content",
|
|
471
|
+
description: "Read a single contract spec file by path.",
|
|
472
|
+
mimeType: "text/plain",
|
|
473
|
+
tags: TAGS
|
|
653
474
|
},
|
|
654
|
-
input:
|
|
655
|
-
resolve: async ({
|
|
656
|
-
const
|
|
657
|
-
if (!
|
|
475
|
+
input: z2.object({ path: z2.string() }),
|
|
476
|
+
resolve: async ({ path: path2 }) => {
|
|
477
|
+
const result = await services.getSpec(path2);
|
|
478
|
+
if (!result) {
|
|
658
479
|
return {
|
|
659
|
-
uri: `
|
|
660
|
-
mimeType: "
|
|
661
|
-
data:
|
|
480
|
+
uri: `contracts://spec/${encodeURIComponent(path2)}`,
|
|
481
|
+
mimeType: "text/plain",
|
|
482
|
+
data: `Spec not found: ${path2}`
|
|
662
483
|
};
|
|
663
484
|
}
|
|
664
485
|
return {
|
|
665
|
-
uri: `
|
|
666
|
-
mimeType: "
|
|
667
|
-
data:
|
|
486
|
+
uri: `contracts://spec/${encodeURIComponent(path2)}`,
|
|
487
|
+
mimeType: "text/plain",
|
|
488
|
+
data: result.content
|
|
668
489
|
};
|
|
669
490
|
}
|
|
670
491
|
}));
|
|
671
|
-
resources.register(
|
|
492
|
+
resources.register(defineResourceTemplate2({
|
|
672
493
|
meta: {
|
|
673
|
-
uriTemplate: "
|
|
674
|
-
title: "
|
|
675
|
-
description: "
|
|
676
|
-
mimeType: "application/json",
|
|
677
|
-
tags: INTERNAL_TAGS
|
|
678
|
-
},
|
|
679
|
-
input: z3.object({}),
|
|
680
|
-
resolve: async () => ({
|
|
681
|
-
uri: "internal://endpoints",
|
|
494
|
+
uriTemplate: "contracts://registry/manifest",
|
|
495
|
+
title: "Remote registry manifest",
|
|
496
|
+
description: "Contract registry manifest from the remote server.",
|
|
682
497
|
mimeType: "application/json",
|
|
683
|
-
|
|
684
|
-
})
|
|
685
|
-
}));
|
|
686
|
-
resources.register(defineResourceTemplate3({
|
|
687
|
-
meta: {
|
|
688
|
-
uriTemplate: "internal://playbook",
|
|
689
|
-
title: "Internal MCP usage playbook",
|
|
690
|
-
description: "How internal agents should discover docs, CLI usage, and endpoints.",
|
|
691
|
-
mimeType: "text/markdown",
|
|
692
|
-
tags: INTERNAL_TAGS
|
|
498
|
+
tags: TAGS
|
|
693
499
|
},
|
|
694
|
-
input:
|
|
695
|
-
resolve: async () =>
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
`- Endpoints: ${ENDPOINTS.docs}, ${ENDPOINTS.cli}, ${ENDPOINTS.internal}.`,
|
|
704
|
-
"- For API work, GraphQL at /graphql; health at /health."
|
|
705
|
-
].join(`
|
|
706
|
-
`)
|
|
707
|
-
})
|
|
500
|
+
input: z2.object({}),
|
|
501
|
+
resolve: async () => {
|
|
502
|
+
const manifest = await services.fetchRegistryManifest();
|
|
503
|
+
return {
|
|
504
|
+
uri: "contracts://registry/manifest",
|
|
505
|
+
mimeType: "application/json",
|
|
506
|
+
data: JSON.stringify(manifest, null, 2)
|
|
507
|
+
};
|
|
508
|
+
}
|
|
708
509
|
}));
|
|
709
510
|
return resources;
|
|
710
511
|
}
|
|
711
|
-
function
|
|
712
|
-
const prompts = new
|
|
713
|
-
prompts.register(
|
|
512
|
+
function buildContractsPrompts() {
|
|
513
|
+
const prompts = new PromptRegistry2;
|
|
514
|
+
prompts.register(definePrompt2({
|
|
714
515
|
meta: {
|
|
715
|
-
key: "
|
|
516
|
+
key: "contracts.editor",
|
|
716
517
|
version: "1.0.0",
|
|
717
|
-
title: "
|
|
718
|
-
description: "
|
|
719
|
-
tags:
|
|
720
|
-
|
|
721
|
-
|
|
518
|
+
title: "Contract editing guide",
|
|
519
|
+
description: "Guide AI agents through reading, editing, and validating contracts.",
|
|
520
|
+
tags: TAGS,
|
|
521
|
+
stability: "beta",
|
|
522
|
+
owners: OWNERS
|
|
722
523
|
},
|
|
723
|
-
args: [
|
|
724
|
-
|
|
725
|
-
|
|
524
|
+
args: [
|
|
525
|
+
{
|
|
526
|
+
name: "goal",
|
|
527
|
+
description: "What the agent wants to achieve with the contract.",
|
|
528
|
+
required: false,
|
|
529
|
+
schema: z2.string().optional()
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
input: z2.object({ goal: z2.string().optional() }),
|
|
533
|
+
render: async ({ goal }) => [
|
|
726
534
|
{
|
|
727
535
|
type: "text",
|
|
728
|
-
text:
|
|
536
|
+
text: [
|
|
537
|
+
"Contract editing workflow:",
|
|
538
|
+
"1. Use contracts.list to discover specs",
|
|
539
|
+
"2. Use contracts.get to read a spec",
|
|
540
|
+
"3. Edit content and call contracts.update",
|
|
541
|
+
"4. Run contracts.validate to verify changes",
|
|
542
|
+
"5. Run contracts.build to regenerate artifacts",
|
|
543
|
+
goal ? `Agent goal: ${goal}` : ""
|
|
544
|
+
].filter(Boolean).join(`
|
|
545
|
+
`)
|
|
729
546
|
},
|
|
730
547
|
{
|
|
731
548
|
type: "resource",
|
|
732
|
-
uri: "
|
|
733
|
-
title: "
|
|
549
|
+
uri: "contracts://list",
|
|
550
|
+
title: "Available contracts"
|
|
734
551
|
}
|
|
735
552
|
]
|
|
736
553
|
}));
|
|
737
554
|
return prompts;
|
|
738
555
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
556
|
+
|
|
557
|
+
// src/application/mcp/contractsMcpTools.ts
|
|
558
|
+
import {
|
|
559
|
+
defineCommand as defineCommand2,
|
|
560
|
+
installOp as installOp2,
|
|
561
|
+
OperationSpecRegistry as OperationSpecRegistry2
|
|
562
|
+
} from "@contractspec/lib.contracts-spec";
|
|
563
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
564
|
+
var OWNERS2 = ["@contractspec"];
|
|
565
|
+
var TAGS2 = ["contracts", "mcp"];
|
|
566
|
+
function buildContractsOps(services) {
|
|
567
|
+
const registry = new OperationSpecRegistry2;
|
|
568
|
+
const ListInput = defineSchemaModel2({
|
|
569
|
+
name: "ContractsListInput",
|
|
743
570
|
fields: {
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
571
|
+
pattern: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
572
|
+
type: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
const ListOutput = defineSchemaModel2({
|
|
576
|
+
name: "ContractsListOutput",
|
|
577
|
+
fields: {
|
|
578
|
+
specs: { type: ScalarTypeEnum2.JSON(), isOptional: false },
|
|
579
|
+
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
749
580
|
}
|
|
750
581
|
});
|
|
751
|
-
|
|
582
|
+
installOp2(registry, defineCommand2({
|
|
752
583
|
meta: {
|
|
753
|
-
key: "
|
|
584
|
+
key: "contracts.list",
|
|
754
585
|
version: "1.0.0",
|
|
755
|
-
stability: "
|
|
756
|
-
owners:
|
|
757
|
-
tags:
|
|
758
|
-
description: "
|
|
759
|
-
goal: "
|
|
760
|
-
context: "
|
|
586
|
+
stability: "beta",
|
|
587
|
+
owners: OWNERS2,
|
|
588
|
+
tags: TAGS2,
|
|
589
|
+
description: "List contract specs in the workspace.",
|
|
590
|
+
goal: "Discover available contracts by type, pattern, or owner.",
|
|
591
|
+
context: "Contracts MCP server."
|
|
761
592
|
},
|
|
762
|
-
io: {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
593
|
+
io: { input: ListInput, output: ListOutput },
|
|
594
|
+
policy: { auth: "anonymous" }
|
|
595
|
+
}), async ({ pattern, type }) => {
|
|
596
|
+
const specs = await services.listSpecs({ pattern, type });
|
|
597
|
+
return { specs, total: specs.length };
|
|
598
|
+
});
|
|
599
|
+
const GetInput = defineSchemaModel2({
|
|
600
|
+
name: "ContractsGetInput",
|
|
601
|
+
fields: {
|
|
602
|
+
path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
const GetOutput = defineSchemaModel2({
|
|
606
|
+
name: "ContractsGetOutput",
|
|
607
|
+
fields: {
|
|
608
|
+
content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
609
|
+
info: { type: ScalarTypeEnum2.JSON(), isOptional: false }
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
installOp2(registry, defineCommand2({
|
|
613
|
+
meta: {
|
|
614
|
+
key: "contracts.get",
|
|
615
|
+
version: "1.0.0",
|
|
616
|
+
stability: "beta",
|
|
617
|
+
owners: OWNERS2,
|
|
618
|
+
tags: TAGS2,
|
|
619
|
+
description: "Read a single contract spec file.",
|
|
620
|
+
goal: "Fetch spec content and parsed metadata.",
|
|
621
|
+
context: "Contracts MCP server."
|
|
768
622
|
},
|
|
769
|
-
|
|
770
|
-
|
|
623
|
+
io: { input: GetInput, output: GetOutput },
|
|
624
|
+
policy: { auth: "anonymous" }
|
|
625
|
+
}), async ({ path: path2 }) => {
|
|
626
|
+
const result = await services.getSpec(path2);
|
|
627
|
+
if (!result)
|
|
628
|
+
throw new Error(`Spec not found: ${path2}`);
|
|
629
|
+
return result;
|
|
630
|
+
});
|
|
631
|
+
const ValidateInput = defineSchemaModel2({
|
|
632
|
+
name: "ContractsValidateInput",
|
|
633
|
+
fields: {
|
|
634
|
+
path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
|
|
771
635
|
}
|
|
772
636
|
});
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
return createMcpElysiaHandler({
|
|
781
|
-
logger: appLogger,
|
|
782
|
-
path: path2,
|
|
783
|
-
serverName: "contractspec-internal-mcp",
|
|
784
|
-
ops: buildInternalOps(),
|
|
785
|
-
resources: buildInternalResources(),
|
|
786
|
-
prompts: buildInternalPrompts()
|
|
637
|
+
const ValidateOutput = defineSchemaModel2({
|
|
638
|
+
name: "ContractsValidateOutput",
|
|
639
|
+
fields: {
|
|
640
|
+
valid: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
641
|
+
errors: { type: ScalarTypeEnum2.JSON(), isOptional: false },
|
|
642
|
+
warnings: { type: ScalarTypeEnum2.JSON(), isOptional: false }
|
|
643
|
+
}
|
|
787
644
|
});
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
// src/application/mcp/providerRankingMcp.ts
|
|
791
|
-
import {
|
|
792
|
-
definePrompt as definePrompt4,
|
|
793
|
-
defineResourceTemplate as defineResourceTemplate4,
|
|
794
|
-
installOp as installOp4,
|
|
795
|
-
OperationSpecRegistry as OperationSpecRegistry4,
|
|
796
|
-
PromptRegistry as PromptRegistry4,
|
|
797
|
-
ResourceRegistry as ResourceRegistry4
|
|
798
|
-
} from "@contractspec/lib.contracts-spec";
|
|
799
|
-
import {
|
|
800
|
-
BenchmarkIngestCommand,
|
|
801
|
-
BenchmarkRunCustomCommand,
|
|
802
|
-
RankingRefreshCommand
|
|
803
|
-
} from "@contractspec/lib.contracts-spec/provider-ranking";
|
|
804
|
-
import z4 from "zod";
|
|
805
|
-
import { getModelInfo } from "@contractspec/lib.ai-providers/models";
|
|
806
|
-
import { InMemoryProviderRankingStore } from "@contractspec/lib.provider-ranking/in-memory-store";
|
|
807
|
-
import { createDefaultIngesterRegistry } from "@contractspec/lib.provider-ranking/ingesters";
|
|
808
|
-
import { computeModelRankings } from "@contractspec/lib.provider-ranking/scoring";
|
|
809
|
-
import { normalizeBenchmarkResults } from "@contractspec/lib.provider-ranking/scoring";
|
|
810
|
-
var TransportFilterSchema = z4.enum(["rest", "mcp", "webhook", "sdk"]).optional();
|
|
811
|
-
var AuthFilterSchema = z4.enum([
|
|
812
|
-
"api-key",
|
|
813
|
-
"oauth2",
|
|
814
|
-
"bearer",
|
|
815
|
-
"header",
|
|
816
|
-
"basic",
|
|
817
|
-
"webhook-signing",
|
|
818
|
-
"service-account"
|
|
819
|
-
]).optional();
|
|
820
|
-
var RANKING_TAGS = ["ranking", "mcp", "ai"];
|
|
821
|
-
var RANKING_OWNERS = ["platform.ai"];
|
|
822
|
-
var sharedStore = null;
|
|
823
|
-
function getStore() {
|
|
824
|
-
if (!sharedStore) {
|
|
825
|
-
sharedStore = new InMemoryProviderRankingStore;
|
|
826
|
-
}
|
|
827
|
-
return sharedStore;
|
|
828
|
-
}
|
|
829
|
-
function buildRankingResources() {
|
|
830
|
-
const resources = new ResourceRegistry4;
|
|
831
|
-
resources.register(defineResourceTemplate4({
|
|
645
|
+
installOp2(registry, defineCommand2({
|
|
832
646
|
meta: {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
tags:
|
|
647
|
+
key: "contracts.validate",
|
|
648
|
+
version: "1.0.0",
|
|
649
|
+
stability: "beta",
|
|
650
|
+
owners: OWNERS2,
|
|
651
|
+
tags: TAGS2,
|
|
652
|
+
description: "Validate a contract spec structure.",
|
|
653
|
+
goal: "Check spec for structural or policy issues.",
|
|
654
|
+
context: "Contracts MCP server."
|
|
838
655
|
},
|
|
839
|
-
input:
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
requiredTransport: transport,
|
|
848
|
-
requiredAuthMethod: authMethod
|
|
849
|
-
});
|
|
850
|
-
return {
|
|
851
|
-
uri: "ranking://leaderboard",
|
|
852
|
-
mimeType: "application/json",
|
|
853
|
-
data: JSON.stringify(result, null, 2)
|
|
854
|
-
};
|
|
656
|
+
io: { input: ValidateInput, output: ValidateOutput },
|
|
657
|
+
policy: { auth: "anonymous" }
|
|
658
|
+
}), async ({ path: path2 }) => services.validateSpec(path2));
|
|
659
|
+
const BuildInput = defineSchemaModel2({
|
|
660
|
+
name: "ContractsBuildInput",
|
|
661
|
+
fields: {
|
|
662
|
+
path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
663
|
+
dryRun: { type: ScalarTypeEnum2.Boolean(), isOptional: true }
|
|
855
664
|
}
|
|
856
|
-
})
|
|
857
|
-
|
|
665
|
+
});
|
|
666
|
+
const BuildOutput = defineSchemaModel2({
|
|
667
|
+
name: "ContractsBuildOutput",
|
|
668
|
+
fields: {
|
|
669
|
+
results: { type: ScalarTypeEnum2.JSON(), isOptional: false }
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
installOp2(registry, defineCommand2({
|
|
858
673
|
meta: {
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
tags:
|
|
674
|
+
key: "contracts.build",
|
|
675
|
+
version: "1.0.0",
|
|
676
|
+
stability: "beta",
|
|
677
|
+
owners: OWNERS2,
|
|
678
|
+
tags: TAGS2,
|
|
679
|
+
description: "Generate implementation code from a contract spec.",
|
|
680
|
+
goal: "Produce handler, component, or test skeletons.",
|
|
681
|
+
context: "Contracts MCP server."
|
|
864
682
|
},
|
|
865
|
-
input:
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
683
|
+
io: { input: BuildInput, output: BuildOutput },
|
|
684
|
+
policy: { auth: "user" }
|
|
685
|
+
}), async ({ path: path2, dryRun }) => services.buildSpec(path2, { dryRun }));
|
|
686
|
+
registerMutationTools(registry, services);
|
|
687
|
+
return registry;
|
|
688
|
+
}
|
|
689
|
+
function registerMutationTools(registry, services) {
|
|
690
|
+
const UpdateInput = defineSchemaModel2({
|
|
691
|
+
name: "ContractsUpdateInput",
|
|
692
|
+
fields: {
|
|
693
|
+
path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
694
|
+
content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
695
|
+
fields: { type: ScalarTypeEnum2.JSON(), isOptional: true }
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
const UpdateOutput = defineSchemaModel2({
|
|
699
|
+
name: "ContractsUpdateOutput",
|
|
700
|
+
fields: {
|
|
701
|
+
updated: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
702
|
+
errors: { type: ScalarTypeEnum2.JSON(), isOptional: false },
|
|
703
|
+
warnings: { type: ScalarTypeEnum2.JSON(), isOptional: false }
|
|
883
704
|
}
|
|
705
|
+
});
|
|
706
|
+
installOp2(registry, defineCommand2({
|
|
707
|
+
meta: {
|
|
708
|
+
key: "contracts.update",
|
|
709
|
+
version: "1.0.0",
|
|
710
|
+
stability: "beta",
|
|
711
|
+
owners: OWNERS2,
|
|
712
|
+
tags: TAGS2,
|
|
713
|
+
description: "Update an existing contract spec.",
|
|
714
|
+
goal: "Modify spec content or individual fields with validation.",
|
|
715
|
+
context: "Contracts MCP server."
|
|
716
|
+
},
|
|
717
|
+
io: { input: UpdateInput, output: UpdateOutput },
|
|
718
|
+
policy: { auth: "user" }
|
|
719
|
+
}), async ({ path: path2, content, fields }) => services.updateSpec(path2, {
|
|
720
|
+
content,
|
|
721
|
+
fields: Array.isArray(fields) ? fields : undefined
|
|
884
722
|
}));
|
|
885
|
-
|
|
723
|
+
const DeleteInput = defineSchemaModel2({
|
|
724
|
+
name: "ContractsDeleteInput",
|
|
725
|
+
fields: {
|
|
726
|
+
path: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
727
|
+
clean: { type: ScalarTypeEnum2.Boolean(), isOptional: true }
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
const DeleteOutput = defineSchemaModel2({
|
|
731
|
+
name: "ContractsDeleteOutput",
|
|
732
|
+
fields: {
|
|
733
|
+
deleted: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
734
|
+
cleanedFiles: { type: ScalarTypeEnum2.JSON(), isOptional: false },
|
|
735
|
+
errors: { type: ScalarTypeEnum2.JSON(), isOptional: false }
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
installOp2(registry, defineCommand2({
|
|
886
739
|
meta: {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
740
|
+
key: "contracts.delete",
|
|
741
|
+
version: "1.0.0",
|
|
742
|
+
stability: "beta",
|
|
743
|
+
owners: OWNERS2,
|
|
744
|
+
tags: TAGS2,
|
|
745
|
+
description: "Delete a contract spec and optionally its artifacts.",
|
|
746
|
+
goal: "Remove a spec file and clean generated handlers/tests.",
|
|
747
|
+
context: "Contracts MCP server."
|
|
748
|
+
},
|
|
749
|
+
io: { input: DeleteInput, output: DeleteOutput },
|
|
750
|
+
policy: { auth: "user" }
|
|
751
|
+
}), async ({ path: path2, clean }) => services.deleteSpec(path2, { clean }));
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// src/application/mcp/contractsMcp.ts
|
|
755
|
+
function createContractsMcpHandler(path2 = "/api/mcp/contracts", services) {
|
|
756
|
+
return createMcpElysiaHandler({
|
|
757
|
+
logger: appLogger,
|
|
758
|
+
path: path2,
|
|
759
|
+
serverName: "contractspec-contracts-mcp",
|
|
760
|
+
ops: buildContractsOps(services),
|
|
761
|
+
resources: buildContractsResources(services),
|
|
762
|
+
prompts: buildContractsPrompts()
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// src/features/docs/docs.contracts.ts
|
|
767
|
+
import {
|
|
768
|
+
ContractReferenceQuery,
|
|
769
|
+
DocSummaryModel,
|
|
770
|
+
DocsIndexInput,
|
|
771
|
+
DocsIndexOutput,
|
|
772
|
+
DocsIndexQuery,
|
|
773
|
+
DocsIndexQuery as DocsIndexQuery2
|
|
774
|
+
} from "@contractspec/lib.contracts-spec/docs";
|
|
775
|
+
// src/application/mcp/docsMcp.ts
|
|
776
|
+
import {
|
|
777
|
+
definePrompt as definePrompt3,
|
|
778
|
+
defineResourceTemplate as defineResourceTemplate3,
|
|
779
|
+
installOp as installOp3,
|
|
780
|
+
OperationSpecRegistry as OperationSpecRegistry3,
|
|
781
|
+
PromptRegistry as PromptRegistry3,
|
|
782
|
+
ResourceRegistry as ResourceRegistry3
|
|
783
|
+
} from "@contractspec/lib.contracts-spec";
|
|
784
|
+
import { defaultDocRegistry } from "@contractspec/lib.contracts-spec/docs";
|
|
785
|
+
import z3 from "zod";
|
|
786
|
+
var DOC_OWNERS = ["@contractspec"];
|
|
787
|
+
var DOC_TAGS = ["docs", "mcp"];
|
|
788
|
+
function buildDocResources(routes) {
|
|
789
|
+
const resources = new ResourceRegistry3;
|
|
790
|
+
resources.register(defineResourceTemplate3({
|
|
791
|
+
meta: {
|
|
792
|
+
uriTemplate: "docs://list",
|
|
793
|
+
title: "DocBlocks index",
|
|
794
|
+
description: "All registered DocBlocks with route, visibility, tags, and summary.",
|
|
890
795
|
mimeType: "application/json",
|
|
891
|
-
tags:
|
|
796
|
+
tags: DOC_TAGS
|
|
892
797
|
},
|
|
893
|
-
input:
|
|
894
|
-
resolve: async (
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
}
|
|
904
|
-
const enriched = profile.costPerMillion == null ? (() => {
|
|
905
|
-
const info = getModelInfo(profile.modelId);
|
|
906
|
-
return info?.costPerMillion ? {
|
|
907
|
-
...profile,
|
|
908
|
-
costPerMillion: info.costPerMillion,
|
|
909
|
-
displayName: info.name,
|
|
910
|
-
contextWindow: info.contextWindow,
|
|
911
|
-
capabilities: [
|
|
912
|
-
...info.capabilities.vision ? ["vision"] : [],
|
|
913
|
-
...info.capabilities.tools ? ["tools"] : [],
|
|
914
|
-
...info.capabilities.reasoning ? ["reasoning"] : [],
|
|
915
|
-
...info.capabilities.streaming ? ["streaming"] : []
|
|
916
|
-
]
|
|
917
|
-
} : profile;
|
|
918
|
-
})() : profile;
|
|
798
|
+
input: z3.object({}),
|
|
799
|
+
resolve: async () => {
|
|
800
|
+
const docs = routes.map(({ block, route }) => ({
|
|
801
|
+
id: block.id,
|
|
802
|
+
title: block.title,
|
|
803
|
+
summary: block.summary ?? "",
|
|
804
|
+
tags: block.tags ?? [],
|
|
805
|
+
visibility: block.visibility ?? "public",
|
|
806
|
+
route
|
|
807
|
+
}));
|
|
919
808
|
return {
|
|
920
|
-
uri:
|
|
809
|
+
uri: "docs://list",
|
|
921
810
|
mimeType: "application/json",
|
|
922
|
-
data: JSON.stringify(
|
|
811
|
+
data: JSON.stringify(docs, null, 2)
|
|
923
812
|
};
|
|
924
813
|
}
|
|
925
814
|
}));
|
|
926
|
-
resources.register(
|
|
815
|
+
resources.register(defineResourceTemplate3({
|
|
927
816
|
meta: {
|
|
928
|
-
uriTemplate: "
|
|
929
|
-
title: "
|
|
930
|
-
description: "
|
|
931
|
-
mimeType: "
|
|
932
|
-
tags:
|
|
817
|
+
uriTemplate: "docs://doc/{id}",
|
|
818
|
+
title: "DocBlock markdown",
|
|
819
|
+
description: "Fetch DocBlock body by id as markdown.",
|
|
820
|
+
mimeType: "text/markdown",
|
|
821
|
+
tags: DOC_TAGS
|
|
933
822
|
},
|
|
934
|
-
input:
|
|
935
|
-
resolve: async () => {
|
|
936
|
-
const
|
|
937
|
-
|
|
823
|
+
input: z3.object({ id: z3.string() }),
|
|
824
|
+
resolve: async ({ id }) => {
|
|
825
|
+
const found = defaultDocRegistry.get(id);
|
|
826
|
+
if (!found) {
|
|
827
|
+
return {
|
|
828
|
+
uri: `docs://doc/${encodeURIComponent(id)}`,
|
|
829
|
+
mimeType: "text/plain",
|
|
830
|
+
data: `DocBlock not found: ${id}`
|
|
831
|
+
};
|
|
832
|
+
}
|
|
938
833
|
return {
|
|
939
|
-
uri:
|
|
940
|
-
mimeType: "
|
|
941
|
-
data:
|
|
834
|
+
uri: `docs://doc/${encodeURIComponent(id)}`,
|
|
835
|
+
mimeType: "text/markdown",
|
|
836
|
+
data: String(found.block.body ?? "")
|
|
942
837
|
};
|
|
943
838
|
}
|
|
944
839
|
}));
|
|
945
840
|
return resources;
|
|
946
841
|
}
|
|
947
|
-
function
|
|
948
|
-
const prompts = new
|
|
949
|
-
prompts.register(
|
|
842
|
+
function buildDocPrompts() {
|
|
843
|
+
const prompts = new PromptRegistry3;
|
|
844
|
+
prompts.register(definePrompt3({
|
|
950
845
|
meta: {
|
|
951
|
-
key: "
|
|
846
|
+
key: "docs.navigator",
|
|
952
847
|
version: "1.0.0",
|
|
953
|
-
title: "
|
|
954
|
-
description: "
|
|
955
|
-
tags:
|
|
848
|
+
title: "Find relevant ContractSpec docs",
|
|
849
|
+
description: "Guide agents to pick the right DocBlock by topic or tag.",
|
|
850
|
+
tags: DOC_TAGS,
|
|
956
851
|
stability: "beta",
|
|
957
|
-
owners:
|
|
852
|
+
owners: DOC_OWNERS
|
|
958
853
|
},
|
|
959
854
|
args: [
|
|
960
855
|
{
|
|
961
|
-
name: "
|
|
962
|
-
description: "
|
|
963
|
-
required: true,
|
|
964
|
-
schema: z4.string()
|
|
965
|
-
},
|
|
966
|
-
{
|
|
967
|
-
name: "priority",
|
|
968
|
-
description: "Priority dimension (coding, reasoning, cost, latency, etc.).",
|
|
969
|
-
required: false,
|
|
970
|
-
schema: z4.string().optional()
|
|
971
|
-
},
|
|
972
|
-
{
|
|
973
|
-
name: "transport",
|
|
974
|
-
description: "Required transport type (rest, mcp, webhook, sdk).",
|
|
856
|
+
name: "topic",
|
|
857
|
+
description: "Goal or subject to search for.",
|
|
975
858
|
required: false,
|
|
976
|
-
schema:
|
|
859
|
+
schema: z3.string().optional()
|
|
977
860
|
},
|
|
978
861
|
{
|
|
979
|
-
name: "
|
|
980
|
-
description: "
|
|
862
|
+
name: "tag",
|
|
863
|
+
description: "Optional tag filter.",
|
|
981
864
|
required: false,
|
|
982
|
-
schema:
|
|
865
|
+
schema: z3.string().optional()
|
|
983
866
|
}
|
|
984
867
|
],
|
|
985
|
-
input:
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
transport: TransportFilterSchema,
|
|
989
|
-
authMethod: AuthFilterSchema
|
|
868
|
+
input: z3.object({
|
|
869
|
+
topic: z3.string().optional(),
|
|
870
|
+
tag: z3.string().optional()
|
|
990
871
|
}),
|
|
991
|
-
render: async ({
|
|
992
|
-
const
|
|
993
|
-
if (priority)
|
|
994
|
-
constraints.push(`Prioritize: ${priority}.`);
|
|
995
|
-
if (transport)
|
|
996
|
-
constraints.push(`Required transport: ${transport}.`);
|
|
997
|
-
if (authMethod)
|
|
998
|
-
constraints.push(`Required auth: ${authMethod}.`);
|
|
999
|
-
return [
|
|
872
|
+
render: async ({ topic, tag }) => {
|
|
873
|
+
const parts = [
|
|
1000
874
|
{
|
|
1001
875
|
type: "text",
|
|
1002
|
-
text: `
|
|
876
|
+
text: `Use the docs index to choose DocBlocks. If a specific topic is provided, prefer docs whose id/title/summary match it.${topic ? ` Topic: ${topic}.` : ""}${tag ? ` Tag: ${tag}.` : ""}`
|
|
1003
877
|
},
|
|
1004
878
|
{
|
|
1005
879
|
type: "resource",
|
|
1006
|
-
uri:
|
|
1007
|
-
title: "
|
|
880
|
+
uri: "docs://list",
|
|
881
|
+
title: "DocBlocks index"
|
|
1008
882
|
}
|
|
1009
883
|
];
|
|
884
|
+
return parts;
|
|
1010
885
|
}
|
|
1011
886
|
}));
|
|
1012
887
|
return prompts;
|
|
1013
888
|
}
|
|
1014
|
-
function
|
|
1015
|
-
const registry = new
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
const
|
|
1019
|
-
const
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
889
|
+
function buildDocOps(routes) {
|
|
890
|
+
const registry = new OperationSpecRegistry3;
|
|
891
|
+
installOp3(registry, DocsIndexQuery, async (args) => {
|
|
892
|
+
const query = args.query?.toLowerCase().trim();
|
|
893
|
+
const tagsFilter = args.tag?.map((t) => t.toLowerCase().trim()) ?? [];
|
|
894
|
+
const visibility = args.visibility?.toLowerCase().trim();
|
|
895
|
+
const docs = routes.map(({ block, route }) => ({
|
|
896
|
+
id: block.id,
|
|
897
|
+
title: block.title,
|
|
898
|
+
summary: block.summary ?? "",
|
|
899
|
+
tags: block.tags ?? [],
|
|
900
|
+
visibility: (block.visibility ?? "public").toLowerCase(),
|
|
901
|
+
route
|
|
902
|
+
})).filter((doc) => {
|
|
903
|
+
const matchesQuery = query ? doc.id.toLowerCase().includes(query) || doc.title.toLowerCase().includes(query) || doc.summary.toLowerCase().includes(query) : true;
|
|
904
|
+
const matchesTags = tagsFilter.length ? tagsFilter.every((t) => doc.tags.some((tag) => tag.toLowerCase().includes(t))) : true;
|
|
905
|
+
const matchesVisibility = visibility ? doc.visibility === visibility : true;
|
|
906
|
+
return matchesQuery && matchesTags && matchesVisibility;
|
|
1027
907
|
});
|
|
1028
|
-
const normalized = normalizeBenchmarkResults(rawResults);
|
|
1029
|
-
for (const result of normalized) {
|
|
1030
|
-
await store.upsertBenchmarkResult(result);
|
|
1031
|
-
}
|
|
1032
|
-
return {
|
|
1033
|
-
ingestionId: `ingest-${source}-${Date.now()}`,
|
|
1034
|
-
source,
|
|
1035
|
-
resultsCount: normalized.length,
|
|
1036
|
-
status: "completed",
|
|
1037
|
-
ingestedAt: new Date
|
|
1038
|
-
};
|
|
1039
|
-
});
|
|
1040
|
-
installOp4(registry, BenchmarkRunCustomCommand, async (args) => {
|
|
1041
908
|
return {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
status: "started",
|
|
1046
|
-
startedAt: new Date
|
|
1047
|
-
};
|
|
1048
|
-
});
|
|
1049
|
-
installOp4(registry, RankingRefreshCommand, async (args) => {
|
|
1050
|
-
const store = getStore();
|
|
1051
|
-
const allResults = [];
|
|
1052
|
-
let offset = 0;
|
|
1053
|
-
const pageSize = 500;
|
|
1054
|
-
while (true) {
|
|
1055
|
-
const page = await store.listBenchmarkResults({
|
|
1056
|
-
limit: pageSize,
|
|
1057
|
-
offset
|
|
1058
|
-
});
|
|
1059
|
-
allResults.push(...page.results);
|
|
1060
|
-
if (allResults.length >= page.total || page.results.length < pageSize)
|
|
1061
|
-
break;
|
|
1062
|
-
offset += pageSize;
|
|
1063
|
-
}
|
|
1064
|
-
const existingRankings = new Map((await store.listModelRankings({ limit: 1e4 })).rankings.map((r) => [
|
|
1065
|
-
r.modelId,
|
|
1066
|
-
r
|
|
1067
|
-
]));
|
|
1068
|
-
const weightOverrides = args.weightOverrides ? Array.isArray(args.weightOverrides) ? args.weightOverrides : [args.weightOverrides] : undefined;
|
|
1069
|
-
const newRankings = computeModelRankings(allResults, weightOverrides ? {
|
|
1070
|
-
weightOverrides
|
|
1071
|
-
} : undefined, existingRankings);
|
|
1072
|
-
for (const ranking of newRankings) {
|
|
1073
|
-
await store.upsertModelRanking(ranking);
|
|
1074
|
-
}
|
|
1075
|
-
return {
|
|
1076
|
-
modelsRanked: newRankings.length,
|
|
1077
|
-
updatedAt: new Date,
|
|
1078
|
-
status: "completed"
|
|
909
|
+
docs,
|
|
910
|
+
items: docs,
|
|
911
|
+
total: docs.length
|
|
1079
912
|
};
|
|
1080
913
|
});
|
|
1081
914
|
return registry;
|
|
1082
915
|
}
|
|
1083
|
-
function
|
|
916
|
+
function createDocsMcpHandler(path2 = "/api/mcp/docs") {
|
|
917
|
+
const routes = defaultDocRegistry.list();
|
|
1084
918
|
return createMcpElysiaHandler({
|
|
1085
919
|
logger: appLogger,
|
|
1086
920
|
path: path2,
|
|
1087
|
-
serverName: "contractspec-
|
|
1088
|
-
ops:
|
|
1089
|
-
resources:
|
|
1090
|
-
prompts:
|
|
921
|
+
serverName: "contractspec-docs-mcp",
|
|
922
|
+
ops: buildDocOps(routes),
|
|
923
|
+
resources: buildDocResources(routes),
|
|
924
|
+
prompts: buildDocPrompts(),
|
|
925
|
+
presentations: routes.map(({ descriptor }) => descriptor)
|
|
1091
926
|
});
|
|
1092
927
|
}
|
|
1093
|
-
function setProviderRankingStore(store) {
|
|
1094
|
-
sharedStore = store;
|
|
1095
|
-
}
|
|
1096
928
|
|
|
1097
|
-
// src/application/mcp/
|
|
929
|
+
// src/application/mcp/internalMcp.ts
|
|
1098
930
|
import {
|
|
1099
931
|
defineCommand as defineCommand3,
|
|
1100
|
-
|
|
1101
|
-
|
|
932
|
+
definePrompt as definePrompt4,
|
|
933
|
+
defineResourceTemplate as defineResourceTemplate4,
|
|
934
|
+
installOp as installOp4,
|
|
935
|
+
OperationSpecRegistry as OperationSpecRegistry4,
|
|
936
|
+
PromptRegistry as PromptRegistry4,
|
|
937
|
+
ResourceRegistry as ResourceRegistry4
|
|
1102
938
|
} from "@contractspec/lib.contracts-spec";
|
|
1103
939
|
import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
installOp5(registry, defineCommand3({
|
|
1123
|
-
meta: {
|
|
1124
|
-
key: "contracts.list",
|
|
1125
|
-
version: "1.0.0",
|
|
1126
|
-
stability: "beta",
|
|
1127
|
-
owners: OWNERS,
|
|
1128
|
-
tags: TAGS,
|
|
1129
|
-
description: "List contract specs in the workspace.",
|
|
1130
|
-
goal: "Discover available contracts by type, pattern, or owner.",
|
|
1131
|
-
context: "Contracts MCP server."
|
|
1132
|
-
},
|
|
1133
|
-
io: { input: ListInput, output: ListOutput },
|
|
1134
|
-
policy: { auth: "anonymous" }
|
|
1135
|
-
}), async ({ pattern, type }) => {
|
|
1136
|
-
const specs = await services.listSpecs({ pattern, type });
|
|
1137
|
-
return { specs, total: specs.length };
|
|
1138
|
-
});
|
|
1139
|
-
const GetInput = defineSchemaModel3({
|
|
1140
|
-
name: "ContractsGetInput",
|
|
1141
|
-
fields: {
|
|
1142
|
-
path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
1143
|
-
}
|
|
1144
|
-
});
|
|
1145
|
-
const GetOutput = defineSchemaModel3({
|
|
1146
|
-
name: "ContractsGetOutput",
|
|
1147
|
-
fields: {
|
|
1148
|
-
content: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
1149
|
-
info: { type: ScalarTypeEnum3.JSON(), isOptional: false }
|
|
1150
|
-
}
|
|
1151
|
-
});
|
|
1152
|
-
installOp5(registry, defineCommand3({
|
|
940
|
+
import {
|
|
941
|
+
getExample,
|
|
942
|
+
listExamples,
|
|
943
|
+
searchExamples
|
|
944
|
+
} from "@contractspec/module.examples";
|
|
945
|
+
import z4 from "zod";
|
|
946
|
+
var INTERNAL_TAGS = ["internal", "mcp"];
|
|
947
|
+
var INTERNAL_OWNERS = ["@contractspec"];
|
|
948
|
+
var ENDPOINTS = {
|
|
949
|
+
docs: "/api/mcp/docs",
|
|
950
|
+
cli: "/api/mcp/cli",
|
|
951
|
+
internal: "/api/mcp/internal",
|
|
952
|
+
graphql: "/graphql",
|
|
953
|
+
health: "/health"
|
|
954
|
+
};
|
|
955
|
+
function buildInternalResources() {
|
|
956
|
+
const resources = new ResourceRegistry4;
|
|
957
|
+
resources.register(defineResourceTemplate4({
|
|
1153
958
|
meta: {
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
tags:
|
|
1159
|
-
description: "Read a single contract spec file.",
|
|
1160
|
-
goal: "Fetch spec content and parsed metadata.",
|
|
1161
|
-
context: "Contracts MCP server."
|
|
959
|
+
uriTemplate: "examples://list{?q}",
|
|
960
|
+
title: "ContractSpec examples registry",
|
|
961
|
+
description: "List available examples (templates, integrations, knowledge, scripts). Optional query `q` filters results.",
|
|
962
|
+
mimeType: "application/json",
|
|
963
|
+
tags: ["examples", ...INTERNAL_TAGS]
|
|
1162
964
|
},
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
const ValidateInput = defineSchemaModel3({
|
|
1172
|
-
name: "ContractsValidateInput",
|
|
1173
|
-
fields: {
|
|
1174
|
-
path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1177
|
-
const ValidateOutput = defineSchemaModel3({
|
|
1178
|
-
name: "ContractsValidateOutput",
|
|
1179
|
-
fields: {
|
|
1180
|
-
valid: { type: ScalarTypeEnum3.Boolean(), isOptional: false },
|
|
1181
|
-
errors: { type: ScalarTypeEnum3.JSON(), isOptional: false },
|
|
1182
|
-
warnings: { type: ScalarTypeEnum3.JSON(), isOptional: false }
|
|
965
|
+
input: z4.object({ q: z4.string().optional() }),
|
|
966
|
+
resolve: async ({ q }) => {
|
|
967
|
+
const items = q ? searchExamples(q) : [...listExamples()];
|
|
968
|
+
return {
|
|
969
|
+
uri: q ? `examples://list?q=${encodeURIComponent(q)}` : "examples://list",
|
|
970
|
+
mimeType: "application/json",
|
|
971
|
+
data: JSON.stringify(items, null, 2)
|
|
972
|
+
};
|
|
1183
973
|
}
|
|
1184
|
-
});
|
|
1185
|
-
|
|
974
|
+
}));
|
|
975
|
+
resources.register(defineResourceTemplate4({
|
|
1186
976
|
meta: {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
tags:
|
|
1192
|
-
description: "Validate a contract spec structure.",
|
|
1193
|
-
goal: "Check spec for structural or policy issues.",
|
|
1194
|
-
context: "Contracts MCP server."
|
|
977
|
+
uriTemplate: "examples://example/{id}",
|
|
978
|
+
title: "ContractSpec example (by id)",
|
|
979
|
+
description: "Fetch a single example manifest by id.",
|
|
980
|
+
mimeType: "application/json",
|
|
981
|
+
tags: ["examples", ...INTERNAL_TAGS]
|
|
1195
982
|
},
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
983
|
+
input: z4.object({ id: z4.string().min(1) }),
|
|
984
|
+
resolve: async ({ id }) => {
|
|
985
|
+
const example = getExample(id);
|
|
986
|
+
if (!example) {
|
|
987
|
+
return {
|
|
988
|
+
uri: `examples://example/${encodeURIComponent(id)}`,
|
|
989
|
+
mimeType: "application/json",
|
|
990
|
+
data: JSON.stringify({ error: "not_found", id, message: `Unknown example id: ${id}` }, null, 2)
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
uri: `examples://example/${encodeURIComponent(id)}`,
|
|
995
|
+
mimeType: "application/json",
|
|
996
|
+
data: JSON.stringify(example, null, 2)
|
|
997
|
+
};
|
|
1210
998
|
}
|
|
1211
|
-
});
|
|
1212
|
-
|
|
999
|
+
}));
|
|
1000
|
+
resources.register(defineResourceTemplate4({
|
|
1213
1001
|
meta: {
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
tags:
|
|
1219
|
-
description: "Generate implementation code from a contract spec.",
|
|
1220
|
-
goal: "Produce handler, component, or test skeletons.",
|
|
1221
|
-
context: "Contracts MCP server."
|
|
1002
|
+
uriTemplate: "internal://endpoints",
|
|
1003
|
+
title: "ContractSpec MCP endpoints",
|
|
1004
|
+
description: "Endpoints for docs, CLI, internal MCP servers.",
|
|
1005
|
+
mimeType: "application/json",
|
|
1006
|
+
tags: INTERNAL_TAGS
|
|
1222
1007
|
},
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1008
|
+
input: z4.object({}),
|
|
1009
|
+
resolve: async () => ({
|
|
1010
|
+
uri: "internal://endpoints",
|
|
1011
|
+
mimeType: "application/json",
|
|
1012
|
+
data: JSON.stringify(ENDPOINTS, null, 2)
|
|
1013
|
+
})
|
|
1014
|
+
}));
|
|
1015
|
+
resources.register(defineResourceTemplate4({
|
|
1016
|
+
meta: {
|
|
1017
|
+
uriTemplate: "internal://playbook",
|
|
1018
|
+
title: "Internal MCP usage playbook",
|
|
1019
|
+
description: "How internal agents should discover docs, CLI usage, and endpoints.",
|
|
1020
|
+
mimeType: "text/markdown",
|
|
1021
|
+
tags: INTERNAL_TAGS
|
|
1022
|
+
},
|
|
1023
|
+
input: z4.object({}),
|
|
1024
|
+
resolve: async () => ({
|
|
1025
|
+
uri: "internal://playbook",
|
|
1026
|
+
mimeType: "text/markdown",
|
|
1027
|
+
data: [
|
|
1028
|
+
"# Internal MCP playbook",
|
|
1029
|
+
"- Connect to docs MCP first for canonical specs.",
|
|
1030
|
+
"- Use CLI MCP to surface quickstart/reference before running commands.",
|
|
1031
|
+
"- Keep calls read-only unless explicitly approved.",
|
|
1032
|
+
`- Endpoints: ${ENDPOINTS.docs}, ${ENDPOINTS.cli}, ${ENDPOINTS.internal}.`,
|
|
1033
|
+
"- For API work, GraphQL at /graphql; health at /health."
|
|
1034
|
+
].join(`
|
|
1035
|
+
`)
|
|
1036
|
+
})
|
|
1037
|
+
}));
|
|
1038
|
+
return resources;
|
|
1228
1039
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
fields: {
|
|
1233
|
-
path: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
1234
|
-
content: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
|
|
1235
|
-
fields: { type: ScalarTypeEnum3.JSON(), isOptional: true }
|
|
1236
|
-
}
|
|
1237
|
-
});
|
|
1238
|
-
const UpdateOutput = defineSchemaModel3({
|
|
1239
|
-
name: "ContractsUpdateOutput",
|
|
1240
|
-
fields: {
|
|
1241
|
-
updated: { type: ScalarTypeEnum3.Boolean(), isOptional: false },
|
|
1242
|
-
errors: { type: ScalarTypeEnum3.JSON(), isOptional: false },
|
|
1243
|
-
warnings: { type: ScalarTypeEnum3.JSON(), isOptional: false }
|
|
1244
|
-
}
|
|
1245
|
-
});
|
|
1246
|
-
installOp5(registry, defineCommand3({
|
|
1040
|
+
function buildInternalPrompts() {
|
|
1041
|
+
const prompts = new PromptRegistry4;
|
|
1042
|
+
prompts.register(definePrompt4({
|
|
1247
1043
|
meta: {
|
|
1248
|
-
key: "
|
|
1044
|
+
key: "internal_bootstrap",
|
|
1249
1045
|
version: "1.0.0",
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
tags:
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
context: "Contracts MCP server."
|
|
1046
|
+
title: "Bootstrap internal ContractSpec agent",
|
|
1047
|
+
description: "Points agents to the correct MCP endpoints and guardrails.",
|
|
1048
|
+
tags: INTERNAL_TAGS,
|
|
1049
|
+
owners: INTERNAL_OWNERS,
|
|
1050
|
+
stability: "beta"
|
|
1256
1051
|
},
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1052
|
+
args: [],
|
|
1053
|
+
input: z4.object({}),
|
|
1054
|
+
render: async () => [
|
|
1055
|
+
{
|
|
1056
|
+
type: "text",
|
|
1057
|
+
text: "Start with internal://endpoints to pick the right MCP. Use docs MCP for specifications and CLI MCP for commands. Keep actions read-only unless explicitly approved."
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
type: "resource",
|
|
1061
|
+
uri: "internal://endpoints",
|
|
1062
|
+
title: "Endpoints"
|
|
1063
|
+
}
|
|
1064
|
+
]
|
|
1262
1065
|
}));
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
});
|
|
1270
|
-
const DeleteOutput = defineSchemaModel3({
|
|
1271
|
-
name: "ContractsDeleteOutput",
|
|
1066
|
+
return prompts;
|
|
1067
|
+
}
|
|
1068
|
+
function buildInternalOps() {
|
|
1069
|
+
const registry = new OperationSpecRegistry4;
|
|
1070
|
+
const InternalDescribeOutput = defineSchemaModel3({
|
|
1071
|
+
name: "InternalDescribeOutput",
|
|
1272
1072
|
fields: {
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1073
|
+
endpoints: {
|
|
1074
|
+
type: ScalarTypeEnum3.JSONObject(),
|
|
1075
|
+
isOptional: false
|
|
1076
|
+
},
|
|
1077
|
+
notes: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
1276
1078
|
}
|
|
1277
1079
|
});
|
|
1278
|
-
|
|
1080
|
+
const describeSpec = defineCommand3({
|
|
1279
1081
|
meta: {
|
|
1280
|
-
key: "
|
|
1082
|
+
key: "internal_describe",
|
|
1281
1083
|
version: "1.0.0",
|
|
1282
|
-
stability: "
|
|
1283
|
-
owners:
|
|
1284
|
-
tags:
|
|
1285
|
-
description: "
|
|
1286
|
-
goal: "
|
|
1287
|
-
context: "
|
|
1084
|
+
stability: "stable",
|
|
1085
|
+
owners: INTERNAL_OWNERS,
|
|
1086
|
+
tags: INTERNAL_TAGS,
|
|
1087
|
+
description: "Return MCP endpoints and guidance for internal ContractSpec agents.",
|
|
1088
|
+
goal: "Speed up internal development with the correct MCP entrypoints.",
|
|
1089
|
+
context: "Used by internal MCP surface; read-only."
|
|
1288
1090
|
},
|
|
1289
|
-
io: {
|
|
1290
|
-
|
|
1291
|
-
|
|
1091
|
+
io: {
|
|
1092
|
+
input: defineSchemaModel3({
|
|
1093
|
+
name: "InternalDescribeInput",
|
|
1094
|
+
fields: {}
|
|
1095
|
+
}),
|
|
1096
|
+
output: InternalDescribeOutput
|
|
1097
|
+
},
|
|
1098
|
+
policy: {
|
|
1099
|
+
auth: "anonymous"
|
|
1100
|
+
}
|
|
1101
|
+
});
|
|
1102
|
+
installOp4(registry, describeSpec, async () => ({
|
|
1103
|
+
endpoints: ENDPOINTS,
|
|
1104
|
+
notes: "Use docs MCP for canonical specs, CLI MCP for contractspec commands, and keep side-effecting actions gated behind human review."
|
|
1105
|
+
}));
|
|
1106
|
+
return registry;
|
|
1107
|
+
}
|
|
1108
|
+
function createInternalMcpHandler(path2 = "/api/mcp/internal") {
|
|
1109
|
+
return createMcpElysiaHandler({
|
|
1110
|
+
logger: appLogger,
|
|
1111
|
+
path: path2,
|
|
1112
|
+
serverName: "contractspec-internal-mcp",
|
|
1113
|
+
ops: buildInternalOps(),
|
|
1114
|
+
resources: buildInternalResources(),
|
|
1115
|
+
prompts: buildInternalPrompts()
|
|
1116
|
+
});
|
|
1292
1117
|
}
|
|
1293
1118
|
|
|
1294
|
-
// src/application/mcp/
|
|
1119
|
+
// src/application/mcp/providerRankingMcp.ts
|
|
1120
|
+
import { getModelInfo } from "@contractspec/lib.ai-providers/models";
|
|
1295
1121
|
import {
|
|
1296
1122
|
definePrompt as definePrompt5,
|
|
1297
1123
|
defineResourceTemplate as defineResourceTemplate5,
|
|
1124
|
+
installOp as installOp5,
|
|
1125
|
+
OperationSpecRegistry as OperationSpecRegistry5,
|
|
1298
1126
|
PromptRegistry as PromptRegistry5,
|
|
1299
1127
|
ResourceRegistry as ResourceRegistry5
|
|
1300
1128
|
} from "@contractspec/lib.contracts-spec";
|
|
1129
|
+
import {
|
|
1130
|
+
BenchmarkIngestCommand,
|
|
1131
|
+
BenchmarkRunCustomCommand,
|
|
1132
|
+
RankingRefreshCommand
|
|
1133
|
+
} from "@contractspec/lib.contracts-spec/provider-ranking";
|
|
1134
|
+
import { InMemoryProviderRankingStore } from "@contractspec/lib.provider-ranking/in-memory-store";
|
|
1135
|
+
import { createDefaultIngesterRegistry } from "@contractspec/lib.provider-ranking/ingesters";
|
|
1136
|
+
import {
|
|
1137
|
+
computeModelRankings,
|
|
1138
|
+
normalizeBenchmarkResults
|
|
1139
|
+
} from "@contractspec/lib.provider-ranking/scoring";
|
|
1301
1140
|
import z5 from "zod";
|
|
1302
|
-
var
|
|
1303
|
-
var
|
|
1304
|
-
|
|
1141
|
+
var TransportFilterSchema = z5.enum(["rest", "mcp", "webhook", "sdk"]).optional();
|
|
1142
|
+
var AuthFilterSchema = z5.enum([
|
|
1143
|
+
"api-key",
|
|
1144
|
+
"oauth2",
|
|
1145
|
+
"bearer",
|
|
1146
|
+
"header",
|
|
1147
|
+
"basic",
|
|
1148
|
+
"webhook-signing",
|
|
1149
|
+
"service-account"
|
|
1150
|
+
]).optional();
|
|
1151
|
+
var RANKING_TAGS = ["ranking", "mcp", "ai"];
|
|
1152
|
+
var RANKING_OWNERS = ["platform.ai"];
|
|
1153
|
+
var sharedStore = null;
|
|
1154
|
+
function getStore() {
|
|
1155
|
+
if (!sharedStore) {
|
|
1156
|
+
sharedStore = new InMemoryProviderRankingStore;
|
|
1157
|
+
}
|
|
1158
|
+
return sharedStore;
|
|
1159
|
+
}
|
|
1160
|
+
function buildRankingResources() {
|
|
1305
1161
|
const resources = new ResourceRegistry5;
|
|
1306
1162
|
resources.register(defineResourceTemplate5({
|
|
1307
1163
|
meta: {
|
|
1308
|
-
uriTemplate: "
|
|
1309
|
-
title: "
|
|
1310
|
-
description: "
|
|
1164
|
+
uriTemplate: "ranking://leaderboard",
|
|
1165
|
+
title: "AI Model Leaderboard",
|
|
1166
|
+
description: "Current ranked list of AI models by composite score. Supports optional transport and authMethod query filters.",
|
|
1167
|
+
mimeType: "application/json",
|
|
1168
|
+
tags: RANKING_TAGS
|
|
1169
|
+
},
|
|
1170
|
+
input: z5.object({
|
|
1171
|
+
transport: TransportFilterSchema,
|
|
1172
|
+
authMethod: AuthFilterSchema
|
|
1173
|
+
}),
|
|
1174
|
+
resolve: async ({ transport, authMethod }) => {
|
|
1175
|
+
const store = getStore();
|
|
1176
|
+
const result = await store.listModelRankings({
|
|
1177
|
+
limit: 100,
|
|
1178
|
+
requiredTransport: transport,
|
|
1179
|
+
requiredAuthMethod: authMethod
|
|
1180
|
+
});
|
|
1181
|
+
return {
|
|
1182
|
+
uri: "ranking://leaderboard",
|
|
1183
|
+
mimeType: "application/json",
|
|
1184
|
+
data: JSON.stringify(result, null, 2)
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
}));
|
|
1188
|
+
resources.register(defineResourceTemplate5({
|
|
1189
|
+
meta: {
|
|
1190
|
+
uriTemplate: "ranking://leaderboard/{dimension}",
|
|
1191
|
+
title: "AI Model Leaderboard by Dimension",
|
|
1192
|
+
description: "Ranked list of AI models filtered by a specific dimension. Supports optional transport and authMethod query filters.",
|
|
1311
1193
|
mimeType: "application/json",
|
|
1312
|
-
tags:
|
|
1194
|
+
tags: RANKING_TAGS
|
|
1313
1195
|
},
|
|
1314
|
-
input: z5.object({
|
|
1315
|
-
|
|
1316
|
-
|
|
1196
|
+
input: z5.object({
|
|
1197
|
+
dimension: z5.string(),
|
|
1198
|
+
transport: TransportFilterSchema,
|
|
1199
|
+
authMethod: AuthFilterSchema
|
|
1200
|
+
}),
|
|
1201
|
+
resolve: async ({ dimension, transport, authMethod }) => {
|
|
1202
|
+
const store = getStore();
|
|
1203
|
+
const result = await store.listModelRankings({
|
|
1204
|
+
dimension,
|
|
1205
|
+
limit: 100,
|
|
1206
|
+
requiredTransport: transport,
|
|
1207
|
+
requiredAuthMethod: authMethod
|
|
1208
|
+
});
|
|
1317
1209
|
return {
|
|
1318
|
-
uri:
|
|
1210
|
+
uri: `ranking://leaderboard/${encodeURIComponent(dimension)}`,
|
|
1319
1211
|
mimeType: "application/json",
|
|
1320
|
-
data: JSON.stringify(
|
|
1212
|
+
data: JSON.stringify(result, null, 2)
|
|
1321
1213
|
};
|
|
1322
1214
|
}
|
|
1323
1215
|
}));
|
|
1324
1216
|
resources.register(defineResourceTemplate5({
|
|
1325
1217
|
meta: {
|
|
1326
|
-
uriTemplate: "
|
|
1327
|
-
title: "
|
|
1328
|
-
description: "
|
|
1329
|
-
mimeType: "
|
|
1330
|
-
tags:
|
|
1218
|
+
uriTemplate: "ranking://model/{modelId}",
|
|
1219
|
+
title: "AI Model Profile",
|
|
1220
|
+
description: "Detailed profile for a specific AI model including scores and benchmarks.",
|
|
1221
|
+
mimeType: "application/json",
|
|
1222
|
+
tags: RANKING_TAGS
|
|
1331
1223
|
},
|
|
1332
|
-
input: z5.object({
|
|
1333
|
-
resolve: async ({
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1224
|
+
input: z5.object({ modelId: z5.string() }),
|
|
1225
|
+
resolve: async ({ modelId }) => {
|
|
1226
|
+
const store = getStore();
|
|
1227
|
+
const profile = await store.getModelProfile(modelId);
|
|
1228
|
+
if (!profile) {
|
|
1336
1229
|
return {
|
|
1337
|
-
uri: `
|
|
1338
|
-
mimeType: "
|
|
1339
|
-
data:
|
|
1230
|
+
uri: `ranking://model/${encodeURIComponent(modelId)}`,
|
|
1231
|
+
mimeType: "application/json",
|
|
1232
|
+
data: JSON.stringify({ error: "not_found", modelId })
|
|
1340
1233
|
};
|
|
1341
1234
|
}
|
|
1235
|
+
const enriched = profile.costPerMillion == null ? (() => {
|
|
1236
|
+
const info = getModelInfo(profile.modelId);
|
|
1237
|
+
return info?.costPerMillion ? {
|
|
1238
|
+
...profile,
|
|
1239
|
+
costPerMillion: info.costPerMillion,
|
|
1240
|
+
displayName: info.name,
|
|
1241
|
+
contextWindow: info.contextWindow,
|
|
1242
|
+
capabilities: [
|
|
1243
|
+
...info.capabilities.vision ? ["vision"] : [],
|
|
1244
|
+
...info.capabilities.tools ? ["tools"] : [],
|
|
1245
|
+
...info.capabilities.reasoning ? ["reasoning"] : [],
|
|
1246
|
+
...info.capabilities.streaming ? ["streaming"] : []
|
|
1247
|
+
]
|
|
1248
|
+
} : profile;
|
|
1249
|
+
})() : profile;
|
|
1342
1250
|
return {
|
|
1343
|
-
uri: `
|
|
1344
|
-
mimeType: "
|
|
1345
|
-
data:
|
|
1251
|
+
uri: `ranking://model/${encodeURIComponent(modelId)}`,
|
|
1252
|
+
mimeType: "application/json",
|
|
1253
|
+
data: JSON.stringify(enriched, null, 2)
|
|
1346
1254
|
};
|
|
1347
1255
|
}
|
|
1348
1256
|
}));
|
|
1349
1257
|
resources.register(defineResourceTemplate5({
|
|
1350
1258
|
meta: {
|
|
1351
|
-
uriTemplate: "
|
|
1352
|
-
title: "
|
|
1353
|
-
description: "
|
|
1259
|
+
uriTemplate: "ranking://results",
|
|
1260
|
+
title: "Benchmark Results",
|
|
1261
|
+
description: "List of raw benchmark results from all ingested sources.",
|
|
1354
1262
|
mimeType: "application/json",
|
|
1355
|
-
tags:
|
|
1263
|
+
tags: RANKING_TAGS
|
|
1356
1264
|
},
|
|
1357
1265
|
input: z5.object({}),
|
|
1358
1266
|
resolve: async () => {
|
|
1359
|
-
const
|
|
1267
|
+
const store = getStore();
|
|
1268
|
+
const result = await store.listBenchmarkResults({ limit: 200 });
|
|
1360
1269
|
return {
|
|
1361
|
-
uri: "
|
|
1270
|
+
uri: "ranking://results",
|
|
1362
1271
|
mimeType: "application/json",
|
|
1363
|
-
data: JSON.stringify(
|
|
1272
|
+
data: JSON.stringify(result, null, 2)
|
|
1364
1273
|
};
|
|
1365
1274
|
}
|
|
1366
1275
|
}));
|
|
1367
1276
|
return resources;
|
|
1368
1277
|
}
|
|
1369
|
-
function
|
|
1278
|
+
function buildRankingPrompts() {
|
|
1370
1279
|
const prompts = new PromptRegistry5;
|
|
1371
1280
|
prompts.register(definePrompt5({
|
|
1372
1281
|
meta: {
|
|
1373
|
-
key: "
|
|
1282
|
+
key: "ranking.advisor",
|
|
1374
1283
|
version: "1.0.0",
|
|
1375
|
-
title: "
|
|
1376
|
-
description: "
|
|
1377
|
-
tags:
|
|
1284
|
+
title: "AI Model Advisor",
|
|
1285
|
+
description: "Which AI model is best for a given task? Uses the leaderboard to recommend.",
|
|
1286
|
+
tags: RANKING_TAGS,
|
|
1378
1287
|
stability: "beta",
|
|
1379
|
-
owners:
|
|
1288
|
+
owners: RANKING_OWNERS
|
|
1380
1289
|
},
|
|
1381
1290
|
args: [
|
|
1382
1291
|
{
|
|
1383
|
-
name: "
|
|
1384
|
-
description: "
|
|
1292
|
+
name: "task",
|
|
1293
|
+
description: "The task or use case to recommend a model for.",
|
|
1294
|
+
required: true,
|
|
1295
|
+
schema: z5.string()
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
name: "priority",
|
|
1299
|
+
description: "Priority dimension (coding, reasoning, cost, latency, etc.).",
|
|
1385
1300
|
required: false,
|
|
1386
1301
|
schema: z5.string().optional()
|
|
1387
|
-
}
|
|
1388
|
-
],
|
|
1389
|
-
input: z5.object({ goal: z5.string().optional() }),
|
|
1390
|
-
render: async ({ goal }) => [
|
|
1302
|
+
},
|
|
1391
1303
|
{
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
"2. Use contracts.get to read a spec",
|
|
1397
|
-
"3. Edit content and call contracts.update",
|
|
1398
|
-
"4. Run contracts.validate to verify changes",
|
|
1399
|
-
"5. Run contracts.build to regenerate artifacts",
|
|
1400
|
-
goal ? `Agent goal: ${goal}` : ""
|
|
1401
|
-
].filter(Boolean).join(`
|
|
1402
|
-
`)
|
|
1304
|
+
name: "transport",
|
|
1305
|
+
description: "Required transport type (rest, mcp, webhook, sdk).",
|
|
1306
|
+
required: false,
|
|
1307
|
+
schema: TransportFilterSchema
|
|
1403
1308
|
},
|
|
1404
1309
|
{
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1310
|
+
name: "authMethod",
|
|
1311
|
+
description: "Required auth method (api-key, oauth2, bearer, etc.).",
|
|
1312
|
+
required: false,
|
|
1313
|
+
schema: AuthFilterSchema
|
|
1408
1314
|
}
|
|
1409
|
-
]
|
|
1315
|
+
],
|
|
1316
|
+
input: z5.object({
|
|
1317
|
+
task: z5.string(),
|
|
1318
|
+
priority: z5.string().optional(),
|
|
1319
|
+
transport: TransportFilterSchema,
|
|
1320
|
+
authMethod: AuthFilterSchema
|
|
1321
|
+
}),
|
|
1322
|
+
render: async ({ task, priority, transport, authMethod }) => {
|
|
1323
|
+
const constraints = [];
|
|
1324
|
+
if (priority)
|
|
1325
|
+
constraints.push(`Prioritize: ${priority}.`);
|
|
1326
|
+
if (transport)
|
|
1327
|
+
constraints.push(`Required transport: ${transport}.`);
|
|
1328
|
+
if (authMethod)
|
|
1329
|
+
constraints.push(`Required auth: ${authMethod}.`);
|
|
1330
|
+
return [
|
|
1331
|
+
{
|
|
1332
|
+
type: "text",
|
|
1333
|
+
text: `Recommend the best AI model for: "${task}".${constraints.length ? ` ${constraints.join(" ")}` : ""} Use the leaderboard data to justify your recommendation.`
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
type: "resource",
|
|
1337
|
+
uri: priority ? `ranking://leaderboard/${priority}` : "ranking://leaderboard",
|
|
1338
|
+
title: "Leaderboard"
|
|
1339
|
+
}
|
|
1340
|
+
];
|
|
1341
|
+
}
|
|
1410
1342
|
}));
|
|
1411
1343
|
return prompts;
|
|
1412
1344
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1345
|
+
function buildRankingOps() {
|
|
1346
|
+
const registry = new OperationSpecRegistry5;
|
|
1347
|
+
const ingesterRegistry = createDefaultIngesterRegistry();
|
|
1348
|
+
installOp5(registry, BenchmarkIngestCommand, async (args) => {
|
|
1349
|
+
const store = getStore();
|
|
1350
|
+
const source = args.source;
|
|
1351
|
+
const ingester = ingesterRegistry.get(source);
|
|
1352
|
+
if (!ingester) {
|
|
1353
|
+
throw new Error(`No ingester registered for source: ${source}`);
|
|
1354
|
+
}
|
|
1355
|
+
const rawResults = await ingester.ingest({
|
|
1356
|
+
sourceUrl: args.sourceUrl,
|
|
1357
|
+
dimensions: args.dimensions
|
|
1358
|
+
});
|
|
1359
|
+
const normalized = normalizeBenchmarkResults(rawResults);
|
|
1360
|
+
for (const result of normalized) {
|
|
1361
|
+
await store.upsertBenchmarkResult(result);
|
|
1362
|
+
}
|
|
1363
|
+
return {
|
|
1364
|
+
ingestionId: `ingest-${source}-${Date.now()}`,
|
|
1365
|
+
source,
|
|
1366
|
+
resultsCount: normalized.length,
|
|
1367
|
+
status: "completed",
|
|
1368
|
+
ingestedAt: new Date
|
|
1369
|
+
};
|
|
1370
|
+
});
|
|
1371
|
+
installOp5(registry, BenchmarkRunCustomCommand, async (args) => {
|
|
1372
|
+
return {
|
|
1373
|
+
runId: `custom-${Date.now()}`,
|
|
1374
|
+
evalSuiteKey: args.evalSuiteKey,
|
|
1375
|
+
modelId: args.modelId,
|
|
1376
|
+
status: "started",
|
|
1377
|
+
startedAt: new Date
|
|
1378
|
+
};
|
|
1379
|
+
});
|
|
1380
|
+
installOp5(registry, RankingRefreshCommand, async (args) => {
|
|
1381
|
+
const store = getStore();
|
|
1382
|
+
const allResults = [];
|
|
1383
|
+
let offset = 0;
|
|
1384
|
+
const pageSize = 500;
|
|
1385
|
+
while (true) {
|
|
1386
|
+
const page = await store.listBenchmarkResults({
|
|
1387
|
+
limit: pageSize,
|
|
1388
|
+
offset
|
|
1389
|
+
});
|
|
1390
|
+
allResults.push(...page.results);
|
|
1391
|
+
if (allResults.length >= page.total || page.results.length < pageSize)
|
|
1392
|
+
break;
|
|
1393
|
+
offset += pageSize;
|
|
1394
|
+
}
|
|
1395
|
+
const existingRankings = new Map((await store.listModelRankings({ limit: 1e4 })).rankings.map((r) => [
|
|
1396
|
+
r.modelId,
|
|
1397
|
+
r
|
|
1398
|
+
]));
|
|
1399
|
+
const weightOverrides = args.weightOverrides ? Array.isArray(args.weightOverrides) ? args.weightOverrides : [args.weightOverrides] : undefined;
|
|
1400
|
+
const newRankings = computeModelRankings(allResults, weightOverrides ? {
|
|
1401
|
+
weightOverrides
|
|
1402
|
+
} : undefined, existingRankings);
|
|
1403
|
+
for (const ranking of newRankings) {
|
|
1404
|
+
await store.upsertModelRanking(ranking);
|
|
1405
|
+
}
|
|
1406
|
+
return {
|
|
1407
|
+
modelsRanked: newRankings.length,
|
|
1408
|
+
updatedAt: new Date,
|
|
1409
|
+
status: "completed"
|
|
1410
|
+
};
|
|
1411
|
+
});
|
|
1412
|
+
return registry;
|
|
1413
|
+
}
|
|
1414
|
+
function createProviderRankingMcpHandler(path2 = "/api/mcp/ranking") {
|
|
1416
1415
|
return createMcpElysiaHandler({
|
|
1417
1416
|
logger: appLogger,
|
|
1418
1417
|
path: path2,
|
|
1419
|
-
serverName: "contractspec-
|
|
1420
|
-
ops:
|
|
1421
|
-
resources:
|
|
1422
|
-
prompts:
|
|
1418
|
+
serverName: "contractspec-ranking-mcp",
|
|
1419
|
+
ops: buildRankingOps(),
|
|
1420
|
+
resources: buildRankingResources(),
|
|
1421
|
+
prompts: buildRankingPrompts()
|
|
1423
1422
|
});
|
|
1424
1423
|
}
|
|
1424
|
+
function setProviderRankingStore(store) {
|
|
1425
|
+
sharedStore = store;
|
|
1426
|
+
}
|
|
1425
1427
|
export {
|
|
1426
1428
|
setProviderRankingStore,
|
|
1427
1429
|
createProviderRankingMcpHandler,
|