@contractspec/bundle.library 3.8.9 → 3.8.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (644) hide show
  1. package/.turbo/turbo-build.log +606 -594
  2. package/CHANGELOG.md +68 -0
  3. package/dist/application/context-storage/index.js +1 -28
  4. package/dist/application/index.js +13 -2133
  5. package/dist/application/mcp/cliMcp.js +4 -452
  6. package/dist/application/mcp/common.js +1 -193
  7. package/dist/application/mcp/contractsMcp.js +2 -549
  8. package/dist/application/mcp/contractsMcpResources.js +2 -123
  9. package/dist/application/mcp/contractsMcpTools.js +1 -199
  10. package/dist/application/mcp/docsMcp.catalog.js +3 -381
  11. package/dist/application/mcp/docsMcp.data.js +1 -147
  12. package/dist/application/mcp/docsMcp.js +6 -1039
  13. package/dist/application/mcp/docsMcp.prompts.js +6 -521
  14. package/dist/application/mcp/docsMcp.reference.js +3 -235
  15. package/dist/application/mcp/docsMcp.resources.js +3 -519
  16. package/dist/application/mcp/docsMcp.tools.js +3 -518
  17. package/dist/application/mcp/index.js +13 -2106
  18. package/dist/application/mcp/internalMcp.js +2 -410
  19. package/dist/application/mcp/normalizeMcpRequest.js +1 -21
  20. package/dist/application/mcp/providerRankingMcp.js +1 -530
  21. package/dist/bundles/LibraryBundle.js +1 -138
  22. package/dist/bundles/index.js +1 -138
  23. package/dist/components/docs/DocsIndexPage.js +2 -912
  24. package/dist/components/docs/advanced/AdvancedMCPPage.js +4 -271
  25. package/dist/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -107
  26. package/dist/components/docs/advanced/AdvancedRenderersPage.js +2 -118
  27. package/dist/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -92
  28. package/dist/components/docs/advanced/AdvancedTelemetryPage.js +2 -373
  29. package/dist/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -99
  30. package/dist/components/docs/advanced/index.js +10 -1055
  31. package/dist/components/docs/architecture/ArchitectureAppConfigPage.js +6 -243
  32. package/dist/components/docs/architecture/ArchitectureControlPlanePage.js +3 -160
  33. package/dist/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -259
  34. package/dist/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -374
  35. package/dist/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -166
  36. package/dist/components/docs/architecture/ArchitectureOverviewPage.js +1 -143
  37. package/dist/components/docs/architecture/index.js +20 -1340
  38. package/dist/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -245
  39. package/dist/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -230
  40. package/dist/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -245
  41. package/dist/components/docs/comparison/ComparisonOverviewPage.js +1 -202
  42. package/dist/components/docs/comparison/ComparisonWindmillPage.js +1 -254
  43. package/dist/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -339
  44. package/dist/components/docs/comparison/index.js +1 -1510
  45. package/dist/components/docs/docsManifest.js +1 -611
  46. package/dist/components/docs/docsManifest.test.d.ts +1 -0
  47. package/dist/components/docs/ecosystem/IntegrationsPage.js +2 -103
  48. package/dist/components/docs/ecosystem/PluginsPage.js +13 -179
  49. package/dist/components/docs/ecosystem/RegistryPage.js +7 -100
  50. package/dist/components/docs/ecosystem/TemplatesPage.js +3 -141
  51. package/dist/components/docs/ecosystem/ecosystem.docblocks.js +2 -48
  52. package/dist/components/docs/ecosystem/index.js +23 -569
  53. package/dist/components/docs/examples/DocsExamplesPage.js +4 -124
  54. package/dist/components/docs/examples/ExampleShowcasePage.js +4 -244
  55. package/dist/components/docs/examples/exampleShowcaseData.js +4 -39
  56. package/dist/components/docs/examples/index.js +4 -330
  57. package/dist/components/docs/generated/docs-index.generated.js +1 -5
  58. package/dist/components/docs/generated/index.js +1 -74
  59. package/dist/components/docs/generated/loader.js +1 -74
  60. package/dist/components/docs/getting-started/CLIPage.js +4 -271
  61. package/dist/components/docs/getting-started/CompatibilityPage.js +1 -173
  62. package/dist/components/docs/getting-started/DataViewTutorialPage.js +4 -134
  63. package/dist/components/docs/getting-started/DeveloperToolsPage.js +1 -194
  64. package/dist/components/docs/getting-started/HelloWorldPage.js +5 -183
  65. package/dist/components/docs/getting-started/InstallationPage.js +3 -154
  66. package/dist/components/docs/getting-started/StartHerePage.js +2 -129
  67. package/dist/components/docs/getting-started/TroubleshootingPage.js +2 -168
  68. package/dist/components/docs/getting-started/VSCodeExtensionPage.js +1 -432
  69. package/dist/components/docs/getting-started/getting-started.docblocks.js +4 -41
  70. package/dist/components/docs/getting-started/index.js +18 -1869
  71. package/dist/components/docs/guides/GuideCIDiffGatingPage.js +2 -196
  72. package/dist/components/docs/guides/GuideConnectInRepoPage.d.ts +1 -0
  73. package/dist/components/docs/guides/GuideConnectInRepoPage.js +44 -0
  74. package/dist/components/docs/guides/GuideContractTypesPage.js +6 -541
  75. package/dist/components/docs/guides/GuideDocsPipelinePage.js +3 -207
  76. package/dist/components/docs/guides/GuideFirstModuleBundlePage.d.ts +1 -0
  77. package/dist/components/docs/guides/GuideFirstModuleBundlePage.js +76 -0
  78. package/dist/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -209
  79. package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.d.ts +1 -0
  80. package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.js +70 -0
  81. package/dist/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -754
  82. package/dist/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -268
  83. package/dist/components/docs/guides/GuideSpecValidationTypingPage.js +4 -196
  84. package/dist/components/docs/guides/GuidesIndexPage.js +2 -169
  85. package/dist/components/docs/guides/guides.docblocks.js +11 -75
  86. package/dist/components/docs/guides/index.d.ts +3 -0
  87. package/dist/components/docs/guides/index.js +213 -2428
  88. package/dist/components/docs/index.js +542 -24297
  89. package/dist/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -42
  90. package/dist/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -105
  91. package/dist/components/docs/integrations/IntegrationsGithubPage.js +3 -142
  92. package/dist/components/docs/integrations/IntegrationsGmailPage.js +3 -109
  93. package/dist/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -79
  94. package/dist/components/docs/integrations/IntegrationsHealthRoutingPage.js +3 -146
  95. package/dist/components/docs/integrations/IntegrationsMistralPage.js +5 -150
  96. package/dist/components/docs/integrations/IntegrationsOpenAIPage.js +5 -140
  97. package/dist/components/docs/integrations/IntegrationsOverviewPage.js +1 -160
  98. package/dist/components/docs/integrations/IntegrationsPostmarkPage.js +4 -218
  99. package/dist/components/docs/integrations/IntegrationsPowensPage.js +4 -300
  100. package/dist/components/docs/integrations/IntegrationsQdrantPage.js +5 -111
  101. package/dist/components/docs/integrations/IntegrationsResendPage.js +3 -102
  102. package/dist/components/docs/integrations/IntegrationsS3Page.js +4 -124
  103. package/dist/components/docs/integrations/IntegrationsSlackPage.js +3 -144
  104. package/dist/components/docs/integrations/IntegrationsSpecModelPage.js +7 -290
  105. package/dist/components/docs/integrations/IntegrationsStripePage.js +6 -327
  106. package/dist/components/docs/integrations/IntegrationsTwilioPage.js +3 -128
  107. package/dist/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -146
  108. package/dist/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -156
  109. package/dist/components/docs/integrations/index.js +52 -3100
  110. package/dist/components/docs/intent/ContractFirstApiPage.js +2 -126
  111. package/dist/components/docs/intent/DeterministicCodegenPage.js +2 -148
  112. package/dist/components/docs/intent/GenerateClientFromSchemaPage.js +7 -207
  113. package/dist/components/docs/intent/OpenapiAlternativePage.js +3 -201
  114. package/dist/components/docs/intent/SchemaValidationTypescriptPage.js +4 -144
  115. package/dist/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -126
  116. package/dist/components/docs/intent/index.js +15 -1135
  117. package/dist/components/docs/intent/intent-pages.docblocks.js +1 -201
  118. package/dist/components/docs/knowledge/KnowledgeCategoriesPage.js +6 -750
  119. package/dist/components/docs/knowledge/KnowledgeExamplesPage.js +4 -175
  120. package/dist/components/docs/knowledge/KnowledgeOverviewPage.js +1 -116
  121. package/dist/components/docs/knowledge/KnowledgeSourcesPage.js +8 -391
  122. package/dist/components/docs/knowledge/KnowledgeSpacesPage.js +6 -302
  123. package/dist/components/docs/knowledge/index.js +21 -1730
  124. package/dist/components/docs/libraries/LibrariesAccessibilityPage.js +3 -198
  125. package/dist/components/docs/libraries/LibrariesAiAgentPage.js +3 -141
  126. package/dist/components/docs/libraries/LibrariesAnalyticsPage.js +4 -80
  127. package/dist/components/docs/libraries/LibrariesContentGenPage.js +2 -100
  128. package/dist/components/docs/libraries/LibrariesContractsPage.js +2 -284
  129. package/dist/components/docs/libraries/LibrariesCostTrackingPage.js +3 -112
  130. package/dist/components/docs/libraries/LibrariesDataBackendPage.js +2 -166
  131. package/dist/components/docs/libraries/LibrariesDataViewsPage.js +3 -186
  132. package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +4 -279
  133. package/dist/components/docs/libraries/LibrariesEvolutionPage.js +4 -127
  134. package/dist/components/docs/libraries/LibrariesGraphQLPage.js +2 -173
  135. package/dist/components/docs/libraries/LibrariesGrowthPage.js +3 -88
  136. package/dist/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -108
  137. package/dist/components/docs/libraries/LibrariesObservabilityPage.js +5 -130
  138. package/dist/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -110
  139. package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -170
  140. package/dist/components/docs/libraries/LibrariesPersonalizationPage.js +4 -114
  141. package/dist/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -132
  142. package/dist/components/docs/libraries/LibrariesResiliencePage.js +4 -120
  143. package/dist/components/docs/libraries/LibrariesRuntimePage.js +2 -200
  144. package/dist/components/docs/libraries/LibrariesSLOPage.js +3 -116
  145. package/dist/components/docs/libraries/LibrariesSchemaPage.js +3 -273
  146. package/dist/components/docs/libraries/LibrariesSupportBotPage.js +3 -134
  147. package/dist/components/docs/libraries/LibrariesTestingPage.js +3 -133
  148. package/dist/components/docs/libraries/LibrariesUIKitPage.js +2 -230
  149. package/dist/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -88
  150. package/dist/components/docs/libraries/LibrariesWorkflowsPage.js +2 -181
  151. package/dist/components/docs/libraries/index.js +54 -4147
  152. package/dist/components/docs/manifesto/ManifestoPage.js +1 -86
  153. package/dist/components/docs/ops/AutoEvolutionOpsPage.js +2 -132
  154. package/dist/components/docs/ops/DistributedTracingOpsPage.js +2 -71
  155. package/dist/components/docs/ops/index.js +3 -202
  156. package/dist/components/docs/ops/ops-lifecycle.docblocks.js +3 -38
  157. package/dist/components/docs/ops/ops-runbooks-a.docblocks.js +3 -94
  158. package/dist/components/docs/ops/ops-runbooks-b.docblocks.js +3 -76
  159. package/dist/components/docs/ops/ops-slo-tenant.docblocks.js +3 -76
  160. package/dist/components/docs/ops/ops-top.docs.js +2 -17
  161. package/dist/components/docs/ops/ops.docs.js +10 -302
  162. package/dist/components/docs/product/product.docblocks.js +5 -72
  163. package/dist/components/docs/reference/DocsMarkdownContent.js +2 -196
  164. package/dist/components/docs/reference/DocsReferenceContent.js +3 -256
  165. package/dist/components/docs/reference/DocsReferenceIndexClient.js +2 -127
  166. package/dist/components/docs/reference/DocsReferenceIndexPage.js +2 -206
  167. package/dist/components/docs/reference/DocsReferencePage.js +3 -265
  168. package/dist/components/docs/reference/docsMarkdownParser.js +2 -92
  169. package/dist/components/docs/reference/index.js +4 -470
  170. package/dist/components/docs/safety/SafetyAuditingPage.js +2 -350
  171. package/dist/components/docs/safety/SafetyMigrationsPage.js +2 -359
  172. package/dist/components/docs/safety/SafetyOverviewPage.js +1 -101
  173. package/dist/components/docs/safety/SafetyPDPPage.js +2 -301
  174. package/dist/components/docs/safety/SafetySecurityTrustPage.js +1 -206
  175. package/dist/components/docs/safety/SafetySigningPage.js +3 -90
  176. package/dist/components/docs/safety/SafetyTenantIsolationPage.js +2 -79
  177. package/dist/components/docs/safety/index.js +7 -1480
  178. package/dist/components/docs/shared/StudioPrompt.js +1 -31
  179. package/dist/components/docs/specs/SpecsBuilderControlPlanePage.d.ts +1 -0
  180. package/dist/components/docs/specs/SpecsBuilderControlPlanePage.js +34 -0
  181. package/dist/components/docs/specs/SpecsCapabilitiesPage.js +2 -158
  182. package/dist/components/docs/specs/SpecsConnectPage.d.ts +1 -0
  183. package/dist/components/docs/specs/SpecsConnectPage.js +8 -0
  184. package/dist/components/docs/specs/SpecsDataViewsPage.js +2 -260
  185. package/dist/components/docs/specs/SpecsModuleBundlesPage.d.ts +1 -0
  186. package/dist/components/docs/specs/SpecsModuleBundlesPage.js +67 -0
  187. package/dist/components/docs/specs/SpecsOverlaysPage.js +2 -372
  188. package/dist/components/docs/specs/SpecsOverviewPage.js +1 -186
  189. package/dist/components/docs/specs/SpecsPolicyPage.js +3 -420
  190. package/dist/components/docs/specs/SpecsWorkflowsPage.js +2 -312
  191. package/dist/components/docs/specs/index.d.ts +3 -0
  192. package/dist/components/docs/specs/index.js +109 -1702
  193. package/dist/components/docs/studio/StudioBYOKPage.js +1 -26
  194. package/dist/components/docs/studio/StudioDeploymentsPage.js +1 -26
  195. package/dist/components/docs/studio/StudioGettingStartedPage.js +1 -26
  196. package/dist/components/docs/studio/StudioIntegrationsPage.js +1 -26
  197. package/dist/components/docs/studio/StudioOverviewPage.js +1 -157
  198. package/dist/components/docs/studio/StudioVisualBuilderPage.js +1 -26
  199. package/dist/components/docs/studio/index.js +1 -282
  200. package/dist/components/docs/tech/contracts/tech-docs.docblocks.js +2 -19
  201. package/dist/components/integrations/index.js +2 -600
  202. package/dist/components/integrations/molecules/IntegrationCard.js +1 -100
  203. package/dist/components/integrations/organisms/IntegrationMarketplace.js +1 -214
  204. package/dist/components/integrations/organisms/IntegrationSettings.js +2 -284
  205. package/dist/components/integrations/organisms/KnowledgeSourceList.js +1 -103
  206. package/dist/components/legal/PrivacyTemplate.js +1 -1025
  207. package/dist/components/legal/TermsTemplate.js +1 -941
  208. package/dist/components/legal/index.js +1 -1963
  209. package/dist/components/shared/FeatureGateNotice.js +1 -38
  210. package/dist/components/shared/index.js +1 -38
  211. package/dist/components/shell/WorkspaceHeader.js +1 -100
  212. package/dist/components/shell/WorkspaceProjectShellLayout.js +1 -222
  213. package/dist/components/shell/WorkspaceShellRenderer.js +1 -228
  214. package/dist/components/shell/WorkspaceSidebar.js +1 -68
  215. package/dist/components/shell/index.js +1 -287
  216. package/dist/components/templates/engine/index.js +1 -39
  217. package/dist/components/templates/index.js +11 -965
  218. package/dist/components/templates/messaging/ConversationList.js +2 -83
  219. package/dist/components/templates/messaging/MessageComposer.js +4 -150
  220. package/dist/components/templates/messaging/MessageThread.js +3 -83
  221. package/dist/components/templates/messaging/MessagingWorkspace.js +5 -265
  222. package/dist/components/templates/messaging/index.js +5 -269
  223. package/dist/components/templates/recipes/LanguageSwitcher.js +1 -16
  224. package/dist/components/templates/recipes/RecipeCard.js +1 -80
  225. package/dist/components/templates/recipes/RecipeDetail.js +1 -74
  226. package/dist/components/templates/recipes/RecipeList.js +3 -245
  227. package/dist/components/templates/recipes/index.js +3 -248
  228. package/dist/components/templates/todos/FilterBar.js +1 -107
  229. package/dist/components/templates/todos/TaskForm.js +2 -158
  230. package/dist/components/templates/todos/TaskItem.js +1 -77
  231. package/dist/components/templates/todos/TaskList.js +5 -449
  232. package/dist/components/templates/todos/index.js +5 -452
  233. package/dist/config/contractspec-blueprint.js +1 -123
  234. package/dist/config/contractspec-branding.js +1 -44
  235. package/dist/config/contractspec-routes.js +1 -24
  236. package/dist/config/index.js +1 -126
  237. package/dist/features/contracts-registry.js +1 -178
  238. package/dist/features/docs/docs.contracts.js +1 -17
  239. package/dist/features/docs/index.js +1 -17
  240. package/dist/features/docs.feature.js +1 -33
  241. package/dist/features/index.js +1 -315
  242. package/dist/features/mcp.feature.js +1 -30
  243. package/dist/features/presentations.feature.js +1 -33
  244. package/dist/features/registry.js +1 -116
  245. package/dist/index.js +556 -28580
  246. package/dist/infrastructure/elysia/index.js +1 -35
  247. package/dist/infrastructure/elysia/logger.js +1 -35
  248. package/dist/infrastructure/index.js +1 -35
  249. package/dist/libs/email/client.js +1 -114
  250. package/dist/libs/email/contact.js +12 -165
  251. package/dist/libs/email/newsletter.js +6 -167
  252. package/dist/libs/email/types.js +0 -2
  253. package/dist/libs/email/utils.js +2 -8
  254. package/dist/libs/email/waitlist-application.js +28 -209
  255. package/dist/libs/email/waitlist.js +6 -167
  256. package/dist/libs/email.js +46 -363
  257. package/dist/libs/posthog/client.js +1 -63
  258. package/dist/libs/posthog/native.js +1 -23
  259. package/dist/libs/posthog/server.js +1 -13
  260. package/dist/libs/pricing-examples.js +1 -18
  261. package/dist/node/application/context-storage/index.js +1 -28
  262. package/dist/node/application/index.js +13 -2133
  263. package/dist/node/application/mcp/cliMcp.js +4 -452
  264. package/dist/node/application/mcp/common.js +1 -193
  265. package/dist/node/application/mcp/contractsMcp.js +2 -549
  266. package/dist/node/application/mcp/contractsMcpResources.js +2 -123
  267. package/dist/node/application/mcp/contractsMcpTools.js +1 -199
  268. package/dist/node/application/mcp/docsMcp.catalog.js +3 -381
  269. package/dist/node/application/mcp/docsMcp.data.js +1 -147
  270. package/dist/node/application/mcp/docsMcp.js +6 -1039
  271. package/dist/node/application/mcp/docsMcp.prompts.js +6 -521
  272. package/dist/node/application/mcp/docsMcp.reference.js +3 -235
  273. package/dist/node/application/mcp/docsMcp.resources.js +3 -519
  274. package/dist/node/application/mcp/docsMcp.tools.js +3 -518
  275. package/dist/node/application/mcp/index.js +13 -2106
  276. package/dist/node/application/mcp/internalMcp.js +2 -410
  277. package/dist/node/application/mcp/normalizeMcpRequest.js +1 -21
  278. package/dist/node/application/mcp/providerRankingMcp.js +1 -530
  279. package/dist/node/bundles/LibraryBundle.js +1 -138
  280. package/dist/node/bundles/index.js +1 -138
  281. package/dist/node/components/docs/DocsIndexPage.js +2 -912
  282. package/dist/node/components/docs/advanced/AdvancedMCPPage.js +4 -271
  283. package/dist/node/components/docs/advanced/AdvancedOverlayEditorPage.js +1 -107
  284. package/dist/node/components/docs/advanced/AdvancedRenderersPage.js +2 -118
  285. package/dist/node/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -92
  286. package/dist/node/components/docs/advanced/AdvancedTelemetryPage.js +2 -373
  287. package/dist/node/components/docs/advanced/AdvancedWorkflowMonitoringPage.js +2 -99
  288. package/dist/node/components/docs/advanced/index.js +10 -1055
  289. package/dist/node/components/docs/architecture/ArchitectureAppConfigPage.js +6 -243
  290. package/dist/node/components/docs/architecture/ArchitectureControlPlanePage.js +3 -160
  291. package/dist/node/components/docs/architecture/ArchitectureIntegrationBindingPage.js +7 -259
  292. package/dist/node/components/docs/architecture/ArchitectureKnowledgeBindingPage.js +6 -374
  293. package/dist/node/components/docs/architecture/ArchitectureMultiTenancyPage.js +2 -166
  294. package/dist/node/components/docs/architecture/ArchitectureOverviewPage.js +1 -143
  295. package/dist/node/components/docs/architecture/index.js +20 -1340
  296. package/dist/node/components/docs/comparison/ComparisonAutomationPlatformsPage.js +1 -245
  297. package/dist/node/components/docs/comparison/ComparisonEnterprisePlatformsPage.js +1 -230
  298. package/dist/node/components/docs/comparison/ComparisonInternalToolBuildersPage.js +1 -245
  299. package/dist/node/components/docs/comparison/ComparisonOverviewPage.js +1 -202
  300. package/dist/node/components/docs/comparison/ComparisonWindmillPage.js +1 -254
  301. package/dist/node/components/docs/comparison/ComparisonWorkflowEnginesPage.js +1 -339
  302. package/dist/node/components/docs/comparison/index.js +1 -1510
  303. package/dist/node/components/docs/docsManifest.js +1 -611
  304. package/dist/node/components/docs/ecosystem/IntegrationsPage.js +2 -103
  305. package/dist/node/components/docs/ecosystem/PluginsPage.js +13 -179
  306. package/dist/node/components/docs/ecosystem/RegistryPage.js +7 -100
  307. package/dist/node/components/docs/ecosystem/TemplatesPage.js +3 -141
  308. package/dist/node/components/docs/ecosystem/ecosystem.docblocks.js +2 -48
  309. package/dist/node/components/docs/ecosystem/index.js +23 -569
  310. package/dist/node/components/docs/examples/DocsExamplesPage.js +4 -124
  311. package/dist/node/components/docs/examples/ExampleShowcasePage.js +4 -244
  312. package/dist/node/components/docs/examples/exampleShowcaseData.js +4 -39
  313. package/dist/node/components/docs/examples/index.js +4 -330
  314. package/dist/node/components/docs/generated/docs-index.generated.js +1 -5
  315. package/dist/node/components/docs/generated/index.js +1 -74
  316. package/dist/node/components/docs/generated/loader.js +1 -74
  317. package/dist/node/components/docs/getting-started/CLIPage.js +4 -271
  318. package/dist/node/components/docs/getting-started/CompatibilityPage.js +1 -173
  319. package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +4 -134
  320. package/dist/node/components/docs/getting-started/DeveloperToolsPage.js +1 -194
  321. package/dist/node/components/docs/getting-started/HelloWorldPage.js +5 -183
  322. package/dist/node/components/docs/getting-started/InstallationPage.js +3 -154
  323. package/dist/node/components/docs/getting-started/StartHerePage.js +2 -129
  324. package/dist/node/components/docs/getting-started/TroubleshootingPage.js +2 -168
  325. package/dist/node/components/docs/getting-started/VSCodeExtensionPage.js +1 -432
  326. package/dist/node/components/docs/getting-started/getting-started.docblocks.js +4 -41
  327. package/dist/node/components/docs/getting-started/index.js +18 -1869
  328. package/dist/node/components/docs/guides/GuideCIDiffGatingPage.js +2 -196
  329. package/dist/node/components/docs/guides/GuideConnectInRepoPage.js +43 -0
  330. package/dist/node/components/docs/guides/GuideContractTypesPage.js +6 -541
  331. package/dist/node/components/docs/guides/GuideDocsPipelinePage.js +3 -207
  332. package/dist/node/components/docs/guides/GuideFirstModuleBundlePage.js +75 -0
  333. package/dist/node/components/docs/guides/GuideGenerateDocsClientsSchemasPage.js +2 -209
  334. package/dist/node/components/docs/guides/GuideHostBuilderWorkbenchPage.js +69 -0
  335. package/dist/node/components/docs/guides/GuideImportExistingCodebasesPage.js +8 -754
  336. package/dist/node/components/docs/guides/GuideNextjsOneEndpointPage.js +6 -268
  337. package/dist/node/components/docs/guides/GuideSpecValidationTypingPage.js +4 -196
  338. package/dist/node/components/docs/guides/GuidesIndexPage.js +2 -169
  339. package/dist/node/components/docs/guides/guides.docblocks.js +11 -75
  340. package/dist/node/components/docs/guides/index.js +213 -2428
  341. package/dist/node/components/docs/index.js +542 -24297
  342. package/dist/node/components/docs/integrations/IntegrationsCircuitBreakersPage.js +2 -42
  343. package/dist/node/components/docs/integrations/IntegrationsElevenLabsPage.js +3 -105
  344. package/dist/node/components/docs/integrations/IntegrationsGithubPage.js +3 -142
  345. package/dist/node/components/docs/integrations/IntegrationsGmailPage.js +3 -109
  346. package/dist/node/components/docs/integrations/IntegrationsGoogleCalendarPage.js +3 -79
  347. package/dist/node/components/docs/integrations/IntegrationsHealthRoutingPage.js +3 -146
  348. package/dist/node/components/docs/integrations/IntegrationsMistralPage.js +5 -150
  349. package/dist/node/components/docs/integrations/IntegrationsOpenAIPage.js +5 -140
  350. package/dist/node/components/docs/integrations/IntegrationsOverviewPage.js +1 -160
  351. package/dist/node/components/docs/integrations/IntegrationsPostmarkPage.js +4 -218
  352. package/dist/node/components/docs/integrations/IntegrationsPowensPage.js +4 -300
  353. package/dist/node/components/docs/integrations/IntegrationsQdrantPage.js +5 -111
  354. package/dist/node/components/docs/integrations/IntegrationsResendPage.js +3 -102
  355. package/dist/node/components/docs/integrations/IntegrationsS3Page.js +4 -124
  356. package/dist/node/components/docs/integrations/IntegrationsSlackPage.js +3 -144
  357. package/dist/node/components/docs/integrations/IntegrationsSpecModelPage.js +7 -290
  358. package/dist/node/components/docs/integrations/IntegrationsStripePage.js +6 -327
  359. package/dist/node/components/docs/integrations/IntegrationsTwilioPage.js +3 -128
  360. package/dist/node/components/docs/integrations/IntegrationsWhatsappMetaPage.js +2 -146
  361. package/dist/node/components/docs/integrations/IntegrationsWhatsappTwilioPage.js +2 -156
  362. package/dist/node/components/docs/integrations/index.js +52 -3100
  363. package/dist/node/components/docs/intent/ContractFirstApiPage.js +2 -126
  364. package/dist/node/components/docs/intent/DeterministicCodegenPage.js +2 -148
  365. package/dist/node/components/docs/intent/GenerateClientFromSchemaPage.js +7 -207
  366. package/dist/node/components/docs/intent/OpenapiAlternativePage.js +3 -201
  367. package/dist/node/components/docs/intent/SchemaValidationTypescriptPage.js +4 -144
  368. package/dist/node/components/docs/intent/SpecDrivenDevelopmentPage.js +2 -126
  369. package/dist/node/components/docs/intent/index.js +15 -1135
  370. package/dist/node/components/docs/intent/intent-pages.docblocks.js +1 -201
  371. package/dist/node/components/docs/knowledge/KnowledgeCategoriesPage.js +6 -750
  372. package/dist/node/components/docs/knowledge/KnowledgeExamplesPage.js +4 -175
  373. package/dist/node/components/docs/knowledge/KnowledgeOverviewPage.js +1 -116
  374. package/dist/node/components/docs/knowledge/KnowledgeSourcesPage.js +8 -391
  375. package/dist/node/components/docs/knowledge/KnowledgeSpacesPage.js +6 -302
  376. package/dist/node/components/docs/knowledge/index.js +21 -1730
  377. package/dist/node/components/docs/libraries/LibrariesAccessibilityPage.js +3 -198
  378. package/dist/node/components/docs/libraries/LibrariesAiAgentPage.js +3 -141
  379. package/dist/node/components/docs/libraries/LibrariesAnalyticsPage.js +4 -80
  380. package/dist/node/components/docs/libraries/LibrariesContentGenPage.js +2 -100
  381. package/dist/node/components/docs/libraries/LibrariesContractsPage.js +2 -284
  382. package/dist/node/components/docs/libraries/LibrariesCostTrackingPage.js +3 -112
  383. package/dist/node/components/docs/libraries/LibrariesDataBackendPage.js +2 -166
  384. package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +3 -186
  385. package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +4 -279
  386. package/dist/node/components/docs/libraries/LibrariesEvolutionPage.js +4 -127
  387. package/dist/node/components/docs/libraries/LibrariesGraphQLPage.js +2 -173
  388. package/dist/node/components/docs/libraries/LibrariesGrowthPage.js +3 -88
  389. package/dist/node/components/docs/libraries/LibrariesMultiTenancyPage.js +3 -108
  390. package/dist/node/components/docs/libraries/LibrariesObservabilityPage.js +5 -130
  391. package/dist/node/components/docs/libraries/LibrariesOverlayEnginePage.js +4 -110
  392. package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -170
  393. package/dist/node/components/docs/libraries/LibrariesPersonalizationPage.js +4 -114
  394. package/dist/node/components/docs/libraries/LibrariesProgressiveDeliveryPage.js +3 -132
  395. package/dist/node/components/docs/libraries/LibrariesResiliencePage.js +4 -120
  396. package/dist/node/components/docs/libraries/LibrariesRuntimePage.js +2 -200
  397. package/dist/node/components/docs/libraries/LibrariesSLOPage.js +3 -116
  398. package/dist/node/components/docs/libraries/LibrariesSchemaPage.js +3 -273
  399. package/dist/node/components/docs/libraries/LibrariesSupportBotPage.js +3 -134
  400. package/dist/node/components/docs/libraries/LibrariesTestingPage.js +3 -133
  401. package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +2 -230
  402. package/dist/node/components/docs/libraries/LibrariesWorkflowComposerPage.js +3 -88
  403. package/dist/node/components/docs/libraries/LibrariesWorkflowsPage.js +2 -181
  404. package/dist/node/components/docs/libraries/index.js +54 -4147
  405. package/dist/node/components/docs/manifesto/ManifestoPage.js +1 -86
  406. package/dist/node/components/docs/ops/AutoEvolutionOpsPage.js +2 -132
  407. package/dist/node/components/docs/ops/DistributedTracingOpsPage.js +2 -71
  408. package/dist/node/components/docs/ops/index.js +3 -202
  409. package/dist/node/components/docs/ops/ops-lifecycle.docblocks.js +3 -38
  410. package/dist/node/components/docs/ops/ops-runbooks-a.docblocks.js +3 -94
  411. package/dist/node/components/docs/ops/ops-runbooks-b.docblocks.js +3 -76
  412. package/dist/node/components/docs/ops/ops-slo-tenant.docblocks.js +3 -76
  413. package/dist/node/components/docs/ops/ops-top.docs.js +2 -17
  414. package/dist/node/components/docs/ops/ops.docs.js +10 -302
  415. package/dist/node/components/docs/product/product.docblocks.js +5 -72
  416. package/dist/node/components/docs/reference/DocsMarkdownContent.js +2 -196
  417. package/dist/node/components/docs/reference/DocsReferenceContent.js +3 -256
  418. package/dist/node/components/docs/reference/DocsReferenceIndexClient.js +2 -127
  419. package/dist/node/components/docs/reference/DocsReferenceIndexPage.js +2 -206
  420. package/dist/node/components/docs/reference/DocsReferencePage.js +3 -265
  421. package/dist/node/components/docs/reference/docsMarkdownParser.js +2 -92
  422. package/dist/node/components/docs/reference/index.js +4 -470
  423. package/dist/node/components/docs/safety/SafetyAuditingPage.js +2 -350
  424. package/dist/node/components/docs/safety/SafetyMigrationsPage.js +2 -359
  425. package/dist/node/components/docs/safety/SafetyOverviewPage.js +1 -101
  426. package/dist/node/components/docs/safety/SafetyPDPPage.js +2 -301
  427. package/dist/node/components/docs/safety/SafetySecurityTrustPage.js +1 -206
  428. package/dist/node/components/docs/safety/SafetySigningPage.js +3 -90
  429. package/dist/node/components/docs/safety/SafetyTenantIsolationPage.js +2 -79
  430. package/dist/node/components/docs/safety/index.js +7 -1480
  431. package/dist/node/components/docs/shared/StudioPrompt.js +1 -31
  432. package/dist/node/components/docs/specs/SpecsBuilderControlPlanePage.js +33 -0
  433. package/dist/node/components/docs/specs/SpecsCapabilitiesPage.js +2 -158
  434. package/dist/node/components/docs/specs/SpecsConnectPage.js +7 -0
  435. package/dist/node/components/docs/specs/SpecsDataViewsPage.js +2 -260
  436. package/dist/node/components/docs/specs/SpecsModuleBundlesPage.js +66 -0
  437. package/dist/node/components/docs/specs/SpecsOverlaysPage.js +2 -372
  438. package/dist/node/components/docs/specs/SpecsOverviewPage.js +1 -186
  439. package/dist/node/components/docs/specs/SpecsPolicyPage.js +3 -420
  440. package/dist/node/components/docs/specs/SpecsWorkflowsPage.js +2 -312
  441. package/dist/node/components/docs/specs/index.js +109 -1702
  442. package/dist/node/components/docs/studio/StudioBYOKPage.js +1 -26
  443. package/dist/node/components/docs/studio/StudioDeploymentsPage.js +1 -26
  444. package/dist/node/components/docs/studio/StudioGettingStartedPage.js +1 -26
  445. package/dist/node/components/docs/studio/StudioIntegrationsPage.js +1 -26
  446. package/dist/node/components/docs/studio/StudioOverviewPage.js +1 -157
  447. package/dist/node/components/docs/studio/StudioVisualBuilderPage.js +1 -26
  448. package/dist/node/components/docs/studio/index.js +1 -282
  449. package/dist/node/components/docs/tech/contracts/tech-docs.docblocks.js +2 -19
  450. package/dist/node/components/integrations/index.js +2 -600
  451. package/dist/node/components/integrations/molecules/IntegrationCard.js +1 -100
  452. package/dist/node/components/integrations/organisms/IntegrationMarketplace.js +1 -214
  453. package/dist/node/components/integrations/organisms/IntegrationSettings.js +2 -284
  454. package/dist/node/components/integrations/organisms/KnowledgeSourceList.js +1 -103
  455. package/dist/node/components/legal/PrivacyTemplate.js +1 -1025
  456. package/dist/node/components/legal/TermsTemplate.js +1 -941
  457. package/dist/node/components/legal/index.js +1 -1963
  458. package/dist/node/components/shared/FeatureGateNotice.js +1 -38
  459. package/dist/node/components/shared/index.js +1 -38
  460. package/dist/node/components/shell/WorkspaceHeader.js +1 -100
  461. package/dist/node/components/shell/WorkspaceProjectShellLayout.js +1 -222
  462. package/dist/node/components/shell/WorkspaceShellRenderer.js +1 -228
  463. package/dist/node/components/shell/WorkspaceSidebar.js +1 -68
  464. package/dist/node/components/shell/index.js +1 -287
  465. package/dist/node/components/templates/engine/index.js +1 -39
  466. package/dist/node/components/templates/index.js +11 -965
  467. package/dist/node/components/templates/messaging/ConversationList.js +2 -83
  468. package/dist/node/components/templates/messaging/MessageComposer.js +4 -150
  469. package/dist/node/components/templates/messaging/MessageThread.js +3 -83
  470. package/dist/node/components/templates/messaging/MessagingWorkspace.js +5 -265
  471. package/dist/node/components/templates/messaging/index.js +5 -269
  472. package/dist/node/components/templates/recipes/LanguageSwitcher.js +1 -16
  473. package/dist/node/components/templates/recipes/RecipeCard.js +1 -80
  474. package/dist/node/components/templates/recipes/RecipeDetail.js +1 -74
  475. package/dist/node/components/templates/recipes/RecipeList.js +3 -245
  476. package/dist/node/components/templates/recipes/index.js +3 -248
  477. package/dist/node/components/templates/todos/FilterBar.js +1 -107
  478. package/dist/node/components/templates/todos/TaskForm.js +2 -158
  479. package/dist/node/components/templates/todos/TaskItem.js +1 -77
  480. package/dist/node/components/templates/todos/TaskList.js +5 -449
  481. package/dist/node/components/templates/todos/index.js +5 -452
  482. package/dist/node/config/contractspec-blueprint.js +1 -123
  483. package/dist/node/config/contractspec-branding.js +1 -44
  484. package/dist/node/config/contractspec-routes.js +1 -24
  485. package/dist/node/config/index.js +1 -126
  486. package/dist/node/features/contracts-registry.js +1 -178
  487. package/dist/node/features/docs/docs.contracts.js +1 -17
  488. package/dist/node/features/docs/index.js +1 -17
  489. package/dist/node/features/docs.feature.js +1 -33
  490. package/dist/node/features/index.js +1 -315
  491. package/dist/node/features/mcp.feature.js +1 -30
  492. package/dist/node/features/presentations.feature.js +1 -33
  493. package/dist/node/features/registry.js +1 -116
  494. package/dist/node/index.js +556 -28580
  495. package/dist/node/infrastructure/elysia/index.js +1 -35
  496. package/dist/node/infrastructure/elysia/logger.js +1 -35
  497. package/dist/node/infrastructure/index.js +1 -35
  498. package/dist/node/libs/email/client.js +1 -114
  499. package/dist/node/libs/email/contact.js +12 -165
  500. package/dist/node/libs/email/newsletter.js +6 -167
  501. package/dist/node/libs/email/types.js +0 -2
  502. package/dist/node/libs/email/utils.js +2 -8
  503. package/dist/node/libs/email/waitlist-application.js +28 -209
  504. package/dist/node/libs/email/waitlist.js +6 -167
  505. package/dist/node/libs/email.js +46 -363
  506. package/dist/node/libs/posthog/client.js +1 -63
  507. package/dist/node/libs/posthog/native.js +1 -23
  508. package/dist/node/libs/posthog/server.js +1 -13
  509. package/dist/node/libs/pricing-examples.js +1 -18
  510. package/dist/node/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -97
  511. package/dist/node/presentation/features/atoms/FeatureIcon/index.js +1 -97
  512. package/dist/node/presentation/features/atoms/index.js +1 -97
  513. package/dist/node/presentation/features/hooks/index.js +1 -397
  514. package/dist/node/presentation/features/hooks/useContractsRegistry.js +1 -289
  515. package/dist/node/presentation/features/hooks/useFeatureFilters.js +1 -75
  516. package/dist/node/presentation/features/hooks/useFeatureRegistry.js +1 -147
  517. package/dist/node/presentation/features/hooks/useRelatedDocs.js +1 -28
  518. package/dist/node/presentation/features/index.js +1 -3063
  519. package/dist/node/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -366
  520. package/dist/node/presentation/features/molecules/FeatureCard/index.js +1 -366
  521. package/dist/node/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -50
  522. package/dist/node/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -50
  523. package/dist/node/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -92
  524. package/dist/node/presentation/features/molecules/FeatureFilters/index.js +1 -92
  525. package/dist/node/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -176
  526. package/dist/node/presentation/features/molecules/FeatureHoverPreview/index.js +1 -176
  527. package/dist/node/presentation/features/molecules/index.js +1 -505
  528. package/dist/node/presentation/features/organisms/FeatureDataViewsList.js +1 -304
  529. package/dist/node/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -154
  530. package/dist/node/presentation/features/organisms/FeatureDetail/index.js +1 -154
  531. package/dist/node/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -909
  532. package/dist/node/presentation/features/organisms/FeatureDiscovery/index.js +1 -909
  533. package/dist/node/presentation/features/organisms/FeatureEventsList.js +1 -302
  534. package/dist/node/presentation/features/organisms/FeatureFormsList.js +1 -302
  535. package/dist/node/presentation/features/organisms/FeatureOperationsList.js +1 -180
  536. package/dist/node/presentation/features/organisms/FeaturePresentationsList.js +1 -304
  537. package/dist/node/presentation/features/organisms/index.js +1 -1359
  538. package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -332
  539. package/dist/node/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -332
  540. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -342
  541. package/dist/node/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -342
  542. package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -303
  543. package/dist/node/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -303
  544. package/dist/node/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -340
  545. package/dist/node/presentation/features/templates/FeatureEventsTemplate/index.js +1 -340
  546. package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -329
  547. package/dist/node/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -329
  548. package/dist/node/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -340
  549. package/dist/node/presentation/features/templates/FeatureFormsTemplate/index.js +1 -340
  550. package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -302
  551. package/dist/node/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -302
  552. package/dist/node/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -218
  553. package/dist/node/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -218
  554. package/dist/node/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -187
  555. package/dist/node/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -187
  556. package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -306
  557. package/dist/node/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -306
  558. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -342
  559. package/dist/node/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -342
  560. package/dist/presentation/features/atoms/FeatureIcon/FeatureIcon.js +1 -97
  561. package/dist/presentation/features/atoms/FeatureIcon/index.js +1 -97
  562. package/dist/presentation/features/atoms/index.js +1 -97
  563. package/dist/presentation/features/hooks/index.js +1 -397
  564. package/dist/presentation/features/hooks/useContractsRegistry.js +1 -289
  565. package/dist/presentation/features/hooks/useFeatureFilters.js +1 -75
  566. package/dist/presentation/features/hooks/useFeatureRegistry.js +1 -147
  567. package/dist/presentation/features/hooks/useRelatedDocs.js +1 -28
  568. package/dist/presentation/features/index.js +1 -3063
  569. package/dist/presentation/features/molecules/FeatureCard/FeatureCard.js +1 -366
  570. package/dist/presentation/features/molecules/FeatureCard/index.js +1 -366
  571. package/dist/presentation/features/molecules/FeatureCategoryHeader/FeatureCategoryHeader.js +1 -50
  572. package/dist/presentation/features/molecules/FeatureCategoryHeader/index.js +1 -50
  573. package/dist/presentation/features/molecules/FeatureFilters/FeatureFilters.js +1 -92
  574. package/dist/presentation/features/molecules/FeatureFilters/index.js +1 -92
  575. package/dist/presentation/features/molecules/FeatureHoverPreview/FeatureHoverPreview.js +1 -176
  576. package/dist/presentation/features/molecules/FeatureHoverPreview/index.js +1 -176
  577. package/dist/presentation/features/molecules/index.js +1 -505
  578. package/dist/presentation/features/organisms/FeatureDataViewsList.js +1 -304
  579. package/dist/presentation/features/organisms/FeatureDetail/FeatureDetail.js +1 -154
  580. package/dist/presentation/features/organisms/FeatureDetail/index.js +1 -154
  581. package/dist/presentation/features/organisms/FeatureDiscovery/FeatureDiscovery.js +1 -909
  582. package/dist/presentation/features/organisms/FeatureDiscovery/index.js +1 -909
  583. package/dist/presentation/features/organisms/FeatureEventsList.js +1 -302
  584. package/dist/presentation/features/organisms/FeatureFormsList.js +1 -302
  585. package/dist/presentation/features/organisms/FeatureOperationsList.js +1 -180
  586. package/dist/presentation/features/organisms/FeaturePresentationsList.js +1 -304
  587. package/dist/presentation/features/organisms/index.js +1 -1359
  588. package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/FeatureDataViewDetailTemplate.js +1 -332
  589. package/dist/presentation/features/templates/FeatureDataViewDetailTemplate/index.js +1 -332
  590. package/dist/presentation/features/templates/FeatureDataViewsTemplate/FeatureDataViewsTemplate.js +1 -342
  591. package/dist/presentation/features/templates/FeatureDataViewsTemplate/index.js +1 -342
  592. package/dist/presentation/features/templates/FeatureEventDetailTemplate/FeatureEventDetailTemplate.js +1 -303
  593. package/dist/presentation/features/templates/FeatureEventDetailTemplate/index.js +1 -303
  594. package/dist/presentation/features/templates/FeatureEventsTemplate/FeatureEventsTemplate.js +1 -340
  595. package/dist/presentation/features/templates/FeatureEventsTemplate/index.js +1 -340
  596. package/dist/presentation/features/templates/FeatureFormDetailTemplate/FeatureFormDetailTemplate.js +1 -329
  597. package/dist/presentation/features/templates/FeatureFormDetailTemplate/index.js +1 -329
  598. package/dist/presentation/features/templates/FeatureFormsTemplate/FeatureFormsTemplate.js +1 -340
  599. package/dist/presentation/features/templates/FeatureFormsTemplate/index.js +1 -340
  600. package/dist/presentation/features/templates/FeatureOperationDetailTemplate/FeatureOperationDetailTemplate.js +1 -302
  601. package/dist/presentation/features/templates/FeatureOperationDetailTemplate/index.js +1 -302
  602. package/dist/presentation/features/templates/FeatureOperationsTemplate/FeatureOperationsTemplate.js +1 -218
  603. package/dist/presentation/features/templates/FeatureOperationsTemplate/index.js +1 -218
  604. package/dist/presentation/features/templates/FeatureOverviewTemplate/FeatureOverviewTemplate.js +1 -187
  605. package/dist/presentation/features/templates/FeatureOverviewTemplate/index.js +1 -187
  606. package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/FeaturePresentationDetailTemplate.js +1 -306
  607. package/dist/presentation/features/templates/FeaturePresentationDetailTemplate/index.js +1 -306
  608. package/dist/presentation/features/templates/FeaturePresentationsTemplate/FeaturePresentationsTemplate.js +1 -342
  609. package/dist/presentation/features/templates/FeaturePresentationsTemplate/index.js +1 -342
  610. package/package.json +109 -37
  611. package/src/components/docs/DocsIndexPage.tsx +55 -0
  612. package/src/components/docs/architecture/ArchitectureControlPlanePage.tsx +19 -0
  613. package/src/components/docs/architecture/ArchitectureOverviewPage.tsx +34 -0
  614. package/src/components/docs/docsManifest.test.ts +70 -0
  615. package/src/components/docs/docsManifest.ts +71 -1
  616. package/src/components/docs/ecosystem/PluginsPage.tsx +24 -10
  617. package/src/components/docs/ecosystem/RegistryPage.tsx +11 -6
  618. package/src/components/docs/generated/docs-index._common.json +206 -273
  619. package/src/components/docs/generated/docs-index.control-plane.json +18 -0
  620. package/src/components/docs/generated/docs-index.defineExample.json +10 -0
  621. package/src/components/docs/generated/docs-index.manifest.json +22 -12
  622. package/src/components/docs/generated/docs-index.platform-acp.json +64 -0
  623. package/src/components/docs/generated/docs-index.platform-agent.json +89 -1
  624. package/src/components/docs/generated/docs-index.platform-context.json +48 -0
  625. package/src/components/docs/generated/docs-index.platform-control-plane.json +72 -0
  626. package/src/components/docs/generated/docs-index.platform-database.json +40 -0
  627. package/src/components/docs/generated/docs-index.platform-docs.json +64 -0
  628. package/src/components/docs/generated/docs-index.platform-provider-ranking.json +89 -1
  629. package/src/components/docs/generated/docs-index.pocket-family-office.json +8 -0
  630. package/src/components/docs/generated/docs-index.unknown.json +8 -0
  631. package/src/components/docs/guides/GuideConnectInRepoPage.tsx +184 -0
  632. package/src/components/docs/guides/GuideFirstModuleBundlePage.tsx +182 -0
  633. package/src/components/docs/guides/GuideHostBuilderWorkbenchPage.tsx +230 -0
  634. package/src/components/docs/guides/GuidesIndexPage.tsx +21 -0
  635. package/src/components/docs/guides/index.ts +3 -0
  636. package/src/components/docs/specs/SpecsBuilderControlPlanePage.tsx +210 -0
  637. package/src/components/docs/specs/SpecsConnectPage.tsx +162 -0
  638. package/src/components/docs/specs/SpecsModuleBundlesPage.tsx +223 -0
  639. package/src/components/docs/specs/SpecsOverlaysPage.tsx +20 -0
  640. package/src/components/docs/specs/SpecsOverviewPage.tsx +44 -0
  641. package/src/components/docs/specs/SpecsWorkflowsPage.tsx +9 -1
  642. package/src/components/docs/specs/index.ts +3 -0
  643. package/src/components/docs/studio/StudioOverviewPage.tsx +26 -0
  644. package/src/infrastructure/elysia/logger.ts +11 -3
@@ -1,52 +1,37 @@
1
1
  // @bun
2
- // src/components/docs/specs/SpecsCapabilitiesPage.tsx
3
- import Link from "@contractspec/lib.ui-link";
4
- import { ChevronRight } from "lucide-react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- function SpecsCapabilitiesPage() {
7
- return /* @__PURE__ */ jsxs("div", {
8
- className: "space-y-8",
9
- children: [
10
- /* @__PURE__ */ jsxs("div", {
11
- className: "space-y-2",
12
- children: [
13
- /* @__PURE__ */ jsx("h1", {
14
- className: "font-bold text-4xl",
15
- children: "Capabilities"
16
- }),
17
- /* @__PURE__ */ jsx("p", {
18
- className: "text-lg text-muted-foreground",
19
- children: "Capabilities are the core building block of ContractSpec. They define what your app can do."
20
- })
21
- ]
22
- }),
23
- /* @__PURE__ */ jsxs("div", {
24
- className: "space-y-6",
25
- children: [
26
- /* @__PURE__ */ jsxs("div", {
27
- className: "space-y-3",
28
- children: [
29
- /* @__PURE__ */ jsx("h2", {
30
- className: "font-bold text-2xl",
31
- children: "Overview"
32
- }),
33
- /* @__PURE__ */ jsx("p", {
34
- className: "text-muted-foreground",
35
- children: "A ContractSpec (or Capability) is a typed, declarative description of an operation. It defines the operation's name, version, inputs, outputs, policies, and side effects. Runtime adapters automatically serve these as REST/GraphQL/MCP endpoints with full validation and policy enforcement."
36
- })
37
- ]
38
- }),
39
- /* @__PURE__ */ jsxs("div", {
40
- className: "space-y-3",
41
- children: [
42
- /* @__PURE__ */ jsx("h2", {
43
- className: "font-bold text-2xl",
44
- children: "Defining a Command (Write)"
45
- }),
46
- /* @__PURE__ */ jsx("div", {
47
- className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
48
- children: /* @__PURE__ */ jsx("pre", {
49
- children: `import { defineCommand } from '@contractspec/lib.contracts-spec';
2
+ import{CodeBlock as S}from"@contractspec/lib.design-system";import P from"@contractspec/lib.ui-link";import{jsx as n,jsxs as u}from"react/jsx-runtime";var D=[{title:"Managed",body:"Best when the team wants the platform to own setup, routing, readiness, and mobile-safe defaults."},{title:"Local",body:"Best for power users who want tenant-local execution providers and tighter data-locality control."},{title:"Hybrid",body:"Best when some work should stay local while preview, review, or export flows still use managed coordination."}],O=["Capture prompts, files, voice, and other inbound sources into a typed workspace instead of relying on a single chat transcript.","Fuse the sources into decisions, assumptions, and blueprint updates with provenance and approval memory.","Compile authoring work into execution lanes, then route the work to explicit provider profiles and runtime targets.","Create previews, run readiness gates, and record receipts before export becomes an operator action.","Keep mobile review parity so approvals, incidents, and patch proposals can be inspected away from the desktop workbench."];function W(){return u("div",{className:"space-y-10",children:[u("section",{className:"space-y-3",children:[n("p",{className:"editorial-kicker",children:"Spec pack"}),n("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Builder is a governed authoring control plane, not a frontier coding agent."}),u("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented Builder stack sits across"," ",n("code",{children:"@contractspec/lib.builder-spec"}),","," ",n("code",{children:"@contractspec/lib.builder-runtime"}),","," ",n("code",{children:"@contractspec/lib.provider-spec"}),", and the reusable workbench/mobile modules. It orchestrates inputs, provider routing, readiness, and export decisions on top of the OSS ContractSpec foundation and the Studio operating layer."]})]}),u("section",{className:"editorial-proof-strip",children:[u("div",{className:"editorial-stat",children:[n("span",{className:"editorial-label",children:"What Builder owns"}),n("span",{className:"editorial-stat-value",children:"fusion, routing, readiness, export"})]}),n("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Builder delegates synthesis and coding to external execution providers. Its job is to keep those runs policy-aware, provenance-rich, and usable from both desktop and mobile operator surfaces."})]}),u("section",{className:"editorial-panel space-y-5",children:[u("div",{className:"space-y-2",children:[n("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Implemented stack and entrypoints"}),n("p",{className:"text-muted-foreground text-sm leading-7",children:"You can use the type surfaces directly in code, or start from the already wired workbench and mobile review routes in the public app shell."})]}),n(S,{language:"text",filename:"builder-stack",code:`Packages
3
+ - @contractspec/lib.builder-spec
4
+ - @contractspec/lib.builder-runtime
5
+ - @contractspec/lib.provider-spec
6
+ - @contractspec/module.builder-workbench
7
+ - @contractspec/module.mobile-review
8
+
9
+ Web app routes
10
+ - /operate/builder/workspaces/:workspaceId
11
+ - /operate/builder/workspaces/:workspaceId/mobile-review/:cardId
12
+
13
+ Operate API proxy
14
+ - /api/operate/builder/queries/builder.workspace.snapshot
15
+ - /api/operate/builder/commands/builder.blueprint.patch
16
+ - /api/operate/builder/commands/builder.export.execute`})]}),n("section",{className:"grid gap-4 md:grid-cols-3",children:D.map((c)=>u("article",{className:"editorial-panel space-y-3",children:[n("h2",{className:"font-semibold text-xl",children:c.title}),n("p",{className:"text-muted-foreground text-sm leading-7",children:c.body})]},c.title))}),u("section",{className:"grid gap-5 lg:grid-cols-2",children:[u("article",{className:"editorial-panel space-y-4",children:[n("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Typical Builder loop"}),n("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:O.map((c)=>n("li",{children:c},c))})]}),u("article",{className:"editorial-panel space-y-4",children:[n("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What Builder should not become"}),u("ul",{className:"editorial-list",children:[u("li",{children:[n("span",{className:"editorial-list-marker"}),n("span",{children:"Not a competitor to specialized coding agents such as Codex or Claude Code."})]}),u("li",{children:[n("span",{className:"editorial-list-marker"}),n("span",{children:"Not a managed-only product that traps teams away from OSS-local runtime paths."})]}),u("li",{children:[n("span",{className:"editorial-list-marker"}),n("span",{children:"Not a hidden routing layer that obscures provider provenance, receipts, or runtime mode."})]}),u("li",{children:[n("span",{className:"editorial-list-marker"}),n("span",{children:"Not a desktop-only surface. Mobile review parity is part of the control-plane contract."})]})]})]})]}),u("section",{className:"editorial-panel space-y-5",children:[u("div",{className:"space-y-2",children:[n("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Use the workbench UI as the host surface"}),n("p",{className:"text-muted-foreground text-sm leading-7",children:"The reusable module already exposes the desktop workbench shell. Your host app keeps control of action wiring, runtime mode selection, and approval flows."})]}),n(S,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import { BuilderWorkbench, useBuilderWorkbenchState } from "@contractspec/module.builder-workbench";
17
+
18
+ const state = useBuilderWorkbenchState({
19
+ workspace: initialSnapshot.workspace,
20
+ initialSnapshot,
21
+ });
22
+
23
+ <BuilderWorkbench
24
+ snapshot={state.snapshot}
25
+ promptDraft={state.promptDraft}
26
+ onPromptDraftChange={state.setPromptDraft}
27
+ onCapturePrompt={capturePrompt}
28
+ onGenerateBlueprint={generateBlueprint}
29
+ onCompilePlan={compilePlan}
30
+ onCreatePreview={createPreview}
31
+ onRunReadiness={runReadiness}
32
+ onExecuteExport={executeExport}
33
+ selectedExportRuntimeMode="hybrid"
34
+ />;`})]}),u("section",{className:"editorial-panel space-y-4",children:[n("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Read this with the Studio bridge in mind"}),n("p",{className:"text-muted-foreground text-sm leading-7",children:"Builder is where the OSS foundation meets the richer operating layer. Use the Studio overview when you want the higher-level product posture and team workflows on top of these contracts."}),u("div",{className:"flex flex-wrap gap-3",children:[n(P,{href:"/docs/studio",className:"btn-primary",children:"Studio overview"}),n(P,{href:"/docs/architecture/control-plane",className:"btn-ghost",children:"Control-plane runtime"})]})]})]})}import M from"@contractspec/lib.ui-link";import{ChevronRight as R}from"lucide-react";import{jsx as g,jsxs as v}from"react/jsx-runtime";function z(){return v("div",{className:"space-y-8",children:[v("div",{className:"space-y-2",children:[g("h1",{className:"font-bold text-4xl",children:"Capabilities"}),g("p",{className:"text-lg text-muted-foreground",children:"Capabilities are the core building block of ContractSpec. They define what your app can do."})]}),v("div",{className:"space-y-6",children:[v("div",{className:"space-y-3",children:[g("h2",{className:"font-bold text-2xl",children:"Overview"}),g("p",{className:"text-muted-foreground",children:"A ContractSpec (or Capability) is a typed, declarative description of an operation. It defines the operation's name, version, inputs, outputs, policies, and side effects. Runtime adapters automatically serve these as REST/GraphQL/MCP endpoints with full validation and policy enforcement."})]}),v("div",{className:"space-y-3",children:[g("h2",{className:"font-bold text-2xl",children:"Defining a Command (Write)"}),g("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:g("pre",{children:`import { defineCommand } from '@contractspec/lib.contracts-spec';
50
35
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
51
36
 
52
37
  const TransferFundsInput = new SchemaModel({
@@ -84,230 +69,13 @@ export const TransferFunds = defineCommand({
84
69
  auth: 'user',
85
70
  flags: ['payments_enabled'],
86
71
  },
87
- });`
88
- })
89
- })
90
- ]
91
- }),
92
- /* @__PURE__ */ jsxs("div", {
93
- className: "space-y-3",
94
- children: [
95
- /* @__PURE__ */ jsx("h2", {
96
- className: "font-bold text-2xl",
97
- children: "Schema Types"
98
- }),
99
- /* @__PURE__ */ jsxs("p", {
100
- className: "text-muted-foreground",
101
- children: [
102
- "ContractSpec uses ",
103
- /* @__PURE__ */ jsx("code", {
104
- children: "@contractspec/lib.schema"
105
- }),
106
- " for I/O definitions. This provides Zod validation, GraphQL types, and JSON Schema from a single source."
107
- ]
108
- }),
109
- /* @__PURE__ */ jsxs("ul", {
110
- className: "space-y-2 text-muted-foreground",
111
- children: [
112
- /* @__PURE__ */ jsxs("li", {
113
- children: [
114
- "\u2022",
115
- " ",
116
- /* @__PURE__ */ jsx("code", {
117
- className: "rounded bg-background/50 px-2 py-1",
118
- children: "ScalarTypeEnum.NonEmptyString()"
119
- }),
120
- " ",
121
- "- Non-empty text"
122
- ]
123
- }),
124
- /* @__PURE__ */ jsxs("li", {
125
- children: [
126
- "\u2022",
127
- " ",
128
- /* @__PURE__ */ jsx("code", {
129
- className: "rounded bg-background/50 px-2 py-1",
130
- children: "ScalarTypeEnum.PositiveNumber()"
131
- }),
132
- " ",
133
- "- Positive numbers"
134
- ]
135
- }),
136
- /* @__PURE__ */ jsxs("li", {
137
- children: [
138
- "\u2022",
139
- " ",
140
- /* @__PURE__ */ jsx("code", {
141
- className: "rounded bg-background/50 px-2 py-1",
142
- children: "ScalarTypeEnum.DateTime()"
143
- }),
144
- " ",
145
- "- ISO 8601 timestamps"
146
- ]
147
- }),
148
- /* @__PURE__ */ jsxs("li", {
149
- children: [
150
- "\u2022",
151
- " ",
152
- /* @__PURE__ */ jsx("code", {
153
- className: "rounded bg-background/50 px-2 py-1",
154
- children: "ScalarTypeEnum.Email()"
155
- }),
156
- " ",
157
- "- Valid email addresses"
158
- ]
159
- }),
160
- /* @__PURE__ */ jsxs("li", {
161
- children: [
162
- "\u2022",
163
- " ",
164
- /* @__PURE__ */ jsx("code", {
165
- className: "rounded bg-background/50 px-2 py-1",
166
- children: "defineEnum(...)"
167
- }),
168
- " ",
169
- "- Type-safe enums"
170
- ]
171
- })
172
- ]
173
- })
174
- ]
175
- }),
176
- /* @__PURE__ */ jsx("div", {
177
- className: "flex items-center gap-4 pt-4",
178
- children: /* @__PURE__ */ jsxs(Link, {
179
- href: "/docs/specs/dataviews",
180
- className: "btn-primary",
181
- children: [
182
- "Next: DataViews ",
183
- /* @__PURE__ */ jsx(ChevronRight, {
184
- size: 16
185
- })
186
- ]
187
- })
188
- })
189
- ]
190
- })
191
- ]
192
- });
193
- }
194
-
195
- // src/components/docs/specs/SpecsDataViewsPage.tsx
196
- import Link2 from "@contractspec/lib.ui-link";
197
- import { ChevronRight as ChevronRight2 } from "lucide-react";
198
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
199
- function SpecsDataViewsPage() {
200
- return /* @__PURE__ */ jsxs2("div", {
201
- className: "space-y-8",
202
- children: [
203
- /* @__PURE__ */ jsxs2("div", {
204
- className: "space-y-4",
205
- children: [
206
- /* @__PURE__ */ jsx2("h1", {
207
- className: "font-bold text-4xl",
208
- children: "DataViews"
209
- }),
210
- /* @__PURE__ */ jsxs2("p", {
211
- className: "text-muted-foreground",
212
- children: [
213
- "A ",
214
- /* @__PURE__ */ jsx2("strong", {
215
- children: "DataViewSpec"
216
- }),
217
- " describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."
218
- ]
219
- })
220
- ]
221
- }),
222
- /* @__PURE__ */ jsxs2("div", {
223
- className: "space-y-4",
224
- children: [
225
- /* @__PURE__ */ jsx2("h2", {
226
- className: "font-bold text-2xl",
227
- children: "Core concepts"
228
- }),
229
- /* @__PURE__ */ jsxs2("div", {
230
- className: "space-y-3",
231
- children: [
232
- /* @__PURE__ */ jsxs2("div", {
233
- children: [
234
- /* @__PURE__ */ jsx2("h3", {
235
- className: "font-semibold text-lg",
236
- children: "Data sources"
237
- }),
238
- /* @__PURE__ */ jsx2("p", {
239
- className: "text-muted-foreground",
240
- children: "A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."
241
- })
242
- ]
243
- }),
244
- /* @__PURE__ */ jsxs2("div", {
245
- children: [
246
- /* @__PURE__ */ jsx2("h3", {
247
- className: "font-semibold text-lg",
248
- children: "Filtering"
249
- }),
250
- /* @__PURE__ */ jsx2("p", {
251
- className: "text-muted-foreground",
252
- children: `Define filters that users can apply to narrow down results. Filters can be simple (e.g., "status equals 'active'") or complex (e.g., "created within the last 30 days AND assigned to current user").`
253
- })
254
- ]
255
- }),
256
- /* @__PURE__ */ jsxs2("div", {
257
- children: [
258
- /* @__PURE__ */ jsx2("h3", {
259
- className: "font-semibold text-lg",
260
- children: "Sorting"
261
- }),
262
- /* @__PURE__ */ jsx2("p", {
263
- className: "text-muted-foreground",
264
- children: "Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."
265
- })
266
- ]
267
- }),
268
- /* @__PURE__ */ jsxs2("div", {
269
- children: [
270
- /* @__PURE__ */ jsx2("h3", {
271
- className: "font-semibold text-lg",
272
- children: "Pagination"
273
- }),
274
- /* @__PURE__ */ jsx2("p", {
275
- className: "text-muted-foreground",
276
- children: "DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."
277
- })
278
- ]
279
- }),
280
- /* @__PURE__ */ jsxs2("div", {
281
- children: [
282
- /* @__PURE__ */ jsx2("h3", {
283
- className: "font-semibold text-lg",
284
- children: "Aggregations"
285
- }),
286
- /* @__PURE__ */ jsx2("p", {
287
- className: "text-muted-foreground",
288
- children: "Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."
289
- })
290
- ]
291
- })
292
- ]
293
- })
294
- ]
295
- }),
296
- /* @__PURE__ */ jsxs2("div", {
297
- className: "space-y-4",
298
- children: [
299
- /* @__PURE__ */ jsx2("h2", {
300
- className: "font-bold text-2xl",
301
- children: "Example DataViewSpec"
302
- }),
303
- /* @__PURE__ */ jsx2("p", {
304
- className: "text-muted-foreground",
305
- children: "Here's a DataView for listing orders in TypeScript:"
306
- }),
307
- /* @__PURE__ */ jsx2("div", {
308
- className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
309
- children: /* @__PURE__ */ jsx2("pre", {
310
- children: `import { defineDataView } from '@contractspec/lib.contracts-spec';
72
+ });`})})]}),v("div",{className:"space-y-3",children:[g("h2",{className:"font-bold text-2xl",children:"Schema Types"}),v("p",{className:"text-muted-foreground",children:["ContractSpec uses ",g("code",{children:"@contractspec/lib.schema"})," for I/O definitions. This provides Zod validation, GraphQL types, and JSON Schema from a single source."]}),v("ul",{className:"space-y-2 text-muted-foreground",children:[v("li",{children:["\u2022"," ",g("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.NonEmptyString()"})," ","- Non-empty text"]}),v("li",{children:["\u2022"," ",g("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.PositiveNumber()"})," ","- Positive numbers"]}),v("li",{children:["\u2022"," ",g("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.DateTime()"})," ","- ISO 8601 timestamps"]}),v("li",{children:["\u2022"," ",g("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.Email()"})," ","- Valid email addresses"]}),v("li",{children:["\u2022"," ",g("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum(...)"})," ","- Type-safe enums"]})]})]}),g("div",{className:"flex items-center gap-4 pt-4",children:v(M,{href:"/docs/specs/dataviews",className:"btn-primary",children:["Next: DataViews ",g(R,{size:16})]})})]})]})}import{CodeBlock as U}from"@contractspec/lib.design-system";import B from"@contractspec/lib.ui-link";import{jsx as s,jsxs as y}from"react/jsx-runtime";var E=[{title:"ContextPack",body:"Projects the current repo state, impacted contracts, canon packs, policy bindings, and acceptance checks into one task-scoped envelope."},{title:"PlanPacket",body:"Compiles a candidate objective into ACP-aware steps plus explicit refs back to control-plane intent, plan compile, and plan verify contracts."},{title:"PatchVerdict",body:"Classifies one file edit or shell command as permit, rewrite, require_review, or deny, with runtime-linked control-plane state when available."},{title:"ReviewPacket",body:"Persists the evidence a human needs when Connect escalates, while keeping the local artifact trail authoritative in OSS mode."}],q=["Enable `connect` in `.contractsrc.json` and keep your protected, immutable, generated, and smoke-check policies explicit.","Run `contractspec connect context` and `contractspec connect plan` before risky work so the agent is operating on task-scoped evidence, not ambient repo assumptions.","Gate file and shell mutations through `contractspec connect verify` or the host hook commands instead of inventing editor-specific approval logic.","Inspect pending review packets locally first, then sync them to the Studio bridge only if your team wants centralized operator workflows.","Use replay and harness evaluation to prove whether a prior decision stayed safe when the workspace changed."],G=["Connect is not a second control plane or a second package family.","Verdicts are projections over existing `controlPlane.*`, ACP, workspace, and harness primitives.","Studio is optional for baseline enforcement. Local artifacts remain the OSS source of truth.","Destructive commands, protected paths, drift, and unknown impact stay visible instead of being hidden behind adapter magic."];function H(){return y("div",{className:"space-y-10",children:[y("section",{className:"space-y-3",children:[s("p",{className:"editorial-kicker",children:"Spec pack"}),s("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"ContractSpec Connect puts coding-agent actions behind explicit, local-first governance."}),s("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"Connect is the adapter layer between agent-native actions and the existing ContractSpec stack. It reuses control-plane, ACP, workspace, knowledge, and harness primitives to explain what the agent is trying to do before a file edit or shell command lands."})]}),y("section",{className:"editorial-proof-strip",children:[y("div",{className:"editorial-stat",children:[s("span",{className:"editorial-label",children:"Authoritative surfaces"}),s("span",{className:"editorial-stat-value",children:"control plane, ACP, workspace, harness"})]}),s("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Connect stays narrow on purpose. It projects local evidence, maps its verdicts back to runtime semantics, and leaves the canonical system contracts where they already live."})]}),y("section",{className:"editorial-panel space-y-5",children:[y("div",{className:"space-y-2",children:[s("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What you use in practice"}),s("p",{className:"text-muted-foreground text-sm leading-7",children:"The CLI and the workspace service already implement the pack. The main workflow is local initialization, task projection, verification, then optional review sync."})]}),s(U,{language:"bash",filename:"contractspec-connect",code:`contractspec connect init --scope workspace
73
+ contractspec connect context --task refactor-docs --paths packages/libs/contracts-spec/src/control-plane/contracts.ts --json
74
+ printf '{"objective":"Document the control-plane contract surface","commands":["bun run typecheck"]}' | contractspec connect plan --task refactor-docs --stdin --json
75
+ printf '{"operation":"edit","path":"packages/libs/contracts-spec/src/control-plane/contracts.ts"}' | contractspec connect verify --task refactor-docs --tool acp.fs.access --stdin --json
76
+ printf 'bun run typecheck' | contractspec connect verify --task refactor-docs --tool acp.terminal.exec --stdin --json
77
+ contractspec connect review list --json
78
+ contractspec connect replay <decisionId> --json`})]}),y("section",{className:"space-y-5",children:[y("div",{className:"space-y-2",children:[s("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"The four core artifacts"}),s("p",{className:"text-muted-foreground text-sm leading-7",children:"Every Connect command is there to emit or inspect one of these reviewable objects under `.contractspec/connect/*`."})]}),s("div",{className:"grid gap-4 md:grid-cols-2",children:E.map((c)=>y("article",{className:"editorial-panel space-y-3",children:[s("h3",{className:"font-semibold text-xl",children:c.title}),s("p",{className:"text-muted-foreground text-sm leading-7",children:c.body})]},c.title))})]}),y("section",{className:"grid gap-5 lg:grid-cols-2",children:[y("article",{className:"editorial-panel space-y-4",children:[s("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adopt Connect in this order"}),s("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:q.map((c)=>s("li",{children:c},c))})]}),y("article",{className:"editorial-panel space-y-4",children:[s("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Boundaries that keep it trustworthy"}),s("ul",{className:"editorial-list",children:G.map((c)=>y("li",{children:[s("span",{className:"editorial-list-marker"}),s("span",{children:c})]},c))})]})]}),y("section",{className:"editorial-panel space-y-4",children:[s("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Where Connect fits in the rest of the docs"}),s("p",{className:"text-muted-foreground text-sm leading-7",children:"Read the control-plane runtime page when you want the underlying governance contracts, then use the Studio bridge only if your team wants centralized review queues on top of the OSS-local evidence path."}),y("div",{className:"flex flex-wrap gap-3",children:[s(B,{href:"/docs/architecture/control-plane",className:"btn-primary",children:"Control-plane runtime"}),s(B,{href:"/docs/studio",className:"btn-ghost",children:"Studio bridge"})]})]})]})}import N from"@contractspec/lib.ui-link";import{ChevronRight as V}from"lucide-react";import{jsx as r,jsxs as m}from"react/jsx-runtime";function _(){return m("div",{className:"space-y-8",children:[m("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"DataViews"}),m("p",{className:"text-muted-foreground",children:["A ",r("strong",{children:"DataViewSpec"})," describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."]})]}),m("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Core concepts"}),m("div",{className:"space-y-3",children:[m("div",{children:[r("h3",{className:"font-semibold text-lg",children:"Data sources"}),r("p",{className:"text-muted-foreground",children:"A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."})]}),m("div",{children:[r("h3",{className:"font-semibold text-lg",children:"Filtering"}),r("p",{className:"text-muted-foreground",children:`Define filters that users can apply to narrow down results. Filters can be simple (e.g., "status equals 'active'") or complex (e.g., "created within the last 30 days AND assigned to current user").`})]}),m("div",{children:[r("h3",{className:"font-semibold text-lg",children:"Sorting"}),r("p",{className:"text-muted-foreground",children:"Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."})]}),m("div",{children:[r("h3",{className:"font-semibold text-lg",children:"Pagination"}),r("p",{className:"text-muted-foreground",children:"DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."})]}),m("div",{children:[r("h3",{className:"font-semibold text-lg",children:"Aggregations"}),r("p",{className:"text-muted-foreground",children:"Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."})]})]})]}),m("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Example DataViewSpec"}),r("p",{className:"text-muted-foreground",children:"Here's a DataView for listing orders in TypeScript:"}),r("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:r("pre",{children:`import { defineDataView } from '@contractspec/lib.contracts-spec';
311
79
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
312
80
 
313
81
  export const OrderList = defineDataView({
@@ -347,277 +115,72 @@ export const OrderList = defineDataView({
347
115
  defaultPageSize: 50,
348
116
  maxPageSize: 200,
349
117
  },
350
- });`
351
- })
352
- })
353
- ]
354
- }),
355
- /* @__PURE__ */ jsxs2("div", {
356
- className: "space-y-4",
357
- children: [
358
- /* @__PURE__ */ jsx2("h2", {
359
- className: "font-bold text-2xl",
360
- children: "Policy integration"
361
- }),
362
- /* @__PURE__ */ jsxs2("p", {
363
- className: "text-muted-foreground",
364
- children: [
365
- "DataViews automatically enforce",
366
- " ",
367
- /* @__PURE__ */ jsx2(Link2, {
368
- href: "/docs/specs/policy",
369
- className: "text-violet-400 hover:text-violet-300",
370
- children: "PolicySpecs"
371
- }),
372
- ". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."
373
- ]
374
- }),
375
- /* @__PURE__ */ jsx2("p", {
376
- className: "text-muted-foreground",
377
- children: "This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."
378
- })
379
- ]
380
- }),
381
- /* @__PURE__ */ jsxs2("div", {
382
- className: "space-y-4",
383
- children: [
384
- /* @__PURE__ */ jsx2("h2", {
385
- className: "font-bold text-2xl",
386
- children: "Served outputs"
387
- }),
388
- /* @__PURE__ */ jsx2("p", {
389
- className: "text-muted-foreground",
390
- children: "From a DataViewSpec, ContractSpec serves:"
391
- }),
392
- /* @__PURE__ */ jsxs2("ul", {
393
- className: "list-inside list-disc space-y-2 text-muted-foreground",
394
- children: [
395
- /* @__PURE__ */ jsxs2("li", {
396
- children: [
397
- /* @__PURE__ */ jsx2("strong", {
398
- children: "Database queries"
399
- }),
400
- " \u2013 Optimized SQL or NoSQL queries executed at runtime"
401
- ]
402
- }),
403
- /* @__PURE__ */ jsxs2("li", {
404
- children: [
405
- /* @__PURE__ */ jsx2("strong", {
406
- children: "API endpoints"
407
- }),
408
- " \u2013 RESTful or GraphQL endpoints for fetching data"
409
- ]
410
- }),
411
- /* @__PURE__ */ jsxs2("li", {
412
- children: [
413
- /* @__PURE__ */ jsx2("strong", {
414
- children: "UI components"
415
- }),
416
- " \u2013 List views, tables, cards, and detail views"
417
- ]
418
- }),
419
- /* @__PURE__ */ jsxs2("li", {
420
- children: [
421
- /* @__PURE__ */ jsx2("strong", {
422
- children: "Search interfaces"
423
- }),
424
- " \u2013 Full-text search with autocomplete"
425
- ]
426
- }),
427
- /* @__PURE__ */ jsxs2("li", {
428
- children: [
429
- /* @__PURE__ */ jsx2("strong", {
430
- children: "Export functions"
431
- }),
432
- " \u2013 CSV, JSON, or Excel exports"
433
- ]
434
- })
435
- ]
436
- })
437
- ]
438
- }),
439
- /* @__PURE__ */ jsxs2("div", {
440
- className: "space-y-4",
441
- children: [
442
- /* @__PURE__ */ jsx2("h2", {
443
- className: "font-bold text-2xl",
444
- children: "Best practices"
445
- }),
446
- /* @__PURE__ */ jsxs2("ul", {
447
- className: "list-inside list-disc space-y-2 text-muted-foreground",
448
- children: [
449
- /* @__PURE__ */ jsx2("li", {
450
- children: "Only expose fields that users actually need\u2014this improves performance and security."
451
- }),
452
- /* @__PURE__ */ jsx2("li", {
453
- children: "Use appropriate indexes for sortable and filterable fields."
454
- }),
455
- /* @__PURE__ */ jsx2("li", {
456
- children: "Set reasonable pagination limits to prevent performance issues."
457
- }),
458
- /* @__PURE__ */ jsx2("li", {
459
- children: "Use aggregations sparingly\u2014they can be expensive on large datasets."
460
- }),
461
- /* @__PURE__ */ jsx2("li", {
462
- children: "Test DataViews with realistic data volumes to ensure they perform well."
463
- })
464
- ]
465
- })
466
- ]
467
- }),
468
- /* @__PURE__ */ jsxs2("div", {
469
- className: "flex items-center gap-4 pt-4",
470
- children: [
471
- /* @__PURE__ */ jsx2(Link2, {
472
- href: "/docs/specs/capabilities",
473
- className: "btn-ghost",
474
- children: "Previous: Capabilities"
475
- }),
476
- /* @__PURE__ */ jsxs2(Link2, {
477
- href: "/docs/specs/workflows",
478
- className: "btn-primary",
479
- children: [
480
- "Next: Workflows ",
481
- /* @__PURE__ */ jsx2(ChevronRight2, {
482
- size: 16
483
- })
484
- ]
485
- })
486
- ]
487
- })
488
- ]
489
- });
490
- }
118
+ });`})})]}),m("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Policy integration"}),m("p",{className:"text-muted-foreground",children:["DataViews automatically enforce"," ",r(N,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."]}),r("p",{className:"text-muted-foreground",children:"This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."})]}),m("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Served outputs"}),r("p",{className:"text-muted-foreground",children:"From a DataViewSpec, ContractSpec serves:"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[m("li",{children:[r("strong",{children:"Database queries"})," \u2013 Optimized SQL or NoSQL queries executed at runtime"]}),m("li",{children:[r("strong",{children:"API endpoints"})," \u2013 RESTful or GraphQL endpoints for fetching data"]}),m("li",{children:[r("strong",{children:"UI components"})," \u2013 List views, tables, cards, and detail views"]}),m("li",{children:[r("strong",{children:"Search interfaces"})," \u2013 Full-text search with autocomplete"]}),m("li",{children:[r("strong",{children:"Export functions"})," \u2013 CSV, JSON, or Excel exports"]})]})]}),m("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Best practices"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[r("li",{children:"Only expose fields that users actually need\u2014this improves performance and security."}),r("li",{children:"Use appropriate indexes for sortable and filterable fields."}),r("li",{children:"Set reasonable pagination limits to prevent performance issues."}),r("li",{children:"Use aggregations sparingly\u2014they can be expensive on large datasets."}),r("li",{children:"Test DataViews with realistic data volumes to ensure they perform well."})]})]}),m("div",{className:"flex items-center gap-4 pt-4",children:[r(N,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),m(N,{href:"/docs/specs/workflows",className:"btn-primary",children:["Next: Workflows ",r(V,{size:16})]})]})]})}import{CodeBlock as C}from"@contractspec/lib.design-system";import I from"@contractspec/lib.ui-link";import{jsx as l,jsxs as h}from"react/jsx-runtime";var K=["declared routes, surfaces, layouts, slots, actions, and data recipes","entity registries and field renderers for relation-heavy workbenches","preference-aware adaptation across guidance, density, data depth, control, media, pace, and narrative","auditable overlays and bounded AI patch proposals instead of free-form JSX generation"],Y=["Define one `ModuleBundleSpec` with `defineModuleBundle` and keep the route and surface map explicit.","Resolve the bundle with `resolveBundle` for a real user, route, device, and preference profile.","Render the plan through `BundleProvider` and `BundleRenderer` so the UI stays downstream of the resolved spec.","Add overlays, policy hooks, planner proposals, and telemetry only after the base route resolves cleanly.","Pilot one dense domain first, such as a PM or operations workbench, before expanding the abstraction across the app."];function F(){return h("div",{className:"space-y-10",children:[h("section",{className:"space-y-3",children:[l("p",{className:"editorial-kicker",children:"Spec pack"}),l("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Module bundles turn surface composition into a typed ContractSpec runtime instead of a pile of bespoke page code."}),h("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented package is"," ",l("code",{children:"@contractspec/lib.surface-runtime"}),". It lets you define a bundle spec once, resolve it into a personalized surface plan, then render that plan through React without letting AI or per-route custom code bypass the declared system boundary."]})]}),h("section",{className:"editorial-proof-strip",children:[h("div",{className:"editorial-stat",children:[l("span",{className:"editorial-label",children:"Runtime promise"}),l("span",{className:"editorial-stat-value",children:"bundle spec \u2192 resolved surface plan"})]}),l("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"The bundle spec owns what can render, where it can render, which preferences matter, and how overlays and AI proposals stay bounded."})]}),l("section",{className:"grid gap-4 md:grid-cols-2",children:K.map((c)=>h("article",{className:"editorial-panel space-y-3",children:[l("h2",{className:"font-semibold text-xl",children:"Bundle capability"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:c})]},c))}),h("section",{className:"editorial-panel space-y-5",children:[h("div",{className:"space-y-2",children:[l("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"1) Define the bundle"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:"Start with a typed route and one surface. The runtime validates that you declared routes, surfaces, and verification coverage for all seven preference dimensions."})]}),l(C,{language:"typescript",filename:"support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
491
119
 
492
- // src/components/docs/specs/SpecsOverlaysPage.tsx
493
- import Link3 from "@contractspec/lib.ui-link";
494
- import { ChevronRight as ChevronRight3 } from "lucide-react";
495
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
496
- function SpecsOverlaysPage() {
497
- return /* @__PURE__ */ jsxs3("div", {
498
- className: "space-y-8",
499
- children: [
500
- /* @__PURE__ */ jsxs3("div", {
501
- className: "space-y-4",
502
- children: [
503
- /* @__PURE__ */ jsx3("h1", {
504
- className: "font-bold text-4xl",
505
- children: "Overlays"
506
- }),
507
- /* @__PURE__ */ jsxs3("p", {
508
- className: "text-muted-foreground",
509
- children: [
510
- "An ",
511
- /* @__PURE__ */ jsx3("strong", {
512
- children: "OverlaySpec"
513
- }),
514
- " allows tenants or users to customize UI layouts and field visibility without modifying the underlying application code. Overlays are cryptographically signed to ensure they respect policy boundaries and cannot introduce security vulnerabilities."
515
- ]
516
- })
517
- ]
518
- }),
519
- /* @__PURE__ */ jsxs3("div", {
520
- className: "space-y-4",
521
- children: [
522
- /* @__PURE__ */ jsx3("h2", {
523
- className: "font-bold text-2xl",
524
- children: "Why overlays matter"
525
- }),
526
- /* @__PURE__ */ jsx3("p", {
527
- className: "text-muted-foreground",
528
- children: "Different users have different needs. A power user might want to see all available fields and actions, while a casual user prefers a simplified interface. A tenant in a multi-tenant application might want to brand the UI or hide features they don't use."
529
- }),
530
- /* @__PURE__ */ jsx3("p", {
531
- className: "text-muted-foreground",
532
- children: "Traditional approaches require either building multiple UIs or adding complex configuration logic throughout the codebase. OverlaySpecs provide a safer, more maintainable solution: users can customize their experience, but only within the bounds allowed by the underlying specs and policies."
533
- })
534
- ]
535
- }),
536
- /* @__PURE__ */ jsxs3("div", {
537
- className: "space-y-4",
538
- children: [
539
- /* @__PURE__ */ jsx3("h2", {
540
- className: "font-bold text-2xl",
541
- children: "What overlays can do"
542
- }),
543
- /* @__PURE__ */ jsxs3("ul", {
544
- className: "list-inside list-disc space-y-2 text-muted-foreground",
545
- children: [
546
- /* @__PURE__ */ jsxs3("li", {
547
- children: [
548
- /* @__PURE__ */ jsx3("strong", {
549
- children: "Hide or show fields"
550
- }),
551
- " \u2013 Remove fields from forms or detail views (but only if the user has permission to see them in the first place)"
552
- ]
553
- }),
554
- /* @__PURE__ */ jsxs3("li", {
555
- children: [
556
- /* @__PURE__ */ jsx3("strong", {
557
- children: "Reorder fields"
558
- }),
559
- " \u2013 Change the order in which fields appear"
560
- ]
561
- }),
562
- /* @__PURE__ */ jsxs3("li", {
563
- children: [
564
- /* @__PURE__ */ jsx3("strong", {
565
- children: "Rename labels"
566
- }),
567
- " \u2013 Use different terminology that's more familiar to the user"
568
- ]
569
- }),
570
- /* @__PURE__ */ jsxs3("li", {
571
- children: [
572
- /* @__PURE__ */ jsx3("strong", {
573
- children: "Change layouts"
574
- }),
575
- " \u2013 Switch between list, grid, or card views"
576
- ]
577
- }),
578
- /* @__PURE__ */ jsxs3("li", {
579
- children: [
580
- /* @__PURE__ */ jsx3("strong", {
581
- children: "Add help text"
582
- }),
583
- " \u2013 Provide context-specific guidance"
584
- ]
585
- }),
586
- /* @__PURE__ */ jsxs3("li", {
587
- children: [
588
- /* @__PURE__ */ jsx3("strong", {
589
- children: "Set default values"
590
- }),
591
- " \u2013 Pre-fill forms with tenant-specific defaults"
592
- ]
593
- }),
594
- /* @__PURE__ */ jsxs3("li", {
595
- children: [
596
- /* @__PURE__ */ jsx3("strong", {
597
- children: "Apply branding"
598
- }),
599
- " \u2013 Customize colors, logos, and styling (within approved themes)"
600
- ]
601
- })
602
- ]
603
- })
604
- ]
605
- }),
606
- /* @__PURE__ */ jsxs3("div", {
607
- className: "space-y-4",
608
- children: [
609
- /* @__PURE__ */ jsx3("h2", {
610
- className: "font-bold text-2xl",
611
- children: "Example OverlaySpec"
612
- }),
613
- /* @__PURE__ */ jsx3("p", {
614
- className: "text-muted-foreground",
615
- children: "Here's an overlay that customizes an order form:"
616
- }),
617
- /* @__PURE__ */ jsx3("div", {
618
- className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
619
- children: /* @__PURE__ */ jsx3("pre", {
620
- children: `overlayId: acme-order-form
120
+ export const SupportWorkbenchBundle = defineModuleBundle({
121
+ meta: {
122
+ key: "support.workbench",
123
+ version: "0.1.0",
124
+ title: "Support Workbench",
125
+ },
126
+ routes: [
127
+ {
128
+ routeId: "support-ticket",
129
+ path: "/operate/support/tickets/:ticketId",
130
+ defaultSurface: "ticket-workbench",
131
+ },
132
+ ],
133
+ surfaces: {
134
+ "ticket-workbench": {
135
+ surfaceId: "ticket-workbench",
136
+ kind: "workbench",
137
+ slots: [{ slotId: "primary", role: "primary", accepts: ["entity-section"], cardinality: "many" }],
138
+ layouts: [{ layoutId: "balanced", title: "Balanced", root: { type: "slot", slotId: "primary" } }],
139
+ data: [{ recipeId: "ticket-core", source: { kind: "entity", entityType: "support.ticket" }, hydrateInto: "ticket" }],
140
+ verification: {
141
+ dimensions: {
142
+ guidance: "Surface can reveal walkthrough or inline help states.",
143
+ density: "Layout supports compact and balanced detail modes.",
144
+ dataDepth: "Resolver can hydrate summary or detailed ticket context.",
145
+ control: "Advanced actions stay policy-gated.",
146
+ media: "Surface supports text-first and hybrid assist modes.",
147
+ pace: "Transitions and confirmations adapt to operator pace.",
148
+ narrative: "Summary and evidence ordering stay explicit.",
149
+ },
150
+ },
151
+ },
152
+ },
153
+ });`})]}),h("section",{className:"editorial-panel space-y-5",children:[h("div",{className:"space-y-2",children:[l("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"2) Resolve and render the plan"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:"The app renders the resolved plan, not the raw spec. That keeps layout choice, data hydration, overlays, and AI proposals auditable."})]}),l(C,{language:"tsx",filename:"SurfaceHost.tsx",code:`import { BundleProvider, BundleRenderer } from "@contractspec/lib.surface-runtime/react";
154
+ import { resolveBundle } from "@contractspec/lib.surface-runtime/runtime/resolve-bundle";
155
+
156
+ const plan = await resolveBundle(SupportWorkbenchBundle, {
157
+ tenantId: "tenant_demo",
158
+ workspaceId: "workspace_ops",
159
+ actorId: "user_42",
160
+ route: "/operate/support/tickets/123",
161
+ params: { ticketId: "123" },
162
+ query: {},
163
+ device: "desktop",
164
+ locale: "en",
165
+ preferences: {
166
+ guidance: "hints",
167
+ density: "compact",
168
+ dataDepth: "detailed",
169
+ control: "advanced",
170
+ media: "hybrid",
171
+ pace: "balanced",
172
+ narrative: "top-down",
173
+ },
174
+ capabilities: ["tickets.read", "tickets.update"],
175
+ });
176
+
177
+ export function SurfaceHost() {
178
+ return (
179
+ <BundleProvider plan={plan}>
180
+ <BundleRenderer assistantSlotId="assistant" />
181
+ </BundleProvider>
182
+ );
183
+ }`})]}),h("section",{className:"grid gap-5 lg:grid-cols-2",children:[h("article",{className:"editorial-panel space-y-4",children:[l("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adoption loop"}),l("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:Y.map((c)=>l("li",{children:c},c))})]}),h("article",{className:"editorial-panel space-y-4",children:[l("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Guardrails that matter"}),h("ul",{className:"editorial-list",children:[h("li",{children:[l("span",{className:"editorial-list-marker"}),l("span",{children:"Do not stuff this behavior back into `lib.ui-kit`."})]}),h("li",{children:[l("span",{className:"editorial-list-marker"}),l("span",{children:"Do not let AI invent undeclared components or mutate raw DOM state."})]}),h("li",{children:[l("span",{className:"editorial-list-marker"}),l("span",{children:"Keep third-party UI libraries behind adapter subpaths only."})]}),h("li",{children:[l("span",{className:"editorial-list-marker"}),l("span",{children:"Every surface still needs explicit verification coverage for the seven preference dimensions."})]})]})]})]}),h("section",{className:"editorial-panel space-y-4",children:[l("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Continue with overlays and runtime architecture"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:"Once the bundle resolves deterministically, move into safe customization and the wider architecture that surrounds it."}),h("div",{className:"flex flex-wrap gap-3",children:[l(I,{href:"/docs/specs/overlays",className:"btn-primary",children:"Overlays"}),l(I,{href:"/docs/architecture",className:"btn-ghost",children:"Architecture overview"})]})]})]})}import b from"@contractspec/lib.ui-link";import{ChevronRight as J}from"lucide-react";import{jsx as t,jsxs as o}from"react/jsx-runtime";function X(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-4",children:[t("h1",{className:"font-bold text-4xl",children:"Overlays"}),o("p",{className:"text-muted-foreground",children:["An ",t("strong",{children:"OverlaySpec"})," allows tenants or users to customize UI layouts and field visibility without modifying the underlying application code. Overlays are cryptographically signed to ensure they respect policy boundaries and cannot introduce security vulnerabilities."]})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Why overlays matter"}),t("p",{className:"text-muted-foreground",children:"Different users have different needs. A power user might want to see all available fields and actions, while a casual user prefers a simplified interface. A tenant in a multi-tenant application might want to brand the UI or hide features they don't use."}),t("p",{className:"text-muted-foreground",children:"Traditional approaches require either building multiple UIs or adding complex configuration logic throughout the codebase. OverlaySpecs provide a safer, more maintainable solution: users can customize their experience, but only within the bounds allowed by the underlying specs and policies."})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"What overlays can do"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[t("strong",{children:"Hide or show fields"})," \u2013 Remove fields from forms or detail views (but only if the user has permission to see them in the first place)"]}),o("li",{children:[t("strong",{children:"Reorder fields"})," \u2013 Change the order in which fields appear"]}),o("li",{children:[t("strong",{children:"Rename labels"})," \u2013 Use different terminology that's more familiar to the user"]}),o("li",{children:[t("strong",{children:"Change layouts"})," \u2013 Switch between list, grid, or card views"]}),o("li",{children:[t("strong",{children:"Add help text"})," \u2013 Provide context-specific guidance"]}),o("li",{children:[t("strong",{children:"Set default values"})," \u2013 Pre-fill forms with tenant-specific defaults"]}),o("li",{children:[t("strong",{children:"Apply branding"})," \u2013 Customize colors, logos, and styling (within approved themes)"]})]})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Example OverlaySpec"}),t("p",{className:"text-muted-foreground",children:"Here's an overlay that customizes an order form:"}),t("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:t("pre",{children:`overlayId: acme-order-form
621
184
  version: '1.0.0'.0.0
622
185
  appliesTo:
623
186
  capability: createOrder
@@ -654,550 +217,7 @@ modifications:
654
217
  signature:
655
218
  algorithm: EdDSA
656
219
  publicKey: "acme-corp-overlay-key"
657
- signature: "base64-encoded-signature"`
658
- })
659
- })
660
- ]
661
- }),
662
- /* @__PURE__ */ jsxs3("div", {
663
- className: "space-y-4",
664
- children: [
665
- /* @__PURE__ */ jsx3("h2", {
666
- className: "font-bold text-2xl",
667
- children: "Safety guarantees"
668
- }),
669
- /* @__PURE__ */ jsx3("p", {
670
- className: "text-muted-foreground",
671
- children: "Overlays are powerful, but they must not compromise security or data integrity. ContractSpec enforces several guarantees:"
672
- }),
673
- /* @__PURE__ */ jsxs3("ul", {
674
- className: "list-inside list-disc space-y-2 text-muted-foreground",
675
- children: [
676
- /* @__PURE__ */ jsxs3("li", {
677
- children: [
678
- /* @__PURE__ */ jsx3("strong", {
679
- children: "Overlays cannot grant new permissions"
680
- }),
681
- " \u2013 They can only hide or rearrange what the user is already allowed to see"
682
- ]
683
- }),
684
- /* @__PURE__ */ jsxs3("li", {
685
- children: [
686
- /* @__PURE__ */ jsx3("strong", {
687
- children: "Overlays cannot bypass validation"
688
- }),
689
- " \u2013 Field types, constraints, and business rules from the underlying spec still apply"
690
- ]
691
- }),
692
- /* @__PURE__ */ jsxs3("li", {
693
- children: [
694
- /* @__PURE__ */ jsx3("strong", {
695
- children: "Overlays must be signed"
696
- }),
697
- " \u2013 Only authorized parties (typically tenant admins) can create overlays"
698
- ]
699
- }),
700
- /* @__PURE__ */ jsxs3("li", {
701
- children: [
702
- /* @__PURE__ */ jsx3("strong", {
703
- children: "Overlays are versioned"
704
- }),
705
- " \u2013 Changes to overlays are tracked and can be rolled back"
706
- ]
707
- }),
708
- /* @__PURE__ */ jsxs3("li", {
709
- children: [
710
- /* @__PURE__ */ jsx3("strong", {
711
- children: "Overlays are audited"
712
- }),
713
- " \u2013 Every overlay application is logged"
714
- ]
715
- })
716
- ]
717
- })
718
- ]
719
- }),
720
- /* @__PURE__ */ jsxs3("div", {
721
- className: "space-y-4",
722
- children: [
723
- /* @__PURE__ */ jsx3("h2", {
724
- className: "font-bold text-2xl",
725
- children: "Creating overlays"
726
- }),
727
- /* @__PURE__ */ jsx3("p", {
728
- className: "text-muted-foreground",
729
- children: "Overlays can be created through:"
730
- }),
731
- /* @__PURE__ */ jsxs3("ul", {
732
- className: "list-inside list-disc space-y-2 text-muted-foreground",
733
- children: [
734
- /* @__PURE__ */ jsxs3("li", {
735
- children: [
736
- /* @__PURE__ */ jsx3("strong", {
737
- children: "Visual editor"
738
- }),
739
- " \u2013 A drag-and-drop interface for non-technical users"
740
- ]
741
- }),
742
- /* @__PURE__ */ jsxs3("li", {
743
- children: [
744
- /* @__PURE__ */ jsx3("strong", {
745
- children: "TypeScript/JSON"
746
- }),
747
- " \u2013 For developers who prefer code"
748
- ]
749
- }),
750
- /* @__PURE__ */ jsxs3("li", {
751
- children: [
752
- /* @__PURE__ */ jsx3("strong", {
753
- children: "API"
754
- }),
755
- " \u2013 Programmatically create overlays for automation"
756
- ]
757
- })
758
- ]
759
- }),
760
- /* @__PURE__ */ jsx3("p", {
761
- className: "text-muted-foreground",
762
- children: "Once created, overlays must be signed using a private key. The corresponding public key is registered with ContractSpec, which verifies the signature before applying the overlay."
763
- }),
764
- /* @__PURE__ */ jsxs3("p", {
765
- className: "text-muted-foreground",
766
- children: [
767
- "See",
768
- " ",
769
- /* @__PURE__ */ jsx3(Link3, {
770
- href: "/docs/libraries/overlay-engine",
771
- className: "text-violet-400 underline",
772
- children: "Overlay Engine docs"
773
- }),
774
- " ",
775
- "and the",
776
- " ",
777
- /* @__PURE__ */ jsx3(Link3, {
778
- href: "/docs/advanced/overlay-editor",
779
- className: "text-violet-400 underline",
780
- children: "Overlay Editor guide"
781
- }),
782
- " ",
783
- "for end-to-end workflows."
784
- ]
785
- })
786
- ]
787
- }),
788
- /* @__PURE__ */ jsxs3("div", {
789
- className: "space-y-4",
790
- children: [
791
- /* @__PURE__ */ jsx3("h2", {
792
- className: "font-bold text-2xl",
793
- children: "Overlay scope"
794
- }),
795
- /* @__PURE__ */ jsx3("p", {
796
- className: "text-muted-foreground",
797
- children: "Overlays can be scoped to:"
798
- }),
799
- /* @__PURE__ */ jsxs3("ul", {
800
- className: "list-inside list-disc space-y-2 text-muted-foreground",
801
- children: [
802
- /* @__PURE__ */ jsxs3("li", {
803
- children: [
804
- /* @__PURE__ */ jsx3("strong", {
805
- children: "Tenant"
806
- }),
807
- " \u2013 All users in a tenant see the same overlay"
808
- ]
809
- }),
810
- /* @__PURE__ */ jsxs3("li", {
811
- children: [
812
- /* @__PURE__ */ jsx3("strong", {
813
- children: "User"
814
- }),
815
- " \u2013 Individual users can have personal overlays"
816
- ]
817
- }),
818
- /* @__PURE__ */ jsxs3("li", {
819
- children: [
820
- /* @__PURE__ */ jsx3("strong", {
821
- children: "Role"
822
- }),
823
- " \u2013 All users with a specific role see the overlay"
824
- ]
825
- }),
826
- /* @__PURE__ */ jsxs3("li", {
827
- children: [
828
- /* @__PURE__ */ jsx3("strong", {
829
- children: "Device"
830
- }),
831
- " \u2013 Different overlays for mobile vs desktop"
832
- ]
833
- })
834
- ]
835
- }),
836
- /* @__PURE__ */ jsx3("p", {
837
- className: "text-muted-foreground",
838
- children: "If multiple overlays apply to the same user, they are merged in order of specificity (user overlays override role overlays, which override tenant overlays)."
839
- })
840
- ]
841
- }),
842
- /* @__PURE__ */ jsxs3("div", {
843
- className: "space-y-4",
844
- children: [
845
- /* @__PURE__ */ jsx3("h2", {
846
- className: "font-bold text-2xl",
847
- children: "Best practices"
848
- }),
849
- /* @__PURE__ */ jsxs3("ul", {
850
- className: "list-inside list-disc space-y-2 text-muted-foreground",
851
- children: [
852
- /* @__PURE__ */ jsx3("li", {
853
- children: "Start with the default UI and only create overlays when users request specific changes."
854
- }),
855
- /* @__PURE__ */ jsx3("li", {
856
- children: "Document why each overlay modification was made\u2014this helps when reviewing or updating overlays."
857
- }),
858
- /* @__PURE__ */ jsx3("li", {
859
- children: "Test overlays thoroughly to ensure they don't break workflows or confuse users."
860
- }),
861
- /* @__PURE__ */ jsx3("li", {
862
- children: "Use tenant-level overlays for organizational customizations and user-level overlays for personal preferences."
863
- }),
864
- /* @__PURE__ */ jsx3("li", {
865
- children: "Regularly review overlays to remove ones that are no longer needed."
866
- }),
867
- /* @__PURE__ */ jsx3("li", {
868
- children: "Protect overlay signing keys carefully\u2014they control what customizations are allowed."
869
- })
870
- ]
871
- })
872
- ]
873
- }),
874
- /* @__PURE__ */ jsxs3("div", {
875
- className: "flex items-center gap-4 pt-4",
876
- children: [
877
- /* @__PURE__ */ jsx3(Link3, {
878
- href: "/docs/specs/policy",
879
- className: "btn-ghost",
880
- children: "Previous: Policy"
881
- }),
882
- /* @__PURE__ */ jsxs3(Link3, {
883
- href: "/docs/safety",
884
- className: "btn-primary",
885
- children: [
886
- "Next: Safety ",
887
- /* @__PURE__ */ jsx3(ChevronRight3, {
888
- size: 16
889
- })
890
- ]
891
- })
892
- ]
893
- })
894
- ]
895
- });
896
- }
897
-
898
- // src/components/docs/specs/SpecsOverviewPage.tsx
899
- import Link4 from "@contractspec/lib.ui-link";
900
- import { ChevronRight as ChevronRight4 } from "lucide-react";
901
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
902
- var specTypes = [
903
- {
904
- title: "Capabilities",
905
- body: "Model operations, events, and presentations as explicit system behavior.",
906
- href: "/docs/specs/capabilities"
907
- },
908
- {
909
- title: "Data views",
910
- body: "Describe query, filtering, and presentation behavior from the same source model.",
911
- href: "/docs/specs/dataviews"
912
- },
913
- {
914
- title: "Workflows",
915
- body: "Coordinate multi-step execution, retries, monitoring, and hand-offs.",
916
- href: "/docs/specs/workflows"
917
- },
918
- {
919
- title: "Policy",
920
- body: "Carry governance and access rules through every generated and runtime-served surface.",
921
- href: "/docs/specs/policy"
922
- },
923
- {
924
- title: "Overlays",
925
- body: "Customize generated surfaces safely instead of forking them permanently.",
926
- href: "/docs/specs/overlays"
927
- },
928
- {
929
- title: "Safety and migration",
930
- body: "Keep change safe with signing, audits, rollbacks, and explicit migration behavior.",
931
- href: "/docs/safety"
932
- }
933
- ];
934
- function SpecsOverviewPage() {
935
- return /* @__PURE__ */ jsxs4("div", {
936
- className: "space-y-10",
937
- children: [
938
- /* @__PURE__ */ jsxs4("div", {
939
- className: "space-y-3",
940
- children: [
941
- /* @__PURE__ */ jsx4("p", {
942
- className: "editorial-kicker",
943
- children: "Core model"
944
- }),
945
- /* @__PURE__ */ jsx4("h1", {
946
- className: "font-serif text-4xl tracking-[-0.04em] md:text-5xl",
947
- children: "Contracts are the durable system boundary."
948
- }),
949
- /* @__PURE__ */ jsx4("p", {
950
- className: "max-w-3xl text-lg text-muted-foreground leading-8",
951
- children: "ContractSpec uses explicit TypeScript specs to describe behavior before it spreads across APIs, UI, data models, events, and operator flows. The goal is not to hide implementation. The goal is to make the system boundary explicit enough that generation, validation, runtime enforcement, and regeneration can stay coherent."
952
- })
953
- ]
954
- }),
955
- /* @__PURE__ */ jsxs4("div", {
956
- className: "editorial-proof-strip",
957
- children: [
958
- /* @__PURE__ */ jsxs4("div", {
959
- className: "editorial-stat",
960
- children: [
961
- /* @__PURE__ */ jsx4("span", {
962
- className: "editorial-label",
963
- children: "System promise"
964
- }),
965
- /* @__PURE__ */ jsx4("span", {
966
- className: "editorial-stat-value",
967
- children: "one contract \u2192 many surfaces"
968
- })
969
- ]
970
- }),
971
- /* @__PURE__ */ jsx4("p", {
972
- className: "max-w-2xl text-muted-foreground text-sm leading-7",
973
- children: "Use the contract layer to keep surface behavior aligned, then let runtimes and generators do the repetitive work without inventing a closed platform."
974
- })
975
- ]
976
- }),
977
- /* @__PURE__ */ jsx4("section", {
978
- className: "editorial-panel space-y-5",
979
- children: /* @__PURE__ */ jsxs4("div", {
980
- className: "space-y-2",
981
- children: [
982
- /* @__PURE__ */ jsx4("h2", {
983
- className: "font-serif text-3xl tracking-[-0.03em]",
984
- children: "What the contract layer owns"
985
- }),
986
- /* @__PURE__ */ jsxs4("ul", {
987
- className: "editorial-list",
988
- children: [
989
- /* @__PURE__ */ jsxs4("li", {
990
- children: [
991
- /* @__PURE__ */ jsx4("span", {
992
- className: "editorial-list-marker"
993
- }),
994
- /* @__PURE__ */ jsx4("span", {
995
- children: "Behavior: operations, events, presentations, workflows."
996
- })
997
- ]
998
- }),
999
- /* @__PURE__ */ jsxs4("li", {
1000
- children: [
1001
- /* @__PURE__ */ jsx4("span", {
1002
- className: "editorial-list-marker"
1003
- }),
1004
- /* @__PURE__ */ jsx4("span", {
1005
- children: "Validation: input, output, and schema boundaries."
1006
- })
1007
- ]
1008
- }),
1009
- /* @__PURE__ */ jsxs4("li", {
1010
- children: [
1011
- /* @__PURE__ */ jsx4("span", {
1012
- className: "editorial-list-marker"
1013
- }),
1014
- /* @__PURE__ */ jsx4("span", {
1015
- children: "Governance: policy, auditability, and migration rules."
1016
- })
1017
- ]
1018
- }),
1019
- /* @__PURE__ */ jsxs4("li", {
1020
- children: [
1021
- /* @__PURE__ */ jsx4("span", {
1022
- className: "editorial-list-marker"
1023
- }),
1024
- /* @__PURE__ */ jsx4("span", {
1025
- children: "Surface alignment: generated or served behavior across API, UI, data, and agent-facing interfaces."
1026
- })
1027
- ]
1028
- })
1029
- ]
1030
- })
1031
- ]
1032
- })
1033
- }),
1034
- /* @__PURE__ */ jsxs4("section", {
1035
- className: "space-y-5",
1036
- children: [
1037
- /* @__PURE__ */ jsxs4("div", {
1038
- className: "space-y-2",
1039
- children: [
1040
- /* @__PURE__ */ jsx4("h2", {
1041
- className: "font-serif text-3xl tracking-[-0.03em]",
1042
- children: "Specification types"
1043
- }),
1044
- /* @__PURE__ */ jsx4("p", {
1045
- className: "text-muted-foreground text-sm leading-7",
1046
- children: "You can adopt the model one part at a time. Not every system needs every spec type on day one."
1047
- })
1048
- ]
1049
- }),
1050
- /* @__PURE__ */ jsx4("div", {
1051
- className: "grid gap-4 md:grid-cols-2",
1052
- children: specTypes.map((item) => /* @__PURE__ */ jsxs4(Link4, {
1053
- href: item.href,
1054
- className: "editorial-panel",
1055
- children: [
1056
- /* @__PURE__ */ jsx4("h3", {
1057
- className: "font-semibold text-xl",
1058
- children: item.title
1059
- }),
1060
- /* @__PURE__ */ jsx4("p", {
1061
- className: "mt-2 text-muted-foreground text-sm leading-7",
1062
- children: item.body
1063
- }),
1064
- /* @__PURE__ */ jsxs4("div", {
1065
- className: "mt-4 flex items-center gap-2 text-[color:var(--rust)] text-sm",
1066
- children: [
1067
- "Open section ",
1068
- /* @__PURE__ */ jsx4(ChevronRight4, {
1069
- size: 14
1070
- })
1071
- ]
1072
- })
1073
- ]
1074
- }, item.title))
1075
- })
1076
- ]
1077
- })
1078
- ]
1079
- });
1080
- }
1081
-
1082
- // src/components/docs/specs/SpecsPolicyPage.tsx
1083
- import Link5 from "@contractspec/lib.ui-link";
1084
- import { ChevronRight as ChevronRight5 } from "lucide-react";
1085
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1086
- function SpecsPolicyPage() {
1087
- return /* @__PURE__ */ jsxs5("div", {
1088
- className: "space-y-8",
1089
- children: [
1090
- /* @__PURE__ */ jsxs5("div", {
1091
- className: "space-y-4",
1092
- children: [
1093
- /* @__PURE__ */ jsx5("h1", {
1094
- className: "font-bold text-4xl",
1095
- children: "Policy"
1096
- }),
1097
- /* @__PURE__ */ jsxs5("p", {
1098
- className: "text-muted-foreground",
1099
- children: [
1100
- "A ",
1101
- /* @__PURE__ */ jsx5("strong", {
1102
- children: "PolicySpec"
1103
- }),
1104
- " defines who can do what, when, and under what conditions. ContractSpec uses attribute-based access control (ABAC) to enforce policies across your entire application\u2014from API endpoints to UI components."
1105
- ]
1106
- })
1107
- ]
1108
- }),
1109
- /* @__PURE__ */ jsxs5("div", {
1110
- className: "space-y-4",
1111
- children: [
1112
- /* @__PURE__ */ jsx5("h2", {
1113
- className: "font-bold text-2xl",
1114
- children: "Why policies matter"
1115
- }),
1116
- /* @__PURE__ */ jsx5("p", {
1117
- className: "text-muted-foreground",
1118
- children: "Traditional access control relies on roles (RBAC), which can become unwieldy as applications grow. ABAC is more flexible\u2014it evaluates policies based on attributes of the user, resource, action, and context."
1119
- }),
1120
- /* @__PURE__ */ jsxs5("p", {
1121
- className: "text-muted-foreground",
1122
- children: [
1123
- "ContractSpec's policy engine ensures that access control is consistent across all surfaces. You don't have to remember to add authorization checks in every API endpoint or UI component\u2014the",
1124
- " ",
1125
- /* @__PURE__ */ jsx5(Link5, {
1126
- href: "/docs/safety/pdp",
1127
- className: "text-violet-400 hover:text-violet-300",
1128
- children: "Policy Decision Point"
1129
- }),
1130
- " ",
1131
- "enforces policies automatically."
1132
- ]
1133
- })
1134
- ]
1135
- }),
1136
- /* @__PURE__ */ jsxs5("div", {
1137
- className: "space-y-4",
1138
- children: [
1139
- /* @__PURE__ */ jsx5("h2", {
1140
- className: "font-bold text-2xl",
1141
- children: "Policy structure"
1142
- }),
1143
- /* @__PURE__ */ jsx5("p", {
1144
- className: "text-muted-foreground",
1145
- children: "A PolicySpec contains one or more rules. Each rule has:"
1146
- }),
1147
- /* @__PURE__ */ jsxs5("ul", {
1148
- className: "list-inside list-disc space-y-2 text-muted-foreground",
1149
- children: [
1150
- /* @__PURE__ */ jsxs5("li", {
1151
- children: [
1152
- /* @__PURE__ */ jsx5("strong", {
1153
- children: "Effect"
1154
- }),
1155
- " \u2013 PERMIT, DENY, or REDACT"
1156
- ]
1157
- }),
1158
- /* @__PURE__ */ jsxs5("li", {
1159
- children: [
1160
- /* @__PURE__ */ jsx5("strong", {
1161
- children: "Condition"
1162
- }),
1163
- " \u2013 A boolean expression that determines when the rule applies"
1164
- ]
1165
- }),
1166
- /* @__PURE__ */ jsxs5("li", {
1167
- children: [
1168
- /* @__PURE__ */ jsx5("strong", {
1169
- children: "Scope"
1170
- }),
1171
- " \u2013 Which resources, actions, or fields the rule applies to"
1172
- ]
1173
- }),
1174
- /* @__PURE__ */ jsxs5("li", {
1175
- children: [
1176
- /* @__PURE__ */ jsx5("strong", {
1177
- children: "Priority"
1178
- }),
1179
- " \u2013 Rules are evaluated in priority order; the first matching rule wins"
1180
- ]
1181
- })
1182
- ]
1183
- })
1184
- ]
1185
- }),
1186
- /* @__PURE__ */ jsxs5("div", {
1187
- className: "space-y-4",
1188
- children: [
1189
- /* @__PURE__ */ jsx5("h2", {
1190
- className: "font-bold text-2xl",
1191
- children: "Example PolicySpec"
1192
- }),
1193
- /* @__PURE__ */ jsx5("p", {
1194
- className: "text-muted-foreground",
1195
- children: "Here's a policy that controls access to customer data in TypeScript:"
1196
- }),
1197
- /* @__PURE__ */ jsx5("div", {
1198
- className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
1199
- children: /* @__PURE__ */ jsx5("pre", {
1200
- children: `import { definePolicy } from '@contractspec/lib.contracts-spec';
220
+ signature: "base64-encoded-signature"`})})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Safety guarantees"}),t("p",{className:"text-muted-foreground",children:"Overlays are powerful, but they must not compromise security or data integrity. ContractSpec enforces several guarantees:"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[t("strong",{children:"Overlays cannot grant new permissions"})," \u2013 They can only hide or rearrange what the user is already allowed to see"]}),o("li",{children:[t("strong",{children:"Overlays cannot bypass validation"})," \u2013 Field types, constraints, and business rules from the underlying spec still apply"]}),o("li",{children:[t("strong",{children:"Overlays must be signed"})," \u2013 Only authorized parties (typically tenant admins) can create overlays"]}),o("li",{children:[t("strong",{children:"Overlays are versioned"})," \u2013 Changes to overlays are tracked and can be rolled back"]}),o("li",{children:[t("strong",{children:"Overlays are audited"})," \u2013 Every overlay application is logged"]})]})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Creating overlays"}),t("p",{className:"text-muted-foreground",children:"Overlays can be created through:"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[t("strong",{children:"Visual editor"})," \u2013 A drag-and-drop interface for non-technical users"]}),o("li",{children:[t("strong",{children:"TypeScript/JSON"})," \u2013 For developers who prefer code"]}),o("li",{children:[t("strong",{children:"API"})," \u2013 Programmatically create overlays for automation"]})]}),t("p",{className:"text-muted-foreground",children:"Once created, overlays must be signed using a private key. The corresponding public key is registered with ContractSpec, which verifies the signature before applying the overlay."}),o("p",{className:"text-muted-foreground",children:["See"," ",t(b,{href:"/docs/libraries/overlay-engine",className:"text-violet-400 underline",children:"Overlay Engine docs"})," ","and the"," ",t(b,{href:"/docs/advanced/overlay-editor",className:"text-violet-400 underline",children:"Overlay Editor guide"})," ","for end-to-end workflows."]})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Overlay scope"}),t("p",{className:"text-muted-foreground",children:"Overlays can be scoped to:"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[t("strong",{children:"Tenant"})," \u2013 All users in a tenant see the same overlay"]}),o("li",{children:[t("strong",{children:"User"})," \u2013 Individual users can have personal overlays"]}),o("li",{children:[t("strong",{children:"Role"})," \u2013 All users with a specific role see the overlay"]}),o("li",{children:[t("strong",{children:"Device"})," \u2013 Different overlays for mobile vs desktop"]})]}),t("p",{className:"text-muted-foreground",children:"If multiple overlays apply to the same user, they are merged in order of specificity (user overlays override role overlays, which override tenant overlays)."})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Best practices"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:"Start with the default UI and only create overlays when users request specific changes."}),t("li",{children:"Document why each overlay modification was made\u2014this helps when reviewing or updating overlays."}),t("li",{children:"Test overlays thoroughly to ensure they don't break workflows or confuse users."}),t("li",{children:"Use tenant-level overlays for organizational customizations and user-level overlays for personal preferences."}),t("li",{children:"Regularly review overlays to remove ones that are no longer needed."}),t("li",{children:"Protect overlay signing keys carefully\u2014they control what customizations are allowed."})]})]}),o("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Where overlays fit in the runtime"}),t("p",{className:"text-muted-foreground",children:"Overlays are safest when they sit on top of a declared bundle surface instead of ad hoc page code. Use the module-bundles docs first, then apply overlays as auditable customization on top of the resolved surface plan."}),o("div",{className:"flex flex-wrap gap-3",children:[t(b,{href:"/docs/specs/module-bundles",className:"btn-primary",children:"Module bundles"}),t(b,{href:"/docs/guides/first-module-bundle",className:"btn-ghost",children:"Build a first module bundle"})]})]}),o("div",{className:"flex items-center gap-4 pt-4",children:[t(b,{href:"/docs/specs/policy",className:"btn-ghost",children:"Previous: Policy"}),o(b,{href:"/docs/safety",className:"btn-primary",children:["Next: Safety ",t(J,{size:16})]})]})]})}import A from"@contractspec/lib.ui-link";import{ChevronRight as T}from"lucide-react";import{jsx as p,jsxs as f}from"react/jsx-runtime";var Q=[{title:"Capabilities",body:"Model operations, events, and presentations as explicit system behavior.",href:"/docs/specs/capabilities"},{title:"Data views",body:"Describe query, filtering, and presentation behavior from the same source model.",href:"/docs/specs/dataviews"},{title:"Workflows",body:"Coordinate multi-step execution, retries, monitoring, and hand-offs.",href:"/docs/specs/workflows"},{title:"Policy",body:"Carry governance and access rules through every generated and runtime-served surface.",href:"/docs/specs/policy"},{title:"Overlays",body:"Customize generated surfaces safely instead of forking them permanently.",href:"/docs/specs/overlays"},{title:"Safety and migration",body:"Keep change safe with signing, audits, rollbacks, and explicit migration behavior.",href:"/docs/safety"}],Z=[{title:"Module bundles",body:"Define typed surface bundles that resolve into auditable runtime plans instead of hand-built page logic.",href:"/docs/specs/module-bundles"},{title:"ContractSpec Connect",body:"Put coding-agent edits and commands behind local-first context, verification, replay, and review artifacts.",href:"/docs/specs/connect"},{title:"Builder control plane",body:"Coordinate multimodal authoring, provider routing, readiness, export, and mobile review on top of OSS and Studio.",href:"/docs/specs/builder-control-plane"}];function $(){return f("div",{className:"space-y-10",children:[f("div",{className:"space-y-3",children:[p("p",{className:"editorial-kicker",children:"Core model"}),p("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Contracts are the durable system boundary."}),p("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec uses explicit TypeScript specs to describe behavior before it spreads across APIs, UI, data models, events, and operator flows. The goal is not to hide implementation. The goal is to make the system boundary explicit enough that generation, validation, runtime enforcement, and regeneration can stay coherent."})]}),f("div",{className:"editorial-proof-strip",children:[f("div",{className:"editorial-stat",children:[p("span",{className:"editorial-label",children:"System promise"}),p("span",{className:"editorial-stat-value",children:"one contract \u2192 many surfaces"})]}),p("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Use the contract layer to keep surface behavior aligned, then let runtimes and generators do the repetitive work without inventing a closed platform."})]}),p("section",{className:"editorial-panel space-y-5",children:f("div",{className:"space-y-2",children:[p("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What the contract layer owns"}),f("ul",{className:"editorial-list",children:[f("li",{children:[p("span",{className:"editorial-list-marker"}),p("span",{children:"Behavior: operations, events, presentations, workflows."})]}),f("li",{children:[p("span",{className:"editorial-list-marker"}),p("span",{children:"Validation: input, output, and schema boundaries."})]}),f("li",{children:[p("span",{className:"editorial-list-marker"}),p("span",{children:"Governance: policy, auditability, and migration rules."})]}),f("li",{children:[p("span",{className:"editorial-list-marker"}),p("span",{children:"Surface alignment: generated or served behavior across API, UI, data, and agent-facing interfaces."})]})]})]})}),f("section",{className:"space-y-5",children:[f("div",{className:"space-y-2",children:[p("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Specification types"}),p("p",{className:"text-muted-foreground text-sm leading-7",children:"You can adopt the model one part at a time. Not every system needs every spec type on day one."})]}),p("div",{className:"grid gap-4 md:grid-cols-2",children:Q.map((c)=>f(A,{href:c.href,className:"editorial-panel",children:[p("h3",{className:"font-semibold text-xl",children:c.title}),p("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:c.body}),f("div",{className:"mt-4 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Open section ",p(T,{size:14})]})]},c.title))})]}),f("section",{className:"space-y-5",children:[f("div",{className:"space-y-2",children:[p("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Implemented spec packs"}),p("p",{className:"text-muted-foreground text-sm leading-7",children:"These packs combine multiple contract surfaces into higher-order systems you can use directly today: agent enforcement, AI-native surface runtime, and governed Builder authoring."})]}),p("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:Z.map((c)=>f(A,{href:c.href,className:"editorial-panel",children:[p("h3",{className:"font-semibold text-xl",children:c.title}),p("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:c.body}),f("div",{className:"mt-4 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Open pack ",p(T,{size:14})]})]},c.title))})]})]})}import k from"@contractspec/lib.ui-link";import{ChevronRight as L}from"lucide-react";import{jsx as e,jsxs as i}from"react/jsx-runtime";function x(){return i("div",{className:"space-y-8",children:[i("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Policy"}),i("p",{className:"text-muted-foreground",children:["A ",e("strong",{children:"PolicySpec"})," defines who can do what, when, and under what conditions. ContractSpec uses attribute-based access control (ABAC) to enforce policies across your entire application\u2014from API endpoints to UI components."]})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Why policies matter"}),e("p",{className:"text-muted-foreground",children:"Traditional access control relies on roles (RBAC), which can become unwieldy as applications grow. ABAC is more flexible\u2014it evaluates policies based on attributes of the user, resource, action, and context."}),i("p",{className:"text-muted-foreground",children:["ContractSpec's policy engine ensures that access control is consistent across all surfaces. You don't have to remember to add authorization checks in every API endpoint or UI component\u2014the"," ",e(k,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"})," ","enforces policies automatically."]})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Policy structure"}),e("p",{className:"text-muted-foreground",children:"A PolicySpec contains one or more rules. Each rule has:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[e("strong",{children:"Effect"})," \u2013 PERMIT, DENY, or REDACT"]}),i("li",{children:[e("strong",{children:"Condition"})," \u2013 A boolean expression that determines when the rule applies"]}),i("li",{children:[e("strong",{children:"Scope"})," \u2013 Which resources, actions, or fields the rule applies to"]}),i("li",{children:[e("strong",{children:"Priority"})," \u2013 Rules are evaluated in priority order; the first matching rule wins"]})]})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Example PolicySpec"}),e("p",{className:"text-muted-foreground",children:"Here's a policy that controls access to customer data in TypeScript:"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`import { definePolicy } from '@contractspec/lib.contracts-spec';
1201
221
 
1202
222
  export const CustomerDataAccess = definePolicy({
1203
223
  meta: {
@@ -1239,181 +259,7 @@ export const CustomerDataAccess = definePolicy({
1239
259
  redactFields: ['creditCard', 'ssn', 'bankAccount'],
1240
260
  },
1241
261
  ],
1242
- });`
1243
- })
1244
- })
1245
- ]
1246
- }),
1247
- /* @__PURE__ */ jsxs5("div", {
1248
- className: "space-y-4",
1249
- children: [
1250
- /* @__PURE__ */ jsx5("h2", {
1251
- className: "font-bold text-2xl",
1252
- children: "Attributes"
1253
- }),
1254
- /* @__PURE__ */ jsx5("p", {
1255
- className: "text-muted-foreground",
1256
- children: "Policy conditions can reference attributes from four categories:"
1257
- }),
1258
- /* @__PURE__ */ jsxs5("div", {
1259
- className: "space-y-3",
1260
- children: [
1261
- /* @__PURE__ */ jsxs5("div", {
1262
- children: [
1263
- /* @__PURE__ */ jsx5("h3", {
1264
- className: "font-semibold text-lg",
1265
- children: "User attributes"
1266
- }),
1267
- /* @__PURE__ */ jsxs5("p", {
1268
- className: "text-muted-foreground",
1269
- children: [
1270
- /* @__PURE__ */ jsx5("code", {
1271
- className: "rounded bg-background/50 px-2 py-1",
1272
- children: "user.id"
1273
- }),
1274
- ",",
1275
- " ",
1276
- /* @__PURE__ */ jsx5("code", {
1277
- className: "rounded bg-background/50 px-2 py-1",
1278
- children: "user.role"
1279
- }),
1280
- ",",
1281
- " ",
1282
- /* @__PURE__ */ jsx5("code", {
1283
- className: "rounded bg-background/50 px-2 py-1",
1284
- children: "user.groups"
1285
- }),
1286
- ",",
1287
- " ",
1288
- /* @__PURE__ */ jsx5("code", {
1289
- className: "rounded bg-background/50 px-2 py-1",
1290
- children: "user.department"
1291
- }),
1292
- ", custom attributes"
1293
- ]
1294
- })
1295
- ]
1296
- }),
1297
- /* @__PURE__ */ jsxs5("div", {
1298
- children: [
1299
- /* @__PURE__ */ jsx5("h3", {
1300
- className: "font-semibold text-lg",
1301
- children: "Resource attributes"
1302
- }),
1303
- /* @__PURE__ */ jsxs5("p", {
1304
- className: "text-muted-foreground",
1305
- children: [
1306
- /* @__PURE__ */ jsx5("code", {
1307
- className: "rounded bg-background/50 px-2 py-1",
1308
- children: "resource.type"
1309
- }),
1310
- ",",
1311
- " ",
1312
- /* @__PURE__ */ jsx5("code", {
1313
- className: "rounded bg-background/50 px-2 py-1",
1314
- children: "resource.owner"
1315
- }),
1316
- ",",
1317
- " ",
1318
- /* @__PURE__ */ jsx5("code", {
1319
- className: "rounded bg-background/50 px-2 py-1",
1320
- children: "resource.sensitivity"
1321
- }),
1322
- ", custom attributes"
1323
- ]
1324
- })
1325
- ]
1326
- }),
1327
- /* @__PURE__ */ jsxs5("div", {
1328
- children: [
1329
- /* @__PURE__ */ jsx5("h3", {
1330
- className: "font-semibold text-lg",
1331
- children: "Action attributes"
1332
- }),
1333
- /* @__PURE__ */ jsxs5("p", {
1334
- className: "text-muted-foreground",
1335
- children: [
1336
- /* @__PURE__ */ jsx5("code", {
1337
- className: "rounded bg-background/50 px-2 py-1",
1338
- children: "action"
1339
- }),
1340
- " ",
1341
- "(read, write, delete, execute, export, etc.)"
1342
- ]
1343
- })
1344
- ]
1345
- }),
1346
- /* @__PURE__ */ jsxs5("div", {
1347
- children: [
1348
- /* @__PURE__ */ jsx5("h3", {
1349
- className: "font-semibold text-lg",
1350
- children: "Context attributes"
1351
- }),
1352
- /* @__PURE__ */ jsxs5("p", {
1353
- className: "text-muted-foreground",
1354
- children: [
1355
- /* @__PURE__ */ jsx5("code", {
1356
- className: "rounded bg-background/50 px-2 py-1",
1357
- children: "time.hour"
1358
- }),
1359
- ",",
1360
- " ",
1361
- /* @__PURE__ */ jsx5("code", {
1362
- className: "rounded bg-background/50 px-2 py-1",
1363
- children: "time.dayOfWeek"
1364
- }),
1365
- ",",
1366
- " ",
1367
- /* @__PURE__ */ jsx5("code", {
1368
- className: "rounded bg-background/50 px-2 py-1",
1369
- children: "request.ipAddress"
1370
- }),
1371
- ",",
1372
- " ",
1373
- /* @__PURE__ */ jsx5("code", {
1374
- className: "rounded bg-background/50 px-2 py-1",
1375
- children: "request.userAgent"
1376
- })
1377
- ]
1378
- })
1379
- ]
1380
- })
1381
- ]
1382
- })
1383
- ]
1384
- }),
1385
- /* @__PURE__ */ jsxs5("div", {
1386
- className: "space-y-4",
1387
- children: [
1388
- /* @__PURE__ */ jsx5("h2", {
1389
- className: "font-bold text-2xl",
1390
- children: "Data classification"
1391
- }),
1392
- /* @__PURE__ */ jsxs5("p", {
1393
- className: "text-muted-foreground",
1394
- children: [
1395
- "You can tag fields with sensitivity levels in your",
1396
- " ",
1397
- /* @__PURE__ */ jsx5(Link5, {
1398
- href: "/docs/specs/capabilities",
1399
- className: "text-violet-400 hover:text-violet-300",
1400
- children: "CapabilitySpecs"
1401
- }),
1402
- " ",
1403
- "and",
1404
- " ",
1405
- /* @__PURE__ */ jsx5(Link5, {
1406
- href: "/docs/specs/dataviews",
1407
- className: "text-violet-400 hover:text-violet-300",
1408
- children: "DataViewSpecs"
1409
- }),
1410
- ":"
1411
- ]
1412
- }),
1413
- /* @__PURE__ */ jsx5("div", {
1414
- className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
1415
- children: /* @__PURE__ */ jsx5("pre", {
1416
- children: `fields:
262
+ });`})})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Attributes"}),e("p",{className:"text-muted-foreground",children:"Policy conditions can reference attributes from four categories:"}),i("div",{className:"space-y-3",children:[i("div",{children:[e("h3",{className:"font-semibold text-lg",children:"User attributes"}),i("p",{className:"text-muted-foreground",children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"user.id"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"user.role"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"user.groups"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"user.department"}),", custom attributes"]})]}),i("div",{children:[e("h3",{className:"font-semibold text-lg",children:"Resource attributes"}),i("p",{className:"text-muted-foreground",children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"resource.type"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"resource.owner"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"resource.sensitivity"}),", custom attributes"]})]}),i("div",{children:[e("h3",{className:"font-semibold text-lg",children:"Action attributes"}),i("p",{className:"text-muted-foreground",children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"action"})," ","(read, write, delete, execute, export, etc.)"]})]}),i("div",{children:[e("h3",{className:"font-semibold text-lg",children:"Context attributes"}),i("p",{className:"text-muted-foreground",children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"time.hour"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"time.dayOfWeek"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"request.ipAddress"}),","," ",e("code",{className:"rounded bg-background/50 px-2 py-1",children:"request.userAgent"})]})]})]})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Data classification"}),i("p",{className:"text-muted-foreground",children:["You can tag fields with sensitivity levels in your"," ",e(k,{href:"/docs/specs/capabilities",className:"text-violet-400 hover:text-violet-300",children:"CapabilitySpecs"})," ","and"," ",e(k,{href:"/docs/specs/dataviews",className:"text-violet-400 hover:text-violet-300",children:"DataViewSpecs"}),":"]}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`fields:
1417
263
  - name: email
1418
264
  type: string
1419
265
  sensitivity: PII
@@ -1426,298 +272,7 @@ export const CustomerDataAccess = definePolicy({
1426
272
  sensitivity: PHI
1427
273
  - name: salary
1428
274
  type: number
1429
- sensitivity: confidential`
1430
- })
1431
- }),
1432
- /* @__PURE__ */ jsx5("p", {
1433
- className: "text-muted-foreground",
1434
- children: 'Policies can then reference these tags to enforce blanket rules like "support staff cannot see PII" or "PHI can only be accessed from approved IP addresses."'
1435
- })
1436
- ]
1437
- }),
1438
- /* @__PURE__ */ jsxs5("div", {
1439
- className: "space-y-4",
1440
- children: [
1441
- /* @__PURE__ */ jsx5("h2", {
1442
- className: "font-bold text-2xl",
1443
- children: "Testing policies"
1444
- }),
1445
- /* @__PURE__ */ jsx5("p", {
1446
- className: "text-muted-foreground",
1447
- children: "ContractSpec provides tools for testing policies before deployment:"
1448
- }),
1449
- /* @__PURE__ */ jsxs5("ul", {
1450
- className: "list-inside list-disc space-y-2 text-muted-foreground",
1451
- children: [
1452
- /* @__PURE__ */ jsxs5("li", {
1453
- children: [
1454
- /* @__PURE__ */ jsx5("strong", {
1455
- children: "Policy simulator"
1456
- }),
1457
- " \u2013 Test how policies evaluate for different users and scenarios"
1458
- ]
1459
- }),
1460
- /* @__PURE__ */ jsxs5("li", {
1461
- children: [
1462
- /* @__PURE__ */ jsx5("strong", {
1463
- children: "Coverage analysis"
1464
- }),
1465
- " \u2013 Identify resources or actions that aren't covered by any policy"
1466
- ]
1467
- }),
1468
- /* @__PURE__ */ jsxs5("li", {
1469
- children: [
1470
- /* @__PURE__ */ jsx5("strong", {
1471
- children: "Conflict detection"
1472
- }),
1473
- " \u2013 Find rules that might conflict or produce unexpected results"
1474
- ]
1475
- }),
1476
- /* @__PURE__ */ jsxs5("li", {
1477
- children: [
1478
- /* @__PURE__ */ jsx5("strong", {
1479
- children: "Audit mode"
1480
- }),
1481
- " \u2013 Run policies in audit-only mode to see what would be blocked without actually blocking it"
1482
- ]
1483
- })
1484
- ]
1485
- })
1486
- ]
1487
- }),
1488
- /* @__PURE__ */ jsxs5("div", {
1489
- className: "space-y-4",
1490
- children: [
1491
- /* @__PURE__ */ jsx5("h2", {
1492
- className: "font-bold text-2xl",
1493
- children: "Best practices"
1494
- }),
1495
- /* @__PURE__ */ jsxs5("ul", {
1496
- className: "list-inside list-disc space-y-2 text-muted-foreground",
1497
- children: [
1498
- /* @__PURE__ */ jsx5("li", {
1499
- children: "Start with a deny-by-default policy\u2014explicitly permit what should be allowed."
1500
- }),
1501
- /* @__PURE__ */ jsx5("li", {
1502
- children: "Use clear, descriptive rule IDs that explain what the rule does."
1503
- }),
1504
- /* @__PURE__ */ jsx5("li", {
1505
- children: "Set priorities carefully to ensure rules are evaluated in the right order."
1506
- }),
1507
- /* @__PURE__ */ jsx5("li", {
1508
- children: "Test policies thoroughly with realistic user scenarios before deploying."
1509
- }),
1510
- /* @__PURE__ */ jsxs5("li", {
1511
- children: [
1512
- "Monitor policy decisions in production using",
1513
- " ",
1514
- /* @__PURE__ */ jsx5(Link5, {
1515
- href: "/docs/safety/auditing",
1516
- className: "text-violet-400 hover:text-violet-300",
1517
- children: "audit logs"
1518
- }),
1519
- "."
1520
- ]
1521
- }),
1522
- /* @__PURE__ */ jsx5("li", {
1523
- children: "Review and update policies regularly as your application and requirements evolve."
1524
- })
1525
- ]
1526
- })
1527
- ]
1528
- }),
1529
- /* @__PURE__ */ jsxs5("div", {
1530
- className: "flex items-center gap-4 pt-4",
1531
- children: [
1532
- /* @__PURE__ */ jsx5(Link5, {
1533
- href: "/docs/specs/workflows",
1534
- className: "btn-ghost",
1535
- children: "Previous: Workflows"
1536
- }),
1537
- /* @__PURE__ */ jsxs5(Link5, {
1538
- href: "/docs/specs/overlays",
1539
- className: "btn-primary",
1540
- children: [
1541
- "Next: Overlays ",
1542
- /* @__PURE__ */ jsx5(ChevronRight5, {
1543
- size: 16
1544
- })
1545
- ]
1546
- })
1547
- ]
1548
- })
1549
- ]
1550
- });
1551
- }
1552
-
1553
- // src/components/docs/specs/SpecsWorkflowsPage.tsx
1554
- import Link6 from "@contractspec/lib.ui-link";
1555
- import { ChevronRight as ChevronRight6 } from "lucide-react";
1556
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1557
- function SpecsWorkflowsPage() {
1558
- return /* @__PURE__ */ jsxs6("div", {
1559
- className: "space-y-8",
1560
- children: [
1561
- /* @__PURE__ */ jsxs6("div", {
1562
- className: "space-y-4",
1563
- children: [
1564
- /* @__PURE__ */ jsx6("h1", {
1565
- className: "font-bold text-4xl",
1566
- children: "Workflows"
1567
- }),
1568
- /* @__PURE__ */ jsxs6("p", {
1569
- className: "text-muted-foreground",
1570
- children: [
1571
- "A ",
1572
- /* @__PURE__ */ jsx6("strong", {
1573
- children: "WorkflowSpec"
1574
- }),
1575
- " orchestrates multi-step processes. It defines the sequence of operations, handles failures with retries and compensation, and provides observability into long-running tasks."
1576
- ]
1577
- })
1578
- ]
1579
- }),
1580
- /* @__PURE__ */ jsxs6("div", {
1581
- className: "space-y-4",
1582
- children: [
1583
- /* @__PURE__ */ jsx6("h2", {
1584
- className: "font-bold text-2xl",
1585
- children: "Core concepts"
1586
- }),
1587
- /* @__PURE__ */ jsxs6("div", {
1588
- className: "space-y-3",
1589
- children: [
1590
- /* @__PURE__ */ jsxs6("div", {
1591
- children: [
1592
- /* @__PURE__ */ jsx6("h3", {
1593
- className: "font-semibold text-lg",
1594
- children: "Identifiers"
1595
- }),
1596
- /* @__PURE__ */ jsxs6("p", {
1597
- className: "text-muted-foreground",
1598
- children: [
1599
- "Each workflow has a unique",
1600
- " ",
1601
- /* @__PURE__ */ jsx6("code", {
1602
- className: "rounded bg-background/50 px-2 py-1",
1603
- children: "workflowId"
1604
- }),
1605
- " ",
1606
- "and a",
1607
- " ",
1608
- /* @__PURE__ */ jsx6("code", {
1609
- className: "rounded bg-background/50 px-2 py-1",
1610
- children: "version"
1611
- }),
1612
- ". This allows you to run multiple versions of the same workflow simultaneously during migrations or A/B tests."
1613
- ]
1614
- })
1615
- ]
1616
- }),
1617
- /* @__PURE__ */ jsxs6("div", {
1618
- children: [
1619
- /* @__PURE__ */ jsx6("h3", {
1620
- className: "font-semibold text-lg",
1621
- children: "Steps"
1622
- }),
1623
- /* @__PURE__ */ jsxs6("p", {
1624
- className: "text-muted-foreground",
1625
- children: [
1626
- "A workflow is composed of ",
1627
- /* @__PURE__ */ jsx6("strong", {
1628
- children: "steps"
1629
- }),
1630
- ". Each step invokes a",
1631
- " ",
1632
- /* @__PURE__ */ jsx6(Link6, {
1633
- href: "/docs/specs/capabilities",
1634
- className: "text-violet-400 hover:text-violet-300",
1635
- children: "CapabilitySpec"
1636
- }),
1637
- ", passes inputs, and receives outputs. Steps can run sequentially or in parallel."
1638
- ]
1639
- })
1640
- ]
1641
- }),
1642
- /* @__PURE__ */ jsxs6("div", {
1643
- children: [
1644
- /* @__PURE__ */ jsx6("h3", {
1645
- className: "font-semibold text-lg",
1646
- children: "Transitions"
1647
- }),
1648
- /* @__PURE__ */ jsxs6("p", {
1649
- className: "text-muted-foreground",
1650
- children: [
1651
- /* @__PURE__ */ jsx6("strong", {
1652
- children: "Transitions"
1653
- }),
1654
- ' define the flow between steps. They can be conditional (e.g., "if payment succeeds, go to step 3; otherwise, go to step 5") or unconditional.'
1655
- ]
1656
- })
1657
- ]
1658
- }),
1659
- /* @__PURE__ */ jsxs6("div", {
1660
- children: [
1661
- /* @__PURE__ */ jsx6("h3", {
1662
- className: "font-semibold text-lg",
1663
- children: "Retries"
1664
- }),
1665
- /* @__PURE__ */ jsx6("p", {
1666
- className: "text-muted-foreground",
1667
- children: "If a step fails, the workflow can retry it with exponential backoff. You specify the maximum number of retries and the backoff strategy in the spec."
1668
- })
1669
- ]
1670
- }),
1671
- /* @__PURE__ */ jsxs6("div", {
1672
- children: [
1673
- /* @__PURE__ */ jsx6("h3", {
1674
- className: "font-semibold text-lg",
1675
- children: "Compensation"
1676
- }),
1677
- /* @__PURE__ */ jsxs6("p", {
1678
- className: "text-muted-foreground",
1679
- children: [
1680
- "When a workflow fails partway through,",
1681
- " ",
1682
- /* @__PURE__ */ jsx6("strong", {
1683
- children: "compensation"
1684
- }),
1685
- " steps undo the effects of completed steps (e.g., refunding a payment, releasing a reservation). This ensures consistency even in failure scenarios."
1686
- ]
1687
- })
1688
- ]
1689
- }),
1690
- /* @__PURE__ */ jsxs6("div", {
1691
- children: [
1692
- /* @__PURE__ */ jsx6("h3", {
1693
- className: "font-semibold text-lg",
1694
- children: "SLAs"
1695
- }),
1696
- /* @__PURE__ */ jsx6("p", {
1697
- className: "text-muted-foreground",
1698
- children: "You can define Service Level Agreements (SLAs) for each step or the entire workflow. If a step exceeds its SLA, the system can trigger alerts or escalations."
1699
- })
1700
- ]
1701
- })
1702
- ]
1703
- })
1704
- ]
1705
- }),
1706
- /* @__PURE__ */ jsxs6("div", {
1707
- className: "space-y-4",
1708
- children: [
1709
- /* @__PURE__ */ jsx6("h2", {
1710
- className: "font-bold text-2xl",
1711
- children: "Example WorkflowSpec (TypeScript)"
1712
- }),
1713
- /* @__PURE__ */ jsx6("p", {
1714
- className: "text-muted-foreground",
1715
- children: "Here's a simplified example of a payment workflow in TypeScript:"
1716
- }),
1717
- /* @__PURE__ */ jsx6("div", {
1718
- className: "overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",
1719
- children: /* @__PURE__ */ jsx6("pre", {
1720
- children: `import { defineWorkflow } from '@contractspec/lib.contracts-spec/workflow';
275
+ sensitivity: confidential`})}),e("p",{className:"text-muted-foreground",children:'Policies can then reference these tags to enforce blanket rules like "support staff cannot see PII" or "PHI can only be accessed from approved IP addresses."'})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Testing policies"}),e("p",{className:"text-muted-foreground",children:"ContractSpec provides tools for testing policies before deployment:"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[i("li",{children:[e("strong",{children:"Policy simulator"})," \u2013 Test how policies evaluate for different users and scenarios"]}),i("li",{children:[e("strong",{children:"Coverage analysis"})," \u2013 Identify resources or actions that aren't covered by any policy"]}),i("li",{children:[e("strong",{children:"Conflict detection"})," \u2013 Find rules that might conflict or produce unexpected results"]}),i("li",{children:[e("strong",{children:"Audit mode"})," \u2013 Run policies in audit-only mode to see what would be blocked without actually blocking it"]})]})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Best practices"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Start with a deny-by-default policy\u2014explicitly permit what should be allowed."}),e("li",{children:"Use clear, descriptive rule IDs that explain what the rule does."}),e("li",{children:"Set priorities carefully to ensure rules are evaluated in the right order."}),e("li",{children:"Test policies thoroughly with realistic user scenarios before deploying."}),i("li",{children:["Monitor policy decisions in production using"," ",e(k,{href:"/docs/safety/auditing",className:"text-violet-400 hover:text-violet-300",children:"audit logs"}),"."]}),e("li",{children:"Review and update policies regularly as your application and requirements evolve."})]})]}),i("div",{className:"flex items-center gap-4 pt-4",children:[e(k,{href:"/docs/specs/workflows",className:"btn-ghost",children:"Previous: Workflows"}),i(k,{href:"/docs/specs/overlays",className:"btn-primary",children:["Next: Overlays ",e(L,{size:16})]})]})]})}import w from"@contractspec/lib.ui-link";import{ChevronRight as j}from"lucide-react";import{jsx as a,jsxs as d}from"react/jsx-runtime";function ee(){return d("div",{className:"space-y-8",children:[d("div",{className:"space-y-4",children:[a("h1",{className:"font-bold text-4xl",children:"Workflows"}),d("p",{className:"text-muted-foreground",children:["A ",a("strong",{children:"WorkflowSpec"})," orchestrates multi-step processes. It defines the sequence of operations, handles failures with retries and compensation, and provides observability into long-running tasks."]})]}),d("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Core concepts"}),d("div",{className:"space-y-3",children:[d("div",{children:[a("h3",{className:"font-semibold text-lg",children:"Identifiers"}),d("p",{className:"text-muted-foreground",children:["Each workflow has a unique"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"workflowId"})," ","and a"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"version"}),". This allows you to run multiple versions of the same workflow simultaneously during migrations or A/B tests."]})]}),d("div",{children:[a("h3",{className:"font-semibold text-lg",children:"Steps"}),d("p",{className:"text-muted-foreground",children:["A workflow is composed of ",a("strong",{children:"steps"}),". Each step invokes a"," ",a(w,{href:"/docs/specs/capabilities",className:"text-violet-400 hover:text-violet-300",children:"CapabilitySpec"}),", passes inputs, and receives outputs. Steps can run sequentially or in parallel."]})]}),d("div",{children:[a("h3",{className:"font-semibold text-lg",children:"Transitions"}),d("p",{className:"text-muted-foreground",children:[a("strong",{children:"Transitions"}),' define the flow between steps. They can be conditional (e.g., "if payment succeeds, go to step 3; otherwise, go to step 5") or unconditional.']})]}),d("div",{children:[a("h3",{className:"font-semibold text-lg",children:"Retries"}),a("p",{className:"text-muted-foreground",children:"If a step fails, the workflow can retry it with exponential backoff. You specify the maximum number of retries and the backoff strategy in the spec."})]}),d("div",{children:[a("h3",{className:"font-semibold text-lg",children:"Compensation"}),d("p",{className:"text-muted-foreground",children:["When a workflow fails partway through,"," ",a("strong",{children:"compensation"})," steps undo the effects of completed steps (e.g., refunding a payment, releasing a reservation). This ensures consistency even in failure scenarios."]})]}),d("div",{children:[a("h3",{className:"font-semibold text-lg",children:"SLAs"}),a("p",{className:"text-muted-foreground",children:"You can define Service Level Agreements (SLAs) for each step or the entire workflow. If a step exceeds its SLA, the system can trigger alerts or escalations."})]})]})]}),d("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Example WorkflowSpec (TypeScript)"}),a("p",{className:"text-muted-foreground",children:"Here's a simplified example of a payment workflow in TypeScript:"}),d("p",{className:"text-muted-foreground text-sm",children:["For Vercel Workflow and other VM-evaluated runtimes, author workflow specs from"," ",a("code",{className:"rounded bg-background/50 px-2 py-1",children:"@contractspec/lib.contracts-spec/workflow/spec"})," ","rather than the broad workflow barrel."]}),a("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:a("pre",{children:`import { defineWorkflow } from '@contractspec/lib.contracts-spec/workflow/spec';
1721
276
  import { ValidatePaymentMethod, ChargePayment, SendEmail } from './specs';
1722
277
 
1723
278
  export const PaymentFlow = defineWorkflow({
@@ -1769,152 +324,4 @@ export const PaymentFlow = defineWorkflow({
1769
324
  maxDuration: 30000, // milliseconds
1770
325
  alertOnBreach: true,
1771
326
  },
1772
- });`
1773
- })
1774
- })
1775
- ]
1776
- }),
1777
- /* @__PURE__ */ jsxs6("div", {
1778
- className: "space-y-4",
1779
- children: [
1780
- /* @__PURE__ */ jsx6("h2", {
1781
- className: "font-bold text-2xl",
1782
- children: "Triggers"
1783
- }),
1784
- /* @__PURE__ */ jsx6("p", {
1785
- className: "text-muted-foreground",
1786
- children: "Workflows can be triggered in several ways:"
1787
- }),
1788
- /* @__PURE__ */ jsxs6("ul", {
1789
- className: "list-inside list-disc space-y-2 text-muted-foreground",
1790
- children: [
1791
- /* @__PURE__ */ jsxs6("li", {
1792
- children: [
1793
- /* @__PURE__ */ jsx6("strong", {
1794
- children: "Manual invocation"
1795
- }),
1796
- " \u2013 A user or system calls the workflow via an API endpoint."
1797
- ]
1798
- }),
1799
- /* @__PURE__ */ jsxs6("li", {
1800
- children: [
1801
- /* @__PURE__ */ jsx6("strong", {
1802
- children: "Event-driven"
1803
- }),
1804
- " \u2013 The workflow starts automatically when a specific event occurs (e.g., a new order is created)."
1805
- ]
1806
- }),
1807
- /* @__PURE__ */ jsxs6("li", {
1808
- children: [
1809
- /* @__PURE__ */ jsx6("strong", {
1810
- children: "Scheduled"
1811
- }),
1812
- " \u2013 The workflow runs on a cron schedule (e.g., nightly batch processing)."
1813
- ]
1814
- }),
1815
- /* @__PURE__ */ jsxs6("li", {
1816
- children: [
1817
- /* @__PURE__ */ jsx6("strong", {
1818
- children: "Chained"
1819
- }),
1820
- " \u2013 One workflow can invoke another as a step."
1821
- ]
1822
- })
1823
- ]
1824
- })
1825
- ]
1826
- }),
1827
- /* @__PURE__ */ jsxs6("div", {
1828
- className: "space-y-4",
1829
- children: [
1830
- /* @__PURE__ */ jsx6("h2", {
1831
- className: "font-bold text-2xl",
1832
- children: "Monitoring and versioning"
1833
- }),
1834
- /* @__PURE__ */ jsx6("p", {
1835
- className: "text-muted-foreground",
1836
- children: "ContractSpec automatically instruments workflows with telemetry. You can view:"
1837
- }),
1838
- /* @__PURE__ */ jsxs6("ul", {
1839
- className: "list-inside list-disc space-y-2 text-muted-foreground",
1840
- children: [
1841
- /* @__PURE__ */ jsx6("li", {
1842
- children: "Real-time execution status for each step"
1843
- }),
1844
- /* @__PURE__ */ jsx6("li", {
1845
- children: "Historical run data and success/failure rates"
1846
- }),
1847
- /* @__PURE__ */ jsx6("li", {
1848
- children: "Latency distributions and SLA compliance"
1849
- }),
1850
- /* @__PURE__ */ jsx6("li", {
1851
- children: "Compensation events and retry attempts"
1852
- })
1853
- ]
1854
- }),
1855
- /* @__PURE__ */ jsx6("p", {
1856
- className: "text-muted-foreground",
1857
- children: "When you update a workflow, you increment its version. Running workflows continue on their original version, while new invocations use the latest version. This allows safe, zero-downtime deployments."
1858
- })
1859
- ]
1860
- }),
1861
- /* @__PURE__ */ jsxs6("div", {
1862
- className: "space-y-4",
1863
- children: [
1864
- /* @__PURE__ */ jsx6("h2", {
1865
- className: "font-bold text-2xl",
1866
- children: "Best practices"
1867
- }),
1868
- /* @__PURE__ */ jsxs6("ul", {
1869
- className: "list-inside list-disc space-y-2 text-muted-foreground",
1870
- children: [
1871
- /* @__PURE__ */ jsx6("li", {
1872
- children: "Keep steps idempotent \u2013 they should be safe to retry without side effects."
1873
- }),
1874
- /* @__PURE__ */ jsx6("li", {
1875
- children: "Define compensation for any step that modifies external state."
1876
- }),
1877
- /* @__PURE__ */ jsx6("li", {
1878
- children: "Use meaningful step IDs that describe the operation."
1879
- }),
1880
- /* @__PURE__ */ jsx6("li", {
1881
- children: "Set realistic SLAs and monitor them in production."
1882
- }),
1883
- /* @__PURE__ */ jsx6("li", {
1884
- children: "Test failure scenarios locally before deploying."
1885
- })
1886
- ]
1887
- })
1888
- ]
1889
- }),
1890
- /* @__PURE__ */ jsxs6("div", {
1891
- className: "flex items-center gap-4 pt-4",
1892
- children: [
1893
- /* @__PURE__ */ jsx6(Link6, {
1894
- href: "/docs/specs/capabilities",
1895
- className: "btn-ghost",
1896
- children: "Previous: Capabilities"
1897
- }),
1898
- /* @__PURE__ */ jsxs6(Link6, {
1899
- href: "/docs/safety",
1900
- className: "btn-primary",
1901
- children: [
1902
- "Next: Safety Features ",
1903
- /* @__PURE__ */ jsx6(ChevronRight6, {
1904
- size: 16
1905
- })
1906
- ]
1907
- })
1908
- ]
1909
- })
1910
- ]
1911
- });
1912
- }
1913
- export {
1914
- SpecsWorkflowsPage,
1915
- SpecsPolicyPage,
1916
- SpecsOverviewPage,
1917
- SpecsOverlaysPage,
1918
- SpecsDataViewsPage,
1919
- SpecsCapabilitiesPage
1920
- };
327
+ });`})})]}),d("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Triggers"}),a("p",{className:"text-muted-foreground",children:"Workflows can be triggered in several ways:"}),d("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[d("li",{children:[a("strong",{children:"Manual invocation"})," \u2013 A user or system calls the workflow via an API endpoint."]}),d("li",{children:[a("strong",{children:"Event-driven"})," \u2013 The workflow starts automatically when a specific event occurs (e.g., a new order is created)."]}),d("li",{children:[a("strong",{children:"Scheduled"})," \u2013 The workflow runs on a cron schedule (e.g., nightly batch processing)."]}),d("li",{children:[a("strong",{children:"Chained"})," \u2013 One workflow can invoke another as a step."]})]})]}),d("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Monitoring and versioning"}),a("p",{className:"text-muted-foreground",children:"ContractSpec automatically instruments workflows with telemetry. You can view:"}),d("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:"Real-time execution status for each step"}),a("li",{children:"Historical run data and success/failure rates"}),a("li",{children:"Latency distributions and SLA compliance"}),a("li",{children:"Compensation events and retry attempts"})]}),a("p",{className:"text-muted-foreground",children:"When you update a workflow, you increment its version. Running workflows continue on their original version, while new invocations use the latest version. This allows safe, zero-downtime deployments."})]}),d("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Best practices"}),d("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:"Keep steps idempotent \u2013 they should be safe to retry without side effects."}),a("li",{children:"Define compensation for any step that modifies external state."}),a("li",{children:"Use meaningful step IDs that describe the operation."}),a("li",{children:"Set realistic SLAs and monitor them in production."}),a("li",{children:"Test failure scenarios locally before deploying."})]})]}),d("div",{className:"flex items-center gap-4 pt-4",children:[a(w,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),d(w,{href:"/docs/safety",className:"btn-primary",children:["Next: Safety Features ",a(j,{size:16})]})]})]})}export{ee as SpecsWorkflowsPage,x as SpecsPolicyPage,$ as SpecsOverviewPage,X as SpecsOverlaysPage,F as SpecsModuleBundlesPage,_ as SpecsDataViewsPage,H as SpecsConnectPage,z as SpecsCapabilitiesPage,W as SpecsBuilderControlPlanePage};