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