@contractspec/bundle.library 3.8.10 → 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 +37 -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 -24310
- 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 -325
- package/dist/components/docs/specs/index.d.ts +3 -0
- package/dist/components/docs/specs/index.js +109 -1715
- 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 -28593
- 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 -24310
- 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 -325
- package/dist/node/components/docs/specs/index.js +109 -1715
- 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 -28593
- 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 +103 -31
- 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/index.ts +3 -0
- package/src/components/docs/studio/StudioOverviewPage.tsx +26 -0
- package/src/infrastructure/elysia/logger.ts +11 -3
|
@@ -1,306 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
import Link from "@contractspec/lib.ui-link";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
function StudioPrompt({
|
|
5
|
-
title = "Need the operating layer on top of OSS ContractSpec?",
|
|
6
|
-
body = "ContractSpec Studio helps teams turn evidence into proposed spec changes, governed delivery loops, and execution-ready task packs while keeping the open contract system as the source of truth.",
|
|
7
|
-
ctaLabel = "See what Studio adds",
|
|
8
|
-
href = "https://www.contractspec.studio/docs"
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
-
className: "card-subtle space-y-3 p-6",
|
|
12
|
-
children: [
|
|
13
|
-
/* @__PURE__ */ jsx("h3", {
|
|
14
|
-
className: "font-semibold text-lg",
|
|
15
|
-
children: title
|
|
16
|
-
}),
|
|
17
|
-
/* @__PURE__ */ jsx("p", {
|
|
18
|
-
className: "text-muted-foreground text-sm",
|
|
19
|
-
children: body
|
|
20
|
-
}),
|
|
21
|
-
/* @__PURE__ */ jsx(Link, {
|
|
22
|
-
href,
|
|
23
|
-
className: "btn-primary",
|
|
24
|
-
children: ctaLabel
|
|
25
|
-
})
|
|
26
|
-
]
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/components/docs/guides/GuideCIDiffGatingPage.tsx
|
|
31
|
-
import { CodeBlock } from "@contractspec/lib.design-system";
|
|
32
|
-
import Link2 from "@contractspec/lib.ui-link";
|
|
33
|
-
import { ChevronRight } from "lucide-react";
|
|
34
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
35
|
-
function GuideCIDiffGatingPage() {
|
|
36
|
-
return /* @__PURE__ */ jsxs2("div", {
|
|
37
|
-
className: "space-y-8",
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
40
|
-
className: "space-y-3",
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ jsx2("h1", {
|
|
43
|
-
className: "font-bold text-4xl",
|
|
44
|
-
children: "CI gating with deterministic diffs"
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ jsx2("p", {
|
|
47
|
-
className: "text-lg text-muted-foreground",
|
|
48
|
-
children: "Add ContractSpec CI checks that validate specs, detect drift, and gate breaking changes before merge."
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
}),
|
|
52
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
53
|
-
className: "card-subtle space-y-4 p-6",
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
56
|
-
className: "font-bold text-2xl",
|
|
57
|
-
children: "What you'll build"
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ jsxs2("ul", {
|
|
60
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ jsx2("li", {
|
|
63
|
-
children: "CI workflow running ContractSpec validation and drift checks."
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ jsx2("li", {
|
|
66
|
-
children: "Machine-readable output for PR annotations."
|
|
67
|
-
}),
|
|
68
|
-
/* @__PURE__ */ jsx2("li", {
|
|
69
|
-
children: "Deterministic contract diffs in review."
|
|
70
|
-
})
|
|
71
|
-
]
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
76
|
-
className: "space-y-6",
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
79
|
-
className: "space-y-3",
|
|
80
|
-
children: [
|
|
81
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
82
|
-
className: "font-bold text-2xl",
|
|
83
|
-
children: "1) Add the CI workflow"
|
|
84
|
-
}),
|
|
85
|
-
/* @__PURE__ */ jsx2("p", {
|
|
86
|
-
className: "text-muted-foreground text-sm",
|
|
87
|
-
children: "Copy the template from the CLI package."
|
|
88
|
-
}),
|
|
89
|
-
/* @__PURE__ */ jsx2(CodeBlock, {
|
|
90
|
-
language: "bash",
|
|
91
|
-
filename: "ci-copy",
|
|
92
|
-
code: `cp node_modules/@contractspec/app.cli-contractspec/templates/github-action.yml .github/workflows/contractspec.yml`
|
|
93
|
-
}),
|
|
94
|
-
/* @__PURE__ */ jsxs2("p", {
|
|
95
|
-
className: "text-muted-foreground text-sm",
|
|
96
|
-
children: [
|
|
97
|
-
"Expected output: new workflow file in ",
|
|
98
|
-
/* @__PURE__ */ jsx2("code", {
|
|
99
|
-
children: ".github/workflows"
|
|
100
|
-
}),
|
|
101
|
-
"."
|
|
102
|
-
]
|
|
103
|
-
})
|
|
104
|
-
]
|
|
105
|
-
}),
|
|
106
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
107
|
-
className: "space-y-3",
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
110
|
-
className: "font-bold text-2xl",
|
|
111
|
-
children: "2) Run CI locally"
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ jsx2(CodeBlock, {
|
|
114
|
-
language: "bash",
|
|
115
|
-
filename: "ci-local",
|
|
116
|
-
code: `contractspec ci --format json --check-drift`
|
|
117
|
-
}),
|
|
118
|
-
/* @__PURE__ */ jsx2("p", {
|
|
119
|
-
className: "text-muted-foreground text-sm",
|
|
120
|
-
children: "Expected output: JSON summary including pass/fail counts and drift status (if configured)."
|
|
121
|
-
})
|
|
122
|
-
]
|
|
123
|
-
}),
|
|
124
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
125
|
-
className: "space-y-3",
|
|
126
|
-
children: [
|
|
127
|
-
/* @__PURE__ */ jsx2("h2", {
|
|
128
|
-
className: "font-bold text-2xl",
|
|
129
|
-
children: "3) Add a diff check"
|
|
130
|
-
}),
|
|
131
|
-
/* @__PURE__ */ jsx2("p", {
|
|
132
|
-
className: "text-muted-foreground text-sm",
|
|
133
|
-
children: "Use the diff command to inspect breaking changes in PRs."
|
|
134
|
-
}),
|
|
135
|
-
/* @__PURE__ */ jsx2(CodeBlock, {
|
|
136
|
-
language: "bash",
|
|
137
|
-
filename: "ci-diff",
|
|
138
|
-
code: `contractspec diff src/contracts/spec-v1.ts src/contracts/spec-v2.ts --breaking`
|
|
139
|
-
}),
|
|
140
|
-
/* @__PURE__ */ jsx2("p", {
|
|
141
|
-
className: "text-muted-foreground text-sm",
|
|
142
|
-
children: "Expected output: deterministic diff with breaking change hints."
|
|
143
|
-
})
|
|
144
|
-
]
|
|
145
|
-
}),
|
|
146
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
147
|
-
className: "card-subtle space-y-3 p-6",
|
|
148
|
-
children: [
|
|
149
|
-
/* @__PURE__ */ jsx2("h3", {
|
|
150
|
-
className: "font-semibold text-lg",
|
|
151
|
-
children: "Example package"
|
|
152
|
-
}),
|
|
153
|
-
/* @__PURE__ */ jsx2("p", {
|
|
154
|
-
className: "text-muted-foreground text-sm",
|
|
155
|
-
children: "The CRM pipeline example is already wired in the quickstart smoke test. Use it as a CI-ready template."
|
|
156
|
-
}),
|
|
157
|
-
/* @__PURE__ */ jsx2(CodeBlock, {
|
|
158
|
-
language: "bash",
|
|
159
|
-
filename: "crm-ci",
|
|
160
|
-
code: `cd packages/examples/crm-pipeline
|
|
1
|
+
import $ from"@contractspec/lib.ui-link";import{jsx as O,jsxs as X}from"react/jsx-runtime";function g({title:c="Need the operating layer on top of OSS ContractSpec?",body:_="ContractSpec Studio helps teams turn evidence into proposed spec changes, governed delivery loops, and execution-ready task packs while keeping the open contract system as the source of truth.",ctaLabel:Y="See what Studio adds",href:J="https://www.contractspec.studio/docs"}){return X("div",{className:"card-subtle space-y-3 p-6",children:[O("h3",{className:"font-semibold text-lg",children:c}),O("p",{className:"text-muted-foreground text-sm",children:_}),O($,{href:J,className:"btn-primary",children:Y})]})}import{CodeBlock as R}from"@contractspec/lib.design-system";import L from"@contractspec/lib.ui-link";import{ChevronRight as Z}from"lucide-react";import{jsx as d,jsxs as w}from"react/jsx-runtime";function x(){return w("div",{className:"space-y-8",children:[w("div",{className:"space-y-3",children:[d("h1",{className:"font-bold text-4xl",children:"CI gating with deterministic diffs"}),d("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec CI checks that validate specs, detect drift, and gate breaking changes before merge."})]}),w("div",{className:"card-subtle space-y-4 p-6",children:[d("h2",{className:"font-bold text-2xl",children:"What you'll build"}),w("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[d("li",{children:"CI workflow running ContractSpec validation and drift checks."}),d("li",{children:"Machine-readable output for PR annotations."}),d("li",{children:"Deterministic contract diffs in review."})]})]}),w("div",{className:"space-y-6",children:[w("div",{className:"space-y-3",children:[d("h2",{className:"font-bold text-2xl",children:"1) Add the CI workflow"}),d("p",{className:"text-muted-foreground text-sm",children:"Copy the template from the CLI package."}),d(R,{language:"bash",filename:"ci-copy",code:"cp node_modules/@contractspec/app.cli-contractspec/templates/github-action.yml .github/workflows/contractspec.yml"}),w("p",{className:"text-muted-foreground text-sm",children:["Expected output: new workflow file in ",d("code",{children:".github/workflows"}),"."]})]}),w("div",{className:"space-y-3",children:[d("h2",{className:"font-bold text-2xl",children:"2) Run CI locally"}),d(R,{language:"bash",filename:"ci-local",code:"contractspec ci --format json --check-drift"}),d("p",{className:"text-muted-foreground text-sm",children:"Expected output: JSON summary including pass/fail counts and drift status (if configured)."})]}),w("div",{className:"space-y-3",children:[d("h2",{className:"font-bold text-2xl",children:"3) Add a diff check"}),d("p",{className:"text-muted-foreground text-sm",children:"Use the diff command to inspect breaking changes in PRs."}),d(R,{language:"bash",filename:"ci-diff",code:"contractspec diff src/contracts/spec-v1.ts src/contracts/spec-v2.ts --breaking"}),d("p",{className:"text-muted-foreground text-sm",children:"Expected output: deterministic diff with breaking change hints."})]}),w("div",{className:"card-subtle space-y-3 p-6",children:[d("h3",{className:"font-semibold text-lg",children:"Example package"}),d("p",{className:"text-muted-foreground text-sm",children:"The CRM pipeline example is already wired in the quickstart smoke test. Use it as a CI-ready template."}),d(R,{language:"bash",filename:"crm-ci",code:`cd packages/examples/crm-pipeline
|
|
161
2
|
bun run build
|
|
162
|
-
bun run validate`
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
children: "Docs home"
|
|
189
|
-
})
|
|
190
|
-
]
|
|
191
|
-
})
|
|
192
|
-
]
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// src/components/docs/guides/GuideContractTypesPage.tsx
|
|
197
|
-
import { CodeBlock as CodeBlock2 } from "@contractspec/lib.design-system";
|
|
198
|
-
import Link3 from "@contractspec/lib.ui-link";
|
|
199
|
-
import { ChevronRight as ChevronRight2, Globe, Layers, Shield, Zap } from "lucide-react";
|
|
200
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
201
|
-
var contractTypes = [
|
|
202
|
-
{
|
|
203
|
-
name: "Operations",
|
|
204
|
-
factory: "defineCommand / defineQuery",
|
|
205
|
-
description: "API endpoints with input/output schemas, validation, and policy.",
|
|
206
|
-
icon: Zap,
|
|
207
|
-
color: "text-blue-400"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
name: "Events",
|
|
211
|
-
factory: "defineEvent",
|
|
212
|
-
description: "Domain events with typed payloads and PII handling.",
|
|
213
|
-
icon: Layers,
|
|
214
|
-
color: "text-green-400"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: "Capabilities",
|
|
218
|
-
factory: "defineCapability",
|
|
219
|
-
description: "Feature groupings that link operations, events, and UIs.",
|
|
220
|
-
icon: Shield,
|
|
221
|
-
color: "text-purple-400"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: "Presentations",
|
|
225
|
-
factory: "definePresentation",
|
|
226
|
-
description: "UI specifications for rendering data and handling interactions.",
|
|
227
|
-
icon: Globe,
|
|
228
|
-
color: "text-orange-400"
|
|
3
|
+
bun run validate`})]}),d(g,{title:"Need continuous checks tied to outcomes?",body:"Studio closes the loop with post-change verification and learning dividends that improve future decisions."})]}),w("div",{className:"flex items-center gap-4 pt-4",children:[w(L,{href:"/docs/guides",className:"btn-primary",children:["Back to guides ",d(Z,{size:16})]}),d(L,{href:"/docs",className:"btn-ghost",children:"Docs home"})]})]})}import{CodeBlock as P}from"@contractspec/lib.design-system";import G from"@contractspec/lib.ui-link";import{ChevronRight as j}from"lucide-react";import{jsx as i,jsxs as b}from"react/jsx-runtime";var ee=[".contractspec/connect/context-pack.json",".contractspec/connect/plan-packet.json",".contractspec/connect/patch-verdict.json",".contractspec/connect/audit.ndjson",".contractspec/connect/decisions/<decisionId>/"];function te(){return b("div",{className:"space-y-8",children:[b("div",{className:"space-y-3",children:[i("h1",{className:"font-bold text-4xl",children:"Use Connect in a repo"}),i("p",{className:"text-lg text-muted-foreground",children:"Put coding-agent edits and shell commands behind task-scoped context, plan compilation, verification, and local review evidence without introducing a second control plane."})]}),b("div",{className:"card-subtle space-y-4 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"What you'll build"}),b("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[i("li",{children:"A workspace-level Connect config in `.contractsrc.json`."}),i("li",{children:"A context and plan flow for one task."}),i("li",{children:"Verified file and shell mutations with local review/replay evidence."})]})]}),b("div",{className:"space-y-6",children:[b("div",{className:"space-y-3",children:[i("h2",{className:"font-bold text-2xl",children:"1) Enable Connect"}),i("p",{className:"text-muted-foreground text-sm",children:"Start by making the safety policy explicit. Protected paths, generated paths, review thresholds, and command rules live in the workspace config, not in editor-specific hooks."}),i(P,{language:"json",filename:".contractsrc.json",code:`{
|
|
4
|
+
"connect": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"storage": {
|
|
7
|
+
"root": ".contractspec/connect",
|
|
8
|
+
"contextPack": ".contractspec/connect/context-pack.json",
|
|
9
|
+
"planPacket": ".contractspec/connect/plan-packet.json",
|
|
10
|
+
"patchVerdict": ".contractspec/connect/patch-verdict.json",
|
|
11
|
+
"auditFile": ".contractspec/connect/audit.ndjson",
|
|
12
|
+
"reviewPacketsDir": ".contractspec/connect/review-packets"
|
|
13
|
+
},
|
|
14
|
+
"policy": {
|
|
15
|
+
"protectedPaths": ["packages/libs/contracts-spec/**"],
|
|
16
|
+
"generatedPaths": ["generated/**"],
|
|
17
|
+
"smokeChecks": ["bun run typecheck"],
|
|
18
|
+
"reviewThresholds": {
|
|
19
|
+
"protectedPathWrite": "require_review",
|
|
20
|
+
"breakingChange": "require_review",
|
|
21
|
+
"destructiveCommand": "deny"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"commands": {
|
|
25
|
+
"allow": ["bun run typecheck"],
|
|
26
|
+
"review": ["git push"],
|
|
27
|
+
"deny": ["git reset --hard", "git push --force", "rm -rf"]
|
|
28
|
+
}
|
|
229
29
|
}
|
|
230
|
-
]
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
]
|
|
247
|
-
}),
|
|
248
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
249
|
-
className: "card-subtle space-y-4 p-6",
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
252
|
-
className: "font-bold text-2xl",
|
|
253
|
-
children: "Core Contract Types"
|
|
254
|
-
}),
|
|
255
|
-
/* @__PURE__ */ jsx3("div", {
|
|
256
|
-
className: "grid gap-3 md:grid-cols-2",
|
|
257
|
-
children: contractTypes.map((type) => /* @__PURE__ */ jsxs3("div", {
|
|
258
|
-
className: "flex items-start gap-3 rounded-lg border border-white/10 p-4",
|
|
259
|
-
children: [
|
|
260
|
-
/* @__PURE__ */ jsx3(type.icon, {
|
|
261
|
-
className: type.color,
|
|
262
|
-
size: 20
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
265
|
-
className: "space-y-1",
|
|
266
|
-
children: [
|
|
267
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
268
|
-
className: "font-semibold",
|
|
269
|
-
children: type.name
|
|
270
|
-
}),
|
|
271
|
-
/* @__PURE__ */ jsx3("p", {
|
|
272
|
-
className: "text-muted-foreground text-xs",
|
|
273
|
-
children: type.description
|
|
274
|
-
}),
|
|
275
|
-
/* @__PURE__ */ jsx3("code", {
|
|
276
|
-
className: "text-violet-400 text-xs",
|
|
277
|
-
children: type.factory
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
})
|
|
281
|
-
]
|
|
282
|
-
}, type.name))
|
|
283
|
-
})
|
|
284
|
-
]
|
|
285
|
-
}),
|
|
286
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
287
|
-
className: "space-y-6",
|
|
288
|
-
children: [
|
|
289
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
290
|
-
className: "space-y-3",
|
|
291
|
-
children: [
|
|
292
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
293
|
-
className: "font-bold text-2xl",
|
|
294
|
-
children: "1) Operations (Commands & Queries)"
|
|
295
|
-
}),
|
|
296
|
-
/* @__PURE__ */ jsx3("p", {
|
|
297
|
-
className: "text-muted-foreground text-sm",
|
|
298
|
-
children: "Operations are the backbone of your API. Commands mutate state, queries read state. Both have typed input/output schemas."
|
|
299
|
-
}),
|
|
300
|
-
/* @__PURE__ */ jsx3(CodeBlock2, {
|
|
301
|
-
language: "typescript",
|
|
302
|
-
filename: "src/contracts/user.operation.ts",
|
|
303
|
-
code: `import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
|
|
30
|
+
}`}),i("p",{className:"text-muted-foreground text-sm",children:"Expected output: Connect has enough policy to classify writes, commands, drift, and review thresholds deterministically."})]}),b("div",{className:"space-y-3",children:[i("h2",{className:"font-bold text-2xl",children:"2) Initialize storage"}),i(P,{language:"bash",filename:"connect-init",code:"contractspec connect init --scope workspace"}),i("p",{className:"text-muted-foreground text-sm",children:"Expected output: `.contractsrc.json` is updated if needed and `.contractspec/connect/` is created."})]}),b("div",{className:"space-y-3",children:[i("h2",{className:"font-bold text-2xl",children:"3) Project context and compile a plan"}),i("p",{className:"text-muted-foreground text-sm",children:"Use the task id as the thread that connects context, plan, verdict, and replay artifacts."}),i(P,{language:"bash",filename:"connect-plan",code:`contractspec connect context \\
|
|
31
|
+
--task docs-connect \\
|
|
32
|
+
--paths packages/libs/contracts-spec/src/control-plane/contracts.ts \\
|
|
33
|
+
--json
|
|
34
|
+
|
|
35
|
+
printf '{"objective":"Document the control-plane contract surface","commands":["bun run typecheck"]}' | \\
|
|
36
|
+
contractspec connect plan --task docs-connect --stdin --json`}),i("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `ContextPack` and `PlanPacket` that point back to `controlPlane.intent.submit`, `controlPlane.plan.compile`, and `controlPlane.plan.verify`."})]}),b("div",{className:"space-y-3",children:[i("h2",{className:"font-bold text-2xl",children:"4) Verify file and shell mutations"}),i(P,{language:"bash",filename:"connect-verify",code:`printf '{"operation":"edit","path":"packages/libs/contracts-spec/src/control-plane/contracts.ts"}' | \\
|
|
37
|
+
contractspec connect verify --task docs-connect --tool acp.fs.access --stdin --json
|
|
38
|
+
|
|
39
|
+
printf 'bun run typecheck' | \\
|
|
40
|
+
contractspec connect verify --task docs-connect --tool acp.terminal.exec --stdin --json`}),i("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `PatchVerdict` with `permit`, `rewrite`, `require_review`, or `deny`, plus a runtime-linked control-plane state when that linkage is available."})]}),b("div",{className:"card-subtle space-y-3 p-6",children:[i("h3",{className:"font-semibold text-lg",children:"Artifacts to inspect"}),i("ul",{className:"space-y-2 text-muted-foreground text-sm",children:ee.map((c)=>i("li",{children:i("code",{children:c})},c))})]}),b("div",{className:"space-y-3",children:[i("h2",{className:"font-bold text-2xl",children:"5) Review, replay, and optional Studio sync"}),i(P,{language:"bash",filename:"connect-review-replay",code:`contractspec connect review list --json
|
|
41
|
+
contractspec connect replay <decisionId> --json
|
|
42
|
+
contractspec connect eval <decisionId> --registry ./harness-registry.ts --scenario connect.safe-refactor --json
|
|
43
|
+
|
|
44
|
+
# Optional when Studio review-bridge mode is enabled
|
|
45
|
+
contractspec connect review sync --decision <decisionId> --json`}),i("p",{className:"text-muted-foreground text-sm",children:"Local review packets remain authoritative. Studio sync is an operator convenience layer, not a requirement for baseline OSS safety."})]})]}),b("div",{className:"flex items-center gap-4 pt-4",children:[b(G,{href:"/docs/specs/connect",className:"btn-primary",children:["Back to Connect spec ",i(j,{size:16})]}),i(G,{href:"/docs/architecture/control-plane",className:"btn-ghost",children:"Control-plane runtime"})]})]})}import{CodeBlock as B}from"@contractspec/lib.design-system";import W from"@contractspec/lib.ui-link";import{ChevronRight as ae,Globe as oe,Layers as ne,Shield as ie,Zap as re}from"lucide-react";import{jsx as t,jsxs as o}from"react/jsx-runtime";var ce=[{name:"Operations",factory:"defineCommand / defineQuery",description:"API endpoints with input/output schemas, validation, and policy.",icon:re,color:"text-blue-400"},{name:"Events",factory:"defineEvent",description:"Domain events with typed payloads and PII handling.",icon:ne,color:"text-green-400"},{name:"Capabilities",factory:"defineCapability",description:"Feature groupings that link operations, events, and UIs.",icon:ie,color:"text-purple-400"},{name:"Presentations",factory:"definePresentation",description:"UI specifications for rendering data and handling interactions.",icon:oe,color:"text-orange-400"}];function se(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-3",children:[t("h1",{className:"font-bold text-4xl",children:"Contract Types Overview"}),t("p",{className:"text-lg text-muted-foreground",children:"Learn about the different contract types in ContractSpec and when to use each one when you are making the system boundary explicit."})]}),o("div",{className:"card-subtle space-y-4 p-6",children:[t("h2",{className:"font-bold text-2xl",children:"Core Contract Types"}),t("div",{className:"grid gap-3 md:grid-cols-2",children:ce.map((c)=>o("div",{className:"flex items-start gap-3 rounded-lg border border-white/10 p-4",children:[t(c.icon,{className:c.color,size:20}),o("div",{className:"space-y-1",children:[t("h3",{className:"font-semibold",children:c.name}),t("p",{className:"text-muted-foreground text-xs",children:c.description}),t("code",{className:"text-violet-400 text-xs",children:c.factory})]})]},c.name))})]}),o("div",{className:"space-y-6",children:[o("div",{className:"space-y-3",children:[t("h2",{className:"font-bold text-2xl",children:"1) Operations (Commands & Queries)"}),t("p",{className:"text-muted-foreground text-sm",children:"Operations are the backbone of your API. Commands mutate state, queries read state. Both have typed input/output schemas."}),t(B,{language:"typescript",filename:"src/contracts/user.operation.ts",code:`import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
|
|
304
46
|
import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
305
47
|
|
|
306
48
|
// Command: Mutates state (creates a user)
|
|
@@ -366,25 +108,7 @@ export const GetUserQuery = defineQuery({
|
|
|
366
108
|
}),
|
|
367
109
|
},
|
|
368
110
|
policy: { auth: "user" },
|
|
369
|
-
});`
|
|
370
|
-
})
|
|
371
|
-
]
|
|
372
|
-
}),
|
|
373
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
374
|
-
className: "space-y-3",
|
|
375
|
-
children: [
|
|
376
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
377
|
-
className: "font-bold text-2xl",
|
|
378
|
-
children: "2) Events"
|
|
379
|
-
}),
|
|
380
|
-
/* @__PURE__ */ jsx3("p", {
|
|
381
|
-
className: "text-muted-foreground text-sm",
|
|
382
|
-
children: "Events represent domain occurrences. They have typed payloads with PII field marking for compliance."
|
|
383
|
-
}),
|
|
384
|
-
/* @__PURE__ */ jsx3(CodeBlock2, {
|
|
385
|
-
language: "typescript",
|
|
386
|
-
filename: "src/contracts/user.event.ts",
|
|
387
|
-
code: `import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
111
|
+
});`})]}),o("div",{className:"space-y-3",children:[t("h2",{className:"font-bold text-2xl",children:"2) Events"}),t("p",{className:"text-muted-foreground text-sm",children:"Events represent domain occurrences. They have typed payloads with PII field marking for compliance."}),t(B,{language:"typescript",filename:"src/contracts/user.event.ts",code:`import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
388
112
|
import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
389
113
|
|
|
390
114
|
export const UserCreatedEvent = defineEvent({
|
|
@@ -425,25 +149,7 @@ export const UserDeletedEvent = defineEvent({
|
|
|
425
149
|
reason: { type: ScalarTypeEnum.String(), isOptional: true },
|
|
426
150
|
},
|
|
427
151
|
}),
|
|
428
|
-
});`
|
|
429
|
-
})
|
|
430
|
-
]
|
|
431
|
-
}),
|
|
432
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
433
|
-
className: "space-y-3",
|
|
434
|
-
children: [
|
|
435
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
436
|
-
className: "font-bold text-2xl",
|
|
437
|
-
children: "3) Capabilities"
|
|
438
|
-
}),
|
|
439
|
-
/* @__PURE__ */ jsx3("p", {
|
|
440
|
-
className: "text-muted-foreground text-sm",
|
|
441
|
-
children: "Capabilities group related operations, events, and presentations. They define feature boundaries and dependencies."
|
|
442
|
-
}),
|
|
443
|
-
/* @__PURE__ */ jsx3(CodeBlock2, {
|
|
444
|
-
language: "typescript",
|
|
445
|
-
filename: "src/contracts/user-management.capability.ts",
|
|
446
|
-
code: `import { defineCapability } from "@contractspec/lib.contracts-spec";
|
|
152
|
+
});`})]}),o("div",{className:"space-y-3",children:[t("h2",{className:"font-bold text-2xl",children:"3) Capabilities"}),t("p",{className:"text-muted-foreground text-sm",children:"Capabilities group related operations, events, and presentations. They define feature boundaries and dependencies."}),t(B,{language:"typescript",filename:"src/contracts/user-management.capability.ts",code:`import { defineCapability } from "@contractspec/lib.contracts-spec";
|
|
447
153
|
|
|
448
154
|
export const UserManagementCapability = defineCapability({
|
|
449
155
|
meta: {
|
|
@@ -486,25 +192,7 @@ export const AdminUserCapability = defineCapability({
|
|
|
486
192
|
{ surface: "operation", key: "user.ban", version: "1.0.0" },
|
|
487
193
|
{ surface: "operation", key: "user.impersonate", version: "1.0.0" },
|
|
488
194
|
],
|
|
489
|
-
});`
|
|
490
|
-
})
|
|
491
|
-
]
|
|
492
|
-
}),
|
|
493
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
494
|
-
className: "space-y-3",
|
|
495
|
-
children: [
|
|
496
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
497
|
-
className: "font-bold text-2xl",
|
|
498
|
-
children: "4) Presentations"
|
|
499
|
-
}),
|
|
500
|
-
/* @__PURE__ */ jsx3("p", {
|
|
501
|
-
className: "text-muted-foreground text-sm",
|
|
502
|
-
children: "Presentations define UI specifications. They link to capabilities and specify how data should be displayed."
|
|
503
|
-
}),
|
|
504
|
-
/* @__PURE__ */ jsx3(CodeBlock2, {
|
|
505
|
-
language: "typescript",
|
|
506
|
-
filename: "src/contracts/user-list.presentation.ts",
|
|
507
|
-
code: `import { definePresentation } from "@contractspec/lib.contracts-spec";
|
|
195
|
+
});`})]}),o("div",{className:"space-y-3",children:[t("h2",{className:"font-bold text-2xl",children:"4) Presentations"}),t("p",{className:"text-muted-foreground text-sm",children:"Presentations define UI specifications. They link to capabilities and specify how data should be displayed."}),t(B,{language:"typescript",filename:"src/contracts/user-list.presentation.ts",code:`import { definePresentation } from "@contractspec/lib.contracts-spec";
|
|
508
196
|
|
|
509
197
|
export const UserListPresentation = definePresentation({
|
|
510
198
|
meta: {
|
|
@@ -526,179 +214,7 @@ export const UserListPresentation = definePresentation({
|
|
|
526
214
|
pagination: { defaultPageSize: 25 },
|
|
527
215
|
search: { fields: ["name", "email"] },
|
|
528
216
|
},
|
|
529
|
-
});`
|
|
530
|
-
})
|
|
531
|
-
]
|
|
532
|
-
}),
|
|
533
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
534
|
-
className: "space-y-3",
|
|
535
|
-
children: [
|
|
536
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
537
|
-
className: "font-bold text-2xl",
|
|
538
|
-
children: "5) Additional Contract Types"
|
|
539
|
-
}),
|
|
540
|
-
/* @__PURE__ */ jsx3("p", {
|
|
541
|
-
className: "text-muted-foreground text-sm",
|
|
542
|
-
children: "ContractSpec provides specialized contracts for different concerns:"
|
|
543
|
-
}),
|
|
544
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
545
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
546
|
-
children: [
|
|
547
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
548
|
-
className: "card-subtle space-y-2 p-4",
|
|
549
|
-
children: [
|
|
550
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
551
|
-
className: "font-semibold",
|
|
552
|
-
children: "Policy"
|
|
553
|
-
}),
|
|
554
|
-
/* @__PURE__ */ jsx3("code", {
|
|
555
|
-
className: "text-violet-400 text-xs",
|
|
556
|
-
children: "definePolicy"
|
|
557
|
-
}),
|
|
558
|
-
/* @__PURE__ */ jsx3("p", {
|
|
559
|
-
className: "text-muted-foreground text-xs",
|
|
560
|
-
children: "RBAC/ABAC rules, rate limits, and access control."
|
|
561
|
-
})
|
|
562
|
-
]
|
|
563
|
-
}),
|
|
564
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
565
|
-
className: "card-subtle space-y-2 p-4",
|
|
566
|
-
children: [
|
|
567
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
568
|
-
className: "font-semibold",
|
|
569
|
-
children: "Workflow"
|
|
570
|
-
}),
|
|
571
|
-
/* @__PURE__ */ jsx3("code", {
|
|
572
|
-
className: "text-violet-400 text-xs",
|
|
573
|
-
children: "defineWorkflow"
|
|
574
|
-
}),
|
|
575
|
-
/* @__PURE__ */ jsx3("p", {
|
|
576
|
-
className: "text-muted-foreground text-xs",
|
|
577
|
-
children: "Multi-step processes with states, transitions, and SLAs."
|
|
578
|
-
})
|
|
579
|
-
]
|
|
580
|
-
}),
|
|
581
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
582
|
-
className: "card-subtle space-y-2 p-4",
|
|
583
|
-
children: [
|
|
584
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
585
|
-
className: "font-semibold",
|
|
586
|
-
children: "Translation"
|
|
587
|
-
}),
|
|
588
|
-
/* @__PURE__ */ jsx3("code", {
|
|
589
|
-
className: "text-violet-400 text-xs",
|
|
590
|
-
children: "defineTranslation"
|
|
591
|
-
}),
|
|
592
|
-
/* @__PURE__ */ jsx3("p", {
|
|
593
|
-
className: "text-muted-foreground text-xs",
|
|
594
|
-
children: "i18n messages with ICU format and locale fallbacks."
|
|
595
|
-
})
|
|
596
|
-
]
|
|
597
|
-
}),
|
|
598
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
599
|
-
className: "card-subtle space-y-2 p-4",
|
|
600
|
-
children: [
|
|
601
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
602
|
-
className: "font-semibold",
|
|
603
|
-
children: "Integration"
|
|
604
|
-
}),
|
|
605
|
-
/* @__PURE__ */ jsx3("code", {
|
|
606
|
-
className: "text-violet-400 text-xs",
|
|
607
|
-
children: "defineIntegration"
|
|
608
|
-
}),
|
|
609
|
-
/* @__PURE__ */ jsx3("p", {
|
|
610
|
-
className: "text-muted-foreground text-xs",
|
|
611
|
-
children: "External service connections and API adapters."
|
|
612
|
-
})
|
|
613
|
-
]
|
|
614
|
-
}),
|
|
615
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
616
|
-
className: "card-subtle space-y-2 p-4",
|
|
617
|
-
children: [
|
|
618
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
619
|
-
className: "font-semibold",
|
|
620
|
-
children: "Form"
|
|
621
|
-
}),
|
|
622
|
-
/* @__PURE__ */ jsx3("code", {
|
|
623
|
-
className: "text-violet-400 text-xs",
|
|
624
|
-
children: "defineFormSpec"
|
|
625
|
-
}),
|
|
626
|
-
/* @__PURE__ */ jsx3("p", {
|
|
627
|
-
className: "text-muted-foreground text-xs",
|
|
628
|
-
children: "Form definitions with fields, validation, and layouts."
|
|
629
|
-
})
|
|
630
|
-
]
|
|
631
|
-
}),
|
|
632
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
633
|
-
className: "card-subtle space-y-2 p-4",
|
|
634
|
-
children: [
|
|
635
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
636
|
-
className: "font-semibold",
|
|
637
|
-
children: "Data View"
|
|
638
|
-
}),
|
|
639
|
-
/* @__PURE__ */ jsx3("code", {
|
|
640
|
-
className: "text-violet-400 text-xs",
|
|
641
|
-
children: "defineDataView"
|
|
642
|
-
}),
|
|
643
|
-
/* @__PURE__ */ jsx3("p", {
|
|
644
|
-
className: "text-muted-foreground text-xs",
|
|
645
|
-
children: "Read-only data projections and aggregations."
|
|
646
|
-
})
|
|
647
|
-
]
|
|
648
|
-
}),
|
|
649
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
650
|
-
className: "card-subtle space-y-2 p-4",
|
|
651
|
-
children: [
|
|
652
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
653
|
-
className: "font-semibold",
|
|
654
|
-
children: "Feature"
|
|
655
|
-
}),
|
|
656
|
-
/* @__PURE__ */ jsx3("code", {
|
|
657
|
-
className: "text-violet-400 text-xs",
|
|
658
|
-
children: "defineFeature"
|
|
659
|
-
}),
|
|
660
|
-
/* @__PURE__ */ jsx3("p", {
|
|
661
|
-
className: "text-muted-foreground text-xs",
|
|
662
|
-
children: "Feature flags and progressive rollout configurations."
|
|
663
|
-
})
|
|
664
|
-
]
|
|
665
|
-
}),
|
|
666
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
667
|
-
className: "card-subtle space-y-2 p-4",
|
|
668
|
-
children: [
|
|
669
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
670
|
-
className: "font-semibold",
|
|
671
|
-
children: "Test"
|
|
672
|
-
}),
|
|
673
|
-
/* @__PURE__ */ jsx3("code", {
|
|
674
|
-
className: "text-violet-400 text-xs",
|
|
675
|
-
children: "defineTestSpec"
|
|
676
|
-
}),
|
|
677
|
-
/* @__PURE__ */ jsx3("p", {
|
|
678
|
-
className: "text-muted-foreground text-xs",
|
|
679
|
-
children: "Contract-driven test scenarios and fixtures."
|
|
680
|
-
})
|
|
681
|
-
]
|
|
682
|
-
})
|
|
683
|
-
]
|
|
684
|
-
})
|
|
685
|
-
]
|
|
686
|
-
}),
|
|
687
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
688
|
-
className: "space-y-3",
|
|
689
|
-
children: [
|
|
690
|
-
/* @__PURE__ */ jsx3("h2", {
|
|
691
|
-
className: "font-bold text-2xl",
|
|
692
|
-
children: "6) Registering Contracts"
|
|
693
|
-
}),
|
|
694
|
-
/* @__PURE__ */ jsx3("p", {
|
|
695
|
-
className: "text-muted-foreground text-sm",
|
|
696
|
-
children: "Each contract type has a registry for lookup and validation."
|
|
697
|
-
}),
|
|
698
|
-
/* @__PURE__ */ jsx3(CodeBlock2, {
|
|
699
|
-
language: "typescript",
|
|
700
|
-
filename: "src/contracts/registry.ts",
|
|
701
|
-
code: `import {
|
|
217
|
+
});`})]}),o("div",{className:"space-y-3",children:[t("h2",{className:"font-bold text-2xl",children:"5) Additional Contract Types"}),t("p",{className:"text-muted-foreground text-sm",children:"ContractSpec provides specialized contracts for different concerns:"}),o("div",{className:"grid gap-4 md:grid-cols-2",children:[o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Policy"}),t("code",{className:"text-violet-400 text-xs",children:"definePolicy"}),t("p",{className:"text-muted-foreground text-xs",children:"RBAC/ABAC rules, rate limits, and access control."})]}),o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Workflow"}),t("code",{className:"text-violet-400 text-xs",children:"defineWorkflow"}),t("p",{className:"text-muted-foreground text-xs",children:"Multi-step processes with states, transitions, and SLAs."})]}),o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Translation"}),t("code",{className:"text-violet-400 text-xs",children:"defineTranslation"}),t("p",{className:"text-muted-foreground text-xs",children:"i18n messages with ICU format and locale fallbacks."})]}),o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Integration"}),t("code",{className:"text-violet-400 text-xs",children:"defineIntegration"}),t("p",{className:"text-muted-foreground text-xs",children:"External service connections and API adapters."})]}),o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Form"}),t("code",{className:"text-violet-400 text-xs",children:"defineFormSpec"}),t("p",{className:"text-muted-foreground text-xs",children:"Form definitions with fields, validation, and layouts."})]}),o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Data View"}),t("code",{className:"text-violet-400 text-xs",children:"defineDataView"}),t("p",{className:"text-muted-foreground text-xs",children:"Read-only data projections and aggregations."})]}),o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Feature"}),t("code",{className:"text-violet-400 text-xs",children:"defineFeature"}),t("p",{className:"text-muted-foreground text-xs",children:"Feature flags and progressive rollout configurations."})]}),o("div",{className:"card-subtle space-y-2 p-4",children:[t("h3",{className:"font-semibold",children:"Test"}),t("code",{className:"text-violet-400 text-xs",children:"defineTestSpec"}),t("p",{className:"text-muted-foreground text-xs",children:"Contract-driven test scenarios and fixtures."})]})]})]}),o("div",{className:"space-y-3",children:[t("h2",{className:"font-bold text-2xl",children:"6) Registering Contracts"}),t("p",{className:"text-muted-foreground text-sm",children:"Each contract type has a registry for lookup and validation."}),t(B,{language:"typescript",filename:"src/contracts/registry.ts",code:`import {
|
|
702
218
|
OperationSpecRegistry,
|
|
703
219
|
installOp,
|
|
704
220
|
} from "@contractspec/lib.contracts-spec/operations";
|
|
@@ -728,291 +244,9 @@ installOp(operationRegistry, GetUserQuery, async (input) => {
|
|
|
728
244
|
|
|
729
245
|
// Register events and capabilities
|
|
730
246
|
eventRegistry.register(UserCreatedEvent);
|
|
731
|
-
capabilityRegistry.register(UserManagementCapability);`
|
|
732
|
-
})
|
|
733
|
-
]
|
|
734
|
-
}),
|
|
735
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
736
|
-
className: "card-subtle space-y-3 p-6",
|
|
737
|
-
children: [
|
|
738
|
-
/* @__PURE__ */ jsx3("h3", {
|
|
739
|
-
className: "font-semibold text-lg",
|
|
740
|
-
children: "Contract Type Decision Guide"
|
|
741
|
-
}),
|
|
742
|
-
/* @__PURE__ */ jsxs3("table", {
|
|
743
|
-
className: "w-full text-sm",
|
|
744
|
-
children: [
|
|
745
|
-
/* @__PURE__ */ jsx3("thead", {
|
|
746
|
-
children: /* @__PURE__ */ jsxs3("tr", {
|
|
747
|
-
className: "border-white/10 border-b",
|
|
748
|
-
children: [
|
|
749
|
-
/* @__PURE__ */ jsx3("th", {
|
|
750
|
-
className: "py-2 text-left",
|
|
751
|
-
children: "When you need..."
|
|
752
|
-
}),
|
|
753
|
-
/* @__PURE__ */ jsx3("th", {
|
|
754
|
-
className: "py-2 text-left",
|
|
755
|
-
children: "Use this contract"
|
|
756
|
-
})
|
|
757
|
-
]
|
|
758
|
-
})
|
|
759
|
-
}),
|
|
760
|
-
/* @__PURE__ */ jsxs3("tbody", {
|
|
761
|
-
className: "text-muted-foreground",
|
|
762
|
-
children: [
|
|
763
|
-
/* @__PURE__ */ jsxs3("tr", {
|
|
764
|
-
className: "border-white/5 border-b",
|
|
765
|
-
children: [
|
|
766
|
-
/* @__PURE__ */ jsx3("td", {
|
|
767
|
-
className: "py-2",
|
|
768
|
-
children: "An API endpoint that changes data"
|
|
769
|
-
}),
|
|
770
|
-
/* @__PURE__ */ jsx3("td", {
|
|
771
|
-
className: "py-2",
|
|
772
|
-
children: /* @__PURE__ */ jsx3("code", {
|
|
773
|
-
children: "defineCommand"
|
|
774
|
-
})
|
|
775
|
-
})
|
|
776
|
-
]
|
|
777
|
-
}),
|
|
778
|
-
/* @__PURE__ */ jsxs3("tr", {
|
|
779
|
-
className: "border-white/5 border-b",
|
|
780
|
-
children: [
|
|
781
|
-
/* @__PURE__ */ jsx3("td", {
|
|
782
|
-
className: "py-2",
|
|
783
|
-
children: "An API endpoint that reads data"
|
|
784
|
-
}),
|
|
785
|
-
/* @__PURE__ */ jsx3("td", {
|
|
786
|
-
className: "py-2",
|
|
787
|
-
children: /* @__PURE__ */ jsx3("code", {
|
|
788
|
-
children: "defineQuery"
|
|
789
|
-
})
|
|
790
|
-
})
|
|
791
|
-
]
|
|
792
|
-
}),
|
|
793
|
-
/* @__PURE__ */ jsxs3("tr", {
|
|
794
|
-
className: "border-white/5 border-b",
|
|
795
|
-
children: [
|
|
796
|
-
/* @__PURE__ */ jsx3("td", {
|
|
797
|
-
className: "py-2",
|
|
798
|
-
children: "Async notification of something that happened"
|
|
799
|
-
}),
|
|
800
|
-
/* @__PURE__ */ jsx3("td", {
|
|
801
|
-
className: "py-2",
|
|
802
|
-
children: /* @__PURE__ */ jsx3("code", {
|
|
803
|
-
children: "defineEvent"
|
|
804
|
-
})
|
|
805
|
-
})
|
|
806
|
-
]
|
|
807
|
-
}),
|
|
808
|
-
/* @__PURE__ */ jsxs3("tr", {
|
|
809
|
-
className: "border-white/5 border-b",
|
|
810
|
-
children: [
|
|
811
|
-
/* @__PURE__ */ jsx3("td", {
|
|
812
|
-
className: "py-2",
|
|
813
|
-
children: "Group related specs under a feature"
|
|
814
|
-
}),
|
|
815
|
-
/* @__PURE__ */ jsx3("td", {
|
|
816
|
-
className: "py-2",
|
|
817
|
-
children: /* @__PURE__ */ jsx3("code", {
|
|
818
|
-
children: "defineCapability"
|
|
819
|
-
})
|
|
820
|
-
})
|
|
821
|
-
]
|
|
822
|
-
}),
|
|
823
|
-
/* @__PURE__ */ jsxs3("tr", {
|
|
824
|
-
className: "border-white/5 border-b",
|
|
825
|
-
children: [
|
|
826
|
-
/* @__PURE__ */ jsx3("td", {
|
|
827
|
-
className: "py-2",
|
|
828
|
-
children: "Define UI rendering specifications"
|
|
829
|
-
}),
|
|
830
|
-
/* @__PURE__ */ jsx3("td", {
|
|
831
|
-
className: "py-2",
|
|
832
|
-
children: /* @__PURE__ */ jsx3("code", {
|
|
833
|
-
children: "definePresentation"
|
|
834
|
-
})
|
|
835
|
-
})
|
|
836
|
-
]
|
|
837
|
-
}),
|
|
838
|
-
/* @__PURE__ */ jsxs3("tr", {
|
|
839
|
-
className: "border-white/5 border-b",
|
|
840
|
-
children: [
|
|
841
|
-
/* @__PURE__ */ jsx3("td", {
|
|
842
|
-
className: "py-2",
|
|
843
|
-
children: "Access control and rate limiting"
|
|
844
|
-
}),
|
|
845
|
-
/* @__PURE__ */ jsx3("td", {
|
|
846
|
-
className: "py-2",
|
|
847
|
-
children: /* @__PURE__ */ jsx3("code", {
|
|
848
|
-
children: "definePolicy"
|
|
849
|
-
})
|
|
850
|
-
})
|
|
851
|
-
]
|
|
852
|
-
}),
|
|
853
|
-
/* @__PURE__ */ jsxs3("tr", {
|
|
854
|
-
children: [
|
|
855
|
-
/* @__PURE__ */ jsx3("td", {
|
|
856
|
-
className: "py-2",
|
|
857
|
-
children: "Multi-step business processes"
|
|
858
|
-
}),
|
|
859
|
-
/* @__PURE__ */ jsx3("td", {
|
|
860
|
-
className: "py-2",
|
|
861
|
-
children: /* @__PURE__ */ jsx3("code", {
|
|
862
|
-
children: "defineWorkflow"
|
|
863
|
-
})
|
|
864
|
-
})
|
|
865
|
-
]
|
|
866
|
-
})
|
|
867
|
-
]
|
|
868
|
-
})
|
|
869
|
-
]
|
|
870
|
-
})
|
|
871
|
-
]
|
|
872
|
-
}),
|
|
873
|
-
/* @__PURE__ */ jsx3(StudioPrompt, {
|
|
874
|
-
title: "Need to decide which contract should change next?",
|
|
875
|
-
body: "Studio uses evidence and focus constraints to generate decision briefs, patch intents, and execution-ready task packs."
|
|
876
|
-
})
|
|
877
|
-
]
|
|
878
|
-
}),
|
|
879
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
880
|
-
className: "flex items-center gap-4 pt-4",
|
|
881
|
-
children: [
|
|
882
|
-
/* @__PURE__ */ jsxs3(Link3, {
|
|
883
|
-
href: "/docs/guides/nextjs-one-endpoint",
|
|
884
|
-
className: "btn-primary",
|
|
885
|
-
children: [
|
|
886
|
-
"Next: Add your first endpoint ",
|
|
887
|
-
/* @__PURE__ */ jsx3(ChevronRight2, {
|
|
888
|
-
size: 16
|
|
889
|
-
})
|
|
890
|
-
]
|
|
891
|
-
}),
|
|
892
|
-
/* @__PURE__ */ jsx3(Link3, {
|
|
893
|
-
href: "/docs/guides",
|
|
894
|
-
className: "btn-ghost",
|
|
895
|
-
children: "Back to guides"
|
|
896
|
-
})
|
|
897
|
-
]
|
|
898
|
-
})
|
|
899
|
-
]
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
// src/components/docs/guides/GuideDocsPipelinePage.tsx
|
|
904
|
-
import { CodeBlock as CodeBlock3 } from "@contractspec/lib.design-system";
|
|
905
|
-
import Link4 from "@contractspec/lib.ui-link";
|
|
906
|
-
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
907
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
908
|
-
function GuideDocsPipelinePage() {
|
|
909
|
-
return /* @__PURE__ */ jsxs4("div", {
|
|
910
|
-
className: "space-y-8",
|
|
911
|
-
children: [
|
|
912
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
913
|
-
className: "space-y-3",
|
|
914
|
-
children: [
|
|
915
|
-
/* @__PURE__ */ jsx4("h1", {
|
|
916
|
-
className: "font-bold text-4xl",
|
|
917
|
-
children: "Build the docs pipeline"
|
|
918
|
-
}),
|
|
919
|
-
/* @__PURE__ */ jsx4("p", {
|
|
920
|
-
className: "text-lg text-muted-foreground",
|
|
921
|
-
children: "Generate reference docs, chunk the index, and wire the docs pages the same way this repo does."
|
|
922
|
-
})
|
|
923
|
-
]
|
|
924
|
-
}),
|
|
925
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
926
|
-
className: "card-subtle space-y-4 p-6",
|
|
927
|
-
children: [
|
|
928
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
929
|
-
className: "font-bold text-2xl",
|
|
930
|
-
children: "What you'll build"
|
|
931
|
-
}),
|
|
932
|
-
/* @__PURE__ */ jsxs4("ul", {
|
|
933
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
934
|
-
children: [
|
|
935
|
-
/* @__PURE__ */ jsx4("li", {
|
|
936
|
-
children: "Generated Markdown and a chunked index manifest."
|
|
937
|
-
}),
|
|
938
|
-
/* @__PURE__ */ jsx4("li", {
|
|
939
|
-
children: "Reference routes powered by the docs loader."
|
|
940
|
-
}),
|
|
941
|
-
/* @__PURE__ */ jsx4("li", {
|
|
942
|
-
children: "Versioned outputs you can publish per release."
|
|
943
|
-
})
|
|
944
|
-
]
|
|
945
|
-
})
|
|
946
|
-
]
|
|
947
|
-
}),
|
|
948
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
949
|
-
className: "space-y-6",
|
|
950
|
-
children: [
|
|
951
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
952
|
-
className: "space-y-3",
|
|
953
|
-
children: [
|
|
954
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
955
|
-
className: "font-bold text-2xl",
|
|
956
|
-
children: "1) Generate contract docs"
|
|
957
|
-
}),
|
|
958
|
-
/* @__PURE__ */ jsx4(CodeBlock3, {
|
|
959
|
-
language: "bash",
|
|
960
|
-
filename: "generate-contract-docs",
|
|
961
|
-
code: `contractspec generate`
|
|
962
|
-
}),
|
|
963
|
-
/* @__PURE__ */ jsxs4("p", {
|
|
964
|
-
className: "text-muted-foreground text-sm",
|
|
965
|
-
children: [
|
|
966
|
-
"Expected output: Markdown in ",
|
|
967
|
-
/* @__PURE__ */ jsx4("code", {
|
|
968
|
-
children: "generated/docs"
|
|
969
|
-
}),
|
|
970
|
-
"."
|
|
971
|
-
]
|
|
972
|
-
})
|
|
973
|
-
]
|
|
974
|
-
}),
|
|
975
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
976
|
-
className: "space-y-3",
|
|
977
|
-
children: [
|
|
978
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
979
|
-
className: "font-bold text-2xl",
|
|
980
|
-
children: "2) Build the docs index"
|
|
981
|
-
}),
|
|
982
|
-
/* @__PURE__ */ jsx4(CodeBlock3, {
|
|
983
|
-
language: "bash",
|
|
984
|
-
filename: "docs-generate",
|
|
985
|
-
code: `bun docs:generate
|
|
247
|
+
capabilityRegistry.register(UserManagementCapability);`})]}),o("div",{className:"card-subtle space-y-3 p-6",children:[t("h3",{className:"font-semibold text-lg",children:"Contract Type Decision Guide"}),o("table",{className:"w-full text-sm",children:[t("thead",{children:o("tr",{className:"border-white/10 border-b",children:[t("th",{className:"py-2 text-left",children:"When you need..."}),t("th",{className:"py-2 text-left",children:"Use this contract"})]})}),o("tbody",{className:"text-muted-foreground",children:[o("tr",{className:"border-white/5 border-b",children:[t("td",{className:"py-2",children:"An API endpoint that changes data"}),t("td",{className:"py-2",children:t("code",{children:"defineCommand"})})]}),o("tr",{className:"border-white/5 border-b",children:[t("td",{className:"py-2",children:"An API endpoint that reads data"}),t("td",{className:"py-2",children:t("code",{children:"defineQuery"})})]}),o("tr",{className:"border-white/5 border-b",children:[t("td",{className:"py-2",children:"Async notification of something that happened"}),t("td",{className:"py-2",children:t("code",{children:"defineEvent"})})]}),o("tr",{className:"border-white/5 border-b",children:[t("td",{className:"py-2",children:"Group related specs under a feature"}),t("td",{className:"py-2",children:t("code",{children:"defineCapability"})})]}),o("tr",{className:"border-white/5 border-b",children:[t("td",{className:"py-2",children:"Define UI rendering specifications"}),t("td",{className:"py-2",children:t("code",{children:"definePresentation"})})]}),o("tr",{className:"border-white/5 border-b",children:[t("td",{className:"py-2",children:"Access control and rate limiting"}),t("td",{className:"py-2",children:t("code",{children:"definePolicy"})})]}),o("tr",{children:[t("td",{className:"py-2",children:"Multi-step business processes"}),t("td",{className:"py-2",children:t("code",{children:"defineWorkflow"})})]})]})]})]}),t(g,{title:"Need to decide which contract should change next?",body:"Studio uses evidence and focus constraints to generate decision briefs, patch intents, and execution-ready task packs."})]}),o("div",{className:"flex items-center gap-4 pt-4",children:[o(W,{href:"/docs/guides/nextjs-one-endpoint",className:"btn-primary",children:["Next: Add your first endpoint ",t(ae,{size:16})]}),t(W,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as U}from"@contractspec/lib.design-system";import H from"@contractspec/lib.ui-link";import{ChevronRight as de}from"lucide-react";import{jsx as p,jsxs as f}from"react/jsx-runtime";function le(){return f("div",{className:"space-y-8",children:[f("div",{className:"space-y-3",children:[p("h1",{className:"font-bold text-4xl",children:"Build the docs pipeline"}),p("p",{className:"text-lg text-muted-foreground",children:"Generate reference docs, chunk the index, and wire the docs pages the same way this repo does."})]}),f("div",{className:"card-subtle space-y-4 p-6",children:[p("h2",{className:"font-bold text-2xl",children:"What you'll build"}),f("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[p("li",{children:"Generated Markdown and a chunked index manifest."}),p("li",{children:"Reference routes powered by the docs loader."}),p("li",{children:"Versioned outputs you can publish per release."})]})]}),f("div",{className:"space-y-6",children:[f("div",{className:"space-y-3",children:[p("h2",{className:"font-bold text-2xl",children:"1) Generate contract docs"}),p(U,{language:"bash",filename:"generate-contract-docs",code:"contractspec generate"}),f("p",{className:"text-muted-foreground text-sm",children:["Expected output: Markdown in ",p("code",{children:"generated/docs"}),"."]})]}),f("div",{className:"space-y-3",children:[p("h2",{className:"font-bold text-2xl",children:"2) Build the docs index"}),p(U,{language:"bash",filename:"docs-generate",code:`bun docs:generate
|
|
986
248
|
# versioned output
|
|
987
|
-
bun docs:generate -- --version v1.0.0`
|
|
988
|
-
}),
|
|
989
|
-
/* @__PURE__ */ jsxs4("p", {
|
|
990
|
-
className: "text-muted-foreground text-sm",
|
|
991
|
-
children: [
|
|
992
|
-
"This writes ",
|
|
993
|
-
/* @__PURE__ */ jsx4("code", {
|
|
994
|
-
children: "docs-index.manifest.json"
|
|
995
|
-
}),
|
|
996
|
-
" and chunked",
|
|
997
|
-
/* @__PURE__ */ jsx4("code", {
|
|
998
|
-
children: "docs-index.*.json"
|
|
999
|
-
}),
|
|
1000
|
-
" files in the generated docs bundle."
|
|
1001
|
-
]
|
|
1002
|
-
})
|
|
1003
|
-
]
|
|
1004
|
-
}),
|
|
1005
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
1006
|
-
className: "space-y-3",
|
|
1007
|
-
children: [
|
|
1008
|
-
/* @__PURE__ */ jsx4("h2", {
|
|
1009
|
-
className: "font-bold text-2xl",
|
|
1010
|
-
children: "3) Wire reference routes"
|
|
1011
|
-
}),
|
|
1012
|
-
/* @__PURE__ */ jsx4(CodeBlock3, {
|
|
1013
|
-
language: "tsx",
|
|
1014
|
-
filename: "docs-reference-route",
|
|
1015
|
-
code: `import { notFound } from "next/navigation";
|
|
249
|
+
bun docs:generate -- --version v1.0.0`}),f("p",{className:"text-muted-foreground text-sm",children:["This writes ",p("code",{children:"docs-index.manifest.json"})," and chunked",p("code",{children:"docs-index.*.json"})," files in the generated docs bundle."]})]}),f("div",{className:"space-y-3",children:[p("h2",{className:"font-bold text-2xl",children:"3) Wire reference routes"}),p(U,{language:"tsx",filename:"docs-reference-route",code:`import { notFound } from "next/navigation";
|
|
1016
250
|
import {
|
|
1017
251
|
DocsReferenceIndexPage,
|
|
1018
252
|
DocsReferencePage,
|
|
@@ -1030,474 +264,159 @@ export default async function Page({ params }: { params: { slug?: string[] } })
|
|
|
1030
264
|
const doc = await getGeneratedDocById(slug);
|
|
1031
265
|
if (!doc) notFound();
|
|
1032
266
|
return <DocsReferencePage entry={doc.entry} content={doc.content} />;
|
|
1033
|
-
}`
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
/* @__PURE__ */ jsxs4(Link4, {
|
|
1077
|
-
href: "/docs/guides/ci-contract-diff-gating",
|
|
1078
|
-
className: "btn-primary",
|
|
1079
|
-
children: [
|
|
1080
|
-
"Next: CI gating ",
|
|
1081
|
-
/* @__PURE__ */ jsx4(ChevronRight3, {
|
|
1082
|
-
size: 16
|
|
1083
|
-
})
|
|
1084
|
-
]
|
|
1085
|
-
}),
|
|
1086
|
-
/* @__PURE__ */ jsx4(Link4, {
|
|
1087
|
-
href: "/docs/guides",
|
|
1088
|
-
className: "btn-ghost",
|
|
1089
|
-
children: "Back to guides"
|
|
1090
|
-
})
|
|
1091
|
-
]
|
|
1092
|
-
})
|
|
1093
|
-
]
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
267
|
+
}`}),f("p",{className:"text-muted-foreground text-sm",children:["Use the index page on ",p("code",{children:"/docs/reference"})," to render the searchable list."]})]}),f("div",{className:"card-subtle space-y-3 p-6",children:[p("h3",{className:"font-semibold text-lg",children:"Repo reference"}),f("p",{className:"text-muted-foreground text-sm",children:["This repo wires docs under"," ",p("code",{children:"packages/apps/web-landing/src/app/docs/reference"}),"."]})]}),p(g,{title:"Need decision-to-export automation?",body:"Studio exports evidence-backed spec changes and task packs to Linear, Jira, Notion, and GitHub."})]}),f("div",{className:"flex items-center gap-4 pt-4",children:[f(H,{href:"/docs/guides/ci-contract-diff-gating",className:"btn-primary",children:["Next: CI gating ",p(de,{size:16})]}),p(H,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as D}from"@contractspec/lib.design-system";import z from"@contractspec/lib.ui-link";import{ChevronRight as pe}from"lucide-react";import{jsx as s,jsxs as C}from"react/jsx-runtime";function me(){return C("div",{className:"space-y-8",children:[C("div",{className:"space-y-3",children:[s("h1",{className:"font-bold text-4xl",children:"Build a first module bundle"}),s("p",{className:"text-lg text-muted-foreground",children:"Define one bundle spec, resolve it for a real route and preference profile, then render the resulting surface plan through the React host layer."})]}),C("div",{className:"card-subtle space-y-4 p-6",children:[s("h2",{className:"font-bold text-2xl",children:"What you'll build"}),C("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[s("li",{children:"One `ModuleBundleSpec` with a route and workbench surface."}),s("li",{children:"One `ResolvedSurfacePlan` from `resolveBundle`."}),s("li",{children:"One React host using `BundleProvider` and `BundleRenderer`."})]})]}),C("div",{className:"space-y-6",children:[C("div",{className:"space-y-3",children:[s("h2",{className:"font-bold text-2xl",children:"1) Define the bundle spec"}),s("p",{className:"text-muted-foreground text-sm",children:"The bundle spec is the durable contract. It owns route selection, surface shape, layouts, data recipes, and verification coverage for all seven preference dimensions."}),s(D,{language:"typescript",filename:"src/bundles/support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
|
|
268
|
+
|
|
269
|
+
export const SupportWorkbenchBundle = defineModuleBundle({
|
|
270
|
+
meta: {
|
|
271
|
+
key: "support.workbench",
|
|
272
|
+
version: "0.1.0",
|
|
273
|
+
title: "Support Workbench",
|
|
274
|
+
},
|
|
275
|
+
routes: [
|
|
276
|
+
{
|
|
277
|
+
routeId: "support-ticket",
|
|
278
|
+
path: "/operate/support/tickets/:ticketId",
|
|
279
|
+
defaultSurface: "ticket-workbench",
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
surfaces: {
|
|
283
|
+
"ticket-workbench": {
|
|
284
|
+
surfaceId: "ticket-workbench",
|
|
285
|
+
kind: "workbench",
|
|
286
|
+
slots: [
|
|
287
|
+
{ slotId: "primary", role: "primary", accepts: ["entity-section"], cardinality: "many" },
|
|
288
|
+
{ slotId: "assistant", role: "assistant", accepts: ["assistant-panel"], cardinality: "many", mutableByAi: true, mutableByUser: true },
|
|
289
|
+
],
|
|
290
|
+
layouts: [
|
|
291
|
+
{ layoutId: "balanced", title: "Balanced", root: { type: "slot", slotId: "primary" } },
|
|
292
|
+
],
|
|
293
|
+
data: [
|
|
294
|
+
{ recipeId: "ticket-core", source: { kind: "entity", entityType: "support.ticket" }, hydrateInto: "ticket" },
|
|
295
|
+
],
|
|
296
|
+
verification: {
|
|
297
|
+
dimensions: {
|
|
298
|
+
guidance: "Surface can reveal walkthrough or inline help states.",
|
|
299
|
+
density: "Layout supports compact and balanced detail modes.",
|
|
300
|
+
dataDepth: "Resolver can hydrate summary or detailed ticket context.",
|
|
301
|
+
control: "Advanced actions stay policy-gated.",
|
|
302
|
+
media: "Surface supports text-first and hybrid assist modes.",
|
|
303
|
+
pace: "Transitions and confirmations adapt to operator pace.",
|
|
304
|
+
narrative: "Summary and evidence ordering stay explicit.",
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
});`}),s("p",{className:"text-muted-foreground text-sm",children:"Expected output: `defineModuleBundle` validates the route, surface, and verification dimensions at runtime."})]}),C("div",{className:"space-y-3",children:[s("h2",{className:"font-bold text-2xl",children:"2) Resolve the plan"}),s("p",{className:"text-muted-foreground text-sm",children:"Resolve against a real route, device, and preference profile. This is where the runtime chooses the surface, layout, bindings, and audit reasons."}),s(D,{language:"typescript",filename:"src/runtime/resolve-support-workbench.ts",code:`import { resolveBundle } from "@contractspec/lib.surface-runtime/runtime/resolve-bundle";
|
|
1096
310
|
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
children: [
|
|
1129
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1130
|
-
children: "Export docs from your specs."
|
|
1131
|
-
}),
|
|
1132
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1133
|
-
children: "Emit OpenAPI 3.1 for client SDK generation."
|
|
1134
|
-
}),
|
|
1135
|
-
/* @__PURE__ */ jsx5("li", {
|
|
1136
|
-
children: "Keep outputs deterministic with CI validation."
|
|
1137
|
-
})
|
|
1138
|
-
]
|
|
1139
|
-
})
|
|
1140
|
-
]
|
|
1141
|
-
}),
|
|
1142
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1143
|
-
className: "space-y-6",
|
|
1144
|
-
children: [
|
|
1145
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1146
|
-
className: "space-y-3",
|
|
1147
|
-
children: [
|
|
1148
|
-
/* @__PURE__ */ jsx5("h2", {
|
|
1149
|
-
className: "font-bold text-2xl",
|
|
1150
|
-
children: "1) Generate docs"
|
|
1151
|
-
}),
|
|
1152
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1153
|
-
className: "text-muted-foreground text-sm",
|
|
1154
|
-
children: "Use the generator to emit docs from your contracts."
|
|
1155
|
-
}),
|
|
1156
|
-
/* @__PURE__ */ jsx5(CodeBlock4, {
|
|
1157
|
-
language: "bash",
|
|
1158
|
-
filename: "generate-docs",
|
|
1159
|
-
code: `contractspec generate`
|
|
1160
|
-
}),
|
|
1161
|
-
/* @__PURE__ */ jsxs5("p", {
|
|
1162
|
-
className: "text-muted-foreground text-sm",
|
|
1163
|
-
children: [
|
|
1164
|
-
"Expected output: ",
|
|
1165
|
-
/* @__PURE__ */ jsx5("code", {
|
|
1166
|
-
children: "Generate X doc files in generated/docs"
|
|
1167
|
-
}),
|
|
1168
|
-
"."
|
|
1169
|
-
]
|
|
1170
|
-
})
|
|
1171
|
-
]
|
|
1172
|
-
}),
|
|
1173
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1174
|
-
className: "space-y-3",
|
|
1175
|
-
children: [
|
|
1176
|
-
/* @__PURE__ */ jsx5("h2", {
|
|
1177
|
-
className: "font-bold text-2xl",
|
|
1178
|
-
children: "2) Export OpenAPI"
|
|
1179
|
-
}),
|
|
1180
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1181
|
-
className: "text-muted-foreground text-sm",
|
|
1182
|
-
children: "Export an OpenAPI document from your registry module."
|
|
1183
|
-
}),
|
|
1184
|
-
/* @__PURE__ */ jsx5(CodeBlock4, {
|
|
1185
|
-
language: "bash",
|
|
1186
|
-
filename: "openapi-export",
|
|
1187
|
-
code: `contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json`
|
|
1188
|
-
}),
|
|
1189
|
-
/* @__PURE__ */ jsxs5("p", {
|
|
1190
|
-
className: "text-muted-foreground text-sm",
|
|
1191
|
-
children: [
|
|
1192
|
-
"Expected output:",
|
|
1193
|
-
" ",
|
|
1194
|
-
/* @__PURE__ */ jsx5("code", {
|
|
1195
|
-
children: "OpenAPI written to .../generated/openapi.json"
|
|
1196
|
-
}),
|
|
1197
|
-
"."
|
|
1198
|
-
]
|
|
1199
|
-
})
|
|
1200
|
-
]
|
|
1201
|
-
}),
|
|
1202
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1203
|
-
className: "space-y-3",
|
|
1204
|
-
children: [
|
|
1205
|
-
/* @__PURE__ */ jsx5("h2", {
|
|
1206
|
-
className: "font-bold text-2xl",
|
|
1207
|
-
children: "3) Validate specs"
|
|
1208
|
-
}),
|
|
1209
|
-
/* @__PURE__ */ jsx5(CodeBlock4, {
|
|
1210
|
-
language: "bash",
|
|
1211
|
-
filename: "validate-specs",
|
|
1212
|
-
code: `contractspec validate`
|
|
1213
|
-
}),
|
|
1214
|
-
/* @__PURE__ */ jsxs5("p", {
|
|
1215
|
-
className: "text-muted-foreground text-sm",
|
|
1216
|
-
children: [
|
|
1217
|
-
"Expected output: ",
|
|
1218
|
-
/* @__PURE__ */ jsx5("code", {
|
|
1219
|
-
children: "Validation passed"
|
|
1220
|
-
}),
|
|
1221
|
-
"."
|
|
1222
|
-
]
|
|
1223
|
-
})
|
|
1224
|
-
]
|
|
1225
|
-
}),
|
|
1226
|
-
/* @__PURE__ */ jsxs5("div", {
|
|
1227
|
-
className: "card-subtle space-y-3 p-6",
|
|
1228
|
-
children: [
|
|
1229
|
-
/* @__PURE__ */ jsx5("h3", {
|
|
1230
|
-
className: "font-semibold text-lg",
|
|
1231
|
-
children: "Example package"
|
|
1232
|
-
}),
|
|
1233
|
-
/* @__PURE__ */ jsx5("p", {
|
|
1234
|
-
className: "text-muted-foreground text-sm",
|
|
1235
|
-
children: "The Integration Hub example provides a full registry of operations and is a good source for OpenAPI exports."
|
|
1236
|
-
}),
|
|
1237
|
-
/* @__PURE__ */ jsx5(CodeBlock4, {
|
|
1238
|
-
language: "bash",
|
|
1239
|
-
filename: "integration-hub-example",
|
|
1240
|
-
code: `contractspec examples show integration-hub
|
|
311
|
+
export const supportWorkbenchPlan = await resolveBundle(
|
|
312
|
+
SupportWorkbenchBundle,
|
|
313
|
+
{
|
|
314
|
+
tenantId: "tenant_demo",
|
|
315
|
+
workspaceId: "workspace_ops",
|
|
316
|
+
actorId: "user_42",
|
|
317
|
+
route: "/operate/support/tickets/123",
|
|
318
|
+
params: { ticketId: "123" },
|
|
319
|
+
query: {},
|
|
320
|
+
device: "desktop",
|
|
321
|
+
locale: "en",
|
|
322
|
+
preferences: {
|
|
323
|
+
guidance: "hints",
|
|
324
|
+
density: "compact",
|
|
325
|
+
dataDepth: "detailed",
|
|
326
|
+
control: "advanced",
|
|
327
|
+
media: "hybrid",
|
|
328
|
+
pace: "balanced",
|
|
329
|
+
narrative: "top-down",
|
|
330
|
+
},
|
|
331
|
+
capabilities: ["tickets.read", "tickets.update"],
|
|
332
|
+
}
|
|
333
|
+
);`}),s("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `ResolvedSurfacePlan` with `bundleKey`, `surfaceId`, `layoutId`, `bindings`, `adaptation`, and audit reasons."})]}),C("div",{className:"space-y-3",children:[s("h2",{className:"font-bold text-2xl",children:"3) Render the plan"}),s("p",{className:"text-muted-foreground text-sm",children:"The host app renders the resolved plan, not the raw spec. That keeps layout selection, overlays, and AI proposals downstream of the declared bundle contract."}),s(D,{language:"tsx",filename:"src/app/support/SurfaceHost.tsx",code:`import { BundleProvider, BundleRenderer } from "@contractspec/lib.surface-runtime/react";
|
|
334
|
+
|
|
335
|
+
export function SurfaceHost() {
|
|
336
|
+
return (
|
|
337
|
+
<BundleProvider plan={supportWorkbenchPlan}>
|
|
338
|
+
<BundleRenderer assistantSlotId="assistant" />
|
|
339
|
+
</BundleProvider>
|
|
340
|
+
);
|
|
341
|
+
}`}),s("p",{className:"text-muted-foreground text-sm",children:"Expected output: the route renders according to the resolved layout root and slot plan instead of bespoke page assembly."})]}),C("div",{className:"card-subtle space-y-3 p-6",children:[s("h3",{className:"font-semibold text-lg",children:"Verification checks"}),C("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[s("li",{children:"The resolved `surfaceId` matches the route you expected."}),s("li",{children:"The `layoutId` is stable for the active view and preferences."}),s("li",{children:"The plan carries audit reasons and all seven adaptation dimensions."}),s("li",{children:"Assistant or overlay work stays within declared slots."})]})]})]}),C("div",{className:"flex items-center gap-4 pt-4",children:[C(z,{href:"/docs/specs/module-bundles",className:"btn-primary",children:["Back to module bundles ",s(pe,{size:16})]}),s(z,{href:"/docs/specs/overlays",className:"btn-ghost",children:"Next: overlays"})]})]})}import{CodeBlock as T}from"@contractspec/lib.design-system";import V from"@contractspec/lib.ui-link";import{ChevronRight as ue}from"lucide-react";import{jsx as l,jsxs as y}from"react/jsx-runtime";function he(){return y("div",{className:"space-y-8",children:[y("div",{className:"space-y-3",children:[l("h1",{className:"font-bold text-4xl",children:"Generate docs + client schemas"}),l("p",{className:"text-lg text-muted-foreground",children:"Generate docs and OpenAPI output from ContractSpec operations to power SDKs, docs sites, and tooling."})]}),y("div",{className:"card-subtle space-y-4 p-6",children:[l("h2",{className:"font-bold text-2xl",children:"What you'll build"}),y("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[l("li",{children:"Export docs from your specs."}),l("li",{children:"Emit OpenAPI 3.1 for client SDK generation."}),l("li",{children:"Keep outputs deterministic with CI validation."})]})]}),y("div",{className:"space-y-6",children:[y("div",{className:"space-y-3",children:[l("h2",{className:"font-bold text-2xl",children:"1) Generate docs"}),l("p",{className:"text-muted-foreground text-sm",children:"Use the generator to emit docs from your contracts."}),l(T,{language:"bash",filename:"generate-docs",code:"contractspec generate"}),y("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",l("code",{children:"Generate X doc files in generated/docs"}),"."]})]}),y("div",{className:"space-y-3",children:[l("h2",{className:"font-bold text-2xl",children:"2) Export OpenAPI"}),l("p",{className:"text-muted-foreground text-sm",children:"Export an OpenAPI document from your registry module."}),l(T,{language:"bash",filename:"openapi-export",code:"contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json"}),y("p",{className:"text-muted-foreground text-sm",children:["Expected output:"," ",l("code",{children:"OpenAPI written to .../generated/openapi.json"}),"."]})]}),y("div",{className:"space-y-3",children:[l("h2",{className:"font-bold text-2xl",children:"3) Validate specs"}),l(T,{language:"bash",filename:"validate-specs",code:"contractspec validate"}),y("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",l("code",{children:"Validation passed"}),"."]})]}),y("div",{className:"card-subtle space-y-3 p-6",children:[l("h3",{className:"font-semibold text-lg",children:"Example package"}),l("p",{className:"text-muted-foreground text-sm",children:"The Integration Hub example provides a full registry of operations and is a good source for OpenAPI exports."}),l(T,{language:"bash",filename:"integration-hub-example",code:`contractspec examples show integration-hub
|
|
1241
342
|
|
|
1242
343
|
# openapi export against your registry module
|
|
1243
|
-
contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json`
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
className: "btn-ghost",
|
|
1269
|
-
children: "Back to guides"
|
|
1270
|
-
})
|
|
1271
|
-
]
|
|
1272
|
-
})
|
|
1273
|
-
]
|
|
344
|
+
contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json`})]}),l(g,{title:"Want exports tied to product decisions?",body:"Studio compiles approved changes into deliverables and pushes them to your execution stack with full evidence context."})]}),y("div",{className:"flex items-center gap-4 pt-4",children:[y(V,{href:"/docs/guides/docs-generation-pipeline",className:"btn-primary",children:["Next: Docs pipeline ",l(ue,{size:16})]}),l(V,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as I}from"@contractspec/lib.design-system";import Q from"@contractspec/lib.ui-link";import{ChevronRight as fe}from"lucide-react";import{jsx as n,jsxs as v}from"react/jsx-runtime";var ge=["builder.workspace.bootstrap","builder.channel.receiveInbound","builder.blueprint.generate","builder.plan.compile","builder.preview.create","builder.preview.runHarness","builder.export.prepare","builder.export.approve","builder.export.execute"];function ye(){return v("div",{className:"space-y-8",children:[v("div",{className:"space-y-3",children:[n("h1",{className:"font-bold text-4xl",children:"Host the Builder workbench"}),n("p",{className:"text-lg text-muted-foreground",children:"Use the reusable Builder workbench as the desktop control surface for snapshot loading, guided authoring, preview, readiness, export, and mobile review handoff."})]}),v("div",{className:"card-subtle space-y-4 p-6",children:[n("h2",{className:"font-bold text-2xl",children:"What you'll build"}),v("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[n("li",{children:"A workspace snapshot fetch path."}),n("li",{children:"A `BuilderWorkbench` host with action callbacks."}),n("li",{children:"Runtime-mode aware preview/export controls plus mobile review links."})]})]}),v("div",{className:"space-y-6",children:[v("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"1) Fetch the workspace snapshot"}),n("p",{className:"text-muted-foreground text-sm",children:"The web shell already exposes a query path for the current Builder workspace snapshot. Your host should load it first, then refresh it after each successful command."}),n(I,{language:"typescript",filename:"builder-workbench-controller.ts",code:`export async function fetchBuilderSnapshot(workspaceId: string) {
|
|
345
|
+
const response = await fetch(
|
|
346
|
+
\`/api/operate/builder/queries/builder.workspace.snapshot?workspaceId=\${encodeURIComponent(workspaceId)}\`,
|
|
347
|
+
{ cache: "no-store" }
|
|
348
|
+
);
|
|
349
|
+
if (!response.ok) {
|
|
350
|
+
throw new Error("Failed to fetch Builder workspace snapshot.");
|
|
351
|
+
}
|
|
352
|
+
const payload = await response.json() as {
|
|
353
|
+
ok: boolean;
|
|
354
|
+
result: BuilderWorkspaceSnapshot;
|
|
355
|
+
};
|
|
356
|
+
if (!payload.ok) {
|
|
357
|
+
throw new Error("Builder workspace snapshot query returned an error.");
|
|
358
|
+
}
|
|
359
|
+
return payload.result;
|
|
360
|
+
}`}),n("p",{className:"text-muted-foreground text-sm",children:"Expected output: one `BuilderWorkspaceSnapshot` containing workspace, plan, providers, runtime targets, preview, export, and mobile review state."})]}),v("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"2) Host the workbench and refresh on action"}),n("p",{className:"text-muted-foreground text-sm",children:"The simplest host pattern is local state plus a small action wrapper that executes one Builder command and then refreshes the snapshot."}),n(I,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import {
|
|
361
|
+
BuilderWorkbench,
|
|
362
|
+
useBuilderWorkbenchState,
|
|
363
|
+
} from "@contractspec/module.builder-workbench/presentation";
|
|
364
|
+
|
|
365
|
+
const { snapshot, setSnapshot, promptDraft, setPromptDraft } =
|
|
366
|
+
useBuilderWorkbenchState({
|
|
367
|
+
workspace: initialSnapshot.workspace,
|
|
368
|
+
initialSnapshot,
|
|
1274
369
|
});
|
|
370
|
+
|
|
371
|
+
async function runAction(commandKey: string, payload?: Record<string, unknown>) {
|
|
372
|
+
await executeBuilderCommand({ commandKey, workspaceId, payload });
|
|
373
|
+
setSnapshot(await fetchBuilderSnapshot(workspaceId));
|
|
1275
374
|
}
|
|
1276
375
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
FileCode,
|
|
1284
|
-
Scan,
|
|
1285
|
-
Settings
|
|
1286
|
-
} from "lucide-react";
|
|
1287
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1288
|
-
var supportedFrameworks = [
|
|
1289
|
-
{
|
|
1290
|
-
name: "NestJS",
|
|
1291
|
-
flag: "nestjs",
|
|
1292
|
-
description: "Controllers, decorators, DTOs"
|
|
1293
|
-
},
|
|
1294
|
-
{
|
|
1295
|
-
name: "Express",
|
|
1296
|
-
flag: "express",
|
|
1297
|
-
description: "Router methods, middleware"
|
|
1298
|
-
},
|
|
1299
|
-
{
|
|
1300
|
-
name: "Fastify",
|
|
1301
|
-
flag: "fastify",
|
|
1302
|
-
description: "Route definitions, schemas"
|
|
1303
|
-
},
|
|
1304
|
-
{
|
|
1305
|
-
name: "Hono",
|
|
1306
|
-
flag: "hono",
|
|
1307
|
-
description: "Route handlers, validators"
|
|
1308
|
-
},
|
|
1309
|
-
{
|
|
1310
|
-
name: "Elysia",
|
|
1311
|
-
flag: "elysia",
|
|
1312
|
-
description: "Type-safe routes, schemas"
|
|
1313
|
-
},
|
|
1314
|
-
{
|
|
1315
|
-
name: "tRPC",
|
|
1316
|
-
flag: "trpc",
|
|
1317
|
-
description: "Procedure definitions"
|
|
1318
|
-
},
|
|
1319
|
-
{
|
|
1320
|
-
name: "Next.js",
|
|
1321
|
-
flag: "next-api",
|
|
1322
|
-
description: "API routes (app/api, pages/api)"
|
|
376
|
+
<BuilderWorkbench
|
|
377
|
+
snapshot={snapshot}
|
|
378
|
+
promptDraft={promptDraft}
|
|
379
|
+
onPromptDraftChange={setPromptDraft}
|
|
380
|
+
onCapturePrompt={() =>
|
|
381
|
+
runAction("builder.channel.receiveInbound", createPromptEnvelope(workspaceId, promptDraft))
|
|
1323
382
|
}
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
}),
|
|
1355
|
-
/* @__PURE__ */ jsx6("li", {
|
|
1356
|
-
children: "Framework-specific patterns and auto-detection."
|
|
1357
|
-
}),
|
|
1358
|
-
/* @__PURE__ */ jsx6("li", {
|
|
1359
|
-
children: "Customizing imports with scopes, dry-run, and output options."
|
|
1360
|
-
}),
|
|
1361
|
-
/* @__PURE__ */ jsx6("li", {
|
|
1362
|
-
children: "Registering imported contracts and adding handlers."
|
|
1363
|
-
})
|
|
1364
|
-
]
|
|
1365
|
-
})
|
|
1366
|
-
]
|
|
1367
|
-
}),
|
|
1368
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1369
|
-
className: "space-y-6",
|
|
1370
|
-
children: [
|
|
1371
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1372
|
-
className: "space-y-3",
|
|
1373
|
-
children: [
|
|
1374
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1375
|
-
className: "font-bold text-2xl",
|
|
1376
|
-
children: "Why import existing code?"
|
|
1377
|
-
}),
|
|
1378
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1379
|
-
className: "text-muted-foreground text-sm",
|
|
1380
|
-
children: "Instead of writing contracts from scratch, the import command extracts endpoint patterns from your existing codebase. This gives you:"
|
|
1381
|
-
}),
|
|
1382
|
-
/* @__PURE__ */ jsxs6("ul", {
|
|
1383
|
-
className: "list-disc space-y-1 pl-5 text-muted-foreground text-sm",
|
|
1384
|
-
children: [
|
|
1385
|
-
/* @__PURE__ */ jsx6("li", {
|
|
1386
|
-
children: "Instant spec coverage for existing APIs"
|
|
1387
|
-
}),
|
|
1388
|
-
/* @__PURE__ */ jsx6("li", {
|
|
1389
|
-
children: "Type-safe schemas derived from your existing types"
|
|
1390
|
-
}),
|
|
1391
|
-
/* @__PURE__ */ jsx6("li", {
|
|
1392
|
-
children: "A foundation to iterate and refine contracts"
|
|
1393
|
-
}),
|
|
1394
|
-
/* @__PURE__ */ jsx6("li", {
|
|
1395
|
-
children: "Gradual adoption without rewriting code"
|
|
1396
|
-
})
|
|
1397
|
-
]
|
|
1398
|
-
})
|
|
1399
|
-
]
|
|
1400
|
-
}),
|
|
1401
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1402
|
-
className: "space-y-3",
|
|
1403
|
-
children: [
|
|
1404
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1405
|
-
className: "font-bold text-2xl",
|
|
1406
|
-
children: "Supported frameworks"
|
|
1407
|
-
}),
|
|
1408
|
-
/* @__PURE__ */ jsx6("div", {
|
|
1409
|
-
className: "grid gap-3 md:grid-cols-2 lg:grid-cols-3",
|
|
1410
|
-
children: supportedFrameworks.map((fw) => /* @__PURE__ */ jsxs6("div", {
|
|
1411
|
-
className: "flex items-start gap-3 rounded-lg border border-white/10 p-4",
|
|
1412
|
-
children: [
|
|
1413
|
-
/* @__PURE__ */ jsx6(FileCode, {
|
|
1414
|
-
className: "text-violet-400",
|
|
1415
|
-
size: 18
|
|
1416
|
-
}),
|
|
1417
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1418
|
-
className: "space-y-1",
|
|
1419
|
-
children: [
|
|
1420
|
-
/* @__PURE__ */ jsx6("h3", {
|
|
1421
|
-
className: "font-semibold",
|
|
1422
|
-
children: fw.name
|
|
1423
|
-
}),
|
|
1424
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1425
|
-
className: "text-muted-foreground text-xs",
|
|
1426
|
-
children: fw.description
|
|
1427
|
-
}),
|
|
1428
|
-
/* @__PURE__ */ jsxs6("code", {
|
|
1429
|
-
className: "text-violet-400 text-xs",
|
|
1430
|
-
children: [
|
|
1431
|
-
"--framework ",
|
|
1432
|
-
fw.flag
|
|
1433
|
-
]
|
|
1434
|
-
})
|
|
1435
|
-
]
|
|
1436
|
-
})
|
|
1437
|
-
]
|
|
1438
|
-
}, fw.flag))
|
|
1439
|
-
})
|
|
1440
|
-
]
|
|
1441
|
-
}),
|
|
1442
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1443
|
-
className: "space-y-3",
|
|
1444
|
-
children: [
|
|
1445
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1446
|
-
className: "font-bold text-2xl",
|
|
1447
|
-
children: "1) Quick start"
|
|
1448
|
-
}),
|
|
1449
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1450
|
-
className: "text-muted-foreground text-sm",
|
|
1451
|
-
children: "Run the import command to auto-detect your framework and extract endpoints:"
|
|
1452
|
-
}),
|
|
1453
|
-
/* @__PURE__ */ jsx6(CodeBlock5, {
|
|
1454
|
-
language: "bash",
|
|
1455
|
-
filename: "import-quickstart",
|
|
1456
|
-
code: `# Auto-detect framework and import all endpoints
|
|
383
|
+
onGenerateBlueprint={() => runAction("builder.blueprint.generate")}
|
|
384
|
+
onCompilePlan={() => runAction("builder.plan.compile")}
|
|
385
|
+
onCreatePreview={() => runAction("builder.preview.create", { runtimeMode: "hybrid" })}
|
|
386
|
+
onRunReadiness={() => runAction("builder.preview.runHarness")}
|
|
387
|
+
onPrepareExport={() => runAction("builder.export.prepare", { runtimeMode: "hybrid" })}
|
|
388
|
+
onApproveExport={() => runAction("builder.export.approve")}
|
|
389
|
+
onExecuteExport={() => runAction("builder.export.execute")}
|
|
390
|
+
selectedExportRuntimeMode="hybrid"
|
|
391
|
+
/>;`}),n("p",{className:"text-muted-foreground text-sm",children:"Expected output: each successful action leaves the host with a fresh snapshot and keeps the workbench tabs aligned with current runtime state."})]}),v("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"3) Bootstrap providers and routing policy explicitly"}),n("p",{className:"text-muted-foreground text-sm",children:"Builder v3 treats provider routing as policy, not heuristic. Use the workspace bootstrap command as the single managed-first setup path instead of orchestrating provider registration in the app shell."}),n(I,{language:"typescript",filename:"builder-bootstrap.ts",code:`await executeBuilderCommand({
|
|
392
|
+
commandKey: "builder.workspace.bootstrap",
|
|
393
|
+
workspaceId,
|
|
394
|
+
payload: {
|
|
395
|
+
preset: "managed_mvp",
|
|
396
|
+
includeLocalHelperProvider: true,
|
|
397
|
+
},
|
|
398
|
+
});`})]}),v("div",{className:"card-subtle space-y-3 p-6",children:[n("h3",{className:"font-semibold text-lg",children:"Common command keys"}),n("ul",{className:"space-y-2 text-muted-foreground text-sm",children:ge.map((c)=>n("li",{children:n("code",{children:c})},c))})]}),v("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"4) Keep runtime mode explicit"}),n("p",{className:"text-muted-foreground text-sm",children:"Preview and export flows are runtime-mode aware. The host chooses between `managed`, `local`, and `hybrid` and passes that choice into preview or export commands instead of hiding it behind provider selection heuristics."}),n(I,{language:"typescript",filename:"runtime-mode",code:`const [selectedExportRuntimeMode, setSelectedExportRuntimeMode] =
|
|
399
|
+
React.useState(resolveBuilderExportRuntimeMode(initialSnapshot));
|
|
400
|
+
|
|
401
|
+
await executeBuilderCommand({
|
|
402
|
+
commandKey: "builder.preview.create",
|
|
403
|
+
workspaceId,
|
|
404
|
+
payload: {
|
|
405
|
+
runtimeMode: selectedExportRuntimeMode,
|
|
406
|
+
},
|
|
407
|
+
});`})]}),v("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"5) Link mobile review flows"}),n("p",{className:"text-muted-foreground text-sm",children:"When a patch proposal, approval ticket, or incident needs operator follow-up away from the desktop workbench, deep-link into the mobile review route instead of inventing a separate data model."}),n(I,{language:"typescript",filename:"mobile-review-path.ts",code:`export function buildBuilderMobileReviewPath(
|
|
408
|
+
workspaceId: string,
|
|
409
|
+
cardId: string
|
|
410
|
+
) {
|
|
411
|
+
return \`/operate/builder/workspaces/\${encodeURIComponent(workspaceId)}/mobile-review/\${encodeURIComponent(cardId)}\`;
|
|
412
|
+
}`}),n("p",{className:"text-muted-foreground text-sm",children:"Expected output: the same Builder workspace state stays visible from desktop workbench and mobile review surfaces."})]}),v("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"6) Keep Connect adjacent, not embedded"}),n("p",{className:"text-muted-foreground text-sm",children:"Builder owns the authoring control plane. When Builder delegates into coding repositories, enable Connect in those target workspaces for context packs, mutation verification, replay, and review packets, but do not replace Builder contracts with Connect artifacts."}),n(I,{language:"bash",filename:"connect-init.sh",code:"contractspec connect init --scope workspace"})]})]}),v("div",{className:"flex items-center gap-4 pt-4",children:[v(Q,{href:"/docs/specs/builder-control-plane",className:"btn-primary",children:["Back to Builder control plane ",n(fe,{size:16})]}),n(Q,{href:"/docs/studio",className:"btn-ghost",children:"Studio overview"})]})]})}import{CodeBlock as S}from"@contractspec/lib.design-system";import q from"@contractspec/lib.ui-link";import{AlertCircle as ve,ChevronRight as be,FileCode as Ne,Scan as M,Settings as ke}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";var we=[{name:"NestJS",flag:"nestjs",description:"Controllers, decorators, DTOs"},{name:"Express",flag:"express",description:"Router methods, middleware"},{name:"Fastify",flag:"fastify",description:"Route definitions, schemas"},{name:"Hono",flag:"hono",description:"Route handlers, validators"},{name:"Elysia",flag:"elysia",description:"Type-safe routes, schemas"},{name:"tRPC",flag:"trpc",description:"Procedure definitions"},{name:"Next.js",flag:"next-api",description:"API routes (app/api, pages/api)"}];function Ce(){return a("div",{className:"space-y-8",children:[a("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Import Existing Codebases"}),e("p",{className:"text-lg text-muted-foreground",children:"Convert your existing API endpoints into ContractSpec contracts. Auto-detect frameworks, extract schemas, and generate explicit contract definitions from your code."})]}),a("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll learn"}),a("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"How to import existing API endpoints as ContractSpec contracts."}),e("li",{children:"Framework-specific patterns and auto-detection."}),e("li",{children:"Customizing imports with scopes, dry-run, and output options."}),e("li",{children:"Registering imported contracts and adding handlers."})]})]}),a("div",{className:"space-y-6",children:[a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Why import existing code?"}),e("p",{className:"text-muted-foreground text-sm",children:"Instead of writing contracts from scratch, the import command extracts endpoint patterns from your existing codebase. This gives you:"}),a("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground text-sm",children:[e("li",{children:"Instant spec coverage for existing APIs"}),e("li",{children:"Type-safe schemas derived from your existing types"}),e("li",{children:"A foundation to iterate and refine contracts"}),e("li",{children:"Gradual adoption without rewriting code"})]})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Supported frameworks"}),e("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:we.map((c)=>a("div",{className:"flex items-start gap-3 rounded-lg border border-white/10 p-4",children:[e(Ne,{className:"text-violet-400",size:18}),a("div",{className:"space-y-1",children:[e("h3",{className:"font-semibold",children:c.name}),e("p",{className:"text-muted-foreground text-xs",children:c.description}),a("code",{className:"text-violet-400 text-xs",children:["--framework ",c.flag]})]})]},c.flag))})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Quick start"}),e("p",{className:"text-muted-foreground text-sm",children:"Run the import command to auto-detect your framework and extract endpoints:"}),e(S,{language:"bash",filename:"import-quickstart",code:`# Auto-detect framework and import all endpoints
|
|
1457
413
|
contractspec import ./src
|
|
1458
414
|
|
|
1459
415
|
# Preview what would be imported (dry-run)
|
|
1460
416
|
contractspec import ./src --dry-run
|
|
1461
417
|
|
|
1462
418
|
# Force a specific framework
|
|
1463
|
-
contractspec import ./src --framework nestjs`
|
|
1464
|
-
}),
|
|
1465
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1466
|
-
className: "text-muted-foreground text-sm",
|
|
1467
|
-
children: "Expected output: A summary of endpoints found, schemas extracted, and files generated."
|
|
1468
|
-
})
|
|
1469
|
-
]
|
|
1470
|
-
}),
|
|
1471
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1472
|
-
className: "space-y-3",
|
|
1473
|
-
children: [
|
|
1474
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1475
|
-
className: "font-bold text-2xl",
|
|
1476
|
-
children: "2) Framework-specific patterns"
|
|
1477
|
-
}),
|
|
1478
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1479
|
-
className: "text-muted-foreground text-sm",
|
|
1480
|
-
children: "The import command recognizes these patterns in each framework:"
|
|
1481
|
-
})
|
|
1482
|
-
]
|
|
1483
|
-
}),
|
|
1484
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1485
|
-
className: "space-y-3",
|
|
1486
|
-
children: [
|
|
1487
|
-
/* @__PURE__ */ jsxs6("h3", {
|
|
1488
|
-
className: "flex items-center gap-2 font-semibold text-xl",
|
|
1489
|
-
children: [
|
|
1490
|
-
/* @__PURE__ */ jsx6(Scan, {
|
|
1491
|
-
size: 18,
|
|
1492
|
-
className: "text-blue-400"
|
|
1493
|
-
}),
|
|
1494
|
-
"NestJS"
|
|
1495
|
-
]
|
|
1496
|
-
}),
|
|
1497
|
-
/* @__PURE__ */ jsx6(CodeBlock5, {
|
|
1498
|
-
language: "typescript",
|
|
1499
|
-
filename: "src/users/users.controller.ts (before)",
|
|
1500
|
-
code: `@Controller('users')
|
|
419
|
+
contractspec import ./src --framework nestjs`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: A summary of endpoints found, schemas extracted, and files generated."})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Framework-specific patterns"}),e("p",{className:"text-muted-foreground text-sm",children:"The import command recognizes these patterns in each framework:"})]}),a("div",{className:"space-y-3",children:[a("h3",{className:"flex items-center gap-2 font-semibold text-xl",children:[e(M,{size:18,className:"text-blue-400"}),"NestJS"]}),e(S,{language:"typescript",filename:"src/users/users.controller.ts (before)",code:`@Controller('users')
|
|
1501
420
|
export class UsersController {
|
|
1502
421
|
@Get(':id')
|
|
1503
422
|
async getUser(@Param('id') id: string): Promise<UserDto> {
|
|
@@ -1509,59 +428,7 @@ export class UsersController {
|
|
|
1509
428
|
async createUser(@Body() dto: CreateUserDto): Promise<UserDto> {
|
|
1510
429
|
return this.usersService.create(dto);
|
|
1511
430
|
}
|
|
1512
|
-
}`
|
|
1513
|
-
}),
|
|
1514
|
-
/* @__PURE__ */ jsxs6("p", {
|
|
1515
|
-
className: "text-muted-foreground text-sm",
|
|
1516
|
-
children: [
|
|
1517
|
-
"Detected: ",
|
|
1518
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1519
|
-
children: "@Controller"
|
|
1520
|
-
}),
|
|
1521
|
-
", ",
|
|
1522
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1523
|
-
children: "@Get"
|
|
1524
|
-
}),
|
|
1525
|
-
",",
|
|
1526
|
-
" ",
|
|
1527
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1528
|
-
children: "@Post"
|
|
1529
|
-
}),
|
|
1530
|
-
", ",
|
|
1531
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1532
|
-
children: "@Body"
|
|
1533
|
-
}),
|
|
1534
|
-
", ",
|
|
1535
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1536
|
-
children: "@Param"
|
|
1537
|
-
}),
|
|
1538
|
-
",",
|
|
1539
|
-
" ",
|
|
1540
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1541
|
-
children: "@UseGuards"
|
|
1542
|
-
}),
|
|
1543
|
-
" decorators."
|
|
1544
|
-
]
|
|
1545
|
-
})
|
|
1546
|
-
]
|
|
1547
|
-
}),
|
|
1548
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1549
|
-
className: "space-y-3",
|
|
1550
|
-
children: [
|
|
1551
|
-
/* @__PURE__ */ jsxs6("h3", {
|
|
1552
|
-
className: "flex items-center gap-2 font-semibold text-xl",
|
|
1553
|
-
children: [
|
|
1554
|
-
/* @__PURE__ */ jsx6(Scan, {
|
|
1555
|
-
size: 18,
|
|
1556
|
-
className: "text-green-400"
|
|
1557
|
-
}),
|
|
1558
|
-
"Express"
|
|
1559
|
-
]
|
|
1560
|
-
}),
|
|
1561
|
-
/* @__PURE__ */ jsx6(CodeBlock5, {
|
|
1562
|
-
language: "typescript",
|
|
1563
|
-
filename: "src/routes/users.ts (before)",
|
|
1564
|
-
code: `const router = express.Router();
|
|
431
|
+
}`}),a("p",{className:"text-muted-foreground text-sm",children:["Detected: ",e("code",{children:"@Controller"}),", ",e("code",{children:"@Get"}),","," ",e("code",{children:"@Post"}),", ",e("code",{children:"@Body"}),", ",e("code",{children:"@Param"}),","," ",e("code",{children:"@UseGuards"})," decorators."]})]}),a("div",{className:"space-y-3",children:[a("h3",{className:"flex items-center gap-2 font-semibold text-xl",children:[e(M,{size:18,className:"text-green-400"}),"Express"]}),e(S,{language:"typescript",filename:"src/routes/users.ts (before)",code:`const router = express.Router();
|
|
1565
432
|
|
|
1566
433
|
router.get('/users/:id', async (req, res) => {
|
|
1567
434
|
const user = await getUserById(req.params.id);
|
|
@@ -1571,41 +438,7 @@ router.get('/users/:id', async (req, res) => {
|
|
|
1571
438
|
router.post('/users', validateBody(CreateUserSchema), async (req, res) => {
|
|
1572
439
|
const user = await createUser(req.body);
|
|
1573
440
|
res.status(201).json(user);
|
|
1574
|
-
});`
|
|
1575
|
-
}),
|
|
1576
|
-
/* @__PURE__ */ jsxs6("p", {
|
|
1577
|
-
className: "text-muted-foreground text-sm",
|
|
1578
|
-
children: [
|
|
1579
|
-
"Detected: ",
|
|
1580
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1581
|
-
children: "router.get"
|
|
1582
|
-
}),
|
|
1583
|
-
", ",
|
|
1584
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1585
|
-
children: "router.post"
|
|
1586
|
-
}),
|
|
1587
|
-
", validation middleware, Zod schemas."
|
|
1588
|
-
]
|
|
1589
|
-
})
|
|
1590
|
-
]
|
|
1591
|
-
}),
|
|
1592
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1593
|
-
className: "space-y-3",
|
|
1594
|
-
children: [
|
|
1595
|
-
/* @__PURE__ */ jsxs6("h3", {
|
|
1596
|
-
className: "flex items-center gap-2 font-semibold text-xl",
|
|
1597
|
-
children: [
|
|
1598
|
-
/* @__PURE__ */ jsx6(Scan, {
|
|
1599
|
-
size: 18,
|
|
1600
|
-
className: "text-purple-400"
|
|
1601
|
-
}),
|
|
1602
|
-
"Next.js API Routes"
|
|
1603
|
-
]
|
|
1604
|
-
}),
|
|
1605
|
-
/* @__PURE__ */ jsx6(CodeBlock5, {
|
|
1606
|
-
language: "typescript",
|
|
1607
|
-
filename: "app/api/users/[id]/route.ts (before)",
|
|
1608
|
-
code: `export async function GET(
|
|
441
|
+
});`}),a("p",{className:"text-muted-foreground text-sm",children:["Detected: ",e("code",{children:"router.get"}),", ",e("code",{children:"router.post"}),", validation middleware, Zod schemas."]})]}),a("div",{className:"space-y-3",children:[a("h3",{className:"flex items-center gap-2 font-semibold text-xl",children:[e(M,{size:18,className:"text-purple-400"}),"Next.js API Routes"]}),e(S,{language:"typescript",filename:"app/api/users/[id]/route.ts (before)",code:`export async function GET(
|
|
1609
442
|
request: Request,
|
|
1610
443
|
{ params }: { params: { id: string } }
|
|
1611
444
|
) {
|
|
@@ -1617,48 +450,7 @@ export async function POST(request: Request) {
|
|
|
1617
450
|
const body = await request.json();
|
|
1618
451
|
const user = await createUser(body);
|
|
1619
452
|
return Response.json(user, { status: 201 });
|
|
1620
|
-
}`
|
|
1621
|
-
}),
|
|
1622
|
-
/* @__PURE__ */ jsxs6("p", {
|
|
1623
|
-
className: "text-muted-foreground text-sm",
|
|
1624
|
-
children: [
|
|
1625
|
-
"Detected: ",
|
|
1626
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1627
|
-
children: "GET"
|
|
1628
|
-
}),
|
|
1629
|
-
", ",
|
|
1630
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1631
|
-
children: "POST"
|
|
1632
|
-
}),
|
|
1633
|
-
" exports in",
|
|
1634
|
-
" ",
|
|
1635
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1636
|
-
children: "app/api/**/route.ts"
|
|
1637
|
-
}),
|
|
1638
|
-
" and ",
|
|
1639
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1640
|
-
children: "pages/api/**/*.ts"
|
|
1641
|
-
}),
|
|
1642
|
-
"."
|
|
1643
|
-
]
|
|
1644
|
-
})
|
|
1645
|
-
]
|
|
1646
|
-
}),
|
|
1647
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1648
|
-
className: "space-y-3",
|
|
1649
|
-
children: [
|
|
1650
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1651
|
-
className: "font-bold text-2xl",
|
|
1652
|
-
children: "3) Understanding generated contracts"
|
|
1653
|
-
}),
|
|
1654
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1655
|
-
className: "text-muted-foreground text-sm",
|
|
1656
|
-
children: "The import command generates ContractSpec operations with TODO placeholders for fields it cannot infer:"
|
|
1657
|
-
}),
|
|
1658
|
-
/* @__PURE__ */ jsx6(CodeBlock5, {
|
|
1659
|
-
language: "typescript",
|
|
1660
|
-
filename: ".contractspec/generated/users.operation.ts",
|
|
1661
|
-
code: `import { defineQuery, defineCommand } from "@contractspec/lib.contracts-spec";
|
|
453
|
+
}`}),a("p",{className:"text-muted-foreground text-sm",children:["Detected: ",e("code",{children:"GET"}),", ",e("code",{children:"POST"})," exports in"," ",e("code",{children:"app/api/**/route.ts"})," and ",e("code",{children:"pages/api/**/*.ts"}),"."]})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Understanding generated contracts"}),e("p",{className:"text-muted-foreground text-sm",children:"The import command generates ContractSpec operations with TODO placeholders for fields it cannot infer:"}),e(S,{language:"typescript",filename:".contractspec/generated/users.operation.ts",code:`import { defineQuery, defineCommand } from "@contractspec/lib.contracts-spec";
|
|
1662
454
|
import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
1663
455
|
|
|
1664
456
|
export const GetUserQuery = defineQuery({
|
|
@@ -1718,191 +510,7 @@ export const CreateUserCommand = defineCommand({
|
|
|
1718
510
|
transport: {
|
|
1719
511
|
rest: { method: "POST", path: "/users" },
|
|
1720
512
|
},
|
|
1721
|
-
});`
|
|
1722
|
-
})
|
|
1723
|
-
]
|
|
1724
|
-
}),
|
|
1725
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1726
|
-
className: "space-y-3",
|
|
1727
|
-
children: [
|
|
1728
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1729
|
-
className: "font-bold text-2xl",
|
|
1730
|
-
children: "4) Customizing imports"
|
|
1731
|
-
}),
|
|
1732
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1733
|
-
className: "flex items-center gap-2",
|
|
1734
|
-
children: [
|
|
1735
|
-
/* @__PURE__ */ jsx6(Settings, {
|
|
1736
|
-
size: 18,
|
|
1737
|
-
className: "text-violet-400"
|
|
1738
|
-
}),
|
|
1739
|
-
/* @__PURE__ */ jsx6("h3", {
|
|
1740
|
-
className: "font-semibold text-lg",
|
|
1741
|
-
children: "Available options"
|
|
1742
|
-
})
|
|
1743
|
-
]
|
|
1744
|
-
}),
|
|
1745
|
-
/* @__PURE__ */ jsx6("div", {
|
|
1746
|
-
className: "overflow-x-auto",
|
|
1747
|
-
children: /* @__PURE__ */ jsxs6("table", {
|
|
1748
|
-
className: "w-full text-sm",
|
|
1749
|
-
children: [
|
|
1750
|
-
/* @__PURE__ */ jsx6("thead", {
|
|
1751
|
-
children: /* @__PURE__ */ jsxs6("tr", {
|
|
1752
|
-
className: "border-white/10 border-b",
|
|
1753
|
-
children: [
|
|
1754
|
-
/* @__PURE__ */ jsx6("th", {
|
|
1755
|
-
className: "py-2 pr-4 text-left",
|
|
1756
|
-
children: "Option"
|
|
1757
|
-
}),
|
|
1758
|
-
/* @__PURE__ */ jsx6("th", {
|
|
1759
|
-
className: "py-2 pr-4 text-left",
|
|
1760
|
-
children: "Description"
|
|
1761
|
-
}),
|
|
1762
|
-
/* @__PURE__ */ jsx6("th", {
|
|
1763
|
-
className: "py-2 text-left",
|
|
1764
|
-
children: "Example"
|
|
1765
|
-
})
|
|
1766
|
-
]
|
|
1767
|
-
})
|
|
1768
|
-
}),
|
|
1769
|
-
/* @__PURE__ */ jsxs6("tbody", {
|
|
1770
|
-
className: "text-muted-foreground",
|
|
1771
|
-
children: [
|
|
1772
|
-
/* @__PURE__ */ jsxs6("tr", {
|
|
1773
|
-
className: "border-white/5 border-b",
|
|
1774
|
-
children: [
|
|
1775
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1776
|
-
className: "py-2 pr-4",
|
|
1777
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1778
|
-
children: "--scope"
|
|
1779
|
-
})
|
|
1780
|
-
}),
|
|
1781
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1782
|
-
className: "py-2 pr-4",
|
|
1783
|
-
children: "Limit to specific directories"
|
|
1784
|
-
}),
|
|
1785
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1786
|
-
className: "py-2",
|
|
1787
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1788
|
-
children: "--scope src/users src/auth"
|
|
1789
|
-
})
|
|
1790
|
-
})
|
|
1791
|
-
]
|
|
1792
|
-
}),
|
|
1793
|
-
/* @__PURE__ */ jsxs6("tr", {
|
|
1794
|
-
className: "border-white/5 border-b",
|
|
1795
|
-
children: [
|
|
1796
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1797
|
-
className: "py-2 pr-4",
|
|
1798
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1799
|
-
children: "--framework"
|
|
1800
|
-
})
|
|
1801
|
-
}),
|
|
1802
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1803
|
-
className: "py-2 pr-4",
|
|
1804
|
-
children: "Force a specific framework"
|
|
1805
|
-
}),
|
|
1806
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1807
|
-
className: "py-2",
|
|
1808
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1809
|
-
children: "--framework express"
|
|
1810
|
-
})
|
|
1811
|
-
})
|
|
1812
|
-
]
|
|
1813
|
-
}),
|
|
1814
|
-
/* @__PURE__ */ jsxs6("tr", {
|
|
1815
|
-
className: "border-white/5 border-b",
|
|
1816
|
-
children: [
|
|
1817
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1818
|
-
className: "py-2 pr-4",
|
|
1819
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1820
|
-
children: "--output"
|
|
1821
|
-
})
|
|
1822
|
-
}),
|
|
1823
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1824
|
-
className: "py-2 pr-4",
|
|
1825
|
-
children: "Output directory"
|
|
1826
|
-
}),
|
|
1827
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1828
|
-
className: "py-2",
|
|
1829
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1830
|
-
children: "--output ./contracts"
|
|
1831
|
-
})
|
|
1832
|
-
})
|
|
1833
|
-
]
|
|
1834
|
-
}),
|
|
1835
|
-
/* @__PURE__ */ jsxs6("tr", {
|
|
1836
|
-
className: "border-white/5 border-b",
|
|
1837
|
-
children: [
|
|
1838
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1839
|
-
className: "py-2 pr-4",
|
|
1840
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1841
|
-
children: "--dry-run"
|
|
1842
|
-
})
|
|
1843
|
-
}),
|
|
1844
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1845
|
-
className: "py-2 pr-4",
|
|
1846
|
-
children: "Preview without writing files"
|
|
1847
|
-
}),
|
|
1848
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1849
|
-
className: "py-2",
|
|
1850
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1851
|
-
children: "--dry-run"
|
|
1852
|
-
})
|
|
1853
|
-
})
|
|
1854
|
-
]
|
|
1855
|
-
}),
|
|
1856
|
-
/* @__PURE__ */ jsxs6("tr", {
|
|
1857
|
-
className: "border-white/5 border-b",
|
|
1858
|
-
children: [
|
|
1859
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1860
|
-
className: "py-2 pr-4",
|
|
1861
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1862
|
-
children: "--analyze"
|
|
1863
|
-
})
|
|
1864
|
-
}),
|
|
1865
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1866
|
-
className: "py-2 pr-4",
|
|
1867
|
-
children: "Analysis only, no code generation"
|
|
1868
|
-
}),
|
|
1869
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1870
|
-
className: "py-2",
|
|
1871
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1872
|
-
children: "--analyze"
|
|
1873
|
-
})
|
|
1874
|
-
})
|
|
1875
|
-
]
|
|
1876
|
-
}),
|
|
1877
|
-
/* @__PURE__ */ jsxs6("tr", {
|
|
1878
|
-
children: [
|
|
1879
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1880
|
-
className: "py-2 pr-4",
|
|
1881
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1882
|
-
children: "--json"
|
|
1883
|
-
})
|
|
1884
|
-
}),
|
|
1885
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1886
|
-
className: "py-2 pr-4",
|
|
1887
|
-
children: "Output as JSON for scripting"
|
|
1888
|
-
}),
|
|
1889
|
-
/* @__PURE__ */ jsx6("td", {
|
|
1890
|
-
className: "py-2",
|
|
1891
|
-
children: /* @__PURE__ */ jsx6("code", {
|
|
1892
|
-
children: "--json"
|
|
1893
|
-
})
|
|
1894
|
-
})
|
|
1895
|
-
]
|
|
1896
|
-
})
|
|
1897
|
-
]
|
|
1898
|
-
})
|
|
1899
|
-
]
|
|
1900
|
-
})
|
|
1901
|
-
}),
|
|
1902
|
-
/* @__PURE__ */ jsx6(CodeBlock5, {
|
|
1903
|
-
language: "bash",
|
|
1904
|
-
filename: "import-options",
|
|
1905
|
-
code: `# Import only specific modules
|
|
513
|
+
});`})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"4) Customizing imports"}),a("div",{className:"flex items-center gap-2",children:[e(ke,{size:18,className:"text-violet-400"}),e("h3",{className:"font-semibold text-lg",children:"Available options"})]}),e("div",{className:"overflow-x-auto",children:a("table",{className:"w-full text-sm",children:[e("thead",{children:a("tr",{className:"border-white/10 border-b",children:[e("th",{className:"py-2 pr-4 text-left",children:"Option"}),e("th",{className:"py-2 pr-4 text-left",children:"Description"}),e("th",{className:"py-2 text-left",children:"Example"})]})}),a("tbody",{className:"text-muted-foreground",children:[a("tr",{className:"border-white/5 border-b",children:[e("td",{className:"py-2 pr-4",children:e("code",{children:"--scope"})}),e("td",{className:"py-2 pr-4",children:"Limit to specific directories"}),e("td",{className:"py-2",children:e("code",{children:"--scope src/users src/auth"})})]}),a("tr",{className:"border-white/5 border-b",children:[e("td",{className:"py-2 pr-4",children:e("code",{children:"--framework"})}),e("td",{className:"py-2 pr-4",children:"Force a specific framework"}),e("td",{className:"py-2",children:e("code",{children:"--framework express"})})]}),a("tr",{className:"border-white/5 border-b",children:[e("td",{className:"py-2 pr-4",children:e("code",{children:"--output"})}),e("td",{className:"py-2 pr-4",children:"Output directory"}),e("td",{className:"py-2",children:e("code",{children:"--output ./contracts"})})]}),a("tr",{className:"border-white/5 border-b",children:[e("td",{className:"py-2 pr-4",children:e("code",{children:"--dry-run"})}),e("td",{className:"py-2 pr-4",children:"Preview without writing files"}),e("td",{className:"py-2",children:e("code",{children:"--dry-run"})})]}),a("tr",{className:"border-white/5 border-b",children:[e("td",{className:"py-2 pr-4",children:e("code",{children:"--analyze"})}),e("td",{className:"py-2 pr-4",children:"Analysis only, no code generation"}),e("td",{className:"py-2",children:e("code",{children:"--analyze"})})]}),a("tr",{children:[e("td",{className:"py-2 pr-4",children:e("code",{children:"--json"})}),e("td",{className:"py-2 pr-4",children:"Output as JSON for scripting"}),e("td",{className:"py-2",children:e("code",{children:"--json"})})]})]})]})}),e(S,{language:"bash",filename:"import-options",code:`# Import only specific modules
|
|
1906
514
|
contractspec import ./src --scope src/users src/orders
|
|
1907
515
|
|
|
1908
516
|
# Preview with analysis
|
|
@@ -1912,25 +520,7 @@ contractspec import ./src --dry-run --analyze
|
|
|
1912
520
|
contractspec import ./src --output ./src/contracts/generated
|
|
1913
521
|
|
|
1914
522
|
# Get JSON for CI/scripting
|
|
1915
|
-
contractspec import ./src --json > import-result.json`
|
|
1916
|
-
})
|
|
1917
|
-
]
|
|
1918
|
-
}),
|
|
1919
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1920
|
-
className: "space-y-3",
|
|
1921
|
-
children: [
|
|
1922
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1923
|
-
className: "font-bold text-2xl",
|
|
1924
|
-
children: "5) Registering imported contracts"
|
|
1925
|
-
}),
|
|
1926
|
-
/* @__PURE__ */ jsx6("p", {
|
|
1927
|
-
className: "text-muted-foreground text-sm",
|
|
1928
|
-
children: "After import, register contracts and add handlers:"
|
|
1929
|
-
}),
|
|
1930
|
-
/* @__PURE__ */ jsx6(CodeBlock5, {
|
|
1931
|
-
language: "typescript",
|
|
1932
|
-
filename: "src/contracts/registry.ts",
|
|
1933
|
-
code: `import {
|
|
523
|
+
contractspec import ./src --json > import-result.json`})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"5) Registering imported contracts"}),e("p",{className:"text-muted-foreground text-sm",children:"After import, register contracts and add handlers:"}),e(S,{language:"typescript",filename:"src/contracts/registry.ts",code:`import {
|
|
1934
524
|
OperationSpecRegistry,
|
|
1935
525
|
installOp,
|
|
1936
526
|
} from "@contractspec/lib.contracts-spec/operations";
|
|
@@ -1950,271 +540,8 @@ installOp(registry, GetUserQuery, async (input) => {
|
|
|
1950
540
|
installOp(registry, CreateUserCommand, async (input) => {
|
|
1951
541
|
const user = await db.user.create({ data: input });
|
|
1952
542
|
return { id: user.id };
|
|
1953
|
-
});`
|
|
1954
|
-
|
|
1955
|
-
]
|
|
1956
|
-
}),
|
|
1957
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
1958
|
-
className: "space-y-3",
|
|
1959
|
-
children: [
|
|
1960
|
-
/* @__PURE__ */ jsx6("h2", {
|
|
1961
|
-
className: "font-bold text-2xl",
|
|
1962
|
-
children: "6) After importing"
|
|
1963
|
-
}),
|
|
1964
|
-
/* @__PURE__ */ jsxs6("ol", {
|
|
1965
|
-
className: "list-decimal space-y-2 pl-5 text-muted-foreground text-sm",
|
|
1966
|
-
children: [
|
|
1967
|
-
/* @__PURE__ */ jsxs6("li", {
|
|
1968
|
-
children: [
|
|
1969
|
-
/* @__PURE__ */ jsx6("strong", {
|
|
1970
|
-
children: "Review generated contracts"
|
|
1971
|
-
}),
|
|
1972
|
-
" — Check the TODO placeholders and fill in descriptions, owners, and tags."
|
|
1973
|
-
]
|
|
1974
|
-
}),
|
|
1975
|
-
/* @__PURE__ */ jsxs6("li", {
|
|
1976
|
-
children: [
|
|
1977
|
-
/* @__PURE__ */ jsx6("strong", {
|
|
1978
|
-
children: "Refine schemas"
|
|
1979
|
-
}),
|
|
1980
|
-
" — Add proper types, validation rules, and error definitions."
|
|
1981
|
-
]
|
|
1982
|
-
}),
|
|
1983
|
-
/* @__PURE__ */ jsxs6("li", {
|
|
1984
|
-
children: [
|
|
1985
|
-
/* @__PURE__ */ jsx6("strong", {
|
|
1986
|
-
children: "Run validation"
|
|
1987
|
-
}),
|
|
1988
|
-
" —",
|
|
1989
|
-
" ",
|
|
1990
|
-
/* @__PURE__ */ jsx6("code", {
|
|
1991
|
-
children: "contractspec validate"
|
|
1992
|
-
}),
|
|
1993
|
-
" to ensure contracts are valid."
|
|
1994
|
-
]
|
|
1995
|
-
}),
|
|
1996
|
-
/* @__PURE__ */ jsxs6("li", {
|
|
1997
|
-
children: [
|
|
1998
|
-
/* @__PURE__ */ jsx6("strong", {
|
|
1999
|
-
children: "Register and wire handlers"
|
|
2000
|
-
}),
|
|
2001
|
-
" — Connect contracts to your existing business logic."
|
|
2002
|
-
]
|
|
2003
|
-
}),
|
|
2004
|
-
/* @__PURE__ */ jsxs6("li", {
|
|
2005
|
-
children: [
|
|
2006
|
-
/* @__PURE__ */ jsx6("strong", {
|
|
2007
|
-
children: "Iterate"
|
|
2008
|
-
}),
|
|
2009
|
-
" — The imported contracts are a starting point. Refine them as your spec matures."
|
|
2010
|
-
]
|
|
2011
|
-
})
|
|
2012
|
-
]
|
|
2013
|
-
})
|
|
2014
|
-
]
|
|
2015
|
-
}),
|
|
2016
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
2017
|
-
className: "space-y-3",
|
|
2018
|
-
children: [
|
|
2019
|
-
/* @__PURE__ */ jsxs6("h2", {
|
|
2020
|
-
className: "flex items-center gap-2 font-bold text-2xl",
|
|
2021
|
-
children: [
|
|
2022
|
-
/* @__PURE__ */ jsx6(AlertCircle, {
|
|
2023
|
-
size: 20,
|
|
2024
|
-
className: "text-yellow-400"
|
|
2025
|
-
}),
|
|
2026
|
-
"Troubleshooting"
|
|
2027
|
-
]
|
|
2028
|
-
}),
|
|
2029
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
2030
|
-
className: "space-y-4",
|
|
2031
|
-
children: [
|
|
2032
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
2033
|
-
className: "card-subtle space-y-2 p-4",
|
|
2034
|
-
children: [
|
|
2035
|
-
/* @__PURE__ */ jsx6("h3", {
|
|
2036
|
-
className: "font-semibold",
|
|
2037
|
-
children: "Framework not detected"
|
|
2038
|
-
}),
|
|
2039
|
-
/* @__PURE__ */ jsxs6("p", {
|
|
2040
|
-
className: "text-muted-foreground text-sm",
|
|
2041
|
-
children: [
|
|
2042
|
-
"Use ",
|
|
2043
|
-
/* @__PURE__ */ jsx6("code", {
|
|
2044
|
-
children: "--framework <name>"
|
|
2045
|
-
}),
|
|
2046
|
-
" to force a specific framework. Check that your entry files follow standard patterns."
|
|
2047
|
-
]
|
|
2048
|
-
})
|
|
2049
|
-
]
|
|
2050
|
-
}),
|
|
2051
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
2052
|
-
className: "card-subtle space-y-2 p-4",
|
|
2053
|
-
children: [
|
|
2054
|
-
/* @__PURE__ */ jsx6("h3", {
|
|
2055
|
-
className: "font-semibold",
|
|
2056
|
-
children: "Missing schemas"
|
|
2057
|
-
}),
|
|
2058
|
-
/* @__PURE__ */ jsxs6("p", {
|
|
2059
|
-
className: "text-muted-foreground text-sm",
|
|
2060
|
-
children: [
|
|
2061
|
-
"Schema inference works best with explicit types. If using",
|
|
2062
|
-
" ",
|
|
2063
|
-
/* @__PURE__ */ jsx6("code", {
|
|
2064
|
-
children: "any"
|
|
2065
|
-
}),
|
|
2066
|
-
" or dynamic types, you'll see TODO placeholders. Fill them in manually."
|
|
2067
|
-
]
|
|
2068
|
-
})
|
|
2069
|
-
]
|
|
2070
|
-
}),
|
|
2071
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
2072
|
-
className: "card-subtle space-y-2 p-4",
|
|
2073
|
-
children: [
|
|
2074
|
-
/* @__PURE__ */ jsx6("h3", {
|
|
2075
|
-
className: "font-semibold",
|
|
2076
|
-
children: "Partial imports"
|
|
2077
|
-
}),
|
|
2078
|
-
/* @__PURE__ */ jsxs6("p", {
|
|
2079
|
-
className: "text-muted-foreground text-sm",
|
|
2080
|
-
children: [
|
|
2081
|
-
"Some endpoints may not be detected if they use unconventional patterns. Use ",
|
|
2082
|
-
/* @__PURE__ */ jsx6("code", {
|
|
2083
|
-
children: "--analyze"
|
|
2084
|
-
}),
|
|
2085
|
-
" to see what was found, then add missing contracts manually."
|
|
2086
|
-
]
|
|
2087
|
-
})
|
|
2088
|
-
]
|
|
2089
|
-
})
|
|
2090
|
-
]
|
|
2091
|
-
})
|
|
2092
|
-
]
|
|
2093
|
-
}),
|
|
2094
|
-
/* @__PURE__ */ jsx6(StudioPrompt, {
|
|
2095
|
-
title: "Want evidence-driven migration priorities?",
|
|
2096
|
-
body: "Studio clusters product signals into scored patterns, then proposes contract changes and execution-ready work for the highest-impact areas."
|
|
2097
|
-
})
|
|
2098
|
-
]
|
|
2099
|
-
}),
|
|
2100
|
-
/* @__PURE__ */ jsxs6("div", {
|
|
2101
|
-
className: "flex items-center gap-4 pt-4",
|
|
2102
|
-
children: [
|
|
2103
|
-
/* @__PURE__ */ jsxs6(Link6, {
|
|
2104
|
-
href: "/docs/guides/spec-validation-and-typing",
|
|
2105
|
-
className: "btn-primary",
|
|
2106
|
-
children: [
|
|
2107
|
-
"Next: Spec validation + typing ",
|
|
2108
|
-
/* @__PURE__ */ jsx6(ChevronRight5, {
|
|
2109
|
-
size: 16
|
|
2110
|
-
})
|
|
2111
|
-
]
|
|
2112
|
-
}),
|
|
2113
|
-
/* @__PURE__ */ jsx6(Link6, {
|
|
2114
|
-
href: "/docs/guides",
|
|
2115
|
-
className: "btn-ghost",
|
|
2116
|
-
children: "Back to guides"
|
|
2117
|
-
})
|
|
2118
|
-
]
|
|
2119
|
-
})
|
|
2120
|
-
]
|
|
2121
|
-
});
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
// src/components/docs/guides/GuideNextjsOneEndpointPage.tsx
|
|
2125
|
-
import { CodeBlock as CodeBlock6 } from "@contractspec/lib.design-system";
|
|
2126
|
-
import Link7 from "@contractspec/lib.ui-link";
|
|
2127
|
-
import { ChevronRight as ChevronRight6 } from "lucide-react";
|
|
2128
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2129
|
-
function GuideNextjsOneEndpointPage() {
|
|
2130
|
-
return /* @__PURE__ */ jsxs7("div", {
|
|
2131
|
-
className: "space-y-8",
|
|
2132
|
-
children: [
|
|
2133
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2134
|
-
className: "space-y-3",
|
|
2135
|
-
children: [
|
|
2136
|
-
/* @__PURE__ */ jsx7("h1", {
|
|
2137
|
-
className: "font-bold text-4xl",
|
|
2138
|
-
children: "Next.js: add one endpoint"
|
|
2139
|
-
}),
|
|
2140
|
-
/* @__PURE__ */ jsx7("p", {
|
|
2141
|
-
className: "text-lg text-muted-foreground",
|
|
2142
|
-
children: "Add ContractSpec to an existing Next.js App Router project by wiring a single operation end-to-end with validation and types."
|
|
2143
|
-
})
|
|
2144
|
-
]
|
|
2145
|
-
}),
|
|
2146
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2147
|
-
className: "card-subtle space-y-4 p-6",
|
|
2148
|
-
children: [
|
|
2149
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
2150
|
-
className: "font-bold text-2xl",
|
|
2151
|
-
children: "What you'll build"
|
|
2152
|
-
}),
|
|
2153
|
-
/* @__PURE__ */ jsxs7("ul", {
|
|
2154
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
2155
|
-
children: [
|
|
2156
|
-
/* @__PURE__ */ jsx7("li", {
|
|
2157
|
-
children: "One OperationSpec with SchemaModel validation."
|
|
2158
|
-
}),
|
|
2159
|
-
/* @__PURE__ */ jsx7("li", {
|
|
2160
|
-
children: "A registry wiring the operation to its handler."
|
|
2161
|
-
}),
|
|
2162
|
-
/* @__PURE__ */ jsx7("li", {
|
|
2163
|
-
children: "A Next.js route handler that exposes the operation."
|
|
2164
|
-
})
|
|
2165
|
-
]
|
|
2166
|
-
})
|
|
2167
|
-
]
|
|
2168
|
-
}),
|
|
2169
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2170
|
-
className: "space-y-6",
|
|
2171
|
-
children: [
|
|
2172
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2173
|
-
className: "space-y-3",
|
|
2174
|
-
children: [
|
|
2175
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
2176
|
-
className: "font-bold text-2xl",
|
|
2177
|
-
children: "1) Install core packages"
|
|
2178
|
-
}),
|
|
2179
|
-
/* @__PURE__ */ jsx7(CodeBlock6, {
|
|
2180
|
-
language: "bash",
|
|
2181
|
-
filename: "nextjs-install",
|
|
2182
|
-
code: `bun add -D contractspec
|
|
2183
|
-
bun add @contractspec/lib.contracts-spec @contractspec/lib.contracts-runtime-server-rest @contractspec/lib.schema`
|
|
2184
|
-
}),
|
|
2185
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
2186
|
-
className: "text-muted-foreground text-sm",
|
|
2187
|
-
children: [
|
|
2188
|
-
"Expected output: ",
|
|
2189
|
-
/* @__PURE__ */ jsx7("code", {
|
|
2190
|
-
children: "added 3 packages"
|
|
2191
|
-
}),
|
|
2192
|
-
" and a lockfile update."
|
|
2193
|
-
]
|
|
2194
|
-
})
|
|
2195
|
-
]
|
|
2196
|
-
}),
|
|
2197
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2198
|
-
className: "space-y-3",
|
|
2199
|
-
children: [
|
|
2200
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
2201
|
-
className: "font-bold text-2xl",
|
|
2202
|
-
children: "2) Define the operation spec"
|
|
2203
|
-
}),
|
|
2204
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
2205
|
-
className: "text-muted-foreground text-sm",
|
|
2206
|
-
children: [
|
|
2207
|
-
"Create ",
|
|
2208
|
-
/* @__PURE__ */ jsx7("code", {
|
|
2209
|
-
children: "src/contracts/healthcheck.operation.ts"
|
|
2210
|
-
}),
|
|
2211
|
-
":"
|
|
2212
|
-
]
|
|
2213
|
-
}),
|
|
2214
|
-
/* @__PURE__ */ jsx7(CodeBlock6, {
|
|
2215
|
-
language: "typescript",
|
|
2216
|
-
filename: "src/contracts/healthcheck.operation.ts",
|
|
2217
|
-
code: `import { defineQuery } from "@contractspec/lib.contracts-spec/operations";
|
|
543
|
+
});`})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"6) After importing"}),a("ol",{className:"list-decimal space-y-2 pl-5 text-muted-foreground text-sm",children:[a("li",{children:[e("strong",{children:"Review generated contracts"})," — Check the TODO placeholders and fill in descriptions, owners, and tags."]}),a("li",{children:[e("strong",{children:"Refine schemas"})," — Add proper types, validation rules, and error definitions."]}),a("li",{children:[e("strong",{children:"Run validation"})," —"," ",e("code",{children:"contractspec validate"})," to ensure contracts are valid."]}),a("li",{children:[e("strong",{children:"Register and wire handlers"})," — Connect contracts to your existing business logic."]}),a("li",{children:[e("strong",{children:"Iterate"})," — The imported contracts are a starting point. Refine them as your spec matures."]})]})]}),a("div",{className:"space-y-3",children:[a("h2",{className:"flex items-center gap-2 font-bold text-2xl",children:[e(ve,{size:20,className:"text-yellow-400"}),"Troubleshooting"]}),a("div",{className:"space-y-4",children:[a("div",{className:"card-subtle space-y-2 p-4",children:[e("h3",{className:"font-semibold",children:"Framework not detected"}),a("p",{className:"text-muted-foreground text-sm",children:["Use ",e("code",{children:"--framework <name>"})," to force a specific framework. Check that your entry files follow standard patterns."]})]}),a("div",{className:"card-subtle space-y-2 p-4",children:[e("h3",{className:"font-semibold",children:"Missing schemas"}),a("p",{className:"text-muted-foreground text-sm",children:["Schema inference works best with explicit types. If using"," ",e("code",{children:"any"})," or dynamic types, you'll see TODO placeholders. Fill them in manually."]})]}),a("div",{className:"card-subtle space-y-2 p-4",children:[e("h3",{className:"font-semibold",children:"Partial imports"}),a("p",{className:"text-muted-foreground text-sm",children:["Some endpoints may not be detected if they use unconventional patterns. Use ",e("code",{children:"--analyze"})," to see what was found, then add missing contracts manually."]})]})]})]}),e(g,{title:"Want evidence-driven migration priorities?",body:"Studio clusters product signals into scored patterns, then proposes contract changes and execution-ready work for the highest-impact areas."})]}),a("div",{className:"flex items-center gap-4 pt-4",children:[a(q,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Next: Spec validation + typing ",e(be,{size:16})]}),e(q,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as E}from"@contractspec/lib.design-system";import F from"@contractspec/lib.ui-link";import{ChevronRight as Se}from"lucide-react";import{jsx as r,jsxs as u}from"react/jsx-runtime";function Ie(){return u("div",{className:"space-y-8",children:[u("div",{className:"space-y-3",children:[r("h1",{className:"font-bold text-4xl",children:"Next.js: add one endpoint"}),r("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec to an existing Next.js App Router project by wiring a single operation end-to-end with validation and types."})]}),u("div",{className:"card-subtle space-y-4 p-6",children:[r("h2",{className:"font-bold text-2xl",children:"What you'll build"}),u("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"One OperationSpec with SchemaModel validation."}),r("li",{children:"A registry wiring the operation to its handler."}),r("li",{children:"A Next.js route handler that exposes the operation."})]})]}),u("div",{className:"space-y-6",children:[u("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"1) Install core packages"}),r(E,{language:"bash",filename:"nextjs-install",code:`bun add -D contractspec
|
|
544
|
+
bun add @contractspec/lib.contracts-spec @contractspec/lib.contracts-runtime-server-rest @contractspec/lib.schema`}),u("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",r("code",{children:"added 3 packages"})," and a lockfile update."]})]}),u("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"2) Define the operation spec"}),u("p",{className:"text-muted-foreground text-sm",children:["Create ",r("code",{children:"src/contracts/healthcheck.operation.ts"}),":"]}),r(E,{language:"typescript",filename:"src/contracts/healthcheck.operation.ts",code:`import { defineQuery } from "@contractspec/lib.contracts-spec/operations";
|
|
2218
545
|
import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
2219
546
|
|
|
2220
547
|
const HealthcheckOutput = new SchemaModel({
|
|
@@ -2245,31 +572,7 @@ export const HealthcheckQuery = defineQuery({
|
|
|
2245
572
|
gql: { field: "healthcheck_get" },
|
|
2246
573
|
mcp: { toolName: "healthcheck_get-v1" },
|
|
2247
574
|
},
|
|
2248
|
-
});`
|
|
2249
|
-
})
|
|
2250
|
-
]
|
|
2251
|
-
}),
|
|
2252
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2253
|
-
className: "space-y-3",
|
|
2254
|
-
children: [
|
|
2255
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
2256
|
-
className: "font-bold text-2xl",
|
|
2257
|
-
children: "3) Register the operation"
|
|
2258
|
-
}),
|
|
2259
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
2260
|
-
className: "text-muted-foreground text-sm",
|
|
2261
|
-
children: [
|
|
2262
|
-
"Create ",
|
|
2263
|
-
/* @__PURE__ */ jsx7("code", {
|
|
2264
|
-
children: "src/contracts/registry.ts"
|
|
2265
|
-
}),
|
|
2266
|
-
":"
|
|
2267
|
-
]
|
|
2268
|
-
}),
|
|
2269
|
-
/* @__PURE__ */ jsx7(CodeBlock6, {
|
|
2270
|
-
language: "typescript",
|
|
2271
|
-
filename: "src/contracts/registry.ts",
|
|
2272
|
-
code: `import {
|
|
575
|
+
});`})]}),u("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"3) Register the operation"}),u("p",{className:"text-muted-foreground text-sm",children:["Create ",r("code",{children:"src/contracts/registry.ts"}),":"]}),r(E,{language:"typescript",filename:"src/contracts/registry.ts",code:`import {
|
|
2273
576
|
OperationSpecRegistry,
|
|
2274
577
|
installOp,
|
|
2275
578
|
} from "@contractspec/lib.contracts-spec/operations";
|
|
@@ -2280,31 +583,7 @@ export const registry = new OperationSpecRegistry();
|
|
|
2280
583
|
installOp(registry, HealthcheckQuery, async () => ({
|
|
2281
584
|
status: "ok",
|
|
2282
585
|
checkedAt: new Date().toISOString(),
|
|
2283
|
-
}));`
|
|
2284
|
-
})
|
|
2285
|
-
]
|
|
2286
|
-
}),
|
|
2287
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2288
|
-
className: "space-y-3",
|
|
2289
|
-
children: [
|
|
2290
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
2291
|
-
className: "font-bold text-2xl",
|
|
2292
|
-
children: "4) Add the Next.js handler"
|
|
2293
|
-
}),
|
|
2294
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
2295
|
-
className: "text-muted-foreground text-sm",
|
|
2296
|
-
children: [
|
|
2297
|
-
"Create ",
|
|
2298
|
-
/* @__PURE__ */ jsx7("code", {
|
|
2299
|
-
children: "app/api/ops/[...route]/route.ts"
|
|
2300
|
-
}),
|
|
2301
|
-
":"
|
|
2302
|
-
]
|
|
2303
|
-
}),
|
|
2304
|
-
/* @__PURE__ */ jsx7(CodeBlock6, {
|
|
2305
|
-
language: "typescript",
|
|
2306
|
-
filename: "app/api/ops/[...route]/route.ts",
|
|
2307
|
-
code: `import { makeNextAppHandler } from "@contractspec/lib.contracts-runtime-server-rest/rest-next-app";
|
|
586
|
+
}));`})]}),u("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"4) Add the Next.js handler"}),u("p",{className:"text-muted-foreground text-sm",children:["Create ",r("code",{children:"app/api/ops/[...route]/route.ts"}),":"]}),r(E,{language:"typescript",filename:"app/api/ops/[...route]/route.ts",code:`import { makeNextAppHandler } from "@contractspec/lib.contracts-runtime-server-rest/rest-next-app";
|
|
2308
587
|
import { registry } from "@/contracts/registry";
|
|
2309
588
|
|
|
2310
589
|
const handler = makeNextAppHandler(registry, async () => ({
|
|
@@ -2312,171 +591,11 @@ const handler = makeNextAppHandler(registry, async () => ({
|
|
|
2312
591
|
tenantId: "public",
|
|
2313
592
|
}));
|
|
2314
593
|
|
|
2315
|
-
export { handler as GET, handler as POST };`
|
|
2316
|
-
}),
|
|
2317
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
2318
|
-
className: "text-muted-foreground text-sm",
|
|
2319
|
-
children: [
|
|
2320
|
-
"Expected output: the route responds at",
|
|
2321
|
-
/* @__PURE__ */ jsx7("code", {
|
|
2322
|
-
children: " /api/ops/healthcheck.get"
|
|
2323
|
-
}),
|
|
2324
|
-
"."
|
|
2325
|
-
]
|
|
2326
|
-
})
|
|
2327
|
-
]
|
|
2328
|
-
}),
|
|
2329
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2330
|
-
className: "space-y-3",
|
|
2331
|
-
children: [
|
|
2332
|
-
/* @__PURE__ */ jsx7("h2", {
|
|
2333
|
-
className: "font-bold text-2xl",
|
|
2334
|
-
children: "5) Validate the spec"
|
|
2335
|
-
}),
|
|
2336
|
-
/* @__PURE__ */ jsx7(CodeBlock6, {
|
|
2337
|
-
language: "bash",
|
|
2338
|
-
filename: "nextjs-validate",
|
|
2339
|
-
code: `contractspec validate src/contracts/healthcheck.operation.ts`
|
|
2340
|
-
}),
|
|
2341
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
2342
|
-
className: "text-muted-foreground text-sm",
|
|
2343
|
-
children: [
|
|
2344
|
-
"Expected output: ",
|
|
2345
|
-
/* @__PURE__ */ jsx7("code", {
|
|
2346
|
-
children: "Validation passed"
|
|
2347
|
-
}),
|
|
2348
|
-
"."
|
|
2349
|
-
]
|
|
2350
|
-
})
|
|
2351
|
-
]
|
|
2352
|
-
}),
|
|
2353
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2354
|
-
className: "card-subtle space-y-3 p-6",
|
|
2355
|
-
children: [
|
|
2356
|
-
/* @__PURE__ */ jsx7("h3", {
|
|
2357
|
-
className: "font-semibold text-lg",
|
|
2358
|
-
children: "Example package"
|
|
2359
|
-
}),
|
|
2360
|
-
/* @__PURE__ */ jsxs7("p", {
|
|
2361
|
-
className: "text-muted-foreground text-sm",
|
|
2362
|
-
children: [
|
|
2363
|
-
"Use ",
|
|
2364
|
-
/* @__PURE__ */ jsx7("code", {
|
|
2365
|
-
children: "@contractspec/example.lifecycle-dashboard"
|
|
2366
|
-
}),
|
|
2367
|
-
" as a lightweight Next.js snippet reference."
|
|
2368
|
-
]
|
|
2369
|
-
}),
|
|
2370
|
-
/* @__PURE__ */ jsx7(CodeBlock6, {
|
|
2371
|
-
language: "bash",
|
|
2372
|
-
filename: "nextjs-example",
|
|
2373
|
-
code: `# Inspect the example docs
|
|
594
|
+
export { handler as GET, handler as POST };`}),u("p",{className:"text-muted-foreground text-sm",children:["Expected output: the route responds at",r("code",{children:" /api/ops/healthcheck.get"}),"."]})]}),u("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"5) Validate the spec"}),r(E,{language:"bash",filename:"nextjs-validate",code:"contractspec validate src/contracts/healthcheck.operation.ts"}),u("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",r("code",{children:"Validation passed"}),"."]})]}),u("div",{className:"card-subtle space-y-3 p-6",children:[r("h3",{className:"font-semibold text-lg",children:"Example package"}),u("p",{className:"text-muted-foreground text-sm",children:["Use ",r("code",{children:"@contractspec/example.lifecycle-dashboard"})," as a lightweight Next.js snippet reference."]}),r(E,{language:"bash",filename:"nextjs-example",code:`# Inspect the example docs
|
|
2374
595
|
contractspec examples show lifecycle-dashboard
|
|
2375
596
|
|
|
2376
597
|
# Validate all example manifests in this repo
|
|
2377
|
-
contractspec examples validate --repo-root .`
|
|
2378
|
-
})
|
|
2379
|
-
]
|
|
2380
|
-
}),
|
|
2381
|
-
/* @__PURE__ */ jsx7(StudioPrompt, {
|
|
2382
|
-
title: "Want real product evidence behind endpoint changes?",
|
|
2383
|
-
body: "Studio correlates meetings, support, analytics, and code signals before compiling endpoint decisions into spec diffs."
|
|
2384
|
-
})
|
|
2385
|
-
]
|
|
2386
|
-
}),
|
|
2387
|
-
/* @__PURE__ */ jsxs7("div", {
|
|
2388
|
-
className: "flex items-center gap-4 pt-4",
|
|
2389
|
-
children: [
|
|
2390
|
-
/* @__PURE__ */ jsxs7(Link7, {
|
|
2391
|
-
href: "/docs/guides/spec-validation-and-typing",
|
|
2392
|
-
className: "btn-primary",
|
|
2393
|
-
children: [
|
|
2394
|
-
"Next: Spec validation + typing ",
|
|
2395
|
-
/* @__PURE__ */ jsx7(ChevronRight6, {
|
|
2396
|
-
size: 16
|
|
2397
|
-
})
|
|
2398
|
-
]
|
|
2399
|
-
}),
|
|
2400
|
-
/* @__PURE__ */ jsx7(Link7, {
|
|
2401
|
-
href: "/docs/guides",
|
|
2402
|
-
className: "btn-ghost",
|
|
2403
|
-
children: "Back to guides"
|
|
2404
|
-
})
|
|
2405
|
-
]
|
|
2406
|
-
})
|
|
2407
|
-
]
|
|
2408
|
-
});
|
|
2409
|
-
}
|
|
2410
|
-
|
|
2411
|
-
// src/components/docs/guides/GuideSpecValidationTypingPage.tsx
|
|
2412
|
-
import { CodeBlock as CodeBlock7 } from "@contractspec/lib.design-system";
|
|
2413
|
-
import Link8 from "@contractspec/lib.ui-link";
|
|
2414
|
-
import { ChevronRight as ChevronRight7 } from "lucide-react";
|
|
2415
|
-
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2416
|
-
function GuideSpecValidationTypingPage() {
|
|
2417
|
-
return /* @__PURE__ */ jsxs8("div", {
|
|
2418
|
-
className: "space-y-8",
|
|
2419
|
-
children: [
|
|
2420
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2421
|
-
className: "space-y-3",
|
|
2422
|
-
children: [
|
|
2423
|
-
/* @__PURE__ */ jsx8("h1", {
|
|
2424
|
-
className: "font-bold text-4xl",
|
|
2425
|
-
children: "Spec-driven validation + typing"
|
|
2426
|
-
}),
|
|
2427
|
-
/* @__PURE__ */ jsx8("p", {
|
|
2428
|
-
className: "text-lg text-muted-foreground",
|
|
2429
|
-
children: "Define a single operation with SchemaModel, generate validation, and keep your existing handler logic."
|
|
2430
|
-
})
|
|
2431
|
-
]
|
|
2432
|
-
}),
|
|
2433
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2434
|
-
className: "card-subtle space-y-4 p-6",
|
|
2435
|
-
children: [
|
|
2436
|
-
/* @__PURE__ */ jsx8("h2", {
|
|
2437
|
-
className: "font-bold text-2xl",
|
|
2438
|
-
children: "What you'll build"
|
|
2439
|
-
}),
|
|
2440
|
-
/* @__PURE__ */ jsxs8("ul", {
|
|
2441
|
-
className: "space-y-2 text-muted-foreground text-sm",
|
|
2442
|
-
children: [
|
|
2443
|
-
/* @__PURE__ */ jsx8("li", {
|
|
2444
|
-
children: "One command spec with explicit input/output models."
|
|
2445
|
-
}),
|
|
2446
|
-
/* @__PURE__ */ jsx8("li", {
|
|
2447
|
-
children: "Validation + typing without rewriting your service layer."
|
|
2448
|
-
}),
|
|
2449
|
-
/* @__PURE__ */ jsx8("li", {
|
|
2450
|
-
children: "Clear acceptance scenarios for regression safety."
|
|
2451
|
-
})
|
|
2452
|
-
]
|
|
2453
|
-
})
|
|
2454
|
-
]
|
|
2455
|
-
}),
|
|
2456
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2457
|
-
className: "space-y-6",
|
|
2458
|
-
children: [
|
|
2459
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2460
|
-
className: "space-y-3",
|
|
2461
|
-
children: [
|
|
2462
|
-
/* @__PURE__ */ jsx8("h2", {
|
|
2463
|
-
className: "font-bold text-2xl",
|
|
2464
|
-
children: "1) Define the spec"
|
|
2465
|
-
}),
|
|
2466
|
-
/* @__PURE__ */ jsxs8("p", {
|
|
2467
|
-
className: "text-muted-foreground text-sm",
|
|
2468
|
-
children: [
|
|
2469
|
-
"Create ",
|
|
2470
|
-
/* @__PURE__ */ jsx8("code", {
|
|
2471
|
-
children: "src/contracts/contact-create.operation.ts"
|
|
2472
|
-
}),
|
|
2473
|
-
":"
|
|
2474
|
-
]
|
|
2475
|
-
}),
|
|
2476
|
-
/* @__PURE__ */ jsx8(CodeBlock7, {
|
|
2477
|
-
language: "typescript",
|
|
2478
|
-
filename: "src/contracts/contact-create.operation.ts",
|
|
2479
|
-
code: `import { defineCommand } from "@contractspec/lib.contracts-spec/operations";
|
|
598
|
+
contractspec examples validate --repo-root .`})]}),r(g,{title:"Want real product evidence behind endpoint changes?",body:"Studio correlates meetings, support, analytics, and code signals before compiling endpoint decisions into spec diffs."})]}),u("div",{className:"flex items-center gap-4 pt-4",children:[u(F,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Next: Spec validation + typing ",r(Se,{size:16})]}),r(F,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as A}from"@contractspec/lib.design-system";import K from"@contractspec/lib.ui-link";import{ChevronRight as Ee}from"lucide-react";import{jsx as m,jsxs as N}from"react/jsx-runtime";function Pe(){return N("div",{className:"space-y-8",children:[N("div",{className:"space-y-3",children:[m("h1",{className:"font-bold text-4xl",children:"Spec-driven validation + typing"}),m("p",{className:"text-lg text-muted-foreground",children:"Define a single operation with SchemaModel, generate validation, and keep your existing handler logic."})]}),N("div",{className:"card-subtle space-y-4 p-6",children:[m("h2",{className:"font-bold text-2xl",children:"What you'll build"}),N("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[m("li",{children:"One command spec with explicit input/output models."}),m("li",{children:"Validation + typing without rewriting your service layer."}),m("li",{children:"Clear acceptance scenarios for regression safety."})]})]}),N("div",{className:"space-y-6",children:[N("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"1) Define the spec"}),N("p",{className:"text-muted-foreground text-sm",children:["Create ",m("code",{children:"src/contracts/contact-create.operation.ts"}),":"]}),m(A,{language:"typescript",filename:"src/contracts/contact-create.operation.ts",code:`import { defineCommand } from "@contractspec/lib.contracts-spec/operations";
|
|
2480
599
|
import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
2481
600
|
|
|
2482
601
|
const ContactInput = new SchemaModel({
|
|
@@ -2522,25 +641,7 @@ export const ContactCreateCommand = defineCommand({
|
|
|
2522
641
|
},
|
|
2523
642
|
],
|
|
2524
643
|
},
|
|
2525
|
-
});`
|
|
2526
|
-
})
|
|
2527
|
-
]
|
|
2528
|
-
}),
|
|
2529
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2530
|
-
className: "space-y-3",
|
|
2531
|
-
children: [
|
|
2532
|
-
/* @__PURE__ */ jsx8("h2", {
|
|
2533
|
-
className: "font-bold text-2xl",
|
|
2534
|
-
children: "2) Wire the handler"
|
|
2535
|
-
}),
|
|
2536
|
-
/* @__PURE__ */ jsx8("p", {
|
|
2537
|
-
className: "text-muted-foreground text-sm",
|
|
2538
|
-
children: "Keep your existing code. Just ensure the handler returns the output shape defined above."
|
|
2539
|
-
}),
|
|
2540
|
-
/* @__PURE__ */ jsx8(CodeBlock7, {
|
|
2541
|
-
language: "typescript",
|
|
2542
|
-
filename: "src/handlers/contact-create.ts",
|
|
2543
|
-
code: `import { ContactCreateCommand } from "@/contracts/contact-create.operation";
|
|
644
|
+
});`})]}),N("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"2) Wire the handler"}),m("p",{className:"text-muted-foreground text-sm",children:"Keep your existing code. Just ensure the handler returns the output shape defined above."}),m(A,{language:"typescript",filename:"src/handlers/contact-create.ts",code:`import { ContactCreateCommand } from "@/contracts/contact-create.operation";
|
|
2544
645
|
|
|
2545
646
|
export async function handleContactCreate(
|
|
2546
647
|
input: (typeof ContactCreateCommand)["io"]["input"],
|
|
@@ -2552,304 +653,21 @@ export const ContactCreateCommand = defineCommand({
|
|
|
2552
653
|
email: input.email,
|
|
2553
654
|
createdAt: new Date().toISOString(),
|
|
2554
655
|
};
|
|
2555
|
-
}`
|
|
2556
|
-
})
|
|
2557
|
-
]
|
|
2558
|
-
}),
|
|
2559
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2560
|
-
className: "space-y-3",
|
|
2561
|
-
children: [
|
|
2562
|
-
/* @__PURE__ */ jsx8("h2", {
|
|
2563
|
-
className: "font-bold text-2xl",
|
|
2564
|
-
children: "3) Validate"
|
|
2565
|
-
}),
|
|
2566
|
-
/* @__PURE__ */ jsx8(CodeBlock7, {
|
|
2567
|
-
language: "bash",
|
|
2568
|
-
filename: "spec-validation",
|
|
2569
|
-
code: `contractspec validate src/contracts/contact-create.operation.ts`
|
|
2570
|
-
}),
|
|
2571
|
-
/* @__PURE__ */ jsxs8("p", {
|
|
2572
|
-
className: "text-muted-foreground text-sm",
|
|
2573
|
-
children: [
|
|
2574
|
-
"Expected output: ",
|
|
2575
|
-
/* @__PURE__ */ jsx8("code", {
|
|
2576
|
-
children: "Validation passed"
|
|
2577
|
-
}),
|
|
2578
|
-
"."
|
|
2579
|
-
]
|
|
2580
|
-
})
|
|
2581
|
-
]
|
|
2582
|
-
}),
|
|
2583
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2584
|
-
className: "card-subtle space-y-3 p-6",
|
|
2585
|
-
children: [
|
|
2586
|
-
/* @__PURE__ */ jsx8("h3", {
|
|
2587
|
-
className: "font-semibold text-lg",
|
|
2588
|
-
children: "Example package"
|
|
2589
|
-
}),
|
|
2590
|
-
/* @__PURE__ */ jsx8("p", {
|
|
2591
|
-
className: "text-muted-foreground text-sm",
|
|
2592
|
-
children: "The CRM Pipeline example includes real specs, handlers, and presentations for contact + deal flows."
|
|
2593
|
-
}),
|
|
2594
|
-
/* @__PURE__ */ jsx8(CodeBlock7, {
|
|
2595
|
-
language: "bash",
|
|
2596
|
-
filename: "crm-example",
|
|
2597
|
-
code: `# Build + validate the CRM pipeline example
|
|
656
|
+
}`})]}),N("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"3) Validate"}),m(A,{language:"bash",filename:"spec-validation",code:"contractspec validate src/contracts/contact-create.operation.ts"}),N("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",m("code",{children:"Validation passed"}),"."]})]}),N("div",{className:"card-subtle space-y-3 p-6",children:[m("h3",{className:"font-semibold text-lg",children:"Example package"}),m("p",{className:"text-muted-foreground text-sm",children:"The CRM Pipeline example includes real specs, handlers, and presentations for contact + deal flows."}),m(A,{language:"bash",filename:"crm-example",code:`# Build + validate the CRM pipeline example
|
|
2598
657
|
cd packages/examples/crm-pipeline
|
|
2599
658
|
bun install
|
|
2600
659
|
bun run build
|
|
2601
|
-
bun run validate`
|
|
2602
|
-
})
|
|
2603
|
-
]
|
|
2604
|
-
}),
|
|
2605
|
-
/* @__PURE__ */ jsx8(StudioPrompt, {
|
|
2606
|
-
title: "Need validation tied to real outcomes?",
|
|
2607
|
-
body: "Studio links checks to evidence, focus decisions, and post-release verification so specs evolve with product truth."
|
|
2608
|
-
})
|
|
2609
|
-
]
|
|
2610
|
-
}),
|
|
2611
|
-
/* @__PURE__ */ jsxs8("div", {
|
|
2612
|
-
className: "flex items-center gap-4 pt-4",
|
|
2613
|
-
children: [
|
|
2614
|
-
/* @__PURE__ */ jsxs8(Link8, {
|
|
2615
|
-
href: "/docs/guides/generate-docs-clients-schemas",
|
|
2616
|
-
className: "btn-primary",
|
|
2617
|
-
children: [
|
|
2618
|
-
"Next: Generate docs + clients ",
|
|
2619
|
-
/* @__PURE__ */ jsx8(ChevronRight7, {
|
|
2620
|
-
size: 16
|
|
2621
|
-
})
|
|
2622
|
-
]
|
|
2623
|
-
}),
|
|
2624
|
-
/* @__PURE__ */ jsx8(Link8, {
|
|
2625
|
-
href: "/docs/guides",
|
|
2626
|
-
className: "btn-ghost",
|
|
2627
|
-
children: "Back to guides"
|
|
2628
|
-
})
|
|
2629
|
-
]
|
|
2630
|
-
})
|
|
2631
|
-
]
|
|
2632
|
-
});
|
|
2633
|
-
}
|
|
2634
|
-
|
|
2635
|
-
// src/components/docs/guides/GuidesIndexPage.tsx
|
|
2636
|
-
import { CodeBlock as CodeBlock8 } from "@contractspec/lib.design-system";
|
|
2637
|
-
import Link9 from "@contractspec/lib.ui-link";
|
|
2638
|
-
import { ArrowRight, CheckCircle2, GitBranch } from "lucide-react";
|
|
2639
|
-
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2640
|
-
var guides = [
|
|
2641
|
-
{
|
|
2642
|
-
title: "Adopt one endpoint in Next.js",
|
|
2643
|
-
description: "Start inside a live app with one operation, one generated surface, and one clearly bounded change.",
|
|
2644
|
-
href: "/docs/guides/nextjs-one-endpoint",
|
|
2645
|
-
time: "25 min"
|
|
2646
|
-
},
|
|
2647
|
-
{
|
|
2648
|
-
title: "Import an existing codebase",
|
|
2649
|
-
description: "Stabilize what already exists instead of treating adoption as a rewrite project.",
|
|
2650
|
-
href: "/docs/guides/import-existing-codebases",
|
|
2651
|
-
time: "20 min"
|
|
2652
|
-
},
|
|
2653
|
-
{
|
|
2654
|
-
title: "Validation and typing",
|
|
2655
|
-
description: "Keep runtime validation and TypeScript behavior aligned from the same source definitions.",
|
|
2656
|
-
href: "/docs/guides/spec-validation-and-typing",
|
|
2657
|
-
time: "20 min"
|
|
2658
|
-
},
|
|
2659
|
-
{
|
|
2660
|
-
title: "Generate docs and clients",
|
|
2661
|
-
description: "Publish stable docs, schemas, and client-facing artifacts from the contract layer.",
|
|
2662
|
-
href: "/docs/guides/generate-docs-clients-schemas",
|
|
2663
|
-
time: "20 min"
|
|
2664
|
-
},
|
|
2665
|
-
{
|
|
2666
|
-
title: "Docs pipeline",
|
|
2667
|
-
description: "Feed generated reference material into the docs site without confusing ownership.",
|
|
2668
|
-
href: "/docs/guides/docs-generation-pipeline",
|
|
2669
|
-
time: "20 min"
|
|
2670
|
-
},
|
|
2671
|
-
{
|
|
2672
|
-
title: "CI diff gating",
|
|
2673
|
-
description: "Use deterministic checks to catch drift and risky changes before they ship.",
|
|
2674
|
-
href: "/docs/guides/ci-contract-diff-gating",
|
|
2675
|
-
time: "15 min"
|
|
2676
|
-
}
|
|
2677
|
-
];
|
|
2678
|
-
function GuidesIndexPage() {
|
|
2679
|
-
return /* @__PURE__ */ jsxs9("div", {
|
|
2680
|
-
className: "space-y-10",
|
|
2681
|
-
children: [
|
|
2682
|
-
/* @__PURE__ */ jsxs9("div", {
|
|
2683
|
-
className: "space-y-3",
|
|
2684
|
-
children: [
|
|
2685
|
-
/* @__PURE__ */ jsx9("p", {
|
|
2686
|
-
className: "editorial-kicker",
|
|
2687
|
-
children: "Build"
|
|
2688
|
-
}),
|
|
2689
|
-
/* @__PURE__ */ jsx9("h1", {
|
|
2690
|
-
className: "font-serif text-4xl tracking-[-0.04em] md:text-5xl",
|
|
2691
|
-
children: "Adoption guides for teams that want to keep their code."
|
|
2692
|
-
}),
|
|
2693
|
-
/* @__PURE__ */ jsx9("p", {
|
|
2694
|
-
className: "max-w-3xl text-lg text-muted-foreground leading-8",
|
|
2695
|
-
children: "These guides assume you are introducing ContractSpec into a real code base. Start with a narrow surface, verify the generated outputs, and expand only after the contract loop feels trustworthy."
|
|
2696
|
-
})
|
|
2697
|
-
]
|
|
2698
|
-
}),
|
|
2699
|
-
/* @__PURE__ */ jsx9("div", {
|
|
2700
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
2701
|
-
children: guides.map((guide) => /* @__PURE__ */ jsxs9(Link9, {
|
|
2702
|
-
href: guide.href,
|
|
2703
|
-
className: "editorial-panel",
|
|
2704
|
-
children: [
|
|
2705
|
-
/* @__PURE__ */ jsxs9("div", {
|
|
2706
|
-
className: "flex items-start justify-between gap-4",
|
|
2707
|
-
children: [
|
|
2708
|
-
/* @__PURE__ */ jsxs9("div", {
|
|
2709
|
-
children: [
|
|
2710
|
-
/* @__PURE__ */ jsx9("h2", {
|
|
2711
|
-
className: "font-semibold text-xl",
|
|
2712
|
-
children: guide.title
|
|
2713
|
-
}),
|
|
2714
|
-
/* @__PURE__ */ jsx9("p", {
|
|
2715
|
-
className: "mt-2 text-muted-foreground text-sm leading-7",
|
|
2716
|
-
children: guide.description
|
|
2717
|
-
})
|
|
2718
|
-
]
|
|
2719
|
-
}),
|
|
2720
|
-
/* @__PURE__ */ jsx9(ArrowRight, {
|
|
2721
|
-
className: "mt-1 shrink-0",
|
|
2722
|
-
size: 18
|
|
2723
|
-
})
|
|
2724
|
-
]
|
|
2725
|
-
}),
|
|
2726
|
-
/* @__PURE__ */ jsxs9("div", {
|
|
2727
|
-
className: "mt-4 flex items-center gap-2 text-muted-foreground text-xs",
|
|
2728
|
-
children: [
|
|
2729
|
-
/* @__PURE__ */ jsx9(CheckCircle2, {
|
|
2730
|
-
size: 14
|
|
2731
|
-
}),
|
|
2732
|
-
/* @__PURE__ */ jsxs9("span", {
|
|
2733
|
-
children: [
|
|
2734
|
-
"Target time: ",
|
|
2735
|
-
guide.time
|
|
2736
|
-
]
|
|
2737
|
-
})
|
|
2738
|
-
]
|
|
2739
|
-
})
|
|
2740
|
-
]
|
|
2741
|
-
}, guide.href))
|
|
2742
|
-
}),
|
|
2743
|
-
/* @__PURE__ */ jsxs9("div", {
|
|
2744
|
-
className: "editorial-panel space-y-4",
|
|
2745
|
-
children: [
|
|
2746
|
-
/* @__PURE__ */ jsxs9("div", {
|
|
2747
|
-
className: "flex items-center gap-2 font-semibold text-[color:var(--rust)] text-sm uppercase tracking-[0.2em]",
|
|
2748
|
-
children: [
|
|
2749
|
-
/* @__PURE__ */ jsx9(GitBranch, {
|
|
2750
|
-
size: 16
|
|
2751
|
-
}),
|
|
2752
|
-
"Working style"
|
|
2753
|
-
]
|
|
2754
|
-
}),
|
|
2755
|
-
/* @__PURE__ */ jsxs9("ul", {
|
|
2756
|
-
className: "editorial-list",
|
|
2757
|
-
children: [
|
|
2758
|
-
/* @__PURE__ */ jsxs9("li", {
|
|
2759
|
-
children: [
|
|
2760
|
-
/* @__PURE__ */ jsx9("span", {
|
|
2761
|
-
className: "editorial-list-marker"
|
|
2762
|
-
}),
|
|
2763
|
-
/* @__PURE__ */ jsx9("span", {
|
|
2764
|
-
children: "Run each guide in a branch or sandboxed workspace."
|
|
2765
|
-
})
|
|
2766
|
-
]
|
|
2767
|
-
}),
|
|
2768
|
-
/* @__PURE__ */ jsxs9("li", {
|
|
2769
|
-
children: [
|
|
2770
|
-
/* @__PURE__ */ jsx9("span", {
|
|
2771
|
-
className: "editorial-list-marker"
|
|
2772
|
-
}),
|
|
2773
|
-
/* @__PURE__ */ jsx9("span", {
|
|
2774
|
-
children: "Prefer one bounded surface at a time: one endpoint, one workflow, one integration, one unsafe module."
|
|
2775
|
-
})
|
|
2776
|
-
]
|
|
2777
|
-
}),
|
|
2778
|
-
/* @__PURE__ */ jsxs9("li", {
|
|
2779
|
-
children: [
|
|
2780
|
-
/* @__PURE__ */ jsx9("span", {
|
|
2781
|
-
className: "editorial-list-marker"
|
|
2782
|
-
}),
|
|
2783
|
-
/* @__PURE__ */ jsx9("span", {
|
|
2784
|
-
children: "Use the example and reference outputs to verify what changed, not just the narrative page."
|
|
2785
|
-
})
|
|
2786
|
-
]
|
|
2787
|
-
})
|
|
2788
|
-
]
|
|
2789
|
-
}),
|
|
2790
|
-
/* @__PURE__ */ jsx9(CodeBlock8, {
|
|
2791
|
-
language: "bash",
|
|
2792
|
-
filename: "guides-quickstart",
|
|
2793
|
-
code: `# list example systems
|
|
660
|
+
bun run validate`})]}),m(g,{title:"Need validation tied to real outcomes?",body:"Studio links checks to evidence, focus decisions, and post-release verification so specs evolve with product truth."})]}),N("div",{className:"flex items-center gap-4 pt-4",children:[N(K,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Next: Generate docs + clients ",m(Ee,{size:16})]}),m(K,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as Be}from"@contractspec/lib.design-system";import Re from"@contractspec/lib.ui-link";import{ArrowRight as Te,CheckCircle2 as Ae,GitBranch as Oe}from"lucide-react";import{jsx as h,jsxs as k}from"react/jsx-runtime";var Ue=[{title:"Adopt one endpoint in Next.js",description:"Start inside a live app with one operation, one generated surface, and one clearly bounded change.",href:"/docs/guides/nextjs-one-endpoint",time:"25 min"},{title:"Import an existing codebase",description:"Stabilize what already exists instead of treating adoption as a rewrite project.",href:"/docs/guides/import-existing-codebases",time:"20 min"},{title:"Validation and typing",description:"Keep runtime validation and TypeScript behavior aligned from the same source definitions.",href:"/docs/guides/spec-validation-and-typing",time:"20 min"},{title:"Generate docs and clients",description:"Publish stable docs, schemas, and client-facing artifacts from the contract layer.",href:"/docs/guides/generate-docs-clients-schemas",time:"20 min"},{title:"Docs pipeline",description:"Feed generated reference material into the docs site without confusing ownership.",href:"/docs/guides/docs-generation-pipeline",time:"20 min"},{title:"Build a first module bundle",description:"Define one bundle spec, resolve a surface plan, and render it through the React host layer.",href:"/docs/guides/first-module-bundle",time:"20 min"},{title:"Host the Builder workbench",description:"Wire a Builder workspace snapshot, common commands, runtime modes, and mobile review links into the reusable host.",href:"/docs/guides/host-builder-workbench",time:"20 min"},{title:"Use Connect in a repo",description:"Enable Connect, verify agent actions locally, and inspect the resulting review and replay artifacts.",href:"/docs/guides/connect-in-a-repo",time:"15 min"},{title:"CI diff gating",description:"Use deterministic checks to catch drift and risky changes before they ship.",href:"/docs/guides/ci-contract-diff-gating",time:"15 min"}];function De(){return k("div",{className:"space-y-10",children:[k("div",{className:"space-y-3",children:[h("p",{className:"editorial-kicker",children:"Build"}),h("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Adoption guides for teams that want to keep their code."}),h("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"These guides assume you are introducing ContractSpec into a real code base. Start with a narrow surface, verify the generated outputs, and expand only after the contract loop feels trustworthy."})]}),h("div",{className:"grid gap-4 md:grid-cols-2",children:Ue.map((c)=>k(Re,{href:c.href,className:"editorial-panel",children:[k("div",{className:"flex items-start justify-between gap-4",children:[k("div",{children:[h("h2",{className:"font-semibold text-xl",children:c.title}),h("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:c.description})]}),h(Te,{className:"mt-1 shrink-0",size:18})]}),k("div",{className:"mt-4 flex items-center gap-2 text-muted-foreground text-xs",children:[h(Ae,{size:14}),k("span",{children:["Target time: ",c.time]})]})]},c.href))}),k("div",{className:"editorial-panel space-y-4",children:[k("div",{className:"flex items-center gap-2 font-semibold text-[color:var(--rust)] text-sm uppercase tracking-[0.2em]",children:[h(Oe,{size:16}),"Working style"]}),k("ul",{className:"editorial-list",children:[k("li",{children:[h("span",{className:"editorial-list-marker"}),h("span",{children:"Run each guide in a branch or sandboxed workspace."})]}),k("li",{children:[h("span",{className:"editorial-list-marker"}),h("span",{children:"Prefer one bounded surface at a time: one endpoint, one workflow, one integration, one unsafe module."})]}),k("li",{children:[h("span",{className:"editorial-list-marker"}),h("span",{children:"Use the example and reference outputs to verify what changed, not just the narrative page."})]})]}),h(Be,{language:"bash",filename:"guides-quickstart",code:`# list example systems
|
|
2794
661
|
contractspec examples list
|
|
2795
662
|
|
|
2796
663
|
# validate the examples in this workspace
|
|
2797
|
-
contractspec examples validate --repo-root .`
|
|
2798
|
-
})
|
|
2799
|
-
]
|
|
2800
|
-
})
|
|
2801
|
-
]
|
|
2802
|
-
});
|
|
2803
|
-
}
|
|
664
|
+
contractspec examples validate --repo-root .`})]})]})}import{registerDocBlocks as Me}from"@contractspec/lib.contracts-spec/docs";var Le=[{id:"docs.guides.index",title:"Guides",summary:"Hands-on guides for adopting ContractSpec in real workflows.",kind:"goal",visibility:"public",route:"/docs/guides",tags:["guides","adoption"],body:`# Guides
|
|
2804
665
|
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
title: "Guides",
|
|
2811
|
-
summary: "Hands-on guides for adopting ContractSpec in real workflows.",
|
|
2812
|
-
kind: "goal",
|
|
2813
|
-
visibility: "public",
|
|
2814
|
-
route: "/docs/guides",
|
|
2815
|
-
tags: ["guides", "adoption"],
|
|
2816
|
-
body: `# Guides
|
|
2817
|
-
|
|
2818
|
-
Hands-on, runnable guides that map to real adoption scenarios. Each guide includes commands, expected output, and a CI-verified example package.`
|
|
2819
|
-
},
|
|
2820
|
-
{
|
|
2821
|
-
id: "docs.guides.nextjs-one-endpoint",
|
|
2822
|
-
title: "Next.js one endpoint",
|
|
2823
|
-
summary: "Add ContractSpec to an existing Next.js app with one endpoint.",
|
|
2824
|
-
kind: "usage",
|
|
2825
|
-
visibility: "public",
|
|
2826
|
-
route: "/docs/guides/nextjs-one-endpoint",
|
|
2827
|
-
tags: ["guides", "nextjs", "operations"],
|
|
2828
|
-
body: `# Add ContractSpec to a Next.js app (one endpoint)
|
|
2829
|
-
|
|
2830
|
-
Create a single OperationSpec, register it, and expose it through a Next.js App Router handler.`
|
|
2831
|
-
},
|
|
2832
|
-
{
|
|
2833
|
-
id: "docs.guides.spec-validation-typing",
|
|
2834
|
-
title: "Spec validation and typing",
|
|
2835
|
-
summary: "Define an operation spec with validation and types, no rewrites.",
|
|
2836
|
-
kind: "usage",
|
|
2837
|
-
visibility: "public",
|
|
2838
|
-
route: "/docs/guides/spec-validation-and-typing",
|
|
2839
|
-
tags: ["guides", "validation", "typing"],
|
|
2840
|
-
body: `# Spec-driven validation and typing
|
|
2841
|
-
|
|
2842
|
-
Define command/query specs that enforce validation and generate types without rewriting your app.`
|
|
2843
|
-
},
|
|
2844
|
-
{
|
|
2845
|
-
id: "docs.guides.docs-clients-schemas",
|
|
2846
|
-
title: "Generate docs, clients, schemas",
|
|
2847
|
-
summary: "Generate docs and OpenAPI for client SDKs from specs.",
|
|
2848
|
-
kind: "usage",
|
|
2849
|
-
visibility: "public",
|
|
2850
|
-
route: "/docs/guides/generate-docs-clients-schemas",
|
|
2851
|
-
tags: ["guides", "docs", "openapi"],
|
|
2852
|
-
body: `# Generate docs and client schemas
|
|
666
|
+
Hands-on, runnable guides that map to real adoption scenarios. Each guide includes commands, expected output, and a CI-verified example package.`},{id:"docs.guides.nextjs-one-endpoint",title:"Next.js one endpoint",summary:"Add ContractSpec to an existing Next.js app with one endpoint.",kind:"usage",visibility:"public",route:"/docs/guides/nextjs-one-endpoint",tags:["guides","nextjs","operations"],body:`# Add ContractSpec to a Next.js app (one endpoint)
|
|
667
|
+
|
|
668
|
+
Create a single OperationSpec, register it, and expose it through a Next.js App Router handler.`},{id:"docs.guides.spec-validation-typing",title:"Spec validation and typing",summary:"Define an operation spec with validation and types, no rewrites.",kind:"usage",visibility:"public",route:"/docs/guides/spec-validation-and-typing",tags:["guides","validation","typing"],body:`# Spec-driven validation and typing
|
|
669
|
+
|
|
670
|
+
Define command/query specs that enforce validation and generate types without rewriting your app.`},{id:"docs.guides.docs-clients-schemas",title:"Generate docs, clients, schemas",summary:"Generate docs and OpenAPI for client SDKs from specs.",kind:"usage",visibility:"public",route:"/docs/guides/generate-docs-clients-schemas",tags:["guides","docs","openapi"],body:`# Generate docs and client schemas
|
|
2853
671
|
|
|
2854
672
|
Use ContractSpec to generate documentation and OpenAPI exports for client SDKs.
|
|
2855
673
|
|
|
@@ -2867,17 +685,7 @@ bun contractspec generate
|
|
|
2867
685
|
bun docs:generate
|
|
2868
686
|
# or versioned output
|
|
2869
687
|
bun docs:generate -- --version v1.0.0
|
|
2870
|
-
\`\`\``
|
|
2871
|
-
},
|
|
2872
|
-
{
|
|
2873
|
-
id: "docs.guides.docs-generation-pipeline",
|
|
2874
|
-
title: "Docs generation pipeline",
|
|
2875
|
-
summary: "Wire generated docs into a reference site with chunked indexes.",
|
|
2876
|
-
kind: "usage",
|
|
2877
|
-
visibility: "public",
|
|
2878
|
-
route: "/docs/guides/docs-generation-pipeline",
|
|
2879
|
-
tags: ["guides", "docs", "pipeline"],
|
|
2880
|
-
body: `# Build the docs pipeline
|
|
688
|
+
\`\`\``},{id:"docs.guides.docs-generation-pipeline",title:"Docs generation pipeline",summary:"Wire generated docs into a reference site with chunked indexes.",kind:"usage",visibility:"public",route:"/docs/guides/docs-generation-pipeline",tags:["guides","docs","pipeline"],body:`# Build the docs pipeline
|
|
2881
689
|
|
|
2882
690
|
Use ContractSpec to generate reference markdown, build a chunked index, and wire it into your docs routes.
|
|
2883
691
|
|
|
@@ -2897,29 +705,6 @@ bun docs:generate -- --version v1.0.0
|
|
|
2897
705
|
|
|
2898
706
|
## Reference wiring
|
|
2899
707
|
|
|
2900
|
-
Use the generated manifest and chunks under \`docs-index.manifest.json\` and \`docs-index.*.json\` to load the index at runtime.`
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
id: "docs.guides.ci-contract-diff-gating",
|
|
2904
|
-
title: "CI gating for contract diffs",
|
|
2905
|
-
summary: "Gate changes with deterministic diffs and CI checks.",
|
|
2906
|
-
kind: "usage",
|
|
2907
|
-
visibility: "public",
|
|
2908
|
-
route: "/docs/guides/ci-contract-diff-gating",
|
|
2909
|
-
tags: ["guides", "ci", "diff"],
|
|
2910
|
-
body: `# CI gating with deterministic diffs
|
|
2911
|
-
|
|
2912
|
-
Run ContractSpec CI checks to detect drift and breaking changes before merge.`
|
|
2913
|
-
}
|
|
2914
|
-
];
|
|
2915
|
-
registerDocBlocks(guideDocBlocks);
|
|
2916
|
-
export {
|
|
2917
|
-
GuidesIndexPage,
|
|
2918
|
-
GuideSpecValidationTypingPage,
|
|
2919
|
-
GuideNextjsOneEndpointPage,
|
|
2920
|
-
GuideImportExistingCodebasesPage,
|
|
2921
|
-
GuideGenerateDocsClientsSchemasPage,
|
|
2922
|
-
GuideDocsPipelinePage,
|
|
2923
|
-
GuideContractTypesPage,
|
|
2924
|
-
GuideCIDiffGatingPage
|
|
2925
|
-
};
|
|
708
|
+
Use the generated manifest and chunks under \`docs-index.manifest.json\` and \`docs-index.*.json\` to load the index at runtime.`},{id:"docs.guides.ci-contract-diff-gating",title:"CI gating for contract diffs",summary:"Gate changes with deterministic diffs and CI checks.",kind:"usage",visibility:"public",route:"/docs/guides/ci-contract-diff-gating",tags:["guides","ci","diff"],body:`# CI gating with deterministic diffs
|
|
709
|
+
|
|
710
|
+
Run ContractSpec CI checks to detect drift and breaking changes before merge.`}];Me(Le);export{De as GuidesIndexPage,Pe as GuideSpecValidationTypingPage,Ie as GuideNextjsOneEndpointPage,Ce as GuideImportExistingCodebasesPage,ye as GuideHostBuilderWorkbenchPage,he as GuideGenerateDocsClientsSchemasPage,me as GuideFirstModuleBundlePage,le as GuideDocsPipelinePage,se as GuideContractTypesPage,te as GuideConnectInRepoPage,x as GuideCIDiffGatingPage};
|