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