@contractspec/bundle.library 3.8.9 → 3.8.11
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 +606 -594
- package/CHANGELOG.md +68 -0
- package/dist/application/context-storage/index.js +1 -28
- package/dist/application/index.js +13 -2133
- package/dist/application/mcp/cliMcp.js +4 -452
- package/dist/application/mcp/common.js +1 -193
- package/dist/application/mcp/contractsMcp.js +2 -549
- package/dist/application/mcp/contractsMcpResources.js +2 -123
- package/dist/application/mcp/contractsMcpTools.js +1 -199
- package/dist/application/mcp/docsMcp.catalog.js +3 -381
- package/dist/application/mcp/docsMcp.data.js +1 -147
- package/dist/application/mcp/docsMcp.js +6 -1039
- package/dist/application/mcp/docsMcp.prompts.js +6 -521
- package/dist/application/mcp/docsMcp.reference.js +3 -235
- package/dist/application/mcp/docsMcp.resources.js +3 -519
- package/dist/application/mcp/docsMcp.tools.js +3 -518
- package/dist/application/mcp/index.js +13 -2106
- package/dist/application/mcp/internalMcp.js +2 -410
- package/dist/application/mcp/normalizeMcpRequest.js +1 -21
- package/dist/application/mcp/providerRankingMcp.js +1 -530
- package/dist/bundles/LibraryBundle.js +1 -138
- package/dist/bundles/index.js +1 -138
- package/dist/components/docs/DocsIndexPage.js +2 -912
- package/dist/components/docs/advanced/AdvancedMCPPage.js +4 -271
- package/dist/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -107
- package/dist/components/docs/advanced/AdvancedRenderersPage.js +2 -118
- package/dist/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -92
- package/dist/components/docs/advanced/AdvancedTelemetryPage.js +2 -373
- package/dist/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -99
- package/dist/components/docs/advanced/index.js +10 -1055
- package/dist/components/docs/architecture/ArchitectureAppConfigPage.js +6 -243
- package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +3 -160
- package/dist/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -259
- package/dist/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -374
- package/dist/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -166
- package/dist/components/docs/architecture/ArchitectureOverviewPage.js +1 -143
- package/dist/components/docs/architecture/index.js +20 -1340
- package/dist/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -245
- package/dist/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -230
- package/dist/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -245
- package/dist/components/docs/comparison/ComparisonOverviewPage.js +1 -202
- package/dist/components/docs/comparison/ComparisonWindmillPage.js +1 -254
- package/dist/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -339
- package/dist/components/docs/comparison/index.js +1 -1510
- package/dist/components/docs/docsManifest.js +1 -611
- package/dist/components/docs/docsManifest.test.d.ts +1 -0
- package/dist/components/docs/ecosystem/IntegrationsPage.js +2 -103
- package/dist/components/docs/ecosystem/PluginsPage.js +13 -179
- package/dist/components/docs/ecosystem/RegistryPage.js +7 -100
- package/dist/components/docs/ecosystem/TemplatesPage.js +3 -141
- package/dist/components/docs/ecosystem/ecosystem.docblocks.js +2 -48
- package/dist/components/docs/ecosystem/index.js +23 -569
- package/dist/components/docs/examples/DocsExamplesPage.js +4 -124
- package/dist/components/docs/examples/ExampleShowcasePage.js +4 -244
- package/dist/components/docs/examples/exampleShowcaseData.js +4 -39
- package/dist/components/docs/examples/index.js +4 -330
- package/dist/components/docs/generated/docs-index.generated.js +1 -5
- package/dist/components/docs/generated/index.js +1 -74
- package/dist/components/docs/generated/loader.js +1 -74
- package/dist/components/docs/getting-started/CLIPage.js +4 -271
- package/dist/components/docs/getting-started/CompatibilityPage.js +1 -173
- package/dist/components/docs/getting-started/DataViewTutorialPage.js +4 -134
- package/dist/components/docs/getting-started/DeveloperToolsPage.js +1 -194
- package/dist/components/docs/getting-started/HelloWorldPage.js +5 -183
- package/dist/components/docs/getting-started/InstallationPage.js +3 -154
- package/dist/components/docs/getting-started/StartHerePage.js +2 -129
- package/dist/components/docs/getting-started/TroubleshootingPage.js +2 -168
- package/dist/components/docs/getting-started/VSCodeExtensionPage.js +1 -432
- package/dist/components/docs/getting-started/getting-started.docblocks.js +4 -41
- package/dist/components/docs/getting-started/index.js +18 -1869
- package/dist/components/docs/guides/GuideCIDiffGatingPage.js +2 -196
- package/dist/components/docs/guides/GuideConnectInRepoPage.d.ts +1 -0
- package/dist/components/docs/guides/GuideConnectInRepoPage.js +44 -0
- package/dist/components/docs/guides/GuideContractTypesPage.js +6 -541
- package/dist/components/docs/guides/GuideDocsPipelinePage.js +3 -207
- package/dist/components/docs/guides/GuideFirstModuleBundlePage.d.ts +1 -0
- package/dist/components/docs/guides/GuideFirstModuleBundlePage.js +76 -0
- package/dist/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -209
- package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.d.ts +1 -0
- package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.js +70 -0
- package/dist/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -754
- package/dist/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -268
- package/dist/components/docs/guides/GuideSpecValidationTypingPage.js +4 -196
- package/dist/components/docs/guides/GuidesIndexPage.js +2 -169
- package/dist/components/docs/guides/guides.docblocks.js +11 -75
- package/dist/components/docs/guides/index.d.ts +3 -0
- package/dist/components/docs/guides/index.js +213 -2428
- package/dist/components/docs/index.js +542 -24297
- package/dist/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -42
- package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -105
- package/dist/components/docs/integrations/IntegrationsGithubPage.js +3 -142
- package/dist/components/docs/integrations/IntegrationsGmailPage.js +3 -109
- package/dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -79
- package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +3 -146
- package/dist/components/docs/integrations/IntegrationsMistralPage.js +5 -150
- package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +5 -140
- package/dist/components/docs/integrations/IntegrationsOverviewPage.js +1 -160
- package/dist/components/docs/integrations/IntegrationsPostmarkPage.js +4 -218
- package/dist/components/docs/integrations/IntegrationsPowensPage.js +4 -300
- package/dist/components/docs/integrations/IntegrationsQdrantPage.js +5 -111
- package/dist/components/docs/integrations/IntegrationsResendPage.js +3 -102
- package/dist/components/docs/integrations/IntegrationsS3Page.js +4 -124
- package/dist/components/docs/integrations/IntegrationsSlackPage.js +3 -144
- package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +7 -290
- package/dist/components/docs/integrations/IntegrationsStripePage.js +6 -327
- package/dist/components/docs/integrations/IntegrationsTwilioPage.js +3 -128
- package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -146
- package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -156
- package/dist/components/docs/integrations/index.js +52 -3100
- package/dist/components/docs/intent/ContractFirstApiPage.js +2 -126
- package/dist/components/docs/intent/DeterministicCodegenPage.js +2 -148
- package/dist/components/docs/intent/GenerateClientFromSchemaPage.js +7 -207
- package/dist/components/docs/intent/OpenapiAlternativePage.js +3 -201
- package/dist/components/docs/intent/SchemaValidationTypescriptPage.js +4 -144
- package/dist/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -126
- package/dist/components/docs/intent/index.js +15 -1135
- package/dist/components/docs/intent/intent-pages.docblocks.js +1 -201
- package/dist/components/docs/knowledge/KnowledgeCategoriesPage.js +6 -750
- package/dist/components/docs/knowledge/KnowledgeExamplesPage.js +4 -175
- package/dist/components/docs/knowledge/KnowledgeOverviewPage.js +1 -116
- package/dist/components/docs/knowledge/KnowledgeSourcesPage.js +8 -391
- package/dist/components/docs/knowledge/KnowledgeSpacesPage.js +6 -302
- package/dist/components/docs/knowledge/index.js +21 -1730
- package/dist/components/docs/libraries/LibrariesAccessibilityPage.js +3 -198
- package/dist/components/docs/libraries/LibrariesAiAgentPage.js +3 -141
- package/dist/components/docs/libraries/LibrariesAnalyticsPage.js +4 -80
- package/dist/components/docs/libraries/LibrariesContentGenPage.js +2 -100
- package/dist/components/docs/libraries/LibrariesContractsPage.js +2 -284
- package/dist/components/docs/libraries/LibrariesCostTrackingPage.js +3 -112
- package/dist/components/docs/libraries/LibrariesDataBackendPage.js +2 -166
- package/dist/components/docs/libraries/LibrariesDataViewsPage.js +3 -186
- package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +4 -279
- package/dist/components/docs/libraries/LibrariesEvolutionPage.js +4 -127
- package/dist/components/docs/libraries/LibrariesGraphQLPage.js +2 -173
- package/dist/components/docs/libraries/LibrariesGrowthPage.js +3 -88
- package/dist/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -108
- package/dist/components/docs/libraries/LibrariesObservabilityPage.js +5 -130
- package/dist/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -110
- package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -170
- package/dist/components/docs/libraries/LibrariesPersonalizationPage.js +4 -114
- package/dist/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -132
- package/dist/components/docs/libraries/LibrariesResiliencePage.js +4 -120
- package/dist/components/docs/libraries/LibrariesRuntimePage.js +2 -200
- package/dist/components/docs/libraries/LibrariesSLOPage.js +3 -116
- package/dist/components/docs/libraries/LibrariesSchemaPage.js +3 -273
- package/dist/components/docs/libraries/LibrariesSupportBotPage.js +3 -134
- package/dist/components/docs/libraries/LibrariesTestingPage.js +3 -133
- package/dist/components/docs/libraries/LibrariesUIKitPage.js +2 -230
- package/dist/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -88
- package/dist/components/docs/libraries/LibrariesWorkflowsPage.js +2 -181
- package/dist/components/docs/libraries/index.js +54 -4147
- package/dist/components/docs/manifesto/ManifestoPage.js +1 -86
- package/dist/components/docs/ops/AutoEvolutionOpsPage.js +2 -132
- package/dist/components/docs/ops/DistributedTracingOpsPage.js +2 -71
- package/dist/components/docs/ops/index.js +3 -202
- package/dist/components/docs/ops/ops-lifecycle.docblocks.js +3 -38
- package/dist/components/docs/ops/ops-runbooks-a.docblocks.js +3 -94
- package/dist/components/docs/ops/ops-runbooks-b.docblocks.js +3 -76
- package/dist/components/docs/ops/ops-slo-tenant.docblocks.js +3 -76
- package/dist/components/docs/ops/ops-top.docs.js +2 -17
- package/dist/components/docs/ops/ops.docs.js +10 -302
- package/dist/components/docs/product/product.docblocks.js +5 -72
- package/dist/components/docs/reference/DocsMarkdownContent.js +2 -196
- package/dist/components/docs/reference/DocsReferenceContent.js +3 -256
- package/dist/components/docs/reference/DocsReferenceIndexClient.js +2 -127
- package/dist/components/docs/reference/DocsReferenceIndexPage.js +2 -206
- package/dist/components/docs/reference/DocsReferencePage.js +3 -265
- package/dist/components/docs/reference/docsMarkdownParser.js +2 -92
- package/dist/components/docs/reference/index.js +4 -470
- package/dist/components/docs/safety/SafetyAuditingPage.js +2 -350
- package/dist/components/docs/safety/SafetyMigrationsPage.js +2 -359
- package/dist/components/docs/safety/SafetyOverviewPage.js +1 -101
- package/dist/components/docs/safety/SafetyPDPPage.js +2 -301
- package/dist/components/docs/safety/SafetySecurityTrustPage.js +1 -206
- package/dist/components/docs/safety/SafetySigningPage.js +3 -90
- package/dist/components/docs/safety/SafetyTenantIsolationPage.js +2 -79
- package/dist/components/docs/safety/index.js +7 -1480
- package/dist/components/docs/shared/StudioPrompt.js +1 -31
- package/dist/components/docs/specs/SpecsBuilderControlPlanePage.d.ts +1 -0
- package/dist/components/docs/specs/SpecsBuilderControlPlanePage.js +34 -0
- package/dist/components/docs/specs/SpecsCapabilitiesPage.js +2 -158
- package/dist/components/docs/specs/SpecsConnectPage.d.ts +1 -0
- package/dist/components/docs/specs/SpecsConnectPage.js +8 -0
- package/dist/components/docs/specs/SpecsDataViewsPage.js +2 -260
- package/dist/components/docs/specs/SpecsModuleBundlesPage.d.ts +1 -0
- package/dist/components/docs/specs/SpecsModuleBundlesPage.js +67 -0
- package/dist/components/docs/specs/SpecsOverlaysPage.js +2 -372
- package/dist/components/docs/specs/SpecsOverviewPage.js +1 -186
- package/dist/components/docs/specs/SpecsPolicyPage.js +3 -420
- package/dist/components/docs/specs/SpecsWorkflowsPage.js +2 -312
- package/dist/components/docs/specs/index.d.ts +3 -0
- package/dist/components/docs/specs/index.js +109 -1702
- package/dist/components/docs/studio/StudioBYOKPage.js +1 -26
- package/dist/components/docs/studio/StudioDeploymentsPage.js +1 -26
- package/dist/components/docs/studio/StudioGettingStartedPage.js +1 -26
- package/dist/components/docs/studio/StudioIntegrationsPage.js +1 -26
- package/dist/components/docs/studio/StudioOverviewPage.js +1 -157
- package/dist/components/docs/studio/StudioVisualBuilderPage.js +1 -26
- package/dist/components/docs/studio/index.js +1 -282
- package/dist/components/docs/tech/contracts/tech-docs.docblocks.js +2 -19
- package/dist/components/integrations/index.js +2 -600
- package/dist/components/integrations/molecules/IntegrationCard.js +1 -100
- package/dist/components/integrations/organisms/IntegrationMarketplace.js +1 -214
- package/dist/components/integrations/organisms/IntegrationSettings.js +2 -284
- package/dist/components/integrations/organisms/KnowledgeSourceList.js +1 -103
- package/dist/components/legal/PrivacyTemplate.js +1 -1025
- package/dist/components/legal/TermsTemplate.js +1 -941
- package/dist/components/legal/index.js +1 -1963
- package/dist/components/shared/FeatureGateNotice.js +1 -38
- package/dist/components/shared/index.js +1 -38
- package/dist/components/shell/WorkspaceHeader.js +1 -100
- package/dist/components/shell/WorkspaceProjectShellLayout.js +1 -222
- package/dist/components/shell/WorkspaceShellRenderer.js +1 -228
- package/dist/components/shell/WorkspaceSidebar.js +1 -68
- package/dist/components/shell/index.js +1 -287
- package/dist/components/templates/engine/index.js +1 -39
- package/dist/components/templates/index.js +11 -965
- package/dist/components/templates/messaging/ConversationList.js +2 -83
- package/dist/components/templates/messaging/MessageComposer.js +4 -150
- package/dist/components/templates/messaging/MessageThread.js +3 -83
- package/dist/components/templates/messaging/MessagingWorkspace.js +5 -265
- package/dist/components/templates/messaging/index.js +5 -269
- package/dist/components/templates/recipes/LanguageSwitcher.js +1 -16
- package/dist/components/templates/recipes/RecipeCard.js +1 -80
- package/dist/components/templates/recipes/RecipeDetail.js +1 -74
- package/dist/components/templates/recipes/RecipeList.js +3 -245
- package/dist/components/templates/recipes/index.js +3 -248
- package/dist/components/templates/todos/FilterBar.js +1 -107
- package/dist/components/templates/todos/TaskForm.js +2 -158
- package/dist/components/templates/todos/TaskItem.js +1 -77
- package/dist/components/templates/todos/TaskList.js +5 -449
- package/dist/components/templates/todos/index.js +5 -452
- package/dist/config/contractspec-blueprint.js +1 -123
- package/dist/config/contractspec-branding.js +1 -44
- package/dist/config/contractspec-routes.js +1 -24
- package/dist/config/index.js +1 -126
- package/dist/features/contracts-registry.js +1 -178
- package/dist/features/docs/docs.contracts.js +1 -17
- package/dist/features/docs/index.js +1 -17
- package/dist/features/docs.feature.js +1 -33
- package/dist/features/index.js +1 -315
- package/dist/features/mcp.feature.js +1 -30
- package/dist/features/presentations.feature.js +1 -33
- package/dist/features/registry.js +1 -116
- package/dist/index.js +556 -28580
- package/dist/infrastructure/elysia/index.js +1 -35
- package/dist/infrastructure/elysia/logger.js +1 -35
- package/dist/infrastructure/index.js +1 -35
- package/dist/libs/email/client.js +1 -114
- package/dist/libs/email/contact.js +12 -165
- package/dist/libs/email/newsletter.js +6 -167
- package/dist/libs/email/types.js +0 -2
- package/dist/libs/email/utils.js +2 -8
- package/dist/libs/email/waitlist-application.js +28 -209
- package/dist/libs/email/waitlist.js +6 -167
- package/dist/libs/email.js +46 -363
- package/dist/libs/posthog/client.js +1 -63
- package/dist/libs/posthog/native.js +1 -23
- package/dist/libs/posthog/server.js +1 -13
- package/dist/libs/pricing-examples.js +1 -18
- package/dist/node/application/context-storage/index.js +1 -28
- package/dist/node/application/index.js +13 -2133
- package/dist/node/application/mcp/cliMcp.js +4 -452
- package/dist/node/application/mcp/common.js +1 -193
- package/dist/node/application/mcp/contractsMcp.js +2 -549
- package/dist/node/application/mcp/contractsMcpResources.js +2 -123
- package/dist/node/application/mcp/contractsMcpTools.js +1 -199
- package/dist/node/application/mcp/docsMcp.catalog.js +3 -381
- package/dist/node/application/mcp/docsMcp.data.js +1 -147
- package/dist/node/application/mcp/docsMcp.js +6 -1039
- package/dist/node/application/mcp/docsMcp.prompts.js +6 -521
- package/dist/node/application/mcp/docsMcp.reference.js +3 -235
- package/dist/node/application/mcp/docsMcp.resources.js +3 -519
- package/dist/node/application/mcp/docsMcp.tools.js +3 -518
- package/dist/node/application/mcp/index.js +13 -2106
- package/dist/node/application/mcp/internalMcp.js +2 -410
- package/dist/node/application/mcp/normalizeMcpRequest.js +1 -21
- package/dist/node/application/mcp/providerRankingMcp.js +1 -530
- package/dist/node/bundles/LibraryBundle.js +1 -138
- package/dist/node/bundles/index.js +1 -138
- package/dist/node/components/docs/DocsIndexPage.js +2 -912
- package/dist/node/components/docs/advanced/AdvancedMCPPage.js +4 -271
- package/dist/node/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -107
- package/dist/node/components/docs/advanced/AdvancedRenderersPage.js +2 -118
- package/dist/node/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -92
- package/dist/node/components/docs/advanced/AdvancedTelemetryPage.js +2 -373
- package/dist/node/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -99
- package/dist/node/components/docs/advanced/index.js +10 -1055
- package/dist/node/components/docs/architecture/ArchitectureAppConfigPage.js +6 -243
- package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +3 -160
- package/dist/node/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -259
- package/dist/node/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -374
- package/dist/node/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -166
- package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +1 -143
- package/dist/node/components/docs/architecture/index.js +20 -1340
- package/dist/node/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -245
- package/dist/node/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -230
- package/dist/node/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -245
- package/dist/node/components/docs/comparison/ComparisonOverviewPage.js +1 -202
- package/dist/node/components/docs/comparison/ComparisonWindmillPage.js +1 -254
- package/dist/node/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -339
- package/dist/node/components/docs/comparison/index.js +1 -1510
- package/dist/node/components/docs/docsManifest.js +1 -611
- package/dist/node/components/docs/ecosystem/IntegrationsPage.js +2 -103
- package/dist/node/components/docs/ecosystem/PluginsPage.js +13 -179
- package/dist/node/components/docs/ecosystem/RegistryPage.js +7 -100
- package/dist/node/components/docs/ecosystem/TemplatesPage.js +3 -141
- package/dist/node/components/docs/ecosystem/ecosystem.docblocks.js +2 -48
- package/dist/node/components/docs/ecosystem/index.js +23 -569
- package/dist/node/components/docs/examples/DocsExamplesPage.js +4 -124
- package/dist/node/components/docs/examples/ExampleShowcasePage.js +4 -244
- package/dist/node/components/docs/examples/exampleShowcaseData.js +4 -39
- package/dist/node/components/docs/examples/index.js +4 -330
- package/dist/node/components/docs/generated/docs-index.generated.js +1 -5
- package/dist/node/components/docs/generated/index.js +1 -74
- package/dist/node/components/docs/generated/loader.js +1 -74
- package/dist/node/components/docs/getting-started/CLIPage.js +4 -271
- package/dist/node/components/docs/getting-started/CompatibilityPage.js +1 -173
- package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +4 -134
- package/dist/node/components/docs/getting-started/DeveloperToolsPage.js +1 -194
- package/dist/node/components/docs/getting-started/HelloWorldPage.js +5 -183
- package/dist/node/components/docs/getting-started/InstallationPage.js +3 -154
- package/dist/node/components/docs/getting-started/StartHerePage.js +2 -129
- package/dist/node/components/docs/getting-started/TroubleshootingPage.js +2 -168
- package/dist/node/components/docs/getting-started/VSCodeExtensionPage.js +1 -432
- package/dist/node/components/docs/getting-started/getting-started.docblocks.js +4 -41
- package/dist/node/components/docs/getting-started/index.js +18 -1869
- package/dist/node/components/docs/guides/GuideCIDiffGatingPage.js +2 -196
- package/dist/node/components/docs/guides/GuideConnectInRepoPage.js +43 -0
- package/dist/node/components/docs/guides/GuideContractTypesPage.js +6 -541
- package/dist/node/components/docs/guides/GuideDocsPipelinePage.js +3 -207
- package/dist/node/components/docs/guides/GuideFirstModuleBundlePage.js +75 -0
- package/dist/node/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -209
- package/dist/node/components/docs/guides/GuideHostBuilderWorkbenchPage.js +69 -0
- package/dist/node/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -754
- package/dist/node/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -268
- package/dist/node/components/docs/guides/GuideSpecValidationTypingPage.js +4 -196
- package/dist/node/components/docs/guides/GuidesIndexPage.js +2 -169
- package/dist/node/components/docs/guides/guides.docblocks.js +11 -75
- package/dist/node/components/docs/guides/index.js +213 -2428
- package/dist/node/components/docs/index.js +542 -24297
- package/dist/node/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -42
- package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -105
- package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +3 -142
- package/dist/node/components/docs/integrations/IntegrationsGmailPage.js +3 -109
- package/dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -79
- package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +3 -146
- package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +5 -150
- package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +5 -140
- package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +1 -160
- package/dist/node/components/docs/integrations/IntegrationsPostmarkPage.js +4 -218
- package/dist/node/components/docs/integrations/IntegrationsPowensPage.js +4 -300
- package/dist/node/components/docs/integrations/IntegrationsQdrantPage.js +5 -111
- package/dist/node/components/docs/integrations/IntegrationsResendPage.js +3 -102
- package/dist/node/components/docs/integrations/IntegrationsS3Page.js +4 -124
- package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +3 -144
- package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +7 -290
- package/dist/node/components/docs/integrations/IntegrationsStripePage.js +6 -327
- package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +3 -128
- package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -146
- package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -156
- package/dist/node/components/docs/integrations/index.js +52 -3100
- package/dist/node/components/docs/intent/ContractFirstApiPage.js +2 -126
- package/dist/node/components/docs/intent/DeterministicCodegenPage.js +2 -148
- package/dist/node/components/docs/intent/GenerateClientFromSchemaPage.js +7 -207
- package/dist/node/components/docs/intent/OpenapiAlternativePage.js +3 -201
- package/dist/node/components/docs/intent/SchemaValidationTypescriptPage.js +4 -144
- package/dist/node/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -126
- package/dist/node/components/docs/intent/index.js +15 -1135
- package/dist/node/components/docs/intent/intent-pages.docblocks.js +1 -201
- package/dist/node/components/docs/knowledge/KnowledgeCategoriesPage.js +6 -750
- package/dist/node/components/docs/knowledge/KnowledgeExamplesPage.js +4 -175
- package/dist/node/components/docs/knowledge/KnowledgeOverviewPage.js +1 -116
- package/dist/node/components/docs/knowledge/KnowledgeSourcesPage.js +8 -391
- package/dist/node/components/docs/knowledge/KnowledgeSpacesPage.js +6 -302
- package/dist/node/components/docs/knowledge/index.js +21 -1730
- package/dist/node/components/docs/libraries/LibrariesAccessibilityPage.js +3 -198
- package/dist/node/components/docs/libraries/LibrariesAiAgentPage.js +3 -141
- package/dist/node/components/docs/libraries/LibrariesAnalyticsPage.js +4 -80
- package/dist/node/components/docs/libraries/LibrariesContentGenPage.js +2 -100
- package/dist/node/components/docs/libraries/LibrariesContractsPage.js +2 -284
- package/dist/node/components/docs/libraries/LibrariesCostTrackingPage.js +3 -112
- package/dist/node/components/docs/libraries/LibrariesDataBackendPage.js +2 -166
- package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +3 -186
- package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +4 -279
- package/dist/node/components/docs/libraries/LibrariesEvolutionPage.js +4 -127
- package/dist/node/components/docs/libraries/LibrariesGraphQLPage.js +2 -173
- package/dist/node/components/docs/libraries/LibrariesGrowthPage.js +3 -88
- package/dist/node/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -108
- package/dist/node/components/docs/libraries/LibrariesObservabilityPage.js +5 -130
- package/dist/node/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -110
- package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -170
- package/dist/node/components/docs/libraries/LibrariesPersonalizationPage.js +4 -114
- package/dist/node/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -132
- package/dist/node/components/docs/libraries/LibrariesResiliencePage.js +4 -120
- package/dist/node/components/docs/libraries/LibrariesRuntimePage.js +2 -200
- package/dist/node/components/docs/libraries/LibrariesSLOPage.js +3 -116
- package/dist/node/components/docs/libraries/LibrariesSchemaPage.js +3 -273
- package/dist/node/components/docs/libraries/LibrariesSupportBotPage.js +3 -134
- package/dist/node/components/docs/libraries/LibrariesTestingPage.js +3 -133
- package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +2 -230
- package/dist/node/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -88
- package/dist/node/components/docs/libraries/LibrariesWorkflowsPage.js +2 -181
- package/dist/node/components/docs/libraries/index.js +54 -4147
- package/dist/node/components/docs/manifesto/ManifestoPage.js +1 -86
- package/dist/node/components/docs/ops/AutoEvolutionOpsPage.js +2 -132
- package/dist/node/components/docs/ops/DistributedTracingOpsPage.js +2 -71
- package/dist/node/components/docs/ops/index.js +3 -202
- package/dist/node/components/docs/ops/ops-lifecycle.docblocks.js +3 -38
- package/dist/node/components/docs/ops/ops-runbooks-a.docblocks.js +3 -94
- package/dist/node/components/docs/ops/ops-runbooks-b.docblocks.js +3 -76
- package/dist/node/components/docs/ops/ops-slo-tenant.docblocks.js +3 -76
- package/dist/node/components/docs/ops/ops-top.docs.js +2 -17
- package/dist/node/components/docs/ops/ops.docs.js +10 -302
- package/dist/node/components/docs/product/product.docblocks.js +5 -72
- package/dist/node/components/docs/reference/DocsMarkdownContent.js +2 -196
- package/dist/node/components/docs/reference/DocsReferenceContent.js +3 -256
- package/dist/node/components/docs/reference/DocsReferenceIndexClient.js +2 -127
- package/dist/node/components/docs/reference/DocsReferenceIndexPage.js +2 -206
- package/dist/node/components/docs/reference/DocsReferencePage.js +3 -265
- package/dist/node/components/docs/reference/docsMarkdownParser.js +2 -92
- package/dist/node/components/docs/reference/index.js +4 -470
- package/dist/node/components/docs/safety/SafetyAuditingPage.js +2 -350
- package/dist/node/components/docs/safety/SafetyMigrationsPage.js +2 -359
- package/dist/node/components/docs/safety/SafetyOverviewPage.js +1 -101
- package/dist/node/components/docs/safety/SafetyPDPPage.js +2 -301
- package/dist/node/components/docs/safety/SafetySecurityTrustPage.js +1 -206
- package/dist/node/components/docs/safety/SafetySigningPage.js +3 -90
- package/dist/node/components/docs/safety/SafetyTenantIsolationPage.js +2 -79
- package/dist/node/components/docs/safety/index.js +7 -1480
- package/dist/node/components/docs/shared/StudioPrompt.js +1 -31
- package/dist/node/components/docs/specs/SpecsBuilderControlPlanePage.js +33 -0
- package/dist/node/components/docs/specs/SpecsCapabilitiesPage.js +2 -158
- package/dist/node/components/docs/specs/SpecsConnectPage.js +7 -0
- package/dist/node/components/docs/specs/SpecsDataViewsPage.js +2 -260
- package/dist/node/components/docs/specs/SpecsModuleBundlesPage.js +66 -0
- package/dist/node/components/docs/specs/SpecsOverlaysPage.js +2 -372
- package/dist/node/components/docs/specs/SpecsOverviewPage.js +1 -186
- package/dist/node/components/docs/specs/SpecsPolicyPage.js +3 -420
- package/dist/node/components/docs/specs/SpecsWorkflowsPage.js +2 -312
- package/dist/node/components/docs/specs/index.js +109 -1702
- package/dist/node/components/docs/studio/StudioBYOKPage.js +1 -26
- package/dist/node/components/docs/studio/StudioDeploymentsPage.js +1 -26
- package/dist/node/components/docs/studio/StudioGettingStartedPage.js +1 -26
- package/dist/node/components/docs/studio/StudioIntegrationsPage.js +1 -26
- package/dist/node/components/docs/studio/StudioOverviewPage.js +1 -157
- package/dist/node/components/docs/studio/StudioVisualBuilderPage.js +1 -26
- package/dist/node/components/docs/studio/index.js +1 -282
- package/dist/node/components/docs/tech/contracts/tech-docs.docblocks.js +2 -19
- package/dist/node/components/integrations/index.js +2 -600
- package/dist/node/components/integrations/molecules/IntegrationCard.js +1 -100
- package/dist/node/components/integrations/organisms/IntegrationMarketplace.js +1 -214
- package/dist/node/components/integrations/organisms/IntegrationSettings.js +2 -284
- package/dist/node/components/integrations/organisms/KnowledgeSourceList.js +1 -103
- package/dist/node/components/legal/PrivacyTemplate.js +1 -1025
- package/dist/node/components/legal/TermsTemplate.js +1 -941
- package/dist/node/components/legal/index.js +1 -1963
- package/dist/node/components/shared/FeatureGateNotice.js +1 -38
- package/dist/node/components/shared/index.js +1 -38
- package/dist/node/components/shell/WorkspaceHeader.js +1 -100
- package/dist/node/components/shell/WorkspaceProjectShellLayout.js +1 -222
- package/dist/node/components/shell/WorkspaceShellRenderer.js +1 -228
- package/dist/node/components/shell/WorkspaceSidebar.js +1 -68
- package/dist/node/components/shell/index.js +1 -287
- package/dist/node/components/templates/engine/index.js +1 -39
- package/dist/node/components/templates/index.js +11 -965
- package/dist/node/components/templates/messaging/ConversationList.js +2 -83
- package/dist/node/components/templates/messaging/MessageComposer.js +4 -150
- package/dist/node/components/templates/messaging/MessageThread.js +3 -83
- package/dist/node/components/templates/messaging/MessagingWorkspace.js +5 -265
- package/dist/node/components/templates/messaging/index.js +5 -269
- package/dist/node/components/templates/recipes/LanguageSwitcher.js +1 -16
- package/dist/node/components/templates/recipes/RecipeCard.js +1 -80
- package/dist/node/components/templates/recipes/RecipeDetail.js +1 -74
- package/dist/node/components/templates/recipes/RecipeList.js +3 -245
- package/dist/node/components/templates/recipes/index.js +3 -248
- package/dist/node/components/templates/todos/FilterBar.js +1 -107
- package/dist/node/components/templates/todos/TaskForm.js +2 -158
- package/dist/node/components/templates/todos/TaskItem.js +1 -77
- package/dist/node/components/templates/todos/TaskList.js +5 -449
- package/dist/node/components/templates/todos/index.js +5 -452
- package/dist/node/config/contractspec-blueprint.js +1 -123
- package/dist/node/config/contractspec-branding.js +1 -44
- package/dist/node/config/contractspec-routes.js +1 -24
- package/dist/node/config/index.js +1 -126
- package/dist/node/features/contracts-registry.js +1 -178
- package/dist/node/features/docs/docs.contracts.js +1 -17
- package/dist/node/features/docs/index.js +1 -17
- package/dist/node/features/docs.feature.js +1 -33
- package/dist/node/features/index.js +1 -315
- package/dist/node/features/mcp.feature.js +1 -30
- package/dist/node/features/presentations.feature.js +1 -33
- package/dist/node/features/registry.js +1 -116
- package/dist/node/index.js +556 -28580
- package/dist/node/infrastructure/elysia/index.js +1 -35
- package/dist/node/infrastructure/elysia/logger.js +1 -35
- package/dist/node/infrastructure/index.js +1 -35
- package/dist/node/libs/email/client.js +1 -114
- package/dist/node/libs/email/contact.js +12 -165
- package/dist/node/libs/email/newsletter.js +6 -167
- package/dist/node/libs/email/types.js +0 -2
- package/dist/node/libs/email/utils.js +2 -8
- package/dist/node/libs/email/waitlist-application.js +28 -209
- package/dist/node/libs/email/waitlist.js +6 -167
- package/dist/node/libs/email.js +46 -363
- package/dist/node/libs/posthog/client.js +1 -63
- package/dist/node/libs/posthog/native.js +1 -23
- package/dist/node/libs/posthog/server.js +1 -13
- package/dist/node/libs/pricing-examples.js +1 -18
- package/dist/node/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -97
- package/dist/node/presentation/features/atoms/FeatureIcon/index.js +1 -97
- package/dist/node/presentation/features/atoms/index.js +1 -97
- package/dist/node/presentation/features/hooks/index.js +1 -397
- package/dist/node/presentation/features/hooks/useContractsRegistry.js +1 -289
- package/dist/node/presentation/features/hooks/useFeatureFilters.js +1 -75
- package/dist/node/presentation/features/hooks/useFeatureRegistry.js +1 -147
- package/dist/node/presentation/features/hooks/useRelatedDocs.js +1 -28
- package/dist/node/presentation/features/index.js +1 -3063
- package/dist/node/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -366
- package/dist/node/presentation/features/molecules/FeatureCard/index.js +1 -366
- package/dist/node/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -50
- package/dist/node/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -50
- package/dist/node/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -92
- package/dist/node/presentation/features/molecules/FeatureFilters/index.js +1 -92
- package/dist/node/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -176
- package/dist/node/presentation/features/molecules/FeatureHoverPreview/index.js +1 -176
- package/dist/node/presentation/features/molecules/index.js +1 -505
- package/dist/node/presentation/features/organisms/FeatureDataViewsList.js +1 -304
- package/dist/node/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -154
- package/dist/node/presentation/features/organisms/FeatureDetail/index.js +1 -154
- package/dist/node/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -909
- package/dist/node/presentation/features/organisms/FeatureDiscovery/index.js +1 -909
- package/dist/node/presentation/features/organisms/FeatureEventsList.js +1 -302
- package/dist/node/presentation/features/organisms/FeatureFormsList.js +1 -302
- package/dist/node/presentation/features/organisms/FeatureOperationsList.js +1 -180
- package/dist/node/presentation/features/organisms/FeaturePresentationsList.js +1 -304
- package/dist/node/presentation/features/organisms/index.js +1 -1359
- package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -332
- package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -332
- package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -342
- package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -342
- package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -303
- package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -303
- package/dist/node/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -340
- package/dist/node/presentation/features/templates/FeatureEventsTemplate/index.js +1 -340
- package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -329
- package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -329
- package/dist/node/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -340
- package/dist/node/presentation/features/templates/FeatureFormsTemplate/index.js +1 -340
- package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -302
- package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -302
- package/dist/node/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -218
- package/dist/node/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -218
- package/dist/node/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -187
- package/dist/node/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -187
- package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -306
- package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -306
- package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -342
- package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -342
- package/dist/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -97
- package/dist/presentation/features/atoms/FeatureIcon/index.js +1 -97
- package/dist/presentation/features/atoms/index.js +1 -97
- package/dist/presentation/features/hooks/index.js +1 -397
- package/dist/presentation/features/hooks/useContractsRegistry.js +1 -289
- package/dist/presentation/features/hooks/useFeatureFilters.js +1 -75
- package/dist/presentation/features/hooks/useFeatureRegistry.js +1 -147
- package/dist/presentation/features/hooks/useRelatedDocs.js +1 -28
- package/dist/presentation/features/index.js +1 -3063
- package/dist/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -366
- package/dist/presentation/features/molecules/FeatureCard/index.js +1 -366
- package/dist/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -50
- package/dist/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -50
- package/dist/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -92
- package/dist/presentation/features/molecules/FeatureFilters/index.js +1 -92
- package/dist/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -176
- package/dist/presentation/features/molecules/FeatureHoverPreview/index.js +1 -176
- package/dist/presentation/features/molecules/index.js +1 -505
- package/dist/presentation/features/organisms/FeatureDataViewsList.js +1 -304
- package/dist/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -154
- package/dist/presentation/features/organisms/FeatureDetail/index.js +1 -154
- package/dist/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -909
- package/dist/presentation/features/organisms/FeatureDiscovery/index.js +1 -909
- package/dist/presentation/features/organisms/FeatureEventsList.js +1 -302
- package/dist/presentation/features/organisms/FeatureFormsList.js +1 -302
- package/dist/presentation/features/organisms/FeatureOperationsList.js +1 -180
- package/dist/presentation/features/organisms/FeaturePresentationsList.js +1 -304
- package/dist/presentation/features/organisms/index.js +1 -1359
- package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -332
- package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -332
- package/dist/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -342
- package/dist/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -342
- package/dist/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -303
- package/dist/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -303
- package/dist/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -340
- package/dist/presentation/features/templates/FeatureEventsTemplate/index.js +1 -340
- package/dist/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -329
- package/dist/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -329
- package/dist/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -340
- package/dist/presentation/features/templates/FeatureFormsTemplate/index.js +1 -340
- package/dist/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -302
- package/dist/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -302
- package/dist/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -218
- package/dist/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -218
- package/dist/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -187
- package/dist/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -187
- package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -306
- package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -306
- package/dist/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -342
- package/dist/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -342
- package/package.json +109 -37
- package/src/components/docs/DocsIndexPage.tsx +55 -0
- package/src/components/docs/architecture/ArchitectureControlPlanePage.tsx +19 -0
- package/src/components/docs/architecture/ArchitectureOverviewPage.tsx +34 -0
- package/src/components/docs/docsManifest.test.ts +70 -0
- package/src/components/docs/docsManifest.ts +71 -1
- package/src/components/docs/ecosystem/PluginsPage.tsx +24 -10
- package/src/components/docs/ecosystem/RegistryPage.tsx +11 -6
- package/src/components/docs/generated/docs-index._common.json +206 -273
- package/src/components/docs/generated/docs-index.control-plane.json +18 -0
- package/src/components/docs/generated/docs-index.defineExample.json +10 -0
- package/src/components/docs/generated/docs-index.manifest.json +22 -12
- package/src/components/docs/generated/docs-index.platform-acp.json +64 -0
- package/src/components/docs/generated/docs-index.platform-agent.json +89 -1
- package/src/components/docs/generated/docs-index.platform-context.json +48 -0
- package/src/components/docs/generated/docs-index.platform-control-plane.json +72 -0
- package/src/components/docs/generated/docs-index.platform-database.json +40 -0
- package/src/components/docs/generated/docs-index.platform-docs.json +64 -0
- package/src/components/docs/generated/docs-index.platform-provider-ranking.json +89 -1
- package/src/components/docs/generated/docs-index.pocket-family-office.json +8 -0
- package/src/components/docs/generated/docs-index.unknown.json +8 -0
- package/src/components/docs/guides/GuideConnectInRepoPage.tsx +184 -0
- package/src/components/docs/guides/GuideFirstModuleBundlePage.tsx +182 -0
- package/src/components/docs/guides/GuideHostBuilderWorkbenchPage.tsx +230 -0
- package/src/components/docs/guides/GuidesIndexPage.tsx +21 -0
- package/src/components/docs/guides/index.ts +3 -0
- package/src/components/docs/specs/SpecsBuilderControlPlanePage.tsx +210 -0
- package/src/components/docs/specs/SpecsConnectPage.tsx +162 -0
- package/src/components/docs/specs/SpecsModuleBundlesPage.tsx +223 -0
- package/src/components/docs/specs/SpecsOverlaysPage.tsx +20 -0
- package/src/components/docs/specs/SpecsOverviewPage.tsx +44 -0
- package/src/components/docs/specs/SpecsWorkflowsPage.tsx +9 -1
- package/src/components/docs/specs/index.ts +3 -0
- package/src/components/docs/studio/StudioOverviewPage.tsx +26 -0
- package/src/infrastructure/elysia/logger.ts +11 -3
|
@@ -1,457 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
3
|
-
var createAppLogger = () => new Logger({
|
|
4
|
-
level: LogLevel.INFO,
|
|
5
|
-
environment: "production",
|
|
6
|
-
enableTracing: true,
|
|
7
|
-
enableTiming: true,
|
|
8
|
-
enableContext: true,
|
|
9
|
-
enableColors: false
|
|
10
|
-
});
|
|
11
|
-
var appLogger = createAppLogger();
|
|
12
|
-
var dbLogger = new Logger({
|
|
13
|
-
level: LogLevel.WARN,
|
|
14
|
-
environment: "production",
|
|
15
|
-
enableTracing: true,
|
|
16
|
-
enableTiming: true,
|
|
17
|
-
enableContext: true,
|
|
18
|
-
enableColors: false
|
|
19
|
-
});
|
|
20
|
-
var authLogger = new Logger({
|
|
21
|
-
level: LogLevel.INFO,
|
|
22
|
-
environment: "production",
|
|
23
|
-
enableTracing: true,
|
|
24
|
-
enableTiming: true,
|
|
25
|
-
enableContext: true,
|
|
26
|
-
enableColors: false
|
|
27
|
-
});
|
|
28
|
-
// src/application/mcp/normalizeMcpRequest.ts
|
|
29
|
-
var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
|
|
30
|
-
function canNormalizeAcceptHeader(acceptHeader) {
|
|
31
|
-
return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
|
|
32
|
-
}
|
|
33
|
-
function normalizeMcpRequest(request) {
|
|
34
|
-
if (request.method !== "POST")
|
|
35
|
-
return request;
|
|
36
|
-
const acceptHeader = request.headers.get("accept");
|
|
37
|
-
if (!canNormalizeAcceptHeader(acceptHeader))
|
|
38
|
-
return request;
|
|
39
|
-
const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
|
|
40
|
-
if (missingTypes.length === 0)
|
|
41
|
-
return request;
|
|
42
|
-
const headers = new Headers(request.headers);
|
|
43
|
-
headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
|
|
44
|
-
return new Request(request, { headers });
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// src/application/mcp/common.ts
|
|
48
|
-
import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
|
|
49
|
-
import { PresentationRegistry } from "@contractspec/lib.contracts-spec/presentations";
|
|
50
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
51
|
-
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
52
|
-
import { randomUUID } from "crypto";
|
|
53
|
-
import { Elysia } from "elysia";
|
|
54
|
-
var baseCtx = {
|
|
55
|
-
actor: "anonymous",
|
|
56
|
-
decide: async () => ({ effect: "allow" })
|
|
57
|
-
};
|
|
58
|
-
function createJsonRpcErrorResponse(status, code, message, data) {
|
|
59
|
-
return new Response(JSON.stringify({
|
|
60
|
-
jsonrpc: "2.0",
|
|
61
|
-
error: {
|
|
62
|
-
code,
|
|
63
|
-
message,
|
|
64
|
-
...data ? { data } : {}
|
|
65
|
-
},
|
|
66
|
-
id: null
|
|
67
|
-
}), {
|
|
68
|
-
status,
|
|
69
|
-
headers: {
|
|
70
|
-
"content-type": "application/json"
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function createSessionState({
|
|
75
|
-
logger,
|
|
76
|
-
serverName,
|
|
77
|
-
ops,
|
|
78
|
-
resources,
|
|
79
|
-
prompts,
|
|
80
|
-
presentations,
|
|
81
|
-
stateful
|
|
82
|
-
}) {
|
|
83
|
-
const server = new McpServer({
|
|
84
|
-
name: serverName,
|
|
85
|
-
version: "1.0.0"
|
|
86
|
-
}, {
|
|
87
|
-
capabilities: {
|
|
88
|
-
tools: {},
|
|
89
|
-
resources: {},
|
|
90
|
-
prompts: {},
|
|
91
|
-
logging: {}
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
logger.info("Setting up MCP server...");
|
|
95
|
-
createMcpServer(server, ops, resources, prompts, {
|
|
96
|
-
logger,
|
|
97
|
-
toolCtx: () => baseCtx,
|
|
98
|
-
promptCtx: () => ({ locale: "en" }),
|
|
99
|
-
resourceCtx: () => ({ locale: "en" }),
|
|
100
|
-
presentations: new PresentationRegistry(presentations)
|
|
101
|
-
});
|
|
102
|
-
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
103
|
-
sessionIdGenerator: stateful ? () => randomUUID() : undefined,
|
|
104
|
-
enableJsonResponse: true
|
|
105
|
-
});
|
|
106
|
-
return server.connect(transport).then(() => ({ server, transport }));
|
|
107
|
-
}
|
|
108
|
-
async function closeSessionState(state) {
|
|
109
|
-
await Promise.allSettled([state.transport.close(), state.server.close()]);
|
|
110
|
-
}
|
|
111
|
-
function toErrorMessage(error) {
|
|
112
|
-
return error instanceof Error ? error.stack ?? error.message : String(error);
|
|
113
|
-
}
|
|
114
|
-
function createMcpElysiaHandler({
|
|
115
|
-
logger,
|
|
116
|
-
path,
|
|
117
|
-
serverName,
|
|
118
|
-
ops,
|
|
119
|
-
resources,
|
|
120
|
-
prompts,
|
|
121
|
-
presentations,
|
|
122
|
-
validateAuth,
|
|
123
|
-
requiredAuthMethods
|
|
124
|
-
}) {
|
|
125
|
-
logger.info("Setting up MCP handler...", {
|
|
126
|
-
requiredAuthMethods: requiredAuthMethods ?? []
|
|
127
|
-
});
|
|
128
|
-
const isStateful = process.env.CONTRACTSPEC_MCP_STATEFUL === "1";
|
|
129
|
-
const sessions = new Map;
|
|
130
|
-
async function handleStateless(request) {
|
|
131
|
-
const state = await createSessionState({
|
|
132
|
-
logger,
|
|
133
|
-
path,
|
|
134
|
-
serverName,
|
|
135
|
-
ops,
|
|
136
|
-
resources,
|
|
137
|
-
prompts,
|
|
138
|
-
presentations,
|
|
139
|
-
stateful: false
|
|
140
|
-
});
|
|
141
|
-
try {
|
|
142
|
-
return await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
143
|
-
} finally {
|
|
144
|
-
await closeSessionState(state);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
async function closeSession(sessionId) {
|
|
148
|
-
const state = sessions.get(sessionId);
|
|
149
|
-
if (!state)
|
|
150
|
-
return;
|
|
151
|
-
sessions.delete(sessionId);
|
|
152
|
-
await closeSessionState(state);
|
|
153
|
-
}
|
|
154
|
-
async function handleStateful(request) {
|
|
155
|
-
const requestedSessionId = request.headers.get("mcp-session-id");
|
|
156
|
-
let state;
|
|
157
|
-
let createdState = false;
|
|
158
|
-
if (requestedSessionId) {
|
|
159
|
-
const existing = sessions.get(requestedSessionId);
|
|
160
|
-
if (!existing) {
|
|
161
|
-
return createJsonRpcErrorResponse(404, -32001, "Session not found");
|
|
162
|
-
}
|
|
163
|
-
state = existing;
|
|
164
|
-
} else {
|
|
165
|
-
state = await createSessionState({
|
|
166
|
-
logger,
|
|
167
|
-
path,
|
|
168
|
-
serverName,
|
|
169
|
-
ops,
|
|
170
|
-
resources,
|
|
171
|
-
prompts,
|
|
172
|
-
presentations,
|
|
173
|
-
stateful: true
|
|
174
|
-
});
|
|
175
|
-
createdState = true;
|
|
176
|
-
}
|
|
177
|
-
try {
|
|
178
|
-
const response = await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
179
|
-
const activeSessionId = state.transport.sessionId;
|
|
180
|
-
if (activeSessionId && !sessions.has(activeSessionId)) {
|
|
181
|
-
sessions.set(activeSessionId, state);
|
|
182
|
-
}
|
|
183
|
-
if (request.method === "DELETE" && activeSessionId) {
|
|
184
|
-
await closeSession(activeSessionId);
|
|
185
|
-
} else if (!activeSessionId && createdState) {
|
|
186
|
-
await closeSessionState(state);
|
|
187
|
-
}
|
|
188
|
-
return response;
|
|
189
|
-
} catch (error) {
|
|
190
|
-
if (createdState) {
|
|
191
|
-
await closeSessionState(state);
|
|
192
|
-
}
|
|
193
|
-
throw error;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return new Elysia({ name: `mcp-${serverName}` }).all(path, async ({ request }) => {
|
|
197
|
-
try {
|
|
198
|
-
if (validateAuth) {
|
|
199
|
-
const authResult = await validateAuth(request);
|
|
200
|
-
if (!authResult.valid) {
|
|
201
|
-
return createJsonRpcErrorResponse(401, -32002, "Authentication failed", authResult.reason);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (isStateful) {
|
|
205
|
-
return await handleStateful(request);
|
|
206
|
-
}
|
|
207
|
-
return await handleStateless(request);
|
|
208
|
-
} catch (error) {
|
|
209
|
-
logger.error("Error handling MCP request", {
|
|
210
|
-
path,
|
|
211
|
-
method: request.method,
|
|
212
|
-
error: toErrorMessage(error)
|
|
213
|
-
});
|
|
214
|
-
return createJsonRpcErrorResponse(500, -32000, "Internal error");
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// src/application/mcp/cliMcp.ts
|
|
220
|
-
import fs from "node:fs/promises";
|
|
221
|
-
import {
|
|
222
|
-
defineCommand,
|
|
223
|
-
definePrompt,
|
|
224
|
-
defineResourceTemplate,
|
|
225
|
-
installOp,
|
|
226
|
-
OperationSpecRegistry,
|
|
227
|
-
PromptRegistry,
|
|
228
|
-
ResourceRegistry
|
|
229
|
-
} from "@contractspec/lib.contracts-spec";
|
|
230
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
231
|
-
import path from "path";
|
|
232
|
-
import z from "zod";
|
|
233
|
-
var __dirname = "/home/runner/work/contractspec/contractspec/packages/bundles/library/src/application/mcp";
|
|
234
|
-
var CLI_DOC_PATHS = {
|
|
235
|
-
quickstart: "packages/apps/cli-contractspec/QUICK_START.md",
|
|
236
|
-
reference: "packages/apps/cli-contractspec/QUICK_REFERENCE.md",
|
|
237
|
-
readme: "packages/apps/cli-contractspec/README.md"
|
|
238
|
-
};
|
|
239
|
-
var CLI_DOC_FALLBACK = {
|
|
240
|
-
quickstart: `# ContractSpec CLI quickstart
|
|
1
|
+
import{Logger as E,LogLevel as b}from"@contractspec/lib.logger";function f(){return"production"}var v=()=>new E({level:b.INFO,environment:f(),enableTracing:!0,enableTiming:!0,enableContext:!0,enableColors:!1}),N=v(),$j=new E({level:b.WARN,environment:f(),enableTracing:!0,enableTiming:!0,enableContext:!0,enableColors:!1}),xj=new E({level:b.INFO,environment:f(),enableTracing:!0,enableTiming:!0,enableContext:!0,enableColors:!1});var _=["application/json","text/event-stream"];function S(j){return!j||j.includes("*/*")||j.includes("application/*")||_.some((Q)=>j.includes(Q))}function O(j){if(j.method!=="POST")return j;let Q=j.headers.get("accept");if(!S(Q))return j;let U=_.filter((X)=>!Q?.includes(X));if(U.length===0)return j;let Y=new Headers(j.headers);return Y.set("accept",[Q,...U].filter(Boolean).join(", ")),new Request(j,{headers:Y})}import{createMcpServer as c}from"@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";import{PresentationRegistry as n}from"@contractspec/lib.contracts-spec/presentations";import{McpServer as d}from"@modelcontextprotocol/sdk/server/mcp.js";import{WebStandardStreamableHTTPServerTransport as i}from"@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";import{randomUUID as u}from"crypto";import{Elysia as p}from"elysia";var g={actor:"anonymous",decide:async()=>({effect:"allow"})};function T(j,Q,U,Y){return new Response(JSON.stringify({jsonrpc:"2.0",error:{code:Q,message:U,...Y?{data:Y}:{}},id:null}),{status:j,headers:{"content-type":"application/json"}})}function k({logger:j,serverName:Q,ops:U,resources:Y,prompts:X,presentations:Z,stateful:V}){let x=new d({name:Q,version:"1.0.0"},{capabilities:{tools:{},resources:{},prompts:{},logging:{}}});j.info("Setting up MCP server..."),c(x,U,Y,X,{logger:j,toolCtx:()=>g,promptCtx:()=>({locale:"en"}),resourceCtx:()=>({locale:"en"}),presentations:new n(Z)});let G=new i({sessionIdGenerator:V?()=>u():void 0,enableJsonResponse:!0});return x.connect(G).then(()=>({server:x,transport:G}))}async function w(j){await Promise.allSettled([j.transport.close(),j.server.close()])}function l(j){return j instanceof Error?j.stack??j.message:String(j)}function A({logger:j,path:Q,serverName:U,ops:Y,resources:X,prompts:Z,presentations:V,validateAuth:x,requiredAuthMethods:G}){j.info("Setting up MCP handler...",{requiredAuthMethods:G??[]});let C=process.env.CONTRACTSPEC_MCP_STATEFUL==="1",H=new Map;async function L(B){let J=await k({logger:j,path:Q,serverName:U,ops:Y,resources:X,prompts:Z,presentations:V,stateful:!1});try{return await J.transport.handleRequest(O(B))}finally{await w(J)}}async function h(B){let J=H.get(B);if(!J)return;H.delete(B),await w(J)}async function m(B){let J=B.headers.get("mcp-session-id"),$,R=!1;if(J){let F=H.get(J);if(!F)return T(404,-32001,"Session not found");$=F}else $=await k({logger:j,path:Q,serverName:U,ops:Y,resources:X,prompts:Z,presentations:V,stateful:!0}),R=!0;try{let F=await $.transport.handleRequest(O(B)),K=$.transport.sessionId;if(K&&!H.has(K))H.set(K,$);if(B.method==="DELETE"&&K)await h(K);else if(!K&&R)await w($);return F}catch(F){if(R)await w($);throw F}}return new p({name:`mcp-${U}`}).all(Q,async({request:B})=>{try{if(x){let J=await x(B);if(!J.valid)return T(401,-32002,"Authentication failed",J.reason)}if(C)return await m(B);return await L(B)}catch(J){return j.error("Error handling MCP request",{path:Q,method:B.method,error:l(J)}),T(500,-32000,"Internal error")}})}import o from"node:fs/promises";import{defineCommand as a,definePrompt as t,defineResourceTemplate as I,installOp as r,OperationSpecRegistry as s,PromptRegistry as e,ResourceRegistry as jj}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as q,ScalarTypeEnum as W}from"@contractspec/lib.schema";import z from"path";import P from"zod";var __dirname="/home/runner/work/contractspec/contractspec/packages/bundles/library/src/application/mcp",Qj={quickstart:"packages/apps/cli-contractspec/QUICK_START.md",reference:"packages/apps/cli-contractspec/QUICK_REFERENCE.md",readme:"packages/apps/cli-contractspec/README.md"},Uj={quickstart:`# ContractSpec CLI quickstart
|
|
241
2
|
|
|
242
3
|
contractspec create
|
|
243
4
|
contractspec build <spec>
|
|
244
|
-
contractspec validate <spec>`,
|
|
245
|
-
reference: `# ContractSpec CLI reference
|
|
5
|
+
contractspec validate <spec>`,reference:`# ContractSpec CLI reference
|
|
246
6
|
|
|
247
|
-
Key commands: create, build, validate. See README for full options.`,
|
|
248
|
-
readme: `# ContractSpec CLI
|
|
7
|
+
Key commands: create, build, validate. See README for full options.`,readme:`# ContractSpec CLI
|
|
249
8
|
|
|
250
|
-
Stabilize AI-generated code across API, DB, UI, events. Use create/build/validate commands.`
|
|
251
|
-
};
|
|
252
|
-
var CLI_DOC_TAGS = ["cli", "mcp"];
|
|
253
|
-
var CLI_OWNERS = ["@contractspec"];
|
|
254
|
-
var candidateRoots = (() => {
|
|
255
|
-
const roots = new Set([
|
|
256
|
-
process.cwd(),
|
|
257
|
-
path.resolve(process.cwd(), ".."),
|
|
258
|
-
path.resolve(process.cwd(), "../.."),
|
|
259
|
-
path.resolve(process.cwd(), "../../..")
|
|
260
|
-
]);
|
|
261
|
-
if (typeof __dirname === "string") {
|
|
262
|
-
roots.add(path.resolve(__dirname, "../../../../.."));
|
|
263
|
-
}
|
|
264
|
-
return [...roots];
|
|
265
|
-
})();
|
|
266
|
-
var docCache = new Map;
|
|
267
|
-
async function loadCliDoc(key) {
|
|
268
|
-
if (docCache.has(key)) {
|
|
269
|
-
return docCache.get(key);
|
|
270
|
-
}
|
|
271
|
-
const relative = CLI_DOC_PATHS[key];
|
|
272
|
-
for (const root of candidateRoots) {
|
|
273
|
-
const candidate = path.resolve(root, relative);
|
|
274
|
-
try {
|
|
275
|
-
const data = await fs.readFile(candidate, "utf8");
|
|
276
|
-
docCache.set(key, data);
|
|
277
|
-
return data;
|
|
278
|
-
} catch {}
|
|
279
|
-
}
|
|
280
|
-
const fallback = CLI_DOC_FALLBACK[key];
|
|
281
|
-
docCache.set(key, fallback);
|
|
282
|
-
return fallback;
|
|
283
|
-
}
|
|
284
|
-
function buildCliResources() {
|
|
285
|
-
const resources = new ResourceRegistry;
|
|
286
|
-
resources.register(defineResourceTemplate({
|
|
287
|
-
meta: {
|
|
288
|
-
uriTemplate: "cli://doc/{slug}",
|
|
289
|
-
title: "CLI documentation",
|
|
290
|
-
description: "Quickstart, reference, and README for the CLI.",
|
|
291
|
-
mimeType: "text/markdown",
|
|
292
|
-
tags: CLI_DOC_TAGS
|
|
293
|
-
},
|
|
294
|
-
input: z.object({
|
|
295
|
-
slug: z.enum(["quickstart", "reference", "readme"])
|
|
296
|
-
}),
|
|
297
|
-
resolve: async ({ slug }) => {
|
|
298
|
-
const data = await loadCliDoc(slug);
|
|
299
|
-
return {
|
|
300
|
-
uri: `cli://doc/${slug}`,
|
|
301
|
-
mimeType: "text/markdown",
|
|
302
|
-
data
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
}));
|
|
306
|
-
resources.register(defineResourceTemplate({
|
|
307
|
-
meta: {
|
|
308
|
-
uriTemplate: "cli://commands",
|
|
309
|
-
title: "CLI commands summary",
|
|
310
|
-
description: "Key ContractSpec CLI commands and when to use them.",
|
|
311
|
-
mimeType: "application/json",
|
|
312
|
-
tags: CLI_DOC_TAGS
|
|
313
|
-
},
|
|
314
|
-
input: z.object({}),
|
|
315
|
-
resolve: async () => {
|
|
316
|
-
const commands = [
|
|
317
|
-
{
|
|
318
|
-
command: "contractspec create",
|
|
319
|
-
summary: "Interactive wizard to author specs (with optional AI).",
|
|
320
|
-
doc: "cli://doc/quickstart"
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
command: "contractspec build <specPath>",
|
|
324
|
-
summary: "Generate implementation code from a ContractSpec (agents + templates).",
|
|
325
|
-
doc: "cli://doc/reference"
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
command: "contractspec validate <specPath>",
|
|
329
|
-
summary: "Validate specs and optionally check implementations against them.",
|
|
330
|
-
doc: "cli://doc/reference"
|
|
331
|
-
}
|
|
332
|
-
];
|
|
333
|
-
return {
|
|
334
|
-
uri: "cli://commands",
|
|
335
|
-
mimeType: "application/json",
|
|
336
|
-
data: JSON.stringify(commands, null, 2)
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
}));
|
|
340
|
-
return resources;
|
|
341
|
-
}
|
|
342
|
-
function buildCliPrompts() {
|
|
343
|
-
const prompts = new PromptRegistry;
|
|
344
|
-
prompts.register(definePrompt({
|
|
345
|
-
meta: {
|
|
346
|
-
key: "cli.usage",
|
|
347
|
-
version: "1.0.0",
|
|
348
|
-
title: "Use ContractSpec CLI safely",
|
|
349
|
-
description: "Remind agents to read CLI docs and pick commands from the canonical list.",
|
|
350
|
-
tags: CLI_DOC_TAGS,
|
|
351
|
-
stability: "beta",
|
|
352
|
-
owners: CLI_OWNERS
|
|
353
|
-
},
|
|
354
|
-
args: [
|
|
355
|
-
{
|
|
356
|
-
name: "goal",
|
|
357
|
-
description: "Task the user wants to achieve.",
|
|
358
|
-
required: false,
|
|
359
|
-
schema: z.string().optional()
|
|
360
|
-
}
|
|
361
|
-
],
|
|
362
|
-
input: z.object({ goal: z.string().optional() }),
|
|
363
|
-
render: async ({ goal }) => [
|
|
364
|
-
{
|
|
365
|
-
type: "text",
|
|
366
|
-
text: `Use CLI commands only from cli://commands. Prefer quickstart for newcomers and reference for options.${goal ? ` Goal: ${goal}.` : ""}`
|
|
367
|
-
},
|
|
368
|
-
{ type: "resource", uri: "cli://commands", title: "Commands" },
|
|
369
|
-
{
|
|
370
|
-
type: "resource",
|
|
371
|
-
uri: "cli://doc/quickstart",
|
|
372
|
-
title: "Quickstart"
|
|
373
|
-
}
|
|
374
|
-
]
|
|
375
|
-
}));
|
|
376
|
-
return prompts;
|
|
377
|
-
}
|
|
378
|
-
function buildCliOps() {
|
|
379
|
-
const registry = new OperationSpecRegistry;
|
|
380
|
-
const CliSuggestInput = defineSchemaModel({
|
|
381
|
-
name: "CliSuggestInput",
|
|
382
|
-
fields: {
|
|
383
|
-
goal: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
384
|
-
prefersAi: { type: ScalarTypeEnum.Boolean(), isOptional: true }
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
const CliSuggestOutput = defineSchemaModel({
|
|
388
|
-
name: "CliSuggestOutput",
|
|
389
|
-
fields: {
|
|
390
|
-
command: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
391
|
-
docUri: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
392
|
-
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
const suggestSpec = defineCommand({
|
|
396
|
-
meta: {
|
|
397
|
-
key: "cli_suggestCommand",
|
|
398
|
-
version: "1.0.0",
|
|
399
|
-
stability: "stable",
|
|
400
|
-
owners: CLI_OWNERS,
|
|
401
|
-
tags: CLI_DOC_TAGS,
|
|
402
|
-
description: "Recommend a CLI command for the requested goal.",
|
|
403
|
-
goal: "Help AI agents choose the correct CLI entrypoint quickly.",
|
|
404
|
-
context: "Used inside the CLI MCP server."
|
|
405
|
-
},
|
|
406
|
-
io: {
|
|
407
|
-
input: CliSuggestInput,
|
|
408
|
-
output: CliSuggestOutput
|
|
409
|
-
},
|
|
410
|
-
policy: {
|
|
411
|
-
auth: "anonymous"
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
installOp(registry, suggestSpec, async ({ goal, prefersAi }) => {
|
|
415
|
-
const lower = goal.toLowerCase();
|
|
416
|
-
if (lower.includes("create") || lower.includes("new")) {
|
|
417
|
-
return {
|
|
418
|
-
command: prefersAi ? "contractspec create --ai" : "contractspec create",
|
|
419
|
-
docUri: "cli://doc/quickstart",
|
|
420
|
-
reason: "Creates a new ContractSpec interactively (optionally with AI)."
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
if (lower.includes("build") || lower.includes("generate")) {
|
|
424
|
-
return {
|
|
425
|
-
command: "contractspec build <path-to-spec>",
|
|
426
|
-
docUri: "cli://doc/reference",
|
|
427
|
-
reason: "Builds implementation code from a spec using agents + templates."
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
if (lower.includes("validate") || lower.includes("check")) {
|
|
431
|
-
return {
|
|
432
|
-
command: "contractspec validate <path-to-spec>",
|
|
433
|
-
docUri: "cli://doc/reference",
|
|
434
|
-
reason: "Validates a spec and optionally checks its implementation for drift."
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
return {
|
|
438
|
-
command: "contractspec --help",
|
|
439
|
-
docUri: "cli://doc/readme",
|
|
440
|
-
reason: "Fallback when the goal is unclear; read README for options."
|
|
441
|
-
};
|
|
442
|
-
});
|
|
443
|
-
return registry;
|
|
444
|
-
}
|
|
445
|
-
function createCliMcpHandler(path2 = "/api/mcp/cli") {
|
|
446
|
-
return createMcpElysiaHandler({
|
|
447
|
-
logger: appLogger,
|
|
448
|
-
path: path2,
|
|
449
|
-
serverName: "contractspec-cli-mcp",
|
|
450
|
-
ops: buildCliOps(),
|
|
451
|
-
resources: buildCliResources(),
|
|
452
|
-
prompts: buildCliPrompts()
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
export {
|
|
456
|
-
createCliMcpHandler
|
|
457
|
-
};
|
|
9
|
+
Stabilize AI-generated code across API, DB, UI, events. Use create/build/validate commands.`},D=["cli","mcp"],y=["@contractspec"],Yj=(()=>{let j=new Set([process.cwd(),z.resolve(process.cwd(),".."),z.resolve(process.cwd(),"../.."),z.resolve(process.cwd(),"../../..")]);if(typeof __dirname==="string")j.add(z.resolve(__dirname,"../../../../.."));return[...j]})(),M=new Map;async function Bj(j){if(M.has(j))return M.get(j);let Q=Qj[j];for(let Y of Yj){let X=z.resolve(Y,Q);try{let Z=await o.readFile(X,"utf8");return M.set(j,Z),Z}catch{}}let U=Uj[j];return M.set(j,U),U}function Jj(){let j=new jj;return j.register(I({meta:{uriTemplate:"cli://doc/{slug}",title:"CLI documentation",description:"Quickstart, reference, and README for the CLI.",mimeType:"text/markdown",tags:D},input:P.object({slug:P.enum(["quickstart","reference","readme"])}),resolve:async({slug:Q})=>{let U=await Bj(Q);return{uri:`cli://doc/${Q}`,mimeType:"text/markdown",data:U}}})),j.register(I({meta:{uriTemplate:"cli://commands",title:"CLI commands summary",description:"Key ContractSpec CLI commands and when to use them.",mimeType:"application/json",tags:D},input:P.object({}),resolve:async()=>{return{uri:"cli://commands",mimeType:"application/json",data:JSON.stringify([{command:"contractspec create",summary:"Interactive wizard to author specs (with optional AI).",doc:"cli://doc/quickstart"},{command:"contractspec build <specPath>",summary:"Generate implementation code from a ContractSpec (agents + templates).",doc:"cli://doc/reference"},{command:"contractspec validate <specPath>",summary:"Validate specs and optionally check implementations against them.",doc:"cli://doc/reference"}],null,2)}}})),j}function Vj(){let j=new e;return j.register(t({meta:{key:"cli.usage",version:"1.0.0",title:"Use ContractSpec CLI safely",description:"Remind agents to read CLI docs and pick commands from the canonical list.",tags:D,stability:"beta",owners:y},args:[{name:"goal",description:"Task the user wants to achieve.",required:!1,schema:P.string().optional()}],input:P.object({goal:P.string().optional()}),render:async({goal:Q})=>[{type:"text",text:`Use CLI commands only from cli://commands. Prefer quickstart for newcomers and reference for options.${Q?` Goal: ${Q}.`:""}`},{type:"resource",uri:"cli://commands",title:"Commands"},{type:"resource",uri:"cli://doc/quickstart",title:"Quickstart"}]})),j}function Xj(){let j=new s,Q=q({name:"CliSuggestInput",fields:{goal:{type:W.String_unsecure(),isOptional:!1},prefersAi:{type:W.Boolean(),isOptional:!0}}}),U=q({name:"CliSuggestOutput",fields:{command:{type:W.String_unsecure(),isOptional:!1},docUri:{type:W.String_unsecure(),isOptional:!1},reason:{type:W.String_unsecure(),isOptional:!1}}}),Y=a({meta:{key:"cli_suggestCommand",version:"1.0.0",stability:"stable",owners:y,tags:D,description:"Recommend a CLI command for the requested goal.",goal:"Help AI agents choose the correct CLI entrypoint quickly.",context:"Used inside the CLI MCP server."},io:{input:Q,output:U},policy:{auth:"anonymous"}});return r(j,Y,async({goal:X,prefersAi:Z})=>{let V=X.toLowerCase();if(V.includes("create")||V.includes("new"))return{command:Z?"contractspec create --ai":"contractspec create",docUri:"cli://doc/quickstart",reason:"Creates a new ContractSpec interactively (optionally with AI)."};if(V.includes("build")||V.includes("generate"))return{command:"contractspec build <path-to-spec>",docUri:"cli://doc/reference",reason:"Builds implementation code from a spec using agents + templates."};if(V.includes("validate")||V.includes("check"))return{command:"contractspec validate <path-to-spec>",docUri:"cli://doc/reference",reason:"Validates a spec and optionally checks its implementation for drift."};return{command:"contractspec --help",docUri:"cli://doc/readme",reason:"Fallback when the goal is unclear; read README for options."}}),j}function _j(j="/api/mcp/cli"){return A({logger:N,path:j,serverName:"contractspec-cli-mcp",ops:Xj(),resources:Jj(),prompts:Vj()})}export{_j as createCliMcpHandler};
|
|
@@ -1,193 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var REQUIRED_ACCEPT_TYPES = ["application/json", "text/event-stream"];
|
|
3
|
-
function canNormalizeAcceptHeader(acceptHeader) {
|
|
4
|
-
return !acceptHeader || acceptHeader.includes("*/*") || acceptHeader.includes("application/*") || REQUIRED_ACCEPT_TYPES.some((value) => acceptHeader.includes(value));
|
|
5
|
-
}
|
|
6
|
-
function normalizeMcpRequest(request) {
|
|
7
|
-
if (request.method !== "POST")
|
|
8
|
-
return request;
|
|
9
|
-
const acceptHeader = request.headers.get("accept");
|
|
10
|
-
if (!canNormalizeAcceptHeader(acceptHeader))
|
|
11
|
-
return request;
|
|
12
|
-
const missingTypes = REQUIRED_ACCEPT_TYPES.filter((value) => !acceptHeader?.includes(value));
|
|
13
|
-
if (missingTypes.length === 0)
|
|
14
|
-
return request;
|
|
15
|
-
const headers = new Headers(request.headers);
|
|
16
|
-
headers.set("accept", [acceptHeader, ...missingTypes].filter(Boolean).join(", "));
|
|
17
|
-
return new Request(request, { headers });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// src/application/mcp/common.ts
|
|
21
|
-
import { createMcpServer } from "@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";
|
|
22
|
-
import { PresentationRegistry } from "@contractspec/lib.contracts-spec/presentations";
|
|
23
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
24
|
-
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
25
|
-
import { randomUUID } from "crypto";
|
|
26
|
-
import { Elysia } from "elysia";
|
|
27
|
-
var baseCtx = {
|
|
28
|
-
actor: "anonymous",
|
|
29
|
-
decide: async () => ({ effect: "allow" })
|
|
30
|
-
};
|
|
31
|
-
function createJsonRpcErrorResponse(status, code, message, data) {
|
|
32
|
-
return new Response(JSON.stringify({
|
|
33
|
-
jsonrpc: "2.0",
|
|
34
|
-
error: {
|
|
35
|
-
code,
|
|
36
|
-
message,
|
|
37
|
-
...data ? { data } : {}
|
|
38
|
-
},
|
|
39
|
-
id: null
|
|
40
|
-
}), {
|
|
41
|
-
status,
|
|
42
|
-
headers: {
|
|
43
|
-
"content-type": "application/json"
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function createSessionState({
|
|
48
|
-
logger,
|
|
49
|
-
serverName,
|
|
50
|
-
ops,
|
|
51
|
-
resources,
|
|
52
|
-
prompts,
|
|
53
|
-
presentations,
|
|
54
|
-
stateful
|
|
55
|
-
}) {
|
|
56
|
-
const server = new McpServer({
|
|
57
|
-
name: serverName,
|
|
58
|
-
version: "1.0.0"
|
|
59
|
-
}, {
|
|
60
|
-
capabilities: {
|
|
61
|
-
tools: {},
|
|
62
|
-
resources: {},
|
|
63
|
-
prompts: {},
|
|
64
|
-
logging: {}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
logger.info("Setting up MCP server...");
|
|
68
|
-
createMcpServer(server, ops, resources, prompts, {
|
|
69
|
-
logger,
|
|
70
|
-
toolCtx: () => baseCtx,
|
|
71
|
-
promptCtx: () => ({ locale: "en" }),
|
|
72
|
-
resourceCtx: () => ({ locale: "en" }),
|
|
73
|
-
presentations: new PresentationRegistry(presentations)
|
|
74
|
-
});
|
|
75
|
-
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
76
|
-
sessionIdGenerator: stateful ? () => randomUUID() : undefined,
|
|
77
|
-
enableJsonResponse: true
|
|
78
|
-
});
|
|
79
|
-
return server.connect(transport).then(() => ({ server, transport }));
|
|
80
|
-
}
|
|
81
|
-
async function closeSessionState(state) {
|
|
82
|
-
await Promise.allSettled([state.transport.close(), state.server.close()]);
|
|
83
|
-
}
|
|
84
|
-
function toErrorMessage(error) {
|
|
85
|
-
return error instanceof Error ? error.stack ?? error.message : String(error);
|
|
86
|
-
}
|
|
87
|
-
function createMcpElysiaHandler({
|
|
88
|
-
logger,
|
|
89
|
-
path,
|
|
90
|
-
serverName,
|
|
91
|
-
ops,
|
|
92
|
-
resources,
|
|
93
|
-
prompts,
|
|
94
|
-
presentations,
|
|
95
|
-
validateAuth,
|
|
96
|
-
requiredAuthMethods
|
|
97
|
-
}) {
|
|
98
|
-
logger.info("Setting up MCP handler...", {
|
|
99
|
-
requiredAuthMethods: requiredAuthMethods ?? []
|
|
100
|
-
});
|
|
101
|
-
const isStateful = process.env.CONTRACTSPEC_MCP_STATEFUL === "1";
|
|
102
|
-
const sessions = new Map;
|
|
103
|
-
async function handleStateless(request) {
|
|
104
|
-
const state = await createSessionState({
|
|
105
|
-
logger,
|
|
106
|
-
path,
|
|
107
|
-
serverName,
|
|
108
|
-
ops,
|
|
109
|
-
resources,
|
|
110
|
-
prompts,
|
|
111
|
-
presentations,
|
|
112
|
-
stateful: false
|
|
113
|
-
});
|
|
114
|
-
try {
|
|
115
|
-
return await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
116
|
-
} finally {
|
|
117
|
-
await closeSessionState(state);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
async function closeSession(sessionId) {
|
|
121
|
-
const state = sessions.get(sessionId);
|
|
122
|
-
if (!state)
|
|
123
|
-
return;
|
|
124
|
-
sessions.delete(sessionId);
|
|
125
|
-
await closeSessionState(state);
|
|
126
|
-
}
|
|
127
|
-
async function handleStateful(request) {
|
|
128
|
-
const requestedSessionId = request.headers.get("mcp-session-id");
|
|
129
|
-
let state;
|
|
130
|
-
let createdState = false;
|
|
131
|
-
if (requestedSessionId) {
|
|
132
|
-
const existing = sessions.get(requestedSessionId);
|
|
133
|
-
if (!existing) {
|
|
134
|
-
return createJsonRpcErrorResponse(404, -32001, "Session not found");
|
|
135
|
-
}
|
|
136
|
-
state = existing;
|
|
137
|
-
} else {
|
|
138
|
-
state = await createSessionState({
|
|
139
|
-
logger,
|
|
140
|
-
path,
|
|
141
|
-
serverName,
|
|
142
|
-
ops,
|
|
143
|
-
resources,
|
|
144
|
-
prompts,
|
|
145
|
-
presentations,
|
|
146
|
-
stateful: true
|
|
147
|
-
});
|
|
148
|
-
createdState = true;
|
|
149
|
-
}
|
|
150
|
-
try {
|
|
151
|
-
const response = await state.transport.handleRequest(normalizeMcpRequest(request));
|
|
152
|
-
const activeSessionId = state.transport.sessionId;
|
|
153
|
-
if (activeSessionId && !sessions.has(activeSessionId)) {
|
|
154
|
-
sessions.set(activeSessionId, state);
|
|
155
|
-
}
|
|
156
|
-
if (request.method === "DELETE" && activeSessionId) {
|
|
157
|
-
await closeSession(activeSessionId);
|
|
158
|
-
} else if (!activeSessionId && createdState) {
|
|
159
|
-
await closeSessionState(state);
|
|
160
|
-
}
|
|
161
|
-
return response;
|
|
162
|
-
} catch (error) {
|
|
163
|
-
if (createdState) {
|
|
164
|
-
await closeSessionState(state);
|
|
165
|
-
}
|
|
166
|
-
throw error;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return new Elysia({ name: `mcp-${serverName}` }).all(path, async ({ request }) => {
|
|
170
|
-
try {
|
|
171
|
-
if (validateAuth) {
|
|
172
|
-
const authResult = await validateAuth(request);
|
|
173
|
-
if (!authResult.valid) {
|
|
174
|
-
return createJsonRpcErrorResponse(401, -32002, "Authentication failed", authResult.reason);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
if (isStateful) {
|
|
178
|
-
return await handleStateful(request);
|
|
179
|
-
}
|
|
180
|
-
return await handleStateless(request);
|
|
181
|
-
} catch (error) {
|
|
182
|
-
logger.error("Error handling MCP request", {
|
|
183
|
-
path,
|
|
184
|
-
method: request.method,
|
|
185
|
-
error: toErrorMessage(error)
|
|
186
|
-
});
|
|
187
|
-
return createJsonRpcErrorResponse(500, -32000, "Internal error");
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
export {
|
|
192
|
-
createMcpElysiaHandler
|
|
193
|
-
};
|
|
1
|
+
var G=["application/json","text/event-stream"];function Z(f){return!f||f.includes("*/*")||f.includes("application/*")||G.some((E)=>f.includes(E))}function k(f){if(f.method!=="POST")return f;let E=f.headers.get("accept");if(!Z(E))return f;let w=G.filter((_)=>!E?.includes(_));if(w.length===0)return f;let z=new Headers(f.headers);return z.set("accept",[E,...w].filter(Boolean).join(", ")),new Request(f,{headers:z})}import{createMcpServer as $}from"@contractspec/lib.contracts-runtime-server-mcp/provider-mcp";import{PresentationRegistry as x}from"@contractspec/lib.contracts-spec/presentations";import{McpServer as H}from"@modelcontextprotocol/sdk/server/mcp.js";import{WebStandardStreamableHTTPServerTransport as W}from"@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";import{randomUUID as c}from"crypto";import{Elysia as M}from"elysia";var b={actor:"anonymous",decide:async()=>({effect:"allow"})};function F(f,E,w,z){return new Response(JSON.stringify({jsonrpc:"2.0",error:{code:E,message:w,...z?{data:z}:{}},id:null}),{status:f,headers:{"content-type":"application/json"}})}function J({logger:f,serverName:E,ops:w,resources:z,prompts:_,presentations:O,stateful:Q}){let y=new H({name:E,version:"1.0.0"},{capabilities:{tools:{},resources:{},prompts:{},logging:{}}});f.info("Setting up MCP server..."),$(y,w,z,_,{logger:f,toolCtx:()=>b,promptCtx:()=>({locale:"en"}),resourceCtx:()=>({locale:"en"}),presentations:new x(O)});let T=new W({sessionIdGenerator:Q?()=>c():void 0,enableJsonResponse:!0});return y.connect(T).then(()=>({server:y,transport:T}))}async function U(f){await Promise.allSettled([f.transport.close(),f.server.close()])}function A(f){return f instanceof Error?f.stack??f.message:String(f)}function v({logger:f,path:E,serverName:w,ops:z,resources:_,prompts:O,presentations:Q,validateAuth:y,requiredAuthMethods:T}){f.info("Setting up MCP handler...",{requiredAuthMethods:T??[]});let K=process.env.CONTRACTSPEC_MCP_STATEFUL==="1",D=new Map;async function L(R){let j=await J({logger:f,path:E,serverName:w,ops:z,resources:_,prompts:O,presentations:Q,stateful:!1});try{return await j.transport.handleRequest(k(R))}finally{await U(j)}}async function V(R){let j=D.get(R);if(!j)return;D.delete(R),await U(j)}async function X(R){let j=R.headers.get("mcp-session-id"),P,Y=!1;if(j){let B=D.get(j);if(!B)return F(404,-32001,"Session not found");P=B}else P=await J({logger:f,path:E,serverName:w,ops:z,resources:_,prompts:O,presentations:Q,stateful:!0}),Y=!0;try{let B=await P.transport.handleRequest(k(R)),C=P.transport.sessionId;if(C&&!D.has(C))D.set(C,P);if(R.method==="DELETE"&&C)await V(C);else if(!C&&Y)await U(P);return B}catch(B){if(Y)await U(P);throw B}}return new M({name:`mcp-${w}`}).all(E,async({request:R})=>{try{if(y){let j=await y(R);if(!j.valid)return F(401,-32002,"Authentication failed",j.reason)}if(K)return await X(R);return await L(R)}catch(j){return f.error("Error handling MCP request",{path:E,method:R.method,error:A(j)}),F(500,-32000,"Internal error")}})}export{v as createMcpElysiaHandler};
|