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